@nklisch/pi-agile-workflow 0.15.3
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/.claude-plugin/plugin.json +10 -0
- package/.codex-plugin/plugin.json +28 -0
- package/CHANGELOG.md +591 -0
- package/README.md +107 -0
- package/docs/ARCHITECTURE.md +716 -0
- package/docs/MIGRATION.md +419 -0
- package/docs/PRINCIPLES.md +464 -0
- package/docs/ROADMAP.md +95 -0
- package/docs/SPEC.md +855 -0
- package/docs/VISION.md +106 -0
- package/extensions/agile-workflow.test.ts +419 -0
- package/extensions/agile-workflow.ts +467 -0
- package/hooks/hooks.json +52 -0
- package/hooks/scripts/prompt-context.py +628 -0
- package/hooks/scripts/substrate-maintainer.py +359 -0
- package/hooks/scripts/test_prompt_context.py +757 -0
- package/package.json +30 -0
- package/scripts/install-work-view.sh +165 -0
- package/scripts/tests/agent-metadata.test.sh +75 -0
- package/scripts/tests/bump-version.test.sh +552 -0
- package/scripts/tests/channel-parity.test.sh +117 -0
- package/scripts/tests/convert-content-integrity.test.sh +246 -0
- package/scripts/tests/convert-install-routing.test.sh +159 -0
- package/scripts/tests/install-work-view.test.sh +411 -0
- package/scripts/tests/pi-package-metadata.test.sh +119 -0
- package/scripts/tests/work-board-shim.test.sh +239 -0
- package/scripts/tests/work-view-dist-version.test.sh +105 -0
- package/scripts/work-board.sh +64 -0
- package/scripts/work-view.sh +423 -0
- package/skills/autopilot/SKILL.md +330 -0
- package/skills/autopilot/agents/openai.yaml +6 -0
- package/skills/board/SKILL.md +62 -0
- package/skills/board/agents/openai.yaml +6 -0
- package/skills/bold-refactor/SKILL.md +244 -0
- package/skills/bold-refactor/agents/openai.yaml +6 -0
- package/skills/bug-scan/SKILL.md +378 -0
- package/skills/bug-scan/agents/openai.yaml +6 -0
- package/skills/bug-scan/references/async-promises.md +119 -0
- package/skills/bug-scan/references/concurrency-races.md +148 -0
- package/skills/bug-scan/references/data-layer.md +167 -0
- package/skills/bug-scan/references/error-handling.md +197 -0
- package/skills/bug-scan/references/gate-item-template.md +94 -0
- package/skills/bug-scan/references/language-footguns.md +219 -0
- package/skills/bug-scan/references/parked-item-template.md +103 -0
- package/skills/bug-scan/references/report-template.md +115 -0
- package/skills/bug-scan/references/resource-leaks.md +199 -0
- package/skills/bug-scan/references/state-closures.md +148 -0
- package/skills/bug-scan/references/time-numbers.md +158 -0
- package/skills/convert/SKILL.md +1463 -0
- package/skills/convert/agents/openai.yaml +6 -0
- package/skills/convert/references/legacy-overlap-migration.md +179 -0
- package/skills/deep-code-scan/SKILL.md +378 -0
- package/skills/deep-code-scan/agents/openai.yaml +6 -0
- package/skills/deep-code-scan/references/artifact-ledger.md +148 -0
- package/skills/deep-code-scan/references/consolidation.md +91 -0
- package/skills/deep-code-scan/references/decomposition.md +127 -0
- package/skills/deep-code-scan/references/item-templates.md +263 -0
- package/skills/deep-code-scan/references/lane-catalog.md +129 -0
- package/skills/deep-code-scan/references/review-gauntlet.md +108 -0
- package/skills/deep-code-scan/references/scanner-brief.md +152 -0
- package/skills/e2e-test-design/SKILL.md +517 -0
- package/skills/e2e-test-design/references/anti-tautology.md +261 -0
- package/skills/e2e-test-design/references/service-mocks.md +234 -0
- package/skills/e2e-test-design/references/test-taxonomy.md +211 -0
- package/skills/epic-design/SKILL.md +476 -0
- package/skills/epicize/SKILL.md +210 -0
- package/skills/epicize/agents/openai.yaml +6 -0
- package/skills/feature-design/SKILL.md +472 -0
- package/skills/fix/SKILL.md +173 -0
- package/skills/gate-cruft/SKILL.md +258 -0
- package/skills/gate-docs/SKILL.md +278 -0
- package/skills/gate-patterns/SKILL.md +389 -0
- package/skills/gate-refactor/SKILL.md +408 -0
- package/skills/gate-security/SKILL.md +275 -0
- package/skills/gate-tests/SKILL.md +367 -0
- package/skills/groom/SKILL.md +162 -0
- package/skills/groom/agents/openai.yaml +6 -0
- package/skills/ideate/SKILL.md +185 -0
- package/skills/ideate/agents/openai.yaml +6 -0
- package/skills/implement/SKILL.md +288 -0
- package/skills/implement-orchestrator/SKILL.md +604 -0
- package/skills/park/SKILL.md +111 -0
- package/skills/perf-design/SKILL.md +427 -0
- package/skills/perf-scout/SKILL.md +404 -0
- package/skills/perf-scout/agents/openai.yaml +6 -0
- package/skills/perf-scout/references/algorithmic-and-data-structures.md +126 -0
- package/skills/perf-scout/references/approximation-and-precomputation.md +136 -0
- package/skills/perf-scout/references/caching-and-memoization.md +123 -0
- package/skills/perf-scout/references/compiler-runtime-and-language.md +136 -0
- package/skills/perf-scout/references/database-and-storage-internals.md +144 -0
- package/skills/perf-scout/references/distributed-systems.md +150 -0
- package/skills/perf-scout/references/game-engine-and-realtime.md +136 -0
- package/skills/perf-scout/references/gpu-and-accelerators.md +130 -0
- package/skills/perf-scout/references/idea-ranking.md +75 -0
- package/skills/perf-scout/references/io-and-batching.md +135 -0
- package/skills/perf-scout/references/memory-and-data-locality.md +137 -0
- package/skills/perf-scout/references/parallelism-and-vectorization.md +126 -0
- package/skills/perf-scout/references/parked-item-template.md +117 -0
- package/skills/perf-scout/references/peer-review-pass.md +150 -0
- package/skills/perf-scout/references/report-template.md +148 -0
- package/skills/principles/SKILL.md +678 -0
- package/skills/principles/references/models.md +191 -0
- package/skills/principles/references/subagents.md +158 -0
- package/skills/prose-author/SKILL.md +185 -0
- package/skills/refactor-conventions-creator/SKILL.md +359 -0
- package/skills/refactor-conventions-creator/agents/openai.yaml +6 -0
- package/skills/refactor-conventions-creator/references/common-structures.md +91 -0
- package/skills/refactor-conventions-creator/references/common-styles.md +90 -0
- package/skills/refactor-design/SKILL.md +384 -0
- package/skills/release-deploy/SKILL.md +667 -0
- package/skills/release-deploy/agents/openai.yaml +6 -0
- package/skills/research/SKILL.md +166 -0
- package/skills/research/agents/openai.yaml +6 -0
- package/skills/review/SKILL.md +267 -0
- package/skills/review/references/deep-review.md +98 -0
- package/skills/review/references/review-lenses.md +68 -0
- package/skills/review/references/substrate-side-effects.md +161 -0
- package/skills/review/references/target-resolution.md +52 -0
- package/skills/scope/SKILL.md +486 -0
- package/work-view/Cargo.lock +486 -0
- package/work-view/Cargo.toml +9 -0
- package/work-view/crates/cli/.work-view-version +1 -0
- package/work-view/crates/cli/Cargo.toml +18 -0
- package/work-view/crates/cli/src/actionable.rs +500 -0
- package/work-view/crates/cli/src/args.rs +792 -0
- package/work-view/crates/cli/src/board/assets/board.css +855 -0
- package/work-view/crates/cli/src/board/assets/board.js +259 -0
- package/work-view/crates/cli/src/board/assets/card.js +139 -0
- package/work-view/crates/cli/src/board/assets/components.css +290 -0
- package/work-view/crates/cli/src/board/assets/dependency.js +1193 -0
- package/work-view/crates/cli/src/board/assets/detail.js +256 -0
- package/work-view/crates/cli/src/board/assets/filters.js +389 -0
- package/work-view/crates/cli/src/board/assets/index.html +77 -0
- package/work-view/crates/cli/src/board/assets/kanban.js +231 -0
- package/work-view/crates/cli/src/board/assets/markdown.js +260 -0
- package/work-view/crates/cli/src/board/assets/motion.css +131 -0
- package/work-view/crates/cli/src/board/assets/state.js +245 -0
- package/work-view/crates/cli/src/board/assets/table.js +304 -0
- package/work-view/crates/cli/src/board/assets/tokens.css +602 -0
- package/work-view/crates/cli/src/board/assets/views.js +41 -0
- package/work-view/crates/cli/src/board/assets.rs +162 -0
- package/work-view/crates/cli/src/board/feed.rs +204 -0
- package/work-view/crates/cli/src/board/mod.rs +246 -0
- package/work-view/crates/cli/src/board/open.rs +144 -0
- package/work-view/crates/cli/src/board/server.rs +407 -0
- package/work-view/crates/cli/src/main.rs +195 -0
- package/work-view/crates/cli/src/render.rs +354 -0
- package/work-view/crates/cli/src/scope.rs +157 -0
- package/work-view/crates/cli/src/stale.rs +581 -0
- package/work-view/crates/cli/tests/board-js/dependency-table.test.mjs +64 -0
- package/work-view/crates/cli/tests/board-js/expanded-browsing.test.mjs +79 -0
- package/work-view/crates/cli/tests/board-js/harness-smoke.test.mjs +11 -0
- package/work-view/crates/cli/tests/board-js/harness.mjs +437 -0
- package/work-view/crates/cli/tests/board-js/kanban-detail.test.mjs +75 -0
- package/work-view/crates/cli/tests/board-js/markdown-filter.test.mjs +60 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/CONVENTIONS.md +3 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/epics/epic-alpha.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-a.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-b.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-alpha-1.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-research-1.md +19 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-done.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-shipped.md +18 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/backlog/idea-backlog.md +7 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/CONVENTIONS.md +6 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-dep-done.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-design-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-impl-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/stories/story-review-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/CONVENTIONS.md +4 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/epics/malformed-no-closing-fence.md +8 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/features/good-item.md +16 -0
- package/work-view/crates/cli/tests/integration.rs +2833 -0
- package/work-view/crates/core/Cargo.toml +13 -0
- package/work-view/crates/core/src/error.rs +61 -0
- package/work-view/crates/core/src/filter.rs +804 -0
- package/work-view/crates/core/src/graph.rs +324 -0
- package/work-view/crates/core/src/index.rs +590 -0
- package/work-view/crates/core/src/lib.rs +54 -0
- package/work-view/crates/core/src/model.rs +202 -0
- package/work-view/crates/core/src/parse.rs +494 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/CONVENTIONS.md +15 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/epics/epic-core.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-parser.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-query.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/malformed-no-id.md +15 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-parse-unit.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-security-gate.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-old.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-parser.md +17 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/backlog/idea-future-board.md +7 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/CONVENTIONS.md +10 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/archive/dup-item.md +18 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/releases/v2.0/dup-item.md +18 -0
- package/work-view/crates/core/tests/integration.rs +541 -0
- package/work-view/dist/.gitattributes +1 -0
- package/work-view/dist/README.md +42 -0
- package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
- package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
- package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
- package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: e2e-test-design
|
|
3
|
+
description: >
|
|
4
|
+
ALWAYS invoke this skill when the user asks to design e2e tests, audit or bootstrap the e2e program,
|
|
5
|
+
or work on a [e2e-test]/[testing] feature at stage:drafting. Designs service-level-mocked e2e
|
|
6
|
+
coverage, writes the design into the feature body, spawns child stories with depends_on chains, and
|
|
7
|
+
advances drafting to implementing. Supports golden-path, failure-mode, chaos, and fuzzing coverage,
|
|
8
|
+
plus --bootstrap and --audit modes.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# E2E-Test-Design
|
|
12
|
+
|
|
13
|
+
You design e2e tests in the agile-workflow substrate. The design lives in the
|
|
14
|
+
feature item's body — there is no separate `docs/designs/<name>.md`. As the
|
|
15
|
+
design takes shape, child stories are spawned with declared `depends_on`
|
|
16
|
+
chains. When the design is done, you advance the feature's stage
|
|
17
|
+
`drafting → implementing`.
|
|
18
|
+
|
|
19
|
+
This skill is the fourth member of the design family alongside `feature-design`,
|
|
20
|
+
`refactor-design`, and `perf-design`. The family routes by item kind and tags:
|
|
21
|
+
|
|
22
|
+
- `epic-design` — `kind: epic` at `stage: drafting`
|
|
23
|
+
- `feature-design` — `kind: feature`, no specialized tag
|
|
24
|
+
- `refactor-design` — `kind: feature` with `tags: [refactor]`
|
|
25
|
+
- `perf-design` — `kind: feature` with `tags: [perf]`
|
|
26
|
+
- `e2e-test-design` (this skill) — `kind: feature` with `tags: [e2e-test]` or `tags: [testing]`
|
|
27
|
+
|
|
28
|
+
If the feature you're looking at has `[refactor]` or `[perf]` in `tags`, you
|
|
29
|
+
were misrouted. Don't try to design it — log a one-line note to the item body
|
|
30
|
+
("Misrouted to e2e-test-design; should have gone to refactor-design /
|
|
31
|
+
perf-design based on tags") and return without advancing the stage.
|
|
32
|
+
|
|
33
|
+
## Distinct from gate-tests
|
|
34
|
+
|
|
35
|
+
`/agile-workflow:gate-tests` audits **per-release coverage of acceptance
|
|
36
|
+
criteria** for a release bundle — its findings get `gate_origin: tests`. This
|
|
37
|
+
skill is design-time work on the **test program's shape** — taxonomy
|
|
38
|
+
(golden / failure / chaos / fuzzing), infrastructure (service-level mocks),
|
|
39
|
+
journey coverage, suite-level tautology. They are complementary, not
|
|
40
|
+
overlapping. When `--audit --release <v>` is invoked, this skill produces
|
|
41
|
+
items with `gate_origin: tests` and `release_binding: <v>`, plugging into the
|
|
42
|
+
same gate channel.
|
|
43
|
+
|
|
44
|
+
## Trigger
|
|
45
|
+
|
|
46
|
+
Auto-triggers when the agent identifies a feature at `stage: drafting` ready
|
|
47
|
+
for e2e test design with `tags: [e2e-test]` or `tags: [testing]`. Common
|
|
48
|
+
phrases:
|
|
49
|
+
|
|
50
|
+
- "design e2e tests for X"
|
|
51
|
+
- "design the failure-mode tests"
|
|
52
|
+
- "plan chaos tests for the payment service"
|
|
53
|
+
- "seed an e2e test program" → bootstrap mode
|
|
54
|
+
- "audit our e2e tests" → audit mode
|
|
55
|
+
|
|
56
|
+
## Invocation modes
|
|
57
|
+
|
|
58
|
+
| Invocation | Mode | Behavior |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `<feature-id>` (default) | item-bound | Full design pass on one feature with `[e2e-test]` or `[testing]` tag — Phases 1-9. |
|
|
61
|
+
| `--bootstrap` | bootstrap | Seed an e2e test epic + child features when none exists. Phases B1-B5. |
|
|
62
|
+
| `--audit` | audit (ad-hoc) | Scan existing test program for shape gaps; produce items at `.work/active/` with `gate_origin: null`. Phases A1-A5. |
|
|
63
|
+
| `--audit --release <version>` | audit (gate) | Same as audit, but produced items get `gate_origin: tests` and `release_binding: <version>` for `release-deploy` integration. |
|
|
64
|
+
|
|
65
|
+
## Mock-boundary policy
|
|
66
|
+
|
|
67
|
+
The design must use **service-level mocks only**. This is the single most
|
|
68
|
+
important quality lever for e2e tests. The ladder, in priority order:
|
|
69
|
+
|
|
70
|
+
1. **Off-the-shelf service mock** (preferred) — LocalStack for AWS,
|
|
71
|
+
Testcontainers for databases, WireMock / Mockoon for HTTP APIs, MailHog
|
|
72
|
+
for SMTP, MinIO for S3, redpanda for Kafka, Keycloak for OAuth, Toxiproxy
|
|
73
|
+
for network failure injection. See `references/service-mocks.md`.
|
|
74
|
+
2. **Custom mock container** (fallback) — when no off-the-shelf service mock
|
|
75
|
+
exists, design a small purpose-built container (Flask / FastAPI / Express
|
|
76
|
+
server with deterministic behavior; or a configured WireMock instance) and
|
|
77
|
+
bring it up via docker-compose. Patterns in `references/service-mocks.md`.
|
|
78
|
+
3. **In-process mock** (last resort) — only when (1) and (2) are genuinely
|
|
79
|
+
infeasible. The design must document **strong justification**: the specific
|
|
80
|
+
external dep, why no service-level substitute can exist, what behavior the
|
|
81
|
+
mock is replacing. Audit mode actively challenges in-process mocks and
|
|
82
|
+
proposes promotion to custom containers.
|
|
83
|
+
|
|
84
|
+
## Workflow — item-bound mode
|
|
85
|
+
|
|
86
|
+
### Phase 1: Read the feature item
|
|
87
|
+
|
|
88
|
+
Read `.work/active/features/<id>.md`. Confirm:
|
|
89
|
+
- `kind: feature`
|
|
90
|
+
- `stage: drafting`
|
|
91
|
+
- `tags` includes `e2e-test` or `testing`
|
|
92
|
+
- `tags` does NOT include `refactor` or `perf` (otherwise log misroute and return)
|
|
93
|
+
|
|
94
|
+
The body should already have a brief. Use it as the seed.
|
|
95
|
+
|
|
96
|
+
### Phase 2: Ground yourself
|
|
97
|
+
|
|
98
|
+
The `principles` skill auto-loads. Read:
|
|
99
|
+
1. `docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md`
|
|
100
|
+
2. `AGENTS.md` / `CLAUDE.md` (root, `.agents/`, or `.claude/`; AGENTS is canonical)
|
|
101
|
+
2a. `.agents/rules/*.md` (if present) — the project's force-loaded agent rules
|
|
102
|
+
(tag semantics, test integrity, review policy)
|
|
103
|
+
3. Parent epic body at `.work/active/epics/<parent>.md` if `parent` is set
|
|
104
|
+
4. Foundation docs and existing test infrastructure docs in `docs/research/` if present
|
|
105
|
+
|
|
106
|
+
### Phase 3: Map the codebase and the testable surface
|
|
107
|
+
|
|
108
|
+
Run a read-first scope-size probe before spawning exploratory sub-agents:
|
|
109
|
+
|
|
110
|
+
1. Use Glob/`rg --files` to find entry points, existing e2e/integration tests,
|
|
111
|
+
fixtures, and service-adapter boundaries.
|
|
112
|
+
2. Use Grep/`rg` for route names, CLI commands, exported modules, dependency
|
|
113
|
+
clients, and mock helpers.
|
|
114
|
+
3. Read 2-5 representative app/test files yourself.
|
|
115
|
+
|
|
116
|
+
Then choose the dispatch size:
|
|
117
|
+
|
|
118
|
+
- **Small/bounded surface** — one entry point or obvious journey: skip exploratory fanout
|
|
119
|
+
and map directly.
|
|
120
|
+
- **Medium/unclear surface** — one service but fuzzy dependencies/tests: use one
|
|
121
|
+
focused exploratory sub-agent.
|
|
122
|
+
- **Broad/cross-service surface** — separate journey, dependency, and test
|
|
123
|
+
infrastructure questions: spawn parallel read-only exploratory sub-agents.
|
|
124
|
+
|
|
125
|
+
For exploratory fanout:
|
|
126
|
+
- Use the host's generic/general-purpose subagent prompted with the explorer
|
|
127
|
+
capsule from `../principles/references/subagents.md`, at medium reasoning by
|
|
128
|
+
default.
|
|
129
|
+
- Use high or strongest reviewer reasoning for large or complex codebases.
|
|
130
|
+
- If no generic subagent adapter is available, keep direct host-local mapping.
|
|
131
|
+
|
|
132
|
+
Possible prompts:
|
|
133
|
+
1. **Surfaces & journeys** — entry points (CLI, HTTP routes, exported modules),
|
|
134
|
+
primary user journeys traceable from entry to outcome
|
|
135
|
+
2. **External dependencies** — what does this service talk to? (DBs, APIs,
|
|
136
|
+
queues, object stores, email, auth) — needed for the service-mock plan
|
|
137
|
+
3. **Existing test infrastructure** — frameworks, fixtures, runners, existing
|
|
138
|
+
`tests/e2e/` or equivalent; existing mocks (flag in-process mocks as items
|
|
139
|
+
for audit)
|
|
140
|
+
|
|
141
|
+
After direct reading or Explore results, **read 2-3 key files yourself** to
|
|
142
|
+
verify.
|
|
143
|
+
|
|
144
|
+
### Phase 4: Re-align to project standards
|
|
145
|
+
|
|
146
|
+
Re-read `AGENTS.md` / `CLAUDE.md` if present at root, `.agents/`, or
|
|
147
|
+
`.claude/`, plus `.agents/rules/*.md` (if present) — the project's force-loaded
|
|
148
|
+
agent rules (tag semantics, test integrity, review policy). Treat AGENTS as
|
|
149
|
+
canonical when they disagree. Recency improves adherence.
|
|
150
|
+
|
|
151
|
+
### Phase 4.5: Surface ambiguities
|
|
152
|
+
|
|
153
|
+
Read the brief and the discovery results. Derive specific, concrete design
|
|
154
|
+
questions about *this* feature's actual work — taxonomy scope, journey
|
|
155
|
+
priorities, mock-boundary edge cases (any deps where you genuinely can't find
|
|
156
|
+
a service-level substitute?), test-data strategy, what "chaos" means in this
|
|
157
|
+
project's context.
|
|
158
|
+
|
|
159
|
+
Skip anything the brief, parent epic, foundation docs, or codebase already
|
|
160
|
+
pin. Aim for 2-5 questions.
|
|
161
|
+
|
|
162
|
+
**Caller-awareness rule (mirrors feature-design):**
|
|
163
|
+
|
|
164
|
+
- Running under an active autopilot run or harness goal? Resolve with judgment
|
|
165
|
+
(consistent with foundation docs > simpler > defers irreversible decisions)
|
|
166
|
+
and log under `## Design decisions` in the body.
|
|
167
|
+
- Otherwise (including under harness auto mode): ask via `structured question tool`
|
|
168
|
+
before locking in. Harness-level "work without pausing" reminders do NOT
|
|
169
|
+
suppress these checkpoints.
|
|
170
|
+
|
|
171
|
+
If the body already has `## Design decisions` from a prior pass, treat those
|
|
172
|
+
as inputs — don't re-ask.
|
|
173
|
+
|
|
174
|
+
### Phase 5: Design the test program
|
|
175
|
+
|
|
176
|
+
The substantive phase. Don't rush.
|
|
177
|
+
|
|
178
|
+
#### 5a. Mock-boundary plan
|
|
179
|
+
|
|
180
|
+
For each external dependency the discovery found, walk the mock ladder:
|
|
181
|
+
1. Name the off-the-shelf service mock if one exists. Cite version + image.
|
|
182
|
+
2. If none, design the custom mock container. Pick the framework by this
|
|
183
|
+
ladder, in order:
|
|
184
|
+
- Match the **upstream service's own tech** if known (e.g., if you're
|
|
185
|
+
mocking a Ruby-on-Rails internal API, a Rails skeleton is the most
|
|
186
|
+
faithful substitute)
|
|
187
|
+
- Match the **project's primary stack** (one less language to maintain)
|
|
188
|
+
- Ask the user if neither suggests an obvious choice
|
|
189
|
+
Do NOT default to a single language — over-indexing on one framework is
|
|
190
|
+
exactly how mock containers become alien to the project they serve.
|
|
191
|
+
Describe the endpoints/behaviors the container must emulate and the
|
|
192
|
+
docker-compose service shape.
|
|
193
|
+
3. If neither is feasible, write the strong justification for an in-process
|
|
194
|
+
mock and what it replaces.
|
|
195
|
+
|
|
196
|
+
Reference `references/service-mocks.md` for the catalog.
|
|
197
|
+
|
|
198
|
+
#### 5b. Taxonomy plan
|
|
199
|
+
|
|
200
|
+
For each test style, decide whether it applies to this feature and what it
|
|
201
|
+
covers. Reference `references/test-taxonomy.md`.
|
|
202
|
+
|
|
203
|
+
- **Golden path** — almost always applies. Pick 3-5 critical user journeys.
|
|
204
|
+
- **Failure mode** — almost always applies. Per the failure-mode catalog:
|
|
205
|
+
invalid input, missing config, unavailable dependency, boundary values,
|
|
206
|
+
permission failures, interrupted operations.
|
|
207
|
+
- **Chaos** — applies when the system has retry / fallback / graceful-degrade
|
|
208
|
+
behaviors. Without those, chaos tests have nothing to verify. Tools:
|
|
209
|
+
Toxiproxy for network injection, Pumba for container kill, libfaketime for
|
|
210
|
+
clock skew.
|
|
211
|
+
- **Fuzzing** — applies to parsers, serializers, and input-validation
|
|
212
|
+
boundaries. Pick property-based (Hypothesis / fast-check / proptest),
|
|
213
|
+
mutation, or grammar-based per the data shape.
|
|
214
|
+
|
|
215
|
+
#### 5c. Anti-tautology guardrails
|
|
216
|
+
|
|
217
|
+
Every test in the design must:
|
|
218
|
+
- Assert on **user-visible outcomes** (HTTP responses, file contents, exit
|
|
219
|
+
codes, side effects), not on internal call traces or mock invocations
|
|
220
|
+
- Run against the **real product** (or its containerized copy), not against
|
|
221
|
+
a mocked replacement for the product itself
|
|
222
|
+
- State its **invariant** in plain English in the design notes (one line —
|
|
223
|
+
"after a successful checkout, the order row is created and the user
|
|
224
|
+
receives an email"). If you can't write the invariant, the test is
|
|
225
|
+
tautological.
|
|
226
|
+
|
|
227
|
+
Reference `references/anti-tautology.md` for the full pattern catalog.
|
|
228
|
+
|
|
229
|
+
#### 5d. Test-integrity rules baked into the design
|
|
230
|
+
|
|
231
|
+
The design must teach implementers how to handle failures honestly:
|
|
232
|
+
|
|
233
|
+
- **Park production bugs, don't hide them.** If a test the design specs
|
|
234
|
+
will fail because the product is genuinely broken, the implementer
|
|
235
|
+
parks the bug via `/agile-workflow:park`, lands the failing test with
|
|
236
|
+
a `skip`/`xfail` linked to the backlog id and a one-line reason, and
|
|
237
|
+
proceeds. The failing test is a feature, not a defect.
|
|
238
|
+
- **Fix bad tests in-session.** Stale fixtures, drifted assertions,
|
|
239
|
+
drifted mocks — repair as part of the stride.
|
|
240
|
+
- **Never game an assertion to make it pass.** No
|
|
241
|
+
`expect(true).toBe(true)`, no asserting on whatever the code happens
|
|
242
|
+
to return now, no deleting a flaky test without root-causing.
|
|
243
|
+
|
|
244
|
+
Cite this section in each child story's body so it's repeated where the
|
|
245
|
+
implementer reads it.
|
|
246
|
+
|
|
247
|
+
#### 5d. Design each unit
|
|
248
|
+
|
|
249
|
+
For each test unit, specify:
|
|
250
|
+
- **Exact file path** (e.g., `tests/e2e/checkout-happy-path.spec.ts`)
|
|
251
|
+
- **Test framework + scaffold** in the project's language (`describe`/`it`,
|
|
252
|
+
`test(...)`, etc.)
|
|
253
|
+
- **Setup** — what the docker-compose stack brings up, what seed data exists
|
|
254
|
+
- **Invariant statement** (one line, user-visible)
|
|
255
|
+
- **Assertion targets** (named, concrete)
|
|
256
|
+
- **Teardown**
|
|
257
|
+
|
|
258
|
+
The infrastructure unit comes first and produces a single docker-compose file
|
|
259
|
+
+ test fixtures/helpers.
|
|
260
|
+
|
|
261
|
+
### Phase 5.5: Pre-mortem
|
|
262
|
+
|
|
263
|
+
Attack the design:
|
|
264
|
+
- Which mock decisions are weakest?
|
|
265
|
+
- Which journey did you assume but never verified in the discovery?
|
|
266
|
+
- What test, if it fails, would tell you nothing useful?
|
|
267
|
+
- Where is the suite most likely to become flaky?
|
|
268
|
+
|
|
269
|
+
Revise or add a spike unit if a serious risk surfaces. Document in `## Risks`.
|
|
270
|
+
|
|
271
|
+
### Phase 6: Decompose into stories
|
|
272
|
+
|
|
273
|
+
The natural decomposition:
|
|
274
|
+
|
|
275
|
+
1. **Story `<feature-id>-infra`** — docker-compose stack + custom mock
|
|
276
|
+
containers + test fixtures/helpers. Blocks every other story.
|
|
277
|
+
2. **Story `<feature-id>-golden`** — golden-path tests.
|
|
278
|
+
3. **Story `<feature-id>-failure`** — failure-mode tests.
|
|
279
|
+
4. **Story `<feature-id>-chaos`** (if applicable) — chaos tests. Depends on
|
|
280
|
+
golden — chaos verifies graceful degradation of already-tested paths.
|
|
281
|
+
5. **Story `<feature-id>-fuzz`** (if applicable) — fuzzing harness.
|
|
282
|
+
|
|
283
|
+
For each story file at `.work/active/stories/<feature-id>-<slug>.md`:
|
|
284
|
+
- `kind: story`, `stage: implementing`, `parent: <feature-id>`,
|
|
285
|
+
`depends_on: [...]`, `tags: [e2e-test, testing]`
|
|
286
|
+
- Body: scope, units it implements, acceptance criteria
|
|
287
|
+
|
|
288
|
+
Run `.work/bin/work-view --blocking <story-id>` before adding any
|
|
289
|
+
`depends_on` entry — cycle check is mandatory.
|
|
290
|
+
|
|
291
|
+
### Phase 7: Write design INTO the feature body
|
|
292
|
+
|
|
293
|
+
Append (after the existing brief):
|
|
294
|
+
|
|
295
|
+
```markdown
|
|
296
|
+
## Mock-boundary plan
|
|
297
|
+
<table or list: external dep → service-level mock used, with strong-justification
|
|
298
|
+
notes for any in-process mocks>
|
|
299
|
+
|
|
300
|
+
## Taxonomy plan
|
|
301
|
+
- Golden: <count> tests covering <journeys>
|
|
302
|
+
- Failure: <count> tests covering <categories>
|
|
303
|
+
- Chaos: <count> tests (or "not applicable — no retry/fallback behavior")
|
|
304
|
+
- Fuzz: <count> harnesses (or "not applicable — no parser/validator surface")
|
|
305
|
+
|
|
306
|
+
## Implementation Units
|
|
307
|
+
|
|
308
|
+
### Unit 1: Infrastructure
|
|
309
|
+
**File**: `tests/e2e/docker-compose.test.yml` + `tests/e2e/fixtures/`
|
|
310
|
+
**Story**: `<feature-id>-infra`
|
|
311
|
+
...
|
|
312
|
+
|
|
313
|
+
### Unit N: <name>
|
|
314
|
+
**File**: `tests/e2e/<slug>.spec.<ext>`
|
|
315
|
+
**Story**: `<feature-id>-<slug>`
|
|
316
|
+
**Invariant**: <one-line user-visible assertion target>
|
|
317
|
+
|
|
318
|
+
\`\`\`<lang>
|
|
319
|
+
// test scaffold — describe/it/test, setup/teardown, assertion targets named
|
|
320
|
+
\`\`\`
|
|
321
|
+
|
|
322
|
+
**Acceptance Criteria**:
|
|
323
|
+
- [ ] <testable assertion>
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Implementation Order
|
|
328
|
+
1. <story>
|
|
329
|
+
2. <story>
|
|
330
|
+
|
|
331
|
+
## Risks
|
|
332
|
+
<from pre-mortem, if any>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Phase 8: Advance stage and commit
|
|
336
|
+
|
|
337
|
+
1. Edit the feature file's frontmatter: `stage: drafting → implementing`.
|
|
338
|
+
PostToolUse hook auto-bumps `updated:`.
|
|
339
|
+
2. Commit:
|
|
340
|
+
```bash
|
|
341
|
+
git add .work/active/features/<id>.md .work/active/stories/<feature-id>-*.md
|
|
342
|
+
git commit -m "e2e-test-design: <feature-id> (<N> child stories)"
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Workflow — `--bootstrap` mode
|
|
346
|
+
|
|
347
|
+
For projects that have `.work/` but no e2e test epic yet.
|
|
348
|
+
|
|
349
|
+
### Phase B1: Sanity check
|
|
350
|
+
|
|
351
|
+
- Confirm `.work/CONVENTIONS.md` exists (else direct user to
|
|
352
|
+
`/agile-workflow:convert`)
|
|
353
|
+
- Scan for existing e2e test epic:
|
|
354
|
+
```bash
|
|
355
|
+
.work/bin/work-view --kind epic --tag e2e-test --paths
|
|
356
|
+
```
|
|
357
|
+
If non-empty, refuse: "E2E test epic already exists at <path>. Run
|
|
358
|
+
`/agile-workflow:e2e-test-design <feature-id>` against one of its child
|
|
359
|
+
features instead."
|
|
360
|
+
|
|
361
|
+
### Phase B2: Discovery
|
|
362
|
+
|
|
363
|
+
Run the Phase 3 read-first probe project-wide. If the testable surface is small
|
|
364
|
+
or obvious, map it directly. If the project is broad, use the same three Explore
|
|
365
|
+
prompts from Phase 3, project-wide rather than feature-scoped.
|
|
366
|
+
|
|
367
|
+
### Phase B3: Strategy checkpoint
|
|
368
|
+
|
|
369
|
+
`structured question tool` (always — bootstrap is interactive-only):
|
|
370
|
+
- Which taxonomy layers to include? (golden, failure are default-on; chaos
|
|
371
|
+
and fuzz are decisions)
|
|
372
|
+
- Custom-mock budget — how many off-the-shelf service mocks does the discovery
|
|
373
|
+
find? How many deps would require custom containers? Surface the trade-off.
|
|
374
|
+
|
|
375
|
+
### Phase B4: Seed epic + features
|
|
376
|
+
|
|
377
|
+
Create `.work/active/epics/e2e-test-program.md` at `stage: drafting` with
|
|
378
|
+
`tags: [e2e-test, testing]`, body describing the test program's scope and
|
|
379
|
+
mock policy.
|
|
380
|
+
|
|
381
|
+
Spawn child features at `stage: drafting` with `tags: [e2e-test]`, `parent:
|
|
382
|
+
e2e-test-program`, `depends_on` chains:
|
|
383
|
+
- `infrastructure-and-service-mocks` (no deps)
|
|
384
|
+
- `golden-path-journeys` (depends on infra)
|
|
385
|
+
- `failure-mode-coverage` (depends on infra)
|
|
386
|
+
- `chaos-scenarios` (depends on golden) — only if chosen
|
|
387
|
+
- `fuzzing-harness` (depends on infra) — only if chosen
|
|
388
|
+
|
|
389
|
+
### Phase B5: Commit + handoff
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
git add .work/active/epics/e2e-test-program.md .work/active/features/<seeded>*
|
|
393
|
+
git commit -m "e2e-test-design --bootstrap: seed e2e test program"
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Direct the user: "Run `/agile-workflow:e2e-test-design <feature-id>` against
|
|
397
|
+
each child feature, or start an autopilot goal for `e2e-test-program` to drive
|
|
398
|
+
the program end-to-end."
|
|
399
|
+
|
|
400
|
+
## Workflow — `--audit` mode
|
|
401
|
+
|
|
402
|
+
For projects with an existing e2e suite. Produces items as findings.
|
|
403
|
+
|
|
404
|
+
### Phase A1: Detect the suite
|
|
405
|
+
|
|
406
|
+
Look for canonical locations: `tests/e2e/`, `e2e/`, `cypress/`, `playwright/`,
|
|
407
|
+
`tests/integration/`. If nothing found, refuse: "No e2e suite detected.
|
|
408
|
+
Run `--bootstrap` to seed one."
|
|
409
|
+
|
|
410
|
+
### Phase A2: Dispatch audit scanner
|
|
411
|
+
|
|
412
|
+
Spawn ONE deep scanner agent with the audit brief. Use a generic sub-agent prompted with the scanner posture from `../principles/references/subagents.md` and the host's source-read-only
|
|
413
|
+
deep inspection path with high reviewer reasoning; use extra-high reasoning only
|
|
414
|
+
for large suites, complex mock-boundary audits, or repeated escaped tautologies.
|
|
415
|
+
If no generic scanner subagent adapter is available, run the audit inline and record the
|
|
416
|
+
reduced isolation in the feature body.
|
|
417
|
+
|
|
418
|
+
The scanner reads test files (NOT implementation code — that's how tautologies
|
|
419
|
+
hide), maps the suite against the four taxonomy layers, scans for mock-boundary
|
|
420
|
+
violations (in-process mocks where service-level is possible), and returns
|
|
421
|
+
structured findings.
|
|
422
|
+
|
|
423
|
+
The audit brief enforces the same `references/anti-tautology.md` heuristics
|
|
424
|
+
the design phase uses, plus the mock-ladder challenge from the mock policy.
|
|
425
|
+
|
|
426
|
+
### Phase A3: Triage with the user
|
|
427
|
+
|
|
428
|
+
`structured question tool`: present finding counts by severity (Critical / High /
|
|
429
|
+
Medium / Low). User confirms which to file as items.
|
|
430
|
+
|
|
431
|
+
Skipping triage for active autopilot-driven invocations: classify all Critical
|
|
432
|
+
and High automatically; route Medium and Low to `.work/backlog/`.
|
|
433
|
+
|
|
434
|
+
### Phase A4: File items
|
|
435
|
+
|
|
436
|
+
For each accepted finding, create a story at `.work/active/stories/`:
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
---
|
|
440
|
+
id: e2e-audit-<short-slug>
|
|
441
|
+
kind: story
|
|
442
|
+
stage: drafting
|
|
443
|
+
tags: [testing, e2e-test, audit]
|
|
444
|
+
parent: null
|
|
445
|
+
depends_on: []
|
|
446
|
+
release_binding: <version> | null # set only if --release was passed
|
|
447
|
+
gate_origin: tests | null # set to "tests" only if --release was passed
|
|
448
|
+
created: YYYY-MM-DD
|
|
449
|
+
updated: YYYY-MM-DD
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
# <finding title>
|
|
453
|
+
|
|
454
|
+
## Severity
|
|
455
|
+
Critical | High | Medium | Low
|
|
456
|
+
|
|
457
|
+
## Finding type
|
|
458
|
+
mock-boundary-violation | missing-taxonomy-layer | journey-gap | tautology
|
|
459
|
+
|
|
460
|
+
## Evidence
|
|
461
|
+
<file:line citations from the audited suite>
|
|
462
|
+
|
|
463
|
+
## Suggested remedy
|
|
464
|
+
<promote in-process mock to custom container | add chaos coverage | rewrite
|
|
465
|
+
tautological test against invariant | ...>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Phase A5: Commit
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
git add .work/active/stories/e2e-audit-*.md .work/backlog/
|
|
472
|
+
git commit -m "e2e-test-design --audit: <N> findings (gate=<version>)"
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## Output
|
|
476
|
+
|
|
477
|
+
**Item-bound mode** (in conversation):
|
|
478
|
+
- **Designed**: `<feature-id>` advanced to `stage: implementing`
|
|
479
|
+
- **Mock plan**: counts (off-the-shelf vs custom vs in-process)
|
|
480
|
+
- **Child stories**: list with `depends_on` chains
|
|
481
|
+
- **Risks flagged**: list (or "none")
|
|
482
|
+
- **Next**: `/agile-workflow:implement-orchestrator <feature-id>`
|
|
483
|
+
|
|
484
|
+
**Bootstrap mode**:
|
|
485
|
+
- **Seeded epic**: `e2e-test-program`
|
|
486
|
+
- **Child features**: list (one per taxonomy layer chosen + infra)
|
|
487
|
+
- **Next**: `/agile-workflow:e2e-test-design <feature-id>` per child, or an
|
|
488
|
+
autopilot goal for `e2e-test-program`
|
|
489
|
+
|
|
490
|
+
**Audit mode**:
|
|
491
|
+
- **Suite path**: detected location
|
|
492
|
+
- **Findings by severity**: counts
|
|
493
|
+
- **Items created**: count with new ids
|
|
494
|
+
- **Gate binding**: `<version>` if `--release` was passed, else `none`
|
|
495
|
+
|
|
496
|
+
## Guardrails
|
|
497
|
+
|
|
498
|
+
- Design lives in the feature's body. NEVER create `docs/designs/<name>.md` —
|
|
499
|
+
that's the workflow plugin's pattern.
|
|
500
|
+
- **Mock-boundary policy is non-negotiable.** In-process mocks must carry
|
|
501
|
+
strong written justification, or the design is incomplete.
|
|
502
|
+
- **Tests assert user-visible outcomes**, never mock invocations. If the
|
|
503
|
+
assertion target is a `mock.assert_called_with(...)`, the test is
|
|
504
|
+
tautological — see `references/anti-tautology.md`.
|
|
505
|
+
- The audit mode reads **test files, not implementation code**. Reading
|
|
506
|
+
implementation to decide what to verify is the same mistake the audited
|
|
507
|
+
tests likely made.
|
|
508
|
+
- Cycle prevention on `depends_on` is mandatory. Use `work-view --blocking`.
|
|
509
|
+
- `gate_origin` is enum-constrained: only `tests` (when `--release` is set in
|
|
510
|
+
audit mode) or `null`. Never invent values.
|
|
511
|
+
- Don't pre-populate stages beyond `implementing` on child stories. Stages
|
|
512
|
+
advance through actual work.
|
|
513
|
+
- **Test integrity is part of the design contract.** Each child story's
|
|
514
|
+
body must restate Phase 5d's rules so the implementer reads them at
|
|
515
|
+
authoring time, not just at gate time: park production bugs, fix bad
|
|
516
|
+
tests, never game an assertion. A green suite that lies is worse than
|
|
517
|
+
a red suite that documents what's broken.
|