Skip to content

Wire llm-friendly-qa-wrappers in as a major dependency (redirect raw QA tool calls → wrapper + jq guidance) #33

Description

@edmondscommerce

Summary

Adopt edmondscommerce/llm-friendly-qa-wrappers as a major dependency of the hooks daemon, and build handlers that redirect raw QA tool invocations to the wrapper version, then guide the agent to parse the JSON output with jq.

The wrapper repo provides thin wrappers around common QA / static-analysis tools (ESLint, Prettier, Jest, TSC, Vitest, Biome, PHPStan, PHP-CS-Fixer, PHPUnit, ShellCheck, shfmt, Ruff, pytest, MyPy) that print a terse 1–5 line terminal summary and write full JSON details to a temp file for jq querying — exactly the output contract an LLM agent wants instead of human-formatted tool noise.

This generalises the existing npm_command interception pattern (raw npm/npxllm:-prefixed) across every wrapped tool and language.

What we want to build

  1. Redirect handler(s) (PreToolUse) — detect a raw wrapped-tool Bash command (e.g. eslint src/) and redirect to the wrapper equivalent (llm-eslint.js src/), with get_claude_md() guidance that names the wrapper invocation and teaches reading the JSON temp file with jq.
  2. A single machine-readable mapping raw command → wrapper invocation as the SSOT — handlers read it via a tool/language-aware Strategy + Registry (no hardcoded if/elif chains), consistent with our existing QA-suppression / security-antipattern registries.
  3. Graceful degradation — when a project hasn't installed the wrapper, advise rather than hard-block.

php-qa-ci integration (secondary strand)

Our PHP estate runs lts/php-qa-ci (org lts = LongTermSupport, first-party) — a Bash pipeline (bin/qa) orchestrating Rector, PHP-CS-Fixer, PHPStan, PHPUnit, Infection across four phases. Rather than wrapping each PHP tool individually and re-implementing the orchestration, we likely want a global --json mode on php-qa-ci that drives every underlying tool into its JSON output mode and emits one aggregate machine-readable result document, surfaced through the wrapper repo's conventions.

Open question (tracked in the plan): does the JSON aggregation live in php-qa-ci itself (a --json flag — we control lts), in a dedicated llm-php-qa-ci wrapper, or both?

Pre-work: full audit

Before depending on it, the wrapper repo gets a thorough critical engineering audit (completeness vs. advertised tools, output-contract consistency, code correctness, temp-file path determinism, install/dependency surface, test coverage, stability/maturity, and gaps/risks specific to our redirect use case). Adoption is gated on the audit's readiness verdict; blockers get filed upstream (we own edmondscommerce).

Tracking

Tracked in this repo under CLAUDE/Plan/00129-llm-qa-wrappers-integration/ — see PLAN.md for phased tasks and AUDIT-llm-friendly-qa-wrappers.md for the audit report.

Phases

  • Phase 1 — Audit & consumption decision (submodule / vendored / pinned release / package; pin a version)
  • Phase 2 — Redirect mapping SSOT (schema-validated, Strategy + Registry)
  • Phase 3 — Redirect handler(s) (TDD, 95%+ coverage, acceptance tests, dogfooded)
  • Phase 4 — php-qa-ci global JSON integration
  • Phase 5 — Documentation & rollout (config-gated, conservative default)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions