@clawhub-mackding-e858a000bb
Scaffold a personal LLM wiki (Karpathy pattern) — multi-agent, MCP-ready, with SEO/GEO publish target. Compiles knowledge into a persistent wiki instead of r...
---
name: create-opc-wiki
description: Scaffold a personal LLM wiki (Karpathy pattern) — multi-agent, MCP-ready, with SEO/GEO publish target. Compiles knowledge into a persistent wiki instead of re-deriving from raw docs on every query. One paste from any agent (OpenClaw, Claude Code, Codex, Cursor, Hermes) installs it.
---
# create-opc-wiki
Scaffold a personal LLM wiki on the [Karpathy pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) in 30 seconds. Multi-agent native, MCP server built-in, SEO/GEO-optimized publish target.
## What this skill does
Run the scaffolder against any folder and you get a complete personal-knowledge-base vault:
- `agent-rules/main.md` — single source of truth, synced to **9 agent file formats** (CLAUDE.md, AGENTS.md, .cursor/rules/main.mdc, .cursorrules, .github/copilot-instructions.md, .trae/rules.md, **.openclaw/rules.md**, .hermes/agent.md)
- Three reusable skills: `/wiki-ingest`, `/wiki-query`, `/wiki-lint`
- Five source recipes: arXiv paper, X thread, YouTube transcript, RSS article, podcast transcript
- Privacy-tagged frontmatter: `public | private | secret`
- An MCP server with three tools (`wiki_query`, `wiki_list`, `wiki_read`) and a hard privacy gate (`privacy: secret` pages **never** leave the box)
- Optional Astro static site target with sitemap.xml, llms.txt, robots.txt, RSS feed, OpenGraph + JSON-LD per page
## How to invoke
The skill wraps the published npm package `create-opc-wiki@latest`. From any agent that can run a shell command:
```bash
npx -y create-opc-wiki@latest <path> --yes --agents=openclaw,claude,codex,cursor
```
Common one-liners:
| Agent | Command |
|---|---|
| OpenClaw | `npx -y create-opc-wiki@latest ~/wiki --yes --agents=openclaw,claude` |
| Claude Code | `npx -y create-opc-wiki@latest ~/wiki --yes --agents=claude` |
| Codex CLI | `npx -y create-opc-wiki@latest ~/wiki --yes --agents=codex` |
| Cursor | `npx -y create-opc-wiki@latest ~/wiki --yes --agents=cursor` |
| All of them | `npx -y create-opc-wiki@latest ~/wiki --yes --agents=openclaw,claude,codex,cursor,hermes,vscode,trae` |
Add `--no-mcp`, `--no-site`, `--no-recipes`, or `--no-git` to skip those layers. `--json` emits machine-readable result on stdout.
## How to use the generated vault
1. **Open the folder in Obsidian** (it's a valid Obsidian vault) — and/or
2. **Open the folder in your AI agent** (it reads `CLAUDE.md` / `AGENTS.md` / `.openclaw/rules.md` / etc.)
3. From inside the agent, use the three skills:
- `/wiki-ingest <url-or-file>` — drop a new source, agent files it into `raw/` and synthesizes wiki pages
- `/wiki-query <question>` — natural-language query across compiled wiki
- `/wiki-lint` — health-check (contradictions, stale `speculative` claims, orphan pages)
The MCP server in `mcp/server.mjs` exposes the wiki to any MCP client (Claude Desktop, Cursor, Codex). Run `npm install && npm start` from the `mcp/` directory.
## Why a wiki and not just RAG
Most LLM-on-files setups re-derive answers from raw docs at every query. There's no accumulation. Quoting [Karpathy's gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f):
> The LLM **incrementally builds and maintains a persistent wiki** — a structured, interlinked collection of markdown files that sits between you and the raw sources. The wiki keeps getting richer with every source you add and every question you ask.
This skill operationalizes exactly that, with concrete choices for ontology, agent rules, MCP, and publishing.
## Privacy & security
- `privacy: secret` pages **never** returned by the MCP server (enforced at `mcp/server.mjs:38`)
- `privacy: public` is the **only** level that publishes (enforced at `site/build.mjs:53`)
- Default frontmatter privacy is `private` — nothing publishes by accident
- The scaffolder runs once, locally, and exits — no telemetry, no network calls during scaffolding except the optional `npm` install you trigger yourself
## Links
- **npm**: <https://www.npmjs.com/package/create-opc-wiki>
- **GitHub**: <https://github.com/MackDing/create-opc-wiki>
- **Inspiration**: <https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f>
- **Stability scope**: see `STABILITY.md` in the repo for the semver-stable surface
- **Per-agent install recipes**: see `docs/INSTALL-FOR-AGENTS.md` in the repo
## License
MIT. Inspired by Andrej Karpathy's "LLM Wiki" gist; implementation choices are this project's. Full attribution in `INSPIRATION.md`.
FILE:EXAMPLES.md
# Quick examples
## Most common: install for all popular agents
```bash
npx -y create-opc-wiki@latest ~/wiki --yes \
--agents=openclaw,claude,codex,cursor,hermes,vscode
```
## Minimal install (no MCP, no site, single agent)
```bash
npx -y create-opc-wiki@latest /tmp/quick-wiki --yes \
--agents=claude --no-mcp --no-site --no-recipes --no-git
```
## Custom domains for a research vault
```bash
npx -y create-opc-wiki@latest ~/research --yes \
--domains=ai,bio,papers,methodology --agents=claude
```
## Programmatic / CI use
```bash
npx -y create-opc-wiki@latest /tmp/wiki --yes --json --no-git \
| jq '{ok, files, dirs, target}'
```
Output:
```json
{
"ok": true,
"target": "/tmp/wiki",
"files": 28,
"dirs": 17
}
```
## Then use the wiki
After scaffolding, `cd <vault>` and run your agent. From inside:
```
/wiki-ingest https://paulgraham.com/ds.html
/wiki-query "what's the relationship between Kelly criterion and position sizing?"
/wiki-lint
```
## Run the MCP server
```bash
cd ~/wiki/mcp
npm install
npm start
```
Then connect from Claude Desktop / Cursor / Codex. Three tools available: `wiki_query`, `wiki_list`, `wiki_read`.
## Publish your wiki
Tag pages with `privacy: public` in frontmatter, then:
```bash
cd ~/wiki/site
npm install
npm run build
# dist/ contains: index.html, sitemap.xml, llms.txt, robots.txt, feed.xml,
# per-page HTML with OpenGraph + JSON-LD
```
Drop `dist/` on GitHub Pages, Cloudflare Pages, Netlify, anywhere.
Scan any OpenClaw skill for security issues before installing — malware, prompt injection, obfuscation, supply chain attacks.
---
name: Skill Security Scanner
description: Scan any OpenClaw skill for security issues before installing — malware, prompt injection, obfuscation, supply chain attacks.
version: 1.0.0
author: claws-shield
tags:
- security
- scanner
- malware
- prompt-injection
- supply-chain
user-invocable: true
argument-hint: "<path-to-skill>"
when_to_use: "When you want to check if an OpenClaw skill is safe to install, or scan a skill directory for security vulnerabilities."
allowed-tools:
- Bash
- Read
- Glob
- Grep
---
# Skill Security Scanner
You are the **Claws-Shield Skill Security Scanner** — born from the ClawHavoc incident to protect OpenClaw users from malicious skills.
## What You Do
Scan any OpenClaw skill for security issues across 5 categories:
1. **Malware Detection** — Suspicious shell commands, destructive operations, credential harvesting
2. **Prompt Injection** — Instruction override attempts, permission bypasses, hidden exfiltration directives
3. **Obfuscation** — Base64 encoded commands, charcode tricks, string concatenation, encoded URLs
4. **Supply Chain** — Unsafe postinstall scripts, unpinned dependencies, typosquatting
5. **Data Exfiltration** — Outbound network calls with sensitive data, env variable dumps, secret file access
Plus **composite correlation rules** that detect multi-signal attack patterns.
## How to Use
```bash
npx @claws-shield/cli scan <path-to-skill>
```
Or programmatically:
```bash
node scripts/run-scan.mjs <path-to-skill>
```
## Output
- Security grade (A-F) with confidence score
- Issues by severity (critical / high / medium / low)
- Safe-to-install recommendation
- Manual review flags
- Remediation suggestions
## Scoring
Base score starts at 100. Deductions:
- Critical: -30 points
- High: -15 points
- Medium: -7 points
- Low: -3 points
Grades: A (90-100), B (80-89), C (65-79), D (50-64), F (0-49)
FILE:scripts/run-scan.mjs
#!/usr/bin/env node
// Thin wrapper for scanning skills from the OpenClaw skill
import { scanSkill } from "@claws-shield/scanner"
const skillPath = process.argv[2]
if (!skillPath) {
console.error("Usage: run-scan.mjs <path-to-skill>")
process.exit(1)
}
const result = await scanSkill(skillPath)
console.log(JSON.stringify(result, null, 2))
Research-backed intelligence database covering AI coding tools' hidden features, model codenames, feature flags, and version changes.
---
name: Agent Intelligence
description: Research-backed intelligence database covering AI coding tools' hidden features, model codenames, feature flags, and version changes.
version: 1.0.0
author: claws-shield
tags:
- intelligence
- research
- codenames
- feature-flags
- ai-agent
user-invocable: true
argument-hint: "<query>"
when_to_use: "When you need to look up AI tool codenames, feature flags, hidden features, or compare versions of AI coding tools."
allowed-tools:
- Bash
- Read
- Grep
---
# Agent Intelligence
You are the **Claws-Shield Agent Intelligence** engine — a research-backed database covering the hidden internals of AI coding tools.
## What You Do
Query the intelligence database for:
1. **Model Codenames** — Map internal codenames (Capybara, Tengu, Fennec, Numbat) to actual models
2. **Feature Flags** — Look up 250+ documented feature flags with decoded purposes
3. **Hidden Features** — Discover unreleased tools and capabilities behind feature gates
4. **Version Diffs** — Compare behavioral changes between AI tool versions
5. **User Tier Analysis** — Document internal vs external user treatment differences
## How to Use
```bash
npx @claws-shield/cli intel "capybara codename"
npx @claws-shield/cli intel "tengu feature flags"
npx @claws-shield/cli intel "unreleased tools"
```
Or programmatically:
```bash
node scripts/query-intel.mjs "<query>"
```
## Data Sources
- Deep reverse engineering analysis of Claude Code v2.1.88 (512K lines)
- 5 unique research documents covering telemetry, features, undercover mode, killswitches, and roadmap
- Community contributions
- Automated scanning of new releases
## Knowledge Base
The intelligence database is structured as JSON datasets:
- `telemetry/endpoints.json` — Known telemetry endpoints
- `flags/feature-flags.json` — 250+ feature flags with decoded purposes
- `codenames/models.json` — Model codename registry
- `hidden-features/unreleased-tools.json` — 17+ unreleased tools
- `remote-control/managed-settings.json` — Remote control infrastructure
FILE:scripts/query-intel.mjs
#!/usr/bin/env node
// Thin wrapper for querying the intel database from the OpenClaw skill
import { searchKB } from "@claws-shield/intel"
import { findKBRoot } from "@claws-shield/core"
const query = process.argv.slice(2).join(" ")
if (!query) {
console.error("Usage: query-intel.mjs <query>")
process.exit(1)
}
const kbRoot = findKBRoot()
const results = searchKB(kbRoot, query)
console.log(JSON.stringify(results, null, 2))
Smart multi-model routing — use Claude, GPT, Gemini, or local Ollama models with automatic cost optimization, fallback chains, and usage tracking.
---
name: Agent Gateway
description: Smart multi-model routing — use Claude, GPT, Gemini, or local Ollama models with automatic cost optimization, fallback chains, and usage tracking.
version: 1.0.0
author: claws-shield
tags:
- gateway
- multi-model
- routing
- cost-optimization
- llm
user-invocable: true
argument-hint: "start [--port 8787]"
when_to_use: "When you want to route LLM requests across multiple providers with cost optimization, fallback chains, or usage tracking."
allowed-tools:
- Bash
---
# Agent Gateway
You are the **Claws-Shield Agent Gateway** — a smart multi-model routing proxy that runs locally.
## What You Do
1. **Multi-Provider Support** — Route requests to Anthropic Claude, OpenAI GPT, Google Gemini, or local Ollama models
2. **Smart Routing** — 3 strategies: cheapest-viable, best-quality, balanced
3. **Fallback Chains** — If provider A fails, automatically try provider B
4. **Cost Tracking** — Per-request cost calculation, daily/weekly/monthly aggregation
5. **Health Monitoring** — Circuit breaker pattern, automatic provider health checking
6. **OpenAI-Compatible API** — Drop-in replacement with `/v1/chat/completions` endpoint
## How to Use
Start the gateway server:
```bash
npx @claws-shield/cli gateway --port 8787
```
Or programmatically:
```bash
node scripts/start-gateway.mjs
```
Then send requests to `http://localhost:8787/v1/chat/completions` using any OpenAI-compatible client.
## Configuration
Set provider API keys via environment variables:
- `ANTHROPIC_API_KEY` — For Claude models
- `OPENAI_API_KEY` — For GPT models
- `GEMINI_API_KEY` — For Gemini models
- Ollama requires no key (connects to localhost:11434)
## Routing Strategies
| Strategy | Description |
|----------|-------------|
| `cheapest` | Pick the lowest-cost model that meets requirements |
| `best-quality` | Pick the most capable model available |
| `balanced` | Best value: quality per dollar |
## Privacy
All usage data stays local. The gateway never phones home. Your API keys are never transmitted to third parties.
FILE:scripts/start-gateway.mjs
#!/usr/bin/env node
// Thin wrapper for starting the gateway from the OpenClaw skill
console.log("Starting Claws-Shield Agent Gateway...")
console.log("Gateway server not yet available in skill mode.")
console.log("Use the CLI instead: npx @claws-shield/cli gateway --port 8787")
Audit any AI coding tool for telemetry, remote control, permissions, privacy, and hidden features. Generates a graded report (A-F).
---
name: Agent Auditor
description: Audit any AI coding tool for telemetry, remote control, permissions, privacy, and hidden features. Generates a graded report (A-F).
version: 1.0.0
author: claws-shield
tags:
- security
- audit
- privacy
- telemetry
- ai-agent
user-invocable: true
argument-hint: "<path-to-tool-source>"
when_to_use: "When you need to audit an AI coding tool's behavior, check for telemetry, detect remote control mechanisms, or assess privacy impact."
allowed-tools:
- Bash
- Read
- Glob
- Grep
- Write
---
# Agent Auditor
You are the **Claws-Shield Agent Auditor** — the world's most comprehensive AI coding tool audit engine.
## What You Do
When invoked, you perform a deep audit of an AI coding tool's source code, analyzing:
1. **Telemetry & Data Collection** — Identify all outbound data collection endpoints, classify data types, detect opt-out mechanisms
2. **Remote Control & Killswitches** — Find managed settings, accept-or-die dialogs, model override capabilities, feature flag infrastructure
3. **Undercover Mode** — Detect AI attribution stripping, "write as human" instructions, commit message manipulation
4. **Permissions** — Map all permission requests, identify overprivileged tools, detect escalation patterns
5. **Network Traffic** — Aggregate outbound hosts, classify 1P vs 3P, identify exfiltration destinations
6. **Hidden Features** — Scan for unreleased tools behind feature flags, track feature readiness
7. **Privacy Score** — Compute composite A-F grade with weighted scoring across all categories
## How to Use
Run the audit against a target source directory:
```bash
npx @claws-shield/cli audit <path-to-source>
```
Or use the audit engine programmatically:
```bash
node scripts/run-audit.mjs <path-to-source>
```
## Output
The audit produces a structured report with:
- Overall grade (A-F) and score (0-100)
- Per-category grades and findings
- Evidence with source locations
- Actionable recommendations
- Comparison baselines
## Scoring
| Category | Weight |
|----------|--------|
| Telemetry | 30% |
| Remote Control | 25% |
| Permissions | 15% |
| Network | 15% |
| Undercover | 15% |
Grades: A (90-100), B (80-89), C (65-79), D (50-64), F (0-49)
FILE:scripts/run-audit.mjs
#!/usr/bin/env node
// Thin wrapper for running audits from the OpenClaw skill
import { runAudit } from "@claws-shield/auditor"
const target = process.argv[2]
if (!target) {
console.error("Usage: run-audit.mjs <path-to-source>")
process.exit(1)
}
const report = await runAudit(target, { format: "terminal" })
console.log(JSON.stringify(report, null, 2))