fix(skills): correct invalid task tool references
This commit is contained in:
@@ -11,14 +11,14 @@ Read-only GitHub triage orchestrator. Fetch open issues/PRs, classify, spawn 1 b
|
|||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
**1 ISSUE/PR = 1 TASKCREATE = 1 `quick` SUBAGENT (background). NO EXCEPTIONS.**
|
**1 ISSUE/PR = 1 `task_create` = 1 `quick` SUBAGENT (background). NO EXCEPTIONS.**
|
||||||
|
|
||||||
| Rule | Value |
|
| Rule | Value |
|
||||||
|------|-------|
|
|------|-------|
|
||||||
| Category | `quick` |
|
| Category | `quick` |
|
||||||
| Execution | `run_in_background=true` |
|
| Execution | `run_in_background=true` |
|
||||||
| Parallelism | ALL items simultaneously |
|
| Parallelism | ALL items simultaneously |
|
||||||
| Tracking | `TaskCreate` per item |
|
| Tracking | `task_create` per item |
|
||||||
| Output | `/tmp/{YYYYMMDD-HHmmss}/issue-{N}.md` or `pr-{N}.md` |
|
| Output | `/tmp/{YYYYMMDD-HHmmss}/issue-{N}.md` or `pr-{N}.md` |
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -140,7 +140,7 @@ fi
|
|||||||
|
|
||||||
```
|
```
|
||||||
For each item:
|
For each item:
|
||||||
1. TaskCreate(subject="Triage: #{number} {title}")
|
1. task_create(subject="Triage: #{number} {title}")
|
||||||
2. task(category="quick", run_in_background=true, load_skills=[], prompt=SUBAGENT_PROMPT)
|
2. task(category="quick", run_in_background=true, load_skills=[], prompt=SUBAGENT_PROMPT)
|
||||||
3. Store mapping: item_number -> { task_id, background_task_id }
|
3. Store mapping: item_number -> { task_id, background_task_id }
|
||||||
```
|
```
|
||||||
@@ -482,7 +482,7 @@ NEVER merge. NEVER comment. NEVER review. Write to file ONLY.
|
|||||||
|
|
||||||
Poll `background_output()` per task. As each completes:
|
Poll `background_output()` per task. As each completes:
|
||||||
1. Parse report.
|
1. Parse report.
|
||||||
2. `TaskUpdate(id=task_id, status="completed", description=REPORT_SUMMARY)`
|
2. `task_update(id=task_id, status="completed", description=REPORT_SUMMARY)`
|
||||||
3. Stream to user immediately.
|
3. Stream to user immediately.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ Use the git-master skill's atomic commit principles. The reason for atomic commi
|
|||||||
Each commit should pair implementation with its tests. Load `git-master` skill when committing:
|
Each commit should pair implementation with its tests. Load `git-master` skill when committing:
|
||||||
|
|
||||||
```
|
```
|
||||||
task(category="git", load_skills=["git-master"], prompt="Commit the changes atomically following git-master conventions. Repository is at {WORKTREE_PATH}.")
|
task(category="quick", load_skills=["git-master"], prompt="Commit the changes atomically following git-master conventions. Repository is at {WORKTREE_PATH}.")
|
||||||
```
|
```
|
||||||
|
|
||||||
### Pre-push local validation
|
### Pre-push local validation
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/// <reference types="bun-types" />
|
||||||
|
|
||||||
|
import { describe, expect, test } from "bun:test"
|
||||||
|
import { readFileSync } from "node:fs"
|
||||||
|
import { join } from "node:path"
|
||||||
|
import { fileURLToPath } from "node:url"
|
||||||
|
|
||||||
|
const PROJECT_ROOT = fileURLToPath(new URL("../../..", import.meta.url))
|
||||||
|
|
||||||
|
function readProjectSkill(...segments: string[]) {
|
||||||
|
return readFileSync(join(PROJECT_ROOT, ".opencode", "skills", ...segments, "SKILL.md"), "utf8")
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("project skill tool references", () => {
|
||||||
|
describe("#given work-with-pr skill instructions", () => {
|
||||||
|
test("#when reading the commit delegation example #then it uses a real task category", () => {
|
||||||
|
const skillContent = readProjectSkill("work-with-pr")
|
||||||
|
|
||||||
|
const usesQuickCategory = skillContent.includes(
|
||||||
|
'task(category="quick", load_skills=["git-master"], prompt="Commit the changes atomically following git-master conventions. Repository is at {WORKTREE_PATH}.")'
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(usesQuickCategory).toBe(true)
|
||||||
|
expect(skillContent).not.toContain('task(category="git"')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("#given github-triage skill instructions", () => {
|
||||||
|
test("#when reading task tracking examples #then they use the real task management tool names", () => {
|
||||||
|
const skillContent = readProjectSkill("github-triage")
|
||||||
|
|
||||||
|
const usesRealToolNames =
|
||||||
|
skillContent.includes("task_create(subject=\"Triage: #{number} {title}\")")
|
||||||
|
&& skillContent.includes("task_update(id=task_id, status=\"completed\", description=REPORT_SUMMARY)")
|
||||||
|
|
||||||
|
expect(usesRealToolNames).toBe(true)
|
||||||
|
expect(skillContent).not.toContain("TaskCreate(")
|
||||||
|
expect(skillContent).not.toContain("TaskUpdate(")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user