Skip to content
Back to skills

Forge

ASecurity

Turn a repeated mistake into a tested local Codex hook rule. Use for $forge, requests to prevent a recurring tool action, or requests to backtest, list, audit, harvest, or remove project guardrails.

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
ai-agentspythonrustshellbashrails

Works with

  • terminal

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add MohammedAtya/guardrail-forge --skill forge --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forge?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Forge
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mohammedatya-forge-guardrail-forge/badge)](https://www.skillsdirectory.com/skills/mohammedatya-forge-guardrail-forge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: forge
description: Turn a repeated mistake into a tested local Codex hook rule. Use for $forge, requests to prevent a recurring tool action, or requests to backtest, list, audit, harvest, or remove project guardrails.
---

# Forge for Codex

For a standing task such as “after editing Python, run the tests,” use the sibling [always skill](../always/SKILL.md). For a judgment call that a tool hook cannot observe, propose wording for the project's AGENTS.md.

Use the target project root for all commands. The bundled engine is `scripts/codex_forge.py` relative to this skill. The project's installed engine is `.codex/guardrails/codex_forge.py`.

1. Translate the correction into a narrow trigger, the response Codex should receive, and three fixtures showing a violation, allowed work, and a similar allowed action. Use the [rule format and examples](reference/rules.md). For file rules include `Edit|Write|Bash` and match `path`. Codex patches map to one Edit or Write per affected path. Shell commands map to Bash. Choose a pre-tool denial or a post-tool reminder. If the user wants an interactive approval prompt, explain the Codex hook limitation before proposing a denial.
2. Write a candidate JSON file in a temporary directory. Run `python3 <bundled-engine> backtest <candidate> --project-dir <root>`. Review hits against the user's intent. Report historical coverage and the day-one checks separately. Missing rollout history gives no evidence about past behavior.
3. Show the rule, examples and backtest result. Get the user's agreement to the rule and any first-time hook installation. Run `python3 <bundled-engine> install --project-dir <root>` for setup or upgrade. Ask the user to review the four Forge registrations in Codex's `/hooks` in the trusted project. Installation and hook trust are separate.
4. Run `python3 <installed-engine> add <candidate>`. A green fixture suite and a successful add confirm that the rule was saved. Report any conflict or overly broad match and revise the rule against the examples.

Use the installed engine for `list`, `audit`, `doctor`, `test`, and `split`. Use `harvest --project-dir <root>` with the bundled engine to find repeated corrections in available Codex JSONL sessions. The user can archive a rule from their terminal with `python3 .codex/guardrails/codex_forge.py remove <id>`.

Rules apply in the installed project. Codex handles its own permissions and sandbox. The adapter accepts declarative rules and reminders. Claude settings fields, hook-launched fix commands, and approval-prompt rules are unsupported.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.