shell-function

Generate portable shell functions and aliases for Bash, Zsh, Fish, or POSIX sh.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/ohnotnow/agentic-stuff --skill shell-function
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-function
Source: https://github.com/ohnotnow/agentic-stuff/tree/main/skills/shell-function
Command: npx skills add https://github.com/ohnotnow/agentic-stuff --skill shell-function

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create portable, idiomatic shell functions and aliases tailored to the user's current shell, enabling reuse of commands across environments with safety and clarity.

Core Features & Use Cases

  • Detects the active shell (bash, zsh, fish, or POSIX sh) and outputs a correct wrapper.
  • Generates portable code with proper quoting, local variables, and shell-specific syntax.
  • Provides a guided workflow for review, installation, and integration into shell config.

Quick Start

Ask me to generate a portable, idiomatic shell function or alias tailored to your current shell.

Frequently Asked Questions about shell-function

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create shell functions that work across bash, zsh, and fish?

To create portable shell functions across bash, zsh, and fish, you need environment detection and shell-specific syntax generation. This skill detects your active shell and outputs idiomatic wrapper code with proper quoting and local variables for cross-environment reuse.

What is the best way to write reusable shell aliases for common automation tasks?

The best way to write reusable shell aliases for automation tasks is generating portable, idiomatic code tailored to your current shell. This approach applies safe defaults and clear usage guidance to ensure aliases function correctly across POSIX sh, bash, zsh, and fish environments.

Does this approach support generating one-liners for POSIX sh?

Yes, generating one-liners for POSIX sh is fully supported alongside bash, zsh, and fish. The process detects the active environment and applies shell-specific syntax and safe defaults to ensure the generated one-liners execute correctly within POSIX-compliant environments.

How do I install generated shell functions into my shell config?

To install generated shell functions into your shell config, follow the guided workflow provided after code generation. This workflow walks you through reviewing the portable code, installing it, and integrating the shell-specific syntax directly into your active environment configuration.

Why do my shell aliases break when switching between zsh and fish?

Shell aliases break when switching between zsh and fish because each shell requires specific syntax and quoting rules. Generating portable, idiomatic shell functions with environment detection ensures the output code uses correct local variables and syntax tailored for the active shell.