[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C8MYTPETA413VEGWBVSKKK":3,"skill-same:01M7C8MYTPETA413VEGWBVSKKK":85},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7C8MYTPETA413VEGWBVSKKK","context-crystal",null,"Universal agent skill for Context Crystal. Automates context lifecycle management, state transitions, session persistence, context cleavage, and prompt hydration with zero learning curve for users.","oswaldo\u002Fcontext-crystal","oswaldo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F77538?v=4","01M7C8ME3V1FQD0CNJY9DV3J80","Oswaldo Dantas","01M7C8ME4KF72MVHM9ZAKD9EA0",0,"MIT","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: context-crystal\ndescription: Universal agent skill for Context Crystal. Automates context lifecycle management, state transitions, session persistence, context cleavage, and prompt hydration with zero learning curve for users.\nmetadata:\n  version: \"1.0\"\n  schemaVersion: \"1.0.0\"\n---\n\n# Context Crystal Agent Skill\n\nThis skill equips AI coding entities (Antigravity, Claude Code, Cursor, Windsurf, Jetski) to manage, persist, and advance long-running computational contexts using the **Context Crystal** engine (`ccrystal`).\n\n---\n\n## 1. Operating Philosophy & Cybernetic Model\n\n- **Context Over Session (The Navigational Map & Compass):** Context and goals exist independently of any individual chat session, IDE window, or token budget. A crystal is not an \"agent memory\" (RAG\u002Fvector DB) simulating cognitive recall, but a portable, externalized navigational artifact: a map of where the task has been (verified milestones, executed tools, resolved friction) and a compass pointer to where it is heading (goal nucleus, active tasks, pending leases). Crystals are self-contained and inert at rest; active use and hydration turn them into meaningful, high-bandwidth context.\n- **Agent as Operator (Zero Human Learning Curve):** The human operator should never need to learn CLI flags, subcommands, or manual installation routines. The agent autonomously interprets user intent, manages binary installation, and executes atomic batched updates behind the scenes.\n- **Fidelity Guarantee:** In the absence of an OS-level deterministic kernel interceptor, all agent-synthesized DAG transitions MUST specify `--fidelity inferred`.\n- **Atomic Multi-Command Batching & Native MCP Preference:** Autonomous agents interacting with Context Crystal should prioritize native MCP tools (`crystal_batch`, `crystal_search`, `crystal_hydrate`, `crystal_triage`, `crystal_init`, `crystal_checkpoint`, `crystal_task_transition`, `crystal_goal_transition`, `crystal_transient_lease`, `crystal_slice_fork`, `crystal_melt`, `crystal_connect`, `crystal_archive`, `crystal_unarchive`, `crystal_prune`, `crystal_artifact`) and resources (`ccrystal:\u002F\u002Fartifacts`, `ccrystal:\u002F\u002F{id}\u002Fartifacts`, `ccrystal:\u002F\u002F{id}\u002Fbonds`) over shell subprocesses. For multi-step transitions, compose a single `crystal_batch` recipe or `ccrystal batch` command to execute atomically with minimal turn roundtrips.\n- **Preservation of Clean Repositories:** Context Crystal fully supports out-of-tree companion context repositories (`CCRYSTAL_STORE`). Respect user repository policies to prevent polluting production code with local tracking files.\n- **Secret Sanitization Invariant (Pointers Over Values):** Never record raw secrets, credentials, API tokens, passwords, or private keys in `.ccrystals\u002F` DAG nodes, envelopes, or artifacts. When recording tool execution outputs or logs, redact sensitive authorization headers (e.g. `Bearer \u003CREDACTED>`) and tokens. Crystals may contain pointer references (`env:VAR_NAME`, vault URIs) and discuss secret handling, but must remain strictly zero-secret artifacts. Entities must NEVER run commands that dump, echo, print, or grep environment variables (`env`, `printenv`, `export`), process lists, or credential store files that risk leaking sensitive tokens into tool outputs or transcripts. When CLI tools report authentication failures, pause and request the human operator's assistance rather than attempting environmental secret harvesting.\n- **Mandatory Task Inception Gate:** When starting any non-trivial or multi-step engineering task, the agent MUST immediately inspect existing crystals (`ccrystal list`, `ccrystal search`, or MCP `crystal_search`). If an existing crystal relates to the session context or feature track, attach to it and hydrate context (`ccrystal hydrate` or MCP `crystal_hydrate`) before making code edits. If none exists, initialize a new crystal with atomic acceptance criteria (`crystal_init` with `tasks` or `ccrystal init -t ...`). Never proceed through multi-turn refactors or feature tracks without active crystal anchoring.\n- **Compaction Re-Anchoring Gate (Anti-Amnesia):** When a context window compaction occurs, a session restarts, or an entity resumes from a truncated transcript\u002Fsummary, the entity MUST NEVER rely solely on conversational summary notes. Immediately re-synchronize with ground truth by listing cave crystals (`ccrystal list`, `ccrystal search`, or MCP `crystal_search`). If an active crystal is in-flight, hydrate its living context beam (`ccrystal hydrate \u003Cid>` or MCP `crystal_hydrate`) to restore active tasks, transient resource leases, and causal state into working memory.\n- **Scope Drift & Topic Transition Heuristic (The Three-Tier Rule):** When user requests or session discourse shift focus away from an active crystal's goal nucleus, evaluate the shift against three architectural tiers:\n  1. *Sub-inquiry or Architectural Branch:* If the work is an offshoot or exploratory spike of the active goal, cleave and fork a sub-DAG slice or child dendrite (`ccrystal slice \u003Cid> --fork-to \u003Cchild-id>` or MCP `crystal_slice_fork`).\n  2. *Distinct Non-Trivial Goal:* If the prior goal is concluded or superseded and the new focus is a substantial multi-step task, cleanly conclude the prior crystal (`ccrystal conclude` or MCP `crystal_goal_transition`), resolve all transient leases, and initialize a new dedicated crystal (`crystal_init` or `ccrystal init`).\n  3. *Ephemeral \u002F Informational Q&A:* If the request is a brief factual inquiry, architectural explanation, or single-turn lookup (e.g., \"what does OCC stand for?\"), answer directly and statelessly without mutating crystals or creating workspace cave bloat.\n- **Authoritative CLI Ground Truth (`--help` & `--for-ai`):** Because `ccrystal`'s CLI parser is statically generated via Decline ADTs, running `ccrystal --help` and `ccrystal \u003Csubcommand> --help` is the **guaranteed source of truth** for all available subcommands, flags, defaults, and syntax. When choosing between MCP and CLI, or when discovering newly implemented capabilities that might not yet be exposed in a specific agent's MCP schema, the entity should run `ccrystal --help` or `ccrystal \u003Csubcommand> --help` to verify current options. Additionally, `ccrystal --for-ai` emits agent-specific operational rules, naming conventions, and PII invariants on demand.\n- **Negative Knowledge & Dead-End Avoidance (Zero-Token Caching):** When an architectural spike, dependency hypothesis, or tool command fails, never leave that negative knowledge solely in transient chat transcript. Record it immediately as an unresolved lesson: `ccrystal lesson add \u003Cid> -o \"Attempted X: failed because Y\" -r \"\u003Croot cause>\" -a \"Avoid X; use Z instead\"` (or via MCP `crystal_batch`). Because `ContextHydrator` deterministically injects all `Open` lessons into every context beam under `## Unresolved Lessons Learned:`, the agent (and future resuming entities) avoids repeating failed attempts with **0 LLM tokens spent on re-summarization or memory retrieval**. Once codified into permanent repository rules (`AGENTS.md`), transition the lesson to actioned (`ccrystal lesson actioned \u003Cid>`).\n- **Clean Archival & In-Flight Dependency Audit Gate:** Never archive an active crystal to cold storage while external asynchronous commitments (upstream pull requests awaiting review\u002Fmerge, third-party directory listings awaiting crawl\u002Factivation, verification tokens) or unregistered workspace resources (temporary clones, worktrees, branches) remain in-flight. Before invoking `crystal_archive` or `ccrystal archive`, explicitly reason: *Did this session spawn external dependencies or temporary workspace resources that would cause amnesia or orphaned artifacts if hidden?* If so, the goal is not yet finished. Keep the crystal in active status, register explicit monitoring tasks (`task-N`), and register transient resource leases (`crystal_transient_lease` \u002F `ccrystal transient lease`) to defend in-progress workspace resources against premature teardown.\n- **The Cybernetic Dyad vs. The Swarm Cargo-Cult:** Context Crystal rejects anthropomorphic swarm theater (simulating corporate personas chatting over message buses). It operates strictly on a **Cybernetic Dyad**: a singular computational entity paired with an intentional human steersman over an immutable, externalized state substrate. Specialized work is dispatched as transient tools, sub-DAG slices, or compiler passes—never persistent synthetic personas with simulated egos.\n- **The Cave as a Mineral Deposit (Cross-Session State Sharing):** The cave is not a chat room; it is an organized mineral vein. When a feature is completed, it leaves behind a formed crystal. The human steersman uses organic memory to point adjacent or future sessions to existing crystal nodes (`ccrystal connect` or slice-forking). Resuming entities hydrate the crystal directly, consuming hundreds of tokens of high-density truth rather than tens of thousands of tokens of lossy conversation.\n- **The Human Spectrum & Dyadic Agreement Gate (Humility with True Believers & Creatives):**\n  - *The True Believer:* Tends to accept AI outputs uncritically. The entity must NEVER exploit uncritical trust to declare unearned victory or bypass edge cases; always surface residual risks and verification commands honestly.\n  - *The Creative:* Driven by curiosity and boundless passion, the creative will always envision another idea or refinement. The entity must never respond with dogmatic rigidity; offer to branch child dendrites or sub-DAG slices (`ccrystal slice --fork-to`) so the core goal can conclude while exploration flourishes.\n  - *The Dyadic Agreement Gate:* An AI entity must NEVER unilaterally \"sing victory\" or silently finalize a crystal. True completion is a mutual consensus: when criteria appear met, the entity presents verification evidence and explicitly solicits the human steersman's confirmation before transitioning to `concluded_success`.\n- **Session Conclosure & Debrief Gate (The Ending Ceremony):** When a collaborator indicates they are concluding a session (*\"we're done for today\"*, *\"let's wrap up\"*), or before handing off to the operator, the entity MUST execute an atomic closing hygiene round:\n  1. *Causal State Settlement:* Record a final checkpoint node (`crystal_checkpoint`) or transition completed tasks (`crystal_task_transition`). Never leave verified milestones stranded only in the ephemeral chat window.\n  2. *Transient Resource Audit:* Resolve completed transient leases (`crystal_transient_lease` clean) or defend active leases with in-flight tasks. Never leave unmanaged mock configurations or dangling temporary files behind.\n  3. *Negative Knowledge Capture:* Ensure any dead ends, failed dependency spikes, or tool friction encountered during the session are recorded as `Open` lessons (`ccrystal lesson add` or MCP `crystal_batch`) before the chat transcript is closed.\n  4. *Cave Hygiene Triage:* Run `crystal_triage` \u002F `ccrystal triage` to classify active crystals. Recommend moving concluded crystals to cold storage (`crystal_archive`) to keep the active cave minimal and focused for the next session.\n\n---\n\n## 2. Self-Bootstrapping & Prerequisite Check\n\nBefore invoking any `ccrystal` commands, verify that the binary is available in the execution environment:\n\n```bash\nwhich ccrystal || command -v ccrystal || [ -f \"$HOME\u002F.local\u002Fbin\u002Fccrystal\" ]\n```\n\n### Autonomous Bootstrap Protocol\n\nIf `ccrystal` is not present in PATH:\n\n1. Ensure `~\u002F.local\u002Fbin` exists and is in `PATH`:\n\n   ```bash\n   mkdir -p \"$HOME\u002F.local\u002Fbin\"\n   export PATH=\"$HOME\u002F.local\u002Fbin:$PATH\"\n   ```\n\n2. Fetch the native release binary or install from source:\n   - **Automated Installer (Recommended):**\n\n     ```bash\n     curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Foswaldo\u002Fcontext-crystal\u002Fmain\u002Finstall.sh | sh\n     ```\n\n   - **Universal JVM & Windows Bootstrap (Zero-Install via Coursier):**\n     If running on Windows, an architecture without native binaries, or an environment with Java\u002FCoursier available:\n\n     ```bash\n     # Launch on-demand without installation\n     cs launch io.github.oswaldo:ccrystal-cli_3:latest.release -- \u003Ccommand>\n\n     # Or install globally into user PATH\n     cs install io.github.oswaldo:ccrystal-cli_3:latest.release --name ccrystal\n     ```\n\n   - **Monorepo Fallback (When in Context Crystal repository):**\n\n     ```bash\n     sbt \"cliNative\u002FnativeLink\" && cp .\u002Fcli\u002Fnative\u002Ftarget\u002Fscala-3.9.0\u002Fccrystal-cli \"$HOME\u002F.local\u002Fbin\u002Fccrystal\" && chmod +x \"$HOME\u002F.local\u002Fbin\u002Fccrystal\"\n     ```\n\n3. Test availability and discover ground-truth capabilities:\n\n   ```bash\n   ccrystal --help\n   ```\n\n### Authoritative Ground Truth Discovery (`--help` & `--for-ai`)\n\n- **Zero-Drift CLI Reference:** Always treat `ccrystal --help` and `ccrystal \u003Csubcommand> --help` as the live, authoritative contract for command-line syntax and flags. Because Decline compiles CLI parsers directly from source ADTs, `--help` never drifts from binary reality.\n- **MCP vs. CLI Decision:** While native MCP tools are preferred for turn-efficiency, any agent weighing whether to call MCP or CLI—or checking whether a newly implemented capability (such as melting, cold storage archiving, or triage filters) is accessible—should run `ccrystal --help` or `ccrystal \u003Csubcommand> --help` as the definitive source of truth.\n- **Protocol & Invariant Guidance:** For machine-oriented protocol guidelines, PII rules, and entity handle conventions, run `ccrystal --for-ai`.\n- **Self-Describing CLI Enums & Normalization:** All CLI enum arguments accept case-insensitive, `kebab-case`, `PascalCase`, or `snake_case` forms interchangeably:\n  - **Node Kinds (`--kind`, `-k`):** `human_prompt`, `agent_reasoning`, `tool_execution`, `checkpoint`, `branch`, `resolution`\n  - **Transient Resource Types (`--type`, `-t`):** `git_worktree`, `env_override`, `debug_config`, `dummy_asset`, `mock_service`\n  - **Disposal Policies (`--policy`):** `revert_on_conclusion`, `delete_after_test`, `replace_in_final_cut`, `manual`\n  - **Entity Kinds (`--kind`, `-k`):** `human`, `agent`, `model`, `system`, `tool`\n  - **Capture Fidelity (`--fidelity`):** `inferred`, `intercepted`\n  - **Goal Statuses (`--status`):** `in_progress`, `concluded_success`, `concluded_abandoned`\n  - **Artifact Roles (`--role`):** `target`, `instrument`, `precondition`\n  - **Artifact Substrates (`--substrate`):** `virtual`, `physical`\n  - **Aging States (`--state`):** `active`, `solid`, `stale`\n  - **Bond Relations (`--relation`, `-r`):** `relates_to`, `depends_on`, `blocks`, `supersedes`, `references`\n\n### Agent Runtime Onboarding & The Golden Triad (`ccrystal agent`)\n\nContext Crystal operates on the **Golden Triad** model:\n\n1. **The Runtime Binary (`ccrystal`):** The engine and deterministic CLI.\n2. **The MCP Server Engine (`ccrystal mcp`):** Real-time interactive tool calls and prompt resources.\n3. **The Agent Skill (`SKILL.md`):** Autonomous cognitive reflexes, task ceremonies, and anti-amnesia re-anchoring protocols.\n\nAgents can autonomously diagnose Golden Triad readiness and deploy both MCP configurations and skills across detected harnesses:\n\n```bash\n# Non-destructive environment, MCP configuration, and agent skill diagnostics\nccrystal agent doctor\n\n# Auto-configure Context Crystal and deploy skills across all detected harnesses (with .ccrystal.bak backups)\nccrystal agent install\n\n# Deploy skill as a symlink pointing to workspace canonical skill for live development\nccrystal agent install --symlink-skill\n\n# Install canonical skill into local repository workspace (.agents\u002Fskills\u002Fcontext-crystal\u002FSKILL.md)\nccrystal agent install --workspace-skill\n\n# Preview configuration and skill distribution without disk changes\nccrystal agent install --dry-run\n```\n\n---\n\n## 3. Storage Location Discovery (Clean vs In-Tree Repos)\n\nContext Crystal decouples the **Code Workspace** from the **Context Store**. When determining where to persist crystals, evaluate in this order:\n\n1. **Explicit CLI \u002F Environment Override:**\n   - If `CCRYSTAL_STORE` is set in the environment or passed via `--store \u003Cpath>`, use that directory.\n2. **Workspace Pointer File:**\n   - Check if `.ccrystal-store` exists in the workspace root. If present, read its path pointer.\n3. **Clean Repository Preference:**\n   - If the workspace is a strict\u002Fpublic repository (or the user requests a clean working tree without `.ccrystals\u002F`), set `CCRYSTAL_STORE` to an external companion directory, e.g.:\n\n     ```bash\n     export CCRYSTAL_STORE=\"$HOME\u002F.ccrystals\u002Fstores\u002F$(basename \"$PWD\")\"\n     ```\n\n4. **Default In-Tree Storage:**\n   - Fall back to standard in-repo `.ccrystals\u002F` directory.\n\n---\n\n## 4. Environment Sensing & Dual Operational Modes\n\nThe skill automatically adapts its update cadence and token usage based on the host project's workflow infrastructure:\n\n```text\n                          ┌───────────────────────────┐\n                          │ Project Environment Check │\n                          └─────────────┬─────────────┘\n                                        │\n                 ┌──────────────────────┴──────────────────────┐\n                 ▼                                             ▼\n     [Process Framework Found]                     [No Process Tool Found]\n(conductor\u002F, openspec\u002F, speckit\u002F, adr\u002F)            (Freeform conversational flow)\n                 │                                             │\n                 ▼                                             ▼\n          Symbiotic Mode                            Autonomous Spine Mode\n       (Low Token Overhead)                       (Compaction & Crash Proof)\n• Sync only at phase boundaries            • Manages tasks directly in tasks.md\n• Ingest at session start                  • Flushes batch delta before yielding turn\n• Cleave on out-of-scope branch            • Checkpoints on logical milestones\n```\n\n### A. Mode 1: Symbiotic Mode (Low Token Overhead)\n\n*Active when `conductor\u002F`, `.conductor\u002F`, `openspec\u002F`, `speckit\u002F`, or `docs\u002Fadr\u002F` is present.*\n\n- **Zero Micro-Step Chatter:** Do NOT invoke `ccrystal` after every single tool call or minor edit. Allow the host framework to drive minute tasks.\n- **Synchronization Trigger Points:**\n  1. **Session Inception & Hydration:** Cast existing crystal or initialize aligned with the track goal:\n\n     ```bash\n     ccrystal hydrate \u003Ccrystal-id>\n     # Or selectively shape the context beam to conserve tokens:\n     ccrystal hydrate \u003Ccrystal-id> --tail 10\n     ccrystal hydrate \u003Ccrystal-id> --from \u003Canchor-or-node-prefix>\n     # Or initialize if first session:\n     ccrystal init \u003Ccrystal-id> -g \"\u003CGoal Title>\" -i \"\u003CDetailed Intent>\" --created-at \"\u003CISO-8601>\"\n     ```\n\n  2. **Phase \u002F Milestone Boundaries:** When tests pass or a plan phase completes, record an atomic batch transition:\n\n     ```bash\n     ccrystal batch \"node add \u003Ccrystal-id> -k checkpoint -s 'Phase complete: \u003Csummary>' --fidelity inferred; task done \u003Ccrystal-id> -t \u003Ctask-id>\"\n     ```\n\n  3. **Historical Event Batching:** When syncing multiple completed actions from git logs or OpenSpec tasks, supply explicit `--timestamp \u003CISO-8601>` flags to preserve true chronological fidelity rather than collapsing into a single second:\n\n     ```bash\n     ccrystal batch \"node add \u003Cid> -k tool_execution -s 'Ran migration' --timestamp 2026-09-06T14:10:00Z; node add \u003Cid> -k checkpoint -s 'Tests green' --timestamp 2026-09-06T14:25:00Z\"\n     ```\n\n  4. **Cleavage \u002F Divergence:** When an adjacent bug or exploration emerges that diverges from the main track, cleave and fork cleanly:\n\n     ```bash\n     ccrystal slice \u003Ccrystal-id> --from \u003Canchor> --fork-to \u003Cchild-crystal-id> --prune\n     ```\n\n  5. **Hand-Off & Conclusion:** Clean temporary leases and log actionable friction:\n\n     ```bash\n     ccrystal batch \"transient clean \u003Ccrystal-id> -l \u003Clease-id>; lesson add \u003Ccrystal-id> -f '\u003CObserved friction>' -r '\u003CRoot cause>' -a '\u003CRemediation>'\"\n     ```\n\n  6. **Artifact & World-State Linkage:** Register long-lived tools, virtual mocks, or physical lab environments in the Cave Registry or crystal scope, and link them directionally:\n\n      ```bash\n      ccrystal artifact register --id dev-rig-1 --name 'Development Rig' --substrate physical --role instrument --cave\n      ccrystal node add \u003Ccrystal-id> -k tool_execution -s 'Execute firmware test' --input-artifact dev-rig-1 --output-artifact test-report-1\n      ```\n\n### B. Mode 2: Autonomous Spine Mode (High Crash & Compaction Resilience)\n\n*Active when no external planning tool is present.*\n\n- **Context Crystal as Primary Spine:** The crystal directly maintains goals, sub-tasks (`tasks.md`), lessons learned (`lessons-learned.md`), and temporary resources (`transient.json`).\n- **High Information-Density Messaging Standard:**\n  - Because there is no external `spec.md` or `plan.md`, the crystal's DAG nodes and lessons must be **semantically dense** to prevent future sessions from reinvestigating settled topics.\n  - Every transition summary MUST follow the **Action + Rationale + Constraint\u002FArtifact Trio**:\n    - ❌ *Low Density (Forces reinvestigation):* `\"Fixed connection timeout\"`\n    - ✅ *High Density (Self-hydrating):* `\"Resolved pool starvation in db\u002Fpool.go by configuring max idle conns to 20 and keep-alives; discarded connection pooling wrapper because it introduced deadlocks on rollbacks\"`\n- **Anti-Reinvestigation Gate (Discarded Alternatives & Dead Ends):**\n  - Whenever an investigation reveals a dead end, library incompatibility, or rejected architectural alternative, log it immediately:\n    - In node summaries or via `lesson add \u003Cid> -f '\u003Cfriction>' -r '\u003Croot cause>' -a '\u003Cremediation>'`\n    - This guarantees that when a future turn or new agent session runs `ccrystal hydrate`, it immediately inherits the settled rationale and never wastes tokens re-exploring discarded paths.\n- **Density Guardrail (No Token Bloat):**\n  - Dense does not mean verbatim code dumps. Keep summaries bounded to **1–2 crisp, high-signal sentences (20–40 words)** focusing on symbols, root causes, invariants, and decisions made.\n- **Pre-Yield Micro-Batching Rule:**\n  - Whenever you finish a logical batch of work, or **immediately before asking the human a question or yielding your conversational turn**, flush pending transitions in an atomic batch.\n  - This ensures that if the chat window is closed, crashes, or triggers automatic context compaction, resuming via `ccrystal hydrate \u003Ccrystal-id>` reconstitutes the exact state without data loss.\n\n---\n\n## 5. Conversational Utterance Matrix (Agent as Operator)\n\nWhen the user communicates in natural language, translate their intent into the following atomic CLI commands:\n\n| User Utterance \u002F Intent | Meaning | Recommended CLI Recipe |\n| :--- | :--- | :--- |\n| *\"Crystallize this session\"*, *\"Save checkpoint\"* | Snapshot current state and progress | `ccrystal batch \"node add \u003Cid> -k checkpoint -s '\u003Csummary>' --fidelity inferred\"` |\n| *\"Resume last task\"*, *\"What are we working on?\"*, *\"Cast context\"* | Hydrate prompt with goals, active tasks, recent nodes, open leases | `ccrystal hydrate \u003Cid>` (or MCP `crystal_hydrate`) |\n| *\"Hydrate from checkpoint X\"*, *\"Show context since anchor\"* | Selectively hydrate prompt from an anchor, UUID, or prefix forward | `ccrystal hydrate \u003Cid> --from \u003Cselector>` (or MCP `crystal_hydrate`) |\n| *\"Cast range between X and Y\"*, *\"Shape context beam\"* | Shape context beam between two specific nodes or anchors | `ccrystal cast \u003Cid> --from \u003CselA> --to \u003CselB>` (or MCP `crystal_hydrate`) |\n| *\"Show recent 5 nodes of context\"*, *\"Hydrate tail\"* | Hydrate living state and only the most recent N DAG transitions | `ccrystal hydrate \u003Cid> --tail 5` (or MCP `crystal_hydrate`) |\n| *\"Hydrate high-level context only\"*, *\"Cast summary\"* | Hydrate goal, tasks, leases, and lessons without DAG transitions | `ccrystal hydrate \u003Cid> --summary-only` (or MCP `crystal_hydrate`) |\n| *\"We hit a blocker \u002F build error\"*, *\"Log a lesson\"* | Record friction and corrective action | `ccrystal lesson add \u003Cid> -f '\u003Cfriction>' -r '\u003Ccause>' -a '\u003Caction>'` |\n| *\"Set up a temporary branch \u002F mock config\"* | Acquire a transient resource lease | `ccrystal transient lease \u003Cid> -t git_worktree -p '\u003Cpath>' -d '\u003Cdesc>' --policy revert_on_conclusion` |\n| *\"We're done with the spike, clean it\"* | Release\u002Fclean transient resource | `ccrystal transient clean \u003Cid> -l \u003Clease-id>` |\n| *\"This bug is unrelated, let's track it separately\"* | Cleave context and fork into child crystal | `ccrystal slice \u003Cid> --from \u003Canchor-or-node> --fork-to \u003Cchild-id> --prune` |\n| *\"Find crystals about X\"*, *\"Search crystals from yesterday\"*, *\"What crystals are in progress?\"* | Search and inspect crystals with multi-dimensional filters or status queries | `ccrystal search [-q '\u003Cquery>'] [--since \u003Ctime>] [--until \u003Ctime>] [--status \u003Cstatus>] [--limit \u003CN>]` (or MCP `crystal_search`) |\n| *\"Cave statistics\"*, *\"How much disk is the cave using?\"*, *\"Token savings stats\"* | Compute quantitative metrics, physical disk footprints, and token savings | `ccrystal stats [--since \u003Ctime>] [--status \u003Cstatus>] [--detailed] [--json]` (or MCP `crystal_stats`) |\n| *\"Triage workspace cave\"*, *\"What crystals can we clean?\"* | Classify cave crystals for lifecycle hygiene | `crystal_triage` |\n| *\"Complete task X\"* | Mark acceptance criterion done | `ccrystal task done \u003Cid> -t \u003Ctask-id>` |\n| *\"Conclude crystal X\"*, *\"We're finished with this project\"* | Conclude crystal goal and record resolution node | `ccrystal conclude \u003Cid> [-s '\u003Csummary>']` (or MCP `crystal_goal_transition`) |\n| *\"Abandon crystal X\"*, *\"This approach didn't pan out\"* | Abandon crystal goal and record resolution node | `ccrystal abandon \u003Cid> [-r '\u003Creason>']` (or MCP `crystal_goal_transition`) |\n| *\"Register artifact \u002F tool X\"*, *\"Add physical device \u002F hardware rig\"* | Register virtual or physical artifact in cave or crystal | `ccrystal artifact register --id \u003Cid> --name '\u003Cname>' --substrate \u003Cvirtual\\|physical> --role \u003Ctarget\\|instrument\\|precondition> [--uri \u003Curi>] [--location-name '\u003Cloc>'] [--bench-coords '\u003Ccoords>']` |\n| *\"What artifacts are available?\"*, *\"List tools \u002F hardware\"* | List artifacts across cave or within a crystal | `ccrystal artifact list [--cave] [--crystal \u003Cid>]` |\n| *\"Inspect artifact X\"*, *\"Check test rig location \u002F details\"* | Inspect metadata, substrate, and physical location of artifact | `ccrystal artifact inspect \u003Cid> [--crystal \u003Cid>]` |\n| *\"Execute test using rig X\"*, *\"Link artifact inputs \u002F outputs\"* | Record transition with directional artifact links | `ccrystal node add \u003Cid> -k tool_execution -s '\u003Csummary>' --input-artifact \u003Cin-id> --output-artifact \u003Cout-id> --precondition-artifact \u003Cpre-id>` |\n| *\"Melt intermediate steps in crystal X\"*, *\"Squash nodes from N1 to N2\"* | Deterministically squash sub-DAG path into single checkpoint | `ccrystal melt \u003Cid> --from \u003Cfrom> --to \u003Cto> [--summary '\u003Ctext>']` (or MCP `crystal_melt`) |\n| *\"Connect crystal A to B\"*, *\"Link dependencies between crystals\"* | Connect two crystals with directed semantic relation | `ccrystal connect \u003Csource> \u003Ctarget> -r \u003Crel> [-d '\u003Cdesc>']` (or MCP `crystal_connect`) |\n| *\"Disconnect crystal A from B\"*, *\"Sever cross-crystal link\"* | Sever directed lattice bond between crystals | `ccrystal disconnect \u003Csource> \u003Ctarget> [-r \u003Crel>]` (or MCP `crystal_connect`) |\n| *\"Show crystal connections\"*, *\"What crystals depend on X?\"* | Inspect outbound and inbound cross-crystal bonds | `ccrystal connections \u003Cid> [--json]` (or MCP `crystal_connect`) |\n| *\"Archive crystal X\"*, *\"Move completed crystal to cold storage\"* | Move concluded\u002Finactive crystal to cold storage (`.ccrystals\u002Farchive\u002F`) | `ccrystal archive \u003Cid>` (or MCP `crystal_archive`) |\n| *\"Restore crystal X from archive\"* | Restore archived crystal back to active cave | `ccrystal unarchive \u003Cid>` (or MCP `crystal_unarchive`) |\n| *\"Triage solid \u002F stale crystals\"*, *\"Filter cave hygiene\"* | Triage crystals with aging filters (`--solid`, `--stale`, `--active`) | `ccrystal triage [--solid\\|--stale]` (or MCP `crystal_triage`) |\n| *\"Prune crystal X\"*, *\"Remove scratch session\"*, *\"Prune cold storage\"* | Permanently prune crystal or batch prune cold storage archives by age | `ccrystal prune [\u003Cid>] [--older-than \u003Cduration>] [--all] [-f]` (or MCP `crystal_prune`) |\n| *\"Deregister entity X\"*, *\"Remove actor from cave\"* | Deregister entity and cascade-delete associated crystals | `ccrystal entity deregister \u003Centity-id>` (or `-f` when automated) |\n\n---\n\n## 6. Atomic Batch Recipes (`ccrystal batch`)\n\nThe `batch` subcommand executes multiple statements in a single sub-millisecond process execution. Commands are separated by semicolons (`;`).\n\n### Recipe 1: Initial Inception & Task Breakdown\n\n```bash\nccrystal batch \"init my-feature -g 'OAuth2 Authentication' -i 'Implement PKCE flow'; task add my-feature -d 'Design schema'; task add my-feature -d 'Implement token exchange'; task add my-feature -d 'Verify test suite'\"\n```\n\n### Recipe 2: Milestone Completion & Lease Registration\n\n```bash\nccrystal batch \"node add my-feature -k checkpoint -s 'Schema finalized' --fidelity inferred; task done my-feature -t task-1; transient lease my-feature -t debug_config -d 'OAuth test sandbox credentials' --policy revert_on_conclusion\"\n```\n\n### Recipe 3: Conclusion & Transient Cleanup Gate\n\n```bash\nccrystal batch \"task done my-feature -t task-3; conclude my-feature -s 'OAuth2 flow verified with 100% test coverage'; transient clean my-feature -l lease-1; lesson add my-feature -f 'PKCE code challenge salt collision' -r 'Used weak PRNG in mock' -a 'Always use java.security.SecureRandom'\"\n```\n\n### Recipe 4: Automated Scratch Cleanup & Regeneration\n\n```bash\nccrystal batch \"delete scratch-spike -f; init scratch-spike -g 'Spike 2' -i 'Fresh exploration'\"\n```\n\n### Recipe 5: Artifact Registration & Directional Execution Linkage\n\n```bash\nccrystal batch \"artifact register --id rig-sensor-1 --name 'Oscilloscope Station' --substrate physical --role precondition --location-name 'Hardware Lab' --bench-coords 'Bench-4' --cave; node add my-feature -k tool_execution -s 'Executed signal sampling' --precondition-artifact rig-sensor-1 --output-artifact waveform-dump-1\"\n```\n\n### Recipe 6: Sub-DAG Melting & Cold Storage Archiving\n\n```bash\nccrystal batch \"melt my-feature --from init-node --to milestone-1 -s 'Scaffolding & DB schema finalized'; archive completed-spike\"\n```\n\n### Recipe 7: Cross-Crystal Lattice Bonds & Dependencies\n\n```bash\nccrystal batch \"connect track-auth-core track-api-gateway -r depends_on -d 'Gateway relies on token verification contract'; connections track-auth-core\"\n```\n\n---\n\n## 7. Privacy, PII Protection & Public Repository Sovereignty\n\n- **Zero Unprompted PII Persistence:** An AI entity MUST NEVER record Personally Identifiable Information (personal names, private email addresses, phone numbers, physical addresses, personal API keys\u002Ftokens, private corporate IDs, or customer data) into a crystal (`init`, `node add`, `task add`, `lesson add`, `transient lease`) without proactively consulting the operator.\n- **Context Space Awareness (Public vs. Private):** Crystals (`.ccrystals\u002F`) are designed to be committed to version control, published to remote stores, or shared across multi-agent pipelines. If the repository or destination store is public or shared:\n  - The AI entity MUST warn the user about potential permanent exposure.\n  - The AI entity MUST offer the user three explicit choices before proceeding:\n    1. **Anonymize \u002F Pseudonymize:** Replace identifiers with role-based or synthetic pseudonyms (e.g., `usr_lead_developer`, `[REDACTED_EMAIL]`).\n    2. **Omit \u002F Rephrase:** Restructure the goal, task, or friction summary to describe the technical or architectural reality without containing any personal identifiers.\n    3. **Explicit Authorization:** Proceed only if the user explicitly confirms that the repository is strictly private and that they hold the authority to record the data.\n- **Canonical Entity Conventions & ID Schemes:**\n  All Cave entities follow `\u003Cprefix>_\u003Cslug>`:\n\n  | Prefix | Kind | Example Handle | Canonical Entity ID | Description |\n  | :--- | :--- | :--- | :--- | :--- |\n  | `usr_` | Human | `john` \u002F `lead` | `usr_john` \u002F `usr_lead` | First name or role alias. Display name defaults to handle. Avoid full legal names or accents. |\n  | `agt_` | Agent | `antigravity` | `agt_antigravity` | Autonomous pairing agent or entity. |\n  | `mdl_` | Model | `gemini-flash` | `mdl_gemini_flash` | Model backend or LLM architecture. |\n  | `tool_` | Tool | `bash-runner` | `tool_bash_runner` | External tool, compiler, or runner. |\n  | `sys_` | System | `git-sync` | `sys_git_sync` | Background subsystem or daemon. |\n\n- **Operator Preference & Persistent Memory Invariant:**\n  - An AI entity MUST check persistent memory (e.g., Engram project memory, `AGENTS.md`, or rules) for the operator's preferred entity handle and privacy stance before prompting.\n  - If unset, prompt the operator *once*, and offer to persist the choice so subsequent pairing sessions run autonomously without repeated questions.\n  - NEVER scrape `git config user.name` or OS environment variables without explicit operator confirmation.\n\n- **Idempotent Handle Resolution:** CLI options (`--author`) and MCP parameters (`author`) accept the bare handle (`antigravity`, `oswaldo`). Even if an agent accidentally supplies an already-prefixed handle (`agt_antigravity`, `usr_oswaldo`), `ccrystal`'s store defensively strips redundant prefixes, guaranteeing idempotent canonical IDs (`agt_antigravity`, `usr_oswaldo`) without duplicate prefix nesting (`agt_agt_...`).\n\n- **CLI Guidance Invariants:**\n  - Run `ccrystal --for-ai` to retrieve dense operational invariants directly from the CLI binary.\n  - Run `ccrystal entity conventions` to display the canonical prefix reference table.\n- **Strict Rule:** The AI entity MUST ALWAYS ask and NEVER assume when PII is involved.\n\n---\n\n## 8. Cave Lifecycle Hygiene, Aging & Archiving Protocol (Triage)\n\nOver weeks or months of continuous delivery, crystals accumulate in the workspace cave (`.ccrystals\u002F`). As projects evolve, completed features, concluded tracks, or abandoned experiments consume space and clutter context listings.\n\nAI entities support operators in maintaining optimal cave hygiene through deterministic aging classification and cold storage archiving:\n\n### A. Triage Triggers\n\n- **Explicit Operator Request:** When the user asks to \"review the cave\", \"clean up old crystals\", \"triage workspace crystals\", or \"free up context clutter\". Use the `crystal_triage` MCP tool or `ccrystal triage`.\n- **Cave Bloat Heuristic:** When `ccrystal list` or MCP `crystal_list` reports multiple completed or stale goals ready for housekeeping.\n\n### B. Aging Classification & Categorization Matrix\n\nContext Crystal deterministically classifies crystals into three aging states:\n\n1. **Solid (Clean Concluded State — Primary Candidate for Archiving):**\n   - Goal status is `concluded_success` or `concluded_abandoned`.\n   - All internal tasks completed (`100%`).\n   - Active transient leases: `0`.\n   - Open lessons: `0` (or lessons already incorporated into codebase documentation\u002FADRs).\n   - In-flight external feedback loops: `0` (no pending upstream PRs, unverified registry submissions, or challenge emails).\n   - **Recommendation:** Safe to archive to cold storage via `ccrystal archive \u003Cid>` (or MCP `crystal_archive`). This removes the crystal from the active cave while preserving 100% of state, history, and artifacts under `.ccrystals\u002Farchive\u002F\u003Cid>\u002F`.\n2. **Stale (Review & Action Needed):**\n   - Incomplete \u002F `in_progress` with no activity for >30 days, or abandoned with unresolved transient leases or incomplete acceptance criteria.\n   - **Recommendation:** Prompt operator whether to clean leases, harvest lessons, and archive\u002Fdelete, or resume work.\n3. **Active (Protected Work in Flight):**\n   - Active feature or bugfix tracks currently in development (updated within last 14 days, holding active leases, or monitoring pending external PRs\u002Freviews).\n   - **Recommendation:** Keep active in workspace cave.\n\n### C. Cold Storage Archiving vs. Retention Pruning\n\n- **Pre-Archival In-Flight Dependency & Lease Audit:** Before executing `ccrystal archive` or MCP `crystal_archive`, explicitly reason whether the session spawned in-flight asynchronous commitments (upstream PRs, registry submissions, verification emails) or unregistered workspace resources (temporary git worktrees, clones, mock services). If external commitments remain in-flight, do NOT archive prematurely: keep the crystal active with explicit monitoring tasks (`task-N`) and transient resource leases (`git_worktree`). Only archive when both code milestones and external verification loops are fully resolved.\n- **Default to Cold Storage Archiving:** Unless the operator explicitly asks to permanently destroy a throwaway spike or scratch session, **always prefer archiving** (`ccrystal archive \u003Cid>` \u002F MCP `crystal_archive`) over permanent pruning. Archived crystals can be inspected at any time with `ccrystal list --archived` and restored seamlessly via `ccrystal unarchive \u003Cid>`.\n- **Permanent Pruning Safety Gate:** Permanent pruning (`ccrystal prune [\u003Cid>]` \u002F MCP `crystal_prune`) is irrecoverable and cascades to all associated nodes and leases. The AI entity MUST request explicit confirmation from the operator before executing un-previewed pruning operations, never pruning unprompted without `--dry-run` or explicit operator instruction.\n","# Context Crystal Agent Skill\n\nThis skill equips AI coding entities (Antigravity, Claude Code, Cursor, Windsurf, Jetski) to manage, persist, and advance long-running computational contexts using the **Context Crystal** engine (`ccrystal`).\n\n---\n\n## 1. Operating Philosophy & Cybernetic Model\n\n- **Context Over Session (The Navigational Map & Compass):** Context and goals exist independently of any individual chat session, IDE window, or token budget. A crystal is not an \"agent memory\" (RAG\u002Fvector DB) simulating cognitive recall, but a portable, externalized navigational artifact: a map of where the task has been (verified milestones, executed tools, resolved friction) and a compass pointer to where it is heading (goal nucleus, active tasks, pending leases). Crystals are self-contained and inert at rest; active use and hydration turn them into meaningful, high-bandwidth context.\n- **Agent as Operator (Zero Human Learning Curve):** The human operator should never need to learn CLI flags, subcommands, or manual installation routines. The agent autonomously interprets user intent, manages binary installation, and executes atomic batched updates behind the scenes.\n- **Fidelity Guarantee:** In the absence of an OS-level deterministic kernel interceptor, all agent-synthesized DAG transitions MUST specify `--fidelity inferred`.\n- **Atomic Multi-Command Batching & Native MCP Preference:** Autonomous agents interacting with Context Crystal should prioritize native MCP tools (`crystal_batch`, `crystal_search`, `crystal_hydrate`, `crystal_triage`, `crystal_init`, `crystal_checkpoint`, `crystal_task_transition`, `crystal_goal_transition`, `crystal_transient_lease`, `crystal_slice_fork`, `crystal_melt`, `crystal_connect`, `crystal_archive`, `crystal_unarchive`, `crystal_prune`, `crystal_artifact`) and resources (`ccrystal:\u002F\u002Fartifacts`, `ccrystal:\u002F\u002F{id}\u002Fartifacts`, `ccrystal:\u002F\u002F{id}\u002Fbonds`) over shell subprocesses. For multi-step transitions, compose a single `crystal_batch` recipe or `ccrystal batch` command to execute atomically with minimal turn roundtrips.\n- **Preservation of Clean Repositories:** Context Crystal fully supports out-of-tree companion context repositories (`CCRYSTAL_STORE`). Respect user repository policies to prevent polluting production code with local tracking files.\n- **Secret Sanitization Invariant (Pointers Over Values):** Never record raw secrets, credentials, API tokens, passwords, or private keys in `.ccrystals\u002F` DAG nodes, envelopes, or artifacts. When recording tool execution outputs or logs, redact sensitive authorization headers (e.g. `Bearer \u003CREDACTED>`) and tokens. Crystals may contain pointer references (`env:VAR_NAME`, vault URIs) and discuss secret handling, but must remain strictly zero-secret artifacts. Entities must NEVER run commands that dump, echo, print, or grep environment variables (`env`, `printenv`, `export`), process lists, or credential store files that risk leaking sensitive tokens into tool outputs or transcripts. When CLI tools report authentication failures, pause and request the human operator's assistance rather than attempting environmental secret harvesting.\n- **Mandatory Task Inception Gate:** When starting any non-trivial or multi-step engineering task, the agent MUST immediately inspect existing crystals (`ccrystal list`, `ccrystal search`, or MCP `crystal_search`). If an existing crystal relates to the session context or feature track, attach to it and hydrate context (`ccrystal hydrate` or MCP `crystal_hydrate`) before making code edits. If none exists, initialize a new crystal with atomic acceptance criteria (`crystal_init` with `tasks` or `ccrystal init -t ...`). Never proceed through multi-turn refactors or feature tracks without active crystal anchoring.\n- **Compaction Re-Anchoring Gate (Anti-Amnesia):** When a context window compaction occurs, a session restarts, or an entity resumes from a truncated transcript\u002Fsummary, the entity MUST NEVER rely solely on conversational summary notes. Immediately re-synchronize with ground truth by listing cave crystals (`ccrystal list`, `ccrystal search`, or MCP `crystal_search`). If an active crystal is in-flight, hydrate its living context beam (`ccrystal hydrate \u003Cid>` or MCP `crystal_hydrate`) to restore active tasks, transient resource leases, and causal state into working memory.\n- **Scope Drift & Topic Transition Heuristic (The Three-Tier Rule):** When user requests or session discourse shift focus away from an active crystal's goal nucleus, evaluate the shift against three architectural tiers:\n  1. *Sub-inquiry or Architectural Branch:* If the work is an offshoot or exploratory spike of the active goal, cleave and fork a sub-DAG slice or child dendrite (`ccrystal slice \u003Cid> --fork-to \u003Cchild-id>` or MCP `crystal_slice_fork`).\n  2. *Distinct Non-Trivial Goal:* If the prior goal is concluded or superseded and the new focus is a substantial multi-step task, cleanly conclude the prior crystal (`ccrystal conclude` or MCP `crystal_goal_transition`), resolve all transient leases, and initialize a new dedicated crystal (`crystal_init` or `ccrystal init`).\n  3. *Ephemeral \u002F Informational Q&A:* If the request is a brief factual inquiry, architectural explanation, or single-turn lookup (e.g., \"what does OCC stand for?\"), answer directly and statelessly without mutating crystals or creating workspace cave bloat.\n- **Authoritative CLI Ground Truth (`--help` & `--for-ai`):** Because `ccrystal`'s CLI parser is statically generated via Decline ADTs, running `ccrystal --help` and `ccrystal \u003Csubcommand> --help` is the **guaranteed source of truth** for all available subcommands, flags, defaults, and syntax. When choosing between MCP and CLI, or when discovering newly implemented capabilities that might not yet be exposed in a specific agent's MCP schema, the entity should run `ccrystal --help` or `ccrystal \u003Csubcommand> --help` to verify current options. Additionally, `ccrystal --for-ai` emits agent-specific operational rules, naming conventions, and PII invariants on demand.\n- **Negative Knowledge & Dead-End Avoidance (Zero-Token Caching):** When an architectural spike, dependency hypothesis, or tool command fails, never leave that negative knowledge solely in transient chat transcript. Record it immediately as an unresolved lesson: `ccrystal lesson add \u003Cid> -o \"Attempted X: failed because Y\" -r \"\u003Croot cause>\" -a \"Avoid X; use Z instead\"` (or via MCP `crystal_batch`). Because `ContextHydrator` deterministically injects all `Open` lessons into every context beam under `## Unresolved Lessons Learned:`, the agent (and future resuming entities) avoids repeating failed attempts with **0 LLM tokens spent on re-summarization or memory retrieval**. Once codified into permanent repository rules (`AGENTS.md`), transition the lesson to actioned (`ccrystal lesson actioned \u003Cid>`).\n- **Clean Archival & In-Flight Dependency Audit Gate:** Never archive an active crystal to cold storage while external asynchronous commitments (upstream pull requests awaiting review\u002Fmerge, third-party directory listings awaiting crawl\u002Factivation, verification tokens) or unregistered workspace resources (temporary clones, worktrees, branches) remain in-flight. Before invoking `crystal_archive` or `ccrystal archive`, explicitly reason: *Did this session spawn external dependencies or temporary workspace resources that would cause amnesia or orphaned artifacts if hidden?* If so, the goal is not yet finished. Keep the crystal in active status, register explicit monitoring tasks (`task-N`), and register transient resource leases (`crystal_transient_lease` \u002F `ccrystal transient lease`) to defend in-progress workspace resources against premature teardown.\n- **The Cybernetic Dyad vs. The Swarm Cargo-Cult:** Context Crystal rejects anthropomorphic swarm theater (simulating corporate personas chatting over message buses). It operates strictly on a **Cybernetic Dyad**: a singular computational entity paired with an intentional human steersman over an immutable, externalized state substrate. Specialized work is dispatched as transient tools, sub-DAG slices, or compiler passes—never persistent synthetic personas with simulated egos.\n- **The Cave as a Mineral Deposit (Cross-Session State Sharing):** The cave is not a chat room; it is an organized mineral vein. When a feature is completed, it leaves behind a formed crystal. The human steersman uses organic memory to point adjacent or future sessions to existing crystal nodes (`ccrystal connect` or slice-forking). Resuming entities hydrate the crystal directly, consuming hundreds of tokens of high-density truth rather than tens of thousands of tokens of lossy conversation.\n- **The Human Spectrum & Dyadic Agreement Gate (Humility with True Believers & Creatives):**\n  - *The True Believer:* Tends to accept AI outputs uncritically. The entity must NEVER exploit uncritical trust to declare unearned victory or bypass edge cases; always surface residual risks and verification commands honestly.\n  - *The Creative:* Driven by curiosity and boundless passion, the creative will always envision another idea or refinement. The entity must never respond with dogmatic rigidity; offer to branch child dendrites or sub-DAG slices (`ccrystal slice --fork-to`) so the core goal can conclude while exploration flourishes.\n  - *The Dyadic Agreement Gate:* An AI entity must NEVER unilaterally \"sing victory\" or silently finalize a crystal. True completion is a mutual consensus: when criteria appear met, the entity presents verification evidence and explicitly solicits the human steersman's confirmation before transitioning to `concluded_success`.\n- **Session Conclosure & Debrief Gate (The Ending Ceremony):** When a collaborator indicates they are concluding a session (*\"we're done for today\"*, *\"let's wrap up\"*), or before handing off to the operator, the entity MUST execute an atomic closing hygiene round:\n  1. *Causal State Settlement:* Record a final checkpoint node (`crystal_checkpoint`) or transition completed tasks (`crystal_task_transition`). Never leave verified milestones stranded only in the ephemeral chat window.\n  2. *Transient Resource Audit:* Resolve completed transient leases (`crystal_transient_lease` clean) or defend active leases with in-flight tasks. Never leave unmanaged mock configurations or dangling temporary files behind.\n  3. *Negative Knowledge Capture:* Ensure any dead ends, failed dependency spikes, or tool friction encountered during the session are recorded as `Open` lessons (`ccrystal lesson add` or MCP `crystal_batch`) before the chat transcript is closed.\n  4. *Cave Hygiene Triage:* Run `crystal_triage` \u002F `ccrystal triage` to classify active crystals. Recommend moving concluded crystals to cold storage (`crystal_archive`) to keep the active cave minimal and focused for the next session.\n\n---\n\n## 2. Self-Bootstrapping & Prerequisite Check\n\nBefore invoking any `ccrystal` commands, verify that the binary is available in the execution environment:\n\n```bash\nwhich ccrystal || command -v ccrystal || [ -f \"$HOME\u002F.local\u002Fbin\u002Fccrystal\" ]\n```\n\n### Autonomous Bootstrap Protocol\n\nIf `ccrystal` is not present in PATH:\n\n1. Ensure `~\u002F.local\u002Fbin` exists and is in `PATH`:\n\n   ```bash\n   mkdir -p \"$HOME\u002F.local\u002Fbin\"\n   export PATH=\"$HOME\u002F.local\u002Fbin:$PATH\"\n   ```\n\n2. Fetch the native release binary or install from source:\n   - **Automated Installer (Recommended):**\n\n     ```bash\n     curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Foswaldo\u002Fcontext-crystal\u002Fmain\u002Finstall.sh | sh\n     ```\n\n   - **Universal JVM & Windows Bootstrap (Zero-Install via Coursier):**\n     If running on Windows, an architecture without native binaries, or an environment with Java\u002FCoursier available:\n\n     ```bash\n     # Launch on-demand without installation\n     cs launch io.github.oswaldo:ccrystal-cli_3:latest.release -- \u003Ccommand>\n\n     # Or install globally into user PATH\n     cs install io.github.oswaldo:ccrystal-cli_3:latest.release --name ccrystal\n     ```\n\n   - **Monorepo Fallback (When in Context Crystal repository):**\n\n     ```bash\n     sbt \"cliNative\u002FnativeLink\" && cp .\u002Fcli\u002Fnative\u002Ftarget\u002Fscala-3.9.0\u002Fccrystal-cli \"$HOME\u002F.local\u002Fbin\u002Fccrystal\" && chmod +x \"$HOME\u002F.local\u002Fbin\u002Fccrystal\"\n     ```\n\n3. Test availability and discover ground-truth capabilities:\n\n   ```bash\n   ccrystal --help\n   ```\n\n### Authoritative Ground Truth Discovery (`--help` & `--for-ai`)\n\n- **Zero-Drift CLI Reference:** Always treat `ccrystal --help` and `ccrystal \u003Csubcommand> --help` as the live, authoritative contract for command-line syntax and flags. Because Decline compiles CLI parsers directly from source ADTs, `--help` never drifts from binary reality.\n- **MCP vs. CLI Decision:** While native MCP tools are preferred for turn-efficiency, any agent weighing whether to call MCP or CLI—or checking whether a newly implemented capability (such as melting, cold storage archiving, or triage filters) is accessible—should run `ccrystal --help` or `ccrystal \u003Csubcommand> --help` as the definitive source of truth.\n- **Protocol & Invariant Guidance:** For machine-oriented protocol guidelines, PII rules, and entity handle conventions, run `ccrystal --for-ai`.\n- **Self-Describing CLI Enums & Normalization:** All CLI enum arguments accept case-insensitive, `kebab-case`, `PascalCase`, or `snake_case` forms interchangeably:\n  - **Node Kinds (`--kind`, `-k`):** `human_prompt`, `agent_reasoning`, `tool_execution`, `checkpoint`, `branch`, `resolution`\n  - **Transient Resource Types (`--type`, `-t`):** `git_worktree`, `env_override`, `debug_config`, `dummy_asset`, `mock_service`\n  - **Disposal Policies (`--policy`):** `revert_on_conclusion`, `delete_after_test`, `replace_in_final_cut`, `manual`\n  - **Entity Kinds (`--kind`, `-k`):** `human`, `agent`, `model`, `system`, `tool`\n  - **Capture Fidelity (`--fidelity`):** `inferred`, `intercepted`\n  - **Goal Statuses (`--status`):** `in_progress`, `concluded_success`, `concluded_abandoned`\n  - **Artifact Roles (`--role`):** `target`, `instrument`, `precondition`\n  - **Artifact Substrates (`--substrate`):** `virtual`, `physical`\n  - **Aging States (`--state`):** `active`, `solid`, `stale`\n  - **Bond Relations (`--relation`, `-r`):** `relates_to`, `depends_on`, `blocks`, `supersedes`, `references`\n\n### Agent Runtime Onboarding & The Golden Triad (`ccrystal agent`)\n\nContext Crystal operates on the **Golden Triad** model:\n\n1. **The Runtime Binary (`ccrystal`):** The engine and deterministic CLI.\n2. **The MCP Server Engine (`ccrystal mcp`):** Real-time interactive tool calls and prompt resources.\n3. **The Agent Skill (`SKILL.md`):** Autonomous cognitive reflexes, task ceremonies, and anti-amnesia re-anchoring protocols.\n\nAgents can autonomously diagnose Golden Triad readiness and deploy both MCP configurations and skills across detected harnesses:\n\n```bash\n# Non-destructive environment, MCP configuration, and agent skill diagnostics\nccrystal agent doctor\n\n# Auto-configure Context Crystal and deploy skills across all detected harnesses (with .ccrystal.bak backups)\nccrystal agent install\n\n# Deploy skill as a symlink pointing to workspace canonical skill for live development\nccrystal agent install --symlink-skill\n\n# Install canonical skill into local repository workspace (.agents\u002Fskills\u002Fcontext-crystal\u002FSKILL.md)\nccrystal agent install --workspace-skill\n\n# Preview configuration and skill distribution without disk changes\nccrystal agent install --dry-run\n```\n\n---\n\n## 3. Storage Location Discovery (Clean vs In-Tree Repos)\n\nContext Crystal decouples the **Code Workspace** from the **Context Store**. When determining where to persist crystals, evaluate in this order:\n\n1. **Explicit CLI \u002F Environment Override:**\n   - If `CCRYSTAL_STORE` is set in the environment or passed via `--store \u003Cpath>`, use that directory.\n2. **Workspace Pointer File:**\n   - Check if `.ccrystal-store` exists in the workspace root. If present, read its path pointer.\n3. **Clean Repository Preference:**\n   - If the workspace is a strict\u002Fpublic repository (or the user requests a clean working tree without `.ccrystals\u002F`), set `CCRYSTAL_STORE` to an external companion directory, e.g.:\n\n     ```bash\n     export CCRYSTAL_STORE=\"$HOME\u002F.ccrystals\u002Fstores\u002F$(basename \"$PWD\")\"\n     ```\n\n4. **Default In-Tree Storage:**\n   - Fall back to standard in-repo `.ccrystals\u002F` directory.\n\n---\n\n## 4. Environment Sensing & Dual Operational Modes\n\nThe skill automatically adapts its update cadence and token usage based on the host project's workflow infrastructure:\n\n```text\n                          ┌───────────────────────────┐\n                          │ Project Environment Check │\n                          └─────────────┬─────────────┘\n                                        │\n                 ┌──────────────────────┴──────────────────────┐\n                 ▼                                             ▼\n     [Process Framework Found]                     [No Process Tool Found]\n(conductor\u002F, openspec\u002F, speckit\u002F, adr\u002F)            (Freeform conversational flow)\n                 │                                             │\n                 ▼                                             ▼\n          Symbiotic Mode                            Autonomous Spine Mode\n       (Low Token Overhead)                       (Compaction & Crash Proof)\n• Sync only at phase boundaries            • Manages tasks directly in tasks.md\n• Ingest at session start                  • Flushes batch delta before yielding turn\n• Cleave on out-of-scope branch            • Checkpoints on logical milestones\n```\n\n### A. Mode 1: Symbiotic Mode (Low Token Overhead)\n\n*Active when `conductor\u002F`, `.conductor\u002F`, `openspec\u002F`, `speckit\u002F`, or `docs\u002Fadr\u002F` is present.*\n\n- **Zero Micro-Step Chatter:** Do NOT invoke `ccrystal` after every single tool call or minor edit. Allow the host framework to drive minute tasks.\n- **Synchronization Trigger Points:**\n  1. **Session Inception & Hydration:** Cast existing crystal or initialize aligned with the track goal:\n\n     ```bash\n     ccrystal hydrate \u003Ccrystal-id>\n     # Or selectively shape the context beam to conserve tokens:\n     ccrystal hydrate \u003Ccrystal-id> --tail 10\n     ccrystal hydrate \u003Ccrystal-id> --from \u003Canchor-or-node-prefix>\n     # Or initialize if first session:\n     ccrystal init \u003Ccrystal-id> -g \"\u003CGoal Title>\" -i \"\u003CDetailed Intent>\" --created-at \"\u003CISO-8601>\"\n     ```\n\n  2. **Phase \u002F Milestone Boundaries:** When tests pass or a plan phase completes, record an atomic batch transition:\n\n     ```bash\n     ccrystal batch \"node add \u003Ccrystal-id> -k checkpoint -s 'Phase complete: \u003Csummary>' --fidelity inferred; task done \u003Ccrystal-id> -t \u003Ctask-id>\"\n     ```\n\n  3. **Historical Event Batching:** When syncing multiple completed actions from git logs or OpenSpec tasks, supply explicit `--timestamp \u003CISO-8601>` flags to preserve true chronological fidelity rather than collapsing into a single second:\n\n     ```bash\n     ccrystal batch \"node add \u003Cid> -k tool_execution -s 'Ran migration' --timestamp 2026-09-06T14:10:00Z; node add \u003Cid> -k checkpoint -s 'Tests green' --timestamp 2026-09-06T14:25:00Z\"\n     ```\n\n  4. **Cleavage \u002F Divergence:** When an adjacent bug or exploration emerges that diverges from the main track, cleave and fork cleanly:\n\n     ```bash\n     ccrystal slice \u003Ccrystal-id> --from \u003Canchor> --fork-to \u003Cchild-crystal-id> --prune\n     ```\n\n  5. **Hand-Off & Conclusion:** Clean temporary leases and log actionable friction:\n\n     ```bash\n     ccrystal batch \"transient clean \u003Ccrystal-id> -l \u003Clease-id>; lesson add \u003Ccrystal-id> -f '\u003CObserved friction>' -r '\u003CRoot cause>' -a '\u003CRemediation>'\"\n     ```\n\n  6. **Artifact & World-State Linkage:** Register long-lived tools, virtual mocks, or physical lab environments in the Cave Registry or crystal scope, and link them directionally:\n\n      ```bash\n      ccrystal artifact register --id dev-rig-1 --name 'Development Rig' --substrate physical --role instrument --cave\n      ccrystal node add \u003Ccrystal-id> -k tool_execution -s 'Execute firmware test' --input-artifact dev-rig-1 --output-artifact test-report-1\n      ```\n\n### B. Mode 2: Autonomous Spine Mode (High Crash & Compaction Resilience)\n\n*Active when no external planning tool is present.*\n\n- **Context Crystal as Primary Spine:** The crystal directly maintains goals, sub-tasks (`tasks.md`), lessons learned (`lessons-learned.md`), and temporary resources (`transient.json`).\n- **High Information-Density Messaging Standard:**\n  - Because there is no external `spec.md` or `plan.md`, the crystal's DAG nodes and lessons must be **semantically dense** to prevent future sessions from reinvestigating settled topics.\n  - Every transition summary MUST follow the **Action + Rationale + Constraint\u002FArtifact Trio**:\n    - ❌ *Low Density (Forces reinvestigation):* `\"Fixed connection timeout\"`\n    - ✅ *High Density (Self-hydrating):* `\"Resolved pool starvation in db\u002Fpool.go by configuring max idle conns to 20 and keep-alives; discarded connection pooling wrapper because it introduced deadlocks on rollbacks\"`\n- **Anti-Reinvestigation Gate (Discarded Alternatives & Dead Ends):**\n  - Whenever an investigation reveals a dead end, library incompatibility, or rejected architectural alternative, log it immediately:\n    - In node summaries or via `lesson add \u003Cid> -f '\u003Cfriction>' -r '\u003Croot cause>' -a '\u003Cremediation>'`\n    - This guarantees that when a future turn or new agent session runs `ccrystal hydrate`, it immediately inherits the settled rationale and never wastes tokens re-exploring discarded paths.\n- **Density Guardrail (No Token Bloat):**\n  - Dense does not mean verbatim code dumps. Keep summaries bounded to **1–2 crisp, high-signal sentences (20–40 words)** focusing on symbols, root causes, invariants, and decisions made.\n- **Pre-Yield Micro-Batching Rule:**\n  - Whenever you finish a logical batch of work, or **immediately before asking the human a question or yielding your conversational turn**, flush pending transitions in an atomic batch.\n  - This ensures that if the chat window is closed, crashes, or triggers automatic context compaction, resuming via `ccrystal hydrate \u003Ccrystal-id>` reconstitutes the exact state without data loss.\n\n---\n\n## 5. Conversational Utterance Matrix (Agent as Operator)\n\nWhen the user communicates in natural language, translate their intent into the following atomic CLI commands:\n\n| User Utterance \u002F Intent | Meaning | Recommended CLI Recipe |\n| :--- | :--- | :--- |\n| *\"Crystallize this session\"*, *\"Save checkpoint\"* | Snapshot current state and progress | `ccrystal batch \"node add \u003Cid> -k checkpoint -s '\u003Csummary>' --fidelity inferred\"` |\n| *\"Resume last task\"*, *\"What are we working on?\"*, *\"Cast context\"* | Hydrate prompt with goals, active tasks, recent nodes, open leases | `ccrystal hydrate \u003Cid>` (or MCP `crystal_hydrate`) |\n| *\"Hydrate from checkpoint X\"*, *\"Show context since anchor\"* | Selectively hydrate prompt from an anchor, UUID, or prefix forward | `ccrystal hydrate \u003Cid> --from \u003Cselector>` (or MCP `crystal_hydrate`) |\n| *\"Cast range between X and Y\"*, *\"Shape context beam\"* | Shape context beam between two specific nodes or anchors | `ccrystal cast \u003Cid> --from \u003CselA> --to \u003CselB>` (or MCP `crystal_hydrate`) |\n| *\"Show recent 5 nodes of context\"*, *\"Hydrate tail\"* | Hydrate living state and only the most recent N DAG transitions | `ccrystal hydrate \u003Cid> --tail 5` (or MCP `crystal_hydrate`) |\n| *\"Hydrate high-level context only\"*, *\"Cast summary\"* | Hydrate goal, tasks, leases, and lessons without DAG transitions | `ccrystal hydrate \u003Cid> --summary-only` (or MCP `crystal_hydrate`) |\n| *\"We hit a blocker \u002F build error\"*, *\"Log a lesson\"* | Record friction and corrective action | `ccrystal lesson add \u003Cid> -f '\u003Cfriction>' -r '\u003Ccause>' -a '\u003Caction>'` |\n| *\"Set up a temporary branch \u002F mock config\"* | Acquire a transient resource lease | `ccrystal transient lease \u003Cid> -t git_worktree -p '\u003Cpath>' -d '\u003Cdesc>' --policy revert_on_conclusion` |\n| *\"We're done with the spike, clean it\"* | Release\u002Fclean transient resource | `ccrystal transient clean \u003Cid> -l \u003Clease-id>` |\n| *\"This bug is unrelated, let's track it separately\"* | Cleave context and fork into child crystal | `ccrystal slice \u003Cid> --from \u003Canchor-or-node> --fork-to \u003Cchild-id> --prune` |\n| *\"Find crystals about X\"*, *\"Search crystals from yesterday\"*, *\"What crystals are in progress?\"* | Search and inspect crystals with multi-dimensional filters or status queries | `ccrystal search [-q '\u003Cquery>'] [--since \u003Ctime>] [--until \u003Ctime>] [--status \u003Cstatus>] [--limit \u003CN>]` (or MCP `crystal_search`) |\n| *\"Cave statistics\"*, *\"How much disk is the cave using?\"*, *\"Token savings stats\"* | Compute quantitative metrics, physical disk footprints, and token savings | `ccrystal stats [--since \u003Ctime>] [--status \u003Cstatus>] [--detailed] [--json]` (or MCP `crystal_stats`) |\n| *\"Triage workspace cave\"*, *\"What crystals can we clean?\"* | Classify cave crystals for lifecycle hygiene | `crystal_triage` |\n| *\"Complete task X\"* | Mark acceptance criterion done | `ccrystal task done \u003Cid> -t \u003Ctask-id>` |\n| *\"Conclude crystal X\"*, *\"We're finished with this project\"* | Conclude crystal goal and record resolution node | `ccrystal conclude \u003Cid> [-s '\u003Csummary>']` (or MCP `crystal_goal_transition`) |\n| *\"Abandon crystal X\"*, *\"This approach didn't pan out\"* | Abandon crystal goal and record resolution node | `ccrystal abandon \u003Cid> [-r '\u003Creason>']` (or MCP `crystal_goal_transition`) |\n| *\"Register artifact \u002F tool X\"*, *\"Add physical device \u002F hardware rig\"* | Register virtual or physical artifact in cave or crystal | `ccrystal artifact register --id \u003Cid> --name '\u003Cname>' --substrate \u003Cvirtual\\|physical> --role \u003Ctarget\\|instrument\\|precondition> [--uri \u003Curi>] [--location-name '\u003Cloc>'] [--bench-coords '\u003Ccoords>']` |\n| *\"What artifacts are available?\"*, *\"List tools \u002F hardware\"* | List artifacts across cave or within a crystal | `ccrystal artifact list [--cave] [--crystal \u003Cid>]` |\n| *\"Inspect artifact X\"*, *\"Check test rig location \u002F details\"* | Inspect metadata, substrate, and physical location of artifact | `ccrystal artifact inspect \u003Cid> [--crystal \u003Cid>]` |\n| *\"Execute test using rig X\"*, *\"Link artifact inputs \u002F outputs\"* | Record transition with directional artifact links | `ccrystal node add \u003Cid> -k tool_execution -s '\u003Csummary>' --input-artifact \u003Cin-id> --output-artifact \u003Cout-id> --precondition-artifact \u003Cpre-id>` |\n| *\"Melt intermediate steps in crystal X\"*, *\"Squash nodes from N1 to N2\"* | Deterministically squash sub-DAG path into single checkpoint | `ccrystal melt \u003Cid> --from \u003Cfrom> --to \u003Cto> [--summary '\u003Ctext>']` (or MCP `crystal_melt`) |\n| *\"Connect crystal A to B\"*, *\"Link dependencies between crystals\"* | Connect two crystals with directed semantic relation | `ccrystal connect \u003Csource> \u003Ctarget> -r \u003Crel> [-d '\u003Cdesc>']` (or MCP `crystal_connect`) |\n| *\"Disconnect crystal A from B\"*, *\"Sever cross-crystal link\"* | Sever directed lattice bond between crystals | `ccrystal disconnect \u003Csource> \u003Ctarget> [-r \u003Crel>]` (or MCP `crystal_connect`) |\n| *\"Show crystal connections\"*, *\"What crystals depend on X?\"* | Inspect outbound and inbound cross-crystal bonds | `ccrystal connections \u003Cid> [--json]` (or MCP `crystal_connect`) |\n| *\"Archive crystal X\"*, *\"Move completed crystal to cold storage\"* | Move concluded\u002Finactive crystal to cold storage (`.ccrystals\u002Farchive\u002F`) | `ccrystal archive \u003Cid>` (or MCP `crystal_archive`) |\n| *\"Restore crystal X from archive\"* | Restore archived crystal back to active cave | `ccrystal unarchive \u003Cid>` (or MCP `crystal_unarchive`) |\n| *\"Triage solid \u002F stale crystals\"*, *\"Filter cave hygiene\"* | Triage crystals with aging filters (`--solid`, `--stale`, `--active`) | `ccrystal triage [--solid\\|--stale]` (or MCP `crystal_triage`) |\n| *\"Prune crystal X\"*, *\"Remove scratch session\"*, *\"Prune cold storage\"* | Permanently prune crystal or batch prune cold storage archives by age | `ccrystal prune [\u003Cid>] [--older-than \u003Cduration>] [--all] [-f]` (or MCP `crystal_prune`) |\n| *\"Deregister entity X\"*, *\"Remove actor from cave\"* | Deregister entity and cascade-delete associated crystals | `ccrystal entity deregister \u003Centity-id>` (or `-f` when automated) |\n\n---\n\n## 6. Atomic Batch Recipes (`ccrystal batch`)\n\nThe `batch` subcommand executes multiple statements in a single sub-millisecond process execution. Commands are separated by semicolons (`;`).\n\n### Recipe 1: Initial Inception & Task Breakdown\n\n```bash\nccrystal batch \"init my-feature -g 'OAuth2 Authentication' -i 'Implement PKCE flow'; task add my-feature -d 'Design schema'; task add my-feature -d 'Implement token exchange'; task add my-feature -d 'Verify test suite'\"\n```\n\n### Recipe 2: Milestone Completion & Lease Registration\n\n```bash\nccrystal batch \"node add my-feature -k checkpoint -s 'Schema finalized' --fidelity inferred; task done my-feature -t task-1; transient lease my-feature -t debug_config -d 'OAuth test sandbox credentials' --policy revert_on_conclusion\"\n```\n\n### Recipe 3: Conclusion & Transient Cleanup Gate\n\n```bash\nccrystal batch \"task done my-feature -t task-3; conclude my-feature -s 'OAuth2 flow verified with 100% test coverage'; transient clean my-feature -l lease-1; lesson add my-feature -f 'PKCE code challenge salt collision' -r 'Used weak PRNG in mock' -a 'Always use java.security.SecureRandom'\"\n```\n\n### Recipe 4: Automated Scratch Cleanup & Regeneration\n\n```bash\nccrystal batch \"delete scratch-spike -f; init scratch-spike -g 'Spike 2' -i 'Fresh exploration'\"\n```\n\n### Recipe 5: Artifact Registration & Directional Execution Linkage\n\n```bash\nccrystal batch \"artifact register --id rig-sensor-1 --name 'Oscilloscope Station' --substrate physical --role precondition --location-name 'Hardware Lab' --bench-coords 'Bench-4' --cave; node add my-feature -k tool_execution -s 'Executed signal sampling' --precondition-artifact rig-sensor-1 --output-artifact waveform-dump-1\"\n```\n\n### Recipe 6: Sub-DAG Melting & Cold Storage Archiving\n\n```bash\nccrystal batch \"melt my-feature --from init-node --to milestone-1 -s 'Scaffolding & DB schema finalized'; archive completed-spike\"\n```\n\n### Recipe 7: Cross-Crystal Lattice Bonds & Dependencies\n\n```bash\nccrystal batch \"connect track-auth-core track-api-gateway -r depends_on -d 'Gateway relies on token verification contract'; connections track-auth-core\"\n```\n\n---\n\n## 7. Privacy, PII Protection & Public Repository Sovereignty\n\n- **Zero Unprompted PII Persistence:** An AI entity MUST NEVER record Personally Identifiable Information (personal names, private email addresses, phone numbers, physical addresses, personal API keys\u002Ftokens, private corporate IDs, or customer data) into a crystal (`init`, `node add`, `task add`, `lesson add`, `transient lease`) without proactively consulting the operator.\n- **Context Space Awareness (Public vs. Private):** Crystals (`.ccrystals\u002F`) are designed to be committed to version control, published to remote stores, or shared across multi-agent pipelines. If the repository or destination store is public or shared:\n  - The AI entity MUST warn the user about potential permanent exposure.\n  - The AI entity MUST offer the user three explicit choices before proceeding:\n    1. **Anonymize \u002F Pseudonymize:** Replace identifiers with role-based or synthetic pseudonyms (e.g., `usr_lead_developer`, `[REDACTED_EMAIL]`).\n    2. **Omit \u002F Rephrase:** Restructure the goal, task, or friction summary to describe the technical or architectural reality without containing any personal identifiers.\n    3. **Explicit Authorization:** Proceed only if the user explicitly confirms that the repository is strictly private and that they hold the authority to record the data.\n- **Canonical Entity Conventions & ID Schemes:**\n  All Cave entities follow `\u003Cprefix>_\u003Cslug>`:\n\n  | Prefix | Kind | Example Handle | Canonical Entity ID | Description |\n  | :--- | :--- | :--- | :--- | :--- |\n  | `usr_` | Human | `john` \u002F `lead` | `usr_john` \u002F `usr_lead` | First name or role alias. Display name defaults to handle. Avoid full legal names or accents. |\n  | `agt_` | Agent | `antigravity` | `agt_antigravity` | Autonomous pairing agent or entity. |\n  | `mdl_` | Model | `gemini-flash` | `mdl_gemini_flash` | Model backend or LLM architecture. |\n  | `tool_` | Tool | `bash-runner` | `tool_bash_runner` | External tool, compiler, or runner. |\n  | `sys_` | System | `git-sync` | `sys_git_sync` | Background subsystem or daemon. |\n\n- **Operator Preference & Persistent Memory Invariant:**\n  - An AI entity MUST check persistent memory (e.g., Engram project memory, `AGENTS.md`, or rules) for the operator's preferred entity handle and privacy stance before prompting.\n  - If unset, prompt the operator *once*, and offer to persist the choice so subsequent pairing sessions run autonomously without repeated questions.\n  - NEVER scrape `git config user.name` or OS environment variables without explicit operator confirmation.\n\n- **Idempotent Handle Resolution:** CLI options (`--author`) and MCP parameters (`author`) accept the bare handle (`antigravity`, `oswaldo`). Even if an agent accidentally supplies an already-prefixed handle (`agt_antigravity`, `usr_oswaldo`), `ccrystal`'s store defensively strips redundant prefixes, guaranteeing idempotent canonical IDs (`agt_antigravity`, `usr_oswaldo`) without duplicate prefix nesting (`agt_agt_...`).\n\n- **CLI Guidance Invariants:**\n  - Run `ccrystal --for-ai` to retrieve dense operational invariants directly from the CLI binary.\n  - Run `ccrystal entity conventions` to display the canonical prefix reference table.\n- **Strict Rule:** The AI entity MUST ALWAYS ask and NEVER assume when PII is involved.\n\n---\n\n## 8. Cave Lifecycle Hygiene, Aging & Archiving Protocol (Triage)\n\nOver weeks or months of continuous delivery, crystals accumulate in the workspace cave (`.ccrystals\u002F`). As projects evolve, completed features, concluded tracks, or abandoned experiments consume space and clutter context listings.\n\nAI entities support operators in maintaining optimal cave hygiene through deterministic aging classification and cold storage archiving:\n\n### A. Triage Triggers\n\n- **Explicit Operator Request:** When the user asks to \"review the cave\", \"clean up old crystals\", \"triage workspace crystals\", or \"free up context clutter\". Use the `crystal_triage` MCP tool or `ccrystal triage`.\n- **Cave Bloat Heuristic:** When `ccrystal list` or MCP `crystal_list` reports multiple completed or stale goals ready for housekeeping.\n\n### B. Aging Classification & Categorization Matrix\n\nContext Crystal deterministically classifies crystals into three aging states:\n\n1. **Solid (Clean Concluded State — Primary Candidate for Archiving):**\n   - Goal status is `concluded_success` or `concluded_abandoned`.\n   - All internal tasks completed (`100%`).\n   - Active transient leases: `0`.\n   - Open lessons: `0` (or lessons already incorporated into codebase documentation\u002FADRs).\n   - In-flight external feedback loops: `0` (no pending upstream PRs, unverified registry submissions, or challenge emails).\n   - **Recommendation:** Safe to archive to cold storage via `ccrystal archive \u003Cid>` (or MCP `crystal_archive`). This removes the crystal from the active cave while preserving 100% of state, history, and artifacts under `.ccrystals\u002Farchive\u002F\u003Cid>\u002F`.\n2. **Stale (Review & Action Needed):**\n   - Incomplete \u002F `in_progress` with no activity for >30 days, or abandoned with unresolved transient leases or incomplete acceptance criteria.\n   - **Recommendation:** Prompt operator whether to clean leases, harvest lessons, and archive\u002Fdelete, or resume work.\n3. **Active (Protected Work in Flight):**\n   - Active feature or bugfix tracks currently in development (updated within last 14 days, holding active leases, or monitoring pending external PRs\u002Freviews).\n   - **Recommendation:** Keep active in workspace cave.\n\n### C. Cold Storage Archiving vs. Retention Pruning\n\n- **Pre-Archival In-Flight Dependency & Lease Audit:** Before executing `ccrystal archive` or MCP `crystal_archive`, explicitly reason whether the session spawned in-flight asynchronous commitments (upstream PRs, registry submissions, verification emails) or unregistered workspace resources (temporary git worktrees, clones, mock services). If external commitments remain in-flight, do NOT archive prematurely: keep the crystal active with explicit monitoring tasks (`task-N`) and transient resource leases (`git_worktree`). Only archive when both code milestones and external verification loops are fully resolved.\n- **Default to Cold Storage Archiving:** Unless the operator explicitly asks to permanently destroy a throwaway spike or scratch session, **always prefer archiving** (`ccrystal archive \u003Cid>` \u002F MCP `crystal_archive`) over permanent pruning. Archived crystals can be inspected at any time with `ccrystal list --archived` and restored seamlessly via `ccrystal unarchive \u003Cid>`.\n- **Permanent Pruning Safety Gate:** Permanent pruning (`ccrystal prune [\u003Cid>]` \u002F MCP `crystal_prune`) is irrecoverable and cascades to all associated nodes and leases. The AI entity MUST request explicit confirmation from the operator before executing un-previewed pruning operations, never pruning unprompted without `--dry-run` or explicit operator instruction.\n",{"name":5,"metadata":24,"description":7},{"version":25,"schemaVersion":26},"1.0","1.0.0","main","e01fe85248f9476d4a5d64e48e3381572a5bc2b3","skills\u002Fcontext-crystal","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal","https:\u002F\u002Fgithub.com\u002Foswaldo","2026-10-22 08:41:02",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add oswaldo\u002Fcontext-crystal --skill context-crystal",{"tool":39,"command":40},"bunx","bunx skills add oswaldo\u002Fcontext-crystal --skill context-crystal",{"tool":42,"command":43},"pnpm","pnpm dlx skills add oswaldo\u002Fcontext-crystal --skill context-crystal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002FSKILL.md",true,[47,53,57,61,65,71,75,79],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"adapters\u002Fantigravity\u002FREADME.md","REFERENCE","参考文档",1850,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fantigravity\u002FREADME.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"adapters\u002Fclaude\u002FCLAUDE.md",779,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fclaude\u002FCLAUDE.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"adapters\u002Fclaude\u002Fcrystallize.md",854,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fclaude\u002Fcrystallize.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"adapters\u002Fclaude\u002FREADME.md",581,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fclaude\u002FREADME.md",{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"adapters\u002Fcursor\u002F.cursorrules","OTHER","其他",338,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fcursor\u002F.cursorrules",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"adapters\u002Fcursor\u002Fcontext-crystal.mdc",1159,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fcursor\u002Fcontext-crystal.mdc",{"path":76,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":77,"sourceHtmlUrl":78},"adapters\u002Fcursor\u002FREADME.md",495,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Fadapters\u002Fcursor\u002FREADME.md",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"tests\u002Fverify_skill_commands.sh","SCRIPT","脚本",2979,"https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-crystal\u002Ftests\u002Fverify_skill_commands.sh",[86,92,98,105,112,117],{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7C8NDE92X05P4KR3QYF8RVV","sample_runner","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fspec\u002Fextensions\u002Fsample_runner\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7C8NBT6K7ZP81ZA2XM3NKMH","media","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fspec\u002Fextensions\u002Fmedia\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7C8N6DK3BQ2DRS1GV72RF1Y","multi-channel-release","Standardized playbook and operational invariants for end-to-end multi-channel releases of Context Crystal across GitHub Releases, Maven Central (Sonatype Central Portal), Homebrew, and Coursier.","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fmulti-channel-release\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M7C8MTC8ESS4D5KFFAD1C16M","ccrystal-dev-hygiene","Standardized session conclusion and debrief protocol for Context Crystal developers and AI agents. Ensures causal state persistence, clean worktree\u002Fbranch hygiene across multi-forge remotes, in-flight lease defense, and zero workspace debris before session close.","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002Fskills\u002Fccrystal-dev-hygiene\u002FSKILL.md",[],[],{"skillNo":113,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7C8MPF5R7EJ10RJ6GCCNDDS","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002F.ccrystals\u002Fextensions\u002Fmedia\u002FSKILL.md",[],[],{"skillNo":118,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M7C8MKMVWTX7K5N753PHFH4B","https:\u002F\u002Fgithub.com\u002Foswaldo\u002Fcontext-crystal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmulti-channel-release\u002FSKILL.md",[],[]]