Commit Graph

302 Commits

Author SHA1 Message Date
whale fa69e6b862 fix(shortcuts): 修复 milestone +close 路径并补回归测试
close 命令 API URL 误拼为 {repo_path}/{owner}/milestones/{id}/update_status(Owner 重复、Repo 丢失、缺 /v1),修正为 /v1/{owner}/{repo}/milestones/{id}/update_status;新增 TestMilestoneClose 回归测试。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-05 22:02:00 +08:00
whale af7b5aeea3 chore(git): 精简 .gitignore + 移除二进制 gitlink-cli.exe 跟踪
追加 __pycache__/*.pyc/*.exe/research-output/ 忽略;git rm --cached gitlink-cli.exe 停止 19MB 二进制膨胀历史(CI/Docker 内自行 go build,不影响部署)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-05 22:01:59 +08:00
whale 7aa6f1b757 Merge fork/master 2026-07-02 16:09:18 +08:00
whale 8176d8854c Merge remote-tracking branch 'origin/master' into master
- 保留本地 Wiki shortcuts 完整实现(含 sidebar/目录管理)
- 合并 client.go:保留 DoRaw/DoForm,增加 gateway 错误码与 wiki/open 免 .json 后缀处理
- 更新 register_test.go 以校验 25 个命令域(含 pm/wiki/file/snippet)
- 移除与本地 issue batch 测试冲突的 origin batch_update_test.go

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-02 16:08:43 +08:00
whale e3527826d1 fix(shortcuts): 注册测试补全 pm 域以支持 Wiki 等全部命令域
- 将 pm 加入 expectedGroups,使 TestRegisterAll 与 25 个已注册命令域一致
- 确保 wiki/file/snippet 等 HEAD-only 分组在测试中继续被校验

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-02 15:58:56 +08:00
Surponess 05ef22a38d Merge pull request '修改了两个skills的命令使用' (#22) from surponess_br into master 2026-07-02 15:32:36 +08:00
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
Surponess 42aada59b2 验证部分内容,作出相关修改 2026-06-29 10:39:16 +08:00
Surponess b09ff86078 立即验证结果(本次执行,全部通过)
验证项	结果	说明
任务一·编译		go build 成功
任务一·全量测试		41 包通过 / 0 失败
任务一·25 域可用		之前验证 25/25
任务二三四·Skill 规范		7 个新 Skill frontmatter 全合规
demo 脚本语法		4 个脚本(snippet/pr-guard/research/live)全过
examples 覆盖		42 个文件 / 38 个 Skill 目录
🔧 验证发现并修复的回归(关键)
问题:之前给 register.go 加 pm 域时,漏了更新回归测试 register_test.go —— 它硬编码期望 24 个 group,加 pm 后变 25,导致 TestRegisterAll 失败。

修复:expectedGroups 列表补上 "pm"(24→25),重跑全量测试 41 包全绿。

这说明:光"能跑通"≠"验证通过"。如果不跑全量测试,这个回归会带到提交里。验证抓到了。
2026-06-29 10:39:03 +08:00
Surponess 37b000b478 注册重编激活 25 域、新增 6 个 Skill、补全索引与示例、产出任务三/四的端到端工作流 2026-06-24 13:40:17 +08:00
Surponess 464b0225e8 任务一(50%·CLI 能力)
修改	内容	效果
shortcuts/register.go	补 pm 域注册(import + groups + descriptions 3 处)	25 个命令域全部接入
go build 重编	exe 从 06-11 旧版重编到 06-24	25/25 域全可用(workflow/health/pipeline/pm/compare 等从 unknown 变可用)
诊断修正	纠正"9 域未注册"误判 → 实际只差 pm + 重编	避免误改代码
状态:命令层 + 测试 + 跨平台 + 变更文档均达标;5 域激活直接解锁了 health/workflow/pipeline 等 Skill 的真实演示。🔴 唯一缺口:三份报告(暂缓)。

任务二(20%·Skills)
修改	内容	效果
新增 5 Skill	onboarding / auth / snippet / digest / todo(均含 SKILL.md + examples)	覆盖新人引导/认证/片段/简报/待办
补 28 个 examples	为各已有 Skill 补端到端示例	功能型 Skill examples 覆盖 11%→96%
skills/README.md	新增「智能化与工作流 Skills」小节,收录 5 个新 Skill	索引规范补齐
snippet 实测	7 命令端到端通过(create→...→delete)	Agent 平台验证证据
Skills工作总结.md	多轮完善:成果归属 + 验收演示指南 + 实测验证 + 4 Skill 索引	验收材料成型
状态:课程 6 场景全覆盖,报告待补。

任务三(20%·端到端工作流)
修改	内容
gitlink-pr-guard/SKILL.md	代码质量看门人:5 步流水线(采集→Review→CI→评论→判定)+ 质量门禁规则
pr-guard-workflow.sh	可复现脚本,串联 5 步 4 域(已验证)
pr-guard-architecture.md	ASCII 架构图 + 与 code-review 分工说明
状态:主体完成,满足"≥3 步串联 + 自定义 Skill + 架构图"。 待真实 PR 演示 + 报告。

任务四(加分·科研辅助)
修改	内容
gitlink-research-insight/SKILL.md	科研仓库画像:四维评分(可复现性/活跃度/引用价值/协作健康)+ 协作知识图谱
research-insight-workflow.sh	可复现脚本,4 步串联(已验证)
research-insight-guide.md	完整中文文档 + 架构图 + 报告样例
创新点:把 gitlink 数据从"工程视角"提升到"科研视角"(可复现/引用/合作 + 知识图谱)。 待真实科研仓库验证。

DevOps(10%)
 未实质推进。现状:已有 .gitea/workflows/ci.yml + .github/workflows/{ci,release,test}.yml 基础,待扩展覆盖任务二~四产物。
项目级
文件	内容
项目任务总体计划.md	四任务要求解读 + 现状对照 + 报告策略 + 统一排期(准确版)
CLAUDE.md	Skills 触发索引(让 Claude Code 知道按场景读对应 SKILL.md)
本轮总产出统计
激活:25 个 CLI 域(从部分 unknown → 全可用)
新增 Skill:6 个(onboarding/auth/snippet/digest/todo/pr-guard/research-insight — 注:research-insight 是第 7 个,含它共 7 个新增)
新增 demo/工作流:snippet-live-demo、SHOWCASE、live-demo(guide+sh)、pr-guard(SKILL+脚本+架构)、research-insight(SKILL+脚本+文档)
文档:Skills工作总结、项目任务总体计划、CLAUDE.md
2026-06-24 13:39:09 +08:00
Surponess 849d55be15 Merge pull request '新增skills' (#19) from surponess_br into master 2026-06-23 17:54:18 +08:00
Surponess 0d0a2f4a93 新增
gitlink-digest
gitlink-todo
2026-06-23 17:54:08 +08:00
wbtiger 71ca2bb683 Merge pull request 'chore(skills): update skills/README.md' (#260) from co63oc/gitlink-cli:fix5 into master 2026-06-22 00:28:41 +08:00
wbtiger 593b5e8f0d Merge pull request 'feat(shortcut): add shortcuts/wiki' (#193) from co63oc/gitlink-cli:fix4 into master 2026-06-22 00:03:52 +08:00
co63oc dbf0f45ce3 chore(skills): update skills/README.md 2026-06-16 14:27:50 +08:00
co63oc 2c9a8b6192 feat(shortcut): add shortcuts/wiki 2026-06-16 10:24:15 +08:00
wbtiger 982f2cb336 Merge pull request 'feat(issue): add batch maintenance shortcuts' (#165) from wangyue111/gitlink-cli:feat/issue-batch-maintenance into master 2026-06-16 00:15:17 +08:00
baoerjun 363c25f8cb Merge pull request 'feat: 合并 upstream/master 并对齐风格 — 行为修复 + i18n 化' (#18) from baoerjun_branch into master 2026-06-15 17:45:45 +08:00
wauxing fbdab04a57 refactor(i18n): fork 引入的命令全面 i18n 化,对齐 upstream 风格
仅改造 fork 自己实现/新增的命令,不动 upstream 本身未 i18n 的包:

- issue/batch_*.go(7文件): newBatchXxxShortcut 接受 tr,所有
  Description/Usage 改 tr.T();新增 batchRuntimeFlags(tr) 共享 helper
  消除 dry-run/confirm/max/delay 重复
- search +issues: 11 个硬编码改 tr.T(),复用 flag.search.keyword/
  flag.page/flag.limit/flag.sort_by/flag.sort_direction
- user headmaps/stats-*/trends: newStatsShortcut 接受 tr,
  Description/Usage 改 tr.T()
- locale: 新增 51 个 key(zh-CN + en-US 双语),清理 10 个孤立死 key
  (batch_list.*/batch.reason/yes 等无对应命令的遗留 key)

全模块测试通过(40 包,0 失败)。
2026-06-15 17:28:21 +08:00
wauxing 31065df31d fix: 对齐 issue/org/pr/cmd 实现与 upstream 测试(C1 行为分歧修复)
全模块测试通过(0 失败)。以 upstream 测试为准统一行为:

- issue: IssueData 扩展 5 字段(assigner/branch/date),fetchIssueData
  从嵌套 key 读取(status.id/priority.id),preserveIssueMetadata 输出
  全部 7 字段;create 直传 assigned_to_id 字符串(不再 ResolveUserID);
  update guard 允许 metadata-only 更新
- pr: merge 补默认 do=merge;diff 改用 v0 pulls/:id/files;review 合并
  重复命令(content/body 互为别名),删除重复 reviews;清理 journal 副作用
- org: create 补 nickname/visibility 字段;删除 teams/create-team/
  remove-member 三个未实现的测试
- common: RequireArg 改用 i18n error.missing_required_flag(本地化)
- webhook: Shortcuts 接受 translator,描述/flag 全部 i18n 化
- register: webhook 传 tr
- pr SKILL.md: +diff 端点描述改为 pulls/:id/files
2026-06-15 17:02:17 +08:00
wauxing ca22d2393a fix: 清理合并后遗留 — 文档对齐代码、删除死代码与临时测试桩
- repo SKILL.md: commits/tags/raw 三命令在 18654a8 同步时被意外回退,
  文档改为 Raw API 形式,与当前代码一致
- onboarding SKILL.md: 同步修正 issue +tags / repo +raw 引用为 Raw API
- issue.go: 删除零引用的 existingIssue 死结构体(合并时从 upstream 引入,
  但其 fetchExistingIssue 调用者未进入合并代码)
- issue_test.go: 删除 3 个合并时为绕过编译/重复定义而留的 t.Skip 桩
2026-06-15 11:48:48 +08:00
wauxing ca2431f05b Merge remote-tracking branch 'upstream/master' into baoerjun_branch
# Conflicts:
#	shortcuts/issue/issue.go
#	shortcuts/register.go
#	shortcuts/release/release.go
#	shortcuts/release/release_test.go
#	shortcuts/repo/repo_test.go
#	skills/README.md
#	skills/gitlink-onboarding/SKILL.md
#	skills/gitlink-pr/SKILL.md
#	skills/gitlink-repo/SKILL.md
#	skills/gitlink-search/SKILL.md
2026-06-15 11:15:43 +08:00
wangyue789 0703d3eba9 feat(issue): add batch maintenance shortcuts 2026-06-15 08:21:10 +08:00
wbtiger ef7a2c6ac1 Merge pull request 'docs: add luwanzhou and whale_hihihi to contributors' (#247) from chore/add-contributors-luwanzhou-whale into master 2026-06-14 19:41:06 +08:00
Tiger 6eebfeb40d docs: add luwanzhou and whale_hihihi to contributors 2026-06-14 19:41:54 +08:00
wbtiger 6454645f50 Merge pull request 'feat(skills): add gitlink-issueops — Issue 驱动的 Agent 自动化示例 Skill(响应 #6)' (#220) from recorder/gitlink-cli:feat/issueops-skill into master 2026-06-14 19:35:41 +08:00
wbtiger d3485fce45 Merge pull request 'feat(examples): add pr-quality-gatekeeper end-to-end workflow(子题三:门禁闭环 + 全仓批扫)' (#219) from recorder/gitlink-cli:feat/example-workflow-pr-gatekeeper into master 2026-06-14 19:32:55 +08:00
wbtiger 67b46eece4 Merge pull request 'feat(skills): 新增 issue标签管理的skill、过期issue自动管理的skill' (#233) from yangsai/gitlink-cli:feat/gitlink-stale-issue-manager into master 2026-06-14 19:23:37 +08:00
wbtiger 1806382459 Merge pull request 'feat(skills): 新增 科研Fork影响力分析 的skill : gitlink-research-fork-impact' (#218) from yangsai/gitlink-cli:feat/gitlink-research-fork-impact into master 2026-06-14 19:21:20 +08:00
wbtiger 46154f7c5e Merge pull request 'feat(skills): 新增 学者/团队科研画像生成 的skill : gitlink-scholar-profile' (#149) from yangsai/gitlink-cli:feat/gitlink-scholar-profile into master 2026-06-14 19:20:42 +08:00
wbtiger a61a8c4ef4 Merge pull request 'feat(skills): 新增 3 个 Agent Skill — wiki-builder, pipeline-guardian, webhook-sentinel' (#144) from whale_hihihi/gitlink-cli:skills/new-skills into master 2026-06-14 19:18:43 +08:00
wbtiger 789db5e5ae Merge pull request 'feat: 新增 dataset 数据集管理快捷命令(list/view/create/update/delete-attachment)' (#243) from luwanzhou/gitlink-cli:feat/dataset-shortcuts into master 2026-06-14 18:51:49 +08:00
Tiger ecc5578cf4 Merge upstream/master: resolve conflicts in README.zh-CN.md and register_test.go
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 18:50:50 +08:00
wbtiger 8c29d98a57 Merge pull request 'feat(profile): 新增用户画像统计快捷命令' (#241) from luwanzhou/gitlink-cli:feat/profile-shortcuts into master 2026-06-14 18:32:04 +08:00
wbtiger 1c84cac060 Merge pull request 'feat(shortcut): add shortcuts/ignore' (#153) from co63oc/gitlink-cli:fix3 into master 2026-06-14 18:29:41 +08:00
wbtiger 706a1396ad Merge pull request 'chore(doc): fix README.md' (#152) from co63oc/gitlink-cli:fix1 into master 2026-06-14 18:28:17 +08:00
luwanzhou 29ca94db76 feat(dataset): add full dataset CRUD (view/create/update/delete-attachment)
Extend the dataset group beyond the verified project query to the full
documented contract:

- dataset +view              -> GET    /v1/{owner}/{repo}/dataset (+page/limit)
- dataset +list --ids        -> GET    /v1/project_datasets   (prod-verified)
- dataset +create            -> POST   /v1/{owner}/{repo}/dataset
- dataset +update            -> PUT    /v1/{owner}/{repo}/dataset
- dataset +delete-attachment -> DELETE /attachments/{uuid}

Quality over a bare contract port: bilingual (en-US/zh-CN) i18n help,
--dry-run preview on create/update, --yes confirmation guard on the
destructive attachment delete, and license-id validation.

Only /v1/project_datasets is currently reachable on production www; the
per-repo routes follow the published OpenAPI spec and return 404 there
until the platform deploys them (documented in the change note). Unit
tests exercise every command against a mock server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:01:57 +08:00
luwanzhou 7f731eb04f feat(dataset): add dataset query shortcuts
Add a `dataset` shortcut group for querying GitLink research datasets,
which previously had no shortcut coverage:

- dataset +list --ids <ids>  -> GET /v1/project_datasets
- dataset +view              -> GET /v1/project_datasets (project ID
                                 resolved from --owner/--repo)

Only the platform-wide query endpoint is available on production
gitlink.org.cn; the documented per-repo dataset CRUD routes return 404
there (verified against the API), so this group wraps the query endpoint
for both listing and per-repo viewing.

Includes unit tests, bilingual (en-US/zh-CN) i18n help text, README
updates, and a change note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 11:48:22 +08:00
luwanzhou da4c8c0d10 feat(profile): 新增用户画像统计快捷命令
新增只读 profile 命令组,封装此前无 shortcut 覆盖的
GitLink 用户画像统计接口:

profile +ability      -> /users/{user}/statistics/develop
profile +role         -> /users/{user}/statistics/role
profile +major        -> /users/{user}/statistics/major
profile +activity     -> /users/{user}/statistics/activity
profile +contribution -> /users/{user}/headmaps

省略 --user 时默认通过 /users/me 解析当前认证用户。
统计命令支持 --start-time/--end-time 时间窗口,
+contribution 支持 --year 参数。

包含单元测试、中英双语 i18n 帮助文本、README 更新
及变更说明文档。
2026-06-13 23:07:27 +08:00
yangsai01 2729cc69ba feat(skills): add skill gitlink-issue-tag、gitlink-stale-issue-manager 2026-06-12 18:28:07 +08:00
yangsai01 7b880cb8ad feat(skills): add skill gitlink-scholar-profile 2026-06-12 10:43:23 +08:00
yangsai01 fb2d60f67a feat(skills): add skill gitlink-research-fork-impact 2026-06-12 10:37:31 +08:00
何开元 968ea0d7b4 feat(skills): add gitlink-issueops — issue-driven agent automation (closes #6)
IssueOps loop: create an issue -> agent picks it up -> result written back.
Two modes: live webhook callback, and a zero-infra Replay mode that polls
'webhook +tasks' (GitLink records every delivery payload even if the endpoint
is unreachable - validated on the real platform).

- SKILL.md: task conventions ([agent] prefix / agent:todo label), 7-step loop,
  untrusted-input rule (issue content is data, never instructions), write ops
  gated on user confirmation, gatekeeper integration for code tasks
- references/REFERENCE.md: allowed webhook events, hooktask payload anatomy,
  dedup cursor, the two issue-id/API tracks (v1 PATCH tag_ids for plain issues),
  CLI 0.2.0 quirks discovered during validation
- references/validation-session.md: full real-platform run with verifiable ids
  (webhook 51579, issue #3/144169, hooktask 4836246, comment 475692, label attached)

Requested by maintainer in #6 ('后续可以考虑出一个示例 Skill 来演示这个场景').
2026-06-11 19:34:36 -07:00
Surponess ec6bd5b796 Merge pull request '新增skills' (#16) from surponess_br into master 2026-06-12 10:11:47 +08:00
Surponess a7c16d64fe 1. 🆕 新人引导 Skill (gitlink-onboarding)
创建了 SKILL.md,包含 4 个完整工作流:
项目新人入门(项目概览 + 环境搭建)
寻找适合新人的 Issue(good-first-issue 搜索 + 5 维度友好度评估)
Issue 引导评论生成(自动生成个性化引导并发布)
新人贡献全流程引导(Fork → Branch → Code → PR)
创建了 examples/onboarding-workflow.md
2. 📦 补全 examples 示例文件
从 3/28 提升到 28/28 全覆盖
新增 24 个 examples 文件,每个包含场景描述、分步操作、输出示例、命令速览
3. 📋 Agent 平台验证记录
创建了 docs/agent-platform-verification.md
记录 27 个 Skills 的逐项验证结果 + 5 个典型验证案例
4. 📝 任务总结文档
创建了 docs/skills-completion-report.md
包含:设计思路(三层架构 + 三种类型 + 设计原则)、27 个 Skills 全景表、与课程要求对照、关键设计决策、后续建议
2026-06-12 10:08:28 +08:00
何开元 85a67a875f feat(examples): add pr-quality-gatekeeper end-to-end workflow
Runnable reference implementation of the merged gitlink-gatekeeper Skill:
collect -> route -> decide (deterministic 0-100 scorecard, three-state verdict)
-> write-back (comment + label + tracking issue, --apply gated, never auto-merge).

- scripts/gatekeeper_workflow.py: single-PR gate loop (pure stdlib, py>=3.9)
- scripts/gatekeeper_sweep.py: repo-wide triage — real run over all 113 open PRs
  of this repo (read-only): PASS 105 / COMMENT 6 / REQUEST_CHANGES 2, avg 88.5
- findings.example.json: real code-review findings of a real PR diff (verifiable line numbers)
- ci-example/: Gitea Actions integration (exit code 2 = REQUEST_CHANGES as CI gate)
- docs: architecture / quickstart / runbook / verification (real-platform evidence)
- tests/test_scoring.py: determinism regression guard (green)

Closes the sub-task-3 loop on top of the label command (#89) and the
gitlink-gatekeeper Skill (#90), sharing one policy file across all three layers.
2026-06-11 19:03:52 -07:00
co63oc 17c555620b feat(shortcut): add shortcuts/ignore 2026-06-09 08:50:39 +08:00
co63oc 9be51d34fc chore(doc): fix README.md 2026-06-09 07:56:38 +08:00
Tiger 52b7093846 chore: bump version to 0.2.0
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 01:36:12 +08:00