Claude Skill Authoring is a Python-based tool that guides Claude in creating and validating Claude Code Skills. It follows Anthropic's official best practices, making it ideal for operations teams looking to automate workflows. The skill integrates with Claude's infrastructure, enabling rapid development and deployment of custom skills.
git clone https://github.com/IndianOldTurtledove/claude-skill-authoring.gitClaude Skill Authoring is a Python-based tool that guides Claude in creating and validating Claude Code Skills. It follows Anthropic's official best practices, making it ideal for operations teams looking to automate workflows. The skill integrates with Claude's infrastructure, enabling rapid development and deployment of custom skills.
["Install the claude-skill-authoring tool: `pip install claude-skill-authoring`","Create a new skill project: `claude-skill-authoring new --name weekly-sql-backup --description \"Automates weekly SQL database backups\"`","Edit the generated skill template to implement your specific logic (e.g., database backup, API calls, file processing).","Add unit tests following the template's structure to validate your skill's functionality.","Validate your skill: `claude-skill-authoring validate weekly-sql-backup`","Deploy your skill using the provided deployment instructions in the README.md file."]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/IndianOldTurtledove/claude-skill-authoringCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the claude-skill-authoring tool to create a new Claude Code Skill that [DESCRIBE THE SKILL'S PURPOSE, e.g., 'automates weekly data backup for a company's SQL databases']. Follow Anthropic's best practices for skill structure, validation, and error handling. Include unit tests and a README.md file. The skill should integrate with [SPECIFIC TOOLS/APIs, e.g., 'AWS S3 for storage and Slack for notifications'] and handle [EDGE CASES, e.g., 'failed backups or network timeouts'].
```python
# File: weekly_sql_backup.py
# Description: Automates weekly backups of SQL databases to AWS S3 with Slack notifications.
# Author: AI Assistant
# Version: 1.0.0
import os
import subprocess
import boto3
from datetime import datetime
import requests
import logging
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class WeeklySQLBackup:
def __init__(self, db_host, db_user, db_pass, s3_bucket, slack_webhook):
self.db_host = db_host
self.db_user = db_user
self.db_pass = db_pass
self.s3_bucket = s3_bucket
self.slack_webhook = slack_webhook
self.s3_client = boto3.client('s3')
def backup_database(self, db_name):
"""Create a backup of the specified database and upload to S3."""
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
backup_file = f"/tmp/{db_name}_{timestamp}.sql"
s3_key = f"backups/{db_name}/{timestamp}.sql"
try:
# Dump database
cmd = f"mysqldump -h {self.db_host} -u {self.db_user} -p{self.db_pass} {db_name} > {backup_file}"
subprocess.run(cmd, shell=True, check=True, capture_output=True)
# Upload to S3
self.s3_client.upload_file(backup_file, self.s3_bucket, s3_key)
logger.info(f"Backup of {db_name} uploaded to S3 as {s3_key}")
# Clean up
os.remove(backup_file)
return True
except subprocess.CalledProcessError as e:
logger.error(f"Database backup failed: {e.stderr.decode()}")
self._notify_slack(f"❌ Backup failed for {db_name}: {e.stderr.decode()}")
return False
except Exception as e:
logger.error(f"Unexpected error during backup: {str(e)}")
self._notify_slack(f"❌ Unexpected error for {db_name}: {str(e)}")
return False
def _notify_slack(self, message):
"""Send a notification to Slack via webhook."""
payload = {"text": message}
try:
requests.post(self.slack_webhook, json=payload, timeout=10)
except Exception as e:
logger.error(f"Failed to send Slack notification: {str(e)}")
# Unit tests
import unittest
from unittest.mock import patch, MagicMock
class TestWeeklySQLBackup(unittest.TestCase):
def setUp(self):
self.skill = WeeklySQLBackup(
db_host="localhost",
db_user="admin",
db_pass="password",
s3_bucket="my-backups",
slack_webhook="https://hooks.slack.com/services/XXX/YYY/ZZZ"
)
@patch('subprocess.run')
@patch('boto3.client')
def test_backup_success(self, mock_boto, mock_subprocess):
mock_subprocess.return_value = MagicMock(returncode=0)
mock_boto.return_value.upload_file.return_value = None
result = self.skill.backup_database("test_db")
self.assertTrue(result)
@patch('subprocess.run')
def test_backup_failure(self, mock_subprocess):
mock_subprocess.side_effect = subprocess.CalledProcessError(1, "mysqldump")
result = self.skill.backup_database("test_db")
self.assertFalse(result)
if __name__ == "__main__":
# Example usage
skill = WeeklySQLBackup(
db_host="prod-db.example.com",
db_user="backup_user",
db_pass="secure_password123",
s3_bucket="company-backups",
slack_webhook="https://hooks.slack.com/services/ABC123/DEF456/GHI789"
)
# Backup all databases
databases = ["sales_db", "inventory_db", "user_db"]
for db in databases:
if not skill.backup_database(db):
logger.error(f"Skipping {db} due to backup failure")
```
```markdown
# README.md
## Weekly SQL Backup Skill
This skill automates the weekly backup of SQL databases to AWS S3 with Slack notifications for success/failure.
### Features
- Automated database dumps using `mysqldump`
- Secure upload to AWS S3
- Slack notifications for backup status
- Comprehensive error handling and logging
### Prerequisites
- Python 3.8+
- AWS CLI configured with proper permissions
- Slack webhook URL for notifications
- `mysqldump` installed on the system
### Installation
1. Clone this repository
2. Install dependencies: `pip install boto3 requests`
3. Configure environment variables:
```bash
export DB_HOST="prod-db.example.com"
export DB_USER="backup_user"
export DB_PASS="secure_password123"
export S3_BUCKET="company-backups"
export SLACK_WEBHOOK="https://hooks.slack.com/services/ABC123/DEF456/GHI789"
```
4. Run the skill: `python weekly_sql_backup.py`
### Testing
Run unit tests with: `python -m unittest weekly_sql_backup.py`
### License
MIT
```AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan