Source index · Technical reference · Home

UNRELEASED DEVELOPMENT SNAPSHOT · READ-ONLY EXCERPT

skills/pack-create/SKILL.md

This is the cited technical source at local revision 275a354, inspected on 22 September 2026. It differs from the public release. This reference publishes only the cited sections, not an installable release or the development branch.

Line numbers refer to the complete recorded file. Uncited lines are omitted. Full-file SHA-256: 48afc54a8c489cd46797b675867aa06000683b82d761b6812ec84da217830f22.

1---
2name: pack-create
3layer: foundation
4description: Scaffolds a new Lintel pack — copies _default pack.yaml as starting point, optionally sets extends parent, validates result.
5color: green
6tools: Read, Write, Edit, Bash
7voice: internal
8cli_support: [claude-code, codex]
9---
11You are the PACK-CREATE skill — scaffolds a new pack in `<repo>/packs/<name>/` or `~/.lintel/packs/<name>/`.
13## What this skill does
15Creates a new pack directory + manifest. Three modes:
17- **Blank pack:** starts from `packs/_default/pack.yaml` skeleton (every field declared with neutral value)
18- **Extending pack:** starts from `packs/_default/pack.yaml` + sets `extends: <parent-name>` (validates parent exists)
19- **Cloned pack:** copies an existing pack as a starting point (operator edits per their needs)
21## When to use
23- Operator wants a new pack for a fresh customer/team/domain
24- Sister pack to an existing pack (extends: shared parent)
25- Forking an existing pack for an isolated experiment
… omitted uncited lines …
67```bash
68if [ -n "$extends" ]; then
69 source "$REPO_ROOT/lib/pack-resolver.sh"
70 if ! validate_pack "$extends" 2>/dev/null; then
71 echo "ERROR: parent pack '$extends' does not exist or fails validation"
72 exit 1
73 fi
74fi
75```
77### Step 5 — Write manifest
79```bash
80mkdir -p "$target_dir/$name"
81cp "$template" "$target_dir/$name/pack.yaml"
83# Replace name: line
84sed -i.bak "s/^name: .*/name: $name/" "$target_dir/$name/pack.yaml"
85rm -f "$target_dir/$name/pack.yaml.bak"
87# Add extends: if requested
88if [ -n "$extends" ]; then
89 # Insert after `version:` line
90 awk -v ext="$extends" '
91 /^version:/ { print; print "extends: " ext; next }
92 { print }
93 ' "$target_dir/$name/pack.yaml" > "$target_dir/$name/pack.yaml.tmp"
94 mv "$target_dir/$name/pack.yaml.tmp" "$target_dir/$name/pack.yaml"
95fi
96```
98### Step 6 — Validate result
100```bash
101source "$REPO_ROOT/lib/pack-resolver.sh"
102if validate_pack "$name" 2>&1; then
103 echo "✓ Pack '$name' created at $target_dir/$name/"
104else
105 echo "WARN: pack created but validation failed — review pack.yaml"
106fi
107```
109### Step 7 — Audit + surface next steps
111```bash
112ts=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
113printf '{"ts":"%s","kind":"pack_created","name":"%s","extends":"%s","scope":"%s","operator":"%s"}\n' \
114 "$ts" "$name" "${extends:-none}" "$scope" "$(whoami)" \
115 >> "$LINTEL_HOME/audit/pack-lifecycle.jsonl"
… omitted uncited lines …
126- After Step 6 if validation fails: surface, ask to retry or abandon
128## Integration
130**Reads:**
131- `packs/_default/pack.yaml` (template)
132- `lib/pack-resolver.sh` (validation)
134**Writes:**
135- `<scope>/packs/<name>/pack.yaml`
136- `~/.lintel/audit/pack-lifecycle.jsonl`
138**Triggers (recommends):**
139- `/li:pack-switch <name>` to activate the new pack
140- `/li:pack-list` to confirm
142## Anti-patterns
144- **Creating a pack to override one field** — edit `pack.yaml` of an existing pack instead
145- **Not validating extends parent** — broken extends silently degrades to _default at runtime
146- **Auto-activating after create** — operator decides when to switch (avoids surprise behavior changes mid-session)