* test(#3576): gate shipped reference citations on the canonical resolvable form Failing-first gate for #3576: a backticked bare references/<name>.md cite resolves from no install location (agents, workflows, and references all install where a bare relative references/ path is dead). The gate walks the runtime-loaded trees the issue prescribes, strips @~/ include tokens PER-TOKEN (a line-skip guard would miss a bare cite sharing a line with an include — the issue-named trap), pins the genuinely relative ../ href and canonical forms as non-offenders, and checks canonical cite targets exist. 43 offenders today across 19 files. * fix(#3576): repair all 43 dead references/ cites to the canonical resolvable form Every backticked bare references/<name>.md cite across the 19 shipped files rewritten to gsd-core/references/<name>.md — the form every required_reading block and @~/ include already uses, and the only form that resolves from any install location. All 20 cited targets verified to exist; the one genuinely relative href (plan-phase.md's ../references/mvp-concepts.md) is untouched (the repair is backtick-anchored). Growth acks: new fragment for the three first-time paths, #3206-pattern appends to the five fragments already naming the other grown files (two ack sources may never name the same path). execute-phase.md lands at 93,391/93,400 and gsd-executor.md at 49,150/49,152 — exactly the issue's projections; every repair fits. * fix(#3576): drop stale default.md growth ack (nested modes file is hash-attributed, not growth-ratcheted) Review finding: the emitted-attribution ratchet covers only top-level workflows/ + agents/ files; discuss-phase/modes/default.md's delta is source-attributed, so acknowledging its growth is a stale entry the differential lane fails on. * chore(#3576): add changeset fragment * chore(#3576): backfill changeset pr number --------- Co-authored-by: sim <sim@local>
6.1 KiB
6.1 KiB
Universal Anti-Patterns
Rules that apply to ALL workflows and agents. Individual workflows may have additional specific anti-patterns.
Context Budget Rules
- Never read agent definition files (
agents/*.md) --subagent_typeauto-loads them. Reading agent definitions into the orchestrator wastes context for content automatically injected into subagent sessions. - Never inline large files into subagent prompts -- tell agents to read files from disk instead. Agents have their own context windows.
- Read depth scales with context window -- check
context_windowin.planning/config.json. At < 500000: read only frontmatter, status fields, or summaries. At >= 500000 (1M model): full body reads permitted when content is needed for inline decisions. Seegsd-core/references/context-budget.mdfor the complete table. - Delegate heavy work to subagents -- the orchestrator routes, it does not build, analyze, research, investigate, or verify.
- Proactive pause warning: If you have already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider checkpointing progress."
File Reading Rules
- SUMMARY.md read depth scales with context window -- at context_window < 500000: read frontmatter only from prior phase SUMMARYs. At >= 500000: full body reads permitted for direct-dependency phases. Transitive dependencies (2+ phases back) remain frontmatter-only regardless.
- Never read full PLAN.md files from other phases -- only current phase plans.
- Never read
.planning/logs/files -- only the health workflow reads these. - Do not re-read full file contents when frontmatter is sufficient -- frontmatter contains status, key_files, commits, and provides fields. Exception: at >= 500000, re-reading full body is acceptable when semantic content is needed.
Subagent Rules
- NEVER use non-GSD agent types (
general-purpose,Explore,Plan,Bash,feature-dev, etc.) -- ALWAYS usesubagent_type: "gsd-{agent}"(e.g.,gsd-phase-researcher,gsd-executor,gsd-planner). GSD agents have project-aware prompts, audit logging, and workflow context. Generic agents bypass all of this. - Do not re-litigate decisions that are already locked in CONTEXT.md (or PROJECT.md ## Context section) -- respect locked decisions unconditionally.
Questioning Anti-Patterns
Reference: gsd-core/references/questioning.md for the full anti-pattern list.
- Do not walk through checklists -- checklist walking (asking items one by one from a list) is the #1 anti-pattern. Instead, use progressive depth: start broad, dig where interesting.
- Do not use corporate speak -- avoid jargon like "stakeholder alignment", "synergize", "deliverables". Use plain language.
- Do not apply premature constraints -- don't narrow the solution space before understanding the problem. Ask about the problem first, then constrain.
State Management Anti-Patterns
- No direct Write/Edit to STATE.md or ROADMAP.md for mutations. Always use
gsd-tools queryfor registered state/roadmap handlers (e.g.state.update,state.advance-plan,roadmap.update-plan-progress), or legacynode …/gsd-tools.cjsfor CLI-only commands. Direct Write tool usage bypasses safe update logic and is unsafe in multi-session environments. Exception: first-time creation of STATE.md from template is allowed.
Behavioral Rules
- Do not create artifacts the user did not approve -- always confirm before writing new planning documents.
- Do not modify files outside the workflow's stated scope -- check the plan's files_modified list.
- Do not suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
- Do not use
git add .orgit add -A-- stage specific files only. - Do not include sensitive information (API keys, passwords, tokens) in planning documents or commits.
Error Recovery Rules
- Git lock detection: Before any git operation, if it fails with "Unable to create lock file", check for stale
.git/index.lockand advise the user to remove it (do not remove automatically). - Config fallback awareness: Config loading returns
nullsilently on invalid JSON. If your workflow depends on config values, check for null and warn the user: "config.json is invalid or missing -- running with defaults." - Partial state recovery: If STATE.md references a phase directory that doesn't exist, do not proceed silently. Warn the user and suggest diagnosing the mismatch.
GSD-Specific Rules
- Do not check for
mode === 'auto'ormode === 'autonomous'-- GSD usesyoloconfig flag. Checkyolo: truefor autonomous mode, absence orfalsefor interactive mode. - Prefer
gsd-tools queryfor orchestration when a handler exists; when shelling out to the legacy CLI, usegsd-tools.cjs(notgsd-tools.jsor any other filename) — GSD ships the programmatic API as CommonJS for Node.js CLI compatibility. - Plan files MUST follow
{padded_phase}-{NN}-PLAN.mdpattern (e.g.,01-01-PLAN.md). Never usePLAN-01.md,plan-01.md, or any other variation -- gsd-tools detection depends on this exact pattern. - Do not start executing the next plan before writing the SUMMARY.md for the current plan -- downstream plans may reference it via
@includes.
iOS / Apple Platform Rules
- NEVER use
Package.swift+.executableTarget(or.target) as the primary build system for iOS apps. SPM executable targets produce macOS CLI binaries, not iOS.appbundles. They cannot be installed on iOS devices or submitted to the App Store. Use XcodeGen (project.yml+xcodegen generate) to create a proper.xcodeproj. Seegsd-core/references/ios-scaffold.mdfor the full pattern. - Verify SwiftUI API availability before use. Many SwiftUI APIs require a specific minimum iOS version (e.g.,
NavigationSplitViewis iOS 16+,List(selection:)with multi-select and@Observablerequire iOS 17). If a plan uses an API that exceeds the declaredIPHONEOS_DEPLOYMENT_TARGET, raise the deployment target or add#availableguards.