Fix plugin slash-command docs to use the namespaced form - #723
Conversation
Claude Code namespaces every plugin command as /<plugin-name>:<command>, so the bare forms documented in both READMEs (/onboard, /status, /optimize, /doctor, /uninstall) do not resolve after install. Correct both READMEs to the namespaced form, fix the install line to /plugin install tokenjam@tokenjam, and add a test that derives the plugin's command set and prefix from plugin/commands/*.md and plugin.json so the docs cannot silently drift from the manifest again. Co-Authored-By: Claude <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| README.md | Updates plugin installation and slash-command examples consistently with the repository metadata. |
| plugin/README.md | Documents the namespace rule and updates all listed plugin commands and related prose. |
| tests/unit/test_plugin_command_docs_namespaced.py | Adds useful bare-command detection, but does not enforce the stated rename and command-set drift guarantees. |
Prompt To Fix All With AI
### Issue 1
tests/unit/test_plugin_command_docs_namespaced.py:79-81
**Guard misses namespaced drift**
The test computes `namespaced` but only asserts that bare references are absent. A plugin rename or command addition, rename, or removal can therefore leave namespaced references missing or stale while this regression guard still passes, contrary to its stated coverage.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "docs: fix plugin slash-command reference..." | Re-trigger Greptile
| assert not bare_hits, ( | ||
| f"{doc_path.relative_to(_REPO_ROOT)} documents the bare command " | ||
| f"`/{stem}`, which Claude Code will not resolve — it must be " |
There was a problem hiding this comment.
The test computes namespaced but only asserts that bare references are absent. A plugin rename or command addition, rename, or removal can therefore leave namespaced references missing or stale while this regression guard still passes, contrary to its stated coverage.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/unit/test_plugin_command_docs_namespaced.py
Line: 79-81
Comment:
**Guard misses namespaced drift**
The test computes `namespaced` but only asserts that bare references are absent. A plugin rename or command addition, rename, or removal can therefore leave namespaced references missing or stale while this regression guard still passes, contrary to its stated coverage.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
/<plugin-name>:<command>(prefix fromplugin.json'sname, which istokenjam). Both READMEs documented the bare forms (/onboard,/status,/optimize,/doctor,/uninstall), which do not resolve once the plugin is installed. Reproduced live: typing/onboardafter a successful marketplace add + install matches nothing.README.mdandplugin/README.mdto the namespaced form, and fixed the install line to/plugin install tokenjam@tokenjam.tests/unit/test_plugin_command_docs_namespaced.py, which derives the command set fromplugin/commands/*.mdand the prefix fromplugin.jsonat test time (not hardcoded), so a rename or a newly added/removed command is caught automatically if the docs drift again.Test plan
python3 -m pytest tests/unit/test_plugin_command_docs_namespaced.py -v— 4 passed/onboardinREADME.md, reran the test, observed a realAssertionErrorfailure with a useful message, then restored and reran to confirm it passes againclaude plugin validate ./plugin --strict— Validation passed/api/v1/*HTTP routes and code comments, not plugin slash-command docs, so nothing needed inverting