@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.
- package/README.md +7 -3
- package/agents/code-researcher.md +3 -3
- package/agents/feature-researcher.md +1 -1
- package/agents/implementor.md +4 -4
- package/agents/pr-comment-fixer.md +1 -1
- package/agents/release-fix-applier.md +1 -1
- package/agents/review-fixer.md +1 -1
- package/index.js +146 -95
- package/package.json +1 -1
- package/registration.json +0 -4
- package/shared/references/artifact-store.md +613 -0
- package/shared/references/branch-prep.md +2 -0
- package/shared/references/forge-detection.md +3 -2
- package/shared/references/review-artifact-format.md +13 -6
- package/shared/references/review-checklist.md +3 -2
- package/shared/references/review-dispatch.md +15 -10
- package/shared/references/target-capability-matrix.md +140 -32
- package/shared/references/visual-mode.md +19 -13
- package/shared/references/worktree-strategy.md +12 -8
- package/shared/scripts/artifact-body.sh +71 -0
- package/shared/scripts/artifact-store-pointer.sh +245 -0
- package/shared/scripts/ci-monitor.sh +9 -4
- package/shared/scripts/collect-linear-keys.sh +77 -0
- package/shared/scripts/lib/ci-classify.sh +13 -10
- package/shared/scripts/lib/forge.sh +13 -4
- package/shared/scripts/prepare-feature-branch.sh +118 -10
- package/shared/scripts/release-ci-monitor.sh +2 -2
- package/shared/scripts/report-bundle-drift.sh +1 -1
- package/shared/scripts/resolve-artifact-store.sh +636 -0
- package/shared/scripts/validate-file-paths.sh +11 -4
- package/skills/blueprint/SKILL.md +48 -13
- package/skills/bundle-release/scripts/draft-notes.sh +1 -1
- package/skills/bundle-release/scripts/release_versions.py +9 -1
- package/skills/clean/SKILL.md +1 -1
- package/skills/clean/scripts/detect-project-type.sh +2 -2
- package/skills/clean/scripts/generate-report.sh +34 -5
- package/skills/clean/scripts/validate-safety.sh +9 -6
- package/skills/code-report/SKILL.md +26 -14
- package/skills/code-report/scripts/check-prerequisites.sh +72 -12
- package/skills/code-report/templates/report-structure.md +1 -1
- package/skills/code-review/SKILL.md +68 -17
- package/skills/code-review/references/pr-procedure.md +28 -15
- package/skills/compatibility-audit/SKILL.md +10 -5
- package/skills/compatibility-audit/references/reading-the-report.md +4 -1
- package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +64 -7
- package/skills/compatibility-audit/scripts/audit-target-features.sh +13 -10
- package/skills/deep-research/SKILL.md +28 -5
- package/skills/deep-research/references/completion-summary-template.md +3 -2
- package/skills/deep-research/scripts/validate-research.sh +8 -2
- package/skills/feature-research/SKILL.md +48 -25
- package/skills/feature-research/scripts/validate-research.sh +51 -12
- package/skills/feature-research/scripts/validate-spec.sh +53 -22
- package/skills/feature-research/templates/research-agents.md +15 -14
- package/skills/feature-research/templates/spec-structure.md +5 -0
- package/skills/formatters/scripts/apply-aliases.sh +3 -1
- package/skills/formatters/scripts/apply-ci.sh +3 -1
- package/skills/git-workflow/SKILL.md +2 -1
- package/skills/git-workflow/references/pr-creation.md +10 -0
- package/skills/git-workflow/scripts/analyze-changes.sh +21 -11
- package/skills/git-workflow/scripts/create-pr.sh +51 -6
- package/skills/git-workflow/scripts/validate-commit.sh +26 -14
- package/skills/hooks-workflow/scripts/verify-hooks.sh +1 -1
- package/skills/implement-plan/SKILL.md +35 -16
- package/skills/implement-plan/references/agent-task-prompt.md +8 -5
- package/skills/implement-plan/references/linear-sync.md +20 -0
- package/skills/implement-plan/references/output-formats.md +17 -2
- package/skills/implement-plan/references/plan-inputs.md +23 -4
- package/skills/implement-plan/scripts/check-prerequisites.sh +95 -49
- package/skills/implement-plan/scripts/parse-dependencies.sh +10 -10
- package/skills/init/SKILL.md +77 -42
- package/skills/init/references/flag-reference.md +41 -17
- package/skills/init/references/project-profile-heuristics.md +3 -0
- package/skills/init/references/template-library.md +15 -5
- package/skills/init/scripts/profile-project.sh +26 -0
- package/skills/init/scripts/render-template.py +2 -2
- package/skills/init/templates/AGENTS.md.tmpl +6 -0
- package/skills/init/templates/git/gitignore.tmpl +5 -0
- package/skills/orchestrate/SKILL.md +17 -2
- package/skills/parallel-plan/SKILL.md +14 -8
- package/skills/plan/SKILL.md +18 -2
- package/skills/plan/references/planning-tracks.md +1 -1
- package/skills/plan-workflow/SKILL.md +67 -32
- package/skills/plan-workflow/references/checkpoint-messages.md +23 -14
- package/skills/plan-workflow/references/plan-structure.md +1 -1
- package/skills/plan-workflow/references/planning-agents.md +11 -9
- package/skills/plan-workflow/references/research-agents-optimized.md +12 -10
- package/skills/plan-workflow/references/research-agents.md +11 -10
- package/skills/plan-workflow/scripts/check-prerequisites.sh +50 -11
- package/skills/plan-workflow/scripts/check-state.sh +53 -9
- package/skills/plan-workflow/scripts/persist-or-fail.sh +21 -7
- package/skills/plan-workflow/scripts/validate-analysis-artifacts.sh +28 -14
- package/skills/plan-workflow/scripts/validate-research-artifacts.sh +35 -10
- package/skills/plan-workflow/scripts/validate-shared.sh +56 -15
- package/skills/plan-workflow/scripts/validate-workflow-plan.sh +48 -17
- package/skills/pr-autofix/SKILL.md +19 -4
- package/skills/pr-autofix/references/output-templates.md +3 -2
- package/skills/pr-autofix/scripts/fetch-pr-comments.sh +1 -2
- package/skills/pr-autofix/scripts/post-summary.sh +1 -2
- package/skills/pr-autofix/scripts/resolve-thread.sh +3 -4
- package/skills/prp-implement/SKILL.md +31 -16
- package/skills/prp-implement/references/agent-task-prompt.md +5 -2
- package/skills/prp-implement/references/detection.md +4 -1
- package/skills/prp-implement/references/linear-sync.md +25 -0
- package/skills/prp-implement/references/report-output.md +15 -2
- package/skills/prp-plan/SKILL.md +62 -30
- package/skills/prp-plan/references/enhanced-researchers.md +8 -9
- package/skills/prp-plan/scripts/validate-prp-plan.sh +42 -18
- package/skills/prp-pr/SKILL.md +14 -1
- package/skills/prp-prd/SKILL.md +21 -9
- package/skills/prp-spec/SKILL.md +30 -20
- package/skills/quick-fix/SKILL.md +6 -4
- package/skills/quick-review/SKILL.md +62 -25
- package/skills/release-model/scripts/collect-signals.sh +9 -3
- package/skills/releaser/scripts/publish-release.sh +6 -3
- package/skills/research-to-issues/SKILL.md +33 -14
- package/skills/research-to-issues/scripts/validate-prerequisites.sh +45 -23
- package/skills/research-to-issues/templates/task-issue.md +4 -0
- package/skills/research-to-issues/templates/tracking-issue.md +3 -0
- package/skills/review-fix/SKILL.md +96 -14
- package/skills/review-fix/references/fix-report.md +10 -10
- package/skills/review-fix/references/plan.md +5 -2
- package/skills/shared-context/SKILL.md +14 -11
- package/skills/visual-plan/SKILL.md +26 -8
- package/skills/visual-recap/SKILL.md +1 -1
- package/skills/write-docs/scripts/audit-documentation.sh +44 -10
- package/skills/write-docs/scripts/generate-doc-index.sh +10 -3
|
@@ -7,31 +7,60 @@
|
|
|
7
7
|
|
|
8
8
|
set -euo pipefail
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Source the shared resolver to get PLANS_DIR
|
|
10
|
+
# Source the artifact-store resolver: the feature dir is PLANS_DIR/<feature>
|
|
11
|
+
# in local mode and .ycc/artifacts/<feature> in linear mode.
|
|
13
12
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
14
13
|
SHARED_DIR="${SCRIPT_DIR}/../../../shared/scripts"
|
|
15
14
|
|
|
16
|
-
if [[ -f "${SHARED_DIR}/resolve-
|
|
17
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
18
|
-
source "${SHARED_DIR}/resolve-
|
|
15
|
+
if [[ -f "${SHARED_DIR}/resolve-artifact-store.sh" ]]; then
|
|
16
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
17
|
+
source "${SHARED_DIR}/resolve-artifact-store.sh"
|
|
19
18
|
else
|
|
20
19
|
# ponytail: resolver ships with the plugin; failing beats guessing a wrong
|
|
21
20
|
# relative docs/plans. Upgrade path: restore resolver alongside this script.
|
|
22
|
-
echo "ERROR: resolve-
|
|
21
|
+
echo "ERROR: resolve-artifact-store.sh not found at ${SHARED_DIR}" >&2
|
|
23
22
|
echo "Cannot resolve plans directory safely; refusing to guess." >&2
|
|
24
23
|
exit 1
|
|
25
24
|
fi
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
FEATURE_NAME=""
|
|
27
|
+
STORE_FLAG=""
|
|
28
|
+
while [[ $# -gt 0 ]]; do
|
|
29
|
+
case "$1" in
|
|
30
|
+
--store=*)
|
|
31
|
+
STORE_FLAG="$1"
|
|
32
|
+
;;
|
|
33
|
+
*)
|
|
34
|
+
if [[ -z "$FEATURE_NAME" ]]; then
|
|
35
|
+
FEATURE_NAME="$1"
|
|
36
|
+
else
|
|
37
|
+
echo "Usage: check-prerequisites.sh <feature-name> [--store=linear|local]" >&2
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
;;
|
|
41
|
+
esac
|
|
42
|
+
shift
|
|
43
|
+
done
|
|
44
|
+
|
|
45
|
+
if [[ -n "$STORE_FLAG" ]]; then
|
|
46
|
+
# shellcheck disable=SC2086
|
|
47
|
+
resolve_artifact_store "$PWD" "$STORE_FLAG" || {
|
|
48
|
+
echo "ERROR: invalid ${STORE_FLAG#--}" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
}
|
|
51
|
+
fi
|
|
28
52
|
|
|
29
53
|
if [[ -z "$FEATURE_NAME" ]]; then
|
|
30
54
|
echo "ERROR: Feature name required"
|
|
31
|
-
echo "Usage: check-prerequisites.sh <feature-name>"
|
|
55
|
+
echo "Usage: check-prerequisites.sh <feature-name> [--store=linear|local]"
|
|
32
56
|
exit 1
|
|
33
57
|
fi
|
|
34
58
|
|
|
59
|
+
# The resolver prints its own reason (invalid store config or feature name).
|
|
60
|
+
# Default store: an existing local plan keeps local mode (artifact-store.md Inputs).
|
|
61
|
+
if [[ -z "$STORE_FLAG" ]]; then select_local_plan_store "$FEATURE_NAME" || exit 1; fi
|
|
62
|
+
PLAN_DIR="$(get_plans_feature_dir "$FEATURE_NAME")" || exit 1
|
|
63
|
+
|
|
35
64
|
if [[ ! -d "$PLAN_DIR" ]]; then
|
|
36
65
|
echo "ERROR: Plan directory not found: $PLAN_DIR"
|
|
37
66
|
echo "Create the directory first or run /shared-context to initialize planning"
|
|
@@ -56,8 +85,18 @@ if [[ -f "${PLAN_DIR}/requirements.md" ]]; then
|
|
|
56
85
|
echo " Found: ${PLAN_DIR}/requirements.md"
|
|
57
86
|
fi
|
|
58
87
|
|
|
59
|
-
# Count other markdown files for context
|
|
60
|
-
|
|
88
|
+
# Count other markdown files for context. Research lives either directly in
|
|
89
|
+
# the feature dir (local layout) or in its research/ subdir (linear layout).
|
|
90
|
+
RESEARCH_DIR="${PLAN_DIR}/research"
|
|
91
|
+
if [[ -d "$RESEARCH_DIR" ]]; then
|
|
92
|
+
OTHER_FILES=$(find "$RESEARCH_DIR" -maxdepth 1 -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
93
|
+
if [[ $OTHER_FILES -gt 0 ]]; then
|
|
94
|
+
echo " Found: $OTHER_FILES research file(s)"
|
|
95
|
+
fi
|
|
96
|
+
OTHER_FILES=$(find "$PLAN_DIR" -maxdepth 1 -name "*.md" ! -name "shared.md" ! -name "requirements.md" ! -name "parallel-plan.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
97
|
+
else
|
|
98
|
+
OTHER_FILES=$(find "$PLAN_DIR" -maxdepth 1 -name "*.md" ! -name "shared.md" ! -name "requirements.md" ! -name "parallel-plan.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
99
|
+
fi
|
|
61
100
|
if [[ $OTHER_FILES -gt 0 ]]; then
|
|
62
101
|
echo " Found: $OTHER_FILES additional context file(s)"
|
|
63
102
|
fi
|
|
@@ -14,18 +14,17 @@
|
|
|
14
14
|
|
|
15
15
|
set -uo pipefail
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Source the shared resolver to get PLANS_DIR
|
|
17
|
+
# Source the artifact-store resolver: the feature dir is PLANS_DIR/<feature>
|
|
18
|
+
# in local mode and .ycc/artifacts/<feature> in linear mode.
|
|
20
19
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
21
20
|
SHARED_DIR="${SCRIPT_DIR}/../../../shared/scripts"
|
|
22
21
|
|
|
23
|
-
if [[ -f "${SHARED_DIR}/resolve-
|
|
24
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
25
|
-
source "${SHARED_DIR}/resolve-
|
|
22
|
+
if [[ -f "${SHARED_DIR}/resolve-artifact-store.sh" ]]; then
|
|
23
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
24
|
+
source "${SHARED_DIR}/resolve-artifact-store.sh"
|
|
26
25
|
else
|
|
27
26
|
# Fallback if shared resolver not found - compute absolute repo root
|
|
28
|
-
echo "WARNING: resolve-
|
|
27
|
+
echo "WARNING: resolve-artifact-store.sh not found, using default path" >&2
|
|
29
28
|
|
|
30
29
|
# Try to find repo root using git
|
|
31
30
|
if REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null); then
|
|
@@ -47,7 +46,33 @@ else
|
|
|
47
46
|
export PLANS_ROOT="$REPO_ROOT"
|
|
48
47
|
fi
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
# Optional explicit store override from the invoking skill.
|
|
50
|
+
STORE_FLAG=""
|
|
51
|
+
FEATURE_NAME=""
|
|
52
|
+
while [[ $# -gt 0 ]]; do
|
|
53
|
+
case "$1" in
|
|
54
|
+
--store=*)
|
|
55
|
+
STORE_FLAG="$1"
|
|
56
|
+
;;
|
|
57
|
+
*)
|
|
58
|
+
if [[ -z "$FEATURE_NAME" ]]; then
|
|
59
|
+
FEATURE_NAME="$1"
|
|
60
|
+
else
|
|
61
|
+
echo "Usage: check-state.sh <feature-name> [--store=linear|local]" >&2
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
;;
|
|
65
|
+
esac
|
|
66
|
+
shift
|
|
67
|
+
done
|
|
68
|
+
|
|
69
|
+
if [[ -n "$STORE_FLAG" ]]; then
|
|
70
|
+
# shellcheck disable=SC2086
|
|
71
|
+
resolve_artifact_store "$PWD" "$STORE_FLAG" || {
|
|
72
|
+
echo "ERROR: invalid ${STORE_FLAG#--}" >&2
|
|
73
|
+
exit 1
|
|
74
|
+
}
|
|
75
|
+
fi
|
|
51
76
|
|
|
52
77
|
# Colors for output
|
|
53
78
|
YELLOW='\033[0;33m'
|
|
@@ -79,6 +104,15 @@ if [[ -z "$FEATURE_NAME" ]]; then
|
|
|
79
104
|
exit 1
|
|
80
105
|
fi
|
|
81
106
|
|
|
107
|
+
# The resolver prints its own reason (invalid store config or feature name).
|
|
108
|
+
if [[ -f "${SHARED_DIR}/resolve-artifact-store.sh" ]]; then
|
|
109
|
+
# Default store: an existing local plan keeps local mode (artifact-store.md Inputs).
|
|
110
|
+
if [[ -z "$STORE_FLAG" ]]; then select_local_plan_store "$FEATURE_NAME" || exit 1; fi
|
|
111
|
+
PLAN_DIR="$(get_plans_feature_dir "$FEATURE_NAME")" || exit 1
|
|
112
|
+
else
|
|
113
|
+
PLAN_DIR="${PLANS_DIR}/${FEATURE_NAME}"
|
|
114
|
+
fi
|
|
115
|
+
|
|
82
116
|
echo "Checking state for: ${FEATURE_NAME}"
|
|
83
117
|
echo "Directory: ${PLAN_DIR}"
|
|
84
118
|
echo "---"
|
|
@@ -119,13 +153,23 @@ if [[ "$DIR_EXISTS" == "true" ]]; then
|
|
|
119
153
|
missing "parallel-plan.md"
|
|
120
154
|
fi
|
|
121
155
|
|
|
122
|
-
# Count research files
|
|
156
|
+
# Count research files: directly in the feature dir (local layout) and in
|
|
157
|
+
# its research/ subdir when present (linear layout).
|
|
123
158
|
RESEARCH_COUNT=$(find "$PLAN_DIR" -maxdepth 1 -name "research-*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
159
|
+
if [[ -d "${PLAN_DIR}/research" ]]; then
|
|
160
|
+
SUB_COUNT=$(find "${PLAN_DIR}/research" -maxdepth 1 -name "research-*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
161
|
+
RESEARCH_COUNT=$((RESEARCH_COUNT + SUB_COUNT))
|
|
162
|
+
fi
|
|
124
163
|
if [[ $RESEARCH_COUNT -gt 0 ]]; then
|
|
125
164
|
found "$RESEARCH_COUNT research file(s)"
|
|
126
165
|
find "$PLAN_DIR" -maxdepth 1 -name "research-*.md" -exec basename {} \; | while read -r f; do
|
|
127
166
|
echo " - $f"
|
|
128
167
|
done
|
|
168
|
+
if [[ -d "${PLAN_DIR}/research" ]]; then
|
|
169
|
+
find "${PLAN_DIR}/research" -maxdepth 1 -name "research-*.md" -exec basename {} \; | while read -r f; do
|
|
170
|
+
echo " - $f"
|
|
171
|
+
done
|
|
172
|
+
fi
|
|
129
173
|
fi
|
|
130
174
|
|
|
131
175
|
# Count analysis files
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
set -euo pipefail
|
|
21
21
|
|
|
22
22
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
23
|
-
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-
|
|
23
|
+
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-artifact-store.sh"
|
|
24
24
|
|
|
25
|
-
# Source resolver to get PLANS_ROOT for path resolution
|
|
25
|
+
# Source resolver to get PLANS_ROOT/ARTIFACT_ROOT for path resolution
|
|
26
26
|
if [[ -f "$RESOLVER" ]]; then
|
|
27
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
27
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
28
28
|
source "$RESOLVER"
|
|
29
29
|
fi
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ YELLOW='\033[1;33m'
|
|
|
34
34
|
NC='\033[0m'
|
|
35
35
|
|
|
36
36
|
if [[ $# -lt 1 ]]; then
|
|
37
|
-
echo "Usage: $0 <feature-dir> [--optimized]"
|
|
37
|
+
echo "Usage: $0 <feature-dir> [--optimized] [--store=linear|local]"
|
|
38
38
|
echo ""
|
|
39
39
|
echo "Pre-generation gate: ensures all analysis files exist before plan generation."
|
|
40
40
|
echo " default Standard 3-file set (analysis-context/code/tasks)"
|
|
@@ -46,6 +46,7 @@ fi
|
|
|
46
46
|
|
|
47
47
|
feature_dir=""
|
|
48
48
|
optimized="false"
|
|
49
|
+
store_flag=""
|
|
49
50
|
|
|
50
51
|
while [[ $# -gt 0 ]]; do
|
|
51
52
|
case "$1" in
|
|
@@ -53,6 +54,10 @@ while [[ $# -gt 0 ]]; do
|
|
|
53
54
|
optimized="true"
|
|
54
55
|
shift
|
|
55
56
|
;;
|
|
57
|
+
--store=*)
|
|
58
|
+
store_flag="$1"
|
|
59
|
+
shift
|
|
60
|
+
;;
|
|
56
61
|
*)
|
|
57
62
|
if [[ -z "$feature_dir" ]]; then
|
|
58
63
|
feature_dir="$1"
|
|
@@ -70,9 +75,18 @@ if [[ -z "$feature_dir" ]]; then
|
|
|
70
75
|
exit 1
|
|
71
76
|
fi
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
if [[ -n "$store_flag" ]]; then
|
|
79
|
+
# shellcheck disable=SC2086
|
|
80
|
+
resolve_artifact_store "$PWD" "$store_flag" || {
|
|
81
|
+
echo -e "${RED}ERROR${NC}: invalid ${store_flag#--}" >&2
|
|
82
|
+
exit 1
|
|
83
|
+
}
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Resolve relative paths against the active artifact root: PLANS_ROOT in local
|
|
87
|
+
# mode, ARTIFACT_ROOT in linear mode.
|
|
88
|
+
if [[ "$feature_dir" != /* && -n "${ARTIFACT_ROOT:-${PLANS_ROOT:-}}" ]]; then
|
|
89
|
+
feature_dir="${ARTIFACT_ROOT:-$PLANS_ROOT}/${feature_dir}"
|
|
76
90
|
fi
|
|
77
91
|
|
|
78
92
|
if [[ ! -d "$feature_dir" ]]; then
|
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
set -euo pipefail
|
|
17
17
|
|
|
18
18
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
19
|
-
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-
|
|
19
|
+
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-artifact-store.sh"
|
|
20
20
|
|
|
21
|
-
# Source resolver to get PLANS_ROOT for path resolution
|
|
21
|
+
# Source resolver to get PLANS_ROOT/ARTIFACT_ROOT for path resolution and the
|
|
22
|
+
# artifact_body helper for frontmatter-skipping heading checks.
|
|
22
23
|
if [[ -f "$RESOLVER" ]]; then
|
|
23
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
24
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
24
25
|
source "$RESOLVER"
|
|
26
|
+
# shellcheck source=../../../shared/scripts/artifact-body.sh
|
|
27
|
+
source "${SCRIPT_DIR}/../../../shared/scripts/artifact-body.sh"
|
|
25
28
|
fi
|
|
26
29
|
|
|
27
30
|
RED='\033[0;31m'
|
|
@@ -54,7 +57,9 @@ require_any_heading() {
|
|
|
54
57
|
local found=false
|
|
55
58
|
local heading
|
|
56
59
|
for heading in "$@"; do
|
|
57
|
-
|
|
60
|
+
# Match against the body only: identity frontmatter is not content
|
|
61
|
+
# (see _shared/references/artifact-store.md, Frontmatter).
|
|
62
|
+
if grep -q "^${heading}" < <(artifact_body "$file"); then
|
|
58
63
|
found=true
|
|
59
64
|
break
|
|
60
65
|
fi
|
|
@@ -67,13 +72,9 @@ require_any_heading() {
|
|
|
67
72
|
fi
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
if [[ $# -lt 1 ]]; then
|
|
71
|
-
echo "Usage: $0 <feature-dir> [--optimized]"
|
|
72
|
-
exit 1
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
75
|
feature_dir=""
|
|
76
76
|
optimized="false"
|
|
77
|
+
store_flag=""
|
|
77
78
|
|
|
78
79
|
while [[ $# -gt 0 ]]; do
|
|
79
80
|
case "$1" in
|
|
@@ -81,6 +82,10 @@ while [[ $# -gt 0 ]]; do
|
|
|
81
82
|
optimized="true"
|
|
82
83
|
shift
|
|
83
84
|
;;
|
|
85
|
+
--store=*)
|
|
86
|
+
store_flag="$1"
|
|
87
|
+
shift
|
|
88
|
+
;;
|
|
84
89
|
*)
|
|
85
90
|
if [[ -z "$feature_dir" ]]; then
|
|
86
91
|
feature_dir="$1"
|
|
@@ -93,14 +98,23 @@ while [[ $# -gt 0 ]]; do
|
|
|
93
98
|
esac
|
|
94
99
|
done
|
|
95
100
|
|
|
101
|
+
if [[ -n "$store_flag" ]]; then
|
|
102
|
+
# shellcheck disable=SC2086
|
|
103
|
+
resolve_artifact_store "$PWD" "$store_flag" || {
|
|
104
|
+
echo -e "${RED}ERROR:${NC} invalid ${store_flag#--}" >&2
|
|
105
|
+
exit 1
|
|
106
|
+
}
|
|
107
|
+
fi
|
|
108
|
+
|
|
96
109
|
if [[ -z "$feature_dir" ]]; then
|
|
97
110
|
echo -e "${RED}ERROR:${NC} feature-dir required" >&2
|
|
98
111
|
exit 1
|
|
99
112
|
fi
|
|
100
113
|
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
# Resolve relative paths against the active artifact root: PLANS_ROOT in local
|
|
115
|
+
# mode, ARTIFACT_ROOT in linear mode.
|
|
116
|
+
if [[ "$feature_dir" != /* && -n "${ARTIFACT_ROOT:-${PLANS_ROOT:-}}" ]]; then
|
|
117
|
+
feature_dir="${ARTIFACT_ROOT:-$PLANS_ROOT}/${feature_dir}"
|
|
104
118
|
fi
|
|
105
119
|
|
|
106
120
|
if [[ ! -d "$feature_dir" ]]; then
|
|
@@ -151,8 +165,8 @@ for file in "${files[@]}"; do
|
|
|
151
165
|
log_warning "${file}: content is short (${size_bytes} bytes)"
|
|
152
166
|
fi
|
|
153
167
|
|
|
154
|
-
# Check for title heading
|
|
155
|
-
if grep -q "^# " "$path"; then
|
|
168
|
+
# Check for title heading in the body (frontmatter skipped)
|
|
169
|
+
if grep -q "^# " < <(artifact_body "$path"); then
|
|
156
170
|
log_success "${file}: has title heading"
|
|
157
171
|
else
|
|
158
172
|
log_warning "${file}: missing title heading"
|
|
@@ -17,12 +17,15 @@
|
|
|
17
17
|
set -euo pipefail
|
|
18
18
|
|
|
19
19
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
20
|
-
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-
|
|
20
|
+
RESOLVER="${SCRIPT_DIR}/../../../shared/scripts/resolve-artifact-store.sh"
|
|
21
21
|
|
|
22
|
-
# Source resolver to get PLANS_ROOT for path resolution
|
|
22
|
+
# Source resolver to get PLANS_ROOT/ARTIFACT_ROOT for path resolution and the
|
|
23
|
+
# artifact_body helper for frontmatter-skipping heading checks.
|
|
23
24
|
if [[ -f "$RESOLVER" ]]; then
|
|
24
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
25
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
25
26
|
source "$RESOLVER"
|
|
27
|
+
# shellcheck source=../../../shared/scripts/artifact-body.sh
|
|
28
|
+
source "${SCRIPT_DIR}/../../../shared/scripts/artifact-body.sh"
|
|
26
29
|
fi
|
|
27
30
|
|
|
28
31
|
RED='\033[0;31m'
|
|
@@ -55,7 +58,9 @@ require_any_heading() {
|
|
|
55
58
|
local found=false
|
|
56
59
|
local heading
|
|
57
60
|
for heading in "$@"; do
|
|
58
|
-
|
|
61
|
+
# Match against the body only: identity frontmatter is not content
|
|
62
|
+
# (see _shared/references/artifact-store.md, Frontmatter).
|
|
63
|
+
if grep -q "^${heading}" < <(artifact_body "$file"); then
|
|
59
64
|
found=true
|
|
60
65
|
break
|
|
61
66
|
fi
|
|
@@ -69,12 +74,13 @@ require_any_heading() {
|
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
if [[ $# -lt 1 ]]; then
|
|
72
|
-
echo "Usage: $0 <feature-dir> [--optimized]"
|
|
77
|
+
echo "Usage: $0 <feature-dir> [--optimized] [--store=linear|local]"
|
|
73
78
|
exit 1
|
|
74
79
|
fi
|
|
75
80
|
|
|
76
81
|
feature_dir=""
|
|
77
82
|
optimized="false"
|
|
83
|
+
store_flag=""
|
|
78
84
|
|
|
79
85
|
while [[ $# -gt 0 ]]; do
|
|
80
86
|
case "$1" in
|
|
@@ -82,6 +88,10 @@ while [[ $# -gt 0 ]]; do
|
|
|
82
88
|
optimized="true"
|
|
83
89
|
shift
|
|
84
90
|
;;
|
|
91
|
+
--store=*)
|
|
92
|
+
store_flag="$1"
|
|
93
|
+
shift
|
|
94
|
+
;;
|
|
85
95
|
*)
|
|
86
96
|
if [[ -z "$feature_dir" ]]; then
|
|
87
97
|
feature_dir="$1"
|
|
@@ -94,14 +104,23 @@ while [[ $# -gt 0 ]]; do
|
|
|
94
104
|
esac
|
|
95
105
|
done
|
|
96
106
|
|
|
107
|
+
if [[ -n "$store_flag" ]]; then
|
|
108
|
+
# shellcheck disable=SC2086
|
|
109
|
+
resolve_artifact_store "$PWD" "$store_flag" || {
|
|
110
|
+
echo -e "${RED}ERROR:${NC} invalid ${store_flag#--}" >&2
|
|
111
|
+
exit 1
|
|
112
|
+
}
|
|
113
|
+
fi
|
|
114
|
+
|
|
97
115
|
if [[ -z "$feature_dir" ]]; then
|
|
98
116
|
echo -e "${RED}ERROR:${NC} feature-dir required" >&2
|
|
99
117
|
exit 1
|
|
100
118
|
fi
|
|
101
119
|
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
# Resolve relative paths against the active artifact root: PLANS_ROOT in local
|
|
121
|
+
# mode, ARTIFACT_ROOT in linear mode.
|
|
122
|
+
if [[ "$feature_dir" != /* && -n "${ARTIFACT_ROOT:-${PLANS_ROOT:-}}" ]]; then
|
|
123
|
+
feature_dir="${ARTIFACT_ROOT:-$PLANS_ROOT}/${feature_dir}"
|
|
105
124
|
fi
|
|
106
125
|
|
|
107
126
|
if [[ ! -d "$feature_dir" ]]; then
|
|
@@ -139,6 +158,12 @@ echo "=========================================="
|
|
|
139
158
|
for file in "${files[@]}"; do
|
|
140
159
|
path="${feature_dir}/${file}"
|
|
141
160
|
|
|
161
|
+
# Research files live directly in the feature dir (local layout) or in its
|
|
162
|
+
# research/ subdir (linear layout). An existing research/ directory wins.
|
|
163
|
+
if [[ "$file" == research-* && -d "${feature_dir}/research" ]]; then
|
|
164
|
+
path="${feature_dir}/research/${file}"
|
|
165
|
+
fi
|
|
166
|
+
|
|
142
167
|
if [[ ! -f "$path" ]]; then
|
|
143
168
|
log_error "${file}: file not found"
|
|
144
169
|
continue
|
|
@@ -154,8 +179,8 @@ for file in "${files[@]}"; do
|
|
|
154
179
|
log_warning "${file}: content is short (${size_bytes} bytes)"
|
|
155
180
|
fi
|
|
156
181
|
|
|
157
|
-
# Check for title heading
|
|
158
|
-
if grep -q "^# " "$path"; then
|
|
182
|
+
# Check for title heading in the body (frontmatter skipped)
|
|
183
|
+
if grep -q "^# " < <(artifact_body "$path"); then
|
|
159
184
|
log_success "${file}: has title heading"
|
|
160
185
|
else
|
|
161
186
|
log_warning "${file}: missing title heading"
|
|
@@ -11,21 +11,30 @@
|
|
|
11
11
|
|
|
12
12
|
set -uo pipefail
|
|
13
13
|
|
|
14
|
-
SHARED_FILE="${1:-}"
|
|
15
14
|
ERRORS=0
|
|
16
15
|
WARNINGS=0
|
|
17
16
|
|
|
18
|
-
# Source the
|
|
17
|
+
# Source the artifact-store resolver to get PLANS_ROOT/ARTIFACT_ROOT for path
|
|
18
|
+
# resolution and the store mode.
|
|
19
19
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
20
20
|
SHARED_DIR="${SCRIPT_DIR}/../../../shared/scripts"
|
|
21
21
|
|
|
22
|
-
if [[ -f "${SHARED_DIR}/resolve-
|
|
23
|
-
# shellcheck source=../../../shared/scripts/resolve-
|
|
24
|
-
source "${SHARED_DIR}/resolve-
|
|
22
|
+
if [[ -f "${SHARED_DIR}/resolve-artifact-store.sh" ]]; then
|
|
23
|
+
# shellcheck source=../../../shared/scripts/resolve-artifact-store.sh
|
|
24
|
+
source "${SHARED_DIR}/resolve-artifact-store.sh"
|
|
25
|
+
# shellcheck source=../../../shared/scripts/artifact-body.sh
|
|
26
|
+
source "${SHARED_DIR}/artifact-body.sh"
|
|
27
|
+
else
|
|
28
|
+
# ponytail: resolver ships with the plugin; failing beats guessing a wrong
|
|
29
|
+
# relative docs/plans. Upgrade path: restore resolver alongside this script.
|
|
30
|
+
echo "ERROR: resolve-artifact-store.sh not found at ${SHARED_DIR}" >&2
|
|
31
|
+
echo "Cannot resolve plans directory safely; refusing to guess." >&2
|
|
32
|
+
exit 1
|
|
25
33
|
fi
|
|
26
34
|
|
|
27
|
-
#
|
|
28
|
-
|
|
35
|
+
# Resolve relative paths against the active artifact root: PLANS_ROOT in local
|
|
36
|
+
# mode, ARTIFACT_ROOT in linear mode.
|
|
37
|
+
VALIDATE_ROOT="${ARTIFACT_ROOT:-${PLANS_ROOT:-$(pwd)}}"
|
|
29
38
|
|
|
30
39
|
# Colors for output
|
|
31
40
|
RED='\033[0;31m'
|
|
@@ -47,16 +56,44 @@ success() {
|
|
|
47
56
|
echo -e "${GREEN}✓${NC} $1"
|
|
48
57
|
}
|
|
49
58
|
|
|
59
|
+
SHARED_FILE=""
|
|
60
|
+
STORE_FLAG=""
|
|
61
|
+
while [[ $# -gt 0 ]]; do
|
|
62
|
+
case "$1" in
|
|
63
|
+
--store=*)
|
|
64
|
+
STORE_FLAG="$1"
|
|
65
|
+
;;
|
|
66
|
+
*)
|
|
67
|
+
if [[ -z "$SHARED_FILE" ]]; then
|
|
68
|
+
SHARED_FILE="$1"
|
|
69
|
+
else
|
|
70
|
+
echo "Usage: validate-shared.sh <path-to-shared.md> [--store=linear|local]" >&2
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
;;
|
|
74
|
+
esac
|
|
75
|
+
shift
|
|
76
|
+
done
|
|
77
|
+
|
|
78
|
+
if [[ -n "$STORE_FLAG" ]]; then
|
|
79
|
+
# shellcheck disable=SC2086
|
|
80
|
+
resolve_artifact_store "$PWD" "$STORE_FLAG" || {
|
|
81
|
+
echo "ERROR: invalid ${STORE_FLAG#--}" >&2
|
|
82
|
+
exit 1
|
|
83
|
+
}
|
|
84
|
+
fi
|
|
85
|
+
|
|
50
86
|
if [[ -z "$SHARED_FILE" ]]; then
|
|
51
|
-
echo "Usage: validate-shared.sh <path-to-shared.md>"
|
|
87
|
+
echo "Usage: validate-shared.sh <path-to-shared.md> [--store=linear|local]"
|
|
52
88
|
echo ""
|
|
53
89
|
echo "Validates the structure and content of a shared.md document."
|
|
54
90
|
exit 1
|
|
55
91
|
fi
|
|
56
92
|
|
|
57
|
-
#
|
|
58
|
-
|
|
59
|
-
|
|
93
|
+
# Resolve relative paths against the active artifact root: PLANS_ROOT in local
|
|
94
|
+
# mode, ARTIFACT_ROOT in linear mode.
|
|
95
|
+
if [[ "$SHARED_FILE" != /* && -n "${ARTIFACT_ROOT:-${PLANS_ROOT:-}}" ]]; then
|
|
96
|
+
SHARED_FILE="${ARTIFACT_ROOT:-$PLANS_ROOT}/${SHARED_FILE}"
|
|
60
97
|
fi
|
|
61
98
|
|
|
62
99
|
if [[ ! -f "$SHARED_FILE" ]]; then
|
|
@@ -67,15 +104,19 @@ fi
|
|
|
67
104
|
echo "Validating: $SHARED_FILE"
|
|
68
105
|
echo "---"
|
|
69
106
|
|
|
70
|
-
# Read file content
|
|
71
|
-
|
|
107
|
+
# Read file content minus any leading frontmatter block (linear-mode identity
|
|
108
|
+
# metadata is not body; see _shared/references/artifact-store.md, Frontmatter).
|
|
109
|
+
# Match against it with here-strings, not `echo | grep -q`: under pipefail an
|
|
110
|
+
# early-exiting reader SIGPIPEs the echo writer and a present section reads as
|
|
111
|
+
# missing (YAN-1285).
|
|
112
|
+
CONTENT=$(artifact_body "$SHARED_FILE")
|
|
72
113
|
|
|
73
114
|
# Check for required sections
|
|
74
115
|
check_section() {
|
|
75
116
|
local section="$1"
|
|
76
117
|
local required="$2"
|
|
77
118
|
|
|
78
|
-
if
|
|
119
|
+
if grep -q "^## $section" <<<"$CONTENT"; then
|
|
79
120
|
success "Found section: $section"
|
|
80
121
|
return 0
|
|
81
122
|
else
|
|
@@ -101,7 +142,7 @@ check_section "Relevant Tables" "false" || true
|
|
|
101
142
|
# Check for title (H1)
|
|
102
143
|
echo ""
|
|
103
144
|
echo "Checking document structure..."
|
|
104
|
-
if
|
|
145
|
+
if grep -q "^# " <<<"$(head -n 5 <<<"$CONTENT")"; then
|
|
105
146
|
success "Found document title (H1)"
|
|
106
147
|
else
|
|
107
148
|
error "Missing document title (should start with '# ')"
|