Skip to main content

ContextBridge — Your context. Any agent. No lock-in.

License: MIT Baseline 0.1.0 CI on main CI on develop Python 3.11+ Telemetry: None

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.

Live Demo (Synthetic Workspace)

ContextBridge synthetic CLI demo

Reproduce this exact demo locally in an isolated temporary directory (never touching real agent configurations):

python examples/demo.py

Quick Start

ContextBridge 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.

The distribution name is contextbridge-agents. See GitHub Releases for published artifacts.

Clone the repository and enter the directory.

git clone https://github.com/AlemaoBoy/ContextBridge.git
cd ContextBridge

Use 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 doctor

Install development tools in the virtual environment with the following command.

python -m pip install -e ".[dev]"

Why ContextBridge?

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: fork or disable-model-invocation) may be silently ignored elsewhere.
  • Manual folder copying risks silent overwrites, broken local links, symlink traps, or accidental leakage of .env files and credentials.

Understanding Shared Directories & Physical Deduplication

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-skill would 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.

Command Reference

1. Detect Agents (Read-Only)

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 --json

2. List Skills (Deduplicated, Read-Only)

contextbridge skills list
contextbridge skills list --agent claude
contextbridge skills list --scope project
contextbridge skills list --json

3. Validate a Skill (Agent Skills Spec + Heuristics)

Validates 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 --json

4. Export Portable ZIP Archive

Packages 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 --overwrite

Format 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.

5. Safe Dry-Run & Migration

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 --yes

Portability 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.

6. Local Backups & Restoration

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 snapshot

7. Read-Only Diagnostics

contextbridge doctor
contextbridge doctor --json

Compatibility Matrix (v0.1.0)

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.

Architecture

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.

Security Mechanisms

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.SafeLoader subclass 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:

  1. Static secret and command checks are heuristic aids only and cannot guarantee that an untrusted skill is free of malicious intent or prompt injection.
  2. Local SHA-256 digests in manifest.json verify 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.

Transparent Limitations (v0.1.0)

  • 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]] in config.toml, Antigravity skills.json / _agents/, Cursor nested monorepo .cursor/skills, and Gemini CLI /trust / extension-bundled skills are documented as pending.
  • Read-only permission check on Windows: doctor uses non-mutating os.access checks, which are best-effort on Windows NTFS ACLs.
  • File portability ≠ identical runtime behavior: Agents enforce different tool approval flows and frontmatter extensions.

Roadmap

Implemented in v0.1.0

  • 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)

Planned for Future Versions (Not Implemented in v0.1.0)

  • MCP server configuration migration
  • Conversion between AGENTS.md, CLAUDE.md, and GEMINI.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.

Contributing

Contributions are welcome! Please review CONTRIBUTING.md, AGENTS.md, and CODE_OF_CONDUCT.md before opening an issue or pull request.

License

Licensed under the MIT License.

Metadata

Release files for contextbridge-agents 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextbridge-agents 0.1.0
File Size Uploaded Provenance Actions
contextbridge_agents-0.1.0.tar.gz 380.0 kB With provenance Details for contextbridge_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for contextbridge-agents 0.1.0
File Interpreter ABI Platform Actions
contextbridge_agents-0.1.0-py3-none-any.whl Python 3 none any Details for contextbridge_agents-0.1.0-py3-none-any.whl

Total release size: 450.6 kB

Release files / contextbridge_agents-0.1.0.tar.gz

Download URL contextbridge_agents-0.1.0.tar.gz
Size 380.0 kB
Tags Source
SHA-256 checksum
How to use checksums
254904884ad29c60c45d7a622a30526682c06d6bbde1919d3263d51e35d217de
BLAKE2b-256 checksum
How to use checksums
9095cdeb8914079bc6c11361a8b65f5a6313fed2c0fef8e3b017a28dea885e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / contextbridge_agents-0.1.0-py3-none-any.whl

Download URL contextbridge_agents-0.1.0-py3-none-any.whl
Size 70.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec287dba52689816e16fdfe985f76c49aba0c75dd6d39e0f3db9d75fef1cac86
BLAKE2b-256 checksum
How to use checksums
00eb17ef8631de114ff2671b01948777c5e34b6923a1274f684d146fa57039cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for contextbridge-agents 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for contextbridge_agents-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page