{"_id":"@capybearista/opencode-output-styles","_rev":"3-4c9ee0ac078013442d16ea470241682a","name":"@capybearista/opencode-output-styles","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0":{"name":"@capybearista/opencode-output-styles","version":"0.0.0","keywords":["opencode","opencode-plugin","opencode-styles","output-styles"],"author":{"name":"capyBearista","email":"capybearista@gmail.com"},"license":"MPL-2.0","_id":"@capybearista/opencode-output-styles@0.0.0","maintainers":[{"name":"capybearista","email":"capybearista@gmail.com"}],"homepage":"https://github.com/capybearista/opencode-output-styles#readme","bugs":{"url":"https://github.com/capybearista/opencode-output-styles/issues"},"dist":{"shasum":"c29e29e04accb8fe1de1a68679661fac35b4402d","tarball":"https://registry.npmjs.org/@capybearista/opencode-output-styles/-/opencode-output-styles-0.0.0.tgz","fileCount":11,"integrity":"sha512-hDDIXEmwSy5TfC2rBCadpp5MTPC33vKHGkWG8TU9MmMTgrQDmVEJeOhYWLNa+qUk2kAOpfPDMWOz+vHA0H0LBw==","signatures":[{"sig":"MEUCIQDU7DUTL3ga2qqXqMtHWZDdxCnxgJwMQQb/N3Rko/pUDgIgfWQW7t74wrcEGpK1StApdckGa3Bn9N/sb6BCTSyJm3s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34930},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"opencode":"^1.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"268d8abc732eede8b3504cbc270c6661cceb00e9","scripts":{"ci":"bunx @biomejs/biome ci .","lint":"bunx @biomejs/biome check .","test":"bun test","build":"tsc","check":"bunx @biomejs/biome check --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"capybearista","email":"capybearista@gmail.com"},"repository":{"url":"git+https://github.com/capybearista/opencode-output-styles.git","type":"git"},"_npmVersion":"10.9.3","description":"Output styles plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"yaml":"^2.4.5"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.0.0","git-cliff":"^2.0.0","@types/bun":"latest","typescript":"^5.8.0","@biomejs/biome":"2.4.13","@commitlint/cli":"^19.0.0","@tsconfig/node22":"^22.0.0","@opencode-ai/plugin":">=1.14.0","@commitlint/config-conventional":"^19.0.0"},"peerDependencies":{"@opencode-ai/plugin":">=1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/opencode-output-styles_0.0.0_1777664236715_0.409775677677108","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@capybearista/opencode-output-styles","version":"1.0.0","author":{"name":"capyBearista","email":"capybearista@github.com"},"license":"MPL-2.0","_id":"@capybearista/opencode-output-styles@1.0.0","maintainers":[{"name":"capybearista","email":"capybearista@gmail.com"}],"homepage":"https://github.com/capyBearista/opencode-plugins#readme","bugs":{"url":"https://github.com/capyBearista/opencode-plugins/issues"},"dist":{"shasum":"9c5c626045dde7758ce42c224ff1c73991729b66","tarball":"https://registry.npmjs.org/@capybearista/opencode-output-styles/-/opencode-output-styles-1.0.0.tgz","fileCount":11,"integrity":"sha512-fsV6pgCb4dlSXwWcgxggNmPYT2V/XknoIN58UXWP0YUBffFcB0OFyFZ92XJ3ecPhiunlTQwalwepgWnD5xUO3A==","signatures":[{"sig":"MEUCIQDRU9hf7qUO9FtZkYMyC7gLpeLsII+XObyredM8igLILwIgcpKeXudPehBKAFlvp3Darq0GtHbxXecfyoixNVVVx/8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capybearista%2fopencode-output-styles@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":43696},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"e28f9ac5c7ce3cd6068ff7145e763d0f03c19328","scripts":{"ci":"bunx @biomejs/biome ci .","lint":"bunx @biomejs/biome check .","test":"bun test","build":"rm -rf dist && tsc","check":"bunx @biomejs/biome check --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:71d77242-499a-4c30-b873-9e98a0921877"}},"repository":{"url":"git+https://github.com/capyBearista/opencode-plugins.git","type":"git","directory":"packages/opencode-output-styles"},"_npmVersion":"11.11.0","description":"Output styles plugin for OpenCode","directories":{},"_nodeVersion":"24.14.1","dependencies":{"yaml":"^2.4.5"},"_hasShrinkwrap":false,"devDependencies":{"@opencode-ai/plugin":">=1.14.0"},"peerDependencies":{"@opencode-ai/plugin":">=1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/opencode-output-styles_1.0.0_1777846523154_0.6835716375612075","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@capybearista/opencode-output-styles","version":"1.0.1","description":"Output styles plugin for OpenCode","author":{"name":"capyBearista","email":"capybearista@github.com"},"repository":{"type":"git","url":"git+https://github.com/capyBearista/opencode-plugins.git","directory":"packages/opencode-output-styles"},"type":"module","license":"MPL-2.0","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"rm -rf dist && tsc","typecheck":"tsc --noEmit","lint":"bunx @biomejs/biome check .","check":"bunx @biomejs/biome check --write .","ci":"bunx @biomejs/biome ci .","test":"bun test"},"dependencies":{"yaml":"^2.4.5"},"peerDependencies":{"@opencode-ai/plugin":">=1.14.0"},"devDependencies":{"@opencode-ai/plugin":">=1.14.0"},"gitHead":"9ac013a3f7ca197b9675dc2aae7e097c14cbe030","_id":"@capybearista/opencode-output-styles@1.0.1","bugs":{"url":"https://github.com/capyBearista/opencode-plugins/issues"},"homepage":"https://github.com/capyBearista/opencode-plugins#readme","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-butEhmEaMGYyE2jLaa1NL0DkrfaczMyru3X82KbP1+uCV3bWwrCscKHUklE/f4a7jtpNoqEUr+vFutXGH0jCZQ==","shasum":"b8b7296273e2c5d94dfc80e71b001e3c1b3b07e5","tarball":"https://registry.npmjs.org/@capybearista/opencode-output-styles/-/opencode-output-styles-1.0.1.tgz","fileCount":11,"unpackedSize":43766,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capybearista%2fopencode-output-styles@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA0AL+qmMyneiuWOkwt4+t8iV/R1HxajV+OmyFneRZh6AiBj4Nr+Fh2CckD3mMC7brEOUb4AdHKkv9EIi35znJQXEA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:71d77242-499a-4c30-b873-9e98a0921877"}},"directories":{},"maintainers":[{"name":"capybearista","email":"capybearista@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opencode-output-styles_1.0.1_1777861703688_0.901614781871966"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-01T19:37:16.564Z","modified":"2026-05-04T02:28:24.100Z","0.0.0":"2026-05-01T19:37:16.857Z","1.0.0":"2026-05-03T22:15:23.300Z","1.0.1":"2026-05-04T02:28:23.853Z"},"bugs":{"url":"https://github.com/capyBearista/opencode-plugins/issues"},"author":{"name":"capyBearista","email":"capybearista@github.com"},"license":"MPL-2.0","homepage":"https://github.com/capyBearista/opencode-plugins#readme","repository":{"type":"git","url":"git+https://github.com/capyBearista/opencode-plugins.git","directory":"packages/opencode-output-styles"},"description":"Output styles plugin for OpenCode","maintainers":[{"name":"capybearista","email":"capybearista@gmail.com"}],"readme":"# opencode-output-styles\n\n<p align=\"center\">Reusable response styles for OpenCode sessions</p>\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@capybearista/opencode-output-styles\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/@capybearista/opencode-output-styles?style=flat-square&logo=npm\" /></a>\n  <a href=\"https://www.npmjs.com/package/@capybearista/opencode-output-styles\"><img alt=\"npm\" src=\"https://img.shields.io/npm/d18m/@capybearista/opencode-output-styles?style=flat-square&logo=npm\" /></a>\n  <a href=\"https://opencode.ai\"><img alt=\"opencode\" src=\"https://img.shields.io/badge/OpenCode-Plugin-blue?style=flat-square\" /></a>\n  <a href=\"https://opensource.org/licenses/MPL-2.0\"><img alt=\"license\" src=\"https://img.shields.io/badge/License-MPL--2.0-blue.svg?style=flat-square\" /></a>\n</p>\n\n---\n\n## Why?\n\n> I often find myself telling my agent to adopt an explanatory style or focus on teaching rather than implementing. I really needed a way to add persistent voice, review stance, or response structure without re-prompting every turn. This plugin keeps a chosen style active and appends it to the system prompt so response formatting stays consistent across the session.\n\n## Philosophy: Extending OpenCode\n\nOpenCode is designed to be extensible through plugins. This plugin takes the narrowest useful path: it does not rewrite the base OpenCode prompt, and it does not try to change model behavior outside the style block. It simply discovers styles, persists the active selection, and injects the chosen style wrapped in `<output-style>` tags into the system prompt.\n\n### Architecture\n\n```text\nsrc/\n├── index.ts           # Plugin hooks (thin barrel)\n├── styles.ts          # Style parsing, discovery, built-in loading\n└── built-in-styles/   # Shipped output styles\n    ├── explanatory.md\n    └── learning.md\n```\n\n## Features\n\n- Ships built-in styles inspired by Claude Code (`explanatory`, `learning`) out of the box\n- Discovers global styles from `~/.config/opencode/output-styles/`\n- Discovers project-local styles from `.opencode/output-styles/`\n- Activates styles with `/output-style <id>`\n- Persists the active style in `.opencode/active-style.json`\n- Injects the selected style wrapped in `<output-style>` tags into the system prompt\n- Marks built-in styles with `[Built-in]` in the style listing\n- Supports overriding: user styles take precedence over built-in styles with the same id\n\n## Install\n\nAdd the plugin to `opencode.json` or `opencode.jsonc`:\n\n```json\n{\n  \"plugin\": [\"@capybearista/opencode-output-styles\"]\n}\n```\n\nYou can also install it through the CLI:\n\n```bash\nopencode plugin -g @capybearista/opencode-output-styles    # global install\nopencode plugin @capybearista/opencode-output-styles       # project-local install\n```\n\n## Usage\n\n### Built-in styles\n\nThe plugin ships with two built-in styles that are available immediately:\n\n| Id | Name | Description |\n| --- | --- | --- |\n| `explanatory` | explanatory | Provides educational insights while helping with tasks |\n| `learning` | learning | Interactive learning mode for CS students |\n\nUse them like any other style:\n\n```text\n/output-style explanatory\n/output-style learning\n```\n\n### Custom styles\n\nCreate a markdown file in `~/.config/opencode/output-styles/` or `<project-root>/.opencode/output-styles/` with YAML frontmatter:\n\n```md\n---\nname: \"Pirate\"\ndescription: \"Talks like a pirate\"\n---\n# Pirate\nYou must respond like a swashbuckling pirate.\n```\n\n### Overriding built-in styles\n\nTo replace a built-in style with your own version, create a markdown file with the **same id** (same filename without `.md`) in one of the user style directories. Your version takes precedence over the built-in.\n\nFor example, to override `explanatory` with a custom version, create `~/.config/opencode/output-styles/explanatory.md` or `<project-root>/.opencode/output-styles/explanatory.md`.\n\n### Commands\n\n| Command | Description |\n| --- | --- |\n| `/output-style` | Lists all available styles (built-in and user) |\n| `/output-style <id>` | Activates the specified style |\n| `/output-style clear` | Removes the active style |\n\n## Configuration\n\nStyle files support the following frontmatter:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Display name shown in the `/output-style` list. Defaults to the filename. |\n| `description` | `string` | Short summary shown in the `/output-style` list. Defaults to empty. |\n\nThe active style's body is wrapped in `<output-style>` tags and appended to the system prompt:\n\n```text\n<output-style>\n...style body...\n</output-style>\n```\n\nThe plugin also writes one project-local state file:\n\n| File | Purpose |\n| --- | --- |\n| `.opencode/active-style.json` | Stores the currently selected style id for the project. |\n\n## Troubleshooting\n\n- If `/output-style` shows no results, confirm your style files end in `.md` and include YAML frontmatter.\n- If two styles share the same filename, the project-local version takes precedence over the global one, which takes precedence over the built-in.\n- The `/output-style` command currently uses a plugin API workaround that throws a handled error to short-circuit the command pipeline, because the plugin API does not yet expose a clean command short-circuit path.\n\n## Contributing\n\nThis package lives in the `opencode-plugins` monorepo.\n\n- Run `bun run build`, `bun run typecheck`, `bun run lint`, and `bun test` before opening a PR.\n- Keep the plugin focused on style discovery, persistence, and prompt appending.\n- Prefer small, direct changes over expanding the plugin into broader prompt-rewriting behavior.\n\nPlease open an issue or check for existing ones before creating a pull request.\n\n## License\n\n[MPL-2.0](LICENSE.md)\n","readmeFilename":"README.md"}