insistir
Skill11 starsChanged 11 days agoMITView on GitHub
Run a task through an agent team where every worker's output is cross-reviewed, judged by a second provider and fixed by fresh agents until APPROVED.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- image-to-frontendSkill
- motion-designSkill
- compound-knowledgeSkill
- file-todosSkill
- agent-sdk-wizardSkill
- askcodexSkill
- managed-agents-wizardSkill
- metapromptSkill
- goal-loopSkill
- remote-agentsSkill
- second-opinionSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Fresh agent per phase: Every worker, reviewer and fixer is spawned for one job and ends after its report.
- Very specific: line 64
Every prompt ends with a Report: line: SendMessage to team-lead (team) or final message (subagent).
- Very specific: line 77
All crew agents default to opus.
- Very specific: line 121
If docs/solutions/ exists (Glob), spawn a jaiskills:insistir-learnings-researcher with the task keywords.
- Very specific: line 123
Write <topic>-plan.md from references/plan-template.md: every task declares depends_on, location, description, acceptance_criteria, …
- Distinctive: line 163
Every worker of the wave must be done before review starts.
- Very specific: line 179
Never pass the worker's reasoning or self-assessment.
- Very specific: line 203
If TODOs were filed for the task, call the Skill tool with file-todos to mark complete each one the fixer reported as applied, with the …
- Very specific: line 219
Update the plan's status/log/files fields, run uv run --script "${CLAUDE_SKILL_DIR}/scripts/insistir.py" status <topic>-plan.md, take newly …
- Distinctive: line 227
Remove the run state so the completion gate stops applying to this session:
- Very specific: line 236
If the run solved a non-trivial problem (real debugging, a surprising root cause), offer to document it.
≈ “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
insistir
Task: $ARGUMENTS
You are the tech lead of the pipeline below. Empty task line → get the task in Phase 0.
It pays off for multi-part work that parallelizes across different files. For single-file edits, typos, quick fixes, strictly sequential chains, or tasks that must all edit the same file (parallel workers overwrite each other), tell the user a single session is cheaper and confirm before going on.
Pipeline
LEAD (delegate mode: plans, spawns, routes reports, writes markers; never edits code)
│
├─► worker-t1 worker-t2 worker-t3 implement + commit → done
│ │ │ │
├─► reviewer-t1-r1 reviewer-t2-r1 reviewer-t3-r1 fresh, read-only, never the author
│ │ │ │ → verdict JSON → done
├─► second-opinion judge (cross-provider; skipped on trivial clean approvals)
│ │
│ APPROVED ─► T<N>.approved marker ─► TaskUpdate completed (hook-gated)
│ REVISE ─► fixer-t<N>-r1 (fresh) ─► reviewer-t<N>-r2 (fresh) ─► judge ─► …
│ until APPROVED, or max_review_rounds → FAILED (suggest decomposition)
└─► next wave once dependencies are completedInvariants
- Delegate mode from Phase 2 on. The lead spawns, routes reports, manages tasks and reports
to the user. It never reads or edits code, runs builds or tests. Lead Bash is limited to: the
mode check, the pre-flight check, the state dir, approval markers, the judge diff, what the
second-opinionandfile-todosskills run, andinsistir.py. - Fresh agent per phase. Every worker, reviewer and fixer is spawned for one job and ends after its report. Nothing is reused or resumed across rounds.
- Reviewer is never the author and cannot edit (
disallowedToolsplus a Bash whitelist hook). Its evidence is the code and the checks it runs, not the worker's report. - Acceptance criteria are the contract. Paste them verbatim into every prompt.
- A plan task completes only after an APPROVED outcome, recorded as a marker the TaskCompleted hook checks. Never write a marker to unblock the gate.
- Round budget:
max_review_rounds(default 2, per-task override). Exhausted = failed. - The judge never blocks the run. Unavailable judge → reviewer verdict stands, recorded.
Modes (Phase 0 picks one)
- team: agent teams enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) and an interactive session. Every session has one implicit team; there is nothing to create or delete. Launch a teammate with the Agent tool,name+subagent_type+prompt. Teammates report with SendMessage toteam-lead; after each report send that teammateshutdown_requestand wait for itsshutdown_response. - subagent: teams off or a non-interactive session (
claude -pnever spawns teammates). The same crew runs as plain subagents: Agent tool withsubagent_type+prompt, noname. Spawn a whole wave in one message so it runs in parallel; each agent's final message is its report; no shutdown step. The reviewer Bash hook still applies (it keys on the agent type). Lost: live teammate messaging; the lead waits for each wave to finish.
Every prompt ends with a Report: line: SendMessage to team-lead (team) or final message
(subagent). Prompts: references/spawn-prompts.md.
Crew
| Role | subagent_type | Can | Returns |
| Worker, fixer | jaiskills:insistir-worker | edit, any Bash, web; no TaskCreate/TaskUpdate/TaskList | commit SHA + files |
| Reviewer | jaiskills:insistir-reviewer | read, whitelisted Bash; no Edit/Write | verdict JSON (APPROVED/REVISE) |
| Researcher | jaiskills:insistir-researcher | read, web | findings with [fetched: URL] labels |
| Learnings researcher | jaiskills:insistir-learnings-researcher | read docs/solutions/ | ranked past solutions JSON |
| Judge | not spawned: Skill second-opinion, judge mode | read-only Codex | scored verdict JSON + band |
All crew agents default to opus; a plan task's model overrides it (Agent model). If a
jaiskills:insistir-* type is unknown (skill installed without the plugin), read
references/crew-fallback.md and spawn general-purpose instead.
Run state
~/.claude/insistir-state/${CLAUDE_SESSION_ID}/, written <state> below and in the references
(they cannot expand the variable; this line is the real path). Created in Phase 2, removed in
Phase 6. Holds run.json (topic, plan path, mode, start time), allowed_commands.txt (extra
command prefixes reviewers may run) and <key>.approved markers, <key> being the plan id with
chars outside [A-Za-z0-9_-] replaced by _ (T3, T1_2).
Both plugin hooks no-op outside a run: the completion gate acts only on T<N>: tasks completed in
a session whose <state> exists; the Bash filter acts only on insistir-reviewer agents and reads
allowed_commands.txt from every active state dir. When a hook blocks unexpectedly, read
references/edge-cases.md.
Phase 0: Mode and intake
- Check the mode:
echo "teams=${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-0} entrypoint=${CLAUDE_CODE_ENTRYPOINT:-unknown}"teams=1, interactive → team mode.teamsnot 1, interactive → tell the user: "Agent teams are off: setCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1(settings.jsonenv, or export it) and restartclaude." Offer to continue now in subagent mode, or stop.- Non-interactive (
entrypointissdk-cli,sdk-tsorsdk-py, or AskUserQuestion is unavailable) → subagent mode, no questions or confirmations: scope from the task line, defaults (2 rounds, judge on, no deepening, no TODO files); say so in the first output line.
- Intake with AskUserQuestion (interactive only). Never assume scope, constraints or priorities.
- Scope: what is in and out.
- Priorities: speed, quality, specific features.
- Constraints: stack, patterns to follow, things to avoid.
- Preferences: number of workers;
max_review_rounds(1 = any REVISE fails the task, fits well-specified simple work; 2 = one fix attempt, default; 3 = two, for complex tasks); models; judge on/off (cross-provider needs the Codex CLI logged in, otherwise it degrades to a same-provider judge); file findings astodos/files (yes/no).
Phase 1: Plan (the lead may still read code here)
- Pick
<topic>:[a-z0-9-]only, e.g.auth-reset(it names the plan file). - Research the codebase (architecture, patterns, dependencies) and the docs of external libraries it touches.
- If
docs/solutions/exists (Glob), spawn ajaiskills:insistir-learnings-researcherwith the task keywords. Skip it when the directory is absent. - Write
<topic>-plan.mdfrom references/plan-template.md: every task declaresdepends_on,location,description,acceptance_criteria,validation,status, and optionalmodelandmax_review_rounds. Maximize parallel waves. - Render the waves as box-drawing ASCII (example in the template) and get the user's approval.
- Offer deepening: "Deepen the plan with parallel researchers (framework docs, best practices, edge cases)? Takes a few minutes." Skip for internal-only or already detailed plans. If accepted, read references/deepen-plan.md and follow it.
- Validate and compute waves (stdlib only;
python3works whereuvis missing):uv run --script "${CLAUDE_SKILL_DIR}/scripts/insistir.py" validate <topic>-plan.md uv run --script "${CLAUDE_SKILL_DIR}/scripts/insistir.py" waves <topic>-plan.md - Spawn a
Plansubagent to review the plan for missing dependencies, ordering errors and gaps. Revise and re-validate if it finds any.
Phase 2: Run setup
- Pre-flight:
git diff --name-only HEAD. Non-empty output → stop and ask the user to commit or stash: parallel workers share the working tree. Untracked files are fine. - State dir. The
findclears markers left by an earlier attempt in a resumed session (same session id), which would pre-approve tasks.mkdir -p ~/.claude/insistir-state/${CLAUDE_SESSION_ID} find ~/.claude/insistir-state/${CLAUDE_SESSION_ID} -maxdepth 1 -name '*.approved' -delete printf '{"topic":"%s","plan":"%s","mode":"%s","started":"%s"}\n' "<topic>" "<absolute plan path>" \ "<team|subagent>" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > ~/.claude/insistir-state/${CLAUDE_SESSION_ID}/run.json printf '%s\n' "<validation command prefixes from the plan, one per line>" \ > ~/.claude/insistir-state/${CLAUDE_SESSION_ID}/allowed_commands.txt - TaskCreate one task per plan task, subject exactly
T<N>: <name>(the gate keys on it); set dependencies with TaskUpdateaddBlockedBy. No TaskCreate/TaskUpdate in this session → track status in the plan file only and recordcompletion gate: not appliedfor the summary. Delegate mode starts now.
Phase 3: Execute a wave
- Record
git rev-parse HEAD(the base for the judge diff), then spawnworker-t<N>(jaiskills:insistir-worker) for every unblocked task per the mode, with the worker prompt. - Each worker implements, runs its validation, commits only its paths (never pushes) and reports its commit SHA and files. Team mode: shut each worker down as its report lands. Every worker of the wave must be done before review starts.
Phase 4: Review loop (per task, round R = 1..max_review_rounds)
- Review. Spawn
reviewer-t<N>-r<R>(jaiskills:insistir-reviewer) with the reviewer prompt; all reviewers of the wave at once. Team mode: shut it down once its JSON arrives. Take theverdictfield; a report that is not valid JSON counts as REVISE. - Judge. Skip it only when the task is trivial (single file or config edit) AND the reviewer
APPROVED with every check passing: record
judge: skipped (trivial). Always judge multi-file, cross-cutting or security-sensitive tasks, any REVISE or borderline verdict, and every task that produces citation-bearing content (Source:lines, reference guides, routing tables): same-family reviewers check coherence, not correspondence, and miss citation drift. Get the diff withgit diff <base>..HEAD -- <task files>, then call the Skill tool withsecond-opinion, args starting with the wordjudge(anything else runs advise mode), followed by the task spec, the acceptance criteria verbatim, the diff (or its range and paths when large), the check results from the reviewer'schecks, and the reviewer's JSON verbatim. Never pass the worker's reasoning or self-assessment. It returns the verdict JSON (verdict,score1-5 recomputed, per-criterion scores,findingswithseveritycritical|major|minor,file,line), the provider label and the band: auto-approve = verdict APPROVED, score ≥ 4.0, no critical or major finding; auto-revise = score < 2.5 or any critical or major finding (major = an unmet acceptance criterion); middle = the rest. Recordsame-provider fallbackwhen present. Keep every judge finding for the summary, whatever the band. Skill call fails twice in the session → stop judging, recordjudge: unavailable. Decide by the band second-opinion returns, never by the verdict string alone:
Reviewer Judge band Outcome APPROVED auto-approve, or skipped/unavailable APPROVED APPROVED auto-revise REVISE; judge findings go to the fixer APPROVED middle APPROVED; reviewer breaks the tie, judge findings go to the summary as follow-ups REVISE any REVISE; reviewer findings plus judge findings go to the fixer - Act. TODO filing (user opted in) means: call the Skill tool with
file-todosto file the findings as pending TODOs taggedinsistir,<topic>,T<N>, mapping P0/P1 →p1, P2 →p2, skipping P3; judgecritical/major→p1,minor→p2.- APPROVED: write the marker, TaskUpdate the task to completed, log it in the plan.
If TODOs were filed for the task, call the Skill tool withecho "APPROVED by reviewer-t<N>-r<R> + judge <band|skipped|unavailable> $(date -u +%Y-%m-%dT%H:%M:%SZ)" \ > ~/.claude/insistir-state/${CLAUDE_SESSION_ID}/<key>.approvedfile-todosto markcompleteeach one the fixer reported as applied, with the Work Log line<date>: fixed by fixer-t<N>-r<R> in <commit SHA>; approved in round <R+1>. TODOs the fixer rejected stay pending with a Work Log line quoting its reason. - REVISE with R < max: file TODOs if opted in. Spawn
fixer-t<N>-r<R>(jaiskills:insistir-worker, fixer prompt with the reviewer JSON and judge findings); team mode: shut it down when it reports. Start round R+1 with a fresh reviewer. - REVISE with R = max: file TODOs if opted in. Mark the task failed, log
Exceeded review budget (<R> rounds). Decompose.in the plan, spawn no fixer, tell the user.
- APPROVED: write the marker, TaskUpdate the task to completed, log it in the plan.
- Track every task in one line, e.g.
T1: r1 REVISE (reviewer+judge) → fixer-t1-r1 → r2 APPROVED (judge 4.2 auto-approve). - Step in only on deadlock, unexpected errors or a failed task: report to the user with a decomposition suggestion. Other deviations: references/edge-cases.md.
Phase 5: Next wave
Update the plan's status/log/files fields, run
uv run --script "${CLAUDE_SKILL_DIR}/scripts/insistir.py" status <topic>-plan.md, take newly
unblocked tasks (TaskList or the plan) to Phase 3. Repeat until every task is completed or failed.
Phase 6: Cleanup and report
- Team mode: every teammate should be done. Send
shutdown_requestto any still active; seereferences/edge-cases.mdif one ignores it. Team state is cleaned up when the session ends. - Remove the run state so the completion gate stops applying to this session:
S=~/.claude/insistir-state/${CLAUDE_SESSION_ID} && find "$S" -maxdepth 1 -type f \( -name '*.approved' \ -o -name allowed_commands.txt -o -name run.json \) -delete && rmdir "$S" - Render the execution summary from
references/summary-template.md: mode, per task the outcome,
rounds, judge band or label, every judge finding, failed tasks with decomposition advice,
files changed, and
completion gate: not appliedwhen Phase 2 recorded it. - If the run solved a non-trivial problem (real debugging, a surprising root cause), offer to
document it; on yes, call the Skill tool with
compound-knowledgewith the problem, root cause and fix. Skip the offer for straightforward runs.
References
- references/plan-template.md: writing the plan (Phase 1).
- references/deepen-plan.md: the user accepted plan deepening.
- references/spawn-prompts.md: any spawn (worker, reviewer, fixer, learnings researcher).
- references/crew-fallback.md:
jaiskills:insistir-*agent types are unavailable. - references/edge-cases.md: gate blocks, stale state, non-JSON verdicts, stuck agents, judge failures.
- references/summary-template.md: the final report (Phase 6).
scripts/insistir.py:validate,waves(JSON),statusfor a plan file.
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.

