agentleFS
pedropacheco95pedropacheco95/cortex/skills/cortex-fresh/SKILL.md

cortex-fresh

Skill2 starsChanged 25 days agoMITView on GitHub

Keep the store from going stale.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 0 are distinctive, and 7 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.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run cortex store expire --apply and keep its output.

    line 19
  2. Very specific:

    Write the record history/changes/<today>-fresh.md.

    line 22
  3. Very specific:

    Run cortex store validate and fix any error in a file this run wrote.

    line 23
  4. Very specific:

    Every edit follows the MAP filing rules.

    line 28
  5. Very specific:

    Never edit a file under history/.

    line 33
  6. Very specific:

    nearDuplicates: read the pair and merge only if the two files hold one subject.

    line 43
  7. Very specific:

    Write nothing outside cortex/, never a spec, and do not stage or commit: no git rm, no git add.

    line 62

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

cortex-fresh

When to use

This skill is callable-only — it carries no trigger surface in the skill listing and is not routed into by a matching sentence.

Run by the weekly fresh task, or typed as /cortex-fresh. Core detects what may have rotted; you read it and say whether it still holds, and you fix what you find. You may edit, merge and retire any file in cortex/, following the MAP filing rules. Never write a spec: anything that would change one is a proposal. You write no code, and you neither stage nor commit.

Never spawn a nested claude process. Every cortex command here runs in the background and is polled with a 10-minute limit. macOS has no timeout command, so start it with &, poll, and kill it at the limit; a command past its limit is killed, named in your final message and skipped.

Steps, in order

  1. The write gate. Apply the write gate of cortex-remember. On an unaccepted store, print its refusal line and stop.
  2. Run cortex store expire --apply and keep its output.
  3. Run cortex tasks collect fresh --json.
  4. Act on each finding by Changing a store file, Stale code files, Aged, dead and duplicate and Proposals.
  5. Write the record history/changes/<today>-fresh.md.
  6. Run cortex store validate and fix any error in a file this run wrote.
  7. Run cortex tasks heartbeat fresh.

Changing a store file

Every edit follows the MAP filing rules. Set verified to <today> (observed) only after reading the evidence. Add this run's session:<id> to the file's origin list. Keep one fact in one file.

  • Retiring a file removes it and repoints or removes links to it. The record names it with its about line; git keeps the text.
  • Merging two files keeps one, adds the other's name and aliases to its aliases, joins the origin lists, repoints links, and removes the other.

Never edit a file under history/.

Stale code files

For each stale file, read the file and the code its depends_on names. If the file still holds, update verified. If not, correct the text. If the subject is gone, retire the file.

Aged, dead and duplicate

  • aged: update the file when the repository, the store or a session shows it still holds, and correct it when they show otherwise. When nothing you can read confirms it, leave the file alone, count it as unconfirmed, and write one proposal asking a person. The proposal names citedBy, and a file nobody cites says so.
  • deadRules: retire the rule when the code its globs named is gone, and correct it when the code moved. Its dead globs go in the record.
  • nearDuplicates: read the pair and merge only if the two files hold one subject. Otherwise count it as not a duplicate.
  • scaffolding: fix it with cortex store map.
  • validate: fix each error.
  • openPitfalls.aged: read each file against the code. Close a pitfall, by cortex-remember's bug section, only on observed evidence that the fix landed: a commit or a change that shows it. A missing file or symbol is not evidence, because the code may have moved. Without that evidence, write one proposal asking a person, and name the file in the record.

Proposals

A finding that would change a spec, or that needs a person, is one item appended to now/proposals.md by cortex-remember's propose mode, with the id P-<today>-fresh-<slug of the file's path> and its evidence: the commit, the age, the dead glob. If a pending item already names the same file, write no new item and count the finding as already proposed. now/proposals.md is only ever appended to: never rewrite or reorder it.

The record

Each run writes one new history/changes/<today>-fresh.md (first free name: -2, -3), also when nothing was found, with kind: other, status: done, origin: session:<id>, and one body line each with a count, followed by the paths:

expired, re-verified, corrected, retired, merged, not a duplicate, unconfirmed, scaffolding, open pitfalls, open pitfalls aged, proposed, already proposed.

A quiet run says Nothing went stale this cycle. as the last line.

Limits

Write nothing outside cortex/, never a spec, and do not stage or commit: no git rm, no git add.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.