一键导入
bug-fix-workflow
Fix bugs using the two-commit structure with failing test first. Use when fixing bugs, addressing issues, or correcting incorrect behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix bugs using the two-commit structure with failing test first. Use when fixing bugs, addressing issues, or correcting incorrect behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add new GraphQL lint rules following project patterns. Use when implementing a lint rule, adding validation logic, or extending the linter with new checks.
Debug LSP server issues including hangs, incorrect responses, performance problems, or crashes. Use when troubleshooting the language server.
Create pull requests following project standards. Use when opening a PR, preparing changes for review, or running gh pr create.
Add new IDE/LSP features like hover, goto definition, find references, or completion. Use when implementing editor features, LSP handlers, or IDE functionality.
Audit test organization and patterns. Use PROACTIVELY after writing new tests to self-review, or when reviewing test changes in PRs. Checks unit vs integration test placement, TestDatabase patterns, and caching verification.
Review pull requests against project standards. Use when reviewing PRs, checking code quality, or providing feedback on changes.
| name | bug-fix-workflow |
| description | Fix bugs using the two-commit structure with failing test first. Use when fixing bugs, addressing issues, or correcting incorrect behavior. |
| user-invocable | true |
| argument-hint | [issue number or bug description] |
| allowed-tools | Bash(cargo test *), Bash(cargo clippy *), Bash(cargo fmt *), Bash(cargo check *), Bash(git add *), Bash(git commit *), Read, Edit, Write, Grep, Glob |
Bug fixes in this project use a two-commit structure that proves the bug exists before fixing it.
test: reproduce <issue description>
This commit adds a failing test that demonstrates the bug:
fix: <description of what was fixed>
This commit:
#[test]
fn issue_123_fragment_spread_on_wrong_type() {
// This test reproduces the bug reported in issue #123
let result = validate("...");
// Expected: error about type mismatch
// Actual (bug): no error reported
assert!(!result.diagnostics.is_empty());
}
cargo test issue_123
# Should FAIL - this proves the bug exists
git add .
git commit -m "test: reproduce fragment spread type mismatch (issue #123)"
Make the minimal changes needed to fix the bug.
cargo test issue_123
# Should PASS now
cargo test # All tests should pass
git add .
git commit -m "fix: validate fragment spread target type exists in schema
The fragment spread validator was not checking if the target type
existed in the schema before validating field selections."
test: reproduce <brief description>
- Reference issue number if applicable
- Describe what the test checks
- Note expected vs actual behavior
fix: <what was fixed>
<Why the bug occurred>
<What the fix does>
<Any side effects or related changes>
test: prefixcargo test)fix: prefixcargo clippy)