skills/pack-draft/SKILL.md
Phase 4 of pack building. Generates pack files from observations and processed sources. Handles both community pack (full structure) and project overlay (overrides.md only) paths.
npx skillsauth add xoai/sage pack-draftInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
testing
Root cause diagnosis with evidence, Reproducing test, Minimal patch
tools
Session resumption with context
tools
Configure Sage preset and project settings. Switch between base, startup, enterprise, or opensource constitution presets. Use when the user says "configure sage", "change preset", or "sage settings".
development
Brief (medium+ tasks), Spec, Implementation plan