Skip to content

armgit / brag

Public Imported from GitHub
0

You built it. Now brag. Turn the project you just created into a short, shareable launch video with one command.

fix: resolve bundled assets from the skill's own directory (#19)

ShantanuTaroe02c161a87d4
diff --git a/skills/brag/SKILL.md b/skills/brag/SKILL.md
index 34adb74..a2869ec 100644
--- a/skills/brag/SKILL.md
+++ b/skills/brag/SKILL.md
@@ -79,6 +79,10 @@ Use a timestamp when:
Generate the timestamp at the start of the run (`YYYY-MM-DD-HHmmss`) and use it consistently for all output paths in that run: plan, brief, composition, render, and share copy.
+## Skill directory
+
+`<skill-dir>` is the directory containing this `SKILL.md`. Claude Code prints it as "Base directory for this skill" when the skill loads; for other agents it's wherever the skill was installed. Bundled assets are under `<skill-dir>/assets/` and scripts under `<skill-dir>/scripts/`. Don't guess an install path: a plugin install, a `~/.claude/skills/` copy, and this repo all put it somewhere different.
+
---
## Step 1: Inspect the project
@@ -97,7 +101,7 @@ Scan the project directory and extract the information needed to plan the brag v
Write `<output-dir>/brag-plan.md` (where `<output-dir>` is `brag-output/` or the timestamped variant chosen above). Answer the planning rubric. Commit to a creative angle. Write the beat-by-beat storyboard including scenes, text, timing, transitions, and SFX cues.
-When music is selected, include a compact `Music cue guidance` section: read the bundled track's cue preset from `assets/music/cues/` if present, otherwise note cues will be detected at composition time (any track now supports beat sync — see `references/audio.md`). Cue metadata is optional timing guidance only: story, readability, pacing, and product clarity stay primary.
+When music is selected, include a compact `Music cue guidance` section: read the bundled track's cue preset from `<skill-dir>/assets/music/cues/` if present, otherwise note cues will be detected at composition time (any track now supports beat sync — see `references/audio.md`). Cue metadata is optional timing guidance only: story, readability, pacing, and product clarity stay primary.
**Gate:** `<output-dir>/brag-plan.md` exists with a full storyboard. Scene durations sum to 15–25 seconds.
diff --git a/skills/brag/references/audio.md b/skills/brag/references/audio.md
index bf76d0f..f5b3d9b 100644
--- a/skills/brag/references/audio.md
+++ b/skills/brag/references/audio.md
@@ -33,26 +33,24 @@ Hyperframes implementation note: follow the audio-reactive guidance owned by the
## Asset paths
-SFX live under `sfx/{casino,impact,interface,ui}/`, and the individual keypress set under `sfx/keyboard/`. The assets root is `~/.claude/skills/brag/assets/` in the installed skill and `skills/brag/assets/` in this repo copy.
+All paths below are relative to `<skill-dir>`, this skill's own directory (see "Skill directory" in `SKILL.md`). It differs by install method, so resolve it rather than assuming `~/.claude/skills/brag/`.
-Music lives in the installed skill at `~/.claude/skills/brag/assets/music/`. In this repo copy, it lives at `skills/brag/assets/music/`.
+SFX live under `<skill-dir>/assets/sfx/{casino,impact,interface,ui}/`, and the individual keypress set under `<skill-dir>/assets/sfx/keyboard/`.
+
+Music lives at `<skill-dir>/assets/music/`.
Bundled music cue presets live beside the music:
```text
-skills/brag/assets/music/cues/<track-stem>.music-cues.md
-skills/brag/assets/music/cues/<track-stem>.music-cues.json
-~/.claude/skills/brag/assets/music/cues/<track-stem>.music-cues.md
-~/.claude/skills/brag/assets/music/cues/<track-stem>.music-cues.json
+<skill-dir>/assets/music/cues/<track-stem>.music-cues.md
+<skill-dir>/assets/music/cues/<track-stem>.music-cues.json
```
SFX analysis lives beside the SFX library:
```text
-skills/brag/assets/sfx/sfx-analysis.md
-skills/brag/assets/sfx/sfx-analysis.json
-~/.claude/skills/brag/assets/sfx/sfx-analysis.md
-~/.claude/skills/brag/assets/sfx/sfx-analysis.json
+<skill-dir>/assets/sfx/sfx-analysis.md
+<skill-dir>/assets/sfx/sfx-analysis.json
```
**Critical: copy audio files into the composition project before rendering.** Hyperframes validates and serves assets from the composition directory. Always copy the files you need into `<output-dir>/composition/assets/` first:
@@ -63,12 +61,9 @@ mkdir -p <output-dir>/composition/assets/sfx/interface <output-dir>/composition/
mkdir -p <output-dir>/composition/assets/music
# Copy only the files you plan to use (not the entire library)
-# From the repo copy:
-cp skills/brag/assets/sfx/interface/bong_001.ogg <output-dir>/composition/assets/sfx/interface/
-cp skills/brag/assets/sfx/impact/impactBell_heavy_000.ogg <output-dir>/composition/assets/sfx/impact/
-cp skills/brag/assets/music/happy-beats-business-moves-vol-1-by-ende-dot-app.mp3 <output-dir>/composition/assets/music/
-
-# From an installed Claude skill, use ~/.claude/skills/brag/assets/... instead.
+cp <skill-dir>/assets/sfx/interface/bong_001.ogg <output-dir>/composition/assets/sfx/interface/
+cp <skill-dir>/assets/sfx/impact/impactBell_heavy_000.ogg <output-dir>/composition/assets/sfx/impact/
+cp <skill-dir>/assets/music/happy-beats-business-moves-vol-1-by-ende-dot-app.mp3 <output-dir>/composition/assets/music/
```
Then in the composition HTML, paths are **relative to the `composition/` directory**:
@@ -252,15 +247,15 @@ Beat sync needs a cue source. Three are available — use the richest one the en
1. **Bundled track → precomputed preset (richest, instant, no deps).** The bundled tracks ship with cue metadata. Read the matching markdown summary, and pass the JSON path in `composition-brief.md`:
```text
-assets/music/cues/<track-stem>.music-cues.md
-assets/music/cues/<track-stem>.music-cues.json
+<skill-dir>/assets/music/cues/<track-stem>.music-cues.md
+<skill-dir>/assets/music/cues/<track-stem>.music-cues.json
```
-2. **Any track → extended analysis (richest for custom tracks; needs Python, any Hyperframes version).** For a custom track — or to refresh a bundled one — run `analyze_music_cues.py` on the audio file. It produces the same rich cue JSON/Markdown for any track. Run it via `uv`, which auto-provisions the deps (`librosa`, `numpy`, `scipy`, `soundfile`) from `skills/brag/scripts/pyproject.toml` — no manual `pip install` needed:
+2. **Any track → extended analysis (richest for custom tracks; needs Python, any Hyperframes version).** For a custom track — or to refresh a bundled one — run `analyze_music_cues.py` on the audio file. It produces the same rich cue JSON/Markdown for any track. Run it via `uv`, which auto-provisions the deps (`librosa`, `numpy`, `scipy`, `soundfile`) from `<skill-dir>/scripts/pyproject.toml` — no manual `pip install` needed:
```bash
-uv run --project skills/brag/scripts \
- python skills/brag/scripts/analyze_music_cues.py <track>.mp3 \
+uv run --project <skill-dir>/scripts \
+ python <skill-dir>/scripts/analyze_music_cues.py <track>.mp3 \
--output-json <output-dir>/composition/assets/music/cues/<stem>.music-cues.json \
--output-md <output-dir>/composition/assets/music/cues/<stem>.music-cues.md
```
diff --git a/skills/brag/references/step-3-compose.md b/skills/brag/references/step-3-compose.md
index 983fee9..b54c94c 100644
--- a/skills/brag/references/step-3-compose.md
+++ b/skills/brag/references/step-3-compose.md
@@ -97,10 +97,10 @@ Read [audio.md](audio.md). Copy the planned music into `<output-dir>/composition
```bash
mkdir -p <output-dir>/composition/assets/music
-cp <skill-assets>/music/<track>.mp3 <output-dir>/composition/assets/music/
+cp <skill-dir>/assets/music/<track>.mp3 <output-dir>/composition/assets/music/
```
-When running from an installed Claude skill, `<skill-assets>` is `~/.claude/skills/brag/assets/`. From the repo, it is `skills/brag/assets/`.
+`<skill-dir>` is this skill's own directory (see "Skill directory" in `SKILL.md`).
Hyperframes copies any SFX it selects into the same `assets/` tree after choosing exact files.
@@ -176,7 +176,7 @@ This gives you two layers of musicality: the big moments land on the strongest h
Do not force every tween onto a beat — readability and scene pacing come first. If snapping a tween to a beat hurts copy legibility or the product story, use the natural timing instead.
-If SFX are enabled, also pass `skills/brag/assets/sfx/sfx-analysis.md` as selection guidance. Prefer low high-frequency-risk files for repeated or polished moments. SFX on sequential events should fire at the same timestamp as the visual — the sound and motion land together.
+If SFX are enabled, also pass `<skill-dir>/assets/sfx/sfx-analysis.md` as selection guidance. Prefer low high-frequency-risk files for repeated or polished moments. SFX on sequential events should fire at the same timestamp as the visual — the sound and motion land together.
---