Agent skill
script-kit-agent-workflow
Autonomous fix-verify workflow for Script Kit GPUI. Use when fixing bugs, making changes, or completing tasks. Covers the mandatory build-test-verify loop, logging modes, and session completion protocol.
Install this agent skill to your Project
npx add-skill https://github.com/johnlindquist/script-kit-next/tree/main/.claude/skills/script-kit-agent-workflow
SKILL.md
Script Kit Agent Workflow
Mandatory workflow for all code changes. Do NOT ask users to test. Do NOT skip verification.
Quick-Start Checklist (Do First)
- Read CLAUDE.md before changing code
- Check
.hive/issues.jsonlfor tasks/context - TDD: write failing test → implement → refactor
- Update bead status when starting/completing work
- Include
correlation_idin all log entries/spans - UI changes: test via stdin JSON protocol (never CLI args)
- Before every commit:
cargo check && cargo clippy --all-targets -- -D warnings && cargo test
The Fix-Verify Loop
1. EXPLORE: Understand the problem
- Use Task tool with explore agent for codebase search
- Read relevant files, identify root cause before coding
2. FIX: Make the code change
- Keep changes minimal and focused
3. BUILD: Compile and verify
cargo check && cargo clippy --all-targets -- -D warnings
4. LAUNCH: Run the app with logging
echo '{"type":"show"}' | SCRIPT_KIT_AI_LOG=1 ./target/debug/script-kit-gpui 2>&1
5. CHECK LOGS: Verify the fix
grep -i "keyword" ~/.scriptkit/logs/script-kit-gpui.jsonl
6. VISUAL VERIFY (if UI change):
- Write test script with captureScreenshot()
- Save PNG to ./test-screenshots/
- READ the PNG file to actually verify
7. RUN TESTS: cargo test
Log Modes
| Mode | Command | Use Case |
|---|---|---|
| Compact AI logs | SCRIPT_KIT_AI_LOG=1 |
Default for AI agents |
| Full debug logs | RUST_LOG=debug |
Deep debugging |
| Specific module | RUST_LOG=script_kit::theme=debug |
Target one module |
Anti-Patterns (Never Do These)
- "The user should test this manually"
- "I made the change, it should work"
- Making a fix without checking logs
- Capturing screenshot but not reading the PNG
- Skipping
cargo checkbefore launch - Not using
SCRIPT_KIT_AI_LOG=1orRUST_LOG=debug
Success Indicators
- Explored codebase before fixing
- Made targeted fix based on understanding
cargo check+cargo clippypass- Launched app and checked relevant logs
- Logs confirm the change took effect
cargo testpasses- (If visual) Screenshot captured AND read
Session Completion ("Landing the Plane")
Work is not done until git push succeeds.
- File issues for remaining work
- If code changed: run quality gates (check/clippy/test)
- Update issue status
- Push to remote:
bash
git pull --rebase && git push && git status - Clean up (stashes/branches)
- Verify everything committed + pushed
- Hand off context for next session
Rules:
- Never stop before pushing
- Never say "ready to push when you are"
- If push fails: resolve and retry until success
References
- Scenario Testing - Automated scenario-based testing
- Dev Workflow - Hot reload and debugging
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Generate Component Documentation
Based on existing docs styles and specific API implementations, and referencing same name stories, generate comprehensive documentation for the new component.
Generate Component Story
Generate a comprehensive story for a new component for as example.
new-component
How to write a new component of GPUI Component.
troubleshooting
Diagnose and fix common Script Kit issues. Use when the user reports bugs, crashes, missing features, or unexpected behavior in Script Kit GPUI.
script-authoring
Create and manage TypeScript scripts for Script Kit. Use when the user wants to write a new script, edit an existing script, or understand Script Kit's SDK and metadata system.
agents
Create mdflow-backed agent files for Script Kit. Use when the user wants to create AI agents, configure agent backends (Claude, Gemini, Codex), or manage agent metadata.
Didn't find tool you were looking for?