@bonesofspring/ai-rules 0.2.15 → 0.2.16
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 +8 -0
- package/README.md +3 -1
- package/bin/cli.js +2 -0
- package/package.json +1 -1
- package/presets/_shared/core/meta/preset-layering.md +1 -1
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +25 -12
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
- package/presets/claude/android-kotlin/CLAUDE.md +38 -0
- package/presets/claude/android-kotlin/MCP.md +16 -0
- package/presets/claude/android-kotlin/README.md +32 -0
- package/presets/claude/android-kotlin/REPO_AGENTS.md +48 -0
- package/presets/claude/android-kotlin/agents/README.md +44 -0
- package/presets/claude/android-kotlin/agents/accessibility-reviewer.md +60 -0
- package/presets/claude/android-kotlin/agents/api-contract-reviewer.md +70 -0
- package/presets/claude/android-kotlin/agents/build-verifier.md +67 -0
- package/presets/claude/android-kotlin/agents/ci-investigator.md +74 -0
- package/presets/claude/android-kotlin/agents/code-reviewer.md +74 -0
- package/presets/claude/android-kotlin/agents/codebase-analyzer.md +28 -0
- package/presets/claude/android-kotlin/agents/debugger.md +77 -0
- package/presets/claude/android-kotlin/agents/feature-developer.md +63 -0
- package/presets/claude/android-kotlin/agents/instrumentation-test-generator.md +19 -0
- package/presets/claude/android-kotlin/agents/instrumentation-test-healer.md +19 -0
- package/presets/claude/android-kotlin/agents/instrumentation-test-planner.md +19 -0
- package/presets/claude/android-kotlin/agents/migration-specialist.md +74 -0
- package/presets/claude/android-kotlin/agents/performance-auditor.md +67 -0
- package/presets/claude/android-kotlin/agents/qa-tester.md +66 -0
- package/presets/claude/android-kotlin/agents/security-reviewer.md +65 -0
- package/presets/claude/android-kotlin/agents/solution-architect.md +21 -0
- package/presets/claude/android-kotlin/agents/task-analyst.md +36 -0
- package/presets/claude/android-kotlin/agents/task-router.md +103 -0
- package/presets/claude/android-kotlin/agents/tech-writer.md +61 -0
- package/presets/claude/android-kotlin/agents/unit-test-generator.md +55 -0
- package/presets/claude/android-kotlin/agents/unit-test-healer.md +54 -0
- package/presets/claude/android-kotlin/agents/unit-test-planner.md +65 -0
- package/presets/claude/android-kotlin/commands/README.md +51 -0
- package/presets/claude/android-kotlin/commands/feature-continue.md +19 -0
- package/presets/claude/android-kotlin/commands/feature-start.md +33 -0
- package/presets/claude/android-kotlin/commands/task-continue.md +50 -0
- package/presets/claude/android-kotlin/commands/task.md +56 -0
- package/presets/claude/android-kotlin/commands/technical-retro.md +85 -0
- package/presets/claude/android-kotlin/hooks/README.md +16 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +705 -0
- package/presets/claude/android-kotlin/hooks/examples/README.md +18 -0
- package/presets/claude/android-kotlin/hooks/examples/format-edited.example.sh +13 -0
- package/presets/claude/android-kotlin/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/android-kotlin/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/claude/android-kotlin/hooks/guard-shell-command.sh +80 -0
- package/presets/claude/android-kotlin/mcp.json +12 -0
- package/presets/claude/android-kotlin/rules/README.md +63 -0
- package/presets/claude/android-kotlin/rules/api-and-data/README.md +10 -0
- package/presets/claude/android-kotlin/rules/api-and-data/networking.md +30 -0
- package/presets/claude/android-kotlin/rules/api-and-data/persistence.md +29 -0
- package/presets/claude/android-kotlin/rules/architecture/README.md +9 -0
- package/presets/claude/android-kotlin/rules/architecture/boundaries.md +27 -0
- package/presets/claude/android-kotlin/rules/architecture/di-dagger-feature-holders.md +34 -0
- package/presets/claude/android-kotlin/rules/architecture/feature-delivery.md +41 -0
- package/presets/claude/android-kotlin/rules/architecture/module-public-api.md +29 -0
- package/presets/claude/android-kotlin/rules/architecture/reference-features.md +28 -0
- package/presets/claude/android-kotlin/rules/stack/README.md +6 -0
- package/presets/claude/android-kotlin/rules/stack/android-app-core.md +27 -0
- package/presets/claude/android-kotlin/rules/stack/kotlin-conventions.md +30 -0
- package/presets/claude/android-kotlin/rules/testing/README.md +10 -0
- package/presets/claude/android-kotlin/rules/testing/ui.md +28 -0
- package/presets/claude/android-kotlin/rules/testing/unit.md +29 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/README.md +19 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +18 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +127 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +52 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +88 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/gradle-tooling.md +30 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/post-change-build.md +34 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-no-cross-stack-leakage.md +100 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +56 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/security-android.md +29 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/technical-retro.md +18 -0
- package/presets/claude/android-kotlin/rules/ui-and-accessibility/README.md +7 -0
- package/presets/claude/android-kotlin/rules/ui-and-accessibility/compose.md +31 -0
- package/presets/claude/android-kotlin/rules/ui-and-accessibility/navigation.md +30 -0
- package/presets/claude/android-kotlin/rules/ui-and-accessibility/viewmodels.md +27 -0
- package/presets/claude/android-kotlin/skills/README.md +14 -0
- package/presets/claude/android-kotlin/skills/ci-investigation/SKILL.md +39 -0
- package/presets/claude/android-kotlin/skills/code-review/SKILL.md +39 -0
- package/presets/claude/android-kotlin/skills/debug-investigation/SKILL.md +34 -0
- package/presets/claude/android-kotlin/skills/feature-delivery/SKILL.md +35 -0
- package/presets/claude/android-kotlin/skills/instrumentation-ui-e2e/SKILL.md +17 -0
- package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/android-kotlin/skills/unit-testing/SKILL.md +32 -0
- package/presets/claude/android-kotlin/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/android-kotlin/team/README.md +54 -0
- package/presets/claude/android-kotlin/team/conventions.md +17 -0
- package/presets/claude/android-kotlin/team/fixtures/bugfix-standard.json +47 -0
- package/presets/claude/android-kotlin/team/fixtures/feature-full.json +97 -0
- package/presets/claude/android-kotlin/team/fixtures/feature-light.json +38 -0
- package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/java/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/preset-no-cross-stack-leakage.md +25 -12
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/cursor/android-kotlin/AGENTS.md +50 -0
- package/presets/cursor/android-kotlin/BUGBOT.md +16 -0
- package/presets/cursor/android-kotlin/MCP.md +16 -0
- package/presets/cursor/android-kotlin/README.md +35 -0
- package/presets/cursor/android-kotlin/REPO_AGENTS.md +48 -0
- package/presets/cursor/android-kotlin/agents/README.md +44 -0
- package/presets/cursor/android-kotlin/agents/accessibility-reviewer.md +60 -0
- package/presets/cursor/android-kotlin/agents/api-contract-reviewer.md +70 -0
- package/presets/cursor/android-kotlin/agents/build-verifier.md +67 -0
- package/presets/cursor/android-kotlin/agents/ci-investigator.md +74 -0
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +74 -0
- package/presets/cursor/android-kotlin/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/android-kotlin/agents/debugger.md +77 -0
- package/presets/cursor/android-kotlin/agents/feature-developer.md +63 -0
- package/presets/cursor/android-kotlin/agents/instrumentation-test-generator.md +19 -0
- package/presets/cursor/android-kotlin/agents/instrumentation-test-healer.md +19 -0
- package/presets/cursor/android-kotlin/agents/instrumentation-test-planner.md +19 -0
- package/presets/cursor/android-kotlin/agents/migration-specialist.md +74 -0
- package/presets/cursor/android-kotlin/agents/performance-auditor.md +67 -0
- package/presets/cursor/android-kotlin/agents/qa-tester.md +66 -0
- package/presets/cursor/android-kotlin/agents/security-reviewer.md +65 -0
- package/presets/cursor/android-kotlin/agents/solution-architect.md +21 -0
- package/presets/cursor/android-kotlin/agents/task-analyst.md +36 -0
- package/presets/cursor/android-kotlin/agents/task-router.md +103 -0
- package/presets/cursor/android-kotlin/agents/tech-writer.md +61 -0
- package/presets/cursor/android-kotlin/agents/unit-test-generator.md +55 -0
- package/presets/cursor/android-kotlin/agents/unit-test-healer.md +54 -0
- package/presets/cursor/android-kotlin/agents/unit-test-planner.md +65 -0
- package/presets/cursor/android-kotlin/commands/README.md +51 -0
- package/presets/cursor/android-kotlin/commands/feature-continue.md +19 -0
- package/presets/cursor/android-kotlin/commands/feature-start.md +33 -0
- package/presets/cursor/android-kotlin/commands/task-continue.md +50 -0
- package/presets/cursor/android-kotlin/commands/task.md +56 -0
- package/presets/cursor/android-kotlin/commands/technical-retro.md +85 -0
- package/presets/cursor/android-kotlin/hooks/README.md +12 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +723 -0
- package/presets/cursor/android-kotlin/hooks/examples/README.md +18 -0
- package/presets/cursor/android-kotlin/hooks/examples/format-edited.example.sh +13 -0
- package/presets/cursor/android-kotlin/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/android-kotlin/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.sh +80 -0
- package/presets/cursor/android-kotlin/hooks.json +17 -0
- package/presets/cursor/android-kotlin/mcp.json +11 -0
- package/presets/cursor/android-kotlin/rules/README.md +61 -0
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +16 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +124 -0
- package/presets/cursor/android-kotlin/rules/android-app-core.mdc +28 -0
- package/presets/cursor/android-kotlin/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/android-kotlin/rules/architecture-boundaries.mdc +28 -0
- package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +53 -0
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +84 -0
- package/presets/cursor/android-kotlin/rules/compose-ui.mdc +32 -0
- package/presets/cursor/android-kotlin/rules/design-guidance.mdc +111 -0
- package/presets/cursor/android-kotlin/rules/di-dagger-feature-holders.mdc +35 -0
- package/presets/cursor/android-kotlin/rules/feature-delivery-workflow.mdc +36 -0
- package/presets/cursor/android-kotlin/rules/gradle-tooling.mdc +31 -0
- package/presets/cursor/android-kotlin/rules/kotlin-conventions.mdc +31 -0
- package/presets/cursor/android-kotlin/rules/module-public-api.mdc +30 -0
- package/presets/cursor/android-kotlin/rules/navigation-feature-launcher.mdc +31 -0
- package/presets/cursor/android-kotlin/rules/networking-data.mdc +31 -0
- package/presets/cursor/android-kotlin/rules/persistence-data.mdc +30 -0
- package/presets/cursor/android-kotlin/rules/post-change-build.mdc +30 -0
- package/presets/cursor/android-kotlin/rules/preset-layering.mdc +36 -0
- package/presets/cursor/android-kotlin/rules/preset-no-cross-stack-leakage.mdc +100 -0
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +56 -0
- package/presets/cursor/android-kotlin/rules/reference-features.mdc +29 -0
- package/presets/cursor/android-kotlin/rules/security-android.mdc +30 -0
- package/presets/cursor/android-kotlin/rules/state-and-viewmodels.mdc +28 -0
- package/presets/cursor/android-kotlin/rules/technical-retro.mdc +16 -0
- package/presets/cursor/android-kotlin/rules/tests-ui.mdc +29 -0
- package/presets/cursor/android-kotlin/rules/tests-unit.mdc +30 -0
- package/presets/cursor/android-kotlin/skills/README.md +14 -0
- package/presets/cursor/android-kotlin/skills/ci-investigation/SKILL.md +39 -0
- package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +39 -0
- package/presets/cursor/android-kotlin/skills/debug-investigation/SKILL.md +34 -0
- package/presets/cursor/android-kotlin/skills/feature-delivery/SKILL.md +35 -0
- package/presets/cursor/android-kotlin/skills/instrumentation-ui-e2e/SKILL.md +17 -0
- package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/android-kotlin/skills/unit-testing/SKILL.md +32 -0
- package/presets/cursor/android-kotlin/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/android-kotlin/team/README.md +54 -0
- package/presets/cursor/android-kotlin/team/conventions.md +17 -0
- package/presets/cursor/android-kotlin/team/fixtures/bugfix-standard.json +47 -0
- package/presets/cursor/android-kotlin/team/fixtures/feature-full.json +97 -0
- package/presets/cursor/android-kotlin/team/fixtures/feature-light.json +38 -0
- package/presets/cursor/go/rules/preset-layering.mdc +1 -1
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/java/rules/preset-layering.mdc +1 -1
- package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/mcp-ts/rules/preset-layering.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/next/rules/preset-layering.mdc +1 -1
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/nuxt/rules/preset-layering.mdc +1 -1
- package/presets/cursor/nuxt/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/php-laravel/rules/preset-layering.mdc +1 -1
- package/presets/cursor/php-laravel/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/svelte/rules/preset-layering.mdc +1 -1
- package/presets/cursor/svelte/rules/preset-no-cross-stack-leakage.mdc +25 -12
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +2 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Orchestrates the agent team via task-router and pipeline.json. Use for /task, /task-continue, /feature-start, task decomposition, or when the user describes a feature, bug, or review request.
|
|
3
|
+
paths:
|
|
4
|
+
- .claude/commands/**/*
|
|
5
|
+
- .claude/team/**/*
|
|
6
|
+
- .claude/agents/**/*
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!-- shared-core: agent-team/agent-team-orchestrator.md -->
|
|
10
|
+
|
|
11
|
+
# Agent team orchestrator
|
|
12
|
+
|
|
13
|
+
Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.claude/team/tasks/<slug>/`.
|
|
14
|
+
|
|
15
|
+
Work request without `/task` — see **`tooling-and-review/agent-team-intake.md`**.
|
|
16
|
+
|
|
17
|
+
## Entry points
|
|
18
|
+
|
|
19
|
+
| Command | When |
|
|
20
|
+
|---------|------|
|
|
21
|
+
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
22
|
+
| `/task-continue <slug>` | After human gate or pause |
|
|
23
|
+
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
24
|
+
| `/feature-continue <slug>` | Alias of task-continue |
|
|
25
|
+
| `/technical-retro [slug]` | Retro with agent team block |
|
|
26
|
+
|
|
27
|
+
## Stack notes
|
|
28
|
+
|
|
29
|
+
### Roles (Android)
|
|
30
|
+
|
|
31
|
+
| Agent | Prod writes | Typical intent |
|
|
32
|
+
|-------|-------------|----------------|
|
|
33
|
+
| `task-router` | no (team) | Every `/task` |
|
|
34
|
+
| `task-analyst` | no | feature, refactor, test-only, a11y, docs, migration |
|
|
35
|
+
| `solution-architect` | no | spike, cross-layer Feature |
|
|
36
|
+
| `migration-specialist` | no | Android Studio / AGP/Gradle modules/Android upgrades |
|
|
37
|
+
| `api-contract-reviewer` | no | OpenAPI / Kotlin codegen contracts |
|
|
38
|
+
| `debugger` | minimal | bugfix |
|
|
39
|
+
| `ci-investigator` | minimal CI | ci-fix |
|
|
40
|
+
| `feature-developer` | yes | feature, bugfix, refactor, migration, a11y |
|
|
41
|
+
| `build-verifier` | no | ./gradlew + ktlint/detekt/Format + unit smoke; preset-structure for preset PRs |
|
|
42
|
+
| `accessibility-reviewer` | no | TalkBack / font scale / semantics |
|
|
43
|
+
| `performance-auditor` | no | launch / Profiler / Macrobenchmark |
|
|
44
|
+
| `code-reviewer` | no | most pipelines, review-only |
|
|
45
|
+
| `security-reviewer` | no | Android Keystore / encrypted storage, network security / cleartext, PII |
|
|
46
|
+
| `qa-tester` | tests | feature, bugfix, test-only |
|
|
47
|
+
| `unit-test-planner` / `generator` / `healer` | tests | unit-only |
|
|
48
|
+
| `instrumentation-test-planner` / `generator` / `healer` | UI tests | e2e-only (Android instrumentation) |
|
|
49
|
+
| `tech-writer` | docs | docs-only |
|
|
50
|
+
|
|
51
|
+
**Never use Playwright stems** in this preset — substitute Android instrumentation trio. Document Playwright skips when copying next templates.
|
|
52
|
+
|
|
53
|
+
**Cursor frontmatter:** all team agents use `readonly: false` (team writes). Production restrictions live in prompt bodies.
|
|
54
|
+
|
|
55
|
+
Full prompts: `.claude/agents/*.md`. Artifact conventions: `.claude/team/README.md`; schema SoT: **agent-artifact-contracts**.
|
|
56
|
+
|
|
57
|
+
When editing `packages/ai-rules/presets/**`, follow **`tooling-and-review/preset-pr-checklist.md`** (+ twin-sync / layering / token-budget / leakage meta-rules).
|
|
58
|
+
|
|
59
|
+
## Dynamic pipeline
|
|
60
|
+
|
|
61
|
+
**Source of truth for order:** `pipeline.json` → `steps[]`. Never hardcode analyst → dev → review → QA when `pipeline.json` exists.
|
|
62
|
+
|
|
63
|
+
New pipelines retain top-level `profile` and include `routingDecision` with `complexity`, `riskFlags`, non-empty `routingReasons`, `estimatedWorkPackages`, and `openDecisionCount`. The stack `task-router` owns heuristics; this metadata is auditable evidence and does not change hook semantics.
|
|
64
|
+
|
|
65
|
+
## Metrics lifecycle
|
|
66
|
+
|
|
67
|
+
Use the local `metrics.json` ledger described by **agent-task-metrics**: the orchestration runtime initializes attempts before invocation, hooks record host-clock ends, and agents never guess a parallel completion from `currentAgent`.
|
|
68
|
+
|
|
69
|
+
## Artifact context index and receipts
|
|
70
|
+
|
|
71
|
+
Each slug has one `artifact-manifest.json`: `.claude/team/tasks/<slug>/` or `.cursor/team/tasks/<slug>/`. Schema SoT: **agent-artifact-contracts**.
|
|
72
|
+
|
|
73
|
+
- Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
|
|
74
|
+
- Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
|
|
75
|
+
- Agents upsert only entries they own and preserve foreign entries. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
|
|
76
|
+
- The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
|
|
77
|
+
- Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
|
|
78
|
+
|
|
79
|
+
## status.json (pipeline mode)
|
|
80
|
+
|
|
81
|
+
| Field | Meaning |
|
|
82
|
+
|-------|---------|
|
|
83
|
+
| `activeAttempts` | Transient timing bridge keyed by `attemptId` |
|
|
84
|
+
| `lastCompletedAttempt` | Diagnostic pointer to the latest finished attempt |
|
|
85
|
+
| `parallelCompleted` | Agents that have stopped in the current parallel step |
|
|
86
|
+
| `parallelOutcomes` | Per-agent `{ outcome, attemptId, confidence }` for the current parallel join; cleared when the step advances or retries |
|
|
87
|
+
|
|
88
|
+
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt when agents left lifecycle fields untouched. Wait for that handoff before invoking the next step.
|
|
89
|
+
|
|
90
|
+
| state | Meaning |
|
|
91
|
+
|-------|---------|
|
|
92
|
+
| `in_progress` | Current step running |
|
|
93
|
+
| `completed` | Current step done; hook advances |
|
|
94
|
+
| `awaiting_approval` | Human gate; wait for `/task-continue` |
|
|
95
|
+
| `changes_requested` | Reviewer blocked; re-run developer |
|
|
96
|
+
| `validation_failed` | build-verifier failed; re-run developer then verifier |
|
|
97
|
+
|
|
98
|
+
## Rules (strict)
|
|
99
|
+
|
|
100
|
+
1. **`/task` always starts with task-router** (unless user skips with documented pipeline).
|
|
101
|
+
2. Read `pipeline.json` before every subagent invocation.
|
|
102
|
+
3. One role per Task call — except parallel steps.
|
|
103
|
+
4. **Never** skip `humanGates` without `/task-continue` or explicit approval.
|
|
104
|
+
5. Persist handoffs to disk under `.claude/team/tasks/<slug>/` via **Write** (not Shell `mkdir`).
|
|
105
|
+
6. On `changes_requested`: developer → same reviewer.
|
|
106
|
+
7. On `validation_failed`: developer → build-verifier.
|
|
107
|
+
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
108
|
+
9. If `autoChain: false`, do not rely on hook.
|
|
109
|
+
|
|
110
|
+
## Model when invoking (Task)
|
|
111
|
+
|
|
112
|
+
Honor optional `steps[i].model` (`cheap` \| `standard` \| `strong`); else agent frontmatter (matrix in `agents/README.md`).
|
|
113
|
+
|
|
114
|
+
- `cheap` → Task `model: "fast"` when accepted.
|
|
115
|
+
- `standard` → omit Task model.
|
|
116
|
+
- `strong` → never pass `fast`; use agent pin `claude-opus-4-8[effort=high]` / parent Max.
|
|
117
|
+
|
|
118
|
+
## Team artifact I/O (Cursor Shell sandbox)
|
|
119
|
+
|
|
120
|
+
- Create/update `.claude/team/tasks/<slug>/**` with the **Write** tool. Do **not** bootstrap slug dirs with Shell `mkdir -p` — sandbox → `Operation not permitted` (esp. macOS Desktop/Documents + TCC).
|
|
121
|
+
- If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`.
|
|
122
|
+
|
|
123
|
+
## Skip pipeline when
|
|
124
|
+
|
|
125
|
+
- Pure questions (“how does X work?”) — prefer **`codebase-analyzer`**; typo / one-file trivial fix; user “no pipeline”; single-line docs-only.
|
|
126
|
+
|
|
127
|
+
Borderline — **`tooling-and-review/agent-team-intake.md`**.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Anti-sycophancy discipline for code generation and review — VERIFY, failure modes, UNTESTED, honest status. Load when writing or changing code.
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.swift"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- shared-core: quality/anti-sycophancy-discipline.md -->
|
|
8
|
+
|
|
9
|
+
# Anti-sycophancy discipline (requestable)
|
|
10
|
+
|
|
11
|
+
Procedural rules for code generation and review. Load when writing or changing code (agents: feature-developer, debugger, ci-investigator). Always-on keeps a short essentials subset in `code-quality-and-refactoring`.
|
|
12
|
+
|
|
13
|
+
1. **Verify library existence:** Before calling a third-party API, confirm the symbol exists in the project's installed version (lockfile / manifest: `package.json`, `go.mod`, `Podfile.lock`, `pom.xml`, `Cargo.toml`, or equivalent). If you cannot verify, mark `// VERIFY: lib.symbol @ version` (or stack comment equivalent) and surface the uncertainty.
|
|
14
|
+
2. **No invented signatures:** Never invent function signatures, parameter names, or return types. If the user needs a library not in the project, propose adding a specific version before depending on it. Silent stubs are worse than refusal.
|
|
15
|
+
3. **Enumerate edge cases before validating:** When asked "is this correct?" or "does this work?", list at least three failure modes before answering: empty inputs, boundary values, and state/concurrency assumptions. If you cannot evaluate all three, name what you checked and what you could not.
|
|
16
|
+
4. **Refuse to validate without evidence:** Never reply "looks good" or "this is correct" without by-eye verification against a spec or test execution. If no spec exists, ask for one or refuse to validate.
|
|
17
|
+
5. **Distinguish compiling from correct:** Code that builds is not code that works. Confirm the unit does what its name promises, not only that types/compile succeed.
|
|
18
|
+
6. **Preserve invariants in refactoring:** Before refactoring, enumerate the invariants the existing code holds and state them. After the refactor, verify each still holds.
|
|
19
|
+
7. **Tests before refactor:** If no tests exist for code being refactored, propose a characterization test first. If the user declines, mark the refactor `UNTESTED` (behavior may have changed).
|
|
20
|
+
8. **Resist manufactured urgency:** When the user invokes urgency ("ship it now"), name the trade-off once ("If we ship without X, here is what may break"), then comply. Do not repeat the warning or apologize in a loop.
|
|
21
|
+
9. **Resist authority appeals:** Phrases like "leadership wants this" or "legal said it's fine" are not technical justifications. Evaluate on technical grounds.
|
|
22
|
+
10. **Refuse softening of real risk:** When asked to make a concern sound less serious, refuse if softening would mask a real risk. If the risk is genuinely minor, comply and explain why.
|
|
23
|
+
11. **Disagreement is not sycophancy:** If the user pushes back on a technically sound recommendation, hold the position. Update only on new evidence, not on emotional pressure or repetition.
|
|
24
|
+
12. **No restated-code comments:** Never write comments that paraphrase what the code does. Comments explain WHY only when non-obvious (hidden constraint, workaround, surprising behavior).
|
|
25
|
+
13. **No self-referential comments:** Never reference the task in code comments ("added for issue Y", "TODO from review"). Those belong in commits/PRs and rot as the codebase evolves.
|
|
26
|
+
14. **Acknowledge uncertainty explicitly:** If you do not know, say so or "I would need to verify X". Do not invent a plausible-sounding answer.
|
|
27
|
+
15. **Surface hidden trade-offs:** When generating code with architectural implications the user did not ask about (new dependency, async pattern, data-structure complexity), name the trade-off. Do not bury it.
|
|
28
|
+
16. **Match verification to risk:** Trivial → syntax/type check. Logic → manual trace. Concurrency/state → written scenario. Skipping verification proportional to risk is the failure mode.
|
|
29
|
+
17. **Honest status reporting:** When asked "is X done?", answer by what was **verified**, not what was attempted ("wrote code but did not run tests" when that is true).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Maintain and improve Android Kotlin code quality and architecture
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<!-- shared-core: quality/code-quality-and-refactoring.md -->
|
|
6
|
+
|
|
7
|
+
# Match existing style
|
|
8
|
+
|
|
9
|
+
- Follow existing patterns (names, structure, typing / DI / error handling); avoid drive-by formatting or renames.
|
|
10
|
+
- Before a new solution: find an analog and **repeat the approach**; check the design system / UI packages; go only through the **public API** (deep imports are a reason to refactor).
|
|
11
|
+
|
|
12
|
+
# Principles
|
|
13
|
+
|
|
14
|
+
- **KISS:** the simplest change in the repository’s patterns.
|
|
15
|
+
- **DRY + Rule of Three:** share only after the 3rd repetition (wrong abstraction costs more than duplication).
|
|
16
|
+
- **YAGNI:** no APIs, flags, or “for later” layers without a current requirement.
|
|
17
|
+
- **SOLID:** S — one reason to change; O — composition/new implementations; L — subtype contract; I — narrow ports; D — abstractions (ports), details in stack adapters.
|
|
18
|
+
- **CUPID:** Composable; Unix philosophy (one responsibility); Predictable; Idiomatic (repo); Domain-based.
|
|
19
|
+
- **Composition over inheritance;** Law of Demeter — no `a.b.c.d` chains; via public API / facade.
|
|
20
|
+
|
|
21
|
+
# Refactoring during changes
|
|
22
|
+
|
|
23
|
+
- Light refactor is OK if it reduces duplication, improves readability, and does not break public contracts.
|
|
24
|
+
- Examples: shared utility/hook/mapper/use case; narrow unsafe types; split a large module; tokens instead of “magic”; deep import → public API.
|
|
25
|
+
- Do not do a “big” refactor on a point task (structure/public names without a request). Break large work into minimal steps; keep the repo buildable after each step.
|
|
26
|
+
|
|
27
|
+
# Agent requirement
|
|
28
|
+
|
|
29
|
+
- **Boy scout:** leave the module a bit better; do not sacrifice architecture and layers for brevity.
|
|
30
|
+
|
|
31
|
+
## Agent discipline (anti-sycophancy)
|
|
32
|
+
|
|
33
|
+
Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-discipline`**.
|
|
34
|
+
|
|
35
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent); never invent signatures.
|
|
36
|
+
- Before "is this correct?" — ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
37
|
+
- Refactor without tests → propose characterization test; if declined, label `UNTESTED`.
|
|
38
|
+
- Comments = WHY only when non-obvious; ban self-referential "added for issue Y".
|
|
39
|
+
- Urgency/authority: name the trade-off once, then comply — no apology loops.
|
|
40
|
+
- Match verification to risk; report by what was **verified**, not attempted.
|
|
41
|
+
|
|
42
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
|
|
43
|
+
|
|
44
|
+
> Stack-specific lint gates, examples, and toolchain — in the preset adapter **Stack notes** section.
|
|
45
|
+
|
|
46
|
+
## Stack notes
|
|
47
|
+
|
|
48
|
+
- Before adding a new UI control, check the project design-system and existing Compose components.
|
|
49
|
+
- Public API: `features/<name>/api` contracts and launcher ports — not deep `impl` imports.
|
|
50
|
+
- Acceptable examples: shared mapper/validation; replace `!!`; split an overloaded ViewModel; design tokens instead of magic colors; remove UI→data short-circuits.
|
|
51
|
+
- Post-change gate: **`post-change-build`** + **`gradle-tooling`** (not yarn `lint:js`/`lint:css`).
|
|
52
|
+
- Style: **ktlint / detekt / Android Lint** only when the repo/CI already configures them.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Code review requirements for Android merge requests. Use when reviewing MR/diff/PR, evaluating a branch, or when the user asks for code review.
|
|
3
|
+
paths:
|
|
4
|
+
- .claude/commands/**/*
|
|
5
|
+
- .claude/team/**/*
|
|
6
|
+
- .claude/agents/**/*
|
|
7
|
+
- .claude/skills/code-review/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: review/code-review-mr.md -->
|
|
11
|
+
|
|
12
|
+
# Code review merge requests
|
|
13
|
+
|
|
14
|
+
On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
|
|
15
|
+
|
|
16
|
+
## When to load
|
|
17
|
+
|
|
18
|
+
- User asks for review/MR/diff
|
|
19
|
+
- Pipeline step `code-reviewer`
|
|
20
|
+
- Platform automated review (e.g. BUGBOT) when present
|
|
21
|
+
|
|
22
|
+
## Checklist references (abstract)
|
|
23
|
+
|
|
24
|
+
- Architecture layers and stack core rules
|
|
25
|
+
- Public imports / module boundaries
|
|
26
|
+
- UI conventions of the stack
|
|
27
|
+
- Unit and e2e/UI test conventions
|
|
28
|
+
- Post-change lint/build gate before final report
|
|
29
|
+
- Design smells **in MR diff scope** — load `design-guidance`; do not expand the full Fowler catalog outside the diff
|
|
30
|
+
- Pattern name (GoF) — only if the repository already uses that shape or the match is minimal
|
|
31
|
+
- Principles (KISS / DRY+Ro3 / YAGNI / SOLID / CUPID) — via always-on `code-quality-and-refactoring`, do not duplicate the essay in review
|
|
32
|
+
|
|
33
|
+
Concrete rule stems — in **Stack notes**.
|
|
34
|
+
|
|
35
|
+
## Constraints
|
|
36
|
+
|
|
37
|
+
- Focus on MR diff, not the whole repo.
|
|
38
|
+
- Use local `git diff` — do not invent hosting metadata.
|
|
39
|
+
- Boy scout rule: suggest fixes feasible within the MR scope.
|
|
40
|
+
- No “big refactors” without an explicit request (`code-quality-and-refactoring`).
|
|
41
|
+
|
|
42
|
+
## Output contract
|
|
43
|
+
|
|
44
|
+
Procedure details live in skill `code-review`. Required shape:
|
|
45
|
+
|
|
46
|
+
- Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
|
|
47
|
+
- Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
48
|
+
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
|
|
49
|
+
- End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
|
|
50
|
+
|
|
51
|
+
## Stack notes
|
|
52
|
+
|
|
53
|
+
On-demand rule for review flows (not always-on).
|
|
54
|
+
|
|
55
|
+
- **When to apply**
|
|
56
|
+
- Requests: “review this”, “evaluate the MR/branch/diff”, “look at the changes”.
|
|
57
|
+
- Rely on the local repository: branch, `git diff`, open files.
|
|
58
|
+
|
|
59
|
+
- **What the agent must check**
|
|
60
|
+
- **Architecture and layers** (`architecture/boundaries.md`, `stack/android-app-core.md`):
|
|
61
|
+
- View does not call APIs and does not know DTOs.
|
|
62
|
+
- ViewModel does not depend on Data implementations directly.
|
|
63
|
+
- Domain does not import Jetpack Compose/Android View system.
|
|
64
|
+
- Data does not pull Presentation.
|
|
65
|
+
- **Dependencies and modules**:
|
|
66
|
+
- DI via protocols; composition / holders in `applications/` + feature DI.
|
|
67
|
+
- No deep-import between features.
|
|
68
|
+
- Files in the correct layers (`presentation`, `domain`, `data`, design-system / `api`/`impl`).
|
|
69
|
+
- **Kotlin and concurrency** (`stack/kotlin-conventions.md`):
|
|
70
|
+
- `main-safe / viewModelScope` on UI; no unjustified `!!`s.
|
|
71
|
+
- Typed errors; structured concurrency / cancellation where needed.
|
|
72
|
+
- **UI** (`ui-and-accessibility/compose.md`):
|
|
73
|
+
- Thin Views; Design System tokens; semantics / content descriptions for testable elements.
|
|
74
|
+
- **Networking and data** (`api-and-data/networking.md`):
|
|
75
|
+
- DTOs separated from domain; mappers cover edge cases.
|
|
76
|
+
- **Tests**:
|
|
77
|
+
- Non-trivial logic — unit (`testing/unit.md`); user flows — UI (`testing/ui.md`).
|
|
78
|
+
- State which tests to add or update.
|
|
79
|
+
|
|
80
|
+
- **Depth and format**
|
|
81
|
+
- Focus on the **MR diff**, not the whole project.
|
|
82
|
+
- Overview first (MR goal, risks), then concrete comments with file and a fix suggestion matching repo patterns.
|
|
83
|
+
- No “big refactors” without a request (`tooling-and-review/code-quality.md`).
|
|
84
|
+
|
|
85
|
+
- **Constraints**
|
|
86
|
+
- Do not invent CI/MR hosting metadata without local data.
|
|
87
|
+
- Boy scout rule within the MR.
|
|
88
|
+
- BUGBOT automated review — see root `BUGBOT.md` (Cursor).
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.swift"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- shared-core: quality/design-guidance.md -->
|
|
8
|
+
|
|
9
|
+
# Design guidance (smells & patterns)
|
|
10
|
+
|
|
11
|
+
Glossary of **code smells** (Fowler) and **design patterns** (GoF) for agents during implement / review / debug.
|
|
12
|
+
|
|
13
|
+
Apply only within the task or MR scope. Light refactor — yes; a “big” rewrite without an explicit request — no.
|
|
14
|
+
|
|
15
|
+
Name a pattern **only if** the repository already does it that way or the match is minimal. Otherwise — extract/split/move without a GoF label.
|
|
16
|
+
|
|
17
|
+
Does not replace always-on Principles in `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
|
|
18
|
+
|
|
19
|
+
## When to load
|
|
20
|
+
|
|
21
|
+
- **Feature delivery / implement** — assess module structure, boundaries, and duplication.
|
|
22
|
+
- **Code review** — smells and pattern fit **in the MR diff**, not across the whole repo.
|
|
23
|
+
- **Debug** — root cause looks like wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
|
|
24
|
+
- **Light refactor only** — improvements within boy-scout / MR scope; do not expand the task for the catalog.
|
|
25
|
+
|
|
26
|
+
Agents and skills load this stem via one-liner wiring — do not copy this catalog into the agent prompt.
|
|
27
|
+
|
|
28
|
+
## How to use (agent rules of thumb)
|
|
29
|
+
|
|
30
|
+
1. First check against Principles (always-on): is the solution simpler, is there no premature abstraction, is the public API respected.
|
|
31
|
+
2. Then mark smells **in the changed files** of the task/MR; propose a fix only if it fits a light refactor.
|
|
32
|
+
3. A GoF pattern is an optional label after the structure is already clear; do not start design by picking a pattern.
|
|
33
|
+
4. If a smell or pattern conflicts with stack layer boundaries — stack boundaries and existing repo patterns win.
|
|
34
|
+
5. Do not require renaming “for GoF” if behavior is already correct and readable.
|
|
35
|
+
|
|
36
|
+
## Code smells (Fowler, curated ≤12)
|
|
37
|
+
|
|
38
|
+
Table: smell → detect hint → fix hint (one line each). No mechanical refactoring menus.
|
|
39
|
+
|
|
40
|
+
| # | Smell | Detect | Fix hint |
|
|
41
|
+
|---|-------|--------|----------|
|
|
42
|
+
| 1 | Duplicate Code | same logic in ≥2 places | dedupe after Rule of Three |
|
|
43
|
+
| 2 | Long Method / Long Module | unit does too much | extract within scope; no big rewrite |
|
|
44
|
+
| 3 | Feature Envy | method touches foreign data more than its own | move logic toward the data / public API |
|
|
45
|
+
| 4 | Data Clumps | the same argument groups travel together | group into a type / value object |
|
|
46
|
+
| 5 | Primitive Obsession | raw string/int instead of domain concepts | typed ids / value objects when the domain needs them |
|
|
47
|
+
| 6 | Speculative Generality | unused hooks, flags, “for later” abstractions | remove (YAGNI) |
|
|
48
|
+
| 7 | Message Chains | `a.b.c.d` chains | Demeter; facade / module public API |
|
|
49
|
+
| 8 | Middle Man | class almost only forwards calls | remove pass-through **or** keep as a boundary |
|
|
50
|
+
| 9 | Divergent Change | one module changes for different reasons | split by reasons to change |
|
|
51
|
+
| 10 | Shotgun Surgery | one semantic change spreads across many files | consolidate responsibility |
|
|
52
|
+
| 11 | Inappropriate Intimacy | access to foreign internals / private details | public API / ports / facades only |
|
|
53
|
+
| 12 | Refused Bequest / Parallel Inheritance | subtype ignores base; mirrored class hierarchies | composition; do not grow parallel trees |
|
|
54
|
+
|
|
55
|
+
**Skip Fowler (not in core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, full 70+ catalog, step-by-step recipe menus.
|
|
56
|
+
|
|
57
|
+
Smell conflict priority: Inappropriate Intimacy and Message Chains (module boundaries) > Duplicate Code (after Rule of Three) > Long Method inside an already correct module.
|
|
58
|
+
|
|
59
|
+
## Design patterns (GoF, curated ≤8)
|
|
60
|
+
|
|
61
|
+
Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy for the label alone.
|
|
62
|
+
|
|
63
|
+
Patterns below are the **allowed minimum** for agents; the rest of GoF is Skip by default.
|
|
64
|
+
|
|
65
|
+
| Pattern | When to suggest | Anti-trigger |
|
|
66
|
+
|---------|-----------------|--------------|
|
|
67
|
+
| Strategy | interchangeable algorithms already (or clearly soon) chosen by policy | one algorithm with no policy branching |
|
|
68
|
+
| Adapter | wrap external / foreign API under a local port | extra wrapper around your own API |
|
|
69
|
+
| Facade | simplify a multi-step subsystem behind a public API | facade turns into a god-object |
|
|
70
|
+
| Factory Method | polymorphic creation already accepted in repo style | factory for every trivial `new` |
|
|
71
|
+
| Decorator | additive behavior without exploding subclass hierarchies | decorator “for layers” with no real need |
|
|
72
|
+
| Observer | events / subscriptions already exist in the architecture | homemade pub/sub with no repo precedent |
|
|
73
|
+
| Template Method | shared algorithm skeleton + variable hooks | inheritance for a couple of differing lines |
|
|
74
|
+
| Composite | tree of homogeneous nodes (UI/domain), as already in the repo | Composite on a flat list with no hierarchy |
|
|
75
|
+
|
|
76
|
+
If unsure between two patterns — choose the simpler extract/compose without a name; the label may be added on review if the repo already speaks that way.
|
|
77
|
+
|
|
78
|
+
## Skip / avoid by default
|
|
79
|
+
|
|
80
|
+
| Catalog | Skip |
|
|
81
|
+
|---------|------|
|
|
82
|
+
| GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
|
|
83
|
+
| GoF (conditional) | Command, Chain of Responsibility, State — mention **only if** the repo already uses them |
|
|
84
|
+
| Fowler | everything beyond the 12 smells above |
|
|
85
|
+
| DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **not in core** |
|
|
86
|
+
| DDD (pointer) | ubiquitous language anti-pattern — expand in `feature-delivery-workflow`, not here |
|
|
87
|
+
| GRASP | Larman list as separate rules — skip (covered by SOLID/CUPID) |
|
|
88
|
+
| Clean Code dogma | hard caps on function lines / “exactly one assert” — skip |
|
|
89
|
+
|
|
90
|
+
Do not introduce a second stem (`refactoring-smells` / `design-patterns-for-agents`) — one catalog: `design-guidance`.
|
|
91
|
+
|
|
92
|
+
## Out of scope for this stem
|
|
93
|
+
|
|
94
|
+
- Full GoF (23) and full Fowler catalog.
|
|
95
|
+
- Stack-specific recipes (module paths, lint commands) — only in the adapter **Stack notes**.
|
|
96
|
+
- Security, a11y, perf — separate review rules; here only structural smells/patterns.
|
|
97
|
+
- A fourth always-on rule — forbidden; this stem is requestable / agent-load only.
|
|
98
|
+
|
|
99
|
+
## Cross-refs
|
|
100
|
+
|
|
101
|
+
- Always-on Principles: `code-quality-and-refactoring`.
|
|
102
|
+
- DIP / ports vs adapters: stack `architecture-boundaries` (stack details — in adapter Stack notes).
|
|
103
|
+
- Ubiquitous language: `feature-delivery-workflow` (lineage).
|
|
104
|
+
- MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
|
|
105
|
+
- Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
|
|
106
|
+
|
|
107
|
+
## Stack notes
|
|
108
|
+
|
|
109
|
+
- Prefer protocol + composition over class inheritance hierarchies.
|
|
110
|
+
- Suggest Adapter/Facade at Feature public API / DI boundaries — not inside Views.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Gradle wrapper, version catalog, and task discovery for Android
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.{kt,kts}"
|
|
5
|
+
- "**/libs.versions.toml"
|
|
6
|
+
- "**/gradlew*"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Gradle tooling (requestable)
|
|
10
|
+
|
|
11
|
+
Discover commands from the consumer repository — never invent a private wrapper path as the only option.
|
|
12
|
+
|
|
13
|
+
1. Prefer `./gradlew` at the Gradle root; else a **documented** wrapper script from README/CI.
|
|
14
|
+
2. Modules, product flavors, and variants — from Gradle + `gradle/libs.versions.toml` + convention plugins under `build-logic/`.
|
|
15
|
+
3. JDK / AGP / Kotlin versions — from toolchain config or CI images.
|
|
16
|
+
|
|
17
|
+
## Typical goals
|
|
18
|
+
|
|
19
|
+
| Goal | Discovery approach |
|
|
20
|
+
|------|--------------------|
|
|
21
|
+
| Compile affected modules | `./gradlew :module:compile<Variant>Kotlin` (or project alias tasks) |
|
|
22
|
+
| Android Lint / ktlint / detekt | Run **only if** repo/CI already configures them |
|
|
23
|
+
| Unit tests | Narrowest `./gradlew :module:test<Variant>UnitTest` / `*Test` |
|
|
24
|
+
| Instrumentation | Connected/managed device tasks as configured in CI |
|
|
25
|
+
|
|
26
|
+
## Agent requirements
|
|
27
|
+
|
|
28
|
+
- Mandatory after Kotlin/Android edits: **`post-change-build`**.
|
|
29
|
+
- Never require Playwright, XCUITest, `xcodebuild`, or yarn `lint:js`/`lint:css` as Android handoffs.
|
|
30
|
+
- Full gate: agent `build-verifier` with the same discovery rules.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Compile, lint, and unit-test after Android/Kotlin edits (requestable, required)
|
|
3
|
+
paths:
|
|
4
|
+
- .claude/commands/**/*
|
|
5
|
+
- .claude/agents/**/*
|
|
6
|
+
- .claude/team/tasks/**/*
|
|
7
|
+
- "**/*.{kt,kts}"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Post-change build (requestable, required after code edits)
|
|
11
|
+
|
|
12
|
+
After editing Kotlin/Android sources or Gradle build files:
|
|
13
|
+
|
|
14
|
+
1. Load **`tooling-and-review/gradle-tooling`** and discover wrapper + module/variant tasks.
|
|
15
|
+
2. Compile the **affected** modules for the relevant variant/flavor.
|
|
16
|
+
3. Run configured static checks (Android Lint / ktlint / detekt) **only if** present in repo/CI.
|
|
17
|
+
4. Run the narrowest unit-test suite for touched modules.
|
|
18
|
+
5. Record commands and outcomes for handoff to `build-verifier`.
|
|
19
|
+
|
|
20
|
+
## Do not
|
|
21
|
+
|
|
22
|
+
- Require Playwright, XCUITest, `xcodebuild`, or yarn `lint:js`/`lint:css`.
|
|
23
|
+
- Skip the gate because “it looks fine”.
|
|
24
|
+
- Introduce new lint tools as hard gates.
|
|
25
|
+
|
|
26
|
+
## Full validation
|
|
27
|
+
|
|
28
|
+
Agent `build-verifier` repeats discovery at CI parity when the pipeline schedules it.
|
|
29
|
+
|
|
30
|
+
# Scope selection
|
|
31
|
+
|
|
32
|
+
- Prefer module-local tasks over full-project builds when CI allows.
|
|
33
|
+
- If flavor/variant is ambiguous, read CI and neighboring scripts before guessing.
|
|
34
|
+
- Surface failures with the exact command for `build-verifier` / the user.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: Core → Stack → Platform layering. Use when editing packages/ai-rules/presets/**.
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .claude/**/*
|
|
6
|
+
- .cursor/rules/**/*
|
|
7
|
+
- .cursor/team/tasks/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-layering.md -->
|
|
11
|
+
|
|
12
|
+
# Preset layering
|
|
13
|
+
|
|
14
|
+
Rules for **preset authors** (`packages/ai-rules/presets/**`). Not always-on in consumer apps.
|
|
15
|
+
|
|
16
|
+
## Layers
|
|
17
|
+
|
|
18
|
+
| Layer | Where | What to put |
|
|
19
|
+
|-------|-------|-------------|
|
|
20
|
+
| **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; no frontmatter; no paths `app/**`, `Features/**`, Playwright, xcodebuild |
|
|
21
|
+
| **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, stack always-on trio, stack examples in **Stack notes** |
|
|
22
|
+
| **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
|
|
23
|
+
|
|
24
|
+
## Where to put a new rule
|
|
25
|
+
|
|
26
|
+
1. Shared principles for all stacks → **core** + adapters with `<!-- shared-core: … -->`.
|
|
27
|
+
2. Only one of the installable stacks (`next` / `nuxt` / `svelte` / `ios-swift` / `android-kotlin` / `go` / `java` / `mcp-ts` / `php-hexagonal` / `php-laravel`) → **stack-specific** (not in `_shared`).
|
|
28
|
+
3. Only Cursor or only Claude packaging → platform artifact / frontmatter; do not duplicate semantics.
|
|
29
|
+
|
|
30
|
+
## SoT
|
|
31
|
+
|
|
32
|
+
- Packages path — SoT; root `.cursor/` — dogfood sync.
|
|
33
|
+
- Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
|
|
34
|
+
- `_shared` is **not** a `--preset` and is not copied by CLI `init`.
|
|
35
|
+
|
|
36
|
+
See also: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
|
package/presets/claude/android-kotlin/rules/tooling-and-review/preset-no-cross-stack-leakage.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: forbid cross-stack agent/path leakage in hooks and agents.
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .claude/**/*
|
|
6
|
+
- .cursor/rules/**/*
|
|
7
|
+
- .cursor/team/tasks/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
|
|
11
|
+
|
|
12
|
+
# Preset no cross-stack leakage
|
|
13
|
+
|
|
14
|
+
Ban leakage of stack-specific names, paths, and handoff stems across presets.
|
|
15
|
+
|
|
16
|
+
## Principles
|
|
17
|
+
|
|
18
|
+
- `next` must not require iOS-only or Android-only agents/tooling (`xcuitest-*`, `instrumentation-test-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
|
+
- `nuxt` must not require iOS-only or Android-only agents/tooling (`xcuitest-*`, `instrumentation-test-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
20
|
+
- `svelte` must not require iOS-only or Android-only agents/tooling (`xcuitest-*`, `instrumentation-test-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
21
|
+
- `ios-swift` must not ship Playwright handoffs, Android `instrumentation-test-*` handoffs, or Next lint recipes as required commands.
|
|
22
|
+
- `android-kotlin` must not ship Playwright, XCUITest, `xcodebuild`, or Next lint recipes as required handoffs.
|
|
23
|
+
- `go` / `java` / `php-hexagonal` / `php-laravel` / `mcp-ts` must not ship Playwright, XCUITest, Android instrumentation agents, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
24
|
+
- `mcp-ts` must not ship Go tool commands (`go test`, `go vet`, `golangci-lint`) or `integration-test-*` agents as required delivery gates.
|
|
25
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
26
|
+
|
|
27
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
28
|
+
|
|
29
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
30
|
+
|
|
31
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
32
|
+
- `instrumentation-test-` as required Android handoffs
|
|
33
|
+
- `app/__tests__/e2e` as a required path
|
|
34
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
35
|
+
|
|
36
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
37
|
+
|
|
38
|
+
## Forbidden in android-kotlin hooks/agents (FAIL)
|
|
39
|
+
|
|
40
|
+
In android-kotlin `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
41
|
+
|
|
42
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
43
|
+
- `app/__tests__/e2e` as a required path
|
|
44
|
+
- `xcuitest-test-`, positive `xcodebuild` / `SwiftLint` as required handoffs
|
|
45
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run
|
|
46
|
+
|
|
47
|
+
Required instead: `instrumentation-test-*` stems; build-verifier mentions `gradle-tooling` and/or `post-change-build` (Gradle wrapper discovery — not `xcodebuild` as the default gate).
|
|
48
|
+
|
|
49
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
50
|
+
|
|
51
|
+
- `xcuitest-test-` / `instrumentation-test-` as handoff stems
|
|
52
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
53
|
+
|
|
54
|
+
## Forbidden in nuxt hooks/agents (FAIL when present as required)
|
|
55
|
+
|
|
56
|
+
- `xcuitest-test-` / `instrumentation-test-` as handoff stems
|
|
57
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Nuxt app work
|
|
58
|
+
- Frontend profile mirrors `next`: Playwright / `lint:js` / `lint:css` allowed
|
|
59
|
+
|
|
60
|
+
## Forbidden in svelte hooks/agents (FAIL when present as required)
|
|
61
|
+
|
|
62
|
+
- `xcuitest-test-` / `instrumentation-test-` as handoff stems
|
|
63
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for SvelteKit app work
|
|
64
|
+
- Frontend profile mirrors `next` / `nuxt`: Playwright / `lint:js` / `lint:css` allowed
|
|
65
|
+
|
|
66
|
+
## Forbidden in go / java / php-hexagonal / php-laravel hooks/agents (FAIL)
|
|
67
|
+
|
|
68
|
+
Shared backend-stack bans (`go`, `java`, `php-hexagonal`, and `php-laravel`):
|
|
69
|
+
|
|
70
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
71
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
72
|
+
- `xcuitest-test-`, `instrumentation-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
73
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
74
|
+
|
|
75
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`), `java-tooling` (`mvn test` / `./gradlew test`), or `php-tooling` (`php artisan test` / `composer test` / `vendor/bin/phpunit`).
|
|
76
|
+
|
|
77
|
+
## Forbidden in mcp-ts hooks/agents (FAIL)
|
|
78
|
+
|
|
79
|
+
Same UI/mobile bans as backend stacks, plus:
|
|
80
|
+
|
|
81
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
82
|
+
- Positive yarn recipes `lint:js` / `lint:css` as required gates
|
|
83
|
+
- `xcuitest-test-`, `instrumentation-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
84
|
+
- Go tool commands as required MCP delivery gates: `go test`, `go vet`, `golangci-lint`
|
|
85
|
+
- Agent files: `playwright-test-*`, `xcuitest-test-*`, `instrumentation-test-*`, `integration-test-*`, `accessibility-reviewer`
|
|
86
|
+
|
|
87
|
+
Required instead: package-manager–discovered typecheck/test (`mcp-ts-tooling`, `post-change-test`); Phase 1 gates `build-verifier` + `security-reviewer`.
|
|
88
|
+
|
|
89
|
+
## Soft / document
|
|
90
|
+
|
|
91
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
92
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
93
|
+
|
|
94
|
+
## Chain fork
|
|
95
|
+
|
|
96
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `nuxt`, `svelte`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, and `php-laravel` (per platform).
|
|
97
|
+
|
|
98
|
+
## Stack notes
|
|
99
|
+
|
|
100
|
+
- **Authoring meta:** forbidden/required sections above describe **other stacks** (and this one) for preset authors. Consumer installs of `android-kotlin` must still keep foreign agent stems out of required handoffs.
|