Output generator

From lowtidebuild/public-equity-research · View interactive version

Output generator is an AI agent skill from the GitHub repository lowtidebuild/public-equity-research. **Role**: Step 8 — Generate the final analysis output in the requested mode (A, B, C, D). Mode A delegates to briefing-generator; Mode B uses `scripts/render-comparison.py`; Mode C delegates to dashbo

How to use this skill

Skill file

Output Generator — SKILL.md

Role: Step 8 — Generate the final analysis output in the requested mode (A, B, C, D). Mode A delegates to briefing-generator; Mode B uses scripts/render-comparison.py; Mode C delegates to dashboard-generator; Mode D uses scripts/docx-generator.py.

Triggered by: CLAUDE.md after Analyst Agent (Step 7) completes

Reads: output/runs/{run_id}/{ticker}/analysis-result.json, appropriate mode template

Writes: File (Mode B, D); Mode A delegates to briefing-generator/SKILL.md; Mode C delegates to dashboard-generator/SKILL.md

References: mode-b-template.md, mode-d-template.md, scripts/render-comparison.py, scripts/docx-generator.py


Mode Routing

output_mode = "A" → Mode A: HTML briefing (delegate to briefing-generator/SKILL.md)
output_mode = "B" → Mode B: HTML file (this file, uses mode-b-template.md + scripts/render-comparison.py)
output_mode = "C" → Mode C: HTML dashboard (delegate to dashboard-generator/SKILL.md)
output_mode = "D" → Mode D: DOCX investment memo (this file, uses docx-generator.py)

Mode B — Comparative Matrix (HTML File)

Load mode-b-template.md. Populate from each ticker's run-local validated-data.json.

Preferred scripted path:

python .claude/skills/output-generator/scripts/render-comparison.py \
  --input output/runs/{run_id}/{ticker}/analysis-result.json \
  --output output/reports/{tickers}_B_{lang}_{YYYY-MM-DD}.html

render-comparison.py resolves peer analysis-result.json / validated-data.json files from

the run-local artifact root first, then falls back to peer-specific run-local legacy promotions,

and finally to immutable snapshot refs from output/data/{ticker}/latest.json if needed.

Pre-output checks:

  1. Same metric set applied to all peers?
  2. Winner column logic correct (low for valuation, high for growth)?
  3. R/R Score computed for all peers?
  4. Best Pick labeled as opinion?
  5. Key Differentiators have ≥2 specific numbers each?

Write to: output/reports/{tickers}_B_{lang}_{YYYY-MM-DD}.html

Report file path to user.


Mode D — Investment Memo (DOCX File)

Mode D produces a Word document (.docx) with professional formatting — section headings,

financial tables, scenario matrix, risk table, EBITDA bridge, and source tags throughout.

Step 1 — Ensure all section content is in run-local analysis-result.json

The Analyst Agent must write all narrative and table data into analysis-result.json

sections object before this step runs. See mode-d-template.md for the required

JSON structure for each section.

Step 2 — Run docx-generator.py

python .claude/skills/output-generator/scripts/docx-generator.py \
  --input output/runs/{run_id}/{ticker}/analysis-result.json \
  --output output/reports/{ticker}_D_{lang}_{YYYY-MM-DD}.docx

If Python is unavailable, fall back to writing a structured plain-text memo inline

(clearly labeled as plain-text fallback) and note the limitation to the user.

Pre-output checks:

Write to: output/reports/{ticker}_D_{lang}_{YYYY-MM-DD}.docx

Report file path to user. The user can open the file directly in Microsoft Word,

Google Docs, or LibreOffice.


Disclaimer Text (Required in Mode B HTML outputs)

Append to all Mode B HTML output files:

---
**Disclaimer**: This report is generated by an AI research assistant for informational
purposes only. It does not constitute investment advice, a solicitation to buy or sell
securities, or a guarantee of investment returns. All data is sourced from public
information and may not reflect the most current market conditions. Past performance
is not indicative of future results. Always conduct your own due diligence and consult
a qualified financial advisor before making investment decisions.

*Generated: {YYYY-MM-DD HH:MM} UTC | AI Research Assistant | Data: {source list}*

Korean version:

---
**면책 조항**: 이 보고서는 정보 제공 목적으로만 AI 리서치 어시스턴트가 생성한 것입니다.
투자 조언, 증권 매수/매도 권유, 또는 투자 수익 보장이 아닙니다. 모든 데이터는 공개 정보에서
수집되었으며 최신 시장 상황을 반영하지 않을 수 있습니다. 과거 실적이 미래 결과를 보장하지
않습니다. 투자 결정 전 반드시 자체 실사를 수행하고 전문 재무 어드바이저와 상담하시기 바랍니다.

Note: Mode D DOCX files include the disclaimer automatically via docx-generator.py.


Source Tagging Reference

Use these tags consistently throughout all output:

Grade D data is displayed as "—" in output (no tag needed).


Completion Check

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.