|
1 | 1 | # opencode-plugin-openspec |
2 | 2 |
|
3 | | -An OpenCode plugin that integrates OpenSpec. |
| 3 | +An OpenCode plugin that integrates OpenSpec, providing a dedicated agent for planning and specifying software architecture. |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
7 | | -- **New Mode: `openspec-plan`**: A dedicated planning mode that allows creating and editing OpenSpec files (`*.spec.md`), while keeping the rest of the codebase read-only. |
8 | | -- **Auto-Permission**: Automatically grants write permissions for openSpec files in `openspec-plan` mode. |
| 7 | +- **Auto-Detection**: Automatically detects if the current workspace is an OpenSpec project. |
| 8 | +- **New Agent: `openspec-plan`**: A dedicated agent mode for creating and editing OpenSpec files. |
| 9 | +- **Smart Permissions**: Automatically grants write permissions for: |
| 10 | + - `project.md` |
| 11 | + - `AGENTS.md` |
| 12 | + - `openspec/**` |
| 13 | + - `specs/**` |
| 14 | +- **Read-Only Safety**: Keeps the rest of the codebase read-only when using the `openspec-plan` agent, ensuring the implementation details are not accidentally modified during the planning phase. |
9 | 15 |
|
10 | 16 | ## Installation |
11 | 17 |
|
12 | | -(Instructions to be added) |
| 18 | +You don't need to build this plugin yourself. You can install it via npm or download the pre-built binary. |
| 19 | + |
| 20 | +### Option 1: Install via npm (Recommended) |
| 21 | + |
| 22 | +1. Install the plugin globally: |
| 23 | + ```bash |
| 24 | + npm install -g opencode-plugin-openspec |
| 25 | + ``` |
| 26 | + |
| 27 | +2. Add it to your `opencode.json` (usually in `~/.config/opencode/opencode.json` or `.opencode/opencode.json`): |
| 28 | + |
| 29 | + ```json |
| 30 | + { |
| 31 | + "plugin": [ |
| 32 | + "opencode-plugin-openspec" |
| 33 | + ] |
| 34 | + } |
| 35 | + ``` |
| 36 | + *(Note: If OpenCode doesn't support package names directly, you may need to provide the full path, e.g., `$(npm root -g)/opencode-plugin-openspec/dist/index.js`)* |
| 37 | + |
| 38 | +### Option 2: Download from Releases |
| 39 | + |
| 40 | +1. Go to the [Releases](https://github.com/yourusername/opencode-plugin-openspec/releases) page. |
| 41 | +2. Download the latest `index.js`. |
| 42 | +3. Place it anywhere on your disk. |
| 43 | +4. Add the path to your `opencode.json`: |
| 44 | + ```json |
| 45 | + { |
| 46 | + "plugin": [ |
| 47 | + "/absolute/path/to/downloaded/index.js" |
| 48 | + ] |
| 49 | + } |
| 50 | + ``` |
| 51 | + |
| 52 | +## Usage |
| 53 | + |
| 54 | +1. Open an OpenSpec project in OpenCode. |
| 55 | +2. The plugin will automatically detect the project structure. |
| 56 | +3. Switch to the **OpenSpec Architect** agent (colored #FF6B6B) in the agent selector. |
| 57 | +4. Start planning your architecture! The agent will have access to modify your spec files while keeping your code safe. |
| 58 | + |
| 59 | +## Development |
| 60 | + |
| 61 | +If you want to contribute or modify the plugin, follow these steps: |
| 62 | + |
| 63 | +1. Clone the repository: |
| 64 | + ```bash |
| 65 | + git clone https://github.com/yourusername/opencode-plugin-openspec.git |
| 66 | + cd opencode-plugin-openspec |
| 67 | + ``` |
| 68 | + |
| 69 | +2. Install dependencies: |
| 70 | + ```bash |
| 71 | + bun install |
| 72 | + ``` |
| 73 | + |
| 74 | +3. Build the plugin: |
| 75 | + ```bash |
| 76 | + bun run build |
| 77 | + ``` |
| 78 | + |
| 79 | +4. Run watch mode for development: |
| 80 | + ```bash |
| 81 | + bun run watch |
| 82 | + ``` |
| 83 | + |
| 84 | +## License |
| 85 | + |
| 86 | +MIT |
0 commit comments