Part of the BuildWorks.AI Open Source AI Tooling Ecosystem
Your AI agent command center for VS Code
Website β’ GitHub β’ Documentation β’ Report Issue
AgentHub is your central command center for AI agent workflows in VS Code. It auto-initializes a complete agent workspace with slash commands, reusable skills, and configurable rules enforcement on first activation.
Built by BuildWorks.AI β creators of SARAISE (AI-Enabled ERP) and AISTRALE (LLM Engineering Platform).
- One-click setup: Automatically creates
.agent/structure on first activation - Example commands: Pre-configured approval, review, and investigation commands
- Example skills: React best practices, testing patterns, security audit
- Comprehensive documentation: Auto-generated
.agent/README.mdexplaining structure
- Quick access: Press
Cmd+/(Mac) orCtrl+/(Windows/Linux) for command picker - Browse commands: Visual menu showing all available
.agent/commands/*.mdfiles - Instant use: Command content copied to clipboard for pasting in AI chat
- Edit mode: Quick access to open and customize command files
- Rule source: Reads rules from
.agent/rulesdirectory (supports nested folders) - Multiple formats: YAML, JSON, Markdown, and plain text rule files
- Real-time linting: Diagnostics on document open, save, and change (configurable debounce)
- Quick fixes: Automated fixes where rules define them
- Save blocking: Block file saves when errors/warnings exist (configurable)
- Build integration: CLI script for CI/CD pipelines and pre-commit hooks
- Strict mode: Multiple enforcement levels from passive to draconian
- Status bar: Shows current enforcement mode at a glance
- Path filtering: Include/exclude patterns using minimatch globs
- Language filtering: Target specific programming languages
- Workspace scanning: Command to scan entire workspace for violations
- Auto-reload: Watches
.agent/rules/**and reloads on changes - Fully configurable: All features can be enabled/disabled via settings
When you first activate the extension, it automatically creates:
.agent/
βββ rules/ # Your linting rules
βββ commands/ # Slash commands (approval, review, investigate)
β βββ approval.md
β βββ review.md
β βββ investigate.md
βββ skills/ # Reusable agent expertise
β βββ react-best-practices/
β βββ testing-patterns/
β βββ security-audit/
βββ README.md # Complete documentation
Press Cmd+/ (or Ctrl+/) to open the command picker. Select a command to copy it to your clipboard, then paste in your AI agent chat (GitHub Copilot, Cursor, Claude, etc.).
Example: Code Review
- Press
Cmd+/ - Select "review"
- Paste in chat
- Agent performs comprehensive architectural review
Create .agent/rules/example.yaml:
version: 1
rules:
- id: no-console-log
severity: warn
message: "Avoid console.log in production code"
match:
languages: [javascript, typescript]
regex: "console\\.log\\("
pathExclude: ["**/test/**", "**/*.test.ts"]
fix:
kind: replace
replaceWith: "// console.log("
- id: todo-must-have-ticket
severity: error
message: "TODO comments must reference a ticket number"
match:
regex: "TODO(?!\\(JIRA-\\d+\\))"
flags: "gi"
- id: forbidden-rbac-todo
severity: error
message: "RBAC TODOs are not allowed"
match:
regex: "TODO\\(RBAC\\)"
flags: "g"
fix:
kind: deleteCreate .agent/rules/example.json:
{
"version": 1,
"rules": [
{
"id": "no-hardcoded-secrets",
"severity": "error",
"message": "Hardcoded API keys detected",
"match": {
"regex": "(api[_-]?key|secret)[\\s]*=\\s*['\"][^'\"]{20,}['\"]",
"flags": "i"
}
}
]
}Create .agent/rules/simple-rules.md:
# Simple Rules
error: No debugger statements allowed :: debugger;
warn: Prefer const over let :: \\blet\\b
info: Consider using async/await :: \\.then\\(Format: SEVERITY: <message> :: <regex>
SEVERITY:error,warn, orinfo(defaults towarnif omitted)::separator is required- Lines starting with
#are comments
{
id: string // Unique identifier
severity: "error" | "warn" | "info"
message: string // Diagnostic message
match: {
languages?: string[] // Filter by language IDs (e.g., ["typescript", "javascript"])
regex: string // Regular expression pattern
flags?: string // Regex flags (default: "g")
pathInclude?: string[] // Include paths matching these globs
pathExclude?: string[] // Exclude paths matching these globs (takes priority)
}
fix?: { // Optional quick fix
kind: "replace" | "insert" | "delete"
replaceWith?: string // For "replace" kind
insertText?: string // For "insert" kind
position?: "start" | "end" // For "insert" kind
}
}Simple line-based format:
SEVERITY: <message> :: <regex>
Examples:
error: No console.error allowed :: console\\.error\\(
warn: Avoid var keyword :: \\bvar\\b
info: Consider using template literals :: '.*\\+.*'
| Command | Description |
|---|---|
Agent Rules: Scan Workspace |
Scan all files in workspace (max 2000 files) |
Agent Rules: Open Rules Folder |
Open/create .agent/rules folder |
Agent Rules: Enable Strict Mode |
Enable save blocking with override + reason required |
Agent Rules: Disable Strict Mode |
Switch to passive mode (diagnostics only) |
Agent Rules: Toggle Save Blocking |
Toggle save blocking on/off |
Agent Rules: Temporarily Disable |
Disable for current session only |
Passive Mode (Default)
- Shows diagnostics only
- No save blocking
- User awareness
Active Mode
- Blocks saves when errors/warnings found
- Allows override with optional reason
- Status bar shows warning icon
Strict Mode
- Blocks saves on errors
- Requires reason for override
- Recommended for team enforcement
Draconian Mode
- Blocks saves on errors
- No override allowed
- Must fix before saving
Access via Settings UI (Cmd+,) or .vscode/settings.json:
Use the CLI checker in your build pipeline:
# NPM script
npm run check-rules
# Pre-commit hook
echo "npm run check-rules" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# GitHub Actions
- name: Check Agent Rules
run: npm run check-rulesThe script exits with code 1 if violations found, failing the build.
π‘οΈ Agent Rules: Strict- Strict mode (red background)β οΈ Agent Rules: Active- Save blocking enabled (yellow)βΉοΈ Agent Rules: Passive- Diagnostics onlyπ« Agent Rules: Disabled- Temporarily disabled
The following folders are automatically excluded from scanning:
**/node_modules/****/.git/****/dist/****/build/****/out/**
Override with pathInclude in individual rules.
# Only TypeScript files in src/
match:
pathInclude: ["**/src/**/*.ts"]
# Exclude test files
match:
pathExclude: ["**/*.test.ts", "**/*.spec.ts"]
# Both include and exclude
match:
pathInclude: ["**/src/**"]
pathExclude: ["**/src/test/**"]# Replace
fix:
kind: replace
replaceWith: "// FIXED: "
# Delete
fix:
kind: delete
# Insert at start
fix:
kind: insert
insertText: "// @ts-ignore\n"
position: start
# Insert at end
fix:
kind: insert
insertText: " // TODO: review"
position: end- VS Code 1.107.0 or higher
- Node.js (for development)
This extension does not contribute any VS Code settings. All configuration is done via .agent/rules files.
- Workspace scan is capped at 2000 files for performance
- Very complex regex patterns may impact performance
- Text-based rules (Markdown/plain text) do not support quick fixes unless a clear mapping exists
npm install
npm run compilenpm run watchnpm install -g @vscode/vsce
vsce packageBuildWorks.AI builds enterprise-grade AI products with a commitment to open source innovation. We believe in democratizing AI for businesses worldwide.
- SARAISE β AI-Enabled Enterprise ERP (Apache 2.0)
- AISTRALE β LLM Engineering & Observability Platform (Apache 2.0)
- AI Agents Org β Enterprise Multi-Agent Orchestration (Enterprise)
- AgentHub β AI agent command center for VS Code (Apache 2.0)
- π Website: buildworks.ai
- πΌ LinkedIn: BuildWorks.AI
- π¦ Twitter: @Buildworks_ai
- π§ Email: info@buildworks.ai
- π» GitHub: github.com/buildworksai
Apache 2.0
Copyright Β© 2025 BuildWorks.AI (BuildFlow Consultancy Private Limited)
Licensed under the Apache License, Version 2.0. This is part of BuildWorks.AI's commitment to Open Source First β democratizing AI-powered automation for businesses worldwide.
Power your AI agent workflows with AgentHub by BuildWorks.AI!
{ // Master switch "agentRules.enabled": true, // Save blocking "agentRules.blockSaveOnErrors": false, // Block on errors "agentRules.blockSaveOnWarnings": false, // Block on warnings "agentRules.allowSaveOverride": true, // Allow override "agentRules.requireOverrideReason": false, // Require reason // Build integration "agentRules.failBuildOnErrors": false, "agentRules.failBuildOnWarnings": false, // General "agentRules.autoFix": false, // Auto-apply fixes on save "agentRules.debounceMs": 250, // Typing delay "agentRules.rulesPath": ".agent/rules", // Custom rules location "agentRules.maxFilesToScan": 2000, // Workspace scan limit "agentRules.showStatusBar": true // Show mode indicator }