CtrlK
BlogDocsLog inGet started
Tessl Logo

dynamic-workflow-forge

This skill should be used when the user asks to create, review, save, or validate Claude Code dynamic workflows, asks to use the Workflow tool, mentions ultracode, /workflows, saved workflows, background workflow runs, resumable workflow orchestration, or needs to distinguish dynamic JavaScript workflows from workflow-forge static slash-command workflows.

SKILL.md
Quality
Evals
Security

Dynamic Workflow Forge

Forge or review Claude Code dynamic workflows: JavaScript orchestration scripts that coordinate many subagents in the background, keep intermediate state in script variables, and return one consolidated result. Use this skill for large-scale audits, migrations, cross-checked research, and adversarial review patterns where the orchestration itself must be readable, repeatable, and resumable inside the same Claude Code session. [DOC]

Do not use this skill for static slash-command workflow definitions. If the target is a Markdown command, .claude/commands/*.md, or a phase-map prompt without the Agent SDK Workflow tool or dynamic JavaScript runtime, route to workflow-forge instead. [EXPLICIT]

Required Inputs

  • Task objective, target paths or corpus, and expected final report or change.
  • Scale signal: approximate file count, issue count, source count, or agent fan-out need.
  • Runtime gate: Claude Code version, surface, provider route, and whether dynamic workflows are enabled.
  • Risk controls: approval mode, tool allowlist, max spend or slice-first budget, model routing, and file-edit boundaries.
  • Reuse target: one-off run, saved project workflow, or saved personal workflow.

Core Decision

Choose a dynamic workflow only when code-held orchestration is the advantage.

CandidateUse whenAvoid when
SubagentA few focused workers can report summaries back to the main sessionDozens of workers, loop state, or resumable fan-out is required
SkillReusable instructions or a procedure should load on demandRuntime branching and intermediate state must live outside context
Agent teamPeer sessions need to discuss and coordinate through a shared task listA script can coordinate fixed fan-out more cheaply and repeatably
Dynamic workflowA JavaScript script should own phases, loops, branching, and cross-checkingThe deliverable is a static command, checklist, or small delegation

Forge Procedure

1. Gate the Runtime

  • Require Claude Code v2.1.154 or later for dynamic workflows.
  • Require Agent SDK v0.3.149 or later when authoring or invoking the Workflow tool from SDK code. coverage_gap [INFERENCIA]: este número de versión y los helpers agent()/parallel()/pipeline() NO están documentados en code.claude.com/docs/en/workflows (2026-06-20); confirmar contra release notes o el repo del Agent SDK antes de depender de ellos.
  • Confirm the provider or plan route: paid Claude Code plan, Anthropic API, Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry.
  • Confirm workflows are not disabled by /config, disableWorkflows, managed settings, or CLAUDE_CODE_DISABLE_WORKFLOWS=1.
  • Confirm ultracode only when the selected model exposes xhigh effort.

2. Classify the Run Shape

  • Use direct opt-in when the user says "use a workflow", "run a workflow", or includes ultracode.
  • Use /effort ultracode only when every substantive task in the session should be eligible for workflow planning.
  • Use saved workflows when the same orchestration should recur; save from /workflows to .claude/workflows/ for project reuse or ~/.claude/workflows/ for personal reuse.
  • Use args for saved workflow input such as paths, issue IDs, source lists, or review criteria.

3. Design the Script Contract

  • Make the script coordinate agents; do not put direct shell or filesystem work in the workflow script itself.
  • Keep intermediate evidence, votes, and retry state in script variables.
  • Cap concurrency at 16 agents or lower and cap total agents well below 1,000.
  • Split stages that need human sign-off into separate workflows because mid-run user input is not available except permission prompts.
  • Add /workflows management notes: view phase progress, inspect agents, pause or resume with p, stop with x, restart an agent with r, and save with s.

4. Add Cross-Checks

  • Use independent agents for discovery slices, then separate verifier agents for adversarial review.
  • Require each high-impact claim or proposed change to survive at least one independent check.
  • For research workflows, require source-backed claim voting before synthesis.
  • For code workflows, require targeted tests, static checks, or reviewer votes before final edits are reported as ready.

5. Control Cost and Failure

  • Start with a narrow slice before whole-repo or whole-corpus runs.
  • Route lower-risk phases to smaller models when acceptable; reserve the strongest model for synthesis, architecture, or adversarial judgment.
  • Pre-approve known-safe tools before long background runs; unallowlisted shell, web, or MCP calls can still prompt or fail depending on surface.
  • Make resume scope explicit: paused runs can resume in the same session, but a new Claude Code session starts the workflow fresh.

Deterministic Validator

Use scripts/compile-dynamic-workflow-forge.py when a structured workflow spec must be validated or rendered reproducibly.

Run desde la raíz del skill (las rutas son relativas a ese directorio):

cd "$CLAUDE_PLUGIN_ROOT/skills/dynamic-workflow-forge"
python3 scripts/compile-dynamic-workflow-forge.py \
  --input scripts/fixtures/dynamic-security-audit.json \
  --output /tmp/dynamic-security-audit.md

Load assets/dynamic-workflow-policy.json for local gate rules, assets/dynamic-workflow-schema.json for the structured spec shape, and references/domain-knowledge.md for detailed routing guidance.

Output Requirements

  • State whether the result is a dynamic workflow, a saved workflow, or a validation report.
  • Include runtime/provider gates, orchestration phases, subagent roles, cross-check pattern, /workflows controls, save location, limits, cost controls, and static-workflow boundary.
  • Mark missing runtime facts as coverage_gap instead of assuming availability.
  • Keep any produced workflow script reviewable before launch and explicit about permissions.

Validation Gate

  • Dynamic-workflow route is justified over subagents, skills, teams, and workflow-forge.
  • Claude Code and SDK version gates are stated when relevant.
  • Provider, plan, and disable-setting gates are checked or marked coverage_gap.
  • Script contract coordinates subagents and excludes direct shell/filesystem work from the script body.
  • /workflows management, saved workflow locations, args, resume scope, and background behavior are covered.
  • Agent counts respect 16 concurrent and 1,000 total limits.
  • Cross-check or adversarial review pattern is present for high-impact work.
  • Cost controls include slice-first execution and model-routing guidance.
  • Static slash-command workflows are routed to workflow-forge.

Reference Files

PathUse
references/domain-knowledge.mdDetailed workflow routing, official behavior, limits, and edge cases
references/official-source-map.mdSource URLs and checked-date notes
assets/dynamic-workflow-policy.jsonOffline validator policy
assets/dynamic-workflow-schema.jsonStructured spec shape
assets/workflow-tool-contract.mdWorkflow tool field guide and launch contract
scripts/compile-dynamic-workflow-forge.pyDeterministic spec validator and renderer
scripts/check.shLocal positive and negative fixture check

Related katas (toolkit)

  • katas-deterministic-agent-loop
  • katas-prefix-caching
  • katas-session-resume-fork

Contract

  • Aceptación: workflow JS determinista, resumible, con estado en script y fan-out acotado. [EXPLICIT]
  • Límites: orquesta; la lógica de cada paso vive en agentes/skills. [EXPLICIT]
  • Casos borde: gate de versión Agent SDK; helpers agent()/parallel()/pipeline() no documentados en workflows.md [coverage_gap]. [EXPLICIT]
  • Supuestos: [SUPUESTO] Workflow tool disponible (requiere probe; ver §1 Gate the Runtime). [SUPUESTO]
  • Trade-off: workflow vs equipo/subagente — determinismo y resume a cambio de setup. [EXPLICIT]

Packet

Capas del packet, cargables bajo demanda (disciplina ICM: una capa por vez, nunca todas juntas): references/ guías de profundidad (cargar UNA por etapa) · knowledge/ cuerpo de conocimiento · prompts/ prompts listos · examples/ salida de ejemplo · agents/ subagentes del packet · templates/ plantilla de output · scripts/ automatización local · assets/ recursos estáticos.

Repository
JaviMontano/claude-plugins
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.