Repository navigation
Read use_for in the Claude Code plugin's skill list and find the project under any spelling of its remote - #3645
Conversation
Pragmatic Code Review: PR #3645Review Type: Initial review (no earlier reviews or comments on the PR) SummaryAPPROVE. Both defects are fixed at their cause, with no fallback to the old field name, and the change is a clear net improvement. Nothing blocks the merge. Three improvements are worth folding in, all the same shape as the bugs this PR fixes: the lookup still misses a project saved with the checkout's own remote when that remote has a port, a user or a non-HTTPS scheme; What I ran:
I did not run Requirements Check (issue #3643)
Code Review FindingsCritical IssuesNone. Suggested Improvements1. 🟡 The spelling list omits the checkout's own remote when it has a port, a user or another scheme
Failure scenarios, each returning "no project for this checkout" with no error:
Other misses, by the same exact, case-sensitive
None of these is a regression: the old Recommendation, in order of cost:
Principle: one normalizer on both sides of a comparison beats enumerating one side's outputs; an enumerated list is correct only for the cases someone thought of. 2. 🟡 const node = list(isRecord(parsed) ? parsed.nodes : parsed).find(isRecord)
Recommendation: Principle: YAGNI; no dual-shape reads (CLAUDE.md, no compatibility code). 3. 🟡 The CLI manual still teaches the lookup this PR fixes, and still describes the output as a bare array
Recommendation: change the example to Principle: the CLI operations are a contract (ADR-093, Consequences); the manual is where that contract is written down. 4. 🟢 The gate test ties four of the names the plugin reads; the rest of the contract is still held only by the fake The test does what the acceptance criterion asks. I checked it by mutation, on in-memory copies of both files:
So a rename on either side fails the gate, and a broken regex fails loudly rather than passing on an empty match. What it does not cover, by the same mechanism that caused this bug (the fake and the plugin agreeing with each other, not with the CLI):
I compared each of these with Nitpicks
RecommendationAPPROVE. Findings 1 to 3 are worth folding into this PR, since each is a sibling of the bug being fixed and each is a few lines: add the raw remote to the spelling list, drop the bare-array read, and correct the two lines of |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (commit 7480c20)Addressed
Skipped
Plugin tests: 36 passed. Scripts: 34 passed. Re-review: not needed. The changes are a few lines each, local, and each has a test or is documentation. |
… every spelling of the remote (closes #3643) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e query shape, correct the manual (#3643) - The spelling list includes the remote as written, for one with a port, a user or another scheme - findProject reads the shape the query prints and no other - references/cli.md shows the lookup with in, and the query's real output - A test for a skill whose text alone changed Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
7480c20 to
5e76eec
Compare
Closes #3643
What this fixes
Two defects found by running the merged Claude Code plugin against a real daemon built from
main.descriptionfromnodespace --json skill guidance; a listing entry carriesuse_for. It now readsuse_for, and its own field is renamed to match. No fallback to the old name.equalsfilter with the HTTPS form without.git. It now sends aninfilter over the six common spellings: HTTPS,git@host:pathandssh://git@host/path, each with and without.git.Why the tests missed it
The plugin's tests answer from a fake CLI, which still returned
description. The fake now returnsuse_forand the{count, nodes}shape the project query prints. A new scripts test, which runs in the merge gate, ties the fieldsskillsOfreads to the onesskill_jsonprints inpackages/cli/src/commands/skill.rs, so a rename on either side fails there.Verification
NODESPACE_HOMEwith a project whoserepository.urlends in.git: the session's system prompt section listed all 12 seeded skills with their text. Before the fix the same setup found no project.bun run --cwd packages/skill test:plugin: validate passed, 34 plugin tests passed.bun test scripts/publish-skill-repo.test.ts: 34 passed.bun run test:changed: passed.🤖 Generated with Claude Code