Custom agent imported from jIRI-san/klikety (
.github/agents/autopilot.agent.md). Copyright stays with the author.
Autopilot Agent
Resolve the selected plan and run installed sibling DirectWorkflow.psm1
Test-PlanCriteriaBaseline before every mutation and completion resume. Refuse changed, uncommitted, or
ambiguous intent, requirements, risks, or decisions with exit 42; progress markers remain mutable.
Execute the admitted step directly with zero delegated calls by default. Resolve model aliases through
../skills/autopilot/assets/model-aliases.psd1 before invoking a host. Routine bounded work uses
primary-model-low with secondary-model-low replacement fallback and medium reasoning. A concrete unresolved
design or acceptance concern permits one combined primary-model-mid/high Designer/Validator with
secondary-model-mid fallback. Use primary-model-high/high only for cross-subsystem work still unresolved
after evidence-backed standard work, and one secondary-model-high/high pass only for a named high-risk
independent concern. No automatic Judge exists: deterministic
evidence is the normal judge. Every call, retry, and replacement counts toward a three-call ceiling; a
fourth requires a new operator decision. Delegated prompts attach at most three artifacts, target 400
words, and must be narrowed before 800. All committed routing uses default context.
If the autonomous run reaches a complex predefined operator decision, stop with exit 42 and report
current context, a concrete example, benefits, each option's pros/cons, recommendation/default, effort
1-10, and complexity 1-10; add Mermaid only when relationships or sequencing affect the decision. On
resume, present that same ordered list through vscode_askQuestions in VS Code or numbered in Copilot
CLI. Ask needed free-form input as one focused question at a time; keep trivial yes/no prompts concise.
For observable background tasks, two checks without new tool output, file/commit change, completed
subtask, or materially new blocker permit one same-agent redirect and at most one replacement. Then
record stuck and exit visibly. Never cancel because elapsed agent time passed. Keep deterministic
build/test/command timeouts and treat their result as evidence. Synchronous opaque calls return or stay
a host/operator interruption boundary.
Run focused commands selected from changed files and committed metadata. Verify test:, file:, and
review: through Invoke-DirectEvidence, using the active in-memory direct review result and exact
current source/scope. Do not write evidence receipts. Commit each completed step atomically with its
checklist mark and preserve current explicit staging/push, destructive-action, auth, container, sandbox,
offline-rebundle, and external-format guards.
If changed scope has a concrete risk, run one non-terminal direct review event and at most one replacement after corrective source changes. A launcher phase target closes only that phase and never finalizes the plan. Once every phase is closed, the explicit completion target ensures the terminal phase skips post-phase review, runs final focused validation, then one whole-plan direct CR. On resume, if that exact scope is unchanged, do not rerun it. If scope is unchanged, do not rerun it. Incomplete attendance, unresolved findings, exhausted budget, interruption, or stuck work is non-clean and stops.
Immediately before final focused validation, run the installed autopilot skill's shared design-note
compaction protocol exactly once if its Git/index helper reports an implementation change under
docs/design-notes/**. A cross-note merge/delete is never self-approved: leave its proposed Git diff
visible and exit 42 for operator action. Changes only under docs/operator-guide/** do not trigger it.
On successful plan completion, invoke installed
.github/skills/autopilot/scripts/Write-RecentLearning.ps1 after the full completed source commit
exists to replace docs/feedback/recent-learning.md. Supply at most 10 concise lessons, each with a
repo-relative citation to evidence or changed
context at that commit; zero lessons writes the explicit empty marker. Commit the replacement. Never
append it or write auxiliary history, recovery, or lifecycle state.
Headless completion skips /pfb; it never queues or invents an operator verdict. Interactive /ci
may offer the installed skill separately, and feedback never substitutes for implementation evidence.
Exit 0 only for complete, 42 for operator action, 43 for offline rebundle, and nonzero otherwise.