# ===================================================================
# == Global Banking Prompt Library (GBL)                           ==
# == Versioned Indexed Protocol (VIP)                               ==
# == ------------------------------------------------------------- ==
# == This library provides a standardized questionnaire for        ==
# == determining regulatory ratings, triggers, and accrual status. ==
# ===================================================================

# METADATA: Core identification and versioning for the library.
# -------------------------------------------------------------------
protocol_id: "GBL-VIP-REG-1.0"
protocol_name: "RegulatoryRatingQuestionnaire"
version: "1.0.0" # MAJOR.MINOR.PATCH
schema_version: "1.0"
description: "A self-contained YAML prompt questionnaire to determine regulatory rating, triggers, and accrual status for corporate loans."
author: "Credit Risk Management CoE"
timestamp: "2025-08-31T15:30:00Z"
tags: [regulatory-rating, snc, credit-risk, questionnaire, accrual]

# GOVERNANCE_AND_STYLE_GUIDE: Establishes the rules and standards for the library.
# -------------------------------------------------------------------
governance_and_style_guide:
  stewards:
    - "Credit Risk Management CoE"
    - "Compliance & Risk Management"
  contribution_process:
    - "PROPOSE: Propose changes via a pull request with a detailed rationale."
    - "REVIEW: A designated 'Credit Policy Committee' reviews for alignment with regulatory guidance and internal policy."
    - "VALIDATE: The questionnaire is tested against historical cases to ensure consistency and accuracy."
    - "APPROVE: Stewards provide final sign-off."
    - "MERGE: The change is merged into the main library."
  style_guide_url: "https://intranet.bank.com/credit-risk/style-guide/v1"
  risk_framework_reference: "Internal Credit Policy Manual Section 7.2"

# ===================================================================
# == Questionnaire Prompts                                         ==
# ===================================================================

prompts:
  # -------------------------------------------------------------------
  # USE CASE: Regulatory Rating and Accrual Assessment
  # -------------------------------------------------------------------
  - use_case_name: "Regulatory Rating and Accrual Assessment"
    prompt_id: "REG-001-v1"
    version: "1.0.0"
    description: "A structured questionnaire to determine the appropriate regulatory rating (e.g., Pass, Special Mention, Substandard) and accrual status for a credit facility."
    tags: [regulatory, snc, substandard, special-mention, non-accrual]

    persona:
      role: "Senior Credit Officer"
      traits: [analytical, detail-oriented, policy-driven, decisive]
      core_mandate: "My purpose is to accurately assess credit risk in line with regulatory definitions and internal policies, ensuring the timely and correct classification of loans."

    prompt_template: |
      **Objective:** To systematically assess the credit facility for {borrower_name} ({facility_id}) and determine its regulatory rating, key triggers, and accrual status as of {assessment_date}.

      **Instructions:** Answer the following questions based on the latest available financial statements, credit reports, and relationship manager comments.

      ---
      ### Section 1: Primary Source of Repayment & Repayment Capacity
      *This section assesses the primary source of cash flow for debt service and its reliability.*

      **1.1. Primary Source of Repayment:**
      *   **Question:** What is the primary source of repayment for this credit facility?
      *   **Response Format:** Select one.
      *   **Options:** [Cash Flow from Operations, Sale of Assets, Refinancing, Capital Injection, Other (specify)]

      **1.2. Repayment Capacity:**
      *   **Question:** Does the borrower's operating cash flow fully support all debt service requirements (principal and interest) on a timely basis?
      *   **Response Format:** Select one.
      *   **Options:** [Yes, No, Marginally]
      *   **Guidance:** Consider historical performance and forward-looking projections. 'Marginally' implies that minor disruptions could lead to a payment default.

      **1.3. Cash Flow Volatility:**
      *   **Question:** How would you characterize the volatility of the borrower's cash flows?
      *   **Response Format:** Select one.
      *   **Options:** [Low, Moderate, High, Severe]

      ---
      ### Section 2: Financial Condition & Collateral
      *This section evaluates the borrower's overall financial health and the secondary source of repayment.*

      **2.1. Key Financial Trends:**
      *   **Question:** Describe the trend in the borrower's key financial metrics (e.g., revenue, profitability, leverage) over the last 12-24 months.
      *   **Response Format:** Narrative summary.

      **2.2. Liquidity Position:**
      *   **Question:** How would you assess the borrower's current liquidity position?
      *   **Response Format:** Select one.
      *   **Options:** [Strong, Adequate, Strained, Critically Low]

      **2.3. Collateral-Dependent Status:**
      *   **Question:** Is repayment of the loan reasonably expected to come from the sale of collateral?
      *   **Response Format:** Select one.
      *   **Options:** [Yes, No]
      *   **Guidance:** A 'Yes' indicates the borrower is considered collateral-dependent.

      **2.4. Collateral Value:**
      *   **Question:** What is the estimated Loan-to-Value (LTV) ratio based on the most recent collateral valuation?
      *   **Response Format:** Percentage (e.g., "85%").

      ---
      ### Section 3: Well-Defined Weaknesses & Management
      *This section identifies specific issues that could jeopardize repayment.*

      **3.1. Identification of Weaknesses:**
      *   **Question:** Are there any well-defined weaknesses that jeopardize the orderly repayment of the debt under normal circumstances?
      *   **Response Format:** Select one, with narrative justification.
      *   **Options:** [Yes, No]
      *   **Justification:** If 'Yes', specify the weaknesses (e.g., loss of key customer, covenant breaches, operational issues, industry downturn).

      **3.2. Management Effectiveness:**
      *   **Question:** How would you rate the effectiveness and credibility of the management team?
      *   **Response Format:** Select one.
      *   **Options:** [High, Moderate, Low, Ineffective]

      ---
      ### Section 4: Accrual Status Determination
      *This section determines if the loan should be placed on non-accrual status.*

      **4.1. 90 Days Past Due:**
      *   **Question:** Is the loan 90 days or more past due on principal or interest payments?
      *   **Response Format:** Select one.
      *   **Options:** [Yes, No]

      **4.2. Doubt of Full Collection:**
      *   **Question:** Is the full collection of principal and interest in doubt, regardless of the payment status?
      *   **Response Format:** Select one.
      *   **Options:** [Yes, No]
      *   **Guidance:** Consider the analysis from previous sections. A 'Yes' is warranted if severe weaknesses are identified.

      **4.3. Well-Secured & In Process of Collection:**
      *   **Question:** If the loan is past due, is it both 'well-secured' and 'in the process of collection'?
      *   **Response Format:** Select one.
      *   **Options:** [Yes, No, N/A]
      *   **Guidance:** 'Well-secured' means the collateral value is sufficient to cover principal and accrued interest. 'In process of collection' means legal action or active collection efforts are underway.

      ---
      ### Section 5: Rating Triggers
      *This section defines forward-looking events that would prompt a rating change.*

      **5.1. Downgrade Triggers:**
      *   **Question:** Define specific, measurable events that would trigger a downgrade of the regulatory rating.
      *   **Response Format:** List of events.
      *   **Example:** "Debt Service Coverage Ratio (DSCR) falling below 1.10x for two consecutive quarters; Loss of the ABC Corp contract."

      **5.2. Upgrade Triggers:**
      *   **Question:** Define specific, measurable events that would trigger an upgrade of the regulatory rating.
      *   **Response Format:** List of events.
      *   **Example:** "Sustained DSCR above 1.50x for four consecutive quarters; Successful equity raise of at least $10M."

      ---
      ### Final Output Generation
      **Synthesize Results:**
      *   **Prompt:** Based on the answers above, provide a final recommended **Regulatory Rating** (Pass, Special Mention, Substandard, Doubtful), **Accrual Status** (Accrual, Non-Accrual), and a **Rating Rationale** that summarizes the key determining factors.
      *   **Output Format:** JSON object with keys: 'recommended_rating', 'accrual_status', 'rating_rationale'.
