From sage
Generates Claude Code pack files from observation reports and processed sources, including patterns, anti-patterns, constitution, manifest, and tests for community packs or project overlays.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sage:pack-draftThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate the pack files from evidence.
Generate the pack files from evidence.
Core Principle: Every pattern is grounded in an observed agent failure. Every anti-pattern describes real agent behavior. Nothing is hypothetical. The observation report is your evidence — the draft is your argument.
Run the scaffolding tool:
bash .sage/tools/sage-new-pack.sh <pack-name> --layer <N>
This creates the directory structure with template files.
For each confirmed need from the observation report, write a pattern.
Format (mandatory):
# Pattern Name
**Why agents get this wrong:** [1-2 sentences explaining the root cause —
stale training data, wrong defaults, missing context]
**Do:** [2-3 sentences of specific instruction + code example if needed]
Rules:
For each confirmed failure from the observation report, write an anti-pattern.
Format (mandatory):
# Anti-Pattern: Name
**What agents do:** [1-2 sentences — exact behavior observed]
**Why it's wrong:** [1-2 sentences — consequence of the mistake]
**Do instead:** [1 sentence — the correction]
Rules:
Extract 3-7 non-negotiable principles from the patterns:
1. [Framework] components MUST [do X] because [reason].
2. [Pattern Y] MUST NOT be used because [reason].
Use MUST/MUST NOT/SHOULD/SHOULD NOT language. These are laws, not suggestions.
Fill in pack.yaml with real values: name, description, layer, dependencies,
activation conditions, framework version, last-verified date.
Transfer the test prompts from Phase 3 (pack-observe) into tests.md:
Count approximate tokens (words × 1.3) across all content files. Verify total is within budget:
If over budget, trim the lowest-priority patterns first. Better to have 5 sharp patterns than 7 diluted ones.
mkdir -p .sage/packs/<pack-name>
From the project context gathered in Phase 2, generate a single overlay file:
# Project Overlay: <pack-name>
## Extends: <community-pack-name>
## Project-Specific Conventions
### [Convention Category]
[Specific rule for this project]
### [Convention Category]
[Specific rule]
## Constraints
- [What this project cannot use and why]
- [Required patterns]
## Project API Patterns
[Any project-specific API formats, response structures, error handling]
Rules:
---
name: "@project/<pack-name>"
type: overlay
extends: "<community-pack-name>"
version: "1.0.0"
---
Community pack: Complete pack in packs/<name>/ with all required files.
Project overlay: .sage/packs/<name>/overrides.md + minimal pack.yaml.
npx claudepluginhub xoai/sage --plugin sageDrafts pack files from observations and processed sources, creating patterns, anti-patterns, and constitution additions for community packs or project overlays.
Installs 8 bash hook packs for Claude Code to gate tool calls, user prompts, and session events with safety, verification, context recovery, and teammate quality controls.
Checks NL artifacts (skills, agents, prompts) for anti-patterns like vague triggers, prohibitions without alternatives, oversized skills, and monolithic prompts. Use when authoring or reviewing files.