@haposoft/cafekit 0.3.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 +866 -0
- package/bin/install.js +773 -0
- package/package.json +40 -0
- package/src/antigravity/GEMINI.md +162 -0
- package/src/antigravity/workflows/code.md +16 -0
- package/src/antigravity/workflows/docs-init.md +432 -0
- package/src/antigravity/workflows/docs-update.md +245 -0
- package/src/antigravity/workflows/review.md +15 -0
- package/src/antigravity/workflows/spec-design.md +220 -0
- package/src/antigravity/workflows/spec-init.md +78 -0
- package/src/antigravity/workflows/spec-requirements.md +122 -0
- package/src/antigravity/workflows/spec-status.md +95 -0
- package/src/antigravity/workflows/spec-tasks.md +156 -0
- package/src/antigravity/workflows/spec-validate.md +106 -0
- package/src/antigravity/workflows/test.md +13 -0
- package/src/claude/ROUTING.md +101 -0
- package/src/claude/agents/code-reviewer.md +131 -0
- package/src/claude/agents/debugger.md +137 -0
- package/src/claude/agents/fullstack-developer.md +95 -0
- package/src/claude/agents/tester.md +105 -0
- package/src/claude/commands/code.md +17 -0
- package/src/claude/commands/docs.md +609 -0
- package/src/claude/commands/review/codebase/parallel.md +122 -0
- package/src/claude/commands/review/codebase.md +49 -0
- package/src/claude/commands/review.md +16 -0
- package/src/claude/commands/spec-design.md +247 -0
- package/src/claude/commands/spec-init.md +118 -0
- package/src/claude/commands/spec-requirements.md +138 -0
- package/src/claude/commands/spec-status.md +98 -0
- package/src/claude/commands/spec-tasks.md +173 -0
- package/src/claude/commands/spec-validate.md +118 -0
- package/src/claude/commands/test.md +8 -0
- package/src/claude/migration-manifest.json +39 -0
- package/src/common/skills/specs/SKILL.md +101 -0
- package/src/common/skills/specs/rules/design-discovery-full.md +93 -0
- package/src/common/skills/specs/rules/design-discovery-light.md +49 -0
- package/src/common/skills/specs/rules/design-principles.md +182 -0
- package/src/common/skills/specs/rules/design-review.md +110 -0
- package/src/common/skills/specs/rules/ears-format.md +49 -0
- package/src/common/skills/specs/rules/gap-analysis.md +144 -0
- package/src/common/skills/specs/rules/steering-principles.md +90 -0
- package/src/common/skills/specs/rules/tasks-generation.md +131 -0
- package/src/common/skills/specs/rules/tasks-parallel-analysis.md +34 -0
- package/src/common/skills/specs/templates/design.md +276 -0
- package/src/common/skills/specs/templates/init.json +41 -0
- package/src/common/skills/specs/templates/requirements-init.md +9 -0
- package/src/common/skills/specs/templates/requirements.md +26 -0
- package/src/common/skills/specs/templates/research.md +61 -0
- package/src/common/skills/specs/templates/tasks.md +21 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-tasks
|
|
3
|
+
description: Generate implementation tasks for a specification
|
|
4
|
+
allowed-tools: Glob, Grep, Read, Write, Edit, WebSearch, WebFetch
|
|
5
|
+
argument-hint: <feature-name> [-y] [--sequential]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Implementation Tasks Generator
|
|
9
|
+
|
|
10
|
+
<background_information>
|
|
11
|
+
- **Mission**: Generate detailed, actionable implementation tasks that translate technical design into executable work items
|
|
12
|
+
- **Success Criteria**:
|
|
13
|
+
- All requirements mapped to specific tasks
|
|
14
|
+
- Tasks properly sized (1-3 hours each)
|
|
15
|
+
- Clear task progression with proper hierarchy
|
|
16
|
+
- Natural language descriptions focused on capabilities
|
|
17
|
+
</background_information>
|
|
18
|
+
|
|
19
|
+
<instructions>
|
|
20
|
+
## Core Task
|
|
21
|
+
Generate implementation tasks for feature **$ARGUMENTS** based on approved requirements and design.
|
|
22
|
+
|
|
23
|
+
## Execution Steps
|
|
24
|
+
|
|
25
|
+
### Step 0: Validate Phase State (Plan-Style Gate)
|
|
26
|
+
|
|
27
|
+
- Read `.specs/$ARGUMENTS/spec.json` first
|
|
28
|
+
- If feature directory or `spec.json` is missing: stop and instruct user to run `/spec-init <project-description>`, `/spec-requirements <feature-name>`, and `/spec-design <feature-name>` first
|
|
29
|
+
- If design has not been generated yet (phase before design): stop and instruct user to run `/spec-design $ARGUMENTS`
|
|
30
|
+
- If `phase` is already `tasks-generated`: explain tasks phase already exists and only continue for explicit regeneration/merge intent
|
|
31
|
+
|
|
32
|
+
### Step 1: Load Context
|
|
33
|
+
|
|
34
|
+
**Read all necessary context**:
|
|
35
|
+
- `.specs/$ARGUMENTS/spec.json`, `requirements.md`, `design.md`
|
|
36
|
+
- `.specs/$ARGUMENTS/tasks.md` (if exists, for merge mode)
|
|
37
|
+
- `.specs/$ARGUMENTS/research.md` (if exists, includes validation log)
|
|
38
|
+
- Resolve scope baseline from `spec.json.scope_lock` (fallback to derived baseline when missing)
|
|
39
|
+
- **Entire `.specs/steering/` directory** for complete project memory (if exists)
|
|
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 mention missing context in execution output (do not block generation)
|
|
46
|
+
|
|
47
|
+
**Validate approvals**:
|
|
48
|
+
- If `-y` flag provided: Auto-approve requirements and design in spec.json
|
|
49
|
+
- Otherwise: Verify both approved (stop if not, see Safety & Fallback)
|
|
50
|
+
- **Backward compatibility fallback (older specs):**
|
|
51
|
+
- If `validation` object is missing, treat validation status as `not-run`
|
|
52
|
+
- If `design_context` object is missing, treat `validation_recommended` as `false`
|
|
53
|
+
- If `spec.json.validation.status == "completed"`, treat validation as satisfied
|
|
54
|
+
- If validation is missing and `design_context.validation_recommended == true`, warn user to run `/spec-validate $ARGUMENTS` before continuing (do not hard-block)
|
|
55
|
+
- Determine sequential mode based on presence of `--sequential`
|
|
56
|
+
|
|
57
|
+
### Step 2: Generate Implementation Tasks
|
|
58
|
+
|
|
59
|
+
**Load generation rules and template**:
|
|
60
|
+
- Read `{{SKILLS_DIR}}/specs/rules/tasks-generation.md` for principles
|
|
61
|
+
- If `sequential` is **false**: Read `{{SKILLS_DIR}}/specs/rules/tasks-parallel-analysis.md` for parallel judgement criteria
|
|
62
|
+
- Read `{{SKILLS_DIR}}/specs/templates/tasks.md` for format (supports `(P)` markers)
|
|
63
|
+
|
|
64
|
+
**Generate task list following all rules**:
|
|
65
|
+
- Use language specified in spec.json
|
|
66
|
+
- Map all requirements to tasks
|
|
67
|
+
- Only use valid in-scope requirement IDs from requirements.md
|
|
68
|
+
- Every task MUST reference at least one valid in-scope requirement ID
|
|
69
|
+
- Reject or defer task candidates that map only to out-of-scope capabilities
|
|
70
|
+
- When documenting requirement coverage, list numeric requirement IDs only (comma-separated) without descriptive suffixes, parentheses, translations, or free-form labels
|
|
71
|
+
- Ensure all in-scope design components included
|
|
72
|
+
- Verify task progression is logical and incremental
|
|
73
|
+
- Collapse single-subtask structures by promoting them to major tasks and avoid duplicating details on container-only major tasks (use template patterns accordingly)
|
|
74
|
+
- Apply `(P)` markers to tasks that satisfy parallel criteria (omit markers in sequential mode)
|
|
75
|
+
- Mark optional test coverage subtasks with `- [ ]*` only when they strictly cover acceptance criteria already satisfied by core implementation and can be deferred post-MVP
|
|
76
|
+
- If existing tasks.md found, merge with new content
|
|
77
|
+
|
|
78
|
+
### Step 3: Finalize
|
|
79
|
+
|
|
80
|
+
**Write and update**:
|
|
81
|
+
- Create/update `.specs/$ARGUMENTS/tasks.md`
|
|
82
|
+
- Update spec.json metadata:
|
|
83
|
+
- Set `phase: "tasks-generated"`
|
|
84
|
+
- Set `approvals.tasks.generated: true, approved: false`
|
|
85
|
+
- Set `approvals.requirements.approved: true`
|
|
86
|
+
- Set `approvals.design.approved: true`
|
|
87
|
+
- Update `updated_at` timestamp
|
|
88
|
+
|
|
89
|
+
## Critical Constraints
|
|
90
|
+
- **Follow rules strictly**: All principles in tasks-generation.md are mandatory
|
|
91
|
+
- **Natural Language**: Describe what to do, not code structure details
|
|
92
|
+
- **Complete Coverage**: ALL in-scope requirements must map to tasks
|
|
93
|
+
- **Scope Lock**: Do not generate out-of-scope tasks; classify them as deferred when needed
|
|
94
|
+
- **Requirement Mapping Integrity**: Each task must map to valid numeric in-scope requirement IDs
|
|
95
|
+
- **Maximum 2 Levels**: Major tasks and sub-tasks only (no deeper nesting)
|
|
96
|
+
- **Sequential Numbering**: Major tasks increment (1, 2, 3...), never repeat
|
|
97
|
+
- **Task Integration**: Every task must connect to the system (no orphaned work)
|
|
98
|
+
</instructions>
|
|
99
|
+
|
|
100
|
+
## Tool Guidance
|
|
101
|
+
- **Read first**: Load all context, rules, and templates before generation
|
|
102
|
+
- **Write last**: Generate tasks.md only after complete analysis and verification
|
|
103
|
+
|
|
104
|
+
## Output Description
|
|
105
|
+
|
|
106
|
+
Provide brief summary in the language specified in spec.json:
|
|
107
|
+
|
|
108
|
+
1. **Status**: Confirm tasks generated at `.specs/$ARGUMENTS/tasks.md`
|
|
109
|
+
2. **Task Summary**:
|
|
110
|
+
- Total: X major tasks, Y sub-tasks
|
|
111
|
+
- All Z requirements covered
|
|
112
|
+
- Average task size: 1-3 hours per sub-task
|
|
113
|
+
3. **Quality Validation**:
|
|
114
|
+
- ✅ All in-scope requirements mapped to tasks
|
|
115
|
+
- ✅ Task dependencies verified
|
|
116
|
+
- ✅ Testing tasks included
|
|
117
|
+
4. **Scope Guard**:
|
|
118
|
+
- ✅ Every task maps to valid in-scope requirement IDs
|
|
119
|
+
- ✅ Out-of-scope tasks deferred/blocked
|
|
120
|
+
5. **Next Action**: Review tasks and proceed when ready
|
|
121
|
+
|
|
122
|
+
**Format**: Concise (under 200 words)
|
|
123
|
+
|
|
124
|
+
## Safety & Fallback
|
|
125
|
+
|
|
126
|
+
### Error Scenarios
|
|
127
|
+
|
|
128
|
+
**Requirements or Design Not Approved**:
|
|
129
|
+
- **Stop Execution**: Cannot proceed without approved requirements and design
|
|
130
|
+
- **User Message**: "Requirements and design must be approved before task generation"
|
|
131
|
+
- **Suggested Action**: "Run `/spec-tasks $ARGUMENTS -y` to auto-approve both and proceed"
|
|
132
|
+
|
|
133
|
+
**Missing Requirements or Design**:
|
|
134
|
+
- **Stop Execution**: Both documents must exist
|
|
135
|
+
- **User Message**: "Missing requirements.md or design.md at `.specs/$ARGUMENTS/`"
|
|
136
|
+
- **Suggested Action**: "Complete requirements and design phases first"
|
|
137
|
+
|
|
138
|
+
**Incomplete Requirements Coverage**:
|
|
139
|
+
- **Warning**: "Not all in-scope requirements mapped to tasks. Review coverage."
|
|
140
|
+
- **User Action Required**: Confirm intentional gaps or regenerate tasks
|
|
141
|
+
|
|
142
|
+
**Out-of-Scope Tasks Detected**:
|
|
143
|
+
- **Block/Defer**: Do not include out-of-scope tasks in primary task plan
|
|
144
|
+
- **User Guidance**: Request explicit scope expansion approval if user wants those tasks promoted
|
|
145
|
+
|
|
146
|
+
**Template/Rules Missing**:
|
|
147
|
+
- **User Message**: "Template or rules files missing in `{{SKILLS_DIR}}/specs/`"
|
|
148
|
+
- **Fallback**: Use inline basic structure with warning
|
|
149
|
+
- **Suggested Action**: "Check repository setup or restore template files"
|
|
150
|
+
|
|
151
|
+
**Missing Numeric Requirement IDs**:
|
|
152
|
+
- **Stop Execution**: All requirements in requirements.md MUST have numeric IDs. If any requirement lacks a numeric ID, stop and request that requirements.md be fixed before generating tasks.
|
|
153
|
+
|
|
154
|
+
**Invalid Requirement Mapping in Tasks**:
|
|
155
|
+
- **Stop Execution**: If a generated task cannot map to valid in-scope numeric requirement IDs, remove/defer it and regenerate task mapping
|
|
156
|
+
|
|
157
|
+
### Next Phase: Implementation
|
|
158
|
+
|
|
159
|
+
**Before Starting Implementation**:
|
|
160
|
+
- **IMPORTANT**: Clear conversation history and free up context before running `/code`
|
|
161
|
+
- This applies when starting first task OR switching between tasks
|
|
162
|
+
- Fresh context ensures clean state and proper task focus
|
|
163
|
+
|
|
164
|
+
**If Tasks Approved**:
|
|
165
|
+
- Execute coding pass from approved spec tasks: `/code $ARGUMENTS`
|
|
166
|
+
- After coding, run `/test` then `/review`
|
|
167
|
+
- Repeat in small passes and clear context between iterations when needed
|
|
168
|
+
|
|
169
|
+
**If Modifications Needed**:
|
|
170
|
+
- Provide feedback and re-run `/spec-tasks $ARGUMENTS`
|
|
171
|
+
- Existing tasks used as reference (merge mode)
|
|
172
|
+
|
|
173
|
+
**Note**: Continue with `/test` then `/review` after `/code` to complete the workflow.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-validate
|
|
3
|
+
description: Validate design decisions with interview questions before task generation
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, AskUserQuestion
|
|
5
|
+
argument-hint: <feature-name>
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Specification Validation Interview
|
|
9
|
+
|
|
10
|
+
<background_information>
|
|
11
|
+
- **Mission**: Validate critical design decisions, assumptions, and trade-offs before generating implementation tasks.
|
|
12
|
+
- **Success Criteria**:
|
|
13
|
+
- Ask targeted, concrete questions about high-impact decisions
|
|
14
|
+
- Record answers in spec artifacts for future traceability
|
|
15
|
+
- Update spec metadata to reflect validation status
|
|
16
|
+
</background_information>
|
|
17
|
+
|
|
18
|
+
<instructions>
|
|
19
|
+
## Core Task
|
|
20
|
+
Run a structured interview for feature **$ARGUMENTS** and persist decisions.
|
|
21
|
+
|
|
22
|
+
## Execution Steps
|
|
23
|
+
|
|
24
|
+
### Step 0: Resolve & Validate State
|
|
25
|
+
- Require `$ARGUMENTS` as feature name
|
|
26
|
+
- Read `.specs/$ARGUMENTS/spec.json`
|
|
27
|
+
- Stop with guidance if spec does not exist
|
|
28
|
+
- Ensure `requirements.md` and `design.md` exist before validation
|
|
29
|
+
|
|
30
|
+
### Step 1: Load Validation Context
|
|
31
|
+
Read:
|
|
32
|
+
- `.specs/$ARGUMENTS/spec.json`
|
|
33
|
+
- `.specs/$ARGUMENTS/requirements.md`
|
|
34
|
+
- `.specs/$ARGUMENTS/design.md`
|
|
35
|
+
- `.specs/$ARGUMENTS/research.md` (if exists)
|
|
36
|
+
|
|
37
|
+
Resolve scope lock first:
|
|
38
|
+
- `scope_lock.source`
|
|
39
|
+
- `scope_lock.in_scope[]`
|
|
40
|
+
- `scope_lock.out_of_scope[]`
|
|
41
|
+
- `scope_lock.expansion_policy`
|
|
42
|
+
|
|
43
|
+
Extract decision points around in-scope trade-offs only:
|
|
44
|
+
- architecture and boundaries
|
|
45
|
+
- assumptions and defaults
|
|
46
|
+
- integration risks
|
|
47
|
+
- scope and sequencing
|
|
48
|
+
- testing/security/performance trade-offs
|
|
49
|
+
|
|
50
|
+
### Step 2: Determine Question Budget
|
|
51
|
+
Use injected session validation settings when available (`Validation: mode=X, questions=MIN-MAX`).
|
|
52
|
+
- If unavailable, use 3-6 questions
|
|
53
|
+
- Ask only meaningful questions that can change in-scope implementation
|
|
54
|
+
- Each question must have 2-4 concrete options
|
|
55
|
+
- Prefer in-scope confirmation questions first; scope-expansion questions are optional and only if needed
|
|
56
|
+
|
|
57
|
+
### Step 3: Interview User
|
|
58
|
+
Use `AskUserQuestion` in batches (max 4 questions per call).
|
|
59
|
+
Rules:
|
|
60
|
+
- Include one recommended option when a safe default exists
|
|
61
|
+
- Keep options mutually exclusive
|
|
62
|
+
- Do not ask redundant questions
|
|
63
|
+
- Keep questions inside current scope by default
|
|
64
|
+
- Open-scope expansion questions are allowed only when scope pressure is detected and must require explicit user approval
|
|
65
|
+
|
|
66
|
+
### Step 4: Persist Validation Log
|
|
67
|
+
Append to `.specs/$ARGUMENTS/research.md` under `## Validation Log`.
|
|
68
|
+
If section missing, create it.
|
|
69
|
+
|
|
70
|
+
Session format:
|
|
71
|
+
```markdown
|
|
72
|
+
## Validation Log
|
|
73
|
+
|
|
74
|
+
### Session N — YYYY-MM-DD
|
|
75
|
+
- Questions asked: X
|
|
76
|
+
|
|
77
|
+
1. [Category] Question text
|
|
78
|
+
- Options: A | B | C
|
|
79
|
+
- Answer: ...
|
|
80
|
+
- Rationale: why this decision matters
|
|
81
|
+
|
|
82
|
+
#### Confirmed Decisions
|
|
83
|
+
- ...
|
|
84
|
+
|
|
85
|
+
#### Follow-up Actions
|
|
86
|
+
- [ ] ...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 5: Update Metadata
|
|
90
|
+
Update `.specs/$ARGUMENTS/spec.json`:
|
|
91
|
+
- `approvals.requirements.approved: true`
|
|
92
|
+
- `approvals.design.approved: true`
|
|
93
|
+
- `validation.last_validated_at: <ISO timestamp>`
|
|
94
|
+
- `validation.questions_asked: <number>`
|
|
95
|
+
- `validation.status: "completed"`
|
|
96
|
+
- increment `validation.session_count` (initialize to 1 if absent)
|
|
97
|
+
- if explicit expansion approved by user, update `scope_lock.in_scope` / `scope_lock.out_of_scope` accordingly
|
|
98
|
+
- update `updated_at`
|
|
99
|
+
|
|
100
|
+
## Constraints
|
|
101
|
+
- Keep input/output contract of existing `spec-*` commands unchanged
|
|
102
|
+
- Validation must be traceable and append-only (never overwrite old sessions)
|
|
103
|
+
- Ask fewer questions when artifact is simple; quality over quantity
|
|
104
|
+
- Do not introduce new capability domains during validation unless user explicitly approves scope expansion
|
|
105
|
+
</instructions>
|
|
106
|
+
|
|
107
|
+
## Output Description
|
|
108
|
+
Provide concise summary:
|
|
109
|
+
1. Validation status and files updated
|
|
110
|
+
2. Number of questions asked
|
|
111
|
+
3. Top confirmed decisions
|
|
112
|
+
4. Recommended next command:
|
|
113
|
+
- `/spec-tasks $ARGUMENTS` when ready
|
|
114
|
+
|
|
115
|
+
## Safety & Fallback
|
|
116
|
+
- Missing spec/design artifacts: stop and instruct the exact preceding command
|
|
117
|
+
- Empty decision surface: ask only 1-2 high-value confirmation questions
|
|
118
|
+
- Write failure: report exact path and retry guidance
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: ⚡ Run tests locally and analyze the summary report.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `tester` subagent to run tests locally and analyze the summary report.
|
|
6
|
+
|
|
7
|
+
**IMPORTANT**: **Do not** start implementing.
|
|
8
|
+
**IMPORTANT:** Analyze the skills catalog and activate the skills that are needed for the task during the process.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"scope": "claude-only",
|
|
4
|
+
"commands": {
|
|
5
|
+
"core": [
|
|
6
|
+
"docs.md",
|
|
7
|
+
"spec-init.md",
|
|
8
|
+
"spec-requirements.md",
|
|
9
|
+
"spec-design.md",
|
|
10
|
+
"spec-validate.md",
|
|
11
|
+
"spec-tasks.md",
|
|
12
|
+
"spec-status.md",
|
|
13
|
+
"code.md",
|
|
14
|
+
"test.md",
|
|
15
|
+
"review.md",
|
|
16
|
+
"review/codebase.md",
|
|
17
|
+
"review/codebase/parallel.md"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"skills": {
|
|
21
|
+
"required": [
|
|
22
|
+
"specs"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"agents": {
|
|
26
|
+
"required": [
|
|
27
|
+
"tester.md",
|
|
28
|
+
"code-reviewer.md",
|
|
29
|
+
"fullstack-developer.md",
|
|
30
|
+
"debugger.md"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"required": []
|
|
35
|
+
},
|
|
36
|
+
"hooks": {
|
|
37
|
+
"assumed": []
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specs
|
|
3
|
+
description: Specs workflow for creating comprehensive feature specifications. Use for new features, complex changes, or when you need structured requirements, design, and task breakdown.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Specs (SDD)
|
|
7
|
+
|
|
8
|
+
> Hệ thống tạo specification có cấu trúc, từ ý tưởng mơ hồ đến task list cụ thể.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Skill này cung cấp quy trình 7 bước để biến ý tưởng thành spec và triển khai thực tế:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Idea - Requirements - Design - Tasks - Code - Test - Review
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Available Workflows
|
|
19
|
+
|
|
20
|
+
| Command | Mô tả |
|
|
21
|
+
|---------|-------|
|
|
22
|
+
| `/spec-init <mô tả>` | Khởi tạo spec mới từ ý tưởng |
|
|
23
|
+
| `/spec-requirements <feature>` | Sinh requirements (EARS format) |
|
|
24
|
+
| `/spec-design <feature>` | Sinh design doc + research |
|
|
25
|
+
| `/spec-tasks <feature>` | Sinh task list |
|
|
26
|
+
| `/code <feature>` | Implement task từ spec tasks |
|
|
27
|
+
| `/test` | Run tests cho phần code vừa implement |
|
|
28
|
+
| `/review` | Review code quality trước khi merge |
|
|
29
|
+
| `/spec-status <feature>` | Xem trạng thái hiện tại |
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 1. Khởi tạo spec
|
|
35
|
+
/spec-init Tạo app mobile cho hệ thống quản lý
|
|
36
|
+
|
|
37
|
+
# 2. Sinh requirements
|
|
38
|
+
/spec-requirements mobile-app
|
|
39
|
+
|
|
40
|
+
# 3. Sinh design
|
|
41
|
+
/spec-design mobile-app
|
|
42
|
+
|
|
43
|
+
# 4. Sinh tasks
|
|
44
|
+
/spec-tasks mobile-app
|
|
45
|
+
|
|
46
|
+
# 5. Code
|
|
47
|
+
/code mobile-app
|
|
48
|
+
|
|
49
|
+
# 6. Test
|
|
50
|
+
/test
|
|
51
|
+
|
|
52
|
+
# 7. Review
|
|
53
|
+
/review
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Data Structure
|
|
57
|
+
|
|
58
|
+
Mỗi feature spec được lưu trong `.specs/<feature-name>/`:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
.specs/
|
|
62
|
+
└── mobile-app/
|
|
63
|
+
├── spec.json # Metadata & state
|
|
64
|
+
├── requirements.md # Requirements (EARS format)
|
|
65
|
+
├── research.md # Research log
|
|
66
|
+
├── design.md # Design document
|
|
67
|
+
└── tasks.md # Task list
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Resources
|
|
71
|
+
|
|
72
|
+
Skill này bao gồm:
|
|
73
|
+
|
|
74
|
+
### Templates (`templates/`)
|
|
75
|
+
- `init.json` - Schema metadata
|
|
76
|
+
- `requirements-init.md` - Template requirements rỗng
|
|
77
|
+
- `requirements.md` - Template requirements đầy đủ
|
|
78
|
+
- `design.md` - Template design doc
|
|
79
|
+
- `research.md` - Template research log
|
|
80
|
+
- `tasks.md` - Template task list
|
|
81
|
+
|
|
82
|
+
### Rules (`rules/`)
|
|
83
|
+
- `ears-format.md` - Chuẩn viết Requirements (EARS)
|
|
84
|
+
- `design-principles.md` - Nguyên tắc thiết kế
|
|
85
|
+
- `design-discovery-full.md` - Quy trình research đầy đủ
|
|
86
|
+
- `design-discovery-light.md` - Quy trình research nhẹ
|
|
87
|
+
- `tasks-generation.md` - Quy tắc chia task
|
|
88
|
+
- `tasks-parallel-analysis.md` - Phân tích task song song
|
|
89
|
+
|
|
90
|
+
## When to Use
|
|
91
|
+
|
|
92
|
+
✅ **Dùng khi:**
|
|
93
|
+
- Tạo feature mới phức tạp
|
|
94
|
+
- Cần documentation trước khi code
|
|
95
|
+
- Làm việc với team (cần review spec)
|
|
96
|
+
- Dự án cần audit trail
|
|
97
|
+
|
|
98
|
+
❌ **Không cần khi:**
|
|
99
|
+
- Fix bug đơn giản
|
|
100
|
+
- Thay đổi nhỏ (< 1 giờ)
|
|
101
|
+
- Hotfix khẩn cấp
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Full Discovery Process for Technical Design
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
Conduct comprehensive research and analysis to ensure the technical design is based on complete, accurate, and up-to-date information.
|
|
5
|
+
|
|
6
|
+
## Discovery Steps
|
|
7
|
+
|
|
8
|
+
### 1. Requirements Analysis
|
|
9
|
+
**Map Requirements to Technical Needs**
|
|
10
|
+
- Extract all functional requirements from EARS format
|
|
11
|
+
- Identify non-functional requirements (performance, security, scalability)
|
|
12
|
+
- Determine technical constraints and dependencies
|
|
13
|
+
- List core technical challenges
|
|
14
|
+
|
|
15
|
+
### 2. Existing Implementation Analysis
|
|
16
|
+
**Understand Current System** (if modifying/extending):
|
|
17
|
+
- Analyze codebase structure and architecture patterns
|
|
18
|
+
- Map reusable components, services, utilities
|
|
19
|
+
- Identify domain boundaries and data flows
|
|
20
|
+
- Document integration points and dependencies
|
|
21
|
+
- Determine approach: extend vs refactor vs wrap
|
|
22
|
+
|
|
23
|
+
### 3. Technology Research
|
|
24
|
+
**Investigate Best Practices and Solutions**:
|
|
25
|
+
- **Use WebSearch** to find:
|
|
26
|
+
- Latest architectural patterns for similar problems
|
|
27
|
+
- Industry best practices for the technology stack
|
|
28
|
+
- Recent updates or changes in relevant technologies
|
|
29
|
+
- Common pitfalls and solutions
|
|
30
|
+
|
|
31
|
+
- **Use WebFetch** to analyze:
|
|
32
|
+
- Official documentation for frameworks/libraries
|
|
33
|
+
- API references and usage examples
|
|
34
|
+
- Migration guides and breaking changes
|
|
35
|
+
- Performance benchmarks and comparisons
|
|
36
|
+
|
|
37
|
+
### 4. External Dependencies Investigation
|
|
38
|
+
**For Each External Service/Library**:
|
|
39
|
+
- Search for official documentation and GitHub repositories
|
|
40
|
+
- Verify API signatures and authentication methods
|
|
41
|
+
- Check version compatibility with existing stack
|
|
42
|
+
- Investigate rate limits and usage constraints
|
|
43
|
+
- Find community resources and known issues
|
|
44
|
+
- Document security considerations
|
|
45
|
+
- Note any gaps requiring implementation investigation
|
|
46
|
+
|
|
47
|
+
### 5. Architecture Pattern & Boundary Analysis
|
|
48
|
+
**Evaluate Architectural Options**:
|
|
49
|
+
- Compare relevant patterns (MVC, Clean, Hexagonal, Event-driven)
|
|
50
|
+
- Assess fit with existing architecture and steering principles
|
|
51
|
+
- Identify domain boundaries and ownership seams required to avoid team conflicts
|
|
52
|
+
- Consider scalability implications and operational concerns
|
|
53
|
+
- Evaluate maintainability and team expertise
|
|
54
|
+
- Document preferred pattern and rejected alternatives in `research.md`
|
|
55
|
+
|
|
56
|
+
### 6. Risk Assessment
|
|
57
|
+
**Identify Technical Risks**:
|
|
58
|
+
- Performance bottlenecks and scaling limits
|
|
59
|
+
- Security vulnerabilities and attack vectors
|
|
60
|
+
- Integration complexity and coupling
|
|
61
|
+
- Technical debt creation vs resolution
|
|
62
|
+
- Knowledge gaps and training needs
|
|
63
|
+
|
|
64
|
+
## Research Guidelines
|
|
65
|
+
|
|
66
|
+
### When to Search
|
|
67
|
+
**Always search for**:
|
|
68
|
+
- External API documentation and updates
|
|
69
|
+
- Security best practices for authentication/authorization
|
|
70
|
+
- Performance optimization techniques for identified bottlenecks
|
|
71
|
+
- Latest versions and migration paths for dependencies
|
|
72
|
+
|
|
73
|
+
**Search if uncertain about**:
|
|
74
|
+
- Architectural patterns for specific use cases
|
|
75
|
+
- Industry standards for data formats/protocols
|
|
76
|
+
- Compliance requirements (GDPR, HIPAA, etc.)
|
|
77
|
+
- Scalability approaches for expected load
|
|
78
|
+
|
|
79
|
+
### Search Strategy
|
|
80
|
+
1. Start with official sources (documentation, GitHub)
|
|
81
|
+
2. Check recent blog posts and articles (last 6 months)
|
|
82
|
+
3. Review Stack Overflow for common issues
|
|
83
|
+
4. Investigate similar open-source implementations
|
|
84
|
+
|
|
85
|
+
## Output Requirements
|
|
86
|
+
Capture all findings that impact design decisions in `research.md` using the shared template:
|
|
87
|
+
- Key insights affecting architecture, technology alignment, and contracts
|
|
88
|
+
- Constraints discovered during research
|
|
89
|
+
- Recommended approaches and selected architecture pattern with rationale
|
|
90
|
+
- Rejected alternatives and trade-offs (documented in the Design Decisions section)
|
|
91
|
+
- Updated domain boundaries that inform Components & Interface Contracts
|
|
92
|
+
- Risks and mitigation strategies
|
|
93
|
+
- Gaps requiring further investigation during implementation
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Light Discovery Process for Extensions
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
Quickly analyze existing system and integration requirements for feature extensions.
|
|
5
|
+
|
|
6
|
+
## Focused Discovery Steps
|
|
7
|
+
|
|
8
|
+
### 1. Extension Point Analysis
|
|
9
|
+
**Identify Integration Approach**:
|
|
10
|
+
- Locate existing extension points or interfaces
|
|
11
|
+
- Determine modification scope (files, components)
|
|
12
|
+
- Check for existing patterns to follow
|
|
13
|
+
- Identify backward compatibility requirements
|
|
14
|
+
|
|
15
|
+
### 2. Dependency Check
|
|
16
|
+
**Verify Compatibility**:
|
|
17
|
+
- Check version compatibility of new dependencies
|
|
18
|
+
- Validate API contracts haven't changed
|
|
19
|
+
- Ensure no breaking changes in pipeline
|
|
20
|
+
|
|
21
|
+
### 3. Quick Technology Verification
|
|
22
|
+
**For New Libraries Only**:
|
|
23
|
+
- Use WebSearch for official documentation
|
|
24
|
+
- Verify basic usage patterns
|
|
25
|
+
- Check for known compatibility issues
|
|
26
|
+
- Confirm licensing compatibility
|
|
27
|
+
- Record key findings in `research.md` (technology alignment section)
|
|
28
|
+
|
|
29
|
+
### 4. Integration Risk Assessment
|
|
30
|
+
**Quick Risk Check**:
|
|
31
|
+
- Impact on existing functionality
|
|
32
|
+
- Performance implications
|
|
33
|
+
- Security considerations
|
|
34
|
+
- Testing requirements
|
|
35
|
+
|
|
36
|
+
## When to Escalate to Full Discovery
|
|
37
|
+
Switch to full discovery if you find:
|
|
38
|
+
- Significant architectural changes needed
|
|
39
|
+
- Complex external service integrations
|
|
40
|
+
- Security-sensitive implementations
|
|
41
|
+
- Performance-critical components
|
|
42
|
+
- Unknown or poorly documented dependencies
|
|
43
|
+
|
|
44
|
+
## Output Requirements
|
|
45
|
+
- Clear integration approach (note boundary impacts in `research.md`)
|
|
46
|
+
- List of files/components to modify
|
|
47
|
+
- New dependencies with versions
|
|
48
|
+
- Integration risks and mitigations
|
|
49
|
+
- Testing focus areas
|