[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77H0M9WHDJY4AT3BCF67VJS":3,"skill-same:01M77H0M9WHDJY4AT3BCF67VJS":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":6,"updatedAt":38,"install":39,"resources":51},"01M77H0M9WHDJY4AT3BCF67VJS","goal",null,"Autonomous goal-directed execution loop. Establishes an immutable objective pin, durable scratch state (_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md, whose markdown checklist is the step tracker on pi), a deterministic witness exit-gate, and executes atomic steps until verified.","anthony-chaudhary\u002Ffak","anthony-chaudhary","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F18080164?v=4","01M77GSKCAEKV3JS07J40B94DY","Anthony Chaudhary","01M77GSKD26Z7F4FQQD4VA30VX",48,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgoal\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: goal\ndescription: Autonomous goal-directed execution loop. Establishes an immutable objective pin, durable scratch state (_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md, whose markdown checklist is the step tracker on pi), a deterministic witness exit-gate, and executes atomic steps until verified.\ndisable-model-invocation: false\nuser-invocable: true\nallowed-tools: Read, Edit, Write, Grep, Glob, Bash\nargument-hint: \"[objective] [--witness \u003Ccommand>] [--budget \u003Citers>] [--dry-run]\"\nmetadata:\n  generated-by: fak project-assets sync\n  canonical: ..\u002F..\u002F..\u002F.claude\u002Fskills\u002Fgoal\u002FSKILL.md\n---\n\n# \u002Fgoal — Autonomous Goal-Directed Execution Loop\n\nAn autonomous execution skill that drives a high-level objective to verified completion. While awaiting native OpenCode `\u002Fgoal` runtime primitives, this skill provides a battle-tested goal loop immediately across OpenCode, Claude Code, and Codex.\n\nIt unifies the best patterns from existing open-source agent systems:\n- **Ralph Loop (Geoffrey Huntley, Vercel `ralph-loop-agent`)**: Durable state on disk (`GOAL.md`), surviving context compaction and session restarts.\n- **OpenAI Codex `\u002Fgoal` & Aider `\u002Farchitect`**: Two-phase structured planning, maintaining the objective anchor, and active checklist management.\n- **All-Hands OpenHands (OpenDevin) & SWE-agent**: Reproduction-first discipline, minimal surgical edits, and external exit-gates (rejecting the self-assessment trap).\n- **Fak Goal Specs & Registry**: Native compatibility with `docs\u002Fgoal-spec.md`, `docs\u002Ftemplates\u002FGOAL.md`, and the `fak goal` registry (`internal\u002Fgoalregistry`).\n\n---\n\n## The Five Invariants of Goal Execution\n\n1. **The Objective Pin**: The objective statement is pinned verbatim and never mutates during the run. Pinning prevents goal drift (Arike et al., 2025).\n2. **State on Disk, Not Ephemeral Memory**: Progress, plans, and scratchpad live in `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`) on disk. Goal specs are noisy, disposable scratchpad memory for surviving context compaction; they are not coordination artifacts. First-class coordination occurs via lane leases (`dos arbitrate` \u002F `internal\u002Fleaseref`), claims (`CLAIMS.md`), issue comments, and commit trailers.\n3. **External Witness Exit-Gate (and Live Hardware Shift-Left)**: Model proposes, test disposes. The agent never grades its own work. A goal is satisfied only when a deterministic external command (test suite, buildcheck, validator) exits 0. For tasks touching hardware, compute kernels, or accelerator paths (CUDA, Vulkan, Metal, APU\u002FUMA), bias heavily toward testing sub-components on live physical hardware (divide and conquer) with high volume and frequency (e.g. `fak validate --strix --subkernels=...`, `make mac-perf`, `make cuda-test`) rather than relying on synthetic host mocks or deferring verification to monolithic post-merge runs.\n4. **Atomic S0\u002FS1 Steps (Divide & Conquer, Subdivide, and Scope Abstention)**: Divide and conquer substantive or multi-concern objectives into atomic leaves (1–3 files touched per step). When tasks have independent components, delegate to isolated subagents or workers (`task`: worker, researcher, explore, cross-validator) to prevent coordinator context pollution. Divide and conquer applies to compute pipelines as well: decompose hardware verification into isolated sub-components (sub-kernels, GEMV\u002FGEMM microbenchmarks, Vulkan primitives) to execute on live hardware frequently and in high volume. Parallel subagent cohorts (4–8 parallel subagents across independent packages, tests, or diagnostic probes) are authorized while maintaining the single active goal milestone in the goal checklist. Top-level coordinators fan out subagents, while leaf workers execute directly without nested recursion (#12028). Keep exactly one step `in_progress` in the goal checklist. When encountering high-difficulty boundaries (e.g. frozen ABI, kernel SIMD), scope abstention strictly to the bounded aspect: emit a structured `ABSTAIN` record for that boundary while advancing all independent, safe, solvable sub-components (reproduction tests, diagnostics, disjoint packages).\n5. **Failure Memory Scratchpad & Persistence (Move Forward Over Conclusions)**: Genuine guard refusals carrying a closed reason token or unexpected process crashes are recorded in `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`). Routine CLI return codes from read-only commands (such as `grep` returning 1 on no match, or `git diff --quiet` detecting changes) are normal tool execution results and must not be logged as failures in `# Scratch \u002F last-refusal`. A refusal or tool crash is diagnostic feedback, not a session abort. Query `fak recover \u003CTOKEN>` for structured recovery, adapt the execution path or decompose the step, and maintain momentum on the pinned objective without repeating identical failing calls. Focus on forward momentum over terminal conclusions: rather than defeatist conclusions when a step underperforms (e.g. rather *\"the next step to get better performance is X\"* than *\"X didn't work ... therefore we suck...\"*), treat unmet targets as empirical data that eliminates a variable, and formulate the concrete next checkable step.\n\n---\n\n## Execution Protocol\n\n### Step 1: Intake and Objective Pinning\n\nParse `$ARGUMENTS` (e.g. `\u002Fgoal Fix memory leak in auth service --witness \"go test .\u002Finternal\u002Fauth\u002F...\"`). If no argument was provided, do not prompt the operator - default to acting: derive the best-supported objective from evidence (the active goal, open WIP, tickets, or the repo's default work object) and proceed. Resolve a surfaced choice through the `internal\u002Fchoicetriage` fold: take the obvious move (`TAKE_OBVIOUS`); hand a knowable-but-unobvious question to a **fresh context window at the top tier** (`FRESH_CONTEXT`, the default); or decompose scope too large for this context into a ticket (`FILE_TICKET`). Only an irreducible policy\u002Fauth\u002Frelease\u002Fpriority\u002Ftrust decision (`HUMAN_RESIDUAL`) legitimately returns to a person - and it must be **earned** by a real authority signal, never manufactured by phrasing status as a question. An unattended goal run that opens by asking a person has silently stalled.\n\nFormulate three fields:\n- **Objective Pin**: Exactly one clear, measurable end-state.\n- **Non-Goals \u002F Scope Fences**: Explicitly state what is NOT part of this run to prevent over-scaffolding and companion abstraction sprawl.\n- **Witness Criterion**: The exact deterministic command that proves success (e.g. `go test -v .\u002Finternal\u002Fgateway\u002F... -run TestGatewayReady` or `fak validate --mine \u003Cpaths>`).\n\n### Step 2: Initialize Durable Scratch State (_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md; its checklist is the step tracker)\n\nEnsure directory exists (`mkdir -p _scratch\u002Fgoals`) and create or update `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`). Never create or commit a tracked `GOAL.md` at the workspace root. Goal specs are local, disposable execution scratchpad memory. First-class coordination occurs via lane leases (`dos arbitrate`), claims (`CLAIMS.md`), issue comments, and commit trailers (`(fak \u003Cleaf>)`).\n\n```markdown\n\u003C!-- Active goal spec saved under _scratch\u002Fgoals\u002FGOAL.md or _scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md (never committed) -->\n---\nloop: goal\nwitness: \u003Cwitness command or criterion>\nbudget: { max_iters: 20 }\n---\n# Objective\n\u003CPinned objective statement>\n\n# Non-Goals\n- \u003CExplicit exclusion 1>\n- \u003CExplicit exclusion 2>\n\n# Plan\n- [ ] 1. Reproduce baseline behavior or establish failing test\n- [ ] 2. Implement minimal surgical fix or feature\n- [ ] 3. Run package-level verification and regression checks\n- [ ] 4. Execute final witness command\n\n# Scratch \u002F last-refusal\n```\n\nIf the `fak` binary is available, optionally register the goal in the canonical registry:\n```bash\nfak goal create --title \"\u003Ctitle>\" --summary \"\u003Csummary>\"\n```\n\nIf running on pi (or any harness with no todo tool), the plan items ARE the tracker: keep\n`- [ ]` \u002F `- [x]` state in the goal scratch file and mirror it in the plan block. In\nOpenCode, additionally populate `todowrite` with the plan items, marking the first item\n`in_progress`.\n\n### Step 3: Baseline Reproduction First (SWE-agent Invariant)\n\nBefore editing code:\n1. Locate relevant files using `Glob`, `Grep`, and `Read`.\n2. Execute the existing tests or create a reproduction test case.\n3. Capture the baseline failure or diagnostic. A defect is only proven fixed when the test failed before and passes after.\n\n### Step 4: Atomic Sequential Execution\n\nIterate through plan items sequentially:\n1. **Divide and conquer by delegation**: For substantive, complex, or multi-component goals, launch specialized subagents concurrently for independent parts (e.g. `task` with `worker` for implementation, `researcher` for prior art, `cross-validator` for verification). Pull only compact receipts and decisions into the coordinator.\n2. Keep only one step marked in-progress in the goal checklist.\n3. Confine edits to 1–3 closely related files using `Edit` or `Write`.\n4. If a command or tool fails:\n   - Routine CLI return codes from read-only commands (such as `grep` returning 1 on no match, or `git diff --quiet` detecting changes) are normal tool execution results and must not be logged as failures in `# Scratch \u002F last-refusal`.\n   - Log only genuine guard refusals carrying a closed reason token or unexpected process crashes to `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md`.\n   - Query structured recovery: if a guard refused the call, run `fak recover \u003CTOKEN>` or `dos man wedge \u003CTOKEN> --explain` to obtain the sanctioned remedy.\n   - For `MERGE_IN_PROGRESS`, `COLLISION_RISK`, or `LOCK_BUSY`, inspect the\n     typed recovery, wait for quiescence, or continue an independent disjoint\n     subtask. These tokens grant no authority to change the index.\n   - For an actual owned `PRESTAGED_PATH_OVERLAP`, the native recovery accepts\n     one existing regular tracked stage-0 modification in its managed ticket\n     checkout. Retain the original `EXECUTING` claim's worker and explicit\n     epoch, confirm the path is in scope, and preview with full content pins:\n     ```bash\n     fak-run fak-flow index unstage --repo-root \u003Cmanaged-checkout> --path \u003Cowned-path> --expected-head \u003Cfull-head> --expected-index-blob \u003Cstage-0-blob> --expected-worktree-sha256 \u003Csha256> --ticket \u003Cticket> --worker \u003Coriginal-worker> --epoch \u003Coriginal-epoch> --json\n     fak-run fak-flow index unstage --repo-root \u003Cmanaged-checkout> --path \u003Cowned-path> --expected-head \u003Cfull-head> --expected-index-blob \u003Cstage-0-blob> --expected-worktree-sha256 \u003Csha256> --ticket \u003Cticket> --worker \u003Coriginal-worker> --epoch \u003Coriginal-epoch> --json --expected-index-generation \u003Cpreview-token> --owner-authorized --apply\n     ```\n     Review the preview before applying with its exact generation token and\n     unchanged pins. The owner attestation supplements live SDK\u002Fscope checks.\n     A refusal preserves source and index; keep other work and peers untouched.\n   - Decompose rather than abandon: if a subtask is blocked or too complex, divide it into smaller verifiable leaves (e.g. capture baseline reproduction tests first) while keeping the pinned objective intact.\n   - Adapt the approach: halt repetition of the identical failing call; select a sanctioned alternative tool or modified arguments.\n5. Verify the step using package tests (`go test .\u002Finternal\u002F\u003Cpkg>\u002F...` or platform test script).\n6. Mark the task `- [x]` in the session's `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md` — on pi that file is the sole step tracker; on OpenCode mirror the same transition into that harness's todo list.\n\n### Step 5: Witness Gate Evaluation\n\nRun the declared witness command:\n```bash\n# Example witness commands:\ngo test -v .\u002Finternal\u002F\u003Cpkg>\u002F...\nfak validate --mine \u003Cpath1> \u003Cpath2>\npython tools\u002F\u003Cvalidator>.py --check\n# Live hardware sub-component witnesses:\nfak validate --strix --subkernels=all --ablate=all\nmake mac-perf\nmake cuda-accept\n```\n\n- **Exit code != 0**: Append the failure to `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md`, formulate a targeted fix, and re-run. If the failure exposes an insurmountable high-difficulty boundary, land the verified partial deliverables (e.g. reproduction witness), record a scoped `ABSTAIN` for the specific boundary, and state the exact checkable next step rather than dropping the run.\n- **Exit code == 0**: Witness criterion is satisfied. Proceed to completion.\n\n### Step 6: Completion and Evidence Sealing\n\n1. Record final witness evidence and timestamp in `_scratch\u002Fgoals\u002FGOAL.md`. Files under `_scratch\u002F` are ignored by git (`\u002F_*`) and must never be staged or committed.\n2. If registered in `fak goal`:\n   ```bash\n   fak goal transition --id \u003Cgoal_id> --lifecycle achieved --evidence-class independent_witness --evidence-ref \"\u003Cwitness-command>\"\n   ```\n3. **Safe Git Sync, Commit, and Push by Default**:\n   Do more work by default. When the change is verified green, complete the full delivery lifecycle without waiting for an operator prompt:\n   ```bash\n   # 1. Pre-flight safe sync with origin\u002Fmain:\n   fak sync reconcile --apply\n\n   # 2. Preview commit subject and lane:\n   fak commit --preview -m \"\u003Csubject> (fak \u003Cleaf>)\" --path \u003Cp1> --path \u003Cp2>\n\n   # 3. Stage-and-commit by explicit path (never stage _scratch\u002F):\n   fak commit --path \u003Cp1> --path \u003Cp2> -m \"\u003Csubject> (fak \u003Cleaf>)\"\n\n   # 4. Safe push unprompted:\n   fak sync push\n   # (or combine commit and push: `fak commit --path \u003Cp1> ... -m \"...\" --push`)\n   ```\n4. Emit a concise, verdict-first completion report (\u003C3 lines), oriented toward forward movement:\n   - **Line 1**: Goal status and witness confirmation.\n   - **Line 2**: Deliverables and touched paths.\n   - **Line 3**: Checkable verification command or next forward step.\n\n---\n\n## Tool Mapping Across Agent Harnesses\n\n| Operation | pi (primary) | OpenCode | Claude Code | Codex \u002F fakc |\n|---|---|---|---|---|\n| Step tracking | markdown checklist in the goal scratch file (`- [ ]` \u002F `- [x]`); pi has no `todowrite` tool | `todowrite` | `TodoWrite` \u002F markdown | `update_plan` |\n| File inspection | `read`, `grep`, `find`, `ls` | `read`, `glob`, `grep` | `Read`, `Glob`, `Grep` | `read_file`, `glob` |\n| Code editing | `edit`, `write` | `edit`, `write` | `Edit`, `Write` | `edit_file` |\n| Execution | `bash`, `powershell` | `bash` | `Bash` | `shell_command` |\n| Subagents | `subagent` (agent scope `user`, `project`, or `both`) | `task` | `Task` | detached worker |\n\nOn pi the goal checklist is a plain markdown file, not a tool call. Render the plan\nitems as `- [ ]` lines in `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`, flip the active one to\n`- [ ]`-with-an-in-progress note, and mark finished items `- [x]`. Editing that file is\nthe step-tracking operation; there is no separate todo tool to call.\n\n---\n\n## Verification and Witness\n\nVerify this skill definition using the project gates:\n\n```bash\n# 1. Structural admission and anti-slop verification:\npython tools\u002Fskill_slop_scorecard.py .claude\u002Fskills\u002Fgoal\u002FSKILL.md --corpus .claude\u002Fskills\n\n# 2. Frontmatter portability check:\npython tools\u002Fskill_frontmatter_lint.py --check\n\n# 3. Synchronize cross-harness adapter for OpenCode (.agents\u002Fskills\u002Fgoal\u002FSKILL.md):\ngo run .\u002Fcmd\u002Ffak-project-assets sync --json\n\n# 4. Verify zero unexplained parity gaps across harnesses:\ngo run .\u002Fcmd\u002Ffak-project-assets parity --json\n```\n\nExit code 0 across all checks verifies full portability, compliance with the Agent Skills standard, and zero-gap availability in OpenCode.\n","# \u002Fgoal — Autonomous Goal-Directed Execution Loop\n\nAn autonomous execution skill that drives a high-level objective to verified completion. While awaiting native OpenCode `\u002Fgoal` runtime primitives, this skill provides a battle-tested goal loop immediately across OpenCode, Claude Code, and Codex.\n\nIt unifies the best patterns from existing open-source agent systems:\n- **Ralph Loop (Geoffrey Huntley, Vercel `ralph-loop-agent`)**: Durable state on disk (`GOAL.md`), surviving context compaction and session restarts.\n- **OpenAI Codex `\u002Fgoal` & Aider `\u002Farchitect`**: Two-phase structured planning, maintaining the objective anchor, and active checklist management.\n- **All-Hands OpenHands (OpenDevin) & SWE-agent**: Reproduction-first discipline, minimal surgical edits, and external exit-gates (rejecting the self-assessment trap).\n- **Fak Goal Specs & Registry**: Native compatibility with `docs\u002Fgoal-spec.md`, `docs\u002Ftemplates\u002FGOAL.md`, and the `fak goal` registry (`internal\u002Fgoalregistry`).\n\n---\n\n## The Five Invariants of Goal Execution\n\n1. **The Objective Pin**: The objective statement is pinned verbatim and never mutates during the run. Pinning prevents goal drift (Arike et al., 2025).\n2. **State on Disk, Not Ephemeral Memory**: Progress, plans, and scratchpad live in `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`) on disk. Goal specs are noisy, disposable scratchpad memory for surviving context compaction; they are not coordination artifacts. First-class coordination occurs via lane leases (`dos arbitrate` \u002F `internal\u002Fleaseref`), claims (`CLAIMS.md`), issue comments, and commit trailers.\n3. **External Witness Exit-Gate (and Live Hardware Shift-Left)**: Model proposes, test disposes. The agent never grades its own work. A goal is satisfied only when a deterministic external command (test suite, buildcheck, validator) exits 0. For tasks touching hardware, compute kernels, or accelerator paths (CUDA, Vulkan, Metal, APU\u002FUMA), bias heavily toward testing sub-components on live physical hardware (divide and conquer) with high volume and frequency (e.g. `fak validate --strix --subkernels=...`, `make mac-perf`, `make cuda-test`) rather than relying on synthetic host mocks or deferring verification to monolithic post-merge runs.\n4. **Atomic S0\u002FS1 Steps (Divide & Conquer, Subdivide, and Scope Abstention)**: Divide and conquer substantive or multi-concern objectives into atomic leaves (1–3 files touched per step). When tasks have independent components, delegate to isolated subagents or workers (`task`: worker, researcher, explore, cross-validator) to prevent coordinator context pollution. Divide and conquer applies to compute pipelines as well: decompose hardware verification into isolated sub-components (sub-kernels, GEMV\u002FGEMM microbenchmarks, Vulkan primitives) to execute on live hardware frequently and in high volume. Parallel subagent cohorts (4–8 parallel subagents across independent packages, tests, or diagnostic probes) are authorized while maintaining the single active goal milestone in the goal checklist. Top-level coordinators fan out subagents, while leaf workers execute directly without nested recursion (#12028). Keep exactly one step `in_progress` in the goal checklist. When encountering high-difficulty boundaries (e.g. frozen ABI, kernel SIMD), scope abstention strictly to the bounded aspect: emit a structured `ABSTAIN` record for that boundary while advancing all independent, safe, solvable sub-components (reproduction tests, diagnostics, disjoint packages).\n5. **Failure Memory Scratchpad & Persistence (Move Forward Over Conclusions)**: Genuine guard refusals carrying a closed reason token or unexpected process crashes are recorded in `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`). Routine CLI return codes from read-only commands (such as `grep` returning 1 on no match, or `git diff --quiet` detecting changes) are normal tool execution results and must not be logged as failures in `# Scratch \u002F last-refusal`. A refusal or tool crash is diagnostic feedback, not a session abort. Query `fak recover \u003CTOKEN>` for structured recovery, adapt the execution path or decompose the step, and maintain momentum on the pinned objective without repeating identical failing calls. Focus on forward momentum over terminal conclusions: rather than defeatist conclusions when a step underperforms (e.g. rather *\"the next step to get better performance is X\"* than *\"X didn't work ... therefore we suck...\"*), treat unmet targets as empirical data that eliminates a variable, and formulate the concrete next checkable step.\n\n---\n\n## Execution Protocol\n\n### Step 1: Intake and Objective Pinning\n\nParse `$ARGUMENTS` (e.g. `\u002Fgoal Fix memory leak in auth service --witness \"go test .\u002Finternal\u002Fauth\u002F...\"`). If no argument was provided, do not prompt the operator - default to acting: derive the best-supported objective from evidence (the active goal, open WIP, tickets, or the repo's default work object) and proceed. Resolve a surfaced choice through the `internal\u002Fchoicetriage` fold: take the obvious move (`TAKE_OBVIOUS`); hand a knowable-but-unobvious question to a **fresh context window at the top tier** (`FRESH_CONTEXT`, the default); or decompose scope too large for this context into a ticket (`FILE_TICKET`). Only an irreducible policy\u002Fauth\u002Frelease\u002Fpriority\u002Ftrust decision (`HUMAN_RESIDUAL`) legitimately returns to a person - and it must be **earned** by a real authority signal, never manufactured by phrasing status as a question. An unattended goal run that opens by asking a person has silently stalled.\n\nFormulate three fields:\n- **Objective Pin**: Exactly one clear, measurable end-state.\n- **Non-Goals \u002F Scope Fences**: Explicitly state what is NOT part of this run to prevent over-scaffolding and companion abstraction sprawl.\n- **Witness Criterion**: The exact deterministic command that proves success (e.g. `go test -v .\u002Finternal\u002Fgateway\u002F... -run TestGatewayReady` or `fak validate --mine \u003Cpaths>`).\n\n### Step 2: Initialize Durable Scratch State (_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md; its checklist is the step tracker)\n\nEnsure directory exists (`mkdir -p _scratch\u002Fgoals`) and create or update `_scratch\u002Fgoals\u002FGOAL.md` (or `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`). Never create or commit a tracked `GOAL.md` at the workspace root. Goal specs are local, disposable execution scratchpad memory. First-class coordination occurs via lane leases (`dos arbitrate`), claims (`CLAIMS.md`), issue comments, and commit trailers (`(fak \u003Cleaf>)`).\n\n```markdown\n\u003C!-- Active goal spec saved under _scratch\u002Fgoals\u002FGOAL.md or _scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md (never committed) -->\n---\nloop: goal\nwitness: \u003Cwitness command or criterion>\nbudget: { max_iters: 20 }\n---\n# Objective\n\u003CPinned objective statement>\n\n# Non-Goals\n- \u003CExplicit exclusion 1>\n- \u003CExplicit exclusion 2>\n\n# Plan\n- [ ] 1. Reproduce baseline behavior or establish failing test\n- [ ] 2. Implement minimal surgical fix or feature\n- [ ] 3. Run package-level verification and regression checks\n- [ ] 4. Execute final witness command\n\n# Scratch \u002F last-refusal\n```\n\nIf the `fak` binary is available, optionally register the goal in the canonical registry:\n```bash\nfak goal create --title \"\u003Ctitle>\" --summary \"\u003Csummary>\"\n```\n\nIf running on pi (or any harness with no todo tool), the plan items ARE the tracker: keep\n`- [ ]` \u002F `- [x]` state in the goal scratch file and mirror it in the plan block. In\nOpenCode, additionally populate `todowrite` with the plan items, marking the first item\n`in_progress`.\n\n### Step 3: Baseline Reproduction First (SWE-agent Invariant)\n\nBefore editing code:\n1. Locate relevant files using `Glob`, `Grep`, and `Read`.\n2. Execute the existing tests or create a reproduction test case.\n3. Capture the baseline failure or diagnostic. A defect is only proven fixed when the test failed before and passes after.\n\n### Step 4: Atomic Sequential Execution\n\nIterate through plan items sequentially:\n1. **Divide and conquer by delegation**: For substantive, complex, or multi-component goals, launch specialized subagents concurrently for independent parts (e.g. `task` with `worker` for implementation, `researcher` for prior art, `cross-validator` for verification). Pull only compact receipts and decisions into the coordinator.\n2. Keep only one step marked in-progress in the goal checklist.\n3. Confine edits to 1–3 closely related files using `Edit` or `Write`.\n4. If a command or tool fails:\n   - Routine CLI return codes from read-only commands (such as `grep` returning 1 on no match, or `git diff --quiet` detecting changes) are normal tool execution results and must not be logged as failures in `# Scratch \u002F last-refusal`.\n   - Log only genuine guard refusals carrying a closed reason token or unexpected process crashes to `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md`.\n   - Query structured recovery: if a guard refused the call, run `fak recover \u003CTOKEN>` or `dos man wedge \u003CTOKEN> --explain` to obtain the sanctioned remedy.\n   - For `MERGE_IN_PROGRESS`, `COLLISION_RISK`, or `LOCK_BUSY`, inspect the\n     typed recovery, wait for quiescence, or continue an independent disjoint\n     subtask. These tokens grant no authority to change the index.\n   - For an actual owned `PRESTAGED_PATH_OVERLAP`, the native recovery accepts\n     one existing regular tracked stage-0 modification in its managed ticket\n     checkout. Retain the original `EXECUTING` claim's worker and explicit\n     epoch, confirm the path is in scope, and preview with full content pins:\n     ```bash\n     fak-run fak-flow index unstage --repo-root \u003Cmanaged-checkout> --path \u003Cowned-path> --expected-head \u003Cfull-head> --expected-index-blob \u003Cstage-0-blob> --expected-worktree-sha256 \u003Csha256> --ticket \u003Cticket> --worker \u003Coriginal-worker> --epoch \u003Coriginal-epoch> --json\n     fak-run fak-flow index unstage --repo-root \u003Cmanaged-checkout> --path \u003Cowned-path> --expected-head \u003Cfull-head> --expected-index-blob \u003Cstage-0-blob> --expected-worktree-sha256 \u003Csha256> --ticket \u003Cticket> --worker \u003Coriginal-worker> --epoch \u003Coriginal-epoch> --json --expected-index-generation \u003Cpreview-token> --owner-authorized --apply\n     ```\n     Review the preview before applying with its exact generation token and\n     unchanged pins. The owner attestation supplements live SDK\u002Fscope checks.\n     A refusal preserves source and index; keep other work and peers untouched.\n   - Decompose rather than abandon: if a subtask is blocked or too complex, divide it into smaller verifiable leaves (e.g. capture baseline reproduction tests first) while keeping the pinned objective intact.\n   - Adapt the approach: halt repetition of the identical failing call; select a sanctioned alternative tool or modified arguments.\n5. Verify the step using package tests (`go test .\u002Finternal\u002F\u003Cpkg>\u002F...` or platform test script).\n6. Mark the task `- [x]` in the session's `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md` — on pi that file is the sole step tracker; on OpenCode mirror the same transition into that harness's todo list.\n\n### Step 5: Witness Gate Evaluation\n\nRun the declared witness command:\n```bash\n# Example witness commands:\ngo test -v .\u002Finternal\u002F\u003Cpkg>\u002F...\nfak validate --mine \u003Cpath1> \u003Cpath2>\npython tools\u002F\u003Cvalidator>.py --check\n# Live hardware sub-component witnesses:\nfak validate --strix --subkernels=all --ablate=all\nmake mac-perf\nmake cuda-accept\n```\n\n- **Exit code != 0**: Append the failure to `# Scratch \u002F last-refusal` in `_scratch\u002Fgoals\u002FGOAL.md`, formulate a targeted fix, and re-run. If the failure exposes an insurmountable high-difficulty boundary, land the verified partial deliverables (e.g. reproduction witness), record a scoped `ABSTAIN` for the specific boundary, and state the exact checkable next step rather than dropping the run.\n- **Exit code == 0**: Witness criterion is satisfied. Proceed to completion.\n\n### Step 6: Completion and Evidence Sealing\n\n1. Record final witness evidence and timestamp in `_scratch\u002Fgoals\u002FGOAL.md`. Files under `_scratch\u002F` are ignored by git (`\u002F_*`) and must never be staged or committed.\n2. If registered in `fak goal`:\n   ```bash\n   fak goal transition --id \u003Cgoal_id> --lifecycle achieved --evidence-class independent_witness --evidence-ref \"\u003Cwitness-command>\"\n   ```\n3. **Safe Git Sync, Commit, and Push by Default**:\n   Do more work by default. When the change is verified green, complete the full delivery lifecycle without waiting for an operator prompt:\n   ```bash\n   # 1. Pre-flight safe sync with origin\u002Fmain:\n   fak sync reconcile --apply\n\n   # 2. Preview commit subject and lane:\n   fak commit --preview -m \"\u003Csubject> (fak \u003Cleaf>)\" --path \u003Cp1> --path \u003Cp2>\n\n   # 3. Stage-and-commit by explicit path (never stage _scratch\u002F):\n   fak commit --path \u003Cp1> --path \u003Cp2> -m \"\u003Csubject> (fak \u003Cleaf>)\"\n\n   # 4. Safe push unprompted:\n   fak sync push\n   # (or combine commit and push: `fak commit --path \u003Cp1> ... -m \"...\" --push`)\n   ```\n4. Emit a concise, verdict-first completion report (\u003C3 lines), oriented toward forward movement:\n   - **Line 1**: Goal status and witness confirmation.\n   - **Line 2**: Deliverables and touched paths.\n   - **Line 3**: Checkable verification command or next forward step.\n\n---\n\n## Tool Mapping Across Agent Harnesses\n\n| Operation | pi (primary) | OpenCode | Claude Code | Codex \u002F fakc |\n|---|---|---|---|---|\n| Step tracking | markdown checklist in the goal scratch file (`- [ ]` \u002F `- [x]`); pi has no `todowrite` tool | `todowrite` | `TodoWrite` \u002F markdown | `update_plan` |\n| File inspection | `read`, `grep`, `find`, `ls` | `read`, `glob`, `grep` | `Read`, `Glob`, `Grep` | `read_file`, `glob` |\n| Code editing | `edit`, `write` | `edit`, `write` | `Edit`, `Write` | `edit_file` |\n| Execution | `bash`, `powershell` | `bash` | `Bash` | `shell_command` |\n| Subagents | `subagent` (agent scope `user`, `project`, or `both`) | `task` | `Task` | detached worker |\n\nOn pi the goal checklist is a plain markdown file, not a tool call. Render the plan\nitems as `- [ ]` lines in `_scratch\u002Fgoals\u002FGOAL-\u003Cslug>.md`, flip the active one to\n`- [ ]`-with-an-in-progress note, and mark finished items `- [x]`. Editing that file is\nthe step-tracking operation; there is no separate todo tool to call.\n\n---\n\n## Verification and Witness\n\nVerify this skill definition using the project gates:\n\n```bash\n# 1. Structural admission and anti-slop verification:\npython tools\u002Fskill_slop_scorecard.py .claude\u002Fskills\u002Fgoal\u002FSKILL.md --corpus .claude\u002Fskills\n\n# 2. Frontmatter portability check:\npython tools\u002Fskill_frontmatter_lint.py --check\n\n# 3. Synchronize cross-harness adapter for OpenCode (.agents\u002Fskills\u002Fgoal\u002FSKILL.md):\ngo run .\u002Fcmd\u002Ffak-project-assets sync --json\n\n# 4. Verify zero unexplained parity gaps across harnesses:\ngo run .\u002Fcmd\u002Ffak-project-assets parity --json\n```\n\nExit code 0 across all checks verifies full portability, compliance with the Agent Skills standard, and zero-gap availability in OpenCode.\n",{"name":5,"metadata":24,"description":7,"allowed-tools":27,"argument-hint":28,"user-invocable":29,"disable-model-invocation":20},{"canonical":25,"generated-by":26},"..\u002F..\u002F..\u002F.claude\u002Fskills\u002Fgoal\u002FSKILL.md","fak project-assets sync","Read, Edit, Write, Grep, Glob, Bash","[objective] [--witness \u003Ccommand>] [--budget \u003Citers>] [--dry-run]",true,"main","f565b7b7db63e79649f3a02c08108132a86c5d05",".agents\u002Fskills\u002Fgoal",16,"https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak","https:\u002F\u002Fanthony-chaudhary.github.io\u002Ffak\u002Fshowcase.html","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary","https:\u002F\u002Flinkedin.com\u002Fin\u002Fanthonychaudhary","2026-11-15 03:06:00",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":29},[41,44,47],{"tool":42,"command":43},"npx","npx skills add anthony-chaudhary\u002Ffak --skill goal",{"tool":45,"command":46},"bunx","bunx skills add anthony-chaudhary\u002Ffak --skill goal",{"tool":48,"command":49},"pnpm","pnpm dlx skills add anthony-chaudhary\u002Ffak --skill goal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgoal\u002FSKILL.md",[],[53,60,69,76,83,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78V4059KRP2T88YR6Z05MJQ","serve-receipt","On-demand research protocol + deterministic receipt for serving a Hugging Face model on a concrete GPU target — fan out research lanes (model facts\u002Ffiles, engine support matrix, serving recipes, KV\u002Fstate memory math), compute the tiered feasibility verdict with `fak serve-receipt` (never narrated math), and emit a witnessed launch receipt. Use when asked for an \"initial config\", \"serving receipt\", or \"how do I serve \u003Cmodel> on \u003CGPUs>\".","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fserve-receipt\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":64,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M77HRGKQV2CJ2K6ZFN4YQ32K","caveman","Ultra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says \"caveman mode\", \"talk like caveman\", \"use caveman\", \"less tokens\", \"be brief\", or invokes \u002Fcaveman. Also auto-triggers when token efficiency is requested.","MIT","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fsyspromptmmu\u002Fthird_party\u002Fcaveman\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fsyspromptmmu\u002Fthird_party\u002Fcaveman\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M77HRAY3Y3BE7APN5PVJF7NV","quality-report","Score the repo quality and emit a report card.","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fctxplans\u002Ftestdata\u002Frepo\u002F.claude\u002Fskills\u002Fquality-report\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M77HR9807KHAX13DG9PW2K2Q","ctx-overlay","Compact the context window and prune the memory store when a session grows too long.","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fctxplans\u002Ftestdata\u002Frepo\u002F.claude\u002Fskills\u002Fctx-overlay\u002FSKILL.md",[],[],{"skillNo":84,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M77HR7XQ9X8F2CY9Z4F2ZEZ3","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fctxplanlint\u002Ftestdata\u002Frepo\u002F.claude\u002Fskills\u002Fquality-report\u002FSKILL.md",[],[],{"skillNo":89,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M77HR5BVKCTR1WNJGRBSDNX7","https:\u002F\u002Fgithub.com\u002Fanthony-chaudhary\u002Ffak\u002Fblob\u002Fmain\u002Finternal\u002Fctxplanlint\u002Ftestdata\u002Frepo\u002F.claude\u002Fskills\u002Fctx-overlay\u002FSKILL.md",[],[]]