|
| 1 | +# CodeAlive Context Engine |
| 2 | + |
| 3 | +An [agent skill](https://skills.sh/) that gives your AI coding assistant semantic understanding of your entire codebase — not just the files open in front of you, but every indexed repository, dependency, and workspace in your organization. |
| 4 | + |
| 5 | +Works with Claude Code, Cursor, GitHub Copilot, Windsurf, Gemini CLI, Codex, Goose, Amp, Roo Code, and [other agents](https://skills.sh/docs) that support the SKILL.md format. |
| 6 | + |
| 7 | +**Without this skill**, your agent can only see files you explicitly open or search for with exact keywords. |
| 8 | +**With this skill**, your agent understands codebase architecture, traces cross-service patterns, and answers questions about code it hasn't directly read. |
| 9 | + |
| 10 | +## Quick Start |
| 11 | + |
| 12 | +### 1. Install |
| 13 | + |
| 14 | +**Via [skills.sh](https://skills.sh/)** (recommended): |
| 15 | + |
| 16 | +```bash |
| 17 | +npx skills add CodeAlive-AI/codealive-skills@codealive-context-engine |
| 18 | +``` |
| 19 | + |
| 20 | +This auto-detects your agent and installs the skill to the right location. |
| 21 | + |
| 22 | +**Manual install** — copy the skill folder to your agent's skills directory: |
| 23 | + |
| 24 | +| Agent | Project scope | User scope (all projects) | |
| 25 | +|-------|--------------|--------------------------| |
| 26 | +| Claude Code | `.claude/skills/` | `~/.claude/skills/` | |
| 27 | +| Cursor | `.cursor/skills/` | `~/.cursor/skills/` | |
| 28 | +| GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` | |
| 29 | +| Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` | |
| 30 | +| Gemini CLI | `.gemini/skills/` | `~/.gemini/skills/` | |
| 31 | +| Codex | `.codex/skills/` | `~/.codex/skills/` | |
| 32 | +| Goose | `.goose/skills/` | `~/.config/goose/skills/` | |
| 33 | +| Amp | `.agents/skills/` | `~/.config/agents/skills/` | |
| 34 | +| Roo Code | `.roo/skills/` | `~/.roo/skills/` | |
| 35 | +| OpenCode | `.opencode/skill/` | `~/.config/opencode/skill/` | |
| 36 | + |
| 37 | +### 2. Set up |
| 38 | + |
| 39 | +Run the interactive setup — it will ask for your API key, store it securely, and verify everything works: |
| 40 | + |
| 41 | +```bash |
| 42 | +python setup.py |
| 43 | +``` |
| 44 | + |
| 45 | +``` |
| 46 | + CodeAlive Context Engine — Setup |
| 47 | + ====================================== |
| 48 | +
|
| 49 | + [1/3] Checking for existing API key... |
| 50 | + [2/3] API key required. |
| 51 | + Get yours at: https://app.codealive.ai/settings/api-keys |
| 52 | +
|
| 53 | + Paste your API key (input is hidden): **** |
| 54 | + Key verified. Connected. 7 data sources available. |
| 55 | + [3/3] Storing API key... |
| 56 | + Saved to macOS Keychain. |
| 57 | +
|
| 58 | + -------------------------------------- |
| 59 | + Ready! Start your agent and ask: |
| 60 | +
|
| 61 | + "How is authentication implemented?" |
| 62 | + "Show me error handling patterns" |
| 63 | + "Explain the payment processing flow" |
| 64 | +``` |
| 65 | + |
| 66 | +The setup auto-detects your OS and stores the key in the right place (macOS Keychain, Linux secret-tool, or Windows Credential Manager). |
| 67 | + |
| 68 | +### 3. Use |
| 69 | + |
| 70 | +Start your AI coding agent and ask naturally. No special commands needed: |
| 71 | + |
| 72 | +- *"How is user authentication implemented?"* |
| 73 | +- *"Show me error handling patterns across our microservices"* |
| 74 | +- *"What libraries do we use for caching?"* |
| 75 | +- *"Help me understand the payment processing flow"* |
| 76 | +- *"Find similar features to guide my rate limiting implementation"* |
| 77 | + |
| 78 | +## Prerequisites |
| 79 | + |
| 80 | +- Python 3.8+ (no third-party packages — stdlib only) |
| 81 | +- A [CodeAlive](https://app.codealive.ai) account with indexed repositories |
| 82 | +- API key from [app.codealive.ai/settings/api-keys](https://app.codealive.ai/settings/api-keys) |
| 83 | + |
| 84 | +## How It Works |
| 85 | + |
| 86 | +The skill provides your agent with four tools that it picks from automatically: |
| 87 | + |
| 88 | +| Tool | Speed | Cost | What It Does | |
| 89 | +|------|-------|------|--------------| |
| 90 | +| **List Data Sources** | Instant | Free | Shows which repositories and workspaces are indexed | |
| 91 | +| **Search** | Fast | Low | Finds code locations, file paths, and snippets | |
| 92 | +| **Chat with Codebase** | Slower | Higher | Returns synthesized answers using server-side AI | |
| 93 | +| **Explore** | Slower | Higher | Multi-step workflows combining search and chat | |
| 94 | + |
| 95 | +Search is the default starting point — fast and cheap. Chat with Codebase is used when the agent needs a synthesized explanation rather than raw code locations. |
| 96 | + |
| 97 | +## Alternative Setup Methods |
| 98 | + |
| 99 | +The `setup.py` script is the recommended way. If you prefer manual configuration: |
| 100 | + |
| 101 | +**Environment variable (all platforms):** |
| 102 | +```bash |
| 103 | +export CODEALIVE_API_KEY="your_key_here" |
| 104 | +``` |
| 105 | + |
| 106 | +**macOS Keychain:** |
| 107 | +```bash |
| 108 | +security add-generic-password -a "$USER" -s "codealive-api-key" -w "YOUR_API_KEY" |
| 109 | +``` |
| 110 | + |
| 111 | +**Linux (secret-tool):** |
| 112 | +```bash |
| 113 | +secret-tool store --label="CodeAlive API Key" service codealive-api-key |
| 114 | +``` |
| 115 | + |
| 116 | +**Windows Credential Manager:** |
| 117 | +```cmd |
| 118 | +cmdkey /generic:codealive-api-key /user:codealive /pass:"YOUR_API_KEY" |
| 119 | +``` |
| 120 | + |
| 121 | +**Self-hosted instance:** |
| 122 | +```bash |
| 123 | +export CODEALIVE_BASE_URL="https://your-instance.example.com" |
| 124 | +``` |
| 125 | + |
| 126 | +**Non-interactive setup** (CI/CD, scripted environments): |
| 127 | +```bash |
| 128 | +python setup.py --key "YOUR_API_KEY" |
| 129 | +python setup.py --key "YOUR_API_KEY" --env # prints env var instruction instead of storing in credential manager |
| 130 | +``` |
| 131 | + |
| 132 | +## Troubleshooting |
| 133 | + |
| 134 | +| Error | Fix | |
| 135 | +|-------|-----| |
| 136 | +| "API key not found" | Run `python setup.py` to configure your key | |
| 137 | +| "Authentication failed (401)" | Key is invalid or expired. Get a new one at [app.codealive.ai/settings/api-keys](https://app.codealive.ai/settings/api-keys) | |
| 138 | +| "Data sources not found" | Repository name doesn't match. Run `python scripts/datasources.py` to see available names | |
| 139 | +| "Cannot connect" | Check network. For self-hosted instances, verify `CODEALIVE_BASE_URL` | |
| 140 | +| No results | Be more specific: *"error handling in API controllers"* not just *"error handling"* | |
| 141 | + |
| 142 | +## File Structure |
| 143 | + |
| 144 | +``` |
| 145 | +codealive-context-engine/ |
| 146 | + setup.py # Interactive setup (start here) |
| 147 | + SKILL.md # Skill definition (read by your agent) |
| 148 | + README.md # This file |
| 149 | + scripts/ |
| 150 | + datasources.py # List indexed repos and workspaces |
| 151 | + search.py # Semantic code search |
| 152 | + chat.py # AI-powered codebase Q&A |
| 153 | + explore.py # Multi-step exploration workflows |
| 154 | + lib/ |
| 155 | + api_client.py # API client (auth + HTTP) |
| 156 | + references/ |
| 157 | + query-patterns.md # Effective query writing guide |
| 158 | + workflows.md # Step-by-step workflow examples |
| 159 | +``` |
| 160 | + |
| 161 | +## Platform Support |
| 162 | + |
| 163 | +| Platform | Credential Store | Status | |
| 164 | +|----------|-----------------|--------| |
| 165 | +| macOS | Keychain | Fully supported | |
| 166 | +| Linux | freedesktop Secret Service | Fully supported | |
| 167 | +| Windows | Credential Manager | Fully supported | |
| 168 | + |
| 169 | +All platforms also support the `CODEALIVE_API_KEY` environment variable. |
| 170 | + |
| 171 | +No third-party Python packages required. |
0 commit comments