$npx -y skills add OdradekAI/bundles-forge --skill optimizingUse when optimizing a bundle-plugin or single skill — improving descriptions, reducing tokens, fixing audit findings, restructuring workflows, adding skills to fill gaps, or iterating on user feedback
| 1 | # Optimizing Bundle-Plugins |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Orchestrate targeted improvement of a bundle-plugin project or a single skill. Unlike a full audit, optimization focuses on goals: better triggering, lower token cost, tighter workflow chains, and feedback-driven skill refinement. This skill diagnoses issues, decides on improvements, and delegates content changes to `bundles-forge:authoring`. |
| 6 | |
| 7 | **Core principle:** Optimize for the agent's experience. Diagnose → decide → delegate → verify. |
| 8 | |
| 9 | **Skill type:** Hybrid — follow the execution flow rigidly (diagnose → decide → delegate → verify), but select targets and adapt execution strategies flexibly based on audit findings and user goals. |
| 10 | |
| 11 | **Announce at start:** "I'm using the optimizing skill to improve [this project / this skill]." |
| 12 | |
| 13 | ## Step 1: Resolve Input & Detect Scope |
| 14 | |
| 15 | The target can be a local path, a GitHub URL, or a zip file. Normalize the input to a local directory before scope detection. |
| 16 | |
| 17 | ### Input Normalization |
| 18 | |
| 19 | > Edge cases & naming conventions: `bundles-forge:auditing` — `references/input-normalization.md` |
| 20 | |
| 21 | **This is a mandatory step — do not skip it or improvise paths.** Resolve the target to a local directory before proceeding to Scope Detection. |
| 22 | |
| 23 | 1. **Resolve the workspace.** The workspace is `$CLAUDE_PROJECT_DIR` or `$CURSOR_PROJECT_DIR` (plugin mode), falling back to the current working directory. |
| 24 | 2. **Normalize the target by type:** |
| 25 | - **Local path** — use directly; no transformation needed. |
| 26 | - **GitHub URL** — parse `<owner>` and `<repo>` from the URL. Shallow-clone to `<workspace>/.bundles-forge/repos/<owner>__<repo>/` using `--depth 1 --no-checkout`, then run `git checkout`. If the directory already exists, append a `__<YYYYMMDD>` timestamp to avoid collisions. **Do not clone to `/tmp/`, `~/`, or any path outside `.bundles-forge/repos/`.** |
| 27 | - **Zip/tar.gz** — extract to `<workspace>/.bundles-forge/repos/<archive-name>/`. |
| 28 | 3. **Create the target subdirectory** if it does not exist. |
| 29 | 4. **On failure** (network error, 404, auth required, rate limit): tell the user what failed and suggest providing a local path or zip file instead. Do not silently skip or proceed with partial data. |
| 30 | |
| 31 | See the canonical source for the full naming convention (version/timestamp suffixes), GitHub subdirectory URLs, and security rules. |
| 32 | |
| 33 | ### Scope Detection |
| 34 | |
| 35 | **Prerequisites:** Target resolved to a local path (via Input Normalization above). |
| 36 | |
| 37 | After normalization, determine the scope from the resolved local path: |
| 38 | |
| 39 | | Target | How to Detect | Mode | |
| 40 | |--------|--------------|------| |
| 41 | | Project root | Has `skills/` directory and `package.json` | **Project optimization** — all 6 targets | |
| 42 | | Single skill directory | Contains `SKILL.md` but no `skills/` subdirectory | **Skill optimization** — 3 targets + feedback iteration | |
| 43 | | Single SKILL.md file | Path ends in `SKILL.md` | **Skill optimization** — 3 targets + feedback iteration | |
| 44 | |
| 45 | **If the target is a single skill, skip to the Skill Optimization section below.** |
| 46 | |
| 47 | --- |
| 48 | |
| 49 | ## Project Optimization |
| 50 | |
| 51 | ### Process |
| 52 | |
| 53 | 1. **Diagnose** — run audit scripts, assess skill health, detect workflow gaps |
| 54 | 2. **Classify & Route** — classify action type, select applicable targets |
| 55 | 3. **Apply** — execute selected targets, delegate content changes to authoring |
| 56 | 4. **Verify** — re-audit to confirm improvement |
| 57 | |
| 58 | ### Diagnostic Tools |
| 59 | |
| 60 | #### Audit Script Baseline |
| 61 | |
| 62 | Run the quality linter to identify frontmatter issues, description anti-patterns, and broken references before manual optimization: |
| 63 | |
| 64 | ```bash |
| 65 | bundles-forge audit-skill <target-dir> # markdown report |
| 66 | bundles-forge audit-skill --json <target-dir> # machine-readable |
| 67 | ``` |
| 68 | |
| 69 | The linter automates checks Q1-Q15 and X1-X3 from the skill quality ruleset. Focus manual effort on the subjective targets below. |
| 70 | |
| 71 | #### Skill Health Assessment |
| 72 | |
| 73 | Assess each skill across four qualitative dimensions: trigger confidence, execution clarity, end-to-end completeness, and degradation signals. See `references/optimization-decision-trees.md` for the full assessment framework and signal-to-target mapping. |
| 74 | |
| 75 | #### Workflow Gap Detection |
| 76 | |
| 77 | When findings reveal structural gaps (not just broken connections but missing capabilities), consider creating new skills via the CAPTURED action type. See `references/optimization-decision-trees.md` for the gap detection signals. |
| 78 | |
| 79 | ### Routing & Classification |
| 80 | |
| 81 | Route findings to targets and classify each action (FIX / DERIVED / CAPTURED) before delegating. See `references/optimization-decision-trees.md` for: |
| 82 | - **Target routing table** — map |