Build
Configure build script and run itFrom its SKILL.md
npx -y skills add AnotherSava/claude-code-common --skill buildAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.1 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it
See ~/.claude/learnings/shell-environment.md for the expected bash functions and verification checklist.
Context
- Shell rc target: !
case "$(uname -s)" in Darwin) echo "~/.zshrc" ;; MINGW*|MSYS*|CYGWIN*) echo "~/.bashrc" ;; *) [ -n "$ZSH_VERSION" ] || [ "${SHELL##*/}" = "zsh" ] && echo "~/.zshrc" || echo "~/.bashrc" ;; esac - Build function in shell rc: !
cat ~/.bashrc ~/.zshrc ~/.bash_profile ~/.zprofile 2>/dev/null | grep -c "build()" || echo 0 - run_repo_script helper in shell rc: !
cat ~/.bashrc ~/.zshrc ~/.bash_profile ~/.zprofile 2>/dev/null | grep -c "run_repo_script()" || echo 0 - Wrapper script exists: !
test -f scripts/build.sh && echo yes || echo no - GitHub workflow: !
ls .github/workflows/*.yml 2>/dev/null || echo none
1. Check prerequisites
- If Build function in shell rc is 0, append the
buildwrapper to the file in Shell rc target (i.e.~/.zshrcon macOS,~/.bashrcon Windows Git Bash / Linux-bash). It delegates to the sharedrun_repo_scripthelper, which walks up from the current directory to the repo'sscripts/build.shand runs it from the directory that holds it — sobuildworks from any subdirectory. If run_repo_script helper in shell rc is 0, append the helper too (thedeployskill installs the same one — add it only when missing, so it isn't duplicated):run_repo_script() { local rel="$1"; shift; local d="$PWD"; while [ "$d" != "/" ] && [ ! -f "$d/$rel" ]; do d="$(dirname "$d")"; done; if [ -f "$d/$rel" ]; then ( cd "$d" && bash "$rel" "$@" ); else echo "No $rel in this directory or any parent"; fi; } build() { run_repo_script scripts/build.sh "$@"; }
2. Set up quick build shortcut
- If Wrapper script exists is no, create
scripts/build.sh:#!/bin/bash bash ~/.claude/skills/build/scripts/build.sh "$@" - Keep the wrapper out of git via the global excludes file — never the project's
.gitignore(it's a per-machine artifact only this skill generates). Ensure the global excludes file contains the linescripts/build.sh:gi="$(git config --global core.excludesfile)"; gi="${gi/#\~/$HOME}"; gi="${gi:-$HOME/.gitignore}" grep -qxF 'scripts/build.sh' "$gi" 2>/dev/null || { grep -qF 'per-machine wrappers written by Claude Code' "$gi" 2>/dev/null \ || printf '\n# per-machine wrappers written by Claude Code deploy/build skills — never committed\n' >> "$gi" printf 'scripts/build.sh\n' >> "$gi" }
3. Configure GitHub Actions CI (optional)
If GitHub workflow is none:
- Ask the user: "No GitHub Actions workflow found. Set up CI for push/PR builds?"
- If declined, skip to step 4.
- Detect project type and parameters (see below).
- Generate the workflow, show it to the user for approval.
- On approval:
mkdir -p .github/workflows, then write.github/workflows/build.yml.
Project type detection
| Check | How | Type |
|---|---|---|
test -d src-tauri | directory exists | Tauri |
test -f package.json | file exists (and not Tauri) | npm |
find . -maxdepth 2 -name '*.csproj' | csproj found | dotnet |
Parameter detection
npm:
- Node version: if
.nvmrcexists → usenode-version-file: .nvmrc(stays in sync). Else readengines.nodefrompackage.json→ use minimum major. Else default24(current active LTS). - Lint: include
npm run lintstep only ifpackage.jsonhas ascripts.lintentry. - Test: include
npm teststep only ifpackage.jsonhas ascripts.testthat is not the defaultecho "Error: no test specified" && exit 1.
dotnet:
- .NET version:
global.jsonsdk.version→{major}.x. Else parseTargetFrameworkfrom csproj (net9.0→9.x). Default9.x. - Runner: if csproj contains
<RuntimeIdentifier>win-or<UseWPF>or<UseWindowsForms>→windows-latest. Elseubuntu-latest. - Test: include test step only if
tests/directory exists.
Tauri:
- Node version: same logic as npm.
- Runner: matrix build —
windows-latestandmacos-latest. Each runner uses its native Rust target (x86_64 on Windows, aarch64 on macOS ARM runners). - Rust cache: always include
Swatinem/rust-cache@v2withworkspaces: src-tauri -> target.
Reference workflows
Generate .github/workflows/build.yml following these patterns. Omit commented lines that don't apply; do not leave comments in the output.
npm (reference: bga-assistant):
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version-file: .nvmrc # or node-version: '24' if no .nvmrc
cache: npm
- run: npm ci
- run: npm run lint # omit if no lint script
- run: npm run build
- run: npm test # omit if no real test script
dotnet (reference: crop-stage):
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest # or windows-latest for Windows-only targets
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- run: dotnet restore
- run: dotnet build -c Release --no-restore
- run: dotnet test tests/ -c Release --no-restore # omit if no tests/ dir
Tauri (reference: tauri-dashboard):
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '24' # or node-version-file: .nvmrc
cache: npm
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
- run: npm ci
- run: cargo test --manifest-path src-tauri/Cargo.toml --lib
- run: npm run build
4. Build
If step 1 or 2 made changes, tell the user:
The
buildshortcut has been configured. Restart Claude Code for! buildto work — the shell reads its rc file only at startup, so new functions aren't available until the next session.For now, running the build directly:
Run the build script directly (bypassing the shell function):
bash ~/.claude/skills/build/scripts/build.sh
Report the output to the user. If it fails, analyze the error and suggest a fix. On success, remind the user to restart Claude Code if they haven't already, then ! build will work.
What ships with it: 1 file
437 B alongside SKILL.md, 1 of them executable
scripts/
- build.shruns437 B