Add /publish skill for consistent multi-target deployment
Pushes to backup (full), fa-dev + sheffield (stripped via worktree), and Chromatic in one command. Replaces ad-hoc push workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
73
.claude/skills/publish/SKILL.md
Normal file
73
.claude/skills/publish/SKILL.md
Normal file
@@ -0,0 +1,73 @@
|
||||
Publish the project to all three targets: backup, dev remotes, and Chromatic.
|
||||
|
||||
## Workflow
|
||||
|
||||
### Step 1 — Pre-flight check
|
||||
|
||||
1. Ensure there are no uncommitted changes: `git status --porcelain`
|
||||
- If dirty, ask the user if they want to commit first
|
||||
2. Run `npx tsc --noEmit` to verify the build is clean
|
||||
- If it fails, stop and report errors
|
||||
|
||||
### Step 2 — Push to backup (everything)
|
||||
|
||||
Push main directly to the `backup` remote (git.richie-snitch.online/richie/ParsonsFA). This is a private repo that receives the full repo including AI tooling, memory, and working docs.
|
||||
|
||||
```bash
|
||||
git push backup main
|
||||
```
|
||||
|
||||
If rejected (non-fast-forward), warn the user and ask before force-pushing.
|
||||
|
||||
### Step 3 — Push to dev remotes (stripped)
|
||||
|
||||
Both `fa-dev` and `sheffield` receive a stripped version with AI tooling removed. Use a temporary worktree to avoid touching the working directory.
|
||||
|
||||
```bash
|
||||
# Clean up any prior worktree
|
||||
git worktree remove --force /tmp/dev-push 2>/dev/null
|
||||
git branch -D dev-clean 2>/dev/null
|
||||
|
||||
# Create worktree from current main
|
||||
git worktree add /tmp/dev-push -b dev-clean
|
||||
|
||||
# In the worktree, remove AI tooling from the index
|
||||
cd /tmp/dev-push
|
||||
for path in .claude/ docs/memory/ docs/reference/; do
|
||||
git rm -r --cached "$path" 2>/dev/null
|
||||
done
|
||||
git commit -m "Strip AI tooling and working docs for dev push"
|
||||
|
||||
# Push stripped branch to both dev remotes
|
||||
cd <project-root>
|
||||
git push fa-dev dev-clean:main --force
|
||||
git push sheffield dev-clean:main --force
|
||||
|
||||
# Clean up
|
||||
git worktree remove --force /tmp/dev-push
|
||||
git branch -D dev-clean
|
||||
```
|
||||
|
||||
**Important:** The `--force` is safe here because the stripped branch is always regenerated from main. Dev remotes never have unique commits.
|
||||
|
||||
### Step 4 — Deploy to Chromatic
|
||||
|
||||
```bash
|
||||
npm run chromatic
|
||||
```
|
||||
|
||||
Run this in the background. Report the Storybook URL and build link when complete.
|
||||
|
||||
### Step 5 — Report
|
||||
|
||||
Summarise what was pushed:
|
||||
|
||||
```
|
||||
Published to all targets:
|
||||
- backup → git.richie-snitch.online/richie/ParsonsFA (full)
|
||||
- fa-dev → git.richie-snitch.online/richie/Parsons (stripped)
|
||||
- sheffield → sheffield.sapiente.casa/richie/ParsonsFA (stripped)
|
||||
- Chromatic → [build link]
|
||||
```
|
||||
|
||||
If any target failed, report which ones succeeded and which failed.
|
||||
Reference in New Issue
Block a user