@jakkrichm/create-nexus-devflow 2.2.2 → 2.6.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 (71) hide show
  1. package/README.md +58 -45
  2. package/dist/bin/create-nexus-devflow.js +9 -1
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/command-catalog.js +1 -1
  5. package/dist/lib/command-catalog.js.map +1 -1
  6. package/dist/lib/core-skill-inventory.d.ts +16 -0
  7. package/dist/lib/core-skill-inventory.js +96 -0
  8. package/dist/lib/core-skill-inventory.js.map +1 -0
  9. package/dist/lib/dashboard-page.d.ts +1 -1
  10. package/dist/lib/dashboard-page.js +42 -20
  11. package/dist/lib/dashboard-page.js.map +1 -1
  12. package/dist/lib/dashboard-snapshot.js +16 -12
  13. package/dist/lib/dashboard-snapshot.js.map +1 -1
  14. package/dist/lib/dashboard.js +10 -1
  15. package/dist/lib/dashboard.js.map +1 -1
  16. package/dist/lib/doctor.js +14 -11
  17. package/dist/lib/doctor.js.map +1 -1
  18. package/dist/lib/gatekeeper.d.ts +4 -0
  19. package/dist/lib/gatekeeper.js +2 -2
  20. package/dist/lib/gatekeeper.js.map +1 -1
  21. package/dist/lib/git-status.d.ts +10 -2
  22. package/dist/lib/git-status.js +57 -29
  23. package/dist/lib/git-status.js.map +1 -1
  24. package/dist/lib/swarm-orchestrator.d.ts +4 -1
  25. package/dist/lib/swarm-orchestrator.js +2 -2
  26. package/dist/lib/swarm-orchestrator.js.map +1 -1
  27. package/dist/lib/update.js +5 -8
  28. package/dist/lib/update.js.map +1 -1
  29. package/dist/lib/version-check.js +1 -1
  30. package/dist/lib/workflow-state.js +19 -32
  31. package/dist/lib/workflow-state.js.map +1 -1
  32. package/dist/scripts/prepare-template.js +19 -16
  33. package/dist/scripts/prepare-template.js.map +1 -1
  34. package/package.json +1 -1
  35. package/template/.agents/skills/check/SKILL.md +78 -75
  36. package/template/.agents/skills/complete/SKILL.md +47 -36
  37. package/template/.agents/skills/debug/SKILL.md +76 -94
  38. package/template/.agents/skills/devflow/SKILL.md +51 -79
  39. package/template/.agents/skills/discovery/SKILL.md +7 -9
  40. package/template/.claude/skills/check/SKILL.md +78 -75
  41. package/template/.claude/skills/complete/SKILL.md +47 -36
  42. package/template/.claude/skills/debug/SKILL.md +76 -94
  43. package/template/.claude/skills/devflow/SKILL.md +51 -79
  44. package/template/.claude/skills/discovery/SKILL.md +7 -9
  45. package/template/AGENTS.md +21 -30
  46. package/template/devflow/build-plan.md +9 -0
  47. package/template/devflow/context/ai-interaction.md +43 -45
  48. package/template/devflow/context/coding-standards.md +31 -6
  49. package/template/devflow/context/current-stage.md +10 -7
  50. package/template/devflow/context/findings.md +8 -11
  51. package/template/devflow/context/glossary.md +31 -0
  52. package/template/devflow/history/HISTORY.md +1 -1
  53. package/template/devflow/project-plan.md +2 -2
  54. package/template/devflow/reference/build-plan-template.md +65 -0
  55. package/template/devflow/reference/feature-spec-template.md +110 -0
  56. package/template/devflow/reference/project-plan-template.md +128 -0
  57. package/template/devflow/reference/running-id-contract.md +12 -11
  58. package/template/.agents/skills/10-define/SKILL.md +0 -54
  59. package/template/.agents/skills/20-spec/SKILL.md +0 -155
  60. package/template/.agents/skills/30-plan/SKILL.md +0 -226
  61. package/template/.agents/skills/40-execute/SKILL.md +0 -158
  62. package/template/.agents/skills/50-verify/SKILL.md +0 -62
  63. package/template/.agents/skills/60-report/SKILL.md +0 -57
  64. package/template/.agents/skills/70-deliver/SKILL.md +0 -72
  65. package/template/.claude/skills/10-define/SKILL.md +0 -54
  66. package/template/.claude/skills/20-spec/SKILL.md +0 -155
  67. package/template/.claude/skills/30-plan/SKILL.md +0 -226
  68. package/template/.claude/skills/40-execute/SKILL.md +0 -158
  69. package/template/.claude/skills/50-verify/SKILL.md +0 -62
  70. package/template/.claude/skills/60-report/SKILL.md +0 -57
  71. package/template/.claude/skills/70-deliver/SKILL.md +0 -72
@@ -1,72 +0,0 @@
1
- ---
2
- name: 70-deliver
3
- description: "[devflow][D] Deliver stage in DevFlow 2.0 - package verified work for delivery, archive run to categorized history, git merge, PR, or deployment."
4
- argument-hint: "{running-id or workspace path}"
5
- ---
6
-
7
- # Phase 70: Deliver
8
-
9
- $ARGUMENTS
10
-
11
- Package approved work for delivery after the report stage has captured the final verified story. Archives the active run from `devflow/context/current-run/` to `devflow/history/{features|fixes|rollbacks}/{xxx-slug}/`, updates `HISTORY.md` and `CHANGELOG.md`, executes pre-flight smoke checks, performs conventional git commit & merge, and closes the run.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 70-deliver {id or workspace path}
17
- ```
18
-
19
- ## Markdown-First Contract
20
-
21
- Write the primary stage artifact to:
22
-
23
- ```text
24
- devflow/context/current-run/70-deliver.md
25
- ```
26
-
27
- ## Process & Quality Gates
28
-
29
- ### 0. Step 0 Safety Pass & Findings Ledger Gate
30
-
31
- Before packaging, merging, or delivering:
32
-
33
- 1. **Findings Ledger Blockers**:
34
- - Inspect `devflow/context/findings.md`.
35
- - No Finding of severity `P0` or `P1` in `open` or `fixed` status is permitted.
36
- - `fixed` still blocks release until reviewed and closed in `50-verify`.
37
- 2. **Pre-flight & Deployment Smoke Validation**:
38
- - Verify environment variables and configuration parameters.
39
- - Run production build or package smoke check (`npm run build` or `npm run test:package`).
40
- - Validate that clean state exists with no untracked experimental files.
41
- 3. **2-Stage Approval Separation**:
42
- - Consent to merge into `main` is strictly separate from consent to `git push` to remote or deploy.
43
-
44
- ### 1. Changelog & SemVer Version Bump
45
-
46
- 1. Calculate next version according to **Semantic Versioning (SemVer)**:
47
- - `Major`: Breaking architectural changes, removed public APIs
48
- - `Minor`: New backward-compatible features added
49
- - `Patch`: Bug fixes, optimizations, documentation
50
- 2. Append new release entry to `CHANGELOG.md` in [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format (`Added`, `Changed`, `Fixed`, `Removed`, `Security`).
51
-
52
- ### 2. Conventional Commit & Git Merge
53
-
54
- 1. Stage all release and tracking files.
55
- 2. Commit with conventional format: `chore(release): release {version}` or `feat({scope}): {summary}`.
56
- 3. Squash-merge to base branch (`main`) with explicit user approval.
57
-
58
- ### 3. Archive Run Folder to Categorized History
59
-
60
- 1. Determine Category (`features`, `fixes`, `rollbacks`).
61
- 2. Move directory `devflow/context/current-run/` ➔ `devflow/history/{category}/{xxx-slug}/`.
62
- 3. Clean resolved findings (`closed`, `accepted`, `invalid`) from `devflow/context/findings.md` and append to the release notes.
63
- 4. Append entry to `devflow/history/HISTORY.md` linking to `history/{category}/{xxx-slug}/60-report.md`.
64
-
65
- ### 4. Update Workspace State
66
-
67
- Set `devflow/context/current-stage.md` to:
68
- - `Active Discovery ID`: `None`
69
- - `Active Running ID`: `None (Idle)`
70
- - `Current Stage`: `Idle (Ready for new run)`
71
- - `Last Completed Run`: `{ID} ({YYYY-MM-DD})`
72
- - `Last Updated`: `{YYYY-MM-DD}`
@@ -1,54 +0,0 @@
1
- ---
2
- name: 10-define
3
- description: "[devflow][D] Define stage in DevFlow 2.0 - turn an approved discovery into a bounded delivery run in context/current-run with stable scope."
4
- argument-hint: "{approved discovery-id, discovery path, running-id, or run path}"
5
- ---
6
-
7
- # Phase 10: Define
8
-
9
- $ARGUMENTS
10
-
11
- Convert an approved `Proceed` discovery into a bounded delivery run. Checks the Single Active Run Guardrail, allocates a sequential ID without prefix (`xxx-slug`), and writes `devflow/context/current-run/10-define.md`.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 10-define {discovery-id or discovery path}
17
- 10-define {id or run path}
18
- ```
19
-
20
- ## Markdown-First Contract
21
-
22
- For the active delivery run, write:
23
-
24
- ```text
25
- devflow/context/current-run/10-define.md
26
- ```
27
-
28
- using:
29
-
30
- ```text
31
- .agent/resources/schemas/define.template.md
32
- ```
33
-
34
- ## Process & Quality Gates
35
-
36
- ### 1. Single Active Run Guardrail (One Thing at a Time)
37
- 1. Inspect `devflow/context/current-stage.md`, `devflow/context/current-feature.md`, and `devflow/context/current-run/`.
38
- 2. If an active uncompleted run exists:
39
- - **HALT and reject opening a new define stage**.
40
- - Warn the user to complete or close the active run with `/complete` or `70-deliver` first.
41
-
42
- ### 2. Validate The Discovery Gate
43
- Require:
44
- - `Decision: Proceed`
45
- - `Approval Status: Approved`
46
- - A resolvable Discovery ID and `discovery.md` (or legacy `00-explore.md`)
47
-
48
- ### 3. Allocate Sequential ID
49
- - Inspect `devflow/history/HISTORY.md` and allocate sequential ID without prefix (e.g. `022-{slug}`).
50
- - Create directory `devflow/context/current-run/` if it does not exist.
51
- - Write `devflow/context/current-run/10-define.md`.
52
- - Update `devflow/context/current-stage.md`:
53
- - `Active Running ID`: `{ID}`
54
- - `Current Stage`: `10-define (Completed -> Ready for 20-spec)`
@@ -1,155 +0,0 @@
1
- ---
2
- name: 20-spec
3
- description: "[devflow][D] Spec stage in DevFlow 2.0 - write the formal markdown-first specification from a stable definition."
4
- argument-hint: "{running-id or workspace path}"
5
- ---
6
-
7
- # Phase 20: Spec
8
-
9
- $ARGUMENTS
10
-
11
- Turn the defined work into a specification that is concrete enough for planning and explicit enough to serve as the delivery contract.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 20-spec {running-id or workspace path}
17
- ```
18
-
19
- Use this when:
20
-
21
- - the goal and scope are stable
22
- - the team needs testable or reviewable requirements
23
- - planning should not start until the contract is explicit
24
-
25
- ## Markdown-First Contract
26
-
27
- Write the primary stage artifact to:
28
-
29
- ```text
30
- devflow/runs/{ID}-{slug}20-spec.md
31
- ```
32
-
33
- using:
34
-
35
- ```text
36
- .agent/resources/schemas/spec.template.md
37
- ```
38
-
39
- Before writing `20-spec.md`, read `artifact_language` from `spec.template.md` and produce the artifact in that language.
40
-
41
- ## Required Section Content
42
-
43
- Before completing any generated artifact:
44
-
45
- - preserve every heading required by the selected template
46
- - write concrete information under every heading
47
- - when no information exists or the section does not apply, write exactly `-`
48
- - never leave a heading immediately followed by another heading with no body content
49
- - remove template placeholders from the final artifact
50
- - do not invent facts merely to avoid using `-`
51
- - re-read the saved artifact and verify every heading satisfies this rule
52
-
53
- ## Process
54
-
55
- ### Loop Contract
56
-
57
- Run specification as a contract-hardening loop, not as a prose expansion of the definition.
58
-
59
- - **Intent**: produce requirements and acceptance criteria that are concrete enough for planning and review.
60
- - **Context**: read the run's `10-define.md`, follow its `source_discovery` link when original framing matters, and read relevant research, hard constraints, and domain or codebase decisions that shape this run's delivery contract.
61
- - **Action**: write requirements, acceptance criteria, constraints, and out-of-scope items, then inspect whether each requirement is testable and unambiguous.
62
- - **Observation**: use concrete evidence such as ambiguous wording, unchecked assumptions, edge cases, missing acceptance criteria, conflicting constraints, and implementation details that are not true constraints.
63
- - **Adjustment**: if facts are missing, route to `Research`; if requirements need stress-testing, use `grill-with-docs`; if module or interface boundaries affect the contract, use `codebase-design`; if scope is unstable or still contains multiple independently deliverable contracts, return to `10-define` and split the run before continuing.
64
- - **Stop Condition**: stop when every requirement has checkable acceptance criteria, hard constraints are explicit, out-of-scope items are visible, and `30-plan` can break the work down without inventing intent.
65
- - **Handoff**: `20-spec.md` must tell `30-plan` what must be delivered, how success will be checked, what constraints cannot move, and what is intentionally excluded.
66
-
67
- ### 1. Read Definition Artifacts
68
-
69
- Read:
70
-
71
- - `10-define.md`
72
- - the shared `00-explore.md` referenced by `source_discovery` when the original framing still matters
73
- - research notes if they impose real constraints
74
-
75
- ### 2. Write The Specification
76
-
77
- Define:
78
-
79
- - core requirements
80
- - acceptance criteria
81
- - hard constraints
82
- - explicit out-of-scope items
83
-
84
- The spec should be strong enough that planning can break it into executable units without guessing intent.
85
-
86
- ### 3. Handle Missing Certainty
87
-
88
- If the spec cannot be written confidently:
89
-
90
- - call `Research` when facts are missing
91
- - use `grill-with-docs` when requirements, acceptance criteria, constraints, or out-of-scope items need to be stress-tested against scenarios and domain language
92
- - use `codebase-design` when requirements imply module boundaries, interface contracts, seams, or testability constraints
93
- - record assumptions explicitly when they are unavoidable
94
-
95
- Do not hide uncertainty inside vague requirement text.
96
-
97
- Do not combine sibling Running IDs into one spec. If this run still contains multiple independent acceptance, release, ownership, or context boundaries, stop and return to `10-define {running_id}` for an explicit split.
98
-
99
- ### 4. Finalize `20-spec.md`
100
-
101
- - preserve the template headings
102
- - follow the `artifact_language` configured in `spec.template.md`
103
- - replace all placeholders
104
- - keep implementation details out unless they are true constraints
105
- - make sure the acceptance criteria can actually be checked
106
-
107
- ### 5. Manual Review Soft Gate
108
-
109
- Before recommending `30-plan`, check whether the delivery contract has been human-reviewed.
110
- If `Approval Status` is not approved yet:
111
-
112
- - warn that planning may drift if the spec is still under review
113
- - recommend review of requirements, exclusions, and acceptance criteria first
114
- - keep `30-plan` as a soft recommendation only
115
-
116
- ## Output
117
-
118
- Report:
119
-
120
- - core requirements
121
- - acceptance criteria
122
- - hard constraints
123
- - out-of-scope items
124
- - manual review warnings when the contract is still pending
125
- - recommended next step
126
-
127
- ## Relationship To DevFlow 2.0
128
-
129
- - Classification: Mainline workflow
130
- - Previous state: `10-define`
131
- - Next state: `30-plan` when the contract is implementation-ready
132
- - Common companion commands: `PRD`, `Spec-Research`, `Competitor`, `Spec-Orchestrate` when product or integration context is still incomplete; support skills: `grill-with-docs`, `domain-modeling`, and `codebase-design` when the spec depends on precise domain language, durable decisions, or module/interface constraints
133
-
134
- ## Sources
135
-
136
- - `AGENTS.md`
137
- - `docs/workspace-artifacts.md`
138
- - `.agent/resources/schemas/spec.template.md`
139
- - Related commands: `10-define`, `PRD`, `Spec-Research`, `Competitor`, `Spec-Orchestrate`, `30-plan`
140
-
141
- ## Next Workflow Recommendation
142
-
143
- - **Primary**: `30-plan`
144
- - **Why**: The specification is now concrete enough to break into executable work.
145
- - **Alternatives**:
146
- - `Research` - choose this when the spec still depends on missing facts.
147
- - `grill-with-docs` - choose this when the spec is readable but not yet tough enough to plan from.
148
- - `codebase-design` - choose this when interface shape or testability constraints must be settled before planning.
149
- - `10-define` - choose this when the scope itself is still unstable.
150
-
151
- ## Nexus Event
152
-
153
- - Use `Research` when a requirement, rule, or integration constraint still lacks evidence.
154
- - Use `Spec-Research`, `Competitor`, or `PRD` when the contract needs stronger external, product, or market framing before planning.
155
- - Use `grill-with-docs` when available if clarification could materially change acceptance criteria, edge cases, exclusions, or rules.
@@ -1,226 +0,0 @@
1
- ---
2
- name: 30-plan
3
- description: "[devflow][D] Plan stage in DevFlow 2.0 - transform 20-spec.md into an executable task breakdown with test decisions."
4
- ---
5
- # Phase 30: Plan Implementation
6
-
7
- **Strict mode: planning only. Do not edit source code in this phase.**
8
-
9
- Create a codebase-informed implementation plan using `30-plan.md` as the primary artifact in DevFlow 2.0.
10
-
11
- ## Usage
12
-
13
- ```text
14
- 30-plan {ID}
15
- ```
16
-
17
- ## Markdown-First Contract
18
-
19
- Use `30-plan.md` as the main planning artifact.
20
-
21
- Use controlled task-engine commands when plan status or subtask tracking must be synchronized:
22
-
23
- Record complexity, context, phases, subtasks, and validation notes directly in the stage markdown files for this running ID. Treat `30-plan.md` as the source of truth.
24
-
25
- **MANDATORY RULE:** If you create temporary script files (e.g. `.ps1`, `.sh`) to execute multiple compatibility commands in batch, save them inside the task workspace, never in the central `scripts/` directory.
26
-
27
- ## Required Section Content
28
-
29
- Before completing any generated artifact:
30
-
31
- - preserve every heading required by the selected template
32
- - write concrete information under every heading
33
- - when no information exists or the section does not apply, write exactly `-`
34
- - never leave a heading immediately followed by another heading with no body content
35
- - remove template placeholders from the final artifact
36
- - do not invent facts merely to avoid using `-`
37
- - re-read the saved artifact and verify every heading satisfies this rule
38
-
39
- ## Process
40
-
41
- ### Loop Contract
42
-
43
- Run planning as an evidence loop, not as a one-shot outline.
44
-
45
- - **Intent**: produce a plan that lets implementation proceed without guessing scope, files, risks, or verification.
46
- - **Context**: read the spec, prior stage artifacts, relevant code/docs, existing commands, and any research that constrains execution.
47
- - **Action**: draft the smallest useful plan, then inspect whether every phase has files, dependencies, risks, verification, and a test decision.
48
- - **Observation**: use concrete evidence such as file paths, existing patterns, package scripts, validation commands, and unresolved assumptions.
49
- - **Adjustment**: if evidence is missing, search/read more, recommend `Research` or `Agent codebase-explorer`, split the work, or route back to `20-spec` when the contract is not plan-ready.
50
- - **Stop Condition**: stop only when phases are ordered, subtasks are scoped, verification is explicit, test decisions are recorded, and any blockers are visible.
51
- - **Handoff**: `30-plan.md` must give `40-execute` enough context to select one scoped unit and execute it without inventing intent.
52
-
53
- ### 1. Read Task Artifacts
54
-
55
- Read:
56
-
57
- - `devflow/runs/{ID}-*20-spec.md`
58
- - `10-define.md` and the shared `00-explore.md` referenced by `source_discovery` when they help clarify intent
59
-
60
- ### 2. Assess Complexity
61
-
62
- Use the old planning discipline:
63
-
64
- - `simple`: 1 phase, 1-3 subtasks
65
- - `standard`: multiple ordered phases with clear verification
66
- - `complex`: deeper codebase exploration, possibly specialist help
67
-
68
- If architecture or data flow is still unclear, recommend `Research` or `Agent codebase-explorer` before pretending the plan is stable.
69
- If domain terms, boundaries, or hard-to-reverse design choices are still questionable, use `grill-with-docs` before locking the plan.
70
- Use `codebase-design` when phases depend on seam placement or module interfaces. Use `tdd` when behavior-change subtasks need red-green-refactor test cases.
71
-
72
- ### 3. Explore Codebase Patterns
73
-
74
- Use fast searches (`rg`, file reads) to find:
75
-
76
- - similar implementations
77
- - entry points
78
- - config and test commands
79
- - files likely to change
80
- - patterns that implementation should mirror
81
-
82
- Record important findings in `30-plan.md`. Use legacy context updates only when compatibility tooling still needs them.
83
-
84
- ### 4. Build The Plan
85
-
86
- Use strict planning discipline, keeping `30-plan.md` as the main contract:
87
-
88
- - **Atomic Micro-Task Sizing (2–5 Minutes)**: Every subtask must be a small, verifiable unit that can be implemented and reviewed cleanly without context sprawl.
89
- - record the planning loop evidence: context read, observations, adjustments made, stop condition, and handoff notes
90
- - add phases in dependency order
91
- - include explicit files to modify or create (exact file paths)
92
- - include patterns to follow
93
- - include verification command or manual check
94
- - include a test decision for every subtask
95
- - record assumptions, scope boundaries, and risks explicitly
96
-
97
- Each subtask should answer:
98
-
99
- - what to change
100
- - where to change it (exact path)
101
- - which pattern to follow
102
- - how to verify it
103
- - whether automated tests are required, manual, or not required
104
-
105
- ### 4.1 Strict TDD Task Breakdown & Test Decision Gate
106
-
107
- **STRICT MANDATE (กฎเหล็ก Unit Test & TDD)**: สำหรับทุก subtask ที่มีการเพิ่ม แก้ไข หรือเปลี่ยนแปลงการทำงานของโค้ด (Behavior Change) **ต้องระบุเป็น `Required` เสมอ** และต้องย่อยงานเป็น **TDD Triplet Sub-tasks** ดังนี้:
108
-
109
- ```markdown
110
- - [ ] Task 1.1 [TDD-Red]: Write failing test for {feature/behavior} in {test_file} and verify failure
111
- - [ ] Task 1.2 [TDD-Green]: Implement minimal code in {src_file} to satisfy Task 1.1 test
112
- - [ ] Task 1.3 [TDD-Refactor]: Refactor logic, eliminate duplication, and verify zero regression
113
- ```
114
-
115
- For every subtask, decide one of:
116
-
117
- - `Required`: automated tests must be created or updated (Mandatory for all behavior changes, formatted as TDD Triplet)
118
- - `Manual/Command Only`: verification is non-test but still explicit (Only for configuration/infrastructure tasks)
119
- - `Not Required`: no new automated test is needed because there is no meaningful behavior surface (Only for documentation/comments)
120
-
121
- Record:
122
-
123
- - reason
124
- - planned cases when tests are required (using AAA pattern: Arrange-Act-Assert)
125
- - verification command or manual check
126
- - expected result
127
-
128
- Do not use "too simple" as the only reason for skipping tests.
129
-
130
- ### 5. Create Human-Readable Plan
131
-
132
- Create `30-plan.md` in the task workspace and base its structure on:
133
-
134
- ```text
135
- .agent/resources/schemas/plan.template.md
136
- ```
137
-
138
- Before writing `30-plan.md`, read `artifact_language` from `plan.template.md` and produce the artifact in that language.
139
-
140
- Before reporting completion:
141
-
142
- Review `{plan_md_path}` against `plan.template.md`, keep the required headings, and remove placeholder text before completion.
143
-
144
- Replace every placeholder with concrete phases, files, commands, dependencies, and verification evidence.
145
- Follow the `artifact_language` configured in `plan.template.md` for all plan narrative text.
146
-
147
- Create the checklist directory when detailed execution tracking is needed:
148
-
149
- ```text
150
- devflow/runs/{ID}-*/checklists/
151
- ```
152
-
153
- Seed at least:
154
-
155
- - `implementation-checklist.md`
156
- - `verification-checklist.md`
157
-
158
- Use the schema templates under `.agent/resources/schemas/` and turn approved phases/subtasks into live markdown checklist items using task markers such as `- [ ]`, `- [/]`, `- [!]`, and `- [-]` so humans can follow the run without reading the full planning narrative.
159
-
160
- ### 6. Validate And Close Planning
161
-
162
- Run:
163
-
164
- Run `npm run validate` after changing the framework, templates, or shared references. For task work, manually verify that `30-plan.md` still matches the required template contract.
165
-
166
- If validation fails, repair only what is necessary and keep `30-plan.md` aligned with the corrected state.
167
-
168
- ### 7. Manual Review Soft Gate
169
-
170
- Before recommending `40-execute`, check whether the plan still shows pending review.
171
- If `Approval Status` is still pending or major dependencies remain unresolved:
172
-
173
- - warn that implementation should wait for review
174
- - recommend human confirmation of sequencing, scope, and verification strategy
175
- - keep `40-execute` as a soft recommendation only
176
-
177
- ## Output Checklist
178
-
179
- - complexity is clear
180
- - loop evidence is recorded: intent, context, observation, adjustment, stop condition, and handoff
181
- - phases are ordered by dependency
182
- - every subtask is scoped and verifiable
183
- - every subtask has a test decision
184
- - `30-plan.md` is written and reviewable
185
- - validation passes
186
- - manual review warning is explicit when approval is still pending
187
- - next command is ready
188
-
189
- ## Relationship To DevFlow 2.0
190
-
191
- - Classification: Mainline workflow
192
- - Previous state: `20-spec`
193
- - Next state: `40-execute` when execution steps and verification are clear
194
- - Common companion commands: `Research` or `Agent` when architecture, data flow, or external constraints still need investigation; support skills: `grill-with-docs`, `domain-modeling`, `codebase-design`, `tdd`, and `to-issues` for final design stress-testing, durable terminology capture, test planning, and issue packaging
195
-
196
- ## Sources
197
-
198
- - `AGENTS.md`
199
- - `docs/workspace-artifacts.md`
200
- - `.agent/resources/schemas/plan.template.md`
201
- - Related commands: `20-spec`, `Research`, `Agent`, `40-execute`
202
-
203
- ## Next Workflow Recommendation
204
-
205
- - **Primary**: `40-execute {ID}`
206
- - **Why**: Approved planning is the gate before implementation in DevFlow 2.0.
207
- - **Alternatives**:
208
- - `Research` - choose this when the plan still depends on missing evidence.
209
- - `Agent codebase-explorer devflow/runs/{ID}-*/` - choose this when architecture or data flow is unclear.
210
- - `grill-with-docs` - choose this when plan assumptions or design boundaries need one last adversarial pass.
211
- - `codebase-design` - choose this when a plan needs clearer seams, interfaces, or test surfaces.
212
- - `20-spec {ID}` - choose this when the spec itself is not strong enough for planning.
213
-
214
- ## Nexus Event
215
-
216
- - Use `Research` when architecture, sequencing, or rollout decisions still depend on missing evidence.
217
- - Use `Agent codebase-explorer` or another specialist lane when the codebase shape or integration boundary is still unclear.
218
- - Use `grill-with-docs` when available if a short clarification pass could materially change sequencing, dependency order, rollout risk, or verification strategy.
219
-
220
- ## Wiki Update Recommendation
221
-
222
- - **Needed**: `yes` when planning records a reusable architecture decision, project pattern, or context-loading lesson.
223
- - **Scope**: `project` unless the planning lesson changes DevFlow framework behavior.
224
- - **Reason**: Plans often discover stable patterns that future sessions should reuse.
225
- - **Suggested Command**: `Wiki project ingest devflow/runs/{ID}-*30-plan.md`
226
-
@@ -1,158 +0,0 @@
1
- ---
2
- name: 40-execute
3
- description: "[devflow][D] Execute stage in DevFlow 2.0 - execute planned tasks incrementally with evidence and unit tests."
4
- ---
5
- # Phase 40: Execute Code
6
-
7
- Implement and execute the approved plan incrementally. Source code edits are allowed in this phase.
8
-
9
- ## Usage
10
-
11
- ```text
12
- 40-execute {ID}
13
- ```
14
-
15
- ## Markdown-First Contract
16
-
17
- Use `40-execute.md` as the primary execution artifact.
18
- Before writing `40-execute.md`, produce the artifact in Thai (`th`).
19
-
20
- Before execution, confirm the plan is approved in the stage artifacts. Track subtask progress, execution notes, and completion evidence directly in `40-execute.md` and related stage markdown files.
21
-
22
- ## Required Section Content
23
-
24
- Before completing any generated artifact:
25
-
26
- - preserve every heading required by the selected template
27
- - write concrete information under every heading
28
- - when no information exists or the section does not apply, write exactly `-`
29
- - never leave a heading immediately followed by another heading with no body content
30
- - remove template placeholders from the final artifact
31
- - do not invent facts merely to avoid using `-`
32
- - re-read the saved artifact and verify every heading satisfies this rule
33
-
34
- ## Process
35
-
36
- ### Loop Contract
37
-
38
- Run execution as scoped execution loops, one unit at a time.
39
-
40
- - **Intent**: complete the selected planned unit while preserving the spec, plan, and repository conventions.
41
- - **Context**: read `30-plan.md`, `20-spec.md`, relevant checklist items, target files, pattern files, and test decisions before editing.
42
- - **Action**: make the smallest useful change for the current unit, update or create tests when required, run the planned verification, and record the result.
43
- - **Observation**: inspect concrete evidence from diffs, command output, tests, manual checks, and checklist status before claiming progress.
44
- - **Adjustment**: if evidence does not match intent, fix within the current unit, capture the blocker, use `Debug`, or return to `30-plan` or `20-spec` when the work no longer matches the contract.
45
- - **Stop Condition**: stop the unit when the planned change is complete, verification evidence is recorded, deviations are explained, and the next unit or handoff is clear.
46
- - **Handoff**: `40-execute.md` must tell `50-verify` what changed, why it changed, which checks ran, what failed or was skipped, and what residual risk remains.
47
-
48
- ### 1. Get Bearings
49
-
50
- Read:
51
-
52
- - `30-plan.md`
53
- - `20-spec.md`
54
- - `checklists/implementation-checklist.md` when present
55
- - referenced pattern files
56
- - `10-define.md` when the intent needs a quick reminder
57
-
58
- Confirm the current Git branch with `git branch --show-current` and use that branch as the user's chosen working branch. Do not create, switch, or checkout branches automatically.
59
-
60
- Select one scoped unit of work at a time. Do not implement the whole plan as one blob.
61
-
62
- ### 2. Execute One Scoped Unit (Strict TDD Red-Green-Refactor)
63
-
64
- Use the strict coder discipline:
65
-
66
- - **STRICT MANDATE (กฎเหล็ก Unit Test & TDD)**: สำหรับทุกงานที่มีการแก้ไข logic การทำงาน ต้องสร้างหรือแก้ไข Unit Test ควบคู่กับการแก้ไขโค้ดเสมอ โดยห้ามเขียนเฉพาะ Production Code โดยไม่มีเทสต์
67
- - **🔴 RED (Test First)**: ออกแบบและเขียน Test Case ในไฟล์เทสต์ก่อนเสมอ แล้วรันคำสั่งเทสต์เพื่อพิสูจน์ว่า **Test ล้มเหลว (FAIL)** ตามที่คาดหวัง
68
- - **🟢 GREEN (Minimal Implementation)**: เขียน Production Code เท่าที่จำเป็นเพื่อให้เทสต์ผ่าน แล้วรันคำสั่งเทสต์เพื่อพิสูจน์ว่า **Test ผ่าน 100% (PASS)**
69
- - **🔵 REFACTOR (Clean Code)**: ปรับปรุงโครงสร้างโค้ดให้อ่านง่าย กำจัดความซ้ำซ้อน (DRY) โดยที่เทสต์ยังคงเขียว 100%
70
- - **Code Deletion / Reversion Rule**: หากเผลอเขียน Production Code ก่อนมีเทสต์ ให้ Revert หรือลบโค้ดส่วนนั้น แล้วเริ่มวงจร RED ก่อนเสมอ
71
- - start each scoped unit by naming its intent, context, expected observation, adjustment route, and stop condition
72
- - read referenced pattern files before editing
73
- - read the test decision from `30-plan.md`
74
- - confirm assumptions, target files, and success criteria before editing
75
- - preserve project style
76
- - run the planned verification and capture concrete terminal outputs
77
- - record observation, adjustment, stop condition status, and the result in `40-execute.md`
78
- - update checklist item status, timestamps, and evidence links as work progresses
79
-
80
- ### 3. Recovery
81
-
82
- Use the old recovery discipline when blocked:
83
-
84
- - capture the blocker with evidence
85
- - mark failure only when the current unit truly cannot continue
86
- - recommend `Debug` when root cause analysis is needed
87
- - return to Plan when the work no longer matches the plan
88
-
89
- Use `tdd` for behavior-change implementation loops, `diagnosing-bugs` when a tight repro is needed before a fix, and `codebase-design` when implementation exposes an awkward seam or shallow module.
90
-
91
- ### 4. Finalize Execution
92
-
93
- When the scoped work is complete:
94
-
95
- - summarize the completed units
96
- - list changed files
97
- - record verification performed
98
- - record loop evidence for each completed unit: intent, observation, adjustment, and stop condition
99
- - record deviations, blockers, and manual checks
100
- - make sure checklist statuses match the actual state of the code and tests
101
- - make sure `40-execute.md` is ready for Verify
102
-
103
- ### 5. Manual Review Soft Gate
104
-
105
- If the plan was not clearly approved, warn that execution proceeded under review risk.
106
- When finishing `40-execute.md`:
107
-
108
- - record any deviation from the approved plan explicitly
109
- - set reviewer expectations before `50-verify`
110
- - keep `50-verify` as the next soft recommendation rather than an unconditional jump
111
-
112
- ## Output
113
-
114
- Report:
115
-
116
- - scoped units completed
117
- - files changed
118
- - verification commands run
119
- - test decisions followed or changed, with reasons
120
- - loop evidence and handoff notes for Verify
121
- - blocked items or manual checks
122
- - next command: `50-verify {ID}`
123
-
124
- ## Relationship To DevFlow 2.0
125
-
126
- - Classification: Mainline workflow
127
- - Previous state: `30-plan`
128
- - Next state: `50-verify` when scoped execution is complete
129
- - Common companion commands: `Debug` for blockers, `Preview` for local checks; support skills: `tdd`, `diagnosing-bugs`, and `codebase-design` for behavior changes, root-cause loops, and implementation-time design pressure
130
-
131
- ## Sources
132
-
133
- - `AGENTS.md`
134
- - `docs/workspace-artifacts.md`
135
- - Related commands: `30-plan`, `Debug`, `Preview`, `50-verify`
136
-
137
- ## Next Workflow Recommendation
138
-
139
- - **Primary**: `50-verify {ID}` when the planned work is complete.
140
- - **Why**: Implementation needs independent verification before release or human acceptance.
141
- - **Alternatives**:
142
- - `Debug "{blocker}"` - choose this when execution is blocked by an unexplained failure.
143
- - `30-plan {ID}` - choose this when the plan is incomplete or no longer matches the work.
144
- - `Preview` - choose this when a local runtime or visual check is useful before formal verification.
145
- - `codebase-design` - choose this when the implementation cannot be tested cleanly because the module shape is wrong.
146
-
147
- ## Nexus Event
148
-
149
- - Use `Debug` when the conversation reveals an unexplained blocker, flaky behavior, or root-cause gap.
150
- - Use `Preview` when a runtime, UI, or local interaction check would reduce verification risk.
151
- - Return to `30-plan` when execution drift shows the plan no longer matches reality.
152
-
153
- ## Wiki Update Recommendation
154
-
155
- - **Needed**: `yes` when coding discovers a reusable implementation pattern, gotcha, or context optimization.
156
- - **Scope**: `project` unless the discovery is about DevFlow itself.
157
- - **Reason**: Coding findings are useful only when they are stable enough to help future tasks.
158
- - **Suggested Command**: `Wiki project ingest devflow/runs/{ID}-*40-execute.md`