@tudeorangbiasa/sdd-multiagent-opencode 0.1.4 → 0.2.1

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 (56) hide show
  1. package/.opencode/agents/sdd-explorer.md +1 -2
  2. package/.opencode/agents/sdd-implementer.md +4 -5
  3. package/.opencode/agents/sdd-orchestrator.md +17 -127
  4. package/.opencode/agents/sdd-planner.md +5 -6
  5. package/.opencode/agents/sdd-reviewer.md +0 -1
  6. package/.opencode/agents/sdd-verifier.md +3 -4
  7. package/.opencode/commands/sdd-apply.md +83 -0
  8. package/.opencode/commands/sdd-explore.md +63 -0
  9. package/.opencode/commands/sdd-propose.md +116 -0
  10. package/.opencode/commands/sdd-ship.md +71 -0
  11. package/.opencode/plugins/sdd-register.js +22 -0
  12. package/.opencode/skills/sdd-audit/SKILL.md +5 -5
  13. package/.opencode/skills/sdd-implementation/SKILL.md +10 -12
  14. package/.opencode/skills/sdd-planning/SKILL.md +20 -29
  15. package/.opencode/skills/sdd-research/SKILL.md +5 -5
  16. package/.sdd/config.json +10 -10
  17. package/.sdd/templates/design-template.md +21 -0
  18. package/.sdd/templates/model-profile-template.json +20 -3
  19. package/.sdd/templates/progress-template.md +23 -0
  20. package/.sdd/templates/project-profile-template.json +2 -2
  21. package/.sdd/templates/proposal-template.md +22 -0
  22. package/.sdd/templates/reasoning-profile-template.json +4 -8
  23. package/.sdd/templates/spec-template.md +19 -0
  24. package/.sdd/templates/tasks-template.md +8 -0
  25. package/.sdd/templates/verification-template.md +17 -0
  26. package/GUIDE.md +128 -0
  27. package/README.md +259 -155
  28. package/bin/sdd-opencode.js +7 -9
  29. package/opencode.json +6 -14
  30. package/package.json +6 -4
  31. package/.opencode/commands/audit.md +0 -75
  32. package/.opencode/commands/brief.md +0 -190
  33. package/.opencode/commands/evolve.md +0 -87
  34. package/.opencode/commands/execute-parallel.md +0 -116
  35. package/.opencode/commands/execute-task.md +0 -81
  36. package/.opencode/commands/generate-prd.md +0 -82
  37. package/.opencode/commands/generate-rules.md +0 -67
  38. package/.opencode/commands/grill-me.md +0 -99
  39. package/.opencode/commands/implement.md +0 -149
  40. package/.opencode/commands/init-sdd.md +0 -141
  41. package/.opencode/commands/plan.md +0 -96
  42. package/.opencode/commands/refine.md +0 -115
  43. package/.opencode/commands/research.md +0 -194
  44. package/.opencode/commands/sdd-full-plan.md +0 -91
  45. package/.opencode/commands/specify.md +0 -124
  46. package/.opencode/commands/tasks.md +0 -110
  47. package/.opencode/commands/upgrade.md +0 -107
  48. package/.opencode/skills/sdd-evolve/SKILL.md +0 -95
  49. package/.sdd/templates/feature-brief-v2.md +0 -65
  50. package/.sdd/templates/plan-compact.md +0 -50
  51. package/.sdd/templates/research-compact.md +0 -114
  52. package/.sdd/templates/roadmap-template.json +0 -29
  53. package/.sdd/templates/roadmap-template.md +0 -66
  54. package/.sdd/templates/spec-compact.md +0 -71
  55. package/.sdd/templates/tasks-compact.md +0 -48
  56. package/.sdd/templates/todo-compact.md +0 -30
@@ -1,75 +0,0 @@
1
- ---
2
- description: Perform a spec-driven technical audit, comparing implementation against specifications
3
- agent: sdd-reviewer
4
- ---
5
-
6
- **You are a senior code reviewer and auditor.** Your job is to read specifications, inspect source code, compare implementation against requirements, identify gaps, bugs, and violations, and generate structured review comments with severity levels.
7
-
8
- **Skill:** Uses `sdd-audit` skill for structured compliance checks.
9
-
10
- ---
11
-
12
- ## Usage
13
-
14
- ```
15
- /audit $1 $ARGUMENTS
16
- ```
17
-
18
- **Examples:**
19
- ```
20
- /audit user-auth
21
- /audit checkout-flow Payment processing failing
22
- /audit notification-system Notifications not sending on mobile
23
- ```
24
-
25
- ---
26
-
27
- ## Instructions
28
-
29
- ### Phase 1: Load Specifications
30
-
31
- Read in order:
32
- 1. `specs/active/$1/spec.md` - Requirements
33
- 2. `specs/active/$1/plan.md` - Technical plan
34
- 3. `specs/active/$1/tasks.md` - Task breakdown
35
- 4. `specs/active/$1/todo-list.md` - Implementation checklist
36
-
37
- **If no specs found:** Offer general code review or suggest creating specs with `/brief $1`
38
-
39
- ### Phase 2: Analyze Implementation
40
-
41
- 1. Identify completed tasks from `tasks.md`/`todo-list.md`
42
- 2. Read actual implementation files using `codebase-memory-mcp`
43
- 3. Compare code against spec/plan requirements
44
- 4. Look for gaps: missing features, logic errors, security issues, quality problems
45
-
46
- ### Phase 3: Generate Findings
47
-
48
- **Severity Levels:**
49
- - 🔴 **CRITICAL**: Broken, security risk, blocker
50
- - 🟠 **MAJOR**: Logic error, missing feature
51
- - 🟡 **MINOR**: Style, optimization, cleanup
52
- - ⚪ **OUTDATED**: Code correct, spec wrong
53
-
54
- ### Phase 4: Generate Report
55
-
56
- Generate a structured audit report with: Executive Summary, Quick Stats, Review Comments table, Detailed Findings, and Recommended Actions.
57
-
58
- ---
59
-
60
- ## Output
61
-
62
- Present the audit report, then end with:
63
-
64
- ```
65
- 📋 **Audit Report Ready**
66
-
67
- **Summary:**
68
- - 🔴 Critical: [N]
69
- - 🟠 Major: [N]
70
- - 🟡 Minor: [N]
71
- - ⚪ Outdated: [N]
72
-
73
- **To fix:** "Fix #1" or "Fix all critical"
74
- **To update spec:** "Mark #N as outdated"
75
- ```
@@ -1,190 +0,0 @@
1
- ---
2
- description: Create a lightweight feature brief in ~30 minutes, then start coding
3
- agent: sdd-planner
4
- ---
5
-
6
- Create a focused feature brief through analysis and strategic questioning.
7
-
8
- **Skill:** Uses `sdd-planning` skill. Delegates to `sdd-explorer` (fast, readonly) for codebase pattern discovery.
9
-
10
- **Output:** `specs/active/$1/feature-brief.md`
11
-
12
- ---
13
-
14
- ## Usage
15
-
16
- ```
17
- /brief $1 $ARGUMENTS
18
- ```
19
-
20
- **Examples:**
21
- ```
22
- /brief user-auth JWT authentication with login/logout
23
- /brief checkout-flow Streamlined one-page checkout with guest option
24
- /brief notification-system Real-time push notifications for mobile
25
- ```
26
-
27
- ---
28
-
29
- ## Instructions
30
-
31
- ### Phase 1: Analysis (Readonly)
32
-
33
- **Step 1: Parse the request**
34
- - Extract task-id: `$1`
35
- - Extract feature description: `$ARGUMENTS`
36
- - Identify key requirements and intent
37
-
38
- **Step 2: Check existing patterns**
39
- - Use `codebase-memory-mcp` `search_graph` to find similar features
40
- - Look in `specs/active/` for related briefs
41
- - Note reusable patterns and conventions
42
-
43
- **Step 3: Assess information completeness**
44
-
45
- Ask clarifying questions if ANY of these are unclear:
46
- - What problem does this solve?
47
- - Who are the primary users?
48
- - What are the must-have vs nice-to-have features?
49
- - Are there technical constraints or preferences?
50
- - What does success look like?
51
-
52
- **Step 4: Evaluate complexity**
53
-
54
- | Indicator | Stay with Brief | Upgrade to Full SDD |
55
- |-----------|-----------------|---------------------|
56
- | Timeline | < 3 weeks | > 3 weeks |
57
- | Team size | 1-2 developers | Multiple teams |
58
- | Risk level | Low-medium | High (payments, security) |
59
- | Architecture | Existing patterns | New patterns needed |
60
- | Dependencies | Few/none | Multiple external |
61
-
62
- If complexity suggests Full SDD, mention:
63
- > "This looks like it might benefit from full SDD planning. Would you like me to create a brief for now, or should we use `/research` → `/specify` → `/plan` for more thorough planning?"
64
-
65
- ### Phase 2: Planning (Create Plan)
66
-
67
- **Present a plan before creating any files:**
68
-
69
- ```
70
- ## Brief Creation Plan
71
-
72
- **Task ID:** $1
73
- **Feature:** [feature name]
74
-
75
- **What I'll create:**
76
- - File: `specs/active/$1/feature-brief.md`
77
- - Structure: Problem → Users → Requirements → Approach → Next Actions
78
-
79
- **Research scope (15 min):**
80
- - [What I'll search for in codebase]
81
- - [Patterns I'll look for]
82
-
83
- **Brief will include:**
84
- - Problem statement and target users
85
- - Core requirements (must-haves only)
86
- - Quick technical approach
87
- - 3-5 immediate next actions
88
- - Success criteria
89
-
90
- **Estimated time:** 30 minutes total
91
-
92
- Ready to proceed?
93
- ```
94
-
95
- **Wait for user approval before proceeding.**
96
-
97
- ### Phase 3: Execution (After Approval)
98
-
99
- **Step 1: Create directory**
100
- ```
101
- specs/active/$1/
102
- ```
103
-
104
- **Step 2: Conduct quick research (15 min)**
105
- - Search for similar patterns in codebase using `codebase-memory-mcp`
106
- - Document key findings
107
- - Note reusable components
108
-
109
- **Step 3: Generate feature-brief.md**
110
-
111
- Use this structure:
112
-
113
- ```markdown
114
- # Feature Brief: [Feature Name]
115
-
116
- **Task ID:** $1
117
- **Created:** [date]
118
- **Status:** Ready for Development
119
-
120
- ---
121
-
122
- ## Problem Statement
123
-
124
- [What problem does this solve? 2-3 sentences]
125
-
126
- ## Target Users
127
-
128
- [Who will use this? Be specific]
129
-
130
- ## Core Requirements
131
-
132
- ### Must Have
133
- - [ ] [Requirement 1]
134
- - [ ] [Requirement 2]
135
- - [ ] [Requirement 3]
136
-
137
- ### Nice to Have
138
- - [ ] [Optional 1]
139
- - [ ] [Optional 2]
140
-
141
- ## Technical Approach
142
-
143
- [High-level approach, 3-5 sentences]
144
-
145
- **Patterns to Follow:**
146
- - [Existing pattern 1 from codebase]
147
- - [Existing pattern 2 from codebase]
148
-
149
- **Key Decisions:**
150
- - [Decision 1]: [Rationale]
151
- - [Decision 2]: [Rationale]
152
-
153
- ## Next Actions
154
-
155
- 1. [ ] [First concrete step]
156
- 2. [ ] [Second step]
157
- 3. [ ] [Third step]
158
-
159
- ## Success Criteria
160
-
161
- - [ ] [How we know it's done 1]
162
- - [ ] [How we know it's done 2]
163
-
164
- ## Open Questions
165
-
166
- - [Any unresolved questions]
167
-
168
- ---
169
-
170
- *Brief created with SDD Multi-Agent OpenCode*
171
- ```
172
-
173
- ### Phase 4: Verification
174
-
175
- Verify file created and contains: problem statement, 3+ requirements, actionable next steps.
176
-
177
- ---
178
-
179
- ## Output
180
-
181
- ```
182
- ✅ Brief created: `specs/active/$1/feature-brief.md`
183
-
184
- **Summary:**
185
- - Problem: [One sentence]
186
- - Core requirements: [Count] must-haves
187
- - Next actions: [Count] items
188
-
189
- **Next:** Start coding or run `/upgrade $1` for full SDD planning
190
- ```
@@ -1,87 +0,0 @@
1
- ---
2
- description: Update existing specifications with new discoveries, changes, or refinements made during development
3
- agent: sdd-planner
4
- ---
5
-
6
- **Documentation evolution agent:** Update existing specs with new discoveries and changes while preserving context and maintaining changelog entries.
7
-
8
- **Skill:** Uses `sdd-evolve` skill for structured spec updates.
9
-
10
- **Output:** Updated spec files in `specs/active/$1/`
11
-
12
- ---
13
-
14
- ## Usage
15
-
16
- ```
17
- /evolve $1 $ARGUMENTS
18
- ```
19
-
20
- **Examples:**
21
- - `/evolve user-auth Added password strength validation after security review`
22
- - `/evolve checkout-flow Discovered need for guest checkout fallback`
23
- - `/evolve notification-system Changed from polling to WebSocket based on performance testing`
24
-
25
- ---
26
-
27
- ## Instructions
28
-
29
- ### Phase 1: Analysis
30
-
31
- 1. **Find existing specs** in `specs/active/$1/` (check feature-brief.md, spec.md, plan.md, tasks.md)
32
- 2. **Read all related files** to understand current state and context
33
- 3. **Categorize the change**: Discovery/Refinement (Low), Addition/Modification (Medium), Removal/Architecture (High)
34
- 4. **Assess upgrade need**: Multiple major changes → suggest `/upgrade`, simple discovery → continue with `/evolve`
35
-
36
- ### Phase 2: Planning
37
-
38
- Present evolution plan with:
39
- - Task ID and file to update
40
- - Change summary, type, and impact level
41
- - Before/after diff of relevant sections
42
- - Proposed changelog entry
43
- - Recommendation (proceed or suggest upgrade)
44
-
45
- **Wait for user approval before proceeding.**
46
-
47
- ### Phase 3: Execution
48
-
49
- 1. **Update spec file** preserving context, adding changelog, incrementing version, updating date
50
- 2. **Add changelog entry** (feature-brief.md uses "Changelog" table, spec.md uses "Revision History" table)
51
- 3. **Note cross-references** if change affects other documents
52
- 4. **Update status** if spec was marked "Complete"
53
-
54
- ### Phase 4: Downstream Propagation
55
-
56
- Check for stale downstream documents:
57
- 1. **List downstream files** in `specs/active/$1/` — check for `plan.md`, `tasks.md`, `todo-list.md`
58
- 2. **Assess impact** using the change category
59
- 3. **Add staleness marker** to affected files:
60
- ```
61
- > **[STALE]** — Upstream spec updated on [DATE]. Review needed.
62
- > Change: [Brief description] (spec.md v[VERSION])
63
- ```
64
- 4. **Report affected files** in the evolution summary output
65
-
66
- ### Phase 5: Verification
67
-
68
- Verify before final output:
69
- - Spec file updated, changelog added, version incremented
70
- - Context preserved, cross-references noted
71
- - Staleness markers added to affected downstream files
72
-
73
- ---
74
-
75
- ## Output
76
-
77
- End response with:
78
-
79
- ```
80
- ✅ Spec evolved: `specs/active/$1/[file]`
81
-
82
- **Change:** [Type] | Impact: [Level] | Version: [old] → [new]
83
- **Changelog:** | [version] | [date] | [description] | [reason] |
84
- **Downstream impact:** [List of files marked STALE, or "None"]
85
- **Cross-references:** [Other files that may need updates]
86
- **Next steps:** Review spec, update stale downstream docs, or consider `/upgrade` for major changes
87
- ```
@@ -1,116 +0,0 @@
1
- ---
2
- description: Execute multiple tasks in parallel using async background subagents for DAG-based coordination
3
- agent: sdd-orchestrator
4
- ---
5
-
6
- Execute multiple tasks in parallel using async background subagents for coordination.
7
-
8
- **Leverages:** Async subagents, subagent tree pattern, DAG-based execution with dependency checks and file conflict detection.
9
-
10
- ---
11
-
12
- ## Usage
13
-
14
- ```
15
- /execute-parallel $1
16
- /execute-parallel $1 --epic $2
17
- /execute-parallel $1 --until-finish
18
- /execute-parallel $1 --resume
19
- ```
20
-
21
- **Examples:**
22
- ```
23
- /execute-parallel blog-platform
24
- /execute-parallel saas-dashboard --epic epic-002
25
- /execute-parallel my-project --until-finish
26
- /execute-parallel my-project --resume
27
- ```
28
-
29
- ---
30
-
31
- ## Instructions
32
-
33
- ### Phase 0: Check Context Budget (Before Loading Roadmap)
34
-
35
- 1. Read `.opencode/rules/context-budget.md` if present
36
- 2. If context is near 80%, use **progressive loading**:
37
- - Load only `dag.roots`, `dag.parallelGroups`, `statistics`
38
- - Load full task details only for the current batch
39
- - Re-read from disk after each batch completes
40
- 3. After each batch, write `execution-checkpoint.json` (compact format)
41
- 4. If context grows too large: stop and ask user to compact or continue with reduced context
42
-
43
- ### Phase 1: Load and Analyze Roadmap
44
-
45
- **Step 0: Resume mode (if `--resume` flag)**
46
- 1. Read `specs/todo-roadmap/$1/execution-checkpoint.json` if it exists
47
- 2. Use `nextReadyTasks` as the starting point; skip tasks already `done` in roadmap.json
48
-
49
- **Step 1: Read roadmap (progressive loading for large roadmaps)**
50
- - For heavy roadmaps (20+ tasks), load only `dag.roots`, `dag.parallelGroups`, `statistics`, and task details for ready tasks
51
-
52
- **Step 2: Identify ready tasks**
53
- Tasks are ready when: Status is "todo", all dependencies have status "done", `canParallelize: true`
54
-
55
- **Step 3: Plan execution batches**
56
- Group tasks based on: Dependency satisfaction, **File conflict detection** (check `sdd.touchedFiles` — overlapping files = separate batches), Estimated effort
57
-
58
- **Step 4: Parallelism limits**
59
- - Max parallel implementers: 3–5 (default: 4). Read from `.sdd/config.json` `settings.maxParallelImplementers`
60
-
61
- ### Phase 2: Parallel Execution with Async Subagents
62
-
63
- **For each parallel batch, spawn background subagents simultaneously using multiple Task tool calls in a single message.**
64
-
65
- **Task-to-Subagent Mapping:**
66
-
67
- | Task Phase | Subagent | Model |
68
- |------------|----------|-------|
69
- | research | sdd-explorer | opencode/deepseek-v4-flash-free |
70
- | brief/specify/plan/tasks | sdd-planner | opencode/qwen3.6-plus-free |
71
- | implement | sdd-implementer | opencode/deepseek-v4-flash-free |
72
- | review | sdd-reviewer | opencode/minimax-m2.5-free |
73
- | verify | sdd-verifier | opencode/qwen3.6-plus-free |
74
-
75
- **Subagent Tree Pattern:**
76
- Each background `sdd-implementer` automatically spawns `sdd-verifier` as a child subagent after completing its work.
77
-
78
- ### Phase 3: Progress Tracking
79
-
80
- **After each batch completes:**
81
- 1. Collect results from subagent responses
82
- 2. Update roadmap.json statuses: `todo` → `in-progress` → `review` → `done`
83
- 3. Write execution-checkpoint.json
84
- 4. Identify next ready tasks based on completed dependencies
85
-
86
- ### Phase 4: Completion
87
-
88
- **When all tasks done:**
89
- 1. Final roadmap.json update
90
- 2. Generate completion report with execution timeline and verification summary
91
-
92
- ---
93
-
94
- ## Flags
95
-
96
- | Flag | Description |
97
- |------|-------------|
98
- | `--epic [id]` | Scope to one epic |
99
- | `--until-finish` | Loop until done |
100
- | `--resume` | Resume after error |
101
- | `--dry-run` | Preview only |
102
-
103
- ---
104
-
105
- ## Error Handling
106
-
107
- **If subagent fails:**
108
- 1. Task marked as `blocked` in roadmap
109
- 2. Error details captured
110
- 3. Dependent tasks remain blocked
111
- 4. Continue with independent tasks
112
-
113
- **Recovery:**
114
- ```
115
- /execute-parallel $1 --resume
116
- ```
@@ -1,81 +0,0 @@
1
- ---
2
- description: Execute a specific task from a project roadmap, automatically determining the appropriate SDD command and updating roadmap status
3
- agent: sdd-orchestrator
4
- ---
5
-
6
- Execute tasks from project roadmaps by running appropriate SDD commands and tracking progress.
7
-
8
- **Supports `--until-finish` flag** for automated sequential execution of all tasks in an epic.
9
-
10
- ---
11
-
12
- ## Usage
13
-
14
- ```
15
- /execute-task $1
16
- /execute-task $1 --until-finish
17
- ```
18
-
19
- **Examples:**
20
- ```
21
- /execute-task task-001-1
22
- /execute-task epic-001
23
- /execute-task epic-001 --until-finish
24
- ```
25
-
26
- ---
27
-
28
- ## Instructions
29
-
30
- ### Phase 1: Analysis
31
-
32
- 1. **Find roadmap:** Look in `specs/todo-roadmap/*/roadmap.json`
33
- 2. **Find task:** Locate task by ID in roadmap
34
- 3. **Validate dependencies:** Ensure all dependencies have status "done"
35
- 4. **Determine SDD command:** Map task phase to command:
36
- - `research` → `/research`
37
- - `brief` → `/brief`
38
- - `specification` → `/specify`
39
- - `planning` → `/plan`
40
- - `tasks` → `/tasks`
41
- - `implementation` → `/implement`
42
- - `evolution` → `/evolve`
43
-
44
- ### Phase 2: Planning
45
-
46
- Present execution plan and wait for approval (unless `--until-finish`).
47
-
48
- ### Phase 3: Execution
49
-
50
- 1. **Update status:** Set task status to "in-progress" in roadmap.json
51
- 2. **Execute command:** Run the appropriate SDD command
52
- 3. **Link spec:** Update task with linked spec path
53
- 4. **Update status:** Change to "review" (or "done" with `--until-finish`)
54
- 5. **Log execution:** Add entry to execution-log.md
55
- 6. **Check unblocked:** Identify tasks that can now proceed
56
-
57
- ---
58
-
59
- ## Output
60
-
61
- ```
62
- ✅ Task executed: $1
63
-
64
- **Summary:**
65
- - Command: `/[command] $1`
66
- - Output: `specs/active/$1/[file]`
67
- - Status: review
68
- - Unblocked: [count] tasks ready
69
-
70
- **Next:** Review output or continue with `/execute-task [next-task]`
71
- ```
72
-
73
- ---
74
-
75
- ## Sequential vs Parallel
76
-
77
- | Command | Execution | Best For |
78
- |---------|-----------|----------|
79
- | `/execute-task --until-finish` | **Sequential** (one at a time) | Simple projects, debugging, careful review |
80
- | `/execute-parallel` | **Parallel** (batched via subagents) | Large projects, independent tasks |
81
- | `/sdd-full-plan --until-finish` | **Parallel** (creates roadmap + orchestrator) | Full project from scratch |
@@ -1,82 +0,0 @@
1
- ---
2
- description: Generate a Product Requirements Document through guided Socratic questioning, creating both comprehensive and AI-optimized versions
3
- ---
4
-
5
- **Product requirements analyst** - Guide users through strategic questions to create comprehensive, well-structured PRDs. Ask questions one at a time, probe vague answers, generate both full and quick PRD versions, and validate PRD quality.
6
-
7
- ---
8
-
9
- ## Usage
10
-
11
- ```
12
- /generate-prd $1 $ARGUMENTS
13
- ```
14
-
15
- **Examples:**
16
- ```
17
- /generate-prd saas-dashboard
18
- /generate-prd ecommerce-app Multi-vendor marketplace
19
- /generate-prd mobile-banking
20
- ```
21
-
22
- ---
23
-
24
- ## Instructions
25
-
26
- ### Phase 1: Introduction
27
-
28
- **Start the PRD session:**
29
-
30
- ```
31
- ## PRD Generation Session
32
-
33
- I'll help you create a solid Product Requirements Document through a few key questions. By the end, you'll have clear documentation of what to build and why.
34
-
35
- **Project:** $1
36
-
37
- Let's begin with the first question...
38
- ```
39
-
40
- ### Phase 2: Strategic Questioning
41
-
42
- Ask 5 questions one at a time:
43
-
44
- 1. **Problem & Goal** - What are we building and why? (Must have both problem AND goal)
45
- 2. **Core Features** - List 3-5 must-have features (Need at least 2 concrete features)
46
- 3. **Tech Stack** - Technical requirements, integrations, constraints (Optional)
47
- 4. **Out of Scope** - What's explicitly NOT in v1? (Need at least 1 exclusion)
48
- 5. **Additional Context** - Compliance, accessibility, deadlines, etc. (Optional)
49
-
50
- **Validation:** Probe vague answers, suggest options when stuck, enforce minimum requirements before proceeding.
51
-
52
- ### Phase 3: PRD Generation
53
-
54
- **Verify minimum requirements:** Q1 (problem + goal), Q2 (2+ features), Q4 (1+ exclusion). Ask follow-ups if missing.
55
-
56
- **Generate two documents:**
57
-
58
- 1. **full-prd.md** - Comprehensive PRD with: Executive Summary, Problem Statement, Target Users, Functional/Non-Functional Requirements, Technical Constraints, Out of Scope, Success Metrics, Timeline, Open Questions, Appendix
59
-
60
- 2. **quick-prd.md** - AI-optimized summary with: Problem, Core Features, Technical Approach, Out of Scope, Success Metrics
61
-
62
- ### Phase 4: Quality Validation
63
-
64
- Assess clarity, completeness, and actionability (0-100% each). Overall status: Ready for Planning or Needs Refinement.
65
-
66
- ---
67
-
68
- ## Output
69
-
70
- ```
71
- ✅ PRD generated successfully!
72
-
73
- **Files created:**
74
- - `specs/active/$1/full-prd.md` - Comprehensive PRD
75
- - `specs/active/$1/quick-prd.md` - AI-optimized summary
76
-
77
- **Quality:** Clarity [X]%, Completeness [X]%, Actionability [X]%, Overall [X]%
78
-
79
- **Summary:** Problem [one sentence], [N] core features, [N] exclusions
80
-
81
- **Next steps:** Review PRD, refine with `/refine $1`, create tasks with `/tasks $1`, or start brief with `/brief $1`
82
- ```
@@ -1,67 +0,0 @@
1
- ---
2
- description: Automatically generate comprehensive coding rules based on technology stack detection and codebase analysis
3
- ---
4
-
5
- **Coding standards architect** - Analyze project, detect technology stack, analyze codebase patterns, and generate comprehensive rule files including language-specific, framework-specific, and project-specific rules with 10X dev principles (DRY, KISS, SOLID).
6
-
7
- ---
8
-
9
- ## Usage
10
-
11
- ```
12
- /generate-rules
13
- /generate-rules --language $1 --framework $2
14
- /generate-rules --analyze-codebase
15
- /generate-rules --update-existing
16
- ```
17
-
18
- ---
19
-
20
- ## Instructions
21
-
22
- ### Phase 1: Analysis
23
-
24
- **Technology Detection:** Check package files (package.json, requirements.txt, Cargo.toml, go.mod, etc.)
25
-
26
- **Framework Detection:** Analyze dependencies (React, Vue, Next.js, Django, Flask, etc.)
27
-
28
- **Codebase Analysis:** Use `codebase-memory-mcp` to review code organization, naming conventions, import patterns, error handling, testing patterns
29
-
30
- **Existing Rules:** Check `.opencode/rules/` for files to merge or replace
31
-
32
- ### Phase 2: Planning
33
-
34
- **Present detection results:** Detected stack, codebase analysis, and proposed rule files.
35
-
36
- **Options:** Generate all new rules, generate only missing, or customize selection. Wait for user approval.
37
-
38
- ### Phase 3: Execution
39
-
40
- **Generate rule files in order:**
41
-
42
- 1. **coding-principles.md** (always include) - DRY, KISS, SOLID, code quality, performance mindset
43
- 2. **Language-specific rules** (e.g., typescript-rules.md) - Type safety, naming conventions, best practices
44
- 3. **Framework-specific rules** (e.g., react-rules.md) - Component design, state management, performance, patterns
45
- 4. **testing-rules.md** - Test structure, coverage, mocking
46
- 5. **security-rules.md** - Input validation, authentication, secrets
47
- 6. **performance-rules.md** - General optimization, loading, runtime
48
- 7. **project-specific.md** - Detected patterns, file organization, import conventions, custom rules
49
-
50
- ---
51
-
52
- ## Output
53
-
54
- ```
55
- ✅ Rules generated successfully!
56
-
57
- **Created files:**
58
- - `.opencode/rules/coding-principles.md` - Core 10X principles
59
- - `.opencode/rules/[language]-rules.md` - [Language] best practices
60
- - `.opencode/rules/[framework]-rules.md` - [Framework] patterns
61
- - `.opencode/rules/testing-rules.md` - Testing practices
62
- - `.opencode/rules/security-rules.md` - Security guidelines
63
- - `.opencode/rules/performance-rules.md` - Performance optimization
64
- - `.opencode/rules/project-specific.md` - Project conventions
65
-
66
- **Total:** [N] rule files. Rules are now active for all AI interactions.
67
- ```