@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
@@ -11,13 +11,14 @@ description: Reviews uncommitted changes inline without saving by default. Use w
11
11
 
12
12
  Interactive low-friction review of uncommitted changes. Output is **inline**. The default fix path is artifact-free.
13
13
 
14
- **Operational context:** "Apply fixes" delegates inline findings to /ycc:quick-fix without an artifact; "Save to file" saves under docs/prps/reviews/; "Write file and apply fixes" saves an artifact and delegates to /review-fix. Writes require confirmation unless a documented scripted action selects them.
14
+ **Operational context:** "Apply fixes" delegates inline findings to /ycc:quick-fix without an artifact; "Save to file" saves a review artifact through the artifact store (local mode: docs/prps/reviews/); "Write file and apply fixes" saves an artifact and delegates to /review-fix. Writes require confirmation unless a documented scripted action selects them.
15
15
 
16
16
  **Input**: `$ARGUMENTS`
17
17
 
18
18
  **Core rule**: "Apply fixes" must not write a review artifact. It hands the
19
19
  inline findings directly to `/ycc:quick-fix`. Only "Save to file" and
20
- "Write file and apply fixes" write `docs/prps/reviews/quick-*.md`.
20
+ "Write file and apply fixes" write the `quick-*-review.md` artifact (kind
21
+ `review-quick-<TIMESTAMP>`; local mode `docs/prps/reviews/quick-*.md`).
21
22
 
22
23
  ---
23
24
 
@@ -33,10 +34,12 @@ Extract flags from `$ARGUMENTS`:
33
34
  | `--write-and-apply` | Skip the confirmation prompt, write the review artifact, then hand off to `/ycc:review-fix`. Mutually exclusive with `--yes` and `--save`. |
34
35
  | `--severity <level>` | Forwarded to `/ycc:quick-fix` or `/ycc:review-fix` during hand-off. Valid: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`. Default: `HIGH`. Ignored on "Save to file" / "Discard". |
35
36
  | `--no-worktree` | Accepted as a **no-op**. Quick mode never creates a worktree. Emit a note: `--no-worktree has no effect in quick mode.` |
37
+ | `--store=<mode>` | Artifact store override, `local` or `linear`. Forwarded to `/ycc:review-fix` on "Write file and apply fixes". |
36
38
 
37
39
  Strip these from `$ARGUMENTS` and set `PARALLEL_MODE`, ``,
38
40
  `AUTO_YES`, `AUTO_SAVE`, `AUTO_WRITE_AND_APPLY`, and `MIN_SEVERITY` (default
39
- `HIGH`). The remaining text MUST be empty; if not, abort with:
41
+ `HIGH`). Keep `--store=local|linear` verbatim as `STORE_FLAG` (empty when
42
+ absent). The remaining text MUST be empty; if not, abort with:
40
43
 
41
44
  ```
42
45
  Error: /ycc:quick-review takes no positional argument (only flags).
@@ -148,7 +151,7 @@ options:
148
151
  - label: "Apply fixes"
149
152
  description: "Hand findings directly to /quick-fix. No review file is written. (recommended)"
150
153
  - label: "Save to file"
151
- description: "Write docs/prps/reviews/quick-<timestamp>-review.md and stop."
154
+ description: "Write the quick-<timestamp>-review.md artifact (local mode: docs/prps/reviews/) and stop."
152
155
  - label: "Discard"
153
156
  description: "Write nothing, exit"
154
157
  ```
@@ -162,9 +165,9 @@ options:
162
165
  - label: "Apply fixes"
163
166
  description: "Hand findings directly to /quick-fix. No review file is written."
164
167
  - label: "Write file and apply fixes"
165
- description: "Write docs/prps/reviews/quick-<timestamp>-review.md, then use /ycc:review-fix for an audit trail. (recommended)"
168
+ description: "Write the quick-<timestamp>-review.md artifact, then use /ycc:review-fix for an audit trail. (recommended)"
166
169
  - label: "Save to file"
167
- description: "Write docs/prps/reviews/quick-<timestamp>-review.md and stop."
170
+ description: "Write the quick-<timestamp>-review.md artifact (local mode: docs/prps/reviews/) and stop."
168
171
  - label: "Discard"
169
172
  description: "Write nothing, exit"
170
173
  ```
@@ -188,8 +191,10 @@ Reply synonyms (case-insensitive):
188
191
  ## Phase 5 — HAND-OFF
189
192
 
190
193
  Branch on the user's selection (or auto-confirm flag). If `PARALLEL_MODE=true`
191
- (Path B was used), remove the `docs/prps/reviews/.review-scratch/quick-<TIMESTAMP>/`
192
- scratch directory before exiting — **regardless of which branch below is
194
+ (Path B was used), remove the scratch directory with `rm -rf <SCRATCH_DIR>`,
195
+ passing its literal absolute path (the allowed `rm` forms cover only
196
+ `/tmp/ycc-quick-review.*` and `*/docs/prps/reviews/.review-scratch/quick-*`),
197
+ before exiting — **regardless of which branch below is
193
198
  taken**, including "Discard" and "Apply fixes".
194
199
 
195
200
  ### Selection: "Discard"
@@ -217,30 +222,59 @@ Exit.
217
222
 
218
223
  ### Selection: "Save to file"
219
224
 
220
- Write the artifact to disk using the Phase 3 content plus the canonical header
221
- block:
222
-
223
- ```bash
224
- mkdir -p docs/prps/reviews
225
- TIMESTAMP=$(date +%Y%m%d-%H%M%S) # reuse the Path C timestamp if set
226
- REVIEW_FILE="docs/prps/reviews/quick-${TIMESTAMP}-review.md"
227
- ```
225
+ Write the artifact through the artifact store using the Phase 3 content plus
226
+ the canonical header block:
227
+
228
+ 1. Reuse the Path B/C `TIMESTAMP` if set; otherwise
229
+ `TIMESTAMP=$(date +%Y%m%d-%H%M%S)`.
230
+ 2. Print the mode; read `ARTIFACT_STORE=` from stdout:
231
+ `"{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --shell`
232
+ 3. Slug: local mode uses `review` (validated only; the path ignores it).
233
+ Linear mode applies the **Linear call gate** from
234
+ `{{package-root}}/shared/references/artifact-store.md`, then
235
+ takes the slug from its Slugs rules 2-5 (no feature name).
236
+ 4. Resolve and create the destination:
237
+
238
+ ```bash
239
+ REVIEW_FILE="$("{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --ensure --kind=review-quick-${TIMESTAMP} --slug=<slug>)"
240
+ mkdir -p "$(dirname "$REVIEW_FILE")"
241
+ ```
242
+
243
+ Local mode: unchanged path `docs/prps/reviews/quick-${TIMESTAMP}-review.md`
244
+ under the current checkout's toplevel, no identity frontmatter, no Linear
245
+ calls. Linear mode: `.ycc/artifacts/<slug>/reviews/quick-${TIMESTAMP}-review.md`
246
+ (gitignored). When the rule-only `.gitignore` check (artifact-store.md >
247
+ Reviews) holds, print
248
+ `Note: .gitignore gained the .ycc/artifacts/ rule from the artifact store; leave it out of PR commits.`
249
+
250
+ `DISPLAY_FILE` is the printed form: local mode
251
+ `docs/prps/reviews/quick-${TIMESTAMP}-review.md` (toplevel-relative, as
252
+ before); linear mode the absolute `$REVIEW_FILE`.
228
253
 
229
254
  Write the same artifact content that was printed in Phase 3, but set
230
255
  `**Decision**: COMMENT` in the header (since a review was produced but no
231
256
  GitHub decision is being posted).
232
257
 
258
+ Linear mode: follow artifact-store.md > Review and report skills > Reviews
259
+ (Lookup/Load identity, then Save) for Document `<slug> · quick-<TIMESTAMP>-review`.
260
+ Parent: the verified `ARTIFACT_LINEAR_HINT` issue, else the feature Project,
261
+ else none: keep the file local only and print
262
+ `Review kept local: no Linear issue or Project.`
263
+
233
264
  Print:
234
265
 
235
266
  ```
236
- Quick review written to: docs/prps/reviews/quick-<TIMESTAMP>-review.md
267
+ Quick review written to: <DISPLAY_FILE>
237
268
  Findings: [C] {critical_count} [H] {high_count} [M] {medium_count} [L] {low_count}
238
269
 
239
270
  Next steps:
240
- /ycc:review-fix docs/prps/reviews/quick-<TIMESTAMP>-review.md # apply fixes {recommended_single if 1-2 Open findings}
241
- /ycc:review-fix docs/prps/reviews/quick-<TIMESTAMP>-review.md --parallel # fan out fixes {recommended_parallel if 3+ Open across 2+ files}
271
+ /ycc:review-fix <DISPLAY_FILE> # apply fixes {recommended_single if 1-2 Open findings}
272
+ /ycc:review-fix <DISPLAY_FILE> --parallel # fan out fixes {recommended_parallel if 3+ Open across 2+ files}
242
273
  ```
243
274
 
275
+ `<DISPLAY_FILE>` is defined in step 4; in linear mode also print the
276
+ Document URL when saved.
277
+
244
278
  Annotate ONE command with `# <- recommended`:
245
279
 
246
280
  - 1-2 Open findings -> recommend the single-pass form.
@@ -256,15 +290,15 @@ Step 1 — write the artifact to disk exactly as in "Save to file".
256
290
  Step 2 — invoke the `review-fix` skill inline via the `Skill` tool:
257
291
 
258
292
  - `skill`: `"review-fix"`
259
- - `args`: `"<REVIEW_FILE> [--parallel] [--severity <level>]"`
293
+ - `args`: `"<REVIEW_FILE> [--parallel] [--severity <level>] [--store=<mode>]"`
260
294
 
261
295
  Forward `--parallel` if `PARALLEL_MODE=true`. Forward `--severity <level>` when
262
- `MIN_SEVERITY != HIGH`.
296
+ `MIN_SEVERITY != HIGH`. Forward `STORE_FLAG` when set.
263
297
 
264
298
  Step 3 — after the Skill call returns, print:
265
299
 
266
300
  ```
267
- Fixes complete. Review artifact updated in place: docs/prps/reviews/quick-<TIMESTAMP>-review.md
301
+ Fixes complete. Review artifact updated in place: <DISPLAY_FILE>
268
302
  ```
269
303
 
270
304
  Step 4 — exit.
@@ -277,10 +311,12 @@ fix phase has its own execution decision.
277
311
  ## Important Notes
278
312
 
279
313
  - **Apply fixes is artifact-free**: direct apply routes to `/ycc:quick-fix`
280
- without writing `docs/prps/reviews/quick-*.md`.
314
+ without writing a `quick-*-review.md` artifact.
281
315
  - **Scratch is the one ephemeral exception**: when Path B (`--parallel`) is
282
316
  used, the calling skill persists each valid inline return to its scratch copy
283
- at `docs/prps/reviews/.review-scratch/quick-<TIMESTAMP>/<reviewer-name>.md`
317
+ at `$SCRATCH_DIR/<reviewer-name>.md` (local mode:
318
+ `docs/prps/reviews/.review-scratch/quick-<TIMESTAMP>/`; linear mode: a
319
+ `mktemp -d` directory outside the repository; never pushed)
284
320
  during the `subagent` dispatch in Phase 2. It is always deleted at the end of
285
321
  Phase 5 before the skill returns control to the user — including on
286
322
  "Discard" and "Apply fixes" — so the "no file written" guarantee still
@@ -303,4 +339,5 @@ fix phase has its own execution decision.
303
339
  - `/ycc:code-review --quick` delegates to this skill.
304
340
  - `/ycc:quick-fix` consumes inline findings for artifact-free fixing.
305
341
  - `/ycc:review-fix` consumes written artifacts only.
306
- - `/ycc:prp-commit` or `/ycc:git-workflow --commit` can commit the fixes afterward.
342
+ - Commit the fixes afterward by explicit path: `/ycc:prp-commit <fixed files>`,
343
+ never a stage-everything commit.
@@ -315,7 +315,7 @@ detect_ci() {
315
315
  [[ -z "$file" ]] && continue
316
316
  scan="$(scan_workflow "$file")"
317
317
  branches="${branches}$(printf '%s\n' "$scan" | sed -n 's/^B //p')"$'\n'
318
- if [[ -z "$publish" ]] && printf '%s\n' "$scan" | grep -qE '^(T|R)$'; then
318
+ if [[ -z "$publish" ]] && grep -qE '^(T|R)$' <<<"$scan"; then
319
319
  publish="${file#"${ROOT}"/}"
320
320
  fi
321
321
  done < <(workflow_files)
@@ -389,10 +389,16 @@ detect_sync_merges() {
389
389
 
390
390
  detect_linear_refs() {
391
391
  local base="$1" key_re='(^|[^A-Za-z0-9])[A-Z]{2,}-[0-9]+' deny_re='(CVE|UTF|ISO|RFC|SHA|PEP)-[0-9]'
392
- if {
392
+ # Capture each stage and match with here-strings, not a pipeline ending in
393
+ # `grep -q`: under pipefail the early-exiting reader SIGPIPEs the writer on
394
+ # repos with many refs and a present key reads as absent (YAN-1587).
395
+ local names filtered
396
+ names="$({
393
397
  g log -n "$RECENT_COMMITS" --format='%s' "$base" 2>/dev/null
394
398
  g for-each-ref --format='%(refname:short)' refs/heads refs/remotes
395
- } | grep -Ev "$deny_re" | grep -Eq "$key_re"; then
399
+ } || true)"
400
+ filtered="$(grep -Ev "$deny_re" <<<"$names" || true)"
401
+ if grep -Eq "$key_re" <<<"$filtered"; then
396
402
  echo 1
397
403
  else
398
404
  echo 0
@@ -21,7 +21,6 @@ SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
21
21
  # plugin-root install path; fall back to the source-tree relative path.
22
22
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
23
23
  FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
24
- [[ -f "$FORGE_LIB" ]] || FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
25
24
  # shellcheck source=/dev/null
26
25
  source "$FORGE_LIB"
27
26
 
@@ -219,8 +218,12 @@ if [[ "${PROVIDER}" == "github" ]]; then
219
218
  fi
220
219
  else
221
220
  # tea has no per-tag "view"; list releases as JSON and match the tag_name.
222
- if tea release list --output json 2>/dev/null \
223
- | grep -qE "\"tag_name\"[[:space:]]*:[[:space:]]*\"${TAG}\""; then
221
+ # Capture the list first and match with a here-string, not
222
+ # `tea ... | grep -q`: under pipefail the early-exiting grep SIGPIPEs tea
223
+ # on a large release list and an existing release reads as absent
224
+ # (YAN-1587).
225
+ TEA_RELEASES="$(tea release list --output json 2>/dev/null || true)"
226
+ if grep -qE "\"tag_name\"[[:space:]]*:[[:space:]]*\"${TAG}\"" <<<"${TEA_RELEASES}"; then
224
227
  RELEASE_EXISTS=1
225
228
  fi
226
229
  fi
@@ -11,13 +11,13 @@ Convert planning and research output into structured GitHub issues with tracking
11
11
 
12
12
  ## Supported Source Types
13
13
 
14
- | Source Type | Produced By | Input Path Pattern |
15
- | ------------- | ---------------------------------------- | ----------------------------------- |
16
- | deep-research | `deep-research` | Directory with `RESEARCH-REPORT.md` |
17
- | feature-spec | `feature-research` | `docs/plans/*/feature-spec.md` |
18
- | parallel-plan | `parallel-plan`, `plan-workflow` | `docs/plans/*/parallel-plan.md` |
19
- | prp-plan | `prp-plan` | `docs/prps/plans/*.plan.md` |
20
- | prd | `prp-prd` | `docs/prps/prds/*.prd.md` |
14
+ | Source Type | Produced By | Input Path Pattern (local mode) | Linear cache (linear mode) |
15
+ | ------------- | ---------------------------------------- | ----------------------------------- | ------------------------------------------------ |
16
+ | deep-research | `deep-research` | Directory with `RESEARCH-REPORT.md` | Directory with `RESEARCH-REPORT.md` (`--source`) |
17
+ | feature-spec | `feature-research` | `docs/plans/*/feature-spec.md` | `.ycc/artifacts/<slug>/feature-spec.md` |
18
+ | parallel-plan | `parallel-plan`, `plan-workflow` | `docs/plans/*/parallel-plan.md` | `.ycc/artifacts/<slug>/parallel-plan.md` |
19
+ | prp-plan | `prp-plan` | `docs/prps/plans/*.plan.md` | `.ycc/artifacts/<slug>/prp-plan.md` |
20
+ | prd | `prp-prd` | `docs/prps/prds/*.prd.md` | `.ycc/artifacts/<slug>/prd.md` |
21
21
 
22
22
  ## Current Task
23
23
 
@@ -26,7 +26,9 @@ Convert planning and research output into structured GitHub issues with tracking
26
26
  Parse arguments:
27
27
 
28
28
  - **--source PATH**: Path to source file or directory (aliases: `--research-dir`)
29
- - **--type TYPE**: Explicit source type (`deep-research`, `feature-spec`, `parallel-plan`, `prp-plan`). Auto-detected if omitted.
29
+ - **feature-name** or **Linear reference** (positional, optional): resolved through the artifact store in Step 1
30
+ - **--type TYPE**: Explicit source type (`deep-research`, `feature-spec`, `parallel-plan`, `prp-plan`, `prd`). Auto-detected if omitted.
31
+ - **--store=local|linear**: Artifact-store override; strip it into `STORE_FLAG` (empty when absent) and forward it to every resolver call
30
32
  - **--dry-run**: Preview all issues that would be created without creating them
31
33
  - **--skip-anti-scope**: Skip creating issues for anti-scope/deferred items
32
34
  - **--skip-gaps**: Skip creating issues for research gaps
@@ -74,11 +76,26 @@ Check if GitHub MCP tools are available by looking for tools matching `mcp__gith
74
76
 
75
77
  ### Step 1: Identify Source
76
78
 
77
- Determine the source path:
79
+ Determine the source path through the artifact store (`{{package-root}}/shared/references/artifact-store.md` > Review and report skills > Research to issues). First print the mode and read `ARTIFACT_STORE=` from stdout:
78
80
 
79
- 1. If `--source PATH` or `--research-dir PATH` is specified, use that path
80
- 2. Otherwise, search for common locations: `docs/plans/`, `docs/prps/plans/`, `docs/prps/prds/`, `docs/research/`, `research/`
81
- 3. If not found, ask the user to specify the path
81
+ ```bash
82
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --shell
83
+ ```
84
+
85
+ 1. `--source PATH` or `--research-dir PATH` → use that path. A path under `.ycc/artifacts/` or with a leading `linear:` frontmatter block is a linear source; any other path keeps local behavior.
86
+ 2. A Linear reference (issue key, `linear.app` issue/Project/Document URL, as defined in artifact-store.md > Implementation skills > Inputs) selects linear mode (`STORE_FLAG=--store=linear` when empty; with `--store=local`, abort with `A Linear plan reference requires linear mode; drop --store=local.`). Apply the **Linear call gate**, then follow Implementation skills > Resolve and hydrate steps 2-3: Lookup the source kind (`--type`, else `parallel-plan`, then `prp-plan`, `feature-spec`, `prd`), map the hit to a slug, and Load it into `--ensure --kind=<kind> --slug=<slug>`. Use that absolute cache path. `--dry-run` writes nothing: reuse an existing cache read-only, or read the fetched body from a temporary file outside the repository.
87
+ 3. A feature name → resolve each candidate kind without `--ensure`, in the same order as item 2 (`--type` first when given, else `parallel-plan`, `prp-plan`, `feature-spec`, `prd`), and use the first existing file, so a plan with a `tasks` map wins over its feature spec:
88
+
89
+ ```bash
90
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --kind=<parallel-plan|prp-plan|feature-spec|prd> --slug=<feature-name>
91
+ ```
92
+
93
+ Under `ARTIFACT_STORE_SOURCE=default`, an existing local `docs/plans/<feature-name>/` (or `docs/prps/` file) keeps local mode, as in Implementation skills > Inputs. In linear mode, a missing cache runs Lookup/Load as in item 2 (gate first); never report "not found" without querying Linear.
94
+
95
+ 4. Otherwise, local mode searches the common locations: `docs/plans/`, `docs/prps/plans/`, `docs/prps/prds/`, `docs/research/`, `research/`. Linear mode searches `.ycc/artifacts/*/` in the current checkout, then the main checkout, then runs Lookup.
96
+ 5. If not found, ask the user to specify the path
97
+
98
+ Local mode keeps today's discovery, output, and Linear-free behavior unchanged. Retain the source's leading frontmatter `linear.issue` and `tasks` map (linear sources only) for Step 6.
82
99
 
83
100
  ### Step 2: Run Validation
84
101
 
@@ -136,6 +153,8 @@ Construct a complete plan:
136
153
  - **For each child item** -> 1 child issue with full agentic context
137
154
  - **For each extra item** -> 1 child issue grouped under appropriate tracker
138
155
 
156
+ **Linear task links (linear-sourced plans only).** Linear task issues are created by the planning skill's Save, never here: this skill creates GitHub/Forgejo issues only and makes no Linear writes. When the plan frontmatter has a `tasks` map, add `Refs <KEY>` (that task's `tasks.<id>.issue`, keyed by the literal task heading id) to each child issue whose task id is mapped, and add `Refs <linear.issue>` to every tracking issue when `linear.issue` is set. Unmapped tasks get no Linear line. Local-mode sources never get these lines.
157
+
139
158
  ### Step 7: Compute Labels
140
159
 
141
160
  Collect all unique labels needed. Read `{{package-root}}/skills/research-to-issues/references/label-taxonomy.md` for the full color scheme. Always include the `source:{type}` provenance label.
@@ -196,7 +215,7 @@ Same process as Step 11 for anti-scope items, research gaps, and decision items
196
215
 
197
216
  ### Step 13: Create Tracking Issues
198
217
 
199
- Compose tracking issue bodies using `{{package-root}}/skills/research-to-issues/templates/tracking-issue.md`. Populate checkbox lists with links to child issue numbers (e.g., `- [ ] #42 Set up data models`).
218
+ Compose tracking issue bodies using `{{package-root}}/skills/research-to-issues/templates/tracking-issue.md`. Populate checkbox lists with links to child issue numbers (e.g., `- [ ] #42 Set up data models`). Include the `Refs <linear.issue>` line from Step 6 when present.
200
219
 
201
220
  **MCP (preferred):** `mcp__github__create_issue` with title `"Phase {N}: {title}"` or `"Batch {N}: {title}"`, body, labels.
202
221
 
@@ -253,7 +272,7 @@ EOF
253
272
  - **Labels are created with --force** -- safe to run multiple times
254
273
  - **Issue order matters** -- create child issues before tracking issues (need issue numbers)
255
274
  - **MCP-first** -- GitHub operations prefer MCP tools with automatic `gh` CLI fallback
256
- - **No implementation** -- this skill creates issues only. It does not write code or create plans.
275
+ - **No implementation** -- this skill creates issues only. It does not write code or create plans, and never creates Linear issues (planning Save owns Linear task issues).
257
276
  - **Templates are guides** -- adapt fields to whatever is actually present in the source
258
277
  - **Agentic-friendly** -- every child issue includes mandatory reading, scope, implementation guidance, and validation criteria to support autonomous engineering workflows
259
278
 
@@ -26,10 +26,15 @@ set -euo pipefail
26
26
  # Detect the forge provider and select the matching CLI (gh / tea).
27
27
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
28
28
  FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
29
- [[ -f "$FORGE_LIB" ]] || FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
30
29
  # shellcheck source=/dev/null
31
30
  source "$FORGE_LIB"
32
31
 
32
+ # Plans are judged by their body: leading identity frontmatter (linear:, tasks:)
33
+ # is metadata and must never satisfy or hide headings and task markers.
34
+ ARTIFACT_BODY_LIB="${SCRIPT_DIR}/../../../shared/scripts/artifact-body.sh"
35
+ # shellcheck source=/dev/null
36
+ source "$ARTIFACT_BODY_LIB"
37
+
33
38
  SOURCE_PATH="${1:-}"
34
39
  EXPLICIT_TYPE=""
35
40
  DETECTED_TYPE=""
@@ -130,20 +135,28 @@ else
130
135
  DETECTED_TYPE="feature-spec"
131
136
  elif [[ "$BASENAME" == "parallel-plan.md" ]]; then
132
137
  DETECTED_TYPE="parallel-plan"
133
- elif [[ "$BASENAME" == *.plan.md ]]; then
138
+ elif [[ "$BASENAME" == *.plan.md || "$BASENAME" == "prp-plan.md" ]]; then
139
+ # prp-plan.md / prd.md are the linear artifact-store cache names.
134
140
  DETECTED_TYPE="prp-plan"
135
- elif [[ "$BASENAME" == *.prd.md ]]; then
141
+ elif [[ "$BASENAME" == *.prd.md || "$BASENAME" == "prd.md" ]]; then
136
142
  DETECTED_TYPE="prd"
137
143
  else
138
- # Content-based fallback: check first 40 lines for signature headers
139
- HEAD_CONTENT=$(head -40 "$SOURCE_PATH" 2>/dev/null || echo "")
140
- if echo "$HEAD_CONTENT" | grep -q "## Critically Relevant Files"; then
144
+ # Content-based fallback: check the first 40 body lines (frontmatter
145
+ # skipped) for signature headers. HEAD_CONTENT is matched with
146
+ # here-strings, not `echo | grep -q`, so pipefail cannot SIGPIPE the
147
+ # writer and misread a present header (YAN-1587).
148
+ if SOURCE_BODY=$(artifact_body "$SOURCE_PATH" 2>/dev/null); then
149
+ HEAD_CONTENT=$(head -40 <<<"$SOURCE_BODY")
150
+ else
151
+ HEAD_CONTENT=""
152
+ fi
153
+ if grep -q "## Critically Relevant Files" <<<"$HEAD_CONTENT"; then
141
154
  DETECTED_TYPE="parallel-plan"
142
- elif echo "$HEAD_CONTENT" | grep -q "## Mandatory Reading\|## Step-by-Step Tasks"; then
155
+ elif grep -q "## Mandatory Reading\|## Step-by-Step Tasks" <<<"$HEAD_CONTENT"; then
143
156
  DETECTED_TYPE="prp-plan"
144
- elif echo "$HEAD_CONTENT" | grep -q "## Problem Statement"; then
157
+ elif grep -q "## Problem Statement" <<<"$HEAD_CONTENT"; then
145
158
  DETECTED_TYPE="prd"
146
- elif echo "$HEAD_CONTENT" | grep -q "## Executive Summary"; then
159
+ elif grep -q "## Executive Summary" <<<"$HEAD_CONTENT"; then
147
160
  DETECTED_TYPE="feature-spec"
148
161
  else
149
162
  ERRORS+=("ERROR: Could not detect source type from file: $BASENAME. Use --type to specify.")
@@ -157,6 +170,15 @@ else
157
170
  if [[ -n "$DETECTED_TYPE" ]]; then
158
171
  echo "DETECTED_TYPE: $DETECTED_TYPE"
159
172
 
173
+ # Read the plan body once for the type-specific checks below (frontmatter
174
+ # skipped). Matched with here-strings, never `artifact_body | grep -q`.
175
+ SOURCE_BODY=""
176
+ if [[ "$DETECTED_TYPE" != "deep-research" && -f "$SOURCE_PATH" ]]; then
177
+ if ! SOURCE_BODY=$(artifact_body "$SOURCE_PATH" 2>/dev/null); then
178
+ ERRORS+=("ERROR: Failed to read source file: $SOURCE_PATH")
179
+ SOURCE_BODY=""
180
+ fi
181
+ fi
160
182
  case "$DETECTED_TYPE" in
161
183
  deep-research)
162
184
  if [[ ! -d "$SOURCE_PATH" ]]; then
@@ -194,12 +216,12 @@ else
194
216
  ERRORS+=("ERROR: feature-spec source must be a file: $SOURCE_PATH")
195
217
  else
196
218
  echo "OK: Source file exists: $SOURCE_PATH"
197
- if grep -q "## Executive Summary" "$SOURCE_PATH" 2>/dev/null; then
219
+ if grep -q "## Executive Summary" <<<"$SOURCE_BODY"; then
198
220
  echo "OK: Contains expected ## Executive Summary header"
199
221
  else
200
222
  ERRORS+=("WARNING: Missing ## Executive Summary header -- file may not be a valid feature-spec")
201
223
  fi
202
- if grep -q "## Task Breakdown Preview\|## Recommendations" "$SOURCE_PATH" 2>/dev/null; then
224
+ if grep -q "## Task Breakdown Preview\|## Recommendations" <<<"$SOURCE_BODY"; then
203
225
  echo "OK: Contains task/recommendation structure"
204
226
  else
205
227
  ERRORS+=("WARNING: Missing task breakdown or recommendations section")
@@ -211,12 +233,12 @@ else
211
233
  ERRORS+=("ERROR: parallel-plan source must be a file: $SOURCE_PATH")
212
234
  else
213
235
  echo "OK: Source file exists: $SOURCE_PATH"
214
- if grep -q "## Critically Relevant Files\|## Implementation Plan" "$SOURCE_PATH" 2>/dev/null; then
236
+ if grep -q "## Critically Relevant Files\|## Implementation Plan" <<<"$SOURCE_BODY"; then
215
237
  echo "OK: Contains expected parallel-plan structure"
216
238
  else
217
239
  ERRORS+=("WARNING: Missing expected parallel-plan headers")
218
240
  fi
219
- TASK_COUNT=$(grep -c "^####.*Task" "$SOURCE_PATH" 2>/dev/null) || TASK_COUNT=0
241
+ TASK_COUNT=$(grep -c "^####.*Task" <<<"$SOURCE_BODY") || TASK_COUNT=0
220
242
  echo "INFO: Found approximately $TASK_COUNT tasks"
221
243
  fi
222
244
  ;;
@@ -225,23 +247,23 @@ else
225
247
  ERRORS+=("ERROR: prp-plan source must be a file: $SOURCE_PATH")
226
248
  else
227
249
  echo "OK: Source file exists: $SOURCE_PATH"
228
- if grep -q "## Step-by-Step Tasks\|## Tasks\|## Summary" "$SOURCE_PATH" 2>/dev/null; then
250
+ if grep -q "## Step-by-Step Tasks\|## Tasks\|## Summary" <<<"$SOURCE_BODY"; then
229
251
  echo "OK: Contains expected PRP plan structure"
230
252
  else
231
253
  ERRORS+=("WARNING: Missing expected PRP plan headers")
232
254
  fi
233
- if grep -q "## Batches" "$SOURCE_PATH" 2>/dev/null; then
255
+ if grep -q "## Batches" <<<"$SOURCE_BODY"; then
234
256
  echo "INFO: Parallel/batch mode detected"
235
257
  else
236
258
  echo "INFO: Sequential mode detected"
237
259
  fi
238
260
  # Detect format variant: standard (### Task N:) or narrative (**TN —)
239
- if grep -q "^### Task [0-9]" "$SOURCE_PATH" 2>/dev/null; then
261
+ if grep -q "^### Task [0-9]" <<<"$SOURCE_BODY"; then
240
262
  echo "INFO: Standard format detected (### Task N: headings)"
241
- TASK_COUNT=$(grep -c "^### Task [0-9]" "$SOURCE_PATH" 2>/dev/null) || TASK_COUNT=0
242
- elif grep -q '^\*\*T[0-9]' "$SOURCE_PATH" 2>/dev/null; then
263
+ TASK_COUNT=$(grep -c "^### Task [0-9]" <<<"$SOURCE_BODY") || TASK_COUNT=0
264
+ elif grep -q '^\*\*T[0-9]' <<<"$SOURCE_BODY"; then
243
265
  echo "INFO: Narrative format detected (**TN bold markers)"
244
- TASK_COUNT=$(grep -c '^\*\*T[0-9]' "$SOURCE_PATH" 2>/dev/null) || TASK_COUNT=0
266
+ TASK_COUNT=$(grep -c '^\*\*T[0-9]' <<<"$SOURCE_BODY") || TASK_COUNT=0
245
267
  else
246
268
  TASK_COUNT=0
247
269
  fi
@@ -253,19 +275,19 @@ else
253
275
  ERRORS+=("ERROR: prd source must be a file: $SOURCE_PATH")
254
276
  else
255
277
  echo "OK: Source file exists: $SOURCE_PATH"
256
- if grep -q "## Problem Statement" "$SOURCE_PATH" 2>/dev/null; then
278
+ if grep -q "## Problem Statement" <<<"$SOURCE_BODY"; then
257
279
  echo "OK: Contains expected ## Problem Statement header"
258
280
  else
259
281
  ERRORS+=("WARNING: Missing ## Problem Statement header -- file may not be a valid PRD")
260
282
  fi
261
- if grep -q "## Implementation Phases" "$SOURCE_PATH" 2>/dev/null; then
283
+ if grep -q "## Implementation Phases" <<<"$SOURCE_BODY"; then
262
284
  echo "OK: Contains Implementation Phases section"
263
- PHASE_COUNT=$(grep -c "^| [0-9]" "$SOURCE_PATH" 2>/dev/null) || PHASE_COUNT=0
285
+ PHASE_COUNT=$(grep -c "^| [0-9]" <<<"$SOURCE_BODY") || PHASE_COUNT=0
264
286
  echo "INFO: Found approximately $PHASE_COUNT phases"
265
287
  else
266
288
  ERRORS+=("WARNING: Missing ## Implementation Phases section")
267
289
  fi
268
- if grep -q "## Success Metrics\|## Key Hypothesis" "$SOURCE_PATH" 2>/dev/null; then
290
+ if grep -q "## Success Metrics\|## Key Hypothesis" <<<"$SOURCE_BODY"; then
269
291
  echo "OK: Contains success/hypothesis structure"
270
292
  else
271
293
  ERRORS+=("WARNING: Missing success metrics or hypothesis section")
@@ -48,6 +48,8 @@ Use this template for implementation task issues created from parallel-plan or P
48
48
  > Extracted from: {source_document}
49
49
  > Task: {task_id} of {total_tasks}
50
50
  > Phase/Batch: {phase_or_batch}
51
+
52
+ {linear_refs_line}
51
53
  ```
52
54
 
53
55
  ## Field Descriptions
@@ -67,6 +69,7 @@ Use this template for implementation task issues created from parallel-plan or P
67
69
  | task_id | "Task N.M" identifier | "Task N" identifier |
68
70
  | total_tasks | Total task count across all phases | Total task count |
69
71
  | phase_or_batch | "Phase N: {name}" | "Batch N" (parallel) or sequential position |
72
+ | linear_refs_line | `Refs <KEY>` from frontmatter `tasks` map | Same |
70
73
 
71
74
  ## Field Adaptation
72
75
 
@@ -77,6 +80,7 @@ Not all fields will be present in every source. Adapt:
77
80
  - If no explicit dependencies, write "None -- this task can start independently"
78
81
  - If mandatory reading is empty, write "No mandatory prereading identified. Review the source document for full context."
79
82
  - For files lists, use relative paths from project root
83
+ - Omit `{linear_refs_line}` for local sources and for tasks absent from the `tasks` map
80
84
 
81
85
  ## Label Assignment Rules
82
86
 
@@ -21,6 +21,8 @@ Use this template for phase-level, batch-level, or cluster-level tracking issues
21
21
 
22
22
  {optional_sections}
23
23
 
24
+ {linear_refs_line}
25
+
24
26
  ## Notes
25
27
 
26
28
  - This is a tracking issue. Individual items are linked above.
@@ -114,6 +116,7 @@ Testing approach and validation commands from the plan.
114
116
  | checkbox_list | Generated from child issues after creation | "- [ ] #12 Set up data models" |
115
117
  | success_criteria | Success criteria, acceptance criteria from source | Bulleted list of criteria |
116
118
  | dependency_summary | Phase/batch dependencies from plan | "Requires Phase 1 complete" |
119
+ | linear_refs_line | `Refs <linear.issue>` (linear sources) | "Refs YAN-1152" |
117
120
 
118
121
  ## Label Assignment
119
122