OpenClaw Skills: Procedural Memory for Your Lobster
Skills in OpenClaw are Markdown files with YAML frontmatter (like Hermes), loaded on trigger, teaching lobster reusable workflows. Write once, use forever with /skill name in any chat.
1. SKILL.md File Anatomy
# ~/.config/openclaw/skills/my-skill.md
---
name: my-skill # unique name (for /skill my-skill)
description: "Use when..." # trigger for auto-load
tools: [Terminal, Git, HTTP] # available tools
model: "anthropic/claude-3.5-sonnet" # optional: custom model
---
# Instructions for lobster (markdown)
## When to Use
Description of situations when lobster should load this skill.
## Procedure
1. Step 1
2. Step 2
3. Step 3
## Rollback / Errors
What to do if something goes wrong.
## Notifications
Where and what to send notifications (Telegram, Slack, email).
2. Description Field — Main Trigger
Lobster decides whether to load skill based on description. Write triggers:
"Use when user wants to deploy to production""Use when code review is needed before commit""Use when database migration is required""Use when creating a new PR with tests""Use when backup of database is needed"
More specific = more accurate auto-loading.
3. Tools Field — Limit Scope
Restrict skill to only needed tools — safety and focus:
[Terminal, Git]— deploy/git only[Terminal, Git, HTTP, SQL]— deploy + DB + API[Browser, Terminal]— web scraping + commands[Filesystem, Terminal, Git]— file ops + git
4. Ready-to-Use Skill Examples (Copy & Adapt)
🚀 Deploy Skill — Full Deploy Pipeline
# ~/.config/openclaw/skills/deploy.md
---
name: deploy
description: "Use when user wants to deploy to production. Runs full pipeline with rollback."
tools: [Terminal, Git, HTTP]
---
Deploy procedure:
1. Run tests: npm run test
2. Build: npm run build
3. Check bundle size: npm run analyze
4. Create GitHub release: gh release create
5. Deploy: npm run deploy
6. Verify health: curl https://myapp.com/health
7. Notify Telegram: "✅ Deploy v{version} done!"
Rollback on failure:
- git revert HEAD
- npm run deploy
- Notify: "🔄 Rollback done"
Error handling:
- If tests fail → stop, notify "❌ Tests failed"
- If build fails → stop, notify "❌ Build failed"
- If health check fails → auto rollback
👀 Code Review Skill — Review Before Commit
# ~/.config/openclaw/skills/code-review.md
---
name: code-review
description: "Use when code review is needed before commit. Checks bugs, style, security."
tools: [Read, Grep, Glob, Bash]
---
You are a senior code reviewer. Focus on:
1. Security (SQLi, XSS, path traversal, secrets)
2. Performance (N+1, unnecessary re-renders, memory leaks)
3. Code style consistency (ESLint, Prettier)
4. Test coverage gaps (unit, integration, e2e)
5. Error handling (try/catch, Result types)
6. Documentation (JSDoc, README updates)
Output format:
- **Critical**: must fix before merge
- **Warning**: should fix
- **Nitpick**: optional improvement
- **Praise**: good patterns noticed
🗄️ DB Migration Skill — Safe Migrations
# ~/.config/openclaw/skills/db-migration.md
---
name: db-migration
description: "Use when database migration is needed. Creates safe migration with rollback."
tools: [Terminal, SQL, Git]
---
Migration procedure:
1. Analyze current schema: pg_dump --schema-only
2. Create migration file: timestamp_name.sql
3. Write UP migration (changes)
4. Write DOWN migration (rollback)
5. Test on staging: psql -f migration.sql
6. Create PR with migration
7. After merge → run on prod
8. Verify: SELECT * FROM new_table LIMIT 1
Rollback: psql -f migration_down.sql
Notify team: "Migration {name} applied/rolled back"
🔀 PR Creation Skill — Auto PR with Tests
# ~/.config/openclaw/skills/pr-create.md
---
name: pr-create
description: "Use when creating a new PR. Runs tests, creates PR with description."
tools: [Terminal, Git, HTTP]
---
PR creation procedure:
1. Run full test suite: npm run test
2. Run lint: npm run lint
3. Run typecheck: npm run typecheck
4. Generate conventional commit message
5. Commit: git commit -m "feat: {description}"
6. Push branch: git push origin {branch}
7. Create PR: gh pr create --title "{title}" --body "{template}"
8. Add reviewers: gh pr edit --add-reviewer @team
9. Wait for CI: gh pr checks --watch
10. Notify: "PR #{number} created: {url}"
💾 Backup Skill — DB & Files Backup
# ~/.config/openclaw/skills/backup.md
---
name: backup
description: "Use when backup of database and files is needed. Stores to S3/local."
tools: [Terminal, SQL, HTTP]
---
Backup procedure:
1. DB dump: pg_dump -Fc db_name > backup_$(date +%Y%m%d).dump
2. Compress: gzip backup_*.dump
3. Upload to S3: aws s3 cp backup_*.dump.gz s3://my-bucket/backups/
4. Verify: aws s3 ls s3://my-bucket/backups/ | grep backup_$(date +%Y%m%d)
5. Cleanup local: rm backup_*.dump.gz
6. Prune old: aws s3api delete-objects --bucket my-bucket --delete "$(aws s3api list-object-versions --bucket my-bucket --prefix backups/ --query 'Versions[?LastModified<=`date -d "-30 days" +%Y-%m-%d`].{Key:Key,VersionId:VersionId}')"
7. Notify: "✅ Backup completed: {size} MB"
Restore: pg_restore -d db_name backup_file.dump
5. Where to Store Skills
- Global (all projects):
~/.config/openclaw/skills/ - Project-specific:
.openclaw/skills/in repo root
Lobster checks both folders, project ones take priority.
6. Usage
- Auto: Lobster auto-loads skill if
descriptionmatches request - Manual:
/skill deployor/skill code-review - With args:
/skill deploy --env staging(if skill supports args)
7. Debugging Skills
openclaw skills list— list loaded skillsopenclaw skills show deploy— skill contentopenclaw logs --skill deploy— skill execution logsopenclaw skills validate— validate all skills syntax
8. Best Practices
- One skill = one atomic task
- Always write rollback procedure
- Test on staging before production
- Use specific description for accurate auto-loading
- Limit tools to minimum necessary
- Version skills in git (.openclaw/skills/ in repo)
Links: Skill Examples in Repo | Skills Documentation | Discord #skills
