用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SocketDev/odai --skill codifying-footguns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | codifying-footguns |
| description | Turn a repeated mistake into an enforcement artifact: hook, lint rule, script, or doctrine line. |
A footgun you only write down repeats. The rule is: the same pass that hits it produces the artifact that prevents it. Not the next session, not a follow-up line in a report.
This skill exists because "I hit X again" was said several times in one session about mistakes that already had notes written about them. A note is not enforcement.
The memory side of this is docs/agents.md/fleet/memory-codification.md: a
memory stating an enforceable rule carries an enforcement: line naming the
artifact. That page says a lesson needs an enforcer; this one is how to build
one.
The step people skip, and the one that decides whether the artifact is worth having. Run the candidate pattern across the tree and read the hits.
grep -rEIho "<pattern>" --include='*.mts' . | wc -l
Then judge:
used to <verb> is half passive-purpose
(Used to gate the bypass), in the past is always a date comparison,
historically reads as present-tense legacy state, and spawnSync without
stdioString is 292 of 334 callsites.Re-measure through the REAL entry point afterwards, not a reimplementation. An audit script that loops per-item where the guard groups items over-reports; that turned a real count of 5 into a chased 33.
| The footgun is | Use | Because |
|---|---|---|
| A command shape (bash, git, a CLI) | hook, PreToolUse | Only a hook sees a tool call before it runs |
| Something written into a file | oxlint rule | It is checkable from source, in CI, forever |
| Advice you handed the operator | hook, Stop/PostToolUse | Prose is not a tool call; the bash-side guard never sees it |
| A multi-step flow people re-derive | script (.mts) + a package.json entry | The script owns the argv nobody should retype |
| A judgement call with no single right answer | skill | A checklist beats a blocker when the answer is contextual |
| A fact about intent or preference | doctrine line in CLAUDE.md, or a memory | Nothing to detect, so nothing to enforce |
One artifact per pattern. Two patterns in one rule cannot be dropped independently when one stops earning its keep.
docs/agents.md/fleet/hook-registry.md, or inline in
CLAUDE.md. new-hook-claude-md-guard BLOCKS the Write until this
exists - policy with no entry is policy nobody can look up.void runHook(hook, import.meta.url), with the void. dispatch-scan
matches that literal text; without it the hook is dropped from the
dispatch table and never runs. socket/require-void-run-hook catches it.global: true if the rule holds in ANY repo, then
pnpm run sync-global-hooks. A global hook not named in
~/.claude/settings.json never fires outside a fleet checkout.template/base/... path, or the mirror is
materialized first. Editing canonical while testing the mirror is a
silent pass.node scripts/repo/bootstrap/fleet.mjs --from-template then
node scripts/fleet/gen/hook-dispatch.mts. The generated count going up
by one is the proof it registered.Fix: line.fleet/<name>/index.mts and fleet/<name>/package.json..config/fleet/oxlint-plugin/index.mts, both the import and
the rules map, alphabetically..config/fleet/oxlintrc.json.node scripts/fleet/build-oxlint-bundle.mts. The bundle is generated and
gitignored; without a rebuild oxlint reports
Rule '<name>' not found in plugin 'socket'.RuleTester cases, with the VALID cases pinning the narrowness. The valid
list is what stops the rule being disabled later.pnpm run lint --all clean, and the finding count stated in the commit.package.json entry, so it is reachable as pnpm run <name> and a
guard can redirect to it.--check mode that reports and exits non-zero without writing, so the
doctor and CI can consume it.runMain + isMainModule, bare, matching the other 449 callsites._shared/script-redirects.mts so both the bash-side and emission-side
guards route to it.CLAUDE.md, with the enforcing artifact in parentheses if one
exists.docs/agents.md/fleet/*.md page when it needs more than a line.