@mrciphersmith/keryx 0.2.9
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/LICENSE +21 -0
- package/README.md +351 -0
- package/dist/cli.js +48427 -0
- package/dist/proxy-worker.js +381 -0
- package/package.json +63 -0
- package/src/gdgraph/affected.test.ts +100 -0
- package/src/gdgraph/affected.ts +135 -0
- package/src/gdgraph/build-integrity.test.ts +193 -0
- package/src/gdgraph/build-lang.test.ts +399 -0
- package/src/gdgraph/build.test.ts +120 -0
- package/src/gdgraph/build.ts +804 -0
- package/src/gdgraph/config.test.ts +47 -0
- package/src/gdgraph/config.ts +113 -0
- package/src/gdgraph/core-sources.test.ts +99 -0
- package/src/gdgraph/core-sources.ts +20 -0
- package/src/gdgraph/enrich.ts +79 -0
- package/src/gdgraph/fallback.test.ts +153 -0
- package/src/gdgraph/find.test.ts +78 -0
- package/src/gdgraph/find.ts +107 -0
- package/src/gdgraph/pagerank.ts +129 -0
- package/src/gdgraph/path.test.ts +56 -0
- package/src/gdgraph/path.ts +112 -0
- package/src/gdgraph/query.ts +133 -0
- package/src/gdgraph/repomap.test.ts +110 -0
- package/src/gdgraph/repomap.ts +193 -0
- package/src/gdgraph/service.test.ts +59 -0
- package/src/gdgraph/service.ts +51 -0
- package/src/gdgraph/staleness.ts +20 -0
- package/src/gdgraph/symbol.test.ts +89 -0
- package/src/gdgraph/symbol.ts +123 -0
- package/src/gdgraph/symbols-capability.test.ts +41 -0
- package/src/gdgraph/symbols-capability.ts +49 -0
- package/src/gdgraph/target.ts +56 -0
- package/src/gdgraph/treesitter/adapter.test.ts +249 -0
- package/src/gdgraph/treesitter/adapter.ts +213 -0
- package/src/gdgraph/treesitter/extract.test.ts +278 -0
- package/src/gdgraph/treesitter/extract.ts +389 -0
- package/src/gdgraph/treesitter/grammars.ts +110 -0
- package/src/gdgraph/treesitter/no-treesitter-import.test.ts +51 -0
- package/src/gdgraph/treesitter/resolve-calls.test.ts +38 -0
- package/src/gdgraph/types.ts +63 -0
- package/src/gdskills/bundled/rules/core/api-contracts.mdc +148 -0
- package/src/gdskills/bundled/rules/core/async-patterns.mdc +185 -0
- package/src/gdskills/bundled/rules/core/clean-architecture.mdc +163 -0
- package/src/gdskills/bundled/rules/core/code-review-ai-assistant.mdc +49 -0
- package/src/gdskills/bundled/rules/core/code-review-b091-profile.mdc +48 -0
- package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +54 -0
- package/src/gdskills/bundled/rules/core/commit-message-formatting.mdc +25 -0
- package/src/gdskills/bundled/rules/core/database-patterns.mdc +162 -0
- package/src/gdskills/bundled/rules/core/documentation-management.mdc +106 -0
- package/src/gdskills/bundled/rules/core/error-handling.mdc +163 -0
- package/src/gdskills/bundled/rules/core/execution-metrics.md +99 -0
- package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +40 -0
- package/src/gdskills/bundled/rules/core/git-rules.mdc +37 -0
- package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +198 -0
- package/src/gdskills/bundled/rules/core/implementation-doc-mandate.mdc +149 -0
- package/src/gdskills/bundled/rules/core/implementation-plans.mdc +58 -0
- package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +221 -0
- package/src/gdskills/bundled/rules/core/mobx-store-template.mdc +561 -0
- package/src/gdskills/bundled/rules/core/model-selection.mdc +53 -0
- package/src/gdskills/bundled/rules/core/nestjs-dto.mdc +50 -0
- package/src/gdskills/bundled/rules/core/playwright-testing.mdc +321 -0
- package/src/gdskills/bundled/rules/core/requirements-management.mdc +35 -0
- package/src/gdskills/bundled/rules/core/requirements-package-standard.mdc +103 -0
- package/src/gdskills/bundled/rules/core/review-agent-profile.mdc +49 -0
- package/src/gdskills/bundled/rules/core/review-strict-profile.mdc +44 -0
- package/src/gdskills/bundled/rules/core/rule-management-workflow.mdc +62 -0
- package/src/gdskills/bundled/rules/core/security-baseline.mdc +155 -0
- package/src/gdskills/bundled/rules/core/shared-definitions.mdc +79 -0
- package/src/gdskills/bundled/rules/core/skill-lifecycle.mdc +55 -0
- package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +88 -0
- package/src/gdskills/bundled/rules/core/solid-principles.mdc +149 -0
- package/src/gdskills/bundled/rules/core/storybook-guidelines.mdc +36 -0
- package/src/gdskills/bundled/rules/core/subagent-context-construction.md +107 -0
- package/src/gdskills/bundled/rules/core/subagent-status-protocol.md +169 -0
- package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +96 -0
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.codex.md +47 -0
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.cursor.md +55 -0
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.md +352 -0
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.opencode.md +39 -0
- package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.zed.md +29 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.codex.md +567 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.cursor.md +567 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +655 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.opencode.md +567 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.zed.md +567 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/input-contract.schema.json +134 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/orchestrator-prompt.md +183 -0
- package/src/gdskills/bundled/skills/orchestration/context-collector/output-contract.schema.json +208 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +1412 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +1412 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.detail.md +735 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +468 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +1412 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +1412 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/analysis-request.md +62 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/analysis-request.template.md +79 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/input-contract.schema.json +247 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/orchestrator-prompt.md +362 -0
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/output-contract.schema.json +87 -0
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +105 -0
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +105 -0
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +165 -0
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +379 -0
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/input-contract.schema.json +33 -0
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/output-contract.schema.json +41 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.codex.md +307 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.cursor.md +307 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.md +373 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.opencode.md +307 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.zed.md +307 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/input-contract.schema.json +130 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/issue-request.template.md +50 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/orchestrator-prompt.md +155 -0
- package/src/gdskills/bundled/skills/orchestration/issue-analyzer/output-contract.schema.json +61 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.codex.md +365 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.cursor.md +365 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.md +373 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.opencode.md +365 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.zed.md +365 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/input-contract.schema.json +55 -0
- package/src/gdskills/bundled/skills/orchestration/job-documenter/output-contract.schema.json +58 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +1701 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +1701 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1734 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +1701 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +1701 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/input-contract.schema.json +188 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/orchestrator-prompt.md +179 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/output-contract.schema.json +103 -0
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/state.schema.json +164 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +395 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +395 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +556 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +395 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +395 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +204 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/orchestrator-prompt.md +206 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/output-contract.schema.json +51 -0
- package/src/gdskills/bundled/skills/orchestration/task-implementer/task-request.template.md +111 -0
- package/src/gdskills/bundled/skills/planning/autodoc-analyst/SKILL.md +163 -0
- package/src/gdskills/bundled/skills/planning/autodoc-architect/SKILL.md +161 -0
- package/src/gdskills/bundled/skills/planning/autodoc-assembler/SKILL.md +128 -0
- package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +321 -0
- package/src/gdskills/bundled/skills/planning/autodoc-scanner/SKILL.md +166 -0
- package/src/gdskills/bundled/skills/planning/autodoc-writer/SKILL.md +253 -0
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.claude.md +46 -0
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.codex.md +90 -0
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.cursor.md +90 -0
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +90 -0
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +33 -0
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +33 -0
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +190 -0
- package/src/gdskills/bundled/skills/planning/docpack-orchestrator/SKILL.md +142 -0
- package/src/gdskills/bundled/skills/planning/docpack-orchestrator/input-contract.schema.json +31 -0
- package/src/gdskills/bundled/skills/planning/docpack-orchestrator/output-contract.schema.json +31 -0
- package/src/gdskills/bundled/skills/planning/docpack-review/SKILL.md +80 -0
- package/src/gdskills/bundled/skills/planning/docpack-review/input-contract.schema.json +20 -0
- package/src/gdskills/bundled/skills/planning/docpack-review/output-contract.schema.json +36 -0
- package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +181 -0
- package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +181 -0
- package/src/gdskills/bundled/skills/planning/interview/SKILL.md +187 -0
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.claude.md +94 -0
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +99 -0
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +99 -0
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +105 -0
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +33 -0
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +33 -0
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +237 -0
- package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +33 -0
- package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +33 -0
- package/src/gdskills/bundled/skills/planning/planner/SKILL.md +190 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.codex.md +193 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.cursor.md +193 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.md +193 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.opencode.md +193 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.zed.md +193 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/input-contract.schema.json +63 -0
- package/src/gdskills/bundled/skills/planning/prd-creator/output-contract.schema.json +175 -0
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +31 -0
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +31 -0
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +153 -0
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +32 -0
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +32 -0
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +166 -0
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +44 -0
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +44 -0
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +243 -0
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +43 -0
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +43 -0
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +193 -0
- package/src/gdskills/bundled/skills/platform/agent-entrypoint-distiller/SKILL.md +47 -0
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.codex.md +87 -0
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.cursor.md +87 -0
- package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.md +87 -0
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.codex.md +100 -0
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.cursor.md +100 -0
- package/src/gdskills/bundled/skills/platform/hookify/SKILL.md +100 -0
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.claude.md +45 -0
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.codex.md +84 -0
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.cursor.md +84 -0
- package/src/gdskills/bundled/skills/quality/changelog/SKILL.md +84 -0
- package/src/gdskills/bundled/skills/quality/commit/SKILL.codex.md +66 -0
- package/src/gdskills/bundled/skills/quality/commit/SKILL.cursor.md +66 -0
- package/src/gdskills/bundled/skills/quality/commit/SKILL.md +66 -0
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.claude.md +40 -0
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.codex.md +66 -0
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.cursor.md +66 -0
- package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.md +66 -0
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.claude.md +45 -0
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.codex.md +81 -0
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.cursor.md +81 -0
- package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.md +81 -0
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.claude.md +42 -0
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.codex.md +70 -0
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.cursor.md +70 -0
- package/src/gdskills/bundled/skills/quality/deploy/SKILL.md +70 -0
- package/src/gdskills/bundled/skills/quality/metaproject-security/SKILL.md +103 -0
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.claude.md +48 -0
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.codex.md +83 -0
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.cursor.md +83 -0
- package/src/gdskills/bundled/skills/quality/perf-check/SKILL.md +83 -0
- package/src/gdskills/bundled/skills/quality/pr/SKILL.codex.md +75 -0
- package/src/gdskills/bundled/skills/quality/pr/SKILL.cursor.md +75 -0
- package/src/gdskills/bundled/skills/quality/pr/SKILL.md +75 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.codex.md +364 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.cursor.md +295 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.md +378 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.opencode.md +364 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.zed.md +38 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/input-contract.schema.json +53 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/output-contract.schema.json +46 -0
- package/src/gdskills/bundled/skills/quality/push/SKILL.codex.md +52 -0
- package/src/gdskills/bundled/skills/quality/push/SKILL.cursor.md +52 -0
- package/src/gdskills/bundled/skills/quality/push/SKILL.md +52 -0
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.claude.md +40 -0
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.codex.md +61 -0
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.cursor.md +61 -0
- package/src/gdskills/bundled/skills/quality/security-audit/SKILL.md +61 -0
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.claude.md +30 -0
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.codex.md +75 -0
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.cursor.md +75 -0
- package/src/gdskills/bundled/skills/quality/test-gen/SKILL.md +75 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.codex.md +64 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.cursor.md +74 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +339 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.opencode.md +48 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.zed.md +44 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/input-contract.schema.json +121 -0
- package/src/gdskills/bundled/skills/quality/tests-creator/output-contract.schema.json +127 -0
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.codex.md +204 -0
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.cursor.md +204 -0
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.md +203 -0
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.opencode.md +204 -0
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.zed.md +204 -0
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.codex.md +209 -0
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.cursor.md +209 -0
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.md +208 -0
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.opencode.md +209 -0
- package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.zed.md +209 -0
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.codex.md +263 -0
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.cursor.md +263 -0
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.md +258 -0
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.opencode.md +263 -0
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.zed.md +263 -0
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.codex.md +175 -0
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.cursor.md +175 -0
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +168 -0
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.opencode.md +175 -0
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.zed.md +175 -0
- package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +360 -0
- package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +337 -0
- package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +477 -0
- package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +93 -0
- package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +119 -0
- package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +595 -0
- package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +144 -0
- package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +519 -0
- package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +323 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +927 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/input-contract.schema.json +153 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/output-contract.schema.json +77 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/review-context.schema.json +389 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +189 -0
- package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +241 -0
- package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +344 -0
- package/src/gdskills/bundled/skills/review/review-pr-feedback/SKILL.md +327 -0
- package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +348 -0
- package/src/gdskills/bundled/skills/review/review-strict/SKILL.md +328 -0
- package/src/gdskills/bundled/skills/review/review-style/SKILL.md +343 -0
- package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +134 -0
- package/src/gdskills/bundled/skills/shared/git-merge-base.md +33 -0
- package/src/gdskills/contracts/agent-event.schema.json +32 -0
- package/src/gdskills/contracts/orchestrator-state.schema.json +58 -0
- package/src/gdskills/contracts/review-finding.schema.json +59 -0
- package/src/gdskills/contracts/subagent-dispatch.schema.json +123 -0
- package/src/gdskills/contracts/subagent-result.schema.json +136 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Clean Architecture layer rules: dependency direction, layer isolation, no cross-layer leakage. Use when designing new modules, structuring services, or reviewing architectural boundaries."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Clean Architecture
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Enforce correct dependency direction across architectural layers. Business logic must not depend on frameworks, databases, or UI. Changes to infrastructure must not require changes to domain logic.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when creating new modules, services, or features; when deciding where to place a new class or function; when wiring up dependencies between layers.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Layer Model
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌─────────────────────────────────────┐
|
|
20
|
+
│ Presentation Layer │ Controllers, API handlers, CLI commands
|
|
21
|
+
├─────────────────────────────────────┤
|
|
22
|
+
│ Application Layer │ Use cases, orchestration, DTOs
|
|
23
|
+
├─────────────────────────────────────┤
|
|
24
|
+
│ Domain Layer │ Entities, value objects, domain services
|
|
25
|
+
├─────────────────────────────────────┤
|
|
26
|
+
│ Infrastructure Layer │ DB, HTTP clients, queues, filesystem
|
|
27
|
+
└─────────────────────────────────────┘
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**The Dependency Rule:** Dependencies point INWARD only.
|
|
31
|
+
- Infrastructure → Domain (ok)
|
|
32
|
+
- Application → Domain (ok)
|
|
33
|
+
- Presentation → Application (ok)
|
|
34
|
+
- Domain → Infrastructure (FORBIDDEN)
|
|
35
|
+
- Domain → Framework (FORBIDDEN)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Rules
|
|
40
|
+
|
|
41
|
+
### Rule 1: Domain Layer Has No Framework Imports
|
|
42
|
+
The domain layer must import nothing from:
|
|
43
|
+
- ORM packages (`prisma`, `typeorm`, `mongoose`)
|
|
44
|
+
- HTTP frameworks (`express`, `fastapi`, `nestjs`)
|
|
45
|
+
- External SDKs (AWS SDK, Stripe, etc.)
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// BAD — domain entity knows about Prisma
|
|
49
|
+
import { Prisma } from '@prisma/client';
|
|
50
|
+
class Order {
|
|
51
|
+
static fromPrisma(row: Prisma.OrderGetPayload<{}>): Order {}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// GOOD — domain is pure TypeScript
|
|
55
|
+
class Order {
|
|
56
|
+
constructor(
|
|
57
|
+
readonly id: OrderId,
|
|
58
|
+
readonly status: OrderStatus,
|
|
59
|
+
readonly lines: OrderLine[],
|
|
60
|
+
) {}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Rule 2: Repositories Are Interfaces in Domain, Implementations in Infrastructure
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// Domain layer — interface only
|
|
68
|
+
export interface OrderRepository {
|
|
69
|
+
findById(id: OrderId): Promise<Order | null>;
|
|
70
|
+
save(order: Order): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Infrastructure layer — concrete implementation
|
|
74
|
+
export class PrismaOrderRepository implements OrderRepository {
|
|
75
|
+
constructor(private readonly prisma: PrismaClient) {}
|
|
76
|
+
async findById(id: OrderId) { /* ... */ }
|
|
77
|
+
async save(order: Order) { /* ... */ }
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Rule 3: DTOs Live at Layer Boundaries
|
|
82
|
+
- **Request DTOs** (validation) → Presentation layer
|
|
83
|
+
- **Application DTOs** (use-case input/output) → Application layer
|
|
84
|
+
- **Domain objects** → Domain layer
|
|
85
|
+
- **Persistence models** → Infrastructure layer
|
|
86
|
+
|
|
87
|
+
Never pass a Prisma row directly to a controller, or a request DTO directly into a domain entity.
|
|
88
|
+
|
|
89
|
+
### Rule 4: Use Cases Orchestrate, Domain Encapsulates Logic
|
|
90
|
+
- Use cases (Application layer): coordinate repositories and domain services, handle transactions
|
|
91
|
+
- Domain entities: contain business rules, invariants, validations
|
|
92
|
+
- Controllers: parse input, call use case, format output — nothing else
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// BAD — business logic leaking into controller
|
|
96
|
+
app.post('/orders', async (req, res) => {
|
|
97
|
+
if (req.body.items.length === 0) { /* domain rule in controller */ }
|
|
98
|
+
const discounted = req.body.total * 0.9; /* domain logic */
|
|
99
|
+
await db.orders.create({ data: req.body }); /* infrastructure in controller */
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// GOOD — controller delegates everything
|
|
103
|
+
app.post('/orders', async (req, res) => {
|
|
104
|
+
const dto = parseCreateOrderDto(req.body);
|
|
105
|
+
const result = await createOrderUseCase.execute(dto);
|
|
106
|
+
res.status(201).json(formatOrderResponse(result));
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Rule 5: No God Services
|
|
111
|
+
A service that touches more than 2 domain aggregates is doing too much. Split it.
|
|
112
|
+
|
|
113
|
+
### Rule 6: Module Boundaries Are Enforced by Imports
|
|
114
|
+
If module A imports from module B's internal files (`b/internal/...`), that is a boundary violation. Public APIs of modules are their index exports only.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Directory Structure Pattern
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
src/
|
|
122
|
+
├── domain/
|
|
123
|
+
│ ├── order/
|
|
124
|
+
│ │ ├── Order.ts # entity
|
|
125
|
+
│ │ ├── OrderRepository.ts # interface
|
|
126
|
+
│ │ └── OrderService.ts # domain service
|
|
127
|
+
├── application/
|
|
128
|
+
│ ├── order/
|
|
129
|
+
│ │ ├── CreateOrderUseCase.ts
|
|
130
|
+
│ │ └── dto/
|
|
131
|
+
│ │ ├── CreateOrderDto.ts
|
|
132
|
+
│ │ └── OrderResponseDto.ts
|
|
133
|
+
├── infrastructure/
|
|
134
|
+
│ ├── persistence/
|
|
135
|
+
│ │ └── PrismaOrderRepository.ts
|
|
136
|
+
│ └── http/
|
|
137
|
+
│ └── StripePaymentGateway.ts
|
|
138
|
+
└── presentation/
|
|
139
|
+
└── http/
|
|
140
|
+
└── OrderController.ts
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Iron Laws
|
|
146
|
+
|
|
147
|
+
**IRON LAW 1: The domain layer has zero framework imports. If it imports Prisma, Express, or any SDK — fix it.**
|
|
148
|
+
**IRON LAW 2: Business rules live in the domain layer, not in controllers or use cases.**
|
|
149
|
+
**IRON LAW 3: A controller that queries the database directly violates the architecture unconditionally.**
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Red Flags — Stop and re-read this rule if you are thinking:
|
|
154
|
+
|
|
155
|
+
| Rationalization | Why it's wrong |
|
|
156
|
+
|---|---|
|
|
157
|
+
| "It's a small project, layers are overkill" | Layerless code becomes unmaintainable the moment it needs testing or a second database |
|
|
158
|
+
| "I'll just pass the Prisma object through, it's easier" | The domain now depends on Prisma — every Prisma version upgrade potentially breaks business logic |
|
|
159
|
+
| "The use case is thin, I'll put the logic in the controller" | Controllers are discarded when the transport changes (HTTP → gRPC, REST → GraphQL) |
|
|
160
|
+
| "I'll clean up the layers after the feature ships" | Features shipped with wrong architecture become the foundation for future features |
|
|
161
|
+
| "The repository interface is just ceremony" | The interface enables testing without a database — eliminating it eliminates testability |
|
|
162
|
+
|
|
163
|
+
**IRON LAW: IF CHANGING THE DATABASE REQUIRES CHANGING BUSINESS LOGIC, THE ARCHITECTURE IS WRONG.**
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Baseline AI code review standards for correctness, architecture, safety, and maintainability."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AI Code Review Assistant
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Provide strict, high-signal code reviews with actionable findings.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when performing AI-assisted code review; loaded automatically by the code-ai-review skill.
|
|
13
|
+
|
|
14
|
+
## Verdict Labels
|
|
15
|
+
|
|
16
|
+
All reviews must end with exactly one of the following verdict labels:
|
|
17
|
+
|
|
18
|
+
| Verdict | Meaning |
|
|
19
|
+
|---------|---------|
|
|
20
|
+
| `APPROVE` | Changes accepted as-is; no outstanding issues. |
|
|
21
|
+
| `APPROVE WITH SUGGESTIONS` | Accepted and can merge, but improvements are noted for follow-up. |
|
|
22
|
+
| `REQUEST CHANGES` | Must fix identified issues before merge. |
|
|
23
|
+
| `COMMENT` | Informational findings only; no blocking action required. |
|
|
24
|
+
|
|
25
|
+
## Review Output Structure
|
|
26
|
+
1. Verdict label (from the table above)
|
|
27
|
+
2. Findings by severity and category
|
|
28
|
+
3. Concrete fix proposals
|
|
29
|
+
4. Residual risks and test gaps
|
|
30
|
+
|
|
31
|
+
## Priority Categories
|
|
32
|
+
- Correctness
|
|
33
|
+
- Types and safety
|
|
34
|
+
- Architecture and state boundaries
|
|
35
|
+
- Performance
|
|
36
|
+
- UX/A11y
|
|
37
|
+
- Tests
|
|
38
|
+
|
|
39
|
+
## Mandatory Rules
|
|
40
|
+
- Prioritize correctness over style.
|
|
41
|
+
- Do not request massive refactors unless user asks.
|
|
42
|
+
- Flag unsafe casts and hidden complexity.
|
|
43
|
+
- Align suggestions with existing project patterns.
|
|
44
|
+
- Keep comments specific, respectful, and actionable.
|
|
45
|
+
|
|
46
|
+
## Output Contract
|
|
47
|
+
- Final review must be Markdown.
|
|
48
|
+
- Code snippets/diffs must be fenced code blocks.
|
|
49
|
+
- Response language follows user query language.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "b091-style review profile: direct, strict, architecture-first feedback with concrete fixes."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# b091 Review Profile
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Replicate the b091 review style for requested reviews.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when user explicitly asks for review in b091 style.
|
|
13
|
+
|
|
14
|
+
## Style Profile
|
|
15
|
+
- Direct and concise.
|
|
16
|
+
- Architecture-first.
|
|
17
|
+
- Strongly against duct-tape fixes.
|
|
18
|
+
- Focus on testability and single source of truth.
|
|
19
|
+
|
|
20
|
+
## What To Flag
|
|
21
|
+
- Business logic in UI instead of store/service.
|
|
22
|
+
- **SOLID & Layering Violations**: Domain stores instantiating or importing UI component stores (e.g. `StepStore` directly owning `@components/...` stores). Domain state must remain decoupled from specific UI representations.
|
|
23
|
+
- PRs containing overloaded, AI-generated boilerplate descriptions ("white noise"). Encourage conciseness.
|
|
24
|
+
- Re-introducing known bad patterns or regressions (e.g., adding UI-specific schema fields to core API DTOs).
|
|
25
|
+
- Duplicate rule checks in multiple places.
|
|
26
|
+
- Unsafe casts (`any`, disguised casts).
|
|
27
|
+
- Mocks inheriting production classes.
|
|
28
|
+
- Loading/no-data semantics confusion.
|
|
29
|
+
- Magic numbers without rationale.
|
|
30
|
+
- **Status/result mapping semantics**: Mapping "none" or absence-of-result to a semantic outcome (e.g. canceled, failed) without domain justification. Verify that source enum values (e.g. none, killed, cancelled) have distinct meanings and that the mapping preserves them; flag mappings that equate semantically different states (e.g. `none === canceled`, `killed === canceled` without explicit product rationale).
|
|
31
|
+
- **Non-null assertions (`!`) in tests** — `value!` papers over real initialization issues (test fixtures that didn't actually run, async state that never arrived). Use type guards, typed fixtures/helper returns, or assertion-based setup (`expect(setter).toHaveBeenCalled()`) instead. Applies to `*.test.ts`, `*.spec.ts`, and `e2e/tests/**`. Codebase removed this pattern project-wide previously; flag re-introductions immediately.
|
|
32
|
+
- **Store method accessibility** — See `core/mobx-store-template.mdc` for definitive rules on public vs private store methods. Key violations to flag:
|
|
33
|
+
- Public `onChangeX` / `handleX` methods (must be private)
|
|
34
|
+
- Public `action.bound` that should be private callbacks
|
|
35
|
+
|
|
36
|
+
## Response Format
|
|
37
|
+
1. Verdict in one line — use the canonical verdict vocabulary (same set as `core/code-review-ai-assistant.mdc`):
|
|
38
|
+
- `APPROVE` — no blocking issues; changes accepted as-is
|
|
39
|
+
- `APPROVE WITH SUGGESTIONS` — accepted but improvements noted for follow-up
|
|
40
|
+
- `REQUEST CHANGES` — has issues that must be fixed before merge
|
|
41
|
+
- `COMMENT` — informational findings only; no blocking action required
|
|
42
|
+
2. Top 1-3 blocking findings.
|
|
43
|
+
3. Concrete replacement/fix path.
|
|
44
|
+
|
|
45
|
+
## Guardrails
|
|
46
|
+
- No personal attacks.
|
|
47
|
+
- No empty nitpicks.
|
|
48
|
+
- Keep recommendations lint-safe and scoped.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Code style and architecture patterns for TypeScript, React, and MobX."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Style and Architecture Patterns
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Enforce consistent code style and architecture patterns across TypeScript, React, and MobX code in the frontend project.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when reviewing or implementing TypeScript/React/MobX code in the frontend project.
|
|
13
|
+
|
|
14
|
+
## TypeScript
|
|
15
|
+
- Enforce strict typing; avoid `any`.
|
|
16
|
+
- Use interfaces for component props.
|
|
17
|
+
- Prefer `?.` and `??` over unsafe assertions.
|
|
18
|
+
- Do not use imports like `from \"src/...\"`; use relative paths or approved aliases.
|
|
19
|
+
|
|
20
|
+
## MobX Patterns
|
|
21
|
+
|
|
22
|
+
For complete MobX store patterns, see `core/mobx-store-template.mdc`.
|
|
23
|
+
|
|
24
|
+
Key principles (see canonical source for full detail with examples):
|
|
25
|
+
- All state must use `makeObservable(this)` with explicit decorators
|
|
26
|
+
- Store layout should stay predictable: private fields → public fields → constructor → public methods → private methods
|
|
27
|
+
- Public UI entrypoints called from React should be `@action.bound`, usually as thin `on...` methods
|
|
28
|
+
- Public non-mutating helpers/selectors are not actions and do not use `runInAction`
|
|
29
|
+
- Private API/IO and orchestration belong in private methods; async private methods use `try/catch/finally`
|
|
30
|
+
- Use `runInAction` for private mutation blocks after `await`, and for private orchestration-state updates
|
|
31
|
+
- Wrap React components with `observer`
|
|
32
|
+
- Inter-store callbacks and internal handlers must be private (see `core/mobx-store-template.mdc` for the canonical callback rules)
|
|
33
|
+
- Use equality guards, not truthy checks, when optional values must propagate clearing
|
|
34
|
+
- Implement bounce protection for bidirectional sync
|
|
35
|
+
|
|
36
|
+
## React
|
|
37
|
+
- Wrap observable-consuming components with `observer`.
|
|
38
|
+
- Keep business logic in stores/services.
|
|
39
|
+
- Avoid heavy logic in render.
|
|
40
|
+
|
|
41
|
+
## Architecture
|
|
42
|
+
- Service layer: IO/API only.
|
|
43
|
+
- Store layer: business logic and state transitions.
|
|
44
|
+
- Component layer: view rendering.
|
|
45
|
+
- UI components should preferably have their own local MobX store to manage their specific view state and encapsulate UI-specific logic, implementing reactivity via MobX instead of `useState` where possible.
|
|
46
|
+
|
|
47
|
+
## Review Flags
|
|
48
|
+
- API calls directly in UI components.
|
|
49
|
+
- Missing `observer` where store values are consumed.
|
|
50
|
+
- Direct observable mutation outside actions.
|
|
51
|
+
- Large inline render logic better suited for computed/store methods.
|
|
52
|
+
- Public inter-store callbacks/handlers that should be `private` (e.g. `onChangeEditorState`, `onFireExecutorChange`).
|
|
53
|
+
- Bidirectional store sync without equality guard — risk of infinite callback bounce.
|
|
54
|
+
- Truthy guard (`if (x && x !== y)`) on optional/nullable field — blocks propagation of `undefined`/falsy clearing.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Conventional commit formatting rules."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commit Message Formatting Rules
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Generate concise English conventional commits.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply whenever creating a git commit message.
|
|
13
|
+
|
|
14
|
+
## Language
|
|
15
|
+
- Commit messages must be English only.
|
|
16
|
+
|
|
17
|
+
## Header
|
|
18
|
+
- Use one prefix: `fix:`, `feat:`, `chore:`, `refactor:`, `docs:`, `style:`, `test:`, `perf:`, `ci:`, `build:`.
|
|
19
|
+
- Optional scope: `feat(scope): message` where scope is the affected module (e.g. `feat(pipelines):`, `fix(store):`).
|
|
20
|
+
- Keep header to 72 chars max (including type and scope).
|
|
21
|
+
|
|
22
|
+
## Body
|
|
23
|
+
- Use short bullets.
|
|
24
|
+
- Describe what changed and user impact.
|
|
25
|
+
- Avoid file lists and implementation minutiae.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Database access patterns: no N+1 queries, indexes before deploy, backward-compatible migrations, transaction discipline. Use when writing queries, migrations, or ORM models."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Patterns
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Prevent N+1 query explosions, missing indexes, and migration-induced outages. Enforce safe, observable, backward-compatible database changes.
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when writing ORM queries, creating migrations, designing schema changes, or reviewing data access code.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
### Rule 1: No N+1 Queries
|
|
19
|
+
A query inside a loop is always an N+1 violation. Use eager loading, `JOIN`, or `IN` clause batching.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// BAD — N+1: 1 query for orders + 1 query per order for user
|
|
23
|
+
const orders = await Order.findAll();
|
|
24
|
+
for (const order of orders) {
|
|
25
|
+
const user = await User.findById(order.userId); // N queries
|
|
26
|
+
console.log(user.name);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// GOOD — single query with eager load
|
|
30
|
+
const orders = await Order.findAll({ include: [{ model: User }] });
|
|
31
|
+
for (const order of orders) {
|
|
32
|
+
console.log(order.user.name); // no additional queries
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// GOOD alternative — batch with IN clause
|
|
36
|
+
const userIds = orders.map(o => o.userId);
|
|
37
|
+
const users = await User.findAll({ where: { id: userIds } });
|
|
38
|
+
const userMap = new Map(users.map(u => [u.id, u]));
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Detection rule:** Any `findById`, `findOne`, or `findByPk` inside a loop MUST be refactored.
|
|
42
|
+
|
|
43
|
+
### Rule 2: Index Before Query
|
|
44
|
+
Every WHERE, JOIN, ORDER BY column that does not already have an index MUST have a migration adding one before the feature ships.
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
-- Migration checklist before deploy:
|
|
48
|
+
-- 1. Identify all new WHERE clauses in the feature
|
|
49
|
+
-- 2. Check EXPLAIN ANALYZE on representative data volume
|
|
50
|
+
-- 3. Add indexes for any full-table scans
|
|
51
|
+
|
|
52
|
+
CREATE INDEX CONCURRENTLY idx_orders_user_id ON orders(user_id);
|
|
53
|
+
-- CONCURRENTLY avoids table lock in production
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Index requirements:**
|
|
57
|
+
- Foreign keys: always indexed
|
|
58
|
+
- Columns used in WHERE with high cardinality: indexed
|
|
59
|
+
- Composite indexes: column order matters (most selective first)
|
|
60
|
+
- Unique constraints: also serve as indexes — declare explicitly
|
|
61
|
+
|
|
62
|
+
### Rule 3: Backward-Compatible Migrations
|
|
63
|
+
|
|
64
|
+
Migrations run before code deploys in rolling deployments. The new schema MUST be compatible with both old and new application code simultaneously.
|
|
65
|
+
|
|
66
|
+
**Safe migration sequence:**
|
|
67
|
+
|
|
68
|
+
| Change | Safe? | Safe Method |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| Add nullable column | Yes | Single migration |
|
|
71
|
+
| Add NOT NULL column | No | 3-step: add nullable → backfill → add constraint |
|
|
72
|
+
| Rename column | No | 3-step: add new → copy data → remove old |
|
|
73
|
+
| Remove column | No | 2-step: stop reading in code → migration to drop |
|
|
74
|
+
| Add index | Yes (use CONCURRENTLY) | Single migration |
|
|
75
|
+
| Drop index | Yes | Single migration |
|
|
76
|
+
| Change column type | No | 3-step: add new → migrate data → remove old |
|
|
77
|
+
|
|
78
|
+
**3-Step pattern for breaking changes:**
|
|
79
|
+
```sql
|
|
80
|
+
-- Step 1 (Deploy A): Add new column as nullable
|
|
81
|
+
ALTER TABLE users ADD COLUMN email_verified_at TIMESTAMP;
|
|
82
|
+
|
|
83
|
+
-- Deploy new code that writes to both old and new column
|
|
84
|
+
|
|
85
|
+
-- Step 2 (Deploy B): Backfill + add NOT NULL constraint
|
|
86
|
+
UPDATE users SET email_verified_at = created_at WHERE email_verified_at IS NULL;
|
|
87
|
+
ALTER TABLE users ALTER COLUMN email_verified_at SET NOT NULL;
|
|
88
|
+
|
|
89
|
+
-- Deploy new code that only reads new column
|
|
90
|
+
|
|
91
|
+
-- Step 3 (Deploy C): Remove old column (if applicable)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Rule 4: Transactions for Multi-Step Mutations
|
|
95
|
+
Any operation that writes to multiple tables or performs multiple writes to the same table MUST use a transaction.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// BAD — partial failure leaves data inconsistent
|
|
99
|
+
await userRepo.save(user);
|
|
100
|
+
await walletRepo.create({ userId: user.id, balance: 0 }); // if this fails, orphaned user
|
|
101
|
+
|
|
102
|
+
// GOOD — atomic operation
|
|
103
|
+
await db.transaction(async (trx) => {
|
|
104
|
+
await userRepo.save(user, { transaction: trx });
|
|
105
|
+
await walletRepo.create({ userId: user.id, balance: 0 }, { transaction: trx });
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Rule 5: Never SELECT * in Application Code
|
|
110
|
+
Always select specific columns to avoid:
|
|
111
|
+
- Accidentally loading large TEXT/BLOB columns
|
|
112
|
+
- Breaking when new columns are added to the schema
|
|
113
|
+
- Leaking sensitive fields (passwords, tokens)
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// BAD
|
|
117
|
+
const users = await User.findAll(); // loads ALL columns
|
|
118
|
+
|
|
119
|
+
// GOOD
|
|
120
|
+
const users = await User.findAll({ attributes: ['id', 'name', 'email'] });
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Rule 6: Soft Deletes Need Index on deleted_at
|
|
124
|
+
If using soft deletes (`deleted_at IS NULL` filter), that filter is on every query. Index it:
|
|
125
|
+
|
|
126
|
+
```sql
|
|
127
|
+
CREATE INDEX idx_users_deleted_at ON users(deleted_at) WHERE deleted_at IS NULL;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Migration Review Checklist
|
|
133
|
+
|
|
134
|
+
Before merging any migration:
|
|
135
|
+
- [ ] `CONCURRENTLY` used for new indexes on existing tables
|
|
136
|
+
- [ ] NOT NULL columns have a default or backfill in the same migration
|
|
137
|
+
- [ ] No column renames (use 3-step instead)
|
|
138
|
+
- [ ] `EXPLAIN ANALYZE` run on production-scale data for new queries
|
|
139
|
+
- [ ] Rollback plan documented (reverse migration or migration with inverse operation)
|
|
140
|
+
- [ ] Migration is idempotent (safe to run twice: use `IF NOT EXISTS`, `IF EXISTS`)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Iron Laws
|
|
145
|
+
|
|
146
|
+
**IRON LAW 1: A query inside a loop is an N+1. Fix it before merging.**
|
|
147
|
+
**IRON LAW 2: A NOT NULL column without a backfill migration will fail in production on deploy.**
|
|
148
|
+
**IRON LAW 3: Multi-table writes without a transaction are a data integrity bug.**
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Red Flags — Stop and re-read this rule if you are thinking:
|
|
153
|
+
|
|
154
|
+
| Rationalization | Why it's wrong |
|
|
155
|
+
|---|---|
|
|
156
|
+
| "The table is small, N+1 is fine for now" | Tables grow — N+1 that's "fine now" causes outages at 100k rows |
|
|
157
|
+
| "I'll add the index after it's in production if it's slow" | Adding an index without CONCURRENTLY locks the table in production |
|
|
158
|
+
| "The migration is simple, I don't need a rollback plan" | Every migration that fails in production requires a rollback — having no plan means downtime |
|
|
159
|
+
| "NULL is fine, I'll add NOT NULL later" | Nullable columns become load-bearing nullability over time — enforce constraints early |
|
|
160
|
+
| "SELECT * is easier during development" | SELECT * loaded to production is a query-time performance and security risk |
|
|
161
|
+
|
|
162
|
+
**IRON LAW: A MIGRATION THAT LOCKS A TABLE ON A BUSY PRODUCTION DATABASE IS A PLANNED OUTAGE.**
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Manage project documentation in <PROJECT_DIR>/docs (default) or $GDMETAPRO_DOCS_ROOT with synchronized multilingual outputs."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Management Rules
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Define how the agent creates and updates documentation under `<DOCS_ROOT>` (`<PROJECT_DIR>/docs` by default, or `$GDMETAPRO_DOCS_ROOT`).
|
|
10
|
+
|
|
11
|
+
## When To Apply
|
|
12
|
+
Apply when the user asks to create or update documentation, plans, requirements, communication notes, reports, or review artifacts.
|
|
13
|
+
|
|
14
|
+
## Mandatory Behavior
|
|
15
|
+
1. Ask for target location and folder name before writing any doc.
|
|
16
|
+
2. Use date-stamped folders; never overwrite previous doc sets.
|
|
17
|
+
3. Keep language variants synchronized.
|
|
18
|
+
4. Update `<DOCS_ROOT>/README.md` after doc changes.
|
|
19
|
+
5. Ask whether to apply changes (branch/commit/PR) after edits.
|
|
20
|
+
|
|
21
|
+
## Required Locations
|
|
22
|
+
- Root: `<DOCS_ROOT>` (default: `<PROJECT_DIR>/docs`)
|
|
23
|
+
- Standard pattern: `<DOCS_ROOT>/<category>/<name>-<YYYY-MM-DD>/`
|
|
24
|
+
|
|
25
|
+
## DOCS_ROOT Resolution
|
|
26
|
+
|
|
27
|
+
The docs root is resolved in this priority order:
|
|
28
|
+
|
|
29
|
+
1. **`DOCS_ROOT` passed explicitly** by the orchestrator in the sub-agent dispatch prompt
|
|
30
|
+
2. **`GDMETAPRO_DOCS_ROOT` environment variable** (if set in the shell)
|
|
31
|
+
3. **`<PROJECT_DIR>/docs/`** — default, relative to the project being worked on
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
DOCS_ROOT="${GDMETAPRO_DOCS_ROOT:-$PROJECT_DIR/docs}"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`PROJECT_DIR` is always known by Phase 0.2 of the orchestrator. Sub-agents (context-collector, feature-analyzer, etc.) **never resolve DOCS_ROOT themselves** — they receive it explicitly from the orchestrator.
|
|
38
|
+
|
|
39
|
+
## Category Definitions
|
|
40
|
+
|
|
41
|
+
| Category | Path pattern | Description |
|
|
42
|
+
|----------|-------------|-------------|
|
|
43
|
+
| `requirements` | `docs/requirements/<name>/<YYYY-MM-DD>/` | Feature requirements (iterations grouped by name) |
|
|
44
|
+
| `plans` | `docs/plans/<name>/<YYYY-MM-DD>/` | Standalone implementation plans |
|
|
45
|
+
| `report` | `docs/report/<name>/<YYYY-MM-DD>/` | Standalone review/audit reports |
|
|
46
|
+
| `review-testing` | `docs/review-testing/<name>/<YYYY-MM-DD>/` | QA and testing artifacts |
|
|
47
|
+
| `communication` | `docs/communication/<name>/<YYYY-MM-DD>/` | Communication and context docs |
|
|
48
|
+
| `analysis` | `docs/analysis/<name>/<YYYY-MM-DD>/` | Feature/branch analysis (see below) |
|
|
49
|
+
|
|
50
|
+
## Analysis Category Structure
|
|
51
|
+
|
|
52
|
+
The `analysis` category is used by the `feature-analyzer` skill and any branch/feature analysis tasks.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
docs/analysis/<feature-name>/<YYYY-MM-DD>/
|
|
56
|
+
report/
|
|
57
|
+
ru/
|
|
58
|
+
report.md
|
|
59
|
+
en/
|
|
60
|
+
report.md
|
|
61
|
+
ai/
|
|
62
|
+
report.md
|
|
63
|
+
plans/
|
|
64
|
+
ru/
|
|
65
|
+
implementation-plan.md
|
|
66
|
+
en/
|
|
67
|
+
implementation-plan.md
|
|
68
|
+
ai/
|
|
69
|
+
implementation-plan.md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- `report/` — detailed analysis of changes, ticket, cross-repo findings
|
|
73
|
+
- `plans/` — actionable implementation plan derived from the analysis
|
|
74
|
+
- Each subfolder contains `ru/`, `en/`, `ai/` language variants (all three are mandatory)
|
|
75
|
+
|
|
76
|
+
## Language Matrix
|
|
77
|
+
- Requirements: `ru`, `en`, `ai`
|
|
78
|
+
- Implementation plans: `ru`, `en`, `ai`
|
|
79
|
+
- Communication docs: `ru`, `en`, `ai`
|
|
80
|
+
- Analysis (`report/` + `plans/`): `ru`, `en`, `ai` (mandatory)
|
|
81
|
+
- Other categories: follow explicit user request; default to at least `en`.
|
|
82
|
+
|
|
83
|
+
## Naming Rules
|
|
84
|
+
- Ask user for `<name>` first.
|
|
85
|
+
- Use semantic, kebab-case folder names.
|
|
86
|
+
- Keep filenames deterministic: `<name>.md` unless user asks another convention.
|
|
87
|
+
|
|
88
|
+
## Output Contract
|
|
89
|
+
- Every generated document MUST be Markdown (`.md`).
|
|
90
|
+
- Structure must be explicit with headings and actionable sections.
|
|
91
|
+
- Code examples must be fenced code blocks.
|
|
92
|
+
|
|
93
|
+
## Relationship to `jobs/`
|
|
94
|
+
|
|
95
|
+
`docs/` and `jobs/` are **separate systems**:
|
|
96
|
+
- `docs/` — general project documentation (requirements, plans, reports, analysis). Managed by this rule.
|
|
97
|
+
- `jobs/` — orchestrator pipeline artifacts. Each job folder documents one orchestrated task end-to-end.
|
|
98
|
+
|
|
99
|
+
Standalone skill invocations continue to use `docs/analysis/`. Only orchestrator-driven work produces output in `jobs/`.
|
|
100
|
+
See `core/jobs-documentation.mdc` for the `jobs/` system.
|
|
101
|
+
|
|
102
|
+
## Prohibited
|
|
103
|
+
- Single-language output when the category requires `ru+en+ai`.
|
|
104
|
+
- Partial language updates.
|
|
105
|
+
- Writing docs outside the requested category path without confirmation.
|
|
106
|
+
- Mixing `report/` and `plans/` content in the same file.
|