원클릭으로
forgejo-sync
同步 User Story 与 Forgejo Issue,发布 PRD 到 Wiki。 使用场景:"同步 Story 到 Forgejo Issue"、"发布 PRD 到 Wiki"
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
同步 User Story 与 Forgejo Issue,发布 PRD 到 Wiki。 使用场景:"同步 Story 到 Forgejo Issue"、"发布 PRD 到 Wiki"
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Aria 项目级配置加载器(内部基础设施)。 查找、解析、验证 .aria/config.json 并合并默认值。 此 Skill 不直接触发,由其他 Skills 引用以读取项目配置。
项目状态扫描与智能工作流推荐,十步循环的统一入口。 收集项目状态、分析变更、推荐最佳工作流、引导用户确认执行。 使用场景:"查看项目当前状态"、"我要提交代码"、"开发新功能"
会话收尾 —— 在任意对话(含未走完十步循环的探索/调试/讨论 session)把"未交接成果" 固化为 handoff。**与十步循环正交平级的会话仪式**(非周期收尾): AI 先内省本对话出 未完成线程 + 待固化经验, 再用机械 autofill 交叉核验补漏, 写 docs/handoff/。leaf — 终结于写交接, 不拖入十步循环。 使用场景: "对话收尾" / "执行对话收尾" / "会话收尾" / "session closeout" / "收尾这次对话" / "写交接" / "写 handoff" / "收工" / "结束本次对话" / context 快满时主动收尾。 不适用 (用 phase-d-closer): "Phase D" / "周期收尾" / "归档 Spec" / "更新 cycle 进度" —— 那是开发周期收尾, 不是会话收尾。
Git 多远程 parity 检测与 push 验证的共享基础设施。 内部工具, 仅供其他 skills 引用。提供标准化 Bash/Python 执行脚本段 + 输出 JSON schema 契约。
任务到 Agent 的智能路由器,根据任务类型、文件路径自动选择最合适的 Agent。 使用场景:subagent-driver 需要为任务选择 Agent、不确定应该使用哪个 Agent
向 Aria 维护团队报告 Bug 或提交功能建议。自动收集环境信息, 自动路由到 Forgejo(内部用户)或 GitHub(外部用户)。 使用场景:"报告 bug"、"report an issue"、"提交功能建议"、 "aria 有个问题想反馈"、"feature request"、"提 issue"、 "反馈问题"、"report bug to aria"
| name | forgejo-sync |
| description | 同步 User Story 与 Forgejo Issue,发布 PRD 到 Wiki。 使用场景:"同步 Story 到 Forgejo Issue"、"发布 PRD 到 Wiki" |
| argument-hint | [--sync-direction] |
| disable-model-invocation | false |
| user-invocable | true |
| allowed-tools | Read, Glob, Grep, Edit, WebFetch |
版本: 1.0.0 | 层级: Layer 2 (Business Skill) | 分类: Requirements Skills
使用场景:
不使用场景:
requirements-validatorrequirements-sync前置条件:
| 功能 | 描述 |
|---|---|
| story-to-issue | Story → Issue 创建/更新 |
| issue-to-story | Issue → Story 状态同步 |
| bulk-sync | 批量同步所有 Story |
| status-check | 检查状态差异 |
| prd-to-wiki | PRD → Wiki 发布 |
forgejo-sync 在 PRE_CHECK 步骤中自动检测 Forgejo 配置是否就位。
forgejo.10cg.pub)CLAUDE.local.md 不存在,或文件存在但缺少 forgejo: 配置块文件不存在时:
owner/repo (支持 SSH git@host:owner/repo.git 和 HTTPS 格式)cloudflare_access.enabled: trueCLAUDE.local.md,继续后续步骤文件存在但缺少 forgejo 块时:
已有 forgejo 配置时: 不提示,直接进入原有 PRE_CHECK 流程。
与现有配置 schema 字段一致:
## Forgejo Integration
forgejo:
url: "https://forgejo.10cg.pub"
repo: "{owner}/{repo}"
cloudflare_access:
enabled: true
client_id_env: "CF_ACCESS_CLIENT_ID"
client_secret_env: "CF_ACCESS_CLIENT_SECRET"
forgejo.10cg.pub) 生效,硬编码白名单在 .claude/skills/forgejo-sync/CONFIG.md 或 CLAUDE.local.md 中配置:
forgejo:
url: "https://forgejo.example.com"
api_token: "${FORGEJO_TOKEN}" # 环境变量
repo: "owner/repo"
forgejo:
default_labels: ["user-story"]
auto_create_milestone: true
wiki:
enabled: true
page_prefix: "PRD-"
generate_index: true
| Story Status | Issue State | Issue Labels |
|---|---|---|
| draft | open | [draft] |
| ready | open | [ready] |
| in_progress | open | [in-progress] |
| blocked | open | [blocked] |
| done | closed | - |
| Issue State | Issue Labels | Story Status |
|---|---|---|
| open | draft | draft |
| open | ready | ready |
| open | in-progress | in_progress |
| open | blocked | blocked |
| closed | any | done |
| Story Priority | Issue Label |
|---|---|
| HIGH | priority:high |
| MEDIUM | priority:medium |
| LOW | priority:low |
CRITICAL: 在执行任何 Forgejo API 调用前,AI 必须遵循以下检查流程。 统一规范: 引用
PRE_CHECK.md(同目录)
# 统一的前置检查规范
引用: PRE_CHECK.md
API_Call_Pre_Check:
1. 读取配置:
- 读取 CLAUDE.local.md 或 CONFIG.md
- 查找 forgejo.cloudflare_access.enabled 值
2. 根据 enabled 状态决定调用模式:
enabled = true:
→ 使用 Cloudflare Access 模式
→ 必须添加两个头部:
- CF-Access-Client-Id: ${CF_ACCESS_CLIENT_ID}
- CF-Access-Client-Secret: ${CF_ACCESS_CLIENT_SECRET}
enabled = false 或未设置:
→ 使用标准模式
→ 仅添加标准 Authorization 头部
3. 执行后检测:
- 检查 HTTP 状态码
- 检查响应内容
- 如果 403 或包含 "cloudflare"/"challenge":
→ 自动提示用户配置 Cloudflare Access
标准模式 (cloudflare_access 未启用):
curl -H "Authorization: token ${FORGEJO_TOKEN}" \
-H "Content-Type: application/json" \
"${FORGEJO_API_URL}/repos/{owner}/{repo}/issues"
Cloudflare Access 模式 (cloudflare_access.enabled = true):
curl \
-H "Authorization: token ${FORGEJO_TOKEN}" \
-H "CF-Access-Client-Id: ${CF_ACCESS_CLIENT_ID}" \
-H "CF-Access-Client-Secret: ${CF_ACCESS_CLIENT_SECRET}" \
-H "Content-Type: application/json" \
"${FORGEJO_API_URL}/repos/{owner}/{repo}/issues"
检测条件:
自动提示模板:
⚠️ 检测到 Cloudflare Access 保护
Forgejo API 调用被拒绝 (403),响应中包含 Cloudflare challenge。
请在 CLAUDE.local.md 中添加以下配置:
forgejo:
url: "你的 Forgejo URL"
api_token: "${FORGEJO_TOKEN}"
repo: "owner/repo"
cloudflare_access:
enabled: true
client_id_env: "CF_ACCESS_CLIENT_ID"
client_secret_env: "CF_ACCESS_CLIENT_SECRET"
并设置环境变量:
export CF_ACCESS_CLIENT_ID="your-client-id"
export CF_ACCESS_CLIENT_SECRET="your-service-token"
步骤:
1. 读取 Story 文件
2. 检查是否已有 Forgejo Issue 字段
3. 如无,调用 API 创建 Issue
- Title: "[US-XXX] {标题}"
- Body: Story 内容 + 验收标准
- Labels: ["user-story", "{status}", "{priority}"]
- Milestone: 从 Story 读取
4. 更新 Story 文件的 Forgejo Issue 字段
输出:
issue_created: true
issue_number: 123
issue_url: "https://forgejo.example.com/owner/repo/issues/123"
步骤:
1. 读取 Story 文件的 Forgejo Issue 字段
2. 调用 API 获取 Issue 状态
3. 根据状态映射更新 Story Status
4. 保存 Story 文件
输出:
story_updated: true
old_status: "ready"
new_status: "in_progress"
步骤:
1. 读取 PRD 文件
2. 检查 PRD 状态是否为 approved
3. 调用 Wiki API 创建/更新页面
- Page Name: "PRD-{version}-{feature}"
- Content: PRD 内容 + 自动页脚
4. 更新 UPM 的 wiki_page 字段
输出:
wiki_published: true
page_name: "PRD-v2.1.0-notification"
page_url: "https://forgejo.example.com/owner/repo/wiki/PRD-v2.1.0-notification"
forgejo_sync_result:
action: "story-to-issue|issue-to-story|bulk-sync|prd-to-wiki"
timestamp: "2026-01-01T10:00:00+08:00"
stories:
processed: N
created: N
updated: N
skipped: N
issues:
created: N
updated: N
wiki:
published: N
skipped: N
drift:
detected: true/false
items: [...]
errors: [...]
method: POST
url: /api/v1/repos/{owner}/{repo}/issues
headers:
Authorization: "token ${FORGEJO_TOKEN}"
body:
title: "[US-001] Feature Title"
body: |
## User Story
As a {role}...
## Acceptance Criteria
- [ ] Criteria 1
- [ ] Criteria 2
---
Story File: `docs/requirements/user-stories/US-001-xxx.md`
labels: ["user-story", "ready", "priority:high"]
milestone: 1
method: PATCH
url: /api/v1/repos/{owner}/{repo}/issues/{id}
body:
state: "open|closed"
labels: [...]
method: PUT
url: /api/v1/repos/{owner}/{repo}/wiki/page/{pageName}
body:
title: "PRD: Feature Title"
content: |
{prd_content}
---
> **Source**: `docs/requirements/prd-v2.1.0-xxx.md`
> **Last Synced**: 2026-01-01T10:00:00
> **Note**: Auto-synced from Git. Do not edit directly.
用户: 为 US-001 创建 Forgejo Issue
助手执行:
1. 读取 US-001-xxx.md
2. 调用 Forgejo API 创建 Issue
3. 更新 Story 文件
输出:
forgejo_sync_result:
action: "story-to-issue"
issues:
created: 1
story_updated: "US-001-xxx.md"
issue_url: "https://..."
用户: 同步所有 Story 到 Forgejo
助手执行:
1. 扫描所有 Story 文件
2. 为无 Issue 的 Story 创建 Issue
3. 同步有 Issue 的 Story 状态
输出:
forgejo_sync_result:
action: "bulk-sync"
stories:
processed: 8
created: 3
updated: 5
用户: 发布 PRD 到 Wiki
助手执行:
1. 读取 PRD 文件
2. 检查状态为 approved
3. 调用 Wiki API 发布
输出:
forgejo_sync_result:
action: "prd-to-wiki"
wiki:
published: 1
page_url: "https://..."
┌─────────────────────────────────────────────────────────────┐
│ requirements-validator (Layer 2) │
│ │ 验证后 │
│ ▼ │
│ requirements-sync (Layer 2) │
│ │ 同步 UPM 后 │
│ ▼ │
│ forgejo-sync (Layer 2) ◄── 本 Skill │
│ │ │
│ ▼ │
│ Forgejo API (外部) │
└─────────────────────────────────────────────────────────────┘
openspec/specs/forgejo-sync/spec.mdCONFIG.md (同目录)standards/templates/user-story-template.mdstandards/templates/prd-template.md