ai-sprint-kit 1.1.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.
Files changed (59) hide show
  1. package/README.md +299 -0
  2. package/bin/cli.js +135 -0
  3. package/lib/installer.js +205 -0
  4. package/lib/scanner.js +341 -0
  5. package/package.json +55 -0
  6. package/templates/.claude/.env.example +13 -0
  7. package/templates/.claude/agents/debugger.md +667 -0
  8. package/templates/.claude/agents/devops.md +727 -0
  9. package/templates/.claude/agents/docs.md +661 -0
  10. package/templates/.claude/agents/implementer.md +235 -0
  11. package/templates/.claude/agents/planner.md +243 -0
  12. package/templates/.claude/agents/researcher.md +448 -0
  13. package/templates/.claude/agents/reviewer.md +610 -0
  14. package/templates/.claude/agents/security.md +202 -0
  15. package/templates/.claude/agents/tester.md +604 -0
  16. package/templates/.claude/commands/auto.md +85 -0
  17. package/templates/.claude/commands/code.md +301 -0
  18. package/templates/.claude/commands/debug.md +449 -0
  19. package/templates/.claude/commands/deploy.md +475 -0
  20. package/templates/.claude/commands/docs.md +519 -0
  21. package/templates/.claude/commands/plan.md +57 -0
  22. package/templates/.claude/commands/review.md +412 -0
  23. package/templates/.claude/commands/scan.md +146 -0
  24. package/templates/.claude/commands/secure.md +88 -0
  25. package/templates/.claude/commands/test.md +352 -0
  26. package/templates/.claude/commands/validate.md +238 -0
  27. package/templates/.claude/settings.json +27 -0
  28. package/templates/.claude/skills/codebase-context/SKILL.md +68 -0
  29. package/templates/.claude/skills/codebase-context/references/reading-context.md +68 -0
  30. package/templates/.claude/skills/codebase-context/references/refresh-triggers.md +82 -0
  31. package/templates/.claude/skills/implementation/SKILL.md +70 -0
  32. package/templates/.claude/skills/implementation/references/error-handling.md +106 -0
  33. package/templates/.claude/skills/implementation/references/security-patterns.md +73 -0
  34. package/templates/.claude/skills/implementation/references/validation-patterns.md +107 -0
  35. package/templates/.claude/skills/memory/SKILL.md +67 -0
  36. package/templates/.claude/skills/memory/references/decisions-format.md +68 -0
  37. package/templates/.claude/skills/memory/references/learning-format.md +74 -0
  38. package/templates/.claude/skills/planning/SKILL.md +72 -0
  39. package/templates/.claude/skills/planning/references/plan-templates.md +81 -0
  40. package/templates/.claude/skills/planning/references/research-phase.md +62 -0
  41. package/templates/.claude/skills/planning/references/solution-design.md +66 -0
  42. package/templates/.claude/skills/quality-assurance/SKILL.md +79 -0
  43. package/templates/.claude/skills/quality-assurance/references/review-checklist.md +72 -0
  44. package/templates/.claude/skills/quality-assurance/references/security-checklist.md +70 -0
  45. package/templates/.claude/skills/quality-assurance/references/testing-strategy.md +85 -0
  46. package/templates/.claude/statusline.sh +126 -0
  47. package/templates/.claude/workflows/development-rules.md +97 -0
  48. package/templates/.claude/workflows/orchestration-protocol.md +194 -0
  49. package/templates/.mcp.json.example +36 -0
  50. package/templates/CLAUDE.md +409 -0
  51. package/templates/README.md +331 -0
  52. package/templates/ai_context/codebase/.gitkeep +0 -0
  53. package/templates/ai_context/memory/active.md +15 -0
  54. package/templates/ai_context/memory/decisions.md +18 -0
  55. package/templates/ai_context/memory/learning.md +22 -0
  56. package/templates/ai_context/plans/.gitkeep +0 -0
  57. package/templates/ai_context/reports/.gitkeep +0 -0
  58. package/templates/docs/user-guide-th.md +454 -0
  59. package/templates/docs/user-guide.md +595 -0
@@ -0,0 +1,331 @@
1
+ # AI Sprint Framework
2
+
3
+ **Security-first, production-grade autonomous development with Claude Code**
4
+
5
+ ## Overview
6
+
7
+ This framework provides 9 specialized AI agents and 10 essential commands for autonomous software development with integrated security scanning. Build, test, review, and deploy with confidence using AI-driven workflows.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ # Full automation (recommended)
13
+ /auto "build user authentication system"
14
+
15
+ # Or step-by-step
16
+ /plan "implement JWT authentication"
17
+ /code "implement the plan"
18
+ /test
19
+ /review
20
+ /secure
21
+ /deploy
22
+ ```
23
+
24
+ ## MCP Tools (Optional)
25
+
26
+ Enhance agent capabilities with MCP (Model Context Protocol) servers.
27
+
28
+ ### Quick Setup
29
+
30
+ ```bash
31
+ # Copy example config
32
+ cp .mcp.json.example .mcp.json
33
+
34
+ # Edit .mcp.json and add your API keys:
35
+ # - exa: Clean web search (https://exa.ai) - less tokens than HTML
36
+ # - context7: Library documentation (https://context7.com)
37
+ # - human-mcp: Multimodal AI (Gemini API key)
38
+ ```
39
+
40
+ ### Available Tools
41
+
42
+ - **exa** - Clean web search results (less tokens than WebSearch)
43
+ - **context7** - Up-to-date library documentation
44
+ - **chrome-devtools** - Browser debugging and inspection
45
+ - **sequential-thinking** - Complex multi-step reasoning
46
+ - **time** - Timezone operations
47
+ - **human-mcp** - Image/video/audio generation
48
+
49
+ ### Which Agents Use Which Tools?
50
+
51
+ | Need | Agent | MCP Tool |
52
+ |------|-------|----------|
53
+ | Web search | researcher, planner, security | exa |
54
+ | Library docs | researcher, docs | context7 |
55
+ | Browser debugging | tester, debugger | chrome-devtools |
56
+ | Complex reasoning | planner, reviewer | sequential-thinking |
57
+ | Timestamps | devops | time |
58
+
59
+ See `CLAUDE.md` for detailed MCP configuration.
60
+
61
+ ## Key Components
62
+
63
+ ### Agents (9)
64
+ - **planner** - Architecture & implementation planning
65
+ - **implementer** - Code generation & refactoring
66
+ - **tester** - Test generation & coverage automation
67
+ - **reviewer** - Code quality & best practices analysis
68
+ - **security** - SAST, secrets, dependencies (OWASP Top 10)
69
+ - **devops** - CI/CD pipelines & deployment
70
+ - **docs** - Technical documentation generation
71
+ - **debugger** - Root cause analysis & troubleshooting
72
+ - **researcher** - Technology research with web search
73
+
74
+ ### Commands (11)
75
+ - `/plan` - Create implementation architecture
76
+ - `/code` - Generate or refactor code
77
+ - `/test` - Generate and run tests (80%+ coverage required)
78
+ - `/review` - Analyze code quality
79
+ - `/secure` - Scan for vulnerabilities, secrets, dependencies
80
+ - `/deploy` - Configure CI/CD & deployment
81
+ - `/docs` - Generate documentation
82
+ - `/debug` - Investigate bugs & errors
83
+ - `/scan` - Scan codebase and update AI context
84
+ - `/validate` - Comprehensive check (tests + review + security)
85
+ - `/auto` - Full autonomous cycle
86
+
87
+ ### Skills (5)
88
+ Skills enhance agent capabilities with specialized knowledge:
89
+
90
+ | Skill | Purpose | Used By |
91
+ |-------|---------|---------|
92
+ | `planning` | Architecture methodology | planner |
93
+ | `implementation` | Secure coding patterns | implementer |
94
+ | `quality-assurance` | Testing + review | tester, reviewer |
95
+ | `memory` | Cross-session learning | all |
96
+ | `codebase-context` | Efficient code understanding | all |
97
+
98
+ Skills are activated automatically when relevant.
99
+
100
+ ## Security by Design
101
+
102
+ ### Scanning
103
+ - **SAST** - Static analysis for vulnerabilities
104
+ - **Secret Detection** - Prevents credential leaks
105
+ - **Dependency Check** - Identifies vulnerable packages
106
+ - **OWASP Top 10** - Compliance validation
107
+
108
+ ### Approval Gates (Human-in-the-Loop)
109
+ - Production deployments
110
+ - Infrastructure changes
111
+ - High/critical vulnerability fixes
112
+
113
+ ## Codebase Scanning
114
+
115
+ AI Sprint can scan existing codebases to help agents understand the project quickly.
116
+
117
+ ### Automatic Scanning
118
+ When you run `ai-sprint init` on a project with existing source code, it automatically scans and generates context documents.
119
+
120
+ ### Manual Scanning
121
+ ```bash
122
+ # Update codebase context after changes
123
+ /scan
124
+
125
+ # Or use CLI directly
126
+ ai-sprint scan
127
+ ```
128
+
129
+ ### Output
130
+ ```
131
+ ai_context/
132
+ └── codebase/
133
+ ├── overview.md # Compressed codebase overview
134
+ ├── structure.md # Directory tree
135
+ ├── repomix-output.xml # Token-efficient XML for AI
136
+ └── scan-metadata.json # Scan statistics
137
+ ```
138
+
139
+ ### Benefits
140
+ - **70% token reduction** - Compressed code fits more context
141
+ - **Security scanning** - Detects credentials before AI exposure
142
+ - **Structure awareness** - Agents understand project layout immediately
143
+
144
+ ## Directory Structure
145
+
146
+ ```
147
+ templates/
148
+ ├── .claude/
149
+ │ ├── agents/ # 9 specialized agents
150
+ │ ├── commands/ # 11 slash commands
151
+ │ ├── workflows/ # Development rules
152
+ │ ├── settings.json # Security & testing config
153
+ │ └── .env.example # Environment template
154
+ ├── ai_context/ # AI context & artifacts
155
+ │ ├── plans/ # Implementation plans
156
+ │ ├── docs/ # AI-generated docs
157
+ │ ├── reports/ # Agent outputs
158
+ │ ├── codebase/ # Scanned codebase context
159
+ │ └── memory/
160
+ │ │ ├── learning.md # Lessons learned
161
+ │ │ └── decisions.md # Key decisions
162
+ ├── CLAUDE.md # Claude Code guidance
163
+ └── README.md # This file
164
+ ```
165
+
166
+ ## Statusline
167
+
168
+ AI Sprint includes a custom statusline displaying real-time development metrics.
169
+
170
+ ### Features
171
+
172
+ | Indicator | Description |
173
+ |-----------|-------------|
174
+ | 📁 | Current directory (with ~ expansion) |
175
+ | 🌿 | Git branch |
176
+ | 🤖 | Claude model (Opus/Sonnet) |
177
+ | 🟢🟡🔴 | Context window usage (progress bar) |
178
+ | 💵 | API cost tracking |
179
+ | 📝 | Lines changed (+added -removed) |
180
+
181
+ ### Example Output
182
+ ```
183
+ 📁 ~/my-project 🌿 main 🤖 Opus 🟢 ▰▰▰▱▱▱▱▱▱▱▱▱ 25% 💵 $0.0523 📝 +42 -8
184
+ ```
185
+
186
+ ### Requirements (Optional)
187
+
188
+ Install `jq` for full statusline features:
189
+
190
+ | Platform | Command |
191
+ |----------|---------|
192
+ | macOS | `brew install jq` |
193
+ | Ubuntu/Debian | `sudo apt-get install jq` |
194
+ | Windows | `choco install jq` |
195
+
196
+ Without jq, statusline shows basic "🚀 AI Sprint" text.
197
+
198
+ ## Workflows
199
+
200
+ ### Recommended: Full Automation
201
+ ```bash
202
+ /auto "feature description"
203
+ ```
204
+ Executes: plan → code → test → review → security → docs
205
+
206
+ ### Manual Step-by-Step
207
+ ```bash
208
+ /plan "implement registration system" # Architecture
209
+ /code "implement the plan" # Generate code
210
+ /test # Tests + coverage
211
+ /review # Quality analysis
212
+ /secure # Security scan
213
+ /deploy # CI/CD setup
214
+ ```
215
+
216
+ ### Validation Before Commit
217
+ ```bash
218
+ /validate # tests + review + security
219
+ ```
220
+
221
+ ## Configuration
222
+
223
+ ### Settings (`.claude/settings.json`)
224
+ ```json
225
+ {
226
+ "security": {
227
+ "enableSAST": true,
228
+ "enableSecretDetection": true,
229
+ "enableDependencyCheck": true
230
+ },
231
+ "testing": {
232
+ "minimumCoverage": 80
233
+ }
234
+ }
235
+ ```
236
+
237
+ ### Environment Variables (`.env`)
238
+ ```bash
239
+ # Optional: Security scanning tokens
240
+ SNYK_TOKEN=your_token
241
+ SEMGREP_APP_TOKEN=your_token
242
+
243
+ # Optional: Claude API override
244
+ ANTHROPIC_API_KEY=your_key
245
+ ```
246
+
247
+ ## Code Standards
248
+
249
+ ### Must-Have
250
+ - 80%+ test coverage
251
+ - All tests passing
252
+ - No hardcoded secrets
253
+ - Input validation on all user inputs
254
+ - Error handling throughout
255
+ - OWASP Top 10 compliance
256
+
257
+ ### Pre-Commit Gate
258
+ Run `/validate` before committing. Fixes all issues before pushing.
259
+
260
+ ## Examples
261
+
262
+ ### Example 1: Complete Feature
263
+ ```bash
264
+ /auto "implement password reset with email verification"
265
+ ```
266
+
267
+ ### Example 2: Step-by-Step with Review
268
+ ```bash
269
+ /plan "design GraphQL API for posts"
270
+ /code "implement GraphQL schema and resolvers"
271
+ /test "generate integration tests"
272
+ /review
273
+ /secure src/
274
+ ```
275
+
276
+ ### Example 3: Security Audit
277
+ ```bash
278
+ /secure .
279
+ ```
280
+ Scans codebase for vulnerabilities, secrets, dependencies.
281
+
282
+ ## Customization
283
+
284
+ ### Custom Agent
285
+ Create `.claude/agents/custom-name.md`:
286
+ ```markdown
287
+ ---
288
+ name: custom-name
289
+ description: Purpose of agent
290
+ model: sonnet
291
+ ---
292
+
293
+ Agent system prompt and instructions...
294
+ ```
295
+
296
+ ### Custom Command
297
+ Create `.claude/commands/custom-name.md`:
298
+ ```markdown
299
+ ---
300
+ description: What this command does
301
+ argument-hint: [optional-args]
302
+ ---
303
+
304
+ Command workflow steps...
305
+ ```
306
+
307
+ ## Troubleshooting
308
+
309
+ | Issue | Solution |
310
+ |-------|----------|
311
+ | Security scan fails | Install: `pip install snyk semgrep detect-secrets`. Get API tokens. Update `.env` |
312
+ | Tests don't run | Verify test framework installed. Check test file patterns. Ensure coverage tools available |
313
+ | Agent not found | Verify `.claude/agents/` directory. Check agent name in frontmatter. Restart Claude |
314
+ | Low code coverage | Use `/test` to auto-generate tests for uncovered code |
315
+ | Deployment blocked | Check approval gates in `.claude/settings.json`. Review security findings |
316
+
317
+ ## Key Principles
318
+
319
+ - **Security First** - Every feature scanned for vulnerabilities
320
+ - **Automated Testing** - 80%+ coverage enforced
321
+ - **Code Review** - Quality gates before merge
322
+ - **Human Control** - Approve critical deployments
323
+ - **Documentation** - Auto-generated for all changes
324
+
325
+ ## Next Steps
326
+
327
+ 1. Copy this template to your project
328
+ 2. Update `.claude/settings.json` for your stack
329
+ 3. Configure environment variables in `.env`
330
+ 4. Start with `/auto "your first feature"`
331
+ 5. Monitor `ai_context/memory/learning.md` for lessons
File without changes
@@ -0,0 +1,15 @@
1
+ # Active Session Context
2
+
3
+ Current session state (overwritten each session).
4
+
5
+ ## Current Focus
6
+
7
+ <!-- What you're working on -->
8
+
9
+ ## Recent Changes
10
+
11
+ <!-- What was just modified -->
12
+
13
+ ## Blockers
14
+
15
+ <!-- Any issues or questions -->
@@ -0,0 +1,18 @@
1
+ # Decisions Log
2
+
3
+ Record key architectural and design decisions.
4
+
5
+ ## Format
6
+
7
+ ```
8
+ ## [YYYY-MM-DD] - [Decision Title]
9
+
10
+ **Context**: Why decision needed
11
+ **Options**: What was considered
12
+ **Decision**: What was chosen
13
+ **Rationale**: Why this choice
14
+ ```
15
+
16
+ ---
17
+
18
+ <!-- Add entries below -->
@@ -0,0 +1,22 @@
1
+ # Learning Log
2
+
3
+ Record lessons learned to avoid repeating mistakes.
4
+
5
+ ## Format
6
+
7
+ ```
8
+ ## [YYYY-MM-DD] - [Category]
9
+
10
+ **Context**: What happened
11
+ **Mistake**: What went wrong
12
+ **Lesson**: What to do differently
13
+ **Prevention**: How to avoid in future
14
+ ```
15
+
16
+ ## Categories
17
+
18
+ - Security, Performance, Testing, Architecture, Process, Dependencies
19
+
20
+ ---
21
+
22
+ <!-- Add entries below -->
File without changes
File without changes