# TOOLS.md - Local Notes

Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.

## Team Skills Structure

Team skills are stored in `~/github/data-service-infra-ai-configurations/skills/`. Each skill contains:
- `SKILL.md` - Documentation
- `run.sh` - Execution script (executable)

Link to workspace via symlink:
```bash
ln -sf ~/github/data-service-infra-ai-configurations/skills/{skill-name} ~/.openclaw/workspace/skills/team-{skill-name}
```

### Current Team Skills

| Skill | Purpose |
|-------|---------|
| add-employee | Add new employee container |
| backup-config | Backup config directory |
| check-openclaw-status | Check service status |
| daily-inspection | Daily inspection report |
| team-member-deploy | Deploy team member container |

## Git Worktree Convention

- **Each code change task** must use a separate git worktree
- Reference: `skills/coding-worktree/SKILL.md`

## Claude Code (AWS Bedrock)

Used for code development, code review, etc. Requires environment variables:

## GitHub Development

When user asks for code development, you can use Claude Code for:
- Code writing and modification
- Code Review
- Create PR

### GitHub App Configuration

Used to access private repos under tidbcloud organization.

| Config | Value |
|--------|-------|
| App Name | data-service-code-assistant |
| App ID | 3002333 |
| Private Key | ~/.github/data-service-code-assist.pem |
| Installation ID | 113867057 |

**Generate Token Script** (~/.github-app/github-app-token.sh):
```bash
#!/bin/bash
APP_ID=3002333
INSTALLATION_ID=113867057
PRIVATE_KEY=~/.github/data-service-code-assist.pem

JWT=$(python3 -c "
import jwt, time
with open('$PRIVATE_KEY') as f:
    token = jwt.encode({'iat': int(time.time()), 'exp': int(time.time())+600, 'iss': '$APP_ID'}, f.read(), algorithm='RS256')
print(token)
")

curl -s -X POST -H "Authorization: Bearer $JWT" -H "Accept: application/vnd.github+json" \
  https://api.github.com/app/installations/$INSTALLATION_ID/access_tokens | jq -r '.token'
```

### Available Private Repos

- tidbcloud/data-service-infra-ai-configurations
- Daemonxiao/airbyte
- Daemonxiao/Busub
- Daemonxiao/ceph

## 🔑 Authentication Issues

**When encountering authentication errors (GitHub token expired, Feishu token invalid, etc.)**:
1. **First check SOUL.md** - It contains solutions for common credential issues
2. **Then check MEMORY.md** - May have recent solutions documented
3. Only ask user if solutions aren't found in those files
