@haposoft/cafekit 0.8.16 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -67
- package/bin/install.js +141 -194
- package/bin/lib/copy-utils.js +61 -0
- package/bin/lib/opencode-install.js +866 -0
- package/package.json +4 -1
- package/src/claude/CLAUDE.md +2 -2
- package/src/claude/migration-manifest.json +1 -0
- package/src/claude/rules/skill-domain-routing.md +2 -0
- package/src/claude/rules/skill-workflow-routing.md +3 -1
- package/src/claude/skills/qs/SKILL.md +177 -0
- package/src/claude/skills/qs/templates/qs.md +30 -0
- package/src/opencode/AGENTS.md +140 -0
- package/src/opencode/plugins/docs-sync.ts +181 -0
- package/src/opencode/plugins/inspect-block.ts +164 -0
- package/src/opencode/plugins/privacy-block.ts +182 -0
- package/src/opencode/plugins/rules.ts +163 -0
- package/src/opencode/plugins/session.ts +179 -0
- package/src/opencode/plugins/state.ts +253 -0
- package/src/opencode/plugins/usage.ts +178 -0
- package/src/antigravity/GEMINI.md +0 -162
- package/src/antigravity/workflows/code.md +0 -16
- package/src/antigravity/workflows/docs-init.md +0 -432
- package/src/antigravity/workflows/docs-update.md +0 -245
- package/src/antigravity/workflows/impact-analysis-output-example.md +0 -313
- package/src/antigravity/workflows/impact-analysis.md +0 -730
- package/src/antigravity/workflows/review.md +0 -15
- package/src/antigravity/workflows/spec-design.md +0 -220
- package/src/antigravity/workflows/spec-init.md +0 -78
- package/src/antigravity/workflows/spec-requirements.md +0 -122
- package/src/antigravity/workflows/spec-status.md +0 -95
- package/src/antigravity/workflows/spec-tasks.md +0 -156
- package/src/antigravity/workflows/spec-validate.md +0 -106
- package/src/antigravity/workflows/test.md +0 -13
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Review recent code changes for quality, security, and maintainability.
|
|
3
|
-
allowed-tools: Bash, Read, Grep, Glob
|
|
4
|
-
argument-hint: [scope]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /review
|
|
8
|
-
|
|
9
|
-
Review recent code changes. Prioritize:
|
|
10
|
-
- correctness
|
|
11
|
-
- security
|
|
12
|
-
- regressions
|
|
13
|
-
- maintainability
|
|
14
|
-
|
|
15
|
-
Output findings by severity and include concrete fixes.
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create comprehensive technical design for a specification
|
|
3
|
-
allowed-tools: Glob, Grep, Read, Write, Edit, WebSearch, WebFetch
|
|
4
|
-
argument-hint: <feature-name> [-y]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Technical Design Generator
|
|
8
|
-
|
|
9
|
-
<background_information>
|
|
10
|
-
- **Mission**: Generate comprehensive technical design document that translates requirements (WHAT) into architectural design (HOW)
|
|
11
|
-
- **Success Criteria**:
|
|
12
|
-
- All requirements mapped to technical components with clear interfaces
|
|
13
|
-
- Appropriate architecture discovery and research completed
|
|
14
|
-
- Design aligns with steering context and existing patterns
|
|
15
|
-
- Visual diagrams included for complex architectures
|
|
16
|
-
</background_information>
|
|
17
|
-
|
|
18
|
-
<instructions>
|
|
19
|
-
## Core Task
|
|
20
|
-
Generate technical design document for feature **$ARGUMENTS** based on approved requirements.
|
|
21
|
-
|
|
22
|
-
## Execution Steps
|
|
23
|
-
|
|
24
|
-
### Step 0: Validate Phase State (Plan-Style Gate)
|
|
25
|
-
|
|
26
|
-
- Read `.specs/$ARGUMENTS/spec.json` first
|
|
27
|
-
- If feature directory or `spec.json` is missing: stop and instruct user to run `/spec-init <project-description>` and `/spec-requirements <feature-name>` first
|
|
28
|
-
- If requirements have not been generated yet (phase before requirements): stop and instruct user to run `/spec-requirements $ARGUMENTS`
|
|
29
|
-
- If `phase` is `tasks-generated`: stop and explain design phase is already completed; only re-run for explicit regeneration/update intent
|
|
30
|
-
|
|
31
|
-
### Step 1: Load Context
|
|
32
|
-
|
|
33
|
-
**Read all necessary context**:
|
|
34
|
-
- `.specs/$ARGUMENTS/spec.json`, `requirements.md`, `design.md` (if exists)
|
|
35
|
-
- **Entire `.specs/steering/` directory** for complete project memory (if exists)
|
|
36
|
-
- `{{SKILLS_DIR}}/specs/templates/design.md` for document structure
|
|
37
|
-
- `{{SKILLS_DIR}}/specs/rules/design-principles.md` for design principles
|
|
38
|
-
- `{{SKILLS_DIR}}/specs/templates/research.md` for discovery log structure
|
|
39
|
-
- **Load project docs context (Plan-style quality gate)** when available:
|
|
40
|
-
- `docs/codebase-summary.md`
|
|
41
|
-
- `docs/code-standards.md`
|
|
42
|
-
- `docs/system-architecture.md`
|
|
43
|
-
- `docs/project-overview-pdr.md`
|
|
44
|
-
- If any docs file is missing, continue and mention missing context in execution output (do not block generation)
|
|
45
|
-
|
|
46
|
-
**Validate requirements approval**:
|
|
47
|
-
- If `-y` flag provided: Auto-approve requirements in spec.json
|
|
48
|
-
- Otherwise: Verify approval status (stop if unapproved, see Safety & Fallback)
|
|
49
|
-
|
|
50
|
-
### Step 2: Discovery & Analysis
|
|
51
|
-
|
|
52
|
-
**Critical: This phase ensures design is based on complete, accurate information.**
|
|
53
|
-
|
|
54
|
-
### Step 2A: Discovery Mode Router (Plan-Style)
|
|
55
|
-
|
|
56
|
-
Before discovery, select a deterministic mode and record the reason:
|
|
57
|
-
- **minimal**: UI/CRUD-only change, no new external dependency/API, no schema change, <=2 integration points
|
|
58
|
-
- **light**: extension of existing feature with known patterns and limited integration risk
|
|
59
|
-
- **full**: new subsystem, external integration, auth/security/performance impact, unclear constraints, or architecture trade-offs
|
|
60
|
-
- **Default rule**: when uncertain, choose **full** (safer than missing context)
|
|
61
|
-
- **Research budget**: keep discovery scoped; use at most 2 major external investigations unless findings reveal a blocker
|
|
62
|
-
|
|
63
|
-
Use the selected mode to drive Step 2 execution and persist it in spec metadata during Step 3 finalize.
|
|
64
|
-
|
|
65
|
-
1. **Classify Feature Type**:
|
|
66
|
-
- **New Feature** (greenfield) → Full discovery required
|
|
67
|
-
- **Extension** (existing system) → Integration-focused discovery
|
|
68
|
-
- **Simple Addition** (CRUD/UI) → Minimal or no discovery
|
|
69
|
-
- **Complex Integration** → Comprehensive analysis required
|
|
70
|
-
|
|
71
|
-
2. **Execute Appropriate Discovery Process**:
|
|
72
|
-
|
|
73
|
-
**For Complex/New Features**:
|
|
74
|
-
- Read and execute `{{SKILLS_DIR}}/specs/rules/design-discovery-full.md`
|
|
75
|
-
- Conduct thorough research using WebSearch/WebFetch:
|
|
76
|
-
- Latest architectural patterns and best practices
|
|
77
|
-
- External dependency verification (APIs, libraries, versions, compatibility)
|
|
78
|
-
- Official documentation, migration guides, known issues
|
|
79
|
-
- Performance benchmarks and security considerations
|
|
80
|
-
|
|
81
|
-
**For Extensions**:
|
|
82
|
-
- Read and execute `{{SKILLS_DIR}}/specs/rules/design-discovery-light.md`
|
|
83
|
-
- Focus on integration points, existing patterns, compatibility
|
|
84
|
-
- Use Grep to analyze existing codebase patterns
|
|
85
|
-
|
|
86
|
-
**For Simple Additions**:
|
|
87
|
-
- Skip formal discovery, quick pattern check only
|
|
88
|
-
|
|
89
|
-
3. **Retain Discovery Findings for Step 3**:
|
|
90
|
-
- External API contracts and constraints
|
|
91
|
-
- Technology decisions with rationale
|
|
92
|
-
- Existing patterns to follow or extend
|
|
93
|
-
- Integration points and dependencies
|
|
94
|
-
- Identified risks and mitigation strategies
|
|
95
|
-
- Potential architecture patterns and boundary options
|
|
96
|
-
- Parallelization considerations for future tasks
|
|
97
|
-
|
|
98
|
-
4. **Persist Findings to Research Log**:
|
|
99
|
-
- Create or update `.specs/$ARGUMENTS/research.md` using the shared template
|
|
100
|
-
- Summarize discovery scope and key findings (Summary section)
|
|
101
|
-
- Record investigations in Research Log topics with sources and implications
|
|
102
|
-
- Document architecture pattern evaluation, design decisions, and risks
|
|
103
|
-
- Use the language specified in spec.json
|
|
104
|
-
|
|
105
|
-
### Step 3: Generate Design Document
|
|
106
|
-
|
|
107
|
-
1. **Load Design Template and Rules**:
|
|
108
|
-
- Read `{{SKILLS_DIR}}/specs/templates/design.md` for structure
|
|
109
|
-
- Read `{{SKILLS_DIR}}/specs/rules/design-principles.md` for principles
|
|
110
|
-
|
|
111
|
-
2. **Generate Design Document**:
|
|
112
|
-
- **Follow template structure strictly**
|
|
113
|
-
- **Integrate all discovery findings**: Use researched information throughout component definitions
|
|
114
|
-
- If existing design.md found, use it as reference context (merge mode)
|
|
115
|
-
- Apply design rules: Type Safety, Visual Communication, Formal Tone
|
|
116
|
-
- Use language specified in spec.json
|
|
117
|
-
- Include Mermaid diagrams for architecture visualization
|
|
118
|
-
|
|
119
|
-
3. **Required Sections & Detail Level** (CRITICAL):
|
|
120
|
-
|
|
121
|
-
**Verbosity Guideline**: Aim for high detail. Do not summarize if detail is available. Use full sentences and comprehensive lists. If a section seems simple, expand on *why* it's simple and what alternate options were rejected.
|
|
122
|
-
|
|
123
|
-
| Section | Requirement | Instructions |
|
|
124
|
-
|---------|-------------|--------------|
|
|
125
|
-
| **Overview** | ✅ Mandatory | Include detailed Purpose, Users, Impact, Goals (3+), Non-Goals (3+) |
|
|
126
|
-
| **Architecture** | ✅ Mandatory | Detailed visual Analysis, Architecture Pattern (Mermaid), Tech Stack with rationale |
|
|
127
|
-
| **System Flows** | ✅ Mandatory | **MUST include at least one Mermaid sequence diagram showing component interactions** |
|
|
128
|
-
| **Requirements Traceability** | ✅ Mandatory | Map every single requirement ID. Do not skip or group them. |
|
|
129
|
-
| **Components and Interfaces** | ✅ Mandatory | **MUST include full TypeScript interfaces/types for every component**, state models, and explicit contracts. |
|
|
130
|
-
| **Data Models** | ✅ Mandatory | If no new data: Document "No Data Model Changes" and explain why state sufficiency. |
|
|
131
|
-
| **Error Handling** | ✅ Mandatory | Detailed Error Strategy, specific Categories (User/System/Logic), Monitoring plan. |
|
|
132
|
-
| **Testing Strategy** | ✅ Mandatory | Unit (5+), Integration (3+), E2E (3+), Accessibility (3+). Be specific. |
|
|
133
|
-
| **Security Considerations** | ✅ Mandatory | Threat modeling even for UI (e.g., "XSS via inputs"). If none, explicitly state why safe. |
|
|
134
|
-
| **Performance & Scalability** | ✅ Mandatory | Define target metrics (e.g. <100ms render) even for client-side features. |
|
|
135
|
-
| **Supporting References** | 🔶 Optional | Include if TypeScript definitions or logs exceed 20 lines. |
|
|
136
|
-
|
|
137
|
-
4. **Update Metadata** in spec.json:
|
|
138
|
-
- Set `phase: "design-generated"`
|
|
139
|
-
- Set `approvals.design.generated: true, approved: false`
|
|
140
|
-
- Set `approvals.requirements.approved: true`
|
|
141
|
-
- Set `design_context.discovery_mode: "minimal" | "light" | "full"` (based on Step 2A)
|
|
142
|
-
- Set `design_context.discovery_reason: "<short reason>"`
|
|
143
|
-
- Set `design_context.validation_recommended: true` when discovery mode is `full` or risk level is medium/high
|
|
144
|
-
- Update `updated_at` timestamp
|
|
145
|
-
|
|
146
|
-
## Critical Constraints
|
|
147
|
-
- **Type Safety**:
|
|
148
|
-
- Enforce strong typing aligned with the project's technology stack
|
|
149
|
-
- For TypeScript, never use `any`; prefer precise types and generics
|
|
150
|
-
- Document public interfaces and contracts clearly
|
|
151
|
-
- **Latest Information**: Use WebSearch/WebFetch for external dependencies and best practices
|
|
152
|
-
- **Steering Alignment**: Respect existing architecture patterns from steering context
|
|
153
|
-
- **Template Adherence**: Follow template structure strictly
|
|
154
|
-
- **Design Focus**: Architecture and interfaces ONLY, no implementation code
|
|
155
|
-
- **Requirements Traceability IDs**: Use numeric requirement IDs only (e.g. "1.1", "1.2") as defined in requirements.md
|
|
156
|
-
</instructions>
|
|
157
|
-
|
|
158
|
-
## Tool Guidance
|
|
159
|
-
- **Read first**: Load all context before taking action (specs, steering, templates, rules)
|
|
160
|
-
- **Research when uncertain**: Use WebSearch/WebFetch for external dependencies, APIs, and latest best practices
|
|
161
|
-
- **Analyze existing code**: Use Grep to find patterns and integration points in codebase
|
|
162
|
-
- **Write last**: Generate design.md only after all research and analysis complete
|
|
163
|
-
|
|
164
|
-
## Output Description
|
|
165
|
-
|
|
166
|
-
**Command execution output** (separate from design.md content):
|
|
167
|
-
|
|
168
|
-
Provide brief summary in the language specified in spec.json:
|
|
169
|
-
|
|
170
|
-
1. **Status**: Confirm design document generated at `.specs/$ARGUMENTS/design.md`
|
|
171
|
-
2. **Discovery Type**: Which discovery process was executed (full/light/minimal)
|
|
172
|
-
3. **Discovery Rationale**: One-line reason why this mode was selected
|
|
173
|
-
4. **Key Findings**: 2-3 critical insights from `research.md` that shaped the design
|
|
174
|
-
5. **Next Action**: Approval workflow guidance (include whether `/spec-validate $ARGUMENTS` is recommended before `/spec-tasks`)
|
|
175
|
-
6. **Research Log**: Confirm `research.md` updated with latest decisions
|
|
176
|
-
|
|
177
|
-
**Format**: Concise Markdown (under 200 words)
|
|
178
|
-
|
|
179
|
-
## Safety & Fallback
|
|
180
|
-
|
|
181
|
-
### Error Scenarios
|
|
182
|
-
|
|
183
|
-
**Requirements Not Approved**:
|
|
184
|
-
- **Stop Execution**: Cannot proceed without approved requirements
|
|
185
|
-
- **User Message**: "Requirements not yet approved. Approval required before design generation."
|
|
186
|
-
- **Suggested Action**: "Run `/spec-design $ARGUMENTS -y` to auto-approve requirements and proceed"
|
|
187
|
-
|
|
188
|
-
**Missing Requirements**:
|
|
189
|
-
- **Stop Execution**: Requirements document must exist
|
|
190
|
-
- **User Message**: "No requirements.md found at `.specs/$ARGUMENTS/requirements.md`"
|
|
191
|
-
- **Suggested Action**: "Run `/spec-requirements $ARGUMENTS` to generate requirements first"
|
|
192
|
-
|
|
193
|
-
**Template Missing**:
|
|
194
|
-
- **User Message**: "Template file missing"
|
|
195
|
-
- **Suggested Action**: "Check repository setup or restore template file"
|
|
196
|
-
- **Fallback**: Use inline basic structure with warning
|
|
197
|
-
|
|
198
|
-
**Steering Context Missing**:
|
|
199
|
-
- **Warning**: "Steering directory empty or missing - design may not align with project standards"
|
|
200
|
-
- **Proceed**: Continue with generation but note limitation in output
|
|
201
|
-
|
|
202
|
-
**Discovery Complexity Unclear**:
|
|
203
|
-
- **Default**: Use full discovery process
|
|
204
|
-
- **Rationale**: Better to over-research than miss critical context
|
|
205
|
-
|
|
206
|
-
**Invalid Requirement IDs**:
|
|
207
|
-
- **Stop Execution**: If requirements.md uses non-numeric headings, stop and instruct user to fix
|
|
208
|
-
|
|
209
|
-
### Next Phase: Task Generation
|
|
210
|
-
|
|
211
|
-
**If Design Approved**:
|
|
212
|
-
- Review generated design at `.specs/$ARGUMENTS/design.md`
|
|
213
|
-
- **Recommended for medium/high-risk designs**: Run `/spec-validate $ARGUMENTS` to confirm assumptions and trade-offs
|
|
214
|
-
- Then `/spec-tasks $ARGUMENTS -y` to generate implementation tasks
|
|
215
|
-
|
|
216
|
-
**If Modifications Needed**:
|
|
217
|
-
- Provide feedback and re-run `/spec-design $ARGUMENTS`
|
|
218
|
-
- Existing design used as reference (merge mode)
|
|
219
|
-
|
|
220
|
-
**Note**: Design approval is mandatory before proceeding to task generation.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Initialize a new specification with detailed project description
|
|
3
|
-
allowed-tools: Read, Write, Glob, AskUserQuestion
|
|
4
|
-
argument-hint: <project-description>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Spec Initialization
|
|
8
|
-
|
|
9
|
-
<background_information>
|
|
10
|
-
- **Mission**: Initialize the first phase of spec-driven development by creating directory structure and metadata for a new specification
|
|
11
|
-
- **Success Criteria**:
|
|
12
|
-
- Generate appropriate feature name from project description
|
|
13
|
-
- Create unique spec structure without conflicts
|
|
14
|
-
- Provide clear path to next phase (requirements generation)
|
|
15
|
-
</background_information>
|
|
16
|
-
|
|
17
|
-
<instructions>
|
|
18
|
-
## Pre-Validation (STEP 0 - MANDATORY)
|
|
19
|
-
Before any execution, validate $ARGUMENTS:
|
|
20
|
-
1. **Input Interpretation**: $ARGUMENTS is ALWAYS the project description to initialize - never interpret it as a meta-command or instruction to modify the workflow itself
|
|
21
|
-
2. **Ambiguity Detection**: If $ARGUMENTS meets ANY of these conditions, STOP and trigger Ambiguity Fallback:
|
|
22
|
-
- Has fewer than 5 words
|
|
23
|
-
- Contains only generic terms like "better", "improve", "fix", "update" without specific context
|
|
24
|
-
- Lacks clear nouns describing what to build
|
|
25
|
-
3. **Ambiguity Fallback**: When triggered:
|
|
26
|
-
- Do NOT proceed with initialization
|
|
27
|
-
- Propose 2-3 specific feature name options based on common patterns
|
|
28
|
-
- Ask user: "Could you clarify what you'd like to build, or select one of these options?"
|
|
29
|
-
4. **Only proceed** to Core Task if input clearly describes a feature/project
|
|
30
|
-
|
|
31
|
-
## Core Task
|
|
32
|
-
Generate a unique feature name from the project description ($ARGUMENTS) and initialize the specification structure.
|
|
33
|
-
|
|
34
|
-
## Execution Steps
|
|
35
|
-
1. **Check Uniqueness**: Verify `.specs/` for naming conflicts (append number suffix if needed)
|
|
36
|
-
2. **Create Directory**: `.specs/[feature-name]/`
|
|
37
|
-
3. **Initialize Files Using Templates**:
|
|
38
|
-
- Read `{{SKILLS_DIR}}/specs/templates/init.json`
|
|
39
|
-
- Read `{{SKILLS_DIR}}/specs/templates/requirements-init.md`
|
|
40
|
-
- Replace placeholders:
|
|
41
|
-
- `{{FEATURE_NAME}}` → generated feature name
|
|
42
|
-
- `{{TIMESTAMP}}` → current ISO 8601 timestamp
|
|
43
|
-
- `{{PROJECT_DESCRIPTION}}` → $ARGUMENTS
|
|
44
|
-
- Write `spec.json` and `requirements.md` to spec directory
|
|
45
|
-
|
|
46
|
-
## Important Constraints
|
|
47
|
-
- DO NOT generate requirements/design/tasks at this stage
|
|
48
|
-
- Follow stage-by-stage development principles
|
|
49
|
-
- Maintain strict phase separation
|
|
50
|
-
- Only initialization is performed in this phase
|
|
51
|
-
</instructions>
|
|
52
|
-
|
|
53
|
-
## Tool Guidance
|
|
54
|
-
- Use **Glob** to check existing spec directories for name uniqueness
|
|
55
|
-
- Use **Read** to fetch templates: `init.json` and `requirements-init.md`
|
|
56
|
-
- Use **Write** to create spec.json and requirements.md after placeholder replacement
|
|
57
|
-
- Perform validation before any file write operation
|
|
58
|
-
|
|
59
|
-
## Output Description
|
|
60
|
-
Provide output in the language specified in `spec.json` with the following structure:
|
|
61
|
-
|
|
62
|
-
1. **Generated Feature Name**: `feature-name` format with 1-2 sentence rationale
|
|
63
|
-
2. **Project Summary**: Brief summary (1 sentence)
|
|
64
|
-
3. **Created Files**: Bullet list with full paths
|
|
65
|
-
4. **Next Step**: Command block showing `/spec-requirements <feature-name>`
|
|
66
|
-
5. **Notes**: Explain why only initialization was performed (2-3 sentences on phase separation)
|
|
67
|
-
|
|
68
|
-
**Format Requirements**:
|
|
69
|
-
- Use Markdown headings (##, ###)
|
|
70
|
-
- Wrap commands in code blocks
|
|
71
|
-
- Keep total output concise (under 250 words)
|
|
72
|
-
- Use clear, professional language per `spec.json.language`
|
|
73
|
-
|
|
74
|
-
## Safety & Fallback
|
|
75
|
-
- **Ambiguous Feature Name**: If feature name generation is unclear, propose 2-3 options and ask user to select
|
|
76
|
-
- **Template Missing**: If template files don't exist in `{{SKILLS_DIR}}/specs/templates/`, report error with specific missing file path and suggest checking repository setup
|
|
77
|
-
- **Directory Conflict**: If feature name already exists, append numeric suffix (e.g., `feature-name-2`) and notify user of automatic conflict resolution
|
|
78
|
-
- **Write Failure**: Report error with specific path and suggest checking permissions or disk space
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Generate comprehensive requirements for a specification
|
|
3
|
-
allowed-tools: Glob, Grep, Read, Write, Edit, WebSearch, WebFetch
|
|
4
|
-
argument-hint: <feature-name>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Requirements Generation
|
|
8
|
-
|
|
9
|
-
<background_information>
|
|
10
|
-
- **Mission**: Generate comprehensive, testable requirements in EARS format based on the project description from spec initialization
|
|
11
|
-
- **Success Criteria**:
|
|
12
|
-
- Create complete requirements document aligned with steering context
|
|
13
|
-
- Follow the project's EARS patterns and constraints for all acceptance criteria
|
|
14
|
-
- Focus on core functionality without implementation details
|
|
15
|
-
- Update metadata to track generation status
|
|
16
|
-
</background_information>
|
|
17
|
-
|
|
18
|
-
<instructions>
|
|
19
|
-
## Core Task
|
|
20
|
-
Generate complete requirements for feature **$ARGUMENTS** based on the project description in requirements.md.
|
|
21
|
-
|
|
22
|
-
## Execution Steps
|
|
23
|
-
|
|
24
|
-
0. **Validate Phase State (Plan-Style Gate)**:
|
|
25
|
-
- Read `.specs/$ARGUMENTS/spec.json` first
|
|
26
|
-
- If missing feature directory or spec.json: stop and ask user to run `/spec-init <project-description>` first
|
|
27
|
-
- If `phase` is `design-generated` or `tasks-generated`: stop and explain requirements phase already completed; ask user to edit/re-run only with explicit intent to regenerate requirements
|
|
28
|
-
|
|
29
|
-
1. **Load Context**:
|
|
30
|
-
- Read `.specs/$ARGUMENTS/spec.json` for language and metadata
|
|
31
|
-
- Read `.specs/$ARGUMENTS/requirements.md` for project description
|
|
32
|
-
- **Load ALL steering context** (if exists): Read entire `.specs/steering/` directory including:
|
|
33
|
-
- Default files: `structure.md`, `tech.md`, `product.md`
|
|
34
|
-
- All custom steering files
|
|
35
|
-
- This provides complete project memory and context
|
|
36
|
-
|
|
37
|
-
2. **Read Guidelines**:
|
|
38
|
-
- Read `{{SKILLS_DIR}}/specs/rules/ears-format.md` for EARS syntax rules
|
|
39
|
-
- Read `{{SKILLS_DIR}}/specs/templates/requirements.md` for document structure
|
|
40
|
-
- **Load project docs context (Plan-style quality gate)** when available:
|
|
41
|
-
- `docs/codebase-summary.md`
|
|
42
|
-
- `docs/code-standards.md`
|
|
43
|
-
- `docs/system-architecture.md`
|
|
44
|
-
- `docs/project-overview-pdr.md`
|
|
45
|
-
- If any docs file is missing, continue and note the missing context in output (do not block generation)
|
|
46
|
-
|
|
47
|
-
3. **Analyze Existing Codebase** (for Extension/Enhancement features):
|
|
48
|
-
- Search for related files: `**/*.{tsx,jsx,ts,js,vue,py}`
|
|
49
|
-
- Read existing components/modules related to the feature
|
|
50
|
-
- Identify what's already implemented vs what needs to be added
|
|
51
|
-
|
|
52
|
-
**CRITICAL: DO NOT STOP OR ASK USER.** Instead:
|
|
53
|
-
- Note findings and CONTINUE to Step 4
|
|
54
|
-
- If existing implementation found:
|
|
55
|
-
- Add Introduction section in requirements.md acknowledging existing code
|
|
56
|
-
- Focus requirements on enhancements/additions, not reimplementation
|
|
57
|
-
- Reference existing components (e.g., "The project already has X and Y")
|
|
58
|
-
- If greenfield (no existing code): Skip Introduction, proceed normally
|
|
59
|
-
|
|
60
|
-
4. **Generate Requirements**:
|
|
61
|
-
- Create initial requirements based on project description
|
|
62
|
-
- Consider existing codebase findings (if any)
|
|
63
|
-
- Group related functionality into logical requirement areas
|
|
64
|
-
- Apply EARS format to all acceptance criteria:
|
|
65
|
-
- Event-Driven: `When [event], the [system] shall [response]`
|
|
66
|
-
- State-Driven: `While [precondition], the [system] shall [response]`
|
|
67
|
-
- Unwanted: `If [trigger], the [system] shall [response]`
|
|
68
|
-
- Optional: `Where [feature], the [system] shall [response]`
|
|
69
|
-
- Ubiquitous: `The [system] shall [response]`
|
|
70
|
-
- Use language specified in spec.json
|
|
71
|
-
|
|
72
|
-
5. **Update Metadata**:
|
|
73
|
-
- Set `phase: "requirements-generated"`
|
|
74
|
-
- Set `approvals.requirements.generated: true`
|
|
75
|
-
- Update `updated_at` timestamp
|
|
76
|
-
|
|
77
|
-
## Important Constraints
|
|
78
|
-
- Focus on WHAT, not HOW (no implementation details)
|
|
79
|
-
- Requirements must be testable and verifiable
|
|
80
|
-
- Choose appropriate subject for EARS statements (system/service name for software)
|
|
81
|
-
- Generate initial version first, then iterate with user feedback (no sequential questions upfront)
|
|
82
|
-
- Requirement headings in requirements.md MUST include a leading numeric ID only (for example: "Requirement 1", "1.", "2 Feature ..."); do not use alphabetic IDs like "Requirement A".
|
|
83
|
-
</instructions>
|
|
84
|
-
|
|
85
|
-
## Tool Guidance
|
|
86
|
-
- **Read first**: Load all context (spec, steering, rules, templates) before generation
|
|
87
|
-
- **Write last**: Update requirements.md only after complete generation
|
|
88
|
-
- Use **WebSearch/WebFetch** only if external domain knowledge needed
|
|
89
|
-
|
|
90
|
-
## Output Description
|
|
91
|
-
Provide output in the language specified in spec.json with:
|
|
92
|
-
|
|
93
|
-
1. **Generated Requirements Summary**: Brief overview of major requirement areas (3-5 bullets)
|
|
94
|
-
2. **Document Status**: Confirm requirements.md updated and spec.json metadata updated
|
|
95
|
-
3. **Next Steps**: Guide user on how to proceed (approve and continue, or modify)
|
|
96
|
-
|
|
97
|
-
**Format Requirements**:
|
|
98
|
-
- Use Markdown headings for clarity
|
|
99
|
-
- Include file paths in code blocks
|
|
100
|
-
- Keep summary concise (under 300 words)
|
|
101
|
-
|
|
102
|
-
## Safety & Fallback
|
|
103
|
-
|
|
104
|
-
### Error Scenarios
|
|
105
|
-
- **Missing Project Description**: If requirements.md lacks project description, ask user for feature details
|
|
106
|
-
- **Ambiguous Requirements**: Propose initial version and iterate with user rather than asking many upfront questions
|
|
107
|
-
- **Template Missing**: If template files don't exist, use inline fallback structure with warning
|
|
108
|
-
- **Language Undefined**: Default to English (`en`) if spec.json doesn't specify language
|
|
109
|
-
- **Incomplete Requirements**: After generation, explicitly ask user if requirements cover all expected functionality
|
|
110
|
-
- **Steering Directory Empty**: Warn user that project context is missing and may affect requirement quality
|
|
111
|
-
- **Non-numeric Requirement Headings**: If existing headings do not include a leading numeric ID, normalize them to numeric IDs
|
|
112
|
-
|
|
113
|
-
### Next Phase: Design Generation
|
|
114
|
-
|
|
115
|
-
**If Requirements Approved**:
|
|
116
|
-
- Review generated requirements at `.specs/$ARGUMENTS/requirements.md`
|
|
117
|
-
- Then `/spec-design $ARGUMENTS` to proceed to design phase
|
|
118
|
-
|
|
119
|
-
**If Modifications Needed**:
|
|
120
|
-
- Provide feedback and re-run `/spec-requirements $ARGUMENTS`
|
|
121
|
-
|
|
122
|
-
**Note**: Approval is mandatory before proceeding to design phase.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Display current status of a specification.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /spec-status - View Specification Status
|
|
6
|
-
|
|
7
|
-
$ARGUMENTS
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
Hiển thị trạng thái hiện tại của một spec hoặc liệt kê tất cả specs.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Task
|
|
18
|
-
|
|
19
|
-
### Execution Steps
|
|
20
|
-
|
|
21
|
-
**If `$ARGUMENTS` is provided:**
|
|
22
|
-
|
|
23
|
-
1. Read `.specs/$ARGUMENTS/spec.json`
|
|
24
|
-
2. Display:
|
|
25
|
-
- Feature name
|
|
26
|
-
- Current phase
|
|
27
|
-
- Approval status
|
|
28
|
-
- Discovery mode (if available)
|
|
29
|
-
- Validation status and last validated time (if available)
|
|
30
|
-
- **Backward compatibility fallback (older specs):**
|
|
31
|
-
- If `design_context` is missing, show Discovery mode as `n/a`
|
|
32
|
-
- If `validation` is missing, show Validation as `not-run` and Last validated as `n/a`
|
|
33
|
-
- Created/Updated timestamps
|
|
34
|
-
- Summary of files
|
|
35
|
-
|
|
36
|
-
**If no arguments:**
|
|
37
|
-
|
|
38
|
-
1. Glob `.specs/*/spec.json`
|
|
39
|
-
2. List all specs with their status
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Output Format
|
|
44
|
-
|
|
45
|
-
### Single Spec Status
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
## 📊 Spec Status: `<feature-name>`
|
|
49
|
-
|
|
50
|
-
| Property | Value |
|
|
51
|
-
|----------|-------|
|
|
52
|
-
| **Phase** | `<phase>` |
|
|
53
|
-
| **Discovery Mode** | `<minimal/light/full or n/a>` |
|
|
54
|
-
| **Validation** | `<completed/pending/n/a>` |
|
|
55
|
-
| **Last Validated** | `<timestamp or n/a>` |
|
|
56
|
-
| **Created** | `<timestamp>` |
|
|
57
|
-
| **Updated** | `<timestamp>` |
|
|
58
|
-
|
|
59
|
-
### Approvals
|
|
60
|
-
- Requirements: ✅/❌ Generated | ✅/❌ Approved
|
|
61
|
-
- Design: ✅/❌ Generated | ✅/❌ Approved
|
|
62
|
-
- Tasks: ✅/❌ Generated | ✅/❌ Approved
|
|
63
|
-
|
|
64
|
-
### Files
|
|
65
|
-
- `spec.json` ✅
|
|
66
|
-
- `requirements.md` ✅/❌
|
|
67
|
-
- `research.md` ✅/❌
|
|
68
|
-
- `design.md` ✅/❌
|
|
69
|
-
- `tasks.md` ✅/❌
|
|
70
|
-
|
|
71
|
-
### Next Action
|
|
72
|
-
- If phase = `requirements-generated`: Run `/spec-design <feature-name>`
|
|
73
|
-
- If phase = `design-generated`: Run `/spec-tasks <feature-name>`
|
|
74
|
-
- If phase = `tasks-generated`: Run `/code <feature-name>`, then `/test`, then `/review`
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### All Specs List
|
|
78
|
-
|
|
79
|
-
```markdown
|
|
80
|
-
## 📊 All Specs
|
|
81
|
-
|
|
82
|
-
| Feature | Phase | Last Updated |
|
|
83
|
-
|---------|-------|--------------|
|
|
84
|
-
| `mobile-app` | tasks-generated | 2026-01-21 |
|
|
85
|
-
| `auth-module` | design-generated | 2026-01-20 |
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Usage Examples
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
/spec-status mobile-app
|
|
94
|
-
/spec-status
|
|
95
|
-
```
|