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

cortex-quality

Skill2 starsChanged 25 days agoMITView on GitHub

Find spec drift and measure store use.

The file

We split this skill into the rules it gives an agent

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

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the at-rest review.

    line 23
  2. Distinctive:

    Run the silent-spec job.

    line 24
  3. Very specific:

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

    line 26
  4. Very specific:

    When ported is false, skip steps 4 and 5 and the measurement says not ported.

    line 29
  5. Very specific:

    Discard: Remove and prune every throwaway worktree (git worktree remove --force <folder>, then git worktree prune), also after a failure, …

    line 53
  6. Very specific:

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

    line 71

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

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 quality task, or typed as /cortex-quality. It checks the spec tree, reads coverage, runs the suite, files failures, runs the two spec jobs and measures how the store is used. It reports and proposes; it fixes nothing. Fixing is an ordinary session. Its two spec jobs only propose: never write a spec.

Never spawn a nested claude process. Every cortex command here runs in the background and is polled with a 10-minute limit; the suite has its own limit below. 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.

Every agent runs in the foreground, or is awaited before the next step, and writes its output to a file under <os tmpdir>/cortex-quality-<today>/, which you read. A headless session can end while a background agent runs, and its work is lost. A hand-back can fail after the agent has finished, so the file is the delivery, not its reply. Name the file in each agent's brief.

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 tasks collect quality --json.
  3. Run the suite.
  4. Run the at-rest review.
  5. Run the silent-spec job.
  6. Write the measurement.
  7. Run cortex store validate and fix any error in a file this run wrote.
  8. Run cortex tasks heartbeat quality.

When ported is false, skip steps 4 and 5 and the measurement says not ported. A step that fails is recorded in the measurement and the next step runs.

The suite

With a null testCommand, the measurement says no test command configured and the step is skipped. Otherwise run it once from the project root, with a limit of 30 minutes.

Each failing test is one ## item in now/quality-failures.md: heading ## <test file> › <test name>, then until: <today + 14>, first seen: <date>, the criterion its tag names, and at most 20 lines of failure output with no secret. A test already there keeps its first seen, and its other lines are refreshed. Remove an item whose test now passes.

Change no code and no test. After the run, name in the measurement any tracked files outside cortex/ that the suite changed.

The at-rest review

For each spec in rotation, one fresh agent runs spec mode of specflow-review. Give it the spec path and the repository root and nothing else: never this session's conversation, and a fork does not count.

Findings keep that skill's format and go to now/quality-findings.md as one ## item per spec, heading ## <spec id> <today>, with until: <today + 14>. A finding that would change a spec or a rule also becomes one item in now/proposals.md by cortex-remember's propose mode, id P-<today>-quality-<slug>. That file is only ever appended to.

The silent-spec job

It finds working behaviour no spec describes. On area, in this order:

  1. Tickets. One fresh agent sees only specflow/INDEX.md and that area's spec files, no code in view, and writes 5 change requests as JSON [{ slug, prompt }]: one to three sentences each, from the user's point of view, each on a different part of the area, with no spec id, rule number, file name or technical term, nothing the specs forbid, at least one changing a limit, one changing what a person sees, one adding a small behaviour.
  2. The nothing-agent. For each ticket, run git worktree add --detach <os tmpdir>/cortex-quality-<today>/<slug> HEAD, then delete specflow/, .specflow/, cortex/, .claude/, CLAUDE.md and AGENTS.md inside it. One fresh agent gets only the ticket text and that folder, and implements the ticket there without committing.
  3. Flags. From the project root, run cortex tasks collect quality --flags <folder> --base <HEAD sha> --json. At most 10 flags per ticket go on; count the rest.
  4. Classifier. One fresh agent per ticket gets the flagged files, their diff and the area's spec text, and classifies each flag described or not described, quoting the spec line for described. Each not described becomes an item in now/proposals.md proposing a missing criterion, id P-<today>-silent-<slug>.
  5. Discard. Remove and prune every throwaway worktree (git worktree remove --force <folder>, then git worktree prune), also after a failure, and say so in the measurement. No edit from the job reaches any branch.

A ticket on which the agent edits nothing is counted as blind: it is the method's known limit.

The measurement

One new history/measurements/<today>-quality.md per run (first free name: -2, -3): about, permanence: stable, verified: <today> (observed), origin: session:<id>. These headings, in this order, each with its numbers, never omitted:

  • ## Specs: lint errors and warnings, or lint not run when lint.notRun is set, then criteria, tagged, unverified, untagged tests;
  • ## Tests: passed, failed, new failures, failures open more than 7 days, or the skip reason;
  • ## At-rest review: specs reviewed, findings by severity, proposals written;
  • ## Reviewed specs: one line - <spec id> <YYYY-MM-DD> per spec reviewed;
  • ## Silent-spec job: tickets, blind, flags, flags over the limit, described, not described, worktrees removed;
  • ## Store use: the usage counts, and filed against alreadyThere as a ratio;
  • ## Store shape: the store key.

Limits

Write nothing outside cortex/ and the throwaway worktrees, 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.