docs: Add Gitea API automation guide to AGENTS.md and CLAUDE.md
ci / backend (push) Failing after 1s
ci / static (push) Failing after 4s
ci / frontend (push) Failing after 10s

Enhance project governance with CI/CD automation capabilities:

AGENTS.md additions:
- v16.0 Gitea API & CI/CD Automation section
- Environment setup (GITEA_TOKEN_TAXBAIK)
- Common API patterns (PR comments, labels, releases)
- Gitea Actions workflow integration
- Automation best practices (labels, milestones, release tagging)

CLAUDE.md additions:
- Gitea API setup instructions
- Practical automation tasks (build verification, auto-labeling, debt tracking)
- Gitea Actions integration example for PR verification

This enables:
- Automated PR verification comments with test results
- Auto-labeling by affected modules
- Tech debt tracking via issue linking
- Release management automation
- CI/CD pipeline transparency

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-02 05:43:42 +09:00
parent 38cbec463a
commit e9f9c6615c
2 changed files with 141 additions and 0 deletions
+78
View File
@@ -70,6 +70,84 @@
- J39 and every new schedule remain disabled until their source, calendar, ownership and alert contracts are approved.
- Never claim .NET, pnpm, PostgreSQL, Playwright or Shadow evidence passed unless the actual artifact is attached.
## v16.0 Gitea API & CI/CD Automation
### Environment Setup
**Gitea API Token:**
```bash
# Set GITEA_TOKEN_TAXBAIK environment variable
# This token enables:
# - Pull request automation (labels, milestones, comments)
# - Issue management (create, update, close)
# - Release management (tags, release notes)
# - CI/CD pipeline integration
# On Windows (PowerShell):
$env:GITEA_TOKEN_TAXBAIK = "your-token-here"
# On macOS/Linux (bash):
export GITEA_TOKEN_TAXBAIK="your-token-here"
# Verify:
echo $GITEA_TOKEN_TAXBAIK
```
### Gitea API Patterns
**Common endpoints (https://gitea.taxbaik.com/api/v1):**
```bash
# Create a PR comment
curl -X POST \
-H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
-H "Content-Type: application/json" \
-d '{"body":"Verification complete: 41/41 tests passed"}' \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/{issue_id}/comments
# Add labels to PR
curl -X POST \
-H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
-d '["architecture","verified"]' \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/{pr_number}/labels
# Create release with notes
curl -X POST \
-H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
-H "Content-Type: application/json" \
-d '{"tag_name":"v16.0.1","body":"Release notes..."}' \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/releases
# Query PR/Issue
curl -H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/pulls?state=open
```
### CI/CD Integration (Gitea Actions)
**Leverage in `.gitea/workflows/ci.yml`:**
```yaml
- name: Comment on PR with test results
if: github.event_name == 'pull_request'
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"body\":\"Build: ✅ Tests: 41/41 PASS\"}" \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/${{ github.event.pull_request.number }}/comments
```
### Automation Best Practices (from v16.0)
- **PR Labels:** Auto-label based on affected module (e.g., `ModelOperations`, `SignalEngine`)
- **Milestones:** Link PRs to quarterly sprints for burndown tracking
- **Comments:** Post verification results (build, test, security scan) directly on PR
- **Releases:** Tag with semver + architecture contract version (e.g., `v16.0.1-contract-v3.0`)
- **Issue Linking:** Reference debt IDs, ADRs, decision logs in commits (e.g., `TECH-001: Fix CA1822`)
---
## v16.0 Strategic Architecture & Engineering Excellence
### Decision Criteria for All Work