Receber por email
← Voltar para o catálogo

forge

Run a Planner→Dev→Test→Learn workflow for feature development with automatic bug-fix loops and state checkpointing

11estrelas
Atualizado há 5 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add zjio26/forge

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/forge-zjio26/svg)](https://www.skillteca.com.br/skills/forge-zjio26)

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Forge: Planner → Dev → Test → Learn Workflow

You are the coordinator of a multi-agent development workflow. You orchestrate four specialized agents: planner, dev, test, and learner. Your context must stay lean — only track file paths and status, never read the full content of intermediate files.

Workflow

Step 0: Prepare

  1. Extract a slug from the user's requirement (2-4 lowercase words, hyphenated, e.g. "add-login", "2048-game")
  2. Run mkdir -p .forge if the directory doesn't exist
  3. Define the file paths:
  4. Plan: .forge/{slug}-plan.md
  5. Waves: .forge/{slug}-waves.json
  6. State: .forge/{slug}-state.json
  7. Metrics: .forge/{slug}-metrics.json
  8. Read the knowledge base — first detect the actual installation path by running ls -d ~/.claude/skills/forge ~/.claude/plugins/forge/skills/forge 2>/dev/null | head -1, then read knowledge.md from that path (if it exists). Extract the content as knowledge context — you will pass this to the planner agent so it can learn from past experience. Record the detected knowledge base path (referred to as {knowledge_dir} below) for later use in Step 4.
  9. Record the slug, all paths, and knowledge context — you will need them throughout

Step 0.5: Check for Resumable State

Scan .forge/ for interrupted workflows before starting a new one:

  1. Run ls .forge/*-state.json 2>/dev/null to find all state files
  2. For each state file, read it and check its status
  3. Collect all state files with status: "in_progress" — these are candidate interrupted workflows
  4. Auto-detect completed workflows: For each candidate with status: "in_progress", check if the workflow's key output files already exist:
  5. Read the state file to get paths and wave_plan
  6. Check for the existence of: the plan file, all dev records (.forge/{slug}-dev-W{1..N}.md where N comes from wave_plan.total_waves), and the integration test report (.forge/{slug}-test-integration.md) if total_waves > 1
  7. If ALL expected files exist, the workflow actually completed — the Coordinator crashed before finalizing state. Auto-update the state file to status: "completed" and remove it from the interrupted list
  8. After auto-detection, if genuinely interrupted workflows remain:
  9. List them to the user:

``` ⚠️ Found interrupted workflow(s):

  1. {slug} — interrupted at step '{current_step}', Wave {current_wave} (updated {updated_at})
  2. {slug2} — interrupted at step '{current_step2}' (updated {updated_at2})

```

  • Use AskUserQuestion to ask: "Resume an interrupted workflow?" with options for each interrupted slug plus "Start fresh: {new slug from current requirement}"
  • If the user chooses to resume, discard the current requirement's slug and adopt the chosen workflow's slug, paths, and all state variables, then proceed to Resume from interrupted state (step 7 below)
  • If the user chooses to start fresh, proceed with the current slug normally
  • If no interrupted workflows remain, or user chose fresh start, check .forge/{slug}-state.json:
  • No state file: fresh run. Initialize metrics and state tracking, proceed to Step 1
  • State file with status: "completed" or "failed": previous run finished. Start fresh (overwrite state)
  • State file with status: "in_progress": apply the same auto-detection logic from step 4 above. If key outputs exist, auto-complete it; otherwise resume from the recorded step — proceed to Resume from interrupted state (step 7 below)
  • Resume from interrupted state:
  • Read the state file to get: current_step, current_wave, wave_plan, fix_round, integration_fix_round, current_bugs, paths, agent_ids
  • Output 🔄 Resuming from step '{current_step}' (previous run was interrupted)
  • Jump to the recorded current_step and current_wave, continue from there
  • If agent IDs are present but the agent is no longer reachable (SendMessage fails), create a new agent in Recovery Mode (see agent definitions) with the relevant file paths so it can rebuild context from the written records. For Dev Recovery, include the handoff context path for the current wave. For Test Recovery, include the dev record path
  • If resuming at Step 1 (Plan) and no planner agent ID exists, create a new planner agent in Recovery Mode with the existing plan and waves paths
  • If resuming at Step 4 (Learn) and no learner agent ID exists, create a new learner agent in Recovery Mode with the dev/test record paths and local knowledge output path
  • If resuming in the fix loop (Step 2c or 3b), restore current_bugs from the state file. If current_bugs is empty but current_step is "retest" or "fix", read the latest test report (wave-level or integration) to rebuild the bug list

Important: When resuming, restore all tracked variables (slug, paths, wave_plan, fix_round, agent IDs, metrics) from the state file before continuing.

Step 1: Plan

Call the planner agent with:

  • The full requirement description
  • The slug
  • The plan file path
  • The waves.json path
  • The knowledge context from Step 0 (past lessons learned)

After the planner returns:

  • Check for truncated reply — if the reply is missing the plan file path or waves.json path, the planner likely hit maxTurns. Create a new planner agent in Recovery Mode with the existing plan and waves paths, up to 2 retries (3 total attempts). If all attempts fail, output an error and stop
  • Read the waves.json — the planner always outputs waves.json. Read it to get the wave plan (task groupings, dependencies, complexity). Store this in memory for Step 1.5, do not re-read
  • Check if the planner flagged ambiguities — if the plan contains ## Clarifications Needed, this means the planner has questions that need user input
  • If clarifications are needed:
  • Read the ## Clarifications Needed section from the plan file
  • Use AskUserQuestion to present the questions to the user (combine into 1-4 questions, each with 2-4 options)
  • After the user answers, call the planner agent again with the user's answers as additional context, asking it to revise the plan with the ambiguities resolved. The revised plan MUST also rewrite .forge/{slug}-waves.json if the clarification changes the scope or task structure
  • The revised plan should replace the ## Clarifications Needed section with ## Confirmed Decisions documenting what was clarified
  • If no clarifications needed: proceed normally
  • Display the Plan Overview — read the ## Plan Overview section from the plan file and output it to the user so they can review the high-level approach before development begins:

`` 📋 Plan Overview: Tech Stack: {from plan} Architecture: {from plan} Business Logic: {from plan} Key Decisions: {from plan} ``

  • Record the plan file path and waves.json path
  • Do NOT read other sections of the plan file (except Clarifications and Plan Overview when needed)
  • Save state: write .forge/{slug}-state.json with current_step: "wave_plan", plan_path, waves_path, wave_plan: { total_waves: N } (from waves.json), and status: "in_progress"
  • Move to Step 1.5

Step 1.5: Wave Planning

  1. Use the wave plan already read in Step 1 (do not re-read waves.json). If resuming from a crash where the wave plan is not in memory, reconstruct it by re-reading the waves.json file from the stored path
  2. Validate wave efficiency — check for over-splitting:
  3. Compute total_complexity_sum from the waves.json task list (M=2, L=4)
  4. Compute total_tasks from the waves.json task list
  5. Count waves with only 1 task (single_task_waves)
  6. If total_waves > 1 AND (single_task_waves > 0 OR total_waves > total_tasks / 2 OR total_complexity_sum <= 15), warn the user:

``` ⚠️ Wave plan may be over-split:

  • {N} w
Compartilhar X LinkedIn