@bonesofspring/ai-rules 0.2.52 → 0.2.55
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/CHANGELOG.md +67 -0
- package/README.md +45 -16
- package/bin/cli.js +599 -69
- package/bin/lib/engine-scripts.js +10 -0
- package/bin/lib/mcp/clients.js +205 -0
- package/bin/lib/mcp/credentials.js +310 -0
- package/bin/lib/mcp/doctor.js +396 -0
- package/bin/lib/mcp/prompt.js +115 -0
- package/bin/lib/mcp/registry.js +171 -0
- package/bin/lib/mcp/run.js +125 -0
- package/bin/lib/merged-config.js +68 -2
- package/bin/lib/seed-ai-local-team.js +6 -1
- package/bin/lib/tool-installs.js +28 -0
- package/bin/opencode-install.js +18 -0
- package/bin/zcode-install.js +479 -0
- package/docs/MAVIS.md +3 -3
- package/docs/MCP-SETUP.md +62 -0
- package/docs/OPENCODE-COMPATIBILITY.md +1 -1
- package/docs/OPENCODE.md +3 -3
- package/docs/PRESET-CONTRIBUTION.md +25 -11
- package/docs/TEAM-DB.md +188 -0
- package/docs/ZCODE-COMPATIBILITY.md +143 -0
- package/docs/ZCODE.md +50 -0
- package/docs/openapi/team-db.v1.json +5085 -0
- package/mcp/gitlab.mjs +123 -0
- package/mcp/lib/envfile.mjs +126 -0
- package/mcp/lib/yandex.mjs +384 -0
- package/mcp/yandex-mcp-proxy.mjs +155 -0
- package/mcp/yandex-token-refresh.mjs +65 -0
- package/package.json +23 -3
- package/presets/_shared/ai-local/scripts/manifest.mjs +99 -0
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +1275 -0
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +1067 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +1301 -0
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +1590 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +831 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +297 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +1 -1
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -2
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +109 -0
- package/presets/claude/android-kotlin/REPO_AGENTS.md +15 -8
- package/presets/claude/android-kotlin/commands/README.md +1 -0
- package/presets/claude/android-kotlin/commands/migrate-tasks.md +41 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/android-kotlin/team/README.md +14 -2
- package/presets/claude/go/REPO_AGENTS.md +15 -8
- package/presets/claude/go/commands/README.md +1 -0
- package/presets/claude/go/commands/migrate-tasks.md +41 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/go/rules/README.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/go/team/README.md +14 -2
- package/presets/claude/ios-swift/REPO_AGENTS.md +15 -8
- package/presets/claude/ios-swift/commands/README.md +1 -0
- package/presets/claude/ios-swift/commands/migrate-tasks.md +41 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/ios-swift/rules/README.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/ios-swift/team/README.md +14 -2
- package/presets/claude/java/REPO_AGENTS.md +15 -8
- package/presets/claude/java/commands/README.md +1 -0
- package/presets/claude/java/commands/migrate-tasks.md +41 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/java/team/README.md +14 -2
- package/presets/claude/mcp-ts/REPO_AGENTS.md +15 -8
- package/presets/claude/mcp-ts/commands/README.md +1 -0
- package/presets/claude/mcp-ts/commands/migrate-tasks.md +41 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/mcp-ts/team/README.md +14 -2
- package/presets/claude/mol/CLAUDE.md +53 -0
- package/presets/claude/mol/MCP.md +38 -0
- package/presets/claude/mol/README.md +9 -0
- package/presets/claude/mol/REPO_AGENTS.md +107 -0
- package/presets/claude/mol/agents/README.md +97 -0
- package/presets/claude/mol/agents/accessibility-reviewer.md +86 -0
- package/presets/claude/mol/agents/api-contract-reviewer.md +81 -0
- package/presets/claude/mol/agents/build-verifier.md +111 -0
- package/presets/claude/mol/agents/ci-investigator.md +91 -0
- package/presets/claude/mol/agents/code-reviewer.md +133 -0
- package/presets/claude/mol/agents/codebase-analyzer.md +45 -0
- package/presets/claude/mol/agents/debugger.md +122 -0
- package/presets/claude/mol/agents/feature-developer.md +147 -0
- package/presets/claude/mol/agents/migration-specialist.md +91 -0
- package/presets/claude/mol/agents/mockup-reviewer.md +125 -0
- package/presets/claude/mol/agents/openspec-author.md +207 -0
- package/presets/claude/mol/agents/performance-auditor.md +92 -0
- package/presets/claude/mol/agents/playwright-test-generator.md +52 -0
- package/presets/claude/mol/agents/playwright-test-healer.md +53 -0
- package/presets/claude/mol/agents/playwright-test-planner.md +45 -0
- package/presets/claude/mol/agents/qa-tester.md +76 -0
- package/presets/claude/mol/agents/security-reviewer.md +83 -0
- package/presets/claude/mol/agents/solution-architect.md +93 -0
- package/presets/claude/mol/agents/task-analyst.md +249 -0
- package/presets/claude/mol/agents/task-router.md +261 -0
- package/presets/claude/mol/agents/tech-writer.md +82 -0
- package/presets/claude/mol/agents/unit-test-generator.md +55 -0
- package/presets/claude/mol/agents/unit-test-healer.md +56 -0
- package/presets/claude/mol/agents/unit-test-planner.md +78 -0
- package/presets/claude/mol/ai-local/conventions.md +49 -0
- package/presets/claude/mol/ai-local/rules/task-levels.md +40 -0
- package/presets/claude/mol/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/claude/mol/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/claude/mol/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/claude/mol/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/claude/mol/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/claude/mol/ai-local/rules-library/code-style.md +68 -0
- package/presets/claude/mol/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/claude/mol/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/claude/mol/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/claude/mol/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/claude/mol/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/claude/mol/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/claude/mol/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/claude/mol/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/claude/mol/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/claude/mol/ai-local/rules-library/router-pages.md +25 -0
- package/presets/claude/mol/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/claude/mol/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/claude/mol/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/claude/mol/commands/README.md +56 -0
- package/presets/claude/mol/commands/migrate-tasks.md +41 -0
- package/presets/claude/mol/commands/spec-start.md +29 -0
- package/presets/claude/mol/commands/task-continue.md +72 -0
- package/presets/claude/mol/commands/task-evil.md +84 -0
- package/presets/claude/mol/commands/task.md +72 -0
- package/presets/claude/mol/commands/technical-retro.md +93 -0
- package/presets/claude/mol/commands/update.md +40 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +2783 -0
- package/presets/claude/mol/hooks/check-preset-update.mjs +232 -0
- package/presets/claude/mol/hooks/list-ai-local.mjs +299 -0
- package/presets/claude/mol/mcp.json +20 -0
- package/presets/claude/mol/rules/README.md +87 -0
- package/presets/claude/mol/rules/architecture/feature-delivery-workflow.md +149 -0
- package/presets/claude/mol/rules/architecture/mol-state.md +30 -0
- package/presets/claude/mol/rules/architecture/mol-theming.md +30 -0
- package/presets/claude/mol/rules/architecture/product-specs-authoring.md +124 -0
- package/presets/claude/mol/rules/architecture/product-specs.md +67 -0
- package/presets/claude/mol/rules/architecture/reference-features.md +87 -0
- package/presets/claude/mol/rules/stack/mol-app-core.md +34 -0
- package/presets/claude/mol/rules/stack/mol-components.md +36 -0
- package/presets/claude/mol/rules/stack/mol-reactivity.md +26 -0
- package/presets/claude/mol/rules/stack/mol-view-tree.md +32 -0
- package/presets/claude/mol/rules/stack/package-manager.md +12 -0
- package/presets/claude/mol/rules/testing/mol-build.md +29 -0
- package/presets/claude/mol/rules/testing/mol-testing.md +36 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +19 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +287 -0
- package/presets/claude/mol/rules/tooling-and-review/ai-local-overlay.md +23 -0
- package/presets/claude/mol/rules/tooling-and-review/anti-hallucination-contract.md +42 -0
- package/presets/claude/mol/rules/tooling-and-review/anti-sycophancy-discipline.md +28 -0
- package/presets/claude/mol/rules/tooling-and-review/code-quality.md +80 -0
- package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +100 -0
- package/presets/claude/mol/rules/tooling-and-review/design-guidance.md +109 -0
- package/presets/claude/mol/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/mol/rules/tooling-and-review/language-policy.md +59 -0
- package/presets/claude/mol/rules/tooling-and-review/mcp-usage.md +101 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-goals.md +39 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-layering.md +35 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-no-cross-stack-leakage.md +97 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +53 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-token-budget.md +46 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +49 -0
- package/presets/claude/mol/rules/tooling-and-review/preset-writing-style.md +50 -0
- package/presets/claude/mol/rules/tooling-and-review/technical-retro.md +18 -0
- package/presets/claude/mol/settings.json +52 -0
- package/presets/claude/mol/skills/README.md +17 -0
- package/presets/claude/mol/skills/ci-investigation/SKILL.md +44 -0
- package/presets/claude/mol/skills/code-review/SKILL.md +55 -0
- package/presets/claude/mol/skills/debug-investigation/SKILL.md +59 -0
- package/presets/claude/mol/skills/feature-delivery/SKILL.md +39 -0
- package/presets/claude/mol/skills/spec-authoring/SKILL.md +26 -0
- package/presets/claude/mol/skills/spec-discovery/SKILL.md +58 -0
- package/presets/claude/mol/skills/technical-retro/SKILL.md +67 -0
- package/presets/claude/mol/skills/unit-testing/SKILL.md +33 -0
- package/presets/claude/mol/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/mol/team/README.md +135 -0
- package/presets/claude/mol/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/claude/mol/team/fixtures/bugfix-standard.json +25 -0
- package/presets/claude/mol/team/fixtures/feature-full.json +29 -0
- package/presets/claude/mol/team/fixtures/feature-light.json +28 -0
- package/presets/claude/mol/team/fixtures/feature-parallel.json +84 -0
- package/presets/claude/mol/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/claude/mol/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/claude/mol/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/claude/mol/team/fixtures/memlog.example.md +9 -0
- package/presets/claude/mol/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/claude/mol/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/claude/mol/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/claude/mol/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/claude/mol/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/claude/mol/team/fixtures/metrics.example.json +54 -0
- package/presets/claude/mol/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/claude/mol/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/claude/mol/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/claude/mol/team/tasks/.gitkeep +0 -0
- package/presets/claude/next/REPO_AGENTS.md +16 -9
- package/presets/claude/next/agents/task-analyst.md +11 -0
- package/presets/claude/next/agents/task-router.md +11 -0
- package/presets/claude/next/commands/README.md +4 -0
- package/presets/claude/next/commands/migrate-tasks.md +41 -0
- package/presets/claude/next/commands/task-evil.md +88 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/next/rules/README.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/next/settings.json +1 -6
- package/presets/claude/next/team/README.md +14 -2
- package/presets/claude/nuxt/REPO_AGENTS.md +15 -8
- package/presets/claude/nuxt/commands/README.md +1 -0
- package/presets/claude/nuxt/commands/migrate-tasks.md +41 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/nuxt/settings.json +1 -6
- package/presets/claude/nuxt/team/README.md +14 -2
- package/presets/claude/php-hexagonal/REPO_AGENTS.md +15 -8
- package/presets/claude/php-hexagonal/commands/README.md +1 -0
- package/presets/claude/php-hexagonal/commands/migrate-tasks.md +41 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/php-hexagonal/team/README.md +14 -2
- package/presets/claude/php-laravel/REPO_AGENTS.md +15 -8
- package/presets/claude/php-laravel/commands/README.md +1 -0
- package/presets/claude/php-laravel/commands/migrate-tasks.md +41 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/php-laravel/team/README.md +14 -2
- package/presets/claude/svelte/REPO_AGENTS.md +15 -8
- package/presets/claude/svelte/commands/README.md +1 -0
- package/presets/claude/svelte/commands/migrate-tasks.md +41 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +2 -2
- package/presets/claude/svelte/settings.json +1 -6
- package/presets/claude/svelte/team/README.md +14 -2
- package/presets/cursor/android-kotlin/REPO_AGENTS.md +15 -8
- package/presets/cursor/android-kotlin/commands/README.md +1 -0
- package/presets/cursor/android-kotlin/commands/migrate-tasks.md +41 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/android-kotlin/team/README.md +14 -2
- package/presets/cursor/go/REPO_AGENTS.md +15 -8
- package/presets/cursor/go/commands/README.md +1 -0
- package/presets/cursor/go/commands/migrate-tasks.md +41 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/go/team/README.md +14 -2
- package/presets/cursor/ios-swift/REPO_AGENTS.md +15 -8
- package/presets/cursor/ios-swift/commands/README.md +1 -0
- package/presets/cursor/ios-swift/commands/migrate-tasks.md +41 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/ios-swift/team/README.md +14 -2
- package/presets/cursor/java/REPO_AGENTS.md +15 -8
- package/presets/cursor/java/commands/README.md +1 -0
- package/presets/cursor/java/commands/migrate-tasks.md +41 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/java/team/README.md +14 -2
- package/presets/cursor/mcp-ts/REPO_AGENTS.md +15 -8
- package/presets/cursor/mcp-ts/commands/README.md +1 -0
- package/presets/cursor/mcp-ts/commands/migrate-tasks.md +41 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/mcp-ts/team/README.md +14 -2
- package/presets/cursor/mol/AGENTS.md +40 -0
- package/presets/cursor/mol/BUGBOT.md +14 -0
- package/presets/cursor/mol/MCP.md +50 -0
- package/presets/cursor/mol/README.md +18 -0
- package/presets/cursor/mol/REPO_AGENTS.md +107 -0
- package/presets/cursor/mol/agents/README.md +97 -0
- package/presets/cursor/mol/agents/accessibility-reviewer.md +74 -0
- package/presets/cursor/mol/agents/api-contract-reviewer.md +69 -0
- package/presets/cursor/mol/agents/build-verifier.md +99 -0
- package/presets/cursor/mol/agents/ci-investigator.md +75 -0
- package/presets/cursor/mol/agents/code-reviewer.md +120 -0
- package/presets/cursor/mol/agents/codebase-analyzer.md +33 -0
- package/presets/cursor/mol/agents/debugger.md +106 -0
- package/presets/cursor/mol/agents/feature-developer.md +131 -0
- package/presets/cursor/mol/agents/migration-specialist.md +79 -0
- package/presets/cursor/mol/agents/mockup-reviewer.md +113 -0
- package/presets/cursor/mol/agents/openspec-author.md +195 -0
- package/presets/cursor/mol/agents/performance-auditor.md +80 -0
- package/presets/cursor/mol/agents/playwright-test-generator.md +40 -0
- package/presets/cursor/mol/agents/playwright-test-healer.md +41 -0
- package/presets/cursor/mol/agents/playwright-test-planner.md +33 -0
- package/presets/cursor/mol/agents/qa-tester.md +64 -0
- package/presets/cursor/mol/agents/security-reviewer.md +71 -0
- package/presets/cursor/mol/agents/solution-architect.md +81 -0
- package/presets/cursor/mol/agents/task-analyst.md +237 -0
- package/presets/cursor/mol/agents/task-router.md +249 -0
- package/presets/cursor/mol/agents/tech-writer.md +70 -0
- package/presets/cursor/mol/agents/unit-test-generator.md +43 -0
- package/presets/cursor/mol/agents/unit-test-healer.md +44 -0
- package/presets/cursor/mol/agents/unit-test-planner.md +66 -0
- package/presets/cursor/mol/ai-local/conventions.md +49 -0
- package/presets/cursor/mol/ai-local/rules/task-levels.md +40 -0
- package/presets/cursor/mol/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/cursor/mol/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/cursor/mol/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/cursor/mol/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/cursor/mol/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/cursor/mol/ai-local/rules-library/code-style.md +68 -0
- package/presets/cursor/mol/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/cursor/mol/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/cursor/mol/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/cursor/mol/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/cursor/mol/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/cursor/mol/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/cursor/mol/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/cursor/mol/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/cursor/mol/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/cursor/mol/ai-local/rules-library/router-pages.md +25 -0
- package/presets/cursor/mol/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/cursor/mol/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/cursor/mol/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/cursor/mol/commands/README.md +56 -0
- package/presets/cursor/mol/commands/migrate-tasks.md +41 -0
- package/presets/cursor/mol/commands/spec-start.md +29 -0
- package/presets/cursor/mol/commands/task-continue.md +72 -0
- package/presets/cursor/mol/commands/task-evil.md +88 -0
- package/presets/cursor/mol/commands/task.md +76 -0
- package/presets/cursor/mol/commands/technical-retro.md +93 -0
- package/presets/cursor/mol/commands/update.md +40 -0
- package/presets/cursor/mol/hooks/README.md +14 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +2765 -0
- package/presets/cursor/mol/hooks/check-preset-update.mjs +232 -0
- package/presets/cursor/mol/hooks/examples/README.md +18 -0
- package/presets/cursor/mol/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/mol/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/mol/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/mol/hooks/guard-shell-command.sh +77 -0
- package/presets/cursor/mol/hooks/list-ai-local.mjs +299 -0
- package/presets/cursor/mol/hooks.json +27 -0
- package/presets/cursor/mol/mcp.json +19 -0
- package/presets/cursor/mol/rules/README.md +71 -0
- package/presets/cursor/mol/rules/agent-team-intake.mdc +19 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +263 -0
- package/presets/cursor/mol/rules/ai-local-overlay.mdc +24 -0
- package/presets/cursor/mol/rules/anti-hallucination-contract.mdc +42 -0
- package/presets/cursor/mol/rules/anti-sycophancy-discipline.mdc +28 -0
- package/presets/cursor/mol/rules/code-quality-and-refactoring.mdc +81 -0
- package/presets/cursor/mol/rules/code-review-mr.mdc +100 -0
- package/presets/cursor/mol/rules/design-guidance.mdc +109 -0
- package/presets/cursor/mol/rules/feature-delivery-workflow.mdc +93 -0
- package/presets/cursor/mol/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/mol/rules/language-policy.mdc +60 -0
- package/presets/cursor/mol/rules/mcp-usage.mdc +101 -0
- package/presets/cursor/mol/rules/mol-app-core.mdc +35 -0
- package/presets/cursor/mol/rules/mol-build.mdc +30 -0
- package/presets/cursor/mol/rules/mol-components.mdc +37 -0
- package/presets/cursor/mol/rules/mol-reactivity.mdc +27 -0
- package/presets/cursor/mol/rules/mol-state.mdc +31 -0
- package/presets/cursor/mol/rules/mol-testing.mdc +37 -0
- package/presets/cursor/mol/rules/mol-theming.mdc +31 -0
- package/presets/cursor/mol/rules/mol-view-tree.mdc +33 -0
- package/presets/cursor/mol/rules/package-manager.mdc +12 -0
- package/presets/cursor/mol/rules/preset-goals.mdc +40 -0
- package/presets/cursor/mol/rules/preset-layering.mdc +36 -0
- package/presets/cursor/mol/rules/preset-no-cross-stack-leakage.mdc +98 -0
- package/presets/cursor/mol/rules/preset-pr-checklist.mdc +54 -0
- package/presets/cursor/mol/rules/preset-token-budget.mdc +47 -0
- package/presets/cursor/mol/rules/preset-twin-sync.mdc +50 -0
- package/presets/cursor/mol/rules/preset-writing-style.mdc +51 -0
- package/presets/cursor/mol/rules/product-specs-authoring.mdc +125 -0
- package/presets/cursor/mol/rules/product-specs.mdc +68 -0
- package/presets/cursor/mol/rules/reference-features.mdc +45 -0
- package/presets/cursor/mol/rules/technical-retro.mdc +18 -0
- package/presets/cursor/mol/skills/README.md +17 -0
- package/presets/cursor/mol/skills/ci-investigation/SKILL.md +49 -0
- package/presets/cursor/mol/skills/code-review/SKILL.md +60 -0
- package/presets/cursor/mol/skills/debug-investigation/SKILL.md +63 -0
- package/presets/cursor/mol/skills/feature-delivery/SKILL.md +44 -0
- package/presets/cursor/mol/skills/spec-authoring/SKILL.md +31 -0
- package/presets/cursor/mol/skills/spec-discovery/SKILL.md +63 -0
- package/presets/cursor/mol/skills/technical-retro/SKILL.md +72 -0
- package/presets/cursor/mol/skills/unit-testing/SKILL.md +38 -0
- package/presets/cursor/mol/skills/write-adr/SKILL.md +46 -0
- package/presets/cursor/mol/team/README.md +135 -0
- package/presets/cursor/mol/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/cursor/mol/team/fixtures/bugfix-standard.json +25 -0
- package/presets/cursor/mol/team/fixtures/feature-full.json +29 -0
- package/presets/cursor/mol/team/fixtures/feature-light.json +28 -0
- package/presets/cursor/mol/team/fixtures/feature-parallel.json +84 -0
- package/presets/cursor/mol/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/cursor/mol/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/cursor/mol/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/cursor/mol/team/fixtures/memlog.example.md +9 -0
- package/presets/cursor/mol/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/cursor/mol/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/cursor/mol/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/cursor/mol/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/cursor/mol/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/cursor/mol/team/fixtures/metrics.example.json +54 -0
- package/presets/cursor/mol/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/cursor/mol/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/cursor/mol/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/cursor/mol/team/tasks/.gitkeep +0 -0
- package/presets/cursor/next/MCP.md +7 -0
- package/presets/cursor/next/REPO_AGENTS.md +16 -9
- package/presets/cursor/next/agents/task-analyst.md +11 -0
- package/presets/cursor/next/agents/task-router.md +11 -0
- package/presets/cursor/next/commands/README.md +6 -0
- package/presets/cursor/next/commands/migrate-tasks.md +41 -0
- package/presets/cursor/next/commands/task-evil.md +88 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/next/team/README.md +14 -2
- package/presets/cursor/nuxt/REPO_AGENTS.md +15 -8
- package/presets/cursor/nuxt/commands/README.md +1 -0
- package/presets/cursor/nuxt/commands/migrate-tasks.md +41 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/nuxt/team/README.md +14 -2
- package/presets/cursor/php-hexagonal/REPO_AGENTS.md +15 -8
- package/presets/cursor/php-hexagonal/commands/README.md +1 -0
- package/presets/cursor/php-hexagonal/commands/migrate-tasks.md +41 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/php-hexagonal/team/README.md +14 -2
- package/presets/cursor/php-laravel/REPO_AGENTS.md +15 -8
- package/presets/cursor/php-laravel/commands/README.md +1 -0
- package/presets/cursor/php-laravel/commands/migrate-tasks.md +41 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/php-laravel/team/README.md +14 -2
- package/presets/cursor/svelte/REPO_AGENTS.md +15 -8
- package/presets/cursor/svelte/commands/README.md +1 -0
- package/presets/cursor/svelte/commands/migrate-tasks.md +41 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +2 -2
- package/presets/cursor/svelte/team/README.md +14 -2
- package/presets/mavis/README.md +1 -1
- package/presets/mavis/android-kotlin/REPO_AGENTS.md +15 -8
- package/presets/mavis/android-kotlin/adapter-map.json +9 -1
- package/presets/mavis/android-kotlin/commands/README.md +1 -0
- package/presets/mavis/android-kotlin/commands/migrate-tasks.md +36 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/android-kotlin/team/README.md +14 -2
- package/presets/mavis/go/REPO_AGENTS.md +15 -8
- package/presets/mavis/go/adapter-map.json +9 -1
- package/presets/mavis/go/commands/README.md +1 -0
- package/presets/mavis/go/commands/migrate-tasks.md +36 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/go/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/go/team/README.md +14 -2
- package/presets/mavis/ios-swift/REPO_AGENTS.md +15 -8
- package/presets/mavis/ios-swift/adapter-map.json +9 -1
- package/presets/mavis/ios-swift/commands/README.md +1 -0
- package/presets/mavis/ios-swift/commands/migrate-tasks.md +36 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/ios-swift/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/ios-swift/team/README.md +14 -2
- package/presets/mavis/java/REPO_AGENTS.md +15 -8
- package/presets/mavis/java/adapter-map.json +9 -1
- package/presets/mavis/java/commands/README.md +1 -0
- package/presets/mavis/java/commands/migrate-tasks.md +36 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/java/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/java/team/README.md +14 -2
- package/presets/mavis/mcp-ts/REPO_AGENTS.md +15 -8
- package/presets/mavis/mcp-ts/adapter-map.json +9 -1
- package/presets/mavis/mcp-ts/commands/README.md +1 -0
- package/presets/mavis/mcp-ts/commands/migrate-tasks.md +36 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/mcp-ts/team/README.md +14 -2
- package/presets/mavis/mol/MAVIS.md +94 -0
- package/presets/mavis/mol/MCP.md +50 -0
- package/presets/mavis/mol/README.md +16 -0
- package/presets/mavis/mol/REPO_AGENTS.md +107 -0
- package/presets/mavis/mol/adapter-map.json +1122 -0
- package/presets/mavis/mol/agents/README.md +96 -0
- package/presets/mavis/mol/agents/accessibility-reviewer.md +85 -0
- package/presets/mavis/mol/agents/api-contract-reviewer.md +80 -0
- package/presets/mavis/mol/agents/build-verifier.md +110 -0
- package/presets/mavis/mol/agents/ci-investigator.md +90 -0
- package/presets/mavis/mol/agents/code-reviewer.md +132 -0
- package/presets/mavis/mol/agents/codebase-analyzer.md +44 -0
- package/presets/mavis/mol/agents/debugger.md +121 -0
- package/presets/mavis/mol/agents/feature-developer.md +146 -0
- package/presets/mavis/mol/agents/migration-specialist.md +90 -0
- package/presets/mavis/mol/agents/mockup-reviewer.md +124 -0
- package/presets/mavis/mol/agents/openspec-author.md +206 -0
- package/presets/mavis/mol/agents/performance-auditor.md +91 -0
- package/presets/mavis/mol/agents/playwright-test-generator.md +51 -0
- package/presets/mavis/mol/agents/playwright-test-healer.md +52 -0
- package/presets/mavis/mol/agents/playwright-test-planner.md +44 -0
- package/presets/mavis/mol/agents/qa-tester.md +75 -0
- package/presets/mavis/mol/agents/security-reviewer.md +82 -0
- package/presets/mavis/mol/agents/solution-architect.md +92 -0
- package/presets/mavis/mol/agents/task-analyst.md +248 -0
- package/presets/mavis/mol/agents/task-router.md +260 -0
- package/presets/mavis/mol/agents/tech-writer.md +81 -0
- package/presets/mavis/mol/agents/unit-test-generator.md +54 -0
- package/presets/mavis/mol/agents/unit-test-healer.md +55 -0
- package/presets/mavis/mol/agents/unit-test-planner.md +77 -0
- package/presets/mavis/mol/ai-local/conventions.md +49 -0
- package/presets/mavis/mol/ai-local/rules/task-levels.md +40 -0
- package/presets/mavis/mol/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/mavis/mol/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/mavis/mol/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/mavis/mol/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/mavis/mol/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/mavis/mol/ai-local/rules-library/code-style.md +68 -0
- package/presets/mavis/mol/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/mavis/mol/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/mavis/mol/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/mavis/mol/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/mavis/mol/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/mavis/mol/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/mavis/mol/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/mavis/mol/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/mavis/mol/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/mavis/mol/ai-local/rules-library/router-pages.md +25 -0
- package/presets/mavis/mol/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/mavis/mol/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/mavis/mol/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/mavis/mol/commands/README.md +56 -0
- package/presets/mavis/mol/commands/migrate-tasks.md +36 -0
- package/presets/mavis/mol/commands/spec-start.md +24 -0
- package/presets/mavis/mol/commands/task-continue.md +67 -0
- package/presets/mavis/mol/commands/task-evil.md +82 -0
- package/presets/mavis/mol/commands/task.md +71 -0
- package/presets/mavis/mol/commands/technical-retro.md +88 -0
- package/presets/mavis/mol/commands/update.md +35 -0
- package/presets/mavis/mol/hooks/README.md +27 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +2765 -0
- package/presets/mavis/mol/hooks/check-preset-update.mjs +232 -0
- package/presets/mavis/mol/hooks/list-ai-local.mjs +299 -0
- package/presets/mavis/mol/mcp.json +19 -0
- package/presets/mavis/mol/rules/README.md +16 -0
- package/presets/mavis/mol/rules/agent-team-intake.md +14 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +282 -0
- package/presets/mavis/mol/rules/ai-local-overlay.md +18 -0
- package/presets/mavis/mol/rules/anti-hallucination-contract.md +37 -0
- package/presets/mavis/mol/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/mavis/mol/rules/code-quality-and-refactoring.md +76 -0
- package/presets/mavis/mol/rules/code-review-mr.md +95 -0
- package/presets/mavis/mol/rules/design-guidance.md +104 -0
- package/presets/mavis/mol/rules/feature-delivery-workflow.md +144 -0
- package/presets/mavis/mol/rules/interactive-questions.md +29 -0
- package/presets/mavis/mol/rules/language-policy.md +51 -0
- package/presets/mavis/mol/rules/mcp-usage.md +96 -0
- package/presets/mavis/mol/rules/mol-app-core.md +29 -0
- package/presets/mavis/mol/rules/mol-build.md +19 -0
- package/presets/mavis/mol/rules/mol-components.md +31 -0
- package/presets/mavis/mol/rules/mol-reactivity.md +21 -0
- package/presets/mavis/mol/rules/mol-state.md +22 -0
- package/presets/mavis/mol/rules/mol-testing.md +28 -0
- package/presets/mavis/mol/rules/mol-theming.md +22 -0
- package/presets/mavis/mol/rules/mol-view-tree.md +27 -0
- package/presets/mavis/mol/rules/package-manager.md +7 -0
- package/presets/mavis/mol/rules/preset-goals.md +31 -0
- package/presets/mavis/mol/rules/preset-layering.md +27 -0
- package/presets/mavis/mol/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/mavis/mol/rules/preset-pr-checklist.md +45 -0
- package/presets/mavis/mol/rules/preset-token-budget.md +38 -0
- package/presets/mavis/mol/rules/preset-twin-sync.md +41 -0
- package/presets/mavis/mol/rules/preset-writing-style.md +42 -0
- package/presets/mavis/mol/rules/product-specs-authoring.md +118 -0
- package/presets/mavis/mol/rules/product-specs.md +61 -0
- package/presets/mavis/mol/rules/reference-features.md +82 -0
- package/presets/mavis/mol/rules/technical-retro.md +13 -0
- package/presets/mavis/mol/skills/README.md +17 -0
- package/presets/mavis/mol/skills/ci-investigation/SKILL.md +44 -0
- package/presets/mavis/mol/skills/code-review/SKILL.md +55 -0
- package/presets/mavis/mol/skills/debug-investigation/SKILL.md +58 -0
- package/presets/mavis/mol/skills/feature-delivery/SKILL.md +39 -0
- package/presets/mavis/mol/skills/spec-authoring/SKILL.md +26 -0
- package/presets/mavis/mol/skills/spec-discovery/SKILL.md +58 -0
- package/presets/mavis/mol/skills/technical-retro/SKILL.md +67 -0
- package/presets/mavis/mol/skills/unit-testing/SKILL.md +33 -0
- package/presets/mavis/mol/skills/write-adr/SKILL.md +41 -0
- package/presets/mavis/mol/team/README.md +135 -0
- package/presets/mavis/mol/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/mavis/mol/team/fixtures/bugfix-standard.json +25 -0
- package/presets/mavis/mol/team/fixtures/feature-full.json +29 -0
- package/presets/mavis/mol/team/fixtures/feature-light.json +28 -0
- package/presets/mavis/mol/team/fixtures/feature-parallel.json +84 -0
- package/presets/mavis/mol/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/mavis/mol/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/mavis/mol/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/mavis/mol/team/fixtures/memlog.example.md +9 -0
- package/presets/mavis/mol/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/mavis/mol/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/mavis/mol/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/mavis/mol/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/mavis/mol/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/mavis/mol/team/fixtures/metrics.example.json +54 -0
- package/presets/mavis/mol/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/mavis/mol/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/mavis/mol/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/mavis/mol/team/tasks/.gitkeep +0 -0
- package/presets/mavis/next/MCP.md +7 -0
- package/presets/mavis/next/REPO_AGENTS.md +16 -9
- package/presets/mavis/next/adapter-map.json +18 -1
- package/presets/mavis/next/agents/task-analyst.md +11 -0
- package/presets/mavis/next/agents/task-router.md +11 -0
- package/presets/mavis/next/commands/README.md +6 -0
- package/presets/mavis/next/commands/migrate-tasks.md +36 -0
- package/presets/mavis/next/commands/task-evil.md +82 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/next/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/next/team/README.md +14 -2
- package/presets/mavis/nuxt/REPO_AGENTS.md +15 -8
- package/presets/mavis/nuxt/adapter-map.json +9 -1
- package/presets/mavis/nuxt/commands/README.md +1 -0
- package/presets/mavis/nuxt/commands/migrate-tasks.md +36 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/nuxt/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/nuxt/team/README.md +14 -2
- package/presets/mavis/php-hexagonal/REPO_AGENTS.md +15 -8
- package/presets/mavis/php-hexagonal/adapter-map.json +9 -1
- package/presets/mavis/php-hexagonal/commands/README.md +1 -0
- package/presets/mavis/php-hexagonal/commands/migrate-tasks.md +36 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/php-hexagonal/team/README.md +14 -2
- package/presets/mavis/php-laravel/REPO_AGENTS.md +15 -8
- package/presets/mavis/php-laravel/adapter-map.json +9 -1
- package/presets/mavis/php-laravel/commands/README.md +1 -0
- package/presets/mavis/php-laravel/commands/migrate-tasks.md +36 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/php-laravel/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/php-laravel/team/README.md +14 -2
- package/presets/mavis/platform-contract.json +2 -1
- package/presets/mavis/svelte/REPO_AGENTS.md +15 -8
- package/presets/mavis/svelte/adapter-map.json +9 -1
- package/presets/mavis/svelte/commands/README.md +1 -0
- package/presets/mavis/svelte/commands/migrate-tasks.md +36 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/svelte/rules/preset-twin-sync.md +2 -2
- package/presets/mavis/svelte/team/README.md +14 -2
- package/presets/opencode/android-kotlin/REPO_AGENTS.md +15 -8
- package/presets/opencode/android-kotlin/adapter-map.json +9 -1
- package/presets/opencode/android-kotlin/commands/README.md +1 -0
- package/presets/opencode/android-kotlin/commands/migrate-tasks.md +44 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/android-kotlin/team/README.md +14 -2
- package/presets/opencode/go/REPO_AGENTS.md +15 -8
- package/presets/opencode/go/adapter-map.json +9 -1
- package/presets/opencode/go/commands/README.md +1 -0
- package/presets/opencode/go/commands/migrate-tasks.md +44 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/go/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/go/team/README.md +14 -2
- package/presets/opencode/ios-swift/REPO_AGENTS.md +15 -8
- package/presets/opencode/ios-swift/adapter-map.json +9 -1
- package/presets/opencode/ios-swift/commands/README.md +1 -0
- package/presets/opencode/ios-swift/commands/migrate-tasks.md +44 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/ios-swift/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/ios-swift/team/README.md +14 -2
- package/presets/opencode/java/REPO_AGENTS.md +15 -8
- package/presets/opencode/java/adapter-map.json +9 -1
- package/presets/opencode/java/commands/README.md +1 -0
- package/presets/opencode/java/commands/migrate-tasks.md +44 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/java/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/java/team/README.md +14 -2
- package/presets/opencode/mcp-ts/REPO_AGENTS.md +15 -8
- package/presets/opencode/mcp-ts/adapter-map.json +9 -1
- package/presets/opencode/mcp-ts/commands/README.md +1 -0
- package/presets/opencode/mcp-ts/commands/migrate-tasks.md +44 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/mcp-ts/team/README.md +14 -2
- package/presets/opencode/mol/MCP.md +50 -0
- package/presets/opencode/mol/OPENCODE.md +99 -0
- package/presets/opencode/mol/README.md +17 -0
- package/presets/opencode/mol/REPO_AGENTS.md +107 -0
- package/presets/opencode/mol/adapter-map.json +1122 -0
- package/presets/opencode/mol/agents/README.md +97 -0
- package/presets/opencode/mol/agents/accessibility-reviewer.md +97 -0
- package/presets/opencode/mol/agents/api-contract-reviewer.md +92 -0
- package/presets/opencode/mol/agents/build-verifier.md +122 -0
- package/presets/opencode/mol/agents/ci-investigator.md +98 -0
- package/presets/opencode/mol/agents/code-reviewer.md +144 -0
- package/presets/opencode/mol/agents/codebase-analyzer.md +56 -0
- package/presets/opencode/mol/agents/debugger.md +129 -0
- package/presets/opencode/mol/agents/feature-developer.md +154 -0
- package/presets/opencode/mol/agents/migration-specialist.md +102 -0
- package/presets/opencode/mol/agents/mockup-reviewer.md +136 -0
- package/presets/opencode/mol/agents/openspec-author.md +219 -0
- package/presets/opencode/mol/agents/performance-auditor.md +103 -0
- package/presets/opencode/mol/agents/playwright-test-generator.md +59 -0
- package/presets/opencode/mol/agents/playwright-test-healer.md +60 -0
- package/presets/opencode/mol/agents/playwright-test-planner.md +56 -0
- package/presets/opencode/mol/agents/qa-tester.md +83 -0
- package/presets/opencode/mol/agents/security-reviewer.md +94 -0
- package/presets/opencode/mol/agents/solution-architect.md +104 -0
- package/presets/opencode/mol/agents/task-analyst.md +260 -0
- package/presets/opencode/mol/agents/task-router.md +272 -0
- package/presets/opencode/mol/agents/tech-writer.md +99 -0
- package/presets/opencode/mol/agents/unit-test-generator.md +62 -0
- package/presets/opencode/mol/agents/unit-test-healer.md +63 -0
- package/presets/opencode/mol/agents/unit-test-planner.md +89 -0
- package/presets/opencode/mol/ai-local/conventions.md +49 -0
- package/presets/opencode/mol/ai-local/rules/task-levels.md +40 -0
- package/presets/opencode/mol/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/opencode/mol/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/opencode/mol/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/opencode/mol/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/opencode/mol/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/opencode/mol/ai-local/rules-library/code-style.md +68 -0
- package/presets/opencode/mol/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/opencode/mol/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/opencode/mol/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/opencode/mol/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/opencode/mol/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/opencode/mol/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/opencode/mol/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/opencode/mol/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/opencode/mol/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/opencode/mol/ai-local/rules-library/router-pages.md +25 -0
- package/presets/opencode/mol/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/opencode/mol/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/opencode/mol/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/opencode/mol/commands/README.md +56 -0
- package/presets/opencode/mol/commands/migrate-tasks.md +44 -0
- package/presets/opencode/mol/commands/spec-start.md +32 -0
- package/presets/opencode/mol/commands/task-continue.md +75 -0
- package/presets/opencode/mol/commands/task-evil.md +91 -0
- package/presets/opencode/mol/commands/task.md +79 -0
- package/presets/opencode/mol/commands/technical-retro.md +96 -0
- package/presets/opencode/mol/commands/update.md +43 -0
- package/presets/opencode/mol/hooks/README.md +27 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +2765 -0
- package/presets/opencode/mol/hooks/check-preset-update.mjs +232 -0
- package/presets/opencode/mol/hooks/list-ai-local.mjs +299 -0
- package/presets/opencode/mol/opencode.json +78 -0
- package/presets/opencode/mol/rules/README.md +25 -0
- package/presets/opencode/mol/rules/agent-team-intake.md +14 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +282 -0
- package/presets/opencode/mol/rules/ai-local-overlay.md +18 -0
- package/presets/opencode/mol/rules/anti-hallucination-contract.md +37 -0
- package/presets/opencode/mol/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/opencode/mol/rules/code-quality-and-refactoring.md +76 -0
- package/presets/opencode/mol/rules/code-review-mr.md +95 -0
- package/presets/opencode/mol/rules/design-guidance.md +104 -0
- package/presets/opencode/mol/rules/feature-delivery-workflow.md +144 -0
- package/presets/opencode/mol/rules/interactive-questions.md +29 -0
- package/presets/opencode/mol/rules/language-policy.md +51 -0
- package/presets/opencode/mol/rules/mcp-usage.md +96 -0
- package/presets/opencode/mol/rules/mol-app-core.md +29 -0
- package/presets/opencode/mol/rules/mol-build.md +19 -0
- package/presets/opencode/mol/rules/mol-components.md +31 -0
- package/presets/opencode/mol/rules/mol-reactivity.md +21 -0
- package/presets/opencode/mol/rules/mol-state.md +22 -0
- package/presets/opencode/mol/rules/mol-testing.md +28 -0
- package/presets/opencode/mol/rules/mol-theming.md +22 -0
- package/presets/opencode/mol/rules/mol-view-tree.md +27 -0
- package/presets/opencode/mol/rules/package-manager.md +7 -0
- package/presets/opencode/mol/rules/preset-goals.md +31 -0
- package/presets/opencode/mol/rules/preset-layering.md +27 -0
- package/presets/opencode/mol/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/opencode/mol/rules/preset-pr-checklist.md +45 -0
- package/presets/opencode/mol/rules/preset-token-budget.md +38 -0
- package/presets/opencode/mol/rules/preset-twin-sync.md +41 -0
- package/presets/opencode/mol/rules/preset-writing-style.md +42 -0
- package/presets/opencode/mol/rules/product-specs-authoring.md +118 -0
- package/presets/opencode/mol/rules/product-specs.md +61 -0
- package/presets/opencode/mol/rules/reference-features.md +82 -0
- package/presets/opencode/mol/rules/technical-retro.md +13 -0
- package/presets/opencode/mol/skills/README.md +17 -0
- package/presets/opencode/mol/skills/ci-investigation/SKILL.md +49 -0
- package/presets/opencode/mol/skills/code-review/SKILL.md +60 -0
- package/presets/opencode/mol/skills/debug-investigation/SKILL.md +63 -0
- package/presets/opencode/mol/skills/feature-delivery/SKILL.md +44 -0
- package/presets/opencode/mol/skills/spec-authoring/SKILL.md +31 -0
- package/presets/opencode/mol/skills/spec-discovery/SKILL.md +63 -0
- package/presets/opencode/mol/skills/technical-retro/SKILL.md +72 -0
- package/presets/opencode/mol/skills/unit-testing/SKILL.md +38 -0
- package/presets/opencode/mol/skills/write-adr/SKILL.md +46 -0
- package/presets/opencode/mol/team/README.md +135 -0
- package/presets/opencode/mol/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/opencode/mol/team/fixtures/bugfix-standard.json +25 -0
- package/presets/opencode/mol/team/fixtures/feature-full.json +29 -0
- package/presets/opencode/mol/team/fixtures/feature-light.json +28 -0
- package/presets/opencode/mol/team/fixtures/feature-parallel.json +84 -0
- package/presets/opencode/mol/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/opencode/mol/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/opencode/mol/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/opencode/mol/team/fixtures/memlog.example.md +9 -0
- package/presets/opencode/mol/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/opencode/mol/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/opencode/mol/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/opencode/mol/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/opencode/mol/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/opencode/mol/team/fixtures/metrics.example.json +54 -0
- package/presets/opencode/mol/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/opencode/mol/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/opencode/mol/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/opencode/mol/team/tasks/.gitkeep +0 -0
- package/presets/opencode/next/MCP.md +7 -0
- package/presets/opencode/next/REPO_AGENTS.md +16 -9
- package/presets/opencode/next/adapter-map.json +18 -1
- package/presets/opencode/next/agents/task-analyst.md +11 -0
- package/presets/opencode/next/agents/task-router.md +11 -0
- package/presets/opencode/next/commands/README.md +6 -0
- package/presets/opencode/next/commands/migrate-tasks.md +44 -0
- package/presets/opencode/next/commands/task-evil.md +91 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/next/opencode.json +26 -4
- package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/next/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/next/team/README.md +14 -2
- package/presets/opencode/nuxt/REPO_AGENTS.md +15 -8
- package/presets/opencode/nuxt/adapter-map.json +9 -1
- package/presets/opencode/nuxt/commands/README.md +1 -0
- package/presets/opencode/nuxt/commands/migrate-tasks.md +44 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/nuxt/opencode.json +4 -4
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/nuxt/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/nuxt/team/README.md +14 -2
- package/presets/opencode/php-hexagonal/REPO_AGENTS.md +15 -8
- package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
- package/presets/opencode/php-hexagonal/commands/README.md +1 -0
- package/presets/opencode/php-hexagonal/commands/migrate-tasks.md +44 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/php-hexagonal/team/README.md +14 -2
- package/presets/opencode/php-laravel/REPO_AGENTS.md +15 -8
- package/presets/opencode/php-laravel/adapter-map.json +9 -1
- package/presets/opencode/php-laravel/commands/README.md +1 -0
- package/presets/opencode/php-laravel/commands/migrate-tasks.md +44 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/php-laravel/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/php-laravel/team/README.md +14 -2
- package/presets/opencode/platform-contract.json +2 -1
- package/presets/opencode/svelte/REPO_AGENTS.md +15 -8
- package/presets/opencode/svelte/adapter-map.json +9 -1
- package/presets/opencode/svelte/commands/README.md +1 -0
- package/presets/opencode/svelte/commands/migrate-tasks.md +44 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +109 -0
- package/presets/opencode/svelte/opencode.json +4 -4
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/svelte/rules/preset-twin-sync.md +2 -2
- package/presets/opencode/svelte/team/README.md +14 -2
- package/presets/zcode/README.md +17 -0
- package/presets/zcode/android-kotlin/MCP.md +35 -0
- package/presets/zcode/android-kotlin/README.md +20 -0
- package/presets/zcode/android-kotlin/REPO_AGENTS.md +100 -0
- package/presets/zcode/android-kotlin/adapter-map.json +925 -0
- package/presets/zcode/android-kotlin/agents/README.md +68 -0
- package/presets/zcode/android-kotlin/agents/accessibility-reviewer.md +87 -0
- package/presets/zcode/android-kotlin/agents/api-contract-reviewer.md +92 -0
- package/presets/zcode/android-kotlin/agents/build-verifier.md +87 -0
- package/presets/zcode/android-kotlin/agents/ci-investigator.md +114 -0
- package/presets/zcode/android-kotlin/agents/code-reviewer.md +133 -0
- package/presets/zcode/android-kotlin/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/android-kotlin/agents/debugger.md +136 -0
- package/presets/zcode/android-kotlin/agents/feature-developer.md +154 -0
- package/presets/zcode/android-kotlin/agents/instrumentation-test-generator.md +43 -0
- package/presets/zcode/android-kotlin/agents/instrumentation-test-healer.md +43 -0
- package/presets/zcode/android-kotlin/agents/instrumentation-test-planner.md +45 -0
- package/presets/zcode/android-kotlin/agents/migration-specialist.md +101 -0
- package/presets/zcode/android-kotlin/agents/mockup-reviewer.md +81 -0
- package/presets/zcode/android-kotlin/agents/openspec-author.md +185 -0
- package/presets/zcode/android-kotlin/agents/performance-auditor.md +94 -0
- package/presets/zcode/android-kotlin/agents/qa-tester.md +91 -0
- package/presets/zcode/android-kotlin/agents/security-reviewer.md +86 -0
- package/presets/zcode/android-kotlin/agents/solution-architect.md +48 -0
- package/presets/zcode/android-kotlin/agents/task-analyst.md +152 -0
- package/presets/zcode/android-kotlin/agents/task-router.md +190 -0
- package/presets/zcode/android-kotlin/agents/tech-writer.md +91 -0
- package/presets/zcode/android-kotlin/agents/unit-test-generator.md +77 -0
- package/presets/zcode/android-kotlin/agents/unit-test-healer.md +76 -0
- package/presets/zcode/android-kotlin/agents/unit-test-planner.md +89 -0
- package/presets/zcode/android-kotlin/ai-local/conventions.md +25 -0
- package/presets/zcode/android-kotlin/commands/README.md +51 -0
- package/presets/zcode/android-kotlin/commands/migrate-tasks.md +44 -0
- package/presets/zcode/android-kotlin/commands/spec-start.md +32 -0
- package/presets/zcode/android-kotlin/commands/task-continue.md +75 -0
- package/presets/zcode/android-kotlin/commands/task.md +76 -0
- package/presets/zcode/android-kotlin/commands/technical-retro.md +96 -0
- package/presets/zcode/android-kotlin/commands/update.md +43 -0
- package/presets/zcode/android-kotlin/hooks/README.md +31 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +2768 -0
- package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/android-kotlin/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/android-kotlin/mcp.json +11 -0
- package/presets/zcode/android-kotlin/rules/README.md +25 -0
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +14 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/android-kotlin/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/android-kotlin/rules/android-app-core.md +27 -0
- package/presets/zcode/android-kotlin/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/android-kotlin/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/android-kotlin/rules/architecture-boundaries.md +23 -0
- package/presets/zcode/android-kotlin/rules/code-quality-and-refactoring.md +77 -0
- package/presets/zcode/android-kotlin/rules/code-review-mr.md +109 -0
- package/presets/zcode/android-kotlin/rules/compose-ui.md +25 -0
- package/presets/zcode/android-kotlin/rules/design-guidance.md +104 -0
- package/presets/zcode/android-kotlin/rules/di-dagger-feature-holders.md +26 -0
- package/presets/zcode/android-kotlin/rules/feature-delivery-workflow.md +43 -0
- package/presets/zcode/android-kotlin/rules/gradle-tooling.md +22 -0
- package/presets/zcode/android-kotlin/rules/interactive-questions.md +29 -0
- package/presets/zcode/android-kotlin/rules/kotlin-anti-hallucination.md +27 -0
- package/presets/zcode/android-kotlin/rules/kotlin-conventions.md +24 -0
- package/presets/zcode/android-kotlin/rules/language-policy.md +51 -0
- package/presets/zcode/android-kotlin/rules/mcp-usage.md +94 -0
- package/presets/zcode/android-kotlin/rules/mockup-review.md +171 -0
- package/presets/zcode/android-kotlin/rules/module-public-api.md +22 -0
- package/presets/zcode/android-kotlin/rules/navigation-feature-launcher.md +23 -0
- package/presets/zcode/android-kotlin/rules/networking-data.md +23 -0
- package/presets/zcode/android-kotlin/rules/persistence-data.md +22 -0
- package/presets/zcode/android-kotlin/rules/post-change-build.md +25 -0
- package/presets/zcode/android-kotlin/rules/preset-goals.md +31 -0
- package/presets/zcode/android-kotlin/rules/preset-layering.md +27 -0
- package/presets/zcode/android-kotlin/rules/preset-no-cross-stack-leakage.md +93 -0
- package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/android-kotlin/rules/preset-token-budget.md +38 -0
- package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/android-kotlin/rules/preset-writing-style.md +42 -0
- package/presets/zcode/android-kotlin/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/android-kotlin/rules/product-specs.md +61 -0
- package/presets/zcode/android-kotlin/rules/reference-features.md +22 -0
- package/presets/zcode/android-kotlin/rules/security-android.md +21 -0
- package/presets/zcode/android-kotlin/rules/state-and-viewmodels.md +21 -0
- package/presets/zcode/android-kotlin/rules/technical-retro.md +13 -0
- package/presets/zcode/android-kotlin/rules/tests-ui.md +22 -0
- package/presets/zcode/android-kotlin/rules/tests-unit.md +22 -0
- package/presets/zcode/android-kotlin/rules/ux-design.md +103 -0
- package/presets/zcode/android-kotlin/skills/README.md +18 -0
- package/presets/zcode/android-kotlin/skills/ci-investigation/SKILL.md +53 -0
- package/presets/zcode/android-kotlin/skills/code-review/SKILL.md +61 -0
- package/presets/zcode/android-kotlin/skills/debug-investigation/SKILL.md +72 -0
- package/presets/zcode/android-kotlin/skills/feature-delivery/SKILL.md +51 -0
- package/presets/zcode/android-kotlin/skills/instrumentation-ui-e2e/SKILL.md +23 -0
- package/presets/zcode/android-kotlin/skills/mockup-review/SKILL.md +34 -0
- package/presets/zcode/android-kotlin/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/android-kotlin/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/android-kotlin/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/android-kotlin/skills/unit-testing/SKILL.md +38 -0
- package/presets/zcode/android-kotlin/skills/ux-design/SKILL.md +41 -0
- package/presets/zcode/android-kotlin/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/android-kotlin/team/README.md +123 -0
- package/presets/zcode/android-kotlin/team/fixtures/artifact-manifest.example.json +26 -0
- package/presets/zcode/android-kotlin/team/fixtures/bugfix-standard.json +47 -0
- package/presets/zcode/android-kotlin/team/fixtures/feature-full.json +98 -0
- package/presets/zcode/android-kotlin/team/fixtures/feature-light.json +38 -0
- package/presets/zcode/android-kotlin/team/fixtures/feature-with-figma-url.json +17 -0
- package/presets/zcode/android-kotlin/team/fixtures/feature-with-ux-no-figma.json +17 -0
- package/presets/zcode/android-kotlin/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/android-kotlin/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/android-kotlin/team/fixtures/mockup-review-standalone.json +14 -0
- package/presets/zcode/android-kotlin/team/fixtures/ux-design-standalone.json +15 -0
- package/presets/zcode/go/MCP.md +37 -0
- package/presets/zcode/go/README.md +20 -0
- package/presets/zcode/go/REPO_AGENTS.md +100 -0
- package/presets/zcode/go/adapter-map.json +864 -0
- package/presets/zcode/go/agents/README.md +55 -0
- package/presets/zcode/go/agents/api-contract-reviewer.md +47 -0
- package/presets/zcode/go/agents/build-verifier.md +72 -0
- package/presets/zcode/go/agents/ci-investigator.md +66 -0
- package/presets/zcode/go/agents/code-reviewer.md +128 -0
- package/presets/zcode/go/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/go/agents/debugger.md +98 -0
- package/presets/zcode/go/agents/feature-developer.md +144 -0
- package/presets/zcode/go/agents/integration-test-generator.md +46 -0
- package/presets/zcode/go/agents/integration-test-healer.md +46 -0
- package/presets/zcode/go/agents/integration-test-planner.md +48 -0
- package/presets/zcode/go/agents/migration-specialist.md +59 -0
- package/presets/zcode/go/agents/openspec-author.md +185 -0
- package/presets/zcode/go/agents/performance-auditor.md +50 -0
- package/presets/zcode/go/agents/qa-tester.md +53 -0
- package/presets/zcode/go/agents/security-reviewer.md +42 -0
- package/presets/zcode/go/agents/solution-architect.md +56 -0
- package/presets/zcode/go/agents/task-analyst.md +131 -0
- package/presets/zcode/go/agents/task-router.md +179 -0
- package/presets/zcode/go/agents/tech-writer.md +45 -0
- package/presets/zcode/go/agents/unit-test-generator.md +44 -0
- package/presets/zcode/go/agents/unit-test-healer.md +36 -0
- package/presets/zcode/go/agents/unit-test-planner.md +51 -0
- package/presets/zcode/go/ai-local/conventions.md +29 -0
- package/presets/zcode/go/commands/README.md +54 -0
- package/presets/zcode/go/commands/migrate-tasks.md +44 -0
- package/presets/zcode/go/commands/spec-start.md +32 -0
- package/presets/zcode/go/commands/task-continue.md +73 -0
- package/presets/zcode/go/commands/task.md +74 -0
- package/presets/zcode/go/commands/technical-retro.md +96 -0
- package/presets/zcode/go/commands/update.md +43 -0
- package/presets/zcode/go/hooks/README.md +31 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +2763 -0
- package/presets/zcode/go/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/go/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/go/mcp.json +11 -0
- package/presets/zcode/go/rules/README.md +25 -0
- package/presets/zcode/go/rules/adapters-driven.md +25 -0
- package/presets/zcode/go/rules/adapters-driving.md +26 -0
- package/presets/zcode/go/rules/agent-team-intake.md +18 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/go/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/go/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/go/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/go/rules/api-grpc.md +20 -0
- package/presets/zcode/go/rules/api-http.md +25 -0
- package/presets/zcode/go/rules/application-usecases.md +26 -0
- package/presets/zcode/go/rules/architecture-boundaries.md +31 -0
- package/presets/zcode/go/rules/code-quality-and-refactoring.md +78 -0
- package/presets/zcode/go/rules/code-review-mr.md +77 -0
- package/presets/zcode/go/rules/composition-root.md +26 -0
- package/presets/zcode/go/rules/design-guidance.md +104 -0
- package/presets/zcode/go/rules/domain-layer.md +25 -0
- package/presets/zcode/go/rules/feature-delivery-workflow.md +59 -0
- package/presets/zcode/go/rules/go-anti-hallucination.md +27 -0
- package/presets/zcode/go/rules/go-app-core.md +31 -0
- package/presets/zcode/go/rules/go-conventions.md +46 -0
- package/presets/zcode/go/rules/go-tooling.md +28 -0
- package/presets/zcode/go/rules/interactive-questions.md +29 -0
- package/presets/zcode/go/rules/language-policy.md +51 -0
- package/presets/zcode/go/rules/mcp-usage.md +93 -0
- package/presets/zcode/go/rules/messaging-adapters.md +15 -0
- package/presets/zcode/go/rules/module-public-api.md +16 -0
- package/presets/zcode/go/rules/persistence-adapters.md +24 -0
- package/presets/zcode/go/rules/ports-interfaces.md +26 -0
- package/presets/zcode/go/rules/post-change-test.md +22 -0
- package/presets/zcode/go/rules/preset-goals.md +31 -0
- package/presets/zcode/go/rules/preset-layering.md +27 -0
- package/presets/zcode/go/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/go/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/go/rules/preset-token-budget.md +38 -0
- package/presets/zcode/go/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/go/rules/preset-writing-style.md +42 -0
- package/presets/zcode/go/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/go/rules/product-specs.md +62 -0
- package/presets/zcode/go/rules/reference-features.md +45 -0
- package/presets/zcode/go/rules/security-go.md +26 -0
- package/presets/zcode/go/rules/technical-retro.md +13 -0
- package/presets/zcode/go/rules/tests-e2e.md +13 -0
- package/presets/zcode/go/rules/tests-integration.md +22 -0
- package/presets/zcode/go/rules/tests-unit.md +18 -0
- package/presets/zcode/go/skills/README.md +5 -0
- package/presets/zcode/go/skills/ci-investigation/SKILL.md +24 -0
- package/presets/zcode/go/skills/code-review/SKILL.md +47 -0
- package/presets/zcode/go/skills/debug-investigation/SKILL.md +55 -0
- package/presets/zcode/go/skills/feature-delivery/SKILL.md +43 -0
- package/presets/zcode/go/skills/integration-testing/SKILL.md +21 -0
- package/presets/zcode/go/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/go/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/go/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/go/skills/unit-testing/SKILL.md +20 -0
- package/presets/zcode/go/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/go/team/README.md +123 -0
- package/presets/zcode/go/team/fixtures/bugfix-standard.json +37 -0
- package/presets/zcode/go/team/fixtures/feature-full.json +61 -0
- package/presets/zcode/go/team/fixtures/feature-light.json +17 -0
- package/presets/zcode/go/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/ios-swift/MCP.md +35 -0
- package/presets/zcode/ios-swift/README.md +20 -0
- package/presets/zcode/ios-swift/REPO_AGENTS.md +98 -0
- package/presets/zcode/ios-swift/adapter-map.json +918 -0
- package/presets/zcode/ios-swift/agents/README.md +86 -0
- package/presets/zcode/ios-swift/agents/accessibility-reviewer.md +85 -0
- package/presets/zcode/ios-swift/agents/api-contract-reviewer.md +85 -0
- package/presets/zcode/ios-swift/agents/build-verifier.md +103 -0
- package/presets/zcode/ios-swift/agents/ci-investigator.md +107 -0
- package/presets/zcode/ios-swift/agents/code-reviewer.md +133 -0
- package/presets/zcode/ios-swift/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/ios-swift/agents/debugger.md +129 -0
- package/presets/zcode/ios-swift/agents/feature-developer.md +153 -0
- package/presets/zcode/ios-swift/agents/migration-specialist.md +95 -0
- package/presets/zcode/ios-swift/agents/mockup-reviewer.md +81 -0
- package/presets/zcode/ios-swift/agents/openspec-author.md +185 -0
- package/presets/zcode/ios-swift/agents/performance-auditor.md +94 -0
- package/presets/zcode/ios-swift/agents/qa-tester.md +85 -0
- package/presets/zcode/ios-swift/agents/security-reviewer.md +81 -0
- package/presets/zcode/ios-swift/agents/solution-architect.md +48 -0
- package/presets/zcode/ios-swift/agents/task-analyst.md +152 -0
- package/presets/zcode/ios-swift/agents/task-router.md +190 -0
- package/presets/zcode/ios-swift/agents/tech-writer.md +75 -0
- package/presets/zcode/ios-swift/agents/unit-test-generator.md +71 -0
- package/presets/zcode/ios-swift/agents/unit-test-healer.md +70 -0
- package/presets/zcode/ios-swift/agents/unit-test-planner.md +83 -0
- package/presets/zcode/ios-swift/agents/xcuitest-test-generator.md +59 -0
- package/presets/zcode/ios-swift/agents/xcuitest-test-healer.md +59 -0
- package/presets/zcode/ios-swift/agents/xcuitest-test-planner.md +79 -0
- package/presets/zcode/ios-swift/ai-local/conventions.md +29 -0
- package/presets/zcode/ios-swift/commands/README.md +51 -0
- package/presets/zcode/ios-swift/commands/migrate-tasks.md +44 -0
- package/presets/zcode/ios-swift/commands/spec-start.md +32 -0
- package/presets/zcode/ios-swift/commands/task-continue.md +75 -0
- package/presets/zcode/ios-swift/commands/task.md +76 -0
- package/presets/zcode/ios-swift/commands/technical-retro.md +96 -0
- package/presets/zcode/ios-swift/commands/update.md +43 -0
- package/presets/zcode/ios-swift/hooks/README.md +31 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +2768 -0
- package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/ios-swift/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/ios-swift/mcp.json +11 -0
- package/presets/zcode/ios-swift/rules/README.md +25 -0
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +14 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/ios-swift/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/ios-swift/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/ios-swift/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/ios-swift/rules/architecture-boundaries.md +29 -0
- package/presets/zcode/ios-swift/rules/code-quality-and-refactoring.md +77 -0
- package/presets/zcode/ios-swift/rules/code-review-mr.md +109 -0
- package/presets/zcode/ios-swift/rules/design-guidance.md +104 -0
- package/presets/zcode/ios-swift/rules/feature-delivery-workflow.md +129 -0
- package/presets/zcode/ios-swift/rules/interactive-questions.md +29 -0
- package/presets/zcode/ios-swift/rules/ios-app-core.md +20 -0
- package/presets/zcode/ios-swift/rules/language-policy.md +51 -0
- package/presets/zcode/ios-swift/rules/mcp-usage.md +94 -0
- package/presets/zcode/ios-swift/rules/mockup-review.md +171 -0
- package/presets/zcode/ios-swift/rules/module-public-api.md +17 -0
- package/presets/zcode/ios-swift/rules/navigation-coordinators.md +18 -0
- package/presets/zcode/ios-swift/rules/networking-services.md +43 -0
- package/presets/zcode/ios-swift/rules/persistence-data.md +20 -0
- package/presets/zcode/ios-swift/rules/post-change-build.md +27 -0
- package/presets/zcode/ios-swift/rules/preset-goals.md +31 -0
- package/presets/zcode/ios-swift/rules/preset-layering.md +27 -0
- package/presets/zcode/ios-swift/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/ios-swift/rules/preset-token-budget.md +38 -0
- package/presets/zcode/ios-swift/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/ios-swift/rules/preset-writing-style.md +42 -0
- package/presets/zcode/ios-swift/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/ios-swift/rules/product-specs.md +61 -0
- package/presets/zcode/ios-swift/rules/reference-features.md +94 -0
- package/presets/zcode/ios-swift/rules/security-ios.md +24 -0
- package/presets/zcode/ios-swift/rules/state-and-viewmodels.md +37 -0
- package/presets/zcode/ios-swift/rules/swift-anti-hallucination.md +27 -0
- package/presets/zcode/ios-swift/rules/swift-conventions.md +55 -0
- package/presets/zcode/ios-swift/rules/swiftui-ui.md +70 -0
- package/presets/zcode/ios-swift/rules/technical-retro.md +13 -0
- package/presets/zcode/ios-swift/rules/tests-ui.md +37 -0
- package/presets/zcode/ios-swift/rules/tests-unit.md +35 -0
- package/presets/zcode/ios-swift/rules/ux-design.md +103 -0
- package/presets/zcode/ios-swift/rules/xcode-tooling.md +15 -0
- package/presets/zcode/ios-swift/skills/README.md +18 -0
- package/presets/zcode/ios-swift/skills/ci-investigation/SKILL.md +53 -0
- package/presets/zcode/ios-swift/skills/code-review/SKILL.md +61 -0
- package/presets/zcode/ios-swift/skills/debug-investigation/SKILL.md +72 -0
- package/presets/zcode/ios-swift/skills/feature-delivery/SKILL.md +51 -0
- package/presets/zcode/ios-swift/skills/mockup-review/SKILL.md +34 -0
- package/presets/zcode/ios-swift/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/ios-swift/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/ios-swift/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/ios-swift/skills/unit-testing/SKILL.md +38 -0
- package/presets/zcode/ios-swift/skills/ux-design/SKILL.md +41 -0
- package/presets/zcode/ios-swift/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/ios-swift/skills/xcuitest-e2e/SKILL.md +39 -0
- package/presets/zcode/ios-swift/team/README.md +123 -0
- package/presets/zcode/ios-swift/team/fixtures/artifact-manifest.example.json +26 -0
- package/presets/zcode/ios-swift/team/fixtures/bugfix-standard.json +33 -0
- package/presets/zcode/ios-swift/team/fixtures/feature-full.json +61 -0
- package/presets/zcode/ios-swift/team/fixtures/feature-light.json +17 -0
- package/presets/zcode/ios-swift/team/fixtures/feature-with-figma-url.json +17 -0
- package/presets/zcode/ios-swift/team/fixtures/feature-with-ux-no-figma.json +17 -0
- package/presets/zcode/ios-swift/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/ios-swift/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/ios-swift/team/fixtures/mockup-review-standalone.json +14 -0
- package/presets/zcode/ios-swift/team/fixtures/ux-design-standalone.json +15 -0
- package/presets/zcode/java/MCP.md +34 -0
- package/presets/zcode/java/README.md +20 -0
- package/presets/zcode/java/REPO_AGENTS.md +98 -0
- package/presets/zcode/java/adapter-map.json +864 -0
- package/presets/zcode/java/agents/README.md +55 -0
- package/presets/zcode/java/agents/api-contract-reviewer.md +47 -0
- package/presets/zcode/java/agents/build-verifier.md +72 -0
- package/presets/zcode/java/agents/ci-investigator.md +66 -0
- package/presets/zcode/java/agents/code-reviewer.md +128 -0
- package/presets/zcode/java/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/java/agents/debugger.md +98 -0
- package/presets/zcode/java/agents/feature-developer.md +144 -0
- package/presets/zcode/java/agents/integration-test-generator.md +46 -0
- package/presets/zcode/java/agents/integration-test-healer.md +46 -0
- package/presets/zcode/java/agents/integration-test-planner.md +48 -0
- package/presets/zcode/java/agents/migration-specialist.md +59 -0
- package/presets/zcode/java/agents/openspec-author.md +185 -0
- package/presets/zcode/java/agents/performance-auditor.md +50 -0
- package/presets/zcode/java/agents/qa-tester.md +53 -0
- package/presets/zcode/java/agents/security-reviewer.md +42 -0
- package/presets/zcode/java/agents/solution-architect.md +56 -0
- package/presets/zcode/java/agents/task-analyst.md +131 -0
- package/presets/zcode/java/agents/task-router.md +179 -0
- package/presets/zcode/java/agents/tech-writer.md +45 -0
- package/presets/zcode/java/agents/unit-test-generator.md +44 -0
- package/presets/zcode/java/agents/unit-test-healer.md +36 -0
- package/presets/zcode/java/agents/unit-test-planner.md +51 -0
- package/presets/zcode/java/ai-local/conventions.md +29 -0
- package/presets/zcode/java/commands/README.md +54 -0
- package/presets/zcode/java/commands/migrate-tasks.md +44 -0
- package/presets/zcode/java/commands/spec-start.md +32 -0
- package/presets/zcode/java/commands/task-continue.md +73 -0
- package/presets/zcode/java/commands/task.md +74 -0
- package/presets/zcode/java/commands/technical-retro.md +96 -0
- package/presets/zcode/java/commands/update.md +43 -0
- package/presets/zcode/java/hooks/README.md +31 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +2763 -0
- package/presets/zcode/java/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/java/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/java/mcp.json +11 -0
- package/presets/zcode/java/rules/README.md +25 -0
- package/presets/zcode/java/rules/adapters-driven.md +30 -0
- package/presets/zcode/java/rules/adapters-driving.md +30 -0
- package/presets/zcode/java/rules/agent-team-intake.md +18 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/java/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/java/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/java/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/java/rules/api-grpc.md +22 -0
- package/presets/zcode/java/rules/api-http.md +28 -0
- package/presets/zcode/java/rules/application-usecases.md +26 -0
- package/presets/zcode/java/rules/architecture-boundaries.md +31 -0
- package/presets/zcode/java/rules/code-quality-and-refactoring.md +78 -0
- package/presets/zcode/java/rules/code-review-mr.md +79 -0
- package/presets/zcode/java/rules/composition-root.md +25 -0
- package/presets/zcode/java/rules/design-guidance.md +105 -0
- package/presets/zcode/java/rules/domain-layer.md +32 -0
- package/presets/zcode/java/rules/feature-delivery-workflow.md +59 -0
- package/presets/zcode/java/rules/interactive-questions.md +29 -0
- package/presets/zcode/java/rules/java-anti-hallucination.md +27 -0
- package/presets/zcode/java/rules/java-app-core.md +32 -0
- package/presets/zcode/java/rules/java-conventions.md +48 -0
- package/presets/zcode/java/rules/java-tooling.md +24 -0
- package/presets/zcode/java/rules/language-policy.md +51 -0
- package/presets/zcode/java/rules/mcp-usage.md +92 -0
- package/presets/zcode/java/rules/messaging-adapters.md +23 -0
- package/presets/zcode/java/rules/module-public-api.md +23 -0
- package/presets/zcode/java/rules/persistence-adapters.md +25 -0
- package/presets/zcode/java/rules/ports-interfaces.md +27 -0
- package/presets/zcode/java/rules/post-change-test.md +20 -0
- package/presets/zcode/java/rules/preset-goals.md +31 -0
- package/presets/zcode/java/rules/preset-layering.md +27 -0
- package/presets/zcode/java/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/java/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/java/rules/preset-token-budget.md +38 -0
- package/presets/zcode/java/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/java/rules/preset-writing-style.md +42 -0
- package/presets/zcode/java/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/java/rules/product-specs.md +62 -0
- package/presets/zcode/java/rules/reference-features.md +45 -0
- package/presets/zcode/java/rules/security-java.md +21 -0
- package/presets/zcode/java/rules/technical-retro.md +13 -0
- package/presets/zcode/java/rules/tests-e2e.md +15 -0
- package/presets/zcode/java/rules/tests-integration.md +19 -0
- package/presets/zcode/java/rules/tests-unit.md +26 -0
- package/presets/zcode/java/skills/README.md +5 -0
- package/presets/zcode/java/skills/ci-investigation/SKILL.md +24 -0
- package/presets/zcode/java/skills/code-review/SKILL.md +47 -0
- package/presets/zcode/java/skills/debug-investigation/SKILL.md +55 -0
- package/presets/zcode/java/skills/feature-delivery/SKILL.md +43 -0
- package/presets/zcode/java/skills/integration-testing/SKILL.md +21 -0
- package/presets/zcode/java/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/java/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/java/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/java/skills/unit-testing/SKILL.md +20 -0
- package/presets/zcode/java/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/java/team/README.md +123 -0
- package/presets/zcode/java/team/fixtures/bugfix-standard.json +37 -0
- package/presets/zcode/java/team/fixtures/feature-full.json +61 -0
- package/presets/zcode/java/team/fixtures/feature-light.json +17 -0
- package/presets/zcode/java/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/mcp-ts/MCP.md +56 -0
- package/presets/zcode/mcp-ts/README.md +20 -0
- package/presets/zcode/mcp-ts/REPO_AGENTS.md +101 -0
- package/presets/zcode/mcp-ts/adapter-map.json +612 -0
- package/presets/zcode/mcp-ts/agents/README.md +53 -0
- package/presets/zcode/mcp-ts/agents/build-verifier.md +73 -0
- package/presets/zcode/mcp-ts/agents/feature-developer.md +138 -0
- package/presets/zcode/mcp-ts/agents/security-reviewer.md +43 -0
- package/presets/zcode/mcp-ts/agents/solution-architect.md +50 -0
- package/presets/zcode/mcp-ts/agents/task-analyst.md +134 -0
- package/presets/zcode/mcp-ts/agents/task-router.md +175 -0
- package/presets/zcode/mcp-ts/ai-local/conventions.md +22 -0
- package/presets/zcode/mcp-ts/commands/README.md +11 -0
- package/presets/zcode/mcp-ts/commands/migrate-tasks.md +44 -0
- package/presets/zcode/mcp-ts/commands/spec-start.md +32 -0
- package/presets/zcode/mcp-ts/commands/task-continue.md +73 -0
- package/presets/zcode/mcp-ts/commands/task.md +74 -0
- package/presets/zcode/mcp-ts/commands/technical-retro.md +96 -0
- package/presets/zcode/mcp-ts/commands/update.md +43 -0
- package/presets/zcode/mcp-ts/hooks/README.md +31 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +2710 -0
- package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/mcp-ts/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/mcp-ts/mcp.json +11 -0
- package/presets/zcode/mcp-ts/rules/README.md +25 -0
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +19 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/mcp-ts/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/mcp-ts/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/mcp-ts/rules/anti-sycophancy-discipline.md +27 -0
- package/presets/zcode/mcp-ts/rules/code-quality-and-refactoring.md +78 -0
- package/presets/zcode/mcp-ts/rules/code-review-mr.md +76 -0
- package/presets/zcode/mcp-ts/rules/design-guidance.md +104 -0
- package/presets/zcode/mcp-ts/rules/feature-delivery-workflow.md +59 -0
- package/presets/zcode/mcp-ts/rules/interactive-questions.md +29 -0
- package/presets/zcode/mcp-ts/rules/language-policy.md +51 -0
- package/presets/zcode/mcp-ts/rules/mcp-auth-secrets.md +35 -0
- package/presets/zcode/mcp-ts/rules/mcp-contract-testing.md +32 -0
- package/presets/zcode/mcp-ts/rules/mcp-server-boundaries.md +24 -0
- package/presets/zcode/mcp-ts/rules/mcp-tool-design.md +29 -0
- package/presets/zcode/mcp-ts/rules/mcp-transport-packaging.md +34 -0
- package/presets/zcode/mcp-ts/rules/mcp-ts-anti-hallucination.md +27 -0
- package/presets/zcode/mcp-ts/rules/mcp-ts-app-core.md +27 -0
- package/presets/zcode/mcp-ts/rules/mcp-ts-conventions.md +22 -0
- package/presets/zcode/mcp-ts/rules/mcp-ts-tooling.md +21 -0
- package/presets/zcode/mcp-ts/rules/mcp-usage.md +93 -0
- package/presets/zcode/mcp-ts/rules/post-change-test.md +21 -0
- package/presets/zcode/mcp-ts/rules/preset-goals.md +31 -0
- package/presets/zcode/mcp-ts/rules/preset-layering.md +27 -0
- package/presets/zcode/mcp-ts/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/mcp-ts/rules/preset-token-budget.md +38 -0
- package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/mcp-ts/rules/preset-writing-style.md +42 -0
- package/presets/zcode/mcp-ts/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/mcp-ts/rules/product-specs.md +62 -0
- package/presets/zcode/mcp-ts/rules/reference-features.md +45 -0
- package/presets/zcode/mcp-ts/rules/security-mcp.md +43 -0
- package/presets/zcode/mcp-ts/rules/technical-retro.md +13 -0
- package/presets/zcode/mcp-ts/rules/tests-unit.md +23 -0
- package/presets/zcode/mcp-ts/skills/README.md +14 -0
- package/presets/zcode/mcp-ts/skills/code-review/SKILL.md +31 -0
- package/presets/zcode/mcp-ts/skills/debug-investigation/SKILL.md +51 -0
- package/presets/zcode/mcp-ts/skills/feature-delivery/SKILL.md +42 -0
- package/presets/zcode/mcp-ts/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/mcp-ts/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/mcp-ts/skills/unit-testing/SKILL.md +22 -0
- package/presets/zcode/mcp-ts/team/README.md +123 -0
- package/presets/zcode/mcp-ts/team/fixtures/bugfix-standard.json +32 -0
- package/presets/zcode/mcp-ts/team/fixtures/feature-full.json +36 -0
- package/presets/zcode/mcp-ts/team/fixtures/feature-light.json +34 -0
- package/presets/zcode/mcp-ts/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/mol/MCP.md +50 -0
- package/presets/zcode/mol/README.md +20 -0
- package/presets/zcode/mol/REPO_AGENTS.md +107 -0
- package/presets/zcode/mol/adapter-map.json +1122 -0
- package/presets/zcode/mol/agents/README.md +98 -0
- package/presets/zcode/mol/agents/accessibility-reviewer.md +92 -0
- package/presets/zcode/mol/agents/api-contract-reviewer.md +87 -0
- package/presets/zcode/mol/agents/build-verifier.md +117 -0
- package/presets/zcode/mol/agents/ci-investigator.md +95 -0
- package/presets/zcode/mol/agents/code-reviewer.md +139 -0
- package/presets/zcode/mol/agents/codebase-analyzer.md +51 -0
- package/presets/zcode/mol/agents/debugger.md +126 -0
- package/presets/zcode/mol/agents/feature-developer.md +151 -0
- package/presets/zcode/mol/agents/migration-specialist.md +97 -0
- package/presets/zcode/mol/agents/mockup-reviewer.md +131 -0
- package/presets/zcode/mol/agents/openspec-author.md +213 -0
- package/presets/zcode/mol/agents/performance-auditor.md +98 -0
- package/presets/zcode/mol/agents/playwright-test-generator.md +56 -0
- package/presets/zcode/mol/agents/playwright-test-healer.md +57 -0
- package/presets/zcode/mol/agents/playwright-test-planner.md +51 -0
- package/presets/zcode/mol/agents/qa-tester.md +80 -0
- package/presets/zcode/mol/agents/security-reviewer.md +89 -0
- package/presets/zcode/mol/agents/solution-architect.md +99 -0
- package/presets/zcode/mol/agents/task-analyst.md +255 -0
- package/presets/zcode/mol/agents/task-router.md +267 -0
- package/presets/zcode/mol/agents/tech-writer.md +88 -0
- package/presets/zcode/mol/agents/unit-test-generator.md +59 -0
- package/presets/zcode/mol/agents/unit-test-healer.md +60 -0
- package/presets/zcode/mol/agents/unit-test-planner.md +84 -0
- package/presets/zcode/mol/ai-local/conventions.md +49 -0
- package/presets/zcode/mol/ai-local/rules/task-levels.md +40 -0
- package/presets/zcode/mol/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/zcode/mol/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/zcode/mol/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/zcode/mol/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/zcode/mol/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/zcode/mol/ai-local/rules-library/code-style.md +68 -0
- package/presets/zcode/mol/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/zcode/mol/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/zcode/mol/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/zcode/mol/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/zcode/mol/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/zcode/mol/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/zcode/mol/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/zcode/mol/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/zcode/mol/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/zcode/mol/ai-local/rules-library/router-pages.md +25 -0
- package/presets/zcode/mol/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/zcode/mol/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/zcode/mol/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/zcode/mol/commands/README.md +56 -0
- package/presets/zcode/mol/commands/migrate-tasks.md +44 -0
- package/presets/zcode/mol/commands/spec-start.md +32 -0
- package/presets/zcode/mol/commands/task-continue.md +75 -0
- package/presets/zcode/mol/commands/task-evil.md +90 -0
- package/presets/zcode/mol/commands/task.md +79 -0
- package/presets/zcode/mol/commands/technical-retro.md +96 -0
- package/presets/zcode/mol/commands/update.md +43 -0
- package/presets/zcode/mol/hooks/README.md +31 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +2765 -0
- package/presets/zcode/mol/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/mol/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/mol/mcp.json +19 -0
- package/presets/zcode/mol/rules/README.md +25 -0
- package/presets/zcode/mol/rules/agent-team-intake.md +14 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/mol/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/mol/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/mol/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/mol/rules/code-quality-and-refactoring.md +76 -0
- package/presets/zcode/mol/rules/code-review-mr.md +95 -0
- package/presets/zcode/mol/rules/design-guidance.md +104 -0
- package/presets/zcode/mol/rules/feature-delivery-workflow.md +144 -0
- package/presets/zcode/mol/rules/interactive-questions.md +29 -0
- package/presets/zcode/mol/rules/language-policy.md +51 -0
- package/presets/zcode/mol/rules/mcp-usage.md +96 -0
- package/presets/zcode/mol/rules/mol-app-core.md +29 -0
- package/presets/zcode/mol/rules/mol-build.md +19 -0
- package/presets/zcode/mol/rules/mol-components.md +31 -0
- package/presets/zcode/mol/rules/mol-reactivity.md +21 -0
- package/presets/zcode/mol/rules/mol-state.md +22 -0
- package/presets/zcode/mol/rules/mol-testing.md +28 -0
- package/presets/zcode/mol/rules/mol-theming.md +22 -0
- package/presets/zcode/mol/rules/mol-view-tree.md +27 -0
- package/presets/zcode/mol/rules/package-manager.md +7 -0
- package/presets/zcode/mol/rules/preset-goals.md +31 -0
- package/presets/zcode/mol/rules/preset-layering.md +27 -0
- package/presets/zcode/mol/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/mol/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/mol/rules/preset-token-budget.md +38 -0
- package/presets/zcode/mol/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/mol/rules/preset-writing-style.md +42 -0
- package/presets/zcode/mol/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/mol/rules/product-specs.md +61 -0
- package/presets/zcode/mol/rules/reference-features.md +82 -0
- package/presets/zcode/mol/rules/technical-retro.md +13 -0
- package/presets/zcode/mol/skills/README.md +17 -0
- package/presets/zcode/mol/skills/ci-investigation/SKILL.md +49 -0
- package/presets/zcode/mol/skills/code-review/SKILL.md +60 -0
- package/presets/zcode/mol/skills/debug-investigation/SKILL.md +63 -0
- package/presets/zcode/mol/skills/feature-delivery/SKILL.md +44 -0
- package/presets/zcode/mol/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/mol/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/mol/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/mol/skills/unit-testing/SKILL.md +38 -0
- package/presets/zcode/mol/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/mol/team/README.md +135 -0
- package/presets/zcode/mol/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/zcode/mol/team/fixtures/bugfix-standard.json +25 -0
- package/presets/zcode/mol/team/fixtures/feature-full.json +29 -0
- package/presets/zcode/mol/team/fixtures/feature-light.json +28 -0
- package/presets/zcode/mol/team/fixtures/feature-parallel.json +84 -0
- package/presets/zcode/mol/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/zcode/mol/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/zcode/mol/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/zcode/mol/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/mol/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/zcode/mol/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/zcode/mol/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/zcode/mol/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/zcode/mol/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/zcode/mol/team/fixtures/metrics.example.json +54 -0
- package/presets/zcode/mol/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/mol/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/zcode/mol/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/zcode/mol/team/tasks/.gitkeep +0 -0
- package/presets/zcode/next/MCP.md +50 -0
- package/presets/zcode/next/README.md +20 -0
- package/presets/zcode/next/REPO_AGENTS.md +110 -0
- package/presets/zcode/next/adapter-map.json +1347 -0
- package/presets/zcode/next/agents/README.md +98 -0
- package/presets/zcode/next/agents/accessibility-reviewer.md +92 -0
- package/presets/zcode/next/agents/api-contract-reviewer.md +89 -0
- package/presets/zcode/next/agents/build-verifier.md +119 -0
- package/presets/zcode/next/agents/ci-investigator.md +109 -0
- package/presets/zcode/next/agents/code-reviewer.md +141 -0
- package/presets/zcode/next/agents/codebase-analyzer.md +51 -0
- package/presets/zcode/next/agents/debugger.md +140 -0
- package/presets/zcode/next/agents/feature-developer.md +188 -0
- package/presets/zcode/next/agents/migration-specialist.md +97 -0
- package/presets/zcode/next/agents/mockup-reviewer.md +131 -0
- package/presets/zcode/next/agents/openspec-author.md +213 -0
- package/presets/zcode/next/agents/performance-auditor.md +98 -0
- package/presets/zcode/next/agents/playwright-test-generator.md +60 -0
- package/presets/zcode/next/agents/playwright-test-healer.md +61 -0
- package/presets/zcode/next/agents/playwright-test-planner.md +55 -0
- package/presets/zcode/next/agents/qa-tester.md +85 -0
- package/presets/zcode/next/agents/security-reviewer.md +89 -0
- package/presets/zcode/next/agents/solution-architect.md +99 -0
- package/presets/zcode/next/agents/task-analyst.md +272 -0
- package/presets/zcode/next/agents/task-router.md +267 -0
- package/presets/zcode/next/agents/tech-writer.md +88 -0
- package/presets/zcode/next/agents/unit-test-generator.md +62 -0
- package/presets/zcode/next/agents/unit-test-healer.md +63 -0
- package/presets/zcode/next/agents/unit-test-planner.md +87 -0
- package/presets/zcode/next/ai-local/conventions.md +49 -0
- package/presets/zcode/next/ai-local/rules/task-levels.md +40 -0
- package/presets/zcode/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +71 -0
- package/presets/zcode/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
- package/presets/zcode/next/ai-local/rules-library/analytics-events.md +18 -0
- package/presets/zcode/next/ai-local/rules-library/api-contract-source.md +14 -0
- package/presets/zcode/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
- package/presets/zcode/next/ai-local/rules-library/code-style.md +68 -0
- package/presets/zcode/next/ai-local/rules-library/commit-hygiene.md +17 -0
- package/presets/zcode/next/ai-local/rules-library/component-child-decomposition.md +81 -0
- package/presets/zcode/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
- package/presets/zcode/next/ai-local/rules-library/mcp-required-for-ui-layout.md +45 -0
- package/presets/zcode/next/ai-local/rules-library/no-react-fc.md +46 -0
- package/presets/zcode/next/ai-local/rules-library/no-test-driven-behavior-change.md +14 -0
- package/presets/zcode/next/ai-local/rules-library/pre-pr-checklist.md +16 -0
- package/presets/zcode/next/ai-local/rules-library/pwa-service-worker.md +15 -0
- package/presets/zcode/next/ai-local/rules-library/qa-test-cases.md +14 -0
- package/presets/zcode/next/ai-local/rules-library/router-pages.md +25 -0
- package/presets/zcode/next/ai-local/rules-library/single-source-copy-constants.md +18 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-dev-compare-figma.md +71 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-modals.md +64 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
- package/presets/zcode/next/ai-local/rules-library/ui-change-review-gate.md +15 -0
- package/presets/zcode/next/commands/README.md +56 -0
- package/presets/zcode/next/commands/migrate-tasks.md +44 -0
- package/presets/zcode/next/commands/spec-start.md +32 -0
- package/presets/zcode/next/commands/task-continue.md +75 -0
- package/presets/zcode/next/commands/task-evil.md +90 -0
- package/presets/zcode/next/commands/task.md +79 -0
- package/presets/zcode/next/commands/technical-retro.md +96 -0
- package/presets/zcode/next/commands/update.md +43 -0
- package/presets/zcode/next/hooks/README.md +31 -0
- package/presets/zcode/next/hooks/chain-team-phases.sh +2766 -0
- package/presets/zcode/next/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/next/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/next/mcp.json +19 -0
- package/presets/zcode/next/rules/README.md +25 -0
- package/presets/zcode/next/rules/agent-team-intake.md +14 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/next/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/next/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/next/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/next/rules/api-services.md +74 -0
- package/presets/zcode/next/rules/architecture-boundaries-ui.md +9 -0
- package/presets/zcode/next/rules/architecture-boundaries.md +86 -0
- package/presets/zcode/next/rules/arrow-functions.md +25 -0
- package/presets/zcode/next/rules/code-quality-and-refactoring.md +76 -0
- package/presets/zcode/next/rules/code-review-mr.md +95 -0
- package/presets/zcode/next/rules/component-catalog-gate.md +44 -0
- package/presets/zcode/next/rules/css-property-order-stylelint.md +13 -0
- package/presets/zcode/next/rules/design-guidance.md +104 -0
- package/presets/zcode/next/rules/design-tokens-binding.md +44 -0
- package/presets/zcode/next/rules/feature-delivery-workflow.md +166 -0
- package/presets/zcode/next/rules/forms-validation.md +38 -0
- package/presets/zcode/next/rules/http-client.md +55 -0
- package/presets/zcode/next/rules/interactive-questions.md +29 -0
- package/presets/zcode/next/rules/language-policy.md +51 -0
- package/presets/zcode/next/rules/layer-barrel-exports.md +68 -0
- package/presets/zcode/next/rules/mcp-usage.md +96 -0
- package/presets/zcode/next/rules/mockup-review.md +195 -0
- package/presets/zcode/next/rules/navigation-router-stack.md +68 -0
- package/presets/zcode/next/rules/navigation-router-ui.md +10 -0
- package/presets/zcode/next/rules/next-app-core.md +38 -0
- package/presets/zcode/next/rules/next-app-router.md +58 -0
- package/presets/zcode/next/rules/next-static-export.md +44 -0
- package/presets/zcode/next/rules/no-props-spread.md +31 -0
- package/presets/zcode/next/rules/no-type-assertion-as-import-export.md +51 -0
- package/presets/zcode/next/rules/package-manager.md +11 -0
- package/presets/zcode/next/rules/playwright-agents.md +67 -0
- package/presets/zcode/next/rules/post-change-lint.md +39 -0
- package/presets/zcode/next/rules/preset-goals.md +31 -0
- package/presets/zcode/next/rules/preset-layering.md +27 -0
- package/presets/zcode/next/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/next/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/next/rules/preset-token-budget.md +38 -0
- package/presets/zcode/next/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/next/rules/preset-writing-style.md +42 -0
- package/presets/zcode/next/rules/product-specs-authoring.md +119 -0
- package/presets/zcode/next/rules/product-specs.md +63 -0
- package/presets/zcode/next/rules/public-imports.md +50 -0
- package/presets/zcode/next/rules/react-a11y-coding.md +32 -0
- package/presets/zcode/next/rules/react-next-anti-hallucination.md +75 -0
- package/presets/zcode/next/rules/react-ui.md +154 -0
- package/presets/zcode/next/rules/reference-features.md +86 -0
- package/presets/zcode/next/rules/security-next.md +91 -0
- package/presets/zcode/next/rules/store-rtk.md +85 -0
- package/presets/zcode/next/rules/technical-retro.md +13 -0
- package/presets/zcode/next/rules/tests-e2e-structure.md +87 -0
- package/presets/zcode/next/rules/tests-unit.md +105 -0
- package/presets/zcode/next/rules/types-jsdoc.md +40 -0
- package/presets/zcode/next/rules/ux-design.md +103 -0
- package/presets/zcode/next/skills/README.md +22 -0
- package/presets/zcode/next/skills/ci-investigation/SKILL.md +50 -0
- package/presets/zcode/next/skills/code-review/SKILL.md +61 -0
- package/presets/zcode/next/skills/debug-investigation/SKILL.md +64 -0
- package/presets/zcode/next/skills/feature-delivery/SKILL.md +45 -0
- package/presets/zcode/next/skills/figma-fidelity/SKILL.md +128 -0
- package/presets/zcode/next/skills/mockup-review/SKILL.md +40 -0
- package/presets/zcode/next/skills/playwright-e2e/SKILL.md +39 -0
- package/presets/zcode/next/skills/react-performance/SKILL.md +49 -0
- package/presets/zcode/next/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/next/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/next/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/next/skills/unit-testing/SKILL.md +40 -0
- package/presets/zcode/next/skills/ux-design/SKILL.md +41 -0
- package/presets/zcode/next/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/next/team/README.md +135 -0
- package/presets/zcode/next/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/zcode/next/team/fixtures/bugfix-standard.json +25 -0
- package/presets/zcode/next/team/fixtures/feature-full.json +29 -0
- package/presets/zcode/next/team/fixtures/feature-light.json +28 -0
- package/presets/zcode/next/team/fixtures/feature-parallel.json +84 -0
- package/presets/zcode/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/zcode/next/team/fixtures/feature-with-figma-url.json +27 -0
- package/presets/zcode/next/team/fixtures/feature-with-ux-no-figma.json +26 -0
- package/presets/zcode/next/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/zcode/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/zcode/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/zcode/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/zcode/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/zcode/next/team/fixtures/metrics.example.json +54 -0
- package/presets/zcode/next/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/next/team/fixtures/mockup-review-standalone.json +23 -0
- package/presets/zcode/next/team/fixtures/ux-design-standalone.json +24 -0
- package/presets/zcode/next/team/tasks/.gitkeep +0 -0
- package/presets/zcode/nuxt/MCP.md +36 -0
- package/presets/zcode/nuxt/README.md +20 -0
- package/presets/zcode/nuxt/REPO_AGENTS.md +101 -0
- package/presets/zcode/nuxt/adapter-map.json +1065 -0
- package/presets/zcode/nuxt/agents/README.md +107 -0
- package/presets/zcode/nuxt/agents/accessibility-reviewer.md +91 -0
- package/presets/zcode/nuxt/agents/api-contract-reviewer.md +89 -0
- package/presets/zcode/nuxt/agents/build-verifier.md +106 -0
- package/presets/zcode/nuxt/agents/ci-investigator.md +109 -0
- package/presets/zcode/nuxt/agents/code-reviewer.md +124 -0
- package/presets/zcode/nuxt/agents/codebase-analyzer.md +51 -0
- package/presets/zcode/nuxt/agents/debugger.md +140 -0
- package/presets/zcode/nuxt/agents/feature-developer.md +161 -0
- package/presets/zcode/nuxt/agents/migration-specialist.md +97 -0
- package/presets/zcode/nuxt/agents/mockup-reviewer.md +83 -0
- package/presets/zcode/nuxt/agents/openspec-author.md +187 -0
- package/presets/zcode/nuxt/agents/performance-auditor.md +98 -0
- package/presets/zcode/nuxt/agents/playwright-test-generator.md +60 -0
- package/presets/zcode/nuxt/agents/playwright-test-healer.md +60 -0
- package/presets/zcode/nuxt/agents/playwright-test-planner.md +55 -0
- package/presets/zcode/nuxt/agents/qa-tester.md +85 -0
- package/presets/zcode/nuxt/agents/security-reviewer.md +84 -0
- package/presets/zcode/nuxt/agents/solution-architect.md +98 -0
- package/presets/zcode/nuxt/agents/task-analyst.md +239 -0
- package/presets/zcode/nuxt/agents/task-router.md +226 -0
- package/presets/zcode/nuxt/agents/tech-writer.md +87 -0
- package/presets/zcode/nuxt/agents/unit-test-generator.md +62 -0
- package/presets/zcode/nuxt/agents/unit-test-healer.md +63 -0
- package/presets/zcode/nuxt/agents/unit-test-planner.md +87 -0
- package/presets/zcode/nuxt/ai-local/conventions.md +29 -0
- package/presets/zcode/nuxt/commands/README.md +51 -0
- package/presets/zcode/nuxt/commands/migrate-tasks.md +44 -0
- package/presets/zcode/nuxt/commands/spec-start.md +32 -0
- package/presets/zcode/nuxt/commands/task-continue.md +75 -0
- package/presets/zcode/nuxt/commands/task.md +76 -0
- package/presets/zcode/nuxt/commands/technical-retro.md +96 -0
- package/presets/zcode/nuxt/commands/update.md +43 -0
- package/presets/zcode/nuxt/hooks/README.md +31 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +2766 -0
- package/presets/zcode/nuxt/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/nuxt/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/nuxt/mcp.json +19 -0
- package/presets/zcode/nuxt/rules/README.md +25 -0
- package/presets/zcode/nuxt/rules/agent-team-intake.md +14 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/nuxt/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/nuxt/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/nuxt/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/nuxt/rules/api-services.md +72 -0
- package/presets/zcode/nuxt/rules/architecture-boundaries-ui.md +9 -0
- package/presets/zcode/nuxt/rules/architecture-boundaries.md +90 -0
- package/presets/zcode/nuxt/rules/code-quality-and-refactoring.md +76 -0
- package/presets/zcode/nuxt/rules/code-review-mr.md +84 -0
- package/presets/zcode/nuxt/rules/css-property-order-stylelint.md +14 -0
- package/presets/zcode/nuxt/rules/design-guidance.md +104 -0
- package/presets/zcode/nuxt/rules/feature-delivery-workflow.md +145 -0
- package/presets/zcode/nuxt/rules/http-client.md +9 -0
- package/presets/zcode/nuxt/rules/interactive-questions.md +29 -0
- package/presets/zcode/nuxt/rules/language-policy.md +51 -0
- package/presets/zcode/nuxt/rules/layer-barrel-exports.md +67 -0
- package/presets/zcode/nuxt/rules/mcp-usage.md +95 -0
- package/presets/zcode/nuxt/rules/mockup-review.md +171 -0
- package/presets/zcode/nuxt/rules/navigation-router-stack.md +55 -0
- package/presets/zcode/nuxt/rules/navigation-router-ui.md +10 -0
- package/presets/zcode/nuxt/rules/no-type-assertion-as-import-export.md +51 -0
- package/presets/zcode/nuxt/rules/no-v-bind-spread.md +7 -0
- package/presets/zcode/nuxt/rules/nuxt-app-core.md +44 -0
- package/presets/zcode/nuxt/rules/nuxt-pages-routing.md +31 -0
- package/presets/zcode/nuxt/rules/package-manager.md +13 -0
- package/presets/zcode/nuxt/rules/playwright-agents.md +74 -0
- package/presets/zcode/nuxt/rules/post-change-lint.md +37 -0
- package/presets/zcode/nuxt/rules/preset-goals.md +31 -0
- package/presets/zcode/nuxt/rules/preset-layering.md +27 -0
- package/presets/zcode/nuxt/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/nuxt/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/nuxt/rules/preset-token-budget.md +38 -0
- package/presets/zcode/nuxt/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/nuxt/rules/preset-writing-style.md +42 -0
- package/presets/zcode/nuxt/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/nuxt/rules/product-specs.md +61 -0
- package/presets/zcode/nuxt/rules/public-imports.md +50 -0
- package/presets/zcode/nuxt/rules/reference-features.md +81 -0
- package/presets/zcode/nuxt/rules/script-setup-conventions.md +7 -0
- package/presets/zcode/nuxt/rules/security-nuxt.md +28 -0
- package/presets/zcode/nuxt/rules/store-pinia.md +61 -0
- package/presets/zcode/nuxt/rules/technical-retro.md +13 -0
- package/presets/zcode/nuxt/rules/tests-e2e-structure.md +87 -0
- package/presets/zcode/nuxt/rules/tests-unit.md +82 -0
- package/presets/zcode/nuxt/rules/types-jsdoc.md +40 -0
- package/presets/zcode/nuxt/rules/ux-design.md +103 -0
- package/presets/zcode/nuxt/rules/vue-a11y-coding.md +9 -0
- package/presets/zcode/nuxt/rules/vue-nuxt-anti-hallucination.md +65 -0
- package/presets/zcode/nuxt/rules/vue-ui.md +34 -0
- package/presets/zcode/nuxt/skills/README.md +21 -0
- package/presets/zcode/nuxt/skills/ci-investigation/SKILL.md +50 -0
- package/presets/zcode/nuxt/skills/code-review/SKILL.md +60 -0
- package/presets/zcode/nuxt/skills/debug-investigation/SKILL.md +64 -0
- package/presets/zcode/nuxt/skills/feature-delivery/SKILL.md +52 -0
- package/presets/zcode/nuxt/skills/mockup-review/SKILL.md +34 -0
- package/presets/zcode/nuxt/skills/playwright-e2e/SKILL.md +43 -0
- package/presets/zcode/nuxt/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/nuxt/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/nuxt/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/nuxt/skills/unit-testing/SKILL.md +38 -0
- package/presets/zcode/nuxt/skills/ux-design/SKILL.md +41 -0
- package/presets/zcode/nuxt/skills/vue-performance/SKILL.md +58 -0
- package/presets/zcode/nuxt/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/nuxt/team/README.md +123 -0
- package/presets/zcode/nuxt/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/zcode/nuxt/team/fixtures/bugfix-standard.json +25 -0
- package/presets/zcode/nuxt/team/fixtures/feature-full.json +62 -0
- package/presets/zcode/nuxt/team/fixtures/feature-light.json +27 -0
- package/presets/zcode/nuxt/team/fixtures/feature-with-figma-url.json +17 -0
- package/presets/zcode/nuxt/team/fixtures/feature-with-ux-no-figma.json +17 -0
- package/presets/zcode/nuxt/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/nuxt/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/zcode/nuxt/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/zcode/nuxt/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/zcode/nuxt/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/zcode/nuxt/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/zcode/nuxt/team/fixtures/metrics.example.json +54 -0
- package/presets/zcode/nuxt/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/nuxt/team/fixtures/mockup-review-standalone.json +14 -0
- package/presets/zcode/nuxt/team/fixtures/ux-design-standalone.json +15 -0
- package/presets/zcode/nuxt/team/tasks/.gitkeep +0 -0
- package/presets/zcode/php-hexagonal/MCP.md +34 -0
- package/presets/zcode/php-hexagonal/README.md +20 -0
- package/presets/zcode/php-hexagonal/REPO_AGENTS.md +99 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +864 -0
- package/presets/zcode/php-hexagonal/agents/README.md +55 -0
- package/presets/zcode/php-hexagonal/agents/api-contract-reviewer.md +47 -0
- package/presets/zcode/php-hexagonal/agents/build-verifier.md +72 -0
- package/presets/zcode/php-hexagonal/agents/ci-investigator.md +66 -0
- package/presets/zcode/php-hexagonal/agents/code-reviewer.md +128 -0
- package/presets/zcode/php-hexagonal/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/php-hexagonal/agents/debugger.md +98 -0
- package/presets/zcode/php-hexagonal/agents/feature-developer.md +144 -0
- package/presets/zcode/php-hexagonal/agents/integration-test-generator.md +46 -0
- package/presets/zcode/php-hexagonal/agents/integration-test-healer.md +46 -0
- package/presets/zcode/php-hexagonal/agents/integration-test-planner.md +48 -0
- package/presets/zcode/php-hexagonal/agents/migration-specialist.md +59 -0
- package/presets/zcode/php-hexagonal/agents/openspec-author.md +185 -0
- package/presets/zcode/php-hexagonal/agents/performance-auditor.md +50 -0
- package/presets/zcode/php-hexagonal/agents/qa-tester.md +53 -0
- package/presets/zcode/php-hexagonal/agents/security-reviewer.md +42 -0
- package/presets/zcode/php-hexagonal/agents/solution-architect.md +56 -0
- package/presets/zcode/php-hexagonal/agents/task-analyst.md +131 -0
- package/presets/zcode/php-hexagonal/agents/task-router.md +179 -0
- package/presets/zcode/php-hexagonal/agents/tech-writer.md +45 -0
- package/presets/zcode/php-hexagonal/agents/unit-test-generator.md +44 -0
- package/presets/zcode/php-hexagonal/agents/unit-test-healer.md +36 -0
- package/presets/zcode/php-hexagonal/agents/unit-test-planner.md +51 -0
- package/presets/zcode/php-hexagonal/ai-local/conventions.md +29 -0
- package/presets/zcode/php-hexagonal/commands/README.md +54 -0
- package/presets/zcode/php-hexagonal/commands/migrate-tasks.md +44 -0
- package/presets/zcode/php-hexagonal/commands/spec-start.md +32 -0
- package/presets/zcode/php-hexagonal/commands/task-continue.md +73 -0
- package/presets/zcode/php-hexagonal/commands/task.md +74 -0
- package/presets/zcode/php-hexagonal/commands/technical-retro.md +96 -0
- package/presets/zcode/php-hexagonal/commands/update.md +43 -0
- package/presets/zcode/php-hexagonal/hooks/README.md +31 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +2764 -0
- package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/php-hexagonal/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/php-hexagonal/mcp.json +11 -0
- package/presets/zcode/php-hexagonal/rules/README.md +25 -0
- package/presets/zcode/php-hexagonal/rules/adapters-driven.md +30 -0
- package/presets/zcode/php-hexagonal/rules/adapters-driving.md +30 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +18 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/php-hexagonal/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/php-hexagonal/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/php-hexagonal/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/php-hexagonal/rules/api-grpc.md +22 -0
- package/presets/zcode/php-hexagonal/rules/api-http.md +28 -0
- package/presets/zcode/php-hexagonal/rules/application-usecases.md +25 -0
- package/presets/zcode/php-hexagonal/rules/architecture-boundaries.md +31 -0
- package/presets/zcode/php-hexagonal/rules/code-quality-and-refactoring.md +78 -0
- package/presets/zcode/php-hexagonal/rules/code-review-mr.md +79 -0
- package/presets/zcode/php-hexagonal/rules/composition-root.md +27 -0
- package/presets/zcode/php-hexagonal/rules/design-guidance.md +105 -0
- package/presets/zcode/php-hexagonal/rules/domain-layer.md +31 -0
- package/presets/zcode/php-hexagonal/rules/feature-delivery-workflow.md +59 -0
- package/presets/zcode/php-hexagonal/rules/interactive-questions.md +29 -0
- package/presets/zcode/php-hexagonal/rules/language-policy.md +51 -0
- package/presets/zcode/php-hexagonal/rules/mcp-usage.md +92 -0
- package/presets/zcode/php-hexagonal/rules/messaging-adapters.md +29 -0
- package/presets/zcode/php-hexagonal/rules/module-public-api.md +24 -0
- package/presets/zcode/php-hexagonal/rules/persistence-adapters.md +25 -0
- package/presets/zcode/php-hexagonal/rules/php-app-core.md +36 -0
- package/presets/zcode/php-hexagonal/rules/php-conventions.md +47 -0
- package/presets/zcode/php-hexagonal/rules/php-hexagonal-anti-hallucination.md +27 -0
- package/presets/zcode/php-hexagonal/rules/php-tooling.md +26 -0
- package/presets/zcode/php-hexagonal/rules/ports-interfaces.md +27 -0
- package/presets/zcode/php-hexagonal/rules/post-change-test.md +20 -0
- package/presets/zcode/php-hexagonal/rules/preset-goals.md +31 -0
- package/presets/zcode/php-hexagonal/rules/preset-layering.md +27 -0
- package/presets/zcode/php-hexagonal/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/php-hexagonal/rules/preset-token-budget.md +38 -0
- package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/php-hexagonal/rules/preset-writing-style.md +42 -0
- package/presets/zcode/php-hexagonal/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/php-hexagonal/rules/product-specs.md +62 -0
- package/presets/zcode/php-hexagonal/rules/reference-features.md +45 -0
- package/presets/zcode/php-hexagonal/rules/security-php.md +21 -0
- package/presets/zcode/php-hexagonal/rules/technical-retro.md +13 -0
- package/presets/zcode/php-hexagonal/rules/tests-e2e.md +26 -0
- package/presets/zcode/php-hexagonal/rules/tests-integration.md +23 -0
- package/presets/zcode/php-hexagonal/rules/tests-unit.md +25 -0
- package/presets/zcode/php-hexagonal/skills/README.md +5 -0
- package/presets/zcode/php-hexagonal/skills/ci-investigation/SKILL.md +24 -0
- package/presets/zcode/php-hexagonal/skills/code-review/SKILL.md +47 -0
- package/presets/zcode/php-hexagonal/skills/debug-investigation/SKILL.md +55 -0
- package/presets/zcode/php-hexagonal/skills/feature-delivery/SKILL.md +43 -0
- package/presets/zcode/php-hexagonal/skills/integration-testing/SKILL.md +21 -0
- package/presets/zcode/php-hexagonal/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/php-hexagonal/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/php-hexagonal/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/php-hexagonal/skills/unit-testing/SKILL.md +20 -0
- package/presets/zcode/php-hexagonal/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/php-hexagonal/team/README.md +123 -0
- package/presets/zcode/php-hexagonal/team/fixtures/bugfix-standard.json +37 -0
- package/presets/zcode/php-hexagonal/team/fixtures/feature-full.json +61 -0
- package/presets/zcode/php-hexagonal/team/fixtures/feature-light.json +17 -0
- package/presets/zcode/php-hexagonal/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/php-laravel/MCP.md +26 -0
- package/presets/zcode/php-laravel/README.md +20 -0
- package/presets/zcode/php-laravel/REPO_AGENTS.md +100 -0
- package/presets/zcode/php-laravel/adapter-map.json +864 -0
- package/presets/zcode/php-laravel/agents/README.md +55 -0
- package/presets/zcode/php-laravel/agents/api-contract-reviewer.md +48 -0
- package/presets/zcode/php-laravel/agents/build-verifier.md +72 -0
- package/presets/zcode/php-laravel/agents/ci-investigator.md +66 -0
- package/presets/zcode/php-laravel/agents/code-reviewer.md +128 -0
- package/presets/zcode/php-laravel/agents/codebase-analyzer.md +49 -0
- package/presets/zcode/php-laravel/agents/debugger.md +98 -0
- package/presets/zcode/php-laravel/agents/feature-developer.md +144 -0
- package/presets/zcode/php-laravel/agents/integration-test-generator.md +46 -0
- package/presets/zcode/php-laravel/agents/integration-test-healer.md +46 -0
- package/presets/zcode/php-laravel/agents/integration-test-planner.md +48 -0
- package/presets/zcode/php-laravel/agents/migration-specialist.md +59 -0
- package/presets/zcode/php-laravel/agents/openspec-author.md +185 -0
- package/presets/zcode/php-laravel/agents/performance-auditor.md +50 -0
- package/presets/zcode/php-laravel/agents/qa-tester.md +59 -0
- package/presets/zcode/php-laravel/agents/security-reviewer.md +54 -0
- package/presets/zcode/php-laravel/agents/solution-architect.md +57 -0
- package/presets/zcode/php-laravel/agents/task-analyst.md +131 -0
- package/presets/zcode/php-laravel/agents/task-router.md +195 -0
- package/presets/zcode/php-laravel/agents/tech-writer.md +45 -0
- package/presets/zcode/php-laravel/agents/unit-test-generator.md +44 -0
- package/presets/zcode/php-laravel/agents/unit-test-healer.md +36 -0
- package/presets/zcode/php-laravel/agents/unit-test-planner.md +51 -0
- package/presets/zcode/php-laravel/ai-local/conventions.md +29 -0
- package/presets/zcode/php-laravel/commands/README.md +54 -0
- package/presets/zcode/php-laravel/commands/migrate-tasks.md +44 -0
- package/presets/zcode/php-laravel/commands/spec-start.md +32 -0
- package/presets/zcode/php-laravel/commands/task-continue.md +73 -0
- package/presets/zcode/php-laravel/commands/task.md +74 -0
- package/presets/zcode/php-laravel/commands/technical-retro.md +96 -0
- package/presets/zcode/php-laravel/commands/update.md +43 -0
- package/presets/zcode/php-laravel/hooks/README.md +31 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +2764 -0
- package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/php-laravel/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/php-laravel/mcp.json +11 -0
- package/presets/zcode/php-laravel/rules/README.md +25 -0
- package/presets/zcode/php-laravel/rules/actions-services.md +25 -0
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +18 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/php-laravel/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/php-laravel/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/php-laravel/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/php-laravel/rules/architecture-boundaries.md +32 -0
- package/presets/zcode/php-laravel/rules/code-quality-and-refactoring.md +78 -0
- package/presets/zcode/php-laravel/rules/code-review-mr.md +80 -0
- package/presets/zcode/php-laravel/rules/design-guidance.md +105 -0
- package/presets/zcode/php-laravel/rules/domain-layer.md +19 -0
- package/presets/zcode/php-laravel/rules/eloquent-persistence.md +24 -0
- package/presets/zcode/php-laravel/rules/events-listeners.md +24 -0
- package/presets/zcode/php-laravel/rules/feature-delivery-workflow.md +59 -0
- package/presets/zcode/php-laravel/rules/form-requests.md +24 -0
- package/presets/zcode/php-laravel/rules/http-layer.md +25 -0
- package/presets/zcode/php-laravel/rules/interactive-questions.md +29 -0
- package/presets/zcode/php-laravel/rules/jobs-queues.md +36 -0
- package/presets/zcode/php-laravel/rules/language-policy.md +51 -0
- package/presets/zcode/php-laravel/rules/laravel-anti-hallucination.md +27 -0
- package/presets/zcode/php-laravel/rules/laravel-app-core.md +34 -0
- package/presets/zcode/php-laravel/rules/laravel-conventions.md +34 -0
- package/presets/zcode/php-laravel/rules/mcp-usage.md +92 -0
- package/presets/zcode/php-laravel/rules/module-public-api.md +23 -0
- package/presets/zcode/php-laravel/rules/php-tooling.md +26 -0
- package/presets/zcode/php-laravel/rules/policies-authorization.md +24 -0
- package/presets/zcode/php-laravel/rules/post-change-test.md +20 -0
- package/presets/zcode/php-laravel/rules/preset-goals.md +31 -0
- package/presets/zcode/php-laravel/rules/preset-layering.md +27 -0
- package/presets/zcode/php-laravel/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/php-laravel/rules/preset-token-budget.md +38 -0
- package/presets/zcode/php-laravel/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/php-laravel/rules/preset-writing-style.md +42 -0
- package/presets/zcode/php-laravel/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/php-laravel/rules/product-specs.md +62 -0
- package/presets/zcode/php-laravel/rules/reference-features.md +45 -0
- package/presets/zcode/php-laravel/rules/routes-api.md +24 -0
- package/presets/zcode/php-laravel/rules/security-php.md +47 -0
- package/presets/zcode/php-laravel/rules/service-providers.md +23 -0
- package/presets/zcode/php-laravel/rules/technical-retro.md +13 -0
- package/presets/zcode/php-laravel/rules/tests-e2e.md +26 -0
- package/presets/zcode/php-laravel/rules/tests-integration.md +23 -0
- package/presets/zcode/php-laravel/rules/tests-unit.md +24 -0
- package/presets/zcode/php-laravel/skills/README.md +5 -0
- package/presets/zcode/php-laravel/skills/ci-investigation/SKILL.md +24 -0
- package/presets/zcode/php-laravel/skills/code-review/SKILL.md +47 -0
- package/presets/zcode/php-laravel/skills/debug-investigation/SKILL.md +55 -0
- package/presets/zcode/php-laravel/skills/feature-delivery/SKILL.md +43 -0
- package/presets/zcode/php-laravel/skills/integration-testing/SKILL.md +21 -0
- package/presets/zcode/php-laravel/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/php-laravel/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/php-laravel/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/php-laravel/skills/unit-testing/SKILL.md +20 -0
- package/presets/zcode/php-laravel/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/php-laravel/team/README.md +123 -0
- package/presets/zcode/php-laravel/team/fixtures/bugfix-standard.json +12 -0
- package/presets/zcode/php-laravel/team/fixtures/feature-full.json +44 -0
- package/presets/zcode/php-laravel/team/fixtures/feature-light.json +8 -0
- package/presets/zcode/php-laravel/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/platform-contract.json +135 -0
- package/presets/zcode/svelte/MCP.md +36 -0
- package/presets/zcode/svelte/README.md +20 -0
- package/presets/zcode/svelte/REPO_AGENTS.md +101 -0
- package/presets/zcode/svelte/adapter-map.json +1065 -0
- package/presets/zcode/svelte/agents/README.md +107 -0
- package/presets/zcode/svelte/agents/accessibility-reviewer.md +91 -0
- package/presets/zcode/svelte/agents/api-contract-reviewer.md +89 -0
- package/presets/zcode/svelte/agents/build-verifier.md +106 -0
- package/presets/zcode/svelte/agents/ci-investigator.md +109 -0
- package/presets/zcode/svelte/agents/code-reviewer.md +124 -0
- package/presets/zcode/svelte/agents/codebase-analyzer.md +51 -0
- package/presets/zcode/svelte/agents/debugger.md +140 -0
- package/presets/zcode/svelte/agents/feature-developer.md +161 -0
- package/presets/zcode/svelte/agents/migration-specialist.md +97 -0
- package/presets/zcode/svelte/agents/mockup-reviewer.md +83 -0
- package/presets/zcode/svelte/agents/openspec-author.md +187 -0
- package/presets/zcode/svelte/agents/performance-auditor.md +98 -0
- package/presets/zcode/svelte/agents/playwright-test-generator.md +60 -0
- package/presets/zcode/svelte/agents/playwright-test-healer.md +60 -0
- package/presets/zcode/svelte/agents/playwright-test-planner.md +55 -0
- package/presets/zcode/svelte/agents/qa-tester.md +85 -0
- package/presets/zcode/svelte/agents/security-reviewer.md +84 -0
- package/presets/zcode/svelte/agents/solution-architect.md +98 -0
- package/presets/zcode/svelte/agents/task-analyst.md +239 -0
- package/presets/zcode/svelte/agents/task-router.md +226 -0
- package/presets/zcode/svelte/agents/tech-writer.md +87 -0
- package/presets/zcode/svelte/agents/unit-test-generator.md +62 -0
- package/presets/zcode/svelte/agents/unit-test-healer.md +63 -0
- package/presets/zcode/svelte/agents/unit-test-planner.md +87 -0
- package/presets/zcode/svelte/ai-local/conventions.md +29 -0
- package/presets/zcode/svelte/commands/README.md +51 -0
- package/presets/zcode/svelte/commands/migrate-tasks.md +44 -0
- package/presets/zcode/svelte/commands/spec-start.md +32 -0
- package/presets/zcode/svelte/commands/task-continue.md +75 -0
- package/presets/zcode/svelte/commands/task.md +76 -0
- package/presets/zcode/svelte/commands/technical-retro.md +96 -0
- package/presets/zcode/svelte/commands/update.md +43 -0
- package/presets/zcode/svelte/hooks/README.md +31 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +2766 -0
- package/presets/zcode/svelte/hooks/check-preset-update.mjs +232 -0
- package/presets/zcode/svelte/hooks/list-ai-local.mjs +299 -0
- package/presets/zcode/svelte/mcp.json +19 -0
- package/presets/zcode/svelte/rules/README.md +25 -0
- package/presets/zcode/svelte/rules/agent-team-intake.md +14 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +282 -0
- package/presets/zcode/svelte/rules/ai-local-overlay.md +18 -0
- package/presets/zcode/svelte/rules/anti-hallucination-contract.md +37 -0
- package/presets/zcode/svelte/rules/anti-sycophancy-discipline.md +23 -0
- package/presets/zcode/svelte/rules/api-services.md +39 -0
- package/presets/zcode/svelte/rules/architecture-boundaries-ui.md +9 -0
- package/presets/zcode/svelte/rules/architecture-boundaries.md +54 -0
- package/presets/zcode/svelte/rules/code-quality-and-refactoring.md +76 -0
- package/presets/zcode/svelte/rules/code-review-mr.md +84 -0
- package/presets/zcode/svelte/rules/css-property-order-stylelint.md +14 -0
- package/presets/zcode/svelte/rules/design-guidance.md +104 -0
- package/presets/zcode/svelte/rules/feature-delivery-workflow.md +117 -0
- package/presets/zcode/svelte/rules/http-client.md +10 -0
- package/presets/zcode/svelte/rules/interactive-questions.md +29 -0
- package/presets/zcode/svelte/rules/language-policy.md +51 -0
- package/presets/zcode/svelte/rules/layer-barrel-exports.md +67 -0
- package/presets/zcode/svelte/rules/mcp-usage.md +95 -0
- package/presets/zcode/svelte/rules/mockup-review.md +171 -0
- package/presets/zcode/svelte/rules/navigation-router-stack.md +34 -0
- package/presets/zcode/svelte/rules/navigation-router-ui.md +19 -0
- package/presets/zcode/svelte/rules/no-rest-props-spread.md +26 -0
- package/presets/zcode/svelte/rules/no-type-assertion-as-import-export.md +51 -0
- package/presets/zcode/svelte/rules/package-manager.md +13 -0
- package/presets/zcode/svelte/rules/playwright-agents.md +74 -0
- package/presets/zcode/svelte/rules/post-change-lint.md +37 -0
- package/presets/zcode/svelte/rules/preset-goals.md +31 -0
- package/presets/zcode/svelte/rules/preset-layering.md +27 -0
- package/presets/zcode/svelte/rules/preset-no-cross-stack-leakage.md +89 -0
- package/presets/zcode/svelte/rules/preset-pr-checklist.md +45 -0
- package/presets/zcode/svelte/rules/preset-token-budget.md +38 -0
- package/presets/zcode/svelte/rules/preset-twin-sync.md +41 -0
- package/presets/zcode/svelte/rules/preset-writing-style.md +42 -0
- package/presets/zcode/svelte/rules/product-specs-authoring.md +118 -0
- package/presets/zcode/svelte/rules/product-specs.md +61 -0
- package/presets/zcode/svelte/rules/public-imports.md +32 -0
- package/presets/zcode/svelte/rules/reference-features.md +82 -0
- package/presets/zcode/svelte/rules/security-sveltekit.md +32 -0
- package/presets/zcode/svelte/rules/store-svelte.md +59 -0
- package/presets/zcode/svelte/rules/svelte-a11y-coding.md +21 -0
- package/presets/zcode/svelte/rules/svelte-app-core.md +44 -0
- package/presets/zcode/svelte/rules/svelte-script-conventions.md +27 -0
- package/presets/zcode/svelte/rules/svelte-sveltekit-anti-hallucination.md +66 -0
- package/presets/zcode/svelte/rules/svelte-ui.md +38 -0
- package/presets/zcode/svelte/rules/sveltekit-routing.md +33 -0
- package/presets/zcode/svelte/rules/technical-retro.md +13 -0
- package/presets/zcode/svelte/rules/tests-e2e-structure.md +87 -0
- package/presets/zcode/svelte/rules/tests-unit.md +82 -0
- package/presets/zcode/svelte/rules/types-jsdoc.md +40 -0
- package/presets/zcode/svelte/rules/ux-design.md +103 -0
- package/presets/zcode/svelte/skills/README.md +21 -0
- package/presets/zcode/svelte/skills/ci-investigation/SKILL.md +50 -0
- package/presets/zcode/svelte/skills/code-review/SKILL.md +60 -0
- package/presets/zcode/svelte/skills/debug-investigation/SKILL.md +64 -0
- package/presets/zcode/svelte/skills/feature-delivery/SKILL.md +52 -0
- package/presets/zcode/svelte/skills/mockup-review/SKILL.md +34 -0
- package/presets/zcode/svelte/skills/playwright-e2e/SKILL.md +43 -0
- package/presets/zcode/svelte/skills/spec-authoring/SKILL.md +31 -0
- package/presets/zcode/svelte/skills/spec-discovery/SKILL.md +63 -0
- package/presets/zcode/svelte/skills/svelte-performance/SKILL.md +57 -0
- package/presets/zcode/svelte/skills/technical-retro/SKILL.md +72 -0
- package/presets/zcode/svelte/skills/unit-testing/SKILL.md +38 -0
- package/presets/zcode/svelte/skills/ux-design/SKILL.md +41 -0
- package/presets/zcode/svelte/skills/write-adr/SKILL.md +46 -0
- package/presets/zcode/svelte/team/README.md +123 -0
- package/presets/zcode/svelte/team/fixtures/artifact-manifest.example.json +80 -0
- package/presets/zcode/svelte/team/fixtures/bugfix-standard.json +25 -0
- package/presets/zcode/svelte/team/fixtures/feature-full.json +62 -0
- package/presets/zcode/svelte/team/fixtures/feature-light.json +27 -0
- package/presets/zcode/svelte/team/fixtures/feature-with-figma-url.json +17 -0
- package/presets/zcode/svelte/team/fixtures/feature-with-ux-no-figma.json +17 -0
- package/presets/zcode/svelte/team/fixtures/memlog.example.md +9 -0
- package/presets/zcode/svelte/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/zcode/svelte/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/zcode/svelte/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/zcode/svelte/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/zcode/svelte/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/zcode/svelte/team/fixtures/metrics.example.json +54 -0
- package/presets/zcode/svelte/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
- package/presets/zcode/svelte/team/fixtures/mockup-review-standalone.json +14 -0
- package/presets/zcode/svelte/team/fixtures/ux-design-standalone.json +15 -0
- package/presets/zcode/svelte/team/tasks/.gitkeep +0 -0
|
@@ -0,0 +1,1590 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsers and projector for the `.ai.local/team` SQLite projection.
|
|
3
|
+
*
|
|
4
|
+
* Files are authoritative. One task directory is one transaction: parse the
|
|
5
|
+
* known artifacts, upsert every normalized row by its natural key, store every
|
|
6
|
+
* regular file as a raw document, and rebuild the task's search rows. A
|
|
7
|
+
* malformed input is recorded and the rest of the tree still projects; a
|
|
8
|
+
* database-level failure aborts the run.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here writes a lifecycle file. `status.json` and `metrics.json` are
|
|
11
|
+
* read-only inputs.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import crypto from 'node:crypto';
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
SEARCH_MODE_FTS5,
|
|
20
|
+
TeamDbError,
|
|
21
|
+
chmodDatabaseFiles,
|
|
22
|
+
integrityCheck,
|
|
23
|
+
isBusyError,
|
|
24
|
+
isCorruptError,
|
|
25
|
+
openTeamDb,
|
|
26
|
+
readSearchMode,
|
|
27
|
+
teamDbFail,
|
|
28
|
+
} from './team-db-schema.mjs';
|
|
29
|
+
|
|
30
|
+
export const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
31
|
+
export const MAX_RAW_BYTES = 32 * 1024 * 1024;
|
|
32
|
+
export const RETENTION_DAYS = 90;
|
|
33
|
+
export const SYNC_RUN_RETENTION = 200;
|
|
34
|
+
export const DEFAULT_SLUG_DEADLINE_MS = 4500;
|
|
35
|
+
|
|
36
|
+
const HASH_CHUNK = 64 * 1024;
|
|
37
|
+
const MAX_KNOWN_BYTES = 8 * 1024 * 1024;
|
|
38
|
+
const SKIP_FILE = /(?:^|\/)(?:\.manifest\.lock|[^/]*\.lock|[^/]*\.tmp)$/;
|
|
39
|
+
const SKIP_DIR = new Set(['node_modules', '.git']);
|
|
40
|
+
|
|
41
|
+
const KNOWN_FILES = {
|
|
42
|
+
status: 'status.json',
|
|
43
|
+
pipeline: 'pipeline.json',
|
|
44
|
+
metrics: 'metrics.json',
|
|
45
|
+
manifest: 'artifact-manifest.json',
|
|
46
|
+
prompt: 'prompt.md',
|
|
47
|
+
promptLog: 'prompt-log.md',
|
|
48
|
+
goal: 'goal.md',
|
|
49
|
+
brief: 'brief.md',
|
|
50
|
+
outcome: 'outcome.md',
|
|
51
|
+
reviewLedger: 'review-ledger.md',
|
|
52
|
+
memlog: '.memlog.md',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const EVENT_TYPES = new Set([
|
|
56
|
+
'task_started',
|
|
57
|
+
'attempt_started',
|
|
58
|
+
'attempt_finished',
|
|
59
|
+
'retry_scheduled',
|
|
60
|
+
'attempt_skipped',
|
|
61
|
+
'human_gate_started',
|
|
62
|
+
'human_gate_ended',
|
|
63
|
+
'pipeline_parse_error',
|
|
64
|
+
'task_completed',
|
|
65
|
+
'parallel_wave_started',
|
|
66
|
+
'step_joined',
|
|
67
|
+
'parallel_attribution_repair',
|
|
68
|
+
'parallel_conflict_deferred',
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
const TEXT_EXTENSIONS = new Set([
|
|
72
|
+
'.md',
|
|
73
|
+
'.mdc',
|
|
74
|
+
'.json',
|
|
75
|
+
'.jsonl',
|
|
76
|
+
'.txt',
|
|
77
|
+
'.text',
|
|
78
|
+
'.yml',
|
|
79
|
+
'.yaml',
|
|
80
|
+
'.toml',
|
|
81
|
+
'.mjs',
|
|
82
|
+
'.cjs',
|
|
83
|
+
'.js',
|
|
84
|
+
'.ts',
|
|
85
|
+
'.tsx',
|
|
86
|
+
'.jsx',
|
|
87
|
+
'.css',
|
|
88
|
+
'.html',
|
|
89
|
+
'.htm',
|
|
90
|
+
'.xml',
|
|
91
|
+
'.csv',
|
|
92
|
+
'.log',
|
|
93
|
+
'.sh',
|
|
94
|
+
'.sql',
|
|
95
|
+
'.patch',
|
|
96
|
+
'.diff',
|
|
97
|
+
'',
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
const MEDIA_TYPES = {
|
|
101
|
+
'.md': 'text/markdown',
|
|
102
|
+
'.mdc': 'text/markdown',
|
|
103
|
+
'.json': 'application/json',
|
|
104
|
+
'.jsonl': 'application/x-ndjson',
|
|
105
|
+
'.txt': 'text/plain',
|
|
106
|
+
'.text': 'text/plain',
|
|
107
|
+
'.yml': 'text/yaml',
|
|
108
|
+
'.yaml': 'text/yaml',
|
|
109
|
+
'.toml': 'text/plain',
|
|
110
|
+
'.mjs': 'text/javascript',
|
|
111
|
+
'.cjs': 'text/javascript',
|
|
112
|
+
'.js': 'text/javascript',
|
|
113
|
+
'.ts': 'text/plain',
|
|
114
|
+
'.tsx': 'text/plain',
|
|
115
|
+
'.jsx': 'text/plain',
|
|
116
|
+
'.css': 'text/css',
|
|
117
|
+
'.html': 'text/html',
|
|
118
|
+
'.htm': 'text/html',
|
|
119
|
+
'.xml': 'application/xml',
|
|
120
|
+
'.csv': 'text/csv',
|
|
121
|
+
'.log': 'text/plain',
|
|
122
|
+
'.sh': 'text/x-shellscript',
|
|
123
|
+
'.sql': 'text/plain',
|
|
124
|
+
'.patch': 'text/plain',
|
|
125
|
+
'.diff': 'text/plain',
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
129
|
+
|
|
130
|
+
const sha256 = (value) => crypto.createHash('sha256').update(value).digest('hex');
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Canonical JSON: sorted keys at every depth, arrays preserved, `undefined`
|
|
134
|
+
* dropped, non-finite numbers rejected. Re-projection of equal input is
|
|
135
|
+
* byte-identical even when the source key order differs.
|
|
136
|
+
*/
|
|
137
|
+
export function canonicalJson(value) {
|
|
138
|
+
const walk = (node) => {
|
|
139
|
+
if (node === null || typeof node !== 'object') {
|
|
140
|
+
if (typeof node === 'number' && !Number.isFinite(node)) {
|
|
141
|
+
throw new Error('canonical JSON cannot represent a non-finite number');
|
|
142
|
+
}
|
|
143
|
+
return node;
|
|
144
|
+
}
|
|
145
|
+
if (Array.isArray(node)) return node.map(walk);
|
|
146
|
+
const sorted = {};
|
|
147
|
+
for (const key of Object.keys(node).sort()) {
|
|
148
|
+
if (node[key] === undefined) continue;
|
|
149
|
+
sorted[key] = walk(node[key]);
|
|
150
|
+
}
|
|
151
|
+
return sorted;
|
|
152
|
+
};
|
|
153
|
+
const serialized = JSON.stringify(walk(value));
|
|
154
|
+
return serialized === undefined ? 'null' : serialized;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const isoTimestamp = (value) => {
|
|
158
|
+
if (typeof value !== 'string' || value.trim() === '') return null;
|
|
159
|
+
return Number.isNaN(Date.parse(value)) ? null : value;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const integerOrNull = (value) => {
|
|
163
|
+
if (value === null || value === undefined || value === '') return null;
|
|
164
|
+
const number = typeof value === 'number' ? value : Number(value);
|
|
165
|
+
return Number.isFinite(number) ? Math.trunc(number) : null;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const positiveDurationOrNull = (value) => {
|
|
169
|
+
const number = integerOrNull(value);
|
|
170
|
+
return number === null || number < 0 ? null : number;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const booleanFlag = (value) => (value === true || value === 1 || value === 'true' ? 1 : 0);
|
|
174
|
+
|
|
175
|
+
const firstHeading = (text) => {
|
|
176
|
+
if (typeof text !== 'string') return null;
|
|
177
|
+
const match = /^#\s+(.+)$/m.exec(text);
|
|
178
|
+
return match ? match[1].trim() : null;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const readTextFile = (filePath) => {
|
|
182
|
+
const stats = fs.statSync(filePath);
|
|
183
|
+
if (stats.size > MAX_KNOWN_BYTES) {
|
|
184
|
+
throw new Error(`file is ${stats.size} bytes, above the ${MAX_KNOWN_BYTES}-byte parse bound`);
|
|
185
|
+
}
|
|
186
|
+
return fs.readFileSync(filePath, 'utf8');
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/* --------------------------------- parsers -------------------------------- */
|
|
190
|
+
|
|
191
|
+
export function parseStatusJson(text) {
|
|
192
|
+
const value = JSON.parse(text);
|
|
193
|
+
if (!isRecord(value)) throw new Error('top level must be an object');
|
|
194
|
+
return value;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function parsePipelineJson(text) {
|
|
198
|
+
const value = JSON.parse(text);
|
|
199
|
+
if (!isRecord(value)) throw new Error('top level must be an object');
|
|
200
|
+
if (value.steps !== undefined && !Array.isArray(value.steps)) throw new Error('"steps" must be an array');
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function parseMetricsJson(text) {
|
|
205
|
+
const value = JSON.parse(text);
|
|
206
|
+
if (!isRecord(value)) throw new Error('top level must be an object');
|
|
207
|
+
if (!Array.isArray(value.events)) throw new Error('"events" must be an array');
|
|
208
|
+
return value;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function parseArtifactManifestJson(text) {
|
|
212
|
+
const value = JSON.parse(text);
|
|
213
|
+
if (!isRecord(value)) throw new Error('top level must be an object');
|
|
214
|
+
if (!Array.isArray(value.artifacts)) throw new Error('"artifacts" must be an array');
|
|
215
|
+
return value;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const FENCE_RE = /```(?:text|markdown|md)?\r?\n([\s\S]*?)\r?\n```/;
|
|
219
|
+
|
|
220
|
+
const parsePromptMeta = (text) => {
|
|
221
|
+
const meta = {};
|
|
222
|
+
for (const line of text.split('\n')) {
|
|
223
|
+
const match = /^(?:-\s*)?([A-Za-z][\w-]*):\s*(.*)$/.exec(line.trim());
|
|
224
|
+
if (!match) continue;
|
|
225
|
+
if (!(match[1] in meta)) meta[match[1]] = match[2].trim();
|
|
226
|
+
}
|
|
227
|
+
return meta;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
|
|
231
|
+
const PROMPT_HEADING_RE = /^#\s+(?:Original prompt|Prompt)\s*\r?\n+/i;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Canonical `prompt.md` carries one fenced block. Files written before that
|
|
235
|
+
* shape (24 of this repository's 66) are a frontmatter block and/or a heading
|
|
236
|
+
* followed by plain text; those are valid legacy prompts, not parse failures.
|
|
237
|
+
* An opened fence without a closing fence is still an error.
|
|
238
|
+
*/
|
|
239
|
+
export function parsePromptMarkdown(text) {
|
|
240
|
+
const match = FENCE_RE.exec(text);
|
|
241
|
+
const meta = parsePromptMeta(text);
|
|
242
|
+
if (match) return { content: match[1], meta, error: null };
|
|
243
|
+
if (/^```/m.test(text)) {
|
|
244
|
+
return { content: text, meta, error: 'unterminated prompt code fence; stored the whole file' };
|
|
245
|
+
}
|
|
246
|
+
let body = text;
|
|
247
|
+
const frontmatter = FRONTMATTER_RE.exec(body);
|
|
248
|
+
if (frontmatter) {
|
|
249
|
+
Object.assign(meta, parsePromptMeta(frontmatter[1]));
|
|
250
|
+
body = body.slice(frontmatter[0].length);
|
|
251
|
+
}
|
|
252
|
+
const heading = PROMPT_HEADING_RE.exec(body);
|
|
253
|
+
if (heading) body = body.slice(heading[0].length);
|
|
254
|
+
return { content: body.trim(), meta, error: null };
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function parsePromptLogMarkdown(text) {
|
|
258
|
+
// `## <n>` is a section only outside a fenced block: a prompt may itself
|
|
259
|
+
// contain a Markdown heading.
|
|
260
|
+
const sections = [];
|
|
261
|
+
let inFence = false;
|
|
262
|
+
let current = null;
|
|
263
|
+
for (const line of text.split('\n')) {
|
|
264
|
+
if (/^\s*```/.test(line)) inFence = !inFence;
|
|
265
|
+
const heading = !inFence ? /^##\s+(\d+)\s*$/.exec(line) : null;
|
|
266
|
+
if (heading) {
|
|
267
|
+
current = { label: Number(heading[1]), lines: [line] };
|
|
268
|
+
sections.push(current);
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (current) current.lines.push(line);
|
|
272
|
+
}
|
|
273
|
+
const entries = [];
|
|
274
|
+
const errors = [];
|
|
275
|
+
const seen = new Set();
|
|
276
|
+
sections.forEach((section) => {
|
|
277
|
+
const body = section.lines.join('\n');
|
|
278
|
+
const fence = FENCE_RE.exec(body);
|
|
279
|
+
if (!fence) {
|
|
280
|
+
errors.push(`entry ${section.label} has no fenced text block`);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const meta = parsePromptMeta(body.slice(0, fence.index));
|
|
284
|
+
const seq = integerOrNull(meta.seq) ?? section.label;
|
|
285
|
+
if (seen.has(seq)) {
|
|
286
|
+
errors.push(`entry ${section.label} duplicates seq ${seq}`);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
seen.add(seq);
|
|
290
|
+
entries.push({
|
|
291
|
+
seq,
|
|
292
|
+
source: meta.source ?? null,
|
|
293
|
+
command: meta.command ?? null,
|
|
294
|
+
capturedAt: isoTimestamp(meta.capturedAt),
|
|
295
|
+
language: meta.language ?? null,
|
|
296
|
+
content: fence[1],
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
return { entries, errors };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function parseOutcomeMarkdown(text) {
|
|
303
|
+
const goalAchieved = /^\*\*goalAchieved:\*\*\s*(.+)$/m.exec(text);
|
|
304
|
+
const value = /^\*\*value:\*\*\s*(.+)$/m.exec(text);
|
|
305
|
+
const counts = {};
|
|
306
|
+
const countsSection = /^##\s+Review counts\s*$/m.exec(text);
|
|
307
|
+
if (countsSection) {
|
|
308
|
+
const tail = text.slice(countsSection.index + countsSection[0].length);
|
|
309
|
+
for (const line of tail.split('\n')) {
|
|
310
|
+
const item = /^-\s*([A-Za-z]+):\s*(\d+)\s*$/.exec(line.trim());
|
|
311
|
+
if (item) counts[item[1]] = Number(item[2]);
|
|
312
|
+
if (/^##\s+/.test(line)) break;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
goalAchieved: goalAchieved ? goalAchieved[1].trim() : null,
|
|
317
|
+
value: value ? value[1].trim() : null,
|
|
318
|
+
reviewTotal: counts.total ?? null,
|
|
319
|
+
reviewFair: counts.fair ?? null,
|
|
320
|
+
reviewRejected: counts.rejected ?? null,
|
|
321
|
+
reviewOpen: counts.open ?? null,
|
|
322
|
+
reviewRework: counts.rework ?? null,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const splitTableRow = (line) => {
|
|
327
|
+
const trimmed = line.trim().replace(/^\|/, '').replace(/\|$/, '');
|
|
328
|
+
const cells = [];
|
|
329
|
+
let current = '';
|
|
330
|
+
for (let index = 0; index < trimmed.length; index += 1) {
|
|
331
|
+
const char = trimmed[index];
|
|
332
|
+
if (char === '\\' && trimmed[index + 1] === '|') {
|
|
333
|
+
current += '|';
|
|
334
|
+
index += 1;
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
if (char === '|') {
|
|
338
|
+
cells.push(current.trim());
|
|
339
|
+
current = '';
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
current += char;
|
|
343
|
+
}
|
|
344
|
+
cells.push(current.trim());
|
|
345
|
+
return cells;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const LEDGER_COLUMN_ALIASES = {
|
|
349
|
+
id: ['id', 'seq'],
|
|
350
|
+
at: ['at', 'date'],
|
|
351
|
+
source: ['source', 'origin'],
|
|
352
|
+
summary: ['summary', 'finding'],
|
|
353
|
+
fair: ['fair'],
|
|
354
|
+
disposition: ['disposition', 'status'],
|
|
355
|
+
evidence: ['evidence'],
|
|
356
|
+
signature: ['signature'],
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
const normalizeLedgerHeader = (cell) => cell.toLowerCase().replace(/[^a-z]/g, '');
|
|
360
|
+
|
|
361
|
+
const ledgerHeaderMap = (line) => {
|
|
362
|
+
if (!line.startsWith('|')) return null;
|
|
363
|
+
const cells = splitTableRow(line);
|
|
364
|
+
const map = {};
|
|
365
|
+
for (const [column, aliases] of Object.entries(LEDGER_COLUMN_ALIASES)) {
|
|
366
|
+
const index = cells.findIndex((cell) => aliases.includes(normalizeLedgerHeader(cell)));
|
|
367
|
+
if (index !== -1) map[column] = index;
|
|
368
|
+
}
|
|
369
|
+
if (map.summary === undefined) return null;
|
|
370
|
+
if (map.id === undefined && map.disposition === undefined) return null;
|
|
371
|
+
return { map, width: cells.length };
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const normalizeLedgerId = (value, fallback) => {
|
|
375
|
+
const text = (value ?? '').trim();
|
|
376
|
+
if (/^RL-\d+$/.test(text)) return text;
|
|
377
|
+
if (/^\d+$/.test(text)) return `RL-${text}`;
|
|
378
|
+
return text || `RL-${fallback}`;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const normalizeLedgerFair = (value) => {
|
|
382
|
+
const text = (value ?? '').trim().toLowerCase();
|
|
383
|
+
if (text === 'no' || text === 'rejected') return 'no';
|
|
384
|
+
return text || 'yes';
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const normalizeLedgerDisposition = (value) => {
|
|
388
|
+
const text = (value ?? '').trim().toLowerCase();
|
|
389
|
+
if (!text) return 'open';
|
|
390
|
+
if (text === 'fixed' || text.startsWith('resolved')) return 'fixed';
|
|
391
|
+
if (text === 'rejected') return 'rejected';
|
|
392
|
+
if (text.startsWith('open') || text === 'recorded' || text === 'accepted') return 'open';
|
|
393
|
+
return text;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The canonical ledger is the fixed eight-column table from
|
|
398
|
+
* `agent-artifact-contracts.md`. Older task ledgers use six-column aliases
|
|
399
|
+
* (`seq`/`date`/`origin`/`finding`, `Date`/`Source`/`Finding`/`Fair`) and the
|
|
400
|
+
* MCP roll-up uses sectioned `ID`/`Severity`/`Finding`/`Status` tables.
|
|
401
|
+
* Parse every table in the file, map the aliases, and keep the canonical row
|
|
402
|
+
* shape so the projection does not silently drop a task's review history.
|
|
403
|
+
*/
|
|
404
|
+
export function parseReviewLedgerMarkdown(text) {
|
|
405
|
+
const lines = text.split('\n');
|
|
406
|
+
const rows = [];
|
|
407
|
+
const errors = [];
|
|
408
|
+
let section = null;
|
|
409
|
+
let rowIndex = 0;
|
|
410
|
+
let headerFound = false;
|
|
411
|
+
let index = 0;
|
|
412
|
+
while (index < lines.length) {
|
|
413
|
+
const line = lines[index].trim();
|
|
414
|
+
if (/^##\s+/.test(line)) {
|
|
415
|
+
section = line.replace(/^##\s+/, '').trim() || null;
|
|
416
|
+
index += 1;
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
const header = line.startsWith('|') ? ledgerHeaderMap(line) : null;
|
|
420
|
+
if (!header) {
|
|
421
|
+
index += 1;
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
const { map, width } = header;
|
|
425
|
+
headerFound = true;
|
|
426
|
+
index += 1;
|
|
427
|
+
for (; index < lines.length; index += 1) {
|
|
428
|
+
const rowLine = lines[index].trim();
|
|
429
|
+
if (rowLine === '' || !rowLine.startsWith('|')) break;
|
|
430
|
+
if (/^\|[\s:|-]+\|$/.test(rowLine)) continue;
|
|
431
|
+
const cells = splitTableRow(rowLine);
|
|
432
|
+
if (cells.length < width) {
|
|
433
|
+
errors.push(`row ${index + 1} has ${cells.length} cells, expected ${width}`);
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const summaryIndex = map.summary;
|
|
437
|
+
const trailing = width - summaryIndex - 1;
|
|
438
|
+
const compact =
|
|
439
|
+
cells.length > width
|
|
440
|
+
? [
|
|
441
|
+
...cells.slice(0, summaryIndex),
|
|
442
|
+
cells.slice(summaryIndex, cells.length - trailing).join(' | '),
|
|
443
|
+
...cells.slice(cells.length - trailing),
|
|
444
|
+
]
|
|
445
|
+
: cells;
|
|
446
|
+
const cell = (column) => (map[column] === undefined ? null : compact[map[column]] ?? null);
|
|
447
|
+
const summary = (cell('summary') ?? '').trim();
|
|
448
|
+
if (!summary) {
|
|
449
|
+
errors.push(`row ${index + 1} has no summary`);
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
rowIndex += 1;
|
|
453
|
+
rows.push({
|
|
454
|
+
id: normalizeLedgerId(cell('id'), rowIndex),
|
|
455
|
+
at: isoTimestamp(cell('at')),
|
|
456
|
+
source: cell('source') || section,
|
|
457
|
+
summary,
|
|
458
|
+
fair: normalizeLedgerFair(cell('fair')),
|
|
459
|
+
disposition: normalizeLedgerDisposition(cell('disposition')),
|
|
460
|
+
evidence: cell('evidence') || null,
|
|
461
|
+
signature: cell('signature') || null,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (!headerFound) {
|
|
466
|
+
return { rows: [], error: 'no ledger table header' };
|
|
467
|
+
}
|
|
468
|
+
return { rows, error: null, errors };
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* ------------------------------- projection ------------------------------- */
|
|
472
|
+
|
|
473
|
+
export function listTaskDirectories(teamRoot) {
|
|
474
|
+
const tasksDir = path.join(teamRoot, 'tasks');
|
|
475
|
+
if (!fs.existsSync(tasksDir)) return [];
|
|
476
|
+
return fs
|
|
477
|
+
.readdirSync(tasksDir, { withFileTypes: true })
|
|
478
|
+
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && SLUG_RE.test(entry.name))
|
|
479
|
+
.map((entry) => entry.name)
|
|
480
|
+
.sort();
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
const hashFile = (absolute) => {
|
|
484
|
+
const hash = crypto.createHash('sha256');
|
|
485
|
+
const fd = fs.openSync(absolute, 'r');
|
|
486
|
+
const buffer = Buffer.allocUnsafe(HASH_CHUNK);
|
|
487
|
+
try {
|
|
488
|
+
let read = 0;
|
|
489
|
+
while ((read = fs.readSync(fd, buffer, 0, buffer.length, null)) > 0) {
|
|
490
|
+
hash.update(buffer.subarray(0, read));
|
|
491
|
+
}
|
|
492
|
+
} finally {
|
|
493
|
+
fs.closeSync(fd);
|
|
494
|
+
}
|
|
495
|
+
return hash.digest('hex');
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Walk one task directory, hashing every regular file. Symlinks, lock files,
|
|
500
|
+
* temp files, and `node_modules` are skipped. Returns per-task metadata only,
|
|
501
|
+
* never the whole tree.
|
|
502
|
+
*/
|
|
503
|
+
export function walkTaskDirectory(taskDir, deadlineAt = Infinity) {
|
|
504
|
+
const files = [];
|
|
505
|
+
const walk = (directory, prefix) => {
|
|
506
|
+
const entries = fs.readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
507
|
+
for (const entry of entries) {
|
|
508
|
+
if (Date.now() > deadlineAt) teamDbFail('E_DEADLINE', 'projection deadline expired', 4);
|
|
509
|
+
const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
510
|
+
if (entry.isSymbolicLink()) continue;
|
|
511
|
+
if (entry.isDirectory()) {
|
|
512
|
+
if (SKIP_DIR.has(entry.name)) continue;
|
|
513
|
+
walk(path.join(directory, entry.name), relative);
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
if (!entry.isFile()) continue;
|
|
517
|
+
if (SKIP_FILE.test(relative)) continue;
|
|
518
|
+
const absolute = path.join(directory, entry.name);
|
|
519
|
+
try {
|
|
520
|
+
const stats = fs.statSync(absolute);
|
|
521
|
+
files.push({ path: relative, absolute, bytes: stats.size, sha256: hashFile(absolute), readError: null });
|
|
522
|
+
} catch (error) {
|
|
523
|
+
files.push({ path: relative, absolute, bytes: null, sha256: null, readError: error.message });
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
walk(taskDir, '');
|
|
528
|
+
files.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
529
|
+
return files;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const taskContentHash = (files) =>
|
|
533
|
+
sha256(files.map((file) => `${file.path}\0${file.sha256 ?? ''}\n`).join(''));
|
|
534
|
+
|
|
535
|
+
const mediaTypeFor = (relative) => MEDIA_TYPES[path.extname(relative).toLowerCase()] ?? 'application/octet-stream';
|
|
536
|
+
|
|
537
|
+
const isTextCandidate = (relative, buffer) => {
|
|
538
|
+
if (!TEXT_EXTENSIONS.has(path.extname(relative).toLowerCase())) return false;
|
|
539
|
+
const probe = buffer.subarray(0, Math.min(buffer.length, 8192));
|
|
540
|
+
return !probe.includes(0);
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
const readDocument = (file) => {
|
|
544
|
+
if (file.readError) {
|
|
545
|
+
return {
|
|
546
|
+
content: null,
|
|
547
|
+
contentOmitted: null,
|
|
548
|
+
isText: 0,
|
|
549
|
+
mediaType: mediaTypeFor(file.path),
|
|
550
|
+
parseError: `E_TASK_READ: ${file.readError}`,
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
const mediaType = mediaTypeFor(file.path);
|
|
554
|
+
if (file.bytes > MAX_RAW_BYTES) {
|
|
555
|
+
return { content: null, contentOmitted: 'size', isText: 0, mediaType, parseError: null };
|
|
556
|
+
}
|
|
557
|
+
const buffer = fs.readFileSync(file.absolute);
|
|
558
|
+
if (!isTextCandidate(file.path, buffer)) {
|
|
559
|
+
return { content: null, contentOmitted: 'binary', isText: 0, mediaType, parseError: null };
|
|
560
|
+
}
|
|
561
|
+
return { content: buffer.toString('utf8'), contentOmitted: null, isText: 1, mediaType, parseError: null };
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
const readKnown = (taskDir, name) => {
|
|
565
|
+
const absolute = path.join(taskDir, name);
|
|
566
|
+
if (!fs.existsSync(absolute)) return { exists: false, text: null, error: null };
|
|
567
|
+
try {
|
|
568
|
+
return { exists: true, text: readTextFile(absolute), error: null };
|
|
569
|
+
} catch (error) {
|
|
570
|
+
return { exists: true, text: null, error: error.message };
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
const parseKnown = (taskDir, slug) => {
|
|
575
|
+
const result = {
|
|
576
|
+
status: null,
|
|
577
|
+
pipeline: null,
|
|
578
|
+
metrics: null,
|
|
579
|
+
manifest: null,
|
|
580
|
+
prompt: null,
|
|
581
|
+
promptLog: null,
|
|
582
|
+
goal: null,
|
|
583
|
+
brief: null,
|
|
584
|
+
outcome: null,
|
|
585
|
+
reviewLedger: null,
|
|
586
|
+
memlog: null,
|
|
587
|
+
errors: [],
|
|
588
|
+
};
|
|
589
|
+
const record = (key, parse) => {
|
|
590
|
+
const known = readKnown(taskDir, KNOWN_FILES[key]);
|
|
591
|
+
result[`${key}Exists`] = known.exists;
|
|
592
|
+
if (!known.exists) return;
|
|
593
|
+
if (known.error) {
|
|
594
|
+
result.errors.push({ path: `${slug}/${KNOWN_FILES[key]}`, reason: known.error });
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
try {
|
|
598
|
+
result[key] = parse(known.text);
|
|
599
|
+
} catch (error) {
|
|
600
|
+
result.errors.push({ path: `${slug}/${KNOWN_FILES[key]}`, reason: error.message });
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
record('status', parseStatusJson);
|
|
604
|
+
record('pipeline', parsePipelineJson);
|
|
605
|
+
record('metrics', parseMetricsJson);
|
|
606
|
+
record('manifest', parseArtifactManifestJson);
|
|
607
|
+
record('goal', (text) => ({ text, title: firstHeading(text) }));
|
|
608
|
+
record('brief', (text) => ({ text, title: firstHeading(text) }));
|
|
609
|
+
record('memlog', (text) => ({ text }));
|
|
610
|
+
|
|
611
|
+
// Prompts carry their own soft errors: a missing fence does not discard the text.
|
|
612
|
+
const promptKnown = readKnown(taskDir, KNOWN_FILES.prompt);
|
|
613
|
+
result.promptExists = promptKnown.exists;
|
|
614
|
+
if (promptKnown.exists) {
|
|
615
|
+
if (promptKnown.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.prompt}`, reason: promptKnown.error });
|
|
616
|
+
else {
|
|
617
|
+
result.prompt = parsePromptMarkdown(promptKnown.text);
|
|
618
|
+
if (result.prompt.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.prompt}`, reason: result.prompt.error });
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const logKnown = readKnown(taskDir, KNOWN_FILES.promptLog);
|
|
622
|
+
result.promptLogExists = logKnown.exists;
|
|
623
|
+
if (logKnown.exists) {
|
|
624
|
+
if (logKnown.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.promptLog}`, reason: logKnown.error });
|
|
625
|
+
else {
|
|
626
|
+
result.promptLog = parsePromptLogMarkdown(logKnown.text);
|
|
627
|
+
for (const message of result.promptLog.errors) {
|
|
628
|
+
result.errors.push({ path: `${slug}/${KNOWN_FILES.promptLog}`, reason: message });
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const outcomeKnown = readKnown(taskDir, KNOWN_FILES.outcome);
|
|
633
|
+
result.outcomeExists = outcomeKnown.exists;
|
|
634
|
+
if (outcomeKnown.exists) {
|
|
635
|
+
if (outcomeKnown.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.outcome}`, reason: outcomeKnown.error });
|
|
636
|
+
else {
|
|
637
|
+
try {
|
|
638
|
+
result.outcome = { ...parseOutcomeMarkdown(outcomeKnown.text), body: outcomeKnown.text };
|
|
639
|
+
} catch (error) {
|
|
640
|
+
result.errors.push({ path: `${slug}/${KNOWN_FILES.outcome}`, reason: error.message });
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const ledgerKnown = readKnown(taskDir, KNOWN_FILES.reviewLedger);
|
|
645
|
+
result.reviewLedgerExists = ledgerKnown.exists;
|
|
646
|
+
if (ledgerKnown.exists) {
|
|
647
|
+
if (ledgerKnown.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.reviewLedger}`, reason: ledgerKnown.error });
|
|
648
|
+
else {
|
|
649
|
+
const ledger = parseReviewLedgerMarkdown(ledgerKnown.text);
|
|
650
|
+
if (ledger.error) result.errors.push({ path: `${slug}/${KNOWN_FILES.reviewLedger}`, reason: ledger.error });
|
|
651
|
+
for (const message of ledger.errors ?? []) {
|
|
652
|
+
result.errors.push({ path: `${slug}/${KNOWN_FILES.reviewLedger}`, reason: message });
|
|
653
|
+
}
|
|
654
|
+
result.reviewLedger = ledger;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return result;
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
const normalizeEvent = (event, index, slug) => {
|
|
661
|
+
if (!isRecord(event)) {
|
|
662
|
+
return {
|
|
663
|
+
eventId: `${slug}:event:${index}`,
|
|
664
|
+
seq: index,
|
|
665
|
+
type: 'unknown',
|
|
666
|
+
at: null,
|
|
667
|
+
payloadJson: canonicalJson(event ?? null),
|
|
668
|
+
malformed: 'event is not an object',
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
const type = typeof event.type === 'string' && event.type !== '' ? event.type : 'unknown';
|
|
672
|
+
return {
|
|
673
|
+
eventId: typeof event.eventId === 'string' && event.eventId !== '' ? event.eventId : `${slug}:event:${index}`,
|
|
674
|
+
seq: index,
|
|
675
|
+
type,
|
|
676
|
+
at: isoTimestamp(event.at),
|
|
677
|
+
attemptId: typeof event.attemptId === 'string' ? event.attemptId : null,
|
|
678
|
+
stepIndex: integerOrNull(event.stepIndex),
|
|
679
|
+
stepLabel: typeof event.stepLabel === 'string' ? event.stepLabel : null,
|
|
680
|
+
agent: typeof event.agent === 'string' ? event.agent : null,
|
|
681
|
+
role: typeof event.role === 'string' ? event.role : null,
|
|
682
|
+
attemptNo: integerOrNull(event.attempt),
|
|
683
|
+
outcome: typeof event.outcome === 'string' ? event.outcome : null,
|
|
684
|
+
gateStartedEventId: typeof event.gateStartedEventId === 'string' ? event.gateStartedEventId : null,
|
|
685
|
+
waveId: typeof event.waveId === 'string' ? event.waveId : null,
|
|
686
|
+
parallelGroupId: typeof event.parallelGroupId === 'string' ? event.parallelGroupId : null,
|
|
687
|
+
durationMs: positiveDurationOrNull(event.durationMs),
|
|
688
|
+
source: typeof event.source === 'string' ? event.source : null,
|
|
689
|
+
attributionConfidence:
|
|
690
|
+
typeof event.attributionConfidence === 'string' ? event.attributionConfidence : null,
|
|
691
|
+
payloadJson: canonicalJson(event),
|
|
692
|
+
known: EVENT_TYPES.has(type),
|
|
693
|
+
malformed: null,
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
const attemptSuffix = (attemptId) => {
|
|
698
|
+
const match = /:attempt-(\d+)$/.exec(attemptId || '');
|
|
699
|
+
return match ? Number(match[1]) : null;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
export function deriveAttempts(events, status) {
|
|
703
|
+
const attempts = new Map();
|
|
704
|
+
const ensure = (attemptId) => {
|
|
705
|
+
if (!attempts.has(attemptId)) {
|
|
706
|
+
attempts.set(attemptId, {
|
|
707
|
+
attemptId,
|
|
708
|
+
stepIndex: null,
|
|
709
|
+
stepLabel: null,
|
|
710
|
+
agent: null,
|
|
711
|
+
role: null,
|
|
712
|
+
attemptNo: attemptSuffix(attemptId),
|
|
713
|
+
waveId: null,
|
|
714
|
+
parallelGroupId: null,
|
|
715
|
+
startedAt: null,
|
|
716
|
+
finishedAt: null,
|
|
717
|
+
durationMs: null,
|
|
718
|
+
outcome: null,
|
|
719
|
+
source: 'metrics',
|
|
720
|
+
attributionConfidence: null,
|
|
721
|
+
isCurrent: 0,
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
return attempts.get(attemptId);
|
|
725
|
+
};
|
|
726
|
+
for (const event of events) {
|
|
727
|
+
if (!event.attemptId) continue;
|
|
728
|
+
const row = ensure(event.attemptId);
|
|
729
|
+
row.stepIndex = event.stepIndex ?? row.stepIndex;
|
|
730
|
+
row.stepLabel = event.stepLabel ?? row.stepLabel;
|
|
731
|
+
row.agent = event.agent ?? row.agent;
|
|
732
|
+
row.role = event.role ?? row.role;
|
|
733
|
+
row.attemptNo = event.attemptNo ?? row.attemptNo;
|
|
734
|
+
row.waveId = event.waveId ?? row.waveId;
|
|
735
|
+
row.parallelGroupId = event.parallelGroupId ?? row.parallelGroupId;
|
|
736
|
+
row.source = event.source ?? row.source;
|
|
737
|
+
row.attributionConfidence = event.attributionConfidence ?? row.attributionConfidence;
|
|
738
|
+
if (event.type === 'attempt_started') {
|
|
739
|
+
row.startedAt = event.at ?? row.startedAt;
|
|
740
|
+
} else if (event.type === 'attempt_finished') {
|
|
741
|
+
row.finishedAt = event.at ?? row.finishedAt;
|
|
742
|
+
row.durationMs = event.durationMs ?? row.durationMs;
|
|
743
|
+
row.outcome = event.outcome ?? row.outcome;
|
|
744
|
+
} else if (event.type === 'attempt_skipped') {
|
|
745
|
+
row.outcome = 'skipped';
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
const active = isRecord(status?.activeAttempts) ? status.activeAttempts : {};
|
|
749
|
+
for (const [attemptId, value] of Object.entries(active)) {
|
|
750
|
+
const row = ensure(attemptId);
|
|
751
|
+
row.isCurrent = 1;
|
|
752
|
+
if (!isRecord(value)) continue;
|
|
753
|
+
row.stepIndex = integerOrNull(value.stepIndex) ?? row.stepIndex;
|
|
754
|
+
row.agent = typeof value.agent === 'string' ? value.agent : row.agent;
|
|
755
|
+
row.attemptNo = integerOrNull(value.attempt) ?? row.attemptNo;
|
|
756
|
+
row.waveId = typeof value.waveId === 'string' ? value.waveId : row.waveId;
|
|
757
|
+
row.parallelGroupId = typeof value.parallelGroupId === 'string' ? value.parallelGroupId : row.parallelGroupId;
|
|
758
|
+
row.startedAt = isoTimestamp(value.startedAt) ?? row.startedAt;
|
|
759
|
+
row.source = row.startedAt && !row.finishedAt ? 'status' : row.source;
|
|
760
|
+
}
|
|
761
|
+
return [...attempts.values()];
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
export function deriveGates(events) {
|
|
765
|
+
const gates = new Map();
|
|
766
|
+
for (const event of events) {
|
|
767
|
+
if (event.type === 'human_gate_started') {
|
|
768
|
+
gates.set(event.eventId, {
|
|
769
|
+
startEventId: event.eventId,
|
|
770
|
+
startedAt: event.at,
|
|
771
|
+
endEventId: null,
|
|
772
|
+
endedAt: null,
|
|
773
|
+
durationMs: null,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
for (const event of events) {
|
|
778
|
+
if (event.type !== 'human_gate_ended') continue;
|
|
779
|
+
const gate = event.gateStartedEventId ? gates.get(event.gateStartedEventId) : null;
|
|
780
|
+
if (!gate) continue;
|
|
781
|
+
gate.endEventId = event.eventId;
|
|
782
|
+
gate.endedAt = event.at;
|
|
783
|
+
if (gate.startedAt && gate.endedAt) {
|
|
784
|
+
const duration = Date.parse(gate.endedAt) - Date.parse(gate.startedAt);
|
|
785
|
+
gate.durationMs = Number.isFinite(duration) && duration >= 0 ? duration : null;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return [...gates.values()];
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const deriveTaskTimes = (events) => {
|
|
792
|
+
let startAt = null;
|
|
793
|
+
let endAt = null;
|
|
794
|
+
for (const event of events) {
|
|
795
|
+
if (event.type === 'task_started' && event.at && !startAt) startAt = event.at;
|
|
796
|
+
if (event.type === 'task_completed' && event.at) endAt = event.at;
|
|
797
|
+
}
|
|
798
|
+
return { startAt, endAt };
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
const pipelineAgents = (step) => {
|
|
802
|
+
if (Array.isArray(step.agent)) return step.agent.filter((agent) => typeof agent === 'string' && agent !== '');
|
|
803
|
+
return typeof step.agent === 'string' && step.agent !== '' ? [step.agent] : [];
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
const normalizePipeline = (pipeline) => {
|
|
807
|
+
const steps = Array.isArray(pipeline.steps) ? pipeline.steps : [];
|
|
808
|
+
return {
|
|
809
|
+
values: {
|
|
810
|
+
intent: typeof pipeline.intent === 'string' ? pipeline.intent : null,
|
|
811
|
+
profile: typeof pipeline.profile === 'string' ? pipeline.profile : null,
|
|
812
|
+
specMode: typeof pipeline.specMode === 'string' ? pipeline.specMode : null,
|
|
813
|
+
complexity:
|
|
814
|
+
typeof pipeline.routingDecision?.complexity === 'string' ? pipeline.routingDecision.complexity : null,
|
|
815
|
+
routingSummary: typeof pipeline.summary === 'string' ? pipeline.summary : null,
|
|
816
|
+
routingJson: isRecord(pipeline.routingDecision) ? canonicalJson(pipeline.routingDecision) : null,
|
|
817
|
+
contextBudget: typeof pipeline.contextBudget === 'string' ? pipeline.contextBudget : null,
|
|
818
|
+
planRevision:
|
|
819
|
+
pipeline.planRevision === undefined || pipeline.planRevision === null
|
|
820
|
+
? null
|
|
821
|
+
: String(pipeline.planRevision),
|
|
822
|
+
stepCount: steps.length,
|
|
823
|
+
},
|
|
824
|
+
steps: steps.map((rawStep, index) => {
|
|
825
|
+
const step = isRecord(rawStep) ? rawStep : {};
|
|
826
|
+
return {
|
|
827
|
+
stepIndex: index,
|
|
828
|
+
label: typeof step.label === 'string' ? step.label : null,
|
|
829
|
+
scope: typeof step.scope === 'string' ? step.scope : null,
|
|
830
|
+
model: typeof step.model === 'string' ? step.model : null,
|
|
831
|
+
skipIf: typeof step.skipIf === 'string' ? step.skipIf : typeof step.skip_if === 'string' ? step.skip_if : null,
|
|
832
|
+
parallel: booleanFlag(step.parallel),
|
|
833
|
+
dependsOnJson: step.dependsOn === undefined ? null : canonicalJson(step.dependsOn),
|
|
834
|
+
taskIdsJson: step.taskIds === undefined ? null : canonicalJson(step.taskIds),
|
|
835
|
+
writeScopesJson: step.writeScopes === undefined ? null : canonicalJson(step.writeScopes),
|
|
836
|
+
agents: pipelineAgents(step),
|
|
837
|
+
};
|
|
838
|
+
}),
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
const normalizeArtifacts = (manifest) => {
|
|
843
|
+
const artifacts = [];
|
|
844
|
+
const skipped = [];
|
|
845
|
+
const seen = new Set();
|
|
846
|
+
for (const [index, entry] of (manifest.artifacts ?? []).entries()) {
|
|
847
|
+
if (!isRecord(entry) || typeof entry.id !== 'string' || entry.id === '') {
|
|
848
|
+
skipped.push(`artifacts[${index}] has no id`);
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
if (seen.has(entry.id)) {
|
|
852
|
+
skipped.push(`artifacts[${index}] duplicates id "${entry.id}"`);
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
seen.add(entry.id);
|
|
856
|
+
const receipt = isRecord(entry.receipt) ? entry.receipt : {};
|
|
857
|
+
const timestamps = isRecord(entry.timestamps) ? entry.timestamps : {};
|
|
858
|
+
artifacts.push({
|
|
859
|
+
artifactId: entry.id,
|
|
860
|
+
producer: typeof entry.producer === 'string' ? entry.producer : null,
|
|
861
|
+
status: typeof entry.status === 'string' ? entry.status : null,
|
|
862
|
+
outcome: typeof receipt.outcome === 'string' ? receipt.outcome : null,
|
|
863
|
+
summary: typeof receipt.summary === 'string' ? receipt.summary : typeof entry.summary === 'string' ? entry.summary : null,
|
|
864
|
+
receiptAttemptId:
|
|
865
|
+
typeof receipt.attemptId === 'string'
|
|
866
|
+
? receipt.attemptId
|
|
867
|
+
: typeof entry.attemptId === 'string'
|
|
868
|
+
? entry.attemptId
|
|
869
|
+
: null,
|
|
870
|
+
createdAt: isoTimestamp(timestamps.createdAt),
|
|
871
|
+
updatedAt: isoTimestamp(timestamps.updatedAt),
|
|
872
|
+
completedAt: isoTimestamp(timestamps.completedAt),
|
|
873
|
+
acIdsJson: canonicalJson(Array.isArray(entry.acceptanceCriteriaIds) ? entry.acceptanceCriteriaIds : []),
|
|
874
|
+
taskIdsJson: canonicalJson(Array.isArray(entry.taskIds) ? entry.taskIds : []),
|
|
875
|
+
authoritative: (Array.isArray(entry.authoritativePaths) ? entry.authoritativePaths : []).filter(
|
|
876
|
+
(value) => typeof value === 'string' && value !== '',
|
|
877
|
+
),
|
|
878
|
+
evidence: (Array.isArray(receipt.evidencePaths) ? receipt.evidencePaths : []).filter(
|
|
879
|
+
(value) => typeof value === 'string' && value !== '',
|
|
880
|
+
),
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
return { artifacts, skipped };
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
const taskTitle = (parsed, slug) =>
|
|
887
|
+
parsed.goal?.title || parsed.brief?.title || parsed.status?.slug || slug;
|
|
888
|
+
|
|
889
|
+
const eventRows = (metrics, slug) =>
|
|
890
|
+
(metrics.events ?? []).map((event, index) => normalizeEvent(event, index, slug));
|
|
891
|
+
|
|
892
|
+
const UPSERT_TASK_SQL = `
|
|
893
|
+
INSERT INTO tasks (
|
|
894
|
+
slug, title, intent, profile, spec_mode, complexity, phase, state, pipeline_index,
|
|
895
|
+
current_agent, awaiting_human_gate, metrics_run_id, routing_summary, routing_json,
|
|
896
|
+
context_budget, plan_revision, step_count, start_at, end_at, updated_at,
|
|
897
|
+
projected_at, last_seen_at, content_hash, file_count, document_bytes,
|
|
898
|
+
parse_error_count, first_seen_at, absent_at
|
|
899
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)
|
|
900
|
+
ON CONFLICT(slug) DO UPDATE SET
|
|
901
|
+
title = COALESCE(excluded.title, tasks.title),
|
|
902
|
+
intent = COALESCE(excluded.intent, tasks.intent),
|
|
903
|
+
profile = COALESCE(excluded.profile, tasks.profile),
|
|
904
|
+
spec_mode = COALESCE(excluded.spec_mode, tasks.spec_mode),
|
|
905
|
+
complexity = COALESCE(excluded.complexity, tasks.complexity),
|
|
906
|
+
phase = COALESCE(excluded.phase, tasks.phase),
|
|
907
|
+
state = COALESCE(excluded.state, tasks.state),
|
|
908
|
+
pipeline_index = COALESCE(excluded.pipeline_index, tasks.pipeline_index),
|
|
909
|
+
current_agent = COALESCE(excluded.current_agent, tasks.current_agent),
|
|
910
|
+
awaiting_human_gate = CASE WHEN ? THEN excluded.awaiting_human_gate ELSE tasks.awaiting_human_gate END,
|
|
911
|
+
metrics_run_id = COALESCE(excluded.metrics_run_id, tasks.metrics_run_id),
|
|
912
|
+
routing_summary = COALESCE(excluded.routing_summary, tasks.routing_summary),
|
|
913
|
+
routing_json = COALESCE(excluded.routing_json, tasks.routing_json),
|
|
914
|
+
context_budget = COALESCE(excluded.context_budget, tasks.context_budget),
|
|
915
|
+
plan_revision = COALESCE(excluded.plan_revision, tasks.plan_revision),
|
|
916
|
+
step_count = COALESCE(excluded.step_count, tasks.step_count),
|
|
917
|
+
start_at = COALESCE(excluded.start_at, tasks.start_at),
|
|
918
|
+
end_at = COALESCE(excluded.end_at, tasks.end_at),
|
|
919
|
+
updated_at = COALESCE(excluded.updated_at, tasks.updated_at),
|
|
920
|
+
projected_at = excluded.projected_at,
|
|
921
|
+
last_seen_at = excluded.last_seen_at,
|
|
922
|
+
content_hash = excluded.content_hash,
|
|
923
|
+
file_count = excluded.file_count,
|
|
924
|
+
document_bytes = excluded.document_bytes,
|
|
925
|
+
parse_error_count = excluded.parse_error_count,
|
|
926
|
+
absent_at = NULL
|
|
927
|
+
`;
|
|
928
|
+
|
|
929
|
+
const upsertTask = (db, row) => {
|
|
930
|
+
db.prepare(UPSERT_TASK_SQL).run(
|
|
931
|
+
row.slug,
|
|
932
|
+
row.title,
|
|
933
|
+
row.intent,
|
|
934
|
+
row.profile,
|
|
935
|
+
row.specMode,
|
|
936
|
+
row.complexity,
|
|
937
|
+
row.phase,
|
|
938
|
+
row.state,
|
|
939
|
+
row.pipelineIndex,
|
|
940
|
+
row.currentAgent,
|
|
941
|
+
row.awaitingHumanGate,
|
|
942
|
+
row.metricsRunId,
|
|
943
|
+
row.routingSummary,
|
|
944
|
+
row.routingJson,
|
|
945
|
+
row.contextBudget,
|
|
946
|
+
row.planRevision,
|
|
947
|
+
row.stepCount,
|
|
948
|
+
row.startAt,
|
|
949
|
+
row.endAt,
|
|
950
|
+
row.updatedAt,
|
|
951
|
+
row.projectedAt,
|
|
952
|
+
row.lastSeenAt,
|
|
953
|
+
row.contentHash,
|
|
954
|
+
row.fileCount,
|
|
955
|
+
row.documentBytes,
|
|
956
|
+
row.parseErrorCount,
|
|
957
|
+
row.firstSeenAt,
|
|
958
|
+
row.statusParsed,
|
|
959
|
+
);
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
const replacePipeline = (db, slug, pipeline) => {
|
|
963
|
+
db.prepare('DELETE FROM pipeline_steps WHERE task_slug = ?').run(slug);
|
|
964
|
+
const stepStatement = db.prepare(
|
|
965
|
+
`INSERT INTO pipeline_steps(
|
|
966
|
+
task_slug, step_index, label, scope, model, skip_if, parallel,
|
|
967
|
+
depends_on_json, task_ids_json, write_scopes_json
|
|
968
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
969
|
+
);
|
|
970
|
+
const agentStatement = db.prepare(
|
|
971
|
+
'INSERT INTO pipeline_step_agents(task_slug, step_index, ordinal, agent) VALUES (?, ?, ?, ?)',
|
|
972
|
+
);
|
|
973
|
+
for (const step of pipeline.steps) {
|
|
974
|
+
stepStatement.run(
|
|
975
|
+
slug,
|
|
976
|
+
step.stepIndex,
|
|
977
|
+
step.label,
|
|
978
|
+
step.scope,
|
|
979
|
+
step.model,
|
|
980
|
+
step.skipIf,
|
|
981
|
+
step.parallel,
|
|
982
|
+
step.dependsOnJson,
|
|
983
|
+
step.taskIdsJson,
|
|
984
|
+
step.writeScopesJson,
|
|
985
|
+
);
|
|
986
|
+
step.agents.forEach((agent, ordinal) => {
|
|
987
|
+
agentStatement.run(slug, step.stepIndex, ordinal, agent);
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
const replaceEvents = (db, slug, events) => {
|
|
993
|
+
db.prepare('DELETE FROM events WHERE task_slug = ?').run(slug);
|
|
994
|
+
const statement = db.prepare(
|
|
995
|
+
`INSERT OR IGNORE INTO events(
|
|
996
|
+
event_id, task_slug, seq, type, at, attempt_id, step_index, step_label, agent, role,
|
|
997
|
+
attempt_no, outcome, gate_started_event_id, wave_id, parallel_group_id, duration_ms,
|
|
998
|
+
source, attribution_confidence, payload_json
|
|
999
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
1000
|
+
);
|
|
1001
|
+
for (const event of events) {
|
|
1002
|
+
statement.run(
|
|
1003
|
+
event.eventId,
|
|
1004
|
+
slug,
|
|
1005
|
+
event.seq,
|
|
1006
|
+
event.type,
|
|
1007
|
+
event.at,
|
|
1008
|
+
event.attemptId,
|
|
1009
|
+
event.stepIndex,
|
|
1010
|
+
event.stepLabel,
|
|
1011
|
+
event.agent,
|
|
1012
|
+
event.role,
|
|
1013
|
+
event.attemptNo,
|
|
1014
|
+
event.outcome,
|
|
1015
|
+
event.gateStartedEventId,
|
|
1016
|
+
event.waveId,
|
|
1017
|
+
event.parallelGroupId,
|
|
1018
|
+
event.durationMs,
|
|
1019
|
+
event.source,
|
|
1020
|
+
event.attributionConfidence,
|
|
1021
|
+
event.payloadJson,
|
|
1022
|
+
);
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
const replaceAttempts = (db, slug, attempts) => {
|
|
1027
|
+
db.prepare('DELETE FROM attempts WHERE task_slug = ?').run(slug);
|
|
1028
|
+
const statement = db.prepare(
|
|
1029
|
+
`INSERT OR IGNORE INTO attempts(
|
|
1030
|
+
attempt_id, task_slug, step_index, step_label, agent, role, attempt_no, wave_id,
|
|
1031
|
+
parallel_group_id, started_at, finished_at, duration_ms, outcome, source,
|
|
1032
|
+
attribution_confidence, is_current
|
|
1033
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
1034
|
+
);
|
|
1035
|
+
for (const attempt of attempts) {
|
|
1036
|
+
statement.run(
|
|
1037
|
+
attempt.attemptId,
|
|
1038
|
+
slug,
|
|
1039
|
+
attempt.stepIndex,
|
|
1040
|
+
attempt.stepLabel,
|
|
1041
|
+
attempt.agent,
|
|
1042
|
+
attempt.role,
|
|
1043
|
+
attempt.attemptNo,
|
|
1044
|
+
attempt.waveId,
|
|
1045
|
+
attempt.parallelGroupId,
|
|
1046
|
+
attempt.startedAt,
|
|
1047
|
+
attempt.finishedAt,
|
|
1048
|
+
attempt.durationMs,
|
|
1049
|
+
attempt.outcome,
|
|
1050
|
+
attempt.source,
|
|
1051
|
+
attempt.attributionConfidence,
|
|
1052
|
+
attempt.isCurrent,
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
const replaceGates = (db, slug, gates) => {
|
|
1058
|
+
db.prepare('DELETE FROM gates WHERE task_slug = ?').run(slug);
|
|
1059
|
+
const statement = db.prepare(
|
|
1060
|
+
'INSERT OR IGNORE INTO gates(start_event_id, task_slug, started_at, end_event_id, ended_at, duration_ms) VALUES (?, ?, ?, ?, ?, ?)',
|
|
1061
|
+
);
|
|
1062
|
+
for (const gate of gates) {
|
|
1063
|
+
statement.run(gate.startEventId, slug, gate.startedAt, gate.endEventId, gate.endedAt, gate.durationMs);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
const replaceArtifacts = (db, slug, artifacts) => {
|
|
1068
|
+
db.prepare('DELETE FROM artifacts WHERE task_slug = ?').run(slug);
|
|
1069
|
+
const artifactStatement = db.prepare(
|
|
1070
|
+
`INSERT INTO artifacts(
|
|
1071
|
+
task_slug, artifact_id, producer, status, outcome, summary, receipt_attempt_id,
|
|
1072
|
+
created_at, updated_at, completed_at, ac_ids_json, task_ids_json
|
|
1073
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
1074
|
+
);
|
|
1075
|
+
const pathStatement = db.prepare(
|
|
1076
|
+
'INSERT INTO artifact_paths(task_slug, artifact_id, kind, ordinal, path) VALUES (?, ?, ?, ?, ?)',
|
|
1077
|
+
);
|
|
1078
|
+
for (const artifact of artifacts) {
|
|
1079
|
+
artifactStatement.run(
|
|
1080
|
+
slug,
|
|
1081
|
+
artifact.artifactId,
|
|
1082
|
+
artifact.producer,
|
|
1083
|
+
artifact.status,
|
|
1084
|
+
artifact.outcome,
|
|
1085
|
+
artifact.summary,
|
|
1086
|
+
artifact.receiptAttemptId,
|
|
1087
|
+
artifact.createdAt,
|
|
1088
|
+
artifact.updatedAt,
|
|
1089
|
+
artifact.completedAt,
|
|
1090
|
+
artifact.acIdsJson,
|
|
1091
|
+
artifact.taskIdsJson,
|
|
1092
|
+
);
|
|
1093
|
+
artifact.authoritative.forEach((value, ordinal) => {
|
|
1094
|
+
pathStatement.run(slug, artifact.artifactId, 'authoritative', ordinal, value);
|
|
1095
|
+
});
|
|
1096
|
+
artifact.evidence.forEach((value, ordinal) => {
|
|
1097
|
+
pathStatement.run(slug, artifact.artifactId, 'evidence', ordinal, value);
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
const replacePrompts = (db, slug, parsed) => {
|
|
1103
|
+
db.prepare('DELETE FROM prompts WHERE task_slug = ?').run(slug);
|
|
1104
|
+
const statement = db.prepare(
|
|
1105
|
+
`INSERT INTO prompts(task_slug, seq, source, command, captured_at, language, content, sha256, bytes)
|
|
1106
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
1107
|
+
);
|
|
1108
|
+
const insert = (seq, entry) => {
|
|
1109
|
+
statement.run(
|
|
1110
|
+
slug,
|
|
1111
|
+
seq,
|
|
1112
|
+
entry.source ?? null,
|
|
1113
|
+
entry.command ?? null,
|
|
1114
|
+
entry.capturedAt ?? null,
|
|
1115
|
+
entry.language ?? null,
|
|
1116
|
+
entry.content,
|
|
1117
|
+
sha256(entry.content),
|
|
1118
|
+
Buffer.byteLength(entry.content, 'utf8'),
|
|
1119
|
+
);
|
|
1120
|
+
};
|
|
1121
|
+
if (parsed.prompt) {
|
|
1122
|
+
insert(0, {
|
|
1123
|
+
source: parsed.prompt.meta.source ?? 'user',
|
|
1124
|
+
command: parsed.prompt.meta.command ?? null,
|
|
1125
|
+
capturedAt: isoTimestamp(parsed.prompt.meta.capturedAt),
|
|
1126
|
+
language: parsed.prompt.meta.language ?? null,
|
|
1127
|
+
content: parsed.prompt.content,
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
for (const entry of parsed.promptLog?.entries ?? []) {
|
|
1131
|
+
if (entry.seq === 0) continue;
|
|
1132
|
+
insert(entry.seq, entry);
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
const replaceOutcome = (db, slug, outcome) => {
|
|
1137
|
+
if (!outcome) {
|
|
1138
|
+
db.prepare('DELETE FROM outcomes WHERE task_slug = ?').run(slug);
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
db.prepare(
|
|
1142
|
+
`INSERT INTO outcomes(
|
|
1143
|
+
task_slug, goal_achieved, value, review_total, review_fair, review_rejected,
|
|
1144
|
+
review_open, review_rework, body, sha256
|
|
1145
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
1146
|
+
ON CONFLICT(task_slug) DO UPDATE SET
|
|
1147
|
+
goal_achieved = excluded.goal_achieved,
|
|
1148
|
+
value = excluded.value,
|
|
1149
|
+
review_total = excluded.review_total,
|
|
1150
|
+
review_fair = excluded.review_fair,
|
|
1151
|
+
review_rejected = excluded.review_rejected,
|
|
1152
|
+
review_open = excluded.review_open,
|
|
1153
|
+
review_rework = excluded.review_rework,
|
|
1154
|
+
body = excluded.body,
|
|
1155
|
+
sha256 = excluded.sha256`,
|
|
1156
|
+
).run(
|
|
1157
|
+
slug,
|
|
1158
|
+
outcome.goalAchieved,
|
|
1159
|
+
outcome.value,
|
|
1160
|
+
outcome.reviewTotal,
|
|
1161
|
+
outcome.reviewFair,
|
|
1162
|
+
outcome.reviewRejected,
|
|
1163
|
+
outcome.reviewOpen,
|
|
1164
|
+
outcome.reviewRework,
|
|
1165
|
+
outcome.body,
|
|
1166
|
+
sha256(outcome.body),
|
|
1167
|
+
);
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
const replaceReviewLedger = (db, slug, ledger) => {
|
|
1171
|
+
db.prepare('DELETE FROM review_ledger WHERE task_slug = ?').run(slug);
|
|
1172
|
+
if (!ledger) return;
|
|
1173
|
+
const statement = db.prepare(
|
|
1174
|
+
`INSERT INTO review_ledger(task_slug, row_id, at, source, summary, fair, disposition, evidence, signature)
|
|
1175
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
1176
|
+
);
|
|
1177
|
+
for (const row of ledger.rows) {
|
|
1178
|
+
statement.run(slug, row.id, row.at, row.source, row.summary, row.fair, row.disposition, row.evidence, row.signature);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
const upsertDocuments = (db, slug, files, projectedAt) => {
|
|
1183
|
+
const existing = new Set(
|
|
1184
|
+
db.prepare('SELECT path FROM documents WHERE task_slug = ?').all(slug).map((row) => row.path),
|
|
1185
|
+
);
|
|
1186
|
+
const statement = db.prepare(
|
|
1187
|
+
`INSERT INTO documents(
|
|
1188
|
+
task_slug, path, sha256, bytes, media_type, is_text, content, content_omitted,
|
|
1189
|
+
parse_error, projected_at
|
|
1190
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
1191
|
+
ON CONFLICT(task_slug, path) DO UPDATE SET
|
|
1192
|
+
sha256 = excluded.sha256,
|
|
1193
|
+
bytes = excluded.bytes,
|
|
1194
|
+
media_type = excluded.media_type,
|
|
1195
|
+
is_text = excluded.is_text,
|
|
1196
|
+
content = CASE WHEN documents.sha256 = excluded.sha256 THEN documents.content ELSE excluded.content END,
|
|
1197
|
+
content_omitted = CASE
|
|
1198
|
+
WHEN documents.sha256 = excluded.sha256 AND documents.content_omitted = 'retention' THEN 'retention'
|
|
1199
|
+
ELSE excluded.content_omitted
|
|
1200
|
+
END,
|
|
1201
|
+
parse_error = excluded.parse_error,
|
|
1202
|
+
projected_at = excluded.projected_at`,
|
|
1203
|
+
);
|
|
1204
|
+
for (const file of files) {
|
|
1205
|
+
const document = readDocument(file);
|
|
1206
|
+
statement.run(
|
|
1207
|
+
slug,
|
|
1208
|
+
file.path,
|
|
1209
|
+
file.sha256,
|
|
1210
|
+
file.bytes,
|
|
1211
|
+
document.mediaType,
|
|
1212
|
+
document.isText,
|
|
1213
|
+
document.content,
|
|
1214
|
+
document.contentOmitted,
|
|
1215
|
+
document.parseError,
|
|
1216
|
+
projectedAt,
|
|
1217
|
+
);
|
|
1218
|
+
existing.delete(file.path);
|
|
1219
|
+
}
|
|
1220
|
+
for (const stale of existing) {
|
|
1221
|
+
db.prepare('DELETE FROM documents WHERE task_slug = ? AND path = ?').run(slug, stale);
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
const setDocumentError = (db, slug, filePath, reason) => {
|
|
1226
|
+
db.prepare('UPDATE documents SET parse_error = ? WHERE task_slug = ? AND path = ?').run(reason, slug, filePath);
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
const rebuildSearch = (db, slug, parsed, files) => {
|
|
1230
|
+
db.prepare('DELETE FROM search_fts WHERE task_slug = ?').run(slug);
|
|
1231
|
+
const insert = db.prepare(
|
|
1232
|
+
'INSERT INTO search_fts(task_slug, doc_path, kind, body) VALUES (?, ?, ?, ?)',
|
|
1233
|
+
);
|
|
1234
|
+
const titles = [parsed.goal?.title, parsed.brief?.title].filter(Boolean);
|
|
1235
|
+
const artifactText =
|
|
1236
|
+
parsed.manifest?.artifacts
|
|
1237
|
+
?.map((entry) => `${entry.id ?? ''} ${entry.receipt?.summary ?? entry.summary ?? ''} ${(entry.acceptanceCriteriaIds ?? []).join(' ')}`)
|
|
1238
|
+
.join('\n') ?? '';
|
|
1239
|
+
insert.run(slug, '', 'task', [slug, ...titles, artifactText].join('\n'));
|
|
1240
|
+
for (const file of files) {
|
|
1241
|
+
const document = readDocument(file);
|
|
1242
|
+
if (!document.content) continue;
|
|
1243
|
+
insert.run(slug, file.path, 'document', document.content);
|
|
1244
|
+
}
|
|
1245
|
+
if (parsed.prompt) insert.run(slug, 'prompt.md', 'prompt', parsed.prompt.content);
|
|
1246
|
+
for (const entry of parsed.promptLog?.entries ?? []) {
|
|
1247
|
+
insert.run(slug, `prompt-log.md#${entry.seq}`, 'prompt', entry.content);
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1251
|
+
const projectTask = ({ db, teamRoot, slug, now, searchMode, deadlineAt }) => {
|
|
1252
|
+
const taskDir = path.join(teamRoot, 'tasks', slug);
|
|
1253
|
+
const files = walkTaskDirectory(taskDir, deadlineAt);
|
|
1254
|
+
const contentHash = taskContentHash(files);
|
|
1255
|
+
const existing = db.prepare('SELECT content_hash, absent_at FROM tasks WHERE slug = ?').get(slug);
|
|
1256
|
+
if (existing && existing.content_hash === contentHash && existing.absent_at === null) {
|
|
1257
|
+
db.prepare('UPDATE tasks SET last_seen_at = ? WHERE slug = ?').run(now, slug);
|
|
1258
|
+
return { status: 'unchanged', errors: [] };
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
const parsed = parseKnown(taskDir, slug);
|
|
1262
|
+
const errors = [...parsed.errors];
|
|
1263
|
+
const metrics = parsed.metrics ? eventRows(parsed.metrics, slug) : null;
|
|
1264
|
+
const pipeline = parsed.pipeline ? normalizePipeline(parsed.pipeline) : null;
|
|
1265
|
+
const artifacts = parsed.manifest ? normalizeArtifacts(parsed.manifest) : null;
|
|
1266
|
+
for (const skipped of artifacts?.skipped ?? []) {
|
|
1267
|
+
errors.push({ path: `${slug}/${KNOWN_FILES.manifest}`, reason: skipped });
|
|
1268
|
+
}
|
|
1269
|
+
const attempts = metrics ? deriveAttempts(metrics, parsed.status) : null;
|
|
1270
|
+
const gates = metrics ? deriveGates(metrics) : null;
|
|
1271
|
+
const times = metrics ? deriveTaskTimes(metrics) : null;
|
|
1272
|
+
const documentBytes = files.reduce((sum, file) => sum + (file.bytes ?? 0), 0);
|
|
1273
|
+
|
|
1274
|
+
db.exec('BEGIN IMMEDIATE');
|
|
1275
|
+
try {
|
|
1276
|
+
upsertTask(db, {
|
|
1277
|
+
slug,
|
|
1278
|
+
title: taskTitle(parsed, slug),
|
|
1279
|
+
intent: pipeline?.values.intent ?? parsed.status?.intent ?? null,
|
|
1280
|
+
profile: pipeline?.values.profile ?? parsed.status?.profile ?? null,
|
|
1281
|
+
specMode: pipeline?.values.specMode ?? null,
|
|
1282
|
+
complexity: pipeline?.values.complexity ?? null,
|
|
1283
|
+
phase: parsed.status?.phase ?? null,
|
|
1284
|
+
state: parsed.status?.state ?? null,
|
|
1285
|
+
pipelineIndex: integerOrNull(parsed.status?.pipelineIndex),
|
|
1286
|
+
currentAgent: parsed.status?.currentAgent ?? null,
|
|
1287
|
+
awaitingHumanGate: booleanFlag(parsed.status?.awaitingHumanGate),
|
|
1288
|
+
metricsRunId: parsed.status?.metricsRunId ?? parsed.metrics?.task?.runId ?? null,
|
|
1289
|
+
routingSummary: pipeline?.values.routingSummary ?? null,
|
|
1290
|
+
routingJson: pipeline?.values.routingJson ?? null,
|
|
1291
|
+
contextBudget: pipeline?.values.contextBudget ?? null,
|
|
1292
|
+
planRevision: pipeline?.values.planRevision ?? null,
|
|
1293
|
+
stepCount: pipeline?.values.stepCount ?? null,
|
|
1294
|
+
startAt: times?.startAt ?? null,
|
|
1295
|
+
endAt: times?.endAt ?? null,
|
|
1296
|
+
updatedAt: isoTimestamp(parsed.status?.updatedAt),
|
|
1297
|
+
projectedAt: now,
|
|
1298
|
+
lastSeenAt: now,
|
|
1299
|
+
contentHash,
|
|
1300
|
+
fileCount: files.length,
|
|
1301
|
+
documentBytes,
|
|
1302
|
+
parseErrorCount: errors.length,
|
|
1303
|
+
firstSeenAt: now,
|
|
1304
|
+
statusParsed: parsed.status ? 1 : 0,
|
|
1305
|
+
});
|
|
1306
|
+
if (pipeline) replacePipeline(db, slug, pipeline);
|
|
1307
|
+
if (metrics) {
|
|
1308
|
+
replaceEvents(db, slug, metrics);
|
|
1309
|
+
replaceAttempts(db, slug, attempts);
|
|
1310
|
+
replaceGates(db, slug, gates);
|
|
1311
|
+
}
|
|
1312
|
+
if (artifacts) replaceArtifacts(db, slug, artifacts.artifacts);
|
|
1313
|
+
replacePrompts(db, slug, parsed);
|
|
1314
|
+
if (parsed.outcome || !parsed.outcomeExists) replaceOutcome(db, slug, parsed.outcome);
|
|
1315
|
+
if (parsed.reviewLedger || !parsed.reviewLedgerExists) replaceReviewLedger(db, slug, parsed.reviewLedger);
|
|
1316
|
+
upsertDocuments(db, slug, files, now);
|
|
1317
|
+
for (const error of errors) {
|
|
1318
|
+
const relative = error.path.startsWith(`${slug}/`) ? error.path.slice(slug.length + 1) : null;
|
|
1319
|
+
if (relative) setDocumentError(db, slug, relative, error.reason);
|
|
1320
|
+
}
|
|
1321
|
+
if (searchMode === SEARCH_MODE_FTS5) rebuildSearch(db, slug, parsed, files);
|
|
1322
|
+
db.exec('COMMIT');
|
|
1323
|
+
} catch (error) {
|
|
1324
|
+
try {
|
|
1325
|
+
db.exec('ROLLBACK');
|
|
1326
|
+
} catch {
|
|
1327
|
+
/* the transaction may already be gone; the original error is the finding */
|
|
1328
|
+
}
|
|
1329
|
+
throw error;
|
|
1330
|
+
}
|
|
1331
|
+
return { status: existing ? 'updated' : 'inserted', errors };
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
/* --------------------------- search and lifecycle -------------------------- */
|
|
1335
|
+
|
|
1336
|
+
const escapeLike = (value) => value.replace(/[\\%_]/g, '\\$&');
|
|
1337
|
+
|
|
1338
|
+
// A punctuation-only token (`'`, `--`) becomes an empty FTS phrase and matched
|
|
1339
|
+
// every row. Keep only tokens with a letter or digit; if none remain the search
|
|
1340
|
+
// is empty, not "no filter".
|
|
1341
|
+
const ftsTokens = (query) => query.split(/\s+/).filter((token) => /[\p{L}\p{N}]/u.test(token));
|
|
1342
|
+
|
|
1343
|
+
const toFtsQuery = (tokens) =>
|
|
1344
|
+
tokens
|
|
1345
|
+
.map((token) => `"${token.replace(/"/g, '""')}"`)
|
|
1346
|
+
.join(' AND ');
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Minimal search used by the WP2 suite and reusable by the query layer: FTS5
|
|
1350
|
+
* `MATCH` when available, escaped `LIKE` otherwise. Never builds SQL from input.
|
|
1351
|
+
*/
|
|
1352
|
+
export function searchProjection(db, query, options = {}) {
|
|
1353
|
+
if (typeof query !== 'string' || query.trim() === '') return [];
|
|
1354
|
+
const tokens = ftsTokens(query);
|
|
1355
|
+
if (tokens.length === 0) return [];
|
|
1356
|
+
const limit = Number.isFinite(options.limit) ? Math.max(1, Math.min(200, options.limit)) : 50;
|
|
1357
|
+
const mode = options.mode ?? readSearchMode(db);
|
|
1358
|
+
if (mode === SEARCH_MODE_FTS5) {
|
|
1359
|
+
try {
|
|
1360
|
+
const rows = db
|
|
1361
|
+
.prepare(
|
|
1362
|
+
`SELECT task_slug AS taskSlug, doc_path, kind,
|
|
1363
|
+
snippet(search_fts, 3, '', '', '…', 12) AS snippet
|
|
1364
|
+
FROM search_fts
|
|
1365
|
+
WHERE search_fts MATCH ?
|
|
1366
|
+
ORDER BY rank
|
|
1367
|
+
LIMIT ?`,
|
|
1368
|
+
)
|
|
1369
|
+
.all(toFtsQuery(tokens), limit)
|
|
1370
|
+
.map((row) => ({ ...row }));
|
|
1371
|
+
// An index created after the tree was already projected is empty until a
|
|
1372
|
+
// task changes; the LIKE path keeps search correct in that window.
|
|
1373
|
+
if (rows.length > 0) return rows;
|
|
1374
|
+
} catch {
|
|
1375
|
+
/* an FTS syntax edge falls through to LIKE instead of failing the query */
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
const pattern = `%${escapeLike(query)}%`;
|
|
1379
|
+
return db
|
|
1380
|
+
.prepare(
|
|
1381
|
+
`SELECT task_slug AS taskSlug, path AS doc_path, 'document' AS kind, substr(content, 1, 200) AS snippet
|
|
1382
|
+
FROM documents
|
|
1383
|
+
WHERE content LIKE ? ESCAPE '\\'
|
|
1384
|
+
UNION ALL
|
|
1385
|
+
SELECT task_slug AS taskSlug, 'prompt.md' AS doc_path, 'prompt' AS kind, substr(content, 1, 200) AS snippet
|
|
1386
|
+
FROM prompts
|
|
1387
|
+
WHERE content LIKE ? ESCAPE '\\'
|
|
1388
|
+
LIMIT ?`,
|
|
1389
|
+
)
|
|
1390
|
+
.all(pattern, pattern, limit)
|
|
1391
|
+
.map((row) => ({ ...row }));
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
const hasSearchTable = (db) =>
|
|
1395
|
+
Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'search_fts'").get());
|
|
1396
|
+
|
|
1397
|
+
const markAbsent = (db, slug, at) =>
|
|
1398
|
+
db.prepare('UPDATE tasks SET absent_at = ? WHERE slug = ? AND absent_at IS NULL').run(at, slug).changes;
|
|
1399
|
+
|
|
1400
|
+
const maintainDatabase = (db, now) => {
|
|
1401
|
+
const retentionCutoff = new Date(Date.now() - RETENTION_DAYS * 24 * 60 * 60 * 1000).toISOString();
|
|
1402
|
+
const staleCutoff = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
1403
|
+
const absent = db
|
|
1404
|
+
.prepare('SELECT slug FROM tasks WHERE absent_at IS NOT NULL AND absent_at < ?')
|
|
1405
|
+
.all(retentionCutoff);
|
|
1406
|
+
let retained = 0;
|
|
1407
|
+
for (const row of absent) {
|
|
1408
|
+
const changed = db
|
|
1409
|
+
.prepare(
|
|
1410
|
+
"UPDATE documents SET content = NULL, content_omitted = 'retention' WHERE task_slug = ? AND content IS NOT NULL",
|
|
1411
|
+
)
|
|
1412
|
+
.run(row.slug).changes;
|
|
1413
|
+
if (hasSearchTable(db)) db.prepare('DELETE FROM search_fts WHERE task_slug = ?').run(row.slug);
|
|
1414
|
+
if (changed > 0) retained += 1;
|
|
1415
|
+
}
|
|
1416
|
+
db.prepare(
|
|
1417
|
+
`DELETE FROM sync_runs WHERE run_id NOT IN (
|
|
1418
|
+
SELECT run_id FROM sync_runs ORDER BY run_id DESC LIMIT ?
|
|
1419
|
+
)`,
|
|
1420
|
+
).run(SYNC_RUN_RETENTION);
|
|
1421
|
+
db.prepare('DELETE FROM sync_runs WHERE finished_at IS NULL AND started_at < ?').run(staleCutoff);
|
|
1422
|
+
return { retained, now };
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
const updateRun = (db, runId, result) => {
|
|
1426
|
+
db.prepare(
|
|
1427
|
+
`UPDATE sync_runs SET finished_at = ?, inserted = ?, updated = ?, unchanged = ?, failed = ?,
|
|
1428
|
+
absent = ?, pruned = ?, rebuilt = ?, exit_code = ?, error = ? WHERE run_id = ?`,
|
|
1429
|
+
).run(
|
|
1430
|
+
new Date().toISOString(),
|
|
1431
|
+
result.inserted,
|
|
1432
|
+
result.updated,
|
|
1433
|
+
result.unchanged,
|
|
1434
|
+
result.failed,
|
|
1435
|
+
result.absent,
|
|
1436
|
+
result.pruned,
|
|
1437
|
+
result.rebuilt,
|
|
1438
|
+
result.exitCode,
|
|
1439
|
+
result.error ?? null,
|
|
1440
|
+
runId,
|
|
1441
|
+
);
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
const resolveDeadline = (deadlineMs, slug) => {
|
|
1445
|
+
if (deadlineMs === null || deadlineMs === undefined || deadlineMs === '') {
|
|
1446
|
+
return Number.isFinite(defaultDeadline(slug)) ? Date.now() + defaultDeadline(slug) : Infinity;
|
|
1447
|
+
}
|
|
1448
|
+
const parsed = Number(deadlineMs);
|
|
1449
|
+
if (!Number.isFinite(parsed) || parsed < 0) teamDbFail('E_USAGE', '--deadline-ms must be a non-negative number', 3);
|
|
1450
|
+
return parsed === 0 ? Infinity : Date.now() + parsed;
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
const defaultDeadline = (slug) => (slug ? DEFAULT_SLUG_DEADLINE_MS : Infinity);
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Project a tree (or one slug) into the database.
|
|
1457
|
+
*
|
|
1458
|
+
* Returns the `SyncResult` shape; throws `TeamDbError` for database-level
|
|
1459
|
+
* failures, usage errors, and deadline expiry.
|
|
1460
|
+
*/
|
|
1461
|
+
export function syncProjection(options = {}) {
|
|
1462
|
+
const slug = options.slug ?? null;
|
|
1463
|
+
const maintain = Boolean(options.maintain || options.vacuum);
|
|
1464
|
+
const prune = Boolean(options.prune);
|
|
1465
|
+
const vacuum = Boolean(options.vacuum);
|
|
1466
|
+
if (slug && (prune || vacuum || options.maintain)) {
|
|
1467
|
+
teamDbFail('E_USAGE', '--maintain, --prune and --vacuum cannot be combined with --slug', 3);
|
|
1468
|
+
}
|
|
1469
|
+
const deadlineAt = resolveDeadline(options.deadlineMs, slug);
|
|
1470
|
+
const startedAt = new Date().toISOString();
|
|
1471
|
+
const handle = openTeamDb({
|
|
1472
|
+
teamRoot: options.teamRoot,
|
|
1473
|
+
dbPath: options.dbPath,
|
|
1474
|
+
rebuild: options.rebuild,
|
|
1475
|
+
noRebuild: options.noRebuild,
|
|
1476
|
+
searchMode: options.searchMode,
|
|
1477
|
+
env: options.env,
|
|
1478
|
+
});
|
|
1479
|
+
const { db } = handle;
|
|
1480
|
+
const result = {
|
|
1481
|
+
mode: slug ? 'slug' : 'full',
|
|
1482
|
+
startedAt,
|
|
1483
|
+
inserted: 0,
|
|
1484
|
+
updated: 0,
|
|
1485
|
+
unchanged: 0,
|
|
1486
|
+
failed: 0,
|
|
1487
|
+
absent: 0,
|
|
1488
|
+
pruned: 0,
|
|
1489
|
+
retained: 0,
|
|
1490
|
+
rebuilt: handle.rebuilt ? 1 : 0,
|
|
1491
|
+
exitCode: 0,
|
|
1492
|
+
errors: [],
|
|
1493
|
+
error: null,
|
|
1494
|
+
};
|
|
1495
|
+
const run = (() => {
|
|
1496
|
+
try {
|
|
1497
|
+
return db
|
|
1498
|
+
.prepare('INSERT INTO sync_runs(mode, started_at, rebuilt) VALUES (?, ?, ?)')
|
|
1499
|
+
.run(result.mode, startedAt, result.rebuilt);
|
|
1500
|
+
} catch (error) {
|
|
1501
|
+
db.close();
|
|
1502
|
+
if (isBusyError(error)) teamDbFail('E_DB_BUSY', `${handle.dbPath}: ${error.message}`, 2);
|
|
1503
|
+
if (isCorruptError(error)) teamDbFail('E_DB_CORRUPT', `${handle.dbPath}: ${error.message}`, 2);
|
|
1504
|
+
throw error;
|
|
1505
|
+
}
|
|
1506
|
+
})();
|
|
1507
|
+
const runId = Number(run.lastInsertRowid);
|
|
1508
|
+
|
|
1509
|
+
try {
|
|
1510
|
+
const slugs = slug ? [slug] : listTaskDirectories(handle.teamRoot);
|
|
1511
|
+
for (const taskSlug of slugs) {
|
|
1512
|
+
if (Date.now() > deadlineAt) teamDbFail('E_DEADLINE', `projection deadline expired before ${taskSlug}`, 4);
|
|
1513
|
+
const taskDir = path.join(handle.teamRoot, 'tasks', taskSlug);
|
|
1514
|
+
const present = fs.existsSync(taskDir) && fs.lstatSync(taskDir).isDirectory();
|
|
1515
|
+
if (!present) {
|
|
1516
|
+
if (slug) result.absent += markAbsent(db, taskSlug, startedAt);
|
|
1517
|
+
continue;
|
|
1518
|
+
}
|
|
1519
|
+
try {
|
|
1520
|
+
const outcome = projectTask({
|
|
1521
|
+
db,
|
|
1522
|
+
teamRoot: handle.teamRoot,
|
|
1523
|
+
slug: taskSlug,
|
|
1524
|
+
now: new Date().toISOString(),
|
|
1525
|
+
searchMode: handle.searchMode,
|
|
1526
|
+
deadlineAt,
|
|
1527
|
+
});
|
|
1528
|
+
result[outcome.status] += 1;
|
|
1529
|
+
for (const error of outcome.errors) result.errors.push(error);
|
|
1530
|
+
if (outcome.errors.length > 0) result.failed += 1;
|
|
1531
|
+
} catch (error) {
|
|
1532
|
+
if (error instanceof TeamDbError) throw error;
|
|
1533
|
+
if (isBusyError(error)) teamDbFail('E_DB_BUSY', `${taskSlug}: ${error.message}`, 2);
|
|
1534
|
+
if (isCorruptError(error)) teamDbFail('E_DB_CORRUPT', `${taskSlug}: ${error.message}`, 2);
|
|
1535
|
+
result.failed += 1;
|
|
1536
|
+
result.errors.push({ path: `${taskSlug}`, reason: error.message });
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
if (!slug) {
|
|
1541
|
+
const placeholders = slugs.map(() => '?').join(', ');
|
|
1542
|
+
const statement = slugs.length
|
|
1543
|
+
? db.prepare(`UPDATE tasks SET absent_at = ? WHERE absent_at IS NULL AND slug NOT IN (${placeholders})`)
|
|
1544
|
+
: db.prepare('UPDATE tasks SET absent_at = ? WHERE absent_at IS NULL');
|
|
1545
|
+
result.absent += slugs.length ? statement.run(startedAt, ...slugs).changes : statement.run(startedAt).changes;
|
|
1546
|
+
}
|
|
1547
|
+
if (prune) result.pruned += db.prepare('DELETE FROM tasks WHERE absent_at IS NOT NULL').run().changes;
|
|
1548
|
+
if (maintain) {
|
|
1549
|
+
result.retained += maintainDatabase(db, startedAt).retained;
|
|
1550
|
+
if (!integrityCheck(db)) teamDbFail('E_DB_CORRUPT', `${handle.dbPath} failed PRAGMA integrity_check`, 2);
|
|
1551
|
+
} else if (!slug) {
|
|
1552
|
+
const quick = db.prepare('PRAGMA quick_check').get();
|
|
1553
|
+
if (!quick || Object.values(quick)[0] !== 'ok') {
|
|
1554
|
+
teamDbFail('E_DB_CORRUPT', `${handle.dbPath} failed PRAGMA quick_check`, 2);
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
if (vacuum) {
|
|
1558
|
+
db.exec('PRAGMA wal_checkpoint(TRUNCATE)');
|
|
1559
|
+
db.exec('VACUUM');
|
|
1560
|
+
}
|
|
1561
|
+
result.exitCode = result.failed > 0 ? 1 : 0;
|
|
1562
|
+
result.error = result.errors[0] ? `${result.errors[0].path}: ${result.errors[0].reason}` : null;
|
|
1563
|
+
updateRun(db, runId, result);
|
|
1564
|
+
chmodDatabaseFiles(handle.dbPath);
|
|
1565
|
+
return result;
|
|
1566
|
+
} catch (error) {
|
|
1567
|
+
result.exitCode = error instanceof TeamDbError ? error.exitCode : 2;
|
|
1568
|
+
result.error = error.message;
|
|
1569
|
+
try {
|
|
1570
|
+
updateRun(db, runId, result);
|
|
1571
|
+
} catch {
|
|
1572
|
+
/* the primary failure is the finding */
|
|
1573
|
+
}
|
|
1574
|
+
throw error;
|
|
1575
|
+
} finally {
|
|
1576
|
+
try {
|
|
1577
|
+
db.close();
|
|
1578
|
+
} catch {
|
|
1579
|
+
/* a close error after a successful commit is not a projection failure */
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
/** Human summary for a `sync` run. */
|
|
1585
|
+
export function describeSyncResult(result) {
|
|
1586
|
+
return (
|
|
1587
|
+
`sync: inserted=${result.inserted} updated=${result.updated} unchanged=${result.unchanged} ` +
|
|
1588
|
+
`absent=${result.absent} failed=${result.failed} pruned=${result.pruned} rebuilt=${result.rebuilt}`
|
|
1589
|
+
);
|
|
1590
|
+
}
|