@bonesofspring/ai-rules 0.2.2 → 0.2.3
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 +63 -0
- package/README.md +26 -4
- package/bin/cli.js +259 -72
- package/package.json +3 -2
- package/presets/claude/ios-swift/CLAUDE.md +28 -20
- package/presets/claude/ios-swift/README.md +16 -15
- package/presets/claude/ios-swift/agents/README.md +55 -0
- package/presets/claude/ios-swift/agents/accessibility-reviewer.md +67 -0
- package/presets/claude/ios-swift/agents/api-contract-reviewer.md +72 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +64 -0
- package/presets/claude/ios-swift/agents/ci-investigator.md +73 -0
- package/presets/claude/ios-swift/agents/code-reviewer.md +75 -0
- package/presets/claude/ios-swift/agents/debugger.md +72 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +35 -0
- package/presets/claude/ios-swift/agents/migration-specialist.md +73 -0
- package/presets/claude/ios-swift/agents/performance-auditor.md +72 -0
- package/presets/claude/ios-swift/agents/qa-tester.md +65 -0
- package/presets/claude/ios-swift/agents/security-reviewer.md +69 -0
- package/presets/claude/ios-swift/agents/solution-architect.md +17 -0
- package/presets/claude/ios-swift/agents/task-analyst.md +25 -0
- package/presets/claude/ios-swift/agents/task-router.md +62 -0
- package/presets/claude/ios-swift/agents/tech-writer.md +63 -0
- package/presets/claude/ios-swift/agents/unit-test-generator.md +54 -0
- package/presets/claude/ios-swift/agents/unit-test-healer.md +53 -0
- package/presets/claude/ios-swift/agents/unit-test-planner.md +64 -0
- package/presets/claude/ios-swift/agents/xcuitest-test-generator.md +47 -0
- package/presets/claude/ios-swift/agents/xcuitest-test-healer.md +47 -0
- package/presets/claude/ios-swift/agents/xcuitest-test-planner.md +67 -0
- package/presets/claude/ios-swift/commands/README.md +12 -2
- package/presets/claude/ios-swift/commands/feature-continue.md +51 -0
- package/presets/claude/ios-swift/commands/feature-start.md +30 -0
- package/presets/claude/ios-swift/commands/task-continue.md +49 -0
- package/presets/claude/ios-swift/commands/task.md +50 -0
- package/presets/claude/ios-swift/commands/technical-retro.md +58 -0
- package/presets/claude/ios-swift/hooks/README.md +10 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +382 -0
- package/presets/claude/ios-swift/hooks/guard-shell-command.sh +79 -0
- package/presets/claude/ios-swift/rules/README.md +25 -14
- package/presets/claude/ios-swift/rules/api-and-data/README.md +2 -1
- package/presets/claude/ios-swift/rules/api-and-data/networking.md +2 -2
- package/presets/claude/ios-swift/rules/api-and-data/persistence.md +30 -0
- package/presets/claude/ios-swift/rules/architecture/README.md +3 -1
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +10 -2
- package/presets/claude/ios-swift/rules/architecture/module-public-api.md +25 -0
- package/presets/claude/ios-swift/rules/architecture/reference-features.md +50 -0
- package/presets/claude/ios-swift/rules/stack/ios-app-core.md +2 -1
- package/presets/claude/ios-swift/rules/testing/ui.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/README.md +6 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +18 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +47 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +5 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +5 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/security-ios.md +36 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +14 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/xcode-tooling.md +24 -0
- package/presets/claude/ios-swift/rules/ui-and-accessibility/README.md +2 -1
- package/presets/claude/ios-swift/rules/ui-and-accessibility/navigation.md +28 -0
- package/presets/claude/ios-swift/skills/README.md +13 -0
- package/presets/claude/ios-swift/skills/ci-investigation/SKILL.md +39 -0
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +27 -0
- package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +30 -0
- package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +27 -0
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +10 -0
- package/presets/claude/ios-swift/skills/unit-testing/SKILL.md +32 -0
- package/presets/claude/ios-swift/skills/xcuitest-e2e/SKILL.md +33 -0
- package/presets/claude/ios-swift/team/README.md +27 -0
- package/presets/claude/ios-swift/team/fixtures/bugfix-standard.json +33 -0
- package/presets/claude/ios-swift/team/fixtures/feature-full.json +48 -0
- package/presets/claude/ios-swift/team/fixtures/feature-light.json +36 -0
- package/presets/claude/next/CLAUDE.md +29 -5
- package/presets/claude/next/README.md +10 -0
- package/presets/claude/next/agents/README.md +155 -1
- package/presets/claude/next/agents/accessibility-reviewer.md +65 -0
- package/presets/claude/next/agents/api-contract-reviewer.md +69 -0
- package/presets/claude/next/agents/build-verifier.md +64 -0
- package/presets/claude/next/agents/ci-investigator.md +62 -0
- package/presets/claude/next/agents/code-reviewer.md +63 -0
- package/presets/claude/next/agents/debugger.md +63 -0
- package/presets/claude/next/agents/feature-developer.md +27 -0
- package/presets/claude/next/agents/migration-specialist.md +69 -0
- package/presets/claude/next/agents/performance-auditor.md +68 -0
- package/presets/claude/next/agents/qa-tester.md +56 -0
- package/presets/claude/next/agents/security-reviewer.md +64 -0
- package/presets/claude/next/agents/solution-architect.md +70 -0
- package/presets/claude/next/agents/task-analyst.md +111 -0
- package/presets/claude/next/agents/task-router.md +94 -0
- package/presets/claude/next/agents/tech-writer.md +61 -0
- package/presets/claude/next/agents/unit-test-generator.md +37 -0
- package/presets/claude/next/agents/unit-test-healer.md +38 -0
- package/presets/claude/next/agents/unit-test-planner.md +62 -0
- package/presets/claude/next/commands/README.md +10 -2
- package/presets/claude/next/commands/feature-continue.md +51 -0
- package/presets/claude/next/commands/feature-start.md +30 -0
- package/presets/claude/next/commands/task-continue.md +49 -0
- package/presets/claude/next/commands/task.md +50 -0
- package/presets/claude/next/commands/technical-retro.md +58 -0
- package/presets/claude/next/hooks/README.md +5 -2
- package/presets/claude/next/hooks/chain-team-phases.sh +380 -0
- package/presets/claude/next/hooks/guard-shell-command.sh +77 -0
- package/presets/claude/next/rules/README.md +42 -11
- package/presets/claude/next/rules/api-and-data/README.md +7 -1
- package/presets/claude/next/rules/api-and-data/api-services.md +57 -0
- package/presets/claude/next/rules/api-and-data/http-client.md +40 -0
- package/presets/claude/next/rules/api-and-data/store-rtk.md +65 -0
- package/presets/claude/next/rules/architecture/README.md +11 -2
- package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +15 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +75 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +79 -0
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +58 -0
- package/presets/claude/next/rules/architecture/public-imports.md +46 -0
- package/presets/claude/next/rules/architecture/reference-features.md +37 -0
- package/presets/claude/next/rules/stack/README.md +10 -1
- package/presets/claude/next/rules/stack/arrow-functions.md +45 -0
- package/presets/claude/next/rules/stack/navigation-router-ui.md +15 -0
- package/presets/claude/next/rules/stack/navigation-router.md +64 -0
- package/presets/claude/next/rules/stack/next-app-core.md +33 -0
- package/presets/claude/next/rules/stack/next-app-router.md +36 -0
- package/presets/claude/next/rules/stack/no-type-assertion.md +59 -0
- package/presets/claude/next/rules/stack/types-jsdoc.md +37 -0
- package/presets/claude/next/rules/testing/README.md +9 -1
- package/presets/claude/next/rules/testing/playwright-agents.md +74 -0
- package/presets/claude/next/rules/testing/tests-e2e-structure.md +52 -0
- package/presets/claude/next/rules/testing/tests-unit.md +66 -0
- package/presets/claude/next/rules/tooling-and-review/README.md +12 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +15 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +141 -0
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +42 -0
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +30 -0
- package/presets/claude/next/rules/tooling-and-review/package-manager.md +11 -0
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +44 -0
- package/presets/claude/next/rules/ui-and-accessibility/README.md +10 -1
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +14 -0
- package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +57 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-a11y-coding.md +37 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +91 -0
- package/presets/claude/next/skills/README.md +11 -1
- package/presets/claude/next/skills/ci-investigation/SKILL.md +36 -0
- package/presets/claude/next/skills/code-review/SKILL.md +26 -0
- package/presets/claude/next/skills/debug-investigation/SKILL.md +28 -0
- package/presets/claude/next/skills/feature-delivery/SKILL.md +15 -0
- package/presets/claude/next/skills/playwright-e2e/SKILL.md +31 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +40 -0
- package/presets/claude/next/skills/unit-testing/SKILL.md +32 -0
- package/presets/claude/next/team/README.md +105 -0
- package/presets/claude/next/team/fixtures/bugfix-standard.json +15 -0
- package/presets/claude/next/team/fixtures/feature-full.json +16 -0
- package/presets/claude/next/team/fixtures/feature-light.json +17 -0
- package/presets/claude/next/team/tasks/.gitkeep +1 -0
- package/presets/cursor/ios-swift/AGENTS.md +47 -0
- package/presets/cursor/ios-swift/BUGBOT.md +15 -0
- package/presets/cursor/ios-swift/README.md +26 -7
- package/presets/cursor/ios-swift/agents/README.md +55 -0
- package/presets/cursor/ios-swift/agents/accessibility-reviewer.md +67 -0
- package/presets/cursor/ios-swift/agents/api-contract-reviewer.md +72 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +64 -0
- package/presets/cursor/ios-swift/agents/ci-investigator.md +73 -0
- package/presets/cursor/ios-swift/agents/code-reviewer.md +75 -0
- package/presets/cursor/ios-swift/agents/debugger.md +72 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +35 -0
- package/presets/cursor/ios-swift/agents/migration-specialist.md +73 -0
- package/presets/cursor/ios-swift/agents/performance-auditor.md +72 -0
- package/presets/cursor/ios-swift/agents/qa-tester.md +65 -0
- package/presets/cursor/ios-swift/agents/security-reviewer.md +69 -0
- package/presets/cursor/ios-swift/agents/solution-architect.md +17 -0
- package/presets/cursor/ios-swift/agents/task-analyst.md +25 -0
- package/presets/cursor/ios-swift/agents/task-router.md +62 -0
- package/presets/cursor/ios-swift/agents/tech-writer.md +63 -0
- package/presets/cursor/ios-swift/agents/unit-test-generator.md +54 -0
- package/presets/cursor/ios-swift/agents/unit-test-healer.md +53 -0
- package/presets/cursor/ios-swift/agents/unit-test-planner.md +64 -0
- package/presets/cursor/ios-swift/agents/xcuitest-test-generator.md +47 -0
- package/presets/cursor/ios-swift/agents/xcuitest-test-healer.md +47 -0
- package/presets/cursor/ios-swift/agents/xcuitest-test-planner.md +67 -0
- package/presets/cursor/ios-swift/commands/README.md +49 -1
- package/presets/cursor/ios-swift/commands/feature-continue.md +19 -0
- package/presets/cursor/ios-swift/commands/feature-start.md +33 -0
- package/presets/cursor/ios-swift/commands/task-continue.md +49 -0
- package/presets/cursor/ios-swift/commands/task.md +50 -0
- package/presets/cursor/ios-swift/commands/technical-retro.md +81 -0
- package/presets/cursor/ios-swift/hooks/README.md +8 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +382 -0
- package/presets/cursor/ios-swift/hooks/guard-shell-command.sh +79 -0
- package/presets/cursor/ios-swift/hooks.json +17 -0
- package/presets/cursor/ios-swift/rules/README.md +45 -13
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +16 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +80 -0
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +1 -0
- package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +1 -1
- package/presets/cursor/ios-swift/rules/ios-app-core.mdc +2 -1
- package/presets/cursor/ios-swift/rules/module-public-api.mdc +26 -0
- package/presets/cursor/ios-swift/rules/navigation-coordinators.mdc +29 -0
- package/presets/cursor/ios-swift/rules/networking-services.mdc +2 -2
- package/presets/cursor/ios-swift/rules/persistence-data.mdc +31 -0
- package/presets/cursor/ios-swift/rules/reference-features.mdc +53 -0
- package/presets/cursor/ios-swift/rules/security-ios.mdc +35 -0
- package/presets/cursor/ios-swift/rules/technical-retro.mdc +12 -0
- package/presets/cursor/ios-swift/rules/tests-ui.mdc +1 -0
- package/presets/cursor/ios-swift/rules/xcode-tooling.mdc +20 -0
- package/presets/cursor/ios-swift/skills/README.md +13 -0
- package/presets/cursor/ios-swift/skills/ci-investigation/SKILL.md +39 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +27 -0
- package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +30 -0
- package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +27 -0
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +10 -0
- package/presets/cursor/ios-swift/skills/unit-testing/SKILL.md +32 -0
- package/presets/cursor/ios-swift/skills/xcuitest-e2e/SKILL.md +33 -0
- package/presets/cursor/ios-swift/team/README.md +27 -0
- package/presets/cursor/ios-swift/team/fixtures/bugfix-standard.json +33 -0
- package/presets/cursor/ios-swift/team/fixtures/feature-full.json +48 -0
- package/presets/cursor/ios-swift/team/fixtures/feature-light.json +36 -0
- package/presets/cursor/next/AGENTS.md +36 -0
- package/presets/cursor/next/BUGBOT.md +14 -0
- package/presets/cursor/next/agents/README.md +165 -0
- package/presets/cursor/next/agents/accessibility-reviewer.md +67 -0
- package/presets/cursor/next/agents/api-contract-reviewer.md +71 -0
- package/presets/cursor/next/agents/build-verifier.md +66 -0
- package/presets/cursor/next/agents/ci-investigator.md +64 -0
- package/presets/cursor/next/agents/code-reviewer.md +64 -0
- package/presets/cursor/next/agents/debugger.md +64 -0
- package/presets/cursor/next/agents/feature-developer.md +28 -0
- package/presets/cursor/next/agents/migration-specialist.md +71 -0
- package/presets/cursor/next/agents/performance-auditor.md +70 -0
- package/presets/cursor/next/agents/playwright-test-generator.md +27 -0
- package/presets/cursor/next/agents/playwright-test-healer.md +27 -0
- package/presets/cursor/next/agents/playwright-test-planner.md +28 -0
- package/presets/cursor/next/agents/qa-tester.md +58 -0
- package/presets/cursor/next/agents/security-reviewer.md +66 -0
- package/presets/cursor/next/agents/solution-architect.md +71 -0
- package/presets/cursor/next/agents/task-analyst.md +112 -0
- package/presets/cursor/next/agents/task-router.md +95 -0
- package/presets/cursor/next/agents/tech-writer.md +62 -0
- package/presets/cursor/next/agents/unit-test-generator.md +39 -0
- package/presets/cursor/next/agents/unit-test-healer.md +40 -0
- package/presets/cursor/next/agents/unit-test-planner.md +64 -0
- package/presets/cursor/next/commands/README.md +49 -1
- package/presets/cursor/next/commands/feature-continue.md +19 -0
- package/presets/cursor/next/commands/feature-start.md +33 -0
- package/presets/cursor/next/commands/task-continue.md +49 -0
- package/presets/cursor/next/commands/task.md +50 -0
- package/presets/cursor/next/commands/technical-retro.md +81 -0
- package/presets/cursor/next/hooks/README.md +8 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +380 -0
- package/presets/cursor/next/hooks/guard-shell-command.sh +77 -0
- package/presets/cursor/next/hooks.json +17 -0
- package/presets/cursor/next/rules/README.md +67 -0
- package/presets/cursor/next/rules/agent-team-intake.mdc +14 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +141 -0
- package/presets/cursor/next/rules/api-services.mdc +12 -10
- package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +15 -0
- package/presets/cursor/next/rules/architecture-boundaries.mdc +31 -12
- package/presets/cursor/next/rules/arrow-functions.mdc +46 -0
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +5 -4
- package/presets/cursor/next/rules/code-review-mr.mdc +21 -40
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +16 -0
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +76 -0
- package/presets/cursor/next/rules/http-client.mdc +42 -0
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +59 -0
- package/presets/cursor/next/rules/navigation-router-stack.mdc +62 -0
- package/presets/cursor/next/rules/navigation-router-ui.mdc +16 -0
- package/presets/cursor/next/rules/next-app-core.mdc +18 -61
- package/presets/cursor/next/rules/next-app-router.mdc +36 -0
- package/presets/cursor/next/rules/no-props-spread.mdc +27 -4
- package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +60 -0
- package/presets/cursor/next/rules/package-manager.mdc +16 -0
- package/presets/cursor/next/rules/playwright-agents.mdc +2 -1
- package/presets/cursor/next/rules/post-change-lint.mdc +40 -0
- package/presets/cursor/next/rules/public-imports.mdc +48 -0
- package/presets/cursor/next/rules/react-a11y-coding.mdc +37 -0
- package/presets/cursor/next/rules/react-ui.mdc +33 -3
- package/presets/cursor/next/rules/reference-features.mdc +39 -0
- package/presets/cursor/next/rules/store-rtk.mdc +13 -6
- package/presets/cursor/next/rules/technical-retro.mdc +12 -0
- package/presets/cursor/next/rules/tests-unit.mdc +30 -10
- package/presets/cursor/next/rules/types-jsdoc.mdc +42 -0
- package/presets/cursor/next/skills/README.md +15 -0
- package/presets/cursor/next/skills/ci-investigation/SKILL.md +36 -0
- package/presets/cursor/next/skills/code-review/SKILL.md +26 -0
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +28 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +15 -0
- package/presets/cursor/next/skills/playwright-e2e/SKILL.md +31 -0
- package/presets/cursor/next/skills/technical-retro/SKILL.md +40 -0
- package/presets/cursor/next/skills/unit-testing/SKILL.md +32 -0
- package/presets/cursor/next/team/README.md +105 -0
- package/presets/cursor/next/team/fixtures/bugfix-standard.json +15 -0
- package/presets/cursor/next/team/fixtures/feature-full.json +16 -0
- package/presets/cursor/next/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/next/team/tasks/.gitkeep +0 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Chains agent team steps from pipeline.json after subagentStop.
|
|
3
|
+
# Falls back to legacy phase-based flow when pipeline.json is absent.
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
input=$(cat)
|
|
8
|
+
|
|
9
|
+
INPUT="$input" node <<'NODE'
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
const TEAM_ROOT = path.join(process.cwd(), '.cursor', 'team');
|
|
14
|
+
|
|
15
|
+
const inputRaw = process.env.INPUT || '';
|
|
16
|
+
let hookInput;
|
|
17
|
+
try {
|
|
18
|
+
hookInput = JSON.parse(inputRaw);
|
|
19
|
+
} catch {
|
|
20
|
+
process.stdout.write('{}');
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (hookInput.status !== 'completed') {
|
|
25
|
+
process.stdout.write('{}');
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const activePath = path.join(TEAM_ROOT, 'active-task.json');
|
|
30
|
+
|
|
31
|
+
if (!fs.existsSync(activePath)) {
|
|
32
|
+
process.stdout.write('{}');
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let active;
|
|
37
|
+
try {
|
|
38
|
+
active = JSON.parse(fs.readFileSync(activePath, 'utf8'));
|
|
39
|
+
} catch {
|
|
40
|
+
process.stdout.write('{}');
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const slug = active.slug;
|
|
45
|
+
if (!slug) {
|
|
46
|
+
process.stdout.write('{}');
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const taskDir = path.join(TEAM_ROOT, 'tasks', slug);
|
|
51
|
+
const statusPath = path.join(taskDir, 'status.json');
|
|
52
|
+
const pipelinePath = path.join(taskDir, 'pipeline.json');
|
|
53
|
+
|
|
54
|
+
if (!fs.existsSync(statusPath)) {
|
|
55
|
+
process.stdout.write('{}');
|
|
56
|
+
process.exit(0);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let status;
|
|
60
|
+
try {
|
|
61
|
+
status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
|
|
62
|
+
} catch {
|
|
63
|
+
process.stdout.write('{}');
|
|
64
|
+
process.exit(0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const now = new Date().toISOString();
|
|
68
|
+
|
|
69
|
+
function writeStatus(next) {
|
|
70
|
+
status = { ...status, ...next, slug, updatedAt: now };
|
|
71
|
+
fs.writeFileSync(statusPath, JSON.stringify(status, null, 2) + '\n');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function out(message) {
|
|
75
|
+
process.stdout.write(JSON.stringify({ followup_message: message }));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function readArtifact(name) {
|
|
79
|
+
const p = path.join(taskDir, name);
|
|
80
|
+
if (!fs.existsSync(p)) return '';
|
|
81
|
+
try {
|
|
82
|
+
return fs.readFileSync(p, 'utf8');
|
|
83
|
+
} catch {
|
|
84
|
+
return '';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getStepAgents(step) {
|
|
89
|
+
if (!step) return [];
|
|
90
|
+
return Array.isArray(step.agent) ? step.agent : [step.agent];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function skipIfMatches(skipIf, dir) {
|
|
94
|
+
if (!skipIf) return false;
|
|
95
|
+
if (skipIf === 'debugger.fixed') {
|
|
96
|
+
const text = readArtifact('debug-report.md');
|
|
97
|
+
return /fixApplied:\s*true/i.test(text) || /\*\*Fix applied:\*\*\s*true/i.test(text);
|
|
98
|
+
}
|
|
99
|
+
if (skipIf === 'ci-investigator.resolved') {
|
|
100
|
+
const text = readArtifact('ci-report.md');
|
|
101
|
+
return /fixApplied:\s*true/i.test(text) || /## Verdict\s*\nPASS/i.test(text);
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function findNextExecutableStep(steps, startIdx, dir) {
|
|
107
|
+
for (let i = startIdx; i < steps.length; i++) {
|
|
108
|
+
if (!skipIfMatches(steps[i].skipIf, dir)) {
|
|
109
|
+
return { step: steps[i], index: i };
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const AGENT_HANDOFF = {
|
|
116
|
+
'task-analyst': (s) =>
|
|
117
|
+
`Invoke task-analyst for slug "${s}". Write brief.md and decomposition.md under .cursor/team/tasks/${s}/. ` +
|
|
118
|
+
`Set status.json: phase executing, state awaiting_approval if human gate applies. Do not use legacy phase analysis.`,
|
|
119
|
+
debugger: (s) =>
|
|
120
|
+
`Invoke debugger subagent for slug "${s}". Investigate root cause; write debug-report.md with fixApplied: true/false. ` +
|
|
121
|
+
`Update status.json when done.`,
|
|
122
|
+
'solution-architect': (s) =>
|
|
123
|
+
`Invoke solution-architect for slug "${s}". Read brief.md; write architecture.md. Update status.json when done.`,
|
|
124
|
+
'migration-specialist': (s) =>
|
|
125
|
+
`Invoke migration-specialist for slug "${s}". Read brief.md; write migration-plan.md. Update status.json when done.`,
|
|
126
|
+
'api-contract-reviewer': (s) =>
|
|
127
|
+
`Invoke api-contract-reviewer (readonly) for slug "${s}". Write api-contract-review.md. Update status.json when done.`,
|
|
128
|
+
'ci-investigator': (s) =>
|
|
129
|
+
`Invoke ci-investigator for slug "${s}". Diagnose CI failure; write ci-report.md; apply minimal fix. ` +
|
|
130
|
+
`Use ci-investigation skill. Update status.json when done.`,
|
|
131
|
+
'feature-developer': (s) =>
|
|
132
|
+
`Invoke feature-developer for slug "${s}". Read brief.md, decomposition.md, validation-report.md, review.md, architecture.md, migration-plan.md, api-contract-review.md, debug-report.md if present. ` +
|
|
133
|
+
`Follow feature-delivery-workflow.mdc and reference-features.mdc. Include unit tests for mappers/logic before handoff. Update status.json when done.`,
|
|
134
|
+
'build-verifier': (s) =>
|
|
135
|
+
`Invoke build-verifier (readonly) for slug "${s}". Run lint:js, lint:css, type-check, and targeted unit tests from app/. ` +
|
|
136
|
+
`Write validation-report.md. Set state completed or validation_failed. Do not edit production code.`,
|
|
137
|
+
'accessibility-reviewer': (s) =>
|
|
138
|
+
`Invoke accessibility-reviewer (readonly) for slug "${s}". Review UI diff; write a11y-review.md. Update status.json when done.`,
|
|
139
|
+
'performance-auditor': (s) =>
|
|
140
|
+
`Invoke performance-auditor (readonly) for slug "${s}". Write perf-report.md. Update status.json when done.`,
|
|
141
|
+
'code-reviewer': (s) =>
|
|
142
|
+
`Invoke code-reviewer subagent (readonly) for slug "${s}". Review git diff vs brief.md per code-review-mr.mdc. ` +
|
|
143
|
+
`Update status.json when done.`,
|
|
144
|
+
'security-reviewer': (s) =>
|
|
145
|
+
`Invoke security-reviewer (readonly) for slug "${s}". Write security-review.md. Update status.json when done.`,
|
|
146
|
+
'qa-tester': (s, scope) =>
|
|
147
|
+
`Invoke qa-tester for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
|
|
148
|
+
`Add/update tests per brief. Follow playwright-agents.mdc. Update status.json when done.`,
|
|
149
|
+
'unit-test-planner': (s) =>
|
|
150
|
+
`Invoke unit-test-planner for slug "${s}". Write unit-test-plan.md. Use unit-testing skill. Update status.json when done.`,
|
|
151
|
+
'unit-test-generator': (s) =>
|
|
152
|
+
`Invoke unit-test-generator for slug "${s}". Implement specs from unit-test-plan.md. Use unit-testing skill. Update status.json when done.`,
|
|
153
|
+
'unit-test-healer': (s) =>
|
|
154
|
+
`Invoke unit-test-healer for slug "${s}". Fix failing unit tests. Use unit-testing and debug-investigation skills. Update status.json when done.`,
|
|
155
|
+
'playwright-test-planner': (s) =>
|
|
156
|
+
`Invoke playwright-test-planner for slug "${s}". Create/update app/__tests__/e2e/**/*.cases.md. ` +
|
|
157
|
+
`Follow playwright-agents.mdc and the playwright-e2e skill. Update status.json when done.`,
|
|
158
|
+
'playwright-test-generator': (s) =>
|
|
159
|
+
`Invoke playwright-test-generator for slug "${s}". Generate/update *.spec.ts from matching *.cases.md. ` +
|
|
160
|
+
`Use user-playwright MCP when available. Follow playwright-agents.mdc and the playwright-e2e skill. Update status.json when done.`,
|
|
161
|
+
'playwright-test-healer': (s) =>
|
|
162
|
+
`Invoke playwright-test-healer for slug "${s}". Fix failing/flaky e2e while preserving cases.md assertions. ` +
|
|
163
|
+
`Use user-playwright MCP when available. Follow playwright-agents.mdc and debug-investigation. Update status.json when done.`,
|
|
164
|
+
'tech-writer': (s) =>
|
|
165
|
+
`Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Update status.json when done.`,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const REVIEW_AGENTS = new Set([
|
|
169
|
+
'code-reviewer',
|
|
170
|
+
'accessibility-reviewer',
|
|
171
|
+
'security-reviewer',
|
|
172
|
+
'api-contract-reviewer',
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
function handoffForAgent(agent, scope) {
|
|
176
|
+
const fn = AGENT_HANDOFF[agent];
|
|
177
|
+
return fn ? fn(slug, scope) : `Invoke ${agent} subagent for slug "${slug}". Update status.json when done.`;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function handoffForParallelStep(step) {
|
|
181
|
+
const agents = getStepAgents(step);
|
|
182
|
+
return (
|
|
183
|
+
`Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
|
|
184
|
+
`Each agent writes its artifact and appends itself to status.json parallelCompleted when done.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function hasGateAfter(agent, humanGates) {
|
|
189
|
+
return Array.isArray(humanGates) && humanGates.includes(`after:${agent}`);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function hasGateAfterStep(step, humanGates) {
|
|
193
|
+
return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function legacyFlow() {
|
|
197
|
+
if (status.phase === 'analysis') {
|
|
198
|
+
process.stdout.write('{}');
|
|
199
|
+
process.exit(0);
|
|
200
|
+
}
|
|
201
|
+
if (status.phase === 'development' && (status.state === 'completed' || status.state === 'in_progress')) {
|
|
202
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'build-verifier' });
|
|
203
|
+
out(handoffForAgent('build-verifier'));
|
|
204
|
+
process.exit(0);
|
|
205
|
+
}
|
|
206
|
+
if (status.currentAgent === 'build-verifier' && status.state === 'completed') {
|
|
207
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'code-reviewer' });
|
|
208
|
+
out(handoffForAgent('code-reviewer'));
|
|
209
|
+
process.exit(0);
|
|
210
|
+
}
|
|
211
|
+
if (status.phase === 'review' && status.state === 'completed') {
|
|
212
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'qa-tester' });
|
|
213
|
+
out(handoffForAgent('qa-tester'));
|
|
214
|
+
process.exit(0);
|
|
215
|
+
}
|
|
216
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
217
|
+
writeStatus({
|
|
218
|
+
currentAgent: 'feature-developer',
|
|
219
|
+
state: 'in_progress',
|
|
220
|
+
phase: 'executing',
|
|
221
|
+
retryAfterFix: status.currentAgent,
|
|
222
|
+
});
|
|
223
|
+
out(
|
|
224
|
+
handoffForAgent('feature-developer') +
|
|
225
|
+
` After fixes, re-run ${status.currentAgent}.`,
|
|
226
|
+
);
|
|
227
|
+
process.exit(0);
|
|
228
|
+
}
|
|
229
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
230
|
+
writeStatus({
|
|
231
|
+
currentAgent: 'feature-developer',
|
|
232
|
+
state: 'in_progress',
|
|
233
|
+
phase: 'executing',
|
|
234
|
+
retryAfterFix: 'build-verifier',
|
|
235
|
+
});
|
|
236
|
+
out(
|
|
237
|
+
handoffForAgent('feature-developer') +
|
|
238
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
239
|
+
);
|
|
240
|
+
process.exit(0);
|
|
241
|
+
}
|
|
242
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
243
|
+
const retry = status.retryAfterFix;
|
|
244
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
245
|
+
out(handoffForAgent(retry));
|
|
246
|
+
process.exit(0);
|
|
247
|
+
}
|
|
248
|
+
if (status.phase === 'testing' && status.state === 'completed') {
|
|
249
|
+
writeStatus({ phase: 'done', state: 'completed' });
|
|
250
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
251
|
+
process.exit(0);
|
|
252
|
+
}
|
|
253
|
+
process.stdout.write('{}');
|
|
254
|
+
process.exit(0);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (!fs.existsSync(pipelinePath)) {
|
|
258
|
+
legacyFlow();
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let pipeline;
|
|
262
|
+
try {
|
|
263
|
+
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
264
|
+
} catch {
|
|
265
|
+
legacyFlow();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const steps = pipeline.steps || [];
|
|
269
|
+
if (steps.length === 0 || pipeline.autoChain === false) {
|
|
270
|
+
process.stdout.write('{}');
|
|
271
|
+
process.exit(0);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (status.awaitingHumanGate || status.state === 'awaiting_approval') {
|
|
275
|
+
process.stdout.write('{}');
|
|
276
|
+
process.exit(0);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
280
|
+
const reviewer = status.currentAgent;
|
|
281
|
+
writeStatus({
|
|
282
|
+
currentAgent: 'feature-developer',
|
|
283
|
+
state: 'in_progress',
|
|
284
|
+
phase: 'executing',
|
|
285
|
+
retryAfterFix: reviewer,
|
|
286
|
+
});
|
|
287
|
+
out(
|
|
288
|
+
handoffForAgent('feature-developer') +
|
|
289
|
+
` After fixes, re-run ${reviewer}.`,
|
|
290
|
+
);
|
|
291
|
+
process.exit(0);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
295
|
+
writeStatus({
|
|
296
|
+
currentAgent: 'feature-developer',
|
|
297
|
+
state: 'in_progress',
|
|
298
|
+
phase: 'executing',
|
|
299
|
+
retryAfterFix: 'build-verifier',
|
|
300
|
+
});
|
|
301
|
+
out(
|
|
302
|
+
handoffForAgent('feature-developer') +
|
|
303
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
304
|
+
);
|
|
305
|
+
process.exit(0);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
309
|
+
const retry = status.retryAfterFix;
|
|
310
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
311
|
+
out(handoffForAgent(retry));
|
|
312
|
+
process.exit(0);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
316
|
+
const currentStep = steps[idx];
|
|
317
|
+
if (!currentStep) {
|
|
318
|
+
writeStatus({ phase: 'done', state: 'completed', currentAgent: null });
|
|
319
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
320
|
+
process.exit(0);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const completedAgent = status.currentAgent || getStepAgents(currentStep)[0];
|
|
324
|
+
const stepAgents = getStepAgents(currentStep);
|
|
325
|
+
|
|
326
|
+
if (currentStep.parallel && stepAgents.length > 1) {
|
|
327
|
+
const done = [...(status.parallelCompleted || [])];
|
|
328
|
+
if (completedAgent && !done.includes(completedAgent)) {
|
|
329
|
+
done.push(completedAgent);
|
|
330
|
+
}
|
|
331
|
+
writeStatus({ parallelCompleted: done });
|
|
332
|
+
const remaining = stepAgents.filter((a) => !done.includes(a));
|
|
333
|
+
if (remaining.length > 0) {
|
|
334
|
+
process.stdout.write('{}');
|
|
335
|
+
process.exit(0);
|
|
336
|
+
}
|
|
337
|
+
writeStatus({ parallelCompleted: [] });
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
|
|
341
|
+
writeStatus({
|
|
342
|
+
awaitingHumanGate: true,
|
|
343
|
+
state: 'awaiting_approval',
|
|
344
|
+
currentAgent: completedAgent,
|
|
345
|
+
});
|
|
346
|
+
process.stdout.write('{}');
|
|
347
|
+
process.exit(0);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const next = findNextExecutableStep(steps, idx + 1, taskDir);
|
|
351
|
+
if (!next) {
|
|
352
|
+
writeStatus({
|
|
353
|
+
pipelineIndex: steps.length,
|
|
354
|
+
phase: 'done',
|
|
355
|
+
state: 'completed',
|
|
356
|
+
currentAgent: null,
|
|
357
|
+
awaitingHumanGate: false,
|
|
358
|
+
});
|
|
359
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
360
|
+
process.exit(0);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const { step: nextStep, index: nextIdx } = next;
|
|
364
|
+
const nextAgents = getStepAgents(nextStep);
|
|
365
|
+
|
|
366
|
+
writeStatus({
|
|
367
|
+
pipelineIndex: nextIdx,
|
|
368
|
+
currentAgent: nextAgents[0],
|
|
369
|
+
phase: 'executing',
|
|
370
|
+
state: 'in_progress',
|
|
371
|
+
awaitingHumanGate: false,
|
|
372
|
+
parallelCompleted: [],
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
if (nextStep.parallel && nextAgents.length > 1) {
|
|
376
|
+
out(handoffForParallelStep(nextStep));
|
|
377
|
+
} else {
|
|
378
|
+
out(handoffForAgent(nextAgents[0], nextStep.scope));
|
|
379
|
+
}
|
|
380
|
+
NODE
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Lightweight shell guard for Cursor projects using this preset.
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
input=$(cat)
|
|
7
|
+
|
|
8
|
+
INPUT="$input" node <<'NODE'
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
|
|
11
|
+
const raw = process.env.INPUT || '';
|
|
12
|
+
let event;
|
|
13
|
+
try {
|
|
14
|
+
event = JSON.parse(raw);
|
|
15
|
+
} catch {
|
|
16
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const command = String(event.command || event.input?.command || '');
|
|
21
|
+
if (!command.trim()) {
|
|
22
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function out(permission, userMessage, agentMessage) {
|
|
27
|
+
process.stdout.write(JSON.stringify({
|
|
28
|
+
permission,
|
|
29
|
+
user_message: userMessage,
|
|
30
|
+
agent_message: agentMessage || userMessage,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const dangerousGit = /\bgit\s+(reset\s+--hard|clean\s+-[^\n]*f|push\s+--force|push\s+-f|checkout\s+--\s+)/;
|
|
35
|
+
if (dangerousGit.test(command)) {
|
|
36
|
+
out(
|
|
37
|
+
'ask',
|
|
38
|
+
'This command looks destructive for git state. Review it before continuing.',
|
|
39
|
+
'A project hook flagged a destructive git command. Ask the user before running it.',
|
|
40
|
+
);
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const managerByFile = [
|
|
45
|
+
['yarn.lock', 'yarn'],
|
|
46
|
+
['pnpm-lock.yaml', 'pnpm'],
|
|
47
|
+
['package-lock.json', 'npm'],
|
|
48
|
+
].find(([file]) => fs.existsSync(file));
|
|
49
|
+
|
|
50
|
+
let expected = managerByFile?.[1];
|
|
51
|
+
if (!expected && fs.existsSync('package.json')) {
|
|
52
|
+
try {
|
|
53
|
+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
54
|
+
const pm = typeof pkg.packageManager === 'string' ? pkg.packageManager : '';
|
|
55
|
+
expected = pm.split('@')[0] || undefined;
|
|
56
|
+
} catch {
|
|
57
|
+
// Ignore invalid package.json in the hook; the agent can diagnose it later.
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!expected) {
|
|
62
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const used = command.match(/(^|[;&|]\s*)(npm|yarn|pnpm)\s+/)?.[2];
|
|
67
|
+
if (used && used !== expected) {
|
|
68
|
+
out(
|
|
69
|
+
'ask',
|
|
70
|
+
`This repository appears to use ${expected}, but the command uses ${used}. Confirm before continuing.`,
|
|
71
|
+
`Use ${expected} for package scripts and installs unless the user explicitly approves ${used}.`,
|
|
72
|
+
);
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
77
|
+
NODE
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"beforeShellExecution": [
|
|
5
|
+
{
|
|
6
|
+
"command": ".cursor/hooks/guard-shell-command.sh",
|
|
7
|
+
"failClosed": true
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"subagentStop": [
|
|
11
|
+
{
|
|
12
|
+
"command": ".cursor/hooks/chain-team-phases.sh",
|
|
13
|
+
"loop_limit": 15
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -10,3 +10,70 @@
|
|
|
10
10
|
- Cursor интерпретирует его как конфигурацию поведения ассистента для этого репо (автоматически подмешивает содержимое в контекст, когда правило подходит).
|
|
11
11
|
|
|
12
12
|
- То есть .mdc = “markdown + config для Cursor”, .md = просто текст без управляющего смысла для ассистента.
|
|
13
|
+
|
|
14
|
+
### С чего начать новую задачу
|
|
15
|
+
|
|
16
|
+
- **Команда агентов (рекомендуется):** `/task <описание>` — router выберет роли и порядок; при human gate — `/task-continue <slug>`. См. **`agent-team-orchestrator.mdc`** и `.cursor/team/README.md`.
|
|
17
|
+
- **Legacy:** `/feature-start` → `/feature-continue`.
|
|
18
|
+
- **Сквозной чеклист слоёв (для developer):** **`feature-delivery-workflow.mdc`**.
|
|
19
|
+
|
|
20
|
+
### Loading strategy
|
|
21
|
+
|
|
22
|
+
- **`alwaysApply: true`** (Cursor) / **без `paths:`** (Claude) — только базовые инварианты (**3**):
|
|
23
|
+
- `next-app-core`, `package-manager`, `code-quality-and-refactoring`
|
|
24
|
+
- **On-demand / requestable** — `post-change-lint` (**обязателен после правок кода**, не always-on), `agent-team-intake` (через orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
|
|
25
|
+
- **Skills** — длинные процедуры (`feature-delivery`, `code-review`, …)
|
|
26
|
+
|
|
27
|
+
### UI edit bundle (consolidated globs)
|
|
28
|
+
|
|
29
|
+
При правке `app/src/ui/**/*.tsx` подгружается **уменьшенный** набор (не весь `app/src/**`):
|
|
30
|
+
|
|
31
|
+
| Rule | Globs | Назначение |
|
|
32
|
+
|------|-------|------------|
|
|
33
|
+
| `react-ui.mdc` | `app/src/ui/**` | Структура, стили, пропсы |
|
|
34
|
+
| `architecture-boundaries-ui.mdc` | `app/src/ui/**` | Slim границы UI-слоя |
|
|
35
|
+
| `react-a11y-coding.mdc` | `app/src/ui/**` | A11y |
|
|
36
|
+
| `navigation-router-ui.mdc` | `app/src/ui/**/*.tsx` | Краткий ориентир навигации |
|
|
37
|
+
| `no-props-spread.mdc` | `app/src/**/*.tsx` | Явные пропсы |
|
|
38
|
+
| `arrow-functions.mdc` | `app/src/**` | Синтаксис |
|
|
39
|
+
|
|
40
|
+
**Не грузятся на типичный UI edit:** `architecture-boundaries` (api/store/types/lib), `layer-barrel-exports` (только `index.ts`), `navigation-router-stack` (только `app/src/app/**`). Стили колокации — в `react-ui.mdc` (deprecated stub `no-cross-component-styles-import` removed).
|
|
41
|
+
|
|
42
|
+
`css-property-order-stylelint.mdc` — только на `styles.ts` / `.css`.
|
|
43
|
+
|
|
44
|
+
### Эталонные фичи
|
|
45
|
+
|
|
46
|
+
Заполните **`reference-features.mdc`** (TBD → реальные пути) после `init` в целевом репо.
|
|
47
|
+
|
|
48
|
+
### Каталог ключевых правил
|
|
49
|
+
|
|
50
|
+
| Файл | Назначение |
|
|
51
|
+
|------|------------|
|
|
52
|
+
| `reference-features.mdc` | Эталонные пути UI/store/API/types/tests |
|
|
53
|
+
| `next-app-router.mdc` | App Router, RSC, loading/error |
|
|
54
|
+
| `react-a11y-coding.mdc` | A11y при написании UI |
|
|
55
|
+
| `feature-delivery-workflow.mdc` | Сквозной чеклист (on-demand, не always-on) |
|
|
56
|
+
| `agent-team-intake.mdc` | Подсказка `/task` при work-запросе (on-demand, через orchestrator) |
|
|
57
|
+
| `package-manager.mdc` | Перед `install` / `run` в терминале определить менеджер пакетов репо (lockfile, `packageManager`) и использовать только его |
|
|
58
|
+
| `agent-team-orchestrator.mdc` | `/task`, router, `pipeline.json`, build-verifier, parallel steps |
|
|
59
|
+
| `next-app-core.mdc` | Стек, слои, карта каталогов (alwaysApply) |
|
|
60
|
+
| `post-change-lint.mdc` | Прогон ESLint + Stylelint после изменений кода (**requestable**, обязателен после code edits) |
|
|
61
|
+
| `architecture-boundaries-ui.mdc` | Slim границы UI при правках компонентов |
|
|
62
|
+
| `architecture-boundaries.mdc` | Полная карта UI / store / API (api, store, types, lib) |
|
|
63
|
+
| `navigation-router-ui.mdc` | Навигация в UI-компонентах (slim) |
|
|
64
|
+
| `navigation-router-stack.mdc` | Полный аудит стека навигации (App Router / SPA) |
|
|
65
|
+
| `http-client.mdc` | Один HTTP‑стек, контракты из `@/types`, без разбросанного низкоуровневого API |
|
|
66
|
+
| `api-services.mdc` | Сервисы, мапперы, вызовы через прикладные API‑клиенты |
|
|
67
|
+
| `store-rtk.mdc` | Redux Toolkit, thunk’и, типизация ошибок/ответов как в коде репо |
|
|
68
|
+
| `public-imports.mdc` | Импорты `@/types`, `@/types/enums`, `@/api` (вне `app/src/api/**`) |
|
|
69
|
+
| `layer-barrel-exports.mdc` | Двухуровневые barrel для слоёв с public API (`@/api`, `@/types`, `@/core`, …) |
|
|
70
|
+
| `types-jsdoc.mdc` | JSDoc для типов в `app/src/types` (русский текст, `[computed]`, без `@param`/`@returns`) |
|
|
71
|
+
| `no-type-assertion-as-import-export.mdc` | Ограничение `as`, в т.ч. `instanceof` для ошибок транспорта в `catch` |
|
|
72
|
+
| `code-review-mr.mdc` | Чеклист ревью MR, в т.ч. HTTP‑клиент и тесты |
|
|
73
|
+
| `tests-unit.mdc` | Unit‑тесты и behavior‑тесты HTTP‑клиента |
|
|
74
|
+
| `playwright-agents.mdc`, `tests-e2e-structure.mdc` | E2E |
|
|
75
|
+
| `react-ui.mdc` | React/Next UI: структура компонентов, соседние `ComponentName.data.ts` / `.utils.ts`, стили, пропсы |
|
|
76
|
+
|
|
77
|
+
**Коллизии формулировок:** импорт типов и API — источник правды **`public-imports.mdc`**; дублирует ESLint `no-restricted-imports` в `app/eslint.config.mjs`.
|
|
78
|
+
|
|
79
|
+
Задачи на **сеть, замену HTTP‑библиотеки, новые эндпоинты**: опираться на **`http-client.mdc`** + **`api-services.mdc`** + **`store-rtk.mdc`**.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when user posts a work request without /task — suggest or use /task to run the agent team router. Lightweight intake hint only.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent team intake
|
|
7
|
+
|
|
8
|
+
When the user message looks like a **work request** (implement, add, fix, refactor, review MR, write tests, spike) — not a question about how code works:
|
|
9
|
+
|
|
10
|
+
1. Prefer **`/task <their request>`** or invoke **task-router** first.
|
|
11
|
+
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
12
|
+
3. Pure questions («как работает X», «объясни») — answer normally, no `/task`.
|
|
13
|
+
|
|
14
|
+
Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
|