# Codify Lesson

> Detect recurring P2/P3 audit patterns across recent rounds and promote them into lesson cards. Use after round boundaries or when repeated findings appear.

- Skill: `arch1esun/codify-lesson` (Agent Skill)
- Install (CLI): `npx skillmds@latest add arch1esun/codify-lesson`
- Raw SKILL.md: https://api.skillmd.com/api/skills/arch1esun/codify-lesson/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: Arch1eSUN (https://skillmd.com/u/arch1esun)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/arch1esun/codify-lesson

---


# codify-lesson

Scans recent audit handoffs for recurring P2/P3 patterns in structured findings
tables and promotes repeated clusters into lesson cards.

## When to invoke

- After `round-boundary-lesson-scan` reports a promotable cluster
- User invokes `/codify-lesson`
- 3+ rounds show the same structured finding pattern

## Workflow

1. Shell out to the toolkit:

   ```bash
   arcgentic codify-lesson \
     --audit-dir docs/audits \
     --lessons-dir lessons \
     --amendments-dir mandates/amendments
   ```

2. Read stdout:
   - `lessons: N`
   - `amendments: N`
   - `streak_updates: N`

3. Inspect every generated lesson card before accepting it.

4. If an amendment proposal is generated, stop for founder review before applying
   mandate/rule changes.

The scanner ignores reference scans, author notes, forward-debt prose, and other
unstructured markdown even when those sections mention `P2` or `P3`.

## Output contract

- New lesson card: `lessons/lesson-{N}-{slug}.md`
- Formal-threshold amendment proposal: `mandates/amendments/amendment-{slug}.md`
- Existing lesson streak updates when a lesson was preserved

## See also

- `agents/lesson-codifier.md`
- `toolkit/src/arcgentic/skills_impl/codify_lesson.py`
- `toolkit/src/arcgentic/utils/pattern_detection.py`

