Skip to content

Configure Pi, and report when the embedded command catalog is stale - #80

Merged
woksin merged 4 commits into
mainfrom
feat/79-configure-pi-and-detect-stale-context
Aug 19, 2026
Merged

Configure Pi, and report when the embedded command catalog is stale#80
woksin merged 4 commits into
mainfrom
feat/79-configure-pi-and-detect-stale-context

Conversation

@woksin

@woksin woksin commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Added

  • cratis init now configures Pi, writing the Chronicle skill to .pi/skills/chronicle-cli/SKILL.md, the diagnose prompt to .pi/prompts/, and the @CHRONICLE.md reference to AGENTS.md. Pi is detected from a project's .pi/ directory and from the PI_* variables it exports, so running cratis init inside a Pi session configures it even on a project that has nothing yet. --tool pi targets it explicitly. (cratis init does not configure Pi, and the embedded llm-context is a pinned snapshot #79)

Changed

woksin added 4 commits August 19, 2026 14:32
Pi keeps its project resources under .pi/, and exports PI_* variables into
every command it runs. Detecting both means running `cratis init` from inside
a Pi session configures Pi even on a project that has nothing yet - the same
first-run behaviour Claude Code already gets.

PI_CODING_AGENT identifies the harness itself, where PI_SESSION_ID only says a
session is in flight, so both are accepted and the former stays the signal.
Pi discovers skills from .pi/skills/<name>/SKILL.md and prompts from
.pi/prompts, and reads its context from AGENTS.md. The generated skill already
carries the name/description frontmatter Pi requires - the same shape Copilot
uses - so it is written unchanged and only the path differs.

AGENTS.md rather than a Pi-specific file because that is what Pi reads and it
is the cross-tool convention: a project already carrying one gets the
reference appended rather than a second file to keep in sync. Appending is
idempotent, since AGENTS.md is usually hand-maintained.

--refresh now updates the Pi skill too, or an upgrade would leave it behind
while refreshing the others.
The catalog embedded in CHRONICLE.md and the generated skill is a snapshot
taken when init ran, not a live lookup. After upgrading the CLI it keeps
describing the older surface: commands added since are invisible to an agent,
and ones renamed or removed are still advertised. Nothing said so, so the
failure was silent - an agent confidently calls a command that is gone.

Init already skips an existing CHRONICLE.md, which is right since it may have
been edited. It now reads the version out of it first and, when that differs
from the running CLI, says so and names --refresh instead of reporting a bare
"already exists".

A file carrying no version is deliberately not reported as stale: it predates
stamping or was hand written, and a warning nobody can act on is how people
learn to ignore warnings.
--tool now accepts pi, so its help has to say so or the option is
undiscoverable. The docs also stated the catalog was refreshable without
saying why anyone would need to, which is the part that matters.
@woksin woksin added minor New features, non-breaking additions and removed minor New features, non-breaking additions labels Aug 19, 2026
@woksin
woksin force-pushed the feat/79-configure-pi-and-detect-stale-context branch from 61bcb6d to bf1c32b Compare August 19, 2026 12:33
@woksin woksin added the minor New features, non-breaking additions label Aug 19, 2026
@woksin
woksin merged commit 9d5aef5 into main Aug 19, 2026
7 of 11 checks passed
@woksin
woksin deleted the feat/79-configure-pi-and-detect-stale-context branch August 19, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features, non-breaking additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant