ai-development-framework 0.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.
- package/.claude/agents/_template/AGENT.md +36 -0
- package/.claude/agents/architect-agent/AGENT.md +60 -0
- package/.claude/agents/architect-agent/decisions/log.md +18 -0
- package/.claude/agents/architect-agent/frontend/.gitkeep +0 -0
- package/.claude/agents/architect-agent/index.md +32 -0
- package/.claude/agents/architect-agent/modules/.gitkeep +0 -0
- package/.claude/agents/architect-agent/shared/patterns.md +19 -0
- package/.claude/agents/mobile-tester-agent/AGENT.md +46 -0
- package/.claude/agents/mobile-tester-agent/screen-patterns.md +42 -0
- package/.claude/agents/tester-agent/AGENT.md +44 -0
- package/.claude/agents/tester-agent/auth-state.md +22 -0
- package/.claude/agents/tester-agent/test-patterns.md +36 -0
- package/.claude/agents/ui-ux-analyzer/AGENT.md +75 -0
- package/.claude/commands/create-prd.md +55 -0
- package/.claude/commands/evolve.md +84 -0
- package/.claude/commands/execute.md +76 -0
- package/.claude/commands/plan-feature.md +100 -0
- package/.claude/commands/plan-project.md +110 -0
- package/.claude/commands/prime.md +71 -0
- package/.claude/commands/setup.md +81 -0
- package/.claude/commands/ship.md +73 -0
- package/.claude/commands/start.md +63 -0
- package/.claude/commands/validate.md +72 -0
- package/.claude/hooks/architect-sync.sh +18 -0
- package/.claude/hooks/branch-guard.sh +15 -0
- package/.claude/hooks/evolve-reminder.sh +13 -0
- package/.claude/hooks/plan-required.sh +20 -0
- package/.claude/hooks/session-primer.sh +38 -0
- package/.claude/references/claude-md-template.md +90 -0
- package/.claude/references/code-patterns.md +37 -0
- package/.claude/references/issue-template.md +56 -0
- package/.claude/references/plan-template.md +92 -0
- package/.claude/references/prd-template.md +119 -0
- package/.claude/rules/_global.md +22 -0
- package/.claude/rules/_template.md +23 -0
- package/.claude/rules/backend.md +29 -0
- package/.claude/rules/database.md +28 -0
- package/.claude/rules/frontend.md +34 -0
- package/.claude/rules/mobile.md +33 -0
- package/.claude/rules/testing.md +37 -0
- package/.claude/settings.local.json +27 -0
- package/.claude/skills/e2e-test/SKILL.md +87 -0
- package/.claude/skills/playwright-cli/SKILL.md +97 -0
- package/CLAUDE.md +65 -0
- package/README.md +83 -0
- package/cli/index.js +35 -0
- package/cli/init.js +219 -0
- package/cli/update.js +120 -0
- package/docs/command-reference.md +41 -0
- package/docs/customization.md +33 -0
- package/docs/getting-started.md +68 -0
- package/docs/methodology.md +78 -0
- package/docs/plans/2026-03-30-ai-development-framework-design.md +483 -0
- package/docs/plugin-install-guide.md +66 -0
- package/docs/superpowers/plans/2026-03-30-framework-implementation.md +3462 -0
- package/package.json +28 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# CLAUDE.md Generation Template
|
|
2
|
+
|
|
3
|
+
Used by `/create-rules` to auto-generate a project CLAUDE.md.
|
|
4
|
+
Fill in sections based on codebase analysis.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# [Project Name]
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
[Auto-generated: 1-2 sentences about the project, detected from README/package.json]
|
|
13
|
+
|
|
14
|
+
## Tech Stack
|
|
15
|
+
|
|
16
|
+
[Auto-detected from package.json, requirements.txt, go.mod, etc.]
|
|
17
|
+
|
|
18
|
+
| Layer | Technology |
|
|
19
|
+
|-------|-----------|
|
|
20
|
+
| Language | |
|
|
21
|
+
| Framework | |
|
|
22
|
+
| Database | |
|
|
23
|
+
| ORM | |
|
|
24
|
+
| Auth | |
|
|
25
|
+
| Styling | |
|
|
26
|
+
| Testing | |
|
|
27
|
+
| Package Manager | |
|
|
28
|
+
|
|
29
|
+
## Pipeline Commands (PIV+E)
|
|
30
|
+
|
|
31
|
+
| Command | Phase | Purpose |
|
|
32
|
+
|---------|-------|---------|
|
|
33
|
+
| `/start` | Router | Detects scope level, routes to correct pipeline |
|
|
34
|
+
| `/prime` | Plan | Loads codebase context |
|
|
35
|
+
| `/create-prd` | Plan | Generates PRD (includes brainstorming) |
|
|
36
|
+
| `/plan-project` | Plan | PRD → GitHub milestones + issues |
|
|
37
|
+
| `/plan-feature` | Plan | Creates implementation plan |
|
|
38
|
+
| `/execute` | Implement | Executes plan with TDD |
|
|
39
|
+
| `/validate` | Validate | Verification + testing agents |
|
|
40
|
+
| `/ship` | Validate | Commit + push + PR |
|
|
41
|
+
| `/evolve` | Evolve | Updates rules + knowledge base |
|
|
42
|
+
| `/setup` | Utility | Checks plugin/skill health |
|
|
43
|
+
|
|
44
|
+
## Project Structure
|
|
45
|
+
|
|
46
|
+
[Auto-generated: tree -L 2 output of key directories]
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
project/
|
|
50
|
+
├── src/ # [detected purpose]
|
|
51
|
+
├── tests/ # [detected purpose]
|
|
52
|
+
└── ...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Development Commands
|
|
56
|
+
|
|
57
|
+
[Auto-detected from package.json scripts, Makefile, etc.]
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Start development
|
|
61
|
+
<detected dev command>
|
|
62
|
+
|
|
63
|
+
# Run tests
|
|
64
|
+
<detected test command>
|
|
65
|
+
|
|
66
|
+
# Build
|
|
67
|
+
<detected build command>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Code Conventions
|
|
71
|
+
|
|
72
|
+
[Auto-detected from codebase analysis]
|
|
73
|
+
|
|
74
|
+
- [Naming convention: camelCase/snake_case/etc.]
|
|
75
|
+
- [Import style: absolute/relative]
|
|
76
|
+
- [Component pattern: functional/class]
|
|
77
|
+
- [Error handling pattern]
|
|
78
|
+
|
|
79
|
+
## Agents
|
|
80
|
+
|
|
81
|
+
- **architect-agent** — Call before structural changes (RETRIEVE/IMPACT/RECORD/PATTERN)
|
|
82
|
+
- **tester-agent** — Web UI testing after changes (VERIFY/FLOW)
|
|
83
|
+
- **mobile-tester-agent** — Mobile testing after changes (VERIFY/FLOW)
|
|
84
|
+
- **ui-ux-analyzer** — Design audits on request
|
|
85
|
+
|
|
86
|
+
## Rules & References
|
|
87
|
+
|
|
88
|
+
- Domain rules auto-load from `.claude/rules/` based on file paths
|
|
89
|
+
- Code patterns in `.claude/references/code-patterns.md`
|
|
90
|
+
- See `docs/customization.md` for extending the framework
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Code Patterns
|
|
2
|
+
|
|
3
|
+
This file is generated per-project by `/create-rules`. It contains real code patterns detected from your codebase.
|
|
4
|
+
|
|
5
|
+
Run `/create-rules` to populate this file with patterns from your actual code.
|
|
6
|
+
|
|
7
|
+
## How This File Works
|
|
8
|
+
|
|
9
|
+
When `/create-rules` scans your codebase, it extracts:
|
|
10
|
+
|
|
11
|
+
1. **Controller/Route patterns** — how endpoints are structured
|
|
12
|
+
2. **Service/business logic patterns** — how business logic is organized
|
|
13
|
+
3. **Data access patterns** — how database queries are written
|
|
14
|
+
4. **Component patterns** — how UI components are structured
|
|
15
|
+
5. **Form patterns** — how forms and validation work
|
|
16
|
+
6. **Error handling patterns** — how errors are caught and reported
|
|
17
|
+
7. **Test patterns** — how tests are structured
|
|
18
|
+
8. **Common pitfalls** — mistakes specific to your codebase
|
|
19
|
+
|
|
20
|
+
Each pattern includes a real code example from your project, so the AI follows YOUR conventions, not generic ones.
|
|
21
|
+
|
|
22
|
+
## Template
|
|
23
|
+
|
|
24
|
+
When populating, use this format per pattern:
|
|
25
|
+
|
|
26
|
+
### [Pattern Name]
|
|
27
|
+
|
|
28
|
+
**File:** `path/to/example.ts`
|
|
29
|
+
**When:** [When to use this pattern]
|
|
30
|
+
|
|
31
|
+
```language
|
|
32
|
+
// Actual code from the project
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Key points:**
|
|
36
|
+
- [What makes this pattern important]
|
|
37
|
+
- [Common mistake to avoid]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# GitHub Issue Template
|
|
2
|
+
|
|
3
|
+
Used by `/plan-project` and `/plan-feature` to create structured issues.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Issue Structure
|
|
8
|
+
|
|
9
|
+
### Title Format
|
|
10
|
+
`[type]: brief description`
|
|
11
|
+
|
|
12
|
+
Types: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`
|
|
13
|
+
|
|
14
|
+
### Body Template
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
## Description
|
|
18
|
+
|
|
19
|
+
[1-2 sentences: what needs to be built/fixed and why]
|
|
20
|
+
|
|
21
|
+
## Acceptance Criteria
|
|
22
|
+
|
|
23
|
+
- [ ] Criterion 1
|
|
24
|
+
- [ ] Criterion 2
|
|
25
|
+
- [ ] Criterion 3
|
|
26
|
+
|
|
27
|
+
## Technical Notes
|
|
28
|
+
|
|
29
|
+
- Key files to modify: `path/to/file`
|
|
30
|
+
- Pattern to follow: [reference existing similar implementation]
|
|
31
|
+
- Dependencies: [other issues that must be completed first]
|
|
32
|
+
|
|
33
|
+
## Size Estimate
|
|
34
|
+
|
|
35
|
+
[S / M / L / XL]
|
|
36
|
+
|
|
37
|
+
- **S** (< 1 hour): Config change, copy update, simple fix
|
|
38
|
+
- **M** (1-4 hours): Single component/endpoint, moderate logic
|
|
39
|
+
- **L** (4-16 hours): Multi-file feature, new module
|
|
40
|
+
- **XL** (> 16 hours): Consider breaking into smaller issues
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Labels
|
|
44
|
+
|
|
45
|
+
Apply these labels via `gh issue create --label`:
|
|
46
|
+
|
|
47
|
+
| Label | When |
|
|
48
|
+
|-------|------|
|
|
49
|
+
| `feat` | New functionality |
|
|
50
|
+
| `fix` | Bug fix |
|
|
51
|
+
| `refactor` | Code improvement, no behavior change |
|
|
52
|
+
| `docs` | Documentation only |
|
|
53
|
+
| `priority:high` | Blocks other work or critical path |
|
|
54
|
+
| `priority:medium` | Important but not blocking |
|
|
55
|
+
| `priority:low` | Nice to have |
|
|
56
|
+
| `size:S/M/L/XL` | Estimated effort |
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Implementation Plan Template
|
|
2
|
+
|
|
3
|
+
Use this structure when generating plans via `/plan-feature`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# [Feature Name] Implementation Plan
|
|
8
|
+
|
|
9
|
+
> **For agentic workers:** Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task.
|
|
10
|
+
|
|
11
|
+
**Goal:** [One sentence]
|
|
12
|
+
|
|
13
|
+
**Architecture:** [2-3 sentences about approach]
|
|
14
|
+
|
|
15
|
+
**Tech Stack:** [Key technologies]
|
|
16
|
+
|
|
17
|
+
**Confidence Score:** [1-10] for one-pass implementation success
|
|
18
|
+
|
|
19
|
+
**Context Reset:** [Recommended / Not needed] between planning and implementation
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Mandatory Reading
|
|
24
|
+
|
|
25
|
+
Before implementing, read these files to understand the codebase context:
|
|
26
|
+
|
|
27
|
+
| File | Lines | What to Learn |
|
|
28
|
+
|------|-------|--------------|
|
|
29
|
+
| `path/to/file` | 1-50 | Pattern for X |
|
|
30
|
+
|
|
31
|
+
## File Map
|
|
32
|
+
|
|
33
|
+
### New Files
|
|
34
|
+
| File | Responsibility |
|
|
35
|
+
|------|---------------|
|
|
36
|
+
| `path/to/new/file` | Description |
|
|
37
|
+
|
|
38
|
+
### Modified Files
|
|
39
|
+
| File | Changes |
|
|
40
|
+
|------|---------|
|
|
41
|
+
| `path/to/existing` | What changes and why |
|
|
42
|
+
|
|
43
|
+
## Dependencies
|
|
44
|
+
|
|
45
|
+
Install before starting:
|
|
46
|
+
```bash
|
|
47
|
+
<install commands if any>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Tasks
|
|
51
|
+
|
|
52
|
+
### Task 1: [Component Name]
|
|
53
|
+
|
|
54
|
+
**Files:**
|
|
55
|
+
- Create: `exact/path/to/file`
|
|
56
|
+
- Modify: `exact/path/to/existing:lines`
|
|
57
|
+
- Test: `tests/exact/path/to/test`
|
|
58
|
+
|
|
59
|
+
- [ ] Step 1: Write the failing test
|
|
60
|
+
```language
|
|
61
|
+
<actual test code>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- [ ] Step 2: Run test to verify it fails
|
|
65
|
+
Run: `<exact command>`
|
|
66
|
+
Expected: FAIL with "<message>"
|
|
67
|
+
|
|
68
|
+
- [ ] Step 3: Write minimal implementation
|
|
69
|
+
```language
|
|
70
|
+
<actual implementation code>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- [ ] Step 4: Run test to verify it passes
|
|
74
|
+
Run: `<exact command>`
|
|
75
|
+
Expected: PASS
|
|
76
|
+
|
|
77
|
+
- [ ] Step 5: Commit
|
|
78
|
+
```bash
|
|
79
|
+
git add <files>
|
|
80
|
+
git commit -m "<conventional commit message>"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Task 2: ...
|
|
84
|
+
|
|
85
|
+
## Acceptance Criteria
|
|
86
|
+
|
|
87
|
+
- [ ] Criterion 1
|
|
88
|
+
- [ ] Criterion 2
|
|
89
|
+
|
|
90
|
+
## GOTCHA Warnings
|
|
91
|
+
|
|
92
|
+
- **GOTCHA:** [Specific pitfall and how to avoid it]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# PRD Template
|
|
2
|
+
|
|
3
|
+
Use this structure when generating a PRD via `/create-prd`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# [Project Name] — Product Requirements Document
|
|
8
|
+
|
|
9
|
+
## 1. Executive Summary
|
|
10
|
+
|
|
11
|
+
One paragraph: what is this product, who is it for, what problem does it solve.
|
|
12
|
+
|
|
13
|
+
## 2. Problem Statement
|
|
14
|
+
|
|
15
|
+
- What pain point exists today?
|
|
16
|
+
- Who experiences it?
|
|
17
|
+
- What are they currently doing instead?
|
|
18
|
+
|
|
19
|
+
## 3. Goals & Success Criteria
|
|
20
|
+
|
|
21
|
+
| Goal | Metric | Target |
|
|
22
|
+
|------|--------|--------|
|
|
23
|
+
| | | |
|
|
24
|
+
|
|
25
|
+
## 4. Target Users
|
|
26
|
+
|
|
27
|
+
| Persona | Description | Key Needs |
|
|
28
|
+
|---------|-------------|-----------|
|
|
29
|
+
| | | |
|
|
30
|
+
|
|
31
|
+
## 5. User Stories
|
|
32
|
+
|
|
33
|
+
### Epic: [Epic Name]
|
|
34
|
+
|
|
35
|
+
- [ ] As a [user], I want to [action] so that [benefit]
|
|
36
|
+
- [ ] As a [user], I want to [action] so that [benefit]
|
|
37
|
+
|
|
38
|
+
### Epic: [Epic Name]
|
|
39
|
+
|
|
40
|
+
- [ ] ...
|
|
41
|
+
|
|
42
|
+
## 6. Scope
|
|
43
|
+
|
|
44
|
+
### In Scope (MVP)
|
|
45
|
+
|
|
46
|
+
- [x] Feature 1
|
|
47
|
+
- [x] Feature 2
|
|
48
|
+
|
|
49
|
+
### Out of Scope (Future)
|
|
50
|
+
|
|
51
|
+
- [ ] Feature 3
|
|
52
|
+
- [ ] Feature 4
|
|
53
|
+
|
|
54
|
+
## 7. Technical Architecture
|
|
55
|
+
|
|
56
|
+
### Tech Stack
|
|
57
|
+
|
|
58
|
+
| Layer | Technology | Rationale |
|
|
59
|
+
|-------|-----------|-----------|
|
|
60
|
+
| Frontend | | |
|
|
61
|
+
| Backend | | |
|
|
62
|
+
| Database | | |
|
|
63
|
+
| Auth | | |
|
|
64
|
+
| Hosting | | |
|
|
65
|
+
|
|
66
|
+
### System Diagram
|
|
67
|
+
|
|
68
|
+
Describe the high-level architecture: which services exist, how they communicate, where data lives.
|
|
69
|
+
|
|
70
|
+
## 8. Data Model
|
|
71
|
+
|
|
72
|
+
List core entities, their key fields, and relationships.
|
|
73
|
+
|
|
74
|
+
## 9. API Design
|
|
75
|
+
|
|
76
|
+
List key endpoints or API surface area.
|
|
77
|
+
|
|
78
|
+
| Method | Endpoint | Purpose |
|
|
79
|
+
|--------|----------|---------|
|
|
80
|
+
| | | |
|
|
81
|
+
|
|
82
|
+
## 10. UI/UX Overview
|
|
83
|
+
|
|
84
|
+
Describe key screens/pages and user flows. Reference wireframes if available.
|
|
85
|
+
|
|
86
|
+
## 11. Implementation Phases
|
|
87
|
+
|
|
88
|
+
### Phase 1: Foundation (MVP)
|
|
89
|
+
- ...
|
|
90
|
+
|
|
91
|
+
### Phase 2: Enhancement
|
|
92
|
+
- ...
|
|
93
|
+
|
|
94
|
+
### Phase 3: Scale
|
|
95
|
+
- ...
|
|
96
|
+
|
|
97
|
+
## 12. Security Considerations
|
|
98
|
+
|
|
99
|
+
- Authentication method
|
|
100
|
+
- Authorization model
|
|
101
|
+
- Data protection
|
|
102
|
+
- OWASP concerns
|
|
103
|
+
|
|
104
|
+
## 13. Performance Requirements
|
|
105
|
+
|
|
106
|
+
- Response time targets
|
|
107
|
+
- Concurrent user capacity
|
|
108
|
+
- Data volume expectations
|
|
109
|
+
|
|
110
|
+
## 14. Risks & Mitigations
|
|
111
|
+
|
|
112
|
+
| Risk | Impact | Likelihood | Mitigation |
|
|
113
|
+
|------|--------|-----------|------------|
|
|
114
|
+
| | | | |
|
|
115
|
+
|
|
116
|
+
## 15. Open Questions
|
|
117
|
+
|
|
118
|
+
- [ ] Question 1
|
|
119
|
+
- [ ] Question 2
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Global Rules
|
|
2
|
+
|
|
3
|
+
## Git Workflow
|
|
4
|
+
|
|
5
|
+
- Branch naming: `{type}/{description}` (e.g., `feat/user-auth`, `fix/login-redirect`)
|
|
6
|
+
- Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `chore:`, `test:`
|
|
7
|
+
- Always link PRs to GitHub issues
|
|
8
|
+
- Never commit directly to main/master — use feature branches
|
|
9
|
+
|
|
10
|
+
## Code Standards
|
|
11
|
+
|
|
12
|
+
- TypeScript strict mode where applicable
|
|
13
|
+
- Self-documenting code — comments only for non-obvious logic
|
|
14
|
+
- No unnecessary abstractions or over-engineering (YAGNI)
|
|
15
|
+
- DRY — but three similar lines beats a premature abstraction
|
|
16
|
+
|
|
17
|
+
## Pipeline Discipline
|
|
18
|
+
|
|
19
|
+
- For non-trivial work: choose Superpowers or Standard mode before starting
|
|
20
|
+
- Plans are mandatory for L/XL tasks — run `/plan-feature` first
|
|
21
|
+
- Run `/validate` before claiming work is done
|
|
22
|
+
- Run `/evolve` after merging to keep the system improving
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: <Describe when this rule should load>
|
|
3
|
+
globs: ["<glob pattern for file paths>"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# [Domain] Rules
|
|
7
|
+
|
|
8
|
+
## Skill Chain
|
|
9
|
+
|
|
10
|
+
1. <First skill or agent to use>
|
|
11
|
+
2. <Second skill>
|
|
12
|
+
3. <Verification step>
|
|
13
|
+
|
|
14
|
+
## Conventions
|
|
15
|
+
|
|
16
|
+
- <Convention 1>
|
|
17
|
+
- <Convention 2>
|
|
18
|
+
- <Convention 3>
|
|
19
|
+
|
|
20
|
+
## Checklist
|
|
21
|
+
|
|
22
|
+
- [ ] <Post-implementation check 1>
|
|
23
|
+
- [ ] <Post-implementation check 2>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Backend development rules — auto-loads when editing backend/server files
|
|
3
|
+
globs: ["**/backend/**", "**/server/**", "**/api/**", "**/*.controller.*", "**/*.service.*", "**/*.module.*", "**/*.guard.*", "**/*.middleware.*", "**/*.resolver.*"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Rules
|
|
7
|
+
|
|
8
|
+
## Skill Chain
|
|
9
|
+
|
|
10
|
+
When working on backend code, follow this order:
|
|
11
|
+
1. **architect-agent RETRIEVE** — understand current module structure before changes
|
|
12
|
+
2. **context7 MCP** — verify framework API (NestJS, FastAPI, Express, etc.) before writing
|
|
13
|
+
3. **Database MCP** — if schema changes needed, use Supabase MCP or direct SQL
|
|
14
|
+
4. **Implement** — follow patterns from `.claude/references/code-patterns.md`
|
|
15
|
+
5. **architect-agent RECORD** — update knowledge base after structural changes
|
|
16
|
+
|
|
17
|
+
## Conventions
|
|
18
|
+
|
|
19
|
+
- Every endpoint needs input validation (DTOs/schemas)
|
|
20
|
+
- Error responses follow consistent format: `{ error: string, statusCode: number }`
|
|
21
|
+
- Business logic lives in services, not controllers
|
|
22
|
+
- Database queries go through a repository/service layer
|
|
23
|
+
- Environment-specific config via env vars, never hardcoded
|
|
24
|
+
|
|
25
|
+
## Testing
|
|
26
|
+
|
|
27
|
+
- Service methods: unit test with mocked dependencies
|
|
28
|
+
- Controllers: integration test with real service, mocked DB if needed
|
|
29
|
+
- E2E: API endpoint tests with real DB for critical paths
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Database rules — auto-loads when editing migrations, schemas, SQL files
|
|
3
|
+
globs: ["**/migrations/**", "**/*.sql", "**/schema*", "**/prisma/**", "**/drizzle/**", "**/supabase/**"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Rules
|
|
7
|
+
|
|
8
|
+
## Skill Chain
|
|
9
|
+
|
|
10
|
+
1. **Supabase MCP** (if using Supabase): `list_tables` → `execute_sql` → `apply_migration` → `get_advisors`
|
|
11
|
+
2. **`/supabase-postgres-best-practices`** — for schema design and query optimization
|
|
12
|
+
3. **`/mongodb`** or **`/mongodb-development`** — if using MongoDB
|
|
13
|
+
|
|
14
|
+
## Conventions
|
|
15
|
+
|
|
16
|
+
- Every migration is reversible (include up AND down)
|
|
17
|
+
- Never modify existing migrations — always create new ones
|
|
18
|
+
- Add indexes for frequently queried columns
|
|
19
|
+
- Use foreign key constraints for referential integrity
|
|
20
|
+
- RLS policies on all user-facing tables (Supabase)
|
|
21
|
+
|
|
22
|
+
## Post-DDL Checklist
|
|
23
|
+
|
|
24
|
+
After any schema change:
|
|
25
|
+
- [ ] Run Supabase advisors (`get_advisors`) or equivalent linter
|
|
26
|
+
- [ ] Verify RLS policies still work
|
|
27
|
+
- [ ] Update TypeScript types (`generate_typescript_types` or equivalent)
|
|
28
|
+
- [ ] Update architect-agent knowledge base
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Frontend development rules — auto-loads when editing frontend/web files
|
|
3
|
+
globs: ["**/web/**", "**/frontend/**", "**/app/**", "**/*.tsx", "**/*.jsx", "**/components/**", "**/pages/**"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Frontend Rules
|
|
7
|
+
|
|
8
|
+
## Design Skill Gate (MANDATORY)
|
|
9
|
+
|
|
10
|
+
Before creating any UI component or page, ask the user which design approach:
|
|
11
|
+
|
|
12
|
+
1. **`/frontend-design`** — Full page/component creation with bold aesthetics
|
|
13
|
+
2. **`/frontend-aesthetics`** — Lightweight guardrails (typography, color, motion)
|
|
14
|
+
3. **`/ui-ux-pro-max`** — Design planning and exploration (50 styles, 21 palettes)
|
|
15
|
+
|
|
16
|
+
Combination rules:
|
|
17
|
+
- `/frontend-aesthetics` can combine with either of the other two
|
|
18
|
+
- Never combine `/frontend-design` + `/ui-ux-pro-max` — they conflict
|
|
19
|
+
|
|
20
|
+
## Skill Chain
|
|
21
|
+
|
|
22
|
+
1. **architect-agent RETRIEVE** — understand page/component structure
|
|
23
|
+
2. **Design skill** — chosen via gate above
|
|
24
|
+
3. **shadcn MCP** — search and install components: `search_items_in_registries`, `view_items_in_registries`, `get_add_command_for_items`
|
|
25
|
+
4. **context7 MCP** — verify framework API (Next.js, React, etc.)
|
|
26
|
+
5. **tester-agent VERIFY/FLOW** — verify UI after implementation
|
|
27
|
+
|
|
28
|
+
## Conventions
|
|
29
|
+
|
|
30
|
+
- Functional components with hooks
|
|
31
|
+
- Form handling: React Hook Form + Zod validation
|
|
32
|
+
- State: prefer server state (React Query/SWR) over client state
|
|
33
|
+
- Styling: follow project convention (Tailwind, CSS Modules, etc.)
|
|
34
|
+
- Accessibility: semantic HTML, ARIA labels, keyboard navigation
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Mobile development rules — auto-loads when editing mobile/native files
|
|
3
|
+
globs: ["**/mobile/**", "**/native/**", "**/*.native.*", "**/expo/**"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mobile Rules
|
|
7
|
+
|
|
8
|
+
## Expo Skills (use the right one for the task)
|
|
9
|
+
|
|
10
|
+
| Task | Skill |
|
|
11
|
+
|------|-------|
|
|
12
|
+
| Building screens, components, navigation | `/expo-app-design:building-native-ui` |
|
|
13
|
+
| API calls, caching, offline support | `/expo-app-design:native-data-fetching` |
|
|
14
|
+
| Tailwind/NativeWind setup | `/expo-app-design:expo-tailwind-setup` |
|
|
15
|
+
| Dev client builds, TestFlight | `/expo-app-design:expo-dev-client` |
|
|
16
|
+
| API routes with EAS Hosting | `/expo-app-design:expo-api-routes` |
|
|
17
|
+
| Web code in native webview | `/expo-app-design:use-dom` |
|
|
18
|
+
| SwiftUI components | `/expo-app-design:expo-ui-swift-ui` |
|
|
19
|
+
| Jetpack Compose components | `/expo-app-design:expo-ui-jetpack-compose` |
|
|
20
|
+
|
|
21
|
+
## Skill Chain
|
|
22
|
+
|
|
23
|
+
1. **architect-agent RETRIEVE** — understand screen/navigation structure
|
|
24
|
+
2. **Expo skill** — appropriate skill from table above
|
|
25
|
+
3. **context7 MCP** — verify Expo/React Native API
|
|
26
|
+
4. **mobile-tester-agent VERIFY/FLOW** — verify on simulator after implementation
|
|
27
|
+
|
|
28
|
+
## Conventions
|
|
29
|
+
|
|
30
|
+
- Follow Expo Router file-based routing
|
|
31
|
+
- Use platform-specific extensions (`.ios.tsx`, `.android.tsx`) only when necessary
|
|
32
|
+
- Animations via `react-native-reanimated`
|
|
33
|
+
- Navigation state managed by Expo Router, not manually
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Testing rules — auto-loads when editing test files
|
|
3
|
+
globs: ["**/*.test.*", "**/*.spec.*", "**/test/**", "**/tests/**", "**/__tests__/**", "**/e2e/**"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Testing Rules
|
|
7
|
+
|
|
8
|
+
## Test Naming
|
|
9
|
+
|
|
10
|
+
- Describe behavior, not implementation: `it('returns 404 when user not found')` not `it('tests getUserById')`
|
|
11
|
+
- Group by feature/module with `describe` blocks
|
|
12
|
+
|
|
13
|
+
## Test Structure
|
|
14
|
+
|
|
15
|
+
- **Arrange** — set up test data and dependencies
|
|
16
|
+
- **Act** — call the function/endpoint under test
|
|
17
|
+
- **Assert** — verify the result
|
|
18
|
+
|
|
19
|
+
## What to Test
|
|
20
|
+
|
|
21
|
+
- Happy path (expected inputs → expected outputs)
|
|
22
|
+
- Edge cases (empty inputs, boundary values, null/undefined)
|
|
23
|
+
- Error cases (invalid inputs, network failures, permission denied)
|
|
24
|
+
- Do NOT test framework internals or third-party libraries
|
|
25
|
+
|
|
26
|
+
## Mock Policy
|
|
27
|
+
|
|
28
|
+
- Use real databases for integration tests where possible
|
|
29
|
+
- Mock external APIs and third-party services
|
|
30
|
+
- Never mock the module under test
|
|
31
|
+
- Prefer dependency injection over module mocking
|
|
32
|
+
|
|
33
|
+
## Coverage
|
|
34
|
+
|
|
35
|
+
- Critical business logic: aim for high coverage
|
|
36
|
+
- UI components: test behavior (clicks, form submissions), not rendering details
|
|
37
|
+
- Don't chase 100% — test what matters
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git *)",
|
|
5
|
+
"Bash(gh *)",
|
|
6
|
+
"Bash(ls *)",
|
|
7
|
+
"Bash(tree *)",
|
|
8
|
+
"Bash(cat *)",
|
|
9
|
+
"Bash(mkdir *)",
|
|
10
|
+
"Bash(npx *)",
|
|
11
|
+
"Bash(npm *)",
|
|
12
|
+
"Bash(pnpm *)",
|
|
13
|
+
"Bash(node *)",
|
|
14
|
+
"WebFetch(*)",
|
|
15
|
+
"WebSearch(*)",
|
|
16
|
+
"mcp__plugin_context7_context7__resolve-library-id",
|
|
17
|
+
"mcp__plugin_context7_context7__query-docs",
|
|
18
|
+
"mcp__shadcn__search_items_in_registries",
|
|
19
|
+
"mcp__shadcn__view_items_in_registries",
|
|
20
|
+
"mcp__shadcn__get_item_examples_from_registries",
|
|
21
|
+
"mcp__shadcn__get_add_command_for_items",
|
|
22
|
+
"mcp__shadcn__list_items_in_registries"
|
|
23
|
+
],
|
|
24
|
+
"deny": []
|
|
25
|
+
},
|
|
26
|
+
"enableAllProjectMcpServers": true
|
|
27
|
+
}
|