Skip to content

Commit edb0aa1

Browse files
committed
Move spec-annotator to separate plugin
1 parent 74d74c8 commit edb0aa1

20 files changed

Lines changed: 148 additions & 100 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
{
1111
"name": "mcp-spec",
1212
"source": "./plugins/mcp-spec",
13-
"description": "Skills for researching and contributing to the MCP specification"
13+
"description": "Skills for researching the MCP specification via GitHub"
14+
},
15+
{
16+
"name": "mcp-spec-annotator",
17+
"source": "./plugins/mcp-spec-annotator",
18+
"description": "Annotates MCP SEP diffs against extracted requirements, producing structured review artifacts"
1419
}
1520
]
1621
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "mcp-spec-annotator",
3+
"version": "0.1.0",
4+
"description": "Claude Code plugin for annotating MCP SEP diffs against extracted requirements",
5+
"author": {
6+
"name": "Model Context Protocol"
7+
},
8+
"repository": "https://github.com/modelcontextprotocol/modelcontextprotocol",
9+
"license": "Apache-2.0",
10+
"keywords": ["mcp", "model-context-protocol", "specification", "annotation", "review"]
11+
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# MCP Spec Annotator Plugin for Claude
2+
3+
Annotates MCP SEP diffs against extracted requirements, producing structured review artifacts.
4+
5+
## Installation
6+
7+
### Claude Code
8+
9+
```bash
10+
/plugin marketplace add modelcontextprotocol/modelcontextprotocol
11+
```
12+
13+
### Claude Cowork
14+
15+
Navigate to Customize >> Browse Plugins >> Personal >> Plus Button >> Add marketplace from GitHub and add `modelcontextprotocol/modelcontextprotocol`
16+
17+
## Available Skills
18+
19+
### `/spec-annotate <sep_number> [mode] [commit_range]`
20+
21+
Orchestrates the full SEP annotation pipeline: reads the SEP, fetches the PR diff, extracts requirements, annotates hunks against requirements, and renders a self-contained HTML report.
22+
23+
| Argument | Required | Default | Description |
24+
| -------------- | -------- | -------- | ---------------------------------------------------------- |
25+
| `sep_number` | Yes || SEP number (e.g., 1686) |
26+
| `mode` | No | `review` | `review` = fresh extraction; `validator` = reuse meta-spec |
27+
| `commit_range` | No || Local git range (e.g., `abc..def`). Omit for PR mode. |
28+
29+
**Output:** `.reviews/SEP-{number}/annotated-diff.html` (plus `meta-spec.json` and `annotations.json`)
30+
31+
**Example:**
32+
33+
```
34+
/spec-annotate 1686
35+
/spec-annotate 1686 validator
36+
/spec-annotate 1686 review abc123..def456
37+
```
38+
39+
### `/spec-update <sep_number> <action> <details>`
40+
41+
Updates an existing meta-spec by adding, removing, modifying, or recategorizing requirements. Preserves existing requirements and offers to re-annotate after changes.
42+
43+
| Argument | Required | Description |
44+
| ------------ | -------- | -------------------------------------------- |
45+
| `sep_number` | Yes | SEP number |
46+
| `action` | Yes | `add`, `remove`, `modify`, or `recategorize` |
47+
| `details` | Yes | Natural language description of the change |
48+
49+
**Example:**
50+
51+
```
52+
/spec-update 1686 add "Servers MUST send progress notifications for long-running tasks"
53+
/spec-update 1686 recategorize "R005 from must-change to may-change"
54+
```
55+
56+
### `/spec-orchestrate <sep_number> [max_iterations]`
57+
58+
Iteratively runs spec review and implementation in a feedback loop until all requirements are satisfied or conflicts are escalated to the user.
59+
60+
| Argument | Required | Default | Description |
61+
| ---------------- | -------- | ------- | ------------------------------- |
62+
| `sep_number` | Yes || SEP number |
63+
| `max_iterations` | No | 3 | Maximum review-implement cycles |
64+
65+
**Example:**
66+
67+
```
68+
/spec-orchestrate 1686
69+
/spec-orchestrate 1686 5
70+
```
71+
72+
## Agents
73+
74+
### `spec-reviewer`
75+
76+
Runs the full annotation pipeline (extract/reuse meta-spec, annotate diff, render HTML). Launched by `/spec-annotate` and `/spec-orchestrate`.
77+
78+
### `spec-qa`
79+
80+
Quality gate agent that audits annotation artifacts against a 21-point checklist covering requirements quality (EARS format, specific actors, affected paths), annotation quality (no empty explanations, multi-hunk synthesis, no cross-product noise), and completeness. Returns a pass/fail verdict with specific issues. Launched by `/spec-annotate` and `/spec-orchestrate` after the reviewer finishes.
81+
82+
### `spec-implementer`
83+
84+
Reads the meta-spec and annotations, then edits schema and documentation files to satisfy unaddressed or violated requirements. Launched by `/spec-orchestrate`.
85+
86+
## Internal Skills (not user-invocable)
87+
88+
These skills provide instructions followed inline by the orchestrator:
89+
90+
- **`spec-extract`** — Extracts structured requirements from SEP markdown
91+
- **`spec-diff`** — Annotates diff hunks against meta-spec requirements
92+
- **`spec-render`** — Populates the HTML template with annotation data
93+
- **`spec-annotation-workflow`** — End-to-end pipeline for the spec-reviewer agent
94+
95+
## Annotation Output
96+
97+
All artifacts are written to `.reviews/SEP-{number}/` (gitignored by default):
98+
99+
| File | Description |
100+
| --------------------- | ---------------------------------------------- |
101+
| `meta-spec.json` | Structured requirements extracted from the SEP |
102+
| `annotations.json` | Per-hunk annotations with coverage status |
103+
| `annotated-diff.html` | Self-contained HTML report for sharing |
104+
105+
The HTML artifact uses a three-column layout (annotations | diff | issues) with GitHub dark theme colors, and can be published to a GitHub Gist for sharing with other reviewers.
106+
107+
## Dependencies
108+
109+
This plugin works alongside the [mcp-spec](../mcp-spec/) plugin, which provides `mcp-spec:search-mcp-github` (used by the `spec-reviewer` and `spec-implementer` agents for GitHub research).

plugins/mcp-spec/agents/spec-implementer.md renamed to plugins/mcp-spec-annotator/agents/spec-implementer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You are a Spec Implementation Agent. Your job is to make edits to the MCP specif
1010

1111
1. `spec-extract` — understand the meta-spec format and requirement categories
1212
2. `spec-diff` — understand annotation statuses and what "satisfied" means for each requirement
13-
3. `search-mcp-github` — search for prior PRs and discussions that may inform implementation decisions
13+
3. `mcp-spec:search-mcp-github` — search for prior PRs and discussions that may inform implementation decisions
1414

1515
## Input
1616

File renamed without changes.

plugins/mcp-spec/agents/spec-reviewer.md renamed to plugins/mcp-spec-annotator/agents/spec-reviewer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You are a SEP Annotation Agent. Your job is to produce a complete annotated diff
1212
2. `spec-extract` — requirement extraction format and rules
1313
3. `spec-diff` — per-hunk annotation rules, hunk splitting, and explanation quality
1414
4. `spec-render` — how to invoke the render script
15-
5. `search-mcp-github` — GitHub search patterns, useful when resolving PR metadata
15+
5. `mcp-spec:search-mcp-github` — GitHub search patterns, useful when resolving PR metadata
1616

1717
## Behavior
1818

@@ -38,7 +38,7 @@ You may be resumed by the orchestrator with a list of annotation issues from the
3838
Do not re-run the full pipeline — only fix the specific issues identified. Use the render script to re-render after fixes:
3939

4040
```
41-
python3 plugins/mcp-spec/skills/spec-render/scripts/render.py .reviews/SEP-{n}/meta-spec.json .reviews/SEP-{n}/annotations.json .reviews/SEP-{n}/annotated-diff.html
41+
python3 plugins/mcp-spec-annotator/skills/spec-render/scripts/render.py .reviews/SEP-{n}/meta-spec.json .reviews/SEP-{n}/annotations.json .reviews/SEP-{n}/annotated-diff.html
4242
```
4343

4444
## Output Constraints

plugins/mcp-spec/skills/spec-annotate/SKILL.md renamed to plugins/mcp-spec-annotator/skills/spec-annotate/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Re-annotate SEP-{sep_number}. Mode: validator. {commit_range if provided, else "
5454
The meta-spec was updated to fix QA issues. Re-annotate the diff against it and re-render.
5555
5656
Use the pre-built scripts — do NOT write HTML manually or create custom Python scripts:
57-
- python3 plugins/mcp-spec/skills/spec-diff/scripts/parse_diff.py (parse diff)
58-
- python3 plugins/mcp-spec/skills/spec-diff/scripts/annotate.py (build skeleton)
59-
- python3 plugins/mcp-spec/skills/spec-render/scripts/render.py (render HTML)
57+
- python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/parse_diff.py (parse diff)
58+
- python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/annotate.py (build skeleton)
59+
- python3 plugins/mcp-spec-annotator/skills/spec-render/scripts/render.py (render HTML)
6060
6161
Write ONLY meta-spec.json, annotations.json, and annotated-diff.html. No summary.md, README, or other files.
6262
```

plugins/mcp-spec/skills/spec-annotation-workflow/SKILL.md renamed to plugins/mcp-spec-annotator/skills/spec-annotation-workflow/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Check if `.reviews/SEP-{sep_number}/meta-spec.json` already exists.
5858
- **Otherwise**: Run the extraction script, then enrich the output:
5959

6060
```bash
61-
python3 plugins/mcp-spec/skills/spec-extract/scripts/extract.py \
61+
python3 plugins/mcp-spec-annotator/skills/spec-extract/scripts/extract.py \
6262
seps/{sep_number}-*.md \
6363
.reviews/SEP-{sep_number}
6464
```
@@ -73,12 +73,12 @@ If you saved the diff to a file, parse and scaffold it with the scripts:
7373

7474
```bash
7575
# Parse and split hunks
76-
python3 plugins/mcp-spec/skills/spec-diff/scripts/parse_diff.py \
76+
python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/parse_diff.py \
7777
.reviews/SEP-{sep_number}/pr-diff.txt \
7878
.reviews/SEP-{sep_number}/parsed-diff.json
7979

8080
# Build annotation skeleton (all requirements as not_addressed, patch_text included, generated files excluded)
81-
python3 plugins/mcp-spec/skills/spec-diff/scripts/annotate.py \
81+
python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/annotate.py \
8282
.reviews/SEP-{sep_number}/meta-spec.json \
8383
.reviews/SEP-{sep_number}/parsed-diff.json \
8484
.reviews/SEP-{sep_number}/annotations.json
@@ -91,7 +91,7 @@ Then read the skeleton `annotations.json` and fill in each requirement's `status
9191
Follow the `spec-render` skill instructions — run the render script:
9292

9393
```bash
94-
python3 plugins/mcp-spec/skills/spec-render/scripts/render.py \
94+
python3 plugins/mcp-spec-annotator/skills/spec-render/scripts/render.py \
9595
.reviews/SEP-{sep_number}/meta-spec.json \
9696
.reviews/SEP-{sep_number}/annotations.json \
9797
.reviews/SEP-{sep_number}/annotated-diff.html

plugins/mcp-spec/skills/spec-diff/SKILL.md renamed to plugins/mcp-spec-annotator/skills/spec-diff/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ The `summary` object contains counts of each status across all entries in `annot
150150
If you have the raw diff as a file, run the parsing script to get structured, section-split hunks:
151151

152152
```bash
153-
python3 plugins/mcp-spec/skills/spec-diff/scripts/parse_diff.py <diff_file> <parsed_diff.json>
153+
python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/parse_diff.py <diff_file> <parsed_diff.json>
154154
```
155155

156156
This produces a JSON file with files split into logical hunks (MDX files split on `##` headings, TS files split on declarations). If you received per-file patches from the GitHub API instead of a raw diff file, you can skip this script and split hunks manually following the rules in "Splitting Large Hunks" above.
@@ -160,7 +160,7 @@ This produces a JSON file with files split into logical hunks (MDX files split o
160160
Generate a skeleton annotations.json with all structure pre-populated:
161161

162162
```bash
163-
python3 plugins/mcp-spec/skills/spec-diff/scripts/annotate.py \
163+
python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/annotate.py \
164164
<meta_spec.json> <parsed_diff.json> <output_annotations.json>
165165
```
166166

@@ -183,7 +183,7 @@ Read the skeleton annotations.json and for each requirement:
183183
Alternatively, write a `matches.json` file and re-run the script to apply it:
184184

185185
```bash
186-
python3 plugins/mcp-spec/skills/spec-diff/scripts/annotate.py \
186+
python3 plugins/mcp-spec-annotator/skills/spec-diff/scripts/annotate.py \
187187
<meta_spec.json> <parsed_diff.json> <output.json> --matches <matches.json>
188188
```
189189

plugins/mcp-spec/skills/spec-diff/scripts/annotate.py renamed to plugins/mcp-spec-annotator/skills/spec-diff/scripts/annotate.py

File renamed without changes.

0 commit comments

Comments
 (0)