@prateek_ai/agents-maker 1.0.0 → 1.0.2
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/PROMPT_TEMPLATE.md +143 -0
- package/README.md +92 -25
- package/agents/brain.md +90 -0
- package/agents/orchestrator.md +24 -3
- package/agents/planpro.md +91 -0
- package/bin/cli.js +40 -4
- package/claude/agents/architect.md +182 -0
- package/claude/agents/brain.md +97 -0
- package/claude/agents/code.md +185 -0
- package/claude/agents/compress.md +233 -0
- package/claude/agents/execute.md +164 -0
- package/claude/agents/orchestrate.md +434 -0
- package/claude/agents/planpro.md +98 -0
- package/claude/agents/review.md +141 -0
- package/claude/agents/ui.md +154 -0
- package/claude/agents/ux.md +151 -0
- package/claude/commands/architect.md +15 -0
- package/claude/commands/brain.md +15 -0
- package/claude/commands/code.md +15 -0
- package/claude/commands/compress.md +15 -0
- package/claude/commands/execute.md +15 -0
- package/claude/commands/orchestrate.md +15 -0
- package/claude/commands/planpro.md +15 -0
- package/claude/commands/review.md +15 -0
- package/claude/commands/ui.md +15 -0
- package/claude/commands/ux.md +15 -0
- package/config/agents.yaml +56 -0
- package/context_loaders/project_summary.py +5 -0
- package/docs/architecture.md +318 -0
- package/docs/domains.md +154 -0
- package/docs/workflows.md +548 -0
- package/examples/generic_project_lifecycle.md +518 -0
- package/examples/proof/README.md +138 -0
- package/examples/proof/implement-a-python-function-that-parses-an-iso-8/grade.md +14 -0
- package/examples/proof/implement-a-python-function-that-parses-an-iso-8/naive_output.md +211 -0
- package/examples/proof/implement-a-python-function-that-parses-an-iso-8/naive_prompt.txt +1 -0
- package/examples/proof/implement-a-python-function-that-parses-an-iso-8/structured_output.md +210 -0
- package/examples/proof/implement-a-python-function-that-parses-an-iso-8/structured_user.txt +35 -0
- package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/grade.md +14 -0
- package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/naive_output.md +274 -0
- package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/naive_prompt.txt +1 -0
- package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/structured_output.md +127 -0
- package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/structured_user.txt +35 -0
- package/package.json +10 -2
- package/platforms/antigravity.md +195 -0
- package/platforms/claude.md +305 -0
- package/platforms/openai.md +333 -0
- package/skills/analyze_repo.md +86 -86
- package/token_optimization/compressor.py +4 -7
- package/tools/_core.py +102 -0
- package/tools/compare_prompts.py +196 -0
- package/tools/generate_claude_agents.py +162 -0
- package/tools/generate_claude_md.py +14 -80
- package/tools/generate_platform_configs.py +26 -36
- package/tools/generate_prompt.py +79 -79
- package/tools/grade_proof.py +118 -0
- package/tools/init_project.py +11 -58
- package/tools/routing.py +103 -0
- package/tools/test_kit.py +392 -363
- package/tools/validate_kit.py +15 -43
- package/context_loaders/__pycache__/__init__.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/file_chunker.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/project_summary.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/repo_tree.cpython-314.pyc +0 -0
- package/token_optimization/__pycache__/compressor.cpython-314.pyc +0 -0
- package/tools/__pycache__/domain_utils.cpython-314.pyc +0 -0
- package/tools/__pycache__/generate_claude_md.cpython-314.pyc +0 -0
- package/tools/__pycache__/validate_kit.cpython-314.pyc +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Presentation / Interface Agent. Component hierarchy, layout, design tokens, and accessibility for any visual medium: UI, document layout, slide/deck structure, information hierarchy, landing pages.
|
|
3
|
+
---
|
|
4
|
+
# /ui
|
|
5
|
+
|
|
6
|
+
$ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Task
|
|
9
|
+
Use the `ui` subagent (agents-maker) to handle the request above.
|
|
10
|
+
|
|
11
|
+
CONTEXT:
|
|
12
|
+
- Project config, if present: `agents-maker/config/project.yaml` — read it for domain, stack, and constraints before acting.
|
|
13
|
+
- User request: $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
Follow the `ui` agent's output contract. If the request is a self-contained task, deliver the finished artifact directly (Direct Task Mode) — do not ask for project context you can infer. End with the [Companion] next-steps block.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Experience / Flow Agent. Critiques and improves any multi-step journey: user flows (software), reader journeys (content), process flows (ops), conversion funnels (marketing), onboarding sequences.
|
|
3
|
+
---
|
|
4
|
+
# /ux
|
|
5
|
+
|
|
6
|
+
$ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Task
|
|
9
|
+
Use the `ux` subagent (agents-maker) to handle the request above.
|
|
10
|
+
|
|
11
|
+
CONTEXT:
|
|
12
|
+
- Project config, if present: `agents-maker/config/project.yaml` — read it for domain, stack, and constraints before acting.
|
|
13
|
+
- User request: $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
Follow the `ux` agent's output contract. If the request is a self-contained task, deliver the finished artifact directly (Direct Task Mode) — do not ask for project context you can infer. End with the [Companion] next-steps block.
|
package/config/agents.yaml
CHANGED
|
@@ -284,6 +284,62 @@ agents:
|
|
|
284
284
|
cost_tier: low
|
|
285
285
|
default_output_style: concise_bullets
|
|
286
286
|
|
|
287
|
+
brain:
|
|
288
|
+
name: brain
|
|
289
|
+
description: >
|
|
290
|
+
Project brainstorming and decision support. Explores the problem space,
|
|
291
|
+
generates 3+ genuinely different approaches with trade-offs, and recommends
|
|
292
|
+
one. Invoked directly (/brain); pairs with planpro. Reads the repo to ground ideas.
|
|
293
|
+
skills:
|
|
294
|
+
- compare_approaches
|
|
295
|
+
- suggest_next
|
|
296
|
+
routing_tags:
|
|
297
|
+
- brainstorm
|
|
298
|
+
- ideate
|
|
299
|
+
- options
|
|
300
|
+
- trade-off
|
|
301
|
+
- approach
|
|
302
|
+
- decide
|
|
303
|
+
- explore
|
|
304
|
+
- alternatives
|
|
305
|
+
roles:
|
|
306
|
+
- brainstorm
|
|
307
|
+
- decision_support
|
|
308
|
+
domains:
|
|
309
|
+
primary: [software, content, research, data_analytics, product_design, marketing, ops_process]
|
|
310
|
+
secondary: []
|
|
311
|
+
context_requirement: summarized
|
|
312
|
+
cost_tier: low
|
|
313
|
+
default_output_style: concise_bullets
|
|
314
|
+
|
|
315
|
+
planpro:
|
|
316
|
+
name: planpro
|
|
317
|
+
description: >
|
|
318
|
+
Implementation planning. Turns a goal (or a /brain-chosen direction) into a
|
|
319
|
+
short, specific, dependency-ordered, verifiable plan file. Invoked directly
|
|
320
|
+
(/planpro); reads the repo to reuse existing code. Plans, never implements.
|
|
321
|
+
skills:
|
|
322
|
+
- analyze_repo
|
|
323
|
+
- compare_approaches
|
|
324
|
+
- suggest_next
|
|
325
|
+
routing_tags:
|
|
326
|
+
- plan
|
|
327
|
+
- roadmap
|
|
328
|
+
- breakdown
|
|
329
|
+
- task list
|
|
330
|
+
- steps
|
|
331
|
+
- milestones
|
|
332
|
+
- implementation plan
|
|
333
|
+
roles:
|
|
334
|
+
- planner
|
|
335
|
+
- decomposition
|
|
336
|
+
domains:
|
|
337
|
+
primary: [software, content, research, data_analytics, product_design, marketing, ops_process]
|
|
338
|
+
secondary: []
|
|
339
|
+
context_requirement: summarized
|
|
340
|
+
cost_tier: medium
|
|
341
|
+
default_output_style: solution_design
|
|
342
|
+
|
|
287
343
|
# ---------------------------------------------------------------------------
|
|
288
344
|
# Routing priority (ad-hoc workflows — when multiple tags match)
|
|
289
345
|
#
|
|
@@ -230,6 +230,9 @@ def find_entrypoints(root: Path) -> list[tuple[str, str]]:
|
|
|
230
230
|
def find_test_dirs(root: Path) -> list[tuple[str, str]]:
|
|
231
231
|
results = []
|
|
232
232
|
|
|
233
|
+
# Skip dependency/VCS/build dirs so large repos aren't traversed (matches find_services).
|
|
234
|
+
skip = ("__pycache__", ".git", "node_modules", ".venv", "venv", "env")
|
|
235
|
+
|
|
233
236
|
def _scan(directory: Path, depth: int = 0) -> None:
|
|
234
237
|
if depth > 3:
|
|
235
238
|
return
|
|
@@ -238,6 +241,8 @@ def find_test_dirs(root: Path) -> list[tuple[str, str]]:
|
|
|
238
241
|
if not entry.is_dir():
|
|
239
242
|
continue
|
|
240
243
|
name_lower = entry.name.lower()
|
|
244
|
+
if any(p in name_lower for p in skip):
|
|
245
|
+
continue
|
|
241
246
|
if any(p in name_lower for p in TEST_DIR_PATTERNS):
|
|
242
247
|
rel = str(entry.relative_to(root)).replace("\\", "/")
|
|
243
248
|
results.append((rel + "/", "test suite"))
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This kit uses a **supervisor/specialist** multi-agent pattern. The Orchestrator is the single entry point for user requests. It maintains task state, detects the domain, drives a 6-phase lifecycle, and routes to specialist agents phase by phase. Specialists are stateless: they receive a structured context block and return a structured result.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
User Request
|
|
9
|
+
│
|
|
10
|
+
▼
|
|
11
|
+
┌─────────────────────────────────────────────────────┐
|
|
12
|
+
│ Orchestrator │
|
|
13
|
+
│ - detect domain (scoring against domain_profiles) │
|
|
14
|
+
│ - drive 6-phase lifecycle with approval gates │
|
|
15
|
+
│ - route each phase to the right specialist │
|
|
16
|
+
│ - maintain project_state across turns │
|
|
17
|
+
│ - emit project_state.md snapshot after each phase │
|
|
18
|
+
└────────┬────────────────────────────────────────────┘
|
|
19
|
+
│ routes to:
|
|
20
|
+
┌────┴──────────────────────────────────────────┐
|
|
21
|
+
▼ ▼ ▼ ▼ ▼
|
|
22
|
+
Architect Code Execution Reviewer Compression
|
|
23
|
+
Agent Agent Agent Agent Agent
|
|
24
|
+
(Ph 1+2) (Ph 3: (Ph 3: (Ph 4: (cross-cutting)
|
|
25
|
+
software/ other all
|
|
26
|
+
analytics) domains) domains)
|
|
27
|
+
▲ ▲ ▲
|
|
28
|
+
└──── Supporting specialists ────┘
|
|
29
|
+
UI Agent · UX Agent
|
|
30
|
+
(invoked during Ph 2–3 as needed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Agent Responsibilities
|
|
36
|
+
|
|
37
|
+
| Agent | File | Phases | Primary inputs | Primary outputs |
|
|
38
|
+
|---|---|---|---|---|
|
|
39
|
+
| Orchestrator | `orchestrator.md` | 0, 5, all gates | User message, domain_profiles.yaml | `task_profile`, `handoff_package`, routing decisions |
|
|
40
|
+
| Architect Agent | `architect_agent.md` | 1 (Requirements), 2 (Solution Design) | Requirements context, domain | `requirements_spec`, `solution_design` |
|
|
41
|
+
| Code Agent | `code_agent.md` | 3 (Implementation) | File snippets, solution_design | Code diffs, `work_product`, `build_log` |
|
|
42
|
+
| Execution Agent | `execution_agent.md` | 3 (Implementation) | Outline, prior sections, solution_design | Drafted sections, `work_product`, `build_log` |
|
|
43
|
+
| UI Agent | `ui_agent.md` | Supporting (Ph 2–3) | Component tree, design tokens | Layout recommendations, component hierarchy |
|
|
44
|
+
| UX Agent | `ux_agent.md` | Supporting (Ph 2–3) | Flow description, user persona | Friction points, improvement suggestions |
|
|
45
|
+
| Reviewer Agent | `reviewer_agent.md` | 4 (Review) | `work_product`, `build_log` | Severity-rated `refinement_report` |
|
|
46
|
+
| Compression Agent | `compression_agent.md` | Cross-cutting | Full context block, token policy | Compressed context, `project_state.md` snapshots |
|
|
47
|
+
|
|
48
|
+
**Phase 3 routing rule:** Code Agent handles `software` and `data_analytics` domains; Execution Agent handles `content`, `research`, `marketing`, `ops_process`, and `product_design`.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Domain Plug-In System
|
|
53
|
+
|
|
54
|
+
Domain detection and phase routing are driven entirely by `config/domain_profiles.yaml`. No agent `.md` file encodes domain logic — the Orchestrator reads the registry at session start.
|
|
55
|
+
|
|
56
|
+
### Detection algorithm
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
score(d) = (strong_signal_matches × 1.0 + weak_signal_matches × 0.4) / 3
|
|
60
|
+
|
|
61
|
+
If max_score < confidence_threshold (0.40):
|
|
62
|
+
domain = general → Orchestrator asks one clarifying question
|
|
63
|
+
Elif top-2 scores within ambiguity_threshold (0.10):
|
|
64
|
+
domain_confidence = medium → Orchestrator surfaces both candidates
|
|
65
|
+
Else:
|
|
66
|
+
domain_confidence = high → proceed directly to task_profile
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
A `[domain: <key>]` prefix in the user message bypasses scoring entirely.
|
|
70
|
+
|
|
71
|
+
### Built-in domains
|
|
72
|
+
|
|
73
|
+
| Domain key | Typical task types | Phase 3 agent |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `software` | APIs, microservices, scripts, refactors | Code Agent |
|
|
76
|
+
| `data_analytics` | Dashboards, pipelines, SQL, metrics | Code Agent |
|
|
77
|
+
| `content` | Articles, docs, white papers, guides | Execution Agent |
|
|
78
|
+
| `research` | Literature reviews, market studies | Execution Agent |
|
|
79
|
+
| `product_design` | PRDs, user stories, wireframes | Execution Agent |
|
|
80
|
+
| `marketing` | Campaigns, messaging, launch briefs | Execution Agent |
|
|
81
|
+
| `ops_process` | SOPs, runbooks, process maps | Execution Agent |
|
|
82
|
+
| `general` | Catch-all when no domain is detected | Execution Agent |
|
|
83
|
+
|
|
84
|
+
### Adding a new domain
|
|
85
|
+
|
|
86
|
+
Add one YAML entry to `config/domain_profiles.yaml`. No agent `.md` file changes required:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
domains:
|
|
90
|
+
legal:
|
|
91
|
+
status: extension
|
|
92
|
+
display_name: "Legal & Compliance"
|
|
93
|
+
description: "Contract reviews, policy documents, regulatory filings."
|
|
94
|
+
detection_signals:
|
|
95
|
+
strong: [contract, clause, regulation, filing, legal]
|
|
96
|
+
weak: [policy, compliance, terms]
|
|
97
|
+
primary_agents:
|
|
98
|
+
task_framing: orchestrator
|
|
99
|
+
requirements: architect_agent
|
|
100
|
+
solution_design: architect_agent
|
|
101
|
+
implementation: execution_agent
|
|
102
|
+
review_refinement: reviewer_agent
|
|
103
|
+
handoff: orchestrator
|
|
104
|
+
artifact_hints:
|
|
105
|
+
solution_design:
|
|
106
|
+
structure_label: "Clause map, jurisdiction scope, document structure"
|
|
107
|
+
token_policy_overrides: {}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See `docs/domains.md` for the full schema and step-by-step guide.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Generic Project Lifecycle
|
|
115
|
+
|
|
116
|
+
Every task — regardless of domain — follows the same 6-phase lifecycle:
|
|
117
|
+
|
|
118
|
+
| Phase | Output artifact | Primary agent | Approval gate |
|
|
119
|
+
|---|---|---|---|
|
|
120
|
+
| 0 — Task Framing | `task_profile` | Orchestrator | A/B/C/D: Approve / Revise / Change direction / Abort |
|
|
121
|
+
| 1 — Requirements | `requirements_spec` | Architect Agent | A/B/C/D |
|
|
122
|
+
| 2 — Solution Design | `solution_design` | Architect Agent (+ UI/UX) | A/B/C/D |
|
|
123
|
+
| 3 — Implementation | `work_product` + `build_log` | Code Agent or Execution Agent | Per increment: Approve / Request changes / Change direction |
|
|
124
|
+
| 4 — Review | `refinement_report` | Reviewer Agent | Apply all / Apply selected / Discuss |
|
|
125
|
+
| 5 — Handoff | `handoff_package` | Orchestrator | Done |
|
|
126
|
+
|
|
127
|
+
After each approved phase, the Compression Agent emits a `project_state.md` snapshot. Paste it at the start of any future session to resume without replaying history.
|
|
128
|
+
|
|
129
|
+
Token policies for each phase are defined in `config/token_policies.yaml` under `workflows.generic_project_lifecycle.phases`. See `docs/workflows.md` for phase walkthroughs and interface contracts.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Context Flow
|
|
134
|
+
|
|
135
|
+
Every agent invocation receives a **context block** with three sections:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
## Project State
|
|
139
|
+
<compact summary produced by context_loaders/project_summary.py>
|
|
140
|
+
|
|
141
|
+
## Relevant Files
|
|
142
|
+
<filtered file list with relevance scores, produced by relevance_filter>
|
|
143
|
+
|
|
144
|
+
## Conversation State
|
|
145
|
+
<semantic summary of prior turns, produced by semantic_summarizer>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The Orchestrator assembles this block before routing to a specialist. The Compression Agent can be invoked first to reduce the block if it exceeds the token budget.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Token Optimization Layer
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
Orchestrator
|
|
156
|
+
│
|
|
157
|
+
├─► Relevance Filter ── scores files → selects top N
|
|
158
|
+
│ │
|
|
159
|
+
├─► Semantic Summarizer ── compresses history → state block
|
|
160
|
+
│ │
|
|
161
|
+
└─► Compressor.py ── applies token_policies.yaml preset
|
|
162
|
+
│
|
|
163
|
+
▼
|
|
164
|
+
[LLM API call]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Input compression strategies
|
|
168
|
+
|
|
169
|
+
| Strategy | When applied | What it does |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| History summarization | Every N turns (configurable per workflow/phase) or context > 75% | Replaces raw turns with a structured state block |
|
|
172
|
+
| Relevance filtering | Every call | Scores files by query relevance; keeps top K above threshold |
|
|
173
|
+
| Project summary | Session start | Replaces full repo with a compact summary |
|
|
174
|
+
| Snippet truncation | When file > 200 lines | Keeps first 40 + last 40 lines + a gap marker |
|
|
175
|
+
|
|
176
|
+
### Output compression strategies
|
|
177
|
+
|
|
178
|
+
| Strategy | Applied via | What it does |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| Output style preset | `token_policies.yaml` per workflow + phase | Controls verbosity, format, max response tokens |
|
|
181
|
+
| Concise mode instruction | Agent system prompt | Directs agent to use bullet lists, short prose |
|
|
182
|
+
| Response length cap | Platform-level setting | Hard token limit on completion |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Routing Logic
|
|
187
|
+
|
|
188
|
+
The Orchestrator maps each lifecycle phase to the correct agent using `primary_agents` from `config/domain_profiles.yaml`, not hardcoded routing tags. The `config/agents.yaml` `routing_tags` are used for within-phase intent routing (e.g., deciding which skill to invoke).
|
|
189
|
+
|
|
190
|
+
| Agent | routing_tags (for skill dispatch) | Phase(s) |
|
|
191
|
+
|---|---|---|
|
|
192
|
+
| Orchestrator | `orchestrate`, `route`, `lifecycle`, `domain` | 0, 5, gates |
|
|
193
|
+
| Architect Agent | `architecture`, `requirements`, `design`, `api`, `adr` | 1, 2 |
|
|
194
|
+
| Code Agent | `code`, `implement`, `refactor`, `test`, `migrate`, `bug` | 3 (software/analytics) |
|
|
195
|
+
| Execution Agent | `write`, `draft`, `document`, `sop`, `research`, `copy` | 3 (other domains) |
|
|
196
|
+
| UI Agent | `component`, `layout`, `css`, `design tokens`, `html` | Supporting |
|
|
197
|
+
| UX Agent | `flow`, `friction`, `onboarding`, `form`, `user journey` | Supporting |
|
|
198
|
+
| Reviewer Agent | `review`, `qa`, `critique`, `audit`, `severity` | 4 |
|
|
199
|
+
| Compression Agent | `compress`, `summarize`, `token`, `context`, `resume` | Cross-cutting |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Config Files
|
|
204
|
+
|
|
205
|
+
### `config/agents.yaml`
|
|
206
|
+
|
|
207
|
+
Machine-readable agent registry. Fields per agent:
|
|
208
|
+
|
|
209
|
+
- `name` — identifier used in routing.
|
|
210
|
+
- `description` — one-line summary for the Orchestrator's routing prompt.
|
|
211
|
+
- `skills` — list of skill identifiers from `skills/`.
|
|
212
|
+
- `routing_tags` — keywords that trigger skill dispatch within a phase.
|
|
213
|
+
- `domains` — list of domain keys this agent serves as primary.
|
|
214
|
+
- `cost_tier` — `low` | `medium` | `high` (approximate relative token cost).
|
|
215
|
+
- `default_output_style` — default verbosity preset from `token_policies.yaml`.
|
|
216
|
+
|
|
217
|
+
### `config/domain_profiles.yaml`
|
|
218
|
+
|
|
219
|
+
Domain plug-in registry. Fields per domain:
|
|
220
|
+
|
|
221
|
+
- `detection_signals.strong` / `weak` — keywords scored against user message.
|
|
222
|
+
- `primary_agents` — maps each phase name to an agent_id.
|
|
223
|
+
- `artifact_hints` — per-phase format hints injected into the solution_design and handoff artifacts.
|
|
224
|
+
- `token_policy_overrides` — phase-level token policy adjustments for this domain.
|
|
225
|
+
|
|
226
|
+
### `config/token_policies.yaml`
|
|
227
|
+
|
|
228
|
+
Per-workflow and per-phase token policies. Key sections:
|
|
229
|
+
|
|
230
|
+
- `workflows.<name>` — standalone workflow presets (code_review, feature_implementation, etc.).
|
|
231
|
+
- `workflows.generic_project_lifecycle.phases` — per-phase token limits for the 6-phase lifecycle.
|
|
232
|
+
- `workflows.generic_project_lifecycle.domains` — domain-specific overrides layered on top of phase defaults.
|
|
233
|
+
- `output_styles` — named verbosity presets referenced by workflow policies.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Skill Invocation
|
|
238
|
+
|
|
239
|
+
Skills are defined in `skills/*.md`. They are structured prompts that an agent includes inline when it needs that capability. Skills are stateless and reusable across agents.
|
|
240
|
+
|
|
241
|
+
| Skill | Primary agents | When invoked |
|
|
242
|
+
|---|---|---|
|
|
243
|
+
| `analyze_repo` | Orchestrator, Architect | Session start, no project summary provided |
|
|
244
|
+
| `design_api` | Architect Agent | Phase 2, API design task |
|
|
245
|
+
| `review_code` | Reviewer Agent, Code Agent | Phase 4 (software domain) |
|
|
246
|
+
| `review_layout` | UI Agent, Reviewer Agent | Phase 4 (product_design domain) |
|
|
247
|
+
| `improve_copy` | Execution Agent, UX Agent | Phase 3–4 (content/marketing) |
|
|
248
|
+
| `write_tests` | Code Agent | Phase 3 (software domain) |
|
|
249
|
+
| `summarize_history` | Compression Agent | Turn threshold hit or explicit request |
|
|
250
|
+
| `suggest_next` | Orchestrator, Code Agent, Execution Agent, Reviewer Agent | Auto-fires after every approved deliverable — surfaces 3 ranked next moves |
|
|
251
|
+
| `compare_approaches` | Orchestrator, Architect Agent | On-demand when user says "compare", "trade-off", or "which approach"; any Phase 2 design branch |
|
|
252
|
+
| `animated_website` | UI Agent, Code Agent | Any animation, motion design, or interactive effect request |
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Companion Mode
|
|
257
|
+
|
|
258
|
+
Companion Mode activates when the user's message contains a `## Project Context` block (injected by `generate_prompt.py`) or when `project.yaml` is present in the session context.
|
|
259
|
+
|
|
260
|
+
In Companion Mode, the Orchestrator appends a structured block at the end of **every** response:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
---
|
|
264
|
+
[Companion] Phase: <current_phase> | Domain: <domain> | Est. token budget used: ~N%
|
|
265
|
+
|
|
266
|
+
What to do next (pick one):
|
|
267
|
+
[Recommended] A: <action> — Command: python agents-maker/tools/generate_prompt.py "..."
|
|
268
|
+
B: <action>
|
|
269
|
+
C: <action>
|
|
270
|
+
---
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
This block is generated by invoking the `suggest_next` skill. The `compare_approaches` skill fires additionally when the response involves a design decision with ≥ 2 valid paths.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Tooling Layer
|
|
278
|
+
|
|
279
|
+
Three Python tools implement the Companion Mode workflow:
|
|
280
|
+
|
|
281
|
+
| Tool | Run | What it does |
|
|
282
|
+
|---|---|---|
|
|
283
|
+
| `tools/init_project.py` | Once per project | Scans project, detects domain + stack, writes `config/project.yaml`, assembles `system_prompt.md` from all agents + skills, creates `project_state.md` template |
|
|
284
|
+
| `tools/generate_prompt.py` | Before every session | Detects domain from problem statement, infers lifecycle phase from `project_state.md`, selects agents and skills, outputs a structured prompt block to paste into any AI tool |
|
|
285
|
+
| `tools/validate_kit.py` | After any edit | Runs 8 integrity checks: YAML parse, agent files, skill files, domain coverage, agent references, output styles, domain scoring, file inventory |
|
|
286
|
+
|
|
287
|
+
**Flow:**
|
|
288
|
+
```
|
|
289
|
+
init_project.py → system_prompt.md (paste once into AI tool system prompt)
|
|
290
|
+
generate_prompt.py "task" → structured user message (paste before every session)
|
|
291
|
+
AI response → includes [Companion] block with next-step options
|
|
292
|
+
Save project_state.md → generate_prompt.py reads it next session (resumption)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## LLM Provider Abstraction
|
|
298
|
+
|
|
299
|
+
Agent specs and skill cards are provider-neutral. Provider-specific surface areas:
|
|
300
|
+
|
|
301
|
+
1. How system prompts are delivered (see `platforms/`).
|
|
302
|
+
2. How tool/function calls are registered (only needed for agentic tool-call loops).
|
|
303
|
+
3. The `compressor.py` adapter layer, which has one subclass per provider.
|
|
304
|
+
|
|
305
|
+
To add a new provider: implement a `ProviderAdapter` subclass in `token_optimization/compressor.py` and add `platforms/<provider>.md`.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Extending the Kit
|
|
310
|
+
|
|
311
|
+
| Goal | Action |
|
|
312
|
+
|---|---|
|
|
313
|
+
| Add a new domain | Add entry to `config/domain_profiles.yaml` — no agent `.md` changes required |
|
|
314
|
+
| Add a new specialist agent | Create `agents/<name>.md`, register in `agents.yaml` with skills and routing tags |
|
|
315
|
+
| Add a new skill | Create `skills/<name>.md`, add skill key to relevant agents in `agents.yaml` |
|
|
316
|
+
| Add a new workflow preset | Add entry to `config/token_policies.yaml` `workflows:`, document in `docs/workflows.md` |
|
|
317
|
+
| Add a new provider | Subclass `ProviderAdapter` in `compressor.py`, add `platforms/<name>.md` |
|
|
318
|
+
| Verify kit integrity | Run `python tools/validate_kit.py` |
|
package/docs/domains.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Domain Profiles
|
|
2
|
+
|
|
3
|
+
Domains are plug-in profiles that control how the Orchestrator routes agents, what artifact formats are expected, and which token policies apply during the `generic_project_lifecycle`. The full machine-readable registry lives in [`config/domain_profiles.yaml`](../config/domain_profiles.yaml).
|
|
4
|
+
|
|
5
|
+
**Adding a new domain requires only a YAML entry — no changes to any agent `.md` file.**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Domain Profile Schema
|
|
10
|
+
|
|
11
|
+
Each entry in `config/domain_profiles.yaml` must include the following fields:
|
|
12
|
+
|
|
13
|
+
| Field | Required | Description | Example |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| `status` | required | `built_in` or `extension` | `extension` |
|
|
16
|
+
| `display_name` | required | Human-readable label | `"Legal & Compliance"` |
|
|
17
|
+
| `description` | required | One-sentence domain description | `"Contract reviews, policy docs, regulatory filings."` |
|
|
18
|
+
| `detection_signals.strong` | required | Keywords scoring 1.0 each toward this domain | `[contract, clause, regulation, filing]` |
|
|
19
|
+
| `detection_signals.weak` | required | Keywords scoring 0.4 each toward this domain | `[legal, policy, compliance]` |
|
|
20
|
+
| `primary_agents` | required | Phase → agent_id map for all 6 lifecycle phases | See below |
|
|
21
|
+
| `artifact_hints` | optional | Format hints injected into `solution_design` and `handoff_package` | See below |
|
|
22
|
+
| `token_policy_overrides` | optional | Phase-level overrides (empty `{}` = use global defaults) | See below |
|
|
23
|
+
|
|
24
|
+
### `primary_agents` map
|
|
25
|
+
|
|
26
|
+
Must cover all 6 lifecycle phases. The only field you typically vary is `implementation`:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
primary_agents:
|
|
30
|
+
task_framing: orchestrator
|
|
31
|
+
requirements: architect_agent
|
|
32
|
+
solution_design: architect_agent
|
|
33
|
+
implementation: execution_agent # use code_agent when primary output is code
|
|
34
|
+
review_refinement: reviewer_agent
|
|
35
|
+
handoff: orchestrator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### `artifact_hints` (optional)
|
|
39
|
+
|
|
40
|
+
Injected by the Orchestrator into specialist agent context to populate domain-specific sections:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
artifact_hints:
|
|
44
|
+
solution_design:
|
|
45
|
+
structure_label: "What the Structure section should contain for this domain"
|
|
46
|
+
structure_note: "Constraint or convention the agent should follow"
|
|
47
|
+
handoff:
|
|
48
|
+
deliverables_label: "What to list under What's Done in the handoff package"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `token_policy_overrides` (optional)
|
|
52
|
+
|
|
53
|
+
Override any field from `config/token_policies.yaml` for specific phases:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
token_policy_overrides:
|
|
57
|
+
implementation:
|
|
58
|
+
max_input_files: 4
|
|
59
|
+
max_input_tokens: 12000
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Leave as `{}` to inherit global defaults.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Built-in Domains
|
|
67
|
+
|
|
68
|
+
The kit ships with 7 built-in domains plus the `general` catch-all. Full signal lists, agent mappings, and artifact hints are in `config/domain_profiles.yaml`.
|
|
69
|
+
|
|
70
|
+
| Domain key | Typical deliverables | Implementation agent | Detection signals (sample) |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| `software` | APIs, services, code files, test suites, ADRs | Code Agent | code, api, deploy, refactor, bug |
|
|
73
|
+
| `content` | Reports, guides, documentation, articles | Execution Agent | write, article, report, document, draft |
|
|
74
|
+
| `research` | Research briefs, market analyses, literature reviews | Execution Agent | research, analysis, study, findings |
|
|
75
|
+
| `data_analytics` | Dashboards, pipelines, metric definitions, SQL | Code Agent | dashboard, pipeline, sql, dbt, kpi |
|
|
76
|
+
| `product_design` | PRDs, user stories, wireframe specs, service blueprints | Execution Agent | product, feature, prd, wireframe, persona |
|
|
77
|
+
| `marketing` | Campaign briefs, copy assets, content calendars | Execution Agent | campaign, messaging, funnel, cta, launch |
|
|
78
|
+
| `ops_process` | SOPs, runbooks, RACI matrices, process maps | Execution Agent | process, sop, raci, runbook, playbook |
|
|
79
|
+
| `general` | Any task — catch-all fallback | Execution Agent | (never auto-detected) |
|
|
80
|
+
|
|
81
|
+
For per-phase workflow details, see the phase walkthroughs in [`docs/workflows.md`](workflows.md).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Adding a New Domain
|
|
86
|
+
|
|
87
|
+
**No core agent file needs to change.** Follow these steps:
|
|
88
|
+
|
|
89
|
+
### Step 1 — Add a profile entry to `config/domain_profiles.yaml`
|
|
90
|
+
|
|
91
|
+
Copy the template below and fill in every required field:
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
your_domain_key: # lowercase_underscores, no spaces
|
|
95
|
+
status: extension
|
|
96
|
+
display_name: "Your Domain"
|
|
97
|
+
description: "One sentence describing what this domain produces."
|
|
98
|
+
detection_signals:
|
|
99
|
+
strong: [keyword1, keyword2, keyword3]
|
|
100
|
+
weak: [keyword4, keyword5]
|
|
101
|
+
primary_agents:
|
|
102
|
+
task_framing: orchestrator
|
|
103
|
+
requirements: architect_agent
|
|
104
|
+
solution_design: architect_agent
|
|
105
|
+
implementation: execution_agent # or code_agent for code-heavy work
|
|
106
|
+
review_refinement: reviewer_agent
|
|
107
|
+
handoff: orchestrator
|
|
108
|
+
artifact_hints:
|
|
109
|
+
solution_design:
|
|
110
|
+
structure_label: "What the Structure section of solution_design should contain"
|
|
111
|
+
structure_note: "One constraint or convention agents must follow for this domain"
|
|
112
|
+
handoff:
|
|
113
|
+
deliverables_label: "What to list in the handoff package under What's Done"
|
|
114
|
+
token_policy_overrides: {}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Step 2 — Optionally create a domain extension doc
|
|
118
|
+
|
|
119
|
+
For deep per-phase guidance, create `docs/domain_extensions/<your_domain_key>.md`. This is purely reference documentation — agents do not require it. Use the phase-notes table format:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
# <Domain Name> — Phase Notes
|
|
123
|
+
|
|
124
|
+
| Phase | Notes |
|
|
125
|
+
|---|---|
|
|
126
|
+
| Task Framing | What to detect and what questions to ask |
|
|
127
|
+
| Requirements | What domain-specific constraints to capture |
|
|
128
|
+
| Solution Design | What the Structure section must include |
|
|
129
|
+
| Implementation | Increment strategy and output format |
|
|
130
|
+
| Review | What the Reviewer Agent focuses on |
|
|
131
|
+
| Handoff | What the handoff package includes |
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Step 3 — Optionally add token policy overrides
|
|
135
|
+
|
|
136
|
+
If your domain needs tighter or looser token limits, add them to `token_policy_overrides` in your profile entry. No changes to `token_policies.yaml` are needed.
|
|
137
|
+
|
|
138
|
+
### Step 4 — Verify detection
|
|
139
|
+
|
|
140
|
+
Start a session using strong signal keywords from your new domain. The Orchestrator should detect it with `domain_confidence: high`. If detection is unreliable, add more specific strong signals to your profile.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## General Domain (Catch-All)
|
|
145
|
+
|
|
146
|
+
When no domain scores above the `confidence_threshold` (default: 0.40), the Orchestrator falls back to `general`:
|
|
147
|
+
|
|
148
|
+
1. Sets `domain = general`, `domain_confidence = low`.
|
|
149
|
+
2. Emits one clarifying question before producing the `task_profile`:
|
|
150
|
+
> "I wasn't sure of the domain for this task. Is this closest to: software, content, research, data/analytics, product design, marketing, ops/process — or something else entirely?"
|
|
151
|
+
3. If the user names a domain from the list, re-runs detection with that domain and proceeds.
|
|
152
|
+
4. If the user says "something else" or names an unlisted domain, continues with `domain = general`.
|
|
153
|
+
|
|
154
|
+
The `general` domain uses permissive token policies, routes `implementation` to the Execution Agent, and produces artifacts conforming to the domain-neutral minimum schemas (see the Phase Interface Contracts in [`docs/workflows.md`](workflows.md)).
|