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,409 @@
1
+ # CLAUDE.md
2
+
3
+ Guidance for Claude Code when using AI Sprint Framework.
4
+
5
+ ## Framework Overview
6
+
7
+ **AI Sprint** - Security-first, production-grade autonomous development powered by 9 specialized agents and 10 core commands.
8
+
9
+ ## Available Agents
10
+
11
+ | Agent | Model | Purpose |
12
+ |-------|-------|---------|
13
+ | planner | opus | Architecture & implementation planning |
14
+ | implementer | sonnet | Code generation & refactoring |
15
+ | tester | sonnet | Test generation & coverage automation |
16
+ | reviewer | sonnet | Code quality & best practices |
17
+ | security | sonnet | SAST, secrets, dependencies |
18
+ | devops | sonnet | CI/CD pipelines & deployment |
19
+ | docs | sonnet | Technical documentation |
20
+ | debugger | sonnet | Root cause analysis |
21
+ | researcher | sonnet | Technology research & web search |
22
+
23
+ ## Core Principles
24
+
25
+ - **YAGNI** - You Aren't Gonna Need It (no over-engineering)
26
+ - **KISS** - Keep It Simple, Stupid (clarity over cleverness)
27
+ - **DRY** - Don't Repeat Yourself (avoid duplication)
28
+ - **Security-First** - Every feature scanned and validated
29
+
30
+ ## Development Workflows
31
+
32
+ ### Full Automation (Recommended)
33
+ ```bash
34
+ /auto "implement user registration with email verification"
35
+ ```
36
+ Executes: plan → code → test → review → security → docs
37
+
38
+ ### Manual Workflow
39
+ ```bash
40
+ /plan "feature description" # 1. Create architecture
41
+ /code "implement the plan" # 2. Generate code
42
+ /test # 3. Test + coverage
43
+ /review # 4. Code quality
44
+ /secure # 5. Security scan
45
+ /deploy # 6. CI/CD setup
46
+ /docs # 7. Documentation
47
+ ```
48
+
49
+ ### Quick Validation
50
+ ```bash
51
+ /validate # Tests + review + security (before commit)
52
+ ```
53
+
54
+ ### Debugging Issues
55
+ ```bash
56
+ /debug "describe the problem" # Root cause analysis
57
+ ```
58
+
59
+ ## Mandatory Security Requirements
60
+
61
+ ### Code Standards
62
+ - ✅ No hardcoded secrets (credentials, tokens, API keys)
63
+ - ✅ Input validation on ALL user-facing inputs
64
+ - ✅ Proper error handling (no silent failures)
65
+ - ✅ OWASP Top 10 compliance
66
+ - ✅ Secure defaults (fail-safe configuration)
67
+
68
+ ### Testing Standards
69
+ - ✅ 80%+ code coverage required
70
+ - ✅ All tests must pass before commit
71
+ - ✅ Unit tests for business logic
72
+ - ✅ Integration tests for APIs
73
+ - ✅ Edge case coverage
74
+
75
+ ### Pre-Commit Gate
76
+ Always run `/validate` before pushing:
77
+ ```bash
78
+ /validate
79
+ # Runs: tests + code review + security scan
80
+ # Blocks commit if: tests fail | coverage < 80% | security issues found
81
+ ```
82
+
83
+ ## Quality Assurance
84
+
85
+ ### Code Review Checklist
86
+ - ✅ Follows framework principles (YAGNI, KISS, DRY)
87
+ - ✅ Has test coverage (>80%)
88
+ - ✅ No security vulnerabilities
89
+ - ✅ No hardcoded secrets
90
+ - ✅ Error handling complete
91
+ - ✅ Self-documenting code
92
+
93
+ ### Security Scanning
94
+ - **SAST** - Static analysis for code vulnerabilities
95
+ - **Secret Detection** - Hardcoded credentials, API keys
96
+ - **Dependency Check** - Vulnerable packages
97
+ - **OWASP Top 10** - Common web vulnerabilities
98
+
99
+ ### Human-in-the-Loop Gates
100
+ Requires explicit approval for:
101
+ - Production deployments
102
+ - Infrastructure/environment changes
103
+ - Critical/high severity vulnerability fixes
104
+ - Database schema migrations
105
+ - Permission/access changes
106
+
107
+ ## File Organization
108
+
109
+ ```
110
+ project/
111
+ ├── .claude/
112
+ │ ├── agents/ # 9 specialized agents
113
+ │ ├── commands/ # 10 slash commands
114
+ │ ├── workflows/ # Development rules
115
+ │ ├── skills/ # Python utilities
116
+ │ ├── settings.json # Configuration
117
+ │ └── .env.example # Environment template
118
+ ├── ai_context/ # AI artifacts (not project code)
119
+ │ ├── plans/ # Implementation plans
120
+ │ ├── docs/ # AI-generated documentation
121
+ │ ├── reports/ # Agent outputs
122
+ │ │ ├── review-*.md # Code review reports
123
+ │ │ ├── test-*.md # Test coverage reports
124
+ │ │ ├── security-*.md # Security scan results
125
+ │ │ └── debug-*.md # Debugging analysis
126
+ │ └── memory/
127
+ │ │ ├── learning.md # Lessons learned
128
+ │ │ ├── decisions.md # Key decisions
129
+ │ │ └── active.md # Current context
130
+ ├── docs/ # User-facing documentation
131
+ ├── src/ # Source code
132
+ ├── tests/ # Test files
133
+ ├── README.md # Framework overview
134
+ └── CLAUDE.md # This file
135
+ ```
136
+
137
+ ## Context Engineering
138
+
139
+ Store all AI context under `ai_context/` to:
140
+ - **Avoid conflicts** with project-level `docs/` folder
141
+ - **Centralize artifacts** for easy discovery
142
+ - **Persist memory** across development sessions
143
+ - **Track decisions** and lessons learned
144
+
145
+ ### Memory System
146
+ - **learning.md** - Retrospective lessons (mistakes to avoid)
147
+ - **decisions.md** - Key architecture & design decisions
148
+ - **active.md** - Current session focus & context
149
+ - **reports/** - Timestamped outputs from agents
150
+
151
+ ## Configuration
152
+
153
+ ### `.claude/settings.json`
154
+ Control agent behavior, security settings, approval gates:
155
+ ```json
156
+ {
157
+ "security": {
158
+ "enableSAST": true,
159
+ "enableSecretDetection": true,
160
+ "enableDependencyCheck": true,
161
+ "owasp_check": true
162
+ },
163
+ "testing": {
164
+ "minimumCoverage": 80,
165
+ "require_all_pass": true
166
+ },
167
+ "approval_gates": {
168
+ "production_deploy": true,
169
+ "infrastructure_change": true,
170
+ "critical_security_fix": true
171
+ }
172
+ }
173
+ ```
174
+
175
+ ### `.env` (Optional)
176
+ ```bash
177
+ # Security scanning (if using premium versions)
178
+ SNYK_TOKEN=your_token
179
+ SEMGREP_APP_TOKEN=your_token
180
+
181
+ # API overrides (optional)
182
+ ANTHROPIC_API_KEY=your_key
183
+ ```
184
+
185
+ ## MCP Tools (Optional)
186
+
187
+ MCP (Model Context Protocol) servers provide enhanced capabilities for agents.
188
+
189
+ ### Setup
190
+
191
+ 1. Copy the example configuration:
192
+ ```bash
193
+ cp .mcp.json.example .mcp.json
194
+ ```
195
+
196
+ 2. Add your API keys:
197
+ - **exa**: Get key from https://exa.ai (clean web search, less tokens)
198
+ - **context7**: Get key from https://context7.com
199
+ - **human-mcp**: Get Gemini key from https://makersuite.google.com/app/apikey
200
+
201
+ 3. Install dependencies:
202
+ ```bash
203
+ # context7 (library docs)
204
+ npx -y @upstash/context7-mcp --help
205
+
206
+ # chrome-devtools (browser debugging)
207
+ npx -y chrome-devtools-mcp@latest --help
208
+
209
+ # sequential-thinking (complex reasoning)
210
+ npx -y @modelcontextprotocol/server-sequential-thinking --help
211
+
212
+ # time (timezone ops)
213
+ uvx mcp-server-time --help
214
+ ```
215
+
216
+ ### Available MCP Tools
217
+
218
+ | Server | Tools | Use Case |
219
+ |--------|-------|----------|
220
+ | **exa** | web_search_exa, get_code_context_exa, deep_search_exa | Web search (clean results, less tokens) |
221
+ | **context7** | resolve-library-id, get-library-docs | Library documentation |
222
+ | **chrome-devtools** | take_snapshot, list_console_messages, evaluate_script | Browser debugging |
223
+ | **sequential-thinking** | sequentialthinking | Complex reasoning |
224
+ | **time** | get_current_time, convert_time | Timezone operations |
225
+ | **human-mcp** | eyes_analyze, gemini_gen_image, mouth_speak | Multimodal AI |
226
+
227
+ ### Agent-MCP Mapping
228
+
229
+ | Agent | Primary MCP Tools |
230
+ |-------|-------------------|
231
+ | researcher | exa, context7, time |
232
+ | planner | exa, context7, sequential-thinking |
233
+ | implementer | context7, sequential-thinking |
234
+ | tester | chrome-devtools |
235
+ | reviewer | sequential-thinking |
236
+ | security | exa, sequential-thinking |
237
+ | devops | time |
238
+ | docs | context7 |
239
+ | debugger | chrome-devtools, sequential-thinking |
240
+
241
+ ### Security Note
242
+
243
+ ⚠️ **Never commit `.mcp.json`** - it contains API keys. Only commit `.mcp.json.example` with placeholders.
244
+
245
+ ## Codebase Context
246
+
247
+ When working on an existing codebase, AI Sprint can scan and index the code for efficient agent understanding.
248
+
249
+ ### Scanned Context Location
250
+
251
+ ```
252
+ ai_context/
253
+ └── codebase/
254
+ ├── overview.md # Human-readable compressed codebase
255
+ ├── structure.md # Directory tree
256
+ ├── repomix-output.xml # Token-efficient XML for AI consumption
257
+ └── scan-metadata.json # Stats (files, tokens, timestamp)
258
+ ```
259
+
260
+ ### When to Read Codebase Context
261
+
262
+ Before starting work on an existing project, read:
263
+ 1. `ai_context/codebase/structure.md` - Understand project layout
264
+ 2. `ai_context/codebase/overview.md` - Review compressed code overview
265
+
266
+ ### Refreshing Context
267
+
268
+ Run `/scan` after major changes to update the codebase index.
269
+
270
+ ## Commands Reference
271
+
272
+ All commands have detailed docs in `.claude/commands/`:
273
+
274
+ | Command | Purpose | Usage |
275
+ |---------|---------|-------|
276
+ | `/plan` | Architecture | `/plan "implement feature"` |
277
+ | `/code` | Generate | `/code "write implementation"` |
278
+ | `/test` | Testing | `/test` (generates & runs) |
279
+ | `/review` | Quality | `/review` (analyzes code) |
280
+ | `/secure` | Security | `/secure src/` (scans directory) |
281
+ | `/deploy` | CI/CD | `/deploy` (sets up pipeline) |
282
+ | `/docs` | Docs | `/docs` (generates documentation) |
283
+ | `/debug` | Debugging | `/debug "issue description"` |
284
+ | `/scan` | Codebase | `/scan` (update AI context) |
285
+ | `/validate` | Gate | `/validate` (before commit) |
286
+ | `/auto` | Full Cycle | `/auto "feature description"` |
287
+
288
+ ## Workflows Reference
289
+
290
+ - **development-rules.md** - Core coding principles & standards
291
+ - **orchestration-protocol.md** - How agents coordinate
292
+
293
+ ## Date Handling
294
+
295
+ **CRITICAL**: Never guess dates. Always use bash:
296
+ ```bash
297
+ date "+%Y-%m-%d" # ISO format: 2025-12-24
298
+ date "+%y%m%d-%H%M" # Filename format: 251224-2153
299
+ ```
300
+
301
+ Use this in reports and file naming consistently.
302
+
303
+ ## Memory Integration
304
+
305
+ ### Before Starting a Task
306
+ Check learning from past sessions:
307
+ ```bash
308
+ cat ai_context/memory/learning.md
309
+ cat ai_context/memory/decisions.md
310
+ ```
311
+
312
+ ### After Completing a Task
313
+ Update collective knowledge:
314
+ 1. Add new lessons to `ai_context/memory/learning.md`
315
+ 2. Document key decisions in `ai_context/memory/decisions.md`
316
+ 3. Save reports to `ai_context/reports/{timestamp}-{type}.md`
317
+ 4. Update `ai_context/memory/active.md` with session summary
318
+
319
+ ## Best Practices
320
+
321
+ ### When Using Agents
322
+ 1. Provide clear, specific descriptions
323
+ 2. Include relevant context from `ai_context/`
324
+ 3. Review agent outputs before accepting
325
+ 4. Ask follow-up questions if needed
326
+ 5. Document decisions in memory system
327
+
328
+ ### Code Generation
329
+ 1. Review generated code before merging
330
+ 2. Run `/test` to validate coverage
331
+ 3. Run `/secure` before commit
332
+ 4. Address all security findings
333
+ 5. Update docs with changes
334
+
335
+ ### Testing & Review
336
+ 1. Aim for >80% coverage
337
+ 2. Include edge cases
338
+ 3. Test error paths
339
+ 4. Verify security assumptions
340
+ 5. Check performance critical sections
341
+
342
+ ### Documentation
343
+ 1. Keep docs synchronized with code
344
+ 2. Use AI docs agent for auto-generation
345
+ 3. Include usage examples
346
+ 4. Document security considerations
347
+ 5. Maintain decision rationale
348
+
349
+ ## Common Patterns
350
+
351
+ ### Feature Implementation
352
+ ```bash
353
+ /plan "describe feature"
354
+ /code "implement based on plan"
355
+ /test
356
+ /validate
357
+ # If passes → merge
358
+ # If fails → /debug "issue" → fix → rerun
359
+ ```
360
+
361
+ ### Bug Fix
362
+ ```bash
363
+ /debug "describe the bug and symptoms"
364
+ # Review root cause analysis
365
+ /code "implement the fix"
366
+ /test
367
+ /validate
368
+ ```
369
+
370
+ ### Security Audit
371
+ ```bash
372
+ /secure .
373
+ # Review findings in ai_context/reports/security-*.md
374
+ /code "fix high/critical issues"
375
+ /test
376
+ ```
377
+
378
+ ### Performance Optimization
379
+ ```bash
380
+ /plan "performance improvement"
381
+ /code "optimize based on plan"
382
+ /test "ensure no regressions"
383
+ /review "check for best practices"
384
+ ```
385
+
386
+ ## Customization
387
+
388
+ ### Add Custom Agent
389
+ Create `.claude/agents/custom-name.md`:
390
+ ```markdown
391
+ ---
392
+ name: custom-name
393
+ description: Agent purpose
394
+ model: sonnet
395
+ ---
396
+
397
+ System prompt and instructions...
398
+ ```
399
+
400
+ ### Add Custom Command
401
+ Create `.claude/commands/custom-name.md`:
402
+ ```markdown
403
+ ---
404
+ description: Command description
405
+ argument-hint: [optional-args]
406
+ ---
407
+
408
+ Workflow steps and orchestration...
409
+ ```