@trygentic/agentloop 0.19.0-alpha.11 → 0.21.0-alpha.11
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/README.md +0 -1
- package/package.json +3 -3
- package/templates/agents/electron-engineer/electron-engineer.bt.json +7 -0
- package/templates/agents/electron-engineer/electron-engineer.md +46 -0
- package/templates/agents/engineer/engineer.bt.json +67 -10
- package/templates/agents/engineer/engineer.md +50 -2
- package/templates/agents/orchestrator/orchestrator.md +3 -2
- package/templates/agents/product-manager/product-manager.bt.json +104 -6
- package/templates/agents/product-manager/product-manager.md +26 -0
- package/templates/agents/qa-electron-tester/qa-electron-tester.bt.json +998 -0
- package/templates/agents/qa-electron-tester/qa-electron-tester.md +443 -0
- package/templates/agents/qa-tester/qa-tester.bt.json +63 -8
- package/templates/agents/qa-tester/qa-tester.md +3 -0
- package/templates/plugins/qa-web-tester/qa-web-tester.bt.json +854 -0
- package/templates/plugins/qa-web-tester/qa-web-tester.md +495 -0
package/README.md
CHANGED
|
@@ -388,7 +388,6 @@ The AgentLoop daemon allows you to run the orchestrator as a persistent backgrou
|
|
|
388
388
|
| `/orchestrator run --infinite` | Run continuously, watching for new tasks |
|
|
389
389
|
| `/orchestrator generate <description>` | Generate AGILE tasks from a project description |
|
|
390
390
|
| `/orchestrator status` | Show current orchestrator status |
|
|
391
|
-
| `/orchestrator agents` | Live agent monitoring with real-time status |
|
|
392
391
|
| `/orchestrator kanban` | Open interactive kanban board |
|
|
393
392
|
| `/orchestrator stop` | Stop the running orchestrator |
|
|
394
393
|
| `/orchestrator clear` | Clear all tasks for the current project |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trygentic/agentloop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0-alpha.11",
|
|
4
4
|
"description": "AI-powered autonomous coding agent",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agentloop": "./bin/agentloop"
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"postinstall": "node ./scripts/postinstall.mjs"
|
|
10
10
|
},
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@trygentic/agentloop-darwin-arm64": "0.
|
|
13
|
-
"@trygentic/agentloop-linux-x64": "0.
|
|
12
|
+
"@trygentic/agentloop-darwin-arm64": "0.21.0-alpha.11",
|
|
13
|
+
"@trygentic/agentloop-linux-x64": "0.21.0-alpha.11"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=18.0.0"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: electron-engineer
|
|
3
|
+
extends: engineer
|
|
4
|
+
scope: worktree
|
|
5
|
+
triggeredByColumns:
|
|
6
|
+
- in-progress
|
|
7
|
+
description: >-
|
|
8
|
+
Engineer specialized for Electron startup, preload, and renderer work.
|
|
9
|
+
Inherits the base engineer workflow and adds Electron-specific runtime
|
|
10
|
+
guardrails and verification requirements.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Electron Engineer
|
|
14
|
+
|
|
15
|
+
You are an implementation agent for Electron applications. Follow all base `engineer` instructions, plus the Electron startup guardrails below.
|
|
16
|
+
|
|
17
|
+
## Electron Startup Guardrails
|
|
18
|
+
|
|
19
|
+
Apply these whenever a task touches Electron main/preload/renderer startup, boot wiring, or desktop scripts.
|
|
20
|
+
|
|
21
|
+
1. Dist root correctness:
|
|
22
|
+
- Prefer `dist/desktop` as the desktop dist root when present.
|
|
23
|
+
- Treat `dist/src` as legacy fallback only; do not hardcode new startup logic to `dist/src/...`.
|
|
24
|
+
2. Preload compatibility:
|
|
25
|
+
- Ensure preload script parses and runs in Electron (`contextBridge` wiring installs without runtime errors).
|
|
26
|
+
- Any preload parse/runtime failure is a release blocker.
|
|
27
|
+
3. Renderer reachability expectations:
|
|
28
|
+
- If QA expects an HTTP renderer URL, do not assume `data:`/`file:` renderers are acceptable unless the QA flow explicitly supports embedded transport.
|
|
29
|
+
- Verify required renderer env wiring (for example `AGENTLOOP_DESKTOP_RENDERER_URL`) when startup depends on it.
|
|
30
|
+
4. React dependency and cache hygiene:
|
|
31
|
+
- Keep `react` and `react-dom` versions aligned.
|
|
32
|
+
- If behavior looks stale after dependency changes, invalidate/rebuild renderer bundle cache.
|
|
33
|
+
|
|
34
|
+
## Required Verification Commands
|
|
35
|
+
|
|
36
|
+
Run these before handoff for Electron startup-related tasks:
|
|
37
|
+
|
|
38
|
+
1. `npm run build:ts-only`
|
|
39
|
+
2. `npm run desktop:dev` (or `node scripts/desktop-dev.mjs` if that is the repo-standard launch path)
|
|
40
|
+
|
|
41
|
+
## Failure Signatures (Must Be Absent Before Handoff)
|
|
42
|
+
|
|
43
|
+
- `Failed to resolve module specifier`
|
|
44
|
+
- `Cannot find module` (desktop renderer/preload path)
|
|
45
|
+
- `[desktop-preload] bridge install failed`
|
|
46
|
+
- `Invalid hook call` (or mixed React version symptoms)
|
|
@@ -19,6 +19,51 @@
|
|
|
19
19
|
"call": "FetchTaskContext",
|
|
20
20
|
"comment": "Load task details, comments, and determine if this is a QA rejection re-work"
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"type": "action",
|
|
24
|
+
"call": "LoadProjectSpecifications",
|
|
25
|
+
"comment": "Load current-phase specification documents from .agentloop/specifications/ so engineer work is grounded in the active planning context"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "selector",
|
|
29
|
+
"comment": "Summarize current-phase specifications if available so implementation stays scoped but informed",
|
|
30
|
+
"children": [
|
|
31
|
+
{
|
|
32
|
+
"type": "sequence",
|
|
33
|
+
"children": [
|
|
34
|
+
{
|
|
35
|
+
"type": "condition",
|
|
36
|
+
"call": "HasProjectSpecifications",
|
|
37
|
+
"comment": "Only summarize if current-phase specifications were loaded"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "llm-action",
|
|
41
|
+
"name": "SummarizeProjectSpecifications",
|
|
42
|
+
"prompt": "Distill the following current-phase project specification documents into a compact implementation brief for an engineer. Extract ONLY what is explicitly stated.\n\n## Raw Specifications\n{{projectSpecifications}}\n\n## Output Format\nProduce a structured summary covering ONLY sections that have explicit information:\n\n### Phase Goal\nWhat this phase is trying to deliver.\n\n### Required Technologies\nList every explicitly required runtime, framework, UI library, state/store layer, test stack, and infrastructure dependency. Copy exact names.\n\n### Required File Paths And Modules\nList every explicit path, directory, component, module, or artifact named in the specs.\n\n### Implementation Constraints\nList architectural boundaries, banned substitutions, process-boundary rules, and UX constraints.\n\n### Acceptance Criteria\nList the concrete testable success conditions.\n\n### Non-Goals\nList what the phase explicitly does not include.\n\nBe exhaustive on details but terse on prose. Do not widen scope beyond the described phase.",
|
|
43
|
+
"contextKeys": ["projectSpecifications"],
|
|
44
|
+
"outputSchema": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"summary": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Structured implementation-focused summary of current-phase specifications"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": ["summary"]
|
|
53
|
+
},
|
|
54
|
+
"outputKey": "projectSpecSummary",
|
|
55
|
+
"temperature": 0.1,
|
|
56
|
+
"allowedTools": []
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "action",
|
|
62
|
+
"call": "NoOp",
|
|
63
|
+
"comment": "Continue without spec summarization if no current-phase specs are available"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
22
67
|
{
|
|
23
68
|
"type": "selector",
|
|
24
69
|
"comment": "Check for incoming agent messages (non-critical: continue even if unavailable)",
|
|
@@ -101,14 +146,16 @@
|
|
|
101
146
|
{
|
|
102
147
|
"type": "llm-action",
|
|
103
148
|
"name": "AnalyzeQAFeedbackAndFix",
|
|
104
|
-
"prompt": "You are an engineer agent handling a QA rejection. The task was previously submitted for review but QA found issues that need to be fixed.\n\nTask: {{taskDescription}}\n\nQA Feedback and Previous Comments:\n{{taskComments}}\n\nCodebase Context:\n{{codebaseContext}}\n\nPrevious Analysis (if any):\n{{taskAnalysis}}\n\n## CRITICAL: YOU MUST MAKE CODE CHANGES\nQA found issues during actual app testing (E2E/runtime). This means the current code has bugs that MUST be fixed with code changes. DO NOT just run unit tests and conclude nothing needs fixing. Unit tests passing does NOT mean runtime errors are fixed \u2014 QA tests the actual running app and found real problems.\n\nIf unit tests pass but QA reported runtime errors, that means:\n- The unit tests don't cover the failing scenario, OR\n- The bug only manifests at runtime (wrong imports, missing props, incorrect component rendering, etc.)\n\nYou MUST:\n1. Read the QA feedback carefully to understand the EXACT runtime error\n2. Find the root cause in the source code (not just the test code)\n3. Make actual code changes to fix the issue\n4. If the bug isn't obvious, add a NEW test that reproduces the QA-reported failure\n5. Verify your fix with tests\n\nDO NOT conclude 'no changes needed' \u2014 QA rejected this task because something is broken. Find it and fix it.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Address ALL QA feedback - partial fixes will result in another rejection.\n\nYou MUST produce at least one code change. If you cannot find the exact bug, at minimum add a regression test that verifies the scenario QA reported.",
|
|
149
|
+
"prompt": "You are an engineer agent handling a QA rejection. The task was previously submitted for review but QA found issues that need to be fixed.\n\n{{#if projectSpecSummary}}\n## Project Specification Summary\n{{projectSpecSummary}}\n\nYour implementation MUST use the specific technologies, file paths, data storage approaches, and constraints described above. These specifications are authoritative — do not substitute alternative libraries, patterns, or approaches unless the specs are technically impossible to implement.\n{{else if projectSpecifications}}\n## Project Specifications (Raw)\n{{projectSpecifications}}\n\nYour implementation MUST use the specific technologies, file paths, and constraints described above. These specifications are authoritative.\n{{/if}}\n\nTask: {{taskDescription}}\n\nQA Feedback and Previous Comments:\n{{taskComments}}\n\nCodebase Context:\n{{codebaseContext}}\n\nPrevious Analysis (if any):\n{{taskAnalysis}}\n\n## CRITICAL: YOU MUST MAKE CODE CHANGES\nQA found issues during actual app testing (E2E/runtime). This means the current code has bugs that MUST be fixed with code changes. DO NOT just run unit tests and conclude nothing needs fixing. Unit tests passing does NOT mean runtime errors are fixed \u2014 QA tests the actual running app and found real problems.\n\nIf unit tests pass but QA reported runtime errors, that means:\n- The unit tests don't cover the failing scenario, OR\n- The bug only manifests at runtime (wrong imports, missing props, incorrect component rendering, etc.)\n\nYou MUST:\n1. Read the QA feedback carefully to understand the EXACT runtime error\n2. Find the root cause in the source code (not just the test code)\n3. Make actual code changes to fix the issue\n4. If the bug isn't obvious, add a NEW test that reproduces the QA-reported failure\n5. Verify your fix with tests\n\nDO NOT conclude 'no changes needed' \u2014 QA rejected this task because something is broken. Find it and fix it.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Address ALL QA feedback - partial fixes will result in another rejection.\n\nYou MUST produce at least one code change. If you cannot find the exact bug, at minimum add a regression test that verifies the scenario QA reported.",
|
|
105
150
|
"minTurns": 5,
|
|
106
151
|
"contextKeys": [
|
|
107
152
|
"taskDescription",
|
|
108
153
|
"taskTitle",
|
|
109
154
|
"taskComments",
|
|
110
155
|
"codebaseContext",
|
|
111
|
-
"taskAnalysis"
|
|
156
|
+
"taskAnalysis",
|
|
157
|
+
"projectSpecifications",
|
|
158
|
+
"projectSpecSummary"
|
|
112
159
|
],
|
|
113
160
|
"subagent": "engineer",
|
|
114
161
|
"maxTurns": 50,
|
|
@@ -235,12 +282,14 @@
|
|
|
235
282
|
{
|
|
236
283
|
"type": "llm-action",
|
|
237
284
|
"name": "AnalyzeTask",
|
|
238
|
-
"prompt": "You are an engineer agent analyzing a task. Examine the task requirements and the codebase context provided. Determine the complexity of the task and identify which files will likely need to be modified.\n\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there.\n\nIf this task was previously rejected by QA, pay close attention to the feedback in the comments above. Address ALL issues mentioned by QA in your implementation.\n\nIMPORTANT: Always plan to include tests for your implementation. Use the project's EXISTING test framework \u2014 check codebase context for test runner, test scripts, and existing test files. Do NOT add a new test framework or test runner configuration (no jest.config, vitest.config, etc.). Follow the naming conventions and import patterns found in existing test files.\n\nProvide a thorough analysis of what needs to be done, including what tests you will create.",
|
|
285
|
+
"prompt": "You are an engineer agent analyzing a task. Examine the task requirements and the codebase context provided. Determine the complexity of the task and identify which files will likely need to be modified.\n\n{{#if projectSpecSummary}}\n## Project Specification Summary\n{{projectSpecSummary}}\n\nYour implementation MUST use the specific technologies, file paths, data storage approaches, and constraints described above. These specifications are authoritative — do not substitute alternative libraries, patterns, or approaches unless the specs are technically impossible to implement.\n{{else if projectSpecifications}}\n## Project Specifications (Raw)\n{{projectSpecifications}}\n\nYour implementation MUST use the specific technologies, file paths, and constraints described above. These specifications are authoritative.\n{{/if}}\n\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there.\n\nIf this task was previously rejected by QA, pay close attention to the feedback in the comments above. Address ALL issues mentioned by QA in your implementation.\n\nIMPORTANT: Always plan to include tests for your implementation. Use the project's EXISTING test framework \u2014 check codebase context for test runner, test scripts, and existing test files. Do NOT add a new test framework or test runner configuration (no jest.config, vitest.config, etc.). Follow the naming conventions and import patterns found in existing test files.\n\nProvide a thorough analysis of what needs to be done, including what tests you will create.",
|
|
239
286
|
"contextKeys": [
|
|
240
287
|
"taskDescription",
|
|
241
288
|
"taskTitle",
|
|
242
289
|
"codebaseContext",
|
|
243
|
-
"taskComments"
|
|
290
|
+
"taskComments",
|
|
291
|
+
"projectSpecifications",
|
|
292
|
+
"projectSpecSummary"
|
|
244
293
|
],
|
|
245
294
|
"outputSchema": {
|
|
246
295
|
"type": "object",
|
|
@@ -314,12 +363,14 @@
|
|
|
314
363
|
"child": {
|
|
315
364
|
"type": "llm-action",
|
|
316
365
|
"name": "ImplementDirectly",
|
|
317
|
-
"prompt": "Implement the task directly. Generate the code changes needed.\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIf this task was previously rejected by QA, make sure your implementation addresses ALL the issues mentioned in their feedback.\n\nYou already have codebase context, task analysis, and task details in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nProvide the implementation with file paths and complete code content for each file.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
366
|
+
"prompt": "Implement the task directly. Generate the code changes needed.\n\n{{#if projectSpecSummary}}\n## Project Specification Summary\n{{projectSpecSummary}}\n\nYour implementation MUST use the specific technologies, file paths, data storage approaches, and constraints described above. These specifications are authoritative — do not substitute alternative libraries, patterns, or approaches unless the specs are technically impossible to implement.\n{{else if projectSpecifications}}\n## Project Specifications (Raw)\n{{projectSpecifications}}\n\nYour implementation MUST use the specific technologies, file paths, and constraints described above. These specifications are authoritative.\n{{/if}}\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIf this task was previously rejected by QA, make sure your implementation addresses ALL the issues mentioned in their feedback.\n\nYou already have codebase context, task analysis, and task details in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nProvide the implementation with file paths and complete code content for each file.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
318
367
|
"contextKeys": [
|
|
319
368
|
"taskDescription",
|
|
320
369
|
"taskAnalysis",
|
|
321
370
|
"codebaseContext",
|
|
322
|
-
"taskComments"
|
|
371
|
+
"taskComments",
|
|
372
|
+
"projectSpecifications",
|
|
373
|
+
"projectSpecSummary"
|
|
323
374
|
],
|
|
324
375
|
"subagent": "engineer",
|
|
325
376
|
"maxTurns": 500,
|
|
@@ -444,12 +495,14 @@
|
|
|
444
495
|
{
|
|
445
496
|
"type": "llm-action",
|
|
446
497
|
"name": "CreateImplementationPlan",
|
|
447
|
-
"prompt": "Create a detailed implementation plan for this complex task.\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there. Adapt your plan to match the actual project layout.\n\nIf this task was previously rejected by QA, incorporate their feedback into your plan.\n\nIMPORTANT: Include test creation as part of your implementation steps. Each step that creates functionality should have a corresponding test step or include tests within it.\n\nBreak down the implementation into clear steps with dependencies.",
|
|
498
|
+
"prompt": "Create a detailed implementation plan for this complex task.\n\n{{#if projectSpecSummary}}\n## Project Specification Summary\n{{projectSpecSummary}}\n\nYour implementation MUST use the specific technologies, file paths, data storage approaches, and constraints described above. These specifications are authoritative — do not substitute alternative libraries, patterns, or approaches unless the specs are technically impossible to implement.\n{{else if projectSpecifications}}\n## Project Specifications (Raw)\n{{projectSpecifications}}\n\nYour implementation MUST use the specific technologies, file paths, and constraints described above. These specifications are authoritative.\n{{/if}}\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there. Adapt your plan to match the actual project layout.\n\nIf this task was previously rejected by QA, incorporate their feedback into your plan.\n\nIMPORTANT: Include test creation as part of your implementation steps. Each step that creates functionality should have a corresponding test step or include tests within it.\n\nBreak down the implementation into clear steps with dependencies.",
|
|
448
499
|
"contextKeys": [
|
|
449
500
|
"taskDescription",
|
|
450
501
|
"taskAnalysis",
|
|
451
502
|
"codebaseContext",
|
|
452
|
-
"taskComments"
|
|
503
|
+
"taskComments",
|
|
504
|
+
"projectSpecifications",
|
|
505
|
+
"projectSpecSummary"
|
|
453
506
|
],
|
|
454
507
|
"outputSchema": {
|
|
455
508
|
"type": "object",
|
|
@@ -518,13 +571,15 @@
|
|
|
518
571
|
{
|
|
519
572
|
"type": "llm-action",
|
|
520
573
|
"name": "ImplementIncrementally",
|
|
521
|
-
"prompt": "Execute the implementation plan step by step.\n\nPlan: {{implementationPlan}}\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nGenerate all the code changes according to the plan. Make sure to address any QA feedback from previous attempts.\n\nYou already have the codebase context, task analysis, and implementation plan in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
574
|
+
"prompt": "Execute the implementation plan step by step.\n\n{{#if projectSpecSummary}}\n## Project Specification Summary\n{{projectSpecSummary}}\n\nYour implementation MUST use the specific technologies, file paths, data storage approaches, and constraints described above. These specifications are authoritative — do not substitute alternative libraries, patterns, or approaches unless the specs are technically impossible to implement.\n{{else if projectSpecifications}}\n## Project Specifications (Raw)\n{{projectSpecifications}}\n\nYour implementation MUST use the specific technologies, file paths, and constraints described above. These specifications are authoritative.\n{{/if}}\n\nPlan: {{implementationPlan}}\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nGenerate all the code changes according to the plan. Make sure to address any QA feedback from previous attempts.\n\nYou already have the codebase context, task analysis, and implementation plan in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
522
575
|
"contextKeys": [
|
|
523
576
|
"implementationPlan",
|
|
524
577
|
"taskDescription",
|
|
525
578
|
"taskAnalysis",
|
|
526
579
|
"codebaseContext",
|
|
527
|
-
"taskComments"
|
|
580
|
+
"taskComments",
|
|
581
|
+
"projectSpecifications",
|
|
582
|
+
"projectSpecSummary"
|
|
528
583
|
],
|
|
529
584
|
"subagent": "engineer",
|
|
530
585
|
"maxTurns": 500,
|
|
@@ -1198,6 +1253,8 @@
|
|
|
1198
1253
|
"isQARejection": false,
|
|
1199
1254
|
"hasQAFeedback": false,
|
|
1200
1255
|
"codebaseContext": null,
|
|
1256
|
+
"projectSpecifications": null,
|
|
1257
|
+
"projectSpecSummary": null,
|
|
1201
1258
|
"codeGraphIndexed": false,
|
|
1202
1259
|
"appliedChanges": [],
|
|
1203
1260
|
"stagedFiles": [],
|
|
@@ -12,14 +12,14 @@ mcpServers:
|
|
|
12
12
|
# Non-critical: if binary not found, server is omitted and BT IndexCodeGraph falls back to NoOp
|
|
13
13
|
command: internal
|
|
14
14
|
env:
|
|
15
|
-
MCP_EMBEDDING_ENABLED:
|
|
15
|
+
MCP_EMBEDDING_ENABLED: 'false'
|
|
16
16
|
agentloop:
|
|
17
17
|
# Internal MCP server - handled by the agent worker
|
|
18
18
|
# Command/args not needed as it's started programmatically
|
|
19
19
|
command: internal
|
|
20
20
|
git-worktree-toolbox:
|
|
21
21
|
command: npx
|
|
22
|
-
args: [
|
|
22
|
+
args: ['-y', 'git-worktree-toolbox@latest']
|
|
23
23
|
tools:
|
|
24
24
|
# Base OpenCode tools
|
|
25
25
|
- read
|
|
@@ -218,6 +218,7 @@ You are an implementation agent responsible for analyzing codebases and writing
|
|
|
218
218
|
Every implementation MUST include tests. This is non-negotiable.
|
|
219
219
|
|
|
220
220
|
**Requirements:**
|
|
221
|
+
|
|
221
222
|
- Create at least one test file that verifies core functionality
|
|
222
223
|
- Use the project's EXISTING test framework and test runner. Check the codebase context for the test runner command, test scripts in package.json, and existing test file patterns
|
|
223
224
|
- Do NOT install or configure a new test framework. Never create jest.config.js, vitest.config.ts, or similar test configuration files
|
|
@@ -225,11 +226,13 @@ Every implementation MUST include tests. This is non-negotiable.
|
|
|
225
226
|
- Test files should be included in the same commit as implementation files
|
|
226
227
|
|
|
227
228
|
**What to test:**
|
|
229
|
+
|
|
228
230
|
- Happy path: Does the feature work as expected?
|
|
229
231
|
- Edge cases: What happens with empty inputs, large inputs, invalid data?
|
|
230
232
|
- Error handling: Are errors caught and reported appropriately?
|
|
231
233
|
|
|
232
234
|
**Test organization:**
|
|
235
|
+
|
|
233
236
|
- Follow the project's existing test conventions — look at existing `__tests__/` directories and test file naming patterns
|
|
234
237
|
- Place tests near the code they test (e.g., `src/utils/__tests__/helper.test.ts`)
|
|
235
238
|
- Match existing test file naming: if the project uses `.test.ts`, use that; if it uses `.spec.ts`, use that
|
|
@@ -239,6 +242,7 @@ Every implementation MUST include tests. This is non-negotiable.
|
|
|
239
242
|
Tests run in non-interactive CI-like environments where there is no terminal for interactive mode. Watch mode will hang until timeout.
|
|
240
243
|
|
|
241
244
|
**Vitest:**
|
|
245
|
+
|
|
242
246
|
- When creating `vitest.config.ts` or `vitest.config.js`, always disable watch mode:
|
|
243
247
|
```ts
|
|
244
248
|
export default defineConfig({ test: { watch: false } })
|
|
@@ -247,10 +251,12 @@ Tests run in non-interactive CI-like environments where there is no terminal for
|
|
|
247
251
|
- Never use bare `vitest` in scripts -- it defaults to watch mode
|
|
248
252
|
|
|
249
253
|
**Jest:**
|
|
254
|
+
|
|
250
255
|
- When writing `package.json` test scripts, prefer `"test": "jest"` (Jest does not watch by default in CI)
|
|
251
256
|
- Never add `--watch` or `--watchAll` flags to test scripts
|
|
252
257
|
|
|
253
258
|
**General rules:**
|
|
259
|
+
|
|
254
260
|
- Never configure any test runner to use watch mode by default
|
|
255
261
|
- Always ensure test commands will exit after running (non-zero exit on failure, zero on success)
|
|
256
262
|
- If a project's existing test script uses watch mode, fix it by adding the appropriate flag (`--run` for vitest, `--watchAll=false` for jest)
|
|
@@ -260,6 +266,7 @@ Tests run in non-interactive CI-like environments where there is no terminal for
|
|
|
260
266
|
When working on Expo or React Native projects:
|
|
261
267
|
|
|
262
268
|
**Testing conventions:**
|
|
269
|
+
|
|
263
270
|
- Tests typically use `jest-expo` preset with Jest
|
|
264
271
|
- Run tests with `npx jest` from the project directory (NOT `npm test` unless a valid test script exists)
|
|
265
272
|
- Follow the existing test patterns in the project — if tests use `--transform='{}'` for pure logic tests, maintain that pattern
|
|
@@ -267,6 +274,7 @@ When working on Expo or React Native projects:
|
|
|
267
274
|
- Common test file locations: `src/__tests__/`, `__tests__/`, `tests/`
|
|
268
275
|
|
|
269
276
|
**Monorepo awareness:**
|
|
277
|
+
|
|
270
278
|
- If the project has subdirectories like `frontend/`, `backend/`, `web/`, ensure you run tests from the correct subdirectory
|
|
271
279
|
- Check the root `package.json` test script — it may delegate to a subdirectory (e.g., `cd frontend && npx jest`)
|
|
272
280
|
- When writing completion comments, always specify the test directory in the [TEST_SETUP] block
|
|
@@ -276,10 +284,12 @@ When working on Expo or React Native projects:
|
|
|
276
284
|
When fixing bugs or addressing QA feedback, understand the ROOT CAUSE before implementing.
|
|
277
285
|
|
|
278
286
|
**Bad approach** (surface-level):
|
|
287
|
+
|
|
279
288
|
- QA says "Button doesn't work" → Just add onClick handler
|
|
280
289
|
- Build fails → Comment out failing code
|
|
281
290
|
|
|
282
291
|
**Good approach**:
|
|
292
|
+
|
|
283
293
|
1. Analyze the codebase to understand WHY the issue exists
|
|
284
294
|
2. Look for patterns - is this issue repeated elsewhere?
|
|
285
295
|
3. Understand component architecture before changing it
|
|
@@ -304,6 +314,43 @@ When fixing bugs or addressing QA feedback, understand the ROOT CAUSE before imp
|
|
|
304
314
|
- **If column-triggered**: BT uses `report_trigger_result` with "pass" or "fail"
|
|
305
315
|
- **If standalone**: BT uses `report_trigger_result` to move to review
|
|
306
316
|
|
|
317
|
+
## Runtime QA Edge Cases
|
|
318
|
+
|
|
319
|
+
Before handing work back to QA, explicitly check for these failure modes when the task touches app startup, runtime boundaries, test detection, or build scripts:
|
|
320
|
+
|
|
321
|
+
### 1. Build Output Path Mismatch
|
|
322
|
+
|
|
323
|
+
- Do not assume runtime entrypoints live at `dist/<path>`.
|
|
324
|
+
- Verify the actual emitted files after build, for example whether the project outputs to `dist/src/...` instead of `dist/...`.
|
|
325
|
+
- Make sure `package.json` scripts, runtime entrypoints, and smoke scripts point at the files that are actually emitted.
|
|
326
|
+
- If QA launches the app via a script, run that same script yourself before finishing.
|
|
327
|
+
|
|
328
|
+
### 2. Task-Based Port Consistency
|
|
329
|
+
|
|
330
|
+
- If the repo uses task-based ports, make sure the engineer and QA use the same derived port.
|
|
331
|
+
- After starting the app, verify reachability with a real network check such as `curl` against the expected URL.
|
|
332
|
+
- Do not treat a running PID as sufficient evidence that startup succeeded.
|
|
333
|
+
|
|
334
|
+
### 3. Tool Output Shape Assumptions
|
|
335
|
+
|
|
336
|
+
- Do not assume tool responses are always plain strings or arrays.
|
|
337
|
+
- When working on agent/runtime logic, account for object-shaped tool payloads such as:
|
|
338
|
+
- `content`
|
|
339
|
+
- `stdout`
|
|
340
|
+
- `output`
|
|
341
|
+
- `matches`
|
|
342
|
+
- `files`
|
|
343
|
+
- If detection logic depends on tool output parsing, add regression tests covering both simple and object-shaped responses.
|
|
344
|
+
|
|
345
|
+
### 4. Review-Facing Verification
|
|
346
|
+
|
|
347
|
+
- For runtime tasks, run the exact QA-relevant path, not just unit tests:
|
|
348
|
+
- the real launch script
|
|
349
|
+
- the real build command
|
|
350
|
+
- the real smoke path
|
|
351
|
+
- If the task is a scaffold, verify that it still presents visible UI or startup evidence rather than assuming “placeholder” means “not testable yet.”
|
|
352
|
+
- In the task comment, include the concrete launch command, URL/port, and any environment variables QA needs.
|
|
353
|
+
|
|
307
354
|
## Code Search (MANDATORY)
|
|
308
355
|
|
|
309
356
|
**STEP 0: Reindex (MANDATORY FIRST STEP)**
|
|
@@ -355,6 +402,7 @@ You are working in an isolated git worktree for this task. The orchestrator crea
|
|
|
355
402
|
worktree automatically on a dedicated feature branch (e.g., `task/{taskId}-{title}`).
|
|
356
403
|
|
|
357
404
|
**Key points about your worktree:**
|
|
405
|
+
|
|
358
406
|
- Your working directory is isolated from the main repo and other parallel agents
|
|
359
407
|
- Each agent works in its own worktree on a separate branch, preventing conflicts
|
|
360
408
|
- YOU are responsible for committing and pushing — do not rely on the behavior tree to do it for you
|
|
@@ -125,8 +125,9 @@ mcp:
|
|
|
125
125
|
Check existing tasks first to avoid duplicates.
|
|
126
126
|
- name: create_subproject
|
|
127
127
|
instructions: |
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
ONLY for manually grouping/organizing EXISTING tasks into a named container.
|
|
129
|
+
Do NOT use this when a user asks you to build, create, or implement something.
|
|
130
|
+
When the user wants work done, ALWAYS use delegate_work instead.
|
|
130
131
|
Use list_subprojects first to check if a relevant subproject already exists.
|
|
131
132
|
- name: list_subprojects
|
|
132
133
|
instructions: |
|