Skill for generating credit analysis reports on bond issuers. Use this skill whenever the user asks to create, generate, or write an analysis report, credit report, issuer report, or risk assessment for a bond issuer or credit entity. Also trigger when the user mentions writing a report that involves credit ratings, probability of default, financial ratios, peer comparison, or risk decomposition — even if they don't call it a "credit report" explicitly. Covers requests like "analyze Apple's credit", "write a bond issuer report for TSLA", "give me a risk assessment of JPMorgan", or "create a report comparing this issuer to its peers".
Generate self-contained HTML credit analysis reports for bond issuers. The agent fetches data through API calls, computes financial ratios locally, and produces a report with formatted tables and interactive Chart.js charts.
The report structure is flexible — there is a default template, but the user can request a different structure, add sections, remove sections, or change the analytical focus.
Use this structure when the user doesn't specify something custom. Each section maps to specific data sources and visual elements.
A high-level snapshot with KPI cards and a short narrative paragraph.
Data needed: issuer profile, latest credit rating, latest 1Y PD, bond portfolio stats, latest-year financials.
Visual elements:
How the issuer's risk has evolved over time, and how it stacks up against peers.
Data needed: credit rating history, credit spread history (12 months), historical PD (1Y and 5Y, 24 months), peer comparison metrics.
Visual elements:
The temporal view answers "is this issuer getting riskier or safer?" The peer view answers "relative to similar companies, where does it sit?"
Break down what drives the issuer's risk, grounded in financial fundamentals.
Data needed: risk factor decomposition (contributions + 6-month trends), annual financial statements (4 years), computed credit ratios.
Visual elements:
This section connects the abstract risk factors to the concrete financial numbers behind them.
Synthesise findings into an actionable assessment.
Visual elements:
Risk level heuristic (adapt based on data):
The user might request changes. Examples:
get_bonds.Always number sections sequentially based on what's actually included.
Fetch data by calling these endpoints. The base URL and auth token come from your environment. Every endpoint requires Authorization: Bearer <token>.
Read references/api_reference.md for the full endpoint specifications, request/response schemas, and example payloads.
Quick reference:
| Endpoint | Returns | Used for |
|---|---|---|
GET /api/data/issuers | List of all issuers | Resolving issuer names |
GET /api/data/issuers/{id} | Full issuer data bundle | One-shot fetch of everything |
GET /api/data/issuers/{id}/ratings | Rating history | Temporal analysis |
GET /api/data/issuers/{id}/pd | PD term structure + history | Credit risk charts |
GET /api/data/issuers/{id}/financials | Annual financial statements | Fundamental analysis |
GET /api/data/issuers/{id}/bonds | Bond portfolio | Portfolio section |
GET /api/data/issuers/{id}/spreads | 12-month daily spreads | Spread chart |
GET /api/data/issuers/{id}/risk-decomposition | Factor contributions + trends | Risk decomposition |
GET /api/data/issuers/{id}/peers | Peer comparison table | Peer analysis |
When the backend is in mock mode (USE_MOCK=true), these endpoints return deterministic mock data. No database needed.
Compute these from the financial statements yourself — they're simple arithmetic and don't need an API call.
From financials:
From bond portfolio:
The report is a single self-contained HTML file. It loads Chart.js from CDN and Google Fonts (DM Sans + JetBrains Mono). No other external dependencies.
Read references/html_format.md for the complete CSS, component patterns, and chart configuration templates.
Critical rules:
var(--bg1), var(--tx1), etc.) throughout — never hardcode colours for text, backgrounds, or chart elements.<canvas> for a chart must have a unique id.<script> must be wrapped in an IIFE: (()=>{ ... })();$XXX.XB for billions, $XXX.XM for millions.X.XXX%.X.XXx format.Use the CSS from assets/report_styles.css — include it verbatim inside the <style> tag. This handles the theme variables, typography, KPI cards, tables, chart containers, rating badges, timelines, and responsive layout.
<div class="kpi-grid">
<div class="kpi">
<div class="kpi-label">LABEL</div>
<div class="kpi-value">VALUE</div>
<div class="kpi-sub">Secondary info</div>
</div>
</div>
Colour-coded spans: AAA–AA range = teal, A range = blue, BBB range = amber, BB–B range = orange/red.
<span class="rating-badge" style="background:#14b8a6">AA</span>
<div class="rating-timeline">
<div class="tl-item">
<span class="tl-date">2024-09-15</span>
<span class="rating-badge" style="background:#14b8a6">AA</span>
<span class="tl-meta">S&P · Stable</span>
</div>
</div>
<div class="tbl-wrap">
<table>
<thead><tr><th>Col</th></tr></thead>
<tbody><tr><td>Val</td></tr></tbody>
</table>
</div>
Use class="hl" on <tr> to highlight the target issuer in peer tables.
<div class="rec-banner" style="border-left:4px solid #10b981">
<div class="rec-level" style="color:#10b981">LOW RISK</div>
<p>Assessment text.</p>
</div>
<div class="chart-box"><canvas id="uniqueId"></canvas></div>
<script>
(()=>{
new Chart(document.getElementById('uniqueId'), {
type: 'line', /* or 'bar', 'doughnut' */
data: { labels: [...], datasets: [...] },
options: {
responsive: true,
scales: {
x: { ticks: { color: 'var(--tx2)' }, grid: { color: 'var(--bdr)' } },
y: { ticks: { color: 'var(--tx2)' }, grid: { color: 'var(--bdr)' } }
}
}
});
})();
</script>
Before returning the report, verify:
var(--tx2) / var(--bdr) / var(--tx1) for theme compatibility<!DOCTYPE html> and is a complete document