Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add Hisham-Hussein/claude-forge --skill "fix-drift"
Install specific skill from multi-skill repository
# Description
Use when fixing contract drifts between directives and scripts, correcting misalignments after running contract verification, or resolving detected drift issues. Triggers include "fix drift", "correct drift", "resolve misalignment", "fix contract", or when drift has been detected by contract-driven-integration skill.
# SKILL.md
name: fix-drift
description: Use when fixing contract drifts between directives and scripts, correcting misalignments after running contract verification, or resolving detected drift issues. Triggers include "fix drift", "correct drift", "resolve misalignment", "fix contract", or when drift has been detected by contract-driven-integration skill.
Automatically correct drifts detected by the contract-driven-integration skill. Completes the detect-fix loop by analyzing drift direction and applying appropriate corrections.
Drift fixes go in one of two directions:
| Drift Type | Direction | What to Update |
|---|---|---|
| Script Drift | Script does more than directive documents | Update directive to document the behavior |
| Directive Drift | Directive promises more than script delivers | Update script to implement the promise |
Default recommendations:
- Script drift (extra fields, undocumented behavior) β Fix directive (document it)
- Directive drift (missing implementation) β Fix script (implement it)
User always chooses final direction.
This is assisted correction, not blind automation:
- Always show what was detected
- Always recommend a fix direction with reasoning
- Always ask user to confirm before applying
- Never delete code or documentation without explicit approval
After each fix:
1. Re-run drift detection on the affected directive
2. Confirm drift is resolved
3. Update mapping file status to "aligned"
What would you like to do?
- Detect and propose fixes - Run drift detection, analyze results, propose corrections
- Fix directive - Update directive to match what script actually does
- Fix script - Update script to match what directive promises
- Re-verify - Check if previous fixes resolved the drift
Provide the directive path with your selection.
| Response | Workflow | Purpose |
|----------|----------|---------|
| 1, "detect", "propose", "check", "analyze" | workflows/detect-and-propose.md | Full analysis with recommendations |
| 2, "fix directive", "update directive", "document" | workflows/fix-directive.md | Add missing documentation |
| 3, "fix script", "update script", "implement" | workflows/fix-script.md | Add missing implementation |
| 4, "verify", "re-check", "confirm" | Re-run contract-driven-integration detect-drift | Verify alignment |
After selecting a workflow, read it and follow exactly.
Most common flow:
- User runs
/fix-drift path/to/directive - Skill invokes contract-driven-integration to detect drift
- Skill analyzes each drift item and proposes fix direction
- User approves fixes
- Skill applies corrections and verifies alignment
Drift correction complete when:
- [ ] All drift items addressed (fixed or explicitly deferred)
- [ ] Verification shows no remaining drift
- [ ] Mapping file updated to "aligned" status
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.