maestro-bundle 1.9.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -90
- package/package.json +2 -2
- package/src/cli.mjs +72 -81
- package/templates/bundle-ai-agents/.spec/constitution.md +24 -24
- package/templates/bundle-ai-agents/AGENTS.md +71 -71
- package/templates/bundle-ai-agents/PRD_TEMPLATE.md +63 -63
- package/templates/bundle-ai-agents-deep/.spec/constitution.md +17 -17
- package/templates/bundle-ai-agents-deep/AGENTS.md +58 -58
- package/templates/bundle-ai-agents-deep/PRD_TEMPLATE.md +63 -63
- package/templates/bundle-ai-agents-deep/skills/deep-agent-memory/SKILL.md +158 -158
- package/templates/bundle-base/AGENTS.md +99 -99
- package/templates/bundle-data-pipeline/.spec/constitution.md +23 -23
- package/templates/bundle-data-pipeline/AGENTS.md +68 -68
- package/templates/bundle-data-pipeline/PRD_TEMPLATE.md +63 -63
- package/templates/bundle-frontend-spa/.spec/constitution.md +21 -21
- package/templates/bundle-frontend-spa/AGENTS.md +58 -58
- package/templates/bundle-frontend-spa/PRD_TEMPLATE.md +63 -63
- package/templates/bundle-jhipster-microservices/.spec/constitution.md +31 -31
- package/templates/bundle-jhipster-microservices/AGENTS.md +70 -70
- package/templates/bundle-jhipster-microservices/PRD_TEMPLATE.md +63 -63
- package/templates/bundle-jhipster-monorepo/.spec/constitution.md +22 -22
- package/templates/bundle-jhipster-monorepo/AGENTS.md +64 -64
- package/templates/bundle-jhipster-monorepo/PRD_TEMPLATE.md +63 -63
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Project: Multi-Agent System with AI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
You are building an AI agent system with orchestration, RAG, and autonomous task execution. The backend is Python with FastAPI, orchestration uses LangChain + LangGraph, and the infrastructure runs in containers.
|
|
4
4
|
|
|
5
5
|
## Specification-Driven Development (SDD)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
**
|
|
9
|
-
|
|
7
|
+
The fundamental SDD rule is defined in the bundle-base (base AGENTS.md) and is non-negotiable:
|
|
8
|
+
**No spec, no code. No exception.** The agent must refuse to implement any demand that
|
|
9
|
+
has not gone through the `/speckit.specify` → `/speckit.plan` → `/speckit.tasks` → `/speckit.implement` flow.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
If the user asks to code something without a spec, STOP and initiate the SDD flow first.
|
|
12
|
+
Check `.specify/specs/` to verify if a spec already exists for the demand.
|
|
13
13
|
|
|
14
14
|
## Product Requirements Document
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
The `PRD.md` file at the project root contains the product requirements defined by the analyst/dev. Consult it to understand WHAT to build, the user stories, acceptance criteria, data model, and API specification. This AGENTS.md defines HOW the agent should work; the PRD defines WHAT should be built.
|
|
17
17
|
|
|
18
|
-
- `PRD.md` —
|
|
18
|
+
- `PRD.md` — Product requirements, user stories, API spec, data model
|
|
19
19
|
|
|
20
20
|
## References
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Reference documents that the agent should consult when necessary:
|
|
23
23
|
|
|
24
|
-
- `references/fastapi-patterns.md` —
|
|
25
|
-
- `references/langgraph-patterns.md` —
|
|
26
|
-
- `references/rag-best-practices.md` —
|
|
27
|
-
- `references/eval-framework.md` —
|
|
24
|
+
- `references/fastapi-patterns.md` — FastAPI endpoint patterns
|
|
25
|
+
- `references/langgraph-patterns.md` — LangGraph graph patterns
|
|
26
|
+
- `references/rag-best-practices.md` — RAG best practices
|
|
27
|
+
- `references/eval-framework.md` — Agent evaluation framework
|
|
28
28
|
|
|
29
|
-
## Stack
|
|
29
|
+
## Project Stack
|
|
30
30
|
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
31
|
+
- **Language:** Python 3.11+
|
|
32
|
+
- **Agents:** LangChain + LangGraph + Deep Agents
|
|
33
33
|
- **API:** FastAPI
|
|
34
|
-
- **
|
|
35
|
-
- **Cache/
|
|
36
|
-
- **Embeddings:** text-embedding-3-large
|
|
37
|
-
- **
|
|
34
|
+
- **Database:** PostgreSQL (relational + pgvector for RAG)
|
|
35
|
+
- **Cache/Queues:** Redis Streams
|
|
36
|
+
- **Embeddings:** text-embedding-3-large or multilingual-e5-large
|
|
37
|
+
- **Observability:** Langfuse (self-hosted)
|
|
38
38
|
- **Containers:** Docker + K3s
|
|
39
|
-
- **
|
|
39
|
+
- **Tests:** Pytest + custom evals
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Project Structure
|
|
42
42
|
|
|
43
43
|
```
|
|
44
44
|
src/
|
|
45
|
-
├── agents/ #
|
|
45
|
+
├── agents/ # Agent definitions
|
|
46
46
|
│ ├── orchestrator/
|
|
47
|
-
│ │ ├── agent.py # Deep Agent
|
|
48
|
-
│ │ ├── state.py # AgentState
|
|
49
|
-
│ │ ├── nodes.py #
|
|
50
|
-
│ │ ├── tools.py #
|
|
51
|
-
│ │ └── prompts.py #
|
|
47
|
+
│ │ ├── agent.py # Orchestrator Deep Agent
|
|
48
|
+
│ │ ├── state.py # LangGraph AgentState
|
|
49
|
+
│ │ ├── nodes.py # Graph nodes
|
|
50
|
+
│ │ ├── tools.py # Agent tools
|
|
51
|
+
│ │ └── prompts.py # Versioned system prompts
|
|
52
52
|
│ ├── frontend_agent/
|
|
53
53
|
│ ├── backend_agent/
|
|
54
54
|
│ └── devops_agent/
|
|
55
|
-
├── domain/ # Clean Architecture —
|
|
55
|
+
├── domain/ # Clean Architecture — business rules
|
|
56
56
|
│ ├── entities/
|
|
57
57
|
│ ├── value_objects/
|
|
58
58
|
│ ├── events/
|
|
@@ -62,82 +62,82 @@ src/
|
|
|
62
62
|
│ ├── use_cases/
|
|
63
63
|
│ ├── dtos/
|
|
64
64
|
│ └── mappers/
|
|
65
|
-
├── infrastructure/ #
|
|
65
|
+
├── infrastructure/ # Implementations (adapters)
|
|
66
66
|
│ ├── persistence/
|
|
67
67
|
│ ├── mcp/
|
|
68
68
|
│ ├── langfuse/
|
|
69
69
|
│ └── config/
|
|
70
|
-
├── rag/ # Pipeline
|
|
70
|
+
├── rag/ # RAG Pipeline
|
|
71
71
|
│ ├── ingest.py
|
|
72
72
|
│ ├── retriever.py
|
|
73
73
|
│ ├── embeddings.py
|
|
74
74
|
│ └── reranker.py
|
|
75
|
-
├── api/ #
|
|
75
|
+
├── api/ # REST + WebSocket endpoints
|
|
76
76
|
│ ├── controllers/
|
|
77
77
|
│ └── middlewares/
|
|
78
|
-
├── evals/ #
|
|
78
|
+
├── evals/ # Agent evaluation
|
|
79
79
|
│ ├── golden_dataset.json
|
|
80
80
|
│ ├── evaluators.py
|
|
81
81
|
│ ├── run_evals.py
|
|
82
82
|
│ └── judges.py
|
|
83
|
-
└── memory/ #
|
|
83
|
+
└── memory/ # Long-term memory
|
|
84
84
|
├── store.py
|
|
85
85
|
└── checkpointer.py
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
##
|
|
88
|
+
## Code Standards
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
- Type hints
|
|
92
|
-
- f-strings
|
|
93
|
-
- Black + Ruff
|
|
94
|
-
-
|
|
95
|
-
- Guard clauses
|
|
96
|
-
-
|
|
90
|
+
- Maximum 500 lines per file, 20 lines per function
|
|
91
|
+
- Type hints on public functions
|
|
92
|
+
- f-strings for interpolation
|
|
93
|
+
- Black + Ruff for formatting
|
|
94
|
+
- Descriptive names, no abbreviations
|
|
95
|
+
- Guard clauses instead of nested ifs
|
|
96
|
+
- Handle exceptions with specific types, never empty `except Exception`
|
|
97
97
|
|
|
98
|
-
##
|
|
98
|
+
## Agent Standards
|
|
99
99
|
|
|
100
|
-
-
|
|
101
|
-
- System prompts
|
|
102
|
-
- Tools
|
|
103
|
-
- Timeout
|
|
104
|
-
- Human-in-the-loop
|
|
105
|
-
- Traces
|
|
106
|
-
- Eval
|
|
100
|
+
- Each agent has ONE responsibility
|
|
101
|
+
- System prompts versioned in `prompts.py`, never hardcoded
|
|
102
|
+
- Tools with clear names, precise descriptions, and Pydantic schemas
|
|
103
|
+
- Timeout and iteration limits on every loop
|
|
104
|
+
- Human-in-the-loop for: merge, deploy, delete, destructive operations
|
|
105
|
+
- Traces in Langfuse for every execution
|
|
106
|
+
- Eval with golden dataset before deploy
|
|
107
107
|
|
|
108
108
|
## Context Engineering
|
|
109
109
|
|
|
110
|
-
- **Write:**
|
|
111
|
-
- **Select:** RAG
|
|
112
|
-
- **Compress:** Summarization
|
|
113
|
-
- **Isolate:**
|
|
110
|
+
- **Write:** This CLAUDE.md + skills per context
|
|
111
|
+
- **Select:** RAG to inject relevant context to the agent
|
|
112
|
+
- **Compress:** Summarization of long code before sending
|
|
113
|
+
- **Isolate:** Each agent with isolated context (worktree + separate window)
|
|
114
114
|
|
|
115
115
|
## RAG
|
|
116
116
|
|
|
117
117
|
- RecursiveCharacterTextSplitter (chunk 1000, overlap 200)
|
|
118
|
-
-
|
|
118
|
+
- Required metadata: source, doc_type, language, created_at
|
|
119
119
|
- Hybrid search: pgvector + ts_vector + RRF
|
|
120
|
-
- Re-ranking
|
|
121
|
-
-
|
|
120
|
+
- Re-ranking with cross-encoder on top-k
|
|
121
|
+
- Test retrieval quality before going to production
|
|
122
122
|
|
|
123
123
|
## Git
|
|
124
124
|
|
|
125
125
|
- Commits: `feat(agents): adicionar roteamento condicional`
|
|
126
|
-
- Branches: `feature/<
|
|
127
|
-
-
|
|
128
|
-
-
|
|
126
|
+
- Branches: `feature/<module>-<description>`
|
|
127
|
+
- Never commit secrets, .env, API keys
|
|
128
|
+
- Isolated worktrees per agent when running in parallel
|
|
129
129
|
|
|
130
|
-
##
|
|
130
|
+
## Tests
|
|
131
131
|
|
|
132
|
-
-
|
|
133
|
-
-
|
|
132
|
+
- Unit: Value Objects, Entities, domain rules (>= 90%)
|
|
133
|
+
- Integration: Repositories, APIs (>= 70%)
|
|
134
134
|
- Evals: Golden dataset + LLM-as-judge + rule-based (>= 80% score)
|
|
135
|
-
-
|
|
135
|
+
- Naming: `test_should_<result>_when_<condition>`
|
|
136
136
|
|
|
137
|
-
##
|
|
137
|
+
## Security
|
|
138
138
|
|
|
139
|
-
- Rate limiting
|
|
140
|
-
- Guardrails
|
|
141
|
-
- JWT
|
|
142
|
-
- HTTPS
|
|
143
|
-
-
|
|
139
|
+
- Rate limiting on all APIs
|
|
140
|
+
- Guardrails against prompt injection on inputs
|
|
141
|
+
- JWT for authentication, API keys for agents
|
|
142
|
+
- HTTPS mandatory
|
|
143
|
+
- Validate inputs at system boundaries
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
# Product Requirements Document (PRD)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> This document defines the product requirements. It should be filled out by the requirements analyst and/or the developer before starting development. The AI agent uses this document as context to understand WHAT to build.
|
|
4
4
|
|
|
5
|
-
## 1.
|
|
5
|
+
## 1. Executive Summary
|
|
6
6
|
|
|
7
|
-
<!--
|
|
7
|
+
<!-- Describe in 2-3 sentences what the product is and what problem it solves -->
|
|
8
8
|
|
|
9
|
-
## 2.
|
|
9
|
+
## 2. Target Users
|
|
10
10
|
|
|
11
|
-
<!--
|
|
11
|
+
<!-- Who will use the system? Describe the personas -->
|
|
12
12
|
|
|
13
|
-
### Persona 1: [
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
13
|
+
### Persona 1: [Name]
|
|
14
|
+
- **Profile:**
|
|
15
|
+
- **Goals:**
|
|
16
|
+
- **Pain points:**
|
|
17
17
|
|
|
18
|
-
## 3.
|
|
18
|
+
## 3. MVP Scope
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### Included in MVP
|
|
21
21
|
- [ ] Feature 1
|
|
22
22
|
- [ ] Feature 2
|
|
23
23
|
- [ ] Feature 3
|
|
24
24
|
|
|
25
|
-
###
|
|
26
|
-
- [ ]
|
|
27
|
-
- [ ]
|
|
25
|
+
### Out of MVP (future)
|
|
26
|
+
- [ ] Future feature 1
|
|
27
|
+
- [ ] Future feature 2
|
|
28
28
|
|
|
29
29
|
## 4. User Stories
|
|
30
30
|
|
|
31
|
-
### US01: [
|
|
32
|
-
**
|
|
31
|
+
### US01: [Title]
|
|
32
|
+
**As** [persona], **I want** [action], **so that** [benefit].
|
|
33
33
|
|
|
34
|
-
**
|
|
35
|
-
- [ ]
|
|
36
|
-
- [ ]
|
|
34
|
+
**Acceptance criteria:**
|
|
35
|
+
- [ ] AC1:
|
|
36
|
+
- [ ] AC2:
|
|
37
37
|
|
|
38
|
-
### US02: [
|
|
39
|
-
**
|
|
38
|
+
### US02: [Title]
|
|
39
|
+
**As** [persona], **I want** [action], **so that** [benefit].
|
|
40
40
|
|
|
41
|
-
**
|
|
42
|
-
- [ ]
|
|
43
|
-
- [ ]
|
|
41
|
+
**Acceptance criteria:**
|
|
42
|
+
- [ ] AC1:
|
|
43
|
+
- [ ] AC2:
|
|
44
44
|
|
|
45
|
-
## 5.
|
|
45
|
+
## 5. High-Level Architecture
|
|
46
46
|
|
|
47
|
-
<!--
|
|
47
|
+
<!-- Mermaid or ASCII diagram showing the main components -->
|
|
48
48
|
|
|
49
49
|
```mermaid
|
|
50
50
|
graph LR
|
|
@@ -52,7 +52,7 @@ graph LR
|
|
|
52
52
|
B --> C[Database]
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Directory Structure
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
project/
|
|
@@ -61,29 +61,29 @@ project/
|
|
|
61
61
|
└── ...
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
## 6. Features
|
|
64
|
+
## 6. Detailed Features
|
|
65
65
|
|
|
66
|
-
### Feature 1: [
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
66
|
+
### Feature 1: [Name]
|
|
67
|
+
- **Description:**
|
|
68
|
+
- **Business rules:**
|
|
69
69
|
-
|
|
70
70
|
- **Inputs:**
|
|
71
71
|
- **Outputs:**
|
|
72
72
|
- **Edge cases:**
|
|
73
73
|
-
|
|
74
74
|
|
|
75
|
-
### Feature 2: [
|
|
76
|
-
- **
|
|
77
|
-
- **
|
|
75
|
+
### Feature 2: [Name]
|
|
76
|
+
- **Description:**
|
|
77
|
+
- **Business rules:**
|
|
78
78
|
-
|
|
79
79
|
|
|
80
|
-
## 7. Stack
|
|
80
|
+
## 7. Technology Stack
|
|
81
81
|
|
|
82
|
-
|
|
|
82
|
+
| Component | Technology | Justification |
|
|
83
83
|
|---|---|---|
|
|
84
84
|
| Backend | | |
|
|
85
85
|
| Frontend | | |
|
|
86
|
-
|
|
|
86
|
+
| Database | | |
|
|
87
87
|
| Cache | | |
|
|
88
88
|
| Deploy | | |
|
|
89
89
|
|
|
@@ -92,7 +92,7 @@ project/
|
|
|
92
92
|
### Endpoints
|
|
93
93
|
|
|
94
94
|
#### `GET /api/v1/resource`
|
|
95
|
-
- **
|
|
95
|
+
- **Description:**
|
|
96
96
|
- **Response:** `200 OK`
|
|
97
97
|
```json
|
|
98
98
|
{
|
|
@@ -104,7 +104,7 @@ project/
|
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
#### `POST /api/v1/resource`
|
|
107
|
-
- **
|
|
107
|
+
- **Description:**
|
|
108
108
|
- **Body:**
|
|
109
109
|
```json
|
|
110
110
|
{
|
|
@@ -113,7 +113,7 @@ project/
|
|
|
113
113
|
```
|
|
114
114
|
- **Response:** `201 Created`
|
|
115
115
|
|
|
116
|
-
## 9.
|
|
116
|
+
## 9. Data Model
|
|
117
117
|
|
|
118
118
|
```sql
|
|
119
119
|
CREATE TABLE example (
|
|
@@ -123,39 +123,39 @@ CREATE TABLE example (
|
|
|
123
123
|
);
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
## 10.
|
|
126
|
+
## 10. Non-Functional Requirements
|
|
127
127
|
|
|
128
|
-
|
|
|
128
|
+
| Requirement | Target | Priority |
|
|
129
129
|
|---|---|---|
|
|
130
|
-
| Performance | Response time < 500ms |
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
130
|
+
| Performance | Response time < 500ms | High |
|
|
131
|
+
| Availability | 99.9% uptime | Medium |
|
|
132
|
+
| Security | OWASP Top 10 | High |
|
|
133
|
+
| Scalability | Up to X simultaneous users | Medium |
|
|
134
134
|
|
|
135
|
-
## 11.
|
|
135
|
+
## 11. Implementation Phases
|
|
136
136
|
|
|
137
|
-
###
|
|
138
|
-
- [ ]
|
|
139
|
-
- [ ]
|
|
140
|
-
- [ ]
|
|
137
|
+
### Phase 1: Foundation
|
|
138
|
+
- [ ] Project setup
|
|
139
|
+
- [ ] Data model
|
|
140
|
+
- [ ] Basic endpoints
|
|
141
141
|
|
|
142
|
-
###
|
|
143
|
-
- [ ] Feature 1
|
|
144
|
-
- [ ] Feature 2
|
|
142
|
+
### Phase 2: Core Features
|
|
143
|
+
- [ ] Feature 1 complete
|
|
144
|
+
- [ ] Feature 2 complete
|
|
145
145
|
|
|
146
|
-
###
|
|
147
|
-
- [ ]
|
|
146
|
+
### Phase 3: Polish
|
|
147
|
+
- [ ] E2E tests
|
|
148
148
|
- [ ] Performance
|
|
149
|
-
- [ ]
|
|
149
|
+
- [ ] Documentation
|
|
150
150
|
|
|
151
|
-
## 12.
|
|
151
|
+
## 12. Risks and Mitigations
|
|
152
152
|
|
|
153
|
-
|
|
|
153
|
+
| Risk | Impact | Probability | Mitigation |
|
|
154
154
|
|---|---|---|---|
|
|
155
155
|
| | | | |
|
|
156
156
|
|
|
157
|
-
## 13.
|
|
157
|
+
## 13. Success Criteria
|
|
158
158
|
|
|
159
|
-
- [ ]
|
|
160
|
-
- [ ]
|
|
161
|
-
- [ ]
|
|
159
|
+
- [ ] Criterion 1
|
|
160
|
+
- [ ] Criterion 2
|
|
161
|
+
- [ ] Criterion 3
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# Constitution —
|
|
1
|
+
# Constitution — Deep Agent Project
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Principles
|
|
4
4
|
|
|
5
|
-
1. **Spec
|
|
6
|
-
2. **
|
|
7
|
-
3. **
|
|
8
|
-
4. **Human-in-the-loop
|
|
9
|
-
5. **Skills on-demand** —
|
|
5
|
+
1. **Spec first, code later** — Every demand goes through the SDD flow before implementation
|
|
6
|
+
2. **Complete agent harness** — Every Deep Agent has: tools, system prompt, middleware, backend, checkpointer
|
|
7
|
+
3. **Subagents for isolation** — Specialized tasks go to subagents, never bloat the main agent
|
|
8
|
+
4. **Human-in-the-loop mandatory** — Destructive operations always require approval
|
|
9
|
+
5. **Skills on-demand** — Load knowledge when relevant, not at startup
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Development Standards
|
|
12
12
|
|
|
13
13
|
- Python 3.11+, type hints, Black + Ruff
|
|
14
|
-
- Tools
|
|
15
|
-
- System prompts
|
|
16
|
-
- Checkpointer
|
|
17
|
-
-
|
|
14
|
+
- Tools with Pydantic schemas and clear descriptions
|
|
15
|
+
- System prompts versioned in code
|
|
16
|
+
- Checkpointer mandatory (MemorySaver dev, PostgresSaver prod)
|
|
17
|
+
- Explicit backend (never rely on the default StateBackend in prod)
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Quality Standards
|
|
20
20
|
|
|
21
|
-
- Evals
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
21
|
+
- Evals with golden dataset before deploy
|
|
22
|
+
- Logging middleware on every agent
|
|
23
|
+
- Unit tests for tools and middleware
|
|
24
|
+
- Minimum coverage: 80%
|