Skip to content

Phase R1: align rules/skills with MCP surface + cr/* branches + parity tests#42

Merged
ABB65 merged 1 commit intonext-mcpfrom
fix/rules-skills-mcp-parity
Apr 18, 2026
Merged

Phase R1: align rules/skills with MCP surface + cr/* branches + parity tests#42
ABB65 merged 1 commit intonext-mcpfrom
fix/rules-skills-mcp-parity

Conversation

@ABB65
Copy link
Copy Markdown
Member

@ABB65 ABB65 commented Apr 17, 2026

Closes the two P1 drift findings flagged in the release-prep audit and installs parity tests so the same drift can't return.

Problems

  1. Public catalog missing tools@contentrain/rules MCP_TOOLS listed 15 tools. @contentrain/mcp actually registers 17 (contentrain_merge from Phase 9, contentrain_doctor from Phase 14c). @contentrain/skills tool reference jumped from contentrain_submit straight to contentrain_bulk with no merge section.

  2. Legacy contentrain/{operation}/... branch namespace — essentials, review/normalize prompts, and multiple skills still taught the old prefix. MCP's buildBranchName() returns cr/... (Phase 7 migration) and checkBranchHealth filters on cr/. Agents following the shipped guidance would look for branches that don't exist.

Changes

@contentrain/mcp

  • Public export TOOL_NAMES: readonly string[] (frozen, derived from TOOL_ANNOTATIONS) — single source of truth for the tool list.
  • New ./tools/annotations subpath export.

@contentrain/rules

  • MCP_TOOLS extended to 17 (adds contentrain_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 legacy contentrain/<op>/...cr/<op>/....
  • tests/mcp-parity.test.ts — 4 tests: MCP_TOOLSTOOL_NAMES match; essentials mention every MCP tool; buildBranchName() output starts with cr/; rules docs contain no legacy branch prefix (false-positive filter excludes .contentrain/ dir paths).

@contentrain/skills

  • references/mcp-tools.md — new sections for contentrain_merge (after submit) + contentrain_doctor (new Doctor Tools subsection). Submit description → cr/*.
  • references/mcp-pipelines.md, references/workflow.md, contentrain-normalize SKILL + references, contentrain-translate SKILL — 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.json paths — @contentrain/mcp/tools/* alias added.

Test plan

  • 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)

No MCP surface changes

Tool behaviour unchanged. TOOL_NAMES export is additive; everything else is docs + tests.

🤖 Generated with Claude Code

… + 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>
@ABB65 ABB65 merged commit a61b58e into next-mcp Apr 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant