@yandy-r/ycc-opencode 6.3.1 → 6.5.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.
Files changed (38) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/registration.json +11 -0
  4. package/shared/references/branching-model.md +2 -1
  5. package/shared/references/worktree-strategy.md +4 -12
  6. package/shared/scripts/lib/ci-classify.sh +2 -2
  7. package/shared/scripts/release-feature-sets.sh +18 -0
  8. package/shared/scripts/release_feature_sets.py +232 -0
  9. package/shared/scripts/setup-worktree.sh +2 -69
  10. package/skills/bundle-author/references/surface-map.md +1 -1
  11. package/skills/bundle-author/references/when-not-to-scaffold.md +1 -1
  12. package/skills/bundle-release/SKILL.md +22 -5
  13. package/skills/bundle-release/references/release-checklist.md +9 -1
  14. package/skills/bundle-release/references/version-policy.md +11 -4
  15. package/skills/formatters/SKILL.md +2 -1
  16. package/skills/formatters/references/flag-reference.md +8 -4
  17. package/skills/formatters/references/templates/lint-autofix.yml.tmpl +184 -18
  18. package/skills/formatters/references/templates/readme-section.md.tmpl +1 -1
  19. package/skills/formatters/scripts/bundle/style.sh +2 -2
  20. package/skills/git-cleanup/SKILL.md +4 -5
  21. package/skills/init/references/conventional-commits.md +8 -1
  22. package/skills/init/references/template-library.md +1 -1
  23. package/skills/init/templates/git/gitmessage.tmpl +2 -1
  24. package/skills/mcp-parity/SKILL.md +303 -0
  25. package/skills/mcp-parity/references/inventory-format.md +171 -0
  26. package/skills/mcp-parity/references/linear-sync.md +194 -0
  27. package/skills/mcp-parity/references/milestones-priority.md +91 -0
  28. package/skills/mcp-parity/references/research-agents.md +122 -0
  29. package/skills/mcp-parity/scripts/capability_diff.py +525 -0
  30. package/skills/mcp-parity/scripts/detect-api-surface.sh +109 -0
  31. package/skills/mcp-parity/scripts/openapi_inventory.py +253 -0
  32. package/skills/mcp-parity/templates/capability-issue.md +38 -0
  33. package/skills/mcp-parity/templates/foundation-issue.md +35 -0
  34. package/skills/release-model/templates/RELEASING.md.tmpl +2 -1
  35. package/skills/releaser/SKILL.md +5 -1
  36. package/skills/releaser/references/release-preparation.md +34 -15
  37. package/shared/scripts/merge-children.sh +0 -82
  38. package/skills/write-docs/templates/docs-readme.md +0 -34
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.5.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.5.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.5.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.",
@@ -29,7 +29,8 @@ These apply to both models.
29
29
  scenes and flip it in one final PR shortly before the release.
30
30
  5. **A release is a tag on a branch.** Never assemble a release by picking commits after
31
31
  the fact.
32
- 6. **Agents never tag or publish** unless a maintainer explicitly approves that step.
32
+ 6. **One approval per release.** Once a maintainer approves the release ("ship x.y.z to
33
+ prod?"), agents may tag, publish and cut it.
33
34
 
34
35
  ## Models
35
36
 
@@ -24,12 +24,7 @@ plan annotation format, per-target dispatch matrix, and cleanup. There is
24
24
  per parallel task, and not per-severity fan-out. Individual skills own flag
25
25
  plumbing and per-phase behavior; the shared **invariant** lives here.
26
26
 
27
- **Migration note (GitHub #79 / #80):** Older skills and plan artifacts may still
28
- describe a parent/child model, `**Children**` lists, per-task `**Worktree**:`,
29
- or `merge-children.sh` fan-in. That model is **deprecated** for the shared
30
- contract. `setup-worktree.sh child` and `merge-children.sh` are **compatibility
31
- shims** (see shared scripts) until all executors are updated. New planners and
32
- executors should follow **only** the single-worktree contract below.
27
+ **Migration note (GitHub #79 / #80):** the parent/child worktree model and its fan-in merge were removed; follow only the single-worktree contract below.
33
28
 
34
29
  and how a single worktree pairs with parallel sub-agent dispatch.
35
30
 
@@ -232,8 +227,7 @@ Older plans may still include:
232
227
  - A per-task line: `- **Worktree**: <path> ...` inside a task block
233
228
 
234
229
  Parsers that support legacy plans may read these for migration or display, but
235
- the shared **default** is: **one** worktree, no fan-in merge, no
236
- `setup-worktree.sh child` in the new workflow path.
230
+ the shared **default** is: **one** worktree, no fan-in merge.
237
231
 
238
232
  ### Review / PR review artifacts
239
233
 
@@ -255,10 +249,8 @@ need not emit per-task `**Worktree**:` lines for new work.
255
249
  1. **Once:** `setup-worktree.sh parent <repo> <feature-slug>` (optional `--base-ref` for existing branches).
256
250
  2. **Per batch / task:** run work in the feature worktree; dispatch parallel agents
257
251
  with `Working directory: <feature-worktree-path>` (or equivalent target-specific isolation) — **all share the same path**.
258
- 3. **No** `setup-worktree.sh child` and **no** `merge-children.sh` in the new contract.
259
- (Legacy calls may still exist in older skill text; shims are non-destructive — see script headers.)
260
- 4. **Validate** between batches as the skill requires.
261
- 5. On **merge conflicts** or validation failure, handle in the feature worktree
252
+ 3. **Validate** between batches as the skill requires.
253
+ 4. On **merge conflicts** or validation failure, handle in the feature worktree
262
254
  per skill policy (pause, user resolve, etc.).
263
255
 
264
256
  ---
@@ -2,8 +2,8 @@
2
2
  # ci-classify.sh — Shared failure classification and signature helpers.
3
3
  #
4
4
  # Sourced by:
5
- # - ${SCRIPT_DIR}/../../../shared/scripts/ci-monitor.sh (PR-mode monitor)
6
- # - ${SCRIPT_DIR}/../../../shared/scripts/release-ci-monitor.sh (release-mode monitor)
5
+ # - .opencode-plugin/shared/scripts/ci-monitor.sh (PR-mode monitor)
6
+ # - .opencode-plugin/shared/scripts/release-ci-monitor.sh (release-mode monitor)
7
7
  #
8
8
  # Contract:
9
9
  # See _shared/references/ci-monitoring.md ("Failure classification" section)
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+ # release-feature-sets.sh — group feat commits since the last tag into feature
3
+ # sets and compute the minimum semver bump. A feat commit alone does not force a
4
+ # minor: only feature sets the maintainer names complete (--complete) do.
5
+ #
6
+ # Usage:
7
+ # release-feature-sets.sh [--repo DIR] [--from REF] [--to REF]
8
+ # [--complete SET[,SET...]|all] [--format json|text]
9
+ #
10
+ # Feature set = `Feature-Set:` trailer, else the commit scope, else `unscoped`.
11
+ # Required bump: major (breaking) > minor (a set is complete) > patch > none.
12
+ # Requires python3 3.11+. Exit codes: 0 ok, 1 usage error, git error or unknown set.
13
+ set -euo pipefail
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
+ # shellcheck source=require-python.sh
16
+ . "${SCRIPT_DIR}/require-python.sh"
17
+ export PYTHONDONTWRITEBYTECODE=1
18
+ exec python3 "${SCRIPT_DIR}/release_feature_sets.py" "$@"
@@ -0,0 +1,232 @@
1
+ #!/usr/bin/env python3
2
+ """Group release commits into feature sets and compute the required semver bump.
3
+
4
+ A single ``feat:`` commit does not force a minor release. ``feat`` commits are
5
+ grouped into feature sets: the ``Feature-Set:`` trailer when present, otherwise
6
+ the Conventional Commits scope (``feat(worktree): ...`` -> ``worktree``),
7
+ otherwise ``unscoped``. A commit of any other type joins a set only through a
8
+ ``Feature-Set:`` trailer. The maintainer names the sets that are complete and
9
+ user-visible with ``--complete``; only those require a minor.
10
+
11
+ A set whose ``feat`` commits shipped in an earlier (patch) release can still be
12
+ completed: name it with ``--complete`` and the helper finds it in the history
13
+ before the range (or add a ``Feature-Set:`` trailer to the finishing commit).
14
+
15
+ Required bump, first match wins:
16
+
17
+ - ``major``: any breaking change (``type!:``, ``type(scope)!:``, or a
18
+ ``BREAKING CHANGE:`` / ``BREAKING-CHANGE:`` footer, merge commits included).
19
+ - ``minor``: at least one feature set is named complete.
20
+ - ``patch``: any other non-merge commit in the range.
21
+ - ``none``: the range has no non-merge commits.
22
+
23
+ The bump is a floor computed from commit markers only. Release policies may
24
+ require more (for example a renamed or removed public surface); apply those too.
25
+ Standard library only; the file is copied verbatim into every runtime bundle.
26
+ """
27
+
28
+ from __future__ import annotations
29
+
30
+ import argparse
31
+ import json
32
+ import re
33
+ import subprocess
34
+ import sys
35
+ from dataclasses import dataclass, field
36
+ from typing import Any
37
+
38
+ HEADER_RE = re.compile(r"^(?P<type>[A-Za-z]+)(?:\((?P<scope>[^)]*)\))?(?P<bang>!)?:\s*(?P<desc>.+)$")
39
+ BREAKING_RE = re.compile(r"^BREAKING[ -]CHANGE:", re.MULTILINE)
40
+ TRAILER_RE = re.compile(r"^Feature-Set:\s*(?P<name>\S.*?)\s*$", re.MULTILINE | re.IGNORECASE)
41
+ UNSCOPED = "unscoped"
42
+ FIELD_SEP = "\x1f"
43
+ RECORD_SEP = "\x1e"
44
+
45
+
46
+ @dataclass
47
+ class Commit:
48
+ sha: str
49
+ subject: str
50
+ kind: str
51
+ breaking: bool
52
+ feature_set: str | None
53
+
54
+
55
+ @dataclass
56
+ class Report:
57
+ from_ref: str | None
58
+ to_ref: str
59
+ commits: list[Commit] = field(default_factory=list)
60
+ complete: list[str] = field(default_factory=list)
61
+ earlier: list[str] = field(default_factory=list)
62
+
63
+ def feature_sets(self) -> dict[str, list[Commit]]:
64
+ sets: dict[str, list[Commit]] = {}
65
+ for commit in self.commits:
66
+ if commit.feature_set is not None:
67
+ sets.setdefault(commit.feature_set, []).append(commit)
68
+ return sets
69
+
70
+ def required_bump(self) -> str:
71
+ if any(c.breaking for c in self.commits):
72
+ return "major"
73
+ if not any(c.kind != "merge" for c in self.commits):
74
+ return "none"
75
+ if self.complete:
76
+ return "minor"
77
+ return "patch"
78
+
79
+
80
+ def classify(sha: str, subject: str, body: str, *, merge: bool = False) -> Commit:
81
+ """Classify one commit; a merge commit only contributes its breaking markers."""
82
+ match = HEADER_RE.match(subject)
83
+ breaking = bool(match and match.group("bang")) or bool(BREAKING_RE.search(body))
84
+ if merge:
85
+ return Commit(sha=sha, subject=subject, kind="merge", breaking=breaking, feature_set=None)
86
+ kind = match.group("type").lower() if match else "other"
87
+ trailer = TRAILER_RE.search(body)
88
+ feature_set: str | None = trailer.group("name") if trailer else None
89
+ if kind == "feat" and feature_set is None:
90
+ feature_set = ((match.group("scope") or "").strip() if match else "") or UNSCOPED
91
+ return Commit(sha=sha, subject=subject, kind=kind, breaking=breaking, feature_set=feature_set)
92
+
93
+
94
+ def git(repo: str, *args: str) -> subprocess.CompletedProcess[str]:
95
+ return subprocess.run(["git", "-C", repo, *args], capture_output=True, text=True, check=False)
96
+
97
+
98
+ def latest_tag(repo: str, to_ref: str) -> str | None:
99
+ result = git(repo, "describe", "--tags", "--abbrev=0", to_ref)
100
+ if result.returncode != 0:
101
+ return None
102
+ return result.stdout.strip() or None
103
+
104
+
105
+ def read_commits(repo: str, rev_range: str) -> list[Commit]:
106
+ fmt = f"%H{FIELD_SEP}%P{FIELD_SEP}%s{FIELD_SEP}%b{RECORD_SEP}"
107
+ result = git(repo, "log", f"--format={fmt}", rev_range)
108
+ if result.returncode != 0:
109
+ raise ValueError(f"git log {rev_range} failed: {result.stderr.strip()}")
110
+ commits: list[Commit] = []
111
+ for record in result.stdout.split(RECORD_SEP):
112
+ record = record.strip("\n")
113
+ if not record:
114
+ continue
115
+ sha, parents, subject, body = (record.split(FIELD_SEP) + ["", "", ""])[:4]
116
+ commits.append(classify(sha, subject, body, merge=len(parents.split()) > 1))
117
+ return commits
118
+
119
+
120
+ def resolve_complete(
121
+ requested: list[str], sets: dict[str, list[Commit]], earlier: set[str]
122
+ ) -> tuple[list[str], list[str]]:
123
+ """Validate ``--complete`` names. Return (complete, completed-from-earlier-releases).
124
+
125
+ ``all`` selects every set in the range. A name not in the range is accepted
126
+ when a set of that name shipped before the range start.
127
+ """
128
+ if requested == ["all"]:
129
+ return sorted(sets), []
130
+ unknown = [name for name in requested if name not in sets and name not in earlier]
131
+ if unknown:
132
+ known = ", ".join(sorted(sets)) or "(none)"
133
+ raise ValueError(
134
+ f"unknown feature set(s): {', '.join(unknown)}; sets in range: {known}; "
135
+ "no set of that name before the range either"
136
+ )
137
+ names = sorted(set(requested))
138
+ return names, [name for name in names if name not in sets]
139
+
140
+
141
+ def earlier_sets(repo: str, from_ref: str | None) -> set[str]:
142
+ """Feature-set names from commits reachable from the range start."""
143
+ if from_ref is None:
144
+ return set()
145
+ return {c.feature_set for c in read_commits(repo, from_ref) if c.feature_set is not None}
146
+
147
+
148
+ def to_json(report: Report) -> dict[str, Any]:
149
+ def brief(c: Commit) -> dict[str, str]:
150
+ return {"sha": c.sha[:12], "kind": c.kind, "subject": c.subject}
151
+
152
+ counts: dict[str, int] = {"feat": 0, "fix": 0, "other": 0}
153
+ for c in report.commits:
154
+ if c.kind != "merge":
155
+ counts[c.kind if c.kind in counts else "other"] += 1
156
+ sets = [
157
+ {"name": name, "complete": name in report.complete, "earlier": False, "commits": [brief(c) for c in commits]}
158
+ for name, commits in sorted(report.feature_sets().items())
159
+ ]
160
+ sets += [{"name": name, "complete": True, "earlier": True, "commits": []} for name in report.earlier]
161
+ return {
162
+ "from": report.from_ref,
163
+ "to": report.to_ref,
164
+ "counts": counts,
165
+ "breaking": [brief(c) for c in report.commits if c.breaking],
166
+ "feature_sets": sets,
167
+ "complete": report.complete,
168
+ "required_bump": report.required_bump(),
169
+ }
170
+
171
+
172
+ def to_text(report: Report) -> str:
173
+ data = to_json(report)
174
+ lines = [f"Range: {data['from'] or '(root)'}..{data['to']}"]
175
+ counts = data["counts"]
176
+ lines.append(f"Commits: {counts['feat']} feat, {counts['fix']} fix, {counts['other']} other")
177
+ for item in data["breaking"]:
178
+ lines.append(f"BREAKING {item['sha']} {item['subject']}")
179
+ if data["feature_sets"]:
180
+ lines.append("Feature sets:")
181
+ for fs in data["feature_sets"]:
182
+ if fs["earlier"]:
183
+ lines.append(f" {fs['name']} (shipped in earlier releases, complete)")
184
+ continue
185
+ feats = sum(1 for c in fs["commits"] if c["kind"] == "feat")
186
+ mark = "complete" if fs["complete"] else "in progress"
187
+ extra = len(fs["commits"]) - feats
188
+ other = f" + {extra} other" if extra else ""
189
+ lines.append(f" {fs['name']} ({feats} feat{other}, {mark})")
190
+ lines.extend(f" {c['sha']} {c['subject']}" for c in fs["commits"])
191
+ else:
192
+ lines.append("Feature sets: none")
193
+ lines.append(f"Required bump: {data['required_bump']}")
194
+ return "\n".join(lines)
195
+
196
+
197
+ def parse_args(argv: list[str]) -> argparse.Namespace:
198
+ parser = argparse.ArgumentParser(prog="release-feature-sets.sh", description=__doc__.splitlines()[0])
199
+ parser.add_argument("--repo", default=".", help="repository path (default: .)")
200
+ parser.add_argument("--from", dest="from_ref", help="range start (default: latest tag reachable from --to)")
201
+ parser.add_argument("--to", dest="to_ref", default="HEAD", help="range end (default: HEAD)")
202
+ parser.add_argument(
203
+ "--complete",
204
+ default="",
205
+ help="comma-separated feature sets that are complete and user-visible, or 'all'",
206
+ )
207
+ parser.add_argument("--format", choices=("json", "text"), default="json")
208
+ return parser.parse_args(argv)
209
+
210
+
211
+ def main(argv: list[str] | None = None) -> int:
212
+ args = parse_args(sys.argv[1:] if argv is None else argv)
213
+ if git(args.repo, "rev-parse", "--git-dir").returncode != 0:
214
+ print(f"release-feature-sets: not a git repository: {args.repo}", file=sys.stderr)
215
+ return 1
216
+ from_ref = args.from_ref or latest_tag(args.repo, args.to_ref)
217
+ rev_range = f"{from_ref}..{args.to_ref}" if from_ref else args.to_ref
218
+ try:
219
+ report = Report(from_ref=from_ref, to_ref=args.to_ref, commits=read_commits(args.repo, rev_range))
220
+ requested = [n.strip() for n in args.complete.split(",") if n.strip()]
221
+ sets = report.feature_sets()
222
+ earlier = earlier_sets(args.repo, from_ref) if any(n not in sets for n in requested) else set()
223
+ report.complete, report.earlier = resolve_complete(requested, sets, earlier)
224
+ except ValueError as exc:
225
+ print(f"release-feature-sets: {exc}", file=sys.stderr)
226
+ return 1
227
+ print(json.dumps(to_json(report), indent=2) if args.format == "json" else to_text(report))
228
+ return 0
229
+
230
+
231
+ if __name__ == "__main__":
232
+ raise SystemExit(main())
@@ -4,7 +4,6 @@
4
4
  #
5
5
  # Usage:
6
6
  # setup-worktree.sh parent <repo-name> <feature-slug> [--base-ref <branch>]
7
- # setup-worktree.sh child <repo-name> <feature-slug> <task-id> [DEPRECATED]
8
7
  #
9
8
  # Modes:
10
9
  # parent Creates <repo-root>/.opencode/worktrees/<repo>-<feature>/. This is the
@@ -15,15 +14,10 @@
15
14
  # With --base-ref: checks out the existing branch (e.g. PR head). If the
16
15
  # branch is missing locally, runs git fetch from origin once.
17
16
  #
18
- # child DEPRECATED. Does not create a separate per-task worktree. Prints a
19
- # warning to stderr and echoes the *feature* worktree path (same as
20
- # parent) if it already exists; otherwise instructs the caller to run
21
- # `parent` first. Non-destructive — no new git worktrees for “children”.
22
- #
23
17
  # Idempotency (parent): if the path exists and is on the expected branch, echo path.
24
18
  #
25
19
  # Exit codes:
26
- # 0 success (path echoed to stdout; child deprecation may print to stderr)
20
+ # 0 success (path echoed to stdout)
27
21
  # 1 error (message on stderr)
28
22
 
29
23
  set -euo pipefail
@@ -36,12 +30,10 @@ usage() {
36
30
  cat >&2 <<'EOF'
37
31
  Usage:
38
32
  setup-worktree.sh parent <repo-name> <feature-slug> [--base-ref <branch>]
39
- setup-worktree.sh child <repo-name> <feature-slug> <task-id> (deprecated)
40
33
 
41
34
  Arguments:
42
35
  repo-name Short name of the repository (e.g. "ystack")
43
36
  feature-slug Kebab-case feature identifier (e.g. "add-widget")
44
- task-id (child only, ignored for path) legacy parallel-task id
45
37
  --base-ref <b> (parent only) Check out the existing branch <b> into the
46
38
  worktree instead of creating a new feat/<feature> branch.
47
39
 
@@ -51,9 +43,6 @@ Worktree (single contract):
51
43
 
52
44
  Set YCC_WORKTREE_ROOT to override the root. Relative overrides are resolved
53
45
  against the current repository root. Legacy roots are not migrated or touched.
54
-
55
- 'child' mode is deprecated: it echoes the feature worktree path if present; it does
56
- not create separate child worktrees. See worktree-strategy.md.
57
46
  EOF
58
47
  }
59
48
 
@@ -69,12 +58,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
69
58
  # shellcheck source=worktree-paths.sh
70
59
  source "${SCRIPT_DIR}/worktree-paths.sh"
71
60
 
72
- # Replace every '.' with '-' in a task-id string.
73
- normalize_task_id() {
74
- local raw="$1"
75
- echo "${raw//./-}"
76
- }
77
-
78
61
  # Return the branch currently checked out in a worktree path.
79
62
  # Uses `git worktree list --porcelain` output.
80
63
  _worktree_branch() {
@@ -150,43 +133,6 @@ setup_parent() {
150
133
  echo "$parent_path"
151
134
  }
152
135
 
153
- # ---------------------------------------------------------------------------
154
- # Mode: child (deprecated — no separate worktree; echo feature path if exists)
155
- # ---------------------------------------------------------------------------
156
-
157
- setup_child() {
158
- local repo_name="$1"
159
- local feature_slug="$2"
160
- local raw_task_id="$3"
161
-
162
- if [[ -z "$repo_name" || -z "$feature_slug" || -z "$raw_task_id" ]]; then
163
- _error "repo-name, feature-slug, and task-id must not be empty"
164
- usage
165
- exit 1
166
- fi
167
-
168
- local _task_id
169
- _task_id="$(normalize_task_id "$raw_task_id")"
170
-
171
- local repo_root
172
- repo_root="$(ycc_repo_root)"
173
-
174
- local feature_path
175
- feature_path="$(ycc_feature_worktree_path "$repo_root" "$repo_name" "$feature_slug")"
176
-
177
- echo "setup-worktree.sh: DEPRECATED: 'child' does not create a per-task worktree (task-id=${_task_id}). Use a single feature worktree; all agents share: ${feature_path}" >&2
178
-
179
- if [[ -d "$feature_path" ]]; then
180
- if git -C "$feature_path" rev-parse --git-dir >/dev/null 2>&1; then
181
- echo "$feature_path"
182
- return 0
183
- fi
184
- fi
185
-
186
- _error "feature worktree not found at '${feature_path}'. Run: setup-worktree.sh parent ${repo_name} ${feature_slug}"
187
- exit 1
188
- }
189
-
190
136
  parse_parent_args() {
191
137
  local -n out_repo="$1"
192
138
  local -n out_slug="$2"
@@ -249,15 +195,6 @@ run_parent_mode() {
249
195
  setup_parent "$p_repo" "$p_slug" "$p_base_ref"
250
196
  }
251
197
 
252
- run_child_mode() {
253
- if [[ $# -ne 3 ]]; then
254
- _error "'child' mode requires exactly 3 arguments: <repo-name> <feature-slug> <task-id>"
255
- usage
256
- exit 1
257
- fi
258
- setup_child "$1" "$2" "$3"
259
- }
260
-
261
198
  # ---------------------------------------------------------------------------
262
199
  # Entry point
263
200
  # ---------------------------------------------------------------------------
@@ -269,16 +206,12 @@ main() {
269
206
  shift
270
207
  run_parent_mode "$@"
271
208
  ;;
272
- child)
273
- shift
274
- run_child_mode "$@"
275
- ;;
276
209
  --help|-h)
277
210
  usage
278
211
  exit 0
279
212
  ;;
280
213
  *)
281
- _error "first argument must be 'parent' or 'child'"
214
+ _error "first argument must be 'parent'"
282
215
  usage
283
216
  exit 1
284
217
  ;;
@@ -62,7 +62,7 @@ adding it.
62
62
 
63
63
  | Field | Value |
64
64
  | ----------- | -------------------------------------------------------- |
65
- | Path | `.opencode-plugin/skills/_shared/scripts/<kebab-name>.sh` |
65
+ | Path | `.opencode-plugin/shared/scripts/<kebab-name>.sh` |
66
66
  | Sourced via | `{{package-root}}/shared/scripts/<name>.sh` |
67
67
  | Threshold | Only create when two or more distinct skills need it |
68
68
 
@@ -33,7 +33,7 @@ same workflow will be reused repeatedly.
33
33
  creates drift and makes fixes harder to apply consistently.
34
34
 
35
35
  **Do this instead:** If two or more existing skills need the same helper, add it to
36
- `.opencode-plugin/skills/_shared/scripts/` and source it from each skill via
36
+ `.opencode-plugin/shared/scripts/` and source it from each skill via
37
37
  `{{package-root}}/shared/scripts/<name>.sh`. Do not create a new skill
38
38
  just to house shared logic.
39
39
 
@@ -59,15 +59,32 @@ Read `ycc/skills/bundle-release/references/version-policy.md`.
59
59
  Compare the current version (reported by preflight output) against the requested
60
60
  `<new-version>`.
61
61
 
62
- Determine the bump kind (major / minor / patch) by inspecting recent commit history:
62
+ Group the commits since the last tag into feature sets:
63
63
 
64
64
  ```
65
- git log $(git describe --tags --abbrev=0 2>/dev/null || echo HEAD~20)..HEAD --oneline
65
+ .opencode-plugin/shared/scripts/release-feature-sets.sh --format text
66
66
  ```
67
67
 
68
- If the requested bump looks mismatched with the recent history — for example, new
69
- skills were added but a patch bump was requested — surface the concern and ask the user
70
- to confirm before continuing.
68
+ A single `feat` commit does not require a minor; a complete feature set does. When
69
+ feature sets are listed, ask which are complete and user-visible (one multi-select
70
+ question; "none" is valid), then rerun with `--complete <set,...>` to read
71
+ `Required bump`. Several `feat` commits for one feature are one set, and a set still in
72
+ progress or hidden behind an off-by-default switch is not complete. A set whose `feat`
73
+ commits shipped in an earlier patch is not listed; if it is now complete, name it in
74
+ `--complete` anyway (the helper finds it before the range).
75
+
76
+ `Required bump` reads commit markers only, so also apply the Major rules in
77
+ `references/version-policy.md`: a renamed or removed skill, command or agent is a major
78
+ even without a `!` marker. Check with
79
+ `git diff --name-status <last-tag>..HEAD -- ycc/skills ycc/agents` (any `D` or `R` entry
80
+ for a `SKILL.md` or agent file).
81
+
82
+ The floor is the higher of `Required bump` and the Major rules. A requested version below
83
+ it (a patch over a complete set, such as a finished new skill, or a non-major over a
84
+ breaking change or a renamed/removed surface) is refused, not confirmed: stop, name what
85
+ sets the floor, and ask for a version at or above it. A patch over in-progress sets is
86
+ expected; name those sets once and continue. Headless, treat every set as in progress,
87
+ and on a refusal print the concern plus the rerun command.
71
88
 
72
89
  ## Phase 2: Dry-run check
73
90
 
@@ -41,7 +41,15 @@ If pre-flight fails: resolve all failing conditions before proceeding. Do not sk
41
41
  git log $(git describe --tags --abbrev=0)..HEAD --oneline
42
42
  ```
43
43
 
44
- - [ ] Select the semver bump level (major / minor / patch) per `references/version-policy.md`.
44
+ - [ ] Group `feat` commits into feature sets and mark the complete ones:
45
+
46
+ ```
47
+ .opencode-plugin/shared/scripts/release-feature-sets.sh --format text
48
+ .opencode-plugin/shared/scripts/release-feature-sets.sh --complete <set,...> --format text
49
+ ```
50
+
51
+ - [ ] Select the semver bump level (major / minor / patch) at or above `Required bump`,
52
+ per `references/version-policy.md`.
45
53
  - [ ] Record the chosen new version: `<new-version>`
46
54
 
47
55
  ---
@@ -115,7 +115,7 @@ Use standard semver (`MAJOR.MINOR.PATCH`). Apply the first rule that matches:
115
115
  - Change to the `name` field in `plugin.json`
116
116
  - Restructure of how the bundle is loaded or distributed
117
117
 
118
- **Minor** — any of the following:
118
+ **Minor** — a complete feature set that includes any of the following:
119
119
 
120
120
  - New skill, command, or agent added
121
121
  - Additive frontmatter fields on existing surfaces (no removals or renames)
@@ -127,9 +127,16 @@ Use standard semver (`MAJOR.MINOR.PATCH`). Apply the first rule that matches:
127
127
  - Documentation-only change (SKILL.md prose, reference docs, templates)
128
128
  - Template refinement or whitespace/linter-only fix
129
129
 
130
- Tie-breaker: when a change could reasonably justify two bump levels, prefer the more
131
- conservative (higher) bump. When in doubt, bump minor rather than patch, and major
132
- rather than minor.
130
+ These rules apply to **feature sets**, not single commits. Several `feat` commits often
131
+ build one feature; `.opencode-plugin/shared/scripts/release-feature-sets.sh` groups them by
132
+ their `Feature-Set:` footer, else their scope. A set requires a minor only when it is
133
+ complete and user-visible. A set still in progress, or hidden behind an off-by-default
134
+ switch (see "Unfinished work" in `RELEASING.md`), ships in a patch, and its commits are
135
+ listed under the release notes' features as usual.
136
+
137
+ Tie-breaker: Major rules are never downgraded; when a change could be breaking, bump
138
+ major. Between minor and patch, the feature-set answer decides: when the maintainer is
139
+ unsure whether a set is complete, it is in progress and the release is a patch.
133
140
 
134
141
  ## Never-Edit List
135
142
 
@@ -150,7 +150,7 @@ Unless suppressed, run each applier. Each writes to a distinct file so they can
150
150
  {{package-root}}/skills/formatters/scripts/apply-ci.sh --target "$TARGET" --profile-file "$PROFILE_FILE" [--force] [--no-autofix]
151
151
  ```
152
152
 
153
- Pass `--no-autofix` when `NO_AUTOFIX=true` to install only the check workflow. The check workflow runs on every PR and on pushes to the default branch and `release/**`. The autofix workflow runs on same-repo PRs to the default branch (`origin/HEAD`, falling back to `main`), applies `./scripts/style.sh format` + `lint --fix`, and pushes fixes back as `github-actions[bot]`; fork PRs are skipped because `GITHUB_TOKEN` cannot push to them.
153
+ Pass `--no-autofix` when `NO_AUTOFIX=true` to install only the check workflow. The check workflow runs on every PR and on pushes to the default branch and `release/**`. The autofix workflow runs on same-repo PRs to the default branch (`origin/HEAD`, falling back to `main`) as two jobs. The `format` job checks out the PR head without persisted credentials, runs `./scripts/style.sh format` + `lint --fix` with a read-only `GITHUB_TOKEN` and no secrets, and uploads any fixes as a patch artifact. The `push` job never checks out or runs PR code: it validates the patch (in-place text edits to existing files only; anything else, including any path under `.github/` such as `.github/workflows/`, fails the job without pushing), mints a GitHub App installation token with Contents write only (`actions/create-github-app-token`), applies the patch in a fresh repository with hooks disabled, and pushes. It uses an App token because a push made with `GITHUB_TOKEN` leaves every check on the fix commit waiting for approval. It reads the App's client ID from the `AUTOFIX_APP_CLIENT_ID` variable and its private key from the `AUTOFIX_APP_PRIVATE_KEY` secret; without them, or if minting fails, it reports the fixes in a warning and the job summary instead of pushing. Fork PRs are skipped by both jobs because the workflow cannot push to them.
154
154
 
155
155
  4. **Hooks** (run when `HOOKS=true`, OR when the target already has a `lefthook.yml` / `.husky/pre-commit` — i.e., `has_lefthook=true` or `has_husky=true` in the profile):
156
156
 
@@ -177,6 +177,7 @@ Produce a summary with these sections:
177
177
  - `lefthook install` (if `--hooks` + lefthook chosen)
178
178
  - Review `scripts/` bundle in the first commit that adds it
179
179
  - Re-run with `formatters --sync` after upstream bundle changes
180
+ - If `lint-autofix.yml` was written: create a GitHub App with repository permission Contents read and write (no Workflows permission: autofix never pushes changes under `.github/`, so format those locally), install it on the repository, and set the `AUTOFIX_APP_CLIENT_ID` variable and `AUTOFIX_APP_PRIVATE_KEY` secret; until then the workflow reports fixes instead of pushing. Anyone who can write to a repository holding the private key can mint tokens for every repository the App is installed on, so reuse one App only across repositories with the same trusted writers. Organization-level variables and secrets are not available to private repositories on GitHub Free; set them on the repository there
180
181
  - Bypass a single hook run: `git commit --no-verify`
181
182
 
182
183
  ## Important Notes