add-bead
無料Capture free-text work as a tracked Beads issue. Use when the user runs /add-bead or wants to quickly file a Beads issue.
日本語の概要は準備中です。原文の説明を表示しています。
Set up Claude Code git safety guardrails that block dangerous git commands before execution. Use when the user asks to prevent git push, hard reset, git clean, destructive checkout/restore, or branch deletion from Claude Code hooks.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Guide a user through installing a Claude Code PreToolUse hook that blocks dangerous git commands before they execute.
This Agent Forge port is guidance-first: do not install hooks, edit .claude/settings.json, edit ~/.claude/settings.json, or create executable hook files unless the user explicitly asks for installation in the current task.
The reference hook blocks commands matching these patterns:
git push, including force-push variantsgit reset --hardgit clean -f and git clean -fdgit branch -Dgit checkout .git restore .push --force or reset --hardWhen a command is blocked, the hook exits with code 2 and prints a message explaining which dangerous pattern matched.
Ask the user where they want the guardrail installed:
.claude/settings.json with the hook script under .claude/hooks/block-dangerous-git.sh~/.claude/settings.json with the hook script under ~/.claude/hooks/block-dangerous-git.shIf the user only asks for advice or review, provide the guidance and stop before editing files.
Use the bundled reference as the source for the script content:
references/block-dangerous-git.sh.md
Keep it as documentation unless installation is explicitly requested. If installing, copy the shell script content from the reference into the selected hook path and make that copied file executable.
chmod +x .claude/hooks/block-dangerous-git.sh
For global installs, use the global hook path instead:
chmod +x ~/.claude/hooks/block-dangerous-git.sh
Add a PreToolUse hook for the Bash tool. If the settings file already exists, merge into the existing JSON and preserve all unrelated settings and hooks.
Project-scoped hook:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
Global hook:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
Do not replace an existing hooks.PreToolUse array. Append the new command hook only if an equivalent command is not already present.
Ask whether the user wants to add or remove blocked patterns before installation. Keep the defaults unless the user chooses a different policy.
Common customizations:
git push but keep blocking git push --force.git checkout -- . or repo-specific destructive commands.Document any customization in the response so future agents understand the local policy.
Test the installed or candidate script by piping Claude Code hook JSON into it:
echo '{"tool_input":{"command":"git push origin main"}}' | .claude/hooks/block-dangerous-git.sh
Expected result:
2BLOCKEDgit pushAlso test an allowed command:
echo '{"tool_input":{"command":"git status --short"}}' | .claude/hooks/block-dangerous-git.sh
Expected result:
0まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Capture free-text work as a tracked Beads issue. Use when the user runs /add-bead or wants to quickly file a Beads issue.
日本語の概要は準備中です。原文の説明を表示しています。
Register a new sub-repo in the knowledge base.
日本語の概要は準備中です。原文の説明を表示しています。
Add focused Bun unit tests for mission-critical behavior and edge cases — not blanket coverage.
日本語の概要は準備中です。原文の説明を表示しています。
Answer questions about the codebase from knowledge files. Use when the user runs /ask or asks a domain/knowledge question about the repos.
日本語の概要は準備中です。原文の説明を表示しています。
Meta-skill for creating Agent Forge skills under .claude/skills/ with SKILL.md, optional references/ and scripts/, and Bun scaffolds. Use when the user wants to add or author a skill, scaffold a new skill folder, or align skill docs with harness conventions (JSON script output, Beads for tasks).
日本語の概要は準備中です。原文の説明を表示しています。
Choose Beads issue priority (P0–P4, numeric, or named) from urgency, impact, and risk when creating or triaging work.
日本語の概要は準備中です。原文の説明を表示しています。