feat(pipeline): add Unix toolbox orientation to pipeline skills

- Add Orientation sections to housekeeping, reflect, evolve with shell
  commands (find -mtime, grep -c, git diff, wc -c) for efficient scoping
- Update CLAUDE.md memory retrieval to use domain-scoped L0 grep

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcio Puga
2026-03-24 21:30:50 +11:00
parent 28aa16226a
commit d5e9e4333d
4 changed files with 56 additions and 1 deletions

View File

@@ -22,6 +22,26 @@ Measure (don't edit content):
- `memory/cog-meta/patterns.md`
- Any domain satellite pattern files (e.g. `work/*/patterns.md`)
## Orientation (run FIRST, before any file reads)
Use these shell commands to see exactly what changed since last run:
```bash
# What did housekeeping and reflect change recently?
git diff HEAD~1 --stat memory/
# Detailed diff of architectural files (what you care about)
git diff HEAD~1 memory/cog-meta/patterns.md memory/hot-memory.md CLAUDE.md
# What changed in the last 24h?
find memory/ -type f -name "*.md" -mtime -1 | sort
# Current prompt weight components (quick file sizes)
wc -c memory/hot-memory.md memory/cog-meta/patterns.md memory/cog-meta/briefing-bridge.md 2>/dev/null
```
Use git diffs to understand what housekeeping/reflect actually did, instead of re-reading entire files.
## Process
### 1. Architecture Review

View File

@@ -1,5 +1,23 @@
Use this skill to perform memory housekeeping. Trigger if the user says "housekeeping", "clean up memory", "prune memory", "archive old data", or similar maintenance requests.
## 0. Orientation (run FIRST, before any file reads)
Use these shell commands to scope your work before reading files:
```bash
# What changed since last run? Focus here first.
find memory/ -type f -name "*.md" -mtime -1 | sort
# Quick entry counts for archival threshold checks (>50 = archive)
# Add paths for any domain observations files that exist
grep -c "^- " memory/cog-meta/self-observations.md memory/personal/observations.md memory/*/observations.md memory/*/*/observations.md 2>/dev/null
# Completed action items count (>10 = archive)
grep -c "^\- \[x\]" memory/personal/action-items.md memory/*/action-items.md memory/*/*/action-items.md 2>/dev/null
```
Only read files that need work based on these results. Skip unchanged files.
## 1. Garbage Collect Memory
Review and archive stale data per CLAUDE.md glacier rules. All glacier files must have YAML frontmatter.

View File

@@ -11,6 +11,23 @@ If you spot issues in these files, note them in self-observations and evolve wil
Self-improvement — pattern recognition, memory maintenance, knowledge base quality.
## Orientation (run FIRST, before any file reads)
Use these shell commands to scope your work before reading files:
```bash
# What changed since last run? Focus here.
find memory/ -type f -name "*.md" -mtime -1 | sort
# L0 summaries for all domains — quick routing without opening INDEX.md files
grep -rn "<!-- L0:" memory/ --include="*.md" | grep -v glacier/ | sort
# Entry counts for files approaching archival threshold
grep -c "^- " memory/cog-meta/self-observations.md memory/personal/observations.md memory/*/observations.md memory/*/*/observations.md 2>/dev/null
```
Focus on recently-changed files. Skip files that haven't been modified since last run.
## Memory Files
Read these files on activation:

View File

@@ -156,7 +156,7 @@ The `/reflect` skill reads recent session transcripts to review interactions, ca
When responding to any query:
1. **Identify domain** — match query to a domain via file structure knowledge
2. **L0 scan if uncertain** — if multiple files could be relevant, grep L0 headers in the domain directory before opening files
2. **L0 scan** — once you know the domain, run `grep -rn "<!-- L0:" memory/{domain}/` to get all file summaries in one call. This replaces reading INDEX.md — faster and fewer tokens. Use this to pick the right file(s) before opening anything.
3. **Select files by query type:**
- Schedule, tasks → action-items.md + calendar.md
- Person, "who is" → entities.md