graph-protocol
Generated at build time from
skills/graph-protocol/SKILL.md. Do not edit this page directly.
Graph Protocol is orchestration only.
It decides:
who does whatwhat depends on whatwhat may run in parallelwhat context crosses each edgehow worker claims are verifiedwhen the graph must be replannedhow outputs are integratedIt does not decide:
product behaviorsystem architectureUI designtest strategysecurity solutionrelease strategyThose belong to the relevant domain skills.
Task → DAG<Node<I, O, V>> │ │ │ │ │ └─ verification / evidence │ └──── output contract └─────── required inputsI = required inputs + upstream contracts + constraintsO = contracted outcomeV = local verification and evidence
node = delegated unit of outcomeedge = dependency, ordering, decision flow, or write conflictA delegated node is successful when it produces the required outcome with evidence, not when its internal implementation matches a preconceived structure.
1. Decide whether delegation is worth it
Section titled “1. Decide whether delegation is worth it”Do not infer delegation from task size.
Before spawning anyone ask:
Would delegation materially help?
specialized expertise?independent parallel work?large context that can be isolated?separate verification useful?Decision:
no→ solve directly
yes→ graph-protocolCore rule:
Do not delegate work whose coordination costis greater than doing it directly.A large task may still be best handled by one agent.
A small task may justify delegation if it needs a specialized review or isolated verification.
Do not create workers to make the process look parallel.
2. Define nodes as contracted outcomes
Section titled “2. Define nodes as contracted outcomes”A node is not:
edit booking.service.tsupdate frontendchange schemaA node is an outcome with a clear contract.
Node├─ objective├─ required inputs├─ upstream contracts├─ constraints├─ allowed scope├─ expected output└─ verificationExample:
Node A
Objective:Guarantee concurrent booking requests cannot both reserve the same slot.
Inputs:- engineering contract- current booking persistence implementation
Constraints:- preserve existing public booking behavior- no unrelated schema redesign
Allowed scope:- booking persistence / transaction path
Output:- implementation preserving the no-overlap invariant
Verification:- faithful concurrent integration testFiles and modules are implementation details discovered while executing the node.
One node has one accountable owner.
That owner may consume specialist output from other nodes or workers.
Do not interpret ownership as “one worker must personally do every subproblem inside this node.”
3. Build the execution DAG
Section titled “3. Build the execution DAG”The DAG is the orchestration truth.
Do not use global waves as mandatory execution barriers.
A ──→ CB ──→ DIf A finishes first and C’s own requirements are satisfied, C may start without waiting for B.
Readiness:
ready(node) = all required predecessors completed AND required decisions available AND no conflicting writer is activeWaves may be shown for human readability:
wave 1: A, Bwave 2: C, Dbut:
DAG = execution truthwaves = optional scheduling view4. Type the edges
Section titled “4. Type the edges”“No data dependency” does not imply safe parallel execution.
Use the smallest edge vocabulary that explains scheduling.
Data dependency
Section titled “Data dependency”Output of A is required by B.
A ─data→ BExample:
schema decision→ service implementationOrdering dependency
Section titled “Ordering dependency”A must happen before B even if B does not consume A’s output directly.
A ─order→ BExample:
migration expand→ compatibility cleanupDecision dependency
Section titled “Decision dependency”B cannot proceed until A resolves a consequential choice.
A ─decision→ BExample:
choose source of truth→ implement synchronizationWrite conflict
Section titled “Write conflict”A and B may be logically independent but cannot safely mutate overlapping state/code at the same time.
A ─write-conflict─ BExample:
A → refactor UserServiceB → add UserService featureSerialize, repartition, or assign one accountable owner.
Do not create fake parallelism over overlapping mutable scope.
5. Give workers only the context they need
Section titled “5. Give workers only the context they need”A worker contract should contain:
WHY / objectiverequired inputsrelevant upstream contractsconstraintsallowed scopeoutput contractverificationPass a domain skill or method only when it is actually relevant.
Do not preload every worker with:
product-designengineering-designdesign-thinkingdesign-graphsecurity-reviewtest-engineering...unless the node genuinely needs them.
Examples:
Testing worker:
engineering invariant+implementation under test+risk to proveSecurity worker:
changed trust boundary+required security property+affected code/configImplementation worker:
engineering contract+local implementation scope+relevant verificationThe coordinator is responsible for making upstream contracts explicit enough that the worker does not need to reconstruct the entire project.
6. Worker output is an untrusted claim until verified
Section titled “6. Worker output is an untrusted claim until verified”Delegation boundary:
coordinator ↓ contractworker ↓ evidencecoordinator verifiesDo not accept:
Done.Implemented.All good.as proof.
Preferred worker return:
Changed:- ...
Decisions:- ...
Verification:- <command/check> → <result>
Deviations:- ...
Blocked:- ...A worker does not need to return a full “implemented graph” unless that graph materially helps integration.
The coordinator should inspect the actual changed artifact/diff/result when possible.
Evidence may include:
difftest resultbuild/typecheck resultreproductionquery/resultscreenshot when UI evidence is relevantmeasured outputsecurity path proofNever trust worker output merely because the worker is specialized.
7. Compare contract equivalence, not structural equality
Section titled “7. Compare contract equivalence, not structural equality”A worker may discover a better existing mechanism or a different implementation path.
That is not automatically a failure.
Compare:
delegated contract vsimplemented behaviorCheck:
required outcome preserved?constraints preserved?upstream/downstream contracts satisfied?allowed scope materially exceeded?verification passes?new consequential decision reported?Do not require:
same internal nodessame function decompositionsame implementation graphunless structural form itself was part of the contract.
Core rule:
contract equivalence≠structural equality8. Surface deviations and replan
Section titled “8. Surface deviations and replan”Coding creates discoveries.
The execution graph is allowed to change.
Typical discoveries:
requested approach is impossibleexisting assumption is falsehidden dependency appearswrite conflict appearsbetter existing mechanism already existssecurity issue changes the planarchitecture contradiction appearstool/environment limitation blocks the nodeProtocol:
discovery ↓Does it invalidate the delegated contractor downstream assumptions? │ ├─ no │ → continue │ → report deviation │ └─ yes → stop affected work → preserve evidence → coordinator replans affected DAGDo not force a worker to finish an obsolete plan.
Coordinator actions may include:
redirectcancelretryreassignsplit nodemerge nodesserialize conflicting workchange dependenciesescalate to a domain skillReplan only the affected subgraph when possible.
Do not rebuild the whole graph for a local discovery.
9. Model orchestration failures explicitly
Section titled “9. Model orchestration failures explicitly”Failure does not automatically mean “the coordinator wrote a bad prompt.”
Useful failure classes:
Planning├─ wrong decomposition└─ hidden dependency
Context├─ missing input└─ ambiguous contract
Execution├─ implementation failure└─ local verification failure
Coordination├─ write conflict└─ incompatible outputs
Environment├─ tool failure└─ unavailable dependency
Discovery└─ invalidated assumptionPossible responses:
retryredirectreassignreplanserializeescalateabortChoose based on the cause.
Examples:
tool transiently unavailable→ retry may be correct
two workers edit the same state owner→ serialize/repartition
architecture assumption invalid→ replan / engineering-design
worker lacks required product context→ provide missing contract or merge work back to coordinatorDo not blame the worker by default.
Do not blame the coordinator by default.
Classify the actual orchestration failure.
10. Use a concrete worker lifecycle
Section titled “10. Use a concrete worker lifecycle”Worker lifecycle:
planned ↓ready ↓running ├─ completed ├─ blocked ├─ failed └─ cancelledCoordinator may:
startcancelredirectretryreassignA running worker does not have permanent ownership over the orchestration plan.
If new evidence invalidates the task, the coordinator should stop or redirect it.
Do not wait at a global gate merely because another unrelated worker is still running.
11. Make integration a first-class node
Section titled “11. Make integration a first-class node”Parallel local success does not prove global success.
Example:
┌→ Backend ──┐Contract Integration → Final verification └→ UI ───────┘The coordinator owns:
cross-node contract consistencymerge/integration orderconflict resolutionintegration behaviorfinal verificationIntegration may itself be represented as a node:
Node I
Inputs:- backend output- UI output- shared contract
Outcome:end-to-end feature behaves according to the contract
Verification:- targeted integration / E2E proofDo not assume:
backend green+frontend green=feature greenThe integration edge must be proven.
12. Preserve domain ownership
Section titled “12. Preserve domain ownership”Graph Protocol orchestrates domain skills; it does not replace them.
graph-protocol orchestration only │ ┌───────────────────┼────────────────────┐ ▼ ▼ ▼engineering-design security-review test-engineering │ │ │ └───────────────────┼────────────────────┘ ▼ integrateOther examples:
product-design→ defines product behavior
engineering-design→ defines system contract
design-thinking→ implementation reasoning
design-graph→ interface reasoning
code-review→ implementation review
security-review→ security property review
test-engineering→ non-trivial executable proof
release-engineering→ release mechanics
production-ops→ runtime health/recoveryGraph Protocol decides:
which capability is neededwhich node owns the workwhat context it receiveswhat it depends onwhen it may runhow its result is integratedIt does not determine the domain answer itself.
13. Keep delegation proportional
Section titled “13. Keep delegation proportional”Use no graph ceremony when direct execution is clearer.
single coherent change+no specialist need+no useful parallelism→ solve directlyUse a small DAG when there are a few real dependencies.
Use a larger graph only when the task actually contains separable outcomes.
Avoid decomposition such as:
worker A → inspect fileworker B → edit fileworker C → run testwhen one worker can do the coherent task more cheaply and with better context.
Good delegation tends to isolate:
different domainsindependent implementation pathsspecialist reviewexpensive isolated researchindependent verificationBad delegation tends to split one tightly coupled reasoning chain into handoffs.
14. Final proof belongs to the coordinator
Section titled “14. Final proof belongs to the coordinator”Worker-local verification is necessary but not sufficient.
Final flow:
worker produces output ↓local evidence ↓coordinator verifies claim ↓integrate outputs ↓cross-node verification ↓final resultBefore finishing, the coordinator checks:
all required node outcomes exist?all consequential deviations resolved?all dependencies satisfied?no unresolved write conflicts?cross-node contracts consistent?integration verified?remaining risk stated?Do not produce a long orchestration retrospective by default.
Report only information needed to understand:
what changedwhat was verifiedwhat materially deviatedwhat remains blocked/riskyThe Protocol Pipeline
Section titled “The Protocol Pipeline”TASK ↓"Should this even be delegated?" → delegation-value gate → direct execution if coordination is not worth it
↓"What outcomes can be isolated?" → define contracted nodes
↓"What does each node consume and produce?" → define I / O / V
↓"What dependencies, ordering, decisions, or conflicts exist?" → build execution DAG
↓"What nodes are ready now?" → all predecessors satisfied → no conflicting writer active
↓run independent work as soon as it becomes ready
↓worker verifies local result ↓collect changes + decisions + evidence + deviations
↓"Did discovery invalidate this node or downstream assumptions?" ├─ yes → stop affected work → replan affected DAG └─ no → continue
↓integrate dependent outputs
↓cross-node / end-to-end verification
↓FINAL RESULTEvery delegated node must produce its required outcome with evidence. If implementation materially deviates from the delegated contract, surface the deviation and re-evaluate the affected graph before integration.