refresh-decisions
Skill9 starsChanged 41 days agoMITView on GitHub
Recompute the `## Pending Decisions` digest section of `projects/{slug}/_project.md` by collecting line-start `[DECISION-QUEUE]` markers from the project's tasks and the project file itself (decision-loop contract v1.1, ADR-084). Deterministic grep-render-replace, no LLM judgment, idempotent. Use after an agent queues a decision, after a human resolves one, or as a leaf invoked by other skills.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- inbox/CLAUDE.mdCLAUDE.md
- pages/CLAUDE.mdCLAUDE.md
- projects/CLAUDE.mdCLAUDE.md
- tasks/CLAUDE.mdCLAUDE.md
- workspace/CLAUDE.mdCLAUDE.md
- briefingSkill
- clip-tweetSkill
- closeSkill
- distillSkill
- evalSkill
- focusSkill
- inspectSkill
- maintainSkill
- morningSkill
- newsletterSkill
- onboardingSkill
- pageSkill
- pluginSkill
- projectSkill
- pulseSkill
- refresh-projectSkill
- repairSkill
- retrospectiveSkill
- solveSkill
- syncSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Every other section of _project.md is owned by other skills (see the section-ownership table in .claude/rules/rill-projects.md) and must …
- Very specific: line 79
Write entries consequence-framed (ADR-082 D82-8): user-language wording, no internal labels beyond the id needed for addressing.
- Very specific: line 82
If the file has no ## Pending Decisions section yet, insert it directly after ## Current Focus (before ## Active Tasks), per the body …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/refresh-decisions -- Pending-Decisions Digest Refresh
Conduct all conversation with the user — and write all generated output — in the language defined by .claude/rules/personal-language.md (or the user's input language if that file is absent). Follow the language rules in full — exceptions and translation quality are defined in the Language Rules of .claude/rules/rill-core.md and the vault's personal-*.md overrides, never restated per skill. The English instructions below are for skill clarity, not for output style.
Tool references in this skill (
Read,Edit,Grep,Glob,shell) describe intent, not Claude-specific tool calls. Each harness should map them to its native equivalent.
Recomputes one auto-maintained section of a project's main file:
## Pending Decisions-- a digest of every unresolved decision ([DECISION-QUEUE]marker at line start) that belongs to this project, collected from (a) task tickets whose frontmattermentionsincludeprojects/{slug}and (b) project-scoped first-class entries insideprojects/{slug}/_project.mditself (ADR-084 D84-4)
This is the deterministic derived view of the decision-loop contract (ADR-084 D84-5): grep, render, full-section replace. The markers in the source files remain the single source of truth; resolving happens there (a human rewrites [DECISION-QUEUE id=dN] to [DECISION-RESOLVED id=dN ...]), never in the digest. No LLM judgment over decision content is applied.
Every other section of _project.md is owned by other skills (see the section-ownership table in .claude/rules/rill-projects.md) and must not be touched.
Arguments
$ARGUMENTS -- one of:
{slug}-> refresh the single project atprojects/{slug}/_project.md--all-> refresh every project underprojects/*/_project.mdwithstatus: activeorstatus: planning(sequential, per-slug locks)- Omitted -> ask which project, via the harness's question primitive. Internal callers must pass an explicit
{slug}or--all
Procedure
Phase 0: Input validation + lock
- Resolve
projects/{slug}/_project.md. If missing: propose similar slugs viaGlob(projects/*), exit with a one-line error (do not auto-create). - Acquire
.claude/state/refresh-decisions-{slug}.lock(atomicmkdirsemantics; poll up to 30 s; on timeout warn and exit, leaving the section stale rather than racing another writer).
Phase 1: Collect queued decisions
- Task-origin entries:
The closing character class (comma, bracket, whitespace) prevents prefix collisions -- a word boundary alone would letGrep(pattern="^mentions:.*projects/{slug}[,\\]\\s]", path="tasks/", glob="**/_task.md", output_mode="files_with_matches")projects/rillmatchprojects/rill-dev. For each matched file, scan for line-start markers:grep -nE '^(- )?\[DECISION-QUEUE' {file}. - Project-scoped entries: scan
projects/{slug}/_project.mditself with the same line-start pattern, excluding the## Pending Decisionssection (self-reference guard; the rendered digest never uses line-start marker syntax, but the exclusion keeps the recompute well-defined even if a future renderer changes). - For each hit, parse the block that follows the marker line (until the first blank line or the next line-start marker): the human-facing fields
Decision,Background,Choices(with the recommended one),Default,Blocks,More, and theid(ADR-084 D84-7). Parse each field by its label; a field that is absent (commonlyMoreon a self-contained decision) is simply omitted from the render — do not fail or emit a placeholder. Backward compatibility: an entry still using the pre-2026-07-08 labels is read by mappingWhat→DecisionandOptions→Choices(and ignoringWhy AI can't decide), so any decision queued before the D84-7 field revision still renders.- Legacy entries without
id=are included, labeledid=?, with a note that they cannot be consumed until an id is added (ADR-084 D84-2). [DECISION-RESOLVED]blocks are not listed (they are awaiting agent consumption, not human attention).[DECISION-DONE]lines live in History / Decision Log and are ignored.
- Legacy entries without
- Sort deterministically: by source file path (lexicographic), then by numeric id.
Phase 2: Section rewrite (atomic)
Replace the entire ## Pending Decisions section body. Manual edits inside it do not survive (section-ownership doctrine).
Format
## Pending Decisions
_Derived view -- recomputed by `/refresh-decisions`; do not edit here. To resolve, rewrite the `[DECISION-QUEUE id=...]` block in the source file to `[DECISION-RESOLVED ...]` (ADR-084), then re-run the task._
- **{Decision}** -- [{source title}](../../tasks/{task-slug}/_task.md), `id={dN}`
- {Background, rendered verbatim from the marker}
- {Choices, rendered verbatim; keep the recommended marker}
- If left unanswered: {Default}
- Blocked: {Blocks}
- {More links, verbatim, when the entry has them}Render every field verbatim from the source marker -- no summarizing, condensing, or rewording (the skill is deterministic; condensation would be LLM judgment and break idempotency). Keeping Background short is the writer's job at queue time (D84-7), not the digest's. Labels (If left unanswered, Blocked) render in the user's language, consequence-framed. Lead with Decision (the question) so the list scans as questions.
- Write entries consequence-framed (ADR-082 D82-8): user-language wording, no internal labels beyond the
idneeded for addressing. - For project-scoped entries, the source link points to the project file itself.
- Empty case:
_No pending decisions._(a valid, common state). - If the file has no
## Pending Decisionssection yet, insert it directly after## Current Focus(before## Active Tasks), per the body structure in.claude/rules/rill-projects.md.
Atomicity: build the whole new file content in memory, write to a tempfile in the same directory, then mv over the original.
Phase 3: Lock release + summary
- Remove the lock.
- Print one line:
Refreshed projects/{slug}/_project.md -- {N} pending decision(s) ({M} task-origin, {K} project-scoped, {L} legacy id-less).
--all mode
Glob(projects/*/_project.md), filter frontmatter status: active|planning, run Phases 0-3 per slug sequentially, print per-project lines plus an aggregate.
Idempotency
Two consecutive runs produce identical content. Inputs are only: the set of files matched by the mention grep, their line-start [DECISION-QUEUE] blocks, and the project file's own blocks. No time-based or random inputs.
Error handling
| Situation | Behavior |
_project.md missing | Propose similar slugs, one-line error, no auto-create |
| Lock timeout (30 s) | Warn and exit; leave section stale |
| Zero queued decisions | Write the empty-case line -- valid state |
| Malformed QUEUE block (missing fields) | Render what is parseable; append (malformed entry -- fields missing) so the human sees it needs repair. Do not fail the run |
| Marker inside a fenced code block | Line-start grep may false-positive; if the hit is inside a fence, skip it |
No ## Pending Decisions section | Insert at the standard position (after ## Current Focus) |
Invocation
Typical callers:
/solve-- required in autonomous mode: immediately after writing a[DECISION-QUEUE]entry, run this skill for each project the task mentions, so the digest surfaces the entry before the queue-and-exit (the digest must never be stale right after a queue write)- A human -- after resolving entries, to clear them from the digest
/project {slug} status/ future/briefingintegration -- to surface pending counts- Direct:
/refresh-decisions {slug}or/refresh-decisions --all
This skill invokes no other skills. Pure read-grep-write leaf.
Rules
- Never modify any section other than
## Pending Decisions - Never rewrite markers in source files -- this skill renders a view; it must not perform QUEUE -> RESOLVED transitions (that is the human's / the app's move, ADR-084 D84-1) nor consume RESOLVED blocks (that is the resuming agent's move)
- Never modify
inbox/files - Relative Markdown links
[title](../../path)in the body; backtick-only ID references are forbidden - Per-slug lock, atomic tempfile +
mvwrite
See also
- ADR-084 (rill-dev
docs/decisions/) -- decision-loop contract v1.1: marker syntax, writer asymmetry, digest-as-derived-view .claude/rules/rill-autonomous-execution.mdsec. 9 -- the human-decision queue this digest renders.claude/rules/rill-projects.md-- section-ownership table (this skill owns## Pending Decisions)skills/solve/SKILL.md-- writes QUEUE entries and consumes RESOLVED ones on resumeskills/refresh-project/SKILL.md-- sibling deterministic-recompute skill (## Active Tasks/## Related Workspaces)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

