quarterly-profit-chart
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "quarterly-profit-chart" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-aafa75d51685491590231969fe836a1373c13cd471230c2ddd7c91b02037b424. Verify the upstream source and version against https://skillhub.cn/skills/user_ece50f06/stockearningchart before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Generate a dual‑axis quarterly chart showing a stock's adjusted price and single‑quarter net profit, with auto‑generated Chinese analysis. Intended for user requests to visualize a stock's quarterly price and profit trends (e.g., “plot XX quarterly price and net profit,” “compare XX price and profit”). Uses Tencent Custom Stocks data source and covers A‑shares, HK‑shares, and US stocks.
Introduction source: third_party · user_ece50f06 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: quarterly-profit-chart
description: "Generate a quarterly dual-axis chart of a stock's post-adjustment price versus its single-quarter net profit, with auto-generated Chinese analysis. Use when a user asks to visualize a stock's quarterly price and profit trend, e.g. '画一下XX的季度股价和净利润图', '对比XX股价和利润', 'XX季度业绩趋势', or any request to chart a company's quarterly share price against its earnings. Works for A-share / HK / US stocks covered by the Tencent self-selected stock data source."
agent_created: trueQuarterly Profit Chart(季度股价 vs 单季净利润对比图)
Overview
Given a stock (by name or code), produce a self-contained HTML report containing:
- A dual-axis chart: blue bars = single-quarter net profit attributable to parent (left axis, in 亿元), red line = post-adjustment (后复权) closing price (right axis, in 元), plus a sub-chart green line = single-quarter net profit YoY growth (%).
- A data-driven Chinese analysis section (key metrics + trend interpretation).
The chart is pure inline SVG (no CDN dependency), so it renders offline and is easy to save.
When to Use
- "画一下海康威视的季度股价和净利润图"
- "对比比亚迪的股价和利润趋势"
- "XX 季度业绩走势 / 利润和股价背离分析"
- Any request to chart a stock's quarterly price against its earnings.
Dependencies
- westock-data skill — provides the CLI (
index.js) used to fetch K-line and financial data. Load it first via thewestock-dataskill to obtain the CLI path. - node — to run the westock-data CLI.
- This skill's bundled script:
scripts/gen_chart.py.
Workflow
Step 1 — Resolve the stock code
The westock-data CLI does not accept Chinese names (it returns empty). If the user gives a name (e.g. "海康威视"), resolve it to a standard code first:
- Use WebSearch: search
"名称 股票代码"and pick the standard code (formats:sz002415,sh600519,bj430047, or HKhk00700, USusAAPL). - If the user already supplied a code, use it directly.
Step 2 — Load westock-data and locate its CLI
Invoke the westock-data skill to load its instructions, which expose the path to
.../westock-data/scripts/index.js. Pass that path to the script via --westock.
(The script also auto-discovers the path under ~/.workbuddy and /Applications/WorkBuddy.app,
so --westock is optional if the default layout matches.)
Step 3 — Run the generator
python3 SKILL_DIR/scripts/gen_chart.py CODE \
--name "股票名称" \
--westock "PATH/to/westock-data/scripts/index.js" \
--out "OUTPUT.html"
The script prints a progress log and ends with a SUMMARY_JSON:... line containing the key
metrics (profit peak, price peak, latest quarter) — use it for your narration.
Step 4 — Present the result
Use present_files on the generated HTML so the user can view (and save) it. Then, based on the
SUMMARY_JSON and the script's auto-analysis, add a short contextual read-out (e.g. note whether
price and profit peaks are synchronized, or whether profit is at a high while valuation has
pulled back — a "profit up, price flat" divergence worth flagging in a Lynch-style lens).
Implementation Notes (non-obvious gotchas)
- Single-quarter profit: the finance API does not expose a single-quarter field. The
script computes it as
cumulative(this quarter) − cumulative(prior quarter in same year)(Q1 = cumulative directly). Finance returns cumulative net profit inNPParentCompanyOwners(unit: 元 → ÷1e8 for 亿元). - Standard quarter-ends only: filter out non-standard report dates (e.g. re-statement dates
like
2016-07-31) to avoid polluting the cumulative-difference calculation. - Empty-result retry: the westock-data CLI intermittently returns empty
[]/nullon frequent/consecutive calls (likely internal rate-limiting).gen_chart.pyalready retries with exponential backoff; if a call still fails, simply re-run. - History window: the finance endpoint typically returns ~42 quarters (from about 2016Q1). The X-axis is built dynamically from whatever quarters are available, so older/newer listings are handled automatically.
- Post-adjustment price: K-line uses
--fq hfq(后复权) so splits/dividends don't distort the long-term trend.
Resources
scripts/
gen_chart.py— fetches seasonal post-adjustment K-line + quarterly profit, computes single-quarter profit and YoY, and renders the self-contained HTML report. Args:CODE(required),--westock PATH,--name NAME,--out FILE.
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供高价值的股票季度净利润与复权价格双轴图表生成功能,满足投资者可视化分析需求
- 支持A股、港股、美股,覆盖广泛,输出为离线HTML报告,实用性强
Highlights
- 触发词覆盖全面,包含多种中英文变体,边界清晰,能有效匹配用户请求
Areas to improve
-
frontmatter incomplete Reported severity: Minor
顶层frontmatter缺少版本号、作者等常见字段
Recommendation: 建议补充version、author等字段以增强规范性
Highlights
- 文档结构清晰,包含完整的工作流步骤、使用场景和实现细节
Areas to improve
-
dependency on external skill without explicit loading guarantee Reported severity: Minor
依赖'westock-data'技能提供CLI路径,但未明确保证其已加载
Recommendation: 建议在文档中强调必须先加载'westock-data'技能,或提供更明确的错误提示
Highlights
- 脚本内置重试机制处理空结果,使用WebSearch解决中文名称到代码的映射,提升了鲁棒性
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.