arcana

Arcana provides context intelligence for AI coding agents, optimizing skill management and project relevance.

<p align="center"> <img src="assets/banner.svg" alt="arcana" width="600"/> </p> <p align="center"> <strong>Context intelligence for AI coding agents.</strong><br/> 74 skills, 40 commands, 7 platforms. By <a href="https://sporesec.com">SporeSec</a>. </p> <p align="center"> <a href="https://www.npmjs.com/package/@sporesec/arcana"><img src="https://img.shields.io/npm/v/@sporesec/arcana?style=for-the-badge&color=d4943a" alt="npm"/></a> <a href="https://www.npmjs.com/package/@sporesec/arcana"><img src="https://img.shields.io/npm/dw/@sporesec/arcana?style=for-the-badge&color=d4943a" alt="downloads"/></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-d4943a?style=for-the-badge" alt="Apache 2.0"/></a> <a href="https://github.com/medy-gribkov/arcana/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/medy-gribkov/arcana/ci.yml?style=for-the-badge&color=d4943a" alt="CI"/></a> <a href="#skills"><img src="https://img.shields.io/badge/Skills-74-d4943a?style=for-the-badge" alt="Skills"/></a> <a href="#compatibility"><img src="https://img.shields.io/badge/Platforms-7-d4943a?style=for-the-badge" alt="Platforms"/></a> </p>

What It Does

Arcana manages the context your AI coding agent reads. It installs structured skill packages (production code, BAD/GOOD pairs, procedural workflows), then curates which skills load into context based on your project, your token budget, and your usage patterns.

Without arcana, you either load everything (context bloat) or nothing (agent doesn't know your stack). Arcana solves this with budget-aware curation, output compression, cross-session memory, and session management.

Quick Start

# npm
npm i -g @sporesec/arcana

# pnpm
pnpm add -g @sporesec/arcana

# without global install
npx @sporesec/arcana install --all

Then in your project:

arcana init          # detect project, configure AI tools
arcana install --all # install all 74 skills
arcana curate        # auto-select skills within token budget

Skills install to ~/.agents/skills/. Config scaffolds for Claude Code, Cursor, Codex, Gemini, Windsurf, Antigravity, and Aider.

Demo

<p align="center"> <img src="assets/arcana-promo.gif" alt="Arcana CLI demo" width="720"/> </p>

<sub>Built with arcana's own <code>remotion-best-practices</code> skill.</sub>

Core Features

Context Curation

arcana curate auto-generates _active.md containing full content of project-relevant skills within your model's token budget. Skills are ranked by project detection (tags, dependencies, file patterns) and usage history, then greedily packed until the budget fills.

arcana curate                                    # default: 30% of 200K context
arcana curate --model gpt-5.4 --budget 40        # 40% of 1M context
arcana curate --include golang-pro typescript     # force-include specific skills

Supported models: Claude Opus 4.6, Sonnet 4.6, Haiku 4.5 (200K), GPT-5.4 (1M), Gemini 3.1 Pro/Flash/Thinking (1M).

Output Compression

arcana compress runs commands through a 4-stage pipeline (filter, group, truncate, dedup) that reduces token waste from tool output. Shell hooks make it transparent.

arcana compress git status                # compressed git output
arcana compress npm test                  # keep failures + summary only
echo "..." | arcana compress --stdin --tool tsc
arcana hook install                       # transparent shell hooks
arcana hook status                        # show cumulative savings

Rules for: git, npm/pnpm, tsc, vitest, jest, pytest, go test.

Cross-Session Memory

arcana remember persists facts and preferences across sessions. arcana recall searches them. Project-relevant memories inject into _active.md automatically.

arcana remember "always use pnpm for this project"
arcana remember "use vitest not jest" --tag testing
arcana recall "package manager"
arcana recall --all
arcana forget abc123

Session Intelligence

arcana snapshot saves session state before compaction or context loss. arcana trim analyzes and reduces session bloat without touching the original session files.

arcana snapshot pre-refactor              # save current session
arcana snapshot --list                    # list all snapshots
arcana trim --dry-run                     # analyze trimmable content
arcana trim                              # create trimmed copy

MCP Server Management

arcana mcp installs and manages MCP servers (like Context7 for live docs) in your AI tool's config.

arcana mcp list                           # available MCP servers
arcana mcp install context7               # install into Claude/Cursor config
arcana mcp status                         # show configured servers

Progressive Disclosure

Three tiers of context loading:

TierFileTokens/SkillUse Case
Index_index.md~50Discovery, agent reads at startup
Active_active.mdFull (budgeted)Auto-curated, project-relevant
On-demandarcana loadFullManual, specific skill needed
arcana index                              # generate lightweight index
arcana load golang-pro typescript         # load specific skills on demand
arcana benchmark --all --progressive      # compare index vs full token cost

CLI Commands

Getting Started

CommandDescription
arcanaInteractive TUI menu
arcana initDetect project, configure AI tools, install skills, set up MCP
arcana doctorDiagnose environment issues
arcana doctor --fixAuto-fix common issues

Skills

CommandDescription
arcana install <skill>Install one or more skills
arcana install --allInstall all 74 skills
arcana uninstall <skill>Remove one or more skills
arcana update --allUpdate all installed skills
arcana listList available skills
arcana search <query>Search across providers
arcana info <skill>Show skill details and metadata
arcana recommendSmart skill recommendations for current project

Context Intelligence

CommandDescription
arcana curateAuto-generate budget-aware _active.md
arcana compress <cmd>Run command with output compression
arcana hook installInstall transparent shell compression hooks
arcana remember "..."Save a cross-session memory
arcana recall <query>Search saved memories
arcana snapshot [name]Save session state snapshot
arcana trimAnalyze and trim session bloat
arcana mcp install <name>Install an MCP server

Progressive Disclosure

CommandDescription
arcana indexGenerate skill metadata index (~50 tokens/skill)
arcana load <skill>Load full skill content on demand
arcana benchmark --progressiveShow before/after token comparison

Security

CommandDescription
arcana scan --allScan for prompt injection, malware, credential theft
arcana verify --allVerify SHA-256 integrity against lockfile
arcana lock --ciGenerate or validate reproducible lockfile

Development

CommandDescription
arcana create <name>Create a new skill from template
arcana validate --all --fixValidate and auto-fix all skills
arcana auditAudit skill quality (code examples, BAD/GOOD pairs)

Inspection

CommandDescription
arcana benchmarkMeasure token cost of installed skills
arcana diff <skill>Show installed vs remote changes
arcana outdatedList skills with newer versions available
arcana statsSession analytics and token usage
arcana optimizeSuggest token/performance improvements

Configuration

CommandDescription
arcana configView or modify configuration
arcana providers --add <repo>Manage skill providers
arcana cleanRemove orphaned data and temp files
arcana compactRemove agent logs, preserve session history

Workflow

CommandDescription
arcana profile <name>Manage named skill sets
arcana teamShared team skill configuration
arcana export / arcana importPortable skill manifests
arcana completions <shell>Shell completions (bash, zsh, fish)

All commands support --json for machine-readable output and respect NO_COLOR.

Skills

SkillCategoryDescription
accessibility-wcagDesignWCAG 2.1 AA compliance, semantic HTML, ARIA patterns, keyboard navigation, color contrast
api-designAPIREST and GraphQL design. Resource naming, status codes, pagination, versioning
api-testingAPIContract testing (Pact), API mocking (MSW), load testing (k6), BAD/GOOD patterns
asset-optimizationGame DevCompression workflows, WebP/AVIF conversion, streaming, batch processing
audio-systemsGame DevFMOD, Wwise, spatial audio, dynamic mixing, Unity/Godot integration code
aws-essentialsCloudLambda, S3, RDS, CloudFront, IAM, SQS/SNS, DynamoDB, least-privilege policies
ci-cd-pipelinesDevOpsGitHub Actions and GitLab CI. Matrix strategy, caching, deployment patterns
code-reviewerCode QualityCode review with concrete examples. Severity definitions, inline comments
codebase-analysisCode Quality4-phase dissection + 8-domain health scoring. Architecture mapping, dead code
container-securityDevOpsDockerfile BAD/GOOD, rootless containers, image scanning, runtime security
cost-optimizationDevOpsHPA config, spot instances, right-sizing, CDN caching, cost calculations
data-visualizationFrontendRecharts, Chart.js, D3.js. Chart selection, responsive layouts, dashboards
database-designDatabaseSchema design, normalization, indexing, EXPLAIN ANALYZE, migrations
doc-generationDocsOpenAPI, JSDoc, godoc, Mermaid diagrams, procedural walkthrough
docker-kubernetesDevOpsMulti-stage builds (Go, Node, Python), K8s manifests, health checks, Helm
docxDocumentsWord document creation/editing. XML reference, tracked changes, page setup
email-notificationsIntegrationSendGrid, AWS SES, React Email templates, SPF/DKIM/DMARC, bounce handling
env-configDevOps.env management, Zod validation, secret management, 12-factor patterns
flutter-mobileMobileWidget composition, Riverpod state, GoRouter, platform channels, performance
framer-motionDesignFramer Motion animations. Variants, gestures, layout animations, spring physics
frontend-code-reviewCode QualityFrontend review checklist. cn() usage, memoization, accessibility, inline rules
frontend-designDesignProduction interfaces. CSS custom properties, accessibility, DON'T/DO guidelines
fullstack-developerFull-StackReact, Node.js, databases, auth flow (JWT), API error handling patterns
game-enginesGame DevUnity, Unreal, Godot 4.x. Architecture patterns, GDScript 2.0, C# code
game-programming-languagesLanguagesC# 12, C++ 23, GDScript 2.0. Syntax, patterns, engine idioms
game-serversGame DevServer architecture, matchmaking, WebSocket reconnection, cost analysis
gameplay-designGame DevMDA framework, balance formulas, combat systems, progression curves
git-workflowDevOpsMerge vs rebase decision tree, worktrees, SSH signing, sparse checkout
go-linter-configurationLintinggolangci-lint setup, .golangci.yml, import resolution, troubleshooting
godot-4Game DevGodot 4 with GDScript 2.0. Typed syntax, physics, state machines, exports
golang-proLanguagesGo 1.26+. Error handling, HTTP routing, concurrency, testing, profiling
graphics-renderingGame DevPBR shaders, WebGPU, VFX recipes, optimization matrix
i18n-localizationWebnext-intl, react-intl, ICU message syntax, plurals, RTL, dynamic locales
incident-responseOpsSeverity levels, runbooks, PagerDuty/OpsGenie webhooks, blameless postmortems
level-designGame DevWhitebox workflow, pacing graphs, procedural generation seeds
llm-integrationAIOpenAI and Anthropic APIs. Structured output, tool calling, streaming, prompts
local-securitySecuritySSH, GPG, credential managers, Windows OpenSSH agent, file permissions
memory-managementGame DevObject pooling, GC optimization, Rust ownership comparison, budgets
monetization-systemsGame DevIAP manager, battle pass design, A/B test revenue formulas, KPIs
monitoring-observabilityMonitoringJSON logging, Prometheus, OpenTelemetry, Grafana dashboard JSON, SLO alerts
multiplayer-netcodeGame DevClient prediction, server reconciliation, rollback netcode, lag compensation
nextjs-16FrameworkTurbopack, Cache Components, proxy.ts, Server Actions, React 19.2, App Router
notebooklm-researchResearchGoogle NotebookLM automation via Playwright CDP. Sources, queries, artifacts
npm-packagePackagestsup bundling, ESM/CJS exports, semver, changesets, monorepo setup
oauth-authSecurityOAuth2 PKCE, OIDC, JWT validation, session management, refresh token rotation
particle-systemsGame DevVFX, physics simulation, LOD strategy, post-processing
performance-optimizationPerformanceCore Web Vitals, bundle analysis, caching, memory leaks, game frame budgets
playwright-testingTestingE2E testing, page objects, role-based locators, visual regression, CI integration
postgres-advancedDatabaseWindow functions, CTEs, JSONB, full-text search, partitioning, PgBouncer
programming-architectureGame DevECS, data-oriented design, clean architecture, concrete implementations
project-migrationMigrationProject folder migration preserving Claude Code session data and paths
publishing-platformsGame DevSteam, Epic, console submission. Revenue splits, certification checklists
python-best-practicesLanguagesPython 3.14+. Type hints, ruff, uv, async, Pydantic v2, pyproject.toml
react-nativeMobileExpo, React Navigation, Zustand, FlatList optimization, Reanimated
redis-patternsDatabaseCaching, sessions, rate limiting, pub/sub, sorted sets, distributed locks
refactoring-patternsCode QualityBefore/after diffs for extract method, replace conditional, dead code, DI
remotion-best-practicesVideoReact video creation. Composition, spring(), interpolate, Sequence, Audio
rust-best-practicesLanguagesOwnership, lifetimes, error handling, async Tokio, lifetime diagrams
scraping-automationToolingPlaywright, Puppeteer. Stealth mode, proxy rotation, structured extraction
security-reviewSecurityOWASP Top 10, injection prevention, secrets rotation, csrf-csrf patterns
seo-metaWebNext.js metadata API, Open Graph, JSON-LD structured data, sitemaps
shader-techniquesGame DevHLSL/GLSL, mobile GPU gotchas, custom materials, optimization
skill-creatorMetaCreate or update skills. References layout, frontmatter rules, validation
spec-driven-devPlanningSpecification-first development. Requirements, task breakdown, quality gates
stripe-paymentsIntegrationCheckout Sessions, subscriptions, webhook verification, SCA/3D Secure
tailwind-cssDesignConfig, plugins, cn() utility, responsive design, dark mode, theming
terraform-iacDevOpsState management, modules, workspaces, lifecycle rules, CI/CD, AWS patterns
testing-strategyTestingTest pyramid, pytest/Vitest/Jest/Go, flakiness detection, TDD workflow
typescriptLanguagesStrict types, generics constraints, utility types, discriminated unions
typescript-advancedLanguagesBranded types, conditional types, satisfies operator, type-level programming
update-docsDocsMDX workflow for Next.js docs, screenshot patterns, PR-based updates
vercel-deployDevOpsEdge Functions, middleware, preview deployments, caching, monorepo config
websocket-realtimeNetworkingReconnection, heartbeat, SSE, Socket.io rooms, Redis pub/sub scaling
xlsxDocumentsSpreadsheet operations. Pivot tables, chart formulas, financial models

Compatibility

Skills are plain markdown with YAML frontmatter. Claude Code loads them natively from ~/.agents/skills/. Other platforms read them as project context after running arcana init.

PlatformConfig FileIntegration
Claude CodeCLAUDE.mdNative skill loading + _active.md curation
Codex CLIAGENTS.mdConfig scaffold via arcana init
Cursor AI.cursor/rules/Config scaffold via arcana init
Gemini CLIGEMINI.mdConfig scaffold via arcana init
Windsurf.windsurfrulesConfig scaffold via arcana init
AntigravityAGENT.mdConfig scaffold via arcana init
Aider.aider.conf.ymlConfig scaffold via arcana init

Acknowledgments

Arcana was built on the shoulders of these projects:

ProjectInspiration
skills.shMarketplace UX patterns and community-driven skill discovery
token-optimizerToken budget estimation, progressive disclosure, backup-first safety
RTKTool output compression pipeline, 60-90% token reduction patterns
CMVSession snapshot/restore, context bloat analysis, trim strategies
mem0Cross-session memory persistence, project-scoped recall
Context7MCP server for live version-specific documentation
best-practicesUnified setup flow, Command/Agent/Skill pattern, session hygiene
notebooklm-skillNotebookLM browser automation via CDP
notebooklm-pyNotebookLM Python SDK patterns

Support

If these skills save you time, consider supporting the project.

Contributing

See CONTRIBUTING.md.

Security

Report vulnerabilities via SECURITY.md.

Contact

Medy Gribkov - [email protected] - SporeSec - GitHub

License

Apache 2.0 - See NOTICE for attribution requirements.