Files
msd-core/get-shit-done/references/universal-anti-patterns.md
Tom Boucher 0fbe1d899e chore(#191): retire the gsd-sdk shim — route everything at gsd-tools (#522)
* chore(#191): migrate gsd-sdk query call sites to gsd-tools query

Retiring the gsd-sdk shim. gsd-tools.cjs already accepts `query` as a
meta-prefix (gsd-tools query <command>), so this is a behavior-preserving 1:1
swap across the runtime reference prompts, the graphify hook's commit-detection
gate, and two bin/lib comment/message references.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#191): remove vestigial gsd-sdk shim code from installer + projection

The gsd-sdk shim was already not wired up (no gsd-sdk bin in package.json;
buildWindowsShimTriple had zero call sites). Remove the dead code:
- shell-command-projection.cjs: buildWindowsShimTriple + formatSdkPathDiagnostic
  (+ their now-unused PACKAGE_NAME import) and exports
- install.js: the re-export wrappers + imports, the #3406 stale-standalone-sdk
  detection (detectStaleStandaloneSdk/formatStaleStandaloneSdkWarning + its
  global-install call site), and the exports

Preserved (retained, not gsd-sdk): buildCodexHookWindowsShimIR (#3426) — only
its comments referenced the gsd-sdk pattern; reworded. Also kept the
homePathCoveredByRc 'reopen your shell' branch in maybeSuggestPathExport — its
logic is bin-dir-agnostic, only the message mentioned gsd-sdk; reworded to use
the actual bin dir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(#191): update tests for retired gsd-sdk shim

- bug-3441/bug-3442: drop the formatSdkPathDiagnostic / buildWindowsShimTriple
  assertions (functions removed); retained PATH-action + drift-guard tests stay
- bug-505: remove the 'still exported' assertions for detectStaleStandaloneSdk /
  formatStaleStandaloneSdkWarning / the shim contract surface (#505 kept them;
  #191 removes them)
- graphify-auto-update: migrate the hook-dispatch inputs gsd-sdk query commit ->
  gsd-tools query commit to match the migrated commit hook

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(#191): point active docs at gsd-tools query (gsd-sdk shim retired)

Update the user/agent-facing docs (AGENTS, COMMANDS, CONFIGURATION, USER-GUIDE,
ship-pr-body-sections) that presented gsd-sdk query as a current command to
gsd-tools query. Historical docs (ADRs, PRDs, release notes) left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(#191): correct state.load vs state.json description for gsd-tools query

Adversarial-review (codex) finding: the migrated USER-GUIDE line claimed both
'gsd-tools query state.json' and 'state.load' resolve to the frontmatter-rebuild
handler. Verified they don't — state.load returns the CJS load shape
(config + state_raw + flags), state.json returns the frontmatter shape. Both are
available via gsd-tools query; corrected the text to say so.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#191): add changeset for gsd-sdk shim retirement

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 19:19:14 -04:00

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

  1. Never read agent definition files (agents/*.md) -- subagent_type auto-loads them. Reading agent definitions into the orchestrator wastes context for content automatically injected into subagent sessions.
  2. Never inline large files into subagent prompts -- tell agents to read files from disk instead. Agents have their own context windows.
  3. Read depth scales with context window -- check context_window in .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. See references/context-budget.md for the complete table.
  4. Delegate heavy work to subagents -- the orchestrator routes, it does not build, analyze, research, investigate, or verify.
  5. 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

  1. 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.
  2. Never read full PLAN.md files from other phases -- only current phase plans.
  3. Never read .planning/logs/ files -- only the health workflow reads these.
  4. 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

  1. NEVER use non-GSD agent types (general-purpose, Explore, Plan, Bash, feature-dev, etc.) -- ALWAYS use subagent_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.
  2. 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: references/questioning.md for the full anti-pattern list.

  1. 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.
  2. Do not use corporate speak -- avoid jargon like "stakeholder alignment", "synergize", "deliverables". Use plain language.
  3. 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

  1. No direct Write/Edit to STATE.md or ROADMAP.md for mutations. Always use gsd-tools query for registered state/roadmap handlers (e.g. state.update, state.advance-plan, roadmap.update-plan-progress), or legacy node …/gsd-tools.cjs for 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

  1. Do not create artifacts the user did not approve -- always confirm before writing new planning documents.
  2. Do not modify files outside the workflow's stated scope -- check the plan's files_modified list.
  3. Do not suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
  4. Do not use git add . or git add -A -- stage specific files only.
  5. Do not include sensitive information (API keys, passwords, tokens) in planning documents or commits.

Error Recovery Rules

  1. Git lock detection: Before any git operation, if it fails with "Unable to create lock file", check for stale .git/index.lock and advise the user to remove it (do not remove automatically).
  2. Config fallback awareness: Config loading returns null silently 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."
  3. 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

  1. Do not check for mode === 'auto' or mode === 'autonomous' -- GSD uses yolo config flag. Check yolo: true for autonomous mode, absence or false for interactive mode.
  2. Prefer gsd-tools query for orchestration when a handler exists; when shelling out to the legacy CLI, use gsd-tools.cjs (not gsd-tools.js or any other filename) — GSD ships the programmatic API as CommonJS for Node.js CLI compatibility.
  3. Plan files MUST follow {padded_phase}-{NN}-PLAN.md pattern (e.g., 01-01-PLAN.md). Never use PLAN-01.md, plan-01.md, or any other variation -- gsd-tools detection depends on this exact pattern.
  4. 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

  1. NEVER use Package.swift + .executableTarget (or .target) as the primary build system for iOS apps. SPM executable targets produce macOS CLI binaries, not iOS .app bundles. They cannot be installed on iOS devices or submitted to the App Store. Use XcodeGen (project.yml + xcodegen generate) to create a proper .xcodeproj. See references/ios-scaffold.md for the full pattern.
  2. Verify SwiftUI API availability before use. Many SwiftUI APIs require a specific minimum iOS version (e.g., NavigationSplitView is iOS 16+, List(selection:) with multi-select and @Observable require iOS 17). If a plan uses an API that exceeds the declared IPHONEOS_DEPLOYMENT_TARGET, raise the deployment target or add #available guards.