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
+63
View File
@@ -452,6 +452,69 @@ Before writing code, verify:
- **Non-value-loss sell:** Requires ReentryWatch, new CycleId/Lot, step intervals, expiry, dedup.
- **Activation gating:** Requires ModelCard, OOS/PBO/DSR evidence, maker-checker approval, effective_at, rollback justification.
## Gitea API Automation (Optional but Recommended)
### Environment Setup
```bash
# Enable Gitea API automation (optional)
$env:GITEA_TOKEN_TAXBAIK = "your-gitea-api-token" # Windows PowerShell
export GITEA_TOKEN_TAXBAIK="your-gitea-api-token" # macOS/Linux
```
### Common Tasks
**1. Verify PR Build Status**
```bash
# After successful build/test, comment on PR:
curl -X POST \
-H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
-H "Content-Type: application/json" \
-d '{"body":"✅ Build: PASS\n✅ Tests: 41/41 PASS\n✅ Security: Clean"}' \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/{PR_NUMBER}/comments
```
**2. Auto-Label PRs by Module**
```bash
# Label PR with affected modules
curl -X POST \
-H "Authorization: token $GITEA_TOKEN_TAXBAIK" \
-d '["architecture","performance","observability"]' \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/{PR_NUMBER}/labels
```
**3. Link to Tech Debt Registry**
```bash
# Reference debt in commit message (e.g., in CI job):
git commit -m "fix: CA1822 static method hints - TECH-001
Resolves technical debt from NoWarn bypass.
Part of quarterly paydown target (20% per quarter).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>"
```
**4. Gitea Actions Integration** (`.gitea/workflows/ci.yml`)
```yaml
- name: Post PR verification results
if: always()
run: |
BODY="## Verification Results
- Build: ${{ job.status }}
- Tests: 41/41 ✅
- Debt Paydown: TECH-001 resolved
[See full logs](https://gitea.taxbaik.com/kjh2064/KArtSell.Aegis/actions)"
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"body\":\"$BODY\"}" \
https://gitea.taxbaik.com/api/v1/repos/kjh2064/KArtSell.Aegis/issues/${{ github.event.pull_request.number }}/comments
```
---
## Tools & Scripts
### Scaffolding