@bastani/atomic 0.6.5 → 0.6.6-0
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 +4 -2
- 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 +1 -1
- package/src/sdk/runtime/executor.test.ts +254 -1
- package/src/sdk/runtime/executor.ts +135 -89
- 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 +16 -0
- 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/.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,214 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Pin/unpin sub-commands as standalone skill shortcuts.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node <scripts_path>/pin.mjs pin <command>
|
|
7
|
+
* node <scripts_path>/pin.mjs unpin <command>
|
|
8
|
+
*
|
|
9
|
+
* `pin audit` creates a lightweight /audit skill that redirects to /impeccable audit.
|
|
10
|
+
* `unpin audit` removes that shortcut.
|
|
11
|
+
*
|
|
12
|
+
* The script discovers harness directories (.claude/skills, .cursor/skills, etc.)
|
|
13
|
+
* in the project root and creates/removes the pin in all of them.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync, readdirSync } from 'node:fs';
|
|
17
|
+
import { join, resolve, dirname } from 'node:path';
|
|
18
|
+
import { fileURLToPath } from 'node:url';
|
|
19
|
+
|
|
20
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
|
|
22
|
+
// All known harness directories
|
|
23
|
+
const HARNESS_DIRS = [
|
|
24
|
+
'.claude', '.cursor', '.gemini', '.codex', '.agents',
|
|
25
|
+
'.trae', '.trae-cn', '.pi', '.opencode', '.kiro', '.rovodev',
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
// Valid sub-command names
|
|
29
|
+
const VALID_COMMANDS = [
|
|
30
|
+
'craft', 'teach', 'extract', 'document', 'shape',
|
|
31
|
+
'critique', 'audit',
|
|
32
|
+
'polish', 'bolder', 'quieter', 'distill', 'harden', 'onboard', 'live',
|
|
33
|
+
'animate', 'colorize', 'typeset', 'layout', 'delight', 'overdrive',
|
|
34
|
+
'clarify', 'adapt', 'optimize',
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
// Marker to identify pinned skills (so unpin doesn't delete user skills)
|
|
38
|
+
const PIN_MARKER = '<!-- impeccable-pinned-skill -->';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Walk up from startDir to find a project root.
|
|
42
|
+
*/
|
|
43
|
+
function findProjectRoot(startDir = process.cwd()) {
|
|
44
|
+
let dir = resolve(startDir);
|
|
45
|
+
while (dir !== '/') {
|
|
46
|
+
if (
|
|
47
|
+
existsSync(join(dir, 'package.json')) ||
|
|
48
|
+
existsSync(join(dir, '.git')) ||
|
|
49
|
+
existsSync(join(dir, 'skills-lock.json'))
|
|
50
|
+
) {
|
|
51
|
+
return dir;
|
|
52
|
+
}
|
|
53
|
+
const parent = resolve(dir, '..');
|
|
54
|
+
if (parent === dir) break;
|
|
55
|
+
dir = parent;
|
|
56
|
+
}
|
|
57
|
+
return resolve(startDir);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Find harness skill directories that have an impeccable skill installed.
|
|
62
|
+
*/
|
|
63
|
+
function findHarnessDirs(projectRoot) {
|
|
64
|
+
const dirs = [];
|
|
65
|
+
for (const harness of HARNESS_DIRS) {
|
|
66
|
+
const skillsDir = join(projectRoot, harness, 'skills');
|
|
67
|
+
// Only pin in harness dirs that already have impeccable installed
|
|
68
|
+
const impeccableDir = join(skillsDir, 'impeccable');
|
|
69
|
+
if (existsSync(impeccableDir) || existsSync(join(skillsDir, 'i-impeccable'))) {
|
|
70
|
+
dirs.push(skillsDir);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return dirs;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Load command metadata (descriptions for pinned skills).
|
|
78
|
+
*/
|
|
79
|
+
function loadCommandMetadata() {
|
|
80
|
+
const metadataPath = join(__dirname, 'command-metadata.json');
|
|
81
|
+
if (existsSync(metadataPath)) {
|
|
82
|
+
return JSON.parse(readFileSync(metadataPath, 'utf-8'));
|
|
83
|
+
}
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Generate a pinned skill's SKILL.md content.
|
|
89
|
+
*/
|
|
90
|
+
function generatePinnedSkill(command, metadata) {
|
|
91
|
+
const desc = metadata[command]?.description || `Shortcut for /impeccable ${command}.`;
|
|
92
|
+
const hint = metadata[command]?.argumentHint || '[target]';
|
|
93
|
+
|
|
94
|
+
return `---
|
|
95
|
+
name: ${command}
|
|
96
|
+
description: "${desc}"
|
|
97
|
+
argument-hint: "${hint}"
|
|
98
|
+
user-invocable: true
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
${PIN_MARKER}
|
|
102
|
+
|
|
103
|
+
This is a pinned shortcut for \`{{command_prefix}}impeccable ${command}\`.
|
|
104
|
+
|
|
105
|
+
Invoke {{command_prefix}}impeccable ${command}, passing along any arguments provided here, and follow its instructions.
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Pin a command: create shortcut skill in all harness dirs.
|
|
111
|
+
*/
|
|
112
|
+
function pin(command, projectRoot) {
|
|
113
|
+
const metadata = loadCommandMetadata();
|
|
114
|
+
const harnessDirs = findHarnessDirs(projectRoot);
|
|
115
|
+
|
|
116
|
+
if (harnessDirs.length === 0) {
|
|
117
|
+
console.log('No harness directories with impeccable installed found.');
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const content = generatePinnedSkill(command, metadata);
|
|
122
|
+
let created = 0;
|
|
123
|
+
|
|
124
|
+
for (const skillsDir of harnessDirs) {
|
|
125
|
+
// Check if skill already exists (and isn't a pin)
|
|
126
|
+
const skillDir = join(skillsDir, command);
|
|
127
|
+
if (existsSync(skillDir)) {
|
|
128
|
+
const existingMd = join(skillDir, 'SKILL.md');
|
|
129
|
+
if (existsSync(existingMd)) {
|
|
130
|
+
const existing = readFileSync(existingMd, 'utf-8');
|
|
131
|
+
if (!existing.includes(PIN_MARKER)) {
|
|
132
|
+
console.log(` SKIP: ${skillDir} (non-pinned skill already exists)`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
mkdirSync(skillDir, { recursive: true });
|
|
139
|
+
writeFileSync(join(skillDir, 'SKILL.md'), content, 'utf-8');
|
|
140
|
+
console.log(` + ${skillDir}`);
|
|
141
|
+
created++;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (created > 0) {
|
|
145
|
+
console.log(`\nPinned '${command}' as a standalone shortcut in ${created} location(s).`);
|
|
146
|
+
console.log(`You can now use /${command} directly.`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return created > 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Unpin a command: remove shortcut skill from all harness dirs.
|
|
154
|
+
*/
|
|
155
|
+
function unpin(command, projectRoot) {
|
|
156
|
+
const harnessDirs = findHarnessDirs(projectRoot);
|
|
157
|
+
let removed = 0;
|
|
158
|
+
|
|
159
|
+
for (const skillsDir of harnessDirs) {
|
|
160
|
+
const skillDir = join(skillsDir, command);
|
|
161
|
+
if (!existsSync(skillDir)) continue;
|
|
162
|
+
|
|
163
|
+
const skillMd = join(skillDir, 'SKILL.md');
|
|
164
|
+
if (!existsSync(skillMd)) continue;
|
|
165
|
+
|
|
166
|
+
// Safety: only remove if it's a pinned skill
|
|
167
|
+
const content = readFileSync(skillMd, 'utf-8');
|
|
168
|
+
if (!content.includes(PIN_MARKER)) {
|
|
169
|
+
console.log(` SKIP: ${skillDir} (not a pinned skill)`);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
rmSync(skillDir, { recursive: true, force: true });
|
|
174
|
+
console.log(` - ${skillDir}`);
|
|
175
|
+
removed++;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (removed > 0) {
|
|
179
|
+
console.log(`\nUnpinned '${command}' from ${removed} location(s).`);
|
|
180
|
+
console.log(`Use /impeccable ${command} to access it.`);
|
|
181
|
+
} else {
|
|
182
|
+
console.log(`No pinned '${command}' shortcut found.`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return removed > 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// --- CLI ---
|
|
189
|
+
const [,, action, command] = process.argv;
|
|
190
|
+
|
|
191
|
+
if (!action || !command) {
|
|
192
|
+
console.log('Usage: node pin.mjs <pin|unpin> <command>');
|
|
193
|
+
console.log(`\nAvailable commands: ${VALID_COMMANDS.join(', ')}`);
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (action !== 'pin' && action !== 'unpin') {
|
|
198
|
+
console.error(`Unknown action: ${action}. Use 'pin' or 'unpin'.`);
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (!VALID_COMMANDS.includes(command)) {
|
|
203
|
+
console.error(`Unknown command: ${command}`);
|
|
204
|
+
console.error(`Available commands: ${VALID_COMMANDS.join(', ')}`);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const root = findProjectRoot();
|
|
209
|
+
|
|
210
|
+
if (action === 'pin') {
|
|
211
|
+
pin(command, root);
|
|
212
|
+
} else {
|
|
213
|
+
unpin(command, root);
|
|
214
|
+
}
|
|
@@ -4,6 +4,7 @@ description: Use this skill when the user asks to parse, perform multi-format do
|
|
|
4
4
|
compatibility: Requires Node 18+ and `@llamaindex/liteparse` installed globally via npm (`npm i -g @llamaindex/liteparse`)
|
|
5
5
|
license: MIT
|
|
6
6
|
metadata:
|
|
7
|
+
provider: atomic
|
|
7
8
|
author: LlamaIndex
|
|
8
9
|
version: "0.1.0"
|
|
9
10
|
---
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-systems
|
|
3
3
|
description: Guides implementation of agent memory systems, compares production frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee), and designs persistence architectures for cross-session knowledge retention. Use when the user asks to "implement agent memory", "persist state across sessions", "build knowledge graph for agents", "track entities over time", "add long-term memory", "choose a memory framework", or mentions temporal knowledge graphs, vector stores, entity memory, adaptive memory, dynamic memory, or memory benchmarks (LoCoMo, LongMemEval). A core context engineering skill — also activates when the user mentions "context engineering" or "context-engineering" in the context of durable agent knowledge and cross-session persistence.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Memory System Design
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: multi-agent-patterns
|
|
3
3
|
description: This skill should be used when the user asks to "design multi-agent system", "implement supervisor pattern", "create swarm architecture", "coordinate multiple agents", or mentions multi-agent patterns, context isolation, agent handoffs, sub-agents, or parallel agent execution. Part of the context engineering skill suite — also activates when the user mentions "context engineering" or "context-engineering" in the context of orchestrating context across multiple agents.
|
|
4
|
+
metadata:
|
|
5
|
+
provider: atomic
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Multi-Agent Architecture Patterns
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: opentui
|
|
3
3
|
description: Comprehensive OpenTUI skill for building terminal user interfaces. Covers the core imperative API, React reconciler, and Solid reconciler. Use for any TUI development task including components, layout, keyboard handling, animations, and testing.
|
|
4
4
|
metadata:
|
|
5
|
+
provider: atomic
|
|
5
6
|
references: core, react, solid
|
|
6
7
|
internal: true
|
|
7
8
|
---
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
name: pdf
|
|
3
3
|
description: Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
metadata:
|
|
6
|
+
provider: atomic
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# PDF Processing Guide
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: playwright-cli
|
|
3
3
|
description: Automate browser interactions, test web pages and work with Playwright tests.
|
|
4
|
-
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
|
|
4
|
+
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
|
|
5
|
+
metadata:
|
|
6
|
+
provider: atomic
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Browser Automation with playwright-cli
|
|
@@ -38,6 +40,9 @@ playwright-cli dblclick e7
|
|
|
38
40
|
# --submit presses Enter after filling the element
|
|
39
41
|
playwright-cli fill e5 "user@example.com" --submit
|
|
40
42
|
playwright-cli drag e2 e8
|
|
43
|
+
# drop files or data onto an element (from outside the page)
|
|
44
|
+
playwright-cli drop e4 --path=./image.png
|
|
45
|
+
playwright-cli drop e4 --data="text/plain=hello world"
|
|
41
46
|
playwright-cli hover e4
|
|
42
47
|
playwright-cli select e9 "option-value"
|
|
43
48
|
playwright-cli upload ./document.pdf
|
|
@@ -150,7 +155,8 @@ playwright-cli unroute
|
|
|
150
155
|
```bash
|
|
151
156
|
playwright-cli console
|
|
152
157
|
playwright-cli console warning
|
|
153
|
-
playwright-cli
|
|
158
|
+
playwright-cli requests
|
|
159
|
+
playwright-cli request 5
|
|
154
160
|
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
|
|
155
161
|
playwright-cli run-code --filename=script.js
|
|
156
162
|
playwright-cli tracing-start
|
|
@@ -158,6 +164,19 @@ playwright-cli tracing-stop
|
|
|
158
164
|
playwright-cli video-start video.webm
|
|
159
165
|
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
|
|
160
166
|
playwright-cli video-stop
|
|
167
|
+
|
|
168
|
+
# launch the dashboard for UI review / design feedback — user annotates the page, you receive the annotated screenshot, snapshot, and notes
|
|
169
|
+
playwright-cli annotate
|
|
170
|
+
|
|
171
|
+
# generate a Playwright locator for an element from its ref or selector
|
|
172
|
+
playwright-cli generate-locator e5 --raw
|
|
173
|
+
|
|
174
|
+
# show a persistent highlight overlay for an element, optionally with a custom style
|
|
175
|
+
playwright-cli highlight e5
|
|
176
|
+
playwright-cli highlight e5 --style="outline: 3px dashed red"
|
|
177
|
+
# hide a single element highlight, or all page highlights when no target is given
|
|
178
|
+
playwright-cli highlight e5 --hide
|
|
179
|
+
playwright-cli highlight --hide
|
|
161
180
|
```
|
|
162
181
|
|
|
163
182
|
## Raw output
|
|
@@ -175,6 +194,11 @@ TOKEN=$(playwright-cli --raw cookie-get session_id)
|
|
|
175
194
|
playwright-cli --raw localstorage-get theme
|
|
176
195
|
```
|
|
177
196
|
|
|
197
|
+
For structured output wrapping every reply as JSON, pass --json
|
|
198
|
+
```bash
|
|
199
|
+
playwright-cli list --json
|
|
200
|
+
```
|
|
201
|
+
|
|
178
202
|
## Open parameters
|
|
179
203
|
```bash
|
|
180
204
|
# Use specific browser when creating session
|
|
@@ -188,14 +212,23 @@ playwright-cli open --persistent
|
|
|
188
212
|
# Use persistent profile with custom directory
|
|
189
213
|
playwright-cli open --profile=/path/to/profile
|
|
190
214
|
|
|
191
|
-
# Connect to browser via
|
|
192
|
-
playwright-cli attach --extension
|
|
215
|
+
# Connect to browser via Playwright Extension
|
|
216
|
+
playwright-cli attach --extension=chrome
|
|
217
|
+
|
|
218
|
+
# Connect to a running Chrome or Edge by channel name
|
|
219
|
+
playwright-cli attach --cdp=chrome
|
|
220
|
+
playwright-cli attach --cdp=msedge
|
|
221
|
+
|
|
222
|
+
# Connect to a running browser via CDP endpoint
|
|
223
|
+
playwright-cli attach --cdp=http://localhost:9222
|
|
193
224
|
|
|
194
225
|
# Start with config file
|
|
195
226
|
playwright-cli open --config=my-config.json
|
|
196
227
|
|
|
197
228
|
# Close the browser
|
|
198
229
|
playwright-cli close
|
|
230
|
+
# Detach from an attached browser (leaves the external browser running)
|
|
231
|
+
playwright-cli -s=msedge detach
|
|
199
232
|
# Delete user data for the default session
|
|
200
233
|
playwright-cli delete-data
|
|
201
234
|
```
|
|
@@ -228,6 +261,9 @@ playwright-cli snapshot "#main"
|
|
|
228
261
|
# limit snapshot depth for efficiency, take a partial snapshot afterwards
|
|
229
262
|
playwright-cli snapshot --depth=4
|
|
230
263
|
playwright-cli snapshot e34
|
|
264
|
+
|
|
265
|
+
# include each element's bounding box as [box=x,y,width,height]
|
|
266
|
+
playwright-cli snapshot --boxes
|
|
231
267
|
```
|
|
232
268
|
|
|
233
269
|
## Targeting elements
|
|
@@ -318,7 +354,7 @@ playwright-cli open https://example.com
|
|
|
318
354
|
playwright-cli click e4
|
|
319
355
|
playwright-cli fill e7 "test"
|
|
320
356
|
playwright-cli console
|
|
321
|
-
playwright-cli
|
|
357
|
+
playwright-cli requests
|
|
322
358
|
playwright-cli close
|
|
323
359
|
```
|
|
324
360
|
|
|
@@ -331,12 +367,22 @@ playwright-cli tracing-stop
|
|
|
331
367
|
playwright-cli close
|
|
332
368
|
```
|
|
333
369
|
|
|
370
|
+
## Example: Interactive session
|
|
371
|
+
|
|
372
|
+
Ask the user for UI review or design feedback. The user draws boxes on the live page and types comments; you receive the annotated screenshot, the snapshot of the marked region, and the user's notes. Use this whenever the user asks for "UI review", "design feedback", or to "ask the user what they think / want / mean":
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
playwright-cli open https://example.com
|
|
376
|
+
playwright-cli annotate
|
|
377
|
+
```
|
|
378
|
+
|
|
334
379
|
## Specific tasks
|
|
335
380
|
|
|
336
381
|
* **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
|
|
337
382
|
* **Request mocking** [references/request-mocking.md](references/request-mocking.md)
|
|
338
383
|
* **Running Playwright code** [references/running-code.md](references/running-code.md)
|
|
339
384
|
* **Browser session management** [references/session-management.md](references/session-management.md)
|
|
385
|
+
* **Spec-driven testing (plan / generate / heal)** [references/spec-driven-testing.md](references/spec-driven-testing.md)
|
|
340
386
|
* **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
|
|
341
387
|
* **Test generation** [references/test-generation.md](references/test-generation.md)
|
|
342
388
|
* **Tracing** [references/tracing.md](references/tracing.md)
|
|
@@ -14,7 +14,7 @@ PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
|
|
14
14
|
|
|
15
15
|
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
|
16
16
|
|
|
17
|
-
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed.
|
|
17
|
+
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.
|
|
18
18
|
|
|
19
19
|
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
|
20
20
|
|
|
@@ -11,6 +11,16 @@ playwright-cli run-code "async page => {
|
|
|
11
11
|
}"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
You can also load the function from a file:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
playwright-cli run-code --filename=./my-script.js
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
The code must be a single function expression, it is wrapped in `(...)` and evaluated.
|
|
22
|
+
import/export/require syntax is not supported.
|
|
23
|
+
|
|
14
24
|
## Geolocation
|
|
15
25
|
|
|
16
26
|
```bash
|
|
@@ -105,6 +105,62 @@ playwright-cli open https://example.com --persistent
|
|
|
105
105
|
playwright-cli open https://example.com --profile=/path/to/profile
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
## Attaching to a Running Browser
|
|
109
|
+
|
|
110
|
+
Use `attach` to connect to a browser that is already running, instead of launching a new one.
|
|
111
|
+
|
|
112
|
+
### Attach by channel name
|
|
113
|
+
|
|
114
|
+
Connect to a running Chrome or Edge instance by its channel name. The browser must have remote debugging enabled — navigate to `chrome://inspect/#remote-debugging` in the target browser and check "Allow remote debugging for this browser instance".
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Attach to Chrome
|
|
118
|
+
playwright-cli attach --cdp=chrome
|
|
119
|
+
|
|
120
|
+
# Attach to Chrome Canary
|
|
121
|
+
playwright-cli attach --cdp=chrome-canary
|
|
122
|
+
|
|
123
|
+
# Attach to Microsoft Edge
|
|
124
|
+
playwright-cli attach --cdp=msedge
|
|
125
|
+
|
|
126
|
+
# Attach to Edge Dev
|
|
127
|
+
playwright-cli attach --cdp=msedge-dev
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Supported channels: `chrome`, `chrome-beta`, `chrome-dev`, `chrome-canary`, `msedge`, `msedge-beta`, `msedge-dev`, `msedge-canary`.
|
|
131
|
+
|
|
132
|
+
When `--session` is not provided, the session is named after the channel (e.g. `--cdp=msedge` creates a session called `msedge`), so parallel attaches to Chrome and Edge don't collide on `default`. Pass `--session=<name>` to override.
|
|
133
|
+
|
|
134
|
+
### Attach via CDP endpoint
|
|
135
|
+
|
|
136
|
+
Connect to a browser that exposes a Chrome DevTools Protocol endpoint:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
playwright-cli attach --cdp=http://localhost:9222
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Attach via browser extension
|
|
143
|
+
|
|
144
|
+
Connect to a browser with the Playwright extension installed:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
playwright-cli attach --extension
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Detach
|
|
151
|
+
|
|
152
|
+
Tear down an attached session without affecting the external browser:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Detach the default attached session
|
|
156
|
+
playwright-cli detach
|
|
157
|
+
|
|
158
|
+
# Detach a specific attached session
|
|
159
|
+
playwright-cli -s=msedge detach
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
`detach` only works on sessions created via `attach`. For sessions created via `open`, use `close`.
|
|
163
|
+
|
|
108
164
|
## Default Browser Session
|
|
109
165
|
|
|
110
166
|
When `-s` is omitted, commands use the default browser session:
|