alexandervashurin/semaphore / .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. gstack also includes development workflow skills. When you notice the user is at these stages, suggest the appropriate skill: - Brainstorming a new idea → suggest /office-hours - Reviewing a plan (strategy) → suggest /plan-ceo-review - Reviewing a plan (architecture) → suggest /plan-eng-review - Reviewing a plan (design) → suggest /plan-design-review - Creating a design system → suggest /design-consultation - Debugging errors → suggest /investigate - Testing the app → suggest /qa - Code review before merge → suggest /review - Visual design audit → suggest /design-review - Ready to deploy / create PR → suggest /ship - Post-ship doc updates → suggest /document-release - Weekly retrospective → suggest /retro - Wanting a second opinion or adversarial code review → suggest /codex - Working with production or live systems → suggest /careful - Want to scope edits to one module/directory → suggest /freeze - Maximum safety mode (destructive warnings + edit restrictions) → suggest /guard - Removing edit restrictions → suggest /unfreeze - Upgrading gstack to latest version → suggest /gstack-upgrade If the user pushes back on skill suggestions ("stop suggesting things", "I don't need suggestions", "too aggressive"): 1. Stop suggesting for the rest of this session 2. Run: gstack-config set proactive false 3. Say: "Got it — I'll stop suggesting skills. Just tell me to be proactive again if you change your mind." If the user says "be proactive again" or "turn on suggestions": 1. Run: gstack-config set proactive true 2. Say: "Proactive suggestions are back on."
test/helpers/session-runner.test.ts
View on GitHubimport { describe, test, expect } from 'bun:test';
import { parseNDJSON } from './session-runner';
// Fixture: minimal NDJSON session (system init, assistant with tool_use, tool result, assistant text, result)
const FIXTURE_LINES = [
'{"type":"system","subtype":"init","session_id":"test-123"}',
'{"type":"assistant","message":{"content":[{"type":"tool_use","id":"tu1","name":"Bash","input":{"command":"echo hello"}}]}}',
'{"type":"user","tool_use_result":{"tool_use_id":"tu1","stdout":"hello\\n","stderr":""}}',
'{"type":"assistant","message":{"content":[{"type":"text","text":"The command printed hello."}]}}',
'{"type":"assistant","message":{"content":[{"type":"text","text":"Let me also read a file."},{"type":"tool_use","id":"tu2","name":"Read","input":{"file_path":"/tmp/test"}}]}}',
'{"type":"result","subtype":"success","total_cost_usd":0.05,"num_turns":3,"usage":{"input_tokens":100,"output_tokens":50},"result":"Done."}',
];
describe('parseNDJSON', () => {
test('parses valid NDJSON with system + assistant + result events', () => {
const parsed = parseNDJSON(FIXTURE_LINES);
expect(parsed.transcript).toHaveLength(6);
expect(parsed.transcript[0].type).toBe('system');
expect(parsed.transcript[5].type).toBe('result');
});
test('extracts tool calls from assistant.message.content[].type === tool_use', () => {
const parsed = parseNDJSON(FIXTURE_LINES);
expect(parsed.toolCalls).toHaveLength(2);
expect(parsed.toolCalls[0]).toEqual({
tool: 'Bash',
input: { command: 'echo hello' },
output: '',
});
expect(parsed.toolCalls[1]).toEqual({
tool: 'Read',
input: { file_path: '/tmp/test' },
output: '',
});
expect(parsed.toolCallCount).toBe(2);
});
test('skips malformed lines without throwing', () => {
const lines = [
'{"type":"system"}',
'this is not json',
'{"type":"assistant","message":{"content":[{"type":"text","text":"ok"}]}}',
'{incomplete json',
'{"type":"result","subtype":"success","result":"done"}',
];
const parsed = parseNDJSON(lines);
expect(parsed.transcript).toHaveLength(3); // system, assistant, result
expect(parsed.resultLine?.subtype).toBe('success');
});
test('skips empty and whitespace-only lines', () => {
const lines = [
'',
' ',
'{"type":"system"}',
'\t',
'{"type":"result","subtype":"success","result":"ok"}',
];
const parsed = parseNDJSON(lines);
expect(parsed.transcript).toHaveLength(2);
});
test('extracts resultLine from type: "result" event', () => {
const parsed = parseNDJSON(FIXTURE_LINES);
expect(parsed.resultLine).not.toBeNull();
expect(parsed.resultLine.subtype).toBe('success');
expect(parsed.resultLine.total_cost_usd).toBe(0.05);
expect(parsed.resultLine.num_turns).toBe(3);
expect(parsed.resultLine.result).toBe('Done.');
});
test('counts turns correctly — one per assistant event, not per text block', () => {
const parsed = parseNDJSON(FIXTURE_LINES);
// 3 assistant events in fixture (tool_use, text, text+tool_use)
expect(parsed.turnCount).toBe(3);
});
test('handles empty input', () => {
const parsed = parseNDJSON([]);
expect(parsed.transcript).toHaveLength(0);
expect(parsed.resultLine).toBeNull();
expect(parsed.turnCount).toBe(0);
expect(parsed.toolCallCount).toBe(0);
expect(parsed.toolCalls).toHaveLength(0);
});
test('handles assistant event with no content array', () => {
const lines = [
'{"type":"assistant","message":{}}',
'{"type":"assistant"}',
];
const parsed = parseNDJSON(lines);
expect(parsed.turnCount).toBe(2);
expect(parsed.toolCalls).toHaveLength(0);
});
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |