@bonesofspring/ai-rules 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -4
- package/README.md +21 -3
- package/bin/cli.js +30 -1
- package/package.json +9 -1
- package/presets/_shared/README.md +47 -0
- package/presets/_shared/core/agent-team/agent-team-intake.md +9 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +142 -0
- package/presets/_shared/core/architecture/feature-delivery-workflow.md +46 -0
- package/presets/_shared/core/architecture/reference-features.template.md +43 -0
- package/presets/_shared/core/meta/preset-layering.md +25 -0
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +43 -0
- package/presets/_shared/core/meta/preset-pr-checklist.md +28 -0
- package/presets/_shared/core/meta/preset-token-budget.md +30 -0
- package/presets/_shared/core/meta/preset-twin-sync.md +31 -0
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +69 -0
- package/presets/_shared/core/quality/design-guidance.md +97 -0
- package/presets/_shared/core/review/code-review-mr.md +38 -0
- package/presets/_shared/core/review/technical-retro.md +7 -0
- package/presets/claude/go/CLAUDE.md +14 -0
- package/presets/claude/go/MCP.md +16 -0
- package/presets/claude/go/README.md +38 -0
- package/presets/claude/go/REPO_AGENTS.md +48 -0
- package/presets/claude/go/agents/README.md +32 -0
- package/presets/claude/go/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/go/agents/build-verifier.md +35 -0
- package/presets/claude/go/agents/ci-investigator.md +17 -0
- package/presets/claude/go/agents/code-reviewer.md +40 -0
- package/presets/claude/go/agents/codebase-analyzer.md +28 -0
- package/presets/claude/go/agents/debugger.md +25 -0
- package/presets/claude/go/agents/feature-developer.md +43 -0
- package/presets/claude/go/agents/integration-test-generator.md +22 -0
- package/presets/claude/go/agents/integration-test-healer.md +22 -0
- package/presets/claude/go/agents/integration-test-planner.md +22 -0
- package/presets/claude/go/agents/migration-specialist.md +31 -0
- package/presets/claude/go/agents/performance-auditor.md +22 -0
- package/presets/claude/go/agents/qa-tester.md +24 -0
- package/presets/claude/go/agents/security-reviewer.md +20 -0
- package/presets/claude/go/agents/solution-architect.md +28 -0
- package/presets/claude/go/agents/task-analyst.md +25 -0
- package/presets/claude/go/agents/task-router.md +69 -0
- package/presets/claude/go/agents/tech-writer.md +15 -0
- package/presets/claude/go/agents/unit-test-generator.md +21 -0
- package/presets/claude/go/agents/unit-test-healer.md +13 -0
- package/presets/claude/go/agents/unit-test-planner.md +26 -0
- package/presets/claude/go/commands/README.md +13 -0
- package/presets/claude/go/commands/feature-continue.md +51 -0
- package/presets/claude/go/commands/feature-start.md +30 -0
- package/presets/claude/go/commands/task-continue.md +49 -0
- package/presets/claude/go/commands/task.md +49 -0
- package/presets/claude/go/commands/technical-retro.md +58 -0
- package/presets/claude/go/hooks/README.md +16 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +381 -0
- package/presets/claude/go/hooks/examples/README.md +18 -0
- package/presets/claude/go/hooks/examples/format-edited.example.sh +9 -0
- package/presets/claude/go/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/go/hooks/examples/test-on-save.example.sh +11 -0
- package/presets/claude/go/hooks/guard-shell-command.sh +79 -0
- package/presets/claude/go/mcp.json +12 -0
- package/presets/claude/go/rules/README.md +60 -0
- package/presets/claude/go/rules/api-and-data/README.md +14 -0
- package/presets/claude/go/rules/api-and-data/adapters-driven.md +34 -0
- package/presets/claude/go/rules/api-and-data/adapters-driving.md +35 -0
- package/presets/claude/go/rules/api-and-data/api-grpc.md +27 -0
- package/presets/claude/go/rules/api-and-data/api-http.md +33 -0
- package/presets/claude/go/rules/api-and-data/messaging-adapters.md +21 -0
- package/presets/claude/go/rules/api-and-data/persistence-adapters.md +28 -0
- package/presets/claude/go/rules/architecture/README.md +16 -0
- package/presets/claude/go/rules/architecture/application-usecases.md +29 -0
- package/presets/claude/go/rules/architecture/boundaries.md +29 -0
- package/presets/claude/go/rules/architecture/composition-root.md +28 -0
- package/presets/claude/go/rules/architecture/domain-layer.md +32 -0
- package/presets/claude/go/rules/architecture/feature-delivery.md +51 -0
- package/presets/claude/go/rules/architecture/module-public-api.md +23 -0
- package/presets/claude/go/rules/architecture/ports-interfaces.md +34 -0
- package/presets/claude/go/rules/architecture/reference-features.md +34 -0
- package/presets/claude/go/rules/stack/README.md +10 -0
- package/presets/claude/go/rules/stack/go-app-core.md +31 -0
- package/presets/claude/go/rules/stack/go-conventions.md +51 -0
- package/presets/claude/go/rules/testing/README.md +11 -0
- package/presets/claude/go/rules/testing/e2e.md +18 -0
- package/presets/claude/go/rules/testing/integration.md +23 -0
- package/presets/claude/go/rules/testing/unit.md +24 -0
- package/presets/claude/go/rules/tooling-and-review/README.md +21 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +25 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +161 -0
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +83 -0
- package/presets/claude/go/rules/tooling-and-review/code-review.md +57 -0
- package/presets/claude/go/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/go/rules/tooling-and-review/go-tooling.md +38 -0
- package/presets/claude/go/rules/tooling-and-review/post-change-test.md +32 -0
- package/presets/claude/go/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +58 -0
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/go/rules/tooling-and-review/security-go.md +22 -0
- package/presets/claude/go/rules/tooling-and-review/technical-retro.md +19 -0
- package/presets/claude/go/rules/ui-and-accessibility/README.md +3 -0
- package/presets/claude/go/skills/README.md +5 -0
- package/presets/claude/go/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/go/skills/code-review/SKILL.md +25 -0
- package/presets/claude/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/go/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/go/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/go/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/go/team/README.md +27 -0
- package/presets/claude/go/team/conventions.md +21 -0
- package/presets/claude/go/team/fixtures/bugfix-standard.json +37 -0
- package/presets/claude/go/team/fixtures/feature-full.json +43 -0
- package/presets/claude/go/team/fixtures/feature-light.json +17 -0
- package/presets/claude/ios-swift/CLAUDE.md +4 -1
- package/presets/claude/ios-swift/README.md +12 -1
- package/presets/claude/ios-swift/REPO_AGENTS.md +46 -0
- package/presets/claude/ios-swift/agents/README.md +3 -2
- package/presets/claude/ios-swift/agents/build-verifier.md +23 -8
- package/presets/claude/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/claude/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/claude/ios-swift/agents/debugger.md +4 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +17 -0
- package/presets/claude/ios-swift/agents/migration-specialist.md +4 -0
- package/presets/claude/ios-swift/agents/performance-auditor.md +4 -0
- package/presets/claude/ios-swift/agents/qa-tester.md +4 -0
- package/presets/claude/ios-swift/agents/solution-architect.md +4 -0
- package/presets/claude/ios-swift/agents/task-analyst.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-generator.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-healer.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-planner.md +4 -0
- package/presets/claude/ios-swift/hooks/README.md +6 -0
- package/presets/claude/ios-swift/hooks/examples/README.md +18 -0
- package/presets/claude/ios-swift/hooks/examples/format-edited.example.sh +13 -0
- package/presets/claude/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/claude/ios-swift/rules/README.md +24 -2
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +5 -0
- package/presets/claude/ios-swift/rules/architecture/reference-features.md +9 -0
- package/presets/claude/ios-swift/rules/stack/swift-conventions.md +12 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +3 -3
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +64 -20
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +42 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +5 -3
- package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +8 -0
- package/presets/claude/ios-swift/skills/README.md +1 -0
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +14 -2
- package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +8 -0
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +46 -2
- package/presets/claude/ios-swift/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/ios-swift/team/conventions.md +21 -0
- package/presets/claude/next/CLAUDE.md +5 -1
- package/presets/claude/next/README.md +14 -1
- package/presets/claude/next/REPO_AGENTS.md +48 -0
- package/presets/claude/next/agents/README.md +7 -1
- package/presets/claude/next/agents/build-verifier.md +29 -0
- package/presets/claude/next/agents/code-reviewer.md +4 -0
- package/presets/claude/next/agents/codebase-analyzer.md +28 -0
- package/presets/claude/next/agents/debugger.md +4 -0
- package/presets/claude/next/agents/feature-developer.md +17 -0
- package/presets/claude/next/agents/migration-specialist.md +4 -0
- package/presets/claude/next/agents/performance-auditor.md +4 -0
- package/presets/claude/next/agents/qa-tester.md +4 -0
- package/presets/claude/next/agents/security-reviewer.md +4 -2
- package/presets/claude/next/agents/solution-architect.md +4 -0
- package/presets/claude/next/agents/task-analyst.md +4 -0
- package/presets/claude/next/agents/unit-test-generator.md +4 -0
- package/presets/claude/next/agents/unit-test-healer.md +4 -0
- package/presets/claude/next/agents/unit-test-planner.md +4 -0
- package/presets/claude/next/hooks/README.md +6 -0
- package/presets/claude/next/hooks/examples/README.md +18 -0
- package/presets/claude/next/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/next/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/next/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/claude/next/rules/README.md +75 -21
- package/presets/claude/next/rules/api-and-data/api-services.md +22 -0
- package/presets/claude/next/rules/api-and-data/http-client.md +21 -0
- package/presets/claude/next/rules/api-and-data/store-rtk.md +20 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +28 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -0
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +15 -0
- package/presets/claude/next/rules/architecture/public-imports.md +14 -0
- package/presets/claude/next/rules/architecture/reference-features.md +9 -0
- package/presets/claude/next/rules/stack/arrow-functions.md +13 -28
- package/presets/claude/next/rules/stack/next-app-router.md +13 -1
- package/presets/claude/next/rules/testing/tests-unit.md +13 -0
- package/presets/claude/next/rules/tooling-and-review/README.md +2 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +3 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +58 -20
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +39 -8
- package/presets/claude/next/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/next/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/next/rules/tooling-and-review/security-next.md +57 -0
- package/presets/claude/next/rules/tooling-and-review/technical-retro.md +16 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +21 -0
- package/presets/claude/next/skills/README.md +2 -0
- package/presets/claude/next/skills/code-review/SKILL.md +14 -2
- package/presets/claude/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/next/skills/feature-delivery/SKILL.md +8 -0
- package/presets/claude/next/skills/react-performance/SKILL.md +44 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +19 -5
- package/presets/claude/next/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/next/team/conventions.md +21 -0
- package/presets/cursor/go/AGENTS.md +30 -0
- package/presets/cursor/go/BUGBOT.md +9 -0
- package/presets/cursor/go/MCP.md +16 -0
- package/presets/cursor/go/README.md +39 -0
- package/presets/cursor/go/REPO_AGENTS.md +48 -0
- package/presets/cursor/go/agents/README.md +36 -0
- package/presets/cursor/go/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/go/agents/build-verifier.md +35 -0
- package/presets/cursor/go/agents/ci-investigator.md +17 -0
- package/presets/cursor/go/agents/code-reviewer.md +40 -0
- package/presets/cursor/go/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/go/agents/debugger.md +25 -0
- package/presets/cursor/go/agents/feature-developer.md +43 -0
- package/presets/cursor/go/agents/integration-test-generator.md +22 -0
- package/presets/cursor/go/agents/integration-test-healer.md +22 -0
- package/presets/cursor/go/agents/integration-test-planner.md +22 -0
- package/presets/cursor/go/agents/migration-specialist.md +31 -0
- package/presets/cursor/go/agents/performance-auditor.md +22 -0
- package/presets/cursor/go/agents/qa-tester.md +24 -0
- package/presets/cursor/go/agents/security-reviewer.md +20 -0
- package/presets/cursor/go/agents/solution-architect.md +28 -0
- package/presets/cursor/go/agents/task-analyst.md +25 -0
- package/presets/cursor/go/agents/task-router.md +69 -0
- package/presets/cursor/go/agents/tech-writer.md +15 -0
- package/presets/cursor/go/agents/unit-test-generator.md +21 -0
- package/presets/cursor/go/agents/unit-test-healer.md +13 -0
- package/presets/cursor/go/agents/unit-test-planner.md +26 -0
- package/presets/cursor/go/commands/README.md +54 -0
- package/presets/cursor/go/commands/feature-continue.md +19 -0
- package/presets/cursor/go/commands/feature-start.md +33 -0
- package/presets/cursor/go/commands/task-continue.md +49 -0
- package/presets/cursor/go/commands/task.md +49 -0
- package/presets/cursor/go/commands/technical-retro.md +81 -0
- package/presets/cursor/go/hooks/README.md +12 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +381 -0
- package/presets/cursor/go/hooks/examples/README.md +18 -0
- package/presets/cursor/go/hooks/examples/format-edited.example.sh +9 -0
- package/presets/cursor/go/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/go/hooks/examples/test-on-save.example.sh +11 -0
- package/presets/cursor/go/hooks/guard-shell-command.sh +79 -0
- package/presets/cursor/go/hooks.json +17 -0
- package/presets/cursor/go/mcp.json +11 -0
- package/presets/cursor/go/rules/README.md +89 -0
- package/presets/cursor/go/rules/adapters-driven.mdc +35 -0
- package/presets/cursor/go/rules/adapters-driving.mdc +36 -0
- package/presets/cursor/go/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +156 -0
- package/presets/cursor/go/rules/api-grpc.mdc +28 -0
- package/presets/cursor/go/rules/api-http.mdc +34 -0
- package/presets/cursor/go/rules/application-usecases.mdc +30 -0
- package/presets/cursor/go/rules/architecture-boundaries.mdc +30 -0
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +84 -0
- package/presets/cursor/go/rules/code-review-mr.mdc +52 -0
- package/presets/cursor/go/rules/composition-root.mdc +29 -0
- package/presets/cursor/go/rules/design-guidance.mdc +111 -0
- package/presets/cursor/go/rules/domain-layer.mdc +33 -0
- package/presets/cursor/go/rules/feature-delivery-workflow.mdc +46 -0
- package/presets/cursor/go/rules/go-app-core.mdc +32 -0
- package/presets/cursor/go/rules/go-conventions.mdc +52 -0
- package/presets/cursor/go/rules/go-tooling.mdc +33 -0
- package/presets/cursor/go/rules/messaging-adapters.mdc +22 -0
- package/presets/cursor/go/rules/module-public-api.mdc +24 -0
- package/presets/cursor/go/rules/persistence-adapters.mdc +29 -0
- package/presets/cursor/go/rules/ports-interfaces.mdc +35 -0
- package/presets/cursor/go/rules/post-change-test.mdc +27 -0
- package/presets/cursor/go/rules/preset-layering.mdc +36 -0
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +58 -0
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/go/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/go/rules/preset-twin-sync.mdc +42 -0
- package/presets/cursor/go/rules/reference-features.mdc +35 -0
- package/presets/cursor/go/rules/security-go.mdc +23 -0
- package/presets/cursor/go/rules/technical-retro.mdc +14 -0
- package/presets/cursor/go/rules/tests-e2e.mdc +19 -0
- package/presets/cursor/go/rules/tests-integration.mdc +24 -0
- package/presets/cursor/go/rules/tests-unit.mdc +25 -0
- package/presets/cursor/go/skills/README.md +5 -0
- package/presets/cursor/go/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/go/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/go/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/go/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/go/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/go/team/README.md +31 -0
- package/presets/cursor/go/team/conventions.md +21 -0
- package/presets/cursor/go/team/fixtures/bugfix-standard.json +37 -0
- package/presets/cursor/go/team/fixtures/feature-full.json +43 -0
- package/presets/cursor/go/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/ios-swift/AGENTS.md +5 -2
- package/presets/cursor/ios-swift/README.md +13 -5
- package/presets/cursor/ios-swift/REPO_AGENTS.md +46 -0
- package/presets/cursor/ios-swift/agents/README.md +3 -2
- package/presets/cursor/ios-swift/agents/build-verifier.md +23 -8
- package/presets/cursor/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/cursor/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/ios-swift/agents/debugger.md +4 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +17 -0
- package/presets/cursor/ios-swift/agents/migration-specialist.md +4 -0
- package/presets/cursor/ios-swift/agents/performance-auditor.md +4 -0
- package/presets/cursor/ios-swift/agents/qa-tester.md +4 -0
- package/presets/cursor/ios-swift/agents/solution-architect.md +4 -0
- package/presets/cursor/ios-swift/agents/task-analyst.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-generator.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-healer.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-planner.md +4 -0
- package/presets/cursor/ios-swift/commands/README.md +1 -1
- package/presets/cursor/ios-swift/hooks/README.md +4 -0
- package/presets/cursor/ios-swift/hooks/examples/README.md +18 -0
- package/presets/cursor/ios-swift/hooks/examples/format-edited.example.sh +13 -0
- package/presets/cursor/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/ios-swift/rules/README.md +23 -2
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +3 -3
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +9 -3
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +64 -20
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +41 -0
- package/presets/cursor/ios-swift/rules/design-guidance.mdc +111 -0
- package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +6 -0
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +36 -0
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +54 -0
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +42 -0
- package/presets/cursor/ios-swift/rules/reference-features.mdc +10 -0
- package/presets/cursor/ios-swift/rules/swift-conventions.mdc +12 -2
- package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +8 -0
- package/presets/cursor/ios-swift/rules/technical-retro.mdc +4 -2
- package/presets/cursor/ios-swift/skills/README.md +1 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +14 -2
- package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +8 -0
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +46 -2
- package/presets/cursor/ios-swift/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/ios-swift/team/conventions.md +21 -0
- package/presets/cursor/next/AGENTS.md +5 -2
- package/presets/cursor/next/README.md +47 -0
- package/presets/cursor/next/REPO_AGENTS.md +48 -0
- package/presets/cursor/next/agents/README.md +7 -1
- package/presets/cursor/next/agents/build-verifier.md +29 -0
- package/presets/cursor/next/agents/code-reviewer.md +4 -0
- package/presets/cursor/next/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/next/agents/debugger.md +4 -0
- package/presets/cursor/next/agents/feature-developer.md +17 -0
- package/presets/cursor/next/agents/migration-specialist.md +4 -0
- package/presets/cursor/next/agents/performance-auditor.md +4 -0
- package/presets/cursor/next/agents/qa-tester.md +4 -0
- package/presets/cursor/next/agents/security-reviewer.md +4 -2
- package/presets/cursor/next/agents/solution-architect.md +4 -0
- package/presets/cursor/next/agents/task-analyst.md +4 -0
- package/presets/cursor/next/agents/unit-test-generator.md +4 -0
- package/presets/cursor/next/agents/unit-test-healer.md +4 -0
- package/presets/cursor/next/agents/unit-test-planner.md +4 -0
- package/presets/cursor/next/commands/README.md +1 -1
- package/presets/cursor/next/hooks/README.md +4 -0
- package/presets/cursor/next/hooks/examples/README.md +18 -0
- package/presets/cursor/next/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/next/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/next/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/next/rules/README.md +24 -3
- package/presets/cursor/next/rules/agent-team-intake.mdc +3 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +9 -3
- package/presets/cursor/next/rules/api-services.mdc +21 -0
- package/presets/cursor/next/rules/architecture-boundaries.mdc +27 -0
- package/presets/cursor/next/rules/arrow-functions.mdc +13 -28
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +55 -18
- package/presets/cursor/next/rules/code-review-mr.mdc +39 -9
- package/presets/cursor/next/rules/design-guidance.mdc +111 -0
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -0
- package/presets/cursor/next/rules/http-client.mdc +21 -0
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +15 -0
- package/presets/cursor/next/rules/next-app-router.mdc +13 -1
- package/presets/cursor/next/rules/preset-layering.mdc +36 -0
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +54 -0
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/next/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/next/rules/preset-twin-sync.mdc +42 -0
- package/presets/cursor/next/rules/public-imports.mdc +14 -0
- package/presets/cursor/next/rules/react-ui.mdc +20 -0
- package/presets/cursor/next/rules/reference-features.mdc +10 -0
- package/presets/cursor/next/rules/security-next.mdc +57 -0
- package/presets/cursor/next/rules/store-rtk.mdc +19 -0
- package/presets/cursor/next/rules/technical-retro.mdc +5 -3
- package/presets/cursor/next/rules/tests-unit.mdc +12 -0
- package/presets/cursor/next/skills/README.md +2 -0
- package/presets/cursor/next/skills/code-review/SKILL.md +14 -2
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +8 -0
- package/presets/cursor/next/skills/react-performance/SKILL.md +44 -0
- package/presets/cursor/next/skills/technical-retro/SKILL.md +19 -5
- package/presets/cursor/next/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/next/team/conventions.md +21 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: forbid cross-stack agent/path leakage in hooks and agents.
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
|
|
11
|
+
|
|
12
|
+
# Preset no cross-stack leakage
|
|
13
|
+
|
|
14
|
+
Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
|
|
15
|
+
|
|
16
|
+
## Principles
|
|
17
|
+
|
|
18
|
+
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
|
+
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
20
|
+
- `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
21
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
22
|
+
|
|
23
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
24
|
+
|
|
25
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
26
|
+
|
|
27
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
28
|
+
- `app/__tests__/e2e` as a required path
|
|
29
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
30
|
+
|
|
31
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
32
|
+
|
|
33
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
34
|
+
|
|
35
|
+
- `xcuitest-test-` as handoff stems
|
|
36
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
37
|
+
|
|
38
|
+
## Forbidden in go hooks/agents (FAIL)
|
|
39
|
+
|
|
40
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
41
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
42
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
43
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
44
|
+
|
|
45
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
|
|
46
|
+
|
|
47
|
+
## Soft / document
|
|
48
|
+
|
|
49
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
50
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
51
|
+
|
|
52
|
+
## Chain fork
|
|
53
|
+
|
|
54
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: PR checklist for twin sync, budget, leakage, README. Use on preset PRs.
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-pr-checklist.md -->
|
|
11
|
+
|
|
12
|
+
# Preset PR checklist
|
|
13
|
+
|
|
14
|
+
Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
|
|
15
|
+
|
|
16
|
+
## Before merge
|
|
17
|
+
|
|
18
|
+
- [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
|
|
19
|
+
- [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
|
|
20
|
+
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and go — см. `preset-twin-sync`)
|
|
21
|
+
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
|
|
22
|
+
- [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
|
|
23
|
+
- [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
24
|
+
- [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
|
|
25
|
+
- [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
|
|
26
|
+
- [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
|
|
27
|
+
- [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
|
|
28
|
+
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
29
|
+
|
|
30
|
+
## Pointers
|
|
31
|
+
|
|
32
|
+
- Layering: `preset-layering`
|
|
33
|
+
- Sync: `preset-twin-sync`
|
|
34
|
+
- Budget: `preset-token-budget`
|
|
35
|
+
- Leakage: `preset-no-cross-stack-leakage`
|
|
36
|
+
- Validation: stack `agents/build-verifier.md` → preset-structure section
|
|
37
|
+
- Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
|
|
38
|
+
- Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
|
|
39
|
+
- Orchestrator: when editing presets, load this checklist + twin-sync
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: ≤3 always-on / session-start; meta rules never alwaysApply.
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-token-budget.md -->
|
|
11
|
+
|
|
12
|
+
# Preset token budget
|
|
13
|
+
|
|
14
|
+
Инварианты загрузки правил в **установленном** пресете (consumer app).
|
|
15
|
+
|
|
16
|
+
## Hard caps
|
|
17
|
+
|
|
18
|
+
| Platform | Always-on | Cap |
|
|
19
|
+
|----------|-----------|-----|
|
|
20
|
+
| Cursor | `alwaysApply: true` | **≤ 3** |
|
|
21
|
+
| Claude | rules **without** `paths:` | **ровно 3** |
|
|
22
|
+
|
|
23
|
+
**Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
|
|
24
|
+
|
|
25
|
+
Session-start body budget (где задокументировано): ≤120 строк суммарно (stretch ≤100).
|
|
26
|
+
|
|
27
|
+
## Meta / author rules
|
|
28
|
+
|
|
29
|
+
Rules for preset authors (`preset-layering`, `preset-twin-sync`, …):
|
|
30
|
+
|
|
31
|
+
- **Never** `alwaysApply: true` on consumer installs.
|
|
32
|
+
- Cursor: `globs` limited to `packages/ai-rules/presets/**` (and dogfood `.cursor/**` where useful).
|
|
33
|
+
- Claude: `paths:` limited to `packages/ai-rules/presets/**` (and `.claude/**` dogfood if present).
|
|
34
|
+
|
|
35
|
+
## Heavy workflows
|
|
36
|
+
|
|
37
|
+
Orchestrator, feature-delivery, code-review, post-change gates, domain globs — **requestable / paths**, not always-on.
|
|
38
|
+
|
|
39
|
+
## Verifier
|
|
40
|
+
|
|
41
|
+
build-verifier **FAIL** if alwaysApply / session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: Cursor SoT → Claude twin same PR. Use when editing preset rules.
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-twin-sync.md -->
|
|
11
|
+
|
|
12
|
+
# Preset twin sync
|
|
13
|
+
|
|
14
|
+
Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
15
|
+
|
|
16
|
+
## Matrix
|
|
17
|
+
|
|
18
|
+
| Stack | Cursor SoT | Claude derive | Mapping table |
|
|
19
|
+
|-------|------------|---------------|---------------|
|
|
20
|
+
| `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
|
|
21
|
+
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
22
|
+
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
23
|
+
|
|
24
|
+
## Same-PR checklist
|
|
25
|
+
|
|
26
|
+
1. Edit Cursor rule first (body + frontmatter).
|
|
27
|
+
2. Update Claude twin: body + `paths:` (from Cursor `globs:` / requestable triggers); drop `alwaysApply`.
|
|
28
|
+
3. Update mapping table row if stem/path changed.
|
|
29
|
+
4. If body embeds core (`<!-- shared-core: … -->`), sync core consumers across stacks when core changed.
|
|
30
|
+
|
|
31
|
+
## Twin depth
|
|
32
|
+
|
|
33
|
+
- **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
|
|
34
|
+
- **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
|
|
35
|
+
|
|
36
|
+
## Severity (build-verifier)
|
|
37
|
+
|
|
38
|
+
- **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
|
|
39
|
+
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
40
|
+
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
41
|
+
|
|
42
|
+
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -7,6 +7,7 @@ globs:
|
|
|
7
7
|
- app/src/types/**/*
|
|
8
8
|
- app/src/api/**/*
|
|
9
9
|
alwaysApply: false
|
|
10
|
+
impact: HIGH
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# Публичные импорты (`@/types`, `@/api`)
|
|
@@ -46,3 +47,16 @@ import { MedcardApiService } from '@/api/services/MedcardApiService/MedcardApiSe
|
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
Новые публичные символы API — реэкспорт в `app/src/api/index.ts` по **`layer-barrel-exports.mdc`**.
|
|
50
|
+
## Incorrect
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import type { TUserProfile } from '@/types/User.types'
|
|
54
|
+
import { OrdersApi } from '@/api/services/OrdersApi'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Correct
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import type { TUserProfile } from '@/types'
|
|
61
|
+
import { ordersApi } from '@/api'
|
|
62
|
+
```
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
description: Паттерны React/Next UI и стилей (preset)
|
|
3
3
|
globs: app/src/ui/**/*.tsx,app/src/ui/**/*.ts
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: HIGH
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Общие правила компонентов
|
|
@@ -89,4 +90,23 @@ alwaysApply: false
|
|
|
89
90
|
- **Testing Library** для React, как принято в проекте;
|
|
90
91
|
- проверять поведение и бизнес‑правила, а не конкретные CSS‑классы.
|
|
91
92
|
- В тестах ориентироваться на текст, роли и aria‑атрибуты.
|
|
93
|
+
## Incorrect
|
|
92
94
|
|
|
95
|
+
```tsx
|
|
96
|
+
import { mapUserDto } from '@/api/services/UsersApi/userResponseMappers'
|
|
97
|
+
|
|
98
|
+
export const UserBadge = ({ dto }: { dto: unknown }) => {
|
|
99
|
+
const user = mapUserDto(dto as any) // mapping + deep import in UI
|
|
100
|
+
return <span>{user.name}</span>
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Correct
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import type { TUserProfile } from '@/types'
|
|
108
|
+
|
|
109
|
+
export const UserBadge = ({ user }: { user: TUserProfile }) => {
|
|
110
|
+
return <span>{user.name}</span>
|
|
111
|
+
}
|
|
112
|
+
```
|
|
@@ -8,10 +8,16 @@ globs:
|
|
|
8
8
|
alwaysApply: false
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
<!-- shared-core: architecture/reference-features.template.md -->
|
|
12
|
+
|
|
11
13
|
# Эталонные фичи (reference features)
|
|
12
14
|
|
|
15
|
+
## Stack notes
|
|
16
|
+
|
|
13
17
|
Перед реализацией найди фичу того же типа и **повтори её структуру**, не изобретая новую организацию файлов.
|
|
14
18
|
|
|
19
|
+
Taxonomy / shared core: [`presets/_shared/README.md`](../../../../_shared/README.md) · [Preset contribution guide](../../../../docs/PRESET-CONTRIBUTION.md).
|
|
20
|
+
|
|
15
21
|
## Таблица эталонов
|
|
16
22
|
|
|
17
23
|
Замени **TBD** на реальные пути после договорённости в команде (или при `ai-rules init` в целевом репо):
|
|
@@ -32,6 +38,10 @@ alwaysApply: false
|
|
|
32
38
|
3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
|
|
33
39
|
4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
|
|
34
40
|
|
|
41
|
+
## Living conventions
|
|
42
|
+
|
|
43
|
+
Post-init gotchas / patterns / decisions: **`.cursor/team/conventions.md`** (and the twin tool path if both Cursor and Claude are installed). Consumer-owned; not always-on. See root `AGENTS.md` § Living conventions.
|
|
44
|
+
|
|
35
45
|
## Связанные правила
|
|
36
46
|
|
|
37
47
|
- `code-quality-and-refactoring.mdc` — повторять паттерны, не deep-import.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Next.js frontend security — secrets, auth, XSS, Server Actions, env
|
|
3
|
+
globs:
|
|
4
|
+
- "app/src/**/*.{ts,tsx}"
|
|
5
|
+
- "app/**/app/**/*.{ts,tsx}"
|
|
6
|
+
- "**/*Auth*.{ts,tsx}"
|
|
7
|
+
- "**/*Session*.{ts,tsx}"
|
|
8
|
+
- "**/.env*"
|
|
9
|
+
alwaysApply: false
|
|
10
|
+
impact: CRITICAL
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Security (Next.js)
|
|
14
|
+
|
|
15
|
+
Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-review`.
|
|
16
|
+
|
|
17
|
+
## Secrets and env
|
|
18
|
+
|
|
19
|
+
- Never put service / secret keys in `NEXT_PUBLIC_*` or client bundles (`sk_`, private API keys, DB URLs).
|
|
20
|
+
- Do not commit `.env*` with real secrets; use CI / secret manager patterns already in the repo.
|
|
21
|
+
- Prefer server-only modules for privileged clients; do not import them into Client Components.
|
|
22
|
+
|
|
23
|
+
## Auth and session
|
|
24
|
+
|
|
25
|
+
- Enforce auth on the **server** (layouts, pages, Server Actions, route handlers) — not only Edge middleware.
|
|
26
|
+
- Middleware may refresh sessions; do not treat middleware alone as authorization.
|
|
27
|
+
- Prefer httpOnly secure cookies over `localStorage` for tokens when the repo pattern allows.
|
|
28
|
+
- Never trust client-only session claims without a server verify step used by the project.
|
|
29
|
+
|
|
30
|
+
## Mutations and input
|
|
31
|
+
|
|
32
|
+
- Server Actions / route handlers: validate untrusted input at the edge (Zod or the repo’s schema pattern).
|
|
33
|
+
- Prefer an explicit success/error response shape over throwing opaque errors to the client.
|
|
34
|
+
- CSRF / origin checks — follow existing repo middleware and form patterns for state-changing requests.
|
|
35
|
+
|
|
36
|
+
## XSS and output
|
|
37
|
+
|
|
38
|
+
- Avoid `dangerouslySetInnerHTML` unless sanitized and unavoidable; prefer text nodes / safe components.
|
|
39
|
+
- Sanitize or encode user-generated HTML/markdown before render.
|
|
40
|
+
- Open redirects: validate redirect targets against an allowlist or same-origin paths.
|
|
41
|
+
|
|
42
|
+
## Data exposure
|
|
43
|
+
|
|
44
|
+
- Do not log tokens, passwords, or full PII in client or server logs.
|
|
45
|
+
- Do not return full privileged records to the client — map to the minimum domain fields the UI needs.
|
|
46
|
+
|
|
47
|
+
## Anti-hallucination
|
|
48
|
+
|
|
49
|
+
| ❌ Avoid | ✅ Prefer |
|
|
50
|
+
|---------|----------|
|
|
51
|
+
| Invented auth helpers not in `package.json` / codebase | Copy patterns from existing auth routes |
|
|
52
|
+
| Putting secrets in `NEXT_PUBLIC_*` | Server-only env + server modules |
|
|
53
|
+
| Auth only in middleware | Server `getUser` / session verify in layout/page/action |
|
|
54
|
+
|
|
55
|
+
## Agent requirement
|
|
56
|
+
|
|
57
|
+
On auth, forms, payments, or env changes — load this rule and `code-review-mr.mdc`. Route sensitive features through `security-reviewer`.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
description: Redux Toolkit и состояние приложения
|
|
3
3
|
globs: app/src/store/**/*.ts
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: HIGH
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Общие принципы
|
|
@@ -63,4 +64,22 @@ alwaysApply: false
|
|
|
63
64
|
- Строго типизировать state и actions.
|
|
64
65
|
- Использовать единый стиль именования actions и селекторов, как в существующих слайсах.
|
|
65
66
|
- При работе с ошибками и ответами HTTP опираться на **`http-client.mdc`** и контракты из `@/types`, а не на типы внешних HTTP‑библиотек вне зависимостей проекта.
|
|
67
|
+
## Incorrect
|
|
66
68
|
|
|
69
|
+
```ts
|
|
70
|
+
export const loadProfile = createAsyncThunk('profile/load', async () => {
|
|
71
|
+
const res = await fetch('/api/profile')
|
|
72
|
+
return res.json() // raw DTO into slice
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Correct
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { profileApi } from '@/api'
|
|
80
|
+
|
|
81
|
+
export const loadProfile = createAsyncThunk('profile/load', async () => {
|
|
82
|
+
// service returns domain model already mapped
|
|
83
|
+
return profileApi.getProfile()
|
|
84
|
+
})
|
|
85
|
+
```
|
|
@@ -3,10 +3,12 @@ description: Роль агента для проведения техничес
|
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: review/technical-retro.md -->
|
|
7
|
+
|
|
6
8
|
# Техническое ретро — rule alias
|
|
7
9
|
|
|
8
|
-
Полный сценарий (включая блок **«Работа агентов»** для slug из
|
|
10
|
+
Полный сценарий (включая блок **«Работа агентов»** для slug из team tasks) — в slash-команде:
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
**`commands/technical-retro.md`** → `/technical-retro`
|
|
11
13
|
|
|
12
|
-
Используй rule только если command недоступен. Не дублируй содержимое command в ответе — следуй command
|
|
14
|
+
Используй rule только если command недоступен. Не дублируй содержимое command в ответе — следуй command-файлу и skill `technical-retro`.
|
|
@@ -4,6 +4,7 @@ globs:
|
|
|
4
4
|
- app/src/**/*.spec.{ts,tsx}
|
|
5
5
|
- app/src/**/*.test.{ts,tsx}
|
|
6
6
|
alwaysApply: false
|
|
7
|
+
impact: MEDIUM
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Общие правила тестирования
|
|
@@ -63,4 +64,15 @@ it('Returns empty list when user is guest', () => {})
|
|
|
63
64
|
- для **компонентов UI** — **не создавать** поддиректорию `__tests__` внутри папки компонента; тест — соседний `*.spec.tsx`.
|
|
64
65
|
- в **других модулях** (например `api/services`) допустима уже существующая схема с `__tests__` — не ломать ради единообразия с UI.
|
|
65
66
|
- **новые** файлы — `*.spec.ts` / `*.spec.tsx` (см. блок «Имена файлов» выше).
|
|
67
|
+
## Incorrect
|
|
66
68
|
|
|
69
|
+
```ts
|
|
70
|
+
it('returns empty list when guest', () => {})
|
|
71
|
+
it('Возвращает пустой список. пользователь не авторизован', () => {})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Correct
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
it('Возвращает пустой список. Пользователь не авторизован', () => {})
|
|
78
|
+
```
|
|
@@ -11,5 +11,7 @@ Project skills for Cursor. They keep long workflows out of always-on rules while
|
|
|
11
11
|
| `unit-testing` | Planning, generating, or healing unit test coverage |
|
|
12
12
|
| `playwright-e2e` | Planning, generating, or healing Playwright e2e coverage |
|
|
13
13
|
| `technical-retro` | Technical retrospective for a task, sprint, incident, or agent pipeline |
|
|
14
|
+
| `write-adr` | Author an Architecture Decision Record (context / decision / consequences) |
|
|
15
|
+
| `react-performance` | Implementer checklist: bundle, RSC/client, memo, waterfalls, CWV (not a perf audit agent) |
|
|
14
16
|
|
|
15
17
|
Skills are copied to `.cursor/skills/` by `ai-rules init cursor --preset next`.
|
|
@@ -17,10 +17,22 @@ Use the local repository as the source of truth: `git status`, `git diff`, task
|
|
|
17
17
|
4. Check public imports through `@/types` and `@/api`, plus barrel updates for new public symbols.
|
|
18
18
|
5. Review UI consistency, styling conventions, and prop shape.
|
|
19
19
|
6. Check tests: unit for mapper/domain logic, behavior tests for HTTP client changes, e2e plan/spec updates for user flows.
|
|
20
|
-
7.
|
|
20
|
+
7. **Reuse lens:** flag new helpers that duplicate existing utilities; prefer adjacent shared modules over copy-paste.
|
|
21
|
+
8. **Efficiency lens:** unnecessary work, sequential ops that should be parallel, hot-path bloat, no-op store updates, overly broad reads.
|
|
22
|
+
9. Report validation gaps: lint, stylelint, type-check, or relevant tests not run.
|
|
21
23
|
|
|
22
24
|
## Output
|
|
23
25
|
|
|
24
|
-
Lead with findings ordered by severity.
|
|
26
|
+
Lead with findings ordered by severity. Required shape (also in `code-review-mr`):
|
|
27
|
+
|
|
28
|
+
- Each finding: **`path:line`** — problem — impact — concrete fix direction.
|
|
29
|
+
- Severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
30
|
+
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding context.
|
|
31
|
+
- End with a verdict line: **`Safe to merge | needs changes | reject`**.
|
|
32
|
+
- If there are no findings, say so and call out remaining test or validation risk.
|
|
25
33
|
|
|
26
34
|
For agent team tasks, write `.cursor/team/tasks/<slug>/review.md` and set `status.json` to `completed` or `changes_requested`.
|
|
35
|
+
|
|
36
|
+
## Design guidance
|
|
37
|
+
|
|
38
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -10,6 +10,14 @@ description: Delivers Next.js frontend features end-to-end across domain types,
|
|
|
10
10
|
3. Add or update focused tests for changed behavior.
|
|
11
11
|
4. Validation from `app/`: **invoke** **`post-change-lint.mdc`** after code edits (requestable, not always-on — but mandatory when code changed). Pipeline: scoped lint OK if next step is `build-verifier`.
|
|
12
12
|
|
|
13
|
+
## Scope discipline
|
|
14
|
+
|
|
15
|
+
Implement only the current AC / decomposition task. Clarify ambiguity before coding; do not add unrelated hardening, polish, or refactors. See `feature-developer` → **Zero improvisation**.
|
|
16
|
+
|
|
13
17
|
## Handoff
|
|
14
18
|
|
|
15
19
|
Summarize by layer, validation results, and known gaps. Agent team: update `.cursor/team/tasks/<slug>/status.json`.
|
|
20
|
+
|
|
21
|
+
## Design guidance
|
|
22
|
+
|
|
23
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-performance
|
|
3
|
+
description: Next.js React performance checklist for implementers — bundle, RSC/client boundaries, memoization discipline, data-fetch waterfalls, Core Web Vitals. Use while coding a next feature; not a substitute for the performance-auditor agent when the user asks for an audit report.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# React performance (next)
|
|
7
|
+
|
|
8
|
+
On-demand checklist for **implementers** shipping Next.js UI. For a formal diff audit report, use the **`performance-auditor`** agent instead — this skill does not replace it.
|
|
9
|
+
|
|
10
|
+
## Bundle
|
|
11
|
+
|
|
12
|
+
- Prefer route-level and component-level code splitting for heavy UI (charts, editors).
|
|
13
|
+
- Avoid importing large libraries into shared layouts; keep client entry points small.
|
|
14
|
+
- Check that barrel files do not re-export heavy modules into every consumer.
|
|
15
|
+
|
|
16
|
+
## RSC / client boundaries
|
|
17
|
+
|
|
18
|
+
- Default to Server Components; add `"use client"` only when hooks, browser APIs, or interactivity require it.
|
|
19
|
+
- Keep client leaves small; pass serializable props from server parents.
|
|
20
|
+
- Do not pull server-only modules (secrets, Node APIs) into client components.
|
|
21
|
+
|
|
22
|
+
## Memoization discipline
|
|
23
|
+
|
|
24
|
+
- Do **not** add `useMemo` / `useCallback` by default — follow the repo’s React Compiler / team guidance.
|
|
25
|
+
- Memoize when profiling shows unstable props causing expensive subtree re-renders, or when an existing pattern already does.
|
|
26
|
+
- Prefer fixing state placement and list keys over blanket memo wrappers.
|
|
27
|
+
|
|
28
|
+
## Data-fetch waterfalls
|
|
29
|
+
|
|
30
|
+
- Avoid sequential awaits that could be parallel (`Promise.all`) when independent.
|
|
31
|
+
- Lift shared fetches to a layout/parent when multiple children need the same data.
|
|
32
|
+
- Prefer store/thunk or server fetch patterns already used in the feature’s reference slice — do not invent a second data layer.
|
|
33
|
+
|
|
34
|
+
## Core Web Vitals (quick)
|
|
35
|
+
|
|
36
|
+
| Metric | Implementer checks |
|
|
37
|
+
|--------|--------------------|
|
|
38
|
+
| LCP | Hero/media not blocked by unnecessary client JS; sensible image sizing |
|
|
39
|
+
| INP | Click handlers lean; avoid long sync work on the main thread |
|
|
40
|
+
| CLS | Reserve space for images/skeleton; stable fonts |
|
|
41
|
+
|
|
42
|
+
## Handoff
|
|
43
|
+
|
|
44
|
+
If the user asks for a **performance audit report** of a diff/deliverable, route to **`performance-auditor`** (readonly `perf-report.md`), not this skill alone.
|
|
@@ -29,12 +29,26 @@ Ask for missing period, focus, task slug, participants, or format constraints. I
|
|
|
29
29
|
|
|
30
30
|
For `/task` pipelines, include router, analyst, developer, **build-verifier**, reviewer, QA/e2e, hooks, and rules.
|
|
31
31
|
|
|
32
|
+
## Wrong-turn taxonomy (optional)
|
|
33
|
+
|
|
34
|
+
When artifacts or the user mention agent mistakes, tag incidents:
|
|
35
|
+
|
|
36
|
+
| Kind | Signal |
|
|
37
|
+
|------|--------|
|
|
38
|
+
| `correction` | User pushback («no», «don't», «actually») |
|
|
39
|
+
| `retry` | Same tool/approach 2+ times before success |
|
|
40
|
+
| `waste` | Many searches before the right file |
|
|
41
|
+
| `reversal` | Edit then revert / delete |
|
|
42
|
+
| `dead-end` | Env/tool failure (missing binary, wrong path) |
|
|
43
|
+
|
|
44
|
+
Severity: **high** (explicit correction / large waste) · **med** · **low**. Confidence 0–100 — be honest; low-confidence items are optional.
|
|
45
|
+
|
|
32
46
|
## Preset feedback loop
|
|
33
47
|
|
|
34
|
-
If the same issue appeared in 2
|
|
48
|
+
If the same issue appeared in **2+** tasks (or **3+** for packaging a new rule/skill — Rule of Three), add section **Preset updates**:
|
|
35
49
|
|
|
36
|
-
- Proposed change to `.cursor/rules/`, `.cursor/agents/`, or
|
|
37
|
-
- One concrete
|
|
38
|
-
- Whether it belongs in always-on
|
|
50
|
+
- Proposed change to `.cursor/rules/`, `.cursor/agents/`, `.cursor/skills/`, or **`.cursor/team/conventions.md`** (prefer conventions for project gotchas)
|
|
51
|
+
- One concrete snippet or file path
|
|
52
|
+
- Whether it belongs in always-on vs globs vs skill vs conventions (see `PRESET-CONTRIBUTION` → Building blocks)
|
|
39
53
|
|
|
40
|
-
Do not apply preset changes without user approval.
|
|
54
|
+
Do not apply preset or conventions changes without user approval.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-adr
|
|
3
|
+
description: Author an Architecture Decision Record (ADR) with Context, Decision, Consequences, and Links. Use when capturing a durable technical choice for the team.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write ADR
|
|
7
|
+
|
|
8
|
+
On-demand skill for durable architecture decisions. Stack-agnostic sections — fill with project-specific paths and links.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- Choosing between non-trivial alternatives (storage, layering, library, API shape).
|
|
13
|
+
- Recording a decision that future agents/humans should not silently reverse.
|
|
14
|
+
- User asks for an ADR, decision log, or “why did we pick X”.
|
|
15
|
+
|
|
16
|
+
## Template
|
|
17
|
+
|
|
18
|
+
Create (or append) a short markdown ADR in the repo’s agreed location (e.g. `docs/adr/`, `.cursor/team/`, wiki). Suggested filename: `NNNN-short-title.md`.
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
# ADR NNNN: <Title>
|
|
22
|
+
|
|
23
|
+
## Context
|
|
24
|
+
What problem / constraint / force requires a decision?
|
|
25
|
+
|
|
26
|
+
## Decision
|
|
27
|
+
What we chose (one clear option). Include rejected alternatives briefly if useful.
|
|
28
|
+
|
|
29
|
+
## Consequences
|
|
30
|
+
Positive and negative outcomes; follow-up work; what becomes harder.
|
|
31
|
+
|
|
32
|
+
## Links
|
|
33
|
+
Related PRs, issues, rules, prior ADRs, diagrams.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Guidelines
|
|
37
|
+
|
|
38
|
+
- Prefer one decision per ADR.
|
|
39
|
+
- Keep Context factual; Decision imperative and short.
|
|
40
|
+
- Link living gotchas to `team/conventions.md` when the decision becomes a recurring local pattern.
|
|
41
|
+
- Do not put ADR bodies only in root `AGENTS.md` (overwrite on init).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Living conventions (team)
|
|
2
|
+
|
|
3
|
+
Consumer-owned store for post-init gotchas, patterns, and decisions. **Not** always-on. Fill after `ai-rules init`. Root `AGENTS.md` only points here.
|
|
4
|
+
|
|
5
|
+
## Gotchas
|
|
6
|
+
|
|
7
|
+
<!-- e.g. fragile flows, “never do X in this repo” -->
|
|
8
|
+
|
|
9
|
+
-
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
<!-- local patterns beyond reference-features table -->
|
|
14
|
+
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
## Decisions
|
|
18
|
+
|
|
19
|
+
<!-- short pointers to ADRs / product choices that affect code -->
|
|
20
|
+
|
|
21
|
+
-
|