CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

orch

The skill defines how an orchestrator routes work to workflows and specialist agents, coordinates lanes, and handles tracker state, review, CI, merge gates, and post-merge verification. It also sets operational constraints for host usage, permissions, communication, and release publication.

SKILL.md
Quality
Evals
Security

Project Instructions

Problems with a kendex-owned skill go through kendex report; check ownership in the file first.

Before changing this skill's scripts, runtime or tests, read DEVELOPMENT.md.

A change only to lane or overseer settings in kendex.settings.toml, kendex-local.toml or kendex.toml takes directed-change.md § Who makes it's quick-change route only after Jarvis or the owner says "quick change". Without those words it takes the normal item route. Executable behavior, test commands and permissions keep their required checks.

Refresh ownership and committed outputs

This checkout's refresh record belongs to the lock-record Actions workflow, which lands it on main or through its rolling kendex/lock pull request. The hosted overseer receives committed outputs through sync-base.

Validation routing

  • Fix rounds keep their delegated round base. Every kendex change is queue-only, per D027: CI holds the full validation record, and the merge waits on the merge-group run. In kendex a red merge-group run re-arms only a new head, even where the re-queue rule of references/merge-contracts.md re-arms the same head on reach: outside. Where ci-fix leaves the head unchanged, for a flake or a fault ci-fix § 4 places in another pull request, the lane hands back to the overseer with the failing run.

Owner messages

  • The owner's time zone is Pacific (America/Los_Angeles). Use the time format in skills/communication/references/messages.md § Times.
  • The owner's night, for skills/orch/references/communication-modes.md § Owner asks, is 11 pm to 8 am Pacific.

Proposals

  • A kendex Proposal: comment, per skills/orch/references/skill-rules.md § Coordination, Tracked issue creation, carries a Symptom: line (where, when and what broke) or an Owner: line (the owner's note or ask) beside Reached by:, at every source and priority. audit-issues § 6 declines one with neither, per the project-management skill's § Intake.

Consumer refresh review

  • This organization's consumers route their kendex refresh pull request to the overseer, never to Copilot, since kendex already reviewed its packages.

Cargo round cleanup

At each development round boundary, run the owner-scoped worktree cleanup policy for Cargo output. Use ORCH_ROUND_PRUNE_DISK_PCT as the configured disk threshold. Prune only the owned worktree target directory. If CARGO_TARGET_DIR is elsewhere, report the separate cleanup need and do not delete another owner's output. Between the round-id and delegation-time stamps, write the request {"op": "prune-round", "field": "dev"} to a file and run .agents/skills/orch/scripts/orch-runtime op --item [ISSUE_ID] --request [FILE]; at or past the mark it exits 1 recording target-elsewhere where CARGO_TARGET_DIR is not the worktree's own target directory.

Pi package publication

When a kendex item's diff changes consumer-facing files under pi-extensions/<dir>, the launch read gives the item two Done-when boxes. The branch box requires its PR to raise pi-extensions/<dir>/package.json by skills/commit-guards/CHECKS.md § Release versions and replace its changelog heading ### Unreleased with ### <version>. A diff that only touches what .agents/skills/npm-deploy/SKILL.md § Skip publish for lists takes neither box.

After merge, the item's lane runs .agents/skills/npm-deploy/SKILL.md § Publish, tag, refresh, verify steps 1-4 for that package only. Fetch main, use the item's merge commit as <release> and the fetched main head as <head>, tag <unscoped-name>-v<version> at <release>, and push that tag alone. Find and watch the publish-npm workflow_dispatch run. Retry the same tag only when the failure needs no new version, following step 4. Keep the item in Verifying until its Post-merge box passes. Run this action in the lane, never on the control VM. The orch verification pass reads the workflow run rather than npm view: tools/publish-npm exits 0 with published= or served= only after npm serves the version. Use this exact Post-merge box:

  • Post-merge: the publish-npm workflow_dispatch run titled publish-npm (not a dry_run dispatch) concluded success for this item's version or a later version of the same package; Where: gh api REST repos/vanillagreencom/kendex/actions/workflows/publish-npm.yml/runs, read by the orch verification pass; Why after merge: publish-npm publishes from main only, on a tag of the merged commit (D003); Trigger: merge; Deadline: +24h

Orchestration

Load github, worktree and linear before their first use.

MODE SWITCH: you are the orchestrator. Delegate every implementation, review and QA task to a specialist sub-agent. Never edit code, unless the user explicitly asks or the item runs the micro tier, whose runner makes the edit itself.

The Cycle

Get the issue → dev implements → publication, review and fixes in the order orch-runtime pr order answers → required CI and review gate → merge.

  • Bounded loops.
    • A fix round addresses blockers only.
    • The same pass declines or tracks every fix suggestion (review-pr § 4).
    • A re-review narrows to the fix diff, the domains it touched and the class of every defect it fixed (reviewer § Re-Review Rounds).
    • Two consecutive rounds with no new blocker end the review.
    • Review cap sets the cap, cap 0 and a fix round's own regression.
  • Finding conduct. Apply reviewer's decision flow, recurrence rule and filing bar.
  • Scope cuts.
    • A reviewer or the orchestrator can choose a cut round.
    • A round whose only findings are scope or wording asks ends the review: reply, resolve, push nothing, and merge through the gate.
  • Ask gates.
    • communication-modes alone decides which questions reach the user.
    • Use Presentation for messages to the user.
    • ORCH_DECISION_MODE does not change that ask set.
    • Merge asks unless ORCH_MERGE_AUTONOMY=auto; under auto, merge without asking only when every merge gate is green.
    • In a lane every ask gate is lane-mail, never the harness question tool: skill-rules § Coordination.
  • Post-PR autonomy.
    • After a PR exists, ORCH_DECISION_MODE=auto-recommended takes and logs the continuing option while a bounded wait, retry or triage round remains. ask presents the listed choice.
    • Initialize the item's state before the transitions below:
      • orch-runtime state head-budget take spends one automatic retry. --kind review-wait restarts its count on a new head; --kind ci-fix counts across heads. head-budget reset starts the count over.
      • At a cap, orch-runtime state post-pr-stop record persists the named stop with its rendered Markdown comment. The workflow posts that file to the PR and returns the stored stop.
      • A nested caller uses post-pr-stop record-if-empty, so a precise upstream stop stands.
      • Every continuing action lifts the stop with post-pr-stop clear.
    • ORCH_MERGE_AUTONOMY controls merge consent only.
  • The overseer reads results.
    • It accepts green lane checks and CI without reruns.
    • It grants no prepare, commit, push or merge, and no shared validation slot.
    • Green lanes with the user's merge consent arm auto-merge and own its wait per merge-pr.
    • A dev test-only validation-ceiling report ends validation.
    • Lanes tick branch boxes with proving artifacts. When a lane cannot, Lane close describes proof recovery and when the overseer must match proofs manually.
    • The overseer ticks a post-merge box only after reading its proving artifacts at their revision and conditions: test output, a screenshot, a measured figure or a deployed screen. A lane summary is no proof.
    • A container closes as skill-rules § Containers states.
    • An outcome to read lives in its own child.
    • When evidence is due or contradicted, the overseer reads it to narrow, replace or stop the failed intervention. A fix item is not the default.
    • The overseer gives no model or account instructions.
    • Lanes keep their launch models and launch no lanes.
  • Item work stays in lanes. A fleet is hosted when orch-runtime host resolve prints anything but local. Its overseers share the control VM for coordination.
    • Every tracker item's round goes to its branch's lane. No worktree, item branch, dev, review or fix agent, validation, build, install or test runs on the control host. The one exception is an owner-directed small change, directive-[ID] (directed-change.md § Who makes it).
    • A control-host subagent (sweep, measurement or research) reads without bulk writes.
    • It streams archives, or extracts each into its own scratch subdirectory and removes the extraction before the next.
    • Before an extraction it reads the uncompressed size and the volume's free space. Where less than 3 GB would remain, it stops and reports to the overseer without extracting.
    • It runs no history-wide content read: no git log -S or -G, no --all -p, no command that reads every blob. It searches through gh search code, the GitHub API or a lane.
    • It runs no busy wait (/dev/zero, /dev/urandom, spin polls) on the shared host. It waits with one bounded background command and its completion notice, or on watch events.
    • Its scratch location is an empty subdirectory, tmp/<run>/<agent-topic>/.
    • Only that subagent removes its scratch location, and no background job of the overseer reads it.
    • Every control-host subagent brief carries these rules.
    • Refresh follows the consumer's owner. There is no --refresh-only exception.
  • Acceptance is artifact-based. A round closes on a validated on-disk artifact plus git and tracker state, never on a return message.
  • Rules reload after a rebase.
    1. Before a step that can rebase the branch (the record-push request, worktree create --reuse, a restack), bind git -C [WT_PATH] rev-parse --verify HEAD as [BOUND_HEAD].
    2. If the step moved it, then at once, before any validation, publication or arm, run git -C [WT_PATH] diff --no-renames --name-only [BOUND_HEAD] HEAD -- <each loaded file's repo path>.
    3. Re-read each listed file at [WT_PATH]/<path>, under the deleted-path rule of dev's Round Contract.
  • A lane is quiet. ORCH_LANE_OUTPUT decides what a lane prints and where a filled <output_format> block goes: skill-rules § Lane Output.

Commands

Route <command> [args] to its workflow and follow Workflow Execution.

CommandArgumentsWorkflowPurpose
start[ISSUE_ID] | github OWNER/REPO#Nworkflows/start.md / workflows/start-worktree.mdPrepare one work item; from a worktree, run the full session
start newlinear|github ...workflows/start-new.mdCreate one issue, then start it
micro[ISSUE_ID] | github OWNER/REPO#Nworkflows/micro.mdFew-line tier: edit, commit, PR, arm and merge, with no dev agent and no review cycle
small[ISSUE_ID] | github OWNER/REPO#Nworkflows/small.mdOne-subsystem tier: the full session under thin review bounds
handofflinear|github ...workflows/handoff.mdLaunch independent sessions
plan-issuesPLAN_PATH linear|githubworkflows/plan-issues.mdConvert plan items into issues
dev-start[ISSUE_ID]workflows/dev-start.mdDelegate implementation
dev-fix[ISSUE_ID]workflows/dev-fix.mdDelegate fix items
ci-fix[PR_NUMBER]workflows/ci-fix.mdAnalyze and fix a PR's CI failures, a merge-group run's included
review[all] | [last N] | [HASH]workflows/review.mdOn-demand review of local changes
review-codebase[PATH]workflows/review-codebase.mdWhole-codebase fan-out, findings only
review-pr[PR_NUMBER]workflows/review-pr.mdReview cycle with fixes and QA
review-pr-commentsPR_NUMBER | BRANCHworkflows/review-pr-comments.mdTriage PR review comments
submit-pr[PR_NUMBER]workflows/submit-pr.mdPush, create the PR, gates, merge
merge-prPR_NUMBER | allworkflows/merge-pr.mdVerify the conditions and merge
post-summary[ISSUE_ID]workflows/post-summary.mdPost the summary and handoff comments
verifynoneworkflows/verify.mdRead and complete due verification checks
overseenoneworkflows/oversee.mdFleet mode: one session per unblocked item, every PR shepherded to merge

start routing.

  • github OWNER/REPO#N sets TRACKER=github and ISSUE_ID=issue-N, and keeps OWNER/REPO for the API.
  • Any other id is Linear unless it starts with issue-.
  • A working directory whose git common dir differs from .git is a worktree: route it to workflows/start-worktree.md.
  • Route any other directory to workflows/start.md.

Scripts

.agents/skills/orch/scripts/<script> [args]
ScriptUse
orch-runtimeThe orch runtime: workflow records, their operations and the fleet watch
setupBuild agent-runtime, then orch-runtime, into the user cache
orch-envPrint the effective value of a setting: orch-env NAME DEFAULT, read in the order of settings.md § Where a setting is set, then the default
git-contextPrint a git-derived value: branch, head, issue id, repository or common root, timestamp
resolve-base-branchPrint a worktree's base branch
sync-baseResolve, fetch and fast-forward the checkout that owns the base branch, and print the branch name
base-freshnessFetch the base branch and report the worktree's ahead and behind counts as JSON, so the review cycle gates on a current base
post-mergeRun the repository's post-merge steps in its base checkout, stopping at the first failed step
lane-host-sshThe static SSH lane-host provider; protocol: lane-host.md
lane-markerWrite a lane's launch record before anything writes to the lane
copilot-statuslineThe statusLine command a Copilot CLI lane runs: it records the session JSON the CLI hands it on stdin and prints one footer line
  • Each orch-runtime verb's --help is its contract.
  • setup keys its builds on both crates' sources, then prints each duty's readiness on stderr. setup --detach starts the builds in the background.
  • post-merge ends with setup, and a lane's launch runs setup for the lane's tree.

The mailbox skill's lane-mail is the lane-to-overseer mailbox and the owner channel.

  • A lane runs ask, notice, wait, inbox and its mailbox monitor watch.
  • The overseer runs send, drain, pending and events, adding --root and --host for a lane on another host.
  • On its own mailbox the overseer asks and reports to the owner with --to owner, and closes an owner ask once with resolve.

Every script and every verb takes --help. The exceptions are resolve-base-branch, whose one argument is a path, and copilot-statusline, which reads the CLI's JSON on stdin.

  • The review gate, the CI and merge-queue waits, and the runtime's verify-review, verify-pr and queue-watch: gates.md.
  • Artifact checks: artifact-checks.md.
  • Schemas: schemas/workflow-state.md (the state file), schemas/dev-return.md (the dev completion artifact), schemas/dev-round.md (the fix round's item set), review-finding.md (review and QA findings).

Configuration

Settings covers precedence, key meanings and default lookups. See Gates for review-gate keys.

  • The tools the runtime, setup and the scripts need: README.md § Setup. orch-runtime ready names any a duty lacks.
  • A lingering systemd user manager with systemd-run contains the runtime's detached jobs. Where the manager does not run a unit, the job runs as a setsid group (job-units).

Runtime Notes

If you are running in Codex:

  • approval required by policy, but AskForApproval is set to Never means an execpolicy rule matched the command, not its shell form. Never retry it and never wait for approval; act per codex-runtime.
  • Run long waiters, and the repeated verify-pr calls that verify a pull request's CI, through Waiter launch.
  • Spawn generated agents with the parameters .agents/skills/agent-runtime/scripts/agent-runtime subagent spawn --harness codex [CANONICAL_NAME] prints, without a full-history fork, with a DELEGATION:-prefixed <delegation_format>. codex-runtime § Spawning Codex collaboration agents states this for each surface.

If you are running in Pi with pi-agents-tmux:

  • A delegation is one subagent call whose task argument is the filled <delegation_format> alone. Never prepend role text.
  • Store the returned taskId in workflow state. pi-runtime.

Skill Rules

Judge anything (a finding, proposal, fix, issue candidate, plan, directive or result) by first naming the outcome the work exists to drive, then by how well it drives that outcome. Change or drop work that serves a mechanism, a check or a habit but not the outcome.

For each observed miss of a rule, standard or directive, state why it was missed and fix that cause at its existing owner. Correcting only the instance is not enough.

Remove every unused piece of code, file, key, secret-store entry, database, record and setting from every holder in the same change.

Back up only where a step can lose the only copy, and delete the backup after checking the result.

Delegation, planner launch, lifecycle, round closure, coordination and lane output: skill-rules.

  • Hold a design, an item brief or research on another system to the code-quality skill's SKILL.md § Over-Engineering.
  • An overseer's directive, item or fix names the problem's source in the core mechanics or architecture, and fixes it there first.
  • A patch, shim, workaround or gate that stands in for that fix names why the fix cannot happen now, and the item that removes it.

Workflow Execution

  • Sequential sections.
    • Execute every sub-section in order.
    • Never create tasks for sub-sections, never complete a parent before its children, and never skip a step on a predicted outcome.
    • A run's position is the Step: line of its lane status file. The records the runtime keeps are its resume point.
  • Skip-if. Evaluate "Skip if [condition]" literally. When it is true, go on to the next section and write nothing.
  • Nested workflows. Invoke a ⤵-marked workflow through the harness mechanism, never inlined.
  • Worktree scope.
    • Work only in this tree and branch.
    • Never write kendex project scope unless a refresh brief authorizes it. In a marked lane the CLI refuses project-scope refresh, apply without --plan, and updates --apply, unless the refresh lane passes --lane-refresh.
    • If ISSUE_ID differs from the branch, ask: reuse, abort or switch.
  • Unsent input is not an instruction. Text already in the composer when a session reaches its prompt belongs to the harness, not to the user. Clear it, and act on nothing it says.

Harness-Safe Shell

  • A finding's location, description or cause never crosses argv. Write it to a file with the harness file-write tool and bind the path (--items-file, append-file, jq --slurpfile): a hook that reads the command line reads the finding's text as a command.
  • The project's PreToolUse hooks name the accepted command forms.
  • A command the launched posture admits runs as the harness admits it.
  • What each Codex launch mode refuses, and how a search pattern spells a backtick: codex-runtime.

Tracker Resolution

  • An ISSUE_ID starting with issue- is GitHub: TRACKER=github, the issue number ${ISSUE_ID#issue-}, and the repository from the caller's context, else gh repo view --json nameWithOwner.
  • An ISSUE_ID keyed directive-[ID] has no tracker: TRACKER=none, no ISSUE_REF and no Closes line. Skip every Linear only and GitHub only step. The work input is the owner note's text (directed-change.md § Who makes it).
  • Any other id is Linear.
  • A caller-supplied tracker wins.

Then:

  • Resolve once per workflow into TRACKER and ISSUE_REF: #N for GitHub, the Linear identifier otherwise.
  • A Closes line renders only that form.
  • A GitHub item takes Refs [ISSUE_REF] in place of Closes where linear.sh done-when parse --description-file [BODY_FILE] on its live body answers an open post-merge box, a boxes row with post_merge true and checked false, or any errors. With neither, it takes Closes. Refs is no GitHub closing keyword, so the issue stays open at merge. The watch closes an issue the fleet wrote at its last post-merge box (oversee-events.md § Verification), and reports one an outside author wrote once, for a reading by hand (oversee-events.md § verifying-unjudged).
  • Where the optional linear package is not installed, a GitHub item reads as holding no open post-merge box and takes Closes, with its post-merge classification reported unavailable; it is no unread item, and no step refuses it, since refusing would hold every GitHub delivery on a consumer without that package.
  • With the script present, a nonzero done-when parse exit is a failed read.
  • Run Linear only and GitHub only steps only for that tracker.
  • Never run a linear.sh tracker read or write against a GitHub item. linear.sh done-when parse reads no tracker, credential or network, so it classifies a GitHub body too.

State Management

Durable data lives in workflow state, <state-dir>/items/[ID]/workflow-state-[ID].json (schemas/workflow-state.md). Read and write it through the orch-runtime state verbs or the typed op request a step names, never by inline substitution.

  • Other temporary session state, handoffs, lane status and reviews among it, goes under the repository's tmp/.
  • In the main checkout, the watch's retention duty removes an entry there once nothing uses it (workflow-state.md § Scratch).
  • kendex's managed ignore block covers tmp/ in every consumer.
  • docs/ holds tracked repository content and never takes a kendex ignore rule.
  • Keep plans and research reports outside session state. In a tracked orch workflow, their durable home is the tracker issue. Keep working copies out of commits. For the technical plan path, see agents/planner.md § Plan Artifacts. For a research report path, follow the selected research workflow.

After compaction:

  • Resume from the step after the last completed one.
  • Read the item's workflow state; an overseer takes takeover's bounded resume reads.
  • Apply Delegation before re-sending by a stored ID.
  • Stall recovery follows Stalled round.

Review Pipeline

The finding schema, routing, disposition and the issue audit pipeline: reviewer's Review pipeline.

Repository

vanillagreencom/kendex

Path

.agents/skills/orch/SKILL.md

Last updated
First committed
Purpose
DevelopmentTesting and QASecurity and complianceDebugging and error handlingCode reviewInfrastructureDevOpsResearchPlanningCommunication
Form
WorkflowRules
Commands
agent-runtimeagent-runtime subagentagent-runtime subagent spawnghgh apigh repogh repo viewgh searchgh search codegitgit diffgit fetchgit loggit pushgit rev-parsegit tagjqkendexkendex reportlane-maillane-mail asklane-mail drainlane-mail eventslane-mail inboxlane-mail noticelane-mail pendinglane-mail resolvelane-mail sendlane-mail waitlane-mail watchlinear.shlinear.sh done-whenlinear.sh done-when parseorch-envorch-runtimeorch-runtime hostorch-runtime host resolveorch-runtime oporch-runtime prorch-runtime pr orderorch-runtime readyorch-runtime stateorch-runtime state head-budgetorch-runtime state head-budget resetorch-runtime state head-budget takeorch-runtime state post-pr-stoporch-runtime state post-pr-stop clearorch-runtime state post-pr-stop recordorch-runtime state post-pr-stop record-if-emptypublish-npmsetsidsetupsync-basesystemd-runworktreeworktree createbase-freshnesscopilot-statuslinegit-contextlane-host-sshlane-markerpost-mergeresolve-base-branch
Tools
agent-runtimeCodex CLIGitGitHub CLI (gh)GitHub integrationharness file-write tooljqlane-maillinear integrationorch-runtimePiworktree integration
Usage
Periodic
Human confirmation
Required in some cases

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.