build(hermes): unblock RED build + promote inter-session-peer-discipline to auto

Build was RED: 5 skills in skills/ were unmapped (meta-host-routing,
ralph-loop-execution, setup-agents-task-runner, task-format,
using-system-snapshot) — "unmapped entries" abort. Mapped all 5 as `pending`
(conservative placeholder, no auto-commitment; each keeps its own mode decision).
meta-host-routing mapping executes task meta-host-routing-hermes-mapping.

- inter-session-peer-discipline: pending -> auto (category meta). Gate
  ("non-implementer test-trigger + review") satisfied — both VERDICT PASS this
  session; purely behavioral, no tool-side effects, no Windows-PS hook. Human-ratified.
- session-inbox-monitor: reason updated — behavioral gate CLEARED (test-trigger +
  review PASS), STAYS pending on two independent tool-side blockers (Linux port of
  the PS hook + settings.json/process-kill audit), not on behavioral verification.
- dist-hermes regenerated: build now GREEN (auto 14 / manual 2 / skip 9 / pending 13);
  materialized dist-hermes/meta/inter-session-peer-discipline/; synced stale
  using-markitdown / using-tasks copies (source had been bumped without a hermes rebuild).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 12:14:25 +03:00
parent fdb278f358
commit 43f9912c54
5 changed files with 226 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
---
name: using-tasks
version: 1.1.0
version: 1.4.0
description: >
Policy skill for working with an existing `.tasks/` board (per-task files + STATUS.md).
Use whenever the user is switching between tasks, resuming a paused task, starting a new
@@ -33,12 +33,19 @@ If `.tasks/` is **missing**, or `STATUS.md` exists but is non-canonical (e.g. fl
```
<monorepo-root>/
.tasks/
STATUS.md ← board: one block per task, sorted by priority
STATUS.md ← active board: 🔴 / 🟡 / ⚪ / 🔵 blocks, sorted by priority
<task-slug>.md ← deep context per task, one file each
.lock ← runtime session lock; **gitignored** (never committed)
archive/
YYYY-MM.md ← 🟢 done blocks moved off the board, one file per month
```
Commit `.tasks/` to git. Decision history is valuable; diffs show how thinking evolved.
`STATUS.md` is the **active** board — it must stay lean so orientation reads stay cheap. Closed 🟢 tasks are archived to `archive/YYYY-MM.md` once they pile up; see "### Archiving done tasks".
> **`.tasks/.lock` must be listed in `.gitignore`** (add `.tasks/.lock` to your project's `.gitignore`). The lock file is ephemeral runtime state, not project history — it must never be committed.
---
## STATUS.md format
@@ -52,6 +59,7 @@ _Updated: YYYY-MM-DD_
**Where I stopped:** one sentence — the exact thought or action interrupted
**Next action:** one concrete step to resume immediately
**Blocker:** (only if blocked) what is preventing progress
**Session break:** (optional) `true` — or a hint string for the next track. Marks this task as a session boundary.
**Branch:** git branch name
---
@@ -61,9 +69,21 @@ _Updated: YYYY-MM-DD_
- 🔴 Active — currently worked on (only one at a time)
- 🟡 Paused — in progress, resumable
- ⚪ Ready — not started, fully defined
- 🟢 Done — completed, kept until merged
- 🟢 Done — completed; kept on the board until merged, then archived (see "### Archiving done tasks")
- 🔵 Blocked — waiting on external input
### `session_break` marker
A task may carry a `session_break` marker — set by whoever defines the task (e.g. the delegating workshop) when its completion is a natural place to stop and start a fresh session. It signals an autonomous agent: *finish this task, then pause instead of immediately claiming the next one.*
- **Type:** boolean or string.
- `session_break: true` — pause after close; the next track is "see STATUS.md".
- `session_break: "<hint>"` — pause after close; `<hint>` names the recommended next track.
- **Where it lives:** in the task's frontmatter when delivered via the task system (`session_break: true` / `session_break: "<hint>"`); mirrored on the local board as the optional `**Session break:**` field in the task's STATUS.md block.
- **Absent →** behaviour is unchanged: close the task and continue as usual.
The check is enforced in the **Task completion** flow below (after close, before claiming the next task).
---
## Per-task file format (`<task-slug>.md`)
@@ -98,18 +118,35 @@ Temporary hypotheses, links, names of people to consult.
## Agent operations
### Session start
1. Check if `.tasks/STATUS.md` exists. If not → invoke `setup-tasks` and stop here until it returns.
2. Read `STATUS.md`.
3. If user names a task, read its `<task-slug>.md`.
4. Confirm in one sentence: "We're in the middle of X, next step is Y."
5. Ask if the plan is still correct before doing anything.
6. If STATUS.md `_Updated` date is >3 days ago, flag it and ask user to confirm current state.
1. **Session lock guard.** If `.tasks/` exists, read `.tasks/.lock`.
- **Active agent lock** — `type:"agent"` with `heartbeat` ≤ 10 minutes old: print the hard warning below and **require explicit user confirmation** before proceeding. Do not touch the board until the user confirms.
```
⚠️ поллер ведёт <slug> — нельзя работать параллельно
```
(Substitute the `slug` field from the lock file if present, otherwise omit it.)
- **Stale lock** — any type whose TTL has expired (`type:"agent"` with `heartbeat` > 10 min ago; `type:"interactive"` with `started_at` > 2 h ago): silently overwrite.
- **Absent or stale lock** (including after user confirmation): write `.tasks/.lock`:
```json
{"type":"interactive","started_at":"<ISO8601>","ttl_minutes":120}
```
2. Check if `.tasks/STATUS.md` exists. If not → invoke `setup-tasks` and stop here until it returns.
3. Read `STATUS.md` — this is the orientation read (see note below on why it's a local read, not an MCP call).
4. If user names a task, read its `<task-slug>.md`.
5. Confirm in one sentence: "We're in the middle of X, next step is Y."
6. Ask if the plan is still correct before doing anything.
7. If STATUS.md `_Updated` date is >3 days ago, flag it and ask user to confirm current state.
8. If `STATUS.md` holds **≥ 10** 🟢 done blocks, archive them first (see "### Archiving done tasks") so the board you orient on is lean.
> **Orient by reading the local `STATUS.md`, not an MCP call.** It is the live board and — kept lean by archival — cheap to read. Do **not** reach for projects-meta tools to enumerate the current project's board:
> - `tasks_aggregate` is cache-based, cross-project, and does **not** index ready/done — its own docs say to read `.tasks/STATUS.md` directly for the current project.
> - `tasks_get_status(target_project, slug)` returns a **single** task's live status (`{status, found}`) by a slug you already know — it cannot list the board. Use it only to check **one** known task (e.g. confirm a delegated task's board state, or detect async-human parking), never for orientation.
### Session end / pause / switch
1. Update `STATUS.md`: set current task to 🟡, update "Where I stopped" and "Next action".
2. Append to `<task-slug>.md` Decisions log any non-obvious choices made this session.
3. Move finished items to "Completed steps".
4. Commit: `git add .tasks/ && git commit -m "chore: update task status [<task-slug>]"`
1. **Release session lock.** If `.tasks/.lock` exists and contains `"type":"interactive"`: delete `.tasks/.lock`. (Stale interactive locks are cleaned up here too; silently delete any interactive lock regardless of TTL.)
2. Update `STATUS.md`: set current task to 🟡, update "Where I stopped" and "Next action".
3. Append to `<task-slug>.md` Decisions log any non-obvious choices made this session.
4. Move finished items to "Completed steps".
5. Commit: `git add .tasks/ && git commit -m "chore: update task status [<task-slug>]"`
### Task switch
1. Perform session-end operations for the current task.
@@ -133,6 +170,43 @@ Temporary hypotheses, links, names of people to consult.
3. Set status to 🟢 in STATUS.md.
4. Append final summary line to Decisions log.
5. Remind user to delete the branch after merge.
6. **Session-break check (after close, before claiming the next task).** Once the task is 🟢 and committed — and **before** any `tasks_claim_next` or starting the next task — read the closed task's `session_break` marker (its frontmatter `session_break`, or the `**Session break:**` field in its STATUS.md block). If present:
- Print this line **verbatim**, substituting the closed task's slug for `[slug]` and the marker's string value for `[value | "см. STATUS.md"]` (use the literal `см. STATUS.md` when the marker is just `true`):
`🔚 SESSION BOUNDARY — [slug] закрыта. Рекомендую завершить текущую сессию. Следующий трек: [value | "см. STATUS.md"]`
- **Stop.** Do not claim or start the next task.
- If the marker is absent → behaviour is unchanged: proceed to claim / start the next task as usual.
7. **Archival check.** After the close is committed, if `STATUS.md` now holds **≥ 10** 🟢 done blocks, archive them (see "### Archiving done tasks"). This keeps the board lean for the next orientation read.
### Archiving done tasks
🟢 done blocks accumulate in `STATUS.md` and bloat it — and since orientation reads the whole board, a bloated file burns context on every session start (the recurring "huge STATUS.md" complaint). Keep the board lean: done blocks stay only until merged, then move to a monthly archive.
**Threshold.** When `STATUS.md` holds **≥ 10** 🟢 done blocks, archive them. Check at two moments: (a) right after closing a task (Task completion step 7), and (b) at session start, before orienting (Session start step 7). The threshold is a ceiling, not a target — archive in batches; don't churn one block at a time.
**Where.** Append the archived blocks to `.tasks/archive/YYYY-MM.md` — one file per calendar month, keyed by the date of archival. Create `.tasks/archive/` and the month file if absent. If the month file already exists, **append**; never overwrite.
**Archive file format** (header written once, on file creation):
```markdown
# Archived done tasks — YYYY-MM
Moved out of `.tasks/STATUS.md` to keep the active board lean.
Full source is git history; this file is for grep-able historical context.
---
```
…followed by each 🟢 block **verbatim** (including its trailing `---` separator and any `<!-- closed-by … -->` comments).
**After archiving,** `STATUS.md` keeps only 🔴 / 🟡 / ⚪ / 🔵 blocks. Commit the move on its own:
```
git add .tasks/ && git commit -m "meta(tasks): archive done batch → .tasks/archive/YYYY-MM.md"
```
Leave a just-closed 🟢 block on the board only while it's still useful at a glance (pending merge, fresh reference). Everything older goes to the archive.
### Post-commit task closure prompt
@@ -163,6 +237,7 @@ Pair: `using-projects-meta` declares local-first for **reads**; this rule extend
## Rules
- **Honour `.tasks/.lock`** — read the lock at session start before touching the board; write it after clearing the guard; delete it at session end/pause. Never skip the lock check when `.tasks/` exists. The lock file must be gitignored.
- **Never lose "Where I stopped"** — most critical field. If unclear, ask before ending session.
- **One sentence per STATUS.md field** — compress, don't write prose.
- **Key files must be specific** — not "auth module" but `packages/auth/src/useAuth.ts:87`.
@@ -170,5 +245,7 @@ Pair: `using-projects-meta` declares local-first for **reads**; this rule extend
- **Commit after every session end** — git log is the history of thinking.
- **Always confirm orientation at session start** — state understanding before acting.
- **One active task at a time** — only one 🔴 in STATUS.md.
- **Keep the board lean** — orientation reads the local `STATUS.md` whole, so archive 🟢 done blocks to `.tasks/archive/YYYY-MM.md` once ≥10 pile up. Never enumerate the current project's board via `tasks_aggregate` (cross-project cache) or `tasks_get_status` (single-task, by slug). See "### Archiving done tasks".
- **Never close a task without a coverage check** — see "### Task completion" step 1. Acceptance criteria with no evidence → ask, don't auto-close.
- **Honour `session_break`** — a closed task carrying a `session_break` marker means stop after close; never chain into `tasks_claim_next`. See "### Task completion" step 6.
- **Local-first recommendations** — cwd-project board comes first; cross-project urgents are at most one footnote line.