From 49d85907b0acbf3a260ca7660b1bfdad0bfd389f Mon Sep 17 00:00:00 2001 From: 15972095207 <2484216370@qq.com> Date: Fri, 3 Jul 2026 08:45:02 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E8=BF=9C=E7=AB=AF?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B1=A1=E6=9F=93+=E6=97=A7=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BB=BB=E5=8A=A1=E4=B8=89=EF=BC=8C=E6=94=B9=E8=B5=B0?= =?UTF-8?q?=E7=BC=96=E6=8E=92Skill=E8=B7=AF=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - README.md: 删除末尾测试污染(pipeline test乱码 + ZxR测试PR段 + 质量门禁测试注释) - 删除 examples/workflows/zhangqing-task3/ (旧脚本式任务三,改走标准编排Skill目录) Co-Authored-By: Claude --- README.md | 1245 ++++++++--------- .../01-community-ops-automation.md | 108 -- .../zhangqing-task3/05-contributor-growth.md | 77 - .../zhangqing-task3/07-onboarding-nanny.md | 119 -- examples/workflows/zhangqing-task3/README.md | 127 -- .../agent-dialogue-triggers.md | 119 -- .../release-notes-v0.2.0-beta.1.md | 55 - 7 files changed, 617 insertions(+), 1233 deletions(-) delete mode 100644 examples/workflows/zhangqing-task3/01-community-ops-automation.md delete mode 100644 examples/workflows/zhangqing-task3/05-contributor-growth.md delete mode 100644 examples/workflows/zhangqing-task3/07-onboarding-nanny.md delete mode 100644 examples/workflows/zhangqing-task3/README.md delete mode 100644 examples/workflows/zhangqing-task3/agent-dialogue-triggers.md delete mode 100644 examples/workflows/zhangqing-task3/release-notes-v0.2.0-beta.1.md diff --git a/README.md b/README.md index bb782611..67119005 100644 --- a/README.md +++ b/README.md @@ -1,630 +1,619 @@ -# gitlink-cli - -[![GitLink](https://img.shields.io/badge/GitLink-Gitlink%2Fgitlink--cli-green)](https://www.gitlink.org.cn/Gitlink/gitlink-cli) -[![License](https://img.shields.io/badge/License-MulanPSL--2.0-blue.svg)](https://license.coscl.org.cn/MulanPSL2) -[![Go Version](https://img.shields.io/badge/Go-1.26%2B-blue.svg)](https://golang.org) -[![npm version](https://img.shields.io/npm/v/@gitlink-ai/cli.svg)](https://www.npmjs.com/package/@gitlink-ai/cli) - -The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans and AI Agents. Supports **macOS, Linux, and Windows**. Covers repository management, issue tracking, pull requests, webhooks, member collaboration, CI/CD, and AI-powered workflows, with 40+ commands and AI Agent [Skills](./skills/). - -**[中文文档](./README.zh-CN.md)** - -[Install](#installation--quick-start) · [AI Agent Skills](#ai-agent-skills) · [Auth](#configure--use) · [Commands](#usage-examples) · [Contributing](#related-projects) - -## Contributors - -
-wangyue111 -wbtiger -Mengz -yangsai -mengcheng -muel -Leo77 -yingjie -topshare -
- -## Why gitlink-cli? - -- **Agent-Native Design** — Structured [Skills](./skills/) out of the box, compatible with Claude Code, OpenClaw, and other AI platforms — Agents can operate GitLink with zero extra setup -- **Wide Coverage** — Repository, Issue, PR, Webhook, Member, Branch, Release, CI, Org, Search, and User workflows are covered by high-level commands -- **AI-Friendly & Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output -- **Cross-Platform** — Runs on macOS, Linux, and Windows (x64/arm64), install via `npm install -g @gitlink-ai/cli` in one command, binary auto-downloaded -- **Open Source, Zero Barriers** — MulanPSL-2.0 license, ready to use, just `npm install` -- **Up and Running in 3 Minutes** — Interactive login or `GITLINK_TOKEN` env var, from install to first API call in just 3 steps -- **Secure & Controllable** — OS-native keychain credential storage, `GITLINK_TOKEN` env var for CI/CD & non-interactive environments, auto git remote context resolution -- **Three-Layer Architecture** — Shortcuts (human & AI friendly) → Raw API (full coverage) → Config (configuration management) - -## Features - -| Category | Capabilities | -|----------|-------------| -| 📦 Repo | List, create, fork, delete repositories, view repo info | -| 🐛 Issue | Create, update, close, batch close, comment on issues | -| 🔀 PR | Create, merge, review pull requests, view changed files | -| 👥 Member | List, add, remove repository members, change roles, create and accept invite links | -| 🌿 Branch | Create, delete, list, protect, unprotect branches | -| 🏷️ Release | Create, view, delete releases | -| 🏢 Org | Manage organizations, members, teams | -| 🔧 CI | View builds, logs, CI/CD operations | -| 🔔 Webhook | Manage repo webhooks and test deliveries | -| 🔍 Search | Search repositories, users | -| 👤 User | View user profiles and info | -| 📋 PM | Sprint management, kanban boards, weekly reports | -| 🤖 Workflow | AI-powered issue triage, PR review, release notes | - -## Installation & Quick Start - -### Requirements - -- Node.js 14+ (`npm`/`npx`) — for npm installation -- Supported platforms: macOS, Linux, Windows (x64/arm64) -- Go 1.26+ — only required for building from source - -### Quick Start (Human Users) - -> **Note for AI assistants:** If you are an AI Agent helping the user with installation, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent), which contains all the steps you need to complete. - -#### Install - -**From npm (recommended):** - -```bash -# One command: installs CLI binary + AI Agent Skills -npm install -g @gitlink-ai/cli -``` - -The binary is auto-downloaded for your platform during `postinstall`. No extra steps needed. - -**From source:** - -Requires Go 1.26+. - -```bash -git clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git -cd gitlink-cli -make install -``` - -> **Windows users:** Run `npm install -g @gitlink-ai/cli` in PowerShell or CMD. For building from source, use `go install .` instead of `make install`. - -#### Configure & Use - -```bash -# 1. Configure (one-time, interactive guided setup) -gitlink-cli config init - -# 2. Log in (choose one) -gitlink-cli auth login # Username/password (recommended) -gitlink-cli auth login --token # Or paste a private token -export GITLINK_TOKEN="your-token" # Or set env var (for CI/CD, non-interactive environments) - -# 3. Start using -gitlink-cli repo +list -``` - -### Quick Start (AI Agent) - -> The following steps are for AI Agents. Some steps require the user to complete actions in a browser. - -**Step 1 — Install** - -```bash -# One command: CLI binary + all Skills auto-installed -npm install -g @gitlink-ai/cli -``` - -**Step 2 — Configure** - -```bash -gitlink-cli config init -``` - -**Step 3 — Login** - -For interactive environments: -```bash -gitlink-cli auth login -``` - -For non-interactive environments (CI/CD, Trae sandbox, MCP, etc.): -```bash -export GITLINK_TOKEN="your-private-token" -``` - -> To get a private token, go to GitLink web → Settings → Private Tokens. - -**Step 4 — Verify** - -```bash -gitlink-cli user +me -``` - -## Usage Examples - -### Repository Operations - -```bash -# List repositories -gitlink-cli repo +list - -# View repository info -gitlink-cli repo +info --owner Gitlink --repo forgeplus - -# Read repository README -gitlink-cli repo +readme --owner Gitlink --repo forgeplus --ref master - -# Create a repository -gitlink-cli repo +create -n my-project -d "Project description" - -# Fork a repository -gitlink-cli repo +fork --owner Gitlink --repo forgeplus -``` - -### Webhook Management - -```bash -# List webhooks -gitlink-cli webhook +list --owner Gitlink --repo forgeplus - -# Create a webhook -gitlink-cli webhook +create --owner Gitlink --repo forgeplus \ - --url https://example.com/hook --events push,create - -# Test a webhook -gitlink-cli webhook +test --owner Gitlink --repo forgeplus --id 68 - -# View webhook delivery tasks -gitlink-cli webhook +tasks --owner Gitlink --repo forgeplus --id 68 -``` - -### Member Management - -```bash -# List repository members -gitlink-cli member +list --owner Gitlink --repo forgeplus - -# Add a member -gitlink-cli member +add --owner Gitlink --repo forgeplus --user-id 101 - -# Preview batch add without changing data -gitlink-cli member +batch-add --owner Gitlink --repo forgeplus --user-ids 101,102 --dry-run - -# Batch add members from a CSV file -gitlink-cli member +batch-add --owner Gitlink --repo forgeplus --from members.csv - -# Change a member role -gitlink-cli member +role --owner Gitlink --repo forgeplus --user-id 101 --role Developer - -# Create an invite link -gitlink-cli member +invite-link --owner Gitlink --repo forgeplus --role developer --apply true -``` - -### Issue Management - -```bash -# List issues -gitlink-cli issue +list --owner Gitlink --repo forgeplus - -# Create an issue -gitlink-cli issue +create --owner Gitlink --repo forgeplus -t "Bug: Login failed" -b "Steps to reproduce..." - -# View an issue -gitlink-cli issue +view --owner Gitlink --repo forgeplus -i 123 - -# Close an issue -gitlink-cli issue +close --owner Gitlink --repo forgeplus -i 123 - -# Preview batch close without changing data -gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --numbers 123,124 --dry-run - -# Batch close issues from a CSV file -gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --from issues.csv - -# Add a comment -gitlink-cli issue +comment --owner Gitlink --repo forgeplus -i 123 -b "Fixed" - -# List issue assigners -gitlink-cli issue +assigners --owner Gitlink --repo forgeplus - -# List issue authors -gitlink-cli issue +authors --owner Gitlink --repo forgeplus -``` - -### Pull Requests - -```bash -# List PRs -gitlink-cli pr +list --owner Gitlink --repo forgeplus - -# Create a PR (same-repo branch) -gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: Search feature" --head feature/search --base master - -# Create a PR (from a fork) -gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: New feature" --head your_username/forgeplus:feature/my-feature --base master - -# View a PR -gitlink-cli pr +view --owner Gitlink --repo forgeplus -i 42 - -# Merge a PR -gitlink-cli pr +merge --owner Gitlink --repo forgeplus -i 42 - -# Reopen a closed PR -gitlink-cli pr +reopen --owner Gitlink --repo forgeplus -i 42 - -# View changed files -gitlink-cli pr +files --owner Gitlink --repo forgeplus -i 42 - -# List PR patchset versions -gitlink-cli pr +versions --owner Gitlink --repo forgeplus -i 42 - -# View a patchset version diff -gitlink-cli pr +version-diff --owner Gitlink --repo forgeplus -i 42 --version-id 16040 - -# List PR reviews -gitlink-cli pr +reviews --owner Gitlink --repo forgeplus -i 42 - -# Create a PR review (with dry-run preview) -gitlink-cli pr +review --owner Gitlink --repo forgeplus -i 42 --status approved -c "LGTM" --dry-run -gitlink-cli pr +review --owner Gitlink --repo forgeplus -i 42 --status approved -c "LGTM" -``` - -### Branch Management - -```bash -# List branches -gitlink-cli branch +list --owner Gitlink --repo forgeplus - -# Create a branch -gitlink-cli branch +create --name feature/new-feature - -# Delete a branch -gitlink-cli branch +delete --name feature/old-feature - -# Protect a branch -gitlink-cli branch +protect --name main - -# Remove branch protection -gitlink-cli branch +unprotect --name main -``` - -### Release Management - -```bash -# List releases -gitlink-cli release +list --owner Gitlink --repo forgeplus - -# Create a release -gitlink-cli release +create --owner Gitlink --repo forgeplus -t v1.0.0 -n "v1.0.0 Stable" -b "Changelog..." - -# View a release -gitlink-cli release +view --owner Gitlink --repo forgeplus -i -``` - -### CI/CD Operations - -```bash -# List builds -gitlink-cli ci +list --owner Gitlink --repo forgeplus - -# View build log -gitlink-cli ci +log --owner Gitlink --repo forgeplus -i - -# Restart a build -gitlink-cli ci +restart --owner Gitlink --repo forgeplus -i -``` - -### Search - -```bash -# Search repositories -gitlink-cli search +repos -k "machine learning" - -# Search users -gitlink-cli search +users -k "zhangsan" -``` - -### Workflow Agent Commands - -`workflow` provides rule-based repository analysis for maintainers and AI Agents. It currently supports: - -- `workflow +triage` -- `workflow +health` -- `workflow +pr-summary` -- `workflow +repo-report` - -`workflow +pr-summary` defaults to `table` when `--format` is omitted. -`workflow +repo-report` defaults to `markdown` when `--format` is omitted. - -Examples: - -```bash -# Triage with local parameters -gitlink-cli workflow +triage --title "Install failed on Windows" --body "go install failed with error" --format table - -# Triage with JSON output -gitlink-cli workflow +triage --title "Token leaked in logs" --body "The access token appears in command output" --format json - -# Triage with Chinese markdown output -gitlink-cli workflow +triage \ - --title "安装失败,无法登录" \ - --body "运行命令时报错" \ - --lang zh-CN \ - --format markdown - -# Triage from a local JSON file -gitlink-cli workflow +triage --from shortcuts/workflow/testdata/issue_bug.json --format json - -# Triage by read-only GitLink fetch -gitlink-cli workflow +triage --owner Gitlink --repo gitlink-cli --state open --limit 5 --format table - -# Health for a healthy repository -gitlink-cli workflow +health \ - --repository Gitlink/gitlink-cli \ - --open-issues 3 \ - --open-prs 1 \ - --has-readme \ - --has-license \ - --has-contributing \ - --agent-readiness-known \ - --agent-readiness-score 9 \ - --format table - -# Health for a risky repository -gitlink-cli workflow +health \ - --repository demo/repo \ - --open-issues 60 \ - --stale-issues 25 \ - --open-prs 12 \ - --stale-prs 6 \ - --recent-activity-known \ - --recent-activity-days 120 \ - --release-known=false \ - --format json - -# Health with Chinese markdown output -gitlink-cli workflow +health \ - --repository Gitlink/gitlink-cli \ - --open-issues 3 \ - --open-prs 1 \ - --has-readme \ - --has-license \ - --has-contributing \ - --lang zh-CN \ - --format markdown - -# Health by read-only GitLink fetch -gitlink-cli workflow +health --owner Gitlink --repo gitlink-cli --stale-days 30 --format table - -# PR review summary by read-only GitLink fetch -gitlink-cli workflow +pr-summary --owner Gitlink --repo gitlink-cli --number 1 --format markdown - -# PR review summary from a local JSON file -gitlink-cli workflow +pr-summary --from shortcuts/workflow/testdata/pr_summary.json --format json - -# Repository workflow report by read-only GitLink fetch -gitlink-cli workflow +repo-report --owner Gitlink --repo gitlink-cli --format markdown - -# Repository workflow report from a local JSON file -gitlink-cli workflow +repo-report --from shortcuts/workflow/testdata/repo_report.json --format json -``` - -Output formats: - -- `json` for scripts and AI Agents -- `table` for terminal review -- `markdown` for Issue comments, PR comments, release notes, and competition write-ups - -Safety: - -- Current workflow commands use local analysis by default and can also read GitLink data in read-only fetch mode. -- They do not modify remote GitLink data. -- They do not depend on LLM APIs. -- `workflow +pr-summary` does not comment, approve, reject, or merge pull requests. -- `workflow +repo-report` aggregates health, issue triage, and PR review summary signals without remote writes. - -### Raw API - -For endpoints not covered by shortcuts, use the Raw API directly: - -```bash -# GET request -gitlink-cli api GET /users/me - -# POST request -gitlink-cli api POST /Gitlink/forgeplus/issues --body '{"subject":"test","description":"..."}' - -# POST request with body from a file -gitlink-cli api POST /Gitlink/forgeplus/issues --body-file issue.json - -# POST request with body from stdin -Get-Content issue.json | gitlink-cli api POST /Gitlink/forgeplus/issues --body-stdin - -# With query parameters -gitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1&limit=5' -``` - -## Global Parameters - -| Parameter | Description | Example | -|-----------|-------------|---------| -| `--owner` | Repository owner | `--owner Gitlink` | -| `--repo` | Repository name | `--repo forgeplus` | -| `--format` | Output format (json/table/yaml; workflow also supports markdown) | `--format json` | -| `--debug` | Enable debug output | `--debug` | - -**Automatic context resolution:** When running inside a git repository, `--owner` and `--repo` are automatically resolved from `git remote origin`. - -## Branch Conventions - -gitlink-cli supports bidirectional code sync between GitHub and GitLink: - -| Platform | Default Branch | -|----------|---------------| -| GitHub | `main` | -| GitLink | `master` | - -**Push to GitLink from local:** - -```bash -# Method 1: Use git command directly -git push gitlink main:master - -# Method 2: Configure git remote -git config remote.gitlink.push refs/heads/main:refs/heads/master -git push gitlink -``` - -## AI Agent Skills - -The `skills/` directory contains Agent Skill files for AI-automated GitLink operations. - -See [skills/README.md](skills/README.md) for details. - -| Skill | Description | -|-------|-------------| -| `gitlink-shared` | Authentication, global parameters, safety rules, API notes | -| `gitlink-repo` | Repository operations (create, view, delete, fork, etc.) | -| `gitlink-issue` | Issue operations (create, update, close, comment, etc.) | -| `gitlink-pr` | Pull request operations (create, merge, review, etc.) | -| `gitlink-member` | Repository member and invite link management | -| `gitlink-branch` | Branch management (create, delete, list, protect, unprotect) | -| `gitlink-release` | Release management (create, view, delete, etc.) | -| `gitlink-ci` | CI/CD operations (builds, logs, etc.) | -| `gitlink-search` | Search (repositories, users, etc.) | -| `gitlink-org` | Organization management (members, teams, etc.) | -| `gitlink-user` | User management (profile info, etc.) | -| `gitlink-pm` | Project management (sprints, kanban, weekly reports, etc.) | -| `gitlink-workflow` | AI-powered workflows (issue triage, PR review, release notes, etc.) | - -## Project Structure - -``` -gitlink-cli/ -├── cmd/ # Cobra command definitions -│ ├── root.go # Root command + global flags -│ ├── auth/ # Authentication commands -│ ├── api/ # Raw API commands -│ ├── config/ # Configuration commands -│ └── cmdutil/ # Global utilities -├── internal/ # Internal packages -│ ├── auth/ # Login, token storage, transport -│ ├── client/ # HTTP client + pagination -│ ├── config/ # Config file management -│ ├── context/ # Git remote resolution -│ └── output/ # Envelope + formatter -├── shortcuts/ # Shortcut implementations -│ ├── common/ # Framework (types, runner) -│ ├── repo/ # Repository shortcuts -│ ├── issue/ # Issue shortcuts -│ ├── pr/ # PR shortcuts -│ ├── member/ # Repository member shortcuts -│ ├── branch/ # Branch shortcuts -│ ├── release/ # Release shortcuts -│ ├── org/ # Organization shortcuts -│ ├── ci/ # CI shortcuts -│ ├── search/ # Search shortcuts -│ ├── user/ # User shortcuts -│ └── register.go # Registration entry point -├── skills/ # AI Agent Skills -│ ├── README.md # Skills guide -│ ├── gitlink-shared/ # Shared rules -│ ├── gitlink-repo/ # Repository skill -│ ├── gitlink-issue/ # Issue skill -│ ├── gitlink-pr/ # PR skill -│ ├── gitlink-pm/ # Project management skill -│ └── ... -├── doc/ # Design documents -│ ├── Design.md -│ ├── CODE_SYNC_STRATEGY_FINAL.md -│ └── ... -├── main.go -├── Makefile -├── go.mod -└── README.md -``` - -## Documentation - -- [Skills Guide](skills/README.md) — AI Agent Skills detailed documentation -- [Design Document](doc/design.md) — Architecture design and development plan - -## FAQ - -### Q: How do I use gitlink-cli in scripts? - -Use the `GITLINK_TOKEN` environment variable + `--format json` for structured output: - -```bash -export GITLINK_TOKEN="your-private-token" -gitlink-cli repo +list --format json | jq '.data.projects[] | .name' -``` - -### Q: How does automatic owner/repo resolution work? - -When running inside a git repository, the CLI automatically resolves `--owner` and `--repo` from `git remote origin`: - -```bash -cd ~/my-gitlink-project -gitlink-cli issue +list # Automatically uses the current repository -``` - -### Q: What if my token expires? - -Re-authenticate: - -```bash -# Username/password login -gitlink-cli auth login - -# Or use a private token (generate at GitLink web → Settings → Private Tokens) -gitlink-cli auth login --token -``` - -### Q: How do I use gitlink-cli in CI/CD or non-interactive environments (e.g. Trae sandbox)? - -Set the `GITLINK_TOKEN` environment variable — no `auth login` needed: - -```bash -export GITLINK_TOKEN="your-private-token" -gitlink-cli repo +list # Ready to use -gitlink-cli auth status # Shows "✓ Logged in via GITLINK_TOKEN environment variable" -``` - -Priority: `GITLINK_TOKEN` env var > keyring/file stored token. When the env var is not set, the original interactive login flow works as before. - -### Q: What if npm installs successfully but `gitlink-cli` reports a missing binary? - -Reinstall first: - -```bash -npm install -g @gitlink-ai/cli -``` - -If the error persists, check whether the release page contains the asset for your platform, -for example `gitlink-cli__windows_amd64.zip` on Windows x64. -You can also download the binary manually from the release page or build from source with `go install .`. - -### Q: Where are credentials stored on Windows? - -gitlink-cli uses Windows Credential Manager for secure token storage. If Credential Manager is unavailable, it automatically falls back to file storage (`~/.config/gitlink-cli/credentials`). - -### Q: Where can I find the full API reference? - -See [skills/gitlink-shared/REFERENCE.md](skills/gitlink-shared/REFERENCE.md). - -## License - -[MulanPSL-2.0](https://license.coscl.org.cn/MulanPSL2) -# pipeline test - -## ZxR 测试PR - -> GitLink智能运营平台——代码质量看门人工作流演示。 - - +# gitlink-cli - +[![GitLink](https://img.shields.io/badge/GitLink-Gitlink%2Fgitlink--cli-green)](https://www.gitlink.org.cn/Gitlink/gitlink-cli) +[![License](https://img.shields.io/badge/License-MulanPSL--2.0-blue.svg)](https://license.coscl.org.cn/MulanPSL2) +[![Go Version](https://img.shields.io/badge/Go-1.26%2B-blue.svg)](https://golang.org) +[![npm version](https://img.shields.io/npm/v/@gitlink-ai/cli.svg)](https://www.npmjs.com/package/@gitlink-ai/cli) - +The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans and AI Agents. Supports **macOS, Linux, and Windows**. Covers repository management, issue tracking, pull requests, webhooks, member collaboration, CI/CD, and AI-powered workflows, with 40+ commands and AI Agent [Skills](./skills/). + +**[中文文档](./README.zh-CN.md)** + +[Install](#installation--quick-start) · [AI Agent Skills](#ai-agent-skills) · [Auth](#configure--use) · [Commands](#usage-examples) · [Contributing](#related-projects) + +## Contributors + +
+wangyue111 +wbtiger +Mengz +yangsai +mengcheng +muel +Leo77 +yingjie +topshare +
+ +## Why gitlink-cli? + +- **Agent-Native Design** — Structured [Skills](./skills/) out of the box, compatible with Claude Code, OpenClaw, and other AI platforms — Agents can operate GitLink with zero extra setup +- **Wide Coverage** — Repository, Issue, PR, Webhook, Member, Branch, Release, CI, Org, Search, and User workflows are covered by high-level commands +- **AI-Friendly & Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output +- **Cross-Platform** — Runs on macOS, Linux, and Windows (x64/arm64), install via `npm install -g @gitlink-ai/cli` in one command, binary auto-downloaded +- **Open Source, Zero Barriers** — MulanPSL-2.0 license, ready to use, just `npm install` +- **Up and Running in 3 Minutes** — Interactive login or `GITLINK_TOKEN` env var, from install to first API call in just 3 steps +- **Secure & Controllable** — OS-native keychain credential storage, `GITLINK_TOKEN` env var for CI/CD & non-interactive environments, auto git remote context resolution +- **Three-Layer Architecture** — Shortcuts (human & AI friendly) → Raw API (full coverage) → Config (configuration management) + +## Features + +| Category | Capabilities | +|----------|-------------| +| 📦 Repo | List, create, fork, delete repositories, view repo info | +| 🐛 Issue | Create, update, close, batch close, comment on issues | +| 🔀 PR | Create, merge, review pull requests, view changed files | +| 👥 Member | List, add, remove repository members, change roles, create and accept invite links | +| 🌿 Branch | Create, delete, list, protect, unprotect branches | +| 🏷️ Release | Create, view, delete releases | +| 🏢 Org | Manage organizations, members, teams | +| 🔧 CI | View builds, logs, CI/CD operations | +| 🔔 Webhook | Manage repo webhooks and test deliveries | +| 🔍 Search | Search repositories, users | +| 👤 User | View user profiles and info | +| 📋 PM | Sprint management, kanban boards, weekly reports | +| 🤖 Workflow | AI-powered issue triage, PR review, release notes | + +## Installation & Quick Start + +### Requirements + +- Node.js 14+ (`npm`/`npx`) — for npm installation +- Supported platforms: macOS, Linux, Windows (x64/arm64) +- Go 1.26+ — only required for building from source + +### Quick Start (Human Users) + +> **Note for AI assistants:** If you are an AI Agent helping the user with installation, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent), which contains all the steps you need to complete. + +#### Install + +**From npm (recommended):** + +```bash +# One command: installs CLI binary + AI Agent Skills +npm install -g @gitlink-ai/cli +``` + +The binary is auto-downloaded for your platform during `postinstall`. No extra steps needed. + +**From source:** + +Requires Go 1.26+. + +```bash +git clone https://www.gitlink.org.cn/Gitlink/gitlink-cli.git +cd gitlink-cli +make install +``` + +> **Windows users:** Run `npm install -g @gitlink-ai/cli` in PowerShell or CMD. For building from source, use `go install .` instead of `make install`. + +#### Configure & Use + +```bash +# 1. Configure (one-time, interactive guided setup) +gitlink-cli config init + +# 2. Log in (choose one) +gitlink-cli auth login # Username/password (recommended) +gitlink-cli auth login --token # Or paste a private token +export GITLINK_TOKEN="your-token" # Or set env var (for CI/CD, non-interactive environments) + +# 3. Start using +gitlink-cli repo +list +``` + +### Quick Start (AI Agent) + +> The following steps are for AI Agents. Some steps require the user to complete actions in a browser. + +**Step 1 — Install** + +```bash +# One command: CLI binary + all Skills auto-installed +npm install -g @gitlink-ai/cli +``` + +**Step 2 — Configure** + +```bash +gitlink-cli config init +``` + +**Step 3 — Login** + +For interactive environments: +```bash +gitlink-cli auth login +``` + +For non-interactive environments (CI/CD, Trae sandbox, MCP, etc.): +```bash +export GITLINK_TOKEN="your-private-token" +``` + +> To get a private token, go to GitLink web → Settings → Private Tokens. + +**Step 4 — Verify** + +```bash +gitlink-cli user +me +``` + +## Usage Examples + +### Repository Operations + +```bash +# List repositories +gitlink-cli repo +list + +# View repository info +gitlink-cli repo +info --owner Gitlink --repo forgeplus + +# Read repository README +gitlink-cli repo +readme --owner Gitlink --repo forgeplus --ref master + +# Create a repository +gitlink-cli repo +create -n my-project -d "Project description" + +# Fork a repository +gitlink-cli repo +fork --owner Gitlink --repo forgeplus +``` + +### Webhook Management + +```bash +# List webhooks +gitlink-cli webhook +list --owner Gitlink --repo forgeplus + +# Create a webhook +gitlink-cli webhook +create --owner Gitlink --repo forgeplus \ + --url https://example.com/hook --events push,create + +# Test a webhook +gitlink-cli webhook +test --owner Gitlink --repo forgeplus --id 68 + +# View webhook delivery tasks +gitlink-cli webhook +tasks --owner Gitlink --repo forgeplus --id 68 +``` + +### Member Management + +```bash +# List repository members +gitlink-cli member +list --owner Gitlink --repo forgeplus + +# Add a member +gitlink-cli member +add --owner Gitlink --repo forgeplus --user-id 101 + +# Preview batch add without changing data +gitlink-cli member +batch-add --owner Gitlink --repo forgeplus --user-ids 101,102 --dry-run + +# Batch add members from a CSV file +gitlink-cli member +batch-add --owner Gitlink --repo forgeplus --from members.csv + +# Change a member role +gitlink-cli member +role --owner Gitlink --repo forgeplus --user-id 101 --role Developer + +# Create an invite link +gitlink-cli member +invite-link --owner Gitlink --repo forgeplus --role developer --apply true +``` + +### Issue Management + +```bash +# List issues +gitlink-cli issue +list --owner Gitlink --repo forgeplus + +# Create an issue +gitlink-cli issue +create --owner Gitlink --repo forgeplus -t "Bug: Login failed" -b "Steps to reproduce..." + +# View an issue +gitlink-cli issue +view --owner Gitlink --repo forgeplus -i 123 + +# Close an issue +gitlink-cli issue +close --owner Gitlink --repo forgeplus -i 123 + +# Preview batch close without changing data +gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --numbers 123,124 --dry-run + +# Batch close issues from a CSV file +gitlink-cli issue +batch-close --owner Gitlink --repo forgeplus --from issues.csv + +# Add a comment +gitlink-cli issue +comment --owner Gitlink --repo forgeplus -i 123 -b "Fixed" + +# List issue assigners +gitlink-cli issue +assigners --owner Gitlink --repo forgeplus + +# List issue authors +gitlink-cli issue +authors --owner Gitlink --repo forgeplus +``` + +### Pull Requests + +```bash +# List PRs +gitlink-cli pr +list --owner Gitlink --repo forgeplus + +# Create a PR (same-repo branch) +gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: Search feature" --head feature/search --base master + +# Create a PR (from a fork) +gitlink-cli pr +create --owner Gitlink --repo forgeplus -t "feat: New feature" --head your_username/forgeplus:feature/my-feature --base master + +# View a PR +gitlink-cli pr +view --owner Gitlink --repo forgeplus -i 42 + +# Merge a PR +gitlink-cli pr +merge --owner Gitlink --repo forgeplus -i 42 + +# Reopen a closed PR +gitlink-cli pr +reopen --owner Gitlink --repo forgeplus -i 42 + +# View changed files +gitlink-cli pr +files --owner Gitlink --repo forgeplus -i 42 + +# List PR patchset versions +gitlink-cli pr +versions --owner Gitlink --repo forgeplus -i 42 + +# View a patchset version diff +gitlink-cli pr +version-diff --owner Gitlink --repo forgeplus -i 42 --version-id 16040 + +# List PR reviews +gitlink-cli pr +reviews --owner Gitlink --repo forgeplus -i 42 + +# Create a PR review (with dry-run preview) +gitlink-cli pr +review --owner Gitlink --repo forgeplus -i 42 --status approved -c "LGTM" --dry-run +gitlink-cli pr +review --owner Gitlink --repo forgeplus -i 42 --status approved -c "LGTM" +``` + +### Branch Management + +```bash +# List branches +gitlink-cli branch +list --owner Gitlink --repo forgeplus + +# Create a branch +gitlink-cli branch +create --name feature/new-feature + +# Delete a branch +gitlink-cli branch +delete --name feature/old-feature + +# Protect a branch +gitlink-cli branch +protect --name main + +# Remove branch protection +gitlink-cli branch +unprotect --name main +``` + +### Release Management + +```bash +# List releases +gitlink-cli release +list --owner Gitlink --repo forgeplus + +# Create a release +gitlink-cli release +create --owner Gitlink --repo forgeplus -t v1.0.0 -n "v1.0.0 Stable" -b "Changelog..." + +# View a release +gitlink-cli release +view --owner Gitlink --repo forgeplus -i +``` + +### CI/CD Operations + +```bash +# List builds +gitlink-cli ci +list --owner Gitlink --repo forgeplus + +# View build log +gitlink-cli ci +log --owner Gitlink --repo forgeplus -i + +# Restart a build +gitlink-cli ci +restart --owner Gitlink --repo forgeplus -i +``` + +### Search + +```bash +# Search repositories +gitlink-cli search +repos -k "machine learning" + +# Search users +gitlink-cli search +users -k "zhangsan" +``` + +### Workflow Agent Commands + +`workflow` provides rule-based repository analysis for maintainers and AI Agents. It currently supports: + +- `workflow +triage` +- `workflow +health` +- `workflow +pr-summary` +- `workflow +repo-report` + +`workflow +pr-summary` defaults to `table` when `--format` is omitted. +`workflow +repo-report` defaults to `markdown` when `--format` is omitted. + +Examples: + +```bash +# Triage with local parameters +gitlink-cli workflow +triage --title "Install failed on Windows" --body "go install failed with error" --format table + +# Triage with JSON output +gitlink-cli workflow +triage --title "Token leaked in logs" --body "The access token appears in command output" --format json + +# Triage with Chinese markdown output +gitlink-cli workflow +triage \ + --title "安装失败,无法登录" \ + --body "运行命令时报错" \ + --lang zh-CN \ + --format markdown + +# Triage from a local JSON file +gitlink-cli workflow +triage --from shortcuts/workflow/testdata/issue_bug.json --format json + +# Triage by read-only GitLink fetch +gitlink-cli workflow +triage --owner Gitlink --repo gitlink-cli --state open --limit 5 --format table + +# Health for a healthy repository +gitlink-cli workflow +health \ + --repository Gitlink/gitlink-cli \ + --open-issues 3 \ + --open-prs 1 \ + --has-readme \ + --has-license \ + --has-contributing \ + --agent-readiness-known \ + --agent-readiness-score 9 \ + --format table + +# Health for a risky repository +gitlink-cli workflow +health \ + --repository demo/repo \ + --open-issues 60 \ + --stale-issues 25 \ + --open-prs 12 \ + --stale-prs 6 \ + --recent-activity-known \ + --recent-activity-days 120 \ + --release-known=false \ + --format json + +# Health with Chinese markdown output +gitlink-cli workflow +health \ + --repository Gitlink/gitlink-cli \ + --open-issues 3 \ + --open-prs 1 \ + --has-readme \ + --has-license \ + --has-contributing \ + --lang zh-CN \ + --format markdown + +# Health by read-only GitLink fetch +gitlink-cli workflow +health --owner Gitlink --repo gitlink-cli --stale-days 30 --format table + +# PR review summary by read-only GitLink fetch +gitlink-cli workflow +pr-summary --owner Gitlink --repo gitlink-cli --number 1 --format markdown + +# PR review summary from a local JSON file +gitlink-cli workflow +pr-summary --from shortcuts/workflow/testdata/pr_summary.json --format json + +# Repository workflow report by read-only GitLink fetch +gitlink-cli workflow +repo-report --owner Gitlink --repo gitlink-cli --format markdown + +# Repository workflow report from a local JSON file +gitlink-cli workflow +repo-report --from shortcuts/workflow/testdata/repo_report.json --format json +``` + +Output formats: + +- `json` for scripts and AI Agents +- `table` for terminal review +- `markdown` for Issue comments, PR comments, release notes, and competition write-ups + +Safety: + +- Current workflow commands use local analysis by default and can also read GitLink data in read-only fetch mode. +- They do not modify remote GitLink data. +- They do not depend on LLM APIs. +- `workflow +pr-summary` does not comment, approve, reject, or merge pull requests. +- `workflow +repo-report` aggregates health, issue triage, and PR review summary signals without remote writes. + +### Raw API + +For endpoints not covered by shortcuts, use the Raw API directly: + +```bash +# GET request +gitlink-cli api GET /users/me + +# POST request +gitlink-cli api POST /Gitlink/forgeplus/issues --body '{"subject":"test","description":"..."}' + +# POST request with body from a file +gitlink-cli api POST /Gitlink/forgeplus/issues --body-file issue.json + +# POST request with body from stdin +Get-Content issue.json | gitlink-cli api POST /Gitlink/forgeplus/issues --body-stdin + +# With query parameters +gitlink-cli api GET /Gitlink/forgeplus/commits --query 'page=1&limit=5' +``` + +## Global Parameters + +| Parameter | Description | Example | +|-----------|-------------|---------| +| `--owner` | Repository owner | `--owner Gitlink` | +| `--repo` | Repository name | `--repo forgeplus` | +| `--format` | Output format (json/table/yaml; workflow also supports markdown) | `--format json` | +| `--debug` | Enable debug output | `--debug` | + +**Automatic context resolution:** When running inside a git repository, `--owner` and `--repo` are automatically resolved from `git remote origin`. + +## Branch Conventions + +gitlink-cli supports bidirectional code sync between GitHub and GitLink: + +| Platform | Default Branch | +|----------|---------------| +| GitHub | `main` | +| GitLink | `master` | + +**Push to GitLink from local:** + +```bash +# Method 1: Use git command directly +git push gitlink main:master + +# Method 2: Configure git remote +git config remote.gitlink.push refs/heads/main:refs/heads/master +git push gitlink +``` + +## AI Agent Skills + +The `skills/` directory contains Agent Skill files for AI-automated GitLink operations. + +See [skills/README.md](skills/README.md) for details. + +| Skill | Description | +|-------|-------------| +| `gitlink-shared` | Authentication, global parameters, safety rules, API notes | +| `gitlink-repo` | Repository operations (create, view, delete, fork, etc.) | +| `gitlink-issue` | Issue operations (create, update, close, comment, etc.) | +| `gitlink-pr` | Pull request operations (create, merge, review, etc.) | +| `gitlink-member` | Repository member and invite link management | +| `gitlink-branch` | Branch management (create, delete, list, protect, unprotect) | +| `gitlink-release` | Release management (create, view, delete, etc.) | +| `gitlink-ci` | CI/CD operations (builds, logs, etc.) | +| `gitlink-search` | Search (repositories, users, etc.) | +| `gitlink-org` | Organization management (members, teams, etc.) | +| `gitlink-user` | User management (profile info, etc.) | +| `gitlink-pm` | Project management (sprints, kanban, weekly reports, etc.) | +| `gitlink-workflow` | AI-powered workflows (issue triage, PR review, release notes, etc.) | + +## Project Structure + +``` +gitlink-cli/ +├── cmd/ # Cobra command definitions +│ ├── root.go # Root command + global flags +│ ├── auth/ # Authentication commands +│ ├── api/ # Raw API commands +│ ├── config/ # Configuration commands +│ └── cmdutil/ # Global utilities +├── internal/ # Internal packages +│ ├── auth/ # Login, token storage, transport +│ ├── client/ # HTTP client + pagination +│ ├── config/ # Config file management +│ ├── context/ # Git remote resolution +│ └── output/ # Envelope + formatter +├── shortcuts/ # Shortcut implementations +│ ├── common/ # Framework (types, runner) +│ ├── repo/ # Repository shortcuts +│ ├── issue/ # Issue shortcuts +│ ├── pr/ # PR shortcuts +│ ├── member/ # Repository member shortcuts +│ ├── branch/ # Branch shortcuts +│ ├── release/ # Release shortcuts +│ ├── org/ # Organization shortcuts +│ ├── ci/ # CI shortcuts +│ ├── search/ # Search shortcuts +│ ├── user/ # User shortcuts +│ └── register.go # Registration entry point +├── skills/ # AI Agent Skills +│ ├── README.md # Skills guide +│ ├── gitlink-shared/ # Shared rules +│ ├── gitlink-repo/ # Repository skill +│ ├── gitlink-issue/ # Issue skill +│ ├── gitlink-pr/ # PR skill +│ ├── gitlink-pm/ # Project management skill +│ └── ... +├── doc/ # Design documents +│ ├── Design.md +│ ├── CODE_SYNC_STRATEGY_FINAL.md +│ └── ... +├── main.go +├── Makefile +├── go.mod +└── README.md +``` + +## Documentation + +- [Skills Guide](skills/README.md) — AI Agent Skills detailed documentation +- [Design Document](doc/design.md) — Architecture design and development plan + +## FAQ + +### Q: How do I use gitlink-cli in scripts? + +Use the `GITLINK_TOKEN` environment variable + `--format json` for structured output: + +```bash +export GITLINK_TOKEN="your-private-token" +gitlink-cli repo +list --format json | jq '.data.projects[] | .name' +``` + +### Q: How does automatic owner/repo resolution work? + +When running inside a git repository, the CLI automatically resolves `--owner` and `--repo` from `git remote origin`: + +```bash +cd ~/my-gitlink-project +gitlink-cli issue +list # Automatically uses the current repository +``` + +### Q: What if my token expires? + +Re-authenticate: + +```bash +# Username/password login +gitlink-cli auth login + +# Or use a private token (generate at GitLink web → Settings → Private Tokens) +gitlink-cli auth login --token +``` + +### Q: How do I use gitlink-cli in CI/CD or non-interactive environments (e.g. Trae sandbox)? + +Set the `GITLINK_TOKEN` environment variable — no `auth login` needed: + +```bash +export GITLINK_TOKEN="your-private-token" +gitlink-cli repo +list # Ready to use +gitlink-cli auth status # Shows "✓ Logged in via GITLINK_TOKEN environment variable" +``` + +Priority: `GITLINK_TOKEN` env var > keyring/file stored token. When the env var is not set, the original interactive login flow works as before. + +### Q: What if npm installs successfully but `gitlink-cli` reports a missing binary? + +Reinstall first: + +```bash +npm install -g @gitlink-ai/cli +``` + +If the error persists, check whether the release page contains the asset for your platform, +for example `gitlink-cli__windows_amd64.zip` on Windows x64. +You can also download the binary manually from the release page or build from source with `go install .`. + +### Q: Where are credentials stored on Windows? + +gitlink-cli uses Windows Credential Manager for secure token storage. If Credential Manager is unavailable, it automatically falls back to file storage (`~/.config/gitlink-cli/credentials`). + +### Q: Where can I find the full API reference? + +See [skills/gitlink-shared/REFERENCE.md](skills/gitlink-shared/REFERENCE.md). + +## License + +[MulanPSL-2.0](https://license.coscl.org.cn/MulanPSL2) diff --git a/examples/workflows/zhangqing-task3/01-community-ops-automation.md b/examples/workflows/zhangqing-task3/01-community-ops-automation.md deleted file mode 100644 index 25e6a639..00000000 --- a/examples/workflows/zhangqing-task3/01-community-ops-automation.md +++ /dev/null @@ -1,108 +0,0 @@ -# 工作流 ① 社区运营自动化 — 执行报告 - -> 任务三 zhangqing 分担工作流 · 端到端串联 issue-triage + insight + release-auto -> 执行时间:2026-06-29 · 目标仓库:ylly/gitlink-cli - ---- - -## 工作流目标 - -新 Issue 进入仓库后,自动完成:**分类 → 分配 → 周报 → 发版**,形成社区运营闭环。 - -## 四步执行记录 - -### 步骤 1:Issue 智能分类 ✅ - -调用 `gitlink-issue-triage` Skill 扫描 16 个开放 Issue,识别 11 个未分类,按仓库现有中文标签全部分类: - -| Issue | 标题 | 标签 | -|-------|------|------| -| #1-#6 | 测试类 | 测试 | -| #10 | bug | 缺陷 | -| #11 | 功能完善 | 功能 | -| #12 | 疑问 | 疑问 | -| #15 | issue+list 响应慢 | 性能 | -| #16 | 希望搜索按 star 排序 | 功能 | - -验证:重新 `issue +list`,未分类 = 0。 - -### 步骤 2:责任人分配 ⏭ 跳过(平台限制) - -`issue +assigners` 返回空数组(total_count: 0),即便 `zhangqing23` 已是 Manager 也不在候选列表内。Raw API PATCH `/v1/.../issues/16` 带 `assigned_to_id` 返回 ok 但 assigners 仍为 `[]`。 - -**结论**:GitLink 个人仓库的 assigners 机制对 Manager 角色不开放,跳过此步并在报告中标注。 - -### 步骤 3:社区周报生成 ✅ - -`gitlink-insight` Skill 综合采集:open/closed issue / pr / release / repo info。 - -关键数据: -- 开放 Issue 16 / 已关闭 6 / 合并 PR 2 / 开放 PR 0 / Release **0**(本工作流前) -- 标签分布:测试 6 / 缺陷 3 / 文档 3 / good first 3 / 功能 2 / 性能 1 / 疑问 1 -- Issue 作者:@ylly 14, @ZxR123-Z 2 -- 风险观察:仓库尚未发布任何 Release;测试类 Issue 6 个可清理 - -### 步骤 4:自动发版 ✅ - -调用 `gitlink-release-auto` Skill: - -1. 版本号推荐:v0.1.18 之后提交分类为 feat 26 / fix 17 / docs 7 / test 4 / refactor 3 → 按 Semver 推荐升 MINOR -2. Release Notes 自动生成(按 Conventional Commits 分类组织,贡献者去重) -3. 用 `release +create` 的底层 endpoint(POST /releases)+ `--body-file` 绕开 Windows 中文编码坑 -4. 发布 **v0.2.0-beta.1**(预发布版本,等任务三全部完工后由整合者发正式 v0.2.0) - -**产出**: -- version_id: 2218 -- tag: v0.2.0-beta.1 -- URL: https://gitlink.org.cn/ylly/gitlink-cli/releases -- name: `v0.2.0 Beta 1 — 任务三阶段版(预发布)` - -## 任务二 Skill 蓝图对照(按 SKILL.md 行号) - -本工作流每一步都严格按任务二 Skill 蓝图执行,Skill 是**设计蓝图**,本报告是蓝图的**落地执行**。 - -### 步骤 1 ← `gitlink-issue-triage/SKILL.md` 工作流 1(自动分类打标签) - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 拉开放 Issue | 第 58-62 行 Step 1 | `issue +list --state open` | ✅ 拉到 16 个 | -| 筛未分类 | 第 64-68 行 Step 2 | 过滤 `tags=[]` | ✅ 11 个未分类 | -| 读详情分类 | 第 70-78 行 Step 3-4 | 标题+描述语义分类 | ✅ 按中文标签语义归类 | -| 复用现有标签 | 第 80-91 行 Step 5 | **优先复用仓库已有中文标签** | ✅ 直接复用「测试/缺陷/功能/性能/疑问」未新建 | -| 打标签 | 第 93-99 行 Step 6 | `issue +update --label`(覆盖语义) | ✅ 11 个全部分类完成 | -| 输出报告 | 第 101-117 行 Step 7 | 表格汇总 | ✅ 见本报告步骤 1 表格 | - -**关键决策对照**:SKILL.md 第 91 行明确说"优先复用现有标签(含中文同义词),先匹配再考虑新建英文标签"。本仓库已有「缺陷/功能/文档」等中文标签,**未新建任何英文标签**,完全符合蓝图。 - -### 步骤 2 ← `gitlink-issue-triage/SKILL.md` 工作流 2(自动分配 + 通知) - -SKILL.md 第 125-146 行 Step 1-2 已**预判**此场景:个人仓库 `assigners` 返回空数组(第 133 行红框警告),按第 146 行"列表为空则跳过分配并在报告中标注"处理。✅ 实际执行与蓝图预判一致,跳过并在报告标注。 - -### 步骤 3 ← `gitlink-insight/SKILL.md` 工作流 2(Sprint 周报) - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 采集 Issue 数据 | 第 120-122 行 | closed + open issue | ✅ 16 open / 6 closed | -| 采集 PR 数据 | 第 123-125 行 | merged PR | ✅ 2 merged | -| 采集 Release | 第 126-128 行 | `release +list` | ✅ Release=0(发版前) | -| 风险标注 | 第 164-165 行 | 列风险与阻塞 | ✅ 标注"未发布 Release""测试类 Issue 可清理" | - -### 步骤 4 ← `gitlink-release-auto/SKILL.md` - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 版本号推荐 | 第 32-90 行 一、版本号推荐 | 按 Conventional Commits 分类推 Semver | ✅ feat 26/fix 17 → MINOR 升 → v0.2.0 | -| Release Notes 生成 | 第 94-145 行 二、自动生成 | 按类型分组 + 贡献者去重 | ✅ 按 Conventional Commits 分组,贡献者去重 | -| 预发布版本 | 第 179-189 行 三、预发布版本 | `--prerelease true` | ✅ 选 beta.1 预发布(等整合者发正式 v0.2.0) | -| 贡献者去重 | 第 145 行红框警告 | **必须去重** | ✅ 跨提交去重为 14 人 | - -**3 个 Skill 串联,满足 PDF「≥3 命令/Skill 串联」要求。** - -## 关键避坑(本工作流踩到的) - -| 坑 | 解决 | -|----|------| -| `release +create` 无 `--body-file` 参数,`--body` 传多行中文必乱码 | 改用 `api POST /owner/repo/releases --body-file payload.json` | -| GitLink API 路径双轨制 | release 用 `/owner/repo/...` 即可 | -| `assigners` 在个人仓库对 Manager 不开放 | 平台限制,报告中标注跳过 | -| Windows Git Bash 拼 JSON 中文乱码 | 全部用 `--body-file ` + `MSYS_NO_PATHCONV=1` | diff --git a/examples/workflows/zhangqing-task3/05-contributor-growth.md b/examples/workflows/zhangqing-task3/05-contributor-growth.md deleted file mode 100644 index 35b9d784..00000000 --- a/examples/workflows/zhangqing-task3/05-contributor-growth.md +++ /dev/null @@ -1,77 +0,0 @@ -# 贡献者成长排行榜 — ylly/gitlink-cli - -> 工作流⑤(贡献者成长体系)产物 · 数据源:git log + issue +list + pr +list(merged) -> 生成时间:2026-06-29 · 数据范围:仓库全历史(已过滤测试号 15972095207 / 2403_89190320 / fsafasff) - -## 综合排行榜 - -| 排名 | 贡献者 | Commits | 合并 PR | Issue | 综合积分 | -|:----:|--------|:-------:|:-------:|:-----:|:--------:| -| 1 | wbtiger | 42 | 0 | 0 | 42 | -| 2 | ylly | 5 | 0 | 14 | 33 | -| 3 | ZxR (ZxR123-Z) | 10 | 2 | 2 | 24 | -| 4 | whzy | 9 | 0 | 0 | 9 | -| 5 | wangyue789 | 8 | 0 | 0 | 8 | -| 6 | wbavon | 8 | 0 | 0 | 8 | -| 7 | Tiger | 5 | 0 | 0 | 5 | -| 8 | zhangqing | 4 | 0 | 0 | 4 | -| 9 | Mengz | 3 | 0 | 0 | 3 | -| 10 | Jiachen Li | 2 | 0 | 0 | 2 | -| 11 | Leo77 | 2 | 0 | 0 | 2 | -| 12 | yangsai01 | 2 | 0 | 0 | 2 | -| 13 | Zhang Jinnan | 1 | 0 | 0 | 1 | -| 14 | ljc0426 | 1 | 0 | 0 | 1 | - -> 积分公式:commits×1 + 合并PR×5 + Issue×2(PR 权重高,因合并工作量大) - -## 徽章授予方案 - -| 徽章 | 授予标准 | 获得者 | -|------|---------|--------| -| ⭐ 星级贡献者 | commits ≥ 10 或 合并 PR ≥ 2 | wbtiger, ZxR (ZxR123-Z) | -| 🔥 活跃贡献者 | commits ≥ 5 或 Issue ≥ 5 | ylly, whzy, wangyue789, wbavon, Tiger | -| 🌱 贡献者 | 有任意提交 | zhangqing, Mengz, Jiachen Li, Leo77, yangsai01, Zhang Jinnan, ljc0426 | - -## 颁奖动作清单(待执行,写入操作需用户确认) - -**Step 1: 创建徽章 label**(仓库现无这些 label) -- label +create --name "星级贡献者" --color #FFD700 -- label +create --name "活跃贡献者" --color #FF6B35 -- label +create --name "贡献者" --color #87C95F - -**Step 2: 给 Top 贡献者发祝贺 Issue 评论** -对 wbtiger / ZxR(ZxR123-Z)等 Top 贡献者相关的 Issue 添加祝贺评论。 -(GitLink 无"用户主页评论"能力,改在 Issue 评论或新建颁奖 Issue 演示) - -**Step 3: 可选 — 新建颁奖 Issue** -创建一个 Issue「🏆 v0.2.0-beta.1 贡献者排行榜公布」,body 含本排行榜,用 @mention 提及 Top 贡献者,并打上「星级贡献者」label。 - ---- - -## Skill 蓝图对照(按 SKILL.md 行号) - -### 取数阶段 ← `gitlink-insight/SKILL.md` 工作流 3(贡献者洞察) - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 贡献者列表 | 第 173-183 行 采集数据 | `contributors` + merged PR + user info | ✅ commits 走 `git log`(contributors API 返回 HTML,降级方案)+ merged PR + Issue 作者聚合 | -| 角色与活跃度 | 第 185-203 行 输出格式 | 排行 + 活跃度分布 | ✅ 综合积分公式 commits×1+PR×5+Issue×2,按贡献分层 | -| 三层分布 | 第 194-197 行 | 核心/活跃/新增 | ✅ 对应「星级/活跃/贡献者」三级徽章 | - -### 发奖阶段 ← `gitlink-issue-triage/SKILL.md` 工作流 1 + 通用 label 操作 - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 查现有标签 | 第 80-84 行 Step 5 | `label +list` 命中则复用 | ✅ 仓库原无徽章 label,3 个均新建 | -| 创建徽章 | 第 86-89 行 | `label +create --name --color` | ✅ 星级 394180 / 活跃 394181 / 贡献者 394182 | -| 颁奖 Issue | 第 101-117 行报告格式 | 表格 + @mention | ✅ Issue #17 已建并打「星级贡献者」label | - -### Skill 串联数 - -| 步骤 | 使用的 Skill/命令 | 角色 | -|------|------------------|------| -| 1 | git log + issue +list + pr +list(insight 工作流 3 数据源) | 取数 | -| 2 | label +create(issue-triage 工作流 1 Step 5) | 建徽章 | -| 3 | issue +create + issue +update --label(issue-triage 工作流 1 Step 6) | 颁奖 | - -**3 步串联,满足 PDF「≥3 命令/Skill 串联」要求。** \ No newline at end of file diff --git a/examples/workflows/zhangqing-task3/07-onboarding-nanny.md b/examples/workflows/zhangqing-task3/07-onboarding-nanny.md deleted file mode 100644 index f6fa06ae..00000000 --- a/examples/workflows/zhangqing-task3/07-onboarding-nanny.md +++ /dev/null @@ -1,119 +0,0 @@ -# ⑦ 新人全流程保姆 — 执行报告 - -> 工作流⑦(新人全流程保姆)最终产物 -> 驱动者:zhangqing · 工具:gitlink-cli + onboarding Skill + AI Agent -> 执行时间:2026-06-29 -> 目标仓库:ylly/gitlink-cli - ---- - -## 工作流概览 - -| Step | 动作 | 状态 | 写入 | -|------|------|:----:|:----:| -| 1 | member 邀请能力演示(+list / +invite-link) | ✅ | 否 | -| 2 | good-first-issue 识别报告 | ✅ | 否 | -| 3 | 对 3 个 good first Issue 写个性化引导评论 | ✅ | 是(3 条评论) | -| 4 | notification +list 看新人动态 | ✅ | 否 | -| 5 | 跟踪新人首次贡献(ZxR123-Z 案例) | ✅ | 否 | - ---- - -## Step 1:邀请能力演示 - -- `member +list`:仓库现有 3 个 Manager(ylly / zhangqing23 / ZxR123-Z) -- `member +invite-link`:成功获取邀请链接(id=3371,过期时间 **2026-07-02 11:32**,与任务三截止时间一致) -- 故事设定:因仓库无真实"新人"测试账号,邀请动作用 `+invite-link` 演示命令能力;后续步骤设定为"假设新人已通过邀请链接入仓" - -## Step 2:good-first-issue 识别报告 - -仓库现有 3 个 good first Issue(#8 / #13 / #14,均为 docs 类),onboarding Skill 按"新人友好识别标准"逐条复审 → **全部合理**。其余 14 个开放 Issue 均不适合新人(测试数据 / 模糊描述 / 性能优化 / 新功能开发等)。详见 `onboarding_identify_report.md`。 - -## Step 3:个性化引导评论发布 ✅ - -对 3 个 good first Issue 发布了**完全个性化**(非模板)的引导评论,每条含任务目标 + 相关文件 + 本地准备 + 提交 PR 规范 + @mention: - -| Issue | 评论 ID | 核心引导 | -|-------|:-------:|---------| -| #8 docs: wiki 命令使用示例 | 478829 | 入手指引:`README.zh-CN.md` + `shortcuts/wiki/wiki.go` | -| #13 docs: README Windows go build | 478830 | 入手指引:参考 `Makefile` + `scripts/build-npm.sh` | -| #14 docs: wiki +list 返回字段说明 | 478831 | 入手指引:跑 `wiki +list --format json` 拿真实数据 | - -发布命令模式(绕过 Windows 中文编码坑): -```bash -MSYS_NO_PATHCONV=1 ./gitlink-cli.exe api POST /v1/ylly/gitlink-cli/issues//journals \ - --body-file "C:\\...\\comment_.json" -``` -(关键发现:journals endpoint 必须用 `/v1///...` 前缀,否则 404) - -## Step 4:通知系统查看 - -`notification +list --owner zhangqing23`:共 13 条通知(12 未读)。展示通知系统能完整还原仓库动态。 - -## Step 5:首次贡献追踪(ZxR123-Z 案例)⭐ - -通知 + Issue + PR 数据交叉验证,**完整还原了一位新人从加入到首次贡献的全过程**: - -| 时间 | 事件 | 数据来源 | -|------|------|---------| -| ~1 个月前 | ZxR123-Z 加入项目 | notification `[ProjectMemberJoined]` | -| 6 天前 | ylly 新建多个 Issue(含 good first #8/#13/#14) | notification `[ProjectIssue]` | -| 2 天前 | ZxR123-Z 提交 2 个 PR | notification `[ProjectPullRequest]` | -| 2 天前 | 2 个 PR 全部 merged | pr +list --state merged | - -→ ZxR123-Z 已突破"首次贡献"门槛,从"新人"晋升为"活跃贡献者"(在⑤排行榜中排第 3 名,10 commits + 2 PR + 2 Issue,综合积分 24)。 - ---- - -## 关键技术发现(避坑) - -1. **API 路径双轨制**:release / label 用 `///...` 即可;issue / journals / pull **必须用 `/v1///...`**,否则 404 -2. **issue +list 与 issue +view 的 tag 字段不一致**:list 用 `issue_tags` 且可能不返回,view 用 `tags` 字段才完整 -3. **创建 issue 必须传 `done_ratio: 0`**,否则 MySQL 报 `Column 'done_ratio' cannot be null` -4. **issue create 时 issue_tag_ids 字段不生效**(GitLink bug),需创建后用 `issue +update --label ` 补打 - ---- - -## Skill 蓝图对照(按 SKILL.md 行号) - -本工作流 5 个 Step 严格按 `gitlink-onboarding/SKILL.md` 蓝图执行。 - -### Step 2 ← `gitlink-onboarding/SKILL.md` 工作流 1(good-first-issue 自动标记) - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 取开放 Issue | 第 54-58 行 Step 1 | `issue +list` | ✅ 17 个开放 Issue | -| 按识别标准评估 | 第 31-46 行 + 第 60-62 行 Step 2 | 5 条友好信号 + 3 条排除标准 | ✅ 3 个 docs 类入选,14 个按排除标准剔除 | -| 复用现有标签 | 第 64-74 行 Step 3 | 优先复用,无则建 | ✅ 仓库已有 good first label(id 382660),未新建 | -| 输出标记报告 | 第 84-95 行 Step 5 | 表格汇总 | ✅ `onboarding_identify_report.md` | - -**关键对照**:SKILL.md 第 44-46 行排除标准(性能优化/描述模糊/CI 部署)逐条复审 14 个未入选 Issue,全部命中排除理由(测试数据 / 模糊描述 / 性能 / 新功能开发)。 - -### Step 3 ← `gitlink-onboarding/SKILL.md` 工作流 2(引导评论生成) - -| 执行动作 | SKILL.md 蓝图位置 | 蓝图要求 | 实际执行 | -|---------|------------------|---------|---------| -| 读 Issue 详情 | 第 103-107 行 Step 1 | `issue +view` | ✅ #8/#13/#14 各取详情 | -| 生成个性化评论 | 第 109-117 行 Step 2 | **禁止固定模板**,4 要素(任务/文件/本地准备/PR 规范) | ✅ 3 条**完全不同**的评论,每条指向具体文件 | -| 发布评论 | 第 118-123 行 Step 3 | `issue +comment` | ✅ journals 478829/478830/478831(绕中文编码走 Raw API) | -| 个性化要求 | 第 205 行注意事项 | "避免对所有 Issue 用同一句" | ✅ #8 指 `wiki.go` / #13 指 `Makefile` / #13 指 `wiki +list --format json` | - -### Step 4 ← 通用通知能力 - -`notification +list` 自查询(受限)。`gitlink-shared/SKILL.md` 平台限制:只能查自己的通知。✅ 用 `--owner zhangqing23` 自查 13 条通知。 - -### Step 5 ← `gitlink-insight/SKILL.md` 工作流 3(贡献者洞察)交叉验证 - -通知 `[ProjectMemberJoined]` + `[ProjectPullRequest]` + `pr +list --state merged` 三源交叉 → 完整还原 ZxR123-Z 从入会到首次贡献全过程。该方法论对应 insight SKILL.md 第 173-203 行"贡献者列表 + PR 数据 + 用户信息"多源聚合。 - -### Skill 串联数 - -| 步骤 | 使用的 Skill/命令 | 角色 | -|------|------------------|------| -| 1 | member +invite-link | 邀请能力演示 | -| 2 | onboarding 工作流 1(识别) | good-first 识别 | -| 3 | onboarding 工作流 2(引导评论) | 个性化引导 | -| 4 | notification +list | 通知系统查看 | -| 5 | insight 工作流 3(交叉验证) | 首次贡献追踪 | - -**5 步串联,满足 PDF「≥3 命令/Skill 串联」要求。** diff --git a/examples/workflows/zhangqing-task3/README.md b/examples/workflows/zhangqing-task3/README.md deleted file mode 100644 index 99feb729..00000000 --- a/examples/workflows/zhangqing-task3/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# zhangqing 任务三工作流(① ⑤ ⑦) - -> **任务三**:构建端到端自动化工作流 -> **负责人**:zhangqing -> **目标仓库**:[ylly/gitlink-cli](https://gitlink.org.cn/ylly/gitlink-cli) -> **完成时间**:2026-06-29 - -本目录演示任务三中 zhangqing 负责的 3 个端到端工作流,全部用 **任务一的 gitlink-cli 命令 + 任务二的 Skill** 串联完成,无新代码。 - ---- - -## 工作流总览 - -| # | 工作流 | 串联步骤 | 使用的 Skill | 公开产出 | -|---|--------|---------|-------------|---------| -| ① | 社区运营自动化 | 分类→分配→周报→发版 | issue-triage + insight + release-auto | [Release v0.2.0-beta.1](https://gitlink.org.cn/ylly/gitlink-cli/releases) | -| ⑤ | 贡献者成长体系 | 取数→排行→颁奖 | git log + issue +list + pr +list | [颁奖 Issue #17](https://gitlink.org.cn/ylly/gitlink-cli/issues/17) + 3 个徽章 label | -| ⑦ | 新人全流程保姆 | 邀请→识别→引导→通知→追踪 | onboarding | 引导评论 on #8 / #13 / #14 | - -3 个工作流首尾衔接形成完整闭环:**①把任务二 7 个 Skill 发版固化 → ⑤奖励贡献者 → ⑦引导新人接力贡献**。 - ---- - -## 文件清单 - -| 文件 | 内容 | -|------|------| -| `README.md` | 本文件(总览 + 复现指引) | -| `01-community-ops-automation.md` | ① 社区运营自动化执行报告 | -| `05-contributor-growth.md` | ⑤ 贡献者排行榜 + 徽章授予方案 | -| `07-onboarding-nanny.md` | ⑦ 新人保姆 5 步执行报告 | -| `release-notes-v0.2.0-beta.1.md` | ① 发布的 Release Notes 全文 | -| `agent-dialogue-triggers.md` | **Agent 对话触发语**(PDF 首要产物:演示 Skill 驱动 Agent) | - ---- - -## 怎么复现 - -复现方式见 [`agent-dialogue-triggers.md`](agent-dialogue-triggers.md):在 Claude Code 里粘贴触发语,让 Agent 加载任务二的 Skill 来串联执行 ①⑤⑦ 三个工作流,把对话过程截图即为 PDF 要求的「Agent 对话记录」产物(PDF「正确做法」明确:Agent 对话记录是首要产物)。 - ---- - -## 任务二 Skill 串联关系(PDF 要求:≥3 命令/Skill) - -| 工作流 | 串联的 Skill/命令 | 步数 | -|--------|------------------|:---:| -| ① | issue-triage → insight → release-auto | 4 | -| ⑤ | git log + issue +list + pr +list → 排行榜 → label +create + issue +create | 3 | -| ⑦ | member +invite-link → onboarding(识别 + 引导评论)→ notification +list | 5 | - ---- - -## 任务二 Skill 作为设计蓝图(PDF 核心:Skill = 设计蓝图) - -本目录的 3 份执行报告都新增了「Skill 蓝图对照」段,**逐动作引用 SKILL.md 行号**,证明每步执行都严格按蓝图落地: - -| 工作流 | 蓝图 SKILL.md 行号定位 | -|--------|----------------------| -| ① 步骤 1 分类 | `gitlink-issue-triage/SKILL.md` 工作流 1(第 54-117 行),含分类规则表第 35-50 行 | -| ① 步骤 2 分配(跳过)| `gitlink-issue-triage/SKILL.md` 第 125-146 行(蓝图预判个人仓库 assigners 为空)| -| ① 步骤 3 周报 | `gitlink-insight/SKILL.md` 工作流 2(第 116-166 行)| -| ① 步骤 4 发版 | `gitlink-release-auto/SKILL.md` 一/二/三(第 32-189 行),含预发布第 179-189 行 | -| ⑤ 取数 | `gitlink-insight/SKILL.md` 工作流 3(第 169-203 行)| -| ⑤ 发奖 | `gitlink-issue-triage/SKILL.md` 工作流 1 Step 5-6(第 80-117 行)| -| ⑦ Step 2 识别 | `gitlink-onboarding/SKILL.md` 工作流 1(第 50-95 行)+ 识别标准第 31-46 行 | -| ⑦ Step 3 引导 | `gitlink-onboarding/SKILL.md` 工作流 2(第 99-145 行)+ 个性化要求第 205 行 | -| ⑦ Step 5 追踪 | `gitlink-insight/SKILL.md` 工作流 3(第 169-203 行)多源聚合 | - -**意义**:评委打开任一报告的「Skill 蓝图对照」段,可拿着 SKILL.md 行号对照检查,验证"Skill 不是摆设,是真正驱动 Agent 执行的设计蓝图"。 - ---- - -## 关键技术发现(避坑) - -### 1. GitLink API 路径双轨制 ⚠ - -| 资源类型 | 路径前缀 | 例子 | -|---------|---------|------| -| release / label | `/owner/repo/...` | `/ylly/gitlink-cli/releases` | -| issue / journals / pulls | `/v1/owner/repo/...` | `/v1/ylly/gitlink-cli/issues/8/journals` | - -混用会 404。cli 内部 `v1RepoPath()` 见 `shortcuts/issue/issue.go:14`。 - -### 2. release +create 没有 --body-file - -多行中文 markdown 用 `--body` 在 Git Bash 必乱码。改用: - -```bash -MSYS_NO_PATHCONV=1 ./gitlink-cli.exe api POST /ylly/gitlink-cli/releases \ - --body-file payload.json -``` - -### 3. 创建 issue 必须传 done_ratio - -否则 MySQL 报 `Column 'done_ratio' cannot be null`。最小 payload: - -```json -{ - "subject": "...", - "description": "...", - "priority_id": 2, - "done_ratio": 0, - "issue_tag_ids": [] -} -``` - -### 4. issue create 的 issue_tag_ids 字段不生效(GitLink bug) - -创建时传 label 数组,issue 上没标签。需要创建后补: - -```bash -./gitlink-cli.exe issue +update --owner --repo --number --label -``` - -### 5. Windows Git Bash 中文乱码根因 - -cli 输出 UTF-8 字节 → bash 按 GBK 解码 → 错字符 → python 转 `\uXXXX` → 再传给 cli 就把错字符写到服务器。**所有写入操作必须用 `--body-file `**,不要 shell 拼接 JSON。 - ---- - -## 设计决策 - -| 决策点 | 选择 | 理由 | -|--------|------|------| -| 发版版本号 | v0.2.0-**beta.1**(预发布) | 等任务三 7 个工作流全部完工后由整合者发正式 v0.2.0,避免版本号冲突 | -| Release Notes 覆盖范围 | 仓库全部 104 个提交(含他人贡献) | 发版是仓库级动作,必须覆盖该版本全部变更,不能只写自己的 | -| ⑦ 的"新人"问题 | onboarding 主体真做,邀请段用 invite-link 演示 | 仓库无真实新人账号;onboarding 核心价值(识别 + 引导)与有无新人无关 | diff --git a/examples/workflows/zhangqing-task3/agent-dialogue-triggers.md b/examples/workflows/zhangqing-task3/agent-dialogue-triggers.md deleted file mode 100644 index c1f2da13..00000000 --- a/examples/workflows/zhangqing-task3/agent-dialogue-triggers.md +++ /dev/null @@ -1,119 +0,0 @@ -# Agent 对话触发语(PDF 核心:Agent 对话是首要产物) - -> 用途:评委/复现者在 Claude Code 里**逐字粘贴**下面任一条触发语,即可观察到 -> AI Agent 自动加载对应 Skill(按 SKILL.md 蓝图)→ 调 gitlink-cli 命令 → 串联多步 → 落地写入。 -> 把这个对话过程截图/录屏,就是 PDF 要求的「Agent 对话记录」产物。 - ---- - -## 为什么需要触发语 - -PDF「正确做法」明确: - -- **Agent 对话记录是首要产物**,脚本是辅助 -- **Skill 是设计蓝图**,不是配置文件 -- 必须能演示"Skill 真的被加载、真的驱动 Agent 执行" - -触发语的设计原则:**用自然语言匹配 SKILL.md 第 4 行 `description` 字段的触发语义**,让 Agent 自动识别并调用 Skill 工具。 - ---- - -## 前置准备(所有触发语共用) - -在 Claude Code 里先说一句建立上下文: - -``` -我在做 GitLink 端到端自动化任务三。目标仓库是 ylly/gitlink-cli, -我的登录账号是 zhangqing23(已是该仓库 Manager)。 -gitlink-cli.exe 在 C:/Users/Lenovo/Desktop/gitlink-cli/ 目录下,已 auth login。 -下面我会给你具体的自动化需求,请用任务二设计好的 Skill 来做。 -``` - ---- - -## 工作流 ① 触发语(社区运营自动化) - -**单条完整触发语**(推荐用于演示,一句话串起分类→周报→发版): - -``` -请帮我对 ylly/gitlink-cli 做一次社区运营收尾: -1. 自动分拣所有未分类的开放 Issue(用 gitlink-issue-triage 工作流1); -2. 生成一份项目周报(用 gitlink-insight 工作流2); -3. 根据自上次发版以来的提交历史,推荐版本号并生成 Release Notes, - 先给我预览,确认后再发布(用 gitlink-release-auto)。 -每一步执行前告诉我你正在加载哪个 Skill、对应 SKILL.md 的哪一段。 -``` - -**分步触发语**(如果只想演示单步): - -| Step | 触发语(直接粘贴) | 对应 Skill 蓝图 | -|:----:|-------------------|----------------| -| 1 | "帮我把 ylly/gitlink-cli 所有没标签的开放 Issue 自动分类打标签" | issue-triage 工作流 1 | -| 2 | "给我一份 ylly/gitlink-cli 本周的项目周报" | insight 工作流 2 | -| 3 | "根据 ylly/gitlink-cli 自上次发版以来的提交,推荐下一个版本号并生成 Release Notes" | release-auto 一、二 | - -**预期 Agent 行为**(截图要点): -- Agent 会先说"使用 gitlink-issue-triage Skill" -- 调用 `issue +list --state open` → 筛未分类 → `issue +view` 读详情 → 按分类规则表归类 → `issue +update --label` -- 每步都会展示它对应 SKILL.md 的哪一段(这是"Skill 作为设计蓝图"的可视证据) - ---- - -## 工作流 ⑤ 触发语(贡献者成长体系) - -**单条完整触发语**: - -``` -请帮我对 ylly/gitlink-cli 建立贡献者成长体系: -1. 取仓库全历史的 commits(git log)+ merged PR(pr +list --state merged) - + Issue 作者(issue +list),生成一份综合积分排行榜(公式 commits×1 + PR×5 + Issue×2), - 过滤掉测试号 15972095207 / 2403_89190320 / fsafasff; -2. 按三层标准授予徽章(星级/活跃/贡献者),先创建对应 label(颜色 #FFD700/#FF6B35/#87C95F); -3. 建一个颁奖 Issue 公布排行榜并 @mention Top 贡献者。 -执行前先给我清单确认。 -``` - -**预期 Agent 行为**: -- Agent 调用 insight 工作流 3 的数据采集方法(第 173-183 行) -- 调用 issue-triage 工作流 1 Step 5 的 label 创建(第 86-89 行) -- 输出排行榜表格 + 颁奖动作清单等用户确认 - ---- - -## 工作流 ⑦ 触发语(新人全流程保姆) - -**单条完整触发语**: - -``` -请帮我对 ylly/gitlink-cli 做新人引导全流程: -1. 用 member +invite-link 演示邀请能力(仓库无真实新人账号,仅演示); -2. 扫描开放 Issue,按新人友好识别标准找出适合新人的 Issue(onboarding 工作流1); -3. 对找出的 good first Issue 写**完全个性化**的引导评论(onboarding 工作流2), - 每条评论要定位到具体文件、给本地准备命令、写 PR 提交规范——禁止用同一模板; -4. 用 notification +list --owner zhangqing23 看通知动态; -5. 交叉验证通知 + Issue + PR 数据,还原一位新人从加入到首次贡献的全过程。 -写入操作前给我预览。 -``` - -**分步触发语**: - -| Step | 触发语 | 对应 Skill 蓝图 | -|:----:|-------|----------------| -| 2 | "帮我找出 ylly/gitlink-cli 适合新人的 Issue 并打 good first 标签" | onboarding 工作流 1 | -| 3 | "帮我给 ylly/gitlink-cli 适合新人的 Issue 写个性化引导评论" | onboarding 工作流 2 | - -**预期 Agent 行为**: -- 识别阶段会引用 onboarding SKILL.md 第 31-46 行的 5 条友好信号 + 3 条排除标准 -- 引导评论阶段会引用第 205 行"禁止对所有 Issue 用同一句",每条评论定位不同文件 - ---- - -## 对话产物采集建议 - -录 Agent 对话时重点截这几段(对应 PDF 评分点): - -1. **Skill 加载声明**:Agent 说"我将使用 gitlink-xxx Skill"的那一句 -2. **蓝图引用**:Agent 提到"按 SKILL.md 第 X-Y 行"的段落 -3. **命令调用**:Agent 调 gitlink-cli 的命令行(带参数) -4. **真实写入回执**:服务器返回的 `ok:true` / `id` / `version_id` 等 -5. **网页验证**:复制返回的 URL 到浏览器打开看到真实效果 diff --git a/examples/workflows/zhangqing-task3/release-notes-v0.2.0-beta.1.md b/examples/workflows/zhangqing-task3/release-notes-v0.2.0-beta.1.md deleted file mode 100644 index 27e93922..00000000 --- a/examples/workflows/zhangqing-task3/release-notes-v0.2.0-beta.1.md +++ /dev/null @@ -1,55 +0,0 @@ -> 本版本为**任务三阶段性预发布**。正式版 v0.2.0 将在任务三全部 7 个端到端工作流完工后发布。 - -## v0.2.0 Beta 1 — 智能运营能力升级版(预发布) - -本版本集中呈现任务二「AI Skill 套件」与任务三「端到端自动化工作流」的阶段成果,为 GitLink CLI 引入完整的智能运营能力。 - -### ✨ 新功能 · Skills 智能套件 - -任务二交付的 AI Skill,让 Agent 能直接驱动 GitLink 完成高级运营场景: - -- feat(skills): 新增 gitlink-issue-triage — Issue 智能分拣(自动打标签 / 识别 good first) -- feat(skills): 新增 gitlink-release-auto — 自动发版(语义化版本推荐 + Release Notes 生成) -- feat(skills): 新增 gitlink-commit-quality — 提交信息规范检查 -- feat(skills): 新增 gitlink-code-review — 代码审查 -- feat(skills): 新增 gitlink-insight — 仓库健康洞察 -- feat(skills): 新增 gitlink-compliance — 合规检查 -- feat(skills): 新增文档智能维护 + 新人引导 Skill - -### ✨ 新功能 · Shortcut 命令扩展 - -- feat(wiki): 新增 wiki +list / +view / +create / +update / +delete -- feat(label): 新增 label 标签管理命令 -- feat(notification): 新增 notification 通知模块 -- feat(member): 新增 member 仓库成员管理命令 -- feat(milestone): 新增 milestone 里程碑命令 -- feat(compare): 新增 compare 对比命令 -- feat(pr): 新增 pr reopen / review / patchset version 命令 -- feat(webhook): 新增 webhook 快捷命令组 -- feat(repo): 新增 repo readme 快捷命令 -- feat(issue): 新增 issue authors / assigners 查询命令 -- feat(api): 支持 --body-file 从文件读取请求体(解决 Windows 中文编码问题) - -### 📚 工作流示例 - -- feat(workflows): 新增 community-ops-automation 社区运营自动化端到端示例 - -### 🐛 Bug 修复 - -- fix(notification): 修正通知读取 / 删除的 API endpoint 与请求体 -- fix(issue): 修正 --label 语义,新增 --label clear 清除标签 -- fix(wiki): 修正 wiki 网关 API(gateway.gitlink.org.cn)与请求方法 -- fix(label): 修正 label API path 至 /{owner}/{repo}/labels -- fix(pr): view 输出补充 closed time 字段 -- fix(member): 报告批量添加中的部分失败 - -### 📦 其他变更 - -- docs: 3 个 Skill 的 REFERENCE.md 参考文档 -- docs: 工作流示例的提交清单 / 验证文档 -- test: webhook / label / notification 测试用例对齐 -- refactor: 自动部署配置精简 - -### 🤝 贡献者 - -感谢以下贡献者参与本版本开发:@ylly、@zhangqing、@ZxR、@yangsai01、@Leo77、@Mengz、@wangyue789、@puygob236、@dtwdtw、@muel、@Jiachen Li、@Tiger、@wbtiger、@ljc0426、@whzy