agentleFS
pecigonzalopecigonzalo/agent-skills/skills/pattern-orchestration-complex/SKILL.md

pattern-orchestration-complex

Skill0 starsChanged 4 months agoMITView on GitHub

Use this skill whenever a task is complex enough to need phases, approval, and verification, such as touching 4 or more files, the user estimating more than an hour, work spanning sequential phases, or a change carrying architectural, security, or data risk. Runs a plan, approve, execute, verify, summarize workflow with quality gates. Do not use it for simple edits or single-file changes.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep the final summary in chat.

    line 14
  2. Distinctive:

    Commit per task only when the user asked for commits, or the task carried write permission.

    line 15
  3. Distinctive:

    Read the plan delegation template when delegating the planning pass rather than doing it directly.

    line 34
  4. Very specific:

    Do the work directly, or delegate using role-orchestrator guidance.

    line 55
  5. Distinctive:

    Keep read-write delegation serial.

    line 56
  6. Distinctive:

    Run the task's verification.

    line 57
  7. Distinctive:

    Prefer atomic, reviewable changes.

    line 61
  8. Distinctive:

    Run the strongest practical checks for the changed scope:

    line 79
  9. Distinctive:

    If checks cannot run, state why and what should be run instead.

    line 89
  10. Distinctive:

    Before closing complex work:

    line 106
  11. Distinctive:

    Read common orchestration patterns when adapting the workflow to a feature, refactor, or security-hardening project.

    line 120
  12. Distinctive:

    Read orchestration troubleshooting when planning is repeatedly rejected, estimates drift, quality gates fail, or progress context is lost.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Quick Reference

Flow: Plan → Approve → Execute → Verify → Summarize

Rules:

  • Get explicit user approval before modifying files, unless approval was already given.
  • Work one task at a time unless the tasks are read-only and independent.
  • Keep the final summary in chat. Do not create summary files unless asked.
  • Commit per task only when the user asked for commits, or the task carried write permission. Never commit unprompted.

Use when 2+ of these hold: 4+ files, more than 60 minutes, multiple sequential phases, cross-cutting or security-critical changes, data migration, breaking API changes, unclear approach, architectural decisions.

Do not use for: 1 to 3 files under 30 minutes with a clear approach. Delegate those directly.

Host tools: Before delegating in Pi, read the Pi tool mapping and use its native task forms instead of the OpenCode-style Task examples in the templates. If store tools are unavailable, keep the approved plan in TODO descriptions or the conversation and omit store calls. Do not create a substitute plan file unless the user requests one.


1. Plan

Load pattern-task-breakdown and produce the plan. It must include:

  • Goal, assumptions, non-goals, and risks with mitigations.
  • Ordered tasks with dependencies and a runnable verification each.
  • Files and components likely to change.
  • The skills or specialists each task needs.

Read the plan delegation template when delegating the planning pass rather than doing it directly.

For durable plans, load tool-store and persist the plan when the work will exceed 4 hours, when architectural decisions were made, when multiple phases or agents are involved, or when the plan must survive compaction. Store plain task prompts and TODO descriptions, not client-specific tool blocks. pattern-task-breakdown defines the data.prompt_drafts shape; do not improvise it here. See plan persistence for when this applies.

Persisting the plan means that if context is compacted between planning and execution, the agent loads the store item and resumes delegating immediately, with no reconstruction from memory.


2. Approve

Present the plan compactly and wait for explicit approval before modifying any file. If the user already said to proceed, continue and note that the approval was given.

The user may approve as-is, request modifications, change scope, or reject. Revise and re-present rather than proceeding on a partial yes.


3. Execute

For each task:

  1. Mark the TODO item in_progress.
  2. Do the work directly, or delegate using role-orchestrator guidance. Read the task execution delegation template for the call shape.
  3. Keep read-write delegation serial. Parallelize only read-only investigation.
  4. Run the task's verification.
  5. Commit the task atomically, staging only the files this task changed, if the user asked for commits or the task carried write permission. Otherwise leave the change uncommitted and say so. Each commit should represent a working state, which is what makes the history bisect-friendly and any single task revertible.
  6. Mark the TODO done, or record the blocker.

Prefer atomic, reviewable changes. Do not mix unrelated cleanup into a task, because it destroys the ability to roll that task back on its own.

Quality gate after each task:

  • Requirements and success criteria are satisfied
  • Applicable standards were followed
  • Tests are included and passing
  • No obvious errors or security issues
  • Referenced store items were loaded

When the gate fails: re-delegate with targeted feedback once, escalate to a more capable agent once, then split the task or ask the user. Do not advance to the next task on a failed gate.

Between phases: confirm the phase goal was met, update progress, and brief the user.


4. Verify

Run the strongest practical checks for the changed scope:

  • The project's test, build, lint, and docs commands. Check the repo's Taskfile, Makefile, or package.json scripts first rather than guessing the runner.
  • A targeted review pass for security, data, or operational risk.
  • A regression check against the original request, not just against the plan.

Delegate an independent verification pass with role-code-review and role-qa-engineer when the breadth justifies it. Read the final verification delegation template for the call shape.

Final verification catches what per-task gates miss: integration issues, inconsistency across changes, and documentation gaps. Passing tests are not the same as a complete feature.

If checks cannot run, state why and what should be run instead.


5. Summarize

Report in chat:

  • What changed, and the key decisions.
  • Files touched, grouped by area.
  • Verification results.
  • Known limitations, follow-ups, and skipped checks.

Checklist

Before closing complex work:

  • The user-approved scope is satisfied, or the differences are explained
  • TODO items reflect the current state
  • Every delegated result passed its quality gate
  • Full test, lint, and build checks ran, or the gaps are stated
  • Verification evidence is in the final response
  • Follow-up items are documented
  • No summary or planning file was created unless requested

Common Patterns

Read common orchestration patterns when adapting the workflow to a feature, refactor, or security-hardening project.

Troubleshooting

Read orchestration troubleshooting when planning is repeatedly rejected, estimates drift, quality gates fail, or progress context is lost.

Integration with Other Skills

With role-orchestrator: usually loaded from its routing rules when two or more complexity indicators are present. Delegations use the same envelope, so load it directly if this skill is used standalone.

With pattern-task-breakdown: it creates the plan, this skill executes it.

With role-code-review and role-qa-engineer: supply the independent verification pass in step 4.

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.