fix(base): fire the preflight hook on the namespaced /base:refact command - #28
Open
eastagiletracker wants to merge 1 commit into
Open
Conversation
…mand
The UserPromptSubmit hook preflight-refact-config.mjs tested the prompt
against a bare `/refact`, but the command ships namespaced as
`/base:refact`. The test never matched the real command name, so the
missing-`.refact-os.json` note never reached the agent — the behaviour
CLAUDE.md describes ("the preflight-refact-config.mjs hook warns when it
is missing before a /base:refact action") was unreachable.
The prompt test now allows an optional `<plugin>:` prefix, so
`/base:refact …` and the bare `/refact …` form both fire; `/refactor`
still does not match (lookahead instead of a consuming boundary). The
note now names `/base:refact config`.
base 1.8.1, marketplace 2.12.2. The catalog entry for base still read
1.7.0 after the 1.8.0 bump, so it is realigned in the same edit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proposes fixing the base pack's
preflight-refact-config.mjshook so it fires on the namespaced/base:refactcommand instead of only the bare/refactform. We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/383. You can sign in with your GitHub ID to claim ownership of the project.What was wrong
plugins/base/hooks/preflight-refact-config.mjsruns on everyUserPromptSubmit(registered inplugins/base/hooks/hooks.json) and is supposed to add the ".refact-os.jsonwas not found" note before a refact action. Its prompt test was/(^|\s)\/refact(\s|$)/, which was written before the command became namespaced. The shipped command is/base:refact(plugins/base/commands/refact.md, and the README wording throughout), and"/base:refact config"contains no/refactsubstring — so the test never matched the real command name and the note never reached the agent. The repo-root contributor guide states the intended behaviour directly: "thepreflight-refact-config.mjshook warns when it is missing before a/base:refactaction". The hook has not been touched since the initial 7-pack restructure, so the rename to/base:refactleft it behind.Reproduction on
mainata9cce32, from a directory with no.refact-os.json:The change
The prompt test becomes
/(^|\s)\/(?:[\w-]+:)?refact(?=\s|$)/: an optional<plugin>:prefix is allowed, so/base:refact …matches and the bare/refact …form keeps working for anyone whose install resolves the short name — backward compatible, nothing that matched before stops matching. The boundary is a lookahead rather than a consuming(\s|$), so/refactorand/base:refactorstill do not match. The note text now names/base:refact config, and the file's header comment is updated to the current command name.Verification, all replayable from the checkout (the repo ships no test runner, as the contributor guide notes, so these are direct invocations of the hook):
Positive control: with a
.refact-os.jsonpresent in the resolved project directory,/base:refact configstays silent and the hook still exits0, so it never blocks a session. I also ran the repo's whole static check set before and after the change —node --checkon all 45.mjsfiles,bash -non the shell hooks and scripts, and a JSON parse of every manifest, 66 checks — with an identical result set: no new failures.Per the contributor guide's release rule ("bump the changed plugin's
versionin both itsplugin.jsonandmarketplace.jsonand the top-level marketplaceversion") this bumps base to1.8.1and the marketplace to2.12.2, and adds adocs/change-log.mdentry in the existing style. Note that the catalog entry forbasein the marketplace manifest still read1.7.0while the base pack's ownplugin.jsonread1.8.0, so/plugin marketplace update refact-oswas advertising the older version and/plugin update base@refact-oshad nothing to offer; both now read1.8.1. Heads-up on merge order: #25 and #26 also editmarketplace.json(the wordpress entry plus the top-level version), so whichever lands second will want a trivial version reconcile.How this was managed
This work was tracked as a single story on a live board imported from this repository's own issues and pull requests (27 stories from your 27 PRs, plus the labels): the story is https://eastagiletracker.com/projects/383/stories/259908 and the board is https://eastagiletracker.com/projects/383.
If you'd rather not receive contributions like this, reply
no-more-prson this pull request and we won't open any further ones on your repositories.Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com