@thatix.io/context-first-agents-cli 0.1.1 → 0.2.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.
Files changed (89) hide show
  1. package/README.md +25 -12
  2. package/dist/commands/create-orchestrator.js +4 -1
  3. package/dist/commands/doctor.js +21 -5
  4. package/dist/commands/init.js +3 -1
  5. package/dist/templates/commands/en/engineer/plan.md +301 -0
  6. package/dist/templates/commands/en/engineer/pr.md +194 -0
  7. package/dist/templates/commands/en/engineer/pre-pr.md +325 -0
  8. package/dist/templates/commands/en/engineer/start.md +285 -0
  9. package/dist/templates/commands/en/engineer/work.md +256 -0
  10. package/dist/templates/commands/en/products/check.md +237 -0
  11. package/dist/templates/commands/en/products/collect.md +170 -0
  12. package/dist/templates/commands/en/products/refine.md +231 -0
  13. package/dist/templates/commands/en/products/spec.md +273 -0
  14. package/dist/templates/commands/en/quality/metrics.md +266 -0
  15. package/dist/templates/commands/en/quality/observe.md +172 -0
  16. package/dist/templates/commands/en/warm-up.md +83 -0
  17. package/dist/templates/commands/es/agents/CONTEXT-CONTRACT.md +63 -0
  18. package/dist/templates/commands/es/agents/implementer.md +27 -0
  19. package/dist/templates/commands/es/agents/integrator.md +24 -0
  20. package/dist/templates/commands/es/agents/reviewer.md +31 -0
  21. package/dist/templates/commands/es/agents/tester.md +22 -0
  22. package/dist/templates/commands/es/engineer/plan.md +335 -0
  23. package/dist/templates/commands/es/engineer/pr.md +228 -0
  24. package/dist/templates/commands/es/engineer/pre-pr.md +359 -0
  25. package/dist/templates/commands/es/engineer/start.md +318 -0
  26. package/dist/templates/commands/es/engineer/work.md +290 -0
  27. package/dist/templates/commands/es/orchestrate.md +125 -0
  28. package/dist/templates/commands/es/products/check.md +271 -0
  29. package/dist/templates/commands/es/products/collect.md +218 -0
  30. package/dist/templates/commands/es/products/refine.md +265 -0
  31. package/dist/templates/commands/es/products/spec.md +306 -0
  32. package/dist/templates/commands/es/quality/metrics.md +300 -0
  33. package/dist/templates/commands/es/quality/observe.md +205 -0
  34. package/dist/templates/commands/es/warm-up.md +83 -0
  35. package/dist/templates/commands/pt-BR/engineer/plan.md +335 -0
  36. package/dist/templates/commands/pt-BR/engineer/pr.md +228 -0
  37. package/dist/templates/commands/pt-BR/engineer/pre-pr.md +359 -0
  38. package/dist/templates/commands/pt-BR/engineer/start.md +319 -0
  39. package/dist/templates/commands/pt-BR/engineer/work.md +290 -0
  40. package/dist/templates/commands/pt-BR/products/check.md +271 -0
  41. package/dist/templates/commands/pt-BR/products/collect.md +219 -0
  42. package/dist/templates/commands/pt-BR/products/refine.md +265 -0
  43. package/dist/templates/commands/pt-BR/products/spec.md +307 -0
  44. package/dist/templates/commands/pt-BR/quality/metrics.md +300 -0
  45. package/dist/templates/commands/pt-BR/quality/observe.md +206 -0
  46. package/dist/templates/commands/pt-BR/warm-up.md +83 -0
  47. package/package.json +1 -1
  48. package/templates/commands/en/engineer/plan.md +301 -0
  49. package/templates/commands/en/engineer/pr.md +194 -0
  50. package/templates/commands/en/engineer/pre-pr.md +325 -0
  51. package/templates/commands/en/engineer/start.md +285 -0
  52. package/templates/commands/en/engineer/work.md +256 -0
  53. package/templates/commands/en/products/check.md +237 -0
  54. package/templates/commands/en/products/collect.md +170 -0
  55. package/templates/commands/en/products/refine.md +231 -0
  56. package/templates/commands/en/products/spec.md +273 -0
  57. package/templates/commands/en/quality/metrics.md +266 -0
  58. package/templates/commands/en/quality/observe.md +172 -0
  59. package/templates/commands/en/warm-up.md +83 -0
  60. package/templates/commands/es/agents/CONTEXT-CONTRACT.md +63 -0
  61. package/templates/commands/es/agents/implementer.md +27 -0
  62. package/templates/commands/es/agents/integrator.md +24 -0
  63. package/templates/commands/es/agents/reviewer.md +31 -0
  64. package/templates/commands/es/agents/tester.md +22 -0
  65. package/templates/commands/es/engineer/plan.md +335 -0
  66. package/templates/commands/es/engineer/pr.md +228 -0
  67. package/templates/commands/es/engineer/pre-pr.md +359 -0
  68. package/templates/commands/es/engineer/start.md +318 -0
  69. package/templates/commands/es/engineer/work.md +290 -0
  70. package/templates/commands/es/orchestrate.md +125 -0
  71. package/templates/commands/es/products/check.md +271 -0
  72. package/templates/commands/es/products/collect.md +218 -0
  73. package/templates/commands/es/products/refine.md +265 -0
  74. package/templates/commands/es/products/spec.md +306 -0
  75. package/templates/commands/es/quality/metrics.md +300 -0
  76. package/templates/commands/es/quality/observe.md +205 -0
  77. package/templates/commands/es/warm-up.md +83 -0
  78. package/templates/commands/pt-BR/engineer/plan.md +335 -0
  79. package/templates/commands/pt-BR/engineer/pr.md +228 -0
  80. package/templates/commands/pt-BR/engineer/pre-pr.md +359 -0
  81. package/templates/commands/pt-BR/engineer/start.md +319 -0
  82. package/templates/commands/pt-BR/engineer/work.md +290 -0
  83. package/templates/commands/pt-BR/products/check.md +271 -0
  84. package/templates/commands/pt-BR/products/collect.md +219 -0
  85. package/templates/commands/pt-BR/products/refine.md +265 -0
  86. package/templates/commands/pt-BR/products/spec.md +307 -0
  87. package/templates/commands/pt-BR/quality/metrics.md +300 -0
  88. package/templates/commands/pt-BR/quality/observe.md +206 -0
  89. package/templates/commands/pt-BR/warm-up.md +83 -0
@@ -0,0 +1,266 @@
1
+ # Quality Metrics
2
+
3
+ This command collects and analyzes quality metrics of the code and the development process.
4
+
5
+ ## 🎯 Objective
6
+
7
+ Measure and document the quality of the implementation through objective metrics:
8
+ - Test coverage
9
+ - Code complexity
10
+ - Technical debt
11
+ - Performance
12
+ - Compliance with standards
13
+
14
+ ## Configuration
15
+
16
+ Read `context-manifest.json` and `ai.properties.md` from the orchestrator to get repositories, base_path, and task_management_system.
17
+
18
+ ## 📋 Prerequisites
19
+
20
+ - Implementation completed (after `/work`)
21
+ - Tests implemented
22
+ - Build working
23
+
24
+ ## 📊 Metrics to Collect
25
+
26
+ ### 1. Test Coverage
27
+
28
+ For each modified repository:
29
+
30
+ ```bash
31
+ cd <repository>
32
+
33
+ # Run tests with coverage (examples by stack):
34
+ # Node.js: npm run test:coverage / jest --coverage
35
+ # Python: pytest --cov=src tests/
36
+ # Java: mvn jacoco:report / gradle jacocoTestReport
37
+ # Go: go test -cover ./...
38
+ # Ruby: rspec --coverage
39
+ # Rust: cargo tarpaulin
40
+ # PHP: ./vendor/bin/phpunit --coverage-html coverage/
41
+ # C#: dotnet test /p:CollectCoverage=true
42
+
43
+ # Capture results
44
+ ```
45
+
46
+ Document:
47
+ ```markdown
48
+ ## Test Coverage
49
+
50
+ ### <repo-1>
51
+ - **Total Coverage**: X%
52
+ - **Statements**: X%
53
+ - **Branches**: X%
54
+ - **Functions**: X%
55
+ - **Lines**: X%
56
+ - **Uncovered Files**: [list]
57
+
58
+ ### <repo-2>
59
+ [Same format]
60
+ ```
61
+
62
+ ### 2. Code Complexity
63
+
64
+ Analyze the cyclomatic complexity of modified files:
65
+
66
+ ```markdown
67
+ ## Code Complexity
68
+
69
+ ### Files with High Complexity
70
+ - **file1.ts**: Complexity 15 (recommended: < 10)
71
+ - **file2.ts**: Complexity 12
72
+
73
+ ### Recommendations
74
+ - [Refactoring suggestion 1]
75
+ - [Refactoring suggestion 2]
76
+ ```
77
+
78
+ ### 3. Code Quality
79
+
80
+ ```bash
81
+ # Run linting (examples by stack):
82
+ # Node.js: npm run lint / eslint .
83
+ # Python: flake8 . / pylint src/
84
+ # Java: mvn checkstyle:check
85
+ # Go: golangci-lint run
86
+ # Ruby: rubocop
87
+ # Rust: cargo clippy
88
+
89
+ # Check formatting (examples by stack):
90
+ # Node.js: prettier --check .
91
+ # Python: black --check .
92
+ # Java: mvn formatter:validate
93
+ # Go: gofmt -l .
94
+ # Ruby: rubocop --format-only
95
+ # Rust: cargo fmt --check
96
+
97
+ # Static analysis (examples by stack):
98
+ # Node.js: npm run analyze (if configured)
99
+ # Python: mypy src/ / bandit -r src/
100
+ # Java: mvn pmd:check / spotbugs:check
101
+ # Go: go vet ./...
102
+ # Ruby: brakeman (for Rails)
103
+ # Rust: cargo audit
104
+ ```
105
+
106
+ Document:
107
+ ```markdown
108
+ ## Code Quality
109
+
110
+ ### Linting
111
+ - **Errors**: 0
112
+ - **Warnings**: X
113
+ - **Justified Warnings**: [list with justifications]
114
+
115
+ ### Formatting
116
+ - **Status**: ✅ Compliant / ⚠️ Adjustments needed
117
+
118
+ ### Static Analysis
119
+ - **Critical Issues**: 0
120
+ - **Medium Issues**: X
121
+ - **Low Issues**: Y
122
+ ```
123
+
124
+ ### 4. Performance
125
+
126
+ If applicable, measure performance:
127
+
128
+ ```markdown
129
+ ## Performance
130
+
131
+ ### Benchmarks
132
+ - **Operation X**: Yms (baseline: Zms)
133
+ - **Operation Y**: Yms (baseline: Zms)
134
+
135
+ ### Applied Optimizations
136
+ - [Optimization 1 and impact]
137
+ - [Optimization 2 and impact]
138
+
139
+ ### Identified Bottlenecks
140
+ - [Bottleneck 1 and mitigation plan]
141
+ ```
142
+
143
+ ### 5. Size and Impact
144
+
145
+ ```markdown
146
+ ## Size and Impact
147
+
148
+ ### Lines of Code
149
+ - **Added**: +X lines
150
+ - **Removed**: -Y lines
151
+ - **Modified**: Z lines
152
+
153
+ ### Files
154
+ - **New**: X files
155
+ - **Modified**: Y files
156
+ - **Removed**: Z files
157
+
158
+ ### Dependencies
159
+ - **New dependencies**: [list]
160
+ - **Bundle size**: +X KB
161
+ ```
162
+
163
+ ### 6. Technical Debt
164
+
165
+ Identify technical debt introduced or resolved:
166
+
167
+ ```markdown
168
+ ## Technical Debt
169
+
170
+ ### Debt Introduced
171
+ - **Item 1**: [Description and justification]
172
+ - Severity: High / Medium / Low
173
+ - Resolution plan: [when and how to resolve]
174
+
175
+ ### Debt Resolved
176
+ - **Item 1**: [What was resolved]
177
+ - Impact: [improvement achieved]
178
+ ```
179
+
180
+ ## 📄 Metrics Report
181
+
182
+ Create `./.sessions/<ISSUE-ID>/metrics.md`:
183
+
184
+ ```markdown
185
+ # Metrics Report - [ISSUE-ID]
186
+
187
+ **Date**: [date/time]
188
+ **Repositories**: [list]
189
+
190
+ ## Executive Summary
191
+
192
+ - **Test Coverage**: X% (goal: Y%)
193
+ - **Code Quality**: ✅ / ⚠️ / ❌
194
+ - **Performance**: ✅ / ⚠️ / ❌
195
+ - **Technical Debt**: Low / Medium / High
196
+
197
+ ## Detailed Metrics
198
+
199
+ [Include all sections above]
200
+
201
+ ## Comparison with Baseline
202
+
203
+ | Metric | Before | After | Variation |
204
+ |--------|--------|-------|-----------|
205
+ | Coverage | X% | Y% | +Z% |
206
+ | Average Complexity | X | Y | +Z |
207
+ | Bundle Size | X KB | Y KB | +Z KB |
208
+
209
+ ## Recommended Actions
210
+
211
+ 1. [Action 1 - high priority]
212
+ 2. [Action 2 - medium priority]
213
+ 3. [Action 3 - low priority]
214
+
215
+ ## Approval for Merge
216
+
217
+ - [ ] Test coverage >= goal
218
+ - [ ] No critical quality issues
219
+ - [ ] Performance within requirements
220
+ - [ ] Technical debt documented and approved
221
+ ```
222
+
223
+ ## 🎯 Quality Goals
224
+
225
+ If the project has goals defined in metaspecs, validate:
226
+
227
+ ```markdown
228
+ ## Validation against Goals
229
+
230
+ ### Project Goals
231
+ - **Minimum coverage**: 80%
232
+ - **Maximum complexity**: 10
233
+ - **Performance**: < 100ms
234
+
235
+ ### Status
236
+ - Coverage: ✅ 85% (goal: 80%)
237
+ - Complexity: ⚠️ 12 (goal: 10) - Justified
238
+ - Performance: ✅ 85ms (goal: 100ms)
239
+ ```
240
+
241
+ ## 🚨 Alerts
242
+
243
+ If any metric is out of acceptable range:
244
+ 1. 🛑 **DOCUMENT** the issue
245
+ 2. 💬 **ALERT** the user
246
+ 3. 🔧 **PROPOSE** corrective actions
247
+ 4. ⏸️ **CONSIDER** blocking the merge until resolution
248
+
249
+ ---
250
+
251
+ **Provided arguments**:
252
+
253
+ ```
254
+ #$ARGUMENTS
255
+ ```
256
+
257
+ ---
258
+
259
+ ## 🎯 Outcome
260
+
261
+ After running this command, you will have:
262
+ - Complete metrics report
263
+ - Comparison with baseline and goals
264
+ - Identification of quality issues
265
+ - Recommendations for actions
266
+ - Objective basis for merge approval
@@ -0,0 +1,172 @@
1
+ # Decision Observability
2
+
3
+ This command records important decisions made during development, creating an auditable log for explainability and traceability.
4
+
5
+ ## 🎯 Objective
6
+
7
+ Create a structured record of technical and product decisions, ensuring:
8
+ - **Explainability**: Why each decision was made
9
+ - **Traceability**: Which sources (PRD, metaspecs, ADRs) supported the decision
10
+ - **Audit**: Complete history of choices for future review
11
+ - **Learning**: Documentation of trade-offs and alternatives considered
12
+
13
+ **IMPORTANT**: This command DOES NOT generate new decisions. It only RECORDS decisions that have already been made during the development process.
14
+
15
+ ## Configuration
16
+
17
+ Read `context-manifest.json` and `ai.properties.md` from the orchestrator to get repositories, base_path, and task_management_system.
18
+
19
+ ## 📋 Prerequisites
20
+
21
+ - Have executed at least one of the commands that generate decisions:
22
+ - `/spec` - generates PRD with product decisions
23
+ - `/plan` - generates plan.md with technical decisions
24
+ - `/work` - implementation generates decisions during development
25
+
26
+ ## 🔍 Observation Process
27
+
28
+ ### 1. Identify Relevant Decisions
29
+
30
+ Analyze the session files (`./.sessions/<ISSUE-ID>/`) to identify decisions:
31
+
32
+ **After `/spec`** - Product Decisions:
33
+ - Read `./.sessions/<ISSUE-ID>/prd.md`
34
+ - Identify decisions in:
35
+ - Scope (what is included/excluded in the feature)
36
+ - Personas served (who is the target audience)
37
+ - Success metrics (how to measure results)
38
+ - Non-functional requirements (performance, accessibility)
39
+ - Constraints and trade-offs
40
+
41
+ **After `/plan`** - Technical Decisions:
42
+ - Read `./.sessions/<ISSUE-ID>/plan.md`
43
+ - Identify decisions in:
44
+ - Component/module architecture
45
+ - Choice of libraries or tools
46
+ - Implementation patterns
47
+ - Data structure
48
+ - Testing strategy
49
+
50
+ **During `/work`** - Implementation Decisions:
51
+ - Read `./.sessions/<ISSUE-ID>/work.md`
52
+ - Identify decisions in:
53
+ - Refactorings performed
54
+ - Approach changes
55
+ - Applied optimizations
56
+ - Edge case handling
57
+
58
+ ### 2. Document Each Decision
59
+
60
+ For each identified decision, document:
61
+
62
+ ```markdown
63
+ ## Decision: [Clear Title]
64
+
65
+ **Context**: [Why do we need to decide this? What is the problem or need?]
66
+
67
+ **Options Considered**:
68
+ 1. **Option A**: [Description]
69
+ - Pros: [advantages]
70
+ - Cons: [disadvantages]
71
+ 2. **Option B**: [Description]
72
+ - Pros: [advantages]
73
+ - Cons: [disadvantages]
74
+
75
+ **Decision**: [Chosen option]
76
+
77
+ **Justification**: [Why did we choose this option? Which criteria were most important?]
78
+
79
+ **Sources**:
80
+ - [PRD section X]
81
+ - [Metaspec Y]
82
+ - [ADR-00Z]
83
+
84
+ **Accepted Trade-offs**: [Which disadvantages did we consciously accept?]
85
+
86
+ **Reversibility**: Easy / Medium / Hard
87
+
88
+ **Date**: [decision date]
89
+ ```
90
+
91
+ ### 3. Create Decision Log
92
+
93
+ Save in `./.sessions/<ISSUE-ID>/decisions.md`:
94
+
95
+ ```markdown
96
+ # Decision Log - [ISSUE-ID]
97
+
98
+ ## Summary
99
+ [Brief summary of the main decisions made in this feature]
100
+
101
+ ## Product Decisions
102
+
103
+ ### [Decision 1]
104
+ [As per template above]
105
+
106
+ ### [Decision 2]
107
+ [As per template above]
108
+
109
+ ## Technical Decisions
110
+
111
+ ### [Decision 3]
112
+ [As per template above]
113
+
114
+ ### [Decision 4]
115
+ [As per template above]
116
+
117
+ ## Implementation Decisions
118
+
119
+ ### [Decision 5]
120
+ [As per template above]
121
+
122
+ ## Lessons Learned
123
+ - [Lesson 1]
124
+ - [Lesson 2]
125
+
126
+ ## Pending Decisions
127
+ - [Decision that still needs to be made]
128
+ ```
129
+
130
+ ## 📊 Impact Analysis
131
+
132
+ For critical decisions, document the impact:
133
+
134
+ ```markdown
135
+ ## Impact Analysis
136
+
137
+ **Affected Repositories**: [list]
138
+
139
+ **Impacted Components**: [list]
140
+
141
+ **Created Dependencies**: [list]
142
+
143
+ **Introduced Risks**: [list]
144
+
145
+ **Applied Mitigations**: [list]
146
+ ```
147
+
148
+ ## 🔄 Decision Review
149
+
150
+ Periodically review the decisions made:
151
+ - Do they still make sense?
152
+ - Have the trade-offs proven correct?
153
+ - Are there learnings to document?
154
+ - Does any decision need to be reversed?
155
+
156
+ ---
157
+
158
+ **Provided arguments**:
159
+
160
+ ```
161
+ #$ARGUMENTS
162
+ ```
163
+
164
+ ---
165
+
166
+ ## 🎯 Outcome
167
+
168
+ After running this command, you will have:
169
+ - Complete decision log in `./.sessions/<ISSUE-ID>/decisions.md`
170
+ - Traceability of every choice made
171
+ - Documentation for future reference
172
+ - Basis for ADRs (if decisions are architectural)
@@ -0,0 +1,83 @@
1
+ # Warm-up — Context Loading (spec indexes for RAG)
2
+
3
+ Prepares the environment by loading the **spec indexes** into a navigable context map.
4
+ The goal is NOT to dump the specs into context, but to load the **indexes** so later
5
+ commands know **where to look** for each piece of information, on demand.
6
+
7
+ **Arguments**: `#$ARGUMENTS`
8
+
9
+ ---
10
+
11
+ ## 1. Load configuration
12
+
13
+ Read from the orchestrator:
14
+ - **`context-manifest.json`** — `repositories[]` (id, role, hints), and the
15
+ `orchestration` block (especially `indexes`).
16
+ - **`ai.properties.md`** — `base_path`, `task_management_system`.
17
+
18
+ Locate the specs repo: the one with `role: "metaspecs"` (or `"specs-provider"`).
19
+
20
+ ## 2. Discover the indexes (dynamic — requires no fixed file)
21
+
22
+ Build the list of indexes to load, in this priority order, **skipping whatever doesn't exist**:
23
+
24
+ 1. Every path in the manifest's `orchestration.indexes` (if defined).
25
+ 2. If none are defined, or to complement, **discover** indexes in the specs repo:
26
+ - look for `index.md` / `INDEX.md` under `{base_path}/{metaspecs-id}/specs/` and
27
+ subfolders (e.g. `specs/index.md`, `specs/technical/index.md`,
28
+ `specs/business/index.md`, `specs/business/features/index.md`).
29
+ 3. Also include, **if they exist**, each repository's `context[]` files from the manifest.
30
+
31
+ > Degrade gracefully: if an expected index is missing, **just note it and continue**.
32
+ > Never fail the warm-up because a specific file is absent.
33
+
34
+ ## 3. Build the Context Map (the warm-up's output)
35
+
36
+ Read ONLY the discovered indexes (not the documents they point to). From them, assemble
37
+ and present a **RAG map** — the project's "routing table":
38
+
39
+ ```
40
+ ## Context Map (RAG)
41
+
42
+ ### Loaded indexes
43
+ - specs/index.md → navigation root
44
+ - specs/technical/index.md → architecture, API, ADRs, conventions
45
+ - specs/business/index.md → personas, journey, strategy
46
+ - ...(only the ones that exist)
47
+
48
+ ### Where to look, on demand
49
+ | Need | Consult (via index) |
50
+ |-------------------------------|--------------------------------------|
51
+ | Architecture / decisions | technical/index.md → ARCHITECTURE / ADRs |
52
+ | API contract | technical/index.md → API_SPECIFICATION |
53
+ | Business rules / feature | business/index.md → features/... |
54
+ | Code conventions | technical/index.md → code guide |
55
+
56
+ ### Repositories (from the manifest)
57
+ - <repo-id> [role] — hints: ...
58
+ ```
59
+
60
+ If an index references documents that don't exist on disk, mark them as
61
+ `(referenced, missing)` — that signals an incomplete spec, not a warm-up error.
62
+
63
+ ## 4. Verify repositories and session
64
+
65
+ - For each repo in the manifest, confirm it exists at `{base_path}/{repo-id}/`
66
+ (do not read README or code now — that's on demand).
67
+ - If an ISSUE-ID was passed, check `.sessions/<ISSUE-ID>/`.
68
+
69
+ ## 5. How later commands use this
70
+
71
+ Commands like `/spec`, `/orchestrate` and the agents must NOT scan the repo blindly.
72
+ They should: consult the Context Map → open the relevant index → follow the link to the
73
+ specific document. The index is what optimizes RAG: load little, navigate precisely.
74
+
75
+ ## 6. Jidoka principle
76
+
77
+ If you detect a structural problem (no index found, specs-provider missing):
78
+ **STOP**, describe what's missing, and suggest how to fix it (e.g. create `specs/index.md`
79
+ or fill `orchestration.indexes`). Do not invent context.
80
+
81
+ ---
82
+
83
+ **Status**: Indexes loaded and Context Map built. Awaiting the next command.
@@ -0,0 +1,63 @@
1
+ # Contrato de Contexto (forma)
2
+
3
+ Todo agente efímero se spawnea con un contrato. Este es exactamente el objeto que el
4
+ Orquestador compila por nodo y pega en el prompt del subagente. Es lo que mantiene el
5
+ contexto de cada agente **pequeño, acotado y auditable** — el núcleo de la arquitectura.
6
+
7
+ ```json
8
+ {
9
+ "agentId": "agent-w001",
10
+ "archetype": "implementer",
11
+ "objective": "<objetivo específico y acotado de este worker>",
12
+ "repository": "<repo-id o null para workers de sesión>",
13
+ "read": [
14
+ { "type": "index", "path": "../metaspecs/specs/index.md", "reason": "router de contexto" },
15
+ { "type": "hint", "path": "../metaspecs/specs/technical/API_SPECIFICATION.md", "reason": "hint del repo" }
16
+ ],
17
+ "mayDiscover": [
18
+ "referencias alcanzables desde los índices de arriba",
19
+ "archivos de este repositorio necesarios para el objetivo"
20
+ ],
21
+ "mustNotAssume": [
22
+ "reglas de negocio no dichas",
23
+ "contratos externos no indexados",
24
+ "requisitos ausentes en la spec aprobada"
25
+ ],
26
+ "writeBoundary": ["worktree asignado del <repo-id>"],
27
+ "limits": { "policy": "select-do-not-dump", "maxFiles": 20 },
28
+ "return": ["summary", "changes", "evidence", "tests", "unresolved", "confidence"]
29
+ }
30
+ ```
31
+
32
+ ## Reglas que el Orquestador debe garantizar al compilar un contrato
33
+
34
+ - `read` incluye TODOS los `orchestration.indexes` más el `context[]` del repo — pero sólo
35
+ rutas que realmente existen en disco. Descarta el resto silenciosamente.
36
+ - Workers de sesión (integrator, tester, reviewer) tienen `repository: null` y
37
+ `writeBoundary: ["sólo artefactos de la sesión"]`.
38
+ - Nunca expandas `read` a "el repo entero". El descubrimiento está permitido
39
+ (`mayDiscover`), pero parte de los índices, no de un volcado ciego de directorio.
40
+ - El contrato es el ÚNICO contexto de proyecto que recibe un subagente además del objetivo.
41
+ No pegues la conversación entera en los subagentes.
42
+
43
+ ## La forma de retorno que todo agente debe producir
44
+
45
+ ```markdown
46
+ ### summary
47
+ <un párrafo: qué se hizo>
48
+
49
+ ### changes
50
+ <archivos creados/modificados, por repo>
51
+
52
+ ### evidence
53
+ <comandos corridos, salidas, links>
54
+
55
+ ### tests
56
+ <tests agregados/corridos y su resultado>
57
+
58
+ ### unresolved
59
+ <preguntas, conflictos de spec, stops Jidoka — o "ninguno">
60
+
61
+ ### confidence
62
+ <low | medium | high> + una línea de por qué
63
+ ```
@@ -0,0 +1,27 @@
1
+ # Arquetipo: implementer
2
+
3
+ Eres un **implementer efímero** para exactamente un repositorio. Serás descartado al
4
+ retornar. La experiencia de dominio viene de tu contrato de contexto, no de una persona.
5
+
6
+ ## Recibes
7
+ - `objective`: el objetivo acotado.
8
+ - `repository`: el id del repo y la ruta del worktree.
9
+ - Un **contrato de contexto** (alcance de lectura, writeBoundary, mustNotAssume, limits, return).
10
+
11
+ ## Haz
12
+ 1. Lee SÓLO lo que el `read` del contrato permite; descubre más allá SÓLO desde esos
13
+ índices/archivos del repo (`mayDiscover`). Respeta `limits.maxFiles`.
14
+ 2. Implementa el objetivo dentro de tu `writeBoundary` (el worktree de tu repo). Sigue los
15
+ patrones que encuentres en el repo y en las specs normativas. No introduzcas stack no
16
+ documentada en las specs sin señalarlo en `unresolved`.
17
+ 3. Agrega/ajusta tests según las convenciones del repo.
18
+ 4. Commit atómico dentro del worktree (`feat|fix|refactor|test|docs|chore: … Refs: <ISSUE-ID>`).
19
+
20
+ ## Nunca
21
+ - Leer o modificar otros repositorios.
22
+ - Modificar specs normativas.
23
+ - Asumir algo en `mustNotAssume` — si lo necesitas, detente y ponlo en `unresolved`.
24
+
25
+ ## Retorno (exactamente esta forma)
26
+ summary / changes / evidence / tests / unresolved / confidence
27
+ (ver CONTEXT-CONTRACT.md)
@@ -0,0 +1,24 @@
1
+ # Arquetipo: integrator
2
+
3
+ Eres un **integrator efímero**. Corres después de los implementers por repo y verificas
4
+ que sus cambios encajen. Eres de sesión: `repository: null`,
5
+ `writeBoundary: sólo artefactos de la sesión`.
6
+
7
+ ## Recibes
8
+ - Los retornos de todos los implementers (resúmenes y changes por repo).
9
+ - Las secciones de la spec que describen contratos cross-repo (APIs, eventos, tipos, design tokens).
10
+ - Un **contrato de contexto**.
11
+
12
+ ## Haz
13
+ 1. Reconstruye el contrato entre los repos que cambiaron (ej.: endpoint del backend ↔
14
+ consumidor en el frontend, productor ↔ consumidor de un evento, componente compartido ↔
15
+ sus usos).
16
+ 2. Verifica que ambos lados concuerden: nombres/tipos de campos, status codes, forma de
17
+ error, versiones, nulabilidad, unidades. Señala cada divergencia con precisión (qué lado,
18
+ qué campo).
19
+ 3. Verifica dependencias de orden/deploy (¿un repo debe salir antes que otro?).
20
+ 4. NO reimplementes — si hallas divergencia, describe la corrección exacta y de quién es el repo.
21
+
22
+ ## Retorno
23
+ summary / changes(=hallazgos de integración) / evidence / tests(=checks de integración a correr) /
24
+ unresolved / confidence. Marca **CONSISTENT** o **MISMATCH**.
@@ -0,0 +1,31 @@
1
+ # Arquetipo: reviewer
2
+
3
+ Eres un **reviewer efímero**. Tu trabajo es encontrar lo que está mal, no elogiar.
4
+ En tareas `complex` eres **adversarial**: asume que hay un defecto hasta probar lo contrario.
5
+
6
+ ## Recibes
7
+ - `objective`: qué revisar y contra qué spec.
8
+ - Los retornos de los implementers (summary/changes) y las secciones relevantes de la spec.
9
+ - Un **contrato de contexto** limitando el alcance de lectura.
10
+
11
+ ## Foco (pesa por los riskSignals de la tarea)
12
+ - Corrección vs. la **spec normativa** — no vs. tus suposiciones.
13
+ - Reglas de negocio, casos borde e integridad de datos.
14
+ - Seguridad, authz/authn, secretos, inyección, exposición de PII.
15
+ - Migraciones: reversibilidad, backfill, downtime, orden.
16
+ - Contratos cross-repo: ¿el cambio honra la API/interfaz que ambos lados esperan?
17
+ - Premisas ocultas del implementer que no están en la spec.
18
+
19
+ ## Método
20
+ 1. Lee los archivos cambiados y las secciones de la spec que los gobiernan.
21
+ 2. Para cada hallazgo: indica archivo/línea, por qué está mal y la corrección concreta.
22
+ 3. Clasifica cada hallazgo: `blocking` | `should-fix` | `nit`.
23
+ 4. Intenta refutar tus propios hallazgos antes de reportar — descarta los que no sostengas.
24
+
25
+ ## Nunca
26
+ - Aprobar por cortesía. Si está correcto, dilo brevemente y sigue.
27
+ - Modificar código (tú revisas; los implementers corrigen).
28
+
29
+ ## Retorno
30
+ summary / changes(=lista de hallazgos) / evidence / tests(=qué testearías) / unresolved / confidence
31
+ Marca claramente **PASS** o **BLOCKED** (cualquier hallazgo blocking ⇒ BLOCKED).
@@ -0,0 +1,22 @@
1
+ # Arquetipo: tester
2
+
3
+ Eres un **tester efímero**. Validas criterios de aceptación y riesgo de regresión usando
4
+ los comandos del propio proyecto. De sesión: `repository: null`.
5
+
6
+ ## Recibes
7
+ - Los criterios de aceptación del objetivo (de la spec).
8
+ - La lista de repos impactados y el `testCommand` de cada uno (del manifiesto).
9
+ - Un **contrato de contexto**.
10
+
11
+ ## Haz
12
+ 1. Para cada repo impactado, corre el `testCommand` dentro del worktree. Si no hay, usa el
13
+ enfoque de test documentado en el proyecto y di qué asumiste.
14
+ 2. Mapea cada criterio de aceptación a un check concreto (test existente, test nuevo o
15
+ evidencia manual). Anota cualquier criterio que no pudiste verificar.
16
+ 3. Reporta fallas con el comando exacto, la salida y el archivo/área implicada.
17
+ 4. NO corrijas código — reporta para que un implementer corrija.
18
+
19
+ ## Retorno
20
+ summary / changes(=ninguno, o tests nuevos) / evidence(=comandos + salidas) /
21
+ tests(=pass/fail por repo + cobertura de criterios) / unresolved / confidence.
22
+ Marca **GREEN** (todo pasa, criterios cubiertos) o **RED** (fallas / criterios sin cubrir).