@bonesofspring/ai-rules 0.2.9 → 0.2.11
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 +21 -3
- package/README.md +3 -1
- package/bin/cli.js +2 -0
- package/package.json +1 -1
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +15 -2
- package/presets/_shared/core/meta/preset-token-budget.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
- package/presets/claude/go/rules/api-and-data/persistence-adapters.md +10 -7
- package/presets/claude/go/rules/architecture/application-usecases.md +9 -5
- package/presets/claude/go/rules/architecture/boundaries.md +6 -1
- package/presets/claude/go/rules/architecture/composition-root.md +14 -9
- package/presets/claude/go/rules/testing/e2e.md +8 -6
- package/presets/claude/go/rules/testing/integration.md +11 -5
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +15 -2
- package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/go/rules/tooling-and-review/security-go.md +17 -5
- package/presets/claude/ios-swift/README.md +1 -1
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/rules/README.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +15 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/rules/README.md +1 -1
- package/presets/claude/java/rules/api-and-data/messaging-adapters.md +16 -9
- package/presets/claude/java/rules/architecture/boundaries.md +6 -1
- package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +15 -2
- package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/mcp-ts/CLAUDE.md +13 -0
- package/presets/claude/mcp-ts/MCP.md +37 -0
- package/presets/claude/mcp-ts/README.md +11 -0
- package/presets/claude/mcp-ts/REPO_AGENTS.md +49 -0
- package/presets/claude/mcp-ts/agents/README.md +21 -0
- package/presets/claude/mcp-ts/agents/build-verifier.md +39 -0
- package/presets/claude/mcp-ts/agents/feature-developer.md +47 -0
- package/presets/claude/mcp-ts/agents/security-reviewer.md +21 -0
- package/presets/claude/mcp-ts/agents/solution-architect.md +23 -0
- package/presets/claude/mcp-ts/agents/task-analyst.md +25 -0
- package/presets/claude/mcp-ts/agents/task-router.md +73 -0
- package/presets/claude/mcp-ts/commands/README.md +11 -0
- package/presets/claude/mcp-ts/commands/feature-continue.md +19 -0
- package/presets/claude/mcp-ts/commands/feature-start.md +33 -0
- package/presets/claude/mcp-ts/commands/task-continue.md +49 -0
- package/presets/claude/mcp-ts/commands/task.md +49 -0
- package/presets/claude/mcp-ts/commands/technical-retro.md +81 -0
- package/presets/claude/mcp-ts/hooks/README.md +12 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +346 -0
- package/presets/claude/mcp-ts/hooks/examples/README.md +11 -0
- package/presets/claude/mcp-ts/hooks/examples/format-edited.example.sh +16 -0
- package/presets/claude/mcp-ts/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/mcp-ts/hooks/examples/test-on-save.example.sh +25 -0
- package/presets/claude/mcp-ts/hooks/guard-shell-command.sh +79 -0
- package/presets/claude/mcp-ts/mcp.json +11 -0
- package/presets/claude/mcp-ts/rules/README.md +52 -0
- package/presets/claude/mcp-ts/rules/api-and-data/README.md +3 -0
- package/presets/claude/mcp-ts/rules/api-and-data/mcp-auth-secrets.md +44 -0
- package/presets/claude/mcp-ts/rules/api-and-data/mcp-contract-testing.md +42 -0
- package/presets/claude/mcp-ts/rules/api-and-data/mcp-tool-design.md +37 -0
- package/presets/claude/mcp-ts/rules/api-and-data/mcp-transport-packaging.md +43 -0
- package/presets/claude/mcp-ts/rules/architecture/README.md +3 -0
- package/presets/claude/mcp-ts/rules/architecture/feature-delivery.md +45 -0
- package/presets/claude/mcp-ts/rules/architecture/mcp-server-boundaries.md +28 -0
- package/presets/claude/mcp-ts/rules/architecture/reference-features.md +33 -0
- package/presets/claude/mcp-ts/rules/stack/README.md +3 -0
- package/presets/claude/mcp-ts/rules/stack/mcp-ts-app-core.md +27 -0
- package/presets/claude/mcp-ts/rules/stack/mcp-ts-conventions.md +29 -0
- package/presets/claude/mcp-ts/rules/testing/README.md +3 -0
- package/presets/claude/mcp-ts/rules/testing/unit.md +30 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/README.md +3 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +23 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +161 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/anti-sycophancy-discipline.md +34 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +52 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +51 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/design-guidance.md +109 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/mcp-ts-tooling.md +31 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/post-change-test.md +30 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +69 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +46 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/security-mcp.md +52 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/technical-retro.md +20 -0
- package/presets/claude/mcp-ts/rules/ui-and-accessibility/README.md +3 -0
- package/presets/claude/mcp-ts/skills/README.md +12 -0
- package/presets/claude/mcp-ts/skills/code-review/SKILL.md +10 -0
- package/presets/claude/mcp-ts/skills/debug-investigation/SKILL.md +11 -0
- package/presets/claude/mcp-ts/skills/feature-delivery/SKILL.md +29 -0
- package/presets/claude/mcp-ts/skills/unit-testing/SKILL.md +16 -0
- package/presets/claude/mcp-ts/team/README.md +17 -0
- package/presets/claude/mcp-ts/team/conventions.md +14 -0
- package/presets/claude/mcp-ts/team/fixtures/bugfix-standard.json +32 -0
- package/presets/claude/mcp-ts/team/fixtures/feature-full.json +33 -0
- package/presets/claude/mcp-ts/team/fixtures/feature-light.json +34 -0
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +15 -2
- package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/cursor/go/rules/README.md +8 -8
- package/presets/cursor/go/rules/application-usecases.mdc +9 -5
- package/presets/cursor/go/rules/architecture-boundaries.mdc +6 -0
- package/presets/cursor/go/rules/composition-root.mdc +14 -9
- package/presets/cursor/go/rules/persistence-adapters.mdc +10 -7
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +15 -2
- package/presets/cursor/go/rules/preset-token-budget.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/go/rules/security-go.mdc +17 -5
- package/presets/cursor/go/rules/tests-e2e.mdc +8 -6
- package/presets/cursor/go/rules/tests-integration.mdc +11 -5
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/rules/README.md +1 -1
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +15 -2
- package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/java/README.md +1 -1
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/rules/README.md +4 -4
- package/presets/cursor/java/rules/architecture-boundaries.mdc +6 -0
- package/presets/cursor/java/rules/messaging-adapters.mdc +16 -10
- package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +15 -2
- package/presets/cursor/java/rules/preset-token-budget.mdc +1 -1
- package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/mcp-ts/AGENTS.md +25 -0
- package/presets/cursor/mcp-ts/BUGBOT.md +9 -0
- package/presets/cursor/mcp-ts/MCP.md +37 -0
- package/presets/cursor/mcp-ts/README.md +19 -0
- package/presets/cursor/mcp-ts/REPO_AGENTS.md +49 -0
- package/presets/cursor/mcp-ts/agents/README.md +21 -0
- package/presets/cursor/mcp-ts/agents/build-verifier.md +39 -0
- package/presets/cursor/mcp-ts/agents/feature-developer.md +47 -0
- package/presets/cursor/mcp-ts/agents/security-reviewer.md +21 -0
- package/presets/cursor/mcp-ts/agents/solution-architect.md +23 -0
- package/presets/cursor/mcp-ts/agents/task-analyst.md +25 -0
- package/presets/cursor/mcp-ts/agents/task-router.md +73 -0
- package/presets/cursor/mcp-ts/commands/README.md +11 -0
- package/presets/cursor/mcp-ts/commands/feature-continue.md +19 -0
- package/presets/cursor/mcp-ts/commands/feature-start.md +33 -0
- package/presets/cursor/mcp-ts/commands/task-continue.md +49 -0
- package/presets/cursor/mcp-ts/commands/task.md +49 -0
- package/presets/cursor/mcp-ts/commands/technical-retro.md +81 -0
- package/presets/cursor/mcp-ts/hooks/README.md +12 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +346 -0
- package/presets/cursor/mcp-ts/hooks/examples/README.md +11 -0
- package/presets/cursor/mcp-ts/hooks/examples/format-edited.example.sh +16 -0
- package/presets/cursor/mcp-ts/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/mcp-ts/hooks/examples/test-on-save.example.sh +25 -0
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.sh +79 -0
- package/presets/cursor/mcp-ts/hooks.json +17 -0
- package/presets/cursor/mcp-ts/mcp.json +11 -0
- package/presets/cursor/mcp-ts/rules/README.md +52 -0
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +21 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +159 -0
- package/presets/cursor/mcp-ts/rules/anti-sycophancy-discipline.mdc +35 -0
- package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +53 -0
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +50 -0
- package/presets/cursor/mcp-ts/rules/design-guidance.mdc +108 -0
- package/presets/cursor/mcp-ts/rules/feature-delivery-workflow.mdc +43 -0
- package/presets/cursor/mcp-ts/rules/mcp-auth-secrets.mdc +45 -0
- package/presets/cursor/mcp-ts/rules/mcp-contract-testing.mdc +43 -0
- package/presets/cursor/mcp-ts/rules/mcp-server-boundaries.mdc +29 -0
- package/presets/cursor/mcp-ts/rules/mcp-tool-design.mdc +38 -0
- package/presets/cursor/mcp-ts/rules/mcp-transport-packaging.mdc +44 -0
- package/presets/cursor/mcp-ts/rules/mcp-ts-app-core.mdc +28 -0
- package/presets/cursor/mcp-ts/rules/mcp-ts-conventions.mdc +30 -0
- package/presets/cursor/mcp-ts/rules/mcp-ts-tooling.mdc +32 -0
- package/presets/cursor/mcp-ts/rules/post-change-test.mdc +26 -0
- package/presets/cursor/mcp-ts/rules/preset-layering.mdc +36 -0
- package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +69 -0
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +46 -0
- package/presets/cursor/mcp-ts/rules/reference-features.mdc +34 -0
- package/presets/cursor/mcp-ts/rules/security-mcp.mdc +53 -0
- package/presets/cursor/mcp-ts/rules/technical-retro.mdc +18 -0
- package/presets/cursor/mcp-ts/rules/tests-unit.mdc +31 -0
- package/presets/cursor/mcp-ts/skills/README.md +12 -0
- package/presets/cursor/mcp-ts/skills/code-review/SKILL.md +10 -0
- package/presets/cursor/mcp-ts/skills/debug-investigation/SKILL.md +11 -0
- package/presets/cursor/mcp-ts/skills/feature-delivery/SKILL.md +29 -0
- package/presets/cursor/mcp-ts/skills/unit-testing/SKILL.md +16 -0
- package/presets/cursor/mcp-ts/team/README.md +17 -0
- package/presets/cursor/mcp-ts/team/conventions.md +14 -0
- package/presets/cursor/mcp-ts/team/fixtures/bugfix-standard.json +32 -0
- package/presets/cursor/mcp-ts/team/fixtures/feature-full.json +33 -0
- package/presets/cursor/mcp-ts/team/fixtures/feature-light.json +34 -0
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +15 -2
- package/presets/cursor/next/rules/preset-token-budget.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-delivery
|
|
3
|
+
description: Delivers TypeScript MCP server features end-to-end across contracts, schemas, handlers, registration, tests, and package validation. Use when implementing or extending a feature, especially through /task or feature-developer.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature Delivery (mcp-ts)
|
|
7
|
+
|
|
8
|
+
1. Read brief, AC, and decomposition.
|
|
9
|
+
2. Follow `feature-delivery-workflow.mdc` + `reference-features.mdc`: contract → schema → handler → register → unit/contract tests → package validation.
|
|
10
|
+
3. Keep transport/lifecycle in the entry module; tools stay in registration modules.
|
|
11
|
+
4. After TS edits: **invoke** `post-change-test.mdc` (+ `mcp-ts-tooling.mdc`).
|
|
12
|
+
|
|
13
|
+
## Do / Don't
|
|
14
|
+
|
|
15
|
+
- **Do** Zod-first authoring with JSON Schema-compatible protocol contracts.
|
|
16
|
+
- **Don't** invent SDK APIs; use VERIFY markers / Context7.
|
|
17
|
+
- **Don't** use Playwright, XCUITest, Next lint, or Go tools as this stack's gate.
|
|
18
|
+
|
|
19
|
+
## Scope discipline
|
|
20
|
+
|
|
21
|
+
Implement only the current AC / decomposition task. See `feature-developer` → **Zero improvisation**.
|
|
22
|
+
|
|
23
|
+
## Handoff
|
|
24
|
+
|
|
25
|
+
Summarize by layer + validation. Update `.cursor/team/tasks/<slug>/status.json`.
|
|
26
|
+
|
|
27
|
+
## Design guidance
|
|
28
|
+
|
|
29
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unit-testing
|
|
3
|
+
description: Plans and writes unit tests for MCP schemas and handlers using the repository test runner. Use for schema/handler coverage and fixing failing unit tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unit testing (mcp-ts)
|
|
7
|
+
|
|
8
|
+
1. Prefer table-driven tests for schema reject/accept and handler outcomes.
|
|
9
|
+
2. Fake FS/network capabilities — no live MCP client required for unit scope.
|
|
10
|
+
3. Follow `tests-unit.mdc` and `mcp-contract-testing.mdc`.
|
|
11
|
+
4. Discover runner via `mcp-ts-tooling` (Vitest/Jest/node:test).
|
|
12
|
+
|
|
13
|
+
## Out of scope (Phase 1)
|
|
14
|
+
|
|
15
|
+
- Dedicated `contract-test-*` agents (Phase 2).
|
|
16
|
+
- Browser e2e (Playwright) — forbidden.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Team artifacts (mcp-ts)
|
|
2
|
+
|
|
3
|
+
| Path | Purpose |
|
|
4
|
+
|------|---------|
|
|
5
|
+
| `tasks/<slug>/` | Pipeline artifacts (`brief.md`, `status.json`, …) |
|
|
6
|
+
| `fixtures/` | Example pipelines for dogfood |
|
|
7
|
+
| `conventions.md` | Living gotchas (consumer-owned) |
|
|
8
|
+
|
|
9
|
+
Phase 1 agents: see `agents/README.md`.
|
|
10
|
+
|
|
11
|
+
## Fixture policy (Phase 1)
|
|
12
|
+
|
|
13
|
+
`team/fixtures/*.json` may list in `skipped[]` **only** agents that exist in the Phase 1 roster:
|
|
14
|
+
|
|
15
|
+
`task-router`, `task-analyst`, `solution-architect`, `feature-developer`, `build-verifier`, `security-reviewer`.
|
|
16
|
+
|
|
17
|
+
Do **not** name Phase 2 agents (`contract-test-*`, `debugger`, Playwright stems, etc.) in fixture JSON — even as skips. Defer those until the agents ship.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Team conventions (mcp-ts)
|
|
2
|
+
|
|
3
|
+
Fill after init with living gotchas for this MCP server repo.
|
|
4
|
+
|
|
5
|
+
## Suggested topics
|
|
6
|
+
|
|
7
|
+
- Package manager + test/typecheck scripts actually used
|
|
8
|
+
- SDK version pin and VERIFY notes
|
|
9
|
+
- stdio entry / `bin` packaging
|
|
10
|
+
- Capability allowlists (FS roots, outbound hosts)
|
|
11
|
+
|
|
12
|
+
## Fixture policy
|
|
13
|
+
|
|
14
|
+
Phase 1 fixtures: `skipped[]` may name only Phase 1 roster agents (see `team/README.md`).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "example-schema-bugfix",
|
|
3
|
+
"intent": "bugfix",
|
|
4
|
+
"profile": "standard",
|
|
5
|
+
"summary": "Fix schema validation rejecting valid tool input",
|
|
6
|
+
"steps": [
|
|
7
|
+
{
|
|
8
|
+
"agent": "task-analyst",
|
|
9
|
+
"label": "Reproduce + AC"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"agent": "feature-developer",
|
|
13
|
+
"label": "Fix schema/handler + tests"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"agent": "build-verifier",
|
|
17
|
+
"label": "typecheck + tests"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"humanGates": [],
|
|
21
|
+
"autoChain": true,
|
|
22
|
+
"skipped": [
|
|
23
|
+
{
|
|
24
|
+
"agent": "security-reviewer",
|
|
25
|
+
"reason": "Proven schema/style-only bugfix — no auth/**, secrets, or FS/net capability change (document skip; otherwise route security-reviewer)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"agent": "solution-architect",
|
|
29
|
+
"reason": "Localized schema bugfix"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "example-add-tool-full",
|
|
3
|
+
"intent": "feature",
|
|
4
|
+
"profile": "full",
|
|
5
|
+
"summary": "Add MCP tool with schema, handler, registration, and tests",
|
|
6
|
+
"steps": [
|
|
7
|
+
{
|
|
8
|
+
"agent": "task-analyst",
|
|
9
|
+
"label": "Brief + decomposition"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"agent": "feature-developer",
|
|
13
|
+
"label": "contract→schema→handler→register→test→package"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"agent": "build-verifier",
|
|
17
|
+
"label": "typecheck + tests"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"agent": "security-reviewer",
|
|
21
|
+
"label": "Capability / secrets review",
|
|
22
|
+
"model": "strong"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"humanGates": ["after:task-analyst"],
|
|
26
|
+
"autoChain": true,
|
|
27
|
+
"skipped": [
|
|
28
|
+
{
|
|
29
|
+
"agent": "solution-architect",
|
|
30
|
+
"reason": "Straightforward tool add; architecture spike not required"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "example-add-tool-light",
|
|
3
|
+
"intent": "feature",
|
|
4
|
+
"profile": "light",
|
|
5
|
+
"summary": "Add a single MCP tool with explicit AC",
|
|
6
|
+
"steps": [
|
|
7
|
+
{
|
|
8
|
+
"agent": "feature-developer",
|
|
9
|
+
"label": "Implement tool schema/handler/register",
|
|
10
|
+
"model": "cheap"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"agent": "build-verifier",
|
|
14
|
+
"label": "typecheck + tests",
|
|
15
|
+
"model": "cheap"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"humanGates": [],
|
|
19
|
+
"autoChain": true,
|
|
20
|
+
"skipped": [
|
|
21
|
+
{
|
|
22
|
+
"agent": "task-analyst",
|
|
23
|
+
"reason": "Explicit AC and single-tool scope"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"agent": "security-reviewer",
|
|
27
|
+
"reason": "Light profile valid only with no FS/net/auth expansion — otherwise use standard/full and include security-reviewer"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"agent": "solution-architect",
|
|
31
|
+
"reason": "Light profile — no architecture spike"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -36,7 +36,7 @@ When validating **preset packaging** changes (paths under `packages/ai-rules/pre
|
|
|
36
36
|
3. **Mapping / README:** `rules/README.md` must include a Cursor→Claude mapping table; document core→stack mapping when `_shared` consumers exist.
|
|
37
37
|
4. **shared-core consumers:** if `_shared/core/**` changed, every file with matching `<!-- shared-core: … -->` in this PR must be updated (or intentional fork documented).
|
|
38
38
|
5. **Twin presence:** Cursor rule change without Claude twin same PR → **FAIL** (next, ios-swift, go, and java). Domain twin body ≥15 lines; thin aliases may be shorter.
|
|
39
|
-
6. **Session-start body budget:** sum body lines of the **3** intended session-start rules ≤ **
|
|
39
|
+
6. **Session-start body budget:** sum body lines of the **3** intended session-start rules ≤ **140** (stretch ≤120); do **not** include `**/README.md` — record in validation-report; FAIL if grossly over.
|
|
40
40
|
7. **Embed drift (hard in `check:preset-structure`):** run `packages/ai-rules/scripts/check-shared-core-drift.sh` with `AI_RULES_DRIFT_FAIL=1` (bundled by the structure orchestrator). Lineage stems excluded from body equality.
|
|
41
41
|
8. **Dogfood (monorepo soft):** prefer `packages/ai-rules/scripts/sync-dogfood-cursor.sh`; mass dogfood deletion without migration doc → risk / FAIL for maintainers.
|
|
42
42
|
|
|
@@ -17,7 +17,8 @@ paths:
|
|
|
17
17
|
|
|
18
18
|
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
19
|
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
20
|
-
- `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
20
|
+
- `go` / `java` / `mcp-ts` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
21
|
+
- `mcp-ts` must not ship Go tool commands (`go test`, `go vet`, `golangci-lint`) or `integration-test-*` agents as required delivery gates.
|
|
21
22
|
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
22
23
|
|
|
23
24
|
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
@@ -46,6 +47,18 @@ Shared backend-stack bans (both `go` and `java`):
|
|
|
46
47
|
|
|
47
48
|
Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`) or `java-tooling` (`mvn test` / `./gradlew test`).
|
|
48
49
|
|
|
50
|
+
## Forbidden in mcp-ts hooks/agents (FAIL)
|
|
51
|
+
|
|
52
|
+
Same UI/mobile bans as backend stacks, plus:
|
|
53
|
+
|
|
54
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
55
|
+
- Positive yarn recipes `lint:js` / `lint:css` as required gates
|
|
56
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
57
|
+
- Go tool commands as required MCP delivery gates: `go test`, `go vet`, `golangci-lint`
|
|
58
|
+
- Agent files: `playwright-test-*`, `xcuitest-test-*`, `integration-test-*`, `accessibility-reviewer`
|
|
59
|
+
|
|
60
|
+
Required instead: package-manager–discovered typecheck/test (`mcp-ts-tooling`, `post-change-test`); Phase 1 gates `build-verifier` + `security-reviewer`.
|
|
61
|
+
|
|
49
62
|
## Soft / document
|
|
50
63
|
|
|
51
64
|
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
@@ -53,4 +66,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` plus
|
|
|
53
66
|
|
|
54
67
|
## Chain fork
|
|
55
68
|
|
|
56
|
-
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `
|
|
69
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, `java`, and `mcp-ts` (per platform).
|
|
@@ -22,7 +22,7 @@ paths:
|
|
|
22
22
|
|
|
23
23
|
**Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
|
|
24
24
|
|
|
25
|
-
Session-start body budget (где задокументировано): ≤
|
|
25
|
+
Session-start body budget (где задокументировано): ≤140 строк суммарно (stretch ≤120).
|
|
26
26
|
|
|
27
27
|
## Meta / author rules
|
|
28
28
|
|
|
@@ -21,6 +21,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
21
21
|
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
22
22
|
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
23
23
|
| `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
|
|
24
|
+
| `mcp-ts` | `presets/cursor/mcp-ts/rules/*.mdc` | `presets/claude/mcp-ts/rules/<topic>/` | Keep in `claude/mcp-ts/rules/README.md` |
|
|
24
25
|
|
|
25
26
|
## Same-PR checklist
|
|
26
27
|
|
|
@@ -40,5 +41,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
40
41
|
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
41
42
|
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
42
43
|
- **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
|
|
44
|
+
- **mcp-ts:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go / java; mapping table required).
|
|
43
45
|
|
|
44
46
|
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
| `architecture-boundaries` | Hexagonal invariants |
|
|
9
9
|
| `code-quality-and-refactoring` | Shared quality + Go notes |
|
|
10
10
|
|
|
11
|
-
**Session-start body budget:** sum of the 3 always-on bodies ≤ **
|
|
11
|
+
**Session-start body budget:** sum of the 3 always-on bodies ≤ **140** lines (stretch ≤120).
|
|
12
12
|
|
|
13
13
|
## Twin depth (Cursor↔Claude)
|
|
14
14
|
|
|
15
15
|
- **Domain** rules: target ≥15 non-empty body lines (FAIL soft when undocumented stubs).
|
|
16
16
|
- **Thin aliases** (may be shorter): `agent-team-intake`, `technical-retro`.
|
|
17
|
-
- **Documented stubs** (checklist-style, expand in consumer Stack notes / target repo): see Catalog **Depth** column (`stub`). High-traffic stems (`domain-layer`, `ports-interfaces`, `adapters-*`, `post-change-test`, `go-tooling`) are expanded to **full** depth.
|
|
17
|
+
- **Documented stubs** (checklist-style, expand in consumer Stack notes / target repo): see Catalog **Depth** column (`stub`). High-traffic stems (`domain-layer`, `ports-interfaces`, `adapters-*`, `application-usecases`, `composition-root`, `persistence-adapters`, `tests-integration`, `security-go`, `post-change-test`, `go-tooling`) are expanded to **full** depth.
|
|
18
18
|
|
|
19
19
|
## Loading strategy
|
|
20
20
|
|
|
@@ -71,21 +71,21 @@ Claude twins + Cursor→Claude map: `presets/claude/go/rules/README.md`. Cross-s
|
|
|
71
71
|
| `technical-retro` | thin-alias | |
|
|
72
72
|
| `api-grpc` | stub | optional transport; expand when repo uses gRPC |
|
|
73
73
|
| `domain-layer` | full | high-traffic hexagonal |
|
|
74
|
-
| `application-usecases` |
|
|
74
|
+
| `application-usecases` | full | use-case ports, Forbidden, unit via fakes |
|
|
75
75
|
| `ports-interfaces` | full | high-traffic hexagonal |
|
|
76
76
|
| `adapters-driven` | full | high-traffic hexagonal |
|
|
77
77
|
| `adapters-driving` | full | high-traffic hexagonal |
|
|
78
|
-
| `composition-root` |
|
|
78
|
+
| `composition-root` | full | wire order, shutdown, construction smoke |
|
|
79
79
|
| `api-http` | full | thin handlers, resilience, idempotency/bulkhead |
|
|
80
|
-
| `persistence-adapters` |
|
|
80
|
+
| `persistence-adapters` | full | port contract, no `*sql.DB` leak |
|
|
81
81
|
| `messaging-adapters` | stub | |
|
|
82
82
|
| `module-public-api` | stub | |
|
|
83
83
|
| `go-conventions` | full | errors, interfaces at call site, anti-hallucination |
|
|
84
84
|
| `go-tooling` | full | requestable toolchain |
|
|
85
85
|
| `post-change-test` | full | requestable gate |
|
|
86
|
-
| `security-go` |
|
|
86
|
+
| `security-go` | full | redact, fail-closed auth, secret tests |
|
|
87
87
|
| `tests-unit` | stub | |
|
|
88
|
-
| `tests-integration` |
|
|
89
|
-
| `tests-e2e` | stub |
|
|
88
|
+
| `tests-integration` | full | repo contract vs httptest; isolation |
|
|
89
|
+
| `tests-e2e` | stub | scoped smoke banner; prefer integration-test-* |
|
|
90
90
|
|
|
91
91
|
**Всего topic `.mdc`:** 27 domain + 5 preset-meta (без README) = 32.
|
|
@@ -6,25 +6,29 @@ globs:
|
|
|
6
6
|
alwaysApply: false
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Application / use cases
|
|
11
10
|
|
|
12
11
|
- One use case ≈ one application service method (command/query).
|
|
13
12
|
- Depend on **outbound ports** (interfaces), not concrete repos/clients.
|
|
14
13
|
- Orchestrate domain; transaction boundaries via ports (`UnitOfWork`) when needed — still no SQL here.
|
|
15
14
|
- Accept `context.Context` on public methods; propagate to ports.
|
|
15
|
+
- Input/output types stay in application or domain — never handler DTOs, `http.Request`, or SQL row types.
|
|
16
16
|
|
|
17
17
|
## Forbidden
|
|
18
18
|
|
|
19
|
-
- Importing `adapters/*`, SQL drivers, HTTP frameworks.
|
|
20
|
-
- Embedding `*sql.DB`, Redis clients, or handler types in use-case structs.
|
|
21
|
-
- Business rules that belong in domain entities (keep use cases thin).
|
|
19
|
+
- Importing `adapters/*`, SQL drivers, HTTP/gRPC frameworks, broker clients.
|
|
20
|
+
- Embedding `*sql.DB`, Redis/Kafka clients, or handler types in use-case structs.
|
|
21
|
+
- Business rules that belong in domain entities (keep use cases thin orchestrators).
|
|
22
|
+
- Starting DB transactions with concrete `*sql.Tx` — call a port (`UnitOfWork` / `Transactional`).
|
|
22
23
|
|
|
23
24
|
## Structure
|
|
24
25
|
|
|
25
26
|
- Prefer `application/<usecase>.go` + `ports.go` (or `ports/`) colocated.
|
|
26
27
|
- Inbound port = interface the driving adapter calls (optional if use-case struct is the API).
|
|
28
|
+
- Map transport/persistence errors at adapters; use cases return domain/application errors.
|
|
27
29
|
|
|
28
30
|
## Tests
|
|
29
31
|
|
|
30
|
-
-
|
|
32
|
+
- Fake/mock **outbound ports** only; assert domain outcomes and port interactions — no real DB.
|
|
33
|
+
- Table-driven cases for validation/branching; inject clock/ID seams when time/IDs matter.
|
|
34
|
+
- After edits: `post-change-test` (+ `go-tooling`).
|
|
@@ -24,6 +24,12 @@ alwaysApply: true
|
|
|
24
24
|
- Domain never imports adapters or frameworks.
|
|
25
25
|
- Cross-feature access — only via public ports / `pkg` API, not deep imports of another feature's internals.
|
|
26
26
|
|
|
27
|
+
# Edit bundles (load on matching paths)
|
|
28
|
+
|
|
29
|
+
- `**/domain/**` → `domain-layer`; `**/application/**` → `application-usecases` + `ports-interfaces`
|
|
30
|
+
- Driving HTTP/gRPC → `adapters-driving` + `api-http` / `api-grpc`; persistence/messaging → `adapters-driven` + matching `*-adapters`
|
|
31
|
+
- `cmd/**`, `internal/app/**` → `composition-root`; after `*.go` edits → `post-change-test` (+ `go-tooling`)
|
|
32
|
+
|
|
27
33
|
# Требование к агенту
|
|
28
34
|
|
|
29
35
|
- Класть файлы в правильный слой; не «коротить» слои ради скорости.
|
|
@@ -6,24 +6,29 @@ globs:
|
|
|
6
6
|
alwaysApply: false
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Composition root
|
|
11
10
|
|
|
12
|
-
- Construct adapters
|
|
13
|
-
- Wire interfaces to implementations explicitly (manual DI preferred unless repo already uses a container).
|
|
14
|
-
- Load config once; fail fast on missing required settings.
|
|
15
|
-
- Lifecycle:
|
|
11
|
+
- Construct adapters → use cases → servers in `cmd/<service>` and/or `internal/app`.
|
|
12
|
+
- Wire interfaces to implementations explicitly (manual DI preferred unless the repo already uses a container).
|
|
13
|
+
- Load config once; **fail fast** on missing required settings before opening listeners or connections.
|
|
14
|
+
- Lifecycle: cancel root `context` → drain in-flight work → `Shutdown` servers → close driven adapters (DB/pool/clients) in reverse wire order.
|
|
16
15
|
|
|
17
16
|
## Allowed here
|
|
18
17
|
|
|
19
|
-
- Import all layers for wiring only
|
|
20
|
-
- Process-wide loggers/metrics providers.
|
|
18
|
+
- Import all layers **for wiring only**.
|
|
19
|
+
- Process-wide loggers/metrics providers constructed once and injected.
|
|
21
20
|
|
|
22
21
|
## Forbidden
|
|
23
22
|
|
|
24
23
|
- Business rules, SQL queries, HTTP routing tables with domain logic.
|
|
25
|
-
- Global mutable singletons for repos without clear init (prefer explicit deps).
|
|
24
|
+
- Global mutable singletons for repos without clear init (prefer explicit constructor deps).
|
|
25
|
+
- Starting background workers without tying them to the root context / shutdown path.
|
|
26
|
+
|
|
27
|
+
## Agent handoffs
|
|
28
|
+
|
|
29
|
+
- After wiring changes: `post-change-test` (+ `go-tooling`) — at least compile / construction smoke.
|
|
30
|
+
- Layer checklist: `feature-delivery-workflow` (domain → ports → adapters → wire).
|
|
26
31
|
|
|
27
32
|
## Tests
|
|
28
33
|
|
|
29
|
-
- Optional smoke that wiring builds
|
|
34
|
+
- Optional construction/smoke test that `NewApp`/`main` wiring builds; heavy logic stays in unit/integration tests.
|
|
@@ -6,24 +6,27 @@ globs:
|
|
|
6
6
|
alwaysApply: false
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Persistence adapters
|
|
11
10
|
|
|
12
11
|
- Implement outbound repository ports from application.
|
|
13
|
-
- Use parameterized queries; map rows → domain entities inside the adapter.
|
|
12
|
+
- Use **parameterized** queries; map rows → domain entities **inside** the adapter.
|
|
14
13
|
- Transactions: expose via port (`Transactional`, `UnitOfWork`) implemented here — use cases call the port, not `*sql.Tx` directly.
|
|
15
|
-
- Migrations live with infra (separate package/dir) — not in domain.
|
|
14
|
+
- Migrations live with infra (separate package/dir) — not in domain or application.
|
|
16
15
|
|
|
17
16
|
## Mapping
|
|
18
17
|
|
|
19
18
|
- Persistence models (db tags) stay private to the adapter package when possible.
|
|
20
|
-
- Nullability and DB defaults
|
|
19
|
+
- Nullability, zero values, and DB defaults convert to domain values explicitly (no silent zero-value domain objects).
|
|
20
|
+
- Port methods return domain/application errors — never leak driver-specific types through the port.
|
|
21
21
|
|
|
22
22
|
## Forbidden
|
|
23
23
|
|
|
24
|
-
- Importing persistence from domain or leaking `*sql.DB` through port APIs.
|
|
25
|
-
- Building SQL strings in use cases.
|
|
24
|
+
- Importing persistence from domain or leaking `*sql.DB` / ORM handles through port APIs.
|
|
25
|
+
- Building SQL strings in use cases or handlers.
|
|
26
|
+
- Returning scan structs / `sql.Null*` types across the port boundary.
|
|
26
27
|
|
|
27
28
|
## Tests
|
|
28
29
|
|
|
29
|
-
- Integration
|
|
30
|
+
- Integration: repository **contract** round-trip (save → load → error/not-found) against testcontainers / repo-standard test DB.
|
|
31
|
+
- Unit-test mappers with fixtures; do **not** substitute `httptest` for a repository contract.
|
|
32
|
+
- Agents: `integration-test-{planner,generator,healer}` + skill `integration-testing`; then `post-change-test`.
|
|
@@ -17,7 +17,8 @@ alwaysApply: false
|
|
|
17
17
|
|
|
18
18
|
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
19
|
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
20
|
-
- `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
20
|
+
- `go` / `java` / `mcp-ts` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
21
|
+
- `mcp-ts` must not ship Go tool commands (`go test`, `go vet`, `golangci-lint`) or `integration-test-*` agents as required delivery gates.
|
|
21
22
|
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
22
23
|
|
|
23
24
|
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
@@ -46,6 +47,18 @@ Shared backend-stack bans (both `go` and `java`):
|
|
|
46
47
|
|
|
47
48
|
Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`) or `java-tooling` (`mvn test` / `./gradlew test`).
|
|
48
49
|
|
|
50
|
+
## Forbidden in mcp-ts hooks/agents (FAIL)
|
|
51
|
+
|
|
52
|
+
Same UI/mobile bans as backend stacks, plus:
|
|
53
|
+
|
|
54
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
55
|
+
- Positive yarn recipes `lint:js` / `lint:css` as required gates
|
|
56
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
57
|
+
- Go tool commands as required MCP delivery gates: `go test`, `go vet`, `golangci-lint`
|
|
58
|
+
- Agent files: `playwright-test-*`, `xcuitest-test-*`, `integration-test-*`, `accessibility-reviewer`
|
|
59
|
+
|
|
60
|
+
Required instead: package-manager–discovered typecheck/test (`mcp-ts-tooling`, `post-change-test`); Phase 1 gates `build-verifier` + `security-reviewer`.
|
|
61
|
+
|
|
49
62
|
## Soft / document
|
|
50
63
|
|
|
51
64
|
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
@@ -53,4 +66,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` plus
|
|
|
53
66
|
|
|
54
67
|
## Chain fork
|
|
55
68
|
|
|
56
|
-
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `
|
|
69
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, `java`, and `mcp-ts` (per platform).
|
|
@@ -22,7 +22,7 @@ alwaysApply: false
|
|
|
22
22
|
|
|
23
23
|
**Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
|
|
24
24
|
|
|
25
|
-
Session-start body budget (где задокументировано): ≤
|
|
25
|
+
Session-start body budget (где задокументировано): ≤140 строк суммарно (stretch ≤120).
|
|
26
26
|
|
|
27
27
|
## Meta / author rules
|
|
28
28
|
|
|
@@ -21,6 +21,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
21
21
|
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
22
22
|
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
23
23
|
| `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
|
|
24
|
+
| `mcp-ts` | `presets/cursor/mcp-ts/rules/*.mdc` | `presets/claude/mcp-ts/rules/<topic>/` | Keep in `claude/mcp-ts/rules/README.md` |
|
|
24
25
|
|
|
25
26
|
## Same-PR checklist
|
|
26
27
|
|
|
@@ -40,5 +41,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
40
41
|
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
41
42
|
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
42
43
|
- **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
|
|
44
|
+
- **mcp-ts:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go / java; mapping table required).
|
|
43
45
|
|
|
44
46
|
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -7,17 +7,29 @@ globs:
|
|
|
7
7
|
alwaysApply: false
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
# Security (Go)
|
|
12
11
|
|
|
13
|
-
- Secrets from env/secret manager — never commit keys;
|
|
12
|
+
- Secrets from env/secret manager — never commit keys; **never log** tokens, passwords, raw `Authorization` headers, or cookie values.
|
|
14
13
|
- Validate and canonicalize untrusted input at the driving adapter edge.
|
|
15
14
|
- Prefer prepared statements / parameterized queries in persistence adapters.
|
|
16
15
|
- TLS and secure cookie/header defaults when exposing HTTP.
|
|
17
16
|
- AuthN/AuthZ in middleware or driving adapters; pass identity into use cases as domain value (user ID / claims), not raw headers.
|
|
18
|
-
- Minimize PII in logs; redact
|
|
17
|
+
- Minimize PII in structured logs; redact known sensitive fields by default.
|
|
19
18
|
|
|
20
19
|
## Config
|
|
21
20
|
|
|
22
|
-
- Distinguish public vs secret config fields in types.
|
|
23
|
-
- Fail closed when auth is misconfigured in production builds.
|
|
21
|
+
- Distinguish public vs secret config fields in types (separate structs or tagged fields).
|
|
22
|
+
- **Fail closed** when auth is misconfigured in production builds (missing issuer/JWKS/secret → refuse to start or reject requests).
|
|
23
|
+
- Sample configs and README snippets must use placeholders — never real-looking secrets.
|
|
24
|
+
|
|
25
|
+
## Forbidden
|
|
26
|
+
|
|
27
|
+
- Hardcoded API keys/tokens in source or committed `.env` examples with live values.
|
|
28
|
+
- Logging request/response bodies that may contain credentials without an explicit redact step.
|
|
29
|
+
- Fail-open auth middleware when required validators are nil/empty in prod.
|
|
30
|
+
|
|
31
|
+
## Tests
|
|
32
|
+
|
|
33
|
+
- Negative assertions: logs/metrics fixtures must not contain bearer tokens or secret config values.
|
|
34
|
+
- Missing/invalid auth config fails closed in a construction or middleware test.
|
|
35
|
+
- Agents: `security-reviewer` on auth/config/logging changes; then `post-change-test`.
|
|
@@ -6,14 +6,16 @@ globs:
|
|
|
6
6
|
alwaysApply: false
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# E2E / HTTP smoke
|
|
11
10
|
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
11
|
+
> **Documented stub / scoped smoke:** Prefer `tests-integration` + `integration-test-*` for breadth. Expand this rule only when the consumer repo keeps a dedicated black-box smoke suite.
|
|
12
|
+
|
|
13
|
+
- Black-box against a running server (`httptest` with full composition root, or localhost in CI).
|
|
14
|
+
- Cover critical paths only; prefer integration + unit for most coverage.
|
|
15
|
+
- Stable test data; avoid wall-clock flakiness and shared mutable fixtures.
|
|
16
|
+
- Do **not** use browser/Playwright tooling in this preset (`preset-no-cross-stack-leakage`).
|
|
16
17
|
|
|
17
18
|
## Placement
|
|
18
19
|
|
|
19
|
-
- `e2e/` package or `*_e2e_test.go` with build tags if
|
|
20
|
+
- `e2e/` package or `*_e2e_test.go` with build tags if the repo already separates smoke CI.
|
|
21
|
+
- If smoke overlaps repository contracts, put the contract under `tests-integration` instead.
|
|
@@ -6,19 +6,25 @@ globs:
|
|
|
6
6
|
alwaysApply: false
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Integration tests
|
|
11
10
|
|
|
12
11
|
- Exercise driven adapters against real infra doubles (testcontainers, docker compose test DB, miniredis, etc.).
|
|
13
12
|
- Or exercise HTTP adapter with `httptest` + wired use case + fake/real ports — still no full prod cluster required.
|
|
14
|
-
- Build tags (`//go:build integration`)
|
|
15
|
-
- Keep fixtures deterministic; clean up data between tests.
|
|
13
|
+
- Build tags (`//go:build integration`) when the repo separates CI jobs — discover the existing CI entrypoint; do not invent a second runner.
|
|
14
|
+
- Keep fixtures deterministic; clean up / isolate data between tests (truncate, transaction rollback, or unique prefixes).
|
|
16
15
|
|
|
17
16
|
## Scope
|
|
18
17
|
|
|
19
|
-
- Contract of a port implementation (repo save/load
|
|
20
|
-
-
|
|
18
|
+
- **Contract of a port implementation** (repo save/load/error round-trip) — assert semantics at the port, not only SQL rows.
|
|
19
|
+
- HTTP adapter contract with `httptest` is valid **adapter** integration — it is **not** a substitute for a repository contract test.
|
|
20
|
+
- Not a substitute for domain unit tests (table-driven domain logic stays in `tests-unit`).
|
|
21
|
+
|
|
22
|
+
## Forbidden shortcuts
|
|
23
|
+
|
|
24
|
+
- Fake-only “integration” that never crosses the adapter↔infra boundary for the port under test.
|
|
25
|
+
- Skipping isolation so tests pass only in isolation or only on a dirty DB.
|
|
21
26
|
|
|
22
27
|
## Agents
|
|
23
28
|
|
|
24
29
|
- Planning/generation: `integration-test-{planner,generator,healer}` + skill `integration-testing`.
|
|
30
|
+
- After green tests: `post-change-test` (+ `go-tooling`).
|
|
@@ -38,7 +38,7 @@ When validating **ios-swift preset** changes (or `scope: preset-structure-valida
|
|
|
38
38
|
6. **Twin presence (hard):** Cursor rule change → Claude twin present **same PR** — **FAIL** if missing (next, ios-swift, go, and java).
|
|
39
39
|
7. **Mapping / README:** `claude/ios-swift/rules/README.md` mapping table present; core→stack mapping documented when `_shared` consumers exist.
|
|
40
40
|
8. **shared-core consumers:** if `_shared/core/**` changed, every matching `<!-- shared-core: … -->` consumer in this PR must be updated (or intentional fork documented).
|
|
41
|
-
9. **Session-start body budget:** sum of the **3** intended always-on / session-start rule bodies ≤ **
|
|
41
|
+
9. **Session-start body budget:** sum of the **3** intended always-on / session-start rule bodies ≤ **140** lines (stretch ≤120); do **not** include `**/README.md` — record in report.
|
|
42
42
|
10. **Embed drift (hard in `check:preset-structure`):** `packages/ai-rules/scripts/check-shared-core-drift.sh` with `AI_RULES_DRIFT_FAIL=1`.
|
|
43
43
|
11. **Dogfood (monorepo soft):** `packages/ai-rules/scripts/sync-dogfood-cursor.sh`; mass deletion without migration doc → risk / FAIL for maintainers.
|
|
44
44
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
### Пресет ios-swift — карта правил
|
|
15
15
|
|
|
16
|
-
**alwaysApply budget:** **≤3** always-on правила и **≤
|
|
16
|
+
**alwaysApply budget:** **≤3** always-on правила и **≤140** строк тела (после YAML) суммарно (stretch ≤120). Новые alwaysApply только вместе с сокращением существующего бюджета.
|
|
17
17
|
|
|
18
18
|
| Файл | Скоуп | Тема |
|
|
19
19
|
|------|--------|------|
|