Skip to content
Back to skills

Authoring Instructions

ASecurity

Creates and audits the instruction files agents read: agent rules (rules/*.md), the root AGENTS.md with its thin CLAUDE.md bridge, and event-driven hooks (.apm/hooks/hooks.json plus handler scripts). Use when the user wants to write, check, trim or migrate a rule, AGENTS.md or CLAUDE.md, or to add or lint a lifecycle hook such as PreToolUse or SessionStart. Not for skills (use authoring-skills), whole plugins (use authoring-plugins) or GitHub workflows (use authoring-github-workflows).

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 9, 2026
ai-agentspythonbashgit

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add richfrem/agent-plugins-skills --skill authoring-instructions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Authoring Instructions?

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

Security grade badge for Authoring Instructions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-authoring-instructions/badge)](https://www.skillsdirectory.com/skills/richfrem-authoring-instructions)

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: authoring-instructions
plugin: agent-extension-authoring
description: >-
  Creates and audits the instruction files agents read: agent rules (rules/*.md), the root AGENTS.md with its thin CLAUDE.md bridge, and event-driven hooks (.apm/hooks/hooks.json plus handler scripts). Use when the user wants to write, check, trim or migrate a rule, AGENTS.md or CLAUDE.md, or to add or lint a lifecycle hook such as PreToolUse or SessionStart. Not for skills (use authoring-skills), whole plugins (use authoring-plugins) or GitHub workflows (use authoring-github-workflows).
argument-hint: "[rule|agents-md|hook] [create|audit] [path]"
allowed-tools: Bash, Read, Write
---

# Authoring Instructions (`authoring-instructions`)

Writes lean, invariant-driven instruction files and audits them deterministically: rules, root `AGENTS.md` / `CLAUDE.md`, and plugin hooks.

## Contents

- [Constraints](#constraints) • [Modes](#modes) • [Quick start](#quick-start) • [Workflow](#workflow) • [Verification](#verification) • [References](#references)

## Constraints

1. **Rules are constraints, skills are procedures.** A rule states MUST / NEVER / ALWAYS bounds in 30–70 lines (ceiling 80); anything with ordered steps becomes a skill.
2. **Timeless and portable**: no calendar dates, commit SHAs, usernames or absolute machine paths in a rule or root file.
3. **Never overwrite** an existing `AGENTS.md` or `CLAUDE.md`; propose a diff. `CLAUDE.md` stays a bridge of 5 lines or fewer.
4. **Audits are read-only.** They report findings; changes are reviewed edits.
5. **APM-native hooks (SF-11)**: hooks live in `plugins/<plugin>/.apm/hooks/hooks.json` and use `python3 ... || python ...` commands anchored on `${CLAUDE_PLUGIN_ROOT}/.apm/hooks/<name>.py`. Hook scripts run under every target harness (`claude`, `copilot`, `codex`): use `Path(__file__).resolve()` for sibling files, store runtime state in harness-neutral paths (`context/`), never `.claude/` or `.agents/`, exit silently when the repository is not initialised, and stay fast.
6. **Rules & APM (SF-9)**: APM does not deploy a plugin's `rules/` folder (instructions deploy from `.apm/instructions/`), so rules need no copy manifest or symlink registration step; setup copies needed rules into `.agent/rules/`.

## Modes

| Mode | Use when | Entry point | Reference |
|---|---|---|---|
| `create-rule` | New rule file | write the canonical structure | [create-rule.md](references/modes/create-rule.md) |
| `audit-rule` | Check rules | `scripts/audit_rule.py` | [audit-rule.md](references/modes/audit-rule.md) |
| `create-agents-md` | Scaffold or migrate root files | `assets/templates/AGENTS.md.jinja` | [create-agents-md.md](references/modes/create-agents-md.md) |
| `audit-agents-md` | Check size, timelessness, disclosure | `scripts/audit_agents_md.py` | [audit-agents-md.md](references/modes/audit-agents-md.md) |
| `hook` | Add, lint or test a lifecycle hook | `scripts/scaffold_hook.py` | [create-hook.md](references/modes/create-hook.md) |

## Quick start

```bash
python3 scripts/audit_rule.py <rules-dir-or-file> --json
python3 scripts/audit_agents_md.py AGENTS.md --strict
python3 scripts/scaffold_hook.py --event PreToolUse --name check-command --plugin-root plugins/<plugin>
```

## Workflow

1. Pick the mode and read its reference before running anything.
2. Create modes: draft from the canonical structure or template, then run the matching audit.
3. Hook mode: scaffold, implement the handler under `.apm/hooks/`, then run `scripts/validate_hook_schema.py` and `scripts/hook_linter.py`; exercise it with `scripts/test_hook.py`.
4. On any failure follow that mode's section in [fallback-tree.md](references/fallback-tree.md).

## Verification

```bash
python3 scripts/audit_rule.py <rule.md> --strict
python3 scripts/audit_agents_md.py . --all --strict
python3 scripts/validate_hook_schema.py plugins/<plugin>/.apm/hooks/hooks.json
```

Tests: `python3 -m pytest tests`. Check the mode's section in [acceptance-criteria.md](references/acceptance-criteria.md).

## References

- Modes: [create-rule](references/modes/create-rule.md) • [audit-rule](references/modes/audit-rule.md) • [create-agents-md](references/modes/create-agents-md.md) • [audit-agents-md](references/modes/audit-agents-md.md) • [hook](references/modes/create-hook.md)
- Detail: [agents-md-contract.md](references/agents-md-contract.md) • [hooks-spec.md](references/hooks-spec.md) • [hook-patterns.md](references/hook-patterns.md) • [hook-advanced.md](references/hook-advanced.md) • [hook-migration.md](references/hook-migration.md)
- Gates: [acceptance-criteria.md](references/acceptance-criteria.md) • [fallback-tree.md](references/fallback-tree.md)
- Template: [AGENTS.md.jinja](assets/templates/AGENTS.md.jinja)

Files in this skill

  • SKILL.md4.7 KB
  • assets/templates/AGENTS.md.jinja687 B
  • evals/evals.json3.3 KB
  • references/acceptance-criteria.md2.2 KB
  • references/agents-md-contract.md3.6 KB
  • references/fallback-tree.md2.2 KB
  • references/hook-advanced.md10.7 KB
  • references/hook-migration.md8.7 KB
  • references/hook-patterns.md7.7 KB
  • references/hooks-spec.md4.8 KB
  • references/modes/audit-agents-md.md1.8 KB
  • references/modes/audit-rule.md2 KB
  • references/modes/create-agents-md.md2.3 KB
  • references/modes/create-hook.md3.1 KB
  • references/modes/create-rule.md2.8 KB
  • scripts/audit_agents_md.py15 KB
  • scripts/audit_rule.py11.7 KB
  • scripts/hook_linter.py8.6 KB
  • scripts/scaffold_hook.py4.4 KB
  • scripts/test_hook.py10 KB

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.