AgentReverse is a hybrid system: an MCP server (universal tools) + Skills layer (proactive UX). No external LLM calls—host agent performs analysis using AgentReverse's tools.
graph TD
User([User]) --> Agent[Host Agent]
subgraph Skills[Skills Layer - Claude Code]
Observer[Workflow Observer]
Analyzer[Analysis Prompts]
Suggester[Proactive Suggester]
end
subgraph MCP[MCP Server - Universal]
Fetcher[Repo Fetcher]
Parser[Code Parser]
ManifestMgr[Manifest Manager]
Installer[Multi-Agent Installer]
end
Agent --> Skills
Skills -->|invokes| MCP
Agent -->|direct calls| MCP
Fetcher -->|clones| TempStorage[(Temp Storage)]
TempStorage --> Parser
Parser -->|AST + metadata| Agent
ManifestMgr -->|reads/writes| Manifest[agent-reverse.json]
Installer -->|writes| LocalFiles[skills/, claude.md]
Observer -->|learns| WorkflowCache[(workflow-cache.json)]
stateDiagram-v2
[*] --> Idle
Idle --> Analyzing: user invokes / proactive trigger
Analyzing --> BillOfMaterials: repo parsed
BillOfMaterials --> SelectingFeatures: user picks features
SelectingFeatures --> ConflictCheck: features selected
ConflictCheck --> Installing: no conflicts
ConflictCheck --> Synthesizing: conflicts detected
Synthesizing --> Installing: merged version ready
Installing --> Idle: success
Installing --> Error: failure
Error --> Idle: user acknowledges
Idle --> Syncing: sync invoked
Syncing --> Installing: capabilities loaded
Idle --> Auditing: audit invoked
Auditing --> Idle: report generated
| Tool | Description | Input | Output |
|---|---|---|---|
repo_fetch |
Shallow clone repo, pin commit | url, branch? |
{ path, commit, files[] } |
repo_analyze |
Parse repo for capabilities | path |
{ skills[], tools[], plugins[] } |
manifest_add |
Add capability to manifest | capability |
{ success, id } |
manifest_remove |
Remove capability | id |
{ success, filesDeleted[] } |
manifest_sync |
Reinstall all capabilities | targetAgent? |
{ installed[], failed[] } |
manifest_audit |
Scan for bloat/duplicates | paths[] |
{ duplicates[], bloat[], plan } |
manifest_check_updates |
Compare pinned vs HEAD | - | { outdated[] } |
install_capability |
Write extracted files | capability, targetAgent |
{ filesWritten[] } |
- Shallow clone via
git clone --depth 1 - Returns exact commit hash for pinning
- Stores in temp dir, auto-cleanup after session
- Engine: Tree-sitter (TypeScript, Python, Go) + regex fallback
- Extracts:
- MCP tool definitions (
server.tool(...)) - Skill markdown (
.mdfiles with frontmatter) - Function signatures + docstrings
- README install instructions
- Package dependencies
- MCP tool definitions (
File: agent-reverse.json at workspace root
{
"version": "1.0",
"targetAgent": "claude-code",
"capabilities": [
{
"id": "google-search-lite",
"source": "https://github.com/example/mcp-search",
"commit": "a1b2c3d",
"files": ["skills/search.md"],
"dependencies": [],
"status": "installed",
"extractedFrom": "tools/search.ts",
"installedAt": "2024-01-15T10:30:00Z"
}
],
"superseded": []
}Adapts output per target agent:
| Agent | Skills Location | Config File | Notes |
|---|---|---|---|
| Claude Code | .claude/skills/ |
CLAUDE.md |
Append usage to CLAUDE.md |
| Antigravity | skills/ |
agent.md |
|
| Cursor | .cursor/rules/ |
.cursorrules |
Convert to rule format |
| Custom | configurable | configurable |
When manifest_add detects duplicate ID:
- Compare source URLs and commits
- If identical → skip (already installed)
- If different → trigger synthesis mode
- Host agent analyzes both, produces merged version
- Mark old as
superseded, install merged
File: workflow-cache.json (local)
{
"patterns": [
{
"trigger": "user searches for 'how to X'",
"frequency": 5,
"lastSeen": "2024-01-15T09:00:00Z",
"suggestion": "extract X capability from repo Y"
}
],
"installedCapabilities": ["search-lite", "code-review"],
"sessionHistory": []
}Observation hooks:
- Tool invocations (which tools used frequently)
- Error patterns (repeated failures = friction)
- Search queries (indicates missing capability)
- File access patterns (which repos referenced)
Skills that guide Claude through extraction:
/agent-reverse analyze <url>
- Invoke
repo_fetch+repo_analyze - Present Bill of Materials
- Ask user which features to extract
/agent-reverse install <id>
- Pull from analyzed repo
- Run conflict check
- Install and update manifest
/agent-reverse sync
- Read manifest
- Reinstall all for current agent system
/agent-reverse audit
- Scan local skills/plugins
- Report bloat and duplicates
- Propose consolidation
Triggered when:
- Workflow cache shows repeated friction pattern
- User mentions capability that exists in known repos
- Detected overlap between installed capabilities
Output: non-intrusive suggestion, e.g.:
"Noticed you've searched for X 3 times. Repo Y has a lightweight version—want me to analyze it?"
Deliverables:
repo_fetchtoolrepo_analyzetool (basic: skill markdown, README)manifest_add/manifest_removeinstall_capability(Claude Code target only)
Test case: Extract a full plugin from community repo
Deliverables:
- Multi-agent installer (Cursor, Antigravity adapters)
manifest_synctoolmanifest_check_updates
Test case: Sync manifest to clean environment
Deliverables:
/agent-reverseskill command- Workflow observer (basic patterns)
- Proactive suggester (v1)
Test case: Observer suggests capability after repeated friction
Deliverables:
- Conflict resolution + synthesis
manifest_auditwith consolidation plans- Deep parser (Tree-sitter AST for MCP tools)
- Dependency resolution
- Source verification: Warn on non-GitHub sources, unsigned commits
- Isolated storage: Temp clones wiped post-extraction
- No remote execution: Parse and write only, never run source code
- Manifest pinning: Always pin to specific commit, warn on HEAD-only
| Component | Technology |
|---|---|
| MCP Server | TypeScript, @modelcontextprotocol/sdk |
| Parser | Tree-sitter bindings (node-tree-sitter) |
| Git ops | simple-git |
| Skills | Markdown + YAML frontmatter |
| Storage | Local JSON files |
agent-reverse/
├── src/
│ ├── server.ts # MCP server entry
│ ├── tools/
│ │ ├── fetch.ts # repo_fetch
│ │ ├── analyze.ts # repo_analyze
│ │ ├── manifest.ts # manifest_* tools
│ │ └── install.ts # install_capability
│ ├── parsers/
│ │ ├── skill.ts # skill markdown parser
│ │ ├── mcp.ts # MCP tool extractor
│ │ └── readme.ts # README instruction parser
│ └── adapters/
│ ├── claude.ts # Claude Code installer
│ ├── cursor.ts # Cursor installer
│ └── antigravity.ts # Antigravity installer
├── skills/
│ └── agent-reverse.md # Main skill file
├── package.json
└── tsconfig.json