Add reusable AI-agent workflow + docs + AGENTS template

Reusable workflow (on: workflow_call) moved from homelab; consuming repos add a thin caller
(uses: ffaerber/agents/.gitea/workflows/agent.yml@main, secrets: inherit).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Felix Faerber
2026-07-02 07:20:54 +03:00
co-authored by Claude Opus 4.8
parent a14d33bb8d
commit f6df3f24af
3 changed files with 529 additions and 0 deletions
+46
View File
@@ -1,2 +1,48 @@
# agents
Shared **AI dev-team** workflow for Gitea Actions, reusable across repos. It gives any repo the
`@pm` / `@junior` / `@senior` / `@lead` / `@qa` agents driven from issues and comments.
## Use it in a repo
Add `.gitea/workflows/ai-agent.yml` to the consuming repo:
```yaml
name: ai-agent
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
agent:
uses: ffaerber/agents/.gitea/workflows/agent.yml@main
secrets: inherit
```
That's the whole per-repo footprint. All the logic (agent registry, routing, delegation,
reactions, PR/issue plumbing) lives here in `agent.yml`.
## Required secrets (per repo, or org-level for all)
| Secret | For |
|--------|-----|
| `ANTHROPIC_API_KEY` | `@lead`/`@qa` (and `@pm`/`@senior` if on Claude) |
| `OLLAMA_URL`, `OLLAMA_CLOUD_API_KEY` | local ornith / GLM cloud |
| `AGENT_TOKEN` | PAT (issue+repo write) used to post the delegation comment that fires the next agent |
| `TOKEN_PM`,`TOKEN_SENIOR`,`TOKEN_JUNIOR`,`TOKEN_LEAD`,`TOKEN_QA` | optional — post/commit as each agent's own Gitea user (falls back to the bot) |
`GITEA_TOKEN` is auto-provided. Tip: set these once at the **org** level so every repo inherits
them via `secrets: inherit`.
## Also add to each consuming repo
- **`AGENTS.md`** — the repo's own conventions (copy `AGENTS.template.md` from here and adapt). The
agent reads the *caller* repo's `AGENTS.md`, so each repo can differ.
- The bot users (`pm`,`senior`,…) as **collaborators** (needed on private repos, and enables
`@name` autocomplete).
## Maintaining
Change agent behavior once, here. Callers pin `@main` (or pin a tag for stability). History is the
changelog — see `git log`.