Sub Agent that executes Claude AI CLI requirements in a work-pipeline

Published: (March 19, 2026 at 02:40 PM EDT)
6 min read
Source: Dev.to

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-agentnpm: 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:

GoalWhy it matters
Complex tasks are broken into manageable piecesKeeps each step focused and testable
Each piece is built, tested, and committed individuallyGuarantees correctness incrementally
Context doesn’t explode as tasks pile upSaves tokens and reduces hallucinations
Zero external runtime dependenciesPure‑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

ModeWhenWhat Happens
directSimple change, no tests neededRouter handles everything alone
pipelineNeeds testing, single domainrouter → builder → verifier → committer
fullComplex, multi‑file, dependenciesAll 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 taskDetail LevelWhat’s Passed (≈ tokens)
Previous TASK (1)FULLwhat + why + caution + incomplete (~150)
2 tasks agoSUMMARYwhat only (~50)
3 + tasks agoDROPNothing (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:

SourceDetail LevelPayload
TASK‑02FULLwhat / why / caution / incomplete
TASK‑01SUMMARYwhat only
TASK‑00DROP(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.”

StepInputOutput
Router[new-feature] Create calc.js with 4 arithmetic functionsexecution-mode=pipeline + dispatch XML + PLAN.md + TASK-00.md
BuilderDispatch XML from routertask-result XML (creates calc.js & calc.test.js)
VerifierBuilder’s task-result XMLRe‑runs all 8 tests, checks acceptance criteria → ALL PASS
CommitterBuilder + verifier resultsWrites 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

  1. Requirements → Architecture → Design are the true assets.
  2. The spec documents define:
    • XML schemas
    • Context‑handoff rules
    • Pipeline behavior
  3. Agents are plain .md files – pure prompt definitions.
  4. Zero runtime code, zero dependencies → fully portable.

What This Gives You

PropertyBenefit
PortableWorks in any project after uctm init
CustomizableEdit .agent/router_rule_config.json to tune mode‑selection rules
TransparentEvery WORK is a series of readable markdown & XML files
DeterministicNo 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 .md files 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-agentnpm: uctm

Support

  • Open a GitHub issue
  • Find the maintainer on Discord
0 views
Back to Blog

Related posts

Read more »