@yandy-r/ycc-opencode 6.3.1 → 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,6 +1,6 @@
1
1
  # @yandy-r/ycc-opencode
2
2
 
3
- OpenCode V2 plugin carrying the ycc bundle (version 6.3.1). It is how ycc installs
3
+ OpenCode V2 plugin carrying the ycc bundle (version 6.4.0). It is how ycc installs
4
4
  into [OpenCode](https://opencode.ai): `install.sh install --target opencode` writes the `plugins` entry
5
5
  below into `~/.config/opencode/opencode.json` for you.
6
6
 
@@ -15,7 +15,7 @@ Requires OpenCode `>=2.0.30` (V2 plugin API; V1 hook plugins are not supported).
15
15
  `opencode.json`, pinned to an exact release:
16
16
 
17
17
  ```json
18
- { "plugins": ["@yandy-r/ycc-opencode@6.3.1"] }
18
+ { "plugins": ["@yandy-r/ycc-opencode@6.4.0"] }
19
19
  ```
20
20
 
21
21
  Pin the version instead of using the bare name. Right after a release, the registry can briefly serve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yandy-r/ycc-opencode",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
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",
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.",
@@ -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.
@@ -0,0 +1,171 @@
1
+ # Inventory, manifest, and issue map formats
2
+
3
+ ## Contents
4
+
5
+ - Inventory
6
+ - Capability ids
7
+ - Coverage merge
8
+ - Fingerprint
9
+ - Manifest
10
+ - Issue map
11
+ - Meta
12
+
13
+ `capability_diff.py` reads and writes these files. All are JSON in `$WORKDIR`.
14
+
15
+ ## Inventory
16
+
17
+ `inventory.json` is what the app can do now:
18
+
19
+ ```json
20
+ {
21
+ "schema": 1,
22
+ "capabilities": [
23
+ {
24
+ "id": "users.list",
25
+ "kind": "tool",
26
+ "operation": "GET /v1/users",
27
+ "summary": "List users with filters and pagination.",
28
+ "area": "users",
29
+ "inputs": { "query": { "role": "string?", "cursor": "string?", "limit": "integer?" } },
30
+ "outputs": "Page<User>",
31
+ "mutating": false,
32
+ "destructive": false,
33
+ "auth": "user",
34
+ "surface": "rest",
35
+ "source": "src/routes/users.ts:42",
36
+ "mcpCovered": false
37
+ }
38
+ ]
39
+ }
40
+ ```
41
+
42
+ Required: `id`, `kind` (`tool`, `resource`, or `prompt`), a non-empty `operation`, and
43
+ boolean `mutating` and `destructive`. Everything else is strongly recommended because it drives milestone, priority, and
44
+ the issue body.
45
+
46
+ | Field | Meaning |
47
+ | ------------- | --------------------------------------------------------------------------------------------- |
48
+ | `operation` | The app's own handle: `METHOD /path`, `Query.users`, `rpc UserService.List`, `cli users list` |
49
+ | `inputs` | Normalized parameter shape: names, types, optional marker `?`. Sort keys. |
50
+ | `outputs` | Return type name or shape. |
51
+ | `mutating` | Changes state. |
52
+ | `destructive` | Deletes data, irreversible, or affects billing/security. |
53
+ | `auth` | `public`, `user`, `admin`, `service`, or the app's own scope name. |
54
+ | `surface` | `rest`, `graphql`, `grpc`, `trpc`, `cli`, `sdk`, `webhook`, `job`. |
55
+ | `area` | Resource or domain group, used for labels and grouping. |
56
+ | `mcpCovered` | An MCP tool/resource already exposes it with matching inputs. |
57
+
58
+ **Kind choice.** Read-only lookups of a stable, addressable entity (a document, a
59
+ config, a file) may be a `resource`. Anything with filters, side effects, or
60
+ computation is a `tool`. Reusable user-facing workflows the app documents may be a
61
+ `prompt`. When unsure, use `tool`.
62
+
63
+ **Exclude:** health checks, metrics endpoints, auth handshake routes (login, token
64
+ refresh, OAuth callbacks), static asset routes, internal admin debug routes, and
65
+ webhooks the app receives (they are inputs, not capabilities). List exclusions in the
66
+ researcher report so the user can see them.
67
+
68
+ ## Capability ids
69
+
70
+ Pattern `^[a-z0-9][a-z0-9._-]{0,127}$`, unique. Use `<area>.<verb>` with these verbs:
71
+ `list`, `get`, `search`, `create`, `update`, `delete`, or the domain verb (`invoice.send`,
72
+ `order.refund`). Nested resources use dots: `projects.members.add`. Ids must not encode
73
+ the HTTP method or version so a route move keeps the id.
74
+
75
+ ## Coverage merge
76
+
77
+ Save researcher 2's `covered` array as `$WORKDIR/covered.json`, then let the script
78
+ match operations (method case, `{id}`/`:id`/`<id>` path parameters, and trailing
79
+ slashes are normalized):
80
+
81
+ ```bash
82
+ python3 "{{package-root}}/skills/mcp-parity/scripts/capability_diff.py" cover \
83
+ --inventory "$WORKDIR/inventory.raw.json" --covered "$WORKDIR/covered.json" \
84
+ > "$WORKDIR/inventory.json"
85
+ ```
86
+
87
+ A match sets `mcpCovered` to `inputsMatch`; everything else gets `false`. The output's
88
+ `mcpOnly` list holds MCP tools with no app capability: list them in the summary as
89
+ "MCP-only, review".
90
+
91
+ ## Fingerprint
92
+
93
+ The 16-hex SHA-256 over the normalized contract: `kind`, `operation`, `inputs`,
94
+ `outputs`, `mutating`, `destructive`, and `auth`. Normalization collapses
95
+ whitespace, sorts keys, and defaults missing `inputs` to `{}`, `outputs` to `""`,
96
+ and `auth` to `unspecified`. A fingerprint change means the MCP contract
97
+ must change. `summary`, `area`, `source`, `surface`, and `mcpCovered` never change a
98
+ fingerprint, so line moves and doc edits do not create churn. Normalize `inputs` the
99
+ same way every run (same type spelling) or the diff reports noise; on sync runs,
100
+ researcher 1 receives each stored `contract` to copy its spellings.
101
+
102
+ ## Manifest
103
+
104
+ Stored in the Project's manifest Document as the first fenced `json` block after the
105
+ `## Manifest data` heading (a visible heading, because tracker markdown may drop HTML
106
+ comments). `capability_diff.py apply --format markdown` renders the whole
107
+ Document body.
108
+
109
+ ```json
110
+ {
111
+ "schema": 1,
112
+ "project": "acme-api · MCP parity",
113
+ "repo": "acme/acme-api",
114
+ "commit": "1a2b3c4",
115
+ "generatedAt": "2026-11-09T12:00:00Z",
116
+ "foundation": { "scaffold": "ABC-10", "transport": "ABC-11" },
117
+ "capabilities": {
118
+ "users.list": {
119
+ "area": "users",
120
+ "contract": {
121
+ "kind": "tool",
122
+ "operation": "GET /v1/users",
123
+ "inputs": {},
124
+ "outputs": "Page<User>",
125
+ "mutating": false,
126
+ "destructive": false,
127
+ "auth": "user"
128
+ },
129
+ "fingerprint": "3f1c0d9a7b2e4c11",
130
+ "history": ["ABC-3"],
131
+ "issue": "ABC-12",
132
+ "milestone": "M2 Read parity",
133
+ "operation": "GET /v1/users",
134
+ "priority": 2,
135
+ "status": "planned"
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ `status`: `planned` (issue open), `done` (issue completed), `covered` (exposed before
142
+ this skill tracked it, no issue), `removed` (capability gone from the app), `declined` (a person canceled the issue;
143
+ the skill does not recreate it).
144
+
145
+ ## Issue map
146
+
147
+ `issues.json` records this run's results, keyed by capability id. Allowed fields:
148
+ `issue`, `milestone`, `priority`, `status`, `applied`. Unknown ids or fields fail.
149
+ `status` may also be `unlinked` (the issue was deleted or archived).
150
+
151
+ ```json
152
+ {
153
+ "users.list": { "issue": "ABC-12", "milestone": "M2 Read parity", "priority": 2 },
154
+ "users.update": { "applied": true },
155
+ "users.get": { "status": "done" },
156
+ "legacy.export": { "issue": "ABC-30" },
157
+ "_foundation": { "scaffold": "ABC-10", "parity-guardrail": "ABC-15" }
158
+ }
159
+ ```
160
+
161
+ - `issue`: a create succeeded. A replaced key moves to the entry's `history`.
162
+ - `"applied": true`: a non-create action succeeded (patch, cancel, covered re-check,
163
+ declined acknowledgement). Changed contracts and removals commit to the manifest
164
+ only with `issue` or `applied`; anything else is retried on the next run.
165
+ - `status`: a State refresh result. It never commits a contract change.
166
+
167
+ Write each entry immediately after its Linear call succeeds.
168
+
169
+ ## Meta
170
+
171
+ `meta.json`: `{"project": "...", "repo": "...", "commit": "...", "generatedAt": "<ISO-8601 UTC>"}`.