skills/safety/resource-limiting/SKILL.md
# Resource Limiting Skill Protect shared servers from resource exhaustion during development tasks. ## When to Use - Running tests on a server that hosts other sites - Running migrations on a shared database server - Running any CPU/RAM intensive task on production/staging - When you notice server becoming unresponsive during tasks ## The Problem Development tasks like tests, builds, and migrations can consume 100% CPU/RAM, causing: - Other websites on the server to stop responding - SSH co
npx skillsauth add liauw-media/codeassist skills/safety/resource-limitingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Protect shared servers from resource exhaustion during development tasks.
Development tasks like tests, builds, and migrations can consume 100% CPU/RAM, causing:
For tests (recommended):
nice -n 19 ionice -c 3 vendor/bin/pest --processes=1
nice -n 19 ionice -c 3 npm test
nice -n 19 ionice -c 3 pytest
For any heavy command:
nice -n 19 ionice -c 3 <your-command>
| Tool | Built-in? | What it Does |
|------|-----------|--------------|
| nice -n 19 | Yes | Lowest CPU priority - other processes get CPU first |
| ionice -c 3 | Yes | Lowest I/O priority - other processes get disk first |
| cpulimit -l 50 | No | Hard limit to 50% CPU (install: apt install cpulimit) |
| --processes=1 | N/A | Disable parallel testing |
# Best for shared servers
nice -n 19 ionice -c 3 vendor/bin/pest --processes=1
# If you have cpulimit installed
cpulimit -l 50 -- vendor/bin/pest
nice -n 19 php artisan migrate
nice -n 19 python manage.py migrate
nice -n 19 npm run build
nice -n 19 composer install
nice -n 19 ionice -c 3 php artisan queue:work --once
For Linux servers with systemd:
# Limit to 50% CPU and 1GB RAM
systemd-run --scope -p CPUQuota=50% -p MemoryMax=1G vendor/bin/pest
# Limit to 25% CPU and 512MB RAM
systemd-run --scope -p CPUQuota=25% -p MemoryMax=512M npm test
# Check for web servers
pgrep nginx && echo "Nginx running - shared server likely"
pgrep apache2 && echo "Apache running - shared server likely"
pgrep mysql && echo "MySQL running - shared server likely"
# Check for other PHP processes
pgrep -c php-fpm && echo "PHP-FPM running - shared server"
Rule: If web servers are running, use resource limits.
Before running heavy tasks on shared servers:
nice -n 19 for CPU priorityionice -c 3 for disk I/O priority--processes=1 to disable parallel executionAdd to your project's CLAUDE.md:
## Server Environment
This is a shared server hosting multiple sites.
ALWAYS use resource limits when running tests or heavy tasks:
```bash
nice -n 19 ionice -c 3 vendor/bin/pest --processes=1
## Related Skills
- `database-backup` - Backup before heavy operations
- `defense-in-depth` - Multiple safety layers
development
Use when decomposing complex work. Dispatch fresh subagent per task, review between tasks. Flow: Load plan → Dispatch task → Review output → Apply feedback → Mark complete → Next task. No skipping reviews, no parallel dispatch.
development
# Server Documentation System Set up a documentation system that tracks changes and maintains server/project documentation with Claude Code hooks. ## When to Use - Setting up a new server or development environment - Need to track configuration changes over time - Want automatic documentation of work sessions - Maintaining changelog for infrastructure ## Directory Structure ``` ~/docs/ # User home directory (cross-platform) ├── changelog.md # Global over
development
Delegate tasks to remote Claude Code agent containers for parallel execution, long-running analysis, or resource-intensive operations.
development
Use when working on multiple features simultaneously. Creates isolated workspaces without branch switching, enabling parallel development.