@namewta/speculo 2.0.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +3 -0
  2. package/THIRD-PARTY-NOTICES.md +4 -0
  3. package/dist/src/agent-skills.d.ts +5 -0
  4. package/dist/src/agent-skills.js +10 -7
  5. package/dist/src/agent-skills.js.map +1 -1
  6. package/dist/src/cli.js +17 -4
  7. package/dist/src/cli.js.map +1 -1
  8. package/dist/src/coordination.d.ts +3 -3
  9. package/dist/src/coordination.js +21 -4
  10. package/dist/src/coordination.js.map +1 -1
  11. package/dist/src/doctor.js +8 -1
  12. package/dist/src/doctor.js.map +1 -1
  13. package/dist/src/external-files.d.ts +4 -2
  14. package/dist/src/external-files.js +4 -4
  15. package/dist/src/external-files.js.map +1 -1
  16. package/dist/src/hub-catalog.d.ts +11 -0
  17. package/dist/src/hub-catalog.js +91 -0
  18. package/dist/src/hub-catalog.js.map +1 -0
  19. package/dist/src/hub-resources.json +1 -0
  20. package/dist/src/hub-skills.d.ts +53 -0
  21. package/dist/src/hub-skills.js +157 -0
  22. package/dist/src/hub-skills.js.map +1 -0
  23. package/dist/src/index.d.ts +6 -0
  24. package/dist/src/index.js +48 -47
  25. package/dist/src/index.js.map +1 -1
  26. package/dist/src/install-ui.d.ts +16 -0
  27. package/dist/src/install-ui.js +67 -11
  28. package/dist/src/install-ui.js.map +1 -1
  29. package/dist/src/manifest.d.ts +2 -0
  30. package/dist/src/manifest.js +2 -0
  31. package/dist/src/manifest.js.map +1 -1
  32. package/dist/src/refresh.d.ts +1 -0
  33. package/dist/src/refresh.js +13 -10
  34. package/dist/src/refresh.js.map +1 -1
  35. package/dist/src/retained-workflows.d.ts +10 -0
  36. package/dist/src/retained-workflows.js +25 -0
  37. package/dist/src/retained-workflows.js.map +1 -0
  38. package/dist/src/runtime-entry.d.ts +1 -0
  39. package/dist/src/runtime-entry.js +1 -0
  40. package/dist/src/runtime-entry.js.map +1 -1
  41. package/dist/src/skill-trees.d.ts +27 -0
  42. package/dist/src/skill-trees.js +118 -0
  43. package/dist/src/skill-trees.js.map +1 -0
  44. package/dist/src/transaction.d.ts +3 -14
  45. package/dist/src/transaction.js +20 -36
  46. package/dist/src/transaction.js.map +1 -1
  47. package/dist/src/workflow-install.d.ts +15 -0
  48. package/dist/src/workflow-install.js +104 -0
  49. package/dist/src/workflow-install.js.map +1 -0
  50. package/package.json +4 -2
  51. package/skills-hub/automation/grok-bot-team-steward/CHEATSHEET.md +17 -0
  52. package/skills-hub/automation/grok-bot-team-steward/INSTALL.md +23 -0
  53. package/skills-hub/automation/grok-bot-team-steward/LICENSE +21 -0
  54. package/skills-hub/automation/grok-bot-team-steward/README.md +9 -0
  55. package/skills-hub/automation/grok-bot-team-steward/SKILL.md +52 -0
  56. package/skills-hub/automation/grok-bot-team-steward/agents/openai.yaml +4 -0
  57. package/skills-hub/automation/grok-bot-team-steward/references/00-hard-rules.md +50 -0
  58. package/skills-hub/automation/grok-bot-team-steward/references/01-snapshot-schema.md +84 -0
  59. package/skills-hub/automation/grok-bot-team-steward/references/02-export-protocol.md +57 -0
  60. package/skills-hub/automation/grok-bot-team-steward/references/03-restore-protocol.md +64 -0
  61. package/skills-hub/automation/grok-bot-team-steward/references/04-inventory.md +37 -0
  62. package/skills-hub/automation/grok-bot-team-steward/references/05-conversations.md +71 -0
  63. package/skills-hub/automation/grok-bot-team-steward/references/06-sanitizer.md +39 -0
  64. package/skills-hub/automation/grok-bot-team-steward/references/07-prompts.md +87 -0
  65. package/skills-hub/automation/grok-bot-team-steward/references/08-verification.md +30 -0
  66. package/skills-hub/automation/grok-bot-team-steward/references/09-sources.md +31 -0
  67. package/skills-hub/automation/grok-bot-team-steward/scripts/scrub.sh +17 -0
  68. package/skills-hub/automation/grok-bot-team-steward/scripts/snapshot-name.sh +18 -0
  69. package/skills-hub/automation/grok-bot-team-steward/scripts/validate-snapshot.sh +62 -0
  70. package/skills-hub/automation/grok-bot-team-steward/steward/ACTIVATE.md +58 -0
  71. package/skills-hub/automation/grok-bot-team-steward/steward/SETUP-INSTRUCTIONS.md +33 -0
  72. package/skills-hub/automation/grok-bot-team-steward/steward/STEWARD-PROFILE.md +28 -0
  73. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/CHANGELOG.md +3 -0
  74. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/CHARTER.md +27 -0
  75. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/DROP-LIST.md +10 -0
  76. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/GAPS.md +6 -0
  77. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/INIT.md +14 -0
  78. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/MANIFEST.md +30 -0
  79. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/MANIFEST.yaml +20 -0
  80. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/ORG.md +15 -0
  81. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/README.md +8 -0
  82. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/RESTORE.md +13 -0
  83. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/ROSTER.md +11 -0
  84. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/GAPS.md +7 -0
  85. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/MEMORY.md +9 -0
  86. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/PROFILE.md +27 -0
  87. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/agent-spec.md +9 -0
  88. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/conversations/INDEX.md +5 -0
  89. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/conversations/main.md +9 -0
  90. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/routines.md +5 -0
  91. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/skills.md +5 -0
  92. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/connectors.md +7 -0
  93. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/COMPLETED.md +6 -0
  94. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/CREATED.md +6 -0
  95. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/RESTORE-NOTES.md +13 -0
  96. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/SANITIZER.md +7 -0
  97. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/SOURCE.md +8 -0
  98. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/rooms/_ROOM.md +8 -0
  99. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/routines/_ROUTINE.md +12 -0
  100. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/shared/shared-memory.md +5 -0
  101. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/shared/workspace-map.md +5 -0
  102. package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/skills/_SKILL/SKILL.md +18 -0
  103. package/skills-hub/automation/herdr/SKILL.md +246 -0
  104. package/skills-hub/automation/orca/SKILL.md +328 -0
  105. package/skills-hub/coding/gitea-repo/LICENSE +21 -0
  106. package/skills-hub/coding/gitea-repo/SKILL.md +50 -0
  107. package/skills-hub/coding/gitea-repo/agents/openai.yaml +4 -0
  108. package/skills-hub/coding/gitea-repo/references/auth-and-scopes.md +58 -0
  109. package/skills-hub/coding/gitea-repo/references/endpoint-map.md +80 -0
  110. package/skills-hub/coding/gitea-repo/references/pagination-and-errors.md +34 -0
  111. package/skills-hub/coding/gitea-repo/scripts/gitea_api.py +814 -0
  112. package/skills-hub/coding/github-repo-steward/LICENSE +21 -0
  113. package/skills-hub/coding/github-repo-steward/SKILL.md +48 -0
  114. package/skills-hub/coding/github-repo-steward/agents/openai.yaml +4 -0
  115. package/skills-hub/coding/github-repo-steward/references/00-auth-and-tokens.md +73 -0
  116. package/skills-hub/coding/github-repo-steward/references/01-inventory.md +55 -0
  117. package/skills-hub/coding/github-repo-steward/references/02-lifecycle.md +57 -0
  118. package/skills-hub/coding/github-repo-steward/references/03-stars.md +42 -0
  119. package/skills-hub/coding/github-repo-steward/references/04-hygiene.md +40 -0
  120. package/skills-hub/coding/github-repo-steward/references/05-sources.md +42 -0
  121. package/skills-hub/coding/github-repo-steward/scripts/inventory.sh +64 -0
  122. package/skills-hub/coding/vscode-fullstack/LICENSE +21 -0
  123. package/skills-hub/coding/vscode-fullstack/SKILL.md +47 -0
  124. package/skills-hub/coding/vscode-fullstack/agents/openai.yaml +4 -0
  125. package/skills-hub/coding/vscode-fullstack/references/extensions-and-settings.md +181 -0
  126. package/skills-hub/coding/vscode-fullstack/references/profiles-and-validation.md +62 -0
  127. package/skills-hub/coding/vscode-fullstack/references/runtime-reuse.md +52 -0
  128. package/skills-hub/design/photo-retouch/LICENSE +21 -0
  129. package/skills-hub/design/photo-retouch/SKILL.md +50 -0
  130. package/skills-hub/design/photo-retouch/agents/openai.yaml +4 -0
  131. package/skills-hub/design/photo-retouch/references/basic-retouch.md +58 -0
  132. package/skills-hub/design/photo-retouch/references/formal-portrait.md +57 -0
  133. package/skills-hub/design/photo-retouch/references/object-and-canvas.md +82 -0
  134. package/skills-hub/design/photo-retouch/references/product-photo.md +41 -0
  135. package/skills-hub/design/photo-retouch/references/repair-and-look.md +61 -0
  136. package/skills-hub/design/photo-retouch/references/social-effects.md +55 -0
  137. package/skills-hub/design/photo-retouch/references/travel-creative.md +79 -0
  138. package/skills-hub/system/clash-client-profile/LICENSE +21 -0
  139. package/skills-hub/system/clash-client-profile/SKILL.md +79 -0
  140. package/skills-hub/system/clash-client-profile/agents/openai.yaml +4 -0
  141. package/skills-hub/system/clash-client-profile/references/acceptance.md +81 -0
  142. package/skills-hub/system/clash-client-profile/references/browser-privacy.md +35 -0
  143. package/skills-hub/system/clash-client-profile/references/clash-verge.md +40 -0
  144. package/skills-hub/system/clash-client-profile/references/dns-workflow.md +147 -0
  145. package/skills-hub/system/clash-client-profile/references/flclash.md +24 -0
  146. package/skills-hub/system/clash-client-profile/references/network-performance.md +25 -0
  147. package/skills-hub/system/clash-client-profile/references/platform-dns.md +109 -0
  148. package/skills-hub/system/clash-client-profile/references/sources.md +46 -0
  149. package/skills-hub/system/clash-client-profile/references/troubleshooting.md +82 -0
  150. package/skills-hub/system/clash-client-profile/scripts/dns_guard.py +650 -0
  151. package/skills-hub/system/clash-client-profile/scripts/proxy_doctor.py +213 -0
  152. package/skills-hub/system/clash-client-profile/scripts/render_rules.py +34 -0
  153. package/skills-hub/system/clash-client-profile/templates/ai-rules.yaml +18 -0
  154. package/skills-hub/system/clash-client-profile/templates/dns-request.example.json +9 -0
  155. package/skills-hub/system/clash-client-profile/templates/dns.yaml +8 -0
  156. package/skills-hub/system/linux-dev-disk-cleanup/LICENSE +21 -0
  157. package/skills-hub/system/linux-dev-disk-cleanup/SKILL.md +42 -0
  158. package/skills-hub/system/linux-dev-disk-cleanup/agents/openai.yaml +4 -0
  159. package/skills-hub/system/linux-dev-disk-cleanup/references/linux-cleanup-workflow.md +145 -0
  160. package/skills-hub/system/optimize-codex-config/LICENSE +21 -0
  161. package/skills-hub/system/optimize-codex-config/SKILL.md +101 -0
  162. package/skills-hub/system/optimize-codex-config/agents/openai.yaml +4 -0
  163. package/skills-hub/system/optimize-codex-config/assets/capabilities.example.json +22 -0
  164. package/skills-hub/system/optimize-codex-config/references/cli.md +35 -0
  165. package/skills-hub/system/optimize-codex-config/references/configuration-contract.md +33 -0
  166. package/skills-hub/system/optimize-codex-config/references/optimization-method.md +38 -0
  167. package/skills-hub/system/optimize-codex-config/references/privacy.md +41 -0
  168. package/skills-hub/system/optimize-codex-config/references/sources.md +24 -0
  169. package/skills-hub/system/optimize-codex-config/references/statusline.md +31 -0
  170. package/skills-hub/system/optimize-codex-config/references/transactions.md +32 -0
  171. package/skills-hub/system/optimize-codex-config/references/troubleshooting.md +95 -0
  172. package/skills-hub/system/optimize-codex-config/scripts/adapters/claude.mjs +24 -0
  173. package/skills-hub/system/optimize-codex-config/scripts/adapters/codex.mjs +10 -0
  174. package/skills-hub/system/optimize-codex-config/scripts/ai-cli-config.mjs +67 -0
  175. package/skills-hub/system/optimize-codex-config/scripts/audit-codex-config.mjs +762 -0
  176. package/skills-hub/system/optimize-codex-config/scripts/lib/document.mjs +166 -0
  177. package/skills-hub/system/optimize-codex-config/scripts/lib/inspect.mjs +211 -0
  178. package/skills-hub/system/optimize-codex-config/scripts/lib/io.mjs +104 -0
  179. package/skills-hub/system/optimize-codex-config/scripts/lib/plan.mjs +79 -0
  180. package/skills-hub/system/optimize-codex-config/scripts/lib/transaction.mjs +205 -0
  181. package/skills-hub/system/optimize-codex-config/scripts/lib/writers.mjs +46 -0
  182. package/skills-hub/system/optimize-codex-config/scripts/statusline/claude-statusline.mjs +94 -0
  183. package/skills-hub/system/optimize-codex-config/scripts/vendor/THIRD-PARTY-NOTICES.txt +250 -0
  184. package/skills-hub/system/optimize-codex-config/scripts/vendor/build-package-lock.json +488 -0
  185. package/skills-hub/system/optimize-codex-config/scripts/vendor/manifest.json +14 -0
  186. package/skills-hub/system/optimize-codex-config/scripts/vendor/parsers.mjs +16 -0
  187. package/skills-hub/system/proxy-region-locale/LICENSE +21 -0
  188. package/skills-hub/system/proxy-region-locale/SKILL.md +42 -0
  189. package/skills-hub/system/proxy-region-locale/agents/openai.yaml +4 -0
  190. package/skills-hub/system/proxy-region-locale/references/linux.md +35 -0
  191. package/skills-hub/system/proxy-region-locale/references/macos.md +31 -0
  192. package/skills-hub/system/proxy-region-locale/references/windows.md +45 -0
  193. package/skills-hub/system/system-health-audit/LICENSE +21 -0
  194. package/skills-hub/system/system-health-audit/SKILL.md +41 -0
  195. package/skills-hub/system/system-health-audit/agents/openai.yaml +4 -0
  196. package/skills-hub/system/system-health-audit/references/platforms.md +37 -0
  197. package/skills-hub/system/system-health-audit/scripts/system_audit.py +41 -0
  198. package/skills-hub/system/windows-dev-disk-cleanup/LICENSE +21 -0
  199. package/skills-hub/system/windows-dev-disk-cleanup/SKILL.md +40 -0
  200. package/skills-hub/system/windows-dev-disk-cleanup/agents/openai.yaml +4 -0
  201. package/skills-hub/system/windows-dev-disk-cleanup/references/windows-cleanup-workflow.md +121 -0
  202. package/skills-hub/writing/.gitkeep +0 -0
  203. package/skills-hub/writing/job-application/LICENSE +21 -0
  204. package/skills-hub/writing/job-application/SKILL.md +160 -0
  205. package/skills-hub/writing/job-application/agents/openai.yaml +4 -0
  206. package/skills-hub/writing/job-application/assets/resume.css +10 -0
  207. package/skills-hub/writing/job-application/config.example.json +9 -0
  208. package/skills-hub/writing/job-application/references/company-research.md +7 -0
  209. package/skills-hub/writing/job-application/references/corpus-schema.md +33 -0
  210. package/skills-hub/writing/job-application/references/honesty-gate.md +29 -0
  211. package/skills-hub/writing/job-application/references/improvement-plan.md +15 -0
  212. package/skills-hub/writing/job-application/references/ingest-protocol.md +18 -0
  213. package/skills-hub/writing/job-application/references/interview-speech.md +16 -0
  214. package/skills-hub/writing/job-application/references/jd-parse.md +18 -0
  215. package/skills-hub/writing/job-application/references/persist-paths.md +34 -0
  216. package/skills-hub/writing/job-application/references/question-bank.md +19 -0
  217. package/skills-hub/writing/job-application/references/rendering.md +9 -0
  218. package/skills-hub/writing/job-application/references/resume-playbook.md +30 -0
  219. package/skills-hub/writing/job-application/scripts/README.md +12 -0
  220. package/skills-hub/writing/job-application/scripts/ingest_kb.py +188 -0
  221. package/skills-hub/writing/job-application/scripts/render_resume.py +144 -0
  222. package/skills-hub/writing/job-application/scripts/validate_claims.py +52 -0
  223. package/skills-hub/writing/job-application/scripts/write_config.py +72 -0
  224. package/skills-hub/writing/job-application/templates/application-index.md +10 -0
  225. package/skills-hub/writing/job-application/templates/brief.md +16 -0
  226. package/skills-hub/writing/job-application/templates/changelog.md +6 -0
  227. package/skills-hub/writing/job-application/templates/company-research.md +15 -0
  228. package/skills-hub/writing/job-application/templates/corpus.md +11 -0
  229. package/skills-hub/writing/job-application/templates/evidence-map.md +5 -0
  230. package/skills-hub/writing/job-application/templates/framings.md +6 -0
  231. package/skills-hub/writing/job-application/templates/improvement-plan.md +16 -0
  232. package/skills-hub/writing/job-application/templates/ingest-log.md +4 -0
  233. package/skills-hub/writing/job-application/templates/known-gaps.md +4 -0
  234. package/skills-hub/writing/job-application/templates/match-report.md +21 -0
  235. package/skills-hub/writing/job-application/templates/methodology-cache.md +10 -0
  236. package/skills-hub/writing/job-application/templates/persist-index.md +11 -0
  237. package/skills-hub/writing/job-application/templates/profile.md +21 -0
  238. package/skills-hub/writing/job-application/templates/questions.md +22 -0
  239. package/skills-hub/writing/job-application/templates/resume-original.md +10 -0
  240. package/skills-hub/writing/job-application/templates/resume-tailored.md +21 -0
  241. package/skills-hub/writing/job-application/templates/sources-index.md +6 -0
  242. package/skills-hub/writing/job-application/templates/speech.md +19 -0
  243. package/skills-hub/writing/job-application/templates/stories.md +9 -0
  244. package/skills-hub/writing/job-application/templates/story-bank.md +11 -0
  245. package/skills-hub/writing/job-application/templates/strengths.md +4 -0
  246. package/skills-hub/writing/job-application/templates/style-memory.md +7 -0
  247. package/skills-hub/writing/ste-zh/LICENSE +21 -0
  248. package/skills-hub/writing/ste-zh/NOTICE.md +9 -0
  249. package/skills-hub/writing/ste-zh/SKILL.md +130 -0
  250. package/skills-hub/writing/ste-zh/agents/openai.yaml +6 -0
  251. package/skills-hub/writing/ste-zh/examples/zh-report.md +23 -0
  252. package/skills-hub/writing/ste-zh/references/english-modes.md +13 -0
  253. package/skills-hub/writing/ste-zh/references/terminology.md +13 -0
  254. package/skills-hub/writing/ste-zh/references/zh-rules.md +29 -0
  255. package/template/.speculo/refresh-contract.json +2 -0
  256. package/template/canonical/canonical-specdev-goal-plan.md +170 -101
  257. package/template/canonical/canonical-specdev-grill-with-docs.md +346 -277
  258. package/template/canonical/canonical-specdev-spec.md +346 -277
  259. package/template/canonical/canonical-specdev-tickets.md +346 -277
  260. package/template/canonical/canonical-specdev-wayfinder.md +346 -277
  261. package/template/lib/speculo-runtime.mjs +183 -8
  262. package/template/references/coordination/coordination-contract.md +12 -4
  263. package/template/references/coordination/modes/cli.md +3 -3
  264. package/template/references/coordination/modes/herdr.md +11 -11
  265. package/template/references/coordination/modes/orca.md +14 -14
  266. package/template/references/coordination/project-facts.schema.json +1 -0
  267. package/template/references/coordination/report-template.md +18 -0
  268. package/template/references/coordination/result-and-recovery.md +3 -3
  269. package/template/references/coordination/session-files.md +49 -56
  270. package/template/references/coordination/task-brief.md +3 -3
  271. package/template/references/coordination/task-template.md +25 -0
  272. package/template/workflows/specdev/common/rules/path-reference-contract.md +1 -1
  273. package/template/workflows/specdev/common/rules/workflow-state-and-lifecycle.md +1 -1
  274. package/template/workflows/specdev/common/schemas/session-locator.schema.json +15 -0
  275. package/template/workflows/specdev/common/skills/code-review/references/review-evidence.md +1 -1
  276. package/template/workflows/specdev/common/tools/README.md +6 -0
  277. package/template/workflows/specdev/common/tools/delivery-artifacts.mjs +1 -1
  278. package/template/workflows/specdev/common/tools/validate-handoff.mjs +108 -0
  279. package/template/workflows/specdev/specdev-i-implement/assets/evidence-template.md +2 -2
  280. package/template/workflows/specdev/specdev-i-implement/references/implementation-procedure.md +1 -1
  281. package/template/workflows/specdev/specdev-i-init-setup/SKILL.md +7 -6
  282. package/template/workflows/specdev/specdev-i-init-setup/references/first-setup.md +30 -1
  283. package/template/workflows/specdev/specdev-p-goal-plan/references/lead-orchestration.md +1 -1
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: gitea-repo
3
+ description: 管理已确认 Gitea/Forgejo 实例的 issue、PR、标签、里程碑和 Release。用于该平台的仓库查询、具名变更和 API 排错;不处理 GitHub/GitLab 或普通 Git 提交。
4
+ license: MIT
5
+ compatibility: Requires Python 3.10+, confirmed Gitea/Forgejo host and scoped credentials; API operations need network access.
6
+ metadata:
7
+ author: NAMEWTA
8
+ wta-format-reviewed: '2026-10-06'
9
+ ---
10
+ # Gitea / Forgejo 仓库 API
11
+
12
+ ## 输入与输出契约
13
+
14
+ 定位 host、owner/repo、操作、具名对象与授权范围;可从已确认的上下文复用,不重复索取。只有 remote、还未确认平台时先做只读辨认;没有目标 host 就不读取令牌。
15
+
16
+ 查询返回对象编号、筛选条件、页数/覆盖和失败页;写操作另给请求动作、返回 ID 与独立读回状态。未取得响应与明确失败分开,输出中不含令牌。
17
+
18
+ 示例:“列出这台 Forgejo 的 owner/repo 所有关闭 issue,不做修改。”应进入本技能;“给 GitHub 项目提交一个修复 PR。”不应由本技能接管。
19
+
20
+ 需要 Python 3.10+、目标实例网络和相应权限。技能目录以本文件位置为准;Windows 检查 python / py -3,macOS/Linux 检查 python3,路径参数始终作为独立参数传入,不用 shell 字符串拼接。
21
+
22
+ ```bash
23
+ python3 "$SKILL_DIR/scripts/gitea_api.py" --host https://gitea.example.com --repo owner/repo issue list
24
+ ```
25
+
26
+ ## 定位与信任
27
+
28
+ 实例按显式 --host、GITEA_HOST、已确认 remote 定位;仓库按 --repo、GITEA_REPO、remote 定位。非 GitHub remote 不证明它是 Gitea;SSH 端口也不等于 API 端口。凭据必须绑定确认的 host,不能从一个实例转发到另一个实例或重定向目标。
29
+
30
+ 令牌优先 GITEA_TOKEN 或凭据工具,不在命令行、日志、快照或回复打印。--token 兼容接口不是推荐用法。认证失败不关闭 TLS;--insecure 只有对具体实例的明确证书例外授权才可使用。缺权限不绕过服务端限制。
31
+
32
+ ## 按需参考
33
+
34
+ | 任务 | 入口 |
35
+ |---|---|
36
+ | issue/PR/标签/里程碑/Release | [端点与命令](references/endpoint-map.md) |
37
+ | 401/403、令牌来源 | [认证与 scopes](references/auth-and-scopes.md) |
38
+ | 全量列表、分页和状态码 | [分页与错误](references/pagination-and-errors.md) |
39
+
40
+ 先读脚本 --help;--json 是全局参数,放在子命令前。实例当前 swagger 才是该版本字段依据;脚本不支持的字段不能编造成已执行。原生 PowerShell 编码和管道按本机版本验证,传 JSON 文件优于多层 shell 转义。
41
+
42
+ ## 操作与停止条件
43
+
44
+ 读取不扩大成写入。issue/PR 共用编号,普通 issue 列表使用 type=issues;标签 ID 按全量分页解析。合并字段 Do 区分大小写。列表失败、重复页或权限不足时标记部分覆盖,不假定不足一页即全部。
45
+
46
+ 缺 read:user 不代表令牌整体失效;对已指定仓库做只读查询,不能推断写权限。创建、评论、合并发生超时或不确定响应时先查状态,不盲重试;不能为了诊断创建资源。删除/合并须有具体对象和动作授权,“关闭”不是“删除”。
47
+
48
+ ## 交付
49
+
50
+ 报告实例、仓库、对象编号/链接、分页覆盖、实际动作、读回结果和失败原因。保留未完成项;不以请求发送成功代替资源状态验收。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Gitea / Forgejo 仓库"
3
+ short_description: "管理 Gitea 与 Forgejo 的仓库对象、完整分页和具名变更验收"
4
+ default_prompt: "请使用 $gitea-repo:列出这台 Forgejo 的 owner/repo 所有关闭 issue,不做修改。"
@@ -0,0 +1,58 @@
1
+ # Gitea 认证与 Scope
2
+
3
+ 权威说明:[API Usage](https://docs.gitea.com/development/api-usage)、[OAuth2 / PAT scopes](https://docs.gitea.com/development/oauth2-provider/)。以当前实例 Swagger 为准(`$HOST/api/swagger`)。
4
+
5
+ ## 认证方式
6
+
7
+ | 方式 | 用法 | 本技能 |
8
+ |------|------|--------|
9
+ | AuthorizationHeaderToken | `Authorization: token <PAT>` | **默认,必须用这个** |
10
+ | Bearer(OAuth2 access token) | `Authorization: bearer <JWT>` | 仅当凭据是 JWT 时 |
11
+ | HTTP Basic | `username:password` 或 `username:PAT` | 只用于 `/users/:name/tokens` 管理令牌 |
12
+ | `?token=` / `?access_token=` | 查询串 | **禁止**。官方在 1.23 移除 |
13
+ | `X-GITEA-OTP` | 与 Basic + 2FA 一起 | PAT 流程不需要 |
14
+ | `Sudo` 头或 `sudo=` | 管理员冒充其他用户 | 仅管理员,默认不用 |
15
+
16
+ 创建/列出 PAT 本身:`POST/GET /api/v1/users/{username}/tokens`,必须 Basic + 登录密码(不能用 PAT 自己管自己)。`sha1` 明文只在创建响应里出现一次。
17
+
18
+ ## 令牌从哪来
19
+
20
+ 优先级:`--token` → `GITEA_TOKEN` → `git credential fill`(`protocol` + `host`,host 含端口,例如 `gitea.example.com:3000`)。
21
+
22
+ 不要把 PAT 写进仓库、技能或脚本常量,也不要打印。
23
+
24
+ ## Scope
25
+
26
+ 无 scope 的令牌**不能**访问 API(含公开仓)。`write:*` 包含对应 `read:*`。
27
+
28
+ | Scope | 覆盖的路由 | 典型能力 |
29
+ |-------|------------|----------|
30
+ | `issue` | issues / labels / milestones 及相关评论附件 | 列/建/改 issue、评论、标签、里程碑 |
31
+ | `repository` | `/repos/*` **不含** `/repos/.../issues/*` | PR、文件、分支、Release、协作者 |
32
+ | `user` | `/user/*`、`/users/*` | `GET /user`、关注、星标 |
33
+ | `organization` | orgs / teams | 组织与团队 |
34
+ | `notification` | `/notifications` | 通知 |
35
+ | `package` | `/packages/*` | 包 |
36
+ | `admin` | `/admin/*` | 站点管理(非管理员账号看不到) |
37
+ | `activitypub` / `misc` | 很少用 | 日常可忽略 |
38
+ | `all` | 全部读写 | 仅在用户明确要求时创建 |
39
+
40
+ 关键分裂:
41
+
42
+ - 列 issue 要 `read:issue` 或 `write:issue`
43
+ - 建 PR / 合 PR 要 `write:repository`
44
+ - `GET /user` 要 `read:user`。缺它时 **403**,body 类似:`token does not have at least one of required scope(s), required=[read:user]`
45
+ - `whoami` 遇到这次 403 时改为探测 `GET /repos/{owner}/{repo}`,不要判断令牌整体无效
46
+
47
+ ## 状态码
48
+
49
+ | 码 | 含义 | 处理 |
50
+ |----|------|------|
51
+ | 401 | 令牌无效/过期/未带 | 检查凭据,不要当缺 scope |
52
+ | 403 | 已认证但缺 scope 或无权限 | 读 `message`,告知用户补 scope,不要死循环 |
53
+ | 404 | 仓库/编号不存在,或无可见性 | 先确认 owner/repo/index |
54
+ | 409 | PR 冲突等 | 停下来报告 |
55
+ | 412 | 前置条件失败(如已合并 PR 改 state) | 停下来报告 |
56
+ | 422 | 校验失败 | 读 `message` / `errors` |
57
+
58
+ 管理员 sudo:请求头 `Sudo: <username>` 或查询参数 `sudo=`。
@@ -0,0 +1,80 @@
1
+ # Gitea /api/v1 端点图
2
+
3
+ `basePath=/api/v1`。实时契约(优先于本文件):
4
+
5
+ - UI:`$HOST/api/swagger`
6
+ - JSON:`$HOST/swagger.v1.json`
7
+ - 官方分类(可能新于实例):https://docs.gitea.com/api/
8
+
9
+ 脚本没有的能力,用:
10
+
11
+ ```bash
12
+ python3 "$SKILL_DIR/scripts/gitea_api.py" api GET /repos/{owner}/{repo}/issues/1/timeline
13
+ ```
14
+
15
+ 路径占位 `{owner}` `{repo}` 由脚本按当前仓替换。Forgejo 同源 `/api/v1` 同样适用。
16
+
17
+ ## gh → Gitea
18
+
19
+ | gh | Gitea |
20
+ |----|-------|
21
+ | `gh issue list` | `GET /repos/{owner}/{repo}/issues?type=issues` |
22
+ | `gh issue view N` | `GET /repos/{owner}/{repo}/issues/{index}` |
23
+ | `gh issue create` | `POST /repos/{owner}/{repo}/issues` |
24
+ | `gh issue close` | `PATCH /repos/{owner}/{repo}/issues/{index}` `{"state":"closed"}` |
25
+ | `gh issue comment` | `POST /repos/{owner}/{repo}/issues/{index}/comments` |
26
+ | `gh pr list` | `GET /repos/{owner}/{repo}/pulls` |
27
+ | `gh pr view N` | `GET /repos/{owner}/{repo}/pulls/{index}` |
28
+ | `gh pr create` | `POST /repos/{owner}/{repo}/pulls` `{"head","base","title","body"}` |
29
+ | `gh pr merge` | `POST /repos/{owner}/{repo}/pulls/{index}/merge` `{"Do":"merge"}` |
30
+ | `gh pr diff` | `GET /repos/{owner}/{repo}/pulls/{index}.diff` |
31
+ | `gh release list` | `GET /repos/{owner}/{repo}/releases` |
32
+ | `gh api user` | `GET /user` |
33
+ | `gh search issues` | `GET /repos/issues/search` |
34
+ | `gh repo view` | `GET /repos/{owner}/{repo}` |
35
+
36
+ 同仓 issue 与 PR **共用 number/index**。判断 PR:对象带 `pull_request` 字段,或走 `/pulls`。
37
+
38
+ ## 按资源(高频)
39
+
40
+ ### Issue(tag: issue)
41
+
42
+ - `GET/POST /repos/{owner}/{repo}/issues`
43
+ - `GET/PATCH/DELETE /repos/{owner}/{repo}/issues/{index}`
44
+ - `GET/POST /repos/{owner}/{repo}/issues/{index}/comments`
45
+ - `GET /repos/{owner}/{repo}/issues/{index}/timeline`
46
+ - `GET/POST/PUT/DELETE /repos/{owner}/{repo}/issues/{index}/labels`
47
+ - `GET/POST /repos/{owner}/{repo}/labels` 与 `/labels/{id}`
48
+ - `GET/POST /repos/{owner}/{repo}/milestones` 与 `/milestones/{id}`
49
+ - `GET /repos/issues/search` 跨仓搜索;`type=issues|pulls`
50
+
51
+ `POST /issues` 体:`title`(必填)、`body`、`assignees`(用户名数组)、`labels`(**ID 数组**)、`milestone`(ID)、`due_date`、`closed`、`ref`。
52
+
53
+ ### Pull request(tag: repository)
54
+
55
+ - `GET/POST /repos/{owner}/{repo}/pulls`
56
+ - `GET/PATCH /repos/{owner}/{repo}/pulls/{index}`
57
+ - `GET /repos/{owner}/{repo}/pulls/{index}/commits`
58
+ - `GET /repos/{owner}/{repo}/pulls/{index}/files`
59
+ - `GET/POST/DELETE /repos/{owner}/{repo}/pulls/{index}/merge`
60
+ - `GET/POST /repos/{owner}/{repo}/pulls/{index}/reviews`
61
+ - `POST /repos/{owner}/{repo}/pulls/{index}/update`(把 base 合进 head)
62
+
63
+ 同仓 PR 的 `head` 用分支名即可;fork 用 `"owner:branch"`。
64
+
65
+ ### 仓库 / 内容 / 发布
66
+
67
+ - `GET /repos/{owner}/{repo}`
68
+ - `GET /repos/search?q=`
69
+ - `GET /repos/{owner}/{repo}/branches`、`/tags`、`/commits`
70
+ - `GET/POST/PUT/DELETE /repos/{owner}/{repo}/contents/{filepath}`
71
+ - `GET/POST /repos/{owner}/{repo}/releases`、`/releases/latest`
72
+
73
+ ### 用户 / 通知 / 杂项
74
+
75
+ - `GET /user`(需 `read:user`)、`GET/POST /user/repos`
76
+ - `GET /version`(缺 `read:misc` 时也可能 403,以实测为准)
77
+ - `GET /notifications`
78
+ - `GET /settings/api` → `max_response_items`(常见 50)、`default_paging_num`
79
+
80
+ 没有仓库 Projects 看板 API(上游仍在讨论)。不要假装能用 API 管 Gitea Project board。
@@ -0,0 +1,34 @@
1
+ # 分页、错误与字段陷阱
2
+
3
+ ## 分页
4
+
5
+ - 查询参数:`page`(从 1 开始)、`limit`
6
+ - 实例限额见 `GET /settings/api`:常见 `max_response_items=50`,`default_paging_num=30`
7
+ - 超过上限会被服务端截断;脚本 `--all` 按页继续直到空页,不能以本页少于请求的 `limit`(默认 50)判断结束;服务端可设置更小上限。重复非空页或意外响应格式时报错,不静默返回“全量”;不再用 200 页上限静默截断
8
+ - 响应头:
9
+ - `x-total-count`:总数
10
+ - `Link`:`rel="next"` / `rel="last"`
11
+ - 列表接口默认 `state=open`。要全部必须显式 `state=all`
12
+
13
+ ## 错误体
14
+
15
+ Gitea 常见 JSON:
16
+
17
+ ```json
18
+ {"message":"...","url":"https://gitea.example.com/api/swagger"}
19
+ ```
20
+
21
+ 把 `message` 原样告诉用户。缺 scope 的 403 会写出 `required=[read:user], token scope=...`,据此判断是令牌权限问题还是仓库权限问题。
22
+
23
+ ## 字段陷阱
24
+
25
+ 1. **合并 PR 用 `Do`**:`POST .../pulls/{index}/merge` 体为 `{"Do":"merge"}`。小写 `do` 会被忽略。可选值:`merge`、`squash`、`rebase`、`rebase-merge`。删除源分支需显式 `delete_branch_after_merge`;API 不会自动套用仓库「合并后删分支」的 UI 默认值。
26
+ 2. **创建 issue 的 labels 是 ID**:`{"labels":[1,2]}`。名字必须先 `GET .../labels` 再替换。`assignees` 才是用户名数组。
27
+ 3. **issue 列表混有 PR**:不带 `type=issues` 时,PR 也会出现在 `/issues` 里,且带 `pull_request` 字段。
28
+ 4. **`/user` 与 `/version` 可能 403**:与 PAT 是否包含 `read:user` / `read:misc` 有关,不代表令牌整体无效。先用 `GET /repos/{owner}/{repo}/issues` 验证。
29
+ 5. **Basic 用户名可任意、PAT 作密码**:git HTTP 如此;API 的 `Authorization: token` 不需要用户名。
30
+ 6. **deadline 只取日期**:issue/PR 的 `due_date` 忽略时刻。
31
+ 7. **已合并 PR 不能再改 state**:返回 412。
32
+ 8. **删除 issue 是永久删除**,不是 close。默认只 PATCH `state=closed`。
33
+ 9. **不要把令牌放进 URL**。日志、代理、浏览器历史都会留下查询串。
34
+ 10. **方案跟随 `GITEA_HOST` / remote**。SSH remote 只提供待确认主机:统一以 HTTPS 作为候选,不复制 SSH 端口、不推断 HTTP。实例使用其他 API 地址时要求明确 --host;自签证书先采用受信 CA 配置,不能自动加 --insecure。