umairinayat/Specter-AI / .claude/skills/gstack
gstack
FlaggedFast headless browser for QA testing and site dogfooding. Navigate any URL, interact with elements, verify page state, diff before/after actions, take annotated screenshots, check responsive layouts, test forms and uploads, handle dialogs, and assert element states. ~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a user flow, or file a bug with evidence.
| File | Kind | Size |
|---|---|---|
| .env.example | other | 171 B |
| .github/workflows/skill-docs.yml | config | 365 B |
| .gitignore | other | 127 B |
| ARCHITECTURE.md | markdown | 13.9 KB |
| BROWSER.md | markdown | 13.8 KB |
| CHANGELOG.md | markdown | 14.0 KB |
| CONTRIBUTING.md | markdown | 10.2 KB |
| LICENSE | other | 1.0 KB |
| README.md | markdown | 29.2 KB |
| SKILL.md | skill md | 12.5 KB |
| SKILL.md.tmpl | other | 6.1 KB |
| TODO.md | markdown | 6.9 KB |
| TODOS.md | markdown | 1.8 KB |
| VERSION | other | 6 B |
| bin/dev-setup | other | 1.9 KB |
| bin/dev-teardown | other | 946 B |
| bin/gstack-update-check | other | 3.0 KB |
| conductor.json | config | 87 B |
| package.json | manifest | 1.6 KB |
| scripts/dev-skill.ts | script | 2.4 KB |
| scripts/gen-skill-docs.ts | script | 7.6 KB |
| scripts/skill-check.ts | script | 3.7 KB |
| setup | other | 2.8 KB |
| test/gen-skill-docs.test.ts | script | 6.2 KB |
| test/helpers/session-runner.ts | script | 5.0 KB |
| test/helpers/skill-parser.ts | script | 3.4 KB |
| test/skill-e2e.test.ts | script | 6.2 KB |
| test/skill-llm-eval.test.ts | script | 8.2 KB |
| test/skill-parser.test.ts | script | 5.3 KB |
| test/skill-validation.test.ts | script | 5.9 KB |
test/helpers/skill-parser.ts
View on GitHub/**
* SKILL.md parser and validator.
*
* Extracts $B commands from code blocks, validates them against
* the command registry and snapshot flags.
*
* Used by:
* - test/skill-validation.test.ts (Tier 1 static tests)
* - scripts/skill-check.ts (health summary)
* - scripts/dev-skill.ts (watch mode)
*/
import { ALL_COMMANDS } from '../../browse/src/commands';
import { parseSnapshotArgs } from '../../browse/src/snapshot';
import * as fs from 'fs';
export interface BrowseCommand {
command: string;
args: string[];
line: number;
raw: string;
}
export interface ValidationResult {
valid: BrowseCommand[];
invalid: BrowseCommand[];
snapshotFlagErrors: Array<{ command: BrowseCommand; error: string }>;
warnings: string[];
}
/**
* Extract all $B invocations from bash code blocks in a SKILL.md file.
*/
export function extractBrowseCommands(skillPath: string): BrowseCommand[] {
const content = fs.readFileSync(skillPath, 'utf-8');
const lines = content.split('\n');
const commands: BrowseCommand[] = [];
let inBashBlock = false;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Detect code block boundaries
if (line.trimStart().startsWith('```')) {
if (inBashBlock) {
inBashBlock = false;
} else if (line.trimStart().startsWith('```bash')) {
inBashBlock = true;
}
// Non-bash code blocks (```json, ```, ```js, etc.) are skipped
continue;
}
if (!inBashBlock) continue;
// Match lines with $B command invocations
// Handle multiple $B commands on one line (e.g., "$B click @e3 $B fill @e4 "value"")
const matches = line.matchAll(/\$B\s+(\S+)(?:\s+([^\$]*))?/g);
for (const match of matches) {
const command = match[1];
let argsStr = (match[2] || '').trim();
// Strip inline comments (# ...) — but not inside quotes
// Simple approach: remove everything from first unquoted # onward
let inQuote = false;
for (let j = 0; j < argsStr.length; j++) {
if (argsStr[j] === '"') inQuote = !inQuote;
if (argsStr[j] === '#' && !inQuote) {
argsStr = argsStr.slice(0, j).trim();
break;
}
}
// Parse args — handle quoted strings
const args: string[] = [];
if (argsStr) {
const argMatches = argsStr.matchAll(/"([^"]*)"|(\S+)/g);
for (const am of argMatches) {
args.push(am[1] ?? am[2]);
}
}
commands.push({
command,
args,
line: i + 1, // 1-based
raw: match[0].trim(),
});
}
}
return commands;
}
/**
* Extract and validate all $B commands in a SKILL.md file.
*/
export function validateSkill(skillPath: string): ValidationResult {
const commands = extractBrowseCommands(skillPath);
const result: ValidationResult = {
valid: [],
invalid: [],
snapshotFlagErrors: [],
warnings: [],
};
if (commands.length === 0) {
result.warnings.push('no $B commands found');
return result;
}
for (const cmd of commands) {
if (!ALL_COMMANDS.has(cmd.command)) {
result.invalid.push(cmd);
continue;
}
// Validate snapshot flags
if (cmd.command === 'snapshot' && cmd.args.length > 0) {
try {
parseSnapshotArgs(cmd.args);
} catch (err: any) {
result.snapshotFlagErrors.push({ command: cmd, error: err.message });
continue;
}
}
result.valid.push(cmd);
}
return result;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate 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. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |