@1aboveio/skills 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -2
- package/bin/cli.mjs +14 -0
- package/bin/select-core.mjs +172 -0
- package/package.json +146 -4
- package/skills/app-dev/airflow/LICENSE +3 -0
- package/skills/app-dev/airflow/SKILL.md +199 -0
- package/skills/app-dev/airflow/release-check.mjs +93 -0
- package/skills/app-dev/android-foundation/LICENSE +3 -0
- package/skills/app-dev/android-foundation/SKILL.md +192 -0
- package/skills/app-dev/android-foundation/assets/android-ci-job.yml +217 -0
- package/skills/app-dev/android-foundation/references/ci.md +87 -0
- package/skills/app-dev/android-foundation/references/gotchas.md +221 -0
- package/skills/app-dev/android-foundation/references/setup.md +164 -0
- package/skills/app-dev/android-foundation/release-check.mjs +93 -0
- package/skills/app-dev/android-foundation/scripts/device-run.sh +176 -0
- package/skills/app-dev/android-foundation/scripts/device-run.test.mjs +172 -0
- package/skills/app-dev/app-debug/LICENSE +3 -0
- package/skills/app-dev/app-debug/SKILL.md +110 -0
- package/skills/app-dev/app-debug/references/common-errors.md +128 -0
- package/skills/app-dev/app-debug/release-check.mjs +93 -0
- package/skills/app-dev/better-auth/LICENSE +3 -0
- package/skills/app-dev/better-auth/SKILL.md +598 -0
- package/skills/app-dev/better-auth/references/feishu-api.md +270 -0
- package/skills/app-dev/better-auth/release-check.mjs +93 -0
- package/skills/app-dev/data-catalog/LICENSE +3 -0
- package/skills/app-dev/data-catalog/SKILL.md +204 -0
- package/skills/app-dev/data-catalog/agents/openai.yaml +3 -0
- package/skills/app-dev/data-catalog/references/data-catalog-conventions.md +75 -0
- package/skills/app-dev/data-catalog/references/field-definitions.md +116 -0
- package/skills/app-dev/data-catalog/references/format.md +121 -0
- package/skills/app-dev/data-catalog/release-check.mjs +93 -0
- package/skills/app-dev/data-catalog/scripts/data-catalog.test.mjs +36 -0
- package/skills/app-dev/data-catalog/scripts/data_catalog.py +1392 -0
- package/skills/app-dev/data-catalog/scripts/persist-conventions-core.mjs +117 -0
- package/skills/app-dev/data-catalog/scripts/persist-conventions.mjs +17 -0
- package/skills/app-dev/data-catalog/scripts/test_data_catalog.py +571 -0
- package/skills/app-dev/ios-foundation/LICENSE +3 -0
- package/skills/app-dev/ios-foundation/SKILL.md +184 -0
- package/skills/app-dev/ios-foundation/references/setup.md +243 -0
- package/skills/app-dev/ios-foundation/release-check.mjs +93 -0
- package/skills/app-dev/monorepo/LICENSE +3 -0
- package/skills/app-dev/monorepo/SKILL.md +462 -0
- package/skills/app-dev/monorepo/release-check.mjs +93 -0
- package/skills/app-dev/nextjs-fullstack/LICENSE +3 -0
- package/skills/app-dev/nextjs-fullstack/SKILL.md +211 -0
- package/skills/app-dev/nextjs-fullstack/conventions.md +318 -0
- package/skills/app-dev/nextjs-fullstack/frontend-conventions.md +61 -0
- package/skills/app-dev/nextjs-fullstack/nextjs16.md +287 -0
- package/skills/app-dev/nextjs-fullstack/release-check.mjs +93 -0
- package/skills/app-dev/nextjs-fullstack/server-actions.md +409 -0
- package/skills/app-dev/prisma-setup/LICENSE +3 -0
- package/skills/app-dev/prisma-setup/SKILL.md +181 -0
- package/skills/app-dev/prisma-setup/nextjs.md +258 -0
- package/skills/app-dev/prisma-setup/release-check.mjs +93 -0
- package/skills/app-dev/prisma-setup/turborepo.md +301 -0
- package/skills/app-dev/pyspark/LICENSE +3 -0
- package/skills/app-dev/pyspark/SKILL.md +127 -0
- package/skills/app-dev/pyspark/assets/templates/etl.py +748 -0
- package/skills/app-dev/pyspark/assets/templates/utils/__init__.py +1 -0
- package/skills/app-dev/pyspark/assets/templates/utils/hudi_metadata.py +14 -0
- package/skills/app-dev/pyspark/references/diagnosis-and-profiling.md +169 -0
- package/skills/app-dev/pyspark/references/etl-contract.md +129 -0
- package/skills/app-dev/pyspark/references/production-validation.md +131 -0
- package/skills/app-dev/pyspark/references/reconciliation.md +38 -0
- package/skills/app-dev/pyspark/references/transformation-design.md +190 -0
- package/skills/app-dev/pyspark/references/velocity-feature-calculation.md +193 -0
- package/skills/app-dev/pyspark/release-check.mjs +93 -0
- package/skills/app-dev/pyspark/scripts/spark_eventlog_summary.py +223 -0
- package/skills/app-dev/python-backend/LICENSE +3 -0
- package/skills/app-dev/python-backend/SKILL.md +325 -0
- package/skills/app-dev/python-backend/assets/uv-install.sh +48 -0
- package/skills/app-dev/python-backend/references/uv-installs.md +83 -0
- package/skills/app-dev/python-backend/release-check.mjs +93 -0
- package/skills/app-dev/shadcn/LICENSE +3 -0
- package/skills/app-dev/shadcn/SKILL.md +120 -0
- package/skills/app-dev/shadcn/assets/shadcn-small.png +0 -0
- package/skills/app-dev/shadcn/assets/shadcn.png +0 -0
- package/skills/app-dev/shadcn/cli.md +411 -0
- package/skills/app-dev/shadcn/customization.md +224 -0
- package/skills/app-dev/shadcn/mcp.md +101 -0
- package/skills/app-dev/shadcn/release-check.mjs +93 -0
- package/skills/app-dev/shadcn/rules/base-vs-radix.md +323 -0
- package/skills/app-dev/shadcn/rules/component-selection.md +67 -0
- package/skills/app-dev/shadcn/rules/composition.md +195 -0
- package/skills/app-dev/shadcn/rules/data-table.md +201 -0
- package/skills/app-dev/shadcn/rules/forms.md +255 -0
- package/skills/app-dev/shadcn/rules/icons.md +103 -0
- package/skills/app-dev/shadcn/rules/styling.md +167 -0
- package/skills/app-dev/zod-v4/LICENSE +3 -0
- package/skills/app-dev/zod-v4/SKILL.md +286 -0
- package/skills/app-dev/zod-v4/release-check.mjs +93 -0
- package/skills/cicd/cloud-build/LICENSE +3 -0
- package/skills/cicd/cloud-build/SKILL.md +707 -0
- package/skills/cicd/cloud-build/release-check.mjs +93 -0
- package/skills/cicd/cloud-debug/LICENSE +3 -0
- package/skills/cicd/cloud-debug/SKILL.md +315 -0
- package/skills/cicd/cloud-debug/references/build-failures.md +238 -0
- package/skills/cicd/cloud-debug/references/deploy-failures.md +376 -0
- package/skills/cicd/cloud-debug/references/pipeline-failures.md +378 -0
- package/skills/cicd/cloud-debug/release-check.mjs +93 -0
- package/skills/cicd/cloud-deploy/LICENSE +3 -0
- package/skills/cicd/cloud-deploy/SKILL.md +230 -0
- package/skills/cicd/cloud-deploy/references/config-templates.md +257 -0
- package/skills/cicd/cloud-deploy/release-check.mjs +93 -0
- package/skills/cicd/docker/LICENSE +3 -0
- package/skills/cicd/docker/SKILL.md +151 -0
- package/skills/cicd/docker/release-check.mjs +93 -0
- package/skills/cicd/github-actions/LICENSE +3 -0
- package/skills/cicd/github-actions/SKILL.md +111 -0
- package/skills/cicd/github-actions/references/audit-profile-optimize.md +150 -0
- package/skills/cicd/github-actions/references/ci-case-studies.md +141 -0
- package/skills/cicd/github-actions/references/conditional-ci.md +214 -0
- package/skills/cicd/github-actions/references/debugging.md +13 -0
- package/skills/cicd/github-actions/references/pipeline.md +87 -0
- package/skills/cicd/github-actions/references/post-deploy-and-publishing.md +33 -0
- package/skills/cicd/github-actions/references/runners.md +253 -0
- package/skills/cicd/github-actions/references/security.md +29 -0
- package/skills/cicd/github-actions/references/speed-and-audit.md +115 -0
- package/skills/cicd/github-actions/references/two-pass-reading.md +92 -0
- package/skills/cicd/github-actions/release-check.mjs +93 -0
- package/skills/cicd/github-actions/scripts/ci-run-audit-core.mjs +612 -0
- package/skills/cicd/github-actions/scripts/ci-run-audit.mjs +4 -0
- package/skills/cicd/github-actions/scripts/ci-run-audit.test.mjs +637 -0
- package/skills/cicd/github-flow/LICENSE +3 -0
- package/skills/cicd/github-flow/SKILL.md +123 -0
- package/skills/cicd/github-flow/references/ci-conventions.md +14 -0
- package/skills/cicd/github-flow/release-check.mjs +93 -0
- package/skills/cicd/github-flow/scripts/flow-core.mjs +105 -0
- package/skills/cicd/github-flow/scripts/flow.mjs +81 -0
- package/skills/cicd/github-flow/scripts/flow.test.mjs +114 -0
- package/skills/cicd/github-flow/scripts/persist-conventions-core.mjs +117 -0
- package/skills/cicd/github-flow/scripts/persist-conventions.mjs +49 -0
- package/skills/cicd/github-flow/scripts/persist-conventions.test.mjs +108 -0
- package/skills/cicd/google-cloud/LICENSE +3 -0
- package/skills/cicd/google-cloud/SKILL.md +119 -0
- package/skills/cicd/google-cloud/references/gcs.md +469 -0
- package/skills/cicd/google-cloud/references/iam.md +451 -0
- package/skills/cicd/google-cloud/references/project.md +349 -0
- package/skills/cicd/google-cloud/references/secrets.md +336 -0
- package/skills/cicd/google-cloud/references/vpc.md +312 -0
- package/skills/cicd/google-cloud/release-check.mjs +93 -0
- package/skills/cicd/google-cloud/scripts/create-sa.sh +36 -0
- package/skills/cicd/google-cloud/scripts/gcp-config.sh +31 -0
- package/skills/cicd/google-cloud/scripts/grant-iap.sh +41 -0
- package/skills/cicd/google-cloud/scripts/setup-secrets.sh +48 -0
- package/skills/cicd/mergify/LICENSE +3 -0
- package/skills/cicd/mergify/SKILL.md +102 -0
- package/skills/cicd/mergify/assets/templates/mergify.yml +215 -0
- package/skills/cicd/mergify/assets/templates/ruleset.json +46 -0
- package/skills/cicd/mergify/references/branch-protection.md +282 -0
- package/skills/cicd/mergify/references/configuration.md +274 -0
- package/skills/cicd/mergify/references/diagnosis.md +109 -0
- package/skills/cicd/mergify/references/stacks.md +84 -0
- package/skills/cicd/mergify/references/traps.md +119 -0
- package/skills/cicd/mergify/references/watch-contract.md +274 -0
- package/skills/cicd/mergify/release-check.mjs +93 -0
- package/skills/cicd/mergify/scripts/audit-core.mjs +208 -0
- package/skills/cicd/mergify/scripts/audit.mjs +4 -0
- package/skills/cicd/mergify/scripts/audit.test.mjs +201 -0
- package/skills/cicd/mergify/scripts/entrypoints.test.mjs +106 -0
- package/skills/cicd/mergify/scripts/pr-620-mergify-comments.fixture.json +30 -0
- package/skills/cicd/mergify/scripts/stack-push-core.mjs +258 -0
- package/skills/cicd/mergify/scripts/stack-push.mjs +4 -0
- package/skills/cicd/mergify/scripts/stack-push.test.mjs +233 -0
- package/skills/cicd/mergify/scripts/watch-pr-delivery-core.mjs +1065 -0
- package/skills/cicd/mergify/scripts/watch-pr-delivery.mjs +4 -0
- package/skills/cicd/mergify/scripts/watch-pr-delivery.test.mjs +1826 -0
- package/skills/cicd/podman/LICENSE +3 -0
- package/skills/cicd/podman/SKILL.md +71 -0
- package/skills/cicd/podman/agents/openai.yaml +4 -0
- package/skills/cicd/podman/assets/templates/podman-compose-socket-directory.yml +6 -0
- package/skills/cicd/podman/assets/templates/podman-service-override.conf +3 -0
- package/skills/cicd/podman/references/compose-compatibility.md +70 -0
- package/skills/cicd/podman/references/networking-and-ports.md +74 -0
- package/skills/cicd/podman/references/rootless-services-and-sockets.md +156 -0
- package/skills/cicd/podman/references/troubleshooting.md +98 -0
- package/skills/cicd/podman/release-check.mjs +93 -0
- package/skills/content/article-review/LICENSE +3 -0
- package/skills/content/article-review/SKILL.md +66 -0
- package/skills/content/article-review/references/report-format.md +68 -0
- package/skills/content/article-review/references/template-guide.md +79 -0
- package/skills/content/article-review/references/template-wechat-payments.md +125 -0
- package/skills/content/article-review/release-check.mjs +93 -0
- package/skills/content/article-to-image/LICENSE +3 -0
- package/skills/content/article-to-image/SKILL.md +91 -0
- package/skills/content/article-to-image/references/formats.md +53 -0
- package/skills/content/article-to-image/release-check.mjs +93 -0
- package/skills/content/flowchart-svg/LICENSE +3 -0
- package/skills/content/flowchart-svg/SKILL.md +43 -0
- package/skills/content/flowchart-svg/release-check.mjs +93 -0
- package/skills/content/flowchart-svg/scripts/export_png.sh +8 -0
- package/skills/content/image-gen/LICENSE +3 -0
- package/skills/content/image-gen/SKILL.md +192 -0
- package/skills/content/image-gen/release-check.mjs +93 -0
- package/skills/content/image-gen/scripts/credentials.mjs +217 -0
- package/skills/content/image-gen/scripts/credentials.test.mjs +212 -0
- package/skills/content/image-gen/scripts/generate.mjs +240 -0
- package/skills/content/image-gen/scripts/options.mjs +293 -0
- package/skills/content/image-gen/scripts/options.test.mjs +245 -0
- package/skills/content/mermaid/LICENSE +3 -0
- package/skills/content/mermaid/SKILL.md +635 -0
- package/skills/content/mermaid/release-check.mjs +93 -0
- package/skills/content/wechat-article-writer/LICENSE +3 -0
- package/skills/content/wechat-article-writer/SKILL.md +92 -0
- package/skills/content/wechat-article-writer/references/style-selector.md +133 -0
- package/skills/content/wechat-article-writer/references/writing-rules.md +152 -0
- package/skills/content/wechat-article-writer/release-check.mjs +93 -0
- package/skills/content/wechat-article-writer/templates/wechat-comparison.md +52 -0
- package/skills/content/wechat-article-writer/templates/wechat-howto.md +51 -0
- package/skills/content/wechat-article-writer/templates/wechat-insight.md +50 -0
- package/skills/content/wechat-article-writer/templates/wechat-pitfall.md +52 -0
- package/skills/content/wechat-publisher/LICENSE +3 -0
- package/skills/content/wechat-publisher/SKILL.md +171 -0
- package/skills/content/wechat-publisher/references/api.md +105 -0
- package/skills/content/wechat-publisher/references/layout-rules.md +57 -0
- package/skills/content/wechat-publisher/references/wechat-safe-template.html +86 -0
- package/skills/content/wechat-publisher/release-check.mjs +93 -0
- package/skills/content/wechat-publisher/scripts/md_to_wechat_html.py +194 -0
- package/skills/content/wechat-publisher/scripts/publish.py +239 -0
- package/skills/content/wechat-search/LICENSE +3 -0
- package/skills/content/wechat-search/SKILL.md +211 -0
- package/skills/content/wechat-search/release-check.mjs +93 -0
- package/skills/content/wechat-search/scripts/start-chrome.sh +83 -0
- package/skills/content/xai-search/LICENSE +3 -0
- package/skills/content/xai-search/SKILL.md +79 -0
- package/skills/content/xai-search/release-check.mjs +93 -0
- package/skills/content/xai-search/scripts/xai_search.sh +187 -0
- package/skills/content/xai-search/tests/smoke_test.sh +36 -0
- package/skills/core/distill-writing/LICENSE +3 -0
- package/skills/core/distill-writing/SKILL.md +74 -0
- package/skills/core/distill-writing/references/extraction.md +95 -0
- package/skills/core/distill-writing/references/updating.md +46 -0
- package/skills/core/distill-writing/release-check.mjs +93 -0
- package/skills/core/doc-to-md/LICENSE +3 -0
- package/skills/core/doc-to-md/SKILL.md +78 -0
- package/skills/core/doc-to-md/release-check.mjs +93 -0
- package/skills/core/doc-to-md/scripts/convert.py +157 -0
- package/skills/core/editorial-review/LICENSE +3 -0
- package/skills/core/editorial-review/SKILL.md +79 -0
- package/skills/core/editorial-review/references/checklist.md +94 -0
- package/skills/core/editorial-review/release-check.mjs +93 -0
- package/skills/core/house-style/LICENSE +3 -0
- package/skills/core/house-style/SKILL.md +33 -0
- package/skills/core/house-style/references/defaults.md +66 -0
- package/skills/core/house-style/references/rules.md +267 -0
- package/skills/core/house-style/references/sources.md +27 -0
- package/skills/core/house-style/references/style-en.md +131 -0
- package/skills/core/house-style/references/style-zh.md +141 -0
- package/skills/core/house-style/references/terminology-zh.md +223 -0
- package/skills/core/house-style/release-check.mjs +93 -0
- package/skills/core/house-style/templates/brd.md +103 -0
- package/skills/core/house-style/templates/commercial-proposal.md +93 -0
- package/skills/core/house-style/templates/compliance-policy.md +109 -0
- package/skills/core/house-style/templates/gap-analysis.md +105 -0
- package/skills/core/house-style/templates/general.md +63 -0
- package/skills/core/house-style/templates/integration-guide.md +98 -0
- package/skills/core/house-style/templates/prd.md +81 -0
- package/skills/core/house-style/templates/risk-operations-procedure.md +94 -0
- package/skills/core/house-style/templates/technical-spec.md +96 -0
- package/skills/core/polish-cn/LICENSE +3 -0
- package/skills/core/polish-cn/SKILL.md +102 -0
- package/skills/core/polish-cn/references/brief.md +93 -0
- package/skills/core/polish-cn/references/models.md +76 -0
- package/skills/core/polish-cn/release-check.mjs +93 -0
- package/skills/core/polish-cn/scripts/polish-cn.test.mjs +244 -0
- package/skills/core/polish-cn/scripts/polish_blocks.py +489 -0
- package/skills/core/reg-parser/LICENSE +3 -0
- package/skills/core/reg-parser/SKILL.md +212 -0
- package/skills/core/reg-parser/references/checklist-schema.md +223 -0
- package/skills/core/reg-parser/references/checklists/hk-amlo-checklist.json +1306 -0
- package/skills/core/reg-parser/references/checklists/hk-amlo-checklist.md +469 -0
- package/skills/core/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.json +634 -0
- package/skills/core/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.md +233 -0
- package/skills/core/reg-parser/references/checklists/hk-mso-guideline-checklist.json +2194 -0
- package/skills/core/reg-parser/references/checklists/hk-mso-guideline-checklist.md +771 -0
- package/skills/core/reg-parser/references/checklists/kyc-aml-checklist.md +258 -0
- package/skills/core/reg-parser/references/checklists/visa-vars-checklist.md +1058 -0
- package/skills/core/reg-parser/references/mandates/hk-amlo-cap615.md +389 -0
- package/skills/core/reg-parser/references/mandates/visa-vars.md +205 -0
- package/skills/core/reg-parser/release-check.mjs +93 -0
- package/skills/core/reg-parser/scripts/compare_checklist.py +230 -0
- package/skills/core/reg-parser/scripts/dump_checklist.py +361 -0
- package/skills/core/reg-parser/scripts/preprocess-mandate.sh +187 -0
- package/skills/core/reg-parser/scripts/reg-parser.test.mjs +165 -0
- package/skills/core/reg-parser/scripts/test_quarantine.sh +105 -0
- package/skills/core/reg-parser/scripts/validate_checklist.py +563 -0
- package/skills/core/reg-parser/scripts/validate_mandate.py +273 -0
- package/skills/core/terminology/LICENSE +3 -0
- package/skills/core/terminology/SKILL.md +62 -0
- package/skills/core/terminology/references/format.md +50 -0
- package/skills/core/terminology/references/init.md +32 -0
- package/skills/core/terminology/release-check.mjs +93 -0
- package/skills/core/write-doc/LICENSE +3 -0
- package/skills/core/write-doc/SKILL.md +141 -0
- package/skills/core/write-doc/references/bilingual.md +60 -0
- package/skills/core/write-doc/release-check.mjs +93 -0
- package/skills/engineering/better-review/LICENSE +3 -0
- package/skills/engineering/better-review/SKILL.md +249 -0
- package/skills/engineering/better-review/agents/openai.yaml +9 -0
- package/skills/engineering/better-review/references/domain-hazards.md +53 -0
- package/skills/engineering/better-review/references/passes.md +147 -0
- package/skills/engineering/better-review/references/result.md +151 -0
- package/skills/engineering/better-review/release-check.mjs +93 -0
- package/skills/engineering/better-review/scripts/pr-context.mjs +212 -0
- package/skills/engineering/better-review/scripts/pr-context.test.mjs +168 -0
- package/skills/engineering/better-review/scripts/rereview-scope.mjs +503 -0
- package/skills/engineering/better-review/scripts/rereview-scope.test.mjs +587 -0
- package/skills/engineering/better-review/scripts/scan-diff.mjs +365 -0
- package/skills/engineering/better-review/scripts/scan-diff.test.mjs +414 -0
- package/skills/engineering/better-review/scripts/vendor-sync.test.mjs +96 -0
- package/skills/engineering/e2e-test/LICENSE +3 -0
- package/skills/engineering/e2e-test/SKILL.md +98 -0
- package/skills/engineering/e2e-test/assets/ci-gates.cloudbuild.yaml +24 -0
- package/skills/engineering/e2e-test/references/authoring/auth-flows.md +159 -0
- package/skills/engineering/e2e-test/references/authoring/playwright-config.md +73 -0
- package/skills/engineering/e2e-test/references/authoring/playwright-patterns.md +144 -0
- package/skills/engineering/e2e-test/references/ci-integration.md +25 -0
- package/skills/engineering/e2e-test/references/ci-playwright-container.md +290 -0
- package/skills/engineering/e2e-test/references/presentation-sweep.md +104 -0
- package/skills/engineering/e2e-test/references/reviewing.md +41 -0
- package/skills/engineering/e2e-test/references/route-manifest.md +51 -0
- package/skills/engineering/e2e-test/release-check.mjs +93 -0
- package/skills/engineering/e2e-test/scripts/detect-routes-nextjs.mjs +200 -0
- package/skills/engineering/e2e-test/scripts/presentation-checks.mjs +171 -0
- package/skills/engineering/e2e-test/scripts/presentation-checks.test.mjs +106 -0
- package/skills/engineering/e2e-test/scripts/presentation-perceivability.mjs +179 -0
- package/skills/engineering/e2e-test/scripts/presentation-perceivability.test.mjs +117 -0
- package/skills/engineering/e2e-test/scripts/presentation-reachability.mjs +154 -0
- package/skills/engineering/e2e-test/scripts/presentation-reachability.test.mjs +69 -0
- package/skills/engineering/e2e-test/scripts/presentation-render-health.mjs +141 -0
- package/skills/engineering/e2e-test/scripts/presentation-render-health.test.mjs +98 -0
- package/skills/engineering/e2e-test/scripts/presentation-sweep.mjs +147 -0
- package/skills/engineering/e2e-test/scripts/presentation-sweep.test.mjs +71 -0
- package/skills/engineering/e2e-test/scripts/presentation-temporal.mjs +127 -0
- package/skills/engineering/e2e-test/scripts/presentation-temporal.test.mjs +59 -0
- package/skills/engineering/e2e-test/scripts/project-route-manifest.mjs +82 -0
- package/skills/engineering/e2e-test/scripts/project-route-manifest.test.mjs +76 -0
- package/skills/engineering/e2e-test/scripts/validate-manifest.mjs +106 -0
- package/skills/engineering/engineering-runtime/LICENSE +3 -0
- package/skills/engineering/engineering-runtime/SKILL.md +11 -0
- package/skills/engineering/engineering-runtime/agents/openai.yaml +6 -0
- package/skills/engineering/engineering-runtime/coherence/workflow.json +597 -0
- package/skills/engineering/engineering-runtime/engineering-runtime.test.mjs +68 -0
- package/skills/engineering/engineering-runtime/release-check.mjs +93 -0
- package/skills/engineering/engineering-runtime/scripts/exact-head-artifact.mjs +131 -0
- package/skills/engineering/engineering-runtime/scripts/head-check-set.mjs +398 -0
- package/skills/engineering/engineering-runtime/scripts/invocation-policy.mjs +187 -0
- package/skills/engineering/engineering-runtime/scripts/invocation-policy.test.mjs +95 -0
- package/skills/engineering/engineering-runtime/scripts/main-module.mjs +79 -0
- package/skills/engineering/engineering-runtime/scripts/main-module.test.mjs +288 -0
- package/skills/engineering/engineering-runtime/scripts/mergify-yaml.mjs +11 -0
- package/skills/engineering/engineering-runtime/scripts/package-lock.json +43 -0
- package/skills/engineering/engineering-runtime/scripts/package.json +10 -0
- package/skills/engineering/engineering-runtime/scripts/required-check-plan.mjs +223 -0
- package/skills/engineering/engineering-runtime/scripts/required-check-plan.test.mjs +96 -0
- package/skills/engineering/engineering-runtime/scripts/review-completion.mjs +56 -0
- package/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +595 -0
- package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +189 -0
- package/skills/engineering/engineering-runtime/scripts/yaml-mapping.mjs +18 -0
- package/skills/engineering/ensure-coverage/LICENSE +3 -0
- package/skills/engineering/ensure-coverage/SKILL.md +129 -0
- package/skills/engineering/ensure-coverage/references/breadth/coverage-ledger.md +92 -0
- package/skills/engineering/ensure-coverage/references/breadth/inventory-contract.md +85 -0
- package/skills/engineering/ensure-coverage/references/breadth/surface-baseline.md +44 -0
- package/skills/engineering/ensure-coverage/references/breadth/surface-discovery.md +16 -0
- package/skills/engineering/ensure-coverage/references/depth/characterization.md +68 -0
- package/skills/engineering/ensure-coverage/references/depth/coverage.config.example.json +19 -0
- package/skills/engineering/ensure-coverage/references/depth/grading.md +35 -0
- package/skills/engineering/ensure-coverage/references/depth/mock-policy.md +57 -0
- package/skills/engineering/ensure-coverage/references/depth/test-smells.md +39 -0
- package/skills/engineering/ensure-coverage/references/enforcement/ci-contract.md +44 -0
- package/skills/engineering/ensure-coverage/references/examples/coverage-ledger.md +110 -0
- package/skills/engineering/ensure-coverage/references/examples/refund-flow.md +35 -0
- package/skills/engineering/ensure-coverage/references/presentation/axis.md +64 -0
- package/skills/engineering/ensure-coverage/references/process/audit-mode.md +27 -0
- package/skills/engineering/ensure-coverage/references/process/output-template.md +139 -0
- package/skills/engineering/ensure-coverage/references/process/test-strategy.md +56 -0
- package/skills/engineering/ensure-coverage/release-check.mjs +93 -0
- package/skills/engineering/ensure-coverage/schemas/coverage-config.schema.json +67 -0
- package/skills/engineering/ensure-coverage/schemas/coverage-file.schema.json +140 -0
- package/skills/engineering/ensure-coverage/scripts/README.md +99 -0
- package/skills/engineering/ensure-coverage/scripts/adapters/nextjs-inventory.mjs +182 -0
- package/skills/engineering/ensure-coverage/scripts/adapters/nextjs-inventory.test.mjs +96 -0
- package/skills/engineering/ensure-coverage/scripts/check-quarantine-expiry.mjs +105 -0
- package/skills/engineering/ensure-coverage/scripts/check-quarantine-expiry.test.mjs +47 -0
- package/skills/engineering/ensure-coverage/scripts/ci-audit.mjs +137 -0
- package/skills/engineering/ensure-coverage/scripts/ci-audit.test.mjs +86 -0
- package/skills/engineering/ensure-coverage/scripts/coverage-ledger.mjs +674 -0
- package/skills/engineering/ensure-coverage/scripts/coverage-ledger.test.mjs +447 -0
- package/skills/engineering/ensure-coverage/scripts/design-parity.mjs +591 -0
- package/skills/engineering/ensure-coverage/scripts/design-parity.test.mjs +552 -0
- package/skills/engineering/ensure-coverage/scripts/lint-tests.mjs +282 -0
- package/skills/engineering/ensure-coverage/scripts/lint-tests.test.mjs +289 -0
- package/skills/engineering/ensure-coverage/scripts/mock-policy-config.mjs +176 -0
- package/skills/engineering/ensure-coverage/scripts/mock-policy-config.test.mjs +119 -0
- package/skills/engineering/ensure-coverage/scripts/package.json +19 -0
- package/skills/engineering/golden-path/LICENSE +3 -0
- package/skills/engineering/golden-path/SKILL.md +230 -0
- package/skills/engineering/golden-path/agents/openai.yaml +3 -0
- package/skills/engineering/golden-path/assets/golden-paths.example.json +57 -0
- package/skills/engineering/golden-path/references/contract.md +239 -0
- package/skills/engineering/golden-path/references/migration.md +111 -0
- package/skills/engineering/golden-path/release-check.mjs +93 -0
- package/skills/engineering/golden-path/scripts/golden-path-core.mjs +1779 -0
- package/skills/engineering/golden-path/scripts/golden-path.mjs +6 -0
- package/skills/engineering/golden-path/scripts/golden-path.test.mjs +1457 -0
- package/skills/engineering/harness-runtime/LICENSE +3 -0
- package/skills/engineering/harness-runtime/SKILL.md +19 -0
- package/skills/engineering/harness-runtime/agents/openai.yaml +6 -0
- package/skills/engineering/harness-runtime/bin/discover-models.mjs +4 -0
- package/skills/engineering/harness-runtime/bin/model-catalog.mjs +4 -0
- package/skills/engineering/harness-runtime/contracts.md +15 -0
- package/skills/engineering/harness-runtime/discover-models.mjs +392 -0
- package/skills/engineering/harness-runtime/discover-models.test.mjs +363 -0
- package/skills/engineering/harness-runtime/fixtures/native-question-schemas.json +33 -0
- package/skills/engineering/harness-runtime/fixtures/question-responses.json +54 -0
- package/skills/engineering/harness-runtime/harness-runtime.test.mjs +967 -0
- package/skills/engineering/harness-runtime/index.mjs +767 -0
- package/skills/engineering/harness-runtime/model-catalog-seed.test.mjs +829 -0
- package/skills/engineering/harness-runtime/model-catalog.mjs +787 -0
- package/skills/engineering/harness-runtime/model-catalog.test.mjs +366 -0
- package/skills/engineering/harness-runtime/native-question-contracts.md +37 -0
- package/skills/engineering/harness-runtime/references/model-catalog-seed.json +408 -0
- package/skills/engineering/harness-runtime/references/model-catalog.md +57 -0
- package/skills/engineering/harness-runtime/release-check.mjs +93 -0
- package/skills/engineering/resolve-issues/LICENSE +3 -0
- package/skills/engineering/resolve-issues/SKILL.md +250 -0
- package/skills/engineering/resolve-issues/agents/openai.yaml +9 -0
- package/skills/engineering/resolve-issues/plugin-hooks.json +17 -0
- package/skills/engineering/resolve-issues/references/canary.md +28 -0
- package/skills/engineering/resolve-issues/references/ci.md +105 -0
- package/skills/engineering/resolve-issues/references/done.md +25 -0
- package/skills/engineering/resolve-issues/references/dropbox.md +90 -0
- package/skills/engineering/resolve-issues/references/expire.md +318 -0
- package/skills/engineering/resolve-issues/references/exploration.md +202 -0
- package/skills/engineering/resolve-issues/references/implementation.md +303 -0
- package/skills/engineering/resolve-issues/references/preflight.md +445 -0
- package/skills/engineering/resolve-issues/references/review.md +228 -0
- package/skills/engineering/resolve-issues/references/shared-modules.md +44 -0
- package/skills/engineering/resolve-issues/references/task-plan.md +264 -0
- package/skills/engineering/resolve-issues/release-check.mjs +93 -0
- package/skills/engineering/resolve-issues/scripts/cleanup-runs.mjs +364 -0
- package/skills/engineering/resolve-issues/scripts/cleanup-runs.test.mjs +280 -0
- package/skills/engineering/resolve-issues/scripts/discover-models.mjs +9 -0
- package/skills/engineering/resolve-issues/scripts/dropbox.mjs +473 -0
- package/skills/engineering/resolve-issues/scripts/dropbox.test.mjs +346 -0
- package/skills/engineering/resolve-issues/scripts/findings-reuse.mjs +98 -0
- package/skills/engineering/resolve-issues/scripts/findings-reuse.test.mjs +88 -0
- package/skills/engineering/resolve-issues/scripts/github-reviews.mjs +384 -0
- package/skills/engineering/resolve-issues/scripts/github-reviews.test.mjs +264 -0
- package/skills/engineering/resolve-issues/scripts/install-hooks.mjs +135 -0
- package/skills/engineering/resolve-issues/scripts/install-hooks.test.mjs +79 -0
- package/skills/engineering/resolve-issues/scripts/issue-tree.mjs +162 -0
- package/skills/engineering/resolve-issues/scripts/issue-tree.test.mjs +107 -0
- package/skills/engineering/resolve-issues/scripts/manual-invocation.test.mjs +14 -0
- package/skills/engineering/resolve-issues/scripts/model-catalog.mjs +9 -0
- package/skills/engineering/resolve-issues/scripts/next-actions-capacity.test.mjs +149 -0
- package/skills/engineering/resolve-issues/scripts/next-actions.mjs +856 -0
- package/skills/engineering/resolve-issues/scripts/next-actions.test.mjs +915 -0
- package/skills/engineering/resolve-issues/scripts/plan-sync.mjs +269 -0
- package/skills/engineering/resolve-issues/scripts/plan-sync.test.mjs +156 -0
- package/skills/engineering/resolve-issues/scripts/preflight-models.mjs +736 -0
- package/skills/engineering/resolve-issues/scripts/preflight-models.test.mjs +448 -0
- package/skills/engineering/resolve-issues/scripts/ready-check.mjs +185 -0
- package/skills/engineering/resolve-issues/scripts/ready-check.test.mjs +217 -0
- package/skills/engineering/resolve-issues/scripts/rehydrate.mjs +98 -0
- package/skills/engineering/resolve-issues/scripts/rehydrate.test.mjs +91 -0
- package/skills/engineering/resolve-issues/scripts/review-verdict.mjs +509 -0
- package/skills/engineering/resolve-issues/scripts/review-verdict.test.mjs +1060 -0
- package/skills/engineering/resolve-issues/scripts/size-check.mjs +492 -0
- package/skills/engineering/resolve-issues/scripts/size-check.test.mjs +458 -0
- package/skills/engineering/resolve-release/LICENSE +3 -0
- package/skills/engineering/resolve-release/SKILL.md +215 -0
- package/skills/engineering/resolve-release/agents/openai.yaml +8 -0
- package/skills/engineering/resolve-release/flows/cloud-run-canary.md +13 -0
- package/skills/engineering/resolve-release/flows/cloud-run.md +7 -0
- package/skills/engineering/resolve-release/flows/root-tag-npm.md +13 -0
- package/skills/engineering/resolve-release/flows/workspace-npm.md +22 -0
- package/skills/engineering/resolve-release/references/canary.md +51 -0
- package/skills/engineering/resolve-release/references/candidate.md +41 -0
- package/skills/engineering/resolve-release/references/cut.md +131 -0
- package/skills/engineering/resolve-release/references/dark-launch.md +66 -0
- package/skills/engineering/resolve-release/references/flows.md +150 -0
- package/skills/engineering/resolve-release/references/preflight.md +154 -0
- package/skills/engineering/resolve-release/references/prepared-metadata.md +260 -0
- package/skills/engineering/resolve-release/references/promotion.md +82 -0
- package/skills/engineering/resolve-release/references/publish.md +232 -0
- package/skills/engineering/resolve-release/references/workspace-npm.md +103 -0
- package/skills/engineering/resolve-release/release-check.mjs +93 -0
- package/skills/engineering/resolve-release/scripts/apply.mjs +212 -0
- package/skills/engineering/resolve-release/scripts/apply.test.mjs +99 -0
- package/skills/engineering/resolve-release/scripts/dark-flags.mjs +134 -0
- package/skills/engineering/resolve-release/scripts/dark-flags.test.mjs +100 -0
- package/skills/engineering/resolve-release/scripts/flow.mjs +500 -0
- package/skills/engineering/resolve-release/scripts/flow.test.mjs +340 -0
- package/skills/engineering/resolve-release/scripts/green-head.mjs +231 -0
- package/skills/engineering/resolve-release/scripts/green-head.test.mjs +101 -0
- package/skills/engineering/resolve-release/scripts/npm-version-absence.mjs +138 -0
- package/skills/engineering/resolve-release/scripts/npm-version-absence.test.mjs +426 -0
- package/skills/engineering/resolve-release/scripts/plan-npm.test.mjs +659 -0
- package/skills/engineering/resolve-release/scripts/plan-toml-boundary.test.mjs +317 -0
- package/skills/engineering/resolve-release/scripts/plan-uv.test.mjs +291 -0
- package/skills/engineering/resolve-release/scripts/plan.mjs +806 -0
- package/skills/engineering/resolve-release/scripts/plan.test.mjs +428 -0
- package/skills/engineering/rush-issues/LICENSE +3 -0
- package/skills/engineering/rush-issues/SKILL.md +58 -0
- package/skills/engineering/rush-issues/agents/openai.yaml +8 -0
- package/skills/engineering/rush-issues/rehydrate.mjs +10 -0
- package/skills/engineering/rush-issues/release-check.mjs +93 -0
- package/skills/engineering/rush-release/LICENSE +3 -0
- package/skills/engineering/rush-release/SKILL.md +35 -0
- package/skills/engineering/rush-release/agents/openai.yaml +8 -0
- package/skills/engineering/rush-release/release-check.mjs +93 -0
- package/skills/engineering/test-quality/LICENSE +3 -0
- package/skills/engineering/test-quality/SKILL.md +79 -0
- package/skills/engineering/test-quality/references/audit.md +80 -0
- package/skills/engineering/test-quality/references/lint.md +24 -0
- package/skills/engineering/test-quality/references/principles.md +143 -0
- package/skills/engineering/test-quality/references/testing-conventions.md +9 -0
- package/skills/engineering/test-quality/release-check.mjs +93 -0
- package/skills/engineering/test-quality/scripts/lint-tests.mjs +574 -0
- package/skills/engineering/test-quality/scripts/lint-tests.test.mjs +591 -0
- package/skills/engineering/test-quality/scripts/mock-policy-config.mjs +176 -0
- package/skills/engineering/test-quality/scripts/mock-policy-config.test.mjs +119 -0
- package/skills/engineering/test-quality/scripts/persist-conventions-core.mjs +117 -0
- package/skills/engineering/test-quality/scripts/persist-conventions.mjs +17 -0
- package/skills/engineering/test-quality/scripts/persist-conventions.test.mjs +104 -0
- package/skills/risk-compliance/compliance-audit/LICENSE +3 -0
- package/skills/risk-compliance/compliance-audit/SKILL.md +439 -0
- package/skills/risk-compliance/compliance-audit/references/findings-schema.md +293 -0
- package/skills/risk-compliance/compliance-audit/references/normalization-rules.md +45 -0
- package/skills/risk-compliance/compliance-audit/references/vars-checklist.md +1068 -0
- package/skills/risk-compliance/compliance-audit/references/vars-findings-schema.md +398 -0
- package/skills/risk-compliance/compliance-audit/release-check.mjs +93 -0
- package/skills/risk-compliance/compliance-audit/scripts/compliance-audit.test.mjs +14 -0
- package/skills/risk-compliance/compliance-audit/scripts/export_tracker_xlsx.py +221 -0
- package/skills/risk-compliance/compliance-audit/scripts/reconcile_tracker.py +458 -0
- package/skills/risk-compliance/compliance-audit/scripts/test_export_tracker_xlsx.py +97 -0
- package/skills/risk-compliance/compliance-audit/scripts/test_validate_tracker.py +157 -0
- package/skills/risk-compliance/compliance-audit/scripts/validate_tracker.py +829 -0
- package/skills/risk-compliance/contract-compare/LICENSE +3 -0
- package/skills/risk-compliance/contract-compare/SKILL.md +199 -0
- package/skills/risk-compliance/contract-compare/references/comparison-dimensions.md +209 -0
- package/skills/risk-compliance/contract-compare/release-check.mjs +93 -0
- package/skills/risk-compliance/contract-review/LICENSE +3 -0
- package/skills/risk-compliance/contract-review/SKILL.md +240 -0
- package/skills/risk-compliance/contract-review/references/review-criteria.md +223 -0
- package/skills/risk-compliance/contract-review/release-check.mjs +93 -0
- package/skills/risk-compliance/doc-authenticity/LICENSE +3 -0
- package/skills/risk-compliance/doc-authenticity/SKILL.md +160 -0
- package/skills/risk-compliance/doc-authenticity/agents/openai.yaml +8 -0
- package/skills/risk-compliance/doc-authenticity/manual-invocation.test.mjs +12 -0
- package/skills/risk-compliance/doc-authenticity/references/agreement.md +66 -0
- package/skills/risk-compliance/doc-authenticity/references/bank-statement.md +150 -0
- package/skills/risk-compliance/doc-authenticity/references/forensic-signals.md +157 -0
- package/skills/risk-compliance/doc-authenticity/references/image-signals.md +114 -0
- package/skills/risk-compliance/doc-authenticity/references/invoice.md +66 -0
- package/skills/risk-compliance/doc-authenticity/references/issuer-profiles.md +86 -0
- package/skills/risk-compliance/doc-authenticity/references/verdict-and-report.md +95 -0
- package/skills/risk-compliance/doc-authenticity/references/verdict.schema.json +81 -0
- package/skills/risk-compliance/doc-authenticity/release-check.mjs +93 -0
- package/skills/risk-compliance/doc-authenticity/scripts/image_forensics.py +294 -0
- package/skills/risk-compliance/doc-authenticity/scripts/pdf_forensics.py +401 -0
- package/skills/risk-compliance/doc-authenticity/scripts/validate_codes.py +224 -0
- package/skills/risk-compliance/doc-authenticity/scripts/validate_verdict.py +308 -0
- package/skills/risk-compliance/doc-authenticity/scripts/validate_verdict.test.mjs +212 -0
- package/skills/risk-compliance/fraud-analysis/LICENSE +3 -0
- package/skills/risk-compliance/fraud-analysis/SKILL.md +114 -0
- package/skills/risk-compliance/fraud-analysis/references/archetypes/authorized-payment-scam.md +41 -0
- package/skills/risk-compliance/fraud-analysis/references/archetypes/first-party-fraud.md +44 -0
- package/skills/risk-compliance/fraud-analysis/references/archetypes/third-party-fraud.md +27 -0
- package/skills/risk-compliance/fraud-analysis/references/contexts/bank-transfer.md +24 -0
- package/skills/risk-compliance/fraud-analysis/references/contexts/card-payment.md +30 -0
- package/skills/risk-compliance/fraud-analysis/references/contexts/payment-collection.md +20 -0
- package/skills/risk-compliance/fraud-analysis/references/contexts/payout.md +20 -0
- package/skills/risk-compliance/fraud-analysis/references/feature-engineering.md +158 -0
- package/skills/risk-compliance/fraud-analysis/references/mechanisms/account-takeover.md +36 -0
- package/skills/risk-compliance/fraud-analysis/references/report-rationale.md +45 -0
- package/skills/risk-compliance/fraud-analysis/references/report-template.md +190 -0
- package/skills/risk-compliance/fraud-analysis/references/review-checklist.md +175 -0
- package/skills/risk-compliance/fraud-analysis/references/taxonomy.md +79 -0
- package/skills/risk-compliance/fraud-analysis/references/terminology.md +108 -0
- package/skills/risk-compliance/fraud-analysis/references/workflow.md +175 -0
- package/skills/risk-compliance/fraud-analysis/release-check.mjs +93 -0
- package/skills/risk-compliance/payment-analysis/LICENSE +3 -0
- package/skills/risk-compliance/payment-analysis/SKILL.md +180 -0
- package/skills/risk-compliance/payment-analysis/references/auth-rate-actions.md +30 -0
- package/skills/risk-compliance/payment-analysis/references/chargebacks.md +208 -0
- package/skills/risk-compliance/payment-analysis/references/chinese-polish.md +51 -0
- package/skills/risk-compliance/payment-analysis/references/event-layers.md +127 -0
- package/skills/risk-compliance/payment-analysis/references/fx.md +59 -0
- package/skills/risk-compliance/payment-analysis/references/journey.md +79 -0
- package/skills/risk-compliance/payment-analysis/references/metrics.md +67 -0
- package/skills/risk-compliance/payment-analysis/references/report-template.md +119 -0
- package/skills/risk-compliance/payment-analysis/references/terminology.md +95 -0
- package/skills/risk-compliance/payment-analysis/references/visualization.md +56 -0
- package/skills/risk-compliance/payment-analysis/release-check.mjs +93 -0
- package/skills/risk-compliance/report-writing/LICENSE +3 -0
- package/skills/risk-compliance/report-writing/SKILL.md +220 -0
- package/skills/risk-compliance/report-writing/references/audit-report-template.md +121 -0
- package/skills/risk-compliance/report-writing/references/external-assessment-template.md +167 -0
- package/skills/risk-compliance/report-writing/references/management-report-template.md +145 -0
- package/skills/risk-compliance/report-writing/references/vars-report-template.md +224 -0
- package/skills/risk-compliance/report-writing/release-check.mjs +93 -0
- package/skills/risk-compliance/similar-domain/LICENSE +3 -0
- package/skills/risk-compliance/similar-domain/SKILL.md +203 -0
- package/skills/risk-compliance/similar-domain/references/entities.md +67 -0
- package/skills/risk-compliance/similar-domain/references/fingerprints.md +134 -0
- package/skills/risk-compliance/similar-domain/references/pivots.md +82 -0
- package/skills/risk-compliance/similar-domain/references/report-template.md +93 -0
- package/skills/risk-compliance/similar-domain/references/scoring.md +130 -0
- package/skills/risk-compliance/similar-domain/references/terminology.md +41 -0
- package/skills/risk-compliance/similar-domain/references/workflow.md +85 -0
- package/skills/risk-compliance/similar-domain/release-check.mjs +93 -0
- package/skills/risk-compliance/tld-detection/LICENSE +3 -0
- package/skills/risk-compliance/tld-detection/SKILL.md +245 -0
- package/skills/risk-compliance/tld-detection/agents/openai.yaml +9 -0
- package/skills/risk-compliance/tld-detection/references/chinese-polish.md +55 -0
- package/skills/risk-compliance/tld-detection/references/clean.md +51 -0
- package/skills/risk-compliance/tld-detection/references/clustering.md +235 -0
- package/skills/risk-compliance/tld-detection/references/decision.md +189 -0
- package/skills/risk-compliance/tld-detection/references/fx-conversion.md +232 -0
- package/skills/risk-compliance/tld-detection/references/report-template.md +272 -0
- package/skills/risk-compliance/tld-detection/references/streams.md +141 -0
- package/skills/risk-compliance/tld-detection/references/terminology.md +95 -0
- package/skills/risk-compliance/tld-detection/references/workflow.md +95 -0
- package/skills/risk-compliance/tld-detection/release-check.mjs +93 -0
- package/skills/risk-compliance/tld-detection/scripts/detect_ladders.py +390 -0
- package/skills/risk-compliance/tld-detection/scripts/detect_ladders.test.mjs +14 -0
- package/skills/risk-compliance/tld-detection/scripts/detect_streams.py +650 -0
- package/skills/risk-compliance/tld-detection/scripts/detect_streams.test.mjs +14 -0
- package/skills/risk-compliance/tld-detection/tests/test_detect_ladders.py +134 -0
- package/skills/risk-compliance/tld-detection/tests/test_detect_streams.py +520 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Install, or check, the compaction hook that runs rehydrate.mjs: after a context compaction the
|
|
3
|
+
// coordinator is told to read its skills in full again.
|
|
4
|
+
//
|
|
5
|
+
// install-hooks.mjs [--check] [--harness claude|codex] [--home <dir>] [--json] [--exit-missing]
|
|
6
|
+
//
|
|
7
|
+
// Writes one SessionStart entry with matcher `compact` to ~/.claude/settings.json (Claude Code)
|
|
8
|
+
// and ~/.codex/hooks.json (Codex), for each harness whose home directory exists. Idempotent: an
|
|
9
|
+
// entry already running rehydrate.mjs is kept, and its path updated when the skill moved. Every
|
|
10
|
+
// other setting and hook is left as it was. Pi gets the same re-read from its workflow
|
|
11
|
+
// extension, not from a hook file.
|
|
12
|
+
//
|
|
13
|
+
// --check writes nothing. Claude Code counts as installed when the engineering-workflow plugin
|
|
14
|
+
// is enabled, since the plugin ships the same hook; then no settings hook is written either,
|
|
15
|
+
// or the message would arrive twice.
|
|
16
|
+
//
|
|
17
|
+
// Exit 0 whenever it ran: each harness's status (absent, plugin, installed, updated, or
|
|
18
|
+
// missing) is in the output, and --check ends with a `missing: ...` line when one lacks the hook
|
|
19
|
+
// (--json prints `{ results, missing }`). Exit 2 on bad input or a settings file that is not JSON
|
|
20
|
+
// (never overwritten). --exit-missing restores the old exit 1 when --check finds one missing
|
|
21
|
+
// (deprecated).
|
|
22
|
+
|
|
23
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
|
|
24
|
+
import { homedir } from 'node:os'
|
|
25
|
+
import { dirname, join } from 'node:path'
|
|
26
|
+
import { fileURLToPath } from 'node:url'
|
|
27
|
+
|
|
28
|
+
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs'
|
|
29
|
+
|
|
30
|
+
export const REHYDRATE = join(dirname(fileURLToPath(import.meta.url)), 'rehydrate.mjs')
|
|
31
|
+
export const PLUGIN = 'engineering-workflow@'
|
|
32
|
+
const HARNESSES = {
|
|
33
|
+
claude: { dir: '.claude', file: 'settings.json' },
|
|
34
|
+
codex: { dir: '.codex', file: 'hooks.json' },
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class InstallHooksError extends Error {}
|
|
38
|
+
|
|
39
|
+
export const hookCommand = (script = REHYDRATE) => `node "${script}" --hook`
|
|
40
|
+
const isOurs = (h) => typeof h?.command === 'string' && h.command.includes('rehydrate.mjs')
|
|
41
|
+
|
|
42
|
+
// The settings object with the hook in place, and whether anything changed.
|
|
43
|
+
export function withHook(settings, command = hookCommand()) {
|
|
44
|
+
const isObject = (v) => v !== null && typeof v === 'object' && !Array.isArray(v)
|
|
45
|
+
if (!isObject(settings ?? {})) throw new InstallHooksError('the settings file is not a JSON object; fix it by hand, nothing was written')
|
|
46
|
+
const next = structuredClone(settings ?? {})
|
|
47
|
+
next.hooks ??= {}
|
|
48
|
+
next.hooks.SessionStart ??= []
|
|
49
|
+
if (!isObject(next.hooks) || !Array.isArray(next.hooks.SessionStart)) {
|
|
50
|
+
throw new InstallHooksError('hooks.SessionStart is not a list; fix it by hand, nothing was written')
|
|
51
|
+
}
|
|
52
|
+
let found = false
|
|
53
|
+
let changed = false
|
|
54
|
+
for (const group of next.hooks.SessionStart) {
|
|
55
|
+
for (const h of group?.hooks ?? []) {
|
|
56
|
+
if (!isOurs(h)) continue
|
|
57
|
+
found = true
|
|
58
|
+
if (h.command !== command) { h.command = command; changed = true }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!found) {
|
|
62
|
+
next.hooks.SessionStart.push({ matcher: 'compact', hooks: [{ type: 'command', command, timeout: 10 }] })
|
|
63
|
+
changed = true
|
|
64
|
+
}
|
|
65
|
+
return { settings: next, changed }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const pluginEnabled = (settings, harness) => harness === 'claude'
|
|
69
|
+
&& Object.entries(settings?.enabledPlugins ?? {}).some(([k, v]) => k.startsWith(PLUGIN) && v === true)
|
|
70
|
+
|
|
71
|
+
export function hasHook(settings, harness) {
|
|
72
|
+
const groups = Array.isArray(settings?.hooks?.SessionStart) ? settings.hooks.SessionStart : []
|
|
73
|
+
return groups.some((g) => (g?.hooks ?? []).some(isOurs)) || pluginEnabled(settings, harness)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function readJson(file) {
|
|
77
|
+
if (!existsSync(file)) return {}
|
|
78
|
+
try { return JSON.parse(readFileSync(file, 'utf8')) } catch (error) {
|
|
79
|
+
throw new InstallHooksError(`${file} is not JSON (${error.message}); fix it by hand, nothing was written`)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// [{ harness, file, status }] with status installed | updated | plugin | missing | absent (no
|
|
84
|
+
// harness home).
|
|
85
|
+
export function run({ home = homedir(), check = false, harness } = {}) {
|
|
86
|
+
const names = harness ? [harness] : Object.keys(HARNESSES)
|
|
87
|
+
const out = []
|
|
88
|
+
for (const name of names) {
|
|
89
|
+
const h = HARNESSES[name]
|
|
90
|
+
if (!h) throw new InstallHooksError(`unknown harness ${name}: use claude or codex`)
|
|
91
|
+
const file = join(home, h.dir, h.file)
|
|
92
|
+
if (!existsSync(join(home, h.dir))) { out.push({ harness: name, file, status: 'absent' }); continue }
|
|
93
|
+
const settings = readJson(file)
|
|
94
|
+
if (pluginEnabled(settings, name)) { out.push({ harness: name, file, status: 'plugin' }); continue }
|
|
95
|
+
if (check) { out.push({ harness: name, file, status: hasHook(settings, name) ? 'installed' : 'missing' }); continue }
|
|
96
|
+
const { settings: next, changed } = withHook(settings)
|
|
97
|
+
if (changed) {
|
|
98
|
+
mkdirSync(dirname(file), { recursive: true })
|
|
99
|
+
writeFileSync(`${file}.tmp`, `${JSON.stringify(next, null, 2)}\n`)
|
|
100
|
+
renameSync(`${file}.tmp`, file)
|
|
101
|
+
}
|
|
102
|
+
out.push({ harness: name, file, status: changed ? 'updated' : 'installed' })
|
|
103
|
+
}
|
|
104
|
+
return out
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function parseCliArgs(argv) {
|
|
108
|
+
const opts = { check: false }
|
|
109
|
+
for (let i = 0; i < argv.length; i++) {
|
|
110
|
+
if (argv[i] === '--check') { opts.check = true; continue }
|
|
111
|
+
if (argv[i] === '--json') { opts.json = true; continue }
|
|
112
|
+
if (argv[i] === '--exit-missing') { opts.exitMissing = true; continue }
|
|
113
|
+
if (['--home', '--harness'].includes(argv[i]) && argv[i + 1] !== undefined) { opts[argv[i].slice(2)] = argv[++i]; continue }
|
|
114
|
+
throw new InstallHooksError('usage: install-hooks.mjs [--check] [--harness claude|codex] [--home <dir>] [--json] [--exit-missing]')
|
|
115
|
+
}
|
|
116
|
+
return opts
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (isMainModule(import.meta.url)) {
|
|
120
|
+
try {
|
|
121
|
+
const opts = parseCliArgs(process.argv.slice(2))
|
|
122
|
+
const results = run(opts)
|
|
123
|
+
const missing = results.filter((r) => r.status === 'missing').map((r) => r.harness)
|
|
124
|
+
if (opts.json) process.stdout.write(`${JSON.stringify({ results, missing }, null, 2)}\n`)
|
|
125
|
+
else {
|
|
126
|
+
for (const r of results) process.stdout.write(`${r.harness.padEnd(8)}${r.status.padEnd(11)}${r.file}\n`)
|
|
127
|
+
if (missing.length) process.stdout.write(`missing: ${missing.join(', ')} (run without --check to install)\n`)
|
|
128
|
+
if (results.some((r) => r.status === 'updated')) process.stdout.write('Codex may ask you to trust the new hook at its next start.\n')
|
|
129
|
+
}
|
|
130
|
+
process.exitCode = opts.exitMissing && missing.length ? 1 : 0
|
|
131
|
+
} catch (error) {
|
|
132
|
+
process.stderr.write(`install-hooks: ${error.message}\n`)
|
|
133
|
+
process.exitCode = 2
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { test } from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
import { spawnSync } from 'node:child_process'
|
|
4
|
+
import fs from 'node:fs'
|
|
5
|
+
import os from 'node:os'
|
|
6
|
+
import path from 'node:path'
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
|
+
|
|
9
|
+
import { run, withHook, hookCommand, REHYDRATE } from './install-hooks.mjs'
|
|
10
|
+
|
|
11
|
+
const SCRIPT = path.join(path.dirname(fileURLToPath(import.meta.url)), 'install-hooks.mjs')
|
|
12
|
+
|
|
13
|
+
function home(files = {}) {
|
|
14
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'install-hooks-'))
|
|
15
|
+
for (const [rel, body] of Object.entries(files)) {
|
|
16
|
+
fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true })
|
|
17
|
+
fs.writeFileSync(path.join(dir, rel), typeof body === 'string' ? body : JSON.stringify(body))
|
|
18
|
+
}
|
|
19
|
+
return dir
|
|
20
|
+
}
|
|
21
|
+
const read = (dir, rel) => JSON.parse(fs.readFileSync(path.join(dir, rel), 'utf8'))
|
|
22
|
+
|
|
23
|
+
test('installs into both harnesses, keeps every other setting and hook, and a second run changes nothing', () => {
|
|
24
|
+
const herdr = { hooks: [{ type: 'command', command: 'bash herdr.sh session' }] }
|
|
25
|
+
const dir = home({
|
|
26
|
+
'.claude/settings.json': { model: 'opus', hooks: { SessionStart: [herdr], Stop: [{ hooks: [] }] } },
|
|
27
|
+
'.codex/hooks.json': { hooks: { SessionStart: [herdr] } },
|
|
28
|
+
})
|
|
29
|
+
assert.deepEqual(run({ home: dir }).map((r) => `${r.harness}:${r.status}`), ['claude:updated', 'codex:updated'])
|
|
30
|
+
const claude = read(dir, '.claude/settings.json')
|
|
31
|
+
assert.equal(claude.model, 'opus')
|
|
32
|
+
assert.deepEqual(claude.hooks.Stop, [{ hooks: [] }])
|
|
33
|
+
assert.deepEqual(claude.hooks.SessionStart, [herdr, { matcher: 'compact', hooks: [{ type: 'command', command: hookCommand(), timeout: 10 }] }])
|
|
34
|
+
assert.deepEqual(read(dir, '.codex/hooks.json').hooks.SessionStart[1].matcher, 'compact')
|
|
35
|
+
assert.deepEqual(run({ home: dir }).map((r) => r.status), ['installed', 'installed'])
|
|
36
|
+
assert.deepEqual(run({ home: dir, check: true }).map((r) => r.status), ['installed', 'installed'])
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test('a moved skill updates the old entry in place instead of adding a second', () => {
|
|
40
|
+
const old = { hooks: { SessionStart: [{ matcher: 'compact', hooks: [{ type: 'command', command: 'node "/old/resolve-issues/scripts/rehydrate.mjs" --hook' }] }] } }
|
|
41
|
+
const { settings, changed } = withHook(old)
|
|
42
|
+
assert.equal(changed, true)
|
|
43
|
+
assert.equal(settings.hooks.SessionStart.length, 1)
|
|
44
|
+
assert.equal(settings.hooks.SessionStart[0].hooks[0].command, `node "${REHYDRATE}" --hook`)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('check: a missing hook is reported in the output (exit 0; --exit-missing exits 1) and nothing is written; an enabled plugin counts; no harness home is absent', () => {
|
|
48
|
+
const dir = home({ '.claude/settings.json': { model: 'opus' } })
|
|
49
|
+
const out = spawnSync(process.execPath, [SCRIPT, '--check', '--home', dir], { encoding: 'utf8' })
|
|
50
|
+
assert.equal(out.status, 0, out.stderr)
|
|
51
|
+
assert.match(out.stdout, /claude {2}missing/)
|
|
52
|
+
assert.match(out.stdout, /codex {3}absent/)
|
|
53
|
+
assert.match(out.stdout, /^missing: claude/m)
|
|
54
|
+
const json = JSON.parse(spawnSync(process.execPath, [SCRIPT, '--check', '--json', '--home', dir], { encoding: 'utf8' }).stdout)
|
|
55
|
+
assert.deepEqual(json.missing, ['claude'])
|
|
56
|
+
assert.equal(spawnSync(process.execPath, [SCRIPT, '--check', '--exit-missing', '--home', dir], { encoding: 'utf8' }).status, 1)
|
|
57
|
+
assert.equal(spawnSync(process.execPath, [SCRIPT, '--bogus'], { encoding: 'utf8' }).status, 2)
|
|
58
|
+
assert.deepEqual(read(dir, '.claude/settings.json'), { model: 'opus' })
|
|
59
|
+
const plugin = home({ '.claude/settings.json': { enabledPlugins: { 'engineering-workflow@1aboveio-engineering-skills': true } } })
|
|
60
|
+
assert.deepEqual(run({ home: plugin, check: true, harness: 'claude' }).map((r) => r.status), ['plugin'])
|
|
61
|
+
assert.deepEqual(run({ home: plugin, harness: 'claude' }).map((r) => r.status), ['plugin'], 'the plugin ships the hook: no second copy')
|
|
62
|
+
assert.equal(read(plugin, '.claude/settings.json').hooks, undefined)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
test('a settings root or SessionStart of the wrong shape is refused, not silently kept', () => {
|
|
66
|
+
for (const body of [[], { hooks: { SessionStart: {} } }]) {
|
|
67
|
+
const dir = home({ '.claude/settings.json': body })
|
|
68
|
+
assert.throws(() => run({ home: dir, harness: 'claude' }), /fix it by hand/)
|
|
69
|
+
assert.deepEqual(read(dir, '.claude/settings.json'), body)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
test('a settings file that is not JSON is never overwritten', () => {
|
|
74
|
+
const dir = home({ '.claude/settings.json': '{ "model": "opus", // comment\n}' })
|
|
75
|
+
const out = spawnSync(process.execPath, [SCRIPT, '--home', dir, '--harness', 'claude'], { encoding: 'utf8' })
|
|
76
|
+
assert.equal(out.status, 2)
|
|
77
|
+
assert.match(out.stderr, /is not JSON/)
|
|
78
|
+
assert.equal(fs.readFileSync(path.join(dir, '.claude/settings.json'), 'utf8'), '{ "model": "opus", // comment\n}')
|
|
79
|
+
})
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Fetch a spec's GitHub issue tree (native sub-issues at any depth, each issue's labels and
|
|
3
|
+
// native `blockedBy` links) in as few calls as possible: one GraphQL query covers three
|
|
4
|
+
// levels, and follow-up queries run only where GitHub truncated something.
|
|
5
|
+
//
|
|
6
|
+
// issue-tree.mjs --issue <owner/name#123> [--json]
|
|
7
|
+
//
|
|
8
|
+
// Exit 0 whenever it ran (an incomplete tree is `complete: false` with `errors`, not a failure);
|
|
9
|
+
// 2 for a bad command.
|
|
10
|
+
//
|
|
11
|
+
// GraphQL caps a query at 500,000 potential nodes, counted from every `first:` multiplied
|
|
12
|
+
// down the nesting, so the levels narrow (50, 20, 10 sub-issues) and each issue asks for at
|
|
13
|
+
// most 20 labels and 10 blockers. A follow-up runs only for: an issue below the third
|
|
14
|
+
// level that has sub-issues (re-rooted query), an issue with more sub-issues than its
|
|
15
|
+
// level returned (pages of child numbers, each child re-rooted), and an issue with more
|
|
16
|
+
// labels or blockers than fit (one wide detail query). Transient failures (HTTP 502/503/
|
|
17
|
+
// 504, EOF, timeouts, connection resets) retry; anything still failing is listed in
|
|
18
|
+
// `errors` and the tree is marked incomplete, never guessed.
|
|
19
|
+
//
|
|
20
|
+
// Result: { root, complete, errors, nodes: { "owner/name#n": node } } where a node is
|
|
21
|
+
// { key, repo, number, title, state ('open'|'closed'), url, labels, blockedBy: [{ key, state }],
|
|
22
|
+
// children: [key] | null (null = not fetched), parent }.
|
|
23
|
+
|
|
24
|
+
import { execFileSync } from 'node:child_process'
|
|
25
|
+
|
|
26
|
+
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs'
|
|
27
|
+
|
|
28
|
+
export const WIDTHS = [50, 20, 10]
|
|
29
|
+
const LABELS = 20
|
|
30
|
+
const BLOCKERS = 10
|
|
31
|
+
const WIDE = 100
|
|
32
|
+
const TRANSIENT = /\b(?:502|503|504)\b|EOF|ETIMEDOUT|timed? ?out|ECONNRESET|socket hang up|Bad Gateway|Service Unavailable|Gateway Timeout/i
|
|
33
|
+
|
|
34
|
+
const fields = (labels, blockers) => `number title state url repository { nameWithOwner }
|
|
35
|
+
labels(first: ${labels}) { totalCount nodes { name } }
|
|
36
|
+
blockedBy(first: ${blockers}) { totalCount nodes { number state repository { nameWithOwner } } }`
|
|
37
|
+
|
|
38
|
+
function level(depth) {
|
|
39
|
+
if (depth >= WIDTHS.length) return 'subIssuesSummary { total }'
|
|
40
|
+
return `subIssues(first: ${WIDTHS[depth]}) { totalCount pageInfo { hasNextPage endCursor }
|
|
41
|
+
nodes { ${fields(LABELS, BLOCKERS)} ${level(depth + 1)} } }`
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const TREE_QUERY = `query($owner: String!, $name: String!, $number: Int!) {
|
|
45
|
+
repository(owner: $owner, name: $name) { issue(number: $number) { ${fields(LABELS, BLOCKERS)} ${level(0)} } } }`
|
|
46
|
+
|
|
47
|
+
export const PAGE_QUERY = `query($owner: String!, $name: String!, $number: Int!, $after: String!) {
|
|
48
|
+
repository(owner: $owner, name: $name) { issue(number: $number) {
|
|
49
|
+
subIssues(first: ${WIDE}, after: $after) { pageInfo { hasNextPage endCursor } nodes { number repository { nameWithOwner } } } } } }`
|
|
50
|
+
|
|
51
|
+
export const DETAIL_QUERY = `query($owner: String!, $name: String!, $number: Int!) {
|
|
52
|
+
repository(owner: $owner, name: $name) { issue(number: $number) { ${fields(WIDE, WIDE)} } } }`
|
|
53
|
+
|
|
54
|
+
export const keyOf = (repo, number) => `${repo}#${number}`
|
|
55
|
+
const split = (key) => { const i = key.lastIndexOf('#'); return { repo: key.slice(0, i), number: Number(key.slice(i + 1)) } }
|
|
56
|
+
|
|
57
|
+
// Retry a call while it fails transiently; `sleep` is injected so tests do not wait.
|
|
58
|
+
export function withRetry(fn, { attempts = 3, sleep = sleepSync } = {}) {
|
|
59
|
+
return (...args) => {
|
|
60
|
+
for (let i = 1; ; i++) {
|
|
61
|
+
try { return fn(...args) } catch (error) {
|
|
62
|
+
if (i >= attempts || !TRANSIENT.test(String(error?.message || error))) throw error
|
|
63
|
+
sleep(1000 * i)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function sleepSync(ms) { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms) }
|
|
70
|
+
|
|
71
|
+
// `graphql(query, variables)` returns the response's `data`; inject it to test without GitHub.
|
|
72
|
+
export function fetchTree(rootRef, { graphql = ghGraphql, attempts = 3, sleep } = {}) {
|
|
73
|
+
const call = withRetry(graphql, { attempts, sleep })
|
|
74
|
+
const nodes = {}
|
|
75
|
+
const errors = []
|
|
76
|
+
const root = keyOf(rootRef.repo, rootRef.number)
|
|
77
|
+
const issueOf = (key, query, extra = {}) => {
|
|
78
|
+
const { repo, number } = split(key)
|
|
79
|
+
const [owner, name] = repo.split('/')
|
|
80
|
+
const issue = call(query, { owner, name, number, ...extra })?.repository?.issue
|
|
81
|
+
if (!issue) throw new Error(`issue ${key} not found`)
|
|
82
|
+
return issue
|
|
83
|
+
}
|
|
84
|
+
const followUps = []
|
|
85
|
+
|
|
86
|
+
// Record an issue and everything nested under it; queue follow-ups for what was cut off.
|
|
87
|
+
const record = (raw, parent) => {
|
|
88
|
+
const repo = raw.repository?.nameWithOwner
|
|
89
|
+
const key = keyOf(repo, raw.number)
|
|
90
|
+
const prior = nodes[key]
|
|
91
|
+
const node = {
|
|
92
|
+
key, repo, number: raw.number, title: raw.title ?? null,
|
|
93
|
+
state: String(raw.state || '').toLowerCase(), url: raw.url ?? null,
|
|
94
|
+
labels: (raw.labels?.nodes ?? []).map((l) => l.name),
|
|
95
|
+
blockedBy: (raw.blockedBy?.nodes ?? []).map((b) => ({ key: keyOf(b.repository?.nameWithOwner ?? repo, b.number), state: String(b.state || '').toLowerCase() })),
|
|
96
|
+
children: null,
|
|
97
|
+
parent: prior?.parent ?? parent,
|
|
98
|
+
}
|
|
99
|
+
nodes[key] = node
|
|
100
|
+
if ((raw.labels?.totalCount ?? 0) > node.labels.length || (raw.blockedBy?.totalCount ?? 0) > node.blockedBy.length) followUps.push({ kind: 'detail', key })
|
|
101
|
+
if (raw.subIssues) {
|
|
102
|
+
node.children = raw.subIssues.nodes.map((child) => record(child, key))
|
|
103
|
+
if (raw.subIssues.pageInfo?.hasNextPage) followUps.push({ kind: 'page', key, after: raw.subIssues.pageInfo.endCursor })
|
|
104
|
+
} else if ((raw.subIssuesSummary?.total ?? 0) === 0) {
|
|
105
|
+
node.children = []
|
|
106
|
+
} else {
|
|
107
|
+
followUps.push({ kind: 'reroot', key })
|
|
108
|
+
}
|
|
109
|
+
return key
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
record(issueOf(root, TREE_QUERY), null)
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return { root, complete: false, errors: [{ key: root, error: String(error?.message || error) }], nodes }
|
|
116
|
+
}
|
|
117
|
+
while (followUps.length) {
|
|
118
|
+
const job = followUps.shift()
|
|
119
|
+
try {
|
|
120
|
+
if (job.kind === 'reroot') record(issueOf(job.key, TREE_QUERY), nodes[job.key]?.parent ?? null)
|
|
121
|
+
else if (job.kind === 'detail') {
|
|
122
|
+
const raw = issueOf(job.key, DETAIL_QUERY)
|
|
123
|
+
const node = nodes[job.key]
|
|
124
|
+
node.labels = (raw.labels?.nodes ?? []).map((l) => l.name)
|
|
125
|
+
node.blockedBy = (raw.blockedBy?.nodes ?? []).map((b) => ({ key: keyOf(b.repository?.nameWithOwner ?? node.repo, b.number), state: String(b.state || '').toLowerCase() }))
|
|
126
|
+
} else if (job.kind === 'page') {
|
|
127
|
+
const page = issueOf(job.key, PAGE_QUERY, { after: job.after }).subIssues
|
|
128
|
+
for (const child of page.nodes) {
|
|
129
|
+
const childKey = keyOf(child.repository?.nameWithOwner, child.number)
|
|
130
|
+
nodes[job.key].children.push(childKey)
|
|
131
|
+
nodes[childKey] = { key: childKey, parent: job.key }
|
|
132
|
+
followUps.push({ kind: 'reroot', key: childKey })
|
|
133
|
+
}
|
|
134
|
+
if (page.pageInfo?.hasNextPage) followUps.push({ kind: 'page', key: job.key, after: page.pageInfo.endCursor })
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
errors.push({ key: job.key, error: String(error?.message || error) })
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { root, complete: errors.length === 0, errors, nodes }
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function ghGraphql(query, variables) {
|
|
144
|
+
const args = ['api', 'graphql', '-f', `query=${query}`]
|
|
145
|
+
for (const [name, value] of Object.entries(variables)) args.push(typeof value === 'number' ? '-F' : '-f', `${name}=${value}`)
|
|
146
|
+
const out = JSON.parse(execFileSync('gh', args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60_000 }))
|
|
147
|
+
if (out.errors?.length) throw new Error(out.errors.map((e) => e.message).join('; '))
|
|
148
|
+
return out.data
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (isMainModule(import.meta.url)) {
|
|
152
|
+
const i = process.argv.indexOf('--issue')
|
|
153
|
+
const m = /^([^/\s#]+\/[^/\s#]+)#(\d+)$/.exec(process.argv[i + 1] ?? '')
|
|
154
|
+
if (i < 0 || !m) {
|
|
155
|
+
console.error('usage: issue-tree.mjs --issue <owner/name#123>')
|
|
156
|
+
process.exitCode = 2
|
|
157
|
+
} else {
|
|
158
|
+
const tree = fetchTree({ repo: m[1], number: Number(m[2]) })
|
|
159
|
+
console.log(JSON.stringify(tree, null, 2))
|
|
160
|
+
// exit 0 whenever it ran: `complete` and `errors` in the output say whether the tree is whole
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { test } from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
|
|
4
|
+
import { DETAIL_QUERY, PAGE_QUERY, TREE_QUERY, WIDTHS, fetchTree, withRetry } from './issue-tree.mjs'
|
|
5
|
+
|
|
6
|
+
// A fake GitHub GraphQL endpoint over issues keyed "o/r#n": { state, labels, blockedBy, children }.
|
|
7
|
+
// It honors the query's level widths, so truncation and follow-ups behave as on GitHub.
|
|
8
|
+
function fakeGraphql(issues, { fail = {} } = {}) {
|
|
9
|
+
const calls = []
|
|
10
|
+
const node = (key, depth, widths) => {
|
|
11
|
+
const i = issues[key]
|
|
12
|
+
const [repo, n] = key.split('#')
|
|
13
|
+
const labels = i.labels ?? []
|
|
14
|
+
const blockers = i.blockedBy ?? []
|
|
15
|
+
const out = {
|
|
16
|
+
number: Number(n), title: `t${n}`, state: (i.state ?? 'open').toUpperCase(), url: null, repository: { nameWithOwner: repo },
|
|
17
|
+
labels: { totalCount: labels.length, nodes: labels.slice(0, widths.labels).map((name) => ({ name })) },
|
|
18
|
+
blockedBy: { totalCount: blockers.length, nodes: blockers.slice(0, widths.blockers).map((b) => ({ number: Number(b.split('#')[1]), state: (issues[b]?.state ?? 'open').toUpperCase(), repository: { nameWithOwner: b.split('#')[0] } })) },
|
|
19
|
+
}
|
|
20
|
+
const kids = i.children ?? []
|
|
21
|
+
if (depth >= WIDTHS.length) out.subIssuesSummary = { total: kids.length }
|
|
22
|
+
else {
|
|
23
|
+
const shown = kids.slice(0, WIDTHS[depth])
|
|
24
|
+
out.subIssues = { totalCount: kids.length, pageInfo: { hasNextPage: kids.length > shown.length, endCursor: String(shown.length) }, nodes: shown.map((k) => node(k, depth + 1, widths)) }
|
|
25
|
+
}
|
|
26
|
+
return out
|
|
27
|
+
}
|
|
28
|
+
const graphql = (query, { owner, name, number, after }) => {
|
|
29
|
+
const key = `${owner}/${name}#${number}`
|
|
30
|
+
const kind = query === TREE_QUERY ? 'tree' : query === DETAIL_QUERY ? 'detail' : query === PAGE_QUERY ? 'page' : 'unknown'
|
|
31
|
+
calls.push(`${kind} ${key}`)
|
|
32
|
+
if (fail[key]) { const err = fail[key]; if (typeof err === 'number') { fail[key]--; throw new Error('HTTP 502 Bad Gateway') } throw new Error(err) }
|
|
33
|
+
if (!issues[key]) return { repository: { issue: null } }
|
|
34
|
+
if (kind === 'tree') return { repository: { issue: node(key, 0, { labels: 20, blockers: 10 }) } }
|
|
35
|
+
if (kind === 'detail') { const full = node(key, WIDTHS.length, { labels: 100, blockers: 100 }); delete full.subIssuesSummary; return { repository: { issue: full } } }
|
|
36
|
+
const kids = issues[key].children.slice(Number(after), Number(after) + 100)
|
|
37
|
+
return { repository: { issue: { subIssues: { pageInfo: { hasNextPage: Number(after) + 100 < issues[key].children.length, endCursor: String(Number(after) + 100) }, nodes: kids.map((k) => ({ number: Number(k.split('#')[1]), repository: { nameWithOwner: k.split('#')[0] } })) } } } }
|
|
38
|
+
}
|
|
39
|
+
return { graphql, calls }
|
|
40
|
+
}
|
|
41
|
+
const noSleep = () => {}
|
|
42
|
+
|
|
43
|
+
test('one query fetches three levels with labels and blockers', () => {
|
|
44
|
+
const { graphql, calls } = fakeGraphql({
|
|
45
|
+
'o/r#1': { children: ['o/r#2', 'o/r#3'] },
|
|
46
|
+
'o/r#2': { state: 'closed', labels: ['ready-for-agent'] },
|
|
47
|
+
'o/r#3': { children: ['x/y#4'], blockedBy: ['o/r#2'] },
|
|
48
|
+
'x/y#4': { labels: ['ready-for-agent'] },
|
|
49
|
+
})
|
|
50
|
+
const tree = fetchTree({ repo: 'o/r', number: 1 }, { graphql, sleep: noSleep })
|
|
51
|
+
assert.equal(tree.complete, true)
|
|
52
|
+
assert.deepEqual(calls, ['tree o/r#1'])
|
|
53
|
+
assert.deepEqual(tree.nodes['o/r#3'].children, ['x/y#4'])
|
|
54
|
+
assert.deepEqual(tree.nodes['o/r#3'].blockedBy, [{ key: 'o/r#2', state: 'closed' }])
|
|
55
|
+
assert.equal(tree.nodes['x/y#4'].parent, 'o/r#3')
|
|
56
|
+
assert.equal(tree.nodes['o/r#2'].state, 'closed')
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test('follow-ups run only where GitHub truncated: depth, child pages, wide labels or blockers', () => {
|
|
60
|
+
const many = Array.from({ length: 55 }, (_, i) => `o/r#${100 + i}`)
|
|
61
|
+
const issues = {
|
|
62
|
+
'o/r#1': { children: ['o/r#2', ...many] },
|
|
63
|
+
'o/r#2': { children: ['o/r#3'], blockedBy: Array.from({ length: 12 }, (_, i) => `o/r#${200 + i}`) },
|
|
64
|
+
'o/r#3': { children: ['o/r#4'] },
|
|
65
|
+
'o/r#4': { children: ['o/r#5'] },
|
|
66
|
+
'o/r#5': {},
|
|
67
|
+
}
|
|
68
|
+
for (const k of many) issues[k] = {}
|
|
69
|
+
const { graphql, calls } = fakeGraphql(issues)
|
|
70
|
+
const tree = fetchTree({ repo: 'o/r', number: 1 }, { graphql, sleep: noSleep })
|
|
71
|
+
assert.equal(tree.complete, true)
|
|
72
|
+
assert.equal(tree.nodes['o/r#1'].children.length, 56, 'every child, past the first level width')
|
|
73
|
+
assert.deepEqual(tree.nodes['o/r#4'].children, ['o/r#5'], 'the fourth level came from a re-rooted query')
|
|
74
|
+
assert.equal(tree.nodes['o/r#5'].parent, 'o/r#4')
|
|
75
|
+
assert.equal(tree.nodes['o/r#2'].blockedBy.length, 12, 'a wide detail query filled the blockers')
|
|
76
|
+
const pagedChildren = many.slice(49).map((k) => `tree ${k}`)
|
|
77
|
+
assert.deepEqual([...calls].sort(), ['tree o/r#1', 'detail o/r#2', 'tree o/r#4', 'page o/r#1', ...pagedChildren].sort(), 'one follow-up per truncation, nothing else')
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
test('transient failures retry; a lasting failure marks the tree incomplete', () => {
|
|
81
|
+
const issues = { 'o/r#1': { children: ['o/r#2'] }, 'o/r#2': {} }
|
|
82
|
+
const flaky = fakeGraphql(issues, { fail: { 'o/r#1': 2 } })
|
|
83
|
+
assert.equal(fetchTree({ repo: 'o/r', number: 1 }, { graphql: flaky.graphql, sleep: noSleep }).complete, true)
|
|
84
|
+
assert.equal(flaky.calls.length, 3)
|
|
85
|
+
const down = fakeGraphql(issues, { fail: { 'o/r#1': 5 } })
|
|
86
|
+
const tree = fetchTree({ repo: 'o/r', number: 1 }, { graphql: down.graphql, sleep: noSleep })
|
|
87
|
+
assert.equal(tree.complete, false)
|
|
88
|
+
assert.match(tree.errors[0].error, /502/)
|
|
89
|
+
const denied = fakeGraphql(issues, { fail: { 'o/r#1': 'Could not resolve to a Repository' } })
|
|
90
|
+
fetchTree({ repo: 'o/r', number: 1 }, { graphql: denied.graphql, sleep: noSleep })
|
|
91
|
+
assert.equal(denied.calls.length, 1, 'a non-transient error is not retried')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
test('withRetry gives up after its attempts', () => {
|
|
95
|
+
let n = 0
|
|
96
|
+
const call = withRetry(() => { n++; throw new Error('read: EOF') }, { attempts: 3, sleep: noSleep })
|
|
97
|
+
assert.throws(call, /EOF/)
|
|
98
|
+
assert.equal(n, 3)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
test('the tree query stays under GitHub’s 500,000-node limit', () => {
|
|
102
|
+
// GitHub multiplies `first:` down the nesting; each issue also asks for 20 labels and 10 blockers.
|
|
103
|
+
let issues = 1
|
|
104
|
+
let total = 0
|
|
105
|
+
for (const width of WIDTHS) { issues *= width; total += issues * (1 + 20 + 10) }
|
|
106
|
+
assert.ok(total < 500_000, `estimated ${total} nodes`)
|
|
107
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { test } from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
import { dirname, resolve } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
|
|
6
|
+
import { manualOnlyPolicyFindings } from '../../engineering-runtime/scripts/invocation-policy.mjs'
|
|
7
|
+
|
|
8
|
+
const engineeringRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
|
|
9
|
+
|
|
10
|
+
test('issue and release orchestrators require explicit invocation', () => {
|
|
11
|
+
for (const name of ['resolve-issues', 'rush-issues', 'rush-release', 'resolve-release']) {
|
|
12
|
+
assert.deepEqual(manualOnlyPolicyFindings(resolve(engineeringRoot, name)), [], name)
|
|
13
|
+
}
|
|
14
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Thin wrapper: canonical ownership lives in harness-runtime.
|
|
2
|
+
export * from '../../harness-runtime/model-catalog.mjs'
|
|
3
|
+
|
|
4
|
+
import { runCli } from '../../harness-runtime/model-catalog.mjs'
|
|
5
|
+
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs'
|
|
6
|
+
|
|
7
|
+
if (isMainModule(import.meta.url)) {
|
|
8
|
+
process.exit(runCli(process.argv.slice(2)))
|
|
9
|
+
}
|