Problem
/dag-template-update is documented as a compiled built-in command, and core already ships its prompt and v2 draft registration, but the executable v1 Command.Default registry does not register it. Invoking the documented command therefore reaches Command.get and throws Command not found: "dag-template-update".
User Impact
The documented no-git template refresh journey is completely blocked. Users following README/AGENTS guidance see an error instead of the preview, backup, and sync flow.
Evidence
packages/opencode/src/command/index.ts:48-59,120-156: Default and its layer register dag-flow, dag-init, and dag-auto, but not dag-template-update.
packages/core/src/plugin/command.ts:21,31-33,53-56: DagTemplateUpdateDescription and v2 draft.update exist, but DagTemplateUpdateContent is not exported.
packages/core/src/plugin/command/dag-template-update.txt: shipped prompt asset.
packages/opencode/src/session/prompt.ts:2036-2042: missing commands throw.
packages/server/src/handlers/command.ts:7: clients list commands through CommandV2.Service.list(), creating a listed-but-unexecutable mismatch.
README.md:111, README.zh.md:93, AGENTS.md:218: command is documented as built-in.
- Audit against
origin/main 31bd2d4: rg "dag-template-update|DAG_TEMPLATE_UPDATE" packages/opencode/src and rg "CommandV2" packages/opencode/src both return no matches.
Fix Requirements
- Export
DagTemplateUpdateContent from packages/core/src/plugin/command.ts, using the existing DAG_TEMPLATE_UPDATE_PROMPT import and the same pattern as DagFlowContent. Do not duplicate DagTemplateUpdateDescription.
- Add
DAG_TEMPLATE_UPDATE: "dag-template-update" to Command.Default.
- Register the built-in in the command layer using the existing DAG command pattern.
- Add a focused registration/resolution regression test in
packages/opencode/test/command/command.test.ts.
Non-goals
- Do not change command semantics, prompt text, or v2 draft registration.
- Do not add or change HTTP routes; SDK regeneration is not required.
- Do not rewrite documentation.
Acceptance Criteria
Command.get("dag-template-update") returns command info with DagTemplateUpdateDescription and the shipped template.
- Invoking
/dag-template-update no longer throws Command not found.
- Exactly one
DagTemplateUpdateDescription export exists.
- New and existing command tests pass.
Likely Code Locations
packages/opencode/src/command/index.ts
packages/core/src/plugin/command.ts
packages/opencode/test/command/command.test.ts
Verification
git grep -n "DAG_TEMPLATE_UPDATE" -- packages/opencode/src/command/index.ts
cd packages/opencode && bun test test/command/command.test.ts && bun typecheck
Problem
/dag-template-updateis documented as a compiled built-in command, and core already ships its prompt and v2 draft registration, but the executable v1Command.Defaultregistry does not register it. Invoking the documented command therefore reachesCommand.getand throwsCommand not found: "dag-template-update".User Impact
The documented no-git template refresh journey is completely blocked. Users following README/AGENTS guidance see an error instead of the preview, backup, and sync flow.
Evidence
packages/opencode/src/command/index.ts:48-59,120-156:Defaultand its layer registerdag-flow,dag-init, anddag-auto, but notdag-template-update.packages/core/src/plugin/command.ts:21,31-33,53-56:DagTemplateUpdateDescriptionand v2draft.updateexist, butDagTemplateUpdateContentis not exported.packages/core/src/plugin/command/dag-template-update.txt: shipped prompt asset.packages/opencode/src/session/prompt.ts:2036-2042: missing commands throw.packages/server/src/handlers/command.ts:7: clients list commands throughCommandV2.Service.list(), creating a listed-but-unexecutable mismatch.README.md:111,README.zh.md:93,AGENTS.md:218: command is documented as built-in.origin/main31bd2d4:rg "dag-template-update|DAG_TEMPLATE_UPDATE" packages/opencode/srcandrg "CommandV2" packages/opencode/srcboth return no matches.Fix Requirements
DagTemplateUpdateContentfrompackages/core/src/plugin/command.ts, using the existingDAG_TEMPLATE_UPDATE_PROMPTimport and the same pattern asDagFlowContent. Do not duplicateDagTemplateUpdateDescription.DAG_TEMPLATE_UPDATE: "dag-template-update"toCommand.Default.packages/opencode/test/command/command.test.ts.Non-goals
Acceptance Criteria
Command.get("dag-template-update")returns command info withDagTemplateUpdateDescriptionand the shipped template./dag-template-updateno longer throwsCommand not found.DagTemplateUpdateDescriptionexport exists.Likely Code Locations
packages/opencode/src/command/index.tspackages/core/src/plugin/command.tspackages/opencode/test/command/command.test.tsVerification