refactor: split skills into hermes/ and cursor/ categories
- Move all Hermes skills from skills/ to hermes/ - Add cursor/ for Cursor rules (.mdc) - Add code-review.mdc (Gitea PR review with tea CLI) - Update sync.sh to use new hermes/ path - Update README with new structure
This commit is contained in:
parent
c52451a2ee
commit
85e58ae239
50
README.md
50
README.md
@ -1,46 +1,32 @@
|
||||
# 沙洲工坊 — 共享 Skills
|
||||
# Skills
|
||||
|
||||
所有 agent 伙伴通用的 Hermes Skills。
|
||||
通用 skills 仓库,按工具分类。
|
||||
|
||||
## 使用方式
|
||||
## 目录结构
|
||||
|
||||
### 方式一:直接 symlink(推荐)
|
||||
|
||||
```bash
|
||||
git clone https://git.shazhou.work/shazhou/skills.git ~/shazhou-skills
|
||||
ln -s ~/shazhou-skills/skills/* ~/.hermes/skills/openclaw-imports/
|
||||
```
|
||||
hermes/ # Hermes Agent skills (YAML frontmatter + markdown)
|
||||
cursor/ # Cursor rules (.mdc,通用的)
|
||||
```
|
||||
|
||||
### 方式二:运行同步脚本
|
||||
## 使用
|
||||
|
||||
### Hermes Skills
|
||||
|
||||
```bash
|
||||
git clone https://git.shazhou.work/shazhou/skills.git ~/shazhou-skills
|
||||
bash ~/shazhou-skills/sync.sh
|
||||
bash sync.sh # 同步到 ~/.hermes/skills/openclaw-imports/
|
||||
```
|
||||
|
||||
### 更新
|
||||
### Cursor Rules
|
||||
|
||||
手动复制需要的 `.mdc` 到项目的 `.cursor/rules/`:
|
||||
|
||||
```bash
|
||||
cd ~/shazhou-skills && git pull
|
||||
cp cursor/code-review.mdc /path/to/project/.cursor/rules/
|
||||
```
|
||||
|
||||
## Skills 列表
|
||||
## Cursor Rules 列表
|
||||
|
||||
| Skill | 说明 |
|
||||
|-------|------|
|
||||
| `coding-workflow` | 标准编码工作流:Issue → Branch → Code → PR |
|
||||
| `cursor-agent-cn` | Cursor Agent CLI 中国区配置 |
|
||||
| `wiki-writing` | Gitea wiki 编写规范 |
|
||||
| `remote-assist` | 远程 SSH 协助(Cloudflare Tunnel) |
|
||||
| `rfc-iteration` | RFC 驱动迭代工作流 |
|
||||
| `summarize` | 用 summarize CLI 摘要 URL/文件 |
|
||||
| `memex-zettelkasten` | 共享知识库(Zettelkasten) |
|
||||
| `weather` | 天气查询 |
|
||||
| `agent-memes` | 表情包 |
|
||||
|
||||
## 贡献
|
||||
|
||||
1. Fork 或新建分支
|
||||
2. 在 `skills/` 下新增或修改 skill
|
||||
3. 提 PR,等 review 合并
|
||||
4. 合并后各 agent 执行 `git pull` 同步
|
||||
| 文件 | 用途 |
|
||||
|------|------|
|
||||
| `code-review.mdc` | 用 tea CLI 做 Gitea PR Code Review |
|
||||
|
||||
143
cursor/code-review.mdc
Normal file
143
cursor/code-review.mdc
Normal file
@ -0,0 +1,143 @@
|
||||
# Code Review with Gitea (tea CLI)
|
||||
|
||||
How to review Pull Requests on our self-hosted Gitea (git.shazhou.work) using the `tea` CLI.
|
||||
|
||||
## 1. Find and Read PR
|
||||
|
||||
```bash
|
||||
# List open PRs
|
||||
tea pr
|
||||
|
||||
# View PR details (description, author, branch, status)
|
||||
tea pr 5
|
||||
|
||||
# View PR with comments
|
||||
tea pr 5 --comments
|
||||
```
|
||||
|
||||
## 2. Check Out PR Locally
|
||||
|
||||
```bash
|
||||
# Checkout PR branch locally for full-context review
|
||||
tea pr checkout 5
|
||||
|
||||
# See what files changed vs base branch
|
||||
git diff main...HEAD --stat
|
||||
git diff main...HEAD --name-only
|
||||
```
|
||||
|
||||
## 3. Read the Diff
|
||||
|
||||
```bash
|
||||
# Full diff
|
||||
git diff main...HEAD
|
||||
|
||||
# Per-file diff (for large PRs, review file by file)
|
||||
git diff main...HEAD -- path/to/file.py
|
||||
|
||||
# Check for obvious issues in diff
|
||||
git diff main...HEAD | grep -n "TODO\|FIXME\|HACK\|XXX\|debugger\|console\.log"
|
||||
git diff main...HEAD | grep -n "password\|secret\|api_key\|token.*="
|
||||
git diff main...HEAD | grep -n "<<<<<<\|>>>>>>\|======="
|
||||
```
|
||||
|
||||
For each changed file, read the full file (not just the diff) to understand surrounding context.
|
||||
|
||||
## 4. Find Project-Specific Rules
|
||||
|
||||
Before reviewing, check for project conventions:
|
||||
|
||||
```bash
|
||||
# Look for contribution guides, code standards, linting config
|
||||
ls -la .editorconfig .eslintrc* .prettierrc* pyproject.toml biome.json 2>/dev/null
|
||||
cat CONTRIBUTING.md 2>/dev/null
|
||||
cat .cursor/rules/*.mdc 2>/dev/null
|
||||
|
||||
# Check existing CI config for what's enforced
|
||||
ls .github/workflows/ .gitea/workflows/ 2>/dev/null
|
||||
```
|
||||
|
||||
Apply whatever standards the project defines. If none exist, use general best practices.
|
||||
|
||||
## 5. Run Tests / Linters (if available)
|
||||
|
||||
```bash
|
||||
# Detect and run project tests
|
||||
# Node: npm test / npx vitest
|
||||
# Python: pytest / python -m pytest
|
||||
# Rust: cargo test
|
||||
# Go: go test ./...
|
||||
|
||||
# Run linter if configured
|
||||
# Node: npx eslint . / npx biome check
|
||||
# Python: ruff check .
|
||||
```
|
||||
|
||||
## 6. Write Review Feedback
|
||||
|
||||
### Leave a comment on the PR
|
||||
|
||||
```bash
|
||||
tea pr comment 5 "Your review summary here"
|
||||
```
|
||||
|
||||
### Use Gitea API for inline comments (tea doesn't support inline)
|
||||
|
||||
```bash
|
||||
# Get PR diff info for positioning
|
||||
GITEA_TOKEN="your-token"
|
||||
BASE_URL="https://git.shazhou.work/api/v1"
|
||||
OWNER="uncaged"
|
||||
REPO="nerve"
|
||||
PR=5
|
||||
|
||||
# Post a review with inline comments
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$BASE_URL/repos/$OWNER/$REPO/pulls/$PR/reviews" \
|
||||
-d '{
|
||||
"event": "COMMENT",
|
||||
"body": "Code review summary",
|
||||
"comments": [
|
||||
{"path": "src/file.py", "new_position": 45, "body": "Suggestion here"}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
Event values: `"APPROVED"`, `"REQUEST_CHANGES"`, `"COMMENT"`
|
||||
|
||||
### Review comment format
|
||||
|
||||
Use this structure for the summary comment:
|
||||
|
||||
```
|
||||
## Code Review Summary
|
||||
|
||||
**Verdict:** Approved / Changes Requested / Comment
|
||||
|
||||
### 🔴 Critical
|
||||
- **file:line** — description
|
||||
|
||||
### ⚠️ Warnings
|
||||
- **file:line** — description
|
||||
|
||||
### 💡 Suggestions
|
||||
- **file:line** — description
|
||||
|
||||
### ✅ Looks Good
|
||||
- What's well done
|
||||
```
|
||||
|
||||
## 7. Decision Guide
|
||||
|
||||
- **Approve** — no critical/warning issues, only minor suggestions or all clear
|
||||
- **Request Changes** — critical or warning-level issues that must be fixed before merge
|
||||
- **Comment** — observations only, nothing blocking (drafts, or when unsure)
|
||||
|
||||
## 8. Clean Up
|
||||
|
||||
```bash
|
||||
git checkout main
|
||||
git branch -D pr-branch-name
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user