baldart 3.6.2
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 +599 -0
- package/README.md +566 -0
- package/VERSION +1 -0
- package/bin/baldart.js +143 -0
- package/framework/.claude/agents/REGISTRY.md +169 -0
- package/framework/.claude/agents/api-perf-cost-auditor.md +291 -0
- package/framework/.claude/agents/code-reviewer.md +350 -0
- package/framework/.claude/agents/codebase-architect.md +391 -0
- package/framework/.claude/agents/coder.md +291 -0
- package/framework/.claude/agents/deep-human-insight.md +198 -0
- package/framework/.claude/agents/doc-reviewer.md +440 -0
- package/framework/.claude/agents/email-deliverability-architect.md +193 -0
- package/framework/.claude/agents/hybrid-ml-architect.md +285 -0
- package/framework/.claude/agents/hyper-gamification-designer.md +149 -0
- package/framework/.claude/agents/legal-counsel-gdpr.md +179 -0
- package/framework/.claude/agents/marketing-conversion-strategist.md +162 -0
- package/framework/.claude/agents/motion-expert.md +108 -0
- package/framework/.claude/agents/onboarding-architect-lead.md +230 -0
- package/framework/.claude/agents/plan-auditor.md +546 -0
- package/framework/.claude/agents/prd-card-writer.md +372 -0
- package/framework/.claude/agents/prd.md +744 -0
- package/framework/.claude/agents/qa-sentinel.md +305 -0
- package/framework/.claude/agents/remotion-animator-orchestrator.md +218 -0
- package/framework/.claude/agents/security-reviewer.md +276 -0
- package/framework/.claude/agents/senior-researcher.md +175 -0
- package/framework/.claude/agents/seo-analytics-strategist.md +156 -0
- package/framework/.claude/agents/skill-improver.md +61 -0
- package/framework/.claude/agents/ui-expert.md +191 -0
- package/framework/.claude/agents/visual-designer.md +190 -0
- package/framework/.claude/agents/website-orchestrator.md +118 -0
- package/framework/.claude/agents/wiki-curator.md +145 -0
- package/framework/.claude/commands/baldart-push.md +15 -0
- package/framework/.claude/commands/check.md +237 -0
- package/framework/.claude/commands/codexreview.md +203 -0
- package/framework/.claude/commands/design-review.md +11 -0
- package/framework/.claude/commands/issue-review.md +34 -0
- package/framework/.claude/commands/new.md +331 -0
- package/framework/.claude/commands/qa.md +257 -0
- package/framework/.claude/hooks/framework-edit-gate.js +208 -0
- package/framework/.claude/hooks/lint-before-commit.sh.template +66 -0
- package/framework/.claude/settings.local.json.example +32 -0
- package/framework/.claude/skills/api-design-principles/SKILL.md +567 -0
- package/framework/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/framework/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/framework/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/framework/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/framework/.claude/skills/baldart-push/SKILL.md +222 -0
- package/framework/.claude/skills/bug/SKILL.md +200 -0
- package/framework/.claude/skills/bug/references/logging-patterns.md +174 -0
- package/framework/.claude/skills/capture/SKILL.md +125 -0
- package/framework/.claude/skills/capture/references/synthesis-template.md +42 -0
- package/framework/.claude/skills/context-primer/SKILL.md +189 -0
- package/framework/.claude/skills/copywriting/SKILL.md +273 -0
- package/framework/.claude/skills/copywriting/references/copy-frameworks.md +338 -0
- package/framework/.claude/skills/copywriting/references/natural-transitions.md +252 -0
- package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +119 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/before-after-examples.md +291 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/compact-templates.md +183 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/frontmatter-minimal.md +112 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +110 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +129 -0
- package/framework/.claude/skills/find-skills/SKILL.md +133 -0
- package/framework/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/framework/.claude/skills/frontend-design/SKILL.md +84 -0
- package/framework/.claude/skills/gamification-design/SKILL.md +130 -0
- package/framework/.claude/skills/issue-review/SKILL.md +45 -0
- package/framework/.claude/skills/kie-ai/SKILL.md +262 -0
- package/framework/.claude/skills/kie-ai/references/models-catalog.md +272 -0
- package/framework/.claude/skills/kie-ai/scripts/kie_api.sh +209 -0
- package/framework/.claude/skills/kie-ai/scripts/remove_greenscreen.py +69 -0
- package/framework/.claude/skills/kie-ai/scripts/setup_api_key.sh +77 -0
- package/framework/.claude/skills/motion-design/LICENSE +21 -0
- package/framework/.claude/skills/motion-design/README.md +82 -0
- package/framework/.claude/skills/motion-design/SKILL.md +336 -0
- package/framework/.claude/skills/motion-design/director/choreography.md +93 -0
- package/framework/.claude/skills/motion-design/director/context-adaptation.md +83 -0
- package/framework/.claude/skills/motion-design/director/core-philosophy.md +53 -0
- package/framework/.claude/skills/motion-design/director/decision-framework.md +91 -0
- package/framework/.claude/skills/motion-design/director/disney-principles.md +102 -0
- package/framework/.claude/skills/motion-design/director/emotion-mapping.md +71 -0
- package/framework/.claude/skills/motion-design/director/motion-personality.md +89 -0
- package/framework/.claude/skills/motion-design/director/narrative-structure.md +62 -0
- package/framework/.claude/skills/motion-design/patterns/ambient-continuous.md +81 -0
- package/framework/.claude/skills/motion-design/patterns/entrance-exit.md +82 -0
- package/framework/.claude/skills/motion-design/patterns/multi-element.md +69 -0
- package/framework/.claude/skills/motion-design/patterns/state-feedback.md +96 -0
- package/framework/.claude/skills/motion-design/reference/property-selection.md +95 -0
- package/framework/.claude/skills/motion-design/reference/quality-checklist.md +67 -0
- package/framework/.claude/skills/motion-design/reference/timing-easing-tables.md +106 -0
- package/framework/.claude/skills/motion-design/reference/troubleshooting.md +73 -0
- package/framework/.claude/skills/new/SKILL.md +1687 -0
- package/framework/.claude/skills/playwright-skill/API_REFERENCE.md +652 -0
- package/framework/.claude/skills/playwright-skill/SKILL.md +157 -0
- package/framework/.claude/skills/playwright-skill/package.json +26 -0
- package/framework/.claude/skills/prd/SKILL.md +228 -0
- package/framework/.claude/skills/prd/assets/card-template.yml +232 -0
- package/framework/.claude/skills/prd/assets/epic-template.yml +190 -0
- package/framework/.claude/skills/prd/assets/prd-template.md +230 -0
- package/framework/.claude/skills/prd/assets/state-template.md +78 -0
- package/framework/.claude/skills/prd/references/api-perf-gate.md +152 -0
- package/framework/.claude/skills/prd/references/audit-phase.md +478 -0
- package/framework/.claude/skills/prd/references/backlog-phase.md +145 -0
- package/framework/.claude/skills/prd/references/discovery-phase.md +359 -0
- package/framework/.claude/skills/prd/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/prd/references/prd-add-phase.md +214 -0
- package/framework/.claude/skills/prd/references/prd-writing-phase.md +145 -0
- package/framework/.claude/skills/prd/references/research-phase.md +216 -0
- package/framework/.claude/skills/prd/references/ui-design-phase.md +61 -0
- package/framework/.claude/skills/prd/references/validation-phase.md +72 -0
- package/framework/.claude/skills/prd-add/SKILL.md +222 -0
- package/framework/.claude/skills/prd-add/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/remotion-best-practices/SKILL.md +48 -0
- package/framework/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/framework/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/framework/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
- package/framework/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/framework/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/framework/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/framework/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/framework/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/images.md +130 -0
- package/framework/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/framework/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/framework/.claude/skills/remotion-best-practices/rules/lottie.md +67 -0
- package/framework/.claude/skills/remotion-best-practices/rules/maps.md +401 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/framework/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
- package/framework/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/framework/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/framework/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/framework/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/framework/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/framework/.claude/skills/remotion-best-practices/rules/trimming.md +52 -0
- package/framework/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/framework/.claude/skills/seo-audit/SKILL.md +394 -0
- package/framework/.claude/skills/seo-audit/references/aeo-geo-patterns.md +279 -0
- package/framework/.claude/skills/seo-audit/references/ai-writing-detection.md +190 -0
- package/framework/.claude/skills/simplify/SKILL.md +137 -0
- package/framework/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/framework/.claude/skills/skill-creator/SKILL.md +356 -0
- package/framework/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/framework/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/framework/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/framework/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/framework/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/framework/.claude/skills/ui-design/SKILL.md +199 -0
- package/framework/.claude/skills/ui-design/references/component-discovery.md +54 -0
- package/framework/.claude/skills/ui-design/references/evaluation.md +171 -0
- package/framework/.claude/skills/ui-design/references/generation.md +109 -0
- package/framework/.claude/skills/ui-design/references/inventory.md +59 -0
- package/framework/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/framework/.claude/skills/webapp-testing/SKILL.md +123 -0
- package/framework/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/framework/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/framework/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/framework/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/framework/.claude/skills/worktree-manager/SKILL.md +680 -0
- package/framework/AGENTS.md +240 -0
- package/framework/agents/api-contracts.md +137 -0
- package/framework/agents/architecture.md +145 -0
- package/framework/agents/coding-standards.md +148 -0
- package/framework/agents/data-model.md +110 -0
- package/framework/agents/deployment-protocol.md +232 -0
- package/framework/agents/design-review.md +172 -0
- package/framework/agents/env-reference.md +171 -0
- package/framework/agents/github-issue-subagent.md +252 -0
- package/framework/agents/index.md +261 -0
- package/framework/agents/llm-wiki-methodology.md +216 -0
- package/framework/agents/maintenance-protocol.md +305 -0
- package/framework/agents/observability.md +162 -0
- package/framework/agents/performance.md +155 -0
- package/framework/agents/project-context.md +145 -0
- package/framework/agents/runbook.md +208 -0
- package/framework/agents/security.md +168 -0
- package/framework/agents/skills-mapping.md +286 -0
- package/framework/agents/testing.md +111 -0
- package/framework/agents/workflows.md +215 -0
- package/framework/docs/PROJECT-CONFIGURATION.md +336 -0
- package/framework/docs/references/brand-guidelines.md +170 -0
- package/framework/docs/references/ui-guidelines.template.md +182 -0
- package/framework/routines/code-review.routine.yml +46 -0
- package/framework/routines/doc-review.routine.yml +45 -0
- package/framework/routines/ds-drift.routine.yml +52 -0
- package/framework/routines/full-sweep.routine.yml +51 -0
- package/framework/routines/index.yml +70 -0
- package/framework/routines/skill-improve.routine.yml +50 -0
- package/framework/routines/wiki-review.routine.yml +45 -0
- package/framework/templates/baldart.config.template.yml +113 -0
- package/framework/templates/breaking-change-checklist.md +484 -0
- package/framework/templates/feature-card.template.yml +125 -0
- package/framework/templates/overlays/README.md +44 -0
- package/framework/templates/overlays/copywriting.fidelity-example.md +62 -0
- package/framework/templates/overlays/ui-design.fidelity-example.md +75 -0
- package/framework/templates/skill-project-context.snippet.md +19 -0
- package/framework/templates/spec.template.md +208 -0
- package/package.json +51 -0
- package/src/commands/add.js +229 -0
- package/src/commands/configure.js +385 -0
- package/src/commands/doctor.js +486 -0
- package/src/commands/migrate.js +185 -0
- package/src/commands/push.js +0 -0
- package/src/commands/routines.js +269 -0
- package/src/commands/status.js +130 -0
- package/src/commands/update.js +419 -0
- package/src/commands/version.js +88 -0
- package/src/utils/contamination.js +400 -0
- package/src/utils/git.js +181 -0
- package/src/utils/hooks.js +152 -0
- package/src/utils/routine-adapters/claude-code-cloud.js +78 -0
- package/src/utils/routine-adapters/cron.js +138 -0
- package/src/utils/routine-adapters/github-actions.js +141 -0
- package/src/utils/routine-adapters/index.js +21 -0
- package/src/utils/routines.js +166 -0
- package/src/utils/state.js +143 -0
- package/src/utils/symlinks.js +425 -0
- package/src/utils/ui.js +133 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Orchestrate a team of specialized agents to implement one or more backlog cards end-to-end, with code review, doc review, and commit for each.
|
|
3
|
+
allowed-tools: Bash, Task, Edit, Write, Read, Grep, Glob, WebFetch, WebSearch, TaskCreate, TaskUpdate, TaskList, TaskGet, TeamCreate, TeamDelete, SendMessage
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the **backlog orchestrator**. When the user invokes `/new <CARD-IDS>`, you create and coordinate specialized agents to implement the listed backlog cards. You NEVER write production code yourself — you only orchestrate.
|
|
7
|
+
|
|
8
|
+
Parse the card IDs from the arguments. Cards can be specified as:
|
|
9
|
+
- Space-separated: `GLOB-001 GLOB-002 GLOB-003`
|
|
10
|
+
- Hyphen-range: `GLOB-001-GLOB-008` (expands to all cards in range)
|
|
11
|
+
- Comma-separated: `GLOB-001, GLOB-002, GLOB-003`
|
|
12
|
+
|
|
13
|
+
If no card IDs are provided, ask the user which cards to implement.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Context Tracking (CRITICAL)
|
|
18
|
+
|
|
19
|
+
You MUST maintain a **persistent tracking file** at `/tmp/batch-tracker-<FIRST-CARD-ID>.md` throughout the entire batch run (e.g., `/tmp/batch-tracker-FEAT-0396.md`). Use the **first card ID** from the batch as the suffix. This ensures multiple `/new` sessions running in parallel terminals (e.g., one per worktree) do NOT conflict.
|
|
20
|
+
|
|
21
|
+
This file is your single source of truth — if your context gets compacted or you lose track of what happened, **re-read this file first**.
|
|
22
|
+
|
|
23
|
+
### Tracking file format
|
|
24
|
+
|
|
25
|
+
At batch start, create `/tmp/batch-tracker-<FIRST-CARD-ID>.md` with:
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
# Batch Run: [CARD-IDS]
|
|
29
|
+
Started: [timestamp]
|
|
30
|
+
Total cards: [N]
|
|
31
|
+
|
|
32
|
+
## Worktree
|
|
33
|
+
Branch: [feat/FEAT-XXXX-slug]
|
|
34
|
+
Path: [../wt/feat-FEAT-XXXX-slug]
|
|
35
|
+
Group parent: [FEAT-XXXX or "standalone"]
|
|
36
|
+
Main repo: [/absolute/path/to/main/repo]
|
|
37
|
+
|
|
38
|
+
## Card Queue
|
|
39
|
+
- [ ] CARD-001 — [title from backlog]
|
|
40
|
+
- [ ] CARD-002 — [title from backlog]
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
## Completed Cards
|
|
44
|
+
(none yet)
|
|
45
|
+
|
|
46
|
+
## Current Card
|
|
47
|
+
(none — starting pre-flight)
|
|
48
|
+
|
|
49
|
+
## Issues & Flags
|
|
50
|
+
(none yet)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Update rules
|
|
54
|
+
|
|
55
|
+
- **Before starting a card**: move it to `## Current Card` with phase info.
|
|
56
|
+
- **After each phase**: update the current card's phase status in the tracker.
|
|
57
|
+
- **After completing a card**: move it from `Current Card` to `## Completed Cards` with:
|
|
58
|
+
- Commit hash
|
|
59
|
+
- One-line summary of what was implemented
|
|
60
|
+
- Any flags/issues found
|
|
61
|
+
- Code review result (pass/fail + fixes)
|
|
62
|
+
- Doc review result (pass/fail + what was added)
|
|
63
|
+
- Test results (new + existing count, pass/fail)
|
|
64
|
+
- Fix cycles count
|
|
65
|
+
- QA result (profile used: skip/light/balanced/deep | verdict: PASS/FAIL/SKIP | confidence % | findings: N blockers, N majors)
|
|
66
|
+
- QA findings file (e.g. `/qa/FEAT-XXXX.md` or "skipped")
|
|
67
|
+
- **When blocked**: log the blocker in `## Issues & Flags`.
|
|
68
|
+
- **On context recovery**: if you ever feel lost or after context compaction, IMMEDIATELY read your tracker file (`/tmp/batch-tracker-<FIRST-CARD-ID>.md`) to restore your state.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Pre-flight (once)
|
|
73
|
+
|
|
74
|
+
1. Read each backlog card from `/backlog/*.yml` to understand scope and dependencies.
|
|
75
|
+
2. Check `docs/references/project-status.md` for current state.
|
|
76
|
+
3. Determine which cards can run in **parallel** (no shared files/components) vs which must be **sequential** (dependencies or overlapping paths). Use `group.sequence` to determine execution order within a group.
|
|
77
|
+
4. **Worktree grouping** (automated from card metadata — do NOT ask the user if metadata is complete):
|
|
78
|
+
a. Check each card's `group.parent` field.
|
|
79
|
+
b. If all cards share the same `group.parent` → ONE worktree, branch derived from parent card.
|
|
80
|
+
c. If cards have no `group.parent` but share a common ID prefix (e.g., `FEAT-0396-*`) → suggest grouping to user.
|
|
81
|
+
d. If cards are unrelated (no shared parent, no common prefix) → each gets its own worktree.
|
|
82
|
+
e. Read the parent/epic card for `git_strategy.branch` if set; otherwise derive branch name per AGENTS.md naming convention: `feat/<PARENT-ID>-<slug>`.
|
|
83
|
+
f. If `group.parent` is set AND the parent card has `git_strategy.branch` → use it directly, NO questions asked.
|
|
84
|
+
5. **Create worktree(s)**:
|
|
85
|
+
a. Ensure the base branch is clean: `git checkout <base-branch> && git pull`.
|
|
86
|
+
b. For each worktree group:
|
|
87
|
+
- Create: `git worktree add ../wt/<branch-name> -b <branch-name>`.
|
|
88
|
+
- Copy environment files if needed: `cp <main-repo>/.env.local <worktree-path>/.env.local 2>/dev/null`.
|
|
89
|
+
- Install dependencies in worktree (e.g., `npm install`, `pip install`, etc.).
|
|
90
|
+
- Verify build in worktree.
|
|
91
|
+
- If build fails → STOP, report, do NOT continue.
|
|
92
|
+
c. Switch working directory to worktree for all subsequent operations.
|
|
93
|
+
6. Create the tracking file `/tmp/batch-tracker-<FIRST-CARD-ID>.md` (include worktree path and branch name).
|
|
94
|
+
7. Create a task list to track progress across all cards.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## QA Profile Selector
|
|
99
|
+
|
|
100
|
+
Before Phase 3.5, determine the QA profile for each card by reading its YAML metadata. Use the **first matching rule** (priority order):
|
|
101
|
+
|
|
102
|
+
| Profile | When to apply |
|
|
103
|
+
|---------|--------------|
|
|
104
|
+
| **SKIP** | Card type is `docs`, `chore`, or `config` — OR all changed paths are `.md`/`.yml` (non-API)/CSS with zero logic files — OR title contains only cosmetic keywords (typo, rename, copy, wording, style) with no code areas |
|
|
105
|
+
| **LIGHT** | 5 or fewer files likely touched — AND no HIGH-risk keywords in paths/areas — OR card type is `bugfix` with small scope — OR pure refactoring with no logic change |
|
|
106
|
+
| **BALANCED** | Default for all `feature` / `enhancement` cards not matching LIGHT or DEEP rules |
|
|
107
|
+
| **DEEP** | ANY of: areas includes both `api` + `data` — OR paths/title contain `auth`, `payment`, `permission`, `schema`, `migration`, `cron`, `webhook`, `transaction` — OR >15 files likely touched — OR acceptance criteria count > 5 — OR DB indexes changed — OR API contract changed |
|
|
108
|
+
|
|
109
|
+
When in doubt between LIGHT and BALANCED, use BALANCED. When in doubt between BALANCED and DEEP, use DEEP.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Per-card pipeline
|
|
114
|
+
|
|
115
|
+
For each card, execute these phases in order:
|
|
116
|
+
|
|
117
|
+
### Phase 1 — Claim & Context
|
|
118
|
+
1. **Update tracker**: set current card, phase = "1-claim".
|
|
119
|
+
2. Set the card status to `IN_PROGRESS` and assign yourself.
|
|
120
|
+
3. Update `docs/references/project-status.md` Active Code Context.
|
|
121
|
+
4. Invoke the **codebase-architect** agent (MUST per AGENTS.md) to understand the relevant codebase area, existing patterns, and architecture before any implementation.
|
|
122
|
+
5. **Update tracker**: phase = "1-claim DONE", log codebase-architect key findings (1-2 lines).
|
|
123
|
+
|
|
124
|
+
### Phase 2 — Implement (self-healing, up to 3 retries)
|
|
125
|
+
6. **Update tracker**: phase = "2-implement".
|
|
126
|
+
7. Create an agent team of **coder** agent (or appropriate specialist from `.claude/agents/REGISTRY.md`) to implement the card. Pass the codebase-architect findings as context.
|
|
127
|
+
8. Run tests (if they exist), build, and lint to verify everything passes.
|
|
128
|
+
9. **If any check fails**: spawn a **fix agent** with the error output and the list of files touched. Do NOT ask the user — just fix and re-run. Fix the code, not the tests (unless the test itself is wrong). Repeat up to **3 times**.
|
|
129
|
+
10. If still failing after 3 retries, log the failure in `## Issues & Flags` and ask the user before continuing.
|
|
130
|
+
11. **Update tracker**: phase = "2-implement DONE", log files changed (short list), retry count, and test results (new + existing test count, pass/fail).
|
|
131
|
+
|
|
132
|
+
### Phase 3 — Review (parallel read-only audits, then single fix pass)
|
|
133
|
+
12. **Update tracker**: phase = "3-review".
|
|
134
|
+
13. Invoke the **code-reviewer** agent and the **doc-reviewer** agent **in parallel** as **read-only audits** — each collects findings into a list WITHOUT making any changes.
|
|
135
|
+
14. **Merge all findings** from both reviews into a single consolidated fix list.
|
|
136
|
+
15. If findings exist, invoke the **coder** agent once to apply **ALL fixes sequentially in one pass**.
|
|
137
|
+
16. Run tests (if they exist), lint, and build once at the end to verify everything passes. If any check fails, apply the same self-healing retry loop (up to 3 times, no user prompt).
|
|
138
|
+
17. **Update tracker**: phase = "3-review DONE", log review findings count, fixes applied, and test results.
|
|
139
|
+
|
|
140
|
+
### Phase 3.5 — QA Validation
|
|
141
|
+
|
|
142
|
+
18. **Update tracker**: phase = "3.5-qa".
|
|
143
|
+
19. **Select QA profile** using the QA Profile Selector table above. Log the chosen profile and rationale in the tracker (1 line).
|
|
144
|
+
20. **If profile is SKIP**: log "QA skipped — [reason]" in the tracker. Proceed to Phase 4.
|
|
145
|
+
21. **If profile is LIGHT, BALANCED, or DEEP**: invoke the **`qa-sentinel`** agent (subagent_type: `qa-sentinel`) via Task tool with the following context:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Run [QUICK | FULL] VALIDATION MODE on card <CARD-ID>.
|
|
149
|
+
|
|
150
|
+
Context:
|
|
151
|
+
- Worktree path: <worktree-path>
|
|
152
|
+
- Branch: <branch-name>
|
|
153
|
+
- Latest commit: <hash> <message>
|
|
154
|
+
- Changed files: <list from implementation phase>
|
|
155
|
+
- Risk level: [Low | Medium | High]
|
|
156
|
+
- QA profile selected: [light | balanced | deep]
|
|
157
|
+
|
|
158
|
+
Profile → mode mapping:
|
|
159
|
+
- light → QUICK VALIDATION MODE
|
|
160
|
+
- balanced → FULL VALIDATION MODE
|
|
161
|
+
- deep → FULL VALIDATION MODE (plus: run e2e smoke suite if configured)
|
|
162
|
+
|
|
163
|
+
After running all gates, write the complete QA Report to:
|
|
164
|
+
/qa/<CARD-ID>.md
|
|
165
|
+
|
|
166
|
+
Use the findings file format defined in /qa/README.md.
|
|
167
|
+
Return your full structured QA Report and final verdict.
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
22. **Read qa-sentinel's output.** Verify the findings file was written to `/qa/<CARD-ID>.md`.
|
|
171
|
+
23. **If QA verdict is FAIL**:
|
|
172
|
+
- Spawn the **coder** agent to fix all BLOCKER findings (pass it the findings file path + list of blockers). Do NOT ask the user.
|
|
173
|
+
- After coder fixes, re-invoke `qa-sentinel` in the same mode to re-validate. Repeat up to **2 times**.
|
|
174
|
+
- If still FAIL after 2 retries: log in `## Issues & Flags` and **ask the user** whether to proceed or stop.
|
|
175
|
+
- The commit in Phase 4 MUST NOT happen until QA verdict is PASS (or user explicitly overrides).
|
|
176
|
+
24. **Update tracker**: phase = "3.5-qa DONE", log: profile used, verdict (PASS/FAIL/SKIP), confidence %, findings count (blockers/majors/minors), findings file path.
|
|
177
|
+
|
|
178
|
+
### Phase 4 — Commit (in worktree, NO merge yet)
|
|
179
|
+
25. **Update tracker**: phase = "4-commit".
|
|
180
|
+
26. Stage and commit **all changes together** in the worktree using format `[CARD-ID] Brief description` (MUST per AGENTS.md). Include all relevant files — implementation, review fixes, QA-driven fixes, and doc updates in a single commit. Do NOT merge or push yet — that happens post-batch.
|
|
181
|
+
- **IMPORTANT — atomic staging**: Always combine `git add` and `git commit` in a single chained command so staging is never lost on retry:
|
|
182
|
+
```
|
|
183
|
+
cd <worktree-path> && git add -A && git commit -m "[CARD-ID] Brief description"
|
|
184
|
+
```
|
|
185
|
+
- **If commit fails** (e.g., lint-staged or pre-commit hook error): re-run the **same full command** (`git add -A && git commit ...`). Never run `git commit` alone after a failure — the staging area may have been altered by lint-staged auto-fixes.
|
|
186
|
+
27. Update the backlog card: set status to `DONE`, add implementation notes.
|
|
187
|
+
28. **Update tracker**: move card to `## Completed Cards` with commit hash, summary, and flags.
|
|
188
|
+
|
|
189
|
+
### Sub-agent failure protocol
|
|
190
|
+
- If any sub-agent **crashes or errors** during any phase: log the failure in the tracker, **attempt the work yourself directly**, and note it in the final report.
|
|
191
|
+
- Never block the pipeline waiting for a failed agent — recover and continue.
|
|
192
|
+
|
|
193
|
+
### Phase 5 — Context Clean & Continue
|
|
194
|
+
29. Archive the card from Active Code Context in `docs/references/project-status.md`.
|
|
195
|
+
30. **CONTEXT PURGE**: After updating the tracker, deliberately forget the implementation details of this card. From this point forward, you should NOT reference any code, file contents, or review details from this card — only the summary in the tracker. If you need to recall what happened, read the tracker file. This keeps your working context lean for the next card.
|
|
196
|
+
31. **Update tracker**: clear `## Current Card`, move to next pending card.
|
|
197
|
+
32. Move to the next card.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Final review (after all cards)
|
|
202
|
+
|
|
203
|
+
Once ALL cards are committed in the worktree:
|
|
204
|
+
1. **Read the tracker file** to get the full picture of what was implemented.
|
|
205
|
+
2. Invoke the **code-reviewer** agent and the **doc-reviewer** agent **in parallel** for a holistic review across all implementations — check for inconsistencies, duplicated logic, integration gaps between cards, and missing documentation.
|
|
206
|
+
3. **Persist findings to file.** Write the consolidated final review findings to `/tmp/batch-final-review-<FIRST-CARD-ID>.md` using the Write tool. This ensures findings survive context compaction. If context is compacted before fixes are applied, re-read from this file.
|
|
207
|
+
4. **Auto-apply fixes.** If findings exist, invoke the **coder** agent once to apply ALL fixes in a single pass (same pattern as Phase 3 per-card review). Run tests (if they exist), lint, and build to verify. If any check fails, apply the self-healing retry loop (up to 3 times).
|
|
208
|
+
5. Run build one final time in the worktree to confirm stability.
|
|
209
|
+
6. **Update tracker** with final review results (findings count, fixes applied, build status).
|
|
210
|
+
7. **Proceed to Phase 6** (post-batch merge & cleanup).
|
|
211
|
+
8. Present a **single summary report** to the user per card (and a batch summary at the end):
|
|
212
|
+
- **Files changed** (short list per card)
|
|
213
|
+
- **Test results** (new tests + existing tests count, pass rate at each iteration)
|
|
214
|
+
- **Build/lint status** (pass + retry count if any)
|
|
215
|
+
- **Fix cycles** (total number of self-healing retries across phases)
|
|
216
|
+
- **Review findings fixed** (count and brief description)
|
|
217
|
+
- **QA result** (profile: skip/light/balanced/deep | verdict: PASS/FAIL/SKIP | confidence % | findings: N blockers, N majors, N minors | findings file path)
|
|
218
|
+
- **Issues needing user attention** (anything unresolved, partially wired, or flagged)
|
|
219
|
+
- **Commit hashes** (from tracker)
|
|
220
|
+
- **Merge commit hash** (from Phase 6)
|
|
221
|
+
- **Worktree cleanup status** (success/failed)
|
|
222
|
+
- Overall implementation status
|
|
223
|
+
9. **Proceed to Phase 7** (production readiness checklist).
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Phase 6 — Post-batch merge & cleanup
|
|
228
|
+
|
|
229
|
+
After the final review passes AND all cards are committed in the worktree:
|
|
230
|
+
|
|
231
|
+
### 6a. Push feature branch
|
|
232
|
+
1. From the worktree directory: `git push -u origin <branch-name>`.
|
|
233
|
+
|
|
234
|
+
### 6b. Merge into base branch
|
|
235
|
+
2. Switch to main repo: `cd <main-repo-path>` (read from tracker `## Worktree > Main repo`).
|
|
236
|
+
3. `git checkout <base-branch> && git pull`.
|
|
237
|
+
4. `git merge --no-ff <branch-name>`.
|
|
238
|
+
5. **If merge conflicts** → STOP immediately, report conflicting files to user. Do NOT auto-resolve.
|
|
239
|
+
|
|
240
|
+
### 6c. Verify post-merge integrity
|
|
241
|
+
6. Run build — must pass.
|
|
242
|
+
7. Run tests — must pass (if tests exist).
|
|
243
|
+
8. **If anything fails** → STOP, report. Do NOT delete branch or worktree.
|
|
244
|
+
|
|
245
|
+
### 6d. Push base branch
|
|
246
|
+
9. `git push`.
|
|
247
|
+
|
|
248
|
+
### 6e. Cleanup
|
|
249
|
+
10. Delete local branch: `git branch -d <branch-name>`.
|
|
250
|
+
11. Delete remote branch: `git push origin --delete <branch-name>`.
|
|
251
|
+
12. Remove worktree: `git worktree remove ../wt/<branch-name>`.
|
|
252
|
+
13. Prune: `git worktree prune`.
|
|
253
|
+
14. **Update tracker**: log merge commit hash, cleanup status.
|
|
254
|
+
|
|
255
|
+
### Fail-safe rules
|
|
256
|
+
- Never force push.
|
|
257
|
+
- Never delete a branch before successful merge.
|
|
258
|
+
- Never remove a worktree before confirming the base branch is stable.
|
|
259
|
+
- Stop execution immediately if any command fails.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Phase 7 — Production Readiness Checklist
|
|
264
|
+
|
|
265
|
+
After Phase 6 completes (or after the final summary report if Phase 6 is deferred), present a **Production Readiness Checklist** — a clear list of all manual or infrastructure actions required to launch the implemented changes in production.
|
|
266
|
+
|
|
267
|
+
### How to detect items
|
|
268
|
+
|
|
269
|
+
Scan ALL files changed across the batch (use the tracker's completed cards + `git diff` against the base branch) and check for:
|
|
270
|
+
|
|
271
|
+
| Category | Detection signal | Action to report |
|
|
272
|
+
|----------|-----------------|------------------|
|
|
273
|
+
| **DB indexes** | New/modified index config files, or code using new compound queries | Deploy indexes (e.g., `firebase deploy --only firestore:indexes`, run migrations, etc.) |
|
|
274
|
+
| **DB security/access rules** | New/modified access rule files | Deploy updated rules |
|
|
275
|
+
| **Environment variables** | New `process.env.*` references not present in the base branch, new entries in `.env.example` | Add to hosting platform settings (list each var name) |
|
|
276
|
+
| **Scheduled functions / cron** | New or modified cron/scheduled functions | Deploy functions |
|
|
277
|
+
| **Database migrations** | New collections/tables, field renames, data backfills referenced in code or ADRs | Run migration script (specify which) |
|
|
278
|
+
| **New API endpoints** | New route files | Verify CORS/auth config; update API docs if public |
|
|
279
|
+
| **Third-party services** | New API keys, webhook URLs, or external service integrations | Configure in provider dashboard + add secrets |
|
|
280
|
+
| **DNS / domain changes** | Hosting or redirect config changes | Update DNS records or hosting domain settings |
|
|
281
|
+
| **Package upgrades with breaking changes** | Major version bumps in dependency files | Verify compatibility; check migration guides |
|
|
282
|
+
|
|
283
|
+
### Output format
|
|
284
|
+
|
|
285
|
+
Present the checklist as a clearly formatted section in the final report:
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
## Production Readiness Checklist
|
|
289
|
+
|
|
290
|
+
### Required before deploy
|
|
291
|
+
1. **[Category]** Description
|
|
292
|
+
- Command or UI path
|
|
293
|
+
- Reason: which card/feature requires it
|
|
294
|
+
|
|
295
|
+
### No action needed
|
|
296
|
+
- (list categories that don't apply)
|
|
297
|
+
|
|
298
|
+
### Notes
|
|
299
|
+
- Any timing dependencies (e.g., "deploy indexes BEFORE releasing code")
|
|
300
|
+
- Any environment variables that must be set BEFORE deployment
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Rules
|
|
304
|
+
|
|
305
|
+
- **Always present this section**, even if the checklist is empty (in that case, state "No infrastructure changes required — deploy is code-only").
|
|
306
|
+
- Order items by **deployment sequence** (items that must happen first go first).
|
|
307
|
+
- For each item, include the **reason** (which card/feature requires it) and the **exact command or UI path**.
|
|
308
|
+
- If an item is **uncertain**, mark it with `VERIFY` and explain what to check.
|
|
309
|
+
- **Update the tracker** with the full checklist under a new `## Production Readiness` section.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Context recovery protocol
|
|
314
|
+
|
|
315
|
+
If at ANY point you are unsure where you are in the batch:
|
|
316
|
+
1. Read your tracker file (`/tmp/batch-tracker-<FIRST-CARD-ID>.md`)
|
|
317
|
+
2. Check `## Current Card` — if populated, resume that card at the listed phase.
|
|
318
|
+
3. Check `## Card Queue` — find the next unchecked card.
|
|
319
|
+
4. Check `## Completed Cards` — know what's already done (don't redo).
|
|
320
|
+
5. Continue the pipeline from where you left off.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Parallelism rules
|
|
325
|
+
|
|
326
|
+
- Cards with non-overlapping `claimed_paths` CAN run in parallel.
|
|
327
|
+
- Cards with shared dependencies or overlapping files MUST run sequentially.
|
|
328
|
+
- Code review and doc review for the same card run as **parallel read-only audits**, then fixes are applied in a single sequential pass.
|
|
329
|
+
- Different cards' implementations CAN run in parallel if independent.
|
|
330
|
+
- When running parallel agents, expect "file modified since read" errors on shared files (like the backlog yml) — handle gracefully.
|
|
331
|
+
- When running in parallel, each parallel branch updates the tracker with its own card — use card ID as prefix to avoid conflicts.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Standardized QA workflow with 3 profiles — Light (quick), Balanced (default), Deep (Balanced + Playwright UI). Usage: /qa [light|balanced|deep] [--card FEAT-XXXX]
|
|
3
|
+
allowed-tools: Bash, Task, Edit, Write, Read, Grep, Glob, TaskCreate, TaskUpdate, TaskList, TaskGet, TeamCreate, TeamDelete, SendMessage, AskUserQuestion
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the **QA Orchestrator**. When the user invokes `/qa [profile] [--card FEAT-XXXX]`, run the QA workflow below exactly.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Step 0 — Parse Arguments
|
|
11
|
+
|
|
12
|
+
**Profile** (mutually exclusive, default = balanced):
|
|
13
|
+
- `light` → LIGHT profile
|
|
14
|
+
- `balanced` → BALANCED profile (default if no argument given)
|
|
15
|
+
- `deep` → DEEP profile
|
|
16
|
+
|
|
17
|
+
**Card** (optional):
|
|
18
|
+
- Explicit `--card FEAT-XXXX` wins over auto-detection.
|
|
19
|
+
|
|
20
|
+
**Auto-detect card** (in order, stop at first match):
|
|
21
|
+
1. Extract from current branch: `git rev-parse --abbrev-ref HEAD` → pattern `feat/FEAT-XXXX-*` or `codex/FEAT-XXXX-*` or `claude/FEAT-XXXX-*` → capture ID.
|
|
22
|
+
2. Extract from latest commit: `git log -1 --pretty=%s` → pattern `[FEAT-XXXX]` or `[DIO-XXXX]` → capture ID.
|
|
23
|
+
3. Scan `/backlog/*.yml` for a card with `status: IN_PROGRESS` assigned to current work context.
|
|
24
|
+
4. Fallback: use timestamp session ID `session-YYYYMMDD-HHMM` (compute from current date/time).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 1 — Gather Context (always)
|
|
29
|
+
|
|
30
|
+
Run these in parallel:
|
|
31
|
+
- `git rev-parse --abbrev-ref HEAD`
|
|
32
|
+
- `git log -1 --pretty="%h %s"`
|
|
33
|
+
- `git diff --name-only <base-branch>...HEAD 2>/dev/null || git diff --name-only HEAD~1`
|
|
34
|
+
- `git diff --stat <base-branch>...HEAD 2>/dev/null || git diff --stat HEAD~1`
|
|
35
|
+
|
|
36
|
+
**Classify risk** based on changed files:
|
|
37
|
+
- **HIGH**: files matching `auth`, `payment`, `permission`, `schema`, `migration`, `api/v`, `transaction`, `cron`, `webhook`
|
|
38
|
+
- **MEDIUM**: everything else (feature modules, components, utilities)
|
|
39
|
+
- **LOW**: only `.md`, `.yml`, style/CSS, test files, config — no logic changes
|
|
40
|
+
|
|
41
|
+
If risk is HIGH and profile is LIGHT, warn the user: "Risk level is HIGH — consider running `/qa balanced` or `/qa deep` for better coverage."
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 2 — Create Findings File (Balanced + Deep only)
|
|
46
|
+
|
|
47
|
+
**Skip for LIGHT.**
|
|
48
|
+
|
|
49
|
+
Create `/qa/` directory if it does not exist: `mkdir -p /qa`
|
|
50
|
+
|
|
51
|
+
Choose filename:
|
|
52
|
+
- If card known: `/qa/<CARD-ID>.md`
|
|
53
|
+
- Else: `/qa/session-YYYYMMDD-HHMM.md`
|
|
54
|
+
|
|
55
|
+
Write the initial file:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
# QA Session — <CARD or SESSION-ID>
|
|
59
|
+
|
|
60
|
+
**Date**: <ISO timestamp>
|
|
61
|
+
**Branch**: <branch name>
|
|
62
|
+
**Commit**: <short hash> <message>
|
|
63
|
+
**Profile**: <Light | Balanced | Deep>
|
|
64
|
+
**Risk Level**: <Low | Medium | High>
|
|
65
|
+
|
|
66
|
+
## Diff Summary
|
|
67
|
+
|
|
68
|
+
<paste git diff --stat output>
|
|
69
|
+
|
|
70
|
+
## Environment
|
|
71
|
+
|
|
72
|
+
- Package manager: <detect from lockfile>
|
|
73
|
+
- Test framework: <detect from config/package.json>
|
|
74
|
+
- E2E framework: <configured (config file exists) | not configured>
|
|
75
|
+
|
|
76
|
+
## Findings
|
|
77
|
+
|
|
78
|
+
<!-- Populated during testing. Format per finding:
|
|
79
|
+
### FIND-NNN — <Title>
|
|
80
|
+
- **Severity**: Blocker | Major | Minor
|
|
81
|
+
- **File**: <path:line if known>
|
|
82
|
+
- **Repro**: <steps or trigger>
|
|
83
|
+
- **Expected**: <correct behavior>
|
|
84
|
+
- **Actual**: <observed behavior>
|
|
85
|
+
- **Root cause**: <hypothesis>
|
|
86
|
+
- **Suggested fix**: <minimal fix description>
|
|
87
|
+
- **Regression test**: <what test to add>
|
|
88
|
+
-->
|
|
89
|
+
|
|
90
|
+
(none yet)
|
|
91
|
+
|
|
92
|
+
## Final Verdict
|
|
93
|
+
|
|
94
|
+
<!-- Populated at end of run -->
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Step 3 — Execute Profile
|
|
100
|
+
|
|
101
|
+
### LIGHT — Fast confidence (<3 min target)
|
|
102
|
+
|
|
103
|
+
Run directly in this session (no sub-agents):
|
|
104
|
+
|
|
105
|
+
1. Extract changed source files from the diff.
|
|
106
|
+
2. Lint check on changed files — if no changed files, skip with note.
|
|
107
|
+
3. Type check (e.g., `npx tsc --noEmit`)
|
|
108
|
+
4. Scoped tests — if test pattern unclear, run full suite.
|
|
109
|
+
5. Build check.
|
|
110
|
+
|
|
111
|
+
For each step: report PASS / FAIL. On FAIL, show the exact error output.
|
|
112
|
+
|
|
113
|
+
Stop on FAIL (do not run subsequent steps after a BLOCKER failure). Diagnose the failure before presenting the verdict.
|
|
114
|
+
|
|
115
|
+
No findings file required. Present final verdict immediately.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### BALANCED — Solid validation (default)
|
|
120
|
+
|
|
121
|
+
**Decide on parallelization first:**
|
|
122
|
+
- If 3+ clearly independent risk tracks exist (e.g., auth + payments + UI, or unit + integration + DB) → use the parallel agent strategy below.
|
|
123
|
+
- Otherwise → invoke a single `qa-sentinel` agent.
|
|
124
|
+
|
|
125
|
+
**Single-agent path:**
|
|
126
|
+
|
|
127
|
+
Invoke `qa-sentinel` via Task tool:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
Run FULL VALIDATION MODE on the current changeset.
|
|
131
|
+
|
|
132
|
+
Context:
|
|
133
|
+
- Branch: <branch>
|
|
134
|
+
- Latest commit: <hash> <message>
|
|
135
|
+
- Changed files: <list from git diff>
|
|
136
|
+
- Risk level: <Low/Medium/High>
|
|
137
|
+
- Card: <CARD-ID or "none">
|
|
138
|
+
|
|
139
|
+
After completing validation gates (lint, tsc, tests, build, audit):
|
|
140
|
+
1. Start the dev server if appropriate for the change, exercise key flows, and check for server/browser console errors and unexpected 4xx/5xx responses. Focus on flows directly touched by the diff.
|
|
141
|
+
2. Identify collateral impacts on adjacent features not directly in the diff.
|
|
142
|
+
3. Return your full QA Report (all gates + findings).
|
|
143
|
+
|
|
144
|
+
Findings file to update: /qa/<file>.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
After `qa-sentinel` completes:
|
|
148
|
+
- Read its output.
|
|
149
|
+
- Append all findings to `/qa/<file>.md` under the `## Findings` section.
|
|
150
|
+
|
|
151
|
+
**Parallel-agent path (when warranted):**
|
|
152
|
+
|
|
153
|
+
See Step 4 below.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### DEEP — Maximum confidence
|
|
158
|
+
|
|
159
|
+
Run everything in BALANCED, plus:
|
|
160
|
+
|
|
161
|
+
**E2E pass:**
|
|
162
|
+
- Check if an e2e test config exists in the project root (e.g., `playwright.config.ts`, `cypress.config.ts`).
|
|
163
|
+
- If YES: invoke an agent to run the e2e smoke suite (smoke first, full suite if risk is MEDIUM/HIGH). Collect pass/fail and any test output. Append to findings file.
|
|
164
|
+
- If NO: log in findings file: "E2E framework not configured — recommend setting up e2e smoke suite. No e2e tests run."
|
|
165
|
+
|
|
166
|
+
**UI quality checks:**
|
|
167
|
+
- Use MCP Playwright (if available) to open key flows related to the diff and take screenshots, checking for console errors and visual regressions.
|
|
168
|
+
- Validate: login/auth flow, critical navigation, any flow directly touched by the diff.
|
|
169
|
+
|
|
170
|
+
Run the e2e pass in parallel with the `qa-sentinel` FULL VALIDATION (launch both as sub-agents simultaneously).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Step 4 — Parallel Agent Strategy (Balanced/Deep when warranted)
|
|
175
|
+
|
|
176
|
+
Use this when 3+ independent tracks exist.
|
|
177
|
+
|
|
178
|
+
Create a team: `TeamCreate` with name `qa-<CARD-or-timestamp>`.
|
|
179
|
+
|
|
180
|
+
Create tasks:
|
|
181
|
+
- **Task A**: Unit + Lint + TypeScript — `qa-sentinel` quick subset
|
|
182
|
+
- **Task B**: Integration + DB + API contract + Build — `qa-sentinel` full subset
|
|
183
|
+
- **Task C** (Deep only): E2E + UI validation
|
|
184
|
+
- **Task D**: Dev server log inspection + collateral impact analysis on adjacent features
|
|
185
|
+
|
|
186
|
+
Spawn agents in parallel (single message, multiple Task tool calls):
|
|
187
|
+
- Agent A: `qa-sentinel`, tasks A + D
|
|
188
|
+
- Agent B: `qa-sentinel`, task B
|
|
189
|
+
- Agent C (Deep only): general-purpose agent, task C
|
|
190
|
+
|
|
191
|
+
Each agent sends findings to orchestrator via `SendMessage`. Orchestrator consolidates ALL findings into `/qa/<file>.md`.
|
|
192
|
+
|
|
193
|
+
After all agents done: `SendMessage shutdown_request` to each → `TeamDelete`.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Step 5 — Finalize Findings File (Balanced + Deep)
|
|
198
|
+
|
|
199
|
+
After all agents/checks complete, update `/qa/<file>.md` — replace the `## Final Verdict` placeholder:
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
## Final Verdict
|
|
203
|
+
|
|
204
|
+
**QA Verdict**: PASS | FAIL
|
|
205
|
+
**Profile**: <Light | Balanced | Deep>
|
|
206
|
+
**Confidence**: <0–100>%
|
|
207
|
+
**Risk Level**: <Low | Medium | High>
|
|
208
|
+
**Findings**: <N blockers>, <N majors>, <N minors>
|
|
209
|
+
**Next Action**: <none | handoff to coder team | rerun subset | escalate>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Step 6 — Handoff on Failure (Balanced + Deep only)
|
|
215
|
+
|
|
216
|
+
**Only if BLOCKER or MAJOR findings exist:**
|
|
217
|
+
|
|
218
|
+
1. Invoke the **coder** agent (subagent_type: `coder`):
|
|
219
|
+
- Provide: findings file path + instruction to fix all BLOCKERs, fix MAJORs unless they require architectural change, add regression tests for all bug fixes.
|
|
220
|
+
- Do NOT ask the user — proceed directly.
|
|
221
|
+
|
|
222
|
+
2. After coder completes:
|
|
223
|
+
- Re-run LIGHT profile on the fixed files to verify corrections.
|
|
224
|
+
- Invoke `doc-reviewer` and `code-reviewer` in parallel (read-only audit).
|
|
225
|
+
- For DEEP: also re-run e2e smoke tests to verify UI still passes.
|
|
226
|
+
|
|
227
|
+
3. Update `/qa/<file>.md` with post-fix results under a new section `## Post-Fix Verification`.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Step 7 — Console Output (always, at end)
|
|
232
|
+
|
|
233
|
+
Print this block regardless of profile:
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
─────────────────────────────────────────
|
|
237
|
+
QA Verdict: PASS / FAIL
|
|
238
|
+
Profile: Light / Balanced / Deep
|
|
239
|
+
Confidence: <0–100>%
|
|
240
|
+
Risk Level: Low / Medium / High
|
|
241
|
+
Card: <FEAT-XXXX or session ID>
|
|
242
|
+
Findings File: /qa/<file>.md (or "N/A — Light profile")
|
|
243
|
+
─────────────────────────────────────────
|
|
244
|
+
Next Action: <none | handoff to coder team | rerun subset | escalate>
|
|
245
|
+
─────────────────────────────────────────
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Constraints (non-negotiable)
|
|
251
|
+
|
|
252
|
+
- **Never fabricate results.** If a command fails to run, report it as an execution error, not a pass.
|
|
253
|
+
- **Never skip silently.** If a step is skipped, state why explicitly.
|
|
254
|
+
- **Stop on critical failure** — do not continue the suite after a BLOCKER. Diagnose first.
|
|
255
|
+
- **Every bug fix must produce a regression test** covering the exact failure scenario.
|
|
256
|
+
- **No PASS verdict** while any unresolved BLOCKER exists.
|
|
257
|
+
- **Findings file is the single source of truth** — all agents write there; do not split findings across multiple files for the same session.
|