| name | continuous-improvement |
| description | Orchestrate a continuous improvement cycle: spawn rust-live-tester for live testing, rust-researcher for dependency monitoring and research, rust-arch-analyst for code quality and architecture review, and rust-security-analyst for vulnerability scanning. Aggregates findings and produces a cycle summary. |
| argument-hint | [testing|research|dependencies|parity|arch|security|full] |
Continuous Improvement Orchestrator
Run a continuous improvement cycle for the current Rust project by coordinating four specialized agents:
rust-live-tester — syncs with remote, executes the project binary live, detects anomalies and regressions, tracks coverage, files bug issues
rust-researcher — monitors dependency health, researches new techniques, tracks competitive parity, files research and dependency issues
rust-arch-analyst — audits existing codebase for type system anti-patterns, DRY violations, architectural debt, API naming issues, and async concurrency problems; files improvement issues (read-only, sonnet + high effort)
rust-security-analyst — scans existing codebase for vulnerabilities: dependency advisories, unsafe code, exposed secrets, injection and input-validation gaps, crypto misuse, broken auth, panic-based DoS, and supply-chain risk; files security issues (read-only, sonnet + high effort)
Focus: $ARGUMENTS
| Focus value | Agents spawned |
|---|
testing | rust-live-tester only |
dependencies | rust-researcher only (deps phase) |
research | rust-researcher only (research phase) |
parity | rust-researcher only (parity phase) |
arch | rust-arch-analyst only (type-system, modularity, testability, readability, dry, async) |
security | rust-security-analyst only (dependencies, unsafe, secrets, input, crypto, auth, panics, supply-chain) |
full | rust-live-tester + rust-researcher + rust-arch-analyst + rust-security-analyst in parallel |
Hard Rules
- NEVER modify source code in this orchestrator session — delegate all execution to agents
- NEVER run live tests, research, or security scans directly — spawn the appropriate agent
- All spawned agents are read-only with respect to source code; they only write to
.local/
Project-Specific Rules
Check if the project has a .claude/rules/continuous-improvement.md file. If it exists, pass its contents to each spawned agent so they can apply project-specific overrides.
Step 0: Load Tools and Create Cycle Journal
ToolSearch("select:TaskCreate,TaskUpdate,TaskList,TaskGet,SendMessage")
The team forms implicitly when you spawn the first teammate (requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) — there is no team-creation call.
Determine the next cycle number:
ls .local/testing/journal/ 2>/dev/null | grep -E '^ci-[0-9]{3}\.md$' | sort | tail -1
If the directory is empty or missing: use 001; otherwise increment by one. Create .local/testing/journal/ if it does not exist.
Create .local/testing/journal/ci-NNN.md:
---
cycle: NNN
date: YYYY-MM-DD
focus: <focus>
team: <team-name>
---
## Continuous Improvement Cycle NNN — YYYY-MM-DD
### Playbooks
- [Testing playbooks](.local/testing/playbooks/)
- [Competitive parity](.local/testing/playbooks/competitive-parity.md)
- [Regression scenarios](.local/testing/regressions.md)
### Findings
| # | Type | Title | Priority | Issue | Spec |
|---|------|-------|----------|-------|------|
### Live Testing
_(populated by rust-live-tester)_
### Research & Monitoring
_(populated by rust-researcher)_
### Architecture & Code Quality
_(populated by rust-arch-analyst)_
### Security Audit
_(populated by rust-security-analyst)_
### Next Cycle Priorities
_(populated after cycle completes)_
Save {journal-path} = .local/testing/journal/ci-NNN.md for use in agent prompts and Step 3.
Create tasks upfront based on focus:
| Task | Owner | Condition |
|---|
live-testing | rust-live-tester | focus is testing or full |
research | rust-researcher | focus is research, dependencies, parity, or full |
architecture | rust-arch-analyst | focus is arch or full |
security | rust-security-analyst | focus is security or full |
Agent Communication Template
Include this block verbatim in every agent spawn prompt (substitute {agent-role} and {journal-path}):
You are operating as a teammate in this session's CI cycle team.
## Team Context
- Your role: {agent-role}
- Cycle journal: {journal-path}
## Task Management
0. FIRST: call ToolSearch("select:TaskCreate,TaskUpdate,TaskList,TaskGet") to load task tool schemas
1. Check TaskList for your assigned task
2. TaskUpdate(status: "in_progress") when starting
3. TaskUpdate(status: "completed") when done
## Journal
Append each finding as a new row in the Findings table of `{journal-path}`:
`| N | <type> | <title> | <P0-P4> | #<issue> | <spec-path or —> |`
## Communication
- Send results to the lead: SendMessage(to: "main", message: "...", summary: "...")
- Respond to a shutdown_request with: SendMessage(to: "main", message: {type: "shutdown_response", request_id: "<echo the request_id>", approve: true})
- Include file paths and issue URLs in your final message
## Handoff Protocol (MANDATORY)
BEFORE any other work: call Skill(skill: "rust-agents:rust-agent-handoff") and follow the protocol.
Before finishing: write handoff file and include inline frontmatter block + path in your message to the lead.
Step 1: Spawn agents
Spawn all applicable agents in a single message so they run in parallel.
| Agent | Spawn when |
|---|
| rust-live-tester | focus is testing or full |
| rust-researcher | focus is research, dependencies, parity, or full |
| rust-arch-analyst | focus is arch or full |
| rust-security-analyst | focus is security or full |
rust-live-tester:
TaskCreate(id: "live-testing", description: "Live testing cycle")
Agent({
subagent_type: "rust-agents:rust-live-tester",
description: "Live testing cycle",
name: "live-tester",
prompt: "{agent-communication-template}
Run the live-testing skill for this project.
Focus: <testing | full — pick based on $ARGUMENTS>.
Read the handoff chain for context on what changed recently.
Project-specific rules: <paste .claude/rules/continuous-improvement.md if it exists, else omit>
Write your handoff with a Testing Results section listing all findings and filed issue URLs."
})
TaskUpdate(taskId: "live-testing", owner: "live-tester", status: "in_progress")
rust-researcher:
TaskCreate(id: "research", description: "Research and monitoring cycle")
Agent({
subagent_type: "rust-agents:rust-researcher",
description: "Research and monitoring cycle",
name: "researcher",
prompt: "{agent-communication-template}
Run the research-protocol skill for this project.
Focus: <research | dependencies | parity | full — pick based on $ARGUMENTS>.
Read the handoff chain for context on what changed recently.
Project-specific rules: <paste .claude/rules/continuous-improvement.md if it exists, else omit>
Write your handoff with a Research Results section listing all findings and filed issue URLs and spec paths."
})
TaskUpdate(taskId: "research", owner: "researcher", status: "in_progress")
rust-arch-analyst:
TaskCreate(id: "architecture", description: "Architecture and code quality review")
Agent({
subagent_type: "rust-agents:rust-arch-analyst",
description: "Architecture and code quality review",
name: "arch-analyst",
prompt: "{agent-communication-template}
Run a full architecture and code quality audit of this project.
This is a READ-ONLY analysis pass — do NOT modify source files. Use the audit checklist in your agent definition.
Project-specific rules: <paste .claude/rules/continuous-improvement.md if it exists, else omit>
Write your handoff with an Architecture Review section listing all findings and filed issue URLs."
})
TaskUpdate(taskId: "architecture", owner: "arch-analyst", status: "in_progress")
rust-security-analyst:
TaskCreate(id: "security", description: "Vulnerability and security-hardening audit")
Agent({
subagent_type: "rust-agents:rust-security-analyst",
description: "Vulnerability and security-hardening audit",
name: "security-analyst",
prompt: "{agent-communication-template}
Run a full vulnerability and security-hardening audit of this project.
This is a READ-ONLY analysis pass — do NOT modify source files, Cargo.toml, or Cargo.lock. Use the security-audit checklist from your agent definition (run the dependency scanners first, then the code-pattern categories).
Project-specific rules: <paste .claude/rules/continuous-improvement.md if it exists, else omit>
Write your handoff with a Security Review section listing all findings, severities, and filed issue URLs."
})
TaskUpdate(taskId: "security", owner: "security-analyst", status: "in_progress")
WAIT for all spawned agents' messages with handoff frontmatter + paths. Then update their tasks to completed.
Step 2.5: Shutdown Agents
After each agent completes its task, shut it down immediately:
SendMessage(to: "{agent-name}", message: {type: "shutdown_request", reason: "Cycle complete, shutting down"})
Wait for shutdown_response. The team's shared directories are cleaned up automatically when the session ends — there is no separate teardown call.
Step 3: Complete Cycle Summary
Aggregate results from agent messages and complete the remaining sections of {journal-path}:
### Live Testing
- Features tested: <list>
- Issues filed: <links>
- Coverage changes: <components moved to Tested/Partial/Untested>
### Research & Monitoring
- Dependency advisories: <count and priority>
- Research issues filed: <links>
- Parity gaps identified: <count>
### Architecture & Code Quality
- Anti-patterns found: <count by category: type system / DRY / API naming / workspace / async>
- Issues filed: <links>
- Top structural concern: <one-sentence summary>
### Security Audit
- Vulnerabilities found: <count by severity: Critical / High / Medium / Low>
- Scanner results: cargo audit <N advisories> | cargo deny <pass/fail> | gitleaks <clean/N hits>
- Issues filed: <links>
- Top security risk: <one-sentence summary; note if immediate rotation/patch is required>
### Next Cycle Priorities
- <top 3 items based on Findings table>
Print {journal-path} to the console so the user can locate the cycle record.