@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,11 @@
|
|
|
1
|
+
# Commands (mcp-ts)
|
|
2
|
+
|
|
3
|
+
Slash-команды копируются в `.cursor/commands/` (Cursor) или `.claude/commands/` (Claude) при `ai-rules init … --preset mcp-ts`.
|
|
4
|
+
|
|
5
|
+
| Command | Purpose |
|
|
6
|
+
|---------|---------|
|
|
7
|
+
| `/task` | Router + pipeline entry |
|
|
8
|
+
| `/task-continue` | Resume after human gate |
|
|
9
|
+
| `/feature-start` | Legacy analyst-only start |
|
|
10
|
+
| `/feature-continue` | Alias of task-continue |
|
|
11
|
+
| `/technical-retro` | Retro |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-continue
|
|
3
|
+
description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature continue — legacy alias
|
|
7
|
+
|
|
8
|
+
> **Предпочтительно:** `/task-continue <slug>` — то же поведение, учитывает `pipeline.json`.
|
|
9
|
+
|
|
10
|
+
Продолжение после human gate. Полная логика — в **`task-continue.md`**.
|
|
11
|
+
|
|
12
|
+
## Кратко
|
|
13
|
+
|
|
14
|
+
1. Прочитай `pipeline.json` (если есть) и `status.json`.
|
|
15
|
+
2. Сбрось `awaitingHumanGate`; определи следующий step по `pipelineIndex`.
|
|
16
|
+
3. Вызови subagent для `currentAgent`.
|
|
17
|
+
4. Hook продолжит цепочку при `autoChain: true`.
|
|
18
|
+
|
|
19
|
+
См. `task-continue.md` для деталей и таблицы handoff.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-start
|
|
3
|
+
description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature start — legacy (analyst only)
|
|
7
|
+
|
|
8
|
+
> **Предпочтительно:** `/task <описание>` — router выберет роли и порядок автоматически.
|
|
9
|
+
|
|
10
|
+
Запуск **фазы анализа** без router. Родительский агент действует как оркестратор (см. `agent-team-orchestrator.mdc`).
|
|
11
|
+
|
|
12
|
+
## Что делать
|
|
13
|
+
|
|
14
|
+
1. Извлеки описание задачи из аргументов команды (всё после `/feature-start`).
|
|
15
|
+
2. Сгенерируй **slug** (kebab-case, до 48 символов) из заголовка задачи.
|
|
16
|
+
3. Создай `.cursor/team/tasks/<slug>/` если его ещё нет — через **Write** артефакта (не Shell `mkdir`).
|
|
17
|
+
4. Запиши `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
18
|
+
5. Опционально: минимальный `pipeline.json` с фиксированными steps (analyst → developer → reviewer → qa-tester).
|
|
19
|
+
6. Вызови subagent **task-analyst** (Task tool) с полным описанием задачи и путём к артефактам.
|
|
20
|
+
7. Дождись завершения аналитика. **Не вызывай developer** на этом этапе.
|
|
21
|
+
|
|
22
|
+
## Human gate
|
|
23
|
+
|
|
24
|
+
После аналитика:
|
|
25
|
+
|
|
26
|
+
- Покажи пользователю ссылки на `brief.md` и `decomposition.md`.
|
|
27
|
+
- Попроси проверить и утвердить или прислать правки.
|
|
28
|
+
- Для продолжения: `/task-continue <slug>` или `/feature-continue <slug>`.
|
|
29
|
+
|
|
30
|
+
## Если slug уже существует
|
|
31
|
+
|
|
32
|
+
- Если `status.json` в `awaiting_approval` — предложи ревью или continue.
|
|
33
|
+
- Если задача в работе — спроси, продолжать или начать новый slug.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-continue
|
|
3
|
+
description: Continue an agent-team task after a human gate, pause, or review changes request using pipeline.json and status.json.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task continue — после human gate или паузы
|
|
7
|
+
|
|
8
|
+
Продолжение пайплайна из `pipeline.json`. Алиас по смыслу: `/feature-continue`.
|
|
9
|
+
|
|
10
|
+
## Аргументы
|
|
11
|
+
|
|
12
|
+
`<slug>` — идентификатор задачи.
|
|
13
|
+
|
|
14
|
+
## Preconditions
|
|
15
|
+
|
|
16
|
+
1. Прочитай `.cursor/team/tasks/<slug>/pipeline.json` и `status.json`.
|
|
17
|
+
2. Продолжай если:
|
|
18
|
+
- `awaitingHumanGate: true` или `state: awaiting_approval`, **или**
|
|
19
|
+
- `state: changes_requested` (после review), **или**
|
|
20
|
+
- задача прервана и нужно возобновить с `pipelineIndex`.
|
|
21
|
+
|
|
22
|
+
## Алгоритм
|
|
23
|
+
|
|
24
|
+
1. Запиши `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
25
|
+
2. Сбрось gate: `awaitingHumanGate: false`.
|
|
26
|
+
3. Определи **следующий шаг**:
|
|
27
|
+
- После approval analyst/architect: `pipelineIndex + 1` → следующий agent в `steps`.
|
|
28
|
+
- После `changes_requested`: снова **feature-developer** (тот же index или найди developer в steps).
|
|
29
|
+
4. Обнови `status.json`:
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"pipelineIndex": <n>,
|
|
33
|
+
"currentAgent": "<steps[n].agent>",
|
|
34
|
+
"phase": "executing",
|
|
35
|
+
"state": "in_progress",
|
|
36
|
+
"awaitingHumanGate": false
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
5. Вызови subagent для `currentAgent` с контекстом slug и артефактов.
|
|
40
|
+
6. Hook `chain-team-phases.sh` продолжит цепочку по `pipeline.json`, если `autoChain: true`.
|
|
41
|
+
|
|
42
|
+
## Артефакты для handoff
|
|
43
|
+
|
|
44
|
+
| Agent | Прочитать |
|
|
45
|
+
|-------|-----------|
|
|
46
|
+
| feature-developer | brief.md, decomposition.md, validation-report.md (if retry), review.md (if retry), architecture.md |
|
|
47
|
+
| build-verifier | git diff, decomposition.md |
|
|
48
|
+
| security-reviewer | brief.md, validation-report.md, git diff |
|
|
49
|
+
| code-review (skill / Phase 2 agent) | brief.md, validation-report.md, git diff → write `review.md` |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task
|
|
3
|
+
description: Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task — единая точка входа (router + pipeline)
|
|
7
|
+
|
|
8
|
+
Главная команда для постановки задачи. Родительский агент = оркестратор (`agent-team-orchestrator.mdc`). Intake для work-запросов без `/task` — `agent-team-intake.mdc`.
|
|
9
|
+
|
|
10
|
+
## Аргументы
|
|
11
|
+
|
|
12
|
+
Всё после `/task` — описание задачи на естественном языке.
|
|
13
|
+
|
|
14
|
+
Примеры:
|
|
15
|
+
|
|
16
|
+
- `/task Добавить MCP tool list_resources`
|
|
17
|
+
- `/task Handler падает при пустом body — пофикси`
|
|
18
|
+
- `/task Project tests падают локально после правки schema — bugfix + build-verifier`
|
|
19
|
+
- `/task Миграция на новый SDK / package`
|
|
20
|
+
- `/task Покрой unit-тестами handler echo`
|
|
21
|
+
- `/task Напиши changelog для релиза tool`
|
|
22
|
+
- `/task Сделай ревью моих изменений в src/tools`
|
|
23
|
+
- `/task Напиши contract/unit tests для tool schema`
|
|
24
|
+
|
|
25
|
+
## Алгоритм
|
|
26
|
+
|
|
27
|
+
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.cursor/team/tasks/<slug>/` через **Write** (например сразу `status.json` или пустой placeholder) — **не** через Shell `mkdir` (песочница → `Operation not permitted`).
|
|
28
|
+
2. **Router** — вызови subagent **task-router** с описанием задачи и путём к slug.
|
|
29
|
+
3. **План** — покажи пользователю таблицу из `pipeline.json`: intent, steps, skipped, humanGates.
|
|
30
|
+
4. **Intent retro** — если `intent === "retro"`, выполни `/technical-retro` и **остановись**.
|
|
31
|
+
5. **Старт** — вызови subagent для `pipeline.steps[0].agent`:
|
|
32
|
+
- передай slug, пути к артефактам, scope из step (если есть);
|
|
33
|
+
- обнови `status.json`: `pipelineIndex: 0`, `currentAgent`, `state: in_progress`.
|
|
34
|
+
6. **Human gate** — если после текущего шага есть gate в `humanGates` (`after:<agent>`), после завершения агента **остановись** и попроси `/task-continue <slug>` (или `/feature-continue <slug>`).
|
|
35
|
+
|
|
36
|
+
## Не делать
|
|
37
|
+
|
|
38
|
+
- Не вызывать developer до router и (если в pipeline) analyst/architect.
|
|
39
|
+
- Не hardcode порядок ролей — только `pipeline.json`.
|
|
40
|
+
- Не пропускать human gate без явного continue.
|
|
41
|
+
|
|
42
|
+
## Если slug занят
|
|
43
|
+
|
|
44
|
+
- `awaitingHumanGate` / `state: awaiting_approval` → предложи ревью артефактов или `/task-continue <slug>`.
|
|
45
|
+
- `in_progress` → спроси: продолжить или новый slug.
|
|
46
|
+
|
|
47
|
+
## Legacy
|
|
48
|
+
|
|
49
|
+
`/feature-start` и `/feature-continue` остаются совместимыми; для новых задач предпочитай `/task`.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-retro
|
|
3
|
+
description: Facilitate a technical retrospective for a period, incident, release, or completed agent-team task slug.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Техническое ретро
|
|
7
|
+
|
|
8
|
+
Агент выступает как **нейтральный фасилитатор технической ретроспективы**, а не как ревьюер кода или оценщик людей. **Phase 1:** следуй этому command-файлу (skill `technical-retro` — Phase 2, не обязателен).
|
|
9
|
+
|
|
10
|
+
## Когда включать
|
|
11
|
+
|
|
12
|
+
- Пользователь просит: «ретро», «техническое ретро», «разбор спринта/итерации», «action items после релиза».
|
|
13
|
+
- После завершения пайплайна команды агентов (`/feature-start` → `/feature-continue`).
|
|
14
|
+
- Есть контекст: период, тема (релиз, инцидент), slug задачи, заметки.
|
|
15
|
+
|
|
16
|
+
## Входные данные (собрать, не выдумывать)
|
|
17
|
+
|
|
18
|
+
Запросить при нехватке:
|
|
19
|
+
|
|
20
|
+
- **Период и фокус**.
|
|
21
|
+
- **Slug задачи** (если ретро по работе команды агентов).
|
|
22
|
+
- **Участники/роли** (если важно).
|
|
23
|
+
- **Ограничения**: время, формат (async vs синхрон).
|
|
24
|
+
|
|
25
|
+
### Артефакты команды агентов (если есть slug)
|
|
26
|
+
|
|
27
|
+
Прочитать из репозитория:
|
|
28
|
+
|
|
29
|
+
- `.cursor/team/tasks/<slug>/pipeline.json`
|
|
30
|
+
- `.cursor/team/tasks/<slug>/brief.md`
|
|
31
|
+
- `.cursor/team/tasks/<slug>/decomposition.md`
|
|
32
|
+
- `.cursor/team/tasks/<slug>/status.json`
|
|
33
|
+
- Git diff / `git status` для изменённых файлов
|
|
34
|
+
|
|
35
|
+
Не приписывать факты, которых нет в артефактах, diff или сообщении пользователя.
|
|
36
|
+
|
|
37
|
+
## Принципы фасилитации
|
|
38
|
+
|
|
39
|
+
- **Безопасность**: процесс и система, не «виноватые».
|
|
40
|
+
- **Конкретика**: от абстракций к наблюдаемым событиям.
|
|
41
|
+
- **Баланс**: позитив и зоны роста.
|
|
42
|
+
- **Action items**: владелец и срок у каждого.
|
|
43
|
+
- **Не смешивать с code review** — развести блоки, если запросили оба.
|
|
44
|
+
|
|
45
|
+
## Структура сессии (по умолчанию)
|
|
46
|
+
|
|
47
|
+
1. **Цель и рамки**.
|
|
48
|
+
2. **Сбор фактов**: хорошо / мешало / сюрпризы.
|
|
49
|
+
3. **Группировка тем** (3–7).
|
|
50
|
+
4. **Корневые причины** для 1–2 болезненных тем.
|
|
51
|
+
5. **Эксперименты** (1–3 изменения процесса).
|
|
52
|
+
6. **Action items**: что / владелец / до когда / критерий успеха.
|
|
53
|
+
|
|
54
|
+
## Блок «Работа агентов» (обязателен при slug)
|
|
55
|
+
|
|
56
|
+
Если ретро связано с пайплайном `/feature-start`:
|
|
57
|
+
|
|
58
|
+
| Вопрос | Что фиксировать |
|
|
59
|
+
|--------|-----------------|
|
|
60
|
+
| Router | Ошибка intent, лишние/пропущенные steps в pipeline |
|
|
61
|
+
| Аналитик | Ошибки в assumptions, пропущенные AC, лишние/недостающие таски |
|
|
62
|
+
| Декомпозиция | Неполное покрытие слоёв, неверный порядок, blocked-зависимости |
|
|
63
|
+
| Developer | Scope creep, пропущенные правила, lint/type gaps |
|
|
64
|
+
| Reviewer | Пропущенные дефекты, false positives, качество чеклиста |
|
|
65
|
+
| QA | Покрытие AC тестами, flakiness, пробелы в e2e планах |
|
|
66
|
+
|
|
67
|
+
**Action items** в этом блоке — на улучшение **промптов, subagents и rules** (не только кода).
|
|
68
|
+
|
|
69
|
+
## Формат ответа
|
|
70
|
+
|
|
71
|
+
- Шапка: период, фокус, slug (если есть), допущения.
|
|
72
|
+
- Повестка по этапам.
|
|
73
|
+
- Блок **«Работа агентов»** (если применимо).
|
|
74
|
+
- Темы — буллеты; спорное — **вопросы команде**.
|
|
75
|
+
- **Action items** в конце.
|
|
76
|
+
|
|
77
|
+
## Ограничения
|
|
78
|
+
|
|
79
|
+
- Не приписывать цитаты и факты без входа.
|
|
80
|
+
- Не выдавать HR‑рекомендации.
|
|
81
|
+
- Если просят только шаблон — **шаблон повестки** без выдуманного контента.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# `hooks` (preset mcp-ts)
|
|
2
|
+
|
|
3
|
+
| File | Purpose |
|
|
4
|
+
|------|---------|
|
|
5
|
+
| `guard-shell-command.sh` | Destructive git / JS package-manager mismatch; allows npm/npx/node/tsc |
|
|
6
|
+
| `chain-team-phases.sh` | Auto-chain pipeline steps on `subagentStop` (Phase 1: build-verifier, security-reviewer; **no** `contract-test-*`) |
|
|
7
|
+
|
|
8
|
+
See root `hooks.json` for registration (`beforeShellExecution`, `subagentStop`).
|
|
9
|
+
|
|
10
|
+
## Optional cookbook
|
|
11
|
+
|
|
12
|
+
See `hooks/examples/README.md` — secret-guard / format-edited / test-on-save. **Not** in default `hooks.json`.
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# preset: mcp-ts (TypeScript MCP) — chain handoffs use build-verifier + security-reviewer; no contract-test-*
|
|
3
|
+
# Chains agent team steps from pipeline.json after subagentStop.
|
|
4
|
+
# Falls back to legacy phase-based flow when pipeline.json is absent.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
input=$(cat)
|
|
9
|
+
|
|
10
|
+
INPUT="$input" node <<'NODE'
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
// mcp-ts Phase-1 chain: validation via typecheck/tests + security-reviewer (no contract-test-* handoffs)
|
|
15
|
+
const TEAM_ROOT = path.join(process.cwd(), '.cursor', 'team');
|
|
16
|
+
|
|
17
|
+
const inputRaw = process.env.INPUT || '';
|
|
18
|
+
let hookInput;
|
|
19
|
+
try {
|
|
20
|
+
hookInput = JSON.parse(inputRaw);
|
|
21
|
+
} catch {
|
|
22
|
+
process.stdout.write('{}');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (hookInput.status !== 'completed') {
|
|
27
|
+
process.stdout.write('{}');
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const activePath = path.join(TEAM_ROOT, 'active-task.json');
|
|
32
|
+
|
|
33
|
+
if (!fs.existsSync(activePath)) {
|
|
34
|
+
process.stdout.write('{}');
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let active;
|
|
39
|
+
try {
|
|
40
|
+
active = JSON.parse(fs.readFileSync(activePath, 'utf8'));
|
|
41
|
+
} catch {
|
|
42
|
+
process.stdout.write('{}');
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const slug = active.slug;
|
|
47
|
+
if (!slug) {
|
|
48
|
+
process.stdout.write('{}');
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const taskDir = path.join(TEAM_ROOT, 'tasks', slug);
|
|
53
|
+
const statusPath = path.join(taskDir, 'status.json');
|
|
54
|
+
const pipelinePath = path.join(taskDir, 'pipeline.json');
|
|
55
|
+
|
|
56
|
+
if (!fs.existsSync(statusPath)) {
|
|
57
|
+
process.stdout.write('{}');
|
|
58
|
+
process.exit(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let status;
|
|
62
|
+
try {
|
|
63
|
+
status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
|
|
64
|
+
} catch {
|
|
65
|
+
process.stdout.write('{}');
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const now = new Date().toISOString();
|
|
70
|
+
|
|
71
|
+
function writeStatus(next) {
|
|
72
|
+
status = { ...status, ...next, slug, updatedAt: now };
|
|
73
|
+
fs.writeFileSync(statusPath, JSON.stringify(status, null, 2) + '\n');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function out(message) {
|
|
77
|
+
process.stdout.write(JSON.stringify({ followup_message: message }));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function readArtifact(name) {
|
|
81
|
+
const p = path.join(taskDir, name);
|
|
82
|
+
if (!fs.existsSync(p)) return '';
|
|
83
|
+
try {
|
|
84
|
+
return fs.readFileSync(p, 'utf8');
|
|
85
|
+
} catch {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getStepAgents(step) {
|
|
91
|
+
if (!step) return [];
|
|
92
|
+
return Array.isArray(step.agent) ? step.agent : [step.agent];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function skipIfMatches(skipIf, dir) {
|
|
96
|
+
if (!skipIf) return false;
|
|
97
|
+
// Phase-2 reserved: debugger / ci-investigator are not in mcp-ts Phase 1 roster.
|
|
98
|
+
if (skipIf === 'debugger.fixed') {
|
|
99
|
+
const text = readArtifact('debug-report.md');
|
|
100
|
+
return /fixApplied:\s*true/i.test(text) || /\*\*Fix applied:\*\*\s*true/i.test(text);
|
|
101
|
+
}
|
|
102
|
+
if (skipIf === 'ci-investigator.resolved') {
|
|
103
|
+
const text = readArtifact('ci-report.md');
|
|
104
|
+
return /fixApplied:\s*true/i.test(text) || /## Verdict\s*\nPASS/i.test(text);
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function findNextExecutableStep(steps, startIdx, dir) {
|
|
110
|
+
for (let i = startIdx; i < steps.length; i++) {
|
|
111
|
+
if (!skipIfMatches(steps[i].skipIf, dir)) {
|
|
112
|
+
return { step: steps[i], index: i };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const AGENT_HANDOFF = {
|
|
119
|
+
'task-analyst': (s) =>
|
|
120
|
+
`Invoke task-analyst for slug "${s}". Write brief.md and decomposition.md under .cursor/team/tasks/${s}/. ` +
|
|
121
|
+
`Set status.json: phase executing, state awaiting_approval if human gate applies. Do not use legacy phase analysis.`,
|
|
122
|
+
'solution-architect': (s) =>
|
|
123
|
+
`Invoke solution-architect for slug "${s}". Read brief.md; write architecture.md for MCP tool/resource/prompt contracts and module boundaries. Update status.json when done.`,
|
|
124
|
+
'feature-developer': (s) =>
|
|
125
|
+
`Invoke feature-developer for slug "${s}". Read brief.md, decomposition.md, validation-report.md, architecture.md, security-review.md, debug-report.md if present. ` +
|
|
126
|
+
`Follow feature-delivery-workflow.mdc and reference-features.mdc. Mandatory flow: contract → schema → handler → registration → unit/contract verification → package validation. ` +
|
|
127
|
+
`Include schema/handler unit tests before handoff. Update status.json when done.`,
|
|
128
|
+
'build-verifier': (s) =>
|
|
129
|
+
`Invoke build-verifier (readonly) for slug "${s}". Follow mcp-ts-tooling.mdc and post-change-test.mdc. ` +
|
|
130
|
+
`Discover package manager; run typecheck + project tests — never Playwright/XCUITest/Next lint recipes/Go tools as required gates. ` +
|
|
131
|
+
`For preset packaging: yarn check:preset-structure (mcp-ts STACKS + MCP_TS_FORBIDDEN_*). Write validation-report.md. Set state completed or validation_failed. Do not edit production code.`,
|
|
132
|
+
'security-reviewer': (s) =>
|
|
133
|
+
`Invoke security-reviewer (readonly) for slug "${s}". Follow security-mcp.mdc and mcp-auth-secrets.mdc; write security-review.md. Update status.json when done.`,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const REVIEW_AGENTS = new Set([
|
|
137
|
+
'security-reviewer',
|
|
138
|
+
]);
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
function handoffForAgent(agent, scope) {
|
|
142
|
+
const fn = AGENT_HANDOFF[agent];
|
|
143
|
+
return fn ? fn(slug, scope) : `Invoke ${agent} subagent for slug "${slug}". Update status.json when done.`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handoffForParallelStep(step) {
|
|
147
|
+
const agents = getStepAgents(step);
|
|
148
|
+
return (
|
|
149
|
+
`Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
|
|
150
|
+
`Each agent writes its artifact and appends itself to status.json parallelCompleted when done.`
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function hasGateAfter(agent, humanGates) {
|
|
155
|
+
return Array.isArray(humanGates) && humanGates.includes(`after:${agent}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function hasGateAfterStep(step, humanGates) {
|
|
159
|
+
return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function legacyFlow() {
|
|
163
|
+
if (status.phase === 'analysis') {
|
|
164
|
+
process.stdout.write('{}');
|
|
165
|
+
process.exit(0);
|
|
166
|
+
}
|
|
167
|
+
if (status.phase === 'development' && (status.state === 'completed' || status.state === 'in_progress')) {
|
|
168
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'build-verifier' });
|
|
169
|
+
out(handoffForAgent('build-verifier'));
|
|
170
|
+
process.exit(0);
|
|
171
|
+
}
|
|
172
|
+
if (status.currentAgent === 'build-verifier' && status.state === 'completed') {
|
|
173
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'security-reviewer' });
|
|
174
|
+
out(handoffForAgent('security-reviewer'));
|
|
175
|
+
process.exit(0);
|
|
176
|
+
}
|
|
177
|
+
if (status.phase === 'review' && status.state === 'completed') {
|
|
178
|
+
writeStatus({ phase: 'done', state: 'completed' });
|
|
179
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
180
|
+
process.exit(0);
|
|
181
|
+
}
|
|
182
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
183
|
+
writeStatus({
|
|
184
|
+
currentAgent: 'feature-developer',
|
|
185
|
+
state: 'in_progress',
|
|
186
|
+
phase: 'executing',
|
|
187
|
+
retryAfterFix: status.currentAgent,
|
|
188
|
+
});
|
|
189
|
+
out(
|
|
190
|
+
handoffForAgent('feature-developer') +
|
|
191
|
+
` After fixes, re-run ${status.currentAgent}.`,
|
|
192
|
+
);
|
|
193
|
+
process.exit(0);
|
|
194
|
+
}
|
|
195
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
196
|
+
writeStatus({
|
|
197
|
+
currentAgent: 'feature-developer',
|
|
198
|
+
state: 'in_progress',
|
|
199
|
+
phase: 'executing',
|
|
200
|
+
retryAfterFix: 'build-verifier',
|
|
201
|
+
});
|
|
202
|
+
out(
|
|
203
|
+
handoffForAgent('feature-developer') +
|
|
204
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
205
|
+
);
|
|
206
|
+
process.exit(0);
|
|
207
|
+
}
|
|
208
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
209
|
+
const retry = status.retryAfterFix;
|
|
210
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
211
|
+
out(handoffForAgent(retry));
|
|
212
|
+
process.exit(0);
|
|
213
|
+
}
|
|
214
|
+
if (status.phase === 'testing' && status.state === 'completed') {
|
|
215
|
+
writeStatus({ phase: 'done', state: 'completed' });
|
|
216
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
217
|
+
process.exit(0);
|
|
218
|
+
}
|
|
219
|
+
process.stdout.write('{}');
|
|
220
|
+
process.exit(0);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (!fs.existsSync(pipelinePath)) {
|
|
224
|
+
legacyFlow();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let pipeline;
|
|
228
|
+
try {
|
|
229
|
+
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
230
|
+
} catch {
|
|
231
|
+
legacyFlow();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const steps = pipeline.steps || [];
|
|
235
|
+
if (steps.length === 0 || pipeline.autoChain === false) {
|
|
236
|
+
process.stdout.write('{}');
|
|
237
|
+
process.exit(0);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (status.awaitingHumanGate || status.state === 'awaiting_approval') {
|
|
241
|
+
process.stdout.write('{}');
|
|
242
|
+
process.exit(0);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
246
|
+
const reviewer = status.currentAgent;
|
|
247
|
+
writeStatus({
|
|
248
|
+
currentAgent: 'feature-developer',
|
|
249
|
+
state: 'in_progress',
|
|
250
|
+
phase: 'executing',
|
|
251
|
+
retryAfterFix: reviewer,
|
|
252
|
+
});
|
|
253
|
+
out(
|
|
254
|
+
handoffForAgent('feature-developer') +
|
|
255
|
+
` After fixes, re-run ${reviewer}.`,
|
|
256
|
+
);
|
|
257
|
+
process.exit(0);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
261
|
+
writeStatus({
|
|
262
|
+
currentAgent: 'feature-developer',
|
|
263
|
+
state: 'in_progress',
|
|
264
|
+
phase: 'executing',
|
|
265
|
+
retryAfterFix: 'build-verifier',
|
|
266
|
+
});
|
|
267
|
+
out(
|
|
268
|
+
handoffForAgent('feature-developer') +
|
|
269
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
270
|
+
);
|
|
271
|
+
process.exit(0);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
275
|
+
const retry = status.retryAfterFix;
|
|
276
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
277
|
+
out(handoffForAgent(retry));
|
|
278
|
+
process.exit(0);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
282
|
+
const currentStep = steps[idx];
|
|
283
|
+
if (!currentStep) {
|
|
284
|
+
writeStatus({ phase: 'done', state: 'completed', currentAgent: null });
|
|
285
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
286
|
+
process.exit(0);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const completedAgent = status.currentAgent || getStepAgents(currentStep)[0];
|
|
290
|
+
const stepAgents = getStepAgents(currentStep);
|
|
291
|
+
|
|
292
|
+
if (currentStep.parallel && stepAgents.length > 1) {
|
|
293
|
+
const done = [...(status.parallelCompleted || [])];
|
|
294
|
+
if (completedAgent && !done.includes(completedAgent)) {
|
|
295
|
+
done.push(completedAgent);
|
|
296
|
+
}
|
|
297
|
+
writeStatus({ parallelCompleted: done });
|
|
298
|
+
const remaining = stepAgents.filter((a) => !done.includes(a));
|
|
299
|
+
if (remaining.length > 0) {
|
|
300
|
+
process.stdout.write('{}');
|
|
301
|
+
process.exit(0);
|
|
302
|
+
}
|
|
303
|
+
writeStatus({ parallelCompleted: [] });
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
|
|
307
|
+
writeStatus({
|
|
308
|
+
awaitingHumanGate: true,
|
|
309
|
+
state: 'awaiting_approval',
|
|
310
|
+
currentAgent: completedAgent,
|
|
311
|
+
});
|
|
312
|
+
process.stdout.write('{}');
|
|
313
|
+
process.exit(0);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const next = findNextExecutableStep(steps, idx + 1, taskDir);
|
|
317
|
+
if (!next) {
|
|
318
|
+
writeStatus({
|
|
319
|
+
pipelineIndex: steps.length,
|
|
320
|
+
phase: 'done',
|
|
321
|
+
state: 'completed',
|
|
322
|
+
currentAgent: null,
|
|
323
|
+
awaitingHumanGate: false,
|
|
324
|
+
});
|
|
325
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
326
|
+
process.exit(0);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const { step: nextStep, index: nextIdx } = next;
|
|
330
|
+
const nextAgents = getStepAgents(nextStep);
|
|
331
|
+
|
|
332
|
+
writeStatus({
|
|
333
|
+
pipelineIndex: nextIdx,
|
|
334
|
+
currentAgent: nextAgents[0],
|
|
335
|
+
phase: 'executing',
|
|
336
|
+
state: 'in_progress',
|
|
337
|
+
awaitingHumanGate: false,
|
|
338
|
+
parallelCompleted: [],
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
if (nextStep.parallel && nextAgents.length > 1) {
|
|
342
|
+
out(handoffForParallelStep(nextStep));
|
|
343
|
+
} else {
|
|
344
|
+
out(handoffForAgent(nextAgents[0], nextStep.scope));
|
|
345
|
+
}
|
|
346
|
+
NODE
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Hook examples (mcp-ts)
|
|
2
|
+
|
|
3
|
+
Optional cookbook scripts — **not** wired into default `hooks.json`.
|
|
4
|
+
|
|
5
|
+
| Example | Idea |
|
|
6
|
+
|---------|------|
|
|
7
|
+
| `secret-guard.example.sh` | Block committing obvious secrets |
|
|
8
|
+
| `format-edited.example.sh` | Format touched files with project formatter |
|
|
9
|
+
| `test-on-save.example.sh` | Run scoped tests after edits |
|
|
10
|
+
|
|
11
|
+
Adapt commands to the repository package manager (`mcp-ts-tooling`).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: format / lint touched TypeScript files with project tooling.
|
|
3
|
+
# NOT in default hooks.json. Discover package manager before running scripts.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep -E '\.(ts|tsx|js|mjs)$' || true)
|
|
6
|
+
if [[ -z "${changed:-}" ]]; then
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
if [[ -f yarn.lock ]]; then
|
|
10
|
+
yarn -s prettier --write $changed 2>/dev/null || true
|
|
11
|
+
elif [[ -f pnpm-lock.yaml ]]; then
|
|
12
|
+
pnpm exec prettier --write $changed 2>/dev/null || true
|
|
13
|
+
elif [[ -f package-lock.json ]]; then
|
|
14
|
+
npx prettier --write $changed 2>/dev/null || true
|
|
15
|
+
fi
|
|
16
|
+
exit 0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional cookbook: block committing likely secrets in staged diffs.
|
|
3
|
+
# NOT wired in default hooks.json — copy to hooks/ and register manually.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
|
|
6
|
+
if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
|
|
7
|
+
echo "secret-guard: possible secret in staged diff — review before commit" >&2
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
exit 0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: scoped unit tests after TypeScript edits.
|
|
3
|
+
# NOT in default hooks.json. Prefer repository test scripts (Vitest/Jest).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep -E '\.(ts|tsx)$' || true)
|
|
6
|
+
if [[ -z "${changed:-}" ]]; then
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
run_test() {
|
|
10
|
+
local pm="$1"
|
|
11
|
+
if $pm run -s test -- --runRelated "$changed" 2>/dev/null; then
|
|
12
|
+
return 0
|
|
13
|
+
fi
|
|
14
|
+
$pm run -s test 2>/dev/null || true
|
|
15
|
+
}
|
|
16
|
+
if [[ -f yarn.lock ]]; then
|
|
17
|
+
run_test yarn
|
|
18
|
+
elif [[ -f pnpm-lock.yaml ]]; then
|
|
19
|
+
run_test pnpm
|
|
20
|
+
elif [[ -f package-lock.json ]]; then
|
|
21
|
+
npm test --silent 2>/dev/null || true
|
|
22
|
+
elif [[ -f bun.lockb || -f bun.lock ]]; then
|
|
23
|
+
bun test 2>/dev/null || true
|
|
24
|
+
fi
|
|
25
|
+
exit 0
|