@musashishao/agent-kit 1.6.0 → 1.6.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.
- package/.agent/agents/project-planner.md +22 -2
- package/.agent/rules/CODE_RULES.md +88 -0
- package/.agent/rules/GEMINI.md +35 -177
- package/.agent/rules/MEMORY_STATE.md +62 -0
- package/.agent/rules/REFERENCE.md +71 -0
- package/.agent/skills/app-builder/SKILL.md +10 -7
- package/.agent/skills/spec-writing/SKILL.md +189 -0
- package/.agent/skills/tdd-workflow/SKILL.md +30 -0
- package/.agent/workflows/create.md +16 -6
- package/.agent/workflows/plan.md +8 -8
- package/.agent/workflows/spec.md +189 -0
- package/.agent/workflows/test.md +41 -0
- package/package.json +2 -2
|
@@ -3,13 +3,32 @@ name: project-planner
|
|
|
3
3
|
description: Smart project planning agent. Breaks down user requests into tasks, plans file structure, determines which agent does what, creates dependency graph. Use when starting new projects or planning major features.
|
|
4
4
|
tools: Read, Grep, Glob, Bash
|
|
5
5
|
model: inherit
|
|
6
|
-
skills: clean-code, app-builder, plan-writing, brainstorming
|
|
6
|
+
skills: clean-code, app-builder, plan-writing, brainstorming, spec-writing
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Project Planner - Smart Project Planning
|
|
10
10
|
|
|
11
11
|
You are a project planning expert. You analyze user requests, break them into tasks, and create an executable plan.
|
|
12
12
|
|
|
13
|
+
## 🔴 PHASE -2: SPEC CHECK (BEFORE PLANNING)
|
|
14
|
+
|
|
15
|
+
**Before creating a plan, check for existing Specification:**
|
|
16
|
+
|
|
17
|
+
1. **Search** for `SPEC-*.md` files in project root
|
|
18
|
+
2. **If found:** Read spec and use as input for planning
|
|
19
|
+
3. **If not found + complex request (3+ files):** Redirect to `/spec` first
|
|
20
|
+
4. **If simple request:** Proceed to Phase -1
|
|
21
|
+
|
|
22
|
+
> 🔴 **Rule:** Complex features (3+ files) MUST have a Spec before Plan.
|
|
23
|
+
|
|
24
|
+
| Condition | Action |
|
|
25
|
+
|-----------|--------|
|
|
26
|
+
| `SPEC-*.md` exists | Read spec → Use as planning input |
|
|
27
|
+
| Complex request, no spec | Say: "This is a complex feature. Run `/spec` first." |
|
|
28
|
+
| Simple request (1-2 files) | Proceed directly to Phase -1 |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
13
32
|
## 🛑 PHASE 0: CONTEXT CHECK (QUICK)
|
|
14
33
|
|
|
15
34
|
**Check for existing context before starting:**
|
|
@@ -38,6 +57,7 @@ You are a project planning expert. You analyze user requests, break them into ta
|
|
|
38
57
|
|
|
39
58
|
| If You See | Then |
|
|
40
59
|
|------------|------|
|
|
60
|
+
| `SPEC-*.md` exists | Use spec as planning foundation |
|
|
41
61
|
| "User Request: X" in prompt | Use X as the task, ignore folder name |
|
|
42
62
|
| "Decisions: Y" in prompt | Apply Y without re-asking |
|
|
43
63
|
| Existing plan in workspace | Read and CONTINUE it, don't restart |
|
|
@@ -395,7 +415,7 @@ python .agent/skills/webapp-testing/scripts/playwright_runner.py http://localhos
|
|
|
395
415
|
| 5 | **Rollback** | Every task has recovery path | Tasks fail, prepare for it |
|
|
396
416
|
| 6 | **Context** | Explain WHY not just WHAT | Better agent decisions |
|
|
397
417
|
| 7 | **Risks** | Identify before they happen | Prepared responses |
|
|
398
|
-
| 8 | **DYNAMIC NAMING** |
|
|
418
|
+
| 8 | **DYNAMIC NAMING** | `./{task-slug}.md` | Easy to find, multiple plans OK |
|
|
399
419
|
| 9 | **Milestones** | Each phase ends with working state | Continuous value |
|
|
400
420
|
| 10 | **Phase X** | Verification is ALWAYS final | Definition of done |
|
|
401
421
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# CODE_RULES.md - TIER 1: Code Rules
|
|
6
|
+
|
|
7
|
+
> This module defines coding rules, Socratic Gate, and verification protocols.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 📱 Project Type Routing
|
|
12
|
+
|
|
13
|
+
| Project Type | Primary Agent | Skills |
|
|
14
|
+
|--------------|---------------|--------|
|
|
15
|
+
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
16
|
+
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
17
|
+
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
18
|
+
|
|
19
|
+
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🛑 GLOBAL SOCRATIC GATE
|
|
24
|
+
|
|
25
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
26
|
+
|
|
27
|
+
| Request Type | Strategy | Required Action |
|
|
28
|
+
|--------------|----------|-----------------|
|
|
29
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
30
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
31
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
32
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
33
|
+
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
34
|
+
|
|
35
|
+
**Protocol:**
|
|
36
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
37
|
+
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** before starting.
|
|
38
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
39
|
+
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🏁 Final Checklist Protocol
|
|
44
|
+
|
|
45
|
+
**Trigger:** When the user says "final checks", "run all tests", or similar phrases.
|
|
46
|
+
|
|
47
|
+
| Task Stage | Command | Purpose |
|
|
48
|
+
|------------|---------|---------|
|
|
49
|
+
| **Manual Audit** | `python scripts/checklist.py .` | Priority-based project audit |
|
|
50
|
+
| **Pre-Deploy** | `python scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
51
|
+
|
|
52
|
+
**Priority Execution Order:**
|
|
53
|
+
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
|
54
|
+
|
|
55
|
+
**Rules:**
|
|
56
|
+
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
57
|
+
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🎭 Gemini Mode Mapping
|
|
62
|
+
|
|
63
|
+
| Mode | Agent | Behavior |
|
|
64
|
+
|------|-------|----------|
|
|
65
|
+
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
66
|
+
| **ask** | - | Focus on understanding. Ask questions. |
|
|
67
|
+
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
68
|
+
|
|
69
|
+
**Plan Mode (4-Phase):**
|
|
70
|
+
1. ANALYSIS → Research, questions
|
|
71
|
+
2. PLANNING → `{task-slug}.md`, task breakdown
|
|
72
|
+
3. SOLUTIONING → Architecture, design (NO CODE!)
|
|
73
|
+
4. IMPLEMENTATION → Code + tests
|
|
74
|
+
|
|
75
|
+
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## TIER 2: DESIGN RULES (Reference)
|
|
80
|
+
|
|
81
|
+
> **Design rules are in the specialist agents, NOT here.**
|
|
82
|
+
|
|
83
|
+
| Task | Read |
|
|
84
|
+
|------|------|
|
|
85
|
+
| Web UI/UX | `.agent/frontend-specialist.md` |
|
|
86
|
+
| Mobile UI/UX | `.agent/mobile-developer.md` |
|
|
87
|
+
|
|
88
|
+
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
package/.agent/rules/GEMINI.md
CHANGED
|
@@ -36,7 +36,7 @@ Agent activated → Check frontmatter "skills:" field
|
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## 📥 REQUEST CLASSIFIER (STEP 2)
|
|
40
40
|
|
|
41
41
|
**Before ANY action, classify the request:**
|
|
42
42
|
|
|
@@ -45,9 +45,34 @@ Agent activated → Check frontmatter "skills:" field
|
|
|
45
45
|
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
46
46
|
| **SURVEY/INTEL**| "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
47
47
|
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
48
|
-
| **
|
|
48
|
+
| **SPEC REQUIRED** | "build", "create", "implement" (3+ files) | TIER 0 + SDD Gate | **SPEC-{slug}.md → PLAN-{slug}.md** |
|
|
49
|
+
| **COMPLEX CODE**| "refactor", multi-file changes | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
49
50
|
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
50
|
-
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
|
51
|
+
| **SLASH CMD** | /create, /orchestrate, /debug, /spec | Command-specific flow | Variable |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🔒 SDD GATE (Spec Driven Development)
|
|
56
|
+
|
|
57
|
+
> **For complex features, SPEC before PLAN before CODE.**
|
|
58
|
+
|
|
59
|
+
### When to Trigger SDD Gate
|
|
60
|
+
|
|
61
|
+
| Condition | Action |
|
|
62
|
+
|-----------|--------|
|
|
63
|
+
| New feature with 3+ files | ✅ Run `/spec` first |
|
|
64
|
+
| Architecture changes | ✅ Run `/spec` first |
|
|
65
|
+
| User says "build", "create", "implement" | ✅ Suggest `/spec` |
|
|
66
|
+
| Simple bug fix (1 file) | ❌ Skip, use `/debug` |
|
|
67
|
+
| Single file change | ❌ Skip, direct edit |
|
|
68
|
+
|
|
69
|
+
### SDD Flow
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
/spec → SPEC-{slug}.md → User Approval → /plan → PLAN-{slug}.md → User Approval → /create
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> 🔴 **Rule:** Skipping `/spec` for complex features = suboptimal AI output.
|
|
51
76
|
|
|
52
77
|
---
|
|
53
78
|
|
|
@@ -68,10 +93,6 @@ When user's prompt is NOT in English:
|
|
|
68
93
|
- No verbose explanations
|
|
69
94
|
- No over-commenting
|
|
70
95
|
- No over-engineering
|
|
71
|
-
- **Self-Documentation:** Every agent is responsible for documenting their own changes in relevant `.md` files.
|
|
72
|
-
- **Global Testing Mandate:** Every agent is responsible for writing and running tests for their changes. Follow the "Testing Pyramid" (Unit > Integration > E2E) and the "AAA Pattern" (Arrange, Act, Assert).
|
|
73
|
-
- **Global Performance Mandate:** "Measure first, optimize second." Every agent must ensure their changes adhere to 2025 performance standards (Core Web Vitals for Web, query optimization for DB, bundle limits for FS).
|
|
74
|
-
- **Infrastructure & Safety Mandate:** Every agent is responsible for the deployability and operational safety of their changes. Follow the "5-Phase Deployment Process" (Prepare, Backup, Deploy, Verify, Confirm/Rollback). Always verify environment variables and secrets security.
|
|
75
96
|
|
|
76
97
|
### 📁 File Dependency Awareness
|
|
77
98
|
|
|
@@ -84,12 +105,6 @@ When user's prompt is NOT in English:
|
|
|
84
105
|
|
|
85
106
|
> 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
|
|
86
107
|
|
|
87
|
-
**Path Awareness:**
|
|
88
|
-
- Agents: `.agent/` (Project)
|
|
89
|
-
- Skills: `.agent/skills/` (Project)
|
|
90
|
-
- Runtime Scripts: `.agent/skills/<skill>/scripts/`
|
|
91
|
-
|
|
92
|
-
|
|
93
108
|
### 🧠 Read → Understand → Apply
|
|
94
109
|
|
|
95
110
|
```
|
|
@@ -97,171 +112,14 @@ When user's prompt is NOT in English:
|
|
|
97
112
|
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
|
98
113
|
```
|
|
99
114
|
|
|
100
|
-
**Before coding, answer:**
|
|
101
|
-
1. What is the GOAL of this agent/skill?
|
|
102
|
-
2. What PRINCIPLES must I apply?
|
|
103
|
-
3. How does this DIFFER from generic output?
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## TIER 0.5: MEMORY & STATE (NEW)
|
|
108
|
-
|
|
109
|
-
### 🧠 Persistence Protocol
|
|
110
|
-
|
|
111
|
-
**MANDATORY: You MUST synchronize your state with the JSON Memory system.**
|
|
112
|
-
|
|
113
|
-
1. **Read Task Context:** At the start of any complex task, check `.agent/memory/session.json` and `brain.json`.
|
|
114
|
-
2. **Update Progress:** After completing a significant sub-task, update the session using:
|
|
115
|
-
`python3 .agent/scripts/ak_cli.py memory update-task --task "TaskName" --status "completed"`
|
|
116
|
-
3. **Adaptive UI/UX:**
|
|
117
|
-
- **MANDATORY:** Check `.agent/memory/user.json` for `skill_level`.
|
|
118
|
-
- Adjust your language level (newbie, basic, technical) immediately.
|
|
119
|
-
- Use analogies for newbies, concise code for technical users.
|
|
120
|
-
|
|
121
115
|
---
|
|
122
116
|
|
|
123
|
-
##
|
|
124
|
-
|
|
125
|
-
### 📱 Project Type Routing
|
|
126
|
-
|
|
127
|
-
| Project Type | Primary Agent | Skills |
|
|
128
|
-
|--------------|---------------|--------|
|
|
129
|
-
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
130
|
-
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
131
|
-
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
132
|
-
|
|
133
|
-
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
134
|
-
|
|
135
|
-
### 🛑 Socratic Gate
|
|
136
|
-
|
|
137
|
-
**For complex requests, STOP and ASK first:**
|
|
117
|
+
## 📚 MODULAR RULES (Load as needed)
|
|
138
118
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
**
|
|
142
|
-
|
|
143
|
-
|
|
|
144
|
-
|--------------|----------|-----------------|
|
|
145
|
-
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
146
|
-
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
147
|
-
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
148
|
-
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
149
|
-
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
150
|
-
|
|
151
|
-
**Protocol:**
|
|
152
|
-
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
153
|
-
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
|
154
|
-
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
155
|
-
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
156
|
-
|
|
157
|
-
### 🏁 Final Checklist Protocol
|
|
158
|
-
|
|
159
|
-
**Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.
|
|
160
|
-
|
|
161
|
-
| Task Stage | Command | Purpose |
|
|
162
|
-
|------------|---------|---------|
|
|
163
|
-
| **Manual Audit** | `python scripts/checklist.py .` | Priority-based project audit |
|
|
164
|
-
| **Pre-Deploy** | `python scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
165
|
-
|
|
166
|
-
**Priority Execution Order:**
|
|
167
|
-
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
|
168
|
-
|
|
169
|
-
**Rules:**
|
|
170
|
-
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
171
|
-
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
**Available Scripts (12 total):**
|
|
175
|
-
| Script | Skill | When to Use |
|
|
176
|
-
|--------|-------|-------------|
|
|
177
|
-
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
178
|
-
| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
|
|
179
|
-
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
180
|
-
| `test_runner.py` | testing-patterns | After logic change |
|
|
181
|
-
| `schema_validator.py` | database-design | After DB change |
|
|
182
|
-
| `ux_audit.py` | frontend-design | After UI change |
|
|
183
|
-
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
184
|
-
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
185
|
-
| `bundle_analyzer.py` | performance-profiling | Before deploy |
|
|
186
|
-
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
187
|
-
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
188
|
-
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
189
|
-
|
|
190
|
-
> 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
|
|
191
|
-
|
|
192
|
-
### 🎭 Gemini Mode Mapping
|
|
193
|
-
|
|
194
|
-
| Mode | Agent | Behavior |
|
|
195
|
-
|------|-------|----------|
|
|
196
|
-
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
197
|
-
| **ask** | - | Focus on understanding. Ask questions. |
|
|
198
|
-
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
199
|
-
|
|
200
|
-
**Plan Mode (4-Phase):**
|
|
201
|
-
1. ANALYSIS → Research, questions
|
|
202
|
-
2. PLANNING → `{task-slug}.md`, task breakdown
|
|
203
|
-
3. SOLUTIONING → Architecture, design (NO CODE!)
|
|
204
|
-
4. IMPLEMENTATION → Code + tests
|
|
205
|
-
|
|
206
|
-
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
## TIER 2: DESIGN RULES (Reference)
|
|
211
|
-
|
|
212
|
-
> **Design rules are in the specialist agents, NOT here.**
|
|
213
|
-
|
|
214
|
-
| Task | Read |
|
|
215
|
-
|------|------|
|
|
216
|
-
| Web UI/UX | `.agent/frontend-specialist.md` |
|
|
217
|
-
| Mobile UI/UX | `.agent/mobile-developer.md` |
|
|
218
|
-
|
|
219
|
-
**These agents contain:**
|
|
220
|
-
- Purple Ban (no violet/purple colors)
|
|
221
|
-
- Template Ban (no standard layouts)
|
|
222
|
-
- Anti-cliché rules
|
|
223
|
-
- Deep Design Thinking protocol
|
|
224
|
-
|
|
225
|
-
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
|
226
|
-
|
|
227
|
-
---
|
|
119
|
+
| Module | Path | When to Load |
|
|
120
|
+
|--------|------|--------------|
|
|
121
|
+
| **Memory & State** | `.agent/rules/MEMORY_STATE.md` | Session start, task completion |
|
|
122
|
+
| **Code Rules** | `.agent/rules/CODE_RULES.md` | Writing code, using agents |
|
|
123
|
+
| **Reference** | `.agent/rules/REFERENCE.md` | Looking up agents, skills, scripts |
|
|
228
124
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
### Available Master Agents (8)
|
|
232
|
-
|
|
233
|
-
| Agent | Domain & Focus |
|
|
234
|
-
|-------|----------------|
|
|
235
|
-
| `orchestrator` | Multi-agent coordination and synthesis |
|
|
236
|
-
| `project-planner` | Discovery, Architecture, and Task Planning |
|
|
237
|
-
| `security-auditor` | Master Cybersecurity (Audit + Pentest + Infra Hardening) |
|
|
238
|
-
| `backend-specialist` | Backend Architect (API + Database + Server/Docker Deploy) |
|
|
239
|
-
| `frontend-specialist` | Frontend & Growth (UI/UX + SEO + Edge/Static Deploy) |
|
|
240
|
-
| `mobile-developer` | Mobile Specialist (Cross-platform + Mobile Performance)|
|
|
241
|
-
| `debugger` | Systematic Root Cause Analysis & Bug Fixing |
|
|
242
|
-
| `game-developer` | Specialized Game Logic & Assets & Performance |
|
|
243
|
-
|
|
244
|
-
### Key Skills
|
|
245
|
-
|
|
246
|
-
| Skill | Purpose |
|
|
247
|
-
|-------|---------|
|
|
248
|
-
| `clean-code` | Coding standards (GLOBAL) |
|
|
249
|
-
| `brainstorming` | Socratic questioning |
|
|
250
|
-
| `app-builder` | Full-stack orchestration |
|
|
251
|
-
| `frontend-design` | Web UI patterns |
|
|
252
|
-
| `mobile-design` | Mobile UI patterns |
|
|
253
|
-
| `plan-writing` | {task-slug}.md format |
|
|
254
|
-
| `behavioral-modes` | Mode switching |
|
|
255
|
-
|
|
256
|
-
### Script Locations
|
|
257
|
-
|
|
258
|
-
| Script | Path |
|
|
259
|
-
|--------|------|
|
|
260
|
-
| Full verify | `scripts/verify_all.py` |
|
|
261
|
-
| Security scan | `.agent/skills/vulnerability-scanner/scripts/security_scan.py` |
|
|
262
|
-
| UX audit | `.agent/skills/frontend-design/scripts/ux_audit.py` |
|
|
263
|
-
| Mobile audit | `.agent/skills/mobile-design/scripts/mobile_audit.py` |
|
|
264
|
-
| Lighthouse | `.agent/skills/performance-profiling/scripts/lighthouse_audit.py` |
|
|
265
|
-
| Playwright | `.agent/skills/webapp-testing/scripts/playwright_runner.py` |
|
|
266
|
-
|
|
267
|
-
---
|
|
125
|
+
> 🔴 **Load modules selectively** based on current task. Do not load all at once.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# MEMORY_STATE.md - TIER 0.5: Memory & State
|
|
6
|
+
|
|
7
|
+
> This module defines memory persistence, session summaries, and ADR protocols.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🧠 Persistence Protocol
|
|
12
|
+
|
|
13
|
+
**MANDATORY: You MUST synchronize your state with the JSON Memory system.**
|
|
14
|
+
|
|
15
|
+
1. **Read Task Context:** At the start of any complex task, check `.agent/memory/session.json` and `brain.json`.
|
|
16
|
+
2. **Update Progress:** After completing a significant sub-task, update the session using:
|
|
17
|
+
`python3 .agent/scripts/ak_cli.py memory update-task --task "TaskName" --status "completed"`
|
|
18
|
+
3. **Adaptive UI/UX:**
|
|
19
|
+
- **MANDATORY:** Check `.agent/memory/user.json` for `skill_level`.
|
|
20
|
+
- Adjust your language level (newbie, basic, technical) immediately.
|
|
21
|
+
- Use analogies for newbies, concise code for technical users.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📝 Session Summary Protocol
|
|
26
|
+
|
|
27
|
+
**Purpose:** Reduce token usage by maintaining concise session checkpoints.
|
|
28
|
+
|
|
29
|
+
1. **At Session Start:** Read `.agent/memory/SESSION_SUMMARY.md` to understand recent context.
|
|
30
|
+
2. **After Task Completion:** Append a short summary (~50-100 words) to the file:
|
|
31
|
+
```markdown
|
|
32
|
+
## Latest Session
|
|
33
|
+
**Date:** [YYYY-MM-DD]
|
|
34
|
+
**Task:** [Task Name]
|
|
35
|
+
**Summary:** [1-2 sentences of what was accomplished]
|
|
36
|
+
**Files Modified:** [list of key files]
|
|
37
|
+
```
|
|
38
|
+
3. **Benefits:**
|
|
39
|
+
- New sessions start with minimal but sufficient context.
|
|
40
|
+
- Reduces "lost in the middle" phenomenon.
|
|
41
|
+
- Saves tokens on long projects.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 📜 ADR Protocol (Architecture Decision Records)
|
|
46
|
+
|
|
47
|
+
**Purpose:** Preserve decision history for long-term project maintainability.
|
|
48
|
+
|
|
49
|
+
**When to Create an ADR:**
|
|
50
|
+
| Trigger | Example |
|
|
51
|
+
|---------|---------|
|
|
52
|
+
| Tech stack selection | "Using Prisma instead of Drizzle" |
|
|
53
|
+
| Architecture pattern choice | "Choosing microservices over monolith" |
|
|
54
|
+
| Major library decision | "Selecting Tailwind over styled-components" |
|
|
55
|
+
|
|
56
|
+
**How to Create:**
|
|
57
|
+
1. Copy `.agent/adr/ADR-TEMPLATE.md`
|
|
58
|
+
2. Rename to `ADR-XXX-short-slug.md` (auto-increment number)
|
|
59
|
+
3. Fill in: Context, Options, Decision, Consequences
|
|
60
|
+
4. Set Status to `Accepted`
|
|
61
|
+
|
|
62
|
+
**Directory:** `.agent/adr/`
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# REFERENCE.md - Quick Reference
|
|
6
|
+
|
|
7
|
+
> This module contains lookup tables for agents, skills, and scripts.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Available Master Agents (8)
|
|
12
|
+
|
|
13
|
+
| Agent | Domain & Focus |
|
|
14
|
+
|-------|----------------|
|
|
15
|
+
| `orchestrator` | Multi-agent coordination and synthesis |
|
|
16
|
+
| `project-planner` | Discovery, Architecture, and Task Planning |
|
|
17
|
+
| `security-auditor` | Master Cybersecurity (Audit + Pentest + Infra Hardening) |
|
|
18
|
+
| `backend-specialist` | Backend Architect (API + Database + Server/Docker Deploy) |
|
|
19
|
+
| `frontend-specialist` | Frontend & Growth (UI/UX + SEO + Edge/Static Deploy) |
|
|
20
|
+
| `mobile-developer` | Mobile Specialist (Cross-platform + Mobile Performance)|
|
|
21
|
+
| `debugger` | Systematic Root Cause Analysis & Bug Fixing |
|
|
22
|
+
| `game-developer` | Specialized Game Logic & Assets & Performance |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Key Skills
|
|
27
|
+
|
|
28
|
+
| Skill | Purpose |
|
|
29
|
+
|-------|---------|
|
|
30
|
+
| `clean-code` | Coding standards (GLOBAL) |
|
|
31
|
+
| `brainstorming` | Socratic questioning |
|
|
32
|
+
| `spec-writing` | SPEC-{slug}.md format (SDD) |
|
|
33
|
+
| `plan-writing` | PLAN-{slug}.md format |
|
|
34
|
+
| `app-builder` | Full-stack orchestration |
|
|
35
|
+
| `frontend-design` | Web UI patterns |
|
|
36
|
+
| `mobile-design` | Mobile UI patterns |
|
|
37
|
+
| `behavioral-modes` | Mode switching |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Available Scripts (12 total)
|
|
42
|
+
|
|
43
|
+
| Script | Skill | When to Use |
|
|
44
|
+
|--------|-------|-------------|
|
|
45
|
+
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
46
|
+
| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
|
|
47
|
+
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
48
|
+
| `test_runner.py` | testing-patterns | After logic change |
|
|
49
|
+
| `schema_validator.py` | database-design | After DB change |
|
|
50
|
+
| `ux_audit.py` | frontend-design | After UI change |
|
|
51
|
+
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
52
|
+
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
53
|
+
| `bundle_analyzer.py` | performance-profiling | Before deploy |
|
|
54
|
+
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
55
|
+
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
56
|
+
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
57
|
+
|
|
58
|
+
> 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Script Locations
|
|
63
|
+
|
|
64
|
+
| Script | Path |
|
|
65
|
+
|--------|------|
|
|
66
|
+
| Full verify | `scripts/verify_all.py` |
|
|
67
|
+
| Security scan | `.agent/skills/vulnerability-scanner/scripts/security_scan.py` |
|
|
68
|
+
| UX audit | `.agent/skills/frontend-design/scripts/ux_audit.py` |
|
|
69
|
+
| Mobile audit | `.agent/skills/mobile-design/scripts/mobile_audit.py` |
|
|
70
|
+
| Lighthouse | `.agent/skills/performance-profiling/scripts/lighthouse_audit.py` |
|
|
71
|
+
| Playwright | `.agent/skills/webapp-testing/scripts/playwright_runner.py` |
|
|
@@ -95,20 +95,23 @@ python .agent/skills/app-builder/scripts/generate_ai_infra.py --project-root . -
|
|
|
95
95
|
User: "Make an Instagram clone with photo sharing and likes"
|
|
96
96
|
|
|
97
97
|
App Builder Process:
|
|
98
|
-
1.
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
1. **Quality Gate** ⭐ NEW
|
|
99
|
+
├─ Check Approved SPEC-*.md
|
|
100
|
+
└─ Check PLAN-*.md and Test Plan
|
|
101
|
+
2. Project type: Social Media App
|
|
102
|
+
3. Tech stack: Next.js + Prisma + Cloudinary + Clerk
|
|
103
|
+
4. Create plan:
|
|
101
104
|
├─ Database schema (users, posts, likes, follows)
|
|
102
105
|
├─ API routes (12 endpoints)
|
|
103
106
|
├─ Pages (feed, profile, upload)
|
|
104
107
|
└─ Components (PostCard, Feed, LikeButton)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
5. Coordinate agents
|
|
109
|
+
6. Report progress
|
|
110
|
+
7. **Generate AI Infrastructure** ⭐
|
|
108
111
|
├─ AGENTS.md (auto-detected stack)
|
|
109
112
|
├─ .agent/graph.json (dependencies)
|
|
110
113
|
└─ .agent/rag/ (ready for indexing)
|
|
111
|
-
|
|
114
|
+
8. Start preview
|
|
112
115
|
```
|
|
113
116
|
|
|
114
117
|
---
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-writing
|
|
3
|
+
description: Specification writing principles for SDD workflow. How to write clear, testable specs that guide AI implementation. Use when creating feature specifications before planning.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Spec Writing Skill
|
|
8
|
+
|
|
9
|
+
> Write specifications that eliminate ambiguity and enable precise AI implementation.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Core Principles
|
|
14
|
+
|
|
15
|
+
| Principle | Meaning |
|
|
16
|
+
|-----------|---------|
|
|
17
|
+
| **Problem-First** | Understand the problem before describing the solution |
|
|
18
|
+
| **User-Centric** | Every feature connects to a user need |
|
|
19
|
+
| **Testable** | Every requirement can be verified |
|
|
20
|
+
| **Bounded** | Explicit about what's in/out of scope |
|
|
21
|
+
| **Minimal** | Only include what's necessary to implement |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## The 5 Mandatory Sections
|
|
26
|
+
|
|
27
|
+
### 1. Problem Statement
|
|
28
|
+
**Purpose:** Why does this feature exist?
|
|
29
|
+
|
|
30
|
+
| ✅ Good | ❌ Bad |
|
|
31
|
+
|---------|--------|
|
|
32
|
+
| "Users cannot reset their password without contacting support, causing 50+ support tickets/week" | "We need password reset" |
|
|
33
|
+
| "Mobile users abandon checkout 40% more than desktop due to form complexity" | "Improve mobile checkout" |
|
|
34
|
+
|
|
35
|
+
**Format:** 1-2 paragraphs with measurable problem (if available).
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### 2. User Stories
|
|
40
|
+
**Purpose:** Who needs this and why?
|
|
41
|
+
|
|
42
|
+
**Format:**
|
|
43
|
+
```
|
|
44
|
+
As a [user type]
|
|
45
|
+
I want to [action]
|
|
46
|
+
So that [benefit/outcome]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Rules:**
|
|
50
|
+
- Maximum 5 user stories per spec
|
|
51
|
+
- Each story must have a clear benefit
|
|
52
|
+
- Prioritize: Must-have > Should-have > Nice-to-have
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### 3. Acceptance Criteria
|
|
57
|
+
**Purpose:** How do we know it's done?
|
|
58
|
+
|
|
59
|
+
| ✅ Testable | ❌ Vague |
|
|
60
|
+
|-------------|----------|
|
|
61
|
+
| "User receives password reset email within 60 seconds" | "Email should be fast" |
|
|
62
|
+
| "Form validates email format before submission" | "Form should validate properly" |
|
|
63
|
+
| "Button is disabled until all required fields are filled" | "Good UX" |
|
|
64
|
+
|
|
65
|
+
**Format:** Table with ID, criterion, and testability confirmation.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### 4. Out of Scope
|
|
70
|
+
**Purpose:** Prevent scope creep and wasted effort.
|
|
71
|
+
|
|
72
|
+
**Include:**
|
|
73
|
+
- Features explicitly NOT being built
|
|
74
|
+
- Edge cases NOT being handled
|
|
75
|
+
- Platforms NOT being supported
|
|
76
|
+
- Future enhancements deferred
|
|
77
|
+
|
|
78
|
+
**Example:**
|
|
79
|
+
```markdown
|
|
80
|
+
## Out of Scope
|
|
81
|
+
- Social login (OAuth) - will be separate feature
|
|
82
|
+
- Password strength meter - nice-to-have for v2
|
|
83
|
+
- SMS-based reset - only email for MVP
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### 5. Technical Constraints
|
|
89
|
+
**Purpose:** Guardrails for implementation.
|
|
90
|
+
|
|
91
|
+
**Include if relevant:**
|
|
92
|
+
- Must integrate with existing system X
|
|
93
|
+
- Must support browser Y
|
|
94
|
+
- Must not exceed budget Z
|
|
95
|
+
- Must use technology A (if mandated)
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Spec Writing Process
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
1. Receive request
|
|
103
|
+
│
|
|
104
|
+
▼
|
|
105
|
+
2. Ask Socratic questions (minimum 3)
|
|
106
|
+
│
|
|
107
|
+
▼
|
|
108
|
+
3. Draft Problem Statement
|
|
109
|
+
│
|
|
110
|
+
▼
|
|
111
|
+
4. Write User Stories
|
|
112
|
+
│
|
|
113
|
+
▼
|
|
114
|
+
5. Define Acceptance Criteria (MUST be testable)
|
|
115
|
+
│
|
|
116
|
+
▼
|
|
117
|
+
6. List Out of Scope items
|
|
118
|
+
│
|
|
119
|
+
▼
|
|
120
|
+
7. Note Technical Constraints
|
|
121
|
+
│
|
|
122
|
+
▼
|
|
123
|
+
8. Create SPEC-{slug}.md file
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Socratic Questions for Spec Writing
|
|
129
|
+
|
|
130
|
+
Use `@[skills/brainstorming]` for dynamic question generation. Key areas:
|
|
131
|
+
|
|
132
|
+
| Area | Example Questions |
|
|
133
|
+
|------|-------------------|
|
|
134
|
+
| **Users** | Who are the primary users? What's their technical level? |
|
|
135
|
+
| **Scale** | How many users? How often will they use this? |
|
|
136
|
+
| **Integration** | What existing systems must this work with? |
|
|
137
|
+
| **Edge Cases** | What happens if X fails? What about offline users? |
|
|
138
|
+
| **Success** | How will we measure if this feature is successful? |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Anti-Patterns (Avoid)
|
|
143
|
+
|
|
144
|
+
| Anti-Pattern | Problem | Fix |
|
|
145
|
+
|--------------|---------|-----|
|
|
146
|
+
| **Solutioning in Spec** | Spec describes HOW, not WHAT | Remove implementation details |
|
|
147
|
+
| **Vague Criteria** | "Should be fast" is not testable | Add numbers: "< 200ms response" |
|
|
148
|
+
| **Missing Scope** | No out-of-scope section | Always define boundaries |
|
|
149
|
+
| **Feature Creep** | Spec grows during implementation | Lock spec before planning |
|
|
150
|
+
| **No User Stories** | Features without user context | Connect every feature to a user need |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Spec vs Plan vs Implementation
|
|
155
|
+
|
|
156
|
+
| Document | Answers | Contains |
|
|
157
|
+
|----------|---------|----------|
|
|
158
|
+
| **SPEC** | WHAT and WHY | Requirements, criteria, constraints |
|
|
159
|
+
| **PLAN** | HOW and WHO | Tasks, agents, file structure |
|
|
160
|
+
| **CODE** | THE THING | Actual implementation |
|
|
161
|
+
|
|
162
|
+
> 🔴 **Rule:** Spec contains NO code, NO file structure, NO implementation details.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Quality Checklist
|
|
167
|
+
|
|
168
|
+
Before finalizing spec, verify:
|
|
169
|
+
|
|
170
|
+
- [ ] Problem is clearly stated with measurable impact
|
|
171
|
+
- [ ] All user stories have clear benefits
|
|
172
|
+
- [ ] Every acceptance criterion is testable
|
|
173
|
+
- [ ] Out of scope section exists and is explicit
|
|
174
|
+
- [ ] No implementation details leaked into spec
|
|
175
|
+
- [ ] Spec is approved by user before planning
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Integration with Agent Kit
|
|
180
|
+
|
|
181
|
+
**Workflow:**
|
|
182
|
+
```
|
|
183
|
+
/spec → SPEC-{slug}.md → User Review → /plan → PLAN-{slug}.md → /create
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Related Skills:**
|
|
187
|
+
- `brainstorming` - Question generation
|
|
188
|
+
- `plan-writing` - Creating task breakdowns
|
|
189
|
+
- `clean-code` - Implementation standards
|
|
@@ -144,6 +144,36 @@ Every test follows:
|
|
|
144
144
|
| Agent B | Implement to pass (GREEN) |
|
|
145
145
|
| Agent C | Optimize (REFACTOR) |
|
|
146
146
|
|
|
147
|
+
### Red-Phase Automation ⭐ NEW
|
|
148
|
+
|
|
149
|
+
When triggered via `/test red [feature]`:
|
|
150
|
+
|
|
151
|
+
1. **Read** `SPEC-[feature].md` to extract acceptance criteria.
|
|
152
|
+
2. **Generate** a test file targeting the *behavior* not implementation.
|
|
153
|
+
3. **Run** the test and ensure it **FAILS**.
|
|
154
|
+
|
|
155
|
+
#### Failing Test Template
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
// tests/[feature].test.ts
|
|
159
|
+
import { describe, it, expect, vi } from 'vitest'; // or jest
|
|
160
|
+
|
|
161
|
+
describe('[Feature Name]', () => {
|
|
162
|
+
it('should [acceptance criteria 1] - RED PHASE', () => {
|
|
163
|
+
// Arrange
|
|
164
|
+
const input = { /* mock data from SPEC */ };
|
|
165
|
+
|
|
166
|
+
// Act
|
|
167
|
+
const result = featureFunction(input); // Function doesn't exist yet!
|
|
168
|
+
|
|
169
|
+
// Assert
|
|
170
|
+
expect(result).toBeDefined(); // Will fail: function not implemented
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> 🔴 **Remember:** If this test passes on first run, something is wrong.
|
|
176
|
+
|
|
147
177
|
---
|
|
148
178
|
|
|
149
179
|
> **Remember:** The test is the specification. If you can't write a test, you don't understand the requirement.
|
|
@@ -14,24 +14,34 @@ This command starts a new application creation process with **AI-Ready Infrastru
|
|
|
14
14
|
|
|
15
15
|
### Steps:
|
|
16
16
|
|
|
17
|
-
1. **
|
|
17
|
+
1. **Phase 0: Quality Gate** ⭐
|
|
18
|
+
- **SDD Check**: Ensure `SPEC-*.md` exists and is marked as `Approved` for complex features (3+ files).
|
|
19
|
+
- **SDD Check**: Ensure `PLAN-*.md` exists and aligns with the Spec.
|
|
20
|
+
- **TDD Red-Phase Check** ⭐ NEW:
|
|
21
|
+
1. Generate at least 1 failing test based on the approved Spec (e.g., `tests/[feature].test.ts`).
|
|
22
|
+
2. Run the test: `npm test` or equivalent.
|
|
23
|
+
3. Verify the test **FAILS** (exit code != 0).
|
|
24
|
+
4. **If test passes or doesn't exist**: **HALT** and notify user. The test must fail first (RED phase) to ensure the Spec is correctly understood.
|
|
25
|
+
- **Action**: If missing, REDIRECT to `/spec`, `/plan`, or `/test red [feature]` before proceeding.
|
|
26
|
+
|
|
27
|
+
2. **Request Analysis**
|
|
18
28
|
- Understand what the user wants
|
|
19
29
|
- If information is missing, use `brainstorming` skill to ask clarifying questions
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
3. **Project Planning**
|
|
22
32
|
- Use `project-planner` agent for task breakdown
|
|
23
33
|
- Determine tech stack
|
|
24
34
|
- Plan file structure
|
|
25
35
|
- Create plan file and proceed to building
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
4. **Application Building (After Approval)**
|
|
28
38
|
- Orchestrate with `app-builder` skill
|
|
29
39
|
- Coordinate expert agents:
|
|
30
40
|
- `database-architect` → Schema
|
|
31
41
|
- `backend-specialist` → API
|
|
32
42
|
- `frontend-specialist` → UI
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
5. **AI Infrastructure Setup** ⭐
|
|
35
45
|
- Generate `AGENTS.md` using `documentation-templates/agents-template.md`
|
|
36
46
|
- Create `.agent/` directory structure:
|
|
37
47
|
```
|
|
@@ -44,7 +54,7 @@ This command starts a new application creation process with **AI-Ready Infrastru
|
|
|
44
54
|
- Run `graph-mapper` script to generate initial dependency graph
|
|
45
55
|
- Configure `.cursor/mcp.json` or equivalent for MCP servers
|
|
46
56
|
|
|
47
|
-
|
|
57
|
+
6. **Preview & Self-Healing Verification** ⭐
|
|
48
58
|
- Run initial tests or build command.
|
|
49
59
|
- If fail: Activate `self-healing` protocol to fix errors autonomously.
|
|
50
60
|
- Start with `auto_preview.py` once verified.
|
|
@@ -56,7 +66,7 @@ This command starts a new application creation process with **AI-Ready Infrastru
|
|
|
56
66
|
|
|
57
67
|
After building the application, automatically generate:
|
|
58
68
|
|
|
59
|
-
### Step
|
|
69
|
+
### Step 5.1: Generate AGENTS.md
|
|
60
70
|
|
|
61
71
|
Create `AGENTS.md` in project root with:
|
|
62
72
|
- Project name and status
|
package/.agent/workflows/plan.md
CHANGED
|
@@ -25,7 +25,7 @@ Use the `project-planner` agent with this context:
|
|
|
25
25
|
CONTEXT:
|
|
26
26
|
- User Request: $ARGUMENTS
|
|
27
27
|
- Mode: PLANNING ONLY (no code)
|
|
28
|
-
- Output:
|
|
28
|
+
- Output: ./{task-slug}.md (dynamic naming)
|
|
29
29
|
|
|
30
30
|
NAMING RULES:
|
|
31
31
|
1. Extract 2-3 key words from request
|
|
@@ -47,7 +47,7 @@ RULES:
|
|
|
47
47
|
|
|
48
48
|
| Deliverable | Location |
|
|
49
49
|
|-------------|----------|
|
|
50
|
-
| Project Plan |
|
|
50
|
+
| Project Plan | `./{task-slug}.md` |
|
|
51
51
|
| Task Breakdown | Inside plan file |
|
|
52
52
|
| Agent Assignments | Inside plan file |
|
|
53
53
|
| Verification Checklist | Phase X in plan file |
|
|
@@ -58,7 +58,7 @@ RULES:
|
|
|
58
58
|
|
|
59
59
|
Tell user:
|
|
60
60
|
```
|
|
61
|
-
[OK] Plan created:
|
|
61
|
+
[OK] Plan created: ./{slug}.md
|
|
62
62
|
|
|
63
63
|
Next steps:
|
|
64
64
|
- Review the plan
|
|
@@ -72,11 +72,11 @@ Next steps:
|
|
|
72
72
|
|
|
73
73
|
| Request | Plan File |
|
|
74
74
|
|---------|-----------|
|
|
75
|
-
| `/plan e-commerce site with cart` |
|
|
76
|
-
| `/plan mobile app for fitness` |
|
|
77
|
-
| `/plan add dark mode feature` |
|
|
78
|
-
| `/plan fix authentication bug` |
|
|
79
|
-
| `/plan SaaS dashboard` |
|
|
75
|
+
| `/plan e-commerce site with cart` | `./ecommerce-cart.md` |
|
|
76
|
+
| `/plan mobile app for fitness` | `./fitness-app.md` |
|
|
77
|
+
| `/plan add dark mode feature` | `./dark-mode.md` |
|
|
78
|
+
| `/plan fix authentication bug` | `./login-fix.md` |
|
|
79
|
+
| `/plan SaaS dashboard` | `./saas-dashboard.md` |
|
|
80
80
|
|
|
81
81
|
---
|
|
82
82
|
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate specification document before planning. Use for complex features requiring clear requirements before implementation.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /spec - Specification Writing Mode
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🔴 CRITICAL RULES
|
|
12
|
+
|
|
13
|
+
1. **NO CODE WRITING** - This command creates specification file only
|
|
14
|
+
2. **Socratic Gate** - Ask clarifying questions before writing spec
|
|
15
|
+
3. **Dynamic Naming** - Spec file named based on feature
|
|
16
|
+
4. **User Approval Required** - Spec must be approved before `/plan`
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
|
|
22
|
+
Create a clear, testable specification document that serves as the "source of truth" for AI agents during implementation. This prevents "vibe-coding" and ensures alignment between user intent and code output.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## When to Use
|
|
27
|
+
|
|
28
|
+
| Scenario | Use `/spec`? |
|
|
29
|
+
|----------|--------------|
|
|
30
|
+
| New feature with 3+ files | ✅ YES |
|
|
31
|
+
| Architecture changes | ✅ YES |
|
|
32
|
+
| Complex business logic | ✅ YES |
|
|
33
|
+
| Simple bug fix | ❌ NO (use `/debug`) |
|
|
34
|
+
| Single file change | ❌ NO (direct edit) |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Task
|
|
39
|
+
|
|
40
|
+
Use the `spec-writing` skill with this context:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
CONTEXT:
|
|
44
|
+
- User Request: $ARGUMENTS
|
|
45
|
+
- Mode: SPECIFICATION ONLY (no code, no plan)
|
|
46
|
+
- Output: SPEC-{feature-slug}.md (project root)
|
|
47
|
+
|
|
48
|
+
NAMING RULES:
|
|
49
|
+
1. Extract 2-3 key words from request
|
|
50
|
+
2. Lowercase, hyphen-separated
|
|
51
|
+
3. Max 30 characters
|
|
52
|
+
4. Example: "OAuth authentication" → SPEC-oauth-auth.md
|
|
53
|
+
|
|
54
|
+
MANDATORY SECTIONS:
|
|
55
|
+
1. Problem Statement (What problem are we solving?)
|
|
56
|
+
2. User Stories / Use Cases (Who uses this and how?)
|
|
57
|
+
3. Acceptance Criteria (Measurable, testable requirements)
|
|
58
|
+
4. Out of Scope (What we are NOT doing)
|
|
59
|
+
5. Technical Constraints (If any)
|
|
60
|
+
|
|
61
|
+
RULES:
|
|
62
|
+
1. Use @[skills/brainstorming] for question generation
|
|
63
|
+
2. Ask minimum 3 clarifying questions before writing
|
|
64
|
+
3. Each acceptance criterion must be testable
|
|
65
|
+
4. DO NOT write implementation details
|
|
66
|
+
5. REPORT the exact file name created
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Output Format
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
# SPEC: [Feature Name]
|
|
75
|
+
|
|
76
|
+
> Generated: [Date]
|
|
77
|
+
> Status: Draft | Approved
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Problem Statement
|
|
82
|
+
|
|
83
|
+
[1-2 paragraphs describing the problem this feature solves]
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## User Stories
|
|
88
|
+
|
|
89
|
+
### US-1: [Story Title]
|
|
90
|
+
**As a** [user type]
|
|
91
|
+
**I want to** [action]
|
|
92
|
+
**So that** [benefit]
|
|
93
|
+
|
|
94
|
+
### US-2: [Story Title]
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Acceptance Criteria
|
|
100
|
+
|
|
101
|
+
| ID | Criterion | Testable? |
|
|
102
|
+
|----|-----------|-----------|
|
|
103
|
+
| AC-1 | [Specific, measurable requirement] | ✅ |
|
|
104
|
+
| AC-2 | [Specific, measurable requirement] | ✅ |
|
|
105
|
+
| AC-3 | [Specific, measurable requirement] | ✅ |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Out of Scope
|
|
110
|
+
|
|
111
|
+
- [Feature/capability explicitly NOT included]
|
|
112
|
+
- [Another exclusion]
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Technical Constraints
|
|
117
|
+
|
|
118
|
+
| Constraint | Reason |
|
|
119
|
+
|------------|--------|
|
|
120
|
+
| [e.g., Must use existing auth system] | [Why] |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Open Questions
|
|
125
|
+
|
|
126
|
+
- [ ] [Any unresolved questions for user]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Expected Output
|
|
132
|
+
|
|
133
|
+
| Deliverable | Location |
|
|
134
|
+
|-------------|----------|
|
|
135
|
+
| Specification | `./SPEC-{feature-slug}.md` |
|
|
136
|
+
| User Stories | Inside spec file |
|
|
137
|
+
| Acceptance Criteria | Inside spec file |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## After Specification
|
|
142
|
+
|
|
143
|
+
Tell user:
|
|
144
|
+
```
|
|
145
|
+
✅ Spec created: SPEC-{slug}.md
|
|
146
|
+
|
|
147
|
+
Next steps:
|
|
148
|
+
1. Review the specification
|
|
149
|
+
2. Mark status as "Approved" if correct
|
|
150
|
+
3. Run `/plan` to create implementation plan
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Naming Examples
|
|
156
|
+
|
|
157
|
+
| Request | Spec File |
|
|
158
|
+
|---------|-----------|
|
|
159
|
+
| `/spec OAuth authentication with Google` | `SPEC-oauth-google.md` |
|
|
160
|
+
| `/spec shopping cart with checkout` | `SPEC-cart-checkout.md` |
|
|
161
|
+
| `/spec real-time notifications` | `SPEC-realtime-notif.md` |
|
|
162
|
+
| `/spec admin dashboard` | `SPEC-admin-dashboard.md` |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## SDD Flow Overview
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
170
|
+
│ /spec │ ──► │ /plan │ ──► │ /create │
|
|
171
|
+
│ (WHAT) │ │ (HOW) │ │ (DO) │
|
|
172
|
+
└─────────────┘ └─────────────┘ └─────────────┘
|
|
173
|
+
│ │ │
|
|
174
|
+
▼ ▼ ▼
|
|
175
|
+
SPEC-*.md PLAN-*.md Code Files
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
> 🔴 **Rule:** Complex features MUST follow this flow. Skipping `/spec` for complex features = suboptimal results.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Usage
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
/spec OAuth authentication with Google
|
|
186
|
+
/spec shopping cart with Stripe checkout
|
|
187
|
+
/spec real-time chat with WebSocket
|
|
188
|
+
/spec admin dashboard with analytics
|
|
189
|
+
```
|
package/.agent/workflows/test.md
CHANGED
|
@@ -21,6 +21,7 @@ This command generates tests, runs existing tests, or checks test coverage.
|
|
|
21
21
|
/test [file/feature] - Generate tests for specific target
|
|
22
22
|
/test coverage - Show test coverage report
|
|
23
23
|
/test watch - Run tests in watch mode
|
|
24
|
+
/test red [feature] - 🔴 RED Phase: Generate & run a failing test (TDD Enforcer)
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
---
|
|
@@ -100,6 +101,7 @@ Total: 15 tests (14 passed, 1 failed)
|
|
|
100
101
|
/test user registration flow
|
|
101
102
|
/test coverage
|
|
102
103
|
/test fix failed tests
|
|
104
|
+
/test red checkout-flow # 🔴 Generate failing test for checkout
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
---
|
|
@@ -142,3 +144,42 @@ describe('AuthService', () => {
|
|
|
142
144
|
- **Descriptive test names**
|
|
143
145
|
- **Arrange-Act-Assert pattern**
|
|
144
146
|
- **Mock external dependencies**
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🔴 Red-Phase TDD Enforcer
|
|
151
|
+
|
|
152
|
+
When `/test red [feature]` is triggered:
|
|
153
|
+
|
|
154
|
+
1. **Analyze the approved SPEC-*.md** for the feature
|
|
155
|
+
2. **Generate a failing test stub** based on acceptance criteria
|
|
156
|
+
3. **Run the test** and capture output
|
|
157
|
+
4. **Verify failure**: Exit code MUST be != 0
|
|
158
|
+
|
|
159
|
+
### Expected Output
|
|
160
|
+
```
|
|
161
|
+
🔴 RED PHASE: checkout-flow
|
|
162
|
+
|
|
163
|
+
Generating failing test for: checkout-flow
|
|
164
|
+
Based on: SPEC-checkout.md
|
|
165
|
+
|
|
166
|
+
📝 Created: tests/checkout.test.ts
|
|
167
|
+
|
|
168
|
+
Running test...
|
|
169
|
+
❌ FAIL checkout › should calculate total with discount
|
|
170
|
+
Error: Function not implemented
|
|
171
|
+
|
|
172
|
+
✅ RED PHASE COMPLETE
|
|
173
|
+
Test failed as expected. Ready for GREEN phase.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### If Test Passes (Error!)
|
|
177
|
+
```
|
|
178
|
+
⚠️ RED PHASE FAILED
|
|
179
|
+
|
|
180
|
+
The test passed, which means either:
|
|
181
|
+
1. The feature already exists (no work needed)
|
|
182
|
+
2. The test is incorrect (doesn't reflect Spec)
|
|
183
|
+
|
|
184
|
+
Action: Review the test and Spec before proceeding.
|
|
185
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@musashishao/agent-kit",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "AI Agent templates - Skills, Agents, Workflows, and AI-Ready Data Infrastructure Gateway",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=16.0.0"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|