@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
@@ -0,0 +1,253 @@
1
+ #!/usr/bin/env python3
2
+ """Build an mcp-parity capability inventory from an OpenAPI 3.x document.
3
+
4
+ Usage: openapi_inventory.py SPEC [--exclude REGEX ...] [--no-default-excludes]
5
+
6
+ SPEC is JSON, or YAML when PyYAML is installed. Prints inventory JSON on stdout:
7
+ ``{"schema": 1, "source": SPEC, "capabilities": [...], "excluded": [...]}``.
8
+ Operations are deterministic and sorted, so repeated runs on an unchanged spec
9
+ produce identical fingerprints. Exit 0 on success, 1 on invalid input.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import argparse
15
+ import json
16
+ import re
17
+ import sys
18
+ from pathlib import Path
19
+ from typing import Any
20
+
21
+ METHODS = ("get", "put", "post", "delete", "patch", "head", "options")
22
+ DEFAULT_EXCLUDES = (
23
+ r"^/(api/)?(v\d+/)?(health|healthz|livez|readyz?|ping|metrics|status)/?$",
24
+ r"/(oauth2?|\.well-known)(/|$)",
25
+ r"/auth/(login|logout|callback|refresh|token)(/|$)",
26
+ r"/webhooks?(/|$)",
27
+ )
28
+ ID_CLEAN_RE = re.compile(r"[^a-z0-9]+")
29
+ CAMEL_RE = re.compile(r"(?<=[a-z0-9])(?=[A-Z])")
30
+ LEADING_VERBS = frozenset(
31
+ "list get create update delete remove add set search patch replace upsert send run start stop".split()
32
+ )
33
+
34
+
35
+ class InputError(ValueError):
36
+ """Raised for unreadable or non-OpenAPI input."""
37
+
38
+
39
+ def load_spec(path: Path) -> dict[str, Any]:
40
+ """Load an OpenAPI document from JSON or YAML."""
41
+ if not path.is_file():
42
+ raise InputError(f"spec not found: {path}")
43
+ text = path.read_text(encoding="utf-8")
44
+ data: Any
45
+ if path.suffix == ".json":
46
+ try:
47
+ data = json.loads(text)
48
+ except json.JSONDecodeError as exc:
49
+ raise InputError(f"{path} is not valid JSON: {exc}") from exc
50
+ else:
51
+ try:
52
+ import yaml
53
+ except ImportError as exc:
54
+ raise InputError("PyYAML is required for YAML specs (python3 -m pip install --user pyyaml)") from exc
55
+ try:
56
+ data = yaml.safe_load(text)
57
+ except yaml.YAMLError as exc:
58
+ raise InputError(f"{path} is not valid YAML: {exc}") from exc
59
+ if not isinstance(data, dict) or not isinstance(data.get("paths"), dict):
60
+ raise InputError(f"{path} has no OpenAPI 'paths' object")
61
+ if not str(data.get("openapi", "")).startswith("3"):
62
+ raise InputError(f"{path} is not OpenAPI 3.x (swagger 2 is unsupported; convert it first)")
63
+ return data
64
+
65
+
66
+ def _ref_name(ref: str) -> str:
67
+ return ref.rsplit("/", 1)[-1]
68
+
69
+
70
+ def type_name(schema: Any, depth: int = 0) -> str:
71
+ """Return a short, stable type spelling for a schema."""
72
+ if not isinstance(schema, dict):
73
+ return "any"
74
+ if "$ref" in schema:
75
+ return _ref_name(str(schema["$ref"]))
76
+ for combo in ("oneOf", "anyOf", "allOf"):
77
+ if isinstance(schema.get(combo), list) and depth < 3:
78
+ sep = " & " if combo == "allOf" else " | "
79
+ return sep.join(type_name(s, depth + 1) for s in schema[combo])
80
+ kind = schema.get("type")
81
+ if isinstance(kind, list):
82
+ kind = "|".join(str(k) for k in kind)
83
+ if kind == "array":
84
+ return f"{type_name(schema.get('items'), depth + 1)}[]"
85
+ if kind == "object" or (kind is None and "properties" in schema):
86
+ return "object"
87
+ if "enum" in schema and isinstance(schema["enum"], list):
88
+ return "enum(" + ",".join(str(v) for v in schema["enum"]) + ")"
89
+ return str(kind or "any")
90
+
91
+
92
+ def _resolve(spec: dict[str, Any], obj: Any) -> Any:
93
+ """Resolve one local $ref (parameters, requestBodies, responses)."""
94
+ if isinstance(obj, dict) and isinstance(obj.get("$ref"), str) and obj["$ref"].startswith("#/"):
95
+ node: Any = spec
96
+ for part in obj["$ref"][2:].split("/"):
97
+ node = node.get(part) if isinstance(node, dict) else None
98
+ return node if node is not None else obj
99
+ return obj
100
+
101
+
102
+ def make_id(method: str, path: str, op: dict[str, Any]) -> str:
103
+ """Derive a durable capability id: operationId when present, else area.verb from the path."""
104
+ op_id = op.get("operationId")
105
+ if isinstance(op_id, str) and op_id.strip():
106
+ words = [w for w in ID_CLEAN_RE.sub(".", CAMEL_RE.sub(".", op_id.strip()).lower()).split(".") if w]
107
+ if len(words) > 1 and words[0] in LEADING_VERBS:
108
+ words = [*words[1:], words[0]] # listActivity -> activity.list
109
+ return ".".join(words)[:128] or "op"
110
+ segments = [s for s in path.strip("/").split("/") if s and not s.startswith("{")]
111
+ segments = [s for s in segments if not re.fullmatch(r"(api|v\d+)", s)]
112
+ by_id = path.rstrip("/").endswith("}")
113
+ verb = {
114
+ "get": "get" if by_id else "list",
115
+ "post": "create",
116
+ "put": "replace",
117
+ "patch": "update",
118
+ "delete": "delete",
119
+ }.get(method, method)
120
+ base = ".".join(ID_CLEAN_RE.sub("-", s.lower()).strip("-") for s in segments) or "root"
121
+ return f"{base}.{verb}"[:128]
122
+
123
+
124
+ def _inputs(spec: dict[str, Any], path_item: dict[str, Any], op: dict[str, Any]) -> dict[str, Any]:
125
+ params: dict[tuple[str, str], Any] = {}
126
+ for raw in [*path_item.get("parameters", []), *op.get("parameters", [])]:
127
+ param = _resolve(spec, raw)
128
+ if isinstance(param, dict) and isinstance(param.get("name"), str):
129
+ params[(str(param.get("in", "query")), param["name"])] = param
130
+ inputs: dict[str, dict[str, str]] = {}
131
+ for (where, name), param in sorted(params.items()):
132
+ if where == "header" or where == "cookie":
133
+ continue
134
+ optional = "" if param.get("required") or where == "path" else "?"
135
+ inputs.setdefault(where, {})[name] = type_name(param.get("schema")) + optional
136
+ body = _resolve(spec, op.get("requestBody"))
137
+ if isinstance(body, dict) and isinstance(body.get("content"), dict):
138
+ media: Any = body["content"].get("application/json") or next(iter(body["content"].values()), {})
139
+ optional = "" if body.get("required") else "?"
140
+ inputs["body"] = {"type": type_name(media.get("schema") if isinstance(media, dict) else None) + optional}
141
+ return inputs
142
+
143
+
144
+ def _outputs(spec: dict[str, Any], op: dict[str, Any]) -> str:
145
+ responses = op.get("responses")
146
+ if not isinstance(responses, dict):
147
+ return ""
148
+ for code in sorted(str(c) for c in responses):
149
+ if not code.startswith("2"):
150
+ continue
151
+ resp = _resolve(spec, responses.get(code) or responses.get(int(code) if code.isdigit() else code))
152
+ content = resp.get("content") if isinstance(resp, dict) else None
153
+ if not isinstance(content, dict) or not content:
154
+ return "none" if code == "204" else ""
155
+ media = content.get("application/json") or next(iter(content.values()))
156
+ return type_name(media.get("schema") if isinstance(media, dict) else None)
157
+ return ""
158
+
159
+
160
+ def auth_schemes(spec: dict[str, Any], op: dict[str, Any]) -> list[str] | None:
161
+ """Security scheme names for an operation; None when the spec declares none."""
162
+ security = op.get("security", spec.get("security"))
163
+ if not isinstance(security, list):
164
+ return None
165
+ return sorted({name for req in security if isinstance(req, dict) for name in req})
166
+
167
+
168
+ def auth_class(schemes: list[str] | None) -> str:
169
+ """Collapse scheme names to the inventory auth classes."""
170
+ if schemes is None:
171
+ return "unspecified"
172
+ if not schemes:
173
+ return "public"
174
+ if any("admin" in name.lower() for name in schemes):
175
+ return "admin"
176
+ return "user"
177
+
178
+
179
+ def build_inventory(spec: dict[str, Any], excludes: list[str], source: str = "") -> dict[str, Any]:
180
+ """Return inventory JSON for every non-excluded, non-deprecated operation."""
181
+ patterns = [re.compile(p) for p in excludes]
182
+ caps: list[dict[str, Any]] = []
183
+ excluded: list[dict[str, str]] = []
184
+ seen: dict[str, int] = {}
185
+ for path in sorted(spec["paths"]):
186
+ path_item = spec["paths"][path]
187
+ if not isinstance(path_item, dict):
188
+ continue
189
+ for method in METHODS:
190
+ op = path_item.get(method)
191
+ if not isinstance(op, dict):
192
+ continue
193
+ operation = f"{method.upper()} {path}"
194
+ if method in ("head", "options"):
195
+ excluded.append({"operation": operation, "reason": "protocol method"})
196
+ continue
197
+ if op.get("deprecated") is True:
198
+ excluded.append({"operation": operation, "reason": "deprecated"})
199
+ continue
200
+ hit = next((p.pattern for p in patterns if p.search(path)), None)
201
+ if hit:
202
+ excluded.append({"operation": operation, "reason": f"matches {hit}"})
203
+ continue
204
+ cid = make_id(method, path, op)
205
+ seen[cid] = seen.get(cid, 0) + 1
206
+ if seen[cid] > 1:
207
+ cid = f"{cid}.{seen[cid]}"
208
+ tags = op.get("tags") if isinstance(op.get("tags"), list) else []
209
+ segments = [s for s in path.strip("/").split("/") if s and not s.startswith("{")]
210
+ area = str(tags[0]) if tags else (segments[-1] if segments else "root")
211
+ caps.append(
212
+ {
213
+ "id": cid,
214
+ "kind": "tool",
215
+ "operation": operation,
216
+ "summary": str(op.get("summary") or op.get("description") or "").strip().split("\n")[0][:200],
217
+ "area": ID_CLEAN_RE.sub("-", area.lower()).strip("-") or "root",
218
+ "inputs": _inputs(spec, path_item, op),
219
+ "outputs": _outputs(spec, op),
220
+ "mutating": method != "get",
221
+ "destructive": method == "delete",
222
+ "auth": auth_class(auth_schemes(spec, op)),
223
+ "authSchemes": auth_schemes(spec, op) or [],
224
+ "surface": "rest",
225
+ "source": source,
226
+ }
227
+ )
228
+ return {"schema": 1, "source": source, "capabilities": caps, "excluded": excluded}
229
+
230
+
231
+ def main(argv: list[str] | None = None) -> int:
232
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
233
+ parser.add_argument("spec", help="OpenAPI 3.x document (.json, or .yaml/.yml with PyYAML)")
234
+ parser.add_argument("--exclude", action="append", default=[], help="extra path regex to exclude (repeatable)")
235
+ parser.add_argument("--no-default-excludes", action="store_true", help="keep health/auth/webhook paths")
236
+ args = parser.parse_args(argv)
237
+ try:
238
+ excludes = [*([] if args.no_default_excludes else DEFAULT_EXCLUDES), *args.exclude]
239
+ for pattern in excludes:
240
+ try:
241
+ re.compile(pattern)
242
+ except re.error as exc:
243
+ raise InputError(f"invalid --exclude regex {pattern!r}: {exc}") from exc
244
+ spec = load_spec(Path(args.spec))
245
+ print(json.dumps(build_inventory(spec, excludes, args.spec), indent=2))
246
+ return 0
247
+ except InputError as exc:
248
+ print(f"openapi_inventory: {exc}", file=sys.stderr)
249
+ return 1
250
+
251
+
252
+ if __name__ == "__main__":
253
+ sys.exit(main())
@@ -0,0 +1,38 @@
1
+ # Capability issue body
2
+
3
+ Fill `{…}`. Drop a section only when it has nothing true to say. Keep the Agent notes
4
+ lines exactly: lookup and rebuild parse them.
5
+
6
+ ```markdown
7
+ Expose `{operation}` as an MCP {kind} so agents can {summary, lowercase verb phrase}.
8
+
9
+ ## Contract
10
+
11
+ - Operation: `{operation}` ({surface})
12
+ - MCP name: `{suggested tool/resource name, snake_case, e.g. users_list}`
13
+ - Inputs: {normalized inputs, one bullet per parameter with type and optional marker}
14
+ - Output: {outputs}
15
+ - Auth: {auth} — {how the MCP caller's identity maps to the app's check}
16
+ - Side effects: {none | mutating | destructive: what is changed or lost}
17
+
18
+ ## Done when
19
+
20
+ - [ ] The {kind} calls the same code path as `{operation}`; no duplicated business logic.
21
+ - [ ] Input schema matches the contract above, with descriptions agents can follow.
22
+ - [ ] Annotations set: read-only `{true|false}`, destructive `{true|false}`, idempotent `{true|false}`.
23
+ - [ ] App errors and pagination map to MCP results per the foundation conventions.
24
+ - [ ] A contract test covers success, validation error, and unauthorized access.
25
+ - [ ] The parity check passes with this capability mapped.
26
+
27
+ +++ Agent notes
28
+
29
+ Issue-Kind: {capability | update | removal}
30
+ Capability-ID: {id}
31
+ Fingerprint: {fingerprint}
32
+ Source: {source file:line}
33
+ Area: {area}
34
+ Related existing MCP code: {path or none}
35
+ Depends on: foundation issues for scaffold, auth, errors-pagination.
36
+
37
+ +++
38
+ ```
@@ -0,0 +1,35 @@
1
+ # Foundation issue body
2
+
3
+ Fill `{…}` from the architecture brief (researcher 2) and the MCP practice brief
4
+ (researcher 3). Cite sources inline. Keep the Agent notes lines exactly.
5
+
6
+ ```markdown
7
+ {One or two sentences: what this enables for every capability issue.}
8
+
9
+ ## Context
10
+
11
+ - Repository: {language, framework, runtime}
12
+ - Existing MCP code: {paths, or "none"}
13
+ - MCP spec revision: {revision} ({source link})
14
+ - SDK: {official SDK and version} ({source link})
15
+
16
+ ## Approach
17
+
18
+ {Concrete recommendation for this repo: package location, transport, auth reuse,
19
+ error and pagination mapping, or the parity check design. Name files and commands.}
20
+
21
+ ## Done when
22
+
23
+ - [ ] {verifiable outcome 1}
24
+ - [ ] {verifiable outcome 2}
25
+ - [ ] {CI or test command that proves it}
26
+
27
+ +++ Agent notes
28
+
29
+ Issue-Kind: foundation
30
+ Foundation-Key: {key}
31
+ Evidence: {file:line list from the research}
32
+ Open questions: {list, or none}
33
+
34
+ +++
35
+ ```
@@ -40,7 +40,8 @@ The block below is read by tools; the table is generated from it. Change both wi
40
40
  5. **No new long-lived branches.** Large work lands on `{{TRUNK}}` in small PRs. See
41
41
  [Unfinished work](#unfinished-work).
42
42
  6. **`{{TRUNK}}` is always releasable.** CI green, and nothing half-built reachable by users.
43
- 7. **Only maintainers cut releases**, following [Releasing](#releasing). Agents never tag.
43
+ 7. **A maintainer approves each release once** ("ship x.y.z to prod?"), following
44
+ [Releasing](#releasing). After that approval, agents may tag, publish and cut the release.
44
45
 
45
46
  ## Where does my change go?
46
47
 
@@ -43,7 +43,8 @@ Parse `$ARGUMENTS`:
43
43
 
44
44
  - **version** (optional first positional) — target semver (`1.4.0`, `v1.4.0`, or a
45
45
  pre-release like `1.4.0-rc.1`). If omitted, propose one from commit history
46
- (conventional-commit bump) and ask for confirmation before continuing.
46
+ (feature-set bump: a `feat` commit requires a minor only once its feature set is
47
+ complete) and ask for confirmation before continuing.
47
48
  - **--arch=\<list\>** — comma-separated target architectures (e.g. `amd64,arm64`).
48
49
  Overrides language defaults.
49
50
  - **--os=\<list\>** — comma-separated target operating systems
@@ -246,6 +247,9 @@ If a file cannot be read, say so.
246
247
  Scripts (invoke as `{{package-root}}/skills/releaser/scripts/<name>`):
247
248
 
248
249
  - `scripts/detect-project.sh` — Run when: Phase 1 detection (emits JSON).
250
+ - `{{package-root}}/shared/scripts/release-feature-sets.sh` — Run when:
251
+ Phase 2 version proposal or sanity check (groups `feat` commits into feature sets
252
+ and reports `required_bump`).
249
253
  - `scripts/check-release-branch.sh` — Run when: Phase 2 branch check after the
250
254
  version is confirmed.
251
255
  - `scripts/draft-changelog.sh` — Run when: Phase 4 notes drafting.
@@ -77,25 +77,44 @@ matrix.
77
77
 
78
78
  ## Phase 2: Propose version and compute bump
79
79
 
80
- If the user did NOT supply a version:
81
-
82
- 1. Collect commits since `latest_tag` (or the last 50 if no tag exists):
83
- `git log <latest_tag>..HEAD --format="%s"`.
84
- 2. Classify each commit against conventional-commit types. Determine the bump:
85
- - Any `!` marker, `BREAKING CHANGE` footer, or `major:` → major.
86
- - Any `feat:` → minor.
87
- - Otherwise → patch.
88
- 3. Propose the next semver and ASK for confirmation before writing anything.
89
-
90
- If the user DID supply a version, sanity-check the bump magnitude against commit
91
- history. Surface a concern if they are mismatched (e.g. `feat:` commits but a patch
92
- bump) and require explicit confirmation before continuing.
80
+ Steps 1–2 run whether or not the user supplied a version; they produce
81
+ `required_bump` (printed as `Required bump:` by `--format text`).
82
+
83
+ 1. Group the commits since `latest_tag` into feature sets:
84
+ `{{package-root}}/shared/scripts/release-feature-sets.sh --format text`
85
+ (`--from <ref>` when `latest_tag` is not the right range start; with no tag it covers
86
+ all history). `feat` commits are grouped by their `Feature-Set:` footer, else their
87
+ scope, else `unscoped`; merge commits are skipped.
88
+ 2. If any feature sets are listed, ASK which ones are complete and user-visible (one
89
+ multi-select question listing each set with its commit count; "none" is a valid
90
+ answer). Several `feat` commits for one feature are one set, and a set that is still
91
+ in progress, or hidden behind an off-by-default switch, is not complete. Also ask
92
+ whether a set whose `feat` commits shipped in an earlier patch is now complete: it is
93
+ not listed, but naming it in `--complete` is accepted (the helper finds it before
94
+ the range). Rerun the helper with `--complete <set,...>` (or `--complete all`) to
95
+ get `required_bump`:
96
+ - Any `!` marker or `BREAKING CHANGE` footer → major.
97
+ - Any complete feature set → minor.
98
+ - Otherwise → patch. `feat` commits from in-progress sets ship in a patch.
99
+ 3. If the user did NOT supply a version, propose the next semver from `required_bump`
100
+ and ASK for confirmation before writing anything. The bump is a floor; the
101
+ maintainer may choose a higher one.
102
+
103
+ If the user DID supply a version, check it against `required_bump`. A version below it
104
+ (a patch over a complete feature set, or a minor/patch over a breaking change) is
105
+ refused, not confirmed: stop, say which set or breaking commit sets the floor, and ask
106
+ for a version at or above it (headless: stop and print the rerun command). A patch over
107
+ `feat` commits whose sets are all in progress is not a mismatch; note the in-progress
108
+ sets once and continue. The `release/X.Y` rules below take precedence on that branch.
109
+
110
+ Headless (no question tool or chat turn): treat every set as in progress, report the
111
+ sets in the proposal, and require the version as an argument as usual.
93
112
 
94
113
  The release model (from `release-state.sh get`) decides how commit types map to the bump:
95
114
 
96
115
  - **No RELEASING.md, or trunk-only:** the rules above apply as written. Every release is
97
- cut from the trunk, so `feat:` commits mean the next release is a minor; a patch
98
- requested over `feat:` commits gets the mismatch concern.
116
+ cut from the trunk; a complete feature set makes the next release a minor, and a
117
+ patch requested over a complete set is refused.
99
118
  - **release-branches, on `release/X.Y`:** the branch bounds the bump to the next
100
119
  `X.Y.Z` patch. Everything on the branch is a deliberate backport, so a `feat:`
101
120
  cherry-pick is expected and does NOT raise the mismatch concern or make it a minor.
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env bash
2
- # merge-children.sh — DEPRECATED compatibility shim (issue #80, single worktree
3
- # contract). Does NOT merge branches, remove worktrees, or delete branches.
4
- #
5
- # The historical behavior (fan-in merge from per-task child worktrees) was
6
- # unsafe and is removed. Callers that still invoke this script get an explicit
7
- # deprecation message on stderr, confirmation that the feature worktree exists
8
- # (when it does), and exit 0 so orchestration does not break before skills are
9
- # updated.
10
- #
11
- # Usage: merge-children.sh <repo-name> <feature-slug> <task-id>[,<task-id>,...]
12
- # (task-ids are accepted for argument compatibility; they are not used)
13
- #
14
- # Exit codes:
15
- # 0 always (shim: no fan-in, no errors from missing children)
16
-
17
- set -euo pipefail
18
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
-
20
- usage() {
21
- cat >&2 <<'EOF'
22
- Usage: merge-children.sh <repo-name> <feature-slug> <task-id>[,<task-id>,...]
23
-
24
- DEPRECATED: This script is a no-op. ycc uses one feature worktree per run; there
25
- is no per-task child merge. Remove calls to merge-children.sh in favor of working
26
- entirely in the path printed by: setup-worktree.sh parent <repo> <feature-slug>
27
- EOF
28
- printf '\nSee: %s\n' "${SCRIPT_DIR}/../references/worktree-strategy.md" >&2
29
- exit 1
30
- }
31
-
32
- feature_worktree_status() {
33
- local parent_path="$1"
34
- if [[ -d "${parent_path}" ]] && git -C "${parent_path}" rev-parse --git-dir >/dev/null 2>&1; then
35
- echo "OK: feature worktree present at ${parent_path}" >&2
36
- echo "STATUS:feature_worktree=present path=${parent_path}" >&2
37
- return 0
38
- fi
39
-
40
- echo "merge-children.sh: NOTICE: feature worktree not found or not a git checkout: ${parent_path}" >&2
41
- echo "STATUS:feature_worktree=missing path=${parent_path}" >&2
42
- return 1
43
- }
44
-
45
- # shellcheck source=worktree-paths.sh
46
- source "${SCRIPT_DIR}/worktree-paths.sh"
47
-
48
- main() {
49
- if [[ $# -ne 3 ]]; then
50
- echo "ERROR: expected 3 arguments, got $#" >&2
51
- usage
52
- fi
53
-
54
- local repo_name="$1"
55
- local feature_slug="$2"
56
- local _raw_task_ids="$3"
57
-
58
- if [[ -z "${repo_name}" || -z "${feature_slug}" || -z "${_raw_task_ids}" ]]; then
59
- echo "ERROR: repo-name, feature-slug, and task-id list must be non-empty" >&2
60
- usage
61
- fi
62
-
63
- local repo_root
64
- repo_root="$(ycc_repo_root)"
65
-
66
- local parent_path
67
- parent_path="$(ycc_feature_worktree_path "$repo_root" "$repo_name" "$feature_slug")"
68
-
69
- echo "merge-children.sh: DEPRECATED: no-op (single worktree contract). Task IDs ignored: ${_raw_task_ids}" >&2
70
- echo "merge-children.sh: Do not rely on child worktrees or fan-in merge. Use only: ${parent_path}" >&2
71
-
72
- if ! feature_worktree_status "${parent_path}"; then
73
- if [[ "${YCC_MERGE_CHILDREN_REQUIRE_FEATURE_WORKTREE:-0}" == "1" ]]; then
74
- echo "merge-children.sh: strict mode enabled; failing because feature worktree is unavailable" >&2
75
- exit 2
76
- fi
77
- fi
78
-
79
- exit 0
80
- }
81
-
82
- main "$@"
@@ -1,34 +0,0 @@
1
- # {{PROJECT_NAME}} Documentation
2
-
3
- Welcome to the {{PROJECT_NAME}} documentation.
4
-
5
- ## Quick Links
6
-
7
- {{#if HAS_ARCHITECTURE}}
8
-
9
- - [Architecture Overview](architecture/overview.md)
10
- {{/if}}
11
- {{#if HAS_API}}
12
- - [API Reference](api/README.md)
13
- {{/if}}
14
- {{#if HAS_FEATURES}}
15
- - [Feature Guides](features/README.md)
16
- {{/if}}
17
- {{#if HAS_DEVELOPMENT}}
18
- - [Developer Guide](development/README.md)
19
- {{/if}}
20
-
21
- ## Documentation Map
22
-
23
- {{NAVIGATION_TREE}}
24
-
25
- ## Recently Updated
26
-
27
- {{#each RECENT_FILES}}
28
-
29
- - [{{this.title}}]({{this.path}}) - _{{this.date}}_
30
- {{/each}}
31
-
32
- ---
33
-
34
- _Last updated: {{GENERATED_DATE}}_