duaer-spec 0.1.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 (75) hide show
  1. package/.cursor/rules/agents-workflow.mdc +50 -0
  2. package/.cursor/rules/ai-ui-copy.mdc +12 -0
  3. package/.cursor/rules/duaer-spec.mdc +33 -0
  4. package/.cursor/skills/duaer-analyze/SKILL.md +259 -0
  5. package/.cursor/skills/duaer-checklist/SKILL.md +383 -0
  6. package/.cursor/skills/duaer-clarify/SKILL.md +291 -0
  7. package/.cursor/skills/duaer-constitution/SKILL.md +177 -0
  8. package/.cursor/skills/duaer-converge/SKILL.md +277 -0
  9. package/.cursor/skills/duaer-git-commit/SKILL.md +68 -0
  10. package/.cursor/skills/duaer-git-feature/SKILL.md +94 -0
  11. package/.cursor/skills/duaer-git-initialize/SKILL.md +54 -0
  12. package/.cursor/skills/duaer-git-remote/SKILL.md +50 -0
  13. package/.cursor/skills/duaer-git-validate/SKILL.md +54 -0
  14. package/.cursor/skills/duaer-implement/SKILL.md +226 -0
  15. package/.cursor/skills/duaer-plan/SKILL.md +166 -0
  16. package/.cursor/skills/duaer-specify/SKILL.md +345 -0
  17. package/.cursor/skills/duaer-tasks/SKILL.md +214 -0
  18. package/.cursor/skills/duaer-taskstoissues/SKILL.md +109 -0
  19. package/.duaer/extensions/.registry +23 -0
  20. package/.duaer/extensions/git/README.md +119 -0
  21. package/.duaer/extensions/git/commands/duaer.git.commit.md +63 -0
  22. package/.duaer/extensions/git/commands/duaer.git.feature.md +82 -0
  23. package/.duaer/extensions/git/commands/duaer.git.initialize.md +49 -0
  24. package/.duaer/extensions/git/commands/duaer.git.remote.md +45 -0
  25. package/.duaer/extensions/git/commands/duaer.git.validate.md +49 -0
  26. package/.duaer/extensions/git/config-template.yml +79 -0
  27. package/.duaer/extensions/git/extension.yml +142 -0
  28. package/.duaer/extensions/git/git-config.yml +79 -0
  29. package/.duaer/extensions/git/scripts/bash/auto-commit.sh +211 -0
  30. package/.duaer/extensions/git/scripts/bash/create-new-feature-branch.sh +626 -0
  31. package/.duaer/extensions/git/scripts/bash/git-common.sh +56 -0
  32. package/.duaer/extensions/git/scripts/bash/initialize-repo.sh +54 -0
  33. package/.duaer/extensions/git/scripts/powershell/auto-commit.ps1 +230 -0
  34. package/.duaer/extensions/git/scripts/powershell/create-new-feature-branch.ps1 +592 -0
  35. package/.duaer/extensions/git/scripts/powershell/git-common.ps1 +52 -0
  36. package/.duaer/extensions/git/scripts/powershell/initialize-repo.ps1 +69 -0
  37. package/.duaer/extensions/git/scripts/python/auto_commit.py +195 -0
  38. package/.duaer/extensions/git/scripts/python/create_new_feature_branch.py +634 -0
  39. package/.duaer/extensions/git/scripts/python/git_common.py +81 -0
  40. package/.duaer/extensions/git/scripts/python/initialize_repo.py +89 -0
  41. package/.duaer/extensions.yml +167 -0
  42. package/.duaer/init-options.json +9 -0
  43. package/.duaer/integration.json +15 -0
  44. package/.duaer/integrations/cursor-agent.manifest.json +17 -0
  45. package/.duaer/integrations/duaer.manifest.json +19 -0
  46. package/.duaer/memory/.constitution-template.json +4 -0
  47. package/.duaer/memory/constitution.md +37 -0
  48. package/.duaer/memory/project-context.md +24 -0
  49. package/.duaer/memory/testing.md +14 -0
  50. package/.duaer/scripts/bash/check-prerequisites.sh +243 -0
  51. package/.duaer/scripts/bash/common.sh +926 -0
  52. package/.duaer/scripts/bash/create-new-feature.sh +407 -0
  53. package/.duaer/scripts/bash/resolve-template.sh +57 -0
  54. package/.duaer/scripts/bash/setup-plan.sh +85 -0
  55. package/.duaer/scripts/bash/setup-tasks.sh +94 -0
  56. package/.duaer/templates/checklist-template.md +45 -0
  57. package/.duaer/templates/constitution-template.md +50 -0
  58. package/.duaer/templates/plan-template.md +113 -0
  59. package/.duaer/templates/spec-template.md +131 -0
  60. package/.duaer/templates/tasks-template.md +252 -0
  61. package/.duaer/workflows/duaer/workflow.yml +78 -0
  62. package/.duaer/workflows/workflow-registry.json +13 -0
  63. package/ADOPT.md +75 -0
  64. package/AGENTS.md +290 -0
  65. package/CHANGELOG.md +28 -0
  66. package/DUADER.md +57 -0
  67. package/LICENSE +21 -0
  68. package/README.md +74 -0
  69. package/bin/duaer.mjs +298 -0
  70. package/docs/agent/README.md +12 -0
  71. package/docs/agent/change-checklist.md +130 -0
  72. package/docs/agent/e2e-test-plan.md +33 -0
  73. package/docs/agent/workflow.md +127 -0
  74. package/docs/baseline.md +10 -0
  75. package/package.json +49 -0
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: "duaer-implement"
3
+ description: "Execute the implementation plan by processing and executing all tasks defined in tasks.md"
4
+ compatibility: "Requires duaer-spec project structure with .duaer/ directory"
5
+ metadata:
6
+ author: "duaer-spec"
7
+ source: "duaer-spec"
8
+ ---
9
+
10
+
11
+ ## User Input
12
+
13
+ ```text
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ You **MUST** consider the user input before proceeding (if not empty).
18
+
19
+ ## Pre-Execution Checks
20
+
21
+ **Check for extension hooks (before implementation)**:
22
+ - Check if `.duaer/extensions.yml` exists in the project root.
23
+ - If it exists, read it and look for entries under the `hooks.before_implement` key
24
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
25
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
26
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
27
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
28
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
29
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
30
+ - For each executable hook, output the following based on its `optional` flag:
31
+ - **Optional hook** (`optional: true`):
32
+ ```
33
+ ## Extension Hooks
34
+
35
+ **Optional Pre-Hook**: {extension}
36
+ Command: `/{command}`
37
+ Description: {description}
38
+
39
+ Prompt: {prompt}
40
+ To execute: `/{command}`
41
+ ```
42
+ - **Mandatory hook** (`optional: false`):
43
+ ```
44
+ ## Extension Hooks
45
+
46
+ **Automatic Pre-Hook**: {extension}
47
+ Executing: `/{command}`
48
+ EXECUTE_COMMAND: {command}
49
+
50
+ Wait for the result of the hook command before proceeding to the Outline.
51
+ ```
52
+ After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:duaer-...` or `$duaer-...`). Emitting the block alone does not run the hook.
53
+ - If no hooks are registered or `.duaer/extensions.yml` does not exist, skip silently
54
+
55
+ ## Outline
56
+
57
+ 1. Run `.duaer/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
58
+
59
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
60
+ - Treat checklist markers as a read-only gate: scan checkbox state, report status, and ask before proceeding when needed; do NOT modify checklist files or markers
61
+ - `checklists/requirements.md` is the built-in spec-quality checklist maintained by `/duaer-specify` and `/duaer-clarify`; custom checklists generated by `/duaer-checklist` are reviewer-owned requirements-quality review artifacts
62
+ - For custom checklists, `[x]` means the reviewer determined the requirements-quality criterion is satisfied; it does NOT mean implementation work is complete
63
+ - Scan all checklist files in the checklists/ directory
64
+ - For each checklist, count:
65
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
66
+ - Checked items: Lines matching `- [X]` or `- [x]`
67
+ - Unchecked items: Lines matching `- [ ]`
68
+ - Create a status table:
69
+
70
+ ```text
71
+ | Checklist | Total | Checked | Unchecked | Status |
72
+ |-----------|-------|---------|-----------|--------|
73
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
74
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
75
+ | security.md | 6 | 6 | 0 | ✓ PASS |
76
+ ```
77
+
78
+ - Calculate overall status:
79
+ - **PASS**: All checklists have 0 unchecked items
80
+ - **FAIL**: One or more checklists have unchecked items
81
+
82
+ - **If any checklist has unchecked items**:
83
+ - Display the table with unchecked item counts
84
+ - **STOP** and ask: "Some checklists have unchecked items. Do you want to proceed with implementation anyway? (yes/no)"
85
+ - Wait for user response before continuing
86
+ - If user says "no" or "wait" or "stop", halt execution
87
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
88
+
89
+ - **If all checklists are checked**:
90
+ - Display the table showing all checklists passed
91
+ - Automatically proceed to step 3
92
+
93
+ 3. Load and analyze the implementation context:
94
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
95
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
96
+ - **IF EXISTS**: Read data-model.md for entities and relationships
97
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
98
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
99
+ - **IF EXISTS**: Read .duaer/memory/constitution.md for governance constraints
100
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
101
+
102
+ 4. **Project Setup Verification**:
103
+ - **REQUIRED**: Create/verify ignore files based on actual project setup:
104
+
105
+ **Detection & Creation Logic**:
106
+ - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):
107
+
108
+ ```sh
109
+ git rev-parse --git-dir 2>/dev/null
110
+ ```
111
+
112
+ - Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
113
+ - Check if .eslintrc* exists → create/verify .eslintignore
114
+ - Check if eslint.config.* exists → ensure the config's `ignores` entries cover required patterns
115
+ - Check if .prettierrc* exists → create/verify .prettierignore
116
+ - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
117
+ - Check if terraform files (*.tf) exist → create/verify .terraformignore
118
+ - Check if .helmignore needed (helm charts present) → create/verify .helmignore
119
+
120
+ **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
121
+ **If ignore file missing**: Create with full pattern set for detected technology
122
+
123
+ **Common Patterns by Technology** (from plan.md tech stack):
124
+ - **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
125
+ - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
126
+ - **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
127
+ - **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
128
+ - **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
129
+ - **Ruby**: `.bundle/`, `log/`, `tmp/`, `*.gem`, `vendor/bundle/`
130
+ - **PHP**: `vendor/`, `*.log`, `*.cache`, `*.env`
131
+ - **Rust**: `target/`, `debug/`, `release/`, `*.rs.bk`, `*.rlib`, `*.prof*`, `.idea/`, `*.log`, `.env*`
132
+ - **Kotlin**: `build/`, `out/`, `.gradle/`, `.idea/`, `*.class`, `*.jar`, `*.iml`, `*.log`, `.env*`
133
+ - **C++**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.so`, `*.a`, `*.exe`, `*.dll`, `.idea/`, `*.log`, `.env*`
134
+ - **C**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.a`, `*.so`, `*.exe`, `*.dll`, `autom4te.cache/`, `config.status`, `config.log`, `.idea/`, `*.log`, `.env*`
135
+ - **Swift**: `.build/`, `DerivedData/`, `*.swiftpm/`, `Packages/`
136
+ - **R**: `.Rproj.user/`, `.Rhistory`, `.RData`, `.Ruserdata`, `*.Rproj`, `packrat/`, `renv/`
137
+ - **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
138
+
139
+ **Tool-Specific Patterns**:
140
+ - **Docker**: `node_modules/`, `.git/`, `Dockerfile*`, `.dockerignore`, `*.log*`, `.env*`, `coverage/`
141
+ - **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
142
+ - **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
143
+ - **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
144
+ - **Kubernetes/k8s**: `*.secret.yaml`, `secrets/`, `.kube/`, `kubeconfig*`, `*.key`, `*.crt`
145
+
146
+ 5. Parse tasks.md structure and extract:
147
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
148
+ - **Task dependencies**: Sequential vs parallel execution rules
149
+ - **Task details**: ID, description, file paths, parallel markers [P]
150
+ - **Execution flow**: Order and dependency requirements
151
+
152
+ 6. Execute implementation following the task plan:
153
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
154
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
155
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
156
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
157
+ - **Validation checkpoints**: Verify each phase completion before proceeding
158
+
159
+ 7. Implementation execution rules:
160
+ - **Setup first**: Initialize project structure, dependencies, configuration
161
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
162
+ - **Core development**: Implement models, services, CLI commands, endpoints
163
+ - **Integration work**: Database connections, middleware, logging, external services
164
+ - **Polish and validation**: Unit tests, performance optimization, documentation
165
+
166
+ 8. Progress tracking and error handling:
167
+ - Report progress after each completed task
168
+ - Halt execution if any non-parallel task fails
169
+ - For parallel tasks [P], continue with successful tasks, report failed ones
170
+ - Provide clear error messages with context for debugging
171
+ - Suggest next steps if implementation cannot proceed
172
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
173
+
174
+ 9. Completion validation:
175
+ - Verify all required tasks are completed
176
+ - Check that implemented features match the original specification
177
+ - Validate that tests pass and coverage meets requirements
178
+ - Confirm the implementation follows the technical plan
179
+
180
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/duaer-tasks` first to regenerate the task list.
181
+
182
+ ## Mandatory Post-Execution Hooks
183
+
184
+ **You MUST complete this section before reporting completion to the user.**
185
+
186
+ Check if `.duaer/extensions.yml` exists in the project root.
187
+ - If it does not exist, or no hooks are registered under `hooks.after_implement`, skip to the Completion Report.
188
+ - If it exists, read it and look for entries under the `hooks.after_implement` key.
189
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
190
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
191
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
192
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
193
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
194
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
195
+ - For each executable hook, output the following based on its `optional` flag:
196
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
197
+ ```
198
+ ## Extension Hooks
199
+
200
+ **Automatic Hook**: {extension}
201
+ Executing: `/{command}`
202
+ EXECUTE_COMMAND: {command}
203
+ ```
204
+ After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:duaer-...` or `$duaer-...`). Emitting the block alone does not run the hook.
205
+ - **Optional hook** (`optional: true`):
206
+ ```
207
+ ## Extension Hooks
208
+
209
+ **Optional Hook**: {extension}
210
+ Command: `/{command}`
211
+ Description: {description}
212
+
213
+ Prompt: {prompt}
214
+ To execute: `/{command}`
215
+ ```
216
+
217
+ ## Completion Report
218
+
219
+ Report final status with summary of completed work.
220
+
221
+ ## Done When
222
+
223
+ - [ ] All tasks in tasks.md completed and marked `[X]`
224
+ - [ ] Implementation validated against specification, plan, and test coverage
225
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
226
+ - [ ] Completion reported to user with summary of completed work
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: "duaer-plan"
3
+ description: "Execute the implementation planning workflow using the plan template to generate design artifacts."
4
+ compatibility: "Requires duaer-spec project structure with .duaer/ directory"
5
+ metadata:
6
+ author: "duaer-spec"
7
+ source: "duaer-spec"
8
+ ---
9
+
10
+
11
+ ## User Input
12
+
13
+ ```text
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ You **MUST** consider the user input before proceeding (if not empty).
18
+
19
+ ## Pre-Execution Checks
20
+
21
+ **Check for extension hooks (before planning)**:
22
+ - Check if `.duaer/extensions.yml` exists in the project root.
23
+ - If it exists, read it and look for entries under the `hooks.before_plan` key
24
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
25
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
26
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
27
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
28
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
29
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
30
+ - For each executable hook, output the following based on its `optional` flag:
31
+ - **Optional hook** (`optional: true`):
32
+ ```
33
+ ## Extension Hooks
34
+
35
+ **Optional Pre-Hook**: {extension}
36
+ Command: `/{command}`
37
+ Description: {description}
38
+
39
+ Prompt: {prompt}
40
+ To execute: `/{command}`
41
+ ```
42
+ - **Mandatory hook** (`optional: false`):
43
+ ```
44
+ ## Extension Hooks
45
+
46
+ **Automatic Pre-Hook**: {extension}
47
+ Executing: `/{command}`
48
+ EXECUTE_COMMAND: {command}
49
+
50
+ Wait for the result of the hook command before proceeding to the Outline.
51
+ ```
52
+ After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:duaer-...` or `$duaer-...`). Emitting the block alone does not run the hook.
53
+ - If no hooks are registered or `.duaer/extensions.yml` does not exist, skip silently
54
+
55
+ ## Outline
56
+
57
+ 1. **Setup**: Run `.duaer/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
58
+
59
+ 2. **Load context**: Read FEATURE_SPEC and `.duaer/memory/constitution.md`. Load IMPL_PLAN template (already copied).
60
+
61
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
62
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
63
+ - Fill Constitution Check section from constitution
64
+ - Evaluate gates (ERROR if violations unjustified)
65
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
66
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
67
+ - Re-evaluate Constitution Check post-design
68
+
69
+ ## Mandatory Post-Execution Hooks
70
+
71
+ **You MUST complete this section before reporting completion to the user.**
72
+
73
+ Check if `.duaer/extensions.yml` exists in the project root.
74
+ - If it does not exist, or no hooks are registered under `hooks.after_plan`, skip to the Completion Report.
75
+ - If it exists, read it and look for entries under the `hooks.after_plan` key.
76
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
77
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
78
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
79
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
80
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
81
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
82
+ - For each executable hook, output the following based on its `optional` flag:
83
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
84
+ ```
85
+ ## Extension Hooks
86
+
87
+ **Automatic Hook**: {extension}
88
+ Executing: `/{command}`
89
+ EXECUTE_COMMAND: {command}
90
+ ```
91
+ After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:duaer-...` or `$duaer-...`). Emitting the block alone does not run the hook.
92
+ - **Optional hook** (`optional: true`):
93
+ ```
94
+ ## Extension Hooks
95
+
96
+ **Optional Hook**: {extension}
97
+ Command: `/{command}`
98
+ Description: {description}
99
+
100
+ Prompt: {prompt}
101
+ To execute: `/{command}`
102
+ ```
103
+
104
+ ## Completion Report
105
+
106
+ Command ends after Phase 1 design. Report branch, IMPL_PLAN path, and generated artifacts.
107
+
108
+ ## Phases
109
+
110
+ ### Phase 0: Outline & Research
111
+
112
+ 1. **Extract unknowns from Technical Context** above:
113
+ - For each NEEDS CLARIFICATION → research task
114
+ - For each dependency → best practices task
115
+ - For each integration → patterns task
116
+
117
+ 2. **Generate and dispatch research agents**:
118
+
119
+ ```text
120
+ For each unknown in Technical Context:
121
+ Task: "Research {unknown} for {feature context}"
122
+ For each technology choice:
123
+ Task: "Find best practices for {tech} in {domain}"
124
+ ```
125
+
126
+ 3. **Consolidate findings** in `research.md` using format:
127
+ - Decision: [what was chosen]
128
+ - Rationale: [why chosen]
129
+ - Alternatives considered: [what else evaluated]
130
+
131
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
132
+
133
+ ### Phase 1: Design & Contracts
134
+
135
+ **Prerequisites:** `research.md` complete
136
+
137
+ 1. **Extract entities from feature spec** → `data-model.md`:
138
+ - Entity name, fields, relationships
139
+ - Validation rules from requirements
140
+ - State transitions if applicable
141
+
142
+ 2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
143
+ - Identify what interfaces the project exposes to users or other systems
144
+ - Document the contract format appropriate for the project type
145
+ - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
146
+ - Skip if project is purely internal (build scripts, one-off tools, etc.)
147
+
148
+ 3. **Create quickstart validation guide** → `quickstart.md`:
149
+ - Document runnable validation scenarios that prove the feature works end-to-end
150
+ - Include prerequisites, setup commands, test/run commands, and expected outcomes
151
+ - Use links or references to contracts and data model details instead of duplicating them
152
+ - Do not include full implementation code, model/service/controller bodies, migrations, or complete test suites
153
+ - Keep this artifact as a validation/run guide; implementation details belong in `tasks.md` and the implementation phase
154
+
155
+ **Output**: data-model.md, /contracts/*, quickstart.md
156
+
157
+ ## Key rules
158
+
159
+ - Use absolute paths for filesystem operations; use project-relative paths for references in documentation
160
+ - ERROR on gate failures or unresolved clarifications
161
+
162
+ ## Done When
163
+
164
+ - [ ] Plan workflow executed and design artifacts generated
165
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
166
+ - [ ] Completion reported to user with branch, plan path, and generated artifacts