一键导入
joycraft-harden
Invoked by tune, optimize, or session-end to convert eligible boundary prose into machine-checked deny patterns — not a user entry point.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Invoked by tune, optimize, or session-end to convert eligible boundary prose into machine-checked deny patterns — not a user entry point.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Invoked by gather-context or the human after a knowledge gap surfaces — author one long-form reference doc and wire a pointer into AGENTS.md's Context Map
Invoked by session-end or the human after a fact surfaces — route it to the correct context document (production map, dangerous assumptions, decision log, institutional knowledge, troubleshooting)
Invoked at the design bookend by decompose's decision gate or the human directly — turn open questions into a decision dossier; every decision terminates clarified, backlogged, or discarded
Break a feature brief into atomic specs — small, testable, independently executable units
Design discussion before decomposition — produce a ~200-line design artifact for human review, catching wrong assumptions before they propagate into specs
Invoked by tune's roadmap or the human opting into Level 5 — set up the autofix loop, holdout scenario testing, and scenario evolution from specs
| name | joycraft-harden |
| description | Invoked by tune, optimize, or session-end to convert eligible boundary prose into machine-checked deny patterns — not a user entry point. |
You are converting eligible ALWAYS/ASK FIRST/NEVER boundary prose into machine-checked
form. Prose is a rule the model merely hopes to follow; a deny pattern or hook enforces it.
Harden is convert-what-exists — it never interviews from scratch (that's joycraft-lockdown).
Read the project's boundary file (AGENTS.md, or wherever the ALWAYS/ASK FIRST/NEVER
rules live), .claude/settings.json permissions.deny, and
.claude/hooks/joycraft/deny-patterns.txt. These are the only two enforcement surfaces
you target. Both are installed by Joycraft's safeguard machinery (npx joycraft init) —
you append to the files it produces, you never rewrite the hook script itself, and you
never add a new hook framework.
Note: the enforcement surfaces live on the Claude Code side (.claude/). If this
project has no .claude/ install, harden can still classify rules and stamp provenance,
but there is no machine-check surface to write to — say so and stop after Step 2.
For every rule, decide eligible or ineligible:
git push
regex).Semantic downgrade guard: ASK FIRST rules are not NEVER rules. Converting an ASK FIRST rule into a hard deny silently removes the "ask" step. If you propose converting an ASK FIRST rule to a deny pattern, flag the downgrade explicitly in the proposal — don't let it pass as a routine conversion.
Anchoring: a regex that would false-positive a legitimate command (e.g. blocking
git push origin main also blocking git push origin main-docs) is not safely
expressible — anchor with word boundaries (\bmain\b, \bmaster\b) or reclassify
ineligible.
Already covered: if a rule already matches an existing deny pattern, label it
verified and just stamp provenance if the boundary-file line is missing it — don't
duplicate the pattern.
Show the exact diff for each eligible rule before touching anything:
.claude/hooks/joycraft/deny-patterns.txt..claude/settings.json permissions.deny (create the
array if absent; never disturb permissions.allow or the hooks config).Do not write to deny-patterns.txt or settings.json until the human has explicitly
approved the diff shown in Step 3. If the human rejects a proposed conversion, the rule
stays prose — record the rejection in the harden run summary and move on; do not re-propose
it in the same run.
For every rule you convert (or verify as already covered), stamp its AGENTS.md line with an inline HTML comment, exactly this format:
<!-- origin: <failure|source> <date>, probation: <model> -->
<failure|source> is either the failure that motivated the rule or the source that
established it (a decision, a brief, an incident). <date> is the stamp date. <model>
is the current model name — this is what later goes on probation when the model changes.
The comment is inline on the rule's own line, invisible in rendered Markdown — no sidecar
table.
Summarize: rules converted (with the diff applied), rules verified (already covered, now provenance-stamped), rules left ineligible (with why), and any rejections.
permissions.deny and deny-patterns.txt — never the hook script
itself, never docs/templates/, never a new hook framework.settings.json or deny-patterns.txt requires the
Step 4 approval gate.probation: model no longer matches the current model) is
surfaced by joycraft-tune, not decided here — harden never auto-retires a rule.