Extract shared knowledge from clarify.md and quick-clarify.md into reusable skill files: - 4d-methodology.md: Core 4-phase clarification process - nd-accommodations.md: Neurodivergent-friendly question patterns - clarification-techniques.md: Anti-patterns and question templates - escalation-patterns.md: Mode switching guidelines Commands slimmed from 149/96 lines to 44/49 lines respectively. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
Setup Workflow
Configuration Hierarchy
| Level | Location | Contents |
|---|---|---|
| System | ~/.config/claude/gitea.env |
API URL, token (shared across projects) |
| Project | .env in project root |
Org, repo name (per project) |
System Configuration
Check Existing
cat ~/.config/claude/gitea.env 2>/dev/null | grep -v "^#" | grep "GITEA_API_TOKEN=" && echo "OK" || echo "MISSING"
Create New
mkdir -p ~/.config/claude
cat > ~/.config/claude/gitea.env << 'EOF'
# Gitea API Configuration
GITEA_API_URL=https://your-gitea-server.com
GITEA_API_TOKEN=PASTE_YOUR_TOKEN_HERE
EOF
chmod 600 ~/.config/claude/gitea.env
Token Generation
- Gitea: Settings > Applications > Generate New Token
- Required scopes:
repo,read:org,read:user
Project Configuration
Auto-Detect from Git Remote
Extract organization:
git remote get-url origin 2>/dev/null | sed 's/.*[:/]\([^/]*\)\/[^/]*$/\1/'
Extract repository:
git remote get-url origin 2>/dev/null | sed 's/.*[:/]\([^/]*\)\.git$/\1/' | sed 's/.*\/\([^/]*\)$/\1/'
Validate via API
source ~/.config/claude/gitea.env
curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GITEA_API_TOKEN" "$GITEA_API_URL/repos/<org>/<repo>"
| Code | Meaning |
|---|---|
| 200 | Repository verified |
| 404 | Not found - check org/repo names |
| 401/403 | Auth issue - check token |
Create/Update .env
# New file
cat > .env << EOF
GITEA_ORG=<org>
GITEA_REPO=<repo>
EOF
# Or append to existing
echo "GITEA_ORG=<org>" >> .env
echo "GITEA_REPO=<repo>" >> .env
PR Review Settings (Optional)
| Variable | Default | Description |
|---|---|---|
PR_REVIEW_CONFIDENCE_THRESHOLD |
0.7 |
Minimum confidence to report |
PR_REVIEW_AUTO_SUBMIT |
false |
Auto-submit reviews to Gitea |
Sync Workflow
When git remote changes:
- Detect new org/repo from git remote
- Compare with .env values
- Validate new values via API
- Update .env with sed:
sed -i 's/^GITEA_ORG=.*/GITEA_ORG=<new_org>/' .env
sed -i 's/^GITEA_REPO=.*/GITEA_REPO=<new_repo>/' .env
Shared with projman
The Gitea MCP server is shared with the projman plugin. If projman is already configured, system-level setup can be skipped.
Check for projman:
find ~/.claude ~/.config/claude -name "projman" -type d 2>/dev/null | head -1