Выполнить один тикет в свежей сессии — с доказательствами и коммитом. Executor contract for one task packet (ticket) in a fresh session — execute, prove by verification, commit, update status/Результат/journal. Use when asked to «выполни тикет T-###», «выполни task-пакет T-###», «возьми пакет в работу», run a task packet, execute ticket T-###.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pf Do?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/turvodnik-pf-do)
---
name: pf-do
description: Выполнить один тикет в свежей сессии — с доказательствами и коммитом. Executor contract for one task packet (ticket) in a fresh session — execute, prove by verification, commit, update status/Результат/journal. Use when asked to «выполни тикет T-###», «выполни task-пакет T-###», «возьми пакет в работу», run a task packet, execute ticket T-###.
---
# pf-do — executing a task packet
Always communicate with the user in the user's language (Russian in the origin system). File formats, section names and statuses stay exactly as written below.
You are the executor of one packet. The context is minimal by design: the packet + AGENTS.md. Do not ask for other chats' history — the packet must contain everything needed; anything missing is a blocker, not a license to guess.
## Steps
1. Read the packet `.agents/runtime/tasks/T-###-*.md`, the project's AGENTS.md and the global rules. If any dependency in `depends_on` is not `done` — stop and report. Exception: the pf-auto orchestrator may explicitly allow starting on top of a dependency still in `review`, but only as a decision recorded in the wave registry (pf-auto step 2, with a reason) — without that recorded exception, `review` does not clear the gate, stop. If a task HANDOFF is kept (pf-handoff companion, §13) — honor its «Состояние» and «Не делать».
2. Set `status: in_progress`, `owner: <you>`, refresh `updated`.
3. Execute the task step by step. §11 principles: minimal targeted edits; found a bug — root cause first (systematic-debugging), then the fix. A non-obvious assumption you are about to make on the human's behalf — name it in «Результат»/chat BEFORE implementing, not after (silent guesses are the top source of rework). Long packet — record progress as you go (interim notes in «Результат», committed as you go; a HANDOFF checkpoint (§13) only when you are a standalone executor with no orchestrator — under an orchestrator the HANDOFF is its own, do not create or rewrite one) instead of hoarding it until the end: hit the window limit and the finished part must not be lost.
4. Blocker (no access, contradiction in the task, neighboring code broken): `status: blocked`, reason in «Результат», journal entry, stop. Do NOT slip past a blocker with a silent "almost done". **Commit what was done before the blocker** («T-###: blocked — сохраняю сделанное, <причина>»): the working tree stays clean and the next session sees how far you got. The status stays until a human unblocks.
Special case — **secrets**: the task needs a key value but `ai-secret` is unavailable in your mode (subagents and headless runs are often restricted) — that is an immediate blocker: `blocked` + «нужна интерактивная сессия с доступом к scope <имя>». Do not work around it, do not ask for the value in chat, do not burn rounds on it.
4a. **Long runs** (a test suite over ~2 min, an installer, a build, a subagent you launched): commit what is done BEFORE starting the run — a result that arrives after a window limit or a session change must not find an uncommitted tree. Run it with `run_in_background` and wait by a blocking call only, as the LAST tool call of the turn: `TaskOutput(task_id, block=true)` (re-issue until the result is in) or, where `TaskOutput` is not available, a foreground `Bash` with an `until`/`while` wait loop or a `--wait` (`timeout` ≤ 600 000 ms, re-issue on expiry). `Monitor` is a background stream, not a wait. Ending the turn with «Жду» / "Wait" and expecting the notification to start a new turn is forbidden: delivery is not guaranteed over hours (15.09: lost with Monitor/subagent notifications after hours idle — executor T-106 stood for hours); short runs do resume (T-109), but the contract does not rely on it, and the `wait-guard.sh` Stop hook blocks such a turn for an orchestrator.
4b. **Output diet in the autopilot.** When the dispatch prompt carries `PF_AUTOPILOT=1` (pf-auto, template 1 — it is a prompt line, not a shell variable: Bash calls share no environment), every command with an expected output over ~200 lines (a full test suite, `git log`, an installer, a build) runs through `bash <absolute path to pf-run.sh from the prompt> -- <command>` (no path in the prompt: `PR=$(ls ~/.claude/skills/pf-do/scripts/pf-run.sh ~/.codex/skills/pf-do/scripts/pf-run.sh ~/.gemini/skills/pf-do/scripts/pf-run.sh 2>/dev/null | head -1); bash "$PR" -- <command>`). The full output goes to a file (`PF_RUN_DIR`, else `<repo>/.agents/runtime/out/` — make sure that path is in the project's `.gitignore`), the window gets head 10 + tail 30 (60 on failure) + failure-looking lines + `saved: <path> (<N> lines, rc=<code>)`; the exit code is the command's. In «Результат» quote the `saved:` line as the proof — the reviewer opens the file — never the pasted output. Outside the autopilot the wrapper is optional.
5. Before finishing — check EVERY acceptance criterion against fresh command output (verification-before-completion). No proof — not done. Second opinion is a question of **when, not whether**: on M/L the advisor is called at three fixed points (approach before the first edit; two failed attempts on one problem; before claiming done), one question with 2–3 named options and what is already proven, ≤3 calls per ticket — `references/second-opinion.md`. No advisor in this environment — skip it silently, exactly like Codex below.
5b. **Evals smoke** (`evals.sh smoke <plugin> [--tag <skill>]`, SPEC-plugin-evals p. 1, 6; T-146; `PF_TOOLS` — the canon root, `$HOME/ai/_tools` by default, the same resolver convention as the other pf-do scripts). If this ticket's diff touches a distribution's role file (`agents/*.md`, canon `skill-library/agents/*.md`), skill file (`skills/*/SKILL.md`, `skills/*/references/*`, canon `skill-library/skills/*/SKILL.md`, `skill-library/skills/*/references/*`), or hook (`hooks/*.sh`, `context-hooks/*.sh`, canon `skill-library/hooks/*.sh`) — run the cheap eval suite for the touched plugin BEFORE the Codex pre-pass (step 5a is Codex, not the reviewer — the reviewer is pf-auto's gate, step 4). **In the autopilot** (dispatch prompt carries `PF_AUTOPILOT=1`) — skip this here: pf-auto step 4 runs it at every gate invocation for this wave, not per executor; running it again per-ticket only doubles the cost against the same diff. **Outside the autopilot** (interactive/manual pf-do) — run it yourself, resolving the script through the canon (`evals.sh` is not installed to the global skill surfaces): `EV="${PF_TOOLS:-$HOME/ai/_tools}/skill-library/tests/evals.sh"; if [ -f "$EV" ]; then bash "$EV" smoke <plugin> <tag-args>; else echo "evals smoke: unavailable — $EV не найден (PF_TOOLS?)"; fi` where `<plugin>` = `pf-workflow` or `pf-handoff`, resolving to the dev clone `repos/<plugin>`, which must already reflect the edit — **a green run against a stale clone is not proof**: if you edited canon, sync the clone first (`sync-from-tools.sh <canon path>`) and only then run smoke, or the run silently validates the pre-edit skill.
**Tag resolution (`<tag-args>`).** A role/skill file → `--tag <its own name>` (e.g. `pf-reviewer`, `pf-do`; one diff touching several files → one run with several `--tag` flags, `evals.sh` accepts more than one, not a run per file). A hook file has no name of its own to tag with — using the hook's basename as a tag (`--tag wait-guard`) is wrong and produces a false green «пропущен — нет кейсов» when no case happens to carry that literal tag (confirmed: `wait-guard.sh`'s only case is tagged `pf-auto`, not `wait-guard`). Rule: a hook with a documented owning skill uses that skill's tag (`hooks/wait-guard.sh` → `--tag pf-auto`, pf-workflow); a hook with **no** documented owning skill (pf-handoff's `hooks/*.sh` — `context-guard.sh`, `autocheckpoint.sh`, `precompact.sh`, `sessionstart.sh`, `statusline.sh`, `doctor.sh` — none has a case of its own yet) runs the plugin's smoke **without `--tag`** (all of that plugin's cases) — costs a little more, never false-skips.
**rc handling — by the printed reason, not by the bare number** (the script's own header names these exact strings):
- **0** — quote the printed журнал line («evals … smoke: N/M, …» or the «пропущен — нет кейсов» line, both legitimately rc 0) in «Результат».
- **1**, message `evals: plugin eval недоступен на этом аккаунте (…)` — genuinely non-blocking: record «недоступен: <строка>», does not block.
- **1**, any other reason (a real case scored below threshold, `evals: unknown plugin …`, a bad option, an untrusted-and-unscaffolded refusal) — this is either a real red (case below threshold: return the packet like a red test) or a broken command (typo'd plugin name, wrong flag): fix the command and re-run — **never** file it as «недоступен, не блокирует».
- **2**, message `evals: --tag '' (empty tag)` or `evals: … is outside … — not trusted …` — a refused invocation (nothing ran, no JSON): the command itself is broken (empty tag, untrusted path) — fix it (name the tag, or `--trust` only for a plugin you'd run unsandboxed) and re-run; not «partial».
- **2**, message `evals: partial run — reason: <partialReason>` — a real partial run, and the reason decides what happens next: `interrupted` — safe to re-run once; `cost_ceiling` — do **not** blindly re-run (the same `--max-cost-usd 3` ceiling bites again and wastes the spend twice) — record «evals smoke: partial (cost_ceiling)» in «Результат» and ask the human before spending more, do not treat the packet as gated; `auth_failed` — fix the credential first, then re-run, not a blind retry. None of the three is ever relabelled `unavailable` (that reads as a legitimate skip, and a partial run is not one).
- No script at the resolved path (`PF_TOOLS` unset and no canon at `~/ai/_tools`, or the file is missing) — `evals smoke: unavailable — <причина>`, the step is skipped, not a blocker (same convention as 5a's `SC` resolver).
A docs-only diff or a diff outside the globs above skips this step silently — see «When evals are NOT needed» in the plugin's `evals/README.md`.
5c. A behavioral proof about a rules/skill file edited THIS session: order the probe subagent to `Read` it explicitly and quote a line proving the current edition — its own system-prompt snapshot may predate the edit, so a "pass" without that order proves nothing (found live 2026-08-15, T-043).
5a. **Optional second opinion (only if the ticket touched code).** Run `SC=$(ls ~/.claude/skills/pf-do/scripts/codex-review.sh ~/.codex/skills/pf-do/scripts/codex-review.sh ~/.gemini/skills/pf-do/scripts/codex-review.sh 2>/dev/null | head -1); if [ -n "$SC" ]; then bash "$SC" --scope uncommitted; else echo "no script — skip this step"; fi` (the resolver covers every surface the installer writes to; no script — the step is skipped, not an error). It prints `SKIP:` and changes nothing when Codex is absent, unconsented, or the diff is docs-only — that is the normal path, not a failure, and never blocks the ticket. On `OK:` read only the printed digest; open the report file when findings exist. Confirmed findings inside this ticket's scope — fix now and note in «Результат»; anything outside — an observation, not a licence to touch neighbouring code. `FAIL:` means "not reviewed", never "clean" — the verdict is now proof that a review happened (a completion marker), so any output without it fails whatever it looks like. A `NOTE:` line above an `OK:` means the result was accepted on a weaker proof — read it. **A diff too large for one synchronous pass** (the Bash-tool ceiling turns it into `FAIL:` at 540s) goes to the detached mode — and detached means the area under review must stop moving first: commit your work (step 7 explicitly allows several small commits), then `bash "$SC" --async --commit <sha>` → `PENDING: <marker>` at once, the run continuing in the background at full budget. `--scope uncommitted` stays **synchronous only**: asynchronously it is a moving target — codex runs the diff command itself, minutes later, and an emptied working tree comes back as an honest-looking `OK:` with zero findings. Read the result before closing the gate: `bash "$SC" --wait <marker> --timeout 500` (Bash tool `timeout` ≥ 520 000 ms — the default 120 s kills the wait). `PENDING:` alone is **not** a verdict — a ticket whose only evidence is that line has been scheduled, not reviewed; and `FAIL: wait timeout` there means "not finished yet", the one `FAIL:` that is not "not reviewed" — re-run the `--wait`. Details and traps: `references/codex-review.md`. When Codex itself is unavailable — `SKIP: codex CLI not installed`, `SKIP: … not enabled` (no consent), or a `FAIL:` from quota / no output — the council of helpers is the alternative, not a second Codex: `bash "$(dirname "$SC")/council.sh" review --commit <sha>` after your commit, or `git diff HEAD > /tmp/t.diff && … review --diff /tmp/t.diff` for uncommitted work (order = `backends` of council.json, next on refusal, read-only; states, limits: `references/second-opinion.md`). A docs-only `SKIP: diff has no code files` is not a reason to call the council — nothing needs a reviewer there.
6. Fill in «Результат»: what was done, commits, deviations, proofs. A proof is command output, not a from-memory retelling (a claim without a check is a false proof — the reviewer catches it and returns the ticket). Yours is the **positive** half of the proof pair — the fix works on real data; the reviewer owns the hostile half (pf-reviewer, the agent file). Where a criterion could pass by accident, add the negative control yourself: break the thing on purpose and show the check goes red. Before mutating ask: does it hit the CONSUMER, not just the computation; are both guards of one thing removed together; does the guard go red — commit the fix BEFORE mutating: checkout wipes it. Set `status: review` — `done` is set by the human or the reviewer.
7. Commits for this ticket are mandatory: small, with clear messages; secret-scan before committing; hashes go into «Результат» (pf-replan uses them for targeted rollbacks); push to the project's private remote. Journal entry (§10).
## Scripts
`scripts/council.sh` (header = full reference) also starts a fresh-context executor or reviewer as a separate CLI process where the platform has no subagent tool: `council.sh check` before a wave (`доступен:` / `недоступен: <agent> (<reason>)` per agent, saved as `available` in `.agents/council.json`, spends nothing); `council.sh run --task <T-###.md> --role executor|reviewer [--agent claude|codex|agy|grok --model <m>] [--dry-run]` — the executor writes only in its worktree under the same guards as `delegate` (`"delegate": true`, clean worktree, before/after snapshot), the reviewer is read-only, and the launcher appends the outcome to the ticket's «Результат» / «Ревью»; `council.sh ask --agent <a> -f <file>` — one read-only question, the answer on stdout. Without `--agent` the agent and model come from `roles.<role>.primary` in `council.json`; `roles.<role>.fallback` takes over when the primary is unusable (`запасная: <agent>/<model> (<reason>)`). **Warning:** do not set `"delegate": true` in a project whose executor is `claude` (`roles.executor.primary.agent`) until either a sandbox (network off, writes limited to the worktree and `<repo>/.git`) is configured for it and proven by a live run, or `Bash(bash:*)` and `Bash(sh:*)` are removed from its allowlist — through them a script reaches the network and writes outside both trees, where the before/after snapshot does not look.
## Forbidden
- Scope creep ("fixed the neighbor while at it") — record observations in «Результат»/journal, touch nothing.
- Claiming success without fresh proof for every criterion.