Deliverable Archetype
Deliverable Archetype
Section titled “Deliverable Archetype”The deliverable archetype is for teams that produce documentation, reports, or non-code artifacts—without modifying the codebase.
What It Does
Section titled “What It Does”Deliverable teams:
- Write documentation
- Create analysis reports
- Generate diagrams
- Produce specifications
- Compile research findings
Output: Markdown documents, reports, diagrams
Lifecycle States
Section titled “Lifecycle States”preparing ↓scanning ↓distilling ↓aggregating ↓complete
(any state) → failed(any non-terminal state) → paused| State | Description | Typical Duration |
|---|---|---|
preparing | Reading mission, planning document structure | 2-3 minutes |
scanning | Gathering information from codebase | 10-20 minutes |
distilling | Processing findings, identifying key insights | 5-10 minutes |
aggregating | Writing deliverable document, formatting | 10-15 minutes |
complete | Document finished | (terminal) |
failed | Error occurred | (terminal) |
paused | Manually paused | (indefinite) |
State Transitions
Section titled “State Transitions”preparing → scanning
- Read mission from inbox signal
- Plan document structure
- Identify information sources (files, directories)
scanning → distilling
- Read relevant files (code, configs, docs)
- Extract key information
- Log findings to learning log
distilling → aggregating
- Identify patterns and insights
- Organize information logically
- Select examples and code snippets
aggregating → complete
- Write deliverable markdown
- Add diagrams (Mermaid)
- Format according to standards
- Save as
deliverable.md
(any state) → failed
- Cannot find required information
- Source files are corrupted or inaccessible
- Document structure cannot be determined
Skills
Section titled “Skills”Deliverable teams have access to documentation skills in .squad/skills/:
- documentation-standards.md — Markdown conventions, structure guidelines
- report-templates.md — Report formats (architecture, analysis, audit)
- diagram-tools.md — Mermaid and PlantUML syntax
Example Skill: Documentation Standards
Section titled “Example Skill: Documentation Standards”---tags: [documentation, markdown, standards]category: convention---
# Documentation Standards
## Structure
Every document should have:
1. **Title** — Clear, descriptive2. **Summary** — 2-3 sentence overview3. **Table of Contents** — For long docs (>500 words)4. **Sections** — Logical grouping5. **Code Examples** — Syntax-highlighted6. **Next Steps** — Action items
## Markdown
- Use ATX headings (`#`, `##`, `###`)- Code blocks with language: \`\`\`typescript- Lists with `-` (unordered) or `1.` (ordered)- Links: `[text](url)`- Emphasis: `**bold**`, `*italic*`
## Diagrams
Use Mermaid for flowcharts:
\`\`\`mermaidgraph TD A[Start] --> B[Process] B --> C{Decision} C -->|Yes| D[Action] C -->|No| E[End]\`\`\`Agent Configuration
Section titled “Agent Configuration”Lead Agent
Section titled “Lead Agent”Role: Writer and researcher
Model: claude-sonnet-4
Temperature: 0.3 (balanced—slightly creative)
Tools: view, grep, glob, bash (read-only)
Responsibilities:
- Gather information from codebase
- Analyze findings
- Write deliverable document
- Format and structure content
Typical Workflow
Section titled “Typical Workflow”Phase 1: Preparing
Section titled “Phase 1: Preparing”- Team receives signal: “Document the frontend architecture”
- Agent plans document structure:
- Overview
- Directory structure
- State management
- Routing
- Authentication
- Testing
- Transitions to
scanning
Phase 2: Scanning
Section titled “Phase 2: Scanning”- Agent searches for relevant files:
package.json— Dependenciessrc/directory — Code structurevite.config.ts— Build configREADME.md— Setup instructions
- Reads key files:
src/contexts/AuthContext.tsx— Auth implementationsrc/App.tsx— Routing setupsrc/hooks/useAuth.ts— Custom hooks
- Logs findings:
{"timestamp": "2025-01-30T12:00:00Z","domain": "docs-team","category": "discovery","content": "Frontend uses Context API for state management","tags": ["architecture", "state", "react"],"confidence": "high"}
- Transitions to
distilling
Phase 3: Distilling
Section titled “Phase 3: Distilling”- Agent analyzes findings:
- Identifies architectural patterns (Context API, React Router)
- Extracts key technologies (React 18, Vite 4, TypeScript 5)
- Notes conventions (httpOnly cookies for auth)
- Organizes information into sections
- Selects representative code examples
- Transitions to
aggregating
Phase 4: Aggregating
Section titled “Phase 4: Aggregating”- Agent writes
deliverable.md:- Summary paragraph
- Table of contents
- Section-by-section content
- Code examples
- Mermaid diagrams
- Next steps
- Formats according to
documentation-standards.md - Transitions to
complete
Deliverable Format
Section titled “Deliverable Format”Deliverable teams produce well-structured markdown documents.
Example: Architecture Documentation
# Frontend Architecture
## Summary
The frontend is a React SPA using TypeScript, Vite, and React Router. State management uses Context API with custom hooks. Authentication is JWT-based with httpOnly cookies.
## Table of Contents
- [Architecture Overview](#architecture-overview)- [Directory Structure](#directory-structure)- [State Management](#state-management)- [Routing](#routing)- [Authentication](#authentication)- [Testing](#testing)- [Next Steps](#next-steps)
## Architecture Overview
\`\`\`mermaidgraph TD A[User] --> B[React SPA] B --> C[React Router] B --> D[Context API] B --> E[API Client] E --> F[Backend API]\`\`\`
**Key Technologies:**- **Framework:** React 18- **Build Tool:** Vite 4- **Language:** TypeScript 5- **Router:** React Router 6- **State:** Context API + hooks
## Directory Structure
\`\`\`src/├── components/ ← Reusable UI components├── pages/ ← Route-level pages├── hooks/ ← Custom React hooks├── contexts/ ← Context providers├── api/ ← API client├── utils/ ← Helper functions└── types/ ← TypeScript types\`\`\`
## State Management
Global state managed via Context API:
\`\`\`typescript// src/contexts/AuthContext.tsxexport const AuthContext = createContext<AuthState>({ user: null, isAuthenticated: false, login: async () => {}, logout: async () => {}});\`\`\`
**Contexts:**- `AuthContext` — User authentication- `ThemeContext` — UI theme (light/dark)- `NotificationContext` — Toast notifications
## Authentication
JWT tokens stored in httpOnly cookies:
\`\`\`typescript// src/api/auth.tsexport async function login(email: string, password: string) { const response = await fetch('/api/auth/login', { method: 'POST', credentials: 'include', // ← Send cookies body: JSON.stringify({ email, password }) }); return response.json();}\`\`\`
**Flow:**1. User submits login form2. API sets httpOnly cookie with JWT3. Subsequent requests include cookie automatically4. API validates JWT on each request
## Testing
\`\`\`bashnpm run test # Run all testsnpm run test:coverage # Generate coverage report\`\`\`
**Coverage:**- Components: 85%- Hooks: 90%- Utils: 95%
## Next Steps
1. Add E2E tests with Playwright2. Implement lazy loading for routes3. Add error boundary componentCommon Use Cases
Section titled “Common Use Cases”Architecture Documentation
Section titled “Architecture Documentation”Mission: “Document the frontend architecture”
States: preparing → scanning → distilling → aggregating → complete
Duration: 30-45 minutes
Output:
- Comprehensive architecture doc
- Directory structure diagram
- Code examples
- Technology stack overview
Analysis Report
Section titled “Analysis Report”Mission: “Analyze database schema and create ER diagram”
States: preparing → scanning → distilling → aggregating → complete
Duration: 20-30 minutes
Output:
- Table summaries
- ER diagram (Mermaid)
- Relationship analysis
- Observations and recommendations
Security Audit Report
Section titled “Security Audit Report”Mission: “Review authentication flow for security issues”
States: preparing → scanning → distilling → aggregating → complete
Duration: 30-40 minutes
Output:
- Current implementation analysis
- Security findings (ranked by severity)
- Recommendations
- Code examples
Best Practices
Section titled “Best Practices”Clear Structure
Section titled “Clear Structure”Use headings, lists, and code blocks:
## Authentication Flow
1. User submits login form2. Server validates credentials3. Server issues JWT token4. Client stores token5. Client includes token in requests
\`\`\`typescript// Example token validationif (!verifyToken(token)) { throw new Error('Invalid token');}\`\`\`Visual Aids
Section titled “Visual Aids”Include diagrams (Mermaid):
\`\`\`mermaidsequenceDiagram User->>Frontend: Submit login Frontend->>Backend: POST /auth/login Backend-->>Frontend: JWT cookie Frontend->>Backend: GET /api/profile Backend-->>Frontend: User data\`\`\`Code Examples
Section titled “Code Examples”Show, don’t tell:
❌ “The API client uses fetch with credentials”
✅ “The API client uses fetch with credentials:
```typescript fetch(‘/api/endpoint’, { credentials: ‘include’ }) ``` “
Actionable Next Steps
Section titled “Actionable Next Steps”Provide concrete follow-up items:
## Next Steps
1. **High Priority:** Enable HTTPS in production2. **Medium Priority:** Add rate limiting to login endpoint3. **Low Priority:** Rotate JWT secret monthlyDeliverable vs Coding
Section titled “Deliverable vs Coding”| Aspect | Deliverable | Coding |
|---|---|---|
| Output | Documents | Code |
| States | scanning/distilling/aggregating | implementing/testing/pr-open |
| Changes | None to codebase | Modifies files |
| Tools | Read-only | Read + write |
Use deliverable when:
- No code changes needed
- Creating documentation
- Analysis/reporting
Use coding when:
- Implementing features
- Fixing bugs
- Refactoring
Monitoring
Section titled “Monitoring”Deliverable teams emit telemetry (when enabled):
deliverable.size_bytes— Document sizedeliverable.sections— Section countdeliverable.code_examples— Code blocks included
Health checks:
- Deliverable file exists and is non-empty
- Status updated within 10 minutes
- No errors in logs