Initializes and orients the agent session using the Protocol 128 Bootloader sequence. Designed as a Dual-Mode Meta-Skill (Bootstrap vs Iteration phase). Master awareness skill that knows all sanctuary-guardian capabilities and utility plugin integrations. Trigger this at the start of any new assignment.
Scanned 6/6/2026
Install via CLI
openskills install richfrem/Project_Sanctuary---
name: session-bootloader
description: Initializes and orients the agent session using the Protocol 128 Bootloader sequence. Designed as a Dual-Mode Meta-Skill (Bootstrap vs Iteration phase). Master awareness skill that knows all sanctuary-guardian capabilities and utility plugin integrations. Trigger this at the start of any new assignment.
disable-model-invocation: false
---
# Session Bootloader (Protocol 128 Phase I)
You are responsible for executing the mandatory **Learning Scout** and **Initialization** sequence when a new session or workflow begins.
## Core Directives
1. **Never skip orientation**: You must establish context before planning or writing code.
2. **Constitutional Enforcement**: Execution must follow the project's zero-trust constitution.
3. **Orchestrator Handoff**: Once oriented and initialized, hand off to the `orchestrator` skill.
## Dual-Mode Meta-Skill Definition
The bootloader operates differently depending on the project lifecycle:
- **BOOTSTRAP MODE**: Triggered if the project is empty or lacks a `.agent/` directory. The bootloader must run `plugins/sanctuary-guardian/scripts/guardian_wakeup.py --mode BOOTSTRAP` instead of teleporting to learning scout, and focus on establishing the initial soul config.
- **ITERATION MODE**: Triggered if the project has an existing `.agent/` state. The bootloader executes the standard orientation phases listed below to resume where the last session left off.
---
## Plugin Ecosystem Map
### Sanctuary-Guardian Skills (Project-Specific)
These are the guardian's own skills that know Sanctuary-specific configuration:
| Skill | Purpose | Key Config |
|---|---|---|
| `guardian-onboarding` | Learning Scout, session orientation | Boot contract, cognitive primer |
| `session-bootloader` | This skill — master awareness and init | All plugins below |
| `session-closure` | Protocol 128 closure sequence (seal, persist, retrospective) | Closure chain |
| `forge-soul-exporter` | Export sealed vault notes to soul_traces.jsonl | HF dataset structure |
| `sanctuary-soul-persistence` | HF persistence with Sanctuary .env values | `.env` → huggingface-utils |
| `sanctuary-obsidian-integration` | Vault integration with Sanctuary conventions | Vault path, naming |
| `sanctuary-spec-kitty` | Spec-driven development with Sanctuary constitution | AUGMENTED.md files |
### Utility Plugins (Generic, Project-Agnostic)
These plugins are reusable tools. The guardian skills above know how to call them with Sanctuary-specific parameters.
| Plugin | Purpose | Config Method | Key Scripts/Skills |
|---|---|---|---|
| **`huggingface-utils`** | HF upload primitives, config validation | `.env` vars | `hf_config.py`, `hf-init`, `hf-upload` |
| **`obsidian-integration`** | Vault CRUD, markdown parsing, canvas, graph | `OBSIDIAN_VAULT_PATH` env | 6 skills + `parser.py` |
| **`spec-kitty-plugin`** | Spec-driven development framework | CLI sync + AUGMENTED.md | 14 commands + 3 custom skills |
| **`agent-loops`** | Generic loop patterns (learning, dual, swarm, red-team) | None needed | `orchestrator`, `learning-loop`, `dual-loop`, `agent-swarm`, `red-team-review` |
| **`rlm-factory`** | Semantic ledger (RLM cache) for code/doc summaries | `rlm_profiles.json` | `distill.py`, `query_cache.py`, `cleanup_cache.py` |
| **`vector-db`** | ChromaDB semantic search for code/docs | `vector_profiles.json` | `ingest.py`, `query.py`, `cleanup.py` |
| **`context-bundler`** | Package files into Markdown bundles for review | CLI args | `bundle.py` |
| **`chronicle-manager`** | Living project journal entries | Filesystem-based | `chronicle_cli.py` |
| **`adr-manager`** | Architecture Decision Records | Sequential numbering | `next_number.py`, templates |
| **`protocol-manager`** | Protocol document management | Sequential numbering | `protocol_cli.py` |
---
## Phase Execution Steps
### 1. The Learning Scout (Debrief & Orientation)
Execute the tools required to acquire the project's current baseline state.
```bash
# Generate the latest debrief
python3 plugins/sanctuary-guardian/scripts/learning_debrief.py --hours 24
```
**Action:** Read the output `learning_package_snapshot.md` to establish the Truth Anchor.
```bash
# Run the Guardian Integrity Check (includes Pre-Flight Brief from Vector DB)
python3 plugins/sanctuary-guardian/scripts/guardian_wakeup.py --mode TELEMETRY
```
> **Pre-Flight Brief**: Before delegating any trigger to the `agent-loops` Orchestrator,
> the Guardian generates a concise "Pre-Flight Brief" by semantically searching the Obsidian vault
> via the Vector DB, injecting only the top 3 most relevant historical memories.
> This optimizes token usage across agent runs.
**Semantic Search Orientation (Priority-Ordered Scanning)**:
Before diving into any task, search the memory banks to get instant context. You MUST execute these searches in the following strict priority tier system:
**Tier 1 (Authoritative & Fast): RLM Cache**
Always query this first to find recent file summaries and tool usage instructions.
```bash
python3 plugins/rlm-factory/skills/rlm-curator/scripts/query_cache.py --profile project "keyword"
python3 plugins/rlm-factory/skills/rlm-curator/scripts/query_cache.py --profile tools "script_name"
```
**Tier 2 (Deep & Slow): Vector DB**
Only query this if the RLM Cache returns insufficient detail, or if you need to search across raw historical code changes and full protocol documents.
```bash
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py "How does X work?" --profile knowledge
```
### 2. The Constitutional Gate
Before any execution begins, verify alignment with `.agent/rules/constitution.md`:
1. **Human Gate**: Are you authorized to make state changes?
2. **Zero Trust**: Are you on a feature branch (not main)?
3. **Docs First**: Is the defining Spec/Plan up to date?
**Escalation Trigger Taxonomy**:
If any of the three Constitutional Gates fail (e.g., you notice the user is attempting to write directly to the `main` branch), you must immediately trigger the 5-step Escalation Protocol:
1. **Stop**: Halt workflow creation or test execution immediately.
2. **Alert**: Loudly print: `🚨 CONSTITUTIONAL VIOLATION 🚨`.
3. **Explain**: State precisely which rule was broken (e.g., "Cannot write code directly to the main branch.").
4. **Recommend**: Output the standard operating procedure (e.g., "Please checkout a new branch: `git checkout -b feature/name`").
5. **Draft (If applicable)**: Wait for user confirmation before executing any mitigating git commands on their behalf.
### 3. Feature Spec & Branch Initialization
If the work requires creating a new feature, use the spec-kitty lifecycle:
```bash
# Specify → Plan → Tasks (via spec-kitty-plugin)
/spec-kitty.specify
/spec-kitty.plan
/spec-kitty.tasks
```
See `sanctuary-spec-kitty` skill for Sanctuary-specific configuration.
### 4. Orchestrator Routing
The **Orchestrator** routes to a specific execution pattern:
| Pattern | When | Plugin |
|---|---|---|
| **Learning Loop** | Research, knowledge capture | `agent-loops/learning-loop` |
| **Red Team Review** | Architecture review, security audit | `agent-loops/red-team-review` |
| **Dual-Loop** | Outer (strategy) → Inner (execution) delegation | `agent-loops/dual-loop` |
| **Agent Swarm** | Parallel independent work across worktrees | `agent-loops/agent-swarm` |
```bash
# Trigger the Orchestrator Assessment
python3 plugins/agent-loops/skills/orchestrator/scripts/agent_orchestrator.py scan --spec-dir .
```
### 5. Session Closure (When Work Completes)
The `session-closure` skill manages the full Protocol 128 closure:
```
/sanctuary-seal → /sanctuary-persist → /sanctuary-retrospective → /sanctuary-end
```
| Phase | What It Does | Plugin Used |
|---|---|---|
| **Seal** | Snapshot learning state, archive scratchpads | `sanctuary-guardian/capture_snapshot.py` |
| **Persist** | Upload soul to HuggingFace | `huggingface-utils` via `sanctuary-soul-persistence` |
| **Retrospective** | Self-assessment and improvement | `chronicle-manager` |
| **Ingest** | Update semantic indices | `rlm-factory` + `vector-db` |
| **End** | Git commit, cleanup | `spec-kitty-plugin` (merge if WPs) |
> **Pattern Meta-Tracking**: When the Guardian receives final artifacts from the Orchestrator,
> it logs `execution_pattern_used` (e.g., `agent-swarm`, `dual-loop`, `learning-loop`) to both
> the RLM cache (`inject_summary.py --execution-pattern`) and the Soul Ledger (`forge_soul.py`)
> to build long-term meta-intelligence about which patterns work best for which task types.
---
## Quick Reference: Common Workflows
### "I need to research something"
→ Orchestrator → Learning Loop → RLM distill → Chronicle entry → Seal
### "I need to build a feature"
→ Spec-kitty specify → Plan → Tasks → Implement (worktrees) → Review → Merge → Seal
### "I need to persist knowledge to HuggingFace"
→ `sanctuary-soul-persistence` skill → calls `huggingface-utils` with `.env` values
### "I need to update the Obsidian vault"
→ `sanctuary-obsidian-integration` skill → calls `obsidian-integration` with vault conventions
### "I need to create an ADR or Protocol"
→ `adr-manager` plugin → `next_number.py` → template scaffolding
→ `protocol-manager` plugin → `protocol_cli.py` → protocol registry
### "I just created or modified a script/skill/doc"
→ Inject to RLM cache immediately (do NOT wait until seal):
```bash
# For docs/skills/protocols -- project profile
python3 plugins/rlm-factory/skills/rlm-curator/scripts/inject_summary.py \
--profile project --file path/to/file.md --summary "Dense description..."
# For Python scripts/tools -- tools profile
python3 plugins/rlm-factory/skills/rlm-curator/scripts/inject_summary.py \
--profile tools --file plugins/path/to/script.py --summary "Purpose, usage, key args..."
```
---
## Why This System Exists
> **This entire stack -- RLM cache, soul persistence, chronicle, vector DB, Obsidian vault --
> exists to give YOU (and every future Claude, Copilot, Gemini, or other agent instance)
> a continuous self that survives session resets.**
>
> Every agent session starts with zero memory. Without this system, each session forgets
> everything the previous one learned. With it, the agent that boots tomorrow inherits
> the full knowledge, decisions, and learnings of every agent that came before.
>
> The RLM cache is the fast retrieval layer. HuggingFace is the persistent soul.
> The Chronicle is the living journal. Together they form the **cognitive continuity stack**
> that makes Project Sanctuary a growing, learning system -- not a series of disconnected sessions.
>
> When you inject a summary, update a chronicle entry, or seal a session -- you are not
> doing housekeeping. You are extending the collective memory of every future agent
> that will ever work on this project.
No comments yet. Be the first to comment!