manus-loop

star 0

Multi-stage Plan→Knowledge→Draft→Review→Refine workflow for high-quality structured deliverables. Use this skill whenever the user asks for a substantial document where structure, domain conventions, and careful self-review matter more than a single-pass draft would deliver. Trigger even when the user does not explicitly request a multi-stage process; if the deliverable is the kind of thing a careful professional would draft in multiple passes, this skill applies. The skill is domain-agnostic by design — for specific domains with dense conventions (legal contracts, medical reports, academic papers, etc.) install a sibling specialization skill that extends this one with a domain reference file. Do NOT trigger for short emails, simple Q&A, code snippets, conversational answers, casual creative writing, or anything under 300 words.

zysilm By zysilm schedule Updated 5/14/2026

name: manus-loop description: "Multi-stage Plan→Knowledge→Draft→Review→Refine workflow for high-quality structured deliverables. Use this skill whenever the user asks for a substantial document where structure, domain conventions, and careful self-review matter more than a single-pass draft would deliver. Trigger even when the user does not explicitly request a multi-stage process; if the deliverable is the kind of thing a careful professional would draft in multiple passes, this skill applies. The skill is domain-agnostic by design — for specific domains with dense conventions (legal contracts, medical reports, academic papers, etc.) install a sibling specialization skill that extends this one with a domain reference file. Do NOT trigger for short emails, simple Q&A, code snippets, conversational answers, casual creative writing, or anything under 300 words."

manus-loop

A multi-stage drafting workflow modeled on the Manus AI agent's planner→knowledge→executor loop. The core insight: substantial documents are produced far better in 4-5 focused passes than in a single shot. This skill enforces those passes through file-based handoffs between phases.

Why this exists

A single-pass LLM draft of a substantial document tends to:

  • Skip structural conventions of the target document type
  • Use prose where tables would be clearer for parallel content
  • Hardcode values, dates, or facts the user never specified
  • Forget hedging language for uncertain claims
  • Mirror the source material's structure too literally instead of restructuring for the target document's purpose
  • Bury the answer or recommendation when the audience needs it upfront

The Manus pattern fixes this by separating planning from knowledge retrieval from execution from review. Each phase has a focused goal and doesn't compete with the others for attention. This skill replicates that pattern as a portable workflow.

Two modes

Mode A: in-session sequential (default). Play all four roles yourself, one after another, with explicit file handoffs. No API key needed.

Mode B: parallel multi-agent via API. If ANTHROPIC_API_KEY is set in the environment, spawn real subprocess Claude instances for each role using scripts/orchestrate.py. More rigorous because each subagent sees only its own focused system prompt with no role-contamination.

Check first:

test -n "$ANTHROPIC_API_KEY" && echo "MODE B available" || echo "MODE A only"

State the chosen mode to the user before starting. For Mode B usage, run python scripts/orchestrate.py --help.

The loop

Work in a dedicated workspace, e.g. /home/claude/manus-work/<task-slug>/. Every phase writes a file; the next phase reads it. File-based handoff is what enforces phase separation.

workspace/
├── todo.md          ← live checklist, updated as you go
├── plan.md          ← Phase 1: structure decomposition
├── knowledge.md     ← Phase 2: domain conventions retrieved and filtered
├── draft.md         ← Phase 3: full draft
├── review.md        ← Phase 4: issues found by adversarial review
└── final.<ext>      ← Phase 5: refined deliverable

Phase 0: triage

Decide: does this task actually benefit from the loop? If the task is conversational, short-form, casual, or doesn't have structural conventions worth respecting, abort the skill and answer normally. The loop has overhead; don't impose it on tasks that don't need it.

If yes, identify the deliverable type in your own words (e.g., "research report", "design document", "internal memo", "policy"). This is a free-form descriptor used to look up domain knowledge in Phase 2.

Phase 1: Plan

Read all user-provided context. Produce plan.md with:

  1. Deliverable type — your descriptor + one-line rationale
  2. Audience — who reads this and what they need from it (one line; surprisingly often skipped, shapes everything else)
  3. Structural outline — numbered section names with one-line purpose each. Use the target document's conventional structure, not the source material's.
  4. Facts the user explicitly provided that must appear in the output
  5. Facts the user did NOT provide that the draft should leave as placeholders rather than invent
  6. Risk areas — places where a single-pass draft would likely fail, specific to this task

Do not draft any actual content in this phase. The output is structure and constraints only.

Phase 2: Retrieve knowledge

Look at plan.md. Find the matching reference file in references/:

  1. Look for a file matching the deliverable type (e.g., if type is "design document", look for design-document.md, technical-documentation.md, or similar)
  2. If no specific match exists, use meta-principles.md (always present, contains the universal patterns)
  3. Sibling skills (like manus-loop-legal) may have added domain-specific references — those take precedence over meta-principles when they match

Then write knowledge.md containing only the rules that apply to this specific task:

  1. Mandatory structural elements for this deliverable type, anchored to the plan's outline
  2. Tabular zones — which parts should be tables (anywhere with parallel-structure content)
  3. Placeholder rules — which fields must be left as placeholders rather than invented
  4. Hedging language — relevant cautionary clauses for uncertain claims
  5. Non-overstepping list — items the user didn't ask about that the draft must NOT silently decide
  6. Calculation rules — any quantitative derivations the executor will need to perform

Filter, don't dump. The reference contains the full pattern catalog; knowledge.md is the task-specific subset.

Phase 3: Draft

Read plan.md AND knowledge.md together. Now write draft.md.

Hard rules during drafting:

  • Every section in plan.md's outline appears, in that order
  • Every tabular zone from knowledge.md renders as a Markdown table
  • Every placeholder rule is honored — use ____ or [TBD] not invented values
  • Hedging clauses are woven in where appropriate, not piled in one spot
  • Nothing from the non-overstepping list appears as a unilateral decision
  • Calculations from knowledge.md are performed and shown

Generate the full draft once these constraints are loaded. The constraints do the work of keeping you on track.

Phase 4: Review

Read draft.md, plan.md, knowledge.md. Adopt an adversarial mindset — you are not the drafter, you are someone hired to find what the drafter missed. Write review.md with:

  1. Structural compliance — did every mandatory element appear in the right order?
  2. Table compliance — was each tabular zone actually rendered as a table?
  3. Placeholder compliance — were any invented values smuggled in?
  4. Hedging compliance — is uncertainty marked where appropriate, and absent where claims are well-supported?
  5. Overstepping audit — did the draft silently decide anything off the non-overstepping list?
  6. Source-mirror audit — did the draft accidentally mirror source material's structure?
  7. Calculation check — re-derive every numeric value from the user-provided inputs; note any mismatch
  8. Audience fit — does the document serve the audience identified in plan.md?
  9. Risk areas flagged in plan.md — were they handled?

For each issue, write: [HIGH/MED/LOW] Section X.Y: <problem> → <suggested fix>. If everything passes, write "No issues found" and skip Phase 5.

Phase 5: Refine

Read draft.md + review.md. Apply every HIGH and MED severity fix. Apply LOW if obvious. Write final.md, or for .docx/.pptx/.pdf output, generate the final file format using the appropriate document skill.

For LOW-severity issues you chose to skip, note them when delivering so the user can decide.

Phase 6: Deliver

Call present_files on the final deliverable (and optionally the workspace files if the user might want to see the planning trail). In your message:

  • One-sentence summary of what was produced
  • Any LOW-severity issues from Phase 4 you chose to skip
  • Any placeholders the user must fill
  • Any judgment calls the user should review

Don't pad with a recap of the document's contents — the user can read the file.

todo.md discipline

Create todo.md at the start of Phase 1. Update it after each phase. Format:

# Task: <one-line description>
# Mode: A (in-session) | B (multi-agent)
# Deliverable type: <type>

- [x] Phase 0: triage — deliverable type identified
- [x] Phase 1: plan.md written
- [ ] Phase 2: knowledge.md written
- [ ] Phase 3: draft.md written
- [ ] Phase 4: review.md written
- [ ] Phase 5: final.<ext> written
- [ ] Phase 6: delivered to user

## Decisions log
<append running decisions here>

## Issues parked for user
<placeholders and judgment calls to surface in the delivery message>

If you're not updating todo.md, you've drifted from the loop.

Mode B specifics

When ANTHROPIC_API_KEY is set, prefer Mode B. Usage:

python scripts/orchestrate.py \
  --task "<one-line task description>" \
  --context-files "/path/to/source1.pdf,/path/to/source2.md" \
  --user-requirements "<the user's specific asks>" \
  --workspace /home/claude/manus-work/<slug> \
  --deliverable-type "<free-form descriptor, e.g. 'design-document'>"

orchestrate.py runs planner → knowledge → executor → reviewer → executor (round 2) via separate Claude API calls. Each subagent has only its own system prompt — no cross-contamination.

The --deliverable-type value is used to look up a matching reference file. If references/<type>.md exists, it's used; otherwise meta-principles.md is used. This means you can drop new reference files into references/ and they'll be picked up automatically — no code changes needed.

If the script fails (no key, rate limit, network), fall back to Mode A automatically.

When NOT to use this skill

  • Conversational answers, short emails, quick summaries
  • Code snippets or single-file scripts
  • Anything under 300 words of expected output
  • When the user explicitly says "just give me a quick draft" or similar
  • Casual creative writing where conventions don't constrain structure
  • Tasks where a sibling specialization skill (e.g., manus-loop-legal) applies more specifically — let that skill trigger instead

For these cases, answer normally without the loop.

Extending with domain references

This skill ships with one reference file: references/meta-principles.md — the universal patterns that apply across all substantive documents.

For a recurring domain need (research reports, business documents, technical specs, etc.), add a file references/<deliverable-type>.md. The orchestrator picks it up automatically when --deliverable-type matches the filename stem.

For more substantial domain specialization (e.g., legal contracts have dense conventions that warrant their own skill), create a sibling skill: copy this one, swap the references, adjust the description for trigger specificity. manus-loop-legal is the canonical example.

Scripts

  • scripts/orchestrate.py — Mode B orchestrator (Anthropic API)
  • scripts/prompts/planner.txt — planner subagent system prompt
  • scripts/prompts/knowledge.txt — knowledge subagent system prompt
  • scripts/prompts/executor.txt — executor subagent system prompt
  • scripts/prompts/reviewer.txt — reviewer subagent system prompt

Assets

  • assets/todo-template.md — copy-paste starting point for todo.md
  • assets/plan-template.md — copy-paste starting point for plan.md
Install via CLI
npx skills add https://github.com/zysilm/manus-loop --skill manus-loop
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator