@yandy-r/ycc-opencode 6.1.0 → 6.2.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 (119) 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/package.json +1 -1
  9. package/shared/references/artifact-store.md +613 -0
  10. package/shared/references/branch-prep.md +2 -0
  11. package/shared/references/forge-detection.md +3 -2
  12. package/shared/references/review-artifact-format.md +13 -6
  13. package/shared/references/review-checklist.md +3 -2
  14. package/shared/references/review-dispatch.md +15 -10
  15. package/shared/references/target-capability-matrix.md +42 -6
  16. package/shared/references/visual-mode.md +19 -13
  17. package/shared/references/worktree-strategy.md +12 -8
  18. package/shared/scripts/artifact-body.sh +71 -0
  19. package/shared/scripts/artifact-store-pointer.sh +245 -0
  20. package/shared/scripts/ci-monitor.sh +9 -4
  21. package/shared/scripts/collect-linear-keys.sh +77 -0
  22. package/shared/scripts/lib/ci-classify.sh +13 -10
  23. package/shared/scripts/lib/forge.sh +13 -4
  24. package/shared/scripts/prepare-feature-branch.sh +96 -10
  25. package/shared/scripts/release-ci-monitor.sh +2 -2
  26. package/shared/scripts/report-bundle-drift.sh +1 -1
  27. package/shared/scripts/resolve-artifact-store.sh +636 -0
  28. package/shared/scripts/validate-file-paths.sh +11 -4
  29. package/skills/blueprint/SKILL.md +48 -13
  30. package/skills/clean/SKILL.md +1 -1
  31. package/skills/clean/scripts/detect-project-type.sh +2 -2
  32. package/skills/clean/scripts/generate-report.sh +34 -5
  33. package/skills/clean/scripts/validate-safety.sh +9 -6
  34. package/skills/code-report/SKILL.md +26 -14
  35. package/skills/code-report/scripts/check-prerequisites.sh +72 -12
  36. package/skills/code-report/templates/report-structure.md +1 -1
  37. package/skills/code-review/SKILL.md +68 -17
  38. package/skills/code-review/references/pr-procedure.md +28 -15
  39. package/skills/compatibility-audit/scripts/audit-target-features.sh +1 -1
  40. package/skills/deep-research/SKILL.md +28 -5
  41. package/skills/deep-research/references/completion-summary-template.md +3 -2
  42. package/skills/deep-research/scripts/validate-research.sh +8 -2
  43. package/skills/feature-research/SKILL.md +48 -25
  44. package/skills/feature-research/scripts/validate-research.sh +51 -12
  45. package/skills/feature-research/scripts/validate-spec.sh +53 -22
  46. package/skills/feature-research/templates/research-agents.md +15 -14
  47. package/skills/feature-research/templates/spec-structure.md +5 -0
  48. package/skills/formatters/scripts/apply-aliases.sh +3 -1
  49. package/skills/formatters/scripts/apply-ci.sh +3 -1
  50. package/skills/git-workflow/SKILL.md +2 -1
  51. package/skills/git-workflow/references/pr-creation.md +10 -0
  52. package/skills/git-workflow/scripts/analyze-changes.sh +21 -11
  53. package/skills/git-workflow/scripts/create-pr.sh +51 -6
  54. package/skills/git-workflow/scripts/validate-commit.sh +26 -14
  55. package/skills/hooks-workflow/scripts/verify-hooks.sh +1 -1
  56. package/skills/implement-plan/SKILL.md +35 -16
  57. package/skills/implement-plan/references/agent-task-prompt.md +8 -5
  58. package/skills/implement-plan/references/linear-sync.md +20 -0
  59. package/skills/implement-plan/references/output-formats.md +17 -2
  60. package/skills/implement-plan/references/plan-inputs.md +23 -4
  61. package/skills/implement-plan/scripts/check-prerequisites.sh +95 -49
  62. package/skills/implement-plan/scripts/parse-dependencies.sh +10 -10
  63. package/skills/init/SKILL.md +77 -42
  64. package/skills/init/references/flag-reference.md +41 -17
  65. package/skills/init/references/project-profile-heuristics.md +3 -0
  66. package/skills/init/references/template-library.md +15 -5
  67. package/skills/init/scripts/profile-project.sh +26 -0
  68. package/skills/init/scripts/render-template.py +2 -2
  69. package/skills/init/templates/AGENTS.md.tmpl +6 -0
  70. package/skills/init/templates/git/gitignore.tmpl +5 -0
  71. package/skills/orchestrate/SKILL.md +17 -2
  72. package/skills/parallel-plan/SKILL.md +14 -8
  73. package/skills/plan/SKILL.md +18 -2
  74. package/skills/plan/references/planning-tracks.md +1 -1
  75. package/skills/plan-workflow/SKILL.md +67 -32
  76. package/skills/plan-workflow/references/checkpoint-messages.md +23 -14
  77. package/skills/plan-workflow/references/plan-structure.md +1 -1
  78. package/skills/plan-workflow/references/planning-agents.md +11 -9
  79. package/skills/plan-workflow/references/research-agents-optimized.md +12 -10
  80. package/skills/plan-workflow/references/research-agents.md +11 -10
  81. package/skills/plan-workflow/scripts/check-prerequisites.sh +50 -11
  82. package/skills/plan-workflow/scripts/check-state.sh +53 -9
  83. package/skills/plan-workflow/scripts/persist-or-fail.sh +21 -7
  84. package/skills/plan-workflow/scripts/validate-analysis-artifacts.sh +28 -14
  85. package/skills/plan-workflow/scripts/validate-research-artifacts.sh +35 -10
  86. package/skills/plan-workflow/scripts/validate-shared.sh +56 -15
  87. package/skills/plan-workflow/scripts/validate-workflow-plan.sh +48 -17
  88. package/skills/pr-autofix/SKILL.md +19 -4
  89. package/skills/pr-autofix/references/output-templates.md +3 -2
  90. package/skills/pr-autofix/scripts/fetch-pr-comments.sh +1 -2
  91. package/skills/pr-autofix/scripts/post-summary.sh +1 -2
  92. package/skills/pr-autofix/scripts/resolve-thread.sh +3 -4
  93. package/skills/prp-implement/SKILL.md +31 -16
  94. package/skills/prp-implement/references/agent-task-prompt.md +5 -2
  95. package/skills/prp-implement/references/detection.md +4 -1
  96. package/skills/prp-implement/references/linear-sync.md +25 -0
  97. package/skills/prp-implement/references/report-output.md +15 -2
  98. package/skills/prp-plan/SKILL.md +62 -30
  99. package/skills/prp-plan/references/enhanced-researchers.md +8 -9
  100. package/skills/prp-plan/scripts/validate-prp-plan.sh +42 -18
  101. package/skills/prp-pr/SKILL.md +14 -1
  102. package/skills/prp-prd/SKILL.md +21 -9
  103. package/skills/prp-spec/SKILL.md +30 -20
  104. package/skills/quick-fix/SKILL.md +6 -4
  105. package/skills/quick-review/SKILL.md +62 -25
  106. package/skills/release-model/scripts/collect-signals.sh +9 -3
  107. package/skills/releaser/scripts/publish-release.sh +6 -3
  108. package/skills/research-to-issues/SKILL.md +33 -14
  109. package/skills/research-to-issues/scripts/validate-prerequisites.sh +45 -23
  110. package/skills/research-to-issues/templates/task-issue.md +4 -0
  111. package/skills/research-to-issues/templates/tracking-issue.md +3 -0
  112. package/skills/review-fix/SKILL.md +96 -14
  113. package/skills/review-fix/references/fix-report.md +10 -10
  114. package/skills/review-fix/references/plan.md +5 -2
  115. package/skills/shared-context/SKILL.md +14 -11
  116. package/skills/visual-plan/SKILL.md +26 -8
  117. package/skills/visual-recap/SKILL.md +1 -1
  118. package/skills/write-docs/scripts/audit-documentation.sh +44 -10
  119. package/skills/write-docs/scripts/generate-doc-index.sh +10 -3
@@ -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
 
@@ -22,7 +22,7 @@ Read `{{package-root}}/shared/references/standalone-dispatch.md` for standalone
22
22
 
23
23
  ```
24
24
  Error: --research-only and --plan-only are mutually exclusive
25
- Usage: /ycc:plan-workflow [--research-only | --plan-only] [--no-checkpoint] [--optimized] [--dry-run] [--no-worktree] [--visual] [feature-name]
25
+ Usage: /ycc:plan-workflow [--research-only | --plan-only] [--no-checkpoint] [--optimized] [--dry-run] [--no-worktree] [--visual] [--store=local|linear] [feature-name]
26
26
  ```
27
27
 
28
28
  2. **Feature name required**: kebab-case (lowercase, hyphens), no other special characters. If missing or invalid, abort with the matching error block from `references/checkpoint-messages.md` ("Error Messages": Missing Feature Name / Invalid Feature Name).
@@ -38,7 +38,7 @@ Read `{{package-root}}/shared/references/standalone-dispatch.md` for standalone
38
38
 
39
39
  ## Arguments
40
40
 
41
- Parse flags first, then the feature name (first non-flag argument, required; directory name in `${PLANS_DIR}/`).
41
+ Parse flags first, then the feature name (first non-flag argument, required; artifact feature slug).
42
42
 
43
43
  - **--research-only**: stop after research (creates shared.md only).
44
44
  - **--plan-only**: skip research, use existing shared.md. Skips Phases 1–4, NOT Phase 5 (Analysis).
@@ -46,6 +46,7 @@ Parse flags first, then the feature name (first non-flag argument, required; dir
46
46
  - **--optimized**: 7-agent unified deployment (default: 10-agent standard).
47
47
  - **--worktree**: legacy no-op (worktree annotations are the default; safe to omit).
48
48
  - **--no-worktree**: opt out of worktree annotations in the generated `parallel-plan.md`. No effect with `--research-only` (no plan file). Honored with `--plan-only`.
49
+ - **--store=local|linear**: optional artifact-store override. Forward it to every artifact-store helper call. Linear is the default; `local` opts out.
49
50
  - **--visual**: render the finished plan as an Agent-Native visual artifact (MDX) via `visual-plan`; local files by default, hosted link requires `--share`.
50
51
 
51
52
  If no feature name is provided, abort with the full usage instructions from `references/checkpoint-messages.md` — read when the feature name is missing ("Usage Instructions" section).
@@ -54,7 +55,7 @@ If no feature name is provided, abort with the full usage instructions from `ref
54
55
 
55
56
  ## Visual mode
56
57
 
57
- See `{{package-root}}/shared/references/visual-mode.md` for the canonical `--visual` contract. `--visual` is a terminal decorator step, orthogonal to `--optimized` and `--no-worktree`; it runs once at the very end. With `VISUAL_MODE=true` and no `--dry-run`, after the final phase invoke `visual-plan <absolute-plan-path>` where the path is the **actual written plan** at `${feature_dir}/parallel-plan.md` (resolved in Phase 0) — never a hardcoded `docs/prps/plans` path; `visual-plan` derives its `visual/` output directory from it. With `--dry-run`, short-circuit: print `visual generation would run` and do not invoke `visual-plan`. `--research-only` produces no plan file, so `--visual` does not run.
58
+ See `{{package-root}}/shared/references/visual-mode.md` for the canonical `--visual` contract. It is a terminal decorator, orthogonal to `--optimized` and `--no-worktree`; run it once at the end. With `VISUAL_MODE=true` and no `--dry-run`, invoke `visual-plan ${STORE_FLAG} <absolute-plan-path>` with the actual written `${parallel_plan_file}` and the retained store override. Dry runs print `visual generation would run` without invoking it. `--research-only` produces no plan and skips visualization.
58
59
 
59
60
  ## Phase 0: Initialize
60
61
 
@@ -79,21 +80,39 @@ ARGUMENTS="${ARGUMENTS//--visual/}"
79
80
 
80
81
  Apply critical gates 1–3. **feature-name** = first non-flag argument.
81
82
 
82
- ### Step 2: Resolve Plans Directory
83
+ Parse and strip `--store=local|linear` before selecting the feature name. Set `STORE_FLAG` to the exact override when supplied, otherwise empty; reject invalid/conflicting overrides. Append it to every resolver invocation and visual-plan call below.
83
84
 
84
- ```bash
85
- source {{package-root}}/shared/scripts/resolve-plans-dir.sh
86
- feature_dir="$(get_feature_plan_dir "[feature-name]")"
87
- ```
85
+ ### Step 2: Resolve Artifact Paths
86
+
87
+ 1. Print the mode and read `ARTIFACT_STORE=` from stdout; resolve paths without writes:
88
+
89
+ ```bash
90
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --shell
91
+ feature_dir="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=feature-dir --slug="[feature-name]")"
92
+ research_dir="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=research-dir --slug="[feature-name]")"
93
+ shared_file="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=shared --slug="[feature-name]")"
94
+ parallel_plan_file="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=parallel-plan --slug="[feature-name]")"
95
+ ```
96
+
97
+ If `STORE_FLAG` is empty, the printed `ARTIFACT_STORE_SOURCE` is `default`, and `test -d "$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" --store=local)/[feature-name]"` succeeds (legacy local names such as `team/auth` included), set `STORE_FLAG=--store=local`, print `Using local plan at <that path>; pin with store: local in .plans-config`, and rerun the resolutions above (artifact-store.md **Implementation skills > Inputs**).
98
+
99
+ 2. For a non-dry linear run only, apply the **Linear call gate** in `{{package-root}}/shared/references/artifact-store.md` before any write or pull.
100
+ 3. Before Lookup/Load in that linear run, ensure the cache and gitignore rule:
101
+
102
+ ```bash
103
+ feature_dir="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --ensure --kind=feature-dir --slug="[feature-name]")"
104
+ ```
88
105
 
89
- Handles monorepo detection, `.plans-config` files, and git root resolution automatically. See "Monorepo Support" below.
106
+ Then use Lookup/Load to populate missing cached inputs before state detection. For each document that will be written (research, shared, plan), if document identity is missing (or the plan has no task identity), follow **Planning skills** Lookup steps 3–6 and Load any hit before dispatch or writing; preserve identity and resolve Conflict on replacement. Local mode keeps `PLANS_DIR/<feature>/`; linear mode uses `.ycc/artifacts/<feature>/` with research in `research/`. Dry runs only resolve paths, never ensure or Load. Retain the printed mode and absolute paths across tool calls. See "Monorepo Support" below.
90
107
 
91
108
  ### Step 3: Run State Detection
92
109
 
93
110
  ```bash
94
- {{package-root}}/skills/plan-workflow/scripts/check-state.sh [feature-name]
111
+ {{package-root}}/skills/plan-workflow/scripts/check-state.sh "[feature-name]" ${STORE_FLAG}
95
112
  ```
96
113
 
114
+ Set `STORE_FLAG=--store=local` or `--store=linear` only when that override was supplied (or the Step 2 local-plan rule chose `--store=local`); otherwise leave it empty so config/default resolution applies. Forward the same override to `check-prerequisites.sh` and to every path-taking validator below. Validators receive the resolved absolute artifact paths already shown.
115
+
97
116
  Reports whether `${feature_dir}/` exists, `shared.md`, `parallel-plan.md`, and any research files.
98
117
 
99
118
  ### Step 4: Determine Execution Mode
@@ -112,11 +131,11 @@ Reports whether `${feature_dir}/` exists, `shared.md`, `parallel-plan.md`, and a
112
131
 
113
132
  ### Step 4A: Dry-Run Preview (when `--dry-run`, before anything else)
114
133
 
115
- Read `references/checkpoint-messages.md` — read when previewing a dry run. Display its "Dry Run Output" section with values substituted (`{{FEATURE_NAME}}`, `{{FEATURE_DIR}}`, dispatch mode, execution mode), then **STOP** (gate 4). If `--plan-only` is also set and `check-state.sh` shows no `shared.md`, state in the preview that a real run would fail fast at Step 4B (missing prerequisite) and **STOP**.
134
+ Read `references/checkpoint-messages.md` — read when previewing a dry run. Display its "Dry Run Output" section with values substituted (`{{FEATURE_NAME}}`, `{{FEATURE_DIR}}`, `{{RESEARCH_DIR}}`, dispatch mode, execution mode), then **STOP** (gate 4). If `--plan-only` is also set and `check-state.sh` shows no `shared.md`, state in the preview that a real run would fail fast at Step 4B unless a linear Lookup populates the cache from an existing shared document, and **STOP**.
116
135
 
117
136
  ### Step 4B: Plan-Only Prerequisite Gate (when `--plan-only`, before any write)
118
137
 
119
- Run `scripts/check-prerequisites.sh "[feature-name]"` per gate 5. Then, for `--optimized --plan-only`, verify the five unified files exist before any write or dispatch (gate 6): `analysis-architecture.md`, `analysis-patterns.md`, `analysis-integration.md`, `analysis-docs.md`, `analysis-tasks.md`.
138
+ Run `scripts/check-prerequisites.sh "[feature-name]" ${STORE_FLAG}` per gate 5. Then, for `--optimized --plan-only`, verify the five unified files exist before any write or dispatch (gate 6): `analysis-architecture.md`, `analysis-patterns.md`, `analysis-integration.md`, `analysis-docs.md`, `analysis-tasks.md`.
120
139
 
121
140
  ### Step 4C: Overwrite Choice (when shared.md or parallel-plan.md exists)
122
141
 
@@ -125,9 +144,17 @@ Run `scripts/check-prerequisites.sh "[feature-name]"` per gate 5. Then, for `--o
125
144
  - **Headless (no question tool or chat turn), checkpoint enabled**: do not overwrite. Print the existing paths and `rerun with --no-checkpoint` to regenerate, then **STOP** without writes or dispatch.
126
145
  - **Research-only reuse**: report the existing `shared.md` path, state that no files were changed, print `/ycc:parallel-plan <feature>` as the next step, and **STOP** without dispatching agents.
127
146
 
128
- ### Step 5: Create Directory
147
+ ### Step 5: Create Directories
148
+
149
+ Only when `--dry-run` is not set: in linear mode apply the Linear call gate from artifact-store.md before `--ensure`, then run:
150
+
151
+ ```bash
152
+ feature_dir="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --ensure --kind=feature-dir --slug="[feature-name]")"
153
+ research_dir="$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=research-dir --slug="[feature-name]")"
154
+ mkdir -p "$feature_dir" "$research_dir"
155
+ ```
129
156
 
130
- Only when `--dry-run` is not set: `mkdir -p "${feature_dir}"` if missing.
157
+ Local `--ensure` creates only the resolved feature directory; the `mkdir` also prepares research. In linear mode `research_dir` is `${feature_dir}/research`; in local mode it equals `feature_dir`.
131
158
 
132
159
  ## Phase 1: Research Stage (unless --plan-only)
133
160
 
@@ -136,7 +163,7 @@ Only when `--dry-run` is not set: `mkdir -p "${feature_dir}"` if missing.
136
163
  - Standard mode: read `{{package-root}}/skills/plan-workflow/references/research-agents.md` — read when spawning Phase 1 research agents in standard mode.
137
164
  - Optimized mode: read `{{package-root}}/skills/plan-workflow/references/research-agents-optimized.md` — read when `--optimized` replaces the 4 researchers with 5 unified analysts.
138
165
 
139
- Substitute `{{FEATURE_NAME}}` (feature directory name) and `{{FEATURE_DIR}}` (`${feature_dir}`, resolved in Step 2).
166
+ Substitute `{{FEATURE_NAME}}` (feature directory name), `{{FEATURE_DIR}}` (`${feature_dir}`), and every `{{RESEARCH_<LENS>_FILE}}` or `{{ANALYSIS_<NAME>_FILE}}` with its absolute path from the executed resolver (`research-<lens>` or `analysis-<name>` kind), using the same store override as Step 2 and no `--ensure` (Step 5 already created their parent). Analysis artifacts remain local-only in linear mode.
140
167
 
141
168
  ### Step 10: Spawn Research Agents (standard mode)
142
169
 
@@ -160,35 +187,39 @@ If a child report is empty or contentless, record its `sessionID`, inspect the d
160
187
 
161
188
  ```bash
162
189
  # Standard mode (4-file research-*.md set):
163
- {{package-root}}/skills/plan-workflow/scripts/validate-research-artifacts.sh "${feature_dir}"
190
+ {{package-root}}/skills/plan-workflow/scripts/validate-research-artifacts.sh "${feature_dir}" ${STORE_FLAG}
164
191
 
165
192
  # Optimized mode (5-file unified analysis-*.md set):
166
- {{package-root}}/skills/plan-workflow/scripts/validate-research-artifacts.sh "${feature_dir}" --optimized
193
+ {{package-root}}/skills/plan-workflow/scripts/validate-research-artifacts.sh "${feature_dir}" --optimized ${STORE_FLAG}
167
194
  ```
168
195
 
169
196
  Append `--optimized` whenever the flag was passed (gate 8). On failure, apply the fix loop (gate 9). Do not proceed to shared.md synthesis until validation passes.
170
197
 
198
+ In linear mode, after validation and fixes, follow artifact-store.md section **Planning skills** to Save each standard `research-<lens>` document. Optimized `analysis-*` files stay local-only and are never pushed.
199
+
171
200
  ## Phase 3: Consolidate Research
172
201
 
173
202
  ### Step 13: Read Research Results
174
203
 
175
204
  After validation passes, read the input set for the active mode:
176
205
 
177
- - **Standard (4 files)**: `${feature_dir}/research-architecture.md`, `research-patterns.md`, `research-integration.md`, `research-docs.md`.
206
+ - **Standard (4 files)**: `${research_dir}/research-architecture.md`, `research-patterns.md`, `research-integration.md`, `research-docs.md`.
178
207
  - **Optimized (5 unified files; no `research-*.md` exist)**: `${feature_dir}/analysis-architecture.md`, `analysis-patterns.md`, `analysis-integration.md`, `analysis-docs.md`, `analysis-tasks.md`.
179
208
 
180
209
  ### Step 14: Generate shared.md
181
210
 
182
- Read `{{package-root}}/skills/plan-workflow/references/shared-structure.md` — read when writing `shared.md`. Create `${feature_dir}/shared.md` following the template exactly.
211
+ Read `{{package-root}}/skills/plan-workflow/references/shared-structure.md` — read when writing `shared.md`. Create `${shared_file}` following the template exactly.
183
212
 
184
213
  ### Step 15: Validate shared.md
185
214
 
186
215
  ```bash
187
- {{package-root}}/skills/plan-workflow/scripts/validate-shared.sh "${feature_dir}/shared.md"
216
+ {{package-root}}/skills/plan-workflow/scripts/validate-shared.sh "${shared_file}" ${STORE_FLAG}
188
217
  ```
189
218
 
190
219
  Fix any errors before proceeding.
191
220
 
221
+ In linear mode, follow artifact-store.md section **Planning skills** to Save the validated `shared` document before continuing. When replacing an existing shared file, preserve its identity frontmatter and replace only the body as required by Save. Local mode writes the body without frontmatter and makes no Linear calls.
222
+
192
223
  ### Step 15A: Research-Only Stop (if `--research-only`)
193
224
 
194
225
  Once `shared.md` exists and `validate-shared.sh` passed: skip Phases 4–9.5 entirely. Then:
@@ -207,7 +238,7 @@ Once `shared.md` exists and `validate-shared.sh` passed: skip Phases 4–9.5 ent
207
238
  Use **ask the user**. Question: "Research complete for [feature-name]. Review the shared context before planning?" Options:
208
239
 
209
240
  1. **Continue to planning** — proceed to Phase 5.
210
- 2. **Review shared.md first** — display `${feature_dir}/shared.md`, then re-prompt with the same question.
241
+ 2. **Review shared.md first** — display `${shared_file}`, then re-prompt with the same question.
211
242
  3. **Stop here** — display the research-phase completion summary and end the workflow. **STOP** — do not proceed to planning.
212
243
 
213
244
 
@@ -220,7 +251,7 @@ This phase must run in standard mode, including under `--plan-only` (which skips
220
251
 
221
252
  ### Step 18: Read Analysis Prompts
222
253
 
223
- Read `{{package-root}}/skills/plan-workflow/references/planning-agents.md` — read when spawning Phase 5 analysis agents (standard mode). Same variables: `{{FEATURE_NAME}}`, `{{FEATURE_DIR}}`.
254
+ Read `{{package-root}}/skills/plan-workflow/references/planning-agents.md` — read when spawning Phase 5 analysis agents (standard mode). Substitute `{{FEATURE_NAME}}`, `{{FEATURE_DIR}}`, `{{RESEARCH_DIR}}` (`${research_dir}`), and the three `{{ANALYSIS_<NAME>_FILE}}` paths resolved without `--ensure` using kinds `analysis-context`, `analysis-code`, and `analysis-tasks` with the same store override.
224
255
 
225
256
  ### Step 20: Spawn Analysis Agents
226
257
 
@@ -244,10 +275,10 @@ If a child report is empty or contentless, record its `sessionID`, inspect the d
244
275
 
245
276
  ```bash
246
277
  # Standard mode (3-file set: analysis-context, analysis-code, analysis-tasks):
247
- {{package-root}}/skills/plan-workflow/scripts/validate-analysis-artifacts.sh "${feature_dir}"
278
+ {{package-root}}/skills/plan-workflow/scripts/validate-analysis-artifacts.sh "${feature_dir}" ${STORE_FLAG}
248
279
 
249
280
  # Optimized mode (5-file unified set):
250
- {{package-root}}/skills/plan-workflow/scripts/validate-analysis-artifacts.sh "${feature_dir}" --optimized
281
+ {{package-root}}/skills/plan-workflow/scripts/validate-analysis-artifacts.sh "${feature_dir}" --optimized ${STORE_FLAG}
251
282
  ```
252
283
 
253
284
  Pass → Step 22. Fail → fix loop (gate 9), re-validate.
@@ -256,10 +287,10 @@ Pass → Step 22. Fail → fix loop (gate 9), re-validate.
256
287
 
257
288
  ```bash
258
289
  # Standard mode:
259
- {{package-root}}/skills/plan-workflow/scripts/persist-or-fail.sh "${feature_dir}"
290
+ {{package-root}}/skills/plan-workflow/scripts/persist-or-fail.sh "${feature_dir}" ${STORE_FLAG}
260
291
 
261
292
  # Optimized mode:
262
- {{package-root}}/skills/plan-workflow/scripts/persist-or-fail.sh "${feature_dir}" --optimized
293
+ {{package-root}}/skills/plan-workflow/scripts/persist-or-fail.sh "${feature_dir}" --optimized ${STORE_FLAG}
263
294
  ```
264
295
 
265
296
  Exit 0 → Phase 7. Exit 1 → prints `MISSING_FILES` and `ACTION_REQUIRED`; re-dispatch the failing agent, re-run until exit 0 (gate 7). In optimized mode the `MISSING_FILES` set is the 5 unified files.
@@ -284,7 +315,7 @@ Read `{{package-root}}/skills/plan-workflow/references/plan-structure.md` — re
284
315
 
285
316
  ### Step 26: Generate parallel-plan.md
286
317
 
287
- Create `${feature_dir}/parallel-plan.md` following the template exactly. Required sections: Title & Overview (3-4 information-dense sentences); Critically Relevant Files and Documentation; Implementation Plan with Phases and Tasks; Advice section.
318
+ Create `${parallel_plan_file}` following the template exactly. Required sections: Title & Overview (3-4 information-dense sentences); Critically Relevant Files and Documentation; Implementation Plan with Phases and Tasks; Advice section.
288
319
 
289
320
 
290
321
  ### Step 27: Plan Structure Check (deferred)
@@ -328,11 +359,13 @@ Fix issues: correct invalid file paths, resolve circular dependencies, add missi
328
359
  After all fixes, run once on the final artifact (before visual/completion):
329
360
 
330
361
  ```bash
331
- {{package-root}}/skills/plan-workflow/scripts/validate-workflow-plan.sh "${feature_dir}/parallel-plan.md"
362
+ {{package-root}}/skills/plan-workflow/scripts/validate-workflow-plan.sh "${parallel_plan_file}" ${STORE_FLAG}
332
363
  ```
333
364
 
334
365
  Fix any structural errors it reports (missing `### Phase` is an error); do not proceed until it exits 0.
335
366
 
367
+ In linear mode, follow artifact-store.md section **Planning skills** to Save the validated `parallel-plan` document and create/update task sub-issues with `blocks` relations mirroring dependency batches. Analysis files are not saved to Linear.
368
+
336
369
  ## Phase 9.5: Visual Mode (if --visual)
337
370
 
338
371
  Runs only after the plan is written (Phase 8) and validated (Phases 8–9). It never re-orders, re-runs, or substitutes for any earlier phase. See `{{package-root}}/shared/references/visual-mode.md`.
@@ -344,7 +377,7 @@ Runs only after the plan is written (Phase 8) and validated (Phases 8–9). It n
344
377
  - Otherwise invoke `visual-plan` on the **actual written plan path** (feature-dir plan resolved in Phase 0, not a hardcoded `docs/prps/plans` path):
345
378
 
346
379
  ```
347
- visual-plan "${feature_dir}/parallel-plan.md"
380
+ visual-plan ${STORE_FLAG} "${parallel_plan_file}"
348
381
  ```
349
382
 
350
383
  `visual-plan` derives its `visual/` output directory from the supplied plan path and prints the resulting link (hosted URL, localhost preview, or `local files only`). Surface that link in the Phase 10 summary; do not re-derive the path yourself; do not edit the plan file.
@@ -353,7 +386,7 @@ visual-plan "${feature_dir}/parallel-plan.md"
353
386
 
354
387
  ### Step 34: Display Completion Summary
355
388
 
356
- Skipped when `RESEARCH_ONLY=true` (workflow ended at Step 15A) or the user stopped at the checkpoint. Otherwise use the "Full Workflow Complete Summary" block in `references/checkpoint-messages.md` — read when emitting the final summary. List only files this run actually created (`--plan-only`: omit Research Phase files; `--research-only` never reaches here).
389
+ Skipped when `RESEARCH_ONLY=true` or the user stopped at the checkpoint. Otherwise use the "Full Workflow Complete Summary" in `references/checkpoint-messages.md`. List only files actually created (`--plan-only`: omit Research Phase files). In linear mode replace its implementation command with `/ycc:implement-plan --store=linear <feature-slug>`.
357
390
 
358
391
  ## Optimized Mode
359
392
 
@@ -378,7 +411,9 @@ With `--optimized`, deploy 5 unified agents instead of separate research (4) + a
378
411
 
379
412
  ## Output Contract
380
413
 
381
- All files are written to `${feature_dir}/` (resolved via `resolve-plans-dir.sh`).
414
+ Files use the paths resolved in Phase 0: research files under `${research_dir}/`, shared at `${shared_file}`, analysis and plan under `${feature_dir}/`, with the final plan at `${parallel_plan_file}`. Linear mode (default) resolves under `.ycc/artifacts/<feature>/`; local mode preserves the filenames below and their existing paths.
415
+
416
+ Before printing dry-run or completion templates, substitute `{{RESEARCH_DIR}}` with `${research_dir}` and `{{FEATURE_DIR}}` with `${feature_dir}`.
382
417
 
383
418
  | File | Producer | Required Before |
384
419
  | -------------------------- | ----------------------- | --------------------------- |
@@ -402,7 +437,7 @@ Contract rules:
402
437
 
403
438
  ## Monorepo Support
404
439
 
405
- Plans default to the git repository root `docs/plans/`, regardless of the subdirectory the skill runs from; `resolve-plans-dir.sh` handles detection. A `.plans-config` file customizes it — repo root (`plans_dir: docs/plans`) for centralized plans, or package-level (`plans_dir: docs/plans` + `scope: local`) for local plans.
440
+ In local mode, plans resolve through `resolve-artifact-store.sh` to the same git repository root `docs/plans/` as before, regardless of the subdirectory the skill runs from. A `.plans-config` file customizes it — repo root (`plans_dir: docs/plans`) for centralized plans, or package-level (`plans_dir: docs/plans` + `scope: local`) for local plans. In linear mode (the default) the same root resolution selects the `.ycc/artifacts/` cache; `store: local` opts out.
406
441
 
407
442
  ## Notes
408
443
 
@@ -12,6 +12,8 @@
12
12
 
13
13
  Templates for user interaction points during the unified planning workflow.
14
14
 
15
+ `{{RESEARCH_DIR}}` is the resolved research directory: equal to `{{FEATURE_DIR}}` in local mode, or `{{FEATURE_DIR}}/research` in linear mode. Other artifacts use their resolved feature-directory paths.
16
+
15
17
  ---
16
18
 
17
19
  ## Dry Run Output
@@ -74,10 +76,10 @@ Agents to deploy:
74
76
 
75
77
  ### Research Files
76
78
 
77
- - {{FEATURE_DIR}}/research-architecture.md
78
- - {{FEATURE_DIR}}/research-patterns.md
79
- - {{FEATURE_DIR}}/research-integration.md
80
- - {{FEATURE_DIR}}/research-docs.md
79
+ - {{RESEARCH_DIR}}/research-architecture.md
80
+ - {{RESEARCH_DIR}}/research-patterns.md
81
+ - {{RESEARCH_DIR}}/research-integration.md
82
+ - {{RESEARCH_DIR}}/research-docs.md
81
83
  - {{FEATURE_DIR}}/shared.md
82
84
 
83
85
  ### Analysis Files (Standard Mode)
@@ -141,10 +143,10 @@ Display after research phase (if --research-only or user stops at checkpoint):
141
143
 
142
144
  Standard mode:
143
145
 
144
- - {{FEATURE_DIR}}/research-architecture.md - System structure analysis
145
- - {{FEATURE_DIR}}/research-patterns.md - Coding patterns identified
146
- - {{FEATURE_DIR}}/research-integration.md - APIs and integrations
147
- - {{FEATURE_DIR}}/research-docs.md - Relevant documentation
146
+ - {{RESEARCH_DIR}}/research-architecture.md - System structure analysis
147
+ - {{RESEARCH_DIR}}/research-patterns.md - Coding patterns identified
148
+ - {{RESEARCH_DIR}}/research-integration.md - APIs and integrations
149
+ - {{RESEARCH_DIR}}/research-docs.md - Relevant documentation
148
150
  - {{FEATURE_DIR}}/shared.md - Consolidated shared context
149
151
 
150
152
  Optimized mode (`--research-only --optimized`) — no `research-*.md`; the unified artifacts are:
@@ -197,10 +199,10 @@ Display after all phases complete:
197
199
 
198
200
  ### Research Phase
199
201
 
200
- - {{FEATURE_DIR}}/research-architecture.md
201
- - {{FEATURE_DIR}}/research-patterns.md
202
- - {{FEATURE_DIR}}/research-integration.md
203
- - {{FEATURE_DIR}}/research-docs.md
202
+ - {{RESEARCH_DIR}}/research-architecture.md
203
+ - {{RESEARCH_DIR}}/research-patterns.md
204
+ - {{RESEARCH_DIR}}/research-integration.md
205
+ - {{RESEARCH_DIR}}/research-docs.md
204
206
  - {{FEATURE_DIR}}/shared.md
205
207
 
206
208
  ### Analysis Phase
@@ -244,12 +246,18 @@ Optimized mode — the five unified files replace both the research and analysis
244
246
 
245
247
  ## Next Steps
246
248
 
247
- The implementation plan is ready. Run:
249
+ In local mode only, print:
248
250
 
249
251
  /ycc:implement-plan {{FEATURE_NAME}}
250
252
 
251
253
  This will execute the plan with parallel agents where dependencies allow.
252
254
 
255
+ In linear mode, replace that command with:
256
+
257
+ /ycc:implement-plan --store=linear {{FEATURE_NAME}}
258
+
259
+ This loads the plan from the Linear artifact-store cache and executes it with parallel agents where dependencies allow.
260
+
253
261
  To review the plan:
254
262
 
255
263
  cat {{FEATURE_DIR}}/parallel-plan.md
@@ -347,7 +355,7 @@ Examples of valid names:
347
355
  Read when the feature name is missing; abort with this complete usage block.
348
356
 
349
357
  ```
350
- Usage: /ycc:plan-workflow [options] [--visual] [feature-name]
358
+ Usage: /ycc:plan-workflow [options] [--visual] [--store=local|linear] [feature-name]
351
359
 
352
360
  Options:
353
361
  --research-only Stop after research phase (creates shared.md only)
@@ -358,6 +366,7 @@ Options:
358
366
  --worktree (legacy — now default; safe to omit) Worktree annotations emitted by default
359
367
  --no-worktree Opt out of worktree annotations in the generated parallel-plan.md
360
368
  --visual Render the finished plan as a visual artifact via visual-plan (local-files by default; hosted link requires --share)
369
+ --store=local|linear Optional artifact-store override (default: linear)
361
370
 
362
371
  Examples:
363
372
  /ycc:plan-workflow user-authentication
@@ -223,7 +223,7 @@ Format exactly as defined in
223
223
  All tasks — parallel and sequential — share this single feature worktree. Do **not**
224
224
  add a `**Children**:` list. Do **not** add per-task `**Worktree**:` lines.
225
225
 
226
- > **Plan-file handoff**: leave `parallel-plan.md` and `shared.md` in `docs/plans/<feature-slug>/` (main checkout). The implementor (`implement-plan` / `prp-implement`) will **move** them into the feature worktree once created — never copied or synced. See `worktree-strategy.md` §7.
226
+ > **Plan-file handoff**: in local mode, leave `parallel-plan.md` and `shared.md` at their resolved paths in the current checkout (default `docs/plans/<feature-slug>/`). The implementor (`implement-plan` / `prp-implement`) will **move** them into the feature worktree once created — never copied or synced. In linear mode (the default), never move the cache; print `/ycc:implement-plan --store=linear <feature-slug>` as the next step (the implementor loads the plan from the cache). See `worktree-strategy.md` §7 and artifact-store.md "Worktrees".
227
227
 
228
228
  **Plan-generation agent prompt** (both standalone Path A Path B): by default (`WORKTREE_MODE=true`), append the following directive to the plan-generation prompt. Omit when `--no-worktree` was passed (`WORKTREE_MODE=false`):
229
229