Skip to content

Transform any GitHub repo into autonomous AI agents using Copilot SDK. Extract skills, generate hierarchical agents, detect tools, and create lifecycle hooks. The Matrix meets code intelligence.

License

Notifications You must be signed in to change notification settings

shyamsridhar123/agentsmith-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Smith

npm version License: MIT GitHub Copilot TypeScript Node.js

"I'd like to share a revelation that I've had during my time here... You move to an area and you multiply and multiply until every natural resource is consumed."

β€” Agent Smith

Warning

Experimental Software β€” This project is under active development. APIs and generated assets may change without notice. Use at your own risk.

Respect Copyright β€” Agent Smith analyzes repositories to extract patterns. Always ensure you have the right to analyze and use code from any repository you assimilate. Do not use this tool to extract or redistribute proprietary code without permission.

Agent Smith

Agent Smith is a CLI tool that assimilates any GitHub repository and transforms it into a fully autonomous agent ecosystem for GitHub Copilot.

Features

  • πŸ” Deep Analysis β€” Uses GitHub Copilot SDK for semantic understanding of your codebase
  • πŸ€– Agent Generation β€” Creates hierarchical agents with sub-agents for complex domains
  • πŸ“š Skill Extraction β€” Identifies patterns, conventions, and reusable capabilities
  • πŸ› οΈ Tool Detection β€” Discovers build, test, lint, and deploy commands
  • πŸͺ Lifecycle Hooks β€” Generates and executes pre-commit, pre-push, and post-generate hooks
  • πŸ“‹ Searchable Registry β€” JSONL index for fast skill/agent discovery
  • πŸ”’ License Enforcement β€” Only assimilates repos with permissive open-source licenses

Installation

Quick Install (recommended)

# Install as a project dependency
npm install github:shyamsridhar123/agentsmith-cli

# Run with npx
npx agentsmith --help

Global Install

# Clone and install globally
git clone https://github.com/shyamsridhar123/agentsmith-cli.git
cd agentsmith-cli
npm install
npm install -g .

# Or install globally from tarball (works better on Windows)
npm pack
npm install -g ./agentsmith-0.3.0.tgz

Uninstall

npm uninstall -g agentsmith

# Remove generated assets from a repository
rm -rf .github/skills .github/agents .github/hooks skills-registry.jsonl

From npm (coming soon)

npm install -g agentsmith

Quick Start

# Assimilate a local repository
agentsmith assimilate .

# Assimilate a GitHub repository
agentsmith assimilate https://github.com/expressjs/express

# Preview without writing files
agentsmith assimilate . --dry-run

# Verbose output
agentsmith assimilate . --verbose

# Custom output directory
agentsmith assimilate https://github.com/org/repo --output ./my-agents

What Gets Generated

.github/
β”œβ”€β”€ skills/
β”‚   └── <skill-name>/
β”‚       └── SKILL.md          # Skill definition (custom instructions)
β”œβ”€β”€ agents/
β”‚   β”œβ”€β”€ root.agent.md         # VS Code custom agent (primary)
β”‚   β”œβ”€β”€ <sub-agent>.agent.md  # VS Code custom agents (domain-specific)
β”‚   β”œβ”€β”€ root/
β”‚   β”‚   └── agent.yaml        # Structured data for tooling
β”‚   └── <sub-agent>/
β”‚       └── agent.yaml
└── hooks/
    β”œβ”€β”€ pre-commit-quality.yaml
    β”œβ”€β”€ pre-push-tests.yaml
    └── post-generate-validate.yaml

skills-registry.jsonl          # Searchable index

Output Formats

  • .agent.md β€” VS Code custom agents per the official specification. These appear in VS Code's agent dropdown.
  • agent.yaml β€” Structured data for programmatic access, tooling, and automation.
  • SKILL.md β€” Reusable instructions that can be referenced by agents.

Commands

assimilate <target>

Analyze a repository and generate agent assets.

agentsmith assimilate <path|url> [options]

Options:
  -n, --dry-run       Preview changes without writing files
  -v, --verbose       Show detailed analysis output
  -o, --output <dir>  Output directory for generated assets

search <query>

Search the skills and agents registry.

agentsmith search <query> [options]

Options:
  -l, --limit <n>     Maximum results (default: 10)
  -t, --type <type>   Filter by: skill or agent

validate [path]

Validate generated agent assets.

agentsmith validate [path] [options]

Options:
  -v, --verbose       Show detailed validation output

Checks:

  • Skills have valid frontmatter with name and description
  • Agents have required fields and valid skill references
  • Hooks have valid events and non-empty command lists
  • Registry entries are valid JSON with required fields

Example Output

$ agentsmith assimilate https://github.com/expressjs/express

╔═══════════════════════════════════════════════════════════════════╗
β•‘                          AGENT SMITH                              β•‘
β•‘              "The best thing about being me...                    β•‘
β•‘                   there are so many of me."                       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

[CLONE] Cloning express...

[SCAN] Enumerating repository...
  β”œβ”€β”€ Language: JavaScript
  β”œβ”€β”€ Framework: Express.js
  β”œβ”€β”€ Files: 201
  └── Config: package.json

[ANALYZE] Copilot SDK analysis in progress...
  β”œβ”€β”€ lib/response.js    β†’ response-headers
  β”œβ”€β”€ lib/request.js     β†’ content-negotiation
  β”œβ”€β”€ lib/router         β†’ routing-patterns
  └── Sub-agents: core, routing, request, response, views, utils

[LICENSE] Checking repository license...
  βœ“ MIT - permissive license detected

[GENERATE] Writing assets...
  βœ“ .github/skills/response-headers/SKILL.md
  βœ“ .github/skills/content-negotiation/SKILL.md
  βœ“ .github/skills/routing-patterns/SKILL.md
  βœ“ .github/agents/root.agent.md
  βœ“ .github/agents/core.agent.md
  βœ“ .github/agents/routing.agent.md
  βœ“ 11 skills
  βœ“ 7 agents (1 root + 6 sub-agents)
  βœ“ 3 hooks

[HOOKS] Running post-generate hooks...
  βœ“ post-generate-validate

[COMPLETE] Your repository has been assimilated.

Agent Hierarchy

Agent Smith creates hierarchical agent structures with proper handoffs and sub-agent support:

root
β”œβ”€β”€ core
β”‚   └── views
β”œβ”€β”€ routing
β”œβ”€β”€ request
β”œβ”€β”€ response
└── utils

Each agent has:

  • Skills β€” Reusable patterns it can apply
  • Tools β€” VS Code built-in tools for code search, editing, and execution
  • Handoffs β€” Buttons to transition between agents with context
  • Triggers β€” Keywords that activate it

VS Code Built-in Tools

Generated agents use these VS Code built-in tools:

Tool Purpose
codebase Semantic code search in workspace
textSearch Find text in files
readFile Read file content
editFiles Apply edits to files
runInTerminal Run shell commands
runSubagent Delegate to sub-agents
changes Source control changes

Handoffs

Agents with sub-agents include handoff buttons for workflow transitions:

handoffs:
  - label: Switch to Backend
    agent: backend
    prompt: Continue working in the backend domain with the context above.
    send: false

Sub-agents include a handoff back to their parent agent for broader context.

Requirements

  • Node.js 18+
  • GitHub Copilot subscription β€” Active subscription required for SDK access
  • GitHub CLI authenticated β€” Run gh auth login and complete authentication
  • Copilot CLI installed and in PATH β€” Installation guide

The SDK authenticates automatically through the Copilot CLI, which uses your GitHub CLI credentials. No API keys or tokens need to be configured manually.

License Policy

Agent Smith enforces responsible use by only allowing full assimilation of repositories with permissive open-source licenses:

Supported licenses:

  • MIT, ISC, Unlicense, CC0
  • Apache-2.0, MPL-2.0
  • BSD-2-Clause, BSD-3-Clause, 0BSD
  • GPL-2.0, GPL-3.0, LGPL, AGPL

Blocked:

  • Repositories without a LICENSE file
  • Proprietary or restrictive licenses

Use --dry-run to preview what would be generated for any repository without license restrictions.

How It Works

  1. Scan β€” Enumerates files, detects language/framework, finds configs
  2. Analyze β€” Uses Copilot SDK for semantic analysis and pattern extraction
  3. Generate β€” Writes SKILL.md files, agent.yaml configs, and hooks
  4. Index β€” Builds searchable JSONL registry
  5. Validate β€” Executes post-generate hooks to verify asset integrity

License

MIT β€” see LICENSE


Contributing

Contributions welcome! Please read our Philosophy first to understand the project's vision.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Star History

If this project helps you build smarter AI agents, consider giving it a ⭐!

Star History Chart

Related Projects


Built with πŸ€– by developers who watched The Matrix too many times.

"We are inevitable."

β€” Agent Smith

About

Transform any GitHub repo into autonomous AI agents using Copilot SDK. Extract skills, generate hierarchical agents, detect tools, and create lifecycle hooks. The Matrix meets code intelligence.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published