diff --git a/plugins/gitea/skills/gitea-workflow/README.md b/plugins/gitea/skills/gitea-workflow/README.md index 6d1ba9c..4c81d20 100644 --- a/plugins/gitea/skills/gitea-workflow/README.md +++ b/plugins/gitea/skills/gitea-workflow/README.md @@ -1,10 +1,10 @@ # gitea-workflow -Human-facing entry point and dispatcher for the Gitea integration — the default status view plus routing to whichever domain skill owns an ambiguous request. +Human-facing entry point and router for the Gitea integration. ## What it does -This skill is the thin front door for the Gitea integration suite. With no arguments it reproduces the old flat skill's default status view: open issues and open PRs, composed by calling `gitea-issues`' and `gitea-prs`' underlying `list_issues`/`list_pull_requests` tools directly. For any other request, it resolves `owner`/`repo` once from the git remote and routes to whichever of the 6 domain skills owns the request — `gitea-issues`, `gitea-labels-milestones`, `gitea-prs`, `gitea-branches`, `gitea-files`, `gitea-releases` — rather than executing domain operations itself. It does not duplicate any domain skill's call signatures, dispatch verbs, or error recovery; those stay owned by the domain skill. +This skill is the conversational front door to the Gitea suite — it replaces the old flat `/gitea` skill. On its own it never calls a Gitea MCP tool; it composes the six domain skills (`gitea-issues`, `gitea-labels-milestones`, `gitea-prs`, `gitea-branches`, `gitea-files`, `gitea-releases`). It handles the no-args status check-in (open issues + open PRs), resolves ambiguous issue-or-PR numbers before dispatching (issues and PRs share one number space), and points a user or agent to the right domain skill when it's unclear which one applies. ## Usage @@ -12,17 +12,11 @@ This skill is the thin front door for the Gitea integration suite. With no argum /gitea-workflow ``` -With no arguments: shows open issues + open PRs. With a request that doesn't already name a domain explicitly, describe what you want — the skill resolves owner/repo and routes to the right domain skill. If you already know which domain applies (issues, labels/milestones, PRs, branches, files, releases), you can invoke that skill directly instead — this one exists for the ambiguous/default case. +Invoke with no arguments for a status check-in, with a bare number to resolve and show issue or PR detail, or with a general request to be routed to the right domain skill. ## Files | File | Purpose | |------|---------| -| `SKILL.md` | Skill instructions for agents — routing table, default status view, Gotchas | -| `references/README.md` | Describes the references directory contents | -| `references/sources.md` | Provenance for the routing table and status-view call signatures | - -## Related - -- `plugins/bin/skills/gitea/SKILL.md` — the retired flat skill this one replaces (kept as a fallback reference per `docs/adr/0011-gitea-skill-deep-modules.md`, not deleted). -- `plugins/gitea/skills/gitea-issues/`, `gitea-labels-milestones/`, `gitea-prs/`, `gitea-branches/`, `gitea-files/`, `gitea-releases/` — the 6 domain skills this one routes to. +| `SKILL.md` | Skill instructions for agents — Gotchas, status view, ambiguous-number resolution, and the domain-skill index | +| `references/sources.md` | Research sources backing the routing/status guidance | diff --git a/plugins/gitea/skills/gitea-workflow/SKILL.md b/plugins/gitea/skills/gitea-workflow/SKILL.md index 64c8835..92b7a6e 100644 --- a/plugins/gitea/skills/gitea-workflow/SKILL.md +++ b/plugins/gitea/skills/gitea-workflow/SKILL.md @@ -2,20 +2,21 @@ name: gitea-workflow description: > - Use when a user makes a Gitea request that doesn't already name a specific domain, or asks for a - general status check — "what's open", "what needs my attention", "gitea status", or bare - `/gitea-workflow` with no arguments. Resolves the repo's owner/repo once from the git remote, then - either runs the composed default status view (open issues + open PRs) or routes the request to - whichever of the 6 domain skills owns it: gitea-issues, gitea-labels-milestones, gitea-prs, - gitea-branches, gitea-files, gitea-releases. This skill does not execute domain operations itself - — it composes/routes to the owning skill by name. Do not use when the request already clearly - names one domain (e.g. "create an issue", "merge PR #12", "cut a release") — invoke that domain - skill directly instead; this skill exists for the ambiguous/default case, not as a mandatory front - door. + Use when a human wants a general or ambiguous Gitea status check or isn't sure which Gitea + domain skill applies — a no-args check-in ("what's going on in the repo", "any updates?"), + a bare-numbered reference that could be an issue or a PR ("what's the status of #42", "what's + happening with #17"), or a request to discover which Gitea capability handles a task. This is + the human-facing entry point and router for the Gitea integration — it replaces the old flat + `/gitea` invocation (now `/gitea-workflow`) and composes the six domain skills + (`gitea-issues`, `gitea-labels-milestones`, `gitea-prs`, `gitea-branches`, `gitea-files`, + `gitea-releases`) rather than calling any Gitea MCP tool directly. Do not use this skill when + the domain is already known and unambiguous — invoke the matching domain skill directly instead + (e.g. "create an issue" → `gitea-issues`, "merge PR #10" → `gitea-prs`, "cut a release" → + `gitea-releases`). Do not use for local git operations with no Gitea component (use + `git-workflow`). -compatibility: Requires Gitea MCP server configured with write:issue and write:repository token - scopes (for the composed status view's two list calls). Requires git remote "origin" pointing to - the Gitea instance for owner/repo resolution. +compatibility: Requires Gitea MCP server configured with a token; delegates all calls to the six + domain skills, which in turn require write:issue and write:repository scopes at minimum. metadata: category: integration @@ -24,58 +25,50 @@ metadata: - gitea-mcp-repo - gitea-mcp-slim-go - context7-websites-gitea - - context7-gitea-tea-cli - - gitea-flat-skill-dispatch - -allowed-tools: Bash Skill mcp__gitea__list_issues mcp__gitea__list_pull_requests --- ## Gotchas -- **Issues and PRs share one number space — don't re-implement the disambiguation here.** A bare `#N` with no domain word (e.g. "close #12") is ambiguous: it could be an issue or a PR. Default to routing it to `gitea-issues` — its own `` (get) dispatch already calls `issue_read` and checks `is_pull`, redirecting to `gitea-prs` itself if the number turns out to be a PR. This skill does not duplicate that detection. -- **This skill never re-implements a domain skill's confirmation gates or error recovery.** If a routed request needs a destructive-op confirmation (branch deletion, PR merge, release/tag deletion), that confirmation happens inside the routed skill, not here. Routing here is a handoff, not a re-execution of the target's logic. -- **Owner/repo are resolved once, here, and passed through.** Resolve them in Step 1 before dispatching, so the target domain skill doesn't re-resolve them from the git remote a second time. `gitea-files` in particular never resolves owner/repo itself — it always expects a caller to supply them, so this skill must pass them explicitly when routing there. -- **This skill only ever calls two gitea-mcp tools directly** (`list_issues`, `list_pull_requests`), and only for the composed default status view. Every other operation is a routed call to a sibling skill by name — if you find yourself reaching for another `mcp__gitea__*` tool here, that's a sign the request should have been routed instead. +- **This skill never calls a Gitea MCP tool itself.** Every read or write goes through one of the six domain skills. If a request needs a raw `mcp__gitea__*` call that no domain skill exposes, that's a gap in a domain skill, not something to patch here. +- **Issues and PRs share one number space** — a bare number like `#42` could be either. Never guess from context clues alone; resolve it with a real call (see Step 2) before dispatching. +- **A 404 on the resolution call doesn't necessarily mean the number doesn't exist.** Gitea hides permission errors as not-found (documented in `gitea-issues`' Gotchas). If resolution 404s unexpectedly, say so and suggest checking token scope rather than reporting "no such issue or PR." -## Step 1 — Resolve owner and repo +## Step 1 — Default status view (no args) -Before the status view or any routed dispatch, extract `owner` and `repo` from the git remote: +When invoked with no specific request, give a status check-in: -```bash -git remote get-url origin -``` +1. Invoke `gitea-issues` to list open issues (`state: "open"`). +2. Invoke `gitea-prs` to list open PRs (`state: "open"`). +3. Run both in parallel — they're independent reads. +4. Report as two sections, "Open Issues" and "Open Pull Requests", each as a compact list (number, title). This preserves the original flat `/gitea` skill's default behavior. -If origin is not set or the URL is not a Gitea URL, stop and report: "No Gitea remote found — set origin to your Gitea instance URL." +## Step 2 — Resolve an ambiguous number -## Step 2 — Dispatch +When the user references a bare number without saying "issue" or "PR" (e.g. "what's going on with #42"): -| Invocation / trigger phrasing | Route to | +1. Invoke `gitea-issues` to run `issue_read method: "get"` on that number. +2. Check the response's `is_pull` field: + - `true` → it's a PR. Invoke `gitea-prs` for full PR detail (status, diff, reviews as appropriate to the request) and present that instead. + - `false` or absent → it's an issue. Present the issue detail already retrieved. +3. If the resolution call 404s, don't conclude the number doesn't exist — report the 404 and suggest verifying token scope (`write:issue`) per `gitea-issues`' Gotchas, since permission errors are hidden as not-found in Gitea. + +Never dispatch to `gitea-issues` or `gitea-prs` based on guessing from phrasing alone ("that sounds like a bug" is not evidence) — always resolve first. + +## Step 3 — Route explicit but domain-unclear requests + +For requests that name a capability but not obviously which skill owns it, use this index: + +| Skill | Covers | |---|---| -| `/gitea-workflow` (no args), "what's open", "gitea status", "what needs my attention" | **Status (default)** — composed below, no routing | -| "create/get/close/comment on an issue", "what issues are open", "search issues for X" | `gitea-issues` | -| "add/create/edit/delete a label", "list labels", "create/close a milestone", "what labels apply to X" | `gitea-labels-milestones` | -| "open/merge/review a PR", "PR status", "PR diff", "approve/request changes" | `gitea-prs` | -| "list/create/delete a branch", "what commits are on this branch", "show commit ``" | `gitea-branches` | -| "read/create/update/delete a file in the repo", "what's in this directory", "show the repo tree" | `gitea-files` | -| "cut a release", "publish a prerelease", "tag this commit", "what's the latest release" | `gitea-releases` | -| A bare `#N` with no domain word | `gitea-issues` (see Gotchas — it self-corrects to PR if needed) | +| `gitea-issues` | List/read/create/update issues, comments, search across issues and PRs. Composes `gitea-labels-milestones` for label/milestone resolution. | +| `gitea-labels-milestones` | Label and milestone CRUD, label inference from conversation context, resolving names/titles to the numeric IDs writes require. Cross-cutting — used by both `gitea-issues` and `gitea-prs`. | +| `gitea-prs` | List/read/create/update/merge PRs, code reviews. Composes `gitea-labels-milestones` the same way `gitea-issues` does. | +| `gitea-branches` | Branch list/create/delete, plus commit history (list commits, get a single commit by SHA). | +| `gitea-files` | Read/write/delete individual files, list a directory, walk the full repo tree. | +| `gitea-releases` | Release and tag CRUD — draft/prerelease flags, release notes, semver tags. | -Read the target skill's own `SKILL.md` for its full dispatch table and execution detail — this table only routes; it does not restate each domain's verbs. - -## Step 3 — Execute - -### Status (default) - -Call `list_issues state: "open"` and `list_pull_requests state: "open"` in parallel, both scoped to the owner/repo resolved in Step 1. Report as two sections: open issues, open PRs. - -### Routed request - -Invoke the matched domain skill (Skill tool), passing along: -- the resolved `owner`/`repo` from Step 1, so it doesn't need to re-resolve them -- the user's original request/intent, so it doesn't need to re-derive what the user asked for +If a request clearly names one of these (e.g. "create a milestone" → `gitea-labels-milestones`, "read this file from the repo" → `gitea-files`), invoke that skill directly rather than routing through here. Use this table only when the user or an upstream agent is unsure which skill applies. ## Step 4 — Report -For the status view: a compact two-section list — issue/PR number, title, labels, milestone (same fields the old flat skill's status view reported). - -For a routed request: pass through whatever the target skill reports; don't reformat or re-summarize its output beyond what's needed to present it in the conversation. +Present results in plain language. For the status view, two labeled sections. For a resolved ambiguous number, say which domain it turned out to be before showing detail ("That's a pull request:" / "That's an issue:"). For routing, name the skill and hand off — don't duplicate its output format, let it report. diff --git a/plugins/gitea/skills/gitea-workflow/references/README.md b/plugins/gitea/skills/gitea-workflow/references/README.md deleted file mode 100644 index 7988edf..0000000 --- a/plugins/gitea/skills/gitea-workflow/references/README.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -source_keys: - - gitea-mcp-repo - - gitea-mcp-slim-go - - context7-websites-gitea - - context7-gitea-tea-cli - - gitea-flat-skill-dispatch ---- - -# References - -This directory contains provenance metadata and research sources for the `gitea-workflow` skill. - -## Files - -- `sources.md` — Extracted research sources and their contributing documents diff --git a/plugins/gitea/skills/gitea-workflow/references/sources.md b/plugins/gitea/skills/gitea-workflow/references/sources.md index 242be48..852e7af 100644 --- a/plugins/gitea/skills/gitea-workflow/references/sources.md +++ b/plugins/gitea/skills/gitea-workflow/references/sources.md @@ -1,16 +1,9 @@ # Sources -**Note on scope:** this skill has no fresh research corpus of its own — it is pure composition/ -routing over the 6 already-researched domain skills and the retired flat skill. The two entries -below that carry `context7`/`gitea.com` URLs back the two gitea-mcp tool calls this skill makes -directly (`list_issues`, `list_pull_requests`, for the composed status view); the routing table -itself is sourced from the domain skills' own descriptions and the flat skill's dispatch table -(the `gitea-flat-skill-dispatch` entry below). - ## gitea-mcp-repo - **URL:** https://gitea.com/gitea/gitea-mcp -- **Description:** Official gitea-mcp repository (v1.3.0); operation/*.go source files documenting all 55 MCP tools, their parameters, and CLI flags. Backs the `list_issues`/`list_pull_requests` call shapes used in the composed status view. +- **Description:** Official gitea-mcp repository (v1.3.0) — `operation/*.go` source files documenting all 55 MCP tools. This skill's status view relies on `list_issues`/`list_pull_requests` semantics (via `gitea-issues`/`gitea-prs`), and its ambiguous-number resolution relies on `issue_read`'s `is_pull` field, both verified against this source at authoring time. - **Research doc:** plugins/gitea/docs/research/docs/gitea/sources.md - **Contributing files:** SKILL.md - **Status:** `extracted` @@ -18,7 +11,7 @@ itself is sourced from the domain skills' own descriptions and the flat skill's ## gitea-mcp-slim-go - **URL:** https://gitea.com/gitea/gitea-mcp/raw/branch/main/operation/issue/slim.go -- **Description:** Slim response shape structs from gitea-mcp source; confirms `list_issues`/`list_pull_requests` return one page per call with no server-side issue/PR type filter, informing why the status view calls both tools separately rather than assuming a combined feed. +- **Description:** Slim response shape structs from gitea-mcp source — confirms `is_pull` is present on a single-item `issue_read` response, the field this skill's resolution step depends on to distinguish an issue from a PR sharing the same number. - **Research doc:** plugins/gitea/docs/research/docs/gitea/sources.md - **Contributing files:** SKILL.md - **Status:** `extracted` @@ -26,7 +19,7 @@ itself is sourced from the domain skills' own descriptions and the flat skill's ## context7-websites-gitea - **URL:** context7:/websites/gitea -- **Description:** Official Gitea docs mirror on Context7 (docs.gitea.com content) — general issue/PR/branch/release vocabulary used to phrase the routing table's trigger examples consistently with Gitea's own terminology. +- **Description:** Official Gitea docs mirror on Context7 — confirms issues and pull requests share a single per-repository number sequence, and that Gitea returns 404 for permission failures rather than a distinct 403, both facts this skill's resolution and error-handling steps depend on. - **Research doc:** plugins/gitea/docs/research/docs/gitea/sources.md - **Contributing files:** SKILL.md - **Status:** `extracted` @@ -34,15 +27,7 @@ itself is sourced from the domain skills' own descriptions and the flat skill's ## context7-gitea-tea-cli - **URL:** context7:/git_gitea_com/gitea_tea -- **Description:** Official `tea` CLI (reference Gitea client) docs on Context7 — practitioner command patterns for issues, PRs, and releases. Consulted for completeness against the shared research doc; this skill is pure routing/composition with no CLI-command-pattern content of its own, so it contributes nothing here (see `gitea-issues`/`gitea-releases` for where this source actually informs content). +- **Description:** Official `tea` CLI docs on Context7 — practitioner conventions for issues, PRs, and releases. Consulted as part of the shared research pass but its content is domain-specific (PR/release workflow patterns), out of scope for pure status/routing behavior — no content from it was used in this skill. - **Research doc:** plugins/gitea/docs/research/docs/gitea/sources.md - **Contributing files:** (none) - **Status:** `extracted` - -## gitea-flat-skill-dispatch - -- **Description:** This org's retired flat Gitea skill (`plugins/bin/skills/gitea/SKILL.md`) — its "Step 2 — Dispatch" table (5 domains: issues, labels, milestones, PRs, branches) and "Status (default)" behavior are the direct lineage this skill's routing table and default status view generalize across all 6 current domain skills, adding `gitea-files` and `gitea-releases` as new routing targets per `docs/adr/0011-gitea-skill-deep-modules.md`. -- **Source:** org-internal (`plugins/bin/skills/gitea/SKILL.md`, kept in place as a fallback reference, not deleted) -- **Research doc:** none — org-internal skill lineage, not part of the plugin's external research corpus (same pattern as `git-workflow`'s `org-git-conventions` entry) -- **Contributing files:** SKILL.md -- **Status:** `extracted`