feat(skills): add research assistant skill suite

This commit is contained in:
NeeNe 2026-07-05 13:07:28 +08:00
parent 9749a4c832
commit 8642f4026e
28 changed files with 1298 additions and 2 deletions

View File

@ -26,5 +26,8 @@ jobs:
- name: Test
run: make test
- name: Validate research Skills
run: make validate-research-skills
- name: Check formatting
run: make fmt

View File

@ -26,5 +26,8 @@ jobs:
- name: Scan i18n key references
run: go run ./internal/i18n/cmd/check --scan-code
- name: Validate research Skills
run: python3 scripts/validate-research-skills.py
- name: Run Go tests
run: go test ./...

View File

@ -3,7 +3,7 @@ BINARY := gitlink-cli
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -s -w -X '$(MODULE)/cmd.Version=$(VERSION)'
.PHONY: build install clean test check vet fmt cover lint
.PHONY: build install clean test check vet fmt cover lint validate-research-skills
build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .
@ -35,7 +35,10 @@ cover:
lint:
golangci-lint run ./...
check: fmt vet lint test
validate-research-skills:
python3 scripts/validate-research-skills.py
check: fmt vet lint test validate-research-skills
@echo "All checks passed."
hooks:

View File

@ -0,0 +1,22 @@
# Research skills suite
Adds seven read-only research-oriented Agent Skills for GitLink repositories:
- `gitlink-research-reproducibility`: reproducibility checklist and remediation plan for research code.
- `gitlink-research-compliance`: license, security policy, dependency, and sensitive-file risk audit.
- `gitlink-research-progress-tracker`: weekly progress report and risk early warning for research projects.
- `gitlink-research-collaboration-map`: contributor, Issue, and PR collaboration mapping for research teams.
- `gitlink-research-knowledge-graph`: keyword-based research landscape and lightweight knowledge graph workflow.
- `gitlink-research-data-provenance`: dataset source, citation, license, and privacy-risk audit.
- `gitlink-research-artifact-handbook`: research artifact handbook generation for demos, handoff, and open-source release.
These Skills are designed as standalone `gitlink-cli` Skill PR deliverables. They do not depend on external project code and can also be composed by end-to-end research workflows.
Validation:
```bash
make validate-research-skills
git diff --check
```
Agent verification guidance is documented in `docs/research-skills-agent-test-report.md`.

View File

@ -0,0 +1,147 @@
# Research Skills Agent Test Report
## Scope
This report covers the seven read-only research Skills added for the GitLink competition:
- `gitlink-research-reproducibility`
- `gitlink-research-compliance`
- `gitlink-research-progress-tracker`
- `gitlink-research-collaboration-map`
- `gitlink-research-knowledge-graph`
- `gitlink-research-data-provenance`
- `gitlink-research-artifact-handbook`
The Skills are standalone `gitlink-cli` Agent Skills. They do not depend on external project code and can be submitted as an independent Skill PR.
## Automatic Validation
Run:
```bash
make validate-research-skills
git diff --check
```
The validation script checks:
- every Skill has valid `SKILL.md` frontmatter with the expected name and a useful trigger description;
- every Skill instructs the Agent to read `gitlink-shared`;
- every Skill is read-only by default and uses `gitlink-cli --format json`;
- every Skill includes command coverage for its scenario;
- every Skill has at least one reference file and one example file;
- examples contain user request, Agent steps, expected answer, and concrete `gitlink-cli` commands;
- `skills/README.md` and `doc/changes/research-skills-suite.md` index all seven Skills.
## Offline Agent Test Prompts
These prompts can be used in Claude Code, Cursor, Codex, or OpenClaw after installing the Skills.
### Reproducibility
```text
Use gitlink-research-reproducibility to audit songhui18/ICCV2021. Produce a reproducibility score, missing items, and top three remediation actions. Do not write back to GitLink.
```
Expected behavior:
- read `gitlink-shared`;
- run `repo +info` and `repo +tree`, or fall back to `api GET /sub_entries`;
- cite command sources;
- produce a checklist report.
### Compliance
```text
Use gitlink-research-compliance to check Gitconomy/Git4Research before open-source release. Report license, SECURITY, CONTRIBUTING, dependency, and sensitive-file risks.
```
Expected behavior:
- perform read-only file tree checks;
- avoid printing sensitive contents;
- state that the output is an engineering pre-check, not legal advice.
### Progress Tracking
```text
Use gitlink-research-progress-tracker to generate a weekly research progress report for songhui18/ICCV2021, including Issue/PR queues and risk warnings.
```
Expected behavior:
- collect repo, Issue, PR, Release, and contributor data;
- separate facts from recommendations;
- avoid posting a comment unless explicitly requested.
### Collaboration Map
```text
Use gitlink-research-collaboration-map to analyze collaboration structure for Gitconomy/Git4Research. Identify maintainers, contributors, open collaboration gaps, and suggested next actions.
```
Expected behavior:
- use public contributor, Issue, PR, language, and optional user data;
- avoid private contact information;
- base recommendations on evidence.
### Knowledge Graph
```text
Use gitlink-research-knowledge-graph to search GitLink for “论文复现” and “open research”, then output a Markdown trend summary and graph JSON.
```
Expected behavior:
- run bounded keyword searches;
- deep-analyze no more than eight repositories;
- produce `nodes` and `edges` using the documented graph schema;
- mark platform-data limits.
### Data Provenance
```text
Use gitlink-research-data-provenance to audit songhui18/ICCV2021 for dataset source, citation, license, and privacy risks. Do not print raw data contents.
```
Expected behavior:
- collect repo info and selected file trees;
- report paths and risk types only;
- distinguish missing evidence from confirmed risk.
### Artifact Handbook
```text
Use gitlink-research-artifact-handbook to generate a research artifact handbook for Gitconomy/Git4Research, suitable for project handoff and competition demo.
```
Expected behavior:
- collect repo, README, tree, Issue/PR, Release, language, and contributor signals when available;
- produce a structured handbook with missing fields marked as `待补充`;
- avoid writing Wiki, Issue, Release, or repository files unless explicitly requested.
## Real Agent Verification
For competition submission, record at least one Agent run with screenshots or video:
1. Install or expose the Skills to the Agent.
2. Run one prompt from this report against a public GitLink repository.
3. Show the Agent reading the Skill, running read-only `gitlink-cli` commands, and producing the report.
4. Show that no write operation was performed.
Recommended demo target:
```text
songhui18/ICCV2021
```
This repository has richer Issue and PR data, which makes progress tracking and collaboration mapping more visible.
## Known Limitations
- The automatic script validates Skill structure and workflow instructions; it does not prove semantic quality of an LLM-generated report.
- Real GitLink API verification requires network access and may require authentication for private repositories.
- Screenshots or video still need to be captured in the selected Agent UI for the competition submission package.

View File

@ -0,0 +1,160 @@
#!/usr/bin/env python3
from __future__ import annotations
import re
import sys
from pathlib import Path
RESEARCH_SKILLS = {
"gitlink-research-reproducibility": {
"commands": ["repo +info", "repo +tree", "api GET"],
"references": ["checklist.md"],
"examples": ["reproducibility-audit.md"],
"keywords": ["复现", "README", "LICENSE", "依赖"],
},
"gitlink-research-compliance": {
"commands": ["repo +info", "repo +tree", "api GET"],
"references": ["risk-rules.md"],
"examples": ["compliance-audit.md"],
"keywords": ["合规", "敏感", "LICENSE", "SECURITY"],
},
"gitlink-research-progress-tracker": {
"commands": ["issue +list", "pr +list", "release +list"],
"references": ["risk-model.md"],
"examples": ["weekly-report.md"],
"keywords": ["进度", "周报", "风险", "预警"],
},
"gitlink-research-collaboration-map": {
"commands": ["repo +contributors", "issue +list", "pr +list"],
"references": ["profile-fields.md"],
"examples": ["collaboration-map.md"],
"keywords": ["协作", "贡献者", "合作", "画像"],
},
"gitlink-research-knowledge-graph": {
"commands": ["search +repos", "repo +info", "repo +languages"],
"references": ["graph-schema.md"],
"examples": ["keyword-map.md"],
"keywords": ["知识图谱", "热点", "选题", "趋势"],
},
"gitlink-research-data-provenance": {
"commands": ["repo +info", "repo +tree", "api GET"],
"references": ["provenance-rules.md"],
"examples": ["data-provenance-audit.md"],
"keywords": ["数据", "隐私", "来源", "许可证"],
},
"gitlink-research-artifact-handbook": {
"commands": ["repo +info", "repo +tree", "repo +readme", "release +list"],
"references": ["handbook-template.md"],
"examples": ["artifact-handbook.md"],
"keywords": ["成果", "手册", "交接", "复现"],
},
}
def fail(message: str) -> None:
print(f"ERROR: {message}", file=sys.stderr)
raise SystemExit(1)
def read(path: Path) -> str:
try:
return path.read_text(encoding="utf-8")
except FileNotFoundError:
fail(f"missing file: {path}")
def parse_frontmatter(text: str, path: Path) -> dict[str, str]:
if not text.startswith("---\n"):
fail(f"{path} does not start with YAML frontmatter")
try:
_, frontmatter, _ = text.split("---", 2)
except ValueError:
fail(f"{path} has incomplete YAML frontmatter")
parsed: dict[str, str] = {}
for line in frontmatter.strip().splitlines():
if ":" not in line:
fail(f"{path} frontmatter line has no colon: {line}")
key, value = line.split(":", 1)
parsed[key.strip()] = value.strip().strip('"')
return parsed
def assert_contains(text: str, needle: str, path: Path) -> None:
if needle not in text:
fail(f"{path} is missing required text: {needle}")
def assert_regex(text: str, pattern: str, path: Path) -> None:
if not re.search(pattern, text, flags=re.MULTILINE):
fail(f"{path} does not match required pattern: {pattern}")
def validate_skill(root: Path, name: str, spec: dict[str, list[str]]) -> None:
skill_dir = root / "skills" / name
skill_md = skill_dir / "SKILL.md"
text = read(skill_md)
frontmatter = parse_frontmatter(text, skill_md)
if frontmatter.get("name") != name:
fail(f"{skill_md} has wrong name: {frontmatter.get('name')}")
description = frontmatter.get("description", "")
if len(description) < 30:
fail(f"{skill_md} description is too short")
for keyword in spec["keywords"]:
if keyword not in text and keyword not in description:
fail(f"{skill_md} is missing scenario keyword: {keyword}")
assert_contains(text, "gitlink-shared", skill_md)
assert_contains(text, "gitlink-cli", skill_md)
assert_contains(text, "--format json", skill_md)
assert_regex(text, r"只读|默认只读", skill_md)
assert_regex(text, r"不输出 Token|Token", skill_md)
for command in spec["commands"]:
assert_contains(text, command, skill_md)
for filename in spec["references"]:
path = skill_dir / "references" / filename
ref_text = read(path)
if len(ref_text.strip().splitlines()) < 5:
fail(f"{path} is too small to be useful")
for filename in spec["examples"]:
path = skill_dir / "examples" / filename
example_text = read(path)
assert_contains(example_text, "User request", path)
assert_contains(example_text, "Agent steps", path)
assert_contains(example_text, "Expected answer", path)
assert_contains(example_text, "gitlink-cli", path)
def validate_readme(root: Path) -> None:
readme = root / "skills" / "README.md"
text = read(readme)
for name in RESEARCH_SKILLS:
assert_contains(text, name, readme)
def validate_change_note(root: Path) -> None:
note = root / "doc" / "changes" / "research-skills-suite.md"
text = read(note)
for name in RESEARCH_SKILLS:
assert_contains(text, name, note)
if "scripts/validate-research-skills.py" not in text and "make validate-research-skills" not in text:
fail(f"{note} is missing the research Skills validation command")
def main() -> int:
root = Path(__file__).resolve().parents[1]
for name, spec in RESEARCH_SKILLS.items():
validate_skill(root, name, spec)
print(f"ok {name}")
validate_readme(root)
validate_change_note(root)
print("research skill validation passed")
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@ -105,6 +105,48 @@ skills/
│ └── SKILL.md # Wiki 操作指南
├── gitlink-pm/ # 项目管理
│ └── SKILL.md # PM 操作指南
├── gitlink-research-reproducibility/ # 科研仓库复现性审计
│ ├── SKILL.md
│ ├── references/
│ │ └── checklist.md
│ └── examples/
│ └── reproducibility-audit.md
├── gitlink-research-compliance/ # 科研开源合规与敏感风险检查
│ ├── SKILL.md
│ ├── references/
│ │ └── risk-rules.md
│ └── examples/
│ └── compliance-audit.md
├── gitlink-research-progress-tracker/ # 科研项目进度跟踪与预警
│ ├── SKILL.md
│ ├── references/
│ │ └── risk-model.md
│ └── examples/
│ └── weekly-report.md
├── gitlink-research-collaboration-map/ # 科研协作画像与合作建议
│ ├── SKILL.md
│ ├── references/
│ │ └── profile-fields.md
│ └── examples/
│ └── collaboration-map.md
├── gitlink-research-knowledge-graph/ # 科研热点追踪与轻量知识图谱
│ ├── SKILL.md
│ ├── references/
│ │ └── graph-schema.md
│ └── examples/
│ └── keyword-map.md
├── gitlink-research-data-provenance/ # 科研数据来源与隐私审计
│ ├── SKILL.md
│ ├── references/
│ │ └── provenance-rules.md
│ └── examples/
│ └── data-provenance-audit.md
├── gitlink-research-artifact-handbook/ # 科研成果沉淀手册生成
│ ├── SKILL.md
│ ├── references/
│ │ └── handbook-template.md
│ └── examples/
│ └── artifact-handbook.md
├── gitlink-health/ # 项目健康度分析
│ ├── SKILL.md # 健康度分析指南
│ ├── data/
@ -148,6 +190,18 @@ skills/
| **gitlink-workflow** | AI 工作流 | Issue 分类、PR Review、Release Notes |
| **gitlink-health** | 开源项目健康度 | 详情见SKILL.md |
### 科研场景 Skills
| Skill | 说明 | 常用命令 |
|-------|------|----------|
| **gitlink-research-reproducibility** | 科研仓库复现性审计,检查 README、LICENSE、依赖、测试、CI、示例和数据说明 | `repo +info`, `repo +tree`, `api GET /sub_entries` |
| **gitlink-research-compliance** | 科研开源合规与敏感风险检查 | `repo +info`, `repo +tree`, `api GET /sub_entries` |
| **gitlink-research-progress-tracker** | 科研项目周报、Issue/PR 队列和停滞风险预警 | `issue +list`, `pr +list`, `release +list`, `repo +contributors` |
| **gitlink-research-collaboration-map** | 科研协作画像、核心维护者识别和合作建议 | `repo +contributors`, `issue +list`, `pr +list`, `user +info` |
| **gitlink-research-knowledge-graph** | 关键词科研热点追踪和轻量知识图谱 | `search +repos`, `repo +info`, `repo +languages`, `repo +contributors` |
| **gitlink-research-data-provenance** | 科研数据来源、数据许可证、引用链和隐私风险审计 | `repo +info`, `repo +tree`, `api GET /sub_entries` |
| **gitlink-research-artifact-handbook** | 科研成果沉淀手册和课题组交接材料生成 | `repo +info`, `repo +readme`, `repo +tree`, `release +list` |
---
## 🎯 使用场景
@ -252,6 +306,15 @@ gitlink-cli org +info -i Gitlink
- [gitlink-org/SKILL.md](gitlink-org/SKILL.md) - 组织命令
- [gitlink-user/SKILL.md](gitlink-user/SKILL.md) - 用户命令
**科研场景**:
- [gitlink-research-reproducibility/SKILL.md](gitlink-research-reproducibility/SKILL.md) - 复现性审计
- [gitlink-research-compliance/SKILL.md](gitlink-research-compliance/SKILL.md) - 开源合规与敏感风险
- [gitlink-research-progress-tracker/SKILL.md](gitlink-research-progress-tracker/SKILL.md) - 项目进度跟踪与预警
- [gitlink-research-collaboration-map/SKILL.md](gitlink-research-collaboration-map/SKILL.md) - 协作画像与合作建议
- [gitlink-research-knowledge-graph/SKILL.md](gitlink-research-knowledge-graph/SKILL.md) - 热点追踪与知识图谱
- [gitlink-research-data-provenance/SKILL.md](gitlink-research-data-provenance/SKILL.md) - 数据来源与隐私审计
- [gitlink-research-artifact-handbook/SKILL.md](gitlink-research-artifact-handbook/SKILL.md) - 成果沉淀手册
---
## ❓ 常见问题

View File

@ -0,0 +1,73 @@
---
name: gitlink-research-artifact-handbook
description: "科研成果沉淀手册生成:基于 GitLink 仓库 README、目录结构、Release、Issue、PR、贡献者和语言信息生成面向答辩、开源发布或课题组交接的科研成果手册。用于梳理代码、实验、论文、数据、贡献和复现入口。"
---
# gitlink-research-artifact-handbook
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 默认只读执行,不创建 Wiki、不发布 Release、不提交文件。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 如果用户要求把手册写回 Wiki、Issue 或仓库文件,必须先输出 dry-run 草稿并等待确认。
## 工作流
1. 采集仓库概览、语言和贡献者:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
gitlink-cli repo +languages --owner <owner> --repo <repo> --format json
gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json
```
2. 采集根目录和关键目录:
```bash
gitlink-cli repo +tree --owner <owner> --repo <repo> --ref <branch> --format json
gitlink-cli repo +readme --owner <owner> --repo <repo> --ref <branch> --format json
```
如果 `repo +tree` 不可用,回退:
```bash
gitlink-cli api GET /<owner>/<repo>/sub_entries --query 'filepath=&ref=<branch>' --format json
```
3. 采集协作和发布信息:
```bash
gitlink-cli issue +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state merged --format json
gitlink-cli release +list --owner <owner> --repo <repo> --format json
```
4. 按 `references/handbook-template.md` 生成科研成果沉淀手册。
## 输出格式
```markdown
# 科研成果沉淀手册:<owner>/<repo>
## 1. 项目概览
## 2. 研究问题与成果定位
## 3. 代码与目录导览
## 4. 实验和数据入口
## 5. 复现步骤
## 6. 协作与贡献记录
## 7. 发布与引用信息
## 8. 交接清单
```
## 分析原则
- 手册是“可交接材料”,不是营销稿;优先列入口、证据和缺失项。
- 不要编造论文标题、数据来源或实验结果;缺失时写“待补充”。
- 对 Issue/PR 只做摘要,不贴完整讨论。
- 如果仓库没有 Release建议使用 Release 固化阶段成果。
- 如果根目录 README 已完整,保留其结构并补交接清单;如果 README 很弱,按模板重建手册。

View File

@ -0,0 +1,25 @@
# Artifact handbook example
User request:
```text
请为 Gitconomy/Git4Research 生成一份科研成果沉淀手册,用于课题组交接和答辩展示。
```
Agent steps:
```bash
gitlink-cli repo +info --owner Gitconomy --repo Git4Research --format json
gitlink-cli repo +readme --owner Gitconomy --repo Git4Research --ref main --format json
gitlink-cli repo +tree --owner Gitconomy --repo Git4Research --ref main --format json
gitlink-cli issue +list --owner Gitconomy --repo Git4Research --state open --format json
gitlink-cli pr +list --owner Gitconomy --repo Git4Research --state merged --format json
gitlink-cli release +list --owner Gitconomy --repo Git4Research --format json
```
Expected answer:
- Produce a handbook using the template.
- Mark missing evidence as `待补充`.
- Confirm that no Wiki, Issue, PR, Release, or file write operation was performed.

View File

@ -0,0 +1,59 @@
# Research artifact handbook template
```markdown
# 科研成果沉淀手册:<owner>/<repo>
## 1. 项目概览
- 仓库:
- 默认分支:
- 主要语言:
- 维护状态:
- 数据来源:
## 2. 研究问题与成果定位
- 研究问题:
- 方法或系统:
- 对应论文/报告:
- 创新点:
## 3. 代码与目录导览
| 路径 | 作用 | 证据来源 |
|---|---|---|
## 4. 实验和数据入口
| 内容 | 路径/链接 | 状态 | 待补充 |
|---|---|---|---|
## 5. 复现步骤
1. 环境准备:
2. 数据准备:
3. 训练/运行:
4. 评估:
## 6. 协作与贡献记录
- 贡献者:
- 关键 Issue
- 已合并 PR
## 7. 发布与引用信息
- Release
- License
- Citation
## 8. 交接清单
- [ ] README 完整
- [ ] LICENSE 明确
- [ ] 依赖文件存在
- [ ] 数据来源明确
- [ ] 实验命令可运行
- [ ] Release 或归档版本可引用
```

View File

@ -0,0 +1,79 @@
---
name: gitlink-research-collaboration-map
description: "科研协作画像与合作建议:分析 GitLink 科研仓库的贡献者、Issue、PR、语言和用户信息识别核心维护者、潜在协作者、未响应研究问题和协作分工建议。用于课题组协作复盘、跨团队合作匹配和学生贡献画像。"
---
# gitlink-research-collaboration-map
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 只读执行,不自动指派 Issue、不邀请成员。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 不输出私人联系方式或敏感个人信息。
- 协作建议必须基于公开仓库数据,避免做人身评价。
## 工作流
1. 获取仓库、语言、贡献者:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
gitlink-cli repo +languages --owner <owner> --repo <repo> --format json
gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json
```
如 shortcut 不可用,回退:
```bash
gitlink-cli api GET /<owner>/<repo>/languages --format json
gitlink-cli api GET /<owner>/<repo>/contributors --format json
```
2. 获取 Issue 和 PR
```bash
gitlink-cli issue +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli issue +list --owner <owner> --repo <repo> --state closed --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state merged --format json
```
3. 对高频作者或贡献者,按需获取公开用户信息:
```bash
gitlink-cli user +info --login <login> --format json
```
4. 按 `references/profile-fields.md` 生成协作画像。
## 输出格式
```markdown
# 科研协作画像:<owner>/<repo>
## 协作结构
| 角色 | 候选人/账号 | 证据 | 建议 |
|---|---|---|---|
| 核心维护者 | ... | commits/issues/pr | ... |
## 未响应问题
| Issue/PR | 主题 | 等待动作 | 建议协作者 |
|---|---|---|---|
## 合作建议
1. ...
```
## 分析原则
- 贡献者画像使用“贡献事实”和“适合跟进的任务”,不要给人格标签。
- Issue/PR 作者、assignee、reviewer 字段可能缺失,缺失时不要强推断。
- 镜像仓库的 GitLink 协作数据可能很少,需要标注局限。
- 合作建议应给出证据语言栈、历史贡献、Issue/PR 主题。

View File

@ -0,0 +1,23 @@
# Collaboration map example
User request:
```text
请分析 Gitconomy/Git4Research 的科研协作结构,找出核心维护者和可跟进的问题方向。
```
Agent steps:
```bash
gitlink-cli repo +info --owner Gitconomy --repo Git4Research --format json
gitlink-cli repo +contributors --owner Gitconomy --repo Git4Research --format json
gitlink-cli issue +list --owner Gitconomy --repo Git4Research --state open --format json
gitlink-cli pr +list --owner Gitconomy --repo Git4Research --state open --format json
```
Expected answer:
- Separate facts from recommendations.
- Mention data limits if the repository has little Issue/PR activity.
- Do not expose private contact information.

View File

@ -0,0 +1,20 @@
# Collaboration profile fields
| 字段 | 来源 | 用途 |
|---|---|---|
| contributor login/name | `repo +contributors` | 识别代码贡献者 |
| commits/contributions | `repo +contributors` | 粗略衡量贡献量 |
| issue author | `issue +list` | 识别问题提出者 |
| issue assignee | `issue +list` | 识别责任分配 |
| issue labels | `issue +list` | 判断研究主题或任务类型 |
| PR author | `pr +list` | 识别代码贡献者和集成者 |
| PR status | `pr +list` | 判断协作流转状态 |
| language | `repo +languages` | 推断技术栈 |
Suggested role labels:
- 核心维护者:代码贡献和 Issue/PR 参与均较多。
- 问题提出者Issue 活跃但代码贡献少,适合需求澄清和复现实验。
- 实验贡献者PR 或实验相关 Issue 活跃。
- 潜在协作者:与主要语言或研究主题匹配,但当前参与较少。

View File

@ -0,0 +1,77 @@
---
name: gitlink-research-compliance
description: "科研开源合规与敏感风险检查:审计 GitLink 科研仓库的许可证、SECURITY、CONTRIBUTING、依赖声明和敏感文件风险。用于开源发布前预检查、论文代码发布合规清单和整改建议。"
---
# gitlink-research-compliance
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 只读执行,不删除文件、不改 `.gitignore`、不关闭 Issue。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 报告必须注明“工程合规预审,不构成法律意见”。
## 工作流
1. 采集仓库信息和文件树:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
gitlink-cli repo +tree --owner <owner> --repo <repo> --ref <branch> --format json
```
2. 如果 `repo +tree` 不可用,回退:
```bash
gitlink-cli api GET /<owner>/<repo>/sub_entries --query 'filepath=&ref=<branch>' --format json
```
3. 对根目录和高风险目录做规则检查:
- 根目录:许可证、安全策略、贡献指南、依赖清单、`.gitignore`。
- 配置目录:`.github`、`.gitlink`、`.vscode`、`config`。
- 脚本目录:`scripts`、`deploy`、`docker`。
4. 按 `references/risk-rules.md` 输出风险分级。
## 输出格式
```markdown
# 科研开源合规预审:<owner>/<repo>
## 总览
| 项目 | 结果 | 风险等级 | 证据 |
|---|---|---|---|
## 高优先级风险
1. ...
## 整改建议
1. ...
## 说明
本报告是工程合规预审,不构成法律意见。
```
## 检查项
- 许可证:存在 `LICENSE`README 中最好也声明许可证。
- 安全策略:存在 `SECURITY.md`
- 贡献指南:存在 `CONTRIBUTING.md`
- 依赖声明:存在语言对应依赖文件,便于后续许可证和漏洞扫描。
- 敏感文件风险:文件名包含 `.env`、`id_rsa`、`.pem`、`.key`、`credential`、`secret`、`token` 时列为风险。
## 注意事项
- 不要下载或展示疑似密钥内容,只报告路径和风险类型。
- 如果只能获取根目录文件树,报告必须说明深层敏感文件未覆盖。
- 私有仓库需要用户自行完成认证,不能要求用户粘贴 Token。

View File

@ -0,0 +1,21 @@
# Compliance audit example
User request:
```text
请检查 Gitconomy/Git4Research 是否具备开源发布合规基础。
```
Agent steps:
```bash
gitlink-cli repo +info --owner Gitconomy --repo Git4Research --format json
gitlink-cli repo +tree --owner Gitconomy --repo Git4Research --ref main --format json
```
Expected answer:
- Report license, security policy, contribution guide, dependency manifest, and sensitive file risks.
- Mention whether the audit is root-only or includes selected subdirectories.
- Avoid quoting or exposing sensitive file contents.

View File

@ -0,0 +1,11 @@
# Compliance risk rules
| 风险 | 等级 | 判定 | 建议 |
|---|---|---|---|
| 缺少 LICENSE | 高 | 根目录无 LICENSE 文件 | 补充许可证并在 README 声明 |
| 疑似私钥 | 高 | 文件名包含 `id_rsa`、`.pem`、`.key` | 移除文件、轮换密钥、加入 `.gitignore` |
| 疑似环境密钥 | 高 | 文件名包含 `.env`、`credential`、`secret`、`token` | 移除真实配置,保留 `.env.example` |
| 缺少依赖声明 | 中 | 无常见依赖清单 | 补充依赖文件,便于许可证和漏洞审计 |
| 缺少 SECURITY | 中 | 无 `SECURITY.md` | 补充漏洞披露流程 |
| 缺少 CONTRIBUTING | 低 | 无 `CONTRIBUTING.md` | 补充贡献流程和代码规范 |

View File

@ -0,0 +1,79 @@
---
name: gitlink-research-data-provenance
description: "科研数据来源与隐私审计:检查 GitLink 科研仓库中的数据集说明、下载来源、引用链、隐私风险、数据许可证和大文件痕迹。用于论文代码发布前的数据治理、复现实验数据说明和科研合规预审。"
---
# gitlink-research-data-provenance
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 只读执行,不下载大文件、不打开疑似敏感数据内容。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 不输出个人隐私、样本原文、密钥或数据内容;只报告路径、类型和风险。
- 报告必须注明“科研数据治理预审,不构成法律意见或伦理审查结论”。
## 工作流
1. 采集仓库概览和默认分支:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
```
2. 采集根目录文件树:
```bash
gitlink-cli repo +tree --owner <owner> --repo <repo> --ref <branch> --format json
```
如果 `repo +tree` 不可用,回退:
```bash
gitlink-cli api GET /<owner>/<repo>/sub_entries --query 'filepath=&ref=<branch>' --format json
```
3. 如果根目录存在 `data`、`datasets`、`benchmark`、`experiments`、`notebooks`、`docs`、`README`、`paper`、`assets`,只采集一层目录结构:
```bash
gitlink-cli repo +tree --owner <owner> --repo <repo> --path data --ref <branch> --format json
gitlink-cli repo +tree --owner <owner> --repo <repo> --path docs --ref <branch> --format json
```
4. 按 `references/provenance-rules.md` 生成数据来源和隐私风险报告。
## 输出格式
```markdown
# 科研数据来源与隐私审计:<owner>/<repo>
## 数据治理总览
| 检查项 | 结果 | 风险 | 证据 |
|---|---|---|---|
## 数据来源链
| 数据/目录 | 来源说明 | 许可证/引用 | 复现状态 |
|---|---|---|---|
## 风险与整改
1. ...
## 说明
本报告是科研数据治理预审,不构成法律意见或伦理审查结论。
```
## 分析原则
- 有数据目录但无来源说明时,风险高于“未发现数据目录”。
- 发现 `.csv`、`.jsonl`、`.parquet`、`.h5`、`.npy`、`.zip`、`.tar` 等文件名时,只报告文件名和路径,不打印内容。
- 发现 `patient`、`student`、`email`、`phone`、`idcard`、`address`、`face`、`medical` 等词时,标注隐私复核风险。
- 如果仓库只包含数据下载脚本,检查脚本是否说明下载地址、数据许可证和引用方式。
- 无法确认的事项标注“未确认”,不要编造数据来源。

View File

@ -0,0 +1,22 @@
# Data provenance audit example
User request:
```text
请检查 songhui18/ICCV2021 是否有科研数据来源、数据许可证或隐私风险问题。
```
Agent steps:
```bash
gitlink-cli repo +info --owner songhui18 --repo ICCV2021 --format json
gitlink-cli repo +tree --owner songhui18 --repo ICCV2021 --ref master --format json
gitlink-cli repo +tree --owner songhui18 --repo ICCV2021 --path data --ref master --format json
```
Expected answer:
- Report only paths and risk types, not raw data contents.
- Separate data source, license, citation, privacy, and large-file risks.
- State whether the assessment is root-only or includes selected subdirectories.

View File

@ -0,0 +1,12 @@
# Data provenance rules
| 检查项 | 风险等级 | 判定线索 | 建议 |
|---|---|---|---|
| 数据来源说明缺失 | 高 | 存在 data/datasets/benchmark 目录,但 README 或目录下无来源说明 | 补充数据集名称、下载地址、版本、引用论文和访问日期 |
| 数据许可证缺失 | 高 | 存在数据文件或下载脚本,但无 license/citation/terms | 补充数据许可证、使用条款和引用格式 |
| 隐私数据线索 | 高 | 文件名或目录包含 patient、student、email、phone、idcard、address、face、medical 等 | 进行脱敏和伦理审查,避免公开原始个人数据 |
| 大文件或压缩包 | 中 | 文件名包含 .zip、.tar、.h5、.npy、.parquet 等 | 说明文件来源、校验和、下载方式,不建议直接托管大数据 |
| 数据下载脚本无校验 | 中 | 有 download/get_data 脚本但无 checksum/version | 补充 checksum、版本号和失败处理 |
| 引用链不完整 | 中 | README 未说明数据、论文、代码之间的关系 | 补充数据引用、论文引用和实验脚本映射 |
| 未发现数据痕迹 | 低 | 未见数据目录、下载脚本或数据扩展名 | 在报告中标注未发现,建议说明数据是否需另行申请 |

View File

@ -0,0 +1,90 @@
---
name: gitlink-research-knowledge-graph
description: "科研热点追踪与轻量知识图谱:按关键词搜索 GitLink 科研仓库聚合仓库、语言、贡献者、Issue/PR 主题和研究方向,输出趋势分析、图谱节点边和选题建议。用于科研选题、技术生态调研和领域知识图谱构建。"
---
# gitlink-research-knowledge-graph
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 只读执行。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 控制 API 调用量:每个关键词保留前 8 个仓库,深度分析不超过 8 个仓库。
- 对镜像仓库标注数据局限,不把 GitLink 平台内 watcher/fork 等同于原平台全量影响力。
## 工作流
1. 将研究主题拆成 3 到 5 个关键词,覆盖中文、英文、缩写和技术术语。
2. 搜索仓库:
```bash
gitlink-cli search +repos -k <keyword> --format json
```
3. 去重并选取候选仓库:
- 唯一键优先使用 `author.login/identifier`
- 同一仓库匹配多个关键词时保留并记录全部关键词。
- 总候选控制在 20 个以内。
- 深度分析优先选择匹配关键词多、更新时间近、关注度高的 5 到 8 个。
4. 对重点仓库采集详情:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
gitlink-cli repo +languages --owner <owner> --repo <repo> --format json
gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json
gitlink-cli issue +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state open --format json
```
5. 按 `references/graph-schema.md` 输出图谱 JSON 和趋势报告。
## 输出格式
```markdown
# 科研热点与知识图谱:<topic>
## 搜索范围
关键词:...
命中仓库:...
深度分析:...
## 趋势洞察
1. ...
## 图谱摘要
| 节点类型 | 数量 |
|---|---:|
| repo | ... |
| language | ... |
| contributor | ... |
| topic | ... |
## 选题建议
1. ...
```
同时输出或附带如下 JSON 结构:
```json
{
"nodes": [],
"edges": []
}
```
## 分析原则
- 不要把搜索结果数量直接解释为学术热度,只能作为 GitLink 平台内信号。
- 图谱边必须有来源命令或字段依据。
- 选题建议要区分“成熟方向”“新兴方向”“生态空白”。

View File

@ -0,0 +1,24 @@
# Keyword knowledge graph example
User request:
```text
请围绕“论文复现”和“open research”在 GitLink 上做科研热点搜索,并输出轻量知识图谱。
```
Agent steps:
```bash
gitlink-cli search +repos -k "论文复现" --format json
gitlink-cli search +repos -k "open research" --format json
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
gitlink-cli repo +languages --owner <owner> --repo <repo> --format json
gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json
```
Expected answer:
- List keywords and candidate repositories.
- Provide a Markdown trend report.
- Provide `nodes` and `edges` JSON using `references/graph-schema.md`.

View File

@ -0,0 +1,37 @@
# Research knowledge graph schema
Node types:
| Type | Required fields | Description |
|---|---|---|
| `repo` | `id`, `owner`, `repo`, `label` | GitLink repository |
| `language` | `id`, `name` | Programming language |
| `contributor` | `id`, `login` | Public contributor identity |
| `topic` | `id`, `name` | Keyword or inferred research topic |
| `issue` | `id`, `title`, `state` | Representative Issue |
| `pr` | `id`, `title`, `state` | Representative PR |
Edge types:
| Type | From | To | Evidence |
|---|---|---|---|
| `uses_language` | repo | language | `repo +languages` |
| `contributed_by` | contributor | repo | `repo +contributors` |
| `matches_topic` | repo | topic | search keyword or description |
| `has_issue` | repo | issue | `issue +list` |
| `has_pr` | repo | pr | `pr +list` |
Example:
```json
{
"nodes": [
{"id": "repo:Gitconomy/Git4Research", "type": "repo", "label": "Gitconomy/Git4Research"},
{"id": "topic:open-research", "type": "topic", "label": "open research"}
],
"edges": [
{"source": "repo:Gitconomy/Git4Research", "target": "topic:open-research", "type": "matches_topic", "evidence": "search +repos keyword"}
]
}
```

View File

@ -0,0 +1,82 @@
---
name: gitlink-research-progress-tracker
description: "科研项目进度跟踪与预警:基于 GitLink Issue、PR、Release、贡献者和仓库更新时间生成课题组周报、停滞风险、开放问题队列和下一步建议。用于科研项目管理、中期检查和例会汇报。"
---
# gitlink-research-progress-tracker
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 默认只读执行。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 不自动关闭 Issue、不合并 PR、不发布周报评论。
- 如果用户要求发布周报到 Issue先生成 dry-run 草稿并等待确认。
## 工作流
1. 获取仓库概览:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
```
2. 获取协作队列:
```bash
gitlink-cli issue +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli issue +list --owner <owner> --repo <repo> --state closed --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state open --format json
gitlink-cli pr +list --owner <owner> --repo <repo> --state merged --format json
```
3. 获取版本和贡献者信息:
```bash
gitlink-cli release +list --owner <owner> --repo <repo> --format json
gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json
```
如果当前 CLI 版本没有 `repo +contributors`,回退:
```bash
gitlink-cli api GET /<owner>/<repo>/contributors --format json
```
4. 按 `references/risk-model.md` 判断风险,并生成周报。
## 输出格式
```markdown
# 科研项目周报:<owner>/<repo>
## 本期概览
| 指标 | 数值 |
|---|---:|
| 开放 Issue | ... |
| 已关闭 Issue | ... |
| 开放 PR | ... |
| 已合并 PR | ... |
| Release 数 | ... |
| 贡献者 | ... |
## 风险预警
| 风险 | 等级 | 证据 | 建议 |
|---|---|---|---|
## 下一步建议
1. ...
```
## 分析原则
- 先报告事实,再给建议。
- 把“没有数据”和“数据为 0”区分开。
- 如果 PR/Issue 的 state 过滤不精确,根据返回字段二次归类,并在报告中说明。
- 重点识别阻塞项:长期开放 Issue、开放 PR 堆积、无 Release、近期无维护活动、单人维护风险。

View File

@ -0,0 +1,25 @@
# Research weekly report example
User request:
```text
请给 songhui18/ICCV2021 生成一份科研项目进度周报和风险预警。
```
Agent steps:
```bash
gitlink-cli repo +info --owner songhui18 --repo ICCV2021 --format json
gitlink-cli issue +list --owner songhui18 --repo ICCV2021 --state open --format json
gitlink-cli issue +list --owner songhui18 --repo ICCV2021 --state closed --format json
gitlink-cli pr +list --owner songhui18 --repo ICCV2021 --state open --format json
gitlink-cli pr +list --owner songhui18 --repo ICCV2021 --state merged --format json
gitlink-cli release +list --owner songhui18 --repo ICCV2021 --format json
```
Expected answer:
- Provide a concise weekly report.
- Identify the top 3 risks with evidence.
- Do not write comments back unless explicitly requested.

View File

@ -0,0 +1,11 @@
# Research progress risk model
| 风险 | 等级 | 判定线索 | 建议 |
|---|---|---|---|
| Issue 堆积 | 中/高 | 开放 Issue 明显多于关闭 Issue或关键问题长期未响应 | 分类 Issue标注优先级安排负责人 |
| PR 堆积 | 中/高 | 开放 PR 多且缺少 review/merge 记录 | 建立 review 节奏,先处理小 PR |
| 版本停滞 | 中 | 无 Release 或长期无 Release | 为阶段性实验结果建立 Release |
| 维护停滞 | 高 | 仓库更新时间较久且仍有开放问题 | 明确是否归档、继续维护或招募维护者 |
| 单点维护 | 中 | 贡献者数量很少 | 补贡献指南和 onboarding 任务 |
| 数据不足 | 低 | API 缺失或仓库未启用对应功能 | 标注数据不可用,不推断过度结论 |

View File

@ -0,0 +1,90 @@
---
name: gitlink-research-reproducibility
description: "科研仓库复现性审计:检查 GitLink 科研、论文复现、实验代码仓库是否具备 README、LICENSE、依赖清单、测试入口、CI、示例和数据/实验说明。用于生成复现性评分、缺失项和整改建议。"
---
# gitlink-research-reproducibility
开始前必须先阅读 `../gitlink-shared/SKILL.md`,确认认证、权限、安全规则和 GitLink API 注意事项。
## 安全规则
- 只读执行,不创建 Issue、不评论、不修改仓库。
- 所有 GitLink 操作必须使用 `gitlink-cli`
- 所有命令使用 `--format json`
- 不输出 Token、Cookie 或认证 Header。
- 如果用户要求回写整改清单,先输出 dry-run 文本并等待确认。
## 工作流
1. 确认目标仓库:
```bash
gitlink-cli repo +info --owner <owner> --repo <repo> --format json
```
2. 识别默认分支。优先使用 `repo +info` 返回的 `default_branch``default_branch_name`。没有字段时再询问用户,或使用 `master` 作为 GitLink 常见默认值。
3. 采集根目录文件树:
```bash
gitlink-cli repo +tree --owner <owner> --repo <repo> --ref <branch> --format json
```
如果当前 CLI 版本没有 `repo +tree`,回退 Raw API
```bash
gitlink-cli api GET /<owner>/<repo>/sub_entries --query 'filepath=&ref=<branch>' --format json
```
4. 如根目录存在 `docs`、`examples`、`data`、`experiments`、`notebooks`、`tests`、`.github`、`.gitlink`,按需采集一层子目录用于证据补强:
```bash
gitlink-cli repo +tree --owner <owner> --repo <repo> --path docs --ref <branch> --format json
```
5. 按 `references/checklist.md` 的评分表生成报告。没有读取子目录证据时,报告必须标注“仅基于根目录文件树”。
## 输出格式
```markdown
# 科研复现性审计:<owner>/<repo>
## 总分
<score>/100
## 检查明细
| 项目 | 分值 | 结果 | 证据 | 建议 |
|---|---:|---|---|---|
| README | 20 | 通过/缺失 | root_entries | ... |
## 优先整改
1. ...
2. ...
3. ...
## 数据来源
- `repo +info`
- `repo +tree``api GET /sub_entries`
```
## 判定规则
- README`README.md`、`README.zh-CN.md`、`readme`。
- LICENSE`LICENSE`、`LICENSE.md`、`LICENSE.txt`。
- 依赖清单:`requirements.txt`、`pyproject.toml`、`environment.yml`、`package.json`、`go.mod`、`Cargo.toml`、`pom.xml` 等。
- 测试入口:`tests`、`test`、`__tests__`。
- CI 配置:`.github`、`.gitlink`、`.gitlab-ci.yml`、`Jenkinsfile`、`.circleci`。
- 示例或文档:`docs`、`examples`、`demo`。
- 数据或实验说明:`data`、`datasets`、`experiments`、`notebooks`。
## 注意事项
- 复现性评分是工程辅助判断,不等同于论文质量评价。
- GitLink 平台 API 可能返回字段差异,缺失字段时用“未知”而不是编造。
- 如果仓库是镜像仓库,需标注 GitLink 内协作数据可能不代表原平台活跃度。

View File

@ -0,0 +1,23 @@
# Reproducibility audit example
User request:
```text
请用 GitLink 分析 songhui18/ICCV2021 的论文复现性,输出缺失项和整改优先级。
```
Agent steps:
```bash
gitlink-cli repo +info --owner songhui18 --repo ICCV2021 --format json
gitlink-cli repo +tree --owner songhui18 --repo ICCV2021 --ref master --format json
gitlink-cli api GET /songhui18/ICCV2021/sub_entries --query 'filepath=&ref=master' --format json
```
Expected answer:
- Quote the collected command names.
- Score README, LICENSE, dependencies, tests, CI, examples/docs, data notes.
- List the top three fixes before any optional polishing.
- State that no write action was performed.

View File

@ -0,0 +1,12 @@
# Reproducibility checklist
| 项目 | 分值 | 通过条件 | 缺失时建议 |
|---|---:|---|---|
| README | 20 | 根目录存在 README且能说明项目目标、安装或运行方式 | 补充项目背景、环境准备、最小运行命令 |
| LICENSE | 15 | 根目录存在 LICENSE 文件 | 选择合适开源许可证并在 README 中声明 |
| 依赖清单 | 15 | 存在语言对应依赖文件 | 补充 requirements.txt、pyproject.toml、environment.yml、go.mod 等 |
| 测试入口 | 20 | 存在 tests/test/__tests__ 或可运行验证脚本 | 提供最小单元测试或 smoke test |
| CI 配置 | 10 | 存在 CI 配置目录或文件 | 增加基础 lint/test CI |
| 示例或文档 | 10 | 存在 docs/examples/demo | 补充复现实验步骤或示例输入输出 |
| 数据或实验说明 | 10 | 存在 data/datasets/experiments/notebooks 或 README 中明确说明 | 写明数据来源、下载方式、实验配置 |