askill
run-script

run-scriptSafety --Repository

Create and manage bash task runner scripts (Makefile alternative). Use when user says "create run script", "add to run script", "add task to run", "create helper in run script", "run script task", or asks for a bash task runner.

1 stars
1.2k downloads
Updated 2/20/2026

Package Files

Loading files...
SKILL.md

Run Script

Pure bash task runner - functions as tasks, auto-discovered via compgen.

Template

Create file named run at repository root with chmod +x:

#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

BASE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

# Add tasks above help function

function help {
    printf "%s <task> [args]\n\nTasks:\n" "${0}"
    compgen -A function | grep -v "^_" | cat -n
    printf "\nExtended help:\n  Each task has comments for general usage\n"
}

TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"

Adding Tasks

Tasks are functions. Name describes action:

# Build the project
function build {
    go build -o bin/app ./cmd/app
}

function test {
    go test ./...
}

function lint {
    golangci-lint run
}

Tasks with Arguments

Arguments passed after task name available as $1, $2, etc:

# Deploy to environment: ./run deploy staging
function deploy {
    local env="${1:?Usage: deploy <environment>}"
    kubectl apply -k "overlays/${env}"
}

# Run specific test: ./run test-one TestUserCreate
function test-one {
    go test -run "${1:?Usage: test-one <test-name>}" ./...
}

Tasks with Optional Arguments

Use default values:

# Build with optional output name: ./run build [output-name]
function build {
    local output="${1:-bin/app}"
    go build -o "$output" ./cmd/app
}

Private Helpers

Prefix with underscore - excluded from help:

function _log {
    echo "[$(date +'%H:%M:%S')] $*"
}

function _require_env {
    : "${!1:?Environment variable $1 is required}"
}

function build {
    _log "Building..."
    go build -o bin/app ./cmd/app
}

function deploy {
    _require_env "KUBECONFIG"
    kubectl apply -k overlays/prod
}

Task Composition

Call other tasks:

function ci {
    lint
    test
    build
}

function release {
    ci
    deploy prod
}

Comments

Add comment above function for non-obvious tasks:

# Sync database schema from production
function db-sync {
    pg_dump "$PROD_DB" | psql "$LOCAL_DB"
}

Skip comments when function name is self-explanatory:

function test {
    go test ./...
}

NEVER

  • Name file anything other than run
  • Place anywhere other than repository root
  • Forget chmod +x run
  • Use echo for logging in helpers (use functions for consistency)
  • Create tasks that shadow common commands without clear naming (e.g., test is fine, but be careful with cd, ls)

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

AI review pending.

Metadata

Licenseunknown
Version-
Updated2/20/2026
Publishermgajewskik

Tags

ci-cddatabaselintingobservabilitytesting