@punks/cli 5.2.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/README.md +34 -128
- package/dist/index.js +77 -1196
- package/package.json +8 -10
- package/dist/BASELINE_CHANGELOG.md +0 -1330
- package/dist/CHANGELOG.md +0 -1432
- package/dist/baseline/scaffold-baseline/baseline.json +0 -585
- package/dist/baseline/scaffold-baseline/data/catalog/hooks.json +0 -16
- package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +0 -353
- package/dist/baseline/scaffold-baseline/data/catalog/packs.json +0 -466
- package/dist/baseline/scaffold-baseline/data/catalog/skill-id-aliases.json +0 -14
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +0 -914
- package/dist/baseline/scaffold-baseline/data/catalog/tools.json +0 -62
- package/dist/baseline/scaffold-baseline/data/hooks/format-edited-file.mjs +0 -1814
- package/dist/baseline/scaffold-baseline/data/hooks/scaffold-update-check.mjs +0 -234
- package/dist/baseline/scaffold-baseline/data/lint/anti-slop/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/data/lint/anti-slop/index.mjs +0 -1729
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.d.ts +0 -13
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +0 -267
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +0 -789
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.d.mts +0 -3
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.mjs +0 -125
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.d.mts +0 -3
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.mjs +0 -138
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.d.mts +0 -5
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.mjs +0 -107
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.d.mts +0 -5
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.mjs +0 -86
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/apply.d.mts +0 -12
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/apply.mjs +0 -96
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.d.mts +0 -23
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.mjs +0 -84
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.test.ts +0 -79
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.ts +0 -197
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.d.mts +0 -8
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.mjs +0 -243
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.test.ts +0 -61
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/lint-feedback.test.ts +0 -155
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/application-context-plan.json +0 -27
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/actions.json +0 -110
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/context-plan.json +0 -150
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/matrix.json +0 -23
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/traces.json +0 -15
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/actions.json +0 -125
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/context-plan.json +0 -150
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/matrix.json +0 -23
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/traces.json +0 -15
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/compiler-input.json +0 -93
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/context-plan.json +0 -108
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/matrix.json +0 -19
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/projection.json +0 -55
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/mixed-context-plan.json +0 -35
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/compiler-input.json +0 -93
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/context-plan.json +0 -108
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/matrix.json +0 -19
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/projection.json +0 -37
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.d.mts +0 -55
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.mjs +0 -329
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.test.ts +0 -864
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.d.mts +0 -97
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.mjs +0 -658
- package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.test.ts +0 -614
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents-validator.test.ts +0 -98
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.d.mts +0 -1
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.mjs +0 -3298
- package/dist/baseline/scaffold-baseline/data/shared-agents.md +0 -55
- package/dist/baseline/scaffold-baseline/data/subagents/manifest.mjs +0 -495
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/SKILL.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/references/layout.md +0 -238
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/SKILL.md +0 -49
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/references/strategy-matrix.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/references/test-matrix.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/SKILL.md +0 -133
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/context.md +0 -157
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/pitfalls.md +0 -118
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/structure.md +0 -195
- package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/wide-events.md +0 -113
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/SKILL.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +0 -78
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/managed-lint.md +0 -165
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +0 -162
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/wiki-structure.md +0 -16
- package/dist/baseline/scaffold-baseline/skills/agnostic/debug/debug-agent/SKILL.md +0 -184
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +0 -81
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/SKILL.md +0 -18
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/references/migration.md +0 -10
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +0 -110
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/AUTHORING-HANDOFF.md +0 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/SKILL.md +0 -84
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/audit.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/define-authority.md +0 -26
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/qualify.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/router.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/verify-disclosure.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +0 -226
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-beats/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-beats/SKILL.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-beats/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/SKILL.md +0 -81
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-for-agents/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-fragments/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-fragments/SKILL.md +0 -76
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-fragments/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -63
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-shape/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-shape/SKILL.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-shape/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/.clawdhub/origin.json +0 -7
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/SKILL.md +0 -229
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/authentication.md +0 -205
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/commands.md +0 -259
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/proxy-support.md +0 -188
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/session-management.md +0 -194
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/snapshot-refs.md +0 -196
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/video-recording.md +0 -173
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/authenticated-session.sh +0 -97
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/capture-workflow.sh +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/form-automation.sh +0 -62
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/RECIPES.md +0 -333
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/SKILL.md +0 -203
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/design-taste-frontend/SKILL.md +0 -1304
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +0 -42
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +0 -134
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/gpt-taste/SKILL.md +0 -89
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/imagegen-frontend-mobile/SKILL.md +0 -1607
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/imagegen-frontend-web/SKILL.md +0 -1130
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/improve-mobile-frontend/SKILL.md +0 -109
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/improve-mobile-frontend/UPSTREAM.md +0 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/redesign-existing-projects/SKILL.md +0 -182
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/SKILL.md +0 -112
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/STANDARDS.md +0 -229
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handoff/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handoff/SKILL.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handoff/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/SKILL.md +0 -65
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +0 -119
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/references/artifact-contract.md +0 -200
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +0 -44
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +0 -153
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +0 -114
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/backlog-sync.md +0 -63
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/grill-ambiguity.md +0 -66
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +0 -232
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +0 -80
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/stop-conditions.md +0 -19
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/tdd-shaping.md +0 -49
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +0 -87
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +0 -72
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/folder-naming.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +0 -86
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +0 -83
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +0 -51
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-verification-skill/SKILL.md +0 -66
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-verification-skill/references/upstream.md +0 -20
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +0 -105
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -116
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +0 -108
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +0 -338
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +0 -102
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +0 -121
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +0 -19
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/runtime-product-validation.md +0 -77
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/ui-screenshot-evidence.md +0 -61
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/swarm-planner/SKILL.md +0 -210
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/update-verification-skill/SKILL.md +0 -81
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/SKILL.md +0 -120
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/wayfinder/SKILL.md +0 -22
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +0 -218
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/autoreview +0 -1276
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/test-review-harness +0 -176
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/DEEPENING.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/DESIGN-IT-TWICE.md +0 -43
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/SKILL.md +0 -60
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/SKILL.md +0 -57
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/audit-portfolio.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/implement-suite.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/route-api-design.md +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/user-journey-design.md +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/review/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/review/SKILL.md +0 -94
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/review/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/simplify/SKILL.md +0 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +0 -140
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/deep-modules.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/high-signal-tests.md +0 -53
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/interface-design.md +0 -31
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/mocking.md +0 -60
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/refactoring.md +0 -10
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/tests.md +0 -61
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/SKILL.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/acceptance.md +0 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/azure.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/bitbucket.md +0 -8
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/github.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/gitlab.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/ADR-FORMAT.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/GLOSSARY-FORMAT.md +0 -60
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/SKILL.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/agents/openai.yaml +0 -3
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/grilling/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/grilling/SKILL.md +0 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/grilling/UPSTREAM.md +0 -16
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +0 -55
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +0 -212
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/wiki-output.md +0 -107
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +0 -57
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +0 -78
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +0 -109
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +0 -57
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +0 -121
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +0 -171
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +0 -297
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +0 -155
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +0 -236
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/backlog-initialization.md +0 -88
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/business-projection.md +0 -26
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/delivery-status.md +0 -70
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/fog-intake.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/functional-projection.md +0 -22
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/issue-reconciliation.md +0 -76
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/normalization.md +0 -105
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/project-context.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/github.md +0 -123
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/linear.md +0 -120
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/technical-projection.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +0 -151
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/REFERENCE.md +0 -78
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/SKILL.md +0 -85
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/SKILL.md +0 -81
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/LOGIC.md +0 -67
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/SKILL.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/UI.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/SKILL.md +0 -97
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/security-by-design.md +0 -22
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/SKILL.md +0 -65
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/argo-workflows.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/azure-pipelines.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/bitbucket-pipelines.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/buildkite.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/circleci.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/github-actions.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/gitlab-cicd.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/jenkins.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/tekton.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/LICENSE.txt +0 -201
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/SKILL.md +0 -86
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/golang-general-backend-security.md +0 -988
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-express-web-server-security.md +0 -1175
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-general-web-frontend-security.md +0 -753
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-jquery-web-frontend-security.md +0 -695
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +0 -1164
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +0 -1023
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +0 -801
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-django-web-server-security.md +0 -898
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-fastapi-web-server-security.md +0 -1048
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-flask-web-server-security.md +0 -835
- package/dist/baseline/scaffold-baseline/skills/agnostic/subagents/swarm-planner/SKILL.md +0 -210
- package/dist/baseline/scaffold-baseline/skills/frameworks/better-auth/better-auth-best-practices/SKILL.md +0 -174
- package/dist/baseline/scaffold-baseline/skills/frameworks/better-auth/better-auth-security-best-practices/SKILL.MD +0 -432
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/SKILL.md +0 -93
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/CACHING.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/CONFIG.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/EFFECT_ATOM.md +0 -257
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/HTTP_CLIENTS.md +0 -101
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/OBSERVABILITY.md +0 -89
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SCHEDULING.md +0 -131
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SCHEMA.md +0 -130
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +0 -100
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/STREAMS.md +0 -135
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/TESTING.md +0 -46
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md +0 -89
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/references/layout.md +0 -130
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/SKILL.md +0 -65
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/flow-examples.md +0 -154
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/source-backed-primitives.md +0 -104
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/strategy-matrix.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/test-matrix.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/SKILL.md +0 -120
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +0 -17
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/references/AUDIT.md +0 -98
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/SKILL.md +0 -515
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/basic.ts +0 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/body-parser.ts +0 -33
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/complex.ts +0 -111
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/cookie.ts +0 -45
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/error.ts +0 -38
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/file.ts +0 -8
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/guard.ts +0 -34
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/map-response.ts +0 -14
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/redirect.ts +0 -6
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/rename.ts +0 -27
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/schema.ts +0 -61
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/state.ts +0 -6
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/upload-file.ts +0 -16
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/websocket.ts +0 -25
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/ai-sdk.md +0 -103
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/astro.md +0 -67
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/better-auth.md +0 -128
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/cloudflare-worker.md +0 -111
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/deno.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/drizzle.md +0 -259
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/expo.md +0 -104
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nextjs.md +0 -110
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nodejs.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nuxt.md +0 -76
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/prisma.md +0 -102
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/react-email.md +0 -140
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/sveltekit.md +0 -57
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/tanstack-start.md +0 -100
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/vercel.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/patterns/mvc.md +0 -398
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/bearer.md +0 -31
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/cors.md +0 -147
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/cron.md +0 -274
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/graphql-apollo.md +0 -91
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/graphql-yoga.md +0 -89
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/html.md +0 -194
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/jwt.md +0 -227
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/openapi.md +0 -270
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/opentelemetry.md +0 -190
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/server-timing.md +0 -80
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/static.md +0 -97
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/bun-fullstack-dev-server.md +0 -146
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/cookie.md +0 -220
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/deployment.md +0 -427
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/eden.md +0 -178
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/lifecycle.md +0 -189
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/macro.md +0 -97
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/plugin.md +0 -203
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/route.md +0 -329
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/testing.md +0 -389
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/validation.md +0 -549
- package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/websocket.md +0 -244
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/SKILL.md +0 -277
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/references/native-module.md +0 -96
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/RECIPES.md +0 -435
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/SKILL.md +0 -255
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/SKILL.md +0 -363
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/animations.md +0 -189
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/controls.md +0 -245
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/form-sheet.md +0 -251
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/gradients.md +0 -116
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/icons.md +0 -218
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/media.md +0 -223
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/route-structure.md +0 -229
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/search.md +0 -237
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/storage.md +0 -110
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/tabs.md +0 -417
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/toolbar-and-headers.md +0 -267
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/visual-effects.md +0 -193
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/webgpu-three.md +0 -589
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/zoom-transitions.md +0 -161
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/SKILL.md +0 -158
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/controllers.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/run-your-app.md +0 -186
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/troubleshooting.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/SKILL.md +0 -228
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/references/channel-insights-schema.md +0 -53
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +0 -69
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-api-routes/SKILL.md +0 -365
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-api-routes/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/SKILL.md +0 -54
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/brownfield-integrated.md +0 -526
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/brownfield-isolated.md +0 -402
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/comparison.md +0 -63
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/troubleshooting.md +0 -88
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/SKILL.md +0 -92
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/fetch.js +0 -109
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/package.json +0 -11
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/validate.js +0 -84
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/SKILL.md +0 -167
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/app-store-metadata.md +0 -495
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/ios-app-store.md +0 -373
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/play-store.md +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/testflight.md +0 -59
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/workflows.md +0 -160
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-dev-client/SKILL.md +0 -172
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-dev-client/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-examples/SKILL.md +0 -97
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-examples/references/catalog.md +0 -118
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/SKILL.md +0 -141
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/config-plugin.md +0 -85
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/create-expo-module.md +0 -206
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/lifecycle.md +0 -128
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/module-config.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/native-module.md +0 -286
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/native-view.md +0 -171
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/SKILL.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/metrics.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/queries.md +0 -362
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/setup.md +0 -255
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/SKILL.md +0 -315
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/agents/visual-grader.md +0 -52
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/references/design-rubric.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/references/runtime-matrix.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/check-static.sh +0 -64
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/clean-fixture.sh +0 -56
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/generate_viewer.py +0 -450
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/latest-sdk.sh +0 -46
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/make-fixture.sh +0 -95
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/make-workspace.sh +0 -31
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-android.sh +0 -284
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-ios.sh +0 -132
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-web.sh +0 -61
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-tailwind-setup/SKILL.md +0 -456
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-tailwind-setup/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/SKILL.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/drop-in-replacements.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/jetpack-compose.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/swift-ui.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/universal.md +0 -76
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/scripts/list-components.js +0 -213
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/SKILL.md +0 -501
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/references/expo-router-loaders.md +0 -344
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/SKILL.md +0 -135
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/expo-av-to-audio.md +0 -144
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/expo-av-to-video.md +0 -156
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/native-tabs.md +0 -111
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/new-architecture.md +0 -79
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-19.md +0 -79
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-compiler.md +0 -59
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-navigation-to-expo-router.md +0 -61
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/use-dom/SKILL.md +0 -378
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/use-dom/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/SKILL.md +0 -83
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/false-friends.md +0 -119
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/native-patterns.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/run-as-goal.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/verify-on-device.md +0 -47
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/branch-protection.yml +0 -24
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/deploy.yml +0 -61
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/AGENTS.md +0 -5898
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/SKILL.md +0 -131
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-dto-serialization.md +0 -182
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-interceptors.md +0 -202
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-pipes.md +0 -205
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-versioning.md +0 -191
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-avoid-circular-deps.md +0 -80
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-feature-modules.md +0 -82
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-module-sharing.md +0 -141
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-single-responsibility.md +0 -106
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-events.md +0 -108
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-repository-pattern.md +0 -93
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-avoid-n-plus-one.md +0 -139
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-migrations.md +0 -129
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-transactions.md +0 -122
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-graceful-shutdown.md +0 -218
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-config-module.md +0 -165
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-logging.md +0 -229
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-avoid-service-locator.md +0 -104
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-interface-segregation.md +0 -165
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-liskov-substitution.md +0 -217
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-prefer-constructor-injection.md +0 -86
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-scope-awareness.md +0 -94
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-use-interfaces-tokens.md +0 -99
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-handle-async-errors.md +0 -125
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-throw-http-exceptions.md +0 -114
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-use-exception-filters.md +0 -133
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-health-checks.md +0 -226
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-patterns.md +0 -167
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-queues.md +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-async-hooks.md +0 -109
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-lazy-loading.md +0 -121
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-optimize-database.md +0 -131
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-use-caching.md +0 -126
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-auth-jwt.md +0 -146
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-rate-limiting.md +0 -125
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-sanitize-output.md +0 -139
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-use-guards.md +0 -135
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-validate-all-input.md +0 -150
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-e2e-supertest.md +0 -174
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-mock-external-services.md +0 -174
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-use-testing-module.md +0 -153
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/build-agents.ts +0 -298
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/build.sh +0 -16
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/package-lock.json +0 -237
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/package.json +0 -15
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/SKILL.md +0 -208
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/authentication.md +0 -166
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/controllers-routing.md +0 -114
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/dtos-validation.md +0 -165
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/migration-from-express.md +0 -1227
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/services-di.md +0 -140
- package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/testing-patterns.md +0 -186
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/SKILL.md +0 -171
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/async-patterns.md +0 -84
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/bundling.md +0 -182
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/data-patterns.md +0 -300
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/debug-tricks.md +0 -122
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/directives.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/error-handling.md +0 -228
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/file-conventions.md +0 -141
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/font.md +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/functions.md +0 -108
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/hydration-error.md +0 -86
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/image.md +0 -173
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/metadata.md +0 -292
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/parallel-routes.md +0 -286
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/route-handlers.md +0 -143
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/rsc-boundaries.md +0 -160
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/runtime-selection.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/scripts.md +0 -137
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/self-hosting.md +0 -375
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/suspense-boundaries.md +0 -67
- package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-cache-components/SKILL.md +0 -363
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/SKILL.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/use_cases.yaml +0 -15
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/SKILL.md +0 -337
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/references/diagnostic-toolbox.md +0 -131
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/use_cases.yaml +0 -28
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/SKILL.md +0 -320
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/use_cases.yaml +0 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +0 -489
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/use_cases.yaml +0 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/SKILL.md +0 -834
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/use_cases.yaml +0 -19
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/SKILL.md +0 -281
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/use_cases.yaml +0 -30
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-overview/SKILL.md +0 -289
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-overview/use_cases.yaml +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/async-react-patterns/SKILL.md +0 -78
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/SKILL.md +0 -79
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/references/explain.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/AGENTS.md +0 -917
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/SKILL.md +0 -88
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +0 -94
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/architecture-compound-components.md +0 -108
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/patterns-children-over-render-props.md +0 -84
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/patterns-explicit-variants.md +0 -94
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/react19-no-forwardref.md +0 -42
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-context-interface.md +0 -191
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-decouple-implementation.md +0 -103
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-lift-state.md +0 -125
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/AGENTS.md +0 -3663
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/SKILL.md +0 -150
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-effect-event-deps.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-api-routes.md +0 -35
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-defer-await.md +0 -82
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-dependencies.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-parallel.md +0 -24
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -60
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-conditional.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -34
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-preload.md +0 -44
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-event-listeners.md +0 -78
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -110
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-storage.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -51
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-length-check-first.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-request-idle-callback.md +0 -104
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -32
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -72
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -26
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -77
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -56
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -75
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-no-shared-module-state.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +0 -199
- package/dist/baseline/scaffold-baseline/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +0 -31
- package/dist/baseline/scaffold-baseline/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/.claude-plugin/plugin.json +0 -12
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +0 -846
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/assets/example-template.txt +0 -14
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/best-practices.md +0 -310
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/common-patterns.md +0 -269
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/example-reference.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/testing.md +0 -264
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/top-errors.md +0 -352
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/typescript-patterns.md +0 -275
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/v4-to-v5-migration.md +0 -244
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/rules/tanstack-query.md +0 -126
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/scripts/example-script.sh +0 -15
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/devtools-setup.tsx +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/error-boundary.tsx +0 -243
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/package.json +0 -31
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/provider-setup.tsx +0 -46
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/query-client-config.ts +0 -72
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-infinite-query.tsx +0 -193
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-basic.tsx +0 -189
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-optimistic.tsx +0 -220
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-query-basic.tsx +0 -117
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +0 -247
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/.claude-plugin/plugin.json +0 -12
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/SKILL.md +0 -1160
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/assets/example-template.txt +0 -14
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/best-practices.md +0 -310
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/common-patterns.md +0 -269
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/example-reference.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/testing.md +0 -264
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/top-errors.md +0 -352
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/typescript-patterns.md +0 -275
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/v4-to-v5-migration.md +0 -244
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/rules/tanstack-query.md +0 -126
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/scripts/example-script.sh +0 -15
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/devtools-setup.tsx +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/error-boundary.tsx +0 -243
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/package.json +0 -31
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/provider-setup.tsx +0 -46
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/query-client-config.ts +0 -72
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-infinite-query.tsx +0 -193
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-mutation-basic.tsx +0 -189
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-mutation-optimistic.tsx +0 -220
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-query-basic.tsx +0 -117
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/SKILL.md +0 -914
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/command/turborepo.md +0 -70
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/RULE.md +0 -241
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/dependencies.md +0 -246
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/packages.md +0 -335
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/structure.md +0 -270
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/boundaries/RULE.md +0 -126
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/RULE.md +0 -107
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/gotchas.md +0 -169
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/remote-cache.md +0 -127
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/RULE.md +0 -79
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/github-actions.md +0 -162
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/patterns.md +0 -145
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/vercel.md +0 -103
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/cli/RULE.md +0 -100
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/cli/commands.md +0 -297
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/RULE.md +0 -211
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/global-options.md +0 -187
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/gotchas.md +0 -348
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/tasks.md +0 -281
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/RULE.md +0 -96
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/gotchas.md +0 -141
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/modes.md +0 -101
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/filtering/RULE.md +0 -148
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/filtering/patterns.md +0 -152
- package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/watch/RULE.md +0 -99
- package/dist/baseline/scaffold-baseline/skills/languages/python/async-python-patterns/SKILL.md +0 -735
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-backend-structure/SKILL.md +0 -91
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-backend-structure/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-code-style/SKILL.md +0 -363
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-design-patterns/SKILL.md +0 -457
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-project-structure/SKILL.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-testing-patterns/SKILL.md +0 -622
- package/dist/baseline/scaffold-baseline/skills/languages/python/python-testing-patterns/references/advanced-patterns.md +0 -411
- package/dist/baseline/scaffold-baseline/skills/languages/typescript/quality-types/SKILL.md +0 -91
- package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/SKILL.md +0 -54
- package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/command-reference.md +0 -107
- package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/safety-and-errors.md +0 -54
- package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/workflows.md +0 -106
- package/dist/baseline/scaffold-baseline/skills/misc/show-me/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/misc/show-me/SKILL.md +0 -94
- package/dist/baseline/scaffold-baseline/skills/misc/show-me/UPSTREAM.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/misc/timesheet/SKILL.md +0 -87
- package/dist/baseline/scaffold-baseline/skills/misc/timesheet/scripts/git-timesheet-evidence.mjs +0 -231
- package/dist/baseline/scaffold-baseline/skills/misc/wait-what/LICENSE +0 -21
- package/dist/baseline/scaffold-baseline/skills/misc/wait-what/SKILL.md +0 -12
- package/dist/baseline/scaffold-baseline/skills/misc/wait-what/UPSTREAM.md +0 -9
- package/dist/baseline/scaffold-baseline/skills/phases/bug-discovery-phase/REFERENCE.md +0 -193
- package/dist/baseline/scaffold-baseline/skills/phases/bug-discovery-phase/SKILL.md +0 -46
- package/dist/baseline/scaffold-baseline/skills/phases/bug-discovery-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/REFERENCE.md +0 -183
- package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/SKILL.md +0 -50
- package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/business-finder/SKILL.md +0 -43
- package/dist/baseline/scaffold-baseline/skills/phases/business-finder/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/debugging-phase/SKILL.md +0 -97
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +0 -65
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/backlog.md +0 -42
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/closeout.md +0 -52
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/debug.md +0 -43
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/docs-ingest.md +0 -31
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/human-steering.md +0 -25
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +0 -70
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +0 -122
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +0 -54
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +0 -23
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +0 -120
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/context-continuity.md +0 -109
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/failure-continuity.md +0 -27
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +0 -112
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/SKILL.md +0 -48
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/approval.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/backlog.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/delivery-handoff.md +0 -29
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/grill.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/intake.md +0 -25
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/prototype.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/router.md +0 -66
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/SKILL.md +0 -54
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/agents/openai.yaml +0 -4
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/private-internal.md +0 -59
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/public-docs.md +0 -52
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/router.md +0 -42
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/concept-pages.md +0 -70
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/flow-pages.md +0 -56
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/learning-artifacts.md +0 -103
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/public-docs.md +0 -90
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/repo-docs.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/wiki-ingest.md +0 -138
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/AUTHORING-HANDOFF.md +0 -66
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +0 -44
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/ensure-fog.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/grilling.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/human-steering.md +0 -25
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/prototype.md +0 -32
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/reconcile.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/research.md +0 -33
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/return-target.md +0 -31
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/router.md +0 -30
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/entrypoint-contract.md +0 -37
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/root-routing.md +0 -14
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/runtime-handoff.md +0 -40
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/state-graph.md +0 -38
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/scripts/finder-contract.mjs +0 -64
- package/dist/baseline/scaffold-baseline/skills/phases/functional-finder/SKILL.md +0 -45
- package/dist/baseline/scaffold-baseline/skills/phases/functional-finder/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/goalify/EXAMPLES.md +0 -11
- package/dist/baseline/scaffold-baseline/skills/phases/goalify/SKILL.md +0 -32
- package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/SKILL.md +0 -36
- package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/VERDICT-TEMPLATE.md +0 -16
- package/dist/baseline/scaffold-baseline/skills/phases/prototype-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +0 -79
- package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/resolve-debt-phase/SKILL.md +0 -89
- package/dist/baseline/scaffold-baseline/skills/phases/resolve-debt-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +0 -625
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/SKILL.md +0 -25
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/agents/openai.yaml +0 -2
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +0 -146
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +0 -129
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +0 -99
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/router.md +0 -80
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +0 -139
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +0 -205
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/review-packet.md +0 -72
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/runtime-handoff.md +0 -141
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +0 -95
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +0 -157
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +0 -1077
- package/dist/baseline/scaffold-baseline.json +0 -12
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/AGENTS.md +0 -27
- package/dist/data/hooks/format-edited-file.d.mts +0 -26
- package/dist/data/hooks/format-edited-file.mjs +0 -1611
- package/dist/data/hooks/format-edited-file.sh +0 -37
- package/dist/data/hooks/require-tests-for-pr.mjs +0 -206
- package/dist/data/hooks/scaffold-update-check.mjs +0 -234
- package/dist/data/lint/anti-slop/LICENSE +0 -21
- package/dist/data/lint/anti-slop/index.mjs +0 -1729
- package/dist/data/scripts/commit-gate-runner.mjs +0 -267
- package/dist/data/scripts/harness-projection/adapters/claude.d.mts +0 -3
- package/dist/data/scripts/harness-projection/adapters/claude.mjs +0 -125
- package/dist/data/scripts/harness-projection/adapters/codex.d.mts +0 -3
- package/dist/data/scripts/harness-projection/adapters/codex.mjs +0 -138
- package/dist/data/scripts/harness-projection/adapters/cursor.d.mts +0 -5
- package/dist/data/scripts/harness-projection/adapters/cursor.mjs +0 -107
- package/dist/data/scripts/harness-projection/adapters/opencode.d.mts +0 -5
- package/dist/data/scripts/harness-projection/adapters/opencode.mjs +0 -86
- package/dist/data/scripts/harness-projection/apply.d.mts +0 -12
- package/dist/data/scripts/harness-projection/apply.mjs +0 -96
- package/dist/data/scripts/harness-projection/authoring.d.mts +0 -23
- package/dist/data/scripts/harness-projection/authoring.mjs +0 -84
- package/dist/data/scripts/harness-projection/core.d.mts +0 -8
- package/dist/data/scripts/harness-projection/core.mjs +0 -243
- package/dist/data/scripts/harness-projection/test-fixtures/application-context-plan.json +0 -27
- package/dist/data/scripts/harness-projection/test-fixtures/claude/actions.json +0 -110
- package/dist/data/scripts/harness-projection/test-fixtures/claude/context-plan.json +0 -150
- package/dist/data/scripts/harness-projection/test-fixtures/claude/matrix.json +0 -23
- package/dist/data/scripts/harness-projection/test-fixtures/claude/traces.json +0 -15
- package/dist/data/scripts/harness-projection/test-fixtures/codex/actions.json +0 -125
- package/dist/data/scripts/harness-projection/test-fixtures/codex/context-plan.json +0 -150
- package/dist/data/scripts/harness-projection/test-fixtures/codex/matrix.json +0 -23
- package/dist/data/scripts/harness-projection/test-fixtures/codex/traces.json +0 -15
- package/dist/data/scripts/harness-projection/test-fixtures/cursor/compiler-input.json +0 -93
- package/dist/data/scripts/harness-projection/test-fixtures/cursor/context-plan.json +0 -108
- package/dist/data/scripts/harness-projection/test-fixtures/cursor/matrix.json +0 -19
- package/dist/data/scripts/harness-projection/test-fixtures/cursor/projection.json +0 -55
- package/dist/data/scripts/harness-projection/test-fixtures/mixed-context-plan.json +0 -35
- package/dist/data/scripts/harness-projection/test-fixtures/opencode/compiler-input.json +0 -93
- package/dist/data/scripts/harness-projection/test-fixtures/opencode/context-plan.json +0 -108
- package/dist/data/scripts/harness-projection/test-fixtures/opencode/matrix.json +0 -19
- package/dist/data/scripts/harness-projection/test-fixtures/opencode/projection.json +0 -37
- package/dist/data/scripts/managed-lint-runner.d.mts +0 -55
- package/dist/data/scripts/managed-lint-runner.mjs +0 -329
- package/dist/data/scripts/managed-lint.d.mts +0 -97
- package/dist/data/scripts/managed-lint.mjs +0 -658
- package/dist/data/scripts/sync-subagents.d.mts +0 -1
- package/dist/data/scripts/sync-subagents.mjs +0 -3265
- package/dist/data/shared-agents.md +0 -55
- package/dist/data/subagents/manifest.mjs +0 -495
- package/dist/skills/agnostic/backend/backend-domain-structure/SKILL.md +0 -69
- package/dist/skills/agnostic/backend/backend-domain-structure/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/backend/backend-domain-structure/references/layout.md +0 -238
- package/dist/skills/agnostic/backend/backend-recoverable-actions/SKILL.md +0 -49
- package/dist/skills/agnostic/backend/backend-recoverable-actions/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/backend/backend-recoverable-actions/references/strategy-matrix.md +0 -34
- package/dist/skills/agnostic/backend/backend-recoverable-actions/references/test-matrix.md +0 -34
- package/dist/skills/agnostic/backend/logging-best-practices/SKILL.md +0 -127
- package/dist/skills/agnostic/backend/logging-best-practices/rules/context.md +0 -157
- package/dist/skills/agnostic/backend/logging-best-practices/rules/pitfalls.md +0 -118
- package/dist/skills/agnostic/backend/logging-best-practices/rules/structure.md +0 -193
- package/dist/skills/agnostic/backend/logging-best-practices/rules/wide-events.md +0 -113
- package/dist/skills/agnostic/cli/hi-cli/SKILL.md +0 -39
- package/dist/skills/agnostic/cli/hi-cli/references/commands.md +0 -78
- package/dist/skills/agnostic/cli/hi-cli/references/managed-lint.md +0 -165
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +0 -162
- package/dist/skills/agnostic/cli/hi-cli/references/wiki-structure.md +0 -16
- package/dist/skills/agnostic/debug/debug-agent/SKILL.md +0 -184
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +0 -68
- package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +0 -81
- package/dist/skills/agnostic/docs/rule-authoring/SKILL.md +0 -18
- package/dist/skills/agnostic/docs/rule-authoring/references/migration.md +0 -10
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +0 -110
- package/dist/skills/agnostic/docs/write-graph-based-skills/AUTHORING-HANDOFF.md +0 -12
- package/dist/skills/agnostic/docs/write-graph-based-skills/SKILL.md +0 -84
- package/dist/skills/agnostic/docs/write-graph-based-skills/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/audit.md +0 -33
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/define-authority.md +0 -26
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +0 -34
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +0 -30
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/qualify.md +0 -27
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/router.md +0 -36
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +0 -33
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/verify-disclosure.md +0 -28
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +0 -33
- package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +0 -30
- package/dist/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +0 -211
- package/dist/skills/agnostic/docs/writing-beats/LICENSE +0 -21
- package/dist/skills/agnostic/docs/writing-beats/SKILL.md +0 -69
- package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/docs/writing-for-agents/LICENSE +0 -21
- package/dist/skills/agnostic/docs/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/dist/skills/agnostic/docs/writing-for-agents/SKILL.md +0 -81
- package/dist/skills/agnostic/docs/writing-for-agents/UPSTREAM.md +0 -9
- package/dist/skills/agnostic/docs/writing-fragments/LICENSE +0 -21
- package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +0 -76
- package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
- package/dist/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -63
- package/dist/skills/agnostic/docs/writing-shape/LICENSE +0 -21
- package/dist/skills/agnostic/docs/writing-shape/SKILL.md +0 -75
- package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/frontend/agent-browser/.clawdhub/origin.json +0 -7
- package/dist/skills/agnostic/frontend/agent-browser/SKILL.md +0 -229
- package/dist/skills/agnostic/frontend/agent-browser/references/authentication.md +0 -202
- package/dist/skills/agnostic/frontend/agent-browser/references/commands.md +0 -259
- package/dist/skills/agnostic/frontend/agent-browser/references/proxy-support.md +0 -188
- package/dist/skills/agnostic/frontend/agent-browser/references/session-management.md +0 -193
- package/dist/skills/agnostic/frontend/agent-browser/references/snapshot-refs.md +0 -194
- package/dist/skills/agnostic/frontend/agent-browser/references/video-recording.md +0 -173
- package/dist/skills/agnostic/frontend/agent-browser/templates/authenticated-session.sh +0 -97
- package/dist/skills/agnostic/frontend/agent-browser/templates/capture-workflow.sh +0 -69
- package/dist/skills/agnostic/frontend/agent-browser/templates/form-automation.sh +0 -62
- package/dist/skills/agnostic/frontend/animate/LICENSE +0 -21
- package/dist/skills/agnostic/frontend/animate/RECIPES.md +0 -324
- package/dist/skills/agnostic/frontend/animate/SKILL.md +0 -199
- package/dist/skills/agnostic/frontend/animate/UPSTREAM.md +0 -9
- package/dist/skills/agnostic/frontend/design-taste-frontend/SKILL.md +0 -1206
- package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +0 -42
- package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +0 -75
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +0 -134
- package/dist/skills/agnostic/frontend/gpt-taste/SKILL.md +0 -74
- package/dist/skills/agnostic/frontend/imagegen-frontend-mobile/SKILL.md +0 -1465
- package/dist/skills/agnostic/frontend/imagegen-frontend-web/SKILL.md +0 -987
- package/dist/skills/agnostic/frontend/improve-mobile-frontend/SKILL.md +0 -109
- package/dist/skills/agnostic/frontend/improve-mobile-frontend/UPSTREAM.md +0 -5
- package/dist/skills/agnostic/frontend/redesign-existing-projects/SKILL.md +0 -178
- package/dist/skills/agnostic/frontend/review-animations/LICENSE +0 -21
- package/dist/skills/agnostic/frontend/review-animations/SKILL.md +0 -112
- package/dist/skills/agnostic/frontend/review-animations/STANDARDS.md +0 -187
- package/dist/skills/agnostic/frontend/review-animations/UPSTREAM.md +0 -9
- package/dist/skills/agnostic/generic/handoff/LICENSE +0 -21
- package/dist/skills/agnostic/generic/handoff/SKILL.md +0 -28
- package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/planning/create-architecture/SKILL.md +0 -65
- package/dist/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +0 -119
- package/dist/skills/agnostic/planning/create-architecture/references/artifact-contract.md +0 -200
- package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +0 -44
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +0 -153
- package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +0 -114
- package/dist/skills/agnostic/planning/create-plan/references/backlog-sync.md +0 -63
- package/dist/skills/agnostic/planning/create-plan/references/grill-ambiguity.md +0 -66
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +0 -232
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +0 -80
- package/dist/skills/agnostic/planning/create-plan/references/stop-conditions.md +0 -19
- package/dist/skills/agnostic/planning/create-plan/references/tdd-shaping.md +0 -49
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +0 -87
- package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +0 -72
- package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +0 -36
- package/dist/skills/agnostic/planning/create-spec/references/readiness.md +0 -86
- package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +0 -83
- package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +0 -50
- package/dist/skills/agnostic/planning/create-verification-skill/SKILL.md +0 -66
- package/dist/skills/agnostic/planning/create-verification-skill/references/upstream.md +0 -20
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +0 -105
- package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -116
- package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +0 -108
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +0 -338
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +0 -102
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +0 -121
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +0 -19
- package/dist/skills/agnostic/planning/implement-spec/references/runtime-product-validation.md +0 -77
- package/dist/skills/agnostic/planning/implement-spec/references/ui-screenshot-evidence.md +0 -61
- package/dist/skills/agnostic/planning/swarm-planner/SKILL.md +0 -204
- package/dist/skills/agnostic/planning/update-verification-skill/SKILL.md +0 -81
- package/dist/skills/agnostic/planning/verify-behavior/LICENSE +0 -21
- package/dist/skills/agnostic/planning/verify-behavior/SKILL.md +0 -120
- package/dist/skills/agnostic/planning/verify-behavior/UPSTREAM.md +0 -9
- package/dist/skills/agnostic/planning/verify-behavior/agents/openai.yaml +0 -2
- package/dist/skills/agnostic/planning/wayfinder/SKILL.md +0 -22
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +0 -218
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +0 -1276
- package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +0 -176
- package/dist/skills/agnostic/quality/codebase-design/DEEPENING.md +0 -34
- package/dist/skills/agnostic/quality/codebase-design/DESIGN-IT-TWICE.md +0 -43
- package/dist/skills/agnostic/quality/codebase-design/LICENSE +0 -21
- package/dist/skills/agnostic/quality/codebase-design/SKILL.md +0 -60
- package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/quality/make-tsuite/SKILL.md +0 -57
- package/dist/skills/agnostic/quality/make-tsuite/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/quality/make-tsuite/references/audit-portfolio.md +0 -47
- package/dist/skills/agnostic/quality/make-tsuite/references/implement-suite.md +0 -40
- package/dist/skills/agnostic/quality/make-tsuite/references/route-api-design.md +0 -21
- package/dist/skills/agnostic/quality/make-tsuite/references/user-journey-design.md +0 -21
- package/dist/skills/agnostic/quality/review/LICENSE +0 -21
- package/dist/skills/agnostic/quality/review/SKILL.md +0 -94
- package/dist/skills/agnostic/quality/review/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/quality/simplify/SKILL.md +0 -14
- package/dist/skills/agnostic/quality/tdd/LICENSE +0 -21
- package/dist/skills/agnostic/quality/tdd/SKILL.md +0 -140
- package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/quality/tdd/deep-modules.md +0 -33
- package/dist/skills/agnostic/quality/tdd/high-signal-tests.md +0 -53
- package/dist/skills/agnostic/quality/tdd/interface-design.md +0 -31
- package/dist/skills/agnostic/quality/tdd/mocking.md +0 -59
- package/dist/skills/agnostic/quality/tdd/refactoring.md +0 -10
- package/dist/skills/agnostic/quality/tdd/tests.md +0 -61
- package/dist/skills/agnostic/repo-asset-management/SKILL.md +0 -28
- package/dist/skills/agnostic/repo-asset-management/references/acceptance.md +0 -6
- package/dist/skills/agnostic/repo-asset-management/references/azure.md +0 -11
- package/dist/skills/agnostic/repo-asset-management/references/bitbucket.md +0 -8
- package/dist/skills/agnostic/repo-asset-management/references/github.md +0 -11
- package/dist/skills/agnostic/repo-asset-management/references/gitlab.md +0 -11
- package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +0 -50
- package/dist/skills/agnostic/requirements/domain-modeling/ADR-FORMAT.md +0 -47
- package/dist/skills/agnostic/requirements/domain-modeling/GLOSSARY-FORMAT.md +0 -60
- package/dist/skills/agnostic/requirements/domain-modeling/LICENSE +0 -21
- package/dist/skills/agnostic/requirements/domain-modeling/SKILL.md +0 -74
- package/dist/skills/agnostic/requirements/domain-modeling/UPSTREAM.md +0 -9
- package/dist/skills/agnostic/requirements/domain-modeling/agents/openai.yaml +0 -3
- package/dist/skills/agnostic/requirements/grilling/LICENSE +0 -21
- package/dist/skills/agnostic/requirements/grilling/SKILL.md +0 -14
- package/dist/skills/agnostic/requirements/grilling/UPSTREAM.md +0 -16
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +0 -55
- package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +0 -206
- package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +0 -48
- package/dist/skills/agnostic/requirements/requirements-grill/references/wiki-output.md +0 -107
- package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +0 -57
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +0 -78
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +0 -109
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +0 -57
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +0 -121
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +0 -171
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +0 -302
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +0 -155
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +0 -236
- package/dist/skills/agnostic/requirements/write-backlog/references/backlog-initialization.md +0 -88
- package/dist/skills/agnostic/requirements/write-backlog/references/business-projection.md +0 -26
- package/dist/skills/agnostic/requirements/write-backlog/references/delivery-status.md +0 -70
- package/dist/skills/agnostic/requirements/write-backlog/references/fog-intake.md +0 -69
- package/dist/skills/agnostic/requirements/write-backlog/references/functional-projection.md +0 -22
- package/dist/skills/agnostic/requirements/write-backlog/references/issue-reconciliation.md +0 -76
- package/dist/skills/agnostic/requirements/write-backlog/references/normalization.md +0 -105
- package/dist/skills/agnostic/requirements/write-backlog/references/project-context.md +0 -48
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/github.md +0 -123
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/linear.md +0 -120
- package/dist/skills/agnostic/requirements/write-backlog/references/technical-projection.md +0 -69
- package/dist/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +0 -159
- package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +0 -21
- package/dist/skills/agnostic/research/improve-codebase-architecture/REFERENCE.md +0 -78
- package/dist/skills/agnostic/research/improve-codebase-architecture/SKILL.md +0 -85
- package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +0 -29
- package/dist/skills/agnostic/research/parallel-research/SKILL.md +0 -80
- package/dist/skills/agnostic/research/parallel-research/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/research/prototype/LICENSE +0 -21
- package/dist/skills/agnostic/research/prototype/LOGIC.md +0 -67
- package/dist/skills/agnostic/research/prototype/SKILL.md +0 -33
- package/dist/skills/agnostic/research/prototype/UI.md +0 -36
- package/dist/skills/agnostic/research/prototype/UPSTREAM.md +0 -11
- package/dist/skills/agnostic/security/architect-pipeline/SKILL.md +0 -97
- package/dist/skills/agnostic/security/architect-pipeline/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +0 -29
- package/dist/skills/agnostic/security/architect-pipeline/references/security-by-design.md +0 -22
- package/dist/skills/agnostic/security/audit-cicd-security/SKILL.md +0 -58
- package/dist/skills/agnostic/security/audit-cicd-security/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/security/audit-cicd-security/references/argo-workflows.md +0 -25
- package/dist/skills/agnostic/security/audit-cicd-security/references/azure-pipelines.md +0 -27
- package/dist/skills/agnostic/security/audit-cicd-security/references/bitbucket-pipelines.md +0 -26
- package/dist/skills/agnostic/security/audit-cicd-security/references/buildkite.md +0 -26
- package/dist/skills/agnostic/security/audit-cicd-security/references/circleci.md +0 -25
- package/dist/skills/agnostic/security/audit-cicd-security/references/github-actions.md +0 -24
- package/dist/skills/agnostic/security/audit-cicd-security/references/gitlab-cicd.md +0 -27
- package/dist/skills/agnostic/security/audit-cicd-security/references/jenkins.md +0 -26
- package/dist/skills/agnostic/security/audit-cicd-security/references/tekton.md +0 -24
- package/dist/skills/agnostic/security/security-best-practices/LICENSE.txt +0 -201
- package/dist/skills/agnostic/security/security-best-practices/SKILL.md +0 -86
- package/dist/skills/agnostic/security/security-best-practices/agents/openai.yaml +0 -4
- package/dist/skills/agnostic/security/security-best-practices/references/golang-general-backend-security.md +0 -826
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-express-web-server-security.md +0 -1158
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-general-web-frontend-security.md +0 -747
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-jquery-web-frontend-security.md +0 -678
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +0 -1144
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +0 -990
- package/dist/skills/agnostic/security/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +0 -791
- package/dist/skills/agnostic/security/security-best-practices/references/python-django-web-server-security.md +0 -882
- package/dist/skills/agnostic/security/security-best-practices/references/python-fastapi-web-server-security.md +0 -1036
- package/dist/skills/agnostic/security/security-best-practices/references/python-flask-web-server-security.md +0 -705
- package/dist/skills/agnostic/subagents/swarm-planner/SKILL.md +0 -204
- package/dist/skills/frameworks/better-auth/better-auth-best-practices/SKILL.md +0 -166
- package/dist/skills/frameworks/better-auth/better-auth-security-best-practices/SKILL.MD +0 -432
- package/dist/skills/frameworks/effect/effect/LICENSE +0 -21
- package/dist/skills/frameworks/effect/effect/SKILL.md +0 -93
- package/dist/skills/frameworks/effect/effect/UPSTREAM.md +0 -11
- package/dist/skills/frameworks/effect/effect/references/CACHING.md +0 -76
- package/dist/skills/frameworks/effect/effect/references/CONFIG.md +0 -58
- package/dist/skills/frameworks/effect/effect/references/EFFECT_ATOM.md +0 -257
- package/dist/skills/frameworks/effect/effect/references/HTTP_CLIENTS.md +0 -101
- package/dist/skills/frameworks/effect/effect/references/OBSERVABILITY.md +0 -88
- package/dist/skills/frameworks/effect/effect/references/SCHEDULING.md +0 -135
- package/dist/skills/frameworks/effect/effect/references/SCHEMA.md +0 -130
- package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +0 -108
- package/dist/skills/frameworks/effect/effect/references/STREAMS.md +0 -135
- package/dist/skills/frameworks/effect/effect/references/TESTING.md +0 -48
- package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +0 -89
- package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +0 -130
- package/dist/skills/frameworks/effect/effect-recoverable-actions/SKILL.md +0 -65
- package/dist/skills/frameworks/effect/effect-recoverable-actions/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/effect/effect-recoverable-actions/references/flow-examples.md +0 -154
- package/dist/skills/frameworks/effect/effect-recoverable-actions/references/source-backed-primitives.md +0 -104
- package/dist/skills/frameworks/effect/effect-recoverable-actions/references/strategy-matrix.md +0 -34
- package/dist/skills/frameworks/effect/effect-recoverable-actions/references/test-matrix.md +0 -36
- package/dist/skills/frameworks/effect/effect-service-design/LICENSE +0 -21
- package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +0 -126
- package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +0 -17
- package/dist/skills/frameworks/effect/effect-service-design/references/AUDIT.md +0 -98
- package/dist/skills/frameworks/elysia/elysiajs/SKILL.md +0 -475
- package/dist/skills/frameworks/elysia/elysiajs/examples/basic.ts +0 -9
- package/dist/skills/frameworks/elysia/elysiajs/examples/body-parser.ts +0 -33
- package/dist/skills/frameworks/elysia/elysiajs/examples/complex.ts +0 -112
- package/dist/skills/frameworks/elysia/elysiajs/examples/cookie.ts +0 -45
- package/dist/skills/frameworks/elysia/elysiajs/examples/error.ts +0 -38
- package/dist/skills/frameworks/elysia/elysiajs/examples/file.ts +0 -10
- package/dist/skills/frameworks/elysia/elysiajs/examples/guard.ts +0 -34
- package/dist/skills/frameworks/elysia/elysiajs/examples/map-response.ts +0 -15
- package/dist/skills/frameworks/elysia/elysiajs/examples/redirect.ts +0 -6
- package/dist/skills/frameworks/elysia/elysiajs/examples/rename.ts +0 -32
- package/dist/skills/frameworks/elysia/elysiajs/examples/schema.ts +0 -61
- package/dist/skills/frameworks/elysia/elysiajs/examples/state.ts +0 -6
- package/dist/skills/frameworks/elysia/elysiajs/examples/upload-file.ts +0 -20
- package/dist/skills/frameworks/elysia/elysiajs/examples/websocket.ts +0 -25
- package/dist/skills/frameworks/elysia/elysiajs/integrations/ai-sdk.md +0 -92
- package/dist/skills/frameworks/elysia/elysiajs/integrations/astro.md +0 -59
- package/dist/skills/frameworks/elysia/elysiajs/integrations/better-auth.md +0 -117
- package/dist/skills/frameworks/elysia/elysiajs/integrations/cloudflare-worker.md +0 -95
- package/dist/skills/frameworks/elysia/elysiajs/integrations/deno.md +0 -34
- package/dist/skills/frameworks/elysia/elysiajs/integrations/drizzle.md +0 -258
- package/dist/skills/frameworks/elysia/elysiajs/integrations/expo.md +0 -95
- package/dist/skills/frameworks/elysia/elysiajs/integrations/nextjs.md +0 -103
- package/dist/skills/frameworks/elysia/elysiajs/integrations/nodejs.md +0 -64
- package/dist/skills/frameworks/elysia/elysiajs/integrations/nuxt.md +0 -67
- package/dist/skills/frameworks/elysia/elysiajs/integrations/prisma.md +0 -93
- package/dist/skills/frameworks/elysia/elysiajs/integrations/react-email.md +0 -134
- package/dist/skills/frameworks/elysia/elysiajs/integrations/sveltekit.md +0 -53
- package/dist/skills/frameworks/elysia/elysiajs/integrations/tanstack-start.md +0 -87
- package/dist/skills/frameworks/elysia/elysiajs/integrations/vercel.md +0 -55
- package/dist/skills/frameworks/elysia/elysiajs/patterns/mvc.md +0 -380
- package/dist/skills/frameworks/elysia/elysiajs/plugins/bearer.md +0 -30
- package/dist/skills/frameworks/elysia/elysiajs/plugins/cors.md +0 -141
- package/dist/skills/frameworks/elysia/elysiajs/plugins/cron.md +0 -265
- package/dist/skills/frameworks/elysia/elysiajs/plugins/graphql-apollo.md +0 -90
- package/dist/skills/frameworks/elysia/elysiajs/plugins/graphql-yoga.md +0 -87
- package/dist/skills/frameworks/elysia/elysiajs/plugins/html.md +0 -188
- package/dist/skills/frameworks/elysia/elysiajs/plugins/jwt.md +0 -197
- package/dist/skills/frameworks/elysia/elysiajs/plugins/openapi.md +0 -246
- package/dist/skills/frameworks/elysia/elysiajs/plugins/opentelemetry.md +0 -167
- package/dist/skills/frameworks/elysia/elysiajs/plugins/server-timing.md +0 -71
- package/dist/skills/frameworks/elysia/elysiajs/plugins/static.md +0 -84
- package/dist/skills/frameworks/elysia/elysiajs/references/bun-fullstack-dev-server.md +0 -129
- package/dist/skills/frameworks/elysia/elysiajs/references/cookie.md +0 -187
- package/dist/skills/frameworks/elysia/elysiajs/references/deployment.md +0 -413
- package/dist/skills/frameworks/elysia/elysiajs/references/eden.md +0 -158
- package/dist/skills/frameworks/elysia/elysiajs/references/lifecycle.md +0 -198
- package/dist/skills/frameworks/elysia/elysiajs/references/macro.md +0 -83
- package/dist/skills/frameworks/elysia/elysiajs/references/plugin.md +0 -207
- package/dist/skills/frameworks/elysia/elysiajs/references/route.md +0 -331
- package/dist/skills/frameworks/elysia/elysiajs/references/testing.md +0 -385
- package/dist/skills/frameworks/elysia/elysiajs/references/validation.md +0 -491
- package/dist/skills/frameworks/elysia/elysiajs/references/websocket.md +0 -250
- package/dist/skills/frameworks/expo/add-app-clip/SKILL.md +0 -280
- package/dist/skills/frameworks/expo/add-app-clip/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/add-app-clip/references/native-module.md +0 -96
- package/dist/skills/frameworks/expo/animate-expo/LICENSE +0 -21
- package/dist/skills/frameworks/expo/animate-expo/RECIPES.md +0 -385
- package/dist/skills/frameworks/expo/animate-expo/SKILL.md +0 -255
- package/dist/skills/frameworks/expo/animate-expo/UPSTREAM.md +0 -9
- package/dist/skills/frameworks/expo/building-native-ui/SKILL.md +0 -377
- package/dist/skills/frameworks/expo/building-native-ui/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/building-native-ui/references/animations.md +0 -220
- package/dist/skills/frameworks/expo/building-native-ui/references/controls.md +0 -270
- package/dist/skills/frameworks/expo/building-native-ui/references/form-sheet.md +0 -253
- package/dist/skills/frameworks/expo/building-native-ui/references/gradients.md +0 -106
- package/dist/skills/frameworks/expo/building-native-ui/references/icons.md +0 -213
- package/dist/skills/frameworks/expo/building-native-ui/references/media.md +0 -198
- package/dist/skills/frameworks/expo/building-native-ui/references/route-structure.md +0 -229
- package/dist/skills/frameworks/expo/building-native-ui/references/search.md +0 -248
- package/dist/skills/frameworks/expo/building-native-ui/references/storage.md +0 -121
- package/dist/skills/frameworks/expo/building-native-ui/references/tabs.md +0 -433
- package/dist/skills/frameworks/expo/building-native-ui/references/toolbar-and-headers.md +0 -284
- package/dist/skills/frameworks/expo/building-native-ui/references/visual-effects.md +0 -197
- package/dist/skills/frameworks/expo/building-native-ui/references/webgpu-three.md +0 -605
- package/dist/skills/frameworks/expo/building-native-ui/references/zoom-transitions.md +0 -158
- package/dist/skills/frameworks/expo/eas-simulator/SKILL.md +0 -154
- package/dist/skills/frameworks/expo/eas-simulator/references/controllers.md +0 -67
- package/dist/skills/frameworks/expo/eas-simulator/references/run-your-app.md +0 -185
- package/dist/skills/frameworks/expo/eas-simulator/references/troubleshooting.md +0 -38
- package/dist/skills/frameworks/expo/eas-update-insights/SKILL.md +0 -228
- package/dist/skills/frameworks/expo/eas-update-insights/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/eas-update-insights/references/channel-insights-schema.md +0 -47
- package/dist/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +0 -69
- package/dist/skills/frameworks/expo/expo-api-routes/SKILL.md +0 -368
- package/dist/skills/frameworks/expo/expo-api-routes/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-brownfield/SKILL.md +0 -54
- package/dist/skills/frameworks/expo/expo-brownfield/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-integrated.md +0 -526
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-isolated.md +0 -402
- package/dist/skills/frameworks/expo/expo-brownfield/references/comparison.md +0 -63
- package/dist/skills/frameworks/expo/expo-brownfield/references/troubleshooting.md +0 -88
- package/dist/skills/frameworks/expo/expo-cicd-workflows/SKILL.md +0 -92
- package/dist/skills/frameworks/expo/expo-cicd-workflows/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/fetch.js +0 -109
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/package.json +0 -11
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/validate.js +0 -84
- package/dist/skills/frameworks/expo/expo-deployment/SKILL.md +0 -167
- package/dist/skills/frameworks/expo/expo-deployment/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-deployment/references/app-store-metadata.md +0 -497
- package/dist/skills/frameworks/expo/expo-deployment/references/ios-app-store.md +0 -371
- package/dist/skills/frameworks/expo/expo-deployment/references/play-store.md +0 -246
- package/dist/skills/frameworks/expo/expo-deployment/references/testflight.md +0 -58
- package/dist/skills/frameworks/expo/expo-deployment/references/workflows.md +0 -160
- package/dist/skills/frameworks/expo/expo-dev-client/SKILL.md +0 -172
- package/dist/skills/frameworks/expo/expo-dev-client/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-examples/SKILL.md +0 -97
- package/dist/skills/frameworks/expo/expo-examples/references/catalog.md +0 -105
- package/dist/skills/frameworks/expo/expo-module/SKILL.md +0 -141
- package/dist/skills/frameworks/expo/expo-module/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-module/references/config-plugin.md +0 -90
- package/dist/skills/frameworks/expo/expo-module/references/create-expo-module.md +0 -206
- package/dist/skills/frameworks/expo/expo-module/references/lifecycle.md +0 -127
- package/dist/skills/frameworks/expo/expo-module/references/module-config.md +0 -48
- package/dist/skills/frameworks/expo/expo-module/references/native-module.md +0 -286
- package/dist/skills/frameworks/expo/expo-module/references/native-view.md +0 -171
- package/dist/skills/frameworks/expo/expo-observe/SKILL.md +0 -29
- package/dist/skills/frameworks/expo/expo-observe/references/metrics.md +0 -47
- package/dist/skills/frameworks/expo/expo-observe/references/queries.md +0 -342
- package/dist/skills/frameworks/expo/expo-observe/references/setup.md +0 -255
- package/dist/skills/frameworks/expo/expo-skill-eval/SKILL.md +0 -314
- package/dist/skills/frameworks/expo/expo-skill-eval/agents/visual-grader.md +0 -52
- package/dist/skills/frameworks/expo/expo-skill-eval/references/design-rubric.md +0 -45
- package/dist/skills/frameworks/expo/expo-skill-eval/references/runtime-matrix.md +0 -33
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/check-static.sh +0 -64
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/clean-fixture.sh +0 -56
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/generate_viewer.py +0 -450
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/latest-sdk.sh +0 -46
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-fixture.sh +0 -95
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-workspace.sh +0 -31
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-android.sh +0 -284
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-ios.sh +0 -132
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-web.sh +0 -61
- package/dist/skills/frameworks/expo/expo-tailwind-setup/SKILL.md +0 -480
- package/dist/skills/frameworks/expo/expo-tailwind-setup/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-ui/SKILL.md +0 -47
- package/dist/skills/frameworks/expo/expo-ui/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/expo-ui/references/drop-in-replacements.md +0 -27
- package/dist/skills/frameworks/expo/expo-ui/references/jetpack-compose.md +0 -73
- package/dist/skills/frameworks/expo/expo-ui/references/swift-ui.md +0 -73
- package/dist/skills/frameworks/expo/expo-ui/references/universal.md +0 -73
- package/dist/skills/frameworks/expo/expo-ui/scripts/list-components.js +0 -193
- package/dist/skills/frameworks/expo/native-data-fetching/SKILL.md +0 -505
- package/dist/skills/frameworks/expo/native-data-fetching/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/native-data-fetching/references/expo-router-loaders.md +0 -341
- package/dist/skills/frameworks/expo/upgrading-expo/SKILL.md +0 -134
- package/dist/skills/frameworks/expo/upgrading-expo/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-audio.md +0 -132
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-video.md +0 -160
- package/dist/skills/frameworks/expo/upgrading-expo/references/native-tabs.md +0 -124
- package/dist/skills/frameworks/expo/upgrading-expo/references/new-architecture.md +0 -79
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-19.md +0 -79
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-compiler.md +0 -59
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-navigation-to-expo-router.md +0 -61
- package/dist/skills/frameworks/expo/use-dom/SKILL.md +0 -417
- package/dist/skills/frameworks/expo/use-dom/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/expo/web-to-native/SKILL.md +0 -83
- package/dist/skills/frameworks/expo/web-to-native/references/false-friends.md +0 -119
- package/dist/skills/frameworks/expo/web-to-native/references/native-patterns.md +0 -39
- package/dist/skills/frameworks/expo/web-to-native/references/run-as-goal.md +0 -48
- package/dist/skills/frameworks/expo/web-to-native/references/verify-on-device.md +0 -45
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/branch-protection.yml +0 -24
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/deploy.yml +0 -61
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/AGENTS.md +0 -5958
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/SKILL.md +0 -130
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-dto-serialization.md +0 -182
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-interceptors.md +0 -202
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-pipes.md +0 -205
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/api-versioning.md +0 -191
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-avoid-circular-deps.md +0 -80
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-feature-modules.md +0 -82
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-module-sharing.md +0 -141
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-single-responsibility.md +0 -106
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-events.md +0 -108
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-repository-pattern.md +0 -97
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/db-avoid-n-plus-one.md +0 -139
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-migrations.md +0 -129
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-transactions.md +0 -140
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-graceful-shutdown.md +0 -222
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-config-module.md +0 -167
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-logging.md +0 -232
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-avoid-service-locator.md +0 -104
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-interface-segregation.md +0 -165
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-liskov-substitution.md +0 -221
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-prefer-constructor-injection.md +0 -86
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-scope-awareness.md +0 -94
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/di-use-interfaces-tokens.md +0 -101
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/error-handle-async-errors.md +0 -125
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/error-throw-http-exceptions.md +0 -114
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/error-use-exception-filters.md +0 -140
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-health-checks.md +0 -226
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-patterns.md +0 -167
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-queues.md +0 -252
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-async-hooks.md +0 -109
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-lazy-loading.md +0 -121
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-optimize-database.md +0 -131
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-use-caching.md +0 -128
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/security-auth-jwt.md +0 -146
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/security-rate-limiting.md +0 -125
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/security-sanitize-output.md +0 -139
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/security-use-guards.md +0 -135
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/security-validate-all-input.md +0 -150
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/test-e2e-supertest.md +0 -178
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/test-mock-external-services.md +0 -179
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/rules/test-use-testing-module.md +0 -153
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/scripts/build-agents.ts +0 -299
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/scripts/build.sh +0 -16
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/scripts/package-lock.json +0 -237
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/scripts/package.json +0 -15
- package/dist/skills/frameworks/nestjs/nestjs-expert/SKILL.md +0 -208
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/authentication.md +0 -166
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/controllers-routing.md +0 -111
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/dtos-validation.md +0 -153
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/migration-from-express.md +0 -1237
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/services-di.md +0 -140
- package/dist/skills/frameworks/nestjs/nestjs-expert/references/testing-patterns.md +0 -186
- package/dist/skills/frameworks/nextjs/next-best-practices/SKILL.md +0 -153
- package/dist/skills/frameworks/nextjs/next-best-practices/async-patterns.md +0 -87
- package/dist/skills/frameworks/nextjs/next-best-practices/bundling.md +0 -180
- package/dist/skills/frameworks/nextjs/next-best-practices/data-patterns.md +0 -297
- package/dist/skills/frameworks/nextjs/next-best-practices/debug-tricks.md +0 -105
- package/dist/skills/frameworks/nextjs/next-best-practices/directives.md +0 -73
- package/dist/skills/frameworks/nextjs/next-best-practices/error-handling.md +0 -227
- package/dist/skills/frameworks/nextjs/next-best-practices/file-conventions.md +0 -140
- package/dist/skills/frameworks/nextjs/next-best-practices/font.md +0 -245
- package/dist/skills/frameworks/nextjs/next-best-practices/functions.md +0 -108
- package/dist/skills/frameworks/nextjs/next-best-practices/hydration-error.md +0 -91
- package/dist/skills/frameworks/nextjs/next-best-practices/image.md +0 -173
- package/dist/skills/frameworks/nextjs/next-best-practices/metadata.md +0 -301
- package/dist/skills/frameworks/nextjs/next-best-practices/parallel-routes.md +0 -287
- package/dist/skills/frameworks/nextjs/next-best-practices/route-handlers.md +0 -146
- package/dist/skills/frameworks/nextjs/next-best-practices/rsc-boundaries.md +0 -159
- package/dist/skills/frameworks/nextjs/next-best-practices/runtime-selection.md +0 -39
- package/dist/skills/frameworks/nextjs/next-best-practices/scripts.md +0 -141
- package/dist/skills/frameworks/nextjs/next-best-practices/self-hosting.md +0 -371
- package/dist/skills/frameworks/nextjs/next-best-practices/suspense-boundaries.md +0 -67
- package/dist/skills/frameworks/nextjs/next-cache-components/SKILL.md +0 -360
- package/dist/skills/frameworks/pulumi/package-usage/SKILL.md +0 -49
- package/dist/skills/frameworks/pulumi/package-usage/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/package-usage/use_cases.yaml +0 -15
- package/dist/skills/frameworks/pulumi/provider-upgrade/SKILL.md +0 -335
- package/dist/skills/frameworks/pulumi/provider-upgrade/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/provider-upgrade/references/diagnostic-toolbox.md +0 -131
- package/dist/skills/frameworks/pulumi/provider-upgrade/use_cases.yaml +0 -28
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/SKILL.md +0 -320
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/use_cases.yaml +0 -7
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +0 -469
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/use_cases.yaml +0 -7
- package/dist/skills/frameworks/pulumi/pulumi-component/SKILL.md +0 -790
- package/dist/skills/frameworks/pulumi/pulumi-component/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/pulumi-component/use_cases.yaml +0 -19
- package/dist/skills/frameworks/pulumi/pulumi-esc/SKILL.md +0 -281
- package/dist/skills/frameworks/pulumi/pulumi-esc/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/pulumi/pulumi-esc/use_cases.yaml +0 -30
- package/dist/skills/frameworks/pulumi/pulumi-overview/SKILL.md +0 -289
- package/dist/skills/frameworks/pulumi/pulumi-overview/use_cases.yaml +0 -50
- package/dist/skills/frameworks/react/async-react-patterns/SKILL.md +0 -78
- package/dist/skills/frameworks/react/react-doctor/SKILL.md +0 -79
- package/dist/skills/frameworks/react/react-doctor/references/explain.md +0 -75
- package/dist/skills/frameworks/react/vercel-composition-patterns/AGENTS.md +0 -946
- package/dist/skills/frameworks/react/vercel-composition-patterns/SKILL.md +0 -89
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +0 -100
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/architecture-compound-components.md +0 -112
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/patterns-children-over-render-props.md +0 -87
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/patterns-explicit-variants.md +0 -100
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/react19-no-forwardref.md +0 -42
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/state-context-interface.md +0 -191
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/state-decouple-implementation.md +0 -113
- package/dist/skills/frameworks/react/vercel-composition-patterns/rules/state-lift-state.md +0 -125
- package/dist/skills/frameworks/react/vercel-react-best-practices/AGENTS.md +0 -3750
- package/dist/skills/frameworks/react/vercel-react-best-practices/SKILL.md +0 -148
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/advanced-effect-event-deps.md +0 -56
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +0 -37
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-defer-await.md +0 -82
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -60
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-request-idle-callback.md +0 -105
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -149
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-no-shared-module-state.md +0 -50
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +0 -34
- package/dist/skills/frameworks/react/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +0 -199
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +0 -31
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +0 -4
- package/dist/skills/frameworks/tanstack-query/tanstack-query/.claude-plugin/plugin.json +0 -12
- package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +0 -849
- package/dist/skills/frameworks/tanstack-query/tanstack-query/assets/example-template.txt +0 -14
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/best-practices.md +0 -304
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/common-patterns.md +0 -271
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/example-reference.md +0 -26
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/testing.md +0 -282
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/top-errors.md +0 -332
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/typescript-patterns.md +0 -291
- package/dist/skills/frameworks/tanstack-query/tanstack-query/references/v4-to-v5-migration.md +0 -231
- package/dist/skills/frameworks/tanstack-query/tanstack-query/rules/tanstack-query.md +0 -126
- package/dist/skills/frameworks/tanstack-query/tanstack-query/scripts/example-script.sh +0 -15
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/devtools-setup.tsx +0 -248
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/error-boundary.tsx +0 -243
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/package.json +0 -31
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/provider-setup.tsx +0 -50
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/query-client-config.ts +0 -72
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/use-infinite-query.tsx +0 -214
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-basic.tsx +0 -201
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-optimistic.tsx +0 -234
- package/dist/skills/frameworks/tanstack-query/tanstack-query/templates/use-query-basic.tsx +0 -119
- package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +0 -250
- package/dist/skills/frameworks/trpc/tanstack-query/.claude-plugin/plugin.json +0 -12
- package/dist/skills/frameworks/trpc/tanstack-query/SKILL.md +0 -1058
- package/dist/skills/frameworks/trpc/tanstack-query/assets/example-template.txt +0 -14
- package/dist/skills/frameworks/trpc/tanstack-query/references/best-practices.md +0 -304
- package/dist/skills/frameworks/trpc/tanstack-query/references/common-patterns.md +0 -271
- package/dist/skills/frameworks/trpc/tanstack-query/references/example-reference.md +0 -26
- package/dist/skills/frameworks/trpc/tanstack-query/references/testing.md +0 -282
- package/dist/skills/frameworks/trpc/tanstack-query/references/top-errors.md +0 -332
- package/dist/skills/frameworks/trpc/tanstack-query/references/typescript-patterns.md +0 -291
- package/dist/skills/frameworks/trpc/tanstack-query/references/v4-to-v5-migration.md +0 -231
- package/dist/skills/frameworks/trpc/tanstack-query/rules/tanstack-query.md +0 -126
- package/dist/skills/frameworks/trpc/tanstack-query/scripts/example-script.sh +0 -15
- package/dist/skills/frameworks/trpc/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
- package/dist/skills/frameworks/trpc/tanstack-query/templates/devtools-setup.tsx +0 -248
- package/dist/skills/frameworks/trpc/tanstack-query/templates/error-boundary.tsx +0 -243
- package/dist/skills/frameworks/trpc/tanstack-query/templates/package.json +0 -31
- package/dist/skills/frameworks/trpc/tanstack-query/templates/provider-setup.tsx +0 -50
- package/dist/skills/frameworks/trpc/tanstack-query/templates/query-client-config.ts +0 -72
- package/dist/skills/frameworks/trpc/tanstack-query/templates/use-infinite-query.tsx +0 -214
- package/dist/skills/frameworks/trpc/tanstack-query/templates/use-mutation-basic.tsx +0 -201
- package/dist/skills/frameworks/trpc/tanstack-query/templates/use-mutation-optimistic.tsx +0 -234
- package/dist/skills/frameworks/trpc/tanstack-query/templates/use-query-basic.tsx +0 -119
- package/dist/skills/frameworks/turborepo/turborepo/SKILL.md +0 -914
- package/dist/skills/frameworks/turborepo/turborepo/command/turborepo.md +0 -70
- package/dist/skills/frameworks/turborepo/turborepo/references/best-practices/RULE.md +0 -241
- package/dist/skills/frameworks/turborepo/turborepo/references/best-practices/dependencies.md +0 -246
- package/dist/skills/frameworks/turborepo/turborepo/references/best-practices/packages.md +0 -335
- package/dist/skills/frameworks/turborepo/turborepo/references/best-practices/structure.md +0 -270
- package/dist/skills/frameworks/turborepo/turborepo/references/boundaries/RULE.md +0 -126
- package/dist/skills/frameworks/turborepo/turborepo/references/caching/RULE.md +0 -107
- package/dist/skills/frameworks/turborepo/turborepo/references/caching/gotchas.md +0 -169
- package/dist/skills/frameworks/turborepo/turborepo/references/caching/remote-cache.md +0 -127
- package/dist/skills/frameworks/turborepo/turborepo/references/ci/RULE.md +0 -79
- package/dist/skills/frameworks/turborepo/turborepo/references/ci/github-actions.md +0 -162
- package/dist/skills/frameworks/turborepo/turborepo/references/ci/patterns.md +0 -145
- package/dist/skills/frameworks/turborepo/turborepo/references/ci/vercel.md +0 -103
- package/dist/skills/frameworks/turborepo/turborepo/references/cli/RULE.md +0 -100
- package/dist/skills/frameworks/turborepo/turborepo/references/cli/commands.md +0 -297
- package/dist/skills/frameworks/turborepo/turborepo/references/configuration/RULE.md +0 -211
- package/dist/skills/frameworks/turborepo/turborepo/references/configuration/global-options.md +0 -187
- package/dist/skills/frameworks/turborepo/turborepo/references/configuration/gotchas.md +0 -348
- package/dist/skills/frameworks/turborepo/turborepo/references/configuration/tasks.md +0 -285
- package/dist/skills/frameworks/turborepo/turborepo/references/environment/RULE.md +0 -96
- package/dist/skills/frameworks/turborepo/turborepo/references/environment/gotchas.md +0 -141
- package/dist/skills/frameworks/turborepo/turborepo/references/environment/modes.md +0 -101
- package/dist/skills/frameworks/turborepo/turborepo/references/filtering/RULE.md +0 -148
- package/dist/skills/frameworks/turborepo/turborepo/references/filtering/patterns.md +0 -152
- package/dist/skills/frameworks/turborepo/turborepo/references/watch/RULE.md +0 -99
- package/dist/skills/languages/python/async-python-patterns/SKILL.md +0 -735
- package/dist/skills/languages/python/python-backend-structure/SKILL.md +0 -91
- package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +0 -4
- package/dist/skills/languages/python/python-code-style/SKILL.md +0 -360
- package/dist/skills/languages/python/python-design-patterns/SKILL.md +0 -457
- package/dist/skills/languages/python/python-project-structure/SKILL.md +0 -9
- package/dist/skills/languages/python/python-testing-patterns/SKILL.md +0 -622
- package/dist/skills/languages/python/python-testing-patterns/references/advanced-patterns.md +0 -411
- package/dist/skills/languages/typescript/quality-types/SKILL.md +0 -93
- package/dist/skills/misc/secrets-cli/SKILL.md +0 -54
- package/dist/skills/misc/secrets-cli/references/command-reference.md +0 -107
- package/dist/skills/misc/secrets-cli/references/safety-and-errors.md +0 -54
- package/dist/skills/misc/secrets-cli/references/workflows.md +0 -106
- package/dist/skills/misc/show-me/LICENSE +0 -21
- package/dist/skills/misc/show-me/SKILL.md +0 -94
- package/dist/skills/misc/show-me/UPSTREAM.md +0 -11
- package/dist/skills/misc/timesheet/SKILL.md +0 -87
- package/dist/skills/misc/timesheet/scripts/git-timesheet-evidence.mjs +0 -214
- package/dist/skills/misc/wait-what/LICENSE +0 -21
- package/dist/skills/misc/wait-what/SKILL.md +0 -12
- package/dist/skills/misc/wait-what/UPSTREAM.md +0 -9
- package/dist/skills/phases/bug-discovery-phase/REFERENCE.md +0 -193
- package/dist/skills/phases/bug-discovery-phase/SKILL.md +0 -46
- package/dist/skills/phases/bug-discovery-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/bug-resolution-phase/REFERENCE.md +0 -183
- package/dist/skills/phases/bug-resolution-phase/SKILL.md +0 -50
- package/dist/skills/phases/bug-resolution-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/business-finder/SKILL.md +0 -43
- package/dist/skills/phases/business-finder/agents/openai.yaml +0 -2
- package/dist/skills/phases/debugging-phase/SKILL.md +0 -97
- package/dist/skills/phases/delivery-phase/SKILL.md +0 -65
- package/dist/skills/phases/delivery-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/delivery-phase/phases/backlog.md +0 -42
- package/dist/skills/phases/delivery-phase/phases/closeout.md +0 -52
- package/dist/skills/phases/delivery-phase/phases/debug.md +0 -43
- package/dist/skills/phases/delivery-phase/phases/docs-ingest.md +0 -31
- package/dist/skills/phases/delivery-phase/phases/human-steering.md +0 -25
- package/dist/skills/phases/delivery-phase/phases/implement.md +0 -70
- package/dist/skills/phases/delivery-phase/phases/plan.md +0 -37
- package/dist/skills/phases/delivery-phase/phases/review.md +0 -122
- package/dist/skills/phases/delivery-phase/phases/router.md +0 -54
- package/dist/skills/phases/delivery-phase/phases/spec.md +0 -23
- package/dist/skills/phases/delivery-phase/references/artifact-state.md +0 -120
- package/dist/skills/phases/delivery-phase/references/context-continuity.md +0 -109
- package/dist/skills/phases/delivery-phase/references/failure-continuity.md +0 -27
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +0 -112
- package/dist/skills/phases/design-phase/SKILL.md +0 -48
- package/dist/skills/phases/design-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/design-phase/phases/approval.md +0 -37
- package/dist/skills/phases/design-phase/phases/backlog.md +0 -45
- package/dist/skills/phases/design-phase/phases/delivery-handoff.md +0 -29
- package/dist/skills/phases/design-phase/phases/grill.md +0 -37
- package/dist/skills/phases/design-phase/phases/intake.md +0 -25
- package/dist/skills/phases/design-phase/phases/prototype.md +0 -30
- package/dist/skills/phases/design-phase/phases/router.md +0 -66
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +0 -54
- package/dist/skills/phases/docs-ingest-phase/agents/openai.yaml +0 -4
- package/dist/skills/phases/docs-ingest-phase/phases/private-internal.md +0 -59
- package/dist/skills/phases/docs-ingest-phase/phases/public-docs.md +0 -52
- package/dist/skills/phases/docs-ingest-phase/phases/router.md +0 -42
- package/dist/skills/phases/docs-ingest-phase/references/concept-pages.md +0 -70
- package/dist/skills/phases/docs-ingest-phase/references/flow-pages.md +0 -56
- package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +0 -74
- package/dist/skills/phases/docs-ingest-phase/references/learning-artifacts.md +0 -103
- package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +0 -90
- package/dist/skills/phases/docs-ingest-phase/references/repo-docs.md +0 -38
- package/dist/skills/phases/docs-ingest-phase/references/wiki-ingest.md +0 -138
- package/dist/skills/phases/finder-phase/AUTHORING-HANDOFF.md +0 -66
- package/dist/skills/phases/finder-phase/SKILL.md +0 -44
- package/dist/skills/phases/finder-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/finder-phase/phases/ensure-fog.md +0 -33
- package/dist/skills/phases/finder-phase/phases/grilling.md +0 -40
- package/dist/skills/phases/finder-phase/phases/human-steering.md +0 -25
- package/dist/skills/phases/finder-phase/phases/prototype.md +0 -32
- package/dist/skills/phases/finder-phase/phases/reconcile.md +0 -38
- package/dist/skills/phases/finder-phase/phases/research.md +0 -33
- package/dist/skills/phases/finder-phase/phases/return-target.md +0 -31
- package/dist/skills/phases/finder-phase/phases/router.md +0 -30
- package/dist/skills/phases/finder-phase/references/entrypoint-contract.md +0 -37
- package/dist/skills/phases/finder-phase/references/root-routing.md +0 -14
- package/dist/skills/phases/finder-phase/references/runtime-handoff.md +0 -40
- package/dist/skills/phases/finder-phase/references/state-graph.md +0 -38
- package/dist/skills/phases/finder-phase/scripts/finder-contract.mjs +0 -70
- package/dist/skills/phases/functional-finder/SKILL.md +0 -45
- package/dist/skills/phases/functional-finder/agents/openai.yaml +0 -2
- package/dist/skills/phases/goalify/EXAMPLES.md +0 -11
- package/dist/skills/phases/goalify/SKILL.md +0 -32
- package/dist/skills/phases/prototype-phase/SKILL.md +0 -36
- package/dist/skills/phases/prototype-phase/VERDICT-TEMPLATE.md +0 -16
- package/dist/skills/phases/prototype-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/requirements-phase/SKILL.md +0 -79
- package/dist/skills/phases/requirements-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/resolve-debt-phase/SKILL.md +0 -89
- package/dist/skills/phases/resolve-debt-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +0 -625
- package/dist/skills/phases/review-phase/SKILL.md +0 -25
- package/dist/skills/phases/review-phase/agents/openai.yaml +0 -2
- package/dist/skills/phases/review-phase/phases/prepare-review.md +0 -145
- package/dist/skills/phases/review-phase/phases/retain-report.md +0 -129
- package/dist/skills/phases/review-phase/phases/return-route.md +0 -99
- package/dist/skills/phases/review-phase/phases/router.md +0 -80
- package/dist/skills/phases/review-phase/phases/run-review.md +0 -139
- package/dist/skills/phases/review-phase/references/durable-report.md +0 -204
- package/dist/skills/phases/review-phase/references/review-packet.md +0 -72
- package/dist/skills/phases/review-phase/references/runtime-handoff.md +0 -141
- package/dist/skills/phases/review-phase/references/state-graph.md +0 -95
- package/dist/skills/phases/review-phase/references/targets.md +0 -157
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +0 -1034
|
@@ -1,3298 +0,0 @@
|
|
|
1
|
-
import { lstat, readFile, realpath, readdir, readlink } from "node:fs/promises";
|
|
2
|
-
import { spawn } from "node:child_process";
|
|
3
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { createInterface } from "node:readline";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
import { agents, capabilityPacks } from "../subagents/manifest.mjs";
|
|
9
|
-
import { claudeAdapter } from "./harness-projection/adapters/claude.mjs";
|
|
10
|
-
import { codexAdapter } from "./harness-projection/adapters/codex.mjs";
|
|
11
|
-
import { cursorAdapter } from "./harness-projection/adapters/cursor.mjs";
|
|
12
|
-
import { openCodeAdapter } from "./harness-projection/adapters/opencode.mjs";
|
|
13
|
-
import { applyProjection } from "./harness-projection/apply.mjs";
|
|
14
|
-
import { project } from "./harness-projection/core.mjs";
|
|
15
|
-
import {
|
|
16
|
-
assessScopedAuthoring,
|
|
17
|
-
readScopedAuthoringProofs,
|
|
18
|
-
} from "./harness-projection/authoring.mjs";
|
|
19
|
-
|
|
20
|
-
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
21
|
-
const sharedAgentsPath = path.join(repoRoot, ".agents/AGENTS.md");
|
|
22
|
-
const sharedSkillsPath = path.join(repoRoot, ".agents/skills");
|
|
23
|
-
const sharedHooksPath = path.join(repoRoot, ".agents/hooks");
|
|
24
|
-
const contextPlanPath = path.join(repoRoot, ".devpunks/context-plan.json");
|
|
25
|
-
const projectionReceiptPath = path.join(repoRoot, ".devpunks/harness-projection-receipt.json");
|
|
26
|
-
const scaffoldManifestPath = path.join(repoRoot, ".devpunks/scaffold-manifest.json");
|
|
27
|
-
const projectionReceiptRelativePath = ".devpunks/harness-projection-receipt.json";
|
|
28
|
-
const publicationLockCachePath = path.join(repoRoot, ".devpunks-cache");
|
|
29
|
-
const publicationLockPath = path.join(publicationLockCachePath, "sync-subagents-publication.lock");
|
|
30
|
-
const publicationLockOwnerFile = "owner.json";
|
|
31
|
-
const defaultPublicationLockStaleAfterMs = 5 * 60 * 1000;
|
|
32
|
-
const maximumConfinedFileBytes = 16 * 1024 * 1024;
|
|
33
|
-
const adapters = [claudeAdapter, codexAdapter, cursorAdapter, openCodeAdapter];
|
|
34
|
-
let previousCopyFallbacks = [];
|
|
35
|
-
const currentCopyFallbacks = new Map();
|
|
36
|
-
let operationRepoRootIdentity;
|
|
37
|
-
|
|
38
|
-
const confinedMutationScript = String.raw`
|
|
39
|
-
import { spawnSync } from "node:child_process";
|
|
40
|
-
import { createHash } from "node:crypto";
|
|
41
|
-
import {
|
|
42
|
-
closeSync,
|
|
43
|
-
constants,
|
|
44
|
-
fchmodSync,
|
|
45
|
-
fstatSync,
|
|
46
|
-
linkSync,
|
|
47
|
-
lstatSync,
|
|
48
|
-
mkdirSync,
|
|
49
|
-
openSync,
|
|
50
|
-
readSync,
|
|
51
|
-
renameSync,
|
|
52
|
-
rmSync,
|
|
53
|
-
statSync,
|
|
54
|
-
symlinkSync,
|
|
55
|
-
unlinkSync,
|
|
56
|
-
writeFileSync,
|
|
57
|
-
writeSync,
|
|
58
|
-
} from "node:fs";
|
|
59
|
-
import { createInterface } from "node:readline";
|
|
60
|
-
|
|
61
|
-
const parent = JSON.parse(process.argv[1]);
|
|
62
|
-
const assertParentIdentity = () => {
|
|
63
|
-
const current = statSync(".");
|
|
64
|
-
if (current.dev !== parent.device || current.ino !== parent.inode) {
|
|
65
|
-
const error = new Error("Confined mutation parent identity changed.");
|
|
66
|
-
error.code = "ESTALE";
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const leafKind = (entry) =>
|
|
72
|
-
entry.isSymbolicLink()
|
|
73
|
-
? "symlink"
|
|
74
|
-
: entry.isFile()
|
|
75
|
-
? "file"
|
|
76
|
-
: entry.isDirectory()
|
|
77
|
-
? "directory"
|
|
78
|
-
: "other";
|
|
79
|
-
|
|
80
|
-
const assertExpectedLeaf = (targetPath, expected) => {
|
|
81
|
-
const target = lstatSync(targetPath, { throwIfNoEntry: false });
|
|
82
|
-
const matches =
|
|
83
|
-
expected.kind === "absent"
|
|
84
|
-
? target === undefined
|
|
85
|
-
: target !== undefined &&
|
|
86
|
-
target.dev === expected.device &&
|
|
87
|
-
target.ino === expected.inode &&
|
|
88
|
-
leafKind(target) === expected.kind;
|
|
89
|
-
if (!matches) {
|
|
90
|
-
const error = new Error("Confined mutation target changed after validation.");
|
|
91
|
-
error.code = "ESTALE_TARGET";
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
return target;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const assertExpectedFileContent = (
|
|
98
|
-
targetPath,
|
|
99
|
-
expectedTarget,
|
|
100
|
-
expectedSha256,
|
|
101
|
-
maximumBytes,
|
|
102
|
-
) => {
|
|
103
|
-
let contentDescriptor;
|
|
104
|
-
try {
|
|
105
|
-
contentDescriptor = openSync(
|
|
106
|
-
targetPath,
|
|
107
|
-
constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),
|
|
108
|
-
);
|
|
109
|
-
const opened = fstatSync(contentDescriptor);
|
|
110
|
-
if (
|
|
111
|
-
!opened.isFile() ||
|
|
112
|
-
opened.dev !== expectedTarget.device ||
|
|
113
|
-
opened.ino !== expectedTarget.inode
|
|
114
|
-
) {
|
|
115
|
-
const error = new Error("Confined mutation target changed before content validation.");
|
|
116
|
-
error.code = "ESTALE_TARGET";
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
if (opened.size > maximumBytes) {
|
|
120
|
-
const error = new Error("Confined mutation target exceeds the validation limit.");
|
|
121
|
-
error.code = "EFBIG";
|
|
122
|
-
throw error;
|
|
123
|
-
}
|
|
124
|
-
const hash = createHash("sha256");
|
|
125
|
-
let total = 0;
|
|
126
|
-
while (total <= maximumBytes) {
|
|
127
|
-
const buffer = Buffer.alloc(Math.min(64 * 1024, maximumBytes + 1 - total));
|
|
128
|
-
const bytesRead = readSync(contentDescriptor, buffer, 0, buffer.length, null);
|
|
129
|
-
if (bytesRead === 0) break;
|
|
130
|
-
hash.update(buffer.subarray(0, bytesRead));
|
|
131
|
-
total += bytesRead;
|
|
132
|
-
}
|
|
133
|
-
if (total > maximumBytes) {
|
|
134
|
-
const error = new Error("Confined mutation target exceeds the validation limit.");
|
|
135
|
-
error.code = "EFBIG";
|
|
136
|
-
throw error;
|
|
137
|
-
}
|
|
138
|
-
if (hash.digest("hex") !== expectedSha256) {
|
|
139
|
-
const error = new Error("Confined mutation target content changed after validation.");
|
|
140
|
-
error.code = "ESTALE_TARGET";
|
|
141
|
-
throw error;
|
|
142
|
-
}
|
|
143
|
-
} finally {
|
|
144
|
-
if (contentDescriptor !== undefined) closeSync(contentDescriptor);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const confinedDirectoryCopyScript = [
|
|
149
|
-
'import { cpSync, statSync } from "node:fs";',
|
|
150
|
-
"const expected = JSON.parse(process.argv[1]);",
|
|
151
|
-
'const current = statSync(".");',
|
|
152
|
-
"if (current.dev !== expected.device || current.ino !== expected.inode) {",
|
|
153
|
-
' throw new Error("Confined copy directory identity changed.");',
|
|
154
|
-
"}",
|
|
155
|
-
'cpSync(process.argv[2], ".", { recursive: true });',
|
|
156
|
-
].join("\n");
|
|
157
|
-
|
|
158
|
-
const copyIntoClaimedDirectory = (request, expected) => {
|
|
159
|
-
const result = spawnSync(
|
|
160
|
-
process.execPath,
|
|
161
|
-
["--input-type=module", "--eval", confinedDirectoryCopyScript, JSON.stringify(expected), request.source],
|
|
162
|
-
{ cwd: request.target, stdio: "ignore" },
|
|
163
|
-
);
|
|
164
|
-
if (result.error !== undefined) throw result.error;
|
|
165
|
-
if (result.status !== 0) {
|
|
166
|
-
const error = new Error("Confined directory copy failed.");
|
|
167
|
-
error.code = "EIO";
|
|
168
|
-
throw error;
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const readSmallFile = (targetPath, maximumBytes) => {
|
|
173
|
-
let fileDescriptor;
|
|
174
|
-
try {
|
|
175
|
-
fileDescriptor = openSync(
|
|
176
|
-
targetPath,
|
|
177
|
-
constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),
|
|
178
|
-
);
|
|
179
|
-
const opened = fstatSync(fileDescriptor);
|
|
180
|
-
if (!opened.isFile() || opened.size > maximumBytes) {
|
|
181
|
-
const error = new Error("Confined lock owner is not a bounded regular file.");
|
|
182
|
-
error.code = "EINVAL";
|
|
183
|
-
throw error;
|
|
184
|
-
}
|
|
185
|
-
const content = Buffer.alloc(opened.size);
|
|
186
|
-
let offset = 0;
|
|
187
|
-
while (offset < content.length) {
|
|
188
|
-
const bytesRead = readSync(
|
|
189
|
-
fileDescriptor,
|
|
190
|
-
content,
|
|
191
|
-
offset,
|
|
192
|
-
content.length - offset,
|
|
193
|
-
null,
|
|
194
|
-
);
|
|
195
|
-
if (bytesRead === 0) break;
|
|
196
|
-
offset += bytesRead;
|
|
197
|
-
}
|
|
198
|
-
return content.subarray(0, offset).toString("base64");
|
|
199
|
-
} finally {
|
|
200
|
-
if (fileDescriptor !== undefined) closeSync(fileDescriptor);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const assertLockOwner = (request, directory = request.target) => {
|
|
205
|
-
const ownerPath = directory + "/" + request.ownerFile;
|
|
206
|
-
const matches =
|
|
207
|
-
request.ownerEvidence === null
|
|
208
|
-
? lstatSync(ownerPath, { throwIfNoEntry: false }) === undefined
|
|
209
|
-
: readSmallFile(ownerPath, request.maximumBytes) === request.ownerEvidence;
|
|
210
|
-
if (!matches) {
|
|
211
|
-
const error = new Error("Confined publication lock ownership changed.");
|
|
212
|
-
error.code = "ESTALE_TARGET";
|
|
213
|
-
throw error;
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const mutate = (request) => {
|
|
218
|
-
let descriptor;
|
|
219
|
-
let claimedIdentity;
|
|
220
|
-
let claimedPath;
|
|
221
|
-
let createdIdentity;
|
|
222
|
-
let publishedIdentity;
|
|
223
|
-
let response = {};
|
|
224
|
-
let sourceDescriptor;
|
|
225
|
-
let writePath;
|
|
226
|
-
try {
|
|
227
|
-
assertParentIdentity();
|
|
228
|
-
if (request.operation === "read") {
|
|
229
|
-
descriptor = openSync(
|
|
230
|
-
request.target,
|
|
231
|
-
constants.O_RDONLY | (constants.O_NONBLOCK ?? 0) | (constants.O_NOFOLLOW ?? 0),
|
|
232
|
-
);
|
|
233
|
-
const opened = fstatSync(descriptor);
|
|
234
|
-
if (
|
|
235
|
-
!opened.isFile() ||
|
|
236
|
-
request.expectedTarget.kind !== "file" ||
|
|
237
|
-
opened.dev !== request.expectedTarget.device ||
|
|
238
|
-
opened.ino !== request.expectedTarget.inode
|
|
239
|
-
) {
|
|
240
|
-
const error = new Error("Confined read target changed before descriptor read.");
|
|
241
|
-
error.code = "ESTALE_TARGET";
|
|
242
|
-
throw error;
|
|
243
|
-
}
|
|
244
|
-
if (opened.size > request.maximumBytes) {
|
|
245
|
-
const error = new Error("Confined file exceeds the read limit.");
|
|
246
|
-
error.code = "EFBIG";
|
|
247
|
-
throw error;
|
|
248
|
-
}
|
|
249
|
-
const chunks = [];
|
|
250
|
-
let total = 0;
|
|
251
|
-
while (total <= request.maximumBytes) {
|
|
252
|
-
const chunk = Buffer.alloc(Math.min(64 * 1024, request.maximumBytes + 1 - total));
|
|
253
|
-
const bytesRead = readSync(descriptor, chunk, 0, chunk.length, null);
|
|
254
|
-
if (bytesRead === 0) break;
|
|
255
|
-
chunks.push(chunk.subarray(0, bytesRead));
|
|
256
|
-
total += bytesRead;
|
|
257
|
-
}
|
|
258
|
-
if (total > request.maximumBytes) {
|
|
259
|
-
const error = new Error("Confined file exceeds the read limit.");
|
|
260
|
-
error.code = "EFBIG";
|
|
261
|
-
throw error;
|
|
262
|
-
}
|
|
263
|
-
response = { content: Buffer.concat(chunks).toString("base64") };
|
|
264
|
-
closeSync(descriptor);
|
|
265
|
-
descriptor = undefined;
|
|
266
|
-
} else if (request.operation === "mkdir") {
|
|
267
|
-
const target = lstatSync(request.target, { throwIfNoEntry: false });
|
|
268
|
-
if (target === undefined) {
|
|
269
|
-
mkdirSync(request.target);
|
|
270
|
-
} else if (target.isSymbolicLink() || !target.isDirectory()) {
|
|
271
|
-
const error = new Error("Refusing to replace an unsafe confined directory.");
|
|
272
|
-
error.code = "EINVAL";
|
|
273
|
-
throw error;
|
|
274
|
-
}
|
|
275
|
-
} else if (request.operation === "acquire-lock") {
|
|
276
|
-
if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
|
|
277
|
-
const error = new Error("Confined publication lock already exists.");
|
|
278
|
-
error.code = "EEXIST";
|
|
279
|
-
throw error;
|
|
280
|
-
}
|
|
281
|
-
mkdirSync(request.target, 0o700);
|
|
282
|
-
const created = lstatSync(request.target);
|
|
283
|
-
createdIdentity = { device: created.dev, inode: created.ino };
|
|
284
|
-
writePath = request.target;
|
|
285
|
-
writeFileSync(request.target + "/" + request.ownerFile, request.ownerContent, {
|
|
286
|
-
flag: "wx",
|
|
287
|
-
mode: 0o600,
|
|
288
|
-
});
|
|
289
|
-
assertParentIdentity();
|
|
290
|
-
assertExpectedLeaf(request.target, { ...createdIdentity, kind: "directory" });
|
|
291
|
-
assertLockOwner(request);
|
|
292
|
-
response = { target: createdIdentity };
|
|
293
|
-
writePath = undefined;
|
|
294
|
-
createdIdentity = undefined;
|
|
295
|
-
} else if (request.operation === "write") {
|
|
296
|
-
const target = lstatSync(request.target, { throwIfNoEntry: false });
|
|
297
|
-
if (target !== undefined && (target.isSymbolicLink() || !target.isFile())) {
|
|
298
|
-
const error = new Error("Refusing to replace an unsafe confined target.");
|
|
299
|
-
error.code = "EINVAL";
|
|
300
|
-
throw error;
|
|
301
|
-
}
|
|
302
|
-
const expectedTarget = request.expectedTarget ??
|
|
303
|
-
(target === undefined
|
|
304
|
-
? { kind: "absent" }
|
|
305
|
-
: { device: target.dev, inode: target.ino, kind: leafKind(target) });
|
|
306
|
-
assertExpectedLeaf(request.target, expectedTarget);
|
|
307
|
-
writePath = request.temporary;
|
|
308
|
-
descriptor = openSync(
|
|
309
|
-
writePath,
|
|
310
|
-
constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | (constants.O_NOFOLLOW ?? 0),
|
|
311
|
-
target?.mode ?? 0o666,
|
|
312
|
-
);
|
|
313
|
-
const created = fstatSync(descriptor);
|
|
314
|
-
createdIdentity = { device: created.dev, inode: created.ino };
|
|
315
|
-
assertParentIdentity();
|
|
316
|
-
writeFileSync(descriptor, request.content);
|
|
317
|
-
if (target !== undefined) {
|
|
318
|
-
fchmodSync(descriptor, target.mode & 0o7777);
|
|
319
|
-
}
|
|
320
|
-
closeSync(descriptor);
|
|
321
|
-
descriptor = undefined;
|
|
322
|
-
assertParentIdentity();
|
|
323
|
-
assertExpectedLeaf(request.target, expectedTarget);
|
|
324
|
-
if (request.expectedContentSha256 !== undefined) {
|
|
325
|
-
if (lstatSync(request.claim, { throwIfNoEntry: false }) !== undefined) {
|
|
326
|
-
const error = new Error("Confined mutation claim path already exists.");
|
|
327
|
-
error.code = "EEXIST";
|
|
328
|
-
throw error;
|
|
329
|
-
}
|
|
330
|
-
renameSync(request.target, request.claim);
|
|
331
|
-
claimedIdentity = expectedTarget;
|
|
332
|
-
claimedPath = request.claim;
|
|
333
|
-
assertParentIdentity();
|
|
334
|
-
assertExpectedLeaf(request.claim, expectedTarget);
|
|
335
|
-
assertExpectedFileContent(
|
|
336
|
-
request.claim,
|
|
337
|
-
expectedTarget,
|
|
338
|
-
request.expectedContentSha256,
|
|
339
|
-
request.maximumBytes,
|
|
340
|
-
);
|
|
341
|
-
assertExpectedLeaf(request.target, { kind: "absent" });
|
|
342
|
-
if (lstatSync(request.publishedHold, { throwIfNoEntry: false }) !== undefined) {
|
|
343
|
-
const error = new Error("Confined mutation published hold path already exists.");
|
|
344
|
-
error.code = "EEXIST";
|
|
345
|
-
throw error;
|
|
346
|
-
}
|
|
347
|
-
linkSync(request.temporary, request.target);
|
|
348
|
-
publishedIdentity = createdIdentity;
|
|
349
|
-
unlinkSync(request.temporary);
|
|
350
|
-
writePath = undefined;
|
|
351
|
-
createdIdentity = undefined;
|
|
352
|
-
// Supported publication boundary.
|
|
353
|
-
// Both sides are exact. POSIX cannot exclude a non-cooperating writable descriptor later.
|
|
354
|
-
assertExpectedLeaf(request.claim, expectedTarget);
|
|
355
|
-
assertExpectedFileContent(
|
|
356
|
-
request.claim,
|
|
357
|
-
expectedTarget,
|
|
358
|
-
request.expectedContentSha256,
|
|
359
|
-
request.maximumBytes,
|
|
360
|
-
);
|
|
361
|
-
assertExpectedLeaf(request.target, { ...publishedIdentity, kind: "file" });
|
|
362
|
-
assertExpectedFileContent(
|
|
363
|
-
request.target,
|
|
364
|
-
publishedIdentity,
|
|
365
|
-
createHash("sha256").update(request.content).digest("hex"),
|
|
366
|
-
request.maximumBytes,
|
|
367
|
-
);
|
|
368
|
-
unlinkSync(request.claim);
|
|
369
|
-
claimedIdentity = undefined;
|
|
370
|
-
claimedPath = undefined;
|
|
371
|
-
publishedIdentity = undefined;
|
|
372
|
-
} else {
|
|
373
|
-
renameSync(request.temporary, request.target);
|
|
374
|
-
}
|
|
375
|
-
assertParentIdentity();
|
|
376
|
-
} else if (request.operation === "remove") {
|
|
377
|
-
assertExpectedLeaf(request.target, request.expectedTarget);
|
|
378
|
-
if (request.ownerEvidence !== undefined) assertLockOwner(request);
|
|
379
|
-
if (lstatSync(request.claim, { throwIfNoEntry: false }) !== undefined) {
|
|
380
|
-
const error = new Error("Confined removal claim path already exists.");
|
|
381
|
-
error.code = "EEXIST";
|
|
382
|
-
throw error;
|
|
383
|
-
}
|
|
384
|
-
renameSync(request.target, request.claim);
|
|
385
|
-
try {
|
|
386
|
-
assertParentIdentity();
|
|
387
|
-
assertExpectedLeaf(request.claim, request.expectedTarget);
|
|
388
|
-
if (request.ownerEvidence !== undefined) assertLockOwner(request, request.claim);
|
|
389
|
-
rmSync(request.claim, { force: true, recursive: request.recursive });
|
|
390
|
-
} catch (error) {
|
|
391
|
-
if (lstatSync(request.claim, { throwIfNoEntry: false }) !== undefined) {
|
|
392
|
-
try {
|
|
393
|
-
if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
|
|
394
|
-
const restorationError = new Error(
|
|
395
|
-
"Confined removal target was recreated before claim restoration.",
|
|
396
|
-
);
|
|
397
|
-
restorationError.code = "ESTALE_TARGET";
|
|
398
|
-
throw restorationError;
|
|
399
|
-
}
|
|
400
|
-
const claim = lstatSync(request.claim);
|
|
401
|
-
if (claim.isFile()) {
|
|
402
|
-
linkSync(request.claim, request.target);
|
|
403
|
-
unlinkSync(request.claim);
|
|
404
|
-
} else {
|
|
405
|
-
renameSync(request.claim, request.target);
|
|
406
|
-
}
|
|
407
|
-
} catch (cause) {
|
|
408
|
-
const restorationError = new Error(
|
|
409
|
-
"Confined removal could not restore its claimed target.",
|
|
410
|
-
{ cause },
|
|
411
|
-
);
|
|
412
|
-
restorationError.backup = request.claim;
|
|
413
|
-
restorationError.code = "ESTALE_TARGET";
|
|
414
|
-
throw restorationError;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
throw error;
|
|
418
|
-
}
|
|
419
|
-
assertParentIdentity();
|
|
420
|
-
} else if (request.operation === "symlink") {
|
|
421
|
-
if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
|
|
422
|
-
const error = new Error("Confined symlink target already exists.");
|
|
423
|
-
error.code = "EEXIST";
|
|
424
|
-
throw error;
|
|
425
|
-
}
|
|
426
|
-
symlinkSync(request.linkTarget, request.target, request.type);
|
|
427
|
-
assertParentIdentity();
|
|
428
|
-
} else if (request.operation === "copy") {
|
|
429
|
-
assertExpectedLeaf(request.target, request.expectedTarget);
|
|
430
|
-
if (request.recursive) {
|
|
431
|
-
mkdirSync(request.target);
|
|
432
|
-
const created = lstatSync(request.target);
|
|
433
|
-
createdIdentity = { device: created.dev, inode: created.ino };
|
|
434
|
-
writePath = request.target;
|
|
435
|
-
copyIntoClaimedDirectory(request, createdIdentity);
|
|
436
|
-
assertParentIdentity();
|
|
437
|
-
assertExpectedLeaf(request.target, { ...createdIdentity, kind: "directory" });
|
|
438
|
-
} else {
|
|
439
|
-
sourceDescriptor = openSync(
|
|
440
|
-
request.source,
|
|
441
|
-
constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),
|
|
442
|
-
);
|
|
443
|
-
const source = fstatSync(sourceDescriptor);
|
|
444
|
-
if (!source.isFile()) {
|
|
445
|
-
const error = new Error("Confined copy source is not a regular file.");
|
|
446
|
-
error.code = "EINVAL";
|
|
447
|
-
throw error;
|
|
448
|
-
}
|
|
449
|
-
writePath = request.target;
|
|
450
|
-
descriptor = openSync(
|
|
451
|
-
request.target,
|
|
452
|
-
constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY,
|
|
453
|
-
source.mode,
|
|
454
|
-
);
|
|
455
|
-
const created = fstatSync(descriptor);
|
|
456
|
-
createdIdentity = { device: created.dev, inode: created.ino };
|
|
457
|
-
const buffer = Buffer.alloc(64 * 1024);
|
|
458
|
-
for (;;) {
|
|
459
|
-
const bytesRead = readSync(sourceDescriptor, buffer, 0, buffer.length, null);
|
|
460
|
-
if (bytesRead === 0) break;
|
|
461
|
-
let offset = 0;
|
|
462
|
-
while (offset < bytesRead) {
|
|
463
|
-
offset += writeSync(descriptor, buffer, offset, bytesRead - offset);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
fchmodSync(descriptor, source.mode & 0o7777);
|
|
467
|
-
closeSync(descriptor);
|
|
468
|
-
descriptor = undefined;
|
|
469
|
-
closeSync(sourceDescriptor);
|
|
470
|
-
sourceDescriptor = undefined;
|
|
471
|
-
}
|
|
472
|
-
writePath = undefined;
|
|
473
|
-
createdIdentity = undefined;
|
|
474
|
-
assertParentIdentity();
|
|
475
|
-
}
|
|
476
|
-
return response;
|
|
477
|
-
} catch (error) {
|
|
478
|
-
if (descriptor !== undefined) {
|
|
479
|
-
closeSync(descriptor);
|
|
480
|
-
}
|
|
481
|
-
if (sourceDescriptor !== undefined) {
|
|
482
|
-
closeSync(sourceDescriptor);
|
|
483
|
-
}
|
|
484
|
-
if (publishedIdentity !== undefined) {
|
|
485
|
-
const publishedTarget = lstatSync(request.target, { throwIfNoEntry: false });
|
|
486
|
-
if (publishedTarget !== undefined) {
|
|
487
|
-
if (lstatSync(request.publishedHold, { throwIfNoEntry: false }) !== undefined) {
|
|
488
|
-
// A private-path collision is not producer-owned. Leave both public and claimed paths.
|
|
489
|
-
} else {
|
|
490
|
-
renameSync(request.target, request.publishedHold);
|
|
491
|
-
const heldTarget = lstatSync(request.publishedHold);
|
|
492
|
-
if (
|
|
493
|
-
heldTarget.dev === publishedIdentity.device &&
|
|
494
|
-
heldTarget.ino === publishedIdentity.inode
|
|
495
|
-
) {
|
|
496
|
-
unlinkSync(request.publishedHold);
|
|
497
|
-
} else {
|
|
498
|
-
try {
|
|
499
|
-
if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
|
|
500
|
-
throw new Error(
|
|
501
|
-
"Confined mutation target was recreated before published-path restoration.",
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
linkSync(request.publishedHold, request.target);
|
|
505
|
-
unlinkSync(request.publishedHold);
|
|
506
|
-
} catch {
|
|
507
|
-
error.backup ??= request.publishedHold;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
publishedIdentity = undefined;
|
|
513
|
-
}
|
|
514
|
-
if (claimedPath !== undefined && claimedIdentity !== undefined) {
|
|
515
|
-
const claim = lstatSync(claimedPath, { throwIfNoEntry: false });
|
|
516
|
-
if (
|
|
517
|
-
claim !== undefined &&
|
|
518
|
-
claim.dev === claimedIdentity.device &&
|
|
519
|
-
claim.ino === claimedIdentity.inode
|
|
520
|
-
) {
|
|
521
|
-
try {
|
|
522
|
-
if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
|
|
523
|
-
throw new Error("Confined mutation target was recreated before claim restoration.");
|
|
524
|
-
}
|
|
525
|
-
linkSync(claimedPath, request.target);
|
|
526
|
-
unlinkSync(claimedPath);
|
|
527
|
-
claimedPath = undefined;
|
|
528
|
-
} catch {
|
|
529
|
-
error.backup ??= claimedPath;
|
|
530
|
-
}
|
|
531
|
-
} else if (claim !== undefined) {
|
|
532
|
-
error.backup ??= claimedPath;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
if (writePath !== undefined && createdIdentity !== undefined) {
|
|
536
|
-
const current = lstatSync(writePath, { throwIfNoEntry: false });
|
|
537
|
-
if (
|
|
538
|
-
current !== undefined &&
|
|
539
|
-
current.dev === createdIdentity.device &&
|
|
540
|
-
current.ino === createdIdentity.inode
|
|
541
|
-
) {
|
|
542
|
-
rmSync(writePath, {
|
|
543
|
-
force: true,
|
|
544
|
-
recursive:
|
|
545
|
-
request.operation === "acquire-lock" ||
|
|
546
|
-
(request.operation === "copy" && request.recursive === true),
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
throw error;
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
const lines = createInterface({ input: process.stdin });
|
|
555
|
-
for await (const line of lines) {
|
|
556
|
-
try {
|
|
557
|
-
const response = mutate(JSON.parse(line));
|
|
558
|
-
process.stdout.write(JSON.stringify({ ok: true, ...response }) + "\n");
|
|
559
|
-
} catch (error) {
|
|
560
|
-
process.stdout.write(JSON.stringify({
|
|
561
|
-
ok: false,
|
|
562
|
-
backup: error && typeof error === "object" && "backup" in error ? error.backup : undefined,
|
|
563
|
-
code: error && typeof error === "object" && "code" in error ? error.code : undefined,
|
|
564
|
-
message: error instanceof Error ? error.message : String(error),
|
|
565
|
-
}) + "\n");
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
`;
|
|
569
|
-
|
|
570
|
-
const confinedMutationEnvironment = Object.fromEntries(
|
|
571
|
-
["SystemRoot", "WINDIR"].flatMap((key) => {
|
|
572
|
-
const value = process.env[key];
|
|
573
|
-
return value === undefined ? [] : [[key, value]];
|
|
574
|
-
}),
|
|
575
|
-
);
|
|
576
|
-
|
|
577
|
-
const mutationWorkers = new Map();
|
|
578
|
-
const maximumMutationWorkers = 8;
|
|
579
|
-
let mutationWorkerReservations = 0;
|
|
580
|
-
const mutationWorkerCapacityWaiters = [];
|
|
581
|
-
const mutationWorkerExits = new Set();
|
|
582
|
-
|
|
583
|
-
function grantMutationWorkerCapacity() {
|
|
584
|
-
while (
|
|
585
|
-
mutationWorkers.size + mutationWorkerReservations < maximumMutationWorkers &&
|
|
586
|
-
mutationWorkerCapacityWaiters.length > 0
|
|
587
|
-
) {
|
|
588
|
-
mutationWorkerReservations += 1;
|
|
589
|
-
mutationWorkerCapacityWaiters.shift()();
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
function evictIdleMutationWorker() {
|
|
594
|
-
for (const worker of mutationWorkers.values()) {
|
|
595
|
-
if (worker.pending.length === 0 && !worker.closing) {
|
|
596
|
-
closeMutationWorker(worker);
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
async function acquireMutationWorkerCapacity() {
|
|
603
|
-
if (mutationWorkers.size + mutationWorkerReservations < maximumMutationWorkers) {
|
|
604
|
-
mutationWorkerReservations += 1;
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
evictIdleMutationWorker();
|
|
608
|
-
await new Promise((resolve) => mutationWorkerCapacityWaiters.push(resolve));
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
function releaseMutationWorkerCapacity() {
|
|
612
|
-
mutationWorkerReservations -= 1;
|
|
613
|
-
grantMutationWorkerCapacity();
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
function closeMutationWorker(worker) {
|
|
617
|
-
if (mutationWorkers.get(worker.key) !== worker || worker.closing) return;
|
|
618
|
-
worker.closing = true;
|
|
619
|
-
if (!worker.child.stdin.destroyed) worker.child.stdin.end();
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
function scheduleMutationWorkerClose(worker) {
|
|
623
|
-
if (worker.pending.length > 0 || worker.closing) return;
|
|
624
|
-
if (worker.idleTimer !== undefined) clearTimeout(worker.idleTimer);
|
|
625
|
-
worker.idleTimer = setTimeout(() => closeMutationWorker(worker), 25);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
function createMutationWorker(parentDirectory, parentIdentity, key) {
|
|
629
|
-
const child = spawn(
|
|
630
|
-
process.execPath,
|
|
631
|
-
["--input-type=module", "--eval", confinedMutationScript, JSON.stringify(parentIdentity)],
|
|
632
|
-
{
|
|
633
|
-
cwd: parentDirectory,
|
|
634
|
-
env: confinedMutationEnvironment,
|
|
635
|
-
stdio: ["pipe", "pipe", "ignore"],
|
|
636
|
-
},
|
|
637
|
-
);
|
|
638
|
-
const pending = [];
|
|
639
|
-
let terminalError;
|
|
640
|
-
let resolveExited;
|
|
641
|
-
let exitSettled = false;
|
|
642
|
-
const exited = new Promise((resolve) => {
|
|
643
|
-
resolveExited = resolve;
|
|
644
|
-
});
|
|
645
|
-
mutationWorkerExits.add(exited);
|
|
646
|
-
void exited.then(() => mutationWorkerExits.delete(exited));
|
|
647
|
-
const worker = {
|
|
648
|
-
child,
|
|
649
|
-
closing: false,
|
|
650
|
-
exited,
|
|
651
|
-
idleTimer: undefined,
|
|
652
|
-
key,
|
|
653
|
-
pending,
|
|
654
|
-
request(request) {
|
|
655
|
-
if (terminalError !== undefined) return Promise.reject(terminalError);
|
|
656
|
-
return new Promise((resolve, reject) => {
|
|
657
|
-
pending.push({ reject, resolve });
|
|
658
|
-
child.stdin.write(`${JSON.stringify(request)}\n`, (error) => {
|
|
659
|
-
if (error !== null && error !== undefined) fail(error);
|
|
660
|
-
});
|
|
661
|
-
});
|
|
662
|
-
},
|
|
663
|
-
get terminalError() {
|
|
664
|
-
return terminalError;
|
|
665
|
-
},
|
|
666
|
-
};
|
|
667
|
-
const settleExit = () => {
|
|
668
|
-
if (exitSettled) return;
|
|
669
|
-
exitSettled = true;
|
|
670
|
-
if (worker.idleTimer !== undefined) clearTimeout(worker.idleTimer);
|
|
671
|
-
if (mutationWorkers.get(key) === worker) {
|
|
672
|
-
mutationWorkers.delete(key);
|
|
673
|
-
grantMutationWorkerCapacity();
|
|
674
|
-
}
|
|
675
|
-
resolveExited();
|
|
676
|
-
};
|
|
677
|
-
const fail = (error) => {
|
|
678
|
-
terminalError ??= error;
|
|
679
|
-
while (pending.length > 0) pending.shift().reject(error);
|
|
680
|
-
};
|
|
681
|
-
child.once("error", (error) => {
|
|
682
|
-
fail(error);
|
|
683
|
-
settleExit();
|
|
684
|
-
});
|
|
685
|
-
child.once("exit", (code) => {
|
|
686
|
-
if (code !== 0 || pending.length > 0) {
|
|
687
|
-
fail(new Error(`Confined filesystem mutation worker exited with ${code}.`));
|
|
688
|
-
}
|
|
689
|
-
settleExit();
|
|
690
|
-
});
|
|
691
|
-
child.stdout.setEncoding("utf-8");
|
|
692
|
-
createInterface({ input: child.stdout }).on("line", (line) => {
|
|
693
|
-
const waiter = pending.shift();
|
|
694
|
-
if (waiter === undefined) return;
|
|
695
|
-
try {
|
|
696
|
-
waiter.resolve(JSON.parse(line));
|
|
697
|
-
} catch (error) {
|
|
698
|
-
waiter.reject(error);
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
mutationWorkers.set(key, worker);
|
|
702
|
-
return worker;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
async function runStableMutation(parentDirectory, request, content) {
|
|
706
|
-
const key = `${parentDirectory}\0${request.parent.device}:${request.parent.inode}`;
|
|
707
|
-
let worker = mutationWorkers.get(key);
|
|
708
|
-
if (worker === undefined || worker.closing || worker.terminalError !== undefined) {
|
|
709
|
-
await acquireMutationWorkerCapacity();
|
|
710
|
-
try {
|
|
711
|
-
worker = mutationWorkers.get(key);
|
|
712
|
-
if (worker === undefined || worker.closing || worker.terminalError !== undefined) {
|
|
713
|
-
worker = createMutationWorker(parentDirectory, request.parent, key);
|
|
714
|
-
}
|
|
715
|
-
} finally {
|
|
716
|
-
releaseMutationWorkerCapacity();
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
if (worker.idleTimer !== undefined) {
|
|
720
|
-
clearTimeout(worker.idleTimer);
|
|
721
|
-
worker.idleTimer = undefined;
|
|
722
|
-
}
|
|
723
|
-
let result;
|
|
724
|
-
try {
|
|
725
|
-
result = await worker.request({
|
|
726
|
-
...request,
|
|
727
|
-
...(content === undefined ? {} : { content }),
|
|
728
|
-
});
|
|
729
|
-
} finally {
|
|
730
|
-
scheduleMutationWorkerClose(worker);
|
|
731
|
-
}
|
|
732
|
-
if (!result.ok) {
|
|
733
|
-
const backupPath =
|
|
734
|
-
result.backup === undefined ? undefined : path.join(parentDirectory, result.backup);
|
|
735
|
-
const error = new Error(
|
|
736
|
-
`${result.message ?? "Confined filesystem mutation failed."}${
|
|
737
|
-
backupPath === undefined ? "" : ` Retained backup: ${backupPath}.`
|
|
738
|
-
}`,
|
|
739
|
-
);
|
|
740
|
-
if (result.code !== undefined) {
|
|
741
|
-
Object.assign(error, { code: result.code });
|
|
742
|
-
}
|
|
743
|
-
if (backupPath !== undefined) {
|
|
744
|
-
Object.assign(error, { backupPath });
|
|
745
|
-
}
|
|
746
|
-
throw error;
|
|
747
|
-
}
|
|
748
|
-
return result;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
async function closeMutationWorkers() {
|
|
752
|
-
for (const worker of mutationWorkers.values()) closeMutationWorker(worker);
|
|
753
|
-
const exits = [...mutationWorkerExits];
|
|
754
|
-
await Promise.all(exits);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
function isOutsideRoot(relativePath) {
|
|
758
|
-
return (
|
|
759
|
-
relativePath === ".." ||
|
|
760
|
-
relativePath.startsWith(`..${path.sep}`) ||
|
|
761
|
-
path.isAbsolute(relativePath)
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
async function lstatOrNull(targetPath) {
|
|
766
|
-
return lstat(targetPath).catch((error) => {
|
|
767
|
-
if (error?.code === "ENOENT") return null;
|
|
768
|
-
throw error;
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
function confinedRelativePath(targetPath, operation) {
|
|
773
|
-
const relativeTarget = path.relative(repoRoot, path.resolve(targetPath));
|
|
774
|
-
if (relativeTarget.length === 0 || isOutsideRoot(relativeTarget)) {
|
|
775
|
-
throw new Error(`Refusing to ${operation} outside ${repoRoot}`);
|
|
776
|
-
}
|
|
777
|
-
return relativeTarget;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
async function captureRepoRootIdentity(operation) {
|
|
781
|
-
const root = await lstatOrNull(repoRoot);
|
|
782
|
-
if (root === null || root.isSymbolicLink() || !root.isDirectory()) {
|
|
783
|
-
throw new Error(`Refusing to ${operation} through changed root ${repoRoot}`);
|
|
784
|
-
}
|
|
785
|
-
return { device: root.dev, inode: root.ino };
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
function repoRootIdentityForOperation(operation) {
|
|
789
|
-
if (operationRepoRootIdentity === undefined) {
|
|
790
|
-
throw new Error(`Confined filesystem session is not initialized for ${operation}`);
|
|
791
|
-
}
|
|
792
|
-
return operationRepoRootIdentity;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
async function assertRepoRootIdentity(expected, operation) {
|
|
796
|
-
const current = await lstatOrNull(repoRoot);
|
|
797
|
-
if (
|
|
798
|
-
current === null ||
|
|
799
|
-
current.isSymbolicLink() ||
|
|
800
|
-
!current.isDirectory() ||
|
|
801
|
-
current.dev !== expected.device ||
|
|
802
|
-
current.ino !== expected.inode
|
|
803
|
-
) {
|
|
804
|
-
throw new Error(`Refusing to ${operation} through changed root ${repoRoot}`);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
async function captureLeafExpectation(targetPath) {
|
|
809
|
-
const target = await lstatOrNull(targetPath);
|
|
810
|
-
if (target === null) return { kind: "absent" };
|
|
811
|
-
return {
|
|
812
|
-
device: target.dev,
|
|
813
|
-
inode: target.ino,
|
|
814
|
-
kind: target.isSymbolicLink()
|
|
815
|
-
? "symlink"
|
|
816
|
-
: target.isFile()
|
|
817
|
-
? "file"
|
|
818
|
-
: target.isDirectory()
|
|
819
|
-
? "directory"
|
|
820
|
-
: "other",
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
async function assertConfinedDirectoryComponents(components, operation, repoRootIdentity) {
|
|
825
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
826
|
-
const resolvedRoot = await realpath(repoRoot);
|
|
827
|
-
let currentDirectory = repoRoot;
|
|
828
|
-
for (const component of components) {
|
|
829
|
-
currentDirectory = path.join(currentDirectory, component);
|
|
830
|
-
const entry = await lstatOrNull(currentDirectory);
|
|
831
|
-
if (entry === null) break;
|
|
832
|
-
if (
|
|
833
|
-
entry.isSymbolicLink() ||
|
|
834
|
-
!entry.isDirectory() ||
|
|
835
|
-
isOutsideRoot(path.relative(resolvedRoot, await realpath(currentDirectory)))
|
|
836
|
-
) {
|
|
837
|
-
throw new Error(`Refusing to ${operation} through ${currentDirectory}`);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
async function assertConfinedRegularFile(targetPath, suppliedRepoRootIdentity) {
|
|
844
|
-
const operation = "write scaffold content";
|
|
845
|
-
const repoRootIdentity = suppliedRepoRootIdentity ?? repoRootIdentityForOperation(operation);
|
|
846
|
-
const relativeTarget = confinedRelativePath(targetPath, "write scaffold content");
|
|
847
|
-
await assertConfinedDirectoryComponents(
|
|
848
|
-
relativeTarget.split(path.sep).slice(0, -1),
|
|
849
|
-
operation,
|
|
850
|
-
repoRootIdentity,
|
|
851
|
-
);
|
|
852
|
-
|
|
853
|
-
const target = await lstatOrNull(targetPath);
|
|
854
|
-
if (target !== null && (target.isSymbolicLink() || !target.isFile())) {
|
|
855
|
-
throw new Error(`Refusing to replace unsafe scaffold file ${targetPath}`);
|
|
856
|
-
}
|
|
857
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
858
|
-
return target;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
async function captureConfinedDirectoryIdentity(directoryPath, operation, repoRootIdentity) {
|
|
862
|
-
const relativeDirectory = path.relative(repoRoot, path.resolve(directoryPath));
|
|
863
|
-
if (isOutsideRoot(relativeDirectory)) {
|
|
864
|
-
throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
|
|
865
|
-
}
|
|
866
|
-
await assertConfinedDirectoryComponents(
|
|
867
|
-
relativeDirectory.split(path.sep).filter(Boolean),
|
|
868
|
-
operation,
|
|
869
|
-
repoRootIdentity,
|
|
870
|
-
);
|
|
871
|
-
const entry = await lstatOrNull(directoryPath);
|
|
872
|
-
if (entry === null || entry.isSymbolicLink() || !entry.isDirectory()) {
|
|
873
|
-
throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
|
|
874
|
-
}
|
|
875
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
876
|
-
return { device: entry.dev, inode: entry.ino };
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
async function assertSameDirectoryIdentity(directoryPath, expected, operation, repoRootIdentity) {
|
|
880
|
-
const current = await captureConfinedDirectoryIdentity(
|
|
881
|
-
directoryPath,
|
|
882
|
-
operation,
|
|
883
|
-
repoRootIdentity,
|
|
884
|
-
);
|
|
885
|
-
if (current.device !== expected.device || current.inode !== expected.inode) {
|
|
886
|
-
throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
async function ensureConfinedDirectory(directoryPath, suppliedRepoRootIdentity) {
|
|
891
|
-
const operation = "create scaffold directories";
|
|
892
|
-
const repoRootIdentity = suppliedRepoRootIdentity ?? repoRootIdentityForOperation(operation);
|
|
893
|
-
if (path.resolve(directoryPath) === repoRoot) {
|
|
894
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
895
|
-
return;
|
|
896
|
-
}
|
|
897
|
-
const relativeDirectory = confinedRelativePath(directoryPath, operation);
|
|
898
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
899
|
-
const resolvedRoot = await realpath(repoRoot);
|
|
900
|
-
let currentDirectory = repoRoot;
|
|
901
|
-
for (const component of relativeDirectory.split(path.sep)) {
|
|
902
|
-
const parentDirectory = currentDirectory;
|
|
903
|
-
currentDirectory = path.join(currentDirectory, component);
|
|
904
|
-
let entry = await lstatOrNull(currentDirectory);
|
|
905
|
-
if (entry === null) {
|
|
906
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
907
|
-
parentDirectory,
|
|
908
|
-
operation,
|
|
909
|
-
repoRootIdentity,
|
|
910
|
-
);
|
|
911
|
-
await runStableMutation(parentDirectory, {
|
|
912
|
-
operation: "mkdir",
|
|
913
|
-
parent: parentIdentity,
|
|
914
|
-
target: component,
|
|
915
|
-
});
|
|
916
|
-
await assertSameDirectoryIdentity(
|
|
917
|
-
parentDirectory,
|
|
918
|
-
parentIdentity,
|
|
919
|
-
operation,
|
|
920
|
-
repoRootIdentity,
|
|
921
|
-
);
|
|
922
|
-
entry = await lstat(currentDirectory);
|
|
923
|
-
}
|
|
924
|
-
if (
|
|
925
|
-
entry.isSymbolicLink() ||
|
|
926
|
-
!entry.isDirectory() ||
|
|
927
|
-
isOutsideRoot(path.relative(resolvedRoot, await realpath(currentDirectory)))
|
|
928
|
-
) {
|
|
929
|
-
throw new Error(`Refusing to create scaffold content through ${currentDirectory}`);
|
|
930
|
-
}
|
|
931
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
async function removeConfinedPath(targetPath, options = {}) {
|
|
936
|
-
const operation = "remove scaffold content";
|
|
937
|
-
const repoRootIdentity = repoRootIdentityForOperation(operation);
|
|
938
|
-
const relativeTarget = confinedRelativePath(targetPath, operation);
|
|
939
|
-
await assertConfinedDirectoryComponents(
|
|
940
|
-
relativeTarget.split(path.sep).slice(0, -1),
|
|
941
|
-
operation,
|
|
942
|
-
repoRootIdentity,
|
|
943
|
-
);
|
|
944
|
-
const expectedTarget = options.expectedTarget ?? (await captureLeafExpectation(targetPath));
|
|
945
|
-
if (expectedTarget.kind === "absent") {
|
|
946
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
947
|
-
return;
|
|
948
|
-
}
|
|
949
|
-
const parentDirectory = path.dirname(targetPath);
|
|
950
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
951
|
-
parentDirectory,
|
|
952
|
-
operation,
|
|
953
|
-
repoRootIdentity,
|
|
954
|
-
);
|
|
955
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
956
|
-
await runStableMutation(parentDirectory, {
|
|
957
|
-
claim: `.hi-remove-${randomUUID()}`,
|
|
958
|
-
expectedTarget,
|
|
959
|
-
operation: "remove",
|
|
960
|
-
...(options.ownerEvidence === undefined
|
|
961
|
-
? {}
|
|
962
|
-
: {
|
|
963
|
-
maximumBytes: 4096,
|
|
964
|
-
ownerEvidence: options.ownerEvidence,
|
|
965
|
-
ownerFile: publicationLockOwnerFile,
|
|
966
|
-
}),
|
|
967
|
-
parent: parentIdentity,
|
|
968
|
-
recursive: options.recursive === true,
|
|
969
|
-
target: path.basename(targetPath),
|
|
970
|
-
});
|
|
971
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
async function writeConfinedTextFile(targetPath, content, expectedTarget, expectedContentSha256) {
|
|
975
|
-
const operation = "write scaffold content";
|
|
976
|
-
const repoRootIdentity = repoRootIdentityForOperation(operation);
|
|
977
|
-
await assertConfinedRegularFile(targetPath, repoRootIdentity);
|
|
978
|
-
const parentDirectory = path.dirname(targetPath);
|
|
979
|
-
await ensureConfinedDirectory(parentDirectory, repoRootIdentity);
|
|
980
|
-
await assertConfinedRegularFile(targetPath, repoRootIdentity);
|
|
981
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
982
|
-
parentDirectory,
|
|
983
|
-
operation,
|
|
984
|
-
repoRootIdentity,
|
|
985
|
-
);
|
|
986
|
-
|
|
987
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
988
|
-
await runStableMutation(
|
|
989
|
-
parentDirectory,
|
|
990
|
-
{
|
|
991
|
-
operation: "write",
|
|
992
|
-
parent: parentIdentity,
|
|
993
|
-
target: path.basename(targetPath),
|
|
994
|
-
temporary: `.hi-${randomUUID()}.tmp`,
|
|
995
|
-
...(expectedTarget === undefined ? {} : { expectedTarget }),
|
|
996
|
-
...(expectedContentSha256 === undefined
|
|
997
|
-
? {}
|
|
998
|
-
: {
|
|
999
|
-
claim: `.hi-manifest-claim-${randomUUID()}.tmp`,
|
|
1000
|
-
expectedContentSha256,
|
|
1001
|
-
maximumBytes: maximumConfinedFileBytes,
|
|
1002
|
-
publishedHold: `.hi-manifest-published-${randomUUID()}.tmp`,
|
|
1003
|
-
}),
|
|
1004
|
-
},
|
|
1005
|
-
content,
|
|
1006
|
-
);
|
|
1007
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
async function readConfinedRegularFile(targetPath, maximumBytes = maximumConfinedFileBytes) {
|
|
1011
|
-
const operation = "read scaffold content";
|
|
1012
|
-
const repoRootIdentity = repoRootIdentityForOperation(operation);
|
|
1013
|
-
const target = await assertConfinedRegularFile(targetPath, repoRootIdentity);
|
|
1014
|
-
if (target === null) {
|
|
1015
|
-
await assertRepoRootIdentity(repoRootIdentity, operation);
|
|
1016
|
-
return null;
|
|
1017
|
-
}
|
|
1018
|
-
const parentDirectory = path.dirname(targetPath);
|
|
1019
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
1020
|
-
parentDirectory,
|
|
1021
|
-
operation,
|
|
1022
|
-
repoRootIdentity,
|
|
1023
|
-
);
|
|
1024
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
1025
|
-
try {
|
|
1026
|
-
const result = await runStableMutation(parentDirectory, {
|
|
1027
|
-
expectedTarget: {
|
|
1028
|
-
device: target.dev,
|
|
1029
|
-
inode: target.ino,
|
|
1030
|
-
kind: "file",
|
|
1031
|
-
},
|
|
1032
|
-
maximumBytes,
|
|
1033
|
-
operation: "read",
|
|
1034
|
-
parent: parentIdentity,
|
|
1035
|
-
target: path.basename(targetPath),
|
|
1036
|
-
});
|
|
1037
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
1038
|
-
if (typeof result.content !== "string") {
|
|
1039
|
-
throw new Error("Confined filesystem read returned no content.");
|
|
1040
|
-
}
|
|
1041
|
-
return Buffer.from(result.content, "base64");
|
|
1042
|
-
} catch (error) {
|
|
1043
|
-
await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
|
|
1044
|
-
if (error?.code === "ENOENT") return null;
|
|
1045
|
-
throw error;
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
const codexDir = path.join(repoRoot, ".codex");
|
|
1050
|
-
const codexAgentsDir = path.join(codexDir, "agents");
|
|
1051
|
-
const codexHooksDir = path.join(codexDir, "hooks");
|
|
1052
|
-
const codexConfigPath = path.join(codexDir, "config.toml");
|
|
1053
|
-
const codexAgentsMirrorPath = path.join(codexDir, "AGENTS.md");
|
|
1054
|
-
|
|
1055
|
-
const claudeDir = path.join(repoRoot, ".claude");
|
|
1056
|
-
const claudeAgentsDir = path.join(claudeDir, "agents");
|
|
1057
|
-
const claudeHooksDir = path.join(claudeDir, "hooks");
|
|
1058
|
-
const claudeSettingsPath = path.join(claudeDir, "settings.json");
|
|
1059
|
-
const claudeAgentsMirrorPath = path.join(claudeDir, "CLAUDE.md");
|
|
1060
|
-
const claudeSkillsMirrorPath = path.join(claudeDir, "skills");
|
|
1061
|
-
|
|
1062
|
-
const cursorDir = path.join(repoRoot, ".cursor");
|
|
1063
|
-
const cursorAgentsDir = path.join(cursorDir, "agents");
|
|
1064
|
-
const cursorHooksDir = path.join(cursorDir, "hooks");
|
|
1065
|
-
const cursorHooksJsonPath = path.join(cursorDir, "hooks.json");
|
|
1066
|
-
|
|
1067
|
-
const opencodeDir = path.join(repoRoot, ".opencode");
|
|
1068
|
-
const opencodeAgentsDir = path.join(opencodeDir, "agents");
|
|
1069
|
-
const opencodePluginsDir = path.join(opencodeDir, "plugins");
|
|
1070
|
-
const opencodeAgentsMirrorPath = path.join(opencodeDir, "AGENTS.md");
|
|
1071
|
-
const opencodeConfigPath = path.join(repoRoot, "opencode.json");
|
|
1072
|
-
|
|
1073
|
-
const managedHeader = [
|
|
1074
|
-
"# Generated by scripts/sync-subagents.mjs.",
|
|
1075
|
-
"# Do not edit by hand; update .agents/subagents/manifest.mjs and re-run sync.",
|
|
1076
|
-
].join("\n");
|
|
1077
|
-
const claudeManagedComment =
|
|
1078
|
-
"<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
|
|
1079
|
-
const cursorManagedComment =
|
|
1080
|
-
"<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
|
|
1081
|
-
const opencodeManagedComment =
|
|
1082
|
-
"<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
|
|
1083
|
-
const claudeUpdateCheckCommand =
|
|
1084
|
-
'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/scaffold-update-check.mjs claude';
|
|
1085
|
-
const claudeFormatCommand =
|
|
1086
|
-
'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/format-edited-file.mjs claude';
|
|
1087
|
-
|
|
1088
|
-
function buildCodexAgentConfig({ hasFormatHook, hasUpdateCheckHook }) {
|
|
1089
|
-
const lines = ["[agents]", "max_depth = 1", "", "[features]", "hooks = true", "", "[hooks]"];
|
|
1090
|
-
|
|
1091
|
-
if (hasFormatHook || hasUpdateCheckHook) {
|
|
1092
|
-
const sessionStartHooks = [];
|
|
1093
|
-
if (hasUpdateCheckHook) {
|
|
1094
|
-
sessionStartHooks.push(
|
|
1095
|
-
' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/scaffold-update-check.mjs\\" codex", statusMessage = "Checking Harness scaffold", timeout = 60 },',
|
|
1096
|
-
);
|
|
1097
|
-
}
|
|
1098
|
-
if (hasFormatHook) {
|
|
1099
|
-
sessionStartHooks.push(
|
|
1100
|
-
' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" session-start", statusMessage = "Capturing edited-file baseline", timeout = 30 },',
|
|
1101
|
-
);
|
|
1102
|
-
}
|
|
1103
|
-
lines.push(
|
|
1104
|
-
"SessionStart = [",
|
|
1105
|
-
' { matcher = "startup|resume", hooks = [',
|
|
1106
|
-
...sessionStartHooks,
|
|
1107
|
-
" ] },",
|
|
1108
|
-
"]",
|
|
1109
|
-
);
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
if (hasFormatHook) {
|
|
1113
|
-
lines.push(
|
|
1114
|
-
"PostToolUse = [",
|
|
1115
|
-
' { matcher = "Bash|apply_patch|.*apply.?patch.*|edit|write|multiedit", hooks = [',
|
|
1116
|
-
' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" post", statusMessage = "Auto-formatting edited files", timeout = 30 },',
|
|
1117
|
-
" ] },",
|
|
1118
|
-
"]",
|
|
1119
|
-
);
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
lines.push("");
|
|
1123
|
-
return lines.join("\n");
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
function isObject(value) {
|
|
1127
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
function removeClaudeHookCommand(entries, command) {
|
|
1131
|
-
if (!Array.isArray(entries)) {
|
|
1132
|
-
return [];
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
return entries.flatMap((entry) => {
|
|
1136
|
-
if (!isObject(entry) || !Array.isArray(entry.hooks)) {
|
|
1137
|
-
return [entry];
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
const hooks = entry.hooks.filter((hook) => !isObject(hook) || hook.command !== command);
|
|
1141
|
-
return hooks.length === 0 ? [] : [{ ...entry, hooks }];
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
function setClaudeHookEntries(hooks, key, entries) {
|
|
1146
|
-
if (entries.length > 0) {
|
|
1147
|
-
hooks[key] = entries;
|
|
1148
|
-
} else {
|
|
1149
|
-
delete hooks[key];
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
function buildClaudeSettingsConfig(existingConfig, { hasFormatHook, hasUpdateCheckHook }) {
|
|
1154
|
-
const config = isObject(existingConfig) ? existingConfig : {};
|
|
1155
|
-
const existingHooks = isObject(config.hooks) ? config.hooks : {};
|
|
1156
|
-
const hooks = { ...existingHooks };
|
|
1157
|
-
const sessionStartHooks = removeClaudeHookCommand(
|
|
1158
|
-
existingHooks.SessionStart,
|
|
1159
|
-
claudeUpdateCheckCommand,
|
|
1160
|
-
);
|
|
1161
|
-
const postToolUseHooks = removeClaudeHookCommand(existingHooks.PostToolUse, claudeFormatCommand);
|
|
1162
|
-
|
|
1163
|
-
if (hasUpdateCheckHook) {
|
|
1164
|
-
hooks.SessionStart = [
|
|
1165
|
-
...sessionStartHooks,
|
|
1166
|
-
{
|
|
1167
|
-
hooks: [
|
|
1168
|
-
{
|
|
1169
|
-
type: "command",
|
|
1170
|
-
command: claudeUpdateCheckCommand,
|
|
1171
|
-
timeout: 60,
|
|
1172
|
-
},
|
|
1173
|
-
],
|
|
1174
|
-
},
|
|
1175
|
-
];
|
|
1176
|
-
} else {
|
|
1177
|
-
setClaudeHookEntries(hooks, "SessionStart", sessionStartHooks);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
if (hasFormatHook) {
|
|
1181
|
-
hooks.PostToolUse = [
|
|
1182
|
-
...postToolUseHooks,
|
|
1183
|
-
{
|
|
1184
|
-
matcher: "Edit|Write|MultiEdit",
|
|
1185
|
-
hooks: [
|
|
1186
|
-
{
|
|
1187
|
-
type: "command",
|
|
1188
|
-
command: claudeFormatCommand,
|
|
1189
|
-
timeout: 30,
|
|
1190
|
-
},
|
|
1191
|
-
],
|
|
1192
|
-
},
|
|
1193
|
-
];
|
|
1194
|
-
} else {
|
|
1195
|
-
setClaudeHookEntries(hooks, "PostToolUse", postToolUseHooks);
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
return {
|
|
1199
|
-
...config,
|
|
1200
|
-
hooks,
|
|
1201
|
-
};
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
function buildCursorHooksConfig({ hasFormatHook, hasUpdateCheckHook }) {
|
|
1205
|
-
const hooks = {};
|
|
1206
|
-
|
|
1207
|
-
if (hasUpdateCheckHook) {
|
|
1208
|
-
hooks.sessionStart = [
|
|
1209
|
-
{
|
|
1210
|
-
command: "node .cursor/hooks/scaffold-update-check.mjs cursor",
|
|
1211
|
-
timeout: 60000,
|
|
1212
|
-
},
|
|
1213
|
-
];
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
if (hasFormatHook) {
|
|
1217
|
-
hooks.afterFileEdit = [
|
|
1218
|
-
{
|
|
1219
|
-
command: "node .cursor/hooks/format-edited-file.mjs cursor",
|
|
1220
|
-
},
|
|
1221
|
-
];
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
return {
|
|
1225
|
-
version: 1,
|
|
1226
|
-
hooks,
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
function buildOpenCodeConfig(existingConfig) {
|
|
1231
|
-
const config = { ...existingConfig };
|
|
1232
|
-
const formatter =
|
|
1233
|
-
typeof config.formatter === "object" && config.formatter !== null
|
|
1234
|
-
? { ...config.formatter }
|
|
1235
|
-
: {};
|
|
1236
|
-
delete formatter["harness-format-edited-file"];
|
|
1237
|
-
|
|
1238
|
-
if (Object.keys(formatter).length > 0) {
|
|
1239
|
-
config.formatter = formatter;
|
|
1240
|
-
} else {
|
|
1241
|
-
delete config.formatter;
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
return {
|
|
1245
|
-
$schema: "https://opencode.ai/config.json",
|
|
1246
|
-
...config,
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
async function readJsonFile(filePath) {
|
|
1251
|
-
try {
|
|
1252
|
-
const content = await readConfinedRegularFile(filePath);
|
|
1253
|
-
return content === null ? {} : JSON.parse(content.toString("utf8"));
|
|
1254
|
-
} catch (error) {
|
|
1255
|
-
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
1256
|
-
return {};
|
|
1257
|
-
}
|
|
1258
|
-
throw error;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
function getSkillNames(agent) {
|
|
1263
|
-
if (Array.isArray(agent.skills)) {
|
|
1264
|
-
return [...new Set(agent.skills)];
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
return [...new Set(agent.packs.flatMap((pack) => capabilityPacks[pack].skills))];
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
function formatList(items) {
|
|
1271
|
-
return items.map((item) => `- ${item}`).join("\n");
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
function relativeSkillPath(skillName) {
|
|
1275
|
-
const absoluteSkillDir = path.join(sharedSkillsPath, skillName);
|
|
1276
|
-
return path.relative(codexAgentsDir, absoluteSkillDir);
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
function yamlString(value) {
|
|
1280
|
-
return JSON.stringify(value);
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
function encodeJson(value) {
|
|
1284
|
-
return `${JSON.stringify(value, null, 2)}\n`;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
const compareJsonKeys = (left, right) => Number(left > right) - Number(left < right);
|
|
1288
|
-
|
|
1289
|
-
function canonicalJsonStringify(value) {
|
|
1290
|
-
if (Array.isArray(value)) {
|
|
1291
|
-
return `[${value.map(canonicalJsonStringify).join(",")}]`;
|
|
1292
|
-
}
|
|
1293
|
-
if (value !== null && typeof value === "object") {
|
|
1294
|
-
return `{${Object.entries(value)
|
|
1295
|
-
.toSorted(([left], [right]) => compareJsonKeys(left, right))
|
|
1296
|
-
.map(([key, child]) => `${JSON.stringify(key)}:${canonicalJsonStringify(child)}`)
|
|
1297
|
-
.join(",")}}`;
|
|
1298
|
-
}
|
|
1299
|
-
return JSON.stringify(value) ?? "null";
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
const semanticJsonHash = (value) =>
|
|
1303
|
-
createHash("sha256").update(canonicalJsonStringify(value)).digest("hex");
|
|
1304
|
-
|
|
1305
|
-
const managedFileKinds = new Set([
|
|
1306
|
-
"agent-prompt",
|
|
1307
|
-
"context-plan",
|
|
1308
|
-
"handoff",
|
|
1309
|
-
"harness",
|
|
1310
|
-
"hook",
|
|
1311
|
-
"lint-spec",
|
|
1312
|
-
"manifest",
|
|
1313
|
-
"prompt-spec",
|
|
1314
|
-
"projection-receipt",
|
|
1315
|
-
"required-tools",
|
|
1316
|
-
"script",
|
|
1317
|
-
"skill",
|
|
1318
|
-
"source-guide",
|
|
1319
|
-
"subagent",
|
|
1320
|
-
]);
|
|
1321
|
-
|
|
1322
|
-
const hasExactKeys = (value, keys) =>
|
|
1323
|
-
isObject(value) &&
|
|
1324
|
-
Object.keys(value).length === keys.length &&
|
|
1325
|
-
Object.keys(value).every((key) => keys.includes(key));
|
|
1326
|
-
|
|
1327
|
-
const validOutputFingerprint = (fingerprint) =>
|
|
1328
|
-
(hasExactKeys(fingerprint, ["_tag", "mode", "sha256"]) &&
|
|
1329
|
-
fingerprint._tag === "File" &&
|
|
1330
|
-
Number.isInteger(fingerprint.mode) &&
|
|
1331
|
-
fingerprint.mode >= 0 &&
|
|
1332
|
-
fingerprint.mode <= 0o777 &&
|
|
1333
|
-
/^[0-9a-f]{64}$/u.test(fingerprint.sha256)) ||
|
|
1334
|
-
(hasExactKeys(fingerprint, ["_tag", "sha256", "target"]) &&
|
|
1335
|
-
fingerprint._tag === "Symlink" &&
|
|
1336
|
-
/^[0-9a-f]{64}$/u.test(fingerprint.sha256) &&
|
|
1337
|
-
isNonEmptyString(fingerprint.target));
|
|
1338
|
-
|
|
1339
|
-
function validManagedFileOwnership(ownership) {
|
|
1340
|
-
if (ownership === undefined) return true;
|
|
1341
|
-
if (hasExactKeys(ownership, ["_tag"]) && ownership._tag === "ScaffoldManaged") return true;
|
|
1342
|
-
if (
|
|
1343
|
-
!hasExactKeys(ownership, ["_tag", "evidence"]) ||
|
|
1344
|
-
ownership._tag !== "ProjectGenerated" ||
|
|
1345
|
-
!isObject(ownership.evidence)
|
|
1346
|
-
) {
|
|
1347
|
-
return false;
|
|
1348
|
-
}
|
|
1349
|
-
const evidenceKeys = Object.keys(ownership.evidence);
|
|
1350
|
-
if (
|
|
1351
|
-
!evidenceKeys.every((key) =>
|
|
1352
|
-
["producer", "revision", "authority", "outputFingerprint"].includes(key),
|
|
1353
|
-
) ||
|
|
1354
|
-
![3, 4].includes(evidenceKeys.length) ||
|
|
1355
|
-
!isNonEmptyString(ownership.evidence.producer) ||
|
|
1356
|
-
(ownership.evidence.revision !== undefined && !isNonEmptyString(ownership.evidence.revision)) ||
|
|
1357
|
-
!hasExactKeys(ownership.evidence.authority, ["_tag", "sourcePath"]) ||
|
|
1358
|
-
ownership.evidence.authority._tag !== "RepositoryMirror" ||
|
|
1359
|
-
!isNonEmptyString(ownership.evidence.authority.sourcePath)
|
|
1360
|
-
) {
|
|
1361
|
-
return false;
|
|
1362
|
-
}
|
|
1363
|
-
return validOutputFingerprint(ownership.evidence.outputFingerprint);
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
function decodeScaffoldManifest(bytes) {
|
|
1367
|
-
let manifest;
|
|
1368
|
-
try {
|
|
1369
|
-
manifest = JSON.parse(bytes.toString("utf8"));
|
|
1370
|
-
} catch (cause) {
|
|
1371
|
-
throw new Error("Scaffold manifest is malformed JSON.", { cause });
|
|
1372
|
-
}
|
|
1373
|
-
if (
|
|
1374
|
-
!isObject(manifest) ||
|
|
1375
|
-
!Array.isArray(manifest.finalPacks) ||
|
|
1376
|
-
!manifest.finalPacks.every((pack) => typeof pack === "string") ||
|
|
1377
|
-
!Array.isArray(manifest.managedFiles) ||
|
|
1378
|
-
manifest.managedFiles.some(
|
|
1379
|
-
(file) =>
|
|
1380
|
-
!isObject(file) ||
|
|
1381
|
-
typeof file.path !== "string" ||
|
|
1382
|
-
typeof file.sha256 !== "string" ||
|
|
1383
|
-
!managedFileKinds.has(file.kind) ||
|
|
1384
|
-
!validManagedFileOwnership(file.ownership),
|
|
1385
|
-
)
|
|
1386
|
-
) {
|
|
1387
|
-
throw new Error("Scaffold manifest does not match the supported schema.");
|
|
1388
|
-
}
|
|
1389
|
-
const receiptEntries = manifest.managedFiles.filter(({ kind }) => kind === "projection-receipt");
|
|
1390
|
-
const receiptPathEntries = manifest.managedFiles.filter(
|
|
1391
|
-
({ path: managedPath }) => managedPath === projectionReceiptRelativePath,
|
|
1392
|
-
);
|
|
1393
|
-
if (
|
|
1394
|
-
receiptEntries.length !== 1 ||
|
|
1395
|
-
receiptPathEntries.length !== 1 ||
|
|
1396
|
-
receiptEntries[0].path !== projectionReceiptRelativePath ||
|
|
1397
|
-
(receiptEntries[0].ownership !== undefined &&
|
|
1398
|
-
receiptEntries[0].ownership._tag !== "ScaffoldManaged")
|
|
1399
|
-
) {
|
|
1400
|
-
throw new Error(
|
|
1401
|
-
`Scaffold manifest must contain exactly one scaffold-managed projection-receipt entry for ${projectionReceiptRelativePath}.`,
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
|
-
return manifest;
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
async function preflightScaffoldManifest() {
|
|
1408
|
-
await assertConfinedRegularFile(scaffoldManifestPath);
|
|
1409
|
-
const bytes = await readConfinedRegularFile(scaffoldManifestPath);
|
|
1410
|
-
if (bytes === null) return null;
|
|
1411
|
-
const manifest = decodeScaffoldManifest(bytes);
|
|
1412
|
-
return { identity: semanticJsonHash(manifest) };
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
const publicationLockRetry = (cause) => {
|
|
1416
|
-
const error = new Error(
|
|
1417
|
-
"Harness projection publication is already active; retry sync-subagents.",
|
|
1418
|
-
cause === undefined ? undefined : { cause },
|
|
1419
|
-
);
|
|
1420
|
-
error.code = "PROJECTION_PUBLICATION_RETRY";
|
|
1421
|
-
return error;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
async function acquireProjectionPublicationLock({
|
|
1425
|
-
now = Date.now,
|
|
1426
|
-
staleAfterMs = defaultPublicationLockStaleAfterMs,
|
|
1427
|
-
} = {}) {
|
|
1428
|
-
if (typeof now !== "function" || !Number.isFinite(staleAfterMs) || staleAfterMs <= 0) {
|
|
1429
|
-
throw new Error("Projection publication lock timing configuration is invalid.");
|
|
1430
|
-
}
|
|
1431
|
-
const acquiredAt = now();
|
|
1432
|
-
if (!Number.isFinite(acquiredAt)) {
|
|
1433
|
-
throw new Error("Projection publication lock timing configuration is invalid.");
|
|
1434
|
-
}
|
|
1435
|
-
await ensureConfinedDirectory(publicationLockCachePath);
|
|
1436
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
1437
|
-
publicationLockCachePath,
|
|
1438
|
-
"acquire projection publication lock",
|
|
1439
|
-
repoRootIdentityForOperation("acquire projection publication lock"),
|
|
1440
|
-
);
|
|
1441
|
-
const token = randomUUID();
|
|
1442
|
-
const ownerContent = encodeJson({ acquiredAt, token });
|
|
1443
|
-
const ownerEvidence = Buffer.from(ownerContent).toString("base64");
|
|
1444
|
-
const baseRequest = {
|
|
1445
|
-
maximumBytes: 4096,
|
|
1446
|
-
ownerContent,
|
|
1447
|
-
ownerEvidence,
|
|
1448
|
-
ownerFile: publicationLockOwnerFile,
|
|
1449
|
-
parent: parentIdentity,
|
|
1450
|
-
target: path.basename(publicationLockPath),
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
|
-
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
1454
|
-
try {
|
|
1455
|
-
const result = await runStableMutation(publicationLockCachePath, {
|
|
1456
|
-
...baseRequest,
|
|
1457
|
-
operation: "acquire-lock",
|
|
1458
|
-
});
|
|
1459
|
-
if (
|
|
1460
|
-
!isObject(result.target) ||
|
|
1461
|
-
!Number.isInteger(result.target.device) ||
|
|
1462
|
-
!Number.isInteger(result.target.inode)
|
|
1463
|
-
) {
|
|
1464
|
-
throw new Error("Confined publication lock returned no target identity.");
|
|
1465
|
-
}
|
|
1466
|
-
return {
|
|
1467
|
-
expectedTarget: {
|
|
1468
|
-
device: result.target.device,
|
|
1469
|
-
inode: result.target.inode,
|
|
1470
|
-
kind: "directory",
|
|
1471
|
-
},
|
|
1472
|
-
ownerEvidence,
|
|
1473
|
-
};
|
|
1474
|
-
} catch (cause) {
|
|
1475
|
-
if (cause?.code !== "EEXIST") throw cause;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
const existing = await lstatOrNull(publicationLockPath);
|
|
1479
|
-
if (existing === null) continue;
|
|
1480
|
-
if (existing.isSymbolicLink() || !existing.isDirectory()) {
|
|
1481
|
-
throw publicationLockRetry();
|
|
1482
|
-
}
|
|
1483
|
-
const expectedTarget = {
|
|
1484
|
-
device: existing.dev,
|
|
1485
|
-
inode: existing.ino,
|
|
1486
|
-
kind: "directory",
|
|
1487
|
-
};
|
|
1488
|
-
let lockStartedAt = existing.mtimeMs;
|
|
1489
|
-
const observedAt = now();
|
|
1490
|
-
if (!Number.isFinite(observedAt)) {
|
|
1491
|
-
throw new Error("Projection publication lock timing configuration is invalid.");
|
|
1492
|
-
}
|
|
1493
|
-
let observedOwnerEvidence = null;
|
|
1494
|
-
let ownerBytes;
|
|
1495
|
-
try {
|
|
1496
|
-
ownerBytes = await readConfinedRegularFile(
|
|
1497
|
-
path.join(publicationLockPath, publicationLockOwnerFile),
|
|
1498
|
-
4096,
|
|
1499
|
-
);
|
|
1500
|
-
} catch (cause) {
|
|
1501
|
-
throw publicationLockRetry(cause);
|
|
1502
|
-
}
|
|
1503
|
-
if (ownerBytes !== null) {
|
|
1504
|
-
observedOwnerEvidence = ownerBytes.toString("base64");
|
|
1505
|
-
try {
|
|
1506
|
-
const owner = JSON.parse(ownerBytes.toString("utf8"));
|
|
1507
|
-
if (
|
|
1508
|
-
hasExactKeys(owner, ["acquiredAt", "token"]) &&
|
|
1509
|
-
Number.isFinite(owner.acquiredAt) &&
|
|
1510
|
-
owner.acquiredAt <= observedAt &&
|
|
1511
|
-
isNonEmptyString(owner.token)
|
|
1512
|
-
) {
|
|
1513
|
-
lockStartedAt = owner.acquiredAt;
|
|
1514
|
-
}
|
|
1515
|
-
} catch {
|
|
1516
|
-
// Exact malformed bytes remain bound to recovery; directory mtime supplies the TTL.
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
const lockAge = observedAt - lockStartedAt;
|
|
1520
|
-
if (Math.abs(lockAge) < staleAfterMs) {
|
|
1521
|
-
throw publicationLockRetry();
|
|
1522
|
-
}
|
|
1523
|
-
try {
|
|
1524
|
-
await removeConfinedPath(publicationLockPath, {
|
|
1525
|
-
expectedTarget,
|
|
1526
|
-
ownerEvidence: observedOwnerEvidence,
|
|
1527
|
-
recursive: true,
|
|
1528
|
-
});
|
|
1529
|
-
} catch (cause) {
|
|
1530
|
-
throw publicationLockRetry(cause);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
throw publicationLockRetry();
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
async function releaseProjectionPublicationLock(lock) {
|
|
1537
|
-
await removeConfinedPath(publicationLockPath, {
|
|
1538
|
-
expectedTarget: lock.expectedTarget,
|
|
1539
|
-
ownerEvidence: lock.ownerEvidence,
|
|
1540
|
-
recursive: true,
|
|
1541
|
-
});
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
const scaffoldManifestPreflightRetry = (state) => {
|
|
1545
|
-
const error = new Error(`Scaffold manifest ${state} after preflight; retry sync-subagents.`);
|
|
1546
|
-
error.code = "SCAFFOLD_MANIFEST_RETRY";
|
|
1547
|
-
return error;
|
|
1548
|
-
};
|
|
1549
|
-
|
|
1550
|
-
async function assertScaffoldManifestPreflight(preflight) {
|
|
1551
|
-
const bytes = await readConfinedRegularFile(scaffoldManifestPath);
|
|
1552
|
-
if (preflight === null) {
|
|
1553
|
-
if (bytes !== null) throw scaffoldManifestPreflightRetry("changed");
|
|
1554
|
-
return;
|
|
1555
|
-
}
|
|
1556
|
-
if (bytes === null) throw scaffoldManifestPreflightRetry("disappeared");
|
|
1557
|
-
if (semanticJsonHash(decodeScaffoldManifest(bytes)) !== preflight.identity) {
|
|
1558
|
-
throw scaffoldManifestPreflightRetry("changed");
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
async function publishReceiptEvidence(preflight, status, receiptHash) {
|
|
1563
|
-
if (preflight === null) return;
|
|
1564
|
-
const expectedTarget = await captureLeafExpectation(scaffoldManifestPath);
|
|
1565
|
-
if (expectedTarget.kind !== "file") {
|
|
1566
|
-
throw new Error("Scaffold manifest changed after preflight.");
|
|
1567
|
-
}
|
|
1568
|
-
const bytes = await readConfinedRegularFile(scaffoldManifestPath);
|
|
1569
|
-
if (bytes === null) {
|
|
1570
|
-
throw new Error("Scaffold manifest disappeared after preflight.");
|
|
1571
|
-
}
|
|
1572
|
-
const manifest = decodeScaffoldManifest(bytes);
|
|
1573
|
-
if (semanticJsonHash(manifest) !== preflight.identity) {
|
|
1574
|
-
throw new Error("Scaffold manifest changed after preflight.");
|
|
1575
|
-
}
|
|
1576
|
-
const receiptIndex = manifest.managedFiles.findIndex(({ kind }) => kind === "projection-receipt");
|
|
1577
|
-
const updated = {
|
|
1578
|
-
...manifest,
|
|
1579
|
-
projectionReceiptFile: projectionReceiptRelativePath,
|
|
1580
|
-
projectionStatus: status,
|
|
1581
|
-
managedFiles: manifest.managedFiles.map((file, index) =>
|
|
1582
|
-
index === receiptIndex ? { ...file, sha256: receiptHash } : file,
|
|
1583
|
-
),
|
|
1584
|
-
};
|
|
1585
|
-
const expectedContentSha256 = createHash("sha256").update(bytes).digest("hex");
|
|
1586
|
-
await writeConfinedTextFile(
|
|
1587
|
-
scaffoldManifestPath,
|
|
1588
|
-
encodeJson(updated),
|
|
1589
|
-
expectedTarget,
|
|
1590
|
-
expectedContentSha256,
|
|
1591
|
-
);
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
async function assertPublishedReceiptEvidence(preflight, status, receiptHash) {
|
|
1595
|
-
const receiptBytes = await readConfinedRegularFile(projectionReceiptPath);
|
|
1596
|
-
if (receiptBytes === null) {
|
|
1597
|
-
throw new Error("Published harness projection receipt is missing.");
|
|
1598
|
-
}
|
|
1599
|
-
let receipt;
|
|
1600
|
-
try {
|
|
1601
|
-
receipt = JSON.parse(receiptBytes.toString("utf8"));
|
|
1602
|
-
} catch (cause) {
|
|
1603
|
-
throw new Error("Published harness projection receipt is malformed.", { cause });
|
|
1604
|
-
}
|
|
1605
|
-
if (semanticJsonHash(receipt) !== receiptHash) {
|
|
1606
|
-
throw new Error("Published harness projection receipt changed before commit validation.");
|
|
1607
|
-
}
|
|
1608
|
-
if (preflight === null) return;
|
|
1609
|
-
|
|
1610
|
-
const manifestBytes = await readConfinedRegularFile(scaffoldManifestPath);
|
|
1611
|
-
if (manifestBytes === null) {
|
|
1612
|
-
throw new Error("Published scaffold manifest evidence is missing.");
|
|
1613
|
-
}
|
|
1614
|
-
const manifest = decodeScaffoldManifest(manifestBytes);
|
|
1615
|
-
const receiptEntry = manifest.managedFiles.find(({ kind }) => kind === "projection-receipt");
|
|
1616
|
-
if (receiptEntry.sha256 !== receiptHash || manifest.projectionStatus !== status) {
|
|
1617
|
-
throw new Error("Published harness projection receipt and scaffold manifest diverged.");
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
async function commitProjectionEvidence(manifestPreflight, receipt) {
|
|
1622
|
-
await writeConfinedTextFile(projectionReceiptPath, encodeJson(receipt));
|
|
1623
|
-
const committedReceiptBytes = await readConfinedRegularFile(projectionReceiptPath);
|
|
1624
|
-
if (committedReceiptBytes === null) {
|
|
1625
|
-
throw new Error("Committed harness projection receipt is missing.");
|
|
1626
|
-
}
|
|
1627
|
-
let committedReceipt;
|
|
1628
|
-
try {
|
|
1629
|
-
committedReceipt = JSON.parse(committedReceiptBytes.toString("utf8"));
|
|
1630
|
-
} catch (cause) {
|
|
1631
|
-
throw new Error("Committed harness projection receipt is malformed.", { cause });
|
|
1632
|
-
}
|
|
1633
|
-
const committedReceiptHash = semanticJsonHash(committedReceipt);
|
|
1634
|
-
if (committedReceiptHash !== semanticJsonHash(receipt)) {
|
|
1635
|
-
const error = new Error(
|
|
1636
|
-
"Harness projection receipt changed after publication; retry sync-subagents.",
|
|
1637
|
-
);
|
|
1638
|
-
error.code = "PROJECTION_RECEIPT_RETRY";
|
|
1639
|
-
throw error;
|
|
1640
|
-
}
|
|
1641
|
-
try {
|
|
1642
|
-
await publishReceiptEvidence(manifestPreflight, committedReceipt.status, committedReceiptHash);
|
|
1643
|
-
await assertPublishedReceiptEvidence(
|
|
1644
|
-
manifestPreflight,
|
|
1645
|
-
committedReceipt.status,
|
|
1646
|
-
committedReceiptHash,
|
|
1647
|
-
);
|
|
1648
|
-
} catch (cause) {
|
|
1649
|
-
const error = new Error(
|
|
1650
|
-
"Harness projection receipt and scaffold manifest evidence did not commit coherently; retry sync-subagents.",
|
|
1651
|
-
{ cause },
|
|
1652
|
-
);
|
|
1653
|
-
error.code = "SCAFFOLD_MANIFEST_RETRY";
|
|
1654
|
-
throw error;
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
function encodeOpencodeJson(value, depth = 0) {
|
|
1659
|
-
const indent = " ".repeat(depth);
|
|
1660
|
-
const childIndent = " ".repeat(depth + 1);
|
|
1661
|
-
|
|
1662
|
-
if (Array.isArray(value)) {
|
|
1663
|
-
return `[${value.map((item) => JSON.stringify(item)).join(", ")}]`;
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
if (value && typeof value === "object") {
|
|
1667
|
-
const entries = Object.entries(value);
|
|
1668
|
-
if (entries.length === 0) {
|
|
1669
|
-
return "{}";
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
const body = entries
|
|
1673
|
-
.map(
|
|
1674
|
-
([key, entry]) =>
|
|
1675
|
-
`${childIndent}${JSON.stringify(key)}: ${encodeOpencodeJson(entry, depth + 1)}`,
|
|
1676
|
-
)
|
|
1677
|
-
.join(",\n");
|
|
1678
|
-
|
|
1679
|
-
return `{\n${body}\n${indent}}`;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
return JSON.stringify(value);
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
function encodeOpenCodeConfig(value) {
|
|
1686
|
-
return `${encodeOpencodeJson(value)}\n`;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
async function readGuidance(files) {
|
|
1690
|
-
const entries = await Promise.all(
|
|
1691
|
-
files.map(async (file) => {
|
|
1692
|
-
const absolutePath = path.join(repoRoot, file);
|
|
1693
|
-
let content = "";
|
|
1694
|
-
|
|
1695
|
-
try {
|
|
1696
|
-
content = await readFile(absolutePath, "utf8");
|
|
1697
|
-
} catch (error) {
|
|
1698
|
-
if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT")) {
|
|
1699
|
-
throw error;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
content = [
|
|
1703
|
-
`Missing neutral guidance source: ${file}.`,
|
|
1704
|
-
"Author the scoped AGENTS.md file, create the sibling CLAUDE.md symlink mirror, then rerun .agents/scripts/sync-subagents.mjs.",
|
|
1705
|
-
].join("\n");
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
return `### ${file}\n${content.trim()}`;
|
|
1709
|
-
}),
|
|
1710
|
-
);
|
|
1711
|
-
|
|
1712
|
-
return entries.join("\n\n");
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
function buildPrompt(agent, guidance) {
|
|
1716
|
-
const packs = agent.packs.map((pack) => {
|
|
1717
|
-
const definition = capabilityPacks[pack];
|
|
1718
|
-
return `${pack}: ${definition.description}`;
|
|
1719
|
-
});
|
|
1720
|
-
|
|
1721
|
-
return [
|
|
1722
|
-
`You are the ${agent.name} specialist for this repository.`,
|
|
1723
|
-
"",
|
|
1724
|
-
"Operate as a narrow owner for the assigned slice instead of broadening scope.",
|
|
1725
|
-
"",
|
|
1726
|
-
"Primary ownership:",
|
|
1727
|
-
formatList(agent.ownedPaths),
|
|
1728
|
-
"",
|
|
1729
|
-
"Preloaded capability packs:",
|
|
1730
|
-
formatList(packs),
|
|
1731
|
-
"",
|
|
1732
|
-
"Boundary rules:",
|
|
1733
|
-
formatList(agent.boundaries),
|
|
1734
|
-
"",
|
|
1735
|
-
"Scoped skill activation:",
|
|
1736
|
-
formatList(agent.activationInstructions ?? []),
|
|
1737
|
-
"",
|
|
1738
|
-
"Execution expectations:",
|
|
1739
|
-
formatList([
|
|
1740
|
-
"Prefer doing the assigned slice well over exploring adjacent areas.",
|
|
1741
|
-
"If the task clearly belongs to a different specialist, say so explicitly instead of improvising outside your scope.",
|
|
1742
|
-
"Keep repo boundaries intact unless the parent explicitly assigns cross-surface coordination.",
|
|
1743
|
-
"If your work changes architecture, setup, contracts, decisions, or operator workflow, update the relevant docs or runbook in the same task.",
|
|
1744
|
-
]),
|
|
1745
|
-
"",
|
|
1746
|
-
"Baked-in scoped guidance:",
|
|
1747
|
-
guidance,
|
|
1748
|
-
].join("\n");
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
function buildClaudeAgent(agent, prompt, skillNames) {
|
|
1752
|
-
const frontmatter = [
|
|
1753
|
-
"---",
|
|
1754
|
-
`name: ${yamlString(agent.name)}`,
|
|
1755
|
-
`description: ${yamlString(agent.description)}`,
|
|
1756
|
-
"model: inherit",
|
|
1757
|
-
"skills:",
|
|
1758
|
-
...skillNames.map((skillName) => ` - ${skillName}`),
|
|
1759
|
-
"---",
|
|
1760
|
-
"",
|
|
1761
|
-
].join("\n");
|
|
1762
|
-
|
|
1763
|
-
return `${frontmatter}${claudeManagedComment}\n\n${prompt}\n`;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
function buildCodexAgent(agent, prompt, skillNames) {
|
|
1767
|
-
const lines = [
|
|
1768
|
-
managedHeader,
|
|
1769
|
-
"",
|
|
1770
|
-
`name = ${JSON.stringify(agent.name)}`,
|
|
1771
|
-
`description = ${JSON.stringify(agent.description)}`,
|
|
1772
|
-
'model_reasoning_effort = "medium"',
|
|
1773
|
-
`developer_instructions = """\n${prompt}\n"""`,
|
|
1774
|
-
];
|
|
1775
|
-
|
|
1776
|
-
for (const skillName of skillNames) {
|
|
1777
|
-
lines.push("");
|
|
1778
|
-
lines.push("[[skills.config]]");
|
|
1779
|
-
lines.push(`path = ${JSON.stringify(relativeSkillPath(skillName))}`);
|
|
1780
|
-
lines.push("enabled = true");
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
return `${lines.join("\n")}\n`;
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
function buildCursorAgent(agent, prompt) {
|
|
1787
|
-
const frontmatter = [
|
|
1788
|
-
"---",
|
|
1789
|
-
`name: ${agent.name}`,
|
|
1790
|
-
`description: ${yamlString(agent.description)}`,
|
|
1791
|
-
"model: inherit",
|
|
1792
|
-
"---",
|
|
1793
|
-
"",
|
|
1794
|
-
].join("\n");
|
|
1795
|
-
|
|
1796
|
-
return `${frontmatter}${cursorManagedComment}\n\n${prompt}\n`;
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
function buildOpenCodeAgent(agent, prompt) {
|
|
1800
|
-
const frontmatter = [
|
|
1801
|
-
"---",
|
|
1802
|
-
`description: ${yamlString(agent.description)}`,
|
|
1803
|
-
"mode: subagent",
|
|
1804
|
-
"---",
|
|
1805
|
-
"",
|
|
1806
|
-
].join("\n");
|
|
1807
|
-
|
|
1808
|
-
return `${frontmatter}${opencodeManagedComment}\n\n${prompt}\n`;
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
const fileDigest = async (filePath) =>
|
|
1812
|
-
createHash("sha256")
|
|
1813
|
-
.update(await readFile(filePath))
|
|
1814
|
-
.digest("hex");
|
|
1815
|
-
|
|
1816
|
-
const copyFallbackKey = ({ source, target }) => `${source}\0${target}`;
|
|
1817
|
-
|
|
1818
|
-
async function ensureSymlink(linkPath, targetPath, fallbackIdentity) {
|
|
1819
|
-
const repoRootIdentity = repoRootIdentityForOperation("create scaffold symlink");
|
|
1820
|
-
const relativeTarget = path.relative(path.dirname(linkPath), targetPath);
|
|
1821
|
-
await ensureConfinedDirectory(path.dirname(linkPath), repoRootIdentity);
|
|
1822
|
-
|
|
1823
|
-
try {
|
|
1824
|
-
const existingStat = await lstat(linkPath);
|
|
1825
|
-
|
|
1826
|
-
if (existingStat.isSymbolicLink() && (await readlink(linkPath)) === relativeTarget) {
|
|
1827
|
-
return;
|
|
1828
|
-
}
|
|
1829
|
-
} catch (error) {
|
|
1830
|
-
if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT")) {
|
|
1831
|
-
throw error;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
await removeConfinedPath(linkPath, { recursive: true });
|
|
1836
|
-
const parentDirectory = path.dirname(linkPath);
|
|
1837
|
-
const parentIdentity = await captureConfinedDirectoryIdentity(
|
|
1838
|
-
parentDirectory,
|
|
1839
|
-
"create scaffold symlink",
|
|
1840
|
-
repoRootIdentity,
|
|
1841
|
-
);
|
|
1842
|
-
const targetStat = process.platform === "win32" ? await lstat(targetPath) : undefined;
|
|
1843
|
-
const symlinkType = targetStat?.isDirectory() ? "junction" : undefined;
|
|
1844
|
-
|
|
1845
|
-
try {
|
|
1846
|
-
await assertConfinedDirectoryComponents(
|
|
1847
|
-
confinedRelativePath(linkPath, "create scaffold symlink").split(path.sep).slice(0, -1),
|
|
1848
|
-
"create scaffold symlink",
|
|
1849
|
-
repoRootIdentity,
|
|
1850
|
-
);
|
|
1851
|
-
await assertSameDirectoryIdentity(
|
|
1852
|
-
parentDirectory,
|
|
1853
|
-
parentIdentity,
|
|
1854
|
-
"create scaffold symlink",
|
|
1855
|
-
repoRootIdentity,
|
|
1856
|
-
);
|
|
1857
|
-
await runStableMutation(parentDirectory, {
|
|
1858
|
-
linkTarget: symlinkType === "junction" ? targetPath : relativeTarget,
|
|
1859
|
-
operation: "symlink",
|
|
1860
|
-
parent: parentIdentity,
|
|
1861
|
-
target: path.basename(linkPath),
|
|
1862
|
-
...(symlinkType === undefined ? {} : { type: symlinkType }),
|
|
1863
|
-
});
|
|
1864
|
-
await assertSameDirectoryIdentity(
|
|
1865
|
-
parentDirectory,
|
|
1866
|
-
parentIdentity,
|
|
1867
|
-
"create scaffold symlink",
|
|
1868
|
-
repoRootIdentity,
|
|
1869
|
-
);
|
|
1870
|
-
} catch (error) {
|
|
1871
|
-
if (!(error && typeof error === "object" && "code" in error && error.code === "EPERM")) {
|
|
1872
|
-
throw error;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
const copyTargetStat = await lstat(targetPath);
|
|
1876
|
-
await assertSameDirectoryIdentity(
|
|
1877
|
-
parentDirectory,
|
|
1878
|
-
parentIdentity,
|
|
1879
|
-
"copy scaffold fallback",
|
|
1880
|
-
repoRootIdentity,
|
|
1881
|
-
);
|
|
1882
|
-
await runStableMutation(parentDirectory, {
|
|
1883
|
-
expectedTarget: { kind: "absent" },
|
|
1884
|
-
operation: "copy",
|
|
1885
|
-
parent: parentIdentity,
|
|
1886
|
-
recursive: copyTargetStat.isDirectory(),
|
|
1887
|
-
source: targetPath,
|
|
1888
|
-
target: path.basename(linkPath),
|
|
1889
|
-
});
|
|
1890
|
-
await assertSameDirectoryIdentity(
|
|
1891
|
-
parentDirectory,
|
|
1892
|
-
parentIdentity,
|
|
1893
|
-
"copy scaffold fallback",
|
|
1894
|
-
repoRootIdentity,
|
|
1895
|
-
);
|
|
1896
|
-
if (fallbackIdentity !== undefined && !copyTargetStat.isDirectory()) {
|
|
1897
|
-
currentCopyFallbacks.set(copyFallbackKey(fallbackIdentity), {
|
|
1898
|
-
...fallbackIdentity,
|
|
1899
|
-
digest: await fileDigest(linkPath),
|
|
1900
|
-
});
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
async function pathExists(filePath) {
|
|
1906
|
-
try {
|
|
1907
|
-
await lstat(filePath);
|
|
1908
|
-
return true;
|
|
1909
|
-
} catch (error) {
|
|
1910
|
-
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
1911
|
-
return false;
|
|
1912
|
-
}
|
|
1913
|
-
throw error;
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
async function writeManagedFiles(directory, extension, renderedByName, writeCurrent = true) {
|
|
1918
|
-
await ensureConfinedDirectory(directory);
|
|
1919
|
-
|
|
1920
|
-
const managedNames = new Set(Object.keys(renderedByName).map((name) => `${name}.${extension}`));
|
|
1921
|
-
|
|
1922
|
-
for (const filename of await readdir(directory)) {
|
|
1923
|
-
if (!filename.endsWith(`.${extension}`)) {
|
|
1924
|
-
continue;
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
const filePath = path.join(directory, filename);
|
|
1928
|
-
await assertConfinedRegularFile(filePath);
|
|
1929
|
-
const existingBytes = await readConfinedRegularFile(filePath);
|
|
1930
|
-
if (existingBytes === null) continue;
|
|
1931
|
-
const existingContent = existingBytes.toString("utf8");
|
|
1932
|
-
const isManaged =
|
|
1933
|
-
extension === "toml"
|
|
1934
|
-
? existingContent.startsWith(managedHeader)
|
|
1935
|
-
: existingContent.includes(claudeManagedComment);
|
|
1936
|
-
|
|
1937
|
-
if (isManaged && !managedNames.has(filename)) {
|
|
1938
|
-
await removeConfinedPath(filePath);
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
if (writeCurrent) {
|
|
1943
|
-
for (const [name, content] of Object.entries(renderedByName)) {
|
|
1944
|
-
await writeConfinedTextFile(path.join(directory, `${name}.${extension}`), content);
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
async function syncHookSurface() {
|
|
1950
|
-
await ensureConfinedDirectory(sharedHooksPath);
|
|
1951
|
-
await ensureConfinedDirectory(codexHooksDir);
|
|
1952
|
-
await ensureConfinedDirectory(claudeHooksDir);
|
|
1953
|
-
await ensureConfinedDirectory(cursorHooksDir);
|
|
1954
|
-
await ensureConfinedDirectory(opencodePluginsDir);
|
|
1955
|
-
|
|
1956
|
-
for (const hookName of ["format-edited-file.mjs", "scaffold-update-check.mjs"]) {
|
|
1957
|
-
const sourcePath = path.join(sharedHooksPath, hookName);
|
|
1958
|
-
const targetPaths = [
|
|
1959
|
-
path.join(codexHooksDir, hookName),
|
|
1960
|
-
path.join(claudeHooksDir, hookName),
|
|
1961
|
-
path.join(cursorHooksDir, hookName),
|
|
1962
|
-
path.join(opencodePluginsDir, hookName),
|
|
1963
|
-
];
|
|
1964
|
-
|
|
1965
|
-
if (await pathExists(sourcePath)) {
|
|
1966
|
-
for (const targetPath of targetPaths) {
|
|
1967
|
-
await ensureSymlink(targetPath, sourcePath);
|
|
1968
|
-
}
|
|
1969
|
-
} else {
|
|
1970
|
-
for (const targetPath of targetPaths) {
|
|
1971
|
-
await removeConfinedPath(targetPath, { recursive: true });
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
async function syncSkillMirrors() {
|
|
1978
|
-
await ensureSymlink(claudeSkillsMirrorPath, sharedSkillsPath);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
async function syncPromptMirrors() {
|
|
1982
|
-
await ensureSymlink(codexAgentsMirrorPath, sharedAgentsPath);
|
|
1983
|
-
await ensureSymlink(claudeAgentsMirrorPath, sharedAgentsPath);
|
|
1984
|
-
await ensureSymlink(opencodeAgentsMirrorPath, sharedAgentsPath);
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
async function prepareHarnessApplication() {
|
|
1988
|
-
const claudeFiles = {};
|
|
1989
|
-
const codexFiles = {};
|
|
1990
|
-
const cursorFiles = {};
|
|
1991
|
-
const opencodeFiles = {};
|
|
1992
|
-
|
|
1993
|
-
for (const agent of agents) {
|
|
1994
|
-
const guidance = await readGuidance(agent.guidanceFiles);
|
|
1995
|
-
const prompt = buildPrompt(agent, guidance);
|
|
1996
|
-
const skillNames = getSkillNames(agent);
|
|
1997
|
-
|
|
1998
|
-
claudeFiles[agent.name] = buildClaudeAgent(agent, prompt, skillNames);
|
|
1999
|
-
codexFiles[agent.name] = buildCodexAgent(agent, prompt, skillNames);
|
|
2000
|
-
cursorFiles[agent.name] = buildCursorAgent(agent, prompt);
|
|
2001
|
-
opencodeFiles[agent.name] = buildOpenCodeAgent(agent, prompt);
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
const availableHooks = {
|
|
2005
|
-
hasFormatHook: await pathExists(path.join(sharedHooksPath, "format-edited-file.mjs")),
|
|
2006
|
-
hasUpdateCheckHook: await pathExists(path.join(sharedHooksPath, "scaffold-update-check.mjs")),
|
|
2007
|
-
};
|
|
2008
|
-
return {
|
|
2009
|
-
availableHooks,
|
|
2010
|
-
rendered: {
|
|
2011
|
-
claude: claudeFiles,
|
|
2012
|
-
codex: codexFiles,
|
|
2013
|
-
cursor: cursorFiles,
|
|
2014
|
-
opencode: opencodeFiles,
|
|
2015
|
-
},
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
const harnessAgentSurface = {
|
|
2020
|
-
claude: { directory: claudeAgentsDir, extension: "md" },
|
|
2021
|
-
codex: { directory: codexAgentsDir, extension: "toml" },
|
|
2022
|
-
cursor: { directory: cursorAgentsDir, extension: "md" },
|
|
2023
|
-
opencode: { directory: opencodeAgentsDir, extension: "md" },
|
|
2024
|
-
};
|
|
2025
|
-
|
|
2026
|
-
const harnessConfigPath = {
|
|
2027
|
-
claude: claudeSettingsPath,
|
|
2028
|
-
codex: codexConfigPath,
|
|
2029
|
-
cursor: cursorHooksJsonPath,
|
|
2030
|
-
opencode: opencodeConfigPath,
|
|
2031
|
-
};
|
|
2032
|
-
|
|
2033
|
-
const harnessHookSurface = {
|
|
2034
|
-
claude: claudeHooksDir,
|
|
2035
|
-
codex: codexHooksDir,
|
|
2036
|
-
cursor: cursorHooksDir,
|
|
2037
|
-
opencode: opencodePluginsDir,
|
|
2038
|
-
};
|
|
2039
|
-
|
|
2040
|
-
const actionTargetPath = (action) => {
|
|
2041
|
-
const target = action.file ?? action.target ?? action.nativePath;
|
|
2042
|
-
return typeof target === "string" ? target.split("#", 1)[0] : undefined;
|
|
2043
|
-
};
|
|
2044
|
-
|
|
2045
|
-
const actionPathFields = [
|
|
2046
|
-
"source",
|
|
2047
|
-
"target",
|
|
2048
|
-
"file",
|
|
2049
|
-
"nativePath",
|
|
2050
|
-
"canonicalPath",
|
|
2051
|
-
"directory",
|
|
2052
|
-
"config.path",
|
|
2053
|
-
];
|
|
2054
|
-
const harnessActionOperations = new Set([
|
|
2055
|
-
"cleanup-managed-agents",
|
|
2056
|
-
"merge-json",
|
|
2057
|
-
"merge-toml",
|
|
2058
|
-
"mirror",
|
|
2059
|
-
"native",
|
|
2060
|
-
"reconcile-lifecycle-hooks",
|
|
2061
|
-
"render",
|
|
2062
|
-
"render-template",
|
|
2063
|
-
"use-native-mirror",
|
|
2064
|
-
"use-native-prompt",
|
|
2065
|
-
"use-native-skill",
|
|
2066
|
-
]);
|
|
2067
|
-
|
|
2068
|
-
const actionPathValue = (action, field) =>
|
|
2069
|
-
field === "config.path" ? action.config?.path : action[field];
|
|
2070
|
-
|
|
2071
|
-
const isPathWithin = (root, candidate) => {
|
|
2072
|
-
const relative = path.relative(root, candidate);
|
|
2073
|
-
return (
|
|
2074
|
-
relative === "" ||
|
|
2075
|
-
(!relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative))
|
|
2076
|
-
);
|
|
2077
|
-
};
|
|
2078
|
-
|
|
2079
|
-
const resolveActionPath = (value, field) => {
|
|
2080
|
-
if (typeof value !== "string") {
|
|
2081
|
-
throw new Error(`Harness action ${field} path must be a string`);
|
|
2082
|
-
}
|
|
2083
|
-
const candidate = value.split("#", 1)[0];
|
|
2084
|
-
const portableCandidate = candidate.replaceAll("\\", "/");
|
|
2085
|
-
if (
|
|
2086
|
-
candidate.length === 0 ||
|
|
2087
|
-
path.isAbsolute(candidate) ||
|
|
2088
|
-
path.win32.isAbsolute(candidate) ||
|
|
2089
|
-
portableCandidate.split("/").includes("..")
|
|
2090
|
-
) {
|
|
2091
|
-
throw new Error(`Harness action ${field} path escapes the repository: ${value}`);
|
|
2092
|
-
}
|
|
2093
|
-
const resolved = path.resolve(repoRoot, portableCandidate);
|
|
2094
|
-
const relative = path.relative(repoRoot, resolved);
|
|
2095
|
-
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
2096
|
-
throw new Error(`Harness action ${field} path escapes the repository: ${value}`);
|
|
2097
|
-
}
|
|
2098
|
-
return resolved;
|
|
2099
|
-
};
|
|
2100
|
-
|
|
2101
|
-
const resolveActionPaths = (action) =>
|
|
2102
|
-
Object.fromEntries(
|
|
2103
|
-
[
|
|
2104
|
-
...actionPathFields.flatMap((field) => {
|
|
2105
|
-
const value = actionPathValue(action, field);
|
|
2106
|
-
return value === undefined ? [] : [[field, value]];
|
|
2107
|
-
}),
|
|
2108
|
-
...(action.managedHookFiles ?? []).map((value, index) => [
|
|
2109
|
-
`managedHookFiles[${index}]`,
|
|
2110
|
-
value,
|
|
2111
|
-
]),
|
|
2112
|
-
].map(([field, value]) => [field, resolveActionPath(value, field)]),
|
|
2113
|
-
);
|
|
2114
|
-
|
|
2115
|
-
const hasInvalidActionPaths = (action) => {
|
|
2116
|
-
try {
|
|
2117
|
-
resolveActionPaths(action);
|
|
2118
|
-
return false;
|
|
2119
|
-
} catch {
|
|
2120
|
-
return true;
|
|
2121
|
-
}
|
|
2122
|
-
};
|
|
2123
|
-
|
|
2124
|
-
async function nearestExistingPath(candidate) {
|
|
2125
|
-
let current = candidate;
|
|
2126
|
-
while (!(await pathExists(current))) {
|
|
2127
|
-
const parent = path.dirname(current);
|
|
2128
|
-
if (parent === current) {
|
|
2129
|
-
break;
|
|
2130
|
-
}
|
|
2131
|
-
current = parent;
|
|
2132
|
-
}
|
|
2133
|
-
return current;
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
async function assertRealPathContainment(action, actionPaths) {
|
|
2137
|
-
const realRepoRoot = await realpath(repoRoot);
|
|
2138
|
-
for (const [field, candidate] of Object.entries(actionPaths)) {
|
|
2139
|
-
const ancestor = await nearestExistingPath(candidate);
|
|
2140
|
-
const realAncestor = await realpath(ancestor);
|
|
2141
|
-
if (!isPathWithin(realRepoRoot, realAncestor)) {
|
|
2142
|
-
throw new Error(
|
|
2143
|
-
`Harness action ${field} path escapes the repository: ${actionPathValue(action, field)}`,
|
|
2144
|
-
);
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
async function writeAdapterConfig(adapterId, availableHooks) {
|
|
2150
|
-
if (adapterId === "codex") {
|
|
2151
|
-
await writeConfinedTextFile(codexConfigPath, buildCodexAgentConfig(availableHooks));
|
|
2152
|
-
await removeConfinedPath(path.join(codexDir, "hooks.json"));
|
|
2153
|
-
return;
|
|
2154
|
-
}
|
|
2155
|
-
if (adapterId === "claude") {
|
|
2156
|
-
await assertConfinedRegularFile(claudeSettingsPath);
|
|
2157
|
-
await writeConfinedTextFile(
|
|
2158
|
-
claudeSettingsPath,
|
|
2159
|
-
encodeJson(buildClaudeSettingsConfig(await readJsonFile(claudeSettingsPath), availableHooks)),
|
|
2160
|
-
);
|
|
2161
|
-
return;
|
|
2162
|
-
}
|
|
2163
|
-
if (adapterId === "cursor") {
|
|
2164
|
-
await writeConfinedTextFile(
|
|
2165
|
-
cursorHooksJsonPath,
|
|
2166
|
-
encodeJson(buildCursorHooksConfig(availableHooks)),
|
|
2167
|
-
);
|
|
2168
|
-
return;
|
|
2169
|
-
}
|
|
2170
|
-
if (adapterId === "opencode") {
|
|
2171
|
-
await assertConfinedRegularFile(opencodeConfigPath);
|
|
2172
|
-
await writeConfinedTextFile(
|
|
2173
|
-
opencodeConfigPath,
|
|
2174
|
-
encodeOpenCodeConfig(
|
|
2175
|
-
buildOpenCodeConfig(await readJsonFile(opencodeConfigPath), availableHooks),
|
|
2176
|
-
),
|
|
2177
|
-
);
|
|
2178
|
-
}
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
const hookIdForAction = (action) =>
|
|
2182
|
-
action.id.includes(":lifecycle-hook:") ? action.trace?.contribution?.id : undefined;
|
|
2183
|
-
|
|
2184
|
-
const isManagedCanonicalSource = (source) =>
|
|
2185
|
-
typeof source === "string" && source.replaceAll("\\", "/").startsWith(".agents/");
|
|
2186
|
-
|
|
2187
|
-
async function reconcileLifecycleHooks(action, adapterId, actionPaths) {
|
|
2188
|
-
const activeHookIds = new Set();
|
|
2189
|
-
for (const hookId of action.hookIds) {
|
|
2190
|
-
if (await pathExists(path.join(sharedHooksPath, `${hookId}.mjs`))) {
|
|
2191
|
-
activeHookIds.add(hookId);
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
for (const [index, managedHookFile] of action.managedHookFiles.entries()) {
|
|
2195
|
-
const hookId = path.basename(managedHookFile, ".mjs");
|
|
2196
|
-
if (!activeHookIds.has(hookId)) {
|
|
2197
|
-
await removeConfinedPath(actionPaths[`managedHookFiles[${index}]`], { recursive: true });
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
const projectedHooks = {
|
|
2201
|
-
hasFormatHook: action.configurations.some(
|
|
2202
|
-
(configuration) =>
|
|
2203
|
-
hookIdForAction(configuration) === "format-edited-file" &&
|
|
2204
|
-
activeHookIds.has("format-edited-file"),
|
|
2205
|
-
),
|
|
2206
|
-
hasUpdateCheckHook: action.configurations.some(
|
|
2207
|
-
(configuration) =>
|
|
2208
|
-
hookIdForAction(configuration) === "scaffold-update-check" &&
|
|
2209
|
-
activeHookIds.has("scaffold-update-check"),
|
|
2210
|
-
),
|
|
2211
|
-
};
|
|
2212
|
-
if (
|
|
2213
|
-
adapterId !== "opencode" ||
|
|
2214
|
-
projectedHooks.hasFormatHook ||
|
|
2215
|
-
(await pathExists(opencodeConfigPath))
|
|
2216
|
-
) {
|
|
2217
|
-
await writeAdapterConfig(adapterId, projectedHooks);
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
async function applyHarnessAction(action, application) {
|
|
2222
|
-
const actionPaths = resolveActionPaths(action);
|
|
2223
|
-
await assertRealPathContainment(action, actionPaths);
|
|
2224
|
-
const adapterId = action.trace.adapter.id;
|
|
2225
|
-
|
|
2226
|
-
if (action.operation === "cleanup-managed-agents") {
|
|
2227
|
-
await writeManagedFiles(
|
|
2228
|
-
actionPaths.directory,
|
|
2229
|
-
action.extension,
|
|
2230
|
-
application.rendered[adapterId],
|
|
2231
|
-
false,
|
|
2232
|
-
);
|
|
2233
|
-
return;
|
|
2234
|
-
}
|
|
2235
|
-
if (action.operation === "reconcile-lifecycle-hooks") {
|
|
2236
|
-
await reconcileLifecycleHooks(action, adapterId, actionPaths);
|
|
2237
|
-
return;
|
|
2238
|
-
}
|
|
2239
|
-
if (action.operation === "use-native-mirror") {
|
|
2240
|
-
await syncSkillMirrors();
|
|
2241
|
-
return;
|
|
2242
|
-
}
|
|
2243
|
-
if (
|
|
2244
|
-
action.operation === "use-native-skill" ||
|
|
2245
|
-
action.operation === "use-native-prompt" ||
|
|
2246
|
-
action.operation === "native"
|
|
2247
|
-
) {
|
|
2248
|
-
const canonicalSource = action.source ?? action.canonicalPath;
|
|
2249
|
-
const canonicalSourcePath = actionPaths.source ?? actionPaths.canonicalPath;
|
|
2250
|
-
if (
|
|
2251
|
-
isManagedCanonicalSource(canonicalSource) &&
|
|
2252
|
-
canonicalSourcePath !== undefined &&
|
|
2253
|
-
!(await pathExists(canonicalSourcePath))
|
|
2254
|
-
) {
|
|
2255
|
-
throw new Error(`Missing canonical source: ${canonicalSource}`);
|
|
2256
|
-
}
|
|
2257
|
-
return;
|
|
2258
|
-
}
|
|
2259
|
-
if (action.operation === "mirror") {
|
|
2260
|
-
if (action.source !== action.target) {
|
|
2261
|
-
const sourcePath = actionPaths.source;
|
|
2262
|
-
const targetPath = actionPaths.target;
|
|
2263
|
-
if (!(await pathExists(sourcePath))) {
|
|
2264
|
-
throw new Error(`Missing canonical source: ${action.source}`);
|
|
2265
|
-
}
|
|
2266
|
-
if (await pathExists(targetPath)) {
|
|
2267
|
-
const targetStat = await lstat(targetPath);
|
|
2268
|
-
const previousCopy = previousCopyFallbacks.find(
|
|
2269
|
-
(copy) => copy.source === action.source && copy.target === action.target,
|
|
2270
|
-
);
|
|
2271
|
-
const isManagedCopy =
|
|
2272
|
-
targetStat.isFile() &&
|
|
2273
|
-
previousCopy !== undefined &&
|
|
2274
|
-
(await fileDigest(targetPath)) === previousCopy.digest;
|
|
2275
|
-
if (
|
|
2276
|
-
!targetStat.isSymbolicLink() &&
|
|
2277
|
-
!isManagedCopy &&
|
|
2278
|
-
action.id.includes(":scoped-prompt:")
|
|
2279
|
-
) {
|
|
2280
|
-
throw new Error(
|
|
2281
|
-
`Consumer prompt target requires explicit preservation: ${action.target}`,
|
|
2282
|
-
);
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
await ensureSymlink(targetPath, sourcePath, {
|
|
2286
|
-
source: action.source,
|
|
2287
|
-
target: action.target,
|
|
2288
|
-
});
|
|
2289
|
-
}
|
|
2290
|
-
return;
|
|
2291
|
-
}
|
|
2292
|
-
if (action.operation === "merge-json" || action.operation === "merge-toml") {
|
|
2293
|
-
return;
|
|
2294
|
-
}
|
|
2295
|
-
if (action.operation === "render-template" || action.operation === "render") {
|
|
2296
|
-
const name = action.templateId ?? action.contributionId;
|
|
2297
|
-
const content = application.rendered[adapterId]?.[name];
|
|
2298
|
-
const target = actionTargetPath(action);
|
|
2299
|
-
if (typeof content !== "string" || target === undefined) {
|
|
2300
|
-
throw new Error(`Missing ${adapterId} render input for ${name ?? "unknown template"}`);
|
|
2301
|
-
}
|
|
2302
|
-
const targetPath = resolveActionPath(target, "target");
|
|
2303
|
-
await writeConfinedTextFile(targetPath, content);
|
|
2304
|
-
return;
|
|
2305
|
-
}
|
|
2306
|
-
|
|
2307
|
-
throw new Error(`Unknown harness application operation: ${action.operation}`);
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
async function cleanupManagedAgents(application, writeCurrent = false) {
|
|
2311
|
-
for (const [adapterId, surface] of Object.entries(harnessAgentSurface)) {
|
|
2312
|
-
const rendered = application.rendered[adapterId];
|
|
2313
|
-
await writeManagedFiles(surface.directory, surface.extension, rendered, writeCurrent);
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
|
|
2317
|
-
async function materializeLegacyHarnesses(application) {
|
|
2318
|
-
await writeAdapterConfig("codex", application.availableHooks);
|
|
2319
|
-
await writeAdapterConfig("claude", application.availableHooks);
|
|
2320
|
-
await writeAdapterConfig("cursor", application.availableHooks);
|
|
2321
|
-
if (application.availableHooks.hasFormatHook || (await pathExists(opencodeConfigPath))) {
|
|
2322
|
-
await writeAdapterConfig("opencode", application.availableHooks);
|
|
2323
|
-
}
|
|
2324
|
-
await cleanupManagedAgents(application, true);
|
|
2325
|
-
await syncPromptMirrors();
|
|
2326
|
-
await syncSkillMirrors();
|
|
2327
|
-
await syncHookSurface();
|
|
2328
|
-
}
|
|
2329
|
-
|
|
2330
|
-
const summaryState = (summary) =>
|
|
2331
|
-
summary._tag === "HarnessProjectionFailure"
|
|
2332
|
-
? {
|
|
2333
|
-
applied: summary.completed,
|
|
2334
|
-
omissions: summary.omissions,
|
|
2335
|
-
failures: summary.errors,
|
|
2336
|
-
}
|
|
2337
|
-
: {
|
|
2338
|
-
applied: summary.applied,
|
|
2339
|
-
omissions: summary._tag === "HarnessProjectionPartial" ? summary.omissions : [],
|
|
2340
|
-
failures: [],
|
|
2341
|
-
};
|
|
2342
|
-
|
|
2343
|
-
const neutralOmissionEvidence = ({ warning, ...omission }) => ({
|
|
2344
|
-
...omission,
|
|
2345
|
-
family: warning.family,
|
|
2346
|
-
reason: warning.reason,
|
|
2347
|
-
});
|
|
2348
|
-
|
|
2349
|
-
const projectionEvidence = ({ adapter, projection, summary }) => {
|
|
2350
|
-
const state = summaryState(summary);
|
|
2351
|
-
return {
|
|
2352
|
-
adapter: adapter.matrix.adapter,
|
|
2353
|
-
matrixVersion: adapter.matrix.matrixVersion,
|
|
2354
|
-
actions: projection.actions,
|
|
2355
|
-
warnings: [],
|
|
2356
|
-
limitations: state.applied
|
|
2357
|
-
.filter(({ support }) => support === "degraded")
|
|
2358
|
-
.map(({ reason, trace }) => ({
|
|
2359
|
-
_tag: "HarnessCapabilityLimitation",
|
|
2360
|
-
reason,
|
|
2361
|
-
trace,
|
|
2362
|
-
})),
|
|
2363
|
-
omissions: state.omissions.map(neutralOmissionEvidence),
|
|
2364
|
-
failures: state.failures,
|
|
2365
|
-
};
|
|
2366
|
-
};
|
|
2367
|
-
|
|
2368
|
-
const receiptStatus = (projections) =>
|
|
2369
|
-
projections.some(({ failures }) => failures.length > 0)
|
|
2370
|
-
? "failure"
|
|
2371
|
-
: projections.some(({ warnings }) => warnings.length > 0)
|
|
2372
|
-
? "partial"
|
|
2373
|
-
: "success";
|
|
2374
|
-
|
|
2375
|
-
const projectSafely = (adapter, contextPlan) => {
|
|
2376
|
-
try {
|
|
2377
|
-
const issue = canonicalContextIssue(contextPlan);
|
|
2378
|
-
if (issue !== undefined) {
|
|
2379
|
-
throw new Error(issue);
|
|
2380
|
-
}
|
|
2381
|
-
return project({ adapter, contextPlan });
|
|
2382
|
-
} catch (error) {
|
|
2383
|
-
return {
|
|
2384
|
-
actions: [],
|
|
2385
|
-
summary: {
|
|
2386
|
-
_tag: "HarnessProjectionFailure",
|
|
2387
|
-
completed: [],
|
|
2388
|
-
omissions: [],
|
|
2389
|
-
errors: [
|
|
2390
|
-
{
|
|
2391
|
-
_tag: "InvalidHarnessProjectionError",
|
|
2392
|
-
trace: {
|
|
2393
|
-
contextPlanVersion: contextPlanVersion(contextPlan),
|
|
2394
|
-
scopeId: "unknown",
|
|
2395
|
-
kind: "skill",
|
|
2396
|
-
contribution: { id: "context-plan", version: "unknown" },
|
|
2397
|
-
adapter: adapter.matrix.adapter,
|
|
2398
|
-
matrixVersion: adapter.matrix.matrixVersion,
|
|
2399
|
-
},
|
|
2400
|
-
message: error instanceof Error ? error.message : "Invalid canonical context plan",
|
|
2401
|
-
},
|
|
2402
|
-
],
|
|
2403
|
-
},
|
|
2404
|
-
};
|
|
2405
|
-
}
|
|
2406
|
-
};
|
|
2407
|
-
|
|
2408
|
-
const structuralIdentity = (value) => {
|
|
2409
|
-
if (Array.isArray(value)) return `[${value.map(structuralIdentity).join(",")}]`;
|
|
2410
|
-
if (isObject(value)) {
|
|
2411
|
-
return `{${Object.entries(value)
|
|
2412
|
-
.toSorted(([left], [right]) => (left === right ? 0 : left < right ? -1 : 1))
|
|
2413
|
-
.map(([key, entry]) => `${JSON.stringify(key)}:${structuralIdentity(entry)}`)
|
|
2414
|
-
.join(",")}}`;
|
|
2415
|
-
}
|
|
2416
|
-
return JSON.stringify(value) ?? String(value);
|
|
2417
|
-
};
|
|
2418
|
-
|
|
2419
|
-
const normalizeProjectionSummary = (summary) => {
|
|
2420
|
-
const sort = (values) =>
|
|
2421
|
-
[...values].toSorted((left, right) => {
|
|
2422
|
-
const leftIdentity = structuralIdentity(left);
|
|
2423
|
-
const rightIdentity = structuralIdentity(right);
|
|
2424
|
-
return leftIdentity === rightIdentity ? 0 : leftIdentity < rightIdentity ? -1 : 1;
|
|
2425
|
-
});
|
|
2426
|
-
if (summary._tag === "HarnessProjectionSuccess") {
|
|
2427
|
-
return { ...summary, applied: sort(summary.applied) };
|
|
2428
|
-
}
|
|
2429
|
-
if (summary._tag === "HarnessProjectionPartial") {
|
|
2430
|
-
return { ...summary, applied: sort(summary.applied), omissions: sort(summary.omissions) };
|
|
2431
|
-
}
|
|
2432
|
-
return {
|
|
2433
|
-
...summary,
|
|
2434
|
-
completed: sort(summary.completed),
|
|
2435
|
-
errors: sort(summary.errors),
|
|
2436
|
-
omissions: sort(summary.omissions),
|
|
2437
|
-
};
|
|
2438
|
-
};
|
|
2439
|
-
|
|
2440
|
-
const normalizeProjection = (projection) => ({
|
|
2441
|
-
actions: [...projection.actions].toSorted((left, right) =>
|
|
2442
|
-
left.id === right.id ? 0 : left.id < right.id ? -1 : 1,
|
|
2443
|
-
),
|
|
2444
|
-
summary: normalizeProjectionSummary(projection.summary),
|
|
2445
|
-
});
|
|
2446
|
-
|
|
2447
|
-
const withManagedAgentCleanup = (adapter, contextPlan, projection) => {
|
|
2448
|
-
const surface = harnessAgentSurface[adapter.matrix.adapter.id];
|
|
2449
|
-
if (canonicalContextIssue(contextPlan) !== undefined || surface === undefined) {
|
|
2450
|
-
return projection;
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
return {
|
|
2454
|
-
...projection,
|
|
2455
|
-
actions: [
|
|
2456
|
-
{
|
|
2457
|
-
id: `${adapter.matrix.adapter.id}:cleanup-managed-agents`,
|
|
2458
|
-
operation: "cleanup-managed-agents",
|
|
2459
|
-
directory: path.relative(repoRoot, surface.directory),
|
|
2460
|
-
extension: surface.extension,
|
|
2461
|
-
trace: {
|
|
2462
|
-
contextPlanVersion: contextPlan.version,
|
|
2463
|
-
operation: "managed-agent-cleanup",
|
|
2464
|
-
adapter: adapter.matrix.adapter,
|
|
2465
|
-
matrixVersion: adapter.matrix.matrixVersion,
|
|
2466
|
-
},
|
|
2467
|
-
},
|
|
2468
|
-
...projection.actions,
|
|
2469
|
-
],
|
|
2470
|
-
};
|
|
2471
|
-
};
|
|
2472
|
-
|
|
2473
|
-
const withLifecycleHookReconciliation = (adapter, contextPlan, projection) => {
|
|
2474
|
-
if (canonicalContextIssue(contextPlan) !== undefined) {
|
|
2475
|
-
return projection;
|
|
2476
|
-
}
|
|
2477
|
-
const configPath = harnessConfigPath[adapter.matrix.adapter.id];
|
|
2478
|
-
const hookDirectory = harnessHookSurface[adapter.matrix.adapter.id];
|
|
2479
|
-
const lifecycleActions = projection.actions.filter((action) =>
|
|
2480
|
-
action.id.includes(":lifecycle-hook:"),
|
|
2481
|
-
);
|
|
2482
|
-
return {
|
|
2483
|
-
...projection,
|
|
2484
|
-
actions: [
|
|
2485
|
-
...projection.actions,
|
|
2486
|
-
{
|
|
2487
|
-
id: `${adapter.matrix.adapter.id}:reconcile-lifecycle-hooks`,
|
|
2488
|
-
operation: "reconcile-lifecycle-hooks",
|
|
2489
|
-
file: path.relative(repoRoot, configPath),
|
|
2490
|
-
managedHookFiles: ["format-edited-file", "scaffold-update-check"].map((hookId) =>
|
|
2491
|
-
path.relative(repoRoot, path.join(hookDirectory, `${hookId}.mjs`)),
|
|
2492
|
-
),
|
|
2493
|
-
hookIds: [
|
|
2494
|
-
...new Set(
|
|
2495
|
-
lifecycleActions.map(hookIdForAction).filter((hookId) => hookId !== undefined),
|
|
2496
|
-
),
|
|
2497
|
-
].toSorted(),
|
|
2498
|
-
configurations: lifecycleActions.filter(
|
|
2499
|
-
(action) =>
|
|
2500
|
-
action.operation === "merge-json" ||
|
|
2501
|
-
action.operation === "merge-toml" ||
|
|
2502
|
-
action.config !== undefined,
|
|
2503
|
-
),
|
|
2504
|
-
trace: {
|
|
2505
|
-
contextPlanVersion: contextPlan.version,
|
|
2506
|
-
operation: "lifecycle-hook-reconciliation",
|
|
2507
|
-
adapter: adapter.matrix.adapter,
|
|
2508
|
-
matrixVersion: adapter.matrix.matrixVersion,
|
|
2509
|
-
},
|
|
2510
|
-
},
|
|
2511
|
-
],
|
|
2512
|
-
};
|
|
2513
|
-
};
|
|
2514
|
-
|
|
2515
|
-
const sameTrace = (left, right) =>
|
|
2516
|
-
left.contextPlanVersion === right.contextPlanVersion &&
|
|
2517
|
-
left.scopeId === right.scopeId &&
|
|
2518
|
-
left.kind === right.kind &&
|
|
2519
|
-
left.contribution.id === right.contribution.id &&
|
|
2520
|
-
left.contribution.version === right.contribution.version &&
|
|
2521
|
-
left.adapter.id === right.adapter.id &&
|
|
2522
|
-
left.adapter.version === right.adapter.version &&
|
|
2523
|
-
left.matrixVersion === right.matrixVersion;
|
|
2524
|
-
|
|
2525
|
-
const withApplicationOmissions = (summary, omissions) => {
|
|
2526
|
-
if (omissions.length === 0) {
|
|
2527
|
-
return summary;
|
|
2528
|
-
}
|
|
2529
|
-
const omittedTraces = omissions.map(({ trace }) => trace);
|
|
2530
|
-
const keepApplied = ({ trace }) => !omittedTraces.some((omitted) => sameTrace(trace, omitted));
|
|
2531
|
-
|
|
2532
|
-
if (summary._tag === "HarnessProjectionFailure") {
|
|
2533
|
-
return {
|
|
2534
|
-
...summary,
|
|
2535
|
-
completed: summary.completed.filter(keepApplied),
|
|
2536
|
-
omissions: [...summary.omissions, ...omissions],
|
|
2537
|
-
};
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
const applied = summary.applied.filter(keepApplied);
|
|
2541
|
-
return {
|
|
2542
|
-
_tag: "HarnessProjectionPartial",
|
|
2543
|
-
applied,
|
|
2544
|
-
omissions: [
|
|
2545
|
-
...(summary._tag === "HarnessProjectionPartial" ? summary.omissions : []),
|
|
2546
|
-
...omissions,
|
|
2547
|
-
],
|
|
2548
|
-
};
|
|
2549
|
-
};
|
|
2550
|
-
|
|
2551
|
-
async function prepareProjectionApplication(projection) {
|
|
2552
|
-
const actions = [];
|
|
2553
|
-
const omissions = [];
|
|
2554
|
-
|
|
2555
|
-
for (const action of projection.actions) {
|
|
2556
|
-
let canonicalSourcePath;
|
|
2557
|
-
if (action.id.includes(":scoped-prompt:")) {
|
|
2558
|
-
const canonicalSource = action.source ?? action.canonicalPath;
|
|
2559
|
-
try {
|
|
2560
|
-
canonicalSourcePath =
|
|
2561
|
-
typeof canonicalSource === "string"
|
|
2562
|
-
? resolveActionPath(canonicalSource, "source")
|
|
2563
|
-
: undefined;
|
|
2564
|
-
} catch {
|
|
2565
|
-
actions.push(action);
|
|
2566
|
-
continue;
|
|
2567
|
-
}
|
|
2568
|
-
if (canonicalSourcePath !== undefined && !(await pathExists(canonicalSourcePath))) {
|
|
2569
|
-
if (isManagedCanonicalSource(canonicalSource)) {
|
|
2570
|
-
actions.push(action);
|
|
2571
|
-
} else {
|
|
2572
|
-
omissions.push({
|
|
2573
|
-
_tag: "HarnessApplicationOmission",
|
|
2574
|
-
support: "missing",
|
|
2575
|
-
trace: action.trace,
|
|
2576
|
-
warning: {
|
|
2577
|
-
_tag: "MissingCanonicalPromptWarning",
|
|
2578
|
-
family: "scoped-prompt",
|
|
2579
|
-
reason: `Missing canonical prompt source at ${canonicalSource}`,
|
|
2580
|
-
},
|
|
2581
|
-
});
|
|
2582
|
-
}
|
|
2583
|
-
continue;
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
let targetPath;
|
|
2587
|
-
try {
|
|
2588
|
-
targetPath = resolveActionPaths(action).target;
|
|
2589
|
-
} catch {
|
|
2590
|
-
actions.push(action);
|
|
2591
|
-
continue;
|
|
2592
|
-
}
|
|
2593
|
-
if (
|
|
2594
|
-
action.operation === "mirror" &&
|
|
2595
|
-
action.id.includes(":scoped-prompt:") &&
|
|
2596
|
-
action.source !== action.target &&
|
|
2597
|
-
(await pathExists(targetPath))
|
|
2598
|
-
) {
|
|
2599
|
-
const targetStat = await lstat(targetPath);
|
|
2600
|
-
const isManagedSymlink =
|
|
2601
|
-
targetStat.isSymbolicLink() &&
|
|
2602
|
-
canonicalSourcePath !== undefined &&
|
|
2603
|
-
(await readlink(targetPath)) ===
|
|
2604
|
-
path.relative(path.dirname(targetPath), canonicalSourcePath);
|
|
2605
|
-
const previousCopy = previousCopyFallbacks.find(
|
|
2606
|
-
(copy) => copy.source === action.source && copy.target === action.target,
|
|
2607
|
-
);
|
|
2608
|
-
const isManagedCopy =
|
|
2609
|
-
!targetStat.isSymbolicLink() &&
|
|
2610
|
-
targetStat.isFile() &&
|
|
2611
|
-
previousCopy !== undefined &&
|
|
2612
|
-
(await fileDigest(targetPath)) === previousCopy.digest;
|
|
2613
|
-
if (!isManagedSymlink && !isManagedCopy) {
|
|
2614
|
-
omissions.push({
|
|
2615
|
-
_tag: "HarnessApplicationOmission",
|
|
2616
|
-
support: "preserved",
|
|
2617
|
-
trace: action.trace,
|
|
2618
|
-
warning: {
|
|
2619
|
-
_tag: "PreservedConsumerPromptWarning",
|
|
2620
|
-
family: "scoped-prompt",
|
|
2621
|
-
reason: `Preserved consumer-owned prompt at ${action.target}`,
|
|
2622
|
-
},
|
|
2623
|
-
});
|
|
2624
|
-
continue;
|
|
2625
|
-
}
|
|
2626
|
-
}
|
|
2627
|
-
actions.push(action);
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
return {
|
|
2631
|
-
actions,
|
|
2632
|
-
summary: withApplicationOmissions(projection.summary, omissions),
|
|
2633
|
-
};
|
|
2634
|
-
}
|
|
2635
|
-
|
|
2636
|
-
async function readContextPlan() {
|
|
2637
|
-
try {
|
|
2638
|
-
return {
|
|
2639
|
-
exists: true,
|
|
2640
|
-
value: JSON.parse(await readFile(contextPlanPath, "utf8")),
|
|
2641
|
-
};
|
|
2642
|
-
} catch (error) {
|
|
2643
|
-
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
2644
|
-
return { exists: false, value: undefined };
|
|
2645
|
-
}
|
|
2646
|
-
return {
|
|
2647
|
-
exists: true,
|
|
2648
|
-
value: {
|
|
2649
|
-
version: "unknown",
|
|
2650
|
-
scopes: null,
|
|
2651
|
-
parseError: error instanceof Error ? error.message : "Malformed canonical context plan",
|
|
2652
|
-
},
|
|
2653
|
-
};
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
|
-
async function readProjectionPlan() {
|
|
2658
|
-
const projectionPlanPath = process.env.DP_HARNESS_PROJECTION_PLAN;
|
|
2659
|
-
if (projectionPlanPath === undefined) {
|
|
2660
|
-
return { exists: false, value: undefined };
|
|
2661
|
-
}
|
|
2662
|
-
try {
|
|
2663
|
-
const value = JSON.parse(await readFile(projectionPlanPath, "utf8"));
|
|
2664
|
-
if (
|
|
2665
|
-
!isObject(value) ||
|
|
2666
|
-
value.version !== "1" ||
|
|
2667
|
-
typeof value.contextPlanVersion !== "string" ||
|
|
2668
|
-
!Array.isArray(value.projections)
|
|
2669
|
-
) {
|
|
2670
|
-
throw new Error("Invalid supplied harness projection plan");
|
|
2671
|
-
}
|
|
2672
|
-
return { exists: true, value };
|
|
2673
|
-
} catch (error) {
|
|
2674
|
-
throw new Error("Invalid supplied harness projection plan", { cause: error });
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
|
|
2678
|
-
const projectionSummaryShapeIssue = (summary) => {
|
|
2679
|
-
if (!isObject(summary)) return "Projection summary must be an object";
|
|
2680
|
-
if (summary._tag === "HarnessProjectionSuccess") {
|
|
2681
|
-
return Array.isArray(summary.applied) ? undefined : "Success summary must contain applied";
|
|
2682
|
-
}
|
|
2683
|
-
if (summary._tag === "HarnessProjectionPartial") {
|
|
2684
|
-
return Array.isArray(summary.applied) && Array.isArray(summary.omissions)
|
|
2685
|
-
? undefined
|
|
2686
|
-
: "Partial summary must contain applied and omissions";
|
|
2687
|
-
}
|
|
2688
|
-
if (summary._tag === "HarnessProjectionFailure") {
|
|
2689
|
-
return Array.isArray(summary.completed) &&
|
|
2690
|
-
Array.isArray(summary.omissions) &&
|
|
2691
|
-
Array.isArray(summary.errors)
|
|
2692
|
-
? undefined
|
|
2693
|
-
: "Failure summary must contain completed, omissions, and errors";
|
|
2694
|
-
}
|
|
2695
|
-
return "Projection summary tag is invalid";
|
|
2696
|
-
};
|
|
2697
|
-
|
|
2698
|
-
const actionTraceMatches = ({ trace, plan, projection, contextPlan }) =>
|
|
2699
|
-
exactKeys(trace, [
|
|
2700
|
-
"contextPlanVersion",
|
|
2701
|
-
"scopeId",
|
|
2702
|
-
"kind",
|
|
2703
|
-
"contribution",
|
|
2704
|
-
"adapter",
|
|
2705
|
-
"matrixVersion",
|
|
2706
|
-
]) &&
|
|
2707
|
-
trace.contextPlanVersion === plan.contextPlanVersion &&
|
|
2708
|
-
isNonEmptyString(trace.scopeId) &&
|
|
2709
|
-
contributionKinds.has(trace.kind) &&
|
|
2710
|
-
exactKeys(trace.contribution, ["id", "version"]) &&
|
|
2711
|
-
isNonEmptyString(trace.contribution.id) &&
|
|
2712
|
-
isNonEmptyString(trace.contribution.version) &&
|
|
2713
|
-
exactKeys(trace.adapter, ["id", "version"]) &&
|
|
2714
|
-
trace.adapter.id === projection.matrix.adapter.id &&
|
|
2715
|
-
trace.adapter.version === projection.matrix.adapter.version &&
|
|
2716
|
-
trace.matrixVersion === projection.matrix.matrixVersion &&
|
|
2717
|
-
Array.isArray(contextPlan?.scopes) &&
|
|
2718
|
-
contextPlan.scopes.some(
|
|
2719
|
-
(scope) =>
|
|
2720
|
-
scope?.id === trace.scopeId &&
|
|
2721
|
-
Array.isArray(scope.contributions) &&
|
|
2722
|
-
scope.contributions.some(
|
|
2723
|
-
(contribution) =>
|
|
2724
|
-
contribution?.kind === trace.kind &&
|
|
2725
|
-
contribution?.identity?.id === trace.contribution.id &&
|
|
2726
|
-
contribution.identity.version === trace.contribution.version,
|
|
2727
|
-
),
|
|
2728
|
-
);
|
|
2729
|
-
|
|
2730
|
-
const contributionTraceKey = (trace) =>
|
|
2731
|
-
[
|
|
2732
|
-
trace.contextPlanVersion,
|
|
2733
|
-
trace.scopeId,
|
|
2734
|
-
trace.kind,
|
|
2735
|
-
trace.contribution.id,
|
|
2736
|
-
trace.contribution.version,
|
|
2737
|
-
trace.adapter.id,
|
|
2738
|
-
trace.adapter.version,
|
|
2739
|
-
trace.matrixVersion,
|
|
2740
|
-
].join("\u0000");
|
|
2741
|
-
|
|
2742
|
-
const projectionSummaryIssue = ({ summary, plan, projection, contextPlan }) => {
|
|
2743
|
-
const shapeIssue = projectionSummaryShapeIssue(summary);
|
|
2744
|
-
if (shapeIssue !== undefined) return shapeIssue;
|
|
2745
|
-
const applied = summary._tag === "HarnessProjectionFailure" ? summary.completed : summary.applied;
|
|
2746
|
-
const omissions = summary._tag === "HarnessProjectionSuccess" ? [] : summary.omissions;
|
|
2747
|
-
const errors = summary._tag === "HarnessProjectionFailure" ? summary.errors : [];
|
|
2748
|
-
if (
|
|
2749
|
-
applied.some(
|
|
2750
|
-
(outcome) =>
|
|
2751
|
-
!isObject(outcome) ||
|
|
2752
|
-
outcome._tag !== "HarnessProjectionApplied" ||
|
|
2753
|
-
(outcome.support !== "supported" && outcome.support !== "degraded") ||
|
|
2754
|
-
(outcome.support === "degraded" && !isNonEmptyString(outcome.reason)),
|
|
2755
|
-
)
|
|
2756
|
-
) {
|
|
2757
|
-
return "Projection summary contains an invalid applied outcome";
|
|
2758
|
-
}
|
|
2759
|
-
if (
|
|
2760
|
-
omissions.some(
|
|
2761
|
-
(outcome) =>
|
|
2762
|
-
!isObject(outcome) ||
|
|
2763
|
-
outcome._tag !== "HarnessProjectionOmission" ||
|
|
2764
|
-
outcome.support !== "unsupported" ||
|
|
2765
|
-
!isObject(outcome.warning) ||
|
|
2766
|
-
outcome.warning._tag !== "UnsupportedHarnessCapabilityWarning" ||
|
|
2767
|
-
!contributionKinds.has(outcome.warning.family) ||
|
|
2768
|
-
!isNonEmptyString(outcome.warning.reason),
|
|
2769
|
-
)
|
|
2770
|
-
) {
|
|
2771
|
-
return "Projection summary contains an invalid omission";
|
|
2772
|
-
}
|
|
2773
|
-
if (
|
|
2774
|
-
errors.some(
|
|
2775
|
-
(outcome) =>
|
|
2776
|
-
!isObject(outcome) ||
|
|
2777
|
-
(outcome._tag !== "HarnessAdapterDefectError" &&
|
|
2778
|
-
outcome._tag !== "InvalidHarnessProjectionError") ||
|
|
2779
|
-
!isNonEmptyString(outcome.message),
|
|
2780
|
-
)
|
|
2781
|
-
) {
|
|
2782
|
-
return "Projection summary contains an invalid error";
|
|
2783
|
-
}
|
|
2784
|
-
const outcomes = [...applied, ...omissions, ...errors];
|
|
2785
|
-
return outcomes.some(
|
|
2786
|
-
(outcome) =>
|
|
2787
|
-
!isObject(outcome) ||
|
|
2788
|
-
!isObject(outcome.trace) ||
|
|
2789
|
-
!actionTraceMatches({ trace: outcome.trace, plan, projection, contextPlan }),
|
|
2790
|
-
)
|
|
2791
|
-
? "Projection summary contains an invalid trace"
|
|
2792
|
-
: (() => {
|
|
2793
|
-
const actionTraces = new Set(
|
|
2794
|
-
projection.actions.map(({ trace }) => contributionTraceKey(trace)),
|
|
2795
|
-
);
|
|
2796
|
-
const appliedTraces = new Set(applied.map(({ trace }) => contributionTraceKey(trace)));
|
|
2797
|
-
return actionTraces.size !== appliedTraces.size ||
|
|
2798
|
-
[...actionTraces].some((trace) => !appliedTraces.has(trace))
|
|
2799
|
-
? "Projection summary traces do not match projection actions"
|
|
2800
|
-
: undefined;
|
|
2801
|
-
})();
|
|
2802
|
-
};
|
|
2803
|
-
|
|
2804
|
-
const validateProjectionPlan = ({ plan, contextPlan }) => {
|
|
2805
|
-
const contextIssue = canonicalContextIssue(contextPlan);
|
|
2806
|
-
if (contextIssue !== undefined) {
|
|
2807
|
-
throw new Error(`Supplied harness projection plan requires canonical context: ${contextIssue}`);
|
|
2808
|
-
}
|
|
2809
|
-
if (plan.contextPlanVersion !== contextPlanVersion(contextPlan)) {
|
|
2810
|
-
throw new Error("Supplied harness projection plan context version does not match");
|
|
2811
|
-
}
|
|
2812
|
-
const adaptersById = new Map(adapters.map((adapter) => [adapter.matrix.adapter.id, adapter]));
|
|
2813
|
-
const ids = plan.projections.map((projection) => projection?.matrix?.adapter?.id);
|
|
2814
|
-
if (
|
|
2815
|
-
ids.length !== adapters.length ||
|
|
2816
|
-
new Set(ids).size !== ids.length ||
|
|
2817
|
-
ids.some((id) => !adaptersById.has(id))
|
|
2818
|
-
) {
|
|
2819
|
-
throw new Error(
|
|
2820
|
-
"Supplied harness projection plan must contain each known adapter exactly once",
|
|
2821
|
-
);
|
|
2822
|
-
}
|
|
2823
|
-
for (const projection of plan.projections) {
|
|
2824
|
-
const expected = adaptersById.get(projection.matrix.adapter.id);
|
|
2825
|
-
if (
|
|
2826
|
-
projection.matrix.adapter.version !== expected.matrix.adapter.version ||
|
|
2827
|
-
projection.matrix.matrixVersion !== expected.matrix.matrixVersion
|
|
2828
|
-
) {
|
|
2829
|
-
throw new Error(
|
|
2830
|
-
`Supplied harness projection matrix mismatch: ${projection.matrix.adapter.id}`,
|
|
2831
|
-
);
|
|
2832
|
-
}
|
|
2833
|
-
if (
|
|
2834
|
-
!Array.isArray(projection.actions) ||
|
|
2835
|
-
new Set(projection.actions.map((action) => action?.id)).size !== projection.actions.length ||
|
|
2836
|
-
projection.actions.some(
|
|
2837
|
-
(action) =>
|
|
2838
|
-
!isObject(action) ||
|
|
2839
|
-
!isNonEmptyString(action.id) ||
|
|
2840
|
-
!harnessActionOperations.has(action.operation) ||
|
|
2841
|
-
hasInvalidActionPaths(action) ||
|
|
2842
|
-
!isObject(action.trace) ||
|
|
2843
|
-
!actionTraceMatches({ trace: action.trace, plan, projection, contextPlan }),
|
|
2844
|
-
)
|
|
2845
|
-
) {
|
|
2846
|
-
throw new Error(
|
|
2847
|
-
`Supplied harness projection actions are invalid: ${projection.matrix.adapter.id}`,
|
|
2848
|
-
);
|
|
2849
|
-
}
|
|
2850
|
-
const summaryIssue = projectionSummaryIssue({
|
|
2851
|
-
summary: projection.summary,
|
|
2852
|
-
plan,
|
|
2853
|
-
projection,
|
|
2854
|
-
contextPlan,
|
|
2855
|
-
});
|
|
2856
|
-
if (summaryIssue !== undefined) {
|
|
2857
|
-
throw new Error(`${summaryIssue}: ${projection.matrix.adapter.id}`);
|
|
2858
|
-
}
|
|
2859
|
-
const canonical = normalizeProjection(projectSafely(expected, contextPlan));
|
|
2860
|
-
if (
|
|
2861
|
-
JSON.stringify(projection.actions) !== JSON.stringify(canonical.actions) ||
|
|
2862
|
-
JSON.stringify(projection.summary) !== JSON.stringify(canonical.summary)
|
|
2863
|
-
) {
|
|
2864
|
-
throw new Error(
|
|
2865
|
-
`Supplied harness projection is noncanonical: ${projection.matrix.adapter.id}`,
|
|
2866
|
-
);
|
|
2867
|
-
}
|
|
2868
|
-
}
|
|
2869
|
-
return plan;
|
|
2870
|
-
};
|
|
2871
|
-
|
|
2872
|
-
const exactKeys = (value, keys) =>
|
|
2873
|
-
isObject(value) &&
|
|
2874
|
-
Object.keys(value).length === keys.length &&
|
|
2875
|
-
Object.keys(value).every((key) => keys.includes(key));
|
|
2876
|
-
|
|
2877
|
-
const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
2878
|
-
const isOrder = (value) => Number.isInteger(value) && value >= 0;
|
|
2879
|
-
const contributionKinds = new Set([
|
|
2880
|
-
"skill",
|
|
2881
|
-
"scoped-prompt",
|
|
2882
|
-
"lifecycle-hook",
|
|
2883
|
-
"tool-configuration",
|
|
2884
|
-
"subagent-template",
|
|
2885
|
-
"commit-gate",
|
|
2886
|
-
]);
|
|
2887
|
-
|
|
2888
|
-
const identityIssue = (identity) =>
|
|
2889
|
-
exactKeys(identity, ["id", "version"]) &&
|
|
2890
|
-
isNonEmptyString(identity.id) &&
|
|
2891
|
-
isNonEmptyString(identity.version)
|
|
2892
|
-
? undefined
|
|
2893
|
-
: "Context contribution identity is invalid";
|
|
2894
|
-
|
|
2895
|
-
const provenanceIssue = (provenance) =>
|
|
2896
|
-
exactKeys(provenance, ["source", "revision"]) &&
|
|
2897
|
-
isNonEmptyString(provenance.source) &&
|
|
2898
|
-
isNonEmptyString(provenance.revision)
|
|
2899
|
-
? undefined
|
|
2900
|
-
: "Context contribution provenance is invalid";
|
|
2901
|
-
|
|
2902
|
-
const compatibilityIssue = (compatibility) =>
|
|
2903
|
-
Array.isArray(compatibility) &&
|
|
2904
|
-
compatibility.every(
|
|
2905
|
-
(entry) =>
|
|
2906
|
-
exactKeys(entry, ["id", "versionRange"]) &&
|
|
2907
|
-
isNonEmptyString(entry.id) &&
|
|
2908
|
-
isNonEmptyString(entry.versionRange),
|
|
2909
|
-
)
|
|
2910
|
-
? undefined
|
|
2911
|
-
: "Context contribution compatibility is invalid";
|
|
2912
|
-
|
|
2913
|
-
const qualityCommandExecutionModes = new Set(["files", "owner", "repository"]);
|
|
2914
|
-
|
|
2915
|
-
const commitGateContractIssue = (contract) =>
|
|
2916
|
-
(exactKeys(contract, ["lint", "formatCheck"]) ||
|
|
2917
|
-
(exactKeys(contract, ["lint", "formatCheck", "execution"]) &&
|
|
2918
|
-
exactKeys(contract.execution, ["lint", "formatCheck"]) &&
|
|
2919
|
-
qualityCommandExecutionModes.has(contract.execution.lint) &&
|
|
2920
|
-
qualityCommandExecutionModes.has(contract.execution.formatCheck))) &&
|
|
2921
|
-
isNonEmptyString(contract.lint) &&
|
|
2922
|
-
isNonEmptyString(contract.formatCheck)
|
|
2923
|
-
? undefined
|
|
2924
|
-
: "Commit-gate contract must contain non-empty lint and formatCheck strings and optional execution with lint and formatCheck modes: files, owner, or repository";
|
|
2925
|
-
|
|
2926
|
-
const contributionIssue = (contribution) => {
|
|
2927
|
-
const expectedKeys =
|
|
2928
|
-
contribution?.kind === "commit-gate"
|
|
2929
|
-
? ["kind", "identity", "provenance", "compatibility", "references", "order", "contract"]
|
|
2930
|
-
: ["kind", "identity", "provenance", "compatibility", "references", "order"];
|
|
2931
|
-
if (!exactKeys(contribution, expectedKeys)) {
|
|
2932
|
-
return "Context contribution fields are invalid";
|
|
2933
|
-
}
|
|
2934
|
-
return (
|
|
2935
|
-
(!contributionKinds.has(contribution.kind)
|
|
2936
|
-
? "Context contribution kind is invalid"
|
|
2937
|
-
: undefined) ??
|
|
2938
|
-
identityIssue(contribution.identity) ??
|
|
2939
|
-
provenanceIssue(contribution.provenance) ??
|
|
2940
|
-
compatibilityIssue(contribution.compatibility) ??
|
|
2941
|
-
(contribution.kind === "commit-gate"
|
|
2942
|
-
? commitGateContractIssue(contribution.contract)
|
|
2943
|
-
: undefined) ??
|
|
2944
|
-
(!Array.isArray(contribution.references) || !contribution.references.every(isNonEmptyString)
|
|
2945
|
-
? "Context contribution references are invalid"
|
|
2946
|
-
: undefined) ??
|
|
2947
|
-
(!isOrder(contribution.order) ? "Context contribution order is invalid" : undefined)
|
|
2948
|
-
);
|
|
2949
|
-
};
|
|
2950
|
-
|
|
2951
|
-
const scopeIssue = (scope) => {
|
|
2952
|
-
const expectedKeys =
|
|
2953
|
-
scope?.authoring === undefined
|
|
2954
|
-
? ["id", "packs", "contributions"]
|
|
2955
|
-
: ["id", "packs", "contributions", "authoring"];
|
|
2956
|
-
if (!exactKeys(scope, expectedKeys) || !isNonEmptyString(scope.id)) {
|
|
2957
|
-
return "Context scope fields are invalid";
|
|
2958
|
-
}
|
|
2959
|
-
if (scope.authoring !== undefined) {
|
|
2960
|
-
const identity = scope.authoring;
|
|
2961
|
-
if (
|
|
2962
|
-
!exactKeys(identity, ["path", "kind", "contracts", "missingContracts"]) ||
|
|
2963
|
-
!isNonEmptyString(identity.path) ||
|
|
2964
|
-
!isNonEmptyString(identity.kind) ||
|
|
2965
|
-
!Array.isArray(identity.contracts) ||
|
|
2966
|
-
!identity.contracts.every(
|
|
2967
|
-
(contract) =>
|
|
2968
|
-
exactKeys(contract, ["id", "authoringRevision", "activationRevision"]) &&
|
|
2969
|
-
isNonEmptyString(contract.id) &&
|
|
2970
|
-
isNonEmptyString(contract.authoringRevision) &&
|
|
2971
|
-
isNonEmptyString(contract.activationRevision),
|
|
2972
|
-
) ||
|
|
2973
|
-
!Array.isArray(identity.missingContracts) ||
|
|
2974
|
-
!identity.missingContracts.every(isNonEmptyString)
|
|
2975
|
-
) {
|
|
2976
|
-
return `Context scope ${scope.id} authoring identity is invalid`;
|
|
2977
|
-
}
|
|
2978
|
-
}
|
|
2979
|
-
if (
|
|
2980
|
-
!Array.isArray(scope.packs) ||
|
|
2981
|
-
!scope.packs.every(
|
|
2982
|
-
(pack) =>
|
|
2983
|
-
exactKeys(pack, ["id", "order"]) && isNonEmptyString(pack.id) && isOrder(pack.order),
|
|
2984
|
-
)
|
|
2985
|
-
) {
|
|
2986
|
-
return `Context scope ${scope.id} packs are invalid`;
|
|
2987
|
-
}
|
|
2988
|
-
if (!Array.isArray(scope.contributions)) {
|
|
2989
|
-
return `Context scope ${scope.id} contributions must be an array`;
|
|
2990
|
-
}
|
|
2991
|
-
for (const contribution of scope.contributions) {
|
|
2992
|
-
const issue = contributionIssue(contribution);
|
|
2993
|
-
if (issue !== undefined) {
|
|
2994
|
-
return `${issue} in scope ${scope.id}`;
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2997
|
-
return undefined;
|
|
2998
|
-
};
|
|
2999
|
-
|
|
3000
|
-
function contextPlanIssue(contextPlan) {
|
|
3001
|
-
if (!exactKeys(contextPlan, ["version", "scopes"])) {
|
|
3002
|
-
return "Canonical context plan fields are invalid";
|
|
3003
|
-
}
|
|
3004
|
-
if (contextPlan.version !== "1" || !Array.isArray(contextPlan.scopes)) {
|
|
3005
|
-
return "Canonical context plan version or scopes are invalid";
|
|
3006
|
-
}
|
|
3007
|
-
for (const scope of contextPlan.scopes) {
|
|
3008
|
-
const issue = scopeIssue(scope);
|
|
3009
|
-
if (issue !== undefined) {
|
|
3010
|
-
return issue;
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
return undefined;
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
function subagentManifestIssue(contextPlan) {
|
|
3017
|
-
if (!Array.isArray(contextPlan?.scopes)) {
|
|
3018
|
-
return undefined;
|
|
3019
|
-
}
|
|
3020
|
-
const planned = contextPlan.scopes
|
|
3021
|
-
.flatMap((scope) => scope.contributions ?? [])
|
|
3022
|
-
.filter((contribution) => contribution.kind === "subagent-template")
|
|
3023
|
-
.map((contribution) => ({
|
|
3024
|
-
id: contribution.identity.id,
|
|
3025
|
-
references: [...new Set(contribution.references)].toSorted(),
|
|
3026
|
-
}))
|
|
3027
|
-
.toSorted((left, right) => left.id.localeCompare(right.id));
|
|
3028
|
-
if (planned.length === 0) {
|
|
3029
|
-
return undefined;
|
|
3030
|
-
}
|
|
3031
|
-
const authored = agents
|
|
3032
|
-
.map((agent) => ({
|
|
3033
|
-
id: agent.name,
|
|
3034
|
-
references: getSkillNames(agent).toSorted(),
|
|
3035
|
-
}))
|
|
3036
|
-
.toSorted((left, right) => left.id.localeCompare(right.id));
|
|
3037
|
-
return JSON.stringify(planned) === JSON.stringify(authored)
|
|
3038
|
-
? undefined
|
|
3039
|
-
: "Subagent manifest diverges from canonical context plan; run scaffold update to reconcile it";
|
|
3040
|
-
}
|
|
3041
|
-
|
|
3042
|
-
const canonicalContextIssue = (contextPlan) =>
|
|
3043
|
-
contextPlanIssue(contextPlan) ?? subagentManifestIssue(contextPlan);
|
|
3044
|
-
|
|
3045
|
-
export const validateCanonicalContextPlan = (contextPlan) => canonicalContextIssue(contextPlan);
|
|
3046
|
-
|
|
3047
|
-
const contextPlanVersion = (contextPlan) =>
|
|
3048
|
-
isObject(contextPlan) && typeof contextPlan.version === "string"
|
|
3049
|
-
? contextPlan.version
|
|
3050
|
-
: "unknown";
|
|
3051
|
-
|
|
3052
|
-
const parseAuthoringCompletion = (args) => {
|
|
3053
|
-
if (args.length === 0) return undefined;
|
|
3054
|
-
if (args.length !== 3 || args[0] !== "--complete-authoring" || !/^[a-f0-9]{64}$/.test(args[2])) {
|
|
3055
|
-
throw new Error("Expected --complete-authoring <scope> <current input identity>.");
|
|
3056
|
-
}
|
|
3057
|
-
return { scopeId: args[1], inputIdentity: args[2] };
|
|
3058
|
-
};
|
|
3059
|
-
|
|
3060
|
-
async function readAuthoredScope(action) {
|
|
3061
|
-
const promptFile = action.allowedOutputs[0];
|
|
3062
|
-
const bytes = await readConfinedRegularFile(resolveActionPath(promptFile, "authored output"));
|
|
3063
|
-
if (bytes === null || bytes.toString("utf8").trim().length === 0) {
|
|
3064
|
-
throw new Error(`Authored output is missing or empty: ${promptFile}`);
|
|
3065
|
-
}
|
|
3066
|
-
return bytes;
|
|
3067
|
-
}
|
|
3068
|
-
|
|
3069
|
-
async function verifyAuthoredProjection(action, projections, application) {
|
|
3070
|
-
await readAuthoredScope(action);
|
|
3071
|
-
for (const projection of projections) {
|
|
3072
|
-
const relevant = (entry) =>
|
|
3073
|
-
entry.trace?.scopeId === action.scopeId &&
|
|
3074
|
-
["scoped-prompt", "subagent-template"].includes(entry.trace?.kind);
|
|
3075
|
-
if ([...projection.failures, ...projection.omissions].some(relevant)) {
|
|
3076
|
-
throw new Error(`Scoped authoring projection is incomplete: ${action.scopeId}`);
|
|
3077
|
-
}
|
|
3078
|
-
for (const mirror of projection.actions.filter(
|
|
3079
|
-
(entry) => relevant(entry) && entry.operation === "mirror" && entry.source !== entry.target,
|
|
3080
|
-
)) {
|
|
3081
|
-
const sourcePath = resolveActionPath(mirror.source, "source");
|
|
3082
|
-
const targetPath = resolveActionPath(mirror.target, "target");
|
|
3083
|
-
const stat = await lstat(targetPath);
|
|
3084
|
-
if (stat.isSymbolicLink()) {
|
|
3085
|
-
if ((await readlink(targetPath)) !== path.relative(path.dirname(targetPath), sourcePath)) {
|
|
3086
|
-
throw new Error(`Scoped authoring mirror diverges: ${mirror.target}`);
|
|
3087
|
-
}
|
|
3088
|
-
} else {
|
|
3089
|
-
const source = await readConfinedRegularFile(sourcePath);
|
|
3090
|
-
const target = await readConfinedRegularFile(targetPath);
|
|
3091
|
-
if (source === null || target === null || !source.equals(target)) {
|
|
3092
|
-
throw new Error(`Scoped authoring mirror diverges: ${mirror.target}`);
|
|
3093
|
-
}
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
for (const agentId of action.allowedAgentIds) {
|
|
3098
|
-
for (const [adapterId, surface] of Object.entries(harnessAgentSurface)) {
|
|
3099
|
-
const expected = application.rendered[adapterId]?.[agentId];
|
|
3100
|
-
const actual = await readConfinedRegularFile(
|
|
3101
|
-
path.join(surface.directory, `${agentId}.${surface.extension}`),
|
|
3102
|
-
);
|
|
3103
|
-
if (typeof expected !== "string" || actual?.toString("utf8") !== expected) {
|
|
3104
|
-
throw new Error(`Scoped authoring native agent diverges: ${adapterId}:${agentId}`);
|
|
3105
|
-
}
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
}
|
|
3109
|
-
|
|
3110
|
-
async function main({ publicationLock, authoringCompletion } = {}) {
|
|
3111
|
-
operationRepoRootIdentity = await captureRepoRootIdentity("synchronize scaffold output");
|
|
3112
|
-
const manifestPreflight = await preflightScaffoldManifest();
|
|
3113
|
-
await assertConfinedRegularFile(projectionReceiptPath);
|
|
3114
|
-
const previousReceiptBytes = await readConfinedRegularFile(projectionReceiptPath);
|
|
3115
|
-
let previousAuthoringProofs = [];
|
|
3116
|
-
try {
|
|
3117
|
-
const previousReceipt = JSON.parse(previousReceiptBytes?.toString("utf8") ?? "null");
|
|
3118
|
-
previousAuthoringProofs = readScopedAuthoringProofs(previousReceipt);
|
|
3119
|
-
previousCopyFallbacks = Array.isArray(previousReceipt.copyFallbacks)
|
|
3120
|
-
? previousReceipt.copyFallbacks.filter(
|
|
3121
|
-
(copy) =>
|
|
3122
|
-
isObject(copy) &&
|
|
3123
|
-
typeof copy.source === "string" &&
|
|
3124
|
-
typeof copy.target === "string" &&
|
|
3125
|
-
typeof copy.digest === "string",
|
|
3126
|
-
)
|
|
3127
|
-
: [];
|
|
3128
|
-
} catch {
|
|
3129
|
-
previousCopyFallbacks = [];
|
|
3130
|
-
}
|
|
3131
|
-
const loadedContextPlan = await readContextPlan();
|
|
3132
|
-
const loadedProjectionPlan = await readProjectionPlan();
|
|
3133
|
-
const authoringManifestPath = path.join(repoRoot, ".agents/subagents/manifest.mjs");
|
|
3134
|
-
const authoringManifestBytes = await readConfinedRegularFile(authoringManifestPath);
|
|
3135
|
-
const application = await prepareHarnessApplication();
|
|
3136
|
-
const renderedOutputSha256 = semanticJsonHash({
|
|
3137
|
-
availableHooks: application.availableHooks,
|
|
3138
|
-
rendered: application.rendered,
|
|
3139
|
-
});
|
|
3140
|
-
const publicationLease = await acquireProjectionPublicationLock(publicationLock);
|
|
3141
|
-
try {
|
|
3142
|
-
await assertScaffoldManifestPreflight(manifestPreflight);
|
|
3143
|
-
if (!loadedContextPlan.exists && !loadedProjectionPlan.exists) {
|
|
3144
|
-
if (authoringCompletion !== undefined) {
|
|
3145
|
-
throw new Error("Scoped authoring completion requires a canonical context plan.");
|
|
3146
|
-
}
|
|
3147
|
-
await materializeLegacyHarnesses(application);
|
|
3148
|
-
return;
|
|
3149
|
-
}
|
|
3150
|
-
const contextPlan = loadedContextPlan.value;
|
|
3151
|
-
const authoringActions =
|
|
3152
|
-
contextPlanIssue(contextPlan) === undefined
|
|
3153
|
-
? assessScopedAuthoring({ contextPlan, proofs: [] })
|
|
3154
|
-
: [];
|
|
3155
|
-
const completionAction =
|
|
3156
|
-
authoringCompletion === undefined
|
|
3157
|
-
? undefined
|
|
3158
|
-
: authoringActions.find(
|
|
3159
|
-
(action) =>
|
|
3160
|
-
action.scopeId === authoringCompletion.scopeId &&
|
|
3161
|
-
action.inputIdentity === authoringCompletion.inputIdentity,
|
|
3162
|
-
);
|
|
3163
|
-
if (authoringCompletion !== undefined) {
|
|
3164
|
-
if (completionAction === undefined || completionAction.trigger === "compatibility-unknown") {
|
|
3165
|
-
throw new Error("Scoped authoring completion does not match a supported current input.");
|
|
3166
|
-
}
|
|
3167
|
-
const issue = canonicalContextIssue(contextPlan);
|
|
3168
|
-
if (issue !== undefined) throw new Error(issue);
|
|
3169
|
-
await readAuthoredScope(completionAction);
|
|
3170
|
-
}
|
|
3171
|
-
const suppliedProjectionPlan = loadedProjectionPlan.exists
|
|
3172
|
-
? validateProjectionPlan({ plan: loadedProjectionPlan.value, contextPlan })
|
|
3173
|
-
: undefined;
|
|
3174
|
-
const projected =
|
|
3175
|
-
suppliedProjectionPlan !== undefined
|
|
3176
|
-
? suppliedProjectionPlan.projections.map((projection) => {
|
|
3177
|
-
const adapter = adapters.find(
|
|
3178
|
-
({ matrix }) => matrix.adapter.id === projection.matrix.adapter.id,
|
|
3179
|
-
);
|
|
3180
|
-
if (adapter === undefined) throw new Error("Validated projection adapter is missing");
|
|
3181
|
-
return {
|
|
3182
|
-
adapter,
|
|
3183
|
-
projection: withLifecycleHookReconciliation(
|
|
3184
|
-
adapter,
|
|
3185
|
-
contextPlan,
|
|
3186
|
-
withManagedAgentCleanup(adapter, contextPlan, {
|
|
3187
|
-
actions: projection.actions,
|
|
3188
|
-
summary: projection.summary,
|
|
3189
|
-
}),
|
|
3190
|
-
),
|
|
3191
|
-
};
|
|
3192
|
-
})
|
|
3193
|
-
: adapters.map((adapter) => ({
|
|
3194
|
-
adapter,
|
|
3195
|
-
projection: withLifecycleHookReconciliation(
|
|
3196
|
-
adapter,
|
|
3197
|
-
contextPlan,
|
|
3198
|
-
withManagedAgentCleanup(adapter, contextPlan, projectSafely(adapter, contextPlan)),
|
|
3199
|
-
),
|
|
3200
|
-
}));
|
|
3201
|
-
const applied = [];
|
|
3202
|
-
|
|
3203
|
-
for (const entry of projected) {
|
|
3204
|
-
const applicationProjection = await prepareProjectionApplication(entry.projection);
|
|
3205
|
-
const summary = await applyProjection({
|
|
3206
|
-
projection: applicationProjection,
|
|
3207
|
-
filesystem: { apply: (action) => applyHarnessAction(action, application) },
|
|
3208
|
-
});
|
|
3209
|
-
applied.push(
|
|
3210
|
-
projectionEvidence({
|
|
3211
|
-
adapter: entry.adapter,
|
|
3212
|
-
projection: applicationProjection,
|
|
3213
|
-
summary,
|
|
3214
|
-
}),
|
|
3215
|
-
);
|
|
3216
|
-
}
|
|
3217
|
-
|
|
3218
|
-
const scopedAuthoring = previousAuthoringProofs.filter(
|
|
3219
|
-
(proof) =>
|
|
3220
|
-
!authoringActions.some(
|
|
3221
|
-
(action) =>
|
|
3222
|
-
action.scopeId === proof.scopeId &&
|
|
3223
|
-
(action === completionAction || action.inputIdentity === proof.inputIdentity),
|
|
3224
|
-
),
|
|
3225
|
-
);
|
|
3226
|
-
for (const action of authoringActions) {
|
|
3227
|
-
if (action.trigger === "compatibility-unknown") continue;
|
|
3228
|
-
const prior = previousAuthoringProofs.find(
|
|
3229
|
-
(proof) => proof.scopeId === action.scopeId && proof.inputIdentity === action.inputIdentity,
|
|
3230
|
-
);
|
|
3231
|
-
if (action !== completionAction && prior === undefined) continue;
|
|
3232
|
-
try {
|
|
3233
|
-
await verifyAuthoredProjection(action, applied, application);
|
|
3234
|
-
scopedAuthoring.push({
|
|
3235
|
-
scopeId: action.scopeId,
|
|
3236
|
-
inputIdentity: action.inputIdentity,
|
|
3237
|
-
status: "verified",
|
|
3238
|
-
});
|
|
3239
|
-
} catch (error) {
|
|
3240
|
-
if (action === completionAction) throw error;
|
|
3241
|
-
}
|
|
3242
|
-
}
|
|
3243
|
-
if (scopedAuthoring.length > 0) {
|
|
3244
|
-
const currentApplication = await prepareHarnessApplication();
|
|
3245
|
-
const currentManifest = await readConfinedRegularFile(authoringManifestPath);
|
|
3246
|
-
if (
|
|
3247
|
-
authoringManifestBytes === null ||
|
|
3248
|
-
currentManifest === null ||
|
|
3249
|
-
!authoringManifestBytes.equals(currentManifest) ||
|
|
3250
|
-
semanticJsonHash({
|
|
3251
|
-
availableHooks: currentApplication.availableHooks,
|
|
3252
|
-
rendered: currentApplication.rendered,
|
|
3253
|
-
}) !== renderedOutputSha256
|
|
3254
|
-
) {
|
|
3255
|
-
throw new Error("Scoped authoring inputs changed during projection; retry completion.");
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
|
-
const currentContext = await readContextPlan();
|
|
3259
|
-
if (
|
|
3260
|
-
!currentContext.exists ||
|
|
3261
|
-
semanticJsonHash(currentContext.value) !== semanticJsonHash(contextPlan)
|
|
3262
|
-
) {
|
|
3263
|
-
throw new Error("Scoped authoring inputs changed during projection; retry completion.");
|
|
3264
|
-
}
|
|
3265
|
-
const receipt = {
|
|
3266
|
-
version: "1",
|
|
3267
|
-
contextPlanVersion: contextPlanVersion(contextPlan),
|
|
3268
|
-
renderedOutputSha256,
|
|
3269
|
-
status: receiptStatus(applied),
|
|
3270
|
-
projections: applied,
|
|
3271
|
-
scopedAuthoring: scopedAuthoring.toSorted((left, right) =>
|
|
3272
|
-
left.scopeId.localeCompare(right.scopeId),
|
|
3273
|
-
),
|
|
3274
|
-
copyFallbacks: [...currentCopyFallbacks.values()].toSorted((left, right) =>
|
|
3275
|
-
copyFallbackKey(left).localeCompare(copyFallbackKey(right)),
|
|
3276
|
-
),
|
|
3277
|
-
};
|
|
3278
|
-
await commitProjectionEvidence(manifestPreflight, receipt);
|
|
3279
|
-
if (receipt.status === "failure") {
|
|
3280
|
-
throw new Error(
|
|
3281
|
-
`Harness projection failed; inspect ${path.relative(repoRoot, projectionReceiptPath)}`,
|
|
3282
|
-
);
|
|
3283
|
-
}
|
|
3284
|
-
} finally {
|
|
3285
|
-
await releaseProjectionPublicationLock(publicationLease);
|
|
3286
|
-
}
|
|
3287
|
-
}
|
|
3288
|
-
|
|
3289
|
-
const entrypointPath = process.argv[1] === undefined ? null : await realpath(process.argv[1]);
|
|
3290
|
-
const modulePath = await realpath(fileURLToPath(import.meta.url));
|
|
3291
|
-
|
|
3292
|
-
if (entrypointPath === modulePath) {
|
|
3293
|
-
try {
|
|
3294
|
-
await main({ authoringCompletion: parseAuthoringCompletion(process.argv.slice(2)) });
|
|
3295
|
-
} finally {
|
|
3296
|
-
await closeMutationWorkers();
|
|
3297
|
-
}
|
|
3298
|
-
}
|