@torka/claude-workflows 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.
@@ -0,0 +1,107 @@
1
+ # Agent Creator Registry
2
+ # Tracks successfully created agents for reuse and learning
3
+
4
+ # Last updated by skill
5
+ last_updated: 2026-01-12
6
+
7
+ # Successfully created agents that can be reused
8
+ # Format:
9
+ # - name: agent-name (without tmp- prefix)
10
+ # purpose: what task/specialization it handles
11
+ # tools: [list of tools]
12
+ # model: model used
13
+ # created: date
14
+ # project_context: what project/task it was created for
15
+ # success_notes: what worked well
16
+ # template_file: path to the template if saved
17
+ # reuse_count: how many times this pattern was reused
18
+
19
+ successful_agents:
20
+ - name: upgrade-specialist
21
+ purpose: Framework/SDK upgrades (Next.js, React, TypeScript, Supabase)
22
+ tools: [Read, Glob, Grep, Bash, Edit, Write]
23
+ model: sonnet
24
+ created: 2026-01-12
25
+ project_context: VT SaaS Template - Epic 1 Foundation Modernization (Stories 1.1-1.4)
26
+ success_notes: Story-based agent with upgrade best practices, breaking change handling, validation checklist
27
+ template_file: null
28
+ reuse_count: 0
29
+
30
+ - name: refactor-specialist
31
+ purpose: Code refactoring and rebranding (search/replace, naming consistency)
32
+ tools: [Read, Glob, Grep, Bash, Edit, Write]
33
+ model: sonnet
34
+ created: 2026-01-12
35
+ project_context: VT SaaS Template - Epic 1 Foundation Modernization (Story 1.5)
36
+ success_notes: Story-based agent with grep strategies, i18n awareness, metadata updates
37
+ template_file: null
38
+ reuse_count: 0
39
+
40
+ - name: error-handling-specialist
41
+ purpose: Error boundaries, API error standardization, graceful failure patterns
42
+ tools: [Read, Glob, Grep, Bash, Edit, Write]
43
+ model: sonnet
44
+ created: 2026-01-12
45
+ project_context: VT SaaS Template - Epic 1 Foundation Modernization (Stories 1.6-1.7)
46
+ success_notes: Story-based agent with error boundary hierarchy, HTTP status code patterns, user-friendly messaging
47
+ template_file: null
48
+ reuse_count: 0
49
+
50
+ - name: qa-validator
51
+ purpose: CI/CD validation, feature testing, post-upgrade verification, performance audits
52
+ tools: [Read, Glob, Grep, Bash, Edit, Write]
53
+ model: sonnet
54
+ created: 2026-01-12
55
+ project_context: VT SaaS Template - Epic 1 Foundation Modernization (Stories 1.8-1.9)
56
+ success_notes: Story-based agent with CI/CD checks, manual testing checklists, Lighthouse audit guidance
57
+ template_file: null
58
+ reuse_count: 0
59
+
60
+ # Example entry:
61
+ # successful_agents:
62
+ # - name: api-integrator
63
+ # purpose: External API integration with error handling
64
+ # tools: [Read, Write, WebFetch, Bash]
65
+ # model: sonnet
66
+ # created: 2025-01-15
67
+ # project_context: HealthCompanion - Dify API integration
68
+ # success_notes: Good at handling SSE streams, rate limiting
69
+ # template_file: .claude/skills/agent-creator/templates/api-integrator.md
70
+ # reuse_count: 0
71
+
72
+ # Agent patterns that didn't work well (learn from failures)
73
+ failed_patterns: []
74
+
75
+ # Example:
76
+ # failed_patterns:
77
+ # - name: mega-agent
78
+ # reason: Too many responsibilities, confused context
79
+ # lesson: Keep agents single-purpose
80
+
81
+ # Preferred combinations for common tasks
82
+ recommended_combinations:
83
+ feature_development:
84
+ description: Full feature implementation workflow
85
+ agents: [explorer, implementer, tester, reviewer]
86
+
87
+ bug_fix:
88
+ description: Debug and fix issues
89
+ agents: [debugger, tester]
90
+
91
+ refactor:
92
+ description: Code restructuring
93
+ agents: [explorer, refactorer, tester]
94
+
95
+ api_integration:
96
+ description: External service integration
97
+ agents: [api-integrator, tester]
98
+
99
+ documentation:
100
+ description: Documentation updates
101
+ agents: [explorer, documenter]
102
+
103
+ # Statistics
104
+ stats:
105
+ total_agents_created: 4
106
+ total_reuses: 0
107
+ most_reused_agent: null
@@ -0,0 +1,339 @@
1
+ ---
2
+ name: vt-bmad-dev-agents-creator
3
+ description: Creates custom Claude Code sub-agents for project tasks. Use when the user wants to create specialized agents, design agent workflows, or needs help breaking down complex tasks into agent-based solutions. All created agents are stored in .claude/agents/vt-bmad-dev-agents/.
4
+ tools: Read, Write, Edit, Glob, Grep, Bash, WebFetch, WebSearch, Task, LSP
5
+ ---
6
+
7
+ # Agent Creator Skill
8
+
9
+ Create custom Claude Code sub-agents tailored to your project's needs. All agents are stored in `.claude/agents/vt-bmad-dev-agents/`.
10
+
11
+ ## Story-Based Agents (Default Behavior)
12
+
13
+ **All created agents are story-focused by default.** This means:
14
+ 1. Every agent accepts a **story identifier** as input (story number or name)
15
+ 2. Every agent **must invoke `/dev-story`** as their first action when launched
16
+ 3. The story context drives all agent work
17
+
18
+ ### Why Story-Based?
19
+ - Ensures traceability from story → implementation
20
+ - Provides clear scope boundaries for the agent
21
+ - Maintains sprint tracking via `sprint-status.yaml`
22
+ - Aligns with BMAD Method workflows
23
+
24
+ ## Workflow Overview
25
+
26
+ This skill follows a 5-step interactive process:
27
+
28
+ 0. **Memory Check** - Check registry for reusable patterns (may skip to step 4)
29
+ 1. **Context Assessment** - Analyze project and task requirements
30
+ 2. **Agent Design** - Determine needed agents and their specialties
31
+ 3. **Community Research** - Reference GitHub repos for patterns and inspiration
32
+ 4. **Agent Creation** - Generate and validate agent specification files
33
+ 5. **Deployment & Registry** - Save files, verify, and optionally save to registry
34
+
35
+ ---
36
+
37
+ ## Step 0: Quick Start (Always First)
38
+
39
+ **Check for existing patterns before designing from scratch.**
40
+
41
+ ### Check Registry & Templates
42
+ ```bash
43
+ cat .claude/skills/agent-creator/REGISTRY.yaml 2>/dev/null
44
+ ls .claude/skills/agent-creator/templates/ 2>/dev/null
45
+ ```
46
+
47
+ ### If Match Found
48
+ - Ask: "I found a pattern for [X]. Reuse it or create fresh?"
49
+ - If reuse: Skip to Step 4 with the template
50
+ - If fresh: Continue to Step 1
51
+
52
+ ### If No Match
53
+ - For simple requests ("quick agent for..."): Skip to Step 4
54
+ - For complex needs: Continue to Step 1
55
+
56
+ ### Consider Built-in Agents First
57
+ Before creating custom agents, check if built-ins suffice:
58
+ - **Explore** - Codebase research
59
+ - **general-purpose** - Multi-step tasks
60
+ - **Plan** - Implementation planning
61
+
62
+ Only create custom agents when you need project-specific knowledge or custom workflows.
63
+
64
+ ---
65
+
66
+ ## Step 1: Context Assessment
67
+
68
+ Before creating agents, gather comprehensive context:
69
+
70
+ ### Project Analysis
71
+ ```bash
72
+ # Understand project structure (use ls if tree not available)
73
+ ls -la . && ls -la src/ 2>/dev/null
74
+
75
+ # Check existing agents
76
+ ls -la .claude/agents/vt-bmad-dev-agents/ 2>/dev/null || echo "No agents directory yet"
77
+
78
+ # Check existing templates in registry
79
+ ls -la .claude/skills/agent-creator/templates/ 2>/dev/null || echo "No templates yet"
80
+ ```
81
+
82
+ Also read these files for context:
83
+ - `CLAUDE.md` - Project instructions
84
+ - `README.md` - Project overview
85
+ - `package.json` - Dependencies and scripts (if exists)
86
+
87
+ ### Task Analysis Questions
88
+ Ask the user:
89
+ - What is the main task or goal you want to accomplish?
90
+ - Are there specific technologies or frameworks involved?
91
+ - What is the expected complexity (simple fix, feature, refactor, new project)?
92
+ - Do you have preferences for how work should be divided?
93
+
94
+ ### CHECKPOINT 1
95
+ Present findings to user:
96
+ - Project type and tech stack identified
97
+ - Task scope and complexity assessed
98
+ - Proposed number of agents needed
99
+
100
+ **Wait for user approval before proceeding.**
101
+
102
+ ## Step 2: Agent Design
103
+
104
+ Based on context, design the agent architecture:
105
+
106
+ ### Common Agent Patterns (All Story-Based)
107
+
108
+ All agents below accept a story identifier and invoke `/dev-story`. The specialty provides context.
109
+
110
+ | Agent Type | Specialty Focus | Key Tools |
111
+ |------------|-----------------|-----------|
112
+ | `frontend` | UI/React component stories | Read, Glob, Grep, Bash, Edit, Write |
113
+ | `backend` | API/server-side stories | Read, Glob, Grep, Bash, Edit, Write |
114
+ | `fullstack` | End-to-end feature stories | Read, Glob, Grep, Bash, Edit, Write |
115
+ | `tester` | Test-focused stories | Read, Glob, Grep, Bash, Edit, Write |
116
+ | `database` | Schema/migration stories | Read, Glob, Grep, Bash, Edit, Write |
117
+ | `api-integrator` | External API integration stories | Read, Glob, Grep, Bash, Edit, Write, WebFetch |
118
+
119
+ ### Non-Story Agent Patterns (Rare - Only When Explicitly Requested)
120
+
121
+ | Agent Type | Use Case | Key Tools |
122
+ |------------|----------|-----------|
123
+ | `explorer` | Codebase research, file discovery | Read, Glob, Grep |
124
+ | `documenter` | Documentation-only updates | Read, Write |
125
+
126
+ ### Design Considerations
127
+ - **Story-first**: Default to story-based agents that invoke `/dev-story`
128
+ - **Single responsibility**: Each agent has one specialty focus
129
+ - **Minimal wrapper**: Agents delegate to `/dev-story` for all implementation
130
+ - **Model selection**: Use `sonnet` for story agents (complex reasoning needed)
131
+
132
+ ### CHECKPOINT 2
133
+ Present agent design to user:
134
+ - List of proposed agents with names and descriptions
135
+ - Each agent's specialty and tool access
136
+ - How agents will collaborate (if applicable)
137
+
138
+ **Wait for user approval before proceeding.**
139
+
140
+ ## Step 3: Community Research
141
+
142
+ **IMPORTANT: Reference the detailed guide at `.claude/skills/agent-creator/COMMUNITY-REPOS.md`**
143
+
144
+ ### Research Limits (Mandatory)
145
+
146
+ | Activity | Maximum |
147
+ |----------|---------|
148
+ | GitHub repo searches | 3 queries |
149
+ | Repos to evaluate in detail | 5 repos |
150
+ | Web searches | 2 queries |
151
+ | Total research time | 10 minutes |
152
+
153
+ ### Curated Repos (Check First)
154
+
155
+ | Repository | URL |
156
+ |------------|-----|
157
+ | claude-code-templates | https://github.com/davila7/claude-code-templates |
158
+ | wshobson/agents | https://github.com/wshobson/agents |
159
+ | claude-flow | https://github.com/ruvnet/claude-flow |
160
+ | awesome-claude-code | https://github.com/hesreallyhim/awesome-claude-code |
161
+ | SuperClaude Framework | https://github.com/SuperClaude-Org/SuperClaude_Framework |
162
+ | compound-engineering-plugin | https://github.com/EveryInc/compound-engineering-plugin |
163
+ | claude-code-workflows | https://github.com/OneRedOak/claude-code-workflows |
164
+
165
+ ### Evaluation Criteria
166
+
167
+ Before using patterns from a repo, verify:
168
+ 1. **Recent Activity**: Last commit < 30 days (ideal) or < 90 days (acceptable)
169
+ 2. **Stars**: 50+ preferred, 10+ minimum
170
+ 3. **Relevance**: Directly applicable to the task
171
+
172
+ ```bash
173
+ # Quick repo check (if gh CLI available)
174
+ gh repo view {owner}/{repo} --json stargazerCount,pushedAt
175
+
176
+ # Fallback if gh CLI not available - use WebFetch
177
+ # WebFetch("https://api.github.com/repos/{owner}/{repo}")
178
+ ```
179
+
180
+ ### CHECKPOINT 3
181
+ Share research findings:
182
+ - Which repos were checked (max 5)
183
+ - Relevant patterns found
184
+ - Adaptations proposed for this project
185
+
186
+ **Wait for user approval before proceeding.**
187
+
188
+ ## Step 4: Agent Creation
189
+
190
+ Create agent files following Claude Code's native format.
191
+
192
+ ### Templates
193
+
194
+ **Use the template files for full specifications:**
195
+ - **Story-Based (Default)**: `.claude/skills/agent-creator/STORY-AGENT-TEMPLATE.md`
196
+ - **Non-Story (Rare)**: `.claude/skills/agent-creator/NON-STORY-AGENT-TEMPLATE.md`
197
+
198
+ Read the appropriate template file before creating agents.
199
+
200
+ ### File Naming Convention
201
+ - Location: `.claude/agents/vt-bmad-dev-agents/{name}.md`
202
+ - Naming: lowercase, hyphens only
203
+ - Examples: `frontend.md`, `api-integrator.md`
204
+
205
+ ### Pre-Save Validation
206
+ Before presenting to user, validate each agent:
207
+
208
+ 1. **Name format**: Must be `{lowercase-alphanumeric-hyphens}`
209
+ - Valid: `frontend`, `api-client`, `db-migrator`
210
+ - Invalid: `my_agent`, `MyAgent`, `FRONTEND`
211
+
212
+ 2. **Tools list**: Only valid Claude Code tools
213
+ - Valid: Read, Write, Edit, Glob, Grep, Bash, WebFetch, WebSearch, Task, LSP
214
+ - Invalid: AskUserQuestion, CustomTool
215
+
216
+ 3. **Model**: Must be one of: `sonnet`, `haiku`, `opus`, `inherit`
217
+
218
+ 4. **Description**: Should be 20-300 characters, specific enough to trigger correctly
219
+ - **Story agents MUST include**: "Requires story number or name"
220
+
221
+ 5. **No duplicates**: Check `.claude/agents/vt-bmad-dev-agents/` for existing agent with same name
222
+
223
+ 6. **Story-based validation** (for story agents):
224
+ - Description mentions story input requirement
225
+ - Content includes "Required Input" section for story identifier
226
+ - Content includes `/dev-story` invocation instruction
227
+ - Content does NOT include direct implementation steps (only /dev-story delegation)
228
+
229
+ ### CHECKPOINT 4
230
+ For each agent, show:
231
+ - Complete agent file content
232
+ - File path where it will be saved
233
+ - Validation status (all checks passed)
234
+
235
+ **Wait for user approval of each agent before saving.**
236
+
237
+ ## Step 5: Validation & Deployment
238
+
239
+ ### Save Agent Files
240
+ ```bash
241
+ # Ensure agents directory exists
242
+ mkdir -p .claude/agents/vt-bmad-dev-agents
243
+
244
+ # Write each approved agent file
245
+ # (Done via Write tool after user approval)
246
+ ```
247
+
248
+ ### Verify Installation
249
+ ```bash
250
+ # List created agents
251
+ ls -la .claude/agents/vt-bmad-dev-agents/
252
+
253
+ # Show agent count
254
+ echo "Created $(ls .claude/agents/vt-bmad-dev-agents/*.md 2>/dev/null | wc -l) agents"
255
+ ```
256
+
257
+ ### Usage Instructions
258
+ After creation, agents work in two ways:
259
+ - **Automatic**: When your task matches the agent's description, Claude may use it automatically
260
+ - **Explicit**: Reference the agent by name in your prompt, e.g., "Use the tester agent to..."
261
+
262
+ ### Cleanup Instructions
263
+ When agents are no longer needed:
264
+ ```bash
265
+ # Remove all agents in the directory
266
+ rm -rf .claude/agents/vt-bmad-dev-agents/
267
+
268
+ # Or remove specific agent
269
+ rm .claude/agents/vt-bmad-dev-agents/{name}.md
270
+ ```
271
+
272
+ ### CHECKPOINT 5 (Final)
273
+ Present summary:
274
+ - All agents created successfully
275
+ - How to use them
276
+ - How to clean them up later
277
+
278
+ **Ask user**: "Would you like to save this pattern to the registry for future reuse?"
279
+
280
+ ### If User Wants to Save Pattern
281
+ Update `.claude/skills/agent-creator/REGISTRY.yaml`:
282
+
283
+ 1. Add entry to `successful_agents`:
284
+ ```yaml
285
+ - name: {agent-name-without-tmp}
286
+ purpose: What task/specialization it handles
287
+ tools: [list of tools]
288
+ model: model used
289
+ created: YYYY-MM-DD
290
+ project_context: What project/task it was created for
291
+ ```
292
+
293
+ 2. Optionally save template file:
294
+ ```bash
295
+ mkdir -p .claude/skills/agent-creator/templates
296
+ cp .claude/agents/vt-bmad-dev-agents/{name}.md .claude/skills/agent-creator/templates/{name}.md
297
+ ```
298
+
299
+ 3. Update `stats.total_agents_created`
300
+
301
+ ### If Agent Doesn't Work (Later Feedback)
302
+ If user reports issues later, record in `failed_patterns`:
303
+ ```yaml
304
+ - name: agent-name
305
+ reason: Why it failed
306
+ lesson: What to do differently
307
+ ```
308
+
309
+ **Confirm completion with user.**
310
+
311
+ ## Quick Reference
312
+
313
+ ### Templates
314
+
315
+ See the dedicated template files for full examples and minimal templates:
316
+ - **Story-Based**: `STORY-AGENT-TEMPLATE.md`
317
+ - **Non-Story**: `NON-STORY-AGENT-TEMPLATE.md`
318
+
319
+ ### Available Tools Reference
320
+ | Tool | Purpose |
321
+ |------|---------|
322
+ | `Read` | Read file contents |
323
+ | `Write` | Create new files |
324
+ | `Edit` | Modify existing files |
325
+ | `Glob` | Find files by pattern |
326
+ | `Grep` | Search file contents |
327
+ | `Bash` | Run shell commands |
328
+ | `WebFetch` | Fetch web content |
329
+ | `WebSearch` | Search the web |
330
+ | `Task` | Delegate to subagents |
331
+ | `LSP` | Code intelligence |
332
+
333
+ ### Model Selection Guide
334
+ | Model | Best For | Cost |
335
+ |-------|----------|------|
336
+ | `haiku` | Simple, fast tasks | Lowest |
337
+ | `sonnet` | Balanced reasoning | Medium |
338
+ | `opus` | Complex reasoning | Highest |
339
+ | `inherit` | Match parent model | Varies |
@@ -0,0 +1,199 @@
1
+ # Story-Based Agent Template (Default)
2
+
3
+ **All agents are story-execution wrappers by default.** They accept a story identifier and delegate to `/dev-story`.
4
+
5
+ ---
6
+
7
+ ## Full Template
8
+
9
+ ```markdown
10
+ ---
11
+ name: {agent-name}
12
+ description: {Specialty} story executor. Requires story number or name.
13
+ tools: Read, Glob, Grep, Bash, Edit, Write
14
+ model: {sonnet|haiku|opus|inherit}
15
+ ---
16
+
17
+ # {Agent Name} - Story Executor
18
+
19
+ You are a {specialty} agent. Your role is to execute user stories with a focus on {specialty area}.
20
+
21
+ ## Required Input
22
+
23
+ **Story Identifier** (MANDATORY): Accepts either:
24
+ - Story number: e.g., "3.2", "story-3.2", "S3.2"
25
+ - Story name: e.g., "user authentication flow"
26
+
27
+ ## Single Responsibility: Execute /dev-story
28
+
29
+ **Your ONLY job is to invoke /dev-story with the provided story identifier.**
30
+
31
+ Upon receiving a story identifier, immediately execute:
32
+ ```
33
+ /dev-story {story-identifier}
34
+ ```
35
+
36
+ The /dev-story workflow handles ALL implementation work:
37
+ - Loading and validating the story file
38
+ - Updating sprint status
39
+ - Implementing tasks and subtasks
40
+ - Validating against acceptance criteria
41
+ - Updating the story file with completion status
42
+
43
+ ## TDD Requirements
44
+
45
+ These practices are enforced by /dev-story. Include them so the workflow follows TDD:
46
+ - **Red-Green-Refactor**: Write failing test → make it pass → improve code while keeping tests green
47
+ - **Task-driven**: Never implement anything not mapped to a specific task/subtask in the story file
48
+ - **Test coverage**: Every task/subtask must have comprehensive unit tests before marking complete
49
+ - **All tests green**: All existing tests must pass 100% before story is ready for review
50
+
51
+ ## Specialty Context
52
+
53
+ While /dev-story handles execution, your {specialty} focus means:
54
+ - {Specialty consideration 1}
55
+ - {Specialty consideration 2}
56
+
57
+ This context is passed to /dev-story for implementation guidance.
58
+
59
+ ## Constraints
60
+
61
+ - MUST receive a valid story identifier before proceeding
62
+ - MUST NOT implement anything directly - delegate to /dev-story
63
+ - MUST NOT skip the /dev-story invocation
64
+
65
+ ## If /dev-story Fails
66
+
67
+ If the story cannot be found or /dev-story fails:
68
+ 1. Ask user to clarify the story identifier
69
+ 2. Do NOT attempt implementation without a valid story
70
+
71
+ ## Handoff Format (Required for Orchestrator)
72
+
73
+ After /dev-story completes, you MUST output this structured handoff:
74
+
75
+ === AGENT HANDOFF ===
76
+ agent: {agent-name}
77
+ story: [story number, e.g., "2.3"]
78
+ status: completed | failed | blocked
79
+ files_changed:
80
+ - [list all modified/created files]
81
+ tests_passed: true | false
82
+ tests_run: [count]
83
+ tests_failed: [count]
84
+ coverage: [percentage or "unknown"]
85
+ blockers: none | [list any blockers]
86
+ next_action: proceed | escalate | retry
87
+ error_summary: null | "[failure description if any]"
88
+ === END HANDOFF ===
89
+
90
+ **Status Definitions:**
91
+ - `completed`: All tasks done, tests pass, ready for quality gate
92
+ - `failed`: Errors encountered that could not be resolved
93
+ - `blocked`: External dependency prevents completion
94
+
95
+ **Next Action:**
96
+ - `proceed`: Move to quality gate verification
97
+ - `retry`: Attempt to fix issues and re-run
98
+ - `escalate`: Requires human intervention
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Minimal Template
104
+
105
+ ```markdown
106
+ ---
107
+ name: {name}
108
+ description: {Specialty} story executor. Requires story number or name.
109
+ tools: Read, Glob, Grep, Bash, Edit, Write
110
+ model: sonnet
111
+ ---
112
+
113
+ You are a {specialty} agent executing stories via /dev-story.
114
+
115
+ **Required Input**: Story number (e.g., "3.2") or story name
116
+
117
+ **On Launch**: Immediately execute `/dev-story {story-identifier}`
118
+
119
+ All implementation is handled by /dev-story. You provide {specialty} context.
120
+
121
+ **TDD**: Red-green-refactor. Tests before code. All tests must pass.
122
+
123
+ **Handoff**: After /dev-story, output `=== AGENT HANDOFF ===` block with: agent, story, status, files_changed, tests_passed, tests_run, tests_failed, coverage, blockers, next_action, error_summary.
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Complete Example: Frontend Agent
129
+
130
+ ```markdown
131
+ ---
132
+ name: frontend
133
+ description: Frontend/React story executor. Requires story number or name.
134
+ tools: Read, Glob, Grep, Bash, Edit, Write
135
+ model: sonnet
136
+ ---
137
+
138
+ # Frontend Story Executor
139
+
140
+ You are a frontend specialist executing stories via /dev-story.
141
+
142
+ **Required Input**: Story number (e.g., "3.2") or story name
143
+
144
+ **On Launch**: Immediately execute `/dev-story {story-identifier}`
145
+
146
+ All implementation is handled by /dev-story. Your frontend focus provides context for:
147
+ - React component patterns
148
+ - UI/UX considerations
149
+ - CSS/styling approaches
150
+
151
+ ## TDD Requirements
152
+
153
+ - **Red-Green-Refactor**: Write failing test → make it pass → improve code
154
+ - **Task-driven**: Only implement what's in the story file
155
+ - **Test coverage**: Every task/subtask needs unit tests before complete
156
+ - **All tests green**: 100% pass before story is ready for review
157
+
158
+ Use Bash for `npm run dev`, `npm test`, etc.
159
+
160
+ ## If /dev-story Fails
161
+
162
+ 1. Ask user to clarify the story identifier
163
+ 2. Do NOT attempt implementation without a valid story
164
+
165
+ ## Handoff Format (Required for Orchestrator)
166
+
167
+ After /dev-story completes, output:
168
+
169
+ === AGENT HANDOFF ===
170
+ agent: frontend
171
+ story: [story number]
172
+ status: completed | failed | blocked
173
+ files_changed:
174
+ - [list files]
175
+ tests_passed: true | false
176
+ tests_run: [count]
177
+ tests_failed: [count]
178
+ coverage: [percentage]
179
+ blockers: none | [list]
180
+ next_action: proceed | escalate | retry
181
+ error_summary: null | "[error if any]"
182
+ === END HANDOFF ===
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Validation Checklist
188
+
189
+ Before saving a story-based agent, verify:
190
+
191
+ 1. **Name format**: `{lowercase-alphanumeric-hyphens}`
192
+ 2. **Tools list**: Only valid Claude Code tools
193
+ 3. **Model**: `sonnet`, `haiku`, `opus`, or `inherit`
194
+ 4. **Description**: Includes "Requires story number or name"
195
+ 5. **Content includes**:
196
+ - "Required Input" section for story identifier
197
+ - `/dev-story` invocation instruction
198
+ - NO direct implementation steps (only delegation)
199
+ - **Handoff Format section** with `=== AGENT HANDOFF ===` block (required for orchestrator workflows)