feat: local issue cache and draft-then-push workflow

Replace fetch_issue.py with four scripts around a flat, greppable cache in
tmp/issues/. Planning stays offline and issues reach Gitea in one push:

- issue_get.py: fetch by key or by filter (--milestone/--label/-q). The list
  endpoint carries issue bodies, so a whole milestone costs one request per 50
  issues. Gitea silently ignores an unresolvable milestones= filter and returns
  the entire backlog, so the milestone is resolved up front and every returned
  issue is re-checked locally. --deps walks the dependency graph downwards via
  the structured sections plus native dependencies and writes tree-<slug>.md.
- issue_push.py: validate a local draft against the canonical format, create
  missing labels with the right colors and exclusivity, POST, delete the draft.
- issue_list.py: discovery to stdout, writes nothing.
- issue_index.py: rebuild INDEX.md from what is on disk.

Files use one metadata field per line with inline lists so plain grep works
without a parser. This is a cache and a drafting area, not a mirror: no drift
tracking, no sync back.

Projects are not fetchable — the projects API is 404 on Gitea 1.26; documented
alongside the milestone caveat.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
naudachu
2026-08-07 19:35:38 +05:00
parent 3549f37ebf
commit 335b0bbd54
12 changed files with 1190 additions and 249 deletions
+17 -1
View File
@@ -8,7 +8,8 @@ A Claude Code plugin that gives Claude a reference for the `tea` CLI and enforce
|---|---|
| `/tea:auth` skill | Prompts you to pick a Gitea login and pins it to the project |
| `/tea:use` skill | Tea CLI reference — loads command docs on demand |
| `/tea:issue` skill | Creates issues in a canonical format (typed labels, fixed sections) |
| `/tea:issue` skill | Drafts issues locally in a canonical format (typed labels, fixed sections), then pushes them |
| Issue scripts | Fetch issues into a flat, greppable local cache (`tmp/issues/`), walk dependency trees, push drafts |
| `tea-guard` hook | PreToolUse hook that blocks or rewrites every `tea` invocation |
## Prerequisites
@@ -81,5 +82,20 @@ skills/
use/SKILL.md /tea:use skill
use/references/tea/ tea CLI reference docs
use/references/issue-format.md canonical issue format (types, templates)
use/scripts/ issue scripts (Python 3, no deps):
issue_get.py fetch issues into tmp/issues/, --deps walks the graph
issue_push.py validate a local draft, create labels, POST, drop the draft
issue_list.py discovery listing to stdout
issue_index.py rebuild tmp/issues/INDEX.md (no network)
_tea.py shared login / api / on-disk-format helpers
issue/SKILL.md /tea:issue skill
```
## Local issue cache
The scripts keep issues in `tmp/issues/` (gitignore it) as flat markdown with
one metadata field per line — so `grep -l 'labels:.*type/bug' tmp/issues/*.md`
works without a parser. It is a **cache and a drafting area, not a mirror**:
nothing tracks drift and nothing syncs back. Drafts written during planning
live in `tmp/issues/drafts/` and are deleted once `issue_push.py` creates them
in Gitea.