Skip to content

Add a phantom agent skill and point the README and doctor to it - #59

Merged
VirtualMachinist merged 6 commits into
mainfrom
feat/w14-skill
Nov 15, 2026
Merged

VirtualMachinist merged 6 commits into
mainfrom
feat/w14-skill

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

Adds a phantom agent skill, so agents can reach Phantom through a short shell command instead of a large MCP tool list.

What changes

  • The skill. .agents/skills/phantom/SKILL.md and phantom.nu hold the canon, and scripts/sync-skills mirrors them into .claude/, .cursor/ and .grok/. The commands are thin wrappers over fract … --json:
    • each reshapes the reply into a compact answer;
    • each writes nothing;
    • nu is found on PATH only.
  • Tests.
    • tests/skill_copies.rs keeps the mirrored copies identical to the canon.
    • tests/skill_nu.rs runs the skill against a fixture when PHANTOM_NU names a nu binary, and skips otherwise. The tests never download anything. They pass the coverage profile path through, so a coverage run writes nothing into the fixture.
  • README. The "For agents" section leads with the skill: install, the phantomq shim, $PHANTOM_FRACTAL_BIN, and a two-line AGENTS.md snippet for indexed repos. The MCP setup is kept as "Over MCP".
  • doctor. It adds data.agents, which reports whether nu and the skill were found. It never affects ok, spawns no process and prints no path. Without that key, the reply is byte-identical to before.

Checks

fmt, clippy (-D warnings), cargo deny check and nextest all pass, with the skill tests run. No new package, no new crate, no .github change. Store schema, extractor version and envelope are unchanged.

🤖 Generated with Claude Code

VirtualMachinist and others added 6 commits November 14, 2026 23:50
Canonical .agents/skills/phantom holds SKILL.md and phantom.nu, with
regular-file copies under .claude, .cursor and .grok written by
scripts/sync-skills, which refuses symlinks. phantom.nu wraps
phantom-fractal --json (or PHANTOM_FRACTAL_BIN), prints one envelope
per call, copies error.kind, matches and did_you_mean through, and
groups callers and callees by display name with their sites and files.

skill_copies checks the copies, the frontmatter, a main def per listed
command and the one external call. skill_nu runs the script against the
built binary on resolve-dogfood with nu from PHANTOM_NU or PATH, and
skips with a printed reason when there is none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are found

The README For agents section now leads with the phantom skill: where its
copies live, what it runs, how to install it for every session, the
optional phantomq shim, the PHANTOM_FRACTAL_BIN override with its
quoting caveat, and a two-line AGENTS.md snippet for an indexed tree.
The MCP paste block stays below it. doctor gains an agents key after its
checks: nu by PHANTOM_NU or PATH, and the skill directories found under
the working directory or HOME, labelled, never by path. It reads only the
environment and file metadata, starts no process, and never changes ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat/w14-answers took one store-only commit after this branch began:
the find read tests move to their own module. No CLI, skill or README
file changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skill_nu clears the environment of every binary it runs, so under an
instrumented build the binary lost LLVM_PROFILE_FILE and wrote a default
profile into its working directory, the copied fixture, which the
no-write snapshot then caught. Pass LLVM_PROFILE_FILE through when it is
set. The snapshot stays strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test worked out, by running the CLI at every budget from 40 to 400,
that the new call keys stay exactly when the whole reply fits. Whether
the whole reply fits is arithmetic on the unbudgeted line, so it is now
worked out in the test, and the CLI is asked only where that answer
changes, the budgets on either side, and every budget that puts the
reply at exactly the room. Four runs instead of 361; the same property,
and the boundary still fails a < for <= in the budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…turn

The boundary budgets come from the test's own model of the estimate,
so a fit that disagreed with it elsewhere could go unseen. Every 25th
budget of 40 to 400 is now asked too, and each reply is judged on the
printed line alone: with the new keys it is the unbudgeted reply whole,
nothing omitted and used within 95% of the budget, and without them no
hit keeps its display. Across every budget asked, the keys only ever
turn from dropped to kept, and the model agrees with the CLI at each
fixed budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VirtualMachinist
VirtualMachinist merged commit e62f5b8 into main Nov 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant