@bastani/atomic 0.6.5 → 0.6.6-1
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/.agents/skills/ado-commit/SKILL.md +2 -0
- package/.agents/skills/ado-create-pr/SKILL.md +2 -0
- package/.agents/skills/advanced-evaluation/SKILL.md +2 -0
- package/.agents/skills/ast-grep/SKILL.md +2 -0
- package/.agents/skills/bdi-mental-states/SKILL.md +2 -0
- package/.agents/skills/bun/SKILL.md +156 -122
- package/.agents/skills/context-compression/SKILL.md +2 -0
- package/.agents/skills/context-degradation/SKILL.md +2 -0
- package/.agents/skills/context-fundamentals/SKILL.md +2 -0
- package/.agents/skills/context-optimization/SKILL.md +2 -0
- package/.agents/skills/create-spec/SKILL.md +2 -0
- package/.agents/skills/docx/SKILL.md +2 -0
- package/.agents/skills/evaluation/SKILL.md +2 -0
- package/.agents/skills/explain-code/SKILL.md +2 -0
- package/.agents/skills/filesystem-context/SKILL.md +2 -0
- package/.agents/skills/find-skills/SKILL.md +2 -0
- package/.agents/skills/gh-commit/SKILL.md +2 -0
- package/.agents/skills/gh-create-pr/SKILL.md +2 -0
- package/.agents/skills/hosted-agents/SKILL.md +2 -0
- package/.agents/skills/impeccable/SKILL.md +117 -304
- package/.agents/skills/impeccable/agents/openai.yaml +4 -0
- package/.agents/skills/{adapt/SKILL.md → impeccable/reference/adapt.md} +2 -11
- package/.agents/skills/{animate/SKILL.md → impeccable/reference/animate.md} +15 -15
- package/.agents/skills/{audit/SKILL.md → impeccable/reference/audit.md} +8 -22
- package/.agents/skills/{bolder/SKILL.md → impeccable/reference/bolder.md} +9 -13
- package/.agents/skills/impeccable/reference/brand.md +114 -0
- package/.agents/skills/{clarify/SKILL.md → impeccable/reference/clarify.md} +2 -11
- package/.agents/skills/{colorize/SKILL.md → impeccable/reference/colorize.md} +23 -12
- package/.agents/skills/impeccable/reference/craft.md +152 -29
- package/.agents/skills/{critique/SKILL.md → impeccable/reference/critique.md} +25 -37
- package/.agents/skills/{delight/SKILL.md → impeccable/reference/delight.md} +9 -11
- package/.agents/skills/{distill/SKILL.md → impeccable/reference/distill.md} +2 -13
- package/.agents/skills/impeccable/reference/document.md +427 -0
- package/.agents/skills/impeccable/reference/extract.md +1 -1
- package/.agents/skills/{harden/SKILL.md → impeccable/reference/harden.md} +1 -43
- package/.agents/skills/{layout/SKILL.md → impeccable/reference/layout.md} +27 -11
- package/.agents/skills/impeccable/reference/live.md +594 -0
- package/.agents/skills/impeccable/reference/motion-design.md +12 -2
- package/.agents/skills/impeccable/reference/onboard.md +234 -0
- package/.agents/skills/{optimize/SKILL.md → impeccable/reference/optimize.md} +4 -12
- package/.agents/skills/{overdrive/SKILL.md → impeccable/reference/overdrive.md} +9 -21
- package/.agents/skills/{critique → impeccable}/reference/personas.md +1 -1
- package/.agents/skills/{polish/SKILL.md → impeccable/reference/polish.md} +31 -23
- package/.agents/skills/impeccable/reference/product.md +62 -0
- package/.agents/skills/{quieter/SKILL.md → impeccable/reference/quieter.md} +7 -11
- package/.agents/skills/impeccable/reference/shape.md +151 -0
- package/.agents/skills/impeccable/reference/teach.md +156 -0
- package/.agents/skills/{typeset/SKILL.md → impeccable/reference/typeset.md} +19 -11
- package/.agents/skills/impeccable/reference/typography.md +31 -14
- package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +87 -17
- package/.agents/skills/impeccable/scripts/command-metadata.json +94 -0
- package/.agents/skills/impeccable/scripts/design-parser.mjs +820 -0
- package/.agents/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/.agents/skills/impeccable/scripts/is-generated.mjs +69 -0
- package/.agents/skills/impeccable/scripts/live-accept.mjs +595 -0
- package/.agents/skills/impeccable/scripts/live-browser.js +4781 -0
- package/.agents/skills/impeccable/scripts/live-inject.mjs +445 -0
- package/.agents/skills/impeccable/scripts/live-poll.mjs +186 -0
- package/.agents/skills/impeccable/scripts/live-server.mjs +694 -0
- package/.agents/skills/impeccable/scripts/live-wrap.mjs +571 -0
- package/.agents/skills/impeccable/scripts/live.mjs +247 -0
- package/.agents/skills/impeccable/scripts/load-context.mjs +141 -0
- package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/.agents/skills/impeccable/scripts/pin.mjs +214 -0
- package/.agents/skills/init/SKILL.md +2 -0
- package/.agents/skills/liteparse/SKILL.md +1 -0
- package/.agents/skills/memory-systems/SKILL.md +2 -0
- package/.agents/skills/multi-agent-patterns/SKILL.md +2 -0
- package/.agents/skills/opentui/SKILL.md +1 -0
- package/.agents/skills/pdf/SKILL.md +2 -0
- package/.agents/skills/playwright-cli/SKILL.md +51 -5
- package/.agents/skills/playwright-cli/references/playwright-tests.md +1 -1
- package/.agents/skills/playwright-cli/references/running-code.md +10 -0
- package/.agents/skills/playwright-cli/references/session-management.md +56 -0
- package/.agents/skills/playwright-cli/references/spec-driven-testing.md +305 -0
- package/.agents/skills/playwright-cli/references/test-generation.md +49 -3
- package/.agents/skills/pptx/SKILL.md +2 -0
- package/.agents/skills/project-development/SKILL.md +2 -0
- package/.agents/skills/prompt-engineer/SKILL.md +2 -0
- package/.agents/skills/research-codebase/SKILL.md +2 -0
- package/.agents/skills/ripgrep/SKILL.md +2 -0
- package/.agents/skills/skill-creator/LICENSE.txt +1 -1
- package/.agents/skills/skill-creator/SKILL.md +2 -0
- package/.agents/skills/sl-commit/SKILL.md +2 -0
- package/.agents/skills/sl-submit-diff/SKILL.md +2 -0
- package/.agents/skills/tdd/SKILL.md +4 -0
- package/.agents/skills/tool-design/SKILL.md +2 -0
- package/.agents/skills/typescript-advanced-types/SKILL.md +2 -1
- package/.agents/skills/typescript-expert/SKILL.md +7 -1
- package/.agents/skills/typescript-react-reviewer/SKILL.md +2 -1
- package/.agents/skills/workflow-creator/SKILL.md +75 -72
- package/.agents/skills/workflow-creator/references/session-config.md +48 -1
- package/.agents/skills/xlsx/SKILL.md +2 -0
- package/.opencode/opencode.json +6 -2
- package/README.md +39 -38
- package/dist/lib/atomic-temp.d.ts +8 -0
- package/dist/lib/atomic-temp.d.ts.map +1 -0
- package/dist/lib/terminal-env.d.ts +9 -0
- package/dist/lib/terminal-env.d.ts.map +1 -0
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/providers/copilot.d.ts +24 -14
- package/dist/sdk/providers/copilot.d.ts.map +1 -1
- package/dist/sdk/runtime/executor.d.ts +8 -0
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/runtime/port-discovery.d.ts +71 -0
- package/dist/sdk/runtime/port-discovery.d.ts.map +1 -0
- package/dist/sdk/runtime/tmux.d.ts +10 -0
- package/dist/sdk/runtime/tmux.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +1 -0
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +15 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/commands/cli/chat/index.test.ts +194 -2
- package/src/commands/cli/chat/index.ts +83 -28
- package/src/lib/atomic-temp.test.ts +86 -0
- package/src/lib/atomic-temp.ts +62 -0
- package/src/lib/terminal-env.test.ts +343 -0
- package/src/lib/terminal-env.ts +100 -0
- package/src/scripts/clean-dist.test.ts +53 -0
- package/src/scripts/clean-dist.ts +37 -0
- package/src/sdk/providers/claude.ts +42 -20
- package/src/sdk/providers/copilot.test.ts +365 -0
- package/src/sdk/providers/copilot.ts +117 -15
- package/src/sdk/runtime/cc-debounce.ts +2 -2
- package/src/sdk/runtime/executor.test.ts +322 -1
- package/src/sdk/runtime/executor.ts +159 -96
- package/src/sdk/runtime/port-discovery.test.ts +573 -0
- package/src/sdk/runtime/port-discovery.ts +496 -0
- package/src/sdk/runtime/tmux.ts +22 -2
- package/src/sdk/types.ts +1 -0
- package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +24 -6
- package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +52 -13
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +31 -3
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +16 -0
- package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +70 -3
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +50 -6
- package/src/services/system/auth.test.ts +53 -0
- package/src/services/system/auth.ts +31 -28
- package/src/services/system/detect.ts +1 -1
- package/.agents/skills/shape/SKILL.md +0 -96
- /package/.agents/skills/{critique → impeccable}/reference/cognitive-load.md +0 -0
- /package/.agents/skills/{critique → impeccable}/reference/heuristics-scoring.md +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Spec-driven testing (plan → generate → heal)
|
|
2
|
+
|
|
3
|
+
End-to-end workflow for authoring and maintaining Playwright tests using `playwright-cli`. The three sections below can be used independently:
|
|
4
|
+
|
|
5
|
+
- **Planning** — explore the app, produce a spec file describing what to test.
|
|
6
|
+
- **Generate** — turn a spec into Playwright test files. Update the spec if it's vague or stale.
|
|
7
|
+
- **Heal** — diagnose failing tests, fix the code, reconcile the spec with reality.
|
|
8
|
+
|
|
9
|
+
All three lean on the same mechanic: run `npx playwright test --debug=cli` in the background, then `playwright-cli attach tw-XXXX` to drive the paused page interactively. See [playwright-tests.md](playwright-tests.md) for the debug/attach mechanics and [test-generation.md](test-generation.md) for how every `playwright-cli` action emits Playwright TypeScript.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Planning
|
|
14
|
+
|
|
15
|
+
Goal: produce a spec file (e.g. `specs/<feature>.plan.md`) that enumerates the scenarios to test. **Always** write the spec to a file.
|
|
16
|
+
|
|
17
|
+
### 1.1 Prerequisite: workspace
|
|
18
|
+
|
|
19
|
+
Check the workspace has Playwright installed before anything else:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Either of these confirms a workspace:
|
|
23
|
+
test -f playwright.config.ts || test -f playwright.config.js
|
|
24
|
+
npx --no-install playwright --version
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If there is no Playwright install, bootstrap one and let the user pick the defaults:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm init playwright@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 1.2 Prerequisite: seed test
|
|
34
|
+
|
|
35
|
+
A **seed test** is a minimal test that lands the page in the state every scenario starts from: navigation to the app, any required login, feature flags, etc. Scenarios assume a fresh start *after* the seed. `--debug=cli` pauses *inside* this test, so the seed is where every planning and generation session begins.
|
|
36
|
+
|
|
37
|
+
Minimum viable seed:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// tests/seed.spec.ts
|
|
41
|
+
import { test } from '@playwright/test';
|
|
42
|
+
|
|
43
|
+
test('seed', async ({ page }) => {
|
|
44
|
+
await page.goto('https://example.com/');
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Preferred — push navigation into a fixture so scenario tests reuse it:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
// tests/fixtures.ts
|
|
52
|
+
import { test as baseTest } from '@playwright/test';
|
|
53
|
+
export { expect } from '@playwright/test';
|
|
54
|
+
|
|
55
|
+
export const test = baseTest.extend({
|
|
56
|
+
page: async ({ page }, use) => {
|
|
57
|
+
await page.goto('https://example.com/');
|
|
58
|
+
await use(page);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
// tests/seed.spec.ts
|
|
65
|
+
import { test } from './fixtures';
|
|
66
|
+
|
|
67
|
+
test('seed', async ({ page }) => {
|
|
68
|
+
// Fixture already navigates. This empty body tells agents where to start.
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If no seed exists, create one that at least navigates to the app.
|
|
73
|
+
|
|
74
|
+
### 1.3 Explore the app
|
|
75
|
+
|
|
76
|
+
Launch the app via the seed in the background and attach:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/seed.spec.ts --debug=cli
|
|
80
|
+
# wait for "Debugging Instructions" and the session name tw-XXXX
|
|
81
|
+
playwright-cli attach tw-XXXX
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Resume so the seed runs, then probe the app:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
playwright-cli resume # resume so that seed test runs fully
|
|
88
|
+
playwright-cli snapshot # inventory of interactive elements
|
|
89
|
+
playwright-cli click e5 # follow a flow
|
|
90
|
+
playwright-cli eval "location.href" # read URL / state
|
|
91
|
+
playwright-cli annotate # ask the user to point at something
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Map out:
|
|
95
|
+
|
|
96
|
+
- Interactive surfaces (forms, buttons, lists, filters, modals).
|
|
97
|
+
- Primary user journeys end-to-end.
|
|
98
|
+
- Edge cases: empty states, validation errors, very long input, boundary values.
|
|
99
|
+
- Persistence: reload, local/session storage, URL fragments.
|
|
100
|
+
- Navigation: which controls change the URL, back/forward behaviour.
|
|
101
|
+
|
|
102
|
+
**Important**: Do not just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
|
|
103
|
+
**Important**: Stop the background test when done exploring.
|
|
104
|
+
|
|
105
|
+
### 1.4 Write the spec file
|
|
106
|
+
|
|
107
|
+
Save under `specs/<feature>.plan.md`. Use this structure:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
# <Feature> Test Plan
|
|
111
|
+
|
|
112
|
+
## Application Overview
|
|
113
|
+
|
|
114
|
+
<One paragraph describing what the feature does and why it matters.>
|
|
115
|
+
|
|
116
|
+
## Test Scenarios
|
|
117
|
+
|
|
118
|
+
### 1. <Group Name>
|
|
119
|
+
|
|
120
|
+
**Seed:** `tests/seed.spec.ts`
|
|
121
|
+
|
|
122
|
+
#### 1.1. <kebab-case-scenario-name>
|
|
123
|
+
|
|
124
|
+
**File:** `tests/<group>/<kebab-case-scenario-name>.spec.ts`
|
|
125
|
+
|
|
126
|
+
**Steps:**
|
|
127
|
+
1. <Concrete user step>
|
|
128
|
+
- expect: <observable outcome>
|
|
129
|
+
- expect: <another observable outcome>
|
|
130
|
+
2. <Next step>
|
|
131
|
+
- expect: <outcome>
|
|
132
|
+
|
|
133
|
+
#### 1.2. <next-scenario>
|
|
134
|
+
...
|
|
135
|
+
|
|
136
|
+
### 2. <Next Group>
|
|
137
|
+
|
|
138
|
+
**Seed:** `tests/seed.spec.ts`
|
|
139
|
+
...
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Guidelines:
|
|
143
|
+
|
|
144
|
+
- Each scenario is independent and starts from the seed's fresh state — never chain scenarios.
|
|
145
|
+
- Scenario names are kebab-case and match the test file name (`should-add-single-todo` → `should-add-single-todo.spec.ts`).
|
|
146
|
+
- Cover happy path, edge cases, validation, negative flows, persistence.
|
|
147
|
+
- Write steps at the user level ("Type 'Buy milk' into the input"), not the API level ("call `fill`").
|
|
148
|
+
- Put observable outcomes in `- expect:` bullets; each becomes an assertion during generation.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 2. Generate
|
|
153
|
+
|
|
154
|
+
Goal: take a spec file and produce Playwright test files. Optionally update the spec if it has drifted.
|
|
155
|
+
|
|
156
|
+
### 2.1 Inputs
|
|
157
|
+
|
|
158
|
+
- **Spec file**, e.g. `specs/basic-operations.plan.md`.
|
|
159
|
+
- **Target**: either a single scenario (e.g. `1.2`), a whole group (`1`), or all.
|
|
160
|
+
- **Seed file**, read from the `**Seed:**` line of the scenario's group.
|
|
161
|
+
|
|
162
|
+
### 2.2 Generate one scenario
|
|
163
|
+
|
|
164
|
+
For each target scenario, in sequence (never in parallel — scenarios share the seed session):
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test <seed-file> --debug=cli # background
|
|
168
|
+
playwright-cli attach tw-XXXX
|
|
169
|
+
# resume
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Do not** just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
|
|
173
|
+
|
|
174
|
+
Walk the scenario's `Steps:` one by one with `playwright-cli`, treating the spec as the plan and the live app as the source of truth. If a step is vague ("click the button" — which button?), references an element that no longer exists, or contradicts the app's actual behaviour, use your judgement: update the spec to match what the app really does, then keep going. Editing the spec mid-generation is expected.
|
|
175
|
+
|
|
176
|
+
Every action prints the equivalent Playwright TypeScript (see [test-generation.md](test-generation.md)):
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
playwright-cli snapshot # find refs
|
|
180
|
+
playwright-cli fill e3 "John Doe" # -> page.getByRole('textbox', {...}).fill(...)
|
|
181
|
+
playwright-cli press Enter
|
|
182
|
+
playwright-cli click e7
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
For each `- expect:` bullet, add an explicit assertion. See [test-generation.md](test-generation.md) for details.
|
|
186
|
+
|
|
187
|
+
Collect the generated code and write the test file at the path given in the spec:
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
// spec: specs/basic-operations.plan.md
|
|
191
|
+
// seed: tests/seed.spec.ts
|
|
192
|
+
import { test, expect } from './fixtures'; // or '@playwright/test' if no fixtures file
|
|
193
|
+
|
|
194
|
+
test.describe('Singing in and out', () => {
|
|
195
|
+
test('should sign in', async ({ page }) => {
|
|
196
|
+
// 1. Navigate to the application
|
|
197
|
+
// (handled by the seed fixture)
|
|
198
|
+
|
|
199
|
+
// 2. Type 'John Doe' into the username field
|
|
200
|
+
await page.getByRole('textbox', { name: 'username' }).fill('John Doe');
|
|
201
|
+
|
|
202
|
+
// 3. Type password
|
|
203
|
+
await page.getByRole('textbox', { name: 'password' }).fill('TestPassword');
|
|
204
|
+
|
|
205
|
+
// 4. Press Enter to submit
|
|
206
|
+
await page.getByRole('textbox', { name: 'password' }).press('Enter');
|
|
207
|
+
|
|
208
|
+
await expect(page.getByRole('heading')).toContainText('Welcome, John Doe!');
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Rules:
|
|
214
|
+
|
|
215
|
+
- **One test per file.** File path, describe name, and test name come verbatim from the spec (minus the ordinal).
|
|
216
|
+
- Prefix each numbered step with a `// N. <step text>` comment before its actions.
|
|
217
|
+
- Use the describe group name verbatim from the spec (no `1.` ordinal).
|
|
218
|
+
- Import from `./fixtures` if the project has one; otherwise `@playwright/test`.
|
|
219
|
+
- **Important**: close the CLI session and stop the background test before moving to the next scenario.
|
|
220
|
+
|
|
221
|
+
### 2.3 Generate multiple scenarios
|
|
222
|
+
|
|
223
|
+
Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.
|
|
224
|
+
|
|
225
|
+
### 2.4 Run generated tests
|
|
226
|
+
|
|
227
|
+
After generation, run the new tests once:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Any failure goes to Section 3.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 3. Heal
|
|
238
|
+
|
|
239
|
+
Goal: fix failing tests, and update the spec if the app's intended behaviour changed.
|
|
240
|
+
|
|
241
|
+
### 3.1 Find failing tests
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Record the list of failing `<file>:<line>` entries and process them one at a time. Do not attempt parallel fixes — shared state and the single CLI session make that fragile.
|
|
248
|
+
|
|
249
|
+
### 3.2 Debug one failure
|
|
250
|
+
|
|
251
|
+
Run the single failing test in debug mode in the background, then attach:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts:<line> --debug=cli
|
|
255
|
+
# wait for "Debugging Instructions" and the tw-XXXX session name
|
|
256
|
+
playwright-cli attach tw-XXXX
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The test is paused at the start. Step forward or run to until just before the failing action or assertion, then diagnose:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
playwright-cli snapshot # did the element change / move / rename?
|
|
263
|
+
playwright-cli console # app-side errors?
|
|
264
|
+
playwright-cli network # failed request? wrong payload?
|
|
265
|
+
playwright-cli annotate # ask the user to point somewhere
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Common causes: selector drift, new wrapper element, label/ARIA rename, timing (transition, async load), assertion text updated in the app, test data leaking between runs.
|
|
269
|
+
|
|
270
|
+
Rehearse the corrected interaction with `playwright-cli` — the generated code in the output is what you paste back into the test.
|
|
271
|
+
|
|
272
|
+
### 3.3 Apply the fix
|
|
273
|
+
|
|
274
|
+
Edit the test file: update the locator, assertion, step order, or inputs to match the corrected behaviour. Stop the background debug run. Rerun the single test to confirm green.
|
|
275
|
+
|
|
276
|
+
Never skip hooks or add sleeps as a fix. Never use `networkidle`.
|
|
277
|
+
|
|
278
|
+
### 3.4 Reconcile with the spec
|
|
279
|
+
|
|
280
|
+
Open the spec referenced by the `// spec:` header in the test file and locate the scenario that matches the test.
|
|
281
|
+
|
|
282
|
+
- **Fix was purely technical** (locator drift, better assertion shape) and the spec's user-level behaviour still matches the app → leave the spec alone.
|
|
283
|
+
- **Fix changed user-visible steps, inputs, order, or expected outcomes** that the spec describes → update the spec to match reality. Keep the scenario id and file path stable; only the step / expect lines change.
|
|
284
|
+
- **Unclear whether the app change is intentional** (spec is stale) **or a regression** (test was right, app is wrong) → **stop and ask the user**. Provide:
|
|
285
|
+
- the scenario id (e.g. `2.3`),
|
|
286
|
+
- the spec lines that no longer match,
|
|
287
|
+
- the observed app behaviour (quote a snapshot excerpt or a concrete outcome).
|
|
288
|
+
|
|
289
|
+
Only after the user answers, either update the spec (intentional change) or file/flag the test as covering a bug (regression).
|
|
290
|
+
|
|
291
|
+
### 3.5 Iteration and giving up
|
|
292
|
+
|
|
293
|
+
- Fix failures one at a time; rerun after each.
|
|
294
|
+
- If after thorough investigation you are confident the test is correct but the app is wrong *and* the user has confirmed it's a bug: mark the test `test.fixme(...)` with a comment pointing at the user's decision or issue link. Never silently skip.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Cross-references
|
|
299
|
+
|
|
300
|
+
| For... | See |
|
|
301
|
+
|---|---|
|
|
302
|
+
| `--debug=cli` / attach mechanics | [playwright-tests.md](playwright-tests.md) |
|
|
303
|
+
| How `playwright-cli` actions become TS | [test-generation.md](test-generation.md) |
|
|
304
|
+
| Mocking requests during exploration/generation | [request-mocking.md](request-mocking.md) |
|
|
305
|
+
| Managing the CLI browser session | [session-management.md](session-management.md) |
|
|
@@ -77,12 +77,58 @@ playwright-cli click e5
|
|
|
77
77
|
|
|
78
78
|
### 3. Add Assertions Manually
|
|
79
79
|
|
|
80
|
-
Generated code captures actions but not assertions. Add expectations in your test:
|
|
80
|
+
Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
|
|
81
|
+
|
|
82
|
+
- `toBeVisible()` — element is rendered and visible
|
|
83
|
+
- `toHaveText(text)` — element text content matches
|
|
84
|
+
- `toHaveValue(value) / toBeEmpty()` — input/select value matches
|
|
85
|
+
- `toBeChecked() / toBeUnchecked()` — checkbox state matches
|
|
86
|
+
- `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
|
|
87
|
+
|
|
88
|
+
Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
|
|
89
|
+
|
|
90
|
+
When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
|
|
91
|
+
|
|
92
|
+
Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Get a stable locator for an element ref to use in the assertion
|
|
96
|
+
playwright-cli --raw generate-locator e5
|
|
97
|
+
# getByRole('button', { name: 'Submit' })
|
|
98
|
+
|
|
99
|
+
# Capture expected text content for toHaveText
|
|
100
|
+
playwright-cli --raw eval "el => el.textContent" e5
|
|
101
|
+
|
|
102
|
+
# Capture expected input value for toHaveValue/toBeEmpty
|
|
103
|
+
playwright-cli --raw eval "el => el.value" e5
|
|
104
|
+
|
|
105
|
+
# Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
|
|
106
|
+
# (whole page, or use a ref to scope to a region)
|
|
107
|
+
playwright-cli --raw snapshot
|
|
108
|
+
playwright-cli --raw snapshot e5
|
|
109
|
+
```
|
|
81
110
|
|
|
82
111
|
```typescript
|
|
83
112
|
// Generated action
|
|
84
113
|
await page.getByRole('button', { name: 'Submit' }).click();
|
|
85
114
|
|
|
86
|
-
// Manual
|
|
87
|
-
await expect(page.
|
|
115
|
+
// Manual assertions using the outputs above:
|
|
116
|
+
await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
|
|
117
|
+
await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
|
|
118
|
+
await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
|
|
119
|
+
await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
|
|
120
|
+
|
|
121
|
+
// toMatchAriaSnapshot on the whole page, finds a matching region
|
|
122
|
+
await expect(page).toMatchAriaSnapshot(`
|
|
123
|
+
- heading "Welcome, user"
|
|
124
|
+
- link /\\d+ new messages?/
|
|
125
|
+
- button "Sign out"
|
|
126
|
+
`);
|
|
127
|
+
|
|
128
|
+
// toMatchAriaSnapshot scoped to a region
|
|
129
|
+
await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
|
|
130
|
+
- link "Home"
|
|
131
|
+
- link /\\d+ new messages?/
|
|
132
|
+
- link "Profile"
|
|
133
|
+
`);
|
|
88
134
|
```
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
name: pptx
|
|
3
3
|
description: "Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
metadata:
|
|
6
|
+
provider: atomic
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# PPTX Skill
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: project-development
|
|
3
3
|
description: This skill should be used when the user asks to "start an LLM project", "design batch pipeline", "evaluate task-model fit", "structure agent project", or mentions pipeline architecture, agent-assisted development, cost estimation, or choosing between LLM and traditional approaches. Part of the context engineering skill suite — also activates when the user mentions "context engineering" or "context-engineering" in the context of structuring LLM-powered project architectures.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Project Development Methodology
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ripgrep
|
|
3
3
|
description: Use when searching text in files, codebases, books, or documents. Use when finding files by pattern, searching large files that are too big to read fully, extracting specific content from many files, or when grep/find is too slow. Triggers on "search for", "find occurrences", "look for pattern", "search in files".
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Ripgrep (rg) - Fast Text Search Tool
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
|
188
188
|
identification within third-party archives.
|
|
189
189
|
|
|
190
|
-
Copyright
|
|
190
|
+
Copyright 2026 Anthropic, PBC.
|
|
191
191
|
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
193
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: skill-creator
|
|
3
3
|
description: Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Skill Creator
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd
|
|
3
3
|
description: Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Test-Driven Development
|
|
@@ -44,6 +46,8 @@ RIGHT (vertical):
|
|
|
44
46
|
|
|
45
47
|
### 1. Planning
|
|
46
48
|
|
|
49
|
+
When exploring the codebase, use the project's domain glossary so that test names and interface vocabulary match the project's language, and respect ADRs in the area you're touching.
|
|
50
|
+
|
|
47
51
|
Before writing any code:
|
|
48
52
|
|
|
49
53
|
- [ ] Confirm with user what interface changes are needed
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tool-design
|
|
3
3
|
description: This skill should be used when the user asks to "design agent tools", "create tool descriptions", "reduce tool complexity", "implement MCP tools", or mentions tool consolidation, architectural reduction, tool naming conventions, or agent-tool interfaces. Part of the context engineering skill suite — also activates when the user mentions "context engineering" or "context-engineering" in the context of designing tools that shape how agents receive and process context.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Tool Design for Agents
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: typescript-advanced-types
|
|
3
3
|
description: Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
|
|
4
4
|
metadata:
|
|
5
|
-
|
|
5
|
+
provider: atomic
|
|
6
|
+
internal: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# TypeScript Advanced Types
|
|
@@ -6,7 +6,8 @@ risk: critical
|
|
|
6
6
|
source: community
|
|
7
7
|
date_added: '2026-02-27'
|
|
8
8
|
metadata:
|
|
9
|
-
|
|
9
|
+
provider: atomic
|
|
10
|
+
internal: true
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# TypeScript Expert
|
|
@@ -426,3 +427,8 @@ Always validate changes don't break existing functionality before considering th
|
|
|
426
427
|
|
|
427
428
|
## When to Use
|
|
428
429
|
This skill is applicable to execute the workflow or actions described in the overview.
|
|
430
|
+
|
|
431
|
+
## Limitations
|
|
432
|
+
- Use this skill only when the task clearly matches the scope described above.
|
|
433
|
+
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
|
|
434
|
+
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: typescript-react-reviewer
|
|
3
3
|
description: "Expert code reviewer for TypeScript + React 19 applications. Use when reviewing React code, identifying anti-patterns, evaluating state management, or assessing code maintainability. Triggers: code review requests, PR reviews, React architecture evaluation, identifying code smells, TypeScript type safety checks, useEffect abuse detection, state management review."
|
|
4
4
|
metadata:
|
|
5
|
-
|
|
5
|
+
provider: atomic
|
|
6
|
+
internal: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# TypeScript + React 19 Code Review Expert
|