check-results-service

Reuses integration check results in features via the universal CheckResultsService API.

1.9k|402|Updated Jan 15, 2025
One-click install
npx skills add https://github.com/trycompai/comp --skill check-results-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: check-results-service
Source: https://github.com/trycompai/comp/tree/main/.claude/skills/check-results-service
Command: npx skills add https://github.com/trycompai/comp --skill check-results-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Features in the apps/api integration platform often need data produced by integration checks (2FA status, S3 encryption findings, device posture), and developers risk hand-rolling direct IntegrationCheckResult or CheckRunRepository queries that duplicate logic and leak held or inconclusive runs.

Core Features & Use Cases

  • Universal read-only API: Three methods (listSourcesBoundToTask, getLatestResultsByCheck, getLatestResultsForTask) fetch the latest real run's results for any check without feature-specific logic.
  • Person-scoped shape contract: Defines the canonical per-user emission shape (resourceType 'user', resourceId as lowercased email) so features can join check results to org members without parsing.
  • Use Case: To show each employee's 2FA status on the People tab, inject CheckResultsService, call getLatestResultsForTask with the task template and source slug, then map resourceId to member emails and validate evidence with a zod schema.

Quick Start

Ask the AI to add a new feature consumer that reuses an integration check's results through CheckResultsService instead of querying IntegrationCheckResult directly.

Frequently Asked Questions about check-results-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reuse integration check results in a new feature?

Inject CheckResultsService from IntegrationPlatformModule into your feature's constructor, then call getLatestResultsByCheck or getLatestResultsForTask with the organization ID, check ID, and optional resourceType. Interpret the returned rows in your feature and never query IntegrationCheckResult directly.

How do I show per-user 2FA status from a connected integration?

Call getLatestResultsForTask with the twoFactorAuth task template, the org's chosen source slug, and resourceType 'user'. Match each row's resourceId (lowercased email) to member emails and map passed to enabled or missing, treating missing rows as not provided.

Should I query IntegrationCheckResult or CheckRunRepository directly?

No, features must go through CheckResultsService instead of querying IntegrationCheckResult or CheckRunRepository directly. The service filters out held and inconclusive runs and disconnected connections, which hand-rolled queries typically get wrong.

How do I validate the evidence field from check results?

Validate the evidence JSON at your feature's edge with a zod schema and read only the fields your feature understands, never using 'as any'. The service deliberately does not type or interpret evidence because it is check-specific.

What does an empty result array from CheckResultsService mean?

An empty array means no data: the source is not bound or connected, or the check never completed a real run. It never throws for missing results, so render it as 'not provided' rather than a failure state.

When should a check emit per-user rows versus org-level rows?

Checks about people (2FA, training, access inventory) must emit one row per person with resourceType 'user' and resourceId as the lowercased email. Error paths like bad credentials stay org-level rows, and access inventory rows always emit as pass.