Harness integrity

From Intense-Visions/harness-engineering · View interactive version

Harness integrity is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > Unified integrity gate — single invocation chains mechanical verification with AI-powered code review and produces a consolidated pass/fail report.

How to use this skill

Skill file

Harness Integrity

Unified integrity gate — single invocation chains mechanical verification with AI-powered code review and produces a consolidated pass/fail report.

When to Use

Relationship to Other Skills

| Skill | What It Does | Scope | Time |

| ---------------------------- | ---------------------------------------------- | ---------------------- | ----- |

| harness-verify | Mechanical only: typecheck, lint, test | Exit codes | ~30s |

| harness-code-review | AI only: change-type-aware review | LLM analysis | ~2min |

| harness-integrity (this) | Both: verify + code-review unified | Full pipeline | ~3min |

| harness-verification | Deep audit: architecture, patterns, edge cases | Thorough investigation | ~5min |

harness-integrity is the standard pre-PR gate. It runs the fast mechanical checks first, then layers on AI review, and produces a single consolidated report.

Process

Phase 1: VERIFY

Invoke harness-verify to run the mechanical quick gate.

  1. Delegate entirely to harness-verify — typecheck, lint, test.
  2. Capture the structured result (PASS/FAIL per check).
  3. If ALL three checks FAIL, stop here. Do not proceed to Phase 2. The code is not in a reviewable state.
  4. If at least one check passes (or some are skipped), proceed to Phase 2.

Phase 1.5: SECURITY SCAN

Run the built-in security scanner as a mechanical check between verification and AI review.

  1. Use run_security_scan MCP tool against the project root (or changed files if available).
  2. Capture findings by severity: errors, warnings, info.
  3. Error-severity security findings are blocking — they cause the overall integrity check to FAIL, same as a test failure.
  4. Warning/info findings are included in the report but do not block.

Phase 1.7: DESIGN HEALTH (conditional)

When the project has design configured in harness.config.json:

  1. Run harness-design in review mode to check existing components against design intent and anti-patterns.
  2. Run harness-accessibility in scan+evaluate mode to check WCAG compliance.
  3. Combine findings into a design health summary:
  1. Error-severity design findings are blocking in strict mode only. In standard and permissive modes, design findings do not block.
  2. If no design block exists, skip this phase entirely.

Phase 1.8: I18N SCAN (conditional)

When the project has i18n.enabled: true in harness.config.json:

  1. Run harness-i18n in scan mode to detect hardcoded strings, missing translations, locale-sensitive formatting issues, and RTL violations.
  2. Combine findings into an i18n health summary:
  1. Error-severity i18n findings are blocking in strict mode only. In standard and permissive modes, i18n findings do not block.
  2. If no i18n block exists or i18n.enabled is false, skip this phase entirely.

Phase 2: REVIEW

Run change-type-aware AI review using harness-code-review.

  1. Detect the change type if not provided: feature, bugfix, refactor, or docs.
  2. Invoke harness-code-review with the detected change type.
  3. Capture the review findings: suggestions, blocking issues, and notes.
  4. A review finding is "blocking" only if it would cause a runtime error, data loss, or security vulnerability.
  5. The AI review includes a security-focused pass that complements the mechanical scanner — checking for semantic issues like user input flowing to dangerous sinks across function boundaries.

Phase 3: REPORT

Produce a unified integrity report in this exact format:

Integrity Check: [PASS/FAIL]
- Tests:    [PASS/FAIL/SKIPPED]
- Lint:     [PASS/FAIL/SKIPPED]
- Types:    [PASS/FAIL/SKIPPED]
- Security: [PASS/WARN/FAIL] ([count] errors, [count] warnings)
- Design:   [PASS/WARN/FAIL/SKIPPED] ([count] errors, [count] warnings)
- i18n:     [PASS/WARN/FAIL/SKIPPED] ([count] errors, [count] warnings)
- Review:   [PASS/FAIL] ([count] suggestions, [count] blocking)

Overall: [PASS/FAIL]

Rules:

Deterministic Checks

Harness Integration

Success Criteria

Rationalizations to Reject

These are common rationalizations that sound reasonable but lead to incorrect results. When you catch yourself thinking any of these, stop and follow the documented process instead.

| Rationalization | Why It Is Wrong |

| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |

| "All three mechanical checks failed, but I should still run the AI review to get useful feedback" | When ALL three checks fail, stop immediately. Do not proceed to Phase 2. AI review on code that does not compile is wasted effort. |

| "The security scanner found a warning but it is not high severity, so it should not affect the overall result" | Error-severity security findings are blocking. The distinction is severity, not the agent's opinion of importance. |

| "The AI review flagged an architectural concern as blocking, so the integrity check should fail" | Only runtime errors, data loss, and security vulnerabilities count as blocking review findings. Architectural concerns are noted but do not block. |

Examples

Example: All Clear

Integrity Check: PASS
- Tests: PASS (42/42)
- Lint: PASS (0 warnings)
- Types: PASS
- Security: PASS (0 errors, 0 warnings)
- Design: PASS (0 errors, 0 warnings)
- i18n: PASS (0 errors, 0 warnings)
- Review: 1 suggestion (0 blocking)

Example: Security Blocking Issue

Integrity Check: FAIL
- Tests: PASS (42/42)
- Lint: PASS
- Types: PASS
- Security: FAIL (1 error, 0 warnings)
  - [SEC-INJ-002] src/auth/login.ts:42 — SQL query built with string concatenation
- Design: WARN (0 errors, 2 warnings)
- i18n: SKIPPED
- Review: 3 findings (1 blocking)

Blocking: [SEC-INJ-002] SQL injection — user input passed directly to query without parameterization.

Gates

Escalation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.