Sub Agent that executes Claude AI CLI requirements in a work-pipeline
Source: Dev.to
TL;DR
I built uctm (Universal Claude Task Manager) – an npm package that installs six specialized sub‑agents into Claude Code.
You type one request, and it automatically plans, builds, verifies, and commits – all through structured XML messaging.
npm install -g uctm
cd your‑project && uctm init
claude
# Type: [new-feature] Add user authentication with JWT
# → Pipeline runs automatically
GitHub: UCJung/uc-taskmanager-claude-agent npm: uctm
The Problem
Claude Code is powerful, but when you ask it to build something complex it tries to do everything in one shot.
- Simple tasks → fine.
- Multi‑file projects, inter‑dependent components, or proper testing → the output becomes messy, token‑heavy, and hard to reason about.
I wanted a system where:
| Goal | Why it matters |
|---|---|
| Complex tasks are broken into manageable pieces | Keeps each step focused and testable |
| Each piece is built, tested, and committed individually | Guarantees correctness incrementally |
| Context doesn’t explode as tasks pile up | Saves tokens and reduces hallucinations |
| Zero external runtime dependencies | Pure‑prompt, portable solution |
Architecture – 6 Agents, 1 Pipeline
User Request
│
Main Claude (orchestrator)
│
├─ router → decides execution mode
├─ planner → decomposes request into TASKs (DAG)
├─ scheduler → manages DAG, dispatches ready TASKs
├─ builder → writes the actual code
├─ verifier → runs tests / lint / acceptance checks
└─ committer → writes result report & git commits
Key constraint: Claude Code sub‑agents cannot call other sub‑agents.
Therefore the Main Claude (the CLI terminal) acts as the orchestrator, invoking each agent in turn and passing messages between them.
Not every request needs all six agents – the router decides which subset to use.
Execution Modes
| Mode | When | What Happens |
|---|---|---|
| direct | Simple change, no tests needed | Router handles everything alone |
| pipeline | Needs testing, single domain | router → builder → verifier → committer |
| full | Complex, multi‑file, dependencies | All 6 agents with DAG management |
The mode is derived by analysing the request against rules in .agent/router_rule_config.json (fully customizable per project).
Structured XML Messaging
Instead of free‑form text, uctm uses XML – parseable, validatable, and token‑efficient.
Each agent knows exactly what to expect and what to return.
Dispatch (router → builder)
<dispatch>
<project>my-app</project>
<language>ko</language>
<planPath>works/WORK-05/PLAN.md</planPath>
<task>
<path>works/WORK-05/TASK-00.md</path>
<title>Add JWT authentication middleware</title>
<type>implement</type>
<description>Create auth middleware with token validation...</description>
</task>
</dispatch>
Result (builder → verifier)
<result>
<summary>JWT auth middleware implemented</summary>
<details>
<component>JWT verification middleware</component>
<tests>12 test cases for auth flows</tests>
<outcome>12/12 passed</outcome>
</details>
<metadata>
<description>Auth middleware with JWT validation</description>
<libraries>Used jsonwebtoken for RS256 support</libraries>
<env>Requires JWT_SECRET env variable</env>
<notes>None</notes>
</metadata>
</result>
Why XML?
- Parseable – each agent can extract exactly what it needs.
- Validatable – schema enforcement catches malformed messages early.
- Token‑efficient – no extra fluff, only the required fields.
Sliding‑Window Context Handoff
In a multi‑task pipeline the naïve approach would pass the full history of every previous task, causing token bloat.
uctm limits what is transferred based on distance from the current task:
| Distance from current task | Detail Level | What’s Passed (≈ tokens) |
|---|---|---|
| Previous TASK (1) | FULL | what + why + caution + incomplete (~150) |
| 2 tasks ago | SUMMARY | what only (~50) |
| 3 + tasks ago | DROP | Nothing (0) |
Thus the context size stays roughly 200 tokens regardless of how many tasks have completed.
Example
TASK-00 → TASK-01 → TASK-02 → TASK-03
Builder for TASK‑03 receives:
| Source | Detail Level | Payload |
|---|---|---|
| TASK‑02 | FULL | what / why / caution / incomplete |
| TASK‑01 | SUMMARY | what only |
| TASK‑00 | DROP | (nothing) |
In a 10‑task work this saves ≈ 75 000 tokens compared with naïvely passing everything.
Real‑World Pipeline Run (Calculator Example)
Request: “Create a simple calculator with add, subtract, multiply, divide.”
| Step | Input | Output |
|---|---|---|
| Router | [new-feature] Create calc.js with 4 arithmetic functions | execution-mode=pipeline + dispatch XML + PLAN.md + TASK-00.md |
| Builder | Dispatch XML from router | task-result XML (creates calc.js & calc.test.js) |
| Verifier | Builder’s task-result XML | Re‑runs all 8 tests, checks acceptance criteria → ALL PASS |
| Committer | Builder + verifier results | Writes TASK-00_result.md, creates git commit feat(TASK-00): calc.js ESM module, returns commit hash |
Metrics: 136 K tokens, 96 tool calls, 344 s runtime. Every inter‑agent message adhered to the XML spec.
Specification‑Driven Development (SDD) Philosophy
- Requirements → Architecture → Design are the true assets.
- The spec documents define:
- XML schemas
- Context‑handoff rules
- Pipeline behavior
- Agents are plain
.mdfiles – pure prompt definitions. - Zero runtime code, zero dependencies → fully portable.
What This Gives You
| Property | Benefit |
|---|---|
| Portable | Works in any project after uctm init |
| Customizable | Edit .agent/router_rule_config.json to tune mode‑selection rules |
| Transparent | Every WORK is a series of readable markdown & XML files |
| Deterministic | No hidden logic; behavior is driven by the spec itself |
Quick Start Recap
npm install -g uctm # install the CLI globally
cd my-project && uctm init # bootstrap the six agents
claude # start Claude Code
# Example request:
# [new-feature] Add user authentication with JWT
# → uctm automatically runs the appropriate pipeline
Now you have a self‑contained, token‑efficient, test‑driven pipeline that lets Claude Code tackle anything from a one‑liner to a full‑blown multi‑module feature without exploding context.
Overview
uctm (UC Task Manager) generates PLAN.md, TASK files, progress tracking, and result reports.
Installation
npm install -g uctm
Quick Start
# Move to your project folder
cd your-project
# Initialise uctm in the project
uctm init
Run Claude Code (bypass mode for an uninterrupted pipeline)
claude --dangerously-skip-permissions
Trigger the pipeline with a tagged request
# [new-feature] Add a REST API for user management
# [bugfix] Fix the race condition in data loader
# [enhancement] Improve search query performance
What uctm init does
- Copies 12 agent
.mdfiles to.claude/agents/ - Creates
.agent/router_rule_config.json - Appends agent‑invocation rules to CLAUDE.md
- Creates a
works/directory for WORK files
Roadmap Highlights
- MCP Server Integration (Phase 2 complete, Phase 3 planned) – HTTP transport for external‑tool integration
- Multi‑project orchestration – Run pipelines across dependent repositories
- Dashboard visualization – Real‑time pipeline monitoring
Why try uctm?
If you work with Claude Code and manage complex, multi‑file tasks, uctm can streamline your workflow. It’s:
- Free and open‑source
- Takes ≈30 seconds to install
GitHub: UCJung/uc-taskmanager-claude-agent npm: uctm
Support
- Open a GitHub issue
- Find the maintainer on Discord