From 055f12b43dead9a0d5fb4f0ee15ce1dc03a0c99f Mon Sep 17 00:00:00 2001 From: divyanshujethi Date: Wed, 18 Nov 2026 08:10:27 +0530 Subject: [PATCH] docs(phase5): adopt standardized 5-tier /docs hierarchy (01-quickstart through 05-enterprise-vpc) --- docs/01-quickstart.md | 26 ++++++++++++++++++++++++++ docs/02-architecture.md | 16 ++++++++++++++++ docs/03-configuration-and-cli.md | 18 ++++++++++++++++++ docs/04-integrations-and-mcp.md | 13 +++++++++++++ docs/05-enterprise-vpc-and-security.md | 10 ++++++++++ 5 files changed, 83 insertions(+) create mode 100644 docs/01-quickstart.md create mode 100644 docs/02-architecture.md create mode 100644 docs/03-configuration-and-cli.md create mode 100644 docs/04-integrations-and-mcp.md create mode 100644 docs/05-enterprise-vpc-and-security.md diff --git a/docs/01-quickstart.md b/docs/01-quickstart.md new file mode 100644 index 0000000..997edb2 --- /dev/null +++ b/docs/01-quickstart.md @@ -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) diff --git a/docs/02-architecture.md b/docs/02-architecture.md new file mode 100644 index 0000000..e9f78eb --- /dev/null +++ b/docs/02-architecture.md @@ -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. diff --git a/docs/03-configuration-and-cli.md b/docs/03-configuration-and-cli.md new file mode 100644 index 0000000..ceee51a --- /dev/null +++ b/docs/03-configuration-and-cli.md @@ -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. | diff --git a/docs/04-integrations-and-mcp.md b/docs/04-integrations-and-mcp.md new file mode 100644 index 0000000..0ca0066 --- /dev/null +++ b/docs/04-integrations-and-mcp.md @@ -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 `, 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. diff --git a/docs/05-enterprise-vpc-and-security.md b/docs/05-enterprise-vpc-and-security.md new file mode 100644 index 0000000..c6333c8 --- /dev/null +++ b/docs/05-enterprise-vpc-and-security.md @@ -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`.