ai-sprint-kit 1.1.1 → 1.1.7

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/LICENSE ADDED
@@ -0,0 +1,135 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Apiasak Pungpapong (https://github.com/apiasak)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.
132
+
133
+ ---
134
+
135
+ Required Notice: Copyright 2025 Apiasak Pungpapong (https://github.com/apiasak)
package/README.md CHANGED
@@ -1,301 +1,239 @@
1
1
  # AI Sprint Kit
2
2
 
3
- **One-command installer for Claude Code autonomous development framework**
3
+ [English](./README.md) | [ภาษาไทย](./README-th.md)
4
4
 
5
- > **Package name:** `ai-sprint-kit` | **CLI command:** `ai-sprint`
5
+ [![npm version](https://img.shields.io/npm/v/ai-sprint-kit.svg)](https://www.npmjs.com/package/ai-sprint-kit)
6
+ [![License: PolyForm Noncommercial](https://img.shields.io/badge/License-PolyForm%20Noncommercial-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
7
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
6
8
 
7
- ## Features
8
-
9
- - 🤖 **9 Specialized Agents** - Planner, Implementer, Tester, Reviewer, Security, DevOps, Docs, Debugger, Researcher
10
- - ⚡ **11 Essential Commands** - `/plan`, `/code`, `/test`, `/review`, `/secure`, `/deploy`, `/docs`, `/debug`, `/scan`, `/validate`, `/auto`
11
- - 🔒 **Security-First** - Built-in SAST, secret detection, dependency scanning
12
- - 🚀 **Production-Ready** - OWASP Top 10 compliance, security best practices
13
- - 🎯 **Autonomous** - Full development cycle with human-in-the-loop gates
14
- - 🧠 **Context Engineering** - Memory system for learning across sessions
15
- - 📁 **Codebase Scanning** - Auto-scan existing code with 70% token compression
16
- - 📊 **Custom Statusline** - Real-time context, cost, and session tracking
17
-
18
- ## Installation
19
-
20
- ### Quick Start (Recommended)
9
+ > **Transform Claude Code into an autonomous development powerhouse with one command.**
21
10
 
22
11
  ```bash
23
12
  npx ai-sprint-kit init
24
13
  ```
25
14
 
26
- ### Global Installation
15
+ ---
27
16
 
28
- ```bash
29
- npm install -g ai-sprint-kit
30
- ai-sprint init
31
- ```
17
+ ## Why AI Sprint Kit?
32
18
 
33
- ### Options
19
+ Most developers use Claude Code for simple Q&A. **AI Sprint Kit** unlocks its full potential:
34
20
 
35
- ```bash
36
- # Install in specific directory
37
- npx ai-sprint-kit init --dir /path/to/project
21
+ | Without AI Sprint | With AI Sprint Kit |
22
+ |-------------------|-------------------|
23
+ | Manual prompting | Autonomous workflows |
24
+ | No memory between sessions | Persistent learning & decisions |
25
+ | Generic responses | Security-first, production-ready code |
26
+ | Single-task focus | Full development cycle automation |
38
27
 
39
- # Force overwrite existing .claude/
40
- npx ai-sprint-kit init --force
28
+ ---
41
29
 
42
- # Skip Python dependencies
43
- npx ai-sprint-kit init --skip-install
30
+ ## Quick Start
44
31
 
45
- # Scan existing codebase (auto-detected if source exists)
46
- npx ai-sprint-kit init --scan
32
+ ```bash
33
+ # Install in any project
34
+ npx ai-sprint-kit init
47
35
 
48
- # Skip codebase scanning
49
- npx ai-sprint-kit init --no-scan
36
+ # Start Claude Code
37
+ claude
38
+
39
+ # Run your first autonomous cycle
40
+ /auto "build a REST API for user management"
50
41
  ```
51
42
 
52
- ## What Gets Installed
43
+ **That's it.** The framework handles planning, coding, testing, security scanning, and documentation.
53
44
 
54
- ```
55
- your-project/
56
- ├── .claude/
57
- │ ├── agents/ # 9 specialized agents
58
- │ ├── commands/ # 11 slash commands
59
- │ ├── skills/ # Security scanning scripts
60
- │ ├── workflows/ # Development rules
61
- │ ├── settings.json # Configuration
62
- │ ├── statusline.sh # Terminal statusline script
63
- │ └── .env.example # Environment template
64
- ├── ai_context/ # AI context & artifacts
65
- │ ├── plans/ # Implementation plans
66
- │ ├── docs/ # AI-generated docs
67
- │ ├── reports/ # Agent outputs
68
- │ ├── codebase/ # Scanned codebase context (if --scan)
69
- │ └── memory/ # Learning & decisions
70
- ├── CLAUDE.md # Framework instructions
71
- └── README.md # User guide
72
- ```
45
+ ---
73
46
 
74
- ## Usage After Installation
47
+ ## What You Get
75
48
 
76
- ```bash
77
- # Start Claude Code
78
- claude
49
+ ### 9 Specialized Agents
79
50
 
80
- # Use commands
81
- /plan "implement user authentication"
82
- /code "build the authentication system"
83
- /test "generate and run tests"
84
- /secure "run security scans"
85
- /auto "full autonomous cycle"
86
- ```
51
+ | Agent | Superpower |
52
+ |-------|------------|
53
+ | **Planner** | Researches & architects solutions before coding |
54
+ | **Implementer** | Generates production-grade, secure code |
55
+ | **Tester** | Creates comprehensive test suites with 80%+ coverage |
56
+ | **Reviewer** | Enforces code quality & best practices |
57
+ | **Security** | SAST, secret detection, OWASP Top 10 compliance |
58
+ | **DevOps** | Sets up CI/CD pipelines & deployments |
59
+ | **Docs** | Generates & maintains documentation |
60
+ | **Debugger** | Root cause analysis with fix recommendations |
61
+ | **Researcher** | Web search for latest libraries & best practices |
87
62
 
88
- ## Agents
89
-
90
- | Agent | Purpose |
91
- |-------|---------|
92
- | **planner** | Research & create implementation plans |
93
- | **implementer** | Generate production-grade code |
94
- | **tester** | Create and run automated tests |
95
- | **reviewer** | Code quality and best practices review |
96
- | **security** | SAST, secret detection, dependency scanning |
97
- | **devops** | CI/CD setup and deployment |
98
- | **docs** | Generate documentation |
99
- | **debugger** | Root cause analysis and fixes |
100
- | **researcher** | Technology research with web search |
101
-
102
- ## Commands
103
-
104
- | Command | Description | Example |
105
- |---------|-------------|---------|
106
- | `/plan` | Create implementation plan | `/plan "add payment processing"` |
107
- | `/code` | Generate/refactor code | `/code "implement OAuth2 login"` |
108
- | `/test` | Generate and run tests | `/test` |
109
- | `/review` | Code quality review | `/review src/` |
110
- | `/secure` | Security scan | `/secure` |
111
- | `/deploy` | CI/CD setup | `/deploy --platform github` |
112
- | `/docs` | Generate documentation | `/docs` |
113
- | `/debug` | Investigate issues | `/debug "500 error on login"` |
114
- | `/scan` | Scan codebase for AI context | `/scan` |
115
- | `/validate` | Pre-commit validation | `/validate` |
116
- | `/auto` | Automatic full cycle | `/auto "build user dashboard"` |
117
-
118
- ## Security Features
119
-
120
- ### Built-in Scans
121
- - ✅ **SAST** - Static application security testing
122
- - ✅ **Secret Detection** - Find hardcoded credentials
123
- - ✅ **Dependency Check** - Vulnerable packages
124
- - ✅ **OWASP Top 10** - Compliance validation
125
-
126
- ### Security Tools (Optional)
127
- ```bash
128
- # Install security scanning tools
129
- pip install snyk semgrep detect-secrets safety
130
- ```
63
+ ### 11 Slash Commands
131
64
 
132
- ### Configuration
133
- Set API tokens in `.env`:
134
65
  ```bash
135
- SNYK_TOKEN=your_token
136
- SEMGREP_APP_TOKEN=your_token
66
+ /plan # Create implementation plans
67
+ /code # Generate or refactor code
68
+ /test # Generate and run tests
69
+ /review # Code quality review
70
+ /secure # Security scanning
71
+ /deploy # CI/CD setup
72
+ /docs # Generate documentation
73
+ /debug # Investigate issues
74
+ /scan # Index codebase for AI context
75
+ /validate # Pre-commit checks
76
+ /auto # Full autonomous cycle
137
77
  ```
138
78
 
139
- ## CLI Commands
79
+ ### Built-in Security
140
80
 
141
- ### `ai-sprint init`
142
- Install framework in current or specified directory
81
+ - **SAST** - Static application security testing
82
+ - **Secret Detection** - Find hardcoded credentials
83
+ - **Dependency Scanning** - Vulnerable packages
84
+ - **OWASP Top 10** - Compliance validation
143
85
 
144
- ```bash
145
- # Current directory
146
- ai-sprint init
86
+ ### Context Engineering
147
87
 
148
- # Specific directory
149
- ai-sprint init --dir /path/to/project
88
+ - **Memory System** - Learns from past sessions
89
+ - **Decision Tracking** - Records architectural choices
90
+ - **Codebase Indexing** - 70% token compression with Repomix
150
91
 
151
- # Force overwrite
152
- ai-sprint init --force
92
+ ### Real-time Statusline
153
93
 
154
- # Skip Python dependencies
155
- ai-sprint init --skip-install
156
- ```
94
+ Track context usage, costs, and session progress directly in your terminal.
157
95
 
158
- ### `ai-sprint scan`
159
- Scan codebase and generate AI context documents
96
+ ---
160
97
 
161
- ```bash
162
- # Current directory
163
- ai-sprint scan
98
+ ## Installation
164
99
 
165
- # Specific directory
166
- ai-sprint scan --dir /path/to/project
167
- ```
100
+ ### Option 1: npx (Recommended)
168
101
 
169
- **Output:** `ai_context/codebase/` with overview.md, structure.md, repomix-output.xml
102
+ ```bash
103
+ npx ai-sprint-kit init
104
+ ```
170
105
 
171
- ### `ai-sprint list`
172
- Show available agents and commands
106
+ ### Option 2: Global Install
173
107
 
174
108
  ```bash
175
- ai-sprint list
109
+ npm install -g ai-sprint-kit
110
+ ai-sprint init
176
111
  ```
177
112
 
178
- ## Development
179
-
180
- ### Local Testing
113
+ ### Options
181
114
 
182
115
  ```bash
183
- # Clone repository
184
- git clone https://github.com/yourusername/ai-sprint-kit
185
- cd ai-sprint-kit
116
+ --dir <path> # Install in specific directory
117
+ --force # Overwrite existing installation
118
+ --skip-install # Skip Python dependencies
119
+ --scan # Force codebase scanning
120
+ --no-scan # Skip codebase scanning
121
+ ```
186
122
 
187
- # Install dependencies
188
- npm install
123
+ ### Updating
189
124
 
190
- # Link locally
191
- npm link
125
+ To update to the latest version:
192
126
 
193
- # Test installation
194
- mkdir test-project
195
- cd test-project
196
- ai-sprint init
127
+ ```bash
128
+ # Re-run init to update templates
129
+ npx ai-sprint-kit@latest init --force
197
130
 
198
- # Test with Claude Code
199
- claude
200
- /plan "test feature"
131
+ # Or update globally installed version
132
+ npm update -g ai-sprint-kit
201
133
  ```
202
134
 
203
- ### Package Structure
135
+ ---
136
+
137
+ ## Project Structure After Installation
204
138
 
205
139
  ```
206
- ai-sprint-kit/
207
- ├── bin/
208
- └── cli.js # CLI entry point
209
- ├── lib/
210
- │ ├── installer.js # Installation logic
211
- └── scanner.js # Codebase scanning logic
212
- ├── templates/
213
- ├── .claude/ # Framework templates
214
- ├── CLAUDE.md # Instructions
215
- └── README.md # User guide
216
- ├── package.json
217
- └── README.md # This file
140
+ your-project/
141
+ ├── .claude/
142
+ ├── agents/ # 9 specialized agents
143
+ ├── commands/ # 11 slash commands
144
+ │ ├── skills/ # Modular capabilities
145
+ ├── workflows/ # Development rules
146
+ ├── settings.json # Configuration
147
+ └── statusline.sh # Terminal statusline
148
+ ├── ai_context/
149
+ ├── plans/ # Implementation plans
150
+ ├── reports/ # Agent outputs
151
+ │ ├── codebase/ # Indexed source code
152
+ │ └── memory/ # Learning & decisions
153
+ ├── CLAUDE.md # Framework instructions
154
+ └── README.md # User guide
218
155
  ```
219
156
 
220
- ## Requirements
221
-
222
- - Node.js >= 18.0.0
223
- - Claude Code CLI
224
- - Python 3.8+ (optional, for security skills)
157
+ ---
225
158
 
226
159
  ## Examples
227
160
 
228
- ### Example 1: New Project Setup
161
+ ### New Project
162
+
229
163
  ```bash
230
- mkdir my-project
231
- cd my-project
164
+ mkdir my-app && cd my-app
232
165
  npx ai-sprint-kit init
233
166
  claude
234
- /auto "build REST API for todo app"
167
+ /auto "build e-commerce API with Stripe integration"
235
168
  ```
236
169
 
237
- ### Example 2: Add to Existing Project
170
+ ### Existing Project
171
+
238
172
  ```bash
239
- cd existing-project
240
- npx ai-sprint-kit init
173
+ cd my-existing-project
174
+ npx ai-sprint-kit init --scan
241
175
  claude
242
- /secure # Scan existing code
243
- /review # Review code quality
176
+ /review # Analyze code quality
177
+ /secure # Find vulnerabilities
244
178
  ```
245
179
 
246
- ### Example 3: Security-Focused Development
180
+ ### Security-First Development
181
+
247
182
  ```bash
248
- npx ai-sprint-kit init
249
- claude
250
183
  /plan "implement payment processing"
251
- /code "implement with PCI DSS compliance"
252
- /secure # Comprehensive security scan
253
- /review # Security-focused review
184
+ /code "build with PCI DSS compliance"
185
+ /secure # Comprehensive scan
186
+ /validate # Pre-commit checks
254
187
  ```
255
188
 
256
- ## Troubleshooting
189
+ ---
257
190
 
258
- ### "Command not found: ai-sprint"
259
- ```bash
260
- # Use npx instead
261
- npx ai-sprint-kit init
191
+ ## Requirements
262
192
 
263
- # Or install globally
264
- npm install -g ai-sprint-kit
265
- ```
193
+ - **Node.js** >= 18.0.0
194
+ - **Claude Code** CLI installed
195
+ - **Python 3.8+** (optional, for advanced security skills)
266
196
 
267
- ### ".claude/ already exists"
268
- ```bash
269
- # Use --force to overwrite
270
- npx ai-sprint-kit init --force
271
- ```
197
+ ---
272
198
 
273
- ### "Python dependencies failed"
274
- ```bash
275
- # Install manually
276
- cd .claude/skills
277
- python3 -m venv .venv
278
- source .venv/bin/activate # or .venv\Scripts\activate on Windows
279
- pip install -r requirements.txt
280
- ```
199
+ ## CLI Reference
200
+
201
+ | Command | Description |
202
+ |---------|-------------|
203
+ | `ai-sprint init` | Install framework |
204
+ | `ai-sprint scan` | Index codebase |
205
+ | `ai-sprint list` | Show agents & commands |
206
+
207
+ ---
281
208
 
282
209
  ## Contributing
283
210
 
284
- Contributions welcome! Please:
211
+ Contributions welcome!
212
+
285
213
  1. Fork the repository
286
214
  2. Create a feature branch
287
215
  3. Make your changes
288
216
  4. Submit a pull request
289
217
 
290
- ## License
218
+ ---
219
+
220
+ ## Links
221
+
222
+ - [npm Package](https://www.npmjs.com/package/ai-sprint-kit)
223
+ - [GitHub Repository](https://github.com/apiasak/ai-sprint-kit)
224
+ - [Issues](https://github.com/apiasak/ai-sprint-kit/issues)
225
+ - [Framework Documentation](./templates/README.md)
291
226
 
292
- MIT License - see LICENSE file
227
+ ---
228
+
229
+ ## License
293
230
 
294
- ## Support
231
+ **PolyForm Noncommercial 1.0.0** - Free for personal and non-commercial use. See [LICENSE](./LICENSE) file.
295
232
 
296
- - Issues: [GitHub Issues](https://github.com/yourusername/ai-sprint-kit/issues)
297
- - Documentation: [Framework README](./templates/README.md)
233
+ **Not permitted:** Commercial use, resale, or incorporation into commercial products.
298
234
 
299
235
  ---
300
236
 
301
- **Made with ❤️ for autonomous developers**
237
+ <p align="center">
238
+ <strong>Built for developers who want to ship faster, safer, and smarter.</strong>
239
+ </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-sprint-kit",
3
- "version": "1.1.1",
3
+ "version": "1.1.7",
4
4
  "description": "CLI installer for autonomous coding agent framework - security-first, production-grade Claude Code setup",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {
@@ -21,8 +21,8 @@
21
21
  "code-generation",
22
22
  "ai-sprint"
23
23
  ],
24
- "author": "Your Name",
25
- "license": "MIT",
24
+ "author": "Apipoj Piasak <https://data-espresso.com>",
25
+ "license": "PolyForm-Noncommercial-1.0.0",
26
26
  "repository": {
27
27
  "type": "git",
28
28
  "url": "https://github.com/apiasak/ai-sprint-kit.git"
@@ -3,83 +3,148 @@ description: Automatic full development cycle (plan → code → test → review
3
3
  argument-hint: [feature description]
4
4
  ---
5
5
 
6
- ## Command: /auto
6
+ **ULTRATHINK** - Execute complete autonomous development workflow.
7
7
 
8
- Execute complete autonomous development workflow from planning to deployment-ready code.
8
+ **Objective:** $ARGUMENTS
9
9
 
10
- ## Usage
10
+ ## MANDATORY Workflow Execution
11
+
12
+ **CRITICAL:** You MUST execute each phase in order. Do NOT skip to coding.
13
+
14
+ ---
15
+
16
+ ### Phase 1: Planning (MANDATORY - Execute First)
17
+
18
+ **⚠️ STOP! Before ANY code, execute `/plan` command:**
11
19
 
12
20
  ```
13
- /auto "implement user authentication"
14
- /auto "add payment processing with Stripe"
15
- /auto "create REST API for products"
21
+ /plan "$ARGUMENTS"
16
22
  ```
17
23
 
18
- ## Workflow
24
+ The `/plan` command will:
25
+ 1. Research best practices and approaches
26
+ 2. Ask clarifying questions if needed
27
+ 3. Create implementation plan with architecture
28
+ 4. Save plan to `ai_context/plans/`
19
29
 
20
- ### 1. Plan
21
- - Research approaches
22
- - Create implementation plan
23
- - Define architecture
30
+ **Validation Gate:** Plan MUST exist before proceeding.
31
+ - Check: `ai_context/plans/` has new plan directory
32
+ - If NO plan exists → STOP and run `/plan` first
24
33
 
25
- ### 2. Implement
26
- - Generate production code
27
- - Follow security best practices
28
- - Handle errors properly
34
+ ---
29
35
 
30
- ### 3. Test
31
- - Generate unit tests
32
- - Generate integration tests
33
- - Ensure >80% coverage
36
+ ### Phase 2: Implementation
34
37
 
35
- ### 4. Review
36
- - Code quality analysis
37
- - Best practices check
38
- - Refactoring suggestions
38
+ Only after plan exists, execute:
39
+ ```
40
+ /code "implement the plan at ai_context/plans/{plan-path}"
41
+ ```
39
42
 
40
- ### 5. Security Scan
41
- - SAST scanning
42
- - Secret detection
43
- - Dependency check
43
+ **Requirements:**
44
+ - Follow the plan phases step by step
45
+ - Generate production-quality code
46
+ - Follow security best practices (OWASP Top 10)
47
+ - Handle errors properly (no silent failures)
44
48
 
45
- ### 6. Documentation
46
- - Update README
47
- - Generate API docs
48
- - Add code comments
49
+ ---
49
50
 
50
- ## Human-in-the-Loop Gates
51
+ ### Phase 3: Testing
51
52
 
52
- You will be asked to approve:
53
- - Deployment actions
54
- - Infrastructure changes
55
- - Security vulnerability fixes
53
+ After implementation, execute:
54
+ ```
55
+ /test
56
+ ```
56
57
 
57
- ## Output
58
+ **Requirements:**
59
+ - Generate unit tests for business logic
60
+ - Generate integration tests for APIs
61
+ - Ensure >80% code coverage
62
+ - All tests must pass
58
63
 
59
- Complete, deployment-ready feature:
60
- - Implemented code
61
- - Passing tests (>80% coverage)
62
- - ✅ Security validated
63
- - ✅ Code reviewed
64
- - ✅ Documented
64
+ **Validation Gate:** Tests must pass before proceeding.
65
+ - If tests fail → Fix issues → Rerun `/test`
66
+ - Do NOT proceed with failing tests
65
67
 
66
- ## Success Criteria
68
+ ---
69
+
70
+ ### Phase 4: Code Review
71
+
72
+ After tests pass, execute:
73
+ ```
74
+ /review
75
+ ```
76
+
77
+ **Requirements:**
78
+ - Code quality analysis (YAGNI, KISS, DRY)
79
+ - Best practices verification
80
+ - No critical issues allowed
67
81
 
68
- - All tests pass
69
- - No critical security issues
70
- - Code review approved
71
- - Documentation updated
82
+ **Validation Gate:** Review must pass.
83
+ - If critical issues → Fix → Rerun `/review`
72
84
 
73
- ## Estimated Time
85
+ ---
86
+
87
+ ### Phase 5: Security Scan
88
+
89
+ After review passes, execute:
90
+ ```
91
+ /secure
92
+ ```
93
+
94
+ **Requirements:**
95
+ - SAST scanning for vulnerabilities
96
+ - Secret detection (no hardcoded credentials)
97
+ - Dependency vulnerability check
74
98
 
75
- - Simple features: 5-15 minutes
76
- - Medium features: 15-45 minutes
77
- - Complex features: 45+ minutes
99
+ **Validation Gate:** No high/critical security issues.
100
+ - If issues found → Fix → Rerun `/secure`
78
101
 
79
- ## Next Steps
102
+ ---
103
+
104
+ ### Phase 6: Documentation
105
+
106
+ After security passes, execute:
107
+ ```
108
+ /docs
109
+ ```
110
+
111
+ **Requirements:**
112
+ - Update relevant documentation
113
+ - Add code comments where needed
114
+ - Generate API docs if applicable
115
+
116
+ ---
117
+
118
+ ## Human-in-the-Loop Gates
119
+
120
+ Pause and ask for approval before:
121
+ - Deployment actions
122
+ - Infrastructure changes
123
+ - Critical security vulnerability fixes
124
+ - Database schema migrations
125
+
126
+ ## Success Criteria
80
127
 
81
- After /auto completion:
82
- 1. Review generated code
83
- 2. Test manually if needed
84
- 3. Commit and push
85
- 4. Deploy (with /deploy if needed)
128
+ All gates must pass:
129
+ - Plan created and approved
130
+ - Code implemented per plan
131
+ - Tests passing (>80% coverage)
132
+ - Code review approved
133
+ - ✅ Security scan clean
134
+ - ✅ Documentation updated
135
+
136
+ ## Final Report
137
+
138
+ After all phases complete, provide summary:
139
+ 1. What was implemented
140
+ 2. Test coverage achieved
141
+ 3. Security scan results
142
+ 4. Files created/modified
143
+ 5. Next steps (commit, deploy)
144
+
145
+ ## REMEMBER
146
+
147
+ - **Phase 1 is MANDATORY** - Always run `/plan` first
148
+ - **No skipping** - Execute each phase in order
149
+ - **Validation gates** - Do not proceed if a gate fails
150
+ - **Fix and retry** - If any phase fails, fix issues and rerun
@@ -1,32 +1,47 @@
1
1
  ---
2
2
  description: Generate or refactor code with best practices and security
3
- argument-hint: [what to build or refactor]
3
+ argument-hint: [plan-path or task description]
4
4
  ---
5
5
 
6
- ## Command: /code
6
+ **THINK HARDER** - Follow plan or implement with security-first approach.
7
7
 
8
- Generate production-grade code or refactor existing code following best practices, security guidelines, and design patterns.
8
+ **Objective:** $ARGUMENTS
9
9
 
10
- ## Usage
10
+ ## Workflow
11
11
 
12
- ```
13
- /code "implement user authentication with JWT"
14
- /code "refactor the payment service to use async/await"
15
- /code "add input validation to all API endpoints"
16
- /code "optimize database queries in user service"
17
- ```
12
+ ### Step 0: Check for Plan (IMPORTANT)
18
13
 
19
- ## Workflow
14
+ **If argument contains a plan path (e.g., `ai_context/plans/...`):**
15
+ 1. Read the plan: `plan.md` and `phase-*.md` files
16
+ 2. Follow implementation phases in order
17
+ 3. Mark phases complete as you progress
18
+
19
+ **If no plan exists:**
20
+ - Ask: "No plan found. Run `/plan` first or proceed with direct implementation?"
21
+ - If direct implementation requested, continue to Step 1
22
+
23
+ ---
24
+
25
+ ### Step 1: Understand Requirements
20
26
 
21
- ### 1. Understand Requirements
27
+ - Read plan phases if available
22
28
  - Clarify what needs to be built or refactored
23
29
  - Ask questions if requirements unclear
24
30
  - Identify affected files and components
25
31
 
26
- ### 2. Delegate to Implementer Agent
27
- - Spawn implementer agent with detailed instructions
28
- - Agent follows security-first principles
29
- - Implements with proper error handling
32
+ ---
33
+
34
+ ### Step 2: Delegate to Implementer Agent
35
+
36
+ ```
37
+ Task(subagent_type="implementer", prompt="Implement: $ARGUMENTS. Follow security-first principles, YAGNI/KISS/DRY. Handle errors properly.", description="Implement code")
38
+ ```
39
+
40
+ Agent responsibilities:
41
+ - Follow plan phases if provided
42
+ - Security-first implementation
43
+ - Proper error handling
44
+ - Type safety
30
45
 
31
46
  ### 3. Code Generation
32
47
  - Generate clean, maintainable code
@@ -3,6 +3,10 @@ description: Investigate and fix bugs with root cause analysis
3
3
  argument-hint: [bug description or error message]
4
4
  ---
5
5
 
6
+ **THINK HARDER** - Systematic root cause analysis requires careful investigation.
7
+
8
+ **Objective:** $ARGUMENTS
9
+
6
10
  ## Command: /debug
7
11
 
8
12
  Systematically investigate bugs, perform root cause analysis, and provide fixes with regression tests.
@@ -3,55 +3,134 @@ description: Create comprehensive implementation plan with research and architec
3
3
  argument-hint: [feature or task description]
4
4
  ---
5
5
 
6
- ## Command: /plan
6
+ **ULTRATHINK** - Deep thinking mode for comprehensive planning.
7
7
 
8
- Create a detailed implementation plan for the given feature or task.
8
+ **Objective:** $ARGUMENTS
9
9
 
10
- ## Usage
10
+ ## MANDATORY Workflow
11
+
12
+ **CRITICAL:** Follow these steps in order. Do NOT skip research.
13
+
14
+ ---
15
+
16
+ ### Step 1: Context & Memory
17
+
18
+ ```bash
19
+ # Get current timestamp (DO NOT guess dates)
20
+ date "+%y%m%d-%H%M"
21
+ ```
22
+
23
+ Check memory for past lessons:
24
+ - Read `ai_context/memory/learning.md` for mistakes to avoid
25
+ - Read `ai_context/memory/decisions.md` for past architectural decisions
26
+
27
+ ---
28
+
29
+ ### Step 2: Clarification
30
+
31
+ Use `AskUserQuestion` tool if requirements are unclear:
32
+ - Technical constraints?
33
+ - Performance requirements?
34
+ - Security considerations?
35
+ - Integration points?
36
+
37
+ ---
38
+
39
+ ### Step 3: Research (MANDATORY)
40
+
41
+ **⚠️ Do NOT skip research. Use researcher agent:**
11
42
 
12
43
  ```
13
- /plan "implement user authentication with OAuth2"
14
- /plan "add real-time notifications"
15
- /plan "refactor database layer for PostgreSQL"
44
+ Task(subagent_type="researcher", prompt="Research best practices and approaches for: $ARGUMENTS. Find: 1) Common patterns 2) Security considerations 3) Potential pitfalls 4) Recommended libraries/tools. Limit to 5 sources.", description="Research task requirements")
16
45
  ```
17
46
 
18
- ## Workflow
47
+ Research must cover:
48
+ - Industry best practices
49
+ - Security considerations (OWASP if applicable)
50
+ - Common implementation patterns
51
+ - Potential risks and mitigation
19
52
 
20
- 1. **Get timestamp** - `date "+%y%m%d-%H%M"` (DO NOT guess dates)
21
- 2. **Check memory** - Read `ai_context/memory/learning.md` for past lessons
22
- 3. **Understand** the requirement
23
- 4. **Ask** clarifying questions if needed
24
- 5. **Delegate** to planner agent
25
- 6. **Research** best practices and approaches
26
- 7. **Create** comprehensive plan in `ai_context/plans/` directory
27
- 8. **Update memory** - Record decisions in `ai_context/memory/decisions.md`
53
+ ---
28
54
 
29
- ## Plan Contents
55
+ ### Step 4: Architecture Planning
30
56
 
31
- - **Overview** - Summary with phases
32
- - **Architecture** - Technical decisions
33
- - **Phases** - Step-by-step implementation
34
- - **Risks** - Potential issues and mitigation
35
- - **Security** - Security considerations
36
- - **Success Criteria** - Definition of done
57
+ Use planner agent with research results:
37
58
 
38
- ## Output
59
+ ```
60
+ Task(subagent_type="planner", prompt="Create implementation plan for: $ARGUMENTS. Use research findings. Include: architecture, phases, risks, security, success criteria.", description="Create implementation plan")
61
+ ```
39
62
 
40
- Plan created at: `ai_context/plans/YYMMDD-HHMM-feature-name/`
41
- - `plan.md` - Main overview
42
- - `phase-*.md` - Detailed phases
63
+ ---
43
64
 
44
- ## Memory Integration
65
+ ### Step 5: Create Plan Files
45
66
 
46
- Before planning:
47
- - Check `ai_context/memory/learning.md` for past mistakes to avoid
67
+ Create plan directory: `ai_context/plans/YYMMDD-HHMM-feature-name/`
48
68
 
49
- After planning:
50
- - Update `ai_context/memory/decisions.md` with key decisions
69
+ **Required files:**
70
+
71
+ 1. **plan.md** - Overview (keep under 80 lines)
72
+ ```yaml
73
+ ---
74
+ title: "Feature name"
75
+ status: pending
76
+ created: YYYY-MM-DD
77
+ ---
78
+ ```
79
+ - Summary
80
+ - Phase list with links
81
+ - Success criteria
82
+
83
+ 2. **phase-XX-name.md** - Detailed phases
84
+ - Requirements
85
+ - Architecture decisions
86
+ - Implementation steps
87
+ - Security considerations
88
+ - Success criteria
89
+
90
+ 3. **research/researcher-report.md** - Research findings
91
+
92
+ ---
93
+
94
+ ### Step 6: Update Memory
95
+
96
+ After plan creation:
97
+ - Add key decisions to `ai_context/memory/decisions.md`
98
+ - Note any lessons learned
99
+
100
+ ---
101
+
102
+ ## Plan Contents
103
+
104
+ Every plan must include:
105
+ - **Overview** - What we're building and why
106
+ - **Architecture** - Technical decisions with rationale
107
+ - **Phases** - Step-by-step implementation (ordered)
108
+ - **Risks** - Potential issues and mitigation strategies
109
+ - **Security** - Security considerations and requirements
110
+ - **Success Criteria** - Definition of done
111
+
112
+ ## Output
113
+
114
+ Plan directory structure:
115
+ ```
116
+ ai_context/plans/YYMMDD-HHMM-feature-name/
117
+ ├── plan.md # Overview
118
+ ├── phase-01-*.md # Phase details
119
+ ├── phase-02-*.md
120
+ └── research/
121
+ └── researcher-report.md
122
+ ```
51
123
 
52
124
  ## Next Steps
53
125
 
54
126
  After plan creation:
55
- 1. Review plan
56
- 2. Approve or request changes
57
- 3. Execute with `/code` or `/auto`
127
+ 1. Review plan with user
128
+ 2. Get approval or make adjustments
129
+ 3. Execute with `/code {plan-path}` or continue `/auto`
130
+
131
+ ## REMEMBER
132
+
133
+ - **ULTRATHINK** - Take time to think deeply about architecture
134
+ - **Research FIRST** - Always research before planning
135
+ - **No shortcuts** - Complete all steps in order
136
+ - **Memory matters** - Check past lessons, record new decisions
@@ -3,6 +3,10 @@ description: Comprehensive code quality review and best practices analysis
3
3
  argument-hint: [optional: specific file or directory to review]
4
4
  ---
5
5
 
6
+ **THINK HARDER** - Thorough code review requires careful security and quality analysis.
7
+
8
+ **Objective:** $ARGUMENTS
9
+
6
10
  ## Command: /review
7
11
 
8
12
  Perform comprehensive code quality review focusing on security, maintainability, performance, and best practices.