codeforge-dev 1.9.0 → 1.11.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.
Files changed (56) hide show
  1. package/.devcontainer/.env +3 -0
  2. package/.devcontainer/CHANGELOG.md +125 -0
  3. package/.devcontainer/CLAUDE.md +41 -11
  4. package/.devcontainer/README.md +73 -3
  5. package/.devcontainer/config/defaults/main-system-prompt.md +187 -201
  6. package/.devcontainer/config/defaults/rules/session-search.md +66 -0
  7. package/.devcontainer/config/defaults/rules/spec-workflow.md +48 -13
  8. package/.devcontainer/config/defaults/settings.json +2 -1
  9. package/.devcontainer/config/defaults/writing-system-prompt.md +143 -0
  10. package/.devcontainer/config/file-manifest.json +12 -0
  11. package/.devcontainer/connect-external-terminal.sh +17 -17
  12. package/.devcontainer/devcontainer.json +150 -144
  13. package/.devcontainer/features/ccms/README.md +50 -0
  14. package/.devcontainer/features/ccms/devcontainer-feature.json +21 -0
  15. package/.devcontainer/features/ccms/install.sh +105 -0
  16. package/.devcontainer/features/ccstatusline/install.sh +24 -2
  17. package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +8 -1
  18. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/architect.md +5 -3
  19. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/claude-guide.md +1 -1
  20. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/doc-writer.md +7 -7
  21. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/generalist.md +1 -0
  22. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/spec-writer.md +22 -12
  23. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/hooks/hooks.json +11 -1
  24. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/skill-suggester.cpython-314.pyc +0 -0
  25. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/advisory-test-runner.py +186 -13
  26. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/git-state-injector.py +15 -4
  27. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/inject-cwd.py +37 -0
  28. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/skill-suggester.py +24 -0
  29. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/spec-reminder.py +4 -2
  30. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/SKILL.md +1 -1
  31. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-build/SKILL.md +353 -0
  32. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-build/references/review-checklist.md +175 -0
  33. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-check/SKILL.md +28 -15
  34. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/SKILL.md +16 -13
  35. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/backlog-template.md +19 -3
  36. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/milestones-template.md +32 -0
  37. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/SKILL.md +28 -20
  38. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/references/template.md +35 -6
  39. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-refine/SKILL.md +194 -0
  40. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-review/SKILL.md +229 -0
  41. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-update/SKILL.md +24 -2
  42. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/SKILL.md +20 -13
  43. package/.devcontainer/plugins/devs-marketplace/plugins/codeforge-lsp/.claude-plugin/plugin.json +38 -5
  44. package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/.claude-plugin/plugin.json +7 -0
  45. package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/hooks/hooks.json +17 -0
  46. package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/scripts/__pycache__/guard-workspace-scope.cpython-314.pyc +0 -0
  47. package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/scripts/guard-workspace-scope.py +132 -0
  48. package/.devcontainer/scripts/check-setup.sh +24 -25
  49. package/.devcontainer/scripts/setup-aliases.sh +95 -90
  50. package/.devcontainer/scripts/setup-projects.sh +172 -131
  51. package/.devcontainer/scripts/setup-terminal.sh +48 -0
  52. package/.devcontainer/scripts/setup-update-claude.sh +49 -107
  53. package/.devcontainer/scripts/setup.sh +4 -17
  54. package/README.md +2 -2
  55. package/package.json +1 -1
  56. package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/roadmap-template.md +0 -13
@@ -5,14 +5,14 @@ description: >-
5
5
  "set up specs", "bootstrap specs", "start using specs", "create spec
6
6
  directory", "init specs for this project", or needs to set up the
7
7
  .specs/ directory structure for a project that doesn't have one yet.
8
- version: 0.1.0
8
+ version: 0.2.0
9
9
  ---
10
10
 
11
11
  # Initialize Specification Directory
12
12
 
13
13
  ## Mental Model
14
14
 
15
- Before any spec can be created, the project needs a `.specs/` directory with its supporting files: a ROADMAP (what each version delivers) and a BACKLOG (deferred items). This skill bootstraps that structure so `/spec-new` has a home.
15
+ Before any spec can be created, the project needs a `.specs/` directory with its supporting files: a MILESTONES tracker (what each milestone delivers) and a BACKLOG (deferred items). This skill bootstraps that structure so `/spec-new` has a home.
16
16
 
17
17
  ---
18
18
 
@@ -25,7 +25,7 @@ Glob: .specs/**/*.md
25
25
  ```
26
26
 
27
27
  **If `.specs/` already exists:**
28
- - Report current state: how many specs, versions, whether ROADMAP.md and BACKLOG.md exist
28
+ - Report current state: how many specs, domains, whether MILESTONES.md and BACKLOG.md exist
29
29
  - Suggest `/spec-check` to audit health instead
30
30
  - Do NOT recreate or overwrite anything
31
31
  - Stop here
@@ -36,9 +36,9 @@ Glob: .specs/**/*.md
36
36
 
37
37
  Create the `.specs/` directory at the project root.
38
38
 
39
- ### Step 3: Create ROADMAP.md
39
+ ### Step 3: Create MILESTONES.md
40
40
 
41
- Write `.specs/ROADMAP.md` using the template from `references/roadmap-template.md`.
41
+ Write `.specs/MILESTONES.md` using the template from `references/milestones-template.md`.
42
42
 
43
43
  ### Step 4: Create BACKLOG.md
44
44
 
@@ -63,29 +63,32 @@ Summarize what was created:
63
63
 
64
64
  Created:
65
65
  - `.specs/` directory
66
- - `.specs/ROADMAP.md` — version tracking table
66
+ - `.specs/MILESTONES.md` — milestone tracker
67
67
  - `.specs/BACKLOG.md` — deferred items list
68
68
 
69
69
  Next steps:
70
- - Use `/spec-new <feature-name> <version>` to create your first feature spec
70
+ - Add features to `BACKLOG.md` with priority grades (P0–P3)
71
+ - Pull features into a milestone in `MILESTONES.md` when ready to scope
72
+ - Use `/spec-new <feature-name>` to create a spec (domain is inferred)
73
+ - Use `/spec-refine <feature-name>` to validate before implementation
74
+ - After implementing, use `/spec-review <feature-name>` to verify against the spec
75
+ - Then use `/spec-update` to close the loop
71
76
  - Use `/spec-check` to audit spec health at any time
72
77
  ```
73
78
 
74
79
  ---
75
80
 
76
- ## Hard Constraints
81
+ ## Constraints
77
82
 
78
83
  - **Never overwrite** an existing `.specs/` directory or its contents.
79
- - **ROADMAP.md** must stay under 30 lines (it's a summary, not a plan document).
80
- - **BACKLOG.md** must stay under 15 lines (it grows as items are added).
81
- - Templates are starting points — the user will extend them.
84
+ - Templates are starting points the user will extend them as the project grows.
82
85
 
83
86
  ---
84
87
 
85
88
  ## Ambiguity Policy
86
89
 
87
90
  - If the user runs this in a workspace root with multiple projects, ask which project to initialize.
88
- - If `.specs/` exists but is missing ROADMAP.md or BACKLOG.md, offer to create only the missing files.
91
+ - If `.specs/` exists but is missing MILESTONES.md or BACKLOG.md, offer to create only the missing files.
89
92
 
90
93
  ---
91
94
 
@@ -93,5 +96,5 @@ Next steps:
93
96
 
94
97
  | File | Contents |
95
98
  |------|----------|
96
- | `references/roadmap-template.md` | Starter ROADMAP with version table format |
99
+ | `references/milestones-template.md` | Starter MILESTONES with milestone table format |
97
100
  | `references/backlog-template.md` | Starter BACKLOG with item format |
@@ -1,7 +1,23 @@
1
1
  # Backlog
2
2
 
3
- Deferred items not yet scheduled for a version.
3
+ Priority-graded feature and infrastructure backlog. Items are pulled into milestones when ready to scope and spec. See `MILESTONES.md` for the milestone workflow.
4
4
 
5
- ## Items
5
+ ## P0 — High Priority
6
6
 
7
- - [ ] [Item description] — [context/rationale]
7
+ - [ ] [Feature] — [Description]
8
+
9
+ ## P1 — Important
10
+
11
+ - [ ] [Feature] — [Description]
12
+
13
+ ## P2 — Desired
14
+
15
+ - [ ] [Feature] — [Description]
16
+
17
+ ## P3 — Nice to Have
18
+
19
+ - [ ] [Feature] — [Description]
20
+
21
+ ## Infrastructure & CI
22
+
23
+ - [ ] [Item] — [Description]
@@ -0,0 +1,32 @@
1
+ # Milestones
2
+
3
+ > Features are organized by domain in `.specs/`. Milestones group features
4
+ > into deliverable increments. See `BACKLOG.md` for the feature backlog.
5
+
6
+ ## How Milestones Work
7
+
8
+ 1. **Backlog** — All desired features live in `BACKLOG.md`, graded by priority.
9
+ 2. **Milestone scoping** — When ready to plan a deliverable, pull features from the backlog.
10
+ 3. **Spec first** — Each feature gets a spec (via `/spec-new`) before implementation begins.
11
+ 4. **Ship** — A milestone is done when all its specs are implemented and verified.
12
+
13
+ Only the **current milestone** is defined in detail. Everything else is backlog.
14
+
15
+ ## Released
16
+
17
+ _None yet._
18
+
19
+ ## Current
20
+
21
+ ### [Milestone Name]
22
+
23
+ - [ ] `domain/feature-name.md` — [Brief description]
24
+ - [ ] `domain/feature-name.md` — [Brief description]
25
+
26
+ ## Next
27
+
28
+ > Scoped from `BACKLOG.md` when the current milestone is complete.
29
+
30
+ ## Out of Scope
31
+
32
+ - [Items explicitly not planned]
@@ -5,7 +5,7 @@ description: >-
5
5
  "new feature spec", "write a spec for", "spec this feature",
6
6
  "start a new spec", "plan a feature", or needs to create a new
7
7
  specification file from the standard template.
8
- version: 0.1.0
8
+ version: 0.2.0
9
9
  ---
10
10
 
11
11
  # Create New Feature Specification
@@ -14,7 +14,7 @@ version: 0.1.0
14
14
 
15
15
  A specification is a contract between the person requesting a feature and the person building it. Writing the spec BEFORE implementation forces you to think through edge cases, acceptance criteria, and scope boundaries while changes are cheap — before any code exists.
16
16
 
17
- Every project uses `.specs/` as the specification directory. Specs are version-organized, independently loadable, and capped at 200 lines.
17
+ Every project uses `.specs/` as the specification directory. Specs are domain-organized, independently loadable, and should aim for ~200 lines.
18
18
 
19
19
  ---
20
20
 
@@ -22,33 +22,35 @@ Every project uses `.specs/` as the specification directory. Specs are version-o
22
22
 
23
23
  ### Step 1: Parse Arguments
24
24
 
25
- Extract the feature name and version from `$ARGUMENTS`:
25
+ Extract the feature name from `$ARGUMENTS`:
26
26
  - **Feature name**: kebab-case identifier (e.g., `session-history`, `auth-flow`)
27
- - **Version**: semver string (e.g., `v0.3.0`)
28
27
 
29
- If arguments are missing, ask the user for:
30
- 1. Feature name (what is being built)
31
- 2. Target version (which release this belongs to)
28
+ If the feature name is missing, ask the user what they want to spec.
32
29
 
33
- ### Step 2: Determine File Path
30
+ **Note:** Features should be pulled from the project's backlog (`BACKLOG.md`) into a milestone before creating a spec. If the feature isn't in the backlog yet, add it first, then assign it to a milestone.
34
31
 
35
- - **Multi-feature version** (directory already exists or multiple features planned):
36
- `.specs/{version}/{feature-name}.md`
37
- - **Single-feature version** (one spec covers the whole version):
38
- `.specs/{version}.md`
32
+ ### Step 2: Determine Domain and File Path
33
+
34
+ Analyze the feature name and description to infer an appropriate domain folder:
35
+ - Look at existing domain folders in `.specs/` for a natural fit
36
+ - Consider the feature's area: `auth`, `search`, `ui`, `api`, `onboarding`, etc.
37
+ - Present the inferred domain to the user for confirmation or override
38
+
39
+ The file path is always: `.specs/{domain}/{feature-name}.md`
39
40
 
40
41
  If `.specs/` does not exist at the project root, create it.
41
42
 
42
- If `.specs/{version}/` does not exist and you're using the directory form, create it.
43
+ If `.specs/{domain}/` does not exist, create it.
43
44
 
44
45
  ### Step 3: Create the Spec File
45
46
 
46
47
  Write the file using the standard template from `references/template.md`.
47
48
 
48
49
  Pre-fill:
49
- - **Version**: from arguments
50
+ - **Domain**: from the inferred/confirmed domain
50
51
  - **Status**: `planned`
51
52
  - **Last Updated**: today's date (YYYY-MM-DD)
53
+ - **Approval**: `draft`
52
54
  - **Feature name**: from arguments
53
55
 
54
56
  Leave all other sections as placeholders for the user to fill.
@@ -62,24 +64,30 @@ After creating the file, guide the user through filling it out:
62
64
  3. **Key Files** — Glob the codebase to identify existing files relevant to this feature
63
65
  4. **Schema / Data Model** — Reference file paths only, never inline schemas
64
66
  5. **API Endpoints** — Table format: Method | Path | Description
65
- 6. **Requirements** — EARS format, numbered FR-1, FR-2, NFR-1, etc.
67
+ 6. **Requirements** — EARS format, numbered FR-1, FR-2, NFR-1, etc. Tag all requirements `[assumed]` at creation time — they become `[user-approved]` only after explicit user validation via `/spec-refine`.
66
68
  7. **Dependencies** — What this feature depends on
67
69
  8. **Out of Scope** — Explicit non-goals to prevent scope creep
70
+ 9. **Resolved Questions** — Leave empty at creation; populated by `/spec-refine`
68
71
 
69
72
  ### Step 5: Validate
70
73
 
71
74
  Before finishing:
72
- - [ ] File is 200 lines
75
+ - [ ] If the file exceeds ~200 lines, consider splitting into separate specs in the domain folder
73
76
  - [ ] No source code, SQL, or type definitions reproduced inline
74
- - [ ] Status is `planned`
77
+ - [ ] Status is `planned` and Approval is `draft`
75
78
  - [ ] All required sections present (even if some are "N/A" or "TBD")
76
79
  - [ ] Acceptance criteria are testable
80
+ - [ ] All requirements are tagged `[assumed]`
81
+
82
+ After validation, inform the user: **"This spec MUST go through `/spec-refine` before implementation begins.** All requirements are marked `[assumed]` until explicitly validated."
83
+
84
+ The `/spec-refine` skill walks through every `[assumed]` requirement with the user, validates tech decisions and scope boundaries, and upgrades approved items to `[user-approved]`. The spec's `**Approval:**` becomes `user-approved` only after all requirements pass review.
77
85
 
78
86
  ---
79
87
 
80
- ## Hard Constraints
88
+ ## Sizing Guidelines
81
89
 
82
- - **≤200 lines per spec.** If a feature needs more, split into sub-specs with a parent `_overview.md` (≤50 lines) linking them.
90
+ - **Aim for ~200 lines per spec.** If a feature needs more, consider splitting into separate specs in the domain folder.
83
91
  - **Reference, don't reproduce.** Write `see src/engine/db/migrations/002.sql lines 48-70` — never paste the SQL.
84
92
  - **Independently loadable.** Each spec file must be useful without loading any other file.
85
93
  - **EARS format for requirements.** Use the `specification-writing` skill for templates and examples.
@@ -88,7 +96,7 @@ Before finishing:
88
96
 
89
97
  ## Ambiguity Policy
90
98
 
91
- - If the user doesn't specify a version, ask do not assume.
99
+ - If the user doesn't specify a domain, infer one from the feature name and existing `.specs/` structure, then confirm with the user.
92
100
  - If the feature scope is unclear, write a minimal spec with `## Open Questions` listing what needs clarification.
93
101
  - If a spec already exists for this feature, inform the user and suggest `/spec-update` instead.
94
102
 
@@ -9,9 +9,10 @@ Standard template for all feature specifications. Copy this structure when creat
9
9
  ```markdown
10
10
  # Feature: [Name]
11
11
 
12
- **Version:** v0.X.0
12
+ **Domain:** [domain-name]
13
13
  **Status:** planned
14
14
  **Last Updated:** YYYY-MM-DD
15
+ **Approval:** draft
15
16
 
16
17
  ## Intent
17
18
 
@@ -21,6 +22,8 @@ Standard template for all feature specifications. Copy this structure when creat
21
22
 
22
23
  [Testable criteria. Use Given/When/Then for complex flows, checklists for simple features, or tables for business rules. Every criterion must be verifiable.]
23
24
 
25
+ [Markers: `[ ]` = not started, `[~]` = implemented but not yet verified, `[x]` = verified (tests pass). During `/spec-build`, criteria progress from `[ ]` to `[~]` during implementation, then to `[x]` after review.]
26
+
24
27
  - [ ] [Criterion 1]
25
28
  - [ ] [Criterion 2]
26
29
  - [ ] [Criterion 3]
@@ -56,14 +59,14 @@ Standard template for all feature specifications. Copy this structure when creat
56
59
 
57
60
  ### Functional Requirements
58
61
 
59
- - FR-1: [EARS format requirement — see specification-writing skill for templates]
60
- - FR-2: When [event], the system shall [action].
61
- - FR-3: If [unwanted condition], then the system shall [action].
62
+ - FR-1 [assumed]: [EARS format requirement — see specification-writing skill for templates]
63
+ - FR-2 [assumed]: When [event], the system shall [action].
64
+ - FR-3 [assumed]: If [unwanted condition], then the system shall [action].
62
65
 
63
66
  ### Non-Functional Requirements
64
67
 
65
- - NFR-1: The system shall respond to [endpoint] within [N]ms at the [percentile] percentile.
66
- - NFR-2: [Security, accessibility, scalability requirement]
68
+ - NFR-1 [assumed]: The system shall respond to [endpoint] within [N]ms at the [percentile] percentile.
69
+ - NFR-2 [assumed]: [Security, accessibility, scalability requirement]
67
70
 
68
71
  ## Dependencies
69
72
 
@@ -75,6 +78,10 @@ Standard template for all feature specifications. Copy this structure when creat
75
78
  - [Explicit non-goal 1 — prevents scope creep]
76
79
  - [Explicit non-goal 2]
77
80
 
81
+ ## Resolved Questions
82
+
83
+ [Decisions explicitly approved by the user via `/spec-refine`. Each entry: decision topic, chosen option, date, brief rationale.]
84
+
78
85
  ## Implementation Notes
79
86
 
80
87
  [Post-implementation only. Leave empty in planned specs. After building, document what actually shipped vs. what was planned.]
@@ -108,3 +115,25 @@ Standard template for all feature specifications. Copy this structure when creat
108
115
  | `planned` | Spec written, implementation not started |
109
116
  | `partial` | Some acceptance criteria implemented, work ongoing |
110
117
  | `implemented` | All acceptance criteria met, as-built notes complete |
118
+
119
+ ## Approval Workflow
120
+
121
+ | Tag | Meaning |
122
+ |-----|---------|
123
+ | `[assumed]` | Requirement was drafted by AI or inferred — treated as a hypothesis |
124
+ | `[user-approved]` | Requirement was explicitly reviewed and approved by the user via `/spec-refine` |
125
+
126
+ | Approval Status | Meaning |
127
+ |-----------------|---------|
128
+ | `draft` | Spec has unvalidated assumptions — NOT approved for implementation |
129
+ | `user-approved` | All requirements are `[user-approved]` — ready for implementation |
130
+
131
+ ## Acceptance Criteria Markers
132
+
133
+ | Marker | Meaning |
134
+ |--------|---------|
135
+ | `[ ]` | Not started |
136
+ | `[~]` | Implemented, not yet verified — code written, tests not confirmed |
137
+ | `[x]` | Verified — tests pass, behavior confirmed |
138
+
139
+ **Workflow:** `/spec-new` creates → `/spec-refine` validates → `/spec-build` implements + closes the loop (or implement manually → `/spec-review` verifies → `/spec-update` closes the loop).
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: spec-refine
3
+ description: >-
4
+ This skill should be used when the user asks to "refine a spec",
5
+ "review spec assumptions", "validate spec decisions", "question the
6
+ spec", "iterate on the spec", "check spec for assumptions", "approve
7
+ the spec", "walk me through the spec", or needs iterative
8
+ user-driven refinement of a specification through structured
9
+ questioning rounds.
10
+ version: 0.1.0
11
+ ---
12
+
13
+ # Iterative Spec Refinement
14
+
15
+ ## Mental Model
16
+
17
+ A draft spec is a hypothesis, not a commitment. Every requirement, tech decision, and scope boundary in a draft is an assumption until the user explicitly validates it. This skill systematically mines a spec for unvalidated assumptions, presents each to the user for review via structured questions, and iterates until every decision has explicit user approval.
18
+
19
+ No implementation begins on a spec with `**Approval:** draft`. This skill is the gate.
20
+
21
+ ---
22
+
23
+ ## Workflow
24
+
25
+ ### Step 1: Load & Inventory
26
+
27
+ Find the target spec:
28
+ - If `$ARGUMENTS` contains a path or feature name, use it directly
29
+ - Otherwise, glob `.specs/**/*.md` and ask the user which spec to refine
30
+
31
+ Read the full spec. Catalog:
32
+ - Every section and whether it has content
33
+ - The `**Approval:**` status (should be `draft`)
34
+ - All requirements and their current markers (`[assumed]` vs `[user-approved]`)
35
+ - The `## Open Questions` section (if any)
36
+ - The `## Resolved Questions` section (if any)
37
+
38
+ If the spec is already `**Approval:** user-approved` and all requirements are `[user-approved]`, report this and ask if the user wants to re-review anyway.
39
+
40
+ ### Step 2: Assumption Mining
41
+
42
+ Scan each section systematically for unvalidated decisions. Look for:
43
+
44
+ | Category | What to look for |
45
+ |----------|-----------------|
46
+ | **Tech decisions** | Database choices, auth mechanisms, API formats, libraries, protocols |
47
+ | **Scope boundaries** | What's included/excluded without stated rationale |
48
+ | **Performance targets** | Numbers (response times, limits, thresholds) that were assumed |
49
+ | **Architecture choices** | Where logic lives, service boundaries, data flow patterns |
50
+ | **Behavioral defaults** | Error handling, retry logic, fallback behavior, timeout values |
51
+ | **Unstated dependencies** | Systems, services, or libraries the spec assumes exist |
52
+ | **Security assumptions** | Auth requirements, data sensitivity, access control patterns |
53
+
54
+ For each assumption found, prepare a question with 2-4 alternatives including the current assumption.
55
+
56
+ Present findings via `AskUserQuestion` in rounds of 1-4 questions. Group related assumptions together. Example:
57
+
58
+ ```
59
+ Question: "Which authentication mechanism should this feature use?"
60
+ Options:
61
+ - JWT with refresh tokens (current assumption)
62
+ - Session cookies with httpOnly flag
63
+ - OAuth2 with external provider
64
+ ```
65
+
66
+ Record each answer. After the user responds, check: did any answer reveal new assumptions or contradictions? If yes, add follow-up questions to the queue.
67
+
68
+ ### Step 3: Requirement Validation
69
+
70
+ Walk through every requirement tagged `[assumed]`:
71
+
72
+ 1. **Read the requirement** aloud to the user (via the question text)
73
+ 2. **Assess** — is it specific? testable? complete?
74
+ 3. **Present via AskUserQuestion** with options:
75
+ - Approve as-is
76
+ - Needs revision (user provides direction via "Other")
77
+ - Remove (not needed)
78
+ - Defer to Open Questions (not decidable yet)
79
+
80
+ Process requirements in batches of 1-4 per question round. Prioritize:
81
+ - Requirements with the most ambiguity first
82
+ - Requirements that other requirements depend on
83
+ - Requirements involving tech decisions or external systems
84
+
85
+ For approved requirements, update the marker from `[assumed]` to `[user-approved]`.
86
+ For revised requirements, rewrite per user direction and mark `[user-approved]`.
87
+ For removed requirements, delete them.
88
+ For deferred requirements, move to `## Open Questions`.
89
+
90
+ ### Step 4: Acceptance Criteria Review
91
+
92
+ For each acceptance criterion:
93
+ 1. Is it measurable and testable?
94
+ 2. Does it map to a specific requirement?
95
+ 3. Are there requirements without corresponding criteria?
96
+
97
+ Present gaps to the user:
98
+ - Missing criteria for existing requirements
99
+ - Criteria that don't map to any requirement
100
+ - Criteria with vague or unmeasurable outcomes
101
+
102
+ Get approval on each criterion or batch of related criteria.
103
+
104
+ ### Step 5: Scope & Dependency Audit
105
+
106
+ Review the spec from four perspectives:
107
+
108
+ **User perspective:**
109
+ - Does the feature solve the stated problem?
110
+ - Are there user needs not addressed?
111
+ - Is the scope too broad or too narrow?
112
+
113
+ **Developer perspective:**
114
+ - Is this implementable with the current architecture?
115
+ - Are the key files accurate?
116
+ - Are there missing technical constraints?
117
+
118
+ **Security perspective:**
119
+ - Are there data sensitivity issues?
120
+ - Is authentication/authorization addressed?
121
+ - Are there input validation gaps?
122
+
123
+ **Operations perspective:**
124
+ - Deployment considerations?
125
+ - Monitoring and observability needs?
126
+ - Rollback strategy needed?
127
+
128
+ Surface any missing items via `AskUserQuestion`. Get explicit decisions on scope boundaries and dependency completeness.
129
+
130
+ ### Step 6: Final Approval
131
+
132
+ 1. Present a summary of all changes made during refinement:
133
+ - Assumptions resolved (count)
134
+ - Requirements approved/revised/removed
135
+ - New criteria added
136
+ - Scope changes
137
+
138
+ 2. Ask for final approval via `AskUserQuestion`:
139
+ - "Approve spec — all decisions validated, ready for implementation"
140
+ - "More refinement needed — specific concerns remain"
141
+
142
+ 3. On approval:
143
+ - Set `**Approval:** user-approved`
144
+ - Update `**Last Updated:**` to today
145
+ - Verify all requirements are tagged `[user-approved]`
146
+ - Populate `## Resolved Questions` with the decision trail from this session
147
+
148
+ 4. On "more refinement needed":
149
+ - Ask what concerns remain
150
+ - Loop back to the relevant phase
151
+
152
+ ---
153
+
154
+ ## Convergence Rules
155
+
156
+ - After each phase, check: did answers from this phase raise new questions? If yes, run another questioning round before advancing.
157
+ - The skill does NOT terminate until ALL of:
158
+ - Every `[assumed]` requirement is resolved (approved, revised, removed, or deferred)
159
+ - All acceptance criteria are reviewed
160
+ - The user gives explicit final approval
161
+ - If the user wants to stop early, leave `**Approval:** draft` and note remaining items in `## Open Questions`.
162
+
163
+ ---
164
+
165
+ ## Resolved Questions Format
166
+
167
+ Each resolved question follows this format:
168
+
169
+ ```markdown
170
+ 1. **[Decision topic]** — [Chosen option] (user-approved, YYYY-MM-DD)
171
+ - Options considered: [list]
172
+ - Rationale: [brief user reasoning or context]
173
+ ```
174
+
175
+ Keep entries concise — decision + options + rationale in 2-3 lines each.
176
+
177
+ ---
178
+
179
+ ## Ambiguity Policy
180
+
181
+ - If the spec has no `**Approval:**` field, treat it as `draft` and add the field.
182
+ - If requirements lack `[assumed]`/`[user-approved]` tags, treat all as `[assumed]`.
183
+ - If the user says "approve everything" without reviewing individual items, warn that blanket approval defeats the purpose — offer to fast-track by presenting summaries of each batch.
184
+ - If the spec is very short (< 30 lines), the full 6-phase process may be unnecessary. Adapt: merge phases 2-4 into a single review pass. Still require explicit final approval.
185
+ - If the user provides a feature name that matches multiple specs, list them and ask which to refine.
186
+
187
+ ---
188
+
189
+ ## Anti-Patterns
190
+
191
+ - **Rubber-stamping**: Presenting assumptions and immediately suggesting "approve all." Every assumption gets its own question with real alternatives.
192
+ - **Leading questions**: "Should we use JWT as planned?" is leading. Present alternatives neutrally: "Which auth mechanism should this feature use? Options: JWT, sessions, OAuth2."
193
+ - **Skipping phases**: Every phase surfaces different types of assumptions. Don't skip phases even if earlier phases had few findings.
194
+ - **Silent upgrades**: Never change `[assumed]` to `[user-approved]` without presenting the item to the user first.