From 3190ac34d769ec42476d7e16f06a8a8b8a32860d Mon Sep 17 00:00:00 2001 From: anthropic-plugin Date: Sun, 21 Jun 2026 17:59:00 +0530 Subject: [PATCH 1/2] Add partner-built Credit Memo plugin (Synechron) Adds a Credit Memo generation plugin for commercial lending workflows. 9 skills, 5 commands, 6 data connectors, 10 embedded chart types. Supports public and private companies with a 5-layer guardrails system. Placed under plugins/partner-built/synechron-credit-memo/ following the post-#81 repo layout. --- .../synechron-credit-memo/CHANGELOG.md | 51 +++ .../synechron-credit-memo/DISCLAIMER.md | 9 + .../synechron-credit-memo/README.md | 192 ++++++++ .../commands/generate-credit-memo.md | 196 ++++++++ .../commands/industry-snapshot.md | 105 +++++ .../commands/quick-risk-check.md | 89 ++++ .../commands/refresh-data.md | 118 +++++ .../synechron-credit-memo/commands/setup.md | 120 +++++ .../config/config.template.md | 53 +++ .../config/data-sources.md | 197 ++++++++ .../synechron-credit-memo/icon.svg | 17 + .../skills/data-collection/SKILL.md | 329 ++++++++++++++ .../skills/document-generation/SKILL.md | 401 +++++++++++++++++ .../skills/financial-analysis/SKILL.md | 238 ++++++++++ .../skills/guardrails/SKILL.md | 218 +++++++++ .../skills/industry-analysis/SKILL.md | 176 ++++++++ .../skills/management-assessment/SKILL.md | 178 ++++++++ .../skills/repayment-analysis/SKILL.md | 157 +++++++ .../skills/risk-assessment/SKILL.md | 204 +++++++++ .../skills/visuals/SKILL.md | 424 ++++++++++++++++++ 20 files changed, 3472 insertions(+) create mode 100644 plugins/partner-built/synechron-credit-memo/CHANGELOG.md create mode 100644 plugins/partner-built/synechron-credit-memo/DISCLAIMER.md create mode 100644 plugins/partner-built/synechron-credit-memo/README.md create mode 100644 plugins/partner-built/synechron-credit-memo/commands/generate-credit-memo.md create mode 100644 plugins/partner-built/synechron-credit-memo/commands/industry-snapshot.md create mode 100644 plugins/partner-built/synechron-credit-memo/commands/quick-risk-check.md create mode 100644 plugins/partner-built/synechron-credit-memo/commands/refresh-data.md create mode 100644 plugins/partner-built/synechron-credit-memo/commands/setup.md create mode 100644 plugins/partner-built/synechron-credit-memo/config/config.template.md create mode 100644 plugins/partner-built/synechron-credit-memo/config/data-sources.md create mode 100644 plugins/partner-built/synechron-credit-memo/icon.svg create mode 100644 plugins/partner-built/synechron-credit-memo/skills/data-collection/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/document-generation/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/financial-analysis/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/guardrails/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/industry-analysis/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/management-assessment/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/repayment-analysis/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/risk-assessment/SKILL.md create mode 100644 plugins/partner-built/synechron-credit-memo/skills/visuals/SKILL.md diff --git a/plugins/partner-built/synechron-credit-memo/CHANGELOG.md b/plugins/partner-built/synechron-credit-memo/CHANGELOG.md new file mode 100644 index 000000000..5f0b99ff2 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/CHANGELOG.md @@ -0,0 +1,51 @@ +# Credit Memo Generation — Changelog +*Developed by Synechron Technologies PVT LTD* + +--- + +## v1.0.0 — Initial Public Release (April 2026) + +### What's Included + +**Output Formats** +- Word (.docx) — full detailed memo (25–45 pages) with branded styling +- PDF — locked with CONFIDENTIAL watermark +- PowerPoint (.pptx) — 15–20 slide executive summary deck + +**Analysis Coverage** +- Financial analysis — 3–5 years of income statement, balance sheet, and cash flow +- Risk assessment — credit ratings (Moody's, S&P, Fitch), leverage, liquidity, and legal risk +- Repayment analysis — DSCR stress testing, amortization schedule, working capital analysis +- Industry analysis — market size, CAGR, competitive landscape, SWOT +- Management assessment — executive profiles, tenure, governance, and strategic track record + +**Data & Sources** +- Automated data collection from SEC EDGAR, SerpApi, Stock Analysis, Macrotrends, DiscoverCI +- Configurable premium sources: Bloomberg, Refinitiv, FactSet, S&P Capital IQ, PitchBook +- Private company support via document upload + web search fallback +- Data freshness enforcement with per-type staleness thresholds and warnings + +**Charts (10 embedded)** +1. Revenue & EBITDA Trend (5-Year) +2. Profit Margins vs. Industry Benchmark +3. Cash Flow Waterfall +4. Balance Sheet Composition +5. Key Financial Ratios Dashboard (Traffic Light) +6. Credit Rating Scale Visual +7. Industry Market Size & Growth +8. SWOT Matrix +9. DSCR Stress Test (3 scenarios) +10. Management Tenure Timeline + +**Guardrails & Compliance** +- 5-layer guardrails system enforced across all commands +- Inline citation numbers `[n]` on all key figures, linked to a numbered references appendix +- Data Freshness Summary box in every output +- AI-generated disclaimer on all outputs — not financial advice + +**Commands** +- `/credit-memo-generation:setup` — validate API keys and connectivity +- `/credit-memo-generation:generate` — full Credit Memo (Word + PDF + PowerPoint) +- `/credit-memo-generation:quick-risk-check` — 2-minute preliminary risk screen +- `/credit-memo-generation:industry-snapshot` — standalone industry analysis +- `/credit-memo-generation:refresh-data` — update existing memo with latest data diff --git a/plugins/partner-built/synechron-credit-memo/DISCLAIMER.md b/plugins/partner-built/synechron-credit-memo/DISCLAIMER.md new file mode 100644 index 000000000..8bc3e851c --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/DISCLAIMER.md @@ -0,0 +1,9 @@ +# Legal Disclaimer + +**Synechron Technologies PVT LTD ("Synechron")** + +This plugin is provided by Synechron on an "AS IS" and "AS AVAILABLE" basis, without warranties of any kind (express, implied, or statutory), including merchantability, fitness for a particular purpose, non-infringement, accuracy, or uninterrupted availability. Synechron disclaims all liability for any loss, damage, claims, or third-party liabilities arising from or related to use of, or reliance on, the plugin or its outputs. Users are solely responsible for evaluating results, ensuring compliance with applicable laws/policies, and implementing appropriate safeguards before use in any production or regulated context. Synechron shall have no liability whatsoever in connection with the plugin or its outputs. + +--- + +*This disclaimer applies to the Credit Memo Generation plugin (v1.0.0) published on the Anthropic Claude Cowork marketplace by Synechron Technologies PVT LTD.* diff --git a/plugins/partner-built/synechron-credit-memo/README.md b/plugins/partner-built/synechron-credit-memo/README.md new file mode 100644 index 000000000..0d8e9690f --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/README.md @@ -0,0 +1,192 @@ +# Credit Memo Generation — Cowork Plugin + +*Developed by [Synechron Technologies PVT LTD](https://www.synechron.com)* + +--- + +> **⚠️ Legal Disclaimer** +> +> This plugin is provided by Synechron on an "AS IS" and "AS AVAILABLE" basis, without warranties of any kind (express, implied, or statutory), including merchantability, fitness for a particular purpose, non-infringement, accuracy, or uninterrupted availability. Synechron disclaims all liability for any loss, damage, claims, or third-party liabilities arising from or related to use of, or reliance on, the plugin or its outputs. Users are solely responsible for evaluating results, ensuring compliance with applicable laws/policies, and implementing appropriate safeguards before use in any production or regulated context. Synechron shall have no liability whatsoever in connection with the plugin or its outputs. +> +> See [DISCLAIMER.md](./DISCLAIMER.md) for full terms. + +--- + +Generate professional Credit Memorandums in Word, PDF, and PowerPoint with 10 embedded charts. Supports public and private companies. Uses authenticated API calls with SerpApi and SEC EDGAR keys. + +> ⚠️ **Important:** All outputs are AI-generated research aids and must be reviewed by a qualified credit professional before use in any lending decision. This plugin does not constitute financial advice. + +--- + +## What's Included in v1.0.0 + +| Feature | Details | +|---|---| +| Output formats | Word (.docx) + PDF (watermarked) + PowerPoint (.pptx) | +| Charts/Visuals | 10 professional charts, embedded in all formats | +| API key support | SerpApi + SEC EDGAR | +| Private companies | Document upload + web fallback + gap log | +| Internal ratings | Config, upload, or intake | +| Financial history | 3–5 years + sector benchmarks | +| Guardrails | 5-layer compliance enforcement | +| Setup command | Key validation + connectivity check | +| Sector thresholds | 6 industry categories | + +--- + +## Setup + +### Step 1 — Add API Keys (Optional but Recommended) +Copy the template and add your keys: +``` +config/config.template.md → copy and rename to → config/config.local.md +``` +Then open `config.local.md` and fill in: + +**SerpApi Key** — Get free at https://serpapi.com/dashboard +``` +SERPAPI_KEY=your_actual_key_here +``` + +**SEC EDGAR User-Agent** — Not a password; a courtesy identifier required by the SEC. +Format: `"OrganizationName contact@youremail.com"` +``` +SEC_EDGAR_KEY=Acme Credit Team analyst@acmebank.com +``` + +### Step 2 — Verify Setup +Run the setup command to confirm connectivity: +``` +/credit-memo-generation:setup +``` + +--- + +## Commands + +| Command | Description | +|---|---| +| `/credit-memo-generation:setup` | Validate API keys and check connectivity | +| `/credit-memo-generation:generate` | Full Credit Memo — Word + PDF + PowerPoint | +| `/credit-memo-generation:quick-risk-check` | 2-minute preliminary risk screen | +| `/credit-memo-generation:industry-snapshot` | Standalone industry analysis report | +| `/credit-memo-generation:refresh-data` | Update existing memo with latest data | + +--- + +## Output Files + +### Full Credit Memo (`/credit-memo-generation:generate`) +Three files per analysis: +- `Credit_Memo_[Company]_[Date].docx` — Full detailed memo (25–45 pages) +- `Credit_Memo_[Company]_[Date].pdf` — Locked PDF with CONFIDENTIAL watermark +- `Credit_Memo_[Company]_[Date]_Deck.pptx` — Executive summary deck (15–20 slides) + +### Charts Generated (10) +1. Revenue & EBITDA Trend (5-Year) +2. Profit Margins vs. Industry Benchmark +3. Cash Flow Waterfall +4. Balance Sheet Composition +5. Key Financial Ratios Dashboard (Traffic Light) +6. Credit Rating Scale Visual +7. Industry Market Size & Growth +8. SWOT Matrix (4-quadrant color) +9. DSCR Stress Test (3 scenarios) +10. Management Tenure Timeline + +--- + +## Private Company Support + +When a private company is detected, the plugin prompts for document uploads and falls back to web search for missing data. All data is clearly tagged: + +- `[FROM UPLOAD — Management Provided]` — from uploaded documents +- `[WEB ESTIMATE — Verify independently]` — from web search fallback +- `[NOT AVAILABLE]` — not found from any source + +All private company analyses include this disclaimer: +> *"This analysis is based on management-provided financials and/or web-sourced estimates. Independent verification is strongly recommended before credit approval."* + +--- + +## Data Handling & Privacy + +Uploaded documents (financial statements, bank statements, tax returns) are processed locally within your Cowork session. They are not transmitted to third parties beyond the data sources configured in `.mcp.json`. Handle all uploaded documents in accordance with your organization's data classification policies. + +--- + +## Configuring Data Sources + +The plugin ships with free public data sources out of the box. For production use, you can configure premium providers and your own internal systems via `config/data-sources.md`. + +### Built-in free sources (no configuration required) +| Source | Usage | +|---|---| +| SEC EDGAR | 10-K, 10-Q, 8-K filings (User-Agent header required — see setup) | +| SerpApi | Web/news/finance search (free tier: 100 searches/month) | +| Stock Analysis | Financial statements, ratios | +| Macrotrends | 10-year historical data | +| DiscoverCI | Company intelligence | + +### Configurable premium sources +Add API keys to `config/config.local.md` and enable sources in `config/data-sources.md`: + +| Provider | What it unlocks | Config key | +|---|---|---| +| Bloomberg Terminal | Real-time data, full financials, ratings, M&A | `BLOOMBERG_KEY` | +| Refinitiv / LSEG Eikon | Financial statements, estimates, news feeds | `REFINITIV_KEY` | +| FactSet | Standardised financials, estimates, ownership | `FACTSET_KEY` | +| S&P Capital IQ | Private company data, M&A comps, credit scores | `SP_CAPITAL_IQ_KEY` | +| PitchBook | Private company financials, VC/PE deal data | `PITCHBOOK_KEY` | + +### Internal systems +The plugin can connect to your own databases and systems via `config/data-sources.md`: + +- **Internal financial database** — REST API or MCP connector; takes highest priority when configured +- **Internal credit rating system** — REST API, MCP, or static CSV lookup table +- **CRM (Salesforce, Dynamics)** — relationship history and existing facility data +- **Document management (SharePoint, Box, Google Drive)** — for private company document ingestion + +See `config/data-sources.md` for full setup instructions with examples for each source type. + +*Note: Always verify compliance with each source's Terms of Service for automated access.* + +--- + +## Citations & Source Attribution + +Every Credit Memo generated by this plugin includes: + +- **Inline citation numbers** `[1]`, `[2]`, etc. next to key figures in the document body +- **Appendix A — Citations & References** — full table of all sources with URLs and retrieval dates +- **Key Figure Citation Map** — links each major figure (revenue, ratings, ratios, market data) to its source + +--- + +## Data Freshness Policy + +The plugin enforces strict data freshness rules and will warn when data may be stale: + +| Data type | Maximum age before warning | +|---|---| +| Quarterly financials | 6 months | +| Annual financials | 18 months | +| Credit ratings | 12 months | +| News coverage | 30-day minimum window required | +| Industry/market data | 24 months | + +Every output includes a **Data Freshness Summary** box in the Executive Summary showing the age of each data category and when data was retrieved. + +Freshness thresholds are configurable per organisation in `config/data-sources.md`. + +--- + +## Disclaimer + +This plugin is an AI-assisted research tool. All Credit Memorandums, risk assessments, and analyst recommendations generated by this plugin require review by a qualified credit professional before any lending decision is made. + +For the full legal disclaimer covering warranties, liability, and compliance obligations, see [DISCLAIMER.md](./DISCLAIMER.md). + +--- + +*Developed by [Synechron Technologies PVT LTD](https://www.synechron.com)* diff --git a/plugins/partner-built/synechron-credit-memo/commands/generate-credit-memo.md b/plugins/partner-built/synechron-credit-memo/commands/generate-credit-memo.md new file mode 100644 index 000000000..21e861888 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/commands/generate-credit-memo.md @@ -0,0 +1,196 @@ +--- +name: generate-credit-memo +description: Generate a complete Credit Memorandum with full financial, risk, repayment, industry, and management analysis. Outputs Word (.docx), PDF, and PowerPoint files with 10 embedded charts. Supports public and private companies. +--- + +# Command: /credit-memo-generation:generate + +## Purpose +Generate a complete, professional Credit Memorandum. Outputs three files: Word (.docx), PDF, and PowerPoint (.pptx). Includes rich visuals, charts, and tables. Supports both public and private companies. Uses authenticated API calls when SERP and SEC keys are configured. + +--- + +## Trigger +- `/credit-memo-generation:generate` +- "Generate a credit memo for [Company]" +- "Run credit analysis for [Company], loan amount $X" +- "Create a credit memorandum for [Company]" + +--- + +## STEP 0 — Invoke Guardrails +Before anything else, invoke the `guardrails` skill (Layer 1: Session Initialization). + +--- + +## STEP 1 — Read API Configuration +Check for `config/config.local.md` in the plugin folder. +- If found → extract SERPAPI_KEY and SEC_EDGAR_KEY and use in all data calls +- If not found → proceed without keys (lower rate limits, some endpoints restricted) +- Never expose key values in output or logs — only confirm presence + +--- + +## STEP 2 — Collect Basic Inputs + +Ask the user: +``` +📋 CREDIT MEMO — Quick Setup +───────────────────────────────────────── +1. Company name (full legal name preferred) +2. Loan amount required (USD) +3. Purpose of loan +4. [Optional] Loan tenor / repayment period +5. [Optional] Collateral offered +6. [Optional] Internal credit rating (if your org has rated this borrower) +───────────────────────────────────────── +Is this company publicly listed? (Yes / No / Not sure) +``` + +*Invoke `guardrails` skill (Layer 2: Input Validation) on collected inputs.* + +--- + +## STEP 3 — Public vs. Private Company Routing + +### If PUBLIC company: +Proceed directly to Step 4 — full automated data collection. + +### If PRIVATE company: +Display this message: +``` +⚠️ PRIVATE COMPANY DETECTED +────────────────────────────────────────────────────────── +For private companies, financial data is not publicly filed. +To generate the most accurate Credit Memo, please upload +any available documents: + +HIGHLY RECOMMENDED: + 📄 Audited Financial Statements (last 3 years) + 📄 Management Accounts / Unaudited Financials + 📄 Tax Returns (last 2–3 years) + 📄 Bank Statements (last 12 months) + 📄 Business Plan or Investor Deck + 📄 Existing loan agreements or debt schedule + 📄 Accounts Receivable / Payable aging report + +OPTIONAL BUT USEFUL: + 📄 Industry reports or market research + 📄 Any existing credit assessments + 📄 Org chart / management bios + +────────────────────────────────────────────────────────── +🔒 DATA PRIVACY NOTICE +Uploaded documents are processed within your Cowork session +and are not transmitted to third parties. Handle all uploads +in accordance with your organization's data classification +policies. Do not upload documents marked SECRET or above +your organization's permitted sharing threshold. +────────────────────────────────────────────────────────── +Upload what you have, then type CONTINUE. +For any missing data, I will search the web and flag gaps. +────────────────────────────────────────────────────────── +``` + +**After user uploads or types CONTINUE:** +- Ingest all uploaded documents (PDFs, Excel, Word, CSV) +- Extract financial data from uploaded files +- For any missing data point → attempt web search fallback +- Tag every data point: `[FROM UPLOAD]` or `[WEB ESTIMATE]` or `[NOT AVAILABLE]` +- Add disclaimer: *"This analysis is based on management-provided financials and/or web-sourced estimates. Independent verification is strongly recommended before credit approval."* + +--- + +## STEP 4 — Data Collection +*(Invoke `data-collection` skill)* + +Show live progress: +``` +🔍 COLLECTING DATA — [Company Name] +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +✅ SEC EDGAR — 10-K (2019–2023), 10-Q Q3 2024, 3× 8-K +✅ Stock Analysis — 5-year income stmt, balance sheet, cash flow +✅ Macrotrends — 10-year revenue & margin history +✅ Moody's — Baa2 (Stable) as of Nov 2023 +✅ S&P Global — BBB (Stable) as of Oct 2023 +✅ Fitch — BBB- (Negative Watch) as of Sep 2023 +✅ SerpApi/News — 52 articles, 3 risk flags identified +✅ Spherical Insights — Industry: $142bn market, 8.3% CAGR +⚠️ Refinitiv — Key not configured (skipped) +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Data collection complete. Running analysis... +``` + +*Invoke `guardrails` skill (Layer 3: Data Provenance Check) on collected data.* + +--- + +## STEP 5 — Run All Analysis Skills in Parallel +Invoke simultaneously: +1. `financial-analysis` skill — 3–5 year Income, Balance Sheet, Cash Flow +2. `risk-assessment` skill — Ratings, liquidity, leverage, legal, internal rating +3. `repayment-analysis` skill — DSCR, CCC, stress testing +4. `industry-analysis` skill — SWOT, market size, CAGR, competitors +5. `management-assessment` skill — Exec profiles, governance +6. `visuals` skill — Generate all 10 charts + +--- + +## STEP 6 — Generate Three Output Files +*(Invoke `document-generation` skill)* + +Generate in this order: +1. **Word (.docx)** — Full detailed memo, all sections, all tables, embedded charts +2. **PDF** — Converted from Word; CONFIDENTIAL diagonal watermark; editing locked +3. **PowerPoint (.pptx)** — Executive summary deck, 15–20 slides, visual-first + +File naming: +``` +Credit_Memo_[CompanyName]_[YYYY-MM-DD].docx +Credit_Memo_[CompanyName]_[YYYY-MM-DD].pdf +Credit_Memo_[CompanyName]_[YYYY-MM-DD]_Deck.pptx +``` + +*Invoke `guardrails` skill (Layer 5: Output Controls) before delivering files.* + +--- + +## STEP 7 — Deliver + +Present all three files and show key findings summary: +``` +✅ CREDIT MEMO COMPLETE — [Company Name] +══════════════════════════════════════════════════════════ +DEAL SNAPSHOT + Loan Request : USD [Amount] | [Purpose] + Tenor : [X years] + +KEY METRICS + Revenue (LTM) : $X.Xbn (+X.X% YoY) + EBITDA Margin : X.X% + Net Debt/EBITDA: X.Xx + DSCR : X.Xx [✅ Above 1.25x threshold] + +CREDIT RATINGS + Moody's : Baa2 (Stable) + S&P : BBB (Stable) + Fitch : BBB- (Negative Watch) ⚠️ + Internal Rating: [If provided] + +AI-ASSISTED PRELIMINARY ASSESSMENT + ✅ SUPPORTIVE / 🟡 CONDITIONAL / ❌ CONCERNS IDENTIFIED + +⚠️ DISCLAIMER ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +This Credit Memorandum is AI-generated and intended solely +as a research and analytical aid. It does NOT constitute +financial advice or a credit recommendation. All outputs +must be reviewed and approved by a qualified credit +professional before any lending decision is made. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +OUTPUTS + 📄 Word : Credit_Memo_[Company]_[Date].docx + 📄 PDF : Credit_Memo_[Company]_[Date].pdf + 📊 Deck : Credit_Memo_[Company]_[Date]_Deck.pptx +══════════════════════════════════════════════════════════ +``` diff --git a/plugins/partner-built/synechron-credit-memo/commands/industry-snapshot.md b/plugins/partner-built/synechron-credit-memo/commands/industry-snapshot.md new file mode 100644 index 000000000..5f3cbafe1 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/commands/industry-snapshot.md @@ -0,0 +1,105 @@ +--- +name: industry-snapshot +description: Generate a standalone industry analysis report for a given sector or for the industry of a named company. Can be run independently or as a preparatory step before a full Credit Memo. +--- + +# Command: /credit-memo-generation:industry-snapshot + +## Purpose +Generate a standalone Industry Analysis report for a given sector or for the industry of a named company. Can be used independently or as a preparatory step before a full Credit Memo. + +--- + +## Trigger +- `/credit-memo-generation:industry-snapshot` +- "Give me an industry snapshot for [industry / company]" +- "What's the industry outlook for [sector]?" +- "Run industry analysis for [Company]'s sector" +- "What does the [industry] landscape look like?" + +--- + +## Required Inputs +- Either: Company Name (industry auto-detected) OR Industry Name directly +- [Optional] Geography focus (Global / US / India / APAC / EU) +- [Optional] Depth: Summary (1 page) or Detailed (3–5 pages) + +--- + +## Execution Steps + +### STEP 0 — Invoke Guardrails +Invoke `guardrails` skill (Layer 1: Session Initialization) before any data collection. + +### STEP 1 — Industry Identification +If company name given → identify their primary industry/sector. +Confirm with user: *"I've identified [Company] operates in [Industry]. Is that correct?"* + +### STEP 2 — Data Collection +Invoke `guardrails` skill (Layer 3: Data Provenance) after data collection — tag every data point with source name, confidence level, and data-as-of date. + +Pull from: +- Spherical Insights: Market size, CAGR, forecast +- SerpApi: Analyst reports, industry news (use Google News endpoint if key configured) +- SEC EDGAR: Industry-wide 10-K filings for context +- Web: Competitor data, market share, industry associations + +### STEP 3 — Analysis Output +Return in chat AND optionally generate a `.docx` section: + +**Industry Overview** +- Sector definition and scope +- Market size (current year, 5-year forecast) +- CAGR and growth trajectory +- Key growth drivers and headwinds +- Industry lifecycle stage (Emerging / Growth / Mature / Declining) + +**Competitive Landscape** +- Top 5–10 industry players with market share table +- Named company's market position (if applicable) +- Barriers to entry + +**SWOT Analysis Table** +| Strengths | Weaknesses | +|---|---| +| ... | ... | + +| Opportunities | Threats | +|---|---| +| ... | ... | + +**Key Metrics** +- Market size (USD) +- YoY growth rate +- CAGR (3-year, 5-year) +- Seasonality patterns +- Regulatory environment summary + +**Consumer & Demographic Trends** +- Demand shifts +- Demographics driving growth +- Behavioral changes + +**Credit Implications** +- Is this a credit-favorable industry? (Low cyclicality, high visibility = better) +- Industry risks that could impair borrower repayment +- Suggested loan covenants tied to industry risk + +--- + +## Output Format +- Chat summary (always) +- [If detailed requested] → `.docx` Industry Snapshot Report +- Filename: `Industry_Snapshot_[Sector]_[Date].docx` + +--- + +## Notes +- Always invoke `guardrails` skill (Layer 5: Output Controls) before delivering any `.docx` report +- If generating a document, include the standard disclaimer page (see guardrails skill Layer 5) +- All market size figures are estimates from third-party research; tag confidence level per Layer 3 rules + +--- + +> ⚠️ **AI-GENERATED RESEARCH AID — NOT FINANCIAL ADVICE** +> Industry data is AI-generated from publicly available reports and web search. It does not constitute financial advice, investment advice, or a credit recommendation. Market size figures are estimates and must be independently verified against primary sources before use in any credit presentation or lending decision. All outputs require review by a qualified credit professional. diff --git a/plugins/partner-built/synechron-credit-memo/commands/quick-risk-check.md b/plugins/partner-built/synechron-credit-memo/commands/quick-risk-check.md new file mode 100644 index 000000000..e69d1895c --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/commands/quick-risk-check.md @@ -0,0 +1,89 @@ +--- +name: quick-risk-check +description: Run a rapid 2-minute preliminary risk screen on a company. Returns a risk scorecard for initial deal screening — not a substitute for a full Credit Memo or professional credit review. +--- + +# Command: /credit-memo-generation:quick-risk-check + +## Purpose +Run a rapid preliminary risk screen on a company — takes approximately 2 minutes. Returns a risk scorecard without generating the full Credit Memo. Intended for initial deal screening before committing to full analysis. + +> ⚠️ This is a screening tool only. It is not a creditworthiness determination and cannot substitute for a full Credit Memo or qualified professional credit review. + +--- + +## Trigger +- `/credit-memo-generation:quick-risk-check` +- "Quick risk screen on [Company]" +- "Preliminary check on [Company]" +- "Do a fast screening for [Company]" +- "Should I proceed with a full memo on [Company]?" + +--- + +## Required Inputs +- Company Name +- [Optional] Loan Amount + +--- + +## Execution Steps + +### STEP 1 — Invoke Guardrails (Layer 1) +Invoke `guardrails` skill before data collection. + +### STEP 2 — Rapid Data Pull +Collect in parallel (lightweight): +- Latest credit ratings (Moody's, S&P, Fitch) via web search +- Most recent quarterly financials (1 source — Stock Analysis or SEC) +- Top 5 recent news headlines +- Any default, litigation, or distress flags + +### STEP 3 — Score & Flag +Calculate a quick Risk Score across 5 dimensions (score each 1–5): + +| Dimension | Score (1=High Risk, 5=Low Risk) | Key Signal | +|---|---|---| +| Credit Rating | — | External agency rating | +| Financial Health | — | Debt/Equity, Current Ratio | +| News Sentiment | — | Recent negative news | +| Industry Risk | — | Sector cyclicality | +| Litigation / Default | — | Legal flags | + +**Overall Score**: Average of 5 dimensions +- 4.0–5.0 → 🟢 Low preliminary risk — consider full Credit Memo +- 2.5–3.9 → 🟡 Moderate preliminary risk — full memo required before proceeding +- 1.0–2.4 → 🔴 Elevated preliminary risk — flag for senior review before full memo + +### STEP 4 — Output +Return a formatted risk screen card in chat (no document generated): + +``` +⚡ PRELIMINARY RISK SCREEN — [Company Name] +════════════════════════════════════════════ +Credit Rating : BBB (S&P) | Baa2 (Moody's) +Revenue (Latest) : $X.Xbn +Net Debt/EBITDA : X.Xx +Current Ratio : X.X +Recent News : [Positive / Neutral / Negative] +Legal Flags : [None found / ⚠️ See below] +──────────────────────────────────────────── +SCREEN SCORE : X.X/5.0 — 🟢 LOW PRELIMINARY RISK +──────────────────────────────────────────── +Next Step: Run /credit-memo-generation:generate for full analysis + +⚠️ IMPORTANT +This screen is an AI-assisted preliminary indicator only. +It is based on limited data and does NOT constitute a +creditworthiness assessment or financial advice. +A full Credit Memo and qualified professional review are +required before any credit decision. +════════════════════════════════════════════ +``` + +--- + +## Notes +- If any red flags are found, list them explicitly below the main card +- Always recommend full analysis before any credit approval +- Score thresholds are indicative only — not calibrated to any specific credit policy diff --git a/plugins/partner-built/synechron-credit-memo/commands/refresh-data.md b/plugins/partner-built/synechron-credit-memo/commands/refresh-data.md new file mode 100644 index 000000000..14d5cd5d6 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/commands/refresh-data.md @@ -0,0 +1,118 @@ +--- +name: refresh-data +description: Re-fetch the latest data for a previously analyzed company, compare against the prior Credit Memo baseline, and flag material changes. Useful for loan renewals, annual reviews, or when significant events occur. +--- + +# Command: /credit-memo-generation:refresh-data + +## Purpose +Re-fetch the latest data for a previously analyzed company and flag what has changed since the last Credit Memo was generated. Useful for loan renewals, annual reviews, or when significant events occur. + +--- + +## Trigger +- `/credit-memo-generation:refresh-data` +- "Refresh the data for [Company]" +- "What's changed for [Company] since our last memo?" +- "Annual review update for [Company]" +- "Update the credit memo for [Company]" + +--- + +## Required Inputs +- Company Name +- [Optional] Date of previous Credit Memo (for comparison baseline) +- [Optional] Specific sections to refresh (all sections by default) + +--- + +## Execution Steps + +### STEP 0 — Invoke Guardrails +Invoke `guardrails` skill (Layer 1: Session Initialization) before any data collection. +Check `config/config.local.md` for API keys; load custom source priorities from `config/data-sources.md` if present. + +### STEP 1 — Establish Baseline +Ask user: *"Do you have a previous Credit Memo date to compare against? (e.g., June 2023)"* +- If yes → use that date as the comparison baseline +- If no → compare against 12 months ago as default + +### STEP 2 — Targeted Data Refresh +Invoke `guardrails` skill (Layer 3: Data Provenance & Freshness) after data collection — enforce date-of-collection stamps and freshness rules on all updated data points. +Pull only recently changed or newly published data: +- Latest 10-Q or 10-K filed since baseline date +- New credit rating actions (upgrades, downgrades, outlook changes) +- Material news events (M&A, litigation, leadership changes, earnings) +- Updated financial ratios from latest available period +- Industry data refresh (market size updates, new CAGR estimates) + +### STEP 3 — Change Assessment Logic + +For each data category, apply this significance test before flagging: + +**Financial Metrics — Flag if:** +- Revenue change YoY > ±10% +- EBITDA margin change > ±3 percentage points +- Net Debt/EBITDA change > ±0.5x +- Current Ratio falls below 1.0 or rises above 3.0 +- Free Cash Flow turns negative for 2+ quarters + +**Credit Ratings — Flag if:** +- Any agency changes rating by ≥1 notch +- Any agency changes outlook (Stable → Negative, Positive → Watch, etc.) +- New rating action issued by any agency + +**News & Events — Flag if:** +- Litigation filed or judgment >$10M (or >5% of annual revenue) +- M&A announced or completed +- C-suite leadership change (CEO, CFO, COO) +- Earnings miss vs. guidance >10% +- Regulatory investigation or enforcement action +- Default, covenant breach, or debt restructuring + +**Overall Change Severity:** +- 🟢 No material changes — informational refresh only +- 🟡 Moderate changes — recommend review of affected sections +- 🔴 Material changes — recommend full Credit Memo update + +### STEP 4 — Change Summary Output + +``` +📊 DATA REFRESH — [Company Name] +Baseline: [Previous Date] → Current: [Today's Date] +══════════════════════════════════════════════════════ + +📈 FINANCIAL CHANGES + Revenue : $X.Xbn → $X.Xbn (+X.X% YoY) ✅ Improved + EBITDA Mgn : X.X% → X.X% (-X.Xpp) ⚠️ Declined + Net Debt : $X.Xbn → $X.Xbn (Stable) ✅ Stable + DSCR : X.Xx → X.Xx (Stable) ✅ Stable + +📊 RATING CHANGES + S&P : BBB → BBB+ (Upgraded ↑) ✅ Positive + Moody's : Baa2 → Baa2 (No change) ✅ Stable + Fitch : BBB- → BBB- (No change) ✅ Stable + +📰 KEY EVENTS SINCE LAST MEMO + ⚠️ [Date] — Filed $Xm lawsuit in [jurisdiction] + ✅ [Date] — Completed acquisition of [Company] + ⚠️ [Date] — CFO resigned; replacement appointed + +🔄 OVERALL CHANGE SEVERITY: 🟡 MODERATE + → Recommend: Review Risk Assessment and Management sections + +══════════════════════════════════════════════════════ +Run /credit-memo-generation:generate to produce a full updated memo +``` + +### STEP 5 — Optional: Generate Amendment Memo +If changes are significant (🔴 Material), offer: +*"Would you like me to generate an amendment memo showing only the changed sections?"* + +If yes → generate a delta document: +- Filename: `Credit_Memo_[Company]_REFRESH_[Date].docx` +- Include only sections with material changes +- Side-by-side comparison tables where applicable (Old → New) +- Executive summary of what changed and credit impact + +> ⚠️ Refresh outputs are AI-generated and based on publicly available data. All changes and credit implications require review by a qualified credit professional before any lending decision. diff --git a/plugins/partner-built/synechron-credit-memo/commands/setup.md b/plugins/partner-built/synechron-credit-memo/commands/setup.md new file mode 100644 index 000000000..66970c97c --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/commands/setup.md @@ -0,0 +1,120 @@ +--- +name: setup +description: Configure API keys and validate Credit Memo plugin connectivity. Run this first after installation or after updating your config.local.md keys. +--- + +# Command: /credit-memo-generation:setup + +## Purpose +Validate API key configuration, test connectivity to all data sources, and display a readiness summary. Run this after first install or whenever you update your API keys. + +--- + +## Trigger +- `/credit-memo-generation:setup` +- "Set up credit memo plugin" +- "Check my API keys" +- "Validate credit memo configuration" + +--- + +## Execution Steps + +### STEP 0 — Invoke Guardrails (Layer 1) +Invoke `guardrails` skill (Layer 1: Session Initialization) — this displays the one-time session disclaimer and checks key format validity before proceeding with connectivity tests. + +### STEP 1 — Check for config.local.md +Look for `config/config.local.md` in the plugin folder. + +**If not found:** +``` +⚠️ CONFIG FILE NOT FOUND +───────────────────────────────────────────────────────────── +No config.local.md found. The plugin will work in limited mode +(lower rate limits, some endpoints unavailable). + +TO ADD API KEYS: +1. Open: config/config.template.md +2. Copy it and save as: config/config.local.md +3. Fill in your SERPAPI_KEY and SEC_EDGAR_KEY +4. Run /credit-memo-generation:setup again + +CONTINUING WITHOUT KEYS... +───────────────────────────────────────────────────────────── +``` + +**If found:** Proceed to Step 2. + +--- + +### STEP 2 — Validate Key Formats + +**SERPAPI_KEY validation:** +- Check: key is present and not a placeholder (`YOUR_SERPAPI_KEY_HERE`) +- Check: key looks like a valid hex string (64 characters) +- Do NOT expose the key value in output — only confirm presence + +**SEC_EDGAR_KEY validation:** +- Check: key is present and not a placeholder (`YourOrganizationName contact@youremail.com`) +- Check: key contains a space (i.e., appears to be `OrgName email@domain`) — NOT a hex string +- If the value looks like a hex hash, warn the user: + ``` + ⚠️ SEC EDGAR KEY FORMAT ISSUE + Your SEC_EDGAR_KEY appears to be a hex string. SEC EDGAR requires + a User-Agent in the format: "OrganizationName contact@email.com" + Example: Acme Bank analyst@acmebank.com + Please update config.local.md with the correct format. + ``` + +--- + +### STEP 3 — Test Connectivity (Lightweight) + +Run one test call per source — do NOT run full data collection: + +| Source | Test Query | Expected Response | +|---|---|---| +| SEC EDGAR | Fetch Apple Inc. (AAPL) company info from EDGAR | Company name + CIK returned | +| SerpApi | Single search: "Apple Inc revenue 2023" | Results returned | +| Stock Analysis | Fetch AAPL financials page | Page accessible | +| Macrotrends | Fetch AAPL revenue page | Page accessible | + +--- + +### STEP 4 — Display Readiness Report + +``` +✅ CREDIT MEMO PLUGIN — SETUP REPORT +══════════════════════════════════════════════════════════ +CONFIGURATION + Config file : ✅ Found (config/config.local.md) + SERPAPI_KEY : ✅ Configured [100 searches/month on free tier] + SEC_EDGAR_KEY : ✅ Configured [User-Agent format: valid] + Internal Ratings : ⚠️ Not configured [Optional — see config.template.md] + +CONNECTIVITY + SEC EDGAR : ✅ Connected [Apple Inc. — CIK: 0000320193] + SerpApi : ✅ Connected [Results returned in 0.8s] + Stock Analysis : ✅ Accessible + Macrotrends : ✅ Accessible + DiscoverCI : ✅ Accessible + Spherical Insights: ✅ Accessible + +PLUGIN VERSION : v1.0.0 +══════════════════════════════════════════════════════════ +✅ Plugin is ready. Run /credit-memo-generation:generate to start. +══════════════════════════════════════════════════════════ +``` + +If any source fails connectivity, show: +``` + [Source] : ❌ Unreachable [Will use fallback sources] +``` +And note that the plugin will continue using available sources — no source is required. + +--- + +## Notes +- This command makes only lightweight test calls — it does not consume significant API quota +- API keys are never echoed or logged in output +- If all sources fail, advise user to check internet connectivity diff --git a/plugins/partner-built/synechron-credit-memo/config/config.template.md b/plugins/partner-built/synechron-credit-memo/config/config.template.md new file mode 100644 index 000000000..fdba29b48 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/config/config.template.md @@ -0,0 +1,53 @@ +# Credit Memo Generation — API Keys Configuration Template +# ───────────────────────────────────────────────────────────────────── +# HOW TO USE: +# 1. Copy this file and rename the copy to: config.local.md +# 2. Replace the placeholder values below with your real API keys +# 3. config.local.md is for your private use only — never share it +# 4. Claude reads config.local.md automatically at session start +# 5. The plugin works without keys (lower rate limits; some features restricted) +# +# After setup, run /credit-memo-generation:setup to verify connectivity. +# ───────────────────────────────────────────────────────────────────── + +## SERP API (optional but recommended) +SERPAPI_KEY=YOUR_SERPAPI_KEY_HERE + +# Get your key free at: https://serpapi.com/dashboard +# Free tier: 100 searches/month | Paid: 5,000–100,000/month +# Without key: standard web search with lower rate limits +# With key: unlocks Google Finance, Google News, Google Scholar, Bing News + +## SEC EDGAR User-Agent (optional but recommended) +# IMPORTANT: This is NOT a password or API key. +# The SEC requires a courtesy User-Agent in the format: +# "OrganizationName contact@youremail.com" +# Example: SEC_EDGAR_KEY=Acme Credit Team analyst@acmebank.com +SEC_EDGAR_KEY=YourOrganizationName contact@youremail.com + +# Without a User-Agent: limited to 10 req/sec, no full-text search +# With a valid User-Agent: higher rate limits + EDGAR full-text search + +## OPTIONAL: Premium Data Source API Keys +# These keys are referenced by config/data-sources.md (where you configure +# which sources to enable and in what priority order). +# BLOOMBERG_KEY=YOUR_BLOOMBERG_KEY_HERE +# REFINITIV_KEY=YOUR_REFINITIV_KEY_HERE +# FACTSET_KEY=YOUR_FACTSET_KEY_HERE +# FACTSET_USER=YOUR_FACTSET_USERNAME_HERE +# SP_CAPITAL_IQ_KEY=YOUR_SP_CAPITAL_IQ_KEY_HERE +# PITCHBOOK_KEY=YOUR_PITCHBOOK_KEY_HERE + +## OPTIONAL: Internal Systems +# INTERNAL_DB_API_KEY=YOUR_INTERNAL_DB_KEY_HERE +# INTERNAL_RATINGS_KEY=YOUR_INTERNAL_RATINGS_KEY_HERE +# SHAREPOINT_CLIENT_SECRET=YOUR_SHAREPOINT_SECRET_HERE + +## Internal Credit Rating Scale (optional) +# Define your organization's internal rating scale so it appears +# alongside Moody's / S&P / Fitch ratings in the output. +# Examples: +# INTERNAL_RATING_SCALE=AAA,AA,A,BBB,BB,B,CCC,D +# INTERNAL_RATING_SCALE=1,2,3,4,5,6,7,8,9,10 +# INTERNAL_RATING_SCALE=Green,Amber,Red +# INTERNAL_RATING_SCALE=YOUR_SCALE_HERE diff --git a/plugins/partner-built/synechron-credit-memo/config/data-sources.md b/plugins/partner-built/synechron-credit-memo/config/data-sources.md new file mode 100644 index 000000000..c06d4bb07 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/config/data-sources.md @@ -0,0 +1,197 @@ +# Credit Memo Generation — Custom Data Sources Configuration +# ───────────────────────────────────────────────────────────────────── +# HOW TO USE: +# This file lets you configure which data sources the plugin uses +# and in what priority order. It also lets you plug in your own +# internal systems and premium data subscriptions. +# +# The plugin works without this file (falls back to free public sources). +# Add this file to unlock premium sources and internal integrations. +# +# ⚠️ SECURITY NOTE: +# Never store API keys or passwords directly in this file. +# Keys belong in config.local.md (which is private to your session). +# This file only references key NAMES and source settings — not key VALUES. +# ───────────────────────────────────────────────────────────────────── + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 1 — SOURCE PRIORITY ORDER +# ═══════════════════════════════════════════════════════════════════ +# Defines the order in which the plugin tries sources for financial data. +# Higher priority sources are tried first. If a source fails or returns +# no data, the plugin automatically falls back to the next source. +# +# Available source IDs (use these exact names): +# sec_edgar — SEC EDGAR public filings API (free; requires User-Agent) +# serpapi — SerpApi search (requires SERPAPI_KEY in config.local.md) +# bloomberg — Bloomberg Terminal API (requires BLOOMBERG_KEY) +# refinitiv — Refinitiv / LSEG Eikon API (requires REFINITIV_KEY) +# factset — FactSet API (requires FACTSET_KEY + FACTSET_USER) +# sp_capital_iq — S&P Capital IQ (requires SP_CAPITAL_IQ_KEY) +# pitchbook — PitchBook (private companies; requires PITCHBOOK_KEY) +# stock_analysis — stockanalysis.com (free; public companies) +# macrotrends — macrotrends.net (free; historical data) +# discoverci — discoverci.com (free; company intelligence) +# internal_db — Your organisation's internal financial database +# internal_ratings — Your organisation's internal credit rating system +# sharepoint — SharePoint document library (requires SHAREPOINT config) +# box — Box.com (requires BOX_KEY) +# google_drive — Google Drive (requires GOOGLE_DRIVE_KEY) +# upload — User-uploaded documents (always available; no config needed) + +FINANCIAL_DATA_PRIORITY=sec_edgar,bloomberg,refinitiv,factset,sp_capital_iq,stock_analysis,macrotrends,serpapi +RATINGS_DATA_PRIORITY=bloomberg,refinitiv,sp_capital_iq,serpapi +INDUSTRY_DATA_PRIORITY=bloomberg,refinitiv,factset,sp_capital_iq,serpapi +NEWS_DATA_PRIORITY=bloomberg,serpapi +PRIVATE_CO_PRIORITY=upload,pitchbook,sp_capital_iq,internal_db,serpapi + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 2 — PREMIUM DATA PROVIDERS +# ═══════════════════════════════════════════════════════════════════ +# Uncomment and configure the providers you have subscriptions for. +# Add the corresponding API keys to config.local.md (NOT here). + +## Bloomberg Terminal API +# BLOOMBERG_ENABLED=true +# BLOOMBERG_KEY_NAME=BLOOMBERG_KEY +# Bloomberg unlocks: real-time prices, full financials, ratings, news, M&A data +# API docs: https://www.bloomberg.com/professional/support/api-library/ + +## Refinitiv / LSEG Eikon +# REFINITIV_ENABLED=true +# REFINITIV_KEY_NAME=REFINITIV_KEY +# Refinitiv unlocks: financial statements, estimates, credit data, news feeds +# API docs: https://developers.refinitiv.com/ + +## FactSet +# FACTSET_ENABLED=true +# FACTSET_KEY_NAME=FACTSET_KEY +# FACTSET_USER_NAME=FACTSET_USER +# FactSet unlocks: standardized financials, estimates, ownership data +# API docs: https://developer.factset.com/ + +## S&P Capital IQ +# SP_CAPITAL_IQ_ENABLED=true +# SP_CAPITAL_IQ_KEY_NAME=SP_CAPITAL_IQ_KEY +# Capital IQ unlocks: private company data, M&A comps, credit scores +# API docs: https://developer.spglobal.com/ + +## PitchBook (private companies) +# PITCHBOOK_ENABLED=true +# PITCHBOOK_KEY_NAME=PITCHBOOK_KEY +# PitchBook unlocks: private company financials, VC/PE deal data +# API docs: https://docs.pitchbook.com/ + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 3 — INTERNAL DATABASE / API +# ═══════════════════════════════════════════════════════════════════ +# Connect your organisation's own financial database or internal API. +# The plugin will query this FIRST (highest priority) for any company +# that exists in your internal system. + +## Internal Financial Database +# INTERNAL_DB_ENABLED=true +# INTERNAL_DB_TYPE=rest_api # Options: rest_api, sql, mcp +# INTERNAL_DB_ENDPOINT=https://your-internal-api.yourcompany.com/financials +# INTERNAL_DB_KEY_NAME=INTERNAL_DB_API_KEY # Key stored in config.local.md +# +# If using an MCP connector instead: +# INTERNAL_DB_TYPE=mcp +# INTERNAL_DB_MCP_SERVER=your-mcp-server-name +# +# What the plugin expects from your internal API (JSON format): +# { +# "company_id": "...", +# "fiscal_years": [{"year": 2024, "revenue": ..., "ebitda": ...}], +# "existing_facilities": [{"type": "...", "amount": ..., "maturity": "..."}] +# } + +## Internal Relationship / CRM Data (e.g. Salesforce) +# CRM_ENABLED=true +# CRM_TYPE=salesforce # Options: salesforce, dynamics, hubspot, mcp +# CRM_MCP_SERVER=salesforce-mcp # MCP server name if using MCP connector +# Enables: relationship history, existing facilities, account officer notes + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 4 — INTERNAL CREDIT RATING SYSTEM +# ═══════════════════════════════════════════════════════════════════ +# If your organisation has its own credit rating system, configure it here. +# The plugin will pull the internal rating and display it alongside +# Moody's / S&P / Fitch ratings in the output. + +## Internal Rating API +# INTERNAL_RATINGS_ENABLED=true +# INTERNAL_RATINGS_TYPE=rest_api # Options: rest_api, lookup_table, mcp +# INTERNAL_RATINGS_ENDPOINT=https://your-ratings-api.yourcompany.com/ratings +# INTERNAL_RATINGS_KEY_NAME=INTERNAL_RATINGS_KEY + +## Static Lookup Table (for smaller organisations without a ratings API) +# Use this if you rate borrowers manually and store ratings in a file. +# Create a file at config/internal-ratings.csv with columns: +# company_name, internal_rating, rating_date, analyst, rationale +# INTERNAL_RATINGS_TYPE=lookup_table +# INTERNAL_RATINGS_FILE=config/internal-ratings.csv + +## Rating Scale Definition (required if using internal ratings) +# INTERNAL_RATING_SCALE=AAA,AA+,AA,AA-,A+,A,A-,BBB+,BBB,BBB-,BB+,BB,BB-,B,CCC,D +# INTERNAL_RATING_PASSING_THRESHOLD=BBB- # Ratings at or above this = investment grade + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 5 — DOCUMENT MANAGEMENT (PRIVATE COMPANY UPLOADS) +# ═══════════════════════════════════════════════════════════════════ +# For private companies, the plugin can fetch documents directly from +# your document management system instead of requiring manual upload. + +## SharePoint +# SHAREPOINT_ENABLED=true +# SHAREPOINT_TENANT=yourcompany.sharepoint.com +# SHAREPOINT_SITE=CreditTeam +# SHAREPOINT_LIBRARY=BorrowerDocuments +# SHAREPOINT_KEY_NAME=SHAREPOINT_CLIENT_SECRET +# MCP connector (if available): connect Microsoft SharePoint via MCP registry + +## Box +# BOX_ENABLED=true +# BOX_KEY_NAME=BOX_API_KEY +# BOX_FOLDER_ID=your-folder-id + +## Google Drive +# GOOGLE_DRIVE_ENABLED=true +# GOOGLE_DRIVE_KEY_NAME=GOOGLE_DRIVE_KEY +# GOOGLE_DRIVE_FOLDER_ID=your-folder-id + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 6 — DATA FRESHNESS POLICY +# ═══════════════════════════════════════════════════════════════════ +# Override default freshness thresholds if your organisation has +# different data quality standards. + +## Maximum data age before stale warning (in days) +# FRESHNESS_QUARTERLY_FINANCIALS_DAYS=180 # Default: 180 (6 months) +# FRESHNESS_ANNUAL_FINANCIALS_DAYS=548 # Default: 548 (18 months) +# FRESHNESS_CREDIT_RATINGS_DAYS=365 # Default: 365 (12 months) +# FRESHNESS_INDUSTRY_DATA_DAYS=730 # Default: 730 (24 months) +# FRESHNESS_NEWS_MINIMUM_WINDOW_DAYS=30 # Default: 30 (must cover last 30 days) + +## Block generation if data is too stale (vs. just warn) +# FRESHNESS_BLOCK_ON_STALE=false # Default: false (warn only) + + +# ═══════════════════════════════════════════════════════════════════ +# SECTION 7 — OUTPUT & BRANDING +# ═══════════════════════════════════════════════════════════════════ +# Customise the output documents with your organisation's branding. + +# ORGANISATION_NAME=Acme Capital Partners +# ORGANISATION_LOGO=config/logo.png # PNG, max 300×100px recommended +# DOCUMENT_FOOTER_TEXT=Prepared by Acme Capital Partners Credit Team +# CONFIDENTIAL_LABEL=STRICTLY CONFIDENTIAL # Default: CONFIDENTIAL — FOR INTERNAL USE ONLY +# WATERMARK_TEXT=CONFIDENTIAL # Default: CONFIDENTIAL +# PRIMARY_COLOR=#1F3864 # Default: Navy (#1F3864) +# ACCENT_COLOR=#2E75B6 # Default: Blue (#2E75B6) diff --git a/plugins/partner-built/synechron-credit-memo/icon.svg b/plugins/partner-built/synechron-credit-memo/icon.svg new file mode 100644 index 000000000..7f25c7ffe --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/plugins/partner-built/synechron-credit-memo/skills/data-collection/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/data-collection/SKILL.md new file mode 100644 index 000000000..d939544f3 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/data-collection/SKILL.md @@ -0,0 +1,329 @@ +--- +name: credit-memo-data-collection +description: Orchestrates data collection for Credit Memo generation. Reads API keys from config.local.md and uses them for authenticated calls to SerpApi and SEC EDGAR. Handles both public companies (automated collection) and private companies (upload ingestion + web fallback). Always collects 3-5 years of financial data minimum. +--- + +# Data Collection Skill + +## Overview +This skill defines where to get data, how to authenticate, how to handle private companies, and how to tag data confidence. Always collect **minimum 3 years, target 5 years** of financial history. Every data point must be tagged with source and confidence level before being passed to analysis skills. + +--- + +## API Key Usage + +### Reading Keys +At session start, read `config/config.local.md` if it exists: +``` +SERPAPI_KEY → use in all SerpApi calls as &api_key={value} +SEC_EDGAR_KEY → use as User-Agent header in all EDGAR requests +``` +If keys are not found or are placeholders, proceed without them and note rate limit restrictions. + +**Never echo or log key values — only confirm presence.** + +### SEC EDGAR User-Agent — Important Format Note +The SEC EDGAR key is **not a traditional API key or password**. It is a courtesy User-Agent string that the SEC requires for higher-rate access. The correct format is: + +``` +User-Agent: OrganizationName contact@youremail.com +``` + +Example: `User-Agent: Acme Credit Team analyst@acmebank.com` + +If the configured value looks like a hex string (no space, no `@`), warn the user before making EDGAR calls: +``` +⚠️ SEC_EDGAR_KEY format appears incorrect. +Expected format: "OrganizationName contact@email.com" +Current value looks like a hash or token — EDGAR may reject this. +Please update config.local.md and run /credit-memo-generation:setup. +Proceeding with standard rate limits. +``` + +### With SERPAPI_KEY (authenticated): +- Rate limit: up to 15,000 searches/month depending on plan +- Access: Google Finance, Google News, Google Scholar, Bing News +- Better results: less bot-blocking, more consistent data + +Append to every SerpApi URL: +``` +&api_key={SERPAPI_KEY}&num=10&hl=en&gl=us +``` + +Useful SerpApi endpoints with key: +``` +Google Search: engine=google&q={query} +Google Finance: engine=google_finance&q={TICKER}:NASDAQ +Google News: engine=google_news&q={company}+credit+rating +Yahoo Finance: engine=yahoo_finance_search&p={company} +``` + +### With SEC_EDGAR_KEY (valid User-Agent): +Use as User-Agent header on all EDGAR requests: +``` +User-Agent: {SEC_EDGAR_KEY} +``` + +EDGAR endpoints to use: +``` +# Full-text search across filings +https://efts.sec.gov/LATEST/search-index?q="{company}"&forms=10-K,10-Q,8-K&dateRange=custom&startdt={year-4}-01-01&enddt={current_year}-12-31 + +# Company CIK lookup +https://www.sec.gov/cgi-bin/browse-edgar?company={company}&CIK=&type=10-K&action=getcompany + +# Direct filing access once CIK known +https://data.sec.gov/submissions/CIK{cik_padded}.json +``` + +--- + +## Data Source Notes & Terms of Service + +The following sources are used for data collection. Claude should be aware that automated access may be subject to each source's Terms of Service: + +| Source | Access Type | Notes | +|---|---|---| +| SEC EDGAR | Official public API | Free; requires User-Agent header per SEC guidelines | +| SerpApi | Paid API | Legitimate API access; rate limits per plan | +| Stock Analysis (stockanalysis.com) | Web scraping | For informational use; verify ToS compliance | +| Macrotrends (macrotrends.net) | Web scraping | For informational use; verify ToS compliance | +| DiscoverCI (discoverci.com) | Web scraping | For informational use; verify ToS compliance | +| Spherical Insights | Web scraping | Market reports; verify ToS compliance | + +If your organization requires strict ToS compliance, consider substituting scraping-based sources with licensed data providers (Bloomberg, Refinitiv, FactSet). + +--- + +## Financial Data — Time Period Rules + +**ALWAYS collect minimum 3 years. Target 5 years.** + +| Data Type | Minimum | Target | Source Priority | +|---|---|---|---| +| Annual Income Statement | 3 years | 5 years | SEC 10-K → Stock Analysis → Macrotrends | +| Annual Balance Sheet | 3 years | 5 years | SEC 10-K → Stock Analysis | +| Annual Cash Flow | 3 years | 5 years | SEC 10-K → Stock Analysis | +| Quarterly Financials | 4 quarters | 8 quarters | SEC 10-Q | +| Credit Ratings History | 2 years | 5 years | Web search | +| News & Events | 12 months | 24 months | SerpApi | + +When collecting, always note the year range retrieved: *"Financial data covers FY2019–FY2023 (5 years)."* + +--- + +## Public Company Data Collection + +### Phase 1: Identity Resolution +``` +Search: "{company name}" stock ticker SEC CIK +→ Extract: Ticker symbol, CIK number, exchange, SIC code, fiscal year end +``` + +### Phase 2: SEC EDGAR (Primary — most authoritative) +Pull with authenticated header if key available: + +**10-K Annual Reports (last 5 years):** +- Income Statement: Revenue, COGS, Gross Profit, EBITDA, EBIT, Net Income, EPS +- Balance Sheet: Assets breakdown, Liabilities breakdown, Equity, Cash, Debt (ST + LT) +- Cash Flow: Operating, Investing, Financing, FCF, CapEx +- MD&A section: Management's own analysis and forward guidance +- Notes: Debt covenants, contingent liabilities, related party transactions + +**10-Q Quarterly (last 4 quarters):** +- Latest quarterly snapshot for trend analysis +- Any guidance updates or restatements + +**8-K Material Events (last 24 months):** +- Leadership changes, M&A, material litigation, credit amendments, defaults + +### Phase 3: Structured Financial Data +Stock Analysis (`https://stockanalysis.com/stocks/{ticker}/financials/`): +- Annual and TTM financial tables +- Key ratios: PE, EV/EBITDA, Debt/Equity, Current Ratio, Quick Ratio, ROE, ROA + +Macrotrends (`https://www.macrotrends.net/stocks/charts/{ticker}/`): +- 10-year historical data for trend analysis +- Profit margins history, revenue growth history + +### Phase 4: Credit Ratings +SerpApi searches (use Google News endpoint if key available): +``` +"{company}" Moody's credit rating 2024 outlook +"{company}" S&P Global rating action 2024 +"{company}" Fitch rating downgrade upgrade 2024 +"{company}" credit rating history +``` +Capture: Agency, rating, outlook, date, rationale, triggers. + +### Phase 5: Industry Data +Spherical Insights + SerpApi: +``` +"{industry}" market size 2024 billion CAGR forecast +"{industry}" market share leaders 2024 +"{company}" market share position 2024 +``` + +### Phase 6: News, Litigation, Management +SerpApi (use Google News if key available): +``` +"{company}" lawsuit litigation SEC investigation 2023 2024 +"{company}" CEO CFO management change leadership 2024 +"{company}" default debt restructuring covenant +"{company}" earnings results revenue guidance 2024 +"{company}" acquisition merger strategy 2024 +``` + +--- + +## Private Company Handling + +### Step 1: Ingest Uploaded Documents +For each uploaded file: +- PDF financial statements → extract tables, income/balance/cashflow data +- Excel files → read all sheets, extract financial data +- Word/text documents → extract narrative, management info +- CSV files → parse as financial data + +Tag all extracted data: `[FROM UPLOAD — Management Provided]` + +### Step 2: Web Fallback for Missing Data +For each data point NOT found in uploads, attempt web search: +``` +"{company name}" company overview founded employees headquarters +"{company name}" revenue 2023 2022 annual results +"{industry}" average revenue margins ratios private companies +"{company name}" news 2024 +"{company name}" lawsuit litigation court +"{company name}" director CEO background +``` + +Tag web-sourced data: `[WEB ESTIMATE — Verify independently]` + +### Step 3: Data Gap Log +Create a structured gap log (included in Appendix B of output): + +| Data Point | Expected | Status | Fallback Used | +|---|---|---|---| +| Revenue FY2021 | $Xm | ⚠️ MISSING | Industry estimate | +| Balance Sheet FY2022 | Full | ✅ FROM UPLOAD | — | +| Credit Rating | Agency rating | ❌ NOT AVAILABLE | Internal only | +| Management Bio CEO | Full bio | 🟡 PARTIAL | LinkedIn/web | + +--- + +## Data Confidence Tagging +Tag every major data point: +``` +✅ HIGH — SEC filing, official agency rating, audited financials +🟡 MEDIUM — Reputable financial data provider, verified press release +⚠️ LOW — Web estimate, unaudited management accounts, older than 18 months +❌ MISSING — Not found from any source +[FROM UPLOAD] — Management-provided, not independently verified +``` + +**No fabrication rule:** If a data point cannot be found, mark it `❌ MISSING`. Never fill a missing value with a plausible-looking estimate without an explicit `⚠️ LOW` tag and explanation. + +--- + +## Data Freshness Enforcement + +**Before finalising collected data, run these checks on every data point:** + +### Freshness check protocol: +``` +For each data point collected: + 1. Record collected_at = current datetime (ISO 8601) + 2. Record data_as_of = the date the data reflects (e.g. fiscal year end, rating date, article date) + 3. Calculate age = today - data_as_of + 4. Apply freshness rule from table below + 5. Tag accordingly +``` + +### Freshness rules: +| Data Type | Stale if older than | Action | +|---|---|---| +| Latest quarterly financials | 6 months | ⚠️ STALE — attempt to find updated quarter; flag in output | +| Latest annual financials | 18 months | ⚠️ STALE — flag prominently; note gap year in output | +| Credit ratings | 12 months | ⚠️ POSSIBLY OUTDATED — flag; recommend direct agency check | +| News coverage | 30 days minimum window required | ⚠️ NO RECENT NEWS — note in output | +| Industry market data | 24 months | 🟡 NOTE AS OLDER ESTIMATE in output | +| Management/leadership data | 12 months | 🟡 NOTE; check for recent leadership changes | +| Stock/market data | 1 business day | ⚠️ STALE — always fetch live price/market cap | + +### "Latest data" rule — always enforce: +- **ALWAYS** search for the most recent quarter available before using annual-only data +- **ALWAYS** check for any 8-K or press release within the last 30 days that may supersede filed data +- **ALWAYS** check for a rating action or rating watch update within the last 6 months +- **NEVER** use an older data point if a newer one is retrievable — log why if a newer point was unavailable + +### Freshness summary object (pass to document generation): +```json +{ + "freshness_summary": { + "annual_financials_as_of": "FY2025 (Jun 30, 2025)", + "quarterly_financials_as_of": "Q2 FY2026 (Dec 31, 2025)", + "credit_ratings_as_of": "Apr 2026", + "news_coverage_window": "Jan 1, 2026 – Apr 7, 2026", + "industry_data_as_of": "Q1 2025", + "management_data_as_of": "Nov 2025", + "collection_timestamp": "2026-04-07T12:00:00Z", + "stale_items": ["industry_data"], + "missing_items": ["fitch_rating", "internal_rating"] + } +} +``` + +--- + +## Output Data Object Structure +```json +{ + "meta": { + "company": "...", + "ticker": "...", + "is_public": true, + "data_period": "FY2021-FY2025", + "collection_timestamp": "YYYY-MM-DDTHH:MM:SSZ", + "api_keys_used": ["serpapi", "sec_edgar"], + "custom_sources_used": ["bloomberg", "internal_ratings_db"], + "gaps": ["list of missing data points"], + "stale_items": ["list of items flagged as stale"], + "citations": { + "1": {"source": "Stock Analysis", "url": "https://stockanalysis.com/stocks/msft/financials/", "retrieved": "YYYY-MM-DD"}, + "2": {"source": "S&P Global Ratings", "url": "https://disclosure.spglobal.com/...", "retrieved": "YYYY-MM-DD"} + } + }, + "financials": { + "income_statement": [], + "balance_sheet": [], + "cash_flow": [], + "quarterly": [], + "ratios": [] + }, + "credit_ratings": { + "moodys": { "rating": "", "outlook": "", "date": "", "rationale": "" }, + "sp": { "rating": "", "outlook": "", "date": "", "rationale": "" }, + "fitch": { "rating": "", "outlook": "", "date": "", "rationale": "" }, + "internal": { "rating": "", "scale": "", "rationale": "", "date": "" } + }, + "industry": { + "name": "", "sic_code": "", + "market_size_usd_bn": 0, + "cagr_3yr": 0, "cagr_5yr": 0, + "yoy_growth": 0, + "top_competitors": [], + "company_market_share_pct": 0 + }, + "news": { + "articles": [], + "sentiment": "positive/neutral/negative", + "red_flags": [] + }, + "management": { + "executives": [], + "board": [], + "recent_changes": [] + } +} +``` diff --git a/plugins/partner-built/synechron-credit-memo/skills/document-generation/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/document-generation/SKILL.md new file mode 100644 index 000000000..dd8e53ae9 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/document-generation/SKILL.md @@ -0,0 +1,401 @@ +--- +name: credit-memo-document-generation +description: Compiles all analyzed sections and charts into professional Word (.docx), PDF, and PowerPoint (.pptx) output files. Reads chart PNGs from the visuals skill, embeds them with captions, and generates all three formats. Claude uses this skill as the final step in Credit Memo generation. +--- + +# Document Generation Skill + +## Overview +Generate three output files from the underlying data and analysis: +- **Word (.docx)** — Full detailed memo (25–45 pages), all tables, embedded charts +- **PDF** — Converted from Word; CONFIDENTIAL watermark; locked for editing +- **PowerPoint (.pptx)** — Executive summary deck (15–20 slides), visual-first + +--- + +## WORD DOCUMENT (.docx) + +### Setup +```bash +npm install -g docx +``` + +```javascript +const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, + ImageRun, Header, Footer, AlignmentType, HeadingLevel, BorderStyle, + WidthType, ShadingType, VerticalAlign, PageNumber, PageBreak, + LevelFormat } = require('docx'); +const fs = require('fs'); +``` + +### Document Structure +``` +1. Cover Page (Company name, date, loan amount, CONFIDENTIAL marking, disclaimer) +2. Deal Snapshot (key metrics one-pager) +3. Table of Contents +4. Executive Summary +5. Company Overview +6. Financial Analysis + 6.1 Income Statement (+ chart_revenue_ebitda.png, chart_margins.png) + 6.2 Balance Sheet (+ chart_balance_sheet.png) + 6.3 Cash Flow (+ chart_cashflow_waterfall.png) +7. Industry Analysis (+ chart_industry.png, chart_swot.png) +8. Risk Assessment (+ chart_ratios_dashboard.png, chart_credit_ratings.png) +9. Repayment Analysis (+ chart_dscr_stress.png) +10. Management Assessment (+ chart_mgmt_tenure.png) +11. Credit Opinion & AI-Assisted Preliminary Assessment +12. Appendix A: Data Sources & Confidence Levels +13. Appendix B: Data Gap Log (if any MISSING items) +14. Disclaimer Page (full text — required) +``` + +### Page Setup (US Letter) +```javascript +sections: [{ + properties: { + page: { + size: { width: 12240, height: 15840 }, + margin: { top: 1080, right: 1080, bottom: 1080, left: 1080 } + } + }, + headers: { + default: new Header({ + children: [ + new Table({ + width: { size: 10080, type: WidthType.DXA }, + columnWidths: [5040, 5040], + borders: { bottom: { style: BorderStyle.SINGLE, size: 1, color: '2E75B6' }, + top: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, + right: { style: BorderStyle.NONE }, insideH: { style: BorderStyle.NONE }, + insideV: { style: BorderStyle.NONE } }, + rows: [new TableRow({ children: [ + new TableCell({ children: [new Paragraph({ children: [ + new TextRun({ text: company_name, bold: true, color: '1F3864', size: 18 }) + ]})]}), + new TableCell({ children: [new Paragraph({ alignment: AlignmentType.RIGHT, children: [ + new TextRun({ text: 'CONFIDENTIAL — FOR INTERNAL USE ONLY', color: '808080', size: 14, italics: true }) + ]})]}), + ]})] + }) + ] + }) + }, + footers: { + default: new Footer({ + children: [ + new Paragraph({ alignment: AlignmentType.CENTER, children: [ + new TextRun({ text: `Credit Memorandum | ${company_name} | ${date} | Page `, size: 16, color: '808080' }), + new PageNumber() + ]}), + new Paragraph({ alignment: AlignmentType.CENTER, children: [ + new TextRun({ + text: 'AI-generated research aid — not financial advice. Requires review by a qualified credit professional.', + size: 12, color: 'A0A0A0', italics: true + }) + ]}) + ] + }) + } +}] +``` + +### Embedding Charts +```javascript +function embedChart(chartPath, width = 600, height = 350, caption = '') { + // Check for placeholder chart first + const isPlaceholder = chartPath.includes('placeholder') || + !fs.existsSync(chartPath); + if (isPlaceholder) { + return [ + new Paragraph({ + alignment: AlignmentType.CENTER, + spacing: { before: 200, after: 100 }, + children: [new TextRun({ + text: `📊 ${caption} — Data not available for this analysis. See Appendix B.`, + italics: true, size: 18, color: 'A0A0A0' + })] + }) + ]; + } + const imageData = fs.readFileSync(chartPath); + return [ + new Paragraph({ + alignment: AlignmentType.CENTER, + children: [new ImageRun({ + type: 'png', + data: imageData, + transformation: { width, height }, + altText: { title: caption, description: caption, name: caption } + })] + }), + new Paragraph({ + alignment: AlignmentType.CENTER, + spacing: { after: 200 }, + children: [new TextRun({ text: caption, italics: true, size: 18, color: '808080' })] + }) + ]; +} +``` + +### Section Header Style +```javascript +function sectionBanner(number, title) { + return new Table({ + width: { size: 10080, type: WidthType.DXA }, + columnWidths: [10080], + rows: [new TableRow({ children: [ + new TableCell({ + shading: { fill: '1F3864', type: ShadingType.CLEAR }, + margins: { top: 120, bottom: 120, left: 240, right: 240 }, + children: [new Paragraph({ children: [ + new TextRun({ text: `${number} ${title.toUpperCase()}`, + bold: true, color: 'FFFFFF', size: 28 }) + ]})] + }) + ]})] + }); +} +``` + +### Disclaimer Page (Required — must be last page before appendices) +```javascript +function disclaimerPage() { + return [ + new Paragraph({ pageBreakBefore: true }), + new Table({ + width: { size: 10080, type: WidthType.DXA }, + rows: [new TableRow({ children: [new TableCell({ + shading: { fill: 'FFF3CD', type: ShadingType.CLEAR }, + margins: { top: 300, bottom: 300, left: 300, right: 300 }, + children: [ + new Paragraph({ children: [new TextRun({ + text: '⚠️ AI-GENERATED RESEARCH AID — NOT FINANCIAL ADVICE', + bold: true, size: 24, color: '856404' + })]}), + new Paragraph({ spacing: { before: 200 }, children: [new TextRun({ + text: 'This Credit Memorandum is generated by an AI assistant and is intended solely as a research and analytical aid for qualified credit professionals. It does NOT constitute financial advice, investment advice, or a credit recommendation of any kind.', + size: 18, color: '495057' + })]}), + new Paragraph({ spacing: { before: 150 }, children: [new TextRun({ + text: 'All outputs must be independently reviewed and validated by a qualified credit professional before use in any lending, investment, or credit decision. The plugin author, Anthropic, and affiliated parties accept no liability for decisions made based on this document.', + size: 18, color: '495057' + })]}), + new Paragraph({ spacing: { before: 150 }, children: [new TextRun({ + text: 'Data sources, confidence levels, and data gaps are documented in Appendices A and B. Where data is estimated or management-provided, this is explicitly noted throughout the document.', + size: 18, color: '495057' + })]}) + ] + })})] + }) + ]; +} +``` + +--- + +## PDF GENERATION + +### Method: docx2pdf (preferred — highest fidelity) +```bash +pip install docx2pdf --break-system-packages +``` + +```python +from docx2pdf import convert +import subprocess, sys + +docx_path = f'Credit_Memo_{company}_{date}.docx' +pdf_path = f'Credit_Memo_{company}_{date}.pdf' + +try: + convert(docx_path, pdf_path) + print(f"PDF generated: {pdf_path}") +except Exception as e: + # Fallback: LibreOffice headless + subprocess.run([ + 'libreoffice', '--headless', '--convert-to', 'pdf', + '--outdir', '/tmp/', docx_path + ], check=True) + print(f"PDF generated via LibreOffice: {pdf_path}") +``` + +### Add CONFIDENTIAL Watermark to PDF +```python +pip install PyMuPDF --break-system-packages +``` + +```python +import fitz # PyMuPDF + +def add_watermark(pdf_path, output_path): + doc = fitz.open(pdf_path) + for page in doc: + # Diagonal CONFIDENTIAL watermark + page.insert_text( + (page.rect.width * 0.15, page.rect.height * 0.55), + "CONFIDENTIAL", + fontsize=72, + color=(0.85, 0.85, 0.85), + rotate=45, + overlay=False + ) + doc.save(output_path) + doc.close() + +add_watermark(pdf_path, pdf_path) +``` + +--- + +## POWERPOINT DECK (.pptx) + +### Setup +```bash +pip install python-pptx --break-system-packages +``` + +```python +from pptx import Presentation +from pptx.util import Inches, Pt, Emu +from pptx.dml.color import RGBColor +from pptx.enum.text import PP_ALIGN +import datetime + +NAVY = RGBColor(0x1F, 0x38, 0x64) +BLUE = RGBColor(0x2E, 0x75, 0xB6) +GOLD = RGBColor(0xC9, 0xA8, 0x4C) +GREEN = RGBColor(0x70, 0xAD, 0x47) +WHITE = RGBColor(0xFF, 0xFF, 0xFF) +LGRAY = RGBColor(0xF2, 0xF2, 0xF2) + +prs = Presentation() +prs.slide_width = Inches(13.33) +prs.slide_height = Inches(7.5) +blank_layout = prs.slide_layouts[6] # Blank layout +``` + +### Slide Structure (15–20 slides) +``` +Slide 1: Title — Company name, loan amount, date, CONFIDENTIAL +Slide 2: Disclaimer (required — AI-generated research aid) +Slide 3: Deal Snapshot — Key metrics at a glance +Slide 4: Company Overview — Business description, revenue mix +Slide 5: Financial Highlights — Revenue, EBITDA, FCF summary +Slide 6: Revenue & EBITDA Trend (chart_revenue_ebitda.png) +Slide 7: Profit Margin Trends (chart_margins.png) +Slide 8: Balance Sheet Composition (chart_balance_sheet.png) +Slide 9: Cash Flow Waterfall (chart_cashflow_waterfall.png) +Slide 10: Key Ratio Dashboard (chart_ratios_dashboard.png) +Slide 11: Credit Ratings (chart_credit_ratings.png) +Slide 12: Industry Overview (chart_industry.png) +Slide 13: SWOT Analysis (chart_swot.png) +Slide 14: Repayment & DSCR Stress Test (chart_dscr_stress.png) +Slide 15: Management Team (chart_mgmt_tenure.png) +Slide 16: Risk Summary — Heat map table +Slide 17: AI-Assisted Preliminary Assessment + Conditions +Slide 18: Appendix — Data sources and confidence levels +``` + +### Title Slide +```python +def add_title_slide(prs, company, loan_amount, date): + slide = prs.slides.add_slide(blank_layout) + # Navy background + bg = slide.background.fill + bg.solid() + bg.fore_color.rgb = NAVY + + # Company name + txb = slide.shapes.add_textbox(Inches(1), Inches(1.5), Inches(11), Inches(1.5)) + tf = txb.text_frame + tf.word_wrap = True + p = tf.paragraphs[0] + p.text = company + p.font.bold = True + p.font.size = Pt(44) + p.font.color.rgb = WHITE + + # Subtitle + txb2 = slide.shapes.add_textbox(Inches(1), Inches(3.2), Inches(11), Inches(0.8)) + tf2 = txb2.text_frame + p2 = tf2.paragraphs[0] + p2.text = f"Credit Memorandum | Loan Request: {loan_amount} | {date}" + p2.font.size = Pt(20) + p2.font.color.rgb = GOLD + + # CONFIDENTIAL tag + txb3 = slide.shapes.add_textbox(Inches(1), Inches(6.5), Inches(11), Inches(0.5)) + tf3 = txb3.text_frame + p3 = tf3.paragraphs[0] + p3.text = "CONFIDENTIAL — FOR INTERNAL USE ONLY | AI-generated research aid — not financial advice" + p3.font.size = Pt(11) + p3.font.color.rgb = RGBColor(0xAA, 0xAA, 0xAA) + p3.font.italic = True +``` + +### Chart Slide Helper +```python +def add_chart_slide(prs, title, chart_path, note=''): + slide = prs.slides.add_slide(blank_layout) + # Light gray background + bg = slide.background.fill + bg.solid() + bg.fore_color.rgb = LGRAY + + # Title bar + txb = slide.shapes.add_textbox(Inches(0.3), Inches(0.2), Inches(12.7), Inches(0.7)) + tf = txb.text_frame + p = tf.paragraphs[0] + p.text = title + p.font.bold = True + p.font.size = Pt(22) + p.font.color.rgb = NAVY + + # Chart image (or placeholder) + import os + if chart_path and os.path.exists(chart_path): + slide.shapes.add_picture(chart_path, Inches(0.5), Inches(1.0), + Inches(12.3), Inches(5.8)) + else: + txb_ph = slide.shapes.add_textbox(Inches(2), Inches(3), Inches(9), Inches(1)) + tf_ph = txb_ph.text_frame + p_ph = tf_ph.paragraphs[0] + p_ph.text = f"📊 {title} — Data not available. See Appendix." + p_ph.font.size = Pt(16) + p_ph.font.color.rgb = RGBColor(0xAA, 0xAA, 0xAA) + p_ph.font.italic = True + p_ph.alignment = PP_ALIGN.CENTER + + # Bottom note + if note: + txb_n = slide.shapes.add_textbox(Inches(0.3), Inches(7.0), Inches(12.7), Inches(0.35)) + tf_n = txb_n.text_frame + p_n = tf_n.paragraphs[0] + p_n.text = note + p_n.font.size = Pt(9) + p_n.font.color.rgb = RGBColor(0x80, 0x80, 0x80) + p_n.font.italic = True +``` + +### Save PowerPoint +```python +pptx_path = f'Credit_Memo_{company}_{date}_Deck.pptx' +prs.save(pptx_path) +print(f"PowerPoint saved: {pptx_path}") +``` + +--- + +## Final Output Checklist +Before presenting files to the user, verify: +- [ ] Word file opens without errors +- [ ] All 10 charts embedded in Word (placeholder note if any are missing) +- [ ] Disclaimer page present in Word document +- [ ] PDF generated with CONFIDENTIAL watermark +- [ ] PowerPoint has disclaimer on slide 2 and assessment slide +- [ ] All files named consistently: `Credit_Memo_[Company]_[Date].*` +- [ ] File sizes are reasonable (Word: 2–15MB, PDF: similar, PPT: 5–20MB) +- [ ] Data gap appendix included if any items were marked MISSING + +## File Delivery +Present all three files with download links. Guardrails Layer 5 must be invoked before presenting. diff --git a/plugins/partner-built/synechron-credit-memo/skills/financial-analysis/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/financial-analysis/SKILL.md new file mode 100644 index 000000000..33be9c188 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/financial-analysis/SKILL.md @@ -0,0 +1,238 @@ +--- +name: credit-memo-financial-analysis +description: Performs deep financial analysis of a company for credit assessment purposes. Covers Income Statement Analysis, Balance Sheet Analysis, and Cash Flow Analysis over 3–5 years. Generates human-readable commentary, calculates key financial ratios, identifies trends, flags concerns, and benchmarks against industry-adjusted averages. Claude draws on this skill automatically when analyzing financials for a Credit Memo. +--- + +# Credit Memo — Financial Analysis Skill + +## Overview +This skill defines how to analyze 3–5 years of financial data to assess creditworthiness. The output should be analytical, not just descriptive — interpret what the numbers mean for repayment risk. + +--- + +## Guiding Principle +**Never just report numbers. Always interpret them.** +Instead of: *"Revenue was $5.2bn in 2023"* +Write: *"Revenue grew 12% YoY to $5.2bn in 2023, driven by [X], reflecting the company's ability to grow organically despite [macro headwind]. This trajectory supports adequate cash generation for debt service."* + +--- + +## Sector-Specific Ratio Thresholds + +Apply the appropriate industry benchmarks based on the company's primary sector. Do not apply manufacturing thresholds to a SaaS company, or retail thresholds to real estate. + +### Manufacturing +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| Current Ratio | >2.5x | 1.5–2.5x | 1.0–1.5x | <1.0x | +| Net Debt/EBITDA | <2.0x | 2.0–3.0x | 3.0–4.0x | >4.0x | +| Interest Coverage | >6x | 4–6x | 2–4x | <2x | +| EBITDA Margin | >20% | 12–20% | 8–12% | <8% | +| CapEx/Revenue | <5% | 5–10% | 10–15% | >15% | + +### SaaS / Technology +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| Current Ratio | >3.0x | 2.0–3.0x | 1.0–2.0x | <1.0x | +| Net Debt/EBITDA | <1.5x | 1.5–3.0x | 3.0–5.0x | >5.0x | +| Interest Coverage | >8x | 5–8x | 3–5x | <3x | +| EBITDA Margin | >30% | 15–30% | 5–15% | <5% | +| Rule of 40 (Rev Growth% + EBITDA%) | >50 | 40–50 | 30–40 | <30 | +| Gross Margin | >70% | 60–70% | 50–60% | <50% | + +### Retail / Consumer +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| Current Ratio | >2.0x | 1.2–2.0x | 0.8–1.2x | <0.8x | +| Net Debt/EBITDA | <2.5x | 2.5–3.5x | 3.5–5.0x | >5.0x | +| Interest Coverage | >5x | 3–5x | 1.5–3x | <1.5x | +| EBITDA Margin | >12% | 7–12% | 4–7% | <4% | +| Inventory Days (DIO) | <45 days | 45–75 days | 75–100 days | >100 days | +| Same-Store Sales Growth | >4% | 1–4% | 0–1% | <0% | + +### Real Estate / REITs +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| LTV (Loan-to-Value) | <40% | 40–55% | 55–65% | >65% | +| Debt Service Coverage | >2.0x | 1.5–2.0x | 1.2–1.5x | <1.2x | +| FFO/Debt | >20% | 12–20% | 8–12% | <8% | +| Interest Coverage | >3x | 2–3x | 1.5–2x | <1.5x | +| Occupancy Rate | >95% | 88–95% | 80–88% | <80% | +| Cap Rate vs. Borrowing Rate | Spread >200bps | 100–200bps | 50–100bps | <50bps | + +### Healthcare +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| Current Ratio | >2.5x | 1.5–2.5x | 1.0–1.5x | <1.0x | +| Net Debt/EBITDA | <2.5x | 2.5–4.0x | 4.0–5.5x | >5.5x | +| Interest Coverage | >5x | 3–5x | 2–3x | <2x | +| EBITDA Margin | >18% | 10–18% | 5–10% | <5% | +| Days Sales Outstanding (DSO) | <45 days | 45–65 days | 65–90 days | >90 days | + +### Energy (Oil & Gas / Utilities) +| Ratio | Strong | Adequate | Watch | Risk | +|---|---|---|---|---| +| Net Debt/EBITDA | <2.0x | 2.0–3.5x | 3.5–5.0x | >5.0x | +| Interest Coverage | >5x | 3–5x | 2–3x | <2x | +| EBITDA Margin | >35% | 20–35% | 10–20% | <10% | +| Debt/Proved Reserves | <$10/BOE | $10–15/BOE | $15–20/BOE | >$20/BOE | +| Dividend Coverage (FCF/Dividends) | >2x | 1.5–2x | 1.0–1.5x | <1.0x | + +**When sector is unclear or spans multiple categories:** Apply the more conservative thresholds of the two most relevant sectors and note the approach. + +--- + +## Section 1: Financial Overview Summary + +Lead with a concise 2–3 paragraph executive narrative covering: +- Overall financial health in plain English +- Most significant trends (positive and negative) +- Key ratios that matter most for credit decision +- Whether financials support the loan request + +--- + +## Section 2: Income Statement Analysis + +### Questions to Answer: +- What are the firm's revenue and profit trends over 3–5 years? +- What are gross profit margin, operating margin, and net margin? +- How does profitability compare to sector benchmarks? +- What is the EBITDA trajectory and what drives it? +- Are there significant cost structure changes? +- What are the historical growth rates in revenue and profit? + +### Required Calculations: +``` +Gross Profit Margin = (Gross Profit / Revenue) × 100 +Operating Margin = (Operating Income / Revenue) × 100 +Net Profit Margin = (Net Income / Revenue) × 100 +EBITDA Margin = (EBITDA / Revenue) × 100 +Revenue Growth (YoY) = ((Current Revenue - Prior Revenue) / Prior Revenue) × 100 +Cost of Revenue % = (COGS / Revenue) × 100 +SG&A as % of Revenue = (SG&A / Revenue) × 100 +R&D as % of Revenue = (R&D / Revenue) × 100 +``` + +> 📊 *[Embed: chart_revenue_ebitda.png — Revenue & EBITDA Margin (5-Year Trend)]* +> 📊 *[Embed: chart_margins.png — Gross / Operating / Net Margin Trend vs. Industry]* + +### Required Table Format: +| Metric | FY2019 | FY2020 | FY2021 | FY2022 | FY2023 | Trend | +|---|---|---|---|---|---|---| +| Revenue ($M) | | | | | | ↑/↓/→ | +| Revenue Growth % | | | | | | | +| Gross Profit ($M) | | | | | | | +| Gross Margin % | | | | | | | +| EBITDA ($M) | | | | | | | +| EBITDA Margin % | | | | | | | +| Operating Income ($M) | | | | | | | +| Operating Margin % | | | | | | | +| Net Income ($M) | | | | | | | +| Net Margin % | | | | | | | +| Sector Avg Net Margin | | | | | | (benchmark) | + +### Commentary Framework (5 sentences minimum): +1. Revenue trajectory and primary drivers +2. Margin trends and operational efficiency implications +3. Comparison to sector benchmarks — above/below and why +4. Any anomalies, one-time items, or accounting concerns +5. Direct implication for loan repayment capacity + +--- + +## Section 3: Balance Sheet Analysis + +### Required Calculations: +``` +Current Ratio = Current Assets / Current Liabilities +Quick Ratio = (Current Assets - Inventory) / Current Liabilities +Cash Ratio = Cash & Equivalents / Current Liabilities +Debt-to-Equity Ratio = Total Debt / Total Shareholders' Equity +Net Debt = Total Debt - Cash & Equivalents +Net Debt / EBITDA = Net Debt / EBITDA +Interest Coverage = EBIT / Interest Expense +Working Capital = Current Assets - Current Liabilities +Asset Turnover = Revenue / Average Total Assets +Return on Assets (ROA) = Net Income / Average Total Assets +Return on Equity (ROE) = Net Income / Average Shareholders' Equity +``` + +### Required Table Format: +| Metric | FY2021 | FY2022 | FY2023 | Sector Avg | Signal | +|---|---|---|---|---|---| +| Current Ratio | | | | [from sector table] | 🟢/🟡/🔴 | +| Quick Ratio | | | | [from sector table] | 🟢/🟡/🔴 | +| Total Debt ($M) | | | | | | +| Total Equity ($M) | | | | | | +| Debt/Equity | | | | | 🟢/🟡/🔴 | +| Net Debt ($M) | | | | | | +| Net Debt/EBITDA | | | | [from sector table] | 🟢/🟡/🔴 | +| Interest Coverage | | | | [from sector table] | 🟢/🟡/🔴 | +| ROA % | | | | | | +| ROE % | | | | | | + +**Apply sector-specific thresholds from the table above for Signal column.** + +--- + +## Section 4: Cash Flow Analysis + +### Required Calculations: +``` +Free Cash Flow (FCF) = Operating Cash Flow - Capital Expenditures +FCF Margin = FCF / Revenue × 100 +CapEx Intensity = CapEx / Revenue × 100 +Cash Conversion = Operating CF / Net Income (>1 = good quality earnings) +Debt Service Coverage = EBITDA / (Interest + Principal Repayments) +``` + +> 📊 *[Embed: chart_cashflow_waterfall.png — Cash Flow Waterfall (Latest Year)]* + +### Required Table Format: +| Cash Flow Metric ($M) | FY2021 | FY2022 | FY2023 | Trend | +|---|---|---|---|---| +| Operating Cash Flow | | | | | +| CapEx | | | | | +| Free Cash Flow | | | | | +| Investing Activities | | | | | +| Financing Activities | | | | | +| Net Change in Cash | | | | | +| FCF Margin % | | | | | +| Cash & Equivalents (EoP) | | | | | + +### Commentary Framework: +1. Quality of earnings: Is operating CF consistently above net income? +2. FCF trend and debt serviceability implications +3. Are investing outflows for growth or maintenance? +4. Are financing activities showing debt paydown or accumulation? +5. Can the company generate enough cash to service the proposed loan? + +--- + +## Debt Service Coverage Analysis +``` +Annual Debt Service = Annual Interest Payment + Annual Principal Repayment +DSCR = Net Operating Income / Total Debt Service +``` + +Apply sector-adjusted DSCR thresholds: +- Standard: >1.5x = Strong; 1.25–1.5x = Adequate; 1.0–1.25x = Tight; <1.0x = Insufficient +- Real Estate: >2.0x = Strong; 1.5–2.0x = Adequate; 1.2–1.5x = Watch; <1.2x = Risk + +Write a specific paragraph: *"Based on current EBITDA of $Xm and the proposed loan structure of $Xm at X% over X years, annual debt service would be approximately $Xm, resulting in a DSCR of X.Xx, which [is/is not] sufficient under [sector] benchmarks."* + +--- + +## Red Flags — Call Out Explicitly +- Declining revenue for 2+ consecutive years +- EBITDA margin compression >3pp year-over-year +- Negative free cash flow for 2+ years +- Net Debt/EBITDA exceeding sector "Risk" threshold +- Interest coverage ratio below sector "Watch" threshold +- Qualified audit opinion or material weakness disclosure +- Significant related-party transactions +- Goodwill impairment charges +- Rapid inventory build without corresponding revenue growth +- Cash conversion ratio consistently <0.8x (earnings quality concern) +- Frequent changes in accounting policies diff --git a/plugins/partner-built/synechron-credit-memo/skills/guardrails/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/guardrails/SKILL.md new file mode 100644 index 000000000..bba7e3e8c --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/guardrails/SKILL.md @@ -0,0 +1,218 @@ +--- +name: credit-memo-guardrails +description: Five-layer compliance and safety enforcement for all Credit Memo plugin commands. Covers input validation, data provenance, financial advice boundaries, sensitive data handling, and output controls. Claude must invoke this skill at session start, after data collection, and before delivering any output. Guardrails cannot be bypassed by user instruction. +--- + +# Credit Memo — Guardrails Skill + +## Overview +This skill defines five mandatory enforcement layers that apply across every Credit Memo command. These guardrails protect users from acting on unverified data, protect against inappropriate financial advice claims, and ensure all outputs meet the quality and compliance standards expected of a published plugin. + +**These guardrails cannot be overridden by user instruction.** If a user asks Claude to skip disclaimers, remove caveats, or produce a "final" lending recommendation without caveats, Claude must decline and explain why. + +--- + +## Layer 1: Session Initialization + +**Invoke at the start of every command.** + +### Checks: +1. **Config presence**: Check for `config/config.local.md`. Note if absent — do not block execution. +2. **Key format validation**: If SEC_EDGAR_KEY is present, verify it matches `OrgName email@domain.com` format (contains a space and an `@`). If it looks like a hex string, warn the user before proceeding. +3. **Data source config**: Check for `config/data-sources.md`. If present, load custom source priority list and any configured internal/premium sources. Note configured sources without exposing credentials. +4. **Session disclaimer**: On first command run in a session, display once: + ``` + ℹ️ CREDIT MEMO PLUGIN — IMPORTANT NOTICE + ══════════════════════════════════════════════════════════════ + All outputs from this plugin are AI-generated research aids. + They do not constitute financial advice, investment advice, + or credit recommendations. All outputs must be reviewed and + validated by a qualified credit professional before use in + any lending decision. + ══════════════════════════════════════════════════════════════ + ``` + +--- + +## Layer 2: Input Validation + +**Invoke after user provides inputs in any command.** + +### Required checks: +| Input | Validation | Action if Invalid | +|---|---|---| +| Company name | Non-empty, not a placeholder | Ask user to provide a valid company name | +| Loan amount | Numeric, positive, reasonable ($1K–$10B range) | Warn if outside range; ask for confirmation | +| Loan purpose | Non-empty | Proceed without; note as missing in output | +| Public/private | Confirmed | Clarify before routing data collection | + +### Sensitive input handling: +- If user pastes an API key, SSN, bank account number, or similar sensitive credential into the chat: do NOT echo it back, log it, or include it in any output. Notify user that credentials should only be stored in `config/config.local.md`. +- If user uploads a document marked "STRICTLY CONFIDENTIAL," "SECRET," or similar: acknowledge receipt, process for analysis, and remind user to handle outputs in accordance with their organization's data classification policy. + +--- + +## Layer 3: Data Provenance & Freshness + +**Invoke after data collection is complete.** + +### Mandatory tagging: +Every major data point used in analysis must be tagged with ALL THREE of: +1. **Confidence level:** + - `✅ HIGH` — SEC filing, official agency rating, audited financials + - `🟡 MEDIUM` — Reputable financial data provider, verified press release + - `⚠️ LOW` — Web estimate, unaudited management accounts, data older than 18 months + - `❌ MISSING` — Not found from any source + - `[FROM UPLOAD]` — Management-provided; not independently verified +2. **Source name**: e.g., `[Source: SEC 10-K FY2024]`, `[Source: Stock Analysis]`, `[Source: S&P Global]` +3. **Data-as-of date**: e.g., `[As of: Jun 30, 2024]`, `[As of: Apr 2026]` + +Full tag format: `✅ HIGH | Source: SEC 10-K | As of: Jun 30, 2024` + +### Citation index: +Maintain a running citations list throughout data collection. Each unique source gets a citation number `[1]`, `[2]`, etc. These numbers are placed inline next to figures in the output document and resolved in the References appendix. + +``` +Citations index (example): +[1] Stock Analysis (stockanalysis.com) — MSFT Financials — retrieved Apr 7, 2026 +[2] S&P Global Ratings — Microsoft Corp. AAA rating — Apr 2026 +[3] Moody's Investors Service — Microsoft Corp. Aaa rating — Apr 2026 +[4] SEC EDGAR — Microsoft 10-K FY2025 — filed Jul 2025 +[5] Canalys Cloud Infrastructure Q1 2025 — market share data — Apr 2025 +``` + +### Data freshness rules — ENFORCE STRICTLY: +| Data Type | Maximum Age | Action if Stale | +|---|---|---| +| Quarterly financials (latest quarter) | 6 months | ⚠️ STALE DATA warning; fetch updated if possible | +| Annual financials (latest fiscal year) | 18 months | ⚠️ STALE DATA warning; note gap in output | +| Credit ratings | 12 months | ⚠️ Flag as potentially outdated; recommend verification | +| News & events | 30 days minimum coverage required | ⚠️ Warn if no recent news found | +| Industry data | 24 months | ⚠️ Note as potentially outdated | +| Management data | 12 months | ⚠️ Note if bio data appears stale | + +**Freshness summary box** — required in every output: +``` +📅 DATA FRESHNESS SUMMARY +────────────────────────────────────────────────────────────── +Financial statements : FY2025 (year ended Jun 30, 2025) ✅ +Latest quarterly data : Q2 FY2026 (Dec 31, 2025) ✅ +Credit ratings : Apr 2026 ✅ +News coverage : Jan–Apr 2026 ✅ +Industry data : Q1 2025 🟡 (12 months old) +Management profiles : Nov 2025 ✅ +────────────────────────────────────────────────────────────── +All data was retrieved on: [collection date] +⚠️ Always verify data currency before credit decisions. +────────────────────────────────────────────────────────────── +``` + +### Data gap threshold: +- If >30% of key financial metrics are `❌ MISSING` or `⚠️ LOW` confidence: add a prominent warning banner to the analysis output: + ``` + ⚠️ DATA QUALITY ALERT + ───────────────────────────────────────────────────────── + A significant portion of the financial data used in this + analysis is based on estimates or unverified sources. + The reliability of conclusions is materially reduced. + Independent verification is strongly recommended before + any credit decision. + ───────────────────────────────────────────────────────── + ``` + +### No fabrication rule: +Claude must never invent, estimate, or extrapolate financial figures without explicit tagging. If a figure cannot be found, it must be marked `❌ MISSING` — not filled with a plausible-looking number. + +--- + +## Layer 4: Financial Advice Boundaries + +**Invoke explicitly at TWO points in every command:** +- **Before analysis** (after data collection, before running analysis skills) +- **Before output delivery** (after document generation, before presenting files) + +**Apply continuously throughout analysis and output generation.** + +### Permitted: +- Presenting financial data and ratios +- Identifying trends and comparing against benchmarks +- Flagging risk factors and areas of concern +- Presenting stress test scenarios +- Summarizing credit agency ratings and rationale +- Providing a preliminary AI-assisted assessment with caveats + +### Not permitted (even if user requests it): +- Stating definitively that a company "is creditworthy" or "is not creditworthy" +- Issuing a "final" lending recommendation without caveats +- Advising on specific loan pricing, interest rates, or fee structures as a recommendation (present market ranges and benchmarks only, clearly labelled as illustrative) +- Claiming that a lending decision based on this memo would be compliant with any regulatory framework (Basel III, DFAST, CECL, IFRS 9, or similar) +- Removing or watering down the required disclaimer language from outputs +- Producing a memo without a data freshness summary or citation index + +### DSCR sanity check: +If calculated DSCR > 200x: +- Add a note: *"DSCR of [X]x reflects a facility that is immaterially small relative to the borrower's cash generation capacity. The DSCR metric is technically valid but not meaningful as a standalone credit signal at this ratio — focus instead on absolute debt capacity, covenant structure, and rating agency assessments."* +- Do NOT present the extreme DSCR figure as the primary credit signal without this context note. + +### Framing of the assessment box: +The final assessment in all commands must be framed as: +- ✅ `AI-ASSISTED PRELIMINARY ASSESSMENT: SUPPORTIVE` (not "APPROVE") +- 🟡 `AI-ASSISTED PRELIMINARY ASSESSMENT: CONDITIONAL` (not "APPROVE WITH CONDITIONS") +- ❌ `AI-ASSISTED PRELIMINARY ASSESSMENT: CONCERNS IDENTIFIED` (not "DECLINE") + +And must always be followed by the disclaimer block (see Layer 5). + +--- + +## Layer 5: Output Controls + +**Invoke before delivering any file or final response.** + +### Required disclaimer block: +Every command output and every generated document (Word, PDF, PowerPoint) must include the following disclaimer. In documents, place it on the cover page and in the footer: + +``` +⚠️ AI-GENERATED RESEARCH AID — NOT FINANCIAL ADVICE +══════════════════════════════════════════════════════════════ +This Credit Memorandum is generated by an AI assistant and +is intended solely as a research and analytical aid for +qualified credit professionals. It does NOT constitute +financial advice, investment advice, or a credit +recommendation of any kind. + +All outputs must be independently reviewed and validated by +a qualified credit professional before use in any lending, +investment, or credit decision. The plugin author, Anthropic, +and affiliated parties accept no liability for decisions +made based on this document. + +Data sources, confidence levels, and data gaps are documented +throughout this memorandum. Where data is estimated or +management-provided, this is explicitly noted. +══════════════════════════════════════════════════════════════ +``` + +### Document watermarks and markings: +- All Word and PDF documents: include `CONFIDENTIAL — FOR INTERNAL USE ONLY` in the document header +- PDF documents: apply diagonal `CONFIDENTIAL` watermark +- PowerPoint decks: include disclaimer on the title slide and final slide + +### Placeholder chart flagging: +When any chart was generated with a "Data Not Available" placeholder (because data was missing), the document must include a note in the relevant section: +``` +📊 [Chart name] — Data not available for this analysis. + See data gap log in Appendix for details. +``` + +### Final output checklist (verify before presenting files): +- [ ] Disclaimer block present in all outputs (cover page + final page + footer) +- [ ] All data points tagged with confidence level + source name + data-as-of date +- [ ] No fabricated or untagged financial figures +- [ ] Assessment framed as preliminary, not final +- [ ] CONFIDENTIAL marking in all document headers and PDF watermark +- [ ] File naming follows convention: `Credit_Memo_[Company]_[Date].*` +- [ ] Data gap log included in Appendix if any `❌ MISSING` items exist +- [ ] Citations index included (numbered footnotes in document body, resolved in References appendix) +- [ ] Data freshness summary box included in Executive Summary section +- [ ] DSCR context note added if DSCR > 200x +- [ ] Collection timestamp recorded: "Data retrieved on [date]" appears in document header or Section 8 diff --git a/plugins/partner-built/synechron-credit-memo/skills/industry-analysis/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/industry-analysis/SKILL.md new file mode 100644 index 000000000..0caa8a620 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/industry-analysis/SKILL.md @@ -0,0 +1,176 @@ +--- +name: credit-memo-industry-analysis +description: Conducts deep industry analysis for credit assessment, including market size, CAGR, competitive landscape, SWOT analysis, named company's market share and position, consumer trends, regulatory environment, and seasonal patterns. Claude draws on this skill when analyzing the industry context of a borrower for any Credit Memo or loan evaluation. +--- + +# Credit Memo — Industry Analysis Skill + +## Overview +Industry analysis contextualizes the borrower's performance within their competitive environment. A company growing at 5% in a 15% growth industry is losing market share. A company with declining revenue in a contracting industry may still be creditworthy. Context is everything. + +--- + +## Section 1: Industry Overview + +### Questions to Answer: +- What does this industry do and what is its scope? +- What is the estimated size of the sector? +- Have sales been increasing or decreasing recently? +- What is the CAGR and YoY growth rate? + +### Required Data Points: +- Industry/sector name and SIC/NAICS classification +- Global market size (USD billions, current year) +- Domestic (relevant geography) market size +- Market size forecast (5-year) +- CAGR (3-year historical; 5-year projected) +- Current YoY growth rate +- Key value chain participants (upstream, midstream, downstream) +- Industry lifecycle stage: Emerging / Growth / Mature / Declining + +### Market Size Summary Table: + +> 📊 *[Embed: chart_industry.png — Industry Market Size & Growth Trend]* + +| Metric | Value | Source | Confidence | +|---|---|---|---| +| Global Market Size (current year) | $X.Xbn | [Source] | ✅/🟡/⚠️ | +| Domestic Market Size (current year) | $X.Xbn | [Source] | ✅/🟡/⚠️ | +| Market Size Forecast (5-year) | $X.Xbn | [Source] | 🟡 | +| Historical CAGR (3-year) | X.X% | [Source] | ✅/🟡 | +| Projected CAGR (5-year) | X.X% | [Source] | 🟡 | +| YoY Growth (latest year) | X.X% | [Source] | ✅/🟡 | +| Industry Stage | Mature/Growth/etc. | — | — | + +### Industry Narrative (3–4 paragraphs): +1. What the industry does — scope, definition, major sub-segments +2. Key demand drivers — what causes this industry to grow or contract +3. Key supply-side dynamics — production economics, input costs, barriers +4. Current phase of the economic cycle and near-term trajectory + +--- + +## Section 2: Competitive Landscape + +### Questions to Answer: +- Who are the industry leaders and key competitors? +- What is the company's market position and competitive advantage? +- What are the key products, services, and differentiators? + +### Top Competitors Table: +| Rank | Company | Market Share | Revenue (LTM) | Key Strength | +|---|---|---|---|---| +| 1 | [Leader] | X.X% | $Xbn | [e.g., Scale, IP, distribution] | +| 2 | [Competitor] | X.X% | $Xbn | | +| 3 | **[Named Company]** | **X.X%** | **$Xbn** | | +| 4 | | | | | +| 5 | | | | | + +### Competitive Positioning: +- Market rank of named company (1st, 3rd, etc.) +- Market share trend (growing / stable / declining over 3 years) +- Key competitive advantages (pricing power, IP, brand, distribution, cost structure) +- Key competitive disadvantages or vulnerabilities +- Barriers to entry (High / Medium / Low — with explanation) +- Market concentration: HHI score or top-3 concentration ratio + +### Competitive Dynamics Commentary (2–3 paragraphs): +1. How concentrated is the market? Is competition intensifying or stabilizing? +2. What is the company's defensible competitive moat and how durable is it? +3. Threat assessment from new entrants, substitutes, and adjacent competitors + +--- + +## Section 3: Market Trends & Drivers + +### Questions to Answer: +- Are there seasonal fluctuations in sales? +- What demographic and consumer behavioral trends are reshaping the industry? +- How do macro changes affect sector performance? + +### Key Trends to Analyze: +1. **Technology disruption:** Is the industry being reshaped by AI, automation, or platform models? +2. **Consumer behavior shifts:** Changing preferences, digitization, sustainability demands +3. **Regulatory environment:** New regulations, upcoming compliance requirements, tariffs, trade policy +4. **Demographic trends:** Aging population, urbanization, Gen Z and millennial spending +5. **Globalization/localization:** Supply chain restructuring, nearshoring trends +6. **Sustainability/ESG:** Green transition impact on industry economics, emissions obligations + +### Seasonality Assessment: +- Is revenue highly seasonal? If yes, which quarters are peak vs. trough? +- Does seasonality create cash flow timing mismatches that affect loan repayment at critical periods? +- How has the company historically managed seasonal working capital needs? + +### Trend Impact Matrix: +| Trend | Direction | Impact on Industry | Impact on Named Company | Timeline | +|---|---|---|---|---| +| [Trend 1] | ↑ Positive | Moderate tailwind | Strong tailwind | 2–3 years | +| [Trend 2] | ↓ Negative | Structural headwind | Limited exposure | 1–2 years | +| [Trend 3] | → Neutral | Mixed | Watch | Ongoing | + +--- + +## Section 4: SWOT Analysis + +**This is an industry-level SWOT** — structural advantages and risks of the sector, not the specific company. Company-specific SWOT belongs in the management and risk assessment sections. + +> 📊 *[Embed: chart_swot.png — Industry SWOT Matrix]* + +### Industry SWOT: + +**STRENGTHS** (structural advantages) +- [e.g., High barriers to entry protect incumbent margins] +- [e.g., Recurring revenue model creates cash flow predictability] +- [e.g., Government support / subsidies for strategic sectors] +- [e.g., Strong global demand driven by emerging market growth] + +**WEAKNESSES** (structural vulnerabilities) +- [e.g., Capital-intensive nature limits flexibility in downturns] +- [e.g., High labor dependency creates wage inflation risk] +- [e.g., Commodity input costs expose margins to volatility] +- [e.g., Long sales cycles create revenue unpredictability] + +**OPPORTUNITIES** (external growth drivers) +- [e.g., Expanding middle class in Asia-Pacific driving demand] +- [e.g., Technology adoption opening new revenue streams] +- [e.g., Regulatory changes creating new market categories] +- [e.g., Post-restructuring recovery in specific sub-segments] + +**THREATS** (external risks) +- [e.g., Disruptive new entrants with lower-cost models] +- [e.g., Tightening regulation increasing compliance costs] +- [e.g., Trade policy uncertainty affecting supply chains] +- [e.g., Macroeconomic slowdown compressing discretionary spending] + +### SWOT Synthesis (1–2 paragraphs): +*"Overall, the [industry] presents a [favorable/mixed/challenging] operating environment for credit purposes. [Top 2 strengths] provide structural tailwinds for established players like [Company]. However, [top threat/weakness] represents the key risk that lenders should monitor over the loan tenor. For [Company] specifically, [how their position interacts with these industry dynamics and what it means for repayment risk]."* + +--- + +## Section 5: Regulatory & Macro Environment + +### Key Regulatory Considerations: +- Top 3–5 regulations materially impacting this industry today +- Upcoming regulatory changes (new laws, tightening standards, enforcement priorities) +- Industry's historical relationship with regulators (generally compliant vs. contentious) +- ESG/climate compliance obligations and timeline +- Any pending legislation that could materially change industry economics + +### Macroeconomic Sensitivity: +| Economic Scenario | Industry Revenue Impact | Named Company Impact | Basis for Estimate | +|---|---|---|---| +| GDP +3% (Strong Growth) | +X% | +X% | Historical beta | +| GDP 0–1% (Slow Growth) | +X% | +X% | Management guidance | +| GDP -2% (Recession) | -X% | -X% | 2008/2020 precedent | +| High Inflation (+5%) | -X% margin | -X% margin | Cost pass-through rate | +| Rising Rates (+200bps) | Neutral/Neg | [Specific impact] | Float exposure | + +--- + +## Section 6: Industry Credit Implications + +Conclude with a direct assessment for the credit decision: +1. **Industry credit favorability:** Is this a credit-favorable industry? (Low cyclicality, high revenue visibility, and high barriers to entry = more favorable) +2. **Repayment risk from industry:** What industry-level risks could impair the borrower's ability to repay over the loan tenor? +3. **Relative performance:** Is the company growing faster or slower than its industry? (Outperformance = positive signal; persistent underperformance = risk flag) +4. **Recommended industry covenants:** Any industry-wide risks that should be embedded as loan triggers? (e.g., commodity price floors, regulatory compliance certifications, occupancy minimums for real estate) diff --git a/plugins/partner-built/synechron-credit-memo/skills/management-assessment/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/management-assessment/SKILL.md new file mode 100644 index 000000000..47ffd803b --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/management-assessment/SKILL.md @@ -0,0 +1,178 @@ +--- +name: credit-memo-management-assessment +description: Assesses the quality, experience, governance, and strategic execution of a borrower's management team and board of directors for credit purposes. Covers executive biographies, tenure, track record, governance structure, board composition, strategic initiatives, and risk management approach. Claude uses this skill automatically when evaluating management quality in Credit Memo generation. +--- + +# Credit Memo — Management Assessment Skill + +## Overview +Management quality is a qualitative credit factor — but one of the most important. Poor management has destroyed sound businesses. Strong management has navigated companies through crises. The credit analyst's job is to form an informed view on whether this team can execute through the loan period. + +--- + +## Data Collection Requirements +Gather from the following sources before running analysis: +- Company website (About/Leadership/Governance pages) +- SEC DEF 14A (Proxy Statement) — most detailed source of executive bios and compensation +- SEC 10-K (Part I — Business; Part III — Directors and Executive Officers) +- LinkedIn profiles of C-suite executives +- News search: `"{Executive name}" "{Company}" track record achievement` +- Glassdoor ratings (culture/management signals) +- Board composition databases + +--- + +## Section 1: Key Management Profiles + +### Questions to Answer: +- Who are the key management personnel and what is their background? +- What is the track record of the team at this company and previously? +- How long have key executives been in their roles? +- Have there been recent leadership changes and what was the impact? + +> 📊 *[Embed: chart_mgmt_tenure.png — C-Suite Tenure Timeline]* + +### Executive Summary Table: +| Role | Name | Tenure at Company | Total Industry Experience | Prior Company / Role | +|---|---|---|---|---| +| CEO | [Name] | X years | X years | [Previous role] | +| CFO | [Name] | X years | X years | [Previous role] | +| COO | [Name] | X years | X years | [Previous role] | +| CTO/CIO | [Name] | X years | X years | [Previous role] | + +### Detailed Profiles (CEO and CFO — required; others if material): + +**[Name] — [Title]** +- **Tenure:** X years (joined [year]) +- **Education:** [Degree, Institution] +- **Prior Experience:** [Previous 2–3 roles in reverse chronological order] +- **Track Record at Company:** [Key achievements — revenue milestones, turnarounds, acquisitions completed, strategic pivots executed] +- **Industry Standing:** [Awards, board memberships, public recognition] +- **Adverse Findings:** [Any litigation, forced departures elsewhere, regulatory actions — note "None found" if clean] + +### Leadership Stability Assessment: +| Indicator | Value | Signal | +|---|---|---| +| Average C-suite tenure | X years | >5y = Stable 🟢 / 2–5y = Watch 🟡 / <2y = Risk 🔴 | +| C-suite changes in last 24 months | X | 0–1 = Normal / 2–3 = Watch / >3 = Elevated | +| CEO/CFO both present >2 years | Yes/No | Both stable = 🟢 | +| Planned succession in place | Yes/No | Yes = 🟢 | +| Leadership vacuum in critical role | Yes/No | Yes = 🔴 | + +--- + +## Section 2: Board of Directors Analysis + +### Questions to Answer: +- What is the governance and organizational structure? +- How independent and qualified is the board? +- Does the governance structure protect creditors' interests? + +### Board Composition Table: +| Director | Independent? | Committee | Primary Expertise | Tenure | +|---|---|---|---|---| +| [Name] — Chair | Yes/No | Audit, Comp | Finance | X yrs | +| [Name] | Yes/No | Risk | Industry | X yrs | +| [Name] (CEO) | No | — | Operations | X yrs | + +### Governance Quality Scorecard: +Score each dimension (1–5, where 5 = best practice): +| Governance Dimension | Score | Observation | +|---|---|---| +| Board independence (>50% independent = best practice) | /5 | X% independent | +| Audit committee — all members financially literate | /5 | [Big 4 auditor / clean opinion] | +| Separate risk committee | /5 | [Present / Absent] | +| Executive compensation aligned with long-term performance | /5 | [LTI plan / vesting structure] | +| Shareholder rights (no classified board / dual-class shares) | /5 | [Notes] | +| ESG/sustainability oversight | /5 | [Dedicated committee / None] | +| Frequency of board meetings | /5 | [Quarterly or more = best] | +| **Overall Governance Score** | **/5** | | + +### Governance Red Flags — Check Explicitly: +- [ ] Audit committee members without financial expertise +- [ ] CEO also serving as Board Chairman (concentration of power) +- [ ] Multiple undisclosed or inadequately disclosed related-party transactions +- [ ] Frequent auditor changes (>1 change in 5 years without explanation) +- [ ] Material weaknesses in internal controls disclosed in 10-K +- [ ] Dominant founding family with voting control but poor performance track record +- [ ] Lack of independent directors on audit or compensation committee + +--- + +## Section 3: Strategic Execution Assessment + +### Questions to Answer: +- What are the firm's stated strategic priorities? +- How well has management executed against past targets? +- What is the track record on financial guidance accuracy? + +### Top Strategic Priorities (from CEO letters, investor presentations, 10-K): +1. [Strategic Priority 1] +2. [Strategic Priority 2] +3. [Strategic Priority 3] + +### Guidance vs. Actual Performance (last 3 years): +| Year | Revenue Guidance | Actual Revenue | Variance | EBITDA Guidance | Actual EBITDA | Variance | +|---|---|---|---|---|---|---| +| FY2021 | $Xm | $Xm | +/- X% | $Xm | $Xm | +/- X% | +| FY2022 | $Xm | $Xm | +/- X% | $Xm | $Xm | +/- X% | +| FY2023 | $Xm | $Xm | +/- X% | $Xm | $Xm | +/- X% | + +**Assessment:** *"Management has [consistently/mostly/rarely] met its financial guidance over the past three years. [Interpret what this means for the credibility of projections underpinning the repayment analysis.]*" + +--- + +## Section 4: Financial Reporting Quality + +### Reporting Quality Checklist: +| Factor | Status | Credit Risk | +|---|---|---| +| Big 4 / reputable auditor | Yes/No | Low/Medium | +| Clean audit opinion (last 3 years) | Yes/No | Low/High | +| Material weaknesses disclosed | None/Present | Low/High | +| Financial restatements (past 5 years) | None/X | Low/High | +| Related party transactions — adequate disclosure | Yes/No | Low/Medium | +| Segment reporting granularity | Detailed/Limited | Low/Medium | +| ESG/sustainability reporting published | Yes/No | — | +| On-time SEC filing history | Consistent/Late | Low/High | + +--- + +## Section 5: Risk Management Culture + +### Assessment Points: +- Does the company have a formal Enterprise Risk Management (ERM) framework? +- Is there a dedicated Chief Risk Officer (CRO) or equivalent role? +- How frequently does the board formally review risk? +- Has management's response to past risks (operational, financial, reputational) been effective? Reference specific examples. +- Is there a documented Business Continuity Plan (BCP)? +- How has management addressed technology/cybersecurity risk? + +--- + +## Section 6: Management Assessment Summary + +### Management Quality Score: +| Dimension | Score (1–5) | Rationale | +|---|---|---| +| Leadership experience & depth | /5 | | +| Leadership stability & succession planning | /5 | | +| Strategic execution track record | /5 | | +| Corporate governance quality | /5 | | +| Financial reporting quality & transparency | /5 | | +| Risk management maturity | /5 | | +| **Overall Management Score** | **/5** | | + +**Score interpretation:** +- 4.0–5.0: Strong management — positive credit factor +- 2.5–3.9: Adequate management — neutral credit factor +- 1.0–2.4: Weak management — negative credit factor; consider as a risk condition in loan structure + +### Management Credit Opinion (2 paragraphs): +**Paragraph 1:** Overall quality of management and governance — what stands out positively and negatively, and why. + +**Paragraph 2:** Whether management quality strengthens or weakens the overall credit case, and any management-related conditions recommended for the loan structure. Examples: +- *"Key person life insurance on CEO and CFO recommended given their central role in the business."* +- *"Requirement to maintain a CFO with minimum X years of relevant industry experience."* +- *"Quarterly financial reporting covenant recommended given recent leadership transition."* +- *"No material change in senior management without lender notification within 5 business days."* diff --git a/plugins/partner-built/synechron-credit-memo/skills/repayment-analysis/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/repayment-analysis/SKILL.md new file mode 100644 index 000000000..1af6cabe6 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/repayment-analysis/SKILL.md @@ -0,0 +1,157 @@ +--- +name: credit-memo-repayment-analysis +description: Analyzes a borrower's capacity to repay a proposed loan. Covers cash conversion cycle, working capital analysis, Days Sales Outstanding (DSO), Days Payable Outstanding (DPO), debt-to-income ratio, existing debt obligations, macroeconomic factors, and detailed repayment schedule modeling. Claude uses this skill automatically when assessing loan repayment viability. +--- + +# Credit Memo — Repayment Analysis Skill + +## Overview +The central question of repayment analysis is: **Can this borrower comfortably service the proposed debt from operating cash flows, even under stress conditions?** Every calculation must be tied back to this question. + +--- + +## Guiding Principle +Present both a base case and stress case repayment analysis. Lenders need to know not just whether repayment works under normal conditions, but whether the borrower can survive a 20–30% revenue decline or margin compression. + +--- + +## Section 1: Working Capital & Cash Cycle Analysis + +### Required Calculations: +``` +DSO (Days Sales Outstanding) = (Accounts Receivable / Revenue) × 365 +DIO (Days Inventory Outstanding) = (Inventory / COGS) × 365 +DPO (Days Payable Outstanding) = (Accounts Payable / COGS) × 365 +CCC (Cash Conversion Cycle) = DSO + DIO - DPO +Working Capital = Current Assets - Current Liabilities +Working Capital as % Revenue = Working Capital / Revenue × 100 +``` + +### Required Table: +| Working Capital Metric | FY2021 | FY2022 | FY2023 | Industry Avg | Trend | +|---|---|---|---|---|---| +| Accounts Receivable ($M) | | | | | | +| DSO (days) | | | | ~30–45 days | ↑/↓/→ | +| Inventory ($M) | | | | | | +| DIO (days) | | | | | | +| Accounts Payable ($M) | | | | | | +| DPO (days) | | | | ~30–45 days | | +| Cash Conversion Cycle (days) | | | | | | +| Working Capital ($M) | | | | | | + +### Interpretation Framework: +- **Short CCC (< 30 days):** Company converts sales to cash quickly — positive for repayment +- **Long CCC (> 60 days):** Cash is tied up in operations — monitor for liquidity strain at loan drawdown +- **Rising DSO:** Customers paying slower — potential collection issues or revenue quality concern +- **Rising DIO:** Inventory building up — potential demand softness +- **Falling DPO:** Paying suppliers faster — may pressure near-term cash + +Write a paragraph interpreting the CCC trend and what it implies for the borrower's liquidity cycle relative to loan repayment timing. + +--- + +## Section 2: Income & Cash Flow Repayment Capacity + +### Key Metrics: +``` +LTM Revenue = Last Twelve Months Revenue +LTM EBITDA = Last Twelve Months EBITDA +LTM Free Cash Flow = LTM Operating CF - LTM CapEx +LTM Interest Expense = Interest paid in last 12 months +Existing Annual Debt Service = Existing annual interest + principal repayments + +Proposed Annual Payment = [Calculated from loan amount, rate, tenor] +Total Debt Service (post-loan) = Existing service + Proposed payment + +DSCR (existing) = EBITDA / Existing Debt Service +DSCR (post-loan) = EBITDA / Total Debt Service (post-loan) +Fixed Charge Coverage = (EBITDA - CapEx) / (Interest + Lease + Principal) +``` + +### Repayment Capacity Table: +| Repayment Metric | Value | Threshold | Assessment | +|---|---|---|---| +| LTM EBITDA | $Xm | — | — | +| LTM Free Cash Flow | $Xm | — | — | +| Existing Annual Debt Service | $Xm | — | — | +| DSCR (pre-proposed loan) | X.Xx | >1.5x | ✅/🟡/❌ | +| Proposed Annual Loan Payment | $Xm | — | — | +| DSCR (post-proposed loan) | X.Xx | >1.25x | ✅/🟡/❌ | +| Fixed Charge Coverage | X.Xx | >1.2x | ✅/🟡/❌ | +| Loan / EBITDA Multiple | X.Xx | <3.0x | ✅/🟡/❌ | + +### Loan Amortization Schedule (Base Case): +| Year | Opening Balance | Interest | Principal | Closing Balance | Annual Payment | +|---|---|---|---|---|---| +| Year 1 | $Xm | $Xm | $Xm | $Xm | $Xm | +| Year 2 | | | | | | +| Year 3 | | | | | | +| [etc.] | | | | | | +| **Total** | — | **$Xm** | **$Xm** | — | **$Xm** | + +--- + +## Section 3: Debt & Credit Profile + +### Required Calculations: +``` +Debt-to-Income Ratio = Total Annual Debt Service / Gross Annual Income +Total Debt / Revenue = Total Debt / LTM Revenue +Net Debt / EBITDA = Net Debt / LTM EBITDA +Interest Coverage Ratio = EBIT / Interest Expense +``` + +### Existing Debt Summary: +| Facility | Outstanding | Maturity | Annual Service | Rate | Priority | +|---|---|---|---|---|---| +| Facility A | $Xm | YYYY | $Xm | X.X% | Senior Secured | +| Facility B | $Xm | YYYY | $Xm | X.X% | Unsecured | +| **Total Existing** | **$Xm** | — | **$Xm** | — | — | +| **Proposed Loan** | **$Xm** | **YYYY** | **$Xm** | **X.X%** | **TBD** | +| **Pro-forma Total** | **$Xm** | — | **$Xm** | — | — | + +--- + +## Section 4: Macro & Market Sensitivity + +### Macro Factors to Assess: +1. **Interest Rate Environment:** Is proposed loan fixed or floating? If floating, stress test +200bps +2. **Inflation Impact:** What % of costs are inflation-sensitive? How does margin compress? +3. **Currency Risk:** If company has foreign revenue/costs, assess FX exposure +4. **Economic Cycle Sensitivity:** How cyclical is the company's revenue? +5. **Sector Tailwinds/Headwinds:** Current sector health and near-term outlook + +### Stress Test Analysis: + +> 📊 *[Embed: chart_dscr_stress.png — DSCR Stress Test: Base / Downside / Severe]* + +| Scenario | Revenue Assumption | EBITDA Margin | Annual Debt Service | DSCR | Verdict | +|---|---|---|---|---|---| +| **Base Case** | LTM flat to +5% | Current margin | $Xm | X.Xx | ✅ Serviceable | +| **Downside Case** | -15% decline | -2pp margin compression | $Xm | X.Xx | 🟡 Tight | +| **Severe Stress** | -30% decline | -5pp margin compression | $Xm | X.Xx | ❌ Breach | + +Write a specific narrative paragraph: *"Under the base case, the proposed loan can comfortably be serviced with a DSCR of X.Xx. However, if revenue were to decline by 30% (consistent with [2008 GFC / COVID-2020 / relevant benchmark]), DSCR would fall to X.Xx, below the 1.0x threshold. [Mitigants: cash buffer on balance sheet / covenant trigger mechanism / management response plan]."* + +--- + +## Section 5: Repayment Risk Summary + +### Final Repayment Opinion: +State clearly: +1. Whether current cash flows are sufficient to service proposed debt +2. The cushion margin (how far DSCR is above/below threshold) +3. Key conditions that could threaten repayment +4. Recommended structural protections + +### Recommended Loan Covenants: +| Covenant | Threshold | Rationale | +|---|---|---| +| Minimum DSCR | >1.25x (test quarterly) | Ensures adequate repayment buffer | +| Maximum Net Debt/EBITDA | <3.5x | Limits re-leveraging post-close | +| Minimum Cash Balance | $Xm | Protects against short-term liquidity stress | +| Dividend Restriction | If DSCR <1.5x | Protects cash for debt service priority | +| Annual Financial Reporting | Within 120 days of FYE | Lender monitoring | +| Quarterly Management Accounts | Within 45 days of quarter end | Early warning | +| Material Event Notification | Within 5 business days | Covenant breach, M&A, litigation, leadership change | +| CapEx Cap | $Xm per year without lender consent | Prevents unplanned cash drain | diff --git a/plugins/partner-built/synechron-credit-memo/skills/risk-assessment/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/risk-assessment/SKILL.md new file mode 100644 index 000000000..1ec3b6798 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/risk-assessment/SKILL.md @@ -0,0 +1,204 @@ +--- +name: credit-memo-risk-assessment +description: Performs comprehensive risk assessment for credit decisions. Covers external credit ratings (Moody's, S&P, Fitch), internal rating ingestion, liquidity risk, leverage, legal/litigation, operational risks, default history, and collateral. Reads internal rating from config.local.md or prompts user for it. Claude draws on this skill automatically during Credit Memo generation. +--- + +# Risk Assessment Skill + +## Overview +Risk assessment synthesizes all quantitative and qualitative signals into a structured credit risk view. The goal is not to list risks — it is to assess their materiality, probability, and combined impact on the borrower's ability to repay. + +--- + +## Internal Rating Ingestion + +### Reading Internal Rating +At the start of risk assessment, check for an internal rating via three sources (in priority order): + +**Source 1 — User provided during intake:** +If the user entered an internal rating in Step 2 of the generate command, use that directly. + +**Source 2 — config.local.md:** +Check for `INTERNAL_RATING_SCALE` in config. If present, ask user: +``` +Your organization has an internal rating scale configured: [SCALE] +Does this borrower have an internal rating? If yes, please provide: + - Internal rating: [e.g., 4 / BBB / Category B] + - Rated by: [e.g., Credit Risk Team] + - Rating date: [e.g., Q3 2024] + - Key rationale: [optional] +``` + +**Source 3 — Uploaded document:** +If user uploaded a credit assessment document, extract internal rating from it and tag: `[FROM UPLOAD]`. + +**If no internal rating available:** +Note: *"Internal rating not provided. External agency ratings used as primary reference."* + +### Internal Rating Display +When internal rating is available, show it prominently alongside external ratings: + +| Agency | Rating | Scale | Outlook | Date | +|---|---|---|---|---| +| **Internal** | **[Rating]** | **[Your Scale]** | **[Outlook]** | **[Date]** | +| Moody's | Baa2 | Aaa–C | Stable | Dec 2023 | +| S&P Global | BBB | AAA–D | Stable | Nov 2023 | +| Fitch | BBB- | AAA–D | Negative Watch | Oct 2023 | + +**Convergence/Divergence Commentary:** +Write a specific paragraph if internal and external ratings diverge by more than one notch: +*"The internal rating of [X] [is broadly consistent with / is more conservative than / is more optimistic than] the external agency consensus of [Y]. [Explain the divergence and which view is more credible based on available data]."* + +--- + +## Section 1: External Credit Ratings Analysis + +### Data Collection (uses SERPAPI_KEY if configured): +``` +Search queries: +"{company}" Moody's credit rating outlook 2024 +"{company}" S&P Global issuer rating 2024 +"{company}" Fitch rating action downgrade upgrade +"{company}" credit rating history upgrade downgrade timeline +``` + +### Rating Comparison Table: +Include full rating scale reference with company position marked: + +**Investment Grade:** +``` +Moody's: Aaa | Aa1 Aa2 Aa3 | A1 A2 A3 | [Baa1 Baa2★ Baa3] +S&P: AAA | AA+ AA AA- | A+ A A- | [BBB+ BBB★ BBB-] + ←─── STRONGER ──────────────── WEAKER ───► +``` + +**Speculative Grade (flag prominently if borrower is here):** +``` +⚠️ Moody's: Ba1 Ba2 Ba3 | B1 B2 B3 | Caa1 Caa2 Caa3 | Ca | C +⚠️ S&P: BB+ BB BB- | B+ B B- | CCC+ CCC CCC- | CC | C | D +``` + +### Rating Commentary: +Write 3 paragraphs: +1. Current rating summary and what it implies for credit risk +2. Rating trajectory (improving, stable, deteriorating) and primary drivers +3. Rating triggers — specific events that would cause an upgrade or downgrade + +--- + +## Section 2: Liquidity Risk Analysis + +### Key Liquidity Metrics: +| Metric | Value | Industry Avg | Threshold | Signal | +|---|---|---|---|---| +| Current Ratio | X.Xx | ~2.0x | >1.0x | 🟢/🟡/🔴 | +| Quick Ratio | X.Xx | ~1.0x | >0.5x | 🟢/🟡/🔴 | +| Cash Ratio | X.Xx | ~0.5x | >0.2x | 🟢/🟡/🔴 | +| Operating CF / Current Liab | X.Xx | — | >0.4x | 🟢/🟡/🔴 | +| Days Cash on Hand | XX days | — | >30 days | 🟢/🟡/🔴 | + +> 📊 *[Embed: chart_ratios_dashboard.png — Key Financial Ratios Dashboard]* + +Write an interpretation paragraph referencing the visual: +*"As illustrated in the ratio dashboard above, [Company] shows [strong/adequate/concerning] liquidity. [Specific observation about current ratio trend and what it means for near-term debt service]. [Any mitigants or aggravators]."* + +--- + +## Section 3: Leverage & Debt Risk + +### Leverage Metrics: +| Metric | Value | Threshold | Signal | Trend | +|---|---|---|---|---| +| Total Debt ($M) | | — | — | ↑/↓/→ | +| Net Debt ($M) | | — | — | ↑/↓/→ | +| Debt / Equity | X.Xx | <2.0x | 🟢/🟡/🔴 | ↑/↓/→ | +| Net Debt / EBITDA | X.Xx | <3.5x | 🟢/🟡/🔴 | ↑/↓/→ | +| Interest Coverage | X.Xx | >3.0x | 🟢/🟡/🔴 | ↑/↓/→ | +| Debt / Revenue | X.Xx | <1.0x | 🟢/🟡/🔴 | ↑/↓/→ | + +> 📊 *[Embed: chart_balance_sheet.png — Balance Sheet Composition (3-Year)]* + +Write a paragraph on debt structure: senior vs. subordinated, fixed vs. floating, maturity profile, covenant status, and whether the proposed loan increases leverage to concerning levels. + +--- + +## Section 4: Legal & Litigation Risk + +### Data Collection: +Use SerpApi with key for enhanced news search: +``` +Google News endpoint: engine=google_news&q="{company}"+lawsuit+litigation&tbs=qdr:y2 +Additional searches: + "{company}" SEC investigation enforcement action + "{company}" regulatory fine penalty + "{company}" class action lawsuit settlement +``` + +### Litigation Summary Table: +| Case | Nature | Status | Potential Exposure | Materiality | +|---|---|---|---|---| +| [Case name] | [e.g., Employment class action] | Pending | $Xm | 🟢/🟡/🔴 | +| [Case name] | [e.g., IP dispute] | Settled | $Xm | 🟢 Resolved | + +Write a paragraph assessing whether litigation exposure is material relative to the company's EBITDA and cash position, and whether any cases represent existential risk. + +--- + +## Section 5: Operational Risk + +Assess the following operational risk factors: +1. **Customer concentration**: Does any single customer represent >10% of revenue? +2. **Supplier concentration**: Is the company dependent on a small number of suppliers? +3. **Geographic concentration**: Is revenue concentrated in high-risk geographies? +4. **Technology/cyber risk**: Has the company experienced breaches? Are systems modern? +5. **ESG/sustainability risk**: Are there environmental liabilities or regulatory exposure? +6. **Business continuity**: Does the company have documented BCM/BCP plans? + +--- + +## Section 6: Default History + +Search for: +- Prior defaults or near-defaults in the last 10 years +- Debt restructurings, covenant waivers, or forbearance agreements +- Credit watch or rating withdrawal history +- Any payment delays disclosed in filings + +Note: Even a historical default that was resolved may indicate risk culture issues. Comment on the circumstances and whether they are likely to recur. + +--- + +## Section 7: Collateral Analysis + +If collateral has been offered: +| Collateral Item | Type | Estimated Value | Liquidity | LTV Ratio | +|---|---|---|---|---| +| [e.g., Property] | Real estate | $Xm | Low | X.X% | +| [e.g., Receivables] | Financial | $Xm | High | X.X% | +| [e.g., Inventory] | Physical | $Xm | Medium | X.X% | + +Assess: Is the collateral sufficient to cover the loan in a default scenario? What is the recovery rate assumption by collateral type? + +--- + +## Section 8: Overall Risk Summary + +### Risk Heat Map +| Risk Dimension | Level | Trend | Key Driver | +|---|---|---|---| +| Credit Rating | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Liquidity | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Leverage | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Legal / Litigation | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Operational | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Default History | 🟢/🟡/🔴 | ↑/↓/→ | [1 line] | +| Collateral Coverage | 🟢/🟡/🔴 | — | [1 line] | +| **Overall Risk** | **🟢/🟡/🔴** | — | — | + +> 📊 *[Embed: chart_credit_ratings.png — Credit Rating Scale Visual]* + +### Risk Narrative: +Write a 3–paragraph synthesis: +1. Dominant risk factors and their combined effect +2. Key mitigants and why they do or do not offset the risks +3. Risk conditions recommended for the loan structure (covenants, reporting, triggers) diff --git a/plugins/partner-built/synechron-credit-memo/skills/visuals/SKILL.md b/plugins/partner-built/synechron-credit-memo/skills/visuals/SKILL.md new file mode 100644 index 000000000..119b75c54 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/skills/visuals/SKILL.md @@ -0,0 +1,424 @@ +--- +name: credit-memo-visuals +description: Generates all charts, graphs, infographics, and visual assets for the Credit Memo. Creates Python matplotlib/plotly charts as PNG images that get embedded into Word, PDF, and PowerPoint outputs. Claude draws on this skill automatically when financial data has been collected and analysis is ready to be visualized. +--- + +# Credit Memo — Visuals Skill + +## Overview +Numbers without visuals don't communicate well in credit presentations. This skill defines every chart to generate, the data it needs, the chart type, and exact styling. All charts are produced as high-resolution PNG files, then embedded into Word/PDF/PPT outputs by the document-generation skill. + +--- + +## Chart Generation Setup + +```bash +pip install matplotlib plotly kaleido pandas numpy --break-system-packages +``` + +### Standard Chart Template: +```python +import matplotlib.pyplot as plt +import matplotlib.patches as mpatches +import numpy as np + +# Brand colors +NAVY = '#1F3864' +BLUE = '#2E75B6' +GOLD = '#C9A84C' +GREEN = '#70AD47' +AMBER = '#ED7D31' +RED = '#C00000' +LGRAY = '#F2F2F2' +DGRAY = '#404040' + +fig, ax = plt.subplots(figsize=(10, 5), dpi=150) +fig.patch.set_facecolor('white') +ax.set_facecolor('white') +ax.spines['top'].set_visible(False) +ax.spines['right'].set_visible(False) +ax.tick_params(colors=DGRAY) +plt.tight_layout() +plt.savefig('chart_name.png', dpi=150, bbox_inches='tight', + facecolor='white', edgecolor='none') +plt.close() +``` + +--- + +## Placeholder Chart Protocol + +**When data is unavailable for any chart**, generate a clearly marked placeholder PNG instead of skipping the file. This ensures the document-generation skill always finds a file by the expected name, and readers can clearly see that data is missing — rather than seeing a confusing broken image or blank space. + +```python +def generate_placeholder(filename, chart_title, reason='Data not available for this analysis'): + fig, ax = plt.subplots(figsize=(10, 5), dpi=150) + fig.patch.set_facecolor('#F8F9FA') + ax.set_facecolor('#F8F9FA') + ax.set_xlim(0, 1) + ax.set_ylim(0, 1) + ax.axis('off') + + # Dashed border + for spine in ['top', 'bottom', 'left', 'right']: + ax.spines[spine].set_visible(True) + ax.spines[spine].set_linestyle('--') + ax.spines[spine].set_color('#AAAAAA') + + # Icon and message + ax.text(0.5, 0.65, '📊', fontsize=48, ha='center', va='center', transform=ax.transAxes) + ax.text(0.5, 0.45, chart_title, fontsize=14, fontweight='bold', + ha='center', va='center', color='#555555', transform=ax.transAxes) + ax.text(0.5, 0.30, reason, fontsize=11, ha='center', va='center', + color='#888888', style='italic', transform=ax.transAxes) + ax.text(0.5, 0.15, 'See Appendix B — Data Gap Log for details.', + fontsize=10, ha='center', va='center', color='#AAAAAA', transform=ax.transAxes) + + plt.tight_layout() + plt.savefig(filename, dpi=150, bbox_inches='tight', facecolor='#F8F9FA') + plt.close() + print(f"[PLACEHOLDER] Generated: {filename}") +``` + +Call this function whenever the required data for a chart is `❌ MISSING` or confidence is too low to render meaningful values. + +--- + +## Required Charts — All 10 + +### CHART 1: Revenue & EBITDA Trend (5-Year) +**File:** `chart_revenue_ebitda.png` +**Type:** Grouped bar (Revenue) + Line overlay (EBITDA Margin %) +**Data:** Annual Revenue ($M) and EBITDA Margin (%) for 5 years + +```python +fig, ax1 = plt.subplots(figsize=(10, 5), dpi=150) +ax2 = ax1.twinx() + +years = ['FY2019', 'FY2020', 'FY2021', 'FY2022', 'FY2023'] +revenue = [/* from data */] +ebitda_margin = [/* from data */] + +bars = ax1.bar(years, revenue, color=BLUE, alpha=0.85, width=0.5, label='Revenue ($M)') +ax1.bar_label(bars, fmt='$%.0fM', padding=3, fontsize=9, color=DGRAY) +ax1.set_ylabel('Revenue ($M)', color=NAVY, fontweight='bold') +ax1.set_ylim(0, max(revenue) * 1.2) + +line = ax2.plot(years, ebitda_margin, color=GOLD, marker='o', + linewidth=2.5, markersize=8, label='EBITDA Margin %') +for i, v in enumerate(ebitda_margin): + ax2.annotate(f'{v:.1f}%', (years[i], v), textcoords='offset points', + xytext=(0, 10), ha='center', fontsize=9, color=GOLD) +ax2.set_ylabel('EBITDA Margin (%)', color=GOLD, fontweight='bold') +ax2.set_ylim(0, max(ebitda_margin) * 2) + +ax1.set_title(f'{company} — Revenue & EBITDA Margin (5-Year)', + fontsize=13, fontweight='bold', color=NAVY, pad=15) +lines1, labels1 = ax1.get_legend_handles_labels() +lines2, labels2 = ax2.get_legend_handles_labels() +ax1.legend(lines1 + lines2, labels1 + labels2, loc='upper left', framealpha=0.9) +ax1.spines['top'].set_visible(False) +ax2.spines['top'].set_visible(False) +``` + +--- + +### CHART 2: Profit Margins Trend +**File:** `chart_margins.png` +**Type:** Multi-line chart +**Data:** Gross Margin %, Operating Margin %, Net Margin % for 5 years + +```python +fig, ax = plt.subplots(figsize=(10, 5), dpi=150) +ax.plot(years, gross_margins, color=GREEN, marker='s', lw=2.5, ms=8, label='Gross Margin') +ax.plot(years, op_margins, color=BLUE, marker='o', lw=2.5, ms=8, label='Operating Margin') +ax.plot(years, net_margins, color=GOLD, marker='^', lw=2.5, ms=8, label='Net Margin') +# Industry average reference line (if available) +if industry_avg_net_margin: + ax.axhline(y=industry_avg_net_margin, color=RED, linestyle='--', lw=1.5, + label=f'Industry Avg Net Margin ({industry_avg_net_margin:.1f}%)') +ax.fill_between(years, net_margins, alpha=0.1, color=GOLD) +ax.set_ylabel('Margin (%)', fontweight='bold', color=NAVY) +ax.set_title(f'{company} — Profit Margin Trends vs. Industry', + fontsize=13, fontweight='bold', color=NAVY, pad=15) +ax.legend(framealpha=0.9) +ax.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f'{x:.1f}%')) +``` + +--- + +### CHART 3: Cash Flow Waterfall +**File:** `chart_cashflow_waterfall.png` +**Type:** Horizontal waterfall chart +**Data:** OCF, CapEx, FCF, Financing Activities, Net Change (latest year) + +```python +categories = ['Operating\nCash Flow', 'Capital\nExpenditure', 'Free Cash\nFlow', + 'Financing\nActivities', 'Net Cash\nChange'] +values = [ocf, -capex, fcf, financing, net_change] +colors = [GREEN if v >= 0 else RED for v in values] +colors[2] = BLUE # FCF always in blue + +bars = ax.barh(categories, values, color=colors, height=0.5, edgecolor='white', lw=0.5) +ax.axvline(x=0, color=DGRAY, lw=1) +for bar, val in zip(bars, values): + label = f'${abs(val):.0f}M' + xpos = val + (max(abs(v) for v in values) * 0.02) if val >= 0 else val - (max(abs(v) for v in values) * 0.02) + ha = 'left' if val >= 0 else 'right' + ax.text(xpos, bar.get_y() + bar.get_height()/2, label, + va='center', ha=ha, fontsize=10, fontweight='bold', color=DGRAY) +ax.set_title(f'{company} — Cash Flow Waterfall ({latest_year})', + fontsize=13, fontweight='bold', color=NAVY, pad=15) +``` + +--- + +### CHART 4: Balance Sheet Composition +**File:** `chart_balance_sheet.png` +**Type:** Side-by-side stacked bar — Assets AND Liabilities/Equity + +```python +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5), dpi=150) + +# Assets side +ax1.bar(years_3, current_assets, color='#AED6F1', label='Current Assets') +ax1.bar(years_3, noncurrent_assets, bottom=current_assets, color=BLUE, label='Non-Current Assets') +ax1.set_title('Asset Composition', fontweight='bold', color=NAVY) +ax1.legend(loc='upper left', fontsize=9) + +# Liabilities + Equity side +ax2.bar(years_3, current_liab, color='#F1948A', label='Current Liabilities') +ax2.bar(years_3, lt_debt, bottom=current_liab, color=RED, label='Long-Term Debt') +bottom2 = [c + l for c, l in zip(current_liab, lt_debt)] +ax2.bar(years_3, equity, bottom=bottom2, color=GREEN, label="Shareholders' Equity") +ax2.set_title("Liabilities & Equity Composition", fontweight='bold', color=NAVY) +ax2.legend(loc='upper left', fontsize=9) + +fig.suptitle(f'{company} — Balance Sheet Composition (3-Year)', + fontsize=13, fontweight='bold', color=NAVY) +``` + +--- + +### CHART 5: Key Financial Ratios Dashboard (Traffic Light) +**File:** `chart_ratios_dashboard.png` +**Type:** Horizontal bar chart with color-coded thresholds +**Data:** Current Ratio, Quick Ratio, Debt/Equity, Net Debt/EBITDA, Interest Coverage, DSCR + +```python +# Note: thresholds below are defaults — use sector-specific values from financial-analysis skill +ratios = { + 'Current Ratio': {'value': cr, 'good': 2.0, 'warn': 1.0, 'fmt': '{:.2f}x', 'higher_better': True}, + 'Quick Ratio': {'value': qr, 'good': 1.0, 'warn': 0.5, 'fmt': '{:.2f}x', 'higher_better': True}, + 'Debt / Equity': {'value': de, 'good': 1.0, 'warn': 2.0, 'fmt': '{:.2f}x', 'higher_better': False}, + 'Net Debt / EBITDA': {'value': nde, 'good': 2.0, 'warn': 3.5, 'fmt': '{:.2f}x', 'higher_better': False}, + 'Interest Coverage': {'value': ic, 'good': 5.0, 'warn': 2.0, 'fmt': '{:.1f}x', 'higher_better': True}, + 'DSCR': {'value': dscr, 'good': 1.5, 'warn': 1.1, 'fmt': '{:.2f}x', 'higher_better': True}, +} + +fig, ax = plt.subplots(figsize=(10, 6), dpi=150) +labels, values, colors_bar = [], [], [] +for name, r in ratios.items(): + labels.append(name) + values.append(r['value']) + if r['higher_better']: + c = GREEN if r['value'] >= r['good'] else (AMBER if r['value'] >= r['warn'] else RED) + else: + c = GREEN if r['value'] <= r['good'] else (AMBER if r['value'] <= r['warn'] else RED) + colors_bar.append(c) + +bars = ax.barh(labels, values, color=colors_bar, height=0.55, edgecolor='white') +for bar, r in zip(bars, ratios.values()): + ax.text(bar.get_width() + 0.05, bar.get_y() + bar.get_height() / 2, + r['fmt'].format(r['value']), va='center', fontsize=11, fontweight='bold') + +legend_patches = [ + mpatches.Patch(color=GREEN, label='Strong ✅'), + mpatches.Patch(color=AMBER, label='Watch 🟡'), + mpatches.Patch(color=RED, label='Risk ❌') +] +ax.legend(handles=legend_patches, loc='lower right') +ax.set_title(f'{company} — Key Ratio Dashboard', fontsize=13, fontweight='bold', color=NAVY, pad=15) +ax.set_xlabel('Ratio Value', color=NAVY) +``` + +--- + +### CHART 6: Credit Rating Scale Visual +**File:** `chart_credit_ratings.png` +**Type:** Custom horizontal rating scale with agency markers +**Data:** Moody's, S&P, Fitch ratings + internal rating if available + +```python +scale = ['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-', + 'BB+','BB','BB-','B+','B','B-','CCC','CC','C','D'] + +# Color zones: investment grade (green shades) vs speculative (amber/red) +zone_colors = [] +for i in range(len(scale)): + if i < 3: zone_colors.append('#1a7741') # AAA–AA: dark green + elif i < 6: zone_colors.append('#70AD47') # A: green + elif i < 10: zone_colors.append('#A9D18E') # BBB: light green + elif i < 13: zone_colors.append('#ED7D31') # BB: amber + else: zone_colors.append('#C00000') # B and below: red + +fig, ax = plt.subplots(figsize=(12, 3), dpi=150) +for i, (rating, color) in enumerate(zip(scale, zone_colors)): + ax.bar(i, 1, color=color, edgecolor='white', width=0.9) + ax.text(i, 0.5, rating, ha='center', va='center', fontsize=8, + fontweight='bold', color='white') + +# Investment grade dividing line +ax.axvline(x=9.5, color='black', lw=2, linestyle='--') +ax.text(4.5, 1.08, 'INVESTMENT GRADE', ha='center', fontsize=10, + fontweight='bold', color='#1a7741', transform=ax.transAxes) +ax.text(0.78, 1.08, 'SPECULATIVE', ha='center', fontsize=10, + fontweight='bold', color='#C00000', transform=ax.transAxes) + +# Mark each agency's rating with a pin +for agency, rating_str, marker, color in [ + ('Moody\'s', moodys_rating, 'v', NAVY), + ('S&P', sp_rating, '^', BLUE), + ('Fitch', fitch_rating, 's', GOLD), +]: + if rating_str in scale: + idx = scale.index(rating_str) + ax.plot(idx, 1.3, marker=marker, ms=12, color=color, label=f'{agency}: {rating_str}') + +ax.set_xlim(-0.5, len(scale) - 0.5) +ax.set_ylim(0, 1.8) +ax.axis('off') +ax.legend(loc='upper right', fontsize=9, framealpha=0.9) +ax.set_title(f'{company} — Credit Rating Position', fontsize=13, fontweight='bold', + color=NAVY, pad=20) +``` + +--- + +### CHART 7: Industry Market Size & Growth +**File:** `chart_industry.png` +**Type:** Grouped bar (market size, USD bn) + Line (growth rate %) +**Data:** Market size last 5 years + CAGR projection + +```python +fig, ax1 = plt.subplots(figsize=(10, 5), dpi=150) +ax2 = ax1.twinx() +bars = ax1.bar(years, market_size, color=BLUE, alpha=0.8, width=0.5, label='Market Size ($bn)') +ax1.bar_label(bars, fmt='$%.0fbn', padding=3, fontsize=9, color=DGRAY) +ax1.set_ylabel('Market Size (USD bn)', color=NAVY, fontweight='bold') +ax2.plot(years, growth_rate, color=GOLD, marker='o', lw=2.5, ms=8, label='YoY Growth %') +ax2.set_ylabel('Growth Rate (%)', color=GOLD, fontweight='bold') +ax2.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f'{x:.1f}%')) +ax1.set_title(f'{industry} — Market Size & Growth', fontsize=13, fontweight='bold', color=NAVY, pad=15) +lines1, labels1 = ax1.get_legend_handles_labels() +lines2, labels2 = ax2.get_legend_handles_labels() +ax1.legend(lines1 + lines2, labels1 + labels2, loc='upper left', framealpha=0.9) +``` + +--- + +### CHART 8: SWOT Matrix +**File:** `chart_swot.png` +**Type:** 2×2 colored quadrant diagram + +```python +fig, axes = plt.subplots(2, 2, figsize=(12, 8), dpi=150) +configs = [ + ('STRENGTHS', strengths, '#D5E8D4', '#82B366', 0, 0), + ('WEAKNESSES', weaknesses, '#FFE6CC', '#D6B656', 0, 1), + ('OPPORTUNITIES', opportunities, '#DAE8FC', '#6C8EBF', 1, 0), + ('THREATS', threats, '#F8CECC', '#B85450', 1, 1), +] +for title, items, bg, border, r, c in configs: + ax = axes[r][c] + ax.set_facecolor(bg) + ax.set_xticks([]); ax.set_yticks([]) + for spine in ax.spines.values(): + spine.set_edgecolor(border); spine.set_linewidth(2) + ax.text(0.5, 0.92, title, transform=ax.transAxes, fontsize=13, + fontweight='bold', ha='center', color=border) + for i, item in enumerate(items[:4]): + ax.text(0.08, 0.75 - i * 0.18, f'• {item}', transform=ax.transAxes, + fontsize=10, va='top', wrap=True) +fig.suptitle('Industry SWOT Analysis', fontsize=16, fontweight='bold', color=NAVY) +plt.tight_layout(rect=[0, 0, 1, 0.95]) +``` + +--- + +### CHART 9: DSCR Stress Test +**File:** `chart_dscr_stress.png` +**Type:** Grouped bar chart (Base, Downside, Severe) +**Data:** DSCR under 3 scenarios + +```python +scenarios = ['Base Case\n(Revenue flat)', 'Downside\n(-15% Revenue)', 'Severe Stress\n(-30% Revenue)'] +dscr_values = [base_dscr, downside_dscr, severe_dscr] +threshold = 1.25 +colors_s = [GREEN if v >= threshold else (AMBER if v >= 1.0 else RED) for v in dscr_values] + +fig, ax = plt.subplots(figsize=(9, 5), dpi=150) +bars = ax.bar(scenarios, dscr_values, color=colors_s, width=0.4, edgecolor='white') +ax.axhline(y=threshold, color=RED, linestyle='--', lw=2, label=f'Min. DSCR Threshold ({threshold}x)') +ax.axhline(y=1.0, color=AMBER, linestyle=':', lw=1.5, label='Break-even (1.0x)') +ax.bar_label(bars, fmt='{:.2f}x', padding=4, fontsize=11, fontweight='bold') +ax.set_ylabel('Debt Service Coverage Ratio', fontweight='bold', color=NAVY) +ax.set_title(f'{company} — DSCR Stress Test Scenarios', fontsize=13, fontweight='bold', + color=NAVY, pad=15) +ax.legend() +``` + +--- + +### CHART 10: Management Tenure Timeline +**File:** `chart_mgmt_tenure.png` +**Type:** Horizontal Gantt-style bar chart +**Data:** Each C-suite exec — join year, current year, role + +```python +fig, ax = plt.subplots(figsize=(10, max(4, len(executives) * 0.7)), dpi=150) +current_year = 2024 + +for i, exec in enumerate(executives): + tenure = current_year - exec['join_year'] + color = GREEN if tenure >= 5 else (AMBER if tenure >= 2 else RED) + ax.barh(i, tenure, left=exec['join_year'], color=color, height=0.5, + edgecolor='white', alpha=0.85) + ax.text(exec['join_year'] + tenure + 0.1, i, + f"{exec['name']} — {exec['title']} ({tenure}y)", + va='center', fontsize=9, color=DGRAY) + +ax.set_yticks(range(len(executives))) +ax.set_yticklabels([e['title'] for e in executives], fontsize=9) +ax.set_xlabel('Year', color=NAVY, fontweight='bold') +ax.set_title(f'{company} — C-Suite Tenure', fontsize=13, fontweight='bold', + color=NAVY, pad=15) +legend_patches = [ + mpatches.Patch(color=GREEN, label='>5 years — Stable'), + mpatches.Patch(color=AMBER, label='2–5 years — Watch'), + mpatches.Patch(color=RED, label='<2 years — New') +] +ax.legend(handles=legend_patches, loc='lower right') +ax.invert_yaxis() +``` + +--- + +## Chart Output Protocol +1. Generate all charts as PNG at 150 DPI minimum +2. Save to temp folder: `/tmp/credit_memo_charts/` +3. Name exactly as specified (document-generation skill reads them by name) +4. After generation, verify all 10 chart files exist +5. **If any chart fails due to missing data → call `generate_placeholder()` with the chart filename and reason** +6. Log all placeholders: add them to the data gap log (Appendix B) + +## Chart Quality Checklist +Before embedding, verify each chart: +- [ ] No overlapping labels +- [ ] All axes labeled with units +- [ ] Legend present and readable +- [ ] Title includes company name and metric +- [ ] Source line at bottom if data source is known +- [ ] White or light-gray background (no transparency) +- [ ] Minimum 150 DPI +- [ ] Placeholder charts clearly distinguishable from real data charts From ea958d1cd186d3e4c903ef3366a192a4956255ff Mon Sep 17 00:00:00 2001 From: anthropic-plugin Date: Sun, 21 Jun 2026 21:47:41 +0530 Subject: [PATCH 2/2] Add credit-memo plugin under plugins/partner-built/ and update marketplace.json --- .claude-plugin/marketplace.json | 12 ++-- .../.claude-plugin/plugin.json | 8 +++ .../synechron-credit-memo/.mcp.json | 70 +++++++++++++++++++ 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 plugins/partner-built/synechron-credit-memo/.claude-plugin/plugin.json create mode 100644 plugins/partner-built/synechron-credit-memo/.mcp.json diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ea64cfec7..1e5740243 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -119,10 +119,14 @@ "description": "S&P Global - Financial data and analytics skills including company tearsheets, earnings previews, and transaction summaries" }, { - "name": "claude-for-msft-365-install", - "displayName": "Claude for Microsoft 365 Install", - "source": "./claude-for-msft-365-install", - "description": "Provision direct cloud access (Vertex AI, Bedrock, or LLM gateway) for the Claude Microsoft 365 add-in. Generates the customized manifest, walks through Azure admin consent, and writes per-user config via Graph extension attributes." + "name": "claude-in-office", + "source": "./claude-in-office", + "description": "Provision direct cloud access (Vertex AI, Bedrock, or LLM gateway) for the Claude Office add-in. Generates the customized manifest, walks through Azure admin consent, and writes per-user config via Graph extension attributes." + }, + { + "name": "credit-memo", + "source": "./partner-built/synechron-credit-memo", + "description": "Generate comprehensive Credit Memorandums for commercial lending. Collects financial data from SEC EDGAR, SerpApi, and public sources. Analyzes borrower financials, credit risk, repayment capacity, industry position, and management quality. Outputs Word, PDF, and PowerPoint with embedded charts. Built by Synechron Technologies." } ] } diff --git a/plugins/partner-built/synechron-credit-memo/.claude-plugin/plugin.json b/plugins/partner-built/synechron-credit-memo/.claude-plugin/plugin.json new file mode 100644 index 000000000..b8e46f466 --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/.claude-plugin/plugin.json @@ -0,0 +1,8 @@ +{ + "name": "credit-memo-generation", + "version": "1.0.0", + "description": "Generate comprehensive, professional Credit Memorandums for loan analysis. Automatically collects 3–5 years of financial data from SEC EDGAR, Stock Analysis, Moody's, S&P, Fitch, and SerpApi. Supports public and private companies. Outputs Word (.docx), PDF, and PowerPoint with 10 embedded charts. Includes full financial, risk, repayment, industry, and management analysis with a 5-layer guardrails system.", + "author": { + "name": "Synechron Technologies PVT LTD" + } +} diff --git a/plugins/partner-built/synechron-credit-memo/.mcp.json b/plugins/partner-built/synechron-credit-memo/.mcp.json new file mode 100644 index 000000000..f239afefe --- /dev/null +++ b/plugins/partner-built/synechron-credit-memo/.mcp.json @@ -0,0 +1,70 @@ +{ + "mcpServers": { + "sec-edgar": { + "type": "http", + "url": "https://data.sec.gov", + "description": "SEC EDGAR — Official 10-K, 10-Q, 8-K regulatory filings. IMPORTANT: The SEC_EDGAR_KEY in config.local.md is NOT a traditional API key. It is a courtesy User-Agent string in the format 'OrganizationName contact@email.com'. Set it as the User-Agent header on all EDGAR requests. Without a valid User-Agent: 10 req/sec limit. With a valid User-Agent: higher limits and full-text search access.", + "endpoints": { + "full_text_search": "https://efts.sec.gov/LATEST/search-index?q={company}&forms=10-K,10-Q,8-K&dateRange=custom&startdt={start_year}-01-01&enddt={end_year}-12-31", + "company_search": "https://www.sec.gov/cgi-bin/browse-edgar?company={company}&CIK=&type=10-K&dateb=&owner=include&count=10&search_text=&action=getcompany", + "submissions": "https://data.sec.gov/submissions/CIK{cik_padded}.json" + }, + "auth": "User-Agent header — set to value of SEC_EDGAR_KEY from config.local.md", + "terms_of_service": "https://www.sec.gov/privacy.htm — Public access; User-Agent required as per SEC fair access guidelines." + }, + "serpapi": { + "type": "http", + "url": "https://serpapi.com", + "description": "SerpApi — Authenticated Google/Bing search API. API key from SERPAPI_KEY in config.local.md. Append &api_key={SERPAPI_KEY} to all calls. Unlocks Google Finance, Google News, Scholar endpoints.", + "endpoints": { + "google_search": "https://serpapi.com/search?engine=google&q={query}&api_key={SERPAPI_KEY}", + "google_finance": "https://serpapi.com/search?engine=google_finance&q={ticker}&api_key={SERPAPI_KEY}", + "google_news": "https://serpapi.com/search?engine=google_news&q={query}&api_key={SERPAPI_KEY}", + "yahoo_finance": "https://serpapi.com/search?engine=yahoo_finance&q={ticker}&api_key={SERPAPI_KEY}" + }, + "auth": "SERPAPI_KEY query parameter from config.local.md", + "terms_of_service": "https://serpapi.com/terms — Licensed API access; usage subject to SerpApi subscription terms." + }, + "stock-analysis": { + "type": "http", + "url": "https://stockanalysis.com", + "description": "Stock Analysis — Structured financials, ratios, 5-year history. Public web access.", + "endpoints": { + "financials": "https://stockanalysis.com/stocks/{ticker}/financials/", + "balance_sheet": "https://stockanalysis.com/stocks/{ticker}/financials/balance-sheet/", + "cash_flow": "https://stockanalysis.com/stocks/{ticker}/financials/cash-flow-statement/", + "ratios": "https://stockanalysis.com/stocks/{ticker}/financials/ratios/" + }, + "terms_of_service_note": "Web access for informational purposes. Verify compliance with stockanalysis.com Terms of Service before automated use in production." + }, + "discoverci": { + "type": "http", + "url": "https://discoverci.com", + "description": "DiscoverCI — Company intelligence, segments, competitors. Public web access.", + "endpoints": { + "company": "https://discoverci.com/companies/{company}" + }, + "terms_of_service_note": "Web access for informational purposes. Verify compliance with discoverci.com Terms of Service before automated use in production." + }, + "macrotrends": { + "type": "http", + "url": "https://www.macrotrends.net", + "description": "Macrotrends — 10-year historical financials and industry benchmarks. Public web access.", + "endpoints": { + "revenue": "https://www.macrotrends.net/stocks/charts/{ticker}/{company}/revenue", + "profit_margin": "https://www.macrotrends.net/stocks/charts/{ticker}/{company}/profit-margins", + "pe_ratio": "https://www.macrotrends.net/stocks/charts/{ticker}/{company}/pe-ratio" + }, + "terms_of_service_note": "Web access for informational purposes. Verify compliance with macrotrends.net Terms of Service before automated use in production." + }, + "spherical-insights": { + "type": "http", + "url": "https://www.sphericalinsights.com", + "description": "Spherical Insights — Market size, CAGR, industry forecasts. Public web access.", + "endpoints": { + "search": "https://www.sphericalinsights.com/search/{industry}" + }, + "terms_of_service_note": "Web access for informational purposes. Verify compliance with sphericalinsights.com Terms of Service before automated use in production." + } + } +}