Drift types are defined in references/drift-types.md and detected by the drift-detector agent.
To add a new drift type:
- Define it in
references/drift-types.mdwith: name, default severity, definition, examples, detection strategy - Add detection logic to
.claude/agents/drift-detector.md(classification section) - Add scoring for the new type in the drift-analysis skill
- Update
templates/drift-protocol.yamlto include the new type in severity overrides - Update
references/spec-schema.mdif the type requires new spec fields
- Create a directory in
adapters/<your-cli>/ - Wrap the prompts from
prompts/in your CLI's native configuration format - Update
install.shto detect your CLI and install the adapter - Add an entry to the Platform Support table in
README.md
- All 5 commands represented (drift-lock, drift-check, drift-fence, drift-status, drift-report)
- References to drift types and spec schema included
- Installation instructions in the adapter
- Detection logic added to
install.sh
Severity levels are used throughout the system. To modify:
- Update
references/drift-types.mdwith new defaults - Update the scoring weights in
templates/drift-protocol.yaml - Update the drift-analysis skill's scoring section
- Update the drift-detector agent's severity assignment logic
- Update the compliance-auditor agent's scoring computation
Important: Changing severity levels affects drift scores across all projects using Agent-Drift. Consider adding severity overrides to drift-protocol.yaml instead of changing defaults.
To add new fields to the spec schema:
- Define the field in
references/spec-schema.md - Add extraction logic to the
spec-extractoragent - Add parsing logic to the
intent-captureskill - Add analysis logic to the
drift-analysisskill anddrift-detectoragent - Update
templates/drift-protocol.yamlif the field is configurable
Since Agent-Drift is a prompt-based plugin (no runtime code), testing is manual:
- Install the plugin in a test project
- Run
/drift-lockwith sample instructions - Verify the spec is correctly parsed
- Make changes that should trigger each drift type
- Run
/drift-checkand verify detection - Add a constraint with
/drift-fenceand verify enforcement - Run
/drift-reportand verify the verdict
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes following the conventions above
- Commit with a descriptive message (
git commit -m "Add: description of change") - Push to your fork (
git push origin feature/your-feature) - Open a Pull Request against
main
Pull requests should include:
- Description of what changed and why
- Any testing you performed
- Reference to related issues (if applicable)