[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74GSFPHB3J0C8GS8MGYJVCB":3,"skill-same:01M74GSFPHB3J0C8GS8MGYJVCB":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M74GSFPHB3J0C8GS8MGYJVCB","fancy-interactive-bash",null,"Use when creating or refactoring interactive Bash scripts that should be composable, sourceable, color-aware, testable by function, and structured around parse_opts, parse_prereqs, and a sequential run_main orchestration.","jesperronn\u002Fdotfiles","jesperronn","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6267?v=4","01M74GR60DHXTCHW2MMYYQHFGR","Jesper Rønn-Jensen","01M74GR615DJ290CSGD5CF2Z7Z",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: fancy-interactive-bash\ngroup: shell-bash\nsummary: \"Quality Bash pattern: parse_opts\u002Fparse_prereqs\u002Frun_main, sourceable functions, color UX, testable by function.\"\ndescription: Use when creating or refactoring interactive Bash scripts that should be composable, sourceable, color-aware, testable by function, and structured around parse_opts, parse_prereqs, and a sequential run_main orchestration.\n---\n\n# Fancy Interactive Bash\n\nUse this skill for Bash utilities where the implementation quality matters more than the domain logic.\n\nThe goal is not \"write a script that works once\". The goal is:\n- sourceable for tests\n- deterministic in small functions\n- pleasant in terminal use\n- easy to extend without turning `main` into a blob\n\n## Template Files\n\nStarter templates are in `assets\u002F`: `script-template.sh`, `script-template.test.sh`, `bin-test-template`, `bin-lint-template`.\n\nCopy them as starting points and adapt names immediately to avoid leaking placeholders.\n\n## Default Shape\n\nPrefer this structure:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\n# shellcheck shell=bash\n\nset -euo pipefail\n\n# Global flags and cached state\n\n# Colors\n\nusage() { ... }\nlog() { ... }\ncolor_print() { ... }\ninfo() { ... }\nsuccess() { ... }\nwarn() { ... }\nerror() { ... }\nverbose() { ... }\n\nparse_opts() { ... }\nparse_prereqs() { ... }\n\n# Pure helpers and formatting helpers\n\n# Inventory \u002F planning helpers\n\n# Apply \u002F mutate helpers\n\nrun_main() {\n  parse_opts \"$@\" || return $?\n  parse_prereqs\n\n  plan_phase_one\n  apply_phase_one\n\n  plan_phase_two\n  apply_phase_two\n\n  report_summary\n}\n\nif [[ \"${BASH_SOURCE[0]}\" == \"$0\" ]]; then\n  run_main \"$@\"\nfi\n```\n\n## Core Rules\n\n- Keep `run_main` as a readable sequence of function calls.\n- Do not hide orchestration inside one giant helper.\n- Separate planning\u002Freporting from mutation when practical.\n- Make most helpers callable independently after `source script`.\n- Prefer small functions with single responsibility over local cleverness.\n- Keep state in explicit globals with a clear prefix, not anonymous shell variables.\n- Run `shellcheck` during development and before considering the script finished.\n- If `shellcheck` warnings are intentionally suppressed, keep the suppression narrow and explain why.\n\n## Validation Workflow\n\nTreat testing and linting as script contract, not follow-up chores.\n\n**Script level:**\n- Add `*.test.sh` sibling for each script (`bin\u002Ffoo` → `bin\u002Ffoo.test.sh`)\n- Keep tests small, readable, assertion output clear (expected vs actual)\n- Print colored `[PASS]` \u002F `[FAIL]` markers at line start\n- Cover option parsing, defaults, `--help`, symmetry, formatters, interactive fallbacks, progress\u002Ffailure shapes\n\n**Repository level:**\n- `bin\u002Ftest`: discover and run all `*.test.sh` files in stable order; per-file heading before each; fail fast; apply color to headings (cyan\u002Faqua works well)\n- `bin\u002Flint`: standard shellcheck entrypoint; per-file headings with same color scheme; fail non-zero on lint errors\n- Both should have reproducible per-file lines so failures can be retried directly\n\nDevelopers run `bin\u002Flint && bin\u002Ftest` before commit.\n\n## Naming\n\nNormalize the reusable top-level contract to:\n- `parse_opts`: parse flags and mode selection\n- `parse_prereqs`: detect tools, terminal capabilities, required binaries, and environment constraints\n- `run_main`: linear orchestration only\n\nOther helpers should be named by role:\n- `*_usage`\n- `*_info`, `*_warn`, `*_error`, `*_success`\n- `*_format_*`\n- `*_plan_*`\n- `*_apply_*`\n- `*_interactive_select_*`\n- `*_progress_*`\n\n## Option Design\n\nSupport common flags users will try even before they read help:\n- `-h`, `--help`\n- `-n`, `--dry-run`\n- `--verbose`\n- `--trace`\n- `--timings`\n- `-i`, `--interactive`\n- `--color`\n- `--no-color`\n- `--raw`, `--short` when you have machine-lean or condensed output modes\n- `--plain`, `--progressive` when output mode can change materially\n- `--all` when multiple groups\u002Fchecks\u002Factions can be enabled at once\n- `--foo` and `--no-foo` pairs for toggles\n\nRules:\n- Positive group flags should allow \"only mode\" semantics when relevant.\n- `--no-x` must work symmetrically with `--x`.\n- Unknown options should print a warning, show usage, and exit non-zero.\n- `--help` should print usage and exit without running work.\n- `--verbose` should expose useful per-step detail without becoming shell trace noise.\n- Support `--timings` when runtime cost matters and users need to see where time is going.\n- Keep `--trace` separate from `--verbose` so debugging command execution stays opt-in.\n\n## Output and Color\n\nTreat terminal output as part of the interface. Principles apply to Bash, Go, Python, and any CLI tool.\n\n**TTY detection:** Auto-disable color when output is piped\u002Fredirected. Detect via `[[ -t 1 ]]` (Bash), `os.Stat` (Go), `sys.stdout.isatty()` (Python). Optionally support `--color`\u002F`--no-color` flags. **All output must remain readable without color.**\n\n**Vibe palette (mandatory):** Every colored CLI created or refactored with this skill uses this semantic palette. Do not substitute an ad-hoc palette. Emit these sequences only when color is enabled; preserve readable plain output for `NO_COLOR`, `--no-color`, and non-TTY output.\n\n| Element | ANSI color | Used For |\n|---------|-------|----------|\n| Dim | gray | descriptions, prose, non-critical text, debug output |\n| Bold | bright | structural markers, emphasis |\n| Heading | yellow (`33`), bold | section labels (`Usage:`, `Flags:`, `Examples:`) |\n| Command | green | executable tokens, subcommands |\n| Flag | green | option names |\n| Placeholder | bright magenta (`95`) | metavariables (`\u003Cissue-key>`, `[FILE]`) |\n| File heading | cyan\u002Faqua | per-file labels in test\u002Flint output |\n| Tool name | magenta (`35`), bold | primary brand, usage first line |\n| Success | green | completion, `[PASS]` |\n| Error | red | failure, `[FAIL]`, error lines |\n\n**Apply to:**\n- Help section headings and tool name\n- Subcommand tokens separately from placeholders (separate colors so command shape scans fast)\n- Option names in help\n- `info()`, `success()`, `warn()`, `error()` output\n- Test\u002Flint runner headings\n- `[PASS]` \u002F `[FAIL]` markers\n- **Dim text:** Debug output, verbose trace lines, auxiliary information user can ignore (e.g., when `--verbose` shows step-by-step progress, use dim for \"entering step X\" context)\n\n**Rules:**\n- **One central abstraction.** `color_print` helper in Bash, `color` package in Go — not scattered codes.\n- **Token-level, not full-line.** Color individual tokens (command, flag, placeholder) not entire usage line.\n- **Consistent across the tool.** Same palette for help, test output, error messages, runner headings.\n- **Consistent across languages.** Bash script and Go CLI in same project should feel identical to users.\n- **Use the Vibe palette exactly.** Do not change token colors for individual tools; the semantic split is part of the shared CLI interface.\n\nThe supplied `assets\u002Fscript-template.sh` encodes this palette for new Bash tools.\n\n## Performance And Timings\n\nMake slow steps visible without noise.\n\n**Split flags:**\n- `--verbose`: what's happening\n- `--timings`: where time is going\n- `--trace`: exact commands\n\n**Rules:**\n- Default output concise\n- Time meaningful phases (not every helper): `parse_prereqs`, discovery, planning, selectors, external commands, final report\n- In `--verbose`: show timing next to step when it clarifies slowness\n- In default mode: keep timings in `--timings` or summary only\n- Include elapsed time on failure when diagnostic\n- One timing helper, not scattered `date` calls; prefer monotonic timers, fall back cleanly\n- Store per-step data for summary; don't couple timing to color\u002FTTY logic\n\n**Pattern:** `run_timed \"Step name\" step_function` → `Completed in 12.4s`\n\n## Interactivity\n\nInteractive mode should be optional, not structural.\n\nRules:\n- The script must still work non-interactively.\n- If `fzf` or a similar tool is available, use it for multi-select review.\n- If it is not available, fall back to one-at-a-time confirmation or plain prompts.\n- Print a protip when an optional tool would improve UX.\n\nFor `fzf`-style selectors:\n- visible columns should show meaningful labels, not raw payload fields\n- raw paths\u002Fids may remain hidden as the returned value\n- support bulk select\u002Fdeselect bindings\n- include short usage hints in the prompt\u002Fheader\n- keep row formatting deterministic so tests can assert it\n\n## Progress UI\n\nFor longer work, render progress on the same line when stdout is a TTY.\n\nRules:\n- gate live rendering behind `[[ -t 1 ]]`\n- provide explicit start\u002Fstatus\u002Ffinish helpers\n- clear previously rendered status lines before printing final output\n- truncate long paths to terminal width\n- prefer stable two-line status when current target\u002Fpath matters\n\nDo not make progress rendering a dependency of correctness. It is presentation only.\n\n## Failure Handling\n\nAlways tell the user what to do next when a chained command fails.\n\nRules:\n- print the failing step clearly\n- print exit status when available\n- if a line number or source line can be inferred, show it\n- end with a concrete next step\n\nTypical next-step guidance:\n- rerun with `--verbose`\n- rerun with `--timings`\n- rerun with `--trace`\n- rerun a single group with `--foo`\n- install optional dependency such as `fzf`\n- fix prerequisite access such as `sudo` or missing binary\n- run the suggested safer command instead of deleting raw files\n\nFailure output should explain the recovery path, not just the error.\n\n## Composability\n\nWrite the script so functions can be tested in isolation.\n\nPreferred patterns:\n- direct sourcing via `source script`, guarded with `[[ \"${BASH_SOURCE[0]}\" == \"$0\" ]]`\n- explicit reset helper in tests for all globals\n- helper functions return data via stdout when practical\n- orchestration functions call helpers that can be overridden in tests\n- avoid hidden subshell-only state unless required\n\nThis matters more than \"pure shell minimalism\". A sourceable script with overridable helpers is easier to verify.\n\n## Testing Method\n\nTest structure and behavior via source and function override.\n\n**Coverage:** Option parsing, defaults\u002Freset, `--help`, flag symmetry, formatters, interactive fallbacks, progress\u002Ffailure shapes, orchestration, environment branches.\n\n**Method:**\n- Source the script; override helpers to isolate units\n- Use temp directories, not fixtures\n- Assert exact strings (formatted rows, prompts); separate exit code assertions\n- Run `shellcheck` as required validation\n- Print colored `[PASS]` \u002F `[FAIL]` at line start\n- Show expected vs actual clearly on failure\n- Use parameterized loops when they add signal, not noise\n\n**Helpers:** `assert_eq`, `assert_status`, `reset_state`\n\n**Test runner UX:** Section headers, colored `[PASS]` \u002F `[FAIL]`, fail fast on structural regressions.\n\n## What To Reuse From The Source Pattern\n\nExtract and reuse these methods:\n- centralized color handling, including help\u002Fusage output\n- a consistent family of `info\u002Fsuccess\u002Fwarn\u002Ferror\u002Fverbose` helpers\n- symmetrical option parsing with intuitive defaults\n- explicit parsing and prerequisite phases\n- sequential `run_main`\n- plan\u002Fapply separation\n- interactive selectors as separate functions\n- progress helpers separate from business logic\n- failure handlers that include next steps\n- a direct-source entry guard for tests using `BASH_SOURCE`\n- tests that override helpers to isolate units\n\n## What To Ignore\n\nIgnore the actual business purpose of the script.\n\nDo not copy:\n- cleanup-specific paths\n- runtime-specific commands\n- app-specific heuristics\n- domain-specific group names\n\nCopy the engineering pattern, not the business logic.\n\n## Skeleton\n\n```bash\nparse_opts() {\n  while (($#)); do\n    case \"$1\" in\n      -h|--help) usage; return 1 ;;\n      -n|--dry-run) FLAG_DRY_RUN=1 ;;\n      --verbose) FLAG_VERBOSE=1 ;;\n      -i|--interactive) FLAG_INTERACTIVE=1 ;;\n      --color) FLAG_COLOR=1 ;;\n      --no-color) FLAG_COLOR=0 ;;\n      --all) FLAG_ALL=1 ;;\n      --thing) enable_only_mode; FLAG_THING=1 ;;\n      --no-thing) FLAG_THING=0 ;;\n      *) warn \"Unknown option: $1\"; usage >&2; return 2 ;;\n    esac\n    shift\n  done\n}\n\nparse_prereqs() {\n  command -v fzf >\u002Fdev\u002Fnull 2>&1 && HAS_FZF=1 || HAS_FZF=0\n}\n\nrun_main() {\n  parse_opts \"$@\" || return $?\n  parse_prereqs\n  plan_work\n  apply_work\n  report_summary\n}\n```\n\nUse this as the starting contract unless the script is trivial enough that the extra structure would be fake ceremony.\n","# Fancy Interactive Bash\n\nUse this skill for Bash utilities where the implementation quality matters more than the domain logic.\n\nThe goal is not \"write a script that works once\". The goal is:\n- sourceable for tests\n- deterministic in small functions\n- pleasant in terminal use\n- easy to extend without turning `main` into a blob\n\n## Template Files\n\nStarter templates are in `assets\u002F`: `script-template.sh`, `script-template.test.sh`, `bin-test-template`, `bin-lint-template`.\n\nCopy them as starting points and adapt names immediately to avoid leaking placeholders.\n\n## Default Shape\n\nPrefer this structure:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\n# shellcheck shell=bash\n\nset -euo pipefail\n\n# Global flags and cached state\n\n# Colors\n\nusage() { ... }\nlog() { ... }\ncolor_print() { ... }\ninfo() { ... }\nsuccess() { ... }\nwarn() { ... }\nerror() { ... }\nverbose() { ... }\n\nparse_opts() { ... }\nparse_prereqs() { ... }\n\n# Pure helpers and formatting helpers\n\n# Inventory \u002F planning helpers\n\n# Apply \u002F mutate helpers\n\nrun_main() {\n  parse_opts \"$@\" || return $?\n  parse_prereqs\n\n  plan_phase_one\n  apply_phase_one\n\n  plan_phase_two\n  apply_phase_two\n\n  report_summary\n}\n\nif [[ \"${BASH_SOURCE[0]}\" == \"$0\" ]]; then\n  run_main \"$@\"\nfi\n```\n\n## Core Rules\n\n- Keep `run_main` as a readable sequence of function calls.\n- Do not hide orchestration inside one giant helper.\n- Separate planning\u002Freporting from mutation when practical.\n- Make most helpers callable independently after `source script`.\n- Prefer small functions with single responsibility over local cleverness.\n- Keep state in explicit globals with a clear prefix, not anonymous shell variables.\n- Run `shellcheck` during development and before considering the script finished.\n- If `shellcheck` warnings are intentionally suppressed, keep the suppression narrow and explain why.\n\n## Validation Workflow\n\nTreat testing and linting as script contract, not follow-up chores.\n\n**Script level:**\n- Add `*.test.sh` sibling for each script (`bin\u002Ffoo` → `bin\u002Ffoo.test.sh`)\n- Keep tests small, readable, assertion output clear (expected vs actual)\n- Print colored `[PASS]` \u002F `[FAIL]` markers at line start\n- Cover option parsing, defaults, `--help`, symmetry, formatters, interactive fallbacks, progress\u002Ffailure shapes\n\n**Repository level:**\n- `bin\u002Ftest`: discover and run all `*.test.sh` files in stable order; per-file heading before each; fail fast; apply color to headings (cyan\u002Faqua works well)\n- `bin\u002Flint`: standard shellcheck entrypoint; per-file headings with same color scheme; fail non-zero on lint errors\n- Both should have reproducible per-file lines so failures can be retried directly\n\nDevelopers run `bin\u002Flint && bin\u002Ftest` before commit.\n\n## Naming\n\nNormalize the reusable top-level contract to:\n- `parse_opts`: parse flags and mode selection\n- `parse_prereqs`: detect tools, terminal capabilities, required binaries, and environment constraints\n- `run_main`: linear orchestration only\n\nOther helpers should be named by role:\n- `*_usage`\n- `*_info`, `*_warn`, `*_error`, `*_success`\n- `*_format_*`\n- `*_plan_*`\n- `*_apply_*`\n- `*_interactive_select_*`\n- `*_progress_*`\n\n## Option Design\n\nSupport common flags users will try even before they read help:\n- `-h`, `--help`\n- `-n`, `--dry-run`\n- `--verbose`\n- `--trace`\n- `--timings`\n- `-i`, `--interactive`\n- `--color`\n- `--no-color`\n- `--raw`, `--short` when you have machine-lean or condensed output modes\n- `--plain`, `--progressive` when output mode can change materially\n- `--all` when multiple groups\u002Fchecks\u002Factions can be enabled at once\n- `--foo` and `--no-foo` pairs for toggles\n\nRules:\n- Positive group flags should allow \"only mode\" semantics when relevant.\n- `--no-x` must work symmetrically with `--x`.\n- Unknown options should print a warning, show usage, and exit non-zero.\n- `--help` should print usage and exit without running work.\n- `--verbose` should expose useful per-step detail without becoming shell trace noise.\n- Support `--timings` when runtime cost matters and users need to see where time is going.\n- Keep `--trace` separate from `--verbose` so debugging command execution stays opt-in.\n\n## Output and Color\n\nTreat terminal output as part of the interface. Principles apply to Bash, Go, Python, and any CLI tool.\n\n**TTY detection:** Auto-disable color when output is piped\u002Fredirected. Detect via `[[ -t 1 ]]` (Bash), `os.Stat` (Go), `sys.stdout.isatty()` (Python). Optionally support `--color`\u002F`--no-color` flags. **All output must remain readable without color.**\n\n**Vibe palette (mandatory):** Every colored CLI created or refactored with this skill uses this semantic palette. Do not substitute an ad-hoc palette. Emit these sequences only when color is enabled; preserve readable plain output for `NO_COLOR`, `--no-color`, and non-TTY output.\n\n| Element | ANSI color | Used For |\n|---------|-------|----------|\n| Dim | gray | descriptions, prose, non-critical text, debug output |\n| Bold | bright | structural markers, emphasis |\n| Heading | yellow (`33`), bold | section labels (`Usage:`, `Flags:`, `Examples:`) |\n| Command | green | executable tokens, subcommands |\n| Flag | green | option names |\n| Placeholder | bright magenta (`95`) | metavariables (`\u003Cissue-key>`, `[FILE]`) |\n| File heading | cyan\u002Faqua | per-file labels in test\u002Flint output |\n| Tool name | magenta (`35`), bold | primary brand, usage first line |\n| Success | green | completion, `[PASS]` |\n| Error | red | failure, `[FAIL]`, error lines |\n\n**Apply to:**\n- Help section headings and tool name\n- Subcommand tokens separately from placeholders (separate colors so command shape scans fast)\n- Option names in help\n- `info()`, `success()`, `warn()`, `error()` output\n- Test\u002Flint runner headings\n- `[PASS]` \u002F `[FAIL]` markers\n- **Dim text:** Debug output, verbose trace lines, auxiliary information user can ignore (e.g., when `--verbose` shows step-by-step progress, use dim for \"entering step X\" context)\n\n**Rules:**\n- **One central abstraction.** `color_print` helper in Bash, `color` package in Go — not scattered codes.\n- **Token-level, not full-line.** Color individual tokens (command, flag, placeholder) not entire usage line.\n- **Consistent across the tool.** Same palette for help, test output, error messages, runner headings.\n- **Consistent across languages.** Bash script and Go CLI in same project should feel identical to users.\n- **Use the Vibe palette exactly.** Do not change token colors for individual tools; the semantic split is part of the shared CLI interface.\n\nThe supplied `assets\u002Fscript-template.sh` encodes this palette for new Bash tools.\n\n## Performance And Timings\n\nMake slow steps visible without noise.\n\n**Split flags:**\n- `--verbose`: what's happening\n- `--timings`: where time is going\n- `--trace`: exact commands\n\n**Rules:**\n- Default output concise\n- Time meaningful phases (not every helper): `parse_prereqs`, discovery, planning, selectors, external commands, final report\n- In `--verbose`: show timing next to step when it clarifies slowness\n- In default mode: keep timings in `--timings` or summary only\n- Include elapsed time on failure when diagnostic\n- One timing helper, not scattered `date` calls; prefer monotonic timers, fall back cleanly\n- Store per-step data for summary; don't couple timing to color\u002FTTY logic\n\n**Pattern:** `run_timed \"Step name\" step_function` → `Completed in 12.4s`\n\n## Interactivity\n\nInteractive mode should be optional, not structural.\n\nRules:\n- The script must still work non-interactively.\n- If `fzf` or a similar tool is available, use it for multi-select review.\n- If it is not available, fall back to one-at-a-time confirmation or plain prompts.\n- Print a protip when an optional tool would improve UX.\n\nFor `fzf`-style selectors:\n- visible columns should show meaningful labels, not raw payload fields\n- raw paths\u002Fids may remain hidden as the returned value\n- support bulk select\u002Fdeselect bindings\n- include short usage hints in the prompt\u002Fheader\n- keep row formatting deterministic so tests can assert it\n\n## Progress UI\n\nFor longer work, render progress on the same line when stdout is a TTY.\n\nRules:\n- gate live rendering behind `[[ -t 1 ]]`\n- provide explicit start\u002Fstatus\u002Ffinish helpers\n- clear previously rendered status lines before printing final output\n- truncate long paths to terminal width\n- prefer stable two-line status when current target\u002Fpath matters\n\nDo not make progress rendering a dependency of correctness. It is presentation only.\n\n## Failure Handling\n\nAlways tell the user what to do next when a chained command fails.\n\nRules:\n- print the failing step clearly\n- print exit status when available\n- if a line number or source line can be inferred, show it\n- end with a concrete next step\n\nTypical next-step guidance:\n- rerun with `--verbose`\n- rerun with `--timings`\n- rerun with `--trace`\n- rerun a single group with `--foo`\n- install optional dependency such as `fzf`\n- fix prerequisite access such as `sudo` or missing binary\n- run the suggested safer command instead of deleting raw files\n\nFailure output should explain the recovery path, not just the error.\n\n## Composability\n\nWrite the script so functions can be tested in isolation.\n\nPreferred patterns:\n- direct sourcing via `source script`, guarded with `[[ \"${BASH_SOURCE[0]}\" == \"$0\" ]]`\n- explicit reset helper in tests for all globals\n- helper functions return data via stdout when practical\n- orchestration functions call helpers that can be overridden in tests\n- avoid hidden subshell-only state unless required\n\nThis matters more than \"pure shell minimalism\". A sourceable script with overridable helpers is easier to verify.\n\n## Testing Method\n\nTest structure and behavior via source and function override.\n\n**Coverage:** Option parsing, defaults\u002Freset, `--help`, flag symmetry, formatters, interactive fallbacks, progress\u002Ffailure shapes, orchestration, environment branches.\n\n**Method:**\n- Source the script; override helpers to isolate units\n- Use temp directories, not fixtures\n- Assert exact strings (formatted rows, prompts); separate exit code assertions\n- Run `shellcheck` as required validation\n- Print colored `[PASS]` \u002F `[FAIL]` at line start\n- Show expected vs actual clearly on failure\n- Use parameterized loops when they add signal, not noise\n\n**Helpers:** `assert_eq`, `assert_status`, `reset_state`\n\n**Test runner UX:** Section headers, colored `[PASS]` \u002F `[FAIL]`, fail fast on structural regressions.\n\n## What To Reuse From The Source Pattern\n\nExtract and reuse these methods:\n- centralized color handling, including help\u002Fusage output\n- a consistent family of `info\u002Fsuccess\u002Fwarn\u002Ferror\u002Fverbose` helpers\n- symmetrical option parsing with intuitive defaults\n- explicit parsing and prerequisite phases\n- sequential `run_main`\n- plan\u002Fapply separation\n- interactive selectors as separate functions\n- progress helpers separate from business logic\n- failure handlers that include next steps\n- a direct-source entry guard for tests using `BASH_SOURCE`\n- tests that override helpers to isolate units\n\n## What To Ignore\n\nIgnore the actual business purpose of the script.\n\nDo not copy:\n- cleanup-specific paths\n- runtime-specific commands\n- app-specific heuristics\n- domain-specific group names\n\nCopy the engineering pattern, not the business logic.\n\n## Skeleton\n\n```bash\nparse_opts() {\n  while (($#)); do\n    case \"$1\" in\n      -h|--help) usage; return 1 ;;\n      -n|--dry-run) FLAG_DRY_RUN=1 ;;\n      --verbose) FLAG_VERBOSE=1 ;;\n      -i|--interactive) FLAG_INTERACTIVE=1 ;;\n      --color) FLAG_COLOR=1 ;;\n      --no-color) FLAG_COLOR=0 ;;\n      --all) FLAG_ALL=1 ;;\n      --thing) enable_only_mode; FLAG_THING=1 ;;\n      --no-thing) FLAG_THING=0 ;;\n      *) warn \"Unknown option: $1\"; usage >&2; return 2 ;;\n    esac\n    shift\n  done\n}\n\nparse_prereqs() {\n  command -v fzf >\u002Fdev\u002Fnull 2>&1 && HAS_FZF=1 || HAS_FZF=0\n}\n\nrun_main() {\n  parse_opts \"$@\" || return $?\n  parse_prereqs\n  plan_work\n  apply_work\n  report_summary\n}\n```\n\nUse this as the starting contract unless the script is trivial enough that the extra structure would be fake ceremony.\n",{"name":5,"group":24,"summary":25,"description":7},"shell-bash","Quality Bash pattern: parse_opts\u002Fparse_prereqs\u002Frun_main, sourceable functions, color UX, testable by function.","main","c1d43fc3463eca86b9221288c8b29805891ae792","link-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fjesperronn","http:\u002F\u002Fjustaddwater.dk\u002F","2026-11-14 15:24:38",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add jesperronn\u002Fdotfiles --skill fancy-interactive-bash",{"tool":39,"command":40},"bunx","bunx skills add jesperronn\u002Fdotfiles --skill fancy-interactive-bash",{"tool":42,"command":43},"pnpm","pnpm dlx skills add jesperronn\u002Fdotfiles --skill fancy-interactive-bash","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002FSKILL.md",true,[47,53,57,63],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"assets\u002Fbin-lint-template","ASSET","资产文件",634,"https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002Fassets\u002Fbin-lint-template",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"assets\u002Fbin-test-template",570,"https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002Fassets\u002Fbin-test-template",{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"assets\u002Fscript-template.sh","SCRIPT","脚本",2906,"https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002Fassets\u002Fscript-template.sh",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"assets\u002Fscript-template.test.sh",1872,"https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Ffancy-interactive-bash\u002Fassets\u002Fscript-template.test.sh",[68,76,83,90,97,104],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":75},"01M76CVMYE4MRKSWGZMZJQP3WY","maintainer-workflow-commands","Use when adding or auditing project commands for setup, development, tests, lint, dependencies, troubleshooting, or releases, and when making those commands discoverable through bin\u002Fworkflows.","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fmaintainer-workflow-commands\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M74GVPPNXZTYFS5C0KJ59GE8","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M74GVKHYF7RFF60C8JHP68FH","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M74GVF4BCHZ1HQ4Y61P72T07","wrap-up","Scan the current conversation and produce a structured session close-out: deferred items, open questions, decisions made, and the single clearest next action. Ends with a ready-to-paste \"next session opener\" prompt. Use this skill whenever the user says \"\u002Fwrap-up\", \"\u002Fdeferred\", \"wrap up this session\", \"what did we defer\", \"what's left\", \"end of session summary\", or asks what to pick up next time.","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M74GVBMXJYHWN3KJPWZAR2A5","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M74GV9C16Z8YB6R6TK2AVCCJ","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fjesperronn\u002Fdotfiles\u002Fblob\u002Fmain\u002Flink-dir\u002F.agents\u002Fskills\u002Fusing-superpowers\u002FSKILL.md",[],[]]