Repository navigation
Add doctor lint for agent instruction drift - #441
Conversation
Closes #436 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR extends madar doctor/status to detect and report configuration for Aider, Codex CLI, and OpenCode (skill files, AGENTS.md snippets, Codex hooks, OpenCode plugin/MCP wiring), exports installer helpers for Codex/OpenCode, updates README guidance and support table, and adds unit tests verifying behavior. ChangesDoctor/Status Extension for Additional Agents
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/infrastructure/doctor.ts (1)
58-80: ⚡ Quick winConsider co-locating instruction snippets with templates or adding alignment tests.
The instruction snippet constants here must stay synchronized with the template strings in
install.ts(e.g.,AIDER_AGENTS_MD_SECTION,CODEX_AGENTS_MD_SECTION,OPENCODE_AGENTS_MD_SECTION). If someone updates the template wording, they must remember to update these snippets manually. This coupling creates a maintenance risk.Consider one of these approaches:
- Export the snippets from
install.tsalongside the templates- Add a test that verifies each snippet is present in its corresponding template
- Add a comment documenting this dependency
Example: export snippets from install.ts
In
install.ts, add exports near the template definitions:export const AIDER_INSTRUCTION_SNIPPETS = [ '### Aider profile', 'Use a strict context-pack-first workflow', 'Before broad code search or manual file expansion', 'madar pack "<task or question>" --task explain', ] as constThen import in
doctor.ts:import { + AIDER_INSTRUCTION_SNIPPETS, + CODEX_INSTRUCTION_SNIPPETS, OPENCODE_MCP_SERVER_NAME, + OPENCODE_INSTRUCTION_SNIPPETS, OPENCODE_PLUGIN_RELATIVE_PATH, isMadarCodexHook, readOpencodeConfig, resolveOpencodeConfigPath, } from './install.js' - -const AIDER_INSTRUCTION_SNIPPETS = [...] -const CODEX_INSTRUCTION_SNIPPETS = [...] -const OPENCODE_INSTRUCTION_SNIPPETS = [...]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/infrastructure/doctor.ts` around lines 58 - 80, The instruction snippets in doctor.ts (AIDER_INSTRUCTION_SNIPPETS, CODEX_INSTRUCTION_SNIPPETS, OPENCODE_INSTRUCTION_SNIPPETS) must be kept in sync with the template strings in install.ts (AIDER_AGENTS_MD_SECTION, CODEX_AGENTS_MD_SECTION, OPENCODE_AGENTS_MD_SECTION); to fix, move/export the snippet arrays from install.ts alongside those template constants and import them into src/infrastructure/doctor.ts instead of declaring duplicate arrays there (update any references around AIDER_SKILL_PATH, CODEX_SKILL_PATH, OPENCODE_SKILL_PATH to use the imported snippet constants), or alternatively add a unit test that asserts each snippet element exists in its corresponding template constant to prevent drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 237-240: Table cells contain literal pipe characters (e.g., in the
command strings like "madar claude <install|uninstall> [--profile
core|full|strict]", "madar cursor <install|uninstall> [--profile
core|full|strict]", "madar copilot <install|uninstall> [--profile
core|full|strict]", and "madar gemini <install|uninstall> [--profile
core|full|strict]") which break Markdown table parsing (MD056); fix by escaping
each '|' inside those cells (replace '|' with '\|') so the entries render as a
single cell and update the rows referencing CLAUDE.md, .cursor/rules/madar.mdc,
.vscode/mcp.json, and GEMINI.md as needed.
---
Nitpick comments:
In `@src/infrastructure/doctor.ts`:
- Around line 58-80: The instruction snippets in doctor.ts
(AIDER_INSTRUCTION_SNIPPETS, CODEX_INSTRUCTION_SNIPPETS,
OPENCODE_INSTRUCTION_SNIPPETS) must be kept in sync with the template strings in
install.ts (AIDER_AGENTS_MD_SECTION, CODEX_AGENTS_MD_SECTION,
OPENCODE_AGENTS_MD_SECTION); to fix, move/export the snippet arrays from
install.ts alongside those template constants and import them into
src/infrastructure/doctor.ts instead of declaring duplicate arrays there (update
any references around AIDER_SKILL_PATH, CODEX_SKILL_PATH, OPENCODE_SKILL_PATH to
use the imported snippet constants), or alternatively add a unit test that
asserts each snippet element exists in its corresponding template constant to
prevent drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cfe848e-4fbd-4357-94e5-778194305618
📒 Files selected for processing (6)
README.mdsrc/infrastructure/doctor.tssrc/infrastructure/install.tstests/unit/doctor.test.tstests/unit/getting-started-docs.test.tstests/unit/install-docs.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #436
Summary
madar doctor/madar statusto validate optional Aider, Codex, and OpenCode instruction surfaces when those install artifacts are presentVerification
Summary by CodeRabbit
New Features
madar doctorandmadar statusnow detect and report Aider, Codex, and OpenCode wiring—marking agents as configured or partial and suggesting the appropriatemadar <agent> installcommand when incomplete.Documentation
doctor/statuslint surface and install recommendations.