claude-homelab / skills
CLAUDE.md81 starsChanged 8 months agoMITView on GitHub
⚠️ CRITICAL: MANDATORY SKILL USAGE ⚠️ YOU MUST use the plugin-dev:create-plugin skill (NOT optional) when: - Creating ANY new skill in this directory - Need skill structure guidance, templates, or best practices - Setting up SKILL.md, README.md, or skill scripts - Modifying skill patterns or conventions Failure to invoke this skill when creating new skills violates your operational requirements. This directory contains Claude Code skills for homelab service management. Skills provide structured API access to homelab services with consistent patterns…
- Reads credentials
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- bytestashSkill
- gh-address-commentsSkill
- homelab-healthSkill
- homelab-setupSkill
- linkdingSkill
- memosSkill
- notebooklmSkill
- paperless-ngxSkill
- plexSkill
- prowlarrSkill
- qbittorrentSkill
- radarrSkill
- radicaleSkill
- sabnzbdSkill
- sonarrSkill
- tailscaleSkill
- tautulliSkill
- zfsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
49 rules. About 0 are common, 31 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈31
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Every skill MUST have a SKILL.md file with YAML frontmatter and markdown documentation.
- Distinctive: line 74
Metadata (name + description): - Always in context (~100 words)
- Distinctive: line 77
Must include specific trigger phrases
- Distinctive: line 90
No size limits: - only loaded when needed
- Distinctive: line 94
Context window efficiency: Don't waste tokens on content Claude doesn't need
- Very specific: line 112
Keep only syntax and pointers in SKILL.md
- Distinctive: line 132
Use descriptive names that indicate content
- Distinctive: line 158
Follow coding standards from main scripts
- Distinctive: line 159
Test all examples before committing
- Very specific: line 188
Every SKILL.md MUST include this section immediately after the title:
- Distinctive: line 209
Every skill MUST have a README.md file with user-facing documentation.
- Very specific: line 228
All skills MUST use .env file for credentials.
- Distinctive: line 286
All scripts must follow these conventions:
- Very specific: line 302
Use set -euo pipefail (strict mode)
- Distinctive: line 304
Use functions for reusable code
- Very specific: line 307
Use jq for JSON parsing
- Very specific: line 355
Use .mjs extension for ESM modules
- Very specific: line 356
Use import syntax (NOT require)
- Distinctive: line 357
Use async/await for I/O operations
- Very specific: line 360
Use fetch API for HTTP requests (Node 18+)
- Very specific: line 408
All skills SHOULD have reference documentation in the references/ directory:
- Very specific: line 528
When updating a skill, commit with a descriptive message referencing the skill name and what changed: git commit -m "skillname: description …
- Distinctive: line 541
All API calls are GET requests
- Distinctive: line 567
Document destructive operations prominently
- Distinctive: line 599
Use exact phrases users might say
- Very specific: line 611
Every SKILL.md MUST include a Workflow section with decision trees for common tasks.
- Distinctive: line 655
When skills return search results, always include external links:
- Distinctive: line 669
All JSON output should be:
- Distinctive: line 672
Use consistent key naming (camelCase)
- Distinctive: line 689
Before adding a skill to production:
- Very specific: line 692
Check permissions: Ensure scripts are executable (chmod +x)
- Very specific: line 693
Validate JSON: Test JSON output with jq
- Distinctive: line 694
Test error handling: Verify errors are caught and reported clearly
- Distinctive: line 695
Test without credentials: Verify graceful failure with helpful message
- Distinctive: line 696
Check documentation: Verify all sections are complete
- Distinctive: line 697
Test destructive operations: Verify confirmation prompts work
- Distinctive: line 746
Update YAML frontmatter (name, description)
- Distinctive: line 747
Add mandatory skill invocation section (see Core Principles #1)
- Distinctive: line 748
Update all sections with service-specific information
- Distinctive: line 750
Document all commands with examples
- Distinctive: line 754
Update for user-facing documentation
- Very specific: line 759
Use consistent naming (service-api.sh or action.sh)
- Distinctive: line 774
Run all scripts manually
- Very specific: line 780
Add skill entry to skills/references/skill-catalog.md
- Very specific: line 844
Run ls skills/ to see all available skill directories.
- Distinctive: line 871
Never log credentials (even in debug mode)
- Very specific: line 872
Use ONLY .env file for secrets (NO JSON config files)
- Distinctive: line 876
Always validate environment variables exist before use
- Distinctive: line 882
Use pagination for large result sets
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skills Directory - Development Guidelines
⚠️ CRITICAL: MANDATORY SKILL USAGE ⚠️
YOU MUST use the plugin-dev:create-plugin skill (NOT optional) when:
- Creating ANY new skill in this directory
- Need skill structure guidance, templates, or best practices
- Setting up SKILL.md, README.md, or skill scripts
- Modifying skill patterns or conventions
Failure to invoke this skill when creating new skills violates your operational requirements.
This directory contains Claude Code skills for homelab service management. Skills provide structured API access to homelab services with consistent patterns for credentials, documentation, and scripting.
Repository Structure
skills/
├── CLAUDE.md # This file - development guidelines
├── <service>/ # One directory per service (lowercase)
│ ├── SKILL.md # Skill definition (REQUIRED)
│ ├── README.md # User documentation (REQUIRED)
│ ├── scripts/ # Executable scripts
│ │ ├── *.sh # Bash scripts (with shebang)
│ │ ├── *.mjs # Node.js ESM scripts
│ │ └── *.js # Node.js scripts (if needed)
│ ├── references/ # Reference documentation
│ │ ├── api-endpoints.md # Complete API reference (REST APIs)
│ │ ├── command-reference.md # Complete command reference (CLI tools)
│ │ ├── quick-reference.md # Quick command examples
│ │ └── troubleshooting.md # Common issues and solutions
│ └── examples/ # Example usage scripts (optional)Core Principles
1. Skill Definition (SKILL.md)
Every skill MUST have a SKILL.md file with YAML frontmatter and markdown documentation.
Required frontmatter fields:
---
name: service-name # lowercase, no spaces, matches directory name
description: Detailed description with trigger phrases. Use when the user asks to "trigger phrase 1", "trigger phrase 2", or mentions [context].
---Optional frontmatter fields:
---
homepage: https://example.com # Official project website (optional)
---Required markdown sections:
- Title —
# Service Name Skill - ⚠️ Mandatory Skill Invocation Warning — CRITICAL REQUIREMENT (see below)
- Purpose — What the skill does, read-only vs read-write
- Setup — Credential configuration with exact file paths
- Commands — Copy-paste ready examples
- Workflow — Common use cases with decision trees
- Notes — Technical details, limitations, security considerations
- Reference — Links to official documentation
Progressive Disclosure Pattern
CRITICAL PRINCIPLE: Skills use a three-level loading system to manage context efficiently.
Loading Levels
- Metadata (name + description) - Always in context (~100 words)
- Loaded automatically when Claude Code starts
- Used to determine when to activate the skill
- Must include specific trigger phrases
- SKILL.md body - Loaded when skill activates (~2,000 words max)
- Condensed syntax reference and workflows
- Essential commands with brief examples
- Pointers to reference files for details
- Target length: 200-300 lines (~2,000 words)
- Maximum: 500 lines (~5,000 words) before requiring refactoring
- Bundled resources - Loaded as needed by Claude
references/files loaded when Claude needs detailed infoexamples/files loaded when user needs working codescripts/executed without loading into context- No size limits - only loaded when needed
Why Progressive Disclosure Matters
- Context window efficiency: Don't waste tokens on content Claude doesn't need
- Faster skill loading: Smaller SKILL.md = faster context loading
- Better discoverability: Detailed content in references is easier to find than buried in long SKILL.md
- Maintenance: Easier to update one reference file than sections scattered in SKILL.md
SKILL.md Length Guidelines
Target structure (~2,000 words):
- Purpose section (30 lines)
- Setup section (20 lines, link to README for details)
- Commands section (40 lines, syntax only, link to references/commands.md)
- RAG section (30 lines, syntax only, link to references/vector-database.md)
- Workflows section (70 lines, keep decision trees)
- Notes section (30 lines, key points only)
- References section (20 lines, links to all reference files)
If SKILL.md exceeds 500 lines:
- Extract detailed content to
references/files - Keep only syntax and pointers in SKILL.md
- Link to reference files for full documentation
References Directory (references/)
Purpose: Detailed documentation loaded as needed by Claude.
Common reference files (choose based on skill type):
references/api-endpoints.md- Complete API reference (for REST API services)references/command-reference.md- Complete command reference (for CLI tools)references/library-reference.md- Library/SDK reference (for programming libraries)references/parameters.md- Parameters organized by categoryreferences/job-management.md- Async operations and job handlingreferences/vector-database.md- RAG/vector DB specificsreferences/quick-reference.md- Copy-paste command examplesreferences/troubleshooting.md- Common errors and solutions
Best practices:
- Each reference file can be 2,000-5,000+ words
- Organize by topic/function, not alphabetically
- Use descriptive names that indicate content
- Cross-reference between files where helpful
- Include examples within reference files
When to create references:
- Detailed API documentation (all endpoints, all parameters)
- Advanced configuration options
- Complex workflows with many steps
- Troubleshooting guides
- Migration guides
- Any content that makes SKILL.md too long
Examples Directory (examples/)
Purpose: Working code examples that users can copy and adapt.
Common example files:
examples/basic-scrape.sh- Simple scraping exampleexamples/rag-pipeline.sh- Complete RAG workflowexamples/batch-processing.sh- Batch operation exampleexamples/monitor-website.sh- Change monitoring example
Best practices:
- Examples are complete, runnable scripts
- Include comments explaining each step
- Use realistic scenarios
- Follow coding standards from main scripts
- Test all examples before committing
When to create examples:
- Common workflows that users request
- Complex multi-step operations
- Integration patterns
- Best practice demonstrations
Scripts Directory (scripts/)
Purpose: Executable utility scripts (not documentation).
Distinction:
- Scripts = Tools for execution (no need to read)
- Examples = Educational code for learning (meant to be read)
Pattern:
skills/service/
├── scripts/ # Utilities for execution
│ ├── api-wrapper.sh
│ └── health-check.sh
└── examples/ # Educational examples
├── basic-usage.sh
└── advanced-workflow.shCRITICAL: Mandatory Skill Invocation Section
Every SKILL.md MUST include this section immediately after the title:
**⚠️ MANDATORY SKILL INVOCATION ⚠️**
**YOU MUST invoke this skill (NOT optional) when the user mentions ANY of these triggers:**
- "trigger phrase 1", "trigger phrase 2", "trigger phrase 3"
- "action phrase 1", "status check phrase", "query phrase"
- Any mention of [service name] or [related functionality]
**Failure to invoke this skill when triggers occur violates your operational requirements.**This section:
- Uses strong enforcement language (MUST, NOT optional, violates requirements)
- Lists specific trigger phrases (5-10 minimum)
- Makes it clear skill invocation is mandatory, not suggestive
- Appears immediately after the skill title, before Purpose section
2. User Documentation (README.md)
Every skill MUST have a README.md file with user-facing documentation.
Structure:
- Title and brief description
- "What It Does" — Bullet list of capabilities
- "Setup" — Step-by-step credential setup
- "Usage Examples" — Copy-paste commands with explanations
- "Workflow" — Real-world usage scenarios
- "Troubleshooting" — Common errors and solutions
- "Notes" — Additional context
Differences from SKILL.md:
- README.md is user-facing (more explanatory, assumes less context)
- SKILL.md is Claude-facing (assumes Claude context, uses trigger phrases)
- README.md can be more verbose and educational
- SKILL.md is optimized for skill activation and API reference
3. Credential Management
All skills MUST use .env file for credentials. NO JSON config files.
Required pattern:
# In ~/.claude-homelab/.env
SERVICE_URL="http://localhost:PORT"
SERVICE_API_KEY="your-api-key"Common patterns:
API Key authentication:
SERVICE_URL="https://service.example.com"
SERVICE_API_KEY="your-api-key-here"Username/Password authentication:
SERVICE_URL="https://service.example.com"
SERVICE_USERNAME="admin"
SERVICE_PASSWORD="secure-password"Multi-server setup:
# Server 1
SERVICE1_URL="http://server1.local:PORT"
SERVICE1_API_KEY="key1"
# Server 2
SERVICE2_URL="http://server2.local:PORT"
SERVICE2_API_KEY="key2"Loading credentials in scripts:
Bash:
# Use the shared load-env library
source ~/.claude-homelab/load-env.sh
load_env_file || exit 1
validate_env_vars "SERVICE_URL" "SERVICE_API_KEY"Node.js: See the full loadEnv() pattern in Script Standards > Node.js Scripts below.
Security requirements:
- ✅
.envfile is gitignored (NEVER commit) - ✅ Set file permissions:
chmod 600 ~/.claude-homelab/.env - ✅ NEVER log credentials (even in debug mode)
- ✅ Always validate credentials exist before use
- ✅ Document exact variable names in Setup section
- ❌ NO JSON config files in
credentials/directory - ❌ NO hard-coded credentials in scripts
4. Script Standards
All scripts must follow these conventions:
Bash Scripts (.sh)
File header:
#!/bin/bash
# Script Name: script-name.sh
# Purpose: Brief description
# Usage: ./script-name.sh [arguments]
set -euo pipefailStandards:
- Executable:
chmod +x script.sh - Use
set -euo pipefail(strict mode) - Quote all variables:
"$var" - Use functions for reusable code
- Return JSON output when appropriate
- Include error handling with clear messages
- Use
jqfor JSON parsing - Support
--helpflag
Example:
#!/bin/bash
set -euo pipefail
usage() {
cat <<EOF
Usage: $0 <command> [options]
Commands:
list List all items
search Search for items
add Add new item
Options:
--help Show this help message
EOF
}
main() {
local cmd="${1:-}"
case "$cmd" in
list) list_items ;;
search) search_items "$@" ;;
--help) usage ;;
*) echo "Unknown command: $cmd" >&2; usage; exit 1 ;;
esac
}
main "$@"Node.js Scripts (.mjs)
File header:
#!/usr/bin/env node
/**
* Script Name: script-name.mjs
* Purpose: Brief description
* Usage: node script-name.mjs [arguments]
*/Standards:
- Use
.mjsextension for ESM modules - Use
importsyntax (NOTrequire) - Use async/await for I/O operations
- Return JSON output when appropriate
- Include error handling with clear messages
- Use
fetchAPI for HTTP requests (Node 18+) - Support
--helpflag
Example:
#!/usr/bin/env node
import { readFile } from 'fs/promises';
const ENV_PATH = `${process.env.HOME}/.claude-homelab/.env`;
async function loadEnv() {
try {
const content = await readFile(ENV_PATH, 'utf8');
for (const line of content.split('\n')) {
const match = line.match(/^([^#=]+)=(.+)$/);
if (match) {
const [, key, value] = match;
process.env[key.trim()] = value.trim().replace(/^["']|["']$/g, '');
}
}
} catch (error) {
console.error(`Failed to load .env: ${error.message}`);
process.exit(1);
}
}
async function main() {
await loadEnv();
// Validate required environment variables
const { SERVICE_URL, SERVICE_API_KEY } = process.env;
if (!SERVICE_URL || !SERVICE_API_KEY) {
console.error('ERROR: SERVICE_URL and SERVICE_API_KEY must be set in .env');
process.exit(1);
}
// ... implementation using process.env.SERVICE_URL, etc.
}
main().catch(error => {
console.error(error.message);
process.exit(1);
});5. Reference Documentation
All skills SHOULD have reference documentation in the references/ directory:
api-endpoints.md (for REST API services)
Purpose: Complete API reference with all available endpoints.
Use when: Skill interacts with REST API services (Plex, Overseerr, Radarr, etc.)
Structure:
# Service API Endpoints
## Authentication
[How authentication works]
## Endpoints
### GET /endpoint
**Purpose:** What this endpoint does
**Parameters:**
- `param1` (string, required) - Description
- `param2` (int, optional) - Description
**Response:**
```json
{
"example": "response"
}Example:
curl -X GET "http://localhost/endpoint?param1=value"
#### command-reference.md (for CLI tools)
**Purpose:** Complete command syntax reference for CLI tools.
**Use when:** Skill manages CLI tools (ZFS, git, docker, kubectl, etc.)
**Structure:**
```markdown
# Tool Command Reference
## Command Categories
### command subcommand
**Purpose:** What this command does
**Syntax:**
```bash
command subcommand [options] <required> [optional]Options:
-f, --flag- Description-o, --option value- Description
Examples:
# Example 1
command subcommand --flag value
# Example 2 (with explanation)
command subcommand -o custom file.txtNotes:
- Important caveats
- Platform differences
- Common pitfalls
#### quick-reference.md
**Purpose:** Quick command examples for common operations.
**Structure:**
```markdown
# Service Quick Reference
## Common Tasks
### Task 1
```bash
./scripts/command.sh action --flag valueTask 2
./scripts/command.sh action2 | jq '.data'
#### troubleshooting.md
**Purpose:** Common errors and solutions.
**Structure:**
```markdown
# Service Troubleshooting
## Authentication Errors
**Error:** 401 Unauthorized
**Cause:** Invalid API key
**Solution:** Check API key in config file
## Connection Errors
**Error:** Connection refused
**Cause:** Service not running
**Solution:** Start service with `docker compose up service`6. Updates
When updating a skill, commit with a descriptive message referencing the skill name and what changed: git commit -m "skillname: description of change".
Skill Types
Skills fall into three categories based on their operations:
Read-Only Skills
Monitor and query services without making changes.
Examples: plex, glances, unifi, unraid
Characteristics:
- All API calls are GET requests
- Safe for monitoring and reporting
- No confirmation required
- Clearly labeled as "read-only" in Purpose section
Read-Write Skills (Safe)
Manage services with non-destructive operations.
Examples: overseerr (request media), sonarr (add shows), radarr (add movies)
Characteristics:
- Include POST/PUT requests
- Operations are additive or state-changing
- Require user confirmation for significant actions
- Clearly document which operations modify data
Read-Write Skills (Destructive)
Manage services with potentially destructive operations.
Examples: sonarr (remove shows), radarr (remove movies), qbittorrent (delete torrents)
Characteristics:
- Include DELETE requests or file deletion
- ALWAYS require explicit user confirmation
- Document destructive operations prominently
- Provide
--delete-filesflags (default: keep files)
Pattern for destructive operations:
# Always ask user before running
bash scripts/remove.sh <id> # Keep files (safe)
bash scripts/remove.sh <id> --delete-files # Delete files (destructive)Naming Conventions
| Entity | Format | Examples |
| Skill Directory | lowercase | overseerr/, qbittorrent/, unifi/ |
| Script Files | kebab-case.ext | search-api.sh, request-media.mjs |
| Functions | snake_case | load_config(), search_items() |
| Variables (Bash) | UPPER_SNAKE (const), lower_snake (local) | CONFIG_PATH, api_key |
| Variables (JS) | camelCase | configPath, apiKey |
| JSON Keys | camelCase | {"apiKey": "value"} |
Trigger Phrases
Trigger phrases in SKILL.md descriptions help Claude know when to activate the skill.
Format:
description: [Brief description]. Use when the user asks to "[phrase 1]", "[phrase 2]", "[phrase 3]", or mentions [context].Guidelines:
- Include 5-10 trigger phrases minimum
- Use exact phrases users might say
- Include variations (abbreviations, common typos)
- Include both action-oriented and status-check phrases
- Include service name variations
Example:
description: Search and add movies to Radarr. Use when the user asks to "add a movie", "search Radarr", "find a film", "add to Radarr", "remove a movie", "check if movie exists", "Radarr library", or mentions movie management.Workflow Documentation
Every SKILL.md MUST include a Workflow section with decision trees for common tasks.
Format:
## Workflow
When the user asks about [service]:
1. **"User request 1"** → Action to take
2. **"User request 2"** → Multi-step action
3. **"User request 3"** → Conditional logic
### Detailed Flow for Complex Tasks
1. Step 1
2. Step 2 with conditional: If X, then Y
3. Step 3
4. Confirm with user before proceedingExample:
## Workflow
When the user asks about media requests:
1. **"Request Dune"** → Search for "Dune", confirm with user, then request
2. **"Add Bluey to my library"** → Search, request as TV with all seasons
3. **"What's pending?"** → Run `requests.mjs --filter pending`
4. **"Is my Oppenheimer request done?"** → Search requests by title
### Request Flow
1. Search for the media
2. Present results with TMDB/TVDB links
3. User confirms selection
4. Submit request (optionally with 4K flag)
5. Check status periodically or wait for notificationAPI Documentation Patterns
Presenting Search Results
When skills return search results, always include external links:
Movies (TMDB):
- Format: `[Title (Year)](https://themoviedb.org/movie/ID)`TV Shows (TVDB):
- Format: `[Title (Year)](https://thetvdb.com/series/SLUG)`JSON Response Formatting
All JSON output should be:
- Pretty-printed by default (or offer
--jsonflag for raw) - Include error messages in JSON format
- Use consistent key naming (camelCase)
- Include timestamps when relevant
Example:
{
"success": true,
"data": {
"id": 123,
"name": "Example"
},
"timestamp": "2024-01-01T00:00:00Z"
}Testing New Skills
Before adding a skill to production:
- Dry run: Execute all scripts manually
- Check permissions: Ensure scripts are executable (
chmod +x) - Validate JSON: Test JSON output with
jq - Test error handling: Verify errors are caught and reported clearly
- Test without credentials: Verify graceful failure with helpful message
- Check documentation: Verify all sections are complete
- Test destructive operations: Verify confirmation prompts work
# Test skill script
cd skills/service
chmod +x scripts/*.sh
# Test JSON output
./scripts/list.sh | jq .
# Test error handling (without credentials)
mv ~/.claude-homelab/.env{,.bak}
./scripts/list.sh # Should fail gracefully with clear message
mv ~/.claude-homelab/.env{.bak,}
# Test with debug logging
DEBUG=1 ./scripts/list.shAdding New Skills
Before creating a new skill, INVOKE /plugin-dev:create-plugin skill FIRST.
- Invoke plugin-dev:create-plugin:
You MUST invoke the plugin-dev:create-plugin skill before proceeding. This skill provides templates, structure, and best practices. Creating skills without this skill is NOT allowed. - Create a beads issue before writing code:
bd create --title="Add <service-name> skill" --type=feature --description="Why this skill is needed and what it should do" bd update <id> --claim - Create skill directory:
mkdir -p skills/service-name/{scripts,references} - Copy templates:
# Use existing skill as template cp skills/overseerr/SKILL.md skills/service-name/ cp skills/overseerr/README.md skills/service-name/ - Edit SKILL.md:
- Update YAML frontmatter (name, description)
- Add mandatory skill invocation section (see Core Principles #1)
- Update all sections with service-specific information
- Include 5-10 trigger phrases in description
- Document all commands with examples
- Include workflow decision trees
- Edit README.md:
- Update for user-facing documentation
- More verbose explanations than SKILL.md
- Include troubleshooting section
- Create scripts:
- Use consistent naming (
service-api.shoraction.sh) - Include shebangs and file headers
- Implement error handling
- Return JSON output
- Support
--helpflag
- Use consistent naming (
- Create references:
- Choose based on skill type:
references/api-endpoints.md— For REST API servicesreferences/command-reference.md— For CLI toolsreferences/library-reference.md— For libraries/SDKs
references/quick-reference.md— Quick examplesreferences/troubleshooting.md— Common issues
- Choose based on skill type:
- Test thoroughly:
- Run all scripts manually
- Verify JSON output
- Test error conditions
- Verify documentation completeness
- Update skill catalog:
- Add skill entry to
skills/references/skill-catalog.md - Close the beads issue:
bd close <id>
- Add skill entry to
Multi-Instance Support
Skills that support multiple instances of the same service use numbered environment variables in .env:
Pattern: Multiple servers in .env
# In ~/.claude-homelab/.env
# Server 1
SERVICE1_URL="http://server1.local:PORT"
SERVICE1_API_KEY="key1"
# Server 2
SERVICE2_URL="http://server2.local:PORT"
SERVICE2_API_KEY="key2"
# Server 3
SERVICE3_URL="http://server3.local:PORT"
SERVICE3_API_KEY="key3"Script implementation:
#!/bin/bash
source ~/.claude-homelab/load-env.sh
load_env_file || exit 1
# Default to server 1 if SERVER_NUM not specified
SERVER_NUM="${SERVER_NUM:-1}"
# Construct variable names
URL_VAR="SERVICE${SERVER_NUM}_URL"
KEY_VAR="SERVICE${SERVER_NUM}_API_KEY"
# Use indirect expansion to get values
SERVICE_URL="${!URL_VAR}"
SERVICE_API_KEY="${!KEY_VAR}"
# Validate
if [[ -z "$SERVICE_URL" ]] || [[ -z "$SERVICE_API_KEY" ]]; then
echo "ERROR: ${URL_VAR} and ${KEY_VAR} must be set in .env" >&2
exit 1
fi
# Use $SERVICE_URL and $SERVICE_API_KEY for API callsUsage:
# Use server 1 (default)
./scripts/command.sh
# Use server 2
SERVER_NUM=2 ./scripts/command.sh
# Use server 3
SERVER_NUM=3 ./scripts/command.shCurrent Skills
Run ls skills/ to see all available skill directories. Each directory contains a SKILL.md with its definition.
Best Practices
General Guidelines
- ✅ DO: Store ALL credentials in
~/.claude-homelab/.envfile - ✅ DO: Use environment variable pattern:
SERVICE_URL,SERVICE_API_KEY - ✅ DO: Include trigger phrases in SKILL.md descriptions
- ✅ DO: Document all commands with copy-paste examples
- ✅ DO: Return JSON output for programmatic access
- ✅ DO: Include workflow decision trees
- ✅ DO: Test scripts before committing
- ✅ DO: Use
set -euo pipefailin Bash scripts - ✅ DO: Use ESM imports in Node.js scripts (.mjs)
- ✅ DO: Include error handling with clear messages
- ✅ DO: Support
--helpflag in all scripts - ❌ DON'T: Commit
.envfile (always gitignored) - ❌ DON'T: Use JSON config files in
credentials/directory - ❌ DON'T: Hard-code URLs or API keys in scripts
- ❌ DON'T: Skip YAML frontmatter in SKILL.md
- ❌ DON'T: Create destructive operations without confirmation
- ❌ DON'T: Use default exports in Node.js (use named exports)
- ❌ DON'T: Use
requirein Node.js (useimport)
Security
- Never log credentials (even in debug mode)
- Use ONLY
.envfile for secrets (NO JSON config files) - Set restrictive permissions:
chmod 600 ~/.claude-homelab/.env - Include security notes in SKILL.md for sensitive operations
- Warn users about API key permissions in documentation
- Always validate environment variables exist before use
Performance
- Cache API responses when appropriate
- Include timeouts for HTTP requests
- Use pagination for large result sets
- Support
--limitflags to control output size
User Experience
- Provide clear error messages with actionable solutions
- Include progress indicators for long-running operations
- Return human-readable output by default (JSON as option)
- Include examples for common use cases in documentation
- Present search results with external links for verification
Remember: Consistency in structure, naming, and documentation makes skills easier to maintain and use. Follow these patterns for all new skills.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

