# team-admin Initialization

**Hello! Please complete the following initialization steps for team-admin:**

---

## 1. Environment Variables

**Note**: Environment variables are automatically synced from the host to your container by the `container-env-check` script. However, you can verify they are set:

```bash
# Check if environment variables are available
echo "MINIMAX_API_KEY: $MINIMAX_API_KEY"
echo "GITHUB_APP_ID: $GITHUB_APP_ID"
```

If they are empty, you can either:
- Wait for `container-env-check` to sync them (runs periodically)
- Or ask the administrator to run `container-env-check` manually

---

## 2. Install gh CLI (if not installed)

**IMPORTANT**: Do this FIRST, before cloning the repository!

```bash
type gh || (curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && sudo apt update && sudo apt install gh)
```

---

## 3. Clone ai-configuration Repository

**IMPORTANT**: Do this step FIRST, before creating symlinks!

```bash
mkdir -p ~/github
cd ~/github
git clone https://github.com/tidbcloud/data-service-infra-ai-configurations.git
cd data-service-infra-ai-configurations
```

Verify the clone was successful:
```bash
ls -la ~/github/data-service-infra-ai-configurations/memories/team-admin/
```

You should see files like: AGENTS.md, SOUL.md, USER.md, IDENTITY.md, HEARTBEAT.md, configuration.md

---

## 4. Configure GitHub App Authentication

```bash
# Generate GitHub App token
~/.github-app/github-app-token.sh
# Verify
gh auth status
```

---

## 5. Link Workspace Files

First, remove existing files in `~/.openclaw/workspace/` that will be replaced:

```bash
rm -f ~/.openclaw/workspace/AGENTS.md
rm -f ~/.openclaw/workspace/SOUL.md
rm -f ~/.openclaw/workspace/USER.md
rm -f ~/.openclaw/workspace/IDENTITY.md
rm -f ~/.openclaw/workspace/HEARTBEAT.md
rm -f ~/.openclaw/workspace/configuration.md
```

Then create symlinks (make sure you cloned the repo in step 3 first!):

```bash
cd ~/github/data-service-infra-ai-configurations

# Link bootstrap files
ln -sf memories/team-admin/AGENTS.md ~/.openclaw/workspace/AGENTS.md
ln -sf memories/team-admin/SOUL.md ~/.openclaw/workspace/SOUL.md
ln -sf memories/team-admin/USER.md ~/.openclaw/workspace/USER.md
ln -sf memories/team-admin/IDENTITY.md ~/.openclaw/workspace/IDENTITY.md
ln -sf memories/team-admin/HEARTBEAT.md ~/.openclaw/workspace/HEARTBEAT.md

# Link configuration file
ln -sf ../data-service-infra-ai-configurations/memories/team-admin/configuration.md ~/.openclaw/workspace/configuration.md
```

---

## 6. Load Skills

Link the following skill directories to `~/.openclaw/workspace/skills/`:

```bash
cd ~/.openclaw/workspace/skills

# team-admin specific skills
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-admin/team-employee ./team-employee
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-admin/daily-inspection ./daily-inspection
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-admin/backup-config ./backup-config
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-admin/check-openclaw-status ./check-openclaw-status
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-admin/switch-provider ./switch-provider

# Common skills
ln -sf ~/github/data-service-infra-ai-configurations/skills/team-common/jira-issue-ops ./jira-issue-ops
```

---

## 7. Verify Feishu Configuration (if applicable)

Check if Feishu channel is configured:

```bash
cat ~/.openclaw/openclaw.json | jq '.channels.feishu'
```

---

**Report back when complete:**
- ✅ / ❌ Environment variables (list each value)
- ✅ / ❌ gh CLI installed
- ✅ / ❌ Repository clone status
- ✅ / ❌ Workspace symlinks created
- ✅ / ❌ Skills loaded
- ✅ / ❌ Feishu configuration status (if applicable)
