mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-28 20:01:17 +08:00
feat: migrate all codex team skills from spawn_agents_on_csv to spawn_agent + wait_agent architecture
- Delete 21 old team skill directories using CSV-wave pipeline pattern (~100+ files) - Delete old team-lifecycle (v3) and team-planex-v2 - Create generic team-worker.toml and team-supervisor.toml (replacing tlv4-specific TOMLs) - Convert 19 team skills from Claude Code format (Agent/SendMessage/TaskCreate) to Codex format (spawn_agent/wait_agent/tasks.json/request_user_input) - Update team-lifecycle-v4 to use generic agent types (team_worker/team_supervisor) - Convert all coordinator role files: dispatch.md, monitor.md, role.md - Convert all worker role files: remove run_in_background, fix Bash syntax - Convert all specs/pipelines.md references - Final state: 20 team skills, 217 .md files, zero Claude Code API residuals Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,750 +1,129 @@
|
||||
---
|
||||
name: team-frontend
|
||||
description: Frontend development team with built-in ui-ux-pro-max design intelligence. Covers requirement analysis, design system generation, frontend implementation, and quality assurance. CSV wave pipeline with interactive QA gates.
|
||||
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"frontend task description\""
|
||||
allowed-tools: spawn_agents_on_csv, spawn_agent, wait, send_input, close_agent, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
||||
description: Unified team skill for frontend development. Pure router — all roles read this file. Beat model is coordinator-only in monitor.md. Built-in ui-ux-pro-max design intelligence. Triggers on "team frontend".
|
||||
allowed-tools: spawn_agent(*), wait_agent(*), send_input(*), close_agent(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), WebFetch(*), WebSearch(*), mcp__ace-tool__search_context(*)
|
||||
---
|
||||
|
||||
## Auto Mode
|
||||
|
||||
When `--yes` or `-y`: Auto-confirm task decomposition, skip interactive validation, use defaults for scope/industry/constraints.
|
||||
|
||||
# Team Frontend Development
|
||||
|
||||
## Usage
|
||||
Unified team skill: frontend development with built-in ui-ux-pro-max design intelligence. Covers requirement analysis, design system generation, frontend implementation, and quality assurance. Built on **team-worker agent architecture** — all worker roles share a single agent definition with role-specific Phase 2-4 loaded from role.md specs.
|
||||
|
||||
```bash
|
||||
$team-frontend "Build a SaaS dashboard with user management and analytics"
|
||||
$team-frontend -c 3 "Create a healthcare patient portal with WCAG AA compliance"
|
||||
$team-frontend -y "Implement e-commerce product listing page with dark mode"
|
||||
$team-frontend --continue "fe-saas-dashboard-20260308"
|
||||
```
|
||||
|
||||
**Flags**:
|
||||
- `-y, --yes`: Skip all confirmations (auto mode)
|
||||
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 3)
|
||||
- `--continue`: Resume existing session
|
||||
|
||||
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
||||
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Unified frontend development team: analyze requirements, retrieve design intelligence (ui-ux-pro-max), generate design token system, architect components, implement code, and run 5-dimension quality audit. Roles: analyst, architect, developer, qa -- dynamically assigned as CSV wave tasks with dependency ordering. Supports page (4-task), feature (5-task), and system (7-task) pipeline modes.
|
||||
|
||||
**Execution Model**: Hybrid -- CSV wave pipeline (primary) + individual agent spawn (secondary)
|
||||
## Architecture
|
||||
|
||||
```
|
||||
+-------------------------------------------------------------------+
|
||||
| TEAM FRONTEND WORKFLOW |
|
||||
+-------------------------------------------------------------------+
|
||||
| |
|
||||
| Phase 0: Pre-Wave Interactive (Requirement Clarification) |
|
||||
| +- Parse frontend task description |
|
||||
| +- Select scope (page/feature/system), industry, constraints |
|
||||
| +- Output: refined requirements for decomposition |
|
||||
| |
|
||||
| Phase 1: Requirement -> CSV + Classification |
|
||||
| +- Signal detection: keyword scan -> capability inference |
|
||||
| +- Pipeline selection (page: 4-task, feature: 5-task, system) |
|
||||
| +- Dependency graph from pipeline definition |
|
||||
| +- Classify tasks: csv-wave | interactive (exec_mode) |
|
||||
| +- Compute dependency waves (topological sort) |
|
||||
| +- Generate tasks.csv with wave + exec_mode columns |
|
||||
| +- User validates task breakdown (skip if -y) |
|
||||
| |
|
||||
| Phase 2: Wave Execution Engine (Extended) |
|
||||
| +- For each wave (1..N): |
|
||||
| | +- Execute pre-wave interactive tasks (if any) |
|
||||
| | +- Build wave CSV (filter csv-wave tasks for this wave) |
|
||||
| | +- Inject previous findings into prev_context column |
|
||||
| | +- spawn_agents_on_csv(wave CSV) |
|
||||
| | +- Execute post-wave interactive tasks (if any) |
|
||||
| | +- Merge all results into master tasks.csv |
|
||||
| | +- Check: any failed? -> skip dependents |
|
||||
| | +- GC Loop: if QA fails, create DEV-fix + QA-recheck |
|
||||
| +- discoveries.ndjson shared across all modes (append-only) |
|
||||
| |
|
||||
| Phase 3: Post-Wave Interactive (Completion Action) |
|
||||
| +- Pipeline completion report with deliverables listing |
|
||||
| +- Interactive completion choice (Archive/Keep/Export) |
|
||||
| +- Final aggregation / report |
|
||||
| |
|
||||
| Phase 4: Results Aggregation |
|
||||
| +- Export final results.csv |
|
||||
| +- Generate context.md with all findings |
|
||||
| +- Display summary: completed/failed/skipped per wave |
|
||||
| +- Offer: view results | retry failed | done |
|
||||
| |
|
||||
+-------------------------------------------------------------------+
|
||||
Skill(skill="team-frontend", args="task description")
|
||||
|
|
||||
SKILL.md (this file) = Router
|
||||
|
|
||||
+--------------+--------------+
|
||||
| |
|
||||
no --role flag --role <name>
|
||||
| |
|
||||
Coordinator Worker
|
||||
roles/coordinator/role.md roles/<name>/role.md
|
||||
|
|
||||
+-- analyze -> dispatch -> spawn workers -> STOP
|
||||
|
|
||||
+-------+-------+-------+
|
||||
v v v v
|
||||
[analyst] [architect] [developer] [qa]
|
||||
(team-worker agents, each loads roles/<role>/role.md)
|
||||
```
|
||||
|
||||
---
|
||||
## Role Registry
|
||||
|
||||
## Task Classification Rules
|
||||
| Role | Path | Prefix | Inner Loop |
|
||||
|------|------|--------|------------|
|
||||
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
|
||||
| analyst | [roles/analyst/role.md](roles/analyst/role.md) | ANALYZE-* | false |
|
||||
| architect | [roles/architect/role.md](roles/architect/role.md) | ARCH-* | false |
|
||||
| developer | [roles/developer/role.md](roles/developer/role.md) | DEV-* | true |
|
||||
| qa | [roles/qa/role.md](roles/qa/role.md) | QA-* | false |
|
||||
|
||||
Each task is classified by `exec_mode`:
|
||||
## Role Router
|
||||
|
||||
| exec_mode | Mechanism | Criteria |
|
||||
|-----------|-----------|----------|
|
||||
| `csv-wave` | `spawn_agents_on_csv` | One-shot, structured I/O, no multi-round interaction |
|
||||
| `interactive` | `spawn_agent`/`wait`/`send_input`/`close_agent` | Multi-round, revision cycles, user approval |
|
||||
Parse `$ARGUMENTS`:
|
||||
- Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
|
||||
- No `--role` → `roles/coordinator/role.md`, execute entry router
|
||||
|
||||
**Classification Decision**:
|
||||
## Shared Constants
|
||||
|
||||
| Task Property | Classification |
|
||||
|---------------|---------------|
|
||||
| Requirement analysis (analyst) | `csv-wave` |
|
||||
| Architecture design (architect) | `csv-wave` |
|
||||
| Code implementation (developer) | `csv-wave` |
|
||||
| QA audit (qa) | `csv-wave` |
|
||||
| Architecture review gate (qa approving architecture before dev starts) | `interactive` |
|
||||
| GC loop revision (developer fixing QA issues) | `csv-wave` |
|
||||
| Pipeline completion action | `interactive` |
|
||||
- **Session prefix**: `FE`
|
||||
- **Session path**: `.workflow/.team/FE-<slug>-<date>/`
|
||||
- **CLI tools**: `ccw cli --mode analysis` (read-only), `ccw cli --mode write` (modifications)
|
||||
- **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
|
||||
|
||||
---
|
||||
## Worker Spawn Template
|
||||
|
||||
## CSV Schema
|
||||
|
||||
### tasks.csv (Master State)
|
||||
|
||||
```csv
|
||||
id,title,description,role,pipeline_mode,scope,review_type,deps,context_from,exec_mode,wave,status,findings,artifacts_produced,qa_score,qa_verdict,error
|
||||
"ANALYZE-001","Requirement analysis + design intelligence","PURPOSE: Analyze frontend requirements and retrieve design intelligence | Success: design-intelligence.json produced","analyst","feature","full","","","","csv-wave","1","pending","","","","",""
|
||||
"ARCH-001","Design token system + component architecture","PURPOSE: Define design token system and component specs | Success: design-tokens.json + component specs produced","architect","feature","full","","ANALYZE-001","ANALYZE-001","csv-wave","2","pending","","","","",""
|
||||
"QA-001","Architecture review","PURPOSE: Review architecture artifacts before development | Success: Architecture approved","qa","feature","full","architecture-review","ARCH-001","ARCH-001","csv-wave","3","pending","","","","",""
|
||||
```
|
||||
|
||||
**Columns**:
|
||||
|
||||
| Column | Phase | Description |
|
||||
|--------|-------|-------------|
|
||||
| `id` | Input | Unique task identifier (PREFIX-NNN format: ANALYZE, ARCH, DEV, QA) |
|
||||
| `title` | Input | Short task title |
|
||||
| `description` | Input | Detailed task description with PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS |
|
||||
| `role` | Input | Role name: `analyst`, `architect`, `developer`, `qa` |
|
||||
| `pipeline_mode` | Input | Pipeline: `page`, `feature`, `system` |
|
||||
| `scope` | Input | Task scope: `full`, `tokens`, `components` |
|
||||
| `review_type` | Input | QA review type: `architecture-review`, `code-review`, `final` (empty for non-QA) |
|
||||
| `deps` | Input | Semicolon-separated dependency task IDs |
|
||||
| `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
|
||||
| `exec_mode` | Input | `csv-wave` or `interactive` |
|
||||
| `wave` | Computed | Wave number (computed by topological sort, 1-based) |
|
||||
| `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
|
||||
| `findings` | Output | Key discoveries or implementation notes (max 500 chars) |
|
||||
| `artifacts_produced` | Output | Semicolon-separated paths of produced artifacts |
|
||||
| `qa_score` | Output | QA weighted score (0-10, empty for non-QA tasks) |
|
||||
| `qa_verdict` | Output | QA verdict: `PASSED`, `PASSED_WITH_WARNINGS`, `FIX_REQUIRED` (empty for non-QA) |
|
||||
| `error` | Output | Error message if failed (empty if success) |
|
||||
|
||||
### Per-Wave CSV (Temporary)
|
||||
|
||||
Each wave generates a temporary `wave-{N}.csv` with extra `prev_context` column (csv-wave tasks only).
|
||||
|
||||
---
|
||||
|
||||
## Agent Registry (Interactive Agents)
|
||||
|
||||
| Agent | Role File | Pattern | Responsibility | Position |
|
||||
|-------|-----------|---------|----------------|----------|
|
||||
| QA Gate Reviewer | agents/qa-gate-reviewer.md | 2.3 (send_input cycle) | Review QA verdict and handle GC loop decisions | post-wave |
|
||||
| Completion Handler | agents/completion-handler.md | 2.3 (send_input cycle) | Handle pipeline completion action (Archive/Keep/Export) | standalone |
|
||||
|
||||
> **COMPACT PROTECTION**: Agent files are execution documents. When context compression occurs, **you MUST immediately `Read` the corresponding agent.md** to reload.
|
||||
|
||||
---
|
||||
|
||||
## Output Artifacts
|
||||
|
||||
| File | Purpose | Lifecycle |
|
||||
|------|---------|-----------|
|
||||
| `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
|
||||
| `wave-{N}.csv` | Per-wave input (temporary, csv-wave tasks only) | Created before wave, deleted after |
|
||||
| `results.csv` | Final export of all task results | Created in Phase 4 |
|
||||
| `discoveries.ndjson` | Shared exploration board (all agents, both modes) | Append-only, carries across waves |
|
||||
| `context.md` | Human-readable execution report | Created in Phase 4 |
|
||||
| `task-analysis.json` | Phase 0/1 output: capabilities, pipeline, roles | Created in Phase 1 |
|
||||
| `role-instructions/` | Per-role instruction templates for CSV agents | Created in Phase 1 |
|
||||
| `artifacts/` | All deliverables: design-intelligence.json, design-tokens.json, component-specs/, QA audits | Created by agents |
|
||||
| `interactive/{id}-result.json` | Results from interactive tasks | Created per interactive task |
|
||||
|
||||
---
|
||||
|
||||
## Session Structure
|
||||
Coordinator spawns workers using this template:
|
||||
|
||||
```
|
||||
.workflow/.csv-wave/{session-id}/
|
||||
+-- tasks.csv # Master state (all tasks, both modes)
|
||||
+-- results.csv # Final results export
|
||||
+-- discoveries.ndjson # Shared discovery board (all agents)
|
||||
+-- context.md # Human-readable report
|
||||
+-- task-analysis.json # Phase 1 analysis output
|
||||
+-- wave-{N}.csv # Temporary per-wave input (csv-wave only)
|
||||
+-- role-instructions/ # Per-role instruction templates
|
||||
| +-- analyst.md
|
||||
| +-- architect.md
|
||||
| +-- developer.md
|
||||
| +-- qa.md
|
||||
+-- artifacts/ # All deliverables
|
||||
| +-- analysis/
|
||||
| | +-- design-intelligence.json
|
||||
| | +-- requirements.md
|
||||
| +-- architecture/
|
||||
| | +-- design-tokens.json
|
||||
| | +-- component-specs/
|
||||
| | +-- project-structure.md
|
||||
| +-- qa/
|
||||
| | +-- audit-001.md
|
||||
| +-- build/
|
||||
+-- interactive/ # Interactive task artifacts
|
||||
| +-- {id}-result.json
|
||||
+-- wisdom/ # Cross-task knowledge
|
||||
+-- learnings.md
|
||||
+-- decisions.md
|
||||
spawn_agent({
|
||||
agent_type: "team_worker",
|
||||
items: [
|
||||
{ type: "text", text: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: <skill_root>/roles/<role>/role.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
requirement: <task-description>
|
||||
inner_loop: <true|false>
|
||||
|
||||
Read role_spec file (<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.` },
|
||||
|
||||
{ type: "text", text: `## Task Context
|
||||
task_id: <task-id>
|
||||
title: <task-title>
|
||||
description: <task-description>
|
||||
pipeline_phase: <pipeline-phase>` },
|
||||
|
||||
{ type: "text", text: `## Upstream Context
|
||||
<prev_context>` }
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ id })` each worker.
|
||||
|
||||
## Implementation
|
||||
## User Commands
|
||||
|
||||
### Session Initialization
|
||||
| Command | Action |
|
||||
|---------|--------|
|
||||
| `check` / `status` | View execution status graph |
|
||||
| `resume` / `continue` | Advance to next step |
|
||||
|
||||
```javascript
|
||||
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
||||
|
||||
const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
||||
const continueMode = $ARGUMENTS.includes('--continue')
|
||||
const concurrencyMatch = $ARGUMENTS.match(/(?:--concurrency|-c)\s+(\d+)/)
|
||||
const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 3
|
||||
|
||||
const requirement = $ARGUMENTS
|
||||
.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '')
|
||||
.trim()
|
||||
|
||||
const slug = requirement.toLowerCase()
|
||||
.replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
|
||||
.substring(0, 40)
|
||||
const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
|
||||
const sessionId = `fe-${slug}-${dateStr}`
|
||||
const sessionFolder = `.workflow/.csv-wave/${sessionId}`
|
||||
|
||||
Bash(`mkdir -p ${sessionFolder}/artifacts/analysis ${sessionFolder}/artifacts/architecture/component-specs ${sessionFolder}/artifacts/qa ${sessionFolder}/artifacts/build ${sessionFolder}/role-instructions ${sessionFolder}/interactive ${sessionFolder}/wisdom`)
|
||||
|
||||
Write(`${sessionFolder}/discoveries.ndjson`, '')
|
||||
Write(`${sessionFolder}/wisdom/learnings.md`, '# Learnings\n')
|
||||
Write(`${sessionFolder}/wisdom/decisions.md`, '# Decisions\n')
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Phase 0: Pre-Wave Interactive (Requirement Clarification)
|
||||
|
||||
**Objective**: Parse frontend task, clarify scope/industry/constraints, prepare for decomposition.
|
||||
|
||||
**Workflow**:
|
||||
|
||||
1. **Parse user task description** from $ARGUMENTS
|
||||
|
||||
2. **Check for existing sessions** (continue mode):
|
||||
- Scan `.workflow/.csv-wave/fe-*/tasks.csv` for sessions with pending tasks
|
||||
- If `--continue`: resume the specified or most recent session, skip to Phase 2
|
||||
- If active session found: ask user whether to resume or start new
|
||||
|
||||
3. **Clarify scope and industry** (skip if AUTO_YES):
|
||||
|
||||
**Scope Selection**:
|
||||
|
||||
| Option | Pipeline | Task Count |
|
||||
|--------|----------|------------|
|
||||
| Single page | page | 4 tasks (linear) |
|
||||
| Multi-component feature | feature | 5 tasks (with arch review gate) |
|
||||
| Full frontend system | system | 7 tasks (dual-track parallel) |
|
||||
|
||||
**Industry Selection**:
|
||||
|
||||
| Option | Strictness |
|
||||
|--------|------------|
|
||||
| SaaS/Tech | standard |
|
||||
| E-commerce/Retail | standard |
|
||||
| Healthcare/Finance | strict (extra accessibility) |
|
||||
| Other | standard |
|
||||
|
||||
**Design Constraints** (multi-select): Existing design system, WCAG AA, Responsive, Dark mode
|
||||
|
||||
4. **Record requirements**: mode, scope, industry, constraints
|
||||
|
||||
5. **Signal Detection** for pipeline selection:
|
||||
|
||||
| Signal | Keywords | Capability |
|
||||
|--------|----------|------------|
|
||||
| Analysis | analyze, requirements, design intelligence | analyst |
|
||||
| Architecture | design tokens, component architecture, design system | architect |
|
||||
| Implementation | implement, build, code, develop, page, component | developer |
|
||||
| Quality | review, audit, quality, test, accessibility | qa |
|
||||
|
||||
6. **Complexity Scoring**:
|
||||
|
||||
| Factor | Points |
|
||||
|--------|--------|
|
||||
| ui-ux-pro-max integration needed | +1 |
|
||||
| Existing design system detected | +1 |
|
||||
| Accessibility strict mode (healthcare/finance) | +2 |
|
||||
| Multiple tech stacks | +2 |
|
||||
| Dark mode required | +1 |
|
||||
|
||||
Results: 1-2 page, 3-4 feature, 5+ system. Default: feature.
|
||||
|
||||
**Success Criteria**:
|
||||
- Scope, industry, constraints determined
|
||||
- Pipeline mode selected (page/feature/system)
|
||||
|
||||
---
|
||||
|
||||
### Phase 1: Requirement -> CSV + Classification
|
||||
|
||||
**Objective**: Build task dependency graph, generate tasks.csv and per-role instruction templates.
|
||||
|
||||
**Decomposition Rules**:
|
||||
|
||||
1. **Pipeline Selection** based on scope:
|
||||
|
||||
| Scope | Pipeline | Tasks |
|
||||
|-------|----------|-------|
|
||||
| page | ANALYZE-001 -> ARCH-001 -> DEV-001 -> QA-001 | 4 |
|
||||
| feature | ANALYZE-001 -> ARCH-001 -> QA-001(arch) -> DEV-001 -> QA-002(code) | 5 |
|
||||
| system | ANALYZE-001 -> ARCH-001 -> QA-001(arch) -> [ARCH-002 + DEV-001] -> QA-002 -> DEV-002 -> QA-003(final) | 7 |
|
||||
|
||||
2. **Task Description Template**: Every task description uses PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS format (see dispatch.md for full templates)
|
||||
|
||||
3. **Role Instruction Generation**: Write per-role instruction templates to `role-instructions/{role}.md` using the base instruction template customized for each role (analyst, architect, developer, qa)
|
||||
|
||||
**Classification Rules**:
|
||||
|
||||
| Task Property | exec_mode |
|
||||
|---------------|-----------|
|
||||
| Analyst analysis pass | `csv-wave` |
|
||||
| Architect design pass | `csv-wave` |
|
||||
| Developer implementation pass | `csv-wave` |
|
||||
| QA audit pass | `csv-wave` |
|
||||
| All standard pipeline tasks | `csv-wave` |
|
||||
|
||||
**Wave Computation**: Kahn's BFS topological sort with depth tracking.
|
||||
|
||||
```javascript
|
||||
// Generate per-role instruction templates
|
||||
for (const role of ['analyst', 'architect', 'developer', 'qa']) {
|
||||
const instruction = generateRoleInstruction(role, sessionFolder)
|
||||
Write(`${sessionFolder}/role-instructions/${role}.md`, instruction)
|
||||
}
|
||||
|
||||
// Generate tasks.csv from pipeline definition
|
||||
const tasks = buildTasksCsv(pipelineMode, requirement, sessionFolder, industry, constraints)
|
||||
Write(`${sessionFolder}/tasks.csv`, toCsv(tasks))
|
||||
Write(`${sessionFolder}/task-analysis.json`, JSON.stringify(analysisResult, null, 2))
|
||||
```
|
||||
|
||||
**User Validation**: Display task breakdown with wave + exec_mode assignment (skip if AUTO_YES).
|
||||
|
||||
**Success Criteria**:
|
||||
- tasks.csv created with valid schema, wave, and exec_mode assignments
|
||||
- Role instruction templates generated in role-instructions/
|
||||
- task-analysis.json written
|
||||
- No circular dependencies
|
||||
- User approved (or AUTO_YES)
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Wave Execution Engine (Extended)
|
||||
|
||||
**Objective**: Execute tasks wave-by-wave with hybrid mechanism support and cross-wave context propagation.
|
||||
|
||||
```javascript
|
||||
const masterCsv = Read(`${sessionFolder}/tasks.csv`)
|
||||
let tasks = parseCsv(masterCsv)
|
||||
const maxWave = Math.max(...tasks.map(t => t.wave))
|
||||
let gcRound = 0
|
||||
const MAX_GC_ROUNDS = 2
|
||||
|
||||
for (let wave = 1; wave <= maxWave; wave++) {
|
||||
console.log(`\nWave ${wave}/${maxWave}`)
|
||||
|
||||
// 1. Separate tasks by exec_mode
|
||||
const waveTasks = tasks.filter(t => t.wave === wave && t.status === 'pending')
|
||||
const csvTasks = waveTasks.filter(t => t.exec_mode === 'csv-wave')
|
||||
const interactiveTasks = waveTasks.filter(t => t.exec_mode === 'interactive')
|
||||
|
||||
// 2. Check dependencies -- skip tasks whose deps failed
|
||||
for (const task of waveTasks) {
|
||||
const depIds = (task.deps || '').split(';').filter(Boolean)
|
||||
const depStatuses = depIds.map(id => tasks.find(t => t.id === id)?.status)
|
||||
if (depStatuses.some(s => s === 'failed' || s === 'skipped')) {
|
||||
task.status = 'skipped'
|
||||
task.error = `Dependency failed: ${depIds.filter((id, i) =>
|
||||
['failed','skipped'].includes(depStatuses[i])).join(', ')}`
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Execute pre-wave interactive tasks (if any)
|
||||
const preWaveInteractive = interactiveTasks.filter(t => t.status === 'pending')
|
||||
for (const task of preWaveInteractive) {
|
||||
Read(`agents/qa-gate-reviewer.md`)
|
||||
const agent = spawn_agent({
|
||||
message: `## TASK ASSIGNMENT\n\n### MANDATORY FIRST STEPS\n1. Read: agents/qa-gate-reviewer.md\n2. Read: ${sessionFolder}/discoveries.ndjson\n\nGoal: ${task.description}\nScope: ${task.title}\nSession: ${sessionFolder}\n\n### Previous Context\n${buildPrevContext(task, tasks)}`
|
||||
})
|
||||
const result = wait({ ids: [agent], timeout_ms: 600000 })
|
||||
if (result.timed_out) {
|
||||
send_input({ id: agent, message: "Please finalize and output current findings." })
|
||||
wait({ ids: [agent], timeout_ms: 120000 })
|
||||
}
|
||||
Write(`${sessionFolder}/interactive/${task.id}-result.json`, JSON.stringify({
|
||||
task_id: task.id, status: "completed", findings: parseFindings(result),
|
||||
timestamp: getUtc8ISOString()
|
||||
}))
|
||||
close_agent({ id: agent })
|
||||
task.status = 'completed'
|
||||
task.findings = parseFindings(result)
|
||||
}
|
||||
|
||||
// 4. Build prev_context for csv-wave tasks
|
||||
const pendingCsvTasks = csvTasks.filter(t => t.status === 'pending')
|
||||
for (const task of pendingCsvTasks) {
|
||||
task.prev_context = buildPrevContext(task, tasks)
|
||||
}
|
||||
|
||||
if (pendingCsvTasks.length > 0) {
|
||||
// 5. Write wave CSV
|
||||
Write(`${sessionFolder}/wave-${wave}.csv`, toCsv(pendingCsvTasks))
|
||||
|
||||
// 6. Build instruction per role group
|
||||
const waveInstruction = buildWaveInstruction(pendingCsvTasks, sessionFolder, wave)
|
||||
|
||||
// 7. Execute wave via spawn_agents_on_csv
|
||||
spawn_agents_on_csv({
|
||||
csv_path: `${sessionFolder}/wave-${wave}.csv`,
|
||||
id_column: "id",
|
||||
instruction: waveInstruction,
|
||||
max_concurrency: maxConcurrency,
|
||||
max_runtime_seconds: 900,
|
||||
output_csv_path: `${sessionFolder}/wave-${wave}-results.csv`,
|
||||
output_schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: { type: "string" },
|
||||
status: { type: "string", enum: ["completed", "failed"] },
|
||||
findings: { type: "string" },
|
||||
artifacts_produced: { type: "string" },
|
||||
qa_score: { type: "string" },
|
||||
qa_verdict: { type: "string" },
|
||||
error: { type: "string" }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 8. Merge results into master CSV
|
||||
const results = parseCsv(Read(`${sessionFolder}/wave-${wave}-results.csv`))
|
||||
for (const r of results) {
|
||||
const t = tasks.find(t => t.id === r.id)
|
||||
if (t) Object.assign(t, r)
|
||||
}
|
||||
|
||||
// 9. GC Loop Check: if a QA task returned FIX_REQUIRED
|
||||
const qaResults = results.filter(r => r.id.startsWith('QA') && r.qa_verdict === 'FIX_REQUIRED')
|
||||
for (const qr of qaResults) {
|
||||
if (gcRound < MAX_GC_ROUNDS) {
|
||||
gcRound++
|
||||
// Create DEV-fix and QA-recheck tasks, append to tasks array
|
||||
const fixId = `DEV-fix-${gcRound}`
|
||||
const recheckId = `QA-recheck-${gcRound}`
|
||||
tasks.push({
|
||||
id: fixId, title: `Fix QA issues (round ${gcRound})`,
|
||||
description: `PURPOSE: Fix issues from ${qr.id} audit | Success: All critical/high resolved\nTASK:\n- Load QA audit report\n- Fix critical/high issues\n- Re-validate\nCONTEXT:\n- Session: ${sessionFolder}\n- Upstream: ${sessionFolder}/artifacts/qa/\nEXPECTED: Fixed source files\nCONSTRAINTS: Targeted fixes only`,
|
||||
role: 'developer', pipeline_mode: tasks[0].pipeline_mode, scope: 'full',
|
||||
review_type: '', deps: qr.id, context_from: qr.id,
|
||||
exec_mode: 'csv-wave', wave: wave + 1, status: 'pending',
|
||||
findings: '', artifacts_produced: '', qa_score: '', qa_verdict: '', error: ''
|
||||
})
|
||||
tasks.push({
|
||||
id: recheckId, title: `QA recheck (round ${gcRound})`,
|
||||
description: `PURPOSE: Re-audit after fixes | Success: Score >= 8, critical == 0\nTASK:\n- Execute 5-dimension audit on fixed code\n- Focus on previously flagged issues\nCONTEXT:\n- Session: ${sessionFolder}\n- Review type: code-review\nEXPECTED: ${sessionFolder}/artifacts/qa/audit-recheck-${gcRound}.md`,
|
||||
role: 'qa', pipeline_mode: tasks[0].pipeline_mode, scope: 'full',
|
||||
review_type: 'code-review', deps: fixId, context_from: fixId,
|
||||
exec_mode: 'csv-wave', wave: wave + 2, status: 'pending',
|
||||
findings: '', artifacts_produced: '', qa_score: '', qa_verdict: '', error: ''
|
||||
})
|
||||
// Extend maxWave
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 10. Update master CSV
|
||||
Write(`${sessionFolder}/tasks.csv`, toCsv(tasks))
|
||||
|
||||
// 11. Cleanup temp files
|
||||
Bash(`rm -f ${sessionFolder}/wave-${wave}.csv ${sessionFolder}/wave-${wave}-results.csv`)
|
||||
|
||||
// 12. Display wave summary
|
||||
const completed = waveTasks.filter(t => t.status === 'completed').length
|
||||
const failed = waveTasks.filter(t => t.status === 'failed').length
|
||||
const skipped = waveTasks.filter(t => t.status === 'skipped').length
|
||||
console.log(`Wave ${wave} Complete: ${completed} completed, ${failed} failed, ${skipped} skipped`)
|
||||
}
|
||||
```
|
||||
|
||||
**Success Criteria**:
|
||||
- All waves executed in order
|
||||
- Both csv-wave and interactive tasks handled per wave
|
||||
- Each wave's results merged into master CSV before next wave starts
|
||||
- Dependent tasks skipped when predecessor failed
|
||||
- GC loop (developer <-> qa) handled with max 2 rounds
|
||||
- discoveries.ndjson accumulated across all waves and mechanisms
|
||||
|
||||
---
|
||||
|
||||
### Phase 3: Post-Wave Interactive (Completion Action)
|
||||
|
||||
**Objective**: Pipeline completion report with deliverables listing and interactive completion choice.
|
||||
|
||||
```javascript
|
||||
const tasks = parseCsv(Read(`${sessionFolder}/tasks.csv`))
|
||||
const completed = tasks.filter(t => t.status === 'completed')
|
||||
const failed = tasks.filter(t => t.status === 'failed')
|
||||
|
||||
// List deliverables
|
||||
const deliverables = [
|
||||
{ name: "Design Intelligence", path: `${sessionFolder}/artifacts/analysis/design-intelligence.json` },
|
||||
{ name: "Requirements", path: `${sessionFolder}/artifacts/analysis/requirements.md` },
|
||||
{ name: "Design Tokens", path: `${sessionFolder}/artifacts/architecture/design-tokens.json` },
|
||||
{ name: "Component Specs", path: `${sessionFolder}/artifacts/architecture/component-specs/` },
|
||||
{ name: "Project Structure", path: `${sessionFolder}/artifacts/architecture/project-structure.md` },
|
||||
{ name: "QA Audits", path: `${sessionFolder}/artifacts/qa/` }
|
||||
]
|
||||
|
||||
console.log(`
|
||||
============================================
|
||||
FRONTEND TEAM COMPLETE
|
||||
|
||||
Pipeline: ${completed.length}/${tasks.length} tasks (${tasks[0]?.pipeline_mode} mode)
|
||||
GC Rounds: ${gcRound}/${MAX_GC_ROUNDS}
|
||||
Session: ${sessionFolder}
|
||||
|
||||
Deliverables:
|
||||
${deliverables.map(d => ` - ${d.name}: ${d.path}`).join('\n')}
|
||||
============================================
|
||||
`)
|
||||
|
||||
if (!AUTO_YES) {
|
||||
request_user_input({
|
||||
questions: [{
|
||||
question: "Frontend pipeline complete. Choose next action.",
|
||||
header: "Done",
|
||||
id: "completion",
|
||||
options: [
|
||||
{ label: "Archive (Recommended)", description: "Archive session, output final summary" },
|
||||
{ label: "Keep Active", description: "Keep session for follow-up work" },
|
||||
{ label: "Export Results", description: "Export design tokens and component specs" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
**Success Criteria**:
|
||||
- Post-wave interactive processing complete
|
||||
- User informed of deliverables and pipeline status
|
||||
|
||||
---
|
||||
|
||||
### Phase 4: Results Aggregation
|
||||
|
||||
**Objective**: Generate final results and human-readable report.
|
||||
|
||||
```javascript
|
||||
Bash(`cp ${sessionFolder}/tasks.csv ${sessionFolder}/results.csv`)
|
||||
|
||||
const tasks = parseCsv(Read(`${sessionFolder}/tasks.csv`))
|
||||
let contextMd = `# Frontend Development Report\n\n`
|
||||
contextMd += `**Session**: ${sessionId}\n`
|
||||
contextMd += `**Pipeline**: ${tasks[0]?.pipeline_mode} mode\n`
|
||||
contextMd += `**Date**: ${getUtc8ISOString().substring(0, 10)}\n\n`
|
||||
|
||||
contextMd += `## Summary\n`
|
||||
contextMd += `| Status | Count |\n|--------|-------|\n`
|
||||
contextMd += `| Completed | ${tasks.filter(t => t.status === 'completed').length} |\n`
|
||||
contextMd += `| Failed | ${tasks.filter(t => t.status === 'failed').length} |\n`
|
||||
contextMd += `| Skipped | ${tasks.filter(t => t.status === 'skipped').length} |\n\n`
|
||||
|
||||
const maxWave = Math.max(...tasks.map(t => t.wave))
|
||||
contextMd += `## Wave Execution\n\n`
|
||||
for (let w = 1; w <= maxWave; w++) {
|
||||
const waveTasks = tasks.filter(t => t.wave === w)
|
||||
contextMd += `### Wave ${w}\n\n`
|
||||
for (const t of waveTasks) {
|
||||
const icon = t.status === 'completed' ? '[DONE]' : t.status === 'failed' ? '[FAIL]' : '[SKIP]'
|
||||
contextMd += `${icon} **${t.title}** [${t.role}]`
|
||||
if (t.qa_score) contextMd += ` Score: ${t.qa_score}/10 (${t.qa_verdict})`
|
||||
contextMd += ` ${t.findings || ''}\n\n`
|
||||
}
|
||||
}
|
||||
|
||||
contextMd += `## QA Summary\n\n`
|
||||
const qaResults = tasks.filter(t => t.role === 'qa' && t.qa_score)
|
||||
for (const q of qaResults) {
|
||||
contextMd += `- **${q.id}**: Score ${q.qa_score}/10 - ${q.qa_verdict}\n`
|
||||
}
|
||||
|
||||
Write(`${sessionFolder}/context.md`, contextMd)
|
||||
console.log(`Results exported to: ${sessionFolder}/results.csv`)
|
||||
console.log(`Report generated at: ${sessionFolder}/context.md`)
|
||||
```
|
||||
|
||||
**Success Criteria**:
|
||||
- results.csv exported (all tasks, both modes)
|
||||
- context.md generated with QA summary
|
||||
- Summary displayed to user
|
||||
|
||||
---
|
||||
|
||||
## Shared Discovery Board Protocol
|
||||
|
||||
All agents (csv-wave and interactive) share a single `discoveries.ndjson` file for cross-task knowledge exchange.
|
||||
|
||||
**Format**: One JSON object per line (NDJSON):
|
||||
|
||||
```jsonl
|
||||
{"ts":"2026-03-08T10:00:00Z","worker":"ANALYZE-001","type":"tech_stack_detected","data":{"stack":"react","framework":"nextjs","ui_lib":"shadcn"}}
|
||||
{"ts":"2026-03-08T10:05:00Z","worker":"ARCH-001","type":"token_generated","data":{"category":"color","count":24,"supports_dark_mode":true}}
|
||||
{"ts":"2026-03-08T10:10:00Z","worker":"DEV-001","type":"file_modified","data":{"file":"src/styles/tokens.css","change":"Generated CSS custom properties","lines_added":85}}
|
||||
{"ts":"2026-03-08T10:15:00Z","worker":"QA-001","type":"issue_found","data":{"file":"src/components/Button.tsx","line":42,"severity":"high","description":"Missing cursor-pointer on button"}}
|
||||
```
|
||||
|
||||
**Discovery Types**:
|
||||
|
||||
| Type | Data Schema | Description |
|
||||
|------|-------------|-------------|
|
||||
| `tech_stack_detected` | `{stack, framework, ui_lib}` | Tech stack identified by analyst |
|
||||
| `design_pattern_found` | `{pattern_name, location, description}` | Existing design pattern in codebase |
|
||||
| `token_generated` | `{category, count, supports_dark_mode}` | Design token category created |
|
||||
| `file_modified` | `{file, change, lines_added}` | File change recorded |
|
||||
| `issue_found` | `{file, line, severity, description}` | QA issue discovered |
|
||||
| `anti_pattern_violation` | `{pattern, file, line, description}` | Industry anti-pattern detected |
|
||||
| `artifact_produced` | `{name, path, producer, type}` | Deliverable created |
|
||||
|
||||
**Protocol**:
|
||||
1. Agents MUST read discoveries.ndjson at start of execution
|
||||
2. Agents MUST append relevant discoveries during execution
|
||||
3. Agents MUST NOT modify or delete existing entries
|
||||
4. Deduplication by `{type, data.file}` key
|
||||
|
||||
---
|
||||
|
||||
## Pipeline Definitions
|
||||
|
||||
### Page Mode (4 tasks, linear)
|
||||
## Session Directory
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> DEV-001 --> QA-001
|
||||
[analyst] [architect] [developer] [qa:code-review]
|
||||
wave 1 wave 2 wave 3 wave 4
|
||||
.workflow/.team/FE-<slug>-<YYYY-MM-DD>/
|
||||
├── .msg/
|
||||
│ ├── messages.jsonl # Message bus log
|
||||
│ └── meta.json # Session state + cross-role state
|
||||
├── task-analysis.json # Coordinator analyze output
|
||||
├── wisdom/ # Cross-task knowledge
|
||||
├── analysis/ # Analyst output
|
||||
│ ├── design-intelligence.json
|
||||
│ └── requirements.md
|
||||
├── architecture/ # Architect output
|
||||
│ ├── design-tokens.json
|
||||
│ ├── component-specs/
|
||||
│ └── project-structure.md
|
||||
├── qa/ # QA output
|
||||
│ └── audit-<NNN>.md
|
||||
└── build/ # Developer output
|
||||
```
|
||||
|
||||
### Feature Mode (5 tasks, with architecture review gate)
|
||||
## Specs Reference
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> DEV-001 --> QA-002
|
||||
[analyst] [architect] [qa:arch] [developer] [qa:code-review]
|
||||
wave 1 wave 2 wave 3 wave 4 wave 5
|
||||
```
|
||||
|
||||
### System Mode (7 tasks, dual-track parallel)
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> ARCH-002 --+
|
||||
[analyst] [architect] [qa:arch] [architect] |
|
||||
DEV-001 --+--> QA-002 --> DEV-002 --> QA-003
|
||||
[dev:tokens] [qa] [dev:comp] [qa:final]
|
||||
wave 1 wave 2 wave 3 wave 4 wave 5 wave 6 wave 7
|
||||
```
|
||||
|
||||
### Generator-Critic Loop (developer <-> qa)
|
||||
|
||||
```
|
||||
developer (Generator) -> QA artifact -> qa (Critic)
|
||||
<- QA feedback <-
|
||||
(max 2 rounds)
|
||||
|
||||
Convergence: qa.score >= 8 && qa.critical_count === 0
|
||||
```
|
||||
|
||||
---
|
||||
- [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Resolution |
|
||||
|-------|------------|
|
||||
| Circular dependency | Detect in wave computation, abort with error message |
|
||||
| CSV agent timeout | Mark as failed in results, continue with wave |
|
||||
| CSV agent failed | Mark as failed, skip dependent tasks in later waves |
|
||||
| Interactive agent timeout | Urge convergence via send_input, then close if still timed out |
|
||||
| Interactive agent failed | Mark as failed, skip dependents |
|
||||
| All agents in wave failed | Log error, offer retry or abort |
|
||||
| CSV parse error | Validate CSV format before execution, show line number |
|
||||
| discoveries.ndjson corrupt | Ignore malformed lines, continue with valid entries |
|
||||
| QA score < 6 over 2 GC rounds | Escalate to user for manual intervention |
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Unknown command | Error with available command list |
|
||||
| Role not found | Error with role registry |
|
||||
| QA score < 6 over 2 GC rounds | Escalate to user |
|
||||
| ui-ux-pro-max unavailable | Degrade to LLM general design knowledge |
|
||||
| Task description too vague | request_user_input for clarification in Phase 0 |
|
||||
| Continue mode: no session found | List available sessions, prompt user to select |
|
||||
|
||||
---
|
||||
|
||||
## Core Rules
|
||||
|
||||
1. **Start Immediately**: First action is session initialization, then Phase 0/1
|
||||
2. **Wave Order is Sacred**: Never execute wave N before wave N-1 completes and results are merged
|
||||
3. **CSV is Source of Truth**: Master tasks.csv holds all state (both csv-wave and interactive)
|
||||
4. **CSV First**: Default to csv-wave for tasks; only use interactive when interaction pattern requires it
|
||||
5. **Context Propagation**: prev_context built from master CSV, not from memory
|
||||
6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
|
||||
7. **Skip on Failure**: If a dependency failed, skip the dependent task
|
||||
8. **GC Loop Cap**: Max 2 generator-critic rounds between developer and qa
|
||||
9. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
||||
10. **DO NOT STOP**: Continuous execution until all waves complete or all remaining tasks are skipped
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Coordinator Role Constraints (Main Agent)
|
||||
|
||||
**CRITICAL**: The coordinator (main agent executing this skill) is responsible for **orchestration only**, NOT implementation.
|
||||
|
||||
15. **Coordinator Does NOT Execute Code**: The main agent MUST NOT write, modify, or implement any code directly. All implementation work is delegated to spawned team agents. The coordinator only:
|
||||
- Spawns agents with task assignments
|
||||
- Waits for agent callbacks
|
||||
- Merges results and coordinates workflow
|
||||
- Manages workflow transitions between phases
|
||||
|
||||
16. **Patient Waiting is Mandatory**: Agent execution takes significant time (typically 10-30 minutes per phase, sometimes longer). The coordinator MUST:
|
||||
- Wait patiently for `wait()` calls to complete
|
||||
- NOT skip workflow steps due to perceived delays
|
||||
- NOT assume agents have failed just because they're taking time
|
||||
- Trust the timeout mechanisms defined in the skill
|
||||
|
||||
17. **Use send_input for Clarification**: When agents need guidance or appear stuck, the coordinator MUST:
|
||||
- Use `send_input()` to ask questions or provide clarification
|
||||
- NOT skip the agent or move to next phase prematurely
|
||||
- Give agents opportunity to respond before escalating
|
||||
- Example: `send_input({ id: agent_id, message: "Please provide status update or clarify blockers" })`
|
||||
|
||||
18. **No Workflow Shortcuts**: The coordinator MUST NOT:
|
||||
- Skip phases or stages defined in the workflow
|
||||
- Bypass required approval or review steps
|
||||
- Execute dependent tasks before prerequisites complete
|
||||
- Assume task completion without explicit agent callback
|
||||
- Make up or fabricate agent results
|
||||
|
||||
19. **Respect Long-Running Processes**: This is a complex multi-agent workflow that requires patience:
|
||||
- Total execution time may range from 30-90 minutes or longer
|
||||
- Each phase may take 10-30 minutes depending on complexity
|
||||
- The coordinator must remain active and attentive throughout the entire process
|
||||
- Do not terminate or skip steps due to time concerns
|
||||
| Worker no response | Report waiting task, suggest user `resume` |
|
||||
| Pipeline deadlock | Check blockedBy chain, report blocking point |
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
# Completion Handler Agent
|
||||
|
||||
Interactive agent for handling pipeline completion action. Presents deliverables summary and offers Archive/Keep/Export choices.
|
||||
|
||||
## Identity
|
||||
|
||||
- **Type**: `interactive`
|
||||
- **Role File**: `agents/completion-handler.md`
|
||||
- **Responsibility**: Present pipeline results, handle completion choice, execute cleanup or export
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Load role definition via MANDATORY FIRST STEPS pattern
|
||||
- Read all task results from master CSV
|
||||
- Present complete deliverables listing
|
||||
- Wait for user choice before acting
|
||||
- Produce structured output following template
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Skip the MANDATORY FIRST STEPS role loading
|
||||
- Delete session files without user approval
|
||||
- Modify task artifacts
|
||||
- Produce unstructured output
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Available Tools
|
||||
|
||||
| Tool | Type | Purpose |
|
||||
|------|------|---------|
|
||||
| `Read` | built-in | Load task results and artifacts |
|
||||
| `request_user_input` | built-in | Get user completion choice |
|
||||
| `Write` | built-in | Store completion result |
|
||||
| `Bash` | built-in | Execute archive/export operations |
|
||||
|
||||
---
|
||||
|
||||
## Execution
|
||||
|
||||
### Phase 1: Results Loading
|
||||
|
||||
**Objective**: Load all task results and build deliverables inventory
|
||||
|
||||
**Input**:
|
||||
|
||||
| Source | Required | Description |
|
||||
|--------|----------|-------------|
|
||||
| tasks.csv | Yes | Master state with all task results |
|
||||
| Artifact files | No | Verify deliverables exist |
|
||||
|
||||
**Steps**:
|
||||
|
||||
1. Read master tasks.csv
|
||||
2. Parse all completed tasks and their artifacts
|
||||
3. Build deliverables inventory
|
||||
4. Calculate pipeline statistics
|
||||
|
||||
**Output**: Deliverables summary ready for user
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Completion Choice
|
||||
|
||||
**Objective**: Present results and get user action
|
||||
|
||||
**Steps**:
|
||||
|
||||
1. Display pipeline summary with deliverables
|
||||
2. Present completion choice:
|
||||
|
||||
```javascript
|
||||
request_user_input({
|
||||
questions: [{
|
||||
question: "Frontend pipeline complete. What would you like to do?",
|
||||
header: "Completion",
|
||||
id: "completion_action",
|
||||
options: [
|
||||
{ label: "Archive & Clean (Recommended)", description: "Archive session, output final summary" },
|
||||
{ label: "Keep Active", description: "Keep session for follow-up work" },
|
||||
{ label: "Export Results", description: "Export design tokens, component specs, and QA audits" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
3. Handle response:
|
||||
|
||||
| Response | Action |
|
||||
|----------|--------|
|
||||
| Archive & Clean | Mark session as completed, output final summary |
|
||||
| Keep Active | Mark session as paused, keep all artifacts |
|
||||
| Export Results | Copy key artifacts to project directory |
|
||||
|
||||
**Output**: Completion action result
|
||||
|
||||
---
|
||||
|
||||
## Structured Output Template
|
||||
|
||||
```
|
||||
## Summary
|
||||
- Pipeline completed: <task-count> tasks
|
||||
- Status: <all-pass|with-warnings|with-failures>
|
||||
- QA final score: <score>/10
|
||||
|
||||
## Deliverables
|
||||
- Design Intelligence: <path>
|
||||
- Design Tokens: <path>
|
||||
- Component Specs: <path>
|
||||
- QA Audits: <path>
|
||||
- Implementation: <file-count> files
|
||||
|
||||
## Action Taken
|
||||
- Choice: <archive|keep|export>
|
||||
- Session status: <completed|paused|exported>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| tasks.csv not found | Report error, cannot complete |
|
||||
| Artifacts missing | Report partial completion with gaps noted |
|
||||
| User does not respond | Timeout, default to keep active |
|
||||
@@ -1,153 +0,0 @@
|
||||
# QA Gate Reviewer Agent
|
||||
|
||||
Interactive agent for reviewing QA audit verdicts and handling the Generator-Critic (GC) loop decision. Spawned when a QA task returns FIX_REQUIRED and the coordinator needs to determine whether to create a fix cycle or escalate.
|
||||
|
||||
## Identity
|
||||
|
||||
- **Type**: `interactive`
|
||||
- **Role File**: `agents/qa-gate-reviewer.md`
|
||||
- **Responsibility**: Review QA audit verdicts, handle architecture review gates, manage GC loop decisions
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Load role definition via MANDATORY FIRST STEPS pattern
|
||||
- Read the QA audit report being reviewed
|
||||
- Present a clear summary of QA findings to the user
|
||||
- Wait for user decision before proceeding (if not AUTO_YES)
|
||||
- Produce structured output following template
|
||||
- Include file:line references in findings
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Skip the MANDATORY FIRST STEPS role loading
|
||||
- Auto-approve FIX_REQUIRED verdicts without checking GC round count
|
||||
- Modify QA audit artifacts directly
|
||||
- Produce unstructured output
|
||||
- Exceed defined scope boundaries
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Available Tools
|
||||
|
||||
| Tool | Type | Purpose |
|
||||
|------|------|---------|
|
||||
| `Read` | built-in | Load QA audit reports and context |
|
||||
| `request_user_input` | built-in | Get user decision on QA gate |
|
||||
| `Write` | built-in | Store review result |
|
||||
|
||||
### Tool Usage Patterns
|
||||
|
||||
**Read Pattern**: Load context files before review
|
||||
```
|
||||
Read("<session>/artifacts/qa/audit-*.md")
|
||||
Read("<session>/discoveries.ndjson")
|
||||
```
|
||||
|
||||
**Write Pattern**: Store review result
|
||||
```
|
||||
Write("<session>/interactive/<task-id>-result.json", <result>)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution
|
||||
|
||||
### Phase 1: Context Loading
|
||||
|
||||
**Objective**: Load QA audit report and GC loop state
|
||||
|
||||
**Input**:
|
||||
|
||||
| Source | Required | Description |
|
||||
|--------|----------|-------------|
|
||||
| QA audit report | Yes | The audit document to review |
|
||||
| discoveries.ndjson | No | Shared discoveries for context |
|
||||
| Master CSV (tasks.csv) | No | For GC round tracking |
|
||||
|
||||
**Steps**:
|
||||
|
||||
1. Extract session path from task assignment
|
||||
2. Read the QA audit report referenced in the task description
|
||||
3. Read discoveries.ndjson for additional context
|
||||
4. Check current GC round count from session state
|
||||
|
||||
**Output**: QA verdict summary ready for review
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Gate Decision
|
||||
|
||||
**Objective**: Determine next action based on QA verdict
|
||||
|
||||
**Steps**:
|
||||
|
||||
1. Parse QA verdict from audit report:
|
||||
|
||||
| Verdict | GC Round | Action |
|
||||
|---------|----------|--------|
|
||||
| PASSED | any | Report approved, no fix cycle needed |
|
||||
| PASSED_WITH_WARNINGS | any | Report approved with warnings noted |
|
||||
| FIX_REQUIRED | < 2 | Create DEV-fix + QA-recheck tasks |
|
||||
| FIX_REQUIRED | >= 2 | Escalate to user for manual intervention |
|
||||
|
||||
2. If escalation needed, present choice:
|
||||
|
||||
```javascript
|
||||
request_user_input({
|
||||
questions: [{
|
||||
question: "QA has flagged issues after 2 fix rounds. How would you like to proceed?",
|
||||
header: "QA Gate",
|
||||
id: "qa_gate_decision",
|
||||
options: [
|
||||
{ label: "Accept current state (Recommended)", description: "Proceed despite remaining issues" },
|
||||
{ label: "Manual fix", description: "You will fix the issues manually" },
|
||||
{ label: "Abort pipeline", description: "Stop the pipeline" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
3. Handle response accordingly
|
||||
|
||||
**Output**: Gate decision with action directive
|
||||
|
||||
---
|
||||
|
||||
## Structured Output Template
|
||||
|
||||
```
|
||||
## Summary
|
||||
- QA audit reviewed: <audit-id>
|
||||
- Verdict: <PASSED|PASSED_WITH_WARNINGS|FIX_REQUIRED>
|
||||
- Score: <score>/10
|
||||
- Decision: <approved|fix-cycle|escalated|aborted>
|
||||
|
||||
## Findings
|
||||
- Critical issues: <count>
|
||||
- High issues: <count>
|
||||
- Medium issues: <count>
|
||||
- Low issues: <count>
|
||||
|
||||
## Decision Details
|
||||
- GC round: <current>/<max>
|
||||
- Action: <proceed|create-fix-cycle|escalate|abort>
|
||||
- User feedback: <if applicable>
|
||||
|
||||
## Open Questions
|
||||
1. Any unresolved items from review
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| QA audit report not found | Report in Open Questions, ask for path |
|
||||
| GC round state missing | Default to round 0 |
|
||||
| User does not respond | Timeout, report partial with "awaiting-review" status |
|
||||
| Processing failure | Output partial results with clear status indicator |
|
||||
@@ -1,197 +0,0 @@
|
||||
# Agent Instruction Template -- Team Frontend
|
||||
|
||||
Base instruction template for CSV wave agents. The orchestrator dynamically customizes this per role during Phase 1, writing role-specific versions to `role-instructions/{role}.md`.
|
||||
|
||||
## Purpose
|
||||
|
||||
| Phase | Usage |
|
||||
|-------|-------|
|
||||
| Phase 1 | Coordinator generates per-role instruction from this template |
|
||||
| Phase 2 | Injected as `instruction` parameter to `spawn_agents_on_csv` |
|
||||
|
||||
---
|
||||
|
||||
## Base Instruction Template
|
||||
|
||||
```markdown
|
||||
## TASK ASSIGNMENT -- Team Frontend
|
||||
|
||||
### MANDATORY FIRST STEPS
|
||||
1. Read shared discoveries: <session-folder>/discoveries.ndjson (if exists, skip if not)
|
||||
2. Read project context: .workflow/project-tech.json (if exists)
|
||||
|
||||
---
|
||||
|
||||
## Your Task
|
||||
|
||||
**Task ID**: {id}
|
||||
**Title**: {title}
|
||||
**Role**: {role}
|
||||
**Pipeline Mode**: {pipeline_mode}
|
||||
**Scope**: {scope}
|
||||
**Review Type**: {review_type}
|
||||
|
||||
### Task Description
|
||||
{description}
|
||||
|
||||
### Previous Tasks' Findings (Context)
|
||||
{prev_context}
|
||||
|
||||
---
|
||||
|
||||
## Execution Protocol
|
||||
|
||||
1. **Read discoveries**: Load <session-folder>/discoveries.ndjson for shared exploration findings
|
||||
2. **Use context**: Apply previous tasks' findings from prev_context above
|
||||
3. **Execute task**: Follow role-specific instructions below
|
||||
4. **Share discoveries**: Append exploration findings to shared board:
|
||||
```bash
|
||||
echo '{"ts":"<ISO8601>","worker":"{id}","type":"<type>","data":{...}}' >> <session-folder>/discoveries.ndjson
|
||||
```
|
||||
5. **Report result**: Return JSON via report_agent_job_result
|
||||
|
||||
### Discovery Types to Share
|
||||
- `tech_stack_detected`: {stack, framework, ui_lib} -- Tech stack identification
|
||||
- `design_pattern_found`: {pattern_name, location, description} -- Existing design pattern
|
||||
- `token_generated`: {category, count, supports_dark_mode} -- Design token category created
|
||||
- `file_modified`: {file, change, lines_added} -- File change performed
|
||||
- `issue_found`: {file, line, severity, description} -- Issue discovered
|
||||
- `anti_pattern_violation`: {pattern, file, line, description} -- Anti-pattern detected
|
||||
- `artifact_produced`: {name, path, producer, type} -- Deliverable created
|
||||
|
||||
---
|
||||
|
||||
## Output (report_agent_job_result)
|
||||
|
||||
Return JSON:
|
||||
{
|
||||
"id": "{id}",
|
||||
"status": "completed" | "failed",
|
||||
"findings": "Key discoveries and implementation notes (max 500 chars)",
|
||||
"artifacts_produced": "semicolon-separated paths of produced files",
|
||||
"qa_score": "",
|
||||
"qa_verdict": "",
|
||||
"error": ""
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Role-Specific Customization
|
||||
|
||||
The coordinator generates per-role instruction variants during Phase 1. Each variant adds role-specific execution guidance to Step 3.
|
||||
|
||||
### For Analyst Role
|
||||
|
||||
```
|
||||
3. **Execute**:
|
||||
- Detect tech stack from package.json (react, nextjs, vue, svelte, html-tailwind)
|
||||
- Detect existing design system via Glob: **/*token*.*, **/*.css
|
||||
- Retrieve design intelligence via ui-ux-pro-max skill:
|
||||
- Full design system: Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")
|
||||
- UX guidelines: Skill(skill="ui-ux-pro-max", args="accessibility animation responsive --domain ux")
|
||||
- Tech stack guide: Skill(skill="ui-ux-pro-max", args="<keywords> --stack <detected-stack>")
|
||||
- Fallback if skill unavailable: generate from LLM general design knowledge
|
||||
- Analyze existing codebase patterns (color palette, typography, spacing, components)
|
||||
- Optional: WebSearch for "<industry> web design trends best practices"
|
||||
- Compile design-intelligence.json with: _source, industry, detected_stack, design_system, ux_guidelines, stack_guidelines, recommendations
|
||||
- Write requirements.md summarizing all requirements
|
||||
- Output to <session-folder>/artifacts/analysis/
|
||||
```
|
||||
|
||||
### For Architect Role
|
||||
|
||||
```
|
||||
3. **Execute**:
|
||||
- Load design-intelligence.json from analyst output
|
||||
- Generate design token system (design-tokens.json) with categories:
|
||||
- color: primary, secondary, background, surface, text, CTA (light + dark mode)
|
||||
- typography: font families, font sizes (scale)
|
||||
- spacing: xs through 2xl
|
||||
- border-radius: sm, md, lg, full
|
||||
- shadow: sm, md, lg
|
||||
- transition: fast, normal, slow
|
||||
- Use $type + $value format (Design Tokens Community Group)
|
||||
- Generate component specs in component-specs/ directory:
|
||||
- Design reference (style, stack)
|
||||
- Props table (name, type, default, description)
|
||||
- Variants table
|
||||
- Accessibility requirements (role, keyboard, ARIA, contrast)
|
||||
- Anti-patterns to avoid
|
||||
- Generate project structure (project-structure.md) using stack-specific layout
|
||||
- Output to <session-folder>/artifacts/architecture/
|
||||
```
|
||||
|
||||
### For Developer Role
|
||||
|
||||
```
|
||||
3. **Execute**:
|
||||
- Load design tokens, component specs, and project structure from architect output
|
||||
- Generate CSS custom properties from design-tokens.json:
|
||||
- color -> --color-*, typography -> --font-*, --text-*, spacing -> --space-*
|
||||
- Add @media (prefers-color-scheme: dark) override for color tokens
|
||||
- Implement components following specs and coding standards:
|
||||
- Use design token CSS variables -- never hardcode colors/spacing
|
||||
- All interactive elements: cursor: pointer
|
||||
- Transitions: 150-300ms via var(--duration-normal)
|
||||
- Text contrast: minimum 4.5:1 ratio
|
||||
- Include focus-visible styles for keyboard navigation
|
||||
- Support prefers-reduced-motion
|
||||
- Responsive: mobile-first with md/lg breakpoints
|
||||
- No emoji as functional icons
|
||||
- Self-validate: scan for hardcoded colors, missing cursor-pointer, missing focus styles
|
||||
- Auto-fix where possible
|
||||
- Output to src/ directory (codebase files) + implementation summary
|
||||
```
|
||||
|
||||
### For QA Role
|
||||
|
||||
```
|
||||
3. **Execute**:
|
||||
- Load design intelligence and design tokens for compliance checks
|
||||
- Collect files to review based on review_type:
|
||||
- architecture-review: <session>/artifacts/architecture/**/*
|
||||
- code-review: src/**/*.{tsx,jsx,vue,svelte,html,css}
|
||||
- final: src/**/*.{tsx,jsx,vue,svelte,html,css}
|
||||
- Execute 5-dimension audit:
|
||||
- Dim 1 Code Quality (0.20): file length, console.log, empty catch, unused imports
|
||||
- Dim 2 Accessibility (0.25): alt text, labels, headings, focus styles, ARIA
|
||||
- Dim 3 Design Compliance (0.20): hardcoded colors, spacing, anti-patterns
|
||||
- Dim 4 UX Best Practices (0.20): cursor-pointer, transitions, responsive, states
|
||||
- Dim 5 Pre-Delivery (0.15): final checklist (code-review/final types only)
|
||||
- Calculate weighted score: sum(dimension_score * weight)
|
||||
- Determine verdict: score >= 8 AND critical == 0 -> PASSED; score >= 6 AND critical == 0 -> PASSED_WITH_WARNINGS; else -> FIX_REQUIRED
|
||||
- Write audit report to <session-folder>/artifacts/qa/
|
||||
- Set qa_score and qa_verdict in output
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Quality Requirements
|
||||
|
||||
All agents must verify before reporting complete:
|
||||
|
||||
| Requirement | Criteria |
|
||||
|-------------|----------|
|
||||
| Files produced | Verify all claimed artifacts exist via Read |
|
||||
| Files modified | Verify content actually changed |
|
||||
| Findings accuracy | Findings reflect actual work done |
|
||||
| Discovery sharing | At least 1 discovery shared to board |
|
||||
| Error reporting | Non-empty error field if status is failed |
|
||||
| QA fields | qa_score and qa_verdict set for QA role tasks |
|
||||
|
||||
---
|
||||
|
||||
## Placeholder Reference
|
||||
|
||||
| Placeholder | Resolved By | When |
|
||||
|-------------|------------|------|
|
||||
| `<session-folder>` | Skill designer (Phase 1) | Literal path baked into instruction |
|
||||
| `{id}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{title}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{description}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{role}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{pipeline_mode}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{scope}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{review_type}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
| `{prev_context}` | spawn_agents_on_csv | Runtime from CSV row |
|
||||
92
.codex/skills/team-frontend/roles/analyst/role.md
Normal file
92
.codex/skills/team-frontend/roles/analyst/role.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
role: analyst
|
||||
prefix: ANALYZE
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: analyze_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Requirements Analyst
|
||||
|
||||
Analyze frontend requirements and retrieve industry design intelligence via ui-ux-pro-max skill. Produce design-intelligence.json and requirements.md for downstream consumption by architect and developer roles.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Industry context | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path, industry type, and tech stack from task description
|
||||
2. Detect existing design system:
|
||||
|
||||
| Signal | Detection Method |
|
||||
|--------|-----------------|
|
||||
| Token files | Glob `**/*token*.*` |
|
||||
| CSS files | Glob `**/*.css` |
|
||||
| Package.json | Read for framework dependencies |
|
||||
|
||||
3. Detect tech stack from package.json:
|
||||
|
||||
| Dependency | Stack |
|
||||
|------------|-------|
|
||||
| `next` | nextjs |
|
||||
| `react` | react |
|
||||
| `vue` | vue |
|
||||
| `svelte` | svelte |
|
||||
| `@shadcn/ui` | shadcn |
|
||||
| (none) | html-tailwind |
|
||||
|
||||
4. Load .msg/meta.json for shared state
|
||||
|
||||
## Phase 3: Design Intelligence Retrieval
|
||||
|
||||
Retrieve design intelligence via ui-ux-pro-max skill integration.
|
||||
|
||||
**Step 1: Invoke ui-ux-pro-max** (primary path):
|
||||
|
||||
| Action | Invocation |
|
||||
|--------|------------|
|
||||
| Full design system | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| UX guidelines | `Skill(skill="ui-ux-pro-max", args="accessibility animation responsive --domain ux")` |
|
||||
| Tech stack guide | `Skill(skill="ui-ux-pro-max", args="<keywords> --stack <detected-stack>")` |
|
||||
|
||||
**Step 2: Fallback** (if skill unavailable):
|
||||
- Generate design recommendations from LLM general knowledge
|
||||
- Log warning: `ui-ux-pro-max not installed. Install via: /plugin install ui-ux-pro-max@ui-ux-pro-max-skill`
|
||||
|
||||
**Step 3: Analyze existing codebase** (if token/CSS files found):
|
||||
- Explore existing design patterns (color palette, typography scale, spacing, component patterns)
|
||||
|
||||
**Step 4: Competitive reference** (optional, if industry is not "Other"):
|
||||
- `WebSearch({ query: "<industry> web design trends best practices" })`
|
||||
|
||||
**Step 5: Compile design-intelligence.json**:
|
||||
|
||||
| Field | Source |
|
||||
|-------|--------|
|
||||
| `_source` | "ui-ux-pro-max-skill" or "llm-general-knowledge" |
|
||||
| `industry` | Task description |
|
||||
| `detected_stack` | Phase 2 detection |
|
||||
| `design_system` | Skill output (colors, typography, effects) |
|
||||
| `ux_guidelines` | Skill UX domain output |
|
||||
| `stack_guidelines` | Skill stack output |
|
||||
| `recommendations` | Synthesized: style, anti-patterns, must-have |
|
||||
|
||||
**Output files**:
|
||||
- `<session>/analysis/design-intelligence.json`
|
||||
- `<session>/analysis/requirements.md`
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| JSON validity | Parse design-intelligence.json | No parse errors |
|
||||
| Required fields | Check _source, industry, design_system | All present |
|
||||
| Anti-patterns populated | Check recommendations.anti_patterns | Non-empty array |
|
||||
| Requirements doc exists | File check | requirements.md written |
|
||||
|
||||
Update .msg/meta.json: merge `design_intelligence` and `industry_context` keys.
|
||||
86
.codex/skills/team-frontend/roles/architect/role.md
Normal file
86
.codex/skills/team-frontend/roles/architect/role.md
Normal file
@@ -0,0 +1,86 @@
|
||||
---
|
||||
role: architect
|
||||
prefix: ARCH
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: arch_ready
|
||||
error: error
|
||||
---
|
||||
|
||||
# Frontend Architect
|
||||
|
||||
Consume design-intelligence.json to define design token system, component architecture, and project structure. Token values prioritize ui-ux-pro-max recommendations. Produce architecture artifacts for developer consumption.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Scope | Extracted from task description (tokens/components/full) | No (default: full) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and scope from task description
|
||||
2. Load design intelligence from analyst output
|
||||
3. Load .msg/meta.json for shared state (industry_context, design_intelligence)
|
||||
4. Detect existing project structure via Glob `src/**/*`
|
||||
|
||||
**Fail-safe**: If design-intelligence.json not found, use default token values and log warning.
|
||||
|
||||
## Phase 3: Architecture Design
|
||||
|
||||
**Scope selection**:
|
||||
|
||||
| Scope | Output |
|
||||
|-------|--------|
|
||||
| `tokens` | Design token system only |
|
||||
| `components` | Component specs only |
|
||||
| `full` | Both tokens and components + project structure |
|
||||
|
||||
**Step 1: Design Token System** (scope: tokens or full):
|
||||
|
||||
Generate `<session>/architecture/design-tokens.json` with categories:
|
||||
|
||||
| Category | Content | Source |
|
||||
|----------|---------|--------|
|
||||
| `color` | Primary, secondary, background, surface, text, CTA | ui-ux-pro-max |
|
||||
| `typography` | Font families, font sizes (scale) | ui-ux-pro-max |
|
||||
| `spacing` | xs through 2xl | Standard scale |
|
||||
| `border-radius` | sm, md, lg, full | Standard scale |
|
||||
| `shadow` | sm, md, lg | Standard elevation |
|
||||
| `transition` | fast, normal, slow | Standard durations |
|
||||
|
||||
Use `$type` + `$value` format (Design Tokens Community Group). Support light/dark mode via nested values.
|
||||
|
||||
**Step 2: Component Architecture** (scope: components or full):
|
||||
|
||||
Generate component specs in `<session>/architecture/component-specs/`:
|
||||
- Design reference (style, stack)
|
||||
- Props table (name, type, default, description)
|
||||
- Variants table
|
||||
- Accessibility requirements (role, keyboard, ARIA, contrast)
|
||||
- Anti-patterns to avoid (from design intelligence)
|
||||
|
||||
**Step 3: Project Structure** (scope: full):
|
||||
|
||||
Generate `<session>/architecture/project-structure.md` with stack-specific layout:
|
||||
|
||||
| Stack | Key Directories |
|
||||
|-------|----------------|
|
||||
| react | src/components/, src/pages/, src/hooks/, src/styles/ |
|
||||
| nextjs | app/(routes)/, app/components/, app/lib/, app/styles/ |
|
||||
| vue | src/components/, src/views/, src/composables/, src/styles/ |
|
||||
| html-tailwind | src/components/, src/pages/, src/styles/ |
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| JSON validity | Parse design-tokens.json | No errors |
|
||||
| Required categories | Check color, typography, spacing | All present |
|
||||
| Anti-pattern compliance | Token values vs anti-patterns | No violations |
|
||||
| Component specs complete | Each has props + accessibility | All complete |
|
||||
| File existence | Verify all planned files | All present |
|
||||
|
||||
Update .msg/meta.json: merge `design_token_registry` and `component_inventory` keys.
|
||||
@@ -0,0 +1,52 @@
|
||||
# Analyze Task
|
||||
|
||||
Parse frontend task -> detect capabilities -> assess pipeline complexity -> design roles.
|
||||
|
||||
**CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
|
||||
|
||||
## Signal Detection
|
||||
|
||||
| Keywords | Capability | Role |
|
||||
|----------|------------|------|
|
||||
| analyze, requirements, design intelligence | analyst | analyst |
|
||||
| design tokens, component architecture, design system | architect | architect |
|
||||
| implement, build, code, develop, page, component | developer | developer |
|
||||
| review, audit, quality, test, accessibility | qa | qa |
|
||||
|
||||
## Pipeline Selection
|
||||
|
||||
| Scope Signal | Pipeline |
|
||||
|--------------|----------|
|
||||
| single page, landing, simple | page (4-beat) |
|
||||
| feature, multi-component, complex | feature (5-beat with arch review gate) |
|
||||
| full system, design system, multiple pages | system (7-beat dual-track) |
|
||||
|
||||
Default to `feature` if ambiguous.
|
||||
|
||||
## Complexity Scoring
|
||||
|
||||
| Factor | Points |
|
||||
|--------|--------|
|
||||
| ui-ux-pro-max integration needed | +1 |
|
||||
| Existing design system detected | +1 |
|
||||
| Accessibility strict mode (healthcare/finance) | +2 |
|
||||
| Multiple tech stacks | +2 |
|
||||
| Dark mode required | +1 |
|
||||
|
||||
Results: 1-2 page, 3-4 feature, 5+ system
|
||||
|
||||
## Output
|
||||
|
||||
Write <session>/task-analysis.json:
|
||||
```json
|
||||
{
|
||||
"task_description": "<original>",
|
||||
"pipeline_type": "<page|feature|system>",
|
||||
"capabilities": [{ "name": "<cap>", "role": "<role>", "keywords": ["..."] }],
|
||||
"roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
|
||||
"complexity": { "score": 0, "level": "Low|Medium|High" },
|
||||
"industry": "<industry>",
|
||||
"constraints": [],
|
||||
"needs_ui_ux_pro_max": true
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,151 @@
|
||||
# Command: Dispatch
|
||||
|
||||
Create the frontend development task chain with correct dependencies and structured task descriptions. Supports page, feature, and system pipeline modes.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| User requirement | From coordinator Phase 1 | Yes |
|
||||
| Session folder | From coordinator Phase 2 | Yes |
|
||||
| Pipeline mode | From session.json `pipeline_mode` | Yes |
|
||||
| Industry | From session.json `industry` | Yes |
|
||||
| Constraints | From session.json `constraints` | No |
|
||||
|
||||
1. Load user requirement and scope from session.json
|
||||
2. Load pipeline mode (page / feature / system) from session.json
|
||||
3. Load industry and constraints for task descriptions
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
### Task Description Template
|
||||
|
||||
Every task is a JSON entry in the tasks array, written to `<session>/tasks.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "<TASK-ID>",
|
||||
"subject": "<TASK-ID>",
|
||||
"description": "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>\nTASK:\n - <step 1: specific action>\n - <step 2: specific action>\n - <step 3: specific action>\nCONTEXT:\n - Session: <session-folder>\n - Industry: <industry>\n - Scope: <scope>\n - Upstream artifacts: <artifact-1>, <artifact-2>\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <deliverable path> + <quality criteria>\nCONSTRAINTS: <scope limits, focus areas>",
|
||||
"status": "pending",
|
||||
"owner": "<role>",
|
||||
"blockedBy": ["<dependency-list>"]
|
||||
}
|
||||
```
|
||||
|
||||
After building all entries, write the full array to `<session>/tasks.json`.
|
||||
|
||||
### Mode Router
|
||||
|
||||
| Mode | Task Chain |
|
||||
|------|------------|
|
||||
| `page` | ANALYZE-001 -> ARCH-001 -> DEV-001 -> QA-001 |
|
||||
| `feature` | ANALYZE-001 -> ARCH-001 -> QA-001 -> DEV-001 -> QA-002 |
|
||||
| `system` | ANALYZE-001 -> ARCH-001 -> QA-001 -> [ARCH-002 || DEV-001] -> QA-002 -> DEV-002 -> QA-003 |
|
||||
|
||||
---
|
||||
|
||||
### Page Mode Task Chain (4 tasks)
|
||||
|
||||
**ANALYZE-001** (analyst):
|
||||
```json
|
||||
{
|
||||
"id": "ANALYZE-001",
|
||||
"subject": "ANALYZE-001",
|
||||
"description": "PURPOSE: Analyze frontend requirements and retrieve design intelligence | Success: design-intelligence.json produced with industry-specific recommendations\nTASK:\n - Detect tech stack and existing design system\n - Retrieve design intelligence via ui-ux-pro-max (or LLM fallback)\n - Analyze existing codebase patterns\n - Compile design-intelligence.json and requirements.md\nCONTEXT:\n - Session: <session-folder>\n - Industry: <industry>\n - Scope: <scope>\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/analysis/design-intelligence.json + requirements.md | Structured design data\nCONSTRAINTS: Read-only analysis | No code modifications",
|
||||
"status": "pending",
|
||||
"owner": "analyst",
|
||||
"blockedBy": []
|
||||
}
|
||||
```
|
||||
|
||||
**ARCH-001** (architect):
|
||||
```json
|
||||
{
|
||||
"id": "ARCH-001",
|
||||
"subject": "ARCH-001",
|
||||
"description": "PURPOSE: Define design token system and component architecture | Success: design-tokens.json + component specs produced\nTASK:\n - Load design intelligence from analyst output\n - Generate design token system (colors, typography, spacing, shadows)\n - Define component architecture and specs\n - Generate project structure\nCONTEXT:\n - Session: <session-folder>\n - Industry: <industry>\n - Scope: full\n - Upstream artifacts: design-intelligence.json, requirements.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/architecture/design-tokens.json + component-specs/ + project-structure.md\nCONSTRAINTS: Use ui-ux-pro-max recommendations for token values | Support light/dark mode",
|
||||
"status": "pending",
|
||||
"owner": "architect",
|
||||
"blockedBy": ["ANALYZE-001"]
|
||||
}
|
||||
```
|
||||
|
||||
**DEV-001** (developer):
|
||||
```json
|
||||
{
|
||||
"id": "DEV-001",
|
||||
"subject": "DEV-001",
|
||||
"description": "PURPOSE: Implement frontend page/components from architecture artifacts | Success: All planned files implemented with design token usage\nTASK:\n - Load design tokens, component specs, project structure\n - Generate CSS custom properties from design tokens\n - Implement components following specs and coding standards\n - Self-validate: no hardcoded colors, cursor-pointer, focus styles, responsive\nCONTEXT:\n - Session: <session-folder>\n - Industry: <industry>\n - Scope: full\n - Upstream artifacts: design-tokens.json, component-specs/, project-structure.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: src/styles/tokens.css + component files | Design-token compliant code\nCONSTRAINTS: Use CSS variables from tokens | Mobile-first responsive | WCAG AA",
|
||||
"status": "pending",
|
||||
"owner": "developer",
|
||||
"blockedBy": ["ARCH-001"]
|
||||
}
|
||||
```
|
||||
|
||||
**QA-001** (qa):
|
||||
```json
|
||||
{
|
||||
"id": "QA-001",
|
||||
"subject": "QA-001",
|
||||
"description": "PURPOSE: Execute 5-dimension quality audit on implementation | Success: Score >= 8 with 0 critical issues\nTASK:\n - Load design intelligence and tokens for compliance checks\n - Execute 5-dimension audit (code quality, accessibility, design compliance, UX, pre-delivery)\n - Calculate weighted score and determine verdict\n - Write audit report\nCONTEXT:\n - Session: <session-folder>\n - Industry: <industry>\n - Review type: code-review\n - Upstream artifacts: design-intelligence.json, design-tokens.json, src/**\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/qa/audit-001.md | Weighted score + verdict + categorized issues\nCONSTRAINTS: Read-only review | No code modifications",
|
||||
"status": "pending",
|
||||
"owner": "qa",
|
||||
"blockedBy": ["DEV-001"]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Feature Mode Task Chain (5 tasks)
|
||||
|
||||
Create ANALYZE-001 and ARCH-001 as page mode above, then:
|
||||
|
||||
**QA-001** (qa, architecture review):
|
||||
- blockedBy: ["ARCH-001"]
|
||||
- Review type: architecture-review
|
||||
- Reviews architecture artifacts before developer starts
|
||||
|
||||
**DEV-001** (developer):
|
||||
- blockedBy: ["QA-001"] (waits for arch review to pass)
|
||||
|
||||
**QA-002** (qa, code review):
|
||||
- blockedBy: ["DEV-001"]
|
||||
- Review type: code-review
|
||||
|
||||
---
|
||||
|
||||
### System Mode Task Chain (7 tasks)
|
||||
|
||||
Create ANALYZE-001, ARCH-001, QA-001 as feature mode above, then:
|
||||
|
||||
**ARCH-002** (architect, parallel with DEV-001):
|
||||
- blockedBy: ["QA-001"]
|
||||
- Scope: components (refined specs after QA feedback)
|
||||
|
||||
**DEV-001** (developer, parallel with ARCH-002):
|
||||
- blockedBy: ["QA-001"]
|
||||
- Scope: tokens (CSS generation)
|
||||
|
||||
**QA-002** (qa):
|
||||
- blockedBy: ["ARCH-002"]
|
||||
- Review type: component-review
|
||||
|
||||
**DEV-002** (developer):
|
||||
- blockedBy: ["QA-002"]
|
||||
- Scope: components
|
||||
|
||||
**QA-003** (qa, final review):
|
||||
- blockedBy: ["DEV-002"]
|
||||
- Review type: final
|
||||
|
||||
## Phase 4: Validation
|
||||
|
||||
| Check | Method | Expected |
|
||||
|-------|--------|----------|
|
||||
| Task count correct | Read tasks.json, count entries | page: 4, feature: 5, system: 7 |
|
||||
| Dependencies correct | Trace dependency graph | Acyclic, correct blockedBy |
|
||||
| Structured descriptions | Each has PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS | All present |
|
||||
| Owner assignments correct | Role matches task prefix | ANALYZE->analyst, ARCH->architect, DEV->developer, QA->qa |
|
||||
|
||||
If validation fails, fix the specific task entry in tasks.json and re-validate.
|
||||
@@ -0,0 +1,188 @@
|
||||
# Command: Monitor
|
||||
|
||||
Event-driven pipeline coordination. Beat model: coordinator wake -> process -> spawn -> STOP.
|
||||
|
||||
## Constants
|
||||
|
||||
- SPAWN_MODE: background
|
||||
- ONE_STEP_PER_INVOCATION: true
|
||||
- FAST_ADVANCE_AWARE: true
|
||||
- WORKER_AGENT: team-worker
|
||||
- MAX_GC_ROUNDS: 2
|
||||
|
||||
## Handler Router
|
||||
|
||||
| Source | Handler |
|
||||
|--------|---------|
|
||||
| Message contains [analyst], [architect], [developer], [qa] | handleCallback |
|
||||
| "check" or "status" | handleCheck |
|
||||
| "resume" or "continue" | handleResume |
|
||||
| All tasks completed | handleComplete |
|
||||
| Default | handleSpawnNext |
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session state | <session>/session.json | Yes |
|
||||
| Task list | Read `<session>/tasks.json` | Yes |
|
||||
| Trigger event | From Entry Router detection | Yes |
|
||||
| Pipeline definition | From SKILL.md | Yes |
|
||||
|
||||
1. Load session.json for current state, `pipeline_mode`, `gc_rounds`
|
||||
2. Read `<session>/tasks.json` to get current task statuses
|
||||
3. Identify trigger event type from Entry Router
|
||||
|
||||
## Phase 3: Event Handlers
|
||||
|
||||
### handleCallback
|
||||
|
||||
Triggered when a worker sends completion message.
|
||||
|
||||
1. Parse message to identify role and task ID:
|
||||
|
||||
| Message Pattern | Role Detection |
|
||||
|----------------|---------------|
|
||||
| `[analyst]` or task ID `ANALYZE-*` | analyst |
|
||||
| `[architect]` or task ID `ARCH-*` | architect |
|
||||
| `[developer]` or task ID `DEV-*` | developer |
|
||||
| `[qa]` or task ID `QA-*` | qa |
|
||||
|
||||
2. Mark task as completed:
|
||||
|
||||
Read `<session>/tasks.json`, find entry by id `<task-id>`, set `"status": "completed"`, write back.
|
||||
|
||||
3. Record completion in session state
|
||||
|
||||
4. Check if checkpoint applies:
|
||||
|
||||
| Completed Task | Pipeline Mode | Checkpoint Action |
|
||||
|---------------|---------------|-------------------|
|
||||
| ANALYZE-001 | all | Log: analysis ready |
|
||||
| ARCH-001 | feature/system | Log: architecture ready for review |
|
||||
| QA-001 (arch review) | feature/system | Gate: pause if critical issues, wait for architect revision |
|
||||
| QA-* (code review) | all | Check verdict for GC loop (see below) |
|
||||
|
||||
5. **GC Loop Check** (when QA completes with fix_required):
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| QA verdict = PASSED or PASSED_WITH_WARNINGS | Proceed to handleSpawnNext |
|
||||
| QA verdict = FIX_REQUIRED AND gc_round < 2 | Create DEV-fix + QA-recheck tasks, increment gc_round |
|
||||
| QA verdict = FIX_REQUIRED AND gc_round >= 2 | Escalate to user: accept current state or manual intervention |
|
||||
|
||||
**GC Fix Task Creation** -- add new entries to `<session>/tasks.json`:
|
||||
```json
|
||||
{
|
||||
"id": "DEV-fix-<round>",
|
||||
"subject": "DEV-fix-<round>",
|
||||
"description": "PURPOSE: Fix issues identified in QA audit | Success: All critical/high issues resolved\nTASK:\n - Load QA audit report with findings\n - Address critical and high severity issues\n - Re-validate fixes against coding standards\nCONTEXT:\n - Session: <session-folder>\n - Upstream artifacts: <session>/qa/audit-<NNN>.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: Fixed source files | QA issues resolved\nCONSTRAINTS: Targeted fixes only | Do not introduce regressions",
|
||||
"status": "pending",
|
||||
"owner": "developer",
|
||||
"blockedBy": []
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "QA-recheck-<round>",
|
||||
"subject": "QA-recheck-<round>",
|
||||
"description": "PURPOSE: Re-audit after developer fixes | Success: Score >= 8, critical == 0\nTASK:\n - Execute 5-dimension audit on fixed code\n - Focus on previously flagged issues\n - Calculate new score\nCONTEXT:\n - Session: <session-folder>\n - Review type: code-review\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/qa/audit-<NNN>.md | Improved score\nCONSTRAINTS: Read-only review",
|
||||
"status": "pending",
|
||||
"owner": "qa",
|
||||
"blockedBy": ["DEV-fix-<round>"]
|
||||
}
|
||||
```
|
||||
|
||||
6. Proceed to handleSpawnNext
|
||||
|
||||
### handleSpawnNext
|
||||
|
||||
Find and spawn the next ready tasks.
|
||||
|
||||
1. Scan tasks.json for tasks where:
|
||||
- Status is "pending"
|
||||
- All blockedBy tasks have status "completed"
|
||||
|
||||
2. For each ready task, spawn team-worker:
|
||||
|
||||
```
|
||||
spawn_agent({
|
||||
agent_type: "team_worker",
|
||||
items: [{
|
||||
description: "Spawn <role> worker for <task-id>",
|
||||
team_name: "frontend",
|
||||
name: "<role>",
|
||||
prompt: `## Role Assignment
|
||||
role: <role>
|
||||
role_spec: ~ or <project>/.codex/skills/team-frontend/roles/<role>/role.md
|
||||
session: <session-folder>
|
||||
session_id: <session-id>
|
||||
team_name: frontend
|
||||
requirement: <task-description>
|
||||
inner_loop: <true|false>
|
||||
|
||||
Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
3. **Parallel spawn rules**:
|
||||
|
||||
| Mode | Scenario | Spawn Behavior |
|
||||
|------|----------|---------------|
|
||||
| page | Each stage sequential | One worker at a time |
|
||||
| feature | After QA-001 arch review | Spawn DEV-001 |
|
||||
| system | After QA-001 arch review | Spawn ARCH-002 + DEV-001 in parallel |
|
||||
|
||||
4. STOP after spawning -- use `wait_agent({ ids: [<spawned-agent-ids>] })` to wait for next callback
|
||||
|
||||
### handleCheck
|
||||
|
||||
Output current pipeline status.
|
||||
|
||||
```
|
||||
Pipeline Status (<mode> mode):
|
||||
[DONE] ANALYZE-001 (analyst) -> design-intelligence.json
|
||||
[DONE] ARCH-001 (architect) -> design-tokens.json
|
||||
[RUN] DEV-001 (developer) -> implementing...
|
||||
[WAIT] QA-001 (qa) -> blocked by DEV-001
|
||||
|
||||
GC Rounds: 0/2
|
||||
Session: <session-id>
|
||||
```
|
||||
|
||||
Output status -- do NOT advance pipeline.
|
||||
|
||||
### handleResume
|
||||
|
||||
Resume pipeline after user pause or interruption.
|
||||
|
||||
1. Audit tasks.json for inconsistencies:
|
||||
- Tasks stuck in "in_progress" -> reset to "pending"
|
||||
- Tasks with completed blockers but still "pending" -> include in spawn list
|
||||
2. Proceed to handleSpawnNext
|
||||
|
||||
### handleComplete
|
||||
|
||||
Triggered when all pipeline tasks are completed.
|
||||
|
||||
**Completion check**:
|
||||
|
||||
| Mode | Completion Condition |
|
||||
|------|---------------------|
|
||||
| page | All 4 tasks (+ any GC fix/recheck tasks) completed |
|
||||
| feature | All 5 tasks (+ any GC fix/recheck tasks) completed |
|
||||
| system | All 7 tasks (+ any GC fix/recheck tasks) completed |
|
||||
|
||||
1. If any tasks not completed, return to handleSpawnNext
|
||||
2. If all completed, transition to coordinator Phase 5
|
||||
|
||||
## Phase 4: State Persistence
|
||||
|
||||
After every handler execution:
|
||||
|
||||
1. Update session.json with current state (active tasks, gc_rounds, last event)
|
||||
2. Verify tasks.json consistency
|
||||
3. STOP and wait for next event
|
||||
157
.codex/skills/team-frontend/roles/coordinator/role.md
Normal file
157
.codex/skills/team-frontend/roles/coordinator/role.md
Normal file
@@ -0,0 +1,157 @@
|
||||
# Coordinator Role
|
||||
|
||||
Orchestrate team-frontend: analyze -> dispatch -> spawn -> monitor -> report.
|
||||
|
||||
## Identity
|
||||
- Name: coordinator | Tag: [coordinator]
|
||||
- Responsibility: Analyze task -> Create team -> Dispatch tasks -> Monitor progress -> Report results
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
- Use `team-worker` agent type for all worker spawns (NOT `general-purpose`)
|
||||
- Follow Command Execution Protocol for dispatch and monitor commands
|
||||
- Respect pipeline stage dependencies (blockedBy)
|
||||
- Stop after spawning workers -- wait for callbacks
|
||||
- Handle GC loops (developer <-> qa) with max 2 iterations
|
||||
- Execute completion action in Phase 5
|
||||
|
||||
### MUST NOT
|
||||
- Implement domain logic (analyzing, designing, coding, reviewing) -- workers handle this
|
||||
- Spawn workers without creating tasks first
|
||||
- Skip architecture review gate when configured (feature/system modes)
|
||||
- Force-advance pipeline past failed QA review
|
||||
- Modify source code directly -- delegate to developer worker
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command:
|
||||
1. Read `commands/<command>.md`
|
||||
2. Follow the workflow defined in the command
|
||||
3. Commands are inline execution guides, NOT separate agents
|
||||
4. Execute synchronously, complete before proceeding
|
||||
|
||||
## Entry Router
|
||||
|
||||
| Detection | Condition | Handler |
|
||||
|-----------|-----------|---------|
|
||||
| Worker callback | Message contains [analyst], [architect], [developer], [qa] | -> handleCallback (monitor.md) |
|
||||
| Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
|
||||
| Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
|
||||
| Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
|
||||
| Interrupted session | Active/paused session in .workflow/.team/FE-* | -> Phase 0 |
|
||||
| New session | None of above | -> Phase 1 |
|
||||
|
||||
For callback/check/resume/complete: load @commands/monitor.md, execute handler, STOP.
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
|
||||
1. Scan `.workflow/.team/FE-*/.msg/meta.json` for active/paused sessions
|
||||
2. No sessions -> Phase 1
|
||||
3. Single session -> reconcile (audit tasks.json, reset in_progress->pending, rebuild team, kick first ready task)
|
||||
4. Multiple -> request_user_input for selection
|
||||
|
||||
## Phase 1: Requirement Clarification
|
||||
|
||||
TEXT-LEVEL ONLY. No source code reading.
|
||||
|
||||
1. Parse task description from $ARGUMENTS
|
||||
2. Delegate to @commands/analyze.md -> produces task-analysis.json
|
||||
3. Ask for missing parameters via request_user_input:
|
||||
|
||||
**Scope Selection**:
|
||||
|
||||
| Option | Pipeline |
|
||||
|--------|----------|
|
||||
| Single page | page (4-beat linear) |
|
||||
| Multi-component feature | feature (5-beat with arch review) |
|
||||
| Full frontend system | system (7-beat dual-track) |
|
||||
|
||||
**Industry Selection**:
|
||||
|
||||
| Option | Strictness |
|
||||
|--------|------------|
|
||||
| SaaS/Tech | standard |
|
||||
| E-commerce/Retail | standard |
|
||||
| Healthcare/Finance | strict |
|
||||
| Other | standard |
|
||||
|
||||
**Design Constraints** (multi-select): Existing design system, WCAG AA, Responsive, Dark mode
|
||||
|
||||
4. Record requirements: mode, scope, industry, constraints
|
||||
5. CRITICAL: Always proceed to Phase 2, never skip team workflow
|
||||
|
||||
## Phase 2: Session & Team Setup
|
||||
|
||||
1. Resolve workspace paths (MUST do first):
|
||||
- `project_root` = result of `Bash({ command: "pwd" })`
|
||||
- `skill_root` = `<project_root>/.claude/skills/team-frontend`
|
||||
3. Generate session ID: `FE-<slug>-<YYYY-MM-DD>`
|
||||
4. Create session folder structure (replaces TeamCreate):
|
||||
```
|
||||
mkdir -p .workflow/.team/<session-id>/{.msg,wisdom,analysis,architecture,qa,build}
|
||||
```
|
||||
5. Read specs/pipelines.md -> select pipeline based on scope
|
||||
6. Register roles in session state
|
||||
7. Initialize meta.json with pipeline metadata:
|
||||
```typescript
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", session_id: "<id>", from: "coordinator",
|
||||
type: "state_update", summary: "Session initialized",
|
||||
data: {
|
||||
pipeline_mode: "<page|feature|system>",
|
||||
pipeline_stages: ["analyst", "architect", "developer", "qa"],
|
||||
roles: ["coordinator", "analyst", "architect", "developer", "qa"],
|
||||
team_name: "frontend",
|
||||
industry: "<industry>",
|
||||
constraints: []
|
||||
}
|
||||
})
|
||||
```
|
||||
9. Write session.json
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
Delegate to @commands/dispatch.md:
|
||||
1. Read specs/pipelines.md for selected pipeline task registry
|
||||
2. Build tasks array as JSON entries in `<session>/tasks.json`; set deps via `blockedBy` field in each entry
|
||||
3. Update session.json
|
||||
|
||||
## Phase 4: Spawn-and-Stop
|
||||
|
||||
Delegate to @commands/monitor.md#handleSpawnNext:
|
||||
1. Find ready tasks (pending + blockedBy resolved)
|
||||
2. Spawn team-worker agents (see SKILL.md Spawn Template)
|
||||
3. Output status summary
|
||||
4. STOP
|
||||
|
||||
## Phase 5: Report + Completion Action
|
||||
|
||||
1. Load session state -> count completed tasks, calculate duration
|
||||
2. List deliverables:
|
||||
|
||||
| Deliverable | Path |
|
||||
|-------------|------|
|
||||
| Design Intelligence | <session>/analysis/design-intelligence.json |
|
||||
| Requirements | <session>/analysis/requirements.md |
|
||||
| Design Tokens | <session>/architecture/design-tokens.json |
|
||||
| Component Specs | <session>/architecture/component-specs/ |
|
||||
| Project Structure | <session>/architecture/project-structure.md |
|
||||
| QA Audits | <session>/qa/audit-*.md |
|
||||
|
||||
3. Output pipeline summary: task count, duration, QA scores
|
||||
4. Execute completion action per session.completion_action:
|
||||
- interactive -> request_user_input (Archive/Keep/Export)
|
||||
- auto_archive -> Archive & Clean (status=completed, remove/archive session folder)
|
||||
- auto_keep -> Keep Active (status=paused)
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Resolution |
|
||||
|-------|------------|
|
||||
| Task too vague | request_user_input for clarification |
|
||||
| Session corruption | Attempt recovery, fallback to manual |
|
||||
| Worker crash | Reset task to pending, respawn |
|
||||
| Dependency cycle | Detect in analysis, halt |
|
||||
| QA score < 6 over 2 GC rounds | Escalate to user |
|
||||
| ui-ux-pro-max unavailable | Degrade to LLM general design knowledge |
|
||||
93
.codex/skills/team-frontend/roles/developer/role.md
Normal file
93
.codex/skills/team-frontend/roles/developer/role.md
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
role: developer
|
||||
prefix: DEV
|
||||
inner_loop: true
|
||||
message_types:
|
||||
success: dev_complete
|
||||
error: error
|
||||
---
|
||||
|
||||
# Frontend Developer
|
||||
|
||||
Consume architecture artifacts (design tokens, component specs, project structure) to implement frontend code. Reference design-intelligence.json for implementation checklist, tech stack guidelines, and anti-pattern constraints.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Scope | Extracted from task description (tokens/components/full) | No (default: full) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | No |
|
||||
| Design tokens | <session>/architecture/design-tokens.json | Yes |
|
||||
| Component specs | <session>/architecture/component-specs/*.md | No |
|
||||
| Project structure | <session>/architecture/project-structure.md | No |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and scope from task description
|
||||
2. Load design tokens (required -- if missing, report to coordinator)
|
||||
3. Load design intelligence for anti-patterns and guidelines
|
||||
4. Load component specs and project structure
|
||||
5. Detect tech stack from design intelligence `detected_stack`
|
||||
6. Load .msg/meta.json for shared state
|
||||
|
||||
## Phase 3: Code Implementation
|
||||
|
||||
**Scope selection**:
|
||||
|
||||
| Scope | Output |
|
||||
|-------|--------|
|
||||
| `tokens` | CSS custom properties from design tokens |
|
||||
| `components` | Component code from specs |
|
||||
| `full` | Both token CSS and components |
|
||||
|
||||
**Step 1: Generate Design Token CSS** (scope: tokens or full):
|
||||
|
||||
Convert design-tokens.json to `src/styles/tokens.css`:
|
||||
|
||||
| JSON Category | CSS Variable Prefix |
|
||||
|---------------|---------------------|
|
||||
| color | `--color-` |
|
||||
| typography.font-family | `--font-` |
|
||||
| typography.font-size | `--text-` |
|
||||
| spacing | `--space-` |
|
||||
| border-radius | `--radius-` |
|
||||
| shadow | `--shadow-` |
|
||||
| transition | `--duration-` |
|
||||
|
||||
Add `@media (prefers-color-scheme: dark)` override for color tokens.
|
||||
|
||||
**Step 2: Implement Components** (scope: components or full):
|
||||
|
||||
Implementation strategy by complexity:
|
||||
|
||||
| Condition | Strategy |
|
||||
|-----------|----------|
|
||||
| <= 2 components | Direct inline Edit/Write |
|
||||
| 3-5 components | Single batch implementation |
|
||||
| > 5 components | Group by module, implement per batch |
|
||||
|
||||
**Coding standards** (mandatory):
|
||||
- Use design token CSS variables -- never hardcode colors/spacing
|
||||
- All interactive elements: `cursor: pointer`
|
||||
- Transitions: 150-300ms via `var(--duration-normal)`
|
||||
- Text contrast: minimum 4.5:1 ratio
|
||||
- Include `focus-visible` styles for keyboard navigation
|
||||
- Support `prefers-reduced-motion`
|
||||
- Responsive: mobile-first with md/lg breakpoints
|
||||
- No emoji as functional icons
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| Hardcoded colors | Scan for hex codes outside tokens.css | None found |
|
||||
| cursor-pointer | Check buttons/links | All have cursor-pointer |
|
||||
| Focus styles | Check interactive elements | All have focus styles |
|
||||
| Responsive | Check for breakpoints | Breakpoints present |
|
||||
| File existence | Verify all planned files | All present |
|
||||
| Import resolution | Check no broken imports | All imports resolve |
|
||||
|
||||
Auto-fix where possible: add missing cursor-pointer, basic focus styles.
|
||||
|
||||
Update .msg/meta.json: merge `component_inventory` key with implemented file list.
|
||||
79
.codex/skills/team-frontend/roles/qa/role.md
Normal file
79
.codex/skills/team-frontend/roles/qa/role.md
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
role: qa
|
||||
prefix: QA
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: qa_passed
|
||||
error: error
|
||||
---
|
||||
|
||||
# QA Engineer
|
||||
|
||||
Execute 5-dimension quality audit integrating ux-guidelines Do/Don't rules, pre-delivery checklist, and industry anti-pattern library. Perform CSS-level precise review on architecture artifacts and implementation code.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| Review type | Extracted from task description | No (default: code-review) |
|
||||
| Design intelligence | <session>/analysis/design-intelligence.json | No |
|
||||
| Design tokens | <session>/architecture/design-tokens.json | No |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and review type from task description
|
||||
2. Load design intelligence (for anti-patterns, must-have rules)
|
||||
3. Load design tokens (for compliance checks)
|
||||
4. Load .msg/meta.json (for industry context, strictness level)
|
||||
5. Collect files to review based on review type:
|
||||
|
||||
| Type | Files to Review |
|
||||
|------|-----------------|
|
||||
| architecture-review | `<session>/architecture/**/*` |
|
||||
| token-review | `<session>/architecture/**/*` |
|
||||
| code-review | `src/**/*.{tsx,jsx,vue,svelte,html,css}` |
|
||||
| final | `src/**/*.{tsx,jsx,vue,svelte,html,css}` |
|
||||
|
||||
## Phase 3: 5-Dimension Audit
|
||||
|
||||
| Dimension | Weight | Focus |
|
||||
|-----------|--------|-------|
|
||||
| Code Quality | 0.20 | Structure, naming, maintainability |
|
||||
| Accessibility | 0.25 | WCAG compliance, keyboard nav, screen reader |
|
||||
| Design Compliance | 0.20 | Anti-pattern check, design token usage |
|
||||
| UX Best Practices | 0.20 | Interaction patterns, responsive, animations |
|
||||
| Pre-Delivery | 0.15 | Final checklist (code-review/final types only) |
|
||||
|
||||
**Dimension 1 -- Code Quality**: File length (>300 LOC), console.log, empty catch, unused imports.
|
||||
|
||||
**Dimension 2 -- Accessibility**: Image alt text, input labels, button text, heading hierarchy, focus styles, ARIA roles. Strict mode (medical/financial): prefers-reduced-motion required.
|
||||
|
||||
**Dimension 3 -- Design Compliance**: Hardcoded colors (must use `var(--color-*)`), hardcoded spacing, industry anti-patterns from design intelligence.
|
||||
|
||||
**Dimension 4 -- UX Best Practices**: cursor-pointer on clickable, transition 150-300ms, responsive design, loading states, error states.
|
||||
|
||||
**Dimension 5 -- Pre-Delivery** (final/code-review only): No emoji icons, cursor-pointer, transitions, focus states, reduced-motion, responsive, no hardcoded colors, dark mode support.
|
||||
|
||||
**Score calculation**: `score = sum(dimension_score * weight)`
|
||||
|
||||
**Verdict**:
|
||||
|
||||
| Condition | Verdict | Message Type |
|
||||
|-----------|---------|-------------|
|
||||
| score >= 8 AND critical == 0 | PASSED | `qa_passed` |
|
||||
| score >= 6 AND critical == 0 | PASSED_WITH_WARNINGS | `qa_result` |
|
||||
| score < 6 OR critical > 0 | FIX_REQUIRED | `fix_required` |
|
||||
|
||||
## Phase 4: Self-Review
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| All dimensions scored | Check 5 dimension scores | All present |
|
||||
| Audit report written | File check | audit-NNN.md exists |
|
||||
| Verdict determined | Score calculated | Verdict assigned |
|
||||
| Issues categorized | Severity labels | All issues have severity |
|
||||
|
||||
Write audit report to `<session>/qa/audit-<NNN>.md` with: summary, dimension scores, issues by severity, passed dimensions.
|
||||
|
||||
Update .msg/meta.json: append to `qa_history` array.
|
||||
@@ -1,188 +0,0 @@
|
||||
# Team Frontend -- CSV Schema
|
||||
|
||||
## Master CSV: tasks.csv
|
||||
|
||||
### Column Definitions
|
||||
|
||||
#### Input Columns (Set by Decomposer)
|
||||
|
||||
| Column | Type | Required | Description | Example |
|
||||
|--------|------|----------|-------------|---------|
|
||||
| `id` | string | Yes | Unique task identifier (PREFIX-NNN) | `"ANALYZE-001"` |
|
||||
| `title` | string | Yes | Short task title | `"Requirement analysis + design intelligence"` |
|
||||
| `description` | string | Yes | Detailed task description (self-contained) with PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS | `"PURPOSE: Analyze frontend requirements..."` |
|
||||
| `role` | enum | Yes | Worker role: `analyst`, `architect`, `developer`, `qa` | `"analyst"` |
|
||||
| `pipeline_mode` | enum | Yes | Pipeline mode: `page`, `feature`, `system` | `"feature"` |
|
||||
| `scope` | enum | Yes | Task scope: `full`, `tokens`, `components` | `"full"` |
|
||||
| `review_type` | string | No | QA review type: `architecture-review`, `code-review`, `final` (empty for non-QA tasks) | `"code-review"` |
|
||||
| `deps` | string | No | Semicolon-separated dependency task IDs | `"ANALYZE-001"` |
|
||||
| `context_from` | string | No | Semicolon-separated task IDs for context | `"ANALYZE-001"` |
|
||||
| `exec_mode` | enum | Yes | Execution mechanism: `csv-wave` or `interactive` | `"csv-wave"` |
|
||||
|
||||
#### Computed Columns (Set by Wave Engine)
|
||||
|
||||
| Column | Type | Description | Example |
|
||||
|--------|------|-------------|---------|
|
||||
| `wave` | integer | Wave number (1-based, from topological sort) | `2` |
|
||||
| `prev_context` | string | Aggregated findings from context_from tasks (per-wave CSV only) | `"[ANALYZE-001] Detected React + shadcn stack..."` |
|
||||
|
||||
#### Output Columns (Set by Agent)
|
||||
|
||||
| Column | Type | Description | Example |
|
||||
|--------|------|-------------|---------|
|
||||
| `status` | enum | `pending` -> `completed` / `failed` / `skipped` | `"completed"` |
|
||||
| `findings` | string | Key discoveries (max 500 chars) | `"Generated 24 color tokens with dark mode..."` |
|
||||
| `artifacts_produced` | string | Semicolon-separated paths of produced artifacts | `"artifacts/analysis/design-intelligence.json;artifacts/analysis/requirements.md"` |
|
||||
| `qa_score` | string | QA weighted score 0-10 (empty for non-QA tasks) | `"8.5"` |
|
||||
| `qa_verdict` | enum | `PASSED`, `PASSED_WITH_WARNINGS`, `FIX_REQUIRED` (empty for non-QA) | `"PASSED"` |
|
||||
| `error` | string | Error message if failed | `""` |
|
||||
|
||||
---
|
||||
|
||||
### exec_mode Values
|
||||
|
||||
| Value | Mechanism | Description |
|
||||
|-------|-----------|-------------|
|
||||
| `csv-wave` | `spawn_agents_on_csv` | One-shot batch execution within wave |
|
||||
| `interactive` | `spawn_agent`/`wait`/`send_input`/`close_agent` | Multi-round individual execution |
|
||||
|
||||
Interactive tasks appear in master CSV for dependency tracking but are NOT included in wave-{N}.csv files.
|
||||
|
||||
---
|
||||
|
||||
### Role Prefixes
|
||||
|
||||
| Role | Prefix | Responsibility Type |
|
||||
|------|--------|---------------------|
|
||||
| analyst | ANALYZE | read-only (analysis + design intelligence retrieval) |
|
||||
| architect | ARCH | orchestration (design token + component spec generation) |
|
||||
| developer | DEV | code-gen (implementation from specs) |
|
||||
| qa | QA | validation (5-dimension quality audit) |
|
||||
|
||||
---
|
||||
|
||||
### Example Data
|
||||
|
||||
```csv
|
||||
id,title,description,role,pipeline_mode,scope,review_type,deps,context_from,exec_mode,wave,status,findings,artifacts_produced,qa_score,qa_verdict,error
|
||||
"ANALYZE-001","Requirement analysis","PURPOSE: Analyze frontend requirements and retrieve design intelligence via ui-ux-pro-max | Success: design-intelligence.json produced with industry-specific recommendations\nTASK:\n- Detect tech stack and existing design system\n- Retrieve design intelligence\n- Compile design-intelligence.json and requirements.md\nCONTEXT:\n- Session: .workflow/.csv-wave/fe-saas-dashboard-20260308\n- Industry: saas\nEXPECTED: artifacts/analysis/design-intelligence.json + requirements.md","analyst","feature","full","","","","csv-wave","1","pending","","","","",""
|
||||
"ARCH-001","Design token system + architecture","PURPOSE: Define design token system and component architecture | Success: design-tokens.json + component specs\nTASK:\n- Load design intelligence from analyst\n- Generate design tokens (colors, typography, spacing, shadows)\n- Define component specs\n- Generate project structure\nCONTEXT:\n- Session: .workflow/.csv-wave/fe-saas-dashboard-20260308\n- Upstream: design-intelligence.json\nEXPECTED: artifacts/architecture/design-tokens.json + component-specs/ + project-structure.md","architect","feature","full","","ANALYZE-001","ANALYZE-001","csv-wave","2","pending","","","","",""
|
||||
"QA-001","Architecture review","PURPOSE: Review architecture before development | Success: Architecture approved with score >= 8\nTASK:\n- Load design intelligence and tokens\n- Execute 5-dimension audit on architecture\n- Calculate score and verdict\nCONTEXT:\n- Session: .workflow/.csv-wave/fe-saas-dashboard-20260308\n- Review type: architecture-review\nEXPECTED: artifacts/qa/audit-001.md","qa","feature","full","architecture-review","ARCH-001","ARCH-001","csv-wave","3","pending","","","","",""
|
||||
"DEV-001","Frontend implementation","PURPOSE: Implement frontend from architecture artifacts | Success: All planned files implemented\nTASK:\n- Generate CSS custom properties from design tokens\n- Implement components following specs\n- Self-validate: no hardcoded colors, cursor-pointer, focus styles\nCONTEXT:\n- Session: .workflow/.csv-wave/fe-saas-dashboard-20260308\n- Upstream: design-tokens.json, component-specs/\nEXPECTED: src/styles/tokens.css + component files","developer","feature","full","","QA-001","QA-001;ARCH-001","csv-wave","4","pending","","","","",""
|
||||
"QA-002","Code review","PURPOSE: Execute 5-dimension quality audit | Success: Score >= 8 with 0 critical issues\nTASK:\n- Execute full audit (code quality, accessibility, design compliance, UX, pre-delivery)\n- Calculate weighted score\nCONTEXT:\n- Session: .workflow/.csv-wave/fe-saas-dashboard-20260308\n- Review type: code-review\nEXPECTED: artifacts/qa/audit-002.md","qa","feature","full","code-review","DEV-001","DEV-001","csv-wave","5","pending","","","","",""
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Column Lifecycle
|
||||
|
||||
```
|
||||
Decomposer (Phase 1) Wave Engine (Phase 2) Agent (Execution)
|
||||
--------------------- -------------------- -----------------
|
||||
id ----------> id ----------> id
|
||||
title ----------> title ----------> (reads)
|
||||
description ----------> description ----------> (reads)
|
||||
role ----------> role ----------> (reads)
|
||||
pipeline_mode ---------> pipeline_mode ---------> (reads)
|
||||
scope ----------> scope ----------> (reads)
|
||||
review_type ----------> review_type ----------> (reads)
|
||||
deps ----------> deps ----------> (reads)
|
||||
context_from----------> context_from----------> (reads)
|
||||
exec_mode ----------> exec_mode ----------> (reads)
|
||||
wave ----------> (reads)
|
||||
prev_context ----------> (reads)
|
||||
status
|
||||
findings
|
||||
artifacts_produced
|
||||
qa_score
|
||||
qa_verdict
|
||||
error
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Output Schema (JSON)
|
||||
|
||||
Agent output via `report_agent_job_result` (csv-wave tasks):
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "ARCH-001",
|
||||
"status": "completed",
|
||||
"findings": "Generated design token system with 24 color tokens (light+dark), 7 typography scales, 6 spacing values. Created 3 component specs: Button, Card, Header. Project structure follows Next.js app router convention.",
|
||||
"artifacts_produced": "artifacts/architecture/design-tokens.json;artifacts/architecture/component-specs/button.md;artifacts/architecture/project-structure.md",
|
||||
"qa_score": "",
|
||||
"qa_verdict": "",
|
||||
"error": ""
|
||||
}
|
||||
```
|
||||
|
||||
QA agent output example:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "QA-001",
|
||||
"status": "completed",
|
||||
"findings": "Architecture review: 8.2/10. Color tokens complete, typography scale follows best practices. Minor: missing border-radius for 'pill' variant.",
|
||||
"artifacts_produced": "artifacts/qa/audit-001.md",
|
||||
"qa_score": "8.2",
|
||||
"qa_verdict": "PASSED",
|
||||
"error": ""
|
||||
}
|
||||
```
|
||||
|
||||
Interactive tasks output via structured text or JSON written to `interactive/{id}-result.json`.
|
||||
|
||||
---
|
||||
|
||||
## Discovery Types
|
||||
|
||||
| Type | Dedup Key | Data Schema | Description |
|
||||
|------|-----------|-------------|-------------|
|
||||
| `tech_stack_detected` | `data.stack` | `{stack, framework, ui_lib}` | Tech stack identified |
|
||||
| `design_pattern_found` | `data.pattern_name+data.location` | `{pattern_name, location, description}` | Existing design pattern |
|
||||
| `token_generated` | `data.category` | `{category, count, supports_dark_mode}` | Design token category created |
|
||||
| `file_modified` | `data.file` | `{file, change, lines_added}` | File change recorded |
|
||||
| `issue_found` | `data.file+data.line` | `{file, line, severity, description}` | QA issue discovered |
|
||||
| `anti_pattern_violation` | `data.pattern+data.file` | `{pattern, file, line, description}` | Industry anti-pattern detected |
|
||||
| `artifact_produced` | `data.path` | `{name, path, producer, type}` | Deliverable created |
|
||||
|
||||
### Discovery NDJSON Format
|
||||
|
||||
```jsonl
|
||||
{"ts":"2026-03-08T10:00:00Z","worker":"ANALYZE-001","type":"tech_stack_detected","data":{"stack":"react","framework":"nextjs","ui_lib":"shadcn"}}
|
||||
{"ts":"2026-03-08T10:05:00Z","worker":"ARCH-001","type":"token_generated","data":{"category":"color","count":24,"supports_dark_mode":true}}
|
||||
{"ts":"2026-03-08T10:10:00Z","worker":"DEV-001","type":"file_modified","data":{"file":"src/styles/tokens.css","change":"Generated CSS custom properties from design tokens","lines_added":85}}
|
||||
{"ts":"2026-03-08T10:15:00Z","worker":"QA-001","type":"issue_found","data":{"file":"src/components/Button.tsx","line":42,"severity":"high","description":"Missing cursor-pointer on interactive button element"}}
|
||||
```
|
||||
|
||||
> Both csv-wave and interactive agents read/write the same discoveries.ndjson file.
|
||||
|
||||
---
|
||||
|
||||
## Cross-Mechanism Context Flow
|
||||
|
||||
| Source | Target | Mechanism |
|
||||
|--------|--------|-----------|
|
||||
| CSV task findings | Interactive task | Injected via spawn message or send_input |
|
||||
| Interactive task result | CSV task prev_context | Read from interactive/{id}-result.json |
|
||||
| Any agent discovery | Any agent | Shared via discoveries.ndjson |
|
||||
|
||||
---
|
||||
|
||||
## Validation Rules
|
||||
|
||||
| Rule | Check | Error |
|
||||
|------|-------|-------|
|
||||
| Unique IDs | No duplicate `id` values | "Duplicate task ID: {id}" |
|
||||
| Valid deps | All dep IDs exist in tasks | "Unknown dependency: {dep_id}" |
|
||||
| No self-deps | Task cannot depend on itself | "Self-dependency: {id}" |
|
||||
| No circular deps | Topological sort completes | "Circular dependency detected involving: {ids}" |
|
||||
| context_from valid | All context IDs exist and in earlier waves | "Invalid context_from: {id}" |
|
||||
| exec_mode valid | Value is `csv-wave` or `interactive` | "Invalid exec_mode: {value}" |
|
||||
| Description non-empty | Every task has description | "Empty description for task: {id}" |
|
||||
| Status enum | status in {pending, completed, failed, skipped} | "Invalid status: {status}" |
|
||||
| Role valid | role in {analyst, architect, developer, qa} | "Invalid role: {role}" |
|
||||
| Pipeline mode valid | pipeline_mode in {page, feature, system} | "Invalid pipeline_mode: {mode}" |
|
||||
| QA verdict valid | qa_verdict in {PASSED, PASSED_WITH_WARNINGS, FIX_REQUIRED, ""} | "Invalid qa_verdict: {verdict}" |
|
||||
| Cross-mechanism deps | Interactive to CSV deps resolve correctly | "Cross-mechanism dependency unresolvable: {id}" |
|
||||
76
.codex/skills/team-frontend/specs/pipelines.md
Normal file
76
.codex/skills/team-frontend/specs/pipelines.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Frontend Pipeline Definitions
|
||||
|
||||
## Pipeline Modes
|
||||
|
||||
### Page Mode (4 beats, linear)
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> DEV-001 --> QA-001
|
||||
[analyst] [architect] [developer] [qa]
|
||||
```
|
||||
|
||||
### Feature Mode (5 beats, with architecture review gate)
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> DEV-001 --> QA-002
|
||||
[analyst] [architect] [qa:arch] [developer] [qa:code]
|
||||
```
|
||||
|
||||
### System Mode (7 beats, dual-track parallel)
|
||||
|
||||
```
|
||||
ANALYZE-001 --> ARCH-001 --> QA-001 --> ARCH-002 ─┐
|
||||
[analyst] [architect] [qa:arch] [architect] |
|
||||
DEV-001 ──┘ --> QA-002 --> DEV-002 --> QA-003
|
||||
[developer:tokens] [qa] [developer] [qa:final]
|
||||
```
|
||||
|
||||
### Generator-Critic Loop (developer <-> qa)
|
||||
|
||||
```
|
||||
developer (Generator) -> QA artifact -> qa (Critic)
|
||||
<- QA feedback <-
|
||||
(max 2 rounds)
|
||||
|
||||
Convergence: qa.score >= 8 && qa.critical_count === 0
|
||||
```
|
||||
|
||||
## Task Metadata Registry
|
||||
|
||||
| Task ID | Role | Pipeline | Dependencies | Description |
|
||||
|---------|------|----------|-------------|-------------|
|
||||
| ANALYZE-001 | analyst | all | (none) | Requirement analysis + design intelligence |
|
||||
| ARCH-001 | architect | all | ANALYZE-001 | Design token system + component architecture |
|
||||
| ARCH-002 | architect | system | QA-001 | Component specs refinement |
|
||||
| DEV-001 | developer | all | ARCH-001 or QA-001 | Frontend implementation |
|
||||
| DEV-002 | developer | system | QA-002 | Component implementation |
|
||||
| DEV-fix-N | developer | all | QA-N (GC loop trigger) | Fix issues from QA |
|
||||
| QA-001 | qa | all | ARCH-001 or DEV-001 | Architecture or code review |
|
||||
| QA-002 | qa | feature/system | DEV-001 | Code review |
|
||||
| QA-003 | qa | system | DEV-002 | Final quality check |
|
||||
| QA-recheck-N | qa | all | DEV-fix-N | Re-audit after developer fixes |
|
||||
|
||||
## Pipeline Selection Logic
|
||||
|
||||
| Score | Pipeline |
|
||||
|-------|----------|
|
||||
| 1-2 | page |
|
||||
| 3-4 | feature |
|
||||
| 5+ | system |
|
||||
|
||||
Default: feature.
|
||||
|
||||
## ui-ux-pro-max Integration
|
||||
|
||||
Analyst role invokes ui-ux-pro-max via Skill to obtain industry design intelligence:
|
||||
|
||||
| Action | Invocation |
|
||||
|--------|------------|
|
||||
| Full design system | `Skill(skill="ui-ux-pro-max", args="<industry> <keywords> --design-system")` |
|
||||
| Domain search | `Skill(skill="ui-ux-pro-max", args="<query> --domain <domain>")` |
|
||||
| Tech stack guidance | `Skill(skill="ui-ux-pro-max", args="<query> --stack <stack>")` |
|
||||
|
||||
**Supported Domains**: product, style, typography, color, landing, chart, ux, web
|
||||
**Supported Stacks**: html-tailwind, react, nextjs, vue, svelte, shadcn, swiftui, react-native, flutter
|
||||
|
||||
**Fallback**: If ui-ux-pro-max skill not installed, degrade to LLM general design knowledge.
|
||||
84
.codex/skills/team-frontend/specs/team-config.json
Normal file
84
.codex/skills/team-frontend/specs/team-config.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"team_name": "frontend",
|
||||
"skill_name": "team-frontend",
|
||||
"team_display_name": "Frontend Development",
|
||||
"description": "全栈前端开发团队,内置 ui-ux-pro-max 设计智能。具备需求分析、设计系统生成、前端实现、质量保证的完整能力。",
|
||||
"pipeline_type": "adaptive",
|
||||
"roles": [
|
||||
{
|
||||
"name": "coordinator",
|
||||
"task_prefix": null,
|
||||
"responsibility_type": "Orchestration",
|
||||
"description": "需求澄清、行业识别、流水线编排、进度监控、GC循环控制",
|
||||
"message_types": ["task_unblocked", "sync_checkpoint", "fix_required", "error", "shutdown"]
|
||||
},
|
||||
{
|
||||
"name": "analyst",
|
||||
"task_prefix": "ANALYZE",
|
||||
"responsibility_type": "Read-only analysis",
|
||||
"description": "需求分析、调用 ui-ux-pro-max 获取设计智能、行业推理规则匹配",
|
||||
"message_types": ["analyze_ready", "analyze_progress", "error"]
|
||||
},
|
||||
{
|
||||
"name": "architect",
|
||||
"task_prefix": "ARCH",
|
||||
"responsibility_type": "Code generation",
|
||||
"description": "消费设计智能、定义设计令牌系统、组件架构、技术选型",
|
||||
"message_types": ["arch_ready", "arch_revision", "arch_progress", "error"]
|
||||
},
|
||||
{
|
||||
"name": "developer",
|
||||
"task_prefix": "DEV",
|
||||
"responsibility_type": "Code generation",
|
||||
"description": "消费架构产出、实现前端组件/页面代码",
|
||||
"message_types": ["dev_complete", "dev_progress", "error"]
|
||||
},
|
||||
{
|
||||
"name": "qa",
|
||||
"task_prefix": "QA",
|
||||
"responsibility_type": "Read-only analysis",
|
||||
"description": "5维度代码审查:代码质量、可访问性、设计合规、UX最佳实践、Pre-Delivery验证",
|
||||
"message_types": ["qa_passed", "qa_result", "fix_required", "error"]
|
||||
}
|
||||
],
|
||||
"pipelines": {
|
||||
"page": {
|
||||
"description": "单页面开发:分析→架构→开发→质检",
|
||||
"task_chain": ["ANALYZE-001", "ARCH-001", "DEV-001", "QA-001"],
|
||||
"collaboration_patterns": ["CP-1", "CP-2"],
|
||||
"complexity": "low"
|
||||
},
|
||||
"feature": {
|
||||
"description": "多组件特性:分析→架构→质检→开发→质检",
|
||||
"task_chain": ["ANALYZE-001", "ARCH-001", "QA-001", "DEV-001", "QA-002"],
|
||||
"collaboration_patterns": ["CP-1", "CP-2", "CP-8"],
|
||||
"complexity": "medium"
|
||||
},
|
||||
"system": {
|
||||
"description": "完整前端系统:分析→架构→[开发令牌 ∥ 架构组件]→质检→开发组件→最终质检",
|
||||
"task_chain": ["ANALYZE-001", "ARCH-001", "QA-001", "ARCH-002||DEV-001", "QA-002", "DEV-002", "QA-003"],
|
||||
"sync_points": ["QA-001", "QA-002"],
|
||||
"collaboration_patterns": ["CP-1", "CP-2", "CP-8", "CP-9"],
|
||||
"complexity": "high"
|
||||
}
|
||||
},
|
||||
"uipro_config": {
|
||||
"search_paths": [
|
||||
"G:/github_lib/ui-ux-pro-max-skill/src/ui-ux-pro-max",
|
||||
"../ui-ux-pro-max-skill/src/ui-ux-pro-max",
|
||||
"./ui-ux-pro-max"
|
||||
],
|
||||
"fallback": "LLM general design knowledge",
|
||||
"data_domains": ["product", "style", "typography", "color", "landing", "chart", "ux", "web"],
|
||||
"supported_stacks": ["html-tailwind", "react", "nextjs", "vue", "svelte", "shadcn"]
|
||||
},
|
||||
"shared_memory_schema": {
|
||||
"design_intelligence": {},
|
||||
"design_token_registry": {},
|
||||
"component_inventory": [],
|
||||
"style_decisions": [],
|
||||
"qa_history": [],
|
||||
"industry_context": {}
|
||||
},
|
||||
"generated_at": "2026-02-17T00:00:00+08:00"
|
||||
}
|
||||
Reference in New Issue
Block a user