Phase R1: align rules/skills with MCP surface + cr/* branches + parity tests#42
Merged
Phase R1: align rules/skills with MCP surface + cr/* branches + parity tests#42
Conversation
… + cr/* branches + parity tests
Closes the two P1 drift findings and installs a drift-detection
mechanism so they don't come back:
1. contentrain_merge missing from public catalog — @contentrain/rules
MCP_TOOLS listed 15 tools while @contentrain/mcp registers 17
(merge + doctor). Skills tool reference also jumped submit → bulk
with no merge section.
2. Legacy contentrain/{operation}/... branch namespace still taught
by essentials, review/normalize prompts, and multiple skills.
MCP's buildBranchName() returns cr/... (Phase 7). Agents following
shipped guidance would look for branches that don't exist.
### @contentrain/mcp
- Public export TOOL_NAMES in ./tools/annotations (frozen, derived
from TOOL_ANNOTATIONS). Single source of truth.
- New ./tools/annotations subpath export. Build script emits it.
### @contentrain/rules
- MCP_TOOLS extended to 17 (contentrain_merge + contentrain_doctor).
- essentials: doctor row added; feature-branch pattern → cr/...;
health-threshold language mentions cr/*.
- review-mode prompt: every legacy contentrain/<op>/... → cr/<op>/...
- normalize-mode prompt: branch pattern table rewritten.
- shared/workflow-rules: branch pattern spec rewritten.
- tests/mcp-parity.test.ts (new, 4 tests): MCP_TOOLS ↔ TOOL_NAMES
match, essentials cite every tool, buildBranchName emits cr/,
docs contain no legacy branch prefix.
- package.json: @contentrain/mcp workspace devDep for parity test.
### @contentrain/skills
- references/mcp-tools.md: new contentrain_merge (after submit) +
contentrain_doctor (new Doctor Tools subsection). Submit description
updated to cr/*.
- references/mcp-pipelines.md + workflow.md: branch spec + examples
rewritten to cr/*.
- contentrain-normalize SKILL + references (extraction, reuse):
4 stale contentrain/normalize/* → cr/normalize/*.
- contentrain-translate SKILL: translate branch pattern updated.
- tests/mcp-parity.test.ts (new, 2 tests): references/mcp-tools.md
has ### <tool> heading for every MCP tool; 7 skill docs contain no
legacy branch prefix.
- package.json: workspace devDep.
### Monorepo
- tsconfig.json paths: @contentrain/mcp/tools/* alias so TS + vitest
resolve the new subpath from source during dev.
### Verification
- oxlint rules + skills + mcp/tools → 0 warnings
- tsc --noEmit rules + skills + mcp → 0 errors
- @contentrain/rules vitest → 16/16 (was 12, +4 parity)
- @contentrain/skills vitest → 85/85 (was 83, +2 parity)
Tool surface: no behaviour changes. TOOL_NAMES export is additive;
everything else is documentation + tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
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.
Closes the two P1 drift findings flagged in the release-prep audit and installs parity tests so the same drift can't return.
Problems
Public catalog missing tools —
@contentrain/rulesMCP_TOOLSlisted 15 tools.@contentrain/mcpactually registers 17 (contentrain_mergefrom Phase 9,contentrain_doctorfrom Phase 14c).@contentrain/skillstool reference jumped fromcontentrain_submitstraight tocontentrain_bulkwith no merge section.Legacy
contentrain/{operation}/...branch namespace — essentials, review/normalize prompts, and multiple skills still taught the old prefix. MCP'sbuildBranchName()returnscr/...(Phase 7 migration) andcheckBranchHealthfilters oncr/. Agents following the shipped guidance would look for branches that don't exist.Changes
@contentrain/mcpTOOL_NAMES: readonly string[](frozen, derived fromTOOL_ANNOTATIONS) — single source of truth for the tool list../tools/annotationssubpath export.@contentrain/rulesMCP_TOOLSextended to 17 (addscontentrain_merge+contentrain_doctor).essential/contentrain-essentials.md— doctor row added; feature-branch pattern →cr/{operation}/...; health language →cr/*.prompts/review-mode.md,prompts/normalize-mode.md,shared/workflow-rules.md— all legacycontentrain/<op>/...→cr/<op>/....tests/mcp-parity.test.ts— 4 tests:MCP_TOOLS↔TOOL_NAMESmatch; essentials mention every MCP tool;buildBranchName()output starts withcr/; rules docs contain no legacy branch prefix (false-positive filter excludes.contentrain/dir paths).@contentrain/skillsreferences/mcp-tools.md— new sections forcontentrain_merge(after submit) +contentrain_doctor(new Doctor Tools subsection). Submit description →cr/*.references/mcp-pipelines.md,references/workflow.md,contentrain-normalizeSKILL + references,contentrain-translateSKILL — all legacy branch prefixes →cr/.tests/mcp-parity.test.ts— 2 tests: every MCP tool has an### <tool>heading in the reference; 7 skill docs have no legacy branch prefix.Monorepo
tsconfig.jsonpaths —@contentrain/mcp/tools/*alias added.Test plan
oxlintrules + skills + mcp/tools → 0 warningstsc --noEmitrules + skills + mcp → 0 errors@contentrain/rulesvitest → 16/16 (was 12, +4 parity)@contentrain/skillsvitest → 85/85 (was 83, +2 parity)No MCP surface changes
Tool behaviour unchanged.
TOOL_NAMESexport is additive; everything else is docs + tests.🤖 Generated with Claude Code