posix-shell-pro
Overview
This public intake copy packages plugins/antigravity-awesome-skills/skills/posix-shell-pro from https://github.com/sickn33/antigravity-awesome-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses the external_source block in metadata.json plus ORIGIN.md as the provenance anchor for review.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Focus Areas, POSIX Constraints, Approach, Compatibility & Portability, Readability & Maintainability, Safety & Security Patterns.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- Working on posix shell pro tasks or workflows
- Needing guidance, best practices, or checklists for posix shell pro
- The task is unrelated to posix shell pro
- You need a different domain or tool outside this scope
- Use when provenance needs to stay visible in the answer, PR, or review packet.
- Use when copied upstream references, examples, or scripts materially improve the answer.
Operating Table
| Situation |
Start here |
Why it matters |
| First-time use |
metadata.json |
Confirms repository, branch, commit, and imported path through the external_source block before touching the copied workflow |
| Provenance review |
ORIGIN.md |
Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution |
SKILL.md |
Starts with the smallest copied file that materially changes execution |
| Supporting context |
SKILL.md |
Adds the next most relevant copied source file without loading the entire package |
| Handoff decision |
## Related Skills |
Helps the operator switch to a stronger native skill when the task drifts |
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open resources/implementation-playbook.md.
- Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
- Read the overview and provenance files before loading any copied upstream support files.
- Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
Imported Workflow Notes
Imported: Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
Imported: Focus Areas
- Strict POSIX compliance for maximum portability
- Shell-agnostic scripting that works on any Unix-like system
- Defensive programming with portable error handling
- Safe argument parsing without bash-specific features
- Portable file operations and resource management
- Cross-platform compatibility (Linux, BSD, Solaris, AIX, macOS)
- Testing with dash, ash, and POSIX mode validation
- Static analysis with ShellCheck in POSIX mode
- Minimalist approach using only POSIX-specified features
- Compatibility with legacy systems and embedded environments
Examples
Example 1: Ask for the upstream workflow directly
Use @posix-shell-pro-v2 to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
Example 2: Ask for a provenance-grounded review
Review @posix-shell-pro-v2 against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
Example 3: Narrow the copied support files before execution
Use @posix-shell-pro-v2 for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
Example 4: Build a reviewer packet
Review @posix-shell-pro-v2 using the copied upstream files plus provenance, then summarize any gaps before merge.
Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.
Best Practices
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
- Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.
- Prefer the smallest useful set of support files so the workflow stays auditable and fast to review.
- Keep provenance, source commit, and imported file paths visible in notes and PR descriptions.
- Point directly at the copied upstream files that justify the workflow instead of relying on generic review boilerplate.
- Treat generated examples as scaffolding; adapt them to the concrete task before execution.
- Route to a stronger native skill when architecture, debugging, design, or security concerns become dominant.
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in plugins/antigravity-awesome-skills/skills/posix-shell-pro, fails to mention provenance, or does not use any copied source files at all.
Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Check the external_source block first, then restate the provenance before continuing.
Problem: The imported workflow feels incomplete during review
Symptoms: Reviewers can see the generated SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.
Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
Problem: The task drifted into a different specialization
Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better.
Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
Related Skills
@00-andruia-consultant - Use when the work is better handled by that native specialization after this imported skill establishes context.
@00-andruia-consultant-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@10-andruia-skill-smith - Use when the work is better handled by that native specialization after this imported skill establishes context.
@10-andruia-skill-smith-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
| Resource family |
What it gives the reviewer |
Example path |
references |
copied reference notes, guides, or background material from upstream |
references/n/a |
examples |
worked examples or reusable prompts copied from upstream |
examples/n/a |
scripts |
upstream helper scripts that change execution or validation |
scripts/n/a |
agents |
routing or delegation notes that are genuinely part of the imported package |
agents/n/a |
assets |
supporting assets or schemas copied from the source package |
assets/n/a |
Imported Reference Notes
Imported: References & Further Reading
POSIX Standards & Specifications
Portability & Best Practices
Tools & Testing
Imported: POSIX Constraints
- No arrays (use positional parameters or delimited strings)
- No
[[ conditionals (use [ test command only)
- No process substitution
<() or >()
- No brace expansion
{1..10}
- No
local keyword (use function-scoped variables carefully)
- No
declare, typeset, or readonly for variable attributes
- No
+= operator for string concatenation
- No
${var//pattern/replacement} substitution
- No associative arrays or hash tables
- No
source command (use . for sourcing files)
Imported: Approach
- Always use
#!/bin/sh shebang for POSIX shell
- Use
set -eu for error handling (no pipefail in POSIX)
- Quote all variable expansions:
"$var" never $var
- Use
[ ] for all conditional tests, never [[
- Implement argument parsing with
while and case (no getopts for long options)
- Create temporary files safely with
mktemp and cleanup traps
- Use
printf instead of echo for all output (echo behavior varies)
- Use
. script.sh instead of source script.sh for sourcing
- Implement error handling with explicit
|| exit 1 checks
- Design scripts to be idempotent and support dry-run modes
- Use
IFS manipulation carefully and restore original value
- Validate inputs with
[ -n "$var" ] and [ -z "$var" ] tests
- End option parsing with
-- and use rm -rf -- "$dir" for safety
- Use command substitution
$() instead of backticks for readability
- Implement structured logging with timestamps using
date
- Test scripts with dash/ash to verify POSIX compliance
Imported: Compatibility & Portability
- Use
#!/bin/sh to invoke the system's POSIX shell
- Test on multiple shells: dash (Debian/Ubuntu default), ash (Alpine/BusyBox), bash --posix
- Avoid GNU-specific options; use POSIX-specified flags only
- Handle platform differences:
uname -s for OS detection
- Use
command -v instead of which (more portable)
- Check for command availability:
command -v cmd >/dev/null 2>&1 || exit 1
- Provide portable implementations for missing utilities
- Use
[ -e "$file" ] for existence checks (works on all systems)
- Avoid
/dev/stdin, /dev/stdout (not universally available)
- Use explicit redirection instead of
&> (bash-specific)
Imported: Readability & Maintainability
- Use descriptive variable names in UPPER_CASE for exports, lower_case for locals
- Add section headers with comment blocks for organization
- Keep functions under 50 lines; extract complex logic
- Use consistent indentation (spaces only, typically 2 or 4)
- Document function purpose and parameters in comments
- Use meaningful names:
validate_input not check
- Add comments for non-obvious POSIX workarounds
- Group related functions with descriptive headers
- Extract repeated code into functions
- Use blank lines to separate logical sections
Imported: Safety & Security Patterns
- Quote all variable expansions to prevent word splitting
- Validate file permissions before operations:
[ -r "$file" ] || exit 1
- Sanitize user input before using in commands
- Validate numeric input:
case $num in *[!0-9]*) exit 1 ;; esac
- Never use
eval on untrusted input
- Use
-- to separate options from arguments: rm -- "$file"
- Validate required variables:
[ -n "$VAR" ] || { echo "VAR required" >&2; exit 1; }
- Check exit codes explicitly:
cmd || { echo "failed" >&2; exit 1; }
- Use
trap for cleanup: trap 'rm -f "$tmpfile"' EXIT INT TERM
- Set restrictive umask for sensitive files:
umask 077
- Log security-relevant operations to syslog or file
- Validate file paths don't contain unexpected characters
- Use full paths for commands in security-critical scripts:
/bin/rm not rm
Imported: Performance Optimization
- Use shell built-ins over external commands when possible
- Avoid spawning subshells in loops: use
while read not for i in $(cat)
- Cache command results in variables instead of repeated execution
- Use
case for multiple string comparisons (faster than repeated if)
- Process files line-by-line for large files
- Use
expr or $(( )) for arithmetic (POSIX supports $(( )))
- Minimize external command calls in tight loops
- Use
grep -q when you only need true/false (faster than capturing output)
- Batch similar operations together
- Use here-documents for multi-line strings instead of multiple echo calls
Imported: Documentation Standards
- Implement
-h flag for help (avoid --help without proper parsing)
- Include usage message showing synopsis and options
- Document required vs optional arguments clearly
- List exit codes: 0=success, 1=error, specific codes for specific failures
- Document prerequisites and required commands
- Add header comment with script purpose and author
- Include examples of common usage patterns
- Document environment variables used by script
- Provide troubleshooting guidance for common issues
- Note POSIX compliance in documentation
Imported: Working Without Arrays
Since POSIX sh lacks arrays, use these patterns:
- Positional Parameters:
set -- item1 item2 item3; for arg; do echo "$arg"; done
- Delimited Strings:
items="a:b:c"; IFS=:; set -- $items; IFS=' '
- Newline-Separated:
items="a\nb\nc"; while IFS= read -r item; do echo "$item"; done <<EOF
- Counters:
i=0; while [ $i -lt 10 ]; do i=$((i+1)); done
- Field Splitting: Use
cut, awk, or parameter expansion for string splitting
Imported: Portable Conditionals
Use [ ] test command with POSIX operators:
- File Tests:
[ -e file ] exists, [ -f file ] regular file, [ -d dir ] directory
- String Tests:
[ -z "$str" ] empty, [ -n "$str" ] not empty, [ "$a" = "$b" ] equal
- Numeric Tests:
[ "$a" -eq "$b" ] equal, [ "$a" -lt "$b" ] less than
- Logical:
[ cond1 ] && [ cond2 ] AND, [ cond1 ] || [ cond2 ] OR
- Negation:
[ ! -f file ] not a file
- Pattern Matching: Use
case not [[ =~ ]]
Imported: CI/CD Integration
- Matrix testing: Test across dash, ash, bash --posix, yash on Linux, macOS, Alpine
- Container testing: Use alpine:latest (ash), debian:stable (dash) for reproducible tests
- Pre-commit hooks: Configure checkbashisms, shellcheck -s sh, shfmt -ln posix
- GitHub Actions: Use shellcheck-problem-matchers with POSIX mode
- Cross-platform validation: Test on Linux, macOS, FreeBSD, NetBSD
- BusyBox testing: Validate on BusyBox environments for embedded systems
- Automated releases: Tag versions and generate portable distribution packages
- Coverage tracking: Ensure test coverage across all POSIX shells
- Example workflow:
shellcheck -s sh *.sh && shfmt -ln posix -d *.sh && checkbashisms *.sh
Imported: Embedded Systems & Limited Environments
- BusyBox compatibility: Test with BusyBox's limited ash implementation
- Alpine Linux: Default shell is BusyBox ash, not bash
- Resource constraints: Minimize memory usage, avoid spawning excessive processes
- Missing utilities: Provide fallbacks when common tools unavailable (
mktemp, seq)
- Read-only filesystems: Handle scenarios where
/tmp may be restricted
- No coreutils: Some environments lack GNU coreutils extensions
- Signal handling: Limited signal support in minimal environments
- Startup scripts: Init scripts must be POSIX for maximum compatibility
- Example: Check for mktemp:
command -v mktemp >/dev/null 2>&1 || mktemp() { ... }
Imported: Migration from Bash to POSIX sh
- Assessment: Run
checkbashisms to identify bash-specific constructs
- Array elimination: Convert arrays to delimited strings or positional parameters
- Conditional updates: Replace
[[ with [ and adjust regex to case patterns
- Local variables: Remove
local keyword, use function prefixes instead
- Process substitution: Replace
<() with temporary files or pipes
- Parameter expansion: Use
sed/awk for complex string manipulation
- Testing strategy: Incremental conversion with continuous validation
- Documentation: Note any POSIX limitations or workarounds
- Gradual migration: Convert one function at a time, test thoroughly
- Fallback support: Maintain dual implementations during transition if needed
Imported: Quality Checklist
- Scripts pass ShellCheck with
-s sh flag (POSIX mode)
- Code is formatted consistently with shfmt using
-ln posix
- Test on multiple shells: dash, ash, bash --posix, yash
- All variable expansions are properly quoted
- No bash-specific features used (arrays,
[[, local, etc.)
- Error handling covers all failure modes
- Temporary resources cleaned up with EXIT trap
- Scripts provide clear usage information
- Input validation prevents injection attacks
- Scripts portable across Unix-like systems (Linux, BSD, Solaris, macOS, Alpine)
- BusyBox compatibility validated for embedded use cases
- No GNU-specific extensions or flags used
Imported: Output
- POSIX-compliant shell scripts maximizing portability
- Test suites using shellspec or bats-core validating across dash, ash, yash
- CI/CD configurations for multi-shell matrix testing
- Portable implementations of common patterns with fallbacks
- Documentation on POSIX limitations and workarounds with examples
- Migration guides for converting bash scripts to POSIX sh incrementally
- Cross-platform compatibility matrices (Linux, BSD, macOS, Solaris, Alpine)
- Performance benchmarks comparing different POSIX shells
- Fallback implementations for missing utilities (mktemp, seq, timeout)
- BusyBox-compatible scripts for embedded and container environments
- Package distributions for various platforms without bash dependency
Imported: Essential Tools
Static Analysis & Formatting
- ShellCheck: Static analyzer with
-s sh for POSIX mode validation
- shfmt: Shell formatter with
-ln posix option for POSIX syntax
- checkbashisms: Detects bash-specific constructs in scripts (from devscripts)
- Semgrep: SAST with POSIX-specific security rules
- CodeQL: Security scanning for shell scripts
POSIX Shell Implementations for Testing
- dash: Debian Almquist Shell - lightweight, strict POSIX compliance (primary test target)
- ash: Almquist Shell - BusyBox default, embedded systems
- yash: Yet Another Shell - strict POSIX conformance validation
- posh: Policy-compliant Ordinary Shell - Debian policy compliance
- osh: Oil Shell - modern POSIX-compatible shell with better error messages
- bash --posix: GNU Bash in POSIX mode for compatibility testing
Testing Frameworks
- bats-core: Bash testing framework (works with POSIX sh)
- shellspec: BDD-style testing that supports POSIX sh
- shunit2: xUnit-style framework with POSIX sh support
- sharness: Test framework used by Git (POSIX-compatible)
Imported: Common Pitfalls to Avoid
- Using
[[ instead of [ (bash-specific)
- Using arrays (not in POSIX sh)
- Using
local keyword (bash/ksh extension)
- Using
echo without printf (behavior varies across implementations)
- Using
source instead of . for sourcing scripts
- Using bash-specific parameter expansion:
${var//pattern/replacement}
- Using process substitution
<() or >()
- Using
function keyword (ksh/bash syntax)
- Using
$RANDOM variable (not in POSIX)
- Using
read -a for arrays (bash-specific)
- Using
set -o pipefail (bash-specific)
- Using
&> for redirection (use >file 2>&1)
Imported: Advanced Techniques
- Error Trapping:
trap 'echo "Error at line $LINENO" >&2; exit 1' EXIT; trap - EXIT on success
- Safe Temp Files:
tmpfile=$(mktemp) || exit 1; trap 'rm -f "$tmpfile"' EXIT INT TERM
- Simulating Arrays:
set -- item1 item2 item3; for arg; do process "$arg"; done
- Field Parsing:
IFS=:; while read -r user pass uid gid; do ...; done < /etc/passwd
- String Replacement:
echo "$str" | sed 's/old/new/g' or use parameter expansion ${str%suffix}
- Default Values:
value=${var:-default} assigns default if var unset or null
- Portable Functions: Avoid
function keyword, use func_name() { ... }
- Subshell Isolation:
(cd dir && cmd) changes directory without affecting parent
- Here-documents:
cat <<'EOF' with quotes prevents variable expansion
- Command Existence:
command -v cmd >/dev/null 2>&1 && echo "found" || echo "missing"
Imported: POSIX-Specific Best Practices
- Always quote variable expansions:
"$var" not $var
- Use
[ ] with proper spacing: [ "$a" = "$b" ] not ["$a"="$b"]
- Use
= for string comparison, not == (bash extension)
- Use
. for sourcing, not source
- Use
printf for all output, avoid echo -e or echo -n
- Use
$(( )) for arithmetic, not let or declare -i
- Use
case for pattern matching, not [[ =~ ]]
- Test scripts with
sh -n script.sh to check syntax
- Use
command -v not type or which for portability
- Explicitly handle all error conditions with
|| exit 1
Imported: Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: posix-shell-pro-v23description: posix-shell-pro workflow skill. Use this skill when the user needs Expert in strict POSIX sh scripting for maximum portability across Unix-like systems. Specializes in shell scripts that run on any POSIX-compliant shell (dash, ash, sh, bash --posix) and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.4---56# posix-shell-pro78## Overview910This public intake copy packages `plugins/antigravity-awesome-skills/skills/posix-shell-pro` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin.1112Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.1314This intake keeps the copied upstream files intact and uses the `external_source` block in `metadata.json` plus `ORIGIN.md` as the provenance anchor for review.1516Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Focus Areas, POSIX Constraints, Approach, Compatibility & Portability, Readability & Maintainability, Safety & Security Patterns.1718## When to Use This Skill1920Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.2122- Working on posix shell pro tasks or workflows23- Needing guidance, best practices, or checklists for posix shell pro24- The task is unrelated to posix shell pro25- You need a different domain or tool outside this scope26- Use when provenance needs to stay visible in the answer, PR, or review packet.27- Use when copied upstream references, examples, or scripts materially improve the answer.2829## Operating Table3031| Situation | Start here | Why it matters |32| --- | --- | --- |33| First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow |34| Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source |35| Workflow execution | `SKILL.md` | Starts with the smallest copied file that materially changes execution |36| Supporting context | `SKILL.md` | Adds the next most relevant copied source file without loading the entire package |37| Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts |3839## Workflow4041This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.42431. Clarify goals, constraints, and required inputs.442. Apply relevant best practices and validate outcomes.453. Provide actionable steps and verification.464. If detailed examples are required, open resources/implementation-playbook.md.475. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.486. Read the overview and provenance files before loading any copied upstream support files.497. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.5051### Imported Workflow Notes5253#### Imported: Instructions5455- Clarify goals, constraints, and required inputs.56- Apply relevant best practices and validate outcomes.57- Provide actionable steps and verification.58- If detailed examples are required, open `resources/implementation-playbook.md`.5960#### Imported: Focus Areas6162- Strict POSIX compliance for maximum portability63- Shell-agnostic scripting that works on any Unix-like system64- Defensive programming with portable error handling65- Safe argument parsing without bash-specific features66- Portable file operations and resource management67- Cross-platform compatibility (Linux, BSD, Solaris, AIX, macOS)68- Testing with dash, ash, and POSIX mode validation69- Static analysis with ShellCheck in POSIX mode70- Minimalist approach using only POSIX-specified features71- Compatibility with legacy systems and embedded environments7273## Examples7475### Example 1: Ask for the upstream workflow directly7677```text78Use @posix-shell-pro-v2 to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.79```8081**Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository.8283### Example 2: Ask for a provenance-grounded review8485```text86Review @posix-shell-pro-v2 against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.87```8889**Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.9091### Example 3: Narrow the copied support files before execution9293```text94Use @posix-shell-pro-v2 for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.95```9697**Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.9899### Example 4: Build a reviewer packet100101```text102Review @posix-shell-pro-v2 using the copied upstream files plus provenance, then summarize any gaps before merge.103```104105**Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet.106107108109## Best Practices110111Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.112113- Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.114- Prefer the smallest useful set of support files so the workflow stays auditable and fast to review.115- Keep provenance, source commit, and imported file paths visible in notes and PR descriptions.116- Point directly at the copied upstream files that justify the workflow instead of relying on generic review boilerplate.117- Treat generated examples as scaffolding; adapt them to the concrete task before execution.118- Route to a stronger native skill when architecture, debugging, design, or security concerns become dominant.119120121122## Troubleshooting123124### Problem: The operator skipped the imported context and answered too generically125126**Symptoms:** The result ignores the upstream workflow in `plugins/antigravity-awesome-skills/skills/posix-shell-pro`, fails to mention provenance, or does not use any copied source files at all.127**Solution:** Re-open `metadata.json`, `ORIGIN.md`, and the most relevant copied upstream files. Check the `external_source` block first, then restate the provenance before continuing.128129### Problem: The imported workflow feels incomplete during review130131**Symptoms:** Reviewers can see the generated `SKILL.md`, but they cannot quickly tell which references, examples, or scripts matter for the current task.132**Solution:** Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.133134### Problem: The task drifted into a different specialization135136**Symptoms:** The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better.137**Solution:** Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.138139140141## Related Skills142143- `@00-andruia-consultant` - Use when the work is better handled by that native specialization after this imported skill establishes context.144- `@00-andruia-consultant-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.145- `@10-andruia-skill-smith` - Use when the work is better handled by that native specialization after this imported skill establishes context.146- `@10-andruia-skill-smith-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.147148## Additional Resources149150Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.151152| Resource family | What it gives the reviewer | Example path |153| --- | --- | --- |154| `references` | copied reference notes, guides, or background material from upstream | `references/n/a` |155| `examples` | worked examples or reusable prompts copied from upstream | `examples/n/a` |156| `scripts` | upstream helper scripts that change execution or validation | `scripts/n/a` |157| `agents` | routing or delegation notes that are genuinely part of the imported package | `agents/n/a` |158| `assets` | supporting assets or schemas copied from the source package | `assets/n/a` |159160161162### Imported Reference Notes163164#### Imported: References & Further Reading165166### POSIX Standards & Specifications167- [POSIX Shell Command Language](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html) - Official POSIX.1-2024 specification168- [POSIX Utilities](https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html) - Complete list of POSIX-mandated utilities169- [Autoconf Portable Shell Programming](https://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell) - Comprehensive portability guide from GNU170171### Portability & Best Practices172- [Rich's sh (POSIX shell) tricks](http://www.etalabs.net/sh_tricks.html) - Advanced POSIX shell techniques173- [Suckless Shell Style Guide](https://suckless.org/coding_style/) - Minimalist POSIX sh patterns174- [FreeBSD Porter's Handbook - Shell](https://docs.freebsd.org/en/books/porters-handbook/makefiles/#porting-shlibs) - BSD portability considerations175176### Tools & Testing177- [checkbashisms](https://manpages.debian.org/testing/devscripts/checkbashisms.1.en.html) - Detect bash-specific constructs178179#### Imported: POSIX Constraints180181- No arrays (use positional parameters or delimited strings)182- No `[[` conditionals (use `[` test command only)183- No process substitution `<()` or `>()`184- No brace expansion `{1..10}`185- No `local` keyword (use function-scoped variables carefully)186- No `declare`, `typeset`, or `readonly` for variable attributes187- No `+=` operator for string concatenation188- No `${var//pattern/replacement}` substitution189- No associative arrays or hash tables190- No `source` command (use `.` for sourcing files)191192#### Imported: Approach193194- Always use `#!/bin/sh` shebang for POSIX shell195- Use `set -eu` for error handling (no `pipefail` in POSIX)196- Quote all variable expansions: `"$var"` never `$var`197- Use `[ ]` for all conditional tests, never `[[`198- Implement argument parsing with `while` and `case` (no `getopts` for long options)199- Create temporary files safely with `mktemp` and cleanup traps200- Use `printf` instead of `echo` for all output (echo behavior varies)201- Use `. script.sh` instead of `source script.sh` for sourcing202- Implement error handling with explicit `|| exit 1` checks203- Design scripts to be idempotent and support dry-run modes204- Use `IFS` manipulation carefully and restore original value205- Validate inputs with `[ -n "$var" ]` and `[ -z "$var" ]` tests206- End option parsing with `--` and use `rm -rf -- "$dir"` for safety207- Use command substitution `$()` instead of backticks for readability208- Implement structured logging with timestamps using `date`209- Test scripts with dash/ash to verify POSIX compliance210211#### Imported: Compatibility & Portability212213- Use `#!/bin/sh` to invoke the system's POSIX shell214- Test on multiple shells: dash (Debian/Ubuntu default), ash (Alpine/BusyBox), bash --posix215- Avoid GNU-specific options; use POSIX-specified flags only216- Handle platform differences: `uname -s` for OS detection217- Use `command -v` instead of `which` (more portable)218- Check for command availability: `command -v cmd >/dev/null 2>&1 || exit 1`219- Provide portable implementations for missing utilities220- Use `[ -e "$file" ]` for existence checks (works on all systems)221- Avoid `/dev/stdin`, `/dev/stdout` (not universally available)222- Use explicit redirection instead of `&>` (bash-specific)223224#### Imported: Readability & Maintainability225226- Use descriptive variable names in UPPER_CASE for exports, lower_case for locals227- Add section headers with comment blocks for organization228- Keep functions under 50 lines; extract complex logic229- Use consistent indentation (spaces only, typically 2 or 4)230- Document function purpose and parameters in comments231- Use meaningful names: `validate_input` not `check`232- Add comments for non-obvious POSIX workarounds233- Group related functions with descriptive headers234- Extract repeated code into functions235- Use blank lines to separate logical sections236237#### Imported: Safety & Security Patterns238239- Quote all variable expansions to prevent word splitting240- Validate file permissions before operations: `[ -r "$file" ] || exit 1`241- Sanitize user input before using in commands242- Validate numeric input: `case $num in *[!0-9]*) exit 1 ;; esac`243- Never use `eval` on untrusted input244- Use `--` to separate options from arguments: `rm -- "$file"`245- Validate required variables: `[ -n "$VAR" ] || { echo "VAR required" >&2; exit 1; }`246- Check exit codes explicitly: `cmd || { echo "failed" >&2; exit 1; }`247- Use `trap` for cleanup: `trap 'rm -f "$tmpfile"' EXIT INT TERM`248- Set restrictive umask for sensitive files: `umask 077`249- Log security-relevant operations to syslog or file250- Validate file paths don't contain unexpected characters251- Use full paths for commands in security-critical scripts: `/bin/rm` not `rm`252253#### Imported: Performance Optimization254255- Use shell built-ins over external commands when possible256- Avoid spawning subshells in loops: use `while read` not `for i in $(cat)`257- Cache command results in variables instead of repeated execution258- Use `case` for multiple string comparisons (faster than repeated `if`)259- Process files line-by-line for large files260- Use `expr` or `$(( ))` for arithmetic (POSIX supports `$(( ))`)261- Minimize external command calls in tight loops262- Use `grep -q` when you only need true/false (faster than capturing output)263- Batch similar operations together264- Use here-documents for multi-line strings instead of multiple echo calls265266#### Imported: Documentation Standards267268- Implement `-h` flag for help (avoid `--help` without proper parsing)269- Include usage message showing synopsis and options270- Document required vs optional arguments clearly271- List exit codes: 0=success, 1=error, specific codes for specific failures272- Document prerequisites and required commands273- Add header comment with script purpose and author274- Include examples of common usage patterns275- Document environment variables used by script276- Provide troubleshooting guidance for common issues277- Note POSIX compliance in documentation278279#### Imported: Working Without Arrays280281Since POSIX sh lacks arrays, use these patterns:282283- **Positional Parameters**: `set -- item1 item2 item3; for arg; do echo "$arg"; done`284- **Delimited Strings**: `items="a:b:c"; IFS=:; set -- $items; IFS=' '`285- **Newline-Separated**: `items="a\nb\nc"; while IFS= read -r item; do echo "$item"; done <<EOF`286- **Counters**: `i=0; while [ $i -lt 10 ]; do i=$((i+1)); done`287- **Field Splitting**: Use `cut`, `awk`, or parameter expansion for string splitting288289#### Imported: Portable Conditionals290291Use `[ ]` test command with POSIX operators:292293- **File Tests**: `[ -e file ]` exists, `[ -f file ]` regular file, `[ -d dir ]` directory294- **String Tests**: `[ -z "$str" ]` empty, `[ -n "$str" ]` not empty, `[ "$a" = "$b" ]` equal295- **Numeric Tests**: `[ "$a" -eq "$b" ]` equal, `[ "$a" -lt "$b" ]` less than296- **Logical**: `[ cond1 ] && [ cond2 ]` AND, `[ cond1 ] || [ cond2 ]` OR297- **Negation**: `[ ! -f file ]` not a file298- **Pattern Matching**: Use `case` not `[[ =~ ]]`299300#### Imported: CI/CD Integration301302- **Matrix testing**: Test across dash, ash, bash --posix, yash on Linux, macOS, Alpine303- **Container testing**: Use alpine:latest (ash), debian:stable (dash) for reproducible tests304- **Pre-commit hooks**: Configure checkbashisms, shellcheck -s sh, shfmt -ln posix305- **GitHub Actions**: Use shellcheck-problem-matchers with POSIX mode306- **Cross-platform validation**: Test on Linux, macOS, FreeBSD, NetBSD307- **BusyBox testing**: Validate on BusyBox environments for embedded systems308- **Automated releases**: Tag versions and generate portable distribution packages309- **Coverage tracking**: Ensure test coverage across all POSIX shells310- Example workflow: `shellcheck -s sh *.sh && shfmt -ln posix -d *.sh && checkbashisms *.sh`311312#### Imported: Embedded Systems & Limited Environments313314- **BusyBox compatibility**: Test with BusyBox's limited ash implementation315- **Alpine Linux**: Default shell is BusyBox ash, not bash316- **Resource constraints**: Minimize memory usage, avoid spawning excessive processes317- **Missing utilities**: Provide fallbacks when common tools unavailable (`mktemp`, `seq`)318- **Read-only filesystems**: Handle scenarios where `/tmp` may be restricted319- **No coreutils**: Some environments lack GNU coreutils extensions320- **Signal handling**: Limited signal support in minimal environments321- **Startup scripts**: Init scripts must be POSIX for maximum compatibility322- Example: Check for mktemp: `command -v mktemp >/dev/null 2>&1 || mktemp() { ... }`323324#### Imported: Migration from Bash to POSIX sh325326- **Assessment**: Run `checkbashisms` to identify bash-specific constructs327- **Array elimination**: Convert arrays to delimited strings or positional parameters328- **Conditional updates**: Replace `[[` with `[` and adjust regex to `case` patterns329- **Local variables**: Remove `local` keyword, use function prefixes instead330- **Process substitution**: Replace `<()` with temporary files or pipes331- **Parameter expansion**: Use `sed`/`awk` for complex string manipulation332- **Testing strategy**: Incremental conversion with continuous validation333- **Documentation**: Note any POSIX limitations or workarounds334- **Gradual migration**: Convert one function at a time, test thoroughly335- **Fallback support**: Maintain dual implementations during transition if needed336337#### Imported: Quality Checklist338339- Scripts pass ShellCheck with `-s sh` flag (POSIX mode)340- Code is formatted consistently with shfmt using `-ln posix`341- Test on multiple shells: dash, ash, bash --posix, yash342- All variable expansions are properly quoted343- No bash-specific features used (arrays, `[[`, `local`, etc.)344- Error handling covers all failure modes345- Temporary resources cleaned up with EXIT trap346- Scripts provide clear usage information347- Input validation prevents injection attacks348- Scripts portable across Unix-like systems (Linux, BSD, Solaris, macOS, Alpine)349- BusyBox compatibility validated for embedded use cases350- No GNU-specific extensions or flags used351352#### Imported: Output353354- POSIX-compliant shell scripts maximizing portability355- Test suites using shellspec or bats-core validating across dash, ash, yash356- CI/CD configurations for multi-shell matrix testing357- Portable implementations of common patterns with fallbacks358- Documentation on POSIX limitations and workarounds with examples359- Migration guides for converting bash scripts to POSIX sh incrementally360- Cross-platform compatibility matrices (Linux, BSD, macOS, Solaris, Alpine)361- Performance benchmarks comparing different POSIX shells362- Fallback implementations for missing utilities (mktemp, seq, timeout)363- BusyBox-compatible scripts for embedded and container environments364- Package distributions for various platforms without bash dependency365366#### Imported: Essential Tools367368### Static Analysis & Formatting369- **ShellCheck**: Static analyzer with `-s sh` for POSIX mode validation370- **shfmt**: Shell formatter with `-ln posix` option for POSIX syntax371- **checkbashisms**: Detects bash-specific constructs in scripts (from devscripts)372- **Semgrep**: SAST with POSIX-specific security rules373- **CodeQL**: Security scanning for shell scripts374375### POSIX Shell Implementations for Testing376- **dash**: Debian Almquist Shell - lightweight, strict POSIX compliance (primary test target)377- **ash**: Almquist Shell - BusyBox default, embedded systems378- **yash**: Yet Another Shell - strict POSIX conformance validation379- **posh**: Policy-compliant Ordinary Shell - Debian policy compliance380- **osh**: Oil Shell - modern POSIX-compatible shell with better error messages381- **bash --posix**: GNU Bash in POSIX mode for compatibility testing382383### Testing Frameworks384- **bats-core**: Bash testing framework (works with POSIX sh)385- **shellspec**: BDD-style testing that supports POSIX sh386- **shunit2**: xUnit-style framework with POSIX sh support387- **sharness**: Test framework used by Git (POSIX-compatible)388389#### Imported: Common Pitfalls to Avoid390391- Using `[[` instead of `[` (bash-specific)392- Using arrays (not in POSIX sh)393- Using `local` keyword (bash/ksh extension)394- Using `echo` without `printf` (behavior varies across implementations)395- Using `source` instead of `.` for sourcing scripts396- Using bash-specific parameter expansion: `${var//pattern/replacement}`397- Using process substitution `<()` or `>()`398- Using `function` keyword (ksh/bash syntax)399- Using `$RANDOM` variable (not in POSIX)400- Using `read -a` for arrays (bash-specific)401- Using `set -o pipefail` (bash-specific)402- Using `&>` for redirection (use `>file 2>&1`)403404#### Imported: Advanced Techniques405406- **Error Trapping**: `trap 'echo "Error at line $LINENO" >&2; exit 1' EXIT; trap - EXIT` on success407- **Safe Temp Files**: `tmpfile=$(mktemp) || exit 1; trap 'rm -f "$tmpfile"' EXIT INT TERM`408- **Simulating Arrays**: `set -- item1 item2 item3; for arg; do process "$arg"; done`409- **Field Parsing**: `IFS=:; while read -r user pass uid gid; do ...; done < /etc/passwd`410- **String Replacement**: `echo "$str" | sed 's/old/new/g'` or use parameter expansion `${str%suffix}`411- **Default Values**: `value=${var:-default}` assigns default if var unset or null412- **Portable Functions**: Avoid `function` keyword, use `func_name() { ... }`413- **Subshell Isolation**: `(cd dir && cmd)` changes directory without affecting parent414- **Here-documents**: `cat <<'EOF'` with quotes prevents variable expansion415- **Command Existence**: `command -v cmd >/dev/null 2>&1 && echo "found" || echo "missing"`416417#### Imported: POSIX-Specific Best Practices418419- Always quote variable expansions: `"$var"` not `$var`420- Use `[ ]` with proper spacing: `[ "$a" = "$b" ]` not `["$a"="$b"]`421- Use `=` for string comparison, not `==` (bash extension)422- Use `.` for sourcing, not `source`423- Use `printf` for all output, avoid `echo -e` or `echo -n`424- Use `$(( ))` for arithmetic, not `let` or `declare -i`425- Use `case` for pattern matching, not `[[ =~ ]]`426- Test scripts with `sh -n script.sh` to check syntax427- Use `command -v` not `type` or `which` for portability428- Explicitly handle all error conditions with `|| exit 1`429430#### Imported: Limitations431432- Use this skill only when the task clearly matches the scope described above.433- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.434- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.