refactor(gitea): deep modules — split flat dispatch skill into 6 domain skills + orchestrator + agent #67

Merged
Claude merged 29 commits from refactor/6-gitea-deep-modules into main 2026-07-05 19:53:26 +00:00

29 Commits

Author SHA1 Message Date
4bdd9e4e04 docs(agents): capture worktree-isolation and forge-routing lessons
Fix agents in this session's gitea docs-audit all had their isolated
worktree fork from main instead of the current branch, and routing
already-specified fixes through forge added a delegation layer that
occasionally dropped hard constraints handed to sub-subagents.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwtxcDXuLZxYzWnT2FaoZU
2026-07-05 19:23:57 +00:00
18ec0ab0ff fix(gitea): correct token-scope claim in gitea-branches docs
SKILL.md, README.md, and references/{branches,commits}.md claimed
list_branches, list_commits, and get_commit "work with write:issue
alone." This contradicted docs/research/docs/gitea/overview.md, which
documents write:repository as gating both reads and writes for
repo-scoped tool families (Gitea hides these reads behind write
scope). The prior empirical justification was invalid: it tested under
a token holding both write:issue and write:repository simultaneously,
which doesn't isolate which scope actually enabled the reads.

Corrected all four files to state that list_branches, create_branch,
and delete_branch require write:repository, confirmed directly by
overview.md's scope enumeration. list_commits/get_commit are flagged
as inferred to need the same scope by analogy rather than an
overview.md-confirmed fact, since overview.md's write:repository
enumeration names PR/branch/file/release/tag but not commits — this
distinction surfaced during an independent audit pass and is now
called out explicitly so the claim isn't overstated.

Bumped SKILL.md metadata.version 0.1.0 -> 0.1.1 (patch: doc
correction, no behavior change).
2026-07-05 19:14:57 +00:00
3a4ae44500 fix(gitea): correct create-vs-update param scoping in gitea-prs docs
references/pull-requests.md wrongly scoped pull_request_write's
milestone param to "update" only, and reviewers/team_reviewers to
add_reviewers/remove_reviewers only. The canonical create example in
docs/research/docs/gitea/examples.md sets milestone and reviewers
directly on "create", and api-reference.md lists these params
generically without method scoping. Corrects both to reflect that
they're settable on create, with add_reviewers/remove_reviewers
reserved for adjusting an already-open PR.

Bumps gitea-prs skill version 0.1.0 -> 0.1.1 for the docs fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwtxcDXuLZxYzWnT2FaoZU
2026-07-05 19:14:57 +00:00
7b85e33d9c fix(gitea): register gitea-orchestrate agent in plugin manifest
plugins/gitea/agents/gitea-orchestrate.md and .agent.md were fully
written but the plugin manifest never declared an "agents" key, so
the plugin loader had no path to discover/register the agent (unlike
plugins/git and plugins/kyberforge, which both declare "agents":
"agents/"). Bump the patch version in both manifests per plugin-author's
UPDATE flow convention, since consumers cache plugin metadata by version.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwtxcDXuLZxYzWnT2FaoZU
2026-07-05 19:14:57 +00:00
d09375556a fix(gitea): add missing gotchas to gitea-files docs
A documentation-accuracy audit against research docs found three gotchas
in troubleshooting.md that were dropped from gitea-files/SKILL.md during
original authoring: signed-commit branch protection silently blocking
file writes (a distinct failure mode from stale-SHA that an agent could
otherwise misdiagnose and retry indefinitely), reverse-proxy 413s on
large base64-encoded write payloads, and 404-vs-403 scope masking on the
read tools. Also adds the context7-gitea-tea-cli provenance entry to
references/sources.md (Contributing files: none) to resolve a
pre-existing skill-audit provenance FAIL surfaced while validating this
change, matching the pattern already used by sibling skills.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwtxcDXuLZxYzWnT2FaoZU
2026-07-05 19:14:57 +00:00
1cd496e208 fix(gitea): correct label-scope and closing-keyword claims in issues/labels skills
A documentation-accuracy audit against plugins/gitea/docs/research/docs/gitea/*.md
found three overclaims/unsupported claims in skill content:

- gitea-labels-milestones: reworded the exclusive-flag gotcha and
  label-inference.md's "scoped labels" section — exclusive is documented as
  org-labels-only (api-reference.md, data-model.md) and unsupported by the
  live create_repo_label/edit_repo_label schema, so repo-level exclusivity
  for Kind/*/Priority/*/Status/* is a client-side convention this skill
  enforces via replace_labels, not a server guarantee.
- gitea-labels-milestones: added a "Step 1 — Resolve owner and repo" section
  (git remote get-url origin) and Bash to allowed-tools, since
  milestone_read/milestone_write and repo-scoped label_read/label_write
  hard-require owner+repo and the skill is documented as directly invokable,
  matching the pattern already in gitea-issues/SKILL.md.
- gitea-issues: softened the claim that Gitea parses Fixes #N/Closes #N in
  commit messages to auto-close issues — no research doc supports this, and
  examples.md states issues are not auto-closed on PR merge. Now notes the
  behavior is plausible but unconfirmed, keeping the issue_read re-check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwtxcDXuLZxYzWnT2FaoZU
2026-07-05 19:14:57 +00:00
940e414980 fix(gitea): correct is_draft param and soften unverified claims in gitea-releases docs
An audit against plugins/gitea/docs/research/docs/gitea/*.md found the
gitea-releases skill told callers to set create_release's draft flag
as `draft` instead of `is_draft` (the actual input param; `draft` is
only the response field name) - a call following that gotcha would
have the flag silently ignored, publishing a non-draft release.

Also corrected an overclaimed "verified against live MCP schema"
provenance note in call-signatures.md/README.md (its sources are
gitea-mcp source-code extraction, not a live tool call - now noted
alongside a narrow live ToolSearch cross-check performed this session
for 3 of the 9 tools' input params), and softened three behavioral
claims (create_release auto-creating tags, get_latest_release
excluding drafts/prereleases, delete_tag preserving a wrapping
release) that don't trace to any research doc, with a recommendation
to verify release/tag state after delete operations rather than
assume it.
2026-07-05 19:12:10 +00:00
fddf39e396 fix(tests): exclude .claude/worktrees/ from test-file discovery
find-based discovery in run-bats.sh and run-tests.sh picked up test
files nested inside on-disk git worktree checkouts under
.claude/worktrees/ (untracked, created by background agent isolation),
whose submodule-based test_helper isn't initialized there — causing
spurious pre-push failures unrelated to any real change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 13:57:46 +00:00
ad5d61430c feat(gitea): add gitea-orchestrate agent-facing dispatcher
Adds the deterministic, agent-facing counterpart to gitea-workflow per
docs/adr/0011-gitea-skill-deep-modules.md, mirroring git-orchestrate's
shape: structured request/response JSON, safety gates on destructive
ops (delete-branch/release/tag/label/milestone/file, merge-pr), and
routing across the six gitea domain skills without conversational
disambiguation. Authored via kyberforge:agent-author directly (not
forge) since the artifact type was already known, and validated clean
via kyberforge:agent-audit (structure, provenance, and qualitative
checks all pass). Bumps plugin version 1.2.0 -> 1.3.0 in both manifests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
2026-07-05 13:57:46 +00:00
8999db18e7 feat(gitea): add gitea-workflow human-facing router skill 2026-07-05 13:57:46 +00:00
481fedcbca feat(gitea): add gitea-workflow skill (human-facing dispatcher)
Adds the human-facing entry point and dispatcher for the Gitea
integration per docs/adr/0011-gitea-skill-deep-modules.md. Preserves
the retired flat skill's default no-args status view (open issues +
open PRs, composed via list_issues/list_pull_requests) and extends
its dispatch table to route ambiguous requests across all 6 domain
skills (issues, labels/milestones, prs, branches, files, releases) —
the old table only covered 4 of these. The skill only calls
gitea-mcp tools directly for the composed status view; every other
operation is a routed handoff to the owning sibling skill, keeping
execution logic (call signatures, gotchas, confirmation gates) owned
in one place.

Bumps plugins/gitea version 1.1.0 -> 1.2.0 in both manifests for the
new skill. Passed structural validation, provenance validation, and
an independent clean-context skill-audit recheck (one finding fixed:
allowed-tools was missing the Skill tool needed for routing).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
2026-07-05 13:57:12 +00:00
77c722ea5c feat(gitea): add gitea-workflow human-facing router skill
Adds the human-facing entry point and router for the Gitea integration,
replacing the old flat /gitea skill per ADR 0011. It 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, mirroring git-workflow's router shape.

Preserves the old flat skill's default no-args status view (open
issues + open PRs, two sections) and adds deterministic ambiguous
issue-vs-PR number resolution via issue_read's is_pull field, since
issues and PRs share one number space in Gitea.

Authored via kyberforge:forge -> skill-author, with an independent
clean-context skill-audit re-run confirming no findings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
2026-07-05 13:57:12 +00:00
8a154dacbe fix(gitea-prs): document inline-comment field-name asymmetry
An independent clean-context audit of the newly-authored gitea-prs skill
flagged that old_line_num/new_line_num (write path, pull_request_review_write
create) and position/old_position (read path, get_review_comments) name the
same concept differently — the same class of write/read field mismatch that
produced the review_scomments typo elsewhere in this domain. Adds one
clarifying sentence to references/reviews.md so an agent skimming only one
side doesn't assume symmetric field names.
2026-07-05 13:57:12 +00:00
7941c57559 feat(gitea): add gitea-issues skill 2026-07-05 13:57:12 +00:00
1a267d7964 feat(gitea): add gitea-prs skill
Covers list_pull_requests, pull_request_read, pull_request_write, and
pull_request_review_write, split out of the flat plugins/bin/skills/gitea
PR-dispatch logic per ADR 0011. Composes gitea-labels-milestones for
label/milestone ID resolution instead of duplicating that lookup.

Tool signatures were cross-checked live via ToolSearch against the deployed
gitea-mcp server rather than copied from api-reference.md, per the ADR's
schema-drift mitigation process.
2026-07-05 13:57:12 +00:00
e361498311 feat(gitea): add gitea-issues skill
Covers list_issues, issue_read, issue_write, and search_issues, closing out
all four enrichments deferred from issue #6 comment #848: label inference
(delegated to gitea-labels-milestones), milestone assignment on create,
an assignee workaround for the blocked get_me/read:user scope, and the
"Depends on #N" dependency-linking convention validated by Gitea's
automatic cross-reference rendering.

Call signatures were re-verified live via ToolSearch against the deployed
gitea-mcp server rather than copied from api-reference.md, per ADR 0011 --
this caught that list_issues has no `type` or `milestones` parameter on the
live schema, despite the research doc documenting both (the exact drift
that caused issue #6 comment #849).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
2026-07-05 13:57:12 +00:00
198fa9a0f6 docs(gitea): recover signed-commit/reverse-proxy gotchas from orphaned commit
Commit 7ad9fb6 (an orphaned parallel gitea-files authoring run, superseded
by 0c7dd04 during a worktree merge race) backfilled two real gotchas into
troubleshooting.md that the winning version didn't carry: protected-branch
signed-commit rejection and reverse-proxy 413 on large file writes, both
sourced from context7:/websites/gitea. Recovering them since they're
genuine findings, not duplicated elsewhere.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 13:57:12 +00:00
547a653fa0 fix(gitea): fill provenance gap in gitea-branches sources.md
The gitea-branches skill was authored before the context7 research
backfill (workflow-conventions.md) landed on this branch, so its
sources.md was missing context7-websites-gitea and
context7-gitea-tea-cli — both present with status `extracted` in the
upstream research doc, which validate-provenance.sh requires every
consuming skill to account for. Adds context7-websites-gitea (credited
for the protected-branch gotcha) and context7-gitea-tea-cli (marked
`(none)` — its release/tag content is out of scope for branches/commits).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 13:57:12 +00:00
bc784d697b feat(gitea): add gitea-releases skill 2026-07-05 13:57:12 +00:00
05e063bdfc feat(gitea): add gitea-files skill 2026-07-05 13:57:12 +00:00
fdeaf741a8 feat(gitea): add gitea-releases skill
Covers releases and tags (list/get/create/delete) — all verified
working with the current write:issue/write:repository token scope.
2026-07-05 13:57:12 +00:00
b2240864b2 feat(gitea): add gitea-labels-milestones skill 2026-07-05 13:57:12 +00:00
3894c33799 feat(gitea): add gitea-files skill
Covers get_file_contents, get_dir_contents, get_repository_tree,
create_or_update_file, delete_file — all verified working with the
current write:issue/write:repository token scope.
2026-07-05 13:57:12 +00:00
35e9a22ae6 feat(gitea): add gitea-branches skill (branches + commits) 2026-07-05 13:57:12 +00:00
40f4d32175 feat(gitea): add gitea-labels-milestones skill
Cross-cutting skill for label and milestone operations, composed by
gitea-issues and gitea-prs. Includes the label inference guide deferred
from issue #6 comment #848.
2026-07-05 13:57:12 +00:00
47a26b5ee2 docs(gitea): backfill external workflow-convention research via context7
Merge research backfill for issue #6: adds external/best-practice
content (label taxonomy, PR review conventions, milestone semantics,
issue/PR cross-linking, release semver conventions) sourced from
context7, closing the gap left by the original docs.gitea.com timeout.
2026-07-05 13:57:12 +00:00
29af47db20 feat(gitea): add gitea-branches skill (branches + commits)
Adds plugins/gitea/skills/gitea-branches/ per ADR 0011, covering
list_branches/create_branch/delete_branch (migrated from the flat
plugins/bin/skills/gitea/ dispatch) plus list_commits/get_commit (new
read-only commit-history domain). Call signatures were re-verified live
via ToolSearch against the deployed gitea-mcp server rather than copied
from api-reference.md, per issue #6 comment #849's root-cause fix.

Bumps the gitea plugin to 1.1.0 in both manifests for the new skill.
2026-07-05 13:57:12 +00:00
b85cba2abe docs(adr): record gitea plugin deep-module redesign decision
Captures the grill-with-docs session for issue #6: relocate gitea
skill from plugins/bin/ to plugins/gitea/, split into 6 domain skills
plus a workflow orchestrator and orchestrate agent, expand scope to
3 token-verified new domains, and resolve the schema-verification
question from comment #849.
2026-07-05 13:57:12 +00:00
99403f3596 docs(gitea): backfill external workflow-convention research via context7
Existing gitea research docs were 100% code-derived from gitea-mcp
source with zero external content (the original docs.gitea.com fetch
timed out and was never retried). Adds workflow-conventions.md sourced
from context7 /websites/gitea and /git_gitea_com/gitea_tea: scoped/
exclusive label conventions, PR review/branch-protection rules,
release/tag semver conventions, and automatic issue/PR cross-reference
linking (validates the dependency-linking convention for issue #6).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 13:56:46 +00:00