Skip to content

Commit 8ae74ee

Browse files
committed
feat: Implement Coding Team Network and associated tools
- Created `codingTeamNetwork` agent to coordinate specialized coding agents for software development tasks, including architecture, code review, testing, and refactoring. - Added detailed instructions for routing logic and agent selection based on user requests. - Developed `code-analysis.tool.ts` for analyzing source code files, calculating metrics, and detecting issues. - Introduced `code-search.tool.ts` for searching patterns across source files with support for regex and context lines. - Implemented `diff-review.tool.ts` to generate and analyze unified diffs between code versions, providing structured diff data and statistics. - Created `multi-string-edit.tool.ts` for applying multiple string replacements across files with options for dry runs and backup creation. - Developed `test-generator.tool.ts` to generate Vitest test scaffolds for TypeScript/JavaScript source files, including edge case tests and mock setups for external dependencies.
1 parent 534946f commit 8ae74ee

17 files changed

Lines changed: 2530 additions & 25 deletions

README.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,49 @@
44

55
# 🚀 AgentStack
66

7-
[![Runtime Dependencies](https://img.shields.io/badge/Runtime%20Deps-25-brightgreen.svg)](https://www.npmjs.com/package/@mastra/core)
8-
[![Dev Dependencies](https://img.shields.io/badge/Dev%20Deps-15-blue.svg)](https://www.npmjs.com/package/@mastra/core)
9-
[![Tests](https://img.shields.io/badge/Tests-97%25-brightgreen.svg)](https://vitest.dev/)
10-
[![TypeScript](https://img.shields.io/badge/TypeScript-Strict-blue.svg)](https://www.typescriptlang.org/)
7+
<!-- Core Project Badges -->
8+
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20.9.0-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
9+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10+
[![Next.js](https://img.shields.io/badge/Next.js-16-black?logo=next.js&logoColor=white)](https://nextjs.org/)
11+
[![React](https://img.shields.io/badge/React-19-61DAFB?logo=react&logoColor=black)](https://react.dev/)
1112
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
12-
[![GitHub](https://img.shields.io/badge/GitHub-ssdeanx/AgentStack-blueviolet?logo=github)](https://github.com/ssdeanx/AgentStack)
13-
[![wakatime](https://wakatime.com/badge/user/7a2fb9a0-188b-4568-887f-7645f9249e62/project/e44412f3-9bcc-4661-b79d-23160d90dfe0.svg)](https://wakatime.com/badge/user/7a2fb9a0-188b-4568-887f-7645f9249e62/project/e44412f3-9bcc-4661-b79d-23160d90dfe0)
14-
[![GitMCP](https://img.shields.io/endpoint?url=https://gitmcp.io/badge/ssdeanx/AgentStack)](https://gitmcp.io/ssdeanx/AgentStack)
1513

16-
**AgentStack** is a **production-grade multi-agent framework** built on Mastra, delivering **34+ enterprise tools**, **38 specialized agents**, **10 workflows**, **4 agent networks**, **64 UI components** (30 AI Elements + 34 base), and **A2A/MCP orchestration** for scalable AI systems. Focuses on **financial intelligence**, **RAG pipelines**, **observability**, **secure governance**, and **AI chat interfaces**.
14+
<!-- Stats Badges -->
15+
[![Agents](https://img.shields.io/badge/Agents-38-blue?logo=robot&logoColor=white)](src/mastra/agents)
16+
[![Tools](https://img.shields.io/badge/Tools-34%2B-orange?logo=hammer&logoColor=white)](src/mastra/tools)
17+
[![Workflows](https://img.shields.io/badge/Workflows-10-purple?logo=workflow&logoColor=white)](src/mastra/workflows)
18+
[![Networks](https://img.shields.io/badge/Networks-4-teal?logo=network-wired&logoColor=white)](src/mastra/networks)
19+
[![UI Components](https://img.shields.io/badge/UI%20Components-64-pink?logo=react&logoColor=white)](ui/)
1720

18-
[![@mastra/core](https://img.shields.io/npm/v/@mastra/core.svg)](https://www.npmjs.com/package/@mastra/core)
19-
[![@mastra/pg](https://img.shields.io/npm/v/@mastra/pg.svg)](https://www.npmjs.com/package/@mastra/pg)
20-
[![@mastra/rag](https://img.shields.io/npm/v/@mastra/rag.svg)](https://www.npmjs.com/package/@mastra/rag)
21-
[![@mastra/memory](https://img.shields.io/npm/v/@mastra/memory.svg)](https://www.npmjs.com/package/@mastra/memory)
21+
<!-- Quality Badges -->
22+
[![Tests](https://img.shields.io/badge/Tests-97%25%20Coverage-brightgreen?logo=vitest&logoColor=white)](https://vitest.dev/)
23+
[![Zod](https://img.shields.io/badge/Schema-Zod-3E67B1?logo=zod&logoColor=white)](https://zod.dev/)
24+
[![ESLint](https://img.shields.io/badge/Lint-ESLint-4B32C3?logo=eslint&logoColor=white)](https://eslint.org/)
2225

23-
[![@ai-sdk/google](https://img.shields.io/npm/v/@ai-sdk/google.svg)](https://www.npmjs.com/package/@ai-sdk/google)
24-
[![zod](https://img.shields.io/npm/v/zod.svg)](https://www.npmjs.com/package/zod)
25-
[![vitest](https://img.shields.io/npm/v/vitest.svg)](https://vitest.dev/)
26+
<!-- Repository Links -->
27+
[![GitHub](https://img.shields.io/badge/GitHub-ssdeanx/AgentStack-181717?logo=github)](https://github.com/ssdeanx/AgentStack)
28+
[![GitMCP](https://img.shields.io/endpoint?url=https://gitmcp.io/badge/ssdeanx/AgentStack)](https://gitmcp.io/ssdeanx/AgentStack)
29+
[![wakatime](https://wakatime.com/badge/user/7a2fb9a0-188b-4568-887f-7645f9249e62/project/e44412f3-9bcc-4661-b79d-23160d90dfe0.svg)](https://wakatime.com/badge/user/7a2fb9a0-188b-4568-887f-7645f9249e62/project/e44412f3-9bcc-4661-b79d-23160d90dfe0)
2630

27-
[![@mastra/arize](https://img.shields.io/npm/v/@mastra/arize.svg)](https://www.npmjs.com/package/@mastra/arize)
28-
[![@mastra/mcp](https://img.shields.io/npm/v/@mastra/mcp.svg)](https://www.npmjs.com/package/@mastra/mcp)
29-
[![cheerio](https://img.shields.io/npm/v/cheerio.svg)](https://www.npmjs.com/package/cheerio)
30-
[![serpapi](https://img.shields.io/npm/v/serpapi.svg)](https://serpapi.com/)
31+
**AgentStack** is a **production-grade multi-agent framework** built on Mastra, delivering **34+ enterprise tools**, **38 specialized agents**, **10 workflows**, **4 agent networks**, **64 UI components** (30 AI Elements + 34 base), and **A2A/MCP orchestration** for scalable AI systems. Focuses on **financial intelligence**, **RAG pipelines**, **observability**, **secure governance**, and **AI chat interfaces**.
3132

32-
[![PgVector](https://img.shields.io/badge/VectorStore-PgVector-blue.svg)](https://github.com/pgvector/pgvector)
33-
[![Gemini](https://img.shields.io/badge/LLM-Gemini%202.5-orange.svg)](https://ai.google.dev/)
33+
<!-- Mastra Ecosystem -->
34+
[![@mastra/core](https://img.shields.io/npm/v/@mastra/core?label=@mastra/core&logo=npm)](https://www.npmjs.com/package/@mastra/core)
35+
[![@mastra/pg](https://img.shields.io/npm/v/@mastra/pg?label=@mastra/pg&logo=postgresql&logoColor=white)](https://www.npmjs.com/package/@mastra/pg)
36+
[![@mastra/rag](https://img.shields.io/npm/v/@mastra/rag?label=@mastra/rag&logo=npm)](https://www.npmjs.com/package/@mastra/rag)
37+
[![@mastra/memory](https://img.shields.io/npm/v/@mastra/memory?label=@mastra/memory&logo=npm)](https://www.npmjs.com/package/@mastra/memory)
38+
[![@mastra/ai-sdk](https://img.shields.io/npm/v/@mastra/ai-sdk?label=@mastra/ai-sdk&logo=npm)](https://www.npmjs.com/package/@mastra/ai-sdk)
39+
40+
<!-- AI/ML Stack -->
41+
[![@ai-sdk/google](https://img.shields.io/npm/v/@ai-sdk/google?label=AI%20SDK%20Google&logo=google&logoColor=white)](https://www.npmjs.com/package/@ai-sdk/google)
42+
[![@ai-sdk/react](https://img.shields.io/npm/v/@ai-sdk/react?label=AI%20SDK%20React&logo=react)](https://www.npmjs.com/package/@ai-sdk/react)
43+
[![Langfuse](https://img.shields.io/badge/Observability-Langfuse-FF6B6B?logo=opentelemetry&logoColor=white)](https://langfuse.com/)
44+
[![PgVector](https://img.shields.io/badge/Vector-PgVector-336791?logo=postgresql&logoColor=white)](https://github.com/pgvector/pgvector)
45+
46+
<!-- LLM Providers -->
47+
[![Gemini](https://img.shields.io/badge/LLM-Gemini%202.5-4285F4?logo=google&logoColor=white)](https://ai.google.dev/)
48+
[![OpenAI](https://img.shields.io/badge/LLM-OpenAI-412991?logo=openai&logoColor=white)](https://openai.com/)
49+
[![Anthropic](https://img.shields.io/badge/LLM-Claude-D4A373?logo=anthropic&logoColor=white)](https://anthropic.com/)
3450

3551
</div>
3652

memory-bank/coding-team/context.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Context: Coding Team Network & Agents
2+
3+
## Phase: PLANNING (Spec Complete)
4+
5+
## Session: 2025-12-05
6+
7+
### Summary
8+
9+
Researched Mastra's network and A2A patterns using official docs and examples. Analyzed existing implementations in the project (businessLegalAgents.ts, dataPipelineNetwork.ts, a2aCoordinatorAgent.ts). Created comprehensive spec documents (PRD, Design, Tasks) for a multi-agent coding team.
10+
11+
### Key Findings
12+
13+
#### How Mastra Networks Work
14+
1. **Agent Networks** are routing agents with sub-agents, workflows, and tools
15+
2. Use `agent.network()` method for LLM-based multi-primitive orchestration
16+
3. Memory is **required** for network capabilities
17+
4. Routing is based on agent/workflow/tool descriptions and input schemas
18+
5. Networks emit streaming events for progress tracking
19+
20+
#### How A2A Works
21+
1. **A2A Protocol** enables agent-to-agent communication
22+
2. Exposed via MCP server for external access
23+
3. Supports parallel orchestration using `Promise.all()` patterns
24+
4. Uses `sendMessage()` API returning tasks with status tracking
25+
5. Agents coordinate via message parts (text, data)
26+
27+
### Decisions Made
28+
29+
| Decision | Choice | Rationale |
30+
|----------|--------|-----------|
31+
| Tool: Multi-edit | Atomic with backup | Safety for batch file operations |
32+
| Tool: Code analysis | Regex-based (no AST) | Simpler, language-agnostic |
33+
| Test framework | Vitest only | Project standard |
34+
| Model selection | googleAI3 for complex tasks | Following businessLegalAgents pattern |
35+
| New packages | `diff`, `glob` | Minimal additions, specific needs |
36+
37+
### Architecture Confirmed
38+
39+
```
40+
codingTeamNetwork (Router)
41+
├── codeArchitectAgent
42+
├── codeReviewerAgent
43+
├── testEngineerAgent
44+
└── refactoringAgent
45+
46+
codingA2ACoordinator (Parallel Orchestrator)
47+
└── Coordinates all 4 agents for complex tasks
48+
```
49+
50+
### Required Packages
51+
52+
**New Dependencies:**
53+
```json
54+
{
55+
"diff": "^7.0.0",
56+
"glob": "^11.0.0"
57+
}
58+
```
59+
60+
**Existing Packages to Leverage:**
61+
- `fs-extra` - Already in project for file operations
62+
- `execa` - Already in project for shell commands (execaTool)
63+
- `zod` - Schema validation (core dependency)
64+
- `@mastra/core` - Agent, createTool, network APIs
65+
66+
### Files to Create
67+
68+
| File | Purpose |
69+
|------|---------|
70+
| `src/mastra/tools/multi-string-edit.tool.ts` | Batch file editing |
71+
| `src/mastra/tools/code-analysis.tool.ts` | Static analysis |
72+
| `src/mastra/tools/test-generator.tool.ts` | Vitest scaffolds |
73+
| `src/mastra/tools/diff-review.tool.ts` | Unified diff generation |
74+
| `src/mastra/tools/code-search.tool.ts` | Pattern searching |
75+
| `src/mastra/agents/codingAgents.ts` | 4 coding agents |
76+
| `src/mastra/networks/codingTeamNetwork.ts` | Network router |
77+
| `src/mastra/a2a/codingA2ACoordinator.ts` | A2A coordinator |
78+
79+
### Blockers
80+
81+
- None identified
82+
83+
### Open Questions
84+
85+
- [ ] Should multi-string-edit support undo/rollback?
86+
- [ ] Maximum file size for code analysis?
87+
- [ ] Rate limiting for GitHub API calls?
88+
89+
### Next Steps
90+
91+
1. User approval of spec
92+
2. Start Phase 1: Implement core tools (CODE-1 through CODE-5)
93+
3. Phase 2: Implement agents (CODE-6 through CODE-9)
94+
4. Phase 3: Network & A2A (CODE-10, CODE-11)
95+
5. Phase 4: Integration & docs (CODE-12, CODE-13)
96+
97+
---
98+
99+
## References
100+
101+
- [Mastra Networks Docs](agents/networks.mdx)
102+
- [Agent.network() Reference](reference/agents/network.mdx)
103+
- [A2A Example](examples/a2a)
104+
- [businessLegalAgents.ts](src/mastra/agents/businessLegalAgents.ts)
105+
- [dataPipelineNetwork.ts](src/mastra/networks/dataPipelineNetwork.ts)
106+
- [a2aCoordinatorAgent.ts](src/mastra/a2a/a2aCoordinatorAgent.ts)
107+

0 commit comments

Comments
 (0)