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,50 @@
1
+ ---
2
+ description: duaer-spec agent ops (isolated branch/worktree, commits, push opt-in)
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Agent development workflow
7
+
8
+ Part of **duaer-spec**. Authoritative over Duaer when they conflict. This
9
+ repository integrates on `main`. Adopting projects may document another
10
+ integration branch in their baseline.
11
+
12
+ ## Language
13
+
14
+ Use English for code, identifiers, comments, commits, specs, and docs unless
15
+ the project explicitly overrides.
16
+
17
+ ## Isolated development
18
+
19
+ Before editing files for a new request:
20
+
21
+ 1. Update local integration branch (`main` here; or project override)
22
+ 2. Create a unique branch: `<type>/<short-description>`
23
+ 3. Create a dedicated worktree and develop only there
24
+ 4. Never develop in the primary checkout or on the long-lived branch
25
+ 5. Never reuse or modify another agent's branch/worktree
26
+
27
+ ## Immutable habits
28
+
29
+ - Spec-sync: behavior changes update the relevant project specs/docs (and ADR when architecture/security/contracts change)
30
+ - One logical change per commit; leave the worktree clean
31
+ - User/protocol-visible changes update the project's E2E scenario docs
32
+ - Merge the request branch back into the local integration branch when done
33
+ - Remove the request worktree and delete the merged branch after merge
34
+ - Push only when the user explicitly asks for this request
35
+
36
+ ## GitHub issue intake
37
+
38
+ If the user links an issue for this repo: verify the claim first; do not implement until it exists. Comment in the issue's language; close when conclusive. An issue link does not authorize push.
39
+
40
+ ## GitHub PR intake
41
+
42
+ If the user links a PR: judge the principle first. If sound, merge that PR (preserve commits); completeness gaps are follow-up after merge. Do not silently reimplement. A PR link does not authorize unrelated pushes or force-push of the contributor branch.
43
+
44
+ ## Commits
45
+
46
+ ```text
47
+ type(scope): description
48
+ ```
49
+
50
+ Types: `feat fix docs test chore refactor perf build ci` — English, imperative, one logical change.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: Keep AI-generated page copy minimal (duaer-spec agent ops)
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # AI-generated page content
7
+
8
+ AI-generated pages must not contain redundant explanatory text.
9
+
10
+ - No filler introductions, repeated summaries, or prose that only explains an obvious control
11
+ - Prefer concise labels, headings, helper text, and empty states
12
+ - Put rationale and implementation detail in docs or code comments, not in the UI, unless the user asks for explanatory content
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Features and hotfixes must go through Duaer; no code from verbal asks alone
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Duaer required (NON-NEGOTIABLE)
7
+
8
+ See repo `DUADER.md` and `.duaer/memory/constitution.md`.
9
+
10
+ If this rule conflicts with root `AGENTS.md` / `docs/agent/` (worktrees, commits,
11
+ Issue/PR), **AGENTS.md wins**.
12
+
13
+ ## When Duaer is mandatory
14
+
15
+ Always write/update a feature spec before coding for:
16
+
17
+ - New features / user-visible behavior
18
+ - Architecture or contract changes
19
+ - Hotfixes / regressions (still Spec; shorter path allowed)
20
+
21
+ Forbidden: jump from chat to code with no `spec.md` / feature directory under `.duaer/specs/`.
22
+
23
+ ## Default flow
24
+
25
+ `/duaer-specify` → `/duaer-plan` → `/duaer-tasks` → `/duaer-implement` → `/duaer-converge`
26
+
27
+ ## Hotfix (still Spec, shortened)
28
+
29
+ `/duaer-specify` (mark hotfix: symptom / root cause / acceptance) → `/duaer-tasks` → `/duaer-implement` → `/duaer-converge`
30
+
31
+ - Implement only from `tasks.md` when it exists
32
+ - Update `.duaer/memory/project-context.md` when architecture changes
33
+ - Run the verification named in the feature docs before merge
@@ -0,0 +1,259 @@
1
+ ---
2
+ name: "duaer-analyze"
3
+ description: "Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation."
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 analysis)**:
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_analyze` 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 Goal.
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
+ ## Goal
56
+
57
+ Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/duaer-tasks` has successfully produced a complete `tasks.md`.
58
+
59
+ ## Operating Constraints
60
+
61
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
62
+
63
+ **Constitution Authority**: The project constitution (`.duaer/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/duaer-analyze`.
64
+
65
+ ## Execution Steps
66
+
67
+ ### 1. Initialize Analysis Context
68
+
69
+ Run `.duaer/scripts/bash/check-prerequisites.sh --json --require-spec --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
70
+
71
+ - SPEC = FEATURE_DIR/spec.md
72
+ - PLAN = FEATURE_DIR/plan.md
73
+ - TASKS = FEATURE_DIR/tasks.md
74
+
75
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
76
+ 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").
77
+
78
+ ### 2. Load Artifacts (Progressive Disclosure)
79
+
80
+ Load only the minimal necessary context from each artifact:
81
+
82
+ **From spec.md:**
83
+
84
+ - Overview/Context
85
+ - Functional Requirements
86
+ - Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)
87
+ - User Stories
88
+ - Edge Cases (if present)
89
+
90
+ **From plan.md:**
91
+
92
+ - Architecture/stack choices
93
+ - Data Model references
94
+ - Phases
95
+ - Technical constraints
96
+
97
+ **From tasks.md:**
98
+
99
+ - Task IDs
100
+ - Descriptions
101
+ - Phase grouping
102
+ - Parallel markers [P]
103
+ - Referenced file paths
104
+
105
+ **From constitution:**
106
+
107
+ - Load `.duaer/memory/constitution.md` for principle validation
108
+
109
+ ### 3. Build Semantic Models
110
+
111
+ Create internal representations (do not include raw artifacts in output):
112
+
113
+ - **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-/SC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., "User can upload file" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., "Reduce support tickets by 50%").
114
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
115
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
116
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
117
+
118
+ ### 4. Detection Passes (Token-Efficient Analysis)
119
+
120
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
121
+
122
+ #### A. Duplication Detection
123
+
124
+ - Identify near-duplicate requirements
125
+ - Mark lower-quality phrasing for consolidation
126
+
127
+ #### B. Ambiguity Detection
128
+
129
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
130
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
131
+
132
+ #### C. Underspecification
133
+
134
+ - Requirements with verbs but missing object or measurable outcome
135
+ - User stories missing acceptance criteria alignment
136
+ - Tasks referencing files or components not defined in spec/plan
137
+
138
+ #### D. Constitution Alignment
139
+
140
+ - Any requirement or plan element conflicting with a MUST principle
141
+ - Missing mandated sections or quality gates from constitution
142
+
143
+ #### E. Coverage Gaps
144
+
145
+ - Requirements with zero associated tasks
146
+ - Tasks with no mapped requirement/story
147
+ - Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks
148
+
149
+ #### F. Inconsistency
150
+
151
+ - Terminology drift (same concept named differently across files)
152
+ - Data entities referenced in plan but absent in spec (or vice versa)
153
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
154
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
155
+
156
+ ### 5. Severity Assignment
157
+
158
+ Use this heuristic to prioritize findings:
159
+
160
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
161
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
162
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
163
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
164
+
165
+ ### 6. Produce Compact Analysis Report
166
+
167
+ Output a Markdown report (no file writes) with the following structure:
168
+
169
+ ## Specification Analysis Report
170
+
171
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
172
+ |----|----------|----------|-------------|---------|----------------|
173
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
174
+
175
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
176
+
177
+ **Coverage Summary Table:**
178
+
179
+ | Requirement Key | Has Task? | Task IDs | Notes |
180
+ |-----------------|-----------|----------|-------|
181
+
182
+ **Constitution Alignment Issues:** (if any)
183
+
184
+ **Unmapped Tasks:** (if any)
185
+
186
+ **Metrics:**
187
+
188
+ - Total Requirements
189
+ - Total Tasks
190
+ - Coverage % (requirements with >=1 task)
191
+ - Ambiguity Count
192
+ - Duplication Count
193
+ - Critical Issues Count
194
+
195
+ ### 7. Provide Next Actions
196
+
197
+ At end of report, output a concise Next Actions block:
198
+
199
+ - If CRITICAL issues exist: Recommend resolving before `/duaer-implement`
200
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
201
+ - Provide explicit command suggestions: e.g., "Run /duaer-specify with refinement", "Run /duaer-plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
202
+
203
+ ### 8. Offer Remediation
204
+
205
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
206
+
207
+ ### 9. Check for extension hooks
208
+
209
+ After reporting, check if `.duaer/extensions.yml` exists in the project root.
210
+ - If it exists, read it and look for entries under the `hooks.after_analyze` key
211
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
212
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
213
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
214
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
215
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
216
+ - When constructing command invocations from hook command names, replace dots (`.`) with hyphens (`-`). For example, `duaer.git.commit` → `/duaer-git-commit`.
217
+ - For each executable hook, output the following based on its `optional` flag:
218
+ - **Optional hook** (`optional: true`):
219
+ ```
220
+ ## Extension Hooks
221
+
222
+ **Optional Hook**: {extension}
223
+ Command: `/{command}`
224
+ Description: {description}
225
+
226
+ Prompt: {prompt}
227
+ To execute: `/{command}`
228
+ ```
229
+ - **Mandatory hook** (`optional: false`):
230
+ ```
231
+ ## Extension Hooks
232
+
233
+ **Automatic Hook**: {extension}
234
+ Executing: `/{command}`
235
+ EXECUTE_COMMAND: {command}
236
+ ```
237
+ 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.
238
+ - If no hooks are registered or `.duaer/extensions.yml` does not exist, skip silently
239
+
240
+ ## Operating Principles
241
+
242
+ ### Context Efficiency
243
+
244
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
245
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
246
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
247
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
248
+
249
+ ### Analysis Guidelines
250
+
251
+ - **NEVER modify files** (this is read-only analysis)
252
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
253
+ - **Prioritize constitution violations** (these are always CRITICAL)
254
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
255
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
256
+
257
+ ## Context
258
+
259
+ $ARGUMENTS