|
| 1 | +# Platform Implementation Status |
| 2 | + |
| 3 | +All platform adapters in pb-spec are **fully implemented** and production-ready. |
| 4 | + |
| 5 | +## Supported Platforms |
| 6 | + |
| 7 | +| Platform | Status | Directory Structure | File Format | Global Install Support | |
| 8 | +| :--- | :--- | :--- | :--- | :--- | |
| 9 | +| **Claude Code** | ✅ Complete | `.claude/skills/<name>/SKILL.md` | YAML frontmatter + Markdown | ✅ Yes (`~/.claude/skills/`) | |
| 10 | +| **VS Code Copilot** | ✅ Complete | `.github/prompts/<name>.prompt.md` | Plain Markdown | ✅ Yes (`~/.copilot/prompts/`) | |
| 11 | +| **OpenCode** | ✅ Complete | `.opencode/skills/<name>/SKILL.md` | YAML frontmatter + Markdown | ✅ Yes (`~/.config/opencode/skills/`) | |
| 12 | +| **Gemini CLI** | ✅ Complete | `.gemini/commands/<name>.toml` | TOML (description + prompt) | ✅ Yes (`~/.gemini/commands/`) | |
| 13 | +| **OpenAI Codex** | ✅ Complete | `.codex/prompts/<name>.md` | YAML frontmatter + Markdown | ✅ Yes (`~/.codex/prompts/`) | |
| 14 | + |
| 15 | +## Implementation Details |
| 16 | + |
| 17 | +### Claude Code (`claude.py`) |
| 18 | + |
| 19 | +- Uses SKILL.md files with YAML frontmatter |
| 20 | +- Supports `CLAUDE_CONFIG_DIR` environment variable for custom config location |
| 21 | +- Installs reference files alongside skill files |
| 22 | + |
| 23 | +### VS Code Copilot (`copilot.py`) |
| 24 | + |
| 25 | +- Uses `.prompt.md` files without frontmatter |
| 26 | +- Simplest format - just raw prompt content |
| 27 | +- Self-contained prompts (no reference files) |
| 28 | + |
| 29 | +### OpenCode (`opencode.py`) |
| 30 | + |
| 31 | +- Uses SKILL.md files with YAML frontmatter |
| 32 | +- Supports XDG Base Directory specification (`XDG_CONFIG_HOME`) |
| 33 | +- Installs reference files alongside skill files |
| 34 | + |
| 35 | +### Gemini CLI (`gemini.py`) |
| 36 | + |
| 37 | +- Uses TOML format with `description` and `prompt` fields |
| 38 | +- Self-contained prompts (no reference files) |
| 39 | +- Handles quote escaping in TOML values |
| 40 | + |
| 41 | +### OpenAI Codex (`codex.py`) |
| 42 | + |
| 43 | +- Uses `.md` files with YAML frontmatter |
| 44 | +- Supports `CODEX_HOME` environment variable for custom config location |
| 45 | +- Self-contained prompts (no reference files) |
| 46 | + |
| 47 | +## Platform-Specific Features |
| 48 | + |
| 49 | +### Skill Loading Strategy |
| 50 | + |
| 51 | +- **Claude, OpenCode**: Use `load_skill_content()` (SKILL.md with frontmatter) |
| 52 | +- **Copilot, Gemini, Codex**: Use `load_prompt()` (simple prompt files) |
| 53 | + |
| 54 | +### Reference File Installation |
| 55 | + |
| 56 | +- **Claude, OpenCode**: Install reference files in `references/` subdirectory |
| 57 | +- **Copilot, Gemini, Codex**: Self-contained, no reference files needed |
| 58 | + |
| 59 | +## Usage Examples |
| 60 | + |
| 61 | +```bash |
| 62 | +# Install for all platforms |
| 63 | +pb-spec init --ai all |
| 64 | + |
| 65 | +# Install for specific platform |
| 66 | +pb-spec init --ai claude |
| 67 | +pb-spec init --ai copilot |
| 68 | +pb-spec init --ai opencode |
| 69 | +pb-spec init --ai gemini |
| 70 | +pb-spec init --ai codex |
| 71 | + |
| 72 | +# Global installation |
| 73 | +pb-spec init --ai claude -g |
| 74 | +``` |
| 75 | + |
| 76 | +## Testing |
| 77 | + |
| 78 | +All platform adapters are tested in `tests/test_platforms.py`: |
| 79 | + |
| 80 | +- Path generation (local and global) |
| 81 | +- Content rendering |
| 82 | +- File installation |
| 83 | +- Idempotency (skip existing files without `--force`) |
| 84 | + |
| 85 | +## Contributing |
| 86 | + |
| 87 | +When adding new platform support: |
| 88 | + |
| 89 | +1. Create a new file in `src/pb_spec/platforms/` |
| 90 | +2. Inherit from `Platform` base class |
| 91 | +3. Implement required abstract methods: |
| 92 | + - `name` property |
| 93 | + - `get_skill_path()` method |
| 94 | + - `render_skill()` method |
| 95 | +4. Add platform to `PLATFORMS` dict in `src/pb_spec/platforms/__init__.py` |
| 96 | +5. Add tests in `tests/test_platforms.py` |
| 97 | +6. Update this documentation |
0 commit comments