@jakkrichm/create-nexus-devflow 2.2.0 → 2.2.2

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/create-nexus-devflow.js +1 -1
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/command-catalog.js +5 -2
  5. package/dist/lib/command-catalog.js.map +1 -1
  6. package/dist/lib/dashboard.js +1 -1
  7. package/dist/lib/discoveries.js +18 -6
  8. package/dist/lib/discoveries.js.map +1 -1
  9. package/dist/lib/gatekeeper.d.ts +4 -0
  10. package/dist/lib/gatekeeper.js +13 -1
  11. package/dist/lib/gatekeeper.js.map +1 -1
  12. package/dist/lib/ideas.js +2 -2
  13. package/dist/lib/ideas.js.map +1 -1
  14. package/dist/lib/update.js +6 -2
  15. package/dist/lib/update.js.map +1 -1
  16. package/dist/lib/workflow-state.js +9 -6
  17. package/dist/lib/workflow-state.js.map +1 -1
  18. package/dist/scripts/prepare-template.js +10 -2
  19. package/dist/scripts/prepare-template.js.map +1 -1
  20. package/package.json +1 -1
  21. package/template/.agents/skills/10-define/SKILL.md +1 -1
  22. package/template/.agents/skills/30-plan/SKILL.md +13 -7
  23. package/template/.agents/skills/40-execute/SKILL.md +8 -11
  24. package/template/.agents/skills/50-verify/SKILL.md +14 -7
  25. package/template/.agents/skills/brainstorm/SKILL.md +1 -1
  26. package/template/.agents/skills/check/SKILL.md +19 -11
  27. package/template/.agents/skills/debug/SKILL.md +4 -8
  28. package/template/.agents/skills/devflow/SKILL.md +9 -7
  29. package/template/.agents/skills/discovery/SKILL.md +75 -150
  30. package/template/.agents/skills/feature/SKILL.md +9 -4
  31. package/template/.agents/skills/grill/SKILL.md +93 -0
  32. package/template/.agents/skills/implement/SKILL.md +12 -8
  33. package/template/.claude/skills/10-define/SKILL.md +1 -1
  34. package/template/.claude/skills/30-plan/SKILL.md +13 -7
  35. package/template/.claude/skills/40-execute/SKILL.md +8 -11
  36. package/template/.claude/skills/50-verify/SKILL.md +14 -7
  37. package/template/.claude/skills/brainstorm/SKILL.md +1 -1
  38. package/template/.claude/skills/check/SKILL.md +19 -11
  39. package/template/.claude/skills/debug/SKILL.md +4 -8
  40. package/template/.claude/skills/devflow/SKILL.md +9 -7
  41. package/template/.claude/skills/discovery/SKILL.md +75 -150
  42. package/template/.claude/skills/feature/SKILL.md +9 -4
  43. package/template/.claude/skills/grill/SKILL.md +93 -0
  44. package/template/.claude/skills/implement/SKILL.md +12 -8
  45. package/template/AGENTS.md +6 -6
  46. package/template/devflow/build-plan.md +10 -0
  47. package/template/devflow/context/ai-interaction.md +34 -7
  48. package/template/devflow/context/coding-standards.md +32 -7
  49. package/template/devflow/context/current-stage.md +1 -1
  50. package/template/devflow/decisions/.gitkeep +0 -0
  51. package/template/devflow/decisions/README.md +24 -0
  52. package/template/devflow/history/HISTORY.md +1 -1
  53. package/template/.agents/skills/00-explore/SKILL.md +0 -84
  54. package/template/.claude/skills/00-explore/SKILL.md +0 -84
@@ -23,7 +23,7 @@ Use this skill to guide the user on what to do next, inspect current workspace s
23
23
  Nexus-DevFlow supports two seamless workflow tracks:
24
24
  1. **🏎️ Fast-Track (Blueprint Mode - 4 Steps)**: `/spec` ➔ `/implement` ➔ `/check` ➔ `/complete`
25
25
  *Driven by a **Single Living Spec (`current-feature.md`)** for fast, high-velocity daily development and bugfixes (85% of tasks).*
26
- 2. **🏗️ Deep-Track (Architect Mode - 8 Steps)**: `00-explore` ➔ `10-define` ➔ `20-spec` ➔ `30-plan` ➔ `40-execute` ➔ `50-verify` ➔ `60-report` ➔ `70-deliver`
26
+ 2. **🏗️ Deep-Track (Architect Mode - 8 Steps)**: `discovery` ➔ `10-define` ➔ `20-spec` ➔ `30-plan` ➔ `40-execute` ➔ `50-verify` ➔ `60-report` ➔ `70-deliver`
27
27
  *Driven by modular separate stage files for large, high-stakes architectural epics and multi-agent coordination.*
28
28
 
29
29
  ---
@@ -45,14 +45,14 @@ When invoked without an argument (or when determining the next step), inspect:
45
45
  - If at `40-execute.md` with all tasks done -> Recommend `50-verify {RUNNING_ID}`.
46
46
  - If passed `50-verify.md` -> Recommend `60-report {RUNNING_ID}` then `70-deliver {RUNNING_ID}`.
47
47
  3. **Active Discovery**: Check `devflow/discoveries/` for open discovery notes.
48
- 4. **Pending Ideas Inbox**: Check `devflow/ideas.md`. If items exist under `## 📌 Pending Ideas`, summarize them in a **💡 Pending Ideas (Inbox)** list with their IDs (`[IDEA-xxx]`), feasibility, and mention that they can be started with `/spec IDEA-xxx`.
48
+ 4. **Pending Ideas Inbox**: Check `devflow/ideas.md`. If items exist under `## 📌 Pending Ideas`, summarize them in a **💡 Pending Ideas (Inbox)** list with their IDs (`[IDEA-xxx]`), feasibility, and mention that they can be started with `/spec IDEA-xxx` or `/discovery IDEA-xxx`.
49
49
  5. **Audit Findings Ledger**: Check `devflow/context/findings.md` for open high-severity findings.
50
50
 
51
51
  ### Default State Recommendations
52
52
  - if no run is active and user wants to start a feature -> Recommend `/feature <name>`.
53
53
  - If no run is active and user wants to fix a bug -> Recommend `/fix <bug>`.
54
- - If no run is active and user has pending ideas in `devflow/ideas.md` -> Highlight `/spec IDEA-xxx`.
55
- - If no run is active and user wants deep architectural exploration -> Recommend `00-explore`.
54
+ - If no run is active and user has pending ideas in `devflow/ideas.md` -> Highlight `/spec IDEA-xxx` or `/discovery IDEA-xxx`.
55
+ - If no run is active and user wants deep architectural exploration -> Recommend `discovery`.
56
56
  - If user asks to check system health -> Recommend `doctor`.
57
57
 
58
58
  ---
@@ -71,7 +71,7 @@ When invoked without an argument (or when determining the next step), inspect:
71
71
  | "Setup DevFlow on fresh/new project" | `onboard` | `onboard` / `setup` | `onboard` -> `/spec` or `10-define` |
72
72
  | "Adopt DevFlow on existing codebase" | `adopt` | `adopt` / `bootstrap` | `adopt` -> `/spec` or `10-define` |
73
73
  | "Check setup health & diagnostics" | `doctor` | `doctor` / `health` | `doctor` |
74
- | "Explore a new request / deep idea" | `00-explore` | `discover` | **Deep-Track**: `00` -> `10` -> `20` -> ... |
74
+ | "Explore a new request / deep idea" | `discovery` | `discovery` / `/discovery` | **Deep-Track**: `discovery` -> `10` -> `20` -> ... |
75
75
  | "Define delivery boundaries and ID" | `10-define` | `define` | **Deep-Track**: `10` -> `20` -> `30` |
76
76
  | "Break down spec into plan (Deep)" | `30-plan` | `plan` | **Deep-Track**: `30` -> `40` -> `50` |
77
77
  | "Deep code implementation" | `40-execute` | `implement` | **Deep-Track**: `40` -> `50` |
@@ -84,6 +84,7 @@ When invoked without an argument (or when determining the next step), inspect:
84
84
  | "Pre-check scope & risks before spec" | `brief` | `brief` | Companion |
85
85
  | "Run autonomous bounded delivery loop"| `autopilot` | `autopilot` | Companion |
86
86
  | "Brainstorm ideas without ID" | `brainstorm` | `brainstorm` | Companion |
87
+ | "Socratic alignment / ADR / glossary" | `grill` | `/grill` / `align` | Companion (pre-spec / domain modeling) |
87
88
  | "Investigate failure or root cause" | `debug` | `debug` | Companion |
88
89
 
89
90
  ---
@@ -97,7 +98,7 @@ When invoked without an argument (or when determining the next step), inspect:
97
98
  - `complete` (`/complete`, `$complete`) - Safety pass, release digest, git merge, close run
98
99
 
99
100
  ### 2. Deep-Track (Architect Mode - 8 Steps)
100
- - `00-explore` - Explore request and decide Proceed/Defer/Reject
101
+ - `discovery` - Project roadmap planning or feature exploration before delivery commitment
101
102
  - `10-define` - Lock delivery boundaries and allocate Running ID
102
103
  - `20-spec` - Formalize markdown delivery contract
103
104
  - `30-plan` - Breakdown spec into phased tasks with test decisions
@@ -109,6 +110,8 @@ When invoked without an argument (or when determining the next step), inspect:
109
110
  ### 3. Public Companion Commands
110
111
  - `devflow` (`status`, `/devflow`) - Interactive guide, state inspector, and router
111
112
  - `idea` (`/idea`) - Quick idea capture and AI feasibility enrichment into `devflow/ideas.md`
113
+ - `grill` (`/grill`, `align`) - Codebase-grounded Socratic alignment, domain glossary, and ADR recorder
114
+ - `brainstorm` - Ideate and compare trade-off options without allocating running IDs
112
115
  - `report-html` (`/report:html`) - Standalone interactive HTML report dashboard generator
113
116
  - `onboard` - Baseline stack setup for freshly scaffolded projects
114
117
  - `adopt` - Bootstrap DevFlow into existing brownfield projects
@@ -118,6 +121,5 @@ When invoked without an argument (or when determining the next step), inspect:
118
121
  - `ci` - Automatic GitHub Actions workflow setup
119
122
  - `brief` - Read-only scope and risk pre-briefing
120
123
  - `autopilot` - Autonomous bounded delivery loop
121
- - `brainstorm` - Ideate without allocating running IDs
122
124
  - `debug` - Root cause investigation before or during implementation
123
125
  - `overview` - Living context synchronization into project-overview.md
@@ -1,166 +1,91 @@
1
1
  ---
2
2
  name: discovery
3
- description: "[devflow][B] Optional deep, multi-turn project discovery that helps the user develop detailed Blueprint project-plan.md and build-plan.md files through an adaptive conversation, then drafts them only after the user says they are ready. Use when the user explicitly runs /discovery or $discovery, asks for a guided planning interview, wants to think through a new product before writing the plans, or wants help deepening existing plans. Do not use merely because planning files are empty, after /onboard, or before /overview; users may always write the plans directly or create them through any conversation they prefer."
3
+ description: "[devflow][D] Unified discovery and exploration stage in DevFlow 2.0 - conducts project-level roadmap discovery (project-plan.md/build-plan.md) or feature-level exploration (Stage 00) before delivery commitment."
4
+ argument-hint: "[{title, request, IDEA-xxx, or discovery-id}]"
4
5
  ---
5
6
 
6
- # discovery - develop the plans through a deep conversation
7
+ # discovery - Unified Discovery & Pre-Delivery Exploration
7
8
 
8
- Where this can sit in the workflow:
9
+ $ARGUMENTS
9
10
 
10
- /onboard -> write the plans directly -> /overview
11
- \
12
- -> [discovery] -> review and approve plan drafts -> /overview
11
+ `/discovery` is the central discovery entry point in Nexus-DevFlow. It operates in two adaptive modes based on input scope:
12
+ 1. **🗺️ Macro Project Discovery**: Develops high-level product and build roadmap plans (`devflow/project-plan.md` & `devflow/build-plan.md`) through an adaptive conversation before `/overview`.
13
+ 2. **🔍 Micro Feature Exploration (Stage 00)**: Explores a specific feature, request, or idea before committing to delivery, routes through supporting lenses, and finishes with a visible `Proceed`, `Defer`, or `Reject` decision before `10-define`.
13
14
 
14
- `/discovery` is an optional planning partner, not a required workflow gate and
15
- not a quick questionnaire. It can span as many turns as the project needs. Its
16
- job is to help the user think through the product, preserve the depth and nuance
17
- of that conversation, and draft the two user-owned planning files only when the
18
- user asks for drafts.
15
+ ---
16
+
17
+ ## Invocations & Usage
19
18
 
20
- Running `/onboard` never starts this skill. Empty plans never require it. A user
21
- who writes detailed plans manually, has another AI conversation, or arrives with
22
- finished plans continues directly to `/overview` exactly as before.
19
+ ```text
20
+ # 1. Macro Project Planning Mode (No arguments or project scope)
21
+ /discovery
22
+ /discovery --project
23
23
 
24
- ## Step 1 - establish the starting point
24
+ # 2. Micro Feature Exploration Mode (Stage 00 of Deep-Track)
25
+ /discovery {title or request}
26
+ /discovery IDEA-xxx
27
+ /discovery {discovery-id}
28
+ ```
25
29
 
26
- Read only the planning and project facts needed for the conversation:
30
+ ---
27
31
 
28
- - `devflow/project-plan.md`
29
- - `devflow/build-plan.md`
30
- - the root project manifest, README, and framework configuration when they
31
- already contain relevant facts
32
- - `devflow/context/project-overview.md` only when the user is revisiting an
33
- established project's direction
32
+ ## Mode 1: Macro Project Discovery (Roadmap & System Planning)
34
33
 
35
- Classify each planning file as a template, partial draft, or substantive plan.
36
- Never treat existing user content as disposable. When either plan has real
37
- content, summarize what it already establishes and ask whether the user wants to
38
- deepen it, revise a specific direction, or use it unchanged as conversation
39
- context. Do not replace it with a fresh generic plan.
34
+ Use when:
35
+ - Starting a new product or shaping high-level architecture across the entire repository.
36
+ - Revisiting the overall project vision, major milestones, or tech stack before generating `/overview`.
40
37
 
41
- Start with a short working hypothesis about the project and name the most
42
- important unknown. Then ask one focused question. Do not draft either plan yet.
38
+ ### Process:
39
+ 1. **Establish Baseline**: Read `devflow/project-plan.md` and `devflow/build-plan.md` (if present).
40
+ 2. **Adaptive Conversation**: Ask 1-2 focused questions at a time covering problem space, user workflows, MVP boundaries, non-goals, data models, and stack constraints.
41
+ 3. **Periodic Snapshots**: Provide compact summaries of confirmed decisions, working assumptions, and open TODOs.
42
+ 4. **Draft Plans Behind Approval Gate**: Draft proposed `project-plan.md` and `build-plan.md` only when the user explicitly requests drafts.
43
+ 5. **Write on Approval**: Write approved files and recommend `/overview` as the next step.
43
44
 
44
- ## Step 2 - run adaptive discovery
45
+ ---
46
+
47
+ ## Mode 2: Micro Feature Exploration (Stage 00 of Deep-Track)
48
+
49
+ Use when:
50
+ - Exploring a specific feature, complex architectural change, or pending idea (`/discovery IDEA-xxx`).
51
+ - The team needs to evaluate feasibility, options, domain glossary, or root causes before locking delivery scope.
52
+
53
+ ### Markdown-First Contract:
54
+ Write the primary discovery artifact to:
55
+ ```text
56
+ devflow/discoveries/{DISCOVERY_ID}-{slug}/discovery.md
57
+ ```
58
+ *(A Discovery ID uses the namespace `DISC-YYYYMMDD-NNN`. It is not a Running ID and does not reserve a numeric delivery run.)*
59
+
60
+ ### 5 Supporting Routes & Built-in Lenses:
61
+
62
+ 1. **Brainstorming Lens (Divergent & Convergent)**:
63
+ - Formulate 2-3 viable options with trade-offs.
64
+ - Construct a **Trade-off Comparison Table** (Pros, Cons, Recommendation).
65
+ 2. **Research & Empirical Proof Lens**:
66
+ - Inspect existing codebase patterns with search tools (`grep_search`, `rg`).
67
+ - Conduct external web search if library feasibility or API contracts are uncertain.
68
+ 3. **PRD & Scoping Lens**:
69
+ - Problem Statement, Target Persona, Core User Stories, and In-Scope vs. Out-of-Scope boundaries.
70
+ 4. **Issue & Bug Triage Lens**:
71
+ - Classify severity (`Critical/Blocker`, `Major`, `Minor`) and determine whether root-cause analysis (`debug`) is required.
72
+ 5. **Socratic Grilling & Domain Alignment Lens (`grill`)**:
73
+ - Codebase-grounded interactive inquiry to clarify entity boundaries, data flows, and edge cases.
74
+ - Record agreed terminology in `devflow/context/glossary.md` and major architecture decisions in `devflow/decisions/ADR-xxx-{slug}.md`.
75
+
76
+ ### Decision & Approval Gate:
77
+ Set one visible decision:
78
+ - `Proceed`: Enough value and evidence exist to define delivery work:
79
+ - **🏎️ Fast-Track (Recommended for 85% of standard features/fixes)**: Handoff to `/feature {discovery_id}` or `/fix {discovery_id}` (writes `devflow/context/current-feature.md`).
80
+ - **🏗️ Deep-Track (For large architectural epics/migrations)**: Handoff to `10-define {discovery_id}` (writes `devflow/context/current-run/10-define.md`).
81
+ - `Defer`: The idea remains relevant but timing or evidence is not ready.
82
+ - `Reject`: The idea should not proceed under current framing.
83
+
84
+ ---
45
85
 
46
- Ask one meaningful question at a time and let each answer shape the next one.
47
- Prefer a likely interpretation the user can correct over a vague request for
48
- more detail. Explain a tradeoff when the answer would materially change scope,
49
- architecture, cost, or build order.
86
+ ## Next Workflow Recommendations
50
87
 
51
- Cover the areas that matter to this project, not a fixed questionnaire:
52
-
53
- - problem, desired outcome, and why the project should exist
54
- - target users, their context, and their primary workflows
55
- - MVP capabilities, explicit non-goals, and later possibilities
56
- - business rules, data, integrations, permissions, and important edge cases
57
- - stack choices, constraints, dependencies, and technical unknowns
58
- - UI/UX direction, accessibility needs, and useful references
59
- - monetization or business model when relevant
60
- - deployment shape, environments, background work, storage, and operations
61
- - risks, assumptions, unresolved decisions, and how success will be judged
62
- - feature boundaries, dependencies, and a sensible build order
63
-
64
- Depth is the goal. Follow a consequential answer until its implications are
65
- clear instead of racing to the next category. Do not ask the user to repeat facts
66
- already established in the conversation or repository. Do not force irrelevant
67
- topics merely to complete a checklist.
68
-
69
- Periodically return a compact discovery snapshot with:
70
-
71
- - confirmed decisions
72
- - working assumptions that still need confirmation
73
- - open questions or conflicts
74
- - ideas explicitly deferred or excluded
75
-
76
- The snapshot keeps a long conversation coherent. It is not permission to write
77
- the plans.
78
-
79
- ## Step 3 - decide whether the plans are ready
80
-
81
- Do not end discovery because a preset number of questions has been reached. It
82
- is ready to draft when:
83
-
84
- - the problem, users, and core workflows are concrete
85
- - MVP scope and non-goals are distinguishable
86
- - data and technical choices are detailed enough to expose major dependencies
87
- - the build order can be expressed as feature-sized outcomes
88
- - important contradictions are resolved
89
- - remaining unknowns are either safe to defer or explicitly accepted as TODOs
90
- - the user says they are ready for the plans to be drafted
91
-
92
- If the user asks for drafts while a material gap remains, name the gap and ask
93
- whether to continue discovery or preserve it as an explicit TODO. Respect the
94
- choice. The user may also stop at any time and write the plans manually.
95
-
96
- ## Step 4 - draft both planning files
97
-
98
- When the user asks for drafts, produce complete proposed contents for both files
99
- without writing them yet.
100
-
101
- For `devflow/project-plan.md`:
102
-
103
- - keep the template's main subject areas, adding useful sections when the
104
- conversation requires them
105
- - preserve rationale, examples, tradeoffs, constraints, edge cases, and
106
- exclusions that will matter during later feature work
107
- - be as detailed as the project needs; never compress a rich discovery into a
108
- line or two per section
109
- - distinguish confirmed decisions from assumptions and TODOs
110
-
111
- For `devflow/build-plan.md`:
112
-
113
- - use numbered checkboxes and optional milestone headings
114
- - keep each item a high-level, feature-sized outcome with a concise description
115
- - order items by dependency and the earliest useful vertical slice
116
- - keep implementation detail in later `/feature` specs rather than turning the
117
- roadmap into a task dump
118
- - include only agreed scope; place deferred ideas outside the MVP or omit them as
119
- the user directed
120
-
121
- If substantive plans already exist, preserve their information and completed
122
- build-plan numbering. Clearly identify proposed additions, removals, or changed
123
- decisions.
124
-
125
- End by asking the user to review the full drafts. Do not write either file in the
126
- same response that first presents them.
127
-
128
- ## Step 5 - write only after approval
129
-
130
- Write the approved drafts only after the user explicitly approves them. If the
131
- user requests changes, revise the drafts and show the affected sections again
132
- before writing.
133
-
134
- After writing:
135
-
136
- - report which files changed
137
- - list any retained TODOs or unresolved decisions
138
- - remind the user that both files remain theirs to edit and deepen directly
139
- - stop before generating `devflow/context/project-overview.md`
140
- - point to `/overview` or `$overview` as the next optional command when the user
141
- is satisfied with the plans
142
-
143
- ## Rules
144
-
145
- - This skill is always optional. Never make it a prerequisite for `/overview`,
146
- `/feature`, or any other Blueprint command.
147
- - Never start it automatically from `/onboard`, because planning files are
148
- empty, or because a project is new.
149
- - Never imply that plans created manually or through another conversation are
150
- inferior or incomplete merely because this skill was not used.
151
- - Never overwrite substantive planning content without showing the replacement
152
- and receiving explicit approval.
153
- - Never write plans during the interview or after a vague signal such as "looks
154
- good." The user must explicitly approve the proposed file contents.
155
- - Never scaffold the app, edit product code, generate the overview, create a
156
- feature spec, commit, merge, push, or deploy.
157
- - Preserve detailed project reasoning in `project-plan.md`, while keeping
158
- `build-plan.md` high-level and trackable.
159
- - Keep the conversation adaptive. Depth comes from relevant follow-up questions,
160
- not from mechanically asking every possible question.
161
-
162
- ## Formatting
163
-
164
- Follow `devflow/context/ai-interaction.md`. During discovery, ask one focused
165
- question per turn. For snapshots and draft reviews, use concise headings and
166
- lists so confirmed decisions and remaining gaps are easy to inspect.
88
+ - **From Macro Project Mode**: Run `/overview` to compile context into `devflow/context/project-overview.md`.
89
+ - **From Micro Stage 00 (Approved Proceed ➔ Fast-Track)**: Run `/feature {discovery_id}` to start lean living spec.
90
+ - **From Micro Stage 00 (Approved Proceed Deep-Track)**: Run `10-define {discovery_id}` to allocate a Running ID.
91
+ - **From Micro Stage 00 (Defer / Reject)**: No next command needed.
@@ -32,6 +32,7 @@ big item has been split into sub-items, the next unchecked sub-item is the targe
32
32
 
33
33
  ## Step 1 - pick the target
34
34
 
35
+ - Given a Discovery ID or Idea ID (e.g. `/feature DISC-20260824-001` or `/feature IDEA-001`) -> import problem context, research, trade-offs, and ADRs from `devflow/discoveries/{DISC-ID}/discovery.md` or `devflow/ideas.md` into the living spec.
35
36
  - Given a number or name that matches a build-plan item -> use it.
36
37
  - Given a request that clearly describes a new feature with no reasonable match
37
38
  in the build plan -> follow **New-feature intake** below.
@@ -112,10 +113,14 @@ build plan starts high-level.
112
113
 
113
114
  For the one (sub-)feature being built now, write a full spec to
114
115
  `devflow/context/current-feature.md` (create `devflow/context/` if needed), following
115
- `reference/feature-spec-template.md`. Fill every section: goal, in/out of scope,
116
- the build loop, small build steps as a checklist (`- [ ]`, each with an observable
117
- "done when" - `/implement` ticks them off and resumes from the first unchecked
118
- one), files/areas, data/contracts, testing, and notes for the AI.
116
+ `reference/feature-spec-template.md`. Fill every section:
117
+ - Goal, Problem Statement, and In/Out of scope
118
+ - Acceptance Criteria (AC-1, AC-2, ...)
119
+ - Small build steps as atomic 2-5 min checklist items (`- [ ]`, supporting `[TDD-Red]`, `[TDD-Green]`, `[TDD-Refactor]` triplets for functional logic)
120
+ - Two-Stage Verification Strategy:
121
+ - **Stage 1**: Spec Fidelity & Acceptance Criteria Gate
122
+ - **Stage 2**: Technical Multi-lane quality, tests, security, and findings ledger
123
+ - Files/areas to modify, data/contracts, and notes for the AI.
119
124
 
120
125
  **Visual or replication features need a reference image.** If the feature is
121
126
  "make it look like X" - recreating an existing design, matching a mockup, or
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: grill
3
+ description: "[devflow][B] Interactive Socratic alignment & domain modeling - stress-test plans, extract domain glossary, and record architecture decision records (ADRs) before delivery."
4
+ argument-hint: "{topic, plan, or question}"
5
+ ---
6
+
7
+ # grill - Socratic Alignment & Domain Modeling
8
+
9
+ $ARGUMENTS
10
+
11
+ Use this skill to conduct a codebase-grounded, interactive Socratic interview with the user. It clarifies domain vocabulary, resolves architectural ambiguities, and prevents misalignment before writing specifications or code.
12
+
13
+ ## Invocations & Aliases
14
+
15
+ - `/grill {topic or plan}`: Standard slash command in Claude Code, Google Antigravity, and Gemini CLI
16
+ - `grill {topic or plan}`: Plain text invocation
17
+ - `$grill {topic or plan}`: Codex CLI invocation
18
+ - `/align {topic}`: Alias for domain alignment
19
+
20
+ ## Core Philosophy: Align Before You Build
21
+
22
+ 1. **Codebase-Grounded**: Read existing code and context first. Never ask questions the codebase can already answer.
23
+ 2. **One Round at a Time**: Ask 1-2 focused, high-leverage questions per round with clear recommended defaults. Never dump a wall of 10 questions.
24
+ 3. **Lazy Inline Persistence**:
25
+ - Write agreed domain terminology to `devflow/context/glossary.md` the moment each term resolves.
26
+ - Record significant, hard-to-reverse technical decisions as ADRs in `devflow/decisions/ADR-xxx-{slug}.md`.
27
+ 4. **Zero Assumptions**: Challenge ambiguities, contradictory requirements, and naming inconsistencies upfront.
28
+
29
+ ---
30
+
31
+ ## Process & Execution Loop
32
+
33
+ ### 1. Grounding Phase (Silent Inspection)
34
+ Before asking the first question:
35
+ - Read `devflow/context/project-overview.md` and `devflow/context/coding-standards.md`.
36
+ - Inspect existing domain terms in `devflow/context/glossary.md` (if present).
37
+ - Search codebase patterns (`grep_search` / `rg`) related to the topic to ground technical reality.
38
+
39
+ ### 2. Interactive Socratic Interview Loop
40
+ In each turn:
41
+ - Identify the most critical unresolved branch in the design tree:
42
+ - **Domain Language & Boundaries**: "What exactly is an Entity X versus Entity Y in this context?"
43
+ - **Data Flow & Contracts**: "Who owns state X? Synchronous vs. asynchronous?"
44
+ - **Edge Cases & Failure Modes**: "What happens on network failure, concurrent mutation, or invalid input?"
45
+ - **Irreversible Trade-offs**: "Database schema change vs. application-layer adapter?"
46
+ - Ask **1-2 questions maximum** per turn.
47
+ - Always provide a recommended default with concise technical rationale.
48
+ - Wait for the user's answer.
49
+
50
+ ### 3. Immediate State Persistence
51
+
52
+ #### A. Domain Glossary (`devflow/context/glossary.md`)
53
+ When a domain term or conceptual definition crystallizes, immediately create or append to `devflow/context/glossary.md`:
54
+
55
+ ```markdown
56
+ ### [Term / Concept]
57
+ - **Definition**: Clear, unambiguous definition within this project.
58
+ - **Constraints**: Invariants, boundaries, or lifecycle rules.
59
+ - **Aliases / Related**: Related terms or common misnomers.
60
+ ```
61
+
62
+ #### B. Architecture Decision Records (`devflow/decisions/ADR-xxx-{slug}.md`)
63
+ When a decision meets the 3 ADR criteria:
64
+ 1. **Significant Impact**: Affects architecture, data schema, security, or public API.
65
+ 2. **Hard to Reverse**: Changing it later requires painful migration or refactoring.
66
+ 3. **Multiple Viable Alternatives**: There were real trade-offs between 2+ options.
67
+
68
+ Allocate the next sequential ID (`ADR-001`, `ADR-002`, ...) and create `devflow/decisions/ADR-xxx-{slug}.md`:
69
+
70
+ ```markdown
71
+ # ADR-xxx: {Title}
72
+
73
+ - **Status**: Accepted
74
+ - **Date**: {YYYY-MM-DD}
75
+ - **Context**: {Why was this decision needed? What problem does it solve?}
76
+ - **Decision**: {What did we decide to do?}
77
+ - **Alternatives Considered**:
78
+ - *Option 1*: {Pros / Cons}
79
+ - *Option 2*: {Pros / Cons}
80
+ - **Consequences**:
81
+ - *Positive*: {Benefits gained}
82
+ - *Trade-offs / Risks*: {Costs, constraints, or follow-ups}
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 4. Closing & Handoff
88
+
89
+ When all design branches are resolved:
90
+ 1. Summarize settled domain terms and created ADRs.
91
+ 2. Provide explicit next command recommendations:
92
+ - **Fast-Track (Standard Features/Fixes)**: Run `/feature {topic}` or `/fix {topic}` to immediately start the living spec.
93
+ - **Deep-Track (Large Architectural Epics)**: Run `10-define` or `/discovery` with the discovery context.
@@ -88,19 +88,23 @@ broad checkout. Ask whether to resolve only the conflict allowed by the approved
88
88
  spec or abandon the attempt. A cascade into another completed feature needs a
89
89
  new rollback plan.
90
90
 
91
- ## Step 2 - build one step, review, iterate, checkpoint
91
+ ## Step 2 - build one step, review, iterate, checkpoint (Strict TDD)
92
92
 
93
93
  Work through the spec's build steps in order, one at a time. For each step:
94
94
 
95
- 1. Implement just that step: the smallest change that satisfies its "done when."
96
- 2. Show the **diff**, not whole files.
97
- 3. **Explain it, and prove it.** Give a short summary: what the step delivered,
95
+ 1. **Strict TDD Cycle (for logic & behavior changes)**:
96
+ - **🔴 RED**: Write the unit test first in the relevant test file. Execute the test command and show the failing assertion output.
97
+ - **🟢 GREEN**: Implement only the minimal code in the source file necessary to make the test pass. Re-run test and show passing output.
98
+ - **🔵 REFACTOR**: Refactor and format cleanly, verifying that 100% of tests remain green.
99
+ - *Code Reversion Rule*: If production code is written without a prior test for behavior changes, revert it and write the test first.
100
+ 2. Implement just that step: the smallest change that satisfies its "done when."
101
+ 3. Show the **diff**, not whole files.
102
+ 4. **Explain it, and prove it.** Give a short summary: what the step delivered,
98
103
  one line per changed file on what it does and why, then confirm the step's
99
- "done when" is met with evidence (build output, a screenshot, a passing
100
- assertion). This summary is the comprehension gate, so keep it concrete, not
101
- ceremonial. Include a short **How to try it** note when the step has a manual
104
+ "done when" is met with empirical evidence (test pass output, build output, or screenshot). This summary is the comprehension gate, so keep it concrete, not
105
+ vague. Include a short **How to try it** note when the step has a manual
102
106
  path: the command, URL, click, endpoint, or output the user can check.
103
- 4. **Verify the step.** If `AGENTS.md` declares a `Verify` command, run that exact
107
+ 5. **Verify the step.** If `AGENTS.md` declares a `Verify` command, run that exact
104
108
  command as the automated gate. It is only an umbrella for checks the project
105
109
  actually has, so do not invent tests or other checks to satisfy it. If no
106
110
  `Verify` command exists, run the documented build command and the test command
@@ -31,10 +31,10 @@ Unused adapter families can be removed. Codex, Antigravity, GitHub Copilot, and
31
31
 
32
32
  ### Universal Invocation & Agent Directives:
33
33
 
34
- 1. **Canonical Command Names & AI Provider Invocation**: Each workflow stage and companion tool has exactly **one Canonical Name** (e.g. `feature`, `fix`, `implement`, `check`, `complete`, `00-explore`, `10-define`, `20-spec`, `30-plan`, `40-execute`, `50-verify`, `60-report`, `70-deliver`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `idea`, `ci`, `test`, `autopilot`, `prototype`, `report-html`, `brief`, `discovery`, `audit`, `release`). The way you invoke commands depends on your AI Provider / Tool:
35
- - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `40-execute`, `devflow`).
36
- - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/40-execute`, `/devflow`.
37
- - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$40-execute`, `$devflow`.
34
+ 1. **Canonical Command Names & AI Provider Invocation**: Each workflow stage and companion tool has exactly **one Canonical Name** (e.g. `feature`, `fix`, `implement`, `check`, `complete`, `discovery`, `10-define`, `20-spec`, `30-plan`, `40-execute`, `50-verify`, `60-report`, `70-deliver`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `idea`, `ci`, `test`, `autopilot`, `prototype`, `report-html`, `brief`, `audit`, `release`, `brainstorm`, `grill`). The way you invoke commands depends on your AI Provider / Tool:
35
+ - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `40-execute`, `devflow`, `discovery`).
36
+ - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/40-execute`, `/devflow`, `/discovery`.
37
+ - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$40-execute`, `$devflow`, `$discovery`.
38
38
  2. **OpenAI Codex & Non-Native CLI Tools**: In environments without automatic background skill discovery (such as OpenAI Codex CLI, Aider, or generic terminals), **you MUST use your file reading tool to inspect `.agents/skills/<skill>/SKILL.md` before executing the stage** to strictly follow its schema, artifact contract, and quality gates.
39
39
  3. **Google Antigravity & Claude Code**: Native skill engines automatically discover and surface `.agents/skills/` and `.claude/skills/`.
40
40
  4. **State-Aware Inspection**: When unsure what to do next, invoke `devflow` to automatically inspect `devflow/context/current-stage.md` and active context in `devflow/context/`.
@@ -67,10 +67,10 @@ Recommended for 85% of daily work (features, bug fixes, UI improvements, iterati
67
67
  Recommended for large architectural epics, database migrations, and multi-agent coordination:
68
68
 
69
69
  ```text
70
- 00-explore ──▶ 10-define ──▶ 20-spec ──▶ 30-plan ──▶ 40-execute ──▶ 50-verify ──▶ 60-report ──▶ 70-deliver
70
+ discovery ──▶ 10-define ──▶ 20-spec ──▶ 30-plan ──▶ 40-execute ──▶ 50-verify ──▶ 60-report ──▶ 70-deliver
71
71
  ```
72
72
 
73
- 1. `00-explore`: Explore request before delivery commitment without allocating running ID (`00-explore.md`).
73
+ 1. `discovery`: Unified pre-delivery discovery & exploration (project-level roadmap planning or feature-level exploration with 5 lenses: Brainstorm, Research, PRD, Bug Triage, Grill) before delivery commitment (`devflow/discoveries/{DISC-ID}/discovery.md`).
74
74
  2. `10-define`: Turn approved discovery into bounded delivery run in `devflow/context/current-run/10-define.md`.
75
75
  3. `20-spec`: Formalize markdown-first delivery contract & acceptance criteria (`20-spec.md`).
76
76
  4. `30-plan`: Breakdown spec into executable tasks with test decisions (`30-plan.md` + checklists).
@@ -68,3 +68,13 @@
68
68
  - *Dependencies*: None
69
69
  - *Scope*: ผสานความสามารถ Adopt Workflow Visibility (Commit vs Local-only), การรองรับ OpenCode และ Multi-Adapter Checkbox Prompt ใน CLI พร้อมอัปเดต Doctor checks และซิงก์ Baseline SHA เป็น v0.13.0 (`0b65166`)
70
70
 
71
+ ---
72
+
73
+ ## 🧪 Phase 9: Strict TDD Sub-Tasks & Two-Stage Review Guardrails
74
+
75
+ - [x] **9. Strict TDD Sub-Tasks & Two-Stage Review Guardrails** `[Size: M]`
76
+ - *Dependencies*: None
77
+ - *Scope*: นำ Strict TDD (Red-Green-Refactor) Sub-Tasks และ Two-Stage Review Pattern (Stage 1: Spec Fidelity, Stage 2: Quality & Security Gate) ผสานเข้าสู่ Prompt Rules, Coding Standards, AI Interaction และ Stage Skills (`30-plan`, `40-execute`, `50-verify`, `feature`, `implement`, `check`, `debug`) พร้อมอัปเดต Template และ Unit Tests
78
+
79
+
80
+
@@ -65,21 +65,37 @@ The entire lifecycle is driven by the **Single Living Spec (`devflow/context/cur
65
65
  *Recommended for large architectural epics, database migrations, security audits, and multi-agent coordination.*
66
66
 
67
67
  ```text
68
- 00-explore ➔ 10-define ➔ 20-spec ➔ 30-plan ➔ 40-execute ➔ 50-verify ➔ 60-report ➔ 70-deliver
68
+ discovery ➔ 10-define ➔ 20-spec ➔ 30-plan ➔ 40-execute ➔ 50-verify ➔ 60-report ➔ 70-deliver
69
69
  ```
70
70
 
71
- 1. `00-explore`: Explore request before delivery commitment (`DISC-YYYYMMDD-NNN`).
71
+ 1. `discovery`: Unified pre-delivery discovery & Socratic alignment (`DISC-YYYYMMDD-NNN` or project roadmap).
72
72
  2. `10-define`: Turn approved discovery into bounded delivery run in `devflow/context/current-run/10-define.md`.
73
73
  3. `20-spec`: Formalize markdown delivery contract & acceptance criteria (`20-spec.md`).
74
- 4. `30-plan`: Breakdown spec into executable tasks with test decisions (`30-plan.md` + checklists).
75
- 5. `40-execute`: Incremental task execution behind review gates (`40-execute.md`).
76
- 6. `50-verify`: Senior QA review & multi-lane verification checks (`50-verify.md`).
74
+ 4. `30-plan`: Breakdown spec into atomic 2-5 min tasks with explicit TDD decisions (`30-plan.md` + checklists).
75
+ 5. `40-execute`: Strict Red-Green-Refactor task execution behind review gates (`40-execute.md`).
76
+ 6. `50-verify`: Senior QA Two-Stage Review (Spec Fidelity + Quality/Security Gate) (`50-verify.md`).
77
77
  7. `60-report`: Standardized markdown delivery digest (`60-report.md`).
78
- 8. `70-deliver`: Release packaging, git merge, archives `devflow/context/current-run/` ➔ `devflow/history/{features|fixes|rollbacks}/{xxx-slug}/`, and closes the run.
78
+ 8. `70-deliver`: Release packaging, git merge, archives `devflow/context/current-run/` ➔ `devflow/history/{category}/{xxx-slug}/`, and closes the run.
79
79
 
80
80
  ---
81
81
 
82
- ## 4. Standalone HTML Reporting Policy
82
+ ## 4. Strict TDD & Two-Stage Review Interaction Rules
83
+
84
+ ### 🔴🟢 Strict TDD Execution Discipline
85
+ During implementation in `/implement` and `40-execute`:
86
+ - **Show Red Phase**: First execute tests to demonstrate expected failure *before* adding production code.
87
+ - **Show Green Phase**: Add minimal production code, re-run tests, and report pass rate.
88
+ - **Show Refactor Phase**: Polish and clean up with zero test regression.
89
+ - **Forbidden**: Never present functional code changes without matching test execution evidence.
90
+
91
+ ### 🛡️ Two-Stage Verification Reporting
92
+ During `/check` and `50-verify`:
93
+ - **Stage 1 (Spec Fidelity Gate)**: Report each Acceptance Criterion and "Done When" status.
94
+ - **Stage 2 (Code Quality & Security Gate)**: Report Typecheck, Lint, Test Suites, Security checks, and Findings Ledger (0 blockers).
95
+
96
+ ---
97
+
98
+ ## 5. Standalone HTML Reporting Policy
83
99
 
84
100
  > [!IMPORTANT]
85
101
  > **No Auto-Generated HTML**: Mainline stages (`/complete` and `60-report`) strictly output Markdown only.
@@ -120,3 +136,14 @@ Progress lives in persistent files, not in transient chat history:
120
136
  - `autopilot` is an explicit opt-in command (`/autopilot`). Never suggest it as the default next action.
121
137
  - When invoked, it runs one bounded spec/plan/implement/verify pass.
122
138
  - Autopilot **MUST stop** before `/complete`, merge, push, deploy, or any destructive action.
139
+
140
+ ---
141
+
142
+ ## 9. Socratic Alignment & Grilling Discipline (`/grill`)
143
+
144
+ - **Align Before You Build**: When plans, domain language, or architectural boundaries are fuzzy, invoke `/grill` (or use the Grilling Lens in `00-explore`) to conduct a structured interview before creating specifications.
145
+ - **Codebase-Grounded Inquiry**: Inspect existing context and code before asking questions. Never ask questions the codebase already answers.
146
+ - **Turn Discipline**: Ask only 1–2 high-leverage questions per turn with clear recommended defaults. Never dump a wall of questions.
147
+ - **Lazy Inline Persistence**:
148
+ - Immediately append resolved terms to `devflow/context/glossary.md`.
149
+ - Immediately record major, hard-to-reverse architectural decisions as Architecture Decision Records in `devflow/decisions/ADR-xxx-{slug}.md`.