Skip to content

feat:12309 feat:16012 and others: Command and Agent Library Interface#16239

Closed
xman2000 wants to merge 15 commits intoanomalyco:devfrom
xman2000:dev
Closed

feat:12309 feat:16012 and others: Command and Agent Library Interface#16239
xman2000 wants to merge 15 commits intoanomalyco:devfrom
xman2000:dev

Conversation

@xman2000
Copy link
Copy Markdown

@xman2000 xman2000 commented Mar 5, 2026

There are a few requests for UI's for the commands and agents such as

#12309
#16012

This PR introduces a markdown-based library workflow for reusable commands and agents, and applies it consistently across the Desktop app and TUI.

The core model is now file-based:

commands from .opencode/command//*.md
agents from .opencode/agent/
/*.md

Metadata for both objects is supported end-to-end (title, description, summary, category, icon, tags), with command-specific fields (agent, model, subtask) and existing agent configuration behavior preserved.

On Desktop, the Library panel now supports category browsing, command search, hover details, command/agent folder actions, and an agent pulldown for insertion context. Command selection inserts content into the composer without auto-send. Two root actions are available at the bottom of the list: Create a New Command and Create a New Agent which allow the user to create new commands and agents that are properly formatted and stored correctly.

On TUI, the sidebar flow has been updated to command/agent terminology and command insertion behavior.

Library content in this branch includes:

a full command set under .opencode/command/
AI commands grouped under .opencode/command/ai/
agent definitions under .opencode/agent/

Compatibility behavior is included:

nested command names remain valid; flat aliases are added when leaf names are unique
agent alias mapping resolves:
docs -> documentation
planning -> plan
triage -> troubleshooting

Documentation updates:

revised README.md fork section to describe current behavior
added .opencode/command/README.md and .opencode/agent/README.md
updated create-command and create-agent templates with explicit input placeholder:
<>

Validation:

bun run typecheck in packages/app
bun run typecheck in packages/opencode
targeted tests added/passing for:
command alias behavior (packages/opencode/test/config/config.test.ts)
agent alias behavior (packages/opencode/test/agent/agent.test.ts)

xman2000 added 14 commits March 3, 2026 19:43
This branch fully migrates the fork from legacy prompt JSON packs to a command/agent Library model across desktop and TUI. It removes prompt-pack infrastructure, introduces markdown-first command/agent authoring, and aligns UI behavior around safe insert mode.

What changed

Replaced legacy .opencode/prompts/*.json workflow with:
.opencode/command/**/*.md
.opencode/agent/**/*.md
Added large command and agent library content, including AI category and root “create new” actions.
Updated desktop Library panel:
command-focused browsing and search
agent selection pulldown (defaulting to build when available)
bottom single-line “Create a New Command/Agent” actions
improved hover details and icon handling
Updated TUI Library sidebar:
removed todo panel section
cleaned prompt-era naming/copy in command/agent flows
Added metadata support through config and API surfaces:
command: title, summary, category, icon, tags
agent: title, summary, category, icon, tags
Added compatibility behavior:
nested command names preserve path ids and add flat aliases when unique
agent aliases: docs -> documentation, planning -> plan, triage -> troubleshooting
Rewrote docs:
README.md fork section rewritten for the new Library model
added .opencode/command/README.md
added .opencode/agent/README.md
removed legacy prompt docs and packs
Behavior changes to call out

Prompt JSON packs are no longer supported.
Library content is now markdown commands and agents only.
Command insertion remains non-auto-send for safety.
Command naming may include nested path ids; unique leaf aliases are available.
Validation

bun run typecheck passed in:
packages/app
packages/opencode
New compatibility tests added and passing:
command alias behavior (config.test.ts)
agent alias behavior (agent.test.ts)
@xman2000 xman2000 requested a review from adamdotdevin as a code owner March 5, 2026 21:59
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

Hey! Your PR title Feature 12309 16012 and others: Command and Agent Library Interface doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@xman2000
Copy link
Copy Markdown
Author

xman2000 commented Mar 5, 2026

Issue for this PR

Closes #16012
Closes #12309

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR introduces a markdown-based library workflow for reusable commands and agents.

On Desktop, the Library panel now supports category browsing, command search, hover details, command/agent folder actions, and an agent pulldown for insertion context. Command selection inserts content into the composer without auto-send. Two root actions are available at the bottom of the list: Create a New Command and Create a New Agent which allow the user to create new commands and agents that are properly formatted and stored correctly.

On TUI, the sidebar flow has been updated to command/agent terminology and command insertion behavior.

A library of commands and agents has also been added and the schemas and instructions for both have been expanded.

Everything works with existing keyboard commands and functionality. The goal was to integrate new behavior without disrupting existing workflow.

How did you verify your code works?

I built both TUI and GUI versions including packaging to exe. I then installed the exe on another machine and verified it installed.

Screenshots / recordings

image image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@xman2000 xman2000 changed the title Feature 12309 16012 and others: Command and Agent Library Interface feat:12309 feat16012 and others: Command and Agent Library Interface Mar 5, 2026
@xman2000 xman2000 changed the title feat:12309 feat16012 and others: Command and Agent Library Interface feat:12309 feat:16012 and others: Command and Agent Library Interface Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 6, 2026
@github-actions github-actions bot closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant