Skill Integration Guide For BIX Tech Corp — Pedro, Eduardo, Helio
v1.0 | March 2026 | CONFIDENTIAL — PreFi, Inc. / Purpose Technology, Inc. d/b/a Purlend
The Clarity Engine is a 15-skill AI pipeline that ingests raw borrower data and produces, in order: program eligibility, qualification decisions, optimization scoring, scenario generation, program ranking, lender overlay adjustment, a complete audit trace, and the Always-Approved output.
This document tells you how to build that pipeline: the execution order, the data that flows between skills, the JSON field contracts you must implement, how to handle errors, and what the runtime looks like.
Every skill in the library is a standalone Claude prompt-skill. You call each skill in sequence, passing the outputs of upstream skills as inputs to downstream skills. The Clarity Engine is the orchestration layer that makes that chain work correctly.
Each skill has a unique ID, an execution layer, and a defined set of inputs and outputs. Skills within the same layer can execute in parallel.
ID Skill Name Layer Key Input Key Output S01 Math L0 loan_amount pmt S02 VA_Module L1 BorrowerProfile.veteran_status va_eligible S03 Borrower_Profile L1 Raw borrower data (income docs BorrowerProfile: gmi_qualifying S04 Program_Router L2 BorrowerProfile ProgramQueue: ordered list of programs to evaluate + preliminary calculations per program S05 Constraint_Detection L2 BorrowerProfile ConstraintSet: 25 constraint types S06 VA_Qualification L3 BorrowerProfile QualResult_VA: status S07 Conventional_Qualification L3 BorrowerProfile QualResult_CONV: status S08 FHA_Qualification L3 BorrowerProfile QualResult_FHA: status S09 DSCR_Qualification L3 BorrowerProfile QualResult_DSCR: status S10 Optimization L4 All QualResults OptimizationResult: composite_score per program S11 Scenario_Generation L4 OptimizationResult ScenarioSet: up to 5 scenarios S12 Ranking L5 OptimizationResult RankedProgramList: ordered eligible programs with confidence scores S13 Overlay L5 RankedProgramList OverlayAdjustedResult: confidence after lender/state overlays S14 Audit_Trace L6 All LineageTraces AuditTrace: trace_id per decision node S15 Always_Approved L7 RankedProgramList AlwaysApprovedStatement: tier
Follow this order exactly. Parallel steps (4a–4e) may execute concurrently. All other steps are sequential.
Step Skill ID Skill Name Layer Input From Output To Execution Note 1 S03 Borrower_Profile L1 Raw input BorrowerProfile Sequential — must complete before Router 2 S04 Program_Router L2 BorrowerProfile ProgramQueue Sequential — gates eliminate programs 3 S02 VA_Module L1 BorrowerProfile + ProgramQueue[VA] VA eligibility objects Can run in parallel with Router if VA flagged 4a S05 Constraint_Detection L2 BorrowerProfile, ProgramQueue ConstraintSet Parallel with L3 program skills 4b S06 VA_Qualification L3 BorrowerProfile, ProgramQueue[VA] QualResult_VA Parallel with other L3 skills 4c S07 Conventional_Qualification L3 BorrowerProfile, ProgramQueue[CONV] QualResult_CONV Parallel with other L3 skills 4d S08 FHA_Qualification L3 BorrowerProfile, ProgramQueue[FHA] QualResult_FHA Parallel with other L3 skills 4e S09 DSCR_Qualification L3 BorrowerProfile, ProgramQueue[DSCR] QualResult_DSCR Only if investment property 5 S10 Optimization L4 All QualResults OptimizationResult Sequential — needs all L3 outputs 6 S11 Scenario_Generation L4 OptimizationResult + ConstraintSet ScenarioSet Sequential — needs Optimization output 7 S12 Ranking L5 OptimizationResult + ScenarioSet RankedProgramList Sequential — needs both L4 outputs 8 S13 Overlay L5 RankedProgramList + BorrowerProfile.state OverlayAdjustedResult Sequential — needs Ranking output 9 S14 Audit_Trace L6 All LineageTraces + All Results AuditTrace Can begin after L3 completes; finalize after L5 10 S15 Always_Approved L7 All L5 outputs + AuditTrace AlwaysApprovedStatement Final synthesis — needs everything
CRITICAL: The Program_Router (S04) must complete before any L3 qualification skill begins. The Router determines WHICH programs are eligible — do not run VA, Conventional, FHA, or DSCR qualification on programs the Router has already eliminated.
Layer L0 — Math Foundation The Math Skill (S01) is not called in sequence — it is the underlying function library. Every other skill that computes mortgage math calls Math functions internally. Build Math first. Test it against the 50-vector test battery before building any other skill. Layer L1 — Borrower Intelligence Borrower_Profile (S03) normalizes raw borrower data into the canonical BorrowerProfile object. This object is the single source of truth for all downstream skills — every skill receives BorrowerProfile as its primary input. VA_Module (S02) runs in parallel with Borrower_Profile or immediately after, producing VA eligibility objects that the Router and VA_Qualification skill consume. Layer L2 — Routing + Constraint Detection Program_Router (S04) applies 5 sequential gates to determine which programs can proceed to full qualification. Programs failing any gate are marked INELIGIBLE at the Router stage — no further processing. Constraint_Detection (S05) runs in parallel with L3 qualification, building the ConstraintSet that feeds Scenario_Generation. Layer L3 — Program Qualification VA, Conventional, FHA, and DSCR qualification skills run in parallel against their respective program queues. Each produces a QualResult object. Each QualResult includes a LineageTrace — the decision log for that program's evaluation. If a program was eliminated by the Router, its QualResult is pre-filled as INELIGIBLE_ROUTER with no further processing. DSCR qualification only runs if property_type = INVESTMENT. Primary and secondary residence borrowers skip DSCR entirely. Layer L4 — Optimization + Scenario Generation Optimization (S10) receives all QualResults and scores every evaluated program across 6 dimensions (payment, MI, CTC, approval certainty, plus quality bonus). Scores use absolute benchmarks — not relative normalization. Scenario_Generation (S11) uses the ConstraintSet and OptimizationResult to produce actionable scenarios for programs the borrower cannot currently qualify for. Layer L5 — Ranking + Overlay Ranking (S12) sorts programs by composite score, applies 5 tiebreaker rules when programs are within 5 points, and computes confidence scores. Overlay (S13) adjusts confidence scores based on lender credit/DTI overlays, waiting periods, and state-specific rules. Layer L6 — Audit Trace Audit_Trace (S14) consolidates all LineageTrace objects into a single canonical decision record. It assigns trace IDs to every decision node, detects deviations, generates the ECOA adverse action export if required, builds the HMDA field set, and produces the ML training record. Layer L7 — Always Approved Always_Approved (S15) is the capstone. It synthesizes all upstream outputs into Purlend's signature output: the definitive statement that there is always an approved path for every borrower — and exactly what it requires. Four tiers: approved now, approved with one action, approved with multiple actions, approved with time.
These are the fields that pass between skills. Every field must be implemented exactly as specified — name, type, and semantics.
Field Name Type Semantics / Contract BorrowerProfile.gmi_qualifying number Monthly gross qualifying income. Used in ALL DTI calculations. Source: Borrower_Profile S03. BorrowerProfile.qualifying_credit_score integer LOWEST middle score across all borrowers. Source: Borrower_Profile S03. BorrowerProfile.verified_assets number Total verified liquid assets after reserves. Source: Borrower_Profile S03. ProgramQueue[X].preliminary_ltv number LTV calculated in Router Stage 3. Used as input to L3 skills. Source: Program_Router S04. QualResult_X.qualification_status enum
QualResult_X.pitia number Monthly PITI+A (principal, interest, taxes, insurance, assessments). Core payment metric. QualResult_X.back_end_dti number Decimal (e.g., 0.4537 = 45.37%). (pitia + monthly_obligations) / gmi_qualifying. QualResult_X.cash_to_close number Total funds needed at closing: down_payment + closing_costs - credits. QualResult_X.LineageTrace object Complete decision log for this program. Consumed by Audit_Trace S14. OptimizationResult.composite_score number 0-100 score. Weighted sum of 6 dimensions + quality_bonus. Primary ranking input. OptimizationResult.always_approved_state enum CURRENTLY_ACHIEVABLE | NOT_CURRENTLY_ACHIEVABLE. Drives Always_Approved tier detection. ScenarioSet[X].effort_impact_score number effort×0.40 + impact×0.60. Used to rank and filter scenarios (top 3-5, threshold ≥50). RankedProgramList[X].overlay_adjusted_confidence number Final confidence after overlay adjustments. Clamped 0.30-0.99. AuditTrace.trace_id string Format: [L#].[SKILL].[SEQ].[P|F|C|I]. Unique per decision node. Globally unique within run. AlwaysApprovedStatement.tier enum
Math Rules — Non-Negotiable
Qualification Status Rules
Scoring Rules — Optimization
Always-Approved Language Rules
The Clarity Engine is designed to never fail silently. Every error condition has a defined response.
Error Condition Severity Required Response Borrower_Profile returns incomplete data
Proceed with estimated fields; flag data_quality_score < 0.85; surface to advisor Router eliminates all programs at Gate 1
Stop execution. Return: 'Property type not eligible for any program.' Surface to advisor. All L3 qualification skills return INELIGIBLE
Proceed to Optimization, Scenario, Ranking. Always_Approved Tier 3 or 4 will resolve. Single L3 skill throws runtime error
Mark that program INELIGIBLE_SYSTEM_ERROR. Continue with remaining programs. Log for retry. Constraint_Detection returns BLOCKING constraint
Do not stop execution. Carry flag into Optimization and Scenario. Scenarios will address it. Optimization receives zero eligible programs
Compute proximity scores for all programs. always_approved_state = NOT_CURRENTLY_ACHIEVABLE. Continue. Overlay receives unknown state code
Apply no state overlays. Flag OVERLAY_STATE_UNKNOWN. Proceed with federal rules only. AuditTrace cannot find upstream LineageTrace
Build trace from QualResult outputs only. Flag TRACE_INCOMPLETE. Set data_quality_score penalty.
The most important error handling principle: the pipeline must complete for EVERY borrower. Even if all programs return INELIGIBLE, the system runs through Always_Approved to produce a Tier 3 or Tier 4 action plan. There is no 'end of line' error state.
Every skill carries a version number. The AuditTrace records which version of each skill was used for every run — this is essential for debugging and regulatory audit.
Current versions at Gear 1 launch: Skill Current Version Notes Math 1.0 Gear 1 baseline VA_Module 1.0 Gear 1 baseline Borrower_Profile 1.0 Gear 1 baseline Program_Router 1.0 Gear 1 baseline Constraint_Detection 1.0 Gear 1 baseline VA_Qualification 1.0 Gear 1 baseline Conventional_Qualification 1.0 Gear 1 baseline FHA_Qualification 1.0 Gear 1 baseline DSCR_Qualification 1.0 Gear 1 baseline Optimization 1.0 Gear 1 baseline Scenario_Generation 1.0 Gear 1 baseline Ranking 1.0 Gear 1 baseline Overlay 1.0 Gear 1 baseline Audit_Trace 1.0 Gear 1 baseline Always_Approved 1.0 Gear 1 baseline
CONFIDENTIAL — PreFi, Inc. / Purpose Technology, Inc. d/b/a Purlend | Clarity Engine Skill Integration Guide v1.0