Commit Graph

20 Commits

Author SHA1 Message Date
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 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
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
Mengz 0b48ec90d8 fix: 修正 Issue 和 PR 列表筛选 2026-06-05 11:43:30 +08:00
Surponess 333115e9d0 修改编译问题 2026-06-04 11:41:31 +08:00
whale 0efb085bf3 merge: sync with upstream, keep our changes 2026-06-04 08:31:35 +08:00
wbtiger 83fe18f8c0 refactor: rename pr +close to pr +refuse
The `pr +close` shortcut called the `refuse_merge` API, which is
misleading — "close" suggests a benign operation, but the actual
behavior is to refuse/reject the pull request permanently.

Rename the shortcut to `pr +refuse` so the name matches the API
semantics, and add a warning in the docs that it must never be used
as a substitute for `pr +merge`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 23:20:32 +08:00
wangyue789 00c753b421 feat(pr): add reopen shortcut 2026-05-27 01:08:54 +08:00
wbtiger 898b7f59d1 feat: add milestone, compare, pr reopen shortcuts and api enhancements (#45)
- milestone shortcuts: list, create, view, update, delete, close, reopen
- compare shortcuts: view, files (compare branches/tags/commits)
- pr +reopen: reopen closed pull requests
- api: add --body-file and --body-stdin for reading JSON from file/stdin
- comprehensive tests for all new shortcuts

Co-authored-by: wangyue111 <wangyue111>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:44:39 +08:00
Surponess 4176555d37 变更文件清单
1. shortcuts/pr/pr.go — 核心逻辑
+diff 命令替换:

旧实现:与 +files 完全相同,调用 /pulls/{id}/files(只返回文件列表)
新实现:两步调用
GET /v1/{owner}/{repo}/pulls/{id}/versions → 取最新版本 ID
GET /v1/{owner}/{repo}/pulls/{id}/versions/{version_id}/diff → 获取逐行 diff
新增参数:

--file / -f — 过滤特定文件的 diff
--stat — 仅显示统计摘要
新增函数:

getLatestVersionID() — 获取 PR 最新版本 ID
formatDiffStat() — 提取增删统计摘要
2. internal/output/formatter.go — Diff 渲染
isDiffData() — 通过检测 files[].sections 区分 diff 数据和普通文件列表
printDiffTable() — 以 git diff 风格渲染:diff --git 头、hunk header、增删行
修改 printTable() 路由,自动检测并走 diff 渲染分支
3. shortcuts/pr/pr_test.go — 新增 5 个测试
测试用例	验证内容
TestPRDiffFetchesVersionThenDiff	两步调用完整流程
TestPRDiffWithFileFilter	--file 参数传递 filepath 查询参数
TestPRDiffStatMode	--stat 模式只输出统计
TestPRDiffFailsWhenNoVersions	无版本时返回友好错误
TestPRDiffFailsWhenPRNotFound	PR 不存在时正确处理 404
4. Skill 文档更新
SKILL.md — 更新 +diff 描述、新增使用示例、更新注意事项
gitlink-pr-files.md — 完整重写,明确 +files 和 +diff 的区别
2026-05-25 11:36:49 +08:00
Tiger 49cd590227 Merge PR #26: feat(pr): add review shortcuts
Resolved conflicts between PR #24 (+versions, +version-diff) and PR #26
(+reviews, +review). Unified prReviewsPath() to use existing prV1Path() helper.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 22:12:01 +08:00
wangyue789 fbea42ecce feat(pr): add review shortcuts 2026-05-21 17:20:15 +08:00
wangyue789 e85dd367d8 feat(pr): add patchset version shortcuts 2026-05-21 11:58:47 +08:00
wbtiger 20c3a4ff62 feat(pr): add pr +comment shortcut
Add a convenience command to comment on pull requests directly,
without needing to look up the underlying issue ID first.

Internally resolves the PR's issue ID via pr +view, then posts
to the issues journals API.
2026-05-14 14:23:04 +08:00
wbtiger 17abc488a8 fix: 统一使用 pull_request_number 替代 pull_request_id
将所有 skill 文档中对 pull_request_id 的引用替换为 pull_request_number,
与用户在网页 URL (/pulls/N) 中看到的序号一致。API 本身支持
pull_request_number,因此无需任何代码改动。

Fixes #7
2026-05-12 14:07: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