New harness adapter authoring
Runbook for authoring and publishing a new Apothem harness adapter.
Use this runbook when authoring a new harness adapter for first-party inclusion in Apothem or as a third-party package.
Prerequisites
- Familiarity with the HarnessAdapter protocol
- Understanding of the target harness config format
- Python 3.10+
Steps
1. Implement the adapter
Follow the Authoring a harness adapter
example to implement HarnessAdapter for the target harness.
If the adapter writes a plain-text template (a file that is not JSON or YAML)
with mode: write_text and ownership_class: operator-owned, uninstall
deletes the file only while it is an unedited copy of a template Apothem
shipped. When a later release changes the template, add the SHA-256 digest of
the previous text to that manifest entry's earlier_digests list in the same
change, or uninstall leaves every unedited copy the earlier release wrote in
place. Take the digest of the text at the latest release tag with
git show <tag>:<template path> | sha256sum; the template must carry no
${...} path token. tests/unit/test_template_digests.py fails when a shipped
template is not accounted for.
2. Write the docs page
Create site/content/docs/harnesses/<slug>.mdx covering:
- Installation flow
- Profile-to-native-config mapping
- Compatibility caveats
- Verification recipes
- Update and uninstall recipes
- Conformity gate surface
- Troubleshooting table
- Configuration knobs table
3. Write tests
tests/packaging/test_<slug>_adapter.py
tests/unit/test_<slug>_adapter.pyMinimum test coverage:
test_install_creates_expected_filestest_verify_passes_after_installtest_uninstall_removes_files
4. Verify locally
apothem install --harness <slug>
apothem verify --harness <slug>
python -m apothem.conformity.gate --all .5. Submit pull request
Open a PR with:
- Adapter implementation
- Docs page at
site/content/docs/harnesses/<slug>.mdx - Tests
- Entry-point registration in
pyproject.toml, aHARNESS_REGISTRYentry insrc/apothem/lib/harness_registry_data.py(bumpSUPPORTED_HARNESS_COUNTthere), and the ID in theharnessIdenum ofsrc/apothem/schemas/profile.schema.json - Changelog entry
Publisher Account Setup
Configure the npmjs.com trusted publisher for @ahmed-g-gad/apothem and the GitHub-side release prerequisites.
Cross-Machine Sync Verification Checklist
Verification procedure to confirm the Claude Code adapter installs, validates, and uninstalls correctly on a fresh host with full portability checks.