New here? Read
FIRST_RUN.mdfirst for the quick-start checklist.
This repository is a markdown-first workspace template for researching one stock thesis at a time. It is designed to keep a case persistent across sessions so facts, inference, open questions, signals, and active decisions stay separate and reviewable.
- Work one stock case at a time.
- Preserve reusable files instead of one-off chat summaries.
- Separate facts, inferences, open questions, and thesis changes.
- Prefer public and free sources unless the user explicitly provides something else.
- Update the case incrementally when new signals arrive.
- Start a case with
stock-case-init. - Fetch Yahoo profile + financials with
yahoo-profile-financials. - Build the company view with
company-deep-dive. - Run financial analysis with
financial-analysis(Goodinfo annual viafetch_goodinfo.pyplus official monthly revenue, quarterly statements, and valuation band viafetch_fundamentals.py). - Map industry drivers with
industry-transmission-analysis. - Filter macro variables with
macro-impact-analysis. - Add the value-investor quality layer with
quality-and-valuation-check. - Write the current thesis with
investment-thesis. - Refresh TDCC and FinMind market data with
market-data-fetch. - Add the market-state layer with
market-action-read; after this final evidence layer is complete, automatically refresh the derived HTML summary withresearch-html-output. - Use
signal-updatefor new filings, revenue releases, or news. - Use
case-revisitwhen returning to the case later. - Use
session-wrapbefore ending a session to record expected evidence, thesis kill criteria, and tracking triggers inactive-decisions.md.
研究 <ticker> runs the existing workflow only for that case. It may write to the matching companies/<ticker>-<slug>/ directory and required current shared data under market/; it must not modify skills, templates, scripts, the renderer, another case, or workspace policy unless the user explicitly requests a system change. Every case-file update must be evidence-linked to the current fetch results.
The workspace keeps shared market context under market/, reusable templates under templates/, and per-stock cases under companies/. Create shared market files in market/ by copying the corresponding templates from templates/ when needed. See docs/data-layout.md for file ownership and docs/data-freshness.md for stale-data defaults.
Markdown and JSON files remain the source of truth. When the user explicitly asks for a comprehensive research result as HTML, or when the standard workflow finishes market-action-read, use the research-html-output skill and render a derived preview from templates/research-html-summary.html.
The HTML output is produced by string replacement, not by changing the canonical case files:
.venv/bin/python scripts/render_research_html.py \
--data companies/<ticker-slug>/research-summary-data.json \
--output companies/<ticker-slug>/research-summary.htmlAfter the market-action-read.md evidence layer is verified, build the JSON payload from the completed current case files, then let scripts/render_research_html.py replace the template placeholders. The HTML output stays in that company folder as companies/<ticker-slug>/research-summary.html.
Do not reuse, patch, or manually reconstruct a prior payload as a substitute for the current case synthesis. If the current payload cannot satisfy the template contract, stop and report the blocker; do not change the workflow contract during a stock research run. The shared template includes the research snapshot, expectation gap, pricing-stage verification, confidence calibration, cross-layer conflicts, adversarial review, data availability, evidence timeline, scenario summary, watch items, and source quality.
The screenshot below is the result of rendering a case into HTML with scripts/render_research_html.py.
These project-local workflow skills live under .agents/skills/<skill-name>/SKILL.md.
stock-case-init: create case metadata, core questions, and initial open questions.yahoo-profile-financials: run the Yahoo profile and supplemental financial fetch flow.company-deep-dive: analyze business model, products, customers, and revenue structure.financial-analysis: run Goodinfo first, then write the financial fact layer with MOPS cross-checks.industry-transmission-analysis: map the industry chain and leading indicators.macro-impact-analysis: keep only macro variables that materially transmit into the case.quality-and-valuation-check: assess ROIC, owner earnings, working-capital quality, capital allocation, implied expectations, and margin of safety.investment-thesis: produce the current memo with assumptions and disconfirming evidence.market-data-fetch: refresh TDCC ownership distribution and FinMind market data for the requested stock id.market-action-read: summarize market state, institutional flow, and egg-theory evidence without trading instructions, then automatically render the summary HTML preview.research-html-output: derive the current HTML payload and preview from completed case files usingtemplates/research-html-summary.htmlandscripts/render_research_html.py; it does not alter source evidence layers.signal-update: append new events and decide whether the thesis changed.case-revisit: re-enter an existing case with a file-grounded summary.session-wrap: preserve unresolved questions, expected evidence, thesis kill criteria, decisions, and next follow-ups.
- Read
FIRST_RUN.md. - Start a new case with
stock-case-initso metadata, research questions, and open questions are created in the right order. - Use the files in
templates/as the canonical shapes for the artifacts each skill should create or update. - Create shared market context files in
market/by copying the corresponding templates fromtemplates/when needed. - Run the structure and skill checks in
tests/after changing the workspace.
User: "幫我分析 3105 穩懋"
What happens:
stock-case-initcreatescompanies/3105-awsc/directoryyahoo-profile-financialsrunsscripts/fetch_yahoo.py 3105→ savesyahoo-data.jsonin the case directory- Fetches Yahoo profile + financials (revenue, margins, cash flow) for the company deep-dive input
financial-analysisrunsscripts/fetch_goodinfo.py 3105→ savesraw-data.jsonin the case directory- Uses Goodinfo data with MOPS cross-check links for financial-analysis primary evidence
- Writes
company-analysis.mdwith business model, product mix, margin analysis - Writes
financial-analysis.mdwith 3D analysis (經營/獲利/財務健全度) using Goodinfo data - Writes
industry-transmission.mdmapping the industry chain - Writes
macro-map.mdfiltering relevant macro variables - Writes
quality-and-valuation-check.mdwith business quality, implied expectations, and margin-of-safety evidence - Writes
investment-memo.mdwith Bull/Base/Bear scenarios using theinvestment-reasoning-framework.mdpricing framework market-data-fetchruns TDCC then FinMind withFIN_MIND_TOKENwhen needed → savestdcc-data.jsonandmarket-data.jsonin the case directory- Writes
market-action-read.mdwith 1D/3D/5D price-volume, institutional flow, holder distribution, and egg-theory evidence - Refreshes
research-summary-data.jsonand rendersresearch-summary.html - Records expected evidence timeline and thesis kill criteria in
active-decisions.md - Updates
stock-meta.jsonwith all file references
Files created:
companies/3105-awsc/
├── stock-meta.json # Case index
├── yahoo-data.json # Yahoo profile, revenue, margins, and cash-flow summary
├── raw-data.json # Goodinfo raw financial data
├── fundamentals-data.json # FinMind monthly revenue, quarterly statements, valuation band
├── tdcc-data.json # TDCC ownership distribution snapshot
├── research-questions.md # Core questions & unknowns
├── open-questions.md # Active open questions
├── active-decisions.md # Research stance & tracking triggers
├── company-analysis.md # Business model deep-dive
├── financial-analysis.md # 3D financial analysis
├── industry-transmission.md # Industry chain & leading indicators
├── macro-map.md # Macro variables
├── quality-and-valuation-check.md # Quality, implied expectations, margin of safety
├── investment-memo.md # Investment thesis (dual framework)
├── market-data.json # FinMind price/volume, institutional, margin, and egg-theory data
├── market-action-read.md # Neutral market-state read
├── research-summary-data.json # HTML summary payload
├── research-summary.html # Derived summary preview
├── signal-log.md # Append-only event log
└── thesis-updates.md # Explicit thesis changes from new signals
User: "更新 2344 華邦電最新財報"
What happens:
signal-updateclassifies the new item and reads the existing case files- Refreshes the relevant fetcher only when the signal depends on updated structured data
- Appends the event to
signal-log.md - Updates only the affected thesis or tracking section when the signal changes the research stance
User: "我上次研究的 6789 采鈺現在怎麼樣了?"
What happens:
case-revisitreadsstock-meta.jsonto find the case- Summarizes current active decisions from
active-decisions.md - Lists open questions from
open-questions.md - Suggests next follow-ups
Peer comparison is outside the one-stock case workflow. Keep each stock in its own case; do not write a cross-company comparison into a case-owned analysis file.
- Raw data: Always saved as
companies/{ticker-slug}/raw-data.json, never in repo root - Yahoo data: Always saved as
companies/{ticker-slug}/yahoo-data.json, never in repo root - Market data: Always saved as
companies/{ticker-slug}/market-data.json, never in repo root - Financial data: Goodinfo.tw is the annual primary source;
scripts/fetch_fundamentals.pyadds official monthly revenue, quarterly statements, and the P/E / P/B valuation band (fundamentals-data.json); always include MOPS links for cross-checking - Macro data: Taiwan-focused. Run
scripts/fetch_macro.pyto refreshmarket/shared-macro-data.json(TWSE Open API, Yahoo Finance, MOF customs trade statistics by default); include only variables with a concrete company-level transmission path - Quality and valuation: Keep business-quality judgment and implied market expectations in
quality-and-valuation-check.md; the investment memo should consume its conclusion, not duplicate its tables - Expectation gap: Use
investment-memo.mdto separate market belief, verified evidence, narrative-only claims, and the evidence needed to close or invalidate the gap - Market action:
market-action-read.mdsummarizes evidence only; it must not output trade instructions - Market data fetch: run
market-data-fetchbeforemarket-action-readwhen TDCC, FinMind, or egg-theory data is stale - Tracking discipline: Use
active-decisions.mdfor expected evidence timelines, thesis kill criteria, and review triggers so a case can be downgraded when evidence stops compounding - Thesis format: Dual framework (Business Thesis + Pricing Thesis per
investment-reasoning-framework.md) - Pricing stages: Stage 1 (narrative expansion) → Stage 2 (fundamentals catch up) → Stage 3 (growth slows)
- No unsupported targets: Never generate price targets without scenario analysis
- Not a trading bot.
- Not a valuation engine.
- Not a scheduler or watchlist product.
- Not a source of guaranteed returns, price targets, or trade orders.
