@yandy-r/ycc-opencode 6.1.1 → 6.2.1

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 (126) hide show
  1. package/README.md +7 -3
  2. package/agents/code-researcher.md +3 -3
  3. package/agents/feature-researcher.md +1 -1
  4. package/agents/implementor.md +4 -4
  5. package/agents/pr-comment-fixer.md +1 -1
  6. package/agents/release-fix-applier.md +1 -1
  7. package/agents/review-fixer.md +1 -1
  8. package/index.js +146 -95
  9. package/package.json +1 -1
  10. package/registration.json +0 -4
  11. package/shared/references/artifact-store.md +613 -0
  12. package/shared/references/branch-prep.md +2 -0
  13. package/shared/references/forge-detection.md +3 -2
  14. package/shared/references/review-artifact-format.md +13 -6
  15. package/shared/references/review-checklist.md +3 -2
  16. package/shared/references/review-dispatch.md +15 -10
  17. package/shared/references/target-capability-matrix.md +140 -32
  18. package/shared/references/visual-mode.md +19 -13
  19. package/shared/references/worktree-strategy.md +12 -8
  20. package/shared/scripts/artifact-body.sh +71 -0
  21. package/shared/scripts/artifact-store-pointer.sh +245 -0
  22. package/shared/scripts/ci-monitor.sh +9 -4
  23. package/shared/scripts/collect-linear-keys.sh +77 -0
  24. package/shared/scripts/lib/ci-classify.sh +13 -10
  25. package/shared/scripts/lib/forge.sh +13 -4
  26. package/shared/scripts/prepare-feature-branch.sh +118 -10
  27. package/shared/scripts/release-ci-monitor.sh +2 -2
  28. package/shared/scripts/report-bundle-drift.sh +1 -1
  29. package/shared/scripts/resolve-artifact-store.sh +636 -0
  30. package/shared/scripts/validate-file-paths.sh +11 -4
  31. package/skills/blueprint/SKILL.md +48 -13
  32. package/skills/bundle-release/scripts/draft-notes.sh +1 -1
  33. package/skills/bundle-release/scripts/release_versions.py +9 -1
  34. package/skills/clean/SKILL.md +1 -1
  35. package/skills/clean/scripts/detect-project-type.sh +2 -2
  36. package/skills/clean/scripts/generate-report.sh +34 -5
  37. package/skills/clean/scripts/validate-safety.sh +9 -6
  38. package/skills/code-report/SKILL.md +26 -14
  39. package/skills/code-report/scripts/check-prerequisites.sh +72 -12
  40. package/skills/code-report/templates/report-structure.md +1 -1
  41. package/skills/code-review/SKILL.md +68 -17
  42. package/skills/code-review/references/pr-procedure.md +28 -15
  43. package/skills/compatibility-audit/SKILL.md +10 -5
  44. package/skills/compatibility-audit/references/reading-the-report.md +4 -1
  45. package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +64 -7
  46. package/skills/compatibility-audit/scripts/audit-target-features.sh +13 -10
  47. package/skills/deep-research/SKILL.md +28 -5
  48. package/skills/deep-research/references/completion-summary-template.md +3 -2
  49. package/skills/deep-research/scripts/validate-research.sh +8 -2
  50. package/skills/feature-research/SKILL.md +48 -25
  51. package/skills/feature-research/scripts/validate-research.sh +51 -12
  52. package/skills/feature-research/scripts/validate-spec.sh +53 -22
  53. package/skills/feature-research/templates/research-agents.md +15 -14
  54. package/skills/feature-research/templates/spec-structure.md +5 -0
  55. package/skills/formatters/scripts/apply-aliases.sh +3 -1
  56. package/skills/formatters/scripts/apply-ci.sh +3 -1
  57. package/skills/git-workflow/SKILL.md +2 -1
  58. package/skills/git-workflow/references/pr-creation.md +10 -0
  59. package/skills/git-workflow/scripts/analyze-changes.sh +21 -11
  60. package/skills/git-workflow/scripts/create-pr.sh +51 -6
  61. package/skills/git-workflow/scripts/validate-commit.sh +26 -14
  62. package/skills/hooks-workflow/scripts/verify-hooks.sh +1 -1
  63. package/skills/implement-plan/SKILL.md +35 -16
  64. package/skills/implement-plan/references/agent-task-prompt.md +8 -5
  65. package/skills/implement-plan/references/linear-sync.md +20 -0
  66. package/skills/implement-plan/references/output-formats.md +17 -2
  67. package/skills/implement-plan/references/plan-inputs.md +23 -4
  68. package/skills/implement-plan/scripts/check-prerequisites.sh +95 -49
  69. package/skills/implement-plan/scripts/parse-dependencies.sh +10 -10
  70. package/skills/init/SKILL.md +77 -42
  71. package/skills/init/references/flag-reference.md +41 -17
  72. package/skills/init/references/project-profile-heuristics.md +3 -0
  73. package/skills/init/references/template-library.md +15 -5
  74. package/skills/init/scripts/profile-project.sh +26 -0
  75. package/skills/init/scripts/render-template.py +2 -2
  76. package/skills/init/templates/AGENTS.md.tmpl +6 -0
  77. package/skills/init/templates/git/gitignore.tmpl +5 -0
  78. package/skills/orchestrate/SKILL.md +17 -2
  79. package/skills/parallel-plan/SKILL.md +14 -8
  80. package/skills/plan/SKILL.md +18 -2
  81. package/skills/plan/references/planning-tracks.md +1 -1
  82. package/skills/plan-workflow/SKILL.md +67 -32
  83. package/skills/plan-workflow/references/checkpoint-messages.md +23 -14
  84. package/skills/plan-workflow/references/plan-structure.md +1 -1
  85. package/skills/plan-workflow/references/planning-agents.md +11 -9
  86. package/skills/plan-workflow/references/research-agents-optimized.md +12 -10
  87. package/skills/plan-workflow/references/research-agents.md +11 -10
  88. package/skills/plan-workflow/scripts/check-prerequisites.sh +50 -11
  89. package/skills/plan-workflow/scripts/check-state.sh +53 -9
  90. package/skills/plan-workflow/scripts/persist-or-fail.sh +21 -7
  91. package/skills/plan-workflow/scripts/validate-analysis-artifacts.sh +28 -14
  92. package/skills/plan-workflow/scripts/validate-research-artifacts.sh +35 -10
  93. package/skills/plan-workflow/scripts/validate-shared.sh +56 -15
  94. package/skills/plan-workflow/scripts/validate-workflow-plan.sh +48 -17
  95. package/skills/pr-autofix/SKILL.md +19 -4
  96. package/skills/pr-autofix/references/output-templates.md +3 -2
  97. package/skills/pr-autofix/scripts/fetch-pr-comments.sh +1 -2
  98. package/skills/pr-autofix/scripts/post-summary.sh +1 -2
  99. package/skills/pr-autofix/scripts/resolve-thread.sh +3 -4
  100. package/skills/prp-implement/SKILL.md +31 -16
  101. package/skills/prp-implement/references/agent-task-prompt.md +5 -2
  102. package/skills/prp-implement/references/detection.md +4 -1
  103. package/skills/prp-implement/references/linear-sync.md +25 -0
  104. package/skills/prp-implement/references/report-output.md +15 -2
  105. package/skills/prp-plan/SKILL.md +62 -30
  106. package/skills/prp-plan/references/enhanced-researchers.md +8 -9
  107. package/skills/prp-plan/scripts/validate-prp-plan.sh +42 -18
  108. package/skills/prp-pr/SKILL.md +14 -1
  109. package/skills/prp-prd/SKILL.md +21 -9
  110. package/skills/prp-spec/SKILL.md +30 -20
  111. package/skills/quick-fix/SKILL.md +6 -4
  112. package/skills/quick-review/SKILL.md +62 -25
  113. package/skills/release-model/scripts/collect-signals.sh +9 -3
  114. package/skills/releaser/scripts/publish-release.sh +6 -3
  115. package/skills/research-to-issues/SKILL.md +33 -14
  116. package/skills/research-to-issues/scripts/validate-prerequisites.sh +45 -23
  117. package/skills/research-to-issues/templates/task-issue.md +4 -0
  118. package/skills/research-to-issues/templates/tracking-issue.md +3 -0
  119. package/skills/review-fix/SKILL.md +96 -14
  120. package/skills/review-fix/references/fix-report.md +10 -10
  121. package/skills/review-fix/references/plan.md +5 -2
  122. package/skills/shared-context/SKILL.md +14 -11
  123. package/skills/visual-plan/SKILL.md +26 -8
  124. package/skills/visual-recap/SKILL.md +1 -1
  125. package/skills/write-docs/scripts/audit-documentation.sh +44 -10
  126. package/skills/write-docs/scripts/generate-doc-index.sh +10 -3
@@ -12,22 +12,24 @@ Detailed reference for every flag accepted by `init`. See also `SKILL.md` for th
12
12
 
13
13
  ## Flag Matrix
14
14
 
15
- | Flag | Default | Affects phases | Writes to | Example |
16
- | --------------------------- | ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
17
- | `--dry-run` | off | 5 (halt) | nothing | `init --dry-run` |
18
- | `--docs-only` | off | 2, 4 (skip) | `AGENTS.md`, optional `CLAUDE.md` | `init --docs-only` |
19
- | `--templates` | off | 3 (extend) | `.github/ISSUE_TEMPLATE/`, `.github/pull_request_template.md`, `.github/labels.md`, `.github/copilot-instructions.md`, `.github/workflows/pr-title.yml`, `.github/workflows/pr-title-autofix.yml` | `init --templates` |
20
- | `--git` | off | 3 (extend) | `.gitignore`, `.gitmessage`, `commitlint.config.cjs` (JS/TS only), `lefthook.yml`, `scripts/install-lefthook.sh`, `docs/lefthook-usage.md` | `init --git` |
21
- | `--vendor-neutral` | off | 3 (extend) | `.ai/rules/project.md` (pointer to `AGENTS.md`) | `init --vendor-neutral` |
22
- | `--formatters` | off | 6.5 (delegate) | (delegates to `formatters` — see its flag matrix) | `init --formatters` |
23
- | `--release-model[=<model>]` | off (offer) | 5.5 (delegate) | `RELEASING.md` (via `release-model`) | `init --release-model=trunk-only` |
24
- | `--no-release-model` | off | 5.5 (skip) | nothing | `init --no-release-model` |
25
- | `--migrate-rules` | off | 5.7 (migrate) | `AGENTS.md` (moved content), `CLAUDE.md` (pointer) — preview only with `--dry-run` | `init --migrate-rules --dry-run` |
26
- | `--allow-non-git` | off | 5.7 | timestamped backups of the rules files before migrating outside git | `init --migrate-rules --allow-non-git` |
27
- | `--no-claude-md` | off | 3 | skips the `@AGENTS.md` CLAUDE.md shim (needs Claude Code 2.1.277+) | `init --no-claude-md` |
28
- | `--update` | off | 6 (merge) | existing targets only | `init --update` |
29
- | `--force` | off | 6 (overwrite) | all target files | `init --force` |
30
- | `--profile=<name>` | auto-detect | 1 (skip) | (drives template variables) | `init --profile=rust` |
15
+ | Flag | Default | Affects phases | Writes to | Example |
16
+ | ---------------------------- | ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
17
+ | `--dry-run` | off | 5 (halt) | nothing | `init --dry-run` |
18
+ | `--docs-only` | off | 2, 4 (skip) | `AGENTS.md`, optional `CLAUDE.md` | `init --docs-only` |
19
+ | `--templates` | off | 3 (extend) | `.github/ISSUE_TEMPLATE/`, `.github/pull_request_template.md`, `.github/labels.md`, `.github/copilot-instructions.md`, `.github/workflows/pr-title.yml`, `.github/workflows/pr-title-autofix.yml` | `init --templates` |
20
+ | `--git` | off | 3 (extend) | `.gitignore`, `.gitmessage`, `commitlint.config.cjs` (JS/TS only), `lefthook.yml`, `scripts/install-lefthook.sh`, `docs/lefthook-usage.md` | `init --git` |
21
+ | `--vendor-neutral` | off | 3 (extend) | `.ai/rules/project.md` (pointer to `AGENTS.md`) | `init --vendor-neutral` |
22
+ | `--formatters` | off | 6.5 (delegate) | (delegates to `formatters` — see its flag matrix) | `init --formatters` |
23
+ | `--release-model[=<model>]` | off (offer) | 5.5 (delegate) | `RELEASING.md` (via `release-model`) | `init --release-model=trunk-only` |
24
+ | `--no-release-model` | off | 5.5 (skip) | nothing | `init --no-release-model` |
25
+ | `--artifact-store[=<store>]` | off (offer) | 5.6 (delegate) | `.plans-config`, `.gitignore` (via `artifact-store-pointer.sh`), `AGENTS.md` `## Planning artifacts` | `init --artifact-store=linear` |
26
+ | `--no-artifact-store` | off | 5.6 (skip) | nothing | `init --no-artifact-store` |
27
+ | `--migrate-rules` | off | 5.7 (migrate) | `AGENTS.md` (moved content), `CLAUDE.md` (pointer) — preview only with `--dry-run` | `init --migrate-rules --dry-run` |
28
+ | `--allow-non-git` | off | 5.7 | timestamped backups of the rules files before migrating outside git | `init --migrate-rules --allow-non-git` |
29
+ | `--no-claude-md` | off | 3 | skips the `@AGENTS.md` CLAUDE.md shim (needs Claude Code 2.1.277+) | `init --no-claude-md` |
30
+ | `--update` | off | 6 (merge) | existing targets only | `init --update` |
31
+ | `--force` | off | 6 (overwrite) | all target files | `init --force` |
32
+ | `--profile=<name>` | auto-detect | 1 (skip) | (drives template variables) | `init --profile=rust` |
31
33
 
32
34
  ### `--profile` accepted values
33
35
 
@@ -156,6 +158,27 @@ from `{{#IF_RELEASE_MODEL}}` blocks — see `template-library.md`.
156
158
  /ycc:init --no-release-model
157
159
  ```
158
160
 
161
+ ### `--artifact-store[=<store>]` / `--no-artifact-store`
162
+
163
+ Phase 5.6 sets up the planning-artifact store pointer: the repo-root `.plans-config` that tells a fresh clone where planning artifacts live (see `_shared/references/artifact-store.md`). `linear` is the default store without a pointer; by default init only **offers** to commit a Linear pointer (recording workspace/team hints and pinning the store for fresh clones), and only when a Linear MCP is available. `--artifact-store=local` pins local mode. Profile key: `artifact_store=linear|local|none`, read from the root `.plans-config` `store:` value.
164
+
165
+ First match wins:
166
+
167
+ - Root pointer has effective `store: linear` and is tracked (`git --literal-pathspecs -C <repo-root> ls-files --error-unmatch -- .plans-config`) → skip unless `--artifact-store=local` was passed. An untracked linear pointer must rerun the helper, reusing its existing values.
168
+ - `--no-artifact-store` → skip. Conflicts with `--artifact-store` (error).
169
+ - `--artifact-store=local` → run `artifact-store-pointer.sh --store=local`.
170
+ - `--artifact-store` / `--artifact-store=linear` → run Linear setup without asking. Existing `ARTIFACT_LINEAR_*` hints override defaults: workspace from Linear MCP `get_workspace`, team from `ARTIFACT_LINEAR_TEAM` or `list_teams` (ask when several), and label `repo:<repo-name>` from the `origin` remote basename minus `.git`, falling back to the main checkout directory name (parent of `git rev-parse --path-format=absolute --git-common-dir`). A fixed project uses `--linear-project` instead of `--linear-label`; the other helper flags are `--linear-workspace` and `--linear-team`. Headless multi-team ambiguity without a team hint skips setup and is reported. The helper writes/commits `.plans-config` and ensures `.ycc/artifacts/` is gitignored. On success with linear (or an already linear, tracked pointer), keep `IF_ARTIFACT_STORE`. Explicit `--artifact-store=linear` (also bare `--artifact-store`) appends a missing `## Planning artifacts` section to an existing canonical `AGENTS.md`, like `--update`, preserving all other content even with `--force`; existing rules-layout safeguards still apply.
171
+ - `--docs-only` without the flag → skip. Headless without the flag → skip.
172
+ - Otherwise → offer, default no.
173
+
174
+ `--dry-run` performs read-only Gather first, then passes the full resolved command with `--dry-run` to the helper (nothing written). If required values remain unresolved, print the command with placeholders and say it was not run. Keep `IF_ARTIFACT_STORE` only for the effective linear choice, never for explicit local. All helper refusal checks precede writes. Exit `3` includes label/project mapping switches: ask once about `--force` interactively, otherwise skip and report. Dirty staged or unstaged `.plans-config` changes produce a warning and `commit=skipped` while files are written and exit is `0`. A helper failure drops the block, is recorded in Phase 7, and never aborts init. A `.gitignore` created/edited by Phase 5.6 is merged with the rendered template in Phase 6, never skipped or clobbered (including with `--force`).
175
+
176
+ ```
177
+ /ycc:init --artifact-store=linear
178
+ /ycc:init --artifact-store=local
179
+ /ycc:init --no-artifact-store
180
+ ```
181
+
159
182
  ### `--migrate-rules`
160
183
 
161
184
  Rules-only migration: profile, show the full unified diff and content-loss list, then ask
@@ -177,7 +200,7 @@ per-section routing, content-loss list and diff before approving.
177
200
 
178
201
  Structured refresh of existing artifacts. Never clobbers user content — merges instead.
179
202
 
180
- - `AGENTS.md`: append template sections that are missing; preserve everything else verbatim. A legacy pointer-style `AGENTS.md` (short, names `CLAUDE.md`) triggers the `--migrate-rules` offer instead.
203
+ - `AGENTS.md`: append missing template sections (including `## Planning artifacts` when Phase 5.6 keeps `IF_ARTIFACT_STORE`); preserve everything else verbatim. A legacy pointer-style `AGENTS.md` (short, names `CLAUDE.md`) triggers the `--migrate-rules` offer instead.
181
204
  - `CLAUDE.md`: never rewritten by `--update`. A long one triggers the `--migrate-rules` offer; an `@AGENTS.md` one is left as is.
182
205
  - `.cursorrules` (legacy): fold project-specific lines into `AGENTS.md`; leaves the old file for you to delete.
183
206
  - `.github/ISSUE_TEMPLATE/*.yml`: create missing templates; skip existing ones with a diff (pair with `--force` to overwrite).
@@ -220,6 +243,7 @@ Flags are independent and composable. Any combination is valid:
220
243
  - `--force` applies to every output flag in the same invocation.
221
244
  - `--profile=` and detection are mutually exclusive; `--profile=` wins.
222
245
  - `--release-model` and `--no-release-model` are mutually exclusive (error).
246
+ - `--artifact-store` and `--no-artifact-store` are mutually exclusive (error). `--artifact-store=<value>` accepts only `linear` or `local`; any other value is an error before any phase runs.
223
247
  - Unrecognised flags are reported as errors before any phase runs.
224
248
 
225
249
  ### Common combinations
@@ -113,6 +113,7 @@ These keys let the skill trigger update/merge semantics per artifact:
113
113
  | `has_commitlint_config` | Any `commitlint.config.*` or `.commitlintrc*` exists |
114
114
  | `has_lefthook_config` | `lefthook.yml`, `lefthook.yaml`, `.lefthook.yml`, `.lefthook.yaml`, or `.lefthook/` exists |
115
115
  | `has_releasing_md` | `RELEASING.md` exists at the project root — the project already has a release model |
116
+ | `artifact_store` | `linear`, `local`, or `none`: the root `.plans-config` `store:` value (`none` when absent or invalid) |
116
117
 
117
118
  When `--update` is not passed but two or more of these are true, the skill prints a
118
119
  suggestion to re-run with `--update`. See `flag-reference.md` for update semantics per
@@ -124,6 +125,8 @@ is `true`, the offer is skipped and the `AGENTS.md` "Branching & releases" secti
124
125
  rendered. The skill checks only that the file exists; `release-model --audit` validates
125
126
  its content.
126
127
 
128
+ `artifact_store=linear|local|none` is the value of the first `store:` key in the project-root `.plans-config` (`none` when the file, the key, or a valid `linear`/`local` value is missing). Parsing strips `#` comments, trims surrounding spaces/tabs, then strips one matching pair of single or double quotes, like the resolver. It never strips carriage returns: a CRLF value remains invalid and reports `none`. The Bash 3.2 parser uses no pipelines. It reads only the root file, not parent directories or global config. Phase 5.6 skips setup only when this value is `linear` AND the root pointer is tracked (`git --literal-pathspecs -C <repo-root> ls-files --error-unmatch -- .plans-config`); otherwise `--artifact-store` / the offer decides, reusing existing hints. The "Planning artifacts" block is kept only for an already linear, tracked pointer or successful linear setup, not merely a file left by a failed run. The profile key is not part of the `--update` count.
129
+
127
130
  ---
128
131
 
129
132
  ## Empty Repo Fallback
@@ -65,17 +65,27 @@ Every `{{VAR}}` used across all templates:
65
65
  `{{#NAME}}…{{/NAME}}` keeps its contents when the condition holds and is removed entirely
66
66
  otherwise.
67
67
 
68
- | Block | Kept when | Used in |
69
- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
70
- | `IF_RUST`, `IF_TS`, `IF_GO`, `IF_PYTHON`, `IF_TERRAFORM` | The block's language matches `primary_language` (all of `secondary_languages` too for `gitignore.tmpl`) | Most templates |
71
- | `IF_RELEASE_MODEL` | `RELEASING.md` exists at the project root after Phase 5.5 — already present (`has_releasing_md=true`) or created by `release-model` in this run | `AGENTS.md.tmpl`, `github/labels.md.tmpl` |
72
- | `IF_CLAUDE_ONLY` | Claude-specific content exists (Phase 2 or user-supplied) — otherwise only the `@AGENTS.md` shim remains | `CLAUDE.md.tmpl` |
68
+ | Block | Kept when | Used in |
69
+ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
70
+ | `IF_RUST`, `IF_TS`, `IF_GO`, `IF_PYTHON`, `IF_TERRAFORM` | The block's language matches `primary_language` (all of `secondary_languages` too for `gitignore.tmpl`) | Most templates |
71
+ | `IF_RELEASE_MODEL` | `RELEASING.md` exists at the project root after Phase 5.5 — already present (`has_releasing_md=true`) or created by `release-model` in this run | `AGENTS.md.tmpl`, `github/labels.md.tmpl` |
72
+ | `IF_ARTIFACT_STORE` | Phase 5.6 succeeds with effective choice linear, or the root pointer was already linear and tracked; failed setup or an explicit local choice drops it | `AGENTS.md.tmpl` (`## Planning artifacts`), `git/gitignore.tmpl` (`.ycc/artifacts/`) |
73
+ | `IF_CLAUDE_ONLY` | Claude-specific content exists (Phase 2 or user-supplied) — otherwise only the `@AGENTS.md` shim remains | `CLAUDE.md.tmpl` |
73
74
 
74
75
  `IF_RELEASE_MODEL` is resolved in Phase 5.5, after `release-model` has had its chance
75
76
  to run, so the `## Branching & releases` pointer and the `backport:X.Y` label family never
76
77
  reference a `RELEASING.md` that does not exist. Under `--dry-run` it is kept when
77
78
  `has_releasing_md=true` or `--release-model` was passed.
78
79
 
80
+ `IF_ARTIFACT_STORE` is resolved in Phase 5.6: keep it only after a successful helper run
81
+ with effective choice linear, or when the root `.plans-config` was already linear and
82
+ tracked. A failed helper/MCP run drops it even if a pointer remains on disk.
83
+ `render-template` does not compute it: pass `--keep IF_ARTIFACT_STORE` for both templates.
84
+ Under `--dry-run`, keep it only when the effective choice is linear: the root pointer is
85
+ already linear and tracked, or `--artifact-store` / `--artifact-store=linear` was passed;
86
+ an explicit `--artifact-store=local` always drops it. Phase 5 performs read-only Gather
87
+ before a helper preview; unresolved values are shown as placeholders, not passed to it.
88
+
79
89
  ---
80
90
 
81
91
  ## Notes
@@ -398,6 +398,31 @@ fi
398
398
  has_releasing_md=false
399
399
  file_exists "RELEASING.md" && has_releasing_md=true
400
400
 
401
+ # Artifact-store pointer: parse the first root store key like the resolver:
402
+ # strip comments, trim spaces/tabs, then one matching quote pair. Preserve CR
403
+ # so a CRLF value is invalid rather than disagreeing with store resolution.
404
+ artifact_store=none
405
+ if file_exists ".plans-config"; then
406
+ _as_re='^store[[:space:]]*[:=]'
407
+ while IFS= read -r _as_line || [[ -n "$_as_line" ]]; do
408
+ if [[ "$_as_line" =~ $_as_re ]]; then
409
+ _as_value=${_as_line#*[:=]}
410
+ _as_value=${_as_value%%#*}
411
+ _as_value="${_as_value#"${_as_value%%[!$' \t']*}"}"
412
+ _as_value="${_as_value%"${_as_value##*[!$' \t']}"}"
413
+ case "$_as_value" in
414
+ \"*\") _as_value=${_as_value#\"}; _as_value=${_as_value%\"} ;;
415
+ \'*\') _as_value=${_as_value#\'}; _as_value=${_as_value%\'} ;;
416
+ esac
417
+ case "$_as_value" in
418
+ linear) artifact_store=linear ;;
419
+ local) artifact_store=local ;;
420
+ esac
421
+ break
422
+ fi
423
+ done < "${project_root}/.plans-config"
424
+ fi
425
+
401
426
  # ---------------------------------------------------------------------------
402
427
  # CI provider detection
403
428
  # ---------------------------------------------------------------------------
@@ -449,5 +474,6 @@ echo "has_gitignore=${has_gitignore}"
449
474
  echo "has_commitlint_config=${has_commitlint_config}"
450
475
  echo "has_lefthook_config=${has_lefthook_config}"
451
476
  echo "has_releasing_md=${has_releasing_md}"
477
+ echo "artifact_store=${artifact_store}"
452
478
  echo "ci_provider=${ci_provider}"
453
479
  echo "project_name=${project_name}"
@@ -11,8 +11,8 @@ Usage:
11
11
  * --profile is key=value output from profile-project.sh; "-" or piped stdin
12
12
  reads it from stdin. Regular files, FIFOs and /dev/fd paths are accepted.
13
13
  * --set KEY=VALUE overrides the profile. --keep BLOCK keeps a block that is
14
- not computed automatically (IF_RELEASE_MODEL, IF_LABELS, IF_CONTRIBUTING,
15
- IF_CLAUDE_ONLY).
14
+ not computed automatically (IF_RELEASE_MODEL, IF_ARTIFACT_STORE, IF_LABELS,
15
+ IF_CONTRIBUTING, IF_CLAUDE_ONLY).
16
16
 
17
17
  Blocks:
18
18
  {{#NAME}} ... {{/NAME}} markers must be alone on their line. Blocks nest,
@@ -36,3 +36,9 @@ This is the canonical, tool-neutral repository policy.
36
36
 
37
37
  Read [`RELEASING.md`](RELEASING.md) before branching, opening a PR, or releasing. It is the source of truth for trunk, maintenance branches, and backports. Never merge one long-lived branch into another to sync it.
38
38
  {{/IF_RELEASE_MODEL}}
39
+ {{#IF_ARTIFACT_STORE}}
40
+
41
+ ## Planning artifacts
42
+
43
+ Planning artifacts live in Linear (see `.plans-config`); `.ycc/artifacts/` is a gitignored local cache. If it's missing, pull from Linear.
44
+ {{/IF_ARTIFACT_STORE}}
@@ -48,6 +48,11 @@ Thumbs.db
48
48
  .claude/session-data/
49
49
  .claude/plans/
50
50
 
51
+ {{#IF_ARTIFACT_STORE}}
52
+ # Planning artifacts — Linear's local cache
53
+ .ycc/artifacts/
54
+ {{/IF_ARTIFACT_STORE}}
55
+
51
56
  {{#IF_RUST}}
52
57
  # ==============================================================================
53
58
  # Rust
@@ -26,9 +26,12 @@ Parse flags first, then treat the remainder as the task description:
26
26
  - `--sequential`: force single-task batches (tightly dependent tasks). With worktree mode active, all sequential tasks run in the single feature worktree.
27
27
  - `--worktree`: legacy, now default; accepted as a silent no-op.
28
28
  - `--no-worktree`: force worktree mode off. All tasks run in the current checkout; no feature worktree is created.
29
- - `<task-description>`: the task to orchestrate (required, may be multi-word).
29
+ - `--store=local|linear`: artifact-store override (see `{{package-root}}/shared/references/artifact-store.md`, Implementation skills). Default `linear`; `local` opts out.
30
+ - `<task-description>`: the task to orchestrate (required, may be multi-word), or a Linear issue reference (key like `YAN-123`, or issue URL) that selects linear mode (see Linear Mode).
30
31
 
31
- Strip flags from `$ARGUMENTS` and set ``, `DRY_RUN=true|false`, `PLAN_ONLY=true|false`, `SEQUENTIAL=true|false`, `WORKTREE_MODE=true|false` (true unless `--no-worktree`). Join the remaining tokens into `TASK_DESCRIPTION`.
32
+ Strip flags from `$ARGUMENTS` and set ``, `DRY_RUN=true|false`, `PLAN_ONLY=true|false`, `SEQUENTIAL=true|false`, `WORKTREE_MODE=true|false` (true unless `--no-worktree`), and `STORE_FLAG` (the stripped `--store=...` flag, empty when absent; pass `${STORE_FLAG}` to every resolver call). Join the remaining tokens into `TASK_DESCRIPTION`.
33
+
34
+ **Linear input**: immediately after flag parsing, before slug derivation, check whether `TASK_DESCRIPTION` is a Linear issue reference (key or `linear.app` issue URL, per artifact-store.md **Implementation skills > Inputs**). If it is and `--store=local` was passed, abort with `A Linear plan reference requires linear mode; drop --store=local.` Otherwise, when `STORE_FLAG` is empty, set `STORE_FLAG=--store=linear` before the first resolver call and forward it to every later call, per that contract. Then resolve and print the mode (`resolve-artifact-store.sh ${STORE_FLAG} --shell`), apply the Linear call gate, and read the issue's title, description and sub-issues as `TASK_DESCRIPTION` (reads are allowed under `--dry-run`/`--plan-only`; they make no Linear writes). Any other input, including a `store: linear` config alone, skips Linear Mode entirely.
32
35
 
33
36
 
34
37
  ## Gates (hold across the whole run)
@@ -121,6 +124,18 @@ Do not dispatch agents or run worktree scripts in dry-run mode.
121
124
  - With `WORKTREE_MODE=true`, read dispatch-playbook.md section 3 now and include a `## Worktree Setup` section immediately after frontmatter and before Batch 1, listing only the parent path. No child paths, no `**Children**:` list.
122
125
  - **Stop here.** Do not deploy agents.
123
126
 
127
+ ## Linear Mode
128
+
129
+ Contract: `{{package-root}}/shared/references/artifact-store.md` (Implementation skills: Status sync, Report and completion, Orchestrate). Applies only when the input was a Linear issue reference (see Linear input under Current Task); otherwise skip this section entirely (a plain task description makes no Linear calls and has no behavior change, whatever the resolved store). Only this orchestrating skill calls Linear MCP; subagents never do, and agent prompts must not mention Linear tools.
130
+
131
+ 1. **Run start** (non-dry, non-plan-only, immediately before the first dispatch): move the issue to `started` only when it is `backlog`, `unstarted` or `triage`. Never move an issue backwards or touch other issues.
132
+ 2. **Failure**: leave the issue `started`; add one comment with the failed task id, failing check and a short excerpt (no secrets, no full logs).
133
+ 3. **Report**: when the issue has a Project, resolve `${STORE_FLAG} --ensure --kind=report --slug=<feature-slug>` using the feature slug (Project name), write a brief pointer-based report there and Save it on success and failure alike (status update `onTrack` when every task passed, else `atRisk`). With no Project, skip the upload.
134
+ 4. **Completion**: mark the issue `completed` only when final verification (Step 15) passes.
135
+ 5. **Unreachable MCP mid-run**: keep going; list unapplied transitions in the summary under `## Linear sync pending`.
136
+
137
+ `--plan-only` still writes only `docs/orchestration/[sanitized-task-name].md`, never an artifact-store kind.
138
+
124
139
  ## Phase 4: Parallel Agent Deployment
125
140
 
126
141
  **Step 11**: group subtasks by dependency using standalone-dispatch §9.1. With `--sequential`, create single-task batches.
@@ -29,10 +29,12 @@ checkpoint), regardless of `$ARGUMENTS`.
29
29
 
30
30
  **Outputs**:
31
31
 
32
- - `${PLANS_DIR}/[feature-name]/analysis-context.md`
33
- - `${PLANS_DIR}/[feature-name]/analysis-code.md`
34
- - `${PLANS_DIR}/[feature-name]/analysis-tasks.md`
35
- - `${PLANS_DIR}/[feature-name]/parallel-plan.md`
32
+ - `${feature_dir}/analysis-context.md`
33
+ - `${feature_dir}/analysis-code.md`
34
+ - `${feature_dir}/analysis-tasks.md`
35
+ - `${parallel_plan_file}`
36
+
37
+ Canonical `plan-workflow` resolves these paths with the artifact-store `analysis-<name>` and `parallel-plan` kinds. Local mode keeps today's `docs/plans/<feature>/` paths; linear mode resolves under `.ycc/artifacts/<feature>/` and saves only the plan to Linear. Analysis remains local-only.
36
38
 
37
39
  After creating planning artifacts and displaying the summary, **STOP COMPLETELY**.
38
40
 
@@ -50,7 +52,7 @@ shared-context (step 1) -> parallel-plan (this skill) -> implement-plan (step 3)
50
52
 
51
53
  This skill requires `${feature_dir}/shared.md` and ends after producing
52
54
  analysis artifacts and `parallel-plan.md`. The user manually runs
53
- `/ycc:implement-plan` when ready.
55
+ `/ycc:implement-plan` when ready in local mode; in linear mode, `/ycc:implement-plan --store=linear <feature>` loads the plan from the artifact-store cache.
54
56
 
55
57
  **If shared.md doesn't exist**: canonical `plan-workflow/scripts/check-prerequisites.sh`
56
58
  fails fast in plan-only mode. Stop and tell the user to run
@@ -64,7 +66,8 @@ fails fast in plan-only mode. Stop and tell the user to run
64
66
  - **--no-worktree**: Optional. Opt out of worktree annotations. The plan will not contain a `## Worktree Setup` section.
65
67
  - **--visual**: Optional. Render the finished plan as an Agent-Native visual artifact (MDX) via `visual-plan`; local-files by default, hosted link requires `--share`.
66
68
  - **--dry-run**: Show what would be created without making changes. Writes nothing.
67
- - **feature-name**: Required. Matches directory name in `${PLANS_DIR}`.
69
+ - **feature-name**: Required. Feature slug passed to canonical `plan-workflow` for artifact-store resolution.
70
+ - **--store=local|linear**: Optional artifact-store override, forwarded to canonical `plan-workflow`. Linear is the default.
68
71
 
69
72
  If any unsupported flag is present (see Flag policy above), abort with a usage error and STOP:
70
73
 
@@ -106,7 +109,7 @@ are dropped, not duplicated.)
106
109
 
107
110
  ## Location
108
111
 
109
- ${feature_dir}/parallel-plan.md
112
+ ${parallel_plan_file}
110
113
 
111
114
  ## Analysis Files Generated
112
115
 
@@ -118,7 +121,10 @@ ${feature_dir}/parallel-plan.md
118
121
 
119
122
  **THIS SKILL IS NOW COMPLETE. DO NOT PROCEED.**
120
123
 
121
- /ycc:implement-plan [feature-name]
124
+ Local mode only: /ycc:implement-plan [feature-name]
125
+
126
+ In linear mode replace that command with:
127
+ /ycc:implement-plan --store=linear [feature-name]
122
128
  ```
123
129
 
124
130
  **STOP**: Do not execute implement-plan. Do not write any more files. Do not modify any code. This skill is complete.
@@ -124,8 +124,24 @@ Unclear response: ask focused clarification.
124
124
  Runs only after Step 4 confirmation, last; never substitutes for earlier phases.
125
125
 
126
126
  - Dry-run: print `visual generation would run`; no writes/invocation.
127
- - Otherwise write confirmed plan verbatim to `docs/prps/plans/<slug>.plan.md`; create directory, resolve absolute path. Slug: lowercase, replace non-[a-z0-9-] with hyphen, collapse/trim, cap 20, fallback untitled.
128
- - Invoke `visual-plan <absolute-plan-path>`; surface its URL, localhost preview or `local files only`; do not derive output directory yourself.
127
+ - Otherwise derive `<slug>`: lowercase, replace non-[a-z0-9-] with hyphen, collapse/trim, cap 20, fallback untitled. Resolve the `prp-plan` artifact as below and write the confirmed plan verbatim to `$OUT`.
128
+ - Invoke `visual-plan ${STORE_FLAG} <absolute-plan-path>`; surface its URL, localhost preview or `local files only`; do not derive output directory yourself.
129
+
130
+ 1. Print the mode and read `ARTIFACT_STORE=` from stdout:
131
+
132
+ ```bash
133
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --shell
134
+ ```
135
+
136
+ 2. In linear mode only, apply the **Linear call gate** in `{{package-root}}/shared/references/artifact-store.md` before any write or `--ensure`.
137
+ 3. Resolve the destination once writing is permitted:
138
+
139
+ ```bash
140
+ OUT="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --ensure --kind=prp-plan --slug=<slug>)"
141
+ mkdir -p "$(dirname "$OUT")"
142
+ ```
143
+
144
+ Shell state does not persist across tool calls; retain the printed mode and absolute path. Local mode keeps `docs/prps/plans/<slug>.plan.md` under the current checkout's git toplevel without identity frontmatter. Before writing in linear mode, follow artifact-store.md **Planning skills**: when document or task identity is missing, Lookup steps 3–6 and Load any hit, preserve identity and use Conflict before replacement, then Save with task sub-issues. Pass `$OUT` and `${STORE_FLAG}` to visual-plan. In linear mode print `/ycc:prp-implement --store=linear {resolved cached plan path or Linear Document URL}` as the next step.
129
145
 
130
146
  Read `{{package-root}}/shared/references/visual-mode.md` only when visual requested, for force-write-first terminal decorator contract.
131
147
 
@@ -37,7 +37,7 @@ For unattended loop-to-completion of a parallel plan, hand off to `/ycc:implemen
37
37
 
38
38
  **Option 2 — Save to file and hand off (rigorous)**
39
39
 
40
- Write the plan to `docs/prps/plans/{name}.plan.md` (adapting it to the PRP plan template if needed: add `Patterns to Mirror`, `Files to Change`, `Validation Commands`, etc.), then run `/ycc:prp-implement --parallel docs/prps/plans/{name}.plan.md` for the full 5-level validation pipeline.
40
+ Resolve kind `prp-plan` for the feature slug through `{{package-root}}/shared/scripts/resolve-artifact-store.sh` using the skill's three steps: print `--shell` and read `ARTIFACT_STORE`, apply the Linear call gate in linear mode, then `--ensure --kind=prp-plan --slug=<slug>`. Forward `${STORE_FLAG}` on every call. Prepare missing document/task identity via Lookup/Load before writing as required by artifact-store.md **Planning skills**, then Save (including task sub-issues). Write the resolved absolute `$OUT`, adapting to the PRP template when needed. Local mode keeps `docs/prps/plans/<slug>.plan.md` under the current checkout's git toplevel and retains move semantics; print `/ycc:prp-implement --parallel {resolved absolute OUT path}` only in local mode. In linear mode print `/ycc:prp-implement --parallel --store=linear {resolved cached plan path or Linear Document URL}` instead. Never move the linear cache.
41
41
 
42
42
  Use Option 1 for small features and quick iterations. Use Option 2 when the user wants an implementation report, per-task validation logs, and the plan archived for audit.
43
43