Skip to content

Fastest way to scaffold your LLM powered personal knowledge base - Obsidian, Claude Code, qmd, Github

feat(skills): add /update-workflows and call it from /release

jessepinkman9900ff20b80bf18a
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md
index 8939d65..15f976a 100644
--- a/.claude/skills/release/SKILL.md
+++ b/.claude/skills/release/SKILL.md
@@ -1,6 +1,6 @@
---
name: release
-description: "Full release flow for claude-second-brain: resolves the next version, updates the docs site + ship log via /update-docs, then bumps package.json and opens a single PR containing both the docs commit and the version bump via /package-release. Trigger phrases: /release, ship a new version, cut a release, prepare a release."
+description: "Full release flow for claude-second-brain: resolves the next version, audits CI workflows via /update-workflows, syncs docs + ship log via /update-docs, then bumps package.json and opens a single PR containing all three commits via /package-release. Trigger phrases: /release, ship a new version, cut a release, prepare a release."
argument-hint: "Optional: patch | minor | major | exact version (e.g. 0.2.0). Leave blank for auto-suggestion."
---
@@ -9,13 +9,15 @@ argument-hint: "Optional: patch | minor | major | exact version (e.g. 0.2.0). Le
Orchestrates a complete release for `claude-second-brain`:
1. Resolve the target version.
-2. Run `/update-docs` so the docs site and ship log reflect what's shipping (ship log entry uses the target version).
-3. Commit the docs changes.
-4. Run `/package-release` to bump `package.json`, commit, push, and open the PR.
+2. Run `/update-workflows` to catch `pack-test.yml` drift before CI sees it.
+3. Commit any workflow edits.
+4. Run `/update-docs` so the docs site and ship log reflect what's shipping (ship log entry uses the target version).
+5. Commit the docs changes.
+6. Run `/package-release` to bump `package.json`, commit, push, and open the PR.
-The result is **one PR** containing both the docs commit and the version-bump commit.
+The result is **one PR** containing up to three commits (workflows → docs → version) so CI passes on first push.
-If you only want one half, run `/update-docs` or `/package-release` directly — each is usable standalone.
+If you only want one half, run `/update-workflows`, `/update-docs`, or `/package-release` directly — each is usable standalone.
## Preconditions
@@ -45,7 +47,26 @@ Apply the same semver logic `/package-release` uses:
Record the resolved version as `vX.Y.Z` for the rest of the flow.
-### Step 2 — Run /update-docs
+### Step 2 — Run /update-workflows
+
+Invoke the `update-workflows` skill. When it asks for approval of its proposal, forward it to the user and wait.
+
+If the audit reports "pack-test is in sync — nothing to update," skip to Step 4.
+
+Let `/update-workflows` apply its edits.
+
+### Step 3 — Commit workflow changes
+
+If `/update-workflows` modified any files (check `git status`):
+
+```bash
+git add .github/workflows/pack-test.yml .claude/skills/pack-test/SKILL.md
+git commit -m "chore(ci): sync pack-test with current repo state"
+```
+
+If nothing changed, skip this step.
+
+### Step 4 — Run /update-docs
Invoke the `update-docs` skill. When it asks for approval of its proposal, forward that proposal to the user and wait.
@@ -53,7 +74,7 @@ Invoke the `update-docs` skill. When it asks for approval of its proposal, forwa
Let `/update-docs` apply its edits.
-### Step 3 — Commit docs changes
+### Step 5 — Commit docs changes
If `/update-docs` modified any files (check `git status`):
@@ -64,28 +85,29 @@ git commit -m "chore(docs): update ship log and docs for vX.Y.Z"
If nothing changed, skip this step.
-### Step 4 — Run /package-release
+### Step 6 — Run /package-release
Invoke `/package-release <arg>` with the version resolved in Step 1 (e.g. `/package-release 0.8.0`). It will:
- Bump `package.json` to `X.Y.Z`
- Commit the bump (`chore: bump version to X.Y.Z`)
- Push the branch
-- Open a PR — whose commit list will include both your docs commit from Step 3 and the version-bump commit
+- Open a PR — whose commit list will include any workflow commit from Step 3, any docs commit from Step 5, and the version-bump commit
-### Step 5 — Report
+### Step 7 — Report
-Tell the user:
+Tell the user which commits landed in the PR — omit any step that was skipped:
> **Release PR opened:** [url]
>
-> - Docs commit: `chore(docs): update ship log and docs for vX.Y.Z`
+> - Workflow commit: `chore(ci): sync pack-test with current repo state` *(if applicable)*
+> - Docs commit: `chore(docs): update ship log and docs for vX.Y.Z` *(if applicable)*
> - Version commit: `chore: bump version to X.Y.Z`
>
> After merge, `release-publish.yml` tags `vX.Y.Z`, creates a GitHub Release, and publishes `[email protected]` to npm.
## What can go wrong
-- **User declines docs proposal** — stop; do not proceed to `/package-release`. The branch is left with no changes and can be retried.
-- **Version mismatch between ship log and `package.json`** — Step 2's correction gate prevents this; if it slips through, the PR reviewer will catch it. Fix by amending the docs commit before merge.
+- **User declines workflow or docs proposal** — stop; do not proceed to `/package-release`. The branch is left with whatever has already been committed; retry after resolving the concern.
+- **Version mismatch between ship log and `package.json`** — Step 4's correction gate prevents this; if it slips through, the PR reviewer will catch it. Fix by amending the docs commit before merge.
- **Nothing to release** — if `git log main..HEAD` is empty, abort.
diff --git a/.claude/skills/update-workflows/SKILL.md b/.claude/skills/update-workflows/SKILL.md
new file mode 100644
index 0000000..a8449e4
--- /dev/null
+++ b/.claude/skills/update-workflows/SKILL.md
@@ -0,0 +1,115 @@
+---
+name: update-workflows
+description: "Audit .github/workflows/pack-test.yml (and its coupled .claude/skills/pack-test/SKILL.md) against current repo state — skill layout, GLOBAL_SKILLS, bin names, grep/absent patterns. Reports drift, proposes edits, waits for user approval, then applies them. Trigger phrases: /update-workflows, check workflows, audit pack-test, workflows out of date."
+---
+
+# /update-workflows
+
+Audits `pack-test.yml` — the workflow most prone to silent drift — against the current repo state and proposes fixes. Other workflows (`release-publish.yml`, `docs-deploy.yml`, `docs-preview.yml`) are generic and not covered here; inspect them manually if you've touched them.
+
+Proposes all changes and waits for user approval before writing anything.
+
+## Steps
+
+Run each step in order.
+
+---
+
+### Step 1 — Gather current repo state
+
+Run all of these in parallel:
+
+```bash
+# Vault-local skills shipped in the template
+ls template/.claude/skills/
+
+# Top-level template subdirs that pack-test `ls`-checks
+ls template/
+ls template/scripts/qmd/ 2>/dev/null || true
+
+# Global skills list and bin names
+grep -n 'GLOBAL_SKILLS' bin/create.js
+jq -r '.bin | keys[]' package.json
+jq -r '.version' package.json
+```
+
+Also read:
+- `.github/workflows/pack-test.yml` — the workflow being audited
+- `.claude/skills/pack-test/SKILL.md` — coupled checklist/counts
+- A representative global skill (e.g. `template/.claude/skills/brain-ingest/SKILL.md`) — to verify `grep_check` patterns still match
+
+---
+
+### Step 2 — Audit
+
+For each item below, mark `OK` or `DRIFT`. Record every `DRIFT` with the exact pack-test line that's wrong and what it should be.
+
+**Vault-local skill coverage (`pack-test.yml` `check ".claude/skills/<name>"` lines):**
+- Every dir in `template/.claude/skills/` has a matching `check` line.
+- No `check` line points at a dir that no longer exists.
+
+**Global skill coverage (`pack-test.yml` `check "~/.claude/skills/<name>/SKILL.md"` + `.csb-version` lines):**
+- Every name in `GLOBAL_SKILLS` (from `bin/create.js`) has both a `SKILL.md` check and a `.csb-version` check.
+- No extra names appear that aren't in `GLOBAL_SKILLS`.
+- Corresponding `grep_check` / `absent_check` loops iterate the same set.
+
+**`grep_check` patterns:**
+- Each pattern (`claude-second-brain path`, `claude-second-brain qmd`, etc.) still appears in at least one shipped global skill under `template/.claude/skills/`.
+
+**`absent_check` patterns:**
+- Each pattern (`__QMD_PATH__`, `__CSB_CONFIG__`, `INDEX_PATH=\$QMD_INDEX`) still doesn't appear in any shipped file. (A stale `absent_check` for a token that no longer exists anywhere is harmless but noisy — optional to clean up.)
+
+**Bin names:**
+- Every bin name referenced in `pack-test.yml` (e.g. `claude-second-brain`, `csb`) exists as a key in `package.json`'s `bin` object.
+
+**`pack-test/SKILL.md` coupling:**
+- The expected-skills comment lists the same set as `template/.claude/skills/`.
+- The `ls` and `grep` commands in Step 3 reference current paths.
+- The checklist table's "N subdirs" count matches the actual `ls template/.claude/skills/ | wc -l`.
+- The cleanup `rm -rf` line in Step 4 targets the current `GLOBAL_SKILLS` set.
+
+---
+
+### Step 3 — Propose changes
+
+Present a consolidated proposal:
+
+```
+## Workflow audit proposal
+
+### .github/workflows/pack-test.yml
+- DRIFT: <specific line> — <what's wrong> → <proposed fix>
+- ...
+
+### .claude/skills/pack-test/SKILL.md
+- DRIFT: <specific line/section> — <what's wrong> → <proposed fix>
+- ...
+```
+
+If everything is `OK`, report "pack-test is in sync — nothing to update" and stop.
+
+**Stop here and wait for user approval** before applying any edits. If the user wants to skip items, drop them from the list before continuing.
+
+---
+
+### Step 4 — Apply approved edits
+
+Use Edit on:
+- `.github/workflows/pack-test.yml`
+- `.claude/skills/pack-test/SKILL.md`
+
+**Do not** edit other workflows, other skills, or source files. If the audit surfaced drift elsewhere (e.g. a `grep_check` pattern that's truly gone from every skill), flag it in the report — don't fix it here.
+
+---
+
+### Step 5 — Report
+
+Tell the user:
+- Files edited and what was changed on each.
+- Anything flagged but not fixed (and why).
+
+## What can go wrong
+
+- **No drift found** — Step 2 produces all `OK`; report and stop without touching anything.
+- **Ambiguous fix** — if the audit finds drift but multiple corrections are plausible (e.g. a `grep_check` pattern that could be renamed or deleted), ask the user rather than guessing.
+- **Other workflow changes on this branch** — not in scope; mention them in the Step 5 report so the user knows to review manually.