Skip to content

Commit f61c536

Browse files
authored
docs: update Trendshift badge and PR workflow rules (#1736)
1 parent 3b1daa4 commit f61c536

9 files changed

Lines changed: 65 additions & 16 deletions

File tree

.claude/skills/analyze-issue/SKILL.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@
1414

1515
分析时使用简洁中文,优先遵循仓库根目录 `AGENTS.md`
1616

17-
### Step 1: 拉取 Issue 信息
17+
### Step 1: 同步最新代码基线
18+
19+
分析 issue 前必须先刷新远端状态,并尽量把本地安全推进到最新基线:
20+
21+
```bash
22+
git status --short
23+
git fetch --all --prune
24+
# 仅当工作区干净且当前分支可 fast-forward 时执行:
25+
git pull --ff-only
26+
```
27+
28+
- 只有在工作区干净、当前分支有可 fast-forward 的上游时,才执行并接受 `git pull --ff-only` 的结果。
29+
- 如存在本地改动、冲突状态、未跟踪风险文件、无上游分支或无法 fast-forward,不要执行 `stash``reset`、强制切分支或覆盖本地状态;改用已 fetch 的 `origin/main` 或相关远端 refs 做分析。
30+
- 在输出文档的 `Evidence` 中记录同步结果:本地 HEAD、使用的远端基线,以及未更新本地工作树的原因(如有)。
31+
32+
### Step 2: 拉取 Issue 信息
1833

1934
```bash
2035
gh issue view <issue_number> --repo ZhuLinsen/daily_stock_analysis
@@ -28,21 +43,21 @@ gh issue view <issue_number> --repo ZhuLinsen/daily_stock_analysis --comments
2843
- 运行环境与复现步骤
2944
- 日志或报错信息
3045

31-
### Step 2: 回答 4 个核心问题
46+
### Step 3: 回答 4 个核心问题
3247

3348
1. 版本是否明确
3449
2. 问题是否真实且可验证
3550
3. 是否属于仓库责任边界
3651
4. 是否值得立即处理
3752

38-
### Step 3: 结合仓库现状做证据检查
53+
### Step 4: 结合仓库现状做证据检查
3954

4055
- 阅读相关代码、配置、测试、脚本、工作流与文档
4156
- 如果问题涉及 API、数据源 fallback、报告生成、通知发送、认证、桌面端、发布流程,明确写出影响面
4257
- 判断是实际 bug、环境配置问题、使用方式问题、还是外部依赖问题
4358
- 如怀疑已被修复,检查当前代码而不是只看 issue 描述
4459

45-
### Step 4: 形成结论
60+
### Step 5: 形成结论
4661

4762
至少给出以下字段:
4863

@@ -56,7 +71,7 @@ gh issue view <issue_number> --repo ZhuLinsen/daily_stock_analysis --comments
5671
- `难度``easy / medium / hard`
5772
- `建议动作``立即修复 / 排期修复 / 文档澄清 / 关闭`
5873

59-
### Step 5: 生成分析文档
74+
### Step 6: 生成分析文档
6075

6176
保存到 `.claude/reviews/issues/issue-<number>.md`
6277

@@ -82,6 +97,7 @@ gh issue view <issue_number> --repo ZhuLinsen/daily_stock_analysis --comments
8297

8398
## Evidence
8499

100+
- 代码同步基线:
85101
- 关键 issue 信息:
86102
- 关键代码/脚本/工作流证据:
87103

@@ -113,6 +129,7 @@ gh issue view <issue_number> --repo ZhuLinsen/daily_stock_analysis --comments
113129
## Allowed Auto-Actions (No Confirmation Needed)
114130

115131
- 拉取 issue 详情与评论
132+
- 执行 `git fetch --all --prune`,并在工作区干净且可 fast-forward 时执行 `git pull --ff-only`
116133
- 阅读相关代码、配置、脚本、工作流和文档
117134
- 生成分析文档
118135

.claude/skills/analyze-pr/SKILL.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@
1414

1515
分析时使用简洁中文,优先遵循仓库根目录 `AGENTS.md``.github/PULL_REQUEST_TEMPLATE.md`
1616

17-
### Step 1: 拉取 PR 基本信息
17+
### Step 1: 同步最新代码基线
18+
19+
分析 PR 前必须先刷新远端状态,并尽量把本地安全推进到最新基线:
20+
21+
```bash
22+
git status --short
23+
git fetch --all --prune
24+
# 仅当工作区干净且当前分支可 fast-forward 时执行:
25+
git pull --ff-only
26+
```
27+
28+
- 只有在工作区干净、当前分支有可 fast-forward 的上游时,才执行并接受 `git pull --ff-only` 的结果。
29+
- 如存在本地改动、冲突状态、未跟踪风险文件、无上游分支或无法 fast-forward,不要执行 `stash``reset`、强制切分支或覆盖本地状态;改用已 fetch 的 `origin/main`、PR head 或 GitHub diff 做分析。
30+
- 在输出文档的 `Validation Evidence` 中记录同步结果:本地 HEAD、使用的远端基线,以及未更新本地工作树的原因(如有)。
31+
32+
### Step 2: 拉取 PR 基本信息
1833

1934
```bash
2035
gh pr view <pr_number> --repo ZhuLinsen/daily_stock_analysis
@@ -29,7 +44,7 @@ gh pr diff <pr_number> --repo ZhuLinsen/daily_stock_analysis
2944
gh run view <run_id> --log-failed
3045
```
3146

32-
### Step 2: 检查标题与描述完整性
47+
### Step 3: 检查标题与描述完整性
3348

3449
先检查 PR title 是否符合 `AGENTS.md` 的非阻断建议:
3550

@@ -59,7 +74,7 @@ gh run view <run_id> --log-failed
5974

6075
若 PR 修改报告格式、报告渲染效果或 Web UI 界面,还要检查 `Visual Evidence` 是否附受影响报告 / 页面截图;涉及前后差异时优先检查前后对比。若无法截图,描述中应说明原因与替代可视证据。
6176

62-
### Step 3: 优先使用 CI / Diff 证据
77+
### Step 4: 优先使用 CI / Diff 证据
6378

6479
- 先根据 `gh pr checks`、PR diff、现有测试与工作流日志判断问题
6580
- 仅当 CI 未覆盖改动面、CI 结果不足以定性问题、或需要验证关键回归风险时,再补充本地最小验证
@@ -71,7 +86,7 @@ gh run view <run_id> --log-failed
7186
- 前端:`cd apps/dsa-web && npm ci && npm run lint && npm run build`
7287
- 桌面端:先构建 Web,再构建 Electron
7388

74-
### Step 4: 评估正确性与风险
89+
### Step 5: 评估正确性与风险
7590

7691
重点检查:
7792

@@ -80,7 +95,7 @@ gh run view <run_id> --log-failed
8095
- 是否破坏 fallback、降级路径、通知链路或发布流程
8196
- 是否存在明显逻辑错误、异常吞没、安全问题、配置语义变化未同步文档
8297

83-
### Step 5: 生成评审文档
98+
### Step 6: 生成评审文档
8499

85100
保存到 `.claude/reviews/prs/pr-<number>.md`
86101

@@ -109,6 +124,7 @@ gh run view <run_id> --log-failed
109124

110125
## Validation Evidence
111126

127+
- 代码同步基线:
112128
- CI 结论:
113129
- 本地补充验证(如有):
114130

@@ -129,6 +145,7 @@ gh run view <run_id> --log-failed
129145
## Allowed Auto-Actions (No Confirmation Needed)
130146

131147
- 拉取 PR 元数据、diff、评论和 CI 状态
148+
- 执行 `git fetch --all --prune`,并在工作区干净且可 fast-forward 时执行 `git pull --ff-only`
132149
- 阅读相关代码、模板、工作流与文档
133150
- 在必要时执行最小化本地验证
134151
- 生成评审文档

.claude/skills/fix-issue/SKILL.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,21 @@
2020

2121
检查 `.claude/reviews/issues/issue-<number>.md` 是否存在;如果不存在,先补做 issue 分析或在本次修复中补齐最小分析结论。
2222

23-
### Step 2: 选择安全的工作方式
23+
### Step 2: 同步最新代码基线并选择安全的工作方式
24+
25+
开始修复或准备创建 / 更新 PR 前,先按 `AGENTS.md` 拉新:
26+
27+
```bash
28+
git status --short
29+
git fetch --all --prune
30+
# 仅当工作区干净且当前分支可 fast-forward 时执行:
31+
git pull --ff-only
32+
```
2433

2534
- 默认基于当前工作树做最小相关改动
26-
- 不要默认执行 `git pull`
35+
- 只有在工作区干净、当前分支有可 fast-forward 的上游时,才执行并接受 `git pull --ff-only` 的结果
36+
- 如存在本地改动、冲突状态、未跟踪风险文件、无上游分支或无法 fast-forward,不要执行 `stash``reset`、强制切分支或覆盖本地状态;先记录本地 HEAD、使用的远端基线与无法更新本地工作树的原因
37+
- 若后续要创建 / 更新 PR,先说明当前分支与目标基线差异;必要时请求用户确认 rebase、merge 或继续基于当前分支推进
2738
- 不要默认切换分支或改写用户当前工作状态
2839
- 如果用户明确要求建分支,再执行最小必要的分支操作
2940

@@ -95,6 +106,7 @@
95106
## Allowed Auto-Actions (No Confirmation Needed)
96107

97108
- 阅读和分析代码
109+
- 执行 `git fetch --all --prune`,并在工作区干净且可 fast-forward 时执行 `git pull --ff-only`
98110
- 应用与当前任务直接相关的最小修复
99111
- 运行非破坏性的本地验证
100112
- 更新本地 issue 分析文档

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ If any instruction in this file conflicts with `AGENTS.md`, follow `AGENTS.md`.
1212
- Desktop: `apps/dsa-desktop/`
1313
- Deployment/workflows: `scripts/`, `.github/workflows/`, `docker/`
1414
- Do not run `git commit`, `git tag`, or `git push` without explicit user confirmation.
15+
- Before creating/updating PRs, PR review, or issue analysis, refresh the latest code baseline with `git fetch --all --prune`; if the worktree is clean and the current branch can fast-forward, run `git pull --ff-only`. If local changes, conflicts, missing upstream, or non-fast-forward history make that unsafe, do not stash/reset/overwrite local state; analyze against fetched remote refs or record the baseline gap before proceeding.
1516
- PR titles should use `<type>: <change summary>` such as `fix: 修复大盘分析历史记录丢失`; use `fix`/`feat`/`refactor`/`docs`/`chore`/`test`/`ci` where possible, and avoid `[codex]`, `codex`, `autocode`, `copilot`, or other tool/agent source prefixes. Treat this as process guidance and do not use title format mismatches as a hard review blocker.
1617
- Do not hardcode secrets, accounts, ports, model names, absolute environment-specific paths, or environment-specific branches.
1718
- Reuse existing modules, configuration entrypoints, scripts, and tests instead of adding parallel implementations.

.github/instructions/governance.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ applyTo: "README.md,docs/**,AGENTS.md,CLAUDE.md,.github/**,.claude/skills/**,scr
88
- `AGENTS.md` is the canonical AI collaboration document; if its meaning changes, sync `CLAUDE.md`, `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md`, and repository skills as needed.
99
- Root `SKILL.md` and `docs/openclaw-skill-integration.md` describe product or external integration behavior, not repository governance.
1010
- Explain which pipeline, release path, deployment path, review automation, or governance asset is affected and what the rollback path is.
11+
- Before creating/updating PRs, PR review, or issue analysis, refresh the latest code baseline with `git fetch --all --prune`; only run `git pull --ff-only` when the worktree is clean and the current branch can fast-forward. If not, keep local state intact and record the fetched remote baseline or branch gap before proceeding.
1112
- Keep `README.md` limited to homepage-level content such as positioning, high-level capabilities, quick start, main entrypoints, and sponsorship/cooperation; put detailed behavior, configuration, troubleshooting, field contracts, and edge cases in `docs/*.md`.
1213
- Avoid widening permissions, secret exposure, or destructive automation without a clearly documented need.
1314
- Preserve the repository's opt-in auto-tag behavior (`#patch`, `#minor`, `#major`) unless the change explicitly updates release policy.

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ gh run view <run_id> --log-failed
231231
- `.claude/skills/fix-issue/SKILL.md`
232232
- 如果任务明确是 issue 分析、PR 审查、issue 修复,优先按对应 skill 执行,并将产物保存到 `.claude/reviews/`
233233
- skill 中的命令、模板、验证顺序和交付结构必须与 `AGENTS.md` 保持一致。
234+
- 每次进行 PR 创建 / 更新、PR 审查或 issue 分析前,必须先同步最新代码基线:先检查工作区状态并执行 `git fetch --all --prune`;若工作区干净且当前分支可 fast-forward,则执行 `git pull --ff-only`。如存在本地改动、冲突状态、未跟踪风险文件或无法 fast-forward,不得强行切分支、stash、reset 或覆盖本地状态;PR 审查 / issue 分析可改用已 fetch 的远端 refs/PR head 做分析,并在分析文档中明确记录未更新本地工作树的原因、当前本地 HEAD 与使用的远端基线;PR 创建 / 更新应先说明当前分支与目标基线差异,必要时请求用户确认 rebase、merge 或继续基于当前分支推进。
234235
- skill 默认优先读取 CI / 工作流证据,再决定是否补本地验证。
235-
- skill 不得默认执行 `git pull``git push``git tag``gh pr create` 等会改变远端或当前分支状态的操作;这些操作必须要求用户确认。
236+
- 除上述 PR 创建 / 更新、PR 审查 / issue 分析的安全 fast-forward 同步外,skill 不得默认执行 `git pull``git push``git tag``gh pr create` 等会改变远端或当前分支状态的操作;这些操作必须要求用户确认。
236237
- PR 审查默认顺序:
237238
1. 必要性
238239
2. 关联性

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)](https://hub.docker.com/r/zhulinsen/daily_stock_analysis)
1111

1212
<p align="center">
13-
<a href="https://trendshift.io/repositories/18527" target="_blank"><img src="https://trendshift.io/api/badge/repositories/18527" alt="ZhuLinsen%2Fdaily_stock_analysis | Trendshift" width="230" /></a>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
13+
<img src="https://trendshift.io/api/badge/trendshift/repositories/18527/daily?language=Python" alt="#1 Python Repository Of The Day | Trendshift" width="250" height="55"/>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
1414
</p>
1515

1616
> 🤖 基于 AI 大模型的 A股/港股/美股/日股/韩股自选股智能分析系统,每日自动分析并推送「决策仪表盘」到企业微信/飞书/Telegram/Discord/Slack/邮箱

docs/README_CHT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)](https://hub.docker.com/r/zhulinsen/daily_stock_analysis)
1111

1212
<p align="center">
13-
<a href="https://trendshift.io/repositories/18527" target="_blank"><img src="https://trendshift.io/api/badge/repositories/18527" alt="ZhuLinsen%2Fdaily_stock_analysis | Trendshift" width="230" /></a>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
13+
<img src="https://trendshift.io/api/badge/trendshift/repositories/18527/daily?language=Python" alt="#1 Python Repository Of The Day | Trendshift" width="250" height="55"/>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
1414
</p>
1515

1616
**基於 AI 大模型的 A股/港股/美股/日股/韓股自選股智能分析系統**

docs/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)](https://hub.docker.com/r/zhulinsen/daily_stock_analysis)
1111

1212
<p align="center">
13-
<a href="https://trendshift.io/repositories/18527" target="_blank"><img src="https://trendshift.io/api/badge/repositories/18527" alt="ZhuLinsen%2Fdaily_stock_analysis | Trendshift" width="230" /></a>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
13+
<img src="https://trendshift.io/api/badge/trendshift/repositories/18527/daily?language=Python" alt="#1 Python Repository Of The Day | Trendshift" width="250" height="55"/>&nbsp;<a href="https://hellogithub.com/repository/ZhuLinsen/daily_stock_analysis" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=6daa16e405ce46ed97b4a57706aeb29f&claim_uid=pfiJMqhR9uvDGlT&theme=neutral" alt="Featured|HelloGitHub" width="230" /></a>
1414
</p>
1515

1616
**AI-powered stock analysis system for A-shares / Hong Kong / US / Japanese / Korean stocks**

0 commit comments

Comments
 (0)