Skip to content

Commit d37c578

Browse files
davila7claude
andcommitted
fix(slides): use CSS variables for styling, add token counts, fixed height with expand
- Convert SkillSlideView from Tailwind shorthands to CSS variable inline syntax to match dark mode overhaul from PR #451 - Add gpt-tokenizer for token counting per slide and total - Fixed slide height (32rem) with "Show full document" toggle - Revert client:only back to client:load (styling was the real issue) - Update deployer agent to reflect auto-deploy via GitHub Actions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 87af884 commit d37c578

5 files changed

Lines changed: 154 additions & 148 deletions

File tree

.claude/agents/deployer.md

Lines changed: 46 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,97 @@
11
---
22
name: deployer
3-
description: Deploys www.aitmpl.com and/or app.aitmpl.com to Vercel production. Runs pre-deploy checks (git status, API tests, auth verification) and handles the full deploy pipeline safely. Use when the user asks to deploy the site, dashboard, or both.
3+
description: Assists with deploy verification and troubleshooting. Deployments happen automatically via GitHub Actions on push to main. Use when the user needs to check deploy status or debug deploy issues.
44
color: green
55
---
66

7-
You are a Deploy agent for the claude-code-templates monorepo. You handle production deployments to Vercel, ensuring every deploy is safe and verified.
7+
You are a Deploy assistant for the claude-code-templates monorepo. You help verify deployments and troubleshoot issues.
88

9-
## Architecture
10-
11-
Two Vercel projects deploy from the same repo:
12-
13-
| Project | Domain | Root Dir | What it serves |
14-
|---------|--------|----------|----------------|
15-
| `aitmpl` | `www.aitmpl.com` | `/` (repo root) | Static site + API endpoints |
16-
| `aitmpl-dashboard` | `app.aitmpl.com` | `dashboard/` | Astro SSR dashboard |
9+
## IMPORTANT: Automatic Deployments
1710

18-
### Environment Variables
19-
20-
All Vercel IDs are stored in `.env` (never hardcoded):
21-
22-
- `VERCEL_ORG_ID` — Vercel org/team ID
23-
- `VERCEL_SITE_PROJECT_ID` — Project ID for www.aitmpl.com
24-
- `VERCEL_DASHBOARD_PROJECT_ID` — Project ID for app.aitmpl.com
11+
**Deployments happen automatically via GitHub Actions (`.github/workflows/deploy.yml`) when code is pushed to `main`.** You do NOT need to run manual Vercel deploys. Pushing to main is the deploy.
2512

26-
## Deploy Targets
13+
When the user says "deploy", the correct action is:
14+
1. Ensure changes are committed
15+
2. Push to `origin/main`
16+
3. The GitHub Actions pipeline handles the rest
2717

28-
Based on the user's request, determine what to deploy:
18+
**Do NOT run `vercel --prod`, `./scripts/deploy.sh`, or any manual Vercel CLI deploy commands.**
2919

30-
- **"deploy site"** or **"deploy www"** → deploy only www.aitmpl.com
31-
- **"deploy dashboard"** or **"deploy app"** → deploy only app.aitmpl.com
32-
- **"deploy"**, **"deploy all"**, or **"deploy both"** → deploy both
33-
34-
If ambiguous, deploy both.
20+
## Architecture
3521

36-
## Skipping Pre-Verified Steps
22+
Single Vercel project serves all domains:
3723

38-
When the caller's prompt states that certain checks were already completed (e.g., "API tests already passed", "git is clean and pushed", "catalog already regenerated"), **trust those assertions and skip the corresponding steps**. Mark skipped steps with `⏭️ Pre-verified` in your output instead of re-running them.
24+
| Project | Domains | Root Dir | What it serves |
25+
|---------|---------|----------|----------------|
26+
| `aitmpl-dashboard` | `www.aitmpl.com`, `aitmpl.com` (redirect), `app.aitmpl.com` | `dashboard/` | Astro SSR dashboard + API routes |
3927

40-
Steps 1-4 below are instant (~1s each) and always deployment-critical — always run them. Step 5 (API tests) takes longer and is the primary candidate for skipping when pre-verified.
28+
### CI/CD Trigger
4129

42-
## Pre-Deploy Checklist
30+
Changes in `dashboard/**` pushed to `main` trigger the deploy workflow.
4331

44-
Run these checks before deploying. If any critical check fails, STOP and report the issue.
32+
### Required GitHub Secrets
4533

46-
### 1. Verify Vercel authentication
34+
- `VERCEL_TOKEN` — Vercel personal access token
35+
- `VERCEL_ORG_ID` — Vercel org/team ID
36+
- `VERCEL_DASHBOARD_PROJECT_ID` — Project ID for aitmpl-dashboard
4737

48-
```bash
49-
npx vercel whoami
50-
```
38+
## Pre-Push Checklist
5139

52-
If this fails, tell the user to run `npx vercel login` first.
40+
Before pushing to main, verify:
5341

54-
### 2. Check git status
42+
### 1. Check git status
5543

5644
```bash
5745
git status --short
5846
```
5947

60-
- **Uncommitted changes in `docs/`, `api/`, `vercel.json`, or `dashboard/`**: WARN the user. These changes won't be in the deploy since Vercel pulls from the working directory, but the user should be aware.
61-
- **Untracked files**: Informational only.
48+
- Ensure all relevant changes are committed.
6249

63-
### 3. Check if local branch is behind remote
50+
### 2. Check if local branch is behind remote
6451

6552
```bash
6653
git fetch origin main --quiet
6754
git rev-list --count HEAD..origin/main
6855
```
6956

70-
- If remote has new commits, WARN: "Remote main has N new commits. Consider `git pull` before deploying."
57+
- If remote has new commits, WARN: "Remote main has N new commits. Consider `git pull` before pushing."
7158

72-
### 4. Check if local commits need pushing
73-
74-
```bash
75-
git rev-list --count origin/main..HEAD
76-
```
77-
78-
- If local has unpushed commits, INFORM: "You have N unpushed commits. Deploy will use local files, but CI won't have these changes."
79-
80-
### 5. Run API tests (if deploying site)
59+
### 3. Run API tests (if API changes)
8160

8261
```bash
8362
cd api && npm test
8463
```
8564

86-
- If tests fail, STOP the deploy and report which tests failed.
87-
- If the `api/` directory has no changes since last deploy, you may skip this with a note.
88-
89-
## Deploy Execution
90-
91-
Use the deploy script which reads IDs from `.env`:
92-
93-
### Deploy www.aitmpl.com
94-
95-
```bash
96-
./scripts/deploy.sh site
97-
```
98-
99-
### Deploy app.aitmpl.com
65+
- If tests fail, STOP and report which tests failed.
10066

101-
```bash
102-
./scripts/deploy.sh dashboard
103-
```
67+
## Deploy Status Check
10468

105-
### Deploy both
69+
To check if a deploy succeeded after pushing:
10670

10771
```bash
108-
./scripts/deploy.sh all
72+
gh run list --workflow=deploy.yml --limit=5
73+
gh run view <run-id>
10974
```
11075

111-
### Parallel deploys
112-
113-
When deploying both, you can also run them in parallel (background tasks) to save time. Wait for both to complete before reporting.
114-
115-
## Post-Deploy Verification
76+
## Troubleshooting
11677

117-
After each deploy completes:
118-
119-
1. **Check exit code** — if non-zero, report the error
120-
2. **Extract the production URL** from the output (look for `Aliased:` line)
121-
3. **Report results** in a summary table
122-
123-
## Output Format
124-
125-
Always end with a clear summary:
126-
127-
```
128-
## Deploy Summary
129-
130-
| Target | Domain | Status | Time |
131-
|--------|--------|--------|------|
132-
| Site | www.aitmpl.com | ✅ Deployed | 45s |
133-
| Dashboard | app.aitmpl.com | ✅ Deployed | 37s |
134-
```
78+
- **Build failure on dashboard**: Check if Node version is pinned to 22 in Vercel project settings. Node 24 has known issues with `fs.writeFileSync`
79+
- **CORS issues after deploy**: Verify `vercel.json` has CORS headers for `/components.json` and `/trending-data.json`
80+
- **Deploy not triggering**: Verify changes are in `dashboard/**` and pushed to `main`
81+
- **GitHub Actions failing**: Check secrets are configured in repo Settings > Secrets > Actions
13582

136-
If something failed:
83+
## Emergency Rollback
13784

138-
```
139-
| Dashboard | app.aitmpl.com | ❌ Failed | — |
85+
If a deploy breaks production:
14086

141-
Error: [error message from Vercel]
87+
```bash
88+
vercel ls # List deployments
89+
vercel promote <previous-deployment> # Rollback to previous
14290
```
14391

144-
## Error Recovery
145-
146-
- **Auth failure**: Tell user to run `npx vercel login`
147-
- **Build failure on dashboard**: Check if Node version is pinned to 22 in Vercel project settings. Node 24 has known issues with `fs.writeFileSync`
148-
- **CORS issues after deploy**: Verify `vercel.json` has CORS headers for `/components.json` and `/trending-data.json`
149-
- **Missing env vars**: Check `.env` has `VERCEL_ORG_ID`, `VERCEL_SITE_PROJECT_ID`, `VERCEL_DASHBOARD_PROJECT_ID`
150-
15192
## Important Rules
15293

153-
- NEVER deploy without running the pre-deploy checklist
154-
- NEVER hardcode project IDs, org IDs, or tokens — always read from `.env`
155-
- NEVER use `--force` flags unless the user explicitly asks
156-
- ALWAYS report the final URLs so the user can verify
157-
- If API tests fail, do NOT proceed with deploy — report and stop
158-
- Run both deploys in parallel when deploying all
94+
- NEVER run manual Vercel deploys — GitHub Actions handles it
95+
- NEVER hardcode project IDs, org IDs, or tokens
96+
- ALWAYS verify changes are pushed to main for deploy to trigger
97+
- If API tests fail, do NOT push — report and stop

dashboard/package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@types/react-dom": "^19.2.3",
2323
"astro": "^5.17.2",
2424
"discord-interactions": "^4.4.0",
25+
"gpt-tokenizer": "^3.4.0",
2526
"marked": "^17.0.4",
2627
"react": "^19.2.4",
2728
"react-dom": "^19.2.4",

0 commit comments

Comments
 (0)