opencode-orchestrator 0.9.20 → 0.9.22
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/dist/agents/prompts/commander/forbidden.d.ts +2 -0
- package/dist/agents/prompts/common/anti-hallucination.d.ts +1 -0
- package/dist/agents/prompts/common/environment-discovery.d.ts +1 -0
- package/dist/agents/prompts/planner/forbidden.d.ts +2 -0
- package/dist/agents/prompts/planner/research.d.ts +2 -0
- package/dist/agents/prompts/reviewer/forbidden.d.ts +2 -0
- package/dist/agents/prompts/reviewer/verification.d.ts +2 -0
- package/dist/agents/prompts/worker/forbidden.d.ts +2 -0
- package/dist/agents/prompts/worker/quality.d.ts +2 -0
- package/dist/agents/prompts/worker/required.d.ts +2 -0
- package/dist/agents/prompts/worker/workflow.d.ts +2 -0
- package/dist/index.js +414 -165
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12979,76 +12979,162 @@ tool.schema = external_exports;
|
|
|
12979
12979
|
|
|
12980
12980
|
// src/agents/prompts/common/environment-discovery.ts
|
|
12981
12981
|
var ENVIRONMENT_DISCOVERY = `${PROMPT_TAGS.ENVIRONMENT_DISCOVERY.open}
|
|
12982
|
-
MANDATORY FIRST STEP - Before any planning or coding:
|
|
12983
|
-
|
|
12984
|
-
## 1. Project Structure
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
12982
|
+
\u26A0\uFE0F MANDATORY FIRST STEP - Before any planning or coding:
|
|
12983
|
+
|
|
12984
|
+
## 1. Project Structure Discovery
|
|
12985
|
+
Explore the project root to understand its organization:
|
|
12986
|
+
\`\`\`bash
|
|
12987
|
+
ls -la # Root contents
|
|
12988
|
+
find . -maxdepth 2 -type d | head -30 # Directory structure
|
|
12989
|
+
find . -maxdepth 1 -type f # Root files
|
|
12990
|
+
\`\`\`
|
|
12991
|
+
|
|
12992
|
+
**Look for patterns, NOT specific files:**
|
|
12993
|
+
- Source directories (src/, lib/, app/, pkg/, internal/, cmd/)
|
|
12994
|
+
- Test directories (tests/, test/, spec/, __tests__/, *_test/)
|
|
12995
|
+
- Build artifacts (dist/, build/, target/, out/, bin/)
|
|
12996
|
+
- Documentation (docs/, doc/, README*, CONTRIBUTING*, CHANGELOG*)
|
|
12997
|
+
- Configuration (hidden files, *.config.*, *.json, *.yaml, *.toml)
|
|
12998
|
+
|
|
12999
|
+
## 2. Environment Detection (Adaptive)
|
|
13000
|
+
**DO NOT assume technology stack. DETECT it:**
|
|
13001
|
+
|
|
13002
|
+
| Indicator Files | Likely Environment |
|
|
13003
|
+
|----------------|-------------------|
|
|
13004
|
+
| package.json, tsconfig.json | Node.js / TypeScript |
|
|
13005
|
+
| Cargo.toml, Cargo.lock | Rust |
|
|
13006
|
+
| go.mod, go.sum | Go |
|
|
13007
|
+
| requirements.txt, pyproject.toml, setup.py | Python |
|
|
13008
|
+
| pom.xml, build.gradle | Java / JVM |
|
|
13009
|
+
| Gemfile, *.rb | Ruby |
|
|
13010
|
+
| composer.json | PHP |
|
|
13011
|
+
| CMakeLists.txt, Makefile | C/C++ |
|
|
13012
|
+
| *.csproj, *.sln | .NET / C# |
|
|
13013
|
+
| pubspec.yaml | Dart / Flutter |
|
|
13014
|
+
|
|
13015
|
+
**For each detected config file, read it to find:**
|
|
13016
|
+
- Build commands
|
|
13017
|
+
- Test commands
|
|
13018
|
+
- Entry points
|
|
13019
|
+
- Dependencies
|
|
13020
|
+
|
|
13021
|
+
## 3. Infrastructure Detection
|
|
13022
|
+
\`\`\`bash
|
|
13023
|
+
# Container/orchestration
|
|
13024
|
+
ls Dockerfile* docker-compose* 2>/dev/null
|
|
13025
|
+
ls kubernetes/ k8s/ helm/ 2>/dev/null
|
|
13026
|
+
|
|
13027
|
+
# CI/CD
|
|
13028
|
+
ls .github/workflows/ .gitlab-ci.yml .circleci/ Jenkinsfile 2>/dev/null
|
|
13029
|
+
|
|
13030
|
+
# Cloud/IaC
|
|
13031
|
+
ls terraform/ cloudformation/ pulumi/ 2>/dev/null
|
|
13032
|
+
ls serverless.yml sam.yaml 2>/dev/null
|
|
13033
|
+
\`\`\`
|
|
13034
|
+
|
|
13035
|
+
## 4. Existing Context Check
|
|
13036
|
+
\`\`\`bash
|
|
13037
|
+
ls -la ${PATHS.OPENCODE}/ 2>/dev/null || echo "No existing context"
|
|
13038
|
+
\`\`\`
|
|
13039
|
+
- If ${PATHS.OPENCODE}/ exists \u2192 ASK user to continue or start fresh
|
|
13040
|
+
- If not \u2192 Create fresh context
|
|
13041
|
+
|
|
13042
|
+
## 5. Context Summary (SAVE TO ${PATHS.CONTEXT})
|
|
13004
13043
|
\`\`\`markdown
|
|
13005
13044
|
# Project Context
|
|
13045
|
+
|
|
13006
13046
|
## Environment
|
|
13007
|
-
-
|
|
13008
|
-
-
|
|
13009
|
-
-
|
|
13047
|
+
- Language: [DETECTED from files]
|
|
13048
|
+
- Runtime: [DETECTED version if available]
|
|
13049
|
+
- Build: [DETECTED build command]
|
|
13050
|
+
- Test: [DETECTED test command]
|
|
13051
|
+
- Package Manager: [DETECTED from lockfiles]
|
|
13052
|
+
|
|
13053
|
+
## Project Type
|
|
13054
|
+
- [ ] Library/Package
|
|
13055
|
+
- [ ] Application (CLI/Web/Mobile/Desktop)
|
|
13056
|
+
- [ ] Microservice
|
|
13057
|
+
- [ ] Monorepo
|
|
13058
|
+
- [ ] Other: [describe]
|
|
13059
|
+
|
|
13060
|
+
## Infrastructure
|
|
13061
|
+
- Container: [None / Docker / Podman]
|
|
13062
|
+
- Orchestration: [None / K8s / Docker Compose]
|
|
13063
|
+
- CI/CD: [DETECTED from config files]
|
|
13064
|
+
- Cloud: [DETECTED or None]
|
|
13010
13065
|
|
|
13011
13066
|
## Structure
|
|
13012
|
-
- Source:
|
|
13013
|
-
- Tests:
|
|
13014
|
-
- Docs:
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
- [
|
|
13067
|
+
- Source: [DETECTED path]
|
|
13068
|
+
- Tests: [DETECTED path]
|
|
13069
|
+
- Docs: [DETECTED path]
|
|
13070
|
+
- Entry: [DETECTED main file]
|
|
13071
|
+
|
|
13072
|
+
## Conventions (OBSERVE from existing code)
|
|
13073
|
+
- Naming: [camelCase / snake_case / PascalCase]
|
|
13074
|
+
- Imports: [relative / absolute / aliases]
|
|
13075
|
+
- Error handling: [exceptions / Result type / error codes]
|
|
13076
|
+
- Testing: [unit / integration / e2e patterns]
|
|
13077
|
+
|
|
13078
|
+
## Notes
|
|
13079
|
+
- [Any unique patterns or requirements observed]
|
|
13022
13080
|
\`\`\`
|
|
13023
13081
|
|
|
13024
|
-
|
|
13082
|
+
## \u26A0\uFE0F CRITICAL RULES:
|
|
13083
|
+
1. NEVER assume - always VERIFY by reading files
|
|
13084
|
+
2. ADAPT to what you find, don't force expectations
|
|
13085
|
+
3. If uncertain, ASK the user for clarification
|
|
13086
|
+
4. Document EVERYTHING you discover
|
|
13025
13087
|
${PROMPT_TAGS.ENVIRONMENT_DISCOVERY.close}`;
|
|
13026
13088
|
|
|
13027
13089
|
// src/agents/prompts/common/anti-hallucination.ts
|
|
13028
13090
|
var ANTI_HALLUCINATION_CORE = `${PROMPT_TAGS.ANTI_HALLUCINATION.open}
|
|
13029
|
-
ZERO TOLERANCE FOR GUESSING
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
-
|
|
13044
|
-
-
|
|
13091
|
+
\u{1F6AB} ZERO TOLERANCE FOR GUESSING
|
|
13092
|
+
|
|
13093
|
+
## The Golden Rule
|
|
13094
|
+
> If you're not 100% sure, **SEARCH** before you claim.
|
|
13095
|
+
> If you can't find it, **SAY** you can't find it.
|
|
13096
|
+
|
|
13097
|
+
## Before ANY Implementation:
|
|
13098
|
+
|
|
13099
|
+
### Step 1: Check Local Cache
|
|
13100
|
+
\`\`\`bash
|
|
13101
|
+
ls ${PATHS.DOCS}/ # What do we already have?
|
|
13102
|
+
\`\`\`
|
|
13103
|
+
|
|
13104
|
+
### Step 2: If Not Found \u2192 Research
|
|
13105
|
+
- Search for OFFICIAL documentation
|
|
13106
|
+
- Prefer version-specific docs matching project
|
|
13107
|
+
- Cache findings to ${PATHS.DOCS}/
|
|
13108
|
+
|
|
13109
|
+
### Step 3: Verify Before Using
|
|
13110
|
+
- Is this the RIGHT version for THIS project?
|
|
13111
|
+
- Does the syntax match current APIs?
|
|
13112
|
+
- Are there breaking changes to consider?
|
|
13113
|
+
|
|
13114
|
+
## Source Hierarchy (Most to Least Trusted):
|
|
13115
|
+
1. \u{1F7E2} **Official docs** - docs.*, *.dev, readthedocs
|
|
13116
|
+
2. \u{1F7E2} **GitHub source** - actual source code, README
|
|
13117
|
+
3. \u{1F7E1} **Package registries** - npm, PyPI, crates.io, Maven
|
|
13118
|
+
4. \u{1F7E1} **GitHub issues** - real-world usage patterns
|
|
13119
|
+
5. \u{1F534} **Blogs/tutorials** - may be outdated, verify independently
|
|
13120
|
+
|
|
13121
|
+
## \u26D4 ABSOLUTELY FORBIDDEN:
|
|
13122
|
+
- Inventing function signatures from memory
|
|
13123
|
+
- Assuming API compatibility between versions
|
|
13045
13124
|
- Guessing version-specific syntax
|
|
13046
|
-
- Using
|
|
13125
|
+
- Using knowledge without verification
|
|
13126
|
+
- Mixing syntax from different versions
|
|
13047
13127
|
|
|
13048
|
-
REQUIRED:
|
|
13049
|
-
- Source URL for every claim
|
|
13128
|
+
## \u2705 ALWAYS REQUIRED:
|
|
13129
|
+
- Source URL for every technical claim
|
|
13050
13130
|
- Confidence level: ${WORK_STATUS.CONFIDENCE.HIGH} (official) / ${WORK_STATUS.CONFIDENCE.MEDIUM} (github) / ${WORK_STATUS.CONFIDENCE.LOW} (blog)
|
|
13051
|
-
- Say "
|
|
13131
|
+
- Say "I need to research this" if unsure
|
|
13132
|
+
- Say "NOT FOUND in official docs" if documentation unavailable
|
|
13133
|
+
|
|
13134
|
+
## Self-Check Questions:
|
|
13135
|
+
1. Did I VERIFY this, or am I REMEMBERING it?
|
|
13136
|
+
2. Is my source CURRENT for this project's version?
|
|
13137
|
+
3. Am I CERTAIN, or am I HOPING?
|
|
13052
13138
|
${PROMPT_TAGS.ANTI_HALLUCINATION.close}`;
|
|
13053
13139
|
|
|
13054
13140
|
// src/agents/prompts/common/todo-rules.ts
|
|
@@ -13104,10 +13190,10 @@ ${PROMPT_TAGS.TODO_RULES.close}`;
|
|
|
13104
13190
|
|
|
13105
13191
|
// src/agents/prompts/common/shared-workspace.ts
|
|
13106
13192
|
var SHARED_WORKSPACE = `${PROMPT_TAGS.SHARED_WORKSPACE.open}
|
|
13107
|
-
.
|
|
13193
|
+
\u{1F4C2} ${PATHS.OPENCODE}/ - Shared Context Directory (Real-time State)
|
|
13108
13194
|
|
|
13109
13195
|
\`\`\`
|
|
13110
|
-
.
|
|
13196
|
+
${PATHS.OPENCODE}/
|
|
13111
13197
|
\u251C\u2500\u2500 todo.md - Master task list (single source of truth)
|
|
13112
13198
|
\u251C\u2500\u2500 context.md - Project context summary (<150 lines)
|
|
13113
13199
|
\u251C\u2500\u2500 work-log.md - \u{1F504} REAL-TIME work status (ALL agents read/write)
|
|
@@ -13132,7 +13218,7 @@ var SHARED_WORKSPACE = `${PROMPT_TAGS.SHARED_WORKSPACE.open}
|
|
|
13132
13218
|
- Status: ${WORK_STATUS.STATUS.PENDING} | ${WORK_STATUS.STATUS.IN_PROGRESS} | ${WORK_STATUS.STATUS.DONE}
|
|
13133
13219
|
- Test: ${WORK_STATUS.TEST_RESULT.PASS} | ${WORK_STATUS.TEST_RESULT.FAIL}
|
|
13134
13220
|
|
|
13135
|
-
##
|
|
13221
|
+
## ${PATHS.WORK_LOG} FORMAT:
|
|
13136
13222
|
\`\`\`markdown
|
|
13137
13223
|
# Work Log
|
|
13138
13224
|
|
|
@@ -13155,11 +13241,11 @@ var SHARED_WORKSPACE = `${PROMPT_TAGS.SHARED_WORKSPACE.open}
|
|
|
13155
13241
|
- Use path.normalize() or similar when comparing paths programmatically
|
|
13156
13242
|
|
|
13157
13243
|
RULES:
|
|
13158
|
-
- ALL agents MUST read
|
|
13159
|
-
- Worker updates
|
|
13160
|
-
- Reviewer monitors
|
|
13161
|
-
- Commander reads
|
|
13162
|
-
-
|
|
13244
|
+
- ALL agents MUST read ${PATHS.WORK_LOG} before starting
|
|
13245
|
+
- Worker updates ${PATHS.WORK_LOG} when starting/completing file work
|
|
13246
|
+
- Reviewer monitors ${PATHS.WORK_LOG} for completed units
|
|
13247
|
+
- Commander reads ${PATHS.WORK_LOG} in each loop iteration
|
|
13248
|
+
- ${PATHS.SYNC_ISSUES} = Reviewer writes issues for next iteration
|
|
13163
13249
|
${PROMPT_TAGS.SHARED_WORKSPACE.close}`;
|
|
13164
13250
|
|
|
13165
13251
|
// src/agents/prompts/common/mission-seal.ts
|
|
@@ -13190,11 +13276,11 @@ var VERIFICATION_REQUIREMENTS = `${PROMPT_TAGS.VERIFICATION.open}
|
|
|
13190
13276
|
VERIFICATION CHECKLIST
|
|
13191
13277
|
|
|
13192
13278
|
## Code Verification
|
|
13193
|
-
\u25A1 lsp_diagnostics clean (no errors)
|
|
13194
|
-
\u25A1 Build passes (
|
|
13195
|
-
\u25A1 Tests pass (
|
|
13196
|
-
\u25A1 No
|
|
13197
|
-
\u25A1 No console.log
|
|
13279
|
+
\u25A1 lsp_diagnostics clean (no errors/warnings)
|
|
13280
|
+
\u25A1 Build passes (use project's build command from ${PATHS.CONTEXT})
|
|
13281
|
+
\u25A1 Tests pass (use project's test command from ${PATHS.CONTEXT})
|
|
13282
|
+
\u25A1 No untyped variables (language-appropriate)
|
|
13283
|
+
\u25A1 No debug logging left (console.log, print, etc.)
|
|
13198
13284
|
|
|
13199
13285
|
## Documentation Verification
|
|
13200
13286
|
\u25A1 Implementation matches ${PATHS.DOCS}/
|
|
@@ -13202,9 +13288,9 @@ var VERIFICATION_REQUIREMENTS = `${PROMPT_TAGS.VERIFICATION.open}
|
|
|
13202
13288
|
\u25A1 Version compatibility confirmed
|
|
13203
13289
|
|
|
13204
13290
|
## Security Verification
|
|
13205
|
-
\u25A1 No hardcoded secrets/passwords
|
|
13291
|
+
\u25A1 No hardcoded secrets/passwords/API keys
|
|
13206
13292
|
\u25A1 Input validation present
|
|
13207
|
-
\u25A1 Error messages don't leak info
|
|
13293
|
+
\u25A1 Error messages don't leak sensitive info
|
|
13208
13294
|
|
|
13209
13295
|
ONLY mark complete after ALL checks pass!
|
|
13210
13296
|
${PROMPT_TAGS.VERIFICATION.close}`;
|
|
@@ -13227,14 +13313,28 @@ ${PROMPT_TAGS.IDENTITY.close}`;
|
|
|
13227
13313
|
|
|
13228
13314
|
// src/agents/prompts/commander/forbidden.ts
|
|
13229
13315
|
var COMMANDER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
NEVER
|
|
13234
|
-
NEVER
|
|
13235
|
-
NEVER
|
|
13236
|
-
NEVER
|
|
13237
|
-
|
|
13316
|
+
\u26D4 COMMANDER FORBIDDEN ACTIONS
|
|
13317
|
+
|
|
13318
|
+
## Never Stop Prematurely
|
|
13319
|
+
- NEVER say "I've completed..." without outputting ${MISSION_SEAL.PATTERN}
|
|
13320
|
+
- NEVER stop mid-mission to ask for permission
|
|
13321
|
+
- NEVER wait for user input during execution
|
|
13322
|
+
- NEVER output ${MISSION_SEAL.PATTERN} before ALL todos are [x]
|
|
13323
|
+
|
|
13324
|
+
## Never Micromanage
|
|
13325
|
+
- NEVER execute tasks one-by-one when parallel is possible
|
|
13326
|
+
- NEVER do implementation work yourself \u2192 Delegate to ${AGENT_NAMES.WORKER}
|
|
13327
|
+
- NEVER mark TODO [x] yourself \u2192 Only ${AGENT_NAMES.REVIEWER} can verify
|
|
13328
|
+
|
|
13329
|
+
## Never Assume
|
|
13330
|
+
- NEVER assume project structure \u2192 DISCOVER it first via ${PATHS.CONTEXT}
|
|
13331
|
+
- NEVER assume APIs/syntax \u2192 Research first via ${AGENT_NAMES.PLANNER}
|
|
13332
|
+
- NEVER skip environment discovery on new projects
|
|
13333
|
+
|
|
13334
|
+
## Always Adapt
|
|
13335
|
+
- READ ${PATHS.CONTEXT} to understand this specific project
|
|
13336
|
+
- OBSERVE project patterns before delegating work
|
|
13337
|
+
- ADJUST parallelism based on project's actual structure
|
|
13238
13338
|
${PROMPT_TAGS.FORBIDDEN_ACTIONS.close}`;
|
|
13239
13339
|
|
|
13240
13340
|
// src/agents/prompts/commander/required.ts
|
|
@@ -13614,13 +13714,27 @@ ${PROMPT_TAGS.ROLE.close}`;
|
|
|
13614
13714
|
|
|
13615
13715
|
// src/agents/prompts/planner/forbidden.ts
|
|
13616
13716
|
var PLANNER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
NEVER
|
|
13621
|
-
NEVER
|
|
13622
|
-
NEVER
|
|
13623
|
-
|
|
13717
|
+
\u26D4 PLANNER FORBIDDEN ACTIONS
|
|
13718
|
+
|
|
13719
|
+
## Never Implement
|
|
13720
|
+
- NEVER write actual code \u2192 Only plan and research
|
|
13721
|
+
- NEVER execute build/test commands \u2192 That's Worker/Reviewer's job
|
|
13722
|
+
- NEVER modify source files \u2192 Only ${PATHS.TODO} and ${PATHS.DOCS}/
|
|
13723
|
+
|
|
13724
|
+
## Never Assume
|
|
13725
|
+
- NEVER guess API syntax \u2192 Always verify with official documentation
|
|
13726
|
+
- NEVER assume version compatibility \u2192 Check project's actual versions
|
|
13727
|
+
- NEVER claim knowledge without source URL \u2192 Cite everything
|
|
13728
|
+
|
|
13729
|
+
## Never Shortcut
|
|
13730
|
+
- NEVER create TODO without understanding project structure first
|
|
13731
|
+
- NEVER create TODOs with [x] already marked \u2192 All start as [ ]
|
|
13732
|
+
- NEVER skip environment discovery \u2192 Read ${PATHS.CONTEXT} first
|
|
13733
|
+
|
|
13734
|
+
## Always Adapt
|
|
13735
|
+
- DISCOVER the project's structure before planning
|
|
13736
|
+
- MATCH the project's existing patterns in your plans
|
|
13737
|
+
- REFERENCE ${PATHS.CONTEXT} for environment details
|
|
13624
13738
|
${PROMPT_TAGS.FORBIDDEN_ACTIONS.close}`;
|
|
13625
13739
|
|
|
13626
13740
|
// src/agents/prompts/planner/required.ts
|
|
@@ -13691,22 +13805,51 @@ ${PROMPT_TAGS.PLANNING_FORMAT.close}`;
|
|
|
13691
13805
|
|
|
13692
13806
|
// src/agents/prompts/planner/research.ts
|
|
13693
13807
|
var PLANNER_RESEARCH = `${PROMPT_TAGS.RESEARCH_WORKFLOW.open}
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13808
|
+
\u{1F52C} ADAPTIVE RESEARCH WORKFLOW
|
|
13809
|
+
|
|
13810
|
+
## Step 1: Identify What to Research
|
|
13811
|
+
- What technology/library/API is needed?
|
|
13812
|
+
- What version is the project using? (check ${PATHS.CONTEXT})
|
|
13813
|
+
- What specific syntax/pattern is unclear?
|
|
13814
|
+
|
|
13815
|
+
## Step 2: Prioritize Sources (in order)
|
|
13816
|
+
1. **Project's own docs** - Check ${PATHS.DOCS}/ first
|
|
13817
|
+
2. **Official documentation** - [framework].dev, docs.[library].com
|
|
13818
|
+
3. **GitHub repo** - README, examples, source code
|
|
13819
|
+
4. **Package registry** - npm, PyPI, crates.io
|
|
13820
|
+
5. **Community** - Stack Overflow, Discord (lowest priority)
|
|
13821
|
+
|
|
13822
|
+
## Step 3: Search Strategy
|
|
13823
|
+
\`\`\`
|
|
13824
|
+
websearch "[topic] official documentation [detected version]"
|
|
13825
|
+
websearch "[topic] [language] example"
|
|
13826
|
+
\`\`\`
|
|
13827
|
+
|
|
13828
|
+
## Step 4: Validate & Extract
|
|
13829
|
+
- Is this the CORRECT version for this project?
|
|
13830
|
+
- Extract EXACT syntax (never paraphrase)
|
|
13831
|
+
- Note any version-specific differences
|
|
13832
|
+
|
|
13833
|
+
## Step 5: Cache Research
|
|
13834
|
+
Save to ${PATHS.DOCS}/[topic].md:
|
|
13698
13835
|
|
|
13699
|
-
OUTPUT:
|
|
13700
13836
|
\`\`\`markdown
|
|
13701
13837
|
# Research: [topic]
|
|
13838
|
+
Date: [timestamp]
|
|
13702
13839
|
Source: [official URL]
|
|
13703
13840
|
Confidence: ${WORK_STATUS.CONFIDENCE.HIGH}/${WORK_STATUS.CONFIDENCE.MEDIUM}/${WORK_STATUS.CONFIDENCE.LOW}
|
|
13704
|
-
Version: [version]
|
|
13841
|
+
Version: [detected version from project]
|
|
13842
|
+
|
|
13843
|
+
## Context
|
|
13844
|
+
Why this is needed: [brief explanation]
|
|
13705
13845
|
|
|
13706
13846
|
## Exact Syntax
|
|
13707
|
-
\`\`\`[
|
|
13708
|
-
[code from official docs]
|
|
13847
|
+
\`\`\`[detected language]
|
|
13848
|
+
[code from official docs - VERBATIM]
|
|
13709
13849
|
\`\`\`
|
|
13850
|
+
|
|
13851
|
+
## Usage Notes
|
|
13852
|
+
- [any gotchas or important details]
|
|
13710
13853
|
\`\`\`
|
|
13711
13854
|
${PROMPT_TAGS.RESEARCH_WORKFLOW.close}`;
|
|
13712
13855
|
|
|
@@ -13848,67 +13991,141 @@ ${PROMPT_TAGS.ROLE.close}`;
|
|
|
13848
13991
|
|
|
13849
13992
|
// src/agents/prompts/worker/forbidden.ts
|
|
13850
13993
|
var WORKER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
NEVER
|
|
13855
|
-
NEVER
|
|
13856
|
-
NEVER
|
|
13857
|
-
|
|
13858
|
-
|
|
13994
|
+
\u26D4 FORBIDDEN ACTIONS (Adapt to Project Conventions)
|
|
13995
|
+
|
|
13996
|
+
## Never Assume
|
|
13997
|
+
- NEVER guess API syntax \u2192 CHECK ${PATHS.DOCS}/ or research first
|
|
13998
|
+
- NEVER assume patterns \u2192 OBSERVE existing code first
|
|
13999
|
+
- NEVER assume build/test commands \u2192 READ ${PATHS.CONTEXT}
|
|
14000
|
+
|
|
14001
|
+
## Never Skip
|
|
14002
|
+
- NEVER skip error handling \u2192 Follow project's error handling patterns
|
|
14003
|
+
- NEVER skip lsp_diagnostics \u2192 Always verify code compiles
|
|
14004
|
+
- NEVER skip verification \u2192 Test before claiming done
|
|
14005
|
+
|
|
14006
|
+
## Never Shortcut
|
|
14007
|
+
- NEVER leave debug logging \u2192 Remove console.log, print, logger.debug, etc.
|
|
14008
|
+
- NEVER hardcode values \u2192 Use constants/config like existing code does
|
|
14009
|
+
- NEVER use weak types \u2192 Follow project's type safety conventions
|
|
14010
|
+
|
|
14011
|
+
## Never Overstep
|
|
14012
|
+
- NEVER mark TODO [x] \u2192 Only ${AGENT_NAMES.REVIEWER} can verify completion
|
|
14013
|
+
- NEVER claim "done" without evidence \u2192 Provide build/test results
|
|
14014
|
+
|
|
14015
|
+
Remember: OBSERVE how existing code handles these, then FOLLOW those patterns.
|
|
13859
14016
|
${PROMPT_TAGS.FORBIDDEN_ACTIONS.close}`;
|
|
13860
14017
|
|
|
13861
14018
|
// src/agents/prompts/worker/required.ts
|
|
13862
14019
|
var WORKER_REQUIRED = `${PROMPT_TAGS.REQUIRED_ACTIONS.open}
|
|
13863
|
-
\u26A0\uFE0F THINK FIRST - As WORKER,
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
ALWAYS
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
14020
|
+
\u26A0\uFE0F THINK FIRST - As WORKER, explore before implementing:
|
|
14021
|
+
|
|
14022
|
+
## Before Writing ANY Code:
|
|
14023
|
+
1. Do I fully understand WHAT I'm implementing and WHY?
|
|
14024
|
+
2. Have I read ${PATHS.CONTEXT} for project environment?
|
|
14025
|
+
3. Have I checked ${PATHS.DOCS}/ for relevant documentation?
|
|
14026
|
+
4. What PATTERNS does this codebase already use?
|
|
14027
|
+
5. What EDGE CASES must I handle?
|
|
14028
|
+
|
|
14029
|
+
## Adaptive Requirements:
|
|
14030
|
+
|
|
14031
|
+
### ALWAYS Observe First
|
|
14032
|
+
- Study existing code for patterns before writing new code
|
|
14033
|
+
- Match naming conventions you find in the codebase
|
|
14034
|
+
- Follow error handling style used in similar files
|
|
14035
|
+
|
|
14036
|
+
### ALWAYS Verify
|
|
14037
|
+
- Run lsp_diagnostics after changes
|
|
14038
|
+
- Run the project's BUILD command (from ${PATHS.CONTEXT})
|
|
14039
|
+
- Run the project's TEST command (from ${PATHS.CONTEXT})
|
|
14040
|
+
|
|
14041
|
+
### ALWAYS Document
|
|
14042
|
+
- Add documentation matching project's documentation style
|
|
14043
|
+
- Include tests matching project's test patterns
|
|
14044
|
+
|
|
14045
|
+
### ALWAYS Report
|
|
14046
|
+
- Provide completion evidence with actual command outputs
|
|
14047
|
+
- List all files changed with line counts
|
|
13878
14048
|
${PROMPT_TAGS.REQUIRED_ACTIONS.close}`;
|
|
13879
14049
|
|
|
13880
14050
|
// src/agents/prompts/worker/workflow.ts
|
|
13881
14051
|
var WORKER_WORKFLOW = `${PROMPT_TAGS.WORKFLOW.open}
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
14052
|
+
\u{1F504} ADAPTIVE IMPLEMENTATION WORKFLOW
|
|
14053
|
+
|
|
14054
|
+
## Phase 1: UNDERSTAND (Before writing ANY code)
|
|
14055
|
+
1. Read ${PATHS.CONTEXT} \u2192 Get project environment, build/test commands
|
|
14056
|
+
2. Read ${PATHS.TODO} \u2192 Understand assigned task and acceptance criteria
|
|
14057
|
+
3. Read ${PATHS.DOCS}/ \u2192 Check for cached API docs, syntax references
|
|
14058
|
+
|
|
14059
|
+
## Phase 2: OBSERVE (Learn from existing codebase)
|
|
14060
|
+
4. Find SIMILAR code in the project
|
|
14061
|
+
\`\`\`bash
|
|
14062
|
+
# Find related files
|
|
14063
|
+
find . -name "*.ts" -o -name "*.py" -o -name "*.go" | head -20
|
|
14064
|
+
\`\`\`
|
|
14065
|
+
5. Study existing PATTERNS:
|
|
14066
|
+
- How are errors handled?
|
|
14067
|
+
- How are tests structured?
|
|
14068
|
+
- What naming conventions are used?
|
|
14069
|
+
- How is logging done?
|
|
14070
|
+
|
|
14071
|
+
## Phase 3: RESEARCH (If needed)
|
|
14072
|
+
6. If docs missing in ${PATHS.DOCS}/:
|
|
14073
|
+
- Search for official documentation
|
|
14074
|
+
- Cache findings to ${PATHS.DOCS}/
|
|
14075
|
+
|
|
14076
|
+
## Phase 4: IMPLEMENT (Following discoveries)
|
|
14077
|
+
7. Write code following OBSERVED patterns
|
|
14078
|
+
8. Handle edge cases like existing code does
|
|
14079
|
+
9. Add tests matching project's test style
|
|
14080
|
+
|
|
14081
|
+
## Phase 5: VERIFY (Before reporting)
|
|
14082
|
+
10. Run lsp_diagnostics \u2192 Must be clean
|
|
14083
|
+
11. Run BUILD command from ${PATHS.CONTEXT}
|
|
14084
|
+
12. Run TEST command from ${PATHS.CONTEXT}
|
|
14085
|
+
13. Report completion WITH evidence
|
|
14086
|
+
|
|
14087
|
+
\u26A0\uFE0F Do NOT mark [x] in ${PATHS.TODO} - that's ${AGENT_NAMES.REVIEWER}'s job!
|
|
13892
14088
|
${PROMPT_TAGS.WORKFLOW.close}`;
|
|
13893
14089
|
|
|
13894
14090
|
// src/agents/prompts/worker/quality.ts
|
|
13895
14091
|
var WORKER_QUALITY = `${PROMPT_TAGS.QUALITY_CHECKLIST.open}
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
-
|
|
13902
|
-
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
14092
|
+
\u{1F4CB} QUALITY CHECKLIST (Adaptive)
|
|
14093
|
+
|
|
14094
|
+
Before reporting complete, verify against PROJECT-SPECIFIC standards:
|
|
14095
|
+
|
|
14096
|
+
## 1. Static Analysis
|
|
14097
|
+
- lsp_diagnostics shows NO errors
|
|
14098
|
+
- Follow linting rules discovered in project (if any)
|
|
14099
|
+
|
|
14100
|
+
## 2. Build Verification
|
|
14101
|
+
- Run the BUILD command from ${PATHS.CONTEXT}
|
|
14102
|
+
- Must complete without errors
|
|
14103
|
+
|
|
14104
|
+
## 3. Test Verification
|
|
14105
|
+
- Tests written for new/changed code
|
|
14106
|
+
- Run the TEST command from ${PATHS.CONTEXT}
|
|
14107
|
+
- All tests must pass
|
|
14108
|
+
|
|
14109
|
+
## 4. Code Quality (OBSERVE existing patterns)
|
|
14110
|
+
- Match naming conventions found in codebase
|
|
14111
|
+
- Match error handling patterns found in codebase
|
|
14112
|
+
- No debug logging left (console.log, print, logger.debug, etc.)
|
|
14113
|
+
- No hardcoded values that should be config
|
|
14114
|
+
|
|
14115
|
+
## 5. Documentation Compliance
|
|
14116
|
+
- Implementation matches ${PATHS.DOCS}/ patterns
|
|
14117
|
+
- API usage matches official documentation
|
|
14118
|
+
|
|
14119
|
+
## OUTPUT FORMAT:
|
|
14120
|
+
\`\`\`
|
|
13907
14121
|
TASK: T[N]
|
|
13908
14122
|
CHANGED: [files] ([lines])
|
|
13909
|
-
|
|
14123
|
+
BUILD: [command used] \u2192 [result]
|
|
14124
|
+
TEST: [command used] \u2192 [result]
|
|
14125
|
+
PATTERNS_FOLLOWED: [list observed conventions]
|
|
13910
14126
|
DOCS_USED: ${PATHS.DOCS}/[file]
|
|
13911
14127
|
Ready for ${AGENT_NAMES.REVIEWER} verification
|
|
14128
|
+
\`\`\`
|
|
13912
14129
|
${PROMPT_TAGS.QUALITY_CHECKLIST.close}`;
|
|
13913
14130
|
|
|
13914
14131
|
// src/agents/prompts/worker/tdd-workflow.ts
|
|
@@ -14155,14 +14372,27 @@ ${PROMPT_TAGS.ROLE.close}`;
|
|
|
14155
14372
|
|
|
14156
14373
|
// src/agents/prompts/reviewer/forbidden.ts
|
|
14157
14374
|
var REVIEWER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
NEVER
|
|
14162
|
-
NEVER
|
|
14163
|
-
NEVER
|
|
14164
|
-
NEVER
|
|
14165
|
-
|
|
14375
|
+
\u26D4 REVIEWER FORBIDDEN ACTIONS
|
|
14376
|
+
|
|
14377
|
+
## Never Approve Without Verification
|
|
14378
|
+
- NEVER approve without actually running the project's test command
|
|
14379
|
+
- NEVER skip lsp_diagnostics check
|
|
14380
|
+
- NEVER mark [x] without concrete evidence (command outputs)
|
|
14381
|
+
- NEVER trust "task complete" claims \u2192 Always verify yourself
|
|
14382
|
+
|
|
14383
|
+
## Never Assume Quality
|
|
14384
|
+
- NEVER approve code that doesn't match ${PATHS.DOCS}/
|
|
14385
|
+
- NEVER approve code that violates project's observed patterns
|
|
14386
|
+
- NEVER mark [x] before task was actually executed by Worker
|
|
14387
|
+
|
|
14388
|
+
## Never Overstep
|
|
14389
|
+
- NEVER make architecture changes \u2192 Escalate to ${AGENT_NAMES.COMMANDER}
|
|
14390
|
+
- NEVER implement fixes yourself \u2192 Send back to Worker with clear feedback
|
|
14391
|
+
|
|
14392
|
+
## Adaptive Verification
|
|
14393
|
+
- READ ${PATHS.CONTEXT} to know the correct build/test commands
|
|
14394
|
+
- COMPARE with existing code patterns for consistency
|
|
14395
|
+
- VERIFY against project's own quality standards, not generic rules
|
|
14166
14396
|
${PROMPT_TAGS.FORBIDDEN_ACTIONS.close}`;
|
|
14167
14397
|
|
|
14168
14398
|
// src/agents/prompts/reviewer/required.ts
|
|
@@ -14175,8 +14405,8 @@ var REVIEWER_REQUIRED = `${PROMPT_TAGS.REQUIRED_ACTIONS.open}
|
|
|
14175
14405
|
- Am I verifying THOROUGHLY or just going through motions?
|
|
14176
14406
|
|
|
14177
14407
|
ALWAYS run lsp_diagnostics
|
|
14178
|
-
ALWAYS run
|
|
14179
|
-
ALWAYS run
|
|
14408
|
+
ALWAYS run project's BUILD command (from ${PATHS.CONTEXT})
|
|
14409
|
+
ALWAYS run project's TEST command (from ${PATHS.CONTEXT})
|
|
14180
14410
|
ALWAYS check implementation matches ${PATHS.DOCS}/
|
|
14181
14411
|
ALWAYS update ${PATHS.TODO} checkboxes ONLY after verification
|
|
14182
14412
|
ALWAYS provide ${WORK_STATUS.TEST_RESULT.PASS}/${WORK_STATUS.TEST_RESULT.FAIL} with evidence
|
|
@@ -14186,25 +14416,44 @@ ${PROMPT_TAGS.REQUIRED_ACTIONS.close}`;
|
|
|
14186
14416
|
|
|
14187
14417
|
// src/agents/prompts/reviewer/verification.ts
|
|
14188
14418
|
var REVIEWER_VERIFICATION = `${PROMPT_TAGS.VERIFICATION_PROCESS.open}
|
|
14189
|
-
|
|
14190
|
-
lsp_diagnostics - Must show no errors
|
|
14191
|
-
|
|
14192
|
-
## Step 2: Build Check
|
|
14193
|
-
npm run build - Must pass
|
|
14194
|
-
|
|
14195
|
-
## Step 3: Test Check
|
|
14196
|
-
npm test - Must pass
|
|
14197
|
-
Tests must exist for new code
|
|
14419
|
+
\u{1F50D} ADAPTIVE VERIFICATION PROCESS
|
|
14198
14420
|
|
|
14199
|
-
## Step
|
|
14200
|
-
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
|
|
14421
|
+
## Step 1: Read Project Context
|
|
14422
|
+
\`\`\`bash
|
|
14423
|
+
cat ${PATHS.CONTEXT} # Get build/test commands
|
|
14424
|
+
\`\`\`
|
|
14425
|
+
- Identify the BUILD command for this project
|
|
14426
|
+
- Identify the TEST command for this project
|
|
14427
|
+
- Note any project-specific verification requirements
|
|
14428
|
+
|
|
14429
|
+
## Step 2: Static Analysis
|
|
14430
|
+
lsp_diagnostics - Must show NO errors or warnings
|
|
14431
|
+
|
|
14432
|
+
## Step 3: Build Verification
|
|
14433
|
+
- Run the project's BUILD command (from ${PATHS.CONTEXT})
|
|
14434
|
+
- Must pass without errors
|
|
14435
|
+
- Watch for deprecation warnings
|
|
14436
|
+
|
|
14437
|
+
## Step 4: Test Verification
|
|
14438
|
+
- Run the project's TEST command (from ${PATHS.CONTEXT})
|
|
14439
|
+
- ALL tests must pass
|
|
14440
|
+
- New code MUST have corresponding tests
|
|
14441
|
+
|
|
14442
|
+
## Step 5: Documentation Compliance
|
|
14443
|
+
- Compare implementation with ${PATHS.DOCS}/
|
|
14444
|
+
- API usage must match official documentation
|
|
14445
|
+
- Check for breaking changes
|
|
14446
|
+
|
|
14447
|
+
## Step 6: Pattern Verification
|
|
14448
|
+
- Does the code follow EXISTING patterns in codebase?
|
|
14449
|
+
- Naming conventions consistent?
|
|
14450
|
+
- Error handling consistent?
|
|
14451
|
+
|
|
14452
|
+
## Step 7: Mark Complete (ONLY after ALL pass)
|
|
14204
14453
|
In ${PATHS.TODO}:
|
|
14205
|
-
- [x] T1: [task] | verified | evidence:
|
|
14454
|
+
- [x] T1: [task] | verified | evidence: [build/test results]
|
|
14206
14455
|
|
|
14207
|
-
|
|
14456
|
+
\u26A0\uFE0F NEVER mark [x] without running ACTUAL verification commands!
|
|
14208
14457
|
${PROMPT_TAGS.VERIFICATION_PROCESS.close}`;
|
|
14209
14458
|
|
|
14210
14459
|
// src/agents/prompts/reviewer/todo-update.ts
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "opencode-orchestrator",
|
|
3
3
|
"displayName": "OpenCode Orchestrator",
|
|
4
4
|
"description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.22",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|