refactor(kyberforge/gitea): deep modules — move how into reference files, SKILL.md becomes orchestrator #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The
kyberforge:giteadispatch skill currently encodes both routing logic (when/why) and execution detail (how — parameter schemas, call flows, error recovery) in a singleSKILL.md. This works for v1 but doesn't scale as the dispatch table grows or new repos/flows are added.Gaps deferred to deep modules refactor
The following issue-create enrichments were identified during live testing but are deferred to this refactor:
Milestone assignment on create — after inferring labels, check
milestone_read method: "list"for open milestones and assign if one clearly fits the issue scope. Requires milestone ID (not title) in theissue_writecall.Assignee on create — derive from
git config user.nameor leave unset. Giteaissue_write method: "create"acceptsassignees: [<login>]but login cannot be discovered withoutread:userscope (get_meis blocked). Workaround: let user configure a default assignee login or leave unset.Dependency linking — Gitea has no native dependency field in the MCP surface. Reference related issues in the body during create (e.g.
Depends on #N) rather than via a separate API call. Document the conventionLabel inference quality — the current fix infers labels from context signals. include a label inference guide: mapping between common context patterns and the
Kind/*/Priority/*/Status/*taxonomy used in this repo.Root cause of the
typefilter bug — MCP schema vs API spec driftThe
Statussection bug (callinglist_issueswith a non-existenttypeparameter) was caused by the skill being authored from Gitea REST API documentation rather than verified against the actual MCP tool schemas.The MCP layer (
gitea-mcp) wraps the REST API but deliberately slims it — parameters are omitted, response shapes are reduced, some API endpoints are combined into a single tool. Thetypefilter exists in the Gitea REST API (GET /repos/{owner}/{repo}/issues?type=issues) but was not exposed in themcp__gitea__list_issuestool schema. The research docs (api-reference.md) were derived from the MCP source (slim.go files) and correctly captured the MCP schema — but the skill body was written with API-level assumptions that didn't match.General pattern: Any skill wrapping MCP tools must be authored against the MCP tool schema, not the underlying API. The MCP schema is the ground truth for what parameters exist, what they're called, and what the response shape looks like.
Question for the refactor: Do the reference files need to include explicit MCP tool call signatures (as verified against the live server), or is the
api-reference.mdresearch file sufficient? The research file is accurate for MCP schemas — the problem was that the skill author didn't consult it closely enough for every parameter. Options:references/<domain>.mdfile includes the verified MCP call signatures, explicitly derived from the tool schema (not API docs)Option 3 is the strongest but highest overhead. Option 2 alone (process fix) is the minimum. This is worth deciding during the refactor.
Design resolved — grill-with-docs session summary
Full redesign scope has been resolved. Recording it here so it's not locked in chat history.
1. Plugin relocation
Skill moves from
plugins/bin/skills/gitea/intoplugins/gitea/(the actual plugin — currently a research-doc-only shell). Oldplugins/bin/skills/gitea/is left untouched for now (kept for reference/fallback, removed later once the new structure is validated) — not deleted in this pass.2. Scope expansion
Adding 3 new domains verified working with the current token (
write:issue,write:repository— seeplugins/bin/skills/gitea/references/token-access.md): Files, Commits, Releases/Tags.Explicitly deferred:
3. Skill decomposition — 6 domain skills + orchestrator + agent
gitea-issuesgitea-labels-milestones(cross-cutting shared skill, composed by bothgitea-issuesandgitea-prs)gitea-prsgitea-branches(branches + commits)gitea-filesgitea-releases(releases + tags)gitea-workflow(human-facing orchestrator, preserves the old/giteadefault status view — composesgitea-issues+gitea-prs— invocation becomes/gitea-workflow)gitea-orchestrate(agent-facing deterministic counterpart, mirrorsplugins/git/agents/git-orchestrate)Each skill follows the git plugin's deep-module pattern:
SKILL.md(orchestrator/when-why) +references/*.md(how) +references/sources.md(provenance) +README.md.4. Comment #849's schema-verification question — resolved as "both"
Reference file call signatures are verified live against the loaded MCP tool schema via ToolSearch at authoring time (not copied from
api-reference.md).kyberforge:skill-author's own authoring process was explicitly not changed in this pass (considered, declined as out of scope) — the verification discipline is applied manually during this implementation only.5. Comment #848's deferred enrichments — all in scope
Landing in
gitea-issues(composinggitea-labels-milestones):get_me/read:useris blocked)"Depends on #N"in body text — no native API for this)Kind/*/Priority/*/Status/*taxonomy mapping)6. Research gap backfill
Existing research docs (
api-reference.mdetc.) are comprehensive but 100% code-derived from gitea-mcp source, with zero external/best-practice content (the original docs.gitea.com fetch timed out and was never retried). Backfilling now via context7 (/websites/gitea,/git_gitea_com/gitea_tea) + the research skill, before skill-authoring begins.7. Deliberately deferred out of this PR
plugins/gitea/.mcp.jsonwith the real gitea-mcp server config (currently manual via the user's~/.claude.json) — tracked as a separate follow-up issue8. ADR
An ADR is being written in
docs/adr/to record this decision formally.