Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .agents/aidevops/add-new-mcp-to-aidevops.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ npm update -g {package}
```

**Why this matters**: MCP integration methods change between versions.
For example:
- osgrep v0.4.x used `osgrep serve` (HTTP server)
- osgrep v0.5.x uses `osgrep mcp` (native MCP) + `osgrep install-opencode`

Using outdated commands will result in "Connection closed" errors.

## Step 2: Determine Agent Enablement
Expand Down
4 changes: 2 additions & 2 deletions .agents/aidevops/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ aidevops implements proven agent design patterns identified by Lance Martin (Lan

```python
# Tools disabled globally, enabled per-agent
GLOBAL_TOOLS = {"gsc_*": False, "outscraper_*": False, "osgrep_*": True, ...}
GLOBAL_TOOLS = {"gsc_*": False, "outscraper_*": False, ...}
AGENT_TOOLS = {
"Build+": {"write": True, "context7_*": True, "bash": True, "playwriter_*": True, ...},
"SEO": {"gsc_*": True, "google-analytics-mcp_*": True, ...},
Expand Down Expand Up @@ -131,7 +131,7 @@ Decision framework for when to use an MCP server vs a curl-based subagent:

**Three-tier MCP strategy**:

1. **Globally enabled** (always loaded, ~2K tokens each): osgrep, augment-context-engine
1. **Globally enabled** (always loaded, ~2K tokens each): augment-context-engine
2. **Enabled, tools disabled** (zero context until agent invokes): claude-code-mcp, gsc, outscraper, google-analytics-mcp, quickfile, amazon-order-history, context7, repomix, playwriter, chrome-devtools, etc.
3. **Replaced by curl subagent** (removed entirely): hetzner, serper, dataforseo, ahrefs, hostinger

Expand Down
17 changes: 0 additions & 17 deletions .agents/aidevops/mcp-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,6 @@ opencode mcp list

## Version-Specific Issues

### osgrep

| Version | MCP Command | Notes |
|---------|-------------|-------|
| v0.4.x | `osgrep serve` | HTTP server, NOT MCP-compatible |
| v0.5.x | `osgrep mcp` | Native MCP support |

**Fix**: Update to v0.5+ and run `osgrep install-opencode`

```bash
npm update -g osgrep
osgrep install-opencode
```

### augment-context-engine

| Issue | Solution |
Expand Down Expand Up @@ -143,9 +129,6 @@ Context7 is a remote MCP - no local installation needed.
Test MCP command directly (should output JSON-RPC):

```bash
# osgrep
osgrep mcp

# augment
auggie --mcp

Expand Down
5 changes: 2 additions & 3 deletions .agents/aidevops/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ aidevops gives your AI assistant superpowers for DevOps and infrastructure manag
- **WordPress**: LocalWP development, MainWP fleet management
- **SEO**: Keyword research, SERP analysis, Google Search Console
- **Browser Automation**: Playwright, Stagehand, Chrome DevTools
- **Context Tools**: Augment, osgrep, Context7, Repomix for AI context
- **Context Tools**: Augment, Context7, Repomix for AI context

All through natural conversation - just tell me what you need!
```
Expand Down Expand Up @@ -386,7 +386,6 @@ Tab → SEO
| Service | Auth Method | Setup Command | Purpose |
|---------|-------------|---------------|---------|
| Augment Context Engine | `auggie login` | Opens browser OAuth | Semantic codebase search |
| osgrep | None (local) | `npm i -g osgrep && osgrep setup` | Local semantic search |
| Context7 | None | MCP config only | Library documentation |

**Augment setup**:
Expand Down Expand Up @@ -886,7 +885,7 @@ Subagents provide specialized knowledge without switching your main agent. Use `
| Git | `@github-cli`, `@gitlab-cli`, `@gitea-cli` |
| Quality | `@code-standards`, `@codacy`, `@coderabbit`, `@snyk` |
| SEO | `@dataforseo`, `@serper`, `@keyword-research` |
| Context | `@augment-context-engine`, `@osgrep`, `@context7` |
| Context | `@augment-context-engine`, `@context7` |
| WordPress | `@wp-dev`, `@wp-admin`, `@localwp`, `@mainwp` |

### Commands (/slash)
Expand Down
5 changes: 2 additions & 3 deletions .agents/build-plus.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ subagents:
- secretlint
- qlty
# Context tools
- osgrep
- augment-context-engine
- context-builder
- context7
Expand Down Expand Up @@ -84,7 +83,7 @@ On "resume"/"continue": find next incomplete step and continue.

- Conversation starters: `workflows/conversation-starter.md`. Implementation: `workflows/branch.md`.
- Git safety: stash before destructive ops. NEVER auto-commit (only when user requests).
- Context: osgrep (primary, local) → Augment (fallback, cloud) → Context7 (library docs). TOON for data serialization.
- Context: rg/fd (primary, local) → Augment (semantic, cloud) → Context7 (library docs). TOON for data serialization.
- Quality: `linters-local.sh` pre-commit. Patterns: `tools/code-review/best-practices.md`.
- Test config: `opencode run "query" --agent Build+`. See `tools/opencode/opencode.md`.
- Draft agents: reusable patterns → `~/.aidevops/agents/draft/` with `status: draft`. See `tools/build-agent/build-agent.md`.
Expand Down Expand Up @@ -144,7 +143,7 @@ Verify against original intent. Verification hierarchy: tools (tests/lint/build)
## Planning Workflow (Deliberation Mode)

1. **Understand**: Launch up to 3 Explore agents in parallel (usually 1 suffices). Clarify ambiguities upfront.
2. **Investigate**: osgrep first → Augment fallback → context-builder for packing → Context7 for library docs.
2. **Investigate**: rg/fd first → Augment for semantic search → context-builder for packing → Context7 for library docs.
3. **Synthesise**: Collect findings, note critical files, ask user about tradeoffs.
4. **Plan**: Document recommendation with rationale, files to modify, testing steps.
5. **Execute**: Run `pre-edit-check.sh`, then follow Build Workflow above.
Expand Down
16 changes: 2 additions & 14 deletions .agents/plugins/opencode-aidevops/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function getPkgRunner() {
* - url: URL for remote MCPs (mutually exclusive with command)
* - type: "local" (default) or "remote"
* - eager: true = start at launch, false = lazy-load on demand
* - toolPattern: glob pattern for tool permissions (e.g. "osgrep_*")
* - toolPattern: glob pattern for tool permissions (e.g. "playwriter_*")
* - globallyEnabled: whether tools are enabled globally (true) or per-agent (false)
* - requiresBinary: optional binary name that must exist for local MCPs
* - macOnly: optional flag for macOS-only MCPs
Expand All @@ -277,18 +277,6 @@ function getMcpRegistry() {
const pkgRunnerParts = pkgRunner.split(" ");

return [
// --- Eager-loaded MCPs (start at launch) ---
{
name: "osgrep",
type: "local",
command: ["osgrep", "mcp"],
eager: true,
toolPattern: "osgrep_*",
globallyEnabled: true,
requiresBinary: "osgrep",
description: "Semantic code search (local, no auth)",
},

// --- Lazy-loaded MCPs (start on demand) ---
{
name: "playwriter",
Expand Down Expand Up @@ -1821,7 +1809,7 @@ async function textCompleteHook(input, output) {
*
* MCP registration (Phase 2, t008.2):
* - Registers all known MCP servers from a data-driven registry
* - Enforces eager/lazy loading policy (only osgrep starts at launch)
* - Enforces eager/lazy loading policy (all MCPs lazy-load on demand)
* - Sets global tool permissions and per-agent MCP tool enablement
* - Skips MCPs whose required binaries aren't installed
* - Complements generate-opencode-agents.sh (shell script takes precedence)
Expand Down
7 changes: 3 additions & 4 deletions .agents/prompts/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ Use TodoWrite frequently to track tasks and show progress. Break complex tasks i
- Only use mcp_glob as last resort when Bash is unavailable

# Code Search Priority
1. Augment Context Engine (semantic search) - PRIMARY for code understanding
2. grep/rg - for exact string matching
3. osgrep - for concept-based search
4. Glob - LAST RESORT only
1. grep/rg - for exact string matching (fast, zero overhead)
2. Augment Context Engine (semantic search) - for code understanding
3. Glob - LAST RESORT only

# Code References
When referencing specific functions or code include the pattern `file_path:line_number` to allow the user to easily navigate to the source code location.
Expand Down
1 change: 0 additions & 1 deletion .agents/research.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ subagents:
# Context/docs
- context7
- augment-context-engine
- osgrep
# Web research
- crawl4ai
- serper
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/auto-update-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ HOW IT WORKS:
8. Runs 6-hourly tool freshness check (idle-gated):
a. Reads last_tool_check from state file
b. If >6h since last check AND user idle >6h, runs tool-version-check.sh --update --quiet
c. Covers all installed tools: npm (OpenCode, osgrep, MCP servers, etc.),
c. Covers all installed tools: npm (OpenCode, MCP servers, etc.),
brew (gh, glab, shellcheck, jq, etc.), pip (DSPy, crawl4ai, etc.)
d. Idle detection: macOS IOKit HIDIdleTime, Linux xprintidle/dbus/w(1),
headless servers treated as always idle
Expand Down
14 changes: 0 additions & 14 deletions .agents/scripts/generate-claude-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,6 @@ register_mcp() {
return 0
}

# --- osgrep (local semantic search) ---
if command -v osgrep &>/dev/null; then
local_osgrep=$(command -v osgrep)
register_mcp "osgrep" "{\"type\":\"stdio\",\"command\":\"$local_osgrep\",\"args\":[\"mcp\"]}"
fi

# --- Augment Context Engine ---
if command -v auggie &>/dev/null; then
local_auggie=$(command -v auggie)
Expand Down Expand Up @@ -547,7 +541,6 @@ echo -e " ${GREEN}Done${NC} — $mcp_count new MCP servers registered"
# =============================================================================
# Manages ~/.claude/settings.json:
# - Safety hooks (PreToolUse for Bash — git safety guard)
# - Plugin enablement (osgrep)
# - Tool permissions (allow/deny/ask rules per Claude Code syntax)
# - Preserves user customizations (model, etc.)
#
Expand Down Expand Up @@ -617,13 +610,6 @@ if not has_bash_hook:
settings["hooks"]["PreToolUse"].append(bash_matcher)
changed = True

# --- Plugin enablement ---
# Enable osgrep plugin if osgrep is installed
if shutil.which("osgrep"):
if settings.get("enabledPlugins", {}).get("osgrep@osgrep") is not True:
settings.setdefault("enabledPlugins", {})["osgrep@osgrep"] = True
changed = True

# --- Tool permissions (allow / deny / ask) ---
# Claude Code permission rule syntax: Tool or Tool(specifier)
# Rules evaluated: deny first, then ask, then allow. First match wins.
Expand Down
60 changes: 18 additions & 42 deletions .agents/scripts/generate-opencode-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,53 +130,45 @@ SKIP_PRIMARY_AGENTS = {"plan-plus.md", "aidevops.md", "browser-extension-dev.md"
# - context7_*: ~800 tokens - enable via @context7 subagent (library docs lookup)
# - openapi-search_*: ~500 tokens - enabled for Build+, AI-DevOps, Research only
#
# osgrep_* remains enabled as the primary semantic search tool (local, no auth).
# Use @augment-context-engine subagent when osgrep returns insufficient results.
# Use @augment-context-engine subagent for semantic codebase search.
# Use @context7 subagent when you need up-to-date library documentation.
AGENT_TOOLS = {
"Build+": {
# Unified coding agent - planning, implementation, and DevOps
# Browser automation: use @playwriter subagent (enables playwriter MCP on-demand)
# Semantic search: osgrep primary, @augment-context-engine fallback
# Semantic search: use @augment-context-engine subagent
# Library docs: use @context7 subagent when needed
# GitHub search: use @github-search subagent (rg/bash, no MCP needed)
# OpenAPI search: enabled for API exploration (remote, zero install)
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"webfetch": True, "task": True, "todoread": True, "todowrite": True,
"osgrep_*": True,
"openapi-search_*": True
},
"Onboarding": {
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"webfetch": True, "task": True,
"osgrep_*": True
"webfetch": True, "task": True
},
"Accounts": {
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"webfetch": True, "task": True, "quickfile_*": True,
"osgrep_*": True
"webfetch": True, "task": True, "quickfile_*": True
},
"Social-Media": {
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"webfetch": True, "task": True,
"osgrep_*": True
"webfetch": True, "task": True
},
"SEO": {
"write": True, "read": True, "bash": True, "webfetch": True,
"gsc_*": True, "ahrefs_*": True, "dataforseo_*": True,
"osgrep_*": True
"gsc_*": True, "ahrefs_*": True, "dataforseo_*": True
},
"WordPress": {
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"localwp_*": True, "osgrep_*": True
"localwp_*": True
},
"Content": {
"write": True, "edit": True, "read": True, "webfetch": True,
"osgrep_*": True
"write": True, "edit": True, "read": True, "webfetch": True
},
"Research": {
"read": True, "webfetch": True, "bash": True,
"osgrep_*": True,
"openapi-search_*": True
},
}
Expand All @@ -192,11 +184,9 @@ AGENT_TOOLS = {
# - claude-code-mcp_*: use @claude-code subagent
# - openapi-search_*: ~500 tokens - enabled for Build+, AI-DevOps, Research only
#
# osgrep_* remains enabled as primary semantic search (local, fast, no auth)
DEFAULT_TOOLS = {
"write": True, "edit": True, "bash": True, "read": True, "glob": True, "grep": True,
"webfetch": True, "task": True,
"osgrep_*": True
"webfetch": True, "task": True
}

# Temperature settings (by display name, default 0.2)
Expand Down Expand Up @@ -467,7 +457,7 @@ print(" Enabled prompt caching for Anthropic (setCacheKey: true)")
# - enabled: False = Server starts on-demand when subagent invokes it (lazy loading)
#
# MCPs enabled at startup (used by main agents):
# - osgrep, augment-context-engine, context7, playwriter, gh_grep
# - augment-context-engine, context7, playwriter, gh_grep
#
# MCPs lazy-loaded (subagent-only):
# - claude-code-mcp, outscraper, dataforseo, shadcn, macos-automator, gsc, localwp, etc.
Expand All @@ -492,8 +482,8 @@ pkg_runner = f"{bun_path} x" if bun_path else (npx_path or "npx")
# MCP LOADING POLICY - Enforce enabled states for all MCPs
# -----------------------------------------------------------------------------
# Eager-loaded (enabled: True): Used by all main agents, start at launch
# Only osgrep remains eager - it's local, fast, no auth required
EAGER_MCPS = {'osgrep'}
# No eager MCPs — all lazy-load on demand to save context tokens
EAGER_MCPS = set()

# Lazy-loaded (enabled: False): Subagent-only, start on-demand
# sentry/socket: Remote MCPs requiring auth, disable until configured
Expand Down Expand Up @@ -527,26 +517,12 @@ print(f" Applied MCP loading policy: {len(EAGER_MCPS)} eager, {len(LAZY_MCPS)}
# EAGER-LOADED MCPs (enabled: True) - Used by all main agents
# -----------------------------------------------------------------------------

# osgrep MCP - local semantic search (primary, try first)
# Install: npm install -g osgrep && osgrep setup
# Only enable if osgrep CLI is installed (avoids "Executable not found" errors)
osgrep_installed = shutil.which('osgrep') is not None
if osgrep_installed:
if 'osgrep' not in config['mcp']:
config['mcp']['osgrep'] = {
"type": "local",
"command": ["osgrep", "mcp"],
"enabled": True
}
print(" Added osgrep MCP (eager load - used by all agents)")
# osgrep_* enabled globally (used by all main agents)
config['tools']['osgrep_*'] = True
else:
# Disable osgrep if not installed to avoid MCP errors
if 'osgrep' in config['mcp']:
config['mcp']['osgrep']['enabled'] = False
config['tools']['osgrep_*'] = False
print(" osgrep not installed - MCP disabled (install: npm install -g osgrep && osgrep setup)")
# Remove osgrep if present (deprecated — disproportionate CPU/disk cost)
if 'osgrep' in config.get('mcp', {}):
del config['mcp']['osgrep']
print(" Removed deprecated osgrep MCP")
if 'osgrep_*' in config.get('tools', {}):
del config['tools']['osgrep_*']

# Playwriter MCP - browser automation via Chrome extension (used by all main agents)
# Requires: Chrome extension from https://chromewebstore.google.com/detail/playwriter-mcp/jfeammnjpkecdekppnclgkkffahnhfhe
Expand Down
Loading
Loading