One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill shell-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/shell
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill shell-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The shell skill prevents long-running or hanging shell commands from stalling your workflow by adding execution-time visibility and timeout protection.

Core Features & Use Cases

  • Execution time visibility: Uses time to capture how long commands take for performance monitoring and debugging.
  • Timeout enforcement: Uses timeout to cap runtime and reduce the risk of indefinite hangs during builds, tests, and deployments.
  • Safer operation patterns: Highlights common pitfalls like masked exit codes, overly aggressive timeouts, and runaway child processes so results remain trustworthy.

Quick Start

Use the shell skill when running a potentially slow build by executing time timeout 300s build_script.sh to measure performance and stop the command if it exceeds the limit.

Frequently Asked Questions about shell

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

FAQPage Schema
How do I prevent shell commands from hanging during automated builds and tests?

To prevent shell commands from hanging during automated builds and tests, you can enforce timeout limits around command execution. This caps the runtime and stops indefinite hangs, ensuring your automation workflow continues safely without stalling.

What is the best way to measure command execution time for performance monitoring in shell scripts?

The best way to measure command execution time for performance monitoring in shell scripts is to use the time pattern. This captures exactly how long commands take to run, providing visibility for debugging and performance tracking during long-running operations.

How do I safely handle exit codes when running shell commands with timeouts?

To safely handle exit codes when running shell commands with timeouts, use pipefail and perform explicit exit checks. This prevents masked exit codes and ensures that failures in piped commands are caught, keeping your execution results trustworthy.

Why do my child processes keep running after a timeout kills the parent shell command?

Child processes keep running after a timeout kills the parent shell command because of inappropriate kill behavior. To safely control execution and stop runaway child processes, you must apply appropriate kill behavior patterns when enforcing the timeout limit.

Can I use timeout and time together for long-running deployment scripts?

Yes, you can use timeout and time together for long-running deployment scripts. Combining these patterns allows you to simultaneously enforce a runtime cap to prevent hangs and measure execution duration for performance monitoring.