Skip to content

opensite-ai/opensite-skills / context-management

context-management

Verified

Context virtualization skill for extending effective context window across all AI coding agents. Provides SQLite FTS5 indexing of large tool outputs, BM25 search for targeted snippet retrieval, deterministic output compression, and session checkpointing that survives context compaction. Use this skill when working in long sessions, when tool outputs are large (logs, diffs, snapshots), or when resuming after compaction. Essential for Codex CLI and other agents that lack hook-based automatic output interception.

FileKindSize
README.mdmarkdown3.3 KB
SKILL.mdskill md14.0 KB
agents/openai.yamlconfig1.1 KB
references/activation.mdmarkdown2.1 KB
scripts/ctx_checkpoint.pyexecutablescript10.5 KB
scripts/ctx_compress.pyexecutablescript12.0 KB
scripts/ctx_index.pyexecutablescript10.8 KB
scripts/ctx_search.pyexecutablescript10.3 KB
scripts/ctx_stats.pyexecutablescript7.1 KB
scripts/test_ctx.shexecutablescript7.9 KB

references/activation.md

View on GitHub
# Activation Guide

## Best-Fit Tasks
- Context virtualization for extending effective context window across AI coding agents.
- Best trigger phrases: long session management, large output compression, context window optimization, compaction survival, output indexing, search indexed content, checkpoint session state.

## Explicit Invocation
- `Use $context-management when working in long sessions, when tool outputs are large (logs, diffs, snapshots), or when resuming after compaction. Provides SQLite FTS5 indexing, BM25 search, deterministic compression, and session checkpointing.`

## Cross-Agent Notes
- Start with `SKILL.md`, then load only the linked scripts you need.
- All scripts are Python 3.8+ with zero external dependencies.
- Data is stored in `.ctx/` relative to the project root (auto-added to `.gitignore` on first run).
- This skill complements the `memory` skills (long-term persistence) with session-level context optimization.
- The standard metadata and this guide are portable across skills-compatible agents; Claude-specific frontmatter is optional and should degrade cleanly elsewhere.
- Scripts can be invoked with relative paths (`scripts/ctx_index.py`) from the skill's installation directory.

## Quick Reference

```bash
# Index content
cat output.txt | python scripts/ctx_index.py --source "type:name" --project .

# Search indexed content
python scripts/ctx_search.py --query "keywords" --project .

# Compress large output (and optionally index)
command 2>&1 | python scripts/ctx_compress.py --lines 40 --index --source "type:name" --project .

# Save session checkpoint (auto-captures git context)
python scripts/ctx_checkpoint.py save --project . --task "description" --completed "items" --next-steps "items"

# Load checkpoint after compaction
python scripts/ctx_checkpoint.py load --project .

# Load checkpoint as JSON
python scripts/ctx_checkpoint.py load --project . --json

# Delete specific source
python scripts/ctx_search.py --delete-source "file:name" --project .

# Clear all indexed content
python scripts/ctx_search.py --clear-all --project .
```
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall