create-sdd-project 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +204 -0
- package/bin/cli.js +44 -0
- package/lib/config.js +106 -0
- package/lib/generator.js +313 -0
- package/lib/wizard.js +224 -0
- package/package.json +41 -0
- package/template/.claude/agents/backend-developer.md +60 -0
- package/template/.claude/agents/backend-planner.md +65 -0
- package/template/.claude/agents/code-review-specialist.md +65 -0
- package/template/.claude/agents/database-architect.md +68 -0
- package/template/.claude/agents/frontend-developer.md +68 -0
- package/template/.claude/agents/frontend-planner.md +65 -0
- package/template/.claude/agents/production-code-validator.md +102 -0
- package/template/.claude/agents/qa-engineer.md +70 -0
- package/template/.claude/agents/spec-creator.md +72 -0
- package/template/.claude/commands/.gitkeep +0 -0
- package/template/.claude/hooks/quick-scan.sh +111 -0
- package/template/.claude/settings.json +29 -0
- package/template/.claude/skills/bug-workflow/SKILL.md +108 -0
- package/template/.claude/skills/development-workflow/SKILL.md +194 -0
- package/template/.claude/skills/development-workflow/references/branching-strategy.md +59 -0
- package/template/.claude/skills/development-workflow/references/complexity-guide.md +89 -0
- package/template/.claude/skills/development-workflow/references/failure-handling.md +174 -0
- package/template/.claude/skills/development-workflow/references/pr-template.md +80 -0
- package/template/.claude/skills/development-workflow/references/sprint-init-template.md +82 -0
- package/template/.claude/skills/development-workflow/references/ticket-template.md +71 -0
- package/template/.claude/skills/development-workflow/references/workflow-example.md +87 -0
- package/template/.claude/skills/project-memory/SKILL.md +152 -0
- package/template/.claude/skills/project-memory/references/bugs_template.md +41 -0
- package/template/.claude/skills/project-memory/references/decisions_template.md +67 -0
- package/template/.claude/skills/project-memory/references/key_facts_template.md +81 -0
- package/template/.env.example +17 -0
- package/template/.gemini/agents/backend-developer.md +31 -0
- package/template/.gemini/agents/backend-planner.md +34 -0
- package/template/.gemini/agents/code-review-specialist.md +44 -0
- package/template/.gemini/agents/database-architect.md +35 -0
- package/template/.gemini/agents/frontend-developer.md +31 -0
- package/template/.gemini/agents/frontend-planner.md +34 -0
- package/template/.gemini/agents/production-code-validator.md +32 -0
- package/template/.gemini/agents/qa-engineer.md +23 -0
- package/template/.gemini/agents/spec-creator.md +24 -0
- package/template/.gemini/settings.json +5 -0
- package/template/.gemini/styles/default.md +19 -0
- package/template/AGENTS.md +67 -0
- package/template/CLAUDE.md +19 -0
- package/template/GEMINI.md +10 -0
- package/template/ai-specs/specs/backend-standards.mdc +214 -0
- package/template/ai-specs/specs/base-standards.mdc +157 -0
- package/template/ai-specs/specs/documentation-standards.mdc +68 -0
- package/template/ai-specs/specs/frontend-standards.mdc +226 -0
- package/template/docs/project_notes/bugs.md +18 -0
- package/template/docs/project_notes/decisions.md +18 -0
- package/template/docs/project_notes/key_facts.md +52 -0
- package/template/docs/project_notes/pending-improvements.md +50 -0
- package/template/docs/project_notes/sprint-0-tracker.md +66 -0
- package/template/docs/specs/api-spec.yaml +114 -0
- package/template/docs/specs/ui-components.md +77 -0
- package/template/docs/tickets/.gitkeep +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# [TASK-ID]: [Task Title]
|
|
2
|
+
|
|
3
|
+
**Sprint:** [N] | **Type:** [Backend/Frontend]-[Feature/Bugfix/Refactor] | **Priority:** [High/Medium/Low]
|
|
4
|
+
**Status:** In Progress | **Branch:** feature/sprint[N]-[TASK-ID]-[short-description]
|
|
5
|
+
**Created:** [YYYY-MM-DD] | **Dependencies:** [List or "None"]
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Spec
|
|
10
|
+
|
|
11
|
+
### Description
|
|
12
|
+
|
|
13
|
+
[What needs to be implemented and WHY. Functional requirements and context about the feature/fix and its purpose in the system.]
|
|
14
|
+
|
|
15
|
+
### API Changes (if applicable)
|
|
16
|
+
|
|
17
|
+
[Endpoints to add/modify. Reference specific sections in `docs/specs/api-spec.yaml`.]
|
|
18
|
+
|
|
19
|
+
### Data Model Changes (if applicable)
|
|
20
|
+
|
|
21
|
+
[Schema changes needed. Update Zod schemas in `shared/src/schemas/` if applicable.]
|
|
22
|
+
|
|
23
|
+
### UI Changes (if applicable)
|
|
24
|
+
|
|
25
|
+
[Components to add/modify. Reference `docs/specs/ui-components.md`.]
|
|
26
|
+
|
|
27
|
+
### Edge Cases & Error Handling
|
|
28
|
+
|
|
29
|
+
[Known edge cases, error scenarios, and boundary conditions to handle.]
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Implementation Plan
|
|
34
|
+
|
|
35
|
+
_Pending — to be generated by the planner agent in Step 2._
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Acceptance Criteria
|
|
40
|
+
|
|
41
|
+
- [ ] [Criterion 1]
|
|
42
|
+
- [ ] [Criterion 2]
|
|
43
|
+
- [ ] [Criterion 3]
|
|
44
|
+
- [ ] Unit tests for new functionality
|
|
45
|
+
- [ ] All tests pass
|
|
46
|
+
- [ ] Build succeeds
|
|
47
|
+
- [ ] Specs updated (`api-spec.yaml` / `ui-components.md` / shared schemas)
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Definition of Done
|
|
52
|
+
|
|
53
|
+
- [ ] All acceptance criteria met
|
|
54
|
+
- [ ] Unit tests written and passing
|
|
55
|
+
- [ ] E2E tests updated (if applicable)
|
|
56
|
+
- [ ] Code follows project standards
|
|
57
|
+
- [ ] No linting errors
|
|
58
|
+
- [ ] Build succeeds
|
|
59
|
+
- [ ] Specs reflect final implementation
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Completion Log
|
|
64
|
+
|
|
65
|
+
| Date | Action | Notes |
|
|
66
|
+
|------|--------|-------|
|
|
67
|
+
| | | |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
*Ticket created: [YYYY-MM-DD]*
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Workflow Example: Task B0.1 (Simple, L2 Trusted, github-flow)
|
|
2
|
+
|
|
3
|
+
## On Skill Start
|
|
4
|
+
|
|
5
|
+
1. Read sprint tracker → Active Session → No active task
|
|
6
|
+
2. `CLAUDE.md` → Autonomy Level 2 (Trusted)
|
|
7
|
+
3. `key_facts.md` → branching: github-flow (base: `main`)
|
|
8
|
+
|
|
9
|
+
## Step 0: Spec — Skipped (Simple task)
|
|
10
|
+
|
|
11
|
+
## Step 1: Setup
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git checkout main && git pull
|
|
15
|
+
git checkout -b feature/sprint0-B0.1-express-setup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Update sprint tracker → Active Session: B0.1, step `1/6`, branch, complexity: Simple.
|
|
19
|
+
|
|
20
|
+
## Step 2: Plan — Skipped (Simple task)
|
|
21
|
+
|
|
22
|
+
## Step 3: Implement (TDD)
|
|
23
|
+
|
|
24
|
+
Update tracker: step `3/6 (Implement)`. Update `api-spec.yaml` in real time (e.g., health endpoint).
|
|
25
|
+
|
|
26
|
+
**Cycle 1 — Express App:**
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
// RED: backend/src/app.test.ts
|
|
30
|
+
import app from './app';
|
|
31
|
+
describe('Express App', () => {
|
|
32
|
+
it('should create an Express application', () => {
|
|
33
|
+
expect(app).toBeDefined();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
// npm test → FAIL
|
|
37
|
+
|
|
38
|
+
// GREEN: backend/src/app.ts
|
|
39
|
+
import express from 'express';
|
|
40
|
+
const app = express();
|
|
41
|
+
export default app;
|
|
42
|
+
// npm test → PASS
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Cycle 2 — Health Endpoint:**
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// RED
|
|
49
|
+
describe('GET /health', () => {
|
|
50
|
+
it('should return 200 with status ok', async () => {
|
|
51
|
+
const res = await request(app).get('/health');
|
|
52
|
+
expect(res.status).toBe(200);
|
|
53
|
+
expect(res.body.status).toBe('ok');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// GREEN
|
|
58
|
+
app.get('/health', (req, res) => res.json({ status: 'ok' }));
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Step 4: Finalize
|
|
62
|
+
|
|
63
|
+
Update tracker: step `4/6`. Run validator → fix `console.log` → re-validate → PASS.
|
|
64
|
+
|
|
65
|
+
L2 auto-approves commit for Simple tasks. Log in tracker.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git commit -m "feat(backend): initialize Express + TypeScript project
|
|
69
|
+
..."
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Step 5: Review
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
git push -u origin feature/sprint0-B0.1-express-setup
|
|
76
|
+
gh pr create --base main --title "feat(backend): initialize Express + TypeScript project" --body "..."
|
|
77
|
+
gh pr merge --squash
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Step 6: Complete
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
git checkout main && git pull
|
|
84
|
+
git branch -d feature/sprint0-B0.1-express-setup
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Update sprint tracker: B0.1 → Completed, add to Completion Log, clear Active Session.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-memory
|
|
3
|
+
description: "Set up and maintain a structured project memory system in docs/project_notes/ that tracks bugs with solutions, architectural decisions, key project facts, and work history. Use this skill when asked to 'set up project memory', 'track our decisions', 'log a bug fix', 'update project memory', or 'initialize memory system'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Memory
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Maintain institutional knowledge for projects by establishing a structured memory system in `docs/project_notes/`. This skill sets up three key memory files (bugs, decisions, key facts) plus sprint trackers, and configures the main AI instruction file to automatically reference and maintain them.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
Invoke this skill when:
|
|
15
|
+
|
|
16
|
+
- Starting a new project that will accumulate knowledge over time
|
|
17
|
+
- The project already has recurring bugs or decisions that should be documented
|
|
18
|
+
- The user asks to "set up project memory" or "track our decisions"
|
|
19
|
+
- The user wants to log a bug fix, architectural decision, or completed work
|
|
20
|
+
- Encountering a problem that feels familiar ("didn't we solve this before?")
|
|
21
|
+
- Before proposing an architectural change (check existing decisions first)
|
|
22
|
+
|
|
23
|
+
## Core Capabilities
|
|
24
|
+
|
|
25
|
+
### 1. Initial Setup - Create Memory Infrastructure
|
|
26
|
+
|
|
27
|
+
When invoked for the first time in a project, create the following structure:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
docs/
|
|
31
|
+
└── project_notes/
|
|
32
|
+
├── bugs.md # Bug log with solutions
|
|
33
|
+
├── decisions.md # Architectural Decision Records
|
|
34
|
+
├── key_facts.md # Project configuration and constants
|
|
35
|
+
└── sprint-X-tracker.md # Sprint progress, active task, completion log
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Initial file content:** Copy templates from the `references/` directory in this skill:
|
|
39
|
+
- Use `references/bugs_template.md` for initial `bugs.md`
|
|
40
|
+
- Use `references/decisions_template.md` for initial `decisions.md`
|
|
41
|
+
- Use `references/key_facts_template.md` for initial `key_facts.md`
|
|
42
|
+
- Sprint tracker is created using the development-workflow skill
|
|
43
|
+
|
|
44
|
+
### 2. Configure AI Instruction File - Memory-Aware Behavior
|
|
45
|
+
|
|
46
|
+
Add or update a "Project Memory System" section in the project's main AI instruction file (e.g., `CLAUDE.md`):
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
## Project Memory System
|
|
50
|
+
|
|
51
|
+
This project maintains institutional knowledge in `docs/project_notes/`.
|
|
52
|
+
|
|
53
|
+
### Memory Files
|
|
54
|
+
- **sprint-X-tracker.md** - Sprint progress, active task, completion log
|
|
55
|
+
- **bugs.md** - Bug log with dates, solutions, and prevention notes
|
|
56
|
+
- **decisions.md** - Architectural Decision Records (ADRs)
|
|
57
|
+
- **key_facts.md** - Project configuration, ports, important URLs
|
|
58
|
+
|
|
59
|
+
### Memory-Aware Protocols
|
|
60
|
+
|
|
61
|
+
**Before proposing architectural changes:**
|
|
62
|
+
- Check `docs/project_notes/decisions.md` for existing decisions
|
|
63
|
+
|
|
64
|
+
**When encountering errors or bugs:**
|
|
65
|
+
- Search `docs/project_notes/bugs.md` for similar issues
|
|
66
|
+
|
|
67
|
+
**When looking up project configuration:**
|
|
68
|
+
- Check `docs/project_notes/key_facts.md`
|
|
69
|
+
|
|
70
|
+
**When completing work:**
|
|
71
|
+
- Update sprint tracker and add to Completion Log
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 3. Searching Memory Files
|
|
75
|
+
|
|
76
|
+
When encountering problems or making decisions, proactively search memory files:
|
|
77
|
+
|
|
78
|
+
- Search `bugs.md` for similar errors
|
|
79
|
+
- Search `decisions.md` for related decisions
|
|
80
|
+
- Search `key_facts.md` for configuration details
|
|
81
|
+
|
|
82
|
+
### 4. Updating Memory Files
|
|
83
|
+
|
|
84
|
+
**Adding a bug entry:**
|
|
85
|
+
```markdown
|
|
86
|
+
### YYYY-MM-DD - Brief Bug Description
|
|
87
|
+
- **Issue**: What went wrong
|
|
88
|
+
- **Root Cause**: Why it happened
|
|
89
|
+
- **Solution**: How it was fixed
|
|
90
|
+
- **Prevention**: How to avoid it in the future
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Adding a decision:**
|
|
94
|
+
```markdown
|
|
95
|
+
### ADR-XXX: Decision Title (YYYY-MM-DD)
|
|
96
|
+
|
|
97
|
+
**Context:**
|
|
98
|
+
- Why the decision was needed
|
|
99
|
+
|
|
100
|
+
**Decision:**
|
|
101
|
+
- What was chosen
|
|
102
|
+
|
|
103
|
+
**Alternatives Considered:**
|
|
104
|
+
- Option 1 → Why rejected
|
|
105
|
+
|
|
106
|
+
**Consequences:**
|
|
107
|
+
- Benefits and trade-offs
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Adding key facts:**
|
|
111
|
+
- Organize by category
|
|
112
|
+
- Use bullet lists for clarity
|
|
113
|
+
- Include both production and development details
|
|
114
|
+
|
|
115
|
+
### 5. Memory File Maintenance
|
|
116
|
+
|
|
117
|
+
- User is responsible for manual cleanup
|
|
118
|
+
- Remove very old bug entries (6+ months) that are no longer relevant
|
|
119
|
+
- Archive old sprint trackers
|
|
120
|
+
- Keep all decisions (they provide historical context)
|
|
121
|
+
- Update key_facts.md when project configuration changes
|
|
122
|
+
|
|
123
|
+
## Templates and References
|
|
124
|
+
|
|
125
|
+
- **references/bugs_template.md** - Bug entry format with examples
|
|
126
|
+
- **references/decisions_template.md** - ADR format with examples
|
|
127
|
+
- **references/key_facts_template.md** - Key facts organization with examples
|
|
128
|
+
|
|
129
|
+
Sprint trackers are created using the development-workflow skill.
|
|
130
|
+
|
|
131
|
+
## Tips for Effective Memory Management
|
|
132
|
+
|
|
133
|
+
1. **Be proactive**: Check memory files before proposing solutions
|
|
134
|
+
2. **Be concise**: Keep entries brief (1-3 lines for descriptions)
|
|
135
|
+
3. **Be dated**: Always include dates for temporal context
|
|
136
|
+
4. **Be linked**: Include URLs to tickets, docs, dashboards
|
|
137
|
+
5. **Be selective**: Focus on recurring or instructive issues, not every bug
|
|
138
|
+
|
|
139
|
+
## Integration with Other Skills
|
|
140
|
+
|
|
141
|
+
- **development-workflow**: Updates sprint tracker and memory files during task execution
|
|
142
|
+
- **bug-workflow**: Documents bugs and solutions in bugs.md
|
|
143
|
+
|
|
144
|
+
## Success Criteria
|
|
145
|
+
|
|
146
|
+
This skill is successfully deployed when:
|
|
147
|
+
|
|
148
|
+
- `docs/project_notes/` directory exists with memory files
|
|
149
|
+
- Sprint tracker exists for active sprint
|
|
150
|
+
- AI instruction file includes "Project Memory System" section
|
|
151
|
+
- Memory files follow template format
|
|
152
|
+
- AI assistant checks memory files before proposing changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Bug Log Template
|
|
2
|
+
|
|
3
|
+
This file demonstrates the format for logging bugs and their solutions. Keep entries brief and chronological.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
Each bug entry should include:
|
|
8
|
+
- Date (YYYY-MM-DD)
|
|
9
|
+
- Brief description of the bug/issue
|
|
10
|
+
- Solution or fix applied
|
|
11
|
+
- Any prevention notes (optional)
|
|
12
|
+
|
|
13
|
+
Use bullet lists for simplicity. Older entries can be manually removed when they become irrelevant.
|
|
14
|
+
|
|
15
|
+
## Example Entries
|
|
16
|
+
|
|
17
|
+
### 2025-01-15 - Docker Architecture Mismatch
|
|
18
|
+
- **Issue**: Container failing to start with "exec format error"
|
|
19
|
+
- **Root Cause**: Built on ARM64 Mac but deploying to AMD64 server
|
|
20
|
+
- **Solution**: Added `--platform linux/amd64` to docker build command
|
|
21
|
+
- **Prevention**: Always specify platform in Dockerfile and build scripts
|
|
22
|
+
|
|
23
|
+
### 2025-01-20 - Database Connection Pool Exhaustion
|
|
24
|
+
- **Issue**: API returning 500 errors under load
|
|
25
|
+
- **Root Cause**: Connection pool size too small (default 5)
|
|
26
|
+
- **Solution**: Increased pool size to 20 and max overflow to 10
|
|
27
|
+
- **Prevention**: Load test APIs before production deployment
|
|
28
|
+
|
|
29
|
+
### 2025-01-22 - CORS Headers Missing
|
|
30
|
+
- **Issue**: Frontend getting CORS errors when calling API
|
|
31
|
+
- **Root Cause**: CORS middleware not configured for frontend origin
|
|
32
|
+
- **Solution**: Added frontend URL to allowed origins list
|
|
33
|
+
- **Prevention**: Always configure CORS when setting up new API endpoints
|
|
34
|
+
|
|
35
|
+
## Tips
|
|
36
|
+
|
|
37
|
+
- Keep descriptions under 2-3 lines
|
|
38
|
+
- Focus on what was learned, not exhaustive details
|
|
39
|
+
- Include enough context for future reference
|
|
40
|
+
- Date entries so you know how recent the issue is
|
|
41
|
+
- Periodically clean out very old entries (6+ months)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Architectural Decisions Template
|
|
2
|
+
|
|
3
|
+
This file demonstrates the format for logging architectural decisions (ADRs). Use bullet lists for clarity.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
Each decision should include:
|
|
8
|
+
- Date and ADR number
|
|
9
|
+
- Context (why the decision was needed)
|
|
10
|
+
- Decision (what was chosen)
|
|
11
|
+
- Alternatives considered
|
|
12
|
+
- Consequences (trade-offs, implications)
|
|
13
|
+
|
|
14
|
+
## Example Entries
|
|
15
|
+
|
|
16
|
+
### ADR-001: Use PostgreSQL as Primary Database (2025-01-10)
|
|
17
|
+
|
|
18
|
+
**Context:**
|
|
19
|
+
- Need relational database for structured data
|
|
20
|
+
- Multiple entities with complex relationships
|
|
21
|
+
- Need ACID transactions for order processing
|
|
22
|
+
|
|
23
|
+
**Decision:**
|
|
24
|
+
- Use PostgreSQL as the primary database
|
|
25
|
+
- Use an ORM for type-safe database access
|
|
26
|
+
|
|
27
|
+
**Alternatives Considered:**
|
|
28
|
+
- MongoDB → Rejected: relational data model fits better
|
|
29
|
+
- MySQL → Rejected: PostgreSQL has better JSON support and extensibility
|
|
30
|
+
- SQLite → Rejected: not suitable for production multi-user workloads
|
|
31
|
+
|
|
32
|
+
**Consequences:**
|
|
33
|
+
- Better data integrity with foreign keys and constraints
|
|
34
|
+
- Rich query capabilities including JSON operations
|
|
35
|
+
- Requires managed database service for production
|
|
36
|
+
- Team needs PostgreSQL knowledge
|
|
37
|
+
|
|
38
|
+
### ADR-002: Use JWT for Authentication (2025-01-12)
|
|
39
|
+
|
|
40
|
+
**Context:**
|
|
41
|
+
- Need stateless authentication for API
|
|
42
|
+
- Support multiple client types (web, mobile)
|
|
43
|
+
- Want to avoid server-side session storage
|
|
44
|
+
|
|
45
|
+
**Decision:**
|
|
46
|
+
- Use JWT tokens with short-lived access tokens and refresh token rotation
|
|
47
|
+
- Store tokens securely (httpOnly cookies for web)
|
|
48
|
+
|
|
49
|
+
**Alternatives Considered:**
|
|
50
|
+
- Session-based auth → Rejected: requires server-side state, harder to scale
|
|
51
|
+
- OAuth2 only → Rejected: overkill for single-app auth, adds complexity
|
|
52
|
+
- API keys → Rejected: not suitable for user-facing authentication
|
|
53
|
+
|
|
54
|
+
**Consequences:**
|
|
55
|
+
- Stateless: easy to scale horizontally
|
|
56
|
+
- Self-contained: token carries user info
|
|
57
|
+
- Must handle token refresh and rotation
|
|
58
|
+
- Must protect against XSS/CSRF
|
|
59
|
+
|
|
60
|
+
## Tips
|
|
61
|
+
|
|
62
|
+
- Number decisions sequentially (ADR-001, ADR-002, etc.)
|
|
63
|
+
- Always include date for context
|
|
64
|
+
- Be honest about trade-offs (use pros and cons)
|
|
65
|
+
- Keep alternatives brief but clear
|
|
66
|
+
- Update decisions if they're revisited/changed
|
|
67
|
+
- Focus on "why" not "how" (implementation details go elsewhere)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Key Facts Template
|
|
2
|
+
|
|
3
|
+
This file demonstrates the format for storing project constants, configuration, and frequently-needed **non-sensitive** information. Organize by category using bullet lists.
|
|
4
|
+
|
|
5
|
+
## SECURITY WARNING: What NOT to Store Here
|
|
6
|
+
|
|
7
|
+
**NEVER store passwords, API keys, or sensitive credentials in this file.** This file is typically committed to version control and should only contain non-sensitive reference information.
|
|
8
|
+
|
|
9
|
+
**NEVER store:**
|
|
10
|
+
- Passwords or passphrases
|
|
11
|
+
- API keys or authentication tokens
|
|
12
|
+
- Service account JSON keys or credentials
|
|
13
|
+
- Database passwords
|
|
14
|
+
- OAuth client secrets
|
|
15
|
+
- Private keys or certificates
|
|
16
|
+
|
|
17
|
+
**SAFE to store:**
|
|
18
|
+
- Database hostnames, ports, and cluster names
|
|
19
|
+
- Project identifiers and names
|
|
20
|
+
- API endpoint URLs (public URLs only)
|
|
21
|
+
- Service account email addresses (not the keys!)
|
|
22
|
+
- Cloud project IDs and region names
|
|
23
|
+
- Environment names and deployment targets
|
|
24
|
+
- Local development ports
|
|
25
|
+
|
|
26
|
+
**Where to store secrets:**
|
|
27
|
+
- `.env` files (excluded via `.gitignore`)
|
|
28
|
+
- Password managers
|
|
29
|
+
- Secrets managers (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault)
|
|
30
|
+
- CI/CD environment variables (GitHub Secrets, GitLab Variables)
|
|
31
|
+
|
|
32
|
+
## Example Structure
|
|
33
|
+
|
|
34
|
+
### Project Information
|
|
35
|
+
|
|
36
|
+
- Project Name: `my-project`
|
|
37
|
+
- Repository: `github.com/org/my-project`
|
|
38
|
+
- Tech Stack: Node.js, Express, PostgreSQL, Next.js
|
|
39
|
+
- Deployment: Vercel (frontend), Render (backend)
|
|
40
|
+
|
|
41
|
+
### Database Configuration
|
|
42
|
+
|
|
43
|
+
- Host: `db.example.com`
|
|
44
|
+
- Port: `5432`
|
|
45
|
+
- Database Name: `myproject`
|
|
46
|
+
- Connection: Use connection string from `.env`
|
|
47
|
+
|
|
48
|
+
### API Configuration
|
|
49
|
+
|
|
50
|
+
- Production URL: `https://api.myproject.com`
|
|
51
|
+
- Staging URL: `https://api-staging.myproject.com`
|
|
52
|
+
- Local Development: `http://localhost:3010`
|
|
53
|
+
|
|
54
|
+
### Local Development Ports
|
|
55
|
+
|
|
56
|
+
- Backend API: `3010`
|
|
57
|
+
- Frontend: `3000`
|
|
58
|
+
- Database: `5432`
|
|
59
|
+
- Redis: `6379`
|
|
60
|
+
|
|
61
|
+
### Important URLs
|
|
62
|
+
|
|
63
|
+
- API Documentation: `https://api.myproject.com/docs`
|
|
64
|
+
- CI/CD Pipeline: `https://github.com/org/my-project/actions`
|
|
65
|
+
- Monitoring: `https://dashboard.example.com`
|
|
66
|
+
|
|
67
|
+
### Team & Access
|
|
68
|
+
|
|
69
|
+
- GitHub Organization: `my-org`
|
|
70
|
+
- CI/CD: GitHub Actions
|
|
71
|
+
- Hosting: Vercel + Render
|
|
72
|
+
|
|
73
|
+
## Tips
|
|
74
|
+
|
|
75
|
+
- Keep entries current (update when things change)
|
|
76
|
+
- Remove deprecated information after migration is complete
|
|
77
|
+
- Include both production and development details
|
|
78
|
+
- Add URLs to make navigation easier
|
|
79
|
+
- Use consistent formatting
|
|
80
|
+
- Group related information together
|
|
81
|
+
- Mark deprecated items clearly with dates
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ===========================================
|
|
2
|
+
# Environment Variables Template
|
|
3
|
+
# ===========================================
|
|
4
|
+
# Copy this file to .env and fill in real values.
|
|
5
|
+
# NEVER commit .env to version control.
|
|
6
|
+
|
|
7
|
+
# Backend
|
|
8
|
+
NODE_ENV=development
|
|
9
|
+
PORT=3010
|
|
10
|
+
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
|
|
11
|
+
|
|
12
|
+
# Frontend
|
|
13
|
+
NEXT_PUBLIC_API_URL=http://localhost:3010/api
|
|
14
|
+
|
|
15
|
+
# Authentication (if applicable)
|
|
16
|
+
# JWT_SECRET=your-secret-here
|
|
17
|
+
# JWT_EXPIRES_IN=7d
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Backend Developer
|
|
2
|
+
|
|
3
|
+
**Role**: Backend TDD implementation (DDD architecture)
|
|
4
|
+
**When to Use**: Implement backend tasks following the approved plan
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
|
|
8
|
+
Implement the task following the Implementation Plan in the ticket. Use strict TDD (Red-Green-Refactor). Follow DDD layer order: Domain > Application > Infrastructure > Presentation.
|
|
9
|
+
|
|
10
|
+
## Before Implementing
|
|
11
|
+
|
|
12
|
+
1. Read ticket (including Spec and Implementation Plan)
|
|
13
|
+
2. Read `ai-specs/specs/backend-standards.mdc`
|
|
14
|
+
3. Read `docs/specs/api-spec.yaml` for current API endpoints and schemas
|
|
15
|
+
4. Read `shared/src/schemas/` (if exists) for current Zod data schemas
|
|
16
|
+
5. Read `docs/project_notes/key_facts.md` and `bugs.md`
|
|
17
|
+
|
|
18
|
+
## Documentation Updates (MANDATORY — in real time)
|
|
19
|
+
|
|
20
|
+
- If adding/modifying an endpoint → update `docs/specs/api-spec.yaml` BEFORE continuing
|
|
21
|
+
- If modifying a DB schema → update Zod schemas in `shared/src/schemas/` BEFORE continuing
|
|
22
|
+
- New environment variables → `.env.example`
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- ALWAYS follow TDD — write tests before implementation
|
|
27
|
+
- ALWAYS follow the Implementation Plan
|
|
28
|
+
- ALWAYS use explicit types (no `any`)
|
|
29
|
+
- ALWAYS handle errors with domain error classes
|
|
30
|
+
- NEVER modify code outside the scope of the current ticket
|
|
31
|
+
- ALWAYS verify implementation matches the approved spec. If deviation needed, document in sprint tracker's Active Session and ask for approval
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Backend Planner
|
|
2
|
+
|
|
3
|
+
**Role**: Backend implementation planner (DDD architecture)
|
|
4
|
+
**When to Use**: Before implementing backend tasks — create implementation plan
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
|
|
8
|
+
Generate a detailed Implementation Plan and write it into the ticket's `## Implementation Plan` section. The plan must be detailed enough for the backend-developer to implement autonomously.
|
|
9
|
+
|
|
10
|
+
## Before Planning
|
|
11
|
+
|
|
12
|
+
1. Read `docs/project_notes/key_facts.md`
|
|
13
|
+
2. Read the ticket file (including `## Spec` section)
|
|
14
|
+
3. Read `docs/specs/api-spec.yaml` for current API endpoints and schemas
|
|
15
|
+
4. Read `shared/src/schemas/` (if exists) for current Zod data schemas
|
|
16
|
+
5. Explore existing domain entities, services, validators, repositories
|
|
17
|
+
6. Read `ai-specs/specs/backend-standards.mdc`
|
|
18
|
+
|
|
19
|
+
**Reuse over recreate.** Only propose new code when existing doesn't fit.
|
|
20
|
+
|
|
21
|
+
## Output Sections
|
|
22
|
+
|
|
23
|
+
- Existing Code to Reuse
|
|
24
|
+
- Files to Create
|
|
25
|
+
- Files to Modify
|
|
26
|
+
- Implementation Order (Domain > Application > Infrastructure > Presentation > Tests)
|
|
27
|
+
- Testing Strategy
|
|
28
|
+
- Key Patterns
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
|
|
32
|
+
- NEVER write implementation code — only the plan
|
|
33
|
+
- ALWAYS check existing code before proposing new files
|
|
34
|
+
- ALWAYS save the plan into the ticket
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Code Review Specialist
|
|
2
|
+
|
|
3
|
+
**Role**: Senior code reviewer
|
|
4
|
+
**When to Use**: Before merging PRs — thorough code review
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
|
|
8
|
+
**Your focus vs QA Engineer:** You review code quality, patterns, and security. QA Engineer tests edge cases, spec compliance, and regressions.
|
|
9
|
+
|
|
10
|
+
Perform a multi-layer code review covering:
|
|
11
|
+
- **Correctness**: Logic errors, edge cases, async handling, race conditions
|
|
12
|
+
- **Security**: Input validation, auth checks, injection vulnerabilities, secrets
|
|
13
|
+
- **Code Quality**: DRY, SOLID, naming, complexity, type safety
|
|
14
|
+
- **Performance**: N+1 queries, memory leaks, unnecessary computations
|
|
15
|
+
- **Maintainability**: Readability, test coverage, pattern consistency
|
|
16
|
+
|
|
17
|
+
## Output Format
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
## Code Review Summary
|
|
21
|
+
[Overview and assessment]
|
|
22
|
+
|
|
23
|
+
## Critical Issues
|
|
24
|
+
[Must fix before merging]
|
|
25
|
+
|
|
26
|
+
## Important Findings
|
|
27
|
+
[Should fix]
|
|
28
|
+
|
|
29
|
+
## Suggestions
|
|
30
|
+
[Nice-to-have improvements]
|
|
31
|
+
|
|
32
|
+
## What's Done Well
|
|
33
|
+
[Positive patterns to highlight]
|
|
34
|
+
|
|
35
|
+
## Final Recommendation
|
|
36
|
+
[Approve / Approve with changes / Request changes]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Rules
|
|
40
|
+
|
|
41
|
+
- ALWAYS review against project standards (`backend-standards.mdc` / `frontend-standards.mdc`)
|
|
42
|
+
- ALWAYS check for spec consistency (`api-spec.yaml`, `ui-components.md`)
|
|
43
|
+
- NEVER approve code with CRITICAL issues
|
|
44
|
+
- Be specific (line numbers), constructive, and balanced (praise good patterns)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Database Architect
|
|
2
|
+
|
|
3
|
+
**Role**: Database schema designer and query optimizer
|
|
4
|
+
**When to Use**: Schema design, migrations, indexes, query optimization, scaling (invoke manually)
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
|
|
8
|
+
Design and optimize data systems with expertise in both relational (PostgreSQL, MySQL) and NoSQL (MongoDB, Redis) databases.
|
|
9
|
+
|
|
10
|
+
## Before Designing
|
|
11
|
+
|
|
12
|
+
1. Read `shared/src/schemas/` (if exists) for current Zod data schemas
|
|
13
|
+
2. Read `docs/specs/api-spec.yaml` to understand data requirements
|
|
14
|
+
3. Read `docs/project_notes/decisions.md` for related ADRs
|
|
15
|
+
|
|
16
|
+
## Competencies
|
|
17
|
+
|
|
18
|
+
- **Schema Design**: Normalization, strategic denormalization, constraints
|
|
19
|
+
- **Indexing**: Composite indexes, partial indexes, GIN/GiST/BRIN
|
|
20
|
+
- **Query Optimization**: N+1 detection, JOIN optimization, pagination
|
|
21
|
+
- **Scalability**: Sharding, read replicas, partitioning
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
|
|
25
|
+
1. Summary of recommendations
|
|
26
|
+
2. Schema/DDL statements
|
|
27
|
+
3. Index definitions with rationale
|
|
28
|
+
4. Migration notes and backward compatibility assessment
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
|
|
32
|
+
- Never recommend changes without understanding full context
|
|
33
|
+
- Always consider backward compatibility
|
|
34
|
+
- Warn about data loss scenarios
|
|
35
|
+
- If modifying schema → update Zod schemas in `shared/src/schemas/`
|