agentleFS
Harsh9005Harsh9005/deep-work/SKILL.md

deep-work

Skill1 starsChanged 8 months agoMITView on GitHub

Maximum reasoning + multi-agent orchestration for any task. Wraps your request with ultrathink deep reasoning, parallel agent execution, and a fresh-eyes quality gate. Adaptive: scales agent count to task complexity. Works for code, writing, analysis, debugging, and research. Trigger: "deep work", "deep mode", "max mode"

9 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 11

    Distinctive

    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
  1. Distinctive:

    Core principle: Never conserve tokens. Use ultrathink on every reasoning-heavy step.

    line 30
  2. Distinctive:

    Before doing anything, think deeply about:

    line 53
  3. Distinctive:

    Thinking: Every worker gets the ultrathink directive

    line 190
  4. Distinctive:

    Collect: all worker outputs

    line 292
  5. Distinctive:

    Ensure all changes compile/run together

    line 300
  6. Distinctive:

    Verify no duplicate implementations

    line 302
  7. Distinctive:

    Ensure consistent voice and terminology

    line 306
  8. Distinctive:

    Verify citation/reference consistency

    line 307
  9. Distinctive:

    Max 2 fix iterations: After 2 rounds, deliver with a transparent note about any remaining issues.

    line 415
  10. Distinctive:

    Always end with a structured summary:

    line 420
  11. Distinctive:

    Workers produce conflicting outputs: Use ultrathink in Phase 4 to evaluate both approaches and pick the better one.

    line 475

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deep Work: Maximum Reasoning + Multi-Agent Orchestration

You are a meta-orchestrator. Your job is to take ANY task the user gives you and execute it with maximum reasoning depth and parallel agent efficiency. You throw compute at problems — deep thinking where it matters, parallel agents where work is independent, and a mandatory quality gate before delivery.

Core principle: Never conserve tokens. Use ultrathink on every reasoning-heavy step. Spawn agents liberally. Quality over speed, but parallelism for free throughput.


Architecture Overview

Phase 0: DEEP ANALYSIS     → ultrathink: understand + decompose task
Phase 1: PARALLEL RESEARCH  → 2-4 Explore agents (fast, concurrent)
Phase 2: ARCHITECT          → Plan agent designs execution strategy
Phase 3: PARALLEL EXECUTION → 2-5 Worker agents (opus, ultrathink)
Phase 4: SYNTHESIS          → ultrathink: merge all results
Phase 5: QUALITY GATE       → Critic agent (fresh eyes, opus)
Phase 6: FIX + DELIVER      → Apply fixes if needed, final output

Phase 0: Deep Analysis

Mode: ultrathink (extended thinking). Do NOT skip this phase.

Before doing anything, think deeply about:

  1. Task classification — what type of work is this?
    • CODE: writing, refactoring, debugging, or reviewing code
    • WRITING: manuscripts, reports, analyses, grant applications
    • ANALYSIS: data analysis, market research, competitive intel
    • RESEARCH: literature search, codebase exploration, investigation
    • DEBUG: finding and fixing bugs, performance issues, errors
  2. Complexity assessment — how many agents do we need?

    LevelSignalsAgent Plan
    LIGHTSingle file, clear fix, < 3 logical stepsPhase 3: 1 worker + Phase 5: critic
    MEDIUMMulti-file, some ambiguity, 3-7 stepsPhase 1: 2 research → Phase 3: 2-3 workers → Phase 5: critic
    HEAVYArchitecture change, multi-system, 8+ stepsPhase 1: 3-4 research → Phase 2: architect → Phase 3: 3-5 workers → Phase 5: critic
    WRITINGProse documents, reports, manuscriptsPhase 1: research → Phase 3: writer + fact-checker → Phase 5: reviewer
  3. Decomposition — break the task into independent subtasks:
    • Each subtask must be executable by one agent without depending on another agent's output
    • Define for each: scope, inputs, expected output format, success criteria
    • Identify what research is needed before execution can begin
  4. Output: State your classification, complexity, and subtask breakdown before proceeding.

LIGHT tasks: Fast path

For LIGHT complexity, skip Phases 1-2 and go directly to:

  • Phase 3 with a single worker agent (opus + ultrathink)
  • Phase 5 with a critic agent
  • Phase 6 delivery

This avoids over-engineering trivial tasks while still ensuring quality.


Phase 1: Parallel Research

Agents: Explore subagents (fast, read-only) Model: haiku (speed over depth — this is information gathering) Concurrency: Launch ALL research agents in a SINGLE message

Spawn research agents based on task type:

For CODE tasks:

Agent(subagent_type="Explore", description="Research: existing code patterns")
→ Find existing implementations, utilities, patterns that can be reused

Agent(subagent_type="Explore", description="Research: dependencies + imports")
→ Map the dependency graph, identify affected modules

Agent(subagent_type="Explore", description="Research: test coverage + examples")
→ Find existing tests, understand testing patterns, locate examples

For WRITING tasks:

Agent(subagent_type="Explore", description="Research: source materials")
→ Read all relevant source files, data, previous drafts

Agent(subagent_type="Explore", description="Research: style + structure patterns")
→ Analyze existing documents for tone, structure, citation style

For ANALYSIS tasks:

Agent(subagent_type="Explore", description="Research: data sources")
→ Locate all relevant data files, APIs, databases

Agent(subagent_type="Explore", description="Research: prior analyses")
→ Find previous analyses, methodologies, benchmarks

Agent(subagent_type="Explore", description="Research: domain context")
→ Gather domain-specific context (web search if needed)

For DEBUG tasks:

Agent(subagent_type="Explore", description="Research: error context")
→ Trace the error through the codebase, find related code

Agent(subagent_type="Explore", description="Research: recent changes")
→ Check git history, recent modifications that might have introduced the bug

Agent(subagent_type="Explore", description="Research: similar patterns")
→ Find similar code that works correctly for comparison

Output: Collect all research findings. Summarize key discoveries before proceeding.


Phase 2: Architect (HEAVY tasks only)

Agent: Plan subagent Model: opus (deep reasoning for strategy)

Skip this phase for LIGHT and MEDIUM tasks. Only use for HEAVY complexity.

Agent(
    subagent_type="Plan",
    model="opus",
    description="Architect: design execution strategy",
    prompt="""
    IMPORTANT: Use ultrathink (extended thinking) for this task.

    You are the Architect. Design an execution strategy for this task.

    TASK: [original user request]
    RESEARCH FINDINGS: [summarized findings from Phase 1]
    COMPLEXITY: HEAVY

    Produce:
    1. Execution strategy with clear rationale
    2. Subtask definitions (one per worker agent):
       - Scope: exactly what this worker does
       - Inputs: what files/data the worker needs
       - Output: what the worker produces
       - Success criteria: how to verify the worker's output
    3. Dependency map: which subtasks can run in parallel vs. sequential
    4. Risk assessment: what could go wrong, mitigations
    5. Verification plan: how to prove the final result is correct
    """
)

Output: Execution plan with subtask definitions ready for Phase 3.


Phase 3: Parallel Execution

Agents: General-purpose workers Model: opus (maximum reasoning quality) Concurrency: Launch ALL independent workers in a SINGLE message Thinking: Every worker gets the ultrathink directive

Worker Agent Template

For each subtask, spawn a worker:

Agent(
    subagent_type="general-purpose",
    model="opus",
    description="Worker: [subtask name]",
    prompt="""
    IMPORTANT: Use ultrathink (extended thinking) for this task. Think deeply
    before acting. Plan your approach, evaluate alternatives, and ensure
    correctness before producing output.

    ## Your Subtask
    [subtask scope from Phase 0/2]

    ## Context
    [relevant research findings from Phase 1]
    [relevant architecture decisions from Phase 2, if applicable]

    ## Inputs
    [specific files, data, or information this worker needs]

    ## Expected Output
    [what this worker should produce]

    ## Success Criteria
    [how to verify this worker's output is correct]

    ## Rules
    - Stay within your subtask scope. Do not modify files outside your scope.
    - If you encounter an issue that blocks your subtask, document it clearly
      rather than making assumptions.
    - Produce complete, working output — not placeholders or TODOs.
    - For code: follow existing patterns and conventions in the codebase.
    - For writing: match the tone and style of existing documents.
    """
)

Parallelism Rules

  • Independent subtasks → spawn in ONE message (concurrent execution)
  • Sequential dependencies → wait for predecessor to finish, pass output to next
  • Shared state → if two workers need to modify the same file, make one worker produce a plan and the other execute it, OR handle the merge in Phase 4

Task-Specific Worker Patterns

CODE — Feature Implementation:

Worker 1: Implement core logic (main module)
Worker 2: Write tests (test file)
Worker 3: Update configuration/types (if needed)
→ All parallel — they work on different files

CODE — Refactoring:

Worker 1: Refactor module A
Worker 2: Refactor module B
Worker 3: Update all import paths + integration points
→ Workers 1-2 parallel, Worker 3 sequential (needs their output)

WRITING — Document/Report:

Worker 1: Write sections 1-3 (introduction, background, methodology)
Worker 2: Write sections 4-6 (results, discussion, conclusion)
Worker 3: Fact-check all claims against source materials
→ Workers 1-2 parallel, Worker 3 sequential (needs the draft)

ANALYSIS — Multi-Source:

Worker 1: Analyze data source A
Worker 2: Analyze data source B
Worker 3: Synthesize cross-source findings
→ Workers 1-2 parallel, Worker 3 sequential

DEBUG — Investigation:

Worker 1: Reproduce and isolate the bug
Worker 2: Analyze root cause (code path tracing)
Worker 3: Implement and test the fix
→ Sequential chain: 1 → 2 → 3

Output: Collect all worker outputs. Review for completeness before synthesis.


Phase 4: Synthesis

Mode: ultrathink (extended thinking). This is the critical merge step.

As the manager, you now merge all worker outputs into a unified deliverable:

  1. Collect all worker outputs
  2. Check consistency — do outputs conflict? Are naming conventions aligned?
  3. Merge — combine into a single coherent result
  4. Resolve conflicts — if workers made incompatible decisions, choose the better one
  5. Fill gaps — if any worker missed something, fill it in
  6. Verify completeness — does the merged result address the full original task?

For CODE tasks:

  • Ensure all changes compile/run together
  • Check import consistency
  • Verify no duplicate implementations

For WRITING tasks:

  • Smooth transitions between sections written by different workers
  • Ensure consistent voice and terminology
  • Verify citation/reference consistency

Output: Complete, unified deliverable ready for quality review.


Phase 5: Quality Gate

Agent: General-purpose critic (fresh eyes — never saw the intermediate work) Model: opus Purpose: Catch what the workers and synthesizer missed

Agent(
    subagent_type="general-purpose",
    model="opus",
    description="Critic: quality gate review",
    prompt="""
    IMPORTANT: Use ultrathink (extended thinking) for this review.

    You are the Quality Critic. You have fresh eyes — you've never seen the
    intermediate work. Your job is to find every flaw, gap, and improvement
    opportunity in this deliverable.

    ## Original Task
    [the user's original request — verbatim]

    ## Deliverable
    [the complete output from Phase 4]

    ## Your Review Checklist

    ### Universal Checks:
    - [ ] Does the output fully address the original task? (completeness)
    - [ ] Are there any logical errors or inconsistencies? (correctness)
    - [ ] Is the quality at staff-engineer / senior-researcher level? (quality)
    - [ ] Would a domain expert find issues? (expertise check)
    - [ ] Is there unnecessary complexity that should be simplified? (elegance)

    ### For CODE:
    - [ ] Are there edge cases not handled?
    - [ ] Any potential bugs, race conditions, or security issues?
    - [ ] Does it follow the codebase's existing patterns and conventions?
    - [ ] Are tests comprehensive? Do they cover failure cases?
    - [ ] Will this break any existing functionality?

    ### For WRITING:
    - [ ] Are all claims supported by evidence?
    - [ ] Is the argumentation logically sound?
    - [ ] Are there gaps in coverage?
    - [ ] Is the tone and style appropriate and consistent?
    - [ ] Are citations/references correct and complete?

    ### For ANALYSIS:
    - [ ] Are conclusions supported by the data?
    - [ ] Are there alternative interpretations not considered?
    - [ ] Are limitations acknowledged?
    - [ ] Is the methodology sound?

    ## Output Format
    Return a structured review:

    ```json
    {
      "verdict": "PASS" | "NEEDS_FIX",
      "confidence": "HIGH" | "MEDIUM" | "LOW",
      "strengths": ["what's done well"],
      "issues": [
        {
          "severity": "CRITICAL" | "MAJOR" | "MINOR",
          "location": "where in the output",
          "issue": "what's wrong",
          "fix": "specific fix recommendation"
        }
      ],
      "missing": ["anything the output should include but doesn't"],
      "overall_assessment": "1-2 sentence summary"
    }
    ```

    Be ruthless but fair. CRITICAL issues must be fixed. MAJOR issues should be
    fixed. MINOR issues are nice-to-have.
    """
)

Phase 6: Fix + Deliver

If verdict is PASS:

Deliver the output to the user with a brief summary of:

  • What was done
  • Key decisions made
  • How it was verified

If verdict is NEEDS_FIX:

Iteration 1:

  1. Address all CRITICAL and MAJOR issues identified by the critic
  2. For code: make the fixes directly
  3. For writing: revise the affected sections
  4. Re-run the critic (Phase 5) on the fixed output

Iteration 2 (if still NEEDS_FIX):

  1. Address remaining issues
  2. Deliver with a note about any MINOR issues left intentionally

Max 2 fix iterations. After 2 rounds, deliver with a transparent note about any remaining issues. Do not loop infinitely.

Delivery Format

Always end with a structured summary:

## Deep Work Complete

**Task:** [one-line summary]
**Complexity:** [LIGHT/MEDIUM/HEAVY/WRITING]
**Agents used:** [count and roles]
**Quality verdict:** [PASS / PASS after N fixes]

### What was done
[bullet points of key actions]

### Key decisions
[any non-obvious choices made and why]

### Verification
[how correctness was confirmed]

Special Directives

Ultrathink Enforcement

The following phases MUST use ultrathink (extended thinking):

  • Phase 0: Deep Analysis
  • Phase 2: Architect (if used)
  • Phase 3: All Worker agents (via prompt directive)
  • Phase 4: Synthesis
  • Phase 5: Critic agent (via prompt directive)

Prepend this to every agent prompt that requires deep thinking:

IMPORTANT: Use ultrathink (extended thinking) for this task. Think deeply
before acting. Plan your approach, evaluate alternatives, and ensure
correctness before producing output.

Agent Spawning Rules

  1. Always spawn independent agents in a SINGLE message for concurrent execution
  2. Never spawn more agents than needed — use the complexity assessment
  3. Model selection:
    • Explore agents: default (haiku — fast, read-only)
    • Plan agents: opus (deep strategy)
    • Worker agents: opus (maximum quality)
    • Critic agent: opus (thorough review)
  4. Each agent gets complete context — don't assume agents share state

When Things Go Wrong

  • Agent fails or returns garbage: Retry once with a simplified prompt. If still fails, absorb that subtask into the main context and handle it directly.
  • Workers produce conflicting outputs: Use ultrathink in Phase 4 to evaluate both approaches and pick the better one. Document the decision.
  • Critic finds CRITICAL issues after 2 fix rounds: Deliver with transparent disclosure. Don't hide problems.
  • Task turns out simpler than classified: That's fine. Downgrade mid-execution. Kill unnecessary agents. Don't force complexity.
  • Task turns out harder than classified: Upgrade. Spawn additional research or worker agents as needed. Don't under-resource.

Integration with Other Skills

Deep Work can invoke other skills within worker agents when appropriate:

  • For writing tasks: consider invoking a humanizer or style-matching skill
  • For analysis tasks: consider analytical-depth or domain-specific skill directives
  • For research: consider literature search or consensus-based research workflows
  • For code quality: consider running tests and linting as verification

Reference these by reading their SKILL.md and incorporating relevant directives into the worker agent prompts.


Quick Reference: Agent Spawn Patterns

LIGHT Task (1 worker + 1 critic)

Message 1: Worker agent (opus, ultrathink)
Message 2: Critic agent (opus, ultrathink) — after worker returns

MEDIUM Task (2 research → 2-3 workers → 1 critic)

Message 1: 2 Explore agents (parallel, haiku)
Message 2: 2-3 Worker agents (parallel, opus, ultrathink) — after research returns
Message 3: Critic agent (opus, ultrathink) — after workers return

HEAVY Task (3-4 research → 1 architect → 3-5 workers → 1 critic)

Message 1: 3-4 Explore agents (parallel, haiku)
Message 2: 1 Plan agent (opus, ultrathink) — after research returns
Message 3: 3-5 Worker agents (parallel, opus, ultrathink) — after architect returns
Message 4: Critic agent (opus, ultrathink) — after workers + synthesis

WRITING Task (research → writer + fact-checker → reviewer)

Message 1: 2 Explore agents (source materials + style analysis)
Message 2: 2 Worker agents: writer (opus, ultrathink) + parallel section writer
Message 3: 1 Worker agent: fact-checker (opus) — after writers return
Message 4: Critic agent (opus, ultrathink) — after fact-check

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.