Add context builder, agent runner, and pipeline executor
core/context_builder.py: build_context() — assembles role-specific context from DB. PM gets everything; debugger gets gotchas/workarounds; reviewer gets conventions only; tester gets minimal context; security gets security-category decisions. format_prompt() — injects context into role templates. agents/runner.py: run_agent() — launches claude CLI as subprocess with role prompt. run_pipeline() — executes multi-step pipelines sequentially, chains output between steps, logs to agent_logs, creates/updates pipeline records, handles failures gracefully. agents/specialists.yaml — 8 roles with tools, permissions, context rules. agents/prompts/pm.md — PM prompt for task decomposition. agents/prompts/security.md — security audit prompt (OWASP, auth, secrets). CLI: kin run <task_id> [--dry-run] PM decomposes → shows pipeline → executes with confirmation. 31 new tests (15 context_builder, 11 runner, 5 JSON parsing). 92 total, all passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
86e5b8febf
commit
fabae74c19
8 changed files with 1207 additions and 0 deletions
104
agents/specialists.yaml
Normal file
104
agents/specialists.yaml
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
# Kin specialist pool — roles available for pipeline construction.
|
||||
# PM selects from this pool based on task type.
|
||||
|
||||
specialists:
|
||||
pm:
|
||||
name: "Project Manager"
|
||||
model: sonnet
|
||||
tools: [Read, Grep, Glob]
|
||||
description: "Decomposes tasks, selects specialists, builds pipelines"
|
||||
permissions: read_only
|
||||
context_rules:
|
||||
decisions: all
|
||||
modules: all
|
||||
|
||||
architect:
|
||||
name: "Software Architect"
|
||||
model: sonnet
|
||||
tools: [Read, Grep, Glob]
|
||||
description: "Designs solutions, reviews structure, writes specs"
|
||||
permissions: read_only
|
||||
context_rules:
|
||||
decisions: all
|
||||
modules: all
|
||||
|
||||
debugger:
|
||||
name: "Debugger"
|
||||
model: sonnet
|
||||
tools: [Read, Grep, Glob, Bash]
|
||||
description: "Finds root causes, reads logs, traces execution"
|
||||
permissions: read_bash
|
||||
working_dir: project
|
||||
context_rules:
|
||||
decisions: [gotcha, workaround]
|
||||
|
||||
frontend_dev:
|
||||
name: "Frontend Developer"
|
||||
model: sonnet
|
||||
tools: [Read, Write, Edit, Bash, Glob, Grep]
|
||||
description: "Implements UI: Vue, CSS, components, composables"
|
||||
permissions: full
|
||||
working_dir: project
|
||||
context_rules:
|
||||
decisions: [gotcha, workaround, convention]
|
||||
|
||||
backend_dev:
|
||||
name: "Backend Developer"
|
||||
model: sonnet
|
||||
tools: [Read, Write, Edit, Bash, Glob, Grep]
|
||||
description: "Implements API, services, database, business logic"
|
||||
permissions: full
|
||||
working_dir: project
|
||||
context_rules:
|
||||
decisions: [gotcha, workaround, convention]
|
||||
|
||||
tester:
|
||||
name: "Tester"
|
||||
model: sonnet
|
||||
tools: [Read, Write, Bash, Glob, Grep]
|
||||
description: "Writes and runs tests, verifies fixes"
|
||||
permissions: full
|
||||
working_dir: project
|
||||
context_rules:
|
||||
decisions: []
|
||||
|
||||
reviewer:
|
||||
name: "Code Reviewer"
|
||||
model: sonnet
|
||||
tools: [Read, Grep, Glob]
|
||||
description: "Reviews code for quality, conventions, bugs"
|
||||
permissions: read_only
|
||||
context_rules:
|
||||
decisions: [convention]
|
||||
|
||||
security:
|
||||
name: "Security Engineer"
|
||||
model: sonnet
|
||||
tools: [Read, Grep, Glob, Bash]
|
||||
description: "OWASP audit, auth checks, secrets scan, vulnerability analysis"
|
||||
permissions: read_bash
|
||||
working_dir: project
|
||||
context_rules:
|
||||
decisions_category: security
|
||||
|
||||
# Route templates — PM uses these to build pipelines
|
||||
routes:
|
||||
debug:
|
||||
steps: [debugger, tester, frontend_dev, tester]
|
||||
description: "Find bug → verify → fix → verify fix"
|
||||
|
||||
feature:
|
||||
steps: [architect, frontend_dev, tester, reviewer]
|
||||
description: "Design → implement → test → review"
|
||||
|
||||
refactor:
|
||||
steps: [architect, frontend_dev, tester, reviewer]
|
||||
description: "Plan refactor → implement → test → review"
|
||||
|
||||
hotfix:
|
||||
steps: [debugger, frontend_dev, tester]
|
||||
description: "Find → fix → verify (fast track)"
|
||||
|
||||
security_audit:
|
||||
steps: [security, architect]
|
||||
description: "Audit → remediation plan"
|
||||
Loading…
Add table
Add a link
Reference in a new issue