English · Português (Brasil) · Architecture · Compatibility · Research · Roadmap · Security
ContextBridge is a universal, cross-platform, 100% local open-source CLI tool for discovering, validating, packaging, and safely migrating Agent Skills (SKILL.md) across AI coding agents—without telemetry, cloud accounts, or vendor lock-in.
Non-Affiliation Notice: ContextBridge is an independent open-source project and is not officially affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, Google, Cursor, or OpenCode.
Reproduce this exact demo locally in an isolated temporary directory (never touching real agent configurations):
python examples/demo.pyContextBridge requires Python 3.11 or newer.
The main branch contains the v0.1.0 baseline with Phase 2A quality hardening. The develop branch contains unreleased v0.2.0 development.
In an activated virtual environment, install the stable release from PyPI.
python -m pip install contextbridge-agents==0.1.0
contextbridge --versionClone the repository and enter the directory.
git clone https://github.com/AlemaoBoy/ContextBridge.git
cd ContextBridgeUse the block for your system to install from source.
Windows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .If PowerShell policy blocks activation, use .\.venv\Scripts\python.exe -m pip install -e . and run the CLI as .\.venv\Scripts\contextbridge.exe.
Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .Verify the installation on any system.
contextbridge --version
contextbridge scan
contextbridge doctorInstall development tools in the virtual environment with the following command.
python -m pip install -e ".[dev]"Developers increasingly work across multiple AI coding agents—Claude Code, OpenAI Codex, Google Antigravity, OpenCode, Gemini CLI, and Cursor. While the open Agent Skills specification standardizes SKILL.md, day-to-day management still has sharp edges:
- Each agent scans different native and compatibility directories (
.claude/skills,.agents/skills,.gemini/skills,.cursor/skills,.opencode/skills,~/.gemini/config/skills). - Shared directories cause duplicate counts and hidden precedence conflicts.
- Agent-specific frontmatter fields (such as Claude Code's
context: forkordisable-model-invocation) may be silently ignored elsewhere. - Manual folder copying risks silent overwrites, broken local links, symlink traps, or accidental leakage of
.envfiles and credentials.
Several agents scan the same physical directory on disk—most notably <project>/.agents/skills and ~/.agents/skills, as well as .claude/skills compatibility paths read by OpenCode and Cursor.
- Without deduplication, a single skill stored in
~/.agents/skills/my-skillwould be counted up to 5 times across Codex, Antigravity, OpenCode, Gemini CLI, and Cursor. - With ContextBridge, skills are resolved to their canonical physical path and reported once, showing both primary/native agents and compatibility-only agents.
- No-op detection: If you migrate between two agents whose primary target resolves to the exact same physical directory, ContextBridge detects it cleanly as a no-op instead of self-overwriting.
Distinguishes installed + configured, installed (no config), config found (CLI not on PATH), and not found without ever creating missing directories:
contextbridge scan
contextbridge scan --project-dir /path/to/repo
contextbridge scan --jsoncontextbridge skills list
contextbridge skills list --agent claude
contextbridge skills list --scope project
contextbridge skills list --jsonValidates SKILL.md frontmatter, naming rules, directory match, local Markdown references, directory safety, and heuristic security checks without executing any scripts:
contextbridge skills validate ./examples/sample-skill
contextbridge skills validate ./my-skill --jsonPackages SKILL.md, scripts/, references/, and assets/ into a deterministic, ZIP-safety-verified archive while blocking secrets, sensitive files, symlinks, and silent overwrites:
contextbridge skills export ./examples/sample-skill --format zip
contextbridge skills export ./examples/sample-skill --format zip --output ./sample-skill.zip
contextbridge skills export ./examples/sample-skill --format zip --output ./sample-skill.zip --overwriteFormat honesty: Exports produce a standard Agent Skills ZIP layout for extraction into a target agent's skills directory. ContextBridge does not claim native one-click ZIP import where an agent does not officially document it.
Dry-run preview is always the default. Applying changes requires --apply plus interactive confirmation (or --yes in scripts), and replacing an existing destination requires --overwrite (always creating a verified local backup first):
# Step 1 — Preview plan (default dry-run; modifies nothing)
contextbridge skills migrate release-checklist --from claude --to codex
# Step 2 — Apply with interactive confirmation
contextbridge skills migrate release-checklist --from claude --to codex --apply
# Step 3 — Replace an existing destination safely (creates local backup first)
contextbridge skills migrate release-checklist --from claude --to codex --apply --overwrite --yesPortability vs. runtime behavior: Porting skill files preserves the Agent Skills directory structure, but does not guarantee identical runtime behavior, tool permissions, or invocation triggers across different agents.
contextbridge backup list
contextbridge backup restore <BACKUP_ID> # Dry-run preview + SHA-256 check
contextbridge backup restore <BACKUP_ID> --apply # Atomic restore with pre-restore snapshotcontextbridge doctor
contextbridge doctor --json| Agent | Adapter ID | Project Skills Paths | Global Skills Paths | Env Override |
|---|---|---|---|---|
| Claude Code | claude |
.claude/skills |
~/.claude/skills |
CLAUDE_CONFIG_DIR |
| OpenAI Codex | codex |
.agents/skills |
~/.agents/skills, ~/.codex/skills |
CODEX_HOME |
| Google Antigravity | antigravity |
.agents/skills, .agent/skills |
~/.gemini/config/skills, ~/.gemini/antigravity/skills, ~/.agents/skills |
— |
| OpenCode | opencode |
.opencode/skills, .agents/skills, .claude/skills |
~/.config/opencode/skills, ~/.agents/skills, ~/.claude/skills |
OPENCODE_CONFIG_DIR, XDG_CONFIG_HOME |
| Gemini CLI | gemini-cli |
.gemini/skills, .agents/skills |
~/.gemini/skills, ~/.agents/skills |
GEMINI_CLI_HOME |
| Cursor | cursor |
.cursor/skills, .agents/skills, .claude/skills, .codex/skills |
~/.cursor/skills, ~/.agents/skills, ~/.claude/skills, ~/.codex/skills |
— |
See docs/COMPATIBILITY.md for verified details, frontmatter portability, and pending items.
flowchart TD
CLI["CLI Layer (Typer + Rich / JSON)"] --> Core["Core Services (discovery, doctor)"]
CLI --> Skills["Skills Engine (parser, validator, exporter, migrator)"]
CLI --> Backup["Backup Manager (manifest.json + payload + rollback)"]
Core --> Adapters["Agent Adapters (claude, codex, antigravity, opencode, gemini-cli, cursor)"]
Skills --> Adapters
Skills --> Backup
Core --> Security["Security Guards (paths, ADS, symlinks, secrets, archive, audit)"]
Skills --> Security
Backup --> Security
Adapters --> Models["Pydantic v2 Models & EnvironmentContext"]
Security --> Utils["Atomic FS & SHA-256 Utilities"]
See docs/ARCHITECTURE.md for full module boundaries and exit codes.
ContextBridge is safe by default and operates 100% locally with zero telemetry:
- Zero execution of untrusted content: Never runs scripts in
scripts/, never starts MCP servers, and never loads external plugins as Python code. - Strict filesystem & archive guards: Rejects path traversal (
..), symlinks and Windows junctions, NTFS Alternate Data Streams (:), Windows reserved device names (CON,NUL,COM1..9,LPT1..9), trailing dot/space filename tricks, case-insensitive path collisions, ZIP Slip, ZIP bombs, and oversized files. - Hardened YAML parsing: Uses a strict
yaml.SafeLoadersubclass that rejects duplicate mapping keys, excessive nesting depth, and alias/anchor expansion bombs. - Credential & secret blocking: Blocks sensitive files/directories (
.env,.ssh/*,.aws/*,.git-credentials,*.pem,*.key,credentials.json, etc.) and alerts on heuristic token patterns without ever printing or logging matched values. - Authorized restore boundaries & TOCTOU protection: Restores enforce authorized destination rules independently of
manifest.json(blocking tampered manifests, skills root directories, ancestors, system paths, and non-empty non-skill directories). Migrations re-verify both source and destination state between planning and applying, and preserve displaced/backup files if rollback itself fails.
Important Security Disclaimers:
- Static secret and command checks are heuristic aids only and cannot guarantee that an untrusted skill is free of malicious intent or prompt injection.
- Local SHA-256 digests in
manifest.jsonverify integrity against corruption, partial writes, and drift; because manifests are unsigned, they are not a cryptographic authenticity guarantee against an attacker who already holds local write access to~/.contextbridge/backups.
See SECURITY.md for responsible disclosure guidance.
- Platform verification. GitHub Actions tested the v0.1.0 code on Windows, Ubuntu, and macOS with Python 3.11–3.15. Local verification used Windows.
- Custom agent manifests not parsed yet: Codex
[[skills.config]]inconfig.toml, Antigravityskills.json/_agents/, Cursor nested monorepo.cursor/skills, and Gemini CLI/trust/ extension-bundled skills are documented as pending. - Read-only permission check on Windows:
doctoruses non-mutatingos.accesschecks, which are best-effort on Windows NTFS ACLs. - File portability ≠ identical runtime behavior: Agents enforce different tool approval flows and frontmatter extensions.
- Read-only detection for 6 AI coding agents (
scan) - Physically deduplicated skill listing (
skills list) - Official Agent Skills specification validator + static heuristic audit (
skills validate) - Safe deterministic ZIP export (
skills export --format zip) - Transactional 10-step migration with dry-run default, TOCTOU guards, backup, and rollback (
skills migrate) - Local backups with SHA-256 integrity checks and authorized restoration (
backup list,backup restore) - Read-only diagnostics (
doctor)
- MCP server configuration migration
- Conversion between
AGENTS.md,CLAUDE.md, andGEMINI.md - Cross-agent synchronization & redundancy detection
- Context compaction & cross-session context transfer
- Profile management, advanced static security auditing, and optional GUI
See docs/ROADMAP.md for details.
Contributions are welcome! Please review CONTRIBUTING.md, AGENTS.md, and CODE_OF_CONDUCT.md before opening an issue or pull request.
Licensed under the MIT License.
