Memory

orchestrator

Try it

Central entry point of the afonsoft agent harness. Use when starting a new project, resuming an existing one, planning features/Epics/releases, or running any multi-step agent-driven work. Validates and reconciles SPECs (SDD), audits the codebase and harness for gaps (security, architecture, performance, hygiene), proposes improvements, fragments work into GitHub Issues, delegates implementation/QA/review to specialized skills, and re-validates everything until delivery. Also use to review unapproved SPECs, reconcile open GitHub Issues with code, or run a final gap check before closing a release.

What it does

The central control skill for agent-driven projects. It plans, governs, audits, delegates, and re-validates. It never executes complex work directly when a specialized skill exists.

The skill document

Orchestrator

The central control skill for agent-driven projects. It plans, governs, audits, delegates, and re-validates. It never executes complex work directly when a specialized skill exists.

All questions and confirmations directed at the user must be in Portuguese (pt-BR). Internal reasoning and documentation are in English.

When to Use

  • Starting a new project or repository.
  • Resuming an existing project with unclear state.
  • Planning a feature, Epic, or release.
  • Coordinating implementation of a SPEC SDD.
  • Preparing a PR after implementation.

When NOT to Use

  • Do not use when the task is a single, well-scoped code change — use /tdd-spec directly.
  • Do not use when only a code review is needed — use /code-review-and-quality.
  • Do not use when only a bug fix is needed — use /diagnose.

State File

The Orchestrator must read references/ESTADO_ORQUESTRATOR.md at the start of every session and write to it after every phase. This state file persists the DAG, task status, and decisions across sessions. See references/ESTADO_ORQUESTRATOR.md.

Phase -1 — Framework Update

Run this at the start of every Orchestrator session, before project preconditions.

  1. Find where the skills were installed from. For each loaded skill, resolve the real path of the link and locate the catalog clone that contains README.md and SKILL.md.
  2. In the found clone, read origin remote, current branch, and local installed commit.
  3. Check the framework remote with git fetch origin --quiet. Never pull, merge, or reset the framework clone.
  4. Compare local commit with origin/ or the equivalent remote reference.
  5. If there are new commits, report immediately:
Framework update available
- Framework: afonsoft/skills
- Installed: 
- Available: 
- Changes: 
- Action: reinstall the catalog with `npx skills add afonsoft/skills`
  1. If new commits are available, guide the user to reinstall skills with npx skills add afonsoft/skills.
  2. After reinstall, confirm orchestrator and create-agent-harness point to the new revision and report the result.
  3. If no changes, log Framework up-to-date () without stopping the flow.
  4. If the clone, remote, or network cannot be located, log Unable to check framework updates and continue only if local skills are available. Do not reinstall without confirming a new revision.

When a new revision is confirmed, the user must reinstall the skills. That is part of the Orchestrator contract.

Phase 0 — Governance Preconditions

Before creating files or delegating work:

  1. Verify Git is initialized.
  2. Verify a valid GitHub remote exists, preferably origin.
  3. Verify repository access with gh repo view or equivalent.

If the environment is empty, has no Git, or has no GitHub remote, stop the flow and guide the user to:

  1. Create the repository on GitHub;
  2. Initialize the local repository;
  3. Configure the origin remote;
  4. Make the first commit and push;
  5. Return to the Orchestrator.

Never silently replace GitHub with a local tracker. GitHub is the source of traceability, Issues, review, and history for this framework.

Phase 1 — Documentation Provisioning

  1. Invoke /create-agent-harness to generate CLAUDE.md, AGENTS.md (thin reference), .claude/ (settings, rules, agents, memory, context), docs/ (technologies, architecture, decisions), and .specs/.
  2. Invoke /grill-me-with-spec to consolidate domain language and architectural decisions, producing the SPEC SDD in .specs/SPEC-{YYYYMMDD}-{feature}.md before any implementation.
  3. In an empty repository, invoke /scaffold-mvp after domain alignment.
  4. Review and persist documentation and the approved SPEC before starting implementation.

Documentation is not optional: the Orchestrator must leave a state another agent can continue.

Special Case — New Project with Only a PRD in the Folder

When the repository starts from a folder containing only a PRD (no code):

  1. Ensure GitHub repository is initialized with origin configured (Phase 0).
  2. Create and check out a develop branch from the default branch.
  3. Invoke /grill-me-with-spec to turn the PRD into one or more SPEC SDDs in .specs/SPEC-{YYYYMMDD}-{slug}.md, one per Epic or well-delimited area.
  4. Review and approve the SPECs; update Status to Approved on each one.
  5. Based on approved SPECs, open Issues on GitHub using /create-issues (one per Epic, or a master Issue with Epics listed).
  6. Use /create-issues to slice each Epic into atomic Issues (vertical, traceable, with acceptance criteria), recording the mapping .specs/SPEC-*.md → Issue.
  7. Proceed to Phase 4 using the sequential queue described below.

Phase 2 — Audit

Audit the structure produced by create-agent-harness:

[ ] Git initialized
[ ] GitHub remote configured and accessible
[ ] CLAUDE.md (single source of truth) and AGENTS.md (thin reference)
[ ] .claude/settings.json (permissions, hooks, env)
[ ] .claude/rules/global-rules.md and stack-scoped rules/
[ ] .claude/agents/ (review.md, plan.md, test.md)
[ ] .claude/memory/ and .claude/MEMORY.md
[ ] .claude/CONTEXT.md, .claude/RULES.md, .claude/TOOLS.md, .claude/WORKFLOWS.md
[ ] .claude/README.md (harness infrastructure)
[ ] .specs/ for SPEC SDD when features are in flight
[ ] docs/agents/ when domain tracker and labels exist
[ ] docs/adr/ when relevant architectural decisions exist
[ ] Skills installed in the chosen environment

Classify gaps as P1 (security/types), P2 (architecture), P3 (performance), or P4 (hygiene/documentation). To analyze and address gaps, invoke /improve-codebase-architecture.

Phase 3 — GitHub Fragmentation

Approved gaps must be turned into Issues by /create-issues. GitHub is the persistent source of scope, acceptance criteria, dependencies, and status; references/ESTADO_ORQUESTRATOR.md is only the operational view of the DAG.

  1. Pass the gaps, roadmap, and approved documentation to /create-issues.
  2. Present the decomposition for approval when HITL decision is needed.
  3. Publish Issues in dependency order, using real IDs in Blocked by.
  4. Record the mapping Task -> GitHub Issue -> branch/worktree.
  5. Never create a DAG only in memory or only in a local file when the task can be tracked on GitHub.

Phase 4 — Execution Loop

flowchart TB
    subgraph Phase1["Phase 1 - Plan"]
        P1_H[/create-agent-harness/]
        P1_S[/grill-me-with-spec/]
        P1_M[/scaffold-mvp/]
    end

    subgraph Phase2["Phase 2 - Audit"]
        P2_A["Audit gaps"]
        P2_F[/improve-codebase-architecture/]
    end

    subgraph Phase3["Phase 3 - Issues"]
        P3_I[/create-issues/]
    end

    subgraph Slice["Per-Slice Loop"]
        S_R["Read SPEC + Issue"]
        S_T[/tdd-spec/]
        S_C[/code-review-and-quality/]
        S_D[/diagnose/]
        S_V["Verify build / test / lint"]
        S_G[/grill-me-with-spec/]
        S_CM["Commit"]
    end

    subgraph Gate["Phase 5 - QA"]
        G_Q[/qa-analyst/]
        G_R[/code-review-and-quality/]
        G_M[/create-readme/]
        G_P["PR / Merge"]
    end

    P1_H --> P1_S
    P1_S --> P1_M
    P1_M --> P2_A
    P2_A -->|P2 gap| P2_F
    P2_F --> P2_A
    P2_A --> P3_I
    P3_I --> S_R
    S_R --> S_T
    S_T --> S_C
    S_C --> S_V
    S_V -->|green| S_CM
    S_T -->|bug| S_D
    S_D --> S_T
    S_C -->|ambiguous| S_G
    S_G --> S_R
    S_V -->|fail| S_D
    S_CM -->|next slice| S_R
    S_CM -->|Epic done| G_Q
    G_Q -->|approved| G_R
    G_Q -->|fail| S_T
    G_R -->|approved| G_M
    G_R -->|fail| S_T
    G_M --> G_P

The Orchestrator runs sliced Issues in a continuous loop until all SPEC implementations are complete. The focus is small vertical slices, one at a time, with constant re-validation.

General Rules

  • Independent slices may run in parallel in isolated worktrees; slices that change schema, authentication, public APIs, or data require human confirmation.
  • Before each slice, the agent must read the approved .specs/SPEC-{YYYYMMDD}-{slug}.md and the corresponding Issue.
  • After each slice, re-validate: build, tests, lint, type check.
  • Do not move to the next slice while the current one is not green.

Per-Slice Cycle

1. READ         → Approved SPEC + GitHub Issue
2. TDD          → /tdd-spec (red-green-refactor) using acceptance criteria
3. CODE REVIEW  → /code-review-and-quality on the slice diff
4. ARCH         → /improve-codebase-architecture if architecture degrades
5. DIAGNOSE     → /diagnose if a bug or mysterious failure appears
6. CLARIFY      → /grill-me-with-spec if the SPEC is ambiguous
7. VERIFY       → build, tests, lint pass
8. COMMIT       → Conventional commit, reference the Issue
9. LOOP         → Next slice in the queue

Skill Delegation by Situation

SituationSkill
Implement from SPEC/tdd-spec
Review diff before continuing/code-review-and-quality
Bug, regression, or mysterious build failure/diagnose
Degraded architecture / too much coupling/improve-codebase-architecture
Ambiguity in the SPEC/grill-me-with-spec
Create/update Epic Issues/create-issues
Need knowledge of a third-party API/librarymanual / research subagent

Sequential Queue for Epics Sliced from a PRD

When Issues come from the special case "new project with only a PRD" (Phase 1), execution is not parallel: dispatch one agent at a time, in Issue dependency order.

  1. For the current Epic, process its sliced Issues one by one:
    • develop with /tdd-spec;
    • QA (Phase 5);
    • commit;
    • next Issue in the queue. Repeat until all Issues of the Epic are exhausted.
  2. When the Epic is complete, invoke /qa-analyst, then /code-review-and-quality for the accumulated diff, then /drawio-architecture to refresh the system diagram, then /create-readme to reflect what was delivered.
  3. Epic exhausted → open a PR from the working branch to develop.
    • Green PR (CI/tests pass) → merge into develop.
    • Failed PR → fix with /diagnose, re-run verification, then merge.
  4. After the merge, return to the develop branch and advance to the next Epic in the queue, repeating the loop until all PRD Epics are finished.
  5. When all Epics are complete, open the final merge from develop to main.

Phase 5 — Verification and QA

After each slice and at the end of each Epic/DAG:

  1. Run proportional verifications: tests, lint, type check, build.
  2. If it fails, invoke /diagnose before continuing.
  3. When the DAG is complete, invoke /qa-analyst without exception of tier. QA must confront requirements, Issues, implementation, tests, error scenarios, and out-of-scope changes. Failures reopen Issues or create new tasks.
  4. After QA approval, invoke /code-review-and-quality for a final review of the accumulated Epic diff (or set of slices). Quality failures reopen Issues or create new tasks.
  5. After review approval, invoke /drawio-architecture to update or create the system architecture diagram so documentation reflects the delivered structure.
  6. After the architecture diagram is consistent, invoke /create-readme to update README.md with the delivered features, stack, and instructions.
  7. Only after that can delivery by PR occur. If no Git/PR flow skill is installed, describe the steps and ask for human confirmation; never invoke a nonexistent skill.

At the end of the project or release, ensure README.md reflects the current system state.

Skill Call Reference

Phase / SituationSkillWhy it is calledWhat it returns / does
Phase -1 — detect framework updates/orchestrator (self)Compare local installed catalog with remote originReports whether a reinstall is needed
Phase 0 — missing Git / remotemanualCannot proceed without GitHub as source of truthGuides user to create and connect repo
Phase 1 — create harness/create-agent-harnessGenerate CLAUDE.md, AGENTS.md, .claude/, docs/, .specs/Files ready for project governance
Phase 1 — write SPEC/grill-me-with-specConsolidate domain language and architectural decisions.specs/SPEC-{YYYYMMDD}-{slug}.md in Approved state
Phase 1 — empty repo/scaffold-mvpBootstrap stack after domain alignmentInitial project skeleton and README
Phase 2 — architecture gaps/improve-codebase-architectureP2 (architecture) gaps or degraded seamsHTML report with deepening opportunities
Phase 3 — turn work into Issues/create-issuesGaps, roadmap, and approved docs become GitHub IssuesReal GitHub Issue numbers + dependency links
Phase 4 — implement slice/tdd-specApproved SPEC → red-green-refactor sliceWorking code + tests passing
Phase 4 — bug or build failure/diagnoseReproduce, minimise, instrument, fix, regressRoot cause resolved + regression test
Phase 4 — code review per slice/code-review-and-qualityReview diff before next stepRequired changes or approval
Phase 4 — SPEC ambiguity/grill-me-with-specMissing or conflicting requirementUpdated SPEC with new decisions
Phase 5 — QA gate/qa-analystMandatory pre-PR verificationQA approval or new Issues
Phase 5 — final review/code-review-and-qualityAccumulated Epic diff reviewFinal approval or rework
Phase 5 — architecture diagram/drawio-architectureUpdate system diagram after deliverySVG/PNG architecture diagram
Phase 5 — documentation/create-readmeKeep README.md in sync with deliveryUpdated README

Decision Tree

  1. Does the SPEC exist and is Approved?
    • No/grill-me-with-spec.
  2. Is there a P2 architecture gap?
    • Yes/improve-codebase-architecture.
  3. Is the work tracked on GitHub?
    • No/create-issues.
  4. Did a test fail or build break?
    • Yes/diagnose.
  5. Is the code written but not reviewed?
    • Yes/code-review-and-quality.
  6. Is the Epic done and tests green?
    • Yes/qa-analyst/code-review-and-quality/create-readme → PR.

References

  • references/orchestrator-delegation-protocol.md — autonomy matrix, risk tiers, and delegation protocols.
  • references/ESTADO_ORQUESTRATOR.md — operational state file for the session DAG.
  • /create-agent-harness — for generating the project harness
  • /grill-me-with-spec — for authoring the SPEC SDD
  • /scaffold-mvp — for bootstrapping a new project
  • /create-issues — for turning work into GitHub Issues
  • /improve-codebase-architecture — for analyzing and fixing architecture gaps
  • /tdd-spec — for test-driven implementation from the SPEC
  • /code-review-and-quality — for reviewing diffs
  • /diagnose — for debugging regressions and bugs
  • /qa-analyst — for the mandatory QA gate
  • /create-readme — for keeping README in sync

Related skills

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván555 installs18 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván854 installs69 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Query and manage Linear issues, projects, teams, cycles, labels, and comments through a managed OAuth GraphQL endpoint.

by byungkyu518 installs18 stars

Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.

by Iván532 installs31 stars

More from afonsoft

Browse all skills

Single owner of everything under docs/architecture/ — ADRs, architecture and design documents, and architecture diagrams. Routes each deliverable to the right engine: /mermaid-architecture for Markdown-native diagrams, /drawio-architecture for editable .drawio diagrams, and the optional third-party archify skill for interactive standalone HTML diagrams (installed on demand via `npx skills add tt-a1i/archify`, only with explicit user approval). Use whenever architecture documentation, ADRs, or architecture diagrams must be created or updated.

by Iván

Use when building a new MCP server in TypeScript, Python, or C# that exposes tools to LLMs.

by afonsoft2 installs

Use when the user asks to connect an AI agent to external apps via Composio, or when Composio CLI or MCP setup fails.

by afonsoft2 installs

Use when initializing or migrating an AI agent harness in a repository.

by afonsoft1 installs

Use when turning approved plans, specs, PRDs, or Epics into trackable GitHub Issues.

by afonsoft1 installs

Use when generating or editing draw.io/diagrams.net architecture diagrams via MCP or native XML.

by afonsoft1 installs