📦 deps(thirdparty): update snapshots
This commit is contained in:
+288
@@ -0,0 +1,288 @@
|
||||
---
|
||||
name: [YOUR_SKILL_NAME]
|
||||
description: [YOUR_DESCRIPTION] - Be specific about what the skill does, when to use it, and include trigger keywords. Example: "Deploy applications to production with automated testing, health checks, and rollback capabilities. Use when deploying, shipping to production, or when users mention deployment, release, or going live."
|
||||
allowed-tools: Read, Bash
|
||||
version: 1.0.0
|
||||
---
|
||||
|
||||
# [YOUR_SKILL_NAME]
|
||||
|
||||
[Brief overview of the skill and its purpose]
|
||||
|
||||
## Overview
|
||||
|
||||
This skill provides automated [CAPABILITY] using helper scripts:
|
||||
- **Feature 1**: [Description]
|
||||
- **Feature 2**: [Description]
|
||||
- **Feature 3**: [Description]
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Using the Helper Script
|
||||
|
||||
The main script is located at `scripts/[script-name].sh`:
|
||||
|
||||
```bash
|
||||
# Basic usage
|
||||
./scripts/[script-name].sh [args]
|
||||
|
||||
# Example
|
||||
./scripts/deploy.sh staging
|
||||
```
|
||||
|
||||
## Core Workflows
|
||||
|
||||
### Workflow 1: [Name]
|
||||
|
||||
**When to use**: [Description of scenario]
|
||||
|
||||
**Steps**:
|
||||
1. Run the helper script:
|
||||
|
||||
```bash
|
||||
bun run ./scripts/[script-name].sh [args]
|
||||
```
|
||||
|
||||
2. The script will:
|
||||
- [Action 1]
|
||||
- [Action 2]
|
||||
- [Action 3]
|
||||
|
||||
3. Verify the result:
|
||||
|
||||
```bash
|
||||
[VERIFICATION_COMMAND]
|
||||
```
|
||||
|
||||
**Example**:
|
||||
|
||||
```bash
|
||||
# Full example workflow
|
||||
[COMPLETE_EXAMPLE]
|
||||
```
|
||||
|
||||
### Workflow 2: [Name]
|
||||
|
||||
**When to use**: [Description]
|
||||
|
||||
**Steps**:
|
||||
[Instructions for second workflow using scripts]
|
||||
|
||||
## Helper Scripts
|
||||
|
||||
### scripts/[script-name].sh
|
||||
|
||||
**Purpose**: [Description of what the script does]
|
||||
|
||||
**Usage**:
|
||||
|
||||
```bash
|
||||
./scripts/[script-name].sh <arg1> [optional-arg2]
|
||||
```
|
||||
|
||||
**Arguments**:
|
||||
- `arg1`: [Description]
|
||||
- `arg2` (optional): [Description]
|
||||
|
||||
**Example**:
|
||||
|
||||
```bash
|
||||
./scripts/[script-name].sh example-arg
|
||||
```
|
||||
|
||||
**Output**:
|
||||
|
||||
```
|
||||
[EXPECTED_OUTPUT]
|
||||
```
|
||||
|
||||
### scripts/[another-script].sh
|
||||
|
||||
**Purpose**: [Description]
|
||||
|
||||
**Usage**:
|
||||
|
||||
```bash
|
||||
./scripts/[another-script].sh [options]
|
||||
```
|
||||
|
||||
**Options**:
|
||||
- `--option1`: [Description]
|
||||
- `--option2`: [Description]
|
||||
|
||||
## Instructions for Claude
|
||||
|
||||
When this skill is activated:
|
||||
|
||||
1. **Understand the request**
|
||||
- Identify which workflow matches the user's needs
|
||||
- Confirm the parameters with the user if unclear
|
||||
|
||||
2. **Use the appropriate script**
|
||||
- Choose the correct helper script for the task
|
||||
- Pass the validated arguments
|
||||
- Use Bash tool to execute
|
||||
|
||||
3. **Handle the output**
|
||||
- Parse the script output
|
||||
- Report results to the user
|
||||
- If errors occur, check script exit code and stderr
|
||||
|
||||
4. **Follow-up actions**
|
||||
- Verify the operation succeeded
|
||||
- Provide next steps to the user
|
||||
- Update relevant documentation if needed
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Always validate inputs before running scripts**
|
||||
- Check required arguments are provided
|
||||
- Verify paths and parameters are valid
|
||||
- Confirm destructive operations with the user
|
||||
|
||||
2. **Monitor script execution**
|
||||
- Watch for error messages
|
||||
- Check exit codes (0 = success, non-zero = error)
|
||||
- Parse output for warnings
|
||||
|
||||
3. **Handle errors gracefully**
|
||||
- Explain what went wrong
|
||||
- Suggest fixes based on error messages
|
||||
- Offer to retry with corrections
|
||||
|
||||
## Script Details
|
||||
|
||||
### Error Handling
|
||||
|
||||
All scripts follow these conventions:
|
||||
- **Exit code 0**: Success
|
||||
- **Exit code 1**: General error
|
||||
- **Exit code 2**: Invalid arguments
|
||||
- **Exit code 3**: [Custom error type]
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Scripts may use these environment variables:
|
||||
- `VAR_1`: [Description]
|
||||
- `VAR_2`: [Description]
|
||||
- `VAR_3`: [Description]
|
||||
|
||||
Set them in `.env` or pass inline:
|
||||
|
||||
```bash
|
||||
VAR_1=value ./scripts/[script-name].sh
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: [Common Use Case]
|
||||
|
||||
**Scenario**: [Description]
|
||||
|
||||
**Commands**:
|
||||
|
||||
```bash
|
||||
# Step 1: [Description]
|
||||
./scripts/[script-name].sh arg1
|
||||
|
||||
# Step 2: [Description]
|
||||
./scripts/[another-script].sh --option
|
||||
|
||||
# Step 3: Verify
|
||||
[VERIFICATION_COMMAND]
|
||||
```
|
||||
|
||||
**Expected Output**:
|
||||
|
||||
```
|
||||
[OUTPUT_EXAMPLE]
|
||||
```
|
||||
|
||||
### Example 2: [Another Use Case]
|
||||
|
||||
**Scenario**: [Description]
|
||||
|
||||
**Commands**:
|
||||
|
||||
```bash
|
||||
[COMMAND_SEQUENCE]
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Script not executable
|
||||
|
||||
```bash
|
||||
# Make scripts executable
|
||||
chmod +x scripts/*.sh
|
||||
```
|
||||
|
||||
### Script not found
|
||||
|
||||
```bash
|
||||
# Verify script location
|
||||
ls -la scripts/
|
||||
|
||||
# Run from project root
|
||||
cd /path/to/project
|
||||
./scripts/[script-name].sh
|
||||
```
|
||||
|
||||
### Permission denied
|
||||
|
||||
```bash
|
||||
# Check file permissions
|
||||
ls -la scripts/[script-name].sh
|
||||
|
||||
# Fix permissions
|
||||
chmod +x scripts/[script-name].sh
|
||||
```
|
||||
|
||||
### Environment variables not set
|
||||
|
||||
```bash
|
||||
# Check if .env exists
|
||||
ls -la .env
|
||||
|
||||
# Load environment
|
||||
source .env
|
||||
|
||||
# Or use direnv
|
||||
direnv allow
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
**System Requirements**:
|
||||
- [Requirement 1]
|
||||
- [Requirement 2]
|
||||
|
||||
**Dependencies**:
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
[INSTALLATION_COMMANDS]
|
||||
```
|
||||
|
||||
**File Structure**:
|
||||
|
||||
```
|
||||
skill-directory/
|
||||
├── SKILL.md
|
||||
└── scripts/
|
||||
├── [script-name].sh
|
||||
└── [another-script].sh
|
||||
```
|
||||
|
||||
## Security Considerations
|
||||
|
||||
- ⚠️ Scripts run with your user permissions
|
||||
- ⚠️ Always review scripts before running
|
||||
- ⚠️ Validate all inputs to prevent injection
|
||||
- ⚠️ Use quotes around variables: `"$VAR"`
|
||||
- ⚠️ Never commit secrets to scripts
|
||||
|
||||
## Related Skills
|
||||
|
||||
- **[related-skill-1]**: [Description]
|
||||
- **[related-skill-2]**: [Description]
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# [SCRIPT_NAME]: [Brief description of what this script does]
|
||||
# Usage: ./helper.sh <arg1> [optional-arg2]
|
||||
|
||||
# Color codes for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Helper functions
|
||||
log_info() {
|
||||
echo -e "${BLUE}ℹ${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}✓${NC} $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}⚠${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}✗${NC} $1" >&2
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
ARG1="${1:-}"
|
||||
ARG2="${2:-}"
|
||||
|
||||
# Validate required arguments
|
||||
if [[ -z "$ARG1" ]]; then
|
||||
log_error "Missing required argument: <arg1>"
|
||||
echo ""
|
||||
echo "Usage: $0 <arg1> [optional-arg2]"
|
||||
echo ""
|
||||
echo "Arguments:"
|
||||
echo " arg1 [Description of arg1]"
|
||||
echo " arg2 [Description of optional arg2]"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 example-value"
|
||||
echo " $0 example-value optional-value"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Main script logic
|
||||
main() {
|
||||
log_info "Starting [SCRIPT_NAME]..."
|
||||
log_info "Argument 1: $ARG1"
|
||||
|
||||
if [[ -n "$ARG2" ]]; then
|
||||
log_info "Argument 2: $ARG2"
|
||||
fi
|
||||
|
||||
# [YOUR_SCRIPT_LOGIC_HERE]
|
||||
# Example:
|
||||
|
||||
# Step 1: [Description]
|
||||
log_info "Performing step 1..."
|
||||
# Your command here
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_success "Step 1 completed"
|
||||
else
|
||||
log_error "Step 1 failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 2: [Description]
|
||||
log_info "Performing step 2..."
|
||||
# Your command here
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_success "Step 2 completed"
|
||||
else
|
||||
log_error "Step 2 failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 3: [Description]
|
||||
log_info "Performing step 3..."
|
||||
# Your command here
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_success "Step 3 completed"
|
||||
else
|
||||
log_warning "Step 3 had warnings, but continuing..."
|
||||
fi
|
||||
|
||||
# Success
|
||||
log_success "[SCRIPT_NAME] completed successfully!"
|
||||
|
||||
# Output results
|
||||
echo ""
|
||||
echo "Results:"
|
||||
echo " - [Result 1]"
|
||||
echo " - [Result 2]"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Error handling
|
||||
trap 'log_error "Script failed on line $LINENO"' ERR
|
||||
|
||||
# Run main function
|
||||
main
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user