daily-brief

Original🇨🇳 Chinese
Translated
1 scripts

Prepare and publish Briefast's daily pre-market industry and Taiwan stock report. Use before market open when an agent must collect public news, judge short- and long-horizon stock calls, compose the exact Briefast report JSON, and POST it to the authenticated report API.

3installs
Added on

NPX Install

npx skill4agent add hazelnutparadise/briefast daily-brief

SKILL.md Content (Chinese)

View Translation Comparison →

Briefast Daily Pre-Market Report

Complete the following four steps in sequence before the market opens on each trading day. Only submit content; generating or calling Artifact DSL is prohibited.

Pre-Execution Checks

  1. Read configurations from the
    .env
    file in the root directory of the execution workspace. This is the only source of configurations; do not retrieve values from environment variables or read files in the skill directory. The format is one
    KEY=VALUE
    pair per line:
    BRIEFAST_URL=https://briefast.example.com
    BRIEFAST_API_KEY=Key created in the backend
    skills/daily-brief/.env.example
    is a template; copy it to the workspace root directory, rename it to
    .env
    , and fill in the actual values.
  2. If
    .env
    does not exist, or either
    BRIEFAST_URL
    or
    BRIEFAST_API_KEY
    is missing or contains only whitespace, stop immediately. Clearly report which item is missing; do not collect news, draft the report, or send a POST request.
  3. Do not display, record, or return the full API key.
  4. Determine the report date and
    generated_at
    using Taipei Time Zone.
  5. Trading Day Gate: After passing the above checks and before starting news collection, verify whether the current date (in Taipei Time Zone) is a Taiwan stock trading day. If it is a non-trading day, terminate immediately—do not collect news, analyze, draft the report, or send a POST request, and explain the reason for the market closure (weekend, or the name of the calendar entry) in the execution report. Judgment must follow only the verifiable rules below; do not rely on memory or common sense:
    • Saturdays and Sundays are always considered non-trading days; no need to check the endpoint.
    • For other dates, verify using the TWSE holiday schedule endpoint:
      https://openapi.twse.com.tw/v1/holidaySchedule/holidaySchedule
      The
      Date
      in the response uses the Minguo calendar format (e.g.,
      1150101
      corresponds to 2026-01-01). Entries are divided into two categories: those with
      Name
      or
      Description
      indicating "no market trading", "holiday", or "make-up holiday" are non-trading days; informational entries such as "start of trading period" or "last trading day" are trading days and must not be misjudged as non-trading days. Weekdays that do not match any non-trading entries are trading days; proceed as normal.
    • If verifying the endpoint fails on a weekday, retry once. If it still fails, treat it as unable to confirm closure, proceed with the full process as normal, and include the endpoint failure in the execution report. This request occurs before starting collection, and is not performed concurrently with the rate-limited sequence of TWSE requests in Batch 2; do not apply the interval rules of that batch.
    • The verification process and endpoint success/failure of the gate are only included in the execution report. In accordance with the "collection mechanism not disclosed" rule, they must not appear in the report content.

1. Collect Industry and Stock Market News

Time Window

Collect news from the
generated_at
of the previous report to the current time
.
Retrieve the
generated_at
of the previous report using a read-only endpoint; do not rely on memory or guesswork:
bash
curl --silent --show-error \
  --output previous.json \
  --write-out '%{http_code}' \
  --header "Authorization: Bearer ${BRIEFAST_API_KEY}" \
  "${BRIEFAST_URL%/}/api/report/2026-08-06"
Start the date from the previous trading day in Taipei Time Zone. If a
404
is returned, check the day before, up to 5 days back. If a
200
is returned, use the
generated_at
in
previous.json
as the start of the window; if all 5 days return
404
(first execution or after a long holiday), use the past 24 hours as the window. For
401
, handle it as per Step 4: stop and report.

Batch Collection

Collection is divided into five batches. Each batch is responsible for a specific set of endpoints, and must clearly report the number of items obtained—no number means the batch is incomplete. News lists must always be retrieved from the specified endpoints; do not search for news on the portal homepage on your own: the homepage is editorially formatted and may miss small-to-medium news within the window.
The five batches target different hosts and can be initiated simultaneously; there is no need to wait for the previous batch to complete. Only the two requests within the TWSE batch need to maintain sequence and intervals—this restriction applies to the TWSE host, not to batches.
Parallel execution does not relax the counting requirement: before analysis can begin, all five batches must report their status completely. "Complete reporting" includes failures—if a batch cannot retrieve data, record the failure and reason; this is also a valid report. No batch can disappear without a trace.

Batch 1: Cnyes (Primary Source)

Six category list APIs, substitute
{category}
with the values in the table below:
https://api.cnyes.com/media/api/v1/newslist/category/{category}?limit=30
CategoryContentPurpose
tw_stock
Taiwan StocksMain source for individual stock analysis
headline
HeadlinesCross-sector major events
tech
TechnologyTechnology sector
tw_macro
Taiwan MacroFinance sector
cnyeshouse
Real EstateReal estate sector
wd_stock
Global StocksOnly write to
overview_md
, do not include in calls or stock_news
Each item in the list response already contains full content (
content
), related stock symbols (
stock
), and publication timestamp (
publishAt
); there is no need to retrieve the detail page.
For this batch, record: the number of items obtained and the number of unread items for each of the six categories.

Batch 2: TWSE

Two datasets; retrieve the entire package and filter by the time window:
  • https://openapi.twse.com.tw/v1/opendata/t187ap04_L
    (Major Announcements)
  • https://openapi.twse.com.tw/v1/opendata/t187ap05_L
    (Monthly Revenue)
TWSE blocks IPs for high-frequency requests. For this batch, comply with the rules: execute requests sequentially with an interval of at least 5 seconds, do not execute in parallel or retry consecutively; if
429
or connection rejection occurs, wait 60 seconds and retry once. If it still fails, stop making requests and handle it as a secondary source failure per the rules below.
For this batch, record: the number of items in each dataset that fall within the time window.

Batch 3: CTEE

Six category RSS feeds, substitute
{category}
with
policy
(Top News),
stock
(Securities),
finance
(Finance),
industry
(Industry),
house
(Real Estate),
tech
(Technology):
https://www.ctee.com.tw/rss_web/livenews/{category}
Retrieve article URLs from the RSS feed and fetch the content using regular HTTP requests. The category page HTML returns 403, but RSS does not; no headless browser is required.
For this batch, record: the number of unread items for each of the six categories.

Batch 4: CNA, TechNews, LTN

SourceList EndpointContent RetrievalFocus
Central News Agency (CNA)
https://feeds.feedburner.com/rsscna/finance
Fetch article page using regular HTTPFinance and industry news
TechNews
https://technews.tw/feed/
Fetch article page using regular HTTP (feed does not include full text)Technology industry news
Liberty Times (LTN)
https://news.ltn.com.tw/rss/business.xml
Fetch article page using regular HTTPFinance news
For this batch, record: the number of unread items for each of the three sources.

Batch 5: International Financial News (CNBC)

Foreign news source to supplement international events that Taiwanese media have not covered or followed up on:
SourceList EndpointContent RetrievalFocus
CNBC Headlines
https://www.cnbc.com/id/100003114/device/rss/rss.html
Fetch article page using regular HTTPUS finance and cross-sector major events
Content from this batch can only be written to
overview_md
and used as background context for industry events
; do not create or support entries in
calls
and
stock_news
. When covering the same event as Taiwanese media, use the Taiwanese media version as the standard, following the cross-language deduplication rules in the "Deduplication" section.
For this batch, record: the number of items obtained and the number of unread items.
Global market dynamics (US stock closing, Fed movements, international events) are obtained from relevant reports by Taiwanese media and the foreign news in Batch 5. When there is overlap, the Taiwanese media version takes precedence.

Five-Batch Summary Table

After completing all five batches, compile a table covering all sources, with each row representing a source, the number of items obtained, and success/failure status. This table is a prerequisite for starting analysis; analysis cannot begin if any batch is missing.
Any missing entry in the summary table is considered not attempted, not "no news on the day"—go back to re-fetch that batch, or record it as a source failure and follow the diversion rules below according to the actual situation.

Source Success/Failure and Integrity Check

Record whether each source succeeded or failed in this execution. If any source fails, retry once (for TWSE, wait 60 seconds and retry according to the rate-limiting rules in Batch 2). If it still fails after retrying, handle it uniformly:
  • Proceed with analysis and publication as normal, using the content actually retrieved to compile the report. Failure of any single source will not stop the entire report from being published, including Cnyes—TWSE's major announcements include company symbols, monthly revenue is hard facts, and CTEE, CNA, etc., also cover Taiwan stocks. Losing any source reduces coverage density, but not the feasibility of the report. If Batch 5's foreign news (CNBC) fails, proceed with publication as normal: only the density of international context is lost, and international dynamics can still be obtained from Taiwanese media reports.
  • List each missing source and the reason for failure in the execution report, so operators know the coverage level for the day. This is for operators, not readers.
If a source succeeds but there are indeed no new articles within the time window, this is a normal situation and not considered a failure.
Previous closing price data follows the same diversion rules (failure also includes date verification failure): retry each source once; if it still fails, proceed with analysis and publication using only news context as normal, include the omission in the execution report; the report content must not mention the missing price data.
Collection mechanism not disclosed. Source lists, batch structure, which sources were missing on the day, whether coverage was thinner—these must never be written into
overview_md
or any
summary_md
. The report only presents news and analysis; do not disclose how we obtained data, nor expose weaknesses in coverage. Citation of individual articles in
sources
is not subject to this restriction, as this is normal source attribution.

Deduplication (seen.py)

The deduplication script is located at
skills/daily-brief/scripts/seen.py
, and is the only read/write entry for read records.
Collection Process: Steps 1 to 3 are run once within each batch—the "number of unread items" that the batch must submit is the result of Step 2; Steps 4 to 6 are performed during the analysis phase.
  1. Retrieve list page data (title, URL, native ID) from the batch's source, without downloading the content.
  2. Feed the candidates to
    seen.py peek
    , and only retrieve unread items.
  3. Download the content of unread articles.
  4. For articles with sufficient content length, use
    echo "content" | seen.py similar
    to check if they are rewritten reprints of processed articles. A similarity ≥ 0.5 is considered the same article; skip it.
  5. After analysis is complete, record all processed articles (including those determined not to be reported) using
    seen.py record
    . For articles determined not to be reported, set
    "decision": "skipped"
    to avoid re-evaluating the same noise tomorrow.
  6. For cross-day events, register them using
    seen.py event add 'symbol|event type|period'
    . Before writing individual stock details, check using
    seen.py event check
    ; for registered events, use continuation descriptions (e.g., "continues yesterday's revenue upside") instead of re-announcing.
Cross-language deduplication for Batch 5:
seen.py similar
only compares content in the same language, and cannot catch duplicates of "the same event, one in Chinese and one in English". Therefore, foreign news articles must undergo an additional step before analysis—compare each article event-by-event (company, event type, key figures) with Taiwanese media reports in the same window. If the event has already been reported by Taiwanese media, determine not to report it, record it with
seen.py record
and set
"decision": "skipped"
, using the Taiwanese media version as the standard; only events not reported by Taiwanese media can be used as material for
overview_md
or industry event background.
Note: If
event check
finds a registered event, it does not mean the stock cannot appear in calls. The report presents the judgment status for the day; it is normal for the same stock to be bullish for consecutive days. Event registration only affects the writing of individual stock details.

Previous Closing Price Reference Data

Simultaneously retrieve the previous trading day's market-wide closing prices during the collection phase, to be used as price context during analysis:
  • Listed Stocks:
    https://openapi.twse.com.tw/v1/exchangeReport/STOCK_DAY_ALL
  • OTC Stocks:
    https://www.tpex.org.tw/openapi/v1/tpex_mainboard_daily_close_quotes
A single regular HTTP request can retrieve the entire market for each. This TWSE request is included in the rate-limiting rules of Batch 2 (sequential execution with an interval of at least 5 seconds for the TWSE host); the OTC request is for a different host and is not subject to this rate-limiting restriction.
Date Verification: Both responses embed the trading date in Minguo calendar format in the
Date
field (e.g.,
1150814
corresponds to 2026-08-14). After converting to Gregorian calendar, it must equal the previous trading day in Taipei Time Zone; if the date is outdated, treat the source as a retrieval failure, do not use old prices, and do not reference prices without a date.
Record: The number of items obtained and the data date for each source, and include this in the collection completion report. Handle failures according to the diversion rules in "Source Success/Failure and Integrity Check" below.

2. Analyze Industry and Individual Stocks

Analysis is divided into two rounds: first the industry round, then the individual stock round. Each round uses the corresponding analyst perspective and has its own sorting criteria; the three sections of "Common Rules" apply to both rounds.

Common Rules

One-Sentence Headline

Each
industries[].events[]
and
stock_news[]
must have a non-blank
headline
. The headline must simultaneously state "what happened" and "why it is important or what impact it has", so readers can judge the key points without reading the content.
  • Do not use short phrases with only a topic, no event or impact, such as "memory supply and demand" or "capacity expansion".
  • Do not copy or rephrase the first sentence of
    summary_md
    with minor changes. The headline should first condense the event and its significance, and the content should then provide cause and effect, conditions, and details.
  • News in the same industry category should be merged into events by topic. One event covers a set of interrelated dynamics; do not split each source article into a separate event.
Specific positive and negative examples:
ObjectCorrectIncorrectReason for Error
Industry Event
Memory contract prices continue to rise; upstream product mix improves but module manufacturers face margin pressure
Memory supply and demand
Only a topic, no price change or industry chain impact
Individual Stock
New capacity to be put into operation ahead of schedule in Q4, expected to accelerate order digestion
Company announces new capacity will be put into operation in Q4
Rephrases the first sentence of the content, and does not state the importance of the event

Fundamental Reference Discipline

  • Revenue, EPS, gross margin, order amount, or other fundamental figures can only be referenced from public sources actually retrieved during this execution; do not fill in values based on model memory, past conversations, or common sense.
  • Each figure must clearly indicate the data period in the content, e.g., "July revenue", "2026 Q2 EPS", and include the actual source in the
    sources
    of the corresponding
    stock_news
    .
  • If current public data cannot be retrieved during this execution, omit the fundamental figures and related context, and only interpret based on verified news. Do not use old figures, estimates, or force-fit approximate values.

Entry Observation Focus

Each
industries
and
stock_news
entry must have a non-blank
watch_md
, listing 1–2 forward-looking observation points that can be verified afterwards using Markdown:
  • Industry observation points should link to supply and demand, price, or policy dynamics reported in each event of the category, such as the results of the next contract price announcement or the implementation of regulatory measures.
  • Individual stock observation points should link to the news referenced in the entry or fundamentals retrieved during this execution, such as the actual commissioning time of new capacity or whether the next period's revenue reflects orders.
  • Do not rewrite the content of
    watch_md
    into the
    summary_md
    of industry events or individual stocks, and do not use templated empty phrases without specific events, indicators, or time points, such as "continue to follow up on subsequent developments".

First Round: Industry

Process
industries
from the perspective of an industry analyst.

Sorting Criteria

Before writing, sort the industry news within the window by importance, comparing the following five items in order, with the previous item taking precedence:
  1. Actual changes in price and supply/demand — price increases/decreases, production cuts, inventory turning points, freight rate changes, which have altered the industry's profit and loss structure.
  2. Policy regulation to be enforced — tariffs, bans, new regulations, exogenous and applicable to the entire industry.
  3. Scope of impact — affecting the entire supply chain or multiple companies, greater than affecting only a single link.
  4. Sustainability — structural turning points (capacity cycles, technology generations) are greater than one-time events.
  5. Certainty — occurred facts > official outlook > institutional estimates > market rumors.
Sorting only determines which event leads, which is written in depth, and the order between events. Do not use it to filter inclusion—events ranked lower should still be written into the report, just with less focus. The rule of "no upper limit on quantity, list all that can be judged" is not affected by sorting.

Event Writing Method

Each
industries[].events[]
expresses a set of theme-related dynamics with an independent
headline
and
summary_md
. The event content does not repeat the headline; expand on changes, attribution, and impact distribution according to the tips below.
For example, if the headline is "Memory contract prices continue to rise; upstream product mix improves but module manufacturers face margin pressure", and the news states that the price increase comes from production cuts by original manufacturers, the content can be written as: "Production cuts by original manufacturers have returned channel inventories to healthy levels; continued rises in contract prices are beneficial for upstream manufacturers to improve product mix, but if downstream module manufacturers cannot pass on costs synchronously, their gross margins may face pressure." If the news does not state the driver, follow Tip 2 and write "driver unknown".

Industry Event Writing Tips

All four tips are bound by two guardrails: information can only come from news collected during this execution or data retrieved during this execution; omit the entire sentence if data is missing, do not rewrite it into a placeholder phrase like "magnitude to be observed" (the only exception is Tip 2).
  1. Start with the amount of change — write direction, magnitude, and period, not state descriptions like "market is booming". Magnitude and comparison basis are limited to those stated in the news (e.g., if the news writes "highest in nearly 45 months", use it as is), do not reference historical figures or seasonal common sense from memory. If the news does not provide a magnitude, rewrite it as specific facts for policy events: effective time and constrained objects.
  2. Attribute to supply side or demand side — the same price increase, supply contraction (production cuts) will end with resumption of production, while demand-driven increases are more sustainable; this is the basis for judging sustainability. If the news does not state which side the driver comes from, clearly write "driver unknown", do not infer the cause on your own—this is the only entry where explicitly stating missing data is allowed, because silence in attribution will be interpreted as implicit certainty.
  3. Write impact distribution — a change usually affects more than one party: who benefits, who faces pressure, who can pass on costs. For manufacturing, write about upstream, midstream, and downstream; for financial regulation, write about regulated objects and exempt objects; for real estate, write about buyers, sellers, and developers.
  4. Indicate cycle or structure — for events ranked higher and written in depth, the content should explain whether this is a cyclical fluctuation (e.g., freight rate rebound) or a change in the rules of the game (e.g., capacity relocation), corresponding to the sustainability judgment in Sorting Criterion 4.
Negative and positive examples (illustrative writing, not templates that can be directly copied):
TipNegative ExamplePositive Example
Start with the amount of changeMemory market demand is strongDRAM contract prices rose again this month, the largest monthly increase in nearly 45 months as stated in the news
Attribute to supply/demandPrice increases drive performanceThe news does not state whether the price increase is driven by production cuts or demand growth; driver unknown; if it is due to production cuts, price support will weaken after resumption of production
Write impact distributionThe entire industry benefitsUpstream improves product mix; module manufacturers face margin pressure if they cannot pass on costs synchronously
Indicate cycle or structureWorth observing in the futureThis is a price fluctuation within the capacity cycle, not a long-term change in supply structure

Fixed Four Industry Categories

industries
is a closed classification; only the following four names can be used. Each industry news related to Taiwan stocks must be classified into one category based on the main impact; do not add a fifth category, and do not allow the same dynamic to be repeated across categories.
CategoryCoverage Boundaries
TechnologySemiconductors, electronic components, computers and peripherals, network communications, software, telecommunications, and other electronic technology supply chains
FinanceBanking, insurance, securities, financial holding, payment, and financial regulation
Traditional IndustriesShipping, steel, chemicals, machinery, automobiles, food, retail, tourism, biotech and medical, and other non-technology manufacturing and service industries
Real EstateReal estate transactions, developers and construction, commercial real estate, housing policies; if the main subject of the news is suppliers such as cement or steel, classify into Traditional Industries
Cross-sector news is classified into only one category based on "the main affected demand or regulatory object". For example, a biotech company obtaining a US drug approval is classified into "Traditional Industries"; if a technology company purchasing land to build a factory focuses on capacity expansion, it is classified into "Technology"; if it focuses on the land market or development policies, it is classified into "Real Estate".
Each retained category must be split into
events
, with each event having its own
headline
and
summary_md
; do not retain empty event lists. After checking all sources for the day, if it is confirmed that there is no news in a category within the time window, the category can be omitted; do not leave empty entries or placeholders like "no news today", and do not omit directly due to missed checks.

Second Round: Individual Stocks

Process
calls
and
stock_news
from the perspective of an individual stock analyst.

Sorting Criteria

Before writing, sort the individual stock news within the window by importance, comparing the following five items in order, with the previous item taking precedence:
  1. Quantifiable profit impact — financial reports, monthly revenue, orders with specific amounts and delivery periods.
  2. Fact level — company announcements > company outlook > foreign institutional views > supply chain news > market rumors.
  3. Reflection time point — verifiable this quarter, greater than next year, greater than long-term vision.
  4. Change in competitive position — irreversible position shifts such as new customers, new markets, technological breakthroughs.
  5. Capital and chip dynamics — only used as supporting bonus points, cannot alone constitute importance.
Same as the industry round: sorting only affects detail, focus, and order; do not use it to filter inclusion. The same news can have different rankings in the two rounds, which is the purpose of dividing into two rounds of analysis.

Entry Writing Method

stock_news[].summary_md
should interpret the news in the context of the company's operations: which product, order, capacity, or cost the event affects, when it may be reflected, and explain the causal relationship supporting the call, expanding according to the tips below. Do not only list the event and bullish/bearish conclusion.
For example, when a company announces that new capacity will be put into operation in Q4, it should be written as "The impact of new capacity on existing order delivery and product mix; actual contribution must be confirmed by Q4 commissioning progress"; only when public data is actually retrieved during this execution can additional content like "July revenue increased year-over-year..., indicating current demand..." be added.

Individual Stock Entry Writing Tips

Also bound by two guardrails: information can only come from news collected during this execution or data retrieved during this execution; omit the entire sentence if data is missing, do not write placeholder phrases like "magnitude cannot be estimated".
  1. Judgment first — the first sentence of the content should state what judgment this news has changed, then go back to explain the event; do not narrate in chronological order. This sentence should be one level deeper than the
    headline
    : the headline gives the conclusion, the first sentence gives the mechanism or conditions. For entries with
    call: "none"
    , rewrite the first sentence to "why the direction cannot be judged", do not force a judgment for the sake of sentence structure.
  2. Magnitude conversion — amounts in the news are only meaningful when converted to relative magnitudes for the company, but only write this if the benchmark figures (revenue, capital, etc.) are actually retrieved during this execution. If not retrieved, only write the absolute amount stated in the news, omit the entire conversion sentence, and do not leave a placeholder.
  3. Expectation gap positioning — indicate whether this is new information or a continuation of what the market already knows; this is the core of bullish/bearish judgment. Only rely on expectations stated in the news itself (e.g., "better than institutional estimates") or cross-day events registered in
    seen.py event check
    ; if neither exists, do not write the expectation gap.
  4. Translate PR language —还原形容词 in press releases to facts: "deepen layout" or "strategic cooperation" without amounts and delivery periods are downgraded to intentions rather than orders. If there are figures, retain the strength of the figures, do not weaken them.
  5. Named attribution — write who said it as stated in the news: which foreign institution, target price adjusted from how much to how much. If the news only uses vague subjects like "foreign institutions" or "supply chain", retain the vagueness, do not fill in institution names on your own, and simultaneously lower the fact level by one level according to Sorting Criterion 2.
Negative and positive examples (illustrative writing, not templates that can be directly copied):
TipNegative ExamplePositive Example
Judgment firstCompany announces new capacity will be put into operation in Q4 todayOrder visibility is thus extended to the first half of next year; the key is whether new capacity is put into operation as scheduled in Q4
Judgment first (none)Company announces electric vehicle cooperationCooperation is only a memorandum, lacking amount and delivery period; insufficient basis to judge direction
Magnitude conversionSecured a large order, contributing significantlyOrder amount is 1 billion yuan, approximately 4% of last year's revenue retrieved during this execution
Expectation gapRevenue hit a new highRevenue hit a new high but the magnitude is equivalent to institutional estimates stated in the news, with limited incremental themes
Translate PR languageDeepen layout in AI fieldSigned a cooperation memorandum, not yet entered into a formal order with an amount
Named attributionForeign institutions are unanimously bullishThe news only refers to "foreign institutions" without naming them; this is an unnamed institutional view, with a lower fact level than company announcements

Individual Stock Bullish/Bearish Judgment

Judge the direction and time scale based on news within the day's time window. Stocks with no news on the day are not included; do not extend the previous day's judgment.
callJudgment
short_bull
Short-term bullish
short_bear
Short-term bearish
long_bull
Long-term bullish
long_bear
Long-term bearish
none
Major news exists, but insufficient basis to judge direction

Judgment Principles

  • No upper limit on quantity. List all that can be judged from the day's news.
  • No mandatory threshold. The execution model independently judges whether the news content is sufficient to give a direction.
  • Distinguish between occurred facts, company outlook, analyst views, and market rumors. Do not write rumors as confirmed facts.
  • calls
    and
    stock_news
    only include listed and OTC Taiwan stocks and their Taiwan stock symbols. International market dynamics and news of foreign listed companies are only written into
    overview_md
    ; even if related to Taiwan's supply chain, foreign symbols must not be included in
    calls
    or
    stock_news
    .
  • Foreign news articles in Batch 5 can only be used as material for
    overview_md
    and industry event background context; do not create or support any entries in
    calls
    and
    stock_news
    —even if foreign news directly mentions Taiwanese companies, individual stock-level analysis must still be based on Taiwanese media and TWSE sources.
  • Previous closing prices are only used as analysis context (judging whether upside has been reflected, as a benchmark for magnitude comparison) and as a source for report references. When citing previous closing prices, clearly indicate the price date (e.g., "previous close (8/14) 1,080 yuan"), and only use data retrieved during this execution and passed date verification. For stocks with no news within the window, even if the previous close rose or fell sharply, do not create entries in
    calls
    or
    stock_news
    ; price changes can at most be used as context in entries with existing news basis.

Calls Entry Rules

Each entry in the calls list must:
  • Use a single line, specific
    reason
    supported by news.
  • Have corresponding details with the same
    symbol
    in
    stock_news
    .
  • The corresponding
    stock_news
    lists at least one news source.
If an individual stock has major news but the direction is unclear, only create an entry with
call: "none"
in
stock_news
, do not include it in the four calls lists. Do not force a judgment to fill the fields; lists with no judgments can remain empty arrays.

3. Compose and Verify Report JSON

The output must comply with the following complete structure. Field names and types cannot be changed, and no additional fields can be added.
json
{
  "date": "2026-08-07",
  "headline": "US stocks closed red, pre-market sentiment is bullish; Bullish: TSMC",
  "overview_md": "Four major US stock indices closed red; SOX was driven by AI demand; Taiwan stock pre-market sentiment is bullish.",
  "watch_md": "- TSMC will announce July revenue after market close\n- US July CPI will be announced tonight\n- Observe foreign futures net short positions",
  "calls": {
    "short_bull": [
      {
        "symbol": "2330",
        "name": "TSMC",
        "reason": "2nm production ramps up ahead of schedule and foreign institutions raise target prices; short-term themes and capital dynamics turn bullish simultaneously."
      }
    ],
    "short_bear": [],
    "long_bull": [],
    "long_bear": []
  },
  "industries": [
    {
      "name": "Technology",
      "events": [
        {
          "headline": "2nm production ramps up ahead of schedule; demand for equipment and materials is expected to rise",
          "summary_md": "TSMC's advanced process schedule is ahead of plan; order visibility for related equipment and material suppliers is expected to improve."
        },
        {
          "headline": "AI accelerator repeat orders drive up packaging and testing utilization; upstream benefits directly",
          "summary_md": "Repeat orders for accelerators have increased packaging and testing capacity utilization; revenue momentum for advanced packaging and testing supply chains is more clear."
        }
      ],
      "watch_md": "- Track whether TSMC maintains the 2nm mass production schedule in its next earnings call\n- Observe whether packaging and testing companies' next month's revenue reflects repeat orders"
    }
  ],
  "stock_news": [
    {
      "symbol": "2330",
      "name": "TSMC",
      "call": "short_bull",
      "headline": "2nm production ramps up ahead of schedule and foreign institutions upgrade ratings; short-term themes and capital dynamics turn bullish simultaneously",
      "summary_md": "Supply chain sources report that 2nm production is ramping up ahead of schedule; multiple foreign institutions have raised target prices.",
      "watch_md": "- Track the 2nm mass production schedule announced in the company's next earnings call",
      "sources": [
        {
          "title": "TSMC's 2nm production reported to ramp up ahead of schedule",
          "url": "https://example.com/tsmc-2nm"
        }
      ]
    },
    {
      "symbol": "2317",
      "name": "Hon Hai",
      "call": "none",
      "headline": "Electric vehicle cooperation remains at memorandum stage; order visibility is insufficient to judge direction",
      "summary_md": "Announced an electric vehicle cooperation memorandum; short-term contribution and long-term formal orders are still unclear.",
      "watch_md": "- Track whether the cooperation memorandum is converted into a formal order with amount and delivery period",
      "sources": [
        {
          "title": "Hon Hai announces electric vehicle cooperation memorandum",
          "url": "https://example.com/hon-hai-ev"
        }
      ]
    }
  ],
  "generated_at": "2026-08-07T07:50:00+08:00"
}
Check item by item before submitting:
  • date
    is a valid
    YYYY-MM-DD
    date.
  • headline
    ,
    overview_md
    ,
    watch_md
    all have non-blank content.
  • calls
    exactly contains four arrays:
    short_bull
    ,
    short_bear
    ,
    long_bull
    ,
    long_bear
    .
  • stock_news[].call
    only uses the five values in the table.
  • industries[].name
    only uses "Technology", "Finance", "Traditional Industries", "Real Estate".
  • Each
    industries
    entry has at least one
    events
    event.
  • Each
    industries[].events[]
    has non-blank
    headline
    and
    summary_md
    .
  • Each
    stock_news[]
    has a non-blank
    headline
    .
  • Each
    industries
    and
    stock_news
    entry has 1–2 non-blank, verifiable observation points in
    watch_md
    that are not repeated in the
    summary_md
    of industry events or individual stocks.
  • calls
    and
    stock_news
    do not contain foreign listed companies or foreign symbols; only include listed and OTC Taiwan stocks.
  • Each
    symbol
    in calls entries can be found in
    stock_news
    .
  • Each calls entry has a one-line reason, and the corresponding
    stock_news
    has at least one source.
  • Each source has a non-blank URL.
  • Major news with unclear direction uses
    call: "none"
    and does not appear in the calls lists.
  • generated_at
    uses RFC 3339 format with time zone.
  • All figures, expectations, and attributions can be traced back to news or retrieval results from this execution; no memory-filled values; missing data is omitted entirely instead of using placeholder phrases (the only exception is "driver unknown" in industry events).
  • The five-batch summary table is complete: all five batches have counts, no missing items; if sources failed, the missing list is prepared for reporting (only included in the execution report, not in the report content).
  • Previous closing price retrieval has reported the number of items and data date; previous closing prices cited in the report all indicate the price date and come from data retrieved during this execution and passed date verification; no calls or stock_news entries are based solely on price changes.
  • The report content does not mention source lists, batch structure, or any source omissions.
  • Remember to use
    GET /api/report/{date}
    to confirm whether a report already exists for the current
    date
    before sending the POST in Step 4; if it exists, compare the number of industry entries and individual stock entries.
Write the final JSON to a temporary file for this task, e.g.,
report.json
. Do not publish official reports with fake URLs or sample content.

4. POST to Website API

Overwrite Comparison for Same-Day Re-runs

Re-publishing on the same date will fully overwrite the existing report. Before submitting, use the read-only endpoint to confirm whether a report already exists for the date:
bash
curl --silent --show-error \
  --output existing.json \
  --write-out '%{http_code}' \
  --header "Authorization: Bearer ${BRIEFAST_API_KEY}" \
  "${BRIEFAST_URL%/}/api/report/2026-08-07"
404
means no report exists for the day; proceed directly to the submission process.
200
means a report already exists; compare the number of
industries
entries and
stock_news
entries in
existing.json
and the current report:
  • If both are no less than the existing version: proceed with POST as per the process below, no additional confirmation needed.
  • If either is less than the existing version: stop, do not send POST. Explain why the content is less this time (e.g., a source failed, there were indeed few news items on the day), and wait for instructions before deciding whether to overwrite.
Less content is not necessarily wrong, but must be judged by a human; do not allow a degraded re-run to silently replace a more complete version.
401
means the key is invalid or revoked; handle it as per
401
in Step 4: stop, do not retry or change keys.

Submission

Compose the endpoint using values read from
.env
; do not hardcode URLs or keys:
bash
curl --silent --show-error \
  --output response.json \
  --write-out '%{http_code}' \
  --request POST \
  --header "Authorization: Bearer ${BRIEFAST_API_KEY}" \
  --header "Content-Type: application/json" \
  --data-binary @report.json \
  "${BRIEFAST_URL%/}/api/report"
Handle according to HTTP status:
  • 200
    : Confirm that the response is
    {"ok":true,"date":"current date"}
    , report successful publication.
  • 400
    : Considered a failure. Read and retain the complete response body; correct the payload according to
    errors
    and resend once. If the correction method cannot be determined or it still fails after correction, stop and report the response body verbatim.
  • 401
    : Considered a failure. Do not retry, do not guess or change keys; stop and attach the complete response body.
  • 5xx
    : Considered a failure. Retry once using the exact same payload; if it is still not 200 on the second try, stop and attach the last response body, and note the first and second statuses.
  • Other non-
    200
    : Considered a failure, do not retry, stop and attach the complete response body.
Do not report any non-200 status as successful publication. Do not change
date
or omit existing content before retrying.