prizmkit 1.1.41 → 1.1.46
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/settings-adapter.js +4 -4
- package/bundled/adapters/codebuddy/settings-adapter.js +1 -1
- package/bundled/agents/prizm-dev-team-critic.md +9 -9
- package/bundled/agents/prizm-dev-team-dev.md +13 -13
- package/bundled/agents/prizm-dev-team-reviewer.md +2 -2
- package/bundled/dev-pipeline/.env.example +6 -6
- package/bundled/dev-pipeline/README.md +32 -32
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +5 -2
- package/bundled/dev-pipeline/launch-feature-daemon.sh +5 -2
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +5 -2
- package/bundled/dev-pipeline/lib/common.sh +34 -5
- package/bundled/dev-pipeline/reset-bug.sh +7 -5
- package/bundled/dev-pipeline/reset-feature.sh +7 -5
- package/bundled/dev-pipeline/reset-refactor.sh +7 -5
- package/bundled/dev-pipeline/run-bugfix.sh +14 -11
- package/bundled/dev-pipeline/run-feature.sh +15 -12
- package/bundled/dev-pipeline/run-recovery.sh +6 -3
- package/bundled/dev-pipeline/run-refactor.sh +15 -12
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -15
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +10 -5
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +19 -13
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +10 -5
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +9 -1
- package/bundled/dev-pipeline/scripts/update-feature-status.py +13 -1
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +9 -1
- package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +8 -8
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +11 -11
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -9
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +7 -7
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +4 -4
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +5 -5
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +6 -6
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase0-init.md +1 -1
- package/bundled/dev-pipeline/tests/test-path-resolution.sh +100 -0
- package/bundled/rules/USAGE.md +2 -2
- package/bundled/rules/_rules-metadata.json +1 -1
- package/bundled/rules/prizm/prizm-commit-workflow.md +1 -1
- package/bundled/rules/prizm/prizm-documentation.md +4 -4
- package/bundled/rules/prizm/prizm-progressive-loading.md +3 -3
- package/bundled/skills/_metadata.json +4 -4
- package/bundled/skills/app-planner/SKILL.md +35 -7
- package/bundled/skills/bug-fix-workflow/SKILL.md +6 -6
- package/bundled/skills/bug-planner/SKILL.md +5 -5
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +28 -21
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +28 -21
- package/bundled/skills/feature-planner/SKILL.md +5 -5
- package/bundled/skills/feature-workflow/SKILL.md +8 -8
- package/bundled/skills/prizm-kit/SKILL.md +10 -10
- package/bundled/skills/prizmkit-committer/SKILL.md +4 -2
- package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
- package/bundled/skills/prizmkit-init/SKILL.md +17 -17
- package/bundled/skills/prizmkit-plan/SKILL.md +3 -3
- package/bundled/skills/prizmkit-plan/references/verification-checklist.md +2 -2
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +17 -17
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +45 -45
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +9 -9
- package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +1 -1
- package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +2 -2
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +3 -3
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +1 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +10 -10
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +1 -1
- package/bundled/skills/recovery-workflow/SKILL.md +15 -15
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +0 -1
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +28 -21
- package/bundled/skills/refactor-planner/SKILL.md +6 -6
- package/bundled/skills/refactor-workflow/SKILL.md +9 -9
- package/bundled/team/prizm-dev-team.json +1 -1
- package/bundled/templates/hooks/commit-intent.json +2 -2
- package/bundled/templates/hooks/diff-prizm-docs.sh +8 -8
- package/bundled/templates/hooks/prizm-pre-commit.sh +4 -4
- package/bundled/templates/hooks/validate-prizm-docs.sh +4 -4
- package/bundled/templates/project-memory-template.md +4 -4
- package/package.json +1 -1
- package/src/clean.js +1 -3
- package/src/config.js +1 -1
- package/src/gitignore-template.js +4 -24
- package/src/scaffold.js +12 -11
- package/src/upgrade.js +3 -3
|
@@ -33,8 +33,11 @@ set -euo pipefail
|
|
|
33
33
|
# ============================================================
|
|
34
34
|
|
|
35
35
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
|
|
37
|
+
# Source shared common helpers (exports PIPELINE_DIR/PRIZMKIT_DIR/PROJECT_ROOT)
|
|
38
|
+
source "$SCRIPT_DIR/lib/common.sh"
|
|
39
|
+
|
|
40
|
+
STATE_DIR="${PRIZMKIT_DIR}/state/refactor"
|
|
38
41
|
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
39
42
|
|
|
40
43
|
# Colors
|
|
@@ -188,7 +191,6 @@ fi
|
|
|
188
191
|
# Process each refactor
|
|
189
192
|
# ============================================================
|
|
190
193
|
|
|
191
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
192
194
|
RESET_COUNT=0
|
|
193
195
|
FAIL_COUNT=0
|
|
194
196
|
|
|
@@ -383,9 +385,9 @@ if [[ "$DO_RUN" == true && ${#REFACTOR_IDS[@]} -eq 1 ]]; then
|
|
|
383
385
|
echo ""
|
|
384
386
|
exec "$SCRIPT_DIR/run-refactor.sh" run "${REFACTOR_IDS[0]}" "$REFACTOR_LIST"
|
|
385
387
|
else
|
|
386
|
-
log_info "
|
|
388
|
+
log_info " ./.prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json # Resume pipeline from first pending"
|
|
387
389
|
if [[ ${#REFACTOR_IDS[@]} -eq 1 ]]; then
|
|
388
|
-
log_info "
|
|
390
|
+
log_info " ./.prizmkit/dev-pipeline/run-refactor.sh run ${REFACTOR_IDS[0]} # Run single refactor"
|
|
389
391
|
fi
|
|
390
392
|
fi
|
|
391
393
|
echo ""
|
|
@@ -32,8 +32,12 @@ set -euo pipefail
|
|
|
32
32
|
# ============================================================
|
|
33
33
|
|
|
34
34
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
|
|
36
|
+
# Source shared common helpers (exports PIPELINE_DIR/PRIZMKIT_DIR/PROJECT_ROOT,
|
|
37
|
+
# CLI/platform detection, logs, deps)
|
|
38
|
+
source "$SCRIPT_DIR/lib/common.sh"
|
|
39
|
+
|
|
40
|
+
STATE_DIR="${PRIZMKIT_DIR}/state/bugfix"
|
|
37
41
|
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
38
42
|
|
|
39
43
|
# Configuration
|
|
@@ -53,7 +57,6 @@ STOP_ON_FAILURE=${STOP_ON_FAILURE:-0}
|
|
|
53
57
|
ENABLE_DEPLOY=${ENABLE_DEPLOY:-0}
|
|
54
58
|
|
|
55
59
|
# Source shared common helpers (CLI/platform detection + logs + deps)
|
|
56
|
-
source "$SCRIPT_DIR/lib/common.sh"
|
|
57
60
|
prizm_detect_cli_and_platform
|
|
58
61
|
|
|
59
62
|
# Source shared heartbeat library
|
|
@@ -190,7 +193,7 @@ spawn_and_wait_session() {
|
|
|
190
193
|
# ── Determine session outcome from observable signals ──────────────
|
|
191
194
|
local session_status
|
|
192
195
|
local project_root
|
|
193
|
-
project_root="$
|
|
196
|
+
project_root="$PROJECT_ROOT"
|
|
194
197
|
local default_branch="$base_branch"
|
|
195
198
|
|
|
196
199
|
if [[ $exit_code -eq 124 ]]; then
|
|
@@ -275,7 +278,7 @@ spawn_and_wait_session() {
|
|
|
275
278
|
# Validate checkpoint completeness after successful session
|
|
276
279
|
if [[ "$session_status" == "success" ]]; then
|
|
277
280
|
local _ckpt_root
|
|
278
|
-
_ckpt_root="$
|
|
281
|
+
_ckpt_root="$PROJECT_ROOT"
|
|
279
282
|
local checkpoint_file="$_ckpt_root/.prizmkit/bugfix/${bug_id}/workflow-checkpoint.json"
|
|
280
283
|
if [[ -f "$checkpoint_file" ]]; then
|
|
281
284
|
local checkpoint_result
|
|
@@ -379,7 +382,7 @@ for bug in data.get('bugs', []):
|
|
|
379
382
|
fi
|
|
380
383
|
|
|
381
384
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
382
|
-
branch_ensure_return "$
|
|
385
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
383
386
|
|
|
384
387
|
log_info "Bug fix pipeline paused. Run './run-bugfix.sh run' to resume."
|
|
385
388
|
exit 130
|
|
@@ -393,7 +396,7 @@ trap cleanup SIGINT SIGTERM
|
|
|
393
396
|
check_dependencies() {
|
|
394
397
|
prizm_check_common_dependencies "$CLI_CMD"
|
|
395
398
|
local _project_root
|
|
396
|
-
_project_root="$
|
|
399
|
+
_project_root="$PROJECT_ROOT"
|
|
397
400
|
prizm_ensure_git_repo "$_project_root"
|
|
398
401
|
}
|
|
399
402
|
|
|
@@ -567,7 +570,7 @@ sys.exit(1)
|
|
|
567
570
|
log_info "Cleaning artifacts for $bug_id..."
|
|
568
571
|
|
|
569
572
|
local project_root
|
|
570
|
-
project_root="$
|
|
573
|
+
project_root="$PROJECT_ROOT"
|
|
571
574
|
|
|
572
575
|
local bugfix_dir="$project_root/.prizmkit/bugfix/$bug_id"
|
|
573
576
|
if [[ -d "$bugfix_dir" ]]; then
|
|
@@ -746,7 +749,7 @@ else:
|
|
|
746
749
|
fi
|
|
747
750
|
|
|
748
751
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
749
|
-
branch_ensure_return "$
|
|
752
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
750
753
|
exit 130
|
|
751
754
|
}
|
|
752
755
|
trap cleanup_single_bug SIGINT SIGTERM
|
|
@@ -755,7 +758,7 @@ else:
|
|
|
755
758
|
|
|
756
759
|
# Branch lifecycle: create and checkout bugfix branch
|
|
757
760
|
local _proj_root
|
|
758
|
-
_proj_root="$
|
|
761
|
+
_proj_root="$PROJECT_ROOT"
|
|
759
762
|
local _source_branch
|
|
760
763
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
761
764
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -916,7 +919,7 @@ main() {
|
|
|
916
919
|
|
|
917
920
|
# Branch lifecycle: per-bug branches (like feature pipeline)
|
|
918
921
|
local _proj_root
|
|
919
|
-
_proj_root="$
|
|
922
|
+
_proj_root="$PROJECT_ROOT"
|
|
920
923
|
local _source_branch
|
|
921
924
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
922
925
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -35,8 +35,12 @@ set -euo pipefail
|
|
|
35
35
|
# ============================================================
|
|
36
36
|
|
|
37
37
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
|
|
39
|
+
# Source shared common helpers (exports PIPELINE_DIR/PRIZMKIT_DIR/PROJECT_ROOT,
|
|
40
|
+
# CLI/platform detection, logs, deps)
|
|
41
|
+
source "$SCRIPT_DIR/lib/common.sh"
|
|
42
|
+
|
|
43
|
+
STATE_DIR="${PRIZMKIT_DIR}/state/features"
|
|
40
44
|
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
41
45
|
|
|
42
46
|
# Configuration (override via environment variables)
|
|
@@ -56,7 +60,6 @@ STOP_ON_FAILURE=${STOP_ON_FAILURE:-0}
|
|
|
56
60
|
ENABLE_DEPLOY=${ENABLE_DEPLOY:-0}
|
|
57
61
|
|
|
58
62
|
# Source shared common helpers (CLI/platform detection + logs + deps)
|
|
59
|
-
source "$SCRIPT_DIR/lib/common.sh"
|
|
60
63
|
prizm_detect_cli_and_platform
|
|
61
64
|
|
|
62
65
|
# Source shared heartbeat library
|
|
@@ -206,7 +209,7 @@ spawn_and_wait_session() {
|
|
|
206
209
|
# and working tree cleanliness as the single source of truth.
|
|
207
210
|
local session_status
|
|
208
211
|
local project_root
|
|
209
|
-
project_root="$
|
|
212
|
+
project_root="$PROJECT_ROOT"
|
|
210
213
|
local default_branch="$base_branch"
|
|
211
214
|
|
|
212
215
|
if [[ $exit_code -eq 124 ]]; then
|
|
@@ -320,7 +323,7 @@ sys.exit(1)
|
|
|
320
323
|
# Validate key artifacts exist after successful session
|
|
321
324
|
if [[ "$session_status" == "success" && -n "$feature_slug" ]]; then
|
|
322
325
|
local project_root_for_artifacts
|
|
323
|
-
project_root_for_artifacts="$
|
|
326
|
+
project_root_for_artifacts="$PROJECT_ROOT"
|
|
324
327
|
local context_snapshot="$project_root_for_artifacts/.prizmkit/specs/${feature_slug}/context-snapshot.md"
|
|
325
328
|
local plan_file="$project_root_for_artifacts/.prizmkit/specs/${feature_slug}/plan.md"
|
|
326
329
|
|
|
@@ -375,7 +378,7 @@ sys.exit(0)
|
|
|
375
378
|
# Check if session produced a failure-log for future retries
|
|
376
379
|
if [[ "$session_status" != "success" && -n "$feature_slug" ]]; then
|
|
377
380
|
local project_root_for_failure
|
|
378
|
-
project_root_for_failure="$
|
|
381
|
+
project_root_for_failure="$PROJECT_ROOT"
|
|
379
382
|
local failure_log="$project_root_for_failure/.prizmkit/specs/${feature_slug}/failure-log.md"
|
|
380
383
|
if [[ -f "$failure_log" ]]; then
|
|
381
384
|
log_info "FAILURE_LOG: Session wrote failure-log.md — will be available to next retry"
|
|
@@ -468,7 +471,7 @@ for feat in data.get('features', []):
|
|
|
468
471
|
fi
|
|
469
472
|
|
|
470
473
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
471
|
-
branch_ensure_return "$
|
|
474
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
472
475
|
|
|
473
476
|
log_info "Pipeline paused. Run './run-feature.sh run' to resume."
|
|
474
477
|
exit 130
|
|
@@ -482,7 +485,7 @@ trap cleanup SIGINT SIGTERM
|
|
|
482
485
|
check_dependencies() {
|
|
483
486
|
prizm_check_common_dependencies "$CLI_CMD"
|
|
484
487
|
local _project_root
|
|
485
|
-
_project_root="$
|
|
488
|
+
_project_root="$PROJECT_ROOT"
|
|
486
489
|
prizm_ensure_git_repo "$_project_root"
|
|
487
490
|
}
|
|
488
491
|
|
|
@@ -710,7 +713,7 @@ sys.exit(1)
|
|
|
710
713
|
}
|
|
711
714
|
|
|
712
715
|
local project_root
|
|
713
|
-
project_root="$
|
|
716
|
+
project_root="$PROJECT_ROOT"
|
|
714
717
|
|
|
715
718
|
if [[ -n "$feature_slug" ]]; then
|
|
716
719
|
local specs_dir="$project_root/.prizmkit/specs/$feature_slug"
|
|
@@ -910,7 +913,7 @@ else:
|
|
|
910
913
|
fi
|
|
911
914
|
|
|
912
915
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
913
|
-
branch_ensure_return "$
|
|
916
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
914
917
|
exit 130
|
|
915
918
|
}
|
|
916
919
|
trap cleanup_single_feature SIGINT SIGTERM
|
|
@@ -919,7 +922,7 @@ else:
|
|
|
919
922
|
|
|
920
923
|
# Branch lifecycle: create and checkout feature branch
|
|
921
924
|
local _proj_root
|
|
922
|
-
_proj_root="$
|
|
925
|
+
_proj_root="$PROJECT_ROOT"
|
|
923
926
|
local _source_branch
|
|
924
927
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
925
928
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -1100,7 +1103,7 @@ main() {
|
|
|
1100
1103
|
|
|
1101
1104
|
# Branch lifecycle: each feature gets its own dev branch (created per-iteration below)
|
|
1102
1105
|
local _proj_root
|
|
1103
|
-
_proj_root="$
|
|
1106
|
+
_proj_root="$PROJECT_ROOT"
|
|
1104
1107
|
local _source_branch
|
|
1105
1108
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
1106
1109
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -34,8 +34,12 @@ set -euo pipefail
|
|
|
34
34
|
# ============================================================
|
|
35
35
|
|
|
36
36
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
# Source shared common helpers (exports PIPELINE_DIR/PRIZMKIT_DIR/PROJECT_ROOT,
|
|
39
|
+
# CLI/platform detection, logs, deps)
|
|
40
|
+
source "$SCRIPT_DIR/lib/common.sh"
|
|
41
|
+
|
|
42
|
+
RECOVERY_STATE_DIR="${PRIZMKIT_DIR}/state/recovery"
|
|
39
43
|
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
40
44
|
RECOVERY_DETECT_SCRIPT="${PROJECT_ROOT}/core/skills/orchestration-skill/workflows/recovery-workflow/scripts/detect-recovery-state.py"
|
|
41
45
|
|
|
@@ -48,7 +52,6 @@ MODEL=${MODEL:-""}
|
|
|
48
52
|
AUTO_PUSH=${AUTO_PUSH:-0}
|
|
49
53
|
|
|
50
54
|
# Source shared common helpers (CLI/platform detection + logs + deps)
|
|
51
|
-
source "$SCRIPT_DIR/lib/common.sh"
|
|
52
55
|
prizm_detect_cli_and_platform
|
|
53
56
|
|
|
54
57
|
# Source shared heartbeat library
|
|
@@ -33,8 +33,12 @@ set -euo pipefail
|
|
|
33
33
|
# ============================================================
|
|
34
34
|
|
|
35
35
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
|
|
37
|
+
# Source shared common helpers (exports PIPELINE_DIR/PRIZMKIT_DIR/PROJECT_ROOT,
|
|
38
|
+
# CLI/platform detection, logs, deps)
|
|
39
|
+
source "$SCRIPT_DIR/lib/common.sh"
|
|
40
|
+
|
|
41
|
+
STATE_DIR="${PRIZMKIT_DIR}/state/refactor"
|
|
38
42
|
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
39
43
|
|
|
40
44
|
# Configuration
|
|
@@ -55,7 +59,6 @@ STRICT_BEHAVIOR_CHECK=${STRICT_BEHAVIOR_CHECK:-1}
|
|
|
55
59
|
ENABLE_DEPLOY=${ENABLE_DEPLOY:-0}
|
|
56
60
|
|
|
57
61
|
# Source shared common helpers (CLI/platform detection + logs + deps)
|
|
58
|
-
source "$SCRIPT_DIR/lib/common.sh"
|
|
59
62
|
prizm_detect_cli_and_platform
|
|
60
63
|
|
|
61
64
|
# Source shared heartbeat library
|
|
@@ -192,7 +195,7 @@ spawn_and_wait_session() {
|
|
|
192
195
|
# ── Determine session outcome from observable signals ──────────────
|
|
193
196
|
local session_status
|
|
194
197
|
local project_root
|
|
195
|
-
project_root="$
|
|
198
|
+
project_root="$PROJECT_ROOT"
|
|
196
199
|
local default_branch="$base_branch"
|
|
197
200
|
|
|
198
201
|
if [[ $exit_code -eq 124 ]]; then
|
|
@@ -277,7 +280,7 @@ spawn_and_wait_session() {
|
|
|
277
280
|
# Validate key artifacts exist after successful session
|
|
278
281
|
if [[ "$session_status" == "success" ]]; then
|
|
279
282
|
local _artifact_root
|
|
280
|
-
_artifact_root="$
|
|
283
|
+
_artifact_root="$PROJECT_ROOT"
|
|
281
284
|
local plan_file="$_artifact_root/.prizmkit/refactor/$refactor_id/plan.md"
|
|
282
285
|
if [[ ! -f "$plan_file" ]]; then
|
|
283
286
|
log_warn "ARTIFACT_MISSING: plan.md not found at $plan_file"
|
|
@@ -406,7 +409,7 @@ for item in data.get('refactors', []):
|
|
|
406
409
|
fi
|
|
407
410
|
|
|
408
411
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
409
|
-
branch_ensure_return "$
|
|
412
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
410
413
|
|
|
411
414
|
log_info "Refactor pipeline paused. Run './run-refactor.sh run' to resume."
|
|
412
415
|
exit 130
|
|
@@ -420,7 +423,7 @@ trap cleanup SIGINT SIGTERM
|
|
|
420
423
|
check_dependencies() {
|
|
421
424
|
prizm_check_common_dependencies "$CLI_CMD"
|
|
422
425
|
local _project_root
|
|
423
|
-
_project_root="$
|
|
426
|
+
_project_root="$PROJECT_ROOT"
|
|
424
427
|
prizm_ensure_git_repo "$_project_root"
|
|
425
428
|
}
|
|
426
429
|
|
|
@@ -594,7 +597,7 @@ sys.exit(1)
|
|
|
594
597
|
log_info "Cleaning artifacts for $refactor_id..."
|
|
595
598
|
|
|
596
599
|
local project_root
|
|
597
|
-
project_root="$
|
|
600
|
+
project_root="$PROJECT_ROOT"
|
|
598
601
|
|
|
599
602
|
local refactor_dir="$project_root/.prizmkit/refactor/$refactor_id"
|
|
600
603
|
if [[ -d "$refactor_dir" ]]; then
|
|
@@ -776,7 +779,7 @@ else:
|
|
|
776
779
|
fi
|
|
777
780
|
|
|
778
781
|
# GUARANTEED: always return to original branch (save WIP on dev branch first)
|
|
779
|
-
branch_ensure_return "$
|
|
782
|
+
branch_ensure_return "$PROJECT_ROOT" "$_ORIGINAL_BRANCH" "$_DEV_BRANCH_NAME"
|
|
780
783
|
exit 130
|
|
781
784
|
}
|
|
782
785
|
trap cleanup_single_refactor SIGINT SIGTERM
|
|
@@ -785,7 +788,7 @@ else:
|
|
|
785
788
|
|
|
786
789
|
# Branch lifecycle: create and checkout refactor branch
|
|
787
790
|
local _proj_root
|
|
788
|
-
_proj_root="$
|
|
791
|
+
_proj_root="$PROJECT_ROOT"
|
|
789
792
|
local _source_branch
|
|
790
793
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
791
794
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -951,7 +954,7 @@ main() {
|
|
|
951
954
|
|
|
952
955
|
# Branch lifecycle: per-refactor branches (like feature pipeline)
|
|
953
956
|
local _proj_root
|
|
954
|
-
_proj_root="$
|
|
957
|
+
_proj_root="$PROJECT_ROOT"
|
|
955
958
|
local _source_branch
|
|
956
959
|
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
957
960
|
_ORIGINAL_BRANCH="$_source_branch"
|
|
@@ -1195,7 +1198,7 @@ DEPLOY_PROMPT_EOF
|
|
|
1195
1198
|
# Validate key artifacts after successful session
|
|
1196
1199
|
if [[ "$_SPAWN_RESULT" == "success" ]]; then
|
|
1197
1200
|
local _artifact_root
|
|
1198
|
-
_artifact_root="$
|
|
1201
|
+
_artifact_root="$PROJECT_ROOT"
|
|
1199
1202
|
local plan_file="$_artifact_root/.prizmkit/refactor/$refactor_id/plan.md"
|
|
1200
1203
|
if [[ ! -f "$plan_file" ]]; then
|
|
1201
1204
|
log_warn "ARTIFACT_MISSING: plan.md not found at $plan_file"
|
|
@@ -416,17 +416,17 @@ def _read_project_brief(project_root):
|
|
|
416
416
|
|
|
417
417
|
|
|
418
418
|
def resolve_project_root(script_dir):
|
|
419
|
-
"""Resolve project root
|
|
419
|
+
"""Resolve project root from script_dir of the prompt-generator script.
|
|
420
420
|
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
Layout-aware:
|
|
422
|
+
<project>/.prizmkit/dev-pipeline/scripts/ → project root = <project>
|
|
423
|
+
<repo>/dev-pipeline/scripts/ → project root = <repo>
|
|
423
424
|
"""
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return os.path.abspath(project_root)
|
|
425
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
426
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
427
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
428
|
+
return os.path.abspath(os.path.dirname(pipeline_parent))
|
|
429
|
+
return os.path.abspath(pipeline_parent)
|
|
430
430
|
|
|
431
431
|
|
|
432
432
|
def process_conditional_blocks(content, resume_phase):
|
|
@@ -557,7 +557,7 @@ def process_mode_blocks(content, pipeline_mode, init_done, critic_enabled=False,
|
|
|
557
557
|
|
|
558
558
|
def detect_init_status(project_root):
|
|
559
559
|
"""Check if PrizmKit init has already been done."""
|
|
560
|
-
prizm_docs = os.path.join(project_root, ".prizm-docs", "root.prizm")
|
|
560
|
+
prizm_docs = os.path.join(project_root, ".prizmkit/prizm-docs", "root.prizm")
|
|
561
561
|
prizmkit_config = os.path.join(project_root, ".prizmkit", "config.json")
|
|
562
562
|
return os.path.isfile(prizm_docs) and os.path.isfile(prizmkit_config)
|
|
563
563
|
|
|
@@ -587,7 +587,7 @@ def determine_pipeline_mode(complexity):
|
|
|
587
587
|
Tier assignment rationale:
|
|
588
588
|
- low + medium → lite (single agent): most features don't benefit from
|
|
589
589
|
the orchestrator→dev→reviewer overhead. A single agent reading
|
|
590
|
-
.prizm-docs + implementing directly is faster and cheaper.
|
|
590
|
+
.prizmkit/prizm-docs + implementing directly is faster and cheaper.
|
|
591
591
|
- high → standard (orchestrator + dev + reviewer): complex features
|
|
592
592
|
need the spec→plan→analyze→implement→review pipeline.
|
|
593
593
|
- critical → full (full team + framework guardrails): architectural
|
|
@@ -612,7 +612,7 @@ def determine_pipeline_mode(complexity):
|
|
|
612
612
|
# merge_checkpoint_state() never collides.
|
|
613
613
|
SECTION_TO_SKILL = {
|
|
614
614
|
"phase0-init": ("prizmkit-init", "Project Bootstrap",
|
|
615
|
-
[".prizm-docs/root.prizm", ".prizmkit/config.json"]),
|
|
615
|
+
[".prizmkit/prizm-docs/root.prizm", ".prizmkit/config.json"]),
|
|
616
616
|
"phase0-test-baseline": ("test-baseline", "Test Baseline", []),
|
|
617
617
|
"phase-context-snapshot": ("context-snapshot", "Build Context Snapshot",
|
|
618
618
|
[".prizmkit/specs/{slug}/context-snapshot.md"]),
|
|
@@ -631,7 +631,7 @@ SECTION_TO_SKILL = {
|
|
|
631
631
|
# phase-commit is split into two steps
|
|
632
632
|
_COMMIT_STEPS = [
|
|
633
633
|
("prizmkit-retrospective", "Retrospective", []),
|
|
634
|
-
("prizmkit-committer", "Commit", []),
|
|
634
|
+
("prizmkit-committer", "Commit", ["--headless"]),
|
|
635
635
|
]
|
|
636
636
|
|
|
637
637
|
|
|
@@ -1239,8 +1239,8 @@ def build_replacements(args, feature, features, global_context, script_dir):
|
|
|
1239
1239
|
"Run `npx prizmkit install` to reinstall agent definitions.",
|
|
1240
1240
|
agent_path, agent_name,
|
|
1241
1241
|
)
|
|
1242
|
-
# Validator scripts - check if they exist in .codebuddy/scripts/, otherwise use dev-pipeline/scripts/
|
|
1243
|
-
validator_scripts_dir = os.path.join(project_root, "dev-pipeline", "scripts")
|
|
1242
|
+
# Validator scripts - check if they exist in .codebuddy/scripts/, otherwise use .prizmkit/dev-pipeline/scripts/
|
|
1243
|
+
validator_scripts_dir = os.path.join(project_root, ".prizmkit", "dev-pipeline", "scripts")
|
|
1244
1244
|
init_script_path = os.path.join(validator_scripts_dir, "init-dev-team.py")
|
|
1245
1245
|
|
|
1246
1246
|
# Session status path (relative to project root)
|
|
@@ -208,10 +208,15 @@ def get_prev_session_status(state_dir, bug_id):
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
def resolve_project_root(script_dir):
|
|
211
|
-
"""Resolve project root
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
"""Resolve project root. Layout-aware:
|
|
212
|
+
<project>/.prizmkit/dev-pipeline/scripts/ → <project>
|
|
213
|
+
<repo>/dev-pipeline/scripts/ → <repo>
|
|
214
|
+
"""
|
|
215
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
216
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
217
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
218
|
+
return os.path.abspath(os.path.dirname(pipeline_parent))
|
|
219
|
+
return os.path.abspath(pipeline_parent)
|
|
215
220
|
|
|
216
221
|
|
|
217
222
|
def build_replacements(args, bug, global_context, script_dir):
|
|
@@ -450,7 +455,7 @@ BUGFIX_STEPS = [
|
|
|
450
455
|
".prizmkit/bugfix/{slug}/plan.md"]),
|
|
451
456
|
("prizmkit-implement", "Implement Fix", []),
|
|
452
457
|
("prizmkit-code-review", "Code Review", []),
|
|
453
|
-
("prizmkit-committer", "Commit", []),
|
|
458
|
+
("prizmkit-committer", "Commit", ["--headless"]),
|
|
454
459
|
("bug-report", "Generate Fix Report",
|
|
455
460
|
[".prizmkit/bugfix/{slug}/fix-report.md"]),
|
|
456
461
|
]
|
|
@@ -57,7 +57,7 @@ Use whatever information is available:
|
|
|
57
57
|
- Read bug entry from `.prizmkit/plans/bug-fix-list.json` if bug ID is known
|
|
58
58
|
- Read any existing artifacts in `.prizmkit/bugfix/{bug_id}/`
|
|
59
59
|
- Read relevant source code and test files
|
|
60
|
-
- Read `.prizm-docs/` for affected modules
|
|
60
|
+
- Read `.prizmkit/prizm-docs/` for affected modules
|
|
61
61
|
|
|
62
62
|
Produce a bug summary with: symptom, reproduction steps, expected behavior,
|
|
63
63
|
affected files, and root cause hypothesis.""",
|
|
@@ -66,9 +66,9 @@ affected files, and root cause hypothesis.""",
|
|
|
66
66
|
"Triage",
|
|
67
67
|
"""\
|
|
68
68
|
Locate affected code and identify root cause:
|
|
69
|
-
1. Read `.prizm-docs/root.prizm` then relevant L1/L2 docs for affected modules
|
|
69
|
+
1. Read `.prizmkit/prizm-docs/root.prizm` then relevant L1/L2 docs for affected modules
|
|
70
70
|
2. Read files mentioned in the bug description or error/stack trace
|
|
71
|
-
3. Check `.prizm-docs/` TRAPS for known patterns
|
|
71
|
+
3. Check `.prizmkit/prizm-docs/` TRAPS for known patterns
|
|
72
72
|
4. Classify: root cause (confirmed/suspected), blast radius, fix complexity
|
|
73
73
|
5. Log your diagnosis (no need to ask for user confirmation in autonomous mode)""",
|
|
74
74
|
),
|
|
@@ -115,9 +115,9 @@ for manual user testing:
|
|
|
115
115
|
"""\
|
|
116
116
|
Commit the fix and finalize:
|
|
117
117
|
1. Run `/prizmkit-retrospective` (structural sync only — update file counts,
|
|
118
|
-
interfaces, dependencies in .prizm-docs/)
|
|
118
|
+
interfaces, dependencies in .prizmkit/prizm-docs/)
|
|
119
119
|
2. Stage all changed files explicitly (NEVER use `git add -A` or `git add .`)
|
|
120
|
-
3. Run `/prizmkit-committer` with commit prefix `fix(<scope>): <description>`
|
|
120
|
+
3. Run `/prizmkit-committer --headless` with commit prefix `fix(<scope>): <description>`
|
|
121
121
|
4. Verify working tree is clean: `git status --short`
|
|
122
122
|
5. Write `fix-report.md` to `.prizmkit/bugfix/{bug_id}/fix-report.md` with:
|
|
123
123
|
- Root cause summary
|
|
@@ -132,7 +132,7 @@ FEATURE_PHASES = {
|
|
|
132
132
|
"Brainstorm",
|
|
133
133
|
"""\
|
|
134
134
|
Since this is an autonomous recovery session, work with whatever context is
|
|
135
|
-
available. Read existing project files, `.prizm-docs/`, and any user-provided
|
|
135
|
+
available. Read existing project files, `.prizmkit/prizm-docs/`, and any user-provided
|
|
136
136
|
materials to understand the requirements. Skip interactive Q&A.
|
|
137
137
|
Produce a requirements summary if one doesn't already exist.""",
|
|
138
138
|
),
|
|
@@ -153,7 +153,7 @@ Invoke `/feature-pipeline-launcher` skill:
|
|
|
153
153
|
|
|
154
154
|
If `/feature-pipeline-launcher` is not available, run the pipeline directly:
|
|
155
155
|
```bash
|
|
156
|
-
|
|
156
|
+
./.prizmkit/dev-pipeline/run-feature.sh run .prizmkit/plans/feature-list.json
|
|
157
157
|
```""",
|
|
158
158
|
),
|
|
159
159
|
4: (
|
|
@@ -161,7 +161,7 @@ If `/feature-pipeline-launcher` is not available, run the pipeline directly:
|
|
|
161
161
|
"""\
|
|
162
162
|
Check pipeline status and report results:
|
|
163
163
|
```bash
|
|
164
|
-
python3 dev-pipeline/scripts/update-feature-status.py \\
|
|
164
|
+
python3 .prizmkit/dev-pipeline/scripts/update-feature-status.py \\
|
|
165
165
|
--feature-list .prizmkit/plans/feature-list.json \\
|
|
166
166
|
--state-dir .prizmkit/state/features \\
|
|
167
167
|
--action status
|
|
@@ -175,7 +175,7 @@ REFACTOR_PHASES = {
|
|
|
175
175
|
"Brainstorm",
|
|
176
176
|
"""\
|
|
177
177
|
Since this is an autonomous recovery session, work with whatever context is
|
|
178
|
-
available. Read existing project files, `.prizm-docs/`, and any materials
|
|
178
|
+
available. Read existing project files, `.prizmkit/prizm-docs/`, and any materials
|
|
179
179
|
to understand the refactoring goals. Skip interactive Q&A.
|
|
180
180
|
Produce a refactoring goals summary if one doesn't already exist.""",
|
|
181
181
|
),
|
|
@@ -196,7 +196,7 @@ Invoke `/refactor-pipeline-launcher` skill:
|
|
|
196
196
|
|
|
197
197
|
If `/refactor-pipeline-launcher` is not available, run the pipeline directly:
|
|
198
198
|
```bash
|
|
199
|
-
|
|
199
|
+
./.prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
|
|
200
200
|
```""",
|
|
201
201
|
),
|
|
202
202
|
4: (
|
|
@@ -204,7 +204,7 @@ If `/refactor-pipeline-launcher` is not available, run the pipeline directly:
|
|
|
204
204
|
"""\
|
|
205
205
|
Check pipeline status and report results:
|
|
206
206
|
```bash
|
|
207
|
-
python3 dev-pipeline/scripts/update-refactor-status.py \\
|
|
207
|
+
python3 .prizmkit/dev-pipeline/scripts/update-refactor-status.py \\
|
|
208
208
|
--refactor-list .prizmkit/plans/refactor-list.json \\
|
|
209
209
|
--state-dir .prizmkit/state/refactor \\
|
|
210
210
|
--action status
|
|
@@ -688,9 +688,15 @@ def resolve_project_root(given_root):
|
|
|
688
688
|
"""Resolve project root from argument or git."""
|
|
689
689
|
if given_root:
|
|
690
690
|
return os.path.abspath(given_root)
|
|
691
|
-
# Auto-detect
|
|
691
|
+
# Auto-detect across two layouts:
|
|
692
|
+
# <project>/.prizmkit/dev-pipeline/scripts/ → up 3 levels
|
|
693
|
+
# <repo>/dev-pipeline/scripts/ → up 2 levels
|
|
692
694
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
693
|
-
|
|
695
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
696
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
697
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
698
|
+
return os.path.dirname(pipeline_parent)
|
|
699
|
+
return pipeline_parent
|
|
694
700
|
|
|
695
701
|
|
|
696
702
|
def emit_failure(message):
|
|
@@ -40,7 +40,7 @@ REFACTOR_STEPS = [
|
|
|
40
40
|
("prizmkit-code-review", "Review — Code Review & Behavior Verification",
|
|
41
41
|
[".prizmkit/refactor/{slug}/review-report.md"]),
|
|
42
42
|
("prizmkit-committer", "Commit",
|
|
43
|
-
[]),
|
|
43
|
+
["--headless"]),
|
|
44
44
|
("refactor-report", "Generate Refactor Report",
|
|
45
45
|
[".prizmkit/refactor/{slug}/refactor-report.md"]),
|
|
46
46
|
]
|
|
@@ -357,10 +357,15 @@ def get_prev_session_status(state_dir, refactor_id):
|
|
|
357
357
|
|
|
358
358
|
|
|
359
359
|
def resolve_project_root(script_dir):
|
|
360
|
-
"""Resolve project root
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
"""Resolve project root. Layout-aware:
|
|
361
|
+
<project>/.prizmkit/dev-pipeline/scripts/ → <project>
|
|
362
|
+
<repo>/dev-pipeline/scripts/ → <repo>
|
|
363
|
+
"""
|
|
364
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
365
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
366
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
367
|
+
return os.path.abspath(os.path.dirname(pipeline_parent))
|
|
368
|
+
return os.path.abspath(pipeline_parent)
|
|
364
369
|
|
|
365
370
|
|
|
366
371
|
def build_replacements(args, refactor, refactors, global_context, script_dir):
|
|
@@ -50,7 +50,7 @@ PHASE_KEYWORDS = {
|
|
|
50
50
|
},
|
|
51
51
|
"retrospective": {
|
|
52
52
|
"strong": ["prizmkit-retrospective"],
|
|
53
|
-
"weak": ["retrospective", "structural sync", "architecture knowledge", ".prizm-docs/ sync"],
|
|
53
|
+
"weak": ["retrospective", "structural sync", "architecture knowledge", ".prizmkit/prizm-docs/ sync"],
|
|
54
54
|
},
|
|
55
55
|
"commit": {
|
|
56
56
|
"strong": ["prizmkit-committer"],
|
|
@@ -341,7 +341,15 @@ def action_update(args, bug_list_path, state_dir):
|
|
|
341
341
|
|
|
342
342
|
|
|
343
343
|
def _default_project_root():
|
|
344
|
-
|
|
344
|
+
env = os.environ.get("PROJECT_ROOT")
|
|
345
|
+
if env:
|
|
346
|
+
return os.path.abspath(env)
|
|
347
|
+
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
348
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
349
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
350
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
351
|
+
return os.path.dirname(pipeline_parent)
|
|
352
|
+
return pipeline_parent
|
|
345
353
|
|
|
346
354
|
|
|
347
355
|
def cleanup_bug_artifacts(state_dir, bug_id, project_root=None):
|
|
@@ -236,7 +236,19 @@ def update_feature_in_list(feature_list_path, feature_id, new_status):
|
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
def _default_project_root():
|
|
239
|
-
|
|
239
|
+
# Script lives at <pipeline>/scripts/update-feature-status.py.
|
|
240
|
+
# Pipeline may be either <project>/.prizmkit/dev-pipeline (user install)
|
|
241
|
+
# or <repo>/dev-pipeline (framework source). Auto-detect by checking if
|
|
242
|
+
# the parent of dev-pipeline is named ".prizmkit".
|
|
243
|
+
env = os.environ.get("PROJECT_ROOT")
|
|
244
|
+
if env:
|
|
245
|
+
return os.path.abspath(env)
|
|
246
|
+
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
247
|
+
pipeline_dir = os.path.dirname(script_dir)
|
|
248
|
+
pipeline_parent = os.path.dirname(pipeline_dir)
|
|
249
|
+
if os.path.basename(pipeline_parent) == ".prizmkit":
|
|
250
|
+
return os.path.dirname(pipeline_parent)
|
|
251
|
+
return pipeline_parent
|
|
240
252
|
|
|
241
253
|
|
|
242
254
|
def _build_feature_slug(feature_id, title):
|