Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/01-quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 01 — SkillPrism Quickstart

**SkillPrism (`@ritualdev-lab/skillprism`)** is a Just-In-Time (JIT) MCP tool discovery, progressive skill disclosure, and semantic receipt compaction proxy that cuts multi-turn LLM prompt token overhead by up to **98%+** when stacked with native prompt caching.

## 1. Run Reproducible Token Compaction Benchmark
```bash
npx -y @ritualdev-lab/skillprism benchmark
# Or run the full 5-strategy comparative benchmark directly:
npx tsx benchmarks/token-compaction.ts
```

## 2. Initialize Non-Destructive IDE Config
```bash
npx -y @ritualdev-lab/skillprism init
```

## 3. Start Transparent MCP Proxy
```bash
npx -y @ritualdev-lab/skillprism proxy --port 4310
```

## Next Steps
- [02 — Architecture](02-architecture.md)
- [03 — Configuration & CLI Reference](03-configuration-and-cli.md)
- [04 — Integrations & MCP Proxying](04-integrations-and-mcp.md)
- [05 — Enterprise VPC & Security](05-enterprise-vpc-and-security.md)
16 changes: 16 additions & 0 deletions docs/02-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 02 — SkillPrism Architecture

```mermaid
flowchart LR
LLM["AI Agent (3 Zero-State Meta-Tools)"] --> Proxy["SkillPrism MCP Proxy"]
Proxy --> Index["BM25 + RRF Hybrid Skill Index"]
Proxy --> Compactor["Semantic Receipt Compactor"]
Compactor --> Cache["Redis Sentinel Cluster -> Auto Local Disk/LRU Fallback"]
Proxy --> Stack["PromptCacheStack (Anthropic cache_control / OpenAI prefix sorting)"]
```

## Key Subsystems
1. **Zero-State JIT Harness**: Replaces 50+ preloaded MCP tool schemas with 3 lightweight meta-tools (`search_skills`, `load_skill`, `inspect_receipt`) and emits real-time `notifications/tools/list_changed` updates.
2. **Semantic Receipt Compactor**: Stores heavy tool payloads out-of-context and returns compact semantic receipts with field-level `inspect_receipt` access.
3. **Resilient Redis Sentinel Routing (`src/redis-sentinel.ts`)**: Automatically fails over to a bounded local disk-backed LRU store (`local-sqlite-lru` / `local-memory-lru`) with zero errors if Redis Sentinel is stopped or partitioned.
4. **Prompt Cache Stacking (`src/prompt-cache-stack.ts`)**: Stacks Anthropic `cache_control: ephemeral` and OpenAI deterministic prefix sorting on top of JIT pruning for 98%+ effective token reduction with OpenTelemetry FinOps metrics.
18 changes: 18 additions & 0 deletions docs/03-configuration-and-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 03 — SkillPrism Configuration & CLI Reference

## Core CLI Commands

| Command | Description |
| :--- | :--- |
| `skillprism init` | Non-destructively back up and configure local IDE MCP configs. |
| `skillprism proxy [--port 4310]` | Launch transparent stdio + HTTP/SSE MCP proxy server. |
| `skillprism benchmark` | Measure BPE token savings and search latency using `gpt-tokenizer`. |
| `npx tsx benchmarks/token-compaction.ts` | Run reproducible 5-strategy comparison (Raw vs. OpenAI/Anthropic Caching vs. SkillPrism JIT vs. Stacked). |

## Environment Variables

| Variable | Purpose |
| :--- | :--- |
| `CONTEXT_WINDOW_SIZE` | Override host LLM context window budget (e.g. `32000`, `200000`). |
| `SKILLPRISM_REDIS_SENTINELS` | Comma-separated Sentinel endpoints (`host:port`). Falls back automatically to local LRU if unreachable. |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Export OpenTelemetry FinOps token-savings metrics. |
13 changes: 13 additions & 0 deletions docs/04-integrations-and-mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 04 — Integrations & MCP Proxying

## Unified AgentShield Platform Routing
SkillPrism can be invoked directly through AgentShield's unified CLI:
```bash
npx @ritualdev-lab/agentshield compact benchmark
```

## Pairing with DevShelf 1-Click MCP Registry
Discover and install verified MCP tools into your local agent config via `npx devshelf install <tool-slug>`, then route upstream servers through SkillPrism to keep zero-state context usage under 210 tokens regardless of catalog size.

## OpenTelemetry FinOps Integration
`src/finops-exporter.ts` emits per-session token reduction, cache hit ratio, and USD savings telemetry compatible with Prometheus, Grafana, and Datadog.
10 changes: 10 additions & 0 deletions docs/05-enterprise-vpc-and-security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 05 — Enterprise VPC & Security Controls

## Air-Gapped & High-Availability Deployment
- Deploys via the canonical Helm chart in [`RitualDev-Lab/enterprise-governance-suite`](https://github.com/RitualDev-Lab/enterprise-governance-suite) (`helm/agentshield/templates/skillprism-redis-cluster.yaml`).
- Multi-AZ Redis Sentinel clustering with automatic local disk/LRU failover guarantees zero workflow downtime during Redis maintenance or partitions.
- Integrates with `agent-defense-hub` (`/api/v1/skillprism/status` & `/api/v1/skillprism/orchestrate`) for centralized fleet namespace orchestration.
- Cross-turn taint tracking (`src/taint-tracker.ts`) prevents sensitive tool outputs from propagating across untrusted tool calls.

## Security Policy
See [SECURITY.md](../SECURITY.md) or contact `security@ritualdev.in`.
Loading