一键导入
promote
Promote generic patterns from this project back to the upstream agent-kit. Use when you have reusable patterns to share.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Promote generic patterns from this project back to the upstream agent-kit. Use when you have reusable patterns to share.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Cross-project audit and sync. Backs up, bootstraps, promotes, syncs, and verifies all downstream projects.
Structured pre-planning research. Explores codebase, asks clarifying questions, and produces a brainstorm output file for /plan-feature input.
Capture knowledge from development sessions. Debug patterns, architecture decisions, framework gotchas, and integration learnings compound over time.
Load project context and show current status. Use at the start of a session or when context is needed.
Run parallel code reviews using specialized agents (security, performance, simplicity, nextjs-react). Produces a structured report.
Initialize a new project from Agent Kit boilerplate. Use when creating a new downstream project.
基于 SOC 职业分类
| name | promote |
| description | Promote generic patterns from this project back to the upstream agent-kit. Use when you have reusable patterns to share. |
| disable-model-invocation | true |
| allowed-tools | Bash, Read |
| argument-hint | ["--dry-run"] |
Promote generic, reusable patterns from this downstream project back to the upstream agent-kit template.
lucidlabs/
├── lucidlabs-agent-kit/ # Upstream template
└── projects/
└── [this-project]/ # You are here (downstream)
# Run promotion script (default path: ../../lucidlabs-agent-kit)
./scripts/promote.sh --upstream ../../lucidlabs-agent-kit
# Preview only (dry run)
./scripts/promote.sh --upstream ../../lucidlabs-agent-kit --dry-run
# Custom upstream path (if different structure)
./scripts/promote.sh --upstream /path/to/agent-kit
| Promotable | Description |
|---|---|
.claude/skills/* | Claude Code skills |
.claude/reference/* | Best practice documentation |
frontend/components/ui/* | Generic UI components |
frontend/lib/utils.ts | Utility functions |
frontend/lib/hooks/* | Generic React hooks |
scripts/* | Utility scripts |
| Blacklisted | Reason |
|---|---|
.claude/PRD.md | Project-specific requirements |
frontend/app/* | Project-specific pages |
mastra/src/agents/* | Domain-specific agents |
convex/* | Project-specific database |
WICHTIG: Promotions gehen IMMER über Pull Requests, NIE direkt auf main!
WICHTIG: VOR jeder Promotion MUSS ein Abgleich mit Upstream erfolgen!
1. FETCH → Upstream holen: git fetch origin (PFLICHT!)
2. DIFF → Änderungen prüfen: Hat sich upstream was geändert? (PFLICHT!)
3. SYNC → Falls Änderungen: Erst downstream syncen
4. DETECT → Promotable Änderungen finden
5. SELECT → Auswählen was promoted wird
6. BRANCH → Feature Branch im Upstream erstellen
7. COPY → Dateien übertragen
8. PR → Pull Request erstellen (PFLICHT!)
9. REVIEW → Code Review durch Team
10. MERGE → Nach Approval mergen
The promote script now automatically checks upstream before promoting.
It runs git fetch origin in the upstream repo and compares local HEAD with remote. If there are new commits, the script blocks and exits with a clear message:
╔════════════════════════════════════════════════════════════════╗
║ [BLOCKED] Upstream has new commits since last pull ║
╚════════════════════════════════════════════════════════════════╝
Why: The upstream agent-kit has commits that are not in your
local copy. Promoting now could cause merge conflicts
or overwrite recent upstream changes.
New commits:
abc1234 feat: add new skill
def5678 docs: update readme
Fix: 1. Pull upstream first:
cd /path/to/agent-kit && git pull origin main
2. Run /sync in your downstream project
3. Then retry /promote
If upstream is up-to-date:
✓ Upstream is up-to-date (abc1234)
This check is not optional — it runs every time and cannot be bypassed.
| Direkter Push | Pull Request |
|---|---|
| ❌ Keine Review | ✅ Code wird geprüft |
| ❌ Konflikte möglich | ✅ Konflikte vor Merge sichtbar |
| ❌ Fehler gehen direkt live | ✅ CI/CD Tests laufen |
| ❌ Keine Dokumentation | ✅ PR dokumentiert Änderung |
The script warns if files contain domain-specific keywords like:
ticket, customer, invoice, orderproduct, user, account, paymentThese indicate the code may not be generic enough for the template.
| Option | Description |
|---|---|
--upstream PATH | Path to agent-kit (required) |
--dry-run | Preview without changes |
--all | Promote all without selection |
--help | Show help |
╔════════════════════════════════════════════════════════════════╗
║ PATTERN PROMOTION ║
╚════════════════════════════════════════════════════════════════╝
ℹ Downstream: ~/coding/repos/lucidlabs/projects/customer-portal
ℹ Upstream: ~/coding/repos/lucidlabs/lucidlabs-agent-kit
▶ Step 1: Scanning for promotable changes...
Promotable changes found:
[1] .claude/skills/code-review/SKILL.md (NEW)
[2] .claude/reference/api-patterns.md (NEW)
[3] frontend/components/ui/data-table.tsx (MODIFIED)
Enter numbers to promote (e.g., 1,2 or 'all'): 1,2
▶ Step 2: Checking upstream main status...
Last commit: abc1234 "docs: update readme" (2 hours ago)
Your local: In sync ✓
▶ Step 3: Creating promotion branch...
Branch: promote/20260128-code-review-api-patterns
▶ Step 4: Copying files to upstream...
✔ Copied: .claude/skills/code-review/SKILL.md
✔ Copied: .claude/reference/api-patterns.md
▶ Step 5: Creating Pull Request...
✔ Branch pushed: promote/20260128-code-review-api-patterns
✔ PR created: https://github.com/lucidlabs-hq/agent-kit/pull/42
╔════════════════════════════════════════════════════════════════╗
║ ✓ PROMOTION COMPLETE ║
║ ║
║ PR: https://github.com/lucidlabs-hq/agent-kit/pull/42 ║
║ ║
║ Next steps: ║
║ 1. Review the PR ║
║ 2. Request team review if needed ║
║ 3. Merge after approval ║
╚════════════════════════════════════════════════════════════════╝
Falls das Script nicht verfügbar ist:
# 1. Upstream aktualisieren
cd /path/to/lucidlabs-agent-kit
git fetch origin
git checkout main
git pull origin main
# 2. Promotion Branch erstellen
git checkout -b promote/$(date +%Y%m%d)-pattern-name
# 3. Dateien kopieren
cp /path/to/downstream/.claude/skills/my-skill/SKILL.md .claude/skills/my-skill/
# 4. Committen
git add .
git commit -m "feat: promote [pattern] from [project]"
# 5. Branch pushen
git push -u origin promote/$(date +%Y%m%d)-pattern-name
# 6. PR erstellen (PFLICHT!)
gh pr create --title "Promote: [Pattern Name]" --body "..."
⚠️ NIEMALS git push origin main im Upstream!
Promote patterns when:
Do NOT promote:
| Direction | Command | Description |
|---|---|---|
| Downstream → Upstream | /promote | This skill |
| Upstream → Downstream | ./scripts/sync-upstream.sh | Pull updates from template |
Aktiviere Branch Protection für main im Agent Kit:
# Via GitHub CLI
gh repo edit lucidlabs-hq/agent-kit --enable-branch-protection
# Oder via GitHub UI:
# Settings → Branches → Add rule → main
# ✓ Require pull request before merging
# ✓ Require approvals (1)
Bei Promotions prüft Claude automatisch:
main?IF upstream AND on_main THEN
→ create branch
→ commit to branch
→ create PR
→ NEVER push to main directly
Wenn jemand versucht direkt zu pushen (und Branch Protection aktiv):
remote: error: GH006: Protected branch update failed
remote: At least 1 approving review is required
## Pre-Promotion Checklist
- [ ] Ist das Pattern wirklich generisch?
- [ ] Keine Domain-Keywords (invoice, customer, etc.)?
- [ ] Upstream main ist aktuell (`git fetch && git status`)?
- [ ] Feature Branch erstellt (nicht auf main)?
- [ ] PR wird erstellt (nicht direkter Push)?
- [ ] PR Description erklärt das Pattern?