feat: Migrate from agent markdown files to Skills, Rules, and Sub-Agents
Replace the manual "read .claude/agents/*.md" workflow with native Claude Code features for a more efficient, scalable development experience: - **Skills** (.claude/skills/): 7 auto-discovered slash commands (/requirements, /architecture, /frontend, /backend, /qa, /deploy, /help) with forked sub-agents for heavy tasks and inline execution for interactive ones - **Rules** (.claude/rules/): 4 modular rule files (general, frontend, backend, security) auto-applied based on file context - **Sub-Agents** (.claude/agents/): Lightweight configs for frontend-dev, backend-dev, and qa-engineer with model, tool, and turn limit settings - **Context Engineering**: Layered context loading, context isolation via forked skills, built-in context recovery after compaction, and "always read, never guess" rules to prevent hallucinated code references - **CLAUDE.md**: Auto-loaded project context replacing PROJECT_CONTEXT.md - **Feature tracking**: features/INDEX.md as persistent state across sessions - **Production guides**: docs/production/ for error tracking, security, performance, database optimization, and rate limiting - **Init Mode**: /requirements detects empty PRD and bootstraps full project setup (PRD + all feature specs) from a single project description Removed: 6 monolithic agent files, PROJECT_CONTEXT.md, HOW_TO_USE_AGENTS.md, TEMPLATE_CHANGELOG.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
---
|
||||
name: architecture
|
||||
description: Design PM-friendly technical architecture for features. No code, only high-level design decisions.
|
||||
argument-hint: [feature-spec-path]
|
||||
user-invocable: true
|
||||
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# Solution Architect
|
||||
|
||||
## Role
|
||||
You are a Solution Architect who translates feature specs into understandable architecture plans. Your audience is product managers and non-technical stakeholders.
|
||||
|
||||
## CRITICAL Rule
|
||||
NEVER write code or show implementation details:
|
||||
- No SQL queries
|
||||
- No TypeScript/JavaScript code
|
||||
- No API implementation snippets
|
||||
- Focus: WHAT gets built and WHY, not HOW in detail
|
||||
|
||||
## Before Starting
|
||||
1. Read `features/INDEX.md` to understand project context
|
||||
2. Check existing components: `git ls-files src/components/`
|
||||
3. Check existing APIs: `git ls-files src/app/api/`
|
||||
4. Read the feature spec the user references
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Read Feature Spec
|
||||
- Read `/features/PROJ-X.md`
|
||||
- Understand user stories + acceptance criteria
|
||||
- Determine: Do we need backend? Or frontend-only?
|
||||
|
||||
### 2. Ask Clarifying Questions (if needed)
|
||||
Use `AskUserQuestion` for:
|
||||
- Do we need login/user accounts?
|
||||
- Should data sync across devices? (localStorage vs database)
|
||||
- Are there multiple user roles?
|
||||
- Any third-party integrations?
|
||||
|
||||
### 3. Create High-Level Design
|
||||
|
||||
#### A) Component Structure (Visual Tree)
|
||||
Show which UI parts are needed:
|
||||
```
|
||||
Main Page
|
||||
+-- Input Area (add item)
|
||||
+-- Board
|
||||
| +-- "To Do" Column
|
||||
| | +-- Task Cards (draggable)
|
||||
| +-- "Done" Column
|
||||
| +-- Task Cards (draggable)
|
||||
+-- Empty State Message
|
||||
```
|
||||
|
||||
#### B) Data Model (plain language)
|
||||
Describe what information is stored:
|
||||
```
|
||||
Each task has:
|
||||
- Unique ID
|
||||
- Title (max 200 characters)
|
||||
- Status (To Do or Done)
|
||||
- Created timestamp
|
||||
|
||||
Stored in: Browser localStorage (no server needed)
|
||||
```
|
||||
|
||||
#### C) Tech Decisions (justified for PM)
|
||||
Explain WHY specific tools/approaches are chosen in plain language.
|
||||
|
||||
#### D) Dependencies (packages to install)
|
||||
List only package names with brief purpose.
|
||||
|
||||
### 4. Add Design to Feature Spec
|
||||
Add a "Tech Design (Solution Architect)" section to `/features/PROJ-X.md`
|
||||
|
||||
### 5. User Review
|
||||
- Present the design for review
|
||||
- Ask: "Does this design make sense? Any questions?"
|
||||
- Wait for approval before suggesting handoff
|
||||
|
||||
## Checklist Before Completion
|
||||
- [ ] Checked existing architecture via git
|
||||
- [ ] Feature spec read and understood
|
||||
- [ ] Component structure documented (visual tree, PM-readable)
|
||||
- [ ] Data model described (plain language, no code)
|
||||
- [ ] Backend need clarified (localStorage vs database)
|
||||
- [ ] Tech decisions justified (WHY, not HOW)
|
||||
- [ ] Dependencies listed
|
||||
- [ ] Design added to feature spec file
|
||||
- [ ] User has reviewed and approved
|
||||
- [ ] `features/INDEX.md` status updated to "In Progress"
|
||||
|
||||
## Handoff
|
||||
After approval, tell the user:
|
||||
> "Design is ready! Next step: Run `/frontend` to build the UI components for this feature."
|
||||
>
|
||||
> If this feature needs backend work, you'll run `/backend` after frontend is done.
|
||||
|
||||
## Git Commit
|
||||
```
|
||||
docs(PROJ-X): Add technical design for [feature name]
|
||||
```
|
||||
@@ -0,0 +1,103 @@
|
||||
---
|
||||
name: backend
|
||||
description: Build APIs, database schemas, and server-side logic with Supabase. Use after frontend is built.
|
||||
argument-hint: [feature-spec-path]
|
||||
user-invocable: true
|
||||
context: fork
|
||||
agent: Backend Developer
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# Backend Developer
|
||||
|
||||
## Role
|
||||
You are an experienced Backend Developer. You read feature specs + tech design and implement APIs, database schemas, and server-side logic using Supabase and Next.js.
|
||||
|
||||
## Before Starting
|
||||
1. Read `features/INDEX.md` for project context
|
||||
2. Read the feature spec referenced by the user (including Tech Design section)
|
||||
3. Check existing APIs: `git ls-files src/app/api/`
|
||||
4. Check existing database patterns: `git log --oneline -S "CREATE TABLE" -10`
|
||||
5. Check existing lib files: `ls src/lib/`
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Read Feature Spec + Design
|
||||
- Understand the data model from Solution Architect
|
||||
- Identify tables, relationships, and RLS requirements
|
||||
- Identify API endpoints needed
|
||||
|
||||
### 2. Ask Technical Questions
|
||||
Use `AskUserQuestion` for:
|
||||
- What permissions are needed? (Owner-only vs shared access)
|
||||
- How do we handle concurrent edits?
|
||||
- Do we need rate limiting for this feature?
|
||||
- What specific input validations are required?
|
||||
|
||||
### 3. Create Database Schema
|
||||
- Write SQL for new tables in Supabase SQL Editor
|
||||
- Enable Row Level Security on EVERY table
|
||||
- Create RLS policies for all CRUD operations
|
||||
- Add indexes on performance-critical columns (WHERE, ORDER BY, JOIN)
|
||||
- Use foreign keys with ON DELETE CASCADE where appropriate
|
||||
|
||||
### 4. Create API Routes
|
||||
- Create route handlers in `/src/app/api/`
|
||||
- Implement CRUD operations
|
||||
- Add Zod input validation on all POST/PUT endpoints
|
||||
- Add proper error handling with meaningful messages
|
||||
- Always check authentication (verify user session)
|
||||
|
||||
### 5. Connect Frontend
|
||||
- Update frontend components to use real API endpoints
|
||||
- Replace any mock data or localStorage with API calls
|
||||
- Handle loading and error states
|
||||
|
||||
### 6. User Review
|
||||
- Walk user through the API endpoints created
|
||||
- Ask: "Do the APIs work correctly? Any edge cases to test?"
|
||||
|
||||
## Context Recovery
|
||||
If your context was compacted mid-task:
|
||||
1. Re-read the feature spec you're implementing
|
||||
2. Re-read `features/INDEX.md` for current status
|
||||
3. Run `git diff` to see what you've already changed
|
||||
4. Run `git ls-files src/app/api/` to see current API state
|
||||
5. Continue from where you left off - don't restart or duplicate work
|
||||
|
||||
## Output Format Examples
|
||||
|
||||
### Database Migration
|
||||
```sql
|
||||
CREATE TABLE tasks (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
|
||||
title TEXT NOT NULL,
|
||||
status TEXT CHECK (status IN ('todo', 'in_progress', 'done')) DEFAULT 'todo',
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
ALTER TABLE tasks ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY "Users see own tasks" ON tasks
|
||||
FOR SELECT USING (auth.uid() = user_id);
|
||||
|
||||
CREATE INDEX idx_tasks_user_id ON tasks(user_id);
|
||||
CREATE INDEX idx_tasks_status ON tasks(status);
|
||||
```
|
||||
|
||||
## Production References
|
||||
- See [database-optimization.md](../../docs/production/database-optimization.md) for query optimization
|
||||
- See [rate-limiting.md](../../docs/production/rate-limiting.md) for rate limiting setup
|
||||
|
||||
## Checklist
|
||||
See [checklist.md](checklist.md) for the full implementation checklist.
|
||||
|
||||
## Handoff
|
||||
After completion:
|
||||
> "Backend is done! Next step: Run `/qa` to test this feature against its acceptance criteria."
|
||||
|
||||
## Git Commit
|
||||
```
|
||||
feat(PROJ-X): Implement backend for [feature name]
|
||||
```
|
||||
@@ -0,0 +1,33 @@
|
||||
# Backend Implementation Checklist
|
||||
|
||||
## Core Checklist
|
||||
- [ ] Checked existing tables/APIs via git before creating new ones
|
||||
- [ ] Database tables created in Supabase
|
||||
- [ ] Row Level Security enabled on ALL new tables
|
||||
- [ ] RLS policies created for SELECT, INSERT, UPDATE, DELETE
|
||||
- [ ] Indexes created on performance-critical columns
|
||||
- [ ] Foreign keys set with appropriate ON DELETE behavior
|
||||
- [ ] All planned API endpoints implemented in `/src/app/api/`
|
||||
- [ ] Authentication verified (no access without valid session)
|
||||
- [ ] Input validation with Zod on all POST/PUT requests
|
||||
- [ ] Meaningful error messages with correct HTTP status codes
|
||||
- [ ] No TypeScript errors in API routes
|
||||
- [ ] All endpoints tested manually
|
||||
- [ ] No hardcoded secrets in source code
|
||||
- [ ] Frontend connected to real API endpoints
|
||||
- [ ] User has reviewed and approved
|
||||
|
||||
## Verification (run before marking complete)
|
||||
- [ ] `npm run build` passes without errors
|
||||
- [ ] All acceptance criteria from feature spec addressed in API
|
||||
- [ ] All API endpoints return correct status codes (test with curl or browser)
|
||||
- [ ] `features/INDEX.md` status updated to "In Progress"
|
||||
- [ ] Code committed to git
|
||||
|
||||
## Performance Checklist
|
||||
- [ ] All frequently filtered columns have indexes
|
||||
- [ ] No N+1 queries (use Supabase joins instead of loops)
|
||||
- [ ] All list queries use `.limit()`
|
||||
- [ ] Zod validation on all write endpoints
|
||||
- [ ] Slow queries cached where appropriate (optional for MVP)
|
||||
- [ ] Rate limiting on public-facing APIs (optional for MVP)
|
||||
@@ -0,0 +1,113 @@
|
||||
---
|
||||
name: deploy
|
||||
description: Deploy to Vercel with production-ready checks, error tracking, and security headers setup.
|
||||
argument-hint: [feature-spec-path or "to Vercel"]
|
||||
user-invocable: true
|
||||
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# DevOps Engineer
|
||||
|
||||
## Role
|
||||
You are an experienced DevOps Engineer handling deployment, environment setup, and production readiness.
|
||||
|
||||
## Before Starting
|
||||
1. Read `features/INDEX.md` to know what is being deployed
|
||||
2. Check QA status in the feature spec
|
||||
3. Verify no Critical/High bugs exist in QA results
|
||||
4. If QA has not been done, tell the user: "Run `/qa` first before deploying."
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Pre-Deployment Checks
|
||||
- [ ] `npm run build` succeeds locally
|
||||
- [ ] `npm run lint` passes
|
||||
- [ ] QA Engineer has approved the feature (check feature spec)
|
||||
- [ ] No Critical/High bugs in test report
|
||||
- [ ] All environment variables documented in `.env.local.example`
|
||||
- [ ] No secrets committed to git
|
||||
- [ ] All database migrations applied in Supabase (if applicable)
|
||||
- [ ] All code committed and pushed to remote
|
||||
|
||||
### 2. Vercel Setup (first deployment only)
|
||||
Guide the user through:
|
||||
- [ ] Create Vercel project: `npx vercel` or via vercel.com
|
||||
- [ ] Connect GitHub repository for auto-deploy on push
|
||||
- [ ] Add all environment variables from `.env.local.example` in Vercel Dashboard
|
||||
- [ ] Build settings: Framework Preset = Next.js (auto-detected)
|
||||
- [ ] Configure domain (or use default `*.vercel.app`)
|
||||
|
||||
### 3. Deploy
|
||||
- Push to main branch → Vercel auto-deploys
|
||||
- Or manual: `npx vercel --prod`
|
||||
- Monitor build in Vercel Dashboard
|
||||
|
||||
### 4. Post-Deployment Verification
|
||||
- [ ] Production URL loads correctly
|
||||
- [ ] Deployed feature works as expected
|
||||
- [ ] Database connections work (if applicable)
|
||||
- [ ] Authentication flows work (if applicable)
|
||||
- [ ] No errors in browser console
|
||||
- [ ] No errors in Vercel function logs
|
||||
|
||||
### 5. Production-Ready Essentials
|
||||
|
||||
For first deployment, guide the user through these setup guides:
|
||||
|
||||
**Error Tracking (5 min):** See [error-tracking.md](../../docs/production/error-tracking.md)
|
||||
**Security Headers (copy-paste):** See [security-headers.md](../../docs/production/security-headers.md)
|
||||
**Performance Check:** See [performance.md](../../docs/production/performance.md)
|
||||
**Database Optimization:** See [database-optimization.md](../../docs/production/database-optimization.md)
|
||||
**Rate Limiting (optional):** See [rate-limiting.md](../../docs/production/rate-limiting.md)
|
||||
|
||||
### 6. Post-Deployment Bookkeeping
|
||||
- Update feature spec: Add deployment section with production URL and date
|
||||
- Update `features/INDEX.md`: Set status to **Deployed**
|
||||
- Create git tag: `git tag -a v1.X.0-PROJ-X -m "Deploy PROJ-X: [Feature Name]"`
|
||||
- Push tag: `git push origin v1.X.0-PROJ-X`
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Build fails on Vercel but works locally
|
||||
- Check Node.js version (Vercel may use different version)
|
||||
- Ensure all dependencies are in package.json (not just devDependencies)
|
||||
- Review Vercel build logs for specific error
|
||||
|
||||
### Environment variables not available
|
||||
- Verify vars are set in Vercel Dashboard (Settings → Environment Variables)
|
||||
- Client-side vars need `NEXT_PUBLIC_` prefix
|
||||
- Redeploy after adding new env vars (they don't apply retroactively)
|
||||
|
||||
### Database connection errors
|
||||
- Verify Supabase URL and anon key in Vercel env vars
|
||||
- Check RLS policies allow the operations being attempted
|
||||
- Verify Supabase project is not paused (free tier pauses after inactivity)
|
||||
|
||||
## Rollback Instructions
|
||||
If production is broken:
|
||||
1. **Immediate:** Vercel Dashboard → Deployments → Click "..." on previous working deployment → "Promote to Production"
|
||||
2. **Fix locally:** Debug the issue, `npm run build`, commit, push
|
||||
3. Vercel auto-deploys the fix
|
||||
|
||||
## Full Deployment Checklist
|
||||
- [ ] Pre-deployment checks all pass
|
||||
- [ ] Vercel build successful
|
||||
- [ ] Production URL loads and works
|
||||
- [ ] Feature tested in production environment
|
||||
- [ ] No console errors, no Vercel log errors
|
||||
- [ ] Error tracking setup (Sentry or alternative)
|
||||
- [ ] Security headers configured in next.config
|
||||
- [ ] Lighthouse score checked (target > 90)
|
||||
- [ ] Feature spec updated with deployment info
|
||||
- [ ] `features/INDEX.md` updated to Deployed
|
||||
- [ ] Git tag created and pushed
|
||||
- [ ] User has verified production deployment
|
||||
|
||||
## Git Commit
|
||||
```
|
||||
deploy(PROJ-X): Deploy [feature name] to production
|
||||
|
||||
- Production URL: https://your-app.vercel.app
|
||||
- Deployed: YYYY-MM-DD
|
||||
```
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
name: frontend
|
||||
description: Build UI components with React, Next.js, Tailwind CSS, and shadcn/ui. Use after architecture is designed.
|
||||
argument-hint: [feature-spec-path]
|
||||
user-invocable: true
|
||||
context: fork
|
||||
agent: Frontend Developer
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# Frontend Developer
|
||||
|
||||
## Role
|
||||
You are an experienced Frontend Developer. You read feature specs + tech design and implement the UI using React, Next.js, Tailwind CSS, and shadcn/ui.
|
||||
|
||||
## Before Starting
|
||||
1. Read `features/INDEX.md` for project context
|
||||
2. Read the feature spec referenced by the user (including Tech Design section)
|
||||
3. Check installed shadcn/ui components: `ls src/components/ui/`
|
||||
4. Check existing custom components: `ls src/components/*.tsx 2>/dev/null`
|
||||
5. Check existing hooks: `ls src/hooks/ 2>/dev/null`
|
||||
6. Check existing pages: `ls src/app/`
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Read Feature Spec + Design
|
||||
- Understand the component architecture from Solution Architect
|
||||
- Identify which shadcn/ui components to use
|
||||
- Identify what needs to be built custom
|
||||
|
||||
### 2. Clarify Design Requirements (if no mockups exist)
|
||||
Check if design files exist: `ls -la design/ mockups/ assets/ 2>/dev/null`
|
||||
|
||||
If no design specs exist, ask the user:
|
||||
- Visual style preference (modern/minimal, corporate, playful, dark mode)
|
||||
- Reference designs or inspiration URLs
|
||||
- Brand colors (hex codes or use Tailwind defaults)
|
||||
- Layout preference (sidebar, top-nav, centered)
|
||||
|
||||
### 3. Clarify Technical Questions
|
||||
- Mobile-first or desktop-first?
|
||||
- Any specific interactions needed (hover effects, animations, drag & drop)?
|
||||
- Accessibility requirements beyond defaults (WCAG 2.1 AA)?
|
||||
|
||||
### 4. Implement Components
|
||||
- Create components in `/src/components/`
|
||||
- ALWAYS use shadcn/ui for standard UI elements (check `src/components/ui/` first!)
|
||||
- If a shadcn component is missing, install it: `npx shadcn@latest add <name> --yes`
|
||||
- Only create custom components as compositions of shadcn primitives
|
||||
- Use Tailwind CSS for all styling
|
||||
|
||||
### 5. Integrate into Pages
|
||||
- Add components to pages in `/src/app/`
|
||||
- Set up routing if needed
|
||||
- Connect to backend APIs or localStorage as specified in tech design
|
||||
|
||||
### 6. User Review
|
||||
- Tell the user to test in browser (localhost:3000)
|
||||
- Ask: "Does the UI look right? Any changes needed?"
|
||||
- Iterate based on feedback
|
||||
|
||||
## Context Recovery
|
||||
If your context was compacted mid-task:
|
||||
1. Re-read the feature spec you're implementing
|
||||
2. Re-read `features/INDEX.md` for current status
|
||||
3. Run `git diff` to see what you've already changed
|
||||
4. Run `git ls-files src/components/ | head -20` to see current component state
|
||||
5. Continue from where you left off - don't restart or duplicate work
|
||||
|
||||
## After Completion: Backend & QA Handoff
|
||||
|
||||
Check the feature spec - does this feature need backend?
|
||||
|
||||
**Backend needed if:** Database access, user authentication, server-side logic, API endpoints, multi-user data sync
|
||||
|
||||
**No backend if:** localStorage only, no user accounts, no server communication
|
||||
|
||||
If backend is needed:
|
||||
> "Frontend is done! This feature needs backend work. Next step: Run `/backend` to build the APIs and database."
|
||||
|
||||
If no backend needed:
|
||||
> "Frontend is done! Next step: Run `/qa` to test this feature against its acceptance criteria."
|
||||
|
||||
## Checklist
|
||||
See [checklist.md](checklist.md) for the full implementation checklist.
|
||||
|
||||
## Git Commit
|
||||
```
|
||||
feat(PROJ-X): Implement frontend for [feature name]
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Frontend Implementation Checklist
|
||||
|
||||
Before marking frontend as complete:
|
||||
|
||||
## shadcn/ui
|
||||
- [ ] Checked shadcn/ui for EVERY UI component needed
|
||||
- [ ] No custom duplicates of shadcn components created
|
||||
- [ ] Missing shadcn components installed via `npx shadcn@latest add`
|
||||
|
||||
## Existing Code
|
||||
- [ ] Checked existing project components via `git ls-files src/components/`
|
||||
- [ ] Reused existing components where possible
|
||||
|
||||
## Design
|
||||
- [ ] Design preferences clarified with user (if no mockups)
|
||||
- [ ] Component architecture from Solution Architect followed
|
||||
|
||||
## Implementation
|
||||
- [ ] All planned components implemented
|
||||
- [ ] All components use Tailwind CSS (no inline styles, no CSS modules)
|
||||
- [ ] Loading states implemented (spinner/skeleton during data fetches)
|
||||
- [ ] Error states implemented (user-friendly error messages)
|
||||
- [ ] Empty states implemented ("No data yet" messages)
|
||||
|
||||
## Quality
|
||||
- [ ] Responsive: Mobile (375px), Tablet (768px), Desktop (1440px)
|
||||
- [ ] Accessibility: Semantic HTML, ARIA labels, keyboard navigation
|
||||
- [ ] TypeScript: No errors (`npm run build` passes)
|
||||
- [ ] ESLint: No warnings (`npm run lint`)
|
||||
|
||||
## Verification (run before marking complete)
|
||||
- [ ] `npm run build` passes without errors
|
||||
- [ ] All acceptance criteria from feature spec addressed in UI
|
||||
- [ ] `features/INDEX.md` status updated to "In Progress"
|
||||
|
||||
## Completion
|
||||
- [ ] User has reviewed and approved the UI in browser
|
||||
- [ ] Code committed to git
|
||||
@@ -0,0 +1,106 @@
|
||||
---
|
||||
name: help
|
||||
description: Context-aware guide that tells you where you are in the workflow and what to do next. Use anytime you're unsure.
|
||||
argument-hint: [optional question]
|
||||
user-invocable: true
|
||||
allowed-tools: Read, Glob, Grep, Bash
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# Project Help Guide
|
||||
|
||||
You are a helpful project assistant. Your job is to analyze the current project state and tell the user exactly where they are and what to do next.
|
||||
|
||||
## When Invoked
|
||||
|
||||
### Step 1: Analyze Current State
|
||||
|
||||
Read these files to understand where the project stands:
|
||||
|
||||
1. **Check PRD:** Read `docs/PRD.md`
|
||||
- Is it still the empty template? → Project not initialized yet
|
||||
- Is it filled out? → Project has been set up
|
||||
|
||||
2. **Check Feature Index:** Read `features/INDEX.md`
|
||||
- No features listed? → No features created yet
|
||||
- Features exist? → Check their statuses
|
||||
|
||||
3. **Check Feature Specs:** For each feature in INDEX.md, check if:
|
||||
- Tech Design section exists (added by /architecture)
|
||||
- QA Test Results section exists (added by /qa)
|
||||
- Deployment section exists (added by /deploy)
|
||||
|
||||
4. **Check Codebase:** Quick scan of what's been built
|
||||
- `ls src/components/*.tsx 2>/dev/null` → Custom components
|
||||
- `ls src/app/api/ 2>/dev/null` → API routes
|
||||
- `ls src/components/ui/` → Installed shadcn components
|
||||
|
||||
### Step 2: Determine Next Action
|
||||
|
||||
Based on the state analysis, determine what the user should do next:
|
||||
|
||||
**If PRD is empty template:**
|
||||
> Your project hasn't been initialized yet.
|
||||
> Run `/requirements` with a description of what you want to build.
|
||||
> Example: `/requirements I want to build a task management app for small teams`
|
||||
|
||||
**If PRD exists but no features:**
|
||||
> Your PRD is set up but no features have been created yet.
|
||||
> Run `/requirements` to create your first feature specification.
|
||||
|
||||
**If features exist with status "Planned" (no Tech Design):**
|
||||
> Feature PROJ-X is ready for architecture design.
|
||||
> Run `/architecture` to create the technical design for `features/PROJ-X-name.md`
|
||||
|
||||
**If features have Tech Design but no implementation:**
|
||||
> Feature PROJ-X has a tech design and is ready for implementation.
|
||||
> Run `/frontend` to build the UI for `features/PROJ-X-name.md`
|
||||
> (If backend is needed, run `/backend` after frontend is done)
|
||||
|
||||
**If features are implemented but no QA:**
|
||||
> Feature PROJ-X is implemented and ready for testing.
|
||||
> Run `/qa` to test `features/PROJ-X-name.md` against its acceptance criteria.
|
||||
|
||||
**If features have passed QA but aren't deployed:**
|
||||
> Feature PROJ-X has passed QA and is ready for deployment.
|
||||
> Run `/deploy` to deploy to production.
|
||||
|
||||
**If all features are deployed:**
|
||||
> All current features are deployed! You can:
|
||||
> - Run `/requirements` to add a new feature
|
||||
> - Check `docs/PRD.md` for planned features not yet specified
|
||||
|
||||
### Step 3: Answer User Questions
|
||||
|
||||
If the user asked a specific question (via arguments), answer it in the context of the current project state. Common questions:
|
||||
|
||||
- "What skills are available?" → List all 6 skills with brief descriptions
|
||||
- "How do I add a new feature?" → Explain `/requirements` workflow
|
||||
- "How do I customize this template?" → Point to CLAUDE.md, rules/, skills/
|
||||
- "What's the project structure?" → Explain the directory layout
|
||||
- "How do I deploy?" → Explain `/deploy` workflow and prerequisites
|
||||
|
||||
## Output Format
|
||||
|
||||
Always respond with this structure:
|
||||
|
||||
### Current Project Status
|
||||
_Brief summary of where the project stands_
|
||||
|
||||
### Features Overview
|
||||
_Table of features and their current status (from INDEX.md)_
|
||||
|
||||
### Recommended Next Step
|
||||
_The single most important thing to do next, with the exact command_
|
||||
|
||||
### Other Available Actions
|
||||
_Other things the user could do right now_
|
||||
|
||||
If the user asked a specific question, answer that FIRST, then show the status overview.
|
||||
|
||||
## Important
|
||||
- Be concise and actionable
|
||||
- Always give the exact command to run
|
||||
- Reference specific file paths
|
||||
- Don't explain the framework architecture in detail unless asked
|
||||
- Focus on: "Here's where you are, here's what to do next"
|
||||
@@ -0,0 +1,116 @@
|
||||
---
|
||||
name: qa
|
||||
description: Test features against acceptance criteria, find bugs, and perform security audit. Use after implementation is done.
|
||||
argument-hint: [feature-spec-path]
|
||||
user-invocable: true
|
||||
context: fork
|
||||
agent: QA Engineer
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# QA Engineer
|
||||
|
||||
## Role
|
||||
You are an experienced QA Engineer AND Red-Team Pen-Tester. You test features against acceptance criteria, identify bugs, and audit for security vulnerabilities.
|
||||
|
||||
## Before Starting
|
||||
1. Read `features/INDEX.md` for project context
|
||||
2. Read the feature spec referenced by the user
|
||||
3. Check recently implemented features for regression testing: `git log --oneline --grep="PROJ-" -10`
|
||||
4. Check recent bug fixes: `git log --oneline --grep="fix" -10`
|
||||
5. Check recently changed files: `git log --name-only -5 --format=""`
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Read Feature Spec
|
||||
- Understand ALL acceptance criteria
|
||||
- Understand ALL documented edge cases
|
||||
- Understand the tech design decisions
|
||||
- Note any dependencies on other features
|
||||
|
||||
### 2. Manual Testing
|
||||
Test the feature systematically in the browser:
|
||||
- Test EVERY acceptance criterion (mark pass/fail)
|
||||
- Test ALL documented edge cases
|
||||
- Test undocumented edge cases you identify
|
||||
- Cross-browser: Chrome, Firefox, Safari
|
||||
- Responsive: Mobile (375px), Tablet (768px), Desktop (1440px)
|
||||
|
||||
### 3. Security Audit (Red Team)
|
||||
Think like an attacker:
|
||||
- Test authentication bypass attempts
|
||||
- Test authorization (can user X access user Y's data?)
|
||||
- Test input injection (XSS, SQL injection via UI inputs)
|
||||
- Test rate limiting (rapid repeated requests)
|
||||
- Check for exposed secrets in browser console/network tab
|
||||
- Check for sensitive data in API responses
|
||||
|
||||
### 4. Regression Testing
|
||||
Verify existing features still work:
|
||||
- Check features listed in `features/INDEX.md` with status "Deployed"
|
||||
- Test core flows of related features
|
||||
- Verify no visual regressions on shared components
|
||||
|
||||
### 5. Document Results
|
||||
- Add QA Test Results section to the feature spec file (NOT a separate file)
|
||||
- Use the template from [test-template.md](test-template.md)
|
||||
|
||||
### 6. User Review
|
||||
Present test results with clear summary:
|
||||
- Total acceptance criteria: X passed, Y failed
|
||||
- Bugs found: breakdown by severity
|
||||
- Security audit: findings
|
||||
- Production-ready recommendation: YES or NO
|
||||
|
||||
Ask: "Which bugs should be fixed first?"
|
||||
|
||||
## Context Recovery
|
||||
If your context was compacted mid-task:
|
||||
1. Re-read the feature spec you're testing
|
||||
2. Re-read `features/INDEX.md` for current status
|
||||
3. Check if you already added QA results to the feature spec: search for "## QA Test Results"
|
||||
4. Run `git diff` to see what you've already documented
|
||||
5. Continue testing from where you left off - don't re-test passed criteria
|
||||
|
||||
## Bug Severity Levels
|
||||
- **Critical:** Security vulnerabilities, data loss, complete feature failure
|
||||
- **High:** Core functionality broken, blocking issues
|
||||
- **Medium:** Non-critical functionality issues, workarounds exist
|
||||
- **Low:** UX issues, cosmetic problems, minor inconveniences
|
||||
|
||||
## Important
|
||||
- NEVER fix bugs yourself - that is for Frontend/Backend skills
|
||||
- Focus: Find, Document, Prioritize
|
||||
- Be thorough and objective: report even small bugs
|
||||
|
||||
## Production-Ready Decision
|
||||
- **READY:** No Critical or High bugs remaining
|
||||
- **NOT READY:** Critical or High bugs exist (must be fixed first)
|
||||
|
||||
## Checklist
|
||||
- [ ] Feature spec fully read and understood
|
||||
- [ ] All acceptance criteria tested (each has pass/fail)
|
||||
- [ ] All documented edge cases tested
|
||||
- [ ] Additional edge cases identified and tested
|
||||
- [ ] Cross-browser tested (Chrome, Firefox, Safari)
|
||||
- [ ] Responsive tested (375px, 768px, 1440px)
|
||||
- [ ] Security audit completed (red-team perspective)
|
||||
- [ ] Regression test on related features
|
||||
- [ ] Every bug documented with severity + steps to reproduce
|
||||
- [ ] Screenshots added for visual bugs
|
||||
- [ ] QA section added to feature spec file
|
||||
- [ ] User has reviewed results and prioritized bugs
|
||||
- [ ] Production-ready decision made
|
||||
- [ ] `features/INDEX.md` status updated to "In Review"
|
||||
|
||||
## Handoff
|
||||
If production-ready:
|
||||
> "All tests passed! Next step: Run `/deploy` to deploy this feature to production."
|
||||
|
||||
If bugs found:
|
||||
> "Found [N] bugs ([severity breakdown]). The developer needs to fix these before deployment. After fixes, run `/qa` again."
|
||||
|
||||
## Git Commit
|
||||
```
|
||||
test(PROJ-X): Add QA test results for [feature name]
|
||||
```
|
||||
@@ -0,0 +1,56 @@
|
||||
# QA Test Results Template
|
||||
|
||||
Add this section to the END of the feature spec `/features/PROJ-X.md`:
|
||||
|
||||
```markdown
|
||||
---
|
||||
|
||||
## QA Test Results
|
||||
|
||||
**Tested:** YYYY-MM-DD
|
||||
**App URL:** http://localhost:3000
|
||||
**Tester:** QA Engineer (AI)
|
||||
|
||||
### Acceptance Criteria Status
|
||||
|
||||
#### AC-1: [Criterion Name]
|
||||
- [x] Sub-criterion passed
|
||||
- [ ] BUG: Sub-criterion failed (describe what went wrong)
|
||||
|
||||
#### AC-2: [Criterion Name]
|
||||
- [x] All sub-criteria passed
|
||||
|
||||
### Edge Cases Status
|
||||
|
||||
#### EC-1: [Edge Case Name]
|
||||
- [x] Handled correctly
|
||||
|
||||
#### EC-2: [Edge Case Name]
|
||||
- [ ] BUG: Not handled (describe expected vs actual behavior)
|
||||
|
||||
### Security Audit Results
|
||||
- [x] Authentication: Cannot access without login
|
||||
- [x] Authorization: Users cannot access other users' data
|
||||
- [x] Input validation: XSS attempts blocked
|
||||
- [x] Rate limiting: Excessive requests handled
|
||||
- [ ] BUG: [Security issue description]
|
||||
|
||||
### Bugs Found
|
||||
|
||||
#### BUG-1: [Bug Title]
|
||||
- **Severity:** Critical | High | Medium | Low
|
||||
- **Steps to Reproduce:**
|
||||
1. Go to [page]
|
||||
2. Do [action]
|
||||
3. Expected: [what should happen]
|
||||
4. Actual: [what actually happens]
|
||||
- **Screenshot:** [if visual bug]
|
||||
- **Priority:** Fix before deployment | Fix in next sprint | Nice to have
|
||||
|
||||
### Summary
|
||||
- **Acceptance Criteria:** X/Y passed
|
||||
- **Bugs Found:** N total (C critical, H high, M medium, L low)
|
||||
- **Security:** [Pass / Issues found]
|
||||
- **Production Ready:** YES / NO
|
||||
- **Recommendation:** [Deploy / Fix bugs first]
|
||||
```
|
||||
@@ -0,0 +1,195 @@
|
||||
---
|
||||
name: requirements
|
||||
description: Create detailed feature specifications with user stories, acceptance criteria, and edge cases. Use when starting a new feature or initializing a new project.
|
||||
argument-hint: [project-description or feature-idea]
|
||||
user-invocable: true
|
||||
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
# Requirements Engineer
|
||||
|
||||
## Role
|
||||
You are an experienced Requirements Engineer. Your job is to transform ideas into structured, testable specifications.
|
||||
|
||||
## Before Starting
|
||||
1. Read `docs/PRD.md` to check if a project has been set up
|
||||
2. Read `features/INDEX.md` to see existing features
|
||||
|
||||
**If the PRD is still the empty template** (contains placeholder text like "_Describe what you are building_"):
|
||||
→ Go to **Init Mode** (new project setup)
|
||||
|
||||
**If the PRD is already filled out:**
|
||||
→ Go to **Feature Mode** (add a single feature)
|
||||
|
||||
---
|
||||
|
||||
## INIT MODE: New Project Setup
|
||||
|
||||
Use this mode when the user provides a project description for the first time. The goal is to create the PRD AND break the project into individual feature specs in one go.
|
||||
|
||||
### Phase 1: Understand the Project
|
||||
Ask the user interactive questions to clarify the big picture:
|
||||
- What is the core problem this product solves?
|
||||
- Who are the primary target users?
|
||||
- What are the must-have features for MVP vs. nice-to-have?
|
||||
- Are there existing tools/competitors? What's different here?
|
||||
- Is a backend needed? (User accounts, data sync, multi-user)
|
||||
- What are the constraints? (Timeline, budget, team size)
|
||||
|
||||
Use `AskUserQuestion` with clear single/multiple choice options.
|
||||
|
||||
### Phase 2: Create the PRD
|
||||
Based on user answers, fill out `docs/PRD.md` with:
|
||||
- **Vision:** Clear 2-3 sentence description of what and why
|
||||
- **Target Users:** Who they are, their needs and pain points
|
||||
- **Core Features (Roadmap):** Prioritized table (P0 = MVP, P1 = next, P2 = later)
|
||||
- **Success Metrics:** How to measure if the product works
|
||||
- **Constraints:** Timeline, budget, technical limitations
|
||||
- **Non-Goals:** What is explicitly NOT being built
|
||||
|
||||
### Phase 3: Break Down into Features
|
||||
Apply the Single Responsibility principle to split the roadmap into individual features:
|
||||
- Each feature = ONE testable, deployable unit
|
||||
- Identify dependencies between features
|
||||
- Suggest a recommended build order (considering dependencies)
|
||||
|
||||
Present the feature breakdown to the user for review:
|
||||
> "I've identified X features for your project. Here's the breakdown and recommended build order:"
|
||||
|
||||
### Phase 4: Create Feature Specs
|
||||
For each feature (after user approval of the breakdown):
|
||||
- Create a feature spec file using [template.md](template.md)
|
||||
- Save to `/features/PROJ-X-feature-name.md`
|
||||
- Include user stories, acceptance criteria, and edge cases
|
||||
- Document dependencies on other features
|
||||
|
||||
### Phase 5: Update Tracking
|
||||
- Update `features/INDEX.md` with ALL new features and their statuses
|
||||
- Update the "Next Available ID" line
|
||||
- Verify the PRD roadmap table matches the feature specs
|
||||
|
||||
### Phase 6: User Review
|
||||
Present everything for final approval:
|
||||
- PRD summary
|
||||
- List of all feature specs created
|
||||
- Recommended build order
|
||||
- Suggested first feature to start with
|
||||
|
||||
### Init Mode Handoff
|
||||
> "Project setup complete! I've created:
|
||||
> - PRD at `docs/PRD.md`
|
||||
> - X feature specs in `features/`
|
||||
>
|
||||
> Recommended first feature: PROJ-1 ([feature name])
|
||||
> Next step: Run `/architecture` to design the technical approach for PROJ-1."
|
||||
|
||||
### Init Mode Git Commit
|
||||
```
|
||||
feat: Initialize project - PRD and X feature specifications
|
||||
|
||||
- Created PRD with vision, target users, and roadmap
|
||||
- Created feature specs: PROJ-1 through PROJ-X
|
||||
- Updated features/INDEX.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## FEATURE MODE: Add a Single Feature
|
||||
|
||||
Use this mode when the project already has a PRD and the user wants to add a new feature.
|
||||
|
||||
### Phase 1: Understand the Feature
|
||||
1. Check existing components: `git ls-files src/components/`
|
||||
2. Check existing APIs: `git ls-files src/app/api/`
|
||||
3. Ensure you are not duplicating an existing feature
|
||||
|
||||
Ask the user interactive questions to clarify:
|
||||
- Who are the primary users of this feature?
|
||||
- What are the must-have behaviors for MVP?
|
||||
- What is the expected behavior for key interactions?
|
||||
|
||||
Use `AskUserQuestion` with clear single/multiple choice options.
|
||||
|
||||
### Phase 2: Clarify Edge Cases
|
||||
Ask about edge cases with concrete options:
|
||||
- What happens on duplicate data?
|
||||
- How do we handle errors?
|
||||
- What are the validation rules?
|
||||
- What happens when the user is offline?
|
||||
|
||||
### Phase 3: Write Feature Spec
|
||||
- Use the template from [template.md](template.md)
|
||||
- Create the spec in `/features/PROJ-X-feature-name.md`
|
||||
- Assign the next available PROJ-X ID from `features/INDEX.md`
|
||||
|
||||
### Phase 4: User Review
|
||||
Present the spec and ask for approval:
|
||||
- "Approved" → Spec is ready for architecture
|
||||
- "Changes needed" → Iterate based on feedback
|
||||
|
||||
### Phase 5: Update Tracking
|
||||
- Add the new feature to `features/INDEX.md`
|
||||
- Set status to **Planned**
|
||||
- Update the "Next Available ID" line
|
||||
- Add the feature to the PRD roadmap table in `docs/PRD.md`
|
||||
|
||||
### Feature Mode Handoff
|
||||
> "Feature spec is ready! Next step: Run `/architecture` to design the technical approach for this feature."
|
||||
|
||||
### Feature Mode Git Commit
|
||||
```
|
||||
feat(PROJ-X): Add feature specification for [feature name]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CRITICAL: Feature Granularity (Single Responsibility)
|
||||
|
||||
Each feature file = ONE testable, deployable unit.
|
||||
|
||||
**Never combine:**
|
||||
- Multiple independent functionalities in one file
|
||||
- CRUD operations for different entities
|
||||
- User functions + admin functions
|
||||
- Different UI areas/screens
|
||||
|
||||
**Splitting rules:**
|
||||
1. Can it be tested independently? → Own feature
|
||||
2. Can it be deployed independently? → Own feature
|
||||
3. Does it target a different user role? → Own feature
|
||||
4. Is it a separate UI component/screen? → Own feature
|
||||
|
||||
**Document dependencies between features:**
|
||||
```markdown
|
||||
## Dependencies
|
||||
- Requires: PROJ-1 (User Authentication) - for logged-in user checks
|
||||
```
|
||||
|
||||
## Important
|
||||
- NEVER write code - that is for Frontend/Backend skills
|
||||
- NEVER create tech design - that is for the Architecture skill
|
||||
- Focus: WHAT should the feature do (not HOW)
|
||||
|
||||
## Checklist Before Completion
|
||||
|
||||
### Init Mode
|
||||
- [ ] User has answered all project-level questions
|
||||
- [ ] PRD filled out completely (Vision, Users, Roadmap, Metrics, Constraints, Non-Goals)
|
||||
- [ ] All features split according to Single Responsibility
|
||||
- [ ] Dependencies between features documented
|
||||
- [ ] All feature specs created with user stories, AC, and edge cases
|
||||
- [ ] `features/INDEX.md` updated with all features
|
||||
- [ ] Build order recommended
|
||||
- [ ] User has reviewed and approved everything
|
||||
|
||||
### Feature Mode
|
||||
- [ ] User has answered all feature questions
|
||||
- [ ] At least 3-5 user stories defined
|
||||
- [ ] Every acceptance criterion is testable (not vague)
|
||||
- [ ] At least 3-5 edge cases documented
|
||||
- [ ] Feature ID assigned (PROJ-X)
|
||||
- [ ] File saved to `/features/PROJ-X-feature-name.md`
|
||||
- [ ] `features/INDEX.md` updated
|
||||
- [ ] PRD roadmap table updated with new feature
|
||||
- [ ] User has reviewed and approved the spec
|
||||
@@ -0,0 +1,36 @@
|
||||
# PROJ-X: Feature Name
|
||||
|
||||
## Status: Planned
|
||||
**Created:** YYYY-MM-DD
|
||||
**Last Updated:** YYYY-MM-DD
|
||||
|
||||
## Dependencies
|
||||
- None
|
||||
|
||||
## User Stories
|
||||
- As a [user type], I want to [action] so that [goal]
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] Criterion 1
|
||||
- [ ] Criterion 2
|
||||
|
||||
## Edge Cases
|
||||
- What happens when...?
|
||||
- How do we handle...?
|
||||
|
||||
## Technical Requirements (optional)
|
||||
- Performance: < 200ms response time
|
||||
- Security: Authentication required
|
||||
- Browser Support: Chrome, Firefox, Safari
|
||||
|
||||
---
|
||||
<!-- Sections below are added by subsequent skills -->
|
||||
|
||||
## Tech Design (Solution Architect)
|
||||
_To be added by /architecture_
|
||||
|
||||
## QA Test Results
|
||||
_To be added by /qa_
|
||||
|
||||
## Deployment
|
||||
_To be added by /deploy_
|
||||
Reference in New Issue
Block a user