Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jajupmochi-new-hook
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/new-hook
What's inside
- Skill name
new-hook- Description
- Scaffold a new hook under hooks/<kebab-name>/. Creates README.md (what/when/install/variants) and settings.snippet.json (drop-in JSON), plus updates INVENTORY.md and hooks/README.md in the same edit batch. Hooks are sensitive — pipe-test the raw command before wrapping.
- License
- MIT
- Instructions
- 127 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# /new-hook
Scaffold a new hook recipe. Hooks are deterministic shell commands tied to Claude Code lifecycle events.
## Usage
```
/new-hook <kebab-name>
```
E.g.: `/new-hook prettier-format-on-edit` or `/new-hook block-secrets-on-edit`
## Pre-flight
- Verify `hooks/<kebab-name>/` does not already exist
- Confirm the hook isn't redundant with an existing one
- **Critical**: hooks are sensitive — verify you've pipe-tested the raw command before wrapping (see "Construction flow" below)
## Construction flow
Per the official `update-config` skill (Anthropic-managed), hook construction follows:
1. **Dedup check** — search existing `.claude/settings.json` files for similar hooks; reuse if possible
2. **Construct for THIS project** — write the raw command first
3. **Pipe-test raw** — run the bare command and verify it produces correct output
4. **Wrap in JSON** — embed in `settings.snippet.json` with `matcher` and `hooks` array
5. **Validate JSON** — `jq empty settings.snippet.json` (no error = valid)
6. **Live-proof** — for `Pre|PostToolUse` on triggerable matchers, trigger an actual matching tool call and verify the hook fires
7. **Cleanup** — remove test artifacts; document the variant in README
8. **Handoff** — show the user the complete files
## Steps for this skill
1. **Create directory**:
```bash
mkdir -p hooks/<kebab-name>
```
2. **Ask the user** for:
- Event: `PreToolUse | PostToolUse | Stop | SubagentStop`
- Matcher: tool name pattern (e.g., `Write|Edit`, `Bash`, `*`)
- Command: the bare shell command (will be wrapped in JSON `"command"` field)
- Context: which project types it applies to
- Variants: are there alternative ways to achieve the same effect (different toolchain, different config)?
3. **Pipe-test the raw command** before writing files:
```bash
echo '{"tool_input":{"file_path":"<example-file>"}}' | <YOUR-COMMAND>
```
Confirm output matches expectations.
4. **Write `hooks/<kebab-name>/README.md`**:
```markdown
# <kebab-name>
> <one-line: event + matcher + what it does>
## What it does
<full description>
## Why
<bug it prevents / time it saves>
## Install
<install steps + jq merge command>
## Variants
<alternative implementations>
## Caveats
<gotchas, edge cases>
## Companion
<related hooks/rules/skills>
```
5. **Write `hooks/<kebab-name>/settings.snippet.json`**:
```json
{
"hooks": {
"<EVENT>": [
{
"matcher": "<MATCHER>",
"hooks": [
{
"type": "command",
"command": "<wrapped command — escape JSON correctly>",
"timeout": 30,
"statusMessage": "<optional one-line status>"
}
]
}
]
}
}
```
6. **Validate JSON**:
```bash
jq empty hooks/<kebab-name>/settings.snippet.json
```
7. **Update `hooks/README.md`** — add a row to the hook index table.
8. **Update `INVENTORY.md` AND `INVENTORY.zh.md`** — add a row to the Hooks section.
9. **Show the user** the diff and ask for confirmation before committing.From jajupmochi/agent-harness, MIT.
More from jajupmochi/agent-harness
- 0.502score
doc-writing
jajupmochi
Use when writing or updating any document a human will read — a design or architecture spec, a feature manual and its in-app guide, an audit / bugfix / test…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
agent-update-watcher
jajupmochi
Use to keep up with the fast-moving agent ecosystem (new/updated CLIs, plugins, skills) WITHOUT burning tokens on constant checks.
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
figma-design-fetch
jajupmochi
Use when the user shares a figma.com URL, wants to implement/mock a UI from Figma, or do design-to-code — connect the Figma MCP, fetch the design…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
claude-desktop-sessions
jajupmochi
Use when Claude Code sessions started in the terminal CLI don't appear in the Claude Desktop app's Code tab, when you want to hand a running CLI session to…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
publish
jajupmochi
Tag a new version of agent-harness, push to GitHub, and create a GitHub release.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
figma-authoring-constraints
jajupmochi
Use when a designer asks how to structure a Figma file so it produces clean code, when a design keeps yielding pixel-snapshot output, or when…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
init-codex-config
jajupmochi
Scaffold or migrate a project to use agent-harness from Codex.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
long-running-tasks
jajupmochi
Manage long-running commands and multi-step work in Codex.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
init-agent-config
jajupmochi
Scaffold a new project with the relevant subset of agent-harness rules, hooks, skills, recommendations, and templates.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
agent-config-adapter
jajupmochi
Adapt an existing agent configuration or plugin to a new agent or model route.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
autopilot
jajupmochi
Set up or manage the autopilot daily autonomous project-driver.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
end-of-turn-marker
jajupmochi
Every turn MUST end with a visible divider header followed by numbered summary items.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 29, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/jajupmochi/agent-harness
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from jajupmochi
- 0.502score
agent-update-watcher
jajupmochi
Use to keep up with the fast-moving agent ecosystem (new/updated CLIs, plugins, skills) WITHOUT burning tokens on constant checks.
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
doc-writing
jajupmochi
Use when writing or updating any document a human will read — a design or architecture spec, a feature manual and its in-app guide, an audit / bugfix / test…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
claude-desktop-sessions
jajupmochi
Use when Claude Code sessions started in the terminal CLI don't appear in the Claude Desktop app's Code tab, when you want to hand a running CLI session to…
SkillCFreshness: C★ 1Claude Code +9 - 0.502score
figma-design-fetch
jajupmochi
Use when the user shares a figma.com URL, wants to implement/mock a UI from Figma, or do design-to-code — connect the Figma MCP, fetch the design…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
init-codex-config
jajupmochi
Scaffold or migrate a project to use agent-harness from Codex.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
figma-authoring-constraints
jajupmochi
Use when a designer asks how to structure a Figma file so it produces clean code, when a design keeps yielding pixel-snapshot output, or when…
SkillCFreshness: C★ 1Claude Code +9
Cite this page
new-hook skill. Agent Mart. https://agentmart.dev/skills/jajupmochi-new-hook (last updated 2026-10-24)