@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
@@ -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.
@@ -1,54 +1,96 @@
1
1
  #!/usr/bin/env bash
2
- # Check that required planning documents exist for implementation
3
- # Usage: check-prerequisites.sh <feature-name>
4
- #
5
- # Supports monorepo configurations via .plans-config file.
6
- # See resolve-plans-dir.sh for configuration options.
7
-
2
+ # Check that required planning documents exist for implementation.
3
+ # Usage: check-prerequisites.sh <feature-name> [--store=linear|local] [--plan=<path>]
8
4
  set -euo pipefail
9
-
10
- FEATURE_NAME="${1:-}"
11
-
12
- # Source the shared resolver to get PLANS_DIR
13
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
6
  SHARED_DIR="${SCRIPT_DIR}/../../../shared/scripts"
15
-
16
- if [[ -f "${SHARED_DIR}/resolve-plans-dir.sh" ]]; then
17
- # shellcheck source=../../../shared/scripts/resolve-plans-dir.sh
18
- source "${SHARED_DIR}/resolve-plans-dir.sh"
7
+ if [[ -f "${SHARED_DIR}/resolve-artifact-store.sh" ]]; then
8
+ # shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
9
+ source "${SHARED_DIR}/resolve-artifact-store.sh"
19
10
  else
20
- # Fallback if shared resolver not found
21
- echo "WARNING: resolve-plans-dir.sh not found, using default path" >&2
22
- PLANS_DIR="docs/plans"
11
+ echo "ERROR: resolve-artifact-store.sh not found at ${SHARED_DIR}" >&2
12
+ echo "Cannot resolve plans directory safely; refusing to guess." >&2
13
+ exit 1
23
14
  fi
24
-
25
- PLAN_DIR="${PLANS_DIR}/${FEATURE_NAME}"
26
-
27
- if [[ -z "$FEATURE_NAME" ]]; then
15
+ # shellcheck source=../../../shared/scripts/artifact-body.sh
16
+ source "${SHARED_DIR}/artifact-body.sh"
17
+ FEATURE_NAME='' STORE_FLAG='' PLAN_FILE=''
18
+ while [[ $# -gt 0 ]]; do
19
+ case "$1" in
20
+ --store=*) STORE_FLAG=$1 ;;
21
+ --plan=*)
22
+ PLAN_FILE=${1#--plan=}
23
+ [[ -n "$PLAN_FILE" ]] || { echo 'ERROR: Plan path required' >&2; exit 1; }
24
+ ;;
25
+ --*) echo "ERROR: Unknown option: $1" >&2; exit 1 ;;
26
+ *)
27
+ if [[ -n "$FEATURE_NAME" ]]; then
28
+ echo 'Usage: check-prerequisites.sh <feature-name> [--store=linear|local] [--plan=<path>]' >&2
29
+ exit 1
30
+ fi
31
+ FEATURE_NAME=$1
32
+ ;;
33
+ esac
34
+ shift
35
+ done
36
+ if [[ -n "$STORE_FLAG" ]]; then resolve_artifact_store "$PWD" "$STORE_FLAG" || exit 1; fi
37
+ if [[ -z "$FEATURE_NAME" && -z "$PLAN_FILE" ]]; then
28
38
  echo "ERROR: Feature name required"
29
- echo "Usage: check-prerequisites.sh <feature-name>"
39
+ echo 'Usage: check-prerequisites.sh <feature-name> [--store=linear|local] [--plan=<path>]' >&2
30
40
  exit 1
31
41
  fi
32
-
42
+ EXPLICIT_PLAN=$PLAN_FILE
43
+ if [[ -n "$PLAN_FILE" ]]; then
44
+ PLAN_DIR=$(dirname "$PLAN_FILE")
45
+ if [[ -d "$PLAN_DIR" ]]; then
46
+ PLAN_DIR=$(CDPATH='' cd -- "$PLAN_DIR" >/dev/null && pwd -P)
47
+ elif [[ "$PLAN_DIR" != /* ]]; then
48
+ PLAN_DIR="$PWD/$PLAN_DIR"
49
+ fi
50
+ PLAN_FILE="${PLAN_DIR}/$(basename "$PLAN_FILE")"
51
+ FEATURE_NAME=${FEATURE_NAME:-${PLAN_DIR##*/}}
52
+ else
53
+ # Default store: an existing local plan keeps local mode before the strict
54
+ # linear slug check could reject a legacy local name (team/auth, spaces).
55
+ if [[ -z "$STORE_FLAG" ]]; then select_local_plan_store "$FEATURE_NAME" || exit 1; fi
56
+ PLAN_DIR="$(get_plans_feature_dir "$FEATURE_NAME")" || exit 1
57
+ PLAN_FILE="${PLAN_DIR}/parallel-plan.md"
58
+ fi
59
+ # Guidance follows the input: an explicit plan outside the linear cache is a
60
+ # local plan (artifact-store.md Inputs) even when the store resolves to linear.
61
+ # Compare physical paths too: PLAN_DIR is canonical, ARTIFACT_DIR may be logical.
62
+ LINEAR_INPUT=0
63
+ if [[ "${ARTIFACT_STORE:-}" == linear ]]; then
64
+ phys_artifact=$(CDPATH='' cd -- "$ARTIFACT_DIR" 2>/dev/null && pwd -P) || phys_artifact=$ARTIFACT_DIR
65
+ if [[ -z "$EXPLICIT_PLAN" || "$PLAN_DIR/" == "${ARTIFACT_DIR}/"* || "$PLAN_DIR/" == "${phys_artifact}/"* ]]; then LINEAR_INPUT=1; fi
66
+ fi
67
+ missing_guidance() {
68
+ if [[ "$LINEAR_INPUT" == 1 ]]; then
69
+ echo 'Run Lookup and hydrate the plan from Linear before implementation.'
70
+ echo 'See artifact-store.md, Implementation skills (Resolve and hydrate).'
71
+ elif [[ "$1" == dir ]]; then
72
+ echo "Create the planning documents first:"
73
+ echo " 1. Run /shared-context ${FEATURE_NAME}"
74
+ echo " 2. Run /parallel-plan ${FEATURE_NAME}"
75
+ else
76
+ echo "The implementation requires a parallel plan to be created first."
77
+ echo "Run: /parallel-plan ${FEATURE_NAME}"
78
+ echo ""
79
+ echo "This will create parallel-plan.md with detailed implementation tasks."
80
+ fi
81
+ }
33
82
  if [[ ! -d "$PLAN_DIR" ]]; then
34
83
  echo "ERROR: Plan directory not found: $PLAN_DIR"
35
84
  echo ""
36
- echo "Create the planning documents first:"
37
- echo " 1. Run /shared-context ${FEATURE_NAME}"
38
- echo " 2. Run /parallel-plan ${FEATURE_NAME}"
85
+ missing_guidance dir
39
86
  exit 1
40
87
  fi
41
-
42
- if [[ ! -f "${PLAN_DIR}/parallel-plan.md" ]]; then
43
- echo "ERROR: ${PLAN_DIR}/parallel-plan.md not found"
44
- echo ""
45
- echo "The implementation requires a parallel plan to be created first."
46
- echo "Run: /parallel-plan ${FEATURE_NAME}"
88
+ if [[ ! -f "$PLAN_FILE" ]]; then
89
+ echo "ERROR: ${PLAN_FILE} not found"
47
90
  echo ""
48
- echo "This will create parallel-plan.md with detailed implementation tasks."
91
+ missing_guidance file
49
92
  exit 1
50
93
  fi
51
-
52
94
  if [[ ! -f "${PLAN_DIR}/shared.md" ]]; then
53
95
  echo "WARNING: ${PLAN_DIR}/shared.md not found"
54
96
  echo "The shared context document is recommended for implementation."
@@ -57,22 +99,26 @@ if [[ ! -f "${PLAN_DIR}/shared.md" ]]; then
57
99
  fi
58
100
 
59
101
  echo "Prerequisites satisfied"
60
- echo " Found: ${PLAN_DIR}/parallel-plan.md"
61
-
62
- if [[ -f "${PLAN_DIR}/shared.md" ]]; then
63
- echo " Found: ${PLAN_DIR}/shared.md"
64
- fi
65
-
66
- # Count tasks in the plan
67
- TASK_COUNT=$(grep -c "^#### Task" "${PLAN_DIR}/parallel-plan.md" 2>/dev/null || echo "0")
102
+ echo " Found: ${PLAN_FILE}"
103
+ if [[ -f "${PLAN_DIR}/shared.md" ]]; then echo " Found: ${PLAN_DIR}/shared.md"; fi
104
+ # grep -c returns 1 for zero matches; other statuses are real read failures.
105
+ plan_count() {
106
+ local pattern="$1" status=0 count
107
+ if [[ ! -r "$PLAN_FILE" ]]; then
108
+ echo "ERROR: Failed to read ${PLAN_FILE}" >&2
109
+ exit 2
110
+ fi
111
+ count=$(grep -cE "$pattern" < <(artifact_body "$PLAN_FILE")) || status=$?
112
+ if [[ "$status" -gt 1 ]]; then
113
+ echo "ERROR: Failed to read ${PLAN_FILE}" >&2
114
+ exit "$status"
115
+ fi
116
+ echo "$count"
117
+ }
118
+ TASK_COUNT=$(plan_count "^#### Task")
68
119
  echo " Tasks in plan: ${TASK_COUNT}"
69
-
70
- # Count phases
71
- PHASE_COUNT=$(grep -cE "^### (Phase|Batch)" "${PLAN_DIR}/parallel-plan.md" 2>/dev/null || echo "0")
120
+ PHASE_COUNT=$(plan_count "^### (Phase|Batch)")
72
121
  echo " Phases/Batches in plan: ${PHASE_COUNT}"
73
-
74
- # Count independent tasks
75
- INDEPENDENT_COUNT=$(grep -cE "(Depends on \[none\]|\*\*Dependencies\*\*: *[Nn]one)" "${PLAN_DIR}/parallel-plan.md" 2>/dev/null || echo "0")
122
+ INDEPENDENT_COUNT=$(plan_count "(Depends on \[none\]|\*\*Dependencies\*\*: *[Nn]one)")
76
123
  echo " Independent tasks: ${INDEPENDENT_COUNT}"
77
-
78
124
  exit 0
@@ -35,21 +35,16 @@
35
35
  # 1.1|Create user model|none
36
36
  # 1.2|Add validation|none
37
37
  #
38
- # Supports monorepo configurations via .plans-config file.
39
- # See resolve-plans-dir.sh for configuration options.
40
38
 
41
39
  set -euo pipefail
42
40
 
43
41
  PLAN_FILE="${1:-}"
44
42
 
45
- # Source the shared resolver for consistency
43
+ # Strip identity frontmatter before either parsing pass.
46
44
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
47
45
  SHARED_DIR="${SCRIPT_DIR}/../../../shared/scripts"
48
-
49
- if [[ -f "${SHARED_DIR}/resolve-plans-dir.sh" ]]; then
50
- # shellcheck source=../../../shared/scripts/resolve-plans-dir.sh
51
- source "${SHARED_DIR}/resolve-plans-dir.sh" 2>/dev/null || true
52
- fi
46
+ # shellcheck source=../../../shared/scripts/artifact-body.sh
47
+ source "${SHARED_DIR}/artifact-body.sh"
53
48
 
54
49
  if [[ -z "$PLAN_FILE" ]]; then
55
50
  echo "Usage: parse-dependencies.sh <path-to-parallel-plan.md>" >&2
@@ -60,6 +55,11 @@ if [[ ! -f "$PLAN_FILE" ]]; then
60
55
  echo "ERROR: File not found: $PLAN_FILE" >&2
61
56
  exit 1
62
57
  fi
58
+ if [[ ! -r "$PLAN_FILE" ]]; then
59
+ echo "ERROR: Cannot read: $PLAN_FILE" >&2
60
+ exit 1
61
+ fi
62
+
63
63
 
64
64
  # ─────────────────────────────────────────────────────────────────────────────
65
65
  # Pass 1 — Extract optional ## Worktree Setup header (parent path + slug).
@@ -89,7 +89,7 @@ in_wt_setup && /^\- \*\*Parent\*\*:/ {
89
89
  print "WT_FEATURE_SLUG=" slug
90
90
  found = 1
91
91
  }
92
- ' "$PLAN_FILE"
92
+ ' < <(artifact_body "$PLAN_FILE")
93
93
 
94
94
  # ─────────────────────────────────────────────────────────────────────────────
95
95
  # Pass 2 — Extract tasks and their dependencies using a state machine.
@@ -195,7 +195,7 @@ pending_id != "" && /^- \*\*Dependencies\*\*:/ {
195
195
  END {
196
196
  flush_pending()
197
197
  }
198
- ' "$PLAN_FILE" | while IFS='|' read -r task_id title deps; do
198
+ ' < <(artifact_body "$PLAN_FILE") | while IFS='|' read -r task_id title deps; do
199
199
  task_id=$(echo "$task_id" | tr -d ' ')
200
200
  title=$(echo "$title" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
201
201
  deps=$(echo "$deps" | tr -d ' ')
@@ -22,26 +22,28 @@ Context injection is deliberately one scoped helper call: no `pwd`, `ls | head`,
22
22
 
23
23
  ## Arguments
24
24
 
25
- | Flag | Meaning | Example |
26
- | --------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------- |
27
- | `--dry-run` | Preview every planned file; make no writes | `/ycc:init --dry-run` |
28
- | `--docs-only` | Skip MCP/agent selection; emit the rules files only | `/ycc:init --docs-only` |
29
- | `--templates` | Also emit `.github/` issue forms, PR template, labels | `/ycc:init --templates` |
30
- | `--git` | Also emit `.gitignore`, `.gitmessage`, commitlint (JS/TS), and the lefthook bundle | `/ycc:init --git` |
31
- | `--vendor-neutral` | Also emit `.ai/rules/project.md` pointer to `AGENTS.md` | `/ycc:init --vendor-neutral` |
32
- | `--formatters` | Also bootstrap lint/format via `formatters` (scripts, configs, aliases, docs) | `/ycc:init --formatters` |
33
- | `--release-model[=<model>]` | Run `release-model` without asking when `RELEASING.md` is missing | `/ycc:init --release-model=trunk-only` |
34
- | `--no-release-model` | Never offer `release-model` | `/ycc:init --no-release-model` |
35
- | `--migrate-rules` | Move an existing long `CLAUDE.md` into `AGENTS.md` (dry-run diff first) | `/ycc:init --migrate-rules` |
36
- | `--allow-non-git` | With `--migrate-rules`: permit non-git or git-ignored rules files (timestamped backups first) | `/ycc:init --migrate-rules --allow-non-git` |
37
- | `--no-claude-md` | Skip the `@AGENTS.md` `CLAUDE.md` shim (needs Claude Code 2.1.277+) | `/ycc:init --no-claude-md` |
38
- | `--update` | Structured refresh of existing artifacts (merge/migrate, never clobber) | `/ycc:init --update` |
39
- | `--force` | Overwrite existing files without prompting | `/ycc:init --force` |
40
- | `--profile=<lang>` | Override detected language (`rust`, `ts-node`, `python`, `go`, `mixed`, `empty`) | `/ycc:init --profile=rust` |
25
+ | Flag | Meaning | Example |
26
+ | ---------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------- |
27
+ | `--dry-run` | Preview every planned file; make no writes | `/ycc:init --dry-run` |
28
+ | `--docs-only` | Skip MCP/agent selection; emit the rules files only | `/ycc:init --docs-only` |
29
+ | `--templates` | Also emit `.github/` issue forms, PR template, labels | `/ycc:init --templates` |
30
+ | `--git` | Also emit `.gitignore`, `.gitmessage`, commitlint (JS/TS), and the lefthook bundle | `/ycc:init --git` |
31
+ | `--vendor-neutral` | Also emit `.ai/rules/project.md` pointer to `AGENTS.md` | `/ycc:init --vendor-neutral` |
32
+ | `--formatters` | Also bootstrap lint/format via `formatters` (scripts, configs, aliases, docs) | `/ycc:init --formatters` |
33
+ | `--release-model[=<model>]` | Run `release-model` without asking when `RELEASING.md` is missing | `/ycc:init --release-model=trunk-only` |
34
+ | `--no-release-model` | Never offer `release-model` | `/ycc:init --no-release-model` |
35
+ | `--artifact-store[=<store>]` | Set up the artifact-store pointer (`linear` runs without asking; `local` writes a local pointer) | `/ycc:init --artifact-store=linear` |
36
+ | `--no-artifact-store` | Never offer the artifact-store setup | `/ycc:init --no-artifact-store` |
37
+ | `--migrate-rules` | Move an existing long `CLAUDE.md` into `AGENTS.md` (dry-run diff first) | `/ycc:init --migrate-rules` |
38
+ | `--allow-non-git` | With `--migrate-rules`: permit non-git or git-ignored rules files (timestamped backups first) | `/ycc:init --migrate-rules --allow-non-git` |
39
+ | `--no-claude-md` | Skip the `@AGENTS.md` `CLAUDE.md` shim (needs Claude Code 2.1.277+) | `/ycc:init --no-claude-md` |
40
+ | `--update` | Structured refresh of existing artifacts (merge/migrate, never clobber) | `/ycc:init --update` |
41
+ | `--force` | Overwrite existing files without prompting | `/ycc:init --force` |
42
+ | `--profile=<lang>` | Override detected language (`rust`, `ts-node`, `python`, `go`, `mixed`, `empty`) | `/ycc:init --profile=rust` |
41
43
 
42
44
  Flags are composable. See `references/flag-reference.md` for the full matrix.
43
45
 
44
- **Questions:** headless (no question tool or chat turn) defaults: class `clarify` (empty or unknown profile): print the questions and stop; class `confirm-destructive` (profile confirmation, conflicts, rules migration): behave as `--dry-run`, skip existing files, print diffs and the rerun, then stop. The release-model offer is skipped unless `--release-model` is passed. See `{{package-root}}/shared/references/question-policy.md`.
46
+ **Questions:** headless (no question tool or chat turn) defaults: class `clarify` (empty or unknown profile): print the questions and stop; class `confirm-destructive` (profile confirmation, conflicts, rules migration): behave as `--dry-run`, skip existing files, print diffs and the rerun, then stop. The release-model offer is skipped unless `--release-model` is passed. The artifact-store offer is skipped unless `--artifact-store` is passed; with several Linear teams and no `ARTIFACT_LINEAR_TEAM`, skip Linear setup and report it. An artifact-store conflict (exit `3`) is skipped and reported headless. See `{{package-root}}/shared/references/question-policy.md`.
45
47
 
46
48
  ## Task
47
49
 
@@ -66,6 +68,9 @@ Extract mode booleans from `$ARGUMENTS`:
66
68
  - `UPDATE` — true if `--update` present
67
69
  - `FORCE` — true if `--force` present
68
70
  - `PROFILE` — value of `--profile=<lang>` if provided, else empty
71
+ - `ARTIFACT_STORE` — true if `--artifact-store` or `--artifact-store=<value>` present
72
+ - `ARTIFACT_STORE_FLAG` — `<value>` from `--artifact-store=<value>`, else empty (bare `--artifact-store` means `linear`). Must be `linear` or `local`; any other value is an error before any phase runs.
73
+ - `NO_ARTIFACT_STORE` — true if `--no-artifact-store` present. Combining it with `--artifact-store` is an error before any phase runs.
69
74
 
70
75
  Defaults: all booleans off; no profile override. `--update` and `--force` are mutually reinforcing: `--update` controls merge/migrate behavior, `--force` controls conflict resolution. Without either, existing files are preserved with a diff-and-ask prompt.
71
76
 
@@ -77,7 +82,7 @@ Defaults: all booleans off; no profile override. `--update` and `--force` are mu
77
82
  4. If `UPDATE=false` AND at least two of `has_claude_md`, `has_agents_md`, `has_cursor_rules`, `has_issue_templates`, `has_gitmessage`, `has_gitignore` are true: warn the user "Existing doc/workflow files detected — consider re-running with `--update` for structured refresh, or `--force` to overwrite. Continuing with default skip-on-conflict behavior."
78
83
  5. Surface the resolved profile summary to the user and wait for confirmation before writing anything — except when `DRY_RUN=true`, which proceeds directly to preview.
79
84
 
80
- If `MIGRATE_RULES=true`, jump directly to Phase 5.7 after profiling; skip all other rendering, release-model, and formatter phases. Migration ignores `--force`.
85
+ If `MIGRATE_RULES=true`, jump directly to Phase 5.7 after profiling; skip all other rendering, release-model, artifact-store, and formatter phases. Migration ignores `--force`.
81
86
 
82
87
  ### Phase 2 — Optional deep analysis
83
88
 
@@ -99,7 +104,7 @@ Feed the agent's output into the `AGENTS.md` rendering in Phase 3 (conventions a
99
104
 
100
105
  ### Phase 3 — Render templates
101
106
 
102
- Load each applicable `.tmpl` file from `{{package-root}}/skills/init/templates/`. Substitute all `{{PLACEHOLDER}}` variables using profile values from Phase 1 (and Phase 2 if run). For language-conditional blocks (`{{#IF_RUST}}...{{/IF_RUST}}` etc.), include only the block matching `primary_language`. Leave `{{#IF_RELEASE_MODEL}}...{{/IF_RELEASE_MODEL}}` blocks (in `AGENTS.md.tmpl` and `github/labels.md.tmpl`) unresolved — Phase 5 (dry run) or Phase 5.5 resolves them. Render all files in memory — do NOT write yet. `scripts/render-template.sh --template <bundled-template> [--profile -]` (profile on stdin; needs Bash 3.2+ and Python 3) renders a template without writing (a thin wrapper over `scripts/render-template.py`). It only reads templates under the skill's own `templates/` directory. A command that `profile-project.sh` reports as `unknown` renders as `# not detected` inside fenced shell blocks, and any template that would put it into YAML (`run:`) or a checklist guards it with `IF_*_CMD` / `IF_NO_*_CMD` blocks instead (lefthook `pre-push` is omitted, with a comment, when no test command is detected). If `profile-project.sh` warns that `jq` is missing, say so in the Phase 1 summary: JS/TS commands could not be detected and will render as `# not detected`. Mixed-language profiles keep the language blocks of every component language in `secondary_languages`.
107
+ Load each applicable `.tmpl` file from `{{package-root}}/skills/init/templates/`. Substitute all `{{PLACEHOLDER}}` variables using profile values from Phase 1 (and Phase 2 if run). For language-conditional blocks (`{{#IF_RUST}}...{{/IF_RUST}}` etc.), include only the block matching `primary_language`. Leave `{{#IF_RELEASE_MODEL}}...{{/IF_RELEASE_MODEL}}` blocks (in `AGENTS.md.tmpl` and `github/labels.md.tmpl`) unresolved — Phase 5 (dry run) or Phase 5.5 resolves them — and `{{#IF_ARTIFACT_STORE}}...{{/IF_ARTIFACT_STORE}}` blocks (in `AGENTS.md.tmpl`) unresolved — Phase 5 (dry run) or Phase 5.6 resolves them. Render all files in memory — do NOT write yet. `scripts/render-template.sh --template <bundled-template> [--profile -]` (profile on stdin; needs Bash 3.2+ and Python 3) renders a template without writing (a thin wrapper over `scripts/render-template.py`). It only reads templates under the skill's own `templates/` directory. A command that `profile-project.sh` reports as `unknown` renders as `# not detected` inside fenced shell blocks, and any template that would put it into YAML (`run:`) or a checklist guards it with `IF_*_CMD` / `IF_NO_*_CMD` blocks instead (lefthook `pre-push` is omitted, with a comment, when no test command is detected). If `profile-project.sh` warns that `jq` is missing, say so in the Phase 1 summary: JS/TS commands could not be detected and will render as `# not detected`. Mixed-language profiles keep the language blocks of every component language in `secondary_languages`.
103
108
 
104
109
  Rendering map:
105
110
 
@@ -150,11 +155,12 @@ Present all available options as checkboxes organized by category. Pre-check ite
150
155
 
151
156
  If `DRY_RUN=true`:
152
157
 
153
- - Print a listing of every planned file with a preview snippet (first ~15 lines each). Resolve `IF_RELEASE_MODEL` blocks as kept when `has_releasing_md=true` or `RELEASE_MODEL=true`, else drop them.
158
+ - Print a listing of every planned file with a preview snippet (first ~15 lines each). Resolve `IF_RELEASE_MODEL` blocks as kept when `has_releasing_md=true` or `RELEASE_MODEL=true`, else drop them. Resolve `IF_ARTIFACT_STORE` blocks as kept only when the effective choice is linear: `ARTIFACT_STORE_FLAG` is not `local` and either the root pointer is already linear and tracked or Phase 5.6 would run Linear setup (`ARTIFACT_STORE=true`). An explicit `--artifact-store=local` always drops the block.
154
159
  - Print planned rules-file line counts (see Phase 7) so oversize output is visible before any write.
155
160
  - Show the planned `.mcp.json` content.
156
161
  - List agent files that would be copied.
157
162
  - Print the release-model step Phase 5.5 would take: "skip (RELEASING.md exists)", "skip (--no-release-model)", "would run `release-model` [--model <value> --yes]", or "would offer `release-model`".
163
+ - Print the artifact-store step Phase 5.6 would take: "skip (linear pointer already tracked)", "skip (--no-artifact-store)", "would run `artifact-store-pointer.sh --store=local`", "would run `artifact-store-pointer.sh --store=linear` (--artifact-store)", "skip (--docs-only)", "skip (headless)", or "would offer Linear artifact-store setup". Before previewing a Linear helper run, perform Phase 5.6's read-only Gather (`get_workspace`, `list_teams`, existing hints and repo label); do not create Linear objects. If all required values resolve, run the full helper command with `--dry-run` (writes nothing) and show the planned `.plans-config`. If values cannot resolve (including headless multi-team ambiguity), print the command with placeholders for missing values and explicitly report that it was not run. Local previews need no Linear Gather.
158
164
  - STOP — make no writes.
159
165
 
160
166
  ### Phase 5.5 — Release model
@@ -171,6 +177,30 @@ Decide whether to create `RELEASING.md` (the project's branching and release rul
171
177
  3. **Resolve** every `IF_RELEASE_MODEL` block rendered in Phase 3: keep the block contents when `RELEASING.md` now exists at the project root, else drop the block. This covers "exists already" and "created in this run", and drops the pointer if `release-model` was declined or failed.
172
178
  4. If `release-model` errors, record the failure for the Phase 7 summary and continue — do not abort init.
173
179
 
180
+ ### Phase 5.6 — Artifact store
181
+
182
+ Decide whether to write the committed artifact-store pointer (the root `.plans-config`; see `{{package-root}}/shared/references/artifact-store.md`), then resolve the `IF_ARTIFACT_STORE` blocks. This phase runs before Phase 6 so the pointer exists before `AGENTS.md` is applied. `linear` is already the default store; the offered Linear pointer records workspace/team hints and pins the store for fresh clones, while `--artifact-store=local` pins local mode.
183
+
184
+ 1. **Choose the action** (first match wins):
185
+ - The root pointer has effective `store: linear` AND is tracked (`git --literal-pathspecs -C <repo-root> ls-files --error-unmatch -- .plans-config` succeeds), unless `ARTIFACT_STORE_FLAG=local` → skip. An untracked linear pointer does not skip setup; reuse its existing values in Gather and rerun the helper when setup is chosen.
186
+ - `NO_ARTIFACT_STORE=true` → skip.
187
+ - `ARTIFACT_STORE_FLAG=local` → run the helper with `--store=local`.
188
+ - `ARTIFACT_STORE=true` (`--artifact-store` or `--artifact-store=linear`) → run the Linear setup without asking.
189
+ - `DOCS_ONLY=true` (and no `--artifact-store`) → skip; `--docs-only` stays limited to the rules files.
190
+ - Headless (no question tool or chat turn) without `--artifact-store` → skip.
191
+ - Otherwise, when a Linear MCP is available in this runtime → ask: "Store planning artifacts in Linear? This writes and commits `.plans-config` and ignores `.ycc/artifacts/`." Default: no. With no Linear MCP, or "no" → skip silently.
192
+ 2. **Gather** for the Linear setup: existing `ARTIFACT_LINEAR_*` hints (including values already in the root pointer) override defaults. Otherwise get the workspace slug from Linear MCP `get_workspace`; get the team key from `ARTIFACT_LINEAR_TEAM` or `list_teams` (use the only team; ask when several). Headless with several teams and no team hint skips Linear setup and reports the ambiguity. Default the mapping to label `repo:<repo-name>`, taking the `origin` remote basename minus `.git`; without an origin use the main checkout directory name (parent of `git rev-parse --path-format=absolute --git-common-dir`), not the worktree directory name. A project hint or user-supplied fixed Linear Project uses `--linear-project` instead. Without a reachable Linear MCP under `--artifact-store`, record the failure for Phase 7 and continue.
193
+ 3. **Run** the helper once (never retry in a loop):
194
+
195
+ ```bash
196
+ {{package-root}}/shared/scripts/artifact-store-pointer.sh --store=linear --linear-workspace=<slug> --linear-team=<KEY> --linear-label=<label> .
197
+ ```
198
+
199
+ Use `--linear-project=<id-or-slug>` instead of `--linear-label`, and `--store=local` with no other options for the local case. Under `DRY_RUN=true`, Phase 5 performs read-only Gather and runs the same full command with `--dry-run` added; Phase 5.6 does not run. Read the `pointer_change=`, `gitignore=` and `commit=` lines for Phase 7. Exit `3` for an existing value or label/project mapping conflict means show the message and ask once whether to rerun with `--force` (headless or no answer: skip and report). Exit `3` naming nested configs without `scope: local` means creating the root pointer would change their plans directory: skip setup and report the named paths; do not force this automatically. All refusal checks precede writes. Pre-existing staged or unstaged pointer changes, or an untracked pointer with unrelated keys, cause a warning and `commit=skipped`, but the helper still writes the files and exits `0`; report that no commit was made.
200
+
201
+ 4. **Resolve** every `IF_ARTIFACT_STORE` block rendered in Phase 3: keep it only when the helper exited `0` with the effective choice linear, or the root pointer was already linear and tracked; an explicit local choice drops it. A failed run never keeps the block merely because a linear pointer remains on disk. Under `DRY_RUN=true`, use Phase 5's effective-linear rule. `render-template` does not compute this block: pass `--keep IF_ARTIFACT_STORE` for both `AGENTS.md.tmpl` and `git/gitignore.tmpl` when kept. The generated `AGENTS.md` carries the section; no separate compatibility-shim section is needed.
202
+ 5. If the helper or MCP step fails, record the failure for the Phase 7 summary and continue — do not abort init. A failed run leaves the block dropped.
203
+
174
204
  ### Phase 5.7 — Rules migration (when `MIGRATE_RULES=true`)
175
205
 
176
206
  Runs instead of Phases 2–6.5 (profile only), for repos that already have a long `CLAUDE.md`. Never silently rewrites it.
@@ -188,32 +218,34 @@ For each rendered file from Phase 3, apply the resolution rule below. Never sile
188
218
 
189
219
  **Existing rules safeguard (before all resolution rules)** → never rewrite an existing non-importing `CLAUDE.md` or a legacy pointer `AGENTS.md`, even with `--force`; offer `--migrate-rules`. Skip rendering new rules files that would conflict with that existing canonical layout.
190
220
 
221
+ **Artifact-store merge safeguards (before force/update/default rules)** → when Phase 5.6 keeps `IF_ARTIFACT_STORE` and `--artifact-store=linear` was explicitly passed, append the missing `## Planning artifacts` section to an existing canonical `AGENTS.md`, like `--update`, without rewriting any other content (even with `--force`). The same applies to bare `--artifact-store`, whose effective value is linear. Preserve the existing rules-layout safeguard above. If Phase 5.6 created or edited `.gitignore`, merge/append the rendered gitignore template content while preserving existing lines and `.ycc/artifacts/`; never skip or clobber that file, even headless or with `--force`.
222
+
191
223
  **Target exists AND `FORCE=true`** → overwrite other artifacts and log the path.
192
224
 
193
225
  **Target exists AND `UPDATE=true`** → structured refresh per artifact type:
194
226
 
195
- | Artifact | Update behavior |
196
- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197
- | `AGENTS.md` (canonical or custom) | Parse existing `##`-level headings. Append only the template sections that are missing; preserve existing content verbatim. Report the appended section list. |
198
- | `AGENTS.md` (legacy pointer, `agents_md_is_pointer=true`) | Offer `--migrate-rules` (the pointer names `CLAUDE.md`, so the real rules are there). Without it, leave the file untouched. |
199
- | `CLAUDE.md` (already `@AGENTS.md`) | Leave untouched. |
200
- | `CLAUDE.md` (long, no `@AGENTS.md`) | Never rewrite. Print the line count and offer `--migrate-rules` (dry-run diff first). Without it, leave the file and `AGENTS.md` as they are. |
201
- | `.cursor/rules/<scope>.mdc` | Overwrite body content; preserve any non-standard frontmatter keys the user added beyond `description`, `globs`, `alwaysApply`. |
202
- | `.cursor/rules/project.mdc` (legacy always-apply copy) | Leave as is; advise removing it once `AGENTS.md` is canonical (Cursor reads `AGENTS.md` when available; verify your version). |
203
- | `.cursorrules` (legacy, `has_legacy_cursorrules=true`) | Offer `--migrate-rules`-style review: show its content, fold project-specific lines into `AGENTS.md`, and advise deleting `.cursorrules` (do not delete automatically). |
204
- | `.ai/rules/project.md` | Overwrite the pointer body. |
205
- | `.github/ISSUE_TEMPLATE/*.yml` | Per template: if missing → create; if present → show diff and default to skip (issue forms are often customized). `--update --force` overwrites. |
206
- | `.github/pull_request_template.md` | Show diff; default skip. `--update --force` overwrites. |
207
- | `.github/labels.md` | Always overwrite (reference doc, safe to refresh). |
208
- | `.github/copilot-instructions.md` | Show diff; default skip (users customise agent-facing rules). `--update --force` overwrites. |
209
- | `.github/workflows/pr-title.yml` | Show diff; default skip (users may customise the Conventional Commits type list or branch filters). `--update --force` overwrites. |
210
- | `.github/workflows/pr-title-autofix.yml` | Show diff; default skip (users may tune the placeholder regex, the type-normalization pass, or the draft-toggle behaviour). `--update --force` overwrites. |
211
- | `.gitignore` | Show diff; default skip (users curate this file heavily). `--update --force` overwrites. When `has_gitignore=true` at Phase 1, warn the user the file already exists. |
212
- | `.gitmessage` | Show diff; default skip. `--update --force` overwrites (usually safe — it is a reference template). |
213
- | `commitlint.config.cjs` | If present → show diff and default skip with a warning ("commitlint rules are often project-customized"). `--update --force` overwrites. |
214
- | `lefthook.yml` | Show diff; default skip (users often extend the config with project-specific commands). `--update --force` overwrites. When `has_lefthook_config=true` at Phase 1, warn the user the file already exists. |
215
- | `scripts/install-lefthook.sh` | Always overwrite (managed bootstrap tooling; tracks upstream improvements). |
216
- | `docs/lefthook-usage.md` | Always overwrite (managed reference doc). |
227
+ | Artifact | Update behavior |
228
+ | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
229
+ | `AGENTS.md` (canonical or custom) | Parse existing `##`-level headings. Append only missing template sections (including `## Planning artifacts` when Phase 5.6 keeps `IF_ARTIFACT_STORE`); preserve existing content verbatim. Report the appended section list. |
230
+ | `AGENTS.md` (legacy pointer, `agents_md_is_pointer=true`) | Offer `--migrate-rules` (the pointer names `CLAUDE.md`, so the real rules are there). Without it, leave the file untouched. |
231
+ | `CLAUDE.md` (already `@AGENTS.md`) | Leave untouched. |
232
+ | `CLAUDE.md` (long, no `@AGENTS.md`) | Never rewrite. Print the line count and offer `--migrate-rules` (dry-run diff first). Without it, leave the file and `AGENTS.md` as they are. |
233
+ | `.cursor/rules/<scope>.mdc` | Overwrite body content; preserve any non-standard frontmatter keys the user added beyond `description`, `globs`, `alwaysApply`. |
234
+ | `.cursor/rules/project.mdc` (legacy always-apply copy) | Leave as is; advise removing it once `AGENTS.md` is canonical (Cursor reads `AGENTS.md` when available; verify your version). |
235
+ | `.cursorrules` (legacy, `has_legacy_cursorrules=true`) | Offer `--migrate-rules`-style review: show its content, fold project-specific lines into `AGENTS.md`, and advise deleting `.cursorrules` (do not delete automatically). |
236
+ | `.ai/rules/project.md` | Overwrite the pointer body. |
237
+ | `.github/ISSUE_TEMPLATE/*.yml` | Per template: if missing → create; if present → show diff and default to skip (issue forms are often customized). `--update --force` overwrites. |
238
+ | `.github/pull_request_template.md` | Show diff; default skip. `--update --force` overwrites. |
239
+ | `.github/labels.md` | Always overwrite (reference doc, safe to refresh). |
240
+ | `.github/copilot-instructions.md` | Show diff; default skip (users customise agent-facing rules). `--update --force` overwrites. |
241
+ | `.github/workflows/pr-title.yml` | Show diff; default skip (users may customise the Conventional Commits type list or branch filters). `--update --force` overwrites. |
242
+ | `.github/workflows/pr-title-autofix.yml` | Show diff; default skip (users may tune the placeholder regex, the type-normalization pass, or the draft-toggle behaviour). `--update --force` overwrites. |
243
+ | `.gitignore` | If Phase 5.6 created/edited it, always merge/append the rendered template, preserving existing content and `.ycc/artifacts/` (never skip or clobber, even with `--force`). Otherwise show diff; default skip. `--update --force` overwrites. Warn when `has_gitignore=true` at Phase 1. |
244
+ | `.gitmessage` | Show diff; default skip. `--update --force` overwrites (usually safe — it is a reference template). |
245
+ | `commitlint.config.cjs` | If present → show diff and default skip with a warning ("commitlint rules are often project-customized"). `--update --force` overwrites. |
246
+ | `lefthook.yml` | Show diff; default skip (users often extend the config with project-specific commands). `--update --force` overwrites. When `has_lefthook_config=true` at Phase 1, warn the user the file already exists. |
247
+ | `scripts/install-lefthook.sh` | Always overwrite (managed bootstrap tooling; tracks upstream improvements). |
248
+ | `docs/lefthook-usage.md` | Always overwrite (managed reference doc). |
217
249
 
218
250
  **Target exists AND `UPDATE=false` AND `FORCE=false`** → show a unified diff, then prompt the user with three choices: overwrite, merge (only meaningful for `AGENTS.md`), or skip. Default choice: skip.
219
251
 
@@ -247,6 +279,8 @@ Produce a summary using `{{package-root}}/skills/init/templates/workspace-report
247
279
 
248
280
  **Release model** — the Phase 5.5 outcome: `RELEASING.md` created (with the chosen model), already present, skipped (and why), declined, or failed (with the error).
249
281
 
282
+ **Artifact store** — the Phase 5.6 outcome: pointer written and committed (`store: linear|local`, with the helper's `pointer_change=`, `gitignore=` and `commit=` lines), already `linear`, skipped (and why), declined, or failed (with the error). When linear was set up, remind the user that the `.plans-config` commit is local until pushed.
283
+
250
284
  **Next steps** — suggest:
251
285
 
252
286
  - `git config commit.template .gitmessage` (if `GIT=true`)
@@ -269,6 +303,7 @@ Produce a summary using `{{package-root}}/skills/init/templates/workspace-report
269
303
  - No new agents are registered. `codebase-research-analyst` is called only once, conditionally, for large existing repos (>50 source files) when `--docs-only` is not set.
270
304
  - The MCP and agent selection flow is preserved unchanged behind `--docs-only`.
271
305
  - A missing `RELEASING.md` never blocks init. Phase 5.5 only offers `release-model`; `--release-model` runs it and `--no-release-model` silences the offer.
306
+ - A missing artifact-store pointer never blocks init. `linear` is the default store without one; Phase 5.6 only offers to commit a Linear pointer with workspace/team hints (interactive, Linear MCP available), `--artifact-store[=linear|local]` runs it without asking, and `--no-artifact-store` silences it.
272
307
  - For the full flag matrix with composability examples, see `references/flag-reference.md`.
273
308
  - Read `references/conventional-commits.md` only when the user asks for the full commit-type reference; the generated `AGENTS.md` carries a one-line rule, not the types table. Read `references/label-taxonomy.md` when rendering
274
309
  `.github/labels.md` (`--templates`).