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,345 @@
1
+ ---
2
+ name: "duaer-specify"
3
+ description: "Create or update the feature specification from a natural language feature description."
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 specification)**:
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_specify` 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
+ The text the user typed after `/duaer-specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
58
+
59
+ Given that feature description, do this:
60
+
61
+ 1. **Generate a concise short name** (2-4 words) for the feature:
62
+ - Analyze the feature description and extract the most meaningful keywords
63
+ - Create a 2-4 word short name that captures the essence of the feature
64
+ - Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
65
+ - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
66
+ - Keep it concise but descriptive enough to understand the feature at a glance
67
+ - Examples:
68
+ - "I want to add user authentication" → "user-auth"
69
+ - "Implement OAuth2 integration for the API" → "oauth2-api-integration"
70
+ - "Create a dashboard for analytics" → "analytics-dashboard"
71
+ - "Fix payment processing timeout bug" → "fix-payment-timeout"
72
+
73
+ 2. **Branch creation** (optional, via hook):
74
+
75
+ If a `before_specify` hook ran successfully in the Pre-Execution Checks above, it will have created/switched to a git branch and output JSON containing `BRANCH_NAME` and `FEATURE_NUM`. Note these values for reference, but the branch name does **not** dictate the spec directory name.
76
+
77
+ If the user explicitly provided `GIT_BRANCH_NAME`, pass it through to the hook so the branch script uses the exact value as the branch name (bypassing all prefix/suffix generation).
78
+
79
+ 3. **Create the spec feature directory**:
80
+
81
+ Specs live under the default `specs/` directory unless the user explicitly provides `SPECIFY_FEATURE_DIRECTORY`.
82
+
83
+ **Resolution order for `SPECIFY_FEATURE_DIRECTORY`**:
84
+ 1. If the user explicitly provided `SPECIFY_FEATURE_DIRECTORY` (e.g., via environment variable, argument, or configuration), use it as-is
85
+ 2. Otherwise, auto-generate it under `specs/`:
86
+ - Check `.duaer/init-options.json` for `feature_numbering` (preferred) or `branch_numbering` (deprecated, migration only — will be removed in a future release)
87
+ - If `"timestamp"`: prefix is `YYYYMMDD-HHMMSS` (current timestamp)
88
+ - If `"sequential"` or absent: prefix is `NNN` (next available 3-digit number after scanning existing directories in `specs/`)
89
+ - Construct the directory name: `<prefix>-<short-name>` (e.g., `003-user-auth` or `20260319-143022-user-auth`)
90
+ - Set `SPECIFY_FEATURE_DIRECTORY` to `specs/<directory-name>`
91
+ - If `branch_numbering` was used (and `feature_numbering` was absent), emit a one-line warning: "⚠️ `branch_numbering` in init-options.json is deprecated. Rename to `feature_numbering`."
92
+
93
+ **Create the directory and spec file**:
94
+ - `mkdir -p SPECIFY_FEATURE_DIRECTORY`
95
+ - Resolve the active `spec-template` through the Duaer preset/template resolution stack (equivalent to `specify preset resolve spec-template`)
96
+ - Copy the resolved `spec-template` file to `SPECIFY_FEATURE_DIRECTORY/spec.md` as the starting point
97
+ - Set `SPEC_FILE` to `SPECIFY_FEATURE_DIRECTORY/spec.md`
98
+ - Persist the resolved path to `.duaer/feature.json`:
99
+ ```json
100
+ {
101
+ "feature_directory": "<resolved feature dir>"
102
+ }
103
+ ```
104
+ Write the actual resolved directory path value (for example, `specs/003-user-auth`), not the literal string `SPECIFY_FEATURE_DIRECTORY`.
105
+ This allows downstream commands (`/duaer-plan`, `/duaer-tasks`, etc.) to locate the feature directory without relying on git branch name conventions.
106
+
107
+ **IMPORTANT**:
108
+ - You must only create one feature per `/duaer-specify` invocation
109
+ - The spec directory name and the git branch name are independent — they may be the same but that is the user's choice
110
+ - The spec directory and file are always created by this command, never by the hook
111
+
112
+ 4. Load the resolved active `spec-template` file to understand required sections.
113
+
114
+ 5. **IF EXISTS**: Load `.duaer/memory/constitution.md` for project principles and governance constraints.
115
+
116
+ 6. Follow this execution flow:
117
+ 1. Parse user description from arguments
118
+ If empty: ERROR "No feature description provided"
119
+ 2. Extract key concepts from description
120
+ Identify: actors, actions, data, constraints
121
+ 3. For unclear aspects:
122
+ - Make informed guesses based on context and industry standards
123
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
124
+ - The choice significantly impacts feature scope or user experience
125
+ - Multiple reasonable interpretations exist with different implications
126
+ - No reasonable default exists
127
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
128
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
129
+ 4. Fill User Scenarios & Testing section
130
+ If no clear user flow: ERROR "Cannot determine user scenarios"
131
+ 5. Generate Functional Requirements
132
+ Each requirement must be testable
133
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
134
+ 6. Define Success Criteria
135
+ Create measurable, technology-agnostic outcomes
136
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
137
+ Each criterion must be verifiable without implementation details
138
+ 7. Identify Key Entities (if data involved)
139
+ 8. Return: SUCCESS (spec ready for planning)
140
+
141
+ 7. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
142
+
143
+ 8. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
144
+
145
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `SPECIFY_FEATURE_DIRECTORY/checklists/requirements.md` using the checklist template structure with these validation items:
146
+
147
+ ```markdown
148
+ # Specification Quality Checklist: [FEATURE NAME]
149
+
150
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
151
+ **Created**: [DATE]
152
+ **Feature**: [Link to spec.md]
153
+
154
+ ## Content Quality
155
+
156
+ - [ ] No implementation details (languages, frameworks, APIs)
157
+ - [ ] Focused on user value and business needs
158
+ - [ ] Written for non-technical stakeholders
159
+ - [ ] All mandatory sections completed
160
+
161
+ ## Requirement Completeness
162
+
163
+ - [ ] No [NEEDS CLARIFICATION] markers remain
164
+ - [ ] Requirements are testable and unambiguous
165
+ - [ ] Success criteria are measurable
166
+ - [ ] Success criteria are technology-agnostic (no implementation details)
167
+ - [ ] All acceptance scenarios are defined
168
+ - [ ] Edge cases are identified
169
+ - [ ] Scope is clearly bounded
170
+ - [ ] Dependencies and assumptions identified
171
+
172
+ ## Feature Readiness
173
+
174
+ - [ ] All functional requirements have clear acceptance criteria
175
+ - [ ] User scenarios cover primary flows
176
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
177
+ - [ ] No implementation details leak into specification
178
+
179
+ ## Notes
180
+
181
+ - Items marked incomplete require spec updates before `/duaer-clarify` or `/duaer-plan`
182
+ ```
183
+
184
+ b. **Run Validation Check**: Review the spec against each checklist item:
185
+ - For each item, determine if it passes or fails
186
+ - Document specific issues found (quote relevant spec sections)
187
+
188
+ c. **Handle Validation Results**:
189
+
190
+ - **If all items pass**: Mark checklist complete and proceed to the Mandatory Post-Execution Hooks section
191
+
192
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
193
+ 1. List the failing items and specific issues
194
+ 2. Update the spec to address each issue
195
+ 3. Re-run validation until all items pass (max 3 iterations)
196
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
197
+
198
+ - **If [NEEDS CLARIFICATION] markers remain**:
199
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
200
+ 2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
201
+ 3. For each clarification needed (max 3), present options to user in this format:
202
+
203
+ ```markdown
204
+ ## Question [N]: [Topic]
205
+
206
+ **Context**: [Quote relevant spec section]
207
+
208
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
209
+
210
+ **Suggested Answers**:
211
+
212
+ | Option | Answer | Implications |
213
+ |--------|--------|--------------|
214
+ | A | [First suggested answer] | [What this means for the feature] |
215
+ | B | [Second suggested answer] | [What this means for the feature] |
216
+ | C | [Third suggested answer] | [What this means for the feature] |
217
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
218
+
219
+ **Your choice**: _[Wait for user response]_
220
+ ```
221
+
222
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
223
+ - Use consistent spacing with pipes aligned
224
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
225
+ - Header separator must have at least 3 dashes: `|--------|`
226
+ - Test that the table renders correctly in markdown preview
227
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
228
+ 6. Present all questions together before waiting for responses
229
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
230
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
231
+ 9. Re-run validation after all clarifications are resolved
232
+
233
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
234
+
235
+ ## Mandatory Post-Execution Hooks
236
+
237
+ **You MUST complete this section before reporting completion to the user.**
238
+
239
+ Check if `.duaer/extensions.yml` exists in the project root.
240
+ - If it does not exist, or no hooks are registered under `hooks.after_specify`, skip to the Completion Report.
241
+ - If it exists, read it and look for entries under the `hooks.after_specify` key.
242
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
243
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
244
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
245
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
246
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
247
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
248
+ - For each executable hook, output the following based on its `optional` flag:
249
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
250
+ ```
251
+ ## Extension Hooks
252
+
253
+ **Automatic Hook**: {extension}
254
+ Executing: `/{command}`
255
+ EXECUTE_COMMAND: {command}
256
+ ```
257
+ 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.
258
+ - **Optional hook** (`optional: true`):
259
+ ```
260
+ ## Extension Hooks
261
+
262
+ **Optional Hook**: {extension}
263
+ Command: `/{command}`
264
+ Description: {description}
265
+
266
+ Prompt: {prompt}
267
+ To execute: `/{command}`
268
+ ```
269
+
270
+ ## Completion Report
271
+
272
+ Report completion to the user with:
273
+ - `SPECIFY_FEATURE_DIRECTORY` — the feature directory path
274
+ - `SPEC_FILE` — the spec file path
275
+ - Checklist results summary
276
+ - Readiness for the next phase (`/duaer-clarify` or `/duaer-plan`)
277
+
278
+ **NOTE:** Branch creation is handled by the `before_specify` hook (git extension). Spec directory and file creation are always handled by this core command.
279
+
280
+ ## Quick Guidelines
281
+
282
+ - Focus on **WHAT** users need and **WHY**.
283
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
284
+ - Written for business stakeholders, not developers.
285
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
286
+
287
+ ### Section Requirements
288
+
289
+ - **Mandatory sections**: Must be completed for every feature
290
+ - **Optional sections**: Include only when relevant to the feature
291
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
292
+
293
+ ### For AI Generation
294
+
295
+ When creating this spec from a user prompt:
296
+
297
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
298
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
299
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
300
+ - Significantly impact feature scope or user experience
301
+ - Have multiple reasonable interpretations with different implications
302
+ - Lack any reasonable default
303
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
304
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
305
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
306
+ - Feature scope and boundaries (include/exclude specific use cases)
307
+ - User types and permissions (if multiple conflicting interpretations possible)
308
+ - Security/compliance requirements (when legally/financially significant)
309
+
310
+ **Examples of reasonable defaults** (don't ask about these):
311
+
312
+ - Data retention: Industry-standard practices for the domain
313
+ - Performance targets: Standard web/mobile app expectations unless specified
314
+ - Error handling: User-friendly messages with appropriate fallbacks
315
+ - Authentication method: Standard session-based or OAuth2 for web apps
316
+ - Integration patterns: Use project-appropriate patterns (REST/GraphQL for web services, function calls for libraries, CLI args for tools, etc.)
317
+
318
+ ### Success Criteria Guidelines
319
+
320
+ Success criteria must be:
321
+
322
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
323
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
324
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
325
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
326
+
327
+ **Good examples**:
328
+
329
+ - "Users can complete checkout in under 3 minutes"
330
+ - "System supports 10,000 concurrent users"
331
+ - "95% of searches return results in under 1 second"
332
+ - "Task completion rate improves by 40%"
333
+
334
+ **Bad examples** (implementation-focused):
335
+
336
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
337
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
338
+ - "React components render efficiently" (framework-specific)
339
+ - "Redis cache hit rate above 80%" (technology-specific)
340
+
341
+ ## Done When
342
+
343
+ - [ ] Specification written to `SPEC_FILE` and validated against quality checklist
344
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
345
+ - [ ] Completion reported to user with feature directory, spec file path, and checklist results
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: "duaer-tasks"
3
+ description: "Generate an actionable, dependency-ordered tasks.md for the feature based on available 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 tasks generation)**:
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_tasks` 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-tasks.sh --json` from repo root and parse FEATURE_DIR, TASKS_TEMPLATE_CONTENT, TASKS_TEMPLATE, and AVAILABLE_DOCS list. `FEATURE_DIR` and `TASKS_TEMPLATE` must be absolute paths when provided. `AVAILABLE_DOCS` is a list of document names/relative paths available under `FEATURE_DIR` (for example `research.md` or `contracts/`). 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 design documents**: Read from FEATURE_DIR:
60
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
61
+ - **Optional**: data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
62
+ - **IF EXISTS**: Load `.duaer/memory/constitution.md` for project principles and governance constraints
63
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
64
+
65
+ 3. **Execute task generation workflow**:
66
+ - Load plan.md and extract tech stack, libraries, project structure
67
+ - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
68
+ - If data-model.md exists: Extract entities and map to user stories
69
+ - If contracts/ exists: Map interface contracts to user stories
70
+ - If research.md exists: Extract decisions for setup tasks
71
+ - Generate tasks organized by user story (see Task Generation Rules below)
72
+ - Generate dependency graph showing user story completion order
73
+ - Create parallel execution examples per user story
74
+ - Validate task completeness (each user story has all needed tasks, independently testable)
75
+
76
+ 4. **Generate tasks.md**: Use TASKS_TEMPLATE_CONTENT (from the JSON output above) as the structure. For compatibility with older setup scripts that omit TASKS_TEMPLATE_CONTENT, read TASKS_TEMPLATE instead. Fill with:
77
+ - Correct feature name from plan.md
78
+ - Phase 1: Setup tasks (project initialization)
79
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
80
+ - Phase 3+: One phase per user story (in priority order from spec.md)
81
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
82
+ - Final Phase: Polish & cross-cutting concerns
83
+ - All tasks must follow the strict checklist format (see Task Generation Rules below)
84
+ - Clear file paths for each task
85
+ - Dependencies section showing story completion order
86
+ - Parallel execution examples per story
87
+ - Implementation strategy section (MVP first, incremental delivery)
88
+
89
+ ## Mandatory Post-Execution Hooks
90
+
91
+ **You MUST complete this section before reporting completion to the user.**
92
+
93
+ Check if `.duaer/extensions.yml` exists in the project root.
94
+ - If it does not exist, or no hooks are registered under `hooks.after_tasks`, skip to the Completion Report.
95
+ - If it exists, read it and look for entries under the `hooks.after_tasks` key.
96
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
97
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
98
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
99
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
100
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
101
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
102
+ - For each executable hook, output the following based on its `optional` flag:
103
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
104
+ ```
105
+ ## Extension Hooks
106
+
107
+ **Automatic Hook**: {extension}
108
+ Executing: `/{command}`
109
+ EXECUTE_COMMAND: {command}
110
+ ```
111
+ 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.
112
+ - **Optional hook** (`optional: true`):
113
+ ```
114
+ ## Extension Hooks
115
+
116
+ **Optional Hook**: {extension}
117
+ Command: `/{command}`
118
+ Description: {description}
119
+
120
+ Prompt: {prompt}
121
+ To execute: `/{command}`
122
+ ```
123
+
124
+ ## Completion Report
125
+
126
+ Output path to generated tasks.md and summary:
127
+ - Total task count
128
+ - Task count per user story
129
+ - Parallel opportunities identified
130
+ - Independent test criteria for each story
131
+ - Suggested MVP scope (typically just User Story 1)
132
+ - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
133
+
134
+ Context for task generation: $ARGUMENTS
135
+
136
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
137
+
138
+ ## Task Generation Rules
139
+
140
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
141
+
142
+ **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
143
+
144
+ ### Checklist Format (REQUIRED)
145
+
146
+ Every task MUST strictly follow this format:
147
+
148
+ ```text
149
+ - [ ] [TaskID] [P?] [Story?] Description with file path
150
+ ```
151
+
152
+ **Format Components**:
153
+
154
+ 1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
155
+ 2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
156
+ 3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
157
+ 4. **[Story] label**: REQUIRED for user story phase tasks only
158
+ - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
159
+ - Setup phase: NO story label
160
+ - Foundational phase: NO story label
161
+ - User Story phases: MUST have story label
162
+ - Polish phase: NO story label
163
+ 5. **Description**: Clear action with exact file path
164
+
165
+ **Examples**:
166
+
167
+ - ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`
168
+ - ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
169
+ - ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
170
+ - ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
171
+ - ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)
172
+ - ❌ WRONG: `T001 [US1] Create model` (missing checkbox)
173
+ - ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)
174
+ - ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)
175
+
176
+ ### Task Organization
177
+
178
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
179
+ - Each user story (P1, P2, P3...) gets its own phase
180
+ - Map all related components to their story:
181
+ - Models needed for that story
182
+ - Services needed for that story
183
+ - Interfaces/UI needed for that story
184
+ - If tests requested: Tests specific to that story
185
+ - Mark story dependencies (most stories should be independent)
186
+
187
+ 2. **From Contracts**:
188
+ - Map each interface contract → to the user story it serves
189
+ - If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
190
+
191
+ 3. **From Data Model**:
192
+ - Map each entity to the user story(ies) that need it
193
+ - If entity serves multiple stories: Put in earliest story or Setup phase
194
+ - Relationships → service layer tasks in appropriate story phase
195
+
196
+ 4. **From Setup/Infrastructure**:
197
+ - Shared infrastructure → Setup phase (Phase 1)
198
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
199
+ - Story-specific setup → within that story's phase
200
+
201
+ ### Phase Structure
202
+
203
+ - **Phase 1**: Setup (project initialization)
204
+ - **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
205
+ - **Phase 3+**: User Stories in priority order (P1, P2, P3...)
206
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
207
+ - Each phase should be a complete, independently testable increment
208
+ - **Final Phase**: Polish & Cross-Cutting Concerns
209
+
210
+ ## Done When
211
+
212
+ - [ ] tasks.md generated with all phases, task IDs, and file paths
213
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
214
+ - [ ] Completion reported to user with task count, story breakdown, and MVP scope
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: "duaer-taskstoissues"
3
+ description: "Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available 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 tasks-to-issues conversion)**:
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_taskstoissues` 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
+ 1. **IF EXISTS**: Load `.duaer/memory/constitution.md` for project principles and governance constraints.
59
+ 1. From the executed script, extract the path to **tasks**.
60
+ 1. Get the Git remote by running:
61
+
62
+ ```bash
63
+ git config --get remote.origin.url
64
+ ```
65
+
66
+ > [!CAUTION]
67
+ > ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
68
+
69
+ 1. **Fetch existing issues for deduplication**: Before creating anything, build the set of task IDs you are about to process from `tasks.md` (each is a `T` followed by **at least** three digits, e.g. `T001` — `/duaer-converge` assigns new IDs with `T{M+1:03d}`, which is a floor rather than a cap, so once a file has more than 999 tasks the IDs are four digits or longer). Then use the GitHub MCP server's `list_issues` tool to look for issues that already cover those IDs. Do not pass a `state` value, since omitting it makes the tool return both open and closed issues. Request `perPage: 100` to keep the number of calls down, and since the tool uses cursor-based pagination, request pages with the `after` parameter (using the `endCursor` from the previous response). For each issue title, match it against the task ID pattern `\bT\d{3,}\b` (the `{3,}` accepts four-digit and longer IDs — with `\d{3}` a title containing `T1000` would not match at all, because the trailing `\b` cannot fall between two digits, so that task would be silently neither deduplicated nor created; word boundaries still stop a token like `ST001` from matching, and force the whole digit run to be consumed so `T100` can never match inside `T1000`; this also recognises titles written as `T001 ...`, `T001: ...` or `[T001] ...`) and, when it matches one of your task IDs, mark that ID as already having an issue. Stop paginating as soon as every task ID has been matched, or when there are no more pages, so you do not keep fetching the whole repository's issue history once all task IDs are accounted for. This bounds the number of calls on repos with large issue histories and still prevents duplicates when the command is re-run after `tasks.md` is regenerated or the skill is re-invoked.
70
+ 1. For each task in the list, use the GitHub MCP server to create a new issue in the repository that is representative of the Git remote. Task lines in `tasks.md` start with a markdown checkbox, so first strip the leading `- [ ]` (and any `[P]` / `[US#]` markers) to recover the task ID and its description. Create the issue with a single canonical title of the form `T001: <description>`, with the ID written once followed by the task description (for example, the line `- [ ] T001 Create project structure` becomes the title `T001: Create project structure`).
71
+ - **Skip** any task whose ID is already present in the set of existing issues from the previous step, and report it (for example, `T001 already has an issue, skipping`).
72
+ - Only create issues for tasks that do not yet have a matching issue.
73
+
74
+ > [!CAUTION]
75
+ > UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
76
+
77
+ ## Post-Execution Checks
78
+
79
+ **Check for extension hooks (after tasks-to-issues conversion)**:
80
+ Check if `.duaer/extensions.yml` exists in the project root.
81
+ - If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
82
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
83
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
84
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
85
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
86
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
87
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
88
+ - For each executable hook, output the following based on its `optional` flag:
89
+ - **Optional hook** (`optional: true`):
90
+ ```
91
+ ## Extension Hooks
92
+
93
+ **Optional Hook**: {extension}
94
+ Command: `/{command}`
95
+ Description: {description}
96
+
97
+ Prompt: {prompt}
98
+ To execute: `/{command}`
99
+ ```
100
+ - **Mandatory hook** (`optional: false`):
101
+ ```
102
+ ## Extension Hooks
103
+
104
+ **Automatic Hook**: {extension}
105
+ Executing: `/{command}`
106
+ EXECUTE_COMMAND: {command}
107
+ ```
108
+ 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.
109
+ - If no hooks are registered or `.duaer/extensions.yml` does not exist, skip silently