✨ Add /ai-coding-config doctor diagnostic subcommand#56
Conversation
Extends /ai-coding-config with a doctor mode that runs a battery of health checks and reports as a ✅/⚠️ /❌ checklist: - Plugin install state (marketplace registered, cache present, enabled) - Symlink integrity (.claude/commands → plugins/core/*, rules/ → .cursor/rules/) - Hook script health (executable, valid shebang, registered in settings) - Settings JSON validity - Marketplace JSON consistency (version parity across all three locations) - Version drift (local command file vs source repo) - Skill frontmatter (name/description/triggers present, next-skill targets exist) Context-aware: detects source-repo vs user-project and skips inapplicable checks. Auto-fixes hook permissions only (with confirmation). All other issues report with suggested fix commands. Fixes #53 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Code Review:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bbcac1240
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Read `plugins/core/hooks/hooks.json` to get declared hooks. For each hook script: | ||
|
|
||
| ```bash | ||
| ls -la plugins/core/hooks/*.sh | ||
| ``` |
There was a problem hiding this comment.
Use user-project hook paths when running doctor outside source repo
The new doctor flow advertises context-aware behavior, but the hook checks always read plugins/core/hooks/..., which only exists in the source repository layout. In a normal user project (where plugins/core/ is absent by definition in this same section), this will incorrectly report missing hooks and can’t validate the installed plugin hooks at all, producing false failures for one of the core diagnostic categories.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fa53a64. Hook script file checks are now scoped to source-repo context only. In user-project context, the section instructs checking hooks registration in settings instead of looking for script files in plugin cache.
| ```bash | ||
| cat .claude/settings.json 2>/dev/null | python3 -m json.tool > /dev/null && echo "valid" | ||
| ``` |
There was a problem hiding this comment.
Validate global Claude settings instead of only local file
This check claims to verify hooks registration in “project or global settings,” but the command only parses .claude/settings.json in the current repo. If that file is absent (common when only ~/.claude/settings.json exists), piping empty input to python3 -m json.tool yields a parse error, so doctor reports a false JSON failure and never checks the actual global settings file.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fa53a64. The settings check now reads .claude/settings.json if it exists, falls back to ~/.claude/settings.json for projects using only global settings. Both cases report valid/warning/error states based on JSON validity and hook registration.
- Source repo not found is informational (ℹ️), not a warning — normal for plugin-only users - Remove wrong user-project skill glob path (plugin cache uses flat .md, not SKILL.md dirs) - Fix summary count: 1 warning → 2 warnings in example output - Put failures first in summary line (❌ before⚠️ before ✅) - Add all-green closing line to output-format guidance Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix auto-fix example to use todo-persist.sh (matches output-format example) - Replace relative ls -la bash examples with $(pwd)-anchored absolute paths and Glob/Read tool instructions, matching file's own best practices - Clarify next-skill resolution: directory name first (fast path), fall back to scanning name fields, also checks .claude/commands/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Fixed all three items (5ecf04d):
Declined: next-skill scope underspecified for user-project context — the context-detection section at the top already establishes which skill path to use; no additional wording needed. |
Code Review:
|
- Hook script file checks now scoped to source-repo only; user-project context checks hooks registration in settings instead of script files - auto-fix chmod also scoped to source-repo only context - Settings check now reads .claude/settings.json if present, falls back to ~/.claude/settings.json for projects using only global settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code ReviewClean implementation overall. The IssuesHook registration check is incomplete The
In the output format example: But the
This uses a specific filename rather than a generic Minor Notes
Questions
Overall the feature is solid and fills a real gap. The hook registration gap is the most actionable thing before merge. |
Code Review:
|
- Add sync comment noting Plugin Install State mirrors <marketplace-doctor> - Add explicit file-not-found case for known_marketplaces.json - Add stability: experimental rule to Skill Frontmatter checks (was in example but not in spec) - Add Mode Routing section for unrecognized-argument fallback (enter setup mode, mention available subcommands) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Fixed all four in 8201b12:
|
Code Review —
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8201b12. Configure here.
| ### Skill Frontmatter | ||
| ✅ brainstorming — name, description, triggers, next-skill: brainstorm-synthesis (found) | ||
| ✅ systematic-debugging — name, description, triggers, next-skill: verify-fix (found) | ||
| ⚠️ mcp-debug — triggers field present, stability: experimental |
There was a problem hiding this comment.
Example uses ⚠️ but spec says ℹ️ for experimental
Medium Severity
The check specification at line 651 explicitly says stability: experimental gets an ℹ️ and is "not a problem, just surfaced for awareness." However, the example output at line 704 renders mcp-debug with a ⚠️ warning icon instead. This contradiction means the AI agent may treat experimental skills as warnings (needing action) rather than informational notes, and the ⚠️ also inflates the summary warning count at line 708.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8201b12. Configure here.
There was a problem hiding this comment.
Good catch — fixed in PR #59. Changed
|
Great review! Here's how each item landed: Fixed in PR #59:
Declined:
GitHub issue created:
|


Summary
doctorsubcommand to/ai-coding-configvia a new<doctor-mode>section in the command fileDesign Decisions
Extension vs new command: Added as a subcommand to the existing
/ai-coding-configcommand rather than creating a standalone file. Users invoke it as/ai-coding-config doctor, matching the familiar pattern from/ai-coding-config update. The XML mode section pattern already established in the command handles routing cleanly.Read-only by default: Doctor only auto-fixes hook permissions (safe, reversible, no content change). Everything else gets a diagnosis and a fix suggestion — the user runs the fix explicitly. This prevents doctor from accidentally doing destructive things in a broken state.
Context-aware checks: Source-repo checks (symlinks, marketplace JSON parity) are skipped in user-project context where they'd always fail. User-project checks (plugin cache, settings enablement) are emphasized instead.
Skill frontmatter validation includes composition fields: Since #52 landed, doctor also verifies
next-skilltargets resolve — first live consumer of the new frontmatter schema.Complexity
balanced
Validation
Fixes #53