|
| 1 | +# Contributing to the Integration Catalog |
| 2 | + |
| 3 | +This guide covers adding integrations to both the **built-in** and **community** catalogs. |
| 4 | + |
| 5 | +## Adding a Built-In Integration |
| 6 | + |
| 7 | +Built-in integrations are maintained by the Spec Kit core team and ship with the CLI. |
| 8 | + |
| 9 | +### Checklist |
| 10 | + |
| 11 | +1. **Create the integration subpackage** under `src/specify_cli/integrations/<name>/` |
| 12 | +2. **Implement the integration class** extending `MarkdownIntegration`, `TomlIntegration`, or `SkillsIntegration` |
| 13 | +3. **Register the integration** in `src/specify_cli/integrations/__init__.py` |
| 14 | +4. **Add tests** under `tests/integrations/test_integration_<name>.py` |
| 15 | +5. **Add a catalog entry** in `integrations/catalog.json` |
| 16 | +6. **Update documentation** in `AGENTS.md` and `README.md` |
| 17 | + |
| 18 | +### Catalog Entry Format |
| 19 | + |
| 20 | +Add your integration to `integrations/catalog.json`: |
| 21 | + |
| 22 | +```json |
| 23 | +{ |
| 24 | + "my-agent": { |
| 25 | + "id": "my-agent", |
| 26 | + "name": "My Agent", |
| 27 | + "version": "1.0.0", |
| 28 | + "description": "Integration for My Agent", |
| 29 | + "author": "spec-kit-core", |
| 30 | + "repository": "https://github.com/github/spec-kit", |
| 31 | + "tags": ["cli"] |
| 32 | + } |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Adding a Community Integration |
| 37 | + |
| 38 | +Community integrations are contributed by external developers and listed in `integrations/catalog.community.json` for discovery. |
| 39 | + |
| 40 | +### Prerequisites |
| 41 | + |
| 42 | +1. **Working integration** — tested with `specify integration install` |
| 43 | +2. **Public repository** — hosted on GitHub or similar |
| 44 | +3. **`integration.yml` descriptor** — valid descriptor file (see below) |
| 45 | +4. **Documentation** — README with usage instructions |
| 46 | +5. **License** — open source license file |
| 47 | + |
| 48 | +### `integration.yml` Descriptor |
| 49 | + |
| 50 | +Every community integration must include an `integration.yml`: |
| 51 | + |
| 52 | +```yaml |
| 53 | +schema_version: "1.0" |
| 54 | +integration: |
| 55 | + id: "my-agent" |
| 56 | + name: "My Agent" |
| 57 | + version: "1.0.0" |
| 58 | + description: "Integration for My Agent" |
| 59 | + author: "your-name" |
| 60 | + repository: "https://github.com/your-name/speckit-my-agent" |
| 61 | + license: "MIT" |
| 62 | +requires: |
| 63 | + speckit_version: ">=0.6.0" |
| 64 | + tools: |
| 65 | + - name: "my-agent" |
| 66 | + version: ">=1.0.0" |
| 67 | + required: true |
| 68 | +provides: |
| 69 | + commands: |
| 70 | + - name: "speckit.specify" |
| 71 | + file: "templates/speckit.specify.md" |
| 72 | + scripts: |
| 73 | + - update-context.sh |
| 74 | +``` |
| 75 | +
|
| 76 | +### Descriptor Validation Rules |
| 77 | +
|
| 78 | +| Field | Rule | |
| 79 | +|-------|------| |
| 80 | +| `schema_version` | Must be `"1.0"` | |
| 81 | +| `integration.id` | Lowercase alphanumeric + hyphens (`^[a-z0-9-]+$`) | |
| 82 | +| `integration.version` | Valid semantic version | |
| 83 | +| `requires.speckit_version` | PEP 440 version specifier | |
| 84 | +| `provides` | Must include at least one command or script | |
| 85 | +| `provides.commands[].name` | String identifier | |
| 86 | +| `provides.commands[].file` | Relative path to template file | |
| 87 | + |
| 88 | +### Submitting to the Community Catalog |
| 89 | + |
| 90 | +1. **Fork** the [spec-kit repository](https://github.com/github/spec-kit) |
| 91 | +2. **Add your entry** to `integrations/catalog.community.json`: |
| 92 | + |
| 93 | +```json |
| 94 | +{ |
| 95 | + "my-agent": { |
| 96 | + "id": "my-agent", |
| 97 | + "name": "My Agent", |
| 98 | + "version": "1.0.0", |
| 99 | + "description": "Integration for My Agent", |
| 100 | + "author": "your-name", |
| 101 | + "repository": "https://github.com/your-name/speckit-my-agent", |
| 102 | + "tags": ["cli"] |
| 103 | + } |
| 104 | +} |
| 105 | +``` |
| 106 | + |
| 107 | +3. **Open a pull request** with: |
| 108 | + - Your catalog entry |
| 109 | + - Link to your integration repository |
| 110 | + - Confirmation that `integration.yml` is valid |
| 111 | + |
| 112 | +### Version Updates |
| 113 | + |
| 114 | +To update your integration version in the catalog: |
| 115 | + |
| 116 | +1. Release a new version of your integration |
| 117 | +2. Open a PR updating the `version` field in `catalog.community.json` |
| 118 | +3. Ensure backward compatibility or document breaking changes |
| 119 | + |
| 120 | +## Upgrade Workflow |
| 121 | + |
| 122 | +The `specify integration upgrade` command supports diff-aware upgrades: |
| 123 | + |
| 124 | +1. **Hash comparison** — the manifest records SHA-256 hashes of all installed files |
| 125 | +2. **Modified file detection** — files changed since installation are flagged |
| 126 | +3. **Safe default** — modified files are preserved unless `--force` is used |
| 127 | +4. **Clean reinstall** — unmodified files are replaced with the latest version |
| 128 | + |
| 129 | +```bash |
| 130 | +# Upgrade current integration (blocks if files are modified) |
| 131 | +specify integration upgrade |
| 132 | +
|
| 133 | +# Force upgrade (overwrites modified files) |
| 134 | +specify integration upgrade --force |
| 135 | +``` |
0 commit comments