Commit Graph

9 Commits

Author SHA1 Message Date
Surponess ebec668e6e ## 一、research-insight 出入修复(核心,实测驱动)
**起因**:实测发现 SKILL.md 与 CLI 实际行为/数据有 5 类出入(另一窗口跑出的报告)。

**改动**(`skills/gitlink-research-insight/SKILL.md`):

| 出入                                    | 修复                                                                     |
| --------------------------------------- | ------------------------------------------------------------------------ |
| `repo +commits` 凭空写(不存在)        | 换`git clone` + `git log`(本地)                                      |
| `repo +tags` 凭空写                   | 用`repo +info` 的 `version_releases_count` + `git tag`             |
| `repo +raw` 凭空写                    | 换`file +get`(自动 base64 解码)                                        |
| 无 fork 识别                            | **新增 Step 0**:读 `fork_info` → 是 fork 则引用价值转 upstream  |
| 评分表数据科学导向(套 CLI 工具扣冤枉分) | 维度 1 加「工程类 vs 科研数据类适配」(默认工程类)                        |
| 协作数据强依赖 PR/commits API,无降级    | Step 1 加降级方案(pr +list 空 → pull_requests_count + git log --merges) |
| `repo +contributor-stats` 报错        | 降级:改用`repo +contributors`                                          |
| 贡献者口径不一致(3 vs 20)               | Step 1 注释说明(注册用户 vs 含邮箱提交者)                                |

**验证**(实测全过):

-  Step 0:识别 `fork_project_user_login: "Gitlink"`(whale 是 fork)
-  `file +get --path LICENSE`:成功读文件
-  `version_releases_count: 0`:判定无版本归档
-  `pr +list` 空 + `pull_requests_count: 21`:触发降级

---

## 二、gitlink-shared 全局 API 限制(根治,惠及所有 Skill)

**改动**(`skills/gitlink-shared/SKILL.md` 的「API 注意事项」表加 4 行):

| 新增条目                                    | 价值                                                                                                 |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **PR 列表可能返回空**                 | fork/权限受限仓库`pr +list` 空,但 `pull_requests_count` 非零 → 用 count + git log --merges 兜底 |
| **repo +contributor-stats 报错**      | API 不稳 → 改用 repo +contributors                                                                  |
| **commits/tags/releases 无 JSON API** | 端点返回 SPA HTML → 解释了为何没有 repo +commits/+tags/+raw 命令                                    |
| **贡献者口径不一致**                  | contributor_users_count vs contributors 含义不同                                                     |

> 所有 Skill 引用 shared,自动知晓这些降级。团队原 Skill(insight/release-auto/workflow 等)由此覆盖,不必逐个改。
## 改动文件清单(本轮)

| 文件                                         |     操作     | 净改动                                    |
| -------------------------------------------- | :-----------: | ----------------------------------------- |
| `skills/gitlink-research-insight/SKILL.md` |      改      | Step0 fork + Step1 替换 + 评分适配 + 降级 |
| `skills/gitlink-shared/SKILL.md`           |      改      | API 注意事项表 +4 行                      |
2026-07-02 15:32:47 +08:00
wbtiger 723e698db4 Merge pull request '新增 Raw API 批处理执行器' (#124) from Mengz/gitlink-cli:mengz/api-batch-runner into master 2026-06-08 02:24:14 +08:00
Mengz d6321e7af5 fix: 统一认证凭据 fallback 配置目录 2026-06-06 18:42:50 +08:00
Mengz 35e50a1828 feat: 新增 Raw API 批处理执行器 2026-06-06 11:55:20 +08:00
Zhang Jinnan 46aa383d76 fix: preserve issue description on updates 2026-04-28 08:43:51 +08:00
wbtiger 2aad9a00d4 fix: require Fork even for admin/owner, unless user explicitly says otherwise 2026-04-18 17:07:32 +08:00
wbtiger 445e548f49 docs(skills): add Fork-based PR workflow guidelines
- gitlink-shared: add 'PR Collaboration Workflow' section with Fork flow,
  correct/incorrect examples, and self-owned repo exception
- gitlink-pr: replace single-path PR creation with two sections:
  1. Fork flow for contributing to others' repos (mandatory)
  2. Direct branch flow for self-owned repos (allowed)

Ensures AI agents follow standard open-source collaboration practices
instead of pushing branches directly to upstream repositories.
2026-04-18 16:56:55 +08:00
wbtiger 90dee6eeb5 fix(skills): add tool boundary rules to prevent gh/hub misuse on GitLink
Problem:
AI agents (e.g., Claude Code) sometimes use `gh` (GitHub CLI) instead of
`gitlink-cli` when operating on GitLink repositories, causing 'command not
found' errors or targeting the wrong platform.

Solution:
- Add ' Tool Boundary' section to gitlink-shared/SKILL.md with platform-
  to-tool mapping table, judgment criteria, and dual-platform guidance
- Add CRITICAL one-liner to all 10 sub-skills ensuring agents see the
  constraint even without reading shared
- Does NOT block `gh` for GitHub operations — only prevents misuse on
  GitLink resources

Tested with 5 scenarios confirming:
1. GitLink operations correctly use gitlink-cli
2. GitHub operations still use gh when appropriate
3. Ambiguous cases default to gitlink-cli when skill is loaded
2026-04-18 16:14:20 +08:00
wbtiger e892370de8 init gitlink-cli 2026-04-17 10:01:30 +08:00