@jakkrichm/create-nexus-devflow 2.2.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/create-nexus-devflow.js +9 -1
- package/dist/bin/create-nexus-devflow.js.map +1 -1
- package/dist/lib/command-catalog.js +1 -1
- package/dist/lib/command-catalog.js.map +1 -1
- package/dist/lib/dashboard-page.d.ts +1 -1
- package/dist/lib/dashboard-page.js +42 -20
- package/dist/lib/dashboard-page.js.map +1 -1
- package/dist/lib/dashboard-snapshot.js +16 -12
- package/dist/lib/dashboard-snapshot.js.map +1 -1
- package/dist/lib/dashboard.js +10 -1
- package/dist/lib/dashboard.js.map +1 -1
- package/dist/lib/doctor.js +1 -1
- package/dist/lib/gatekeeper.d.ts +4 -0
- package/dist/lib/gatekeeper.js +2 -2
- package/dist/lib/gatekeeper.js.map +1 -1
- package/dist/lib/git-status.d.ts +10 -2
- package/dist/lib/git-status.js +57 -29
- package/dist/lib/git-status.js.map +1 -1
- package/dist/lib/swarm-orchestrator.d.ts +4 -1
- package/dist/lib/swarm-orchestrator.js +2 -2
- package/dist/lib/swarm-orchestrator.js.map +1 -1
- package/dist/lib/version-check.js +1 -1
- package/dist/lib/workflow-state.js +19 -32
- package/dist/lib/workflow-state.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/complete/SKILL.md +47 -36
- package/template/.agents/skills/devflow/SKILL.md +51 -79
- package/template/.claude/skills/complete/SKILL.md +47 -36
- package/template/.claude/skills/devflow/SKILL.md +51 -79
- package/template/AGENTS.md +21 -30
- package/template/devflow/build-plan.md +9 -0
- package/template/devflow/context/ai-interaction.md +38 -39
- package/template/devflow/context/findings.md +8 -11
- package/template/devflow/context/glossary.md +31 -0
- package/template/devflow/reference/build-plan-template.md +65 -0
- package/template/devflow/reference/feature-spec-template.md +110 -0
- package/template/devflow/reference/project-plan-template.md +128 -0
- package/template/devflow/reference/running-id-contract.md +12 -11
- package/template/.agents/skills/10-define/SKILL.md +0 -54
- package/template/.agents/skills/20-spec/SKILL.md +0 -155
- package/template/.agents/skills/30-plan/SKILL.md +0 -226
- package/template/.agents/skills/40-execute/SKILL.md +0 -158
- package/template/.agents/skills/50-verify/SKILL.md +0 -62
- package/template/.agents/skills/60-report/SKILL.md +0 -57
- package/template/.agents/skills/70-deliver/SKILL.md +0 -72
- package/template/.claude/skills/10-define/SKILL.md +0 -54
- package/template/.claude/skills/20-spec/SKILL.md +0 -155
- package/template/.claude/skills/30-plan/SKILL.md +0 -226
- package/template/.claude/skills/40-execute/SKILL.md +0 -158
- package/template/.claude/skills/50-verify/SKILL.md +0 -62
- package/template/.claude/skills/60-report/SKILL.md +0 -57
- package/template/.claude/skills/70-deliver/SKILL.md +0 -72
|
@@ -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`
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: 50-verify
|
|
3
|
-
description: "[devflow][D] Verify stage in DevFlow 2.0 - perform senior QA review, record evidence, and decide pass or return-to-implement."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Phase 50: Verify Quality
|
|
7
|
-
|
|
8
|
-
Review implementation quality, run multi-lane validation, produce a verification report, and route the task forward or back to implementation.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```text
|
|
13
|
-
50-verify {ID}
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Markdown-First Contract
|
|
17
|
-
|
|
18
|
-
Use `50-verify.md` as the primary verification artifact.
|
|
19
|
-
Use `50-verify-impact.md` as an optional companion artifact when the run changes behavior, touches core logic, crosses integration boundaries, or needs explicit rollback and client impact analysis.
|
|
20
|
-
|
|
21
|
-
## Process & Quality Gates (Two-Stage Review Pattern)
|
|
22
|
-
|
|
23
|
-
### Stage 1: Spec Fidelity & Acceptance Criteria Gate
|
|
24
|
-
Before evaluating technical code metrics, verify that the implementation faithfully delivers what was specified:
|
|
25
|
-
1. **Acceptance Criteria Validation**: Cross-check each Acceptance Criterion (AC-1, AC-2, ...) in `20-spec.md` or `current-feature.md` and verify concrete evidence of completion.
|
|
26
|
-
2. **Done-When Observable Verification**: Check that all observable conditions ("Done when...") are satisfied in the running application or test suite.
|
|
27
|
-
3. **Scope Discipline**: Ensure zero scope creep (no unrequested features added) and no unfulfilled functional requirements.
|
|
28
|
-
4. **Boundary & Negative Scenarios**: Verify unhappy paths, empty inputs, and error states defined in the specification.
|
|
29
|
-
|
|
30
|
-
### Stage 2: Code Quality, Security & Architecture Gate
|
|
31
|
-
Execute multi-lane technical verification across all essential quality dimensions:
|
|
32
|
-
|
|
33
|
-
1. **Lane 1: Typecheck & Static Code Quality**:
|
|
34
|
-
- Run typecheck and static analysis (`tsc --noEmit`, `npm run lint`).
|
|
35
|
-
2. **Lane 2: Automated Test Suites (Strict TDD Gate)**:
|
|
36
|
-
- Run automated unit and integration tests (`npm test`).
|
|
37
|
-
- Confirm 100% test pass rate with zero disabled or skipped tests.
|
|
38
|
-
3. **Lane 3: Scrutinize QA & Edge Cases Review**:
|
|
39
|
-
- **Boundary Conditions**: Check empty inputs, 0/1 counts, off-by-one errors.
|
|
40
|
-
- **Null / Undefined Safety**: Verify nullish handling and strict type invariants.
|
|
41
|
-
- **Error Handling & Propagation**: Verify errors provide actionable diagnostics without swallowing.
|
|
42
|
-
4. **Lane 4: Security & Hygiene Audit**:
|
|
43
|
-
- **Secrets Check**: Ensure no hardcoded credentials or API keys exist.
|
|
44
|
-
- **Input Sanitization**: Ensure parameterized queries and validated inputs.
|
|
45
|
-
5. **Lane 5: Findings Ledger State Machine (`findings.md`)**:
|
|
46
|
-
- Inspect `devflow/context/findings.md`.
|
|
47
|
-
- **P0/P1 HARD GATE**: Any Finding of severity `P0` or `P1` in `open` or `fixed` status unconditionally blocks pass.
|
|
48
|
-
6. **Lane 6: Manual Scenario Proof**:
|
|
49
|
-
- Provide clear manual verification instructions: "Where to go", "What to run/click", "What to expect".
|
|
50
|
-
|
|
51
|
-
### 2. Decision & Route
|
|
52
|
-
|
|
53
|
-
- **Pass**: Both Stage 1 and Stage 2 pass with 0 blockers -> Route to `60-report {ID}`.
|
|
54
|
-
- **Fail**: Either Stage 1 or Stage 2 fails -> Route back to `40-execute {ID}` with exact failure evidence and remediation steps.
|
|
55
|
-
|
|
56
|
-
## Output
|
|
57
|
-
|
|
58
|
-
Report:
|
|
59
|
-
- **Stage 1 Verdict**: Spec Fidelity & Acceptance Criteria status
|
|
60
|
-
- **Stage 2 Verdict**: Technical Multi-lane quality & security matrix
|
|
61
|
-
- Evidence commands and outputs
|
|
62
|
-
- Next command: `60-report {ID}` (if pass) or `40-execute {ID}` (if fail)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: 60-report
|
|
3
|
-
description: "[devflow][D] Report stage in DevFlow 2.0 - produce standardized markdown summary report with retrospective lessons learned."
|
|
4
|
-
argument-hint: "{running-id or workspace path}"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 60: Report
|
|
8
|
-
|
|
9
|
-
$ARGUMENTS
|
|
10
|
-
|
|
11
|
-
Produce the final human-friendly summary of the full running flow in Markdown (`60-report.md`) with retrospective lessons learned, findings summary, and release digest.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
60-report {running-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/60-report.md
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
> [!IMPORTANT]
|
|
28
|
-
> **No Auto-Generated HTML**: ห้ามสร้างไฟล์ `60-report.html` แบบอัตโนมัติในขั้นตอนนี้! ระบบจะสร้างเฉพาะ `60-report.md` เท่านั้น หากต้องการดู HTML Report ให้เรียกคำสั่งแยก: `/report:html`
|
|
29
|
-
|
|
30
|
-
## Process
|
|
31
|
-
|
|
32
|
-
### 1. Gather Full Run Context & Verification Evidence
|
|
33
|
-
Read all relevant stage artifacts:
|
|
34
|
-
- `10-define.md`
|
|
35
|
-
- `20-spec.md`
|
|
36
|
-
- `30-plan.md`
|
|
37
|
-
- `40-execute.md`
|
|
38
|
-
- `50-verify.md`
|
|
39
|
-
|
|
40
|
-
### 2. Retrospective Lessons Learned & Gotchas (Insight Extraction)
|
|
41
|
-
Extract durable insights from the completed run:
|
|
42
|
-
- **Reusable Patterns**: Design choices or implementations that future runs should mirror.
|
|
43
|
-
- **Gotchas & Pitfalls**: Unforeseen issues or quirks encountered during execution.
|
|
44
|
-
- **Unresolved Follow-ups**: Route any residual out-of-scope ideas to `devflow/ideas.md`.
|
|
45
|
-
|
|
46
|
-
### 3. Produce Standardized Report (`60-report.md`)
|
|
47
|
-
Structure the report in **Thai (`th`)**:
|
|
48
|
-
1. **Executive Summary**: ปัญหาและแนวทางแก้ไข
|
|
49
|
-
2. **Delivery Scope**: รายการฟีเจอร์และคอมโพเนนต์ที่ส่งมอบ
|
|
50
|
-
3. **Verification Evidence Snapshot**: ผลการทดสอบทุก Lane
|
|
51
|
-
4. **Retrospective & Lessons Learned**: บทเรียนและข้อควรระวัง
|
|
52
|
-
5. **Manual Try Guide**: ขั้นตอนสำหรับมนุษย์ทดสอบระบบ
|
|
53
|
-
|
|
54
|
-
## Next Workflow Recommendation
|
|
55
|
-
|
|
56
|
-
- **Primary**: `70-deliver {ID}`
|
|
57
|
-
- **Optional Standalone HTML**: `/report:html`
|