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.
npx claudepluginhub xoai/sageThis skill uses the workspace's default tool permissions.
Generate the pack files from evidence.
Plans Claude Code packs by identifying type to build, checking existing packs, classifying layers (domain/framework/stack), forking community/project paths, and capturing agent failures. Triggers on pack creation/customization requests.
Evaluates Claude Code packages across 6 quality dimensions like frontmatter and structure for all 7 package types, producing scored audit reports. Use for quick single-package audits or full repository scans.
Determines PACT project scale tier (Seed, Growth, Full) via user input and checks delegation before initializing governance files. Use at start of PACT setup.
Share bugs, ideas, or general feedback.
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.