| id | 160 | |
|---|---|---|
| title | Claude Code plugin extensions — skills, agents, hooks | |
| status | 🔲 | |
| model | sonnet | |
| depends-on |
|
|
| summary | Add three plugins to the Claude Code marketplace alongside the existing `mdsmith-lsp`, `mdsmith-audit`, and `mdsmith-dev-lsp`: `mdsmith-skills` (slash-commands `/mdsmith-fix`, `/mdsmith-kinds`, `/mdsmith-check`), `mdsmith-reviewer` (`markdown-reviewer` subagent), and `mdsmith-autofix` (post-edit lint hook). Follows the one-plugin-per-component-kind precedent set by `mdsmith-audit`. |
Ship three plugins covering skills, subagents, hooks.
The marketplace already lists three plugins:
mdsmith-lsp— LSP server (plan 132).mdsmith-audit—markdown-auditskill.mdsmith-dev-lsp— gopls, TypeScript, mdsmith LSPs for contributors.
mdsmith-audit set the convention: one plugin
per component bundle. Three new plugins below
cover the three component types missing so far
(skills, agents, hooks). MCP is out of scope.
- MCP server (LSP covers what agents need),
bundling binaries (plan 130), a monolithic
mdsmith-toolsplugin, or publishing.claude/skills/contributor skills.
Each new directory mirrors audit:
editors/
claude-code-skills/
.claude-plugin/plugin.json
skills/mdsmith-fix/SKILL.md
skills/mdsmith-kinds/SKILL.md
skills/mdsmith-check/SKILL.md
README.md
claude-code-reviewer/
.claude-plugin/plugin.json
agents/markdown-reviewer.md
patterns.md
README.md
claude-code-autofix/
.claude-plugin/plugin.json
hooks/hooks.json
README.md
Fragment of plugins:
{
"plugins": [
{
"name": "mdsmith-skills",
"source": "./editors/claude-code-skills",
"description": "Slash-command skills for mdsmith fix, kinds, and check"
},
{
"name": "mdsmith-reviewer",
"source": "./editors/claude-code-reviewer",
"description": "Subagent that reviews Markdown PRs and drafts"
},
{
"name": "mdsmith-autofix",
"source": "./editors/claude-code-autofix",
"description": "Post-edit hook that runs mdsmith fix on .md files"
}
]
}Three slash-commands under skills/. Skills
are invoked by name, with no plugin prefix
(per the Skills docs; audit uses
/markdown-audit). SKILL names carry an
mdsmith- prefix to stay distinctive:
| Slash command | Wraps |
|---|---|
/mdsmith-fix |
mdsmith fix |
/mdsmith-kinds |
mdsmith kinds |
/mdsmith-check |
mdsmith check |
/mdsmith-fix is the highest-leverage.
/mdsmith-check deliberately duplicates LSP
diagnostics for users without mdsmith-lsp.
Each SKILL.md follows the Skills
schema and proto.md. Front matter sets
name, description, user-invocable: true,
argument-hint, and an allowed-tools allowlist
scoped to Bash(mdsmith:*). Front-matter and
structure follow the audit SKILL.md
pattern; bodies are command-specific (no
<?include?>). No local copy in
.claude/skills/.
One subagent in agents/markdown-reviewer.md
plus a sibling patterns.md at the plugin
root, outside agents/ so the loader treats
it as data. patterns.md ships the three
config-level checks (no .mdsmith.yml,
similar files without a kind, kind without
path-pattern); installed users don't need
the source-tree audit skill. Rule-backed
patterns load via mdsmith help patterns -f json or LSP mdsmith/rulePatterns (see
plan 161). The agent proposes the
rule, directive, or kind config to adopt
so the pattern stops drifting; content nits
stay with mdsmith check. Tools: Read, Grep,
Bash (mdsmith help, mdsmith check -f json, mdsmith kinds resolve), GitHub MCP.
No auto-fix.
One PostToolUse hook in hooks/hooks.json.
Matches Edit, Write, and MultiEdit on
.md files. Runs mdsmith fix on the edited
file.
Claude Code passes tool input as JSON on stdin
(see .claude/settings.json for
pattern). The file path is at
.tool_input.file_path. The wrapping hooks
array allows multiple per-matcher commands.
${FILE#"$PWD/"} strips the workspace prefix
so relative globs match; the quotes force a
literal prefix (unquoted $PWD would
glob-interpret [, *, ?). -re plus
// empty and the || guard make jq /
missing-file_path failures exit 1 with a
stderr warning. || true covers only
mdsmith fix; -- blocks flag parsing;
case skips non-Markdown. mdsmith and jq
must be on the PATH Claude Code sees.
The hook is opt-in. Users who prefer manual
fix just do not install mdsmith-autofix.
Same shape as the audit
manifest. Vary name,
description, and keywords per plugin:
["markdown", "skills", "mdsmith"],
["markdown", "review", "agent"],
["markdown", "hook", "autofix"]. No inline
component declarations — components load from
the standard skills/, agents/,
hooks/hooks.json paths.
.mdsmith.yml names the audit path four
times. Look in the skill kind, in
kind-assignment, and in two SKILL
overrides:. Swap each
editors/claude-code-audit/skills/*/SKILL.md
glob for editors/claude-code-*/skills/*/SKILL.md.
Surface the diff per CLAUDE.md.
Existing plugins are unchanged; new ones
appear in /plugin marketplace update
without auto-installing.
- Create
editors/claude-code-skills/,editors/claude-code-reviewer/, andeditors/claude-code-autofix/with the layouts above. - Add a
plugin.jsonto each, matching the shapes above. - Write the three SKILL.md files
(
mdsmith-fix,mdsmith-kinds,mdsmith-check) undereditors/claude-code-skills/skills/. Each shells out to the matchingmdsmithsubcommand; surface stderr on non-zero exit. - Write
editors/claude-code-reviewer/agents/markdown-reviewer.md. Subagent front matter usestools(not the skill-styleallowed-tools); body describes capabilities and triggers. - Add
editors/claude-code-autofix/hooks/hooks.jsonusing the inner-hooks-array format above. - Extend
marketplace.jsonwith the three new entries and broaden the top-leveldescriptionpast "via LSP" to cover skills, the reviewer, and the autofix hook. - Generalize the four audit-specific
editors/claude-code-audit/skills/*/SKILL.mdentries in.mdsmith.yml(path-pattern, kind-assignment, two overrides) toeditors/claude-code-*/skills/*/SKILL.md. Surface the diff per CLAUDE.md. - Add a
README.mdper plugin (see audit README): install commands, contents, PATH prereq (mdsmith; plusjqfor autofix), and the autofix opt-out. - Document the three new plugins in the install guide under the Claude Code section.
- Smoke-test: install each plugin, run
/mdsmith-fix,/mdsmith-kinds, and/mdsmith-check, invokemarkdown-revieweron a sample file, and verify the hook fires on Edit, Write, and MultiEdit.
-
/plugin install mdsmith-skills@mdsmith,mdsmith-reviewer@mdsmith, andmdsmith-autofix@mdsmitheach succeed after/reload-plugins. -
/mdsmith-fix,/mdsmith-kinds, and/mdsmith-checkeach run their matchingmdsmithsubcommand and surface output. -
markdown-reviewerproduces a structured review summary on a sample Markdown PR; it pulls rule-backed patterns viamdsmith help patterns(no hard-coded list — verified by adding a new rule and seeing it picked up unchanged) and surfaces the three config-level checks from siblingpatterns.md(fixture: missing.mdsmith.yml, similar files without a kind, kind withoutpath-pattern). - After Edit/Write/MultiEdit on a
.mdfile,mdsmith fixruns on it. Verified with an absolute path under a workspace containing[,*, or?—mdsmithmust receive the workspace-relative path. -
claude plugin validatepasses on each new manifest;mdsmith kinds resolvereportsskillfor audit andmdsmith-skillsSKILL.md files. - The install guide documents all six plugins.
-
go test ./...andmdsmith check .pass.
- Bundle vs split. Revisit if install count becomes painful.
- Agent vs. skill. A
/mdsmith-reviewskill might cover most cases more cheaply.
{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "FILE=$(jq -re '.tool_input.file_path // empty') || { echo 'hook: jq missing or no file_path' >&2; exit 1; }; case \"$FILE\" in *.md|*.markdown) mdsmith fix -- \"${FILE#\"$PWD/\"}\" || true;; esac" } ] } ] } }