Skip to content

feat: auto-detect installed harnesses from project artifacts#21

Merged
mrsimpson merged 2 commits into
mainfrom
claude/auto-detect-harness-ov1BK
Mar 29, 2026
Merged

feat: auto-detect installed harnesses from project artifacts#21
mrsimpson merged 2 commits into
mainfrom
claude/auto-detect-harness-ov1BK

Conversation

@mrsimpson
Copy link
Copy Markdown
Contributor

Instead of defaulting to ["universal"], the configure and install
commands now detect which harnesses are already present in the project
by checking for characteristic top-level artifacts:

  • Universal: AGENTS.md
  • Claude Code: .claude/
  • Cursor: .cursor/
  • GitHub Copilot: .github/agents/ or .vscode/mcp.json
  • Windsurf: .windsurf/ or .windsurfrules
  • Cline: .clinerules or cline_mcp_settings.json
  • Roo Code: .roo/ or .roomodes or .roorules
  • Kiro: .kiro/
  • OpenCode: opencode.json or .opencode/

Each HarnessWriter now implements a detect(projectRoot) method.
detectHarnesses() in index.ts runs all detectors in parallel.

In configure, detected harnesses are pre-selected as initial values
(still overridable by saved lock file harnesses). In install, detected
harnesses are used as the fallback when no --harness flag or lock file
harnesses field is present, with "universal" as the last resort if
nothing is detected.

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

@mrsimpson mrsimpson force-pushed the claude/auto-detect-harness-ov1BK branch 2 times, most recently from 3dbbbad to 79289f1 Compare March 29, 2026 08:58
claude added 2 commits March 29, 2026 09:14
Instead of defaulting to ["universal"], the configure and install
commands now detect which harnesses are already present in the project
by checking for characteristic top-level artifacts:

- Universal:      AGENTS.md
- Claude Code:    .claude/
- Cursor:         .cursor/
- GitHub Copilot: .github/agents/ or .vscode/mcp.json
- Windsurf:       .windsurf/ or .windsurfrules
- Cline:          .clinerules or cline_mcp_settings.json
- Roo Code:       .roo/ or .roomodes or .roorules
- Kiro:           .kiro/
- OpenCode:       opencode.json or .opencode/

Each HarnessWriter now implements a detect(projectRoot) method.
detectHarnesses() in index.ts runs all detectors in parallel.

In configure, detected harnesses are pre-selected as initial values
(still overridable by saved lock file harnesses). In install, detected
harnesses are used as the fallback when no --harness flag or lock file
harnesses field is present, with "universal" as the last resort if
nothing is detected.

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

feat: mark harness detection as verified or unverified

Adds detectionVerified: boolean to HarnessWriter. Verified harnesses
(universal, copilot, kiro, opencode) have had their detect() criteria
confirmed against real-world artifacts. Unverified ones (claude-code,
cursor, windsurf, cline, roo-code) use inferred heuristics and need
feedback from users of those tools.

The configure wizard appends "· auto-detect unverified" to the hint for
unverified harnesses so users can see at a glance which detections are
confirmed and which may need adjustment.

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

refactor: rename detectionVerified→verified, reorder harnesses, update hint

- Rename detectionVerified → verified on HarnessWriter: the flag covers
  the whole harness (install + detect), not just detection
- Wizard hint for unverified harnesses now reads
  "· unverified — config generation may be inaccurate"
- allHarnessWriters reordered so verified harnesses (universal, copilot,
  kiro, opencode) appear first, unverified ones (claude-code, cursor,
  windsurf, cline, roo-code) appear after

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

style: format install.ts

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

fix: move pathExists above clack/core imports in util.ts

fix: update HarnessWriterSchema to include verified and detect

fix: update harness ID order in index.spec.ts
harnesses was never written to the lock file (setup omits it, configure
is ephemeral), so lockFile.harnesses was always undefined. Remove the
field from LockFile and UserConfig types, simplify configure to always
use detectHarnesses(), and simplify install to resolve via --harness
flag or auto-detection only.

Tests updated accordingly: lock-file-harnesses test replaced with
auto-detection test, detectHarnesses mock added to both suites.

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

refactor: remove harness handling from ade install

ade install now only handles skills and knowledge sources.
Harness installation belongs exclusively to ade configure.

- runInstall() signature simplified (no harnessIds or harnessWriters params)
- --harness flag removed from CLI
- detectHarnesses, getHarnessIds, getHarnessWriter removed from install
- index.ts install branch simplified to a single line
- install.spec.ts stripped of all harness-related tests and mocks

https://claude.ai/code/session_01GZ3o2r8bg3ry68sJvuh5pH

fix: update specs for removed harness args and new HarnessWriter fields

fix: add verified/detect to mock HarnessWriter in index.spec.ts
@mrsimpson mrsimpson force-pushed the claude/auto-detect-harness-ov1BK branch from 79289f1 to 893d60f Compare March 29, 2026 09:15
@mrsimpson mrsimpson merged commit 559ea4b into main Mar 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants