{
  "markdown": "# drift-detect\n\nDeep repository analysis to realign project plans with actual code reality.\n\n## Overview\n\nThe drift-detect plugin performs comprehensive analysis of your codebase to identify drift between documented plans and actual implementation. It uses pure JavaScript for data collection (no LLM overhead) and a single Sonnet call for deep semantic analysis.\n\n## Architecture\n\n```\n/drift-detect\n        │\n        ├─→ collectors.js (pure JavaScript)\n        │   ├─ scanGitHubState()       → issues, PRs, milestones\n        │   ├─ analyzeDocumentation()  → docs, plans, checkboxes\n        │   ├─ scanCodebase()          → structure, frameworks, health\n        │   └─ getRepoIntelSignals()   → doc-drift, area health (optional)\n        │\n        └─→ plan-synthesizer (Sonnet)\n            └─ Deep semantic analysis with full context\n```\n\n**Data collection**: No LLM calls - pure JavaScript\n**Semantic analysis**: Single Sonnet call with complete context\n**Token efficiency**: ~77% reduction vs. previous multi-agent architecture\n\n## Features\n\n- **Efficient data collection**: JavaScript collectors for deterministic extraction\n- **Deep semantic analysis**: Single Sonnet call for cross-referencing and insights\n- **Drift detection**: Identifies where plans have diverged from reality\n- **Gap analysis**: Finds missing tests, documentation, and implementation\n- **Priority ranking**: Context-aware prioritization\n- **Command-line flags**: No persistent settings files needed\n\n## Commands\n\n### `/drift-detect`\n\nRun a comprehensive reality check scan.\n\n```\n/drift-detect                              # Full scan (default)\n/drift-detect --sources github,docs        # Specific sources\n/drift-detect --depth quick                # Quick scan\n/drift-detect --output file --file report.md  # Custom output\n```\n\n| Flag | Values | Default | Description |\n|------|--------|---------|-------------|\n| `--sources` | github,docs,code | all three | Which sources to scan |\n| `--depth` | quick, thorough | thorough | How deep to analyze |\n| `--output` | file, display, both | both | Where to output results |\n| `--file` | path | drift-detect-report.md | Output file path |\n\n## Agent\n\n| Agent | Purpose | Model |\n|-------|---------|-------|\n| `plan-synthesizer` | Deep semantic analysis, drift detection, prioritization | sonnet |\n\n## Workflow\n\n```\n/drift-detect\n        │\n        ├─→ Parse command flags\n        │\n        ├─→ JavaScript Data Collection (parallel, no LLM)\n        │   ├─ scanGitHubState()\n        │   ├─ analyzeDocumentation()\n        │   └─ scanCodebase()\n        │\n        └─→ Single Sonnet Analysis Call\n            ├─ Cross-reference docs vs code\n            ├─ Identify drift patterns\n            ├─ Find gaps\n            └─ Generate prioritized plan\n                    │\n                    ▼\n           Reality Check Report\n```\n\n## Data Sources\n\n### GitHub (`--sources github`)\n- Open issues categorized by labels (bug, feature, security)\n- Open pull requests with draft status\n- Milestones with due dates and completion\n- Stale items (> 90 days inactive)\n- Themes extracted from issue titles\n\n**Requires**: `gh` CLI installed and authenticated\n\n### Documentation (`--sources docs`)\n- README.md, CONTRIBUTING.md, CHANGELOG.md\n- PLAN.md, CLAUDE.md\n- docs/*.md\n- Checkbox completion rates\n- Feature lists and planned work\n\n### Code (`--sources code`)\n- Directory structure analysis\n- Framework detection (React, Express, Vue, etc.)\n- Test framework detection (Jest, Mocha, Vitest)\n- Health indicators (CI, linting, tests)\n- Implemented features\n\n### Repo-Intel (optional, auto-detected)\n- Doc files with low code coupling - likely stale documentation\n- Directory-level health: owners, hotspot score, bug-fix rate\n- At-risk and needs-attention areas for focused drift analysis\n\n**Requires**: `agent-analyzer` binary and a cached `repo-intel.json` map. If no map exists, the scan prompts to generate one (~5 seconds).\n\n## Output\n\nThe scan produces:\n\n1. **Executive Summary**: Overview of project state\n2. **Drift Analysis**: Where plans diverge from reality (with evidence)\n3. **Gap Analysis**: Missing tests, docs, implementation (with severity)\n4. **Cross-Reference**: Documented vs. implemented features\n5. **Reconstruction Plan**: Prioritized action items by timeframe\n\n### Example Output\n\n```markdown\n# Reality Check Report\n\n## Executive Summary\nProject has moderate drift: 8 stale priority issues and 20% plan completion.\nStrong code health (tests + CI) but documentation lags implementation.\n\n## Drift Analysis\n\n### Priority Neglect\n**Severity**: high\n8 high-priority issues inactive for 60+ days.\n**Recommendation**: Triage stale issues - close, reassign, or deprioritize.\n\n## Gap Analysis\n\n### No Automated Tests\n**Severity**: critical\n**Impact**: High risk of regressions, difficult to refactor safely.\n**Recommendation**: Add test framework and critical path coverage.\n\n## Prioritized Plan\n\n### Immediate (This Week)\n1. **Close issue #45** - already implemented\n2. **Address security vulnerability** in auth module\n\n### Short-Term (This Month)\n1. Add test coverage for API endpoints\n2. Update README to reflect current features\n```\n\n## Skills\n\n### drift-analysis\n\nProvides knowledge for:\n- Drift detection patterns and signals\n- Prioritization framework\n- Cross-reference matching logic\n- Output templates\n\n## Requirements\n\n- GitHub CLI (`gh`) for GitHub scanning\n- Git repository\n- Node.js\n\n## Breaking Changes from v1\n\n- `.claude/drift-detect.local.md` settings file no longer used\n- Use command flags instead: `--sources`, `--depth`, `--output`, `--file`\n- Three scanner agents replaced with JavaScript collectors\n\n## License\n\nMIT\n",
  "bytes": 5651,
  "sha": "3d7cb8fbfdacf4cd236435c59fda296d4e5a69e82d878e041cc07cbf3132a02b",
  "repo_slug": "agent-sh/drift-detect",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_agent_sh_drift_detect_drift_detect_751ce1cf/readme"
}