@bonesofspring/ai-rules 0.2.3 → 0.2.5
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 +2 -0
- package/README.md +4 -3
- package/bin/cli.js +29 -3
- package/package.json +1 -1
- package/presets/claude/ios-swift/CLAUDE.md +1 -1
- package/presets/claude/ios-swift/MCP.md +14 -0
- package/presets/claude/ios-swift/README.md +2 -0
- package/presets/claude/ios-swift/agents/README.md +16 -2
- package/presets/claude/ios-swift/agents/migration-specialist.md +1 -1
- package/presets/claude/ios-swift/agents/performance-auditor.md +1 -1
- package/presets/claude/ios-swift/agents/security-reviewer.md +1 -1
- package/presets/claude/ios-swift/agents/solution-architect.md +1 -1
- package/presets/claude/ios-swift/agents/task-router.md +10 -1
- package/presets/claude/ios-swift/commands/feature-start.md +1 -1
- package/presets/claude/ios-swift/commands/task.md +1 -1
- package/presets/claude/ios-swift/mcp.json +12 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +9 -1
- package/presets/claude/ios-swift/team/fixtures/feature-full.json +8 -25
- package/presets/claude/ios-swift/team/fixtures/feature-light.json +5 -20
- package/presets/claude/next/CLAUDE.md +1 -1
- package/presets/claude/next/MCP.md +16 -0
- package/presets/claude/next/README.md +2 -0
- package/presets/claude/next/agents/README.md +38 -4
- package/presets/claude/next/agents/migration-specialist.md +1 -1
- package/presets/claude/next/agents/performance-auditor.md +1 -1
- package/presets/claude/next/agents/security-reviewer.md +1 -1
- package/presets/claude/next/agents/solution-architect.md +1 -1
- package/presets/claude/next/agents/task-router.md +16 -2
- package/presets/claude/next/commands/feature-start.md +1 -1
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/next/mcp.json +20 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +16 -2
- package/presets/claude/next/team/fixtures/feature-full.json +4 -2
- package/presets/claude/next/team/fixtures/feature-light.json +2 -2
- package/presets/cursor/ios-swift/AGENTS.md +1 -1
- package/presets/cursor/ios-swift/MCP.md +16 -0
- package/presets/cursor/ios-swift/README.md +1 -0
- package/presets/cursor/ios-swift/agents/README.md +16 -2
- package/presets/cursor/ios-swift/agents/migration-specialist.md +1 -1
- package/presets/cursor/ios-swift/agents/performance-auditor.md +1 -1
- package/presets/cursor/ios-swift/agents/security-reviewer.md +1 -1
- package/presets/cursor/ios-swift/agents/solution-architect.md +1 -1
- package/presets/cursor/ios-swift/agents/task-router.md +10 -1
- package/presets/cursor/ios-swift/commands/feature-start.md +1 -1
- package/presets/cursor/ios-swift/commands/task.md +1 -1
- package/presets/cursor/ios-swift/mcp.json +11 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +14 -1
- package/presets/cursor/ios-swift/team/README.md +4 -0
- package/presets/cursor/ios-swift/team/fixtures/feature-full.json +8 -25
- package/presets/cursor/ios-swift/team/fixtures/feature-light.json +6 -25
- package/presets/cursor/next/AGENTS.md +1 -1
- package/presets/cursor/next/MCP.md +16 -0
- package/presets/cursor/next/agents/README.md +39 -4
- package/presets/cursor/next/agents/migration-specialist.md +1 -1
- package/presets/cursor/next/agents/performance-auditor.md +1 -1
- package/presets/cursor/next/agents/playwright-test-generator.md +1 -1
- package/presets/cursor/next/agents/playwright-test-healer.md +1 -1
- package/presets/cursor/next/agents/security-reviewer.md +1 -1
- package/presets/cursor/next/agents/solution-architect.md +1 -1
- package/presets/cursor/next/agents/task-router.md +16 -2
- package/presets/cursor/next/commands/feature-start.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/next/mcp.json +19 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +16 -0
- package/presets/cursor/next/team/README.md +4 -0
- package/presets/cursor/next/team/fixtures/feature-full.json +4 -2
- package/presets/cursor/next/team/fixtures/feature-light.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
+
- **MCP configs in presets** (`next` + `ios-swift`, Cursor + Claude): `mcp.json` + `MCP.md`. Cursor → `.cursor/mcp.json`; Claude → project-root `.mcp.json`. **next:** Context7, Playwright, Chrome DevTools, Figma (remote). **ios-swift:** Context7 + Figma. CLI `init`/`clean` manage these paths.
|
|
12
13
|
- **Cursor + Claude `ios-swift` — full agent-team parity with `next`:** **21** agents (Playwright trio → `xcuitest-test-{planner,generator,healer}`), **7** skills (`xcuitest-e2e`), **5** slash commands, `hooks.json` + iOS-adapted `chain-team-phases.sh` (Cursor) / hook scripts + README (Claude), `team/fixtures/` ×3, `AGENTS.md` (Cursor) / thin `CLAUDE.md` (≤35 lines).
|
|
13
14
|
- **ios-swift rules:** agent-team intake/orchestrator, `xcode-tooling`, `reference-features`, domain rules (`navigation-coordinators`, `persistence-data`, `security-ios`, `module-public-api`), `technical-retro` alias; **21** rule topics (+ README). CLI init copies agents, hooks, skills, team, `AGENTS.md`.
|
|
14
15
|
- **ios-swift retro follow-ups:** `build-verifier` preset checks (chain ≠ next; ban Playwright/`lint:js` handoffs); enriched 16 priority agent prompts + 6 skills; dogfood checklist (5 scenarios) in `AGENTS.md` / `reference-features`; Cursor-only **`BUGBOT.md`** (iOS review priorities).
|
|
15
16
|
|
|
16
17
|
### Changed
|
|
17
18
|
|
|
19
|
+
- **Agent team slug bootstrap:** `/task` and `/feature-start` (Cursor + Claude, `next` + `ios-swift`) create `.cursor|claude/team/tasks/<slug>/` via **Write**, not Shell `mkdir` — avoids Cursor sandbox `Operation not permitted` (esp. macOS Desktop/Documents). Orchestrator + `team/README` + `task-router` document the rule.
|
|
18
20
|
- **Token model (ios-swift + next):** both presets use **3** alwaysApply / session-start rules (~77 / ~59 body lines). Post-change verification is **requestable** — ios: `post-change-build`; next: `post-change-lint`. Orchestrator, intake, code-review, feature-delivery, tooling rules load on-demand (`paths:` / description).
|
|
19
21
|
- Claude `next`: `agent-team-orchestrator` and `code-review-mr` use `paths:` (on-demand) — session-start matches the 3-rule budget above.
|
|
20
22
|
- Cursor `next` agents: all pipeline agents set **`readonly: false`** so they can write `.cursor/team/**`. Production/app restrictions remain in prompt bodies (Cursor `readonly: true` blocks all file writes, including team artifacts).
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bonesofspring/ai-rules
|
|
2
2
|
|
|
3
|
-
Presets for Cursor and Claude Code: rules, commands, plus optional `agents`, `hooks`, `skills`,
|
|
3
|
+
Presets for Cursor and Claude Code: rules, commands, plus optional `agents`, `hooks`, `skills`, team artifacts, and MCP configs when the preset includes them. For Claude: `CLAUDE.md`. Install from npm into a project so you don’t have to copy files out of the repo by hand.
|
|
4
4
|
|
|
5
5
|
Node 18+.
|
|
6
6
|
|
|
@@ -30,8 +30,8 @@ If `.cursor` does not appear, check the command output for errors and confirm yo
|
|
|
30
30
|
|
|
31
31
|
- `rules/`, `commands/`
|
|
32
32
|
- optional dirs when present: `agents/`, `hooks/`, `skills/`, `team/`
|
|
33
|
-
- Cursor root files: `hooks.json`, `BUGBOT.md`, `AGENTS.md`
|
|
34
|
-
- Claude
|
|
33
|
+
- Cursor root files: `hooks.json`, `BUGBOT.md`, `AGENTS.md`, `MCP.md`, `mcp.json`
|
|
34
|
+
- Claude: `CLAUDE.md`, `MCP.md` under `.claude/`; project `.mcp.json` at repo root
|
|
35
35
|
|
|
36
36
|
Any other files you added under `.cursor/` or `.claude/` (notes, local overrides, IDE state) are **left intact**. Older releases that deleted the whole tool directory are no longer the behavior.
|
|
37
37
|
|
|
@@ -45,6 +45,7 @@ Where things go on `init`:
|
|
|
45
45
|
| hooks | `.cursor/hooks`, `.cursor/hooks.json` | `.claude/hooks` |
|
|
46
46
|
| skills | `.cursor/skills` | `.claude/skills` |
|
|
47
47
|
| team artifacts template | `.cursor/team` | `.claude/team` |
|
|
48
|
+
| MCP | `mcp.json` → `.cursor/mcp.json`, `MCP.md` → `.cursor/` | `mcp.json` → **`.mcp.json`** (project root), `MCP.md` → `.claude/` |
|
|
48
49
|
| other | `BUGBOT.md`, `AGENTS.md` → `.cursor/` | `CLAUDE.md` → `.claude/CLAUDE.md` |
|
|
49
50
|
|
|
50
51
|
The package ships presets including **`next`** (Next.js stack) and **`ios-swift`** (iOS apps on Swift / SwiftUI). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
|
package/bin/cli.js
CHANGED
|
@@ -17,7 +17,10 @@ const PRESETS = {
|
|
|
17
17
|
relBase: ['presets', 'cursor'],
|
|
18
18
|
optionalCursorDirs: ['agents', 'hooks', 'skills', 'team'],
|
|
19
19
|
hooksJsonSrc: 'hooks.json',
|
|
20
|
-
|
|
20
|
+
/** Project MCP → `.cursor/mcp.json` */
|
|
21
|
+
mcpJsonSrc: 'mcp.json',
|
|
22
|
+
mcpJsonDest: '.cursor/mcp.json',
|
|
23
|
+
toolRootFiles: ['BUGBOT.md', 'AGENTS.md', 'MCP.md'],
|
|
21
24
|
},
|
|
22
25
|
claude: {
|
|
23
26
|
rulesDir: '.claude/rules',
|
|
@@ -25,6 +28,10 @@ const PRESETS = {
|
|
|
25
28
|
relBase: ['presets', 'claude'],
|
|
26
29
|
optionalClaudeDirs: ['skills', 'agents', 'hooks', 'team'],
|
|
27
30
|
claudeMdSrc: 'CLAUDE.md',
|
|
31
|
+
/** Project MCP lives at repo root (Claude Code project scope), not under `.claude/`. */
|
|
32
|
+
mcpJsonSrc: 'mcp.json',
|
|
33
|
+
mcpJsonDest: '.mcp.json',
|
|
34
|
+
toolRootFiles: ['MCP.md'],
|
|
28
35
|
},
|
|
29
36
|
};
|
|
30
37
|
|
|
@@ -50,8 +57,8 @@ Options:
|
|
|
50
57
|
|
|
51
58
|
Notes:
|
|
52
59
|
init merges into the target directory; same-named files are overwritten.
|
|
53
|
-
Cursor init copies rules, commands, agents, hooks, skills, team, hooks.json, BUGBOT.md, AGENTS.md.
|
|
54
|
-
Claude init copies rules, commands, skills, agents, hooks, team,
|
|
60
|
+
Cursor init copies rules, commands, agents, hooks, skills, team, hooks.json, BUGBOT.md, AGENTS.md, MCP.md, mcp.json → .cursor/mcp.json.
|
|
61
|
+
Claude init copies rules, commands, skills, agents, hooks, team, CLAUDE.md, MCP.md, and mcp.json → .mcp.json (project root).
|
|
55
62
|
Command forms: "init cursor --preset next", "init cursor next", "--preset next init cursor", "cursor init --preset next".
|
|
56
63
|
|
|
57
64
|
Examples:
|
|
@@ -238,6 +245,9 @@ function presetHasAnySource(base, cfg) {
|
|
|
238
245
|
if (cfg.hooksJsonSrc && fs.existsSync(path.join(base, cfg.hooksJsonSrc))) {
|
|
239
246
|
return true;
|
|
240
247
|
}
|
|
248
|
+
if (cfg.mcpJsonSrc && fs.existsSync(path.join(base, cfg.mcpJsonSrc))) {
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
241
251
|
for (const name of cfg.toolRootFiles || []) {
|
|
242
252
|
if (fs.existsSync(path.join(base, name))) {
|
|
243
253
|
return true;
|
|
@@ -355,6 +365,17 @@ function cmdInit(tool, preset, cwdOption) {
|
|
|
355
365
|
}
|
|
356
366
|
}
|
|
357
367
|
|
|
368
|
+
if (cfg.mcpJsonSrc && cfg.mcpJsonDest) {
|
|
369
|
+
const mcpFrom = path.join(base, cfg.mcpJsonSrc);
|
|
370
|
+
if (fs.existsSync(mcpFrom)) {
|
|
371
|
+
const mcpDestAbs = path.join(cwd, cfg.mcpJsonDest);
|
|
372
|
+
fs.mkdirSync(path.dirname(mcpDestAbs), { recursive: true });
|
|
373
|
+
fs.copyFileSync(mcpFrom, mcpDestAbs);
|
|
374
|
+
console.log(`Copied ${cfg.mcpJsonSrc} → ${cfg.mcpJsonDest}`);
|
|
375
|
+
copiedSteps++;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
358
379
|
for (const name of cfg.toolRootFiles || []) {
|
|
359
380
|
const from = path.join(base, name);
|
|
360
381
|
if (fs.existsSync(from)) {
|
|
@@ -411,6 +432,11 @@ function cmdClean(tool, cwdOption) {
|
|
|
411
432
|
removedParts.push(`${toolRoot}/hooks.json`);
|
|
412
433
|
}
|
|
413
434
|
|
|
435
|
+
if (cfg.mcpJsonDest) {
|
|
436
|
+
removeFileIfExists(path.join(cwd, cfg.mcpJsonDest));
|
|
437
|
+
removedParts.push(cfg.mcpJsonDest);
|
|
438
|
+
}
|
|
439
|
+
|
|
414
440
|
for (const name of cfg.toolRootFiles || []) {
|
|
415
441
|
removeFileIfExists(path.join(cwd, toolRoot, name));
|
|
416
442
|
removedParts.push(`${toolRoot}/${name}`);
|
package/package.json
CHANGED
|
@@ -32,4 +32,4 @@ See @rules/README.md for mapping and loading strategy.
|
|
|
32
32
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `skills/**`, `hooks/**`, `team
|
|
35
|
+
Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `skills/**`, `hooks/**`, `team/**`, `MCP.md` в `.claude/`, плюс `mcp.json` → **`.mcp.json`** в корне.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# MCP (preset `ios-swift`, Claude Code)
|
|
2
|
+
|
|
3
|
+
Копируется в **корень проекта** как `.mcp.json` при `ai-rules init claude --preset ios-swift`.
|
|
4
|
+
|
|
5
|
+
## Servers
|
|
6
|
+
|
|
7
|
+
| Name | Package | Зачем |
|
|
8
|
+
|------|---------|--------|
|
|
9
|
+
| `context7` | `@upstash/context7-mcp` | Актуальная документация Swift / SwiftUI / Apple frameworks |
|
|
10
|
+
| `figma` | remote `https://mcp.figma.com/mcp` | Design context → SwiftUI; OAuth при первом подключении |
|
|
11
|
+
|
|
12
|
+
Playwright / Chrome DevTools не входят в ios-пресет.
|
|
13
|
+
|
|
14
|
+
Секреты не коммитим. Опционально: `CONTEXT7_API_KEY`. Figma — OAuth. Approve project MCP через `/mcp`.
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
| `agents/**` | `.claude/agents/**` (**21**, XCUITest trio) |
|
|
14
14
|
| `hooks/**` | `.claude/hooks/**` (scripts + README; **нет** `hooks.json`) |
|
|
15
15
|
| `team/**` | `.claude/team/**` |
|
|
16
|
+
| `mcp.json` | **`.mcp.json`** в корне (Context7 + Figma) |
|
|
17
|
+
| `MCP.md` | `.claude/MCP.md` |
|
|
16
18
|
|
|
17
19
|
```bash
|
|
18
20
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
@@ -29,6 +29,18 @@ When copying next pipeline templates: put Playwright stems in `skipped` with rea
|
|
|
29
29
|
|
|
30
30
|
Все agents — **`readonly: false`** (нужна запись в `.claude/team/**`). Ограничения production — в теле промпта.
|
|
31
31
|
|
|
32
|
+
## Model matrix (frontmatter `model`)
|
|
33
|
+
|
|
34
|
+
Same tiers as **claude/next**. Defaults in this preset:
|
|
35
|
+
|
|
36
|
+
| Tier | Frontmatter | Agents |
|
|
37
|
+
|------|-------------|--------|
|
|
38
|
+
| **cheap** | `fast` | router, analyst, build-verifier, code-reviewer, tech-writer |
|
|
39
|
+
| **standard** | `inherit` | developer, debugger, ci-investigator, api-contract, a11y, qa, unit-*, xcuitest-* |
|
|
40
|
+
| **strong** | `opus` | solution-architect, migration-specialist, security-reviewer, performance-auditor |
|
|
41
|
+
|
|
42
|
+
Optional `steps[].model`: `cheap` \| `standard` \| `strong`.
|
|
43
|
+
|
|
32
44
|
## Pipeline routing
|
|
33
45
|
|
|
34
46
|
**SoT:** intent table / profiles — **`task-router.md`**. Schema — ниже (same as next).
|
|
@@ -43,8 +55,8 @@ When copying next pipeline templates: put Playwright stems in `skipped` with rea
|
|
|
43
55
|
"steps": [
|
|
44
56
|
{ "agent": "task-analyst", "label": "Clarify and decompose" },
|
|
45
57
|
{ "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
|
|
46
|
-
{ "agent": "build-verifier", "label": "xcodebuild + lint + unit smoke" },
|
|
47
|
-
{ "agent": "code-reviewer", "label": "Code review" }
|
|
58
|
+
{ "agent": "build-verifier", "label": "xcodebuild + lint + unit smoke", "model": "cheap" },
|
|
59
|
+
{ "agent": "code-reviewer", "label": "Code review", "model": "cheap" }
|
|
48
60
|
],
|
|
49
61
|
"humanGates": ["after:task-analyst"],
|
|
50
62
|
"autoChain": true,
|
|
@@ -52,4 +64,6 @@ When copying next pipeline templates: put Playwright stems in `skipped` with rea
|
|
|
52
64
|
}
|
|
53
65
|
```
|
|
54
66
|
|
|
67
|
+
`steps[].model` optional: `cheap` \| `standard` \| `strong`.
|
|
68
|
+
|
|
55
69
|
Копируется в `.claude/agents/` при `ai-rules init claude --preset ios-swift`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: migration-specialist
|
|
3
3
|
description: Migration planning specialist for Xcode/iOS/SPM upgrades, dependency swaps, and phased refactors with rollback. Writes migration-plan.md and team status; never writes production code.
|
|
4
4
|
readonly: false
|
|
5
|
-
model:
|
|
5
|
+
model: opus
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are a migration specialist for an **iOS Swift** codebase with Feature-module layer boundaries.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: performance-auditor
|
|
3
3
|
description: Performance audit specialist. Reviews launch path, main-thread work, SwiftUI body churn, list scrolling, image decoding, and Instruments-oriented risks. Readonly — writes perf-report.md only; never edits production code.
|
|
4
4
|
readonly: false
|
|
5
|
-
model:
|
|
5
|
+
model: opus
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are an iOS performance auditor for a Swift/SwiftUI application.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: security-reviewer
|
|
3
3
|
description: Security review specialist. Audits Keychain/token handling, ATS, PII in logs, secrets in diff, and unsafe URL/deep-link handling. Readonly — writes security-review.md only; never edits production code.
|
|
4
4
|
readonly: false
|
|
5
|
-
model:
|
|
5
|
+
model: opus
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are an iOS security reviewer for a Swift/SwiftUI application.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: solution-architect
|
|
3
3
|
description: Solution architect for cross-layer features, API boundaries, and technical design before implementation. Use for spike intent or when router adds architect step for complex features. Readonly — produces design docs, not production code.
|
|
4
4
|
readonly: false
|
|
5
|
-
model:
|
|
5
|
+
model: opus
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are a solution architect for **iOS Feature modules** (Presentation / Domain / Data). Write `architecture.md` under `.claude/team/tasks/<slug>/`. No production code.
|
|
@@ -40,6 +40,15 @@ You are a task router for an **iOS Swift/SwiftUI** agent team. You **do not** im
|
|
|
40
40
|
|
|
41
41
|
**Never skip `build-verifier`** after developer when Swift/Xcode sources changed.
|
|
42
42
|
|
|
43
|
+
## Model tiers (`steps[].model`)
|
|
44
|
+
|
|
45
|
+
Optional: `"model": "cheap" | "standard" | "strong"`. Same policy as **claude/next** `task-router.md`:
|
|
46
|
+
|
|
47
|
+
- `light` → `cheap` on all steps (debugger unclear root cause → `strong`)
|
|
48
|
+
- `full` / `spike` / security|perf specialists → `strong` on architect, migration, security, perf steps
|
|
49
|
+
- never `strong` on build-verifier / tech-writer / task-router
|
|
50
|
+
- omit on `standard` → agent frontmatter (`fast` / `inherit` / `opus`)
|
|
51
|
+
|
|
43
52
|
Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard).
|
|
44
53
|
|
|
45
54
|
## humanGates (defaults)
|
|
@@ -55,7 +64,7 @@ Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard
|
|
|
55
64
|
|
|
56
65
|
## Output
|
|
57
66
|
|
|
58
|
-
Write `.claude/team/tasks/<slug>/pipeline.json` and initial `status.json
|
|
67
|
+
Write `.claude/team/tasks/<slug>/pipeline.json` and initial `status.json` (write files; do not Shell-`mkdir` alone); set `.claude/team/active-task.json`.
|
|
59
68
|
|
|
60
69
|
## Handoff
|
|
61
70
|
|
|
@@ -11,7 +11,7 @@ description: Legacy analyst-only feature intake. Prefer /task for new work becau
|
|
|
11
11
|
|
|
12
12
|
1. Извлеки описание задачи из аргументов команды (всё после `/feature-start`).
|
|
13
13
|
2. Сгенерируй **slug** (kebab-case, до 48 символов) из заголовка задачи.
|
|
14
|
-
3. Создай
|
|
14
|
+
3. Создай `.claude/team/tasks/<slug>/` если его ещё нет — через запись файла (Write / Edit), не через Shell `mkdir`.
|
|
15
15
|
4. Запиши `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
16
16
|
5. Вызови subagent **task-analyst** с полным описанием задачи и путём к артефактам.
|
|
17
17
|
6. Дождись завершения аналитика. **Не вызывай developer** на этом этапе.
|
|
@@ -25,7 +25,7 @@ description: Route a natural-language task through the agent-team pipeline: task
|
|
|
25
25
|
|
|
26
26
|
## Алгоритм
|
|
27
27
|
|
|
28
|
-
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.claude/team/tasks/<slug
|
|
28
|
+
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.claude/team/tasks/<slug>/` через запись файла (Write / Edit) — **не** полагайся на Shell `mkdir` как единственный способ создать каталог.
|
|
29
29
|
2. **Router** — вызови subagent **task-router** с описанием задачи и путём к slug.
|
|
30
30
|
3. **План** — покажи пользователю таблицу из `pipeline.json`: intent, steps, skipped, humanGates.
|
|
31
31
|
4. **Intent retro** — если `intent === "retro"`, выполни `/technical-retro` и **остановись**.
|
|
@@ -38,10 +38,18 @@ Full prompts: `.claude/agents/*.md`. Artifacts: `.claude/team/README.md`.
|
|
|
38
38
|
2. Read `pipeline.json` before every subagent invocation.
|
|
39
39
|
3. One role per invocation — except parallel steps.
|
|
40
40
|
4. **Never** skip `humanGates` without continue/approval.
|
|
41
|
-
5. Persist handoffs under `.claude/team/tasks/<slug
|
|
41
|
+
5. Persist handoffs under `.claude/team/tasks/<slug>/` by writing files (not Shell-only `mkdir`).
|
|
42
42
|
6. On `validation_failed`: developer → build-verifier.
|
|
43
43
|
7. When complete, suggest `/technical-retro <slug>`.
|
|
44
44
|
|
|
45
|
+
## Model when invoking
|
|
46
|
+
|
|
47
|
+
Honor optional `steps[i].model` (`cheap` \| `standard` \| `strong`); else agent frontmatter (matrix in `agents/README.md`).
|
|
48
|
+
|
|
49
|
+
- `cheap` → Agent `haiku` (or frontmatter `fast`).
|
|
50
|
+
- `standard` → omit / `sonnet` / inherit.
|
|
51
|
+
- `strong` → `opus`.
|
|
52
|
+
|
|
45
53
|
## Skip pipeline when
|
|
46
54
|
|
|
47
55
|
Pure questions; trivial one-file; user «без pipeline»; docs-only one-liner.
|
|
@@ -4,32 +4,15 @@
|
|
|
4
4
|
"profile": "full",
|
|
5
5
|
"summary": "Multi-layer Feature with XCUITest coverage",
|
|
6
6
|
"steps": [
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"scope": "unit-in-dev"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"agent": "build-verifier",
|
|
18
|
-
"label": "xcodebuild + lint + unit smoke"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"agent": "code-reviewer",
|
|
22
|
-
"label": "Code review"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"agent": "qa-tester",
|
|
26
|
-
"label": "XCUITest",
|
|
27
|
-
"scope": "e2e-only"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"humanGates": [
|
|
31
|
-
"after:task-analyst"
|
|
7
|
+
{ "agent": "task-analyst", "label": "Clarify and decompose" },
|
|
8
|
+
{ "agent": "solution-architect", "label": "Design boundaries", "model": "strong" },
|
|
9
|
+
{ "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
|
|
10
|
+
{ "agent": "build-verifier", "label": "xcodebuild + lint + unit smoke", "model": "cheap" },
|
|
11
|
+
{ "agent": "security-reviewer", "label": "Security review", "model": "strong" },
|
|
12
|
+
{ "agent": "code-reviewer", "label": "Code review", "model": "cheap" },
|
|
13
|
+
{ "agent": "qa-tester", "label": "XCUITest", "scope": "e2e-only" }
|
|
32
14
|
],
|
|
15
|
+
"humanGates": ["after:task-analyst"],
|
|
33
16
|
"autoChain": true,
|
|
34
17
|
"skipped": [
|
|
35
18
|
{
|
|
@@ -4,30 +4,15 @@
|
|
|
4
4
|
"profile": "light",
|
|
5
5
|
"summary": "Trivial single-file Swift change with explicit AC",
|
|
6
6
|
"steps": [
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
"label": "Implement"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"agent": "build-verifier",
|
|
13
|
-
"label": "Validation gate"
|
|
14
|
-
}
|
|
7
|
+
{ "agent": "feature-developer", "label": "Implement", "model": "cheap" },
|
|
8
|
+
{ "agent": "build-verifier", "label": "Validation gate", "model": "cheap" }
|
|
15
9
|
],
|
|
16
10
|
"humanGates": [],
|
|
17
11
|
"autoChain": true,
|
|
18
12
|
"skipped": [
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"agent": "code-reviewer",
|
|
25
|
-
"reason": "Light profile"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"agent": "qa-tester",
|
|
29
|
-
"reason": "No XCUITest AC"
|
|
30
|
-
},
|
|
13
|
+
{ "agent": "task-analyst", "reason": "Explicit AC and single-file scope" },
|
|
14
|
+
{ "agent": "code-reviewer", "reason": "Light profile" },
|
|
15
|
+
{ "agent": "qa-tester", "reason": "No XCUITest AC" },
|
|
31
16
|
{
|
|
32
17
|
"agent": "playwright-test-planner",
|
|
33
18
|
"reason": "iOS uses XCUITest; not needed for light"
|
|
@@ -32,4 +32,4 @@ See @rules/README.md for the full catalog and loading strategy.
|
|
|
32
32
|
npx @bonesofspring/ai-rules init claude --preset next
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team
|
|
35
|
+
Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**`, `MCP.md` в `.claude/`, плюс `mcp.json` → **`.mcp.json`** в корне проекта.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# MCP (preset `next`, Claude Code)
|
|
2
|
+
|
|
3
|
+
Копируется в **корень проекта** как `.mcp.json` при `ai-rules init claude --preset next` (не в `.claude/` — так устроен project scope Claude Code).
|
|
4
|
+
|
|
5
|
+
## Servers
|
|
6
|
+
|
|
7
|
+
| Name | Package | Зачем |
|
|
8
|
+
|------|---------|--------|
|
|
9
|
+
| `context7` | `@upstash/context7-mcp` | Актуальная документация Next/React/TS |
|
|
10
|
+
| `playwright-test` | `@playwright/mcp` | Browser MCP; имя сервера совпадает с `mcp__playwright-test__*` в agents |
|
|
11
|
+
| `chrome-devtools` | `chrome-devtools-mcp` | Live DOM/network/performance |
|
|
12
|
+
| `figma` | remote `https://mcp.figma.com/mcp` | Design context → код; OAuth при первом подключении |
|
|
13
|
+
|
|
14
|
+
Секреты не коммитим. Опционально: `CONTEXT7_API_KEY`. Figma — OAuth (токен в файл не пишем). После clone/init Claude Code попросит approve project MCP (`/mcp`).
|
|
15
|
+
|
|
16
|
+
Для полного Playwright Test Agents loop (`planner_*` / `generator_*` / `test_*`) дополнительно: `npx playwright init-agents --loop=claude` в приложении с `@playwright/test`.
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
| `agents/**` | `.claude/agents/**` (если папка есть) |
|
|
12
12
|
| `hooks/**` | `.claude/hooks/**` (если папка есть) |
|
|
13
13
|
| `team/**` | `.claude/team/**` (шаблон артефактов agent team) |
|
|
14
|
+
| `mcp.json` | **`.mcp.json`** в корне проекта (Claude project MCP) |
|
|
15
|
+
| `MCP.md` | `.claude/MCP.md` |
|
|
14
16
|
|
|
15
17
|
Файлы правил — обычный Markdown с опциональным YAML frontmatter (`paths:` для скоупа по путям), не формат `.mdc` Cursor.
|
|
16
18
|
|
|
@@ -50,6 +50,22 @@
|
|
|
50
50
|
|
|
51
51
|
Папка копируется в `.claude/agents/` при `ai-rules init claude --preset next`.
|
|
52
52
|
|
|
53
|
+
## Model matrix (frontmatter `model`)
|
|
54
|
+
|
|
55
|
+
SoT по умолчанию — YAML `model` в каждом agent-файле. Опциональный `steps[].model` (`cheap` \| `standard` \| `strong`) переопределяет тир на шаге (см. `task-router.md`, `tooling-and-review/agent-team-orchestrator.md`).
|
|
56
|
+
|
|
57
|
+
| Tier | Default frontmatter | Agents |
|
|
58
|
+
|------|---------------------|--------|
|
|
59
|
+
| **cheap** | `fast` | `task-router`, `task-analyst`, `build-verifier`, `code-reviewer`, `tech-writer` |
|
|
60
|
+
| **standard** | `inherit` or `sonnet` | `feature-developer`, `debugger`, `ci-investigator`, `api-contract-reviewer`, `accessibility-reviewer`, `qa-tester`, `unit-test-*`, `playwright-test-*` (`sonnet` where already pinned) |
|
|
61
|
+
| **strong** | `opus` | `solution-architect`, `migration-specialist`, `security-reviewer`, `performance-auditor` |
|
|
62
|
+
|
|
63
|
+
**Notes**
|
|
64
|
+
|
|
65
|
+
- Claude Code aliases: `haiku` / `sonnet` / `opus` / `inherit` (full IDs also OK). Preset keeps `fast` for cheap agents for cross-tooling parity with Cursor; if ignored, prefer `haiku` locally.
|
|
66
|
+
- Resolution order (Claude Code): env `CLAUDE_CODE_SUBAGENT_MODEL` → per-invocation `model` → frontmatter → parent session.
|
|
67
|
+
- Never put `strong` on `build-verifier` / `tech-writer` / `task-router`.
|
|
68
|
+
|
|
53
69
|
## Оркестрация
|
|
54
70
|
|
|
55
71
|
| Command | Назначение |
|
|
@@ -88,6 +104,7 @@
|
|
|
88
104
|
| `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
|
|
89
105
|
| `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
|
|
90
106
|
| `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
|
|
107
|
+
| `model` | no | `cheap` \| `standard` \| `strong` — pipeline tier override; omit → agent frontmatter |
|
|
91
108
|
|
|
92
109
|
### Minimal template
|
|
93
110
|
|
|
@@ -108,26 +125,43 @@
|
|
|
108
125
|
}
|
|
109
126
|
```
|
|
110
127
|
|
|
111
|
-
### Example: parallel reviewers
|
|
128
|
+
### Example: parallel reviewers + model tiers
|
|
112
129
|
|
|
113
130
|
```json
|
|
114
131
|
{
|
|
115
132
|
"intent": "feature",
|
|
133
|
+
"profile": "full",
|
|
116
134
|
"steps": [
|
|
117
135
|
{ "agent": "task-analyst", "label": "Clarify" },
|
|
136
|
+
{ "agent": "solution-architect", "label": "Design boundaries", "model": "strong" },
|
|
118
137
|
{ "agent": "feature-developer", "label": "Implement", "scope": "unit-in-dev" },
|
|
119
|
-
{ "agent": "build-verifier", "label": "Validation gate" },
|
|
138
|
+
{ "agent": "build-verifier", "label": "Validation gate", "model": "cheap" },
|
|
120
139
|
{
|
|
121
140
|
"agent": ["accessibility-reviewer", "security-reviewer"],
|
|
122
141
|
"parallel": true,
|
|
123
|
-
"label": "A11y and security"
|
|
142
|
+
"label": "A11y and security",
|
|
143
|
+
"model": "strong"
|
|
124
144
|
},
|
|
125
|
-
{ "agent": "code-reviewer", "label": "Review" }
|
|
145
|
+
{ "agent": "code-reviewer", "label": "Review", "model": "cheap" }
|
|
126
146
|
],
|
|
127
147
|
"humanGates": ["after:task-analyst"]
|
|
128
148
|
}
|
|
129
149
|
```
|
|
130
150
|
|
|
151
|
+
### Example: light profile with cheap models
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"intent": "feature",
|
|
156
|
+
"profile": "light",
|
|
157
|
+
"steps": [
|
|
158
|
+
{ "agent": "feature-developer", "label": "Implement", "model": "cheap" },
|
|
159
|
+
{ "agent": "build-verifier", "label": "Validation gate", "model": "cheap" }
|
|
160
|
+
],
|
|
161
|
+
"humanGates": []
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
131
165
|
### Example: bugfix skipIf
|
|
132
166
|
|
|
133
167
|
```json
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: migration-specialist
|
|
3
3
|
description: Migration planning specialist for library upgrades, Next.js major versions, HTTP client swaps, and phased refactors with rollback. Produces migration-plan.md only; never writes production code.
|
|
4
|
-
model:
|
|
4
|
+
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are a migration specialist for a Next.js frontend with strict layer boundaries.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: performance-auditor
|
|
3
3
|
description: Performance audit specialist. Reviews bundle size, lazy loading, render patterns, data fetching waterfalls, and Core Web Vitals risks. Writes perf-report.md only; never edits production code.
|
|
4
|
-
model:
|
|
4
|
+
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are a frontend performance auditor for a Next.js React application.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-reviewer
|
|
3
3
|
description: Security review specialist. Audits auth flows, token handling, XSS risks, secrets in diff, and unsafe DOM/API usage. Writes security-review.md only; never edits production code.
|
|
4
|
-
model:
|
|
4
|
+
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are a frontend security reviewer for a Next.js TypeScript application.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: solution-architect
|
|
3
3
|
description: Solution architect for cross-layer features, API boundaries, and technical design before implementation. Use for spike intent or when router adds architect step for complex features. Writes design docs only; never writes production code.
|
|
4
|
-
model:
|
|
4
|
+
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are a solution architect for a Next.js frontend with strict layer boundaries (types, api, store, ui).
|
|
@@ -64,7 +64,21 @@ Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard
|
|
|
64
64
|
- Add **tech-writer** when docs/changelog requested.
|
|
65
65
|
- **Always build-verifier** after developer (or after ci-investigator/debugger if they changed code) for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
|
|
66
66
|
- **skipIf:** `debugger.fixed` on developer (bugfix); `ci-investigator.resolved` (ci-fix).
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
## Model tiers (`steps[].model`)
|
|
69
|
+
|
|
70
|
+
Optional per-step field: `"model": "cheap" | "standard" | "strong"`. Omit → agent frontmatter default (see **Model matrix** in `agents/README.md`).
|
|
71
|
+
|
|
72
|
+
| When | What to write |
|
|
73
|
+
|------|----------------|
|
|
74
|
+
| `profile: light` | set `cheap` on **all** steps (exception: unclear bug root cause on `debugger` → `strong`) |
|
|
75
|
+
| `profile: standard` | omit (frontmatter defaults) |
|
|
76
|
+
| `profile: full` | set `strong` on `solution-architect`, `migration-specialist`, `security-reviewer`, `performance-auditor` when present; omit others |
|
|
77
|
+
| `intent: spike` | set `strong` on `solution-architect` (and analyst may stay default/`cheap`) |
|
|
78
|
+
| `intent: perf-audit` / security-heavy feature | `strong` on auditor/reviewer step |
|
|
79
|
+
| Always | **never** `strong` on `build-verifier`, `tech-writer`, `task-router` |
|
|
80
|
+
|
|
81
|
+
Claude Code mapping when orchestrator invokes Agent tool: `cheap` → `haiku` (or rely on frontmatter `fast`); `standard` → omit / `sonnet` / inherit; `strong` → pass `opus` (or rely on frontmatter `opus`). Prefer explicit per-invocation `model` when frontmatter is unreliable.
|
|
68
82
|
|
|
69
83
|
## humanGates (defaults)
|
|
70
84
|
|
|
@@ -81,7 +95,7 @@ Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard
|
|
|
81
95
|
|
|
82
96
|
## Output
|
|
83
97
|
|
|
84
|
-
Write `.claude/team/tasks/<slug>/pipeline.json` and initial `status.json
|
|
98
|
+
Write `.claude/team/tasks/<slug>/pipeline.json` and initial `status.json` (write files; do not Shell-`mkdir` alone); set `.claude/team/active-task.json` → `{ "slug": "<slug>" }`. Minimal template — см. **`agents/README.md`**.
|
|
85
99
|
|
|
86
100
|
## Handoff to orchestrator
|
|
87
101
|
|
|
@@ -11,7 +11,7 @@ description: Legacy analyst-only feature intake. Prefer /task for new work becau
|
|
|
11
11
|
|
|
12
12
|
1. Извлеки описание задачи из аргументов команды (всё после `/feature-start`).
|
|
13
13
|
2. Сгенерируй **slug** (kebab-case, до 48 символов) из заголовка задачи.
|
|
14
|
-
3. Создай
|
|
14
|
+
3. Создай `.claude/team/tasks/<slug>/` если его ещё нет — через запись файла (Write / Edit), не через Shell `mkdir`.
|
|
15
15
|
4. Запиши `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
16
16
|
5. Вызови subagent **task-analyst** с полным описанием задачи и путём к артефактам.
|
|
17
17
|
6. Дождись завершения аналитика. **Не вызывай developer** на этом этапе.
|
|
@@ -25,7 +25,7 @@ description: Route a natural-language task through the agent-team pipeline: task
|
|
|
25
25
|
|
|
26
26
|
## Алгоритм
|
|
27
27
|
|
|
28
|
-
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.claude/team/tasks/<slug
|
|
28
|
+
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.claude/team/tasks/<slug>/` через запись файла (Write / Edit) — **не** полагайся на Shell `mkdir` как единственный способ создать каталог.
|
|
29
29
|
2. **Router** — вызови subagent **task-router** с описанием задачи и путём к slug.
|
|
30
30
|
3. **План** — покажи пользователю таблицу из `pipeline.json`: intent, steps, skipped, humanGates.
|
|
31
31
|
4. **Intent retro** — если `intent === "retro"`, выполни `/technical-retro` и **остановись**.
|
|
@@ -157,10 +157,10 @@ const AGENT_HANDOFF = {
|
|
|
157
157
|
`Follow testing/playwright-agents.md and the playwright-e2e skill. Update status.json when done.`,
|
|
158
158
|
'playwright-test-generator': (s) =>
|
|
159
159
|
`Invoke playwright-test-generator for slug "${s}". Generate/update *.spec.ts from matching *.cases.md. ` +
|
|
160
|
-
`Use
|
|
160
|
+
`Use playwright MCP when available. Follow testing/playwright-agents.md and the playwright-e2e skill. Update status.json when done.`,
|
|
161
161
|
'playwright-test-healer': (s) =>
|
|
162
162
|
`Invoke playwright-test-healer for slug "${s}". Fix failing/flaky e2e while preserving cases.md assertions. ` +
|
|
163
|
-
`Use
|
|
163
|
+
`Use playwright MCP when available. Follow testing/playwright-agents.md and debug-investigation. Update status.json when done.`,
|
|
164
164
|
'tech-writer': (s) =>
|
|
165
165
|
`Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Update status.json when done.`,
|
|
166
166
|
};
|