Skip to content

Commit 53bf87f

Browse files
committed
Optimize setup context budget
Most work done here: agenticnotetaking#13
1 parent c3780ee commit 53bf87f

1 file changed

Lines changed: 119 additions & 59 deletions

File tree

skills/setup/SKILL.md

Lines changed: 119 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ Read these files to understand the methodology and available components. Read th
1717
**Core references (always read):**
1818
- `${CLAUDE_PLUGIN_ROOT}/reference/kernel.yaml` -- the 15 kernel primitives (with enforcement levels)
1919
- `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md` -- dimension coupling rules, hard/soft constraint checks
20-
- `${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md` -- 10 failure modes with domain vulnerability matrix
2120
- `${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md` -- domain-native vocabulary mappings (6 transformation levels)
22-
- `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md` -- personality derivation (4 dimensions, conflict resolution, artifact transformation)
23-
- `${CLAUDE_PLUGIN_ROOT}/reference/three-spaces.md` -- three-space architecture (self/notes/ops separation rules)
24-
- `${CLAUDE_PLUGIN_ROOT}/reference/use-case-presets.md` -- 3 presets with pre-validated configurations
25-
- `${CLAUDE_PLUGIN_ROOT}/reference/conversation-patterns.md` -- 5 worked examples validating derivation heuristics
21+
22+
**Deferred references (read at specific steps, not upfront):**
23+
- `${CLAUDE_PLUGIN_ROOT}/reference/use-case-presets.md` -- read in Step 3c (only the matched preset section)
24+
- `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md` -- read in Step 3d (only if personality signals detected)
25+
- `${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md` -- read in Step 3f (only HIGH-risk failure mode sections identified by the inlined matrix)
26+
- `${CLAUDE_PLUGIN_ROOT}/reference/three-spaces.md` -- not needed; folder structure is fully specified in Step 2
27+
- `${CLAUDE_PLUGIN_ROOT}/reference/conversation-patterns.md` -- consult only if derivation is ambiguous and worked examples would help
2628

2729
**Generation references (read during Phase 5):**
2830
- `${CLAUDE_PLUGIN_ROOT}/generators/claude-md.md` -- CLAUDE.md generation template
@@ -328,7 +330,7 @@ Signals that clearly override defaults get applied. Signals that are ambiguous l
328330

329331
### Step 3b: Cascade Resolution
330332

331-
Once primary dimensions are set, cascade through interaction constraints. Read `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md` for the full cascade rules.
333+
Once primary dimensions are set, cascade through interaction constraints (already loaded from upfront reference reads).
332334

333335
Key cascades:
334336
- Atomic granularity -> pressure toward explicit linking, deep navigation, heavier processing
@@ -340,6 +342,8 @@ For cascaded values: confidence = INFERRED (0.2). User signals ALWAYS override c
340342

341343
### Step 3c: Vocabulary Derivation
342344

345+
Read `${CLAUDE_PLUGIN_ROOT}/reference/use-case-presets.md` — but only the section for the matched preset (or the two closest presets if blending for a novel domain). Skip unmatched preset sections.
346+
343347
Build the complete vocabulary mapping for all 6 transformation levels (see `${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md`):
344348

345349
1. **User's own words** -- highest priority. If they said "book note," use "book note."
@@ -356,7 +360,9 @@ For novel domains (no preset scores above 2.0 affinity):
356360

357361
**Default: neutral-helpful.** Personality is opt-in. The init wizard does NOT ask about personality dimensions unless conversation signals clearly indicate personality preferences.
358362

359-
Map personality signals to four dimensions (see `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md`):
363+
If personality signals were detected during conversation, read `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md` for the full derivation rules. If no personality signals exist (the common case), skip this read — the default neutral-helpful requires no reference file.
364+
365+
Map personality signals to four dimensions:
360366

361367
| Dimension | Poles | Default |
362368
|-----------|-------|---------|
@@ -379,7 +385,7 @@ If personality is derived (strong signals exist), set `personality.enabled: true
379385

380386
### Step 3e: Coherence Validation (Three-Pass Check)
381387

382-
Run BEFORE proceeding to the proposal. Read `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md`.
388+
Run BEFORE proceeding to the proposal. Use the interaction constraints already loaded from upfront reference reads.
383389

384390
**Pass 1 -- Hard constraint check:**
385391

@@ -419,7 +425,26 @@ Note active compensations in derivation rationale. Flag compensated dimensions f
419425

420426
### Step 3f: Failure Mode Risk Assessment
421427

422-
Read `${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md`. Check the derived configuration against the domain vulnerability matrix. Flag all HIGH-risk failure modes for this configuration. These get included in the generated context file's "Common Pitfalls" section.
428+
Check the derived configuration against the domain vulnerability matrix below. Flag all HIGH-risk failure modes for this configuration. These get included in the generated context file's "Common Pitfalls" section.
429+
430+
**Domain Vulnerability Matrix:**
431+
432+
| Failure Mode | Research | Learning | Therapy | Relationships | Creative | PM | Companion |
433+
|-------------|----------|----------|---------|---------------|----------|-----|-----------|
434+
| Collector's Fallacy | HIGH | HIGH | medium | low | medium | medium | low |
435+
| Orphan Drift | HIGH | HIGH | medium | low | medium | low | low |
436+
| Link Rot | medium | medium | low | low | medium | low | low |
437+
| Schema Erosion | medium | medium | medium | medium | low | medium | low |
438+
| MOC Sprawl | HIGH | medium | low | low | medium | low | low |
439+
| Verbatim Risk | HIGH | HIGH | low | low | low | low | low |
440+
| Cognitive Outsourcing | HIGH | medium | HIGH | low | medium | low | medium |
441+
| Over-Automation | medium | medium | medium | low | low | medium | low |
442+
| Productivity Porn | HIGH | medium | low | low | medium | HIGH | low |
443+
| Temporal Staleness | low | medium | low | low | low | HIGH | low |
444+
445+
Include all HIGH-risk modes in the generated context file. Mention medium-risk modes briefly. Omit low-risk modes.
446+
447+
Read `${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md` — but only the sections for HIGH-risk failure modes identified above. Use the prevention patterns, warning signs, and domain-specific descriptions to write the "Common Pitfalls" section in domain-native vocabulary. Skip sections for medium and low-risk modes.
423448

424449
### Step 3g: Full Automation Configuration
425450

@@ -712,7 +737,7 @@ Step 9: Write the file.
712737

713738
#### Step 4: self/identity.md
714739

715-
**Re-read `ops/derivation.md`** for personality dimensions, vocabulary mapping, and use case context.
740+
**Re-read `ops/derivation.md`** for personality dimensions, vocabulary mapping, and use case context. If personality is derived (personality.enabled = true), also re-read `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md` for the personality x artifact transformation matrix.
716741

717742
Generate identity.md with personality expressed as natural self-description, not configuration syntax.
718743

@@ -748,8 +773,6 @@ Topics:
748773

749774
#### Step 5: self/methodology.md
750775

751-
**Re-read `ops/derivation.md`** for processing level, vocabulary mapping, and domain context.
752-
753776
```markdown
754777
---
755778
description: How I process, connect, and maintain knowledge
@@ -778,7 +801,7 @@ Topics:
778801

779802
#### Step 5f: ops/methodology/ (Vault Self-Knowledge)
780803

781-
**Re-read `ops/derivation.md`** for all dimension choices, platform tier, automation level, active feature blocks, and coherence validation results. This step creates the vault's self-knowledge folder required by Kernel Primitive 14 (methodology-folder).
804+
This step creates the vault's self-knowledge folder required by Kernel Primitive 14 (methodology-folder).
782805

783806
**Create `ops/methodology/methodology.md`** (MOC):
784807

@@ -996,8 +1019,6 @@ generated_from: "arscontexta-{version}"
9961019

9971020
#### Step 6: self/goals.md
9981021

999-
**Re-read `ops/derivation.md`** for use case context.
1000-
10011022
```markdown
10021023
---
10031024
description: Current active threads and what I am working on
@@ -1258,42 +1279,36 @@ Apply vocabulary transformation to the template: field labels in comments and ex
12581279

12591280
---
12601281

1261-
#### Step 9: Skills (vocabulary-transformed, full suite)
1282+
#### Step 9: Skills (tiered generation, full suite)
12621283

12631284
**Re-read `ops/derivation.md`** for processing level, platform, vocabulary mapping, and skills list.
12641285

12651286
Generate ALL skills for the detected platform. Every vault ships with the complete skill set from day one. Full automation is the default — users opt down, never up.
12661287

1267-
**Skill source templates live at `${CLAUDE_PLUGIN_ROOT}/skill-sources/`.** Each subdirectory contains a `SKILL.md` template that must be read, vocabulary-transformed, and written to the user's skills directory.
1288+
**Skill source templates live at `${CLAUDE_PLUGIN_ROOT}/skill-sources/`.** Each subdirectory contains a `SKILL.md` template that must be read and written to the user's skills directory.
12681289

12691290
The 16 skill sources to install:
12701291

1271-
| Source Directory | Skill Name | Category |
1272-
|-----------------|------------|----------|
1273-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reduce/` | reduce | Processing |
1274-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reflect/` | reflect | Processing |
1275-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reweave/` | reweave | Processing |
1276-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/verify/` | verify | Processing |
1277-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/validate/` | validate | Processing |
1278-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/seed/` | seed | Orchestration |
1279-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/ralph/` | ralph | Orchestration |
1280-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/pipeline/` | pipeline | Orchestration |
1281-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/tasks/` | tasks | Orchestration |
1282-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/stats/` | stats | Navigation |
1283-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/graph/` | graph | Navigation |
1284-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/next/` | next | Navigation |
1285-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/learn/` | learn | Growth |
1286-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/remember/` | remember | Growth |
1287-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/rethink/` | rethink | Evolution |
1288-
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/refactor/` | refactor | Evolution |
1289-
1290-
For each skill:
1291-
1. Read `${CLAUDE_PLUGIN_ROOT}/skill-sources/[name]/SKILL.md`
1292-
2. Apply vocabulary transformation — rename and update ALL internal references using the vocabulary mapping from `ops/derivation.md`
1293-
3. Adjust skill metadata (set `context: fork` for fresh context per invocation)
1294-
4. Write the transformed SKILL.md to the user's skills directory
1295-
1296-
**For Claude Code:** Write to `.claude/skills/[domain-skill-name]/SKILL.md`
1292+
| Source Directory | Skill Name | Category | Tier |
1293+
|-----------------|------------|----------|------|
1294+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/learn/` | learn | Growth | A |
1295+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/tasks/` | tasks | Orchestration | A |
1296+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reflect/` | reflect | Processing | B |
1297+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reweave/` | reweave | Processing | B |
1298+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/stats/` | stats | Navigation | B |
1299+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/graph/` | graph | Navigation | B |
1300+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/refactor/` | refactor | Evolution | B |
1301+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/seed/` | seed | Orchestration | C |
1302+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/pipeline/` | pipeline | Orchestration | C |
1303+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/ralph/` | ralph | Orchestration | C |
1304+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/rethink/` | rethink | Evolution | C |
1305+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/next/` | next | Navigation | C |
1306+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/validate/` | validate | Processing | C |
1307+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/remember/` | remember | Growth | C |
1308+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/reduce/` | reduce | Processing | C |
1309+
| `${CLAUDE_PLUGIN_ROOT}/skill-sources/verify/` | verify | Processing | C |
1310+
1311+
**For Claude Code:** Write each skill to `.claude/skills/[domain-skill-name]/SKILL.md`
12971312

12981313
**CRITICAL:** Do NOT generate skills from scratch or improvise their content. Read the source template and transform it. The templates contain quality gates, anti-shortcut language, and handoff formats that must be preserved.
12991314

@@ -1303,6 +1318,62 @@ Every generated skill must include:
13031318
- Handoff block format for orchestrated execution
13041319
- Domain-native vocabulary throughout
13051320

1321+
##### Tiered Generation Protocol
1322+
1323+
Skills use two placeholder types:
1324+
- `{vocabulary.xxx}` — resolves at **runtime** when the skill reads `ops/derivation-manifest.md`. Do NOT substitute these during setup.
1325+
- `{DOMAIN:xxx}` — literal string templates that must be substituted at **setup time** using the vocabulary mapping.
1326+
1327+
Process tiers in order: **A → B → C** (simplest first, saving context for skills that need transformation).
1328+
1329+
##### Tier A — Copy (no placeholders)
1330+
1331+
**Skills:** learn, tasks
1332+
1333+
These skill sources contain zero placeholders of either type.
1334+
1335+
1. Read source `SKILL.md`
1336+
2. Transform frontmatter only:
1337+
- `name:` → domain-native command name from vocabulary mapping
1338+
- `description:` → rewrite trigger phrases with domain vocabulary
1339+
- All other frontmatter fields (`model`, `context`, `allowed-tools`, etc.) → copy verbatim
1340+
3. Copy body verbatim — no scanning, no vocabulary reasoning
1341+
4. Write to skills directory
1342+
1343+
##### Tier B — Frontmatter only (runtime vocabulary)
1344+
1345+
**Skills:** reflect, reweave, stats, graph, refactor
1346+
1347+
These skill sources contain only `{vocabulary.xxx}` patterns in their body. Those patterns resolve at runtime — they are NOT setup-time templates.
1348+
1349+
1. Read source `SKILL.md`
1350+
2. Transform frontmatter only:
1351+
- `name:` → domain-native command name from vocabulary mapping
1352+
- `description:` → rewrite trigger phrases with domain vocabulary
1353+
- All other frontmatter fields (`model`, `context`, `allowed-tools`, etc.) → copy verbatim
1354+
3. Copy body verbatim — `{vocabulary.xxx}` patterns are **intentionally preserved**
1355+
4. Write to skills directory
1356+
1357+
**CRITICAL:** Do NOT transform `{vocabulary.xxx}` patterns in the body. These are runtime references, not setup-time templates. If you see `{vocabulary.notes}` in the body, leave it exactly as-is.
1358+
1359+
##### Tier C — DOMAIN substitution (mechanical string replace)
1360+
1361+
**Skills:** seed, pipeline, ralph, rethink, next, validate, remember, reduce, verify
1362+
1363+
These skill sources contain `{DOMAIN:xxx}` patterns that must be literally substituted at setup time. They may also contain `{vocabulary.xxx}` patterns — leave those intact.
1364+
1365+
1. Read source `SKILL.md`
1366+
2. Transform frontmatter:
1367+
- `name:` → domain-native command name from vocabulary mapping
1368+
- `description:` → rewrite trigger phrases with domain vocabulary
1369+
- All other frontmatter fields (`model`, `context`, `allowed-tools`, etc.) → copy verbatim
1370+
3. Build DOMAIN substitution map from the vocabulary mapping in `ops/derivation.md` (e.g., `{DOMAIN:reduce}` → `/distill`, `{DOMAIN:notes}` → `claims`, `{DOMAIN:topic map}` → `MOC`)
1371+
4. Mechanical string replace: substitute every `{DOMAIN:xxx}` → literal value in the body
1372+
5. Do NOT touch `{vocabulary.xxx}` patterns — leave them for runtime resolution
1373+
6. Write to skills directory
1374+
1375+
**Verification:** After writing each Tier C skill, confirm zero `{DOMAIN:` strings remain in the output file. If any remain, the substitution map is incomplete — check `ops/derivation.md` vocabulary mapping for the missing entry.
1376+
13061377
##### Skill Discoverability Protocol
13071378

13081379
**Platform limitation:** Claude Code's skill index does not refresh mid-session. Skills created during /setup are not discoverable until the user restarts Claude Code.
@@ -1419,8 +1490,6 @@ Generate all four hook scripts: session-orient.sh, session-capture.sh, validate-
14191490

14201491
#### Step 11: Hub MOC
14211492

1422-
**Re-read `ops/derivation.md`** for vocabulary mapping and use case context.
1423-
14241493
Create the vault entry point at `[domain:notes]/index.md`:
14251494

14261495
```markdown
@@ -1514,22 +1583,13 @@ Include a discovery section in the context file documenting what queries exist,
15141583

15151584
#### Step 15: Vault Marker
15161585

1517-
Create `.arscontexta` in the vault root. This marker file identifies the directory as an Ars Contexta vault (hooks only run when it exists) and doubles as the hook configuration file.
1518-
1519-
```yaml
1520-
# Ars Contexta vault marker + config
1521-
# This file identifies the directory as an Ars Contexta vault.
1522-
# Do not delete — hooks only run when this file exists.
1586+
Create `.arscontexta` in the vault root. This marker ensures plugin-level hooks only run inside vaults, even when the plugin is installed globally.
15231587

1524-
git: true
1525-
session_capture: true
15261588
```
1527-
1528-
Keys and defaults:
1529-
- `git: true` — auto-commit on writes (auto-commit.sh)
1530-
- `session_capture: true` — session JSON capture on start (session-orient.sh)
1531-
1532-
Omitted keys default to `true`, so a minimal marker file (or even an empty file) preserves full default behaviour.
1589+
|(^.^) henlo, i am a vaultguard
1590+
please dont delete me — i make sure arscontexta hooks only run
1591+
in your vault, even if you installed the plugin globally
1592+
```
15331593

15341594
---
15351595

0 commit comments

Comments
 (0)