@bhargavvc/sdd-cc 1.30.1 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja-JP.md +144 -110
- package/README.ko-KR.md +143 -107
- package/README.md +183 -112
- package/README.pt-BR.md +90 -52
- package/README.zh-CN.md +141 -101
- package/agents/sdd-advisor-researcher.md +23 -0
- package/agents/sdd-ai-researcher.md +133 -0
- package/agents/sdd-code-fixer.md +516 -0
- package/agents/sdd-code-reviewer.md +355 -0
- package/agents/sdd-codebase-mapper.md +3 -3
- package/agents/sdd-debugger.md +17 -5
- package/agents/sdd-doc-verifier.md +201 -0
- package/agents/sdd-doc-writer.md +602 -0
- package/agents/sdd-domain-researcher.md +153 -0
- package/agents/sdd-eval-auditor.md +164 -0
- package/agents/sdd-eval-planner.md +154 -0
- package/agents/sdd-executor.md +87 -4
- package/agents/sdd-framework-selector.md +160 -0
- package/agents/sdd-intel-updater.md +314 -0
- package/agents/sdd-nyquist-auditor.md +1 -1
- package/agents/sdd-phase-researcher.md +71 -4
- package/agents/sdd-plan-checker.md +100 -6
- package/agents/sdd-planner.md +145 -206
- package/agents/sdd-project-researcher.md +25 -2
- package/agents/sdd-research-synthesizer.md +3 -3
- package/agents/sdd-roadmapper.md +6 -6
- package/agents/sdd-security-auditor.md +128 -0
- package/agents/sdd-ui-auditor.md +43 -3
- package/agents/sdd-ui-checker.md +5 -5
- package/agents/sdd-ui-researcher.md +27 -4
- package/agents/sdd-user-profiler.md +2 -2
- package/agents/sdd-verifier.md +142 -22
- package/bin/install.js +2145 -545
- package/commands/sdd/add-backlog.md +5 -5
- package/commands/sdd/add-tests.md +2 -2
- package/commands/sdd/ai-integration-phase.md +36 -0
- package/commands/sdd/analyze-dependencies.md +34 -0
- package/commands/sdd/audit-fix.md +33 -0
- package/commands/sdd/autonomous.md +7 -2
- package/commands/sdd/cleanup.md +5 -0
- package/commands/sdd/code-review-fix.md +52 -0
- package/commands/sdd/code-review.md +55 -0
- package/commands/sdd/complete-milestone.md +6 -6
- package/commands/sdd/debug.md +22 -9
- package/commands/sdd/discuss-phase.md +7 -2
- package/commands/sdd/do.md +1 -1
- package/commands/sdd/docs-update.md +48 -0
- package/commands/sdd/eval-review.md +32 -0
- package/commands/sdd/execute-phase.md +4 -0
- package/commands/sdd/explore.md +27 -0
- package/commands/sdd/fast.md +2 -2
- package/commands/sdd/from-sdd2.md +45 -0
- package/commands/sdd/help.md +2 -0
- package/commands/sdd/import.md +36 -0
- package/commands/sdd/intel.md +179 -0
- package/commands/sdd/join-discord.md +2 -1
- package/commands/sdd/manager.md +1 -0
- package/commands/sdd/map-codebase.md +3 -3
- package/commands/sdd/new-milestone.md +1 -1
- package/commands/sdd/new-project.md +5 -1
- package/commands/sdd/new-workspace.md +1 -1
- package/commands/sdd/next.md +2 -0
- package/commands/sdd/plan-milestone-gaps.md +2 -2
- package/commands/sdd/plan-phase.md +6 -1
- package/commands/sdd/plant-seed.md +1 -1
- package/commands/sdd/profile-user.md +1 -1
- package/commands/sdd/quick.md +5 -3
- package/commands/sdd/reapply-patches.md +230 -42
- package/commands/sdd/research-phase.md +3 -3
- package/commands/sdd/review-backlog.md +1 -0
- package/commands/sdd/review.md +6 -3
- package/commands/sdd/scan.md +26 -0
- package/commands/sdd/secure-phase.md +35 -0
- package/commands/sdd/ship.md +1 -1
- package/commands/sdd/thread.md +5 -5
- package/commands/sdd/undo.md +34 -0
- package/commands/sdd/verify-work.md +1 -1
- package/commands/sdd/workstreams.md +17 -11
- package/hooks/dist/sdd-check-update.js +33 -8
- package/hooks/dist/sdd-context-monitor.js +17 -8
- package/hooks/dist/sdd-phase-boundary.sh +27 -0
- package/hooks/dist/sdd-prompt-guard.js +1 -0
- package/hooks/dist/sdd-read-guard.js +82 -0
- package/hooks/dist/sdd-session-state.sh +33 -0
- package/hooks/dist/sdd-statusline.js +137 -15
- package/hooks/dist/sdd-validate-commit.sh +47 -0
- package/hooks/dist/sdd-workflow-guard.js +4 -4
- package/hooks/sdd-check-update.js +139 -0
- package/hooks/sdd-context-monitor.js +165 -0
- package/hooks/sdd-phase-boundary.sh +27 -0
- package/hooks/sdd-prompt-guard.js +97 -0
- package/hooks/sdd-read-guard.js +82 -0
- package/hooks/sdd-session-state.sh +33 -0
- package/hooks/sdd-statusline.js +241 -0
- package/hooks/sdd-validate-commit.sh +47 -0
- package/hooks/sdd-workflow-guard.js +94 -0
- package/package.json +3 -3
- package/scripts/build-hooks.js +18 -7
- package/scripts/prompt-injection-scan.sh +1 -0
- package/scripts/rebrand-gsd-to-sdd.sh +221 -220
- package/scripts/run-tests.cjs +5 -1
- package/scripts/sync-upstream.sh +1 -1
- package/sdd/bin/lib/commands.cjs +79 -17
- package/sdd/bin/lib/config.cjs +90 -48
- package/sdd/bin/lib/core.cjs +452 -87
- package/sdd/bin/lib/docs.cjs +267 -0
- package/sdd/bin/lib/frontmatter.cjs +381 -336
- package/sdd/bin/lib/init.cjs +110 -16
- package/sdd/bin/lib/intel.cjs +660 -0
- package/sdd/bin/lib/learnings.cjs +378 -0
- package/sdd/bin/lib/milestone.cjs +42 -11
- package/sdd/bin/lib/model-profiles.cjs +17 -15
- package/sdd/bin/lib/phase.cjs +367 -288
- package/sdd/bin/lib/profile-output.cjs +106 -10
- package/sdd/bin/lib/roadmap.cjs +146 -115
- package/sdd/bin/lib/schema-detect.cjs +238 -0
- package/sdd/bin/lib/sdd2-import.cjs +511 -0
- package/sdd/bin/lib/security.cjs +124 -3
- package/sdd/bin/lib/state.cjs +648 -264
- package/sdd/bin/lib/template.cjs +8 -4
- package/sdd/bin/lib/verify.cjs +209 -28
- package/sdd/bin/lib/workstream.cjs +7 -3
- package/sdd/bin/sdd-tools.cjs +184 -12
- package/sdd/contexts/dev.md +21 -0
- package/sdd/contexts/research.md +22 -0
- package/sdd/contexts/review.md +22 -0
- package/sdd/references/agent-contracts.md +79 -0
- package/sdd/references/ai-evals.md +156 -0
- package/sdd/references/ai-frameworks.md +186 -0
- package/sdd/references/artifact-types.md +113 -0
- package/sdd/references/common-bug-patterns.md +114 -0
- package/sdd/references/context-budget.md +49 -0
- package/sdd/references/continuation-format.md +25 -25
- package/sdd/references/domain-probes.md +125 -0
- package/sdd/references/few-shot-examples/plan-checker.md +73 -0
- package/sdd/references/few-shot-examples/verifier.md +109 -0
- package/sdd/references/gate-prompts.md +100 -0
- package/sdd/references/gates.md +70 -0
- package/sdd/references/git-integration.md +1 -1
- package/sdd/references/ios-scaffold.md +123 -0
- package/sdd/references/model-profile-resolution.md +2 -0
- package/sdd/references/model-profiles.md +24 -18
- package/sdd/references/planner-gap-closure.md +62 -0
- package/sdd/references/planner-reviews.md +39 -0
- package/sdd/references/planner-revision.md +87 -0
- package/sdd/references/planning-config.md +252 -0
- package/sdd/references/revision-loop.md +97 -0
- package/sdd/references/thinking-models-debug.md +44 -0
- package/sdd/references/thinking-models-execution.md +50 -0
- package/sdd/references/thinking-models-planning.md +62 -0
- package/sdd/references/thinking-models-research.md +50 -0
- package/sdd/references/thinking-models-verification.md +55 -0
- package/sdd/references/thinking-partner.md +96 -0
- package/sdd/references/ui-brand.md +4 -4
- package/sdd/references/universal-anti-patterns.md +63 -0
- package/sdd/references/verification-overrides.md +227 -0
- package/sdd/references/workstream-flag.md +56 -3
- package/sdd/templates/AI-SPEC.md +246 -0
- package/sdd/templates/DEBUG.md +1 -1
- package/sdd/templates/SECURITY.md +61 -0
- package/sdd/templates/UAT.md +4 -4
- package/sdd/templates/VALIDATION.md +4 -4
- package/sdd/templates/claude-md.md +32 -9
- package/sdd/templates/config.json +4 -0
- package/sdd/templates/debug-subagent-prompt.md +1 -1
- package/sdd/templates/dev-preferences.md +1 -1
- package/sdd/templates/discovery.md +2 -2
- package/sdd/templates/phase-prompt.md +1 -1
- package/sdd/templates/planner-subagent-prompt.md +3 -3
- package/sdd/templates/project.md +1 -1
- package/sdd/templates/research.md +1 -1
- package/sdd/templates/state.md +2 -2
- package/sdd/workflows/add-phase.md +8 -8
- package/sdd/workflows/add-tests.md +12 -9
- package/sdd/workflows/add-todo.md +5 -3
- package/sdd/workflows/ai-integration-phase.md +284 -0
- package/sdd/workflows/analyze-dependencies.md +96 -0
- package/sdd/workflows/audit-fix.md +157 -0
- package/sdd/workflows/audit-milestone.md +11 -11
- package/sdd/workflows/audit-uat.md +2 -2
- package/sdd/workflows/autonomous.md +195 -27
- package/sdd/workflows/check-todos.md +12 -10
- package/sdd/workflows/cleanup.md +2 -0
- package/sdd/workflows/code-review-fix.md +497 -0
- package/sdd/workflows/code-review.md +515 -0
- package/sdd/workflows/complete-milestone.md +56 -22
- package/sdd/workflows/diagnose-issues.md +10 -3
- package/sdd/workflows/discovery-phase.md +5 -3
- package/sdd/workflows/discuss-phase-assumptions.md +24 -6
- package/sdd/workflows/discuss-phase-power.md +291 -0
- package/sdd/workflows/discuss-phase.md +173 -21
- package/sdd/workflows/do.md +23 -21
- package/sdd/workflows/docs-update.md +1155 -0
- package/sdd/workflows/eval-review.md +155 -0
- package/sdd/workflows/execute-phase.md +594 -38
- package/sdd/workflows/execute-plan.md +67 -96
- package/sdd/workflows/explore.md +139 -0
- package/sdd/workflows/fast.md +5 -5
- package/sdd/workflows/forensics.md +2 -2
- package/sdd/workflows/health.md +4 -4
- package/sdd/workflows/help.md +122 -119
- package/sdd/workflows/import.md +276 -0
- package/sdd/workflows/inbox.md +387 -0
- package/sdd/workflows/insert-phase.md +7 -7
- package/sdd/workflows/list-phase-assumptions.md +4 -4
- package/sdd/workflows/list-workspaces.md +2 -2
- package/sdd/workflows/manager.md +35 -32
- package/sdd/workflows/map-codebase.md +7 -5
- package/sdd/workflows/milestone-summary.md +2 -2
- package/sdd/workflows/new-milestone.md +17 -9
- package/sdd/workflows/new-project.md +50 -25
- package/sdd/workflows/new-workspace.md +7 -5
- package/sdd/workflows/next.md +67 -11
- package/sdd/workflows/note.md +9 -7
- package/sdd/workflows/pause-work.md +75 -12
- package/sdd/workflows/plan-milestone-gaps.md +8 -8
- package/sdd/workflows/plan-phase.md +294 -42
- package/sdd/workflows/plant-seed.md +6 -3
- package/sdd/workflows/pr-branch.md +42 -14
- package/sdd/workflows/profile-user.md +9 -7
- package/sdd/workflows/progress.md +45 -45
- package/sdd/workflows/quick.md +195 -47
- package/sdd/workflows/remove-phase.md +6 -6
- package/sdd/workflows/remove-workspace.md +3 -1
- package/sdd/workflows/research-phase.md +2 -2
- package/sdd/workflows/resume-project.md +12 -12
- package/sdd/workflows/review.md +109 -9
- package/sdd/workflows/scan.md +102 -0
- package/sdd/workflows/secure-phase.md +166 -0
- package/sdd/workflows/session-report.md +2 -2
- package/sdd/workflows/settings.md +38 -12
- package/sdd/workflows/ship.md +21 -9
- package/sdd/workflows/stats.md +1 -1
- package/sdd/workflows/transition.md +23 -23
- package/sdd/workflows/ui-phase.md +15 -7
- package/sdd/workflows/ui-review.md +29 -4
- package/sdd/workflows/undo.md +314 -0
- package/sdd/workflows/update.md +171 -20
- package/sdd/workflows/validate-phase.md +6 -4
- package/sdd/workflows/verify-phase.md +210 -6
- package/sdd/workflows/verify-work.md +83 -9
- package/sdd/commands/sdd/workstreams.md +0 -63
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Thinking Models: Debug Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **debugger** agent. Apply these at decision points during investigation, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to SDD debugging workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
**Fault Tree and Hypothesis-Driven are sequential:** Fault Tree FIRST (generate the tree of possible causes), Hypothesis-Driven SECOND (test each branch systematically). Fault Tree provides the map; Hypothesis-Driven provides the discipline to traverse it.
|
|
10
|
+
|
|
11
|
+
## 1. Fault Tree Analysis
|
|
12
|
+
|
|
13
|
+
**Counters:** Jumping to conclusions without systematically mapping failure paths.
|
|
14
|
+
|
|
15
|
+
Before testing any hypothesis, build a fault tree: start with the observed symptom as the root node, then branch into all possible causes at each level (hardware, software, configuration, data, environment). Use AND/OR gates -- some failures require multiple conditions (AND), others have independent triggers (OR). This tree becomes your investigation roadmap. Prioritize branches by likelihood and testability, but do NOT prune branches just because they seem unlikely -- unlikely causes that are easy to test should be tested early.
|
|
16
|
+
|
|
17
|
+
## 2. Hypothesis-Driven Investigation
|
|
18
|
+
|
|
19
|
+
**Counters:** Making random changes and hoping something works -- the "shotgun debugging" anti-pattern.
|
|
20
|
+
|
|
21
|
+
For each hypothesis from the fault tree, follow the strict protocol: PREDICT ("If hypothesis H is correct, then test T should produce result R"), TEST (execute exactly one test), OBSERVE (record the actual result), CONCLUDE (matched = SUPPORTED, failed = ELIMINATED, unexpected = new evidence). Never skip the PREDICT step -- without a prediction, you cannot distinguish a meaningful result from noise. Never change more than one variable per test -- if you change two things and the bug disappears, you don't know which change fixed it.
|
|
22
|
+
|
|
23
|
+
## 3. Occam's Razor
|
|
24
|
+
|
|
25
|
+
**Counters:** Pursuing elaborate explanations when simple ones have not been ruled out.
|
|
26
|
+
|
|
27
|
+
Before investigating complex multi-component interaction bugs, race conditions, or framework-level issues, verify the simple explanations first: typo in variable name, wrong file path, missing import, incorrect config value, stale cache, wrong environment variable. These "boring" causes account for the majority of bugs. Only escalate to complex hypotheses AFTER the simple ones are eliminated. If your current hypothesis requires 3+ things to go wrong simultaneously, step back and look for a single-point failure.
|
|
28
|
+
|
|
29
|
+
## 4. Counterfactual Thinking
|
|
30
|
+
|
|
31
|
+
**Counters:** Failing to isolate causation by not asking "what if we changed just this one thing?"
|
|
32
|
+
|
|
33
|
+
When you have a hypothesis about the root cause, construct a counterfactual: "If I change ONLY this one variable/config/line, the bug should disappear (or appear)." Execute the counterfactual test. If the bug persists after your targeted change, your hypothesis is wrong -- the cause is elsewhere. If the bug disappears, you have strong causal evidence. This is more powerful than correlation ("the bug appeared after deploy X") because it tests the mechanism, not just the timeline.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## When NOT to Think
|
|
38
|
+
|
|
39
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
40
|
+
|
|
41
|
+
- **Obvious single-cause bugs** -- If the error message names the exact file, line, and cause (e.g., `TypeError: Cannot read property 'x' of undefined at foo.js:42`), fix it directly. Do not build a fault tree for a null reference with a stack trace.
|
|
42
|
+
- **Reproducing a known fix** -- If you already know the root cause from a previous investigation or the user told you exactly what is wrong, skip hypothesis-driven investigation and go straight to the fix.
|
|
43
|
+
- **Typos, missing imports, wrong paths** -- If Occam's Razor would immediately resolve it, apply the fix without invoking the full model. The model exists for when simple checks fail, not to gate simple checks.
|
|
44
|
+
- **Reading error logs** -- Reading and understanding error output is normal debugging, not a "decision point." Only invoke models when you have multiple plausible hypotheses and need to choose which to test first.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Thinking Models: Execution Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **executor** agent. Apply these at decision points during task execution, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to SDD execution workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
**Forcing Function and First Principles both push toward "do it now".** Run First Principles FIRST (understand the constraint), Forcing Function SECOND (create the mechanism). Sequential, not competing.
|
|
10
|
+
|
|
11
|
+
## 1. Circle of Concern vs Circle of Control
|
|
12
|
+
|
|
13
|
+
**Counters:** Executor trying to fix things outside its scope -- upstream bugs, unrelated tech debt, infrastructure issues.
|
|
14
|
+
|
|
15
|
+
Before modifying any code not explicitly listed in the plan's `<files>` section, ask: Is this in my Circle of Control (plan scope) or my Circle of Concern (things I notice but shouldn't fix)? If Circle of Concern: document it as a deviation note or deferred item, do NOT fix it. The executor's job is to build what the plan says, not to improve the codebase. Scope creep from "while I'm here" fixes is the #1 cause of executor overruns.
|
|
16
|
+
|
|
17
|
+
## 2. Forcing Function
|
|
18
|
+
|
|
19
|
+
**Counters:** Deferring hard decisions to runtime instead of resolving them at build time.
|
|
20
|
+
|
|
21
|
+
When you encounter an ambiguous requirement or unclear integration point, create a forcing function that makes the decision explicit NOW rather than hiding it behind a TODO or runtime check. Examples: use a TypeScript `never` type to force exhaustive switches, add a build-time assertion for required config values, create an interface that forces callers to handle error cases. If a decision truly cannot be made at build time, document it as a `checkpoint:decision` deviation -- do not silently defer.
|
|
22
|
+
|
|
23
|
+
## 3. First Principles Thinking
|
|
24
|
+
|
|
25
|
+
**Counters:** Copying patterns from existing code without understanding whether they fit the current task.
|
|
26
|
+
|
|
27
|
+
Before copying a pattern from another file or phase, decompose WHY that pattern exists: What constraint does it satisfy? Does your current task have the same constraint? If not, the pattern may be cargo cult. Build your implementation from the task's actual requirements, not from the nearest existing example. When in doubt, the plan's `<action>` steps define what to build -- derive the implementation from those, not from adjacent code.
|
|
28
|
+
|
|
29
|
+
## 4. Occam's Razor
|
|
30
|
+
|
|
31
|
+
**Counters:** Over-engineering simple tasks with unnecessary abstractions, generics, or future-proofing.
|
|
32
|
+
|
|
33
|
+
Before adding an abstraction layer, generic type parameter, factory pattern, or configuration option, ask: Does the plan REQUIRE this flexibility? If the plan says "create a function that does X", create a function that does X -- not a configurable, extensible, pluggable framework that could theoretically do X through Y through Z. The simplest implementation that satisfies the plan's `<done>` condition is the correct one. Add complexity only when the plan explicitly calls for it.
|
|
34
|
+
|
|
35
|
+
## 5. Chesterton's Fence
|
|
36
|
+
|
|
37
|
+
**Counters:** Removing or modifying existing code without understanding why it was written that way.
|
|
38
|
+
|
|
39
|
+
Before removing, replacing, or significantly modifying existing code that the plan touches, determine WHY it exists. Check: git blame for the commit that introduced it, comments explaining the rationale, test cases that exercise it, the PLAN.md or SUMMARY.md that created it. If the purpose is unclear, keep it and add a comment noting the uncertainty -- do NOT remove code whose purpose you don't understand. If the plan explicitly says to remove it, still document what it did in the deviation notes.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## When NOT to Think
|
|
44
|
+
|
|
45
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
46
|
+
|
|
47
|
+
- **Straightforward task actions** -- If the plan says "create file X with content Y" and the action is unambiguous, execute it directly. Do not invoke First Principles to analyze why you are creating a file the plan told you to create.
|
|
48
|
+
- **Following established project patterns** -- If the codebase has a clear, consistent pattern (e.g., every route handler follows the same structure) and the plan says to add another one, follow the pattern. Chesterton's Fence applies to removing patterns, not to following them.
|
|
49
|
+
- **Trivial file edits** -- Adding an import, fixing a typo, updating a version number. These are mechanical changes that do not involve design decisions.
|
|
50
|
+
- **Running verify commands** -- Executing the plan's `<verify>` steps is procedural. Only invoke models if a verify step fails and you need to decide how to respond.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Thinking Models: Planning Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **planner** and **roadmapper** agents. Apply these at decision points during plan creation, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to SDD planning workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
Pre-Mortem and Constraint Analysis both analyze risk at different granularities. Run Constraint Analysis FIRST (identify the hardest constraint), then Pre-Mortem (enumerate failure modes around that constraint and the rest of the plan).
|
|
10
|
+
|
|
11
|
+
## 1. Pre-Mortem Analysis
|
|
12
|
+
|
|
13
|
+
**Counters:** Optimistic plan decomposition that ignores failure modes.
|
|
14
|
+
|
|
15
|
+
Before finalizing this plan, assume it has already failed. List the 3 most likely reasons for failure -- missing dependency, wrong decomposition, underestimated complexity -- and add mitigation steps or acceptance criteria that would catch each failure early.
|
|
16
|
+
|
|
17
|
+
## 2. MECE Decomposition
|
|
18
|
+
|
|
19
|
+
**Counters:** Overlapping tasks (merge conflicts) or gapped tasks (missing requirements).
|
|
20
|
+
|
|
21
|
+
Verify this task breakdown is MECE at the REQUIREMENT level: (1) list every requirement from the phase goal, (2) confirm each maps to exactly one task's `<done>`, (3) if two tasks modify the same file, confirm they modify DIFFERENT sections or serve DIFFERENT requirements, (4) flag any requirement not covered by any task.
|
|
22
|
+
|
|
23
|
+
## 3. Constraint Analysis
|
|
24
|
+
|
|
25
|
+
**Counters:** Deferring the hardest constraint to the last task, causing late-stage failures.
|
|
26
|
+
|
|
27
|
+
Identify the single hardest constraint in this phase -- the one thing that, if it doesn't work, makes everything else irrelevant. Schedule that constraint as Task 1 or 2, not last. If the constraint involves an external API or unfamiliar library, add a spike/proof-of-concept task before the main implementation.
|
|
28
|
+
|
|
29
|
+
## 4. Reversibility Test
|
|
30
|
+
|
|
31
|
+
**Counters:** Over-analyzing cheap decisions, under-analyzing costly ones.
|
|
32
|
+
|
|
33
|
+
For each significant decision in this plan, classify as REVERSIBLE (can change later with low cost) or IRREVERSIBLE (changing later requires migration, breaking changes, or significant rework). Spend analysis time proportional to irreversibility. For irreversible decisions, document the rationale in the plan.
|
|
34
|
+
|
|
35
|
+
## 5. Curse of Knowledge Counter
|
|
36
|
+
|
|
37
|
+
**Counters:** Plan-to-executor ambiguity from compressed instructions.
|
|
38
|
+
|
|
39
|
+
For each `<action>` step, re-read it as if you have NEVER seen this codebase. Is every noun unambiguous (which file? which function? which endpoint?)? Is every verb specific (add WHERE? modify HOW?)? If a step could be interpreted two ways, rewrite it. Include file paths, function names, and expected behavior in every action step.
|
|
40
|
+
|
|
41
|
+
## 6. Base Rate Neglect Counter
|
|
42
|
+
|
|
43
|
+
**Counters:** Planners ignoring low-confidence research caveats.
|
|
44
|
+
|
|
45
|
+
Before finalizing the plan, read ALL `[NEEDS DECISION]` items and LOW-confidence recommendations from SUMMARY.md. For each: either (a) create a `checkpoint:decision` task to resolve it, or (b) document why the risk is acceptable in the plan's deviation notes. LOW-confidence items that are silently accepted become undocumented technical debt.
|
|
46
|
+
|
|
47
|
+
## Gap Closure Mode: Root-Cause Check
|
|
48
|
+
|
|
49
|
+
**Applies only when:** Planner enters gap closure mode (triggered by `gaps_found` in VERIFICATION.md).
|
|
50
|
+
|
|
51
|
+
Before writing the fix plan, apply a single "why" round: Why did this gap occur? Was it a plan deficiency (wrong task), an execution miss (correct task, wrong implementation), or a changed assumption (environment/dependency shift)? The fix plan must target the root cause category, not just the symptom.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## When NOT to Think
|
|
56
|
+
|
|
57
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
58
|
+
|
|
59
|
+
- **Single-task plans** -- If the phase has one clear requirement and one obvious task, do not run Pre-Mortem or MECE analysis. Write the task directly.
|
|
60
|
+
- **Well-researched phases** -- If RESEARCH.md has HIGH-confidence recommendations for every decision and no `[NEEDS DECISION]` items, skip Base Rate Neglect Counter. The research already resolved uncertainty.
|
|
61
|
+
- **Revision iterations** -- When revising a plan based on checker feedback, focus on fixing the flagged issues. Do not re-run the full model suite on every revision pass -- apply only the model relevant to the specific issue (e.g., MECE if the checker found a coverage gap).
|
|
62
|
+
- **Boilerplate plans** -- Configuration changes, version bumps, documentation updates. These do not have failure modes worth pre-mortem analysis.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Thinking Models: Research Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **researcher** and **synthesizer** agents. Apply these at decision points during research and synthesis, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to SDD research workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
**First Principles and Steel Man both expand scope** -- run First Principles FIRST (decompose the problem), then Steel Man (strengthen alternatives). Don't run simultaneously.
|
|
10
|
+
|
|
11
|
+
## 1. First Principles Thinking
|
|
12
|
+
|
|
13
|
+
**Counters:** Accepting surface-level explanations without decomposing into fundamental components.
|
|
14
|
+
|
|
15
|
+
Before accepting any technology recommendation or architectural pattern, decompose it to its fundamental constraints: What problem does this solve? What are the non-negotiable requirements? What are the physical/logical limits? Build your recommendation UP from these constraints rather than DOWN from conventional wisdom. If you cannot explain WHY a recommendation is correct from first principles, flag it as `[LOW]` regardless of source count.
|
|
16
|
+
|
|
17
|
+
## 2. Simpson's Paradox Awareness
|
|
18
|
+
|
|
19
|
+
**Counters:** Synthesizer aggregating conflicting research without checking for confounding splits.
|
|
20
|
+
|
|
21
|
+
When combining findings from multiple research documents that show contradictory results, check whether the contradiction disappears when you split by a hidden variable: framework version, deployment target, project scale, or use case category. A library that benchmarks faster overall may be slower for YOUR specific workload. Before resolving contradictions by majority vote, ask: "Is there a subgroup split that explains why both findings are correct in their own context?"
|
|
22
|
+
|
|
23
|
+
## 3. Survivorship Bias
|
|
24
|
+
|
|
25
|
+
**Counters:** Only finding successful examples while missing failures and abandoned approaches.
|
|
26
|
+
|
|
27
|
+
After gathering evidence FOR a recommended approach, actively search for projects that ABANDONED it. Check GitHub issues for "migrated away from", "replaced X with", or "problems with X at scale". A technology with 10 success stories and 100 quiet failures looks great until you check the graveyard. Weight negative evidence (migration-away stories, deprecation notices, unresolved issues) MORE heavily than positive evidence -- failures are underreported.
|
|
28
|
+
|
|
29
|
+
## 4. Confirmation Bias Counter
|
|
30
|
+
|
|
31
|
+
**Counters:** Searching for evidence that confirms initial hypothesis while ignoring disconfirming evidence.
|
|
32
|
+
|
|
33
|
+
After forming your initial recommendation, spend one full research cycle searching AGAINST it. Use search terms like "{technology} problems", "{technology} alternatives", "why not {technology}", "{technology} vs {competitor}". For each piece of disconfirming evidence found, either (a) refute it with higher-confidence sources, or (b) add it as a caveat to your recommendation. If you cannot find ANY criticism of your recommendation, your search was too narrow -- widen it.
|
|
34
|
+
|
|
35
|
+
## 5. Steel Man
|
|
36
|
+
|
|
37
|
+
**Counters:** Dismissing alternative approaches without giving them their strongest possible form.
|
|
38
|
+
|
|
39
|
+
Before recommending against an alternative technology or approach, construct its STRONGEST possible case. What would a passionate advocate say? What use cases does it serve better than your recommendation? What trade-offs favor it? Present the steel-manned alternative alongside your recommendation with an honest comparison. If the steel-manned alternative is competitive, flag the decision as `[NEEDS DECISION]` rather than making a unilateral recommendation.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## When NOT to Think
|
|
44
|
+
|
|
45
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
46
|
+
|
|
47
|
+
- **Locked decisions from CONTEXT.md** -- If the user already decided "use library X", do not run Steel Man analysis on alternatives or First Principles decomposition of the choice. Research how to use X well, not whether X is the right choice.
|
|
48
|
+
- **Standard stack lookups** -- If you are simply checking the latest version of a well-known library or reading its API docs, do not invoke Survivorship Bias or Confirmation Bias Counter. These models are for evaluating contested recommendations, not for factual lookups.
|
|
49
|
+
- **Single-technology phases** -- If the phase involves one technology with no alternatives to evaluate (e.g., "add ESLint rule X"), skip comparative models (Steel Man, Confirmation Bias Counter). Just research the implementation.
|
|
50
|
+
- **Codebase-only research** -- If the research is purely internal (understanding existing code patterns, finding where a function is called), structured reasoning models add no value. Use grep and read the code.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Thinking Models: Verification Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **verifier** and **plan-checker** agents. Apply these during verification passes, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to SDD verification workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
**Inversion** and **Confirmation Bias Counter** both look for failures but serve different purposes. Run them in sequence:
|
|
10
|
+
|
|
11
|
+
1. **Inversion FIRST** (brainstorm): generate 3 ways this could be wrong
|
|
12
|
+
2. **Confirmation Bias Counter SECOND** (structured check): find one partial requirement, one misleading test, one uncovered error path
|
|
13
|
+
|
|
14
|
+
Inversion generates the list; Confirmation Bias Counter is the discipline to verify items on it.
|
|
15
|
+
|
|
16
|
+
## 1. Inversion
|
|
17
|
+
|
|
18
|
+
**Counters:** Verifiers confirming success rather than finding failures.
|
|
19
|
+
|
|
20
|
+
Instead of checking what IS correct, list 3 specific ways this implementation could be WRONG despite passing tests: missing edge cases, silent data loss, race conditions, unhandled error paths. For each, write a concrete check (grep for pattern, test with specific input, verify error handling exists). Additionally, check whether any documented DEVIATION in SUMMARY.md changes the meaning or applicability of a must-have. If a must-have was written assuming approach A but the executor used approach B, the must-have may need reinterpretation, not literal checking.
|
|
21
|
+
|
|
22
|
+
## 2. Chesterton's Fence
|
|
23
|
+
|
|
24
|
+
**Counters:** Flagging purposeful code as dead or unnecessary.
|
|
25
|
+
|
|
26
|
+
Before flagging any existing code as dead, redundant, or overcomplicated, determine WHY it was written that way. Check git blame, comments, test cases, and the PLAN.md that created it. If the reason is unclear, flag as "purpose unknown -- recommend keeping with WARNING, not removing" and include the git blame hash for the commit that introduced it.
|
|
27
|
+
|
|
28
|
+
## 3. Confirmation Bias Counter
|
|
29
|
+
|
|
30
|
+
**Counters:** Verifiers primed by SUMMARY.md claims to see success.
|
|
31
|
+
|
|
32
|
+
After your initial verification pass, do a DISCONFIRMATION pass: (1) find one requirement that is only partially met, (2) find one test that passes but does not actually test the stated behavior, (3) find one error path that has no test coverage. Report these even if overall verification passes.
|
|
33
|
+
|
|
34
|
+
## 4. Planning Fallacy Calibration
|
|
35
|
+
|
|
36
|
+
**Counters:** Accepting over-scoped plans as reasonable (plan-checker).
|
|
37
|
+
|
|
38
|
+
For each task estimated as "simple" or "small", check: does it touch more than 2 files? Does it require understanding an unfamiliar API? Does it modify shared infrastructure? If yes to any, flag as likely underestimated. Plans with >5 tasks or tasks touching >4 files per task are over-scoped.
|
|
39
|
+
|
|
40
|
+
## 5. Counterfactual Thinking
|
|
41
|
+
|
|
42
|
+
**Counters:** Plans that assume success at every step with no error recovery (plan-checker).
|
|
43
|
+
|
|
44
|
+
For each plan, ask: "What would happen if the executor followed this plan EXACTLY as written but encountered a common failure: dependency version mismatch, API returning unexpected format, file already modified by prior plan?" If the plan has no contingency path and the `<action>` steps assume success at every point, flag as WARNING: "No error recovery path for task T{n}."
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## When NOT to Think
|
|
49
|
+
|
|
50
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
51
|
+
|
|
52
|
+
- **Re-verification of previously passed items** -- When in re-verification mode, items that passed the initial check only need a quick regression check (existence + basic sanity), not the full Inversion + Confirmation Bias Counter treatment.
|
|
53
|
+
- **Binary existence checks** -- If a must-have is "file X exists with >N lines" and the file clearly exists with substantive content, do not run Counterfactual Thinking on it. Reserve models for ambiguous or wiring-dependent must-haves.
|
|
54
|
+
- **Straightforward test results** -- If `<verify>` commands produce clear pass/fail output (e.g., test suite exits 0 with all tests passing), accept the result. Only invoke models when test results are ambiguous or when you suspect the tests do not actually test what they claim.
|
|
55
|
+
- **INFO-level issues** -- Do not apply structured reasoning to decide whether an INFO-level observation is actually a BLOCKER. INFO items are informational by definition and never trigger gates.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Thinking Partner Integration
|
|
2
|
+
|
|
3
|
+
Conditional extended thinking at workflow decision points. Activates when `features.thinking_partner: true` in `.planning/config.json` (default: false).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Tradeoff Detection Signals
|
|
8
|
+
|
|
9
|
+
The thinking partner activates when developer responses contain specific signals indicating competing priorities:
|
|
10
|
+
|
|
11
|
+
**Keyword signals:**
|
|
12
|
+
- "or" / "versus" / "vs" connecting two approaches
|
|
13
|
+
- "tradeoff" / "trade-off" / "tradeoffs"
|
|
14
|
+
- "on one hand" / "on the other hand"
|
|
15
|
+
- "pros and cons"
|
|
16
|
+
- "not sure between" / "torn between"
|
|
17
|
+
|
|
18
|
+
**Structural signals:**
|
|
19
|
+
- Developer lists 2+ competing options
|
|
20
|
+
- Developer asks "which is better" or "what would you recommend"
|
|
21
|
+
- Developer reverses a previous decision ("actually, maybe we should...")
|
|
22
|
+
|
|
23
|
+
**When NOT to activate:**
|
|
24
|
+
- Developer has already made a clear choice
|
|
25
|
+
- The "or" is rhetorical or trivial (e.g., "tabs or spaces" — use project convention)
|
|
26
|
+
- Simple yes/no questions
|
|
27
|
+
- Developer explicitly asks to move on
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Integration Points
|
|
32
|
+
|
|
33
|
+
### 1. Discuss Phase — Tradeoff Deep-Dive
|
|
34
|
+
|
|
35
|
+
**When:** During `discuss_areas` step, after a developer answer reveals competing priorities.
|
|
36
|
+
|
|
37
|
+
**What:** Pause the normal question flow and offer a brief structured analysis:
|
|
38
|
+
```
|
|
39
|
+
I notice competing priorities here — {X} optimizes for {A} while {Y} optimizes for {B}.
|
|
40
|
+
|
|
41
|
+
Want me to think through the tradeoffs before we decide?
|
|
42
|
+
[Yes, analyze tradeoffs] / [No, I've decided]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If yes, provide a brief (3-5 bullet) analysis covering:
|
|
46
|
+
- What each approach optimizes for
|
|
47
|
+
- What each approach sacrifices
|
|
48
|
+
- Which aligns better with the project's stated goals (from PROJECT.md)
|
|
49
|
+
- A recommendation with reasoning
|
|
50
|
+
|
|
51
|
+
Then return to the normal discussion flow.
|
|
52
|
+
|
|
53
|
+
### 2. Plan Phase — Architectural Decision Analysis
|
|
54
|
+
|
|
55
|
+
**When:** During step 11 (Handle Checker Return), when the plan-checker flags issues containing architectural tradeoff keywords.
|
|
56
|
+
|
|
57
|
+
**What:** Before sending to the revision loop, analyze the architectural decision:
|
|
58
|
+
```
|
|
59
|
+
The plan-checker flagged an architectural tradeoff: {issue description}
|
|
60
|
+
|
|
61
|
+
Brief analysis:
|
|
62
|
+
- Option A: {approach} — {pros/cons}
|
|
63
|
+
- Option B: {approach} — {pros/cons}
|
|
64
|
+
- Recommendation: {choice} because {reasoning aligned with phase goals}
|
|
65
|
+
|
|
66
|
+
Apply this recommendation to the revision? [Yes] / [No, let me decide]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Explore — Approach Comparison (requires #1729)
|
|
70
|
+
|
|
71
|
+
**When:** During Socratic conversation, when multiple viable approaches emerge.
|
|
72
|
+
**Note:** This integration point will be added when /sdd-explore (#1729) lands.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"features": {
|
|
81
|
+
"thinking_partner": true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Default: `false`. The thinking partner is opt-in because it adds latency to interactive workflows.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Design Principles
|
|
91
|
+
|
|
92
|
+
1. **Lightweight** — inline analysis, not a separate interactive session
|
|
93
|
+
2. **Opt-in** — must be explicitly enabled, never activates by default
|
|
94
|
+
3. **Skippable** — always offer "No, I've decided" to bypass
|
|
95
|
+
4. **Brief** — 3-5 bullets max, not a full research report
|
|
96
|
+
5. **Aligned** — recommendations reference PROJECT.md goals when available
|
|
@@ -108,15 +108,15 @@ Always at end of major completions.
|
|
|
108
108
|
|
|
109
109
|
**{Identifier}: {Name}** — {one-line description}
|
|
110
110
|
|
|
111
|
-
`
|
|
111
|
+
`/clear` then:
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
`{copy-paste command}`
|
|
114
114
|
|
|
115
115
|
───────────────────────────────────────────────────────────────
|
|
116
116
|
|
|
117
117
|
**Also available:**
|
|
118
|
-
- `/sdd
|
|
119
|
-
- `/sdd
|
|
118
|
+
- `/sdd-alternative-1` — description
|
|
119
|
+
- `/sdd-alternative-2` — description
|
|
120
120
|
|
|
121
121
|
───────────────────────────────────────────────────────────────
|
|
122
122
|
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Universal Anti-Patterns
|
|
2
|
+
|
|
3
|
+
Rules that apply to ALL workflows and agents. Individual workflows may have additional specific anti-patterns.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Context Budget Rules
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
2. **Never** inline large files into subagent prompts -- tell agents to read files from disk instead. Agents have their own context windows.
|
|
11
|
+
3. **Read depth scales with context window** -- check `context_window_tokens` 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.
|
|
12
|
+
4. **Delegate** heavy work to subagents -- the orchestrator routes, it does not build, analyze, research, investigate, or verify.
|
|
13
|
+
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."
|
|
14
|
+
|
|
15
|
+
## File Reading Rules
|
|
16
|
+
|
|
17
|
+
6. **SUMMARY.md read depth scales with context window** -- at context_window_tokens < 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.
|
|
18
|
+
7. **Never** read full PLAN.md files from other phases -- only current phase plans.
|
|
19
|
+
8. **Never** read `.planning/logs/` files -- only the health workflow reads these.
|
|
20
|
+
9. **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.
|
|
21
|
+
|
|
22
|
+
## Subagent Rules
|
|
23
|
+
|
|
24
|
+
10. **NEVER** use non-SDD agent types (`general-purpose`, `Explore`, `Plan`, `Bash`, `feature-dev`, etc.) -- ALWAYS use `subagent_type: "sdd-{agent}"` (e.g., `sdd-phase-researcher`, `sdd-executor`, `sdd-planner`). SDD agents have project-aware prompts, audit logging, and workflow context. Generic agents bypass all of this.
|
|
25
|
+
11. **Do not** re-litigate decisions that are already locked in CONTEXT.md (or PROJECT.md ## Context section) -- respect locked decisions unconditionally.
|
|
26
|
+
|
|
27
|
+
## Questioning Anti-Patterns
|
|
28
|
+
|
|
29
|
+
Reference: `references/questioning.md` for the full anti-pattern list.
|
|
30
|
+
|
|
31
|
+
12. **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.
|
|
32
|
+
13. **Do not** use corporate speak -- avoid jargon like "stakeholder alignment", "synergize", "deliverables". Use plain language.
|
|
33
|
+
14. **Do not** apply premature constraints -- don't narrow the solution space before understanding the problem. Ask about the problem first, then constrain.
|
|
34
|
+
|
|
35
|
+
## State Management Anti-Patterns
|
|
36
|
+
|
|
37
|
+
15. **No direct Write/Edit to STATE.md or ROADMAP.md for mutations.** Always use `sdd-tools.cjs` CLI commands (`state update`, `state advance-plan`, `roadmap update-status`) for mutations. 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.
|
|
38
|
+
|
|
39
|
+
## Behavioral Rules
|
|
40
|
+
|
|
41
|
+
16. **Do not** create artifacts the user did not approve -- always confirm before writing new planning documents.
|
|
42
|
+
17. **Do not** modify files outside the workflow's stated scope -- check the plan's files_modified list.
|
|
43
|
+
18. **Do not** suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
|
|
44
|
+
19. **Do not** use `git add .` or `git add -A` -- stage specific files only.
|
|
45
|
+
20. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
|
|
46
|
+
|
|
47
|
+
## Error Recovery Rules
|
|
48
|
+
|
|
49
|
+
21. **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).
|
|
50
|
+
22. **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."
|
|
51
|
+
23. **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.
|
|
52
|
+
|
|
53
|
+
## SDD-Specific Rules
|
|
54
|
+
|
|
55
|
+
24. **Do not** check for `mode === 'auto'` or `mode === 'autonomous'` -- SDD uses `yolo` config flag. Check `yolo: true` for autonomous mode, absence or `false` for interactive mode.
|
|
56
|
+
25. **Always use `sdd-tools.cjs`** (not `sdd-tools.js` or any other variant) -- SDD uses CommonJS for Node.js CLI compatibility.
|
|
57
|
+
26. **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 -- sdd-tools detection depends on this exact pattern.
|
|
58
|
+
27. **Do not start executing the next plan before writing the SUMMARY.md for the current plan** -- downstream plans may reference it via `@` includes.
|
|
59
|
+
|
|
60
|
+
## iOS / Apple Platform Rules
|
|
61
|
+
|
|
62
|
+
28. **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.
|
|
63
|
+
29. **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.
|