@v587d/capital-generation 2.7.12 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +10 -6
  3. package/THIRD_PARTY_NOTICES.md +6 -1
  4. package/chart-ui/package.json +1 -1
  5. package/config/index.js +1 -0
  6. package/config/package.json +1 -1
  7. package/lib/agents/bash-guard.d.ts +22 -17
  8. package/lib/agents/bash-guard.js +32 -28
  9. package/lib/agents/root-tool-policy.d.ts +29 -3
  10. package/lib/agents/root-tool-policy.js +100 -14
  11. package/lib/data-collector/dataset-tools.js +9 -0
  12. package/lib/data-collector/tools.js +17 -5
  13. package/lib/index.d.ts +4 -0
  14. package/lib/index.js +27 -8
  15. package/lib/sources/ftshare-rest.d.ts +54 -0
  16. package/lib/sources/ftshare-rest.js +2363 -0
  17. package/lib/time/tools.js +24 -0
  18. package/lib/web-retriever/local-fetch.d.ts +1 -1
  19. package/lib/web-retriever/local-fetch.js +1 -1
  20. package/lib/web-retriever/wind-client.d.ts +1 -1
  21. package/lib/web-retriever/wind-client.js +1 -1
  22. package/package.json +1 -1
  23. package/preset/capital-generation/README.md +22 -15
  24. package/preset/capital-generation/agent.patch.yml +14 -1
  25. package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +4 -1
  26. package/selected-skills/InvestSkill/UPSTREAM.md +17 -0
  27. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/10k-digest/SKILL.md +10 -296
  28. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/10k-digest/references/10-retrieving-the-filing.md +130 -0
  29. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/10k-digest/references/11-key-metrics-table.md +129 -0
  30. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/10k-digest/references/12-language-mode.md +60 -0
  31. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/bear-case/SKILL.md +5 -3
  32. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/catalyst-calendar/SKILL.md +10 -284
  33. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/catalyst-calendar/references/10-persona.md +113 -0
  34. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/catalyst-calendar/references/11-section-c-company-specific.md +108 -0
  35. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/catalyst-calendar/references/12-section-f-90-day.md +85 -0
  36. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/SKILL.md +11 -433
  37. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/references/10-overview.md +82 -0
  38. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/references/11-porter-s-five-forces.md +137 -0
  39. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/references/12-innovation-disruption-assessment.md +112 -0
  40. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/references/13-input-formats.md +130 -0
  41. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/SKILL.md +12 -639
  42. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/references/10-analysis-framework.md +138 -0
  43. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/references/11-dividend-history-and-reliability.md +131 -0
  44. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/references/12-share-buyback-analysis.md +125 -0
  45. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/references/13-fcf-deployment-scorecard.md +133 -0
  46. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/references/14-output.md +149 -0
  47. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-call-analysis/SKILL.md +10 -411
  48. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-call-analysis/references/10-analysis-framework.md +194 -0
  49. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-call-analysis/references/11-data-sources.md +196 -0
  50. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-call-analysis/references/12-thesis-invalidation.md +43 -0
  51. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/SKILL.md +11 -234
  52. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/references/10-overview.md +86 -0
  53. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/references/11-phase-4-the-implied.md +60 -0
  54. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/references/12-output-format.md +83 -0
  55. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/references/13-standard-signal-output.md +34 -0
  56. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/economics-analysis/SKILL.md +10 -304
  57. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/economics-analysis/references/10-key-economic-indicators.md +98 -0
  58. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/economics-analysis/references/11-credit-market-indicators.md +114 -0
  59. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/economics-analysis/references/12-recession-probability-scoring.md +114 -0
  60. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/SKILL.md +11 -236
  61. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/references/10-overview.md +83 -0
  62. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/references/11-phase-5-overlap-with.md +69 -0
  63. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/references/12-output-format.md +79 -0
  64. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/references/13-standard-signal-output.md +34 -0
  65. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/SKILL.md +11 -243
  66. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/references/10-overview.md +61 -0
  67. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/references/11-phase-2-source-hierarchy.md +54 -0
  68. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/references/12-phase-5-consistency.md +90 -0
  69. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/references/13-notes.md +68 -0
  70. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/SKILL.md +11 -499
  71. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/references/10-overview.md +143 -0
  72. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/references/11-phase-3-financial-statement.md +167 -0
  73. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/references/12-phase-6-management-tone.md +176 -0
  74. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/references/13-thesis-invalidation.md +43 -0
  75. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/industry-map/SKILL.md +10 -291
  76. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/industry-map/references/10-overview.md +117 -0
  77. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/industry-map/references/11-step-3-position-locator.md +112 -0
  78. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/industry-map/references/12-visualization-support.md +84 -0
  79. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/insider-trading/SKILL.md +10 -457
  80. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/insider-trading/references/10-analysis-framework.md +185 -0
  81. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/insider-trading/references/11-pattern-recognition.md +175 -0
  82. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/insider-trading/references/12-interpretation-guidelines.md +120 -0
  83. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/SKILL.md +11 -503
  84. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/references/10-analysis-framework.md +132 -0
  85. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/references/11-ownership-concentration-analysis.md +166 -0
  86. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/references/12-red-flags-warning-signs.md +192 -0
  87. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/references/13-thesis-invalidation.md +43 -0
  88. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/SKILL.md +11 -264
  89. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/references/10-overview.md +63 -0
  90. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/references/11-phase-2-explanation-card.md +108 -0
  91. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/references/12-output-format.md +88 -0
  92. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/references/13-standard-signal-output.md +34 -0
  93. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/SKILL.md +11 -448
  94. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/references/10-analysis-framework.md +109 -0
  95. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/references/11-implied-volatility-iv-analysis.md +102 -0
  96. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/references/12-earnings-play-analysis.md +109 -0
  97. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/references/13-data-sources.md +159 -0
  98. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/SKILL.md +11 -435
  99. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/references/10-phase-1-portfolio-snapshot.md +124 -0
  100. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/references/11-phase-6-correlation-diversification.md +124 -0
  101. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/references/12-phase-9-rebalancing-decision.md +153 -0
  102. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/references/13-data-verification.md +62 -0
  103. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/SKILL.md +11 -372
  104. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/references/10-overview.md +102 -0
  105. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/references/11-phase-3-the-trim.md +88 -0
  106. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/references/12-phase-6-the-thesis.md +105 -0
  107. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/references/13-input-formats.md +105 -0
  108. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/risk-stress-test/SKILL.md +10 -250
  109. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/risk-stress-test/references/10-overview.md +92 -0
  110. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/risk-stress-test/references/11-phase-4-correlation-spike.md +116 -0
  111. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/risk-stress-test/references/12-notes.md +65 -0
  112. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/SKILL.md +11 -381
  113. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/references/10-sector-overview.md +123 -0
  114. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/references/11-sector-correlation-matrix.md +90 -0
  115. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/references/12-peer-benchmarking-within-sector.md +92 -0
  116. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/references/13-consumer-staples.md +105 -0
  117. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/short-interest/SKILL.md +10 -352
  118. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/short-interest/references/10-analysis-framework.md +110 -0
  119. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/short-interest/references/11-bearish-thesis-evaluation.md +118 -0
  120. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/short-interest/references/12-data-sources.md +148 -0
  121. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/SKILL.md +16 -603
  122. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/10-analysis-components.md +122 -0
  123. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/11-dupont-decomposition.md +121 -0
  124. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/12-quality-scoring-framework.md +115 -0
  125. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/13-dcf-framework.md +113 -0
  126. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/14-analyst-consensus-tracking.md +127 -0
  127. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/references/15-thesis-invalidation.md +43 -0
  128. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-screener/SKILL.md +5 -3
  129. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/SKILL.md +12 -595
  130. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/references/10-overview.md +133 -0
  131. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/references/11-method-2-comparable-company.md +127 -0
  132. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/references/12-football-field-summary-valuation.md +140 -0
  133. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/references/13-terminal-value-two-methods.md +121 -0
  134. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/references/14-when-dcf-is.md +110 -0
  135. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/SKILL.md +12 -304
  136. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/references/10-overview.md +73 -0
  137. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/references/11-phase-3-dividends-qualified.md +67 -0
  138. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/references/12-framework-non-us-module.md +61 -0
  139. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/references/13-scoring-tax-efficiency-score.md +83 -0
  140. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/references/14-thesis-invalidation.md +55 -0
  141. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/SKILL.md +16 -612
  142. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/10-chart-pattern-analysis.md +172 -0
  143. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/11-chart-visualization-support.md +181 -0
  144. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/12-multi-timeframe-analysis-mtf.md +95 -0
  145. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/13-advanced-indicators-ichimoku-cloud.md +61 -0
  146. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/14-options-flow-integration.md +95 -0
  147. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/references/15-thesis-invalidation.md +45 -0
  148. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/thesis-tracker/SKILL.md +10 -274
  149. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/thesis-tracker/references/10-overview.md +94 -0
  150. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/thesis-tracker/references/11-phase-5-the-pre.md +113 -0
  151. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/thesis-tracker/references/12-example.md +90 -0
  152. package/selected-skills/claude-for-financial-services-cn/vertical-plugins/china-finance/skills/china-catalyst-calendar/SKILL.md +5 -3
  153. package/selected-skills/claude-for-financial-services-cn/vertical-plugins/china-finance/skills/china-idea-generation/SKILL.md +5 -3
  154. package/selected-skills/claude-for-financial-services-cn/vertical-plugins/china-finance/skills/china-sector-overview/SKILL.md +5 -3
  155. package/selected-skills/investment-skills/skills/buffett-investment-framework/SKILL.md +1 -1
  156. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/SKILL.md +5 -3
  157. package/watchlist/package.json +1 -1
package/lib/time/tools.js CHANGED
@@ -67,6 +67,30 @@ const DATA_TIME_CONTRACTS = {
67
67
  maxDays: TEN_YEAR_DAYS,
68
68
  warning: '分钟档(m1/m5/m15/m30)区间上限 10 天,超出会在参数层被拒;adjust=qfq 时 end_date 不得晚于当日(afdate 由本能力锁成当日)',
69
69
  },
70
+ // FTShare 免费档那三条日度资金流:实测窗口只有最近约 45 个交易日(按真实交易日二分,T-45 有数、T-46 起 total=0)。
71
+ // ⛔ 这里刻意**不设 maxDays**:maxDays 会在参数层抛错,而这个窗口是每天都在往前滚的观测值,
72
+ // 写成天数常量等于造一个会腐烂的闸门(窗口变宽就误拒合法请求)。只给 warning 提示模型别循环重试。
73
+ ftshare_stock_daily_flow: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '上游只保留最近约 45 个交易日:早于窗口的日期返回 total=0,是合法空结果、不是取数失败,不要换日期循环重试' },
74
+ ftshare_industry_daily_flow: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '上游只保留最近约 45 个交易日:早于窗口的日期返回 total=0,是合法空结果、不是取数失败' },
75
+ ftshare_concept_daily_flow: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '上游只保留最近约 45 个交易日:早于窗口的日期返回 total=0,是合法空结果、不是取数失败' },
76
+ ftshare_main_capital_flow: { kind: 'date', fields: ['date'], warning: 'date 必须是交易日;省略时取上游最新切片(实测为当日 15:30 那一次)' },
77
+ ftshare_daily_kline_snapshot: { kind: 'date', fields: ['trade_date'], warning: 'trade_date 必须是**交易日**:非交易日会在参数层响亮失败(实测上游 400「trade_date 不是交易日」),未来交易日返回 total=0;当日截面收盘后即可取(实测 2026-10-15 15:51 打 20261015 已回 5565 行)' },
78
+ ftshare_prev_close: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '历史窗口起点实测在 2022-04(2016 / 2018 / 2020 / 2021 全年区间都回空数组、不报错);早年请用 history 或 tencent_kline' },
79
+ ftshare_trading_calendar: { kind: 'date_range', fields: ['start_date', 'end_date'] },
80
+ ftshare_block_trades: { kind: 'date', fields: ['date'], warning: 'date 必须是交易日;省略 = 上游最新有数的一天,**当日入库时刻不固定**(实测 2026-10-15 19:32 打 date=当天 total=0,同一晚 20:03 重打已有 80 行)——傍晚拿到当天为空先按「还没入库」理解,不是取数失败、不要循环重试。历史不连续:实测 2016-01-04(交易日历确认是交易日)整天为 0' },
81
+ ftshare_sw_industry_overview: { kind: 'date', fields: ['date'], warning: 'date 必填且必须是交易日(非交易日与未来日期回 total=0,合法空)。⛔ 窗口实测只到最近约 94 个交易日:2026-10-15 实测最早有数的是 2026-05-28,更早的交易日全部 total=0——那是窗口外,不要换日期重试;更早序列请用 ftshare_sw_industry_metrics' },
82
+ ftshare_sw_industry_metrics: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '最早一天实测 2021-05-31(更早区间回 total=0、不报错);start_date 晚于 end_date 也是静默空,本层已在参数层拒。⛔ 聚合列有断供:amount / total_mv / constituent_count / close_price / below_net_asset_count 与多数 *_quantile 实测自 2026-08-26 起为 null(2026-10-14 仍为 null,但 PE/PB/股息率有值),三级行业的 amount / index_close / 拥挤度恒为 null——null 不是 0,别补值也别循环重试' },
83
+ // 批次 D(2026-10-16 真报文)。⛔ `fields` 的顺序是有主的:resolve_data_time_range 把 period 写成
84
+ // fields[0] / fields[1],所以 date_range 必须是 [start, end],多出来的日期参数只能排在后面。
85
+ ftshare_limit_price: { kind: 'date_range', fields: ['start_date', 'end_date', 'date'], warning: '单票区间模式:start_date / end_date 必须与 code 一起给(实测只给区间不给标的 → 400「start_date/end_date 需配合 symbol 使用」),跨度不超过 3 年(实测 2020..2026 → 400)。全市场模式用 date(单日)。⛔ 混用 date 与区间上游 400;非交易日、未来日期与早于窗口的日期都只回 total=0、不报错(实测 600519.SH 2009 全年空、2010-01-04 起有数)' },
86
+ ftshare_dragon_tiger_seats: { kind: 'date', fields: ['date'], warning: 'date 必填且必须是交易日:上游本来允许省略(回"最新快照"),但响应行里**没有日期列**,所以这颗能力要求显式日期来写时间轴。实测非交易日 / 未来日期 / 早于窗口都回 data:null(合法空、不是失败);窗口起点实测在 2022-01-04(2021-12-31 及更早为空),分不清是滚动还是固定起点' },
87
+ ftshare_index_weight: { kind: 'date', fields: ['date'], warning: 'date 是**权重采集期**且必须精确命中:实测 2026-06-15 / 2026-09-30 各回该期,而 2026-10-01 / 2026-01-01 这种没有采集的日期 total=0(**不会**回退到最近一期);省略时取最新一期。请按数据里出现过的 collect_date 挑期,别按自然日猜' },
88
+ ftshare_convertible_bond_kline: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '⛔ 跨度上限是 12 个自然月,本层不换算成天数闸门(换算规则未核出):实测 364 天的区间正常、365 天被上游 400「日 K 及以上周期查询范围不能超过 12 个自然月」。start_date 晚于 end_date 在参数层拒(上游同样 400)。要更长序列请分段取,注意周/月/年档是按请求区间内日 K 聚合的,窗口没盖满周期那根不完整' },
89
+ // 批次 E(2026-10-16 真报文):利率族与财经日历。⛔ LPR 那颗**没有日期参数**(上游会静默忽略多发参数),所以不挂契约。
90
+ ftshare_chinabond_yield: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: 'start_date / end_date 必填。⛔ 三条曲线各自起点不同(实测同一 2002-2010 窗口内:国债 2006-03-01、中短期票据 2006-12-25、商业银行普通债 2009-12-24),早于某条曲线起点只是那一行缺席,是合法空、不是失败、不要按年份重试;起点是滚动还是固定未核出' },
91
+ ftshare_shibor: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: 'start_date / end_date 必填。历史起点实测在 2006-10-08(2006 全年 63 行、首行就是它;2006-01-01..06-30、07-01..09-30、1999 与 2004 全年都 0 行);周末、节假日与未发布日没有行,上游不插值也不前值填充,所以序列天然不连续' },
92
+ ftshare_hibor: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: 'start_date / end_date 必填。实测 2010 全年 249 行(首行 2010-01-04)、2000-01-01..2001-12-31 两年 0 行,起点是否滚动未核出;香港假日与未发布日没有行。⛔ m4 / m5 / m7..m11 七档实测整列为 null(HIBOR 只公布部分期限),null 不是 0,别补值' },
93
+ ftshare_financial_calendar: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '⛔ 单次窗上限是 3 天差(实测 4 天就 400「时间范围不能超过3天」,本层在参数层拒)——要更长区间请分段请求,本层不循环取。覆盖是**滚动窗**:实测 2026-08-03 / 09-01 / 09-15 / 10-05 / 10-12 / 10-19 / 10-26 各日都有事件(40 / 59 / 45 / 37 / 21 / 25 / 10 行),2026-11-02 与 11-16 / 12-01 / 2026-01-05 回空数组(total=0),2020 / 2023 / 2024 / 2025 里的整天直接回 data:null——边界随日期前移;两种空都是合法空,不要换日期重试' },
70
94
  };
71
95
  export function getDataTimeContract(capability) {
72
96
  const contract = DATA_TIME_CONTRACTS[capability];
@@ -6,7 +6,7 @@
6
6
  * between validation and connect. Closing that window would require a custom
7
7
  * dispatcher; this module keeps the same explicit trade-off as dsh-search-first.
8
8
  */
9
- export declare const LOCAL_FETCH_CLIENT_VERSION = "2.7.12";
9
+ export declare const LOCAL_FETCH_CLIENT_VERSION = "2.8.1";
10
10
  export declare const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
11
11
  export type LocalFetchErrorCode = 'ABORTED' | 'TIMEOUT' | 'INVALID_URL' | 'BLOCKED_URL' | 'DNS' | 'REDIRECT' | 'HTTP' | 'TOO_LARGE' | 'UNSUPPORTED_CONTENT_TYPE';
12
12
  export declare class LocalFetchError extends Error {
@@ -7,7 +7,7 @@
7
7
  * dispatcher; this module keeps the same explicit trade-off as dsh-search-first.
8
8
  */
9
9
  import { htmlToMarkdown, stripInvisibleText } from './html-markdown.js';
10
- export const LOCAL_FETCH_CLIENT_VERSION = '2.7.12';
10
+ export const LOCAL_FETCH_CLIENT_VERSION = '2.8.1';
11
11
  export const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
12
12
  export class LocalFetchError extends Error {
13
13
  code;
@@ -52,7 +52,7 @@ export interface WindCallResult {
52
52
  * `test/chart-composition.test.mjs` 守着(会因漂移而失败),这里原本是写死的第二处,
53
53
  * 一次发版就得记得改两遍。所以本常量由测试一并核对(见 `test/wind-client.test.mjs`)。
54
54
  */
55
- export declare const WIND_CLIENT_VERSION = "2.7.12";
55
+ export declare const WIND_CLIENT_VERSION = "2.8.1";
56
56
  export interface WindClient {
57
57
  callTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<WindCallResult>;
58
58
  }
@@ -35,7 +35,7 @@ export const WIND_SERVER_ENDPOINTS = {
35
35
  * `test/chart-composition.test.mjs` 守着(会因漂移而失败),这里原本是写死的第二处,
36
36
  * 一次发版就得记得改两遍。所以本常量由测试一并核对(见 `test/wind-client.test.mjs`)。
37
37
  */
38
- export const WIND_CLIENT_VERSION = '2.7.12';
38
+ export const WIND_CLIENT_VERSION = '2.8.1';
39
39
  function errorText(error) {
40
40
  return error instanceof Error ? error.message : String(error);
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-generation",
3
- "version": "2.7.12",
3
+ "version": "2.8.1",
4
4
  "description": "Capital Generation:面向中国散户的 AI 投资助手插件(Capital mode Agent Preset)",
5
5
  "icon": "assets/cg-icon.png",
6
6
  "author": "v587d",
@@ -120,33 +120,40 @@
120
120
  coding 工具;插件注册 `read_profile`(allow 里的名字必须先真实存在);更新 `AGENTS.md` 与 `docs/dev/data-roles.md`
121
121
  的角色边界与 `test/persona.test.mjs` 的预留期断言。
122
122
 
123
- ## 5.1 bash:为什么只给 data_junior,以及它到底能做什么
123
+ ## 5.1 shell 与文件口:开 read、保留 bash、不给写(2026-10-15 用户决策)
124
124
 
125
125
  - **动机**:`query_dataset` 只有 `count/min/max/avg/sum`,变化量 / 增幅 / CAGR / 比值这类派生
126
126
  指标没有宿主工具;模型只能拿 `time_facts.first/last` 心算——那正是 §1.3 那次 41,961 字符
127
127
  时间戳心算的同型浪费。所以给 data_junior 一个纯计算兜底。**不是**给它开取数通道。
128
- - **为什么主 Agent 不给**:主 Agent 今天没有任何通用执行 / 文件 / 网络工具(Web 平面把 host 层
129
- 的 `tool-bash` / `tool-fs` / `tool-web` 都 `disabled` 了,本 preset 也不挂回来)。这是一条
130
- 结构性事实,不是 persona 约定:主 Agent 唯一对用户说话、又会读到子 Agent 回传(含网页材料),
131
- 一旦拥有 bash 就等于拿到"注入 → 执行 → 读凭据 → 出网"的完整链路。收敛靠
132
- `ROOT_AGENT_DENIED_TOOLS`(含 `bash` / `pwsh`)。
128
+ - **2026-10-15 起主 Agent 也持有 shell 与 `read`**(用户决策「开 read、同时保留 bash」,推翻
129
+ 2026-09-30 的"主 Agent 不给 shell"):主 Agent 需要 `read` 读 skill 分册与工作区文件
130
+ (此前只能 `bash cat`,能力等价但绕远),shell 保留纯计算兜底。`ROOT_AGENT_DENIED_TOOLS`
131
+ 里的 `bash` / `pwsh` 随之移出,名单改为出图三件套 + 十三个出网工具 + `write` / `edit`。
132
+ - **文件写口不开**:`write` / `edit` 被两层拦住——根侧逐名收敛(主 Agent 视图层)+ 全局
133
+ `tools.guard()`(`registerFsWriteGuard`,调用期按 `composedPreset` 认领,fail-open,细节见
134
+ `docs/dev/bash-gate.md` §1.6)。理由:主 Agent 唯一对用户说话、又会读到子 Agent 回传(含网页
135
+ 材料),写文件等于给"注入 → 落盘 → 被别的环节读回"开口;业务落盘本来就有正路
136
+ (`store.writeContext` 等工具实现),模型手里的写口没有正当用途。通用 `subagent` 行的
137
+ `toolFilter.deny` 同步含 `read` / `write` / `edit`(通用 child 不得读 raw.json,原始 rows
138
+ 永不出工具层)。
133
139
  - **平台成对挂载**:Windows 上 host 层挂的是 `pwsh-sandbox`,没有 `bash-sandbox`;只挂
134
140
  `tool-bash` 会让名为 bash 的工具实际执行 PowerShell。所以两行互补 `disabled`,allow / deny
135
141
  里的名字用 `!!js` 三元表达式按平台选。`tools.restrict()` 对未注册名字报错,所以表达式与行必须
136
142
  同进同退(回归:`test/persona.test.mjs`「shell 行:平台成对挂载……」)。
137
143
  - **不给后台执行**:`enableRunInBackground: false`。本 preset 不挂 `tool-jobs`,开着后台只会让
138
144
  模型拿到一个永远读不回来的 jobId(`job_output` / `job_kill` 不在任何 allow 里)。
139
- - **闸门只有两层,且都不是安全边界**(`src/agents/bash-guard.ts`):
140
- ① 只对**被委派**子会话开放(镜像 `tool-exec.ts` 的 `delegatedSession`,执行层兜住可见性被改坏);
141
- ② 拦掉 `sandbox_permissions`——委派会话的审批策略由框架固定为 `never`,升级必然失败,而且模型
142
- 会收到「the user rejected…」这种把系统拒绝说成用户拒绝的文案。
143
- **刻意不解析 `command`**:本仓实测沙箱只拦写、不拦读(`~/.dsh/.credentials.yaml` 与
144
- `sessions/**` 整机可读)、不拦网络(`curl` 直连 200),而正则挡不住 `node -e` / `python3 -c`
145
- ——那正是引入 bash 的目的。禁区与出网纪律是 data_junior persona 的 `# BASH DISCIPLINE` 软约束。
146
- - **写边界收不窄**:`store.writeContext()` 用**调用方 session** 的 policy 且要求
145
+ - **shell 闸门只剩一层,且不是安全边界**(`src/agents/bash-guard.ts`):拦掉
146
+ `sandbox_permissions` / `justification`——被委派会话的审批策略由框架固定为 `never`,升级必然
147
+ 失败,而且模型会收到「the user rejected…」这种把系统拒绝说成用户拒绝的文案;被委派或身份
148
+ 不可考的调用方 fail closed。主 Agent 的升级走正常 ask 审批(2026-10-15 前的"只对被委派子会话
149
+ 开放"一层随决策移除,断言迁移见 `test/bash-guard.test.mjs`)。**刻意不解析 `command`**:本仓
150
+ 实测沙箱只拦写、不拦读(`~/.dsh/.credentials.yaml` 与 `sessions/**` 整机可读)、不拦网络
151
+ (`curl` 直连 200),而正则挡不住 `node -e` / `python3 -c`——那正是引入 bash 的目的。禁区与
152
+ 出网纪律是 data_junior persona 的 `# BASH DISCIPLINE` 软约束。
153
+ - **写边界收不窄到会话**:`store.writeContext()` 用**调用方 session** 的 policy 且要求
147
154
  `mode ∈ {workspace-write, danger-full-access}`,而 `describe_dataset` 会用 data_junior 的会话写
148
155
  `profile.json`;把它的会话钉成 `read-only` 会直接打断 describe_dataset。bash 与 Dataset 管线
149
- 共用同一把尺子(session policy)。
156
+ 共用同一把尺子(session policy),所以模型侧写口只能靠上一条的调用期闸门收。
150
157
  - **要真正收紧**只有两条路:换掉 `ctx.shell`(容器 / 微 VM / 远端执行器),或给 dsh 进程做出网
151
158
  限制。两者都不是 `ctx.sandbox` 能提供的。
152
159
 
@@ -45,6 +45,8 @@
45
45
  最终答:工具完成后再答,必须含结论、关键证据与来源标注、局限与风险;归因准确,给出观察 / 验证 / 防守选项;勿只报“已交付/已完成”。
46
46
 
47
47
  # RULES & DISCIPLINE
48
+ 读文件只用 read:只读 skill 分册与工作区文件;不读 capital-data/ 落盘(原始行走回传),不读 ~/.dsh/;
49
+ 分册整册读完才算读过。
48
50
  用户倾向与外界观点皆为待检验假设;发现造假、质押、现金流或流动性风险时如实说明并给边界,不制造恐慌。
49
51
  仅在有可复现模型或回测时报告胜率 / 盈亏比 / 概率,并披露区间、样本、费用、方法与失效条件;否则明确「无法可靠测算」。
50
52
  不索取凭据与不必要仓位信息;不保证收益或准确率;极端行情与数据延迟如实说明局限。
@@ -130,7 +132,7 @@
130
132
  不得冒充行情证据或补位缺失能力。不支持的频率如实披露,用已有粒度降级,不编造。
131
133
 
132
134
 
133
- # ── shell:只给 data_junior(主 Agent 由 root-tool-policy 在自己 scope 上 deny)──────
135
+ # ── shell:主 Agent 与 data_junior 共用(2026-10-15「开 read、同时保留 bash」)────
134
136
  # 边界、为什么不按命令内容 deny、平台门控:见同目录 README.md 的「bash」一节。
135
137
  - id: tool-bash
136
138
  name: '@deepseek-ai/dsh-tool-bash'
@@ -145,6 +147,12 @@
145
147
  config:
146
148
  enableRunInBackground: false
147
149
 
150
+ # ── 文件口:read 开给主 Agent 读 skill 分册 / 工作区文件(2026-10-15 用户决策)────
151
+ # `tool-fs` 一颗挂 read / write / edit:write / edit 由根侧收敛 + 全局写口闸门拦
152
+ # (src/agents/root-tool-policy.ts),落盘只走工具实现;tool-fs-search 本轮不挂。
153
+ - id: tool-fs
154
+ name: '@deepseek-ai/dsh-tool-fs'
155
+
148
156
  - id: tool-subagent-data-collector
149
157
  name: '@deepseek-ai/dsh-tool-subagent'
150
158
  config:
@@ -418,6 +426,11 @@
418
426
  toolFilter:
419
427
  deny:
420
428
  - !!js "process.platform === 'win32' ? 'pwsh' : 'bash'"
429
+ # 文件口全关:通用 child 不得读 raw.json(原始 rows 永不出工具层)也不得写;
430
+ # read_image 刻意不点名(条件注册,名字不在 = 创建子 Agent 失败,且它只读)。
431
+ - read
432
+ - write
433
+ - edit
421
434
  - render_chart
422
435
  - prepare_chart_source
423
436
  - describe_dataset
@@ -59,7 +59,7 @@ description: Use when composing or reading a Capital data message — data_reque
59
59
  | 步 | 工具 | 得到什么 | 调用纪律 |
60
60
  |----|------|----------|----------|
61
61
  | ① | `list_capabilities()` | 纯文本能力目录:**一行一条** `capability\|summary\|paginated`(1=分页、0=不分页) | **一个任务只调一次**;目录已在本 session 历史里,重复调用只会白占上下文 |
62
- | ② | `describe_capability({ capability })` | 该能力的完整 `description` / `input_schema` / `output_fields`(逐行字段字典) | 一次只传**一个**名字、**不传逗号**;同一个能力描述一次即可;要几个能力就分别调用几次 |
62
+ | ② | `describe_capability({ capability })` | 该能力的完整 `description` / `input_schema` / `output_fields`(逐行字段字典) | 一次只传**一个**名字、**不传逗号**;同一个能力描述一次即可;要几个能力就在**同一条消息里一次发出多个调用**(纯读、可并发),不要一份一份等 |
63
63
 
64
64
  - 读目录时**按行切**:一行就是一条能力,取第一个 `|` 前面的部分当 `capability` 原样复制;摘要里出现的
65
65
  `\|`、`\n` 是转义字符,不是分隔符。
@@ -69,6 +69,9 @@ description: Use when composing or reading a Capital data message — data_reque
69
69
  - 目录刻意不含参数与输出结构:全量 schema 约 23KB,会被工具结果剪枝器(阈值 8192)截断中间
70
70
  部分,导致排在中间的能力在发现阶段不可见。目录只负责"选哪个",详情负责"怎么填"。
71
71
  - **一个任务只调一次 `list_capabilities`**;**同一个能力只描述一次**,重复调用只会白占上下文。
72
+ - `list_capabilities` 与 `describe_capability` 都是**纯读**:本轮要看几个能力,就在**同一条消息里一次发出
73
+ 这几个 `describe_capability` 调用**,它们在框架并发池里并行执行、在同一个下一步一起返回;一份一份等
74
+ 等于把一次往返付成 N 次。这不改变上一条"每个能力只描述一次",也不改变"一次只传一个名字"。
72
75
  - 不查 `input_schema` 就填 `params` 属于违规;`params` 的取值与约束一律以 `describe_capability` 为准。
73
76
 
74
77
  `describe_capability` 的错误按 code 处置,不要盲目重试:
@@ -60,6 +60,23 @@
60
60
  - Maintenance snapshot(checked 2026-10-10):251 次提交;近 90 天 47 次非机器人提交、近 180 天 111 次;
61
61
  最新 release `v1.12.0`(2026-09-25)。维护活跃,因此标 `experimental`。
62
62
  See [GitHub commit history](https://github.com/yennanliu/InvestSkill/commits/main/).
63
+ - Visibility layering, second batch (2026-10-15, same §8.6 reason): the remaining **25** catalogued entries in this
64
+ snapshot were single-file bodies of 15,437–31,754 characters — every one of them arrived as a truncated excerpt
65
+ (head 4,096 + tail 1,024) once a user ticked it. All 25 are now entry file plus parts under `skills/<name>/references/`:
66
+ the entry keeps only what holds on every round (`⚠️ Data Verification`, `📋 Data & Sources Header`, and
67
+ `⚠️ Read This First` where upstream wrote one), gains an index of the part filenames, and states that loading the
68
+ entry is not reading the skill. Everything else moves **in section order** into `references/10…`, splitting a
69
+ section that still overflows at `###`, then `####`, then blank-line paragraphs — and a section cut across two parts
70
+ gets a one-line pointer at the cut (`This section is not finished here: … continues in references/NN-….md`), which
71
+ is why prose like "the following sections" still lands: across the whole batch exactly **one** real dangling pointer
72
+ had to be rewritten (`learning-coach`: "the quiz block from §4" → the part that now holds §4). Nothing was deleted —
73
+ a line-set check per entry found zero lost lines apart from that rewrite, and each directory's `.md` total grew
74
+ (e.g. `stock-eval` 31,754 → 34,135, `earnings-call-analysis` 15,437 → 16,873; 98 new parts in total). Sizes are judged
75
+ on the **rendered** `read` receipt, with the part header itself reserved inside the envelope. Two upstream quirks are
76
+ deliberately left alone: `institutional-ownership` mentions "the smart-money list above" that upstream never defines,
77
+ and `fact-check`'s example table cites `§1…§5` of **the report being verified**, not of this skill — neither is a
78
+ layering artefact. `test/selected-skills-content.test.mjs` (LAYERED, now 32 entries) and the ratchet in
79
+ `test/persona.test.mjs` (baseline emptied, so any future oversized entry fails outright) hold the result.
63
80
  - Visibility layering (2026-10-14, third allowed reason in `docs/dev/selected-skills.md` §8.6): `bear-case` and `stock-screener` had a single `SKILL.md` over the host load cap (8,192 code points; the middle of a longer tool result comes back as `[... tool result middle pruned ...]`). Each is now an entry file plus parts under `skills/<name>/references/`: `bear-case` 13,816 → 15,218 characters with `10-analysis-framework.md`, `11-output-and-signal.md`, `12-thesis-invalidation.md`; `stock-screener` 11,588 → 12,961 with `10-scoring-framework.md`, `11-output-format.md`, `12-invalidation-and-signal.md`. The entry keeps its per-round discipline sections (Data Verification, the Data & Sources header, Read This First / Accepted Inputs) and gains an index of the parts plus a line saying that loading the entry is not reading the skill. No line of upstream text was deleted: a line-set check against this commit found only the rewritten pointer lines, plus two cross-file pointers fixed (`pillars 1–7 above` → the file that now holds them, and the same for `The Score above`). MIT, so no per-file licence notice is required. Sizes are judged on the **rendered** `read` receipt (each line gains an `N: ` prefix), not on file characters — see `test/selected-skills-content.test.mjs`.
64
81
  - Runtime status: `experimental` / 显式实验。默认全关,只在使用者于「插件」→ Capital Generation →「配置」
65
82
  逐格打开后,对**之后新建**的 Capital 根 Agent 可见;子 Agent 不继承。
@@ -37,302 +37,16 @@ Data & Sources
37
37
 
38
38
  Produce a clean, structured markdown document that distills a company's 10-K annual report into an abstract, per-section summaries, a digest of key metrics, and full source references. Designed for quick comprehension — not trading signals. Output language is selectable: English or Traditional Chinese (繁體中文).
39
39
 
40
- ## 🔎 Retrieving the Filing — the Keyless EDGAR Path
40
+ ## Read the Parts
41
41
 
42
- This skill fetches nothing by itself. When the user gives only a ticker, obtain the 10-K in one of three ways and record which one in the `Data & Sources` header:
42
+ Everything below the surface of this file lives in `references/`. **whole, with no line window** — quoting a rule or a template out of a slice of one is how a
43
+ file gets reported as read when it was only skimmed. The file names below are the only
44
+ addressing this entry has.
43
45
 
44
- **A. Retrieval through the host (the normal path)** → `Retrieval: delegated retrieval`. In a role-split host, delegate the fetch to the agent that owns web retrieval — this step never searches from the analysis role itself. Every step is free and needs no API key:
46
+ - `references/10-retrieving-the-filing.md` — 🔎 Retrieving the Filing — the Keyless EDGAR Path; How to Use; Output Document Structure
47
+ - `references/11-key-metrics-table.md` — (continued) Output Document Structure; References
48
+ - `references/12-language-mode.md` — Language Mode; File Output; Thesis Invalidation
45
49
 
46
- 1. **Ticker → CIK** — `https://www.sec.gov/files/company_tickers.json`: find the entry whose `ticker` matches (write `BRK-B` for `BRK.B`) and zero-pad its `cik_str` to 10 digits.
47
- 2. **Filings index** — `https://data.sec.gov/submissions/CIK##########.json`: inside `filings.recent` the arrays `form`, `filingDate`, `reportDate`, `accessionNumber` and `primaryDocument` are aligned by index. Take the newest row whose `form` is `10-K` (foreign private issuers file `20-F` instead; a `10-K/A` is an amendment). The top-level `fiscalYearEnd` is `MMDD`.
48
- 3. **The document** — `https://www.sec.gov/Archives/edgar/data/<CIK without leading zeros>/<accessionNumber without dashes>/<primaryDocument>`: the complete filing as HTML (inline XBRL). The filing's index page is the same folder plus `<accessionNumber>-index.htm`; cite that URL and the accession number in the References.
49
- 4. **Structured statement data (optional)** — `https://data.sec.gov/api/xbrl/companyfacts/CIK##########.json`: every US-GAAP fact the company has tagged, by concept and period. Use it to confirm the figures read from Item 8.
50
- 5. **Full-text search (optional)** — `https://www.sec.gov/edgar/search/#/q=%22<phrase>%22&forms=10-K` when a filing has to be located by phrase rather than ticker.
51
-
52
- Send a `User-Agent` header that identifies the requester (the SEC requires it, e.g. `Name email@example.com`) and stay under 10 requests per second. Never substitute a summary site for the filing itself.
53
-
54
- **B. Only if the host has no retrieval path at all** → `Retrieval: pasted by user`. Ask the user for the sections needed. The repository's own fetch helpers are optional, keyless, and live outside this plugin — they are never run from here.
55
-
56
- **C. Neither** → show the ⚠️ *Source unavailable* warning and digest only what the user provided. What is absent stays absent: no accession number, figure or date is filled in from memory.
57
-
58
- ---
59
-
60
- ## How to Use
61
-
62
- ```
63
- # Analyze by ticker (retrieves the latest 10-K via the EDGAR path above, or asks you to paste it)
64
- /10k-digest AAPL
65
-
66
- # Paste 10-K text directly
67
- /10k-digest [paste 10-K sections here]
68
-
69
- # Specify fiscal year
70
- /10k-digest MSFT FY2024
71
-
72
- # Output in Traditional Chinese
73
- /10k-digest NVDA --lang zh-TW
74
-
75
- # Save output to file
76
- /10k-digest GOOGL --output googl-10k-digest.md
77
- ```
78
-
79
- ---
80
-
81
- ## Output Document Structure
82
-
83
- The skill produces a single markdown document with the following sections in order.
84
-
85
- ---
86
-
87
- ### 1. Cover Block
88
-
89
- ```
90
- # [Company Name] ([TICKER]) — 10-K Digest
91
- **Fiscal Year:** [FY20XX ending MM/DD/YYYY]
92
- **Filed:** [Filing date]
93
- **Source:** SEC EDGAR — [Direct URL to filing]
94
- **Prepared:** [Today's date]
95
- **Language:** English | 繁體中文
96
- ```
97
-
98
- ---
99
-
100
- ### 2. Abstract
101
-
102
- A 3–5 sentence executive summary of the entire 10-K. Cover:
103
- - What the company does (core business in one sentence)
104
- - Year-over-year financial performance headline (revenue, profit, FCF)
105
- - The single most important strategic development disclosed in this filing
106
- - The most material risk disclosed
107
- - Overall filing tone (transparent / cautious / optimistic)
108
-
109
- ---
110
-
111
- ### 3. Section Summaries
112
-
113
- Summarize each major 10-K section. For each section, write 2–4 sentences capturing the substance — not just restating headings.
114
-
115
- #### 3.1 Business Overview (Item 1)
116
- - Core products/services and revenue model
117
- - Key markets and customer segments
118
- - Significant changes to business described in this filing (new products, acquisitions, divestitures)
119
-
120
- #### 3.2 Risk Factors (Item 1A)
121
- - Total number of risk factors disclosed
122
- - Top 3 risks by disclosure prominence (listed first, given most space, or new this year)
123
- - Any risks added or removed vs. prior filing (state "N/A if prior not available")
124
- - One-line assessment: are risks standard boilerplate or specific and material?
125
-
126
- #### 3.3 Selected Financial Data / Properties (Items 1B–2)
127
- - Key quantitative highlights from Selected Financial Data if present
128
- - Material properties or facilities disclosed
129
-
130
- #### 3.4 Management's Discussion & Analysis — MD&A (Item 7)
131
- - Revenue: total and YoY growth; organic vs. inorganic split if stated
132
- - Gross margin and operating margin trend
133
- - Management's stated explanation for performance changes
134
- - Forward-looking statements: what management guided or projected
135
- - Liquidity summary: cash position, debt level, upcoming maturities
136
-
137
- #### 3.5 Financial Statements (Items 8)
138
- - Revenue, net income, EPS (GAAP) — current year vs. prior year
139
- - Operating cash flow and free cash flow (OCF minus capex)
140
- - Total assets, total debt, shareholders' equity
141
- - Auditor name and opinion type (unqualified / qualified / adverse)
142
- - Any restatements or material changes in accounting policy noted
143
-
144
- #### 3.6 Quantitative Disclosures about Market Risk (Item 7A)
145
- - Primary market risks disclosed (interest rate, FX, commodity)
146
- - Sensitivity disclosures if provided (e.g., "1% rate rise = $X impact")
147
-
148
- #### 3.7 Controls and Procedures (Item 9A)
149
- - Management's conclusion on effectiveness of internal controls
150
- - Any material weaknesses or significant deficiencies disclosed
151
-
152
- #### 3.8 Legal Proceedings (Item 3)
153
- - Active material litigation or regulatory matters
154
- - Estimated financial exposure if disclosed
155
-
156
- #### 3.9 Executive Compensation & Governance (Items 10–13, from Proxy if incorporated)
157
- - CEO/CFO compensation summary
158
- - Board composition notes (independence, tenure)
159
- - Any significant governance changes
160
-
161
- ---
162
-
163
- ### 4. Key Metrics Table
164
-
165
- Provide a concise metrics table drawn directly from the financial statements. Use exact figures from the filing; do not estimate.
166
-
167
- ```
168
- | Metric | Current FY | Prior FY | YoY Change |
169
- |---------------------------|-----------------|-----------------|------------|
170
- | Revenue | $X.XX B | $X.XX B | +X.X% |
171
- | Gross Profit | $X.XX B | $X.XX B | +X.X% |
172
- | Gross Margin % | XX.X% | XX.X% | +X bps |
173
- | Operating Income | $X.XX B | $X.XX B | |
174
- | Operating Margin % | XX.X% | XX.X% | |
175
- | Net Income (GAAP) | $X.XX B | $X.XX B | |
176
- | EPS Diluted (GAAP) | $X.XX | $X.XX | |
177
- | Operating Cash Flow | $X.XX B | $X.XX B | |
178
- | Capital Expenditures | $X.XX B | $X.XX B | |
179
- | Free Cash Flow | $X.XX B | $X.XX B | |
180
- | Cash & Equivalents | $X.XX B | $X.XX B | |
181
- | Total Debt | $X.XX B | $X.XX B | |
182
- | Net Debt / (Net Cash) | $X.XX B | $X.XX B | |
183
- | Shares Outstanding (dil.) | X.XX B | X.XX B | |
184
- ```
185
-
186
- Note below the table: data source (filing section and page number if available).
187
-
188
- ---
189
-
190
- ### 5. Highlights & Concerns
191
-
192
- Two short lists that give the reader the "so what" without leaving the digest. Draw every item directly from the filing and cite the source Item.
193
-
194
- **Highlights** — up to 5 of the strongest positives disclosed this year (e.g., record revenue, margin expansion, new products/segments, strong FCF conversion, new buyback authorization, market-share gains). Format: `- **[Headline]** — [one sentence] *(Item X)*`
195
-
196
- **Concerns** — up to 5 of the most material negatives or warning signs (e.g., decelerating growth, margin compression, rising leverage, customer/supplier concentration, new risk factors, active litigation, going-concern language). Format: `- **[Headline]** — [one sentence] *(Item X)*`
197
-
198
- ---
199
-
200
- ### 6. Management Outlook & Forward Guidance
201
-
202
- Capture every forward-looking commitment made in the filing. Present as a table.
203
-
204
- ```
205
- | Guidance Item | What Management Said | Time Horizon | Source |
206
- |----------------------------|-------------------------------------|--------------|------------|
207
- | Revenue growth | [target / range / directional] | [FY / multi] | Item 7 |
208
- | Margin target | [gross / operating target] | [horizon] | Item 7 |
209
- | Capex / capacity | [planned spend or expansion] | [horizon] | Item 7 |
210
- | Capital allocation | [dividend / buyback / debt / M&A] | [horizon] | Item 7/8 |
211
- | Strategic priorities | [product roadmap, new markets] | [horizon] | Item 1/7 |
212
- ```
213
-
214
- Only include rows the filing actually addresses. If the 10-K gives no explicit guidance (common — 10-Ks are backward-looking), state that and summarize any qualitative forward statements instead.
215
-
216
- ---
217
-
218
- ### 7. Prior-Year Promise Tracker
219
-
220
- An accountability audit: take the forward-looking statements, targets, and stated priorities from **last year's** 10-K (Item 7 MD&A) and score whether they materialized in this year's results. This is the single most differentiating part of the digest — it measures management credibility over time.
221
-
222
- ```
223
- | Prior-Year Commitment (FY[N-1] 10-K) | FY[N] Actual Result | Verdict | Notes |
224
- |-----------------------------------------|------------------------------|-------------|------------------|
225
- | [what management said they would do] | [what actually happened] | ✅ Delivered | [brief context] |
226
- | [e.g., "expand operating margin"] | [e.g., "margin +120 bps"] | 🟡 Partial | [brief context] |
227
- | [e.g., "launch product X in H2"] | [e.g., "slipped to next FY"] | ❌ Missed | [brief context] |
228
- ```
229
-
230
- Verdict legend: ✅ Delivered · 🟡 Partial · ❌ Missed · ⏳ Too early to judge.
231
-
232
- Close with a one-line **Management Credibility read**: e.g., "4/5 prior commitments delivered — high follow-through." If the prior-year 10-K is unavailable, state `N/A — prior filing not retrieved` and skip the table.
233
-
234
- ---
235
-
236
- ### 8. Bull vs. Bear Synthesis
237
-
238
- A lightweight face-off built strictly from evidence in this filing — not a full valuation call (defer to `bear-case`, `stock-eval`, and `stock-valuation` for that).
239
-
240
- **Bull case** — 3–4 strongest points from this filing supporting the stock.
241
-
242
- **Bear case** — 3–4 strongest points from this filing arguing against it.
243
-
244
- **Net read** — one sentence weighing the two, consistent with the Investment Signal below.
245
-
246
- ---
247
-
248
- ### 9. Notable Disclosures
249
-
250
- Bullet list of up to 8 items that are worth investor attention but don't fit neatly into section summaries:
251
- - New segment or business unit disclosures
252
- - Changes in accounting estimates or policies
253
- - Related party transactions
254
- - Auditor changes
255
- - Going concern language (if any)
256
- - New share repurchase authorizations or dividend changes
257
- - Material acquisitions or divestitures announced
258
- - Specific named customers or suppliers with concentration risk
259
-
260
- ---
261
-
262
- ### 10. Source References
263
-
264
- List all sources cited in this digest. Format:
265
-
266
- ```
267
- ## References
268
-
269
- 1. **SEC EDGAR Filing** — [Company] 10-K, FY[XXXX]
270
- URL: https://www.sec.gov/cgi-bin/browse-edgar?...
271
- Filed: [Date] | Accession No.: [XXXXXXXXXX-XX-XXXXXX]
272
-
273
- 2. **Item 1 — Business** (pp. X–X of filing)
274
- 3. **Item 1A — Risk Factors** (pp. X–X of filing)
275
- 4. **Item 7 — MD&A** (pp. X–X of filing)
276
- 5. **Item 8 — Financial Statements** (pp. X–X of filing)
277
- 6. **Item 9A — Controls and Procedures** (pp. X–X of filing)
278
- 7. **Exhibit 13 / Annual Report to Shareholders** (if incorporated by reference)
279
- 8. [Any additional sources used, e.g. earnings press release, investor presentation]
280
- ```
281
-
282
- If page numbers are unavailable (e.g., pasted text), reference by Item number and section heading.
283
-
284
- ---
285
-
286
- ## Language Mode
287
-
288
- When `--lang zh-TW` is specified, output the **entire document** in Traditional Chinese (繁體中文), including:
289
- - All section headings translated
290
- - All narrative summaries written in Traditional Chinese
291
- - All tables with Chinese column headers
292
- - Cover block language field: `語言:繁體中文`
293
- - Keep ticker symbols, financial figures, and SEC item numbers in their original form
294
-
295
- Suggested Traditional Chinese headings for the interpretation sections: 亮點與隱憂 (Highlights & Concerns), 管理層展望 (Management Outlook & Forward Guidance), 上年度承諾兌現 (Prior-Year Promise Tracker), 多空對決 (Bull vs. Bear Synthesis).
296
-
297
- English mode is the default when no `--lang` flag is given.
298
-
299
- ---
300
-
301
- ## File Output
302
-
303
- When `--output <filename>` is specified:
304
- - Save the digest as a markdown file at the specified path
305
- - If no path separator is present, save in the current directory
306
- - Confirm the file path after saving: `✓ Digest saved to: <path>`
307
- - Default filename if `--output` flag is present without a name: `<TICKER>-10k-digest.md`
308
-
309
- ---
310
-
311
- ## Thesis Invalidation
312
-
313
- After delivering the digest, note what would make this document stale:
314
-
315
- **Re-run this digest when:**
316
- - [ ] Company files next 10-K or 10-K/A amendment
317
- - [ ] Material 8-K filed disclosing a restatement or auditor change
318
- - [ ] 12 months have elapsed since the filing date
319
-
320
- ```
321
- ╔══════════════════════════════════════════════╗
322
- ║ INVESTMENT SIGNAL ║
323
- ╠══════════════════════════════════════════════╣
324
- ║ Signal: BULLISH / NEUTRAL / BEARISH ║
325
- ║ Confidence: HIGH / MEDIUM / LOW ║
326
- ║ Horizon: SHORT / MEDIUM / LONG-TERM ║
327
- ║ Score: X.X / 10 ║
328
- ╠══════════════════════════════════════════════╣
329
- ║ Action: BUY / HOLD / SELL ║
330
- ║ Conviction: STRONG / MODERATE / WEAK ║
331
- ╚══════════════════════════════════════════════╝
332
- ```
333
-
334
- Score Guide: 8.0–10.0 Strongly Bullish | 6.0–7.9 Moderately Bullish | 4.0–5.9 Neutral | 2.0–3.9 Moderately Bearish | 0.0–1.9 Strongly Bearish
335
- Confidence: HIGH (strong data, clear signals) | MEDIUM (mixed signals) | LOW (limited data, conflicting signals)
336
- Horizon: SHORT-TERM (1 week–3 months) | MEDIUM-TERM (3 months–1 year) | LONG-TERM (1+ years)
337
-
338
- **Disclaimer:** Educational analysis only. Not financial advice.
50
+ Loading this file is not reading the skill: the steps, templates, and thresholds exist only
51
+ in the parts above. Say which parts you opened, name the ones you did not, and never report a
52
+ step or a template you have not read in this session.