refresh-project
Skill9 starsChanged 41 days agoMITView on GitHub
Recompute the auto-maintained sections (`## Active Tasks`, `## Related Workspaces`) of `projects/{slug}/_project.md` via mention reverse-lookup, sorted by dependency-resolved priority. Idempotent. Use when refreshing a project's surface, or as a leaf invoked internally by `/project`.
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-decisionsSkill
- repairSkill
- retrospectiveSkill
- solveSkill
- syncSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 2 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Create a per-slug lock file at .claude/state/refresh-project-{slug}.lock (per-slug, not global — concurrent refresh of different projects …
- Distinctive: line 45
If the lock already exists, poll for up to 30 seconds (1-second intervals)
- Distinctive: line 46
If still present after the wait, log a warning and exit (leave the existing data stale rather than racing)
- Very specific: line 47
Create the lock atomically (mkdir semantics or set -C + redirect)
- Very specific: line 98
If Unblocked is empty, omit the heading and write _None — see Blocked below or /project {slug} continue to investigate._
- Very specific: line 99
If Blocked is empty, omit the heading
- Very specific: line 100
If both are empty, write _No active tasks.
- Very specific: line 117
If Active is empty, omit the heading and write _No active workspaces.
- Very specific: line 118
If Completed is empty, omit the heading entirely (do not write an empty-case marker — completed history is optional surface)
- Very specific: line 119
If both are empty, emit only the active-empty-case line (no ## Related Workspaces body otherwise)
- Very specific: line 125
Read the entire _project.md
- Very specific: line 128
Write the new content to a tempfile in the same directory, then mv (rename) over the original — mv is atomic on the same filesystem
- Very specific: line 129
If either section is missing from the file (e.g.
- Very specific: line 138
When invoked with --all:
≈ “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-project — Auto-section Refresh for Projects
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 — Claude Code uses its built-in tools as named; Codex CLI usesapply_patch/--search/ shell as appropriate.
Recomputes the two auto-maintained sections of a project's main file (projects/{slug}/_project.md):
## Active Tasks— tasks whose frontmatter containsmentions: [..., projects/{slug}, ...], filtered tostatus: open/waiting, sorted by the dependency-resolved priority defined in/project(see "Dependency Resolution" below for the canonical algorithm)## Related Workspaces— workspaces whose frontmatter containsmentions: [..., projects/{slug}, ...]. Active workspaces are listed first (sorted byupdateddesc), then up to 20 most-recently-touched completed workspaces (also sorted byupdateddesc). Each entry carries an explicitstatus:marker so live vs past surfaces stay visually distinct
Other sections (Goal, Current Focus, Watch, Key Facts, Repository, See Also) are owned by different skills (see .claude/rules/rill-projects.md for the section-ownership table) and must not be touched by this skill.
Arguments
$ARGUMENTS — one of the following:
{slug}(e.g.rill,acme-saas) → Refresh the single project atprojects/{slug}/_project.md--all→ Refresh every project underprojects/*/_project.md(processed sequentially, each under its own per-slug lock)- Omitted → Ask the user which project to refresh, via the harness's question primitive. If invoked internally by another skill, the caller must pass an explicit
{slug}or--all
Procedure
Phase 0: Input validation + lock acquisition
- Resolve
{slug}toprojects/{slug}/_project.md. If the file does not exist:- List similar slugs via
Glob(projects/*)and propose corrections - Exit with a one-line error (do not auto-create a project — that is
/project new's job)
- List similar slugs via
- Create a per-slug lock file at
.claude/state/refresh-project-{slug}.lock(per-slug, not global — concurrent refresh of different projects is allowed)- If the lock already exists, poll for up to 30 seconds (1-second intervals)
- If still present after the wait, log a warning and exit (leave the existing data stale rather than racing)
- Create the lock atomically (
mkdirsemantics orset -C+ redirect)
Phase 1: Tasks reverse-lookup
- Find all task tickets that mention this project:
The trailing word boundaryGrep(pattern="^mentions:.*projects/{slug}\b", path="tasks/", glob="**/_task.md", output_mode="files_with_matches")\bis important to avoid matchingprojects/{slug}-extensionwhen the target is{slug}. - For each matched file, Read the frontmatter and extract:
status,due,scheduled,depends-on,blocks(frontmatter fields)- Task title (the body's first
#heading)
- Filter to
status: openorstatus: waiting. Dropdone,cancelled,someday,draft(drafts are unapproved AI suggestions — they are not part of the project's executable surface yet). - Resolve dependency state:
- A task is unblocked if every entry in its
depends-onresolves to a task withstatus: doneorstatus: cancelled(or ifdepends-onis absent/empty) - A task is blocked otherwise (including the case where a referenced dependency cannot be found — emit a broken-link warning but keep the task in the blocked bucket so it surfaces in
/project review) - Detect
depends-oncycles via DFS; tasks in a cycle are treated as blocked, and the cycle is annotated for/project reviewto surface
- A task is unblocked if every entry in its
- Sort the unblocked tasks by the priority levels P0–P4 defined in the
/projectskill (overdueduefirst → today'sscheduled→ upcomingduewithin 7 days → upcomingdue8–30 days → no date, newest first). Sort blocked tasks separately, by the same rules.
Phase 2: Workspaces reverse-lookup
- Find all workspaces that mention this project:
Grep(pattern="^mentions:.*projects/{slug}\b", path="workspace/", glob="**/_workspace.md", output_mode="files_with_matches") - For each matched file, Read the frontmatter and extract
status,name,updated(orcreatedifupdatedis absent). - Bucket by the workspace's own
status(the workspace enumactive | distill-pending | completed— not the project status enumplanning | active | paused | done):- Active bucket:
status: active - Completed bucket:
status: completedorstatus: distill-pending(closed workspaces —distill-pendingones are closed and waiting in the distill queue; both retain provenance value) - Drop: any other status — legacy values (
status: on-hold,status: planning,status: pilot) and any stray project-vocabulary value (status: paused,status: done) that has leaked into a workspace file; not live, not historical-of-record
- Active bucket:
- Sort each bucket by
updateddescending (most recently touched first). - Cap the Completed bucket at the 20 most-recently-touched entries (older history lives in
See Also, plain Grep, or/project review).
Phase 3: Section rewrite (atomic)
Rewrite ## Active Tasks and ## Related Workspaces in projects/{slug}/_project.md. Preserve every other section verbatim — including any text the user has manually added inside these two sections is not preserved (these are auto-managed; the section-ownership doctrine says manual edits here will be overwritten).
Format — ## Active Tasks
## Active Tasks
### Unblocked
- [ ] [{title}](../../tasks/{slug}/_task.md) — status: {status}{ / due: {due}}{ / scheduled: {scheduled}}
### Blocked
- [ ] [{title}](../../tasks/{slug}/_task.md) — status: {status} / waiting on: [{dep-title}](../../tasks/{dep-slug}/_task.md)- If
Unblockedis empty, omit the heading and write_None — see Blocked below or/project {slug} continueto investigate._ - If
Blockedis empty, omit the heading - If both are empty, write
_No active tasks. Userill taskto create one._ - For each blocked task, list one representative blocker (the first unmet
depends-onentry). Cycle annotations and broken-link warnings are deferred to/project review.
Format — ## Related Workspaces
## Related Workspaces
### Active
- [{name}](../../workspace/{id}/_workspace.md) — status: active / last updated: {updated:YYYY-MM-DD}
### Completed (most recent 20)
- [{name}](../../workspace/{id}/_workspace.md) — status: completed / last updated: {updated:YYYY-MM-DD}- If
Activeis empty, omit the heading and write_No active workspaces. Use/focus<theme>to start one._under## Related Workspaces - If
Completedis empty, omit the heading entirely (do not write an empty-case marker — completed history is optional surface) - If both are empty, emit only the active-empty-case line (no
## Related Workspacesbody otherwise)
Atomicity
The two sections must be rewritten as a single operation so that observers never see a half-written state:
- Read the entire
_project.md - Locate the byte ranges of
## Active Tasksand## Related Workspaces(each section runs until the next##heading or EOF) - Build the new content in memory: prefix (everything before
## Active Tasks) + new## Active Tasks+ middle (everything between the end of## Active Tasksand the start of## Related Workspaces) + new## Related Workspaces+ suffix (everything after## Related Workspaces) - Write the new content to a tempfile in the same directory, then
mv(rename) over the original —mvis atomic on the same filesystem - If either section is missing from the file (e.g. a project created before this skill existed), insert it at the standard position defined in
.claude/rules/rill-projects.mdbody structure (Goal → Current Focus → Active Tasks → Related Workspaces → Watch → Key Facts → ...)
Phase 4: Lock release
- Remove
.claude/state/refresh-project-{slug}.lock - Exit silently on success. Print a one-line summary:
Refreshed projects/{slug}/_project.md — {N} active tasks ({M} unblocked, {K} blocked), {W} active workspaces.
--all mode
When invoked with --all:
Glob(projects/*/_project.md)to enumerate all projects- For each, run Phases 0–4 sequentially (per-slug locks prevent races with any concurrent
/refresh-project {slug}invocation) - Print a one-line per-project summary, then a final aggregate count
Dependency Resolution
The unblocked-vs-blocked judgment and the priority ordering are defined canonically in the /project skill (/project mode-shared algorithm). This skill applies the same algorithm so that /project can rely on the file content directly without recomputing.
- Unblocked: all
depends-onentries resolve to tasks withstatus: doneorstatus: cancelled - Broken link: a
depends-onentry whose targettasks/{slug}/_task.mddoes not exist → treat as blocked, warn in/project review - Cycle:
depends-onchain forming a cycle (A → B → A) → all members treated as blocked, surfaced in/project review - Priority (used only to order the Unblocked list; blocked tasks are listed by the same rule but separately):
- P0:
dueis today or overdue (oldest overdue first) - P1:
scheduledis today or past - P2:
duewithin next 7 days (closest first) - P3:
duewithin next 8–30 days - P4: no
due/ noscheduled(newestcreatedfirst)
- P0:
Idempotency
Running this skill twice in a row produces identical file content (modulo the side effect that the second run leaves the lock briefly held during execution). The function depends only on:
- The set of files matching the mention grep
- Each matched file's frontmatter (
status,due,scheduled,depends-on,mentions,updated) - Each task's body
#heading
There are no time-based or random inputs. Repeat invocations are safe and cheap.
Error handling
| Situation | Behavior |
projects/{slug}/_project.md does not exist | Propose similar slugs, exit with one-line error. Do not auto-create |
| Lock acquisition fails after 30 s wait | Warn and exit. Leave existing data stale (better than racing the other writer) |
| Grep returns zero matches | Write the empty-case template into the section. This is a valid state |
A referenced depends-on task file is missing | Treat as broken link → blocked. Do not fail the run; defer the warning to /project review |
depends-on cycle detected | Mark all members as blocked. Do not fail the run |
| Frontmatter parse error in a matched file | Skip that file with a one-line warning. Do not fail the entire run |
_project.md has neither ## Active Tasks nor ## Related Workspaces | Insert both sections at the standard positions defined in .claude/rules/rill-projects.md |
_project.md is missing required frontmatter (no type: project) | Warn and skip (this is a structural problem better reported than papered over) |
Invocation
Typical callers:
/project {slug} status|continue|review— calls/refresh-project {slug}at the start so subsequent reads see fresh data- Direct user invocation:
/refresh-project rillor/refresh-project --all - Future automation (cron-style): periodic
/refresh-project --allto keep the surface fresh without manual prompting
This skill does not invoke other skills. It is a pure read-grep-write leaf.
Rules
- Never modify
## Goal/## Current Focus/## Watch/## Key Facts/## Repository/## See Also(different section owners per.claude/rules/rill-projects.md) - Never modify
inbox/source files (read-only) - Always use relative Markdown links
[display name](../../relative-path)in the body. Backtick-only ID references are forbidden - Per-slug lock, not global — concurrent refresh of different projects must be allowed
- Atomic write via tempfile +
mvso partial states never become visible - The
--allmode is sequential (one slug at a time); a future enhancement could parallelise it but is out of scope here
See also
.claude/rules/rill-projects.md— section ownership table, body structure.claude/rules/rill-tasks.md—depends-on/blocksfrontmatter schema/projectskill — uses this skill as its first phase
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.

