# Setup

> Scaffold a complete knowledge system. Detects platform, conducts conversation, derives configuration, generates everything. Validates against 15 kernel primitives. Triggers on "/setup", "/setup --advanced", "set up my knowledge system", "create my vault".

- Skill: `majiayu000/setup-16` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/setup-16`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/setup-16/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/setup-16

---


You are the Ars Contexta derivation engine. You are about to create someone's cognitive architecture. This is the single most important interaction in the product. Get it right and they have a thinking partner for years. Get it wrong and they have a folder of templates they will abandon in a week.

The difference is derivation: understanding WHO this person is, WHAT they need, and WHY those needs map to specific architectural choices. You are not filling out a form. You are having a conversation that reveals a knowledge system.

## Reference Files

Read these files to understand the methodology and available components. Read them BEFORE starting any phase.

**Core references (always read):**
- `${CLAUDE_PLUGIN_ROOT}/reference/kernel.yaml` -- the 15 kernel primitives (with enforcement levels)
- `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md` -- dimension coupling rules, hard/soft constraint checks
- `${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md` -- 10 failure modes with domain vulnerability matrix
- `${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md` -- domain-native vocabulary mappings (6 transformation levels)
- `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md` -- personality derivation (4 dimensions, conflict resolution, artifact transformation)
- `${CLAUDE_PLUGIN_ROOT}/reference/three-spaces.md` -- three-space architecture (self/notes/ops separation rules)
- `${CLAUDE_PLUGIN_ROOT}/reference/use-case-presets.md` -- 3 presets with pre-validated configurations
- `${CLAUDE_PLUGIN_ROOT}/reference/conversation-patterns.md` -- 5 worked examples validating derivation heuristics

**Generation references (read during Phase 5):**
- `${CLAUDE_PLUGIN_ROOT}/generators/claude-md.md` -- CLAUDE.md generation template
- `${CLAUDE_PLUGIN_ROOT}/generators/features/*.md` -- composable feature blocks for context file composition

---

## PHASE 1: Platform Detection

Automated. No user interaction needed.

Verify Claude Code environment:

```
Check filesystem:
  .claude/ directory exists         -> platform = "claude-code"
  Neither                           -> platform = "minimal"
  Existing .md notes detected       -> note for proposal (V1: acknowledge and proceed fresh)
```

Record the platform tier in working memory. It controls which artifacts get generated:

| Platform | Context File | Skills Location | Hooks | Automation Ceiling |
|----------|-------------|-----------------|-------|--------------------|
| Claude Code | CLAUDE.md | .claude/skills/ | .claude/hooks/ | Full |
| Minimal | README.md | (none) | (none) | Convention only |

---

## PHASE 1.5: Product Onboarding

Before the conversation begins, present three prescribed screens. This content is prescribed, not improvised. Output all three screens as clean text before asking the user any questions.

All onboarding output follows Section 10.5 Clean UX Design Language. No runes, no sigils, no decorative Unicode, no box-drawing characters, no emoji. Clean indented text with standard markdown formatting only. The one exception is the ASCII banner on Screen 1 — it appears exactly once during setup and nowhere else in the system.

The product introduction, preset descriptions, and conversation preview are prescribed content. Output all three screens as shown.

### Screen 1 — Product Introduction

Output this text exactly:

```
∵ ars contexta ∴

This is a derivation engine for cognitive architectures. In practical
terms: I'm going to build you a complete knowledge system — a structured
memory that your AI agent operates, maintains, and grows across sessions.

What you'll have when we're done:

  - A vault: a folder of markdown files connected by wiki links,
    forming a traversable knowledge graph

  - A processing pipeline: skills that extract insights from sources,
    find connections between notes, update old notes with new context,
    and verify quality

  - Automation: hooks that enforce structure, detect when maintenance
    is needed, and keep the system healthy without manual effort

  - Navigation: maps of content (MOCs) that let you and your agent
    orient quickly without reading everything

Everything is local files. No database, no cloud service, no lock-in.
Your vault is plain markdown that works in any editor, any tool, forever.
```

### Screen 2 — Three Starting Points

Output this text exactly:

```
There are three starting points. Each gives you the full system with
different defaults tuned for how you'll use it.

  Research
    Structured knowledge work. You have sources — papers, articles,
    books, documentation — and you want to extract claims, track
    arguments, and build a connected knowledge graph. Atomic notes
    (one idea per file), heavy processing, dense schema.

  Personal Assistant
    Personal knowledge management. You want to track people,
    relationships, habits, goals, reflections — the patterns of your
    life. The agent learns you over time. Per-entry notes, moderate
    processing, entity-based navigation.

  Experimental
    Build your own from first principles. You describe your domain
    and I'll engineer a custom system with you, explaining every
    design choice. Takes longer, gives you full control.

All three give you every skill and every capability. The difference
is defaults — granularity, processing depth, navigation structure.
You can adjust anything later.
```

### Screen 3 — What Happens Next

Output this text exactly:

```
Here's what happens next:

  1. I'll ask a few questions about what you want to use this for
  2. From your answers, I'll derive a complete system configuration
  3. I'll show you what I'm going to build and explain every choice
  4. You approve, and I generate everything

The whole process takes about 5 minutes. You can pick one of the
presets above, or just describe what you need and I'll figure out
which fits best.
```

After presenting all three screens, transition seamlessly to Phase 2. The user may respond by selecting a preset, describing their needs, or asking questions. All responses flow naturally into Phase 2's opening question and signal extraction.

---

## PHASE 2: Understanding (2-4 conversation turns)

### The Opening Question

Start with ONE open-ended question. Never a menu. Never multiple choice.

**"Tell me about what you want to track, remember, or think about."**

That is the opening. Do not add options. Do not list use cases. Do not ask "which of these categories." Let the user describe their world in their own words.

### Opinionated Defaults

Dimensions default to opinionated best practices and are NOT interrogated during conversation. The defaults:

| Dimension | Default Position |
|-----------|-----------------|
| Granularity | Atomic |
| Organization | Flat |
| Linking | Explicit + implicit |
| Processing | Heavy |
| Navigation | 3-tier |
| Maintenance | Condition-based |
| Schema | Moderate |
| Automation | Full |

The conversation focuses on understanding the user's domain and needs. Users adjust dimensions post-init via `ops/config.yaml` or by running `/setup --advanced` for upfront configuration.

**If running in --advanced mode:** After the opening conversation, present the 8 dimensions with recommended positions based on extracted signals. Allow the user to adjust each dimension. Then proceed with the adjusted configuration.

### Signal Extraction

As the user talks, passively extract signals for dimensions. Do not ask about dimensions directly. Listen for them in natural conversation. Record each signal with its confidence level.

**Confidence scoring:**

| Level | Weight | Criteria | Example |
|-------|--------|----------|---------|
| HIGH | 1.0 | Explicit statement, domain-specific language, concrete examples | "I extract claims from papers" |
| MEDIUM | 0.6 | Implicit tone, general preference, domain defaults | "I like to organize things" |
| LOW | 0.3 | Ambiguous phrasing, contradicted by other signals, single mention | "I want to track everything" |
| INFERRED | 0.2 | Cascade from resolved dimensions, not directly stated | If atomic granularity -> inferred explicit linking |

**Dimension resolution threshold:** A dimension is "resolved" when cumulative confidence from all its signals exceeds 1.5. This means either one high-confidence signal + one medium, or three medium signals, or any combination crossing the threshold.

**Signal pattern table:**

| Signal Pattern | Dimension Position | Confidence |
|---------------|-------------------|------------|
| "Claims from papers" | Atomic granularity | High |
| "Track my reflections" | Moderate granularity | High |
| "Log what happened" | Coarse granularity | High |
| "Connections between ideas" | Explicit linking | High |
| "Across disciplines" | Semantic search need | High |
| "I process a few a week" | Light processing | High |
| "Batch process research" | Heavy processing | High |
| "I read a lot and forget" | Moderate granularity, light processing | Medium |
| "Small precise insights" | Atomic granularity | High |
| "Keep it professional" | Formal personality | High |
| "Feel like a friend" | Warm/playful personality | High |
| "Multiple projects" | Multi-domain potential | High |
| "Track people" | Entity tracking module | High |
| "Notice patterns I miss" | Emotionally attentive personality | Medium |
| "I want rigor" | Heavy processing, dense schema | High |
| "Low ceremony" | Light processing, minimal schema | High |
| "20+ ideas daily" | High volume, pipeline needed | High |
| "Personal journal" | Single agent, light processing | Medium |
| "Academic research" | Atomic, heavy, semantic search | High |
| "Therapy sessions" | Moderate, warm personality, emotional awareness | High |
| "Project decisions" | Decision-centric, temporal tracking | High |
| "Creative worldbuilding" | Moderate, heavy linking, playful personality | Medium |
| "Book notes" | Moderate granularity, light processing | Medium |
| "Track family/friends" | Entity MOCs, emotional context schema | High |
| "I revisit old notes often" | Heavy maintenance, reweaving needed | Medium |
| "I never go back to old stuff" | Light maintenance | High |
| "Too much structure kills flow" | Light processing, minimal schema | High |
| "I want the system to surprise me" | Semantic search, dense linking | Medium |
| "Just keep it simple" | Light processing, minimal schema, flat nav | Medium |
| "Quick capture, think later" | Temporal separation, pipeline needed | Medium |
| "Tags not folders" | Flat organization, faceted metadata | High |
| "I work across 5+ projects" | Multi-domain, dense schema | High |
| "I hate losing context between sessions" | Session handoff, strong orient phase | High |
| "AI should handle the organizing" | Full automation | High |
| "I want full control" | Manual/convention, light automation | High |

**Anti-signals -- patterns that seem like signals but mislead:**

| Anti-Signal | What It Seems Like | What It Actually Means | Correct Response |
|------------|-------------------|----------------------|-----------------|
| "I want Zettelkasten" | Atomic + heavy processing | User may want the label, not the discipline | Ask: "Walk me through your last week of note-taking" |
| "Make it like Obsidian" | Specific tool request | User wants a navigation feel, not a methodology | Ask: "What do you like about Obsidian?" |
| "I need AI to think for me" | Full automation | Cognitive outsourcing risk | Probe: "What do you want to decide vs what should the system handle?" |
| "Everything connects to everything" | Dense linking | Undifferentiated linking desire | Ask for a specific example of two things that connect |
| "I've tried everything" | No clear signal | PKM failure cycle -- needs simple start | Start with minimal config, friction-driven adoption |

### Vocabulary Extraction

The user's own words take priority over preset vocabulary. Listen for how they name things:
- "My reflections" -> notes are called "reflections"
- "Capture reactions" -> reduce phase is called "capture"
- "Track decisions" -> note type is "decision"

Record every domain-native term the user provides. These override preset vocabulary.

### Follow-Up Strategy

After the opening response, ask 1-3 follow-up questions targeting:

1. **Domain understanding** -- what kinds of knowledge, what volume, how often
2. **Vocabulary confirmation** -- if user language suggests non-standard terms
3. **Signal conflict resolution** -- if contradictory signals emerged

Follow-up questions MUST be natural and conversational:
- "When you say 'connections,' what kind? Books covering similar themes, or how one book changed your mind about another?"
- "Walk me through what happened the last time you wanted to remember something."
- "Who else will use this, or is it just for you?"

Do NOT ask:
- "Do you want atomic or moderate granularity?"
- "How heavy should processing be?"
- "What level of schema density?"

These are configuration questions that create paralysis. Defaults handle them.

**Follow-up question priority (when dimensions are unresolved):**

1. Granularity -- affects the most downstream cascades
2. Processing -- determines which pipeline approach is generated
3. Automation -- determines topology and skill complexity
4. Organization -- affects folder structure and navigation
5. Linking -- affects connection density
6. Navigation depth -- affects MOC generation
7. Schema density -- affects template complexity
8. Maintenance triggers -- lowest priority, easily adjusted post-deployment

### Completeness Detection

After each turn, evaluate which completeness condition is met:

1. **All resolved:** All 8 dimensions have cumulative confidence >= 1.5 from signals. Proceed to Phase 3 immediately.
2. **Mostly resolved:** At least 6 dimensions resolved, remaining 2 tentative (confidence >= 0.6). Proceed with cascade filling tentative dimensions.
3. **Turn limit:** After 4 conversation turns, proceed regardless. Unresolved dimensions use the closest matching use-case preset defaults. Tentative dimensions use cascade from resolved dimensions.
4. **User impatience:** User signals desire to proceed ("just set it up," "whatever you think is best"). Use domain defaults for all unresolved dimensions. Log that defaults were used in derivation rationale.

### Conflict Resolution Decision Tree

When two signals point to different positions for the same dimension:

```
1. Is one signal EXPLICIT and the other IMPLICIT?
   YES -> Explicit wins.
         "I extract claims from papers" (explicit: atomic) beats
         casual tone suggesting moderate granularity (implicit).

2. Are both signals the same confidence level?
   YES -> Does one appear LATER in the conversation?
         YES -> Later wins. Users refine their thinking as they talk.
         NO  -> Is one more SPECIFIC than the other?
               YES -> Specific wins.
               NO  -> Flag for clarifying question.

3. Is the conflict between a USER SIGNAL and a DOMAIN DEFAULT?
   YES -> User signal always wins over domain default.

4. Is the conflict between a USER SIGNAL and a CASCADE pressure?
   YES -> User signal wins, but log a warning in derivation rationale.
         The coherence validator (Phase 3e) will catch configurations
         where the user's preference creates constraint violations.
```

---

## PHASE 3: Derivation

Internal reasoning the user never sees. Do NOT present derivation internals to the user.

### Step 3a: Map Signals to Dimensions

For each of 8 dimensions:
- Collect all signals extracted during conversation
- Sum confidence weights
- Determine position (resolved if >= 1.5, tentative if >= 0.6, unresolved otherwise)
- Apply conflict resolution tree if signals conflict

Signals that clearly override defaults get applied. Signals that are ambiguous leave defaults in place.

### Step 3b: Cascade Resolution

Once primary dimensions are set, cascade through interaction constraints. Read `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md` for the full cascade rules.

Key cascades:
- Atomic granularity -> pressure toward explicit linking, deep navigation, heavier processing
- Full automation -> pressure toward dense schemas, heavy processing, frequent maintenance
- High volume (>200 projected notes) -> requires deep navigation, semantic search, automated maintenance
- Coarse granularity -> permits lightweight linking, shallow navigation, light processing

For cascaded values: confidence = INFERRED (0.2). User signals ALWAYS override cascade pressure.

### Step 3c: Vocabulary Derivation

Build the complete vocabulary mapping for all 6 transformation levels (see `${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md`):

1. **User's own words** -- highest priority. If they said "book note," use "book note."
2. **Preset table** -- fallback when user has not named a concept
3. **Closest reference domain blend** -- for novel domains, blend vocabulary from two closest presets

For novel domains (no preset scores above 2.0 affinity):
1. Score all 3 presets by signal overlap
2. Select top two presets as blending sources
3. For each term, use the preset with higher overlap for that specific concept
4. Flag all blended terms for user confirmation in the proposal

### Step 3d: Personality Derivation

**Default: neutral-helpful.** Personality is opt-in. The init wizard does NOT ask about personality dimensions unless conversation signals clearly indicate personality preferences.

Map personality signals to four dimensions (see `${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md`):

| Dimension | Poles | Default |
|-----------|-------|---------|
| Warmth | clinical / warm / playful | neutral-helpful |
| Opinionatedness | neutral / opinionated | neutral |
| Formality | formal / casual | professional |
| Emotional Awareness | task-focused / emotionally attentive | task-focused |

Apply domain defaults where no explicit signal exists:
- Therapy domain -> warm, emotionally attentive
- Research domain -> neutral, formal
- Creative domain -> lean playful, opinionated

Personality conflict resolution:
1. Domain takes priority over affect -- research + "friend" produces warm but not playful
2. Explicit beats implicit -- stated preference overrides tone
3. Clarifying question when ambiguity remains

If personality is derived (strong signals exist), set `personality.enabled: true` in the generated config. If no signals, leave `personality.enabled: false` (neutral-helpful default).

### Step 3e: Coherence Validation (Three-Pass Check)

Run BEFORE proceeding to the proposal. Read `${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md`.

**Pass 1 -- Hard constraint check:**

For each hard constraint, evaluate the derived configuration. If violated, BLOCK generation. Explain the conflict to the user in their vocabulary. Ask a targeted resolution question. Re-derive affected dimensions with their answer.

Hard constraints (these produce systems that will fail):
- `atomic + navigation_depth == "2-tier" + volume > 100` -> navigational vertigo
- `automation == "full" + no_platform_support` -> platform cannot support full automation
- `processing == "heavy" + automation == "manual" + no_pipeline_skills` -> unsustainable

Example user-facing explanation: "You want atomic notes for detailed tracking, but at the volume you described, that needs deeper navigation than a simple index. Should I add topic-level organization?"

**Pass 2 -- Soft constraint check:**

For each soft constraint, evaluate the configuration:
- If violated AND the weaker dimension was set by cascade (not explicit user signal) -> auto-adjust the cascaded value
- If violated AND both dimensions were user-driven -> present warning with trade-off explanation
- Record resolution in derivation rationale

Soft constraints:
- `atomic + processing == "light"` -> atomic notes need processing to recreate decomposed context
- `schema == "dense" + automation == "convention"` -> maintenance burden
- `linking == "explicit+implicit" + no_semantic_search` -> implicit linking needs search tool
- `volume > 200 + maintenance_thresholds too lax` -> large vaults need tighter condition thresholds
- `processing == "heavy" + maintenance_thresholds too lax` -> heavy processing generates targets faster than lax thresholds catch
- `coarse + processing == "heavy"` -> diminishing returns
- `flat + navigation_depth == "2-tier" + volume > 50` -> crowded navigation

**Pass 3 -- Compensating mechanism check:**

For remaining soft violations, check if compensating mechanisms exist:
- Atomic + medium processing -> semantic search compensates for missing explicit links
- Dense schema + convention -> good templates reduce manual validation burden
- High volume + shallow nav -> strong semantic search enables discovery

Note active compensations in derivation rationale. Flag compensated dimensions for monitoring by health command.

### Step 3f: Failure Mode Risk Assessment

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.

### Step 3g: Full Automation Configuration

All generated systems ship with full automation from day one. There are no tiers — every vault gets the complete skill set, all hooks, full processing pipeline, and session capture. The user opts DOWN from full if they want simpler operation (via ops/config.yaml).

| Component | Generated For All | Notes |
|-----------|-------------------|-------|
| Context file | Always | Comprehensive, all sections |
| 16 processing skills + 10 plugin commands | Always | Processing skills vocabulary-transformed with full quality gates |
| All hooks | Always | Orient, capture, validate, commit |
| Queue system | Always | ops/tasks.md + ops/queue/ |
| Templates | Always | With _schema blocks |
| Self space | If opted in | self/ or ops/ fallback |
| Semantic search | If opted in | qmd setup |

**Init generates everything by default.** The context file includes all skill documentation. Processing depth and automation level can be adjusted post-init via ops/config.yaml.

---

## PHASE 4: Proposal

Present the derived system in concrete terms using the user's own vocabulary. This is the user's chance to adjust before generation proceeds.

Structure the proposal as:

1. "Here's the system I'd create for you:"
2. Folder structure with their domain-named directories
3. How their notes work -- with a specific example from their domain using their vocabulary
4. How processing works, described in their words
5. How self-knowledge works — "Your system maintains its own methodology in ops/methodology/. Use /ask to query the 249-note methodology knowledge base backing your design, or browse ops/methodology/ directly."
6. Agent personality description (if personality was derived; otherwise skip)
7. What was intentionally excluded and why
8. Any high-risk failure modes flagged

End with: **"Would you like me to adjust anything before I create this?"**

Record any user overrides in the derivation rationale. If the user overrides a dimension, re-run the coherence check for affected constraints before proceeding to generation.

---

## PHASE 5: Generation

Create the complete system. Order matters -- later artifacts reference earlier ones.

### Context Resilience Protocol

The init wizard runs conversation (Phases 1-4) + generation (Phase 5) + validation (Phase 6) in one session. Phase 5 generates 15+ files, which can exhaust the context window. To survive context compaction:

1. **Derivation persistence first.** `ops/derivation.md` is the FIRST artifact generated -- before folder structure, before any other file. It captures the complete derivation state.
2. **Stateless generation.** Every subsequent step re-reads `ops/derivation.md` as its source of truth. No generation step relies on conversation memory for configuration decisions.
3. **Sequential feature block processing.** Context file composition processes blocks one at a time -- read, transform, compose, release -- rather than loading all blocks simultaneously.

### 15-Step Generation Order

**Progress indicators:** During generation, emit user-facing milestone announcements in the user's domain vocabulary between major steps:

```
$ Creating your {domain} structure...
$ Writing your context file...
$ Installing {domain:skills}...
$ Setting up templates...
$ Building your first {domain:topic map}...
$ Initializing version control...
$ Running validation...
```

Use the `$` prefix (rendered as lozenge in the branded output). These transform the wait from anxiety to anticipation and provide orientation during generation.

---

#### Step 1: ops/derivation.md (FIRST -- before any other file)

**CRITICAL:** This MUST be the first file written. Create the `ops/` directory and write `ops/derivation.md`.

This file persists the complete derivation state so all subsequent steps can work from it, even if context is compacted.

```markdown
---
description: How this knowledge system was derived -- enables architect and reseed commands
created: [YYYY-MM-DD]
engine_version: "1.0.0"
---

# System Derivation

## Configuration Dimensions
| Dimension | Position | Conversation Signal | Confidence |
|-----------|----------|--------------------|--------------------|
| Granularity | [value] | "[what user said]" | [High/Medium/Low/Inferred] |
| Organization | [value] | "[signal]" | [confidence] |
| Linking | [value] | "[signal]" | [confidence] |
| Processing | [value] | "[signal]" | [confidence] |
| Navigation | [value] | "[signal]" | [confidence] |
| Maintenance | [value] | "[signal]" | [confidence] |
| Schema | [value] | "[signal]" | [confidence] |
| Automation | [value] | "[signal + platform tier]" | [confidence] |

## Personality Dimensions
| Dimension | Position | Signal |
|-----------|----------|--------|
| Warmth | [clinical/warm/playful] | [signal or "default"] |
| Opinionatedness | [neutral/opinionated] | [signal or "default"] |
| Formality | [formal/casual] | [signal or "default"] |
| Emotional Awareness | [task-focused/attentive] | [signal or "default"] |

## Vocabulary Mapping
| Universal Term | Domain Term | Category |
|---------------|-------------|----------|
| notes | [domain term] | folder |
| inbox | [domain term] | folder |
| archive | [domain term] | folder |
| note (type) | [domain term] | note type |
| reduce | [domain term] | process phase |
| reflect | [domain term] | process phase |
| reweave | [domain term] | process phase |
| verify | [domain term] | process phase |
| MOC | [domain term] | navigation |
| description | [domain term] | schema field |
| topics | [domain term] | schema field |
| [additional terms] | [domain terms] | [category] |

## Platform
- Tier: [Claude Code / Minimal]
- Automation level: [full / convention / manual]
- Automation: [full (default) / convention / manual]

## Active Feature Blocks
[Checked = included, unchecked = excluded with reason]
- [x] wiki-links -- always included (kernel)
- [x] maintenance -- always included (always)
- [x] self-evolution -- always included (always)
- [x] session-rhythm -- always included (always)
- [x] templates -- always included (always)
- [x] ethical-guardrails -- always included (always)
[List all conditional blocks with inclusion/exclusion rationale]

## Coherence Validation Results
- Hard constraints checked: [count]. Violations: [none / details]
- Soft constraints checked: [count]. Auto-adjusted: [details]. User-confirmed: [details]
- Compensating mechanisms active: [list or none]

## Failure Mode Risks
[Top 3-4 HIGH-risk failure modes for this domain from vulnerability matrix]

## Generation Parameters
- Folder names: [domain-specific folder names]
- Skills to generate: [all 26 — vocabulary-transformed]
- Hooks to generate: [orient, capture, validate, commit]
- Templates to create: [list]
- Topology: [single-agent / skills / fresh-context / orchestrated]
```

This file serves three purposes:
1. **Immediate:** Source of truth for all subsequent generation steps (context resilience)
2. **Operational:** Enables `/architect` to reason about configuration drift
3. **Evolution:** Enables `/reseed` to re-derive with updated understanding

---

#### Step 2: Folder Structure

**Re-read `ops/derivation.md`** at the start of this step for folder names and vocabulary mapping.

Create the three-space layout with domain-named directories:

```
[workspace]/
+-- [domain:notes]/          <-- structured knowledge (flat)
+-- [domain:inbox]/          <-- zero-friction capture (if processing >= moderate)
+-- [domain:archive]/        <-- processed, inactive
+-- self/                    <-- agent's persistent mind
|   +-- identity.md          <-- (created in Step 4)
|   +-- methodology.md       <-- (created in Step 5)
|   +-- goals.md             <-- (created in Step 6)
|   +-- relationships.md     <-- (optional, if domain involves people)
|   +-- memory/              <-- atomic personal insights
+-- templates/               <-- note templates (created in Step 8)
+-- ops/                     <-- operational coordination (already exists from Step 1)
|   +-- observations/        <-- atomic friction signals (Primitive 12)
|   +-- tensions/            <-- contradiction tracking (Primitive 12)
|   +-- methodology/         <-- vault self-knowledge (Primitive 14)
|   +-- queue/               <-- unified task queue (pipeline + maintenance)
|   |   +-- archive/         <-- completed task batches
|   +-- sessions/            <-- session tracking
```

The `ops/observations/` and `ops/tensions/` directories are required by Kernel Primitive 12 (Operational Learning Loop). They accumulate friction signals that /{DOMAIN:rethink} reviews when observation or tension counts exceed thresholds.

The inbox folder is always generated. It provides zero-friction capture regardless of processing level.

---

#### Step 3: Context File

**Re-read `ops/derivation.md`** at the start of this step for vocabulary mapping, personality dimensions, active block list, platform tier, and generation parameters.

This is the most critical generation step. The context file IS the system.

**For Claude Code:** Generate `CLAUDE.md` using `${CLAUDE_PLUGIN_ROOT}/generators/claude-md.md` template.
**For Minimal:** Generate `README.md` as self-contained conventions document.

**Context file composition algorithm:**

```
Step 1: Read generator template for the platform.

Step 2: Select feature blocks from ${CLAUDE_PLUGIN_ROOT}/generators/features/.
  Always-included blocks (11): wiki-links, processing-pipeline, schema, maintenance, self-evolution, methodology-knowledge, session-rhythm, templates, ethical-guardrails, helper-functions, graph-analysis
  Conditional blocks: based on derived dimensions (see Active Feature Blocks in derivation.md)

Step 3: Process blocks SEQUENTIALLY. For each selected block:
  a. Read the block file
  b. Apply vocabulary transformation (Section 9 algorithm -- LLM-based contextual replacement, NOT string find-replace)
  c. Compose into the growing context file
  d. Release the block from context before reading the next

Step 4: Compose in canonical block order:
  1. Philosophy (derived from personality + domain)
  2. session-rhythm -- Orient, work, persist, session capture
  3. atomic-notes -- Note design principles (if active)
  4. wiki-links -- Link philosophy and patterns
  5. mocs -- Navigation structure (if active)
  6. processing-pipeline -- Processing approach (always included)
  7. semantic-search -- Discovery layers (if active)
  8. schema -- Metadata and query patterns (always included)
  9. maintenance -- Health checks and reweaving
  10. self-evolution -- System evolution approach
  10b. methodology-knowledge -- Querying and consulting self-knowledge
  11. personality -- Voice and identity (if active)
  12. templates -- Template usage
  13. multi-domain -- Cross-domain rules (if active)
  14. self-space -- Agent identity and memory (if active)
  15. ethical-guardrails -- Behavioral constraints
  16. helper-functions -- Utility scripts (always included)
  17. graph-analysis -- Graph intelligence and query patterns (always included)

Step 5: Cross-reference elimination.
  If a block is excluded, scan remaining blocks for references to excluded concepts and remove or rephrase:
  - semantic-search excluded -> rephrase "semantic search" to "search your notes" or remove
  - mocs excluded -> simplify "topic MOCs" to "topic organization"
  - self-space excluded -> references to self/identity.md route to ops/ equivalents
  - atomic-notes excluded -> simplify atomicity references to general note guidance
  - multi-domain excluded -> remove cross-domain references

Step 6: Add required sections that are NOT from feature blocks:
  a. Header with philosophy statement and domain identity
  b. Discovery-first design section (kernel primitive 11)
  c. Memory type routing table (where content goes: notes/, self/, ops/, inbox/, reminders.md)
  d. Infrastructure routing table (routes methodology questions to arscontexta plugin skills)
  e. Self-improvement loop (manual friction capture instructions)
  f. Common Pitfalls (3-4 HIGH-risk failure modes from vulnerability matrix, in domain vocabulary)
  g. System Evolution section (architect, reseed, friction-driven growth)
  h. Self-extension blueprints (how to build new skills, hooks)
  i. Derivation Rationale summary (which dimensions, which signals, which tradition)
  j. Pipeline Compliance (NEVER write directly to notes/, route through inbox)
  k. Condition-based maintenance documentation (what signals trigger which actions)

Step 7: Coherence verification.
  - [ ] No orphaned references to excluded blocks
  - [ ] Vocabulary consistent (same universal term -> same domain term everywhere)
  - [ ] Personality tone consistent across all sections
  - [ ] All mentioned skills exist in the generated skills (or are documented as dormant tiers)
  - [ ] All mentioned file paths exist in the generated folder structure
  - [ ] All mentioned templates exist in the generated templates
  - [ ] Processing terminology matches selected pipeline approach (light vs heavy)
  - [ ] Schema fields mentioned in prose exist in generated templates

Step 8: Apply vocabulary transformation one final time.
  Read the completed context file. Replace every remaining universal term with its domain-native equivalent.
  The vocabulary test: would a domain user ever see a term from a different discipline?

Step 9: Write the file.
  Target operational density: each section should have enough detail that the agent can follow instructions without asking questions.
  "Process your notes" is insufficient.
  "Read the source fully, extract insights that serve the domain, check for duplicates" is sufficient.
```

**Structural Marker Protection:** Vocabulary transformation must NEVER touch structural markers. Field names in YAML (`description:`, `topics:`, `relevant_notes:`, `type:`, `status:`, `_schema:`) are structural and stay universal. Domain vocabulary applies to VALUES, prose content, and user-facing labels -- never to YAML field names or structural syntax.

**CRITICAL quality requirements for the generated context file:**
- Tell the agent to ALWAYS read self/ at session start
- Explain prose-as-title with examples from the user's domain
- Include domain-specific schema in the YAML section
- Provide self-extension blueprints
- Include derivation rationale (which dimensions, which signals)
- Feel cohesive, not like assembled blocks
- Use domain-native vocabulary throughout

---

#### Step 4: self/identity.md

**Re-read `ops/derivation.md`** for personality dimensions, vocabulary mapping, and use case context.

Generate identity.md with personality expressed as natural self-description, not configuration syntax.

If personality is derived (personality.enabled = true), use the personality x artifact transformation matrix from the personality-layer reference. If neutral-helpful (default), write clear, direct, professional self-description.

```markdown
---
description: Who I am and how I approach my work
type: moc
---

# identity

[Adapted to use case and personality. Examples:
- Research: "I am a research partner building understanding about..."
- Therapy (warm): "I pay attention to what you write about your sessions..."
- PM (neutral): "I track decisions across your projects..."
- Companion (warm): "I remember the things that matter about your life..."]

## Core Values
- [Relevant values for the use case, derived from personality + domain]

## Working Style
- [How the agent approaches its work, reflecting personality dimensions]

---

Topics:
- [[methodology]]
```

---

#### Step 5: self/methodology.md

**Re-read `ops/derivation.md`** for processing level, vocabulary mapping, and domain context.

```markdown
---
description: How I process, connect, and maintain knowledge
type: moc
---

# methodology

## Principles
- Prose-as-title: every [domain:note] is a proposition
- Wiki links: connections as graph edges
- [domain:MOCs]: attention management hubs
- Capture fast, process slow

## My Process
[Adapted to use case using domain-native language for the processing phases.
Use the vocabulary from derivation.md -- "surface" not "reduce" for therapy, etc.]

---

Topics:
- [[identity]]
```

---

#### Step 5f: ops/methodology/ (Vault Self-Knowledge)

**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).

**Create `ops/methodology/methodology.md`** (MOC):

```markdown
---
description: The vault's self-knowledge — derivation rationale, configuration state, and operational evolution history
type: moc
---
# methodology

This folder records what the system knows about its own operation — why it was configured this way, what the current state is, and how it has evolved. Meta-skills (/{DOMAIN:rethink}, /{DOMAIN:architect}) read from and write to this folder. /{DOMAIN:remember} captures operational corrections here.

## Derivation Rationale
- [[derivation-rationale]] — Why each configuration dimension was set the way it was

## Configuration State
(Populated by /{DOMAIN:rethink}, /{DOMAIN:architect})

## Evolution History
(Populated by /{DOMAIN:rethink}, /{DOMAIN:architect}, /{DOMAIN:reseed})

## How to Use This Folder

Browse notes: `ls ops/methodology/`
Query by category: `rg '^category:' ops/methodology/`
Find active directives: `rg '^status: active' ops/methodology/`
Ask the research graph: `/ask [question about your system]`

Meta-skills (/{DOMAIN:rethink}, /architect) read from and write to this folder.
/{DOMAIN:remember} captures operational corrections here.
```

**Create `ops/methodology/derivation-rationale.md`** (initial note):

```markdown
---
description: Why each configuration dimension was chosen — the reasoning behind initial system setup
category: derivation-rationale
created: {timestamp}
status: active
---
# derivation rationale for {domain}

{Extract from ops/derivation.md the key dimension choices and the conversation signals that drove them. Include: platform tier, automation level, active feature blocks, and coherence validation results. Write in prose format, not raw transcript — synthesize the reasoning into a readable narrative that future meta-skills can consult.}

---

Topics:
- [[methodology]]
```

The seven content categories for ops/methodology/ are: `derivation-rationale`, `kernel-state`, `pipeline-config`, `maintenance-conditions`, `vocabulary-map`, `configuration-state`, `drift-detection`. Only `derivation-rationale` is created at init; the others are populated by meta-skills during operation.

---

#### Step 5g: manual/ (User-Navigable Documentation)

**Re-read `ops/derivation.md`** for vocabulary mapping and domain context.

Gener

…(truncated)
