peaks-loop 3.1.2 → 4.0.0-beta.2
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/.claude-plugin/marketplace.json +62 -12
- package/CHANGELOG.md +148 -116
- package/README-en.md +58 -240
- package/README.md +49 -325
- package/agents/karpathy-reviewer.md +3 -3
- package/dist/src/cli/cli-helpers.d.ts +18 -0
- package/dist/src/cli/cli-helpers.js +8 -0
- package/dist/src/cli/commands/adapter-commands.d.ts +30 -0
- package/dist/src/cli/commands/adapter-commands.js +35 -0
- package/dist/src/cli/commands/{solo-commands.d.ts → code-commands.d.ts} +25 -25
- package/dist/src/cli/commands/{solo-commands.js → code-commands.js} +82 -82
- package/dist/src/cli/commands/context-commands.d.ts +1 -1
- package/dist/src/cli/commands/context-commands.js +1 -1
- package/dist/src/cli/commands/contract-commands.d.ts +1 -1
- package/dist/src/cli/commands/contract-commands.js +1 -1
- package/dist/src/cli/commands/core/session-command.js +12 -0
- package/dist/src/cli/commands/core/skill-command.js +4 -4
- package/dist/src/cli/commands/dispatch-commands.js +2 -2
- package/dist/src/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/src/cli/commands/hook-handle.js +7 -7
- package/dist/src/cli/commands/job-commands.js +7 -7
- package/dist/src/cli/commands/observability-commands.js +1 -1
- package/dist/src/cli/commands/perf-audit-commands.js +2 -2
- package/dist/src/cli/commands/security-audit-commands.js +2 -2
- package/dist/src/cli/commands/sediment-commands.d.ts +80 -0
- package/dist/src/cli/commands/sediment-commands.js +640 -0
- package/dist/src/cli/commands/session-auto-compact-hook-command.js +2 -2
- package/dist/src/cli/commands/session-migrate-skill-name.d.ts +17 -0
- package/dist/src/cli/commands/session-migrate-skill-name.js +41 -0
- package/dist/src/cli/commands/skill-visibility.d.ts +8 -0
- package/dist/src/cli/commands/skill-visibility.js +63 -0
- package/dist/src/cli/commands/slice-commands.js +2 -2
- package/dist/src/cli/commands/sub-agent-commands.d.ts +1 -1
- package/dist/src/cli/commands/sub-agent-commands.js +1 -1
- package/dist/src/cli/commands/sub-agent-shared.d.ts +1 -1
- package/dist/src/cli/commands/understand-commands.js +1 -1
- package/dist/src/cli/commands/upgrade-commands.d.ts +1 -1
- package/dist/src/cli/commands/upgrade-commands.js +3 -3
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +4 -4
- package/dist/src/cli/commands/user-touchpoint-commands.js +15 -15
- package/dist/src/cli/commands/verdict-aggregate-command.d.ts +1 -1
- package/dist/src/cli/commands/verdict-aggregate-command.js +2 -2
- package/dist/src/cli/commands/workflow-commands.js +23 -23
- package/dist/src/cli/commands/workspace/init-command.d.ts +3 -3
- package/dist/src/cli/commands/workspace/init-command.js +7 -7
- package/dist/src/cli/program.js +24 -7
- package/dist/src/services/adapter/adapter.d.ts +27 -0
- package/dist/src/services/adapter/adapter.js +5 -0
- package/dist/src/services/adapter/auto-adapter.d.ts +11 -0
- package/dist/src/services/adapter/auto-adapter.js +15 -0
- package/dist/src/services/adapter/claude-adapter.d.ts +14 -0
- package/dist/src/services/adapter/claude-adapter.js +40 -0
- package/dist/src/services/adapter/codex-adapter.d.ts +14 -0
- package/dist/src/services/adapter/codex-adapter.js +14 -0
- package/dist/src/services/adapter/copilot-adapter.d.ts +14 -0
- package/dist/src/services/adapter/copilot-adapter.js +14 -0
- package/dist/src/services/artifacts/repair-cycle-service.js +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +1 -1
- package/dist/src/services/audit/enforcers/{solo-code-ban.d.ts → code-ban.d.ts} +6 -6
- package/dist/src/services/audit/enforcers/{solo-code-ban.js → code-ban.js} +6 -6
- package/dist/src/services/audit/red-line-catalog.d.ts +2 -2
- package/dist/src/services/audit/red-line-catalog.js +6 -6
- package/dist/src/services/audit/scanners/skills-tree-scanner.js +22 -0
- package/dist/src/services/audit/types.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.js +5 -5
- package/dist/src/services/{solo → code}/dag-orchestrator.d.ts +4 -4
- package/dist/src/services/{solo → code}/dag-orchestrator.js +5 -5
- package/dist/src/services/{solo → code}/emit-handoff.d.ts +1 -1
- package/dist/src/services/{solo → code}/emit-handoff.js +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.d.ts +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.js +5 -5
- package/dist/src/services/{solo → code}/mode-gate.d.ts +11 -11
- package/dist/src/services/{solo → code}/mode-gate.js +5 -5
- package/dist/src/services/{solo → code}/post-compact-detector.d.ts +3 -3
- package/dist/src/services/{solo → code}/post-compact-detector.js +6 -6
- package/dist/src/services/{solo → code}/status-line-renderer.d.ts +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.d.ts +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.js +4 -4
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.d.ts +1 -1
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.js +1 -1
- package/dist/src/services/context/auto-compact-dispatcher.d.ts +3 -3
- package/dist/src/services/context/auto-compact-dispatcher.js +2 -2
- package/dist/src/services/context/auto-compact-types.d.ts +1 -1
- package/dist/src/services/dispatch/batch-counter.js +1 -1
- package/dist/src/services/dispatch/leak-detector.js +1 -1
- package/dist/src/services/dispatch/slice-dag.d.ts +2 -2
- package/dist/src/services/dispatch/test-tool-detection.d.ts +1 -1
- package/dist/src/services/dispatch/test-tool-detection.js +1 -1
- package/dist/src/services/doctor/doctor-service.js +2 -2
- package/dist/src/services/feedback/feedback-promotion-service.js +2 -2
- package/dist/src/services/job/job-progress-store.d.ts +1 -1
- package/dist/src/services/job/job-progress-store.js +1 -1
- package/dist/src/services/job/job-resource-snapshot.js +29 -1
- package/dist/src/services/memory/project-memory-service.js +1 -1
- package/dist/src/services/migrate-skill-name/migrate.d.ts +17 -0
- package/dist/src/services/migrate-skill-name/migrate.js +152 -0
- package/dist/src/services/migrate-skill-name/schema.d.ts +42 -0
- package/dist/src/services/migrate-skill-name/schema.js +25 -0
- package/dist/src/services/observability/aggregation.d.ts +1 -1
- package/dist/src/services/observability/aggregation.js +1 -1
- package/dist/src/services/perf/perf-baseline-service.d.ts +1 -1
- package/dist/src/services/perf/perf-baseline-service.js +1 -1
- package/dist/src/services/prd/handoff-types.d.ts +1 -1
- package/dist/src/services/prd/handoff-types.js +1 -1
- package/dist/src/services/preferences/preferences-service.d.ts +1 -1
- package/dist/src/services/preferences/preferences-types.d.ts +1 -1
- package/dist/src/services/progress/progress-service.d.ts +1 -1
- package/dist/src/services/progress/progress-service.js +1 -1
- package/dist/src/services/rd/standards-diagnostic.d.ts +1 -1
- package/dist/src/services/rd/standards-diagnostic.js +3 -3
- package/dist/src/services/recommendations/capability-seed-items.js +1 -1
- package/dist/src/services/recommendations/capability-seed-mappings.js +1 -1
- package/dist/src/services/recommendations/recommendation-service.js +1 -1
- package/dist/src/services/refactor/refactor-service.d.ts +1 -1
- package/dist/src/services/sc/sc-service.js +1 -1
- package/dist/src/services/sediment/dispose-confirm.d.ts +9 -0
- package/dist/src/services/sediment/dispose-confirm.js +5 -0
- package/dist/src/services/sediment/json-schema.d.ts +247 -0
- package/dist/src/services/sediment/json-schema.js +26 -0
- package/dist/src/services/sediment/manifest-lint.d.ts +13 -0
- package/dist/src/services/sediment/manifest-lint.js +11 -0
- package/dist/src/services/sediment/pool-paths.d.ts +22 -0
- package/dist/src/services/sediment/pool-paths.js +25 -0
- package/dist/src/services/sediment/pool-read.d.ts +20 -0
- package/dist/src/services/sediment/pool-read.js +73 -0
- package/dist/src/services/sediment/pool-rebuild-index.d.ts +15 -0
- package/dist/src/services/sediment/pool-rebuild-index.js +28 -0
- package/dist/src/services/sediment/pool-write.d.ts +14 -0
- package/dist/src/services/sediment/pool-write.js +25 -0
- package/dist/src/services/sediment/promotion-gate.d.ts +12 -0
- package/dist/src/services/sediment/promotion-gate.js +20 -0
- package/dist/src/services/sediment/types.d.ts +52 -0
- package/dist/src/services/sediment/types.js +1 -0
- package/dist/src/services/session/binding-store.d.ts +1 -1
- package/dist/src/services/session/binding-store.js +1 -1
- package/dist/src/services/session/caller-id-types.d.ts +1 -1
- package/dist/src/services/session/session-manager.d.ts +1 -1
- package/dist/src/services/session/session-manager.js +1 -1
- package/dist/src/services/signal/cancel-handler.js +3 -3
- package/dist/src/services/skill/resume-detector.js +2 -2
- package/dist/src/services/skill/skill-scheduler.d.ts +1 -1
- package/dist/src/services/skill/skill-scheduler.js +1 -1
- package/dist/src/services/skillhub/release-diff.d.ts +18 -0
- package/dist/src/services/skillhub/release-diff.js +38 -0
- package/dist/src/services/skillhub/release-export.d.ts +8 -0
- package/dist/src/services/skillhub/release-export.js +31 -0
- package/dist/src/services/skillhub/release-gc-blobs.d.ts +13 -0
- package/dist/src/services/skillhub/release-gc-blobs.js +32 -0
- package/dist/src/services/skillhub/release-import.d.ts +7 -0
- package/dist/src/services/skillhub/release-import.js +59 -0
- package/dist/src/services/skillhub/release-retain.d.ts +23 -0
- package/dist/src/services/skillhub/release-retain.js +89 -0
- package/dist/src/services/skillhub/sqlite-store.d.ts +22 -0
- package/dist/src/services/skillhub/sqlite-store.js +47 -0
- package/dist/src/services/skillhub/tar-runtime.d.ts +21 -0
- package/dist/src/services/skillhub/tar-runtime.js +91 -0
- package/dist/src/services/skillhub/types.d.ts +105 -0
- package/dist/src/services/skillhub/types.js +1 -0
- package/dist/src/services/skills/skill-conformance-service.js +8 -5
- package/dist/src/services/skills/skill-presence-service.d.ts +5 -5
- package/dist/src/services/skills/skill-presence-service.js +2 -2
- package/dist/src/services/skills/skill-registry.js +27 -0
- package/dist/src/services/skills/skill-runbook-service.js +2 -2
- package/dist/src/services/slice/slice-check-service.js +1 -1
- package/dist/src/services/slice/slice-check-types.d.ts +1 -1
- package/dist/src/services/slice/slice-check-types.js +1 -1
- package/dist/src/services/slice/slice-decompose-types.d.ts +1 -1
- package/dist/src/services/slice/slice-decompose-types.js +1 -1
- package/dist/src/services/standards/missing-standards-detector.d.ts +1 -1
- package/dist/src/services/standards/missing-standards-detector.js +1 -1
- package/dist/src/services/standards/project-standards-service.d.ts +1 -1
- package/dist/src/services/standards/project-standards-service.js +4 -4
- package/dist/src/services/understand/understand-types.d.ts +1 -1
- package/dist/src/services/upgrade/1x-detector-service.js +2 -2
- package/dist/src/services/upgrade/upgrade-service.d.ts +34 -0
- package/dist/src/services/upgrade/upgrade-service.js +52 -30
- package/dist/src/services/verdict/verdict-aggregator.d.ts +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.d.ts +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.js +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.d.ts +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.js +2 -2
- package/dist/src/services/workflow/workflow-router-service.d.ts +7 -7
- package/dist/src/services/workflow/workflow-router-service.js +33 -33
- package/dist/src/services/workspace/claude-settings-template.d.ts +2 -2
- package/dist/src/services/workspace/claude-settings-template.js +7 -7
- package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +1 -1
- package/dist/src/services/workspace/workspace-claude-settings-materializer.js +1 -1
- package/dist/src/services/workspace/workspace-service.d.ts +4 -4
- package/dist/src/services/workspace/workspace-service.js +2 -2
- package/dist/src/shared/paths.d.ts +1 -1
- package/dist/src/shared/paths.js +1 -1
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/dist/src/skills/peaks-maker/index.d.ts +5 -0
- package/dist/src/skills/peaks-maker/index.js +32 -0
- package/output-styles/peaks-skill-swarm.md +3 -3
- package/package.json +8 -3
- package/scripts/install-skills.mjs +29 -4
- package/skills/{peaks-prd → bee/peaks-prd}/SKILL.md +8 -2
- package/skills/{peaks-prd → bee/peaks-prd}/references/workflow.md +1 -1
- package/skills/{peaks-qa → bee/peaks-qa}/SKILL.md +10 -4
- package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-per-request.md +3 -3
- package/skills/{peaks-qa → bee/peaks-qa}/references/browser-validation-contracts.md +2 -2
- package/skills/{peaks-qa → bee/peaks-qa}/references/external-capability-guidance.md +1 -1
- package/skills/{peaks-qa → bee/peaks-qa}/references/qa-fanout-contract.md +3 -3
- package/skills/{peaks-qa → bee/peaks-qa}/references/qa-sub-agent-dispatch.md +7 -7
- package/skills/{peaks-rd → bee/peaks-rd}/SKILL.md +13 -6
- package/skills/{peaks-rd → bee/peaks-rd}/references/browser-self-test-contracts.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/mock-data-placement.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/parallel-review-fanout.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-fanout-contracts.md +1 -1
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-runbook.md +2 -2
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-sub-agent-dispatch.md +13 -13
- package/skills/{peaks-rd → bee/peaks-rd}/references/rd-transition-gates.md +2 -2
- package/skills/{peaks-rd → bee/peaks-rd}/references/skill-presence-and-title.md +1 -1
- package/skills/{peaks-reviewer → bee/peaks-reviewer}/SKILL.md +2 -2
- package/skills/{peaks-sc → bee/peaks-sc}/SKILL.md +8 -2
- package/skills/{peaks-txt → bee/peaks-txt}/SKILL.md +11 -5
- package/skills/{peaks-ui → bee/peaks-ui}/SKILL.md +19 -13
- package/skills/peaks-audit/SKILL.md +1 -1
- package/skills/{peaks-solo → peaks-code}/SKILL.md +29 -29
- package/skills/{peaks-solo → peaks-code}/references/a2a-artifact-mapping.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/anchoring-and-session-info.md +6 -6
- package/skills/{peaks-solo → peaks-code}/references/artifact-contracts.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/boundaries.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/browser-workflow.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/codegraph-orchestration.md +1 -1
- package/skills/peaks-code/references/command-migration.md +3 -0
- package/skills/{peaks-solo → peaks-code}/references/completion-handoff.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/context-governance.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/dag-orchestrator.md +7 -7
- package/skills/{peaks-solo → peaks-code}/references/external-references.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/fanout-mandatory.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/fast-mode.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/frontend-only-mode.md +10 -10
- package/skills/{peaks-solo → peaks-code}/references/job-loop.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/local-artifact-workspace.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/micro-cycle.md +23 -23
- package/skills/{peaks-solo → peaks-code}/references/mode-selection-with-stale-presence.md +16 -16
- package/skills/{peaks-solo → peaks-code}/references/mode-selection.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/openspec-workflow.md +17 -17
- package/skills/{peaks-solo → peaks-code}/references/periodic-checkpoint.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/project-scan-checklist.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/quality-gate-cheatsheet.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/refactor-mode.md +2 -2
- package/skills/{peaks-solo → peaks-code}/references/resume-detection.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/runbook.md +20 -20
- package/skills/{peaks-solo → peaks-code}/references/skill-presence-and-title.md +3 -3
- package/skills/{peaks-solo → peaks-code}/references/standards-preflight.md +1 -1
- package/skills/{peaks-solo → peaks-code}/references/step-0-55-1x-detection.md +6 -6
- package/skills/{peaks-solo → peaks-code}/references/step-0-8-gate.md +11 -11
- package/skills/{peaks-solo → peaks-code}/references/sub-agent-dispatch.md +17 -17
- package/skills/{peaks-solo → peaks-code}/references/swarm-dispatch-contract.md +22 -22
- package/skills/{peaks-solo → peaks-code}/references/workflow-gates-and-types.md +4 -4
- package/skills/{peaks-solo → peaks-code}/references/workflow.md +5 -5
- package/skills/peaks-doctor/SKILL.md +1 -1
- package/skills/peaks-doctor/references/doctor-check-catalog.md +1 -1
- package/skills/peaks-final-review/SKILL.md +3 -3
- package/skills/peaks-final-review/references/4-dimensions.md +1 -1
- package/skills/peaks-ide/SKILL.md +1 -1
- package/skills/{peaks-solo-resume → peaks-resume}/SKILL.md +15 -15
- package/skills/peaks-sop/SKILL.md +1 -1
- package/skills/{peaks-solo-status → peaks-status}/SKILL.md +14 -14
- package/skills/{peaks-solo-test → peaks-test}/SKILL.md +12 -12
- package/skills/peaks-solo/references/command-migration.md +0 -3
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.d.ts +0 -0
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.js +0 -0
- /package/dist/src/services/{solo → code}/status-line-renderer.js +0 -0
- /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/SKILL.md +0 -0
- /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/references/audit-protocol.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/command-migration.md +0 -0
- /package/skills/{peaks-prd → bee/peaks-prd}/references/prd-for-multi-pass.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/codegraph-regression-focus.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/command-migration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/openspec-validation-gate.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-compact-handoff.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-context-governance.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-gstack-integration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-local-artifacts.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-matt-pocock-integration.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-perf-test-plan.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-refactor-role.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-runbook.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-security-test-plan.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-skill-presence.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-standards-preflight.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-transition-gates.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/reading-handoff-frontmatter.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/regression-gates.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/requirement-boundary-recheck.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/test-case-generation.md +0 -0
- /package/skills/{peaks-qa → bee/peaks-qa}/references/test-report-output.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-and-standards-output.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/browser-action-wrapper.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/code-reviewer-4dim-hint.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/codegraph-project-analysis.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/command-migration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/compact-handoff.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/external-references.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/frontend-project-generation.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/karpathy-reviewer-prompt.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/library-version-awareness.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/mandatory-perf-baseline.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/matt-pocock-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/ocr-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/openspec-cli.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-context-governance.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-gstack-integration.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-standards-preflight.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/reading-v2-slice-results.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/refactor-workflow.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/v2-12-fanout-collapse.md +0 -0
- /package/skills/{peaks-rd → bee/peaks-rd}/references/writing-handoff-frontmatter.md +0 -0
- /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-prompt.md +0 -0
- /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-schema.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-retention.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/command-migration.md +0 -0
- /package/skills/{peaks-sc → bee/peaks-sc}/references/openspec-commit-boundaries.md +0 -0
- /package/skills/{peaks-security-audit → bee/peaks-security-audit}/SKILL.md +0 -0
- /package/skills/{peaks-security-audit → bee/peaks-security-audit}/references/audit-protocol.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/command-migration.md +0 -0
- /package/skills/{peaks-txt → bee/peaks-txt}/references/context-capsule.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-contracts.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-per-request.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/command-migration.md +0 -0
- /package/skills/{peaks-ui → bee/peaks-ui}/references/workflow.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/checkpoint-resume.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/cross-date-session-check.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/envelope-contract.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/existing-system-extraction.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/external-skill-invocation.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/gstack-integration.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/headroom-integration.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/playwright-mcp-multi-terminal.md +0 -0
- /package/skills/{peaks-solo → peaks-code}/references/project-memory-loading.md +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync, readdirSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
3
|
+
import { join, relative } from "node:path";
|
|
4
|
+
/** Compute the sha256 hash and byte length of a single file. */
|
|
5
|
+
export function sha256OfFile(p) {
|
|
6
|
+
const buf = readFileSync(p);
|
|
7
|
+
return { sha: createHash("sha256").update(buf).digest("hex"), bytes: buf.length };
|
|
8
|
+
}
|
|
9
|
+
/** Copy a file into the content-addressed blob store under `blobsDir/<aa>/<sha>`
|
|
10
|
+
* if not already present, and return the relative blob_path used by `bee_file`. */
|
|
11
|
+
export function ensureBlob(blobsDir, sha, srcPath) {
|
|
12
|
+
const dir = join(blobsDir, sha.slice(0, 2));
|
|
13
|
+
const dest = join(dir, sha);
|
|
14
|
+
if (!existsSync(dir))
|
|
15
|
+
mkdirSync(dir, { recursive: true });
|
|
16
|
+
if (!existsSync(dest))
|
|
17
|
+
writeFileSync(dest, readFileSync(srcPath));
|
|
18
|
+
return `blobs/${sha.slice(0, 2)}/${sha}`;
|
|
19
|
+
}
|
|
20
|
+
export function* walk(root, base = root) {
|
|
21
|
+
for (const ent of readdirSync(base, { withFileTypes: true })) {
|
|
22
|
+
const abs = join(base, ent.name);
|
|
23
|
+
if (ent.isDirectory())
|
|
24
|
+
yield* walk(root, abs);
|
|
25
|
+
else {
|
|
26
|
+
const relPosix = relative(root, abs).split(/[\\/]/).join("/");
|
|
27
|
+
yield { abs, rel: relPosix };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function warnOverflow(column, length) {
|
|
32
|
+
// Soft warning, no truncation: the spec does not mandate truncation,
|
|
33
|
+
// but a stale over-16KB row would silently break downstream readers
|
|
34
|
+
// that assume <16KB. Surface it for ops review.
|
|
35
|
+
// eslint-disable-next-line no-console
|
|
36
|
+
console.warn(`[release-retain] WARN: column ${column} overflowed 16KB guard (${length} bytes) — review and consider truncation`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Defensive 16KB check: if the value would exceed SQLite's
|
|
40
|
+
* recommended 16KB single-column limit, log a warning. Not a hard
|
|
41
|
+
* error — we let SQLite handle overflow. The columns covered are the
|
|
42
|
+
* four TEXT columns previously unchecked: bee_manifest.segments_json,
|
|
43
|
+
* bee_segment_ref.inputs_json, bee_segment_ref.outputs_json,
|
|
44
|
+
* bee_segment_ref.side_effects.
|
|
45
|
+
*/
|
|
46
|
+
function checkOverflow({ table, col }, value) {
|
|
47
|
+
const len = Buffer.byteLength(value, "utf-8");
|
|
48
|
+
if (len > 16 * 1024)
|
|
49
|
+
warnOverflow(`${table}.${col}`, len);
|
|
50
|
+
}
|
|
51
|
+
export function retainRelease({ db, blobsDir, scratchDir, manifest, version: explicitVersion, parentVersion, changelog, }) {
|
|
52
|
+
const version = explicitVersion ?? "0.1.0";
|
|
53
|
+
const tx = db.transaction(() => {
|
|
54
|
+
const ins = db.prepare(`INSERT INTO bee_release (bee_name, version, source, archived_at, archived_by, user_intent_raw, description, parent_version, changelog) VALUES (?, ?, 'user', ?, ?, ?, ?, ?, ?)`);
|
|
55
|
+
const info = ins.run(manifest.name, version, new Date().toISOString(), "llm", null, manifest.description, parentVersion ?? null, changelog ?? null);
|
|
56
|
+
const id = info.lastInsertRowid;
|
|
57
|
+
db.prepare(`INSERT OR REPLACE INTO bee_release_pointer (bee_name, latest_version, released_at) VALUES (?, ?, ?)`).run(manifest.name, version, new Date().toISOString());
|
|
58
|
+
for (const s of manifest.segments) {
|
|
59
|
+
const inputsJson = JSON.stringify(s.inputs);
|
|
60
|
+
const outputsJson = JSON.stringify(s.outputs);
|
|
61
|
+
const sideEffectsStr = s.sideEffects.join(",");
|
|
62
|
+
checkOverflow({ table: "bee_segment_ref", col: "inputs_json" }, inputsJson);
|
|
63
|
+
checkOverflow({ table: "bee_segment_ref", col: "outputs_json" }, outputsJson);
|
|
64
|
+
checkOverflow({ table: "bee_segment_ref", col: "side_effects" }, sideEffectsStr);
|
|
65
|
+
db.prepare(`INSERT INTO bee_segment_ref (release_id, segment_name, inputs_json, outputs_json, side_effects) VALUES (?, ?, ?, ?, ?)`).run(id, s.name, inputsJson, outputsJson, sideEffectsStr);
|
|
66
|
+
}
|
|
67
|
+
// Also guard the manifest-level JSON column that holds the segment
|
|
68
|
+
// name list (can exceed 16KB if a bee advertises thousands of
|
|
69
|
+
// segments).
|
|
70
|
+
const segmentsJson = JSON.stringify(manifest.segments.map((s) => s.name));
|
|
71
|
+
checkOverflow({ table: "bee_manifest", col: "segments_json" }, segmentsJson);
|
|
72
|
+
db.prepare(`INSERT INTO bee_manifest (release_id, schema_version, description, segments_json, entrypoint_preamble, promotion, min_cycles, requires_human, requires_smoke, retire_on_misses) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, manifest.schemaVersion, manifest.description, segmentsJson, manifest.entrypoint.preamble, manifest.promotion_status, manifest.promotion.minCycles, manifest.promotion.requiresHumanApproval ? 1 : 0, manifest.promotion.requiresSmokeTest ? 1 : 0, manifest.promotion.retireOnMissesInRow ?? null);
|
|
73
|
+
const insFile = db.prepare(`INSERT INTO bee_file (release_id, owner_kind, owner_name, path, kind, size_bytes, sha256, blob_path) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`);
|
|
74
|
+
for (const f of walk(scratchDir)) {
|
|
75
|
+
const { sha, bytes } = sha256OfFile(f.abs);
|
|
76
|
+
const blobPath = ensureBlob(blobsDir, sha, f.abs);
|
|
77
|
+
const kind = f.rel.endsWith(".md")
|
|
78
|
+
? "markdown"
|
|
79
|
+
: f.rel.startsWith("scripts/")
|
|
80
|
+
? "script"
|
|
81
|
+
: f.rel.startsWith("references/")
|
|
82
|
+
? "reference"
|
|
83
|
+
: "other";
|
|
84
|
+
insFile.run(id, "bee", manifest.name, f.rel, kind, bytes, sha, blobPath);
|
|
85
|
+
}
|
|
86
|
+
return id;
|
|
87
|
+
});
|
|
88
|
+
return tx();
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
/**
|
|
3
|
+
* Open (or create) a SkillHub state database at the given path.
|
|
4
|
+
*
|
|
5
|
+
* Behavior:
|
|
6
|
+
* - Creates the parent directory if it does not exist.
|
|
7
|
+
* - Enables WAL journal mode and foreign-key enforcement.
|
|
8
|
+
* - Applies every `migrations/*.sql` file in lexicographic order.
|
|
9
|
+
* Migrations must be idempotent (CREATE TABLE IF NOT EXISTS, etc.).
|
|
10
|
+
*
|
|
11
|
+
* The migrations directory lives next to this source file at build time;
|
|
12
|
+
* we resolve it via `import.meta.url` so the lookup survives vitest ESM
|
|
13
|
+
* (where `__dirname` is undefined). Migration files are discovered by
|
|
14
|
+
* globbing (`*.sql`) and sorted lexicographically so future
|
|
15
|
+
* `002-…`, `003-…` additions are picked up automatically.
|
|
16
|
+
*/
|
|
17
|
+
export declare function openStateDb(path: string): Database.Database;
|
|
18
|
+
/**
|
|
19
|
+
* Return the user-defined table names present in `db` (excluding SQLite
|
|
20
|
+
* system tables such as `sqlite_sequence`).
|
|
21
|
+
*/
|
|
22
|
+
export declare function listTables(db: Database.Database): string[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import { readFileSync, readdirSync, existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
/**
|
|
6
|
+
* Open (or create) a SkillHub state database at the given path.
|
|
7
|
+
*
|
|
8
|
+
* Behavior:
|
|
9
|
+
* - Creates the parent directory if it does not exist.
|
|
10
|
+
* - Enables WAL journal mode and foreign-key enforcement.
|
|
11
|
+
* - Applies every `migrations/*.sql` file in lexicographic order.
|
|
12
|
+
* Migrations must be idempotent (CREATE TABLE IF NOT EXISTS, etc.).
|
|
13
|
+
*
|
|
14
|
+
* The migrations directory lives next to this source file at build time;
|
|
15
|
+
* we resolve it via `import.meta.url` so the lookup survives vitest ESM
|
|
16
|
+
* (where `__dirname` is undefined). Migration files are discovered by
|
|
17
|
+
* globbing (`*.sql`) and sorted lexicographically so future
|
|
18
|
+
* `002-…`, `003-…` additions are picked up automatically.
|
|
19
|
+
*/
|
|
20
|
+
export function openStateDb(path) {
|
|
21
|
+
const parent = dirname(path);
|
|
22
|
+
if (!existsSync(parent))
|
|
23
|
+
mkdirSync(parent, { recursive: true });
|
|
24
|
+
const db = new Database(path);
|
|
25
|
+
db.pragma("journal_mode = WAL");
|
|
26
|
+
db.pragma("foreign_keys = ON");
|
|
27
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const migrationsDir = join(here, "migrations");
|
|
29
|
+
if (existsSync(migrationsDir)) {
|
|
30
|
+
const files = readdirSync(migrationsDir).filter((f) => f.endsWith(".sql")).sort();
|
|
31
|
+
for (const f of files) {
|
|
32
|
+
const sql = readFileSync(join(migrationsDir, f), "utf-8");
|
|
33
|
+
db.exec(sql);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return db;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Return the user-defined table names present in `db` (excluding SQLite
|
|
40
|
+
* system tables such as `sqlite_sequence`).
|
|
41
|
+
*/
|
|
42
|
+
export function listTables(db) {
|
|
43
|
+
const rows = db
|
|
44
|
+
.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'")
|
|
45
|
+
.all();
|
|
46
|
+
return rows.map((r) => r.name);
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Thrown when no usable tar binary can be located. */
|
|
2
|
+
export declare class TAR_NOT_FOUND extends Error {
|
|
3
|
+
constructor(msg: string);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Run `tar <args...>` in a cross-platform way.
|
|
7
|
+
*
|
|
8
|
+
* Args MUST be `["-czf", outPath, "-C", stageDir, "."]` style (no
|
|
9
|
+
* shell quoting needed because we use execFileSync, not execSync).
|
|
10
|
+
*
|
|
11
|
+
* After the Critical #3 fix:
|
|
12
|
+
* - Honors PEAKS_TAR_BIN / TAR env vars.
|
|
13
|
+
* - On Windows, tries C:\Windows\System32\tar.exe first; falls back
|
|
14
|
+
* to PATH lookup if it's missing.
|
|
15
|
+
* - Accumulates tar's stderr and re-throws it on non-zero exit so
|
|
16
|
+
* operators can see WHY tar failed (path typo, permission, corrupt
|
|
17
|
+
* stage dir, etc.) instead of swallowing it.
|
|
18
|
+
*
|
|
19
|
+
* Throws `TAR_NOT_FOUND` when the binary cannot be located.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runTar(args: string[]): void;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
/** Thrown when no usable tar binary can be located. */
|
|
4
|
+
export class TAR_NOT_FOUND extends Error {
|
|
5
|
+
constructor(msg) {
|
|
6
|
+
super(`TAR_NOT_FOUND: ${msg}`);
|
|
7
|
+
this.name = "TAR_NOT_FOUND";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a tar binary path, in priority order:
|
|
12
|
+
* 1. process.env.PEAKS_TAR_BIN (explicit override; honored unconditionally)
|
|
13
|
+
* 2. process.env.TAR (POSIX convention, honored if set)
|
|
14
|
+
* 3. On Windows: C:\Windows\System32\tar.exe (bsdtar — accepts
|
|
15
|
+
* Windows-style paths verbatim, unlike git-bash GNU tar)
|
|
16
|
+
* 4. PATH lookup: "tar" (delegates to the platform default)
|
|
17
|
+
*
|
|
18
|
+
* Throws `TAR_NOT_FOUND` when none of the candidates exist (Windows
|
|
19
|
+
* file-system check) or no override is set (POSIX). On POSIX we
|
|
20
|
+
* always trust PATH; tar is in base images 99.9% of the time. On
|
|
21
|
+
* Windows we explicitly stat each candidate so a missing
|
|
22
|
+
* C:\Windows\System32\tar.exe falls through to PATH instead of
|
|
23
|
+
* throwing an opaque spawn-ENOENT.
|
|
24
|
+
*/
|
|
25
|
+
function resolveTarBin() {
|
|
26
|
+
const envOverride = process.env.PEAKS_TAR_BIN;
|
|
27
|
+
if (envOverride && envOverride.length > 0)
|
|
28
|
+
return envOverride;
|
|
29
|
+
const envTar = process.env.TAR;
|
|
30
|
+
if (envTar && envTar.length > 0)
|
|
31
|
+
return envTar;
|
|
32
|
+
if (process.platform === "win32") {
|
|
33
|
+
const systemTar = "C:\\Windows\\System32\\tar.exe";
|
|
34
|
+
if (existsSync(systemTar))
|
|
35
|
+
return systemTar;
|
|
36
|
+
// Fall through to PATH lookup below — many dev setups install tar
|
|
37
|
+
// under Git for Windows or WindowsApps rather than System32.
|
|
38
|
+
}
|
|
39
|
+
// PATH lookup. We can't stat `tar` directly (it's a name, not a path),
|
|
40
|
+
// so we trust the resolution to execFileSync and surface a clean
|
|
41
|
+
// TAR_NOT_FOUND error from the caller if it fails.
|
|
42
|
+
return "tar";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Run `tar <args...>` in a cross-platform way.
|
|
46
|
+
*
|
|
47
|
+
* Args MUST be `["-czf", outPath, "-C", stageDir, "."]` style (no
|
|
48
|
+
* shell quoting needed because we use execFileSync, not execSync).
|
|
49
|
+
*
|
|
50
|
+
* After the Critical #3 fix:
|
|
51
|
+
* - Honors PEAKS_TAR_BIN / TAR env vars.
|
|
52
|
+
* - On Windows, tries C:\Windows\System32\tar.exe first; falls back
|
|
53
|
+
* to PATH lookup if it's missing.
|
|
54
|
+
* - Accumulates tar's stderr and re-throws it on non-zero exit so
|
|
55
|
+
* operators can see WHY tar failed (path typo, permission, corrupt
|
|
56
|
+
* stage dir, etc.) instead of swallowing it.
|
|
57
|
+
*
|
|
58
|
+
* Throws `TAR_NOT_FOUND` when the binary cannot be located.
|
|
59
|
+
*/
|
|
60
|
+
export function runTar(args) {
|
|
61
|
+
const cmd = resolveTarBin();
|
|
62
|
+
try {
|
|
63
|
+
execFileSync(cmd, args, {
|
|
64
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
65
|
+
// Surface stderr text rather than dumping a Buffer at the caller.
|
|
66
|
+
// execFileSync with stdio: ["ignore","ignore","pipe"] captures the
|
|
67
|
+
// stderr stream into the Error's `.stderr` Buffer when the child
|
|
68
|
+
// exits non-zero.
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
// Distinguish "binary not found" from "binary ran but failed".
|
|
73
|
+
if (e && typeof e === "object" && "code" in e) {
|
|
74
|
+
const code = e.code;
|
|
75
|
+
if (code === "ENOENT") {
|
|
76
|
+
throw new TAR_NOT_FOUND(`tar binary not found (cmd="${cmd}"). Set PEAKS_TAR_BIN to override, or install tar (Windows: bsdtar is bundled with Windows 10+).`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Non-zero exit from tar itself — re-throw with stderr text.
|
|
80
|
+
const stderr = e?.stderr;
|
|
81
|
+
const stderrText = stderr instanceof Buffer
|
|
82
|
+
? stderr.toString("utf-8")
|
|
83
|
+
: typeof stderr === "string"
|
|
84
|
+
? stderr
|
|
85
|
+
: "";
|
|
86
|
+
const baseMsg = e instanceof Error ? e.message : typeof e === "string" ? e : String(e);
|
|
87
|
+
const wrapped = new Error(`tar exited non-zero (cmd="${cmd}"): ${baseMsg}${stderrText ? `\ntar stderr:\n${stderrText.trimEnd()}` : ""}`);
|
|
88
|
+
wrapped.cause = e;
|
|
89
|
+
throw wrapped;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface BeeReleaseRow {
|
|
2
|
+
id: number;
|
|
3
|
+
bee_name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
source: "user";
|
|
6
|
+
archived_at: string;
|
|
7
|
+
archived_by: "user" | "llm";
|
|
8
|
+
user_intent_raw: string | null;
|
|
9
|
+
description: string | null;
|
|
10
|
+
parent_version: string | null;
|
|
11
|
+
changelog: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface BeeReleasePointerRow {
|
|
14
|
+
bee_name: string;
|
|
15
|
+
latest_version: string;
|
|
16
|
+
released_at: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BeeManifestRow {
|
|
19
|
+
release_id: number;
|
|
20
|
+
schema_version: string;
|
|
21
|
+
description: string;
|
|
22
|
+
segments_json: string;
|
|
23
|
+
entrypoint_preamble: string | null;
|
|
24
|
+
promotion: string;
|
|
25
|
+
min_cycles: number | null;
|
|
26
|
+
requires_human: number;
|
|
27
|
+
requires_smoke: number;
|
|
28
|
+
retire_on_misses: number | null;
|
|
29
|
+
}
|
|
30
|
+
export interface BeeSegmentRefRow {
|
|
31
|
+
id: number;
|
|
32
|
+
release_id: number;
|
|
33
|
+
segment_name: string;
|
|
34
|
+
inputs_json: string | null;
|
|
35
|
+
outputs_json: string | null;
|
|
36
|
+
side_effects: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface BeeFileRow {
|
|
39
|
+
id: number;
|
|
40
|
+
release_id: number;
|
|
41
|
+
owner_kind: "bee" | "segment";
|
|
42
|
+
owner_name: string;
|
|
43
|
+
path: string;
|
|
44
|
+
kind: "markdown" | "script" | "reference" | "binary" | "other";
|
|
45
|
+
size_bytes: number;
|
|
46
|
+
sha256: string;
|
|
47
|
+
blob_path: string;
|
|
48
|
+
}
|
|
49
|
+
export interface BeeChangeRow {
|
|
50
|
+
id: number;
|
|
51
|
+
release_id: number;
|
|
52
|
+
change_kind: string;
|
|
53
|
+
target_kind: string;
|
|
54
|
+
target_name: string;
|
|
55
|
+
detail: string | null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Shape of `manifest.json` inside a release export tarball.
|
|
59
|
+
*
|
|
60
|
+
* Producer: `src/services/skillhub/release-export.ts` writes this file via
|
|
61
|
+
* `JSON.stringify({ bee_name, version, manifestRows, segRows, fileRows, changeRows })`.
|
|
62
|
+
* Consumer: `src/services/skillhub/release-import.ts` parses it back with
|
|
63
|
+
* `JSON.parse(readFileSync(join(stageDir, "manifest.json"), "utf-8"))`.
|
|
64
|
+
*
|
|
65
|
+
* Defining it once here (rather than as an inline anonymous type at the
|
|
66
|
+
* call-site) lets both sides share a structural contract. If a future
|
|
67
|
+
* field is added — e.g. an exported schema-version stamp — it lands in
|
|
68
|
+
* one place and TypeScript flags every consumer that needs updating.
|
|
69
|
+
*/
|
|
70
|
+
export interface ExportPayload {
|
|
71
|
+
bee_name: string;
|
|
72
|
+
version: string;
|
|
73
|
+
manifestRows: Array<{
|
|
74
|
+
schema_version: string;
|
|
75
|
+
description: string;
|
|
76
|
+
segments_json: string;
|
|
77
|
+
entrypoint_preamble: string | null;
|
|
78
|
+
promotion: string;
|
|
79
|
+
min_cycles: number | null;
|
|
80
|
+
requires_human: number;
|
|
81
|
+
requires_smoke: number;
|
|
82
|
+
retire_on_misses: number | null;
|
|
83
|
+
}>;
|
|
84
|
+
segRows: Array<{
|
|
85
|
+
segment_name: string;
|
|
86
|
+
inputs_json: string | null;
|
|
87
|
+
outputs_json: string | null;
|
|
88
|
+
side_effects: string | null;
|
|
89
|
+
}>;
|
|
90
|
+
fileRows: Array<{
|
|
91
|
+
owner_kind: string;
|
|
92
|
+
owner_name: string;
|
|
93
|
+
path: string;
|
|
94
|
+
kind: string;
|
|
95
|
+
size_bytes: number;
|
|
96
|
+
sha256: string;
|
|
97
|
+
blob_path: string;
|
|
98
|
+
}>;
|
|
99
|
+
changeRows: Array<{
|
|
100
|
+
change_kind: string;
|
|
101
|
+
target_kind: string;
|
|
102
|
+
target_name: string;
|
|
103
|
+
detail: string | null;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,10 +28,10 @@ const SKILL_NAMES = [
|
|
|
28
28
|
'peaks-rd',
|
|
29
29
|
'peaks-qa',
|
|
30
30
|
'peaks-sc',
|
|
31
|
-
'peaks-
|
|
32
|
-
'peaks-
|
|
33
|
-
'peaks-
|
|
34
|
-
'peaks-
|
|
31
|
+
'peaks-code',
|
|
32
|
+
'peaks-resume',
|
|
33
|
+
'peaks-status',
|
|
34
|
+
'peaks-test',
|
|
35
35
|
'peaks-sop',
|
|
36
36
|
'peaks-txt',
|
|
37
37
|
'peaks-doctor'
|
|
@@ -85,7 +85,10 @@ export function auditSkillConformance(input) {
|
|
|
85
85
|
const skillsDir = join(input.projectRoot, 'skills');
|
|
86
86
|
const checks = [];
|
|
87
87
|
for (const skillName of SKILL_NAMES) {
|
|
88
|
-
|
|
88
|
+
// LLM-internal skills live under `skills/bee/<name>/` per spec 2026-07-05.
|
|
89
|
+
const topPath = join(skillsDir, skillName, 'SKILL.md');
|
|
90
|
+
const beePath = join(skillsDir, 'bee', skillName, 'SKILL.md');
|
|
91
|
+
const skillPath = existsSync(topPath) ? topPath : beePath;
|
|
89
92
|
const fm = readSkillFrontmatter(skillPath);
|
|
90
93
|
// 1. task-level frontmatter
|
|
91
94
|
if (fm === null) {
|
|
@@ -28,7 +28,7 @@ export type SkillPresence = {
|
|
|
28
28
|
* observability consumer that an outer-session swap was observed
|
|
29
29
|
* on the previous heartbeat. The actual binding rotation is
|
|
30
30
|
* performed by `ensureSessionWithRotation` (slice 018), not by
|
|
31
|
-
* `setSkillPresence`. `peaks-
|
|
31
|
+
* `setSkillPresence`. `peaks-code`'s Step 0 used to read this
|
|
32
32
|
* field and turn it into an AskUserQuestion; that ask is no
|
|
33
33
|
* longer needed because the rotation already happened by the time
|
|
34
34
|
* the skill is invoked.
|
|
@@ -81,12 +81,12 @@ export declare function getSkillPresence(projectRootOverride?: string): SkillPre
|
|
|
81
81
|
* different outer (Claude / harness) session than the one that
|
|
82
82
|
* is now driving peaks. Most common cause: the LLM closed the
|
|
83
83
|
* previous Claude session, the next session boots and finds a
|
|
84
|
-
* presence leftover from the old one. peaks-
|
|
84
|
+
* presence leftover from the old one. peaks-code Step 1 must
|
|
85
85
|
* AskUserQuestion to confirm the user wants the old mode.
|
|
86
86
|
*
|
|
87
87
|
* - `'no-presence'` — there is no presence file on disk.
|
|
88
|
-
* Not strictly "stale", but callers (peaks-
|
|
89
|
-
*
|
|
88
|
+
* Not strictly "stale", but callers (peaks-code Step 1, `peaks
|
|
89
|
+
* code should-pause --step step-1-mode-select`) want to treat
|
|
90
90
|
* this case as "no opinion yet — must ask". Surfaced as
|
|
91
91
|
* `stale: true` with reason `'no-presence'` so the ask path is
|
|
92
92
|
* uniform.
|
|
@@ -130,7 +130,7 @@ export declare function checkStalePresence(opts?: {
|
|
|
130
130
|
* Called from `peaks workspace init` immediately after a successful
|
|
131
131
|
* `outer-session-mismatch` rotation. When the previous session's
|
|
132
132
|
* presence is still on disk under the OLD outer session id,
|
|
133
|
-
* clearing it prevents peaks-
|
|
133
|
+
* clearing it prevents peaks-code Step 1 from picking up a stale
|
|
134
134
|
* `mode` field that the user never explicitly chose.
|
|
135
135
|
*
|
|
136
136
|
* Only clears when:
|
|
@@ -143,7 +143,7 @@ function getBoundOuterSessionId(projectRootOverride) {
|
|
|
143
143
|
* the presence envelope (useful for the statusline to render a stale
|
|
144
144
|
* marker and for the QA / log consumers to know an outer-session swap
|
|
145
145
|
* happened), but it no longer carries the implicit "ask the user"
|
|
146
|
-
* promise — `peaks-
|
|
146
|
+
* promise — `peaks-code`'s Step 0 no longer needs to surface an
|
|
147
147
|
* AskUserQuestion, because the rotation already fired by the time the
|
|
148
148
|
* skill is invoked.
|
|
149
149
|
*
|
|
@@ -377,7 +377,7 @@ export function checkStalePresence(opts) {
|
|
|
377
377
|
* Called from `peaks workspace init` immediately after a successful
|
|
378
378
|
* `outer-session-mismatch` rotation. When the previous session's
|
|
379
379
|
* presence is still on disk under the OLD outer session id,
|
|
380
|
-
* clearing it prevents peaks-
|
|
380
|
+
* clearing it prevents peaks-code Step 1 from picking up a stale
|
|
381
381
|
* `mode` field that the user never explicitly chose.
|
|
382
382
|
*
|
|
383
383
|
* Only clears when:
|
|
@@ -13,6 +13,33 @@ export async function loadSkillRegistry(baseDir = skillsDir) {
|
|
|
13
13
|
const skills = [];
|
|
14
14
|
const failures = [];
|
|
15
15
|
for (const directory of directories) {
|
|
16
|
+
// LLM-internal skills (bees) live under `bee/` per spec 2026-07-05.
|
|
17
|
+
// Recurse one level into `bee/`; treat each child as a separate skill.
|
|
18
|
+
if (directory === 'bee') {
|
|
19
|
+
const subEntries = await listDirectories(join(baseDir, 'bee'));
|
|
20
|
+
for (const subDir of subEntries) {
|
|
21
|
+
const skillPath = join(baseDir, 'bee', subDir, 'SKILL.md');
|
|
22
|
+
if (!(await pathExists(skillPath))) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const frontmatter = parseFrontmatter(await readText(skillPath));
|
|
27
|
+
// `directory` is the on-disk skill folder name; for bees that is the
|
|
28
|
+
// basename of the bee child, NOT `bee/<name>` (keeps the
|
|
29
|
+
// doctor skill-name-matches-directory invariant working).
|
|
30
|
+
skills.push({
|
|
31
|
+
name: frontmatter.name,
|
|
32
|
+
description: frontmatter.description,
|
|
33
|
+
directory: subDir,
|
|
34
|
+
skillPath
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
failures.push({ directory: subDir, skillPath, message: getLoadFailureMessage(error) });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
16
43
|
const skillPath = join(baseDir, directory, 'SKILL.md');
|
|
17
44
|
if (!(await pathExists(skillPath))) {
|
|
18
45
|
continue;
|
|
@@ -36,7 +36,7 @@ function extractRunbookSection(body) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Load the runbook section, falling back to `references/runbook.md` if the
|
|
38
38
|
* SKILL.md only has a pointer section. This supports skills (notably
|
|
39
|
-
* `peaks-
|
|
39
|
+
* `peaks-code`) that extracted their 150-line bash runbook to a sibling
|
|
40
40
|
* reference to keep SKILL.md under the 800-line cap. The CLI
|
|
41
41
|
* `peaks skill runbook` command uses the same fallback so a human
|
|
42
42
|
* reviewer sees the full runbook regardless of where it lives.
|
|
@@ -52,7 +52,7 @@ async function loadRunbookSection(skillPath, body) {
|
|
|
52
52
|
const inline = extractRunbookSection(body);
|
|
53
53
|
const skillDir = dirname(skillPath);
|
|
54
54
|
// Try multiple reference filenames. Convention: each skill may name its
|
|
55
|
-
// runbook file `runbook.md` (the generic name, used by peaks-
|
|
55
|
+
// runbook file `runbook.md` (the generic name, used by peaks-code), or
|
|
56
56
|
// `<role>-runbook.md` (the role-suffixed name, used by peaks-rd → rd-runbook.md,
|
|
57
57
|
// peaks-qa → qa-runbook.md, etc.). Prefer the longest extracted section.
|
|
58
58
|
const refCandidates = [
|
|
@@ -297,7 +297,7 @@ export async function sliceCheck(options) {
|
|
|
297
297
|
description: 'vitest run (skipped per --skip-tests)',
|
|
298
298
|
status: 'skipped',
|
|
299
299
|
durationMs: 0,
|
|
300
|
-
detail: 'Skipped: --skip-tests was set. Use the peaks-
|
|
300
|
+
detail: 'Skipped: --skip-tests was set. Use the peaks-test skill to run the full suite manually.'
|
|
301
301
|
});
|
|
302
302
|
unitTestsRunMode = 'skipped';
|
|
303
303
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type envelope for the `peaks slice check` CLI command.
|
|
3
3
|
*
|
|
4
4
|
* `peaks slice check` is the boundary check for the RD micro-cycle
|
|
5
|
-
* (see `skills/peaks-
|
|
5
|
+
* (see `skills/peaks-code/references/micro-cycle.md`). It bundles the
|
|
6
6
|
* 4 self-checks that must pass at slice end before the slice is handed
|
|
7
7
|
* off to peaks-qa:
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type envelope for the `peaks slice check` CLI command.
|
|
3
3
|
*
|
|
4
4
|
* `peaks slice check` is the boundary check for the RD micro-cycle
|
|
5
|
-
* (see `skills/peaks-
|
|
5
|
+
* (see `skills/peaks-code/references/micro-cycle.md`). It bundles the
|
|
6
6
|
* 4 self-checks that must pass at slice end before the slice is handed
|
|
7
7
|
* off to peaks-qa:
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type envelope for `peaks slice decompose` and its outputs.
|
|
3
3
|
*
|
|
4
4
|
* The slice-decomposition algorithm is a 6-stage deterministic function
|
|
5
|
-
* (see `peaks-
|
|
5
|
+
* (see `peaks-code/references/slice-algorithm.md` for the full spec):
|
|
6
6
|
*
|
|
7
7
|
* 1. workUnitResolution -- codegraph.query + knowledge_graph.grep
|
|
8
8
|
* 2. buildDependencyDAG -- real import edges + codegraph.affected fallback
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type envelope for `peaks slice decompose` and its outputs.
|
|
3
3
|
*
|
|
4
4
|
* The slice-decomposition algorithm is a 6-stage deterministic function
|
|
5
|
-
* (see `peaks-
|
|
5
|
+
* (see `peaks-code/references/slice-algorithm.md` for the full spec):
|
|
6
6
|
*
|
|
7
7
|
* 1. workUnitResolution -- codegraph.query + knowledge_graph.grep
|
|
8
8
|
* 2. buildDependencyDAG -- real import edges + codegraph.affected fallback
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slice 2026-06-16-peaks-
|
|
2
|
+
* Slice 2026-06-16-peaks-code-auto-scaffold (RD#7) — missing-standards-detector.
|
|
3
3
|
*
|
|
4
4
|
* Read-side companion to the `peaks standards init` / `peaks standards update`
|
|
5
5
|
* writers in `./project-standards-service.ts`. The writer KNOWS how to scaffold
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slice 2026-06-16-peaks-
|
|
2
|
+
* Slice 2026-06-16-peaks-code-auto-scaffold (RD#7) — missing-standards-detector.
|
|
3
3
|
*
|
|
4
4
|
* Read-side companion to the `peaks standards init` / `peaks standards update`
|
|
5
5
|
* writers in `./project-standards-service.ts`. The writer KNOWS how to scaffold
|
|
@@ -30,7 +30,7 @@ export type ProjectStandardsSource = {
|
|
|
30
30
|
readonly usage: 'curated-baseline-reference';
|
|
31
31
|
};
|
|
32
32
|
export type StandardsSkillPreflight = {
|
|
33
|
-
readonly appliesTo: readonly ['peaks-rd', 'peaks-qa', 'peaks-
|
|
33
|
+
readonly appliesTo: readonly ['peaks-rd', 'peaks-qa', 'peaks-code'];
|
|
34
34
|
readonly summary: string;
|
|
35
35
|
};
|
|
36
36
|
export type ProjectStandardsInitPlan = {
|
|
@@ -23,8 +23,8 @@ const SOURCE = {
|
|
|
23
23
|
usage: 'curated-baseline-reference'
|
|
24
24
|
};
|
|
25
25
|
const SKILL_PREFLIGHT = {
|
|
26
|
-
appliesTo: ['peaks-rd', 'peaks-qa', 'peaks-
|
|
27
|
-
summary: 'peaks-rd、peaks-qa、peaks-
|
|
26
|
+
appliesTo: ['peaks-rd', 'peaks-qa', 'peaks-code'],
|
|
27
|
+
summary: 'peaks-rd、peaks-qa、peaks-code 进入代码仓工作流时自动 preflight 项目规范。'
|
|
28
28
|
};
|
|
29
29
|
const SUPPORTED_LANGUAGES = new Set(['generic', 'typescript', 'javascript', 'python', 'go', 'rust']);
|
|
30
30
|
function normalizeRoot(path) {
|
|
@@ -104,7 +104,7 @@ function renderHeader(title) {
|
|
|
104
104
|
`# ${title}`,
|
|
105
105
|
'',
|
|
106
106
|
'Source: Peaks curated baseline; everything-claude-code reference: https://github.com/affaan-m/everything-claude-code',
|
|
107
|
-
'Scope: project-local standards for peaks-rd, peaks-qa, and peaks-
|
|
107
|
+
'Scope: project-local standards for peaks-rd, peaks-qa, and peaks-code workflow preflight.',
|
|
108
108
|
''
|
|
109
109
|
].join('\n');
|
|
110
110
|
}
|
|
@@ -151,7 +151,7 @@ function renderClaudeMd(language, ctx) {
|
|
|
151
151
|
'Peaks workflow automation:',
|
|
152
152
|
'- peaks-rd checks these standards before RD planning or implementation work.',
|
|
153
153
|
'- peaks-qa checks code review and security guidance before verification work.',
|
|
154
|
-
'- peaks-
|
|
154
|
+
'- peaks-code summarizes RD and QA standards preflight before end-to-end code workflows.',
|
|
155
155
|
'',
|
|
156
156
|
'Rules:',
|
|
157
157
|
'- Read `.claude/rules/common/coding-style.md` before editing code.',
|
|
@@ -33,7 +33,7 @@ export type UnderstandScanReport = {
|
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Slice L3.1 — opt-in prompt payload. When uaPrompt === 'unset' and UA is
|
|
36
|
-
* absent, the peaks-
|
|
36
|
+
* absent, the peaks-code / peaks-ide layer surfaces this to the user via
|
|
37
37
|
* AskUserQuestion. The CLI does not prompt directly; it returns this
|
|
38
38
|
* payload so the LLM-side UX layer can decide.
|
|
39
39
|
*/
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* 1.x → 2.0 detection service — TypeScript mirror of
|
|
3
3
|
* `scripts/install-skills.mjs:detect1xProjectState`.
|
|
4
4
|
*
|
|
5
|
-
* Slice: 2026-06-12-
|
|
5
|
+
* Slice: 2026-06-12-code-step-0-55-1x-detection.
|
|
6
6
|
*
|
|
7
7
|
* The canonical implementation lives in the .mjs postinstall
|
|
8
8
|
* (because the postinstall runs before any TS compile step).
|
|
9
|
-
* This TS mirror exists so the peaks-
|
|
9
|
+
* This TS mirror exists so the peaks-code skill can call
|
|
10
10
|
* `peaks upgrade --detect-1x --project <root> --json` and
|
|
11
11
|
* read a structured JSON envelope to gate the
|
|
12
12
|
* AskUserQuestion that prompts the 1.x → 2.0 upgrade.
|