ilancohen/lodestar-skills

lodestar-fix

- Triages and executes action items produced by lodestar-audit.

Ver código-fonte
Documento original do Skill

Renderizado do repositório de origem, preservando títulos, exemplos, código, tabelas, links e imagens.

You are running lodestar-fix. The job is to triage and execute the action items produced by a lodestar-audit run, marking each with a status so re-runs pick up where you left off. This skill modifies application source code.

Scripts live beside this SKILL.md under scripts/. Keep the process cwd as the target repository. Invoke scripts with an absolute path to that file (or node <skill-dir>/scripts/<name>.mjs). --file and --run-dir are paths in the target repository. Use them for status writes and file moves instead of POSIX mv.


How to talk to the user

Anything you print or ask is read by a person who is skimming. The Step 4 report and commit messages keep their given shape.

  • Ask one clear question at a time. Say what happens for each answer.
  • Describe a fix by what it changes, not by its category key or item id.
  • Keep status values out of questions — say "left for later", not "deferred".
  • Never trim or postpone a warning.
  • Point first. Bullets, not paragraphs. Blank line between blocks.
  • Bold the first few words of each bullet.

Milestones

Concise chat progress — not diagnostic logs or run files:

  • Opening — selected items, output path, checks, mutation/commit policy
  • Before long work — current item
  • At boundaries — done/skipped/deferred counts and next item
  • Closing — artifacts, skipped coverage, actionable failures

Inputs

The skill operates on one <output-root>/<RUN_ID>/ directory at a time (outputRoot from node <lodestar-audit-skill>/scripts/audit-state.mjs validate-input --root <repo>, default docs/audit). Substitute that value for the output directory — do not hardcode docs/audit. Required contents:

  • INDEX.md (written by lodestar-audit's Plan phase).
  • One or more NNN-<category>-<slug>.md action items.

If any are missing, stop and ask the user to run lodestar-audit first.

Capture from the same validate-input payload:

  • outputRoot — where audit runs land.
  • git — commit policy. Every key is populated; a missing git row in

## Audit Configuration yields today's defaults (commits: ask, subject <category>: <slug>, trailer Closes <item>., no protected branches, require-clean: no).

Capture from .agents/lodestar/context.md (the file lodestar-setup writes; AGENTS.md is not read):

  • <typecheck>, <lint>, <test> — context build commands. n/a

skips that command when an item's acceptance names it. The item's Acceptance check is the contract; stop only when that section names no usable method.

  • ## Package Layout — the Package and Path glob(s) columns, read only

when Step 2's "By area" option is chosen. A missing table does not stop the skill.

Then run command-only freshness (layout facts are not this skill's):

text
node <lodestar-audit-skill>/scripts/audit-state.mjs check-freshness --root <repo> --facts commands

Exit 2: stop. Name the stale command and point at lodestar-setup. n/a is not drift. Do not run a layout check.


Step 1 — Pick a run

Git preconditions (before applying anything):

  1. If git.requireClean is yes, run git status --porcelain. A

dirty tree → stop. Name the dirty files. Do not pick a run.

  1. If the current branch (git branch --show-current) is in

git.protected and git.commits is not never, stop and offer to continue this session without committing. On yes, set sessionCommits = never for the rest of the session — do not write context.md. On no, stop entirely. Otherwise sessionCommits = git.commits.

Then:

  1. List <output-root>/*/ directories that contain both INDEX.md and

at least one NNN-<category>-<slug>.md file in the run root (not under done/). Exclude <output-root>/done/ itself. Never offer a run that lacks INDEX.md.

  1. An "unfinished" run is one where the run root (not the done/

subfolder) still holds at least one action-item file. If exactly one run is unfinished, default to that. Otherwise list the unfinished runs and ask which one. If no candidate run qualifies, say so and point the user at lodestar-audit's Plan phase.

  1. Print: "Working through the fixes in <output-root>/<RUN_ID>/."

Steps

References load one hop from this file; a reference must not load another.

If the run root has in_progress or deferred, load references/resume.md first.

  1. Triagereferences/triage.md. Choose the

batch and set AUTO_COMMIT.

  1. Executereferences/execute.md. One item

at a time, serially. No mutating sub-agent fan-out.

  1. Reportreferences/report.md. Session

summary, archive run (Step 4a); do not refresh Dependency Policy (Step 4b).

Resuming a previous run: references/resume.md.


Rules

  • Read each item before acting. The action item is the contract —

evidence, files, requested change, decision, scope exceptions, and acceptance. Do not load whole category documents; the item must stand alone with these resident rules.

  • Resident safety (always). Apply unless the item's **Scope

exceptions or Acceptance check** override them:

  • Edit only paths in files: (plus paths named in Scope exceptions).
  • Do not rewrite unrelated dirty hunks; stop on dirty listed files.
  • Never git add -A; stage only the item's files.
  • Honor stop conditions in Scope exceptions; hitting one → deferred.
  • Run the item's Acceptance check; when it names <typecheck> /

<lint> / <test>, use context commands (n/a skips that cell).

  • One concern per item — do not expand into multi-stage redesign

(lodestar-plan).

  • Scope exceptions are stop conditions. Hitting one → status: deferred,

never "ignore and proceed".

  • `requires_decision: true` always asks. Even under a bulk pick. Use

the item's Decision section when present.

  • Never modify the body of an action-item file. Only frontmatter

gains status:, completed_at:, commit:, note:. Problem / fix / scope / acceptance stay immutable.

  • Never delete an action-item file. done/skipped move to

<output-root>/<RUN_ID>/done/; deferred stay in the run root.

  • No `git add -A`. Stage only the item's files:. Never stage a

whole dirty file that already had unrelated edits.

  • Never rewrite Dependency Policy from observation. Step 4b does not

refresh context.md from the live import graph after cycle fixes.

  • Stop conditions:
  • No INDEX.md or no action-item files in the run directory.
  • The item's acceptance method is empty or unusable (no command and no

deterministic inspection named in the item).

  • check-freshness --facts commands reports drift → point at

lodestar-setup.

  • The user says stop.
  • A files: path already has unrelated uncommitted changes the user

has not resolved.

do mesmo repositório

Mais Skills

Todos os Skills
ilancohen
Comunidade

lodestar-audit

- Audits a codebase against the review rubric in context.md ( Review Rubric, or principles only when that section is absent) and writes self-contained findings and action items under the output-root in context.md (default docs/audit/). Discovery only; never modifies application source. Restartable from findings.md. Do not load unless the user explicitly invokes lodestar-audit by name.

instalações
1
GitHub Stars
0
Atualizado
10 de set.
ilancohen
Comunidade

lodestar-docs

- Harvests leftover knowledge from lodestar-owned docs staging into existing canonical homes, then deletes files that would not help an agent starting fresh. Default scope is audit done/abandoned, architecture reviews, and plans done/abandoned — not the whole docs/ tree. Never creates new homes, never edits application source or .agents/lodestar/context.md. Do not load unless the user explicitly invokes lodestar-docs by name.

instalações
1
GitHub Stars
0
Atualizado
10 de set.
ilancohen
Comunidade

lodestar-plan

- Writes an implementable plan under the resolved plans root (default docs/plans/) with a rigor: light | standard | full tier. Grounds named files and commands before creating the root or any plan files. The filesystem is the index — no ledger. Does not implement the plan and does not edit application source. Do not load unless the user explicitly invokes lodestar-plan by name.

instalações
1
GitHub Stars
0
Atualizado
10 de set.
ilancohen
Comunidade

lodestar-setup

- Sets up the lodestar suite in a repository: writes .agents/lodestar/context.md (package layout, conventions, optional dependency policy, audit scope when audit is installed). Principles resolve from the installed lodestar-setup skill. Measures git churn when audit is present. Do not load unless the user explicitly invokes lodestar-setup by name.

instalações
1
GitHub Stars
0
Atualizado
10 de set.