@yandy-r/ycc-opencode 6.3.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,25 +1,26 @@
1
1
  # @yandy-r/ycc-opencode
2
2
 
3
- Experimental, opt-in [OpenCode](https://opencode.ai) V2 plugin carrying the ycc bundle
4
- (version 6.3.0). It is unlisted and never the default install: the
5
- `install.sh --target opencode` file copy remains the primary path.
3
+ OpenCode V2 plugin carrying the ycc bundle (version 6.4.0). It is how ycc installs
4
+ into [OpenCode](https://opencode.ai): `install.sh install --target opencode` writes the `plugins` entry
5
+ below into `~/.config/opencode/opencode.json` for you.
6
6
 
7
7
  Requires OpenCode `>=2.0.30` (V2 plugin API; V1 hook plugins are not supported).
8
8
 
9
9
  ## Enable
10
10
 
11
- Add the package to the V2 `plugins` array in your own `opencode.json`, pinned to an exact release:
11
+ `./install.sh install --target opencode` registers this checkout's package as a directory entry
12
+ (`"file:///abs/path/to/packages/opencode/ycc-opencode"`, not the `index.js` file);
13
+ `--mode repo` registers the published release instead. Either replaces any earlier
14
+ `@yandy-r/ycc-opencode` entry in place. By hand, add the package to the V2 `plugins` array of your own
15
+ `opencode.json`, pinned to an exact release:
12
16
 
13
17
  ```json
14
- { "plugins": ["@yandy-r/ycc-opencode@6.3.0"] }
18
+ { "plugins": ["@yandy-r/ycc-opencode@6.4.0"] }
15
19
  ```
16
20
 
17
21
  Pin the version instead of using the bare name. Right after a release, the registry can briefly serve
18
22
  stale `latest` metadata, and early placeholder versions of this package (`0.0.0-*`) were never
19
- loadable plugins. Bump the pin when you upgrade.
20
-
21
- A local checkout loads with a directory entry (`"file:///abs/path/to/packages/opencode/ycc-opencode"`),
22
- not the `index.js` file.
23
+ loadable plugins. Bump the pin when you upgrade (`install.sh install --target opencode --mode repo` does).
23
24
 
24
25
  ## What it registers
25
26
 
@@ -34,7 +35,7 @@ not the `index.js` file.
34
35
  - **MCP servers**: plain data from `mcp-configs/mcp.json`; `{env:VAR}` placeholders resolve from the
35
36
  environment at setup time.
36
37
  - **Instructions**: `AGENTS.md` pushed through the session `context` hook.
37
- - **Sensitive-file guard** (`ycc-sensitive-guard/`, the same plugin the file-copy install loads): for the
38
+ - **Sensitive-file guard** (`ycc-sensitive-guard/`): for the
38
39
  restricted specialists in its `policy.json` it checks tool calls against the sensitive-file policy,
39
40
  filters search results, and provides their only search tools (`ycc_grep`/`ycc_glob`, shown to them as
40
41
  `grep`/`glob`) after checking the caller's own permissions.
@@ -44,12 +45,17 @@ not the `index.js` file.
44
45
  never loosens or re-prompts a decision. Shell interpreters and build tools in their allowlists still run
45
46
  project code, which the guard does not bound.
46
47
 
47
- ## Coexistence with the file-copy install
48
+ ## Coexistence with local config
49
+
50
+ Skills, agents, and MCP servers are registered under their source ids, in id-keyed registries. OpenCode
51
+ applies config (`~/.config/opencode`, the project's `.opencode/`) after user plugins, so a same-id
52
+ skill, agent, or command there replaces (agents: field-blends over) the package definition; the package's
53
+ `editor.get` skip only sees registrations loaded before it, and MCP config servers genuinely win. Package
54
+ commands are always `ycc:<skill>` and never collide with bare `/<skill>` commands or host built-ins such as
55
+ `/init`. The context hook does not push instructions already present in the request, so the global
56
+ `AGENTS.md` that `install.sh --target opencode --rules` links is not injected twice.
48
57
 
49
- Skills, agents, and MCP servers are registered under their source ids. OpenCode applies file-copy config
50
- (`~/.config/opencode`) after user plugins, so a same-id file-copy skill, agent, or command replaces (agents:
51
- field-blends over) the package definition; the package's `editor.get` skip only sees registrations loaded
52
- before it, and MCP config servers genuinely win. Package commands are always `ycc:<skill>` and never collide
53
- with the bare file-copy `/<skill>` commands or host built-ins such as `/init`. The context hook does not push
54
- instructions already present in the request.
58
+ `install.sh install --target opencode` retires the copies an older ycc installer mirrored into
59
+ `~/.config/opencode/{skills,agents,commands,shared,ycc-sensitive-guard}` (byte-identical ones only), so a
60
+ stale copy cannot shadow the package.
55
61
  Provider and variant settings (`providers`) are user configuration and are not carried by this package.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yandy-r/ycc-opencode",
3
- "version": "6.3.0",
4
- "description": "Experimental opt-in OpenCode V2 plugin registering the ycc bundle (skills, agents, commands, MCP servers, and session instructions) through its setup hook. The file-copy install remains the primary path.",
3
+ "version": "6.4.0",
4
+ "description": "OpenCode V2 plugin registering the ycc bundle (skills, agents, ycc:<skill> commands, MCP servers, the sensitive-file guard and session instructions) through its setup hook. install.sh --target opencode installs it.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "exports": {
@@ -20,7 +20,6 @@
20
20
  "keywords": [
21
21
  "opencode-plugin",
22
22
  "opencode",
23
- "experimental",
24
23
  "ycc"
25
24
  ],
26
25
  "author": {
package/registration.json CHANGED
@@ -133,6 +133,12 @@
133
133
  "description": "Initializes project AI-agent docs and workspace conventions. Use when generating agent rules docs, adding GitHub templates, or bootstrapping project rules.",
134
134
  "path": "skills/init/SKILL.md"
135
135
  },
136
+ {
137
+ "id": "mcp-parity",
138
+ "name": "mcp-parity",
139
+ "description": "Researches a repo and creates or syncs a Linear project, milestones, and prioritized issues for one-to-one MCP parity with the app. Use when planning an MCP server for an API or app, or when re-syncing MCP issues after new features.",
140
+ "path": "skills/mcp-parity/SKILL.md"
141
+ },
136
142
  {
137
143
  "id": "orchestrate",
138
144
  "name": "orchestrate",
@@ -7051,6 +7057,11 @@
7051
7057
  "description": "Initializes project AI-agent docs and workspace conventions. Use when generating agent rules docs, adding GitHub templates, or bootstrapping project rules.",
7052
7058
  "template": "Use the skill tool to load the `init` skill, then follow its instructions with these arguments:\n\n$ARGUMENTS"
7053
7059
  },
7060
+ {
7061
+ "name": "ycc:mcp-parity",
7062
+ "description": "Researches a repo and creates or syncs a Linear project, milestones, and prioritized issues for one-to-one MCP parity with the app. Use when planning an MCP server for an API or app, or when re-syncing MCP issues after new features.",
7063
+ "template": "Use the skill tool to load the `mcp-parity` skill, then follow its instructions with these arguments:\n\n$ARGUMENTS"
7064
+ },
7054
7065
  {
7055
7066
  "name": "ycc:orchestrate",
7056
7067
  "description": "Coordinates specialized agents in dependency-resolved batches. Use when delegating a complex task, splitting independent implementation work, or coordinating multiple specialists.",
@@ -9,7 +9,7 @@
9
9
  - Artifact store
10
10
  - How to Update This Document
11
11
 
12
- As of 2026-11-04
12
+ As of 2026-11-05
13
13
 
14
14
  This file is the authoritative source for which ycc bundle capabilities are supported on each
15
15
  deployment target. Downstream scripts parse the table below; read the Parser Grammar section
@@ -62,7 +62,7 @@ Follow these rules exactly or the parser will misread cells:
62
62
 
63
63
  ## Native vs install.sh Fallback
64
64
 
65
- Packaging status as of v6.0.0 (2026-10-18). This descriptive companion separates shipping native packages
65
+ Packaging status as of v6.3.0 (2026-11-05). This descriptive companion separates shipping native packages
66
66
  from installer-managed artifacts and gated work in `ycc/settings/packages.json`.
67
67
  `listed: false` packages are not published catalog entries; generated trees and successful spikes
68
68
  alone do not make them shipping user install paths. This does not revise the capability verdicts above.
@@ -72,7 +72,7 @@ alone do not make them shipping user install paths. This does not revise the cap
72
72
  | Claude | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-hooks@ycc` (2.1.300+), `ycc-all@ycc`; `status-bar@ycc-mods` | Installs the native plugins via `claude plugin` (`mcp`/`hooks` at project scope by default, user scope with `--global`); rules, settings, statusline | `ycc-agents@ycc` in v7.0.0 |
73
73
  | Cursor | `ycc`, `ycc-rules`, `ycc-mcp`, `ycc-hooks` via the root `.cursor-plugin/marketplace.json` (interactive `/plugins`); hooks `sessionStart` only | Registers the marketplace and prints the `/plugins` step; `cli-config.json` settings (`--global`) | None |
74
74
  | Codex | `ycc@ycc`, `ycc-mcp@ycc` via the root `.agents/plugins/marketplace.json` | Installs both via `codex plugin add` (codex 0.160+ required); agent TOMLs, `AGENTS.md`, `config.toml` | `ycc-hooks` excluded (YAN-1149) |
75
- | opencode | None | Skills, agents, commands, shared, `opencode.json`, `AGENTS.md` | `@yandy-r/ycc-opencode` npm plugin: experimental, opt-in, unpublished |
75
+ | opencode | `@yandy-r/ycc-opencode` npm V2 plugin (opencode `>=2.0.30`), not catalog-listed | Writes its `plugins` entry (local: `file://` checkout; repo: pinned release), retires the old file copy; `opencode.json` settings, `AGENTS.md` link | None |
76
76
  | `agents` | None | Skills and `ycc-shared` copied into `~/.agents/` | None planned |
77
77
  | `omp` | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-rules@ycc` via the root `.omp-plugin/marketplace.json` (omp `>=18.12.2`) | `install.sh --target omp`: local export (`--mode local`) or the repository catalog (`--mode repo`) installed through `omp plugin` (user or project scope); opt-in `--rules` (`AGENTS.md`) and `--settings` (`config.yml`), user scope only | `ycc-hooks` and `ycc-all` excluded (herdr: `herdr integration install omp`) |
78
78
  | `pi` | None | None | `ycc`, `ycc-mcp`, `ycc-rules` deferred to v6.3.0 (ADR 0003, pi `>=1.2.0`); `ycc-hooks` and `ycc-all` excluded |
@@ -96,8 +96,8 @@ The recommendation in `docs/research/ystack/recommendation.md` is qualified by
96
96
  generates the native packages with a tested Cursor floor of 3.24.12, listed in the root marketplace.
97
97
  Native hooks are limited to `sessionStart`; do not infer `WorktreeCreate` or other Claude hook parity.
98
98
  - `opencode-config-hook.md`: V2 registrations and context-hook instructions were verified on
99
- v2.0.29, not the V1 config-hook approach. The experimental npm path still needs CI publishing;
100
- `install.sh` file copy remains primary.
99
+ v2.0.29, not the V1 config-hook approach. Since YAN-1973 the `@yandy-r/ycc-opencode` npm
100
+ plugin is the only opencode install route; `install.sh` writes its `plugins` entry.
101
101
  - `omp-runtime-contract.md`: tested on omp 18.12.2 (supported floor `>=18.12.2`). OMP gets a
102
102
  dedicated generated `.omp-plugin/` tree; shell hooks, `hooks.json`, and `WorktreeCreate` never
103
103
  run, and `ycc-all` is omitted because OMP ignores plugin dependencies. See ADR 0002. The
@@ -252,9 +252,14 @@ cache and catalog entry, `~/.codex/skills` copies, merged `[mcp_servers]`), keep
252
252
  `./scripts/sync.sh --only codex` or after clearing `~/.codex/plugins/cache/`.
253
253
 
254
254
  **INSTALL_PATH:opencode**
255
- Generated bundle lives at `.opencode-plugin/` (skills, agents, commands, AGENTS.md,
256
- opencode.json). Consumed by opencode from `~/.config/opencode/` (global) or `.opencode/`
257
- (project-local) after `install.sh install --target opencode` rsyncs the files.
255
+ The generator writes `.opencode-plugin/` (skills, agents, commands, shared, AGENTS.md,
256
+ opencode.json) and, from it, the npm package `packages/opencode/ycc-opencode`
257
+ (`@yandy-r/ycc-opencode`). `install.sh install --target opencode` merges one `plugins` entry
258
+ into `~/.config/opencode/opencode.json`: `file:///<checkout>/packages/opencode/ycc-opencode` in
259
+ local mode, `@yandy-r/ycc-opencode@<version>` in repo mode. Older ycc-opencode entries are
260
+ replaced in place; the base step then retires the old file copy (byte-identical units,
261
+ owned `mcp.servers`, the owned `./ycc-sensitive-guard` item). `opencode.json` settings and the
262
+ `AGENTS.md` link stay on the installer (`--settings`, `--rules`).
258
263
 
259
264
  **SKILLS:opencode**
260
265
  Native support at `.opencode/skills/<name>/SKILL.md` with strict YAML frontmatter
@@ -148,8 +148,8 @@ This reads `references/release-notes-template.md` and writes `docs/releases/<new
148
148
  The `{{PACKAGES_TABLE}}` placeholder is rendered from `ycc/settings/packages.json`
149
149
  with Package, Runtime, Status, Mechanism, Listed, Version or target, and Notes
150
150
  columns. Included packages show the release version; deferred/excluded entries
151
- show their target. The opencode npm package is experimental, opt-in, and not yet
152
- published; file-copy fallback is noted separately. Prompt the user to review the
151
+ show their target. Experimental and opt-in markers come from the package model;
152
+ file-copy fallback is noted separately. Prompt the user to review the
153
153
  Packages, Summary, and Upgrade Notes sections before committing. If the script
154
154
  exits non-zero, surface stderr and STOP.
155
155
 
@@ -109,7 +109,7 @@ Run: `ycc/skills/bundle-release/scripts/draft-notes.sh <new-version>`
109
109
  - [ ] `Summary` section edited to describe the release in 1–3 sentences.
110
110
  - [ ] `Upgrade Notes` section reviewed and updated (delete if not applicable).
111
111
  - [ ] `Added`, `Changed`, `Removed`, and `Fixed` bullet sections reflect the actual changes from Phase 1.
112
- - [ ] `Packages` section present with the generated table (Package, Runtime, Status, Mechanism, Listed, Version or target, Notes): included packages at the release version, deferred/excluded at their target, opencode npm marked experimental/opt-in/not yet published, and the file-copy fallback noted.
112
+ - [ ] `Packages` section present with the generated table (Package, Runtime, Status, Mechanism, Listed, Version or target, Notes): included packages at the release version, deferred/excluded at their target, experimental/opt-in markers from the package model, and the file-copy fallback noted.
113
113
  - [ ] Commit log section at the bottom preserved as-is (auto-populated by the script).
114
114
 
115
115
  ---
@@ -1,4 +1,4 @@
1
- <!-- Template used by bundle-release/scripts/draft-notes.sh. Placeholders are replaced at generation time; do not remove or rename them. The PACKAGES_TABLE placeholder renders one row per package and runtime from ycc/settings/packages.json (columns Package | Runtime | Status | Mechanism | Listed | Version or target | Notes): included packages show the release version, deferred and excluded packages show their target, and opencode is marked experimental, opt-in, and not yet published. -->
1
+ <!-- Template used by bundle-release/scripts/draft-notes.sh. Placeholders are replaced at generation time; do not remove or rename them. The PACKAGES_TABLE placeholder renders one row per package and runtime from ycc/settings/packages.json (columns Package | Runtime | Status | Mechanism | Listed | Version or target | Notes): included packages show the release version, deferred and excluded packages show their target, and experimental/opt-in markers come from the package model. -->
2
2
 
3
3
  # Release {{VERSION}} — {{DATE}}
4
4
 
@@ -42,8 +42,8 @@ Discovery rules are implemented in `bundle-release/scripts/release_versions.py`
42
42
  `packages/omp/<key>/.omp-plugin/plugin.json` plus `packages/omp/<key>/.opencode-plugin/plugin.json`
43
43
  and `packages/omp/<key>/package.json`. Generated manifests are check-only.
44
44
  - Included opencode npm packages use `packages/opencode/<unscoped-key>/package.json`
45
- and are required to exist at the lockstep version (check-only). The package is
46
- experimental, opt-in, and not yet published.
45
+ and are required to exist at the lockstep version (check-only). `release.yml`
46
+ publishes the package to npm on the maintainer-pushed tag.
47
47
  - `deferred` and `excluded` entries require no manifest and suppress their modeled
48
48
  paths from the bounded backstop. `file-copy` entries are skipped entirely.
49
49
  - `ycc/mods/**` is excluded entirely — `ycc-mods` keeps its own version. Marketplace
@@ -172,8 +172,6 @@ for key in sorted(packages):
172
172
  notes.append("experimental")
173
173
  if entry.get("opt_in"):
174
174
  notes.append("opt-in")
175
- if mechanism == "npm" and status == "included":
176
- notes.append("not yet published")
177
175
  if entry.get("notes"):
178
176
  notes.append(str(entry["notes"]))
179
177
  rows.append(
@@ -0,0 +1,303 @@
1
+ ---
2
+ name: mcp-parity
3
+ description: Researches a repo and creates or syncs a Linear project, milestones,
4
+ and prioritized issues for one-to-one MCP parity with the app. Use when planning
5
+ an MCP server for an API or app, or when re-syncing MCP issues after new features.
6
+ ---
7
+
8
+ # MCP Parity Planner
9
+
10
+ Research what an API, app, or CLI can do and plan an MCP (Model Context Protocol)
11
+ capability that mirrors it one-to-one. The output is Linear only: one Project, a
12
+ fixed set of milestones, and one prioritized issue per capability, plus a
13
+ foundation track for the server itself. This skill plans. It writes no code and no
14
+ files in the target repository.
15
+
16
+ The first run creates the Project. Each later run finds it, re-inventories the
17
+ repository, diffs against the stored manifest, and changes only the delta: new
18
+ capabilities get issues, changed contracts get issue updates, and removed
19
+ capabilities get cancel or removal work. Unchanged capabilities are not touched.
20
+
21
+ ## Current Task
22
+
23
+ **Arguments**: `$ARGUMENTS`
24
+
25
+ - `--dry-run`: research and diff, print the plan, make no Linear writes.
26
+ - `--publish`: skip the Phase 3 confirmation (needed for headless or scheduled runs).
27
+ It never skips the mass-removal guard.
28
+ - `--project REF`: an existing Linear Project (URL, id, or name) to sync. Skips lookup.
29
+ - `--owner-team TEAM`: Linear team key or name for a new Project.
30
+ - `--path DIR`: sub-directory to inventory (monorepo package). Default: the git toplevel.
31
+ - `--refresh-foundation`: on a sync run, re-research foundation and create only
32
+ foundation keys the manifest does not have yet.
33
+ - `--keep-workdir`: keep the scratch directory and print its path at the end.
34
+
35
+ **Questions:** class `clarify` (team or Project ambiguous, manifest repo mismatch):
36
+ headless, print the candidates and stop. Class `confirm-publish` (Phase 3): headless
37
+ without `--publish`, behave as `--dry-run` and print `Stopped before Linear writes:
38
+ headless run. Rerun with --publish.` Class `confirm-destructive` (mass-removal guard):
39
+ headless, stop with `Stopped: {n} of {m} capabilities would be removed. Check --path
40
+ and the branch, then rerun interactively.` See
41
+ `{{package-root}}/shared/references/question-policy.md`.
42
+
43
+ ## Reference map
44
+
45
+ Read each reference when its phase starts, not up front:
46
+
47
+ | Phase | Reference |
48
+ | ----------- | --------------------------------------------------------------------------- |
49
+ | 1 Research | `{{package-root}}/skills/mcp-parity/references/research-agents.md` |
50
+ | 1 Inventory | `{{package-root}}/skills/mcp-parity/references/inventory-format.md` |
51
+ | 2 Plan | `{{package-root}}/skills/mcp-parity/references/milestones-priority.md` |
52
+ | 1-4 Linear | `{{package-root}}/skills/mcp-parity/references/linear-sync.md` |
53
+ | 4 Bodies | `{{package-root}}/skills/mcp-parity/templates/capability-issue.md` |
54
+ | 4 Bodies | `{{package-root}}/skills/mcp-parity/templates/foundation-issue.md` |
55
+
56
+ Scripts:
57
+
58
+ - `{{package-root}}/skills/mcp-parity/scripts/openapi_inventory.py` turns an OpenAPI
59
+ 3.x spec into a deterministic inventory (stable ids and fingerprints).
60
+ - `{{package-root}}/skills/mcp-parity/scripts/detect-api-surface.sh` lists surface
61
+ hints (languages, specs, route files, CLI files, existing MCP code).
62
+ - `{{package-root}}/skills/mcp-parity/scripts/capability_diff.py` validates the
63
+ inventory, diffs it against the manifest, and renders the next manifest.
64
+
65
+ **Shell state does not persist between commands.** Wherever this skill writes
66
+ `$WORKDIR`, `$REPO_SLUG`, or `$COMMIT`, substitute the literal value you recorded.
67
+ Never run a command with one of them empty.
68
+
69
+ ---
70
+
71
+ ## Phase 0: Preflight
72
+
73
+ 1. Resolve the repository root: `git rev-parse --show-toplevel`. With `--path`, the
74
+ inventory root is that directory; it must exist inside the toplevel.
75
+ 2. Derive `REPO_SLUG` as `owner/repo` from the `origin` URL (strip `.git`), else the
76
+ toplevel directory name. `REPO_NAME` is the part after the last `/`. With `--path`,
77
+ append `/<path>` to `REPO_SLUG` and `-<path-basename>` to `REPO_NAME`.
78
+ 3. Read Linear hints from the artifact store resolver (read-only; nothing is created):
79
+
80
+ ```bash
81
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" --shell
82
+ ```
83
+
84
+ Use `ARTIFACT_LINEAR_WORKSPACE`, `ARTIFACT_LINEAR_TEAM`, and `ARTIFACT_LINEAR_LABEL`
85
+ when set. This skill is Linear-only and ignores `ARTIFACT_STORE=local`.
86
+
87
+ 4. **Linear gate.** A Linear MCP must be installed and authorized. If not, stop:
88
+ `mcp-parity needs an authorized Linear MCP. Connect Linear, then rerun.` When
89
+ `ARTIFACT_LINEAR_WORKSPACE` is set, confirm the connected workspace matches; on a
90
+ mismatch, ask (class `clarify`).
91
+ 5. Create a scratch directory outside the repository and record its literal path:
92
+
93
+ ```bash
94
+ mktemp -d "${TMPDIR:-/tmp}/ycc-mcp-parity.XXXXXX"
95
+ ```
96
+
97
+ Write `{}` to `$WORKDIR/issues.json`. Write `$WORKDIR/meta.json` with `project`,
98
+ `repo` (`REPO_SLUG`), `commit`, and `generatedAt` (UTC ISO-8601); fill `project`
99
+ once it is known. Other files (`surface.tsv`, `inventory.json`, `manifest.md` or
100
+ `manifest.json`, `diff.json`) also live there.
101
+
102
+ 6. Record `COMMIT` (`git rev-parse --short HEAD`) and whether the tree is dirty. A
103
+ dirty tree is fine; say so in the summary.
104
+
105
+ ## Phase 1: Detect mode and research
106
+
107
+ ### Step 1: Find a previous run
108
+
109
+ Follow `references/linear-sync.md` > Lookup and Rebuild. The outcome is one of:
110
+
111
+ - **sync**: a Project exists, and its manifest is at `$WORKDIR/manifest.md` (the
112
+ Document body) or `$WORKDIR/manifest.json` (rebuilt). That file is `MANIFEST_FILE`.
113
+ - **create**: no Project. Write an empty manifest and use it as `MANIFEST_FILE`:
114
+
115
+ ```bash
116
+ python3 "{{package-root}}/skills/mcp-parity/scripts/capability_diff.py" init \
117
+ --repo "$REPO_SLUG" > "$WORKDIR/manifest.json"
118
+ ```
119
+
120
+ Print the mode, the Project, and the manifest commit, for example
121
+ `Mode: sync (Project "acme-api · MCP parity", manifest at 1a2b3c4)`.
122
+
123
+ ### Step 2: Refresh issue states (sync only)
124
+
125
+ Follow `references/linear-sync.md` > State refresh. It records `done`, `declined`,
126
+ reopened, and `unlinked` statuses in `issues.json`, and `diff --issues` applies
127
+ them, so people's decisions shape this run.
128
+
129
+ ### Step 3: Surface scan
130
+
131
+ ```bash
132
+ "{{package-root}}/skills/mcp-parity/scripts/detect-api-surface.sh" "<inventory-root>" > "$WORKDIR/surface.tsv"
133
+ ```
134
+
135
+ The output is hints, not truth. Notices about truncated lists go to stderr.
136
+
137
+ **Spec-first inventory.** When `surface.tsv` lists an OpenAPI 3.x `SPEC` that the app
138
+ serves or generates (not a vendored third-party spec), build the base inventory from it
139
+ deterministically. Large APIs (hundreds of operations) are only reliable this way:
140
+
141
+ ```bash
142
+ python3 "{{package-root}}/skills/mcp-parity/scripts/openapi_inventory.py" \
143
+ "<inventory-root>/<spec path>" > "$WORKDIR/inventory.spec.json"
144
+ ```
145
+
146
+ Use `--exclude REGEX` for app-specific non-capabilities. With several specs, prefer
147
+ the one the server generates or serves; ask when unsure. A YAML spec needs PyYAML;
148
+ install it per the dependency policy, or convert the spec to JSON.
149
+
150
+ ### Step 4: Dispatch research agents
151
+
152
+ Read `references/research-agents.md` and dispatch the researchers in parallel in one
153
+ message. Each gets the inventory root and
154
+ `surface.tsv`; on sync runs, researcher 1 also gets each manifest capability's id and
155
+ stored `contract`, so ids and field spellings stay stable:
156
+
157
+ 1. **Surface inventory**: every capability, as inventory JSON. With a spec-first
158
+ inventory, it only verifies it and returns capabilities the spec misses (CLI
159
+ commands, GraphQL/RPC surfaces, undocumented routes) and ids to exclude.
160
+ 2. **Architecture and existing MCP**: existing MCP server, auth model, runtime, and
161
+ where a server should live, plus which operations an existing MCP server covers.
162
+ 3. **MCP practice**: current spec revision, the official SDK for the language,
163
+ transports, auth, and tool annotations. Sync runs skip it unless
164
+ `--refresh-foundation` is set or the manifest has no `foundation` entries.
165
+
166
+ ### Step 5: Assemble, validate, and diff
167
+
168
+ Write researcher 1's JSON (merged into the spec inventory, when there is one, with
169
+ its exclusions removed) to `$WORKDIR/inventory.raw.json`, then produce
170
+ `$WORKDIR/inventory.json` with `references/inventory-format.md` > Coverage merge.
171
+ Validate and diff:
172
+
173
+ ```bash
174
+ python3 "{{package-root}}/skills/mcp-parity/scripts/capability_diff.py" diff \
175
+ --manifest "<MANIFEST_FILE>" --inventory "$WORKDIR/inventory.json" \
176
+ --issues "$WORKDIR/issues.json" --repo "$REPO_SLUG" > "$WORKDIR/diff.json"
177
+ ```
178
+
179
+ A non-zero exit names the problem: fix the inventory field, or, for a repo mismatch,
180
+ stop and ask (class `clarify`; see `references/linear-sync.md` > Lookup for
181
+ `--adopt-repo`). Never hand-edit `diff.json`.
182
+
183
+ **Renames.** For each `possibleRenames` pair, read both operations. When it is the same
184
+ capability, rename the inventory id back to the manifest id and rerun the diff, so it
185
+ reports `changed` instead of a cancel plus a duplicate. Ask when unsure.
186
+
187
+ **Mass-removal guard.** When every tracked capability would be removed, or
188
+ `removedRatio` exceeds `0.25` with more than 3 removed, ask before planning (class `confirm-destructive`), naming the count and the
189
+ inventory root. Wrong `--path`, a stale branch, or a failed researcher usually causes
190
+ it.
191
+
192
+ ## Phase 2: Plan
193
+
194
+ Read `references/milestones-priority.md`.
195
+
196
+ 1. **Foundation track.** Create mode, or `--refresh-foundation` for keys missing from
197
+ `manifest.foundation`: plan the foundation issues from researchers 2 and 3. Skip
198
+ any item the existing MCP server already provides.
199
+ 2. **Added and revived.** One issue each: title, milestone, priority, labels, and body
200
+ from `templates/capability-issue.md`. One capability is one issue, which keeps the
201
+ manifest one-to-one.
202
+ 3. **Changed.** Plan per `references/linear-sync.md` > Changed. The action depends on
203
+ the issue's state and the manifest status.
204
+ 4. **Removed.** Plan per `references/linear-sync.md` > Removed.
205
+ 5. **Covered.** Record in the manifest with no issue.
206
+
207
+ A no-op diff (`"noop": true`) without a foundation refresh plans no issue writes:
208
+ only the manifest refresh and one status update.
209
+
210
+ ### Display the plan
211
+
212
+ Print one table per action, then totals:
213
+
214
+ ```markdown
215
+ ## MCP parity plan: {REPO_SLUG} @ {COMMIT}
216
+
217
+ Mode: {create|sync} · Project: {name or "(new)"}
218
+
219
+ ### New issues ({n})
220
+
221
+ | Capability | Operation | Milestone | Priority | Labels |
222
+ | ---------- | ---------- | -------------- | -------- | -------------------- |
223
+ | users.list | GET /users | M2 Read parity | High | mcp-parity, mcp:tool |
224
+
225
+ ### Updated ({n}) · Cancelled ({n}) · Removal issues ({n}) · Covered ({n}) · Declined ({n}) · Unchanged ({n})
226
+ ```
227
+
228
+ With `--dry-run`, stop here: `Dry run complete. Rerun without --dry-run to publish.`
229
+
230
+ ## Phase 3: Confirm
231
+
232
+ Unless `--publish` is set, ask once (class `confirm-publish`) with the counts:
233
+ `Publish to Linear: create {a} issues, update {c}, cancel {r}, add {m} milestones?`
234
+ Options: publish, or stop as a dry run.
235
+
236
+ ## Phase 4: Write to Linear
237
+
238
+ Follow `references/linear-sync.md` > Write order. Record every successful action in
239
+ `$WORKDIR/issues.json` immediately, before the next call
240
+ (`references/inventory-format.md` > Issue map): a new `issue` key for creates, and
241
+ `"applied": true` for patches, cancels, and covered re-checks. Unrecorded work is
242
+ not committed to the manifest, so the next run retries it.
243
+
244
+ Then render and save the manifest:
245
+
246
+ ```bash
247
+ python3 "{{package-root}}/skills/mcp-parity/scripts/capability_diff.py" apply \
248
+ --manifest "<MANIFEST_FILE>" --inventory "$WORKDIR/inventory.json" --repo "$REPO_SLUG" \
249
+ --issues "$WORKDIR/issues.json" --meta "$WORKDIR/meta.json" --format markdown \
250
+ > "$WORKDIR/manifest.next.md"
251
+ ```
252
+
253
+ Save `manifest.next.md` as the manifest Document (update in place when it exists).
254
+ Then post the Project status update (`references/linear-sync.md` > Status update).
255
+
256
+ ### Failure handling
257
+
258
+ Class `failure-recovery`: when a Linear write fails, stop new writes. Still render the
259
+ manifest with `--partial` added to the command above and save it, so recorded work is
260
+ kept and the rest re-diffs next run. Post the status update with health `atRisk`.
261
+ Report the failed call and the rerun command.
262
+
263
+ ## Phase 5: Summary
264
+
265
+ ```markdown
266
+ # MCP parity {created|synced}: {Project name}
267
+
268
+ Project: {url} · Commit: {COMMIT}{ (dirty tree)}
269
+ Milestones: {list with issue counts}
270
+
271
+ | Action | Count | Issues |
272
+ | --------- | ----- | ------------------- |
273
+ | Created | n | ABC-12, ABC-13, ... |
274
+ | Updated | n | ... |
275
+ | Cancelled | n | ... |
276
+ | Removal | n | ... |
277
+ | Declined | n | ... (not recreated) |
278
+ | Covered | n | - |
279
+ | Unchanged | n | - |
280
+
281
+ Parity: {done + covered}/{tracked} capabilities exposed over MCP.
282
+ Next: rerun /ycc:mcp-parity after API changes; implement issues with /ycc:prp-plan
283
+ or /orchestrate.
284
+ ```
285
+
286
+ Remove `$WORKDIR` unless `--keep-workdir`.
287
+
288
+ ## Important rules
289
+
290
+ - **Plan only.** Never write code, scaffold a server, or commit files in the target
291
+ repository.
292
+ - **Delta only on sync.** Never recreate, retitle, re-prioritize, reassign, or move
293
+ issues that the diff reports as unchanged. People own those fields after creation.
294
+ - **Respect people.** A capability issue a person canceled is `declined`: never
295
+ recreate it; list it in the summary so the gap stays visible.
296
+ - **Never move an issue backwards or delete one.** Cancel only unstarted open issues,
297
+ and only when their capability is gone.
298
+ - **One-to-one.** Every live capability has exactly one tracking issue, or is
299
+ `covered` or `declined`. The parity guardrail issue keeps that true in CI.
300
+ - **Ids are durable.** Capability ids key the manifest and appear in each issue's
301
+ Agent notes. Do not rename ids for style.
302
+ - **Subagents never touch Linear.** Researchers are read-only and return data; this
303
+ skill alone calls the Linear MCP.