abelworkflow 0.1.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.
Files changed (51) hide show
  1. package/.gitignore +13 -0
  2. package/.skill-lock.json +29 -0
  3. package/AGENTS.md +45 -0
  4. package/README.md +147 -0
  5. package/bin/abelworkflow.mjs +2 -0
  6. package/commands/oc/diagnose.md +63 -0
  7. package/commands/oc/implementation.md +157 -0
  8. package/commands/oc/init.md +27 -0
  9. package/commands/oc/plan.md +88 -0
  10. package/commands/oc/research.md +126 -0
  11. package/lib/cli.mjs +222 -0
  12. package/package.json +23 -0
  13. package/skills/confidence-check/SKILL.md +124 -0
  14. package/skills/confidence-check/confidence.ts +335 -0
  15. package/skills/context7-auto-research/.env +4 -0
  16. package/skills/context7-auto-research/.env.example +4 -0
  17. package/skills/context7-auto-research/SKILL.md +83 -0
  18. package/skills/context7-auto-research/context7-api.js +283 -0
  19. package/skills/dev-browser/SKILL.md +225 -0
  20. package/skills/dev-browser/bun.lock +443 -0
  21. package/skills/dev-browser/package-lock.json +2988 -0
  22. package/skills/dev-browser/package.json +31 -0
  23. package/skills/dev-browser/references/scraping.md +155 -0
  24. package/skills/dev-browser/resolve-skill-dir.sh +35 -0
  25. package/skills/dev-browser/scripts/start-relay.ts +32 -0
  26. package/skills/dev-browser/scripts/start-server.ts +117 -0
  27. package/skills/dev-browser/server.sh +24 -0
  28. package/skills/dev-browser/src/client.ts +474 -0
  29. package/skills/dev-browser/src/index.ts +287 -0
  30. package/skills/dev-browser/src/relay.ts +731 -0
  31. package/skills/dev-browser/src/snapshot/browser-script.ts +877 -0
  32. package/skills/dev-browser/src/snapshot/index.ts +14 -0
  33. package/skills/dev-browser/src/snapshot/inject.ts +13 -0
  34. package/skills/dev-browser/src/types.ts +34 -0
  35. package/skills/dev-browser/tsconfig.json +36 -0
  36. package/skills/dev-browser/vitest.config.ts +12 -0
  37. package/skills/git-commit/SKILL.md +124 -0
  38. package/skills/grok-search/.env.example +24 -0
  39. package/skills/grok-search/SKILL.md +114 -0
  40. package/skills/grok-search/requirements.txt +2 -0
  41. package/skills/grok-search/scripts/groksearch_cli.py +1214 -0
  42. package/skills/grok-search/scripts/groksearch_entry.py +116 -0
  43. package/skills/prompt-enhancer/ADVANCED.md +74 -0
  44. package/skills/prompt-enhancer/SKILL.md +71 -0
  45. package/skills/prompt-enhancer/TEMPLATE.md +91 -0
  46. package/skills/prompt-enhancer/scripts/enhance.py +142 -0
  47. package/skills/sequential-think/SKILL.md +198 -0
  48. package/skills/sequential-think/scripts/.env.example +5 -0
  49. package/skills/sequential-think/scripts/sequential_think_cli.py +253 -0
  50. package/skills/time/SKILL.md +116 -0
  51. package/skills/time/scripts/time_cli.py +104 -0
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: dev-browser
3
+ description: Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.
4
+ ---
5
+
6
+ # Dev Browser Skill
7
+
8
+ Browser automation that maintains page state across script executions. Write small, focused scripts to accomplish tasks incrementally. Once you've proven out part of a workflow and there is repeated work to be done, you can write a script to do the repeated work in a single execution.
9
+
10
+ ## Choosing Your Approach
11
+
12
+ - **Local/source-available sites**: Read the source code first to write selectors directly
13
+ - **Unknown page layouts**: Use `getAISnapshot()` to discover elements and `selectSnapshotRef()` to interact with them
14
+ - **Visual feedback**: Take screenshots to see what the user sees
15
+
16
+ ## Setup
17
+
18
+ Two modes available. Ask the user if unclear which to use.
19
+
20
+ ### Resolving SKILL_DIR
21
+
22
+ Prepend this to every Bash snippet (each starts a fresh shell). All examples below use `### SKILL_DIR ###` as a placeholder for this block:
23
+
24
+ ```bash
25
+ SKILL_DIR=$(bash skills/dev-browser/resolve-skill-dir.sh 2>/dev/null) || { echo "Skill not found: dev-browser" >&2; exit 1; }
26
+ ```
27
+
28
+ ### Standalone Mode (Default)
29
+
30
+ Launches a new Chromium browser for fresh automation sessions.
31
+
32
+ ```bash
33
+ ### SKILL_DIR ###
34
+ bash "$SKILL_DIR/server.sh" &
35
+ ```
36
+
37
+ Add `--headless` flag if user requests it. **Wait for the `Ready` message before running scripts.**
38
+
39
+ ### Extension Mode
40
+
41
+ Connects to user's existing Chrome browser. Use this when:
42
+
43
+ - The user is already logged into sites and wants you to do things behind an authed experience that isn't local dev.
44
+ - The user asks you to use the extension
45
+
46
+ **Important**: The core flow is still the same. You create named pages inside of their browser.
47
+
48
+ **Start the relay server:**
49
+
50
+ ```bash
51
+ ### SKILL_DIR ###
52
+ (cd "$SKILL_DIR" && npm i && npm run start-extension) &
53
+ ```
54
+
55
+ Wait for `Waiting for extension to connect...` followed by `Extension connected` in the console. To know that a client has connected and the browser is ready to be controlled.
56
+ **Workflow:**
57
+
58
+ 1. Scripts call `client.page("name")` just like the normal mode to create new pages / connect to existing ones.
59
+ 2. Automation runs on the user's actual browser session
60
+
61
+ If the extension hasn't connected yet, tell the user to launch and activate it. Download link: https://github.com/SawyerHood/dev-browser/releases
62
+
63
+ ## Writing Scripts
64
+
65
+ > **Each standalone Bash snippet resolves `SKILL_DIR` inside the same snippet before changing directories.** The `@/` import alias requires the skill root's config.
66
+
67
+ Execute scripts inline using heredocs:
68
+
69
+ ```bash
70
+ ### SKILL_DIR ###
71
+ (cd "$SKILL_DIR" && npx tsx <<'EOF'
72
+ import { connect, waitForPageLoad } from "@/client.js";
73
+
74
+ const client = await connect();
75
+ // Create page with custom viewport size (optional)
76
+ const page = await client.page("example", { viewport: { width: 1920, height: 1080 } });
77
+
78
+ await page.goto("https://example.com");
79
+ await waitForPageLoad(page);
80
+
81
+ console.log({ title: await page.title(), url: page.url() });
82
+ await client.disconnect();
83
+ EOF
84
+ )
85
+ ```
86
+
87
+ **Write to `tmp/` files only when** the script needs reuse, is complex, or user explicitly requests it.
88
+
89
+ ### Key Principles
90
+
91
+ 1. **Small scripts**: Each script does ONE thing (navigate, click, fill, check)
92
+ 2. **Evaluate state**: Log/return state at the end to decide next steps
93
+ 3. **Descriptive page names**: Use `"checkout"`, `"login"`, not `"main"`
94
+ 4. **Disconnect to exit**: `await client.disconnect()` - pages persist on server
95
+ 5. **Plain JS in evaluate**: `page.evaluate()` runs in browser - no TypeScript syntax
96
+
97
+ ## Workflow Loop
98
+
99
+ Follow this pattern for complex tasks:
100
+
101
+ 1. **Write a script** to perform one action
102
+ 2. **Run it** and observe the output
103
+ 3. **Evaluate** - did it work? What's the current state?
104
+ 4. **Decide** - is the task complete or do we need another script?
105
+ 5. **Repeat** until task is done
106
+
107
+ ### No TypeScript in Browser Context
108
+
109
+ Code passed to `page.evaluate()` runs in the browser, which doesn't understand TypeScript:
110
+
111
+ ```typescript
112
+ // ✅ Correct: plain JavaScript
113
+ const text = await page.evaluate(() => {
114
+ return document.body.innerText;
115
+ });
116
+
117
+ // ❌ Wrong: TypeScript syntax will fail at runtime
118
+ const text = await page.evaluate(() => {
119
+ const el: HTMLElement = document.body; // Type annotation breaks in browser!
120
+ return el.innerText;
121
+ });
122
+ ```
123
+
124
+ ## Scraping Data
125
+
126
+ For scraping large datasets, intercept and replay network requests rather than scrolling the DOM. See [references/scraping.md](references/scraping.md) for the complete guide covering request capture, schema discovery, and paginated API replay.
127
+
128
+ ## Client API
129
+
130
+ ```typescript
131
+ const client = await connect();
132
+
133
+ // Get or create named page (viewport only applies to new pages)
134
+ const page = await client.page("name");
135
+ const pageWithSize = await client.page("name", { viewport: { width: 1920, height: 1080 } });
136
+
137
+ const pages = await client.list(); // List all page names
138
+ await client.close("name"); // Close a page
139
+ await client.disconnect(); // Disconnect (pages persist)
140
+
141
+ // ARIA Snapshot methods
142
+ const snapshot = await client.getAISnapshot("name"); // Get accessibility tree
143
+ const element = await client.selectSnapshotRef("name", "e5"); // Get element by ref
144
+ ```
145
+
146
+ The `page` object is a standard Playwright Page.
147
+
148
+ ## Waiting
149
+
150
+ ```typescript
151
+ import { waitForPageLoad } from "@/client.js";
152
+
153
+ await waitForPageLoad(page); // After navigation
154
+ await page.waitForSelector(".results"); // For specific elements
155
+ await page.waitForURL("**/success"); // For specific URL
156
+ ```
157
+
158
+ ## Inspecting Page State
159
+
160
+ ### Screenshots
161
+
162
+ ```typescript
163
+ await page.screenshot({ path: "tmp/screenshot.png" });
164
+ await page.screenshot({ path: "tmp/full.png", fullPage: true });
165
+ ```
166
+
167
+ ### ARIA Snapshot (Element Discovery)
168
+
169
+ Use `getAISnapshot()` to discover page elements. Returns YAML-formatted accessibility tree:
170
+
171
+ ```yaml
172
+ - banner:
173
+ - link "Hacker News" [ref=e1]
174
+ - navigation:
175
+ - link "new" [ref=e2]
176
+ - main:
177
+ - list:
178
+ - listitem:
179
+ - link "Article Title" [ref=e8]
180
+ - link "328 comments" [ref=e9]
181
+ - contentinfo:
182
+ - textbox [ref=e10]
183
+ - /placeholder: "Search"
184
+ ```
185
+
186
+ **Interpreting refs:**
187
+
188
+ - `[ref=eN]` - Element reference for interaction (visible, clickable elements only)
189
+ - `[checked]`, `[disabled]`, `[expanded]` - Element states
190
+ - `[level=N]` - Heading level
191
+ - `/url:`, `/placeholder:` - Element properties
192
+
193
+ **Interacting with refs:**
194
+
195
+ ```typescript
196
+ const snapshot = await client.getAISnapshot("hackernews");
197
+ console.log(snapshot); // Find the ref you need
198
+
199
+ const element = await client.selectSnapshotRef("hackernews", "e2");
200
+ await element.click();
201
+ ```
202
+
203
+ ## Error Recovery
204
+
205
+ Page state persists after failures. Re-resolve `SKILL_DIR` (see top of file) before debugging:
206
+
207
+ ```bash
208
+ ### SKILL_DIR ###
209
+ (cd "$SKILL_DIR" && npx tsx <<'EOF'
210
+ import { connect } from "@/client.js";
211
+
212
+ const client = await connect();
213
+ const page = await client.page("hackernews");
214
+
215
+ await page.screenshot({ path: "tmp/debug.png" });
216
+ console.log({
217
+ url: page.url(),
218
+ title: await page.title(),
219
+ bodyText: await page.textContent("body").then((t) => t?.slice(0, 200)),
220
+ });
221
+
222
+ await client.disconnect();
223
+ EOF
224
+ )
225
+ ```