tt-workflow-audit
Skill20 starsChanged 36 days agoMITView on GitHub
Tasktracker-native, project-wide parallel audit. Partitions a repo, backlog or architecture, fans out one read-only agent per partition (through the Claude Code Workflow tool when it is in the tool list, otherwise parallel Agent subagents), aggregates their findings into a deduplicated, ranked risk register, and optionally writes fixes back as tasks under a Bug Fix phase. The parent does every tasktracker write; the agents only read. An interrupted run resumes without re-running finished partitions. Use for large, embarrassingly parallel analyze-at-scale jobs in a tasktracker project: audit every file or component for risk, find all architecture drift or duplicate tasks, a per-file tech-debt sweep, or a coverage or security-surface scan. Prefer it over /codebase-audit or /code-quality-audit when the findings should become tracked tasks; use plain subagents instead when each step depends on the previous result.
In this repository34 other files it gives its agents.
- adrSkill
- adversarial-reviewerSkill
- agent-creatorSkill
- brainstormSkill
- codebase-auditSkill
- codebase-researchSkill
- code-quality-auditSkill
- code-reviewSkill
- context-saverSkill
- continuous-learningSkill
- create-planSkill
- design-languageSkill
- e2e-testingSkill
- eval-harnessSkill
- grumpy-reviewerSkill
- implement-phaseSkill
- implement-planSkill
- iterate-planSkill
- prompt-generatorSkill
- security-reviewSkill
- ship-issueSkill
- skill-visualizerSkill
- strategic-compactSkill
- tt-create-build-loopSkill
- tt-create-planSkill
- tt-implement-phaseSkill
- tt-implement-planSkill
- tt-workflow-buildSkill
- tt-workflow-runSkill
- user-storySkill
- verification-loopSkill
- video-explainerSkill
- visual-explainerSkill
- workflow-guideSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 82
Use this when the project is in tasktracker AND you want findings to become tracked work.
- Distinctive: line 108
Read the things every agent would otherwise re-fetch (principles, architecture components, the task tree, the file list) once, in the …
- Distinctive: line 183
Checkpoint first: Write the checkpoint file (see Resumability) with every partition id, and tell the user its path.
- Distinctive: line 203
If the user wants findings tracked:
- Distinctive: line 262
Read project-invariant context once: Don't fan out N× identical reads.
- Distinctive: line 264
Disclose coverage: No silent truncation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tt-workflow-audit
<!-- contents: generated by tests/skill_structure.py --write; edit headings, not this block -->Contents
- CRITICAL: the contract is non-negotiable
- How this differs from the other audit skills
- When to use / when not
- Workflow
- Step 0 — Locate the project + scope (parent, inline)
- Step 1 — Read project-invariant context once + partition (parent, inline)
- Step 2 — Fan out read-only analysis
- Step 3 — Aggregate into a risk register (parent, plain code/reasoning)
- Step 4 — Present the register (parent)
- Step 5 — Optional write-back (parent only, gated)
- Resumability
- Anti-patterns
- Quality checklist
- Resources
- references/
- Related skills
- Key principles
Reference files (open one when a step points to it):
references/workflow-tasktracker-contract.md: Workflow ↔ TaskTracker Contract
<!-- /contents -->A tasktracker-native, project-wide parallel audit. It is the first concrete skill in the tt-workflow-* tier — the "parallel and tasktracker-correct" quadrant that the sequential tt-* skills don't cover.
The shape is a hybrid: the parent (this session) scouts and partitions inline, fans the analysis out — one Workflow run when that tool is available, otherwise batches of parallel Agent calls — then does all writes in the tail. The parallel agents only read and report.
CRITICAL: the contract is non-negotiable
Read
references/workflow-tasktracker-contract.mdbefore running. It is the shared contract for everytt-workflow-*skill, grounded in verified facts about the live system.
The one rule you cannot break:
The PARENT orchestrates (through a Workflow script, or directly with Agent calls).
Parallel agents are READ/ANALYZE-ONLY and return schema output.
The PARENT (this main-loop session) performs ALL tasktracker writes — serially.Why (verified): the active task is a single process-global pointer, parallel agents — workflow agent() calls and Agent subagents alike — share one session id + one MCP process, and the shared stdio MCP cannot attribute a tool call to a specific agent. So no agent may call setActiveTask or any write-gated tool — it would clobber the shared pointer and bill time to the wrong task. Reads are fine (gate-exempt and reachable in background runs, probe-verified).
| DO (parent) | DON'T |
| Read project-invariant context once, pass it down | Let agents re-fetch the same context N× |
| Partition the audit scope | Let agents call setActiveTask |
Fan out read-only agents (Workflow, or parallel Agent calls) | Let agents call logDefect/updateTaskStatus/batchCreate* |
| Aggregate findings → risk register | Edit a locked phase body |
| Write fixes back in the tail (with an active task set) | Write back destructively without a dry-run + confirmation |
How this differs from the other audit skills
/code-quality-audit | /codebase-audit, /adversarial-reviewer --codebase | /tt-workflow-audit (this) | |
| Engine | metrics tools | sequential / small subagent fan-out | parallel fan-out — Workflow (journaled) when available, else batched Agent calls (checkpointed) |
| Output | metrics report | written report / risk register | schema-checked risk register + optional tasktracker tasks |
| Tasktracker | none | none | native — write-back as Bug-Fix-phase tasks, insight logging, all parent-owned |
| Resumes after crash/rate-limit | no | no | yes (the journal, or the checkpoint file) |
Use this when the project is in tasktracker AND you want findings to become tracked work. Use the others for pure-report or metrics-only runs.
When to use / when not
Use it when the job is large, embarrassingly parallel, read/analyze-heavy, with aggregable per-unit output: audit every file/component, find all architecture drift or duplicate tasks, a per-file tech-debt sweep, a coverage/security-surface scan.
Don't use it when the work is sequential or must branch on results mid-run (a fixed fan-out can't adapt mid-flight — use plain subagents one at a time), or when the project isn't in tasktracker (use /codebase-audit).
Workflow
Step 0 — Locate the project + scope (parent, inline)
1. tasktracker_listProjects({search}) (or use the argument hint) → project id.
2. tasktracker_getProject({projectId}) → understand the project.
3. Decide the AUDIT MODE (argument or ask):
- architecture-drift → inputs from scanArchitectureDrift / listArchitectureComponents
- duplicate-backlog → detectDuplicates / auditDuplicates over the task tree
- file-risk → per-file tech-debt / complexity / smell sweep
- coverage-gaps → per-module test-coverage analysis
- security-surface → per-entrypoint security review
- (compose modes if the user wants a full sweep)Step 1 — Read project-invariant context once + partition (parent, inline)
Read the things every agent would otherwise re-fetch (principles, architecture components, the task tree, the file list) once, in the parent, and pass them into the agents as data (contract R3). Then build the partition list — the unit of parallelism:
- file-risk → a list of files/dirs (glob the repo; group into balanced partitions).
- architecture-drift → the registered components.
- duplicate-backlog → the task tree (or sub-trees).
- coverage-gaps / security-surface → modules / entrypoints.
Scope the partitions inline, then fan out.
Step 2 — Fan out read-only analysis
Pick the engine from your tool list (contract, "Tool availability"):
Workflowis in your tool list → oneWorkflowrun (2a).- It isn't → batches of parallel
Agentcalls (2b).Workflowis opt-in, so this is the common case; it is not a reason to stop.
Both engines give every partition the same read-only prompt and collect the same FINDING shape, so Step 3 onward doesn't change. The agent prompt MUST forbid setActiveTask and every write tool.
2a — With the Workflow tool
Give Workflow a script that parallel()s (or pipeline()s) one read-only agent per partition, each returning schema-checked findings. Skeleton:
export const meta = {
name: 'tt-workflow-audit-run',
description: 'Read-only parallel audit fan-out; parent does all tasktracker writes',
phases: [{ title: 'Audit' }],
}
const FINDING = {
type: 'object', additionalProperties: false,
required: ['partition', 'findings'],
properties: {
partition: { type: 'string' },
findings: {
type: 'array',
items: {
type: 'object', additionalProperties: false,
required: ['title', 'severity', 'location', 'detail'],
properties: {
title: { type: 'string' },
severity: { type: 'string', enum: ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'] },
location: { type: 'string', description: 'file:line or component/task id' },
detail: { type: 'string' },
suggestedFix: { type: 'string' },
},
},
},
},
}
phase('Audit')
// `args` carries {partitions, invariantContext} passed in by the parent.
const results = await parallel(
args.partitions.map((p) => () =>
agent(
`Audit partition "${p.id}" of project ${args.projectName}. Mode: ${args.mode}.
Context (already read — do NOT re-fetch): ${JSON.stringify(args.invariantContext)}
Scope: ${JSON.stringify(p.scope)}
READ ONLY. Report findings against the schema. You MUST NOT call setActiveTask or ANY tasktracker write tool (no create/update/log/batch). Reads are fine.`,
{ label: `audit:${p.id}`, phase: 'Audit', schema: FINDING }
)
)
)
return { findings: results.filter(Boolean).flatMap((r) => r.findings) }Pass args as real JSON ({partitions, invariantContext, projectName, mode}). For a write-heavy variant that edits code, add isolation: 'worktree' and have agents return integrationIntents (contract R6) — but a pure audit is read-only and needs no worktrees.
No Date.now() / Math.random() / new Date() in the script (contract R5). Vary agent labels by partition id, not RNG.
2b — Without the Workflow tool (parallel Agent calls)
The parent runs the same fan-out itself:
- Checkpoint first. Write the checkpoint file (see Resumability) with every partition id, and tell the user its path.
- Dispatch a batch of up to 8 partitions as one message holding one
Agentcall per partition, so the batch runs concurrently. Each call:subagent_type: "Explore"— read-only by construction (no Write, Edit or Agent);description: "audit <partition id>";prompt: the per-partition prompt from the 2a script, filled in for this partition (same context, scope and write prohibition), plus: "Read the files in scope in full. Reply with ONLY a JSON object of this shape, no prose:" followed byFINDINGas JSON.
- Collect.
Agentsubagents run in the background: wait until every agent in the batch has sent its completion notification. Parse each reply and check it againstFINDING(required keys, the severity enum). For a malformed reply,SendMessagethat agent once asking for the JSON only; if it is still malformed, mark the partition failed. Add each valid result to the checkpoint as it lands. - Repeat with the next batch until every partition has a result or is marked failed. Re-dispatch failed partitions once; any still failing are uncovered and Step 4 says so (contract R8).
The concatenated findings are what the workflow would have returned.
Step 3 — Aggregate into a risk register (parent, plain code/reasoning)
Collect the fan-out's findings, dedupe (same file:line / same component) and rank by severity. This is ordinary parent-side work — not an agent, not a write.
Step 4 — Present the register (parent)
Show the user the ranked register: counts by severity, the top findings with location + suggestedFix. If coverage was bounded (sampled, top-N, partitions that failed), state what was dropped (contract R8) — never imply full coverage silently.
Step 5 — Optional write-back (parent only, gated)
If the user wants findings tracked:
1. Confirm with the user (this writes to PRODUCTION).
2. Ensure a "Bug Fix" phase exists (or create one — createTask/createPhaseFromTemplate are planning-exempt).
3. tasktracker_setActiveTask(<Bug Fix phase or coordination task>) ← parent owns the pointer
4. tasktracker_batchCreateTasks(register.map(toFixTask)) ← planning-exempt, atomic
5. For findings worth an insight: tasktracker_logDefect(...) ← gated; needs the active task set in (3)
6. tasktracker_clearActiveTask()Dry-run/report mode is the default for any first run; only create tasks after the user sees the register and confirms. Never batchDelete* from an audit.
Resumability
Workflowpath: the run is journaled. If a run is interrupted (rate-limit, crash, network), resume it withWorkflow({scriptPath, resumeFromRunId})— completed partitions return cached results; only the unfinished ones re-run.Agentpath: there is no journal and noresumeFromRunId. The checkpoint replaces it: a JSON filett-workflow-audit-<projectId>-<mode>.jsonin the session scratchpad (or the system temp directory when there is none), holding the partition list and each finished partition's validated result. On a re-run for the same project and mode, or one given that path, read the checkpoint first and dispatch only the partitions without a result. It is a local file because the audit writes nothing to tasktracker before the user has seen the register (Step 5); a resume therefore needs the same machine, or the user handing over the file.
Either way, resuming beats re-running the whole scope — the main reason to use this skill for large audits.
Anti-patterns
- ❌ An agent calling
setActiveTaskor any write tool. Agents read and report; the parent writes. - ❌ Each agent re-reading principles/architecture/the task tree. Read once in the parent, pass down.
- ❌
Date.now()/Math.random()/new Date()in the workflow script (breaks resume). - ❌ Stopping, or auditing serially, because
Workflowisn't in the tool list. Use theAgentfan-out (2b). - ❌ On the
Agentpath, one agent per message (serial) or all partitions in one message (unbounded). Batch up to ~8. - ❌ Editing a locked phase body with findings. Route to a sub-task (parent) or a Bug-Fix-phase task.
- ❌ Creating fix tasks in prod before the user has seen the register and confirmed.
- ❌ Silently capping coverage (top-N / sampling / failed partitions) without saying so.
- ❌ Running this as an
Agent-dispatched subagent —Workflowis main-loop-only, and the parent must be the session that owns the writes; invoke this skill in the main session.
Quality checklist
- Project + audit mode resolved (Step 0).
- Project-invariant context read ONCE in the parent and passed into agents as data.
- Partition list built before the fan-out.
- Engine picked from the tool list:
Workflowif listed, else batchedExploreAgentcalls with a checkpoint. - Every agent prompt forbids
setActiveTask+ all write tools; agents returned schema findings only (validated by the parent on theAgentpath). Workflowpath: noDate.now()/RNG in the script; labels vary by partition id.- Findings deduped + ranked into a risk register (parent-side).
- Bounded coverage (if any) disclosed, not silent.
- Write-back (if any) done by the parent with an active task set, after user confirmation; dry-run first.
- On interruption, resumed (
resumeFromRunId, or the checkpoint) rather than re-run from scratch.
Resources
references/
workflow-tasktracker-contract.md— the shared contract everytt-workflow-*skill obeys (tool availability and theAgentfallback, parent-owns-writes, read-only agents, locked body, no Date/RNG, worktree intents, prod safety, MCP reachability). Read it first.
Related skills
/workflow-guide— routes read-only audits at scale here./codebase-audit,/adversarial-reviewer --codebase,/code-quality-audit— non-tasktracker / report-only audit alternatives./tt-create-plan,/tt-implement-plan— where the fix tasks this audit creates get planned and executed.
Key principles
- Parent owns every tasktracker write. Agents read and report.
- Scout inline, fan out, write in the tail. Hybrid orchestration.
- Read project-invariant context once. Don't fan out N× identical reads.
- Resumable. A journaled
Workflowrun, or the checkpoint on theAgentpath; resume on interruption. - Disclose coverage. No silent truncation.
- Write-back is gated. Production writes only after the user sees the register and confirms.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

