|
#!/bin/bash |
|
# Agency Setup Script |
|
# Creates Kiro workflow templates and a starter CLAUDE.md for any project. |
|
# Global agent commands (in ~/.claude/commands/) are already available everywhere. |
|
# |
|
# Usage: ~/.claude/setup-agency.sh |
|
|
|
set -e |
|
|
|
# Colors |
|
GREEN='\033[0;32m' |
|
YELLOW='\033[1;33m' |
|
NC='\033[0m' |
|
|
|
echo -e "${GREEN}Setting up Agency workflow...${NC}" |
|
|
|
# Create Kiro directory structure |
|
mkdir -p .kiro/templates |
|
mkdir -p .kiro/specs |
|
|
|
# Requirements template |
|
cat > .kiro/templates/requirements.md << 'TEMPLATE' |
|
# [Feature Name] Requirements |
|
|
|
## 1. Introduction |
|
|
|
[Brief description of the feature. Purpose, scope, and context.] |
|
|
|
## 2. User Stories |
|
|
|
### [User Category 1] |
|
- **As a** [user role], **I want to** [action], **so that** [benefit] |
|
|
|
### [User Category 2] |
|
- **As a** [user role], **I want to** [action], **so that** [benefit] |
|
|
|
## 3. Acceptance Criteria |
|
|
|
### Functional Requirements |
|
- **WHEN** [condition], **THEN** the system **SHALL** [expected behavior] |
|
|
|
### Performance Requirements |
|
- **WHEN** [scenario], **THEN** the system **SHALL** [performance target] |
|
|
|
### Accessibility Requirements |
|
- **WHEN** [interaction], **THEN** the system **SHALL** [accessibility behavior] |
|
|
|
## 4. Success Criteria |
|
|
|
- [Measurable outcome] |
|
|
|
## 5. Assumptions & Constraints |
|
|
|
- [Technical and business assumptions] |
|
|
|
--- |
|
|
|
**Status**: Draft / In Review / Approved |
|
**Last Updated**: [Date] |
|
TEMPLATE |
|
|
|
# Design template |
|
cat > .kiro/templates/design.md << 'TEMPLATE' |
|
# [Feature Name] Design Document |
|
|
|
## Overview |
|
|
|
[Description of the feature and what problem it solves.] |
|
|
|
## Architecture |
|
|
|
### Files Modified/Created |
|
|
|
``` |
|
[list affected files with status: new/modified/unchanged] |
|
``` |
|
|
|
### Technology Decisions |
|
|
|
- [Decision]: [Approach] — **Rationale**: [Why] |
|
|
|
## Components and Interfaces |
|
|
|
### New/Modified Components |
|
|
|
[Component details with code snippets] |
|
|
|
## Specialist Agent Assignments |
|
|
|
| Concern | Agent | Responsibility | |
|
|---------|-------|---------------| |
|
| Implementation | `/frontend-developer` | Build changes | |
|
| SEO | `/seo-specialist` | Validate SEO impact | |
|
| Accessibility | `/accessibility-auditor` | Audit WCAG compliance | |
|
| Brand | `/brand-guardian` | Verify brand alignment | |
|
| Performance | `/performance-benchmarker` | Measure before/after | |
|
| Content | `/content-creator` | Review/write copy | |
|
| CSS/Layout | `/ux-architect` | Review style changes | |
|
| Code quality | `/code-reviewer` | Final review | |
|
|
|
## Testing Strategy |
|
|
|
- [How to verify the changes work] |
|
|
|
--- |
|
|
|
**Status**: Draft / In Review / Approved |
|
**Last Updated**: [Date] |
|
TEMPLATE |
|
|
|
# Tasks template |
|
cat > .kiro/templates/tasks.md << 'TEMPLATE' |
|
# [Feature Name] Implementation Tasks |
|
|
|
## Task Overview |
|
|
|
**Feature**: [Feature name] |
|
**Total Tasks**: [X] tasks in [Y] phases |
|
**Requirements Reference**: `requirements.md` |
|
**Design Reference**: `design.md` |
|
|
|
## Implementation Tasks |
|
|
|
### Phase 1: [Phase Name] |
|
|
|
- [ ] **1.1** [Task Title] |
|
- **Agent**: `/[agent-command]` |
|
- **Description**: [What needs to be done] |
|
- **Deliverables**: [Files to create/modify] |
|
- **Requirements**: [Requirement reference] |
|
- **Acceptance Criteria**: [How to verify] |
|
- **Commit**: `[commit message]` |
|
|
|
## Task Completion Criteria |
|
|
|
Each task is complete when: |
|
- [ ] All deliverables implemented |
|
- [ ] Build succeeds |
|
- [ ] Acceptance criteria verified |
|
|
|
## Progress Tracking |
|
|
|
| Task | Status | Agent | Committed | |
|
|------|--------|-------|-----------| |
|
| 1.1 | Not Started | `/agent` | | |
|
|
|
**Overall Progress**: 0/X tasks (0%) |
|
**Last Updated**: [Date] |
|
TEMPLATE |
|
|
|
# Create starter CLAUDE.md if none exists |
|
if [ ! -f CLAUDE.md ]; then |
|
cat > CLAUDE.md << 'CLAUDEMD' |
|
# [Project Name] |
|
|
|
## Project Overview |
|
[Brief description of the project] |
|
|
|
- **Stack**: [Technologies used] |
|
- **Deploy**: [How the project is deployed] |
|
|
|
## Development Commands |
|
- [Build command] |
|
- [Dev server command] |
|
- [Test command] |
|
|
|
## Kiro Spec-Driven Workflow |
|
|
|
All feature work follows the **Kiro 3-phase process** with approval gates: |
|
|
|
1. **Requirements** → `.kiro/specs/{feature}/requirements.md` |
|
2. **Design** → `.kiro/specs/{feature}/design.md` |
|
3. **Tasks** → `.kiro/specs/{feature}/tasks.md` |
|
4. **Implementation** → Execute tasks incrementally |
|
|
|
Templates are in `.kiro/templates/`. Never skip phases or approval gates. |
|
|
|
## Agent Team |
|
|
|
The `/project-shepherd` manages all specialist agents: |
|
|
|
| Command | Role | |
|
|---------|------| |
|
| `/project-shepherd` | Coordinates team, manages Kiro workflow | |
|
| `/frontend-developer` | UI implementation | |
|
| `/seo-specialist` | Technical SEO, structured data | |
|
| `/ux-architect` | Design systems, layout | |
|
| `/code-reviewer` | Code quality reviews | |
|
| `/accessibility-auditor` | WCAG 2.2 AA compliance | |
|
| `/content-creator` | Copywriting, content strategy | |
|
| `/brand-guardian` | Brand consistency | |
|
| `/performance-benchmarker` | Core Web Vitals, page speed | |
|
|
|
## Key File Paths |
|
- [List important directories and files] |
|
CLAUDEMD |
|
echo -e "${GREEN}Created starter CLAUDE.md${NC}" |
|
else |
|
echo -e "${YELLOW}CLAUDE.md already exists — skipping (add agent team table manually if needed)${NC}" |
|
fi |
|
|
|
echo "" |
|
echo -e "${GREEN}Done! Agency workflow is ready.${NC}" |
|
echo "" |
|
echo "What was created:" |
|
echo " .kiro/templates/requirements.md" |
|
echo " .kiro/templates/design.md" |
|
echo " .kiro/templates/tasks.md" |
|
echo " .kiro/specs/ (empty, for feature specs)" |
|
if [ -f CLAUDE.md ]; then |
|
echo " CLAUDE.md (starter — customize for your project)" |
|
fi |
|
echo "" |
|
echo "Global agent commands (already available via ~/.claude/commands/):" |
|
echo " /project-shepherd /frontend-developer /seo-specialist" |
|
echo " /ux-architect /code-reviewer /accessibility-auditor" |
|
echo " /content-creator /brand-guardian /performance-benchmarker" |
|
echo "" |
|
echo "Next step: Edit CLAUDE.md with your project details, then run /project-shepherd" |