feat: Add OurDigital custom skills package (10 skills)
Complete implementation of OurDigital skills with dual-platform support (Claude Desktop + Claude Code) following standardized structure. Skills created: - 01-ourdigital-brand-guide: Brand reference & style guidelines - 02-ourdigital-blog: Korean blog drafts (blog.ourdigital.org) - 03-ourdigital-journal: English essays (journal.ourdigital.org) - 04-ourdigital-research: Research prompts & workflows - 05-ourdigital-document: Notion-to-presentation pipeline - 06-ourdigital-designer: Visual/image prompt generation - 07-ourdigital-ad-manager: Ad copywriting & keyword research - 08-ourdigital-trainer: Training materials & workshop planning - 09-ourdigital-backoffice: Quotes, proposals, cost analysis - 10-ourdigital-skill-creator: Meta skill for creating new skills Features: - YAML frontmatter with "ourdigital" or "our" prefix triggers - Standardized directory structure (code/, desktop/, shared/, docs/) - Shared environment setup (_ourdigital-shared/) - Comprehensive reference documentation - Cross-skill integration support Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,215 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Initialize a new OurDigital skill with standard directory structure.
|
||||
|
||||
Usage:
|
||||
python init_skill.py {skill-name} --number XX
|
||||
python init_skill.py blog --number 02
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
SKILL_TEMPLATE = '''---
|
||||
name: ourdigital-{name}
|
||||
description: |
|
||||
{description}
|
||||
Activated with "ourdigital" keyword.
|
||||
|
||||
Triggers:
|
||||
- "ourdigital {name}", "ourdigital {trigger}"
|
||||
|
||||
Features:
|
||||
- {feature}
|
||||
version: "1.0"
|
||||
author: OurDigital
|
||||
environment: {environment}
|
||||
---
|
||||
|
||||
# OurDigital {title}
|
||||
|
||||
{description}
|
||||
|
||||
## Activation
|
||||
|
||||
Only activate when user includes "ourdigital" keyword:
|
||||
- "ourdigital {trigger}"
|
||||
|
||||
## Workflow
|
||||
|
||||
### Phase 1: Input
|
||||
|
||||
Gather requirements from user.
|
||||
|
||||
### Phase 2: Process
|
||||
|
||||
Execute core functionality.
|
||||
|
||||
### Phase 3: Output
|
||||
|
||||
Deliver results.
|
||||
|
||||
## Quick Commands
|
||||
|
||||
| Command | Action |
|
||||
|---------|--------|
|
||||
| "ourdigital {name}" | Main action |
|
||||
'''
|
||||
|
||||
CHANGELOG_TEMPLATE = '''# Changelog
|
||||
|
||||
All notable changes to this skill will be documented in this file.
|
||||
|
||||
## [1.0.0] - {date}
|
||||
|
||||
### Added
|
||||
- Initial skill creation
|
||||
- Desktop and Code versions
|
||||
- Basic workflow implementation
|
||||
|
||||
### Notion Ref
|
||||
- (To be added after sync)
|
||||
'''
|
||||
|
||||
README_TEMPLATE = '''# OurDigital {title}
|
||||
|
||||
{description}
|
||||
|
||||
## Installation
|
||||
|
||||
This skill is part of the OurDigital custom skills package.
|
||||
|
||||
## Usage
|
||||
|
||||
### Claude Desktop
|
||||
|
||||
The skill activates when you mention "ourdigital {name}".
|
||||
|
||||
### Claude Code
|
||||
|
||||
```bash
|
||||
# The skill activates via SKILL.md directive
|
||||
```
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
{number}-ourdigital-{name}/
|
||||
├── code/SKILL.md
|
||||
├── desktop/SKILL.md
|
||||
├── shared/
|
||||
│ └── references/
|
||||
├── docs/
|
||||
│ └── CHANGELOG.md
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Version
|
||||
|
||||
- Current: 1.0.0
|
||||
- Author: OurDigital
|
||||
'''
|
||||
|
||||
|
||||
def create_skill(name: str, number: str, description: str = "", environment: str = "Both"):
|
||||
"""Create a new skill directory structure."""
|
||||
|
||||
base_path = Path(__file__).parent.parent.parent.parent
|
||||
skill_dir = base_path / f"{number}-ourdigital-{name}"
|
||||
|
||||
if skill_dir.exists():
|
||||
print(f"Skill directory already exists: {skill_dir}")
|
||||
return False
|
||||
|
||||
# Create directories
|
||||
dirs = [
|
||||
skill_dir / "code",
|
||||
skill_dir / "desktop",
|
||||
skill_dir / "shared" / "references",
|
||||
skill_dir / "shared" / "templates",
|
||||
skill_dir / "shared" / "scripts",
|
||||
skill_dir / "docs" / "logs",
|
||||
]
|
||||
|
||||
for d in dirs:
|
||||
d.mkdir(parents=True, exist_ok=True)
|
||||
print(f"Created: {d}")
|
||||
|
||||
# Title case for display
|
||||
title = name.replace("-", " ").title()
|
||||
trigger = name.replace("-", " ")
|
||||
feature = f"Core {title} functionality"
|
||||
date = datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
if not description:
|
||||
description = f"OurDigital {title} skill for Claude."
|
||||
|
||||
# Create SKILL.md for desktop
|
||||
desktop_skill = SKILL_TEMPLATE.format(
|
||||
name=name,
|
||||
title=title,
|
||||
description=description,
|
||||
trigger=trigger,
|
||||
feature=feature,
|
||||
environment="Desktop"
|
||||
)
|
||||
(skill_dir / "desktop" / "SKILL.md").write_text(desktop_skill)
|
||||
print(f"Created: desktop/SKILL.md")
|
||||
|
||||
# Create SKILL.md for code
|
||||
code_skill = SKILL_TEMPLATE.format(
|
||||
name=name,
|
||||
title=title,
|
||||
description=description,
|
||||
trigger=trigger,
|
||||
feature=feature,
|
||||
environment="Code"
|
||||
)
|
||||
(skill_dir / "code" / "SKILL.md").write_text(code_skill)
|
||||
print(f"Created: code/SKILL.md")
|
||||
|
||||
# Create CHANGELOG.md
|
||||
changelog = CHANGELOG_TEMPLATE.format(date=date)
|
||||
(skill_dir / "docs" / "CHANGELOG.md").write_text(changelog)
|
||||
print(f"Created: docs/CHANGELOG.md")
|
||||
|
||||
# Create README.md
|
||||
readme = README_TEMPLATE.format(
|
||||
title=title,
|
||||
name=name,
|
||||
number=number,
|
||||
description=description
|
||||
)
|
||||
(skill_dir / "README.md").write_text(readme)
|
||||
print(f"Created: README.md")
|
||||
|
||||
print(f"\nSkill created successfully: {skill_dir}")
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Initialize a new OurDigital skill")
|
||||
parser.add_argument("name", help="Skill name (e.g., 'blog', 'designer')")
|
||||
parser.add_argument("--number", required=True, help="Skill number (e.g., '02', '07')")
|
||||
parser.add_argument("--description", default="", help="Skill description")
|
||||
parser.add_argument("--environment", default="Both",
|
||||
choices=["Desktop", "Code", "Both"],
|
||||
help="Target environment")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
success = create_skill(
|
||||
name=args.name,
|
||||
number=args.number,
|
||||
description=args.description,
|
||||
environment=args.environment
|
||||
)
|
||||
|
||||
return 0 if success else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit(main())
|
||||
@@ -0,0 +1,171 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Validate an OurDigital skill structure and content.
|
||||
|
||||
Usage:
|
||||
python validate_skill.py {skill-directory}
|
||||
python validate_skill.py 02-ourdigital-blog
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class SkillValidator:
|
||||
def __init__(self, skill_path: Path):
|
||||
self.skill_path = skill_path
|
||||
self.errors = []
|
||||
self.warnings = []
|
||||
|
||||
def validate(self) -> bool:
|
||||
"""Run all validations."""
|
||||
self._check_directory_structure()
|
||||
self._check_skill_files()
|
||||
self._check_frontmatter()
|
||||
self._check_content_length()
|
||||
self._check_ourdigital_triggers()
|
||||
|
||||
return len(self.errors) == 0
|
||||
|
||||
def _check_directory_structure(self):
|
||||
"""Verify required directories exist."""
|
||||
required_dirs = [
|
||||
"code",
|
||||
"desktop",
|
||||
]
|
||||
|
||||
recommended_dirs = [
|
||||
"shared",
|
||||
"docs",
|
||||
]
|
||||
|
||||
for d in required_dirs:
|
||||
if not (self.skill_path / d).is_dir():
|
||||
self.errors.append(f"Missing required directory: {d}/")
|
||||
|
||||
for d in recommended_dirs:
|
||||
if not (self.skill_path / d).is_dir():
|
||||
self.warnings.append(f"Missing recommended directory: {d}/")
|
||||
|
||||
def _check_skill_files(self):
|
||||
"""Verify SKILL.md files exist."""
|
||||
skill_files = [
|
||||
"code/SKILL.md",
|
||||
"desktop/SKILL.md",
|
||||
]
|
||||
|
||||
for f in skill_files:
|
||||
if not (self.skill_path / f).is_file():
|
||||
self.errors.append(f"Missing required file: {f}")
|
||||
|
||||
def _check_frontmatter(self):
|
||||
"""Verify YAML frontmatter in SKILL.md files."""
|
||||
for env in ["code", "desktop"]:
|
||||
skill_file = self.skill_path / env / "SKILL.md"
|
||||
if not skill_file.is_file():
|
||||
continue
|
||||
|
||||
content = skill_file.read_text()
|
||||
|
||||
# Check for YAML frontmatter
|
||||
if not content.startswith("---"):
|
||||
self.errors.append(f"{env}/SKILL.md: Missing YAML frontmatter")
|
||||
continue
|
||||
|
||||
# Check required fields
|
||||
required_fields = ["name", "description", "version", "author", "environment"]
|
||||
for field in required_fields:
|
||||
if f"{field}:" not in content.split("---")[1]:
|
||||
self.warnings.append(f"{env}/SKILL.md: Missing frontmatter field '{field}'")
|
||||
|
||||
def _check_content_length(self):
|
||||
"""Verify SKILL.md body is within word limit."""
|
||||
for env in ["code", "desktop"]:
|
||||
skill_file = self.skill_path / env / "SKILL.md"
|
||||
if not skill_file.is_file():
|
||||
continue
|
||||
|
||||
content = skill_file.read_text()
|
||||
|
||||
# Extract body (after frontmatter)
|
||||
parts = content.split("---")
|
||||
if len(parts) >= 3:
|
||||
body = "---".join(parts[2:])
|
||||
word_count = len(body.split())
|
||||
|
||||
if word_count < 200:
|
||||
self.warnings.append(
|
||||
f"{env}/SKILL.md: Body too short ({word_count} words, recommended 800-1200)"
|
||||
)
|
||||
elif word_count > 1500:
|
||||
self.warnings.append(
|
||||
f"{env}/SKILL.md: Body too long ({word_count} words, recommended 800-1200)"
|
||||
)
|
||||
|
||||
def _check_ourdigital_triggers(self):
|
||||
"""Verify 'ourdigital' keyword in triggers."""
|
||||
for env in ["code", "desktop"]:
|
||||
skill_file = self.skill_path / env / "SKILL.md"
|
||||
if not skill_file.is_file():
|
||||
continue
|
||||
|
||||
content = skill_file.read_text().lower()
|
||||
|
||||
# Check for ourdigital in description/triggers
|
||||
if "ourdigital" not in content:
|
||||
self.errors.append(
|
||||
f"{env}/SKILL.md: Missing 'ourdigital' keyword in triggers"
|
||||
)
|
||||
|
||||
def report(self):
|
||||
"""Print validation report."""
|
||||
print(f"\nValidation Report: {self.skill_path.name}")
|
||||
print("=" * 50)
|
||||
|
||||
if self.errors:
|
||||
print(f"\nERRORS ({len(self.errors)}):")
|
||||
for e in self.errors:
|
||||
print(f" [X] {e}")
|
||||
|
||||
if self.warnings:
|
||||
print(f"\nWARNINGS ({len(self.warnings)}):")
|
||||
for w in self.warnings:
|
||||
print(f" [!] {w}")
|
||||
|
||||
if not self.errors and not self.warnings:
|
||||
print("\n All checks passed!")
|
||||
|
||||
print("\n" + "=" * 50)
|
||||
status = "PASS" if not self.errors else "FAIL"
|
||||
print(f"Status: {status}")
|
||||
|
||||
return not self.errors
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Validate an OurDigital skill")
|
||||
parser.add_argument("skill_dir", help="Skill directory name or path")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Handle relative or absolute path
|
||||
skill_path = Path(args.skill_dir)
|
||||
if not skill_path.is_absolute():
|
||||
# Try relative to custom-skills directory
|
||||
base_path = Path(__file__).parent.parent.parent.parent
|
||||
skill_path = base_path / args.skill_dir
|
||||
|
||||
if not skill_path.is_dir():
|
||||
print(f"Error: Skill directory not found: {skill_path}")
|
||||
return 1
|
||||
|
||||
validator = SkillValidator(skill_path)
|
||||
validator.validate()
|
||||
success = validator.report()
|
||||
|
||||
return 0 if success else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit(main())
|
||||
Reference in New Issue
Block a user