forge
Multi-phase, multi-model deep analysis workflow for complex problems. This skill should be used when the user wants rigorous, multi-model collaborative analysis: deep research with Opus and PAL MCP consensus (GPT-5.4-Pro + Gemini 3 Pro), strategic planning, Sonnet execution with tests, comprehensive review, and adversarial devil's advocate critique. Invoke explicitly with /forge.
What this skill does
# Forge: Multi-Model Collaborative Workflow
## Overview
Forge applies maximum analytical rigor to complex problems by orchestrating multiple AI models across five sequential phases:
| Phase | Model(s) | Purpose |
|-------|----------|---------|
| 1. Research | Opus + GPT-5.4-Pro + Gemini 3 Pro | Deep analysis and consensus |
| 2. Planning | Opus + GPT-5.4-Pro + Gemini 3 Pro | Strategic plan with validation |
| 3. Execution | Sonnet | Code changes + test execution |
| 4. Review | Opus + GPT-5.4-Pro + Gemini 3 Pro | Comprehensive change review |
| 5. Critique | Opus + GPT-5.4-Pro + Gemini 3 Pro | Devil's advocate analysis |
Each analytical phase (1, 2, 4, 5) uses Opus as orchestrator and builds multi-model consensus via PAL MCP with GPT-5.4-Pro and Gemini 3 Pro. Phase 3 uses only Sonnet for cost-efficient execution.
## Prerequisites
- The current session must be running on Opus (`claude-opus-4-6`)
- PAL MCP server must be running with access to `gpt-5.4-pro` and `gemini-3.1-pro-preview`
- To verify model availability, call `mcp__pal__listmodels` before starting
If PAL MCP is unavailable or a partner model is missing, inform the user and halt. Do not fall back to single-model operation -- the value of Forge comes from multi-model collaboration.
## Workflow
### Phase 1: Deep Analysis & Research
Conduct thorough investigation of the problem before any planning or coding.
**Step 1.1 -- Explore the problem space:**
- Read all relevant files using Glob, Grep, and Read tools
- Understand the current state, architecture, and constraints
- Identify the root cause (if debugging) or core requirements (if building)
- Collect relevant file paths and code snippets for partner model consumption
**Step 1.2 -- Systematic deep analysis:**
Use `mcp__pal__thinkdeep` (for debugging/investigation) or `mcp__pal__analyze` (for architecture/feature analysis) to perform structured multi-step investigation. Pass `relevant_files` with absolute paths to all pertinent source files. Set model to `gemini-3.1-pro-preview`.
**Step 1.3 -- Multi-model consensus on findings:**
Use `mcp__pal__consensus` to gather perspectives from both partner models:
```
models: [
{"model": "gpt-5.4-pro", "stance": "neutral"},
{"model": "gemini-3.1-pro-preview", "stance": "neutral"}
]
```
The consensus step 1 prompt must present:
- The problem statement
- Your investigation findings from steps 1.1 and 1.2
- Specific questions: what aspects were missed, alternative root causes or approaches, additional constraints or risks
**Step 1.4 -- Synthesize the research brief:**
Combine Opus analysis with consensus output into a research brief containing:
- Problem statement and context
- Root cause analysis or requirements analysis
- Key constraints and risks
- Areas of agreement and disagreement across models
- Recommendations for the planning phase
Hold the research brief in context for Phase 2.
---
### Phase 2: Strategic Planning
Create a detailed execution plan validated across all three models.
**Step 2.1 -- Draft the plan:**
Based on the Phase 1 research brief, create a structured plan covering:
- Specific files to create, modify, or delete (with descriptions of each change)
- Order of operations and dependencies between changes
- Test strategy: which tests to run, what to verify, expected outcomes
- Rollback approach if changes break existing functionality
**Step 2.2 -- Validate with multi-model consensus:**
Use `mcp__pal__consensus`:
```
models: [
{"model": "gpt-5.4-pro", "stance": "neutral"},
{"model": "gemini-3.1-pro-preview", "stance": "neutral"}
]
```
The consensus step 1 prompt must present the full plan and ask each model to:
- Identify gaps, missing steps, or overlooked dependencies
- Flag potential risks, edge cases, or failure modes
- Suggest improvements or alternative approaches
- Rate confidence in the plan's completeness (1-10)
**Step 2.3 -- Refine the plan** based on consensus feedback. Address every concern raised or explicitly document why a suggestion was not incorporated.
**Step 2.4 -- Present the plan to the user for approval.**
Display the final plan clearly and wait for explicit user approval before proceeding. If the user requests changes, iterate (repeating consensus validation if changes are substantial). Do NOT proceed to Phase 3 without approval.
---
### Phase 3: Execution
Spawn a Sonnet agent to execute the approved plan.
**Step 3.1 -- Capture pre-execution state:**
Run `git stash list && git status && git log --oneline -5` to record the
baseline state before execution begins.
**Step 3.2 -- Spawn the Sonnet executor:**
Use the Task tool:
```
subagent_type: "general-purpose"
model: "sonnet"
mode: "bypassPermissions"
```
The Task prompt must include:
1. The complete approved plan from Phase 2 (verbatim)
2. Clear instruction to execute each step in the specified order
3. Instruction to run the specified tests after making changes
4. Instruction to report back with:
- Summary of every file changed and what was done
- Full test output (pass/fail for each test)
- Any deviations from the plan and why they were necessary
- Any issues, warnings, or concerns encountered during execution
**Step 3.3 -- Collect results:**
When the Sonnet agent completes, capture its full report. Run `git diff` to independently verify what changed. Hold both the agent report and the diff in context for Phase 4.
---
### Phase 4: Comprehensive Review
Perform thorough review of all changes made during execution.
**Step 4.1 -- Gather the diff:**
Run `git diff` (or `git diff HEAD~N..HEAD` if changes were committed) to capture all modifications. Also run any tests specified in the plan to independently verify results.
**Step 4.2 -- Structured code review:**
Use `mcp__pal__codereview` for systematic review:
- Set `model` to `gemini-3.1-pro-preview`
- Set `review_type` to `full`
- Include the diff via `relevant_files` (pass the changed file paths)
- In the step narrative, cover: correctness, security, performance, architecture, and test coverage
**Step 4.3 -- Multi-model review consensus:**
Use `mcp__pal__consensus`:
```
models: [
{"model": "gpt-5.4-pro", "stance": "neutral"},
{"model": "gemini-3.1-pro-preview", "stance": "neutral"}
]
```
The consensus step 1 prompt must include:
- The full diff of changes
- The Sonnet executor's report (deviations, test results)
- The Phase 2 plan for comparison
- Ask each model to evaluate:
- Correctness of the implementation
- Security vulnerabilities (OWASP top 10)
- Performance implications
- Whether changes match the plan and original intent
- Regressions or unintended side effects
- Test coverage adequacy
**Step 4.4 -- Compile review report:**
Synthesize Opus analysis with codereview output and consensus into a review report organized by category (correctness, security, performance, architecture, test coverage). Note severity for each finding.
Hold the review report in context for Phase 5.
---
### Phase 5: Devil's Advocate Critique
Apply aggressive critical analysis to find problems the review missed.
**Step 5.1 -- Adversarial self-analysis (Opus):**
Deliberately adopt a hostile critic's perspective. Assume the code has hidden bugs, the review was too lenient, and important edge cases were missed.
Examine:
- Every conditional branch: what if the other path is taken?
- Every external call: what if it fails, times out, or returns unexpected data?
- Every assumption: what if it's wrong?
- Concurrency: are there race conditions or deadlocks?
- Error propagation: are errors swallowed or mishandled?
- The review itself: did reviewers agree too readily? What did they not check?
**Step 5.4 -- Adversarial multi-model consensus:**
Use `mcp__pal__consensus` with adversarial stances:
```
models: [
{
"model": "gpt-5.4-pro",
"stance": "against",
"stance_prompt": "You are a hostile code reviewer. Find every possible
flaw, vulnerability, edge case, race condition, and design mistake in
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.