feat: create subagent definitions for deepagents library - #565
Merged
Conversation
…E docs - Fix index.js re-exports to use imports for getAllAgents() scope - Export TOOLS const from tools/index.js for deepAgents.js consumption - Remove unused imports (TOOL_CLASSIFICATIONS, AgentRegistry, readFileSync, codingAgentPrompt) - Add comprehensive agent definition tests (24 tests) - Update README with subagent documentation - Format test file with oxfmt
- Moved change to openspec/changes/archive/2026-07-19-create-subagent-definitions-deepagents/ - Applied spec deltas to openspec/specs/ (11 spec files updated) - +31 lines added to specs, 0 removed
Owner
Author
Implementation Audit: create-subagent-definitions-deepagentsGoal FulfillmentGoal 1: Subagent Definition FrameworkStatus: ✅ Complete
Goal 2: Eight Agents Across Three TiersStatus: ✅ Complete
Goal 3: Tool Filtering via TOOL_CLASSIFICATIONSStatus: ✅ Complete
Goal 4: Orchestrator IntegrationStatus: ✅ Complete
Goal 5: TestsStatus: ✅ Complete
Goal 6: DocumentationStatus: ✅ Complete
Spec ComplianceProposal.md
Design.md
Tasks.md
Quality CheckCode Quality
Test Coverage
Lint & Formatting
Deferred Items (Acceptable)
VerdictImplementation is complete and ready for archive. All core goals fulfilled, specs matched, tests pass, lint clean. Deferred items are justified by the deepagents library architecture. |
- agent-registry, code-review-agent, debug-agent, documentation-agent - performance-agent, research-agent, search-agent, security-audit-agent - subagent-definitions, testing-agent, tool-classification
…rience - Move Docker Quick Start to the top of Quick Start section - Add clear statement that madz is designed for containerized deployment - Prerequisites: Docker listed first, Node.js marked as optional/local dev - Installation: moved to 'Local Development' subsection - Running: Docker as recommended, local TUI/CLI as alternatives - Remove orphaned bullet points from Quick Start
- Add ORCHESTRATOR_TOOLS list in src/tools/index.js (10 tools) - Filter buildToolConfig output to orchestrator-only set - Domain-specific tools (executeCode, shell, readFile, etc.) now go to subagents only - Orchestrator keeps: clarify, compactContext, date, memory, sessionSearch, webSearch, webExtract, skillView, skillsList, scanAgents - This forces delegation to specialized subagents instead of the orchestrator doing everything itself
- Create 8 prompt files in prompts/: SEARCH.md, DEBUG.md, CODE_REVIEW.md, RESEARCH.md, TESTING.md, DOCUMENTATION.md, SECURITY_AUDIT.md, PERFORMANCE.md - Each agent definition now loads its system prompt from disk via readFileSync - Mirrors the existing pattern used by CODING.md and SYSTEM_PROMPT.md - Prompts are now editable without code changes
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implemented a full subagent definition framework for the deepagents library, adding 8 specialized agents with focused tool access and system prompts.
Changes
New Files (34 files, +1939 lines)
Agent Definitions:
src/agent/agentRegistry.js— AgentRegistry class with addAgent, getAgent, listAgents, validateAgent, clearsrc/agent/agents/— 8 agent definition files:search.js— Multi-source search with synthesisdebug.js— Error tracing and fix proposalscode-review.js— Structured code reviews with severity ratingsresearch.js— Multi-step research with source trackingtesting.js— Test generation and gap analysisdocumentation.js— Documentation updates and generationsecurity-audit.js— Security scanning and vulnerability detectionperformance.js— Performance benchmarking and optimizationsrc/agent/agents/index.js— Agent registry index with getAllAgents()Orchestrator Integration:
src/agent/deepAgents.js— Updated createDeepAgentsOrchestrator() with subagent definitions, tool filtering, and agent invocation loggingTool Classification:
src/tools/index.js— Added TOOL_CLASSIFICATIONS mapping tools to agent types, getToolsForAgentTypes() filtering function, exported TOOLS constTests:
tests/unit/agentRegistry.test.js— 16 tests for registry CRUD and validationtests/unit/agentDefinitions.test.js— 24 tests for agent structure, output formats, tool classificationDocumentation:
README.md— Added subagent documentation section with agent table and tool access mappingsOpenSpec:
openspec/changes/create-subagent-definitions-deepagents/— Full change proposal, design, tasks, and spec deltas (now archived)openspec/specs/— 11 spec files created/updated (agent-registry, code-review-agent, debug-agent, documentation-agent, performance-agent, research-agent, search-agent, security-audit-agent, subagent-definitions, testing-agent, tool-classification)Capabilities Added
subagent-definitions— Framework for defining specialized subagents with focused tool accessagent-registry— Registry pattern for loading and validating subagent definitionstool-classification— Tool filtering system that categorizes tools by agent typeTesting
Notes