/devflow:tt-workflow-run [project-slug-or-id] [run-name]from DevFlow Skills Collection
Orchestrates an autonomous build loop as a first-class workflow_run: resumes or starts a run, enforces lifecycle gates, loops over tasks with drift/defect checks, and logs measured time and insights. Use when driving a tasktracker backlog to completion.
Ships in DevFlow Skills Collection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A thin, tasktracker-native orchestrator that turns an autonomous Claude Code build loop into a visible, auditable, resumable, projectable workflow_run. It is the session layer between the loop (which executes) and the tasktracker spine (project → phase → task → requirement+AC → time-log → insight).
It does not merely record the loop — it enforces the lifecycle through three backend gates that already exist (shipped in P99–P101), measures real build-time per slice, auto-logs insights, verifies architecture is followed each slice, and re-projects remaining effort from measured time only as an append-only versioned series.
Design source of truth: brainstorm
92898896→ "Solution Description (v1)" docba161e43-7697-4167-9fc7-f314ca68c3af. The four forks are LOCKED (A: new entity; B: loose coupling; C: lean v1 dogfooded, UI v2; D: getTimeLog preview folded in). Re-read it before changing this skill.
/tt-implement-plan | /tt-workflow-run (this skill) | |
|---|---|---|
| Unit driven | the plan's phase tasks, in author order | a first-class workflow_run over the next-ready backlog |
| Slice selection | next pending phase | tasktracker_getNextReadyTask(projectId) — dependency-free, ranked |
| Pre-conditions | readiness plan row satisfied | Gate 1 (lifecycle completeness) + Gate 2 (zero-defects-in), enforced server-side as 412 |
| Per-slice gates | none | Gate 3 architecture-followed (drift hash-diff) + Gate 2 defect-delta, every slice |
| Time / projection | none | getTimeSummary measured ms → workflow_recordIteration appends a by-layer projection version |
| Run entity | none | workflow_run row with status machine + projection series; resumable across sessions |
| Insight logging | per-phase, via /tt-implement-phase | per-phase plus the run's OWN insights (no-data friction, patterns, new-defect) |
If you just want to execute phases in order with no measured run, use /tt-implement-plan. If you want the run entity + measured projection + per-slice gates on top, use this skill. Both delegate the actual code work to /tt-implement-phase.
THIS SESSION IS THE RUN ORCHESTRATOR + the SINGLE writer of run state. IT NEVER IMPLEMENTS CODE DIRECTLY — for each slice it follows
/tt-implement-phaseas the phase lead, in this session, and the role agents write the code. The slice runs here because agent reports arrive in this session; a forked lead can't receive them. Only with no subagent tool at all does the code get written in-context (the graceful-degradation mode). "Foreground" or "don't poll" in the user's words is about waiting, not about who writes the code. Run-state writes (workflow_* MCP calls) are always yours and always main-context, regardless of mode.
tt-workflow-run (this session — RUN ORCHESTRATOR + the SINGLE writer of run state)
│ ⛔ NEVER writes code ⛔ NEVER uses Write/Edit (while Agent is available)
└── follows /tt-implement-phase for each slice, in this session
├── orchestrated mode → implementer / mechanic / reviewer agents do the work;
│ their reports arrive here as messages
└── in-context mode → only when no subagent tool exists
| DO (this session) | DO NOT |
|---|---|
Create + drive the workflow_run (start/record/pause/complete) | Write code or edit files |
setActiveTask / pauseActiveTask / clearActiveTask | Edit a locked phase body (HTTP 422) |
Pick the next slice via getNextReadyTask | Invent a new backend Workflow API (none exists — Fork B) |
Lead each slice by /tt-implement-phase | Estimate a slice's duration (principle #11) |
| Run the two start gates + three per-slice gates | Advance past a blocked gate without resolving it |
| Log the run's own defects/learnings/frictions | Bury insights in chat narrative |
This skill is main-loop-only (it needs to ask the user at gates): it calls sibling skills via the Skill tool, never via an Agent dispatch. Invoking /tt-implement-phase loads its procedure into this session, which then leads the slice: agents are dispatched, their reports arrive here as messages, and the slice ends with the PHASE_RESULT (Step 2c). The tasktracker_workflow_* MCP tools are module-cached at MCP boot — if one isn't visible, the MCP needs a restart (mcp-server/CLAUDE.md), not a workaround. This restart caveat applies ONLY to those MCP tools. The built-in Workflow and Agent tools are top-level main-loop tools — never MCP, never in ToolSearch, never affected by an MCP restart; don't conflate the two.
Exact tool names — note the tasktracker_ prefix + workflow_ infix:
| Tool | Role in the loop | Active-task |
|---|---|---|
tasktracker_workflow_startRun | Create + start a run; runs Gate 1 + Gate 2; 412 on failure (run persists as enforcing). acknowledgeBaseline: true pins the current open-defect count as the run baseline (bootstrap fallback only). | EXEMPT (first-contact, like createProject) |
tasktracker_getNextReadyTask | Pick the next dependency-free slice. It takes only projectId and can return a non-phase task — map that to its phase (Step 2). null ⇒ backlog drained ⇒ complete. | EXEMPT (read) |
tasktracker_workflow_setCurrentTask | Point the run at the picked slice (no iteration recorded). | requires active task (heartbeats) |
tasktracker_scanArchitectureDrift | Baseline (slice start) + re-scan (slice end). Returns bucketed missing / stale / orphaned. | EXEMPT (read) |
tasktracker_getDefectStats | Re-read .open for the Gate 2 delta vs baseline. | EXEMPT (read) |
tasktracker_getTimeSummary | Measured (stopped-segment-only) ms for the slice task. | EXEMPT (read) |
tasktracker_workflow_recordIteration | Runs the advance gates (Gate 3 reqs-link + architecture-followed, Gate 2 defect-delta), records the iteration, appends a projection version, and auto-logs the "no data" friction when hadHeartbeatData: false. 412 on a blocked advance (run → blocked_on_gate). | requires active task (heartbeats) |
tasktracker_workflow_pauseRun / resumeRun | Pause before a human gate / resume after. | requires active task |
tasktracker_workflow_completeRun / abandonRun | Terminal. | requires active task |
tasktracker_workflow_getRun / listRuns | Inspect run + projection series; listRuns finds an open run to resume (Step 0). | EXEMPT (read) |
recordIteration key inputs (get these right — they drive the gates + projection):
runId, taskId, layer (required) — layer ∈ backend|frontend|fullstack|docs|infra (project-estimate.py taxonomy).measuredMs — from getTimeSummary (bigint → pass as a string for large values; defaults to 0).measurementSource — 'timer' (summed stopped segments) or 'wallclock' (manual fallback).hadHeartbeatData — false when the slice produced no heartbeat-backed time-log data → triggers the run's own "no data" friction (R3 / principle #11).baselineDrift / drift — the slice-START and slice-END scanArchitectureDrift outputs as {missing:[file...], stale:["componentId:file"...], orphaned:["componentId:file"...]} key arrays. Net-new at end vs baseline blocks the advance + logs a defect.remainingByLayer — per-layer count of the run's remaining pending dependency-free slices: the projection multiplier (projected = Σ_layer remaining×mean). Omit the whole object on the final slice and the projection trends to ~0.projectionTrigger — defaults 'slice_complete'; use 'scope_change' / 'defect_baseline_shift' for re-projections not driven by a finished slice.1. tasktracker_listProjects({search}) — or use the argument hint → projectId.
2. tasktracker_workflow_listRuns({projectId}) — if a run is `running`, `paused` or
`blocked_on_gate`, resume it instead of starting a new one:
- tasktracker_workflow_getRun({runId}) — its current task, defect baseline, projection so far.
- tasktracker_setActiveTask({taskId: <the run's current task>}) — resumeRun needs an active task.
(No current task → use the slice Step 2 picks.)
- `paused` / `blocked_on_gate` → tasktracker_workflow_resumeRun({runId}). `running` → just use its runId.
- If the current task isn't completed, it is the next slice: run Step 2 on it before calling
getNextReadyTask. A `blocked_on_gate` run resumes at the blocked step — resolve it and
re-record (see "Handling a blocked gate").
- Skip the rest of Step 0 and Step 1.
3. tasktracker_getProject({projectId}) — confirm solutionDescription is non-null (Gate 1 input).
4. tasktracker_getProjectReadiness({projectId}) — the requirements row must read `satisfied`
and unlinkedTaskCount must be 0 for the run's subtree (Gate 1).
5. tasktracker_getDefectStats({projectId}) — note `.open`. This is the Gate 2 input AND the run baseline.
Do not try to pre-satisfy a gate by editing data behind the run's back. If Gate 1 will fail (no solution description, requirements not satisfied, unlinked tasks), STOP — the project needs /tt-create-plan / requirement linking first. If Gate 2 will fail (open defects), see the Bootstrap nuance below — the strict posture refuses to start; the documented fallback is acknowledgeBaseline.
tasktracker_workflow_startRun({
projectId,
name: "<run name>",
acknowledgeBaseline: <true ONLY for the documented bootstrap case — see below>,
brainstormId?: <originating brainstorm>,
sessionId?: <current session>,
})
running with baselineDefectCount = 0. Strict zero-defects-in now holds for the whole run.enforcing so you can inspect the structured body (unlinked task ids / open-defect count). Fix the cause (link tasks, resolve defects, or acknowledge the baseline) and retry — do not route around the gate.startRun is active-task-EXEMPT (it CREATES the run). Right after a successful start, the first setActiveTask (Step 2) begins heartbeating.
A project that already has an open defect cannot pass strict Gate 2 — but that open defect is often exactly the first thing the loop should fix. The documented bootstrap path:
acknowledgeBaseline: true. The run pins baselineDefectCount = N (the current open count). Only NEW defects above N block advance; the N pre-existing ones don't.tasktracker_createFixTask({defectInsightId}) — stamps metadata.fixesInsightId so the fix-time rolls into getDefectStats.timeOnDefects). Running it resolves the defect, dropping .open back toward 0.acknowledgeBaseline is a one-time bootstrap concession, not a routine knob. Once the backlog is clean, future runs start strict (baseline 0).
Loop while getNextReadyTask returns a slice. Each iteration is the brainstorm's per-slice protocol, one step per call:
loop:
slice = tasktracker_getNextReadyTask({projectId})
if slice == null: break # backlog drained → Step 3
if slice.type != "phase": # it can return a task or subtask
slice = the type "phase" entry of tasktracker_getTaskAncestors({taskId: slice.id})
# that phase already completed (a straggler task) → take the first not-completed
# phase from tasktracker_getReadyTasks({projectId}) instead
# 2a. Focus + point the run at the slice
tasktracker_setActiveTask({taskId: slice.id}) # heartbeats start; digest carries principles + body
tasktracker_workflow_setCurrentTask({runId, taskId: slice.id})
# 2b. Pre-slice drift baseline (Gate 3 input — baseline-subtracted so only the slice's delta is charged)
baselineDrift = tasktracker_scanArchitectureDrift({projectId}) # capture missing/stale/orphaned key arrays
# 2c. Run the slice by /tt-implement-phase, in this session (you are the phase lead)
Skill(skill="tt-implement-phase", args=
"Execute the slice. Caller: tt-workflow-run. Phase task id: <slice.id>. Project: <name + id>.
Sub-tasks (getChildTasks), linked requirements + ACs, principles from the setActiveTask digest.
Unattended: yes # only when this run is wrapped in /loop with no one to answer")
/tt-implement-phase: the role agents do the code (Sonnet implementer, Haiku mechanic per unit, Opus reviewer); registers the architecture delta in the SAME
slice (principle #8 — so the slice's own drift re-scan stays clean), runs verification-loop +
code-review + ADR compliance, auto-logs defects/learnings/frictions with relatedTaskId = slice.id,
keeps the slice heartbeating, and leaves the active task on the slice for you.
Agents report asynchronously: when nothing else is left, end the turn naming what you wait for; the
report resumes you. Never poll with sleep loops. Blockers mid-slice are asked by the procedure itself.
PHASE_RESULT FAILED (or BLOCKED, from an unattended run) →
tasktracker_workflow_pauseRun({runId, reason: "<blocked step — what is needed>"})
tasktracker_pauseActiveTask()
ask the user (AskUserQuestion) with the PHASE_RESULT's options; on resume:
tasktracker_workflow_resumeRun({runId}) # the pointer is still on the slice
run 2c again with Resume From Step + the decision + the earlier PHASE_RESULT.
Never record an iteration for an unfinished slice.
# 2d. Slice-end gate inputs (only after PHASE_RESULT status PASS)
endDrift = tasktracker_scanArchitectureDrift({projectId}) # Gate 3 delta
defects = tasktracker_getDefectStats({projectId}) # Gate 2 delta (.open vs run baseline)
time = tasktracker_getTimeSummary({taskId: slice.id}) # measured (stopped-only) ms
layer = classify(slice) # backend|frontend|fullstack|docs|infra
# 2e. Record the iteration → appends a projection version (runs the advance gates server-side)
# recordIteration requires an active task: the child left it on the slice — check, and re-set if not.
if tasktracker_getActiveTask() != slice.id: tasktracker_setActiveTask({taskId: slice.id})
tasktracker_workflow_recordIteration({
runId, taskId: slice.id, layer,
measuredMs: time.totalMs (as string if large),
measurementSource: time had data ? 'timer' : 'wallclock',
hadHeartbeatData: <true iff getTimeSummary returned measured data>,
baselineDrift, drift: endDrift,
remainingByLayer: <per-layer count of remaining pending dependency-free slices>, # omit on last slice
})
# 412 here ⇒ the advance was BLOCKED (Gate 3 net-new drift / missing req link, or Gate 2 new defect).
# The run is now blocked_on_gate. Resolve the cause (re-register the arch delta, link the requirement,
# or fix the new defect) within /tt-implement-phase, tasktracker_workflow_resumeRun({runId}), then
# re-record. Do NOT skip the slice.
# 2f. Pause before any human gate
tasktracker_pauseActiveTask() # before any message that waits on the human (their think-time isn't work)
# Don't clear the active task between slices — the next 2a moves it; Step 3 clears it.
Time comes from heartbeats, not timers. getTimeSummary only sees time-log segments that tasktracker MCP calls kept alive; a segment closes after ~5 minutes without one. While the role agents work they keep the slice heartbeating (getCurrentTimer at least every ~4 minutes, confirmed by a HEARTBEAT: line in each report; this session can't heartbeat while it waits), and this session doesn't switch or pause the active task while they run. Never call startTimer — started timers create lease-less rows that absorb other sessions' cost (one phase read 12h18m against 3h16m of real work); stopTimer is only for a timer found still running on a slice at its close.
/tt-implement-phase logs the slice's insights. ON TOP of that, this skill logs the run's own:
| Condition | Tool | Notes |
|---|---|---|
| The slice produced no heartbeat-backed time data | recordIteration({hadHeartbeatData:false}) auto-logs it, OR tasktracker_logFriction | "no data" — never estimate the duration (principle #11). The auto-log stamps run_id + iteration_id. |
| A notable cross-slice pattern emerged | tasktracker_logLearning | E.g., "drift baseline-subtraction means an unrelated stale component never blocks an unrelated slice." |
.open rose above the run baseline | tasktracker_logDefect | The new error is "ours" (principle #14). recordIteration also blocks the advance. |
Per R3, auto-logged slice insights carry relatedTaskId = slice.id AND their metadata is stamped with run_id + iteration_id (no new column). When you log the run's own insight manually, set relatedTaskId to the slice and reference the run/iteration in the body.
Map the slice to the project-estimate.py taxonomy: frontend (Angular templates/components/styles), backend (NestJS services/controllers/entities), fullstack (both in one slice), docs (markdown/skill files), infra (CI, compose, migrations-only). When a slice touches both backend + frontend, classify fullstack (don't split the iteration).
When getNextReadyTask returns null:
tasktracker_workflow_completeRun({runId}) # terminal; sets ended_at
tasktracker_workflow_getRun({runId}) # confirm the projection series is populated
tasktracker_getDefectStats({projectId}) # confirm .open == baseline (no nets introduced)
tasktracker_clearActiveTask()
Then emit the closing summary (counts, the projection series, insights logged this run, manual verification still owed) in chat — not as a file. If the run ended deliberately short, use abandonRun instead and say why.
Loose coupling (Fork B) means /loop is orthogonal: you can wrap the whole skill in /loop <interval> /tt-workflow-run <project> for an unattended cadence, but the run does not depend on it. The run entity + gates + projection are pure tasktracker data; /loop just re-invokes the skill, and Step 0 finds the open run with workflow_listRuns and resumes it rather than starting a new one.
A 412 is the system working, not a failure to route around.
| Where | Cause | Resolution |
|---|---|---|
startRun 412 | Gate 1: no solution description / requirements not satisfied / unlinked tasks | Fix the lifecycle (/tt-create-plan, link requirements), then retry. |
startRun 412 | Gate 2: open defects, no ack | Resolve them, OR start with acknowledgeBaseline: true and clear them as inaugural slices. |
recordIteration 412 | Gate 3: net-new drift (a new file no component cites; an edited component whose driftHash wasn't refreshed) | Register/refresh the architecture component in-slice (principle #8), then re-record. |
recordIteration 412 | Gate 3: the slice task has no requirement link in its hierarchy | Link it to a requirement, then re-record. |
recordIteration 412 | Gate 2: .open rose above baseline | The new defect is ours — fix it (a follow-up slice), then re-record. |
On any 412 the run sits in enforcing (start) or blocked_on_gate (advance). pauseActiveTask before surfacing the blocker to the user; resume from the blocked step, not from Step 0 — for an advance, workflow_resumeRun({runId}) with the slice still active, then re-record.
/tt-implement-phase describes.measuredMs.setActiveTask before a slice — no heartbeats, no measured time, the projection goes blind.startTimer, or switching/pausing the active task while role agents are working.PHASE_RESULT is written.running, paused or blocked_on_gate one — resume it (Step 0).acknowledgeBaseline: true as a routine convenience. It is a one-time bootstrap concession; once clean, start strict.setActiveTask) is the locked contract.logDefect/logLearning/logFriction.Agent-dispatched subagent — invoke it in the main loop; call siblings via Skill.running / paused / blocked_on_gate) resumed rather than duplicated; otherwise Gate 1 inputs (solution description, requirements satisfied, zero unlinked) checked and Gate 2 baseline (.open) noted.startRun ran the gates; strict by default; acknowledgeBaseline used ONLY for the documented bootstrap case, with the inaugural slice resolving a baseline defect.setActiveTask + setCurrentTask, captured a pre-slice drift baseline, led the slice by /tt-implement-phase until its PHASE_RESULT, re-scanned drift + re-read defect stats, read getTimeSummary, and recordIteration'd (with the slice active) with the right layer + drift arrays + remainingByLayer. No startTimer.relatedTaskId + run_id/iteration_id; the run logged its OWN "no data" friction whenever heartbeating was off.pauseActiveTask before every human-gate message.completeRun; projection series populated; .open back at baseline; clearActiveTask.This skill reuses the tasktracker references already shipped with the sibling skills:
/tt-implement-phase references/insight-cookbook.md — when/how to logDefect / logLearning / logFriction./tt-workflow-audit references/workflow-tasktracker-contract.md — the shared tt-workflow-* contract (parent owns writes, no Date/RNG in any workflow script, MCP reachability, prod safety). This skill is sequential (single active task) — it does NOT use the parallel Workflow tool — but the active-task / locked-body / prod-write rules in that contract still apply. Namespace note: the tasktracker_workflow_* MCP tools this skill uses (workflow_startRun, workflow_recordIteration, …) are run-TRACKING tools — NOT the built-in Workflow orchestration tool; they only share the word "workflow". The siblings /tt-workflow-audit and /tt-workflow-build are the ones that invoke the built-in Workflow tool./tt-implement-phase — the per-slice procedure. This session follows it for every slice./tt-implement-plan — the no-run-entity alternative: executes phases in order without projection or per-slice gates./tt-create-plan — upstream: produces the requirements + linked tasks Gate 1 checks for./loop — optional outer cadence; orthogonal to the run./devflow:code-review, /verification-loop, /adr — quality gates inside /tt-implement-phase./tt-implement-phase./loop optional.getTimeSummary (stopped segments); no heartbeat data ⇒ "no data" friction, never an estimate.acknowledgeBaseline is a one-time bootstrap.setActiveTask per slice, pauseActiveTask before human waits, clearActiveTask on completion; time from heartbeats, never startTimer.What SKILL.md sets; muted values are Claude Code's defaults
35 skills in this plugin
/adrDocument architectural decisions in standardized ADR format. This skill should be used when making significant technical decisions, choosing between approaches, establishing patterns, or when other skills (create-plan, implement-plan, brainstorm) identify decisions that need documentation. Triggers on "document decision", "create ADR", "architectural decision", or automatically when invoked by other skills during planning and implementation./adversarial-reviewerAdversarial code review by three independent subagent personas (Saboteur, New Hire, Security Auditor) running in parallel, isolated contexts that know nothing of the author's intent or Claude's earlier conclusions. Reviews a diff by default (staged/unstaged, a ref or a file); --codebase reviews a whole repo or subtree for tech debt, attack surface and knowledge silos. Use before merging a PR; when the user asks for a hostile, harsh, critical, skeptical or second-opinion review; when a /devflow:code-review came back suspiciously clean; when the user is tired after a long session or has a gut feeling something is off; or for a quick audit of an inherited repo ("what am I inheriting"). Differs from /devflow:code-review (routine per-phase review, no isolation) and /devflow:security-review (single-lens OWASP depth)./agent-creatorCreate composable AI agent systems in NestJS projects following the "tools all the way down" architecture. Use this skill when users want to: (1) Create new AI agents with orchestrator/planner/executor/evaluator components, (2) Build agentic systems that can call other agents as tools, (3) Implement DAG-based planning with parallel execution, (4) Add database-backed state persistence for agent runs, (5) Create custom evaluators for quality assurance. Triggers on "create agent", "build agent", "agent system", "agentic", "orchestrator", "planner/executor pattern", or NestJS AI agent requests.
/brainstormRefine a rough idea into a well-structured concept through Socratic questioning, targeted research and one or two fitting analysis frameworks (Six Thinking Hats, SCAMPER, Premortem), then write it to docs/brainstorms/ as the input for planning. Use when the user wants to brainstorm, explore or think through an idea, find holes in a proposal, asks "what am I missing", or wants to shape a concept before planning, whether or not the work is tracked in TaskTracker. The output feeds /create-plan, /tt-create-plan and /user-story./codebase-auditLong-running, resumable adversarial audit of a whole codebase. Splits the repo into partitions, runs /adversarial-reviewer --codebase on each, then synthesizes a cross-partition risk register and a written remediation report. Use for onboarding audits of an inherited codebase, pre-acquisition due diligence, periodic tech-debt health checks, or when the user asks for a comprehensive, thorough, exhaustive or deep review of the whole codebase ("full codebase audit", "code due diligence", "tech debt audit", "what am I inheriting"). Differs from /adversarial-reviewer --codebase, which samples the repo in one pass, and from /code-quality-audit, which measures coverage, complexity, cycles and mutation scores./codebase-researchOrchestrates comprehensive codebase research by decomposing user queries into parallel sub-agent tasks and synthesizing findings. This skill should be used when users ask questions about how code works, where functionality exists, how components interact, or need comprehensive documentation of existing implementations. It focuses exclusively on documenting and explaining the codebase as it exists today.npx claudepluginhub mhylle/claude-skills-collection --plugin devflowOther plugins' skills for the same job