@yandy-r/ycc-opencode 6.1.1 → 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
@@ -43,8 +43,13 @@ echo -e "${GREEN}=== Commit Message Validation ===${NC}\n"
43
43
  echo "Validating: $COMMIT_MSG"
44
44
  echo ""
45
45
 
46
- # Extract the subject line (first line)
47
- SUBJECT=$(echo "$COMMIT_MSG" | head -n1)
46
+ # Match variables with here-strings, not `echo | grep -q`: under pipefail an
47
+ # early-exiting reader SIGPIPEs the echo writer and a present pattern reads
48
+ # as missing (YAN-1587).
49
+
50
+ # Extract the subject line (first line). Parameter expansion keeps the whole
51
+ # message in memory — no echo writer for an early-exiting head to SIGPIPE.
52
+ SUBJECT="${COMMIT_MSG%%$'\n'*}"
48
53
 
49
54
  # Check if message is empty
50
55
  if [ -z "$SUBJECT" ]; then
@@ -54,7 +59,7 @@ if [ -z "$SUBJECT" ]; then
54
59
  fi
55
60
 
56
61
  # Validate format: <type>(<scope>): <subject> or <type>: <subject>
57
- if ! echo "$SUBJECT" | grep -qE '^[a-z]+(\([a-z0-9-]+\))?!?: .+'; then
62
+ if ! grep -qE '^[a-z]+(\([a-z0-9-]+\))?!?: .+' <<<"$SUBJECT"; then
58
63
  echo -e "${RED}✗ Error: Subject line doesn't match conventional commit format${NC}"
59
64
  echo " Expected: <type>(<scope>): <subject> or <type>: <subject>"
60
65
  echo " Got: $SUBJECT"
@@ -86,23 +91,23 @@ if [ -n "$TYPE" ]; then
86
91
  fi
87
92
 
88
93
  # Extract scope (if present)
89
- if echo "$SUBJECT" | grep -qE '\([a-z0-9-]+\)'; then
94
+ if grep -qE '\([a-z0-9-]+\)' <<<"$SUBJECT"; then
90
95
  SCOPE=$(echo "$SUBJECT" | grep -oE '\([a-z0-9-]+\)' | tr -d '()')
91
96
  echo -e "${GREEN}✓ Scope '$SCOPE' is present${NC}"
92
97
 
93
98
  # Check scope format (lowercase, alphanumeric + hyphens)
94
- if ! echo "$SCOPE" | grep -qE '^[a-z0-9-]+$'; then
99
+ if ! grep -qE '^[a-z0-9-]+$' <<<"$SCOPE"; then
95
100
  echo -e "${YELLOW}⚠ Warning: Scope should be lowercase alphanumeric with hyphens${NC}"
96
101
  WARNINGS=$((WARNINGS + 1))
97
102
  fi
98
103
  fi
99
104
 
100
105
  # Check for breaking change indicator (!)
101
- if echo "$SUBJECT" | grep -qE '!:'; then
106
+ if grep -qE '!:' <<<"$SUBJECT"; then
102
107
  echo -e "${YELLOW}⚠ Breaking change indicator detected (!)${NC}"
103
108
 
104
109
  # Check if BREAKING CHANGE footer is present in full message
105
- if ! echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE:'; then
110
+ if ! grep -qE 'BREAKING CHANGE:' <<<"$COMMIT_MSG"; then
106
111
  echo -e "${YELLOW}⚠ Warning: Breaking change indicator used but no BREAKING CHANGE footer found${NC}"
107
112
  echo " Consider adding: BREAKING CHANGE: <description>"
108
113
  WARNINGS=$((WARNINGS + 1))
@@ -128,7 +133,7 @@ if [ -n "$SUBJECT_TEXT" ]; then
128
133
 
129
134
  # Check if subject starts with uppercase (should be lowercase)
130
135
  FIRST_CHAR=$(echo "$SUBJECT_TEXT" | cut -c1)
131
- if echo "$FIRST_CHAR" | grep -qE '[A-Z]'; then
136
+ if grep -qE '[A-Z]' <<<"$FIRST_CHAR"; then
132
137
  # Portable lowercase conversion using bash parameter expansion
133
138
  REST="${SUBJECT_TEXT:1}"
134
139
  LOWERCASE_FIRST="${FIRST_CHAR,,}"
@@ -143,7 +148,7 @@ if [ -n "$SUBJECT_TEXT" ]; then
143
148
  fi
144
149
 
145
150
  # Check if subject ends with period (should not)
146
- if echo "$SUBJECT_TEXT" | grep -qE '\.$'; then
151
+ if grep -qE '\.$' <<<"$SUBJECT_TEXT"; then
147
152
  echo -e "${YELLOW}⚠ Warning: Subject should not end with a period${NC}"
148
153
  WARNINGS=$((WARNINGS + 1))
149
154
  else
@@ -154,7 +159,7 @@ if [ -n "$SUBJECT_TEXT" ]; then
154
159
  FIRST_WORD=$(echo "$SUBJECT_TEXT" | awk '{print $1}')
155
160
 
156
161
  # Common non-imperative patterns
157
- if echo "$FIRST_WORD" | grep -qE '(added|fixed|updated|changed|removed|deleted)$'; then
162
+ if grep -qE '(added|fixed|updated|changed|removed|deleted)$' <<<"$FIRST_WORD"; then
158
163
  echo -e "${YELLOW}⚠ Warning: Use imperative mood (add, fix, update, not added, fixed, updated)${NC}"
159
164
  echo " Got: '$FIRST_WORD'"
160
165
  echo " Prefer: '$(echo "$FIRST_WORD" | sed 's/ed$//' | sed 's/d$//')'"
@@ -165,7 +170,14 @@ if [ -n "$SUBJECT_TEXT" ]; then
165
170
  fi
166
171
 
167
172
  # Check for body (optional but recommended for complex changes)
168
- BODY_LINES=$(echo "$COMMIT_MSG" | tail -n +3 | grep -c '[[:alnum:]]' || echo "0")
173
+ # grep -c prints the count itself; exit 1 only means zero matches. Any other
174
+ # non-zero status is a real failure.
175
+ BODY_LINES_STATUS=0
176
+ BODY_LINES=$(echo "$COMMIT_MSG" | tail -n +3 | grep -c '[[:alnum:]]') || BODY_LINES_STATUS=$?
177
+ if [ "$BODY_LINES_STATUS" -gt 1 ]; then
178
+ echo "Error: Failed to count body lines" >&2
179
+ exit "$BODY_LINES_STATUS"
180
+ fi
169
181
 
170
182
  if [ "$BODY_LINES" -gt 0 ]; then
171
183
  echo -e "${GREEN}✓ Body is present ($BODY_LINES lines)${NC}"
@@ -186,11 +198,11 @@ if [ "$BODY_LINES" -gt 0 ]; then
186
198
  fi
187
199
 
188
200
  # Check for BREAKING CHANGE footer
189
- if echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE:'; then
201
+ if grep -qE 'BREAKING CHANGE:' <<<"$COMMIT_MSG"; then
190
202
  echo -e "${YELLOW}⚠ Breaking change footer detected${NC}"
191
203
 
192
204
  # Verify format
193
- if echo "$COMMIT_MSG" | grep -qE '^BREAKING CHANGE: .+'; then
205
+ if grep -qE '^BREAKING CHANGE: .+' <<<"$COMMIT_MSG"; then
194
206
  echo -e "${GREEN}✓ BREAKING CHANGE footer is properly formatted${NC}"
195
207
  else
196
208
  echo -e "${RED}✗ Error: BREAKING CHANGE footer format incorrect${NC}"
@@ -200,7 +212,7 @@ if echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE:'; then
200
212
  fi
201
213
 
202
214
  # Check for issue references
203
- if echo "$COMMIT_MSG" | grep -qE '(Fixes|Closes|Resolves|Related to) #[0-9]+'; then
215
+ if grep -qE '(Fixes|Closes|Resolves|Related to) #[0-9]+' <<<"$COMMIT_MSG"; then
204
216
  echo -e "${GREEN}✓ Issue reference found${NC}"
205
217
  fi
206
218
 
@@ -197,7 +197,7 @@ PYEOF
197
197
  fi
198
198
  local first_line
199
199
  first_line="$(head -1 "$CONFIG_FILE")"
200
- if echo "$first_line" | grep -q "Advisory only"; then
200
+ if grep -q "Advisory only" <<<"$first_line"; then
201
201
  add_check "advisory-comment" "PASS" "file leads with advisory comment"
202
202
  else
203
203
  add_check "advisory-comment" "FAIL" "file must lead with '# Advisory only ...' comment; got: ${first_line}"
@@ -15,7 +15,7 @@ Execute a parallel implementation plan by deploying implementor agents in depend
15
15
  ## Hard Gates
16
16
 
17
17
  - `--worktree` and `--no-worktree` together → abort (exact message in Arguments).
18
- - `--dry-run` → print the plan only; never dispatch agents or manage team state. STOP HERE.
18
+ - `--dry-run` → print the plan only; never dispatch agents or manage team state. Skip branch preparation and worktree setup, including Phase 2.5. STOP HERE. In linear mode it also makes no Linear or local writes (no `--ensure`, no cache write); see `references/linear-sync.md`.
19
19
  - Always run the branch-prep helper before any dispatch — narrative-only branch instructions are how agents end up committing to `main`.
20
20
  - Never pass `isolation: "worktree"` per agent — all agents in all batches share the one feature worktree (or the prepared checkout under `--no-worktree`).
21
21
  - Standalone task failure: record it and continue only independent tasks. Team failure: no auto-retry or skipping; ask the user before advancing.
@@ -35,25 +35,26 @@ Final step of the planning workflow; requires `parallel-plan.md` from the parall
35
35
  shared.md parallel-plan.md parallel-plan.md
36
36
  ```
37
37
 
38
- If parallel-plan.md doesn't exist, run `/ycc:parallel-plan [feature-name]` first.
38
+ In local mode, if parallel-plan.md doesn't exist, run `/ycc:parallel-plan [feature-name]` first. In linear mode, use Phase 0 Lookup before concluding that a plan is missing.
39
39
 
40
40
  ## Arguments
41
41
 
42
42
  **Target**: `$ARGUMENTS`
43
43
 
44
- Parse flags first, then treat the remainder as the feature name:
44
+ Parse flags first, then resolve the remaining feature name, plan path, or Linear reference using `references/plan-inputs.md`:
45
45
 
46
46
  - `--worktree` — (legacy — now default; safe to omit) Accepted as a silent no-op. Worktree isolation is on by default; this flag matches the new default and has no additional effect.
47
47
  - `--no-worktree` — Force worktree mode **OFF** regardless of plan annotations. Create/use `feat/<feature-name>` in the current checkout and run tasks there. No feature worktree is created.
48
- - `<feature-name>` — The name of the feature to implement (matches directory name in `docs/plans/`).
48
+ - `--store=local|linear` — Artifact-store override; strip and retain as `STORE_FLAG` (empty when absent), forwarding it to every resolver call.
49
+ - `<feature-name | plan-path | Linear-reference>` — Existing feature name, cached plan path, or issue key/URL, Project URL/slug, or Document URL/id; see artifact-store.md **Implementation skills > Inputs**.
49
50
 
50
- Strip the supported flags from `$ARGUMENTS` and set `DRY_RUN=true|false`, `WORKTREE_MODE=true|false`, and `WORKTREE_FLAG_PRESENT=true|false`. The remaining non-flag token is the feature name.
51
+ Strip the flags from `$ARGUMENTS` and set ``, `DRY_RUN=true|false`, `WORKTREE_MODE=true|false`, and `WORKTREE_FLAG_PRESENT=true|false`. Retain the remaining input; derive the feature slug during Phase 0.
51
52
 
52
53
  **Validation**:
53
54
 
54
55
  - `--worktree` and `--no-worktree` together → abort with: `--worktree and --no-worktree are mutually exclusive. Use --no-worktree to opt out of the default.`
55
56
 
56
- If no feature name remains after stripping flags, abort with this usage line followed by the Examples in `references/plan-inputs.md` (default worktree, `--dry-run`, `--no-worktree`, and the combinations):
57
+ If no input remains after stripping flags, abort with this usage line followed by the Examples in `references/plan-inputs.md`:
57
58
 
58
59
  Usage: /ycc:implement-plan [--dry-run] [--worktree] [--no-worktree] <feature-name>
59
60
 
@@ -66,18 +67,28 @@ Read `{{package-root}}/shared/references/standalone-dispatch.md` for standalone
66
67
 
67
68
  ### Step 1: Validate Prerequisites
68
69
 
69
- After flag parsing, extract the feature name (first non-flag argument) and run:
70
+ First read `{{package-root}}/shared/references/artifact-store.md` **Implementation skills**, **Sync**, **Lookup**, and **Helper API**. Apply **Inputs** before resolution (including the local-plan-wins and `--store=local` conflict rules): when a Linear reference or linear plan path selects linear mode and `STORE_FLAG` is empty, set `STORE_FLAG=--store=linear` before the first resolver call and forward it to every later call, consistent with `references/plan-inputs.md`. Resolve and print the store (default `linear`), retaining the printed mode and absolute paths across tool calls:
70
71
 
71
72
  ```bash
72
- {{package-root}}/skills/implement-plan/scripts/check-prerequisites.sh [feature-name]
73
+ bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" ${STORE_FLAG} --shell
73
74
  ```
74
75
 
75
- If the script exits with error: display the error message, instruct the user to run `/ycc:parallel-plan` first to create the implementation plan, and **STOP HERE** — do not proceed.
76
+ If the printed `ARTIFACT_STORE_SOURCE` is `default` and `STORE_FLAG` is empty, apply the Inputs local-plan rule: an explicit plan path outside `.ycc/artifacts/`, or an existing local feature directory (`test -d "$(bash "{{package-root}}/shared/scripts/resolve-artifact-store.sh" --store=local)/<feature-name>"`, which also accepts legacy local names such as `team/auth`), sets `STORE_FLAG=--store=local`; print `Using local plan at <path>; pin with store: local in .plans-config` and resolve again with it. `check-prerequisites.sh` applies the same feature-directory rule when called without a store flag.
77
+
78
+ In linear mode, follow **Resolve and hydrate** (Lookup → Load `parallel-plan` and available `shared`) before prerequisites or branch preparation; retain absolute `PLAN_PATH` and `SHARED_PATH`. Follow `references/linear-sync.md` throughout this run. Local feature-name input keeps the existing prerequisite call:
79
+
80
+ ```bash
81
+ {{package-root}}/skills/implement-plan/scripts/check-prerequisites.sh ${STORE_FLAG} [feature-name]
82
+ ```
83
+
84
+ For linear mode, call the helper with `${STORE_FLAG} --plan="${PLAN_PATH}" <resolved-slug>`; `PLAN_PATH` must be the absolute hydrated cache path. An explicit local plan path uses `${STORE_FLAG} --plan="${PLAN_PATH}" <feature-name>` with the store chosen above.
85
+
86
+ If the script exits with error: display the error message and **STOP HERE** — do not proceed. In local mode, instruct the user to run `/ycc:parallel-plan` first; in linear mode, preserve Lookup's diagnostics rather than claiming no plan without querying Linear.
76
87
 
77
88
  ### Step 2: Read Planning Documents
78
89
 
79
- 1. `docs/plans/[feature-name]/parallel-plan.md` — the implementation plan
80
- 2. `docs/plans/[feature-name]/shared.md` — architecture context
90
+ 1. Local: `docs/plans/[feature-name]/parallel-plan.md` (or explicit plan path); linear: absolute `PLAN_PATH` — the implementation plan
91
+ 2. Local: companion `shared.md`; linear: hydrated `SHARED_PATH` when available — architecture context
81
92
 
82
93
  Also read files listed in the "Critically Relevant Files" section of parallel-plan.md.
83
94
 
@@ -85,17 +96,18 @@ Also read files listed in the "Critically Relevant Files" section of parallel-pl
85
96
 
86
97
  ### Step 3: Extract Tasks
87
98
 
88
- Run when building the execution graph (Phase 1 task extraction):
99
+ For local inputs, set absolute `PLAN_PATH` and companion `SHARED_PATH` from the resolved plan directory (refresh both after worktree relocation); linear mode keeps the absolute cache paths. Run when building the execution graph (Phase 1 task extraction):
89
100
 
90
101
  ```bash
91
- {{package-root}}/skills/implement-plan/scripts/parse-dependencies.sh docs/plans/[feature-name]/parallel-plan.md
102
+ {{package-root}}/skills/implement-plan/scripts/parse-dependencies.sh "${PLAN_PATH}"
92
103
  ```
93
104
 
94
105
  The script emits optional header lines (`WT_PARENT_PATH=<path>`, `WT_FEATURE_SLUG=<slug>` — present only when the plan has a `## Worktree Setup` section) followed by per-task rows (`TASK_ID|TASK_TITLE|DEPENDENCIES`). Row fields and the monorepo `.plans-config` behavior are documented in `references/plan-inputs.md`.
106
+ Parse task specifications from the body, not identity frontmatter.
95
107
 
96
108
  ### How Worktree Mode Is Decided
97
109
 
98
- Use standalone-dispatch.md §8.1 for precedence and variables in both modes. Skill input: `WT_FEATURE_SLUG` is the parsed annotation slug if present, otherwise the feature-name argument (no extra sanitization/cap). Always derive `WT_REPO_NAME` and `FEATURE_BRANCH`; `--no-worktree` sets `WORKTREE_ACTIVE=false` even when parser headers exist.
110
+ Use standalone-dispatch.md §8.1 for precedence and variables in both modes. Local skill input: `WT_FEATURE_SLUG` is the parsed annotation slug if present, otherwise the resolved feature slug (the feature-name argument in local mode; no extra sanitization/cap). In linear mode, derive `WT_FEATURE_SLUG` from the cache slug per artifact-store.md **Resolve and hydrate** step 4: lowercase, replace `[^a-z0-9-]` with `-`, collapse runs, trim `-`, truncate to 40 characters, and fall back to `untitled` if empty. Keep the raw cache slug for every resolver `--slug=` call. Always derive `WT_REPO_NAME` and `FEATURE_BRANCH`; `--no-worktree` sets `WORKTREE_ACTIVE=false` even when parser headers exist.
99
111
 
100
112
  ### Step 4: Build Dependency Graph
101
113
 
@@ -111,6 +123,7 @@ Use `track the task` for each plan item with `subject="[Task ID] [Task Title]"`
111
123
  `description="<full specification and dependencies>"`. Capture the returned task IDs;
112
124
  wire dependencies via `update the todo tracker` with `addBlockedBy` using those IDs. See
113
125
  `references/plan-inputs.md` (Task list format).
126
+ In linear mode, reconcile mapped task issues before registration per `references/linear-sync.md`; completed/canceled tasks are skipped, not dispatched, and completed prerequisites count as satisfied.
114
127
 
115
128
  ### Step 6: Identify First Batch
116
129
 
@@ -120,7 +133,7 @@ All tasks with `Depends on [none]` form the first batch; mark them ready for exe
120
133
 
121
134
  ### Steps 6.5–6.7
122
135
 
123
- Use standalone-dispatch.md §8.2 in both dispatch modes for Git inspection, required branch preparation, one-time parent setup, and one-way artifact relocation. Expected dirty artifacts: `docs/plans/${WT_FEATURE_SLUG}/` only; unrelated dirty files stop and require user cleanup. Move `docs/plans/${WT_FEATURE_SLUG}/parallel-plan.md` with `docs/plans/${WT_FEATURE_SLUG}/shared.md` as companion; other research artifacts from the same feature directory may ride as extra arguments. Keep returned `$PLAN_PATH` canonical; later validation/reports use the execution tree. Branch-prep exit contract: `{{package-root}}/shared/references/branch-prep.md`.
136
+ Use standalone-dispatch.md §8.2 in both dispatch modes for Git inspection, required branch preparation and one-time parent setup. **Local mode:** expected dirty artifacts: `docs/plans/${WT_FEATURE_SLUG}/` only; unrelated dirty files stop and require user cleanup. Move `docs/plans/${WT_FEATURE_SLUG}/parallel-plan.md` with `docs/plans/${WT_FEATURE_SLUG}/shared.md` as companion; other research artifacts from the same feature directory may ride as extra arguments. Keep returned `$PLAN_PATH` canonical; later validation/reports use the execution tree. **Linear mode:** skip `move-plan-to-worktree.sh` and all artifact relocation; keep absolute cache paths from Phase 0 for worktree prompts and plan validation. The cache is gitignored; the only expected dirty path is a `.gitignore` whose sole change appends one `.ycc/artifacts/` rule line, which branch preparation accepts. Branch-prep exit contract: `{{package-root}}/shared/references/branch-prep.md`.
124
137
 
125
138
  ## Phase 3: Execute in Batches
126
139
 
@@ -129,6 +142,8 @@ Use standalone-dispatch.md §8.2 in both dispatch modes for Git inspection, requ
129
142
  If `--dry-run` is present, read `references/output-formats.md` (Dry-run formats), print the default batch roster, and do not dispatch any agents.
130
143
  **STOP HERE** after either dry-run output.
131
144
 
145
+ After this gate, linear mode runs the start transitions and pending replay in `references/linear-sync.md` before dispatch.
146
+
132
147
  ### Step 8: Execute standalone batches
133
148
 
134
149
  Execute the dependency-ready standalone batches described below.
@@ -161,6 +176,7 @@ All parallel agents in this batch share this path; batching guarantees no two ag
161
176
  ```
162
177
 
163
178
  Implementor prompt template: `references/agent-task-prompt.md` — read once before the loop for the full task prompt.
179
+ For both paths, apply `references/linear-sync.md` before each batch and after its orchestrator validation; implementors never sync Linear or edit plan identity.
164
180
 
165
181
  #### Process Batch Results (Path A)
166
182
 
@@ -190,6 +206,8 @@ Repeat from the ready-task selection until no tasks remain, then Phase 4.
190
206
  2. Verify all "Files to Create" exist.
191
207
  3. Sanity-check the modifications.
192
208
 
209
+ In linear mode, write kind `report` and Save its Project status update, then apply parent/Project completion via `references/linear-sync.md`; local mode retains its existing report behavior and makes no Linear calls.
210
+
193
211
  ### Step 10: Display Summary
194
212
 
195
213
  When `WORKTREE_ACTIVE=true`, first capture: `bash {{package-root}}/shared/scripts/list-worktrees.sh "${WT_REPO_NAME}" "${WT_FEATURE_SLUG}"`.
@@ -204,7 +222,7 @@ The implementation must: complete all tasks in the plan, respect dependency orde
204
222
 
205
223
  ## Monorepo Support
206
224
 
207
- Plans are read from the git repository root in `docs/plans/` by default; running from any subdirectory still reads from the root. A `.plans-config` at repo root (`plans_dir: docs/plans`) customizes the directory; with `scope: local` in a package-level `.plans-config`, plans are read from that package's local `docs/plans/`. Structure example in `references/plan-inputs.md` (Monorepo Support).
225
+ Local-mode plans are read from the git repository root in `docs/plans/` by default; running from any subdirectory still reads from the root. A `.plans-config` at repo root (`plans_dir: docs/plans`) customizes the directory; with `scope: local` in a package-level `.plans-config`, plans are read from that package's local `docs/plans/`. Linear mode resolves under `.ycc/artifacts/<slug>/` in the invoking checkout and passes absolute cache paths to worktree agents. Structure example in `references/plan-inputs.md` (Monorepo Support).
208
226
 
209
227
  ## Success Criteria
210
228
 
@@ -221,3 +239,4 @@ Pair with the `/goal` session directive to loop the batch executor to completion
221
239
  - `references/plan-inputs.md` — read when parsing tasks, building the dependency graph, registering tasks, showing usage, or resolving the monorepo plans directory.
222
240
  - `references/agent-task-prompt.md` — read once before dispatching implementor agents.
223
241
  - `references/output-formats.md` — read when printing `--dry-run` output or the Phase 4 completion summary, or writing a `/goal` condition.
242
+ - `references/linear-sync.md` — orchestrator-only Linear lifecycle hooks; canonical behavior lives in artifact-store.md.
@@ -24,11 +24,11 @@ You are implementing one task from a larger feature plan. Read the context docum
24
24
 
25
25
  ### Required Reading
26
26
 
27
- 1. **Plan Document**: docs/plans/{{FEATURE_NAME}}/parallel-plan.md
27
+ 1. **Plan Document**: {{PLAN_PATH}} (absolute, read-only)
28
28
  - Read the full plan to understand the feature
29
29
  - Focus on Task {{TASK_ID}} for your specific instructions
30
30
 
31
- 2. **Shared Context**: docs/plans/{{FEATURE_NAME}}/shared.md
31
+ 2. **Shared Context**: {{SHARED_PATH}} (absolute, read-only; omit when unavailable)
32
32
  - Understand the architecture and patterns
33
33
  - Note the relevant files and their purposes
34
34
 
@@ -55,6 +55,7 @@ You are implementing one task from a larger feature plan. Read the context docum
55
55
  3. **Follow Existing Patterns**: Match the codebase style and conventions
56
56
  4. **Validate Changes**: Check for linting errors after modifications
57
57
  5. **Report Results**: Return a summary of what you changed
58
+ 6. **Orchestrator-Owned Plan and Status**: Never edit the plan or its frontmatter, and never call Linear MCP or other external tracker tools. Report status only to the orchestrator. Read the supplied absolute plan/context paths even if the cache is outside your working directory; all implementation writes stay in the assigned working directory.
58
59
 
59
60
  ## Output Format
60
61
 
@@ -85,7 +86,8 @@ After completing the task, provide:
85
86
 
86
87
  | Variable | Description | Example |
87
88
  |----------|-------------|---------|
88
- | `{{FEATURE_NAME}}` | Feature directory name | `user-authentication` |
89
+ | `{{PLAN_PATH}}` | Canonical absolute plan path; linear cache is not moved into the feature worktree | `/repo/.ycc/artifacts/user-authentication/parallel-plan.md` |
90
+ | `{{SHARED_PATH}}` | Absolute companion context path; omit its reading item when absent | `/repo/.ycc/artifacts/user-authentication/shared.md` |
89
91
  | `{{TASK_ID}}` | Task identifier | `1.1`, `2.3` or `T0`, `T1` |
90
92
  | `{{TASK_TITLE}}` | Task title from plan | `Create user model` |
91
93
  | `{{FILES_TO_READ}}` | Files from "READ THESE BEFORE TASK" | `- /src/models/base.ts` |
@@ -121,11 +123,11 @@ You are implementing one task from a larger feature plan. Read the context docum
121
123
 
122
124
  ### Required Reading
123
125
 
124
- 1. **Plan Document**: docs/plans/user-authentication/parallel-plan.md
126
+ 1. **Plan Document**: /repo/.ycc/artifacts/user-authentication/parallel-plan.md (absolute, read-only)
125
127
  - Read the full plan to understand the feature
126
128
  - Focus on Task 1.1 for your specific instructions
127
129
 
128
- 2. **Shared Context**: docs/plans/user-authentication/shared.md
130
+ 2. **Shared Context**: /repo/.ycc/artifacts/user-authentication/shared.md (absolute, read-only)
129
131
  - Understand the architecture and patterns
130
132
  - Note the relevant files and their purposes
131
133
 
@@ -167,6 +169,7 @@ Follow the pattern in /src/models/base-model.ts for consistency.
167
169
  3. **Follow Existing Patterns**: Match the codebase style and conventions
168
170
  4. **Validate Changes**: Check for linting errors after modifications
169
171
  5. **Report Results**: Return a summary of what you changed
172
+ 6. **Orchestrator-Owned Plan and Status**: Never edit the plan or its frontmatter, and never call Linear MCP or other external tracker tools. Report status only to the orchestrator. The supplied absolute plan/context paths may be outside your working directory; implementation writes stay in the assigned working directory.
170
173
 
171
174
  ## Output Format
172
175
 
@@ -0,0 +1,20 @@
1
+ # Implement-plan Linear Lifecycle
2
+
3
+ Read `{{package-root}}/shared/references/artifact-store.md` **Implementation skills** (Inputs, Resolve and hydrate, Status sync, Report and completion), **Plan task issues**, **Sync**, and **Lookup**. Those sections are the contract; this file maps them to executor phases, not a second sync protocol. All hooks below are linear-mode only. Local mode keeps its existing paths, worktree move and report behavior, with no Linear calls.
4
+
5
+ ## Phase hooks
6
+
7
+ - **Phase 0:** apply Inputs and Resolve and hydrate before prerequisites. Retain `STORE_FLAG`, resolved feature slug, absolute `PLAN_PATH`, and available `SHARED_PATH` across tool calls. Use Lookup and Load with the Linear call gate and Conflict rules; never overwrite unpushed cache edits. Read the `tasks` map; rebuild a missing map in memory only (no issue creation, no cache write). Tasks without issues remain runnable and are reported as untracked.
8
+ - **Phases 1–2:** fetch mapped task states. Treat `completed` tasks as done and skip dispatch on resume; skip `canceled` tasks as removed. Retain both lists for the summary and account for completed dependencies in the execution graph. Never renumber task ids or change the plan body.
9
+ - **After Step 7's dry-run exit:** replay pending transitions from the prior report through Offline and the normal remote checks before dispatch. Apply Status sync's run-start row to the parent and Project by state type, never by a hardcoded team state name. A dry run follows the contract's `--dry-run` rule: Lookup and read-only reuse only; no `--ensure`, no cache write, no Linear writes (state changes, comments, pending replay, report Save, Project updates).
10
+ - **Before every batch, Path A or B:** apply Status sync's dispatch row to each mapped task issue. The orchestrator alone performs these transitions; implementors receive read-only absolute cache paths and report only to it.
11
+ - **After each batch's orchestrator validation:** mark issues for tasks that passed their required validation `completed`. Do not mark success merely because an agent returned. Apply Status sync's failure row to failed tasks/batches: leave issues `started` and add one sanitized comment identifying the task id, failed check and short excerpt; no secrets or full logs. Preserve the existing standalone/team failure policy.
12
+ - **After every state change or failure comment:** apply the contract's Timestamps rule (fetch `updatedAt` first; re-stamp `tasks.<id>.updatedAt` only when it matched the stored stamp). Never move issues backwards, reopen them, change assignees, or touch issues outside this plan's map and parent.
13
+
14
+ ## Phase 4 report and completion
15
+
16
+ After final verification, apply **Report and completion**: resolve kind `report` with `${STORE_FLAG} --ensure --kind=report --slug=<resolved-slug>` through the shared resolver, retain its absolute path, write the run report, and Save as the Project status update (plus a Document when long), recording `linear.statusUpdate`. Do this on failure as well as success (including team-abort). Use the contract's health, parent-completion and Project completion rules (name equals slug, label, not `ARTIFACT_LINEAR_PROJECT`, all issues done); otherwise leave the Project open and report why. Local mode does not run this hook.
17
+
18
+ If an installed, authorized MCP becomes unreachable mid-run, keep implementing through **Offline**. At the moment a transition fails, resolve the report path with `--ensure`, append it under `## Linear sync pending` in that file and set `pending: true`; the final report merges into the same file. Print the same list; the next run replays it before dispatch, without overriding remote changes. Do not claim an unapplied transition or status update succeeded. Missing/unauthorized MCP at initial hydration follows the gate, not a local fallback.
19
+
20
+ Use `references/output-formats.md` for Linear URLs, issues moved, skipped/untracked tasks, pending transitions and the Project completion reason. Keep the existing Goal Signals unchanged.
@@ -93,6 +93,19 @@ Provide completion summary:
93
93
 
94
94
  [List any problems or warnings]
95
95
 
96
+ ## Linear ← include this section only when ARTIFACT_STORE=linear
97
+
98
+ - **Issues moved**: [parent/task keys and resulting state types, or none]
99
+ - **Skipped on resume**: [completed task ids/keys; canceled task ids/keys]
100
+ - **Untracked tasks**: [ids without mapped issues; suggest re-saving with /ycc:parallel-plan]
101
+ - **Project**: [URL; completed, or left open with reason]
102
+ - **Plan**: [Document URL]
103
+ - **Report**: [absolute report cache path; Project status update URL, or pending]
104
+
105
+ ### Linear sync pending
106
+
107
+ [Each unapplied transition/report write, or None; preserve the same list in the report with pending: true while unapplied]
108
+
96
109
  ## Worktree Status ← include this section only when WORKTREE_ACTIVE=true
97
110
 
98
111
  [Output of list-worktrees.sh]
@@ -110,7 +123,7 @@ Provide completion summary:
110
123
  3. Commit the changes when satisfied
111
124
  4. **Optional**: Generate implementation report:
112
125
 
113
- /ycc:code-report [feature-name]
126
+ /ycc:code-report ${STORE_FLAG} [feature-name]
114
127
 
115
128
  ## Goal Signals (machine-readable — printed verbatim for /goal)
116
129
 
@@ -123,6 +136,8 @@ Print every signal verbatim as the last lines of the completion summary. Use `PA
123
136
  when the matching criterion in `## Success Criteria` is met; otherwise `FAIL` (for example
124
137
  `FILES_CHANGED_NONEMPTY: FAIL` when the "Files Changed" section enumerated no files).
125
138
 
139
+ In linear mode, Step 9 already writes kind `report` and Saves a Project status update per `references/linear-sync.md`. Include its URL (or pending failure), issue transitions, skipped tasks and Project completion reason above; do not claim a remote write succeeded without its response. Keep the Goal Signals unchanged and last.
140
+
126
141
  ## Goal pairing
127
142
 
128
143
  Pair this skill with the `/goal` session directive to loop the batch executor to completion
@@ -132,7 +147,7 @@ condition that references the Phase 4 Step 10 Goal Signals block rather than fil
132
147
  Recommended condition template:
133
148
 
134
149
  ```
135
- /goal Execute the parallel plan at docs/plans/<feature>/parallel-plan.md using the
150
+ /goal Execute the parallel plan <feature> (resolved plan path) using the
136
151
  implement-plan workflow, continuing through every batch and the Phase 4 lint pass
137
152
  without returning control to me. Done when the transcript shows the Phase 4
138
153
  "# Implementation Complete" output followed by all three Goal Signals printed verbatim —
@@ -10,10 +10,10 @@
10
10
 
11
11
  ## Usage block
12
12
 
13
- Print when no feature name remains after stripping flags:
13
+ Print when no input remains after stripping flags:
14
14
 
15
15
  ```
16
- Usage: /ycc:implement-plan [--dry-run] [--worktree] [--no-worktree] <feature-name>
16
+ Usage: /ycc:implement-plan [--dry-run] [--worktree] [--no-worktree] [--store=local|linear] <feature-name | plan-path | Linear-reference>
17
17
 
18
18
  Examples:
19
19
  /ycc:implement-plan user-authentication
@@ -27,8 +27,27 @@ Examples:
27
27
  # opt out of worktree isolation; create/use feat/my-feature in the current checkout
28
28
 
29
29
  # agent-team dispatch on the current-checkout feature branch
30
+
31
+ /ycc:implement-plan --store=local user-authentication
32
+ # explicit local mode; existing paths and no Linear calls
33
+
34
+ /ycc:implement-plan --store=linear user-authentication
35
+ /ycc:implement-plan YAN-123
36
+ /ycc:implement-plan https://linear.app/workspace/issue/YAN-123/feature
37
+ /ycc:implement-plan https://linear.app/workspace/project/feature-slug
38
+ /ycc:implement-plan --store=linear feature-project-slug
39
+ /ycc:implement-plan https://linear.app/workspace/document/plan-document-id
40
+ /ycc:implement-plan --store=linear <document-id>
41
+ /ycc:implement-plan .ycc/artifacts/user-authentication/parallel-plan.md
42
+ # issue, Project, Document, or cached plan; hydrate before prerequisites
30
43
  ```
31
44
 
45
+ ### Store and input resolution
46
+
47
+ Read `{{package-root}}/shared/references/artifact-store.md` **Implementation skills > Inputs**, **Resolve and hydrate**, and **Store resolution**; Inputs defines what counts as an issue key, a Linear reference and a linear plan path, and that an existing local `${PLANS_DIR}/<name>/` wins over reference parsing. Strip `--store=local|linear` into `STORE_FLAG` and forward it on every resolver call. A Linear reference or linear plan path sets `STORE_FLAG=--store=linear`; combined with explicit `--store=local`, abort with: `A Linear plan reference requires linear mode; drop --store=local.` Anything else (including feature names such as `oauth-2`) follows normal store resolution (default `linear`); local-mode behavior is unchanged. A bare Project slug or Document id is a reference only with `--store=linear`; it is resolved through Lookup, not guessed from a missing local file.
48
+
49
+ Resolve and print the mode. When `STORE_FLAG` is empty and `ARTIFACT_STORE_SOURCE=default`, an explicit plan path outside `.ycc/artifacts/` or an existing `--store=local` feature directory sets `STORE_FLAG=--store=local` and prints `Using local plan at <path>; pin with store: local in .plans-config` (Inputs). Then in linear mode apply the Linear call gate and Lookup → Load for `parallel-plan` and available `shared`; use their absolute cache paths. Derive the feature slug from the selected Document/Project using the canonical contract. A missing `shared` Document warns; it does not block a plan. Rebuild a missing task map in memory from existing sub-issues; untracked tasks still run. Never create task issues during implementation. A dry run follows the contract's `--dry-run` rule (no `--ensure`, no cache write, no Linear writes). An explicit local plan path uses its absolute path and companion `shared.md`, retaining local behavior.
50
+
32
51
  ## Task parser output
33
52
 
34
53
  `parse-dependencies.sh` emits optional header lines followed by per-task rows.
@@ -83,9 +102,9 @@ update the todo tracker: taskId="<1.2 returned ID>", addBlockedBy=["<1.1 returne
83
102
 
84
103
  ## Monorepo Support
85
104
 
86
- The skill detects and uses the correct plans directory in monorepo setups.
105
+ In local mode, the skill detects and uses the correct plans directory in monorepo setups. Linear mode resolves `parallel-plan` and `shared` under `.ycc/artifacts/<slug>/` in the invoking checkout, independent of a package's local `docs/plans/`; see artifact-store.md **Worktrees**. The examples below retain local-mode behavior.
87
106
 
88
- Default behavior:
107
+ Local-mode default:
89
108
 
90
109
  - Plans are read from the git repository root in `docs/plans/`.
91
110
  - Running the skill from any subdirectory (e.g., `packages/app1/`) still reads plans from the root.