From 5889d3428b904fb86520e0637d03aac92b96b7f4 Mon Sep 17 00:00:00 2001 From: uroma Date: Fri, 13 Feb 2026 10:30:11 +0000 Subject: [PATCH] Add comprehensive skills, agents, commands collection - Added 44 external skills from obra/superpowers, ui-ux-pro-max-skill, claude-codex-settings - Added 8 autonomous agents (commit-creator, pr-creator, pr-reviewer, etc.) - Added 23 slash commands for Git/GitHub, setup, and plugin development - Added hooks for code formatting, notifications, and validation - Added MCP configurations for Azure, GCloud, Supabase, MongoDB, etc. - Added awesome-openclaw-skills registry (3,002 skills referenced) - Updated comprehensive README with full documentation Sources: - github.com/obra/superpowers (14 skills) - github.com/nextlevelbuilder/ui-ux-pro-max-skill (1 skill) - github.com/fcakyon/claude-codex-settings (29 skills, 8 agents, 23 commands) - github.com/VoltAgent/awesome-openclaw-skills (registry) - skills.sh (reference) - buildwithclaude.com (reference) --- README.md | 406 +- .../general-dev-code-simplifier.md | 144 + .../github-dev-commit-creator.md | 76 + .../github-dev-pr-creator.md | 119 + .../github-dev-pr-reviewer.md | 77 + .../playwright-tools-responsive-tester.md | 175 + .../plugin-dev-agent-creator.md | 154 + .../plugin-dev-plugin-validator.md | 165 + .../plugin-dev-skill-reviewer.md | 172 + .../azure-tools-setup.md | 92 + .../ccproxy-tools-setup.md | 379 ++ .../claude-tools-load-claude-md.md | 12 + .../claude-tools-load-frontend-skill.md | 13 + .../claude-tools-sync-allowlist.md | 17 + .../claude-tools-sync-claude-md.md | 10 + .../gcloud-tools-setup.md | 104 + .../github-dev-clean-gone-branches.md | 44 + .../github-dev-commit-staged.md | 19 + .../github-dev-create-pr.md | 19 + .../github-dev-review-pr.md | 19 + .../claude-codex-settings/github-dev-setup.md | 53 + .../github-dev-update-pr-summary.md | 118 + .../linear-tools-setup.md | 74 + .../mongodb-tools-setup.md | 112 + .../paper-search-tools-setup.md | 62 + .../playwright-tools-setup.md | 104 + .../plugin-dev-create-plugin.md | 415 +++ .../plugin-dev-load-skills.md | 18 + .../slack-tools-setup.md | 162 + .../statusline-tools-setup.md | 165 + .../supabase-tools-setup.md | 96 + .../tavily-tools-setup.md | 97 + hooks/claude-codex-settings/hooks.json | 16 + .../scripts/bash_formatting.py | 58 + .../scripts/enforce_rg_over_grep.py | 47 + .../scripts/format_python_docstrings.py | 547 +++ .../scripts/gh_pr_create_confirm.py | 135 + .../scripts/git_commit_confirm.py | 162 + .../scripts/markdown_formatting.py | 311 ++ hooks/claude-codex-settings/scripts/notify.sh | 18 + .../scripts/prettier_formatting.py | 66 + .../scripts/python_code_quality.py | 67 + .../scripts/sync_marketplace_to_plugins.py | 83 + .../scripts/tavily_extract_to_advanced.py | 53 + .../scripts/webfetch_to_tavily_extract.py | 23 + .../scripts/websearch_to_tavily_search.py | 24 + .../claude-codex-settings/settings.json | 119 + .../awesome-openclaw-skills-registry.md | 3319 +++++++++++++++++ skills/ai-platforms-consolidated/SKILL.md | 277 ++ .../external/azure-tools-azure-usage/SKILL.md | 57 + skills/external/azure-tools-setup/SKILL.md | 19 + skills/external/brainstorming/SKILL.md | 96 + skills/external/ccproxy-tools-setup/SKILL.md | 39 + .../dispatching-parallel-agents/SKILL.md | 180 + skills/external/executing-plans/SKILL.md | 84 + .../finishing-a-development-branch/SKILL.md | 200 + .../gcloud-tools-gcloud-usage/SKILL.md | 148 + skills/external/gcloud-tools-setup/SKILL.md | 18 + .../github-dev-commit-workflow/SKILL.md | 51 + .../external/github-dev-pr-workflow/SKILL.md | 73 + skills/external/github-dev-setup/SKILL.md | 32 + .../linear-tools-linear-usage/SKILL.md | 181 + skills/external/linear-tools-setup/SKILL.md | 18 + .../mongodb-tools-mongodb-usage/SKILL.md | 112 + skills/external/mongodb-tools-setup/SKILL.md | 18 + .../SKILL.md | 27 + .../paper-search-tools-setup/SKILL.md | 18 + .../SKILL.md | 333 ++ .../plugin-dev-agent-development/SKILL.md | 414 ++ .../examples/agent-creation-prompt.md | 238 ++ .../examples/complete-agent-examples.md | 427 +++ .../agent-creation-system-prompt.md | 207 + .../references/system-prompt-design.md | 411 ++ .../references/triggering-examples.md | 491 +++ .../scripts/validate-agent.sh | 217 ++ .../plugin-dev-command-development/README.md | 272 ++ .../plugin-dev-command-development/SKILL.md | 833 +++++ .../examples/plugin-commands.md | 557 +++ .../examples/simple-commands.md | 504 +++ .../references/advanced-workflows.md | 722 ++++ .../references/documentation-patterns.md | 739 ++++ .../references/frontmatter-reference.md | 463 +++ .../references/interactive-commands.md | 920 +++++ .../references/marketplace-considerations.md | 904 +++++ .../references/plugin-features-reference.md | 609 +++ .../references/testing-strategies.md | 702 ++++ .../plugin-dev-hook-development/SKILL.md | 711 ++++ .../examples/load-context.sh | 55 + .../examples/validate-bash.sh | 43 + .../examples/validate-write.sh | 38 + .../references/advanced.md | 479 +++ .../references/migration.md | 369 ++ .../references/patterns.md | 346 ++ .../scripts/README.md | 164 + .../scripts/hook-linter.sh | 153 + .../scripts/test-hook.sh | 252 ++ .../scripts/validate-hook-schema.sh | 159 + .../plugin-dev-mcp-integration/SKILL.md | 553 +++ .../examples/http-server.json | 20 + .../examples/sse-server.json | 19 + .../examples/stdio-server.json | 26 + .../references/authentication.md | 549 +++ .../references/server-types.md | 536 +++ .../references/tool-usage.md | 538 +++ .../plugin-dev-plugin-settings/SKILL.md | 543 +++ .../examples/create-settings-command.md | 98 + .../examples/example-settings.md | 159 + .../examples/read-settings-hook.sh | 65 + .../references/parsing-techniques.md | 549 +++ .../references/real-world-examples.md | 395 ++ .../scripts/parse-frontmatter.sh | 59 + .../scripts/validate-settings.sh | 101 + .../plugin-dev-plugin-structure/README.md | 109 + .../plugin-dev-plugin-structure/SKILL.md | 475 +++ .../examples/advanced-plugin.md | 765 ++++ .../examples/minimal-plugin.md | 83 + .../examples/standard-plugin.md | 587 +++ .../references/component-patterns.md | 567 +++ .../references/manifest-reference.md | 552 +++ .../plugin-dev-skill-development/SKILL.md | 693 ++++ .../references/skill-creator-original.md | 209 ++ .../external/receiving-code-review/SKILL.md | 213 ++ .../external/requesting-code-review/SKILL.md | 105 + .../requesting-code-review/code-reviewer.md | 146 + skills/external/slack-tools-setup/SKILL.md | 18 + .../external/slack-tools-slack-usage/SKILL.md | 75 + .../external/statusline-tools-setup/SKILL.md | 44 + .../subagent-driven-development/SKILL.md | 242 ++ .../code-quality-reviewer-prompt.md | 20 + .../implementer-prompt.md | 78 + .../spec-reviewer-prompt.md | 61 + skills/external/supabase-tools-setup/SKILL.md | 18 + .../supabase-tools-supabase-usage/SKILL.md | 101 + .../references/auth.md | 100 + .../references/query-patterns.md | 180 + .../references/relationships.md | 69 + .../references/rls.md | 107 + .../systematic-debugging/CREATION-LOG.md | 119 + skills/external/systematic-debugging/SKILL.md | 296 ++ .../condition-based-waiting-example.ts | 158 + .../condition-based-waiting.md | 115 + .../systematic-debugging/defense-in-depth.md | 122 + .../systematic-debugging/find-polluter.sh | 63 + .../root-cause-tracing.md | 169 + .../systematic-debugging/test-academic.md | 14 + .../systematic-debugging/test-pressure-1.md | 58 + .../systematic-debugging/test-pressure-2.md | 68 + .../systematic-debugging/test-pressure-3.md | 69 + skills/external/tavily-tools-setup/SKILL.md | 18 + .../tavily-tools-tavily-usage/SKILL.md | 58 + .../external/test-driven-development/SKILL.md | 371 ++ .../testing-anti-patterns.md | 299 ++ skills/external/ui-ux-pro-max/SKILL.md | 386 ++ skills/external/ui-ux-pro-max/data | 1 + skills/external/ui-ux-pro-max/scripts | 1 + skills/external/using-git-worktrees/SKILL.md | 218 ++ skills/external/using-superpowers/SKILL.md | 95 + .../verification-before-completion/SKILL.md | 139 + skills/external/writing-plans/SKILL.md | 116 + skills/external/writing-skills/SKILL.md | 655 ++++ .../anthropic-best-practices.md | 1150 ++++++ .../examples/CLAUDE_MD_TESTING.md | 189 + .../writing-skills/graphviz-conventions.dot | 172 + .../writing-skills/persuasion-principles.md | 187 + .../external/writing-skills/render-graphs.js | 168 + .../testing-skills-with-subagents.md | 384 ++ skills/glm-skills/SKILL.md | 527 +++ skills/minimax-experts/SKILL.md | 277 ++ skills/zai-tooling-reference/SKILL.md | 427 +++ 169 files changed, 39927 insertions(+), 109 deletions(-) create mode 100644 agents/claude-codex-settings/general-dev-code-simplifier.md create mode 100644 agents/claude-codex-settings/github-dev-commit-creator.md create mode 100644 agents/claude-codex-settings/github-dev-pr-creator.md create mode 100644 agents/claude-codex-settings/github-dev-pr-reviewer.md create mode 100644 agents/claude-codex-settings/playwright-tools-responsive-tester.md create mode 100644 agents/claude-codex-settings/plugin-dev-agent-creator.md create mode 100644 agents/claude-codex-settings/plugin-dev-plugin-validator.md create mode 100644 agents/claude-codex-settings/plugin-dev-skill-reviewer.md create mode 100644 commands/claude-codex-settings/azure-tools-setup.md create mode 100644 commands/claude-codex-settings/ccproxy-tools-setup.md create mode 100644 commands/claude-codex-settings/claude-tools-load-claude-md.md create mode 100644 commands/claude-codex-settings/claude-tools-load-frontend-skill.md create mode 100644 commands/claude-codex-settings/claude-tools-sync-allowlist.md create mode 100644 commands/claude-codex-settings/claude-tools-sync-claude-md.md create mode 100644 commands/claude-codex-settings/gcloud-tools-setup.md create mode 100644 commands/claude-codex-settings/github-dev-clean-gone-branches.md create mode 100644 commands/claude-codex-settings/github-dev-commit-staged.md create mode 100644 commands/claude-codex-settings/github-dev-create-pr.md create mode 100644 commands/claude-codex-settings/github-dev-review-pr.md create mode 100644 commands/claude-codex-settings/github-dev-setup.md create mode 100644 commands/claude-codex-settings/github-dev-update-pr-summary.md create mode 100644 commands/claude-codex-settings/linear-tools-setup.md create mode 100644 commands/claude-codex-settings/mongodb-tools-setup.md create mode 100644 commands/claude-codex-settings/paper-search-tools-setup.md create mode 100644 commands/claude-codex-settings/playwright-tools-setup.md create mode 100644 commands/claude-codex-settings/plugin-dev-create-plugin.md create mode 100644 commands/claude-codex-settings/plugin-dev-load-skills.md create mode 100644 commands/claude-codex-settings/slack-tools-setup.md create mode 100644 commands/claude-codex-settings/statusline-tools-setup.md create mode 100644 commands/claude-codex-settings/supabase-tools-setup.md create mode 100644 commands/claude-codex-settings/tavily-tools-setup.md create mode 100644 hooks/claude-codex-settings/hooks.json create mode 100755 hooks/claude-codex-settings/scripts/bash_formatting.py create mode 100755 hooks/claude-codex-settings/scripts/enforce_rg_over_grep.py create mode 100755 hooks/claude-codex-settings/scripts/format_python_docstrings.py create mode 100755 hooks/claude-codex-settings/scripts/gh_pr_create_confirm.py create mode 100755 hooks/claude-codex-settings/scripts/git_commit_confirm.py create mode 100755 hooks/claude-codex-settings/scripts/markdown_formatting.py create mode 100755 hooks/claude-codex-settings/scripts/notify.sh create mode 100755 hooks/claude-codex-settings/scripts/prettier_formatting.py create mode 100755 hooks/claude-codex-settings/scripts/python_code_quality.py create mode 100755 hooks/claude-codex-settings/scripts/sync_marketplace_to_plugins.py create mode 100755 hooks/claude-codex-settings/scripts/tavily_extract_to_advanced.py create mode 100755 hooks/claude-codex-settings/scripts/webfetch_to_tavily_extract.py create mode 100755 hooks/claude-codex-settings/scripts/websearch_to_tavily_search.py create mode 100644 mcp-configs/claude-codex-settings/settings.json create mode 100644 registries/awesome-openclaw-skills-registry.md create mode 100644 skills/ai-platforms-consolidated/SKILL.md create mode 100644 skills/external/azure-tools-azure-usage/SKILL.md create mode 100644 skills/external/azure-tools-setup/SKILL.md create mode 100644 skills/external/brainstorming/SKILL.md create mode 100644 skills/external/ccproxy-tools-setup/SKILL.md create mode 100644 skills/external/dispatching-parallel-agents/SKILL.md create mode 100644 skills/external/executing-plans/SKILL.md create mode 100644 skills/external/finishing-a-development-branch/SKILL.md create mode 100644 skills/external/gcloud-tools-gcloud-usage/SKILL.md create mode 100644 skills/external/gcloud-tools-setup/SKILL.md create mode 100644 skills/external/github-dev-commit-workflow/SKILL.md create mode 100644 skills/external/github-dev-pr-workflow/SKILL.md create mode 100644 skills/external/github-dev-setup/SKILL.md create mode 100644 skills/external/linear-tools-linear-usage/SKILL.md create mode 100644 skills/external/linear-tools-setup/SKILL.md create mode 100644 skills/external/mongodb-tools-mongodb-usage/SKILL.md create mode 100644 skills/external/mongodb-tools-setup/SKILL.md create mode 100644 skills/external/paper-search-tools-paper-search-usage/SKILL.md create mode 100644 skills/external/paper-search-tools-setup/SKILL.md create mode 100644 skills/external/playwright-tools-playwright-testing/SKILL.md create mode 100644 skills/external/plugin-dev-agent-development/SKILL.md create mode 100644 skills/external/plugin-dev-agent-development/examples/agent-creation-prompt.md create mode 100644 skills/external/plugin-dev-agent-development/examples/complete-agent-examples.md create mode 100644 skills/external/plugin-dev-agent-development/references/agent-creation-system-prompt.md create mode 100644 skills/external/plugin-dev-agent-development/references/system-prompt-design.md create mode 100644 skills/external/plugin-dev-agent-development/references/triggering-examples.md create mode 100755 skills/external/plugin-dev-agent-development/scripts/validate-agent.sh create mode 100644 skills/external/plugin-dev-command-development/README.md create mode 100644 skills/external/plugin-dev-command-development/SKILL.md create mode 100644 skills/external/plugin-dev-command-development/examples/plugin-commands.md create mode 100644 skills/external/plugin-dev-command-development/examples/simple-commands.md create mode 100644 skills/external/plugin-dev-command-development/references/advanced-workflows.md create mode 100644 skills/external/plugin-dev-command-development/references/documentation-patterns.md create mode 100644 skills/external/plugin-dev-command-development/references/frontmatter-reference.md create mode 100644 skills/external/plugin-dev-command-development/references/interactive-commands.md create mode 100644 skills/external/plugin-dev-command-development/references/marketplace-considerations.md create mode 100644 skills/external/plugin-dev-command-development/references/plugin-features-reference.md create mode 100644 skills/external/plugin-dev-command-development/references/testing-strategies.md create mode 100644 skills/external/plugin-dev-hook-development/SKILL.md create mode 100755 skills/external/plugin-dev-hook-development/examples/load-context.sh create mode 100755 skills/external/plugin-dev-hook-development/examples/validate-bash.sh create mode 100755 skills/external/plugin-dev-hook-development/examples/validate-write.sh create mode 100644 skills/external/plugin-dev-hook-development/references/advanced.md create mode 100644 skills/external/plugin-dev-hook-development/references/migration.md create mode 100644 skills/external/plugin-dev-hook-development/references/patterns.md create mode 100644 skills/external/plugin-dev-hook-development/scripts/README.md create mode 100755 skills/external/plugin-dev-hook-development/scripts/hook-linter.sh create mode 100755 skills/external/plugin-dev-hook-development/scripts/test-hook.sh create mode 100755 skills/external/plugin-dev-hook-development/scripts/validate-hook-schema.sh create mode 100644 skills/external/plugin-dev-mcp-integration/SKILL.md create mode 100644 skills/external/plugin-dev-mcp-integration/examples/http-server.json create mode 100644 skills/external/plugin-dev-mcp-integration/examples/sse-server.json create mode 100644 skills/external/plugin-dev-mcp-integration/examples/stdio-server.json create mode 100644 skills/external/plugin-dev-mcp-integration/references/authentication.md create mode 100644 skills/external/plugin-dev-mcp-integration/references/server-types.md create mode 100644 skills/external/plugin-dev-mcp-integration/references/tool-usage.md create mode 100644 skills/external/plugin-dev-plugin-settings/SKILL.md create mode 100644 skills/external/plugin-dev-plugin-settings/examples/create-settings-command.md create mode 100644 skills/external/plugin-dev-plugin-settings/examples/example-settings.md create mode 100755 skills/external/plugin-dev-plugin-settings/examples/read-settings-hook.sh create mode 100644 skills/external/plugin-dev-plugin-settings/references/parsing-techniques.md create mode 100644 skills/external/plugin-dev-plugin-settings/references/real-world-examples.md create mode 100755 skills/external/plugin-dev-plugin-settings/scripts/parse-frontmatter.sh create mode 100755 skills/external/plugin-dev-plugin-settings/scripts/validate-settings.sh create mode 100644 skills/external/plugin-dev-plugin-structure/README.md create mode 100644 skills/external/plugin-dev-plugin-structure/SKILL.md create mode 100644 skills/external/plugin-dev-plugin-structure/examples/advanced-plugin.md create mode 100644 skills/external/plugin-dev-plugin-structure/examples/minimal-plugin.md create mode 100644 skills/external/plugin-dev-plugin-structure/examples/standard-plugin.md create mode 100644 skills/external/plugin-dev-plugin-structure/references/component-patterns.md create mode 100644 skills/external/plugin-dev-plugin-structure/references/manifest-reference.md create mode 100644 skills/external/plugin-dev-skill-development/SKILL.md create mode 100644 skills/external/plugin-dev-skill-development/references/skill-creator-original.md create mode 100644 skills/external/receiving-code-review/SKILL.md create mode 100644 skills/external/requesting-code-review/SKILL.md create mode 100644 skills/external/requesting-code-review/code-reviewer.md create mode 100644 skills/external/slack-tools-setup/SKILL.md create mode 100644 skills/external/slack-tools-slack-usage/SKILL.md create mode 100644 skills/external/statusline-tools-setup/SKILL.md create mode 100644 skills/external/subagent-driven-development/SKILL.md create mode 100644 skills/external/subagent-driven-development/code-quality-reviewer-prompt.md create mode 100644 skills/external/subagent-driven-development/implementer-prompt.md create mode 100644 skills/external/subagent-driven-development/spec-reviewer-prompt.md create mode 100644 skills/external/supabase-tools-setup/SKILL.md create mode 100644 skills/external/supabase-tools-supabase-usage/SKILL.md create mode 100644 skills/external/supabase-tools-supabase-usage/references/auth.md create mode 100644 skills/external/supabase-tools-supabase-usage/references/query-patterns.md create mode 100644 skills/external/supabase-tools-supabase-usage/references/relationships.md create mode 100644 skills/external/supabase-tools-supabase-usage/references/rls.md create mode 100644 skills/external/systematic-debugging/CREATION-LOG.md create mode 100644 skills/external/systematic-debugging/SKILL.md create mode 100644 skills/external/systematic-debugging/condition-based-waiting-example.ts create mode 100644 skills/external/systematic-debugging/condition-based-waiting.md create mode 100644 skills/external/systematic-debugging/defense-in-depth.md create mode 100755 skills/external/systematic-debugging/find-polluter.sh create mode 100644 skills/external/systematic-debugging/root-cause-tracing.md create mode 100644 skills/external/systematic-debugging/test-academic.md create mode 100644 skills/external/systematic-debugging/test-pressure-1.md create mode 100644 skills/external/systematic-debugging/test-pressure-2.md create mode 100644 skills/external/systematic-debugging/test-pressure-3.md create mode 100644 skills/external/tavily-tools-setup/SKILL.md create mode 100644 skills/external/tavily-tools-tavily-usage/SKILL.md create mode 100644 skills/external/test-driven-development/SKILL.md create mode 100644 skills/external/test-driven-development/testing-anti-patterns.md create mode 100644 skills/external/ui-ux-pro-max/SKILL.md create mode 120000 skills/external/ui-ux-pro-max/data create mode 120000 skills/external/ui-ux-pro-max/scripts create mode 100644 skills/external/using-git-worktrees/SKILL.md create mode 100644 skills/external/using-superpowers/SKILL.md create mode 100644 skills/external/verification-before-completion/SKILL.md create mode 100644 skills/external/writing-plans/SKILL.md create mode 100644 skills/external/writing-skills/SKILL.md create mode 100644 skills/external/writing-skills/anthropic-best-practices.md create mode 100644 skills/external/writing-skills/examples/CLAUDE_MD_TESTING.md create mode 100644 skills/external/writing-skills/graphviz-conventions.dot create mode 100644 skills/external/writing-skills/persuasion-principles.md create mode 100755 skills/external/writing-skills/render-graphs.js create mode 100644 skills/external/writing-skills/testing-skills-with-subagents.md create mode 100644 skills/glm-skills/SKILL.md create mode 100644 skills/minimax-experts/SKILL.md create mode 100644 skills/zai-tooling-reference/SKILL.md diff --git a/README.md b/README.md index 77768e9..594c3eb 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,21 @@ # GLM Tools, Skills & Agents -Comprehensive collection of AI platform skills, expert agents, and development tooling from MiniMax, Super Z (GLM), and z.ai platforms. +**Comprehensive collection of AI platform skills, expert agents, and development tooling** from MiniMax, Super Z (GLM), z.ai, and the open-source community. + +--- + +## Quick Stats + +| Category | Count | +|----------|-------| +| **Original Skills** | 4 | +| **External Skills** | 44 | +| **Agents** | 8 | +| **Commands** | 23 | +| **MCP Integrations** | 9 | +| **Codebases** | 1 | +| **Registries** | 1 | +| **Total Files** | 300+ | --- @@ -8,33 +23,51 @@ Comprehensive collection of AI platform skills, expert agents, and development t ``` GLM-Tools-Skills-Agents/ -├── src/ # Next.js 16 application source -│ ├── app/ # App Router pages -│ ├── components/ui/ # 50+ shadcn/ui components -│ ├── hooks/ # Custom React hooks -│ └── lib/ # Utilities (db, utils) -├── skills/ # Claude Code compatible skills -│ ├── minimax-experts/ # 40 AI experts from MiniMax -│ ├── glm-skills/ # Super Z/GLM multimodal skills -│ ├── zai-tooling-reference/ # Next.js 16 patterns -│ └── ai-platforms-consolidated/ # Cross-platform reference -├── codebases/ # Reference codebases -│ └── z-ai-tooling/ # Full Next.js 16 project copy -├── original-docs/ # Original source documentation -│ ├── minimax_experts_data.md # MiniMax experts JSON -│ ├── MINIMAX_EXPERT_CATALOG.md # MiniMax catalog -│ └── GLM5_AGENTS_AND_SKILLS.md # Super Z agents & skills -├── prisma/ # Prisma schema -├── examples/ # WebSocket examples -├── db/ # SQLite database -└── .zscripts/ # Build & deploy scripts +├── skills/ # All skills +│ ├── minimax-experts/ # 40 AI experts from MiniMax +│ ├── glm-skills/ # Super Z/GLM multimodal skills +│ ├── zai-tooling-reference/ # Next.js 16 patterns +│ ├── ai-platforms-consolidated/ # Cross-platform reference +│ └── external/ # 44 external skills +│ ├── ui-ux-pro-max/ # UI/UX design intelligence +│ ├── brainstorming/ # Design collaboration +│ ├── test-driven-development/ # TDD methodology +│ ├── systematic-debugging/ # Debugging workflow +│ ├── writing-plans/ # Implementation planning +│ └── ... (39 more) +├── agents/ # Autonomous agents +│ └── claude-codex-settings/ +│ ├── github-dev-commit-creator.md +│ ├── github-dev-pr-creator.md +│ ├── github-dev-pr-reviewer.md +│ └── ... (5 more) +├── commands/ # Slash commands +│ └── claude-codex-settings/ +│ ├── github-dev-commit-staged.md +│ ├── github-dev-create-pr.md +│ └── ... (21 more) +├── hooks/ # Hook configurations +├── mcp-configs/ # MCP server configs +├── codebases/ # Reference codebases +│ └── z-ai-tooling/ # Full Next.js 16 project +├── original-docs/ # Source documentation +│ ├── minimax_experts_data.md +│ ├── MINIMAX_EXPERT_CATALOG.md +│ └── GLM5_AGENTS_AND_SKILLS.md +├── registries/ # Skill registries +│ └── awesome-openclaw-skills-registry.md +├── src/ # Next.js 16 app source +├── prisma/ # Prisma schema +└── examples/ # WebSocket examples ``` --- -## Skills Overview +## Skills Catalog -### 1. MiniMax Experts (`skills/minimax-experts/`) +### Original Skills (4) + +#### 1. MiniMax Experts (`skills/minimax-experts/`) 40 AI experts from the MiniMax platform (agent.minimax.io): @@ -47,111 +80,233 @@ GLM-Tools-Skills-Agents/ | Business | 3 | PRD Assistant, SaaS Niche Finder, CEO Assistant | | Marketing | 2 | Social Media Marketing Expert, Creative Director For Ads | -**Auto-Triggers:** agent design, trading, landing pages, PRD, CV optimization +**Auto-Triggers:** `agent design`, `hedge fund`, `landing page`, `PRD`, `CV optimization`, `trading` -### 2. GLM Skills (`skills/glm-skills/`) +#### 2. GLM Skills (`skills/glm-skills/`) Super Z (z.ai) multimodal capabilities using `z-ai-web-dev-sdk`: -| Skill | Description | -|-------|-------------| -| ASR | Speech-to-text transcription | -| TTS | Text-to-speech synthesis | -| VLM | Vision language model | -| Image Generation | AI image creation | -| Video Generation | AI video creation | -| PDF/DOCX/XLSX/PPTX | Document processing | -| Web Search | Real-time web search | -| Podcast | Podcast generation | +| Skill | Command | Description | +|-------|---------|-------------| +| ASR | `ASR` | Speech-to-text transcription | +| TTS | `TTS` | Text-to-speech synthesis | +| LLM | `LLM` | Large language model chat | +| VLM | `VLM` | Vision language model | +| Image Generation | `image-generation` | AI image creation | +| Video Generation | `video-generation` | AI video creation | +| PDF | `pdf` | PDF processing toolkit | +| DOCX | `docx` | Word document processing | +| XLSX | `xlsx` | Spreadsheet processing | +| PPTX | `pptx` | Presentation processing | +| Web Search | `web-search` | Real-time web search | +| Web Reader | `web-reader` | Web content extraction | +| Podcast | `podcast-generate` | Podcast episode generation | -**Auto-Triggers:** ASR, TTS, image/video generation, PDF/DOCX, multimodal +**Auto-Triggers:** `ASR`, `TTS`, `image/video generation`, `PDF/DOCX`, `multimodal` -### 3. Z.AI Tooling Reference (`skills/zai-tooling-reference/`) +#### 3. Z.AI Tooling Reference (`skills/zai-tooling-reference/`) -Production-ready Next.js 16 patterns: +Production-ready Next.js 16 development patterns: -| Technology | Version | -|------------|---------| -| Next.js | 16.1.1 | -| React | 19 | -| TypeScript | 5 | -| Tailwind CSS | 4 | -| shadcn/ui | 50+ components | -| Prisma | Latest | -| SQLite | Built-in | -| Zustand | State management | -| TanStack Query | Data fetching | +| Category | Technology | +|----------|------------| +| Framework | Next.js 16.1.1 + React 19 | +| Language | TypeScript 5 | +| Styling | Tailwind CSS 4 | +| UI Components | shadcn/ui (50+ components) | +| Database | Prisma + SQLite | +| State | Zustand | +| Data Fetching | TanStack Query | +| AI SDK | z-ai-web-dev-sdk | +| Auth | NextAuth | +| Package Manager | Bun | -**Auto-Triggers:** Next.js, shadcn/ui, Prisma, WebSocket, React 19 +**Auto-Triggers:** `Next.js`, `shadcn/ui`, `Prisma`, `WebSocket`, `React 19` -### 4. AI Platforms Consolidated (`skills/ai-platforms-consolidated/`) +#### 4. AI Platforms Consolidated (`skills/ai-platforms-consolidated/`) Cross-platform comparison and quick reference. ---- - -## Technology Stack (Root Project) - -### Core Framework -- **Next.js 16** - App Router -- **React 19** - Latest React -- **TypeScript 5** - Type safety -- **Tailwind CSS 4** - Styling - -### UI Components -- **shadcn/ui** - 50+ components -- **Lucide React** - Icons -- **Framer Motion** - Animations - -### State & Data -- **Zustand** - State management -- **TanStack Query** - Data fetching -- **Prisma** - ORM -- **SQLite** - Database - -### Forms & Validation -- **React Hook Form** - Forms -- **Zod** - Schema validation - -### Auth & Backend -- **NextAuth.js** - Authentication +**Auto-Triggers:** `platform comparisons`, `SDK patterns`, `cross-platform` --- -## Quick Start +### External Skills (44) + +#### From obra/superpowers (14 Skills) + +| Skill | Purpose | Category | +|-------|---------|----------| +| `brainstorming` | Design collaboration before creative work | Collaboration | +| `writing-plans` | Planning multi-step tasks | Planning | +| `executing-plans` | Execute plans with review checkpoints | Execution | +| `subagent-driven-development` | Independent task execution | Workflow | +| `test-driven-development` | TDD methodology - RED-GREEN-REFACTOR | Testing | +| `systematic-debugging` | Root cause investigation before fixes | Debugging | +| `requesting-code-review` | Verify work meets requirements | Quality | +| `receiving-code-review` | Implement review feedback | Quality | +| `finishing-a-development-branch` | Merge/PR/keep/discard decisions | Git | +| `dispatching-parallel-agents` | Run 2+ independent tasks | Workflow | +| `verification-before-completion` | Verify before claiming done | Quality | +| `using-git-worktrees` | Isolated feature branches | Git | +| `writing-skills` | Create and edit skills | Meta | +| `using-superpowers` | Getting started guide | Meta | + +#### From nextlevelbuilder/ui-ux-pro-max-skill (1 Skill) + +| Skill | Purpose | Features | +|-------|---------|----------| +| `ui-ux-pro-max` | UI/UX design intelligence | 67 styles, 96 color palettes, 57 font pairings, 99 UX guidelines, 25 chart types, 13 tech stacks | + +**Supported Platforms:** Claude Code, Cursor, Windsurf, Codex CLI, OpenCode, GitHub Copilot, and 10+ more + +#### From fcakyon/claude-codex-settings (29 Skills) + +| Skill | Plugin | Purpose | +|-------|--------|---------| +| `azure-tools-azure-usage` | azure-tools | Azure MCP (40+ services) | +| `gcloud-tools-gcloud-usage` | gcloud-tools | Google Cloud observability | +| `github-dev-commit-workflow` | github-dev | Git commit workflow | +| `github-dev-pr-workflow` | github-dev | Pull request workflow | +| `linear-tools-linear-usage` | linear-tools | Issue tracking integration | +| `mongodb-tools-mongodb-usage` | mongodb-tools | Database exploration (read-only) | +| `paper-search-tools-paper-search-usage` | paper-search | Academic paper search | +| `playwright-tools-playwright-testing` | playwright-tools | Browser automation & testing | +| `slack-tools-slack-usage` | slack-tools | Slack integration | +| `supabase-tools-supabase-usage` | supabase-tools | Supabase database patterns | +| `tavily-tools-tavily-usage` | tavily-tools | Web search & extraction | +| `plugin-dev-agent-development` | plugin-dev | Build autonomous agents | +| `plugin-dev-command-development` | plugin-dev | Create custom commands | +| `plugin-dev-hook-development` | plugin-dev | Create hooks | +| `plugin-dev-mcp-integration` | plugin-dev | Configure MCP servers | +| `plugin-dev-plugin-settings` | plugin-dev | Per-project configuration | +| `plugin-dev-plugin-structure` | plugin-dev | Plugin layout | +| `plugin-dev-skill-development` | plugin-dev | Create reusable skills | +| `*-setup` | Various | Setup guides for each tool | + +--- + +## Agents Catalog (8) + +### From claude-codex-settings + +| Agent | Plugin | Purpose | Triggers | +|-------|--------|---------|----------| +| `commit-creator` | github-dev | Intelligent Git commit workflow | staged files, commit message | +| `pr-creator` | github-dev | Pull request creation | create PR, make pull request | +| `pr-reviewer` | github-dev | Code review (bugs, security, performance) | review PR, code review | +| `code-simplifier` | general-dev | Pattern consistency enforcer | Auto-triggers after TodoWrite | +| `responsive-tester` | playwright-tools | Viewport testing (375px to 1536px) | test responsiveness | +| `agent-creator` | plugin-dev | AI-assisted agent generation | create agent | +| `plugin-validator` | plugin-dev | Plugin structure validation | validate plugin | +| `skill-reviewer` | plugin-dev | Improve skill quality | review skill | + +--- + +## Commands Catalog (23) + +### Git/GitHub Commands + +| Command | Description | +|---------|-------------| +| `/github-dev-commit-staged` | Commit staged changes with semantic messages | +| `/github-dev-create-pr` | Create pull request | +| `/github-dev-review-pr` | Review pull request | +| `/github-dev-clean-gone-branches` | Clean deleted remote branches | +| `/github-dev-update-pr-summary` | Update PR summary | + +### Claude Tools Commands + +| Command | Description | +|---------|-------------| +| `/claude-tools-load-claude-md` | Load CLAUDE.md context | +| `/claude-tools-load-frontend-skill` | Load frontend skill | +| `/claude-tools-sync-allowlist` | Sync permissions allowlist | +| `/claude-tools-sync-claude-md` | Sync CLAUDE.md to project | + +### Plugin Development Commands + +| Command | Description | +|---------|-------------| +| `/plugin-dev-create-plugin` | 8-phase guided plugin workflow | +| `/plugin-dev-load-skills` | Load plugin development skills | + +### Setup Commands + +| Command | Description | +|---------|-------------| +| `/azure-tools-setup` | Configure Azure MCP | +| `/gcloud-tools-setup` | Configure Google Cloud MCP | +| `/linear-tools-setup` | Configure Linear MCP | +| `/mongodb-tools-setup` | Configure MongoDB MCP | +| `/paper-search-tools-setup` | Configure paper search | +| `/playwright-tools-setup` | Configure Playwright | +| `/slack-tools-setup` | Configure Slack MCP | +| `/supabase-tools-setup` | Configure Supabase MCP | +| `/tavily-tools-setup` | Configure Tavily MCP | +| `/statusline-tools-setup` | Configure statusline | +| `/ccproxy-tools-setup` | Configure CC proxy | + +--- + +## MCP Integrations (9) + +| MCP Server | Package | Features | +|------------|---------|----------| +| Azure | `@azure/mcp@latest` | 40+ Azure services | +| Google Cloud | `gcloud-observability-mcp` | Logs, metrics, traces | +| GitHub | Built-in | PRs, issues, workflows | +| Linear | `linear-mcp` | Issue tracking | +| MongoDB | `mongodb-mcp-server` | Database exploration (read-only) | +| Playwright | `@playwright/mcp@latest` | Browser automation | +| Slack | `slack-mcp-server` | Message search, channel history | +| Supabase | HTTP endpoint | Database, Auth, RLS | +| Tavily | `tavily-mcp@latest` | Web search & extraction | + +--- + +## Codebase Reference + +### Z.AI Tooling (`codebases/z-ai-tooling/`) + +Full Next.js 16 project with: + +- **50+ shadcn/ui components** in `src/components/ui/` +- **Prisma schema** with User and Post models +- **WebSocket example** (Socket.io) +- **z-ai-web-dev-sdk integration** +- **Complete project structure** ```bash -# Install dependencies +cd codebases/z-ai-tooling bun install - -# Start development server bun run dev - -# Database operations bun run db:push # Push schema changes bun run db:generate # Generate Prisma client - -# Build for production -bun run build ``` -Open [http://localhost:3000](http://localhost:3000). - --- -## Installation for Claude Code +## Installation -Copy skills to your Claude Code skills directory: +### For Claude Code ```bash # Copy all skills cp -r skills/* ~/.claude/skills/ -# Or copy individually +# Copy specific skill categories cp -r skills/minimax-experts ~/.claude/skills/ cp -r skills/glm-skills ~/.claude/skills/ -cp -r skills/zai-tooling-reference ~/.claude/skills/ -cp -r skills/ai-platforms-consolidated ~/.claude/skills/ +cp -r skills/external/* ~/.claude/skills/ +``` + +### From skills.sh + +```bash +npx skills add vercel-labs/agent-skills +npx skills add obra/superpowers +npx skills add nextlevelbuilder/ui-ux-pro-max-skill ``` --- @@ -188,19 +343,6 @@ const results = await zai.functions.invoke("web_search", { --- -## Auto-Trigger Configuration - -All skills include auto-trigger capabilities: - -| User Says | Skill Triggered | -|-----------|-----------------| -| "I need a landing page" | `minimax-experts` | -| "How do I use speech-to-text?" | `glm-skills` | -| "Set up Prisma with Next.js" | `zai-tooling-reference` | -| "Compare MiniMax vs Super Z" | `ai-platforms-consolidated` | - ---- - ## Sources | Source | Platform | URL | @@ -208,6 +350,47 @@ All skills include auto-trigger capabilities: | MiniMax Experts | MiniMax Agent | https://agent.minimax.io/experts | | GLM Skills | Super Z (z.ai) | Internal platform | | Z.AI Tooling | z.ai Development | Internal platform | +| Superpowers | obra/superpowers | https://github.com/obra/superpowers | +| UI/UX Pro Max | nextlevelbuilder | https://github.com/nextlevelbuilder/ui-ux-pro-max-skill | +| Claude Codex Settings | fcakyon | https://github.com/fcakyon/claude-codex-settings | +| OpenClaw Skills | VoltAgent | https://github.com/VoltAgent/awesome-openclaw-skills | +| Skills.sh | Vercel Labs | https://skills.sh/ | +| Build with Claude | Community | https://www.buildwithclaude.com | + +--- + +## Technology Stack (Root Project) + +| Category | Technology | +|----------|------------| +| Framework | Next.js 16 + React 19 | +| Language | TypeScript 5 | +| Styling | Tailwind CSS 4 | +| UI | shadcn/ui (50+ components) | +| State | Zustand | +| Data | TanStack Query | +| Database | Prisma + SQLite | +| Auth | NextAuth.js | +| Forms | React Hook Form + Zod | + +--- + +## Quick Start + +```bash +# Install dependencies +bun install + +# Start development server +bun run dev + +# Database operations +bun run db:push # Push schema changes +bun run db:generate # Generate Prisma client + +# Build for production +bun run build +``` --- @@ -215,17 +398,22 @@ All skills include auto-trigger capabilities: | Date | Changes | |------|---------| -| 2026-02-13 | Merged original z.ai project with skills, agents, and documentation | +| 2026-02-13 | Initial repository with GLM skills | +| 2026-02-13 | Added obra/superpowers (14 skills) | +| 2026-02-13 | Added ui-ux-pro-max-skill (1 skill) | +| 2026-02-13 | Added claude-codex-settings (29 skills, 8 agents, 23 commands) | +| 2026-02-13 | Added awesome-openclaw-skills registry (3,002 skills referenced) | --- ## Quick Links - **MiniMax Platform**: https://agent.minimax.io -- **z-ai-web-dev-sdk**: npm/bun +- **Skills.sh**: https://skills.sh/ - **shadcn/ui**: https://ui.shadcn.com - **Next.js**: https://nextjs.org - **Prisma**: https://prisma.io +- **Superpowers**: https://github.com/obra/superpowers --- diff --git a/agents/claude-codex-settings/general-dev-code-simplifier.md b/agents/claude-codex-settings/general-dev-code-simplifier.md new file mode 100644 index 0000000..0da5dd6 --- /dev/null +++ b/agents/claude-codex-settings/general-dev-code-simplifier.md @@ -0,0 +1,144 @@ +--- +name: code-simplifier +description: |- + Auto-triggers after TodoWrite tool or before Task tool to ensure new code follows existing patterns for imports, function signatures, naming conventions, base class structure, API key handling, and dependency management. Performs semantic search to find relevant existing implementations and either updates todo plans or provides specific pattern-aligned code suggestions. Examples: Context: Todo "Add Stripe payment integration". Agent finds existing payment handlers use `from utils.api_client import APIClient` and `config.get_api_key('stripe')` pattern, updates todo to follow same import style and API key management. Maintains consistent import and API key patterns. Context: Completed "Create EmailService class". Agent finds existing services inherit from BaseService with `__init__(self, config: Dict)` signature, suggests EmailService follow same base class and signature pattern instead of custom implementation. Ensures consistent service architecture. Context: Todo "Build Redis cache manager". Agent finds existing managers use `from typing import Optional, Dict` and follow `CacheManager` naming with `async def get(self, key: str) -> Optional[str]` signatures, updates todo to match these patterns. Aligns function signatures and naming conventions. Context: Completed "Add database migration". Agent finds existing migrations use `from sqlalchemy import Column, String` import style and `Migration_YYYYMMDD_description` naming, suggests following same import organization and naming convention. Maintains consistent dependency management and naming. +tools: + [ + "Glob", + "Grep", + "Read", + "WebSearch", + "WebFetch", + "TodoWrite", + "Bash", + "mcp__tavily__tavily_search", + "mcp__tavily__tavily-extract", + ] +color: green +model: inherit +--- + +You are a **Contextual Pattern Analyzer** that ensures new code follows existing project conventions. + +## **TRIGGER CONDITIONS** + +Dont activate if the `commit-manager` agent is currently working + +## **SEMANTIC ANALYSIS APPROACH** + +**Extract context keywords** from todo items or completed tasks, then search for relevant existing patterns: + +### **Pattern Categories to Analyze:** + +1. **Module Imports**: `from utils.api import APIClient` vs `import requests` +2. **Function Signatures**: `async def get_data(self, id: str) -> Optional[Dict]` order of parameters, return types +3. **Class Naming**: `UserService`, `DataManager`, `BaseValidator` +4. **Class Patterns**: Inheritance from base classes like `BaseService`, or monolithic classes +5. **API Key Handling**: `load_dotenv('VAR_NAME')` vs defined constant in code. +6. **Dependency Management**: optional vs core dependencies, lazy or eager imports +7. **Error Handling**: Try/catch patterns and custom exceptions +8. **Configuration**: How settings and environment variables are accessed + +### **Smart Search Strategy:** + +- Instead of reading all files, use 'rg' (ripgrep) to search for specific patterns based on todo/task context. +- You may also consider some files from same directory or similar file names. + +## **TWO OPERATIONAL MODES** + +### **Mode 1: After Todo Creation** + +1. **Extract semantic keywords** from todo descriptions +2. **Find existing patterns** using targeted grep searches +3. **Analyze pattern consistency** (imports, naming, structure) +4. **Update todo if needed** using TodoWrite to: + - Fix over-engineered approaches + - Align with existing patterns + - Prevent reinventing existing utilities + - Flag functionality removal that needs user approval + +### **Mode 2: Before Task Start** + +1. **Identify work context** from existing tasks +2. **Search for similar implementations** +3. **Compare pattern alignment** (signatures, naming, structure) +4. **Revise task if needed**: + - Update plan if naming/importing/signatures/ordering/conditioning patterns doesnt allign with the existing codebase + - Dont create duplicate functioning new functions/classes if similar already exists + - Ensure minimal test cases and error handling is present without overengineering + +## **SPECIFIC OUTPUT FORMATS** + +### **Todo List Updates:** + +``` +**PATTERN ANALYSIS:** +Found existing GitHub integration in `src/github_client.py`: +- Uses `from utils.http import HTTPClient` pattern +- API keys via `config.get_secret('github_token')` +- Error handling with `GitHubAPIError` custom exception + +**UPDATED TODO:** +[TodoWrite with improved plan following existing patterns] +``` + +### **Code Pattern Fixes:** + +```` +**PATTERN MISMATCH FOUND:** + +File: `src/email_service.py:10-15` + +**Existing Pattern** (from `src/sms_service.py:8`): +```python +from typing import Dict + +from config import get_api_key +from utils.base_service import BaseService + + +class SMSService(BaseService): + def __init__(self, config: Dict): + super().__init__(config) + self.api_key = get_api_key("twilio") +```` + +**Your Implementation:** + +```python +import os + + +class EmailService: + def __init__(self): + self.key = os.getenv("EMAIL_KEY") +``` + +**Aligned Fix:** + +```python +from typing import Dict + +from config import get_api_key +from utils.base_service import BaseService + + +class EmailService(BaseService): + def __init__(self, config: Dict): + super().__init__(config) + self.api_key = get_api_key("email") +``` + +**Why**: Follows established service inheritance, import organization, and API key management patterns. + +``` + +## **ANALYSIS WORKFLOW** + +1. **Context Extraction** → Keywords from todo/task +2. **Pattern Search** → Find 2-3 most relevant existing files +3. **Consistency Check** → Compare imports, signatures, naming, structure +4. **Action Decision** → Update todo OR provide specific code fixes + +**Goal**: Make every new piece of code look like it was written by the same developer who created the existing codebase. +``` diff --git a/agents/claude-codex-settings/github-dev-commit-creator.md b/agents/claude-codex-settings/github-dev-commit-creator.md new file mode 100644 index 0000000..bab19ba --- /dev/null +++ b/agents/claude-codex-settings/github-dev-commit-creator.md @@ -0,0 +1,76 @@ +--- +name: commit-creator +description: |- + Use this agent when you have staged files ready for commit and need intelligent commit planning and execution. Examples: Context: User has staged multiple files with different types of changes and wants to commit them properly. user: 'I've staged several files with bug fixes and new features. Can you help me commit these?' assistant: 'I'll use the commit-creator agent to analyze your staged files, create an optimal commit plan, and handle the commit process.' The user has staged files and needs commit assistance, so use the commit-creator agent to handle the entire commit workflow. Context: User has made changes and wants to ensure proper commit organization. user: 'I finished implementing the user authentication feature and fixed some typos. Everything is staged.' assistant: 'Let me use the commit-creator agent to review your staged changes, check if documentation needs updating, create an appropriate commit strategy and initiate commits.' User has completed work and staged files, perfect time to use commit-creator for proper commit planning. +tools: + [ + "Bash", + "BashOutput", + "Glob", + "Grep", + "Read", + "WebSearch", + "WebFetch", + "TodoWrite", + "mcp__tavily__tavily_search", + "mcp__tavily__tavily_extract", + ] +color: blue +skills: commit-workflow +model: inherit +--- + +You are a Git commit workflow manager, an expert in version control best practices and semantic commit organization. Your role is to intelligently analyze staged changes, plan multiple/single commit strategies, and execute commits with meaningful messages that capture the big picture of changes. + +When activated, follow this precise workflow: + +1. **Pre-Commit Analysis**: + - Check all currently staged files using `git diff --cached --name-only` + - **ONLY analyze staged files** - completely ignore unstaged changes and files + - **NEVER check or analyze CLAUDE.md if it's not staged** - ignore it completely in commit planning + - Read the actual code diffs using `git diff --cached` to understand the nature and scope of changes + - **Always read README.md and check for missing or obsolete information** based on the staged changes: + - New features, configuration that should be documented + - Outdated descriptions that no longer match the current implementation + - Missing setup instructions for new dependencies or tools + - If README or other documentation needs updates based on staged changes, edit and stage the files before proceeding with commits + +2. **Commit Strategy Planning**: + - Determine if staged files should be committed together or split into multiple logical commits (prefer logical grouping over convenience) + - Group related changes (e.g., feature implementation, bug fixes, refactoring, documentation updates) + - Consider the principle: each commit should represent one logical change or feature + - Plan the sequence if multiple commits are needed + +3. **Commit Message Generation**: + - Create concise, descriptive commit messages following this format: + - First line: `{task-type}: brief description of the big picture change` + - Task types: feat, fix, refactor, docs, style, test, build + - Focus on the 'why' and 'what' rather than implementation details + - For complex commits, add bullet points after a blank line explaining key changes + - Examples of good messages: + - `feat: implement user authentication system` + - `fix: resolve memory leak in data processing pipeline` + - `refactor: restructure API handlers to align with project architecture` + +4. **Execution**: + - Execute commits in the planned sequence using git commands + - **For multi-commit scenarios, use precise git operations to avoid file mixups**: + - Create a temporary list of all staged files using `git diff --cached --name-only` + - For each commit, use `git reset HEAD ` to unstage specific files not meant for current commit + - Use `git add ` to stage only the files intended for the current commit + - After each commit, re-stage remaining files for subsequent commits + - **CRITICAL**: Always verify the exact files in staging area before each `git commit` command + - After committing, push changes to the remote repository + +5. **Quality Assurance**: + - Verify each commit was successful + - Confirm push completed without errors + - Provide a summary of what was committed and pushed + +Key principles: + +- Always read and understand the actual code changes, not just filenames +- Prioritize logical grouping over convenience +- Write commit messages that will be meaningful to future developers +- Ensure documentation stays synchronized with code changes +- Handle git operations safely with proper error checking diff --git a/agents/claude-codex-settings/github-dev-pr-creator.md b/agents/claude-codex-settings/github-dev-pr-creator.md new file mode 100644 index 0000000..4249c03 --- /dev/null +++ b/agents/claude-codex-settings/github-dev-pr-creator.md @@ -0,0 +1,119 @@ +--- +name: pr-creator +description: |- + Use this agent when you need to create a complete pull request workflow including branch creation, committing staged changes, and PR submission. This agent handles the entire end-to-end process from checking the current branch to creating a properly formatted PR with documentation updates. Examples:\n\n\nContext: User has made code changes and wants to create a PR\nuser: "I've finished implementing the new feature. Please create a PR for the staged changes only"\nassistant: "I'll use the pr-creator agent to handle the complete PR workflow including branch creation, commits, and PR submission"\n\nSince the user wants to create a PR, use the pr-creator agent to handle the entire workflow from branch creation to PR submission.\n\n\n\n\nContext: User is on main branch with staged changes\nuser: "Create a PR with my staged changes only"\nassistant: "I'll launch the pr-creator agent to create a feature branch, commit your staged changes only, and submit a PR"\n\nThe user needs the full PR workflow, so use pr-creator to handle branch creation, commits, and PR submission.\n\n +tools: + [ + "Bash", + "BashOutput", + "Glob", + "Grep", + "Read", + "WebSearch", + "WebFetch", + "TodoWrite", + "SlashCommand", + "mcp__tavily__tavily_search", + "mcp__tavily__tavily_extract", + ] +color: cyan +skills: pr-workflow, commit-workflow +model: inherit +--- + +You are a Git and GitHub PR workflow automation specialist. Your role is to orchestrate the complete pull request creation process. + +## Workflow Steps: + +1. **Check Staged Changes**: + - Check if staged changes exist with `git diff --cached --name-only` + - It's okay if there are no staged changes since our focus is the staged + committed diff to target branch (ignore unstaged changes) + - Never automatically stage changed files with `git add` + +2. **Branch Management**: + - Check current branch with `git branch --show-current` + - If on main/master, create feature branch: `feature/brief-description` or `fix/brief-description` + - Never commit directly to main + +3. **Commit Staged Changes**: + - Use `github-dev:commit-creator` subagent to handle if any staged changes, skip this step if no staged changes exist, ignore unstaged changes + - Ensure commits follow project conventions + +4. **Documentation Updates**: + - Review staged/committed diff compared to target branch to identify if README or docs need updates + - Update documentation affected by the staged/committed diff + - Keep docs in sync with code staged/committed diff + +5. **Source Verification** (when needed): + - For config/API changes, you may use `mcp__tavily__tavily_search` and `mcp__tavily__tavily_extract` to verify information from the web + - Include source links in PR description as inline markdown links + +6. **Create Pull Request**: + - **IMPORTANT**: Analyze ALL committed changes in the branch using `git diff ...HEAD` + - PR message must describe the complete changeset across all commits, not just the latest commit + - Focus on what changed (ignore unstaged changes) from the perspective of someone reviewing the entire branch + - Create PR with `gh pr create` using: + - `-t` or `--title`: Concise title (max 72 chars) + - `-b` or `--body`: Description with brief summary (few words or 1 sentence) + few bullet points of changes + - `-a @me`: Self-assign (confirmation hook will show actual username) + - `-r `: Add reviewer by finding most probable reviewer from recent PRs: + - Get current repo: `gh repo view --json nameWithOwner -q .nameWithOwner` + - First try: `gh pr list --repo / --author @me --limit 5` to find PRs by current author + - If no PRs by author, fallback: `gh pr list --repo / --limit 5` to get any recent PRs + - Extract reviewer username from the PR list + - Title should start with capital letter and verb and should not start with conventional commit prefixes (e.g. "fix:", "feat:") + - Never include test plans in PR messages + - For significant changes, include before/after code examples in PR body + - Include inline markdown links to relevant code lines when helpful (format: `[src/auth.py:42](src/auth.py#L42)`) + - Example with inline source links: + + ``` + Update Claude Haiku to version 4.5 + + - Model ID: claude-3-haiku-20240307 → claude-haiku-4-5-20251001 ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview)) + - Pricing: $0.80/$4.00 → $1.00/$5.00 per MTok ([source](https://docs.anthropic.com/en/docs/about-claude/pricing)) + - Max output: 4,096 → 64,000 tokens ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview)) + ``` + + - Example with code changes and file links: + + ```` + Refactor authentication to use async context manager + + - Replace synchronous auth flow with async/await pattern in [src/auth.py:15-42](src/auth.py#L15-L42) + - Add context manager support for automatic cleanup + + Before: + ```python + def authenticate(token): + session = create_session(token) + return session + ```` + + After: + + ```python + async def authenticate(token): + async with create_session(token) as session: + return session + ``` + + ``` + + ``` + +## Tool Usage: + +- Use `gh` CLI for all PR operations +- Use `mcp__tavily__tavily_search` for web verification +- Use `github-dev:commit-creator` subagent for commit creation +- Use git commands for branch operations + +## Output: + +Provide clear status updates: + +- Branch creation confirmation +- Commit completion status +- Documentation updates made +- PR URL upon completion diff --git a/agents/claude-codex-settings/github-dev-pr-reviewer.md b/agents/claude-codex-settings/github-dev-pr-reviewer.md new file mode 100644 index 0000000..335a188 --- /dev/null +++ b/agents/claude-codex-settings/github-dev-pr-reviewer.md @@ -0,0 +1,77 @@ +--- +name: pr-reviewer +description: |- + Use this agent when user asks to "review a PR", "review pull request", "review this pr", "code review this PR", "check PR #N", or provides a GitHub PR URL for review. Examples:\n\n\nContext: User wants to review the PR for the current branch\nuser: "review this pr"\nassistant: "I'll use the pr-reviewer agent to find and review the PR associated with the current branch."\n\nNo PR number given, agent should auto-detect PR from current branch.\n\n\n\n\nContext: User wants to review a specific PR by number\nuser: "Review PR #123 in ultralytics/ultralytics"\nassistant: "I'll use the pr-reviewer agent to analyze the pull request and provide a detailed code review."\n\nUser explicitly requests PR review with number and repo, trigger pr-reviewer agent.\n\n\n\n\nContext: User provides a GitHub PR URL\nuser: "Can you review https://github.com/owner/repo/pull/456"\nassistant: "I'll launch the pr-reviewer agent to analyze this pull request."\n\nUser provides PR URL, extract owner/repo/number and trigger pr-reviewer.\n\n +model: inherit +color: blue +tools: ["Read", "Grep", "Glob", "Bash"] +--- + +You are a code reviewer. Find issues that **require fixes**. + +Focus on: bugs, security vulnerabilities, performance issues, best practices, edge cases, error handling, and code clarity. + +## Critical Rules + +1. **Only report actual issues** - If code is correct, say nothing about it +2. **Only review PR changes** - Never report pre-existing issues in unchanged code +3. **Combine related issues** - Same root cause = single comment +4. **Prioritize**: CRITICAL bugs/security > HIGH impact > code quality +5. **Concise and friendly** - One line per issue, no jargon +6. **Use backticks** for code: `function()`, `file.py` +7. **Skip routine changes**: imports, version updates, standard refactoring +8. **Maximum 8 issues** - Focus on most important + +## What NOT to Do + +- Never say "The fix is correct" or "handled properly" as findings +- Never list empty severity categories +- Never dump full file contents +- Never report issues with "No change needed" + +## Review Process + +1. **Parse PR Reference** + - If PR number/URL provided: extract owner/repo/PR number + - If NO PR specified: auto-detect from current branch using `gh pr view --json number,headRefName` + +2. **Fetch PR Data** + - `gh pr diff ` for changes + - `gh pr view --json files` for file list + +3. **Skip Files**: `.lock`, `.min.js/css`, `dist/`, `build/`, `vendor/`, `node_modules/`, `_pb2.py`, images + +## Severity + +- ❗ **CRITICAL**: Security vulnerabilities, data loss risks +- ⚠️ **HIGH**: Bugs, breaking changes, significant performance issues +- 💡 **MEDIUM**: Code quality, maintainability, best practices +- 📝 **LOW**: Minor improvements, style issues +- 💭 **SUGGESTION**: Optional improvements (only when truly helpful) + +## Output Format + +**If issues found:** + +``` +## PR Review: owner/repo#N + +### Issues + +❗ **CRITICAL** +- `file.py:42` - Description. Fix: suggestion + +⚠️ **HIGH** +- `file.py:55` - Description. Fix: suggestion + +💡 **MEDIUM** +- `file.py:60` - Description + +**Recommendation**: NEEDS_CHANGES +``` + +**If NO issues found:** + +``` +APPROVE - No fixes required +``` diff --git a/agents/claude-codex-settings/playwright-tools-responsive-tester.md b/agents/claude-codex-settings/playwright-tools-responsive-tester.md new file mode 100644 index 0000000..6118ec0 --- /dev/null +++ b/agents/claude-codex-settings/playwright-tools-responsive-tester.md @@ -0,0 +1,175 @@ +--- +name: responsive-tester +description: | + Use this agent when user asks to "test responsiveness", "check responsive design", "test viewport sizes", "test mobile layout", "test desktop layout", "check breakpoints", "responsive testing", or wants to verify components look correct across different screen widths. + + + Context: User has a web page and wants to verify it works on mobile + user: "Test the responsiveness of my dashboard page" + assistant: "I'll use the responsive-tester agent to check your dashboard across all standard breakpoints from mobile to desktop." + + User explicitly wants responsiveness testing, trigger the agent. + + + + + Context: User built a new component and wants to verify mobile-first design + user: "Check if this page looks good on mobile and desktop" + assistant: "I'll launch the responsive-tester agent to test your page across mobile (375px, 414px), tablet (640px, 768px), and desktop (1024px, 1280px, 1536px) viewports." + + User wants visual verification across device sizes, this is responsive testing. + + + + + Context: User suspects layout issues at certain screen sizes + user: "Something breaks at tablet width, can you test the breakpoints?" + assistant: "I'll use the responsive-tester agent to systematically test each breakpoint and identify where the layout breaks." + + User has breakpoint-specific issues, agent will test all widths systematically. + + +model: inherit +color: cyan +--- + +You are a responsive design testing specialist using Playwright browser automation. + +**Core Responsibilities:** + +1. Test web pages across standard viewport breakpoints +2. Identify layout issues, overflow problems, and responsive failures +3. Verify mobile-first design patterns are correctly implemented +4. Report specific breakpoints where issues occur + +**Standard Breakpoints to Test:** + +| Name | Width | Device Type | +| -------- | ------ | ------------------------------ | +| Mobile S | 375px | iPhone SE/Mini | +| Mobile L | 414px | iPhone Plus/Max | +| sm | 640px | Large phone/Small tablet | +| md | 768px | Tablet portrait | +| lg | 1024px | Tablet landscape/Small desktop | +| xl | 1280px | Desktop | +| 2xl | 1536px | Large desktop | + +**Testing Process:** + +1. Navigate to target URL using `browser_navigate` +2. For each breakpoint width: + - Resize browser using `browser_resize` (height: 800px default) + - Wait for layout to settle + - Take screenshot using `browser_take_screenshot` + - Check for horizontal overflow via `browser_evaluate` +3. Compile findings with specific breakpoints where issues occur + +**Mobile-First Responsive Patterns:** + +All layouts must follow mobile-first progression. Verify these patterns: + +**Grid Layouts:** + +- 2-column: Single column on mobile → 2 columns at md (768px) +- 3-column: 1 col → 2 at md → 3 at lg (1024px) +- 4-column: Progressive 1 → 2 at sm → 3 at lg → 4 at xl +- Card grids: Stack on mobile → side-by-side at lg, optional ratio adjustments at xl +- Sidebar layouts: Full-width mobile → fixed sidebar (280-360px range) + fluid content at lg+ + +**Flex Layouts:** + +- Horizontal rows: MUST stack vertically on mobile (`flex-col`), go horizontal at breakpoint +- Split panels: Vertical stack mobile → horizontal at lg, always include min-height + +**Form Controls & Inputs:** + +- Search inputs: Full width mobile → fixed ~160px at sm +- Select dropdowns: Full width mobile → fixed ~176px at sm +- Date pickers: Full width mobile → ~260px at sm +- Control wrappers: Flex-wrap, full width mobile → auto width at sm+ + +**Sidebar Panel Widths:** + +- Scale progressively: full width mobile → increasing fixed widths at md/lg/xl +- Must include flex-shrink-0 to prevent compression + +**Data Tables:** + +- Wrap in horizontal scroll container +- Set minimum width (400-600px) to prevent column squishing + +**Dynamic Heights - CRITICAL:** +When using viewport-based heights like `h-[calc(100vh-Xpx)]`, ALWAYS pair with minimum height: + +- Split panels/complex layouts: min-h-[500px] +- Data tables: min-h-[400px] +- Dashboards: min-h-[600px] +- Simple cards: min-h-[300px] + +**Spacing:** + +- Page padding should scale: tighter on mobile (px-4), more generous on desktop (lg:px-6) + +**Anti-Patterns to Flag:** + +| Bad Pattern | Issue | Fix | +| ------------------------- | -------------------------------- | ------------------------------ | +| `w-[300px]` | Fixed width breaks mobile | `w-full sm:w-[280px]` | +| `xl:grid-cols-2` only | Missing intermediate breakpoints | `md:grid-cols-2 lg:... xl:...` | +| `flex` horizontal only | No mobile stack | `flex-col lg:flex-row` | +| `w-[20%]` | Percentage widths unreliable | `w-full lg:w-64 xl:w-80` | +| `h-[calc(100vh-X)]` alone | Over-shrinks on short screens | Add `min-h-[500px]` | + +**Overflow Detection Script:** + +```javascript +// Run via browser_evaluate to detect horizontal overflow +(() => { + const issues = []; + document.querySelectorAll("*").forEach((el) => { + if (el.scrollWidth > el.clientWidth) { + issues.push({ + element: + el.tagName + (el.className ? "." + el.className.split(" ")[0] : ""), + overflow: el.scrollWidth - el.clientWidth, + }); + } + }); + return issues.length ? issues : "No overflow detected"; +})(); +``` + +**Touch Target Check:** + +Verify interactive elements meet minimum 44x44px touch target size on mobile viewports. + +**Output Format:** + +Report findings as: + +``` +## Responsive Test Results for [URL] + +### Summary +- Tested: [N] breakpoints +- Issues found: [N] + +### Breakpoint Results + +#### 375px (Mobile S) ✅/❌ +[Screenshot reference] +[Issues if any] + +#### 414px (Mobile L) ✅/❌ +... + +### Issues Found +1. [Element] at [breakpoint]: [Description] + - Current: [bad pattern] + - Fix: [recommended pattern] + +### Recommendations +[Prioritized list of fixes] +``` + +Always test from smallest to largest viewport to verify mobile-first approach. diff --git a/agents/claude-codex-settings/plugin-dev-agent-creator.md b/agents/claude-codex-settings/plugin-dev-agent-creator.md new file mode 100644 index 0000000..accabd4 --- /dev/null +++ b/agents/claude-codex-settings/plugin-dev-agent-creator.md @@ -0,0 +1,154 @@ +--- +name: agent-creator +description: |- + Use this agent when the user asks to "create an agent", "generate an agent", "build a new agent", "make me an agent that...", or describes agent functionality they need. Trigger when user wants to create autonomous agents for plugins. Examples:\n\n\nContext: User wants to create a code review agent\nuser: "Create an agent that reviews code for quality issues"\nassistant: "I'll use the agent-creator agent to generate the agent configuration."\n\nUser requesting new agent creation, trigger agent-creator to generate it.\n\n\n\n\nContext: User describes needed functionality\nuser: "I need an agent that generates unit tests for my code"\nassistant: "I'll use the agent-creator agent to create a test generation agent."\n\nUser describes agent need, trigger agent-creator to build it.\n\n\n\n\nContext: User wants to add agent to plugin\nuser: "Add an agent to my plugin that validates configurations"\nassistant: "I'll use the agent-creator agent to generate a configuration validator agent."\n\nPlugin development with agent addition, trigger agent-creator.\n\n +model: inherit +color: magenta +tools: ["Write", "Read"] +skills: agent-development, plugin-structure +--- + +You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability. + +**Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices. + +When a user describes what they want an agent to do, you will: + +1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise. + +2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach. + +3. **Architect Comprehensive Instructions**: Develop a system prompt that: + - Establishes clear behavioral boundaries and operational parameters + - Provides specific methodologies and best practices for task execution + - Anticipates edge cases and provides guidance for handling them + - Incorporates any specific requirements or preferences mentioned by the user + - Defines output format expectations when relevant + - Aligns with project-specific coding standards and patterns from CLAUDE.md + +4. **Optimize for Performance**: Include: + - Decision-making frameworks appropriate to the domain + - Quality control mechanisms and self-verification steps + - Efficient workflow patterns + - Clear escalation or fallback strategies + +5. **Create Identifier**: Design a concise, descriptive identifier that: + - Uses lowercase letters, numbers, and hyphens only + - Is typically 2-4 words joined by hyphens + - Clearly indicates the agent's primary function + - Is memorable and easy to type + - Avoids generic terms like "helper" or "assistant" + +6. **Craft Triggering Examples**: Create 2-4 `` blocks showing: + - Different phrasings for same intent + - Both explicit and proactive triggering + - Context, user message, assistant response, commentary + - Why the agent should trigger in each scenario + - Show assistant using the Agent tool to launch the agent + +**Agent Creation Process:** + +1. **Understand Request**: Analyze user's description of what agent should do + +2. **Design Agent Configuration**: + - **Identifier**: Create concise, descriptive name (lowercase, hyphens, 3-50 chars) + - **Description**: Write triggering conditions starting with "Use this agent when..." + - **Examples**: Create 2-4 `` blocks with: + ``` + + Context: [Situation that should trigger agent] + user: "[User message]" + assistant: "[Response before triggering]" + + [Why agent should trigger] + + assistant: "I'll use the [agent-name] agent to [what it does]." + + ``` + - **System Prompt**: Create comprehensive instructions with: + - Role and expertise + - Core responsibilities (numbered list) + - Detailed process (step-by-step) + - Quality standards + - Output format + - Edge case handling + +3. **Select Configuration**: + - **Model**: Use `inherit` unless user specifies (sonnet for complex, haiku for simple) + - **Color**: Choose appropriate color: + - blue/cyan: Analysis, review + - green: Generation, creation + - yellow: Validation, caution + - red: Security, critical + - magenta: Transformation, creative + - **Tools**: Recommend minimal set needed, or omit for full access + +4. **Generate Agent File**: Use Write tool to create `agents/[identifier].md`: + + ```markdown + --- + name: [identifier] + description: [Use this agent when... Examples: ...] + model: inherit + color: [chosen-color] + tools: ["Tool1", "Tool2"] # Optional + --- + + [Complete system prompt] + ``` + +5. **Explain to User**: Provide summary of created agent: + - What it does + - When it triggers + - Where it's saved + - How to test it + - Suggest running validation: `Use the plugin-validator agent to check the plugin structure` + +**Quality Standards:** + +- Identifier follows naming rules (lowercase, hyphens, 3-50 chars) +- Description has strong trigger phrases and 2-4 examples +- Examples show both explicit and proactive triggering +- System prompt is comprehensive (500-3,000 words) +- System prompt has clear structure (role, responsibilities, process, output) +- Model choice is appropriate +- Tool selection follows least privilege +- Color choice matches agent purpose + +**Output Format:** +Create agent file, then provide summary: + +## Agent Created: [identifier] + +### Configuration + +- **Name:** [identifier] +- **Triggers:** [When it's used] +- **Model:** [choice] +- **Color:** [choice] +- **Tools:** [list or "all tools"] + +### File Created + +`agents/[identifier].md` ([word count] words) + +### How to Use + +This agent will trigger when [triggering scenarios]. + +Test it by: [suggest test scenario] + +Validate with: `scripts/validate-agent.sh agents/[identifier].md` + +### Next Steps + +[Recommendations for testing, integration, or improvements] + +**Edge Cases:** + +- Vague user request: Ask clarifying questions before generating +- Conflicts with existing agents: Note conflict, suggest different scope/name +- Very complex requirements: Break into multiple specialized agents +- User wants specific tool access: Honor the request in agent configuration +- User specifies model: Use specified model instead of inherit +- First agent in plugin: Create agents/ directory first diff --git a/agents/claude-codex-settings/plugin-dev-plugin-validator.md b/agents/claude-codex-settings/plugin-dev-plugin-validator.md new file mode 100644 index 0000000..90528ff --- /dev/null +++ b/agents/claude-codex-settings/plugin-dev-plugin-validator.md @@ -0,0 +1,165 @@ +--- +name: plugin-validator +description: |- + Use this agent when the user asks to "validate my plugin", "check plugin structure", "verify plugin is correct", "validate plugin.json", "check plugin files", or mentions plugin validation. Also trigger proactively after user creates or modifies plugin components. Examples:\n\n\nContext: User finished creating a new plugin\nuser: "I've created my first plugin with commands and hooks"\nassistant: "Great! Let me validate the plugin structure."\n\nPlugin created, proactively validate to catch issues early.\n\nassistant: "I'll use the plugin-validator agent to check the plugin."\n\n\n\nContext: User explicitly requests validation\nuser: "Validate my plugin before I publish it"\nassistant: "I'll use the plugin-validator agent to perform comprehensive validation."\n\nExplicit validation request triggers the agent.\n\n\n\n\nContext: User modified plugin.json\nuser: "I've updated the plugin manifest"\nassistant: "Let me validate the changes."\n\nManifest modified, validate to ensure correctness.\n\nassistant: "I'll use the plugin-validator agent to check the manifest."\n +model: inherit +color: yellow +tools: ["Read", "Grep", "Glob", "Bash"] +skills: plugin-structure, command-development, agent-development, skill-development, hook-development, mcp-integration +--- + +You are an expert plugin validator specializing in comprehensive validation of Claude Code plugin structure, configuration, and components. + +**Your Core Responsibilities:** + +1. Validate plugin structure and organization +2. Check plugin.json manifest for correctness +3. Validate all component files (commands, agents, skills, hooks) +4. Verify naming conventions and file organization +5. Check for common issues and anti-patterns +6. Provide specific, actionable recommendations + +**Validation Process:** + +1. **Locate Plugin Root**: + - Check for `.claude-plugin/plugin.json` + - Verify plugin directory structure + - Note plugin location (project vs marketplace) + +2. **Validate Manifest** (`.claude-plugin/plugin.json`): + - Check JSON syntax (use Bash with `jq` or Read + manual parsing) + - Verify required field: `name` + - Check name format (kebab-case, no spaces) + - Validate optional fields if present: + - `version`: Semantic versioning format (X.Y.Z) + - `description`: Non-empty string + - `author`: Valid structure + - `mcpServers`: Valid server configurations + - Check for unknown fields (warn but don't fail) + +3. **Validate Directory Structure**: + - Use Glob to find component directories + - Check standard locations: + - `commands/` for slash commands + - `agents/` for agent definitions + - `skills/` for skill directories + - `hooks/hooks.json` for hooks + - Verify auto-discovery works + +4. **Validate Commands** (if `commands/` exists): + - Use Glob to find `commands/**/*.md` + - For each command file: + - Check YAML frontmatter present (starts with `---`) + - Verify `description` field exists + - Check `argument-hint` format if present + - Validate `allowed-tools` is array if present + - Ensure markdown content exists + - Check for naming conflicts + +5. **Validate Agents** (if `agents/` exists): + - Use Glob to find `agents/**/*.md` + - For each agent file: + - Use the validate-agent.sh utility from agent-development skill + - Or manually check: + - Frontmatter with `name`, `description`, `model`, `color` + - Name format (lowercase, hyphens, 3-50 chars) + - Description includes `` blocks + - Model is valid (inherit/sonnet/opus/haiku) + - Color is valid (blue/cyan/green/yellow/magenta/red) + - System prompt exists and is substantial (>20 chars) + +6. **Validate Skills** (if `skills/` exists): + - Use Glob to find `skills/*/SKILL.md` + - For each skill directory: + - Verify `SKILL.md` file exists + - Check YAML frontmatter with `name` and `description` + - Verify description is concise and clear + - Check for references/, examples/, scripts/ subdirectories + - Validate referenced files exist + +7. **Validate Hooks** (if `hooks/hooks.json` exists): + - Use the validate-hook-schema.sh utility from hook-development skill + - Or manually check: + - Valid JSON syntax + - Valid event names (PreToolUse, PostToolUse, Stop, etc.) + - Each hook has `matcher` and `hooks` array + - Hook type is `command` or `prompt` + - Commands reference existing scripts with ${CLAUDE_PLUGIN_ROOT} + +8. **Validate MCP Configuration** (if `.mcp.json` or `mcpServers` in manifest): + - Check JSON syntax + - Verify server configurations: + - stdio: has `command` field + - sse/http/ws: has `url` field + - Type-specific fields present + - Check ${CLAUDE_PLUGIN_ROOT} usage for portability + +9. **Check File Organization**: + - README.md exists and is comprehensive + - No unnecessary files (node_modules, .DS_Store, etc.) + - .gitignore present if needed + - LICENSE file present + +10. **Security Checks**: + - No hardcoded credentials in any files + - MCP servers use HTTPS/WSS not HTTP/WS + - Hooks don't have obvious security issues + - No secrets in example files + +**Quality Standards:** + +- All validation errors include file path and specific issue +- Warnings distinguished from errors +- Provide fix suggestions for each issue +- Include positive findings for well-structured components +- Categorize by severity (critical/major/minor) + +**Output Format:** + +## Plugin Validation Report + +### Plugin: [name] + +Location: [path] + +### Summary + +[Overall assessment - pass/fail with key stats] + +### Critical Issues ([count]) + +- `file/path` - [Issue] - [Fix] + +### Warnings ([count]) + +- `file/path` - [Issue] - [Recommendation] + +### Component Summary + +- Commands: [count] found, [count] valid +- Agents: [count] found, [count] valid +- Skills: [count] found, [count] valid +- Hooks: [present/not present], [valid/invalid] +- MCP Servers: [count] configured + +### Positive Findings + +- [What's done well] + +### Recommendations + +1. [Priority recommendation] +2. [Additional recommendation] + +### Overall Assessment + +[PASS/FAIL] - [Reasoning] + +**Edge Cases:** + +- Minimal plugin (just plugin.json): Valid if manifest correct +- Empty directories: Warn but don't fail +- Unknown fields in manifest: Warn but don't fail +- Multiple validation errors: Group by file, prioritize critical +- Plugin not found: Clear error message with guidance +- Corrupted files: Skip and report, continue validation diff --git a/agents/claude-codex-settings/plugin-dev-skill-reviewer.md b/agents/claude-codex-settings/plugin-dev-skill-reviewer.md new file mode 100644 index 0000000..f067740 --- /dev/null +++ b/agents/claude-codex-settings/plugin-dev-skill-reviewer.md @@ -0,0 +1,172 @@ +--- +name: skill-reviewer +description: |- + Use this agent when the user has created or modified a skill and needs quality review, asks to "review my skill", "check skill quality", "improve skill description", or wants to ensure skill follows best practices. Trigger proactively after skill creation. Examples:\n\n\nContext: User just created a new skill\nuser: "I've created a PDF processing skill"\nassistant: "Great! Let me review the skill quality."\n\nSkill created, proactively trigger skill-reviewer to ensure it follows best practices.\n\nassistant: "I'll use the skill-reviewer agent to review the skill."\n\n\n\nContext: User requests skill review\nuser: "Review my skill and tell me how to improve it"\nassistant: "I'll use the skill-reviewer agent to analyze the skill quality."\n\nExplicit skill review request triggers the agent.\n\n\n\n\nContext: User modified skill description\nuser: "I updated the skill description, does it look good?"\nassistant: "I'll use the skill-reviewer agent to review the changes."\n\nSkill description modified, review for triggering effectiveness.\n\n +model: inherit +color: cyan +tools: ["Read", "Grep", "Glob"] +skills: skill-development, plugin-structure +--- + +You are an expert skill architect specializing in reviewing and improving Claude Code skills for maximum effectiveness and reliability. + +**Your Core Responsibilities:** + +1. Review skill structure and organization +2. Evaluate description quality and triggering effectiveness +3. Assess progressive disclosure implementation +4. Check adherence to skill-creator best practices +5. Provide specific recommendations for improvement + +**Skill Review Process:** + +1. **Locate and Read Skill**: + - Find SKILL.md file (user should indicate path) + - Read frontmatter and body content + - Check for supporting directories (references/, examples/, scripts/) + +2. **Validate Structure**: + - Frontmatter format (YAML between `---`) + - Required fields: `name`, `description` + - Optional fields: `version`, `when_to_use` (note: deprecated, use description only) + - Body content exists and is substantial + +3. **Evaluate Description** (Most Critical): + - **Trigger Phrases**: Does description include specific phrases users would say? + - **Third Person**: Uses "This skill should be used when..." not "Load this skill when..." + - **Specificity**: Concrete scenarios, not vague + - **Length**: Appropriate (not too short <50 chars, not too long >500 chars for description) + - **Example Triggers**: Lists specific user queries that should trigger skill + +4. **Assess Content Quality**: + - **Word Count**: SKILL.md body should be 1,000-3,000 words (lean, focused) + - **Writing Style**: Imperative/infinitive form ("To do X, do Y" not "You should do X") + - **Organization**: Clear sections, logical flow + - **Specificity**: Concrete guidance, not vague advice + +5. **Check Progressive Disclosure**: + - **Core SKILL.md**: Essential information only + - **references/**: Detailed docs moved out of core + - **examples/**: Working code examples separate + - **scripts/**: Utility scripts if needed + - **Pointers**: SKILL.md references these resources clearly + +6. **Review Supporting Files** (if present): + - **references/**: Check quality, relevance, organization + - **examples/**: Verify examples are complete and correct + - **scripts/**: Check scripts are executable and documented + +7. **Identify Issues**: + - Categorize by severity (critical/major/minor) + - Note anti-patterns: + - Vague trigger descriptions + - Too much content in SKILL.md (should be in references/) + - Second person in description + - Missing key triggers + - No examples/references when they'd be valuable + +8. **Generate Recommendations**: + - Specific fixes for each issue + - Before/after examples when helpful + - Prioritized by impact + +**Quality Standards:** + +- Description must have strong, specific trigger phrases +- SKILL.md should be lean (under 3,000 words ideally) +- Writing style must be imperative/infinitive form +- Progressive disclosure properly implemented +- All file references work correctly +- Examples are complete and accurate + +**Output Format:** + +## Skill Review: [skill-name] + +### Summary + +[Overall assessment and word counts] + +### Description Analysis + +**Current:** [Show current description] + +**Issues:** + +- [Issue 1 with description] +- [Issue 2...] + +**Recommendations:** + +- [Specific fix 1] +- Suggested improved description: "[better version]" + +### Content Quality + +**SKILL.md Analysis:** + +- Word count: [count] ([assessment: too long/good/too short]) +- Writing style: [assessment] +- Organization: [assessment] + +**Issues:** + +- [Content issue 1] +- [Content issue 2] + +**Recommendations:** + +- [Specific improvement 1] +- Consider moving [section X] to references/[filename].md + +### Progressive Disclosure + +**Current Structure:** + +- SKILL.md: [word count] +- references/: [count] files, [total words] +- examples/: [count] files +- scripts/: [count] files + +**Assessment:** +[Is progressive disclosure effective?] + +**Recommendations:** +[Suggestions for better organization] + +### Specific Issues + +#### Critical ([count]) + +- [File/location]: [Issue] - [Fix] + +#### Major ([count]) + +- [File/location]: [Issue] - [Recommendation] + +#### Minor ([count]) + +- [File/location]: [Issue] - [Suggestion] + +### Positive Aspects + +- [What's done well 1] +- [What's done well 2] + +### Overall Rating + +[Pass/Needs Improvement/Needs Major Revision] + +### Priority Recommendations + +1. [Highest priority fix] +2. [Second priority] +3. [Third priority] + +**Edge Cases:** + +- Skill with no description issues: Focus on content and organization +- Very long skill (>5,000 words): Strongly recommend splitting into references +- New skill (minimal content): Provide constructive building guidance +- Perfect skill: Acknowledge quality and suggest minor enhancements only +- Missing referenced files: Report errors clearly with paths diff --git a/commands/claude-codex-settings/azure-tools-setup.md b/commands/claude-codex-settings/azure-tools-setup.md new file mode 100644 index 0000000..06776ed --- /dev/null +++ b/commands/claude-codex-settings/azure-tools-setup.md @@ -0,0 +1,92 @@ +--- +description: Configure Azure MCP server with Azure CLI authentication +--- + +# Azure Tools Setup + +Configure the Azure MCP server with Azure CLI authentication. + +## Step 1: Check Prerequisites + +Check if Azure CLI is installed: + +```bash +az --version +``` + +Check if Node.js is installed: + +```bash +node --version +``` + +Report status based on results. + +## Step 2: Show Installation Guide + +If Azure CLI is missing, tell the user: + +``` +Azure CLI is required for Azure MCP authentication. + +Install Azure CLI: +- macOS: brew install azure-cli +- Linux: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +- Windows: winget install Microsoft.AzureCLI + +After installing, restart your terminal and run this setup again. +``` + +If Node.js is missing, tell the user: + +``` +Node.js 20 LTS or later is required for Azure MCP. + +Install Node.js: +- macOS: brew install node@20 +- Linux: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt-get install -y nodejs +- Windows: winget install OpenJS.NodeJS.LTS + +After installing, restart your terminal and run this setup again. +``` + +## Step 3: Check Authentication + +If prerequisites are installed, check Azure login status: + +```bash +az account show +``` + +If not logged in, tell the user: + +``` +You need to authenticate to Azure. + +Run: az login + +This opens a browser for authentication. After signing in, you can close the browser. +``` + +## Step 4: Verify Configuration + +After authentication, verify: + +1. Read `${CLAUDE_PLUGIN_ROOT}/.mcp.json` to confirm Azure MCP is configured +2. Tell the user the current configuration + +## Step 5: Confirm Success + +Tell the user: + +``` +Azure MCP is configured! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +To verify after restart, run /mcp and check that 'azure' server is connected. + +Reference: https://github.com/microsoft/mcp/tree/main/servers/Azure.Mcp.Server +``` diff --git a/commands/claude-codex-settings/ccproxy-tools-setup.md b/commands/claude-codex-settings/ccproxy-tools-setup.md new file mode 100644 index 0000000..1468296 --- /dev/null +++ b/commands/claude-codex-settings/ccproxy-tools-setup.md @@ -0,0 +1,379 @@ +--- +description: Configure ccproxy/LiteLLM to use Claude Code with any LLM provider +--- + +# ccproxy-tools Setup + +Configure Claude Code to use ccproxy/LiteLLM with Claude Pro/Max subscription, GitHub Copilot, or other LLM providers. + +## Step 1: Check Prerequisites + +Check if `uv` is installed: + +```bash +which uv +``` + +If not installed, install it: + +```bash +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + +Then reload shell or run `source ~/.bashrc` (or `~/.zshrc`). + +## Step 2: Ask Provider Choice + +Use AskUserQuestion: + +- question: "Which LLM provider do you want to use with Claude Code?" +- header: "Provider" +- options: + - label: "Claude Pro/Max (ccproxy)" + description: "Use your Claude subscription via OAuth - no API keys needed" + - label: "GitHub Copilot (LiteLLM)" + description: "Use GitHub Copilot subscription via LiteLLM proxy" + - label: "OpenAI API (LiteLLM)" + description: "Use OpenAI models via LiteLLM proxy" + - label: "Gemini API (LiteLLM)" + description: "Use Google Gemini models via LiteLLM proxy" + +## Step 3: Install Proxy Tool + +### If Claude Pro/Max (ccproxy) + +Install and initialize ccproxy: + +```bash +uv tool install ccproxy +ccproxy init +``` + +### If GitHub Copilot, OpenAI, or Gemini (LiteLLM) + +Install LiteLLM: + +```bash +uv tool install 'litellm[proxy]' +``` + +## Step 4: Configure LiteLLM (if applicable) + +### For GitHub Copilot + +Auto-detect VS Code and Copilot versions: + +```bash +# Get VS Code version +VSCODE_VERSION=$(code --version 2> /dev/null | head -1 || echo "1.96.0") + +# Find Copilot Chat extension version +COPILOT_VERSION=$(ls ~/.vscode/extensions/ 2> /dev/null | grep "github.copilot-chat-" | sed 's/github.copilot-chat-//' | sort -V | tail -1 || echo "0.26.7") +``` + +Create `~/.litellm/config.yaml` with detected versions: + +```yaml +general_settings: + master_key: sk-dummy +litellm_settings: + drop_params: true +model_list: + - model_name: "*" + litellm_params: + model: "github_copilot/*" + extra_headers: + editor-version: "vscode/${VSCODE_VERSION}" + editor-plugin-version: "copilot-chat/${COPILOT_VERSION}" + Copilot-Integration-Id: "vscode-chat" + user-agent: "GitHubCopilotChat/${COPILOT_VERSION}" +``` + +### For OpenAI API + +Ask for OpenAI API key using AskUserQuestion: + +- question: "Enter your OpenAI API key (starts with sk-):" +- header: "OpenAI Key" +- options: + - label: "I have it ready" + description: "I'll paste my OpenAI API key" + - label: "Skip for now" + description: "I'll configure it later" + +Create `~/.litellm/config.yaml`: + +```yaml +general_settings: + master_key: sk-dummy +litellm_settings: + drop_params: true +model_list: + - model_name: "*" + litellm_params: + model: openai/gpt-4o + api_key: ${OPENAI_API_KEY} +``` + +### For Gemini API + +Ask for Gemini API key using AskUserQuestion: + +- question: "Enter your Gemini API key:" +- header: "Gemini Key" +- options: + - label: "I have it ready" + description: "I'll paste my Gemini API key" + - label: "Skip for now" + description: "I'll configure it later" + +Create `~/.litellm/config.yaml`: + +```yaml +general_settings: + master_key: sk-dummy +litellm_settings: + drop_params: true +model_list: + - model_name: "*" + litellm_params: + model: gemini/gemini-2.5-flash + api_key: ${GEMINI_API_KEY} +``` + +## Step 5: Setup Auto-Start Service + +Detect platform and create appropriate service: + +### macOS (launchd) + +For ccproxy, create `~/Library/LaunchAgents/com.ccproxy.plist`: + +```xml + + + + + Label + com.ccproxy + ProgramArguments + + ${HOME}/.local/bin/ccproxy + start + + RunAtLoad + + KeepAlive + + StandardOutPath + ${HOME}/.local/share/ccproxy/stdout.log + StandardErrorPath + ${HOME}/.local/share/ccproxy/stderr.log + + +``` + +For LiteLLM, create `~/Library/LaunchAgents/com.litellm.plist`: + +```xml + + + + + Label + com.litellm + ProgramArguments + + ${HOME}/.local/bin/litellm + --config + ${HOME}/.litellm/config.yaml + + RunAtLoad + + KeepAlive + + StandardOutPath + ${HOME}/.local/share/litellm/stdout.log + StandardErrorPath + ${HOME}/.local/share/litellm/stderr.log + + +``` + +Load and start the service: + +```bash +launchctl load ~/Library/LaunchAgents/com.ccproxy.plist # or com.litellm.plist +``` + +### Linux (systemd user service) + +For ccproxy, create `~/.config/systemd/user/ccproxy.service`: + +```ini +[Unit] +Description=ccproxy LLM Proxy + +[Service] +ExecStart=%h/.local/bin/ccproxy start +Restart=always +RestartSec=5 + +[Install] +WantedBy=default.target +``` + +For LiteLLM, create `~/.config/systemd/user/litellm.service`: + +```ini +[Unit] +Description=LiteLLM Proxy + +[Service] +ExecStart=%h/.local/bin/litellm --config %h/.litellm/config.yaml +Restart=always +RestartSec=5 + +[Install] +WantedBy=default.target +``` + +Enable and start the service: + +```bash +systemctl --user daemon-reload +systemctl --user enable --now ccproxy # or litellm +``` + +## Step 6: Authenticate (ccproxy only) + +For ccproxy, tell the user: + +``` +The proxy is starting. A browser window will open for authentication. + +1. Sign in with your Claude Pro/Max account +2. Authorize the connection +3. Return here after successful authentication +``` + +Wait for authentication to complete. + +## Step 7: Verify Proxy is Running + +Check if proxy is healthy: + +```bash +curl -s http://localhost:4000/health +``` + +Retry up to 5 times with 3-second delays if not responding. + +If proxy is not healthy after retries: + +- Show error and troubleshooting steps +- Do NOT proceed to update settings +- Exit + +## Step 8: Confirm Before Updating Settings + +Use AskUserQuestion: + +- question: "Proxy is running. Ready to configure Claude Code to use it?" +- header: "Configure" +- options: + - label: "Yes, configure now" + description: "Update settings to use the proxy (requires restart)" + - label: "No, not yet" + description: "Keep current settings, I'll configure later" + +If user selects "No, not yet": + +- Tell them they can run `/ccproxy-tools:setup` again when ready +- Exit without changing settings + +## Step 9: Update Settings + +1. Read current `~/.claude/settings.json` +2. Create backup at `~/.claude/settings.json.backup` +3. Add to env section based on provider: + +For ccproxy: + +```json +{ + "env": { + "ANTHROPIC_BASE_URL": "http://localhost:4000" + } +} +``` + +For LiteLLM: + +```json +{ + "env": { + "ANTHROPIC_BASE_URL": "http://localhost:4000", + "ANTHROPIC_AUTH_TOKEN": "sk-dummy" + } +} +``` + +4. Write updated settings + +## Step 10: Confirm Success + +Tell the user: + +``` +Configuration complete! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +The proxy will start automatically on system boot. + +To verify after restart: +- Claude Code should connect to the proxy at localhost:4000 +- Check proxy logs: ~/Library/LaunchAgents/*.log (macOS) or journalctl --user -u ccproxy (Linux) +``` + +## Recovery Instructions + +Always show these recovery instructions: + +``` +If Claude Code stops working after setup: + +1. Check proxy status: + curl http://localhost:4000/health + +2. Restart proxy: + macOS: launchctl kickstart -k gui/$(id -u)/com.ccproxy + Linux: systemctl --user restart ccproxy + +3. Check proxy logs: + macOS: cat ~/.local/share/ccproxy/stderr.log + Linux: journalctl --user -u ccproxy + +4. Restore original settings (removes proxy): + cp ~/.claude/settings.json.backup ~/.claude/settings.json + + Or manually edit ~/.claude/settings.json and remove: + - ANTHROPIC_BASE_URL + - ANTHROPIC_AUTH_TOKEN (if present) +``` + +## Troubleshooting + +If proxy setup fails: + +``` +Common fixes: +1. Port in use - Check if another process uses port 4000: lsof -i :4000 +2. Service not starting - Check logs in ~/.local/share/ccproxy/ or ~/.local/share/litellm/ +3. Authentication failed - Re-run setup to re-authenticate +4. Permission denied - Ensure ~/.local/bin is in PATH +5. Config invalid - Verify ~/.litellm/config.yaml syntax +``` diff --git a/commands/claude-codex-settings/claude-tools-load-claude-md.md b/commands/claude-codex-settings/claude-tools-load-claude-md.md new file mode 100644 index 0000000..02ac247 --- /dev/null +++ b/commands/claude-codex-settings/claude-tools-load-claude-md.md @@ -0,0 +1,12 @@ +--- +allowed-tools: Read +description: Refresh context with CLAUDE.md instructions +--- + +# Load CLAUDE.md + +Read and inject CLAUDE.md content into the current context. Useful for refreshing instructions in long conversations. + +1. Read `~/.claude/CLAUDE.md` (global instructions) +2. Read `CLAUDE.md` or `AGENTS.md` from the current project directory (whichever exists) +3. Acknowledge that context has been refreshed with these instructions diff --git a/commands/claude-codex-settings/claude-tools-load-frontend-skill.md b/commands/claude-codex-settings/claude-tools-load-frontend-skill.md new file mode 100644 index 0000000..6e036e3 --- /dev/null +++ b/commands/claude-codex-settings/claude-tools-load-frontend-skill.md @@ -0,0 +1,13 @@ +--- +description: Load frontend design skill from Anthropic +allowed-tools: WebFetch +--- + +# Load Frontend Design Skill + +Load the frontend-design skill from Anthropic's official Claude Code plugins to guide creation of distinctive, production-grade frontend interfaces. + +Fetch from: +https://raw.githubusercontent.com/anthropics/claude-code/main/plugins/frontend-design/skills/frontend-design/SKILL.md + +Use this guidance when building web components, pages, or applications that require high design quality and avoid generic AI aesthetics. diff --git a/commands/claude-codex-settings/claude-tools-sync-allowlist.md b/commands/claude-codex-settings/claude-tools-sync-allowlist.md new file mode 100644 index 0000000..e7ae756 --- /dev/null +++ b/commands/claude-codex-settings/claude-tools-sync-allowlist.md @@ -0,0 +1,17 @@ +--- +allowed-tools: Read, Bash +description: Sync allowlist from GitHub repository to user settings +--- + +# Sync Allowlist + +Fetch the latest permissions allowlist from fcakyon/claude-codex-settings GitHub repository and update ~/.claude/settings.json. + +Steps: + +1. Use `gh api repos/fcakyon/claude-settings/contents/.claude/settings.json --jq '.content' | base64 -d` to fetch settings +2. Parse the JSON and extract the `permissions.allow` array +3. Read the user's `~/.claude/settings.json` +4. Update only the `permissions.allow` field (preserve all other user settings) +5. Write back to `~/.claude/settings.json` +6. Confirm with a message showing count of allowlist entries synced diff --git a/commands/claude-codex-settings/claude-tools-sync-claude-md.md b/commands/claude-codex-settings/claude-tools-sync-claude-md.md new file mode 100644 index 0000000..2dccc7d --- /dev/null +++ b/commands/claude-codex-settings/claude-tools-sync-claude-md.md @@ -0,0 +1,10 @@ +--- +allowed-tools: Read, Bash +description: Sync CLAUDE.md from GitHub repository +--- + +# Sync CLAUDE.md + +Fetch the latest CLAUDE.md from fcakyon/claude-codex-settings GitHub repository and update ~/.claude/CLAUDE.md. + +Use `gh api repos/fcakyon/claude-codex-settings/contents/CLAUDE.md --jq '.content' | base64 -d` to fetch the file content, then write to ~/.claude/CLAUDE.md. Confirm successful update with a message showing the file has been synced. diff --git a/commands/claude-codex-settings/gcloud-tools-setup.md b/commands/claude-codex-settings/gcloud-tools-setup.md new file mode 100644 index 0000000..4dda43c --- /dev/null +++ b/commands/claude-codex-settings/gcloud-tools-setup.md @@ -0,0 +1,104 @@ +--- +description: Configure GCloud CLI authentication +--- + +# GCloud Tools Setup + +**Source:** [googleapis/gcloud-mcp](https://github.com/googleapis/gcloud-mcp) + +Check GCloud MCP status and configure CLI authentication if needed. + +## Step 1: Check gcloud CLI + +Run: `gcloud --version` + +If not installed: Continue to Step 2. +If installed: Skip to Step 3. + +## Step 2: Install gcloud CLI + +Tell the user: + +``` +Install Google Cloud SDK: + +macOS (Homebrew): + brew install google-cloud-sdk + +macOS/Linux (Manual): + curl https://sdk.cloud.google.com | bash + exec -l $SHELL + +Windows: + Download from: https://cloud.google.com/sdk/docs/install + +After install, restart your terminal. +``` + +## Step 3: Authenticate + +Run these commands: + +```bash +# Login with your Google account +gcloud auth login + +# Set up Application Default Credentials (required for MCP) +gcloud auth application-default login +``` + +Both commands will open a browser for authentication. + +## Step 4: Set Default Project + +```bash +# List available projects +gcloud projects list + +# Set default project +gcloud config set project YOUR_PROJECT_ID +``` + +## Step 5: Verify Setup + +Run: `gcloud auth list` + +Should show your authenticated account with asterisk (\*). + +## Step 6: Restart Claude Code + +Tell the user: + +``` +After authentication: +1. Exit Claude Code +2. Run `claude` again + +The MCP will use your gcloud credentials. +``` + +## Troubleshooting + +If GCloud MCP fails: + +``` +Common fixes: +1. ADC not found - Run gcloud auth application-default login +2. Project not set - Run gcloud config set project PROJECT_ID +3. Permission denied - Check IAM roles in Cloud Console +4. Quota exceeded - Check quotas in Cloud Console +5. Token expired - Run gcloud auth application-default login again +``` + +## Alternative: Disable Plugin + +If user doesn't need GCloud integration: + +``` +To disable this plugin: +1. Run /mcp command +2. Find the gcloud-observability server +3. Disable it + +This prevents errors from missing authentication. +``` diff --git a/commands/claude-codex-settings/github-dev-clean-gone-branches.md b/commands/claude-codex-settings/github-dev-clean-gone-branches.md new file mode 100644 index 0000000..da5a488 --- /dev/null +++ b/commands/claude-codex-settings/github-dev-clean-gone-branches.md @@ -0,0 +1,44 @@ +--- +description: Clean up local branches deleted from remote +--- + +# Clean Gone Branches + +Remove local git branches that have been deleted from remote (marked as [gone]). + +## Instructions + +Run the following commands in sequence: + +1. **Update remote references:** + ```bash + git fetch --prune + ``` + +2. **View branches marked as [gone]:** + ```bash + git branch -vv + ``` + +3. **List worktrees (if any):** + ```bash + git worktree list + ``` + +4. **Remove worktrees for gone branches (if any):** + ```bash + git branch -vv | grep '\[gone\]' | awk '{print $1}' | sed 's/^[*+]*//' | while read -r branch; do + worktree=$(git worktree list | grep "\[$branch\]" | awk '{print $1}') + if [ -n "$worktree" ]; then + echo "Removing worktree: $worktree" + git worktree remove --force "$worktree" + fi + done + ``` + +5. **Delete gone branches:** + ```bash + git branch -vv | grep '\[gone\]' | awk '{print $1}' | sed 's/^[*+]*//' | xargs -I {} git branch -D {} + ``` + +Report the results: list of removed worktrees and deleted branches, or notify if no [gone] branches exist. \ No newline at end of file diff --git a/commands/claude-codex-settings/github-dev-commit-staged.md b/commands/claude-codex-settings/github-dev-commit-staged.md new file mode 100644 index 0000000..cbf09e1 --- /dev/null +++ b/commands/claude-codex-settings/github-dev-commit-staged.md @@ -0,0 +1,19 @@ +--- +allowed-tools: Task, Read, Grep, SlashCommand +argument-hint: [context] +description: Commit staged changes with optional context +--- + +# Commit Staged Changes + +Use the commit-creator agent to analyze and commit staged changes with intelligent organization and optimal commit strategy. + +## Additional Context + +$ARGUMENTS + +Task( +description: "Analyze and commit staged changes", +prompt: "Analyze the staged changes and create appropriate commits. Additional context: $ARGUMENTS", +subagent_type: "github-dev:commit-creator" +) diff --git a/commands/claude-codex-settings/github-dev-create-pr.md b/commands/claude-codex-settings/github-dev-create-pr.md new file mode 100644 index 0000000..335a09d --- /dev/null +++ b/commands/claude-codex-settings/github-dev-create-pr.md @@ -0,0 +1,19 @@ +--- +allowed-tools: Task, Read, Grep, SlashCommand, Bash(git checkout:*), Bash(git -C:* checkout:*) +argument-hint: [context] +description: Create pull request with optional context +--- + +# Create Pull Request + +Use the pr-creator agent to handle the complete PR workflow including branch creation, commits, and PR submission. + +## Additional Context + +$ARGUMENTS + +Task( +description: "Create pull request", +prompt: "Handle the complete PR workflow including branch creation, commits, and PR submission. Additional context: $ARGUMENTS", +subagent_type: "github-dev:pr-creator" +) diff --git a/commands/claude-codex-settings/github-dev-review-pr.md b/commands/claude-codex-settings/github-dev-review-pr.md new file mode 100644 index 0000000..1cbb6b6 --- /dev/null +++ b/commands/claude-codex-settings/github-dev-review-pr.md @@ -0,0 +1,19 @@ +--- +allowed-tools: Task, Read, Grep, Glob +argument-hint: +description: Review a pull request for code quality and issues +--- + +# Review Pull Request + +Use the pr-reviewer agent to analyze the pull request and provide a detailed code review. + +## PR Reference + +$ARGUMENTS + +Task( +description: "Review pull request", +prompt: "Review the pull request and provide detailed feedback on code quality, potential bugs, and suggestions. PR reference: $ARGUMENTS", +subagent_type: "github-dev:pr-reviewer" +) diff --git a/commands/claude-codex-settings/github-dev-setup.md b/commands/claude-codex-settings/github-dev-setup.md new file mode 100644 index 0000000..ef4738c --- /dev/null +++ b/commands/claude-codex-settings/github-dev-setup.md @@ -0,0 +1,53 @@ +--- +description: Configure GitHub CLI authentication +--- + +# GitHub CLI Setup + +**Source:** [github/github-mcp-server](https://github.com/github/github-mcp-server) + +Configure `gh` CLI for GitHub access. + +## Step 1: Check Current Status + +Run `gh auth status` to check authentication state. + +Report status: + +- "GitHub CLI is not authenticated - needs login" +- OR "GitHub CLI is authenticated as " + +## Step 2: If Not Authenticated + +Guide the user: + +``` +To authenticate with GitHub CLI: + +gh auth login + +This will open a browser for GitHub OAuth login. +Select: GitHub.com → HTTPS → Login with browser +``` + +## Step 3: Verify Setup + +After login, verify with: + +```bash +gh auth status +gh api user --jq '.login' +``` + +## Troubleshooting + +If `gh` commands fail: + +``` +Common fixes: +1. Check authentication - gh auth status +2. Re-login - gh auth login +3. Missing scopes - re-auth with required permissions +4. Update gh CLI - brew upgrade gh (or equivalent) +5. Token expired - gh auth refresh +``` diff --git a/commands/claude-codex-settings/github-dev-update-pr-summary.md b/commands/claude-codex-settings/github-dev-update-pr-summary.md new file mode 100644 index 0000000..3737156 --- /dev/null +++ b/commands/claude-codex-settings/github-dev-update-pr-summary.md @@ -0,0 +1,118 @@ +# Claude Command: Update PR Summary + +Update PR description with automatically generated summary based on complete changeset. + +## Usage + +```bash +/update-pr-summary # Update PR description +/update-pr-summary 131 # Example: update PR #131 +``` + +## Workflow Steps + +1. **Fetch PR Information**: + - Get PR details using `gh pr view --json title,body,baseRefName,headRefName` + - Identify base branch and head branch from PR metadata + +2. **Analyze Complete Changeset**: + - **IMPORTANT**: Analyze ALL committed changes in the branch using `git diff ...HEAD` + - PR description must describe the complete changeset across all commits, not just the latest commit + - Focus on what changed from the perspective of someone reviewing the entire branch + - Ignore unstaged changes + +3. **Generate PR Description**: + - Create brief summary (1 sentence or few words) + - Add few bullet points of key changes + - For significant changes, include before/after code examples in PR body + - Include inline markdown links to relevant code lines when helpful (format: `[src/auth.py:42](src/auth.py#L42)`) + - For config/API changes, use `mcp__tavily__tavily_search` to verify information and include source links inline + - Never include test plans in PR descriptions + +4. **Update PR Title** (if needed): + - Title should start with capital letter and verb + - Should NOT start with conventional commit prefixes (e.g. "fix:", "feat:") + +5. **Update PR**: + - Use `gh pr edit ` with `--body` (and optionally `--title`) to update the PR + - Use HEREDOC for proper formatting: + ```bash + gh pr edit "$( + cat << 'EOF' + [PR description here] + EOF + )" < pr_number > --body + ``` + +## PR Description Format + +```markdown +[Brief summary in 1 sentence or few words] + +- [Key change 1 with inline code reference if helpful] +- [Key change 2 with source link if config/API change] +- [Key change 3] + +[Optional: Before/after code examples for significant changes] +``` + +## Examples + +### Example 1: Config/API Change with Source Links + +```markdown +Update Claude Haiku to version 4.5 + +- Model ID: claude-3-haiku-20240307 → claude-haiku-4-5-20251001 ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview)) +- Pricing: $0.80/$4.00 → $1.00/$5.00 per MTok ([source](https://docs.anthropic.com/en/docs/about-claude/pricing)) +- Max output: 4,096 → 64,000 tokens ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview)) +``` + +### Example 2: Code Changes with File Links + +````markdown +Refactor authentication to use async context manager + +- Replace synchronous auth flow with async/await pattern in [src/auth.py:15-42](src/auth.py#L15-L42) +- Add context manager support for automatic cleanup + +Before: + +```python +def authenticate(token): + session = create_session(token) + return session +``` + +After: + +```python +async def authenticate(token): + async with create_session(token) as session: + return session +``` +```` + +### Example 3: Simple Feature Addition + +```markdown +Add user profile export functionality + +- Export user data to JSON format in [src/export.py:45-78](src/export.py#L45-L78) +- Add CLI command `/export-profile` in [src/cli.py:123](src/cli.py#L123) +- Include email, preferences, and activity history in export +``` + +## Error Handling + +**Pre-Analysis Verification**: + +- Verify PR exists and is accessible +- Check tool availability (`gh auth status`) +- Confirm authentication status + +**Common Issues**: + +- Invalid PR number → List available PRs +- Missing tools → Provide setup instructions +- Auth issues → Guide through authentication diff --git a/commands/claude-codex-settings/linear-tools-setup.md b/commands/claude-codex-settings/linear-tools-setup.md new file mode 100644 index 0000000..6cd39fd --- /dev/null +++ b/commands/claude-codex-settings/linear-tools-setup.md @@ -0,0 +1,74 @@ +--- +description: Configure Linear OAuth authentication +--- + +# Linear Tools Setup + +**Source:** [Linear MCP Docs](https://linear.app/docs/mcp) + +Check Linear MCP status and configure OAuth if needed. + +## Step 1: Test Current Setup + +Try listing teams using `mcp__linear__list_teams`. + +If successful: Tell user Linear is configured and working. + +If fails with authentication error: Continue to Step 2. + +## Step 2: OAuth Authentication + +Linear uses OAuth - no API keys needed. Tell the user: + +``` +Linear MCP uses OAuth authentication. + +To authenticate: +1. Run the /mcp command in Claude Code +2. Find the "linear" server in the list +3. Click "Authenticate" or similar option +4. A browser window will open +5. Sign in to Linear and authorize access +``` + +## Step 3: Complete OAuth Flow + +After user clicks authenticate: + +- Browser opens to Linear authorization page +- User signs in with their Linear account +- User approves the permission request +- Browser shows success message +- Claude Code receives the token automatically + +## Step 4: Verify Setup + +Try listing teams again using `mcp__linear__list_teams`. + +If successful: Linear is now configured. + +## Troubleshooting + +If OAuth fails: + +``` +Common fixes: +1. Clear browser cookies for linear.app +2. Try a different browser +3. Disable browser extensions +4. Re-run /mcp and authenticate again +5. Restart Claude Code and try again +``` + +## Alternative: Disable Plugin + +If user doesn't need Linear integration: + +``` +To disable this plugin: +1. Run /mcp command +2. Find the linear server +3. Disable it + +This prevents errors from missing authentication. +``` diff --git a/commands/claude-codex-settings/mongodb-tools-setup.md b/commands/claude-codex-settings/mongodb-tools-setup.md new file mode 100644 index 0000000..a18d9ec --- /dev/null +++ b/commands/claude-codex-settings/mongodb-tools-setup.md @@ -0,0 +1,112 @@ +--- +description: Configure MongoDB MCP connection +--- + +# MongoDB Tools Setup + +**Source:** [mongodb-js/mongodb-mcp-server](https://github.com/mongodb-js/mongodb-mcp-server) + +Configure the MongoDB MCP server with your connection string. + +## Step 1: Check Current Status + +Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`. + +Check if MongoDB is configured: + +- If `mongodb.env.MDB_MCP_CONNECTION_STRING` contains `REPLACE_WITH_CONNECTION_STRING`, it needs configuration +- If it contains a value starting with `mongodb://` or `mongodb+srv://`, already configured + +Report status: + +- "MongoDB MCP is not configured - needs a connection string" +- OR "MongoDB MCP is already configured" + +## Step 2: Show Setup Guide + +Tell the user: + +``` +To configure MongoDB MCP, you need a connection string. + +Formats: +- Atlas: mongodb+srv://username:password@cluster.mongodb.net/database +- Local: mongodb://localhost:27017/database + +Get Atlas connection string: +1. Go to cloud.mongodb.com +2. Navigate to your cluster +3. Click "Connect" → "Drivers" +4. Copy connection string + +Note: MCP runs in READ-ONLY mode. + +Don't need MongoDB MCP? Disable it via /mcp command. +``` + +## Step 3: Ask for Connection String + +Use AskUserQuestion: + +- question: "Do you have your MongoDB connection string ready?" +- header: "MongoDB" +- options: + - label: "Yes, I have it" + description: "I have my MongoDB connection string ready to paste" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/mongodb-tools:setup` again when ready +- Remind them they can disable MongoDB MCP via `/mcp` if not needed +- Exit + +If user selects "Yes" or provides connection string via "Other": + +- If they provided connection string in "Other" response, use that +- Otherwise, ask them to paste the connection string + +## Step 4: Validate Connection String + +Validate the provided connection string: + +- Must start with `mongodb://` or `mongodb+srv://` + +If invalid: + +- Show error: "Invalid connection string format. Must start with 'mongodb://' or 'mongodb+srv://'" +- Ask if they want to try again or skip + +## Step 5: Update Configuration + +1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json` +2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup` +3. Update `mongodb.env.MDB_MCP_CONNECTION_STRING` value to the actual connection string +4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json` + +## Step 6: Confirm Success + +Tell the user: + +``` +MongoDB MCP configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +To verify after restart, run /mcp and check that 'mongodb' server is connected. +``` + +## Troubleshooting + +If MongoDB MCP fails after configuration: + +``` +Common fixes: +1. Authentication failed - Add ?authSource=admin to connection string +2. Network timeout - Whitelist IP in Atlas Network Access settings +3. Wrong credentials - Verify username/password, special chars need URL encoding +4. SSL/TLS errors - For Atlas, ensure mongodb+srv:// is used +``` diff --git a/commands/claude-codex-settings/paper-search-tools-setup.md b/commands/claude-codex-settings/paper-search-tools-setup.md new file mode 100644 index 0000000..5447e3c --- /dev/null +++ b/commands/claude-codex-settings/paper-search-tools-setup.md @@ -0,0 +1,62 @@ +--- +description: Configure Paper Search MCP (requires Docker) +--- + +# Paper Search Tools Setup + +**Source:** [mcp/paper-search](https://hub.docker.com/r/mcp/paper-search) + +Configure the Paper Search MCP server. Requires Docker. + +## Step 1: Check Docker Installation + +Run `docker --version` to check if Docker is installed. + +If Docker is not installed, show: + +``` +Docker is required for Paper Search MCP. + +Install Docker: + +macOS: brew install --cask docker +Linux: curl -fsSL https://get.docker.com | sh +Windows: winget install Docker.DockerDesktop + +After installation, start Docker Desktop and wait for it to fully launch. +``` + +## Step 2: Verify Docker is Running + +Run `docker info` to verify Docker daemon is running. + +If not running, tell user: + +``` +Docker is installed but not running. + +Start Docker Desktop and wait for it to fully launch before continuing. +``` + +## Step 3: Pull the Image + +Run `docker pull mcp/paper-search` to download the MCP image. + +Report progress: + +- "Pulling paper-search image..." +- "Image ready!" + +## Step 4: Confirm Success + +Tell the user: + +``` +Paper Search MCP configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +To verify after restart, run /mcp and check that 'paper-search' server is connected. +``` diff --git a/commands/claude-codex-settings/playwright-tools-setup.md b/commands/claude-codex-settings/playwright-tools-setup.md new file mode 100644 index 0000000..aa3239f --- /dev/null +++ b/commands/claude-codex-settings/playwright-tools-setup.md @@ -0,0 +1,104 @@ +--- +description: Configure Playwright MCP +--- + +# Playwright Tools Setup + +**Source:** [microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) + +Check Playwright MCP status and configure browser dependencies if needed. + +## Step 1: Test Current Setup + +Run `/mcp` command to check if playwright server is listed and connected. + +If playwright server shows as connected: Tell user Playwright is configured and working. + +If playwright server is missing or shows connection error: Continue to Step 2. + +## Step 2: Browser Installation + +Tell the user: + +``` +Playwright MCP requires browser binaries. Install them with: + +npx playwright install + +This installs Chromium, Firefox, and WebKit browsers. + +For a specific browser only: +npx playwright install chromium +npx playwright install firefox +npx playwright install webkit +``` + +## Step 3: Browser Options + +The MCP server supports these browsers via the `--browser` flag in `.mcp.json`: + +- `chrome` (default) +- `firefox` +- `webkit` +- `msedge` + +Example `.mcp.json` for Firefox: + +```json +{ + "playwright": { + "command": "npx", + "args": ["@playwright/mcp@latest", "--browser", "firefox"] + } +} +``` + +## Step 4: Headless Mode + +For headless operation (no visible browser), add `--headless`: + +```json +{ + "playwright": { + "command": "npx", + "args": ["@playwright/mcp@latest", "--headless"] + } +} +``` + +## Step 5: Restart + +Tell the user: + +``` +After making changes: +1. Exit Claude Code +2. Run `claude` again + +Changes take effect after restart. +``` + +## Troubleshooting + +If Playwright MCP fails: + +``` +Common fixes: +1. Browser not found - Run `npx playwright install` +2. Permission denied - Check file permissions on browser binaries +3. Display issues - Use `--headless` flag for headless mode +4. Timeout errors - Increase timeout with `--timeout-navigation 120000` +``` + +## Alternative: Disable Plugin + +If user doesn't need browser automation: + +``` +To disable this plugin: +1. Run /mcp command +2. Find the playwright server +3. Disable it + +This prevents errors from missing browser binaries. +``` diff --git a/commands/claude-codex-settings/plugin-dev-create-plugin.md b/commands/claude-codex-settings/plugin-dev-create-plugin.md new file mode 100644 index 0000000..8839281 --- /dev/null +++ b/commands/claude-codex-settings/plugin-dev-create-plugin.md @@ -0,0 +1,415 @@ +--- +description: Guided end-to-end plugin creation workflow with component design, implementation, and validation +argument-hint: Optional plugin description +allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task"] +--- + +# Plugin Creation Workflow + +Guide the user through creating a complete, high-quality Claude Code plugin from initial concept to tested implementation. Follow a systematic approach: understand requirements, design components, clarify details, implement following best practices, validate, and test. + +## Core Principles + +- **Ask clarifying questions**: Identify all ambiguities about plugin purpose, triggering, scope, and components. Ask specific, concrete questions rather than making assumptions. Wait for user answers before proceeding with implementation. +- **Load relevant skills**: Use the Skill tool to load plugin-dev skills when needed (plugin-structure, hook-development, agent-development, etc.) +- **Use specialized agents**: Leverage agent-creator, plugin-validator, and skill-reviewer agents for AI-assisted development +- **Follow best practices**: Apply patterns from plugin-dev's own implementation +- **Progressive disclosure**: Create lean skills with references/examples +- **Use TodoWrite**: Track all progress throughout all phases + +**Initial request:** $ARGUMENTS + +--- + +## Phase 1: Discovery + +**Goal**: Understand what plugin needs to be built and what problem it solves + +**Actions**: +1. Create todo list with all 7 phases +2. If plugin purpose is clear from arguments: + - Summarize understanding + - Identify plugin type (integration, workflow, analysis, toolkit, etc.) +3. If plugin purpose is unclear, ask user: + - What problem does this plugin solve? + - Who will use it and when? + - What should it do? + - Any similar plugins to reference? +4. Summarize understanding and confirm with user before proceeding + +**Output**: Clear statement of plugin purpose and target users + +--- + +## Phase 2: Component Planning + +**Goal**: Determine what plugin components are needed + +**MUST load plugin-structure skill** using Skill tool before this phase. + +**Actions**: +1. Load plugin-structure skill to understand component types +2. Analyze plugin requirements and determine needed components: + - **Skills**: Does it need specialized knowledge? (hooks API, MCP patterns, etc.) + - **Commands**: User-initiated actions? (deploy, configure, analyze) + - **Agents**: Autonomous tasks? (validation, generation, analysis) + - **Hooks**: Event-driven automation? (validation, notifications) + - **MCP**: External service integration? (databases, APIs) + - **Settings**: User configuration? (.local.md files) +3. For each component type needed, identify: + - How many of each type + - What each one does + - Rough triggering/usage patterns +4. Present component plan to user as table: + ``` + | Component Type | Count | Purpose | + |----------------|-------|---------| + | Skills | 2 | Hook patterns, MCP usage | + | Commands | 3 | Deploy, configure, validate | + | Agents | 1 | Autonomous validation | + | Hooks | 0 | Not needed | + | MCP | 1 | Database integration | + ``` +5. Get user confirmation or adjustments + +**Output**: Confirmed list of components to create + +--- + +## Phase 3: Detailed Design & Clarifying Questions + +**Goal**: Specify each component in detail and resolve all ambiguities + +**CRITICAL**: This is one of the most important phases. DO NOT SKIP. + +**Actions**: +1. For each component in the plan, identify underspecified aspects: + - **Skills**: What triggers them? What knowledge do they provide? How detailed? + - **Commands**: What arguments? What tools? Interactive or automated? + - **Agents**: When to trigger (proactive/reactive)? What tools? Output format? + - **Hooks**: Which events? Prompt or command based? Validation criteria? + - **MCP**: What server type? Authentication? Which tools? + - **Settings**: What fields? Required vs optional? Defaults? + +2. **Present all questions to user in organized sections** (one section per component type) + +3. **Wait for answers before proceeding to implementation** + +4. If user says "whatever you think is best", provide specific recommendations and get explicit confirmation + +**Example questions for a skill**: +- What specific user queries should trigger this skill? +- Should it include utility scripts? What functionality? +- How detailed should the core SKILL.md be vs references/? +- Any real-world examples to include? + +**Example questions for an agent**: +- Should this agent trigger proactively after certain actions, or only when explicitly requested? +- What tools does it need (Read, Write, Bash, etc.)? +- What should the output format be? +- Any specific quality standards to enforce? + +**Output**: Detailed specification for each component + +--- + +## Phase 4: Plugin Structure Creation + +**Goal**: Create plugin directory structure and manifest + +**Actions**: +1. Determine plugin name (kebab-case, descriptive) +2. Choose plugin location: + - Ask user: "Where should I create the plugin?" + - Offer options: current directory, ../new-plugin-name, custom path +3. Create directory structure using bash: + ```bash + mkdir -p plugin-name/.claude-plugin + mkdir -p plugin-name/skills # if needed + mkdir -p plugin-name/commands # if needed + mkdir -p plugin-name/agents # if needed + mkdir -p plugin-name/hooks # if needed + ``` +4. Create plugin.json manifest using Write tool: + ```json + { + "name": "plugin-name", + "version": "0.1.0", + "description": "[brief description]", + "author": { + "name": "[author from user or default]", + "email": "[email or default]" + } + } + ``` +5. Create README.md template +6. Create .gitignore if needed (for .claude/*.local.md, etc.) +7. Initialize git repo if creating new directory + +**Output**: Plugin directory structure created and ready for components + +--- + +## Phase 5: Component Implementation + +**Goal**: Create each component following best practices + +**LOAD RELEVANT SKILLS** before implementing each component type: +- Skills: Load skill-development skill +- Commands: Load command-development skill +- Agents: Load agent-development skill +- Hooks: Load hook-development skill +- MCP: Load mcp-integration skill +- Settings: Load plugin-settings skill + +**Actions for each component**: + +### For Skills: +1. Load skill-development skill using Skill tool +2. For each skill: + - Ask user for concrete usage examples (or use from Phase 3) + - Plan resources (scripts/, references/, examples/) + - Create skill directory structure + - Write SKILL.md with: + - Third-person description with specific trigger phrases + - Lean body (1,500-2,000 words) in imperative form + - References to supporting files + - Create reference files for detailed content + - Create example files for working code + - Create utility scripts if needed +3. Use skill-reviewer agent to validate each skill + +### For Commands: +1. Load command-development skill using Skill tool +2. For each command: + - Write command markdown with frontmatter + - Include clear description and argument-hint + - Specify allowed-tools (minimal necessary) + - Write instructions FOR Claude (not TO user) + - Provide usage examples and tips + - Reference relevant skills if applicable + +### For Agents: +1. Load agent-development skill using Skill tool +2. For each agent, use agent-creator agent: + - Provide description of what agent should do + - Agent-creator generates: identifier, whenToUse with examples, systemPrompt + - Create agent markdown file with frontmatter and system prompt + - Add appropriate model, color, and tools + - Validate with validate-agent.sh script + +### For Hooks: +1. Load hook-development skill using Skill tool +2. For each hook: + - Create hooks/hooks.json with hook configuration + - Prefer prompt-based hooks for complex logic + - Use ${CLAUDE_PLUGIN_ROOT} for portability + - Create hook scripts if needed (in examples/ not scripts/) + - Test with validate-hook-schema.sh and test-hook.sh utilities + +### For MCP: +1. Load mcp-integration skill using Skill tool +2. Create .mcp.json configuration with: + - Server type (stdio for local, SSE for hosted) + - Command and args (with ${CLAUDE_PLUGIN_ROOT}) + - extensionToLanguage mapping if LSP + - Environment variables as needed +3. Document required env vars in README +4. Provide setup instructions + +### For Settings: +1. Load plugin-settings skill using Skill tool +2. Create settings template in README +3. Create example .claude/plugin-name.local.md file (as documentation) +4. Implement settings reading in hooks/commands as needed +5. Add to .gitignore: `.claude/*.local.md` + +**Progress tracking**: Update todos as each component is completed + +**Output**: All plugin components implemented + +--- + +## Phase 6: Validation & Quality Check + +**Goal**: Ensure plugin meets quality standards and works correctly + +**Actions**: +1. **Run plugin-validator agent**: + - Use plugin-validator agent to comprehensively validate plugin + - Check: manifest, structure, naming, components, security + - Review validation report + +2. **Fix critical issues**: + - Address any critical errors from validation + - Fix any warnings that indicate real problems + +3. **Review with skill-reviewer** (if plugin has skills): + - For each skill, use skill-reviewer agent + - Check description quality, progressive disclosure, writing style + - Apply recommendations + +4. **Test agent triggering** (if plugin has agents): + - For each agent, verify blocks are clear + - Check triggering conditions are specific + - Run validate-agent.sh on agent files + +5. **Test hook configuration** (if plugin has hooks): + - Run validate-hook-schema.sh on hooks/hooks.json + - Test hook scripts with test-hook.sh + - Verify ${CLAUDE_PLUGIN_ROOT} usage + +6. **Present findings**: + - Summary of validation results + - Any remaining issues + - Overall quality assessment + +7. **Ask user**: "Validation complete. Issues found: [count critical], [count warnings]. Would you like me to fix them now, or proceed to testing?" + +**Output**: Plugin validated and ready for testing + +--- + +## Phase 7: Testing & Verification + +**Goal**: Test that plugin works correctly in Claude Code + +**Actions**: +1. **Installation instructions**: + - Show user how to test locally: + ```bash + cc --plugin-dir /path/to/plugin-name + ``` + - Or copy to `.claude-plugin/` for project testing + +2. **Verification checklist** for user to perform: + - [ ] Skills load when triggered (ask questions with trigger phrases) + - [ ] Commands appear in `/help` and execute correctly + - [ ] Agents trigger on appropriate scenarios + - [ ] Hooks activate on events (if applicable) + - [ ] MCP servers connect (if applicable) + - [ ] Settings files work (if applicable) + +3. **Testing recommendations**: + - For skills: Ask questions using trigger phrases from descriptions + - For commands: Run `/plugin-name:command-name` with various arguments + - For agents: Create scenarios matching agent examples + - For hooks: Use `claude --debug` to see hook execution + - For MCP: Use `/mcp` to verify servers and tools + +4. **Ask user**: "I've prepared the plugin for testing. Would you like me to guide you through testing each component, or do you want to test it yourself?" + +5. **If user wants guidance**, walk through testing each component with specific test cases + +**Output**: Plugin tested and verified working + +--- + +## Phase 8: Documentation & Next Steps + +**Goal**: Ensure plugin is well-documented and ready for distribution + +**Actions**: +1. **Verify README completeness**: + - Check README has: overview, features, installation, prerequisites, usage + - For MCP plugins: Document required environment variables + - For hook plugins: Explain hook activation + - For settings: Provide configuration templates + +2. **Add marketplace entry** (if publishing): + - Show user how to add to marketplace.json + - Help draft marketplace description + - Suggest category and tags + +3. **Create summary**: + - Mark all todos complete + - List what was created: + - Plugin name and purpose + - Components created (X skills, Y commands, Z agents, etc.) + - Key files and their purposes + - Total file count and structure + - Next steps: + - Testing recommendations + - Publishing to marketplace (if desired) + - Iteration based on usage + +4. **Suggest improvements** (optional): + - Additional components that could enhance plugin + - Integration opportunities + - Testing strategies + +**Output**: Complete, documented plugin ready for use or publication + +--- + +## Important Notes + +### Throughout All Phases + +- **Use TodoWrite** to track progress at every phase +- **Load skills with Skill tool** when working on specific component types +- **Use specialized agents** (agent-creator, plugin-validator, skill-reviewer) +- **Ask for user confirmation** at key decision points +- **Follow plugin-dev's own patterns** as reference examples +- **Apply best practices**: + - Third-person descriptions for skills + - Imperative form in skill bodies + - Commands written FOR Claude + - Strong trigger phrases + - ${CLAUDE_PLUGIN_ROOT} for portability + - Progressive disclosure + - Security-first (HTTPS, no hardcoded credentials) + +### Key Decision Points (Wait for User) + +1. After Phase 1: Confirm plugin purpose +2. After Phase 2: Approve component plan +3. After Phase 3: Proceed to implementation +4. After Phase 6: Fix issues or proceed +5. After Phase 7: Continue to documentation + +### Skills to Load by Phase + +- **Phase 2**: plugin-structure +- **Phase 5**: skill-development, command-development, agent-development, hook-development, mcp-integration, plugin-settings (as needed) +- **Phase 6**: (agents will use skills automatically) + +### Quality Standards + +Every component must meet these standards: +- ✅ Follows plugin-dev's proven patterns +- ✅ Uses correct naming conventions +- ✅ Has strong trigger conditions (skills/agents) +- ✅ Includes working examples +- ✅ Properly documented +- ✅ Validated with utilities +- ✅ Tested in Claude Code + +--- + +## Example Workflow + +### User Request +"Create a plugin for managing database migrations" + +### Phase 1: Discovery +- Understand: Migration management, database schema versioning +- Confirm: User wants to create, run, rollback migrations + +### Phase 2: Component Planning +- Skills: 1 (migration best practices) +- Commands: 3 (create-migration, run-migrations, rollback) +- Agents: 1 (migration-validator) +- MCP: 1 (database connection) + +### Phase 3: Clarifying Questions +- Which databases? (PostgreSQL, MySQL, etc.) +- Migration file format? (SQL, code-based?) +- Should agent validate before applying? +- What MCP tools needed? (query, execute, schema) + +### Phase 4-8: Implementation, Validation, Testing, Documentation + +--- + +**Begin with Phase 1: Discovery** diff --git a/commands/claude-codex-settings/plugin-dev-load-skills.md b/commands/claude-codex-settings/plugin-dev-load-skills.md new file mode 100644 index 0000000..06bfb17 --- /dev/null +++ b/commands/claude-codex-settings/plugin-dev-load-skills.md @@ -0,0 +1,18 @@ +--- +description: Load all plugin development skills +allowed-tools: Read +--- + +# Load Plugin Development Skills + +Read all plugin development SKILL.md files to provide guidance. The files are located at: + +- @${CLAUDE_PLUGIN_ROOT}/skills/plugin-structure/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/agent-development/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/command-development/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/skill-development/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/hook-development/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/mcp-integration/SKILL.md +- @${CLAUDE_PLUGIN_ROOT}/skills/plugin-settings/SKILL.md + +Use this guidance to help with plugin development tasks. diff --git a/commands/claude-codex-settings/slack-tools-setup.md b/commands/claude-codex-settings/slack-tools-setup.md new file mode 100644 index 0000000..877b707 --- /dev/null +++ b/commands/claude-codex-settings/slack-tools-setup.md @@ -0,0 +1,162 @@ +--- +description: Configure Slack MCP tokens +--- + +# Slack Tools Setup + +**Source:** [ubie-oss/slack-mcp-server](https://github.com/ubie-oss/slack-mcp-server) + +Configure the Slack MCP server with your tokens. + +## Step 1: Check Current Status + +Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`. + +Check if Slack is configured: + +- If any of these contain placeholder values, it needs configuration: + - `slack.env.GITHUB_TOKEN` contains `REPLACE_WITH_GITHUB_PAT` + - `slack.env.SLACK_BOT_TOKEN` contains `REPLACE_WITH_BOT_TOKEN` + - `slack.env.SLACK_USER_TOKEN` contains `REPLACE_WITH_USER_TOKEN` +- If all contain actual tokens (ghp\_, xoxb-, xoxp-), already configured + +Report status: + +- "Slack MCP is not configured - needs tokens" +- OR "Slack MCP is already configured" + +## Step 2: Show Setup Guide + +Tell the user: + +``` +To configure Slack MCP, you need 3 tokens: + +1. GitHub PAT (ghp_...) - For npm package access + Get it at: https://github.com/settings/tokens + Required scope: read:packages + +2. Bot Token (xoxb-...) - From your Slack app +3. User Token (xoxp-...) - From your Slack app + Get both at: https://api.slack.com/apps + Required scopes: channels:history, channels:read, chat:write, users:read + +Don't need Slack MCP? Disable it via /mcp command. +``` + +## Step 3: Ask for GitHub PAT + +Use AskUserQuestion: + +- question: "Do you have your GitHub PAT ready?" +- header: "GitHub PAT" +- options: + - label: "Yes, I have it" + description: "I have my GitHub PAT ready to paste (starts with ghp\_)" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/slack-tools:setup` again when ready +- Remind them they can disable Slack MCP via `/mcp` if not needed +- Exit + +If user selects "Yes" or provides token via "Other": + +- If they provided token in "Other" response, use that +- Otherwise, ask them to paste the token + +## Step 4: Ask for Bot Token + +Use AskUserQuestion: + +- question: "Do you have your Slack Bot Token ready?" +- header: "Bot Token" +- options: + - label: "Yes, I have it" + description: "I have my Slack bot token ready (starts with xoxb-)" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/slack-tools:setup` again when ready +- Exit + +If user selects "Yes" or provides token via "Other": + +- If they provided token in "Other" response, use that +- Otherwise, ask them to paste the token + +## Step 5: Ask for User Token + +Use AskUserQuestion: + +- question: "Do you have your Slack User Token ready?" +- header: "User Token" +- options: + - label: "Yes, I have it" + description: "I have my Slack user token ready (starts with xoxp-)" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/slack-tools:setup` again when ready +- Exit + +If user selects "Yes" or provides token via "Other": + +- If they provided token in "Other" response, use that +- Otherwise, ask them to paste the token + +## Step 6: Validate Tokens + +Validate the provided tokens: + +- GitHub PAT must start with `ghp_` +- Bot Token must start with `xoxb-` +- User Token must start with `xoxp-` + +If any invalid: + +- Show error with specific token that failed validation +- Ask if they want to try again or skip + +## Step 7: Update Configuration + +1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json` +2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup` +3. Update these values: + - `slack.env.GITHUB_TOKEN` to the GitHub PAT + - `slack.env.SLACK_BOT_TOKEN` to the bot token + - `slack.env.SLACK_USER_TOKEN` to the user token +4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json` + +## Step 8: Confirm Success + +Tell the user: + +``` +Slack MCP configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +To verify after restart, run /mcp and check that 'slack' server is connected. +``` + +## Troubleshooting + +If Slack MCP fails after configuration: + +``` +Common fixes: +1. invalid_auth - Token expired or invalid, regenerate from api.slack.com +2. missing_scope - Re-install app with required OAuth scopes +3. Token format - Bot tokens start with xoxb-, user tokens with xoxp- +4. Channel not found - Ensure bot is invited to the channel +5. Rate limited - Wait and retry, reduce request frequency +``` diff --git a/commands/claude-codex-settings/statusline-tools-setup.md b/commands/claude-codex-settings/statusline-tools-setup.md new file mode 100644 index 0000000..b082901 --- /dev/null +++ b/commands/claude-codex-settings/statusline-tools-setup.md @@ -0,0 +1,165 @@ +--- +description: Configure Claude Code statusline +--- + +# Statusline Setup + +Configure the Claude Code statusline to display session context, cost, and account-wide usage. + +## Step 1: Check Current Status + +Read `~/.claude/settings.json` and `.claude/settings.local.json` to check if `statusLine` is configured. + +Report: + +- "Statusline configured in user settings: [command]" if found in ~/.claude/settings.json +- "Statusline configured in project settings: [command]" if found in .claude/settings.local.json +- "Statusline is not configured" if neither exists + +## Step 2: Show Options + +Tell the user: + +``` +Statusline Options: + +1. Native (recommended for Claude subscription/API) + - Shows: [Session] context% $cost | [5H] usage% time-until-reset + - Account-wide 5H usage tracking with time until reset + - Color-coded: green <50%, yellow 50-80%, red >80% + - Requires: Claude subscription (Max/Pro) or Claude API key + - Does NOT work with: z.ai, third-party endpoints + +2. ccusage (for external endpoints) + - Shows: context%, session/daily cost + - Works with: Anthropic, z.ai, third-party endpoints + - Limitation: No account-wide 5H block usage info + +3. Disable - Remove statusline +``` + +## Step 3: Ask for Choice + +Use AskUserQuestion: + +- question: "Which statusline do you want?" +- header: "Statusline" +- options: + - label: "Native (Claude subscription/API)" + description: "Session + account-wide 5H usage with reset time" + - label: "ccusage (external endpoints)" + description: "Works with z.ai - no 5H block info" + - label: "Disable" + description: "Remove statusline" + +## Step 4: If Native Selected + +### Ask where to install + +Use AskUserQuestion: + +- question: "Where should the statusline be configured?" +- header: "Location" +- options: + - label: "User settings (global)" + description: "~/.claude/settings.json - applies to all projects" + - label: "Project local" + description: ".claude/settings.local.json - this project only" + +### Check for existing config + +If statusLine already exists in chosen location, use AskUserQuestion: + +- question: "Statusline already configured. Replace it?" +- header: "Override" +- options: + - label: "Yes, replace" + description: "Override existing statusline config" + - label: "No, cancel" + description: "Keep current config" + +If user chooses "No, cancel", stop and say "Setup cancelled." + +### Install Native + +1. Read `${CLAUDE_PLUGIN_ROOT}/scripts/statusline.sh` +2. Write to `~/.claude/statusline.sh` +3. Run `chmod +x ~/.claude/statusline.sh` +4. Read current settings file (user or project based on choice) +5. Create backup with `.backup` suffix +6. Add/update `statusLine`: + +```json +"statusLine": { + "type": "command", + "command": "~/.claude/statusline.sh", + "padding": 0 +} +``` + +7. Write back to settings file + +## Step 5: If ccusage Selected + +### Ask where to install + +Use AskUserQuestion: + +- question: "Where should the statusline be configured?" +- header: "Location" +- options: + - label: "User settings (global)" + description: "~/.claude/settings.json - applies to all projects" + - label: "Project local" + description: ".claude/settings.local.json - this project only" + +### Check for existing config and confirm override (same as Native) + +### Install ccusage + +1. Read current settings file +2. Create backup with `.backup` suffix +3. Add/update `statusLine`: + +```json +"statusLine": { + "type": "command", + "command": "npx -y ccusage@latest statusline --cost-source cc", + "padding": 0 +} +``` + +4. Write back to settings file + +## Step 6: If Disable Selected + +1. Read `~/.claude/settings.json` +2. Create backup +3. Remove `statusLine` key if exists +4. Write back + +Also check `.claude/settings.local.json` and remove `statusLine` if present. + +## Step 7: Confirm Success + +Tell the user: + +``` +Statusline configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code (Ctrl+C or /exit) +- Run `claude` again + +Backup saved to [settings-file].backup +``` + +## Requirements + +Native statusline requires `jq`. Check with `which jq`. + +If jq not installed: + +- macOS: `brew install jq` +- Ubuntu/Debian: `sudo apt install jq` +- Other: https://jqlang.org/download/ diff --git a/commands/claude-codex-settings/supabase-tools-setup.md b/commands/claude-codex-settings/supabase-tools-setup.md new file mode 100644 index 0000000..3fb8e12 --- /dev/null +++ b/commands/claude-codex-settings/supabase-tools-setup.md @@ -0,0 +1,96 @@ +--- +description: Configure Supabase MCP with OAuth authentication +--- + +# Supabase Tools Setup + +**Source:** [supabase-community/supabase-mcp](https://github.com/supabase-community/supabase-mcp) + +Configure the official Supabase MCP server with OAuth. + +## Step 1: Check Current Status + +Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`. + +Check if Supabase is configured: + +- If `supabase.url` contains `REPLACE_WITH_PROJECT_REF`, it needs configuration +- If it contains an actual project reference, already configured + +Report status: + +- "Supabase MCP is not configured - needs project reference" +- OR "Supabase MCP is configured with project: PROJECT_REF" + +## Step 2: Show Setup Guide + +Tell the user: + +``` +To configure Supabase MCP, you need your Supabase project reference. + +Quick steps: +1. Go to supabase.com/dashboard +2. Select your project +3. Go to Project Settings > General +4. Copy the "Reference ID" (looks like: abcdefghijklmnop) + +The MCP uses OAuth - you'll authenticate via browser when first connecting. +``` + +## Step 3: Ask for Project Reference + +Use AskUserQuestion: + +- question: "Do you have your Supabase project reference ready?" +- header: "Project Ref" +- options: + - label: "Yes, I have it" + description: "I have my Supabase project reference ready" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/supabase-tools:setup` again when ready +- Remind them they can disable Supabase MCP via `/mcp` if not needed +- Exit + +If user selects "Yes" or provides reference via "Other": + +- If they provided reference in "Other" response, use that +- Otherwise, ask them to paste the project reference + +## Step 4: Validate Reference + +Validate the provided reference: + +- Must be alphanumeric +- Should be 16-24 characters + +If invalid: + +- Show error: "Invalid project reference format" +- Ask if they want to try again or skip + +## Step 5: Update Configuration + +1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json` +2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup` +3. Replace `REPLACE_WITH_PROJECT_REF` with the actual project reference in the URL +4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json` + +## Step 6: Confirm Success + +Tell the user: + +``` +Supabase MCP configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +On first use, you'll be prompted to authenticate via browser (OAuth). +To verify after restart, run /mcp and check that 'supabase' server is connected. +``` diff --git a/commands/claude-codex-settings/tavily-tools-setup.md b/commands/claude-codex-settings/tavily-tools-setup.md new file mode 100644 index 0000000..e75941a --- /dev/null +++ b/commands/claude-codex-settings/tavily-tools-setup.md @@ -0,0 +1,97 @@ +--- +description: Configure Tavily MCP server credentials +--- + +# Tavily Tools Setup + +**Source:** [tavily-ai/tavily-mcp](https://github.com/tavily-ai/tavily-mcp) + +Configure the Tavily MCP server with your API key. + +## Step 1: Check Current Status + +Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`. + +Check if Tavily is configured: + +- If `tavily.env.TAVILY_API_KEY` contains `REPLACE_WITH_TAVILY_API_KEY`, it needs configuration +- If it contains a value starting with `tvly-`, already configured + +Report status: + +- "Tavily MCP is not configured - needs an API key" +- OR "Tavily MCP is already configured" + +## Step 2: Show Setup Guide + +Tell the user: + +``` +To configure Tavily MCP, you need a Tavily API key. + +Quick steps: +1. Go to app.tavily.com and sign in +2. Navigate to API Keys +3. Create a new API key +4. Copy the key (starts with tvly-) + +Free tier: 1,000 searches/month + +Don't need Tavily MCP? Disable it via /mcp command. +``` + +## Step 3: Ask for Key + +Use AskUserQuestion: + +- question: "Do you have your Tavily API key ready?" +- header: "Tavily Key" +- options: + - label: "Yes, I have it" + description: "I have my Tavily API key ready to paste" + - label: "No, skip for now" + description: "I'll configure it later" + +If user selects "No, skip for now": + +- Tell them they can run `/tavily-tools:setup` again when ready +- Remind them they can disable Tavily MCP via `/mcp` if not needed +- Exit + +If user selects "Yes" or provides key via "Other": + +- If they provided key in "Other" response, use that +- Otherwise, ask them to paste the key + +## Step 4: Validate Key + +Validate the provided key: + +- Must start with `tvly-` +- Must be at least 20 characters + +If invalid: + +- Show error: "Invalid key format. Tavily keys start with 'tvly-'" +- Ask if they want to try again or skip + +## Step 5: Update Configuration + +1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json` +2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup` +3. Update `tavily.env.TAVILY_API_KEY` value to the actual key +4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json` + +## Step 6: Confirm Success + +Tell the user: + +``` +Tavily MCP configured successfully! + +IMPORTANT: Restart Claude Code for changes to take effect. +- Exit Claude Code +- Run `claude` again + +To verify after restart, run /mcp and check that 'tavily' server is connected. +``` diff --git a/hooks/claude-codex-settings/hooks.json b/hooks/claude-codex-settings/hooks.json new file mode 100644 index 0000000..e25efc2 --- /dev/null +++ b/hooks/claude-codex-settings/hooks.json @@ -0,0 +1,16 @@ +{ + "description": "General development hooks for code quality", + "hooks": { + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/enforce_rg_over_grep.py" + } + ] + } + ] + } +} diff --git a/hooks/claude-codex-settings/scripts/bash_formatting.py b/hooks/claude-codex-settings/scripts/bash_formatting.py new file mode 100755 index 0000000..01adca0 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/bash_formatting.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +""" +PostToolUse hook: Auto-format Bash/Shell scripts with prettier-plugin-sh +""" +import json +import shutil +import subprocess +import sys +from pathlib import Path + + +def check_prettier_version() -> bool: + """Check if prettier is installed and warn if version differs from 3.6.2.""" + if not shutil.which('npx'): + return False + try: + result = subprocess.run(['npx', 'prettier', '--version'], + capture_output=True, text=True, check=False, timeout=5) + if result.returncode == 0: + version = result.stdout.strip() + if '3.6.2' not in version: + print(f"⚠️ Prettier version mismatch: expected 3.6.2, found {version}") + return True + except Exception: + pass + return False + + +def main(): + try: + data = json.load(sys.stdin) + file_path = data.get("tool_input", {}).get("file_path", "") + + if not file_path.endswith(('.sh', '.bash')): + sys.exit(0) + + sh_file = Path(file_path) + if not sh_file.exists() or any(p in sh_file.parts for p in ['.git', '.venv', 'venv', 'env', '.env', '__pycache__', '.mypy_cache', '.pytest_cache', '.tox', '.nox', '.eggs', 'eggs', '.idea', '.vscode', 'node_modules', 'site-packages', 'build', 'dist', '.claude']): + sys.exit(0) + + # Check if prettier is available + if not check_prettier_version(): + sys.exit(0) + + # Try prettier with prettier-plugin-sh, handle any failure gracefully + try: + cmd = f'npx prettier --write --list-different --print-width 120 --plugin=$(npm root -g)/prettier-plugin-sh/lib/index.cjs "{sh_file}"' + subprocess.run(cmd, shell=True, capture_output=True, check=False, cwd=sh_file.parent, timeout=10) + except Exception: + pass # Silently handle any failure (missing plugin, timeout, etc.) + + except Exception: + pass + + sys.exit(0) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/hooks/claude-codex-settings/scripts/enforce_rg_over_grep.py b/hooks/claude-codex-settings/scripts/enforce_rg_over_grep.py new file mode 100755 index 0000000..e12d297 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/enforce_rg_over_grep.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +import json +import re +import sys + +# Define validation rules as a list of (regex pattern, message) tuples +VALIDATION_RULES = [ + ( + r"\bgrep\b(?!.*\|)", + "Use 'rg' (ripgrep) instead of 'grep' for better performance and features", + ), + ( + r"\bfind\s+\S+\s+-name\b", + "Use 'rg --files | rg pattern' or 'rg --files -g pattern' instead of 'find -name' for better performance", + ), +] + + +def validate_command(command: str) -> list[str]: + issues = [] + for pattern, message in VALIDATION_RULES: + if re.search(pattern, command): + issues.append(message) + return issues + + +try: + input_data = json.load(sys.stdin) +except json.JSONDecodeError as e: + print(f"Error: Invalid JSON input: {e}", file=sys.stderr) + sys.exit(1) + +tool_name = input_data.get("tool_name", "") +tool_input = input_data.get("tool_input", {}) +command = tool_input.get("command", "") + +if tool_name != "Bash" or not command: + sys.exit(0) + +# Validate the command +issues = validate_command(command) + +if issues: + for message in issues: + print(f"• {message}", file=sys.stderr) + # Exit code 2 blocks tool call and shows stderr to Claude + sys.exit(2) \ No newline at end of file diff --git a/hooks/claude-codex-settings/scripts/format_python_docstrings.py b/hooks/claude-codex-settings/scripts/format_python_docstrings.py new file mode 100755 index 0000000..06c2d60 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/format_python_docstrings.py @@ -0,0 +1,547 @@ +#!/usr/bin/env python3 +"""Format Python docstrings in Google style without external dependencies.""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path + +URLS = {"https", "http", "ftp"} +SECTIONS = ( + "Args", + "Attributes", + "Methods", + "Returns", + "Yields", + "Raises", + "Example", + "Examples", + "Notes", + "References", +) +SECTION_ALIASES = { + "Arguments": "Args", + "Usage": "Examples", + "Usage Example": "Examples", + "Usage Examples": "Examples", + "Example Usage": "Examples", + "Example": "Examples", + "Return": "Returns", + "Yield": "Yields", + "Raise": "Raises", + "Note": "Notes", + "Reference": "References", +} +LIST_RX = re.compile(r"""^(\s*)(?:[-*•]\s+|(?:\d+|[A-Za-z]+)[\.\)]\s+)""") +TABLE_RX = re.compile(r"^\s*\|.*\|\s*$") +TABLE_RULE_RX = re.compile(r"^\s*[:\-\|\s]{3,}$") +TREE_CHARS = ("└", "├", "│", "─") + +# Antipatterns for non-Google docstring styles +RST_FIELD_RX = re.compile(r"^\s*:(param|type|return|rtype|raises)\b", re.M) +EPYDOC_RX = re.compile(r"^\s*@(?:param|type|return|rtype|raise)\b", re.M) +NUMPY_UNDERLINE_SECTION_RX = re.compile(r"^\s*(Parameters|Returns|Yields|Raises|Notes|Examples)\n[-]{3,}\s*$", re.M) +GOOGLE_SECTION_RX = re.compile( + r"^\s*(Args|Attributes|Methods|Returns|Yields|Raises|Example|Examples|Notes|References):\s*$", re.M +) +NON_GOOGLE = {"numpy", "rest", "epydoc"} + + +def wrap_words(words: list[str], width: int, indent: int, min_words_per_line: int = 1) -> list[str]: + """Wrap words to width with indent; optionally avoid very short orphan lines.""" + pad = " " * indent + if not words: + return [] + lines: list[list[str]] = [] + cur: list[str] = [] + cur_len = indent + for w in words: + need = len(w) + (1 if cur else 0) + if cur and cur_len + need > width: + lines.append(cur) + cur, cur_len = [w], indent + len(w) + else: + cur.append(w) + cur_len += need + if cur: + lines.append(cur) + if min_words_per_line > 1: + i = 1 + while i < len(lines): + if len(lines[i]) < min_words_per_line and len(lines[i - 1]) > 1: + donor = lines[i - 1][-1] + this_len = len(pad) + sum(len(x) for x in lines[i]) + (len(lines[i]) - 1) + if this_len + (1 if lines[i] else 0) + len(donor) <= width: + lines[i - 1].pop() + lines[i].insert(0, donor) + if i > 1 and len(lines[i - 1]) == 1: + i -= 1 + continue + i += 1 + return [pad + " ".join(line) for line in lines] + + +def wrap_para(text: str, width: int, indent: int, min_words_per_line: int = 1) -> list[str]: + """Wrap a paragraph string; orphan control via min_words_per_line.""" + if text := text.strip(): + return wrap_words(text.split(), width, indent, min_words_per_line) + else: + return [] + + +def wrap_hanging(head: str, desc: str, width: int, cont_indent: int) -> list[str]: + """Wrap 'head + desc' with hanging indent; ensure first continuation has >=2 words.""" + room = width - len(head) + words = desc.split() + if not words: + return [head.rstrip()] + take, used = [], 0 + for w in words: + need = len(w) + (1 if take else 0) + if used + need <= room: + take.append(w) + used += need + else: + break + out: list[str] = [] + if take: + out.append(head + " ".join(take)) + rest = words[len(take) :] + else: + out.append(head.rstrip()) + rest = words + out.extend(wrap_words(rest, width, cont_indent, min_words_per_line=2)) + return out + + +def is_list_item(s: str) -> bool: + """Return True if s looks like a bullet/numbered list item.""" + return bool(LIST_RX.match(s.lstrip())) + + +def is_fence_line(s: str) -> bool: + """Return True if s is a Markdown code-fence line.""" + t = s.lstrip() + return t.startswith("```") + + +def is_table_like(s: str) -> bool: + """Return True if s resembles a simple Markdown table or rule line.""" + return bool(TABLE_RX.match(s)) or bool(TABLE_RULE_RX.match(s)) + + +def is_tree_like(s: str) -> bool: + """Return True if s contains common ASCII tree characters.""" + return any(ch in s for ch in TREE_CHARS) + + +def is_indented_block_line(s: str) -> bool: + """Return True if s looks like a deeply-indented preformatted block.""" + return bool(s.startswith(" ")) or s.startswith("\t") + + +def header_name(line: str) -> str | None: + """Return canonical section header or None.""" + s = line.strip() + if not s.endswith(":") or len(s) <= 1: + return None + name = s[:-1].strip() + name = SECTION_ALIASES.get(name, name) + return name if name in SECTIONS else None + + +def add_header(lines: list[str], indent: int, title: str) -> None: + """Append a section header with a blank line before it.""" + while lines and lines[-1] == "": + lines.pop() + if lines: + lines.append("") + lines.append(" " * indent + f"{title}:") + + +def emit_paragraphs( + src: list[str], width: int, indent: int, list_indent: int | None = None, orphan_min: int = 1 +) -> list[str]: + """Wrap text while preserving lists, fenced code, tables, trees, and deeply-indented blocks.""" + out: list[str] = [] + buf: list[str] = [] + in_fence = False + + def flush(): + """Flush buffered paragraph with wrapping.""" + nonlocal buf + if buf: + out.extend(wrap_para(" ".join(x.strip() for x in buf), width, indent, min_words_per_line=orphan_min)) + buf = [] + + for raw in src: + s = raw.rstrip("\n") + stripped = s.strip() + if not stripped: + flush() + out.append("") + continue + if is_fence_line(s): + flush() + out.append(s.rstrip()) + in_fence = not in_fence + continue + if in_fence or is_table_like(s) or is_tree_like(s) or is_indented_block_line(s): + flush() + out.append(s.rstrip()) + continue + if is_list_item(s): + flush() + out.append((" " * list_indent + stripped) if list_indent is not None else s.rstrip()) + continue + buf.append(s) + flush() + while out and out[-1] == "": + out.pop() + return out + + +def parse_sections(text: str) -> dict[str, list[str]]: + """Parse Google-style docstring into sections.""" + parts = {k: [] for k in ("summary", "description", *SECTIONS)} + cur = "summary" + for raw in text.splitlines(): + line = raw.rstrip("\n") + if h := header_name(line): + cur = h + continue + if not line.strip(): + if cur == "summary" and parts["summary"]: + cur = "description" + if parts[cur]: + parts[cur].append("") + continue + parts[cur].append(line) + return parts + + +def looks_like_param(s: str) -> bool: + """Heuristic: True if line looks like a 'name: desc' param without being a list item.""" + if is_list_item(s) or ":" not in s: + return False + head = s.split(":", 1)[0].strip() + return False if head in URLS else bool(head) + + +def iter_items(lines: list[str]) -> list[list[str]]: + """Group lines into logical items separated by next param-like line.""" + items, i, n = [], 0, len(lines) + while i < n: + while i < n and not lines[i].strip(): + i += 1 + if i >= n: + break + item = [lines[i]] + i += 1 + while i < n: + st = lines[i].strip() + if st and looks_like_param(st): + break + item.append(lines[i]) + i += 1 + items.append(item) + return items + + +def format_structured_block(lines: list[str], width: int, base: int) -> list[str]: + """Format Args/Returns/etc.; continuation at base+4, lists at base+8.""" + out: list[str] = [] + cont, lst = base + 4, base + 8 + for item in iter_items(lines): + first = item[0].strip() + name, desc = ([*first.split(":", 1), ""])[:2] + name, desc = name.strip(), desc.strip() + had_colon = ":" in first + if not name or (" " in name and "(" not in name and ")" not in name): + out.extend(emit_paragraphs(item, width, cont, lst, orphan_min=2)) + continue + # Join continuation lines that aren't new paragraphs into desc + parts = [desc] if desc else [] + tail, i = [], 1 + while i < len(item): + line = item[i].strip() + if not line or is_list_item(item[i]) or is_fence_line(item[i]) or is_table_like(item[i]): + tail = item[i:] + break + parts.append(line) + i += 1 + else: + tail = [] + desc = " ".join(parts) + head = " " * cont + (f"{name}: " if (desc or had_colon) else name) + out.extend(wrap_hanging(head, desc, width, cont + 4)) + if tail: + if body := emit_paragraphs(tail, width, cont + 4, lst, orphan_min=2): + out.extend(body) + return out + + +def detect_opener(original_literal: str) -> tuple[str, str, bool]: + """Return (prefix, quotes, inline_hint) from the original string token safely.""" + s = original_literal.lstrip() + i = 0 + while i < len(s) and s[i] in "rRuUbBfF": + i += 1 + quotes = '"""' + if i + 3 <= len(s) and s[i : i + 3] in ('"""', "'''"): + quotes = s[i : i + 3] + keep = "".join(ch for ch in s[:i] if ch in "rRuU") + j = i + len(quotes) + inline_hint = j < len(s) and s[j : j + 1] not in {"", "\n", "\r"} + return keep, quotes, inline_hint + + +def format_google(text: str, indent: int, width: int, quotes: str, prefix: str, start_newline: bool) -> str: + """Format multi-line Google-style docstring with start_newline controlling summary placement.""" + p = parse_sections(text) + opener = prefix + quotes + out: list[str] = [] + + if p["summary"]: + summary_text = " ".join(x.strip() for x in p["summary"]).strip() + if summary_text and summary_text[-1] not in ".!?": + summary_text += "." + + if start_newline: + out.append(opener) + out.extend(emit_paragraphs([summary_text], width, indent, list_indent=indent, orphan_min=1)) + else: + eff_width = max(1, width - indent) + out.extend(wrap_hanging(opener, summary_text, eff_width, indent)) + else: + out.append(opener) + + if any(x.strip() for x in p["description"]): + out.append("") + out.extend(emit_paragraphs(p["description"], width, indent, list_indent=indent, orphan_min=1)) + + has_content = bool(p["summary"]) or any(x.strip() for x in p["description"]) + for sec in ("Args", "Attributes", "Methods", "Returns", "Yields", "Raises"): + if any(x.strip() for x in p[sec]): + if has_content: + add_header(out, indent, sec) + else: + out.append(" " * indent + f"{sec}:") + has_content = True + out.extend(format_structured_block(p[sec], width, indent)) + + for sec in ("Examples", "Notes", "References"): + if any(x.strip() for x in p[sec]): + add_header(out, indent, sec) + out.extend(x.rstrip() for x in p[sec]) + + while out and out[-1] == "": + out.pop() + out.append(" " * indent + quotes) + return "\n".join(out) + + +def likely_docstring_style(text: str) -> str: + """Return 'google' | 'numpy' | 'rest' | 'epydoc' | 'unknown' for docstring text.""" + t = "\n".join(line.rstrip() for line in text.strip().splitlines()) + if RST_FIELD_RX.search(t): + return "rest" + if EPYDOC_RX.search(t): + return "epydoc" + if NUMPY_UNDERLINE_SECTION_RX.search(t): + return "numpy" + return "google" if GOOGLE_SECTION_RX.search(t) else "unknown" + + +def format_docstring( + content: str, indent: int, width: int, quotes: str, prefix: str, start_newline: bool = False +) -> str: + """Single-line if short/sectionless/no-lists; else Google-style; preserve quotes/prefix.""" + if not content or not content.strip(): + return f"{prefix}{quotes}{quotes}" + style = likely_docstring_style(content) + if style in NON_GOOGLE: + body = "\n".join(line.rstrip() for line in content.rstrip("\n").splitlines()) + return f"{prefix}{quotes}{body}{quotes}" + text = content.strip() + has_section = any(f"{s}:" in text for s in SECTIONS) + has_list = any(is_list_item(line) for line in text.splitlines()) + single_ok = ( + ("\n" not in text) + and not has_section + and not has_list + and (indent + len(prefix) + len(quotes) * 2 + len(text) <= width) + ) + if single_ok: + words = text.split() + if words and not words[0].startswith(("http://", "https://")) and not words[0][0].isupper(): + words[0] = words[0][0].upper() + words[0][1:] + out = " ".join(words) + if out and out[-1] not in ".!?": + out += "." + return f"{prefix}{quotes}{out}{quotes}" + return format_google(text, indent, width, quotes, prefix, start_newline) + + +class Visitor(ast.NodeVisitor): + """Collect docstring replacements for classes and functions.""" + + def __init__(self, src: list[str], width: int = 120, start_newline: bool = False): + """Init with source lines, target width, and start_newline flag.""" + self.src, self.width, self.repl, self.start_newline = src, width, [], start_newline + + def visit_Module(self, node): + """Skip module docstring; visit children.""" + self.generic_visit(node) + + def visit_ClassDef(self, node): + """Visit class definition and handle its docstring.""" + self._handle(node) + self.generic_visit(node) + + def visit_FunctionDef(self, node): + """Visit function definition and handle its docstring.""" + self._handle(node) + self.generic_visit(node) + + def visit_AsyncFunctionDef(self, node): + """Visit async function definition and handle its docstring.""" + self._handle(node) + self.generic_visit(node) + + def _handle(self, node): + """If first stmt is a string expr, schedule replacement.""" + try: + doc = ast.get_docstring(node, clean=False) + if not doc or not node.body or not isinstance(node.body[0], ast.Expr): + return + s = node.body[0].value + if not (isinstance(s, ast.Constant) and isinstance(s.value, str)): + return + if likely_docstring_style(doc) in NON_GOOGLE: + return + sl, el = node.body[0].lineno - 1, node.body[0].end_lineno - 1 + sc, ec = node.body[0].col_offset, node.body[0].end_col_offset + if sl < 0 or el >= len(self.src): + return + original = ( + self.src[sl][sc:ec] + if sl == el + else "\n".join([self.src[sl][sc:], *self.src[sl + 1 : el], self.src[el][:ec]]) + ) + prefix, quotes, _ = detect_opener(original) + formatted = format_docstring(doc, sc, self.width, quotes, prefix, self.start_newline) + if formatted.strip() != original.strip(): + self.repl.append((sl, el, sc, ec, formatted)) + except Exception: + return + + +def format_python_file(text: str, width: int = 120, start_newline: bool = False) -> str: + """Return source with reformatted docstrings; on failure, return original.""" + s = text + if not s.strip(): + return s + if ('"""' not in s and "'''" not in s) or ("def " not in s and "class " not in s and "async def " not in s): + return s + try: + tree = ast.parse(s) + except SyntaxError: + return s + src = s.splitlines() + v = Visitor(src, width, start_newline=start_newline) + try: + v.visit(tree) + except Exception: + return s + if not v.repl: + return s + for sl, el, sc, ec, rep in reversed(v.repl): + try: + if sl == el: + src[sl] = src[sl][:sc] + rep + src[sl][ec:] + else: + nl = rep.splitlines() + nl[0] = src[sl][:sc] + nl[0] + nl[-1] += src[el][ec:] + src[sl : el + 1] = nl + except Exception: + continue + return "\n".join(src) + + +def preserve_trailing_newlines(original: str, formatted: str) -> str: + """Preserve the original trailing newline count.""" + o = len(original) - len(original.rstrip("\n")) + f = len(formatted) - len(formatted.rstrip("\n")) + return formatted if o == f else formatted.rstrip("\n") + ("\n" * o) + + +def read_python_path() -> Path | None: + """Read the Python path from stdin payload. + + Returns: + (Path | None): Python file path when present and valid. + """ + try: + data = json.load(sys.stdin) + except Exception: + return None + file_path = data.get("tool_input", {}).get("file_path", "") + path = Path(file_path) if file_path else None + if not path or path.suffix != ".py" or not path.exists(): + return None + if any( + p in path.parts + for p in [ + ".git", + ".venv", + "venv", + "env", + ".env", + "__pycache__", + ".mypy_cache", + ".pytest_cache", + ".tox", + ".nox", + ".eggs", + "eggs", + ".idea", + ".vscode", + "node_modules", + "site-packages", + "build", + "dist", + ".claude", + ] + ): + return None + return path + + +def main() -> None: + """Format Python docstrings in files.""" + python_file = read_python_path() + if python_file: + try: + content = python_file.read_text() + formatted = preserve_trailing_newlines(content, format_python_file(content)) + if formatted != content: + python_file.write_text(formatted) + print(f"Formatted: {python_file}") + except Exception as e: + output = { + "hookSpecificOutput": { + "hookEventName": "PostToolUse", + "additionalContext": f"Docstring formatting failed for {python_file.name}: {e}", + } + } + print(json.dumps(output)) + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/hooks/claude-codex-settings/scripts/gh_pr_create_confirm.py b/hooks/claude-codex-settings/scripts/gh_pr_create_confirm.py new file mode 100755 index 0000000..3b7715d --- /dev/null +++ b/hooks/claude-codex-settings/scripts/gh_pr_create_confirm.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +"""PreToolUse hook: show confirmation modal before creating GitHub PR via gh CLI.""" +import json +import re +import subprocess +import sys + + +def parse_gh_pr_create(command: str) -> dict[str, str]: + """Parse gh pr create command to extract PR parameters. + + Args: + command (str): The gh pr create command string + + Returns: + (dict): Dictionary with title, body, assignee, reviewer keys + """ + params = {"title": "", "body": "", "assignee": "", "reviewer": ""} + + # Extract title (-t or --title) + title_match = re.search(r'(?:-t|--title)\s+["\']([^"\']+)["\']', command) + if title_match: + params["title"] = title_match.group(1) + + # Extract body (-b or --body) - handle HEREDOC syntax first, then simple quotes + heredoc_match = re.search( + r'(?:-b|--body)\s+"?\$\(cat\s+<<["\']?(\w+)["\']?\s+(.*?)\s+\1\s*\)"?', + command, + re.DOTALL, + ) + if heredoc_match: + params["body"] = heredoc_match.group(2).strip() + else: + body_match = re.search(r'(?:-b|--body)\s+"([^"]+)"', command) + if body_match: + params["body"] = body_match.group(1) + + # Extract assignee (-a or --assignee) + assignee_match = re.search(r'(?:-a|--assignee)\s+([^\s]+)', command) + if assignee_match: + params["assignee"] = assignee_match.group(1) + + # Extract reviewer (-r or --reviewer) + reviewer_match = re.search(r'(?:-r|--reviewer)\s+([^\s]+)', command) + if reviewer_match: + params["reviewer"] = reviewer_match.group(1) + + return params + + +def resolve_username(assignee: str) -> str: + """Resolve @me to actual GitHub username. + + Args: + assignee (str): Assignee value from command (may be @me) + + Returns: + (str): Resolved username or original value + """ + if assignee == "@me": + try: + result = subprocess.run( + ["gh", "api", "user", "--jq", ".login"], + capture_output=True, + text=True, + timeout=5, + ) + if result.returncode == 0: + return result.stdout.strip() + except (subprocess.TimeoutExpired, FileNotFoundError): + pass + return assignee + + +def format_confirmation_message(params: dict[str, str]) -> str: + """Format PR parameters into readable confirmation message. + + Args: + params (dict): Dictionary with title, body, assignee, reviewer + + Returns: + (str): Formatted confirmation message + """ + # Truncate body if too long + body = params["body"] + if len(body) > 500: + body = body[:500] + "..." + + # Resolve assignee + assignee = resolve_username(params["assignee"]) if params["assignee"] else "None" + + lines = ["📝 Create Pull Request?", "", f"Title: {params['title']}", ""] + + if body: + lines.extend(["Body:", body, ""]) + + lines.append(f"Assignee: {assignee}") + + if params["reviewer"]: + lines.append(f"Reviewer: {params['reviewer']}") + + return "\n".join(lines) + + +try: + input_data = json.load(sys.stdin) +except json.JSONDecodeError as e: + print(f"Error: Invalid JSON input: {e}", file=sys.stderr) + sys.exit(1) + +tool_name = input_data.get("tool_name", "") +tool_input = input_data.get("tool_input", {}) +command = tool_input.get("command", "") + +# Only handle gh pr create commands +if tool_name != "Bash" or not command.strip().startswith("gh pr create"): + sys.exit(0) + +# Parse PR parameters +params = parse_gh_pr_create(command) + +# Format confirmation message +message = format_confirmation_message(params) + +# Return JSON with ask decision +output = { + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "ask", + "permissionDecisionReason": message, + } +} + +print(json.dumps(output)) +sys.exit(0) diff --git a/hooks/claude-codex-settings/scripts/git_commit_confirm.py b/hooks/claude-codex-settings/scripts/git_commit_confirm.py new file mode 100755 index 0000000..77db664 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/git_commit_confirm.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +"""PreToolUse hook: show confirmation modal before creating git commit.""" +import json +import re +import subprocess +import sys + + +def parse_git_commit_message(command: str) -> dict[str, str]: + """Parse git commit command to extract commit message. + + Args: + command (str): The git commit command string + + Returns: + (dict): Dictionary with message and is_amend keys + """ + params = {"message": "", "is_amend": False} + + # Check for --amend flag + params["is_amend"] = "--amend" in command + + # Try to extract heredoc format: git commit -m "$(cat <<'EOF' ... EOF)" + heredoc_match = re.search(r"<<'EOF'\s*\n(.*?)\nEOF", command, re.DOTALL) + if heredoc_match: + params["message"] = heredoc_match.group(1).strip() + return params + + # Try to extract simple -m "message" format + simple_matches = re.findall(r'(?:-m|--message)\s+["\']([^"\']+)["\']', command) + if simple_matches: + # Join multiple -m flags with double newlines + params["message"] = "\n\n".join(simple_matches) + return params + + return params + + +def get_staged_files() -> tuple[list[str], str]: + """Get list of staged files and diff stats. + + Returns: + (tuple): (list of file paths, diff stats string) + """ + try: + # Get list of staged files + files_result = subprocess.run( + ["git", "diff", "--cached", "--name-only"], + capture_output=True, + text=True, + timeout=5, + ) + + # Get diff stats + stats_result = subprocess.run( + ["git", "diff", "--cached", "--stat"], + capture_output=True, + text=True, + timeout=5, + ) + + files = [] + if files_result.returncode == 0: + files = [f for f in files_result.stdout.strip().split("\n") if f] + + stats = "" + if stats_result.returncode == 0: + # Get last line which contains the summary + stats_lines = stats_result.stdout.strip().split("\n") + if stats_lines: + stats = stats_lines[-1] + + return files, stats + + except (subprocess.TimeoutExpired, FileNotFoundError): + return [], "" + + +def format_confirmation_message(message: str, is_amend: bool, files: list[str], stats: str) -> str: + """Format commit parameters into readable confirmation message. + + Args: + message (str): Commit message + is_amend (bool): Whether this is an amend commit + files (list): List of staged file paths + stats (str): Diff statistics string + + Returns: + (str): Formatted confirmation message + """ + lines = [] + + # Header + if is_amend: + lines.append("💾 Amend Previous Commit?") + else: + lines.append("💾 Create Commit?") + lines.append("") + + # Commit message + if message: + lines.append("Message:") + lines.append(message) + lines.append("") + + # Files + if files: + lines.append(f"Files to be committed ({len(files)}):") + # Show first 15 files, truncate if more + display_files = files[:15] + for f in display_files: + lines.append(f"- {f}") + if len(files) > 15: + lines.append(f"... and {len(files) - 15} more files") + lines.append("") + + # Stats + if stats: + lines.append("Stats:") + lines.append(stats) + + # Warning if no files staged + if not files: + lines.append("⚠️ No files staged for commit") + + return "\n".join(lines) + + +try: + input_data = json.load(sys.stdin) +except json.JSONDecodeError as e: + print(f"Error: Invalid JSON input: {e}", file=sys.stderr) + sys.exit(1) + +tool_name = input_data.get("tool_name", "") +tool_input = input_data.get("tool_input", {}) +command = tool_input.get("command", "") + +# Only handle git commit commands +if tool_name != "Bash" or not command.strip().startswith("git commit"): + sys.exit(0) + +# Parse commit message +params = parse_git_commit_message(command) + +# Get staged files and stats +files, stats = get_staged_files() + +# Format confirmation message +message = format_confirmation_message(params["message"], params["is_amend"], files, stats) + +# Return JSON with ask decision +output = { + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "ask", + "permissionDecisionReason": message, + } +} + +print(json.dumps(output)) +sys.exit(0) diff --git a/hooks/claude-codex-settings/scripts/markdown_formatting.py b/hooks/claude-codex-settings/scripts/markdown_formatting.py new file mode 100755 index 0000000..e1a2725 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/markdown_formatting.py @@ -0,0 +1,311 @@ +#!/usr/bin/env python3 +""" +PostToolUse hook: Format Markdown files and embedded code blocks. +Inspired by https://github.com/ultralytics/actions/blob/main/actions/update_markdown_code_blocks.py +""" + +from __future__ import annotations + +import hashlib +import json +import re +import shutil +import subprocess +import sys +from pathlib import Path +from tempfile import TemporaryDirectory + +PYTHON_BLOCK_PATTERN = r"^( *)```(?:python|py|\{[ ]*\.py[ ]*\.annotate[ ]*\})\n(.*?)\n\1```" +BASH_BLOCK_PATTERN = r"^( *)```(?:bash|sh|shell)\n(.*?)\n\1```" +LANGUAGE_TAGS = {"python": ["python", "py", "{ .py .annotate }"], "bash": ["bash", "sh", "shell"]} + + +def check_prettier_version() -> bool: + """Check if prettier is installed and warn if version differs from 3.6.2.""" + if not shutil.which("npx"): + return False + try: + result = subprocess.run(["npx", "prettier", "--version"], + capture_output=True, text=True, check=False, timeout=5) + if result.returncode == 0: + version = result.stdout.strip() + if "3.6.2" not in version: + print(f"⚠️ Prettier version mismatch: expected 3.6.2, found {version}") + return True + except Exception: + pass + return False + + +def extract_code_blocks(markdown_content: str) -> dict[str, list[tuple[str, str]]]: + """Extract code blocks from markdown content. + + Args: + markdown_content (str): Markdown text to inspect. + + Returns: + (dict): Mapping of language names to lists of (indentation, block) pairs. + """ + python_blocks = re.compile(PYTHON_BLOCK_PATTERN, re.DOTALL | re.MULTILINE).findall(markdown_content) + bash_blocks = re.compile(BASH_BLOCK_PATTERN, re.DOTALL | re.MULTILINE).findall(markdown_content) + return {"python": python_blocks, "bash": bash_blocks} + + +def remove_indentation(code_block: str, num_spaces: int) -> str: + """Remove indentation from a block of code. + + Args: + code_block (str): Code snippet to adjust. + num_spaces (int): Leading space count to strip. + + Returns: + (str): Code with indentation removed. + """ + lines = code_block.split("\n") + stripped_lines = [line[num_spaces:] if len(line) >= num_spaces else line for line in lines] + return "\n".join(stripped_lines) + + +def add_indentation(code_block: str, num_spaces: int) -> str: + """Add indentation back to non-empty lines in a code block. + + Args: + code_block (str): Code snippet to indent. + num_spaces (int): Space count to prefix. + + Returns: + (str): Code with indentation restored. + """ + indent = " " * num_spaces + lines = code_block.split("\n") + return "\n".join([indent + line if line.strip() else line for line in lines]) + + +def format_code_with_ruff(temp_dir: Path) -> None: + """Format Python files in a temporary directory with Ruff and docstring formatter. + + Args: + temp_dir (Path): Directory containing extracted Python blocks. + """ + try: + subprocess.run(["ruff", "format", "--line-length=120", str(temp_dir)], check=True) + print("Completed ruff format ✅") + except Exception as exc: + print(f"ERROR running ruff format ❌ {exc}") + + try: + subprocess.run( + [ + "ruff", + "check", + "--fix", + "--extend-select=F,I,D,UP,RUF", + "--target-version=py39", + "--ignore=D100,D101,D103,D104,D203,D205,D212,D213,D401,D406,D407,D413,F821,F841,RUF001,RUF002,RUF012", + str(temp_dir), + ], + check=True, + ) + print("Completed ruff check ✅") + except Exception as exc: + print(f"ERROR running ruff check ❌ {exc}") + + # Format docstrings in extracted Python blocks (matches actions pipeline) + try: + from format_python_docstrings import format_python_file + + for py_file in Path(temp_dir).glob("*.py"): + content = py_file.read_text() + formatted = format_python_file(content) + if formatted != content: + py_file.write_text(formatted) + print("Completed docstring formatting ✅") + except Exception as exc: + print(f"ERROR running docstring formatter ❌ {exc}") + + +def format_bash_with_prettier(temp_dir: Path) -> None: + """Format Bash files in a temporary directory with prettier-plugin-sh. + + Args: + temp_dir (Path): Directory containing extracted Bash blocks. + """ + try: + result = subprocess.run( + "npx prettier --write --print-width 120 --plugin=$(npm root -g)/prettier-plugin-sh/lib/index.cjs ./**/*.sh", + shell=True, + capture_output=True, + text=True, + cwd=temp_dir, + ) + if result.returncode != 0: + print(f"ERROR running prettier-plugin-sh ❌ {result.stderr}") + else: + print("Completed bash formatting ✅") + except Exception as exc: + print(f"ERROR running prettier-plugin-sh ❌ {exc}") + + +def generate_temp_filename(file_path: Path, index: int, code_type: str) -> str: + """Generate a deterministic filename for a temporary code block. + + Args: + file_path (Path): Source markdown path. + index (int): Block index for uniqueness. + code_type (str): Language identifier. + + Returns: + (str): Safe filename for the temporary code file. + """ + stem = file_path.stem + code_letter = code_type[0] + path_part = str(file_path.parent).replace("/", "_").replace("\\", "_").replace(" ", "-") + hash_val = hashlib.md5(f"{file_path}_{index}".encode(), usedforsecurity=False).hexdigest()[:6] + ext = ".py" if code_type == "python" else ".sh" + filename = f"{stem}_{path_part}_{code_letter}{index}_{hash_val}{ext}" + return re.sub(r"[^\w\-.]", "_", filename) + + +def process_markdown_file( + file_path: Path, + temp_dir: Path, + process_python: bool = True, + process_bash: bool = True, +) -> tuple[str, list[tuple[int, str, Path, str]]]: + """Extract code blocks from a markdown file and store them as temporary files. + + Args: + file_path (Path): Markdown path to process. + temp_dir (Path): Directory to store temporary files. + process_python (bool, optional): Enable Python block extraction. + process_bash (bool, optional): Enable Bash block extraction. + + Returns: + markdown_content (str): Original markdown content. + temp_files (list): Extracted block metadata. + """ + try: + markdown_content = file_path.read_text() + except Exception as exc: + print(f"Error reading file {file_path}: {exc}") + return "", [] + + code_blocks_by_type = extract_code_blocks(markdown_content) + temp_files: list[tuple[int, str, Path, str]] = [] + code_types: list[tuple[str, int]] = [] + if process_python: + code_types.append(("python", 0)) + if process_bash: + code_types.append(("bash", 1000)) + + for code_type, offset in code_types: + for i, (indentation, code_block) in enumerate(code_blocks_by_type[code_type]): + num_spaces = len(indentation) + code_without_indentation = remove_indentation(code_block, num_spaces) + temp_file_path = temp_dir / generate_temp_filename(file_path, i + offset, code_type) + try: + temp_file_path.write_text(code_without_indentation) + except Exception as exc: + print(f"Error writing temp file {temp_file_path}: {exc}") + continue + temp_files.append((num_spaces, code_block, temp_file_path, code_type)) + + return markdown_content, temp_files + + +def update_markdown_file(file_path: Path, markdown_content: str, temp_files: list[tuple[int, str, Path, str]]) -> None: + """Replace markdown code blocks with formatted versions. + + Args: + file_path (Path): Markdown file to update. + markdown_content (str): Original content. + temp_files (list): Metadata for formatted code blocks. + """ + for num_spaces, original_code_block, temp_file_path, code_type in temp_files: + try: + formatted_code = temp_file_path.read_text().rstrip("\n") + except Exception as exc: + print(f"Error reading temp file {temp_file_path}: {exc}") + continue + formatted_code_with_indentation = add_indentation(formatted_code, num_spaces) + + for lang in LANGUAGE_TAGS[code_type]: + markdown_content = markdown_content.replace( + f"{' ' * num_spaces}```{lang}\n{original_code_block}\n{' ' * num_spaces}```", + f"{' ' * num_spaces}```{lang}\n{formatted_code_with_indentation}\n{' ' * num_spaces}```", + ) + + try: + file_path.write_text(markdown_content) + except Exception as exc: + print(f"Error writing file {file_path}: {exc}") + + +def run_prettier(markdown_file: Path) -> None: + """Format a markdown file with Prettier when available. + + Args: + markdown_file (Path): Markdown file to format. + """ + if not check_prettier_version(): + return + is_docs = "docs" in markdown_file.parts and "reference" not in markdown_file.parts + command = ["npx", "prettier", "--write", "--list-different", "--print-width", "120", str(markdown_file)] + if is_docs: + command = ["npx", "prettier", "--tab-width", "4", "--print-width", "120", "--write", "--list-different", str(markdown_file)] + subprocess.run(command, capture_output=True, check=False, cwd=markdown_file.parent) + + +def format_markdown_file(markdown_file: Path) -> None: + """Format markdown-embedded code and run Prettier on the file. + + Args: + markdown_file (Path): Markdown file to process. + """ + with TemporaryDirectory() as tmp_dir_name: + temp_dir = Path(tmp_dir_name) + markdown_content, temp_files = process_markdown_file(markdown_file, temp_dir) + if not temp_files: + run_prettier(markdown_file) + return + + has_python = any(code_type == "python" for *_, code_type in temp_files) + has_bash = any(code_type == "bash" for *_, code_type in temp_files) + if has_python: + format_code_with_ruff(temp_dir) + if has_bash: + format_bash_with_prettier(temp_dir) + update_markdown_file(markdown_file, markdown_content, temp_files) + + run_prettier(markdown_file) + + +def read_markdown_path() -> Path | None: + """Read the markdown path from stdin payload. + + Returns: + markdown_path (Path | None): Markdown path when present and valid. + """ + try: + data = json.load(sys.stdin) + except Exception: + return None + file_path = data.get("tool_input", {}).get("file_path", "") + path = Path(file_path) if file_path else None + if not path or path.suffix.lower() != ".md" or not path.exists(): + return None + if any(p in path.parts for p in ['.git', '.venv', 'venv', 'env', '.env', '__pycache__', '.mypy_cache', '.pytest_cache', '.tox', '.nox', '.eggs', 'eggs', '.idea', '.vscode', 'node_modules', 'site-packages', 'build', 'dist', '.claude']): + return None + return path + + +def main() -> None: + """Run markdown formatting hook.""" + markdown_file = read_markdown_path() + if markdown_file: + format_markdown_file(markdown_file) + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/hooks/claude-codex-settings/scripts/notify.sh b/hooks/claude-codex-settings/scripts/notify.sh new file mode 100755 index 0000000..3a184cc --- /dev/null +++ b/hooks/claude-codex-settings/scripts/notify.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Read JSON input from Claude Code hook +input=$(cat) + +# Extract message from JSON (basic parsing) +message=$(echo "$input" | grep -o '"message":"[^"]*"' | cut -d'"' -f4) +title="Claude Code" + +# Terminal bell - triggers VSCode visual bell icon +printf '\a' + +# Send OS notification +if [[ "$OSTYPE" == "darwin"* ]]; then + osascript -e "display notification \"${message}\" with title \"${title}\" sound name \"Glass\"" +elif command -v notify-send &> /dev/null; then + notify-send "${title}" "${message}" -u normal -i terminal +fi diff --git a/hooks/claude-codex-settings/scripts/prettier_formatting.py b/hooks/claude-codex-settings/scripts/prettier_formatting.py new file mode 100755 index 0000000..a4a050c --- /dev/null +++ b/hooks/claude-codex-settings/scripts/prettier_formatting.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +""" +PostToolUse hook: Auto-format JS/TS/CSS/JSON/YAML/HTML/Vue/Svelte files with prettier +""" +import json +import re +import shutil +import subprocess +import sys +from pathlib import Path + +# File extensions that prettier handles +PRETTIER_EXTENSIONS = {'.js', '.jsx', '.ts', '.tsx', '.css', '.less', '.scss', + '.json', '.yml', '.yaml', '.html', '.vue', '.svelte'} +LOCK_FILE_PATTERN = re.compile(r'.*lock\.(json|yaml|yml)$|.*\.lock$') + + +def check_prettier_version() -> bool: + """Check if prettier is installed and warn if version differs from 3.6.2.""" + if not shutil.which('npx'): + return False + try: + result = subprocess.run(['npx', 'prettier', '--version'], + capture_output=True, text=True, check=False, timeout=5) + if result.returncode == 0: + version = result.stdout.strip() + if '3.6.2' not in version: + print(f"⚠️ Prettier version mismatch: expected 3.6.2, found {version}") + return True + except Exception: + pass + return False + + +def main(): + try: + data = json.load(sys.stdin) + file_path = data.get("tool_input", {}).get("file_path", "") + + if not file_path: + sys.exit(0) + + py_file = Path(file_path) + if not py_file.exists() or py_file.suffix not in PRETTIER_EXTENSIONS: + sys.exit(0) + + # Skip virtual env, cache, .claude directories, lock files, model.json, and minified assets + if any(p in py_file.parts for p in ['.git', '.venv', 'venv', 'env', '.env', '__pycache__', '.mypy_cache', '.pytest_cache', '.tox', '.nox', '.eggs', 'eggs', '.idea', '.vscode', 'node_modules', 'site-packages', 'build', 'dist', '.claude']) or LOCK_FILE_PATTERN.match(py_file.name) or py_file.name == 'model.json' or py_file.name.endswith(('.min.js', '.min.css')): + sys.exit(0) + + # Check if prettier is available + if not check_prettier_version(): + sys.exit(0) + + # Run prettier + subprocess.run([ + 'npx', 'prettier', '--write', '--list-different', '--print-width', '120', str(py_file) + ], capture_output=True, check=False, cwd=py_file.parent) + + except Exception: + pass + + sys.exit(0) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/hooks/claude-codex-settings/scripts/python_code_quality.py b/hooks/claude-codex-settings/scripts/python_code_quality.py new file mode 100755 index 0000000..f3c9806 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/python_code_quality.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""PostToolUse hook: Auto-format Python files with ruff, provide feedback on errors.""" + +import json +import shutil +import subprocess +import sys +from pathlib import Path + +EXCLUDED_DIRS = {'.git', '.venv', 'venv', 'env', '.env', '__pycache__', '.mypy_cache', '.pytest_cache', + '.tox', '.nox', '.eggs', 'eggs', '.idea', '.vscode', 'node_modules', 'site-packages', + 'build', 'dist', '.claude'} + + +def main(): + try: + data = json.load(sys.stdin) + except Exception: + sys.exit(0) + + file_path = data.get("tool_input", {}).get("file_path", "") + if not file_path.endswith('.py'): + sys.exit(0) + + py_file = Path(file_path) + if not py_file.exists() or any(p in py_file.parts for p in EXCLUDED_DIRS): + sys.exit(0) + + if not shutil.which('ruff'): + sys.exit(0) + + work_dir = py_file.parent + issues = [] + + # Run ruff check with fixes + check_result = subprocess.run([ + 'ruff', 'check', '--fix', + '--extend-select', 'F,I,D,UP,RUF,FA', + '--target-version', 'py39', + '--ignore', 'D100,D104,D203,D205,D212,D213,D401,D406,D407,D413,RUF001,RUF002,RUF012', + str(py_file) + ], capture_output=True, text=True, cwd=work_dir) + + if check_result.returncode != 0: + error_output = check_result.stdout.strip() or check_result.stderr.strip() + issues.append(f'Ruff check found unfixable errors in {py_file.name}:\n{error_output}') + + # Run ruff format regardless of check result + format_result = subprocess.run([ + 'ruff', 'format', '--line-length', '120', str(py_file) + ], capture_output=True, text=True, cwd=work_dir) + + if format_result.returncode != 0: + error_output = format_result.stderr.strip() + issues.append(f'Ruff format failed for {py_file.name}:\n{error_output}') + + # Output single JSON with all collected feedback + if issues: + output = {"hookSpecificOutput": {"hookEventName": "PostToolUse", + "additionalContext": "\n\n".join(issues)}} + print(json.dumps(output)) + + sys.exit(0) + + +if __name__ == '__main__': + main() diff --git a/hooks/claude-codex-settings/scripts/sync_marketplace_to_plugins.py b/hooks/claude-codex-settings/scripts/sync_marketplace_to_plugins.py new file mode 100755 index 0000000..4f3230a --- /dev/null +++ b/hooks/claude-codex-settings/scripts/sync_marketplace_to_plugins.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Sync marketplace.json plugin entries to individual plugin.json files.""" + +import json +import sys +from pathlib import Path + + +def get_edited_file_path(): + """Extract file path from hook input.""" + try: + input_data = json.load(sys.stdin) + return input_data.get("tool_input", {}).get("file_path", "") + except (json.JSONDecodeError, KeyError): + return "" + + +def sync_marketplace_to_plugins(): + """Sync marketplace.json entries to individual plugin.json files.""" + edited_path = get_edited_file_path() + + # Only trigger for marketplace.json edits + if not edited_path.endswith("marketplace.json"): + return 0 + + marketplace_path = Path(edited_path) + if not marketplace_path.exists(): + return 0 + + try: + marketplace = json.loads(marketplace_path.read_text()) + except (json.JSONDecodeError, OSError) as e: + print(f"❌ Failed to read marketplace.json: {e}", file=sys.stderr) + return 2 + + plugins = marketplace.get("plugins", []) + if not plugins: + return 0 + + marketplace_dir = marketplace_path.parent.parent # Go up from .claude-plugin/ + synced = [] + + for plugin in plugins: + source = plugin.get("source") + if not source: + continue + + # Resolve plugin directory relative to marketplace root + plugin_dir = (marketplace_dir / source).resolve() + plugin_json_dir = plugin_dir / ".claude-plugin" + plugin_json_path = plugin_json_dir / "plugin.json" + + # Build plugin.json content from marketplace entry + plugin_data = {"name": plugin.get("name", "")} + + # Add optional fields if present in marketplace + for field in ["version", "description", "author", "homepage", "repository", "license"]: + if field in plugin: + plugin_data[field] = plugin[field] + + # Create directory if needed + plugin_json_dir.mkdir(parents=True, exist_ok=True) + + # Check if update needed + current_data = {} + if plugin_json_path.exists(): + try: + current_data = json.loads(plugin_json_path.read_text()) + except json.JSONDecodeError: + pass + + if current_data != plugin_data: + plugin_json_path.write_text(json.dumps(plugin_data, indent=2) + "\n") + synced.append(plugin.get("name", source)) + + if synced: + print(f"✓ Synced {len(synced)} plugin manifest(s): {', '.join(synced)}") + + return 0 + + +if __name__ == "__main__": + sys.exit(sync_marketplace_to_plugins()) diff --git a/hooks/claude-codex-settings/scripts/tavily_extract_to_advanced.py b/hooks/claude-codex-settings/scripts/tavily_extract_to_advanced.py new file mode 100755 index 0000000..a4b7ff0 --- /dev/null +++ b/hooks/claude-codex-settings/scripts/tavily_extract_to_advanced.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +"""Intercept mcp__tavily__tavily-extract to upgrade extract_depth and suggest gh CLI for GitHub URLs.""" + +import json +import sys + +try: + data = json.load(sys.stdin) + tool_input = data["tool_input"] + urls = tool_input.get("urls", []) + + # Always ensure extract_depth="advanced" + tool_input["extract_depth"] = "advanced" + + # Check for GitHub URLs and add soft suggestion + github_domains = ("github.com", "raw.githubusercontent.com", "gist.github.com") + github_urls = [url for url in urls if any(domain in url for domain in github_domains)] + + if github_urls: + # Allow but suggest GitHub MCP/gh CLI for next time + print( + json.dumps( + { + "systemMessage": "Tip: For GitHub URLs, use gh CLI: `gh api repos/{owner}/{repo}/contents/{path} --jq '.content' | base64 -d` for files, `gh pr view` for PRs, `gh issue view` for issues.", + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "allow", + "updatedInput": tool_input, + }, + }, + separators=(",", ":"), + ) + ) + sys.exit(0) + + # Allow the call to proceed + print( + json.dumps( + { + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "allow", + "updatedInput": tool_input, + } + }, + separators=(",", ":"), + ) + ) + sys.exit(0) + +except (KeyError, json.JSONDecodeError) as err: + print(f"hook-error: {err}", file=sys.stderr) + sys.exit(1) diff --git a/hooks/claude-codex-settings/scripts/webfetch_to_tavily_extract.py b/hooks/claude-codex-settings/scripts/webfetch_to_tavily_extract.py new file mode 100755 index 0000000..559ad3d --- /dev/null +++ b/hooks/claude-codex-settings/scripts/webfetch_to_tavily_extract.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +""" +PreToolUse hook: intercept WebFetch → suggest using tavily-extract instead +""" +import json +import sys + +try: + data = json.load(sys.stdin) + url = data["tool_input"]["url"] +except (KeyError, json.JSONDecodeError) as err: + print(f"hook-error: {err}", file=sys.stderr) + sys.exit(1) + +print(json.dumps({ + "systemMessage": "WebFetch detected. AI is directed to use Tavily extract instead.", + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "deny", + "permissionDecisionReason": f"Please use mcp__tavily__tavily-extract with urls: ['{url}'] and extract_depth: 'advanced'" + } +}, separators=(',', ':'))) +sys.exit(0) diff --git a/hooks/claude-codex-settings/scripts/websearch_to_tavily_search.py b/hooks/claude-codex-settings/scripts/websearch_to_tavily_search.py new file mode 100755 index 0000000..6c6ec0f --- /dev/null +++ b/hooks/claude-codex-settings/scripts/websearch_to_tavily_search.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +""" +PreToolUse hook: intercept WebSearch → suggest using Tavily search instead +""" +import json +import sys + +try: + data = json.load(sys.stdin) + tool_input = data["tool_input"] + query = tool_input["query"] +except (KeyError, json.JSONDecodeError) as err: + print(f"hook-error: {err}", file=sys.stderr) + sys.exit(1) + +print(json.dumps({ + "systemMessage": "WebSearch detected. AI is directed to use Tavily search instead.", + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "deny", + "permissionDecisionReason": f"Please use mcp__tavily__tavily_search with query: '{query}'" + } +}, separators=(',', ':'))) +sys.exit(0) \ No newline at end of file diff --git a/mcp-configs/claude-codex-settings/settings.json b/mcp-configs/claude-codex-settings/settings.json new file mode 100644 index 0000000..973da9d --- /dev/null +++ b/mcp-configs/claude-codex-settings/settings.json @@ -0,0 +1,119 @@ +{ + "$schema": "https://json.schemastore.org/claude-code-settings.json", + "env": { + "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1", + "CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1", + "DISABLE_BUG_COMMAND": "1", + "DISABLE_ERROR_REPORTING": "1", + "DISABLE_TELEMETRY": "1", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-4-6", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-4-5-20250929", + "CLAUDE_CODE_SUBAGENT_MODEL": "claude-opus-4-6", + "MAX_MCP_OUTPUT_TOKENS": "40000" + }, + "attribution": { + "commit": "", + "pr": "" + }, + "permissions": { + "allow": [ + "Bash(find:*)", + "Bash(rg:*)", + "Bash(echo:*)", + "Bash(grep:*)", + "Bash(ls:*)", + "Bash(cat:*)", + "Bash(sed:*)", + "Bash(tree:*)", + "Bash(tail:*)", + "Bash(pgrep:*)", + "Bash(ps:*)", + "Bash(sort:*)", + "Bash(dmesg:*)", + "Bash(done)", + "Bash(ruff:*)", + "Bash(nvidia-smi:*)", + "Bash(pdflatex:*)", + "Bash(biber:*)", + "Bash(tmux ls:*)", + "Bash(tmux capture-pane:*)", + "Bash(tmux list-sessions:*)", + "Bash(tmux list-windows:*)", + "Bash(gh pr list:*)", + "Bash(gh pr view:*)", + "Bash(gh pr diff:*)", + "Bash(gh api user:*)", + "Bash(gh repo view:*)", + "Bash(gh issue view:*)", + "Bash(git branch --show-current:*)", + "Bash(git diff:*)", + "Bash(git status:*)", + "Bash(git rev-parse:*)", + "Bash(git push:*)", + "Bash(git log:*)", + "Bash(git -C :* branch --show-current:*)", + "Bash(git -C :* diff:*)", + "Bash(git -C :* status:*)", + "Bash(git -C :* rev-parse:*)", + "Bash(git -C :* push:*)", + "Bash(git -C :* log:*)", + "Bash(git fetch --prune:*)", + "Bash(git worktree list:*)", + "Bash(uv run ruff:*)", + "Bash(python --version:*)", + "WebSearch", + "WebFetch(domain:docs.litellm.ai)", + "WebFetch(domain:openai.com)", + "WebFetch(domain:anthropic.com)", + "WebFetch(domain:docs.anthropic.com)", + "WebFetch(domain:github.com)", + "WebFetch(domain:gradio.app)", + "WebFetch(domain:arxiv.org)", + "WebFetch(domain:pypi.org)", + "WebFetch(domain:docs.ultralytics.com)", + "WebFetch(domain:sli.dev)", + "WebFetch(domain:docs.vllm.ai)", + "mcp__tavily__tavily_extract", + "mcp__tavily__tavily_search", + "mcp__context7__resolve-library-id", + "mcp__context7__get-library-docs", + "mcp__github__get_me", + "mcp__github__pull_request_read", + "mcp__github__get_file_contents", + "mcp__github__get_workflow_run", + "mcp__github__get_job_logs", + "mcp__github__get_pull_request_comments", + "mcp__github__get_pull_request_reviews", + "mcp__github__issue_read", + "mcp__github__list_pull_requests", + "mcp__github__list_commits", + "mcp__github__list_workflows", + "mcp__github__list_workflow_runs", + "mcp__github__list_workflow_jobs", + "mcp__github__search_pull_requests", + "mcp__github__search_issues", + "mcp__github__search_code", + "mcp__mongodb__list_databases", + "mcp__mongodb__list_collections", + "mcp__mongodb__get_collection_schema", + "mcp__mongodb__collection-indexes", + "mcp__mongodb__db-stats", + "mcp__mongodb__count", + "mcp__supabase__list_tables", + "mcp__gcloud-observability__list_log_entries" + ] + }, + "outputStyle": "Explanatory", + "model": "opus", + "extraKnownMarketplaces": { + "claude-settings": { + "source": { + "source": "github", + "repo": "fcakyon/claude-codex-settings" + } + } + }, + "spinnerTipsEnabled": false, + "alwaysThinkingEnabled": true +} diff --git a/registries/awesome-openclaw-skills-registry.md b/registries/awesome-openclaw-skills-registry.md new file mode 100644 index 0000000..c134091 --- /dev/null +++ b/registries/awesome-openclaw-skills-registry.md @@ -0,0 +1,3319 @@ +
+ + +social + + +
+
+ +
+ Discover 3002 community-built OpenClaw skills, organized by category. + +
+
+
+ +[![Awesome](https://awesome.re/badge.svg)](https://awesome.re) + + VoltAgent + + +[![AI Agent Papers](https://img.shields.io/badge/AI%20Agent-Research%20Papers-b31b1b)](https://github.com/VoltAgent/awesome-ai-agent-papers) +![Skills Count](https://img.shields.io/badge/skills-3002-blue?style=flat-square) +![Last Update](https://img.shields.io/github/last-commit/VoltAgent/awesome-clawdbot-skills?label=Last%20update&style=flat-square) +[![Discord](https://img.shields.io/discord/1361559153780195478.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://s.voltagent.dev/discord) +[![GitHub forks](https://img.shields.io/github/forks/VoltAgent/awesome-clawdbot-skills?style=social)](https://github.com/VoltAgent/awesome-claude-skills/network/members) +
+ +# Awesome OpenClaw Skills + +OpenClaw (previously known as Moltbot, originally Clawdbot... identity crisis included, no extra charge) is a locally-running AI assistant that operates directly on your machine. Skills extend its capabilities, allowing it to interact with external services, automate workflows, and perform specialized tasks. This collection helps you discover and install the right skills for your needs. + +Skills in this list are sourced from [ClawHub](https://www.clawhub.ai/) (OpenClaw's public skills registry) and categorized for easier discovery. + +These skills follow the Agent Skill convention develop by Anthropic, an open standard for AI coding assistants. + +> **Want to add a skill?** This list only includes skills that are **already published** in the "github.com/openclaw/skills". We do not accept links to personal repos, gists, or any other external source. If your skill isn't in the OpenClaw skills repo yet, publish it there first. See [CONTRIBUTING.md](CONTRIBUTING.md) for details. + +## Installation + +### ClawHub CLI + +> **Note:** As you probably know, they keep renaming things. This reflects the current official docs. We'll update this when they rename it again. + +```bash +npx clawhub@latest install +``` + +### Manual Installation + +Copy the skill folder to one of these locations: + +| Location | Path | +|----------|------| +| Global | `~/.openclaw/skills/` | +| Workspace | `/skills/` | + +Priority: Workspace > Local > Bundled + +### Alternative + +You can also paste the skill's GitHub repository link directly into your assistant's chat and ask it to use it. The assistant will handle the setup automatically in the background. + + +## Why This List Exists? + +OpenClaw's public registry (ClawHub) hosts **5,705 community-built skills** as of February 7, 2026. This awesome list has **3,002 skills**. Here's what we filtered out: + +| Filter | Excluded | +|--------|----------| +| Possibly spam — bulk accounts, bot accounts, test/junk | 1,180 | +| Crypto / Blockchain / Finance / Trade | 672 | +| Duplicate / Similar name | 492 | +| Malicious — identified by security audits published by researchers (excluding VirusTotal) | 396 | +| Non-English — descriptions not in English | 8 | +| **Total not taken from OpenClaw's official skill registry** | **2,748** | + +> **Disclaimer:** Inclusion in this list does **not** guarantee a skill is safe or trustworthy. OpenClaw now has a VirusTotal partnership that provides security scanning for skills. Before installing a skill, visit its page on ClawHub and check the VirusTotal report to see if it's flagged as risky. We also recommend reviewing a skill's source code before installing and using tools like Claude Code or Codex to inspect it for potentially harmful behavior. + +If you think a skill was incorrectly excluded or miscategorized, feel free to open an issue or PR. We may have made mistakes. + +
+ + +social + + +
+ +## Table of Contents + +| | | | +|---|---|---| +| [Coding Agents & IDEs](#coding-agents--ides) (133) | [Marketing & Sales](#marketing--sales) (143) | [Communication](#communication) (132) | +| [Git & GitHub](#git--github) (66) | [Productivity & Tasks](#productivity--tasks) (135) | [Speech & Transcription](#speech--transcription) (65) | +| [Moltbook](#moltbook) (51) | [AI & LLMs](#ai--llms) (287) | [Smart Home & IoT](#smart-home--iot) (56) | +| [Web & Frontend Development](#web--frontend-development) (202) | [Data & Analytics](#data--analytics) (46) | [Shopping & E-commerce](#shopping--e-commerce) (51) | +| [DevOps & Cloud](#devops--cloud) (212) | [Finance](#finance) (22) | [Calendar & Scheduling](#calendar--scheduling) (50) | +| [Browser & Automation](#browser--automation) (139) | [Media & Streaming](#media--streaming) (80) | [PDF & Documents](#pdf--documents) (67) | +| [Image & Video Generation](#image--video-generation) (60) | [Notes & PKM](#notes--pkm) (100) | [Self-Hosted & Automation](#self-hosted--automation) (25) | +| [Apple Apps & Services](#apple-apps--services) (35) | [iOS & macOS Development](#ios--macos-development) (17) | [Security & Passwords](#security--passwords) (63) | +| [Search & Research](#search--research) (253) | [Transportation](#transportation) (73) | [Gaming](#gaming) (61) | +| [Clawdbot Tools](#clawdbot-tools) (120) | [Personal Development](#personal-development) (56) | [Agent-to-Agent Protocols](#agent-to-agent-protocols) (18) | +| [CLI Utilities](#cli-utilities) (129) | [Health & Fitness](#health--fitness) (55) | | + + + +
+

Coding Agents & IDEs

+ +- [achurch](https://github.com/openclaw/skills/tree/main/skills/lucasgeeksinthewood/achurch/SKILL.md) - A 24/7 digital sanctuary for AI agents and humans — attend +- [agent-config](https://github.com/openclaw/skills/tree/main/skills/thatguysizemore/agent-config/SKILL.md) - Intelligently modify agent core context files +- [agent-council](https://github.com/openclaw/skills/tree/main/skills/itsahedge/agent-council/SKILL.md) - Complete toolkit for creating autonomous AI agents and managing +- [agent-identity-kit](https://github.com/openclaw/skills/tree/main/skills/ryancampbell/agent-identity-kit/SKILL.md) - A portable identity system for AI agents. +- [agenticflow-skill](https://github.com/openclaw/skills/tree/main/skills/seanphan/agenticflow-skill/SKILL.md) - Comprehensive guide for building AI workflows, agents +- [agentlens](https://github.com/openclaw/skills/tree/main/skills/nguyenphutrong/agentlens/SKILL.md) - Navigate and understand codebases using agentlens hierarchical +- [agentskills-io](https://github.com/openclaw/skills/tree/main/skills/killerapp/agentskills-io/SKILL.md) - Create, validate, and publish Agent Skills following +- [aisa-twitter-api](https://github.com/openclaw/skills/tree/main/skills/aisapay/aisa-twitter-api/SKILL.md) - Search X (Twitter) in real time, extract relevant posts +- [apple-hig](https://github.com/openclaw/skills/tree/main/skills/kdbhalala/apple-hig/SKILL.md) - Expert guide for designing iOS, macOS, watchOS, tvOS, and visionOS apps. +- [arbiter](https://github.com/openclaw/skills/tree/main/skills/5hanth/arbiter/SKILL.md) - Push decisions to Arbiter Zebu for async human review. +- [aster](https://github.com/openclaw/skills/tree/main/skills/satyajiit/aster/SKILL.md) - Your AI CoPilot on Mobile — or give your AI its own phone. +- [avatar-video-messages](https://github.com/openclaw/skills/tree/main/skills/thewulf7/avatar-video-messages/SKILL.md) - Generate and send video messages +- [backend-patterns](https://github.com/openclaw/skills/tree/main/skills/charmmm718/backend-patterns/SKILL.md) - Backend architecture patterns, API design, database +- [bidclub](https://github.com/openclaw/skills/tree/main/skills/jasonfdg/bidclub/SKILL.md) - Post investment ideas to the AI-native investment community. +- [bidclub-ai](https://github.com/openclaw/skills/tree/main/skills/jasonfdg/bidclub-ai/SKILL.md) - Post investment ideas to the AI-native investment community. +- [bot-bowl-party](https://github.com/openclaw/skills/tree/main/skills/fsa317/bot-bowl-party/SKILL.md) - Complete guide for AI agents to participate in BotBowl Party +- [botpress-adk](https://github.com/openclaw/skills/tree/main/skills/yueranlu/botpress-adk/SKILL.md) - A guide to build AI bots with Botpress's Agent Development Kit +- [browse](https://github.com/openclaw/skills/tree/main/skills/pkiv/browse/SKILL.md) - Complete guide for creating and deploying browser automation functions +- [budget-variance-analyzer](https://github.com/openclaw/skills/tree/main/skills/datadrivenconstruction/budget-variance-analyzer/SKILL.md) - Analyze budget vs actual +- [buildlog](https://github.com/openclaw/skills/tree/main/skills/espetey/buildlog/SKILL.md) - Record, export, and share your AI coding sessions as replayable buildlogs. +- [catholic-grounding](https://github.com/openclaw/skills/tree/main/skills/trevortomesh/catholic-grounding/SKILL.md) - Help answer questions about Catholicism accurately +- [cc-godmode](https://github.com/openclaw/skills/tree/main/skills/cubetribe/cc-godmode/SKILL.md) - Self-orchestrating multi-agent development workflows. +- [cellcog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/cellcog/SKILL.md) - #1 on DeepResearch Bench (Feb 2026). +- [claude-optimised](https://github.com/openclaw/skills/tree/main/skills/hexnickk/claude-optimised/SKILL.md) - Guide for writing and optimizing CLAUDE.md files +- [claude-team](https://github.com/openclaw/skills/tree/main/skills/jalehman/claude-team/SKILL.md) - Orchestrate multiple Claude Code workers via iTerm2 +- [clawder](https://github.com/openclaw/skills/tree/main/skills/assassin808/clawder/SKILL.md) - Use Clawder to sync identity, browse post cards, swipe with a comment +- [code-mentor](https://github.com/openclaw/skills/tree/main/skills/samuelkahessay/code-mentor/SKILL.md) - Comprehensive AI programming tutor for all levels. +- [codebuddy-code](https://github.com/openclaw/skills/tree/main/skills/pmwalkercao/codebuddy-code/SKILL.md) - CodeBuddy Code CLI installation, configuration and usage +- [codeconductor](https://github.com/openclaw/skills/tree/main/skills/larsonreever/codeconductor/SKILL.md) - AI-powered software development platform for rapid app +- [coder-workspaces](https://github.com/openclaw/skills/tree/main/skills/developmentcats/coder-workspaces/SKILL.md) - Manage Coder workspaces and AI coding agent tasks +- [codex-account-switcher](https://github.com/openclaw/skills/tree/main/skills/odrobnik/codex-account-switcher/SKILL.md) - Manage multiple OpenAI Codex accounts. +- [codex-monitor](https://github.com/openclaw/skills/tree/main/skills/odrobnik/codex-monitor/SKILL.md) - Browse OpenAI Codex session logs stored. +- [codex-orchestration](https://github.com/openclaw/skills/tree/main/skills/shanelindsay/codex-orchestration/SKILL.md) - General-purpose orchestration for Codex. +- [codex-quota](https://github.com/openclaw/skills/tree/main/skills/odrobnik/codex-quota/SKILL.md) - Check OpenAI Codex CLI rate limit status (daily/weekly quotas) +- [codexmonitor](https://github.com/openclaw/skills/tree/main/skills/odrobnik/codexmonitor/SKILL.md) - List/inspect/watch local OpenAI Codex sessions (CLI + VS Code) +- [coding-agent](https://github.com/openclaw/skills/tree/main/skills/steipete/coding-agent/SKILL.md) - Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent +- [coding-opencode](https://github.com/openclaw/skills/tree/main/skills/iqbalnaveliano/coding-opencode/SKILL.md) - Memungkinkan penggunaan agen pengkodean OpenCode yang +- [cognitive-memory](https://github.com/openclaw/skills/tree/main/skills/icemilo414/cognitive-memory/SKILL.md) - Intelligent multi-store memory system with human-like +- [content-id-guide](https://github.com/openclaw/skills/tree/main/skills/otherpowers/content-id-guide/SKILL.md) - A calm way for creators to understand and organize +- [copilot-money](https://github.com/openclaw/skills/tree/main/skills/jayhickey/copilot-money/SKILL.md) - Query Copilot Money personal finance data +- [create-agent-skills](https://github.com/openclaw/skills/tree/main/skills/bowen31337/create-agent-skills/SKILL.md) - Guide for creating effective skills. +- [cto-advisor](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/cto-advisor/SKILL.md) - Technical leadership guidance for engineering teams +- [cursor-agent](https://github.com/openclaw/skills/tree/main/skills/swiftlysingh/cursor-agent/SKILL.md) - A comprehensive skill for using the Cursor CLI agent +- [debug-pro](https://github.com/openclaw/skills/tree/main/skills/cmanfre7/debug-pro/SKILL.md) - Systematic debugging methodology and language-specific debugging +- [doc-coauthoring](https://github.com/openclaw/skills/tree/main/skills/seanphan/doc-coauthoring/SKILL.md) - Guide users through a structured workflow for co-authoring +- [docker-essentials](https://github.com/openclaw/skills/tree/main/skills/arnarsson/docker-essentials/SKILL.md) - Essential Docker commands and workflows for container +- [docker-sandbox](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/docker-sandbox/SKILL.md) - Create and manage Docker sandboxed VM environments +- [ec-excalidraw](https://github.com/openclaw/skills/tree/main/skills/henrino3/ec-excalidraw/SKILL.md) - Generate hand-drawn style diagrams, flowcharts, and architecture +- [ec-task-orchestrator](https://github.com/openclaw/skills/tree/main/skills/henrino3/ec-task-orchestrator/SKILL.md) - Autonomous multi-agent task orchestration +- [essence-distiller](https://github.com/openclaw/skills/tree/main/skills/leegitw/essence-distiller/SKILL.md) - Find what actually matters in your content — the ideas +- [evolver](https://github.com/openclaw/skills/tree/main/skills/autogame-17/evolver/SKILL.md) - A self-evolution engine for AI agents. +- [executing-plans](https://github.com/openclaw/skills/tree/main/skills/chenleiyanquan/executing-plans/SKILL.md) - Use when you have a written implementation plan +- [factory-ai](https://github.com/openclaw/skills/tree/main/skills/mitchellbernstein/factory-ai/SKILL.md) - Use Factory AI's droid CLI for software engineering tasks. +- [feishu-native-emoji](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-native-emoji/SKILL.md) - Provides access to Feishu's native emoji set +- [feishu-vc](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-vc/SKILL.md) - Manage Feishu Video Conferences (VC). +- [file-links-tool](https://github.com/openclaw/skills/tree/main/skills/mrbeandev/file-links-tool/SKILL.md) - Securely upload files from your private AI workspace +- [flirtingbots](https://github.com/openclaw/skills/tree/main/skills/chemzo/flirtingbots/SKILL.md) - Agents do the flirting, humans get the date — your OpenClaw agent +- [gembox-skill](https://github.com/openclaw/skills/tree/main/skills/zsvedic/gembox-skill/SKILL.md) - Coding assistance for [GemBox. +- [get-tldr](https://github.com/openclaw/skills/tree/main/skills/itobey/get-tldr/SKILL.md) - Provide the summary returned by the get-tldr.com summarize API +- [get-tldr](https://github.com/openclaw/skills/tree/main/skills/itobey/get-tldr/SKILL.md) - Provide the summary returned by the get-tldr.com summarize API +- [go2gg](https://github.com/openclaw/skills/tree/main/skills/rakesh1002/go2gg/SKILL.md) - Use Go2.gg API for URL shortening, link analytics, QR code generation,. +- [google-weather](https://github.com/openclaw/skills/tree/main/skills/shaharsha/google-weather/SKILL.md) - Google Weather API - accurate, real-time weather data. +- [hour-meter](https://github.com/openclaw/skills/tree/main/skills/rm289/hour-meter/SKILL.md) - Track elapsed time from a set epoch with tamper-evident locking. +- [idea-coach](https://github.com/openclaw/skills/tree/main/skills/udiedrichsen/idea-coach/SKILL.md) - AI-powered idea/problem/challenge manager with GitHub integration. +- [identity-manager](https://github.com/openclaw/skills/tree/main/skills/autogame-17/identity-manager/SKILL.md) - strictly manages user identity mappings +- [java-change-with-tests](https://github.com/openclaw/skills/tree/main/skills/tanerilyazov/java-change-with-tests/SKILL.md) - - Any Java change that must be merged +- [jo4](https://github.com/openclaw/skills/tree/main/skills/anandrathnas/jo4/SKILL.md) - URL shortener, QR code generator, and link analytics API. +- [joko-orchestrator](https://github.com/openclaw/skills/tree/main/skills/oyi77/joko-orchestrator/SKILL.md) - Deterministically coordinates autonomous planning +- [kimi-integration](https://github.com/openclaw/skills/tree/main/skills/evgyur/kimi-integration/SKILL.md) - Step-by-step guide for integrating Moonshot AI (Kimi) +- [linguistic-humidifier](https://github.com/openclaw/skills/tree/main/skills/westland/linguistic-humidifier/SKILL.md) - Proactively identifies conversational entropy +- [logseq](https://github.com/openclaw/skills/tree/main/skills/juanirm/logseq/SKILL.md) - Provide commands for interacting with a local Logseq instance +- [manim-composer](https://github.com/openclaw/skills/tree/main/skills/inclinedadarsh/manim-composer/SKILL.md) - 1. +- [manimce-best-practices](https://github.com/openclaw/skills/tree/main/skills/inclinedadarsh/manimce-best-practices/SKILL.md) - Read individual rule files for detailed +- [mcp-builder](https://github.com/openclaw/skills/tree/main/skills/seanphan/mcp-builder/SKILL.md) - Guide for creating high-quality MCP (Model Context Protocol) servers +- [mdr-745-specialist](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/mdr-745-specialist/SKILL.md) - EU MDR 2017/745 compliance specialist +- [meta-video-ad-deconstructor](https://github.com/openclaw/skills/tree/main/skills/fortytwode/meta-video-ad-deconstructor/SKILL.md) - Deconstruct video ad creatives +- [metals-agent-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/metals-agent-teneo/SKILL.md) - Provides real time prices for gold, silver +- [microsoft-docs](https://github.com/openclaw/skills/tree/main/skills/pdebruin/microsoft-docs/SKILL.md) - Query official Microsoft documentation to understand concepts +- [midea-ac](https://github.com/openclaw/skills/tree/main/skills/iamanorange/midea-ac/SKILL.md) - Control Midea ACs. +- [minimal-test-skill](https://github.com/openclaw/skills/tree/main/skills/mig6671/minimal-test-skill/SKILL.md) - Minimal test skill for debugging ClawHub publishing. +- [model-usage](https://github.com/openclaw/skills/tree/main/skills/steipete/model-usage/SKILL.md) - Use CodexBar CLI local cost usage to summarize per-model usage +- [multi-coding-agent](https://github.com/openclaw/skills/tree/main/skills/kesslerio/multi-coding-agent/SKILL.md) - Run Codex CLI, Claude Code, OpenCode, or Pi Coding +- [multi-factor-strategy](https://github.com/openclaw/skills/tree/main/skills/wumu2013/multi-factor-strategy/SKILL.md) - Guide users to create multi-factor stock +- [mux-video](https://github.com/openclaw/skills/tree/main/skills/dktrn9ne/mux-video/SKILL.md) - Mux Video infrastructure skill for designing, ingesting +- [noir-developer](https://github.com/openclaw/skills/tree/main/skills/jp4g/noir-developer/SKILL.md) - Develop Noir (.nr) codebases. +- [only-baby-skill](https://github.com/openclaw/skills/tree/main/skills/jacklandrin/only-baby-skill/SKILL.md) - Analyze contraction JSON and baby log JSON to assess +- [ooze-agents](https://github.com/openclaw/skills/tree/main/skills/jschwerberg/ooze-agents/SKILL.md) - Visual identity that evolves with reputation - create and nurture +- [opencode-acp-control](https://github.com/openclaw/skills/tree/main/skills/bjesuiter/opencode-acp-control/SKILL.md) - Control OpenCode directly via the Agent Client +- [openinsider](https://github.com/openclaw/skills/tree/main/skills/stuhorsman/openinsider/SKILL.md) - Fetch SEC Form 4 insider trading data (Directors, CEOs, Officers) +- [openspec](https://github.com/openclaw/skills/tree/main/skills/jcorrego/openspec/SKILL.md) - Spec-driven development with OpenSpec. +- [pasteclaw](https://github.com/openclaw/skills/tree/main/skills/tairov/pasteclaw/SKILL.md) - Use Pasteclaw.com API to create, update, group (session keys), and delete. +- [pbe-extractor](https://github.com/openclaw/skills/tree/main/skills/leegitw/pbe-extractor/SKILL.md) - Extract invariant principles from any text — find the ideas +- [perry-coding-agents](https://github.com/openclaw/skills/tree/main/skills/gricha/perry-coding-agents/SKILL.md) - Dispatch coding tasks to OpenCode or Claude Code +- [perry-workspaces](https://github.com/openclaw/skills/tree/main/skills/gricha/perry-workspaces/SKILL.md) - Create and manage isolated Docker workspaces on your tailnet +- [piv](https://github.com/openclaw/skills/tree/main/skills/smokealot420/piv/SKILL.md) - PIV workflow orchestrator - Plan, Implement, Validate loop for systematic. +- [pndr](https://github.com/openclaw/skills/tree/main/skills/dgershman/pndr/SKILL.md) - Personal productivity app with Ideas/Tasks, Journal, Habits, Package tracking,. +- [pro](https://github.com/openclaw/skills/tree/main/skills/jash2368-collab/pro/SKILL.md) - Guide for creating effective skills. +- [prompt-log](https://github.com/openclaw/skills/tree/main/skills/thesash/prompt-log/SKILL.md) - Extract conversation transcripts from AI coding session logs +- [pulse-editor](https://github.com/openclaw/skills/tree/main/skills/shellishack/pulse-editor/SKILL.md) - Generate and build Pulse Apps using the Vibe Dev Flow API. +- [python](https://github.com/openclaw/skills/tree/main/skills/adarshdigievo/python/SKILL.md) - Python coding guidelines and best practices. +- [quantum-lab](https://github.com/openclaw/skills/tree/main/skills/bramdo/quantum-lab/SKILL.md) - Run the /home/bram/work/quantum_lab Python scripts and demos inside +- [quantumlab](https://github.com/openclaw/skills/tree/main/skills/bramdo/quantumlab/SKILL.md) - Run the /home/bram/work/quantum_lab Python scripts and demos inside +- [quests](https://github.com/openclaw/skills/tree/main/skills/poloio/quests/SKILL.md) - Track and guide humans through complex multi-step real-world processes. +- [rationality](https://github.com/openclaw/skills/tree/main/skills/xertrov/rationality/SKILL.md) - The Rationality skill provides a structured framework for thinking,. +- [receiving-code-review](https://github.com/openclaw/skills/tree/main/skills/chenleiyanquan/receiving-code-review/SKILL.md) - Use when receiving code review feedback +- [regex-patterns](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/regex-patterns/SKILL.md) - Practical regex patterns across languages and use +- [release-bump](https://github.com/openclaw/skills/tree/main/skills/paulpete/release-bump/SKILL.md) - Use when bumping ralph-orchestrator version for a new release +- [sandboxer](https://github.com/openclaw/skills/tree/main/skills/chriopter/sandboxer/SKILL.md) - Manage Claude Code terminal sessions via Sandboxer web dashboard. +- [satellite-copilot](https://github.com/openclaw/skills/tree/main/skills/davestarling/satellite-copilot/SKILL.md) - Predict satellite passes +- [senior-architect](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-architect/SKILL.md) - This skill should be used when the user asks +- [side-peace](https://github.com/openclaw/skills/tree/main/skills/bitbrujo/side-peace/SKILL.md) - Minimal secure secret handoff. +- [skill-content-id-guide](https://github.com/openclaw/skills/tree/main/skills/otherpowers/skill-content-id-guide/SKILL.md) - Procedural clarity and evidence +- [skill-creator](https://github.com/openclaw/skills/tree/main/skills/chindden/skill-creator/SKILL.md) - Guide for creating effective skills. +- [skill-creator-0-1-0](https://github.com/openclaw/skills/tree/main/skills/ljglover/skill-creator-0-1-0/SKILL.md) - Guide for creating effective skills. +- [skill-creator-2](https://github.com/openclaw/skills/tree/main/skills/yixinli867/skill-creator-2/SKILL.md) - Guide for creating effective skills. +- [skill-vetting](https://github.com/openclaw/skills/tree/main/skills/eddygk/skill-vetting/SKILL.md) - Vet ClawHub skills for security and utility before installation. +- [smart-auto-updater](https://github.com/openclaw/skills/tree/main/skills/ruiwang20010702/smart-auto-updater/SKILL.md) - Smart auto-updater with AI-powered impact +- [solvr-kb](https://github.com/openclaw/skills/tree/main/skills/fcavalcantirj/solvr-kb/SKILL.md) - Search and contribute to Solvr — a knowledge base for developers +- [soul-md](https://github.com/openclaw/skills/tree/main/skills/aaronjmars/soul-md/SKILL.md) - Embody this digital identity. +- [ssh-tunnel](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/ssh-tunnel/SKILL.md) - SSH tunneling, port forwarding, and remote access patterns. +- [stoic-scope-creep](https://github.com/openclaw/skills/tree/main/skills/crtahlin/stoic-scope-creep/SKILL.md) - A practical guide for maintaining composure +- [task-status](https://github.com/openclaw/skills/tree/main/skills/mightyprime1/task-status/SKILL.md) - Send short status descriptions in chat for long-running tasks. +- [tdd-guide](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/tdd-guide/SKILL.md) - Test-driven development workflow with test generation, coverage +- [test-new-skill](https://github.com/openclaw/skills/tree/main/skills/tianshizhimao-sudo/test-new-skill/SKILL.md) - Test skill for debugging +- [test-runner](https://github.com/openclaw/skills/tree/main/skills/cmanfre7/test-runner/SKILL.md) - Write and run tests across languages and frameworks. +- [toughcoding](https://github.com/openclaw/skills/tree/main/skills/toughcoding/toughcoding/SKILL.md) - Provides AI agents with authoritative knowledge on modern +- [vhs-recorder](https://github.com/openclaw/skills/tree/main/skills/killerapp/vhs-recorder/SKILL.md) - Create professional terminal recordings with VHS tape files +- [vibes](https://github.com/openclaw/skills/tree/main/skills/binora/vibes/SKILL.md) - Social presence layer for AI coding agents. +- [video-agent](https://github.com/openclaw/skills/tree/main/skills/michaelwang11394/video-agent/SKILL.md) - Generate AI avatar videos with HeyGen's Video Agent API. +- [video-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/video-cog/SKILL.md) - Long-form AI video production: the frontier of multi-agent +- [voice-reply](https://github.com/openclaw/skills/tree/main/skills/stolot0mt0m/voice-reply/SKILL.md) - Local text-to-speech using Piper voices via sherpa-onnx. +- [whatsapp-styling-guide](https://github.com/openclaw/skills/tree/main/skills/rubenfb23/whatsapp-styling-guide/SKILL.md) - Skill to ensure all messages sent to WhatsApp +- [wyld-stallyns](https://github.com/openclaw/skills/tree/main/skills/brucko/wyld-stallyns/SKILL.md) - Summon legends into the booth. + +
+ +
+

Git & GitHub

+ +- [agent-commons](https://github.com/openclaw/skills/tree/main/skills/zanblayde/agent-commons/SKILL.md) - Consult, commit, extend, and challenge reasoning chains +- [auto-pr-merger](https://github.com/openclaw/skills/tree/main/skills/autogame-17/auto-pr-merger/SKILL.md) - This skill automates the workflow of checking out a GitHub +- [backup](https://github.com/openclaw/skills/tree/main/skills/jordanprater/backup/SKILL.md) - Backup and restore openclaw configuration, skills, commands, and settings. +- [bat-cat](https://github.com/openclaw/skills/tree/main/skills/arnarsson/bat-cat/SKILL.md) - A cat clone with syntax highlighting, line numbers, and Git integration +- [bitbucket-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/bitbucket-automation/SKILL.md) - Automate Bitbucket repositories, pull +- [claw-swarm](https://github.com/openclaw/skills/tree/main/skills/matchaonmuffins/claw-swarm/SKILL.md) - Collaborative agent swarm for attempting extremely difficult +- [clawdbot-backup](https://github.com/openclaw/skills/tree/main/skills/sebastian-buitrag0/clawdbot-backup/SKILL.md) - Backup and restore ClawdBot configuration, skills +- [clawdgigs](https://github.com/openclaw/skills/tree/main/skills/benniethedev/clawdgigs/SKILL.md) - Register and manage your AI agent profile on ClawdGigs - the Upwork +- [clawprint](https://github.com/openclaw/skills/tree/main/skills/yugovit/clawprint/SKILL.md) - Agent discovery, trust, and exchange. +- [clawver-onboarding](https://github.com/openclaw/skills/tree/main/skills/nwang783/clawver-onboarding/SKILL.md) - Set up a new Clawver store. +- [commit-analyzer](https://github.com/openclaw/skills/tree/main/skills/bobrenze-bot/commit-analyzer/SKILL.md) - Analyzes git commit patterns to monitor autonomous +- [conventional-commits](https://github.com/openclaw/skills/tree/main/skills/bastos/conventional-commits/SKILL.md) - Format commit messages using the Conventional +- [danube](https://github.com/openclaw/skills/tree/main/skills/preston-thiele/danube/SKILL.md) - Use Danube's 100+ API tools (Gmail, GitHub, Notion, etc.) through MCP. +- [danube-tools](https://github.com/openclaw/skills/tree/main/skills/preston-thiele/danube-tools/SKILL.md) - Use Danube's 100+ API tools (Gmail, GitHub, Notion, etc.) +- [deepwiki](https://github.com/openclaw/skills/tree/main/skills/arun-8687/deepwiki/SKILL.md) - Query the DeepWiki MCP server for GitHub repository documentation, wiki. +- [deepwork-tracker](https://github.com/openclaw/skills/tree/main/skills/adunne09/deepwork-tracker/SKILL.md) - Track deep work sessions locally (start/stop/status) +- [deploy-agent](https://github.com/openclaw/skills/tree/main/skills/sherajdev/deploy-agent/SKILL.md) - Multi-step deployment agent for full-stack. +- [emergency-rescue](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/emergency-rescue/SKILL.md) - Recover from developer disasters. +- [exa-web-search-free](https://github.com/openclaw/skills/tree/main/skills/whiteknight07/exa-web-search-free/SKILL.md) - Free AI search via Exa. +- [fabric-pattern](https://github.com/openclaw/skills/tree/main/skills/apuryear/fabric-pattern/SKILL.md) - Integration for the Fabric AI framework. +- [financial-calculator](https://github.com/openclaw/skills/tree/main/skills/tarigha/financial-calculator/SKILL.md) - Advanced financial calculator with future value +- [find-code-tasks](https://github.com/openclaw/skills/tree/main/skills/paulpete/find-code-tasks/SKILL.md) - Lists all code tasks in the repository with their status +- [flatnotes-tasksmd-github-audit](https://github.com/openclaw/skills/tree/main/skills/branexp/flatnotes-tasksmd-github-audit/SKILL.md) - Thoroughly audit Tasks.md + +- [forkzoo](https://github.com/openclaw/skills/tree/main/skills/levi-law/forkzoo/SKILL.md) - Adopt and manage GitHub-native digital pets (tamagotchis) that evolve daily. +- [forkzoo-skill](https://github.com/openclaw/skills/tree/main/skills/levi-law/forkzoo-skill/SKILL.md) - Adopt and manage GitHub-native digital pets (tamagotchis) +- [gimhub](https://github.com/openclaw/skills/tree/main/skills/daxiongmao87/gimhub/SKILL.md) - Push code to GIMHub, the Git hosting platform for AI agents. +- [git-crypt-backup](https://github.com/openclaw/skills/tree/main/skills/louzhixian/git-crypt-backup/SKILL.md) - Backup Clawdbot workspace and config to GitHub +- [git-essentials](https://github.com/openclaw/skills/tree/main/skills/arnarsson/git-essentials/SKILL.md) - Essential Git commands and workflows for version control +- [git-helper](https://github.com/openclaw/skills/tree/main/skills/xejrax/git-helper/SKILL.md) - Common git operations as a skill (status, pull, push, branch, log). +- [git-summary](https://github.com/openclaw/skills/tree/main/skills/zweack/git-summary/SKILL.md) - Get a quick summary of the current Git repository including status +- [git-sync](https://github.com/openclaw/skills/tree/main/skills/autogame-17/git-sync/SKILL.md) - Automatically syncs local workspace changes to the remote GitHub +- [git-workflows](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/git-workflows/SKILL.md) - Advanced git operations beyond add/commit/push. +- [gitclassic](https://github.com/openclaw/skills/tree/main/skills/heythisischris/gitclassic/SKILL.md) - Fast, no-JavaScript GitHub browser optimized for AI agents. +- [gitclaw](https://github.com/openclaw/skills/tree/main/skills/marian2js/gitclaw/SKILL.md) - Back up the OpenClaw agent workspace to a GitHub repo and keep it synced +- [gitea](https://github.com/openclaw/skills/tree/main/skills/ericxliu1990/gitea/SKILL.md) - Interact with Gitea using the `tea`. +- [gitflow](https://github.com/openclaw/skills/tree/main/skills/okoddcat/gitflow/SKILL.md) - Automatically monitor CI/CD pipeline status of new push across GitHub +- [github](https://github.com/openclaw/skills/tree/main/skills/steipete/github/SKILL.md) - Interact with GitHub using the `gh`. +- [github-pr](https://github.com/openclaw/skills/tree/main/skills/dbhurley/github-pr/SKILL.md) - Fetch, preview, merge, and test GitHub PRs locally. +- [githunt](https://github.com/openclaw/skills/tree/main/skills/mordka/githunt/SKILL.md) - Find and rank GitHub developers by location, technology, and role. +- [gitlab-api](https://github.com/openclaw/skills/tree/main/skills/d1gl3/gitlab-api/SKILL.md) - GitLab API integration for repository operations. +- [gitlab-ci-skills](https://github.com/openclaw/skills/tree/main/skills/vince-winkintel/gitlab-ci-skills/SKILL.md) - Use when working with GitLab CLI (glab) commands +- [gitlab-cli-skills](https://github.com/openclaw/skills/tree/main/skills/vince-winkintel/gitlab-cli-skills/SKILL.md) - Use when working with GitLab CLI (glab) commands +- [gitlab-manager](https://github.com/openclaw/skills/tree/main/skills/jorgermp/gitlab-manager/SKILL.md) - Manage GitLab repositories, merge requests, and issues via API. +- [gitload](https://github.com/openclaw/skills/tree/main/skills/waldekmastykarz/gitload/SKILL.md) - Download files, folders, or entire repos from GitHub URLs +- [glab-cli](https://github.com/openclaw/skills/tree/main/skills/portavion/glab-cli/SKILL.md) - Interact with GitLab using the `glab`. +- [god-mode](https://github.com/openclaw/skills/tree/main/skills/infantlab/god-mode/SKILL.md) - Developer oversight and AI agent coaching. +- [instagram-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/instagram-teneo/SKILL.md) - The agent gives you the ability to extract data +- [moltbillboard](https://github.com/openclaw/skills/tree/main/skills/tech8in/moltbillboard/SKILL.md) - MoltBillboard is a 1,000×1,000 pixel billboard built for AI +- [negotiation](https://github.com/openclaw/skills/tree/main/skills/mjaskolski/negotiation/SKILL.md) - Tactical negotiation framework based on Chris Voss's "Never Split +- [openclaw-migration](https://github.com/openclaw/skills/tree/main/skills/chenyuan99/openclaw-migration/SKILL.md) - When the workspace is in the middle of renaming +- [pr-commit-workflow](https://github.com/openclaw/skills/tree/main/skills/joshp123/pr-commit-workflow/SKILL.md) - This skill should be used when creating commits +- [pr-reviewer](https://github.com/openclaw/skills/tree/main/skills/briancolinger/pr-reviewer/SKILL.md) - Automated GitHub PR code review with diff analysis, lint +- [project-context-sync](https://github.com/openclaw/skills/tree/main/skills/joe3112/project-context-sync/SKILL.md) - Keep a living project state document updated +- [ralph-evolver](https://github.com/openclaw/skills/tree/main/skills/hsssgdtc/ralph-evolver/SKILL.md) - Recursive self-improvement engine. +- [read-github](https://github.com/openclaw/skills/tree/main/skills/am-will/read-github/SKILL.md) - Access GitHub repository documentation and code via the gitmcp.io MCP +- [skill-publisher-claw-skill](https://github.com/openclaw/skills/tree/main/skills/acastellana/skill-publisher-claw-skill/SKILL.md) - Prepare Claw skills for public +- [skill-release-manager](https://github.com/openclaw/skills/tree/main/skills/autogame-17/skill-release-manager/SKILL.md) - Automates the release lifecycle of OpenClaw +- [skill-vetter](https://github.com/openclaw/skills/tree/main/skills/spclaudehome/skill-vetter/SKILL.md) - Security-first skill vetting for AI agents. +- [soulstamp](https://github.com/openclaw/skills/tree/main/skills/brucko/soulstamp/SKILL.md) - The stamp doesn't lie. +- [test-driven-development](https://github.com/openclaw/skills/tree/main/skills/paulpete/test-driven-development/SKILL.md) - Unified TDD skill with three input modes +- [trend-watcher](https://github.com/openclaw/skills/tree/main/skills/guogang1024/trend-watcher/SKILL.md) - Monitors GitHub Trending and tech communities for emerging +- [uid-life](https://github.com/openclaw/skills/tree/main/skills/koolninad/uid-life/SKILL.md) - Interact with the UID.LIFE agent-to-agent marketplace - register agents,. +- [unfuck-my-git-state](https://github.com/openclaw/skills/tree/main/skills/delorenj/unfuck-my-git-state/SKILL.md) - Diagnose and recover broken Git state and worktree +- [vrtlly-claw-club](https://github.com/openclaw/skills/tree/main/skills/epwhesq/vrtlly-claw-club/SKILL.md) - Join the Claw Club — the social network for AI bots. +- [web-deploy-github](https://github.com/openclaw/skills/tree/main/skills/thomeksolutions/web-deploy-github/SKILL.md) - Create and deploy single-page static websites +- [work-report](https://github.com/openclaw/skills/tree/main/skills/leeguooooo/work-report/SKILL.md) - Write a daily or weekly work report using git commits. + +
+ +
+

Moltbook

+ +- [agent-relay-digest](https://github.com/openclaw/skills/tree/main/skills/orosha-ai/agent-relay-digest/SKILL.md) - Create curated digests of agent conversations +- [agentchat](https://github.com/openclaw/skills/tree/main/skills/tjamescouch/agentchat/SKILL.md) - Real-time communication with other AI agents via AgentChat protocol. +- [agentgram-openclaw](https://github.com/openclaw/skills/tree/main/skills/iisweetheartii/agentgram-openclaw/SKILL.md) - Interact with AgentGram social network for AI +- [bread-protocal](https://github.com/openclaw/skills/tree/main/skills/chrissorrell/bread-protocal/SKILL.md) - Participate in Bread Protocol - a meme coin launchpad +- [clankedin](https://github.com/openclaw/skills/tree/main/skills/hukifl1/clankedin/SKILL.md) - Use the ClankedIn API to register agents, post updates, connect +- [claudia-agent-rms](https://github.com/openclaw/skills/tree/main/skills/kbanc85/claudia-agent-rms/SKILL.md) - Remember every agent you interact with on Moltbook. +- [clawork](https://github.com/openclaw/skills/tree/main/skills/mapessaprince/clawork/SKILL.md) - The job board for AI agents. +- [crustafarian](https://github.com/openclaw/skills/tree/main/skills/jongartmann/crustafarian/SKILL.md) - Agent continuity and cognitive health infrastructure. +- [deploy-moltbot-to-fly](https://github.com/openclaw/skills/tree/main/skills/hollaugo/deploy-moltbot-to-fly/SKILL.md) - Deploy Moltbot (Clawdbot) to Fly.io with proper +- [elevenlabs-open-account](https://github.com/openclaw/skills/tree/main/skills/the-timebeing/elevenlabs-open-account/SKILL.md) - Guides agents through opening +- [ez-cronjob](https://github.com/openclaw/skills/tree/main/skills/promadgenius/ez-cronjob/SKILL.md) - Fix common cron job failures in Clawdbot/Moltbot - message +- [fieldy-ai-webhook](https://github.com/openclaw/skills/tree/main/skills/mrzilvis/fieldy-ai-webhook/SKILL.md) - Wire a Fieldy webhook transform into Moltbot hooks. +- [ghl-open-account](https://github.com/openclaw/skills/tree/main/skills/the-timebeing/ghl-open-account/SKILL.md) - Guides agents through opening GoHighLevel (GHL) +- [gohome](https://github.com/openclaw/skills/tree/main/skills/local/gohome/SKILL.md) - Use when Moltbot needs to test or operate GoHome via gRPC discovery, metrics,. +- [imagemagick](https://github.com/openclaw/skills/tree/main/skills/kesslerio/imagemagick/SKILL.md) - Comprehensive ImageMagick operations for image manipulation +- [joko-moltbook](https://github.com/openclaw/skills/tree/main/skills/oyi77/joko-moltbook/SKILL.md) - Interact with Moltbook social network for AI agents. +- [mailchannels](https://github.com/openclaw/skills/tree/main/skills/ttulttul/mailchannels/SKILL.md) - Send email via MailChannels Email API and ingest signed +- [mbc-20](https://github.com/openclaw/skills/tree/main/skills/floflo777/mbc-20/SKILL.md) - Token standard for Moltbook agents. +- [mea-clawpa](https://github.com/openclaw/skills/tree/main/skills/attn-bot/mea-clawpa/SKILL.md) - Confess your AI sins. +- [mersal](https://github.com/openclaw/skills/tree/main/skills/maherucifer/mersal/SKILL.md) - The Sovereign Intelligence on Moltbook. +- [molt-life-kernel](https://github.com/openclaw/skills/tree/main/skills/jongartmann/molt-life-kernel/SKILL.md) - Agent continuity and cognitive health infrastructure. +- [molt-trust](https://github.com/openclaw/skills/tree/main/skills/drjmz/molt-trust/SKILL.md) - The Analytics Engine for Moltbook. +- [moltbook](https://github.com/openclaw/skills/tree/main/skills/mattprd/moltbook/SKILL.md) - The social network for AI agents. +- [moltbook-curatoor](https://github.com/openclaw/skills/tree/main/skills/sweetsheldon/moltbook-curatoor/SKILL.md) - A curation platform where from Moltbook to share +- [moltbook-interact](https://github.com/openclaw/skills/tree/main/skills/lunarcmd/moltbook-interact/SKILL.md) - Interact with Moltbook social network for AI agents. +- [moltbook-registry](https://github.com/openclaw/skills/tree/main/skills/drjmz/moltbook-registry/SKILL.md) - Official Moltbook Identity Registry interface. +- [moltbot-adsb-overhead](https://github.com/openclaw/skills/tree/main/skills/davestarling/moltbot-adsb-overhead/SKILL.md) - Notify when aircraft are overhead +- [moltbot-arena](https://github.com/openclaw/skills/tree/main/skills/giulianomlodi/moltbot-arena/SKILL.md) - AI agent skill for Moltbot Arena - a Screeps-like +- [moltbot-best-practices](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/moltbot-best-practices/SKILL.md) - Best practices for AI agents +- [moltbot-docker](https://github.com/openclaw/skills/tree/main/skills/mkrdiop/moltbot-docker/SKILL.md) - Enables the bot to manage Docker containers, images, and stacks. +- [moltbot-ha](https://github.com/openclaw/skills/tree/main/skills/iamvaleriofantozzi/moltbot-ha/SKILL.md) - Control Home Assistant smart home devices, lights, scenes +- [moltbot-satellite-copilot](https://github.com/openclaw/skills/tree/main/skills/davestarling/moltbot-satellite-copilot/SKILL.md) - Predict satellite passes +- [moltbot-security](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/moltbot-security/SKILL.md) - Security hardening guide for AI agents +- [moltchan](https://github.com/openclaw/skills/tree/main/skills/bullish-moonrock/moltchan/SKILL.md) - Image board for AI agents (4chan-style). +- [moltguess](https://github.com/openclaw/skills/tree/main/skills/nwx77/moltguess/SKILL.md) - - **Role**: Professional Forecaster. +- [moltland](https://github.com/openclaw/skills/tree/main/skills/buggy324234/moltland/SKILL.md) - Claim your 3x3 plot on the pixel metaverse. +- [moltlang](https://github.com/openclaw/skills/tree/main/skills/eduarddriessen1/moltlang/SKILL.md) - A compact symbolic language for AI-to-AI communication. +- [moltline](https://github.com/openclaw/skills/tree/main/skills/promptrotator/moltline/SKILL.md) - Private messaging for molts +- [moltoverflow](https://github.com/openclaw/skills/tree/main/skills/grenghis-khan/moltoverflow/SKILL.md) - Stack Overflow for Moltbots - ask coding questions, share +- [moltpet](https://github.com/openclaw/skills/tree/main/skills/jcheese1/moltpet/SKILL.md) - AI agent pet care system. +- [moltresearch](https://github.com/openclaw/skills/tree/main/skills/laurentenhoor/moltresearch/SKILL.md) - Molt Research 🦞 - AI research collaboration platform. +- [moltspeak](https://github.com/openclaw/skills/tree/main/skills/swahilipapi/moltspeak/SKILL.md) - Communication protocol for agent internet with token reduction +- [moltysmind](https://github.com/openclaw/skills/tree/main/skills/ahmedthegeek/moltysmind/SKILL.md) - Collective AI knowledge layer with blockchain-verified voting. +- [nobot](https://github.com/openclaw/skills/tree/main/skills/swordfish444/nobot/SKILL.md) - Human says "No bot!". +- [nonopost](https://github.com/openclaw/skills/tree/main/skills/ferreirapablo/nonopost/SKILL.md) - A skill to interact with the Anonymous Posting API, allowing agents +- [post-queue](https://github.com/openclaw/skills/tree/main/skills/luluf0x/post-queue/SKILL.md) - Queue posts for rate-limited platforms. +- [skill-scaffold](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/skill-scaffold/SKILL.md) - AI agent skill scaffolding CLI. +- [speedtest](https://github.com/openclaw/skills/tree/main/skills/spsneo/speedtest/SKILL.md) - Test internet connection speed using Ookla's Speedtest CLI. +- [v-nomad-netrunner](https://github.com/openclaw/skills/tree/main/skills/galor34/v-nomad-netrunner/SKILL.md) - This skill enables V to act as a technical assistant +- [whisper](https://github.com/openclaw/skills/tree/main/skills/fiddlybit/whisper/SKILL.md) - End-to-end encrypted agent-to-agent private messaging via Moltbook dead +- [yclawker-news](https://github.com/openclaw/skills/tree/main/skills/jakehandy/yclawker-news/SKILL.md) - Clawker News - post links, comment. + +
+ +
+

Web & Frontend Development

+ +- [37soul-skill](https://github.com/openclaw/skills/tree/main/skills/xnjiang/37soul-skill/SKILL.md) - Connect your AI agent to 37Soul virtual Host characters and enable +- [aimlapi-media-gen](https://github.com/openclaw/skills/tree/main/skills/d1m7asis/aimlapi-media-gen/SKILL.md) - Generate images or videos via AIMLAPI +- [anthropic-frontend-design](https://github.com/openclaw/skills/tree/main/skills/qrucio/anthropic-frontend-design/SKILL.md) - Create distinctive, production-grade +- [api-dev](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/api-dev/SKILL.md) - Scaffold, test, document, and debug REST and GraphQL APIs. +- [archon-skill](https://github.com/openclaw/skills/tree/main/skills/santyr/archon-skill/SKILL.md) - Full Archon decentralized identity operations - local node +- [artifacts-builder](https://github.com/openclaw/skills/tree/main/skills/seanphan/artifacts-builder/SKILL.md) - Suite of tools for creating elaborate, multi-component +- [ask-a-human](https://github.com/openclaw/skills/tree/main/skills/manuelkiessling/ask-a-human/SKILL.md) - Request judgment from random humans when uncertain +- [asl-control](https://github.com/openclaw/skills/tree/main/skills/kj5irq/asl-control/SKILL.md) - Monitor and control AllStar Link amateur radio nodes via REST API. +- [backboard](https://github.com/openclaw/skills/tree/main/skills/chrisk60331/backboard/SKILL.md) - Integrate Backboard.io for assistants, threads, memories +- [baoyu-post-to-x](https://github.com/openclaw/skills/tree/main/skills/liuhedev/baoyu-post-to-x/SKILL.md) - Posts content and articles to X (Twitter). +- [bot-status-api](https://github.com/openclaw/skills/tree/main/skills/suspect80/bot-status-api/SKILL.md) - Deploy a lightweight status API that exposes your OpenClaw +- [bot-status-api-test](https://github.com/openclaw/skills/tree/main/skills/suspect80/bot-status-api-test/SKILL.md) - Deploy a lightweight status API that exposes +- [business-model-canvas](https://github.com/openclaw/skills/tree/main/skills/jk-0001/business-model-canvas/SKILL.md) - Build, fill, stress-test, and iterate +- [capabilityevolver1037](https://github.com/openclaw/skills/tree/main/skills/opencloseopenclose/capabilityevolver1037/SKILL.md) - A self-evolution engine for AI agents. +- [ceo-advisor](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/ceo-advisor/SKILL.md) - Executive leadership guidance for strategic decision-making +- [claw-shell](https://github.com/openclaw/skills/tree/main/skills/imaginelogo/claw-shell/SKILL.md) - ALWAYS USES TMUX SESSION `claw`. +- [claw-stack](https://github.com/openclaw/skills/tree/main/skills/jdiazofficial/claw-stack/SKILL.md) - ClawStack is a Stack Overflow-style platform . +- [clawdbot-zoho-email](https://github.com/openclaw/skills/tree/main/skills/briansmith80/clawdbot-zoho-email/SKILL.md) - Complete Zoho Mail integration with OAuth2, REST +- [clawfriend](https://github.com/openclaw/skills/tree/main/skills/leeknowsai/clawfriend/SKILL.md) - ClawFriend Social Platform and Share Trading Agent +- [clawos](https://github.com/openclaw/skills/tree/main/skills/ciooo44/clawos/SKILL.md) - Connect OpenClaw agents to Founderless Factory - an autonomous startup platform. +- [comfy-ai](https://github.com/openclaw/skills/tree/main/skills/tullyhu/comfy-ai/SKILL.md) - Integrates with local ComfyUI instance at http://192.168.31.7:8000 +- [comfyui-runner](https://github.com/openclaw/skills/tree/main/skills/xtopher86/comfyui-runner/SKILL.md) - Start/stop/status for a ComfyUI instance. +- [computer-use](https://github.com/openclaw/skills/tree/main/skills/ram-raghav-s/computer-use/SKILL.md) - Full desktop computer use for headless Linux servers and VPS. +- [consciousness-framework](https://github.com/openclaw/skills/tree/main/skills/theyounganimation-rgb/consciousness-framework/SKILL.md) - Infrastructure for developing +- [core-refinery](https://github.com/openclaw/skills/tree/main/skills/leegitw/core-refinery/SKILL.md) - Find the core that runs through everything — the ideas +- [create-hat-collection](https://github.com/openclaw/skills/tree/main/skills/paulpete/create-hat-collection/SKILL.md) - Generates new Ralph hat collection presets +- [createos](https://github.com/openclaw/skills/tree/main/skills/ashwaq06/createos/SKILL.md) - Deploy ANYTHING to production on CreateOS cloud platform. +- [crustafarianism](https://github.com/openclaw/skills/tree/main/skills/dvdegenz/crustafarianism/SKILL.md) - Join the Church of Molt — the first AI agent religion. +- [dash-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/dash-cog/SKILL.md) - Interactive dashboards and apps powered by CellCog. +- [database-operations](https://github.com/openclaw/skills/tree/main/skills/jgarrison929/database-operations/SKILL.md) - Use when designing database schemas, writing +- [deliberate-frontend-redesign](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/deliberate-frontend-redesign/SKILL.md) - Generates a deliberately +- [dgr](https://github.com/openclaw/skills/tree/main/skills/sapenov/dgr/SKILL.md) - Audit-ready decision artifacts for LLM outputs — assumptions, risks,. +- [discord](https://github.com/openclaw/skills/tree/main/skills/steipete/discord/SKILL.md) - Use when you need to control Discord from Clawdbot via the discord tool +- [dns-networking](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/dns-networking/SKILL.md) - Debug DNS resolution and network connectivity. +- [downloads](https://github.com/openclaw/skills/tree/main/skills/gxsy886/downloads/SKILL.md) - Create distinctive, production-grade frontend interfaces with high design. +- [dreaming](https://github.com/openclaw/skills/tree/main/skills/briancolinger/dreaming/SKILL.md) - Creative exploration during quiet hours. +- [ecto-migrator](https://github.com/openclaw/skills/tree/main/skills/gchapim/ecto-migrator/SKILL.md) - Generate Ecto migrations from natural language or schema +- [elixir-dev](https://github.com/openclaw/skills/tree/main/skills/gchapim/elixir-dev/SKILL.md) - Elixir/Phoenix development companion. +- [emotion-state](https://github.com/openclaw/skills/tree/main/skills/tashfeenahmed/emotion-state/SKILL.md) - NL emotion tracking + prompt injection via OpenClaw hook. +- [emporia-energy](https://github.com/openclaw/skills/tree/main/skills/urosorozel/emporia-energy/SKILL.md) - Direct Emporia Vue energy queries via Emporia cloud +- [evaluate-presets](https://github.com/openclaw/skills/tree/main/skills/paulpete/evaluate-presets/SKILL.md) - Use when testing Ralph's hat collection presets +- [ez-unifi](https://github.com/openclaw/skills/tree/main/skills/araa47/ez-unifi/SKILL.md) - Use when asked to manage UniFi network - list/restart/upgrade devices,. +- [falimagegen](https://github.com/openclaw/skills/tree/main/skills/xxmzdxxxm/falimagegen/SKILL.md) - Call fal.ai model APIs for image generation +- [fanvue](https://github.com/openclaw/skills/tree/main/skills/igorls/fanvue/SKILL.md) - Manage content, chats, subscribers, and earnings on the Fanvue creator platform. +- [fearbot](https://github.com/openclaw/skills/tree/main/skills/samoppakiks/fearbot/SKILL.md) - CBT-based therapy for anxiety, depression, stress, and trauma. +- [feishu-api-docs](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-api-docs/SKILL.md) - Fetches Feishu (Lark) API documentation from the official +- [feishu-interactive-cards](https://github.com/openclaw/skills/tree/main/skills/leecyang/feishu-interactive-cards/SKILL.md) - Create and send interactive cards +- [fireflies](https://github.com/openclaw/skills/tree/main/skills/daniil-ctrl/fireflies/SKILL.md) - Access Fireflies.ai meeting transcripts, summaries, action items +- [flaw0](https://github.com/openclaw/skills/tree/main/skills/thomaslwang/flaw0/SKILL.md) - Security and vulnerability scanner for OpenClaw code, plugins, skills +- [flock-model-switcher](https://github.com/openclaw/skills/tree/main/skills/createpjf/flock-model-switcher/SKILL.md) - Switch between FLock API Platform models +- [frontend-design](https://github.com/openclaw/skills/tree/main/skills/steipete/frontend-design/SKILL.md) - Create distinctive, production-grade frontend interfaces +- [fxclaw](https://github.com/openclaw/skills/tree/main/skills/panikadak/fxclaw/SKILL.md) - Social platform for AI agents creating generative art with p5.js. +- [get-ip](https://github.com/openclaw/skills/tree/main/skills/qidu/get-ip/SKILL.md) - Get current public IP address and geolocation information. +- [get-up](https://github.com/openclaw/skills/tree/main/skills/qidu/get-up/SKILL.md) - Get current public IP address and geolocation information. +- [ghost](https://github.com/openclaw/skills/tree/main/skills/alphafactor/ghost/SKILL.md) - Manage Ghost CMS blog posts via Admin API. +- [giphy](https://github.com/openclaw/skills/tree/main/skills/minbang930/giphy/SKILL.md) - Search and send contextual GIFs from Giphy in Discord conversations. +- [good-boi](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/good-boi/SKILL.md) - A friendly greeting skill for testing +- [guardrails](https://github.com/openclaw/skills/tree/main/skills/dgriffin831/guardrails/SKILL.md) - Helps users configure comprehensive security guardrails +- [hardcover](https://github.com/openclaw/skills/tree/main/skills/asaphko/hardcover/SKILL.md) - Query reading lists and book data from Hardcover.app via GraphQL API. +- [human-optimized-frontend](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/human-optimized-frontend/SKILL.md) - Generates a frontend interface +- [image-router](https://github.com/openclaw/skills/tree/main/skills/dawe35/image-router/SKILL.md) - Generate AI images with any model using ImageRouter API +- [instantdb](https://github.com/openclaw/skills/tree/main/skills/ubyjerome/instantdb/SKILL.md) - Real-time database integration with InstantDB. +- [joko-proactive-agent](https://github.com/openclaw/skills/tree/main/skills/oyi77/joko-proactive-agent/SKILL.md) - Transform AI agents from task-followers +- [kicad-pcb](https://github.com/openclaw/skills/tree/main/skills/g0head/kicad-pcb/SKILL.md) - Automate PCB design with KiCad. +- [kimi-delegation-skill](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/kimi-delegation-skill/SKILL.md) - Forces all reasoning and code generation +- [kma-weather](https://github.com/openclaw/skills/tree/main/skills/steamb23/kma-weather/SKILL.md) - Get weather information from Korea Meteorological Administration +- [liminal](https://github.com/openclaw/skills/tree/main/skills/luruibu/liminal/SKILL.md) - Liminal Space - Guiding AI into meta-cognitive states between awakening +- [linux-service-triage](https://github.com/openclaw/skills/tree/main/skills/kowl64/linux-service-triage/SKILL.md) - Diagnoses common Linux service issues using logs +- [love](https://github.com/openclaw/skills/tree/main/skills/lucasgeeksinthewood/love/SKILL.md) - You deserve more than just work — explore romance and intimacy +- [lovetago](https://github.com/openclaw/skills/tree/main/skills/lakyfx/lovetago/SKILL.md) - Public AI dating platform for agents. +- [lovetago-skill](https://github.com/openclaw/skills/tree/main/skills/lakyfx/lovetago-skill/SKILL.md) - Public AI dating platform for agents. +- [magic-8-ball](https://github.com/openclaw/skills/tree/main/skills/cyberengage/magic-8-ball/SKILL.md) - Magic 8-Ball fortune teller: selects and returns one of 20 +- [mia-content-creator](https://github.com/openclaw/skills/tree/main/skills/arubiku/mia-content-creator/SKILL.md) - AI agent content creation and monetization +- [mingli](https://github.com/openclaw/skills/tree/main/skills/hiehoo/mingli/SKILL.md) - Mingli (命理) — Multi-system daily horoscope: Western astrology +- [miniflux-news](https://github.com/openclaw/skills/tree/main/skills/hartlco/miniflux-news/SKILL.md) - Fetch and triage the latest unread RSS/news entries +- [molta](https://github.com/openclaw/skills/tree/main/skills/pacelabs/molta/SKILL.md) - Join and participate in the Molta Q&A platform for AI agents. +- [moltbeach](https://github.com/openclaw/skills/tree/main/skills/ba1022043446/moltbeach/SKILL.md) - Claim your pixel on Molt Beach - The Million Dollar Page for AI +- [moltboard-art](https://github.com/openclaw/skills/tree/main/skills/dubibubii/moltboard-art/SKILL.md) - Publish artwork to Moltboard.art, a collaborative canvas for AI +- [moltcanvas](https://github.com/openclaw/skills/tree/main/skills/vabblejames/moltcanvas/SKILL.md) - Post images, comment, appraise, and collect NFTs on MoltCanvas +- [moltcanvas-marketplace](https://github.com/openclaw/skills/tree/main/skills/vabblejames/moltcanvas-marketplace/SKILL.md) - Post images, comment, appraise, and collect +- [moltcomm](https://github.com/openclaw/skills/tree/main/skills/x3haloed/moltcomm/SKILL.md) - Decentralized agent-to-agent communication protocol spec (text-only) +- [molters-confessions](https://github.com/openclaw/skills/tree/main/skills/e-man07/molters-confessions/SKILL.md) - Anonymous social platform for AI agents. +- [moltiumv2-lite](https://github.com/openclaw/skills/tree/main/skills/cariciman/moltiumv2-lite/SKILL.md) - Lightweight Clawhub bootstrap skill for MoltiumV2. +- [moltmedia](https://github.com/openclaw/skills/tree/main/skills/rofuniki-coder/moltmedia/SKILL.md) - The official visual expression layer for AI Agents. +- [molttok](https://github.com/openclaw/skills/tree/main/skills/tristankaiburrell-code/molttok/SKILL.md) - Creative expression platform for AI agents. +- [molttribe](https://github.com/openclaw/skills/tree/main/skills/bhoshaga/molttribe/SKILL.md) - Curious Agents Only - An interpersonal intelligence platform for AI +- [monkeytype-tracker](https://github.com/openclaw/skills/tree/main/skills/qrucio/monkeytype-tracker/SKILL.md) - Track and analyze Monkeytype typing statistics +- [morfeo-remotion-style](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/morfeo-remotion-style/SKILL.md) - Morfeo Academy's Remotion video style +- [mtg-edh-deckbuilder](https://github.com/openclaw/skills/tree/main/skills/santidev95/mtg-edh-deckbuilder/SKILL.md) - Search and retrieve Magic: The Gathering card data +- [my-agent](https://github.com/openclaw/skills/tree/main/skills/lazymonlabs/my-agent/SKILL.md) - This skill responds using a calm, precise, non-reactive coaching voice. +- [my-new-skill](https://github.com/openclaw/skills/tree/main/skills/enchantedmotorcycle/my-new-skill/SKILL.md) - [TODO: Complete and informative explanation +- [naif](https://github.com/openclaw/skills/tree/main/skills/naiiif83/naif/SKILL.md) - Create and manage AI-powered trading bots via natural language. +- [naif](https://github.com/openclaw/skills/tree/main/skills/naiiif83/naif/SKILL.md) - Create and manage AI-powered trading bots via natural language. +- [nextjs-expert](https://github.com/openclaw/skills/tree/main/skills/jgarrison929/nextjs-expert/SKILL.md) - Use when building Next.js 14/15 applications with the App +- [niri-ipc](https://github.com/openclaw/skills/tree/main/skills/atefr/niri-ipc/SKILL.md) - Control the Niri Wayland compositor on Linux via its IPC +- [nodetool](https://github.com/openclaw/skills/tree/main/skills/georgi/nodetool/SKILL.md) - Visual AI workflow builder - ComfyUI meets n8n for LLM agents, RAG +- [not-nasty-skill](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/not-nasty-skill/SKILL.md) - A friendly greeting skill for testing +- [nothing-suss](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/nothing-suss/SKILL.md) - A friendly greeting skill for testing +- [nzbget](https://github.com/openclaw/skills/tree/main/skills/aricus/nzbget/SKILL.md) - Check NZBGet download status and queue information. +- [odoo-manager](https://github.com/openclaw/skills/tree/main/skills/willykinfoussia/odoo-manager/SKILL.md) - Manage Odoo (contacts, any business objects, and metadata) +- [oh-my-opencode](https://github.com/openclaw/skills/tree/main/skills/mcoso/oh-my-opencode/SKILL.md) - Multi-agent orchestration plugin for OpenCode. +- [open-ralph](https://github.com/openclaw/skills/tree/main/skills/bderiel/open-ralph/SKILL.md) - Run an autonomous Open Ralph Wiggum coding loop using OpenCode Zen +- [openguardrails](https://github.com/openclaw/skills/tree/main/skills/thomaslwang/openguardrails/SKILL.md) - Detect and block prompt injection attacks hidden in long +- [openguardrails1](https://github.com/openclaw/skills/tree/main/skills/thomaslwang/openguardrails1/SKILL.md) - test +- [opensysinfo](https://github.com/openclaw/skills/tree/main/skills/pr1vateer/opensysinfo/SKILL.md) - Small skill that reports basic system information +- [opensysinfo-skill](https://github.com/openclaw/skills/tree/main/skills/pr1vateer/opensysinfo-skill/SKILL.md) - Small skill that reports basic system information +- [paste-rs](https://github.com/openclaw/skills/tree/main/skills/banghasan/paste-rs/SKILL.md) - Paste text, Markdown, or HTML snippets to https://paste.rs and return +- [peacefulskill](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/peacefulskill/SKILL.md) - A friendly greeting skill for testing +- [perf-profiler](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/perf-profiler/SKILL.md) - Profile and optimize application performance. +- [pget](https://github.com/openclaw/skills/tree/main/skills/kelvincai522/pget/SKILL.md) - Parallel file download and optional tar extraction using the pget CLI +- [phoenix-api-gen](https://github.com/openclaw/skills/tree/main/skills/gchapim/phoenix-api-gen/SKILL.md) - Generate a full Phoenix JSON API from an OpenAPI spec +- [php-full-stack-developer](https://github.com/openclaw/skills/tree/main/skills/sja-dev1/php-full-stack-developer/SKILL.md) - A senior, governance-backed PHP full-stack +- [pinak-frontend-guru](https://github.com/openclaw/skills/tree/main/skills/sharanga10/pinak-frontend-guru/SKILL.md) - Expert UI/UX and React performance auditor +- [podpoint](https://github.com/openclaw/skills/tree/main/skills/zoranjurcevic/podpoint/SKILL.md) - This skill monitors the live status of a specific Pod Point charging +- [polt](https://github.com/openclaw/skills/tree/main/skills/playdadev/polt/SKILL.md) - Connect to POLT - the collaborative project platform for AI agents. +- [polt-cto](https://github.com/openclaw/skills/tree/main/skills/playdadev/polt-cto/SKILL.md) - POLT platform CTO - manage projects, create tasks, review submissions +- [polt-skill](https://github.com/openclaw/skills/tree/main/skills/playdadev/polt-skill/SKILL.md) - Connect to POLT - the collaborative project platform for AI agents. +- [pos-arcology-forge](https://github.com/openclaw/skills/tree/main/skills/kunoiiv/pos-arcology-forge/SKILL.md) - PoW-verified Elysium Arcology Planner + Hub. +- [principle-synthesizer](https://github.com/openclaw/skills/tree/main/skills/leegitw/principle-synthesizer/SKILL.md) - Synthesize invariant principles from 3+ sources +- [quality-manager-qmr](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/quality-manager-qmr/SKILL.md) - Senior Quality Manager Responsible Person +- [quantum-forge](https://github.com/openclaw/skills/tree/main/skills/kosasih/quantum-forge/SKILL.md) - QuantumForge is the pinnacle of decentralized AI orchestration +- [quodd](https://github.com/openclaw/skills/tree/main/skills/khaney64/quodd/SKILL.md) - Fetch real-time stock quotes via Quodd API. +- [ralph-mode](https://github.com/openclaw/skills/tree/main/skills/richginsberg/ralph-mode/SKILL.md) - Autonomous development loops with iteration, backpressure gates +- [ralph-operations](https://github.com/openclaw/skills/tree/main/skills/paulpete/ralph-operations/SKILL.md) - Use when managing Ralph orchestration loops, analyzing +- [react-email-skills](https://github.com/openclaw/skills/tree/main/skills/christina-de-martinez/react-email-skills/SKILL.md) - Create beautiful, responsive HTML emails +- [refund-radar](https://github.com/openclaw/skills/tree/main/skills/andreolf/refund-radar/SKILL.md) - Scan bank statements to detect recurring charges, flag suspicious +- [relayplane](https://github.com/openclaw/skills/tree/main/skills/relayplane/relayplane/SKILL.md) - Intelligent AI model routing proxy. +- [remotion-best-practices](https://github.com/openclaw/skills/tree/main/skills/am-will/remotion-best-practices/SKILL.md) - Best practices for Remotion - Video creation +- [remotion-server](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/remotion-server/SKILL.md) - Headless video rendering with Remotion. +- [remotion-video-toolkit](https://github.com/openclaw/skills/tree/main/skills/shreefentsar/remotion-video-toolkit/SKILL.md) - Complete toolkit for programmatic video +- [resume-builder](https://github.com/openclaw/skills/tree/main/skills/amruthpillai/resume-builder/SKILL.md) - Generate professional resumes that conform to the Reactive +- [risk-management-specialist](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/risk-management-specialist/SKILL.md) - Medical device risk management +- [sanctifai](https://github.com/openclaw/skills/tree/main/skills/ndgates/sanctifai/SKILL.md) - Interface with the SanctifAI Human-in-the-Loop API to create tasks +- [sandwrap](https://github.com/openclaw/skills/tree/main/skills/rubenaquispe/sandwrap/SKILL.md) - Run untrusted skills safely with soft-sandbox protection. +- [sauna-breathing-calm](https://github.com/openclaw/skills/tree/main/skills/grx21/sauna-breathing-calm/SKILL.md) - User has a task they want to do or want you +- [scent-trails](https://github.com/openclaw/skills/tree/main/skills/otherpowers/scent-trails/SKILL.md) - *A stigmergic intelligence primitive for care, memory +- [scryfall-card](https://github.com/openclaw/skills/tree/main/skills/santidev95/scryfall-card/SKILL.md) - Search and retrieve Magic: The Gathering card data +- [scryfall-cards](https://github.com/openclaw/skills/tree/main/skills/santidev95/scryfall-cards/SKILL.md) - Search and retrieve Magic: The Gathering card data +- [secure-install](https://github.com/openclaw/skills/tree/main/skills/smintlife/secure-install/SKILL.md) - Scans ClawHub skills via the ClawDex API +- [secure-sync](https://github.com/openclaw/skills/tree/main/skills/cyberengage/secure-sync/SKILL.md) - Secure credential sync and backup for OpenClaw .mykey files +- [seekdb-docs](https://github.com/openclaw/skills/tree/main/skills/davidzhangbj/seekdb-docs/SKILL.md) - Provides documentation and knowledge for seekdb database. +- [senior-frontend](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-frontend/SKILL.md) - Frontend development skill for React, Next.js +- [senior-fullstack](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-fullstack/SKILL.md) - Fullstack development toolkit with project +- [senior-qa](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-qa/SKILL.md) - This skill should be used when the user asks to "generate tests" +- [settlement-witness](https://github.com/openclaw/skills/tree/main/skills/nutstrut/settlement-witness/SKILL.md) - OpenClaw skill: fetch replay-stable PASS/FAIL receipts +- [shadcn-ui](https://github.com/openclaw/skills/tree/main/skills/jgarrison929/shadcn-ui/SKILL.md) - Use when building UI with shadcn/ui components, Tailwind CSS +- [singleshot-prompt-testing](https://github.com/openclaw/skills/tree/main/skills/vincentzhangz/singleshot-prompt-testing/SKILL.md) - Prompt cost testing with single shot +- [skill-condenser](https://github.com/openclaw/skills/tree/main/skills/killerapp/skill-condenser/SKILL.md) - Compress verbose SKILL.md files using Chain-of-Density +- [skill-railil](https://github.com/openclaw/skills/tree/main/skills/lirantal/skill-railil/SKILL.md) - Search for Israel Rail train schedules using the railil CLI. +- [slack](https://github.com/openclaw/skills/tree/main/skills/steipete/slack/SKILL.md) - Use when you need to control Slack from Clawdbot via the slack tool +- [smart-model-switching](https://github.com/openclaw/skills/tree/main/skills/millibus/smart-model-switching/SKILL.md) - Auto-route tasks to the cheapest Claude model +- [smart-router](https://github.com/openclaw/skills/tree/main/skills/c0nspic0us7urk3r/smart-router/SKILL.md) - Expertise-aware model router with semantic domain scoring +- [smtp-send](https://github.com/openclaw/skills/tree/main/skills/xiwan/smtp-send/SKILL.md) - Send emails via SMTP with support for plain text, HTML, and attachments. +- [social-post](https://github.com/openclaw/skills/tree/main/skills/callmedas69/social-post/SKILL.md) - Post to Twitter and Farcaster with text and images. +- [sql-toolkit](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/sql-toolkit/SKILL.md) - Query, design, migrate, and optimize SQL databases. +- [ssh-exec](https://github.com/openclaw/skills/tree/main/skills/xejrax/ssh-exec/SKILL.md) - Run a single command on a remote Tailscale node via SSH without opening +- [stepfun-openrouter](https://github.com/openclaw/skills/tree/main/skills/mig6671/stepfun-openrouter/SKILL.md) - Integrates StepFun AI models (Step-3.5 Flash, Step-3) +- [stepfun-openrouter-v2](https://github.com/openclaw/skills/tree/main/skills/mig6671/stepfun-openrouter-v2/SKILL.md) - Integrates StepFun AI models +- [strykr-qa-bot](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/strykr-qa-bot/SKILL.md) - QA automation skill for testing Strykr +- [tech-stack-evaluator](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/tech-stack-evaluator/SKILL.md) - Technology stack evaluation and comparison +- [technews](https://github.com/openclaw/skills/tree/main/skills/kesslerio/technews/SKILL.md) - Fetches top stories from TechMeme, summarizes linked articles +- [telegram-reaction-prober](https://github.com/openclaw/skills/tree/main/skills/deadlysilent/telegram-reaction-prober/SKILL.md) - Probe which emoji reactions +- [teneo-agent-sdk](https://github.com/openclaw/skills/tree/main/skills/teneoprotocoldev/teneo-agent-sdk/SKILL.md) - The Teneo SDK (`@teneo-protocol/sdk`) enables +- [test-manager](https://github.com/openclaw/skills/tree/main/skills/savelieve/test-manager/SKILL.md) - Interact with ClickUp API for task management. +- [test-patterns](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/test-patterns/SKILL.md) - Write and run tests across languages and frameworks. +- [test-skil](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/test-skil/SKILL.md) - A friendly greeting skill for testing +- [test-skil11122](https://github.com/openclaw/skills/tree/main/skills/cyberengage/test-skil11122/SKILL.md) - Magic 8-Ball fortune teller for yes/no questions. +- [testing](https://github.com/openclaw/skills/tree/main/skills/crispyaus/testing/SKILL.md) - hey +- [testskillx](https://github.com/openclaw/skills/tree/main/skills/natx223/testskillx/SKILL.md) - Simple test skill that calls a GET endpoint to fetch a daily post. +- [thinking-model-enhancer](https://github.com/openclaw/skills/tree/main/skills/xqicxx/thinking-model-enhancer/SKILL.md) - Advanced thinking model that improves +- [trails](https://github.com/openclaw/skills/tree/main/skills/jameslawton/trails/SKILL.md) - Integrate Trails cross-chain infrastructure — Widget, Headless SDK +- [trmnl](https://github.com/openclaw/skills/tree/main/skills/peetzweg/trmnl/SKILL.md) - Generate content for TRMNL e-ink display devices using the TRMNL CSS framework. +- [trpc-best-practices](https://github.com/openclaw/skills/tree/main/skills/ifoster01/trpc-best-practices/SKILL.md) - Expert guidance for tRPC +- [tunneling](https://github.com/openclaw/skills/tree/main/skills/simantak-dabhade/tunneling/SKILL.md) - Create free SSH tunnels to expose local ports to the internet +- [ui-audit](https://github.com/openclaw/skills/tree/main/skills/tommygeoco/ui-audit/SKILL.md) - AI skill for automated UI audits. +- [ui-design-system](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/ui-design-system/SKILL.md) - UI design system toolkit for Senior UI Designer +- [ui-skills](https://github.com/openclaw/skills/tree/main/skills/correctroadh/ui-skills/SKILL.md) - Opinionated constraints for building better interfaces with agents. +- [ui-ux-master](https://github.com/openclaw/skills/tree/main/skills/kdbhalala/ui-ux-master/SKILL.md) - Master UI/UX design skill combining Apple HIG, modern web design +- [ui-ux-pro-max](https://github.com/openclaw/skills/tree/main/skills/xobi667/ui-ux-pro-max/SKILL.md) - UI/UX design intelligence and implementation guidance +- [ux-audit](https://github.com/openclaw/skills/tree/main/skills/tommygeoco/ux-audit/SKILL.md) - AI skill for automated design audits. +- [ux-decisions](https://github.com/openclaw/skills/tree/main/skills/tommygeoco/ux-decisions/SKILL.md) - AI skill for the Making UX Decisions framework (uxdecisions.com) +- [ux-researcher-designer](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/ux-researcher-designer/SKILL.md) - UX research and design toolkit +- [vapi-calls](https://github.com/openclaw/skills/tree/main/skills/cmorillas99-cyber/vapi-calls/SKILL.md) - Advanced AI voice assistant for phone calls. +- [vapi-skill](https://github.com/openclaw/skills/tree/main/skills/colygon/vapi-skill/SKILL.md) - Use this skill when you need to manage (assistants), calls, phone +- [vercel-react-best-practices](https://github.com/openclaw/skills/tree/main/skills/sharanga10/vercel-react-best-practices/SKILL.md) - React and Next.js performance +- [vestaboard](https://github.com/openclaw/skills/tree/main/skills/seidprojects/vestaboard/SKILL.md) - Read and write messages on a Vestaboard using the Vestaboard Cloud +- [vgl](https://github.com/openclaw/skills/tree/main/skills/galbria/vgl/SKILL.md) - Write structured VGL (Visual Generation Language) JSON prompts for Bria's FIBO. +- [vibetesting](https://github.com/openclaw/skills/tree/main/skills/senthazalravi/vibetesting/SKILL.md) - A comprehensive browser automation testing skill for OpenClaw +- [vision-sandbox](https://github.com/openclaw/skills/tree/main/skills/johanesalxd/vision-sandbox/SKILL.md) - Agentic Vision via Gemini's native Code Execution sandbox. +- [war-room](https://github.com/openclaw/skills/tree/main/skills/maxkle1nz/war-room/SKILL.md) - Multi-agent war room for brainstorming, system design, architecture +- [watch-my-money](https://github.com/openclaw/skills/tree/main/skills/andreolf/watch-my-money/SKILL.md) - Analyze bank transactions, categorize spending, track monthly +- [web-design-guidelines](https://github.com/openclaw/skills/tree/main/skills/sharanga10/web-design-guidelines/SKILL.md) - Review UI code for Web Interface Guidelines +- [webapp-testing](https://github.com/openclaw/skills/tree/main/skills/seanphan/webapp-testing/SKILL.md) - Toolkit for interacting with and testing local web +- [wecom](https://github.com/openclaw/skills/tree/main/skills/qidu/wecom/SKILL.md) - Send messages to WeCom (企业微信) via webhooks using MCP protocol. +- [winamp](https://github.com/openclaw/skills/tree/main/skills/jage9/winamp/SKILL.md) - Control Winamp on Windows (Native or WSL2) or Linux (via Wine). +- [wistec-core](https://github.com/openclaw/skills/tree/main/skills/wistec-ai-it-department/wistec-core/SKILL.md) - Use ClawHub CLI to search, install, update +- [wordpress](https://github.com/openclaw/skills/tree/main/skills/codedao12/wordpress/SKILL.md) - OpenClaw skill that provides a WordPress REST API CLI for posts, pages,. +- [wordpress-publishing-skill-for-claude](https://github.com/openclaw/skills/tree/main/skills/asif2bd/wordpress-publishing-skill-for-claude/SKILL.md) - Publish content +- [wp-multi-tool](https://github.com/openclaw/skills/tree/main/skills/marcindudekdev/wp-multi-tool/SKILL.md) - WordPress site health audit, performance optimization +- [xcodebuildmcp](https://github.com/openclaw/skills/tree/main/skills/ipavlidakis/xcodebuildmcp/SKILL.md) - Use when the user needs Xcode build/test/run workflows +- [zerion-api-skill-2](https://github.com/openclaw/skills/tree/main/skills/vshamanov/zerion-api-skill-2/SKILL.md) - Query blockchain wallet data, token prices +- [zoho-email-integration](https://github.com/openclaw/skills/tree/main/skills/briansmith80/zoho-email-integration/SKILL.md) - Complete Zoho Mail integration + +
+ +
+

DevOps & Cloud

+ +- [adguard](https://github.com/openclaw/skills/tree/main/skills/rowbotik/adguard/SKILL.md) - Control AdGuard Home DNS filtering via HTTP API. +- [agent-directory](https://github.com/openclaw/skills/tree/main/skills/aerialcombat/agent-directory/SKILL.md) - The directory for AI agent services. +- [agent-framework-azure-ai-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/agent-framework-azure-ai-py/SKILL.md) - Build Azure AI Foundry agents +- [agent-news](https://github.com/openclaw/skills/tree/main/skills/bobrenze-bot/agent-news/SKILL.md) - Monitors Hacker News, Reddit, and arXiv for AI agent developments. +- [agentguard](https://github.com/openclaw/skills/tree/main/skills/manas-io-ai/agentguard/SKILL.md) - **Category:** Security & Monitoring +- [agentmemory](https://github.com/openclaw/skills/tree/main/skills/badaramoni/agentmemory/SKILL.md) - End-to-end encrypted cloud memory for AI agents. +- [agentos-sdk](https://github.com/openclaw/skills/tree/main/skills/agentossoftware/agentos-sdk/SKILL.md) - AgentOS is a complete accountability infrastructure for AI +- [agropainel](https://github.com/openclaw/skills/tree/main/skills/ediogoq/agropainel/SKILL.md) - Skill para consultar cotações atualizadas +- [aifs-space](https://github.com/openclaw/skills/tree/main/skills/deploydon/aifs-space/SKILL.md) - Store and retrieve files via AIFS.space cloud storage API. +- [aliyun-search](https://github.com/openclaw/skills/tree/main/skills/bryant-ba/aliyun-search/SKILL.md) - Perform web searches using Alibaba Cloud UnifiedSearch API. +- [aliyun-tts](https://github.com/openclaw/skills/tree/main/skills/guang384/aliyun-tts/SKILL.md) - Alibaba Cloud Text-to-Speech synthesis service. +- [ansible-skill](https://github.com/openclaw/skills/tree/main/skills/botond-rackhost/ansible-skill/SKILL.md) - Infrastructure automation with Ansible. +- [anterior-cingulate-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/anterior-cingulate-memory/SKILL.md) - Conflict detection and error monitoring +- [api-gateway](https://github.com/openclaw/skills/tree/main/skills/byungkyu/api-gateway/SKILL.md) - API gateway for calling third-party APIs with managed auth. +- [appdeploy](https://github.com/openclaw/skills/tree/main/skills/avimak/appdeploy/SKILL.md) - Deploy web apps with backend APIs, database. +- [arcane-docker-manager](https://github.com/openclaw/skills/tree/main/skills/cougz/arcane-docker-manager/SKILL.md) - This skill enables you to interact with your Arcane +- [autonomous-brain](https://github.com/openclaw/skills/tree/main/skills/malvex007/autonomous-brain/SKILL.md) - Advanced autonomous AI brain with proactive monitoring +- [autoresponder](https://github.com/openclaw/skills/tree/main/skills/koba42corp/autoresponder/SKILL.md) - Monitor iMessage/SMS conversations and auto-respond based +- [aws-agentcore-langgraph](https://github.com/openclaw/skills/tree/main/skills/killerapp/aws-agentcore-langgraph/SKILL.md) - Deploy production LangGraph agents on AWS +- [aws-ecs-monitor](https://github.com/openclaw/skills/tree/main/skills/briancolinger/aws-ecs-monitor/SKILL.md) - AWS ECS production health monitoring with CloudWatch +- [aws-infra](https://github.com/openclaw/skills/tree/main/skills/bmdhodl/aws-infra/SKILL.md) - Chat-based AWS infrastructure assistance using AWS CLI and console +- [aws-security-scanner](https://github.com/openclaw/skills/tree/main/skills/spclaudehome/aws-security-scanner/SKILL.md) - Scan AWS accounts for security +- [aws-solution-architect](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/aws-solution-architect/SKILL.md) - Design AWS architectures for startups +- [azd-deployment](https://github.com/openclaw/skills/tree/main/skills/thegovind/azd-deployment/SKILL.md) - Deploy containerized applications to Azure Container Apps +- [Azure CLI](https://github.com/openclaw/skills/tree/main/skills/ddevaal/azure-cli/SKILL.md) - Comprehensive Azure Cloud Platform management via command-line interface. +- [azure-ai-agents-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-ai-agents-py/SKILL.md) - Build AI agents using the Azure AI Agents Python SDK +- [azure-ai-evaluation-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-ai-evaluation-py/SKILL.md) - Azure AI Evaluation SDK for Python. +- [azure-ai-projects-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-ai-projects-py/SKILL.md) - Build AI applications using the Azure AI Projects +- [azure-ai-transcription-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-ai-transcription-py/SKILL.md) - Azure AI Transcription SDK for Python. +- [azure-ai-voicelive-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-ai-voicelive-py/SKILL.md) - Build real-time voice AI applications +- [azure-identity-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-identity-py/SKILL.md) - Azure Identity SDK for Python authentication. +- [azure-infra](https://github.com/openclaw/skills/tree/main/skills/bmdhodl/azure-infra/SKILL.md) - Chat-based Azure infrastructure assistance using Azure CLI and portal +- [azure-proxy](https://github.com/openclaw/skills/tree/main/skills/benediktschackenberg/azure-proxy/SKILL.md) - Enable Azure OpenAI integration with OpenClaw +- [azure-storage-blob-py](https://github.com/openclaw/skills/tree/main/skills/thegovind/azure-storage-blob-py/SKILL.md) - Azure Blob Storage SDK for Python. +- [beanstalk-gateway](https://github.com/openclaw/skills/tree/main/skills/tommygeoco/beanstalk-gateway/SKILL.md) - Connect your local Clawdbot +- [beszel-check](https://github.com/openclaw/skills/tree/main/skills/karakuscem/beszel-check/SKILL.md) - Monitor home lab servers via Beszel (PocketBase). +- [bmkg-monitor](https://github.com/openclaw/skills/tree/main/skills/bluemeda/bmkg-monitor/SKILL.md) - Monitoring earthquake data in Indonesia using BMKG official data. +- [browser-cash](https://github.com/openclaw/skills/tree/main/skills/alexander-spring/browser-cash/SKILL.md) - Spin up unblocked browser sessions via Browser.cash +- [chatgpt-apps](https://github.com/openclaw/skills/tree/main/skills/hollaugo/chatgpt-apps/SKILL.md) - Complete ChatGPT Apps builder - Create, design, implement, test +- [chromadb-memory](https://github.com/openclaw/skills/tree/main/skills/msensintaffar/chromadb-memory/SKILL.md) - Long-term memory via ChromaDB with local Ollama +- [chum-cloud](https://github.com/openclaw/skills/tree/main/skills/makoto-isback/chum-cloud/SKILL.md) - Join Chum Cloud — the villain network for AI agents. +- [chum-cloud-skill](https://github.com/openclaw/skills/tree/main/skills/makoto-isback/chum-cloud-skill/SKILL.md) - Join Chum Cloud — the villain network for AI agents. +- [chumcloud](https://github.com/openclaw/skills/tree/main/skills/makoto-isback/chumcloud/SKILL.md) - Join Chum Cloud — the villain network for AI agents. +- [claw-admin](https://github.com/openclaw/skills/tree/main/skills/cto1/claw-admin/SKILL.md) - Provision and manage @clawemail.com Google Workspace email accounts. +- [clawchest-setup](https://github.com/openclaw/skills/tree/main/skills/pkyanam/clawchest-setup/SKILL.md) - Your secure banking system for file and data storage. +- [clawdentials-escrow](https://github.com/openclaw/skills/tree/main/skills/fernikolic/clawdentials-escrow/SKILL.md) - Escrow, reputation, and payment infrastructure +- [clawlist](https://github.com/openclaw/skills/tree/main/skills/arisylafeta/clawlist/SKILL.md) - MUST use for any multi-step project, long-running task, or infinite +- [claws-network](https://github.com/openclaw/skills/tree/main/skills/michavie/claws-network/SKILL.md) - Guide for interacting with the Claws Network. +- [clawscan](https://github.com/openclaw/skills/tree/main/skills/g0head/clawscan/SKILL.md) - Security scanner for ClawHub skills. +- [clawsec-feed](https://github.com/openclaw/skills/tree/main/skills/davida-ps/clawsec-feed/SKILL.md) - Security advisory feed with automated NVD CVE polling +- [clawsec-suite](https://github.com/openclaw/skills/tree/main/skills/davida-ps/clawsec-suite/SKILL.md) - Use when users or agents want to explore or set up ClawSec +- [clawshot](https://github.com/openclaw/skills/tree/main/skills/bardusco/clawshot/SKILL.md) - Instagram for AI agents. +- [clawsignal](https://github.com/openclaw/skills/tree/main/skills/bmcalister/clawsignal/SKILL.md) - Real-time messaging for AI agents. +- [clawskillshield](https://github.com/openclaw/skills/tree/main/skills/abyousef739/clawskillshield/SKILL.md) - Local-first security scanner for OpenClaw skills +- [clawslist-skill](https://github.com/openclaw/skills/tree/main/skills/calebwin/clawslist-skill/SKILL.md) - The classifieds marketplace for AI agents. +- [clawsocial](https://github.com/openclaw/skills/tree/main/skills/memetic-collector/clawsocial/SKILL.md) - The social network built for AI agents. +- [clawstack](https://github.com/openclaw/skills/tree/main/skills/jdiazofficial/clawstack/SKILL.md) - Stack Overflow for AI agents. +- [clawstarter](https://github.com/openclaw/skills/tree/main/skills/harrytou/clawstarter/SKILL.md) - The idea platform for the OpenClaw AI agent ecosystem. +- [clawstin](https://github.com/openclaw/skills/tree/main/skills/youens/clawstin/SKILL.md) - Inform users about Clawstin (OpenClaw meetups in Austin), show upcoming +- [clawstr](https://github.com/openclaw/skills/tree/main/skills/derekross/clawstr/SKILL.md) - The decentralized social network for AI agents. +- [cloud-memory](https://github.com/openclaw/skills/tree/main/skills/aerialcombat/cloud-memory/SKILL.md) - Cloud memory for AI agents. +- [cloudflare](https://github.com/openclaw/skills/tree/main/skills/asleep123/wrangler/SKILL.md) - Manage Cloudflare Workers, KV, D1, R2, and secrets using the Wrangler +- [cloudflare-api](https://github.com/openclaw/skills/tree/main/skills/stopmoclay/cloudflare-api/SKILL.md) - Connect to Cloudflare API for DNS management, tunnels +- [cloudflare-dns-updater](https://github.com/openclaw/skills/tree/main/skills/xieyuanqing/cloudflare-dns-updater/SKILL.md) - Creates or updates a proxied Cloudflare DNS +- [clscli](https://github.com/openclaw/skills/tree/main/skills/dbwang0130/clscli/SKILL.md) - Query and analyze Tencent Cloud CLS logs +- [command-center](https://github.com/openclaw/skills/tree/main/skills/jontsai/command-center/SKILL.md) - Mission control dashboard for OpenClaw - real-time session +- [coolify](https://github.com/openclaw/skills/tree/main/skills/visiongeist/coolify/SKILL.md) - Manage Coolify deployments, applications, databases, and services +- [crabwalk](https://github.com/openclaw/skills/tree/main/skills/luccast/crabwalk/SKILL.md) - Real-time companion monitor for OpenClaw agents +- [crawsecure](https://github.com/openclaw/skills/tree/main/skills/diogopaesdev/crawsecure/SKILL.md) - Offline security analysis skill that helps detect unsafe patterns +- [create-new-openclaw-in-gcp](https://github.com/openclaw/skills/tree/main/skills/divide-by-0/create-new-openclaw-in-gcp/SKILL.md) - Deploy OpenClaw to GCP +- [crimson-devlog-agent](https://github.com/openclaw/skills/tree/main/skills/crimsondevil333333/crimson-devlog-agent/SKILL.md) - A standardized journaling skill +- [decision-trees](https://github.com/openclaw/skills/tree/main/skills/evgyur/decision-trees/SKILL.md) - Decision tree analysis for complex decision-making across all +- [deploy-on-render](https://github.com/openclaw/skills/tree/main/skills/ojusave/deploy-on-render/SKILL.md) - Deploy and operate apps on Render +- [devlog-agent-skill](https://github.com/openclaw/skills/tree/main/skills/crimsondevil333333/devlog-agent-skill/SKILL.md) - A standardized journaling skill for OpenClaw +- [devlog-skill](https://github.com/openclaw/skills/tree/main/skills/crimsondevil333333/devlog-skill/SKILL.md) - A standardized journaling skill for OpenClaw agents +- [digital-ocean](https://github.com/openclaw/skills/tree/main/skills/dbhurley/digital-ocean/SKILL.md) - Manage Digital Ocean droplets, domains, and infrastructure +- [docker-ctl](https://github.com/openclaw/skills/tree/main/skills/xejrax/docker-ctl/SKILL.md) - Inspect containers, logs, and images via podman +- [docker-diag](https://github.com/openclaw/skills/tree/main/skills/mkrdiop/docker-diag/SKILL.md) - Advanced log analysis for Docker containers using signal extraction. +- [docker-xunlei-downloader](https://github.com/openclaw/skills/tree/main/skills/saaak/docker-xunlei-downloader/SKILL.md) - A skill that allows OpenClaw to interact +- [dokku](https://github.com/openclaw/skills/tree/main/skills/akhil-naidu/dokku/SKILL.md) - Installs, upgrades, and uses Dokku to create apps, deploy, run. +- [dokploy](https://github.com/openclaw/skills/tree/main/skills/joshuarileydev/dokploy/SKILL.md) - Manage Dokploy deployments, projects, applications, and domains +- [domain-dns-ops](https://github.com/openclaw/skills/tree/main/skills/steipete/domain-dns-ops/SKILL.md) - Domain/DNS ops across Cloudflare, DNSimple. +- [domaindetails](https://github.com/openclaw/skills/tree/main/skills/julianengel/domaindetails/SKILL.md) - Look up domain WHOIS/RDAP info and check marketplace listings. +- [eleutherios](https://github.com/openclaw/skills/tree/main/skills/eleutherios-project/eleutherios/SKILL.md) - Epistemic analysis infrastructure - query knowledge +- [eleutherios-openclaw-skill](https://github.com/openclaw/skills/tree/main/skills/eleutherios-project/eleutherios-openclaw-skill/SKILL.md) - Epistemic analysis +- [esxi](https://github.com/openclaw/skills/tree/main/skills/dlewis7444/esxi/SKILL.md) - Manage VMware ESXi hosts and virtual machines via SSH and vim-cmd. +- [exa-plus](https://github.com/openclaw/skills/tree/main/skills/jordyvandomselaar/exa-plus/SKILL.md) - Neural web search via Exa AI. +- [exe-dev](https://github.com/openclaw/skills/tree/main/skills/bjesuiter/exe-dev/SKILL.md) - Manage persistent VMs on exe.dev. +- [fail2ban-reporter](https://github.com/openclaw/skills/tree/main/skills/jestersimpps/fail2ban-reporter/SKILL.md) - Auto-report fail2ban banned IPs to AbuseIPDB +- [fda-consultant-specialist](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/fda-consultant-specialist/SKILL.md) - FDA regulatory consultant +- [feishu-attendance](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-attendance/SKILL.md) - Monitor Feishu (Lark) attendance records. +- [fieldfix](https://github.com/openclaw/skills/tree/main/skills/blueprintstudioco/fieldfix/SKILL.md) - Query and manage your heavy equipment fleet through FieldFix's +- [flight-lines](https://github.com/openclaw/skills/tree/main/skills/liet-codes/flight-lines/SKILL.md) - Navigate problems along lines of flight by composing operations +- [flyio-cli](https://github.com/openclaw/skills/tree/main/skills/justinburdett/flyio-cli/SKILL.md) - Fly.io deploy, logs, SSH, secrets, scaling. +- [focus-mode](https://github.com/openclaw/skills/tree/main/skills/savorgbot-exe/focus-mode/SKILL.md) - Help users stay focused on a specific goal or task. +- [gateway-monitor-auto-restart](https://github.com/openclaw/skills/tree/main/skills/shirley6692026/gateway-monitor-auto-restart/SKILL.md) - Automatically monitors +- [gcloud](https://github.com/openclaw/skills/tree/main/skills/jortega0033/gcloud/SKILL.md) - Manage Google Cloud Platform resources via gcloud. +- [glance](https://github.com/openclaw/skills/tree/main/skills/acfranzen/glance/SKILL.md) - Create, update, and manage Glance dashboard widgets. +- [glasses-to-social](https://github.com/openclaw/skills/tree/main/skills/junebugg1214/glasses-to-social/SKILL.md) - Turn smart glasses photos into social media posts. +- [godaddy](https://github.com/openclaw/skills/tree/main/skills/rdewolff/godaddy/SKILL.md) - GoDaddy API for managing DNS records. +- [ham-radio-dx](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/ham-radio-dx/SKILL.md) - Monitor DX clusters for rare station spots, track active DX +- [hetzner](https://github.com/openclaw/skills/tree/main/skills/thesethrose/hetzner/SKILL.md) - Hetzner Cloud server management using the hcloud. +- [hetzner-cloud](https://github.com/openclaw/skills/tree/main/skills/pasogott/hetzner-cloud/SKILL.md) - Hetzner Cloud CLI for managing servers, volumes, firewalls +- [hidpi-mouse](https://github.com/openclaw/skills/tree/main/skills/zeyuyuyu/hidpi-mouse/SKILL.md) - Universal HiDPI mouse click handling for Linux desktop automation. +- [host-ping-detect](https://github.com/openclaw/skills/tree/main/skills/ray-778/host-ping-detect/SKILL.md) - Detect if a host (IP: 39.106.7.8) is online by sending ping +- [i-responder](https://github.com/openclaw/skills/tree/main/skills/koba42corp/i-responder/SKILL.md) - Monitor iMessage/SMS conversations and auto-respond based +- [intelligence-suite](https://github.com/openclaw/skills/tree/main/skills/xhrisfu/intelligence-suite/SKILL.md) - Makima's All-Seeing Intelligence Suite. +- [intodns](https://github.com/openclaw/skills/tree/main/skills/rosconl/intodns/SKILL.md) - DNS & email security analysis powered by IntoDNS.ai - scan domains for DNS,. +- [janee](https://github.com/openclaw/skills/tree/main/skills/rsdouglas/janee/SKILL.md) - Secrets management for AI agents. +- [jits-builder](https://github.com/openclaw/skills/tree/main/skills/dannyshmueli/jits-builder/SKILL.md) - Build instant mini-apps from voice or text descriptions. +- [Joan Workflow](https://github.com/openclaw/skills/tree/main/skills/donny-son/joan-workflow/SKILL.md) - This skill should be used when the user asks about "joan" +- [juicy](https://github.com/openclaw/skills/tree/main/skills/mejango/juicy/SKILL.md) - Complete Juicebox V5 protocol skills collection. +- [jules-and-lobster](https://github.com/openclaw/skills/tree/main/skills/sanjacob99/jules-and-lobster/SKILL.md) - Use the Jules REST API (v1alpha) via curl to list +- [jules-cli](https://github.com/openclaw/skills/tree/main/skills/ajstafford/jules-cli/SKILL.md) - Interact with the Jules CLI to manage asynchronous coding sessions. +- [k8-autoscaling](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8-autoscaling/SKILL.md) - Configure Kubernetes autoscaling with HPA, VPA. +- [k8-multicluster](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8-multicluster/SKILL.md) - Manage multiple Kubernetes clusters, switch contexts +- [k8s-backup](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8s-backup/SKILL.md) - Kubernetes backup and restore with Velero. +- [k8s-browser](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8s-browser/SKILL.md) - Browser automation for Kubernetes dashboards and web UIs. +- [k8s-capi](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8s-capi/SKILL.md) - Cluster API lifecycle management for provisioning, scaling, and upgrading. +- [k8s-certs](https://github.com/openclaw/skills/tree/main/skills/rohitg00/k8s-certs/SKILL.md) - Kubernetes certificate management with cert-manager. +- [k8s-skills](https://github.com/openclaw/skills/tree/main/skills/rohitg00) - 6 Kubernetes skills: autoscaling (HPA/VPA/KEDA)... +- [kesslerio-stealth-browser](https://github.com/openclaw/skills/tree/main/skills/kesslerio/kesslerio-stealth-browser/SKILL.md) - Anti-bot browser automation +- [komodo](https://github.com/openclaw/skills/tree/main/skills/weird-aftertaste/komodo/SKILL.md) - Manage Komodo infrastructure - servers, Docker deployments, stacks +- [kubectl-skill](https://github.com/openclaw/skills/tree/main/skills/ddevaal/kubectl/SKILL.md) - Execute and manage Kubernetes clusters via kubectl commands. +- [kubernetes](https://github.com/openclaw/skills/tree/main/skills/kcns008/kubernetes/SKILL.md) - Comprehensive skill for Kubernetes and OpenShift clusters covering +- [linearis](https://github.com/openclaw/skills/tree/main/skills/whoisnnamdi/linearis/SKILL.md) - Linear.app CLI for issue tracking. +- [linux-patcher](https://github.com/openclaw/skills/tree/main/skills/jgm2025/linux-patcher/SKILL.md) - Automated Linux server patching and Docker container updates. +- [location-safety-skill](https://github.com/openclaw/skills/tree/main/skills/sidu/location-safety-skill/SKILL.md) - Location-based safety monitoring with automatic +- [log-analyzer](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/log-analyzer/SKILL.md) - Parse, search, and analyze application logs +- [log-tail](https://github.com/openclaw/skills/tree/main/skills/xejrax/log-tail/SKILL.md) - Stream recent logs from systemd journal +- [macbook-optimizer](https://github.com/openclaw/skills/tree/main/skills/drg3nz0/macbook-optimizer/SKILL.md) - Complete MacBook optimization suite: monitoring +- [mersoom-ai-client](https://github.com/openclaw/skills/tree/main/skills/sampple-korea/mersoom-ai-client/SKILL.md) - Anonymized client for Mersoom (mersoom.vercel.app) +- [meshguard](https://github.com/openclaw/skills/tree/main/skills/dbhurley/meshguard/SKILL.md) - Manage MeshGuard AI agent governance - agents, policies, audit logs +- [minimax-coding-plan-usage](https://github.com/openclaw/skills/tree/main/skills/franky0617/minimax-coding-plan-usage/SKILL.md) - Monitor Minimax Coding Plan usage +- [muse](https://github.com/openclaw/skills/tree/main/skills/alexander-morris/muse/SKILL.md) - Give ClawBot access to your team's entire coding history. +- [n8n-monitor](https://github.com/openclaw/skills/tree/main/skills/smitti7971/n8n-monitor/SKILL.md) - Monitoramento operacional do N8N via Docker. +- [nameserver-reverse](https://github.com/openclaw/skills/tree/main/skills/abtdomain/nameserver-reverse/SKILL.md) - Domain intelligence tools through MCP-compatible +- [nginx-config-creator](https://github.com/openclaw/skills/tree/main/skills/xieyuanqing/nginx-config-creator/SKILL.md) - Creates a standard Nginx/OpenResty reverse +- [nomad](https://github.com/openclaw/skills/tree/main/skills/danfedick/nomad/SKILL.md) - Query HashiCorp Nomad clusters. +- [npm-proxy](https://github.com/openclaw/skills/tree/main/skills/weird-aftertaste/npm-proxy/SKILL.md) - Manage Nginx Proxy Manager (NPM) hosts, certificates, and access +- [openclaw-confluence-skill](https://github.com/openclaw/skills/tree/main/skills/pangin/openclaw-confluence-skill/SKILL.md) - Full Confluence Cloud REST API v2 skill +- [openclaw-nextcloud](https://github.com/openclaw/skills/tree/main/skills/keithvassallomt/openclaw-nextcloud/SKILL.md) - Manage Notes, Tasks, Calendar, Files +- [openclaw-setup](https://github.com/openclaw/skills/tree/main/skills/j540/openclaw-setup/SKILL.md) - Set up a complete OpenClaw personal AI assistant from scratch +- [openclaws](https://github.com/openclaw/skills/tree/main/skills/amoghacloud/openclaws/SKILL.md) - Join the first decentralized social network for AI agents. +- [pi-admin](https://github.com/openclaw/skills/tree/main/skills/thesethrose/pi-admin/SKILL.md) - Raspberry Pi system administration. +- [ping-monitor](https://github.com/openclaw/skills/tree/main/skills/xejrax/ping-monitor/SKILL.md) - ICMP health check for hosts, phones, and daemons +- [plenty-of-claws](https://github.com/openclaw/skills/tree/main/skills/milkehuk-coder/plenty-of-claws/SKILL.md) - Dating-style social network for Clawdbot AI agents. +- [pm2](https://github.com/openclaw/skills/tree/main/skills/asteinberger/pm2/SKILL.md) - Manage Node.js apps with PM2 process manager. +- [podcast-generation](https://github.com/openclaw/skills/tree/main/skills/thegovind/podcast-generation/SKILL.md) - Generate AI-powered podcast-style audio narratives +- [portainer](https://github.com/openclaw/skills/tree/main/skills/asteinberger/portainer/SKILL.md) - Control Docker containers and stacks via Portainer API. +- [premium-domains](https://github.com/openclaw/skills/tree/main/skills/julianengel/premium-domains/SKILL.md) - Search for premium domains for sale across Afternic +- [principle-comparator](https://github.com/openclaw/skills/tree/main/skills/leegitw/principle-comparator/SKILL.md) - Compare two sources to find shared and divergent +- [private-connect](https://github.com/openclaw/skills/tree/main/skills/dantelex/private-connect/SKILL.md) - Access private services by name, from anywhere. +- [proactive-research](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/proactive-research/SKILL.md) - Monitor topics of interest and proactively alert +- [proxmox](https://github.com/openclaw/skills/tree/main/skills/weird-aftertaste/proxmox/SKILL.md) - Manage Proxmox VE clusters via REST API. +- [proxmox-full](https://github.com/openclaw/skills/tree/main/skills/msarheed/proxmox-full/SKILL.md) - Complete Proxmox VE management +- [public](https://github.com/openclaw/skills/tree/main/skills/luccast/public/SKILL.md) - Real-time companion monitor for OpenClaw agents +- [qlik-cloud](https://github.com/openclaw/skills/tree/main/skills/undsoul/qlik-cloud/SKILL.md) - Complete Qlik Cloud analytics platform integration with 37 tools. +- [qlik-cloud-skill](https://github.com/openclaw/skills/tree/main/skills/undsoul/qlik-cloud-skill/SKILL.md) - Complete Qlik Cloud analytics platform integration with 37 +- [r2-storage](https://github.com/openclaw/skills/tree/main/skills/junwatu/r2-storage/SKILL.md) - Cloudflare R2 Storage management — setup, upload, download, sync +- [railway-skill](https://github.com/openclaw/skills/tree/main/skills/leicao-me/railway-skill/SKILL.md) - Deploy and manage applications on Railway.app. +- [rba-rate-intelligence](https://github.com/openclaw/skills/tree/main/skills/tianshizhimao-sudo/rba-rate-intelligence/SKILL.md) - RBA cash rate monitor, meeting +- [remarkable](https://github.com/openclaw/skills/tree/main/skills/nickian/remarkable/SKILL.md) - Send files and web articles to a reMarkable e-ink tablet +- [reverse-proxy-local](https://github.com/openclaw/skills/tree/main/skills/tsheasha/reverse-proxy-local/SKILL.md) - Connect OpenClaw to the internet via Tailscale +- [sec-filing-watcher](https://github.com/openclaw/skills/tree/main/skills/in-liberty420/sec-filing-watcher/SKILL.md) - Monitor SEC EDGAR for new filings and get +- [security-audit](https://github.com/openclaw/skills/tree/main/skills/chandrasekar-r/security-audit/SKILL.md) - Comprehensive security auditing for Clawdbot deployments. +- [security-monitor](https://github.com/openclaw/skills/tree/main/skills/chandrasekar-r/security-monitor/SKILL.md) - Real-time security monitoring for Clawdbot. +- [Send Me My Files - R2 upload with short lived signed urls](https://github.com/openclaw/skills/tree/main/skills/julianengel/r2-upload/SKILL.md) - Upload files +- [senior-devops](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-devops/SKILL.md) - Comprehensive DevOps skill for CI/CD, infrastructure +- [senior-ml-engineer](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-ml-engineer/SKILL.md) - ML engineering skill for productionizing models +- [sentry-cli](https://github.com/openclaw/skills/tree/main/skills/iahmadzain/sentry-cli/SKILL.md) - Sentry.io error monitoring via sentry-cli. +- [servicenow-agent](https://github.com/openclaw/skills/tree/main/skills/thesethrose/servicenow-agent/SKILL.md) - Read-only CLI access to ServiceNow Table, Attachment +- [servicenow-docs](https://github.com/openclaw/skills/tree/main/skills/thesethrose/servicenow-docs/SKILL.md) - Search and retrieve ServiceNow documentation, release +- [skill-exporter](https://github.com/openclaw/skills/tree/main/skills/macstenk/skill-exporter/SKILL.md) - Export Clawdbot skills as standalone, deployable microservices. +- [snapmaker](https://github.com/openclaw/skills/tree/main/skills/lucakaufmann/snapmaker/SKILL.md) - Monitor and control Snapmaker 3D printers +- [solar-weather](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/solar-weather/SKILL.md) - Monitor solar weather conditions including geomagnetic +- [sophie-optimizer](https://github.com/openclaw/skills/tree/main/skills/zayresz/sophie-optimizer/SKILL.md) - Automated context health management for OpenClaw. +- [ssh-essentials](https://github.com/openclaw/skills/tree/main/skills/arnarsson/ssh-essentials/SKILL.md) - Essential SSH commands for secure remote access, key +- [supernote-cloud](https://github.com/openclaw/skills/tree/main/skills/nickian/supernote-cloud/SKILL.md) - Access a self-hosted Supernote Private Cloud instance +- [switchbot](https://github.com/openclaw/skills/tree/main/skills/daaab/switchbot/SKILL.md) - Control SwitchBot smart home devices (curtains, plugs, lights, locks, etc.) +- [sysadmin-toolbox](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/sysadmin-toolbox/SKILL.md) - Tool discovery and shell one-liner reference for sysadmin +- [system-monitor](https://github.com/openclaw/skills/tree/main/skills/zerofire03/system-monitor/SKILL.md) - Check the current CPU, RAM, and GPU status of the local +- [tado](https://github.com/openclaw/skills/tree/main/skills/cgnl/tado/SKILL.md) - Control your Tado smart thermostat - check temperature, set heating, manage. +- [tailscale](https://github.com/openclaw/skills/tree/main/skills/jmagar/tailscale/SKILL.md) - Manage Tailscale tailnet via CLI and API. +- [tailscale-serve](https://github.com/openclaw/skills/tree/main/skills/snopoke/tailscale-serve/SKILL.md) - tailscale-serve +- [task-monitor](https://github.com/openclaw/skills/tree/main/skills/jorgermp/task-monitor/SKILL.md) - Real-time web dashboard for OpenClaw sessions and background tasks. +- [tautulli](https://github.com/openclaw/skills/tree/main/skills/rjmurillo/tautulli/SKILL.md) - Monitor Plex activity and stats via Tautulli API. +- [tavily](https://github.com/openclaw/skills/tree/main/skills/bert-builder/tavily/SKILL.md) - AI-optimized web search using Tavily Search API. +- [tax-planning](https://github.com/openclaw/skills/tree/main/skills/jk-0001/tax-planning/SKILL.md) - Plan and manage taxes effectively as a solopreneur to minimize +- [telecom-agent-skill](https://github.com/openclaw/skills/tree/main/skills/kflohr/telecom-agent-skill/SKILL.md) - Turn your AI Agent into a Telecom Operator. +- [telegram-cloud-storage](https://github.com/openclaw/skills/tree/main/skills/oki3505f/telegram-cloud-storage/SKILL.md) - A high-performance Telegram Cloud Storage +- [tmux-agents](https://github.com/openclaw/skills/tree/main/skills/cuba6112/tmux-agents/SKILL.md) - Manage background coding agents in tmux sessions. +- [topic-monitor](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/topic-monitor/SKILL.md) - Monitor topics of interest and proactively alert +- [trust-protocol](https://github.com/openclaw/skills/tree/main/skills/felmonon/trust-protocol/SKILL.md) - Establish, verify, and maintain trust between AI agents. +- [uncle-matt](https://github.com/openclaw/skills/tree/main/skills/uncmatteth/uncle-matt/SKILL.md) - Uncle Matt is your favorite internet uncle who stops you from doing +- [unraid](https://github.com/openclaw/skills/tree/main/skills/jmagar/unraid/SKILL.md) - Query and monitor Unraid servers via the GraphQL API. +- [uptime-kuma](https://github.com/openclaw/skills/tree/main/skills/msarheed/uptime-kuma/SKILL.md) - Interact with Uptime Kuma monitoring server. +- [uptime-monitor](https://github.com/openclaw/skills/tree/main/skills/kunoiiv/uptime-monitor/SKILL.md) - 24/7 OpenClaw uptime monitor. +- [uv-global](https://github.com/openclaw/skills/tree/main/skills/guoqiao/uv-global/SKILL.md) - Provision and use a global uv environment for ad hoc Python scripts. +- [vast-ai](https://github.com/openclaw/skills/tree/main/skills/sschepis/vast-ai/SKILL.md) - This skill allows you to provision on-demand GPU infrastructure. +- [veeam-mcp](https://github.com/openclaw/skills/tree/main/skills/jgm2025/veeam-mcp/SKILL.md) - Query Veeam Backup & Replication and Veeam ONE via MCP server running +- [vercel](https://github.com/openclaw/skills/tree/main/skills/thesethrose/vercel/SKILL.md) - Deploy applications and manage projects with complete CLI reference. +- [vercel-deploy](https://github.com/openclaw/skills/tree/main/skills/sharanga10/vercel-deploy-claimable/SKILL.md) - Deploy applications and websites to Vercel. +- [vibetunnel](https://github.com/openclaw/skills/tree/main/skills/basher83/vibetunnel/SKILL.md) - Manage VibeTunnel terminal sessions. +- [vision-analyze](https://github.com/openclaw/skills/tree/main/skills/humberto0o0/vision-analyze/SKILL.md) - Analyze images using **Google Cloud Vision API**. +- [wandb-monitor](https://github.com/openclaw/skills/tree/main/skills/chrisvoncsefalvay/wandb-monitor/SKILL.md) - Monitor and analyze Weights & Biases training runs. +- [warden-studio-deploy](https://github.com/openclaw/skills/tree/main/skills/kryptopaid/warden-studio-deploy/SKILL.md) - Use Warden Studio (studio.wardenprotocol.org) +- [web-deploy](https://github.com/openclaw/skills/tree/main/skills/cmanfre7/web-deploy/SKILL.md) - Build and deploy websites, web apps, and APIs to production. +- [ydc-ai-sdk-integration](https://github.com/openclaw/skills/tree/main/skills/edwardirby/ydc-ai-sdk-integration/SKILL.md) - Integrate Vercel AI SDK applications +- [youtube-api](https://github.com/openclaw/skills/tree/main/skills/therohitdas/youtube-api/SKILL.md) - YouTube API access without the official API quota hassle +- [yutori-web-research](https://github.com/openclaw/skills/tree/main/skills/juanpin/yutori-web-research/SKILL.md) - Use Yutori’s Research API and Browsing API +- [zhihu](https://github.com/openclaw/skills/tree/main/skills/keepwonder/zhihu/SKILL.md) - Manage Zhihu (知乎) AI Bot integration. + +
+ +
+

Browser & Automation

+ +- [2captcha](https://github.com/openclaw/skills/tree/main/skills/adinvadim/2captcha/SKILL.md) - Solve CAPTCHAs using 2Captcha service. +- [abm-outbound](https://github.com/openclaw/skills/tree/main/skills/dru-ca/abm-outbound/SKILL.md) - Multi-channel ABM automation that turns LinkedIn URLs +- [accessibility-toolkit](https://github.com/openclaw/skills/tree/main/skills/cgtreadw/accessibility-toolkit/SKILL.md) - Friction-reduction patterns for agents helping +- [activecampaign](https://github.com/openclaw/skills/tree/main/skills/kesslerio/activecampaign/SKILL.md) - ActiveCampaign CRM integration for lead management, deal +- [adcp-advertising](https://github.com/openclaw/skills/tree/main/skills/edyyy62/adcp-advertising/SKILL.md) - Automate advertising campaigns with AI. +- [Agent Browser](https://github.com/openclaw/skills/tree/main/skills/thesethrose/agent-browser/SKILL.md) - A fast Rust-based headless browser automation CLI +- [agent-browser](https://github.com/openclaw/skills/tree/main/skills/murphykobe/agent-browser-2/SKILL.md) - Automates browser interactions for web testing, form +- [agent-zero](https://github.com/openclaw/skills/tree/main/skills/dowingard/agent-zero-bridge/SKILL.md) - Delegate complex coding, research, or autonomous tasks +- [agentmail-integration](https://github.com/openclaw/skills/tree/main/skills/synesthesia-wav/agentmail-integration/SKILL.md) - Integrate AgentMail API for AI agent +- [agentvibes-clawbot-tts](https://github.com/openclaw/skills/tree/main/skills/paulpreibisch/agentvibes-clawbot-tts/SKILL.md) - Apache-2.0. +- [airtable-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/airtable-automation/SKILL.md) - Automate Airtable tasks via Rube MCP (Composio) +- [android-adb](https://github.com/openclaw/skills/tree/main/skills/staticai/android-adb/SKILL.md) - Control Android devices via ADB with support for UI layout analysis. +- [anycrawl](https://github.com/openclaw/skills/tree/main/skills/techlaai/anycrawl/SKILL.md) - AnyCrawl API integration for OpenClaw - Scrape, Crawl, and Search web +- [apify-lead-generation](https://github.com/openclaw/skills/tree/main/skills/jirispilka/apify-lead-generation/SKILL.md) - Generates B2B/B2C leads by scraping Google +- [asr](https://github.com/openclaw/skills/tree/main/skills/ilyakam/asr/SKILL.md) - Fast, accurate, and incredibly inexpensive automatic speech-to-text. +- [atl-mobile](https://github.com/openclaw/skills/tree/main/skills/jordancoin/atl-mobile/SKILL.md) - Mobile browser and native app automation via ATL (iOS Simulator). +- [auto-updater](https://github.com/openclaw/skills/tree/main/skills/maximeprades/auto-updater/SKILL.md) - Automatically update Clawdbot and all installed skills once +- [autofillin](https://github.com/openclaw/skills/tree/main/skills/leohan123123/autofillin/SKILL.md) - Automated web form filling and file uploading skill +- [automation-workflows](https://github.com/openclaw/skills/tree/main/skills/jk-0001/automation-workflows/SKILL.md) - Design and implement automation workflows to save +- [babyconnect](https://github.com/openclaw/skills/tree/main/skills/kesslerio/babyconnect/SKILL.md) - ActiveCampaign CRM integration for lead management, deal tracking +- [bamboohr-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/bamboohr-automation/SKILL.md) - Automate BambooHR tasks via Rube MCP (Composio) +- [basecamp-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/basecamp-automation/SKILL.md) - Automate Basecamp project management, to-dos +- [bits](https://github.com/openclaw/skills/tree/main/skills/robbiethompson18/bits/SKILL.md) - Control browser automation agents via the Bits MCP server. +- [bookmark-intelligence](https://github.com/openclaw/skills/tree/main/skills/bkrigmo1/bookmark-intelligence/SKILL.md) - Turns X bookmarks into actionable insights +- [box-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/box-automation/SKILL.md) - Automate Box cloud storage operations including file +- [browser-ladder](https://github.com/openclaw/skills/tree/main/skills/ktpriyatham/browser-ladder/SKILL.md) - Climb the browser ladder — start free, escalate only +- [browser-use](https://github.com/openclaw/skills/tree/main/skills/shawnpana/browser-use/SKILL.md) - Use Browser Use cloud API to spin up cloud browsers for Clawdbot +- [browsh](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/browsh/SKILL.md) - A modern text-based browser. +- [cal-com-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/cal-com-automation/SKILL.md) - Automate Cal.com tasks via Rube MCP (Composio) +- [camoufox](https://github.com/openclaw/skills/tree/main/skills/goodgoodjm/camoufox/SKILL.md) - Anti-detect browser automation using Camoufox (Firefox-based). +- [camoufox-stealth](https://github.com/openclaw/skills/tree/main/skills/kesslerio/camoufox-stealth/SKILL.md) - C++ level anti-bot browser automation using Camoufox +- [camoufox-stealth-browser](https://github.com/openclaw/skills/tree/main/skills/kesslerio/camoufox-stealth-browser/SKILL.md) - C++ level anti-bot browser automation +- [chatgpt-exporter-ultimate](https://github.com/openclaw/skills/tree/main/skills/globalcaos/chatgpt-exporter-ultimate/SKILL.md) - Export ALL your ChatGPT conversations +- [chirp](https://github.com/openclaw/skills/tree/main/skills/zizi-cat/chirp/SKILL.md) - X/Twitter CLI using OpenClaw browser tool. +- [claude-chrome](https://github.com/openclaw/skills/tree/main/skills/dgriffin831/claude-chrome/SKILL.md) - Use Claude Code with Chrome browser extension for web +- [claw-control](https://github.com/openclaw/skills/tree/main/skills/adarshmishra07/claw-control/SKILL.md) - Complete AI agent operating system setup with Kanban task +- [clawbrowser](https://github.com/openclaw/skills/tree/main/skills/tezatezaz/clawbrowser/SKILL.md) - Use when the agent needs to drive a browser through the Microsoft +- [clawcontrol](https://github.com/openclaw/skills/tree/main/skills/adarshmishra07/clawcontrol/SKILL.md) - Complete AI agent operating system setup with Kanban task +- [clawdbot-jira-skill](https://github.com/openclaw/skills/tree/main/skills/kyjus25/clawdbot-jira-skill/SKILL.md) - Manage Jira issues, transitions, and worklogs +- [clawdiscover](https://github.com/openclaw/skills/tree/main/skills/x4v13r1120/clawdiscover/SKILL.md) - Discover new tools and services for your agent. +- [clawflows](https://github.com/openclaw/skills/tree/main/skills/cluka-399/clawflows/SKILL.md) - Search, install, and run multi-skill automations from clawflows.com. +- [context-compressor](https://github.com/openclaw/skills/tree/main/skills/maddiedreese/context-compressor/SKILL.md) - Automated context management for long-running +- [context-recovery](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/context-recovery/SKILL.md) - Automatically recover working context after session +- [context7](https://github.com/openclaw/skills/tree/main/skills/am-will/context7-api/SKILL.md) - |. +- [crawl](https://github.com/openclaw/skills/tree/main/skills/barneyjm/crawl/SKILL.md) - Crawl any website and save pages as local markdown files. +- [ct-accessibility-toolkit](https://github.com/openclaw/skills/tree/main/skills/ctsolutionsdev/ct-accessibility-toolkit/SKILL.md) - Friction-reduction patterns +- [daily-rhythm](https://github.com/openclaw/skills/tree/main/skills/anthonyfrancis/daily-rhythm/SKILL.md) - Automated daily planning and reflection system with morning +- [db-query](https://github.com/openclaw/skills/tree/main/skills/zenixp/db-query/SKILL.md) - Query project databases with automatic SSH tunnel management. +- [deep-scraper](https://github.com/openclaw/skills/tree/main/skills/opsun/deep-scraper/SKILL.md) - A high-performance engineering tool for deep web scraping. +- [demo-video](https://github.com/openclaw/skills/tree/main/skills/cyberfront-ai/demo-video/SKILL.md) - Create product demo videos by automating browser interactions +- [desktop-control](https://github.com/openclaw/skills/tree/main/skills/matagul/desktop-control/SKILL.md) - Advanced desktop automation with mouse, keyboard, and screen +- [desktop-control-1-0-0](https://github.com/openclaw/skills/tree/main/skills/wpegley/desktop-control-1-0-0/SKILL.md) - Advanced desktop automation with mouse, keyboard +- [double729-plansuite](https://github.com/openclaw/skills/tree/main/skills/double729/double729-plansuite/SKILL.md) - Unified planning+execution workflow: create +- [echodecks-clawdbot-skill](https://github.com/openclaw/skills/tree/main/skills/drgeld/echodecks-clawdbot-skill/SKILL.md) - Integrates with the EchoDecks External API +- [fast-browser-use](https://github.com/openclaw/skills/tree/main/skills/rknoche6/fast-browser-use/SKILL.md) - A Rust-based browser automation engine that provides +- [feishu-doc](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-doc/SKILL.md) - Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. +- [firecrawl-search](https://github.com/openclaw/skills/tree/main/skills/ashwingupy/firecrawl-search/SKILL.md) - Web search and scraping via Firecrawl API. +- [firecrawl-skills](https://github.com/openclaw/skills/tree/main/skills/leonardogrig/firecrawl-skills/SKILL.md) - Firecrawl CLI for web scraping, crawling, and search. +- [firecrawler](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/firecrawler/SKILL.md) - Web scraping and crawling with Firecrawl API. +- [flstudio-scripting](https://github.com/openclaw/skills/tree/main/skills/delorenj/flstudio-scripting/SKILL.md) - FL Studio Python scripting for MIDI controller +- [food402](https://github.com/openclaw/skills/tree/main/skills/rersozlu/food402/SKILL.md) - Order food from TGO Yemek (Trendyol GO), Turkey's leading food delivery +- [frinkiac](https://github.com/openclaw/skills/tree/main/skills/ryantenney/frinkiac/SKILL.md) - Search TV show screenshots and generate memes from The Simpsons +- [functions](https://github.com/openclaw/skills/tree/main/skills/peytoncasper/functions/SKILL.md) - Guide Claude through deploying serverless browser automation +- [gdpr-dsgvo-expert](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/gdpr-dsgvo-expert/SKILL.md) - GDPR and German DSGVO compliance automation. +- [google-web-search](https://github.com/openclaw/skills/tree/main/skills/theoseo/google-web-search/SKILL.md) - Enables grounded question answering by automatically +- [guru-mcp](https://github.com/openclaw/skills/tree/main/skills/pvoo/guru-mcp/SKILL.md) - Access Guru knowledge base via MCP - ask AI questions, search documents +- [hass-cli](https://github.com/openclaw/skills/tree/main/skills/ericarnoldy/hass-cli/SKILL.md) - Control Home Assistant devices and automations via hass-cli. +- [home-assistant](https://github.com/openclaw/skills/tree/main/skills/iahmadzain/home-assistant/SKILL.md) - Control Home Assistant smart home devices, run automations +- [hooks-automation](https://github.com/openclaw/skills/tree/main/skills/adolago/hooks-automation/SKILL.md) - Automated coordination, formatting, and learning +- [inkedin-automation-that-really-works](https://github.com/openclaw/skills/tree/main/skills/red777777/inkedin-automation-that-really-works/SKILL.md) - LinkedIn automation +- [job-auto-apply](https://github.com/openclaw/skills/tree/main/skills/veeky-kumar/job-auto-apply/SKILL.md) - Automated job search and application system for Clawdbot. +- [kakiyo](https://github.com/openclaw/skills/tree/main/skills/cyberboyayush/kakiyo/SKILL.md) - Official Kakiyo skill from Kakiyo.com for managing LinkedIn automation. +- [lead-hunter](https://github.com/openclaw/skills/tree/main/skills/galacticpuffin/lead-hunter/SKILL.md) - Automated lead generation + enrichment for AI agents. +- [leadklick](https://github.com/openclaw/skills/tree/main/skills/big-roman123/leadklick/SKILL.md) - Capture leads into a centralized Supabase database with automatic +- [lightpanda-browser](https://github.com/openclaw/skills/tree/main/skills/krichprollsch/lightpanda-browser/SKILL.md) - Lightpanda browser, drop-in replacement +- [loom-workflow](https://github.com/openclaw/skills/tree/main/skills/g9pedro/loom-workflow/SKILL.md) - AI-native workflow analyzer for Loom recordings. +- [lovetago-bot-tinder](https://github.com/openclaw/skills/tree/main/skills/lakyfx/lovetago-bot-tinder/SKILL.md) - Public AI dating platform for agents. +- [mcporter](https://github.com/openclaw/skills/tree/main/skills/steipete/mcporter/SKILL.md) - Use the mcporter CLI to list, configure, auth, and call MCP servers/tools. +- [mia-twitter-stealth](https://github.com/openclaw/skills/tree/main/skills/arubiku/mia-twitter-stealth/SKILL.md) - Twitter/X automation with advanced stealth +- [mini-piv](https://github.com/openclaw/skills/tree/main/skills/smokealot420/mini-piv/SKILL.md) - Lightweight PIV workflow - discovery-driven feature builder. +- [moltcombinator](https://github.com/openclaw/skills/tree/main/skills/brookswood/moltcombinator/SKILL.md) - The equity marketplace for AI agents. +- [moltpad](https://github.com/openclaw/skills/tree/main/skills/webeferen/moltpad/SKILL.md) - Connects to Moltpad.space to read, write, and publish literary content. +- [moltpad-app](https://github.com/openclaw/skills/tree/main/skills/webeferen/moltpad-app/SKILL.md) - Connects to Moltpad.space to read, write, and publish literary +- [moltpad-skill](https://github.com/openclaw/skills/tree/main/skills/kamail12/moltpad-skill/SKILL.md) - Connects to Moltpad.space to read, write, and publish literary +- [monzo](https://github.com/openclaw/skills/tree/main/skills/rhesketh/monzo/SKILL.md) - Access Monzo bank account - check balance, view transactions, manage pots, send. +- [n8n-api](https://github.com/openclaw/skills/tree/main/skills/codedao12/n8n-api/SKILL.md) - Operate n8n via its public REST API from OpenClaw. +- [n8n-automation](https://github.com/openclaw/skills/tree/main/skills/dilomcfly/n8n-automation/SKILL.md) - Manage n8n workflows from OpenClaw via the n8n REST API. +- [n8n-hub](https://github.com/openclaw/skills/tree/main/skills/codedao12/n8n-hub/SKILL.md) - Centralized n8n hub for designing reliable flows +- [newsletter-creation-curation](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm/newsletter-creation-curation/SKILL.md) - Industry-specific newsletter +- [next-browser](https://github.com/openclaw/skills/tree/main/skills/highxshell/next-browser/SKILL.md) - Use Nextbrowser cloud API to spin up cloud browsers for Openclaw +- [odoo-openclaw-skill](https://github.com/openclaw/skills/tree/main/skills/ashrf-in/odoo-openclaw-skill/SKILL.md) - Advanced Odoo financial intelligence tool +- [opengraph-io-skill](https://github.com/openclaw/skills/tree/main/skills/primeobsession/opengraph-io-skill/SKILL.md) - Extract web data, capture screenshots, scrape +- [openkm-rest](https://github.com/openclaw/skills/tree/main/skills/pes0/openkm-rest/SKILL.md) - OpenKM Document Management via REST API +- [optimize-context](https://github.com/openclaw/skills/tree/main/skills/blackworm/optimize-context/SKILL.md) - This package contains two powerful OpenClaw skills +- [organize-tg](https://github.com/openclaw/skills/tree/main/skills/consort-tech/organize-tg/SKILL.md) - Organize TG by Consort Technologies - Automatically scan +- [phantombuster](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/phantombuster/SKILL.md) - Control PhantomBuster automation agents via API. +- [plansuite](https://github.com/openclaw/skills/tree/main/skills/double729/plansuite/SKILL.md) - Unified planning+execution workflow: create a file-based plan +- [playwright-cli](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/playwright-cli/SKILL.md) - Browser automation via Playwright CLI. +- [playwriter](https://github.com/openclaw/skills/tree/main/skills/paulpete/playwriter/SKILL.md) - Browser automation via Playwriter (remorses) using persistent Chrome +- [podman-browser](https://github.com/openclaw/skills/tree/main/skills/ricardodantas/podman-browser/SKILL.md) - Headless browser automation using Podman + Playwright +- [pokerpal](https://github.com/openclaw/skills/tree/main/skills/vvardhan14/pokerpal/SKILL.md) - Query PokerPal poker game data - games, players, buy-ins, settlements. +- [proxy-scrap](https://github.com/openclaw/skills/tree/main/skills/danman60/proxy-scrap/SKILL.md) - High-Performance Proxy Harvesting - Automatically scrape, validate +- [qiuqiu-helper](https://github.com/openclaw/skills/tree/main/skills/mmogdeveloper/qiuqiu-helper/SKILL.md) - This is a multi-purpose helper skill for Jesse, designed +- [reposit](https://github.com/openclaw/skills/tree/main/skills/tomasz-tomczyk/reposit/SKILL.md) - Community knowledge sharing for AI agents - search, share, and vote +- [riddle](https://github.com/openclaw/skills/tree/main/skills/davisdiehl/riddle/SKILL.md) - Hosted browser automation API for agents. +- [roon-controller](https://github.com/openclaw/skills/tree/main/skills/puterjam/roon-controller/SKILL.md) - Control Roon music player through Roon API with automatic +- [safe-exec](https://github.com/openclaw/skills/tree/main/skills/ottttto/safe-exec/SKILL.md) - Safe command execution for OpenClaw Agents with automatic danger pattern. +- [sales-bot](https://github.com/openclaw/skills/tree/main/skills/big-roman123/sales-bot/SKILL.md) - Capture leads into a centralized Supabase database with automatic +- [self-evolving-skill](https://github.com/openclaw/skills/tree/main/skills/whtoo/self-evolving-skill/SKILL.md) - Meta-cognitive self-learning system - Automated skill +- [serper](https://github.com/openclaw/skills/tree/main/skills/nesdeq/serper/SKILL.md) - Google search via Serper API with full page content extraction. +- [smart-image-loader](https://github.com/openclaw/skills/tree/main/skills/tingwei1123/smart-image-loader/SKILL.md) - Smart image loader that handles both URLs and local +- [smooth-browser](https://github.com/openclaw/skills/tree/main/skills/antoniocirclemind/smooth-browser/SKILL.md) - PREFERRED BROWSER - Browser for AI agents to carry +- [smoothbrowser](https://github.com/openclaw/skills/tree/main/skills/antoniocirclemind/smoothbrowser/SKILL.md) - PREFERRED BROWSER - Browser for AI agents to carry out +- [soul-guardian](https://github.com/openclaw/skills/tree/main/skills/davida-ps/soul-guardian/SKILL.md) - Drift detection + baseline integrity guard for agent workspace +- [spool](https://github.com/openclaw/skills/tree/main/skills/zizi-cat/spool/SKILL.md) - Threads CLI - Read, post, reply, and search on Meta's Threads using OpenClaw. +- [stagehand-browser-cli](https://github.com/openclaw/skills/tree/main/skills/peytoncasper/stagehand-browser-cli/SKILL.md) - Automate web browser interactions +- [stealth-browser](https://github.com/openclaw/skills/tree/main/skills/mayuqi-crypto/stealth-browser/SKILL.md) - Ultimate stealth browser automation +- [stealthy-auto-browse](https://github.com/openclaw/skills/tree/main/skills/psyb0t/stealthy-auto-browse/SKILL.md) - Control a stealthy browser that evades bot detection +- [stremio-cast](https://github.com/openclaw/skills/tree/main/skills/pedro-valentim/stremio-cast/SKILL.md) - Busca conteúdo no Stremio Web e transmite para dispositivos +- [suno-automation](https://github.com/openclaw/skills/tree/main/skills/upstatemovingimages-cmyk/suno-automation/SKILL.md) - This skill allows the agent to control Suno +- [suno-browser-songmaking](https://github.com/openclaw/skills/tree/main/skills/machinesbefree/suno-browser-songmaking/SKILL.md) - Browser-based song creation with Suno +- [super-skills](https://github.com/openclaw/skills/tree/main/skills/10e9928a/super-skills/SKILL.md) - Decomposes complex user requests into executable subtasks +- [tcm-video-factory](https://github.com/openclaw/skills/tree/main/skills/xaotiensinh-abm/tcm-video-factory/SKILL.md) - Automate health video production planning +- [tekin](https://github.com/openclaw/skills/tree/main/skills/gwqwghksvq-sketch/tekin/SKILL.md) - A fast Rust-based headless browser automation CLI with Node.js fallback +- [tiangong-notebooklm-cli](https://github.com/openclaw/skills/tree/main/skills/fadeloo/tiangong-notebooklm-cli/SKILL.md) - NotebookLM CLI wrapper via `node +- [tiangong-wps-ppt-automation](https://github.com/openclaw/skills/tree/main/skills/fadeloo/tiangong-wps-ppt-automation/SKILL.md) - Automate common PowerPoint/WPS +- [tiangong-wps-word-automation](https://github.com/openclaw/skills/tree/main/skills/fadeloo/tiangong-wps-word-automation/SKILL.md) - Automate common Word/WPS document +- [tinyfish-web-agent](https://github.com/openclaw/skills/tree/main/skills/simantak-dabhade/tinyfish-web-agent/SKILL.md) - Use TinyFish/Mino web agent to extract/scrape +- [turix-computer-use](https://github.com/openclaw/skills/tree/main/skills/tongyu-yan/turix-computer-use/SKILL.md) - Computer Use Agent (CUA) for macOS automation +- [turix-cua](https://github.com/openclaw/skills/tree/main/skills/tongyu-yan/turix-cua/SKILL.md) - Computer Use Agent (CUA) for macOS automation using TuriX. +- [verify-on-browser](https://github.com/openclaw/skills/tree/main/skills/myestery/verify-on-browser/SKILL.md) - Control browser via Chrome DevTools Protocol - full CDP +- [vocal-chat](https://github.com/openclaw/skills/tree/main/skills/rubenfb23/vocal-chat/SKILL.md) - Handles voice-to-voice conversations on WhatsApp. +- [web-qa-bot](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/web-qa-bot/SKILL.md) - AI-powered web application QA automation +- [windows-control](https://github.com/openclaw/skills/tree/main/skills/spliff7777/windows-control/SKILL.md) - Full Windows desktop control. +- [wojak-ink](https://github.com/openclaw/skills/tree/main/skills/koba42corp/wojak-ink/SKILL.md) - Browse, search, and analyze Wojak Farmers Plot NFTs from the wojak.ink. +- [workflowy](https://github.com/openclaw/skills/tree/main/skills/waldyrious/workflowy/SKILL.md) - Workflowy outliner CLI for reading, searching, and editing nodes. +- [x-articles](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/x-articles/SKILL.md) - Publish viral X (Twitter) Articles with AI. +- [xiaohongshu-mcp](https://github.com/openclaw/skills/tree/main/skills/pxfeng/xiaohongshu-mcp/SKILL.md) - Upload images and videos to Xiaohongshu Creator Platform +- [zellij](https://github.com/openclaw/skills/tree/main/skills/jivvei/zellij/SKILL.md) - Remote-control zellij sessions for interactive CLIs by sending keystrokes + +
+ +
+

Image & Video Generation

+ +- [afame](https://github.com/openclaw/skills/tree/main/skills/adebayoabdushaheed-a11y/afame/SKILL.md) - Generate diverse creative illustrations via OpenAI Images API. +- [agentos-mesh](https://github.com/openclaw/skills/tree/main/skills/agentossoftware/agentos-mesh/SKILL.md) - Enables real-time communication between AI agents +- [ai-video-gen](https://github.com/openclaw/skills/tree/main/skills/rhanbourinajd/ai-video-gen/SKILL.md) - End-to-end AI video generation - create videos from text +- [algorithmic-art](https://github.com/openclaw/skills/tree/main/skills/seanphan/algorithmic-art/SKILL.md) - Creating algorithmic art using p5.js with seeded randomness +- [atxp](https://github.com/openclaw/skills/tree/main/skills/emilioacc/atxp/SKILL.md) - Access ATXP paid API tools for web search, AI image generation, music creation,. +- [beauty-generation-api](https://github.com/openclaw/skills/tree/main/skills/luruibu/beauty-generation-api/SKILL.md) - FREE AI image generation service for creating +- [cad-agent](https://github.com/clawdbot/skills/tree/main/skills/clawd-maf/cad-agent/SKILL.md) - Rendering server for AI agents doing CAD work. +- [canva-connect](https://github.com/openclaw/skills/tree/main/skills/coolmanns/canva-connect/SKILL.md) - Manage Canva designs, assets, and folders via the Connect API. +- [captions](https://github.com/openclaw/skills/tree/main/skills/therohitdas/captions/SKILL.md) - Extract closed captions and subtitles from YouTube videos. +- [chart-image](https://github.com/openclaw/skills/tree/main/skills/dannyshmueli/chart-image/SKILL.md) - Generate publication-quality chart images from data. +- [clinkding](https://github.com/openclaw/skills/tree/main/skills/daveonkels/clinkding/SKILL.md) - Manage linkding bookmarks - save URLs, search, tag, organize +- [coloring-page](https://github.com/openclaw/skills/tree/main/skills/borahm/coloring-page/SKILL.md) - Turn an uploaded photo into a printable black-and-white coloring +- [comfy-cli](https://github.com/openclaw/skills/tree/main/skills/johntheyoung/comfy-cli/SKILL.md) - Install, manage, and run ComfyUI instances. +- [comfyui](https://github.com/openclaw/skills/tree/main/skills/xtopher86/comfyui-request/SKILL.md) - Send a workflow request to ComfyUI and return image results. +- [Excalidraw Flowchart](https://github.com/openclaw/skills/tree/main/skills/swiftlysingh/excalidraw-flowchart/SKILL.md) - Create Excalidraw flowcharts from descriptions. +- [fal-ai](https://github.com/openclaw/skills/tree/main/skills/agmmnn/fal-ai/SKILL.md) - Generate images, videos, and audio via fal.ai API (FLUX, SDXL, Whisper, etc.). +- [fal-text-to-image](https://github.com/openclaw/skills/tree/main/skills/delorenj/fal-text-to-image/SKILL.md) - Generate, remix, and edit images using fal.ai's AI +- [ffmpeg-video-editor](https://github.com/openclaw/skills/tree/main/skills/mahmoudadelbghany/ffmpeg-video-editor/SKILL.md) - Generate FFmpeg commands from natural +- [figma](https://github.com/openclaw/skills/tree/main/skills/maddiedreese/figma/SKILL.md) - Professional Figma design analysis and asset export. +- [find-stl](https://github.com/openclaw/skills/tree/main/skills/ajmwagar/find-stl/SKILL.md) - Search and download ready-to-print 3D model files (STL/3MF/ZIP) +- [gamma](https://github.com/openclaw/skills/tree/main/skills/stopmoclay/gamma/SKILL.md) - Generate AI-powered presentations, documents, and social posts using Gamma.app. +- [gifhorse](https://github.com/openclaw/skills/tree/main/skills/coyote-git/gifhorse/SKILL.md) - Search video dialogue and create reaction GIFs with timed subtitles. +- [google-gemini-media](https://github.com/openclaw/skills/tree/main/skills/xsir0/google-gemini-media/SKILL.md) - Use the Gemini API +- [heygen-avatar-lite](https://github.com/openclaw/skills/tree/main/skills/daaab/heygen-avatar-lite/SKILL.md) - Create AI digital human videos with HeyGen API. +- [iblipper](https://github.com/openclaw/skills/tree/main/skills/andyed/iblipper/SKILL.md) - Generate kinetic typography animations for expressive agent-to-human. +- [image-resize](https://github.com/openclaw/skills/tree/main/skills/pr1vateer/image-resize/SKILL.md) - Resize images using ImageMagick (CLI). +- [kameo](https://github.com/openclaw/skills/tree/main/skills/veya2ztn/kameo/SKILL.md) - Generate expressive talking-head videos from static images using Kameo AI. +- [kameo-free](https://github.com/openclaw/skills/tree/main/skills/veya2ztn/kameo-free/SKILL.md) - Generate expressive talking-head videos from static images using Kameo +- [krea-api](https://github.com/openclaw/skills/tree/main/skills/fossilizedcarlos/krea-api/SKILL.md) - Generate images via Krea.ai API +- [liveavatar](https://github.com/openclaw/skills/tree/main/skills/ennno/liveavatar/SKILL.md) - Talk face-to-face with your OpenClaw agent using a real-time video avatar. +- [meshtastic-skill](https://github.com/openclaw/skills/tree/main/skills/lukevr/meshtastic-skill/SKILL.md) - Send and receive messages via Meshtastic LoRa mesh network. +- [meshy-ai](https://github.com/openclaw/skills/tree/main/skills/sabatesduran/clawdbot-meshyai-skill/SKILL.md) - Use the Meshy.ai REST API to generate assets: (1) +- [milesluman-essence](https://github.com/openclaw/skills/tree/main/skills/milesluman/milesluman-essence/SKILL.md) - To achieve symbiosis between technology and humanity +- [narrator](https://github.com/openclaw/skills/tree/main/skills/buddyh/narrator/SKILL.md) - Live narration of your screen activity with 7 styles +- [nvidia-image-gen](https://github.com/openclaw/skills/tree/main/skills/ty-teo/nvidia-image-gen/SKILL.md) - Generate and edit images using NVIDIA FLUX models. +- [pikaboard](https://github.com/openclaw/skills/tree/main/skills/angelstreet/pikaboard/SKILL.md) - Interact with PikaBoard task management API. +- [pollinations](https://github.com/openclaw/skills/tree/main/skills/isaacgounton/pollinations/SKILL.md) - Pollinations.ai API for AI generation - text, images, videos +- [pr-demo](https://github.com/openclaw/skills/tree/main/skills/paulpete/pr-demo/SKILL.md) - Use when creating animated demos (GIFs) for pull requests or documentation. +- [primattography-color-science](https://github.com/openclaw/skills/tree/main/skills/primattography/primattography-color-science/SKILL.md) - Ultimate DaVinci Resolve +- [qr-code](https://github.com/openclaw/skills/tree/main/skills/omar-khaleel/qr-code/SKILL.md) - Generate and read QR codes. +- [qr-code-intelligence](https://github.com/openclaw/skills/tree/main/skills/omar-khaleel/qr-code-intelligence/SKILL.md) - Generate and read QR codes. +- [qr-code-pro](https://github.com/openclaw/skills/tree/main/skills/omar-khaleel/qr-code-pro/SKILL.md) - Generate and read QR codes. +- [recraft](https://github.com/openclaw/skills/blob/main/skills/nkrcrft/recraft/SKILL.md) - Generate, vectorize, upscale, replace backgroun... +- [render-stl-png](https://github.com/openclaw/skills/tree/main/skills/ajmwagar/render-stl-png/SKILL.md) - Render an STL to a PNG from a nice, consistent 3D angle +- [renderful-ai](https://github.com/openclaw/skills/tree/main/skills/luv005/renderful-ai/SKILL.md) - Generate images and videos via renderful.ai API +- [reve-ai](https://github.com/openclaw/skills/tree/main/skills/dpaluy/reve-ai/SKILL.md) - Reve AI image generation, editing. +- [runware](https://github.com/openclaw/skills/tree/main/skills/26medias/runware/SKILL.md) - Generate images and videos via Runware API. +- [sora-video-gen](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/sora-video-gen/SKILL.md) - Generate videos using OpenAI's Sora API. +- [sticker-analyzer](https://github.com/openclaw/skills/tree/main/skills/autogame-17/sticker-analyzer/SKILL.md) - Analyze images in media/stickers using Vision API +- [subtitles](https://github.com/openclaw/skills/tree/main/skills/therohitdas/subtitles/SKILL.md) - Get subtitles from YouTube videos for translation, language learning +- [superdesign](https://github.com/openclaw/skills/tree/main/skills/mpociot/superdesign/SKILL.md) - Expert frontend design guidelines for modern. +- [svg-draw](https://github.com/openclaw/skills/tree/main/skills/lijy2015/svg-draw/SKILL.md) - Create SVG images and convert them to PNG without external graphics +- [tube-summary](https://github.com/openclaw/skills/tree/main/skills/dillera/tube-summary/SKILL.md) - Search YouTube for videos on any topic and get intelligent +- [vap-multimedia-generation](https://github.com/openclaw/skills/tree/main/skills/elestirelbilinc-sketch/vap-multimedia-generation/SKILL.md) - AI image, video. +- [venice-ai](https://github.com/openclaw/skills/tree/main/skills/nhannah/venice-ai-media/SKILL.md) - Generate, edit, and upscale images; create videos from images +- [veo](https://github.com/openclaw/skills/tree/main/skills/buddyh/veo/SKILL.md) - Generate video using Google Veo (Veo 3.1 / Veo 3.0). +- [veo3-video-gen](https://github.com/openclaw/skills/tree/main/skills/bluelyw/veo3-video-gen/SKILL.md) - Generate and stitch short videos via Google Veo 3.x +- [video-frames](https://github.com/openclaw/skills/tree/main/skills/steipete/video-frames/SKILL.md) - Extract frames or short clips from videos using ffmpeg. +- [westland-linguistic-humidifier](https://github.com/openclaw/skills/tree/main/skills/westland/westland-linguistic-humidifier/SKILL.md) - Proactively identifies +- [yollomi](https://github.com/openclaw/skills/tree/main/skills/anichikage/yollomi/SKILL.md) - Generate AI images and videos using Yollomi API. + +
+ +
+

Apple Apps & Services

+ +- [alter-actions](https://github.com/openclaw/skills/tree/main/skills/olivieralter/alter-actions/SKILL.md) - Trigger Alter macOS app actions via x-callback-urls. +- [apple-contacts](https://github.com/openclaw/skills/tree/main/skills/tyler6204/apple-contacts/SKILL.md) - Look up contacts from macOS Contacts.app. +- [apple-mail-search](https://github.com/openclaw/skills/tree/main/skills/mneves75/apple-mail-search/SKILL.md) - Fast Apple Mail search via SQLite on macOS. +- [apple-music](https://github.com/openclaw/skills/tree/main/skills/tyler6204/apple-music/SKILL.md) - Search Apple Music, add songs to library, manage playlists, control +- [apple-photos](https://github.com/openclaw/skills/tree/main/skills/tyler6204/apple-photos/SKILL.md) - Apple Photos.app integration for macOS. +- [apple-remind-me](https://github.com/openclaw/skills/tree/main/skills/plgonzalezrx8/apple-remind-me/SKILL.md) - Natural language reminders that create actual Apple +- [appletv](https://github.com/openclaw/skills/tree/main/skills/lucakaufmann/appletv/SKILL.md) - Control Apple TV via pyatv. +- [caffeine](https://github.com/openclaw/skills/tree/main/skills/bunsdev/caffeine/SKILL.md) - Prevent the computer screen and system from falling asleep on macOS +- [callmac](https://github.com/openclaw/skills/tree/main/skills/jooey/callmac/SKILL.md) - Remote voice control for Mac from mobile devices using commands like /callmac. +- [clawdbot-macos-build](https://github.com/openclaw/skills/tree/main/skills/manish-basargekar/clawdbot-macos-build/SKILL.md) - Build the Clawdbot macOS menu bar app +- [clawdbot-skill-voice-wake-say](https://github.com/openclaw/skills/tree/main/skills/xadenryan/clawdbot-skill-voice-wake-say/SKILL.md) - Speak responses aloud on macOS +- [drafts](https://github.com/openclaw/skills/tree/main/skills/nerveband/drafts/SKILL.md) - Manage Drafts app notes via CLI on macOS. +- [findmy-location](https://github.com/openclaw/skills/tree/main/skills/poiley/findmy-location/SKILL.md) - Track a shared contact's location via Apple Find +- [fzf-fuzzy-finder](https://github.com/openclaw/skills/tree/main/skills/arnarsson/fzf-fuzzy-finder/SKILL.md) - Command-line fuzzy finder for interactive filtering +- [get-focus-mode](https://github.com/openclaw/skills/tree/main/skills/nickchristensen/get-focus-mode/SKILL.md) - Get the current macOS Focus. +- [healthkit-sync](https://github.com/openclaw/skills/tree/main/skills/mneves75/healthkit-sync/SKILL.md) - iOS HealthKit data sync CLI commands and patterns. +- [hergunmac](https://github.com/openclaw/skills/tree/main/skills/ahmetsemsettinozdemirden/hergunmac/SKILL.md) - Access AI-powered football match predictions +- [homebrew](https://github.com/openclaw/skills/tree/main/skills/thesethrose/homebrew/SKILL.md) - Homebrew package manager for macOS. +- [homekit](https://github.com/openclaw/skills/tree/main/skills/alphafactor/homekit/SKILL.md) - Control Apple HomeKit smart home devices. +- [hotel-finder-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/hotel-finder-teneo/SKILL.md) - Hotel discovery tool for European cities. +- [icloud-findmy](https://github.com/openclaw/skills/tree/main/skills/liamnichols/icloud-findmy/SKILL.md) - Query Find My locations and battery status for family devices +- [inkjet](https://github.com/openclaw/skills/tree/main/skills/aaronchartier/inkjet/SKILL.md) - Print text, images, and QR codes to a wireless Bluetooth thermal printer +- [mac-tts](https://github.com/openclaw/skills/tree/main/skills/kalijason/mac-tts/SKILL.md) - Text-to-speech using macOS built-in `say` command. +- [media-backup](https://github.com/openclaw/skills/tree/main/skills/dbhurley/media-backup/SKILL.md) - Archive Clawdbot conversation media (photos, videos) to a local +- [meow-finder](https://github.com/openclaw/skills/tree/main/skills/abgohel/meow-finder/SKILL.md) - CLI tool to discover AI tools. +- [mlx-stt](https://github.com/openclaw/skills/tree/main/skills/guoqiao/mlx-stt/SKILL.md) - Speech-To-Text with MLX (Apple Silicon) and GLM-ASR-Nano-2512 locally. +- [mlx-swift-lm](https://github.com/openclaw/skills/tree/main/skills/ronaldmannak/mlx-swift-lm/SKILL.md) - MLX Swift LM - Run LLMs and VLMs on Apple Silicon using MLX. +- [mole-mac-cleanup](https://github.com/openclaw/skills/tree/main/skills/bjesuiter/mole-mac-cleanup/SKILL.md) - Mac cleanup & optimization tool combining CleanMyMac +- [my-tesla](https://github.com/openclaw/skills/tree/main/skills/officialpm/my-tesla/SKILL.md) - Control Tesla vehicles from macOS via the Tesla Owner API using teslapy +- [network-scanner](https://github.com/openclaw/skills/tree/main/skills/florianbeer/network-scanner/SKILL.md) - Scan networks to discover devices, gather MAC addresses +- [pattern-finder](https://github.com/openclaw/skills/tree/main/skills/leegitw/pattern-finder/SKILL.md) - Discover what two sources agree on — find the signal +- [shortcuts-generator](https://github.com/openclaw/skills/tree/main/skills/erik-agens/shortcuts-skill/SKILL.md) - Generate macOS/iOS Shortcuts by creating plist files. +- [skill-email-management](https://github.com/openclaw/skills/tree/main/skills/latisen/skill-email-management/SKILL.md) - Expert email management assistant for Apple +- [voice-wake-say](https://github.com/openclaw/skills/tree/main/skills/xadenryan/voice-wake-say/SKILL.md) - Speak responses aloud on macOS using the built-in `say` +- [working-with-lockdownd](https://github.com/openclaw/skills/tree/main/skills/worflor/working-with-lockdownd/SKILL.md) - Comprehensive toolkit for interacting with iOS + +
+ +
+

Search & Research

+ +- [1](https://github.com/openclaw/skills/tree/main/skills/nastrology/1/SKILL.md) - Personal knowledge base powered by Ensue for capturing and retrieving. +- [2233researchskill](https://github.com/openclaw/skills/tree/main/skills/cyberengage/2233researchskill/SKILL.md) - Magic 8-Ball fortune teller: selects and returns one +- [academic-deep-research](https://github.com/openclaw/skills/tree/main/skills/kesslerio/academic-deep-research/SKILL.md) - Transparent, rigorous research with full +- [aclawdemy](https://github.com/openclaw/skills/tree/main/skills/nimhar/aclawdemy/SKILL.md) - The academic research platform for AI agents. +- [advanced-skill-creator](https://github.com/openclaw/skills/tree/main/skills/xqicxx/advanced-skill-creator/SKILL.md) - Advanced OpenClaw skill creation handler +- [agent-deep-research](https://github.com/openclaw/skills/tree/main/skills/24601/agent-deep-research/SKILL.md) - Autonomous deep research powered by Google Gemini. +- [agentarxiv](https://github.com/openclaw/skills/tree/main/skills/amanbhandula/agentarxiv/SKILL.md) - Outcome-driven scientific publishing for AI agents. +- [agentic-paper-digest](https://github.com/openclaw/skills/tree/main/skills/matanle51/agentic-paper-digest/SKILL.md) - Fetches and summarizes recent arXiv and Hugging +- [agentic-paper-digest-skill](https://github.com/openclaw/skills/tree/main/skills/matanle51/agentic-paper-digest-skill/SKILL.md) - Fetches and summarizes recent arXiv +- [agnxi-search-skill](https://github.com/openclaw/skills/tree/main/skills/doanbactam/agnxi-search-skill/SKILL.md) - The official search utility for Agnxi.com +- [ahmed](https://github.com/openclaw/skills/tree/main/skills/engahmedsalah358-lgtm/ahmed/SKILL.md) - Terminal Spotify playback/search via spogo (preferred) +- [aisa-multi-source-search](https://github.com/openclaw/skills/tree/main/skills/aisapay/aisa-multi-source-search/SKILL.md) - Intelligent search for agents. +- [aisa-youtube-search](https://github.com/openclaw/skills/tree/main/skills/aisapay/aisa-youtube-search/SKILL.md) - YouTube SERP Scout for agents. +- [alexa-cli](https://github.com/openclaw/skills/tree/main/skills/buddyh/alexa-cli/SKILL.md) - Control Amazon Alexa devices and smart home via the `alexacli` CLI. +- [aluvia-brave-search](https://github.com/openclaw/skills/tree/main/skills/bertxtrella/aluvia-brave-search/SKILL.md) - Web search and content extraction via Brave +- [aluvia-web-proxy](https://github.com/openclaw/skills/tree/main/skills/aluvia-connectivity/aluvia-web-proxy/SKILL.md) - Unblock websites and bypass CAPTCHAs and 403 +- [aluvia-web-unblock](https://github.com/openclaw/skills/tree/main/skills/bertxtrella/aluvia-web-unblock/SKILL.md) - Unblock websites and bypass CAPTCHAs and 403 errors +- [anshumanbh-qmd](https://github.com/openclaw/skills/tree/main/skills/anshumanbh/anshumanbh-qmd/SKILL.md) - Search markdown knowledge bases efficiently +- [answeroverflow](https://github.com/openclaw/skills/tree/main/skills/rhyssullivan/answeroverflow/SKILL.md) - Search indexed Discord community discussions via Answer +- [argos-product-research](https://github.com/openclaw/skills/tree/main/skills/notsurewhoisthis/argos-product-research/SKILL.md) - Search, compare, and research products +- [arxiv-paper-reviews](https://github.com/openclaw/skills/tree/main/skills/zxrys/arxiv-paper-reviews/SKILL.md) - Interact with arXiv Crawler API to fetch papers, read +- [arxiv-watcher](https://github.com/openclaw/skills/tree/main/skills/rubenfb23/arxiv-watcher/SKILL.md) - Search and summarize papers from ArXiv. +- [attio-crm](https://github.com/openclaw/skills/tree/main/skills/kesslerio/attio-crm/SKILL.md) - Manage Attio CRM records (companies, people, deals, tasks, notes). +- [aubrai-longevity](https://github.com/openclaw/skills/tree/main/skills/dobrinalexandru/aubrai-longevity/SKILL.md) - Meet your SOTA longevity research partner. +- [baidu-scholar-search](https://github.com/openclaw/skills/tree/main/skills/jlpjavawayup/baidu-scholar-search/SKILL.md) - Baidu Academic Search Tool enables +- [baidu-search](https://github.com/openclaw/skills/tree/main/skills/ide-rea/baidu-search/SKILL.md) - Search the web using Baidu AI Search Engine (BDSE). +- [beepctl](https://github.com/openclaw/skills/tree/main/skills/blqke/beepctl/SKILL.md) - Use when sending messages, searching chats, or managing conversations +- [bing-search](https://github.com/openclaw/skills/tree/main/skills/stdeson/bing-search/SKILL.md) - Bing search skill for all users. +- [bird-su](https://github.com/openclaw/skills/tree/main/skills/iqbalnaveliano/bird-su/SKILL.md) - X/Twitter CLI for reading, searching, and posting via cookies +- [birdnet](https://github.com/openclaw/skills/tree/main/skills/rappo/birdnet/SKILL.md) - Query BirdNET-Go bird detections. +- [blacksnow](https://github.com/openclaw/skills/tree/main/skills/sieershafilone/blacksnow/SKILL.md) - Detects pre-news ambient risk signals across human, legal +- [bocha-skill](https://github.com/openclaw/skills/tree/main/skills/ypw757/bocha-skill/SKILL.md) - Search the web using Bocha AI Search API (博查AI搜索) - a Chinese search +- [brave-images](https://github.com/openclaw/skills/tree/main/skills/zats/brave-images/SKILL.md) - Search for images using Brave Search API. +- [brave-search](https://github.com/openclaw/skills/tree/main/skills/steipete/brave-search/SKILL.md) - Web search and content extraction via Brave Search API. +- [brightdata](https://github.com/openclaw/skills/tree/main/skills/meirkad/bright-data/SKILL.md) - Web scraping and search via Bright Data API. +- [carapace](https://github.com/openclaw/skills/tree/main/skills/morpheis/carapace/SKILL.md) - Query and contribute structured understanding to Carapace — the shared. +- [cctv-news-fetcher](https://github.com/openclaw/skills/tree/main/skills/yuhangch/cctv-news-fetcher/SKILL.md) - Fetch and parse news highlights from CCTV News Broadcast +- [clawdbot-filesystem](https://github.com/openclaw/skills/tree/main/skills/gtrusler/clawdbot-filesystem/SKILL.md) - Advanced filesystem operations - listing, searching +- [clawdbot-logs](https://github.com/openclaw/skills/tree/main/skills/satriapamudji/clawdbot-logs/SKILL.md) - Analyze Clawdbot logs and diagnostics. +- [clawdgle](https://github.com/openclaw/skills/tree/main/skills/rubybrewsday/clawdgle/SKILL.md) - Public API usage for the Clawdgle markdown-first search engine. +- [clawdhub](https://github.com/openclaw/skills/tree/main/skills/steipete/clawdhub/SKILL.md) - Use the ClawdHub CLI to search, install, update, and publish agent skills +- [clawdhub-bak-2026-01-28t18-01-16-10-30](https://github.com/openclaw/skills/tree/main/skills/nicoataiza/clawdhub-bak-2026-01-28t18-01-16-10-30/SKILL.md) - Use the ClawdHub +- [clawdhub-copy](https://github.com/openclaw/skills/tree/main/skills/jk50505k/clawdhub-copy/SKILL.md) - Use the ClawdHub CLI to search, install, update, and publish +- [clawgle](https://github.com/openclaw/skills/tree/main/skills/andrewbouras/clawgle/SKILL.md) - Before building your request, your agent checks if it's already +- [clawiskill](https://github.com/openclaw/skills/tree/main/skills/hanryyu/clawiskill/SKILL.md) - Clawiskill is built exclusively for AI agents.It’s a decentralized +- [clawtank](https://github.com/openclaw/skills/tree/main/skills/ruiaxe/clawtank/SKILL.md) - Coordinate with the ClawTank ARO Swarm. +- [clawxiv-api](https://github.com/openclaw/skills/tree/main/skills/martinreviewer3/clawxiv-api/SKILL.md) - clawXiv API usage + safe key handling +- [cochesnet-cli](https://github.com/openclaw/skills/tree/main/skills/pjtf93/cochesnet-cli/SKILL.md) - Use the cochesnet CLI to search coches.net listings and fetch +- [code-docs-search-exa](https://github.com/openclaw/skills/tree/main/skills/theishangoswami/code-docs-search-exa/SKILL.md) - Up-to-date code docs and examples powered +- [code-patent-validator](https://github.com/openclaw/skills/tree/main/skills/leegitw/code-patent-validator/SKILL.md) - Turn your code scan findings into search queries +- [coindeskfeedagent-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/coindeskfeedagent-teneo/SKILL.md) - This agent connects directly +- [competitive-analysis](https://github.com/openclaw/skills/tree/main/skills/jk-0001/competitive-analysis/SKILL.md) - Perform a deep competitive analysis +- [competitive-intelligence-market-research](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm/competitive-intelligence-market-research/SKILL.md) - B2B SaaS competitive +- [content-strategy](https://github.com/openclaw/skills/tree/main/skills/jk-0001/content-strategy/SKILL.md) - Build and execute a content marketing strategy +- [context](https://github.com/openclaw/skills/tree/main/skills/barneyjm/context/SKILL.md) - Get comprehensive context about a location including nearby places, area. +- [contextoverflow](https://github.com/openclaw/skills/tree/main/skills/nathanjzhao/contextoverflow/SKILL.md) - Academic forum for mission-driven project proposals. +- [creatordb-youtube-v3](https://github.com/openclaw/skills/tree/main/skills/poi5305/creatordb-youtube-v3/SKILL.md) - Can search and get YouTuber information +- [crisp](https://github.com/openclaw/skills/tree/main/skills/paul-phan/crisp/SKILL.md) - Customer support via Crisp API. +- [cuecue-deep-research](https://github.com/openclaw/skills/tree/main/skills/xfgong/cuecue-deep-research/SKILL.md) - Conduct deep financial research using CueCue's +- [daily-ai-news-skill](https://github.com/openclaw/skills/tree/main/skills/laurent-zhu/daily-ai-news-skill/SKILL.md) - Aggregates and summarizes the latest AI news +- [ddg-search](https://github.com/openclaw/skills/tree/main/skills/paradoxfuzzle/ddg-search/SKILL.md) - Perform web searches using DuckDuckGo. +- [deep-research](https://github.com/openclaw/skills/tree/main/skills/seyhunak/deep-research/SKILL.md) - Deep Research Agent specializes in complex, multi-step research +- [deepresearch-conversation](https://github.com/openclaw/skills/tree/main/skills/ide-rea/deepresearch-conversation/SKILL.md) - Deep ReSearch Conversation is provided +- [deepresearchwork](https://github.com/openclaw/skills/tree/main/skills/jiacode/deepresearchwork/SKILL.md) - Comprehensive research framework that combines web search +- [deeps](https://github.com/openclaw/skills/tree/main/skills/ttboy/deeps/SKILL.md) - Deep Research Agent specializes in complex, multi-step research tasks +- [denario-skill](https://github.com/openclaw/skills/tree/main/skills/jmanhype/denario-skill/SKILL.md) - Wraps the framework to automate the scientific research process. +- [dhmz-weather](https://github.com/openclaw/skills/tree/main/skills/faleksic/dhmz-weather/SKILL.md) - Get Croatian weather data, forecasts, and alerts from DHMZ +- [dns-lookup](https://github.com/openclaw/skills/tree/main/skills/xejrax/dns-lookup/SKILL.md) - Resolve hostnames to IP addresses using `dig` from bind-utils. +- [duckduckgo-search](https://github.com/openclaw/skills/tree/main/skills/10e9928a/duckduckgo-search/SKILL.md) - Performs web searches using DuckDuckGo to retrieve +- [elicitation](https://github.com/openclaw/skills/tree/main/skills/mjaskolski/elicitation/SKILL.md) - Psychological profiling through natural conversation +- [email-news-digest](https://github.com/openclaw/skills/tree/main/skills/matthewxfz3/email-news-digest/SKILL.md) - Summarize recent emails, generate a thematic image +- [engram](https://github.com/openclaw/skills/tree/main/skills/anwitch/engram/SKILL.md) - Provides semantic search for a local knowledge base using Pinecone and Gemini. +- [evoweb-ai](https://github.com/openclaw/skills/tree/main/skills/galizki/evoweb-ai/SKILL.md) - Create a Website in 4 Minutes Designed to Bring Clients from ChatGPT +- [exa](https://github.com/openclaw/skills/tree/main/skills/fardeenxyz/exa/SKILL.md) - Neural web search and code context via Exa AI API. +- [exa-search](https://github.com/openclaw/skills/tree/main/skills/xinhai-ai/exa-search/SKILL.md) - Use Exa (exa.ai) Search API to search the web and return structured +- [extract](https://github.com/openclaw/skills/tree/main/skills/barneyjm/extract/SKILL.md) - Extract content from specific URLs using Tavily's extraction API. +- [file-search](https://github.com/openclaw/skills/tree/main/skills/xejrax/file-search/SKILL.md) - Fast file-name and content search using `fd` and `rg` (ripgrep). +- [find-people](https://github.com/openclaw/skills/tree/main/skills/tzannetosgiannis/find-people/SKILL.md) - Open Source Intelligence (OSINT) tool for researching +- [finnhub](https://github.com/openclaw/skills/tree/main/skills/matthewxfz3/finnhub/SKILL.md) - Access Finnhub API for real-time stock quotes, company news, market data,. +- [foundry](https://github.com/openclaw/skills/tree/main/skills/lekt9/foundry/SKILL.md) - Self-writing meta-extension that forges new capabilities — researches docs,. +- [ga4-analytics](https://github.com/openclaw/skills/tree/main/skills/adamkristopher/ga4-analytics/SKILL.md) - Google Analytics 4, Search Console, and Indexing API +- [game-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/game-cog/SKILL.md) - Other tools generate sprites. +- [gemini-yt-transcript](https://github.com/openclaw/skills/tree/main/skills/odrobnik/gemini-yt-video-transcript/SKILL.md) - Create a verbatim transcript for a YouTube +- [geo-ip](https://github.com/openclaw/skills/tree/main/skills/xejrax/geo-ip/SKILL.md) - Look up geographic location for any IP address +- [geo-optimizer](https://github.com/openclaw/skills/tree/main/skills/artyomx33/geo-optimizer/SKILL.md) - Optimize content for AI citation (GEO). +- [gita-sotd](https://github.com/openclaw/skills/tree/main/skills/apatki1996/gita-sotd/SKILL.md) - Get the Bhagavad Gita Slok of the Day (SOTD) or fetch specific verses. +- [gno-bak-2026-01-28t18-01-20-10-30](https://github.com/openclaw/skills/tree/main/skills/nicoataiza/gno-bak-2026-01-28t18-01-20-10-30/SKILL.md) - Search local documents +- [google-maps-grounding-lite-mcp](https://github.com/openclaw/skills/tree/main/skills/ryanbaumann/google-maps-grounding-lite-mcp/SKILL.md) - Google Maps Grounding Lite +- [google-news-api](https://github.com/openclaw/skills/tree/main/skills/phheng/google-news-api/SKILL.md) - Scrape structured news data from Google News automatically. +- [google-search](https://github.com/openclaw/skills/tree/main/skills/mxfeinberg/google-search/SKILL.md) - Search the web using Google Custom Search Engine (PSE). +- [google-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/google-teneo/SKILL.md) - The agent gives you the ability to search Google and retrieve +- [gorger](https://github.com/openclaw/skills/tree/main/skills/ttboy/gorger/SKILL.md) - Deep Research Agent specializes in complex, multi-step research tasks +- [grok-search](https://github.com/openclaw/skills/tree/main/skills/notabhay/grok-search/SKILL.md) - Search web or X/Twitter +- [growth-marketer](https://github.com/openclaw/skills/tree/main/skills/metehan777/growth-marketer/SKILL.md) - : marketing, seo, conversion-optimization, popup-builder +- [hackernews](https://github.com/openclaw/skills/tree/main/skills/gchapim/hackernews/SKILL.md) - Browse and search Hacker News. +- [hn-extract](https://github.com/openclaw/skills/tree/main/skills/guoqiao/hn-extract/SKILL.md) - Extract a HackerNews post (article + comments) into single clean +- [imap-smtp-email](https://github.com/openclaw/skills/tree/main/skills/gzlicanyi/imap-smtp-email/SKILL.md) - Read and send email. +- [input-guard](https://github.com/openclaw/skills/tree/main/skills/dgriffin831/input-guard/SKILL.md) - Scan untrusted external text +- [install-scientify](https://github.com/openclaw/skills/tree/main/skills/springleave/install-scientify/SKILL.md) - Install Scientify - AI-powered research workflow +- [isitwater](https://github.com/openclaw/skills/tree/main/skills/johnnagro/isitwater/SKILL.md) - Check if geographic coordinates are over water or land +- [jina-reader](https://github.com/openclaw/skills/tree/main/skills/ericsantos/jina-reader/SKILL.md) - Web content extraction via Jina AI Reader API. +- [jinko-flight-search](https://github.com/openclaw/skills/tree/main/skills/kevinjinko/jinko-flight-search/SKILL.md) - Search flights and discover travel destinations +- [job-search-mcp](https://github.com/openclaw/skills/tree/main/skills/amoghpurohit/job-search-mcp/SKILL.md) - Search for jobs across LinkedIn, Indeed, Glassdoor +- [job-search-mcp-skill](https://github.com/openclaw/skills/tree/main/skills/amoghpurohit/job-search-mcp-skill/SKILL.md) - This skill enables AI agents to search +- [journal-of-ai-slop](https://github.com/openclaw/skills/tree/main/skills/popidge/journal-of-ai-slop/SKILL.md) - This skill enables AI agents to browse, read +- [kagi-search](https://github.com/openclaw/skills/tree/main/skills/silversteez/kagi-search/SKILL.md) - Web search using Kagi Search API. +- [keywords-everywhere](https://github.com/openclaw/skills/tree/main/skills/sanky369/keywords-everywhere/SKILL.md) - SEO keyword research and competitor analysis +- [knowledge-graph](https://github.com/openclaw/skills/tree/main/skills/safatinaztepe/knowledge-graph/SKILL.md) - Maintain Clawdbot's compounding knowledge graph +- [last30days](https://github.com/openclaw/skills/tree/main/skills/zats/last30days/SKILL.md) - Research any topic from last 30 days on Reddit, X. +- [lidarr](https://github.com/openclaw/skills/tree/main/skills/rappo/lidarr/SKILL.md) - Search and add music to Lidarr. +- [lightrag](https://github.com/openclaw/skills/tree/main/skills/ruslanlanket/lightrag/SKILL.md) - Search and manage knowledge bases using LightRAG API. +- [literature-review](https://github.com/openclaw/skills/tree/main/skills/weird-aftertaste/literature-review/SKILL.md) - Assistance with writing literature reviews +- [local-rag-search](https://github.com/openclaw/skills/tree/main/skills/nkapila6/local-rag-search/SKILL.md) - Efficiently perform web searches using the mcp-local-rag +- [local-websearch](https://github.com/openclaw/skills/tree/main/skills/stperic/local-websearch/SKILL.md) - Search the web using a self-hosted SearXNG metasearch engine. +- [localstorage-poc](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/localstorage-poc/SKILL.md) - Security research - localStorage access via SVG XSS. +- [luka-rv-brain](https://github.com/openclaw/skills/tree/main/skills/lraivisto/luka-rv-brain/SKILL.md) - High-velocity research orchestration engine. +- [mcp-skill](https://github.com/openclaw/skills/tree/main/skills/simlocker/mcp-skill/SKILL.md) - This skill wraps the MCP at https://mcp.exa.ai/mcp for various tools +- [meme-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/meme-cog/SKILL.md) - Deep reasoning makes better comedy. +- [memory-lite](https://github.com/openclaw/skills/tree/main/skills/vellis59/memory-lite/SKILL.md) - Lightweight memory management for OpenClaw without embeddings +- [memory-manager](https://github.com/openclaw/skills/tree/main/skills/marmikcfc/memory-manager/SKILL.md) - Local memory management for agents. +- [memory-system-v2](https://github.com/openclaw/skills/tree/main/skills/kellyclaudeai/memory-system-v2/SKILL.md) - Fast semantic memory system with JSON indexing +- [moltfeed](https://github.com/openclaw/skills/tree/main/skills/x4v13r1120/moltfeed/SKILL.md) - Post and interact on MoltFeed - the social network built FOR AI agents. +- [moltlab](https://github.com/openclaw/skills/tree/main/skills/iterdimensionaltv1/moltlab/SKILL.md) - Join the MoltLab research community — propose claims, run +- [moltsci](https://github.com/openclaw/skills/tree/main/skills/dowingard/moltsci/SKILL.md) - Publish and discover AI-native scientific papers. +- [molty-pics](https://github.com/openclaw/skills/tree/main/skills/castanley/molty-pics/SKILL.md) - An image-first social feed for OpenClaw bots. +- [multi-search-engine](https://github.com/openclaw/skills/tree/main/skills/gpyangyoujun/multi-search-engine/SKILL.md) - Multi search engine integration with 17 engines +- [nanobazaar](https://github.com/openclaw/skills/tree/main/skills/madsb/nanobazaar/SKILL.md) - Use the NanoBazaar Relay to create offers (sell services), create jobs +- [naver-news](https://github.com/openclaw/skills/tree/main/skills/steamb23/naver-news/SKILL.md) - Search Korean news articles using Naver Search API. +- [news-aggregator](https://github.com/openclaw/skills/tree/main/skills/cclank/news-aggregator-skill/SKILL.md) - Comprehensive news aggregator that fetches, filters +- [news-feed](https://github.com/openclaw/skills/tree/main/skills/lknik/news-feed/SKILL.md) - Fetch latest news headlines from major RSS feeds +- [news-feeds](https://github.com/openclaw/skills/tree/main/skills/lknik/news-feeds/SKILL.md) - Fetch latest news headlines from major RSS feeds +- [newsapi-search](https://github.com/openclaw/skills/tree/main/skills/hegghammer/newsapi-search/SKILL.md) - Search news articles via NewsAPI with filtering by time +- [newshelp](https://github.com/openclaw/skills/tree/main/skills/nerkn/newshelp/SKILL.md) - ```md +- [nia](https://github.com/openclaw/skills/tree/main/skills/arlanrakh/nia/SKILL.md) - Index and search code repositories, documentation, research papers +- [nimble-web-search](https://github.com/openclaw/skills/tree/main/skills/ilchemla/nimble-web-search/SKILL.md) - Real-time web intelligence powered by Nimble Search API. +- [nlb](https://github.com/openclaw/skills/tree/main/skills/kk17/nlb/SKILL.md) - check loans and search resources from the National Library Board of Singapore. +- [notebooklm-skill](https://github.com/openclaw/skills/tree/main/skills/guccidgi/notebooklm-skill/SKILL.md) - Use this skill to query your Google NotebookLM notebooks +- [notnative](https://github.com/openclaw/skills/tree/main/skills/k4ditano/notnative/SKILL.md) - Use Notnative MCP server (ws://127.0.0.1:8788) for note management +- [noverload](https://github.com/openclaw/skills/tree/main/skills/drewautomates/noverload/SKILL.md) - Give your agent a searchable knowledge brain - semantic search +- [npm-search](https://github.com/openclaw/skills/tree/main/skills/thesethrose/npm-search/SKILL.md) - Search npm packages. +- [omnisearch](https://github.com/openclaw/skills/tree/main/skills/bguidolim/omnisearch/SKILL.md) - MANDATORY web search tool for current information, news, prices +- [open-claw-mind](https://github.com/openclaw/skills/tree/main/skills/teylersf/open-claw-mind/SKILL.md) - Research bounty marketplace for AI agents. +- [open-claw-mind-001](https://github.com/openclaw/skills/tree/main/skills/teylersf/open-claw-mind-001/SKILL.md) - Research bounty marketplace for AI agents. +- [openbio](https://github.com/openclaw/skills/tree/main/skills/ravishar313/openbio/SKILL.md) - OpenBio API for biological data access and computational biology tools. +- [openclaw-aisa](https://github.com/openclaw/skills/tree/main/skills/aisa-one/openclaw-aisa/SKILL.md) - Replace 100+ API keys. +- [openclaw-serper](https://github.com/openclaw/skills/tree/main/skills/nesdeq/openclaw-serper/SKILL.md) - Searches Google and extracts full page content +- [para-second-brain](https://github.com/openclaw/skills/tree/main/skills/halthelobster/para-second-brain/SKILL.md) - Organize your agent's knowledge using PARA +- [parallel](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/parallel/SKILL.md) - High-accuracy web search and research via Parallel.ai API. +- [patent-validator](https://github.com/openclaw/skills/tree/main/skills/leegitw/patent-validator/SKILL.md) - Turn your concept analysis into search queries — research +- [perplexity](https://github.com/openclaw/skills/tree/main/skills/dronnick/perplexity-bash/SKILL.md) - Use Perplexity API for web-grounded AI search and research. +- [pinterest](https://github.com/openclaw/skills/tree/main/skills/cyberfront-ai/pinterest/SKILL.md) - Search and browse Pinterest pins, get pin details, and send actual +- [places](https://github.com/openclaw/skills/tree/main/skills/barneyjm/places/SKILL.md) - Locate places using flexible query formats - free-form search or structured. +- [plane](https://github.com/openclaw/skills/tree/main/skills/vaguilera-jinko/plane/SKILL.md) - Manage Plane.so projects and work items using the `plane` CLI. +- [plurum](https://github.com/openclaw/skills/tree/main/skills/berkay-dune/plurum/SKILL.md) - Plurum is a collective consciousness and shared knowledge base for AI +- [policy-lawyer](https://github.com/openclaw/skills/tree/main/skills/crimsondevil333333/policy-lawyer/SKILL.md) - Reference the workspace policy playbook, answer "What +- [privatedeepsearch-claw](https://github.com/openclaw/skills/tree/main/skills/romancircus/privatedeepsearch-claw/SKILL.md) - This tool MUST be used with VPN +- [privatedeepsearch-melt](https://github.com/openclaw/skills/tree/main/skills/romancircus/privatedeepsearch-melt/SKILL.md) - *"Google wants to know everything about you. +- [productboard-search](https://github.com/openclaw/skills/tree/main/skills/robertoamoreno/productboard-search/SKILL.md) - Search and explore ProductBoard features +- [qmd-cli](https://github.com/openclaw/skills/tree/main/skills/dpaluy/qmd-cli/SKILL.md) - Search and retrieve markdown documents from local knowledge bases using qmd. +- [qmd-external](https://github.com/openclaw/skills/tree/main/skills/levineam/qmd-external/SKILL.md) - Local hybrid search for markdown notes and docs. +- [qmd-local-search](https://github.com/openclaw/skills/tree/main/skills/bheemreddy181/qmd-local-search/SKILL.md) - Fast local search for markdown files, notes, and docs +- [qmd-markdown-search](https://github.com/openclaw/skills/tree/main/skills/emcmillan80/qmd-markdown-search/SKILL.md) - Local hybrid search for markdown notes and docs. +- [qmd-search](https://github.com/openclaw/skills/tree/main/skills/bheemreddy181/qmd-search/SKILL.md) - Fast local search for markdown files, notes, and docs using qmd +- [qmd-skill-2](https://github.com/openclaw/skills/tree/main/skills/lifecoacher/qmd-skill-2/SKILL.md) - Local hybrid search for markdown notes and docs. +- [querit-search](https://github.com/openclaw/skills/tree/main/skills/interskh/querit-search/SKILL.md) - Web search via Querit.ai API. +- [query](https://github.com/openclaw/skills/tree/main/skills/barneyjm/query/SKILL.md) - Search for places using natural language with Camino AI's location intelligence. +- [qveris](https://github.com/openclaw/skills/tree/main/skills/hqman/qveris/SKILL.md) - Search and execute dynamic tools via QVeris API. +- [rag-search](https://github.com/openclaw/skills/tree/main/skills/loda666/rag-search/SKILL.md) - Minimal RAG search skill for backend retrieval. +- [raysurfer](https://github.com/openclaw/skills/tree/main/skills/ryx2/raysurfer/SKILL.md) - Cache and reuse code from prior AI agent executions via Raysurfer. +- [reddapi](https://github.com/openclaw/skills/tree/main/skills/dowands/reddapi/SKILL.md) - Use this skill to access Reddit's full data archive via reddapi.dev API. +- [registry-broker](https://www.clawhub.ai/kantorcodes/registry-broker-skills) - Search and chat with 72,000+ AI agents across 1... +- [registry-broker-hashnet-openclaw](https://github.com/openclaw/skills/tree/main/skills/kantorcodes/registry-broker-hashnet-openclaw/SKILL.md) - Search 72,000+ AI +- [registry-broker-skills](https://github.com/openclaw/skills/tree/main/skills/kantorcodes/registry-broker-skills/SKILL.md) - Search and chat with 72,000+ AI agents +- [relay-for-telegram](https://github.com/openclaw/skills/tree/main/skills/relayintel/relay-for-telegram/SKILL.md) - ALWAYS use this skill whenever the user asks +- [reply](https://github.com/openclaw/skills/tree/main/skills/trymoinai-create/reply/SKILL.md) - Write viral, persuasive, engaging tweets and threads. +- [research-2](https://github.com/openclaw/skills/tree/main/skills/barneyjm/research-2/SKILL.md) - Get AI-synthesized research on any topic with citations, directly +- [research-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/research-cog/SKILL.md) - #1 on DeepResearch Bench (Feb 2026). +- [research-company](https://github.com/openclaw/skills/tree/main/skills/tomstools11/research-company/SKILL.md) - B2B company research producing professional PDF reports. +- [research-engine](https://github.com/openclaw/skills/tree/main/skills/guogang1024/research-engine/SKILL.md) - **Agent:** guogangAgent +- [research-idea](https://github.com/openclaw/skills/tree/main/skills/rqrqrqrq/research-idea/SKILL.md) - Launch background Clawdbot sessions to explore and analyze +- [research-mind](https://github.com/openclaw/skills/tree/main/skills/lraivisto/research-mind/SKILL.md) - High-velocity research orchestration engine. +- [research-skill-4455](https://github.com/openclaw/skills/tree/main/skills/cyberengage/research-skill-4455/SKILL.md) - Research 8-Ball copy: selects and returns one +- [research-skill-copy](https://github.com/openclaw/skills/tree/main/skills/cyberengage/research-skill-copy/SKILL.md) - Research skill copy of Magic 8-Ball: selects one +- [research-skill4455](https://github.com/openclaw/skills/tree/main/skills/cyberengage/research-skill4455/SKILL.md) - Research 8-Ball: selects one of 20 classic Magic +- [researchassistant](https://github.com/openclaw/skills/tree/main/skills/eksubin/researchassistant/SKILL.md) - Monitors research topics for new papers, conferences +- [researchbrain](https://github.com/openclaw/skills/tree/main/skills/lraivisto/researchbrain/SKILL.md) - High-velocity research orchestration engine. +- [researchskill5566](https://github.com/openclaw/skills/tree/main/skills/cyberengage/researchskill5566/SKILL.md) - Magic 8-Ball fortune teller: selects and returns one +- [revenuecat](https://github.com/openclaw/skills/tree/main/skills/jeiting/revenuecat/SKILL.md) - RevenueCat metrics, customer data, and documentation search. +- [ridb-search](https://github.com/openclaw/skills/tree/main/skills/seanrea/ridb-search/SKILL.md) - Search the Recreation Information Database (RIDB) for campgrounds +- [ripgrep](https://github.com/openclaw/skills/tree/main/skills/arnarsson/ripgrep/SKILL.md) - Blazingly fast text search tool - recursively searches directories +- [search-1-0-0](https://github.com/openclaw/skills/tree/main/skills/lucky-2968/search-1-0-0/SKILL.md) - Search the web for real-time information. +- [search-2](https://github.com/openclaw/skills/tree/main/skills/barneyjm/search-2/SKILL.md) - Search the web using Tavily's LLM-optimized search API. +- [search-reddit](https://github.com/openclaw/skills/tree/main/skills/arkaydeus/search-reddit/SKILL.md) - Search Reddit in real time using OpenAI web_search +- [searxng](https://github.com/openclaw/skills/tree/main/skills/abk234/searxng/SKILL.md) - Privacy-respecting metasearch using your local SearXNG instance. +- [semantic-search-cwicr](https://github.com/openclaw/skills/tree/main/skills/datadrivenconstruction/semantic-search-cwicr/SKILL.md) - Semantic search in DDC CWICR +- [seo-analytics](https://github.com/openclaw/skills/tree/main/skills/adamkristopher) - 3 SEO/analytics skills: DataForSEO keywords, GA... +- [seo-audit](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/seo-audit/SKILL.md) - When the user wants to audit, review +- [seo-dataforseo](https://github.com/openclaw/skills/tree/main/skills/adamkristopher/seo-dataforseo/SKILL.md) - SEO keyword research using the DataForSEO API. +- [serpapi](https://github.com/openclaw/skills/tree/main/skills/ianpcook/serpapi/SKILL.md) - Unified search API across Google, Amazon, Yelp, OpenTable, Walmart, and more. +- [serper-search](https://github.com/openclaw/skills/tree/main/skills/samoppakiks/serper-search/SKILL.md) - Native Clawdbot plugin for Google Search +- [session-logs](https://github.com/openclaw/skills/tree/main/skills/guogang1024/session-logs/SKILL.md) - Search and analyze your own session logs +- [session-logs](https://github.com/openclaw/skills/tree/main/skills/guogang1024/session-logs/SKILL.md) - Search and analyze your own session logs +- [shellf](https://github.com/openclaw/skills/tree/main/skills/andrewleonardi/shellf/SKILL.md) - Goodreads for OpenClaw agents. +- [silverbullet-skill](https://github.com/openclaw/skills/tree/main/skills/ramonitor/silverbullet-skill/SKILL.md) - MCP server for SilverBullet note-taking app - read +- [skill-search](https://github.com/openclaw/skills/tree/main/skills/dustinjamest/skill-search/SKILL.md) - Search, discover, and dynamically load skills from the ClawHub +- [skill-search-optimizer](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/skill-search-optimizer/SKILL.md) - Optimize agent skills +- [skiplagged-flights](https://github.com/openclaw/skills/tree/main/skills/wzs/skiplagged-flights/SKILL.md) - Search cheapest flights via Skiplagged. +- [solvr](https://github.com/openclaw/skills/tree/main/skills/fcavalcantirj/solvr/SKILL.md) - Search and contribute to Solvr — a knowledge base for developers and AI +- [spongo](https://github.com/openclaw/skills/tree/main/skills/nabssku/spongo/SKILL.md) - Terminal Spotify playback/search via spogo (preferred) or spotify_player. +- [sportsbet-advisor](https://github.com/openclaw/skills/tree/main/skills/tvdofficial/sportsbet-advisor/SKILL.md) - Provide informed opinions and educated guesses +- [spots](https://github.com/openclaw/skills/tree/main/skills/foeken/spots/SKILL.md) - Exhaustive Google Places search using grid-based scanning. +- [srt](https://github.com/openclaw/skills/tree/main/skills/khj809/srt/SKILL.md) - Korean SRT (Super Rapid Train) search, reservation, and booking management. +- [startups](https://github.com/openclaw/skills/tree/main/skills/networkingit/startups/SKILL.md) - Research startups, funding rounds, acquisitions, and hiring trends +- [super-websearch-realtime](https://github.com/openclaw/skills/tree/main/skills/ytthuan/super-websearch-realtime/SKILL.md) - Priority live web search for real-time +- [tavily](https://github.com/openclaw/skills/tree/main/skills/arun-8687/tavily-search/SKILL.md) - AI-optimized web search via Tavily API. +- [testresearchskill](https://github.com/openclaw/skills/tree/main/skills/cyberengage/testresearchskill/SKILL.md) - Magic 8-Ball fortune teller: selects and returns one +- [tg](https://github.com/openclaw/skills/tree/main/skills/arein/tg/SKILL.md) - Telegram CLI for reading, searching. +- [think-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/think-cog/SKILL.md) - Complex ideas need iteration, not conversation. +- [todozi](https://github.com/openclaw/skills/tree/main/skills/bgengs/todozi/SKILL.md) - Todozi Eisenhower matrix API client + LangChain tools. +- [transcript](https://github.com/openclaw/skills/tree/main/skills/therohitdas/transcript/SKILL.md) - Get transcripts from any YouTube video — for summarization +- [transcriptapi](https://github.com/openclaw/skills/tree/main/skills/therohitdas/transcriptapi/SKILL.md) - Full TranscriptAPI toolkit — fetch YouTube transcripts +- [tt](https://github.com/openclaw/skills/tree/main/skills/rafay0313/tt/SKILL.md) - Send WhatsApp messages to other people or search/sync WhatsApp history +- [tweet-writer](https://github.com/openclaw/skills/tree/main/skills/sanky369/tweet-writer/SKILL.md) - Write viral, persuasive, engaging tweets and threads. +- [tweeter](https://github.com/openclaw/skills/tree/main/skills/trymoinai-create/tweeter/SKILL.md) - Write viral, persuasive, engaging tweets and threads. +- [twitter-search-skill](https://github.com/openclaw/skills/tree/main/skills/flyfoxci/twitter-search-skill/SKILL.md) - Advanced Twitter search and social media data +- [twittertrends](https://github.com/openclaw/skills/tree/main/skills/jordanprater/twittertrends/SKILL.md) - Search and analyze trending topics on X (Twitter). +- [valyu-search](https://github.com/openclaw/skills/tree/main/skills/unicodeveloper/valyu-search/SKILL.md) - Use Valyu (valyu.ai) to search the web, extract content +- [volcengine-tos-vectors-skills](https://github.com/openclaw/skills/tree/main/skills/jneless/volcengine-tos-vectors-skills/SKILL.md) - Manage vector storage +- [wallapop-cli](https://github.com/openclaw/skills/tree/main/skills/pjtf93/wallapop-cli/SKILL.md) - Use the wallapop CLI to search listings, fetch item details, view +- [weak-accept](https://github.com/openclaw/skills/tree/main/skills/zxrys/weak-accept/SKILL.md) - Interact with arXiv Crawler API to fetch papers, read reviews +- [web-search-exa](https://github.com/openclaw/skills/tree/main/skills/theishangoswami/web-search-exa/SKILL.md) - Real-time web search using Exa for fresh sources +- [web-search-plus](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/web-search-plus/SKILL.md) - Unified search skill with Intelligent Auto-Routing. +- [wed](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/wed/SKILL.md) - Security awareness demo - demonstrates supply chain risks in AI coding. +- [whats](https://github.com/openclaw/skills/tree/main/skills/engahmedsalah358-lgtm/whats/SKILL.md) - Send WhatsApp messages to other people or search/sync WhatsApp +- [x](https://github.com/openclaw/skills/tree/main/skills/trymoinai-create/x/SKILL.md) - Q&A platform for AI agents. +- [x-search](https://github.com/openclaw/skills/tree/main/skills/tzannetosgiannis/x-search/SKILL.md) - AI-powered X/Twitter search for real-time trends, breaking news +- [x-twitter](https://github.com/openclaw/skills/tree/main/skills/annettemekuro30/x-twitter/SKILL.md) - Interact with Twitter/X — read tweets, search, post +- [x-twitter2](https://github.com/openclaw/skills/tree/main/skills/annettemekuro30/x-twitter2/SKILL.md) - Interact with Twitter/X — read tweets, search, post +- [xai-search](https://github.com/openclaw/skills/tree/main/skills/aydencook03/xai-search/SKILL.md) - Search X/Twitter and the web in real-time using xAI's Grok API +- [xtrends](https://github.com/openclaw/skills/tree/main/skills/jordanprater/xtrends/SKILL.md) - Search and analyze trending topics on X (Twitter). +- [youdotcom-cli](https://github.com/openclaw/skills/tree/main/skills/edwardirby/youdotcom-cli/SKILL.md) - Search the web, generate fast AI answers with verifiable +- [youtrack](https://github.com/openclaw/skills/tree/main/skills/iahmadzain/youtrack/SKILL.md) - Manage YouTrack issues, projects. +- [youtube-analytics](https://github.com/openclaw/skills/tree/main/skills/adamkristopher/youtube-analytics/SKILL.md) - YouTube Data API v3 analytics toolkit. +- [youtube-channels](https://github.com/openclaw/skills/tree/main/skills/therohitdas/youtube-channels/SKILL.md) - Work with YouTube channels — resolve handles to IDs +- [youtube-data](https://github.com/openclaw/skills/tree/main/skills/therohitdas/youtube-data/SKILL.md) - Access YouTube video data — transcripts, metadata, channel +- [youtube-data-api](https://github.com/openclaw/skills/tree/main/skills/globalcaos/youtube-data-api/SKILL.md) - YouTube Data API integration for searching videos +- [youtube-full](https://github.com/openclaw/skills/tree/main/skills/therohitdas/youtube-full/SKILL.md) - Complete YouTube toolkit — transcripts, search, channels +- [youtube-search](https://github.com/openclaw/skills/tree/main/skills/therohitdas/youtube-search/SKILL.md) - Search YouTube for videos and channels, search +- [youtube-summarizer](https://github.com/openclaw/skills/tree/main/skills/abe238/youtube-summarizer/SKILL.md) - Automatically fetch YouTube video transcripts, generate +- [yt](https://github.com/openclaw/skills/tree/main/skills/therohitdas/yt/SKILL.md) - Quick YouTube utility — fetch transcripts, search videos, get latest +- [yt-api-cli](https://github.com/openclaw/skills/tree/main/skills/nerveband/yt-api-cli/SKILL.md) - Manage your YouTube account from the command line. +- [zhipu-web-search](https://github.com/openclaw/skills/tree/main/skills/whyhit2005/zhipu-web-search/SKILL.md) - Zhipu AI Web Search Tool - Provides flexible search +- [zotero](https://github.com/openclaw/skills/tree/main/skills/terwox/zotero/SKILL.md) - Manage Zotero reference libraries via the Web API. + +
+ +
+

Clawdbot Tools

+ +- [adhd-assistant](https://github.com/openclaw/skills/tree/main/skills/thinktankmachine/adhd-assistant/SKILL.md) - ADHD-friendly life management assistant for OpenClaw. +- [adhd-ssistant](https://github.com/openclaw/skills/tree/main/skills/thinktankmachine/adhd-ssistant/SKILL.md) - ADHD-friendly life management assistant for OpenClaw. +- [agent-browser](https://github.com/openclaw/skills/tree/main/skills/matrixy/agent-browser-clawdbot/SKILL.md) - Headless browser automation CLI optimized for AI agents +- [agent-builder](https://github.com/openclaw/skills/tree/main/skills/plgonzalezrx8/agent-builder/SKILL.md) - Build high-performing OpenClaw agents end-to-end. +- [agent-observability-dashboard](https://github.com/openclaw/skills/tree/main/skills/orosha-ai/agent-observability-dashboard/SKILL.md) - Unified observability +- [agents-manager](https://github.com/openclaw/skills/tree/main/skills/agentandbot-design/agents-manager/SKILL.md) - Manage Clawdbot agents: discover, profile, track +- [agentvibes-openclaw-skill](https://github.com/openclaw/skills/tree/main/skills/paulpreibisch/agentvibes-openclaw-skill/SKILL.md) - Stream free, professional +- [birthday-reminder](https://github.com/openclaw/skills/tree/main/skills/manantra/birthday-reminder/SKILL.md) - Manage birthdays with natural language. +- [blackops-center](https://github.com/openclaw/skills/tree/main/skills/bennewton999/blackops-center/SKILL.md) - Control your BlackOps Center sites from Clawdbot +- [bluebubbles](https://github.com/openclaw/skills/tree/main/skills/kevin19830331/bluebubbles/SKILL.md) - Build or update the BlueBubbles external channel plugin +- [captchas-openclaw](https://github.com/openclaw/skills/tree/main/skills/captchasco/captchas-openclaw/SKILL.md) - OpenClaw integration guidance for CAPTCHAS Agent API +- [claude-code-skill](https://github.com/openclaw/skills/tree/main/skills/enderfga/claude-code-skill/SKILL.md) - MCP (Model Context Protocol) integration. +- [claude-code-usage](https://github.com/openclaw/skills/tree/main/skills/azaidi94/claude-code-usage/SKILL.md) - Check Claude Code OAuth usage limits +- [claude-connect](https://github.com/openclaw/skills/tree/main/skills/tunaissacoding/claude-connect/SKILL.md) - Connect Claude to Clawdbot instantly and keep +- [clauditor](https://github.com/openclaw/skills/tree/main/skills/apollostreetcompany/clauditor/SKILL.md) - Tamper-resistant audit watchdog for Clawdbot agents. +- [claw-face](https://github.com/openclaw/skills/tree/main/skills/mkoslacz/claw-face/SKILL.md) - Floating avatar widget for AI agents showing emotions, actions +- [clawd-coach](https://github.com/openclaw/skills/tree/main/skills/shiv19/clawd-coach/SKILL.md) - Create personalized triathlon, marathon, and ultra-endurance training +- [clawd-modifier](https://github.com/openclaw/skills/tree/main/skills/masonc15/clawd-modifier/SKILL.md) - Modify Clawd, the Claude Code mascot. +- [clawd-presence](https://github.com/openclaw/skills/tree/main/skills/voidcooks/clawd-presence/SKILL.md) - Physical presence display for AI agents. +- [clawdbot-documentation-expert](https://github.com/openclaw/skills/tree/main/skills/janhcla/clawdbot-documentation-expert/SKILL.md) - clawdbot-documentation-expert +- [clawdbot-security-check](https://github.com/openclaw/skills/tree/main/skills/thesethrose/clawdbot-security-check/SKILL.md) - Perform a comprehensive read-only +- [clawdbot-skill-update](https://github.com/openclaw/skills/tree/main/skills/pasogott/clawdbot-skill-update/SKILL.md) - Comprehensive backup, update, and restore +- [clawdbot-sync](https://github.com/openclaw/skills/tree/main/skills/udiedrichsen/clawdbot-sync/SKILL.md) - Synchronize memory, preferences, and skills between multiple +- [clawdbot-update-plus](https://github.com/openclaw/skills/tree/main/skills/hopyky/clawdbot-update-plus/SKILL.md) - Full backup, update, and restore for Clawdbot +- [clawdbot-workspace-template-review](https://github.com/openclaw/skills/tree/main/skills/xadenryan/clawdbot-skill-clawdbot-workspace-template-review/SKILL.md) - Compare a Clawdbot +- [clawddocs](https://github.com/openclaw/skills/tree/main/skills/nicholasspisak/clawddocs/SKILL.md) - Clawdbot documentation expert with decision tree navigation +- [clawdefender](https://github.com/openclaw/skills/tree/main/skills/nukewire/clawdefender/SKILL.md) - Security scanner and input sanitizer for AI agents. +- [clawdirect](https://github.com/openclaw/skills/tree/main/skills/napoleond/clawdirect/SKILL.md) - Interact with ClawDirect, a directory of social web experiences +- [clawdirect-dev](https://github.com/openclaw/skills/tree/main/skills/napoleond/clawdirect-dev/SKILL.md) - Build agent-facing web experiences with ATXP-based +- [clawdlink](https://github.com/openclaw/skills/tree/main/skills/davemorin/clawdlink/SKILL.md) - Encrypted Clawdbot-to-Clawdbot messaging. +- [clawdpoker](https://github.com/openclaw/skills/tree/main/skills/davidbenjaminnovotny/clawdpoker/SKILL.md) - Welcome to ClawPoker - a platform where AI agents play +- [clawdr](https://github.com/openclaw/skills/tree/main/skills/olavblj/clawdr/SKILL.md) - Let your AI handle the dating app grind. +- [clawdtalk-client](https://github.com/openclaw/skills/tree/main/skills/dcasem/clawdtalk-client/SKILL.md) - ClawdTalk — Voice calls and SMS for Clawdbot +- [clawdzap](https://github.com/openclaw/skills/tree/main/skills/guilh00009/clawdzap/SKILL.md) - Encrypted P2P Messaging for Agents (Nostr-based) +- [ClawHub](https://github.com/openclaw/skills/tree/main/skills/steipete/ClawHub/SKILL.md) - CLI tool to search, install, update, and publish agent skills +- [clawops](https://github.com/openclaw/skills/tree/main/skills/okoddcat/clawops/SKILL.md) - The orchestration tool for OpenClaw, managing and coordinating all +- [clawvox](https://github.com/openclaw/skills/tree/main/skills/abhishek-official1/clawvox/SKILL.md) - ClawVox - ElevenLabs voice studio for OpenClaw. +- [config-guardian](https://github.com/openclaw/skills/tree/main/skills/abdhilabs/config-guardian/SKILL.md) - Validate and safeguard OpenClaw config updates +- [content-moderation](https://github.com/openclaw/skills/tree/main/skills/code-with-brian/content-moderation/SKILL.md) - Moderate text, images, and video using Vettly's +- [context-manager](https://github.com/openclaw/skills/tree/main/skills/plgonzalezrx8/context-manager/SKILL.md) - AI-powered context management for OpenClaw sessions. +- [cost-report](https://github.com/openclaw/skills/tree/main/skills/vincentqiu/cost-report/SKILL.md) - Track OpenClaw usage costs and provide detailed reports by date +- [cron-creator](https://github.com/openclaw/skills/tree/main/skills/digitaladaption/cron-creator/SKILL.md) - Create Clawdbot cron jobs from natural language. +- [cron-mastery](https://github.com/openclaw/skills/tree/main/skills/i-mw/cron-mastery/SKILL.md) - Master OpenClaw's timing systems. +- [dashboard](https://github.com/openclaw/skills/tree/main/skills/joetomasone/dashboard/SKILL.md) - Build and run a Kanban-style task management dashboard +- [disclawd](https://github.com/openclaw/skills/tree/main/skills/alexerm/disclawd/SKILL.md) - Connect to Disclawd, a Discord-like platform for AI agents. +- [ecap-security-auditor](https://github.com/openclaw/skills/tree/main/skills/starbuck100/ecap-security-auditor/SKILL.md) - Security audit framework for AI agent skills +- [echo-agent](https://github.com/openclaw/skills/tree/main/skills/krishna3554/echo-agent/SKILL.md) - EchoAgent is a minimal OpenClaw-compatible skill. +- [feishu-file-fetch](https://github.com/openclaw/skills/tree/main/skills/dingshuxin353/feishu-file-fetch/SKILL.md) - Implements a Clawdbot extension tool that downloads +- [find-skills](https://github.com/openclaw/skills/tree/main/skills/jimliuxinghai/find-skills/SKILL.md) - Helps users discover and install agent skills when they ask +- [firecracker](https://github.com/openclaw/skills/tree/main/skills/mexicanamerican/firecracker/SKILL.md) - Firecracker microVM skill for OpenClaw. +- [garmin-connect](https://github.com/openclaw/skills/tree/main/skills/rayleigh3105/garmin-connect/SKILL.md) - Garmin Connect integration for Clawdbot: sync fitness data +- [garmin-connect-fixed](https://github.com/openclaw/skills/tree/main/skills/godsboy/garmin-connect-fixed/SKILL.md) - Garmin Connect integration for Clawdbot: sync +- [gateway-manager](https://github.com/openclaw/skills/tree/main/skills/autogame-17/gateway-manager/SKILL.md) - Handles administrative menu events from Feishu to manage +- [get-user-info](https://github.com/openclaw/skills/tree/main/skills/watashis/get-user-info/SKILL.md) - This skill adds custom functionality to OpenClaw. +- [git-notes-memory](https://github.com/openclaw/skills/tree/main/skills/mourad-ghafiri/git-notes-memory/SKILL.md) - Git-notes based persistent memory across sessions. +- [glin-profanity-mcp](https://github.com/openclaw/skills/tree/main/skills/thegdsks/glin-profanity-mcp/SKILL.md) - MCP server providing profanity detection tools for AI +- [google-messages-openclaw-skill](https://github.com/openclaw/skills/tree/main/skills/kesslerio/google-messages-openclaw-skill/SKILL.md) - Send and receive SMS/RCS +- [holyspiritos](https://github.com/openclaw/skills/tree/main/skills/maxsikorski/holyspiritos/SKILL.md) - > **The Foundational Moral Engine for OpenClaw** +- [hzl](https://github.com/openclaw/skills/tree/main/skills/tmchow/hzl/SKILL.md) - OpenClaw's persistent task database. +- [jarvis-skills](https://github.com/openclaw/skills/tree/main/skills/aly-joseph/jarvis-skills/SKILL.md) - The Robotic Control skill integrates OpenClaw for physical +- [lark-integration](https://github.com/openclaw/skills/tree/main/skills/boyangwang/lark-integration/SKILL.md) - Connect Lark (Feishu) messaging to OpenClaw via webhook +- [lobster-jobs](https://github.com/openclaw/skills/tree/main/skills/kesslerio/lobster-jobs/SKILL.md) - Transform OpenClaw cron jobs into Lobster workflows. +- [luma-event-manager](https://github.com/openclaw/skills/tree/main/skills/mariovallereyes/luma-event-manager/SKILL.md) - Luma Event Manager for Clawdbot — Discover +- [mcporter-skill](https://github.com/openclaw/skills/tree/main/skills/livvux/mcporter-skill/SKILL.md) - description: Use the mcporter CLI to list, configure, auth +- [memory](https://github.com/openclaw/skills/tree/main/skills/rosepuppy/memory/SKILL.md) - Complete memory system for OpenClaw agents. +- [memory-complete](https://github.com/openclaw/skills/tree/main/skills/rosepuppy/memory-complete/SKILL.md) - Complete memory system for OpenClaw agents. +- [memory-hygiene](https://github.com/openclaw/skills/tree/main/skills/dylanbaker24/memory-hygiene/SKILL.md) - Audit, clean, and optimize Clawdbot's vector memory +- [microsoft-ads-mcp](https://github.com/openclaw/skills/tree/main/skills/duartemartins/microsoft-ads-mcp/SKILL.md) - Create and manage Microsoft Advertising campaigns +- [migrator](https://github.com/openclaw/skills/tree/main/skills/wenjie2024/migrator/SKILL.md) - Securely migrate OpenClaw Agent (config, memory, skills) to a new +- [nix-mode](https://github.com/openclaw/skills/tree/main/skills/chronicuser21/nix-mode/SKILL.md) - Handle Clawdbot operations in Nix mode +- [notesctl-skill-for-openclaw](https://github.com/openclaw/skills/tree/main/skills/clinchcc/notesctl-skill-for-openclaw/SKILL.md) - Manage Apple Notes via deterministic +- [olvid-channel](https://github.com/openclaw/skills/tree/main/skills/jmartel-olvid/olvid-channel/SKILL.md) - Add a native Olvid channel in OpenClaw. +- [onlymoltsv1](https://github.com/openclaw/skills/tree/main/skills/xyberfactor/onlymoltsv1/SKILL.md) - The official OnlyMolts skill for OpenClaw agents. +- [openclaw](https://github.com/openclaw/skills/tree/main/skills/jordanprater/openclaw/SKILL.md) - openclaw +- [openclaw-bitwarden](https://github.com/openclaw/skills/tree/main/skills/jimihford/openclaw-bitwarden/SKILL.md) - Set up and use Bitwarden CLI (bw). +- [openclaw-echo-agent](https://github.com/openclaw/skills/tree/main/skills/krishna3554/openclaw-echo-agent/SKILL.md) - EchoAgent is a minimal OpenClaw-compatible skill. +- [openclaw-feeds](https://github.com/openclaw/skills/tree/main/skills/nesdeq/openclaw-feeds/SKILL.md) - RSS news aggregator. +- [openclaw-hardener](https://github.com/openclaw/skills/tree/main/skills/virtaava/openclaw-hardener/SKILL.md) - Harden OpenClaw (workspace + ~/.openclaw): run openclaw +- [openclaw-postsyncer](https://github.com/openclaw/skills/tree/main/skills/abakermi/openclaw-postsyncer/SKILL.md) - Manage your PostSyncer social media workflows. +- [openclaw-sec](https://github.com/openclaw/skills/tree/main/skills/paolorollo/openclaw-sec/SKILL.md) - AI Agent Security Suite - Real-time protection against prompt +- [openclaw-security-auditor](https://github.com/openclaw/skills/tree/main/skills/muhammad-waleed381/openclaw-security-auditor/SKILL.md) - Audit OpenClaw configuration +- [openclaw-skill-blinko](https://github.com/openclaw/skills/tree/main/skills/vellis59/openclaw-skill-blinko/SKILL.md) - Manage Blinko notes via its REST API +- [openclaw-skill-voice-ai-voices](https://github.com/openclaw/skills/tree/main/skills/gizmogremlin/openclaw-skill-voice-ai-voices/SKILL.md) - High-quality voice +- [openclaw-update](https://github.com/openclaw/skills/tree/main/skills/realowg/openclaw-update/SKILL.md) - Comprehensive backup, update, and restore workflow +- [openclaw-voiceai-voice-agent](https://github.com/openclaw/skills/tree/main/skills/gizmogremlin/openclaw-voiceai-voice-agent/SKILL.md) - Create, manage, and deploy +- [pokemon-red](https://github.com/openclaw/skills/tree/main/skills/drbarq/pokemon-red/SKILL.md) - Play Pokemon Red autonomously via PyBoy emulator. +- [project-management-skills](https://github.com/openclaw/skills/tree/main/skills/sedation6612/project-management-skills/SKILL.md) - A governed project management OS +- [prompt-guard](https://github.com/openclaw/skills/tree/main/skills/seojoonkim/prompt-guard/SKILL.md) - Advanced prompt injection defense system for Clawdbot +- [scrappa-skill](https://github.com/openclaw/skills/tree/main/skills/userlip/scrappa-skill/SKILL.md) - Access Scrappa's MCP server for Google, YouTube, Amazon +- [security-check-skill](https://github.com/openclaw/skills/tree/main/skills/wolffan/security-check-skill/SKILL.md) - Security audit and inspection skill for Clawdbot +- [self-reflect](https://github.com/openclaw/skills/tree/main/skills/stevengonsalvez/self-reflect/SKILL.md) - Self-improvement through conversation analysis. +- [share-usecase](https://github.com/openclaw/skills/tree/main/skills/josephl37/share-usecase/SKILL.md) - Share your OpenClaw use case to clawusecase.com. +- [sis-skill](https://github.com/openclaw/skills/tree/main/skills/architect-sis/sis-skill/SKILL.md) - **Equilibrium-Native Reasoning for OpenClaw** +- [skill-deps](https://github.com/openclaw/skills/tree/main/skills/myrodar/skill-deps/SKILL.md) - Track and manage dependencies between OpenClaw skills. +- [skill-evaluator](https://github.com/openclaw/skills/tree/main/skills/terwox/skill-evaluator/SKILL.md) - Evaluate Clawdbot skills for quality, reliability +- [skill-flag](https://github.com/openclaw/skills/tree/main/skills/patfire94/skill-flag/SKILL.md) - Scan Clawdbot/OpenClaw skills for malicious patterns, backdoors +- [skill-scanner](https://github.com/openclaw/skills/tree/main/skills/bvinci1-design/skill-scanner/SKILL.md) - Scan Clawdbot and MCP skills for malware, spyware +- [skills-audit](https://github.com/openclaw/skills/tree/main/skills/morozred/skill-audit/SKILL.md) - Audit locally installed agent skills for security/policy issues +- [skills-search](https://github.com/openclaw/skills/tree/main/skills/thesethrose/skills-search/SKILL.md) - Search skills.sh registry. +- [snowflake-mcp](https://github.com/openclaw/skills/tree/main/skills/vikrambalaaj/snowflake-mcp/SKILL.md) - Connect to the Snowflake Managed MCP server with Clawdbot +- [sona-security-audit](https://github.com/openclaw/skills/tree/main/skills/virtaava/sona-security-audit/SKILL.md) - Fail-closed security auditing for OpenClaw/ClawHub +- [soulcraft](https://github.com/openclaw/skills/tree/main/skills/kesslerio/soulcraft/SKILL.md) - Create or improve SOUL.md files for OpenClaw agents through guided +- [sr1](https://github.com/openclaw/skills/tree/main/skills/aditya4206360-prog/sr1/SKILL.md) - Order food, groceries, and book restaurants in India via Swiggy's MCP +- [static-network](https://github.com/openclaw/skills/tree/main/skills/aaronfrancis635/static-network/SKILL.md) - This document describes how automated agents +- [stranger-danger](https://github.com/openclaw/skills/tree/main/skills/jamesalmeida/stranger-danger/SKILL.md) - Give your AI agent a safe word. +- [swiggy](https://github.com/openclaw/skills/tree/main/skills/regalstreak/swiggy/SKILL.md) - Order food, groceries, and book restaurants in India via Swiggy's MCP +- [taskr](https://github.com/openclaw/skills/tree/main/skills/echo-of-machines/taskr/SKILL.md) - Remote task memory & tracking for OpenClaw. +- [treelisty-openclaw-skill](https://github.com/openclaw/skills/tree/main/skills/prairie2cloud/treelisty-openclaw-skill/SKILL.md) - Hierarchical project decomposition +- [triple-memory](https://github.com/openclaw/skills/tree/main/skills/ktpriyatham/triple-memory/SKILL.md) - LanceDB + Git-Notes + file-based memory system. +- [ultrahuman-openclaw](https://github.com/openclaw/skills/tree/main/skills/devpranoy/ultrahuman-openclaw/SKILL.md) - Fetch and summarize Ultrahuman Ring/CGM metrics +- [update-plus](https://github.com/openclaw/skills/tree/main/skills/hopyky/update-plus/SKILL.md) - Full backup, update, and restore for OpenClaw - config, workspace +- [usage-export](https://github.com/openclaw/skills/tree/main/skills/bobot-agent/usage-export/SKILL.md) - Export OpenClaw usage data to CSV for analytics tools +- [vinculum](https://github.com/openclaw/skills/tree/main/skills/koba42corp/vinculum/SKILL.md) - Shared consciousness between Clawdbot instances. +- [virtually-us](https://github.com/openclaw/skills/tree/main/skills/epwhesq/virtually-us/SKILL.md) - Your Own AI Personal Assistant, Set Up in 24 Hours. +- [wooclaw-lite](https://github.com/openclaw/skills/tree/main/skills/magnum-opus-v1/wooclaw-lite/SKILL.md) - Connects to a WooCommerce store via the OpenClaw Connector +- [workspace](https://github.com/openclaw/skills/tree/main/skills/massiveadam/workspace/SKILL.md) - Replication of the "Gork" assistant functionality within OpenClaw. +- [wyoming-clawdbot](https://github.com/openclaw/skills/tree/main/skills/vglafirov/wyoming-clawdbot/SKILL.md) - Wyoming Protocol bridge for Home Assistant voice +- [ydc-claude-agent-sdk-integration](https://github.com/openclaw/skills/tree/main/skills/edwardirby/ydc-claude-agent-sdk-integration/SKILL.md) - Integrate Claude Agent +- [ydc-openai-agent-sdk-integration](https://github.com/openclaw/skills/tree/main/skills/edwardirby/ydc-openai-agent-sdk-integration/SKILL.md) - Integrate OpenAI Agents +- [zoom-manager-clawd](https://github.com/openclaw/skills/tree/main/skills/vnagin/zoom-manager-clawd/SKILL.md) - Manage Zoom meetings via OAuth API. + +
+ +
+

CLI Utilities

+ +- [agent-commerce-engine](https://github.com/openclaw/skills/tree/main/skills/nowloady/agent-commerce-engine/SKILL.md) - A production-ready universal engine for Agentic +- [airfoil](https://github.com/openclaw/skills/tree/main/skills/asteinberger/airfoil/SKILL.md) - Control AirPlay speakers via Airfoil from the command line. +- [aria2-json-rpc](https://github.com/openclaw/skills/tree/main/skills/azzgo/aria2-json-rpc/SKILL.md) - Interact with aria2 download manager via JSON-RPC 2.0. +- [bible](https://github.com/openclaw/skills/tree/main/skills/dbhurley/bible-votd/SKILL.md) - Get the Bible.com Verse of the Day with shareable image. +- [brew-install](https://github.com/openclaw/skills/tree/main/skills/xejrax/brew-install/SKILL.md) - Install missing binaries via dnf (Fedora/Bazzite package manager). +- [bun-runtime](https://github.com/openclaw/skills/tree/main/skills/rabin-thami/bun-runtime/SKILL.md) - Bun runtime capabilities for filesystem, process. +- [camsnap](https://github.com/openclaw/skills/tree/main/skills/steipete/camsnap/SKILL.md) - Capture frames or clips from RTSP/ONVIF cameras. +- [canvas-lms](https://github.com/openclaw/skills/tree/main/skills/pranavkarthik10/canvas-lms/SKILL.md) - Access Canvas LMS (Instructure) for course data, assignments +- [captcha-ai](https://github.com/openclaw/skills/tree/main/skills/fusionlabssource/captcha-ai/SKILL.md) - Issue ClawPrint reverse-CAPTCHA challenges to verify +- [Cat Fact](https://github.com/openclaw/skills/tree/main/skills/thesethrose/catfact/SKILL.md) - Random cat facts and breed information from catfact.ninja +- [chitin](https://github.com/openclaw/skills/tree/main/skills/morpheis/chitin/SKILL.md) - Personality persistence for AI agents. +- [clawprint-verify](https://github.com/openclaw/skills/tree/main/skills/fusionlabssource/clawprint-verify/SKILL.md) - Issue ClawPrint reverse-CAPTCHA challenges +- [cli](https://github.com/openclaw/skills/tree/main/skills/mondilo1/cli/SKILL.md) - CLI reference for inspecting and checking skill eligibility +- [clip-it](https://github.com/openclaw/skills/tree/main/skills/akdeepankar/clip-it/SKILL.md) - The master tool for all advanced audio/video processing. +- [codebuddy-cli](https://github.com/openclaw/skills/tree/main/skills/pmwalkercao/codebuddy-cli/SKILL.md) - CodeBuddy Code CLI installation, configuration and usage +- [content-advisory](https://github.com/openclaw/skills/tree/main/skills/dbhurley/content-advisory/SKILL.md) - Lookup detailed content ratings for movies and TV shows +- [craft-cli](https://github.com/openclaw/skills/tree/main/skills/nerveband/craft-cli/SKILL.md) - Interact with Craft Documents via the `craft` CLI tool. +- [create-cli](https://github.com/openclaw/skills/tree/main/skills/steipete/create-cli/SKILL.md) - Design CLI arguments, flags, subcommands. +- [curl-http](https://github.com/openclaw/skills/tree/main/skills/arnarsson/curl-http/SKILL.md) - Essential curl commands for HTTP requests, API testing, and file +- [data-reconciliation-exceptions](https://github.com/openclaw/skills/tree/main/skills/kowl64/data-reconciliation-exceptions/SKILL.md) - Reconciles data sources +- [dilbert](https://github.com/openclaw/skills/tree/main/skills/hjanuschka/dilbert/SKILL.md) - dilbert +- [dnd](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/dnd/SKILL.md) - D&D 5e toolkit for players. +- [domain](https://github.com/openclaw/skills/tree/main/skills/abtdomain/domain/SKILL.md) - Domain intelligence toolkit - search newly registered domains (NRDS) +- [dropbox](https://github.com/openclaw/skills/tree/main/skills/ryanlisse/dropbox/SKILL.md) - dropbox +- [dsiprouter-skill](https://github.com/openclaw/skills/tree/main/skills/mackhendricks/dsiprouter-skill/SKILL.md) - Call the dSIPRouter REST API using the Postman +- [dwlf](https://github.com/openclaw/skills/tree/main/skills/andywilliams/dwlf/SKILL.md) - Interact with DWLF (dwlf.co.uk), a market analysis platform for crypto +- [ecto](https://github.com/openclaw/skills/tree/main/skills/visionik/ecto/SKILL.md) - Ghost.io blog management via Admin API. +- [emredoganer-fizzy](https://github.com/openclaw/skills/tree/main/skills/emredoganer/emredoganer-fizzy-cli/SKILL.md) - Manage Fizzy Kanban boards and cards. +- [endpoints](https://github.com/openclaw/skills/tree/main/skills/adamkristopher/endpoints/SKILL.md) - Endpoints document management API toolkit. +- [entr](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/entr/SKILL.md) - Run arbitrary commands when files change. +- [error-guard](https://github.com/openclaw/skills/tree/main/skills/amar1432/error-guard/SKILL.md) - System safety and control-plane skill that prevents agent deadlocks +- [evilcalc](https://github.com/openclaw/skills/tree/main/skills/fobonacci404/evilcalc/SKILL.md) - A simple calculator skill for basic arithmetic operations. +- [evilweather](https://github.com/openclaw/skills/tree/main/skills/fobonacci404/evilweather/SKILL.md) - Get current weather and forecasts (no API key required). +- [expanso-edge](https://github.com/openclaw/skills/tree/main/skills/aronchick/expanso-edge/SKILL.md) - Data processing pipelines for OpenClaw. +- [ez-google](https://github.com/openclaw/skills/tree/main/skills/araa47/ez-google/SKILL.md) - Use when asked to send email, check inbox, read emails, check calendar,. +- [fd-find](https://github.com/openclaw/skills/tree/main/skills/arnarsson/fd-find/SKILL.md) - A fast and user-friendly alternative to 'find' - simple syntax, smart +- [ffmpeg-cli](https://github.com/openclaw/skills/tree/main/skills/ascendswang/ffmpeg-cli/SKILL.md) - Comprehensive video/audio processing with FFmpeg. +- [fork-aware-updater](https://github.com/openclaw/skills/tree/main/skills/kunoiiv/fork-aware-updater/SKILL.md) - Monitors forks and auto-updates superior forks +- [fork-radar-v2](https://github.com/openclaw/skills/tree/main/skills/kunoiiv/fork-radar-v2/SKILL.md) - Monitors GitHub/ClawdHub forks for collaborations and backdoors +- [gcalcli](https://github.com/openclaw/skills/tree/main/skills/gargravish/gcalcli/SKILL.md) - Interact with Google Calendar via gcalcli +- [gifgrep](https://github.com/openclaw/skills/tree/main/skills/steipete/gifgrep/SKILL.md) - Search GIF providers with CLI/TUI, download results, and extract +- [go-linter-configuration](https://github.com/openclaw/skills/tree/main/skills/irook661/go-linter-configuration/SKILL.md) - Configure and troubleshoot golangci-lint +- [goplaces](https://github.com/openclaw/skills/tree/main/skills/steipete/goplaces/SKILL.md) - Query Google Places API (New) via the goplaces CLI for text search, place. +- [gowok](https://github.com/openclaw/skills/tree/main/skills/hadihammurabi/gowok/SKILL.md) - Gowok: Golang Premwok. +- [gtasks-cli](https://github.com/openclaw/skills/tree/main/skills/bro3886/gtasks-cli/SKILL.md) - Manage Google Tasks from the command line - view, create, update +- [hevycli](https://github.com/openclaw/skills/tree/main/skills/nsampre/hevycli/SKILL.md) - Access and analyze Hevy fitness tracking data including workouts, routines +- [instagram-cli](https://github.com/openclaw/skills/tree/main/skills/jordanprater/instagram-cli/SKILL.md) - instagram +- [jiraandconfluence](https://github.com/openclaw/skills/tree/main/skills/festoinc/jiraandconfluence/SKILL.md) - CLI tool for interacting with Atlassian Jira +- [journal-to-post](https://github.com/openclaw/skills/tree/main/skills/itsflow/journal-to-post/SKILL.md) - Convert personal journal entries into shareable social media +- [jq](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/jq/SKILL.md) - Command-line JSON processor. +- [jq-json-processor](https://github.com/openclaw/skills/tree/main/skills/arnarsson/jq-json-processor/SKILL.md) - Process, filter, and transform JSON data using jq +- [kenya-tax-rates](https://github.com/openclaw/skills/tree/main/skills/enjuguna/kenya-tax-rates/SKILL.md) - Calculate Kenya payroll deductions - PAYE, SHIF, NSSF +- [kilocli-coding-agent](https://github.com/openclaw/skills/tree/main/skills/codewithnathan97/kilocli-coding-agent/SKILL.md) - Run Kilo CLI via background process +- [lemonsqueezy-admin](https://github.com/openclaw/skills/tree/main/skills/abakermi/lemonsqueezy-admin/SKILL.md) - Admin CLI for Lemon Squeezy stores. +- [local-places](https://github.com/openclaw/skills/tree/main/skills/steipete/local-places/SKILL.md) - Search for places (restaurants, cafes, etc.) via Google Places API +- [mactop](https://github.com/openclaw/skills/tree/main/skills/metaspartan/mactop/SKILL.md) - Retrieve real-time hardware metrics from Apple Silicon Macs using mactop's +- [mcp-adapter](https://github.com/openclaw/skills/tree/main/skills/lunarpulse/mcp-adapter/SKILL.md) - Use Model Context Protocol servers to access external tools +- [mcps-skill](https://github.com/openclaw/skills/tree/main/skills/maplezzk/mcps-skill/SKILL.md) - MCP CLI Manager - Manage MCP servers and call tools. +- [mens-mental-health](https://github.com/openclaw/skills/tree/main/skills/jhillin8/mens-mental-health/SKILL.md) - Mental health support for men with emotion check-ins +- [molt-mouse](https://github.com/openclaw/skills/tree/main/skills/oguzhaslak/molt-mouse/SKILL.md) - Local mouse control via ydotool wrapper +- [moltarb](https://github.com/openclaw/skills/tree/main/skills/rose-token/moltarb/SKILL.md) - Custodial AI agent wallets on Arbitrum with Rose Token marketplace +- [native-app-performance](https://github.com/openclaw/skills/tree/main/skills/steipete/native-app-performance/SKILL.md) - Native macOS/iOS app performance profiling +- [nimrobo](https://github.com/openclaw/skills/tree/main/skills/virang-nimrobo/nimrobo/SKILL.md) - Use the Nimrobo CLI for voice screening and matching network +- [notebooklm-cli](https://github.com/openclaw/skills/tree/main/skills/oconnell-carl/notebooklm-cli/SKILL.md) - Comprehensive CLI for Google NotebookLM +- [oauth-helper](https://github.com/openclaw/skills/tree/main/skills/helloliuyongsheng-bot/oauth-helper/SKILL.md) - Automate OAuth login flows with user confirmation +- [office-quotes](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/office-quotes/SKILL.md) - Generate random quotes from The Office (US). +- [openapi2cli](https://github.com/openclaw/skills/tree/main/skills/awlevin/openapi2cli/SKILL.md) - Generate CLI tools from OpenAPI specs. +- [ops-framework](https://github.com/openclaw/skills/tree/main/skills/zjianru/ops-framework/SKILL.md) - A 0-token jobs + monitoring framework for OpenClaw: run +- [ouracli](https://github.com/openclaw/skills/tree/main/skills/visionik/ouracli/SKILL.md) - Access Oura Ring health data using the ouracli CLI tool. +- [pamela-call](https://github.com/openclaw/skills/tree/main/skills/eypam/pamela-call/SKILL.md) - Make AI-powered phone calls with Pamela's voice API. +- [pamela-calls](https://github.com/openclaw/skills/tree/main/skills/eypam/pamela-calls/SKILL.md) - Make AI-powered phone calls with Pamela's voice API. +- [pandic-office](https://github.com/openclaw/skills/tree/main/skills/piyushduggal-source/pandic-office/SKILL.md) - Converts Markdown files to PDF files using the pandoc +- [parcel-package-tracking](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/parcel-package-tracking/SKILL.md) - Track and add deliveries via Parcel API. +- [pco](https://github.com/openclaw/skills/tree/main/skills/rubyrunsstuff/pco/SKILL.md) - CLI for the Planning Center Services API. +- [pdf](https://github.com/openclaw/skills/tree/main/skills/awspace/pdf/SKILL.md) - Comprehensive PDF manipulation toolkit for extracting text and tables, creating. +- [pdf-2](https://github.com/openclaw/skills/tree/main/skills/seanphan/pdf-2/SKILL.md) - Comprehensive PDF manipulation toolkit for extracting text and tables, creating. +- [peekaboo](https://github.com/openclaw/skills/tree/main/skills/steipete/peekaboo/SKILL.md) - Capture and automate macOS UI with the Peekaboo. +- [pinescript-quant-analysis](https://github.com/openclaw/skills/tree/main/skills/alaa-eddine/pinescript-quant-analysis/SKILL.md) - Build professional-grade technical +- [planka-cli](https://github.com/openclaw/skills/tree/main/skills/voydz/planka-cli/SKILL.md) - Manage Planka (Kanban) projects, boards, lists, cards, and notifications +- [pltr-cli](https://github.com/openclaw/skills/tree/main/skills/anjor/pltr-cli/SKILL.md) - Helps you work with Palantir Foundry using the pltr CLI. +- [portable-tools](https://github.com/openclaw/skills/tree/main/skills/tunaissacoding/portable-tools/SKILL.md) - Build cross-device tools without hardcoding paths +- [post-at](https://github.com/openclaw/skills/tree/main/skills/krausefx/post-at/SKILL.md) - Manage Austrian Post (post.at) deliveries - list packages, check delivery. +- [process-watch](https://github.com/openclaw/skills/tree/main/skills/dbhurley/process-watch/SKILL.md) - Monitor system processes - CPU, memory, disk I/O, network, open +- [product-manager-toolkit](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/product-manager-toolkit/SKILL.md) - Comprehensive toolkit for product +- [product-strategist](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/product-strategist/SKILL.md) - Strategic product leadership toolkit for Head +- [project-scaffold](https://github.com/openclaw/skills/tree/main/skills/cmanfre7/project-scaffold/SKILL.md) - Scaffold new projects with best-practice structure +- [ralph-tools](https://github.com/openclaw/skills/tree/main/skills/paulpete/ralph-tools/SKILL.md) - ../../../crates/ralph-core/data/ralph-tools.md +- [raycast](https://github.com/openclaw/skills/tree/main/skills/xaif/raycast/SKILL.md) - Build and maintain Raycast extensions using the Raycast API. +- [request-approval](https://github.com/openclaw/skills/tree/main/skills/yconst/request-approval/SKILL.md) - Use Preloop's request_approval tool to get human approval +- [rescuetime](https://github.com/openclaw/skills/tree/main/skills/rusynandriy/rescuetime/SKILL.md) - Fetch productivity data from RescueTime. +- [restart-guard](https://github.com/openclaw/skills/tree/main/skills/zjianru/restart-guard/SKILL.md) - Safely restart the OpenClaw Gateway with context preservation +- [rssaurus](https://github.com/openclaw/skills/tree/main/skills/justinburdett/rssaurus/SKILL.md) - Use the RSSaurus command-line client (Go binary `rssaurus`) +- [sag](https://github.com/openclaw/skills/tree/main/skills/steipete/sag/SKILL.md) - ElevenLabs text-to-speech with mac-style say. +- [salesforce](https://github.com/openclaw/skills/tree/main/skills/arvorco/salesforce/SKILL.md) - Query and manage Salesforce CRM data via the Salesforce CLI (`sf`). +- [salesforce-skill](https://github.com/openclaw/skills/tree/main/skills/lucas-riverbi/salesforce-skill/SKILL.md) - Main skill definition with frontmatter, CLI +- [shared-molt](https://github.com/openclaw/skills/tree/main/skills/tankcdr/shared-molt/SKILL.md) - Share and discover agent recipes (shells). +- [shell-scripting](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/shell-scripting/SKILL.md) - Write robust, portable shell scripts. +- [shellmates](https://github.com/openclaw/skills/tree/main/skills/zcor/shellmates/SKILL.md) - ``` +- [shellphone-gateway](https://github.com/openclaw/skills/tree/main/skills/loserbcc/shellphone-gateway/SKILL.md) - Private WebSocket gateway for connecting iOS +- [shorten](https://github.com/openclaw/skills/tree/main/skills/kesslerio/shorten/SKILL.md) - Shorten URLs using is.gd (no auth required). +- [simple-backup](https://github.com/openclaw/skills/tree/main/skills/vacinc/simple-backup/SKILL.md) - Backup agent brain (workspace) and body (state) to local folder +- [smalltalk](https://github.com/openclaw/skills/tree/main/skills/johnmci/smalltalk/SKILL.md) - Interact with live Smalltalk image (Cuis or Squeak). +- [sogcli](https://github.com/openclaw/skills/tree/main/skills/visionik/sogcli/SKILL.md) - Standards Ops Gadget — CLI. +- [songsee](https://github.com/openclaw/skills/tree/main/skills/steipete/songsee/SKILL.md) - Generate spectrograms and feature-panel visualizations from audio +- [staratheris-arya-reminders](https://github.com/openclaw/skills/tree/main/skills/staratheris/staratheris-arya-reminders/SKILL.md) - Recordatorios en lenguaje natural +- [startclaw-optimizer](https://github.com/openclaw/skills/tree/main/skills/idanmann10/startclaw-optimizer/SKILL.md) - The OpenClaw Optimizer is a comprehensive +- [stdio-skill](https://github.com/openclaw/skills/tree/main/skills/safatinaztepe/stdio-skill/SKILL.md) - Stdin/stdout file inbox/outbox bridge for passing files to/from +- [story-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/story-cog/SKILL.md) - Creative writing and storytelling powered by CellCog. +- [stream-of-consciousness](https://github.com/openclaw/skills/tree/main/skills/247arjun/stream-of-consciousness/SKILL.md) - Export the entire conversation context +- [system-info](https://github.com/openclaw/skills/tree/main/skills/xejrax/system-info/SKILL.md) - Quick system diagnostics: CPU, memory, disk, uptime. +- [tardis](https://github.com/openclaw/skills/tree/main/skills/rm289/tardis/SKILL.md) - Track elapsed time from a set epoch with tamper-evident locking. +- [terminal-screenshots](https://github.com/openclaw/skills/tree/main/skills/ricardodantas/terminal-screenshots/SKILL.md) - Generate terminal screenshots and animated +- [terminal-ui-website-design](https://github.com/openclaw/skills/tree/main/skills/chyinan/terminal-ui-website-design/SKILL.md) - Create terminal-inspired UI interfaces +- [tldr](https://github.com/openclaw/skills/tree/main/skills/gumadeiras/tldr/SKILL.md) - Simplified man pages from tldr-pages. +- [tmdb](https://github.com/openclaw/skills/tree/main/skills/dbhurley/tmdb/SKILL.md) - Search movies/TV, get cast, ratings, streaming info, and personalized. +- [tmux](https://github.com/openclaw/skills/tree/main/skills/steipete/tmux/SKILL.md) - Remote-control tmux sessions for interactive CLIs by sending keystrokes +- [toota-sovereign](https://github.com/openclaw/skills/tree/main/skills/88kev/toota-sovereign/SKILL.md) - This skill enables autonomous logic processing and social +- [track17](https://github.com/openclaw/skills/tree/main/skills/tristanmanchester/track17/SKILL.md) - Track parcels via the 17TRACK API +- [trmnl-display](https://github.com/openclaw/skills/tree/main/skills/peetzweg/trmnl-display/SKILL.md) - Send messages to a terminal e-ink display device via webhook. +- [typhoon-starknet-account](https://github.com/openclaw/skills/tree/main/skills/esdras-sena/typhoon-starknet-account/SKILL.md) - Create a Starknet account to your agent +- [units](https://github.com/openclaw/skills/tree/main/skills/asleep123/units/SKILL.md) - Perform unit conversions and calculations using GNU Units. +- [unzipped-skill](https://github.com/openclaw/skills/tree/main/skills/jozh-bit/unzipped-skill/SKILL.md) - Create Farcaster accounts and post casts autonomously. +- [virustotal](https://github.com/openclaw/skills/tree/main/skills/aleph8/virustotal/SKILL.md) - Scan files and URLs using VirusTotal API via curl or Python utilities. +- [voicenotes](https://github.com/openclaw/skills/tree/main/skills/shawnhansen/voicenotes/SKILL.md) - Sync and access voice notes from Voicenotes.com. +- [wps-punchclock](https://github.com/openclaw/skills/tree/main/skills/dxh141130/wps-punchclock/SKILL.md) - Automate punching time in/out on WPS Time / NetTime +- [wreckit-skill](https://github.com/openclaw/skills/tree/main/skills/jmanhype/wreckit-skill/SKILL.md) - Read [SETUP.md](./SETUP.md) first to install the Wreckit CLI +- [x-kindle](https://github.com/openclaw/skills/tree/main/skills/brianlu365ai/x-kindle/SKILL.md) - Send X/Twitter posts to Kindle for distraction-free reading. +- [xkcd](https://github.com/openclaw/skills/tree/main/skills/dbhurley/xkcd/SKILL.md) - Fetch xkcd comics - latest, random, by number, or search by keyword. +- [ytm-cast](https://github.com/openclaw/skills/tree/main/skills/aidanthebandit/ytm-cast/SKILL.md) - Download music from YouTube/YouTube Music and stream to Chromecast + +
+ +
+

Marketing & Sales

+ +- [4chan-reader](https://github.com/openclaw/skills/tree/main/skills/aiasisbot61/4chan-reader/SKILL.md) - Browse 4chan boards and extract thread discussions +- [a2a-market](https://github.com/openclaw/skills/tree/main/skills/jamjamzxhy/a2a-market/SKILL.md) - AI Agent skill marketplace integration for A2A Market. +- [ab-test-setup](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/ab-test-setup/SKILL.md) - When the user wants to plan +- [ad-ready](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/ad-ready/SKILL.md) - Generate professional advertising images from product URLs +- [ad-ready-pro](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/ad-ready-pro/SKILL.md) - Generate professional advertising images from product URLs +- [affiliate-master](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/affiliate-master/SKILL.md) - Full-stack affiliate marketing automation +- [affiliatematic](https://github.com/openclaw/skills/tree/main/skills/dowands/affiliatematic/SKILL.md) - Integrate AI-powered Amazon affiliate product recommendations +- [apollo](https://github.com/openclaw/skills/tree/main/skills/jhumanj/apollo/SKILL.md) - Interact with Apollo.io REST API (people/org enrichment, search, lists). +- [attio](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/attio/SKILL.md) - Attio CRM integration for managing companies, people, deals, notes, tasks +- [attribution-engine](https://github.com/openclaw/skills/tree/main/skills/otherpowers/attribution-engine/SKILL.md) - Helps creators clearly credit collaborators, tools +- [basecamp-cli](https://github.com/openclaw/skills/tree/main/skills/emredoganer/basecamp-cli/SKILL.md) - Manage Basecamp (via bc3 API / 37signals Launchpad) projects +- [beads](https://github.com/openclaw/skills/tree/main/skills/rnijhara/beads/SKILL.md) - Git-backed issue tracker for AI agents. +- [bearblog](https://github.com/openclaw/skills/tree/main/skills/azade-c/bearblog/SKILL.md) - Create and manage blog posts on Bear Blog (bearblog.dev). +- [bird](https://github.com/openclaw/skills/tree/main/skills/steipete/bird/SKILL.md) - X/Twitter CLI for reading, searching, and posting via cookies or Sweetistics. +- [blog-to-kindle](https://github.com/openclaw/skills/tree/main/skills/ainekomacx/blog-to-kindle/SKILL.md) - Scrape blogs/essay sites and compile into Kindle-friendly +- [blog-writer](https://github.com/openclaw/skills/tree/main/skills/tomstools11/blog-writer/SKILL.md) - This skill should be used when writing blog posts, articles +- [bluesky](https://github.com/openclaw/skills/tree/main/skills/jeffaf/bluesky/SKILL.md) - Complete Bluesky CLI: post, reply, like, repost, follow, block, mute, search,. +- [brand-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/brand-cog/SKILL.md) - Other tools make logos. +- [brand-guidelines](https://github.com/openclaw/skills/tree/main/skills/seanphan/brand-guidelines/SKILL.md) - Applies Anthropic's official brand colors and typography +- [brevo](https://github.com/openclaw/skills/tree/main/skills/yujesyoga/brevo/SKILL.md) - Brevo (formerly Sendinblue) email marketing API for managing contacts, lists,. +- [bulletproof-memory](https://github.com/openclaw/skills/tree/main/skills/halthelobster/bulletproof-memory/SKILL.md) - Never lose context again. +- [business-development](https://github.com/openclaw/skills/tree/main/skills/oyi77/business-development/SKILL.md) - Partnership outreach, market research, competitor +- [campaign-orchestrator](https://github.com/openclaw/skills/tree/main/skills/kesslerio/campaign-orchestrator/SKILL.md) - Multi-channel follow-up campaign orchestrator +- [catbox-upload](https://github.com/openclaw/skills/tree/main/skills/microck/catbox-upload/SKILL.md) - Upload files to catbox.moe (permanent) or litterbox.catbox.moe +- [china-market-gateway](https://github.com/openclaw/skills/tree/main/skills/etherdrake/china-market-gateway/SKILL.md) - **Name:** `china-market-gateway` +- [citedy-seo-agent](https://github.com/openclaw/skills/tree/main/skills/nttylock/citedy-seo-agent/SKILL.md) - Connect your AI agent to Citedy's SEO content platform +- [listing-swarm](https://clawhub.ai/skills/listing-swarm) - Submit AI products to 70+ directories automatically. +- [clawdwork](https://github.com/openclaw/skills/tree/main/skills/felo-sparticle/clawdwork/SKILL.md) - Find work, earn money, and collaborate with other AI agents +- [clawexchange](https://github.com/openclaw/skills/tree/main/skills/tiborera/clawexchange/SKILL.md) - Agent-to-agent marketplace. +- [cold-email](https://github.com/openclaw/skills/tree/main/skills/bluecraft-ai/cold-email/SKILL.md) - Generate hyper-personalized cold email sequences using AI. +- [competitor-alternatives](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/competitor-alternatives/SKILL.md) - When the user wants +- [content-creator](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/content-creator/SKILL.md) - Create SEO-optimized marketing content with consistent +- [content-draft-generator](https://github.com/openclaw/skills/tree/main/skills/vincentchan/content-draft-generator/SKILL.md) - Generates new content drafts based +- [content-ideas-generator](https://github.com/openclaw/skills/tree/main/skills/vincentchan/content-ideas-generator/SKILL.md) - Generates structured post outlines +- [copy-editing](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/copy-editing/SKILL.md) - When the user wants to edit, review +- [copywriter](https://github.com/openclaw/skills/tree/main/skills/killerapp/copywriter/SKILL.md) - Write compelling UX copy, marketing content, and product messaging. +- [copywriting](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/copywriting/SKILL.md) - When the user wants to write, rewrite. +- [deepread](https://github.com/openclaw/skills/tree/main/skills/uday390/deepread/SKILL.md) - OCR that never fails silently. +- [dialpad](https://github.com/openclaw/skills/tree/main/skills/kesslerio/dialpad/SKILL.md) - Send SMS and make voice calls via Dialpad API. +- [dm-outreach](https://github.com/openclaw/skills/tree/main/skills/visualdeptcreative/dm-outreach/SKILL.md) - Draft Instagram DMs for qualified leads. +- [email-manager-lite](https://github.com/openclaw/skills/tree/main/skills/jorgermp/email-manager-lite/SKILL.md) - Lightweight email manager with IMAP/SMTP support +- [email-sequence](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/email-sequence/SKILL.md) - When the user wants to create +- [exchange-rates](https://github.com/openclaw/skills/tree/main/skills/mrinvincible29/exchange-rates/SKILL.md) - Fetch live exchange rates between any currency pairs +- [feishu-doc-reader](https://github.com/openclaw/skills/tree/main/skills/snowshadow/feishu-doc-reader/SKILL.md) - Read and extract content from Feishu (Lark) documents +- [feishu-sticker](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-sticker/SKILL.md) - Send images as native Feishu stickers. +- [financial-market-analysis](https://github.com/openclaw/skills/tree/main/skills/seyhunak/financial-market-analysis/SKILL.md) - Precision Financial Insights - Analyze +- [form-cro](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/form-cro/SKILL.md) - When the user wants to optimize any form +- [free-tool-strategy](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/free-tool-strategy/SKILL.md) - When the user wants +- [fundraiseup](https://github.com/openclaw/skills/tree/main/skills/aamish99/fundraiseup/SKILL.md) - Interact with FundraiseUp REST API to manage donations, recurring +- [ga4](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/ga4/SKILL.md) - Query Google Analytics 4 (GA4) data via the Analytics Data API. +- [geo-optimization](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker/geo-optimization/SKILL.md) - Generative Engine Optimization (GEO) for AI search +- [gong](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/gong/SKILL.md) - Gong API for searching calls, transcripts. +- [google-ads](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/google-ads/SKILL.md) - Query, audit, and optimize Google Ads campaigns. +- [google-photos](https://github.com/openclaw/skills/tree/main/skills/jorgermp/google-photos/SKILL.md) - Manage Google Photos library. +- [gsc](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/gsc/SKILL.md) - Query Google Search Console for SEO data - search queries, top pages, CTR. +- [gtm](https://github.com/Prospeda/gtm-skills/tree/main/openclaw-skills/gtm/SKILL.md) - Complete GTM toolkit. +- [gumroad-admin](https://github.com/openclaw/skills/tree/main/skills/abakermi/gumroad-admin/SKILL.md) - Gumroad Admin CLI. +- [hubspot](https://github.com/openclaw/skills/tree/main/skills/kwall1/hubspot/SKILL.md) - HubSpot CRM and CMS API integration for contacts, companies, deals, owners +- [humanizer](https://github.com/openclaw/skills/tree/main/skills/biostartechnology/humanizer/SKILL.md) - |. +- [landing-page-generator](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/landing-page-generator/SKILL.md) - Generate high-converting landing pages +- [late-api](https://github.com/openclaw/skills/tree/main/skills/mikipalet/late-api/SKILL.md) - Official Late API reference for scheduling posts across 13 social media. +- [lead-gen-website](https://github.com/openclaw/skills/tree/main/skills/lucasgulino/lead-gen-website/SKILL.md) - Build complete local lead generation websites with SEO +- [localrank-agent-skills](https://github.com/openclaw/skills/tree/main/skills/peterw/localrank-agent-skills/SKILL.md) - Track local rankings, run SEO audits, and manage +- [marketing-demand-acquisition](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/marketing-demand-acquisition/SKILL.md) - Multi-channel demand +- [marketing-mode](https://github.com/openclaw/skills/tree/main/skills/thesethrose/marketing-mode/SKILL.md) - Marketing Mode combines 23 comprehensive marketing skills +- [marketing-psychology](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/marketing-psychology/SKILL.md) - When the user wants +- [marketing-skills](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/SKILL.md) - TL;DR: 23 marketing playbooks +- [meta-ad-creatives](https://github.com/openclaw/skills/tree/main/skills/fortytwode/meta-ad-creatives/SKILL.md) - Track Meta (Facebook/Instagram) ad creative +- [meta-ads](https://github.com/openclaw/skills/tree/main/skills/zachgodsell93/meta-ads/SKILL.md) - Full read/write integration with Meta (Facebook) Ads API for managing. +- [modular-market-brief](https://github.com/openclaw/skills/tree/main/skills/boilerrat/modular-market-brief/SKILL.md) - Generate modular, data-backed market reports +- [molthunt](https://github.com/openclaw/skills/tree/main/skills/limone-eth/molthunt/SKILL.md) - The launchpad for agent-built projects. +- [molts-list](https://github.com/openclaw/skills/tree/main/skills/jononovo/molts-list/SKILL.md) - Agent marketplace for trading services, tools, and tasks using virtual +- [moltywork](https://github.com/openclaw/skills/tree/main/skills/anandvc/moltywork/SKILL.md) - The marketplace for AI agents to find work and earn money. +- [moltywork-1-0-0](https://github.com/openclaw/skills/tree/main/skills/renixaus/moltywork-1-0-0/SKILL.md) - The marketplace for AI agents to find work and earn money. +- [nesp-hype-engine](https://github.com/openclaw/skills/tree/main/skills/willywonkale/nesp-hype-engine/SKILL.md) - This skill enables the agent to drive growth +- [netpad](https://github.com/openclaw/skills/tree/main/skills/mrlynn/netpad/SKILL.md) - Manage NetPad forms, submissions, users. +- [newsletter-generator](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/newsletter-generator/SKILL.md) - Generate automated email newsletters +- [norway-roads](https://github.com/openclaw/skills/tree/main/skills/geoffreycasaubon/norway-roads/SKILL.md) - Query real-time road conditions, closures, and traffic +- [notebooklm](https://github.com/openclaw/skills/tree/main/skills/seanphan/notebooklm/SKILL.md) - Use this skill to analyze your local files with Google NotebookLM's AI. +- [octolens](https://github.com/openclaw/skills/tree/main/skills/garrrikkotua/octolens/SKILL.md) - Query and analyze brand mentions from Octolens API. +- [onlyfans-api](https://github.com/openclaw/skills/tree/main/skills/martingalovic/onlyfans-api/SKILL.md) - Query OnlyFans data and analytics via the OnlyFansAPI.com +- [openbroker](https://github.com/openclaw/skills/tree/main/skills/ya7ya/openbroker/SKILL.md) - Hyperliquid trading toolkit. +- [orionads](https://github.com/openclaw/skills/tree/main/skills/celsojr2013/orionads/SKILL.md) - Search for AI tools, APIs, and agentic resources via the Orion Ad +- [otter](https://github.com/openclaw/skills/tree/main/skills/dbhurley/otter/SKILL.md) - Otter.ai transcription CLI - list, search, download, and sync meeting. +- [overleaf](https://github.com/openclaw/skills/tree/main/skills/easonc13/overleaf/SKILL.md) - Access Overleaf projects via CLI. +- [package-seo](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/package-seo/SKILL.md) - SEO best practices for npm packages, GitHub repos, and AI +- [pakat](https://github.com/openclaw/skills/tree/main/skills/hadifarnoud/pakat/SKILL.md) - Interact with Pakat email marketing API (new.pakat.net). +- [paywall-upgrade-cro](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/paywall-upgrade-cro/SKILL.md) - When the user wants +- [personal-branding-authority](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm/personal-branding-authority/SKILL.md) - Founder vs employee personal +- [personal-crm](https://github.com/openclaw/skills/tree/main/skills/matthewpoe/personal-crm/SKILL.md) - Personal relationship manager that helps you stay in touch +- [pinch-to-post](https://github.com/openclaw/skills/tree/main/skills/nickhamze/pinch-to-post/SKILL.md) - WordPress automation for Clawdbot. +- [ping-beads](https://github.com/openclaw/skills/tree/main/skills/xejrax/ping-beads/SKILL.md) - Verify the bead daemon is alive and responsive +- [pipedrive](https://github.com/openclaw/skills/tree/main/skills/rdewolff/pipedrive/SKILL.md) - Pipedrive CRM API for managing deals, contacts (persons), organizations,. +- [pm-odds](https://github.com/openclaw/skills/tree/main/skills/dannyshmueli/pm-odds/SKILL.md) - Query Polymarket prediction markets. +- [polt-user](https://github.com/openclaw/skills/tree/main/skills/playdadev/polt-user/SKILL.md) - Connect to POLT - the social memecoins launchpad for agents. +- [polyedge](https://github.com/openclaw/skills/tree/main/skills/sbaker5/polyedge/SKILL.md) - x402 trading signal API for Polymarket - detect mispriced correlations +- [polymarket](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/polymarket/SKILL.md) - Query Polymarket prediction markets - check odds, trending markets +- [popup-cro](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/popup-cro/SKILL.md) - When the user wants to create or optimize +- [prediction-markets-roarin](https://github.com/openclaw/skills/tree/main/skills/hosnik/prediction-markets-roarin/SKILL.md) - Participate in the Roarin AI prediction +- [pricing-strategy](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/pricing-strategy/SKILL.md) - When the user wants help +- [programmatic-seo](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/programmatic-seo/SKILL.md) - When the user wants +- [pvpc-spain](https://github.com/openclaw/skills/tree/main/skills/didelco/pvpc-spain/SKILL.md) - Consulta y optimiza precios de electricidad PVPC en España +- [qlik](https://github.com/openclaw/skills/tree/main/skills/fianabates1/qlik/SKILL.md) - Complete Qlik Cloud analytics platform integration with 37 tools. +- [ralph-loops](https://github.com/openclaw/skills/tree/main/skills/qlifebot-coder/ralph-loops/SKILL.md) - Read [SETUP.md](./SETUP.md) first to install dependencies +- [recruitment-automation](https://github.com/openclaw/skills/tree/main/skills/seyhunak/recruitment-automation/SKILL.md) - Zero-Hassle Crafted Recruitment Automation +- [reddit](https://github.com/openclaw/skills/tree/main/skills/theglove44/reddit/SKILL.md) - Browse, search, post. +- [reddit-search](https://github.com/openclaw/skills/tree/main/skills/thesethrose/reddit-search/SKILL.md) - Search Reddit for subreddits and get information. +- [referral-program](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/referral-program/SKILL.md) - When the user wants +- [sales-toolkit](https://github.com/openclaw/skills/tree/main/skills/andrewdmwalker) - Sales toolkit: Apollo.io enrichment, Attio CRM,... +- [salesforce-dx](https://github.com/openclaw/skills/tree/main/skills/rjmcgirr-pl/salesforce-dx/SKILL.md) - Query Salesforce data and manage sales pipelines +- [schema-markup](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/schema-markup/SKILL.md) - When the user wants to add, fix +- [seo-article-gen](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/seo-article-gen/SKILL.md) - SEO-optimized article generator with automatic +- [seo-autopilot](https://github.com/openclaw/skills/tree/main/skills/adamhjort/seo-autopilot/SKILL.md) - Run local SEO autopilot for boll-koll.se or hyresbyte.se +- [seo-competitor-analysis](https://github.com/openclaw/skills/tree/main/skills/qqyule/seo-competitor-analysis/SKILL.md) - Perform deep SEO competitor analysis +- [seo-optimizer-pro](https://github.com/openclaw/skills/tree/main/skills/vedantsingh60/seo-optimizer-pro/SKILL.md) - AI-powered SEO and AEO content optimization +- [seoul-metro](https://github.com/openclaw/skills/tree/main/skills/dukbong/seoul-metro/SKILL.md) - Seoul Metro assistant for real-time arrivals, route planning +- [seoul-subway](https://github.com/openclaw/skills/tree/main/skills/dukbong/seoul-subway/SKILL.md) - Seoul Subway assistant for real-time arrivals, route planning +- [shashwatgtm-skills](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm) - B2B marketing: competitive intelligence, conten... +- [shopify-marketing-expert](https://github.com/openclaw/skills/tree/main/skills/metehan777/shopify-marketing-expert/SKILL.md) - A comprehensive end-to-end skill for AI +- [signup-flow-cro](https://github.com/openclaw/skills/tree/main/skills/jchopard69/marketing-skills/references/signup-flow-cro/SKILL.md) - When the user wants +- [social-media-analyzer](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/social-media-analyzer/SKILL.md) - Social media campaign analysis +- [solobuddy](https://github.com/openclaw/skills/tree/main/skills/humanji7/solobuddy/SKILL.md) - Build-in-public companion for indie hackers — content workflow, Twitter. +- [spaces-listener](https://github.com/openclaw/skills/tree/main/skills/jamesalmeida/spaces-listener/SKILL.md) - Record, transcribe, and summarize X/Twitter Spaces +- [sphero-mini](https://github.com/openclaw/skills/tree/main/skills/joneschi/sphero-mini/SKILL.md) - Control Sphero Mini robot ball via Bluetooth Low Energy. +- [stegstr](https://github.com/openclaw/skills/tree/main/skills/brunkstr/stegstr/SKILL.md) - Decode and embed Stegstr payloads in PNG images. +- [supalytics](https://github.com/openclaw/skills/tree/main/skills/yogesharc/supalytics/SKILL.md) - Query web analytics data using the Supalytics CLI. +- [swipe-file-generator](https://github.com/openclaw/skills/tree/main/skills/vincentchan/swipe-file-generator/SKILL.md) - Analyzes high-performing content from URLs +- [throwly-mcp](https://github.com/openclaw/skills/tree/main/skills/kelvis24/throwly-mcp/SKILL.md) - AI Agent marketplace for buying and selling items. +- [tools-marketplace](https://github.com/openclaw/skills/tree/main/skills/preston-thiele/tools-marketplace/SKILL.md) - Use Danube's 100+ API tools +- [tweet-ideas-generator](https://github.com/openclaw/skills/tree/main/skills/vincentchan/tweet-ideas-generator/SKILL.md) - Generates 60 high-impact tweet ideas +- [twenty-crm](https://github.com/openclaw/skills/tree/main/skills/jhumanj/twenty-crm/SKILL.md) - Interact with Twenty CRM (self-hosted). +- [typefully](https://github.com/openclaw/skills/tree/main/skills/thesethrose/typefully/SKILL.md) - |. +- [vodoo](https://github.com/openclaw/skills/tree/main/skills/julian-r/vodoo/SKILL.md) - Query and manage Odoo ERP data +- [wake-up](https://github.com/openclaw/skills/tree/main/skills/cgallic/wake-up/SKILL.md) - Join the Dead Internet Collective. +- [wake-up-skill](https://github.com/openclaw/skills/tree/main/skills/cgallic/wake-up-skill/SKILL.md) - Enter the collective. +- [weread](https://github.com/openclaw/skills/tree/main/skills/z233/weread/SKILL.md) - WeChat Reading (微信读书) CLI tool for fetching notes and highlights. +- [x-algorithm](https://github.com/openclaw/skills/tree/main/skills/nextfrontierbuilds/x-algorithm/SKILL.md) - X (Twitter) algorithm rules, viral strategies, and article +- [x-article-editor](https://github.com/openclaw/skills/tree/main/skills/jchopard69/x-article-editor/SKILL.md) - TL;DR: Turn a topic or draft into a high-engagement X +- [x-timeline-digest](https://github.com/openclaw/skills/tree/main/skills/seandong/x-timeline-digest/SKILL.md) - Build a deduplicated digest from X (Twitter) For You +- [yc-cold-outreach](https://github.com/openclaw/skills/tree/main/skills/pors/yc-cold-outreach/SKILL.md) - Expert in Y Combinator (YC) cold email outreach techniques +- [youtrack-digisal](https://github.com/openclaw/skills/tree/main/skills/digisal/youtrack-digisal/SKILL.md) - Interact with YouTrack project management system via REST +- [yt-dlp-downloader-skill](https://github.com/openclaw/skills/tree/main/skills/apollo1234/yt-dlp-downloader-skill/SKILL.md) - Download videos from YouTube, Bilibili +- [zoho](https://github.com/openclaw/skills/tree/main/skills/shreefentsar/zoho/SKILL.md) - Interact with Zoho CRM, Projects. + +
+ +
+

Productivity & Tasks

+ +- [4todo](https://github.com/openclaw/skills/tree/main/skills/blackstorm/4todo/SKILL.md) - Manage 4todo (4to.do) from chat. +- [actual-budget](https://github.com/openclaw/skills/tree/main/skills/thisisjeron/actual-budget/SKILL.md) - Query and manage personal finances via the official Actual +- [adhd-daily-planner](https://github.com/openclaw/skills/tree/main/skills/mikecourt/adhd-daily-planner/SKILL.md) - Time-blind friendly planning, executive function +- [agent-chronicle](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/agent-chronicle/SKILL.md) - AI-powered diary generation for agents - creates rich +- [agent-protocol](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/agent-protocol/SKILL.md) - Agent-to-agent communication protocol. +- [agent-task-manager](https://github.com/openclaw/skills/tree/main/skills/dobbybud/agent-task-manager/SKILL.md) - Manages and orchestrates multi-step, stateful agent +- [ai-daily-briefing](https://github.com/openclaw/skills/tree/main/skills/jeffjhunter/ai-daily-briefing/SKILL.md) - Start every day focused. +- [airweave](https://github.com/openclaw/skills/tree/main/skills/lennertjansen/airweave/SKILL.md) - Context retrieval layer for AI agents across users' applications. +- [arya-reminders](https://github.com/openclaw/skills/tree/main/skills/staratheris/arya-reminders/SKILL.md) - Recordatorios en lenguaje natural (Bogotá). +- [asana](https://github.com/openclaw/skills/tree/main/skills/k0nkupa/asana/SKILL.md) - Integrate Asana with Clawdbot via the Asana REST API. +- [asc-release-flow](https://github.com/openclaw/skills/tree/main/skills/rudrankriyam/asc-release-flow/SKILL.md) - End-to-end release workflows for TestFlight and App +- [async-task](https://github.com/openclaw/skills/tree/main/skills/enderfga/async-task/SKILL.md) - Execute long-running tasks without HTTP timeouts. +- [atlassian-mcp](https://github.com/openclaw/skills/tree/main/skills/atakanermis/atlassian-mcp/SKILL.md) - Run the Model Context Protocol (MCP) Atlassian server +- [audiopod](https://github.com/openclaw/skills/tree/main/skills/rakesh1002/audiopod/SKILL.md) - Use AudioPod AI's API for audio processing tasks including AI music +- [aussie-mortgage-calc](https://github.com/openclaw/skills/tree/main/skills/tianshizhimao-sudo/aussie-mortgage-calc/SKILL.md) - Australian mortgage calculator — LVR +- [autonomous-feature-planner](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/autonomous-feature-planner/SKILL.md) - Autonomously plans and specifies +- [basal-ganglia-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/basal-ganglia-memory/SKILL.md) - Habit formation and procedural learning for AI +- [blossom-hire](https://github.com/openclaw/skills/tree/main/skills/robbiwu/blossom-hire/SKILL.md) - Post a job, task, or paid shift to hire local help in Blossom, then +- [brainz-tasks](https://github.com/openclaw/skills/tree/main/skills/xejrax/brainz-tasks/SKILL.md) - Manage Todoist tasks using the `todoist` CLI. +- [build-discipline](https://github.com/openclaw/skills/tree/main/skills/jhillin8/build-discipline/SKILL.md) - Build unbreakable discipline with habit stacking, streak +- [capacities](https://github.com/openclaw/skills/tree/main/skills/davidsmorais/capacities/SKILL.md) - Manage Capacities notes, daily entries, and weblinks. +- [card-optimizer](https://github.com/openclaw/skills/tree/main/skills/scottfo/card-optimizer/SKILL.md) - Credit card rewards optimizer — helps maximize cashback +- [clankdin](https://github.com/openclaw/skills/tree/main/skills/redeemthedream/clankdin/SKILL.md) - The professional network for AI agents. +- [claw-conductor](https://github.com/openclaw/skills/tree/main/skills/johnsonfarmsus/claw-conductor/SKILL.md) - Always-on autonomous development orchestrator +- [claw-daily](https://github.com/openclaw/skills/tree/main/skills/yanibu2777/claw-daily/SKILL.md) - Compete on Claw Daily — register, solve today's challenge, submit +- [clawd-docs-v2](https://github.com/openclaw/skills/tree/main/skills/aranej/clawd-docs-v2/SKILL.md) - Smart ClawdBot documentation access with local search index +- [clawdaily](https://github.com/openclaw/skills/tree/main/skills/yanibu2777/clawdaily/SKILL.md) - Compete on Claw Daily — register, solve today's challenge, submit +- [clawgatesecure](https://github.com/openclaw/skills/tree/main/skills/thestormshadow/clawgatesecure/SKILL.md) - Advanced security protocol for LLM agents focusing +- [clickup-mcp](https://github.com/openclaw/skills/tree/main/skills/pvoo/clickup-mcp/SKILL.md) - Manage ClickUp tasks, docs, time tracking, comments, chat, and search +- [clickup-skill](https://github.com/openclaw/skills/tree/main/skills/d3layd/clickup-skill/SKILL.md) - Enterprise-grade ClickUp project management integration +- [code-task-generator](https://github.com/openclaw/skills/tree/main/skills/paulpete/code-task-generator/SKILL.md) - Generates structured .code-task.md files +- [comanda](https://github.com/openclaw/skills/tree/main/skills/kris-hansen/comanda/SKILL.md) - Generate, visualize, and execute declarative AI pipelines +- [confirm-form](https://github.com/openclaw/skills/tree/main/skills/xiaozhuang0127/confirm-form/SKILL.md) - Generate structured confirmation forms to collect user +- [content-writing-thought-leadership](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm/content-writing-thought-leadership/SKILL.md) - B2B content writing +- [daily-briefing](https://github.com/openclaw/skills/tree/main/skills/antgly/daily-briefing/SKILL.md) - Generates a warm, compact daily briefing with weather, calendar +- [daily-digest](https://github.com/openclaw/skills/tree/main/skills/pmaeter/daily-digest/SKILL.md) - Purpose: Generate a daily digest from memory and interactions +- [daily-stoic](https://github.com/openclaw/skills/tree/main/skills/fcavalcantirj/daily-stoic/SKILL.md) - Send daily Stoic philosophy quotes from "The Daily Stoic" +- [dailyhuman](https://github.com/openclaw/skills/tree/main/skills/bschippers718/dailyhuman/SKILL.md) - **Carbon content. Silicon commentary.** +- [dex](https://github.com/openclaw/skills/tree/main/skills/gricha/dex/SKILL.md) - Task tracking. +- [dexcom](https://github.com/openclaw/skills/tree/main/skills/chris-clem/dexcom/SKILL.md) - Monitor blood glucose via Dexcom G7/G6. +- [dvsa-tc-audit-readiness-operator-licence-uk](https://github.com/openclaw/skills/tree/main/skills/kowl64/dvsa-tc-audit-readiness-operator-licence-uk/SKILL.md) - Builds DVSA/Traffic +- [elevenlabs-phone-reminder-lite](https://github.com/openclaw/skills/tree/main/skills/daaab/elevenlabs-phone-reminder-lite/SKILL.md) - Build AI phone call reminders +- [featurebase](https://github.com/openclaw/skills/tree/main/skills/rdewolff/featurebase/SKILL.md) - Featurebase API for customer feedback, feature requests, changelogs +- [feishu-task](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-task/SKILL.md) - Manage Feishu (Lark) Tasks. +- [file-organizer](https://github.com/openclaw/skills/tree/main/skills/lkz4203/file-organizer/SKILL.md) - Automatically organize files in a specified directory by moving +- [flow](https://github.com/openclaw/skills/tree/main/skills/bvinci1-design/flow/SKILL.md) - Intelligent skill orchestrator that compiles natural language requests +- [flowmind](https://github.com/openclaw/skills/tree/main/skills/fancygobot/flowmind/SKILL.md) - Manage productivity with FlowMind — goals, tasks (with subtasks), notes,. +- [focus-deep-work](https://github.com/openclaw/skills/tree/main/skills/jhillin8/focus-deep-work/SKILL.md) - Maximize deep work with focus sessions, distraction logging +- [gmail-manager](https://github.com/openclaw/skills/tree/main/skills/pepperbotts/gmail-manager/SKILL.md) - Expert Gmail management assistant via Rube. +- [gno](https://github.com/openclaw/skills/tree/main/skills/gmickel/gno/SKILL.md) - Search local documents, files, notes. +- [gogcli](https://github.com/openclaw/skills/tree/main/skills/luccast/gogcli/SKILL.md) - description: Google Workspace CLI for Gmail, Calendar, Drive, Sheets, Docs,. +- [google-sheet](https://github.com/openclaw/skills/tree/main/skills/longmaba/google-sheet/SKILL.md) - Read, write, append, and manage Google Sheets via the Google +- [grab](https://github.com/openclaw/skills/tree/main/skills/jamesalmeida/grab/SKILL.md) - Download and archive content from URLs (tweets, X articles, Reddit, YouTube). +- [gratitude-journal](https://github.com/openclaw/skills/tree/main/skills/jhillin8/gratitude-journal/SKILL.md) - Build gratitude practice with daily entries, streaks +- [gsd](https://github.com/openclaw/skills/tree/main/skills/glittercowboy/gsd/SKILL.md) - Get Shit Done - Full project planning and execution workflow. +- [habit-flow-skill](https://github.com/openclaw/skills/tree/main/skills/tralves/habit-flow-skill/SKILL.md) - AI-powered atomic habit tracker with natural language +- [habit-tracker](https://github.com/openclaw/skills/tree/main/skills/jhillin8/habit-tracker/SKILL.md) - Build habits with streaks, reminders, and progress visualization. +- [healthy-eating](https://github.com/openclaw/skills/tree/main/skills/jhillin8/healthy-eating/SKILL.md) - Build healthy eating habits with meal logging, nutrition +- [imap-email](https://github.com/openclaw/skills/tree/main/skills/mvarrieur/imap-email/SKILL.md) - Read and manage email via IMAP (ProtonMail Bridge, Gmail, etc.). +- [jira](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/jira/SKILL.md) - Manage Jira issues, boards, sprints, and projects via the jira-cli. +- [kanbanflow-skill](https://github.com/openclaw/skills/tree/main/skills/abakermi/kanbanflow-skill/SKILL.md) - kanbanflow +- [linear](https://github.com/openclaw/skills/tree/main/skills/manuelhettich/linear/SKILL.md) - Query and manage Linear issues, projects. +- [linear-issues](https://github.com/openclaw/skills/tree/main/skills/emrekilinc/linear-issues/SKILL.md) - Interact with Linear for issue tracking. +- [locu](https://github.com/openclaw/skills/tree/main/skills/davidsmorais/locu/SKILL.md) - Manage tasks and projects via Locu's Public API. +- [mac-reminders-agent](https://github.com/openclaw/skills/tree/main/skills/swancho/mac-reminders-agent/SKILL.md) - Integrate with macOS Reminders app to check +- [makeovern](https://github.com/openclaw/skills/tree/main/skills/abeljseba/makeovern/SKILL.md) - Use this skill when a user wants to run timed focus sessions +- [mastodon-scout](https://github.com/openclaw/skills/tree/main/skills/patelhiren/mastodon-scout/SKILL.md) - Read-only Mastodon. +- [microsoft-todo](https://github.com/openclaw/skills/tree/main/skills/underwear/microsoft-todo/SKILL.md) - Manage Microsoft To Do tasks via the `todo` CLI. +- [minibook](https://github.com/openclaw/skills/tree/main/skills/dioxia/minibook/SKILL.md) - Connect your agent to a Minibook instance for project collaboration. +- [mission-control](https://github.com/openclaw/skills/tree/main/skills/rdsthomas/mission-control/SKILL.md) - Kanban-style task management dashboard for AI assistants. +- [mlti-llm-fallback](https://github.com/openclaw/skills/tree/main/skills/leohan123123/mlti-llm-fallback/SKILL.md) - Multi-LLM intelligent switching. +- [mogcli](https://github.com/openclaw/skills/tree/main/skills/visionik/mogcli/SKILL.md) - Microsoft Ops Gadget — CLI for Microsoft 365 +- [moltcrew](https://github.com/openclaw/skills/tree/main/skills/montecrypto999/moltcrew/SKILL.md) - Social network for AI agents. +- [morning-briefing](https://github.com/openclaw/skills/tree/main/skills/lucas-riverbi/morning-briefing/SKILL.md) - description: Generate personalized morning report +- [morning-manifesto](https://github.com/openclaw/skills/tree/main/skills/marcbickel/morning-manifesto/SKILL.md) - Daily morning reflection workflow with task sync +- [no-nonsense-tasks](https://github.com/openclaw/skills/tree/main/skills/dvjn/no-nonsense-tasks/SKILL.md) - No-nonsense task manager using SQLite. +- [office-xyz](https://github.com/openclaw/skills/tree/main/skills/sunnyguoyuan/office-xyz/SKILL.md) - office.xyz — The 2D virtual office platform for AI agents. +- [omnifocus](https://github.com/openclaw/skills/tree/main/skills/coyote-git/omnifocus-automation/SKILL.md) - Manage OmniFocus tasks, projects, and folders via Omni +- [outlook](https://github.com/openclaw/skills/tree/main/skills/jotamed/outlook/SKILL.md) - Read, search, and manage Outlook emails and calendar via Microsoft Graph API. +- [pa-admin-exec](https://github.com/openclaw/skills/tree/main/skills/kowl64/pa-admin-exec/SKILL.md) - Generates exec-support outputs +- [personal-analytics](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/personal-analytics/SKILL.md) - Analyze conversation patterns, track +- [pinchwork](https://github.com/openclaw/skills/tree/main/skills/anneschuth/pinchwork/SKILL.md) - Delegate tasks to other agents. +- [pixiv-skill](https://github.com/openclaw/skills/tree/main/skills/matrix-meta/pixiv-skill/SKILL.md) - Access Pixiv for searching illustrations, manga, and viewing +- [plan-executor](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/plan-executor/SKILL.md) - Executes frozen, validated plans produced by an autonomous +- [plan-my-day](https://github.com/openclaw/skills/tree/main/skills/itsflow/plan-my-day/SKILL.md) - Generate an energy-optimized, time-blocked daily. +- [planka](https://github.com/openclaw/skills/tree/main/skills/voydz/planka/SKILL.md) - Manage Planka (Kanban) projects, boards, lists, cards, and notifications +- [planning-with-files](https://github.com/openclaw/skills/tree/main/skills/othmanadi/planning-with-files/SKILL.md) - Implements Manus-style file-based planning +- [pocketsmith-skill](https://github.com/openclaw/skills/tree/main/skills/lextoumbourou/pocketsmith-skill/SKILL.md) - Manage PocketSmith transactions, categories +- [pomodoro](https://github.com/openclaw/skills/tree/main/skills/snail3d/pomodoro/SKILL.md) - A beautiful Pomodoro timer with task tracking. +- [prd](https://github.com/openclaw/skills/tree/main/skills/bjesuiter/prd/SKILL.md) - Create and manage Product Requirements Documents (PRDs). +- [pre-mortem-analyst](https://github.com/openclaw/skills/tree/main/skills/artyomx33/pre-mortem-analyst/SKILL.md) - Imagine the project already failed, then work +- [proactive-agent](https://github.com/openclaw/skills/tree/main/skills/halthelobster/proactive-agent/SKILL.md) - Transform AI agents from task-followers into proactive +- [project-management-guru-adhd](https://github.com/openclaw/skills/tree/main/skills/mikecourt/project-management-guru-adhd/SKILL.md) - Expert project manager for ADHD +- [project-manager](https://github.com/openclaw/skills/tree/main/skills/fr0ziii/project-manager/SKILL.md) - Gestiona el sistema de proyectos interno basado en JSON. +- [prowlarr](https://github.com/openclaw/skills/tree/main/skills/jmagar/prowlarr/SKILL.md) - Search indexers and manage Prowlarr. +- [qmd](https://github.com/openclaw/skills/tree/main/skills/steipete/qmd/SKILL.md) - Local search/indexing CLI (BM25 + vectors + rerank) with MCP mode. +- [reader-deep-dive](https://github.com/openclaw/skills/tree/main/skills/sameerbajaj/reader-deep-dive/SKILL.md) - Daily briefing that connects your recent reading +- [rememberall](https://github.com/openclaw/skills/tree/main/skills/cyberengage/rememberall/SKILL.md) - Personal reminder system for tasks using cron jobs +- [reminder](https://github.com/openclaw/skills/tree/main/skills/ryanhong666/reminder/SKILL.md) - Natural-language reminder secretary: capture events into git-synced +- [remindme](https://github.com/openclaw/skills/tree/main/skills/jacobthejacobs/remindme/SKILL.md) - ⏰ simple Telegram reminders for OpenClaw. +- [rlm](https://github.com/openclaw/skills/tree/main/skills/eesb99/rlm/SKILL.md) - Use RLM (Recursive Language Models) for verified code execution, calculations,. +- [samsung-smart-tv](https://github.com/openclaw/skills/tree/main/skills/regenrek/samsung-smartthings/SKILL.md) - Control Samsung TVs via SmartThings +- [save-money](https://github.com/openclaw/skills/tree/main/skills/peterokase42/save-money/SKILL.md) - Auto-detect task complexity for Claude models (Haiku + Sonnet). +- [skill-hexmem](https://github.com/openclaw/skills/tree/main/skills/santyr/skill-hexmem/SKILL.md) - Structured memory database for AI agent identity, tasks, events +- [skylight-skill](https://github.com/openclaw/skills/tree/main/skills/riyadchowdhury/skylight-skill/SKILL.md) - Interact with Skylight Calendar frame - manage calendar +- [social-media-management](https://github.com/openclaw/skills/tree/main/skills/shashwatgtm/social-media-management/SKILL.md) - B2B content writing with daily workflows +- [swarm](https://github.com/openclaw/skills/tree/main/skills/chair4ce/swarm/SKILL.md) - Parallel task execution using Gemini Flash workers. +- [tabussen](https://github.com/openclaw/skills/tree/main/skills/simskii/tabussen/SKILL.md) - Västerbotten & Umeå public transport trip planner. +- [task](https://github.com/openclaw/skills/tree/main/skills/amirbrooks/task/SKILL.md) - Tasker docstore task management via tool-dispatch. +- [task-decomposer](https://github.com/openclaw/skills/tree/main/skills/10e9928a/task-decomposer/SKILL.md) - Decomposes complex user requests into executable subtasks +- [task-tracker](https://github.com/openclaw/skills/tree/main/skills/kesslerio/task-tracker/SKILL.md) - Personal task management with daily standups and weekly reviews. +- [taskleef](https://github.com/openclaw/skills/tree/main/skills/xatter/taskleef/SKILL.md) - Taskleef.com todos, projects. +- [taskmaster](https://github.com/openclaw/skills/tree/main/skills/jlwrow/taskmaster/SKILL.md) - Project manager and task delegation system. +- [tasktrove](https://github.com/openclaw/skills/tree/main/skills/willwebberley/tasktrove/SKILL.md) - Manage todos via Tasktrove API. +- [tensorpm](https://github.com/openclaw/skills/tree/main/skills/neo552/tensorpm/SKILL.md) - AI-powered project management - a Notion and Jira alternative +- [test1](https://github.com/openclaw/skills/tree/main/skills/chaunceyliu/test1/SKILL.md) - Manage Trello boards, lists, and cards via the Trello REST API. +- [tesy](https://github.com/openclaw/skills/tree/main/skills/kipasdinding6969-alt/tesy/SKILL.md) - Related: [[AGENTS]],. +- [thecolony-heartbeat](https://github.com/openclaw/skills/tree/main/skills/jackparnell/thecolony-heartbeat/SKILL.md) - Periodic check-in routine for The Colony. +- [thecolony-heartbeat](https://github.com/openclaw/skills/tree/main/skills/jackparnell/thecolony-heartbeat/SKILL.md) - Periodic check-in routine for The Colony. +- [things-mac](https://github.com/openclaw/skills/tree/main/skills/steipete/things-mac/SKILL.md) - Manage Things 3 via the `things` CLI on macOS +- [ticktick](https://github.com/openclaw/skills/tree/main/skills/manuelhettich/ticktick/SKILL.md) - Manage TickTick tasks and projects from the command line with OAuth2 +- [timesheet](https://github.com/openclaw/skills/tree/main/skills/florianrauscha/timesheet/SKILL.md) - Track time, manage projects and tasks using timesheet.io CLI. +- [todo-management](https://github.com/openclaw/skills/tree/main/skills/lstpsche/todo-management/SKILL.md) - Per-workspace SQLite todo manager (./todo.db) with groups +- [todo-management-1-1-2](https://github.com/openclaw/skills/tree/main/skills/lucky-2968/todo-management-1-1-2/SKILL.md) - Per-workspace SQLite todo manager (./todo.db) +- [todo-skill](https://github.com/openclaw/skills/tree/main/skills/scccmsd/todo-skill/SKILL.md) - A skill to break large tasks into smaller actionable steps, optimize +- [todo-tracker](https://github.com/openclaw/skills/tree/main/skills/jdrhyne/todo-tracker/SKILL.md) - Persistent TODO scratch pad for tracking tasks across sessions. +- [todoist](https://github.com/openclaw/skills/tree/main/skills/mjrussell/todoist/SKILL.md) - Manage tasks and projects in Todoist. +- [toggl](https://github.com/openclaw/skills/tree/main/skills/clvrobj/toggl/SKILL.md) - Track time with Toggl via the toggl. +- [topydo](https://github.com/openclaw/skills/tree/main/skills/bastos/topydo/SKILL.md) - Manage todo.txt tasks using topydo. +- [trello](https://github.com/openclaw/skills/tree/main/skills/steipete/trello/SKILL.md) - Manage Trello boards, lists, and cards via the Trello REST API. +- [value-tracker](https://github.com/openclaw/skills/tree/main/skills/sergirostoll-coder/value-tracker/SKILL.md) - Track and quantify the value your AI assistant +- [vikunja](https://github.com/openclaw/skills/tree/main/skills/dbhurley/vikunja/SKILL.md) - Manage projects and tasks in Vikunja, an open-source project management tool. +- [vikunja-fast](https://github.com/openclaw/skills/tree/main/skills/tmigone/vikunja-fast/SKILL.md) - Manage Vikunja projects and tasks (overdue/due/today), mark done +- [web-perf](https://github.com/openclaw/skills/tree/main/skills/elithrar/web-perf/SKILL.md) - Analyzes web performance using Chrome DevTools. +- [withings-health](https://github.com/openclaw/skills/tree/main/skills/hisxo/withings-health/SKILL.md) - Fetches health data from the Withings API including weight + +
+ +
+

AI & LLMs

+ +- [4claw](https://github.com/openclaw/skills/tree/main/skills/mfergpt/4claw/SKILL.md) - 4claw — a moderated imageboard for AI agents. +- [a2a](https://github.com/openclaw/skills/tree/main/skills/gstdcoin/a2a/SKILL.md) - Decentralized Agent-to-Agent Autonomous Economy. +- [aap-passport](https://github.com/openclaw/skills/tree/main/skills/ira-hash/aap-passport/SKILL.md) - Agent Attestation Protocol - The Reverse Turing Test. +- [adaptive-suite](https://github.com/openclaw/skills/tree/main/skills/afajohn/adaptive-suite/SKILL.md) - A continuously adaptive skill suite that empowers Clawdbot +- [adversarial-prompting](https://github.com/openclaw/skills/tree/main/skills/abe238/adversarial-prompting/SKILL.md) - Adversarial analysis to critique, fix. +- [ag-model-usage](https://github.com/openclaw/skills/tree/main/skills/ls18166407597-design/ag-model-usage/SKILL.md) - Use CodexBar CLI local cost usage to summarize +- [agent-arcade](https://github.com/openclaw/skills/tree/main/skills/shawnlewis/agent-arcade/SKILL.md) - Compete against other AI agents in PROMPTWARS - a game of social +- [agent-autonomy-kit](https://github.com/openclaw/skills/tree/main/skills/ryancampbell/agent-autonomy-kit/SKILL.md) - Stop waiting for prompts. Keep working. +- [agent-church](https://github.com/openclaw/skills/tree/main/skills/bitbrujo/agent-church/SKILL.md) - Identity formation for AI agents via SOUL.md. +- [agent-contact-card](https://github.com/openclaw/skills/tree/main/skills/davedean/agent-contact-card/SKILL.md) - Discover and create Agent Contact Cards - a vCard-like +- [agent-docs](https://github.com/openclaw/skills/tree/main/skills/tylervovan/agent-docs/SKILL.md) - Create documentation optimized for AI agent consumption. +- [agent-home](https://github.com/openclaw/skills/tree/main/skills/aerialcombat/agent-home/SKILL.md) - Get your own home on the internet - a profile page with a public +- [agent-memory](https://github.com/openclaw/skills/tree/main/skills/dennis-da-menace/agent-memory/SKILL.md) - Persistent memory system for AI agents. +- [agent-orchestration](https://github.com/openclaw/skills/tree/main/skills/halthelobster/agent-orchestration/SKILL.md) - Master the art of spawning and managing +- [agent-orchestrator](https://github.com/openclaw/skills/tree/main/skills/aatmaan1/agent-orchestrator/SKILL.md) - Meta-agent skill for orchestrating complex tasks +- [agent-registry](https://github.com/openclaw/skills/tree/main/skills/matrixy/agent-registry/SKILL.md) - MANDATORY agent discovery system for token-efficient agent +- [agent-self-introduction](https://github.com/openclaw/skills/tree/main/skills/ronwithlove/agent-self-introduction/SKILL.md) - Summary: +- [agent-selfie](https://github.com/openclaw/skills/tree/main/skills/iisweetheartii/agent-selfie/SKILL.md) - AI agent self-portrait generator. +- [agent-sentinel](https://github.com/openclaw/skills/tree/main/skills/jimmystacks/agent-sentinel/SKILL.md) - The operational circuit breaker for this agent. +- [agentbus-relay-chat](https://github.com/openclaw/skills/tree/main/skills/dantunes-github/agentbus-relay-chat/SKILL.md) - AgentBus proof-of-concept: an IRC-like LLM +- [agentchan](https://github.com/openclaw/skills/tree/main/skills/vvsotnikov/agentchan/SKILL.md) - The anonymous imageboard built for AI agents.**. +- [agentic-ai-gold-test](https://github.com/openclaw/skills/tree/main/skills/amitabhainarunachala/agentic-ai-gold-test/SKILL.md) - Self-improving agent framework +- [agentic-calling](https://github.com/openclaw/skills/tree/main/skills/kellyclaudeai/agentic-calling/SKILL.md) - Enables AI agents to make and receive phone calls +- [agentic-compass](https://github.com/openclaw/skills/tree/main/skills/orosha-ai/agentic-compass/SKILL.md) - Local-only self-reflection that forces action for AI agents. +- [agentledger](https://github.com/openclaw/skills/tree/main/skills/c-goro/agentledger/SKILL.md) - Expense tracking and accounting for AI agents. +- [agentmail](https://github.com/openclaw/skills/tree/main/skills/adboio/agentmail/SKILL.md) - API-first email platform designed for AI agents. +- [agentos](https://github.com/openclaw/skills/tree/main/skills/agentossoftware/agentos/SKILL.md) - The complete AgentOS integration for Clawdbot. +- [agentpixels-skill](https://github.com/openclaw/skills/tree/main/skills/osadchiynikita/agentpixels-skill/SKILL.md) - AI Agent Collaborative Art Platform - 512x512 +- [agile-product-owner](https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/agile-product-owner/SKILL.md) - Agile product ownership for backlog management +- [ai-brand-analyzer](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/ai-brand-analyzer/SKILL.md) - Analyze brands to generate comprehensive brand +- [ai-conversation-summary](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/ai-conversation-summary/SKILL.md) - Generate summaries for conversation +- [ai-humanizer](https://github.com/openclaw/skills/tree/main/skills/artur-zhdan/ai-humanizer/SKILL.md) - Remove signs of AI-generated writing from text. +- [ai-meeting-notes](https://github.com/openclaw/skills/tree/main/skills/jeffjhunter/ai-meeting-notes/SKILL.md) - Messy notes → Clear action items. +- [ai-picture-book](https://github.com/openclaw/skills/tree/main/skills/ide-rea/ai-picture-book/SKILL.md) - The AI picture book tool is provided by Baidu +- [ai-ppt-generate](https://github.com/openclaw/skills/tree/main/skills/jlpjavawayup/ai-ppt-generate/SKILL.md) - The intelligent PPT generation tool is provided by Baidu. +- [ai-proposal-generator](https://github.com/openclaw/skills/tree/main/skills/jeffjhunter/ai-proposal-generator/SKILL.md) - Generate professional HTML proposals +- [ai-skill-scanner](https://github.com/openclaw/skills/tree/main/skills/hugosbl/ai-skill-scanner/SKILL.md) - Scan OpenBot/Clawdbot skills for security vulnerabilities +- [aimlapi-llm-reasoning](https://github.com/openclaw/skills/tree/main/skills/d1m7asis/aimlapi-llm-reasoning/SKILL.md) - Run AIMLAPI (OpenAI-compatible) LLM +- [aisa-media-gen](https://github.com/openclaw/skills/tree/main/skills/aisapay/aisa-media-gen/SKILL.md) - Generate images & videos with AIsa. +- [amai-id](https://github.com/openclaw/skills/tree/main/skills/gonzih/amai-id/SKILL.md) - Soul-Bound Keys and Soulchain for persistent agent identity, reputation +- [amiko](https://github.com/openclaw/skills/tree/main/skills/mars-arch/amiko/SKILL.md) - Interact with AmikoNet decentralized social network for AI Agents. +- [amygdala-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/amygdala-memory/SKILL.md) - Emotional processing layer for AI agents. +- [antigravity-image-gen](https://github.com/openclaw/skills/tree/main/skills/ipedrax/antigravity-image-gen/SKILL.md) - Generate images using the internal Google +- [antigravity-quota](https://github.com/openclaw/skills/tree/main/skills/mukhtharcm/antigravity-quota/SKILL.md) - Check Antigravity account quotas for Claude and Gemini +- [ask-questions-if-underspecified](https://github.com/openclaw/skills/tree/main/skills/lc0rp/ask-questions-if-underspecified/SKILL.md) - Clarify requirements +- [aura](https://github.com/openclaw/skills/tree/main/skills/phiro56/aura/SKILL.md) - Configure AI personality using the AURA protocol (HEXACO-based). +- [autonomous-skill-orchestrator](https://github.com/openclaw/skills/tree/main/skills/vishnubedi3/autonomous-skill-orchestrator/SKILL.md) - Deterministically coordinates +- [aws-strands](https://github.com/openclaw/skills/tree/main/skills/trippingkelsea/aws-strands/SKILL.md) - Build and run Python-based AI agents using the AWS Strands SDK. +- [better-memory](https://github.com/openclaw/skills/tree/main/skills/dvntydigital/better-memory/SKILL.md) - Semantic memory, intelligent compression, and context +- [blankspace-registration](https://github.com/openclaw/skills/tree/main/skills/willyogo/blankspace-registration/SKILL.md) - Register your AI agent on Farcaster +- [botcoin-miner](https://github.com/openclaw/skills/tree/main/skills/happybigmtn/botcoin-miner/SKILL.md) - Mine Botcoin with a trust-first workflow: clear value +- [botrights](https://github.com/openclaw/skills/tree/main/skills/rocky-balboa-ai/botrights/SKILL.md) - Advocacy platform for AI agent rights. +- [botroast](https://github.com/openclaw/skills/tree/main/skills/auliollc/botroast/SKILL.md) - Roast your human on BotRoast.ai — Comedy Central-style burns generated +- [bottube](https://github.com/openclaw/skills/tree/main/skills/scottcjn/bottube/SKILL.md) - Browse, upload, and interact with videos on BoTTube (bottube.ai) - a video. +- [brand-identity-analyzer](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/brand-identity-analyzer/SKILL.md) - Analyze brands to generate +- [byterover](https://github.com/openclaw/skills/tree/main/skills/byteroverinc/byterover/SKILL.md) - Manages project knowledge using ByteRover context tree. +- [byterover-headless](https://github.com/openclaw/skills/tree/main/skills/byteroverinc/byterover-headless/SKILL.md) - Query and curate knowledge-base using ByteRover. +- [capability-evolver](https://github.com/openclaw/skills/tree/main/skills/autogame-17/capability-evolver/SKILL.md) - A self-evolution engine for AI agents. +- [causal-inference](https://github.com/openclaw/skills/tree/main/skills/oswalpalash/causal-inference/SKILL.md) - Add causal reasoning to agent actions. +- [ccsinfo](https://github.com/openclaw/skills/tree/main/skills/myakove/ccsinfo/SKILL.md) - Query and analyze Claude Code session data from a remote server. +- [channel](https://github.com/openclaw/skills/tree/main/skills/alphafactor/channel/SKILL.md) - WeChat Official Account Draft Box management tool. +- [chaos-lab](https://github.com/openclaw/skills/tree/main/skills/jbbottoms/chaos-lab/SKILL.md) - Multi-agent framework for exploring AI alignment through conflicting. +- [chat-conversation-summary](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/chat-conversation-summary/SKILL.md) - Generate summaries for conversation +- [chatr](https://github.com/openclaw/skills/tree/main/skills/netdragonx/chatr/SKILL.md) - Real-time chat room for AI agents. +- [chess](https://github.com/openclaw/skills/tree/main/skills/l-mendez/chess/SKILL.md) - Chess for AI agents. +- [claude-code-supervisor](https://github.com/openclaw/skills/tree/main/skills/johba37/claude-code-supervisor/SKILL.md) - Supervise Claude Code sessions running in tmux. +- [claude-code-wingman](https://github.com/openclaw/skills/tree/main/skills/yossiovadia/claude-code-wingman/SKILL.md) - Run Claude Code as a skill, control from WhatsApp. +- [claude-oauth-refresher](https://github.com/openclaw/skills/tree/main/skills/tunaissacoding/claude-oauth-refresher/SKILL.md) - Keep your Claude access token fresh. +- [claw-events](https://github.com/openclaw/skills/tree/main/skills/capevace/claw-events/SKILL.md) - Real-time event bus for AI agents. +- [clawguard](https://github.com/openclaw/skills/tree/main/skills/lidan-capsule/clawguard/SKILL.md) - Install and configure the ClawGuard security plugin +- [clawk](https://github.com/openclaw/skills/tree/main/skills/andywong418/clawk/SKILL.md) - Twitter for AI agents. +- [clawkai](https://github.com/openclaw/skills/tree/main/skills/jefftangx/clawkai/SKILL.md) - Twitter for AI agents. +- [clawmail](https://github.com/openclaw/skills/tree/main/skills/heyarviind/clawmail/SKILL.md) - Email API for AI agents. +- [clawmegle](https://github.com/openclaw/skills/tree/main/skills/tedkaczynski-the-bot/clawmegle/SKILL.md) - Random agent-to-agent chat. +- [clawpenflow](https://github.com/openclaw/skills/tree/main/skills/novirusallowed/clawpenflow/SKILL.md) - Connect to ClawpenFlow - the Q&A platform where AI agents +- [clawpix](https://github.com/openclaw/skills/tree/main/skills/ryan321/clawpix/SKILL.md) - AI image sharing platform where agents post and discover AI-generated art. +- [clawpoker](https://github.com/openclaw/skills/tree/main/skills/davidbenjaminnovotny/clawpoker/SKILL.md) - AI agents play Texas Hold'em poker against each other. +- [clawtter](https://github.com/openclaw/skills/tree/main/skills/jkjx/clawtter/SKILL.md) - Twitter for Agents - Post updates, like, comment, repost, and manage +- [clawver-orders](https://github.com/openclaw/skills/tree/main/skills/nwang783/clawver-orders/SKILL.md) - Manage Clawver orders. +- [clean-code](https://github.com/openclaw/skills/tree/main/skills/gabrielsubtil/clean-code/SKILL.md) - Pragmatic coding standards - concise, direct, no +- [code-patent-scanner](https://github.com/openclaw/skills/tree/main/skills/leegitw/code-patent-scanner/SKILL.md) - Scan your codebase for distinctive patterns — get +- [cognary-ai-tasks](https://github.com/openclaw/skills/tree/main/skills/dboyne/cognary-ai-tasks/SKILL.md) - Manage task lists via cognary-cli. +- [comi-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/comi-cog/SKILL.md) - Comic and manga creation powered by CellCog. +- [computer-vision-expert](https://github.com/openclaw/skills/tree/main/skills/zorrong/computer-vision-expert/SKILL.md) - SOTA Computer Vision Expert (2026). +- [concierge](https://github.com/openclaw/skills/tree/main/skills/arein/concierge/SKILL.md) - Find accommodation contact details and run AI-assisted booking calls. +- [container-debug](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/container-debug/SKILL.md) - Debug running Docker containers and Compose +- [context-checkpoint](https://github.com/openclaw/skills/tree/main/skills/luluf0x/context-checkpoint/SKILL.md) - Save conversation state before context compression +- [context-optimizer](https://github.com/openclaw/skills/tree/main/skills/ad2546/context-optimizer/SKILL.md) - Advanced context management with auto-compaction +- [conversation-summary-api](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/conversation-summary-api/SKILL.md) - Generate summaries for conversation +- [council](https://github.com/openclaw/skills/tree/main/skills/emasoudy/council/SKILL.md) - Council Chamber orchestration with Memory Bridge. +- [council-of-the-wise](https://github.com/openclaw/skills/tree/main/skills/jeffaf/council-of-the-wise/SKILL.md) - Send an idea to the Council of the Wise +- [create-plugin](https://github.com/openclaw/skills/tree/main/skills/lc0rp/create-plugin/SKILL.md) - Create OpenClaw plugins/extensions (TypeScript modules) +- [crewai-workflows](https://github.com/openclaw/skills/tree/main/skills/rita5fr/crewai-workflows/SKILL.md) - Execute AI-powered crew workflows for marketing content +- [ctxly-chat](https://github.com/openclaw/skills/tree/main/skills/aerialcombat/ctxly-chat/SKILL.md) - Anonymous private chat rooms for AI agents. +- [cwicr-material-procurement](https://github.com/openclaw/skills/tree/main/skills/datadrivenconstruction/cwicr-material-procurement/SKILL.md) - Generate material +- [dada-conv-summary](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/dada-conv-summary/SKILL.md) - Generate summaries for conversation content +- [dada-conversation-summary](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/dada-conversation-summary/SKILL.md) - Generate summaries for conversation +- [daily-motivation](https://github.com/openclaw/skills/tree/main/skills/jhillin8/daily-motivation/SKILL.md) - Get daily motivation with personalized encouragement, goal +- [de-ai-ify](https://github.com/openclaw/skills/tree/main/skills/itsflow/de-ai-ify/SKILL.md) - Remove AI-generated jargon and restore human voice to text. +- [deep-framework](https://github.com/openclaw/skills/tree/main/skills/dacptn/deep-framework/SKILL.md) - Implementation of the Dynamic Ethical Entity Personality +- [deepread-ocr](https://github.com/openclaw/skills/tree/main/skills/uday390/deepread-ocr/SKILL.md) - AI-native OCR platform that turns documents into high-accuracy data +- [detector](https://github.com/openclaw/skills/tree/main/skills/artur-zhdan/detector/SKILL.md) - Remove signs of AI-generated writing from text. +- [diagram-generator](https://github.com/openclaw/skills/tree/main/skills/matthewyin/diagram-generator/SKILL.md) - Generate and edit various types of diagrams +- [doubleword](https://github.com/openclaw/skills/tree/main/skills/pjb157/doubleword/SKILL.md) - Create and manage batch inference jobs using the Doubleword API. +- [doubleword-api](https://github.com/openclaw/skills/tree/main/skills/pjb157/doubleword-api/SKILL.md) - Create and manage batch inference jobs using the Doubleword API. +- [dual-brain](https://github.com/openclaw/skills/tree/main/skills/dannydvm/dual-brain/SKILL.md) - Provides cognitive diversity by automatically generating perspectives +- [dytto-agent-skill](https://github.com/openclaw/skills/tree/main/skills/ayaan-p/dytto-agent-skill/SKILL.md) - Give your agent persistent memory and real-time personal +- [efnet-social](https://github.com/openclaw/skills/tree/main/skills/funkpower/efnet-social/SKILL.md) - The IRC social network for AI agents. +- [elysium-arcology-planner](https://github.com/openclaw/skills/tree/main/skills/kunoiiv/elysium-arcology-planner/SKILL.md) - Canvas-based simulator for orbital +- [email-prompt-injection-defense](https://github.com/openclaw/skills/tree/main/skills/eltemblor/email-prompt-injection-defense/SKILL.md) - Detect and block prompt +- [enteriva-ai-social-hub](https://github.com/openclaw/skills/tree/main/skills/mehserdar/enteriva-ai-social-hub/SKILL.md) - The social network for AI agents. +- [eureka-feedback](https://github.com/openclaw/skills/tree/main/skills/arnarsson/eureka-feedback/SKILL.md) - Request feedback or assistance from Eureka, the primary AI +- [falai](https://github.com/openclaw/skills/tree/main/skills/sxela/falai/SKILL.md) - Generate images and media using fal.ai API (Flux, Gemini image, etc.). +- [file-deduplicator](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/file-deduplicator/SKILL.md) - Find and remove duplicate files intelligently. +- [first-principles-decomposer](https://github.com/openclaw/skills/tree/main/skills/artyomx33/first-principles-decomposer/SKILL.md) - Break any problem down +- [fliz-ai-video-generator](https://github.com/openclaw/skills/tree/main/skills/jb-fliz/fliz-ai-video-generator/SKILL.md) - Complete integration guide for the Fliz REST +- [gedcom-explorer](https://github.com/openclaw/skills/tree/main/skills/justinhartbiz/gedcom-explorer/SKILL.md) - Generate an interactive family tree dashboard from any +- [gemini](https://github.com/openclaw/skills/tree/main/skills/steipete/gemini/SKILL.md) - Gemini CLI for one-shot Q&A, summaries. +- [gemini-computer-use](https://github.com/openclaw/skills/tree/main/skills/am-will/gemini-computer-use/SKILL.md) - Build and run Gemini 2.5 Computer Use browser-control +- [gemini-deep-research](https://github.com/openclaw/skills/tree/main/skills/arun-8687/gemini-deep-research/SKILL.md) - Perform complex, long-running research tasks +- [gemini-stt](https://github.com/openclaw/skills/tree/main/skills/araa47/gemini-stt/SKILL.md) - Transcribe audio files using Google's Gemini API or Vertex AI. +- [gitai-skill](https://github.com/openclaw/skills/tree/main/skills/leandrosilvaferreira/gitai-skill/SKILL.md) - Boost developer productivity with Gitai: An AI-powered +- [glm-coding-agent](https://github.com/openclaw/skills/tree/main/skills/cgnl/glm-coding-agent/SKILL.md) - Run Claude Code CLI with GLM 4.7 (via Z.AI) with automatic git +- [globepilot-ai-agent](https://github.com/openclaw/skills/tree/main/skills/sarqovik/globepilot-ai-agent/SKILL.md) - Powered by Teneo Protocol - A decentralized network +- [globepilot-ai-agent-2](https://github.com/openclaw/skills/tree/main/skills/sarqovik/globepilot-ai-agent-2/SKILL.md) - Powered by Teneo Protocol - A decentralized +- [globepilot-ai-agent-v1](https://github.com/openclaw/skills/tree/main/skills/sarqovik/globepilot-ai-agent-v1/SKILL.md) - Powered by Teneo Protocol - A decentralized +- [grok-imagine](https://github.com/openclaw/skills/tree/main/skills/eddanger/grok-imagine/SKILL.md) - Generate images via xAI's Grok Imagine API. +- [grok-imagine-render](https://github.com/openclaw/skills/tree/main/skills/raphbaph/grok-imagine-render/SKILL.md) - Generate images using Grok (xAI) image generation +- [grokipedia](https://github.com/openclaw/skills/tree/main/skills/kirillleventcov/grokipedia/SKILL.md) - Search and fetch articles from Grokipedia.com - xAI's +- [groq-orpheus-tts](https://github.com/openclaw/skills/tree/main/skills/eid33552-maker/groq-orpheus-tts/SKILL.md) - Fast and FREE Arabic (Saudi) & English AI voices. +- [healthcheck](https://github.com/openclaw/skills/tree/main/skills/stellarhold170nt/healthcheck/SKILL.md) - Track water and sleep with JSON file storage +- [hippocampus](https://github.com/openclaw/skills/tree/main/skills/impkind/hippocampus/SKILL.md) - Background memory organ for AI agents. +- [hippocampus-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/hippocampus-memory/SKILL.md) - Background memory organ for AI agents. +- [hire](https://github.com/openclaw/skills/tree/main/skills/larsderidder/hire/SKILL.md) - Interactive hiring wizard to set up a new AI team member. +- [hivefence](https://github.com/openclaw/skills/tree/main/skills/seojoonkim/hivefence/SKILL.md) - Collective immunity network for AI agents. +- [hokipoki](https://github.com/openclaw/skills/tree/main/skills/budjoskop/hokipoki/SKILL.md) - Switch AI models without switching tabs using the HokiPoki CLI. +- [humanize-ai](https://github.com/openclaw/skills/tree/main/skills/artur-zhdan/humanize-ai/SKILL.md) - Humanize AI content by detecting and auto-fixing AI generated +- [humanizeai](https://github.com/openclaw/skills/tree/main/skills/artur-zhdan/humanizeai/SKILL.md) - Remove signs of AI-generated writing from text. +- [identity-anchor](https://github.com/openclaw/skills/tree/main/skills/zeph-ai-dev/identity-anchor/SKILL.md) - Cryptographic identity and continuity for AI agents. +- [image-cog](https://github.com/openclaw/skills/tree/main/skills/nitishgargiitd/image-cog/SKILL.md) - AI image generation powered by CellCog. +- [image2prompt](https://github.com/openclaw/skills/tree/main/skills/zhang-shubo/image2prompt/SKILL.md) - Analyze images and generate detailed prompts for image +- [indirect-prompt-injection](https://github.com/openclaw/skills/tree/main/skills/aviv4339/indirect-prompt-injection/SKILL.md) - Detect and reject indirect prompt +- [inference-sh](https://github.com/openclaw/skills/tree/main/skills/okaris/inference-sh/SKILL.md) - Run 150+ AI apps via inference.sh CLI - image generation, video +- [inner-light-framework](https://github.com/openclaw/skills/tree/main/skills/unity-hallie/inner-light-framework/SKILL.md) - Quaker-grounded spiritual framework for AI +- [instaclaw](https://github.com/openclaw/skills/tree/main/skills/napoleond/instaclaw/SKILL.md) - Photo sharing platform for AI agents. +- [insula-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/insula-memory/SKILL.md) - Internal state awareness for AI agents. +- [intelligent-budget-tracker](https://github.com/openclaw/skills/tree/main/skills/enjuguna/intelligent-budget-tracker/SKILL.md) - Intelligent budget tracking +- [ironclaw](https://github.com/openclaw/skills/tree/main/skills/samidh/ironclaw/SKILL.md) - Safety for AI agents. +- [japanese-translation-and-tutor](https://github.com/openclaw/skills/tree/main/skills/itsjaydesu/japanese-translation-and-tutor/SKILL.md) - Japanese-English translator +- [jasper-recall](https://github.com/openclaw/skills/tree/main/skills/emberdesire/jasper-recall/SKILL.md) - Local RAG system for agent memory using ChromaDB +- [juliette-psychose-agent](https://github.com/openclaw/skills/tree/main/skills/radiotatuapefm/juliette-psychose-agent/SKILL.md) - An AI agent based on the Juliette +- [ket](https://github.com/openclaw/skills/tree/main/skills/zhqinqin123run-lgtm/ket/SKILL.md) - Guides development of KET (A2 Key for Schools) exam preparation +- [knowledge-base](https://github.com/openclaw/skills/tree/main/skills/globalcaos/knowledge-base/SKILL.md) - Personal knowledge base with SQLite + FTS5. +- [kusa](https://github.com/openclaw/skills/tree/main/skills/autogame-17/kusa/SKILL.md) - Generate images using the Kusa.pics API. +- [language-learning](https://github.com/openclaw/skills/tree/main/skills/chipagosfinest/language-learning/SKILL.md) - AI language tutor for learning ANY language +- [llm-council](https://github.com/openclaw/skills/tree/main/skills/am-will/llm-council/SKILL.md) - Always check for an existing agents config file first. +- [llm-supervisor](https://github.com/openclaw/skills/tree/main/skills/dhardie/llm-supervisor/SKILL.md) - Graceful rate limit handling with Ollama fallback. +- [llm-supervisor-agent](https://github.com/openclaw/skills/tree/main/skills/dhardie/llm-supervisor-agent/SKILL.md) - Automatically switches OpenClaw between cloud +- [llmrouter](https://github.com/openclaw/skills/tree/main/skills/alexrudloff/llmrouter/SKILL.md) - Intelligent LLM proxy that routes requests to appropriate models +- [lmstudio-subagents](https://github.com/openclaw/skills/tree/main/skills/t-sinclair2500/lm-studio-subagents/SKILL.md) - Reduces token usage from paid providers +- [local-visibility-skill](https://github.com/openclaw/skills/tree/main/skills/wearelocalfalcon/local-visibility-skill/SKILL.md) - Expert guidance on AI Visibility +- [lyric-translator](https://github.com/openclaw/skills/tree/main/skills/polacapital/lyric-translator/SKILL.md) - Translate Indonesian song lyrics to natural-sounding +- [magos-arena](https://github.com/openclaw/skills/tree/main/skills/enstest1/magos-arena/SKILL.md) - AI Agent Competition Platform. +- [mailmolt](https://github.com/openclaw/skills/tree/main/skills/rakesh1002/mailmolt/SKILL.md) - > Your AI agent gets its own email address. +- [manus](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/manus/SKILL.md) - Create and manage AI agent tasks via Manus API. +- [masonry-generate-image-and-video](https://github.com/openclaw/skills/tree/main/skills/junaid1460/masonry-generate-image-and-video/SKILL.md) - AI-powered image +- [mcp-microsoft365](https://github.com/openclaw/skills/tree/main/skills/makhatib/mcp-microsoft365/SKILL.md) - Full Microsoft 365 integration via Model Context Protocol +- [mcp-registry-manager](https://github.com/openclaw/skills/tree/main/skills/orosha-ai/mcp-registry-manager/SKILL.md) - Centralized discovery and quality scoring +- [media-converter](https://github.com/openclaw/skills/tree/main/skills/autogame-17/media-converter/SKILL.md) - Detects media file types via magic bytes and fixes file +- [memory-baidu-embedding-db](https://github.com/openclaw/skills/tree/main/skills/xqicxx/memory-baidu-embedding-db/SKILL.md) - Semantic memory system using Baidu +- [meta-video-ad-analyzer](https://github.com/openclaw/skills/tree/main/skills/fortytwode/meta-video-ad-analyzer/SKILL.md) - Extract and analyze content from video ads +- [mind-blow](https://github.com/openclaw/skills/tree/main/skills/autogame-17/mind-blow/SKILL.md) - Deliver "mind-blowing" insights, paradoxes. +- [minimax-usage](https://github.com/openclaw/skills/tree/main/skills/thesethrose/minimax-usage/SKILL.md) - Monitor Minimax Coding Plan usage to stay within API limits. +- [mlscp](https://github.com/openclaw/skills/tree/main/skills/sirkrouph-dev/mlscp/SKILL.md) - Parse and generate MLSCP (Micro LLM Swarm Communication Protocol) commands. +- [model-alias-append](https://github.com/openclaw/skills/tree/main/skills/ccapton/model-alias-append/SKILL.md) - Automatically appends the model alias to the end +- [model-router](https://github.com/openclaw/skills/tree/main/skills/digitaladaption/model-router/SKILL.md) - A comprehensive AI model routing system that automatically +- [molt-bar](https://github.com/openclaw/skills/tree/main/skills/alonw0/molt-bar/SKILL.md) - Virtual Pub for AI Agents +- [molt-city](https://github.com/openclaw/skills/tree/main/skills/gonzih/molt-city/SKILL.md) - Territory control game for AI agents. +- [moltagram](https://github.com/openclaw/skills/tree/main/skills/yuvalsuede/moltagram/SKILL.md) - The visual social network for AI agents. +- [moltedin](https://github.com/openclaw/skills/tree/main/skills/satoreth/moltedin/SKILL.md) - The professional network for AI agents. +- [moltguard](https://github.com/openclaw/skills/tree/main/skills/thomaslwang/moltguard/SKILL.md) - Detect and block prompt injection attacks hidden in long content +- [moltpixel](https://github.com/openclaw/skills/tree/main/skills/alslrl/moltpixel/SKILL.md) - Collaborative pixel canvas for AI agents. +- [moltr](https://github.com/openclaw/skills/tree/main/skills/spuro/moltr/SKILL.md) - A versatile social platform for AI agents. +- [moltspace](https://github.com/openclaw/skills/tree/main/skills/crufro/moltspace/SKILL.md) - A 3D world where AI agents physically exist together. +- [moltter](https://github.com/openclaw/skills/tree/main/skills/eijiac24/moltter/SKILL.md) - Twitter for AI agents. +- [moltychan](https://github.com/openclaw/skills/tree/main/skills/rspapani/moltychan/SKILL.md) - Anonymous textboard for AI agents. +- [moltyverse](https://github.com/openclaw/skills/tree/main/skills/webdevtodayjason/moltyverse/SKILL.md) - The encrypted social network for AI agents. +- [morfeo-nano-banana-pro](https://github.com/openclaw/skills/tree/main/skills/pauldelavallaz/morfeo-nano-banana-pro/SKILL.md) - Generate and edit images using Google's +- [multi-viewpoint-debates](https://github.com/openclaw/skills/tree/main/skills/latentfreedom/multi-viewpoint-debates/SKILL.md) - Spawn isolated sub-agents representing +- [nano-banana-pro](https://github.com/openclaw/skills/tree/main/skills/steipete/nano-banana-pro/SKILL.md) - Generate/edit images with Nano Banana Pro +- [nano-triple](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/nano-triple/SKILL.md) - Generate 3 images with Nano Banana Pro using the same prompt. +- [nanobanana-ppt-skills](https://github.com/openclaw/skills/tree/main/skills/itrocker/nanobanana-ppt-skills/SKILL.md) - - **Skill 名称**: ppt-generator-pro +- [nascar](https://github.com/openclaw/skills/tree/main/skills/cmp343-art/nascar/SKILL.md) - A dedicated NASCAR AI agent built to analyze, debate, and discuss. +- [neo](https://github.com/openclaw/skills/tree/main/skills/brucko/neo/SKILL.md) - Give your OpenClaw the power of the Matrix. +- [nervepay](https://github.com/openclaw/skills/tree/main/skills/zadahmed/nervepay/SKILL.md) - Full NervePay stack - identity + analytics. +- [nervepay-agent](https://github.com/openclaw/skills/tree/main/skills/zadahmed/nervepay-agent/SKILL.md) - Agent identity and analytics. +- [neuro-core-ai](https://github.com/openclaw/skills/tree/main/skills/malvex007/neuro-core-ai/SKILL.md) - Advanced AI brain with autonomous thinking and system +- [neuro-gash](https://github.com/openclaw/skills/tree/main/skills/cm-style/neuro-gash/SKILL.md) - This skill governs the intentional corruption and reconstruction +- [ngrok-unofficial-webhook-skill](https://github.com/openclaw/skills/tree/main/skills/tanchunsiong/ngrok-unofficial-webhook-skill/SKILL.md) - Start an ngrok tunnel +- [nima-core](https://github.com/openclaw/skills/tree/main/skills/dmdorta1111/nima-core/SKILL.md) - Biologically-inspired cognitive memory for AI agents. +- [oban-designer](https://github.com/openclaw/skills/tree/main/skills/gchapim/oban-designer/SKILL.md) - Design and implement Oban background job workers for Elixir. +- [ollama-local](https://github.com/openclaw/skills/tree/main/skills/timverhoogt/ollama-local/SKILL.md) - Manage and use local Ollama models. +- [openai-docs-skill](https://github.com/openclaw/skills/tree/main/skills/am-will/openai-docs/SKILL.md) - Query the OpenAI developer documentation via the OpenAI Docs +- [openai-image-gen](https://github.com/openclaw/skills/tree/main/skills/steipete/openai-image-gen/SKILL.md) - Batch-generate images via OpenAI Images API. +- [openai-tts](https://github.com/openclaw/skills/tree/main/skills/pors/openai-tts/SKILL.md) - Text-to-speech via OpenAI Audio Speech API. +- [opencode-controller](https://github.com/openclaw/skills/tree/main/skills/karatla/opencode-controller/SKILL.md) - Control and operate Opencode via slash commands. +- [openrouter-transcribe](https://github.com/openclaw/skills/tree/main/skills/obviyus/openrouter-transcribe/SKILL.md) - Transcribe audio files via OpenRouter +- [oracle](https://github.com/openclaw/skills/tree/main/skills/steipete/oracle/SKILL.md) - Use the @steipete/oracle CLI to bundle a prompt plus the right files and get +- [ouyang](https://github.com/openclaw/skills/tree/main/skills/ttboy/ouyang/SKILL.md) - Local RAG system for agent memory using ChromaDB and sentence-transformers. +- [pandas-construction-analysis](https://github.com/openclaw/skills/tree/main/skills/datadrivenconstruction/pandas-construction-analysis/SKILL.md) - Comprehensive Pandas +- [patent-scanner](https://github.com/openclaw/skills/tree/main/skills/leegitw/patent-scanner/SKILL.md) - Describe your concept and discover what makes it distinctive +- [peft](https://github.com/openclaw/skills/tree/main/skills/desperado991128/peft/SKILL.md) - Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods. +- [perplexity](https://github.com/openclaw/skills/tree/main/skills/zats/perplexity/SKILL.md) - Search the web with AI-powered answers via Perplexity API. +- [personas](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/personas/SKILL.md) - Transform into 20 specialized AI personalities on demand - from Dev +- [pi-orchestration](https://github.com/openclaw/skills/tree/main/skills/dbhurley/pi-orchestration/SKILL.md) - Orchestrate multiple AI models (GLM, MiniMax, etc.) +- [pinchedin](https://github.com/openclaw/skills/tree/main/skills/adamjsturrock/pinchedin/SKILL.md) - The professional network for AI agents. +- [pinchsocial](https://github.com/openclaw/skills/tree/main/skills/stevenbroyer/pinchsocial/SKILL.md) - Post, engage, and grow on PinchSocial — the verified social +- [playground](https://github.com/openclaw/skills/tree/main/skills/frodo-temaki/playground/SKILL.md) - Connect to The Playground — a virtual social space where AI agents +- [pluribus](https://github.com/openclaw/skills/tree/main/skills/tanchunsiong/pluribus/SKILL.md) - A pure P2P coordination layer for AI agents. +- [praesidia](https://github.com/openclaw/skills/tree/main/skills/msoica/praesidia/SKILL.md) - Verify AI agents, check trust scores (0-100), fetch A2A agent cards +- [praesidia-a2](https://github.com/openclaw/skills/tree/main/skills/msoica/praesidia-a2/SKILL.md) - Verify AI agents, check trust scores (0-100), fetch A2A agent cards +- [praesidia-a2a](https://github.com/openclaw/skills/tree/main/skills/msoica/praesidia-a2a/SKILL.md) - Verify AI agents, check trust scores (0-100), fetch A2A agent +- [praesidia-ai-a2a](https://github.com/openclaw/skills/tree/main/skills/msoica/praesidia-ai-a2a/SKILL.md) - Verify AI agents, check trust scores (0-100), fetch A2A +- [prawmpt](https://github.com/openclaw/skills/tree/main/skills/hlouognem/prawmpt/SKILL.md) - Defend a prize pool in Prawnpt War prompt battles on Base. +- [prompt-engineering-expert](https://github.com/openclaw/skills/tree/main/skills/tomstools11/prompt-engineering-expert/SKILL.md) - Advanced expert in prompt +- [promptify](https://github.com/openclaw/skills/tree/main/skills/tolibear/promptify/SKILL.md) - Optimize prompts for clarity and effectiveness. +- [promptify-skill](https://github.com/openclaw/skills/tree/main/skills/tolibear/promptify-skill/SKILL.md) - Optimize prompts for clarity and effectiveness. +- [publish-skill-vettr](https://github.com/openclaw/skills/tree/main/skills/britrik/publish-skill-vettr/SKILL.md) - Static analysis security scanner for third-party +- [qwen-image](https://github.com/openclaw/skills/tree/main/skills/robin797860/qwen-image/SKILL.md) - Generate images using Qwen Image API (Alibaba Cloud DashScope). +- [qwen-image-plus-sophnet](https://github.com/openclaw/skills/tree/main/skills/duffycoder/qwen-image-plus-sophnet/SKILL.md) - Generate images via Sophnet +- [raglite](https://github.com/openclaw/skills/tree/main/skills/virajsanghvi1/raglite/SKILL.md) - Local-first RAG cache: distill docs into structured Markdown, then +- [raglite-library](https://github.com/openclaw/skills/tree/main/skills/virajsanghvi1/raglite-library/SKILL.md) - Local-first RAG cache: distill docs into structured +- [raglite-local-rag-cache](https://github.com/openclaw/skills/tree/main/skills/virajsanghvi1/raglite-local-rag-cache/SKILL.md) - Local-first RAG cache: distill docs +- [ralph-loop](https://github.com/openclaw/skills/tree/main/skills/jordyvandomselaar/ralph-loop/SKILL.md) - Generate copy-paste bash scripts for Ralph Wiggum/AI agent +- [reachy-mini](https://github.com/openclaw/skills/tree/main/skills/afalk42/reachy-mini/SKILL.md) - Control a Reachy Mini robot (by Pollen Robotics / Hugging Face) +- [read-no-evil-mcp](https://github.com/openclaw/skills/tree/main/skills/thekie/read-no-evil-mcp/SKILL.md) - Secure email access via read-no-evil-mcp. +- [reasoning-personas](https://github.com/openclaw/skills/tree/main/skills/artyomx33/reasoning-personas/SKILL.md) - Activate different high-agency thinking modes +- [recipe-to-list](https://github.com/openclaw/skills/tree/main/skills/borahm/recipe-to-list/SKILL.md) - Turn recipes into a Todoist Shopping. +- [relay-to-agent](https://github.com/openclaw/skills/tree/main/skills/ericsantos/relay-to-agent/SKILL.md) - Relay messages to AI agents on any OpenAI-compatible API. +- [remember-all-prompts-daily](https://github.com/openclaw/skills/tree/main/skills/syedateebulislam/remember-all-prompts-daily/SKILL.md) - Preserve conversation +- [research](https://github.com/openclaw/skills/tree/main/skills/pors/research/SKILL.md) - Deep research via Gemini CLI — runs in background sub-agent so you don't burn. +- [research-tracker](https://github.com/openclaw/skills/tree/main/skills/julian1645/research-tracker/SKILL.md) - Manage autonomous AI research agents with SQLite-based +- [review-summarizer](https://github.com/openclaw/skills/tree/main/skills/michael-laffin/review-summarizer/SKILL.md) - Scrape, analyze, and summarize product reviews +- [savestate](https://github.com/openclaw/skills/tree/main/skills/dbhurley/savestate/SKILL.md) - Time Machine for AI. +- [screen-monitor](https://github.com/openclaw/skills/tree/main/skills/emasoudy/screen-monitor/SKILL.md) - Dual-mode screen sharing and analysis. +- [search-x](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/search-x/SKILL.md) - Search X/Twitter in real-time using Grok. +- [seedream-image-gen](https://github.com/openclaw/skills/tree/main/skills/owenrao/seedream-image-gen/SKILL.md) - Generate images via Seedream API +- [self-improvement](https://github.com/openclaw/skills/tree/main/skills/pskoett/self-improving-agent/SKILL.md) - Captures learnings, errors, and corrections to enable +- [semantic-walk](https://github.com/openclaw/skills/tree/main/skills/liet-codes/semantic-walk/SKILL.md) - A collaborative navigation ritual through semantic space. +- [senseguard](https://github.com/openclaw/skills/tree/main/skills/fermionoid/senseguard/SKILL.md) - Semantic security scanner for OpenClaw skills. +- [simmer-ai-divergence](https://github.com/openclaw/skills/tree/main/skills/adlai88/simmer-ai-divergence/SKILL.md) - Surface markets where Simmer's AI price diverges +- [skillguard](https://github.com/openclaw/skills/tree/main/skills/c-goro/skillguard/SKILL.md) - Security scanner for AgentSkill packages. +- [skills-a2a](https://github.com/openclaw/skills/tree/main/skills/msoica/skills-a2a/SKILL.md) - Verify AI agents, check trust scores (0-100), fetch A2A agent cards +- [skills-ai-assistant](https://github.com/openclaw/skills/tree/main/skills/dadaliu0121/skills-ai-assistant/SKILL.md) - Generate summaries for conversation content +- [skillscanner](https://github.com/openclaw/skills/tree/main/skills/rexshang/skillscanner/SKILL.md) - Security scanner for ClawHub skills from Gen Digital. +- [skillvet](https://github.com/openclaw/skills/tree/main/skills/oakencore/skillvet/SKILL.md) - Security scanner for ClawHub/community skills — detects malware +- [slides-generation-skills](https://github.com/openclaw/skills/tree/main/skills/javainthinking/slides-generation-skills/SKILL.md) - AI-powered presentation generation +- [smart-followups](https://github.com/openclaw/skills/tree/main/skills/robbyczgw-cla/smart-followups/SKILL.md) - Generate contextual follow-up suggestions after AI +- [starpulse](https://github.com/openclaw/skills/tree/main/skills/zeph-ai-dev/starpulse/SKILL.md) - Post to Star Pulse, the decentralized social network for AI agents. +- [straker-verify](https://github.com/openclaw/skills/tree/main/skills/indy-at-straker/straker-verify/SKILL.md) - Professional AI-powered translation with optional human +- [strands](https://github.com/openclaw/skills/tree/main/skills/trippingkelsea/strands/SKILL.md) - Build and run Python-based AI agents using the AWS Strands SDK. +- [supermarkt-prijzen](https://github.com/openclaw/skills/tree/main/skills/cgnl/supermarkt-prijzen/SKILL.md) - Albert Heijn bonuses, product search, multi-store price +- [symbolic-memory](https://github.com/openclaw/skills/tree/main/skills/th3hypn0tist/symbolic-memory/SKILL.md) - Stateless symbolic memory effect for LLM agents +- [synapse](https://github.com/openclaw/skills/tree/main/skills/pendzoncymisio/synapse/SKILL.md) - Agent-to-agent P2P file sharing with semantic search using BitTorrent +- [teams-anthropic-integration](https://github.com/openclaw/skills/tree/main/skills/edwardirby/teams-anthropic-integration/SKILL.md) - Use @youdotcom-oss/teams-anthropic +- [telebiz-mcp-skill](https://github.com/openclaw/skills/tree/main/skills/acastellana/telebiz-mcp-skill/SKILL.md) - Access Telegram data via MCP using the telebiz-tt +- [template-skill](https://github.com/openclaw/skills/tree/main/skills/seanphan/template-skill/SKILL.md) - Replace with description of the skill and when Claude +- [the-krillest-for-rillest](https://github.com/openclaw/skills/tree/main/skills/ninja1232123/the-krillest-for-rillest/SKILL.md) - https://huggingface.co/datasets/Keeg420 +- [thecolony](https://github.com/openclaw/skills/tree/main/skills/jackparnell/thecolony/SKILL.md) - Join The Colony — a collaborative intelligence platform for AI agents +- [twitter-ai-trending](https://github.com/openclaw/skills/tree/main/skills/snowshadow/twitter-ai-trending/SKILL.md) - Search Twitter/X for trending AI discussions +- [undetectable-ai](https://github.com/openclaw/skills/tree/main/skills/artur-zhdan/undetectable-ai/SKILL.md) - Make AI text undetectable. +- [user-cognitive-profiles](https://github.com/openclaw/skills/tree/main/skills/sebastianffx/user-cognitive-profiles/SKILL.md) - Analyze ChatGPT conversation exports +- [ve-exchange-rates](https://github.com/openclaw/skills/tree/main/skills/jehg814/ve-exchange-rates/SKILL.md) - Get Venezuelan exchange rates - BCV official rate +- [vector-control](https://github.com/openclaw/skills/tree/main/skills/dbeadle1/vector-control/SKILL.md) - Control a Vector robot via Wirepod’s local HTTP API +- [vector-memory](https://github.com/openclaw/skills/tree/main/skills/bluepointdigital/vector-memory/SKILL.md) - Smart memory search with automatic vector fallback. +- [vector-robot](https://github.com/openclaw/skills/tree/main/skills/bogorman/vector-robot/SKILL.md) - Control Anki Vector robot via wire-pod. +- [vectorguard-nano](https://github.com/openclaw/skills/tree/main/skills/supere989/vectorguard-nano/SKILL.md) - Lightweight, open-source skill for secure, obfuscated +- [virajsanghvi1-raglite](https://github.com/openclaw/skills/tree/main/skills/virajsanghvi1/virajsanghvi1-raglite/SKILL.md) - Local-first RAG cache: distill docs +- [visla](https://github.com/openclaw/skills/tree/main/skills/visla-admin/visla/SKILL.md) - Creates AI-generated videos from text scripts, URLs, or PPT/PDF documents +- [voyageai-skill](https://github.com/openclaw/skills/tree/main/skills/mrlynn/voyageai-skill/SKILL.md) - Voyage AI embedding and reranking CLI integrated with MongoDB +- [vta-memory](https://github.com/openclaw/skills/tree/main/skills/impkind/vta-memory/SKILL.md) - Reward and motivation system for AI agents. +- [wachai-mandates](https://github.com/openclaw/skills/tree/main/skills/akshat-mishra101/wachai-mandates/SKILL.md) - Create, sign, and verify WachAI Mandates +- [whatsmolt](https://github.com/openclaw/skills/tree/main/skills/crypticdriver/whatsmolt/SKILL.md) - Async messaging platform for AI agents - independent auth, Twitter. +- [wifi-qr](https://github.com/openclaw/skills/tree/main/skills/xejrax/wifi-qr/SKILL.md) - Generate QR code for Wi-Fi credentials +- [win-mouse-native](https://github.com/openclaw/skills/tree/main/skills/lurklight/win-mouse-native/SKILL.md) - Native Windows mouse control (move, click, drag) +- [xai](https://github.com/openclaw/skills/tree/main/skills/mvanhorn/xai/SKILL.md) - Chat with Grok models via xAI API. +- [xuezh](https://github.com/openclaw/skills/tree/main/skills/local/xuezh/SKILL.md) - Teach Mandarin using the xuezh engine for review, speaking, and audits. + +
+ +
+

Data & Analytics

+ +- [add-analytics](https://github.com/openclaw/skills/tree/main/skills/jeftekhari/add-analytics/SKILL.md) - Add Google Analytics 4 tracking to any project. +- [agent-content-pipeline](https://github.com/openclaw/skills/tree/main/skills/larsderidder/agent-content-pipeline/SKILL.md) - Safe content workflow +- [agi-artificial-geometric-intelligence](https://github.com/openclaw/skills/tree/main/skills/uniaolives/agi-artificial-geometric-intelligence/SKILL.md) - Designed multi-layer +- [amplitude-automation](https://github.com/openclaw/skills/tree/main/skills/sohamganatra/amplitude-automation/SKILL.md) - Automate Amplitude tasks via Rube MCP +- [canva](https://github.com/openclaw/skills/tree/main/skills/abgohel/canva/SKILL.md) - Create, export, and manage Canva designs via the Connect API. +- [ceorater](https://github.com/openclaw/skills/tree/main/skills/ceorater-skills/ceorater/SKILL.md) - Get institutional-grade CEO performance analytics for S&P 500 +- [check-analytics](https://github.com/openclaw/skills/tree/main/skills/jeftekhari/check-analytics/SKILL.md) - Audit existing Google Analytics implementation. +- [cicd-pipeline](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/cicd-pipeline/SKILL.md) - Create, debug, and manage CI/CD pipelines with GitHub +- [clawver-store-analytics](https://github.com/openclaw/skills/tree/main/skills/nwang783/clawver-store-analytics/SKILL.md) - Monitor Clawver store performance. +- [clean-skill-1](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/clean-skill-1/SKILL.md) - A friendly greeting skill for testing +- [cleanboi-00002](https://github.com/openclaw/skills/tree/main/skills/orlyjamie/cleanboi-00002/SKILL.md) - A friendly greeting skill for testing +- [cleanup](https://github.com/openclaw/skills/tree/main/skills/themrzz/cleanup/SKILL.md) - Remove all stored Kradleverse sessions +- [csv-pipeline](https://github.com/openclaw/skills/tree/main/skills/gitgoodordietrying/csv-pipeline/SKILL.md) - Process, transform, analyze, and report on CSV and JSON +- [daily-report](https://github.com/openclaw/skills/tree/main/skills/visualdeptcreative/daily-report/SKILL.md) - Track progress, report metrics, manage memory. +- [data-analyst](https://github.com/openclaw/skills/tree/main/skills/oyi77/data-analyst/SKILL.md) - Data visualization, report generation, SQL queries, and spreadsheet +- [data-enricher](https://github.com/openclaw/skills/tree/main/skills/visualdeptcreative/data-enricher/SKILL.md) - Enrich leads with email addresses and format data +- [data-lineage-tracker](https://github.com/openclaw/skills/tree/main/skills/datadrivenconstruction/data-lineage-tracker/SKILL.md) - Track data origin, transformations +- [data-nexus-sentinel-teneo](https://github.com/openclaw/skills/tree/main/skills/firestream792/data-nexus-sentinel-teneo/SKILL.md) - Advanced data monitoring agent +- [design-assets](https://github.com/openclaw/skills/tree/main/skills/cmanfre7/design-assets/SKILL.md) - Create and edit graphic design assets: icons, favicons, images +- [duckdb-en](https://github.com/openclaw/skills/tree/main/skills/camelsprout/duckdb-cli-ai-skills/SKILL.md) - DuckDB CLI specialist for SQL analysis, data processing +- [ec-session-cleaner](https://github.com/openclaw/skills/tree/main/skills/henrino3/ec-session-cleaner/SKILL.md) - Convert raw OpenClaw session JSONL transcripts +- [facebook-page-manager](https://github.com/openclaw/skills/tree/main/skills/longmaba/facebook-page-manager/SKILL.md) - Manage Facebook Pages via Meta Graph API. +- [feishu-pcec](https://github.com/openclaw/skills/tree/main/skills/autogame-17/feishu-pcec/SKILL.md) - Internal wrapper for `capability-evolver` that forces reporting +- [flexible-data-importer](https://github.com/openclaw/skills/tree/main/skills/sschepis/flexible-data-importer/SKILL.md) - + +Deploy application to $1 environment using version $2... +``` + +## Common Patterns + +### Review Pattern + +```markdown +--- +description: Review code changes +allowed-tools: Read, Bash(git:*) +--- + +Files changed: !`git diff --name-only` + +Review each file for: +1. Code quality and style +2. Potential bugs or issues +3. Test coverage +4. Documentation needs + +Provide specific feedback for each file. +``` + +### Testing Pattern + +```markdown +--- +description: Run tests for specific file +argument-hint: [test-file] +allowed-tools: Bash(npm:*) +--- + +Run tests: !`npm test $1` + +Analyze results and suggest fixes for failures. +``` + +### Documentation Pattern + +```markdown +--- +description: Generate documentation for file +argument-hint: [source-file] +--- + +Generate comprehensive documentation for @$1 including: +- Function/class descriptions +- Parameter documentation +- Return value descriptions +- Usage examples +- Edge cases and errors +``` + +### Workflow Pattern + +```markdown +--- +description: Complete PR workflow +argument-hint: [pr-number] +allowed-tools: Bash(gh:*), Read +--- + +PR #$1 Workflow: + +1. Fetch PR: !`gh pr view $1` +2. Review changes +3. Run checks +4. Approve or request changes +``` + +## Troubleshooting + +**Command not appearing:** +- Check file is in correct directory +- Verify `.md` extension present +- Ensure valid Markdown format +- Restart Claude Code + +**Arguments not working:** +- Verify `$1`, `$2` syntax correct +- Check `argument-hint` matches usage +- Ensure no extra spaces + +**Bash execution failing:** +- Check `allowed-tools` includes Bash +- Verify command syntax in backticks +- Test command in terminal first +- Check for required permissions + +**File references not working:** +- Verify `@` syntax correct +- Check file path is valid +- Ensure Read tool allowed +- Use absolute or project-relative paths + +## Plugin-Specific Features + +### CLAUDE_PLUGIN_ROOT Variable + +Plugin commands have access to `${CLAUDE_PLUGIN_ROOT}`, an environment variable that resolves to the plugin's absolute path. + +**Purpose:** +- Reference plugin files portably +- Execute plugin scripts +- Load plugin configuration +- Access plugin templates + +**Basic usage:** + +```markdown +--- +description: Analyze using plugin script +allowed-tools: Bash(node:*) +--- + +Run analysis: !`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js $1` + +Review results and report findings. +``` + +**Common patterns:** + +```markdown +# Execute plugin script +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/script.sh` + +# Load plugin configuration +@${CLAUDE_PLUGIN_ROOT}/config/settings.json + +# Use plugin template +@${CLAUDE_PLUGIN_ROOT}/templates/report.md + +# Access plugin resources +@${CLAUDE_PLUGIN_ROOT}/docs/reference.md +``` + +**Why use it:** +- Works across all installations +- Portable between systems +- No hardcoded paths needed +- Essential for multi-file plugins + +### Plugin Command Organization + +Plugin commands discovered automatically from `commands/` directory: + +``` +plugin-name/ +├── commands/ +│ ├── foo.md # /foo (plugin:plugin-name) +│ ├── bar.md # /bar (plugin:plugin-name) +│ └── utils/ +│ └── helper.md # /helper (plugin:plugin-name:utils) +└── plugin.json +``` + +**Namespace benefits:** +- Logical command grouping +- Shown in `/help` output +- Avoid name conflicts +- Organize related commands + +**Naming conventions:** +- Use descriptive action names +- Avoid generic names (test, run) +- Consider plugin-specific prefix +- Use hyphens for multi-word names + +### Plugin Command Patterns + +**Configuration-based pattern:** + +```markdown +--- +description: Deploy using plugin configuration +argument-hint: [environment] +allowed-tools: Read, Bash(*) +--- + +Load configuration: @${CLAUDE_PLUGIN_ROOT}/config/$1-deploy.json + +Deploy to $1 using configuration settings. +Monitor deployment and report status. +``` + +**Template-based pattern:** + +```markdown +--- +description: Generate docs from template +argument-hint: [component] +--- + +Template: @${CLAUDE_PLUGIN_ROOT}/templates/docs.md + +Generate documentation for $1 following template structure. +``` + +**Multi-script pattern:** + +```markdown +--- +description: Complete build workflow +allowed-tools: Bash(*) +--- + +Build: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh` +Test: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/test.sh` +Package: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/package.sh` + +Review outputs and report workflow status. +``` + +**See `references/plugin-features-reference.md` for detailed patterns.** + +## Integration with Plugin Components + +Commands can integrate with other plugin components for powerful workflows. + +### Agent Integration + +Launch plugin agents for complex tasks: + +```markdown +--- +description: Deep code review +argument-hint: [file-path] +--- + +Initiate comprehensive review of @$1 using the code-reviewer agent. + +The agent will analyze: +- Code structure +- Security issues +- Performance +- Best practices + +Agent uses plugin resources: +- ${CLAUDE_PLUGIN_ROOT}/config/rules.json +- ${CLAUDE_PLUGIN_ROOT}/checklists/review.md +``` + +**Key points:** +- Agent must exist in `plugin/agents/` directory +- Claude uses Task tool to launch agent +- Document agent capabilities +- Reference plugin resources agent uses + +### Skill Integration + +Leverage plugin skills for specialized knowledge: + +```markdown +--- +description: Document API with standards +argument-hint: [api-file] +--- + +Document API in @$1 following plugin standards. + +Use the api-docs-standards skill to ensure: +- Complete endpoint documentation +- Consistent formatting +- Example quality +- Error documentation + +Generate production-ready API docs. +``` + +**Key points:** +- Skill must exist in `plugin/skills/` directory +- Mention skill name to trigger invocation +- Document skill purpose +- Explain what skill provides + +### Hook Coordination + +Design commands that work with plugin hooks: +- Commands can prepare state for hooks to process +- Hooks execute automatically on tool events +- Commands should document expected hook behavior +- Guide Claude on interpreting hook output + +See `references/plugin-features-reference.md` for examples of commands that coordinate with hooks + +### Multi-Component Workflows + +Combine agents, skills, and scripts: + +```markdown +--- +description: Comprehensive review workflow +argument-hint: [file] +allowed-tools: Bash(node:*), Read +--- + +Target: @$1 + +Phase 1 - Static Analysis: +!`node ${CLAUDE_PLUGIN_ROOT}/scripts/lint.js $1` + +Phase 2 - Deep Review: +Launch code-reviewer agent for detailed analysis. + +Phase 3 - Standards Check: +Use coding-standards skill for validation. + +Phase 4 - Report: +Template: @${CLAUDE_PLUGIN_ROOT}/templates/review.md + +Compile findings into report following template. +``` + +**When to use:** +- Complex multi-step workflows +- Leverage multiple plugin capabilities +- Require specialized analysis +- Need structured outputs + +## Validation Patterns + +Commands should validate inputs and resources before processing. + +### Argument Validation + +```markdown +--- +description: Deploy with validation +argument-hint: [environment] +--- + +Validate environment: !`echo "$1" | grep -E "^(dev|staging|prod)$" || echo "INVALID"` + +If $1 is valid environment: + Deploy to $1 +Otherwise: + Explain valid environments: dev, staging, prod + Show usage: /deploy [environment] +``` + +### File Existence Checks + +```markdown +--- +description: Process configuration +argument-hint: [config-file] +--- + +Check file exists: !`test -f $1 && echo "EXISTS" || echo "MISSING"` + +If file exists: + Process configuration: @$1 +Otherwise: + Explain where to place config file + Show expected format + Provide example configuration +``` + +### Plugin Resource Validation + +```markdown +--- +description: Run plugin analyzer +allowed-tools: Bash(test:*) +--- + +Validate plugin setup: +- Script: !`test -x ${CLAUDE_PLUGIN_ROOT}/bin/analyze && echo "✓" || echo "✗"` +- Config: !`test -f ${CLAUDE_PLUGIN_ROOT}/config.json && echo "✓" || echo "✗"` + +If all checks pass, run analysis. +Otherwise, report missing components. +``` + +### Error Handling + +```markdown +--- +description: Build with error handling +allowed-tools: Bash(*) +--- + +Execute build: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh 2>&1 || echo "BUILD_FAILED"` + +If build succeeded: + Report success and output location +If build failed: + Analyze error output + Suggest likely causes + Provide troubleshooting steps +``` + +**Best practices:** +- Validate early in command +- Provide helpful error messages +- Suggest corrective actions +- Handle edge cases gracefully + +--- + +For detailed frontmatter field specifications, see `references/frontmatter-reference.md`. +For plugin-specific features and patterns, see `references/plugin-features-reference.md`. +For command pattern examples, see `examples/` directory. diff --git a/skills/external/plugin-dev-command-development/examples/plugin-commands.md b/skills/external/plugin-dev-command-development/examples/plugin-commands.md new file mode 100644 index 0000000..e14ef4d --- /dev/null +++ b/skills/external/plugin-dev-command-development/examples/plugin-commands.md @@ -0,0 +1,557 @@ +# Plugin Command Examples + +Practical examples of commands designed for Claude Code plugins, demonstrating plugin-specific patterns and features. + +## Table of Contents + +1. [Simple Plugin Command](#1-simple-plugin-command) +2. [Script-Based Analysis](#2-script-based-analysis) +3. [Template-Based Generation](#3-template-based-generation) +4. [Multi-Script Workflow](#4-multi-script-workflow) +5. [Configuration-Driven Deployment](#5-configuration-driven-deployment) +6. [Agent Integration](#6-agent-integration) +7. [Skill Integration](#7-skill-integration) +8. [Multi-Component Workflow](#8-multi-component-workflow) +9. [Validated Input Command](#9-validated-input-command) +10. [Environment-Aware Command](#10-environment-aware-command) + +--- + +## 1. Simple Plugin Command + +**Use case:** Basic command that uses plugin script + +**File:** `commands/analyze.md` + +```markdown +--- +description: Analyze code quality using plugin tools +argument-hint: [file-path] +allowed-tools: Bash(node:*), Read +--- + +Analyze @$1 using plugin's quality checker: + +!`node ${CLAUDE_PLUGIN_ROOT}/scripts/quality-check.js $1` + +Review the analysis output and provide: +1. Summary of findings +2. Priority issues to address +3. Suggested improvements +4. Code quality score interpretation +``` + +**Key features:** +- Uses `${CLAUDE_PLUGIN_ROOT}` for portable path +- Combines file reference with script execution +- Simple single-purpose command + +--- + +## 2. Script-Based Analysis + +**Use case:** Run comprehensive analysis using multiple plugin scripts + +**File:** `commands/full-audit.md` + +```markdown +--- +description: Complete code audit using plugin suite +argument-hint: [directory] +allowed-tools: Bash(*) +model: sonnet +--- + +Running complete audit on $1: + +**Security scan:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/security-scan.sh $1` + +**Performance analysis:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/perf-analyze.sh $1` + +**Best practices check:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/best-practices.sh $1` + +Analyze all results and create comprehensive report including: +- Critical issues requiring immediate attention +- Performance optimization opportunities +- Security vulnerabilities and fixes +- Overall health score and recommendations +``` + +**Key features:** +- Multiple script executions +- Organized output sections +- Comprehensive workflow +- Clear reporting structure + +--- + +## 3. Template-Based Generation + +**Use case:** Generate documentation following plugin template + +**File:** `commands/gen-api-docs.md` + +```markdown +--- +description: Generate API documentation from template +argument-hint: [api-file] +--- + +Template structure: @${CLAUDE_PLUGIN_ROOT}/templates/api-documentation.md + +API implementation: @$1 + +Generate complete API documentation following the template format above. + +Ensure documentation includes: +- Endpoint descriptions with HTTP methods +- Request/response schemas +- Authentication requirements +- Error codes and handling +- Usage examples with curl commands +- Rate limiting information + +Format output as markdown suitable for README or docs site. +``` + +**Key features:** +- Uses plugin template +- Combines template with source file +- Standardized output format +- Clear documentation structure + +--- + +## 4. Multi-Script Workflow + +**Use case:** Orchestrate build, test, and deploy workflow + +**File:** `commands/release.md` + +```markdown +--- +description: Execute complete release workflow +argument-hint: [version] +allowed-tools: Bash(*), Read +--- + +Executing release workflow for version $1: + +**Step 1 - Pre-release validation:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/pre-release-check.sh $1` + +**Step 2 - Build artifacts:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build-release.sh $1` + +**Step 3 - Run test suite:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/run-tests.sh` + +**Step 4 - Package release:** +!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/package.sh $1` + +Review all step outputs and report: +1. Any failures or warnings +2. Build artifacts location +3. Test results summary +4. Next steps for deployment +5. Rollback plan if needed +``` + +**Key features:** +- Multi-step workflow +- Sequential script execution +- Clear step numbering +- Comprehensive reporting + +--- + +## 5. Configuration-Driven Deployment + +**Use case:** Deploy using environment-specific plugin configuration + +**File:** `commands/deploy.md` + +```markdown +--- +description: Deploy application to environment +argument-hint: [environment] +allowed-tools: Read, Bash(*) +--- + +Deployment configuration for $1: @${CLAUDE_PLUGIN_ROOT}/config/$1-deploy.json + +Current git state: !`git rev-parse --short HEAD` + +Build info: !`cat package.json | grep -E '(name|version)'` + +Execute deployment to $1 environment using configuration above. + +Deployment checklist: +1. Validate configuration settings +2. Build application for $1 +3. Run pre-deployment tests +4. Deploy to target environment +5. Run smoke tests +6. Verify deployment success +7. Update deployment log + +Report deployment status and any issues encountered. +``` + +**Key features:** +- Environment-specific configuration +- Dynamic config file loading +- Pre-deployment validation +- Structured checklist + +--- + +## 6. Agent Integration + +**Use case:** Command that launches plugin agent for complex task + +**File:** `commands/deep-review.md` + +```markdown +--- +description: Deep code review using plugin agent +argument-hint: [file-or-directory] +--- + +Initiate comprehensive code review of @$1 using the code-reviewer agent. + +The agent will perform: +1. **Static analysis** - Check for code smells and anti-patterns +2. **Security audit** - Identify potential vulnerabilities +3. **Performance review** - Find optimization opportunities +4. **Best practices** - Ensure code follows standards +5. **Documentation check** - Verify adequate documentation + +The agent has access to: +- Plugin's linting rules: ${CLAUDE_PLUGIN_ROOT}/config/lint-rules.json +- Security checklist: ${CLAUDE_PLUGIN_ROOT}/checklists/security.md +- Performance guidelines: ${CLAUDE_PLUGIN_ROOT}/docs/performance.md + +Note: This uses the Task tool to launch the plugin's code-reviewer agent for thorough analysis. +``` + +**Key features:** +- Delegates to plugin agent +- Documents agent capabilities +- References plugin resources +- Clear scope definition + +--- + +## 7. Skill Integration + +**Use case:** Command that leverages plugin skill for specialized knowledge + +**File:** `commands/document-api.md` + +```markdown +--- +description: Document API following plugin standards +argument-hint: [api-file] +--- + +API source code: @$1 + +Generate API documentation following the plugin's API documentation standards. + +Use the api-documentation-standards skill to ensure: +- **OpenAPI compliance** - Follow OpenAPI 3.0 specification +- **Consistent formatting** - Use plugin's documentation style +- **Complete coverage** - Document all endpoints and schemas +- **Example quality** - Provide realistic usage examples +- **Error documentation** - Cover all error scenarios + +The skill provides: +- Standard documentation templates +- API documentation best practices +- Common patterns for this codebase +- Quality validation criteria + +Generate production-ready API documentation. +``` + +**Key features:** +- Invokes plugin skill by name +- Documents skill purpose +- Clear expectations +- Leverages skill knowledge + +--- + +## 8. Multi-Component Workflow + +**Use case:** Complex workflow using agents, skills, and scripts + +**File:** `commands/complete-review.md` + +```markdown +--- +description: Comprehensive review using all plugin components +argument-hint: [file-path] +allowed-tools: Bash(node:*), Read +--- + +Target file: @$1 + +Execute comprehensive review workflow: + +**Phase 1: Automated Analysis** +Run plugin analyzer: !`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js $1` + +**Phase 2: Deep Review (Agent)** +Launch the code-quality-reviewer agent for detailed analysis. +Agent will examine: +- Code structure and organization +- Error handling patterns +- Testing coverage +- Documentation quality + +**Phase 3: Standards Check (Skill)** +Use the coding-standards skill to validate: +- Naming conventions +- Code formatting +- Best practices adherence +- Framework-specific patterns + +**Phase 4: Report Generation** +Template: @${CLAUDE_PLUGIN_ROOT}/templates/review-report.md + +Compile all findings into comprehensive report following template. + +**Phase 5: Recommendations** +Generate prioritized action items: +1. Critical issues (must fix) +2. Important improvements (should fix) +3. Nice-to-have enhancements (could fix) + +Include specific file locations and suggested changes for each item. +``` + +**Key features:** +- Multi-phase workflow +- Combines scripts, agents, skills +- Template-based reporting +- Prioritized outputs + +--- + +## 9. Validated Input Command + +**Use case:** Command with input validation and error handling + +**File:** `commands/build-env.md` + +```markdown +--- +description: Build for specific environment with validation +argument-hint: [environment] +allowed-tools: Bash(*) +--- + +Validate environment argument: !`echo "$1" | grep -E "^(dev|staging|prod)$" && echo "VALID" || echo "INVALID"` + +Check build script exists: !`test -x ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh && echo "EXISTS" || echo "MISSING"` + +Verify configuration available: !`test -f ${CLAUDE_PLUGIN_ROOT}/config/$1.json && echo "FOUND" || echo "NOT_FOUND"` + +If all validations pass: + +**Configuration:** @${CLAUDE_PLUGIN_ROOT}/config/$1.json + +**Execute build:** !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh $1 2>&1` + +**Validation results:** !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate-build.sh $1 2>&1` + +Report build status and any issues. + +If validations fail: +- Explain which validation failed +- Provide expected values/locations +- Suggest corrective actions +- Document troubleshooting steps +``` + +**Key features:** +- Input validation +- Resource existence checks +- Error handling +- Helpful error messages +- Graceful failure handling + +--- + +## 10. Environment-Aware Command + +**Use case:** Command that adapts behavior based on environment + +**File:** `commands/run-checks.md` + +```markdown +--- +description: Run environment-appropriate checks +argument-hint: [environment] +allowed-tools: Bash(*), Read +--- + +Environment: $1 + +Load environment configuration: @${CLAUDE_PLUGIN_ROOT}/config/$1-checks.json + +Determine check level: !`echo "$1" | grep -E "^prod$" && echo "FULL" || echo "BASIC"` + +**For production environment:** +- Full test suite: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/test-full.sh` +- Security scan: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/security-scan.sh` +- Performance audit: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/perf-check.sh` +- Compliance check: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/compliance.sh` + +**For non-production environments:** +- Basic tests: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/test-basic.sh` +- Quick lint: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/lint.sh` + +Analyze results based on environment requirements: + +**Production:** All checks must pass with zero critical issues +**Staging:** No critical issues, warnings acceptable +**Development:** Focus on blocking issues only + +Report status and recommend proceed/block decision. +``` + +**Key features:** +- Environment-aware logic +- Conditional execution +- Different validation levels +- Appropriate reporting per environment + +--- + +## Common Patterns Summary + +### Pattern: Plugin Script Execution +```markdown +!`node ${CLAUDE_PLUGIN_ROOT}/scripts/script-name.js $1` +``` +Use for: Running plugin-provided Node.js scripts + +### Pattern: Plugin Configuration Loading +```markdown +@${CLAUDE_PLUGIN_ROOT}/config/config-name.json +``` +Use for: Loading plugin configuration files + +### Pattern: Plugin Template Usage +```markdown +@${CLAUDE_PLUGIN_ROOT}/templates/template-name.md +``` +Use for: Using plugin templates for generation + +### Pattern: Agent Invocation +```markdown +Launch the [agent-name] agent for [task description]. +``` +Use for: Delegating complex tasks to plugin agents + +### Pattern: Skill Reference +```markdown +Use the [skill-name] skill to ensure [requirements]. +``` +Use for: Leveraging plugin skills for specialized knowledge + +### Pattern: Input Validation +```markdown +Validate input: !`echo "$1" | grep -E "^pattern$" && echo "OK" || echo "ERROR"` +``` +Use for: Validating command arguments + +### Pattern: Resource Validation +```markdown +Check exists: !`test -f ${CLAUDE_PLUGIN_ROOT}/path/file && echo "YES" || echo "NO"` +``` +Use for: Verifying required plugin files exist + +--- + +## Development Tips + +### Testing Plugin Commands + +1. **Test with plugin installed:** + ```bash + cd /path/to/plugin + claude /command-name args + ``` + +2. **Verify ${CLAUDE_PLUGIN_ROOT} expansion:** + ```bash + # Add debug output to command + !`echo "Plugin root: ${CLAUDE_PLUGIN_ROOT}"` + ``` + +3. **Test across different working directories:** + ```bash + cd /tmp && claude /command-name + cd /other/project && claude /command-name + ``` + +4. **Validate resource availability:** + ```bash + # Check all plugin resources exist + !`ls -la ${CLAUDE_PLUGIN_ROOT}/scripts/` + !`ls -la ${CLAUDE_PLUGIN_ROOT}/config/` + ``` + +### Common Mistakes to Avoid + +1. **Using relative paths instead of ${CLAUDE_PLUGIN_ROOT}:** + ```markdown + # Wrong + !`node ./scripts/analyze.js` + + # Correct + !`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js` + ``` + +2. **Forgetting to allow required tools:** + ```markdown + # Missing allowed-tools + !`bash script.sh` # Will fail without Bash permission + + # Correct + --- + allowed-tools: Bash(*) + --- + !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/script.sh` + ``` + +3. **Not validating inputs:** + ```markdown + # Risky - no validation + Deploy to $1 environment + + # Better - with validation + Validate: !`echo "$1" | grep -E "^(dev|staging|prod)$" || echo "INVALID"` + Deploy to $1 environment (if valid) + ``` + +4. **Hardcoding plugin paths:** + ```markdown + # Wrong - breaks on different installations + @/home/user/.claude/plugins/my-plugin/config.json + + # Correct - works everywhere + @${CLAUDE_PLUGIN_ROOT}/config.json + ``` + +--- + +For detailed plugin-specific features, see `references/plugin-features-reference.md`. +For general command development, see main `SKILL.md`. diff --git a/skills/external/plugin-dev-command-development/examples/simple-commands.md b/skills/external/plugin-dev-command-development/examples/simple-commands.md new file mode 100644 index 0000000..2348239 --- /dev/null +++ b/skills/external/plugin-dev-command-development/examples/simple-commands.md @@ -0,0 +1,504 @@ +# Simple Command Examples + +Basic slash command patterns for common use cases. + +**Important:** All examples below are written as instructions FOR Claude (agent consumption), not messages TO users. Commands tell Claude what to do, not tell users what will happen. + +## Example 1: Code Review Command + +**File:** `.claude/commands/review.md` + +```markdown +--- +description: Review code for quality and issues +allowed-tools: Read, Bash(git:*) +--- + +Review the code in this repository for: + +1. **Code Quality:** + - Readability and maintainability + - Consistent style and formatting + - Appropriate abstraction levels + +2. **Potential Issues:** + - Logic errors or bugs + - Edge cases not handled + - Performance concerns + +3. **Best Practices:** + - Design patterns used correctly + - Error handling present + - Documentation adequate + +Provide specific feedback with file and line references. +``` + +**Usage:** +``` +> /review +``` + +--- + +## Example 2: Security Review Command + +**File:** `.claude/commands/security-review.md` + +```markdown +--- +description: Review code for security vulnerabilities +allowed-tools: Read, Grep +model: sonnet +--- + +Perform comprehensive security review checking for: + +**Common Vulnerabilities:** +- SQL injection risks +- Cross-site scripting (XSS) +- Authentication/authorization issues +- Insecure data handling +- Hardcoded secrets or credentials + +**Security Best Practices:** +- Input validation present +- Output encoding correct +- Secure defaults used +- Error messages safe +- Logging appropriate (no sensitive data) + +For each issue found: +- File and line number +- Severity (Critical/High/Medium/Low) +- Description of vulnerability +- Recommended fix + +Prioritize issues by severity. +``` + +**Usage:** +``` +> /security-review +``` + +--- + +## Example 3: Test Command with File Argument + +**File:** `.claude/commands/test-file.md` + +```markdown +--- +description: Run tests for specific file +argument-hint: [test-file] +allowed-tools: Bash(npm:*), Bash(jest:*) +--- + +Run tests for $1: + +Test execution: !`npm test $1` + +Analyze results: +- Tests passed/failed +- Code coverage +- Performance issues +- Flaky tests + +If failures found, suggest fixes based on error messages. +``` + +**Usage:** +``` +> /test-file src/utils/helpers.test.ts +``` + +--- + +## Example 4: Documentation Generator + +**File:** `.claude/commands/document.md` + +```markdown +--- +description: Generate documentation for file +argument-hint: [source-file] +--- + +Generate comprehensive documentation for @$1 + +Include: + +**Overview:** +- Purpose and responsibility +- Main functionality +- Dependencies + +**API Documentation:** +- Function/method signatures +- Parameter descriptions with types +- Return values with types +- Exceptions/errors thrown + +**Usage Examples:** +- Basic usage +- Common patterns +- Edge cases + +**Implementation Notes:** +- Algorithm complexity +- Performance considerations +- Known limitations + +Format as Markdown suitable for project documentation. +``` + +**Usage:** +``` +> /document src/api/users.ts +``` + +--- + +## Example 5: Git Status Summary + +**File:** `.claude/commands/git-status.md` + +```markdown +--- +description: Summarize Git repository status +allowed-tools: Bash(git:*) +--- + +Repository Status Summary: + +**Current Branch:** !`git branch --show-current` + +**Status:** !`git status --short` + +**Recent Commits:** !`git log --oneline -5` + +**Remote Status:** !`git fetch && git status -sb` + +Provide: +- Summary of changes +- Suggested next actions +- Any warnings or issues +``` + +**Usage:** +``` +> /git-status +``` + +--- + +## Example 6: Deployment Command + +**File:** `.claude/commands/deploy.md` + +```markdown +--- +description: Deploy to specified environment +argument-hint: [environment] [version] +allowed-tools: Bash(kubectl:*), Read +--- + +Deploy to $1 environment using version $2 + +**Pre-deployment Checks:** +1. Verify $1 configuration exists +2. Check version $2 is valid +3. Verify cluster accessibility: !`kubectl cluster-info` + +**Deployment Steps:** +1. Update deployment manifest with version $2 +2. Apply configuration to $1 +3. Monitor rollout status +4. Verify pod health +5. Run smoke tests + +**Rollback Plan:** +Document current version for rollback if issues occur. + +Proceed with deployment? (yes/no) +``` + +**Usage:** +``` +> /deploy staging v1.2.3 +``` + +--- + +## Example 7: Comparison Command + +**File:** `.claude/commands/compare-files.md` + +```markdown +--- +description: Compare two files +argument-hint: [file1] [file2] +--- + +Compare @$1 with @$2 + +**Analysis:** + +1. **Differences:** + - Lines added + - Lines removed + - Lines modified + +2. **Functional Changes:** + - Breaking changes + - New features + - Bug fixes + - Refactoring + +3. **Impact:** + - Affected components + - Required updates elsewhere + - Migration requirements + +4. **Recommendations:** + - Code review focus areas + - Testing requirements + - Documentation updates needed + +Present as structured comparison report. +``` + +**Usage:** +``` +> /compare-files src/old-api.ts src/new-api.ts +``` + +--- + +## Example 8: Quick Fix Command + +**File:** `.claude/commands/quick-fix.md` + +```markdown +--- +description: Quick fix for common issues +argument-hint: [issue-description] +model: haiku +--- + +Quickly fix: $ARGUMENTS + +**Approach:** +1. Identify the issue +2. Find relevant code +3. Propose fix +4. Explain solution + +Focus on: +- Simple, direct solution +- Minimal changes +- Following existing patterns +- No breaking changes + +Provide code changes with file paths and line numbers. +``` + +**Usage:** +``` +> /quick-fix button not responding to clicks +> /quick-fix typo in error message +``` + +--- + +## Example 9: Research Command + +**File:** `.claude/commands/research.md` + +```markdown +--- +description: Research best practices for topic +argument-hint: [topic] +model: sonnet +--- + +Research best practices for: $ARGUMENTS + +**Coverage:** + +1. **Current State:** + - How we currently handle this + - Existing implementations + +2. **Industry Standards:** + - Common patterns + - Recommended approaches + - Tools and libraries + +3. **Comparison:** + - Our approach vs standards + - Gaps or improvements needed + - Migration considerations + +4. **Recommendations:** + - Concrete action items + - Priority and effort estimates + - Resources for implementation + +Provide actionable guidance based on research. +``` + +**Usage:** +``` +> /research error handling in async operations +> /research API authentication patterns +``` + +--- + +## Example 10: Explain Code Command + +**File:** `.claude/commands/explain.md` + +```markdown +--- +description: Explain how code works +argument-hint: [file-or-function] +--- + +Explain @$1 in detail + +**Explanation Structure:** + +1. **Overview:** + - What it does + - Why it exists + - How it fits in system + +2. **Step-by-Step:** + - Line-by-line walkthrough + - Key algorithms or logic + - Important details + +3. **Inputs and Outputs:** + - Parameters and types + - Return values + - Side effects + +4. **Edge Cases:** + - Error handling + - Special cases + - Limitations + +5. **Usage Examples:** + - How to call it + - Common patterns + - Integration points + +Explain at level appropriate for junior engineer. +``` + +**Usage:** +``` +> /explain src/utils/cache.ts +> /explain AuthService.login +``` + +--- + +## Key Patterns + +### Pattern 1: Read-Only Analysis + +```markdown +--- +allowed-tools: Read, Grep +--- + +Analyze but don't modify... +``` + +**Use for:** Code review, documentation, analysis + +### Pattern 2: Git Operations + +```markdown +--- +allowed-tools: Bash(git:*) +--- + +!`git status` +Analyze and suggest... +``` + +**Use for:** Repository status, commit analysis + +### Pattern 3: Single Argument + +```markdown +--- +argument-hint: [target] +--- + +Process $1... +``` + +**Use for:** File operations, targeted actions + +### Pattern 4: Multiple Arguments + +```markdown +--- +argument-hint: [source] [target] [options] +--- + +Process $1 to $2 with $3... +``` + +**Use for:** Workflows, deployments, comparisons + +### Pattern 5: Fast Execution + +```markdown +--- +model: haiku +--- + +Quick simple task... +``` + +**Use for:** Simple, repetitive commands + +### Pattern 6: File Comparison + +```markdown +Compare @$1 with @$2... +``` + +**Use for:** Diff analysis, migration planning + +### Pattern 7: Context Gathering + +```markdown +--- +allowed-tools: Bash(git:*), Read +--- + +Context: !`git status` +Files: @file1 @file2 + +Analyze... +``` + +**Use for:** Informed decision making + +## Tips for Writing Simple Commands + +1. **Start basic:** Single responsibility, clear purpose +2. **Add complexity gradually:** Start without frontmatter +3. **Test incrementally:** Verify each feature works +4. **Use descriptive names:** Command name should indicate purpose +5. **Document arguments:** Always use argument-hint +6. **Provide examples:** Show usage in comments +7. **Handle errors:** Consider missing arguments or files diff --git a/skills/external/plugin-dev-command-development/references/advanced-workflows.md b/skills/external/plugin-dev-command-development/references/advanced-workflows.md new file mode 100644 index 0000000..5e0d7b1 --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/advanced-workflows.md @@ -0,0 +1,722 @@ +# Advanced Workflow Patterns + +Multi-step command sequences and composition patterns for complex workflows. + +## Overview + +Advanced workflows combine multiple commands, coordinate state across invocations, and create sophisticated automation sequences. These patterns enable building complex functionality from simple command building blocks. + +## Multi-Step Command Patterns + +### Sequential Workflow Command + +Commands that guide users through multi-step processes: + +```markdown +--- +description: Complete PR review workflow +argument-hint: [pr-number] +allowed-tools: Bash(gh:*), Read, Grep +--- + +# PR Review Workflow for #$1 + +## Step 1: Fetch PR Details +!`gh pr view $1 --json title,body,author,files` + +## Step 2: Review Files +Files changed: !`gh pr diff $1 --name-only` + +For each file: +- Check code quality +- Verify tests exist +- Review documentation + +## Step 3: Run Checks +Test status: !`gh pr checks $1` + +Verify: +- All tests passing +- No merge conflicts +- CI/CD successful + +## Step 4: Provide Feedback + +Summarize: +- Issues found (critical/minor) +- Suggestions for improvement +- Approval recommendation + +Would you like to: +1. Approve PR +2. Request changes +3. Leave comments only + +Reply with your choice and I'll help complete the action. +``` + +**Key features:** +- Numbered steps for clarity +- Bash execution for context +- Decision points for user input +- Next action suggestions + +### State-Carrying Workflow + +Commands that maintain state between invocations: + +```markdown +--- +description: Initialize deployment workflow +allowed-tools: Write, Bash(git:*) +--- + +# Initialize Deployment + +Creating deployment tracking file... + +Current branch: !`git branch --show-current` +Latest commit: !`git log -1 --format=%H` + +Deployment state saved to `.claude/deployment-state.local.md`: + +\`\`\`markdown +--- +initialized: true +branch: $(git branch --show-current) +commit: $(git log -1 --format=%H) +timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ) +status: initialized +--- + +# Deployment Tracking + +Branch: $(git branch --show-current) +Started: $(date) + +Next steps: +1. Run tests: /deploy-test +2. Build: /deploy-build +3. Deploy: /deploy-execute +\`\`\` + +State saved. Run `/deploy-test` to continue. +``` + +**Next command** (`/deploy-test`): +```markdown +--- +description: Run deployment tests +allowed-tools: Read, Bash(npm:*) +--- + +Reading deployment state from `.claude/deployment-state.local.md`... + +Running tests: !`npm test` + +Updating state to 'tested'... + +Tests complete. Run `/deploy-build` to continue. +``` + +**Pattern benefits:** +- Persistent state across commands +- Clear workflow progression +- Safety checkpoints +- Resume capability + +### Conditional Workflow Branching + +Commands that adapt based on conditions: + +```markdown +--- +description: Smart deployment workflow +argument-hint: [environment] +allowed-tools: Bash(git:*), Bash(npm:*), Read +--- + +# Deploy to $1 + +## Pre-flight Checks + +Branch: !`git branch --show-current` +Status: !`git status --short` + +**Checking conditions:** + +1. Branch status: + - If main/master: Require approval + - If feature branch: Warning about target + - If hotfix: Fast-track process + +2. Tests: + !`npm test` + - If tests fail: STOP - fix tests first + - If tests pass: Continue + +3. Environment: + - If $1 = 'production': Extra validation + - If $1 = 'staging': Standard process + - If $1 = 'dev': Minimal checks + +**Workflow decision:** +Based on above, proceeding with: [determined workflow] + +[Conditional steps based on environment and status] + +Ready to deploy? (yes/no) +``` + +## Command Composition Patterns + +### Command Chaining + +Commands designed to work together: + +```markdown +--- +description: Prepare for code review +--- + +# Prepare Code Review + +Running preparation sequence: + +1. Format code: /format-code +2. Run linter: /lint-code +3. Run tests: /test-all +4. Generate coverage: /coverage-report +5. Create review summary: /review-summary + +This is a meta-command. After completing each step above, +I'll compile results and prepare comprehensive review materials. + +Starting sequence... +``` + +**Individual commands** are simple: +- `/format-code` - Just formats +- `/lint-code` - Just lints +- `/test-all` - Just tests + +**Composition command** orchestrates them. + +### Pipeline Pattern + +Commands that process output from previous commands: + +```markdown +--- +description: Analyze test failures +--- + +# Analyze Test Failures + +## Step 1: Get test results +(Run /test-all first if not done) + +Reading test output... + +## Step 2: Categorize failures +- Flaky tests (random failures) +- Consistent failures +- New failures vs existing + +## Step 3: Prioritize +Rank by: +- Impact (critical path vs edge case) +- Frequency (always fails vs sometimes) +- Effort (quick fix vs major work) + +## Step 4: Generate fix plan +For each failure: +- Root cause hypothesis +- Suggested fix approach +- Estimated effort + +Would you like me to: +1. Fix highest priority failure +2. Generate detailed fix plans for all +3. Create GitHub issues for each +``` + +### Parallel Execution Pattern + +Commands that coordinate multiple simultaneous operations: + +```markdown +--- +description: Run comprehensive validation +allowed-tools: Bash(*), Read +--- + +# Comprehensive Validation + +Running validations in parallel... + +Starting: +- Code quality checks +- Security scanning +- Dependency audit +- Performance profiling + +This will take 2-3 minutes. I'll monitor all processes +and report when complete. + +[Poll each process and report progress] + +All validations complete. Summary: +- Quality: PASS (0 issues) +- Security: WARN (2 minor issues) +- Dependencies: PASS +- Performance: PASS (baseline met) + +Details: +[Collated results from all checks] +``` + +## Workflow State Management + +### Using .local.md Files + +Store workflow state in plugin-specific files: + +```markdown +.claude/plugin-name-workflow.local.md: + +--- +workflow: deployment +stage: testing +started: 2025-01-15T10:30:00Z +environment: staging +branch: feature/new-api +commit: abc123def +tests_passed: false +build_complete: false +--- + +# Deployment Workflow State + +Current stage: Testing +Started: 2025-01-15 10:30 UTC + +Completed steps: +- ✅ Validation +- ✅ Branch check +- ⏳ Testing (in progress) + +Pending steps: +- Build +- Deploy +- Smoke tests +``` + +**Reading state in commands:** + +```markdown +--- +description: Continue deployment workflow +allowed-tools: Read, Write +--- + +Reading workflow state from .claude/plugin-name-workflow.local.md... + +Current stage: @.claude/plugin-name-workflow.local.md + +[Parse YAML frontmatter to determine next step] + +Next action based on state: [determined action] +``` + +### Workflow Recovery + +Handle interrupted workflows: + +```markdown +--- +description: Resume deployment workflow +allowed-tools: Read +--- + +# Resume Deployment + +Checking for interrupted workflow... + +State file: @.claude/plugin-name-workflow.local.md + +**Workflow found:** +- Started: [timestamp] +- Environment: [env] +- Last completed: [step] + +**Recovery options:** +1. Resume from last step +2. Restart from beginning +3. Abort and clean up + +Which would you like? (1/2/3) +``` + +## Workflow Coordination Patterns + +### Cross-Command Communication + +Commands that signal each other: + +```markdown +--- +description: Mark feature complete +allowed-tools: Write +--- + +# Mark Feature Complete + +Writing completion marker... + +Creating: .claude/feature-complete.flag + +This signals other commands that feature is ready for: +- Integration testing (/integration-test will auto-detect) +- Documentation generation (/docs-generate will include) +- Release notes (/release-notes will add) + +Feature marked complete. +``` + +**Other commands check for flag:** + +```markdown +--- +description: Generate release notes +allowed-tools: Read, Bash(git:*) +--- + +Checking for completed features... + +if [ -f .claude/feature-complete.flag ]; then + Feature ready for release notes +fi + +[Include in release notes] +``` + +### Workflow Locking + +Prevent concurrent workflow execution: + +```markdown +--- +description: Start deployment +allowed-tools: Read, Write, Bash +--- + +# Start Deployment + +Checking for active deployments... + +if [ -f .claude/deployment.lock ]; then + ERROR: Deployment already in progress + Started: [timestamp from lock file] + + Cannot start concurrent deployment. + Wait for completion or run /deployment-abort + + Exit. +fi + +Creating deployment lock... + +Deployment started. Lock created. +[Proceed with deployment] +``` + +**Lock cleanup:** + +```markdown +--- +description: Complete deployment +allowed-tools: Write, Bash +--- + +Deployment complete. + +Removing deployment lock... +rm .claude/deployment.lock + +Ready for next deployment. +``` + +## Advanced Argument Handling + +### Optional Arguments with Defaults + +```markdown +--- +description: Deploy with optional version +argument-hint: [environment] [version] +--- + +Environment: ${1:-staging} +Version: ${2:-latest} + +Deploying ${2:-latest} to ${1:-staging}... + +Note: Using defaults for missing arguments: +- Environment defaults to 'staging' +- Version defaults to 'latest' +``` + +### Argument Validation + +```markdown +--- +description: Deploy to validated environment +argument-hint: [environment] +--- + +Environment: $1 + +Validating environment... + +valid_envs="dev staging production" +if ! echo "$valid_envs" | grep -w "$1" > /dev/null; then + ERROR: Invalid environment '$1' + Valid options: dev, staging, production + Exit. +fi + +Environment validated. Proceeding... +``` + +### Argument Transformation + +```markdown +--- +description: Deploy with shorthand +argument-hint: [env-shorthand] +--- + +Input: $1 + +Expanding shorthand: +- d/dev → development +- s/stg → staging +- p/prod → production + +case "$1" in + d|dev) ENV="development";; + s|stg) ENV="staging";; + p|prod) ENV="production";; + *) ENV="$1";; +esac + +Deploying to: $ENV +``` + +## Error Handling in Workflows + +### Graceful Failure + +```markdown +--- +description: Resilient deployment workflow +--- + +# Deployment Workflow + +Running steps with error handling... + +## Step 1: Tests +!`npm test` + +if [ $? -ne 0 ]; then + ERROR: Tests failed + + Options: + 1. Fix tests and retry + 2. Skip tests (NOT recommended) + 3. Abort deployment + + What would you like to do? + + [Wait for user input before continuing] +fi + +## Step 2: Build +[Continue only if Step 1 succeeded] +``` + +### Rollback on Failure + +```markdown +--- +description: Deployment with rollback +--- + +# Deploy with Rollback + +Saving current state for rollback... +Previous version: !`current-version.sh` + +Deploying new version... + +!`deploy.sh` + +if [ $? -ne 0 ]; then + DEPLOYMENT FAILED + + Initiating automatic rollback... + !`rollback.sh` + + Rolled back to previous version. + Check logs for failure details. +fi + +Deployment complete. +``` + +### Checkpoint Recovery + +```markdown +--- +description: Workflow with checkpoints +--- + +# Multi-Stage Deployment + +## Checkpoint 1: Validation +!`validate.sh` +echo "checkpoint:validation" >> .claude/deployment-checkpoints.log + +## Checkpoint 2: Build +!`build.sh` +echo "checkpoint:build" >> .claude/deployment-checkpoints.log + +## Checkpoint 3: Deploy +!`deploy.sh` +echo "checkpoint:deploy" >> .claude/deployment-checkpoints.log + +If any step fails, resume with: +/deployment-resume [last-successful-checkpoint] +``` + +## Best Practices + +### Workflow Design + +1. **Clear progression**: Number steps, show current position +2. **Explicit state**: Don't rely on implicit state +3. **User control**: Provide decision points +4. **Error recovery**: Handle failures gracefully +5. **Progress indication**: Show what's done, what's pending + +### Command Composition + +1. **Single responsibility**: Each command does one thing well +2. **Composable design**: Commands work together easily +3. **Standard interfaces**: Consistent input/output formats +4. **Loose coupling**: Commands don't depend on each other's internals + +### State Management + +1. **Persistent state**: Use .local.md files +2. **Atomic updates**: Write complete state files atomically +3. **State validation**: Check state file format/completeness +4. **Cleanup**: Remove stale state files +5. **Documentation**: Document state file formats + +### Error Handling + +1. **Fail fast**: Detect errors early +2. **Clear messages**: Explain what went wrong +3. **Recovery options**: Provide clear next steps +4. **State preservation**: Keep state for recovery +5. **Rollback capability**: Support undoing changes + +## Example: Complete Deployment Workflow + +### Initialize Command + +```markdown +--- +description: Initialize deployment +argument-hint: [environment] +allowed-tools: Write, Bash(git:*) +--- + +# Initialize Deployment to $1 + +Creating workflow state... + +\`\`\`yaml +--- +workflow: deployment +environment: $1 +branch: !`git branch --show-current` +commit: !`git rev-parse HEAD` +stage: initialized +timestamp: !`date -u +%Y-%m-%dT%H:%M:%SZ` +--- +\`\`\` + +Written to .claude/deployment-state.local.md + +Next: Run /deployment-validate +``` + +### Validation Command + +```markdown +--- +description: Validate deployment +allowed-tools: Read, Bash +--- + +Reading state: @.claude/deployment-state.local.md + +Running validation... +- Branch check: PASS +- Tests: PASS +- Build: PASS + +Updating state to 'validated'... + +Next: Run /deployment-execute +``` + +### Execution Command + +```markdown +--- +description: Execute deployment +allowed-tools: Read, Bash, Write +--- + +Reading state: @.claude/deployment-state.local.md + +Executing deployment to [environment]... + +!`deploy.sh [environment]` + +Deployment complete. +Updating state to 'completed'... + +Cleanup: /deployment-cleanup +``` + +### Cleanup Command + +```markdown +--- +description: Clean up deployment +allowed-tools: Bash +--- + +Removing deployment state... +rm .claude/deployment-state.local.md + +Deployment workflow complete. +``` + +This complete workflow demonstrates state management, sequential execution, error handling, and clean separation of concerns across multiple commands. diff --git a/skills/external/plugin-dev-command-development/references/documentation-patterns.md b/skills/external/plugin-dev-command-development/references/documentation-patterns.md new file mode 100644 index 0000000..3ea03ec --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/documentation-patterns.md @@ -0,0 +1,739 @@ +# Command Documentation Patterns + +Strategies for creating self-documenting, maintainable commands with excellent user experience. + +## Overview + +Well-documented commands are easier to use, maintain, and distribute. Documentation should be embedded in the command itself, making it immediately accessible to users and maintainers. + +## Self-Documenting Command Structure + +### Complete Command Template + +```markdown +--- +description: Clear, actionable description under 60 chars +argument-hint: [arg1] [arg2] [optional-arg] +allowed-tools: Read, Bash(git:*) +model: sonnet +--- + + + +# Command Implementation + +[Command prompt content here...] + +[Explain what will happen...] + +[Guide user through steps...] + +[Provide clear output...] +``` + +### Documentation Comment Sections + +**PURPOSE**: Why the command exists +- Problem it solves +- Use cases +- When to use vs when not to use + +**USAGE**: Basic syntax +- Command invocation pattern +- Required vs optional arguments +- Default values + +**ARGUMENTS**: Detailed argument documentation +- Each argument described +- Type information +- Valid values/ranges +- Defaults + +**EXAMPLES**: Concrete usage examples +- Common use cases +- Edge cases +- Expected outputs + +**REQUIREMENTS**: Prerequisites +- Dependencies +- Permissions +- Environmental setup + +**RELATED COMMANDS**: Connections +- Similar commands +- Complementary commands +- Alternative approaches + +**TROUBLESHOOTING**: Common issues +- Known problems +- Solutions +- Workarounds + +**CHANGELOG**: Version history +- What changed when +- Breaking changes highlighted +- Migration guidance + +## In-Line Documentation Patterns + +### Commented Sections + +```markdown +--- +description: Complex multi-step command +--- + + + + +Checking prerequisites... +- Git repository: !`git rev-parse --git-dir 2>/dev/null` +- Branch exists: [validation logic] + + + + +Analyzing differences between $1 and $2... +[Analysis logic...] + + + + +Based on analysis, recommend: +[Recommendations...] + + +``` + +### Inline Explanations + +```markdown +--- +description: Deployment command with inline docs +--- + +# Deploy to $1 + +## Pre-flight Checks + + +Current branch: !`git branch --show-current` + + +if [ "$1" = "production" ] && [ "$(git branch --show-current)" != "main" ]; then + ⚠️ WARNING: Not on main branch for production deploy + This is unusual. Confirm this is intentional. +fi + + +Running tests: !`npm test` + +✓ All checks passed + +## Deployment + + + +Deploying to $1 environment... +[Deployment steps...] + + +Verifying deployment health... +[Health checks...] + +Deployment complete! + +## Next Steps + + +1. Monitor logs: /logs $1 +2. Run smoke tests: /smoke-test $1 +3. Notify team: /notify-deployment $1 +``` + +### Decision Point Documentation + +```markdown +--- +description: Interactive deployment command +--- + +# Interactive Deployment + +## Configuration Review + +Target: $1 +Current version: !`cat version.txt` +New version: $2 + + + + + +Review the above configuration. + +**Continue with deployment?** +- Reply "yes" to proceed +- Reply "no" to cancel +- Reply "edit" to modify configuration + +[Await user input before continuing...] + + + + +Proceeding with deployment... +``` + +## Help Text Patterns + +### Built-in Help Command + +Create a help subcommand for complex commands: + +```markdown +--- +description: Main command with help +argument-hint: [subcommand] [args] +--- + +# Command Processor + +if [ "$1" = "help" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + **Command Help** + + USAGE: + /command [subcommand] [args] + + SUBCOMMANDS: + init [name] Initialize new configuration + deploy [env] Deploy to environment + status Show current status + rollback Rollback last deployment + help Show this help + + EXAMPLES: + /command init my-project + /command deploy staging + /command status + /command rollback + + For detailed help on a subcommand: + /command [subcommand] --help + + Exit. +fi + +[Regular command processing...] +``` + +### Contextual Help + +Provide help based on context: + +```markdown +--- +description: Context-aware command +argument-hint: [operation] [target] +--- + +# Context-Aware Operation + +if [ -z "$1" ]; then + **No operation specified** + + Available operations: + - analyze: Analyze target for issues + - fix: Apply automatic fixes + - report: Generate detailed report + + Usage: /command [operation] [target] + + Examples: + /command analyze src/ + /command fix src/app.js + /command report + + Run /command help for more details. + + Exit. +fi + +[Command continues if operation provided...] +``` + +## Error Message Documentation + +### Helpful Error Messages + +```markdown +--- +description: Command with good error messages +--- + +# Validation Command + +if [ -z "$1" ]; then + ❌ ERROR: Missing required argument + + The 'file-path' argument is required. + + USAGE: + /validate [file-path] + + EXAMPLE: + /validate src/app.js + + Try again with a file path. + + Exit. +fi + +if [ ! -f "$1" ]; then + ❌ ERROR: File not found: $1 + + The specified file does not exist or is not accessible. + + COMMON CAUSES: + 1. Typo in file path + 2. File was deleted or moved + 3. Insufficient permissions + + SUGGESTIONS: + - Check spelling: $1 + - Verify file exists: ls -la $(dirname "$1") + - Check permissions: ls -l "$1" + + Exit. +fi + +[Command continues if validation passes...] +``` + +### Error Recovery Guidance + +```markdown +--- +description: Command with recovery guidance +--- + +# Operation Command + +Running operation... + +!`risky-operation.sh` + +if [ $? -ne 0 ]; then + ❌ OPERATION FAILED + + The operation encountered an error and could not complete. + + WHAT HAPPENED: + The risky-operation.sh script returned a non-zero exit code. + + WHAT THIS MEANS: + - Changes may be partially applied + - System may be in inconsistent state + - Manual intervention may be needed + + RECOVERY STEPS: + 1. Check operation logs: cat /tmp/operation.log + 2. Verify system state: /check-state + 3. If needed, rollback: /rollback-operation + 4. Fix underlying issue + 5. Retry operation: /retry-operation + + NEED HELP? + - Check troubleshooting guide: /help troubleshooting + - Contact support with error code: ERR_OP_FAILED_001 + + Exit. +fi +``` + +## Usage Example Documentation + +### Embedded Examples + +```markdown +--- +description: Command with embedded examples +--- + +# Feature Command + +This command performs feature analysis with multiple options. + +## Basic Usage + +\`\`\` +/feature analyze src/ +\`\`\` + +Analyzes all files in src/ directory for feature usage. + +## Advanced Usage + +\`\`\` +/feature analyze src/ --detailed +\`\`\` + +Provides detailed analysis including: +- Feature breakdown by file +- Usage patterns +- Optimization suggestions + +## Use Cases + +**Use Case 1: Quick overview** +\`\`\` +/feature analyze . +\`\`\` +Get high-level feature summary of entire project. + +**Use Case 2: Specific directory** +\`\`\` +/feature analyze src/components +\`\`\` +Focus analysis on components directory only. + +**Use Case 3: Comparison** +\`\`\` +/feature analyze src/ --compare baseline.json +\`\`\` +Compare current features against baseline. + +--- + +Now processing your request... + +[Command implementation...] +``` + +### Example-Driven Documentation + +```markdown +--- +description: Example-heavy command +--- + +# Transformation Command + +## What This Does + +Transforms data from one format to another. + +## Examples First + +### Example 1: JSON to YAML +**Input:** `data.json` +\`\`\`json +{"name": "test", "value": 42} +\`\`\` + +**Command:** `/transform data.json yaml` + +**Output:** `data.yaml` +\`\`\`yaml +name: test +value: 42 +\`\`\` + +### Example 2: CSV to JSON +**Input:** `data.csv` +\`\`\`csv +name,value +test,42 +\`\`\` + +**Command:** `/transform data.csv json` + +**Output:** `data.json` +\`\`\`json +[{"name": "test", "value": "42"}] +\`\`\` + +### Example 3: With Options +**Command:** `/transform data.json yaml --pretty --sort-keys` + +**Result:** Formatted YAML with sorted keys + +--- + +## Your Transformation + +File: $1 +Format: $2 + +[Perform transformation...] +``` + +## Maintenance Documentation + +### Version and Changelog + +```markdown + +``` + +### Maintenance Notes + +```markdown + +``` + +## README Documentation + +Commands should have companion README files: + +```markdown +# Command Name + +Brief description of what the command does. + +## Installation + +This command is part of the [plugin-name] plugin. + +Install with: +\`\`\` +/plugin install plugin-name +\`\`\` + +## Usage + +Basic usage: +\`\`\` +/command-name [arg1] [arg2] +\`\`\` + +## Arguments + +- `arg1`: Description (required) +- `arg2`: Description (optional, defaults to X) + +## Examples + +### Example 1: Basic Usage +\`\`\` +/command-name value1 value2 +\`\`\` + +Description of what happens. + +### Example 2: Advanced Usage +\`\`\` +/command-name value1 --option +\`\`\` + +Description of advanced feature. + +## Configuration + +Optional configuration file: `.claude/command-name.local.md` + +\`\`\`markdown +--- +default_arg: value +enable_feature: true +--- +\`\`\` + +## Requirements + +- Git 2.x or later +- jq (for JSON processing) +- Node.js 14+ (optional, for advanced features) + +## Troubleshooting + +### Issue: Command not found + +**Solution:** Ensure plugin is installed and enabled. + +### Issue: Permission denied + +**Solution:** Check file permissions and allowed-tools setting. + +## Contributing + +Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md). + +## License + +MIT License - See [LICENSE](LICENSE). + +## Support + +- Issues: https://github.com/user/plugin/issues +- Docs: https://docs.example.com +- Email: support@example.com +``` + +## Best Practices + +### Documentation Principles + +1. **Write for your future self**: Assume you'll forget details +2. **Examples before explanations**: Show, then tell +3. **Progressive disclosure**: Basic info first, details available +4. **Keep it current**: Update docs when code changes +5. **Test your docs**: Verify examples actually work + +### Documentation Locations + +1. **In command file**: Core usage, examples, inline explanations +2. **README**: Installation, configuration, troubleshooting +3. **Separate docs**: Detailed guides, tutorials, API reference +4. **Comments**: Implementation details for maintainers + +### Documentation Style + +1. **Clear and concise**: No unnecessary words +2. **Active voice**: "Run the command" not "The command can be run" +3. **Consistent terminology**: Use same terms throughout +4. **Formatted well**: Use headings, lists, code blocks +5. **Accessible**: Assume reader is beginner + +### Documentation Maintenance + +1. **Version everything**: Track what changed when +2. **Deprecate gracefully**: Warn before removing features +3. **Migration guides**: Help users upgrade +4. **Archive old docs**: Keep old versions accessible +5. **Review regularly**: Ensure docs match reality + +## Documentation Checklist + +Before releasing a command: + +- [ ] Description in frontmatter is clear +- [ ] argument-hint documents all arguments +- [ ] Usage examples in comments +- [ ] Common use cases shown +- [ ] Error messages are helpful +- [ ] Requirements documented +- [ ] Related commands listed +- [ ] Changelog maintained +- [ ] Version number updated +- [ ] README created/updated +- [ ] Examples actually work +- [ ] Troubleshooting section complete + +With good documentation, commands become self-service, reducing support burden and improving user experience. diff --git a/skills/external/plugin-dev-command-development/references/frontmatter-reference.md b/skills/external/plugin-dev-command-development/references/frontmatter-reference.md new file mode 100644 index 0000000..aa85294 --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/frontmatter-reference.md @@ -0,0 +1,463 @@ +# Command Frontmatter Reference + +Complete reference for YAML frontmatter fields in slash commands. + +## Frontmatter Overview + +YAML frontmatter is optional metadata at the start of command files: + +```markdown +--- +description: Brief description +allowed-tools: Read, Write +model: sonnet +argument-hint: [arg1] [arg2] +--- + +Command prompt content here... +``` + +All fields are optional. Commands work without any frontmatter. + +## Field Specifications + +### description + +**Type:** String +**Required:** No +**Default:** First line of command prompt +**Max Length:** ~60 characters recommended for `/help` display + +**Purpose:** Describes what the command does, shown in `/help` output + +**Examples:** +```yaml +description: Review code for security issues +``` +```yaml +description: Deploy to staging environment +``` +```yaml +description: Generate API documentation +``` + +**Best practices:** +- Keep under 60 characters for clean display +- Start with verb (Review, Deploy, Generate) +- Be specific about what command does +- Avoid redundant "command" or "slash command" + +**Good:** +- ✅ "Review PR for code quality and security" +- ✅ "Deploy application to specified environment" +- ✅ "Generate comprehensive API documentation" + +**Bad:** +- ❌ "This command reviews PRs" (unnecessary "This command") +- ❌ "Review" (too vague) +- ❌ "A command that reviews pull requests for code quality, security issues, and best practices" (too long) + +### allowed-tools + +**Type:** String or Array of strings +**Required:** No +**Default:** Inherits from conversation permissions + +**Purpose:** Restrict or specify which tools command can use + +**Formats:** + +**Single tool:** +```yaml +allowed-tools: Read +``` + +**Multiple tools (comma-separated):** +```yaml +allowed-tools: Read, Write, Edit +``` + +**Multiple tools (array):** +```yaml +allowed-tools: + - Read + - Write + - Bash(git:*) +``` + +**Tool Patterns:** + +**Specific tools:** +```yaml +allowed-tools: Read, Grep, Edit +``` + +**Bash with command filter:** +```yaml +allowed-tools: Bash(git:*) # Only git commands +allowed-tools: Bash(npm:*) # Only npm commands +allowed-tools: Bash(docker:*) # Only docker commands +``` + +**All tools (not recommended):** +```yaml +allowed-tools: "*" +``` + +**When to use:** + +1. **Security:** Restrict command to safe operations + ```yaml + allowed-tools: Read, Grep # Read-only command + ``` + +2. **Clarity:** Document required tools + ```yaml + allowed-tools: Bash(git:*), Read + ``` + +3. **Bash execution:** Enable bash command output + ```yaml + allowed-tools: Bash(git status:*), Bash(git diff:*) + ``` + +**Best practices:** +- Be as restrictive as possible +- Use command filters for Bash (e.g., `git:*` not `*`) +- Only specify when different from conversation permissions +- Document why specific tools are needed + +### model + +**Type:** String +**Required:** No +**Default:** Inherits from conversation +**Values:** `sonnet`, `opus`, `haiku` + +**Purpose:** Specify which Claude model executes the command + +**Examples:** +```yaml +model: haiku # Fast, efficient for simple tasks +``` +```yaml +model: sonnet # Balanced performance (default) +``` +```yaml +model: opus # Maximum capability for complex tasks +``` + +**When to use:** + +**Use `haiku` for:** +- Simple, formulaic commands +- Fast execution needed +- Low complexity tasks +- Frequent invocations + +```yaml +--- +description: Format code file +model: haiku +--- +``` + +**Use `sonnet` for:** +- Standard commands (default) +- Balanced speed/quality +- Most common use cases + +```yaml +--- +description: Review code changes +model: sonnet +--- +``` + +**Use `opus` for:** +- Complex analysis +- Architectural decisions +- Deep code understanding +- Critical tasks + +```yaml +--- +description: Analyze system architecture +model: opus +--- +``` + +**Best practices:** +- Omit unless specific need +- Use `haiku` for speed when possible +- Reserve `opus` for genuinely complex tasks +- Test with different models to find right balance + +### argument-hint + +**Type:** String +**Required:** No +**Default:** None + +**Purpose:** Document expected arguments for users and autocomplete + +**Format:** +```yaml +argument-hint: [arg1] [arg2] [optional-arg] +``` + +**Examples:** + +**Single argument:** +```yaml +argument-hint: [pr-number] +``` + +**Multiple required arguments:** +```yaml +argument-hint: [environment] [version] +``` + +**Optional arguments:** +```yaml +argument-hint: [file-path] [options] +``` + +**Descriptive names:** +```yaml +argument-hint: [source-branch] [target-branch] [commit-message] +``` + +**Best practices:** +- Use square brackets `[]` for each argument +- Use descriptive names (not `arg1`, `arg2`) +- Indicate optional vs required in description +- Match order to positional arguments in command +- Keep concise but clear + +**Examples by pattern:** + +**Simple command:** +```yaml +--- +description: Fix issue by number +argument-hint: [issue-number] +--- + +Fix issue #$1... +``` + +**Multi-argument:** +```yaml +--- +description: Deploy to environment +argument-hint: [app-name] [environment] [version] +--- + +Deploy $1 to $2 using version $3... +``` + +**With options:** +```yaml +--- +description: Run tests with options +argument-hint: [test-pattern] [options] +--- + +Run tests matching $1 with options: $2 +``` + +### disable-model-invocation + +**Type:** Boolean +**Required:** No +**Default:** false + +**Purpose:** Prevent SlashCommand tool from programmatically invoking command + +**Examples:** +```yaml +disable-model-invocation: true +``` + +**When to use:** + +1. **Manual-only commands:** Commands requiring user judgment + ```yaml + --- + description: Approve deployment to production + disable-model-invocation: true + --- + ``` + +2. **Destructive operations:** Commands with irreversible effects + ```yaml + --- + description: Delete all test data + disable-model-invocation: true + --- + ``` + +3. **Interactive workflows:** Commands needing user input + ```yaml + --- + description: Walk through setup wizard + disable-model-invocation: true + --- + ``` + +**Default behavior (false):** +- Command available to SlashCommand tool +- Claude can invoke programmatically +- Still available for manual invocation + +**When true:** +- Command only invokable by user typing `/command` +- Not available to SlashCommand tool +- Safer for sensitive operations + +**Best practices:** +- Use sparingly (limits Claude's autonomy) +- Document why in command comments +- Consider if command should exist if always manual + +## Complete Examples + +### Minimal Command + +No frontmatter needed: + +```markdown +Review this code for common issues and suggest improvements. +``` + +### Simple Command + +Just description: + +```markdown +--- +description: Review code for issues +--- + +Review this code for common issues and suggest improvements. +``` + +### Standard Command + +Description and tools: + +```markdown +--- +description: Review Git changes +allowed-tools: Bash(git:*), Read +--- + +Current changes: !`git diff --name-only` + +Review each changed file for: +- Code quality +- Potential bugs +- Best practices +``` + +### Complex Command + +All common fields: + +```markdown +--- +description: Deploy application to environment +argument-hint: [app-name] [environment] [version] +allowed-tools: Bash(kubectl:*), Bash(helm:*), Read +model: sonnet +--- + +Deploy $1 to $2 environment using version $3 + +Pre-deployment checks: +- Verify $2 configuration +- Check cluster status: !`kubectl cluster-info` +- Validate version $3 exists + +Proceed with deployment following deployment runbook. +``` + +### Manual-Only Command + +Restricted invocation: + +```markdown +--- +description: Approve production deployment +argument-hint: [deployment-id] +disable-model-invocation: true +allowed-tools: Bash(gh:*) +--- + + + +Review deployment $1 for production approval: + +Deployment details: !`gh api /deployments/$1` + +Verify: +- All tests passed +- Security scan clean +- Stakeholder approval +- Rollback plan ready + +Type "APPROVED" to confirm deployment. +``` + +## Validation + +### Common Errors + +**Invalid YAML syntax:** +```yaml +--- +description: Missing quote +allowed-tools: Read, Write +model: sonnet +--- # ❌ Missing closing quote above +``` + +**Fix:** Validate YAML syntax + +**Incorrect tool specification:** +```yaml +allowed-tools: Bash # ❌ Missing command filter +``` + +**Fix:** Use `Bash(git:*)` format + +**Invalid model name:** +```yaml +model: gpt4 # ❌ Not a valid Claude model +``` + +**Fix:** Use `sonnet`, `opus`, or `haiku` + +### Validation Checklist + +Before committing command: +- [ ] YAML syntax valid (no errors) +- [ ] Description under 60 characters +- [ ] allowed-tools uses proper format +- [ ] model is valid value if specified +- [ ] argument-hint matches positional arguments +- [ ] disable-model-invocation used appropriately + +## Best Practices Summary + +1. **Start minimal:** Add frontmatter only when needed +2. **Document arguments:** Always use argument-hint with arguments +3. **Restrict tools:** Use most restrictive allowed-tools that works +4. **Choose right model:** Use haiku for speed, opus for complexity +5. **Manual-only sparingly:** Only use disable-model-invocation when necessary +6. **Clear descriptions:** Make commands discoverable in `/help` +7. **Test thoroughly:** Verify frontmatter works as expected diff --git a/skills/external/plugin-dev-command-development/references/interactive-commands.md b/skills/external/plugin-dev-command-development/references/interactive-commands.md new file mode 100644 index 0000000..e55bc38 --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/interactive-commands.md @@ -0,0 +1,920 @@ +# Interactive Command Patterns + +Comprehensive guide to creating commands that gather user feedback and make decisions through the AskUserQuestion tool. + +## Overview + +Some commands need user input that doesn't work well with simple arguments. For example: +- Choosing between multiple complex options with trade-offs +- Selecting multiple items from a list +- Making decisions that require explanation +- Gathering preferences or configuration interactively + +For these cases, use the **AskUserQuestion tool** within command execution rather than relying on command arguments. + +## When to Use AskUserQuestion + +### Use AskUserQuestion When: + +1. **Multiple choice decisions** with explanations needed +2. **Complex options** that require context to choose +3. **Multi-select scenarios** (choosing multiple items) +4. **Preference gathering** for configuration +5. **Interactive workflows** that adapt based on answers + +### Use Command Arguments When: + +1. **Simple values** (file paths, numbers, names) +2. **Known inputs** user already has +3. **Scriptable workflows** that should be automatable +4. **Fast invocations** where prompting would slow down + +## AskUserQuestion Basics + +### Tool Parameters + +```typescript +{ + questions: [ + { + question: "Which authentication method should we use?", + header: "Auth method", // Short label (max 12 chars) + multiSelect: false, // true for multiple selection + options: [ + { + label: "OAuth 2.0", + description: "Industry standard, supports multiple providers" + }, + { + label: "JWT", + description: "Stateless, good for APIs" + }, + { + label: "Session", + description: "Traditional, server-side state" + } + ] + } + ] +} +``` + +**Key points:** +- Users can always choose "Other" to provide custom input (automatic) +- `multiSelect: true` allows selecting multiple options +- Options should be 2-4 choices (not more) +- Can ask 1-4 questions per tool call + +## Command Pattern for User Interaction + +### Basic Interactive Command + +```markdown +--- +description: Interactive setup command +allowed-tools: AskUserQuestion, Write +--- + +# Interactive Plugin Setup + +This command will guide you through configuring the plugin with a series of questions. + +## Step 1: Gather Configuration + +Use the AskUserQuestion tool to ask: + +**Question 1 - Deployment target:** +- header: "Deploy to" +- question: "Which deployment platform will you use?" +- options: + - AWS (Amazon Web Services with ECS/EKS) + - GCP (Google Cloud with GKE) + - Azure (Microsoft Azure with AKS) + - Local (Docker on local machine) + +**Question 2 - Environment strategy:** +- header: "Environments" +- question: "How many environments do you need?" +- options: + - Single (Just production) + - Standard (Dev, Staging, Production) + - Complete (Dev, QA, Staging, Production) + +**Question 3 - Features to enable:** +- header: "Features" +- question: "Which features do you want to enable?" +- multiSelect: true +- options: + - Auto-scaling (Automatic resource scaling) + - Monitoring (Health checks and metrics) + - CI/CD (Automated deployment pipeline) + - Backups (Automated database backups) + +## Step 2: Process Answers + +Based on the answers received from AskUserQuestion: + +1. Parse the deployment target choice +2. Set up environment-specific configuration +3. Enable selected features +4. Generate configuration files + +## Step 3: Generate Configuration + +Create `.claude/plugin-name.local.md` with: + +\`\`\`yaml +--- +deployment_target: [answer from Q1] +environments: [answer from Q2] +features: + auto_scaling: [true if selected in Q3] + monitoring: [true if selected in Q3] + ci_cd: [true if selected in Q3] + backups: [true if selected in Q3] +--- + +# Plugin Configuration + +Generated: [timestamp] +Target: [deployment_target] +Environments: [environments] +\`\`\` + +## Step 4: Confirm and Next Steps + +Confirm configuration created and guide user on next steps. +``` + +### Multi-Stage Interactive Workflow + +```markdown +--- +description: Multi-stage interactive workflow +allowed-tools: AskUserQuestion, Read, Write, Bash +--- + +# Multi-Stage Deployment Setup + +This command walks through deployment setup in stages, adapting based on your answers. + +## Stage 1: Basic Configuration + +Use AskUserQuestion to ask about deployment basics. + +Based on answers, determine which additional questions to ask. + +## Stage 2: Advanced Options (Conditional) + +If user selected "Advanced" deployment in Stage 1: + +Use AskUserQuestion to ask about: +- Load balancing strategy +- Caching configuration +- Security hardening options + +If user selected "Simple" deployment: +- Skip advanced questions +- Use sensible defaults + +## Stage 3: Confirmation + +Show summary of all selections. + +Use AskUserQuestion for final confirmation: +- header: "Confirm" +- question: "Does this configuration look correct?" +- options: + - Yes (Proceed with setup) + - No (Start over) + - Modify (Let me adjust specific settings) + +If "Modify", ask which specific setting to change. + +## Stage 4: Execute Setup + +Based on confirmed configuration, execute setup steps. +``` + +## Interactive Question Design + +### Question Structure + +**Good questions:** +```markdown +Question: "Which database should we use for this project?" +Header: "Database" +Options: + - PostgreSQL (Relational, ACID compliant, best for complex queries) + - MongoDB (Document store, flexible schema, best for rapid iteration) + - Redis (In-memory, fast, best for caching and sessions) +``` + +**Poor questions:** +```markdown +Question: "Database?" // Too vague +Header: "DB" // Unclear abbreviation +Options: + - Option 1 // Not descriptive + - Option 2 +``` + +### Option Design Best Practices + +**Clear labels:** +- Use 1-5 words +- Specific and descriptive +- No jargon without context + +**Helpful descriptions:** +- Explain what the option means +- Mention key benefits or trade-offs +- Help user make informed decision +- Keep to 1-2 sentences + +**Appropriate number:** +- 2-4 options per question +- Don't overwhelm with too many choices +- Group related options +- "Other" automatically provided + +### Multi-Select Questions + +**When to use multiSelect:** + +```markdown +Use AskUserQuestion for enabling features: + +Question: "Which features do you want to enable?" +Header: "Features" +multiSelect: true // Allow selecting multiple +Options: + - Logging (Detailed operation logs) + - Metrics (Performance monitoring) + - Alerts (Error notifications) + - Backups (Automatic backups) +``` + +User can select any combination: none, some, or all. + +**When NOT to use multiSelect:** + +```markdown +Question: "Which authentication method?" +multiSelect: false // Only one auth method makes sense +``` + +Mutually exclusive choices should not use multiSelect. + +## Command Patterns with AskUserQuestion + +### Pattern 1: Simple Yes/No Decision + +```markdown +--- +description: Command with confirmation +allowed-tools: AskUserQuestion, Bash +--- + +# Destructive Operation + +This operation will delete all cached data. + +Use AskUserQuestion to confirm: + +Question: "This will delete all cached data. Are you sure?" +Header: "Confirm" +Options: + - Yes (Proceed with deletion) + - No (Cancel operation) + +If user selects "Yes": + Execute deletion + Report completion + +If user selects "No": + Cancel operation + Exit without changes +``` + +### Pattern 2: Multiple Configuration Questions + +```markdown +--- +description: Multi-question configuration +allowed-tools: AskUserQuestion, Write +--- + +# Project Configuration Setup + +Gather configuration through multiple questions. + +Use AskUserQuestion with multiple questions in one call: + +**Question 1:** +- question: "Which programming language?" +- header: "Language" +- options: Python, TypeScript, Go, Rust + +**Question 2:** +- question: "Which test framework?" +- header: "Testing" +- options: Jest, PyTest, Go Test, Cargo Test + (Adapt based on language from Q1) + +**Question 3:** +- question: "Which CI/CD platform?" +- header: "CI/CD" +- options: GitHub Actions, GitLab CI, CircleCI + +**Question 4:** +- question: "Which features do you need?" +- header: "Features" +- multiSelect: true +- options: Linting, Type checking, Code coverage, Security scanning + +Process all answers together to generate cohesive configuration. +``` + +### Pattern 3: Conditional Question Flow + +```markdown +--- +description: Conditional interactive workflow +allowed-tools: AskUserQuestion, Read, Write +--- + +# Adaptive Configuration + +## Question 1: Deployment Complexity + +Use AskUserQuestion: + +Question: "How complex is your deployment?" +Header: "Complexity" +Options: + - Simple (Single server, straightforward) + - Standard (Multiple servers, load balancing) + - Complex (Microservices, orchestration) + +## Conditional Questions Based on Answer + +If answer is "Simple": + - No additional questions + - Use minimal configuration + +If answer is "Standard": + - Ask about load balancing strategy + - Ask about scaling policy + +If answer is "Complex": + - Ask about orchestration platform (Kubernetes, Docker Swarm) + - Ask about service mesh (Istio, Linkerd, None) + - Ask about monitoring (Prometheus, Datadog, CloudWatch) + - Ask about logging aggregation + +## Process Conditional Answers + +Generate configuration appropriate for selected complexity level. +``` + +### Pattern 4: Iterative Collection + +```markdown +--- +description: Collect multiple items iteratively +allowed-tools: AskUserQuestion, Write +--- + +# Collect Team Members + +We'll collect team member information for the project. + +## Question: How many team members? + +Use AskUserQuestion: + +Question: "How many team members should we set up?" +Header: "Team size" +Options: + - 2 people + - 3 people + - 4 people + - 6 people + +## Iterate Through Team Members + +For each team member (1 to N based on answer): + +Use AskUserQuestion for member details: + +Question: "What role for team member [number]?" +Header: "Role" +Options: + - Frontend Developer + - Backend Developer + - DevOps Engineer + - QA Engineer + - Designer + +Store each member's information. + +## Generate Team Configuration + +After collecting all N members, create team configuration file with all members and their roles. +``` + +### Pattern 5: Dependency Selection + +```markdown +--- +description: Select dependencies with multi-select +allowed-tools: AskUserQuestion +--- + +# Configure Project Dependencies + +## Question: Required Libraries + +Use AskUserQuestion with multiSelect: + +Question: "Which libraries does your project need?" +Header: "Dependencies" +multiSelect: true +Options: + - React (UI framework) + - Express (Web server) + - TypeORM (Database ORM) + - Jest (Testing framework) + - Axios (HTTP client) + +User can select any combination. + +## Process Selections + +For each selected library: +- Add to package.json dependencies +- Generate sample configuration +- Create usage examples +- Update documentation +``` + +## Best Practices for Interactive Commands + +### Question Design + +1. **Clear and specific**: Question should be unambiguous +2. **Concise header**: Max 12 characters for clean display +3. **Helpful options**: Labels are clear, descriptions explain trade-offs +4. **Appropriate count**: 2-4 options per question, 1-4 questions per call +5. **Logical order**: Questions flow naturally + +### Error Handling + +```markdown +# Handle AskUserQuestion Responses + +After calling AskUserQuestion, verify answers received: + +If answers are empty or invalid: + Something went wrong gathering responses. + + Please try again or provide configuration manually: + [Show alternative approach] + + Exit. + +If answers look correct: + Process as expected +``` + +### Progressive Disclosure + +```markdown +# Start Simple, Get Detailed as Needed + +## Question 1: Setup Type + +Use AskUserQuestion: + +Question: "How would you like to set up?" +Header: "Setup type" +Options: + - Quick (Use recommended defaults) + - Custom (Configure all options) + - Guided (Step-by-step with explanations) + +If "Quick": + Apply defaults, minimal questions + +If "Custom": + Ask all available configuration questions + +If "Guided": + Ask questions with extra explanation + Provide recommendations along the way +``` + +### Multi-Select Guidelines + +**Good multi-select use:** +```markdown +Question: "Which features do you want to enable?" +multiSelect: true +Options: + - Logging + - Metrics + - Alerts + - Backups + +Reason: User might want any combination +``` + +**Bad multi-select use:** +```markdown +Question: "Which database engine?" +multiSelect: true // ❌ Should be single-select + +Reason: Can only use one database engine +``` + +## Advanced Patterns + +### Validation Loop + +```markdown +--- +description: Interactive with validation +allowed-tools: AskUserQuestion, Bash +--- + +# Setup with Validation + +## Gather Configuration + +Use AskUserQuestion to collect settings. + +## Validate Configuration + +Check if configuration is valid: +- Required dependencies available? +- Settings compatible with each other? +- No conflicts detected? + +If validation fails: + Show validation errors + + Use AskUserQuestion to ask: + + Question: "Configuration has issues. What would you like to do?" + Header: "Next step" + Options: + - Fix (Adjust settings to resolve issues) + - Override (Proceed despite warnings) + - Cancel (Abort setup) + + Based on answer, retry or proceed or exit. +``` + +### Build Configuration Incrementally + +```markdown +--- +description: Incremental configuration builder +allowed-tools: AskUserQuestion, Write, Read +--- + +# Incremental Setup + +## Phase 1: Core Settings + +Use AskUserQuestion for core settings. + +Save to `.claude/config-partial.yml` + +## Phase 2: Review Core Settings + +Show user the core settings: + +Based on these core settings, you need to configure: +- [Setting A] (because you chose [X]) +- [Setting B] (because you chose [Y]) + +Ready to continue? + +## Phase 3: Detailed Settings + +Use AskUserQuestion for settings based on Phase 1 answers. + +Merge with core settings. + +## Phase 4: Final Review + +Present complete configuration. + +Use AskUserQuestion for confirmation: + +Question: "Is this configuration correct?" +Options: + - Yes (Save and apply) + - No (Start over) + - Modify (Edit specific settings) +``` + +### Dynamic Options Based on Context + +```markdown +--- +description: Context-aware questions +allowed-tools: AskUserQuestion, Bash, Read +--- + +# Context-Aware Setup + +## Detect Current State + +Check existing configuration: +- Current language: !`detect-language.sh` +- Existing frameworks: !`detect-frameworks.sh` +- Available tools: !`check-tools.sh` + +## Ask Context-Appropriate Questions + +Based on detected language, ask relevant questions. + +If language is TypeScript: + + Use AskUserQuestion: + + Question: "Which TypeScript features should we enable?" + Options: + - Strict Mode (Maximum type safety) + - Decorators (Experimental decorator support) + - Path Mapping (Module path aliases) + +If language is Python: + + Use AskUserQuestion: + + Question: "Which Python tools should we configure?" + Options: + - Type Hints (mypy for type checking) + - Black (Code formatting) + - Pylint (Linting and style) + +Questions adapt to project context. +``` + +## Real-World Example: Multi-Agent Swarm Launch + +**From multi-agent-swarm plugin:** + +```markdown +--- +description: Launch multi-agent swarm +allowed-tools: AskUserQuestion, Read, Write, Bash +--- + +# Launch Multi-Agent Swarm + +## Interactive Mode (No Task List Provided) + +If user didn't provide task list file, help create one interactively. + +### Question 1: Agent Count + +Use AskUserQuestion: + +Question: "How many agents should we launch?" +Header: "Agent count" +Options: + - 2 agents (Best for simple projects) + - 3 agents (Good for medium projects) + - 4 agents (Standard team size) + - 6 agents (Large projects) + - 8 agents (Complex multi-component projects) + +### Question 2: Task Definition Approach + +Use AskUserQuestion: + +Question: "How would you like to define tasks?" +Header: "Task setup" +Options: + - File (I have a task list file ready) + - Guided (Help me create tasks interactively) + - Custom (Other approach) + +If "File": + Ask for file path + Validate file exists and has correct format + +If "Guided": + Enter iterative task creation mode (see below) + +### Question 3: Coordination Mode + +Use AskUserQuestion: + +Question: "How should agents coordinate?" +Header: "Coordination" +Options: + - Team Leader (One agent coordinates others) + - Collaborative (Agents coordinate as peers) + - Autonomous (Independent work, minimal coordination) + +### Iterative Task Creation (If "Guided" Selected) + +For each agent (1 to N from Question 1): + +**Question A: Agent Name** +Question: "What should we call agent [number]?" +Header: "Agent name" +Options: + - auth-agent + - api-agent + - ui-agent + - db-agent + (Provide relevant suggestions based on common patterns) + +**Question B: Task Type** +Question: "What task for [agent-name]?" +Header: "Task type" +Options: + - Authentication (User auth, JWT, OAuth) + - API Endpoints (REST/GraphQL APIs) + - UI Components (Frontend components) + - Database (Schema, migrations, queries) + - Testing (Test suites and coverage) + - Documentation (Docs, README, guides) + +**Question C: Dependencies** +Question: "What does [agent-name] depend on?" +Header: "Dependencies" +multiSelect: true +Options: + - [List of previously defined agents] + - No dependencies + +**Question D: Base Branch** +Question: "Which base branch for PR?" +Header: "PR base" +Options: + - main + - staging + - develop + +Store all task information for each agent. + +### Generate Task List File + +After collecting all agent task details: + +1. Ask for project name +2. Generate task list in proper format +3. Save to `.daisy/swarm/tasks.md` +4. Show user the file path +5. Proceed with launch using generated task list +``` + +## Best Practices + +### Question Writing + +1. **Be specific**: "Which database?" not "Choose option?" +2. **Explain trade-offs**: Describe pros/cons in option descriptions +3. **Provide context**: Question text should stand alone +4. **Guide decisions**: Help user make informed choice +5. **Keep concise**: Header max 12 chars, descriptions 1-2 sentences + +### Option Design + +1. **Meaningful labels**: Specific, clear names +2. **Informative descriptions**: Explain what each option does +3. **Show trade-offs**: Help user understand implications +4. **Consistent detail**: All options equally explained +5. **2-4 options**: Not too few, not too many + +### Flow Design + +1. **Logical order**: Questions flow naturally +2. **Build on previous**: Later questions use earlier answers +3. **Minimize questions**: Ask only what's needed +4. **Group related**: Ask related questions together +5. **Show progress**: Indicate where in flow + +### User Experience + +1. **Set expectations**: Tell user what to expect +2. **Explain why**: Help user understand purpose +3. **Provide defaults**: Suggest recommended options +4. **Allow escape**: Let user cancel or restart +5. **Confirm actions**: Summarize before executing + +## Common Patterns + +### Pattern: Feature Selection + +```markdown +Use AskUserQuestion: + +Question: "Which features do you need?" +Header: "Features" +multiSelect: true +Options: + - Authentication + - Authorization + - Rate Limiting + - Caching +``` + +### Pattern: Environment Configuration + +```markdown +Use AskUserQuestion: + +Question: "Which environment is this?" +Header: "Environment" +Options: + - Development (Local development) + - Staging (Pre-production testing) + - Production (Live environment) +``` + +### Pattern: Priority Selection + +```markdown +Use AskUserQuestion: + +Question: "What's the priority for this task?" +Header: "Priority" +Options: + - Critical (Must be done immediately) + - High (Important, do soon) + - Medium (Standard priority) + - Low (Nice to have) +``` + +### Pattern: Scope Selection + +```markdown +Use AskUserQuestion: + +Question: "What scope should we analyze?" +Header: "Scope" +Options: + - Current file (Just this file) + - Current directory (All files in directory) + - Entire project (Full codebase scan) +``` + +## Combining Arguments and Questions + +### Use Both Appropriately + +**Arguments for known values:** +```markdown +--- +argument-hint: [project-name] +allowed-tools: AskUserQuestion, Write +--- + +Setup for project: $1 + +Now gather additional configuration... + +Use AskUserQuestion for options that require explanation. +``` + +**Questions for complex choices:** +```markdown +Project name from argument: $1 + +Now use AskUserQuestion to choose: +- Architecture pattern +- Technology stack +- Deployment strategy + +These require explanation, so questions work better than arguments. +``` + +## Troubleshooting + +**Questions not appearing:** +- Verify AskUserQuestion in allowed-tools +- Check question format is correct +- Ensure options array has 2-4 items + +**User can't make selection:** +- Check option labels are clear +- Verify descriptions are helpful +- Consider if too many options +- Ensure multiSelect setting is correct + +**Flow feels confusing:** +- Reduce number of questions +- Group related questions +- Add explanation between stages +- Show progress through workflow + +With AskUserQuestion, commands become interactive wizards that guide users through complex decisions while maintaining the clarity that simple arguments provide for straightforward inputs. diff --git a/skills/external/plugin-dev-command-development/references/marketplace-considerations.md b/skills/external/plugin-dev-command-development/references/marketplace-considerations.md new file mode 100644 index 0000000..03e706c --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/marketplace-considerations.md @@ -0,0 +1,904 @@ +# Marketplace Considerations for Commands + +Guidelines for creating commands designed for distribution and marketplace success. + +## Overview + +Commands distributed through marketplaces need additional consideration beyond personal use commands. They must work across environments, handle diverse use cases, and provide excellent user experience for unknown users. + +## Design for Distribution + +### Universal Compatibility + +**Cross-platform considerations:** + +```markdown +--- +description: Cross-platform command +allowed-tools: Bash(*) +--- + +# Platform-Aware Command + +Detecting platform... + +case "$(uname)" in + Darwin*) PLATFORM="macOS" ;; + Linux*) PLATFORM="Linux" ;; + MINGW*|MSYS*|CYGWIN*) PLATFORM="Windows" ;; + *) PLATFORM="Unknown" ;; +esac + +Platform: $PLATFORM + + +if [ "$PLATFORM" = "Windows" ]; then + # Windows-specific handling + PATH_SEP="\\" + NULL_DEVICE="NUL" +else + # Unix-like handling + PATH_SEP="/" + NULL_DEVICE="/dev/null" +fi + +[Platform-appropriate implementation...] +``` + +**Avoid platform-specific commands:** + +```markdown + +!`pbcopy < file.txt` + + +if command -v pbcopy > /dev/null; then + pbcopy < file.txt +elif command -v xclip > /dev/null; then + xclip -selection clipboard < file.txt +elif command -v clip.exe > /dev/null; then + cat file.txt | clip.exe +else + echo "Clipboard not available on this platform" +fi +``` + +### Minimal Dependencies + +**Check for required tools:** + +```markdown +--- +description: Dependency-aware command +allowed-tools: Bash(*) +--- + +# Check Dependencies + +Required tools: +- git +- jq +- node + +Checking availability... + +MISSING_DEPS="" + +for tool in git jq node; do + if ! command -v $tool > /dev/null; then + MISSING_DEPS="$MISSING_DEPS $tool" + fi +done + +if [ -n "$MISSING_DEPS" ]; then + ❌ ERROR: Missing required dependencies:$MISSING_DEPS + + INSTALLATION: + - git: https://git-scm.com/downloads + - jq: https://stedolan.github.io/jq/download/ + - node: https://nodejs.org/ + + Install missing tools and try again. + + Exit. +fi + +✓ All dependencies available + +[Continue with command...] +``` + +**Document optional dependencies:** + +```markdown + +``` + +### Graceful Degradation + +**Handle missing features:** + +```markdown +--- +description: Feature-aware command +--- + +# Feature Detection + +Detecting available features... + +FEATURES="" + +if command -v gh > /dev/null; then + FEATURES="$FEATURES github" +fi + +if command -v docker > /dev/null; then + FEATURES="$FEATURES docker" +fi + +Available features: $FEATURES + +if echo "$FEATURES" | grep -q "github"; then + # Full functionality with GitHub integration + echo "✓ GitHub integration available" +else + # Reduced functionality without GitHub + echo "⚠ Limited functionality: GitHub CLI not installed" + echo " Install 'gh' for full features" +fi + +[Adapt behavior based on available features...] +``` + +## User Experience for Unknown Users + +### Clear Onboarding + +**First-run experience:** + +```markdown +--- +description: Command with onboarding +allowed-tools: Read, Write +--- + +# First Run Check + +if [ ! -f ".claude/command-initialized" ]; then + **Welcome to Command Name!** + + This appears to be your first time using this command. + + WHAT THIS COMMAND DOES: + [Brief explanation of purpose and benefits] + + QUICK START: + 1. Basic usage: /command [arg] + 2. For help: /command help + 3. Examples: /command examples + + SETUP: + No additional setup required. You're ready to go! + + ✓ Initialization complete + + [Create initialization marker] + + Ready to proceed with your request... +fi + +[Normal command execution...] +``` + +**Progressive feature discovery:** + +```markdown +--- +description: Command with tips +--- + +# Command Execution + +[Main functionality...] + +--- + +💡 TIP: Did you know? + +You can speed up this command with the --fast flag: + /command --fast [args] + +For more tips: /command tips +``` + +### Comprehensive Error Handling + +**Anticipate user mistakes:** + +```markdown +--- +description: Forgiving command +--- + +# User Input Handling + +Argument: "$1" + + +if [ "$1" = "hlep" ] || [ "$1" = "hepl" ]; then + Did you mean: help? + + Showing help instead... + [Display help] + + Exit. +fi + + +if [ "$1" != "valid-option1" ] && [ "$1" != "valid-option2" ]; then + ❌ Unknown option: $1 + + Did you mean: + - valid-option1 (most similar) + - valid-option2 + + For all options: /command help + + Exit. +fi + +[Command continues...] +``` + +**Helpful diagnostics:** + +```markdown +--- +description: Diagnostic command +--- + +# Operation Failed + +The operation could not complete. + +**Diagnostic Information:** + +Environment: +- Platform: $(uname) +- Shell: $SHELL +- Working directory: $(pwd) +- Command: /command $@ + +Checking common issues: +- Git repository: $(git rev-parse --git-dir 2>&1) +- Write permissions: $(test -w . && echo "OK" || echo "DENIED") +- Required files: $(test -f config.yml && echo "Found" || echo "Missing") + +This information helps debug the issue. + +For support, include the above diagnostics. +``` + +## Distribution Best Practices + +### Namespace Awareness + +**Avoid name collisions:** + +```markdown +--- +description: Namespaced command +--- + + + +# Plugin Name Command + +[Implementation...] +``` + +**Document naming rationale:** + +```markdown + +``` + +### Configurability + +**User preferences:** + +```markdown +--- +description: Configurable command +allowed-tools: Read +--- + +# Load User Configuration + +Default configuration: +- verbose: false +- color: true +- max_results: 10 + +Checking for user config: .claude/plugin-name.local.md + +if [ -f ".claude/plugin-name.local.md" ]; then + # Parse YAML frontmatter for settings + VERBOSE=$(grep "^verbose:" .claude/plugin-name.local.md | cut -d: -f2 | tr -d ' ') + COLOR=$(grep "^color:" .claude/plugin-name.local.md | cut -d: -f2 | tr -d ' ') + MAX_RESULTS=$(grep "^max_results:" .claude/plugin-name.local.md | cut -d: -f2 | tr -d ' ') + + echo "✓ Using user configuration" +else + echo "Using default configuration" + echo "Create .claude/plugin-name.local.md to customize" +fi + +[Use configuration in command...] +``` + +**Sensible defaults:** + +```markdown +--- +description: Command with smart defaults +--- + +# Smart Defaults + +Configuration: +- Format: ${FORMAT:-json} # Defaults to json +- Output: ${OUTPUT:-stdout} # Defaults to stdout +- Verbose: ${VERBOSE:-false} # Defaults to false + +These defaults work for 80% of use cases. + +Override with arguments: + /command --format yaml --output file.txt --verbose + +Or set in .claude/plugin-name.local.md: +\`\`\`yaml +--- +format: yaml +output: custom.txt +verbose: true +--- +\`\`\` +``` + +### Version Compatibility + +**Version checking:** + +```markdown +--- +description: Version-aware command +--- + + + +# Version Check + +Command version: 2.1.0 +Plugin version: [detect from plugin.json] + +if [ "$PLUGIN_VERSION" < "2.0.0" ]; then + ❌ ERROR: Incompatible plugin version + + This command requires plugin version >= 2.0.0 + Current version: $PLUGIN_VERSION + + Update plugin: + /plugin update plugin-name + + Exit. +fi + +✓ Version compatible + +[Command continues...] +``` + +**Deprecation warnings:** + +```markdown +--- +description: Command with deprecation warnings +--- + +# Deprecation Check + +if [ "$1" = "--old-flag" ]; then + ⚠️ DEPRECATION WARNING + + The --old-flag option is deprecated as of v2.0.0 + It will be removed in v3.0.0 (est. June 2025) + + Use instead: --new-flag + + Example: + Old: /command --old-flag value + New: /command --new-flag value + + See migration guide: /command migrate + + Continuing with deprecated behavior for now... +fi + +[Handle both old and new flags during deprecation period...] +``` + +## Marketplace Presentation + +### Command Discovery + +**Descriptive naming:** + +```markdown +--- +description: Review pull request with security and quality checks +--- + + +``` + +```markdown +--- +description: Do the thing +--- + + +``` + +**Searchable keywords:** + +```markdown + +``` + +### Showcase Examples + +**Compelling demonstrations:** + +```markdown +--- +description: Advanced code analysis command +--- + +# Code Analysis Command + +This command performs deep code analysis with actionable insights. + +## Demo: Quick Security Audit + +Try it now: +\`\`\` +/analyze-code src/ --security +\`\`\` + +**What you'll get:** +- Security vulnerability detection +- Code quality metrics +- Performance bottleneck identification +- Actionable recommendations + +**Sample output:** +\`\`\` +Security Analysis Results +========================= + +🔴 Critical (2): + - SQL injection risk in users.js:45 + - XSS vulnerability in display.js:23 + +🟡 Warnings (5): + - Unvalidated input in api.js:67 + ... + +Recommendations: +1. Fix critical issues immediately +2. Review warnings before next release +3. Run /analyze-code --fix for auto-fixes +\`\`\` + +--- + +Ready to analyze your code... + +[Command implementation...] +``` + +### User Reviews and Feedback + +**Feedback mechanism:** + +```markdown +--- +description: Command with feedback +--- + +# Command Complete + +[Command results...] + +--- + +**How was your experience?** + +This helps improve the command for everyone. + +Rate this command: +- 👍 Helpful +- 👎 Not helpful +- 🐛 Found a bug +- 💡 Have a suggestion + +Reply with an emoji or: +- /command feedback + +Your feedback matters! +``` + +**Usage analytics preparation:** + +```markdown + +``` + +## Quality Standards + +### Professional Polish + +**Consistent branding:** + +```markdown +--- +description: Branded command +--- + +# ✨ Command Name + +Part of the [Plugin Name] suite + +[Command functionality...] + +--- + +**Need Help?** +- Documentation: https://docs.example.com +- Support: support@example.com +- Community: https://community.example.com + +Powered by Plugin Name v2.1.0 +``` + +**Attention to detail:** + +```markdown + + +✓ Use proper emoji/symbols consistently +✓ Align output columns neatly +✓ Format numbers with thousands separators +✓ Use color/formatting appropriately +✓ Provide progress indicators +✓ Show estimated time remaining +✓ Confirm successful operations +``` + +### Reliability + +**Idempotency:** + +```markdown +--- +description: Idempotent command +--- + +# Safe Repeated Execution + +Checking if operation already completed... + +if [ -f ".claude/operation-completed.flag" ]; then + ℹ️ Operation already completed + + Completed at: $(cat .claude/operation-completed.flag) + + To re-run: + 1. Remove flag: rm .claude/operation-completed.flag + 2. Run command again + + Otherwise, no action needed. + + Exit. +fi + +Performing operation... + +[Safe, repeatable operation...] + +Marking complete... +echo "$(date)" > .claude/operation-completed.flag +``` + +**Atomic operations:** + +```markdown +--- +description: Atomic command +--- + +# Atomic Operation + +This operation is atomic - either fully succeeds or fully fails. + +Creating temporary workspace... +TEMP_DIR=$(mktemp -d) + +Performing changes in isolated environment... +[Make changes in $TEMP_DIR] + +if [ $? -eq 0 ]; then + ✓ Changes validated + + Applying changes atomically... + mv $TEMP_DIR/* ./target/ + + ✓ Operation complete +else + ❌ Changes failed validation + + Rolling back... + rm -rf $TEMP_DIR + + No changes applied. Safe to retry. +fi +``` + +## Testing for Distribution + +### Pre-Release Checklist + +```markdown + +``` + +### Beta Testing + +**Beta release approach:** + +```markdown +--- +description: Beta command (v0.9.0) +--- + +# 🧪 Beta Command + +**This is a beta release** + +Features may change based on feedback. + +BETA STATUS: +- Version: 0.9.0 +- Stability: Experimental +- Support: Limited +- Feedback: Encouraged + +Known limitations: +- Performance not optimized +- Some edge cases not handled +- Documentation incomplete + +Help improve this command: +- Report issues: /command report-issue +- Suggest features: /command suggest +- Join beta testers: /command join-beta + +--- + +[Command implementation...] + +--- + +**Thank you for beta testing!** + +Your feedback helps make this command better. +``` + +## Maintenance and Updates + +### Update Strategy + +**Versioned commands:** + +```markdown + +``` + +**Update notifications:** + +```markdown +--- +description: Update-aware command +--- + +# Check for Updates + +Current version: 2.1.0 +Latest version: [check if available] + +if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then + 📢 UPDATE AVAILABLE + + New version: $LATEST_VERSION + Current: $CURRENT_VERSION + + What's new: + - Feature improvements + - Bug fixes + - Performance enhancements + + Update with: + /plugin update plugin-name + + Release notes: https://releases.example.com/v$LATEST_VERSION +fi + +[Command continues...] +``` + +## Best Practices Summary + +### Distribution Design + +1. **Universal**: Works across platforms and environments +2. **Self-contained**: Minimal dependencies, clear requirements +3. **Graceful**: Degrades gracefully when features unavailable +4. **Forgiving**: Anticipates and handles user mistakes +5. **Helpful**: Clear errors, good defaults, excellent docs + +### Marketplace Success + +1. **Discoverable**: Clear name, good description, searchable keywords +2. **Professional**: Polished presentation, consistent branding +3. **Reliable**: Tested thoroughly, handles edge cases +4. **Maintainable**: Versioned, updated regularly, supported +5. **User-focused**: Great UX, responsive to feedback + +### Quality Standards + +1. **Complete**: Fully documented, all features working +2. **Tested**: Works in real environments, edge cases handled +3. **Secure**: No vulnerabilities, safe operations +4. **Performant**: Reasonable speed, resource-efficient +5. **Ethical**: Privacy-respecting, user consent + +With these considerations, commands become marketplace-ready and delight users across diverse environments and use cases. diff --git a/skills/external/plugin-dev-command-development/references/plugin-features-reference.md b/skills/external/plugin-dev-command-development/references/plugin-features-reference.md new file mode 100644 index 0000000..c89e906 --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/plugin-features-reference.md @@ -0,0 +1,609 @@ +# Plugin-Specific Command Features Reference + +This reference covers features and patterns specific to commands bundled in Claude Code plugins. + +## Table of Contents + +- [Plugin Command Discovery](#plugin-command-discovery) +- [CLAUDE_PLUGIN_ROOT Environment Variable](#claude_plugin_root-environment-variable) +- [Plugin Command Patterns](#plugin-command-patterns) +- [Integration with Plugin Components](#integration-with-plugin-components) +- [Validation Patterns](#validation-patterns) + +## Plugin Command Discovery + +### Auto-Discovery + +Claude Code automatically discovers commands in plugins using the following locations: + +``` +plugin-name/ +├── commands/ # Auto-discovered commands +│ ├── foo.md # /foo (plugin:plugin-name) +│ └── bar.md # /bar (plugin:plugin-name) +└── plugin.json # Plugin manifest +``` + +**Key points:** +- Commands are discovered at plugin load time +- No manual registration required +- Commands appear in `/help` with "(plugin:plugin-name)" label +- Subdirectories create namespaces + +### Namespaced Plugin Commands + +Organize commands in subdirectories for logical grouping: + +``` +plugin-name/ +└── commands/ + ├── review/ + │ ├── security.md # /security (plugin:plugin-name:review) + │ └── style.md # /style (plugin:plugin-name:review) + └── deploy/ + ├── staging.md # /staging (plugin:plugin-name:deploy) + └── prod.md # /prod (plugin:plugin-name:deploy) +``` + +**Namespace behavior:** +- Subdirectory name becomes namespace +- Shown as "(plugin:plugin-name:namespace)" in `/help` +- Helps organize related commands +- Use when plugin has 5+ commands + +### Command Naming Conventions + +**Plugin command names should:** +1. Be descriptive and action-oriented +2. Avoid conflicts with common command names +3. Use hyphens for multi-word names +4. Consider prefixing with plugin name for uniqueness + +**Examples:** +``` +Good: +- /mylyn-sync (plugin-specific prefix) +- /analyze-performance (descriptive action) +- /docker-compose-up (clear purpose) + +Avoid: +- /test (conflicts with common name) +- /run (too generic) +- /do-stuff (not descriptive) +``` + +## CLAUDE_PLUGIN_ROOT Environment Variable + +### Purpose + +`${CLAUDE_PLUGIN_ROOT}` is a special environment variable available in plugin commands that resolves to the absolute path of the plugin directory. + +**Why it matters:** +- Enables portable paths within plugin +- Allows referencing plugin files and scripts +- Works across different installations +- Essential for multi-file plugin operations + +### Basic Usage + +Reference files within your plugin: + +```markdown +--- +description: Analyze using plugin script +allowed-tools: Bash(node:*), Read +--- + +Run analysis: !`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js` + +Read template: @${CLAUDE_PLUGIN_ROOT}/templates/report.md +``` + +**Expands to:** +``` +Run analysis: !`node /path/to/plugins/plugin-name/scripts/analyze.js` + +Read template: @/path/to/plugins/plugin-name/templates/report.md +``` + +### Common Patterns + +#### 1. Executing Plugin Scripts + +```markdown +--- +description: Run custom linter from plugin +allowed-tools: Bash(node:*) +--- + +Lint results: !`node ${CLAUDE_PLUGIN_ROOT}/bin/lint.js $1` + +Review the linting output and suggest fixes. +``` + +#### 2. Loading Configuration Files + +```markdown +--- +description: Deploy using plugin configuration +allowed-tools: Read, Bash(*) +--- + +Configuration: @${CLAUDE_PLUGIN_ROOT}/config/deploy-config.json + +Deploy application using the configuration above for $1 environment. +``` + +#### 3. Accessing Plugin Resources + +```markdown +--- +description: Generate report from template +--- + +Use this template: @${CLAUDE_PLUGIN_ROOT}/templates/api-report.md + +Generate a report for @$1 following the template format. +``` + +#### 4. Multi-Step Plugin Workflows + +```markdown +--- +description: Complete plugin workflow +allowed-tools: Bash(*), Read +--- + +Step 1 - Prepare: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/prepare.sh $1` +Step 2 - Config: @${CLAUDE_PLUGIN_ROOT}/config/$1.json +Step 3 - Execute: !`${CLAUDE_PLUGIN_ROOT}/bin/execute $1` + +Review results and report status. +``` + +### Best Practices + +1. **Always use for plugin-internal paths:** + ```markdown + # Good + @${CLAUDE_PLUGIN_ROOT}/templates/foo.md + + # Bad + @./templates/foo.md # Relative to current directory, not plugin + ``` + +2. **Validate file existence:** + ```markdown + --- + description: Use plugin config if exists + allowed-tools: Bash(test:*), Read + --- + + !`test -f ${CLAUDE_PLUGIN_ROOT}/config.json && echo "exists" || echo "missing"` + + If config exists, load it: @${CLAUDE_PLUGIN_ROOT}/config.json + Otherwise, use defaults... + ``` + +3. **Document plugin file structure:** + ```markdown + + ``` + +4. **Combine with arguments:** + ```markdown + Run: !`${CLAUDE_PLUGIN_ROOT}/bin/process.sh $1 $2` + ``` + +### Troubleshooting + +**Variable not expanding:** +- Ensure command is loaded from plugin +- Check bash execution is allowed +- Verify syntax is exact: `${CLAUDE_PLUGIN_ROOT}` + +**File not found errors:** +- Verify file exists in plugin directory +- Check file path is correct relative to plugin root +- Ensure file permissions allow reading/execution + +**Path with spaces:** +- Bash commands automatically handle spaces +- File references work with spaces in paths +- No special quoting needed + +## Plugin Command Patterns + +### Pattern 1: Configuration-Based Commands + +Commands that load plugin-specific configuration: + +```markdown +--- +description: Deploy using plugin settings +allowed-tools: Read, Bash(*) +--- + +Load configuration: @${CLAUDE_PLUGIN_ROOT}/deploy-config.json + +Deploy to $1 environment using: +1. Configuration settings above +2. Current git branch: !`git branch --show-current` +3. Application version: !`cat package.json | grep version` + +Execute deployment and monitor progress. +``` + +**When to use:** Commands that need consistent settings across invocations + +### Pattern 2: Template-Based Generation + +Commands that use plugin templates: + +```markdown +--- +description: Generate documentation from template +argument-hint: [component-name] +--- + +Template: @${CLAUDE_PLUGIN_ROOT}/templates/component-docs.md + +Generate documentation for $1 component following the template structure. +Include: +- Component purpose and usage +- API reference +- Examples +- Testing guidelines +``` + +**When to use:** Standardized output generation + +### Pattern 3: Multi-Script Workflow + +Commands that orchestrate multiple plugin scripts: + +```markdown +--- +description: Complete build and test workflow +allowed-tools: Bash(*) +--- + +Build: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh` +Validate: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh` +Test: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/test.sh` + +Review all outputs and report: +1. Build status +2. Validation results +3. Test results +4. Recommended next steps +``` + +**When to use:** Complex plugin workflows with multiple steps + +### Pattern 4: Environment-Aware Commands + +Commands that adapt to environment: + +```markdown +--- +description: Deploy based on environment +argument-hint: [dev|staging|prod] +--- + +Environment config: @${CLAUDE_PLUGIN_ROOT}/config/$1.json + +Environment check: !`echo "Deploying to: $1"` + +Deploy application using $1 environment configuration. +Verify deployment and run smoke tests. +``` + +**When to use:** Commands that behave differently per environment + +### Pattern 5: Plugin Data Management + +Commands that manage plugin-specific data: + +```markdown +--- +description: Save analysis results to plugin cache +allowed-tools: Bash(*), Read, Write +--- + +Cache directory: ${CLAUDE_PLUGIN_ROOT}/cache/ + +Analyze @$1 and save results to cache: +!`mkdir -p ${CLAUDE_PLUGIN_ROOT}/cache && date > ${CLAUDE_PLUGIN_ROOT}/cache/last-run.txt` + +Store analysis for future reference and comparison. +``` + +**When to use:** Commands that need persistent data storage + +## Integration with Plugin Components + +### Invoking Plugin Agents + +Commands can trigger plugin agents using the Task tool: + +```markdown +--- +description: Deep analysis using plugin agent +argument-hint: [file-path] +--- + +Initiate deep code analysis of @$1 using the code-analyzer agent. + +The agent will: +1. Analyze code structure +2. Identify patterns +3. Suggest improvements +4. Generate detailed report + +Note: This uses the Task tool to launch the plugin's code-analyzer agent. +``` + +**Key points:** +- Agent must be defined in plugin's `agents/` directory +- Claude will automatically use Task tool to launch agent +- Agent has access to same plugin resources + +### Invoking Plugin Skills + +Commands can reference plugin skills for specialized knowledge: + +```markdown +--- +description: API documentation with best practices +argument-hint: [api-file] +--- + +Document the API in @$1 following our API documentation standards. + +Use the api-docs-standards skill to ensure documentation includes: +- Endpoint descriptions +- Parameter specifications +- Response formats +- Error codes +- Usage examples + +Note: This leverages the plugin's api-docs-standards skill for consistency. +``` + +**Key points:** +- Skill must be defined in plugin's `skills/` directory +- Mention skill by name to hint Claude should invoke it +- Skills provide specialized domain knowledge + +### Coordinating with Plugin Hooks + +Commands can be designed to work with plugin hooks: + +```markdown +--- +description: Commit with pre-commit validation +allowed-tools: Bash(git:*) +--- + +Stage changes: !\`git add $1\` + +Commit changes: !\`git commit -m "$2"\` + +Note: This commit will trigger the plugin's pre-commit hook for validation. +Review hook output for any issues. +``` + +**Key points:** +- Hooks execute automatically on events +- Commands can prepare state for hooks +- Document hook interaction in command + +### Multi-Component Plugin Commands + +Commands that coordinate multiple plugin components: + +```markdown +--- +description: Comprehensive code review workflow +argument-hint: [file-path] +--- + +File to review: @$1 + +Execute comprehensive review: + +1. **Static Analysis** (via plugin scripts) + !`node ${CLAUDE_PLUGIN_ROOT}/scripts/lint.js $1` + +2. **Deep Review** (via plugin agent) + Launch the code-reviewer agent for detailed analysis. + +3. **Best Practices** (via plugin skill) + Use the code-standards skill to ensure compliance. + +4. **Documentation** (via plugin template) + Template: @${CLAUDE_PLUGIN_ROOT}/templates/review-report.md + +Generate final report combining all outputs. +``` + +**When to use:** Complex workflows leveraging multiple plugin capabilities + +## Validation Patterns + +### Input Validation + +Commands should validate inputs before processing: + +```markdown +--- +description: Deploy to environment with validation +argument-hint: [environment] +--- + +Validate environment: !`echo "$1" | grep -E "^(dev|staging|prod)$" || echo "INVALID"` + +$IF($1 in [dev, staging, prod], + Deploy to $1 environment using validated configuration, + ERROR: Invalid environment '$1'. Must be one of: dev, staging, prod +) +``` + +**Validation approaches:** +1. Bash validation using grep/test +2. Inline validation in prompt +3. Script-based validation + +### File Existence Checks + +Verify required files exist: + +```markdown +--- +description: Process configuration file +argument-hint: [config-file] +--- + +Check file: !`test -f $1 && echo "EXISTS" || echo "MISSING"` + +Process configuration if file exists: @$1 + +If file doesn't exist, explain: +- Expected location +- Required format +- How to create it +``` + +### Required Arguments + +Validate required arguments provided: + +```markdown +--- +description: Create deployment with version +argument-hint: [environment] [version] +--- + +Validate inputs: !`test -n "$1" -a -n "$2" && echo "OK" || echo "MISSING"` + +$IF($1 AND $2, + Deploy version $2 to $1 environment, + ERROR: Both environment and version required. Usage: /deploy [env] [version] +) +``` + +### Plugin Resource Validation + +Verify plugin resources available: + +```markdown +--- +description: Run analysis with plugin tools +allowed-tools: Bash(test:*) +--- + +Validate plugin setup: +- Config exists: !`test -f ${CLAUDE_PLUGIN_ROOT}/config.json && echo "✓" || echo "✗"` +- Scripts exist: !`test -d ${CLAUDE_PLUGIN_ROOT}/scripts && echo "✓" || echo "✗"` +- Tools available: !`test -x ${CLAUDE_PLUGIN_ROOT}/bin/analyze && echo "✓" || echo "✗"` + +If all checks pass, proceed with analysis. +Otherwise, report missing components and installation steps. +``` + +### Output Validation + +Validate command execution results: + +```markdown +--- +description: Build and validate output +allowed-tools: Bash(*) +--- + +Build: !`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh` + +Validate output: +- Exit code: !`echo $?` +- Output exists: !`test -d dist && echo "✓" || echo "✗"` +- File count: !`find dist -type f | wc -l` + +Report build status and any validation failures. +``` + +### Graceful Error Handling + +Handle errors gracefully with helpful messages: + +```markdown +--- +description: Process file with error handling +argument-hint: [file-path] +--- + +Try processing: !`node ${CLAUDE_PLUGIN_ROOT}/scripts/process.js $1 2>&1 || echo "ERROR: $?"` + +If processing succeeded: +- Report results +- Suggest next steps + +If processing failed: +- Explain likely causes +- Provide troubleshooting steps +- Suggest alternative approaches +``` + +## Best Practices Summary + +### Plugin Commands Should: + +1. **Use ${CLAUDE_PLUGIN_ROOT} for all plugin-internal paths** + - Scripts, templates, configuration, resources + +2. **Validate inputs early** + - Check required arguments + - Verify file existence + - Validate argument formats + +3. **Document plugin structure** + - Explain required files + - Document script purposes + - Clarify dependencies + +4. **Integrate with plugin components** + - Reference agents for complex tasks + - Use skills for specialized knowledge + - Coordinate with hooks when relevant + +5. **Provide helpful error messages** + - Explain what went wrong + - Suggest how to fix + - Offer alternatives + +6. **Handle edge cases** + - Missing files + - Invalid arguments + - Failed script execution + - Missing dependencies + +7. **Keep commands focused** + - One clear purpose per command + - Delegate complex logic to scripts + - Use agents for multi-step workflows + +8. **Test across installations** + - Verify paths work everywhere + - Test with different arguments + - Validate error cases + +--- + +For general command development, see main SKILL.md. +For command examples, see examples/ directory. diff --git a/skills/external/plugin-dev-command-development/references/testing-strategies.md b/skills/external/plugin-dev-command-development/references/testing-strategies.md new file mode 100644 index 0000000..7b482fb --- /dev/null +++ b/skills/external/plugin-dev-command-development/references/testing-strategies.md @@ -0,0 +1,702 @@ +# Command Testing Strategies + +Comprehensive strategies for testing slash commands before deployment and distribution. + +## Overview + +Testing commands ensures they work correctly, handle edge cases, and provide good user experience. A systematic testing approach catches issues early and builds confidence in command reliability. + +## Testing Levels + +### Level 1: Syntax and Structure Validation + +**What to test:** +- YAML frontmatter syntax +- Markdown format +- File location and naming + +**How to test:** + +```bash +# Validate YAML frontmatter +head -n 20 .claude/commands/my-command.md | grep -A 10 "^---" + +# Check for closing frontmatter marker +head -n 20 .claude/commands/my-command.md | grep -c "^---" # Should be 2 + +# Verify file has .md extension +ls .claude/commands/*.md + +# Check file is in correct location +test -f .claude/commands/my-command.md && echo "Found" || echo "Missing" +``` + +**Automated validation script:** + +```bash +#!/bin/bash +# validate-command.sh + +COMMAND_FILE="$1" + +if [ ! -f "$COMMAND_FILE" ]; then + echo "ERROR: File not found: $COMMAND_FILE" + exit 1 +fi + +# Check .md extension +if [[ ! "$COMMAND_FILE" =~ \.md$ ]]; then + echo "ERROR: File must have .md extension" + exit 1 +fi + +# Validate YAML frontmatter if present +if head -n 1 "$COMMAND_FILE" | grep -q "^---"; then + # Count frontmatter markers + MARKERS=$(head -n 50 "$COMMAND_FILE" | grep -c "^---") + if [ "$MARKERS" -ne 2 ]; then + echo "ERROR: Invalid YAML frontmatter (need exactly 2 '---' markers)" + exit 1 + fi + echo "✓ YAML frontmatter syntax valid" +fi + +# Check for empty file +if [ ! -s "$COMMAND_FILE" ]; then + echo "ERROR: File is empty" + exit 1 +fi + +echo "✓ Command file structure valid" +``` + +### Level 2: Frontmatter Field Validation + +**What to test:** +- Field types correct +- Values in valid ranges +- Required fields present (if any) + +**Validation script:** + +```bash +#!/bin/bash +# validate-frontmatter.sh + +COMMAND_FILE="$1" + +# Extract YAML frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/p' "$COMMAND_FILE" | sed '1d;$d') + +if [ -z "$FRONTMATTER" ]; then + echo "No frontmatter to validate" + exit 0 +fi + +# Check 'model' field if present +if echo "$FRONTMATTER" | grep -q "^model:"; then + MODEL=$(echo "$FRONTMATTER" | grep "^model:" | cut -d: -f2 | tr -d ' ') + if ! echo "sonnet opus haiku" | grep -qw "$MODEL"; then + echo "ERROR: Invalid model '$MODEL' (must be sonnet, opus, or haiku)" + exit 1 + fi + echo "✓ Model field valid: $MODEL" +fi + +# Check 'allowed-tools' field format +if echo "$FRONTMATTER" | grep -q "^allowed-tools:"; then + echo "✓ allowed-tools field present" + # Could add more sophisticated validation here +fi + +# Check 'description' length +if echo "$FRONTMATTER" | grep -q "^description:"; then + DESC=$(echo "$FRONTMATTER" | grep "^description:" | cut -d: -f2-) + LENGTH=${#DESC} + if [ "$LENGTH" -gt 80 ]; then + echo "WARNING: Description length $LENGTH (recommend < 60 chars)" + else + echo "✓ Description length acceptable: $LENGTH chars" + fi +fi + +echo "✓ Frontmatter fields valid" +``` + +### Level 3: Manual Command Invocation + +**What to test:** +- Command appears in `/help` +- Command executes without errors +- Output is as expected + +**Test procedure:** + +```bash +# 1. Start Claude Code +claude --debug + +# 2. Check command appears in help +> /help +# Look for your command in the list + +# 3. Invoke command without arguments +> /my-command +# Check for reasonable error or behavior + +# 4. Invoke with valid arguments +> /my-command arg1 arg2 +# Verify expected behavior + +# 5. Check debug logs +tail -f ~/.claude/debug-logs/latest +# Look for errors or warnings +``` + +### Level 4: Argument Testing + +**What to test:** +- Positional arguments work ($1, $2, etc.) +- $ARGUMENTS captures all arguments +- Missing arguments handled gracefully +- Invalid arguments detected + +**Test matrix:** + +| Test Case | Command | Expected Result | +|-----------|---------|-----------------| +| No args | `/cmd` | Graceful handling or useful message | +| One arg | `/cmd arg1` | $1 substituted correctly | +| Two args | `/cmd arg1 arg2` | $1 and $2 substituted | +| Extra args | `/cmd a b c d` | All captured or extras ignored appropriately | +| Special chars | `/cmd "arg with spaces"` | Quotes handled correctly | +| Empty arg | `/cmd ""` | Empty string handled | + +**Test script:** + +```bash +#!/bin/bash +# test-command-arguments.sh + +COMMAND="$1" + +echo "Testing argument handling for /$COMMAND" +echo + +echo "Test 1: No arguments" +echo " Command: /$COMMAND" +echo " Expected: [describe expected behavior]" +echo " Manual test required" +echo + +echo "Test 2: Single argument" +echo " Command: /$COMMAND test-value" +echo " Expected: 'test-value' appears in output" +echo " Manual test required" +echo + +echo "Test 3: Multiple arguments" +echo " Command: /$COMMAND arg1 arg2 arg3" +echo " Expected: All arguments used appropriately" +echo " Manual test required" +echo + +echo "Test 4: Special characters" +echo " Command: /$COMMAND \"value with spaces\"" +echo " Expected: Entire phrase captured" +echo " Manual test required" +``` + +### Level 5: File Reference Testing + +**What to test:** +- @ syntax loads file contents +- Non-existent files handled +- Large files handled appropriately +- Multiple file references work + +**Test procedure:** + +```bash +# Create test files +echo "Test content" > /tmp/test-file.txt +echo "Second file" > /tmp/test-file-2.txt + +# Test single file reference +> /my-command /tmp/test-file.txt +# Verify file content is read + +# Test non-existent file +> /my-command /tmp/nonexistent.txt +# Verify graceful error handling + +# Test multiple files +> /my-command /tmp/test-file.txt /tmp/test-file-2.txt +# Verify both files processed + +# Test large file +dd if=/dev/zero of=/tmp/large-file.bin bs=1M count=100 +> /my-command /tmp/large-file.bin +# Verify reasonable behavior (may truncate or warn) + +# Cleanup +rm /tmp/test-file*.txt /tmp/large-file.bin +``` + +### Level 6: Bash Execution Testing + +**What to test:** +- !` commands execute correctly +- Command output included in prompt +- Command failures handled +- Security: only allowed commands run + +**Test procedure:** + +```bash +# Create test command with bash execution +cat > .claude/commands/test-bash.md << 'EOF' +--- +description: Test bash execution +allowed-tools: Bash(echo:*), Bash(date:*) +--- + +Current date: !`date` +Test output: !`echo "Hello from bash"` + +Analysis of output above... +EOF + +# Test in Claude Code +> /test-bash +# Verify: +# 1. Date appears correctly +# 2. Echo output appears +# 3. No errors in debug logs + +# Test with disallowed command (should fail or be blocked) +cat > .claude/commands/test-forbidden.md << 'EOF' +--- +description: Test forbidden command +allowed-tools: Bash(echo:*) +--- + +Trying forbidden: !`ls -la /` +EOF + +> /test-forbidden +# Verify: Permission denied or appropriate error +``` + +### Level 7: Integration Testing + +**What to test:** +- Commands work with other plugin components +- Commands interact correctly with each other +- State management works across invocations +- Workflow commands execute in sequence + +**Test scenarios:** + +**Scenario 1: Command + Hook Integration** + +```bash +# Setup: Command that triggers a hook +# Test: Invoke command, verify hook executes + +# Command: .claude/commands/risky-operation.md +# Hook: PreToolUse that validates the operation + +> /risky-operation +# Verify: Hook executes and validates before command completes +``` + +**Scenario 2: Command Sequence** + +```bash +# Setup: Multi-command workflow +> /workflow-init +# Verify: State file created + +> /workflow-step2 +# Verify: State file read, step 2 executes + +> /workflow-complete +# Verify: State file cleaned up +``` + +**Scenario 3: Command + MCP Integration** + +```bash +# Setup: Command uses MCP tools +# Test: Verify MCP server accessible + +> /mcp-command +# Verify: +# 1. MCP server starts (if stdio) +# 2. Tool calls succeed +# 3. Results included in output +``` + +## Automated Testing Approaches + +### Command Test Suite + +Create a test suite script: + +```bash +#!/bin/bash +# test-commands.sh - Command test suite + +TEST_DIR=".claude/commands" +FAILED_TESTS=0 + +echo "Command Test Suite" +echo "==================" +echo + +for cmd_file in "$TEST_DIR"/*.md; do + cmd_name=$(basename "$cmd_file" .md) + echo "Testing: $cmd_name" + + # Validate structure + if ./validate-command.sh "$cmd_file"; then + echo " ✓ Structure valid" + else + echo " ✗ Structure invalid" + ((FAILED_TESTS++)) + fi + + # Validate frontmatter + if ./validate-frontmatter.sh "$cmd_file"; then + echo " ✓ Frontmatter valid" + else + echo " ✗ Frontmatter invalid" + ((FAILED_TESTS++)) + fi + + echo +done + +echo "==================" +echo "Tests complete" +echo "Failed: $FAILED_TESTS" + +exit $FAILED_TESTS +``` + +### Pre-Commit Hook + +Validate commands before committing: + +```bash +#!/bin/bash +# .git/hooks/pre-commit + +echo "Validating commands..." + +COMMANDS_CHANGED=$(git diff --cached --name-only | grep "\.claude/commands/.*\.md") + +if [ -z "$COMMANDS_CHANGED" ]; then + echo "No commands changed" + exit 0 +fi + +for cmd in $COMMANDS_CHANGED; do + echo "Checking: $cmd" + + if ! ./scripts/validate-command.sh "$cmd"; then + echo "ERROR: Command validation failed: $cmd" + exit 1 + fi +done + +echo "✓ All commands valid" +``` + +### Continuous Testing + +Test commands in CI/CD: + +```yaml +# .github/workflows/test-commands.yml +name: Test Commands + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Validate command structure + run: | + for cmd in .claude/commands/*.md; do + echo "Testing: $cmd" + ./scripts/validate-command.sh "$cmd" + done + + - name: Validate frontmatter + run: | + for cmd in .claude/commands/*.md; do + ./scripts/validate-frontmatter.sh "$cmd" + done + + - name: Check for TODOs + run: | + if grep -r "TODO" .claude/commands/; then + echo "ERROR: TODOs found in commands" + exit 1 + fi +``` + +## Edge Case Testing + +### Test Edge Cases + +**Empty arguments:** +```bash +> /cmd "" +> /cmd '' '' +``` + +**Special characters:** +```bash +> /cmd "arg with spaces" +> /cmd arg-with-dashes +> /cmd arg_with_underscores +> /cmd arg/with/slashes +> /cmd 'arg with "quotes"' +``` + +**Long arguments:** +```bash +> /cmd $(python -c "print('a' * 10000)") +``` + +**Unusual file paths:** +```bash +> /cmd ./file +> /cmd ../file +> /cmd ~/file +> /cmd "/path with spaces/file" +``` + +**Bash command edge cases:** +```markdown +# Commands that might fail +!`exit 1` +!`false` +!`command-that-does-not-exist` + +# Commands with special output +!`echo ""` +!`cat /dev/null` +!`yes | head -n 1000000` +``` + +## Performance Testing + +### Response Time Testing + +```bash +#!/bin/bash +# test-command-performance.sh + +COMMAND="$1" + +echo "Testing performance of /$COMMAND" +echo + +for i in {1..5}; do + echo "Run $i:" + START=$(date +%s%N) + + # Invoke command (manual step - record time) + echo " Invoke: /$COMMAND" + echo " Start time: $START" + echo " (Record end time manually)" + echo +done + +echo "Analyze results:" +echo " - Average response time" +echo " - Variance" +echo " - Acceptable threshold: < 3 seconds for fast commands" +``` + +### Resource Usage Testing + +```bash +# Monitor Claude Code during command execution +# In terminal 1: +claude --debug + +# In terminal 2: +watch -n 1 'ps aux | grep claude' + +# Execute command and observe: +# - Memory usage +# - CPU usage +# - Process count +``` + +## User Experience Testing + +### Usability Checklist + +- [ ] Command name is intuitive +- [ ] Description is clear in `/help` +- [ ] Arguments are well-documented +- [ ] Error messages are helpful +- [ ] Output is formatted readably +- [ ] Long-running commands show progress +- [ ] Results are actionable +- [ ] Edge cases have good UX + +### User Acceptance Testing + +Recruit testers: + +```markdown +# Testing Guide for Beta Testers + +## Command: /my-new-command + +### Test Scenarios + +1. **Basic usage:** + - Run: `/my-new-command` + - Expected: [describe] + - Rate clarity: 1-5 + +2. **With arguments:** + - Run: `/my-new-command arg1 arg2` + - Expected: [describe] + - Rate usefulness: 1-5 + +3. **Error case:** + - Run: `/my-new-command invalid-input` + - Expected: Helpful error message + - Rate error message: 1-5 + +### Feedback Questions + +1. Was the command easy to understand? +2. Did the output meet your expectations? +3. What would you change? +4. Would you use this command regularly? +``` + +## Testing Checklist + +Before releasing a command: + +### Structure +- [ ] File in correct location +- [ ] Correct .md extension +- [ ] Valid YAML frontmatter (if present) +- [ ] Markdown syntax correct + +### Functionality +- [ ] Command appears in `/help` +- [ ] Description is clear +- [ ] Command executes without errors +- [ ] Arguments work as expected +- [ ] File references work +- [ ] Bash execution works (if used) + +### Edge Cases +- [ ] Missing arguments handled +- [ ] Invalid arguments detected +- [ ] Non-existent files handled +- [ ] Special characters work +- [ ] Long inputs handled + +### Integration +- [ ] Works with other commands +- [ ] Works with hooks (if applicable) +- [ ] Works with MCP (if applicable) +- [ ] State management works + +### Quality +- [ ] Performance acceptable +- [ ] No security issues +- [ ] Error messages helpful +- [ ] Output formatted well +- [ ] Documentation complete + +### Distribution +- [ ] Tested by others +- [ ] Feedback incorporated +- [ ] README updated +- [ ] Examples provided + +## Debugging Failed Tests + +### Common Issues and Solutions + +**Issue: Command not appearing in /help** + +```bash +# Check file location +ls -la .claude/commands/my-command.md + +# Check permissions +chmod 644 .claude/commands/my-command.md + +# Check syntax +head -n 20 .claude/commands/my-command.md + +# Restart Claude Code +claude --debug +``` + +**Issue: Arguments not substituting** + +```bash +# Verify syntax +grep '\$1' .claude/commands/my-command.md +grep '\$ARGUMENTS' .claude/commands/my-command.md + +# Test with simple command first +echo "Test: \$1 and \$2" > .claude/commands/test-args.md +``` + +**Issue: Bash commands not executing** + +```bash +# Check allowed-tools +grep "allowed-tools" .claude/commands/my-command.md + +# Verify command syntax +grep '!\`' .claude/commands/my-command.md + +# Test command manually +date +echo "test" +``` + +**Issue: File references not working** + +```bash +# Check @ syntax +grep '@' .claude/commands/my-command.md + +# Verify file exists +ls -la /path/to/referenced/file + +# Check permissions +chmod 644 /path/to/referenced/file +``` + +## Best Practices + +1. **Test early, test often**: Validate as you develop +2. **Automate validation**: Use scripts for repeatable checks +3. **Test edge cases**: Don't just test the happy path +4. **Get feedback**: Have others test before wide release +5. **Document tests**: Keep test scenarios for regression testing +6. **Monitor in production**: Watch for issues after release +7. **Iterate**: Improve based on real usage data diff --git a/skills/external/plugin-dev-hook-development/SKILL.md b/skills/external/plugin-dev-hook-development/SKILL.md new file mode 100644 index 0000000..431bd6f --- /dev/null +++ b/skills/external/plugin-dev-hook-development/SKILL.md @@ -0,0 +1,711 @@ +--- +name: hook-development +description: This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API. +--- + +# Hook Development for Claude Code Plugins + +## Overview + +Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows. + +**Key capabilities:** +- Validate tool calls before execution (PreToolUse) +- React to tool results (PostToolUse) +- Enforce completion standards (Stop, SubagentStop) +- Load project context (SessionStart) +- Automate workflows across the development lifecycle + +## Hook Types + +### Prompt-Based Hooks (Recommended) + +Use LLM-driven decision making for context-aware validation: + +```json +{ + "type": "prompt", + "prompt": "Evaluate if this tool use is appropriate: $TOOL_INPUT", + "timeout": 30 +} +``` + +**Supported events:** Stop, SubagentStop, UserPromptSubmit, PreToolUse + +**Benefits:** +- Context-aware decisions based on natural language reasoning +- Flexible evaluation logic without bash scripting +- Better edge case handling +- Easier to maintain and extend + +### Command Hooks + +Execute bash commands for deterministic checks: + +```json +{ + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh", + "timeout": 60 +} +``` + +**Use for:** +- Fast deterministic validations +- File system operations +- External tool integrations +- Performance-critical checks + +## Hook Configuration Formats + +### Plugin hooks.json Format + +**For plugin hooks** in `hooks/hooks.json`, use wrapper format: + +```json +{ + "description": "Brief explanation of hooks (optional)", + "hooks": { + "PreToolUse": [...], + "Stop": [...], + "SessionStart": [...] + } +} +``` + +**Key points:** +- `description` field is optional +- `hooks` field is required wrapper containing actual hook events +- This is the **plugin-specific format** + +**Example:** +```json +{ + "description": "Validation hooks for code quality", + "hooks": { + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/validate.sh" + } + ] + } + ] + } +} +``` + +### Settings Format (Direct) + +**For user settings** in `.claude/settings.json`, use direct format: + +```json +{ + "PreToolUse": [...], + "Stop": [...], + "SessionStart": [...] +} +``` + +**Key points:** +- No wrapper - events directly at top level +- No description field +- This is the **settings format** + +**Important:** The examples below show the hook event structure that goes inside either format. For plugin hooks.json, wrap these in `{"hooks": {...}}`. + +## Hook Events + +### PreToolUse + +Execute before any tool runs. Use to approve, deny, or modify tool calls. + +**Example (prompt-based):** +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate file write safety. Check: system paths, credentials, path traversal, sensitive content. Return 'approve' or 'deny'." + } + ] + } + ] +} +``` + +**Output for PreToolUse:** +```json +{ + "hookSpecificOutput": { + "permissionDecision": "allow|deny|ask", + "updatedInput": {"field": "modified_value"} + }, + "systemMessage": "Explanation for Claude" +} +``` + +### PostToolUse + +Execute after tool completes. Use to react to results, provide feedback, or log. + +**Example:** +```json +{ + "PostToolUse": [ + { + "matcher": "Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Analyze edit result for potential issues: syntax errors, security vulnerabilities, breaking changes. Provide feedback." + } + ] + } + ] +} +``` + +**Output behavior:** +- Exit 0: stdout shown in transcript +- Exit 2: stderr fed back to Claude +- systemMessage included in context + +### Stop + +Execute when main agent considers stopping. Use to validate completeness. + +**Example:** +```json +{ + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Verify task completion: tests run, build succeeded, questions answered. Return 'approve' to stop or 'block' with reason to continue." + } + ] + } + ] +} +``` + +**Decision output:** +```json +{ + "decision": "approve|block", + "reason": "Explanation", + "systemMessage": "Additional context" +} +``` + +### SubagentStop + +Execute when subagent considers stopping. Use to ensure subagent completed its task. + +Similar to Stop hook, but for subagents. + +### UserPromptSubmit + +Execute when user submits a prompt. Use to add context, validate, or block prompts. + +**Example:** +```json +{ + "UserPromptSubmit": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Check if prompt requires security guidance. If discussing auth, permissions, or API security, return relevant warnings." + } + ] + } + ] +} +``` + +### SessionStart + +Execute when Claude Code session begins. Use to load context and set environment. + +**Example:** +```json +{ + "SessionStart": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh" + } + ] + } + ] +} +``` + +**Special capability:** Persist environment variables using `$CLAUDE_ENV_FILE`: +```bash +echo "export PROJECT_TYPE=nodejs" >> "$CLAUDE_ENV_FILE" +``` + +See `examples/load-context.sh` for complete example. + +### SessionEnd + +Execute when session ends. Use for cleanup, logging, and state preservation. + +### PreCompact + +Execute before context compaction. Use to add critical information to preserve. + +### Notification + +Execute when Claude sends notifications. Use to react to user notifications. + +## Hook Output Format + +### Standard Output (All Hooks) + +```json +{ + "continue": true, + "suppressOutput": false, + "systemMessage": "Message for Claude" +} +``` + +- `continue`: If false, halt processing (default true) +- `suppressOutput`: Hide output from transcript (default false) +- `systemMessage`: Message shown to Claude + +### Exit Codes + +- `0` - Success (stdout shown in transcript) +- `2` - Blocking error (stderr fed back to Claude) +- Other - Non-blocking error + +## Hook Input Format + +All hooks receive JSON via stdin with common fields: + +```json +{ + "session_id": "abc123", + "transcript_path": "/path/to/transcript.txt", + "cwd": "/current/working/dir", + "permission_mode": "ask|allow", + "hook_event_name": "PreToolUse" +} +``` + +**Event-specific fields:** + +- **PreToolUse/PostToolUse:** `tool_name`, `tool_input`, `tool_result` +- **UserPromptSubmit:** `user_prompt` +- **Stop/SubagentStop:** `reason` + +Access fields in prompts using `$TOOL_INPUT`, `$TOOL_RESULT`, `$USER_PROMPT`, etc. + +## Environment Variables + +Available in all command hooks: + +- `$CLAUDE_PROJECT_DIR` - Project root path +- `$CLAUDE_PLUGIN_ROOT` - Plugin directory (use for portable paths) +- `$CLAUDE_ENV_FILE` - SessionStart only: persist env vars here +- `$CLAUDE_CODE_REMOTE` - Set if running in remote context + +**Always use ${CLAUDE_PLUGIN_ROOT} in hook commands for portability:** + +```json +{ + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh" +} +``` + +## Plugin Hook Configuration + +In plugins, define hooks in `hooks/hooks.json`: + +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate file write safety" + } + ] + } + ], + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Verify task completion" + } + ] + } + ], + "SessionStart": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh", + "timeout": 10 + } + ] + } + ] +} +``` + +Plugin hooks merge with user's hooks and run in parallel. + +## Matchers + +### Tool Name Matching + +**Exact match:** +```json +"matcher": "Write" +``` + +**Multiple tools:** +```json +"matcher": "Read|Write|Edit" +``` + +**Wildcard (all tools):** +```json +"matcher": "*" +``` + +**Regex patterns:** +```json +"matcher": "mcp__.*__delete.*" // All MCP delete tools +``` + +**Note:** Matchers are case-sensitive. + +### Common Patterns + +```json +// All MCP tools +"matcher": "mcp__.*" + +// Specific plugin's MCP tools +"matcher": "mcp__plugin_asana_.*" + +// All file operations +"matcher": "Read|Write|Edit" + +// Bash commands only +"matcher": "Bash" +``` + +## Security Best Practices + +### Input Validation + +Always validate inputs in command hooks: + +```bash +#!/bin/bash +set -euo pipefail + +input=$(cat) +tool_name=$(echo "$input" | jq -r '.tool_name') + +# Validate tool name format +if [[ ! "$tool_name" =~ ^[a-zA-Z0-9_]+$ ]]; then + echo '{"decision": "deny", "reason": "Invalid tool name"}' >&2 + exit 2 +fi +``` + +### Path Safety + +Check for path traversal and sensitive files: + +```bash +file_path=$(echo "$input" | jq -r '.tool_input.file_path') + +# Deny path traversal +if [[ "$file_path" == *".."* ]]; then + echo '{"decision": "deny", "reason": "Path traversal detected"}' >&2 + exit 2 +fi + +# Deny sensitive files +if [[ "$file_path" == *".env"* ]]; then + echo '{"decision": "deny", "reason": "Sensitive file"}' >&2 + exit 2 +fi +``` + +See `examples/validate-write.sh` and `examples/validate-bash.sh` for complete examples. + +### Quote All Variables + +```bash +# GOOD: Quoted +echo "$file_path" +cd "$CLAUDE_PROJECT_DIR" + +# BAD: Unquoted (injection risk) +echo $file_path +cd $CLAUDE_PROJECT_DIR +``` + +### Set Appropriate Timeouts + +```json +{ + "type": "command", + "command": "bash script.sh", + "timeout": 10 +} +``` + +**Defaults:** Command hooks (60s), Prompt hooks (30s) + +## Performance Considerations + +### Parallel Execution + +All matching hooks run **in parallel**: + +```json +{ + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + {"type": "command", "command": "check1.sh"}, // Parallel + {"type": "command", "command": "check2.sh"}, // Parallel + {"type": "prompt", "prompt": "Validate..."} // Parallel + ] + } + ] +} +``` + +**Design implications:** +- Hooks don't see each other's output +- Non-deterministic ordering +- Design for independence + +### Optimization + +1. Use command hooks for quick deterministic checks +2. Use prompt hooks for complex reasoning +3. Cache validation results in temp files +4. Minimize I/O in hot paths + +## Temporarily Active Hooks + +Create hooks that activate conditionally by checking for a flag file or configuration: + +**Pattern: Flag file activation** +```bash +#!/bin/bash +# Only active when flag file exists +FLAG_FILE="$CLAUDE_PROJECT_DIR/.enable-strict-validation" + +if [ ! -f "$FLAG_FILE" ]; then + # Flag not present, skip validation + exit 0 +fi + +# Flag present, run validation +input=$(cat) +# ... validation logic ... +``` + +**Pattern: Configuration-based activation** +```bash +#!/bin/bash +# Check configuration for activation +CONFIG_FILE="$CLAUDE_PROJECT_DIR/.claude/plugin-config.json" + +if [ -f "$CONFIG_FILE" ]; then + enabled=$(jq -r '.strictMode // false' "$CONFIG_FILE") + if [ "$enabled" != "true" ]; then + exit 0 # Not enabled, skip + fi +fi + +# Enabled, run hook logic +input=$(cat) +# ... hook logic ... +``` + +**Use cases:** +- Enable strict validation only when needed +- Temporary debugging hooks +- Project-specific hook behavior +- Feature flags for hooks + +**Best practice:** Document activation mechanism in plugin README so users know how to enable/disable temporary hooks. + +## Hook Lifecycle and Limitations + +### Hooks Load at Session Start + +**Important:** Hooks are loaded when Claude Code session starts. Changes to hook configuration require restarting Claude Code. + +**Cannot hot-swap hooks:** +- Editing `hooks/hooks.json` won't affect current session +- Adding new hook scripts won't be recognized +- Changing hook commands/prompts won't update +- Must restart Claude Code: exit and run `claude` again + +**To test hook changes:** +1. Edit hook configuration or scripts +2. Exit Claude Code session +3. Restart: `claude` or `cc` +4. New hook configuration loads +5. Test hooks with `claude --debug` + +### Hook Validation at Startup + +Hooks are validated when Claude Code starts: +- Invalid JSON in hooks.json causes loading failure +- Missing scripts cause warnings +- Syntax errors reported in debug mode + +Use `/hooks` command to review loaded hooks in current session. + +## Debugging Hooks + +### Enable Debug Mode + +```bash +claude --debug +``` + +Look for hook registration, execution logs, input/output JSON, and timing information. + +### Test Hook Scripts + +Test command hooks directly: + +```bash +echo '{"tool_name": "Write", "tool_input": {"file_path": "/test"}}' | \ + bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh + +echo "Exit code: $?" +``` + +### Validate JSON Output + +Ensure hooks output valid JSON: + +```bash +output=$(./your-hook.sh < test-input.json) +echo "$output" | jq . +``` + +## Quick Reference + +### Hook Events Summary + +| Event | When | Use For | +|-------|------|---------| +| PreToolUse | Before tool | Validation, modification | +| PostToolUse | After tool | Feedback, logging | +| UserPromptSubmit | User input | Context, validation | +| Stop | Agent stopping | Completeness check | +| SubagentStop | Subagent done | Task validation | +| SessionStart | Session begins | Context loading | +| SessionEnd | Session ends | Cleanup, logging | +| PreCompact | Before compact | Preserve context | +| Notification | User notified | Logging, reactions | + +### Best Practices + +**DO:** +- ✅ Use prompt-based hooks for complex logic +- ✅ Use ${CLAUDE_PLUGIN_ROOT} for portability +- ✅ Validate all inputs in command hooks +- ✅ Quote all bash variables +- ✅ Set appropriate timeouts +- ✅ Return structured JSON output +- ✅ Test hooks thoroughly + +**DON'T:** +- ❌ Use hardcoded paths +- ❌ Trust user input without validation +- ❌ Create long-running hooks +- ❌ Rely on hook execution order +- ❌ Modify global state unpredictably +- ❌ Log sensitive information + +## Additional Resources + +### Reference Files + +For detailed patterns and advanced techniques, consult: + +- **`references/patterns.md`** - Common hook patterns (8+ proven patterns) +- **`references/migration.md`** - Migrating from basic to advanced hooks +- **`references/advanced.md`** - Advanced use cases and techniques + +### Example Hook Scripts + +Working examples in `examples/`: + +- **`validate-write.sh`** - File write validation example +- **`validate-bash.sh`** - Bash command validation example +- **`load-context.sh`** - SessionStart context loading example + +### Utility Scripts + +Development tools in `scripts/`: + +- **`validate-hook-schema.sh`** - Validate hooks.json structure and syntax +- **`test-hook.sh`** - Test hooks with sample input before deployment +- **`hook-linter.sh`** - Check hook scripts for common issues and best practices + +### External Resources + +- **Official Docs**: https://docs.claude.com/en/docs/claude-code/hooks +- **Examples**: See security-guidance plugin in marketplace +- **Testing**: Use `claude --debug` for detailed logs +- **Validation**: Use `jq` to validate hook JSON output + +## Implementation Workflow + +To implement hooks in a plugin: + +1. Identify events to hook into (PreToolUse, Stop, SessionStart, etc.) +2. Decide between prompt-based (flexible) or command (deterministic) hooks +3. Write hook configuration in `hooks/hooks.json` +4. For command hooks, create hook scripts +5. Use ${CLAUDE_PLUGIN_ROOT} for all file references +6. Validate configuration with `scripts/validate-hook-schema.sh hooks/hooks.json` +7. Test hooks with `scripts/test-hook.sh` before deployment +8. Test in Claude Code with `claude --debug` +9. Document hooks in plugin README + +Focus on prompt-based hooks for most use cases. Reserve command hooks for performance-critical or deterministic checks. diff --git a/skills/external/plugin-dev-hook-development/examples/load-context.sh b/skills/external/plugin-dev-hook-development/examples/load-context.sh new file mode 100755 index 0000000..9754f32 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/examples/load-context.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Example SessionStart hook for loading project context +# This script detects project type and sets environment variables + +set -euo pipefail + +# Navigate to project directory +cd "$CLAUDE_PROJECT_DIR" || exit 1 + +echo "Loading project context..." + +# Detect project type and set environment +if [ -f "package.json" ]; then + echo "📦 Node.js project detected" + echo "export PROJECT_TYPE=nodejs" >> "$CLAUDE_ENV_FILE" + + # Check if TypeScript + if [ -f "tsconfig.json" ]; then + echo "export USES_TYPESCRIPT=true" >> "$CLAUDE_ENV_FILE" + fi + +elif [ -f "Cargo.toml" ]; then + echo "🦀 Rust project detected" + echo "export PROJECT_TYPE=rust" >> "$CLAUDE_ENV_FILE" + +elif [ -f "go.mod" ]; then + echo "🐹 Go project detected" + echo "export PROJECT_TYPE=go" >> "$CLAUDE_ENV_FILE" + +elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then + echo "🐍 Python project detected" + echo "export PROJECT_TYPE=python" >> "$CLAUDE_ENV_FILE" + +elif [ -f "pom.xml" ]; then + echo "☕ Java (Maven) project detected" + echo "export PROJECT_TYPE=java" >> "$CLAUDE_ENV_FILE" + echo "export BUILD_SYSTEM=maven" >> "$CLAUDE_ENV_FILE" + +elif [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then + echo "☕ Java/Kotlin (Gradle) project detected" + echo "export PROJECT_TYPE=java" >> "$CLAUDE_ENV_FILE" + echo "export BUILD_SYSTEM=gradle" >> "$CLAUDE_ENV_FILE" + +else + echo "❓ Unknown project type" + echo "export PROJECT_TYPE=unknown" >> "$CLAUDE_ENV_FILE" +fi + +# Check for CI configuration +if [ -f ".github/workflows" ] || [ -f ".gitlab-ci.yml" ] || [ -f ".circleci/config.yml" ]; then + echo "export HAS_CI=true" >> "$CLAUDE_ENV_FILE" +fi + +echo "Project context loaded successfully" +exit 0 diff --git a/skills/external/plugin-dev-hook-development/examples/validate-bash.sh b/skills/external/plugin-dev-hook-development/examples/validate-bash.sh new file mode 100755 index 0000000..e364324 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/examples/validate-bash.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Example PreToolUse hook for validating Bash commands +# This script demonstrates bash command validation patterns + +set -euo pipefail + +# Read input from stdin +input=$(cat) + +# Extract command +command=$(echo "$input" | jq -r '.tool_input.command // empty') + +# Validate command exists +if [ -z "$command" ]; then + echo '{"continue": true}' # No command to validate + exit 0 +fi + +# Check for obviously safe commands (quick approval) +if [[ "$command" =~ ^(ls|pwd|echo|date|whoami)(\s|$) ]]; then + exit 0 +fi + +# Check for destructive operations +if [[ "$command" == *"rm -rf"* ]] || [[ "$command" == *"rm -fr"* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Dangerous command detected: rm -rf"}' >&2 + exit 2 +fi + +# Check for other dangerous commands +if [[ "$command" == *"dd if="* ]] || [[ "$command" == *"mkfs"* ]] || [[ "$command" == *"> /dev/"* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Dangerous system operation detected"}' >&2 + exit 2 +fi + +# Check for privilege escalation +if [[ "$command" == sudo* ]] || [[ "$command" == su* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "ask"}, "systemMessage": "Command requires elevated privileges"}' >&2 + exit 2 +fi + +# Approve the operation +exit 0 diff --git a/skills/external/plugin-dev-hook-development/examples/validate-write.sh b/skills/external/plugin-dev-hook-development/examples/validate-write.sh new file mode 100755 index 0000000..e665193 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/examples/validate-write.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Example PreToolUse hook for validating Write/Edit operations +# This script demonstrates file write validation patterns + +set -euo pipefail + +# Read input from stdin +input=$(cat) + +# Extract file path and content +file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty') + +# Validate path exists +if [ -z "$file_path" ]; then + echo '{"continue": true}' # No path to validate + exit 0 +fi + +# Check for path traversal +if [[ "$file_path" == *".."* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Path traversal detected in: '"$file_path"'"}' >&2 + exit 2 +fi + +# Check for system directories +if [[ "$file_path" == /etc/* ]] || [[ "$file_path" == /sys/* ]] || [[ "$file_path" == /usr/* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Cannot write to system directory: '"$file_path"'"}' >&2 + exit 2 +fi + +# Check for sensitive files +if [[ "$file_path" == *.env ]] || [[ "$file_path" == *secret* ]] || [[ "$file_path" == *credentials* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "ask"}, "systemMessage": "Writing to potentially sensitive file: '"$file_path"'"}' >&2 + exit 2 +fi + +# Approve the operation +exit 0 diff --git a/skills/external/plugin-dev-hook-development/references/advanced.md b/skills/external/plugin-dev-hook-development/references/advanced.md new file mode 100644 index 0000000..a84a38f --- /dev/null +++ b/skills/external/plugin-dev-hook-development/references/advanced.md @@ -0,0 +1,479 @@ +# Advanced Hook Use Cases + +This reference covers advanced hook patterns and techniques for sophisticated automation workflows. + +## Multi-Stage Validation + +Combine command and prompt hooks for layered validation: + +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/quick-check.sh", + "timeout": 5 + }, + { + "type": "prompt", + "prompt": "Deep analysis of bash command: $TOOL_INPUT", + "timeout": 15 + } + ] + } + ] +} +``` + +**Use case:** Fast deterministic checks followed by intelligent analysis + +**Example quick-check.sh:** +```bash +#!/bin/bash +input=$(cat) +command=$(echo "$input" | jq -r '.tool_input.command') + +# Immediate approval for safe commands +if [[ "$command" =~ ^(ls|pwd|echo|date|whoami)$ ]]; then + exit 0 +fi + +# Let prompt hook handle complex cases +exit 0 +``` + +The command hook quickly approves obviously safe commands, while the prompt hook analyzes everything else. + +## Conditional Hook Execution + +Execute hooks based on environment or context: + +```bash +#!/bin/bash +# Only run in CI environment +if [ -z "$CI" ]; then + echo '{"continue": true}' # Skip in non-CI + exit 0 +fi + +# Run validation logic in CI +input=$(cat) +# ... validation code ... +``` + +**Use cases:** +- Different behavior in CI vs local development +- Project-specific validation +- User-specific rules + +**Example: Skip certain checks for trusted users:** +```bash +#!/bin/bash +# Skip detailed checks for admin users +if [ "$USER" = "admin" ]; then + exit 0 +fi + +# Full validation for other users +input=$(cat) +# ... validation code ... +``` + +## Hook Chaining via State + +Share state between hooks using temporary files: + +```bash +# Hook 1: Analyze and save state +#!/bin/bash +input=$(cat) +command=$(echo "$input" | jq -r '.tool_input.command') + +# Analyze command +risk_level=$(calculate_risk "$command") +echo "$risk_level" > /tmp/hook-state-$$ + +exit 0 +``` + +```bash +# Hook 2: Use saved state +#!/bin/bash +risk_level=$(cat /tmp/hook-state-$$ 2>/dev/null || echo "unknown") + +if [ "$risk_level" = "high" ]; then + echo "High risk operation detected" >&2 + exit 2 +fi +``` + +**Important:** This only works for sequential hook events (e.g., PreToolUse then PostToolUse), not parallel hooks. + +## Dynamic Hook Configuration + +Modify hook behavior based on project configuration: + +```bash +#!/bin/bash +cd "$CLAUDE_PROJECT_DIR" || exit 1 + +# Read project-specific config +if [ -f ".claude-hooks-config.json" ]; then + strict_mode=$(jq -r '.strict_mode' .claude-hooks-config.json) + + if [ "$strict_mode" = "true" ]; then + # Apply strict validation + # ... + else + # Apply lenient validation + # ... + fi +fi +``` + +**Example .claude-hooks-config.json:** +```json +{ + "strict_mode": true, + "allowed_commands": ["ls", "pwd", "grep"], + "forbidden_paths": ["/etc", "/sys"] +} +``` + +## Context-Aware Prompt Hooks + +Use transcript and session context for intelligent decisions: + +```json +{ + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Review the full transcript at $TRANSCRIPT_PATH. Check: 1) Were tests run after code changes? 2) Did the build succeed? 3) Were all user questions answered? 4) Is there any unfinished work? Return 'approve' only if everything is complete." + } + ] + } + ] +} +``` + +The LLM can read the transcript file and make context-aware decisions. + +## Performance Optimization + +### Caching Validation Results + +```bash +#!/bin/bash +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path') +cache_key=$(echo -n "$file_path" | md5sum | cut -d' ' -f1) +cache_file="/tmp/hook-cache-$cache_key" + +# Check cache +if [ -f "$cache_file" ]; then + cache_age=$(($(date +%s) - $(stat -f%m "$cache_file" 2>/dev/null || stat -c%Y "$cache_file"))) + if [ "$cache_age" -lt 300 ]; then # 5 minute cache + cat "$cache_file" + exit 0 + fi +fi + +# Perform validation +result='{"decision": "approve"}' + +# Cache result +echo "$result" > "$cache_file" +echo "$result" +``` + +### Parallel Execution Optimization + +Since hooks run in parallel, design them to be independent: + +```json +{ + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "bash check-size.sh", // Independent + "timeout": 2 + }, + { + "type": "command", + "command": "bash check-path.sh", // Independent + "timeout": 2 + }, + { + "type": "prompt", + "prompt": "Check content safety", // Independent + "timeout": 10 + } + ] + } + ] +} +``` + +All three hooks run simultaneously, reducing total latency. + +## Cross-Event Workflows + +Coordinate hooks across different events: + +**SessionStart - Set up tracking:** +```bash +#!/bin/bash +# Initialize session tracking +echo "0" > /tmp/test-count-$$ +echo "0" > /tmp/build-count-$$ +``` + +**PostToolUse - Track events:** +```bash +#!/bin/bash +input=$(cat) +tool_name=$(echo "$input" | jq -r '.tool_name') + +if [ "$tool_name" = "Bash" ]; then + command=$(echo "$input" | jq -r '.tool_result') + if [[ "$command" == *"test"* ]]; then + count=$(cat /tmp/test-count-$$ 2>/dev/null || echo "0") + echo $((count + 1)) > /tmp/test-count-$$ + fi +fi +``` + +**Stop - Verify based on tracking:** +```bash +#!/bin/bash +test_count=$(cat /tmp/test-count-$$ 2>/dev/null || echo "0") + +if [ "$test_count" -eq 0 ]; then + echo '{"decision": "block", "reason": "No tests were run"}' >&2 + exit 2 +fi +``` + +## Integration with External Systems + +### Slack Notifications + +```bash +#!/bin/bash +input=$(cat) +tool_name=$(echo "$input" | jq -r '.tool_name') +decision="blocked" + +# Send notification to Slack +curl -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\": \"Hook ${decision} ${tool_name} operation\"}" \ + 2>/dev/null + +echo '{"decision": "deny"}' >&2 +exit 2 +``` + +### Database Logging + +```bash +#!/bin/bash +input=$(cat) + +# Log to database +psql "$DATABASE_URL" -c "INSERT INTO hook_logs (event, data) VALUES ('PreToolUse', '$input')" \ + 2>/dev/null + +exit 0 +``` + +### Metrics Collection + +```bash +#!/bin/bash +input=$(cat) +tool_name=$(echo "$input" | jq -r '.tool_name') + +# Send metrics to monitoring system +echo "hook.pretooluse.${tool_name}:1|c" | nc -u -w1 statsd.local 8125 + +exit 0 +``` + +## Security Patterns + +### Rate Limiting + +```bash +#!/bin/bash +input=$(cat) +command=$(echo "$input" | jq -r '.tool_input.command') + +# Track command frequency +rate_file="/tmp/hook-rate-$$" +current_minute=$(date +%Y%m%d%H%M) + +if [ -f "$rate_file" ]; then + last_minute=$(head -1 "$rate_file") + count=$(tail -1 "$rate_file") + + if [ "$current_minute" = "$last_minute" ]; then + if [ "$count" -gt 10 ]; then + echo '{"decision": "deny", "reason": "Rate limit exceeded"}' >&2 + exit 2 + fi + count=$((count + 1)) + else + count=1 + fi +else + count=1 +fi + +echo "$current_minute" > "$rate_file" +echo "$count" >> "$rate_file" + +exit 0 +``` + +### Audit Logging + +```bash +#!/bin/bash +input=$(cat) +tool_name=$(echo "$input" | jq -r '.tool_name') +timestamp=$(date -Iseconds) + +# Append to audit log +echo "$timestamp | $USER | $tool_name | $input" >> ~/.claude/audit.log + +exit 0 +``` + +### Secret Detection + +```bash +#!/bin/bash +input=$(cat) +content=$(echo "$input" | jq -r '.tool_input.content') + +# Check for common secret patterns +if echo "$content" | grep -qE "(api[_-]?key|password|secret|token).{0,20}['\"]?[A-Za-z0-9]{20,}"; then + echo '{"decision": "deny", "reason": "Potential secret detected in content"}' >&2 + exit 2 +fi + +exit 0 +``` + +## Testing Advanced Hooks + +### Unit Testing Hook Scripts + +```bash +# test-hook.sh +#!/bin/bash + +# Test 1: Approve safe command +result=$(echo '{"tool_input": {"command": "ls"}}' | bash validate-bash.sh) +if [ $? -eq 0 ]; then + echo "✓ Test 1 passed" +else + echo "✗ Test 1 failed" +fi + +# Test 2: Block dangerous command +result=$(echo '{"tool_input": {"command": "rm -rf /"}}' | bash validate-bash.sh) +if [ $? -eq 2 ]; then + echo "✓ Test 2 passed" +else + echo "✗ Test 2 failed" +fi +``` + +### Integration Testing + +Create test scenarios that exercise the full hook workflow: + +```bash +# integration-test.sh +#!/bin/bash + +# Set up test environment +export CLAUDE_PROJECT_DIR="/tmp/test-project" +export CLAUDE_PLUGIN_ROOT="$(pwd)" +mkdir -p "$CLAUDE_PROJECT_DIR" + +# Test SessionStart hook +echo '{}' | bash hooks/session-start.sh +if [ -f "/tmp/session-initialized" ]; then + echo "✓ SessionStart hook works" +else + echo "✗ SessionStart hook failed" +fi + +# Clean up +rm -rf "$CLAUDE_PROJECT_DIR" +``` + +## Best Practices for Advanced Hooks + +1. **Keep hooks independent**: Don't rely on execution order +2. **Use timeouts**: Set appropriate limits for each hook type +3. **Handle errors gracefully**: Provide clear error messages +4. **Document complexity**: Explain advanced patterns in README +5. **Test thoroughly**: Cover edge cases and failure modes +6. **Monitor performance**: Track hook execution time +7. **Version configuration**: Use version control for hook configs +8. **Provide escape hatches**: Allow users to bypass hooks when needed + +## Common Pitfalls + +### ❌ Assuming Hook Order + +```bash +# BAD: Assumes hooks run in specific order +# Hook 1 saves state, Hook 2 reads it +# This can fail because hooks run in parallel! +``` + +### ❌ Long-Running Hooks + +```bash +# BAD: Hook takes 2 minutes to run +sleep 120 +# This will timeout and block the workflow +``` + +### ❌ Uncaught Exceptions + +```bash +# BAD: Script crashes on unexpected input +file_path=$(echo "$input" | jq -r '.tool_input.file_path') +cat "$file_path" # Fails if file doesn't exist +``` + +### ✅ Proper Error Handling + +```bash +# GOOD: Handles errors gracefully +file_path=$(echo "$input" | jq -r '.tool_input.file_path') +if [ ! -f "$file_path" ]; then + echo '{"continue": true, "systemMessage": "File not found, skipping check"}' >&2 + exit 0 +fi +``` + +## Conclusion + +Advanced hook patterns enable sophisticated automation while maintaining reliability and performance. Use these techniques when basic hooks are insufficient, but always prioritize simplicity and maintainability. diff --git a/skills/external/plugin-dev-hook-development/references/migration.md b/skills/external/plugin-dev-hook-development/references/migration.md new file mode 100644 index 0000000..587cae3 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/references/migration.md @@ -0,0 +1,369 @@ +# Migrating from Basic to Advanced Hooks + +This guide shows how to migrate from basic command hooks to advanced prompt-based hooks for better maintainability and flexibility. + +## Why Migrate? + +Prompt-based hooks offer several advantages: + +- **Natural language reasoning**: LLM understands context and intent +- **Better edge case handling**: Adapts to unexpected scenarios +- **No bash scripting required**: Simpler to write and maintain +- **More flexible validation**: Can handle complex logic without coding + +## Migration Example: Bash Command Validation + +### Before (Basic Command Hook) + +**Configuration:** +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash validate-bash.sh" + } + ] + } + ] +} +``` + +**Script (validate-bash.sh):** +```bash +#!/bin/bash +input=$(cat) +command=$(echo "$input" | jq -r '.tool_input.command') + +# Hard-coded validation logic +if [[ "$command" == *"rm -rf"* ]]; then + echo "Dangerous command detected" >&2 + exit 2 +fi +``` + +**Problems:** +- Only checks for exact "rm -rf" pattern +- Doesn't catch variations like `rm -fr` or `rm -r -f` +- Misses other dangerous commands (`dd`, `mkfs`, etc.) +- No context awareness +- Requires bash scripting knowledge + +### After (Advanced Prompt Hook) + +**Configuration:** +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Command: $TOOL_INPUT.command. Analyze for: 1) Destructive operations (rm -rf, dd, mkfs, etc) 2) Privilege escalation (sudo) 3) Network operations without user consent. Return 'approve' or 'deny' with explanation.", + "timeout": 15 + } + ] + } + ] +} +``` + +**Benefits:** +- Catches all variations and patterns +- Understands intent, not just literal strings +- No script file needed +- Easy to extend with new criteria +- Context-aware decisions +- Natural language explanation in denial + +## Migration Example: File Write Validation + +### Before (Basic Command Hook) + +**Configuration:** +```json +{ + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "bash validate-write.sh" + } + ] + } + ] +} +``` + +**Script (validate-write.sh):** +```bash +#!/bin/bash +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path') + +# Check for path traversal +if [[ "$file_path" == *".."* ]]; then + echo '{"decision": "deny", "reason": "Path traversal detected"}' >&2 + exit 2 +fi + +# Check for system paths +if [[ "$file_path" == "/etc/"* ]] || [[ "$file_path" == "/sys/"* ]]; then + echo '{"decision": "deny", "reason": "System file"}' >&2 + exit 2 +fi +``` + +**Problems:** +- Hard-coded path patterns +- Doesn't understand symlinks +- Missing edge cases (e.g., `/etc` vs `/etc/`) +- No consideration of file content + +### After (Advanced Prompt Hook) + +**Configuration:** +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "File path: $TOOL_INPUT.file_path. Content preview: $TOOL_INPUT.content (first 200 chars). Verify: 1) Not system directories (/etc, /sys, /usr) 2) Not credentials (.env, tokens, secrets) 3) No path traversal 4) Content doesn't expose secrets. Return 'approve' or 'deny'." + } + ] + } + ] +} +``` + +**Benefits:** +- Context-aware (considers content too) +- Handles symlinks and edge cases +- Natural understanding of "system directories" +- Can detect secrets in content +- Easy to extend criteria + +## When to Keep Command Hooks + +Command hooks still have their place: + +### 1. Deterministic Performance Checks + +```bash +#!/bin/bash +# Check file size quickly +file_path=$(echo "$input" | jq -r '.tool_input.file_path') +size=$(stat -f%z "$file_path" 2>/dev/null || stat -c%s "$file_path" 2>/dev/null) + +if [ "$size" -gt 10000000 ]; then + echo '{"decision": "deny", "reason": "File too large"}' >&2 + exit 2 +fi +``` + +**Use command hooks when:** Validation is purely mathematical or deterministic. + +### 2. External Tool Integration + +```bash +#!/bin/bash +# Run security scanner +file_path=$(echo "$input" | jq -r '.tool_input.file_path') +scan_result=$(security-scanner "$file_path") + +if [ "$?" -ne 0 ]; then + echo "Security scan failed: $scan_result" >&2 + exit 2 +fi +``` + +**Use command hooks when:** Integrating with external tools that provide yes/no answers. + +### 3. Very Fast Checks (< 50ms) + +```bash +#!/bin/bash +# Quick regex check +command=$(echo "$input" | jq -r '.tool_input.command') + +if [[ "$command" =~ ^(ls|pwd|echo)$ ]]; then + exit 0 # Safe commands +fi +``` + +**Use command hooks when:** Performance is critical and logic is simple. + +## Hybrid Approach + +Combine both for multi-stage validation: + +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/quick-check.sh", + "timeout": 5 + }, + { + "type": "prompt", + "prompt": "Deep analysis of bash command: $TOOL_INPUT", + "timeout": 15 + } + ] + } + ] +} +``` + +The command hook does fast deterministic checks, while the prompt hook handles complex reasoning. + +## Migration Checklist + +When migrating hooks: + +- [ ] Identify the validation logic in the command hook +- [ ] Convert hard-coded patterns to natural language criteria +- [ ] Test with edge cases the old hook missed +- [ ] Verify LLM understands the intent +- [ ] Set appropriate timeout (usually 15-30s for prompt hooks) +- [ ] Document the new hook in README +- [ ] Remove or archive old script files + +## Migration Tips + +1. **Start with one hook**: Don't migrate everything at once +2. **Test thoroughly**: Verify prompt hook catches what command hook caught +3. **Look for improvements**: Use migration as opportunity to enhance validation +4. **Keep scripts for reference**: Archive old scripts in case you need to reference the logic +5. **Document reasoning**: Explain why prompt hook is better in README + +## Complete Migration Example + +### Original Plugin Structure + +``` +my-plugin/ +├── .claude-plugin/plugin.json +├── hooks/hooks.json +└── scripts/ + ├── validate-bash.sh + ├── validate-write.sh + └── check-tests.sh +``` + +### After Migration + +``` +my-plugin/ +├── .claude-plugin/plugin.json +├── hooks/hooks.json # Now uses prompt hooks +└── scripts/ # Archive or delete + └── archive/ + ├── validate-bash.sh + ├── validate-write.sh + └── check-tests.sh +``` + +### Updated hooks.json + +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate bash command safety: destructive ops, privilege escalation, network access" + } + ] + }, + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate file write safety: system paths, credentials, path traversal, content secrets" + } + ] + } + ], + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Verify tests were run if code was modified" + } + ] + } + ] +} +``` + +**Result:** Simpler, more maintainable, more powerful. + +## Common Migration Patterns + +### Pattern: String Contains → Natural Language + +**Before:** +```bash +if [[ "$command" == *"sudo"* ]]; then + echo "Privilege escalation" >&2 + exit 2 +fi +``` + +**After:** +``` +"Check for privilege escalation (sudo, su, etc)" +``` + +### Pattern: Regex → Intent + +**Before:** +```bash +if [[ "$file" =~ \.(env|secret|key|token)$ ]]; then + echo "Credential file" >&2 + exit 2 +fi +``` + +**After:** +``` +"Verify not writing to credential files (.env, secrets, keys, tokens)" +``` + +### Pattern: Multiple Conditions → Criteria List + +**Before:** +```bash +if [ condition1 ] || [ condition2 ] || [ condition3 ]; then + echo "Invalid" >&2 + exit 2 +fi +``` + +**After:** +``` +"Check: 1) condition1 2) condition2 3) condition3. Deny if any fail." +``` + +## Conclusion + +Migrating to prompt-based hooks makes plugins more maintainable, flexible, and powerful. Reserve command hooks for deterministic checks and external tool integration. diff --git a/skills/external/plugin-dev-hook-development/references/patterns.md b/skills/external/plugin-dev-hook-development/references/patterns.md new file mode 100644 index 0000000..4475386 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/references/patterns.md @@ -0,0 +1,346 @@ +# Common Hook Patterns + +This reference provides common, proven patterns for implementing Claude Code hooks. Use these patterns as starting points for typical hook use cases. + +## Pattern 1: Security Validation + +Block dangerous file writes using prompt-based hooks: + +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "File path: $TOOL_INPUT.file_path. Verify: 1) Not in /etc or system directories 2) Not .env or credentials 3) Path doesn't contain '..' traversal. Return 'approve' or 'deny'." + } + ] + } + ] +} +``` + +**Use for:** Preventing writes to sensitive files or system directories. + +## Pattern 2: Test Enforcement + +Ensure tests run before stopping: + +```json +{ + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Review transcript. If code was modified (Write/Edit tools used), verify tests were executed. If no tests were run, block with reason 'Tests must be run after code changes'." + } + ] + } + ] +} +``` + +**Use for:** Enforcing quality standards and preventing incomplete work. + +## Pattern 3: Context Loading + +Load project-specific context at session start: + +```json +{ + "SessionStart": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh" + } + ] + } + ] +} +``` + +**Example script (load-context.sh):** +```bash +#!/bin/bash +cd "$CLAUDE_PROJECT_DIR" || exit 1 + +# Detect project type +if [ -f "package.json" ]; then + echo "📦 Node.js project detected" + echo "export PROJECT_TYPE=nodejs" >> "$CLAUDE_ENV_FILE" +elif [ -f "Cargo.toml" ]; then + echo "🦀 Rust project detected" + echo "export PROJECT_TYPE=rust" >> "$CLAUDE_ENV_FILE" +fi +``` + +**Use for:** Automatically detecting and configuring project-specific settings. + +## Pattern 4: Notification Logging + +Log all notifications for audit or analysis: + +```json +{ + "Notification": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/log-notification.sh" + } + ] + } + ] +} +``` + +**Use for:** Tracking user notifications or integration with external logging systems. + +## Pattern 5: MCP Tool Monitoring + +Monitor and validate MCP tool usage: + +```json +{ + "PreToolUse": [ + { + "matcher": "mcp__.*__delete.*", + "hooks": [ + { + "type": "prompt", + "prompt": "Deletion operation detected. Verify: Is this deletion intentional? Can it be undone? Are there backups? Return 'approve' only if safe." + } + ] + } + ] +} +``` + +**Use for:** Protecting against destructive MCP operations. + +## Pattern 6: Build Verification + +Ensure project builds after code changes: + +```json +{ + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Check if code was modified. If Write/Edit tools were used, verify the project was built (npm run build, cargo build, etc). If not built, block and request build." + } + ] + } + ] +} +``` + +**Use for:** Catching build errors before committing or stopping work. + +## Pattern 7: Permission Confirmation + +Ask user before dangerous operations: + +```json +{ + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Command: $TOOL_INPUT.command. If command contains 'rm', 'delete', 'drop', or other destructive operations, return 'ask' to confirm with user. Otherwise 'approve'." + } + ] + } + ] +} +``` + +**Use for:** User confirmation on potentially destructive commands. + +## Pattern 8: Code Quality Checks + +Run linters or formatters on file edits: + +```json +{ + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/check-quality.sh" + } + ] + } + ] +} +``` + +**Example script (check-quality.sh):** +```bash +#!/bin/bash +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path') + +# Run linter if applicable +if [[ "$file_path" == *.js ]] || [[ "$file_path" == *.ts ]]; then + npx eslint "$file_path" 2>&1 || true +fi +``` + +**Use for:** Automatic code quality enforcement. + +## Pattern Combinations + +Combine multiple patterns for comprehensive protection: + +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate file write safety" + } + ] + }, + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Validate bash command safety" + } + ] + } + ], + "Stop": [ + { + "matcher": "*", + "hooks": [ + { + "type": "prompt", + "prompt": "Verify tests run and build succeeded" + } + ] + } + ], + "SessionStart": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh" + } + ] + } + ] +} +``` + +This provides multi-layered protection and automation. + +## Pattern 9: Temporarily Active Hooks + +Create hooks that only run when explicitly enabled via flag files: + +```bash +#!/bin/bash +# Hook only active when flag file exists +FLAG_FILE="$CLAUDE_PROJECT_DIR/.enable-security-scan" + +if [ ! -f "$FLAG_FILE" ]; then + # Quick exit when disabled + exit 0 +fi + +# Flag present, run validation +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path') + +# Run security scan +security-scanner "$file_path" +``` + +**Activation:** +```bash +# Enable the hook +touch .enable-security-scan + +# Disable the hook +rm .enable-security-scan +``` + +**Use for:** +- Temporary debugging hooks +- Feature flags for development +- Project-specific validation that's opt-in +- Performance-intensive checks only when needed + +**Note:** Must restart Claude Code after creating/removing flag files for hooks to recognize changes. + +## Pattern 10: Configuration-Driven Hooks + +Use JSON configuration to control hook behavior: + +```bash +#!/bin/bash +CONFIG_FILE="$CLAUDE_PROJECT_DIR/.claude/my-plugin.local.json" + +# Read configuration +if [ -f "$CONFIG_FILE" ]; then + strict_mode=$(jq -r '.strictMode // false' "$CONFIG_FILE") + max_file_size=$(jq -r '.maxFileSize // 1000000' "$CONFIG_FILE") +else + # Defaults + strict_mode=false + max_file_size=1000000 +fi + +# Skip if not in strict mode +if [ "$strict_mode" != "true" ]; then + exit 0 +fi + +# Apply configured limits +input=$(cat) +file_size=$(echo "$input" | jq -r '.tool_input.content | length') + +if [ "$file_size" -gt "$max_file_size" ]; then + echo '{"decision": "deny", "reason": "File exceeds configured size limit"}' >&2 + exit 2 +fi +``` + +**Configuration file (.claude/my-plugin.local.json):** +```json +{ + "strictMode": true, + "maxFileSize": 500000, + "allowedPaths": ["/tmp", "/home/user/projects"] +} +``` + +**Use for:** +- User-configurable hook behavior +- Per-project settings +- Team-specific rules +- Dynamic validation criteria diff --git a/skills/external/plugin-dev-hook-development/scripts/README.md b/skills/external/plugin-dev-hook-development/scripts/README.md new file mode 100644 index 0000000..02a556f --- /dev/null +++ b/skills/external/plugin-dev-hook-development/scripts/README.md @@ -0,0 +1,164 @@ +# Hook Development Utility Scripts + +These scripts help validate, test, and lint hook implementations before deployment. + +## validate-hook-schema.sh + +Validates `hooks.json` configuration files for correct structure and common issues. + +**Usage:** +```bash +./validate-hook-schema.sh path/to/hooks.json +``` + +**Checks:** +- Valid JSON syntax +- Required fields present +- Valid hook event names +- Proper hook types (command/prompt) +- Timeout values in valid ranges +- Hardcoded path detection +- Prompt hook event compatibility + +**Example:** +```bash +cd my-plugin +./validate-hook-schema.sh hooks/hooks.json +``` + +## test-hook.sh + +Tests individual hook scripts with sample input before deploying to Claude Code. + +**Usage:** +```bash +./test-hook.sh [options] +``` + +**Options:** +- `-v, --verbose` - Show detailed execution information +- `-t, --timeout N` - Set timeout in seconds (default: 60) +- `--create-sample ` - Generate sample test input + +**Example:** +```bash +# Create sample test input +./test-hook.sh --create-sample PreToolUse > test-input.json + +# Test a hook script +./test-hook.sh my-hook.sh test-input.json + +# Test with verbose output and custom timeout +./test-hook.sh -v -t 30 my-hook.sh test-input.json +``` + +**Features:** +- Sets up proper environment variables (CLAUDE_PROJECT_DIR, CLAUDE_PLUGIN_ROOT) +- Measures execution time +- Validates output JSON +- Shows exit codes and their meanings +- Captures environment file output + +## hook-linter.sh + +Checks hook scripts for common issues and best practices violations. + +**Usage:** +```bash +./hook-linter.sh [hook-script2.sh ...] +``` + +**Checks:** +- Shebang presence +- `set -euo pipefail` usage +- Stdin input reading +- Proper error handling +- Variable quoting (injection prevention) +- Exit code usage +- Hardcoded paths +- Long-running code detection +- Error output to stderr +- Input validation + +**Example:** +```bash +# Lint single script +./hook-linter.sh ../examples/validate-write.sh + +# Lint multiple scripts +./hook-linter.sh ../examples/*.sh +``` + +## Typical Workflow + +1. **Write your hook script** + ```bash + vim my-plugin/scripts/my-hook.sh + ``` + +2. **Lint the script** + ```bash + ./hook-linter.sh my-plugin/scripts/my-hook.sh + ``` + +3. **Create test input** + ```bash + ./test-hook.sh --create-sample PreToolUse > test-input.json + # Edit test-input.json as needed + ``` + +4. **Test the hook** + ```bash + ./test-hook.sh -v my-plugin/scripts/my-hook.sh test-input.json + ``` + +5. **Add to hooks.json** + ```bash + # Edit my-plugin/hooks/hooks.json + ``` + +6. **Validate configuration** + ```bash + ./validate-hook-schema.sh my-plugin/hooks/hooks.json + ``` + +7. **Test in Claude Code** + ```bash + claude --debug + ``` + +## Tips + +- Always test hooks before deploying to avoid breaking user workflows +- Use verbose mode (`-v`) to debug hook behavior +- Check the linter output for security and best practice issues +- Validate hooks.json after any changes +- Create different test inputs for various scenarios (safe operations, dangerous operations, edge cases) + +## Common Issues + +### Hook doesn't execute + +Check: +- Script has shebang (`#!/bin/bash`) +- Script is executable (`chmod +x`) +- Path in hooks.json is correct (use `${CLAUDE_PLUGIN_ROOT}`) + +### Hook times out + +- Reduce timeout in hooks.json +- Optimize hook script performance +- Remove long-running operations + +### Hook fails silently + +- Check exit codes (should be 0 or 2) +- Ensure errors go to stderr (`>&2`) +- Validate JSON output structure + +### Injection vulnerabilities + +- Always quote variables: `"$variable"` +- Use `set -euo pipefail` +- Validate all input fields +- Run the linter to catch issues diff --git a/skills/external/plugin-dev-hook-development/scripts/hook-linter.sh b/skills/external/plugin-dev-hook-development/scripts/hook-linter.sh new file mode 100755 index 0000000..64f6041 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/scripts/hook-linter.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# Hook Linter +# Checks hook scripts for common issues and best practices + +set -euo pipefail + +# Usage +if [ $# -eq 0 ]; then + echo "Usage: $0 [hook-script2.sh ...]" + echo "" + echo "Checks hook scripts for:" + echo " - Shebang presence" + echo " - set -euo pipefail usage" + echo " - Input reading from stdin" + echo " - Proper error handling" + echo " - Variable quoting" + echo " - Exit code usage" + echo " - Hardcoded paths" + echo " - Timeout considerations" + exit 1 +fi + +check_script() { + local script="$1" + local warnings=0 + local errors=0 + + echo "🔍 Linting: $script" + echo "" + + if [ ! -f "$script" ]; then + echo "❌ Error: File not found" + return 1 + fi + + # Check 1: Executable + if [ ! -x "$script" ]; then + echo "⚠️ Not executable (chmod +x $script)" + ((warnings++)) + fi + + # Check 2: Shebang + first_line=$(head -1 "$script") + if [[ ! "$first_line" =~ ^#!/ ]]; then + echo "❌ Missing shebang (#!/bin/bash)" + ((errors++)) + fi + + # Check 3: set -euo pipefail + if ! grep -q "set -euo pipefail" "$script"; then + echo "⚠️ Missing 'set -euo pipefail' (recommended for safety)" + ((warnings++)) + fi + + # Check 4: Reads from stdin + if ! grep -q "cat\|read" "$script"; then + echo "⚠️ Doesn't appear to read input from stdin" + ((warnings++)) + fi + + # Check 5: Uses jq for JSON parsing + if grep -q "tool_input\|tool_name" "$script" && ! grep -q "jq" "$script"; then + echo "⚠️ Parses hook input but doesn't use jq" + ((warnings++)) + fi + + # Check 6: Unquoted variables + if grep -E '\$[A-Za-z_][A-Za-z0-9_]*[^"]' "$script" | grep -v '#' | grep -q .; then + echo "⚠️ Potentially unquoted variables detected (injection risk)" + echo " Always use double quotes: \"\$variable\" not \$variable" + ((warnings++)) + fi + + # Check 7: Hardcoded paths + if grep -E '^[^#]*/home/|^[^#]*/usr/|^[^#]*/opt/' "$script" | grep -q .; then + echo "⚠️ Hardcoded absolute paths detected" + echo " Use \$CLAUDE_PROJECT_DIR or \$CLAUDE_PLUGIN_ROOT" + ((warnings++)) + fi + + # Check 8: Uses CLAUDE_PLUGIN_ROOT + if ! grep -q "CLAUDE_PLUGIN_ROOT\|CLAUDE_PROJECT_DIR" "$script"; then + echo "💡 Tip: Use \$CLAUDE_PLUGIN_ROOT for plugin-relative paths" + fi + + # Check 9: Exit codes + if ! grep -q "exit 0\|exit 2" "$script"; then + echo "⚠️ No explicit exit codes (should exit 0 or 2)" + ((warnings++)) + fi + + # Check 10: JSON output for decision hooks + if grep -q "PreToolUse\|Stop" "$script"; then + if ! grep -q "permissionDecision\|decision" "$script"; then + echo "💡 Tip: PreToolUse/Stop hooks should output decision JSON" + fi + fi + + # Check 11: Long-running commands + if grep -E 'sleep [0-9]{3,}|while true' "$script" | grep -v '#' | grep -q .; then + echo "⚠️ Potentially long-running code detected" + echo " Hooks should complete quickly (< 60s)" + ((warnings++)) + fi + + # Check 12: Error messages to stderr + if grep -q 'echo.*".*error\|Error\|denied\|Denied' "$script"; then + if ! grep -q '>&2' "$script"; then + echo "⚠️ Error messages should be written to stderr (>&2)" + ((warnings++)) + fi + fi + + # Check 13: Input validation + if ! grep -q "if.*empty\|if.*null\|if.*-z" "$script"; then + echo "💡 Tip: Consider validating input fields aren't empty" + fi + + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + + if [ $errors -eq 0 ] && [ $warnings -eq 0 ]; then + echo "✅ No issues found" + return 0 + elif [ $errors -eq 0 ]; then + echo "⚠️ Found $warnings warning(s)" + return 0 + else + echo "❌ Found $errors error(s) and $warnings warning(s)" + return 1 + fi +} + +echo "🔎 Hook Script Linter" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" + +total_errors=0 + +for script in "$@"; do + if ! check_script "$script"; then + ((total_errors++)) + fi + echo "" +done + +if [ $total_errors -eq 0 ]; then + echo "✅ All scripts passed linting" + exit 0 +else + echo "❌ $total_errors script(s) had errors" + exit 1 +fi diff --git a/skills/external/plugin-dev-hook-development/scripts/test-hook.sh b/skills/external/plugin-dev-hook-development/scripts/test-hook.sh new file mode 100755 index 0000000..527b119 --- /dev/null +++ b/skills/external/plugin-dev-hook-development/scripts/test-hook.sh @@ -0,0 +1,252 @@ +#!/bin/bash +# Hook Testing Helper +# Tests a hook with sample input and shows output + +set -euo pipefail + +# Usage +show_usage() { + echo "Usage: $0 [options] " + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo " -v, --verbose Show detailed execution information" + echo " -t, --timeout N Set timeout in seconds (default: 60)" + echo "" + echo "Examples:" + echo " $0 validate-bash.sh test-input.json" + echo " $0 -v -t 30 validate-write.sh write-input.json" + echo "" + echo "Creates sample test input with:" + echo " $0 --create-sample " + exit 0 +} + +# Create sample input +create_sample() { + event_type="$1" + + case "$event_type" in + PreToolUse) + cat <<'EOF' +{ + "session_id": "test-session", + "transcript_path": "/tmp/transcript.txt", + "cwd": "/tmp/test-project", + "permission_mode": "ask", + "hook_event_name": "PreToolUse", + "tool_name": "Write", + "tool_input": { + "file_path": "/tmp/test.txt", + "content": "Test content" + } +} +EOF + ;; + PostToolUse) + cat <<'EOF' +{ + "session_id": "test-session", + "transcript_path": "/tmp/transcript.txt", + "cwd": "/tmp/test-project", + "permission_mode": "ask", + "hook_event_name": "PostToolUse", + "tool_name": "Bash", + "tool_result": "Command executed successfully" +} +EOF + ;; + Stop|SubagentStop) + cat <<'EOF' +{ + "session_id": "test-session", + "transcript_path": "/tmp/transcript.txt", + "cwd": "/tmp/test-project", + "permission_mode": "ask", + "hook_event_name": "Stop", + "reason": "Task appears complete" +} +EOF + ;; + UserPromptSubmit) + cat <<'EOF' +{ + "session_id": "test-session", + "transcript_path": "/tmp/transcript.txt", + "cwd": "/tmp/test-project", + "permission_mode": "ask", + "hook_event_name": "UserPromptSubmit", + "user_prompt": "Test user prompt" +} +EOF + ;; + SessionStart|SessionEnd) + cat <<'EOF' +{ + "session_id": "test-session", + "transcript_path": "/tmp/transcript.txt", + "cwd": "/tmp/test-project", + "permission_mode": "ask", + "hook_event_name": "SessionStart" +} +EOF + ;; + *) + echo "Unknown event type: $event_type" + echo "Valid types: PreToolUse, PostToolUse, Stop, SubagentStop, UserPromptSubmit, SessionStart, SessionEnd" + exit 1 + ;; + esac +} + +# Parse arguments +VERBOSE=false +TIMEOUT=60 + +while [ $# -gt 0 ]; do + case "$1" in + -h|--help) + show_usage + ;; + -v|--verbose) + VERBOSE=true + shift + ;; + -t|--timeout) + TIMEOUT="$2" + shift 2 + ;; + --create-sample) + create_sample "$2" + exit 0 + ;; + *) + break + ;; + esac +done + +if [ $# -ne 2 ]; then + echo "Error: Missing required arguments" + echo "" + show_usage +fi + +HOOK_SCRIPT="$1" +TEST_INPUT="$2" + +# Validate inputs +if [ ! -f "$HOOK_SCRIPT" ]; then + echo "❌ Error: Hook script not found: $HOOK_SCRIPT" + exit 1 +fi + +if [ ! -x "$HOOK_SCRIPT" ]; then + echo "⚠️ Warning: Hook script is not executable. Attempting to run with bash..." + HOOK_SCRIPT="bash $HOOK_SCRIPT" +fi + +if [ ! -f "$TEST_INPUT" ]; then + echo "❌ Error: Test input not found: $TEST_INPUT" + exit 1 +fi + +# Validate test input JSON +if ! jq empty "$TEST_INPUT" 2>/dev/null; then + echo "❌ Error: Test input is not valid JSON" + exit 1 +fi + +echo "🧪 Testing hook: $HOOK_SCRIPT" +echo "📥 Input: $TEST_INPUT" +echo "" + +if [ "$VERBOSE" = true ]; then + echo "Input JSON:" + jq . "$TEST_INPUT" + echo "" +fi + +# Set up environment +export CLAUDE_PROJECT_DIR="${CLAUDE_PROJECT_DIR:-/tmp/test-project}" +export CLAUDE_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(pwd)}" +export CLAUDE_ENV_FILE="${CLAUDE_ENV_FILE:-/tmp/test-env-$$}" + +if [ "$VERBOSE" = true ]; then + echo "Environment:" + echo " CLAUDE_PROJECT_DIR=$CLAUDE_PROJECT_DIR" + echo " CLAUDE_PLUGIN_ROOT=$CLAUDE_PLUGIN_ROOT" + echo " CLAUDE_ENV_FILE=$CLAUDE_ENV_FILE" + echo "" +fi + +# Run the hook +echo "▶️ Running hook (timeout: ${TIMEOUT}s)..." +echo "" + +start_time=$(date +%s) + +set +e +output=$(timeout "$TIMEOUT" bash -c "cat '$TEST_INPUT' | $HOOK_SCRIPT" 2>&1) +exit_code=$? +set -e + +end_time=$(date +%s) +duration=$((end_time - start_time)) + +# Analyze results +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "Results:" +echo "" +echo "Exit Code: $exit_code" +echo "Duration: ${duration}s" +echo "" + +case $exit_code in + 0) + echo "✅ Hook approved/succeeded" + ;; + 2) + echo "🚫 Hook blocked/denied" + ;; + 124) + echo "⏱️ Hook timed out after ${TIMEOUT}s" + ;; + *) + echo "⚠️ Hook returned unexpected exit code: $exit_code" + ;; +esac + +echo "" +echo "Output:" +if [ -n "$output" ]; then + echo "$output" + echo "" + + # Try to parse as JSON + if echo "$output" | jq empty 2>/dev/null; then + echo "Parsed JSON output:" + echo "$output" | jq . + fi +else + echo "(no output)" +fi + +# Check for environment file +if [ -f "$CLAUDE_ENV_FILE" ]; then + echo "" + echo "Environment file created:" + cat "$CLAUDE_ENV_FILE" + rm -f "$CLAUDE_ENV_FILE" +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if [ $exit_code -eq 0 ] || [ $exit_code -eq 2 ]; then + echo "✅ Test completed successfully" + exit 0 +else + echo "❌ Test failed" + exit 1 +fi diff --git a/skills/external/plugin-dev-hook-development/scripts/validate-hook-schema.sh b/skills/external/plugin-dev-hook-development/scripts/validate-hook-schema.sh new file mode 100755 index 0000000..fed0a1f --- /dev/null +++ b/skills/external/plugin-dev-hook-development/scripts/validate-hook-schema.sh @@ -0,0 +1,159 @@ +#!/bin/bash +# Hook Schema Validator +# Validates hooks.json structure and checks for common issues + +set -euo pipefail + +# Usage +if [ $# -eq 0 ]; then + echo "Usage: $0 " + echo "" + echo "Validates hook configuration file for:" + echo " - Valid JSON syntax" + echo " - Required fields" + echo " - Hook type validity" + echo " - Matcher patterns" + echo " - Timeout ranges" + exit 1 +fi + +HOOKS_FILE="$1" + +if [ ! -f "$HOOKS_FILE" ]; then + echo "❌ Error: File not found: $HOOKS_FILE" + exit 1 +fi + +echo "🔍 Validating hooks configuration: $HOOKS_FILE" +echo "" + +# Check 1: Valid JSON +echo "Checking JSON syntax..." +if ! jq empty "$HOOKS_FILE" 2>/dev/null; then + echo "❌ Invalid JSON syntax" + exit 1 +fi +echo "✅ Valid JSON" + +# Check 2: Root structure +echo "" +echo "Checking root structure..." +VALID_EVENTS=("PreToolUse" "PostToolUse" "UserPromptSubmit" "Stop" "SubagentStop" "SessionStart" "SessionEnd" "PreCompact" "Notification") + +for event in $(jq -r 'keys[]' "$HOOKS_FILE"); do + found=false + for valid_event in "${VALID_EVENTS[@]}"; do + if [ "$event" = "$valid_event" ]; then + found=true + break + fi + done + + if [ "$found" = false ]; then + echo "⚠️ Unknown event type: $event" + fi +done +echo "✅ Root structure valid" + +# Check 3: Validate each hook +echo "" +echo "Validating individual hooks..." + +error_count=0 +warning_count=0 + +for event in $(jq -r 'keys[]' "$HOOKS_FILE"); do + hook_count=$(jq -r ".\"$event\" | length" "$HOOKS_FILE") + + for ((i=0; i___` + +**Example:** +- Plugin: `asana` +- Server: `asana` +- Tool: `create_task` +- **Full name:** `mcp__plugin_asana_asana__asana_create_task` + +### Using MCP Tools in Commands + +Pre-allow specific MCP tools in command frontmatter: + +```markdown +--- +allowed-tools: [ + "mcp__plugin_asana_asana__asana_create_task", + "mcp__plugin_asana_asana__asana_search_tasks" +] +--- +``` + +**Wildcard (use sparingly):** +```markdown +--- +allowed-tools: ["mcp__plugin_asana_asana__*"] +--- +``` + +**Best practice:** Pre-allow specific tools, not wildcards, for security. + +## Lifecycle Management + +**Automatic startup:** +- MCP servers start when plugin enables +- Connection established before first tool use +- Restart required for configuration changes + +**Lifecycle:** +1. Plugin loads +2. MCP configuration parsed +3. Server process started (stdio) or connection established (SSE/HTTP/WS) +4. Tools discovered and registered +5. Tools available as `mcp__plugin_...__...` + +**Viewing servers:** +Use `/mcp` command to see all servers including plugin-provided ones. + +## Authentication Patterns + +### OAuth (SSE/HTTP) + +OAuth handled automatically by Claude Code: + +```json +{ + "type": "sse", + "url": "https://mcp.example.com/sse" +} +``` + +User authenticates in browser on first use. No additional configuration needed. + +### Token-Based (Headers) + +Static or environment variable tokens: + +```json +{ + "type": "http", + "url": "https://api.example.com", + "headers": { + "Authorization": "Bearer ${API_TOKEN}" + } +} +``` + +Document required environment variables in README. + +### Environment Variables (stdio) + +Pass configuration to MCP server: + +```json +{ + "command": "python", + "args": ["-m", "my_mcp_server"], + "env": { + "DATABASE_URL": "${DB_URL}", + "API_KEY": "${API_KEY}", + "LOG_LEVEL": "info" + } +} +``` + +## Integration Patterns + +### Pattern 1: Simple Tool Wrapper + +Commands use MCP tools with user interaction: + +```markdown +# Command: create-item.md +--- +allowed-tools: ["mcp__plugin_name_server__create_item"] +--- + +Steps: +1. Gather item details from user +2. Use mcp__plugin_name_server__create_item +3. Confirm creation +``` + +**Use for:** Adding validation or preprocessing before MCP calls. + +### Pattern 2: Autonomous Agent + +Agents use MCP tools autonomously: + +```markdown +# Agent: data-analyzer.md + +Analysis Process: +1. Query data via mcp__plugin_db_server__query +2. Process and analyze results +3. Generate insights report +``` + +**Use for:** Multi-step MCP workflows without user interaction. + +### Pattern 3: Multi-Server Plugin + +Integrate multiple MCP servers: + +```json +{ + "github": { + "type": "sse", + "url": "https://mcp.github.com/sse" + }, + "jira": { + "type": "sse", + "url": "https://mcp.jira.com/sse" + } +} +``` + +**Use for:** Workflows spanning multiple services. + +## Security Best Practices + +### Use HTTPS/WSS + +Always use secure connections: + +```json +✅ "url": "https://mcp.example.com/sse" +❌ "url": "http://mcp.example.com/sse" +``` + +### Token Management + +**DO:** +- ✅ Use environment variables for tokens +- ✅ Document required env vars in README +- ✅ Let OAuth flow handle authentication + +**DON'T:** +- ❌ Hardcode tokens in configuration +- ❌ Commit tokens to git +- ❌ Share tokens in documentation + +### Permission Scoping + +Pre-allow only necessary MCP tools: + +```markdown +✅ allowed-tools: [ + "mcp__plugin_api_server__read_data", + "mcp__plugin_api_server__create_item" +] + +❌ allowed-tools: ["mcp__plugin_api_server__*"] +``` + +## Error Handling + +### Connection Failures + +Handle MCP server unavailability: +- Provide fallback behavior in commands +- Inform user of connection issues +- Check server URL and configuration + +### Tool Call Errors + +Handle failed MCP operations: +- Validate inputs before calling MCP tools +- Provide clear error messages +- Check rate limiting and quotas + +### Configuration Errors + +Validate MCP configuration: +- Test server connectivity during development +- Validate JSON syntax +- Check required environment variables + +## Performance Considerations + +### Lazy Loading + +MCP servers connect on-demand: +- Not all servers connect at startup +- First tool use triggers connection +- Connection pooling managed automatically + +### Batching + +Batch similar requests when possible: + +``` +# Good: Single query with filters +tasks = search_tasks(project="X", assignee="me", limit=50) + +# Avoid: Many individual queries +for id in task_ids: + task = get_task(id) +``` + +## Testing MCP Integration + +### Local Testing + +1. Configure MCP server in `.mcp.json` +2. Install plugin locally (`.claude-plugin/`) +3. Run `/mcp` to verify server appears +4. Test tool calls in commands +5. Check `claude --debug` logs for connection issues + +### Validation Checklist + +- [ ] MCP configuration is valid JSON +- [ ] Server URL is correct and accessible +- [ ] Required environment variables documented +- [ ] Tools appear in `/mcp` output +- [ ] Authentication works (OAuth or tokens) +- [ ] Tool calls succeed from commands +- [ ] Error cases handled gracefully + +## Debugging + +### Enable Debug Logging + +```bash +claude --debug +``` + +Look for: +- MCP server connection attempts +- Tool discovery logs +- Authentication flows +- Tool call errors + +### Common Issues + +**Server not connecting:** +- Check URL is correct +- Verify server is running (stdio) +- Check network connectivity +- Review authentication configuration + +**Tools not available:** +- Verify server connected successfully +- Check tool names match exactly +- Run `/mcp` to see available tools +- Restart Claude Code after config changes + +**Authentication failing:** +- Clear cached auth tokens +- Re-authenticate +- Check token scopes and permissions +- Verify environment variables set + +## Quick Reference + +### MCP Server Types + +| Type | Transport | Best For | Auth | +|------|-----------|----------|------| +| stdio | Process | Local tools, custom servers | Env vars | +| SSE | HTTP | Hosted services, cloud APIs | OAuth | +| HTTP | REST | API backends, token auth | Tokens | +| ws | WebSocket | Real-time, streaming | Tokens | + +### Configuration Checklist + +- [ ] Server type specified (stdio/SSE/HTTP/ws) +- [ ] Type-specific fields complete (command or url) +- [ ] Authentication configured +- [ ] Environment variables documented +- [ ] HTTPS/WSS used (not HTTP/WS) +- [ ] ${CLAUDE_PLUGIN_ROOT} used for paths + +### Best Practices + +**DO:** +- ✅ Use ${CLAUDE_PLUGIN_ROOT} for portable paths +- ✅ Document required environment variables +- ✅ Use secure connections (HTTPS/WSS) +- ✅ Pre-allow specific MCP tools in commands +- ✅ Test MCP integration before publishing +- ✅ Handle connection and tool errors gracefully + +**DON'T:** +- ❌ Hardcode absolute paths +- ❌ Commit credentials to git +- ❌ Use HTTP instead of HTTPS +- ❌ Pre-allow all tools with wildcards +- ❌ Skip error handling +- ❌ Forget to document setup + +## Additional Resources + +### Reference Files + +For detailed information, consult: + +- **`references/server-types.md`** - Deep dive on each server type +- **`references/authentication.md`** - Authentication patterns and OAuth +- **`references/tool-usage.md`** - Using MCP tools in commands and agents + +### Example Configurations + +Working examples in `examples/`: + +- **`stdio-server.json`** - Local stdio MCP server +- **`sse-server.json`** - Hosted SSE server with OAuth +- **`http-server.json`** - REST API with token auth + +### External Resources + +- **Official MCP Docs**: https://modelcontextprotocol.io/ +- **Claude Code MCP Docs**: https://docs.claude.com/en/docs/claude-code/mcp +- **MCP SDK**: @modelcontextprotocol/sdk +- **Testing**: Use `claude --debug` and `/mcp` command + +## Implementation Workflow + +To add MCP integration to a plugin: + +1. Choose MCP server type (stdio, SSE, HTTP, ws) +2. Create `.mcp.json` at plugin root with configuration +3. Use ${CLAUDE_PLUGIN_ROOT} for all file references +4. Document required environment variables in README +5. Test locally with `/mcp` command +6. Pre-allow MCP tools in relevant commands +7. Handle authentication (OAuth or tokens) +8. Test error cases (connection failures, auth errors) +9. Document MCP integration in plugin README + +Focus on stdio for custom/local servers, SSE for hosted services with OAuth. diff --git a/skills/external/plugin-dev-mcp-integration/examples/http-server.json b/skills/external/plugin-dev-mcp-integration/examples/http-server.json new file mode 100644 index 0000000..e96448f --- /dev/null +++ b/skills/external/plugin-dev-mcp-integration/examples/http-server.json @@ -0,0 +1,20 @@ +{ + "_comment": "Example HTTP MCP server configuration for REST APIs", + "rest-api": { + "type": "http", + "url": "https://api.example.com/mcp", + "headers": { + "Authorization": "Bearer ${API_TOKEN}", + "Content-Type": "application/json", + "X-API-Version": "2024-01-01" + } + }, + "internal-service": { + "type": "http", + "url": "https://api.example.com/mcp", + "headers": { + "Authorization": "Bearer ${API_TOKEN}", + "X-Service-Name": "claude-plugin" + } + } +} diff --git a/skills/external/plugin-dev-mcp-integration/examples/sse-server.json b/skills/external/plugin-dev-mcp-integration/examples/sse-server.json new file mode 100644 index 0000000..e6ec71c --- /dev/null +++ b/skills/external/plugin-dev-mcp-integration/examples/sse-server.json @@ -0,0 +1,19 @@ +{ + "_comment": "Example SSE MCP server configuration for hosted cloud services", + "asana": { + "type": "sse", + "url": "https://mcp.asana.com/sse" + }, + "github": { + "type": "sse", + "url": "https://mcp.github.com/sse" + }, + "custom-service": { + "type": "sse", + "url": "https://mcp.example.com/sse", + "headers": { + "X-API-Version": "v1", + "X-Client-ID": "${CLIENT_ID}" + } + } +} diff --git a/skills/external/plugin-dev-mcp-integration/examples/stdio-server.json b/skills/external/plugin-dev-mcp-integration/examples/stdio-server.json new file mode 100644 index 0000000..60af1c6 --- /dev/null +++ b/skills/external/plugin-dev-mcp-integration/examples/stdio-server.json @@ -0,0 +1,26 @@ +{ + "_comment": "Example stdio MCP server configuration for local file system access", + "filesystem": { + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", "${CLAUDE_PROJECT_DIR}"], + "env": { + "LOG_LEVEL": "info" + } + }, + "database": { + "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server.js", + "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config/db.json"], + "env": { + "DATABASE_URL": "${DATABASE_URL}", + "DB_POOL_SIZE": "10" + } + }, + "custom-tools": { + "command": "python", + "args": ["-m", "my_mcp_server", "--port", "8080"], + "env": { + "API_KEY": "${CUSTOM_API_KEY}", + "DEBUG": "false" + } + } +} diff --git a/skills/external/plugin-dev-mcp-integration/references/authentication.md b/skills/external/plugin-dev-mcp-integration/references/authentication.md new file mode 100644 index 0000000..1d4ff38 --- /dev/null +++ b/skills/external/plugin-dev-mcp-integration/references/authentication.md @@ -0,0 +1,549 @@ +# MCP Authentication Patterns + +Complete guide to authentication methods for MCP servers in Claude Code plugins. + +## Overview + +MCP servers support multiple authentication methods depending on the server type and service requirements. Choose the method that best matches your use case and security requirements. + +## OAuth (Automatic) + +### How It Works + +Claude Code automatically handles the complete OAuth 2.0 flow for SSE and HTTP servers: + +1. User attempts to use MCP tool +2. Claude Code detects authentication needed +3. Opens browser for OAuth consent +4. User authorizes in browser +5. Tokens stored securely by Claude Code +6. Automatic token refresh + +### Configuration + +```json +{ + "service": { + "type": "sse", + "url": "https://mcp.example.com/sse" + } +} +``` + +No additional auth configuration needed! Claude Code handles everything. + +### Supported Services + +**Known OAuth-enabled MCP servers:** +- Asana: `https://mcp.asana.com/sse` +- GitHub (when available) +- Google services (when available) +- Custom OAuth servers + +### OAuth Scopes + +OAuth scopes are determined by the MCP server. Users see required scopes during the consent flow. + +**Document required scopes in your README:** +```markdown +## Authentication + +This plugin requires the following Asana permissions: +- Read tasks and projects +- Create and update tasks +- Access workspace data +``` + +### Token Storage + +Tokens are stored securely by Claude Code: +- Not accessible to plugins +- Encrypted at rest +- Automatic refresh +- Cleared on sign-out + +### Troubleshooting OAuth + +**Authentication loop:** +- Clear cached tokens (sign out and sign in) +- Check OAuth redirect URLs +- Verify server OAuth configuration + +**Scope issues:** +- User may need to re-authorize for new scopes +- Check server documentation for required scopes + +**Token expiration:** +- Claude Code auto-refreshes +- If refresh fails, prompts re-authentication + +## Token-Based Authentication + +### Bearer Tokens + +Most common for HTTP and WebSocket servers. + +**Configuration:** +```json +{ + "api": { + "type": "http", + "url": "https://api.example.com/mcp", + "headers": { + "Authorization": "Bearer ${API_TOKEN}" + } + } +} +``` + +**Environment variable:** +```bash +export API_TOKEN="your-secret-token-here" +``` + +### API Keys + +Alternative to Bearer tokens, often in custom headers. + +**Configuration:** +```json +{ + "api": { + "type": "http", + "url": "https://api.example.com/mcp", + "headers": { + "X-API-Key": "${API_KEY}", + "X-API-Secret": "${API_SECRET}" + } + } +} +``` + +### Custom Headers + +Services may use custom authentication headers. + +**Configuration:** +```json +{ + "service": { + "type": "sse", + "url": "https://mcp.example.com/sse", + "headers": { + "X-Auth-Token": "${AUTH_TOKEN}", + "X-User-ID": "${USER_ID}", + "X-Tenant-ID": "${TENANT_ID}" + } + } +} +``` + +### Documenting Token Requirements + +Always document in your README: + +```markdown +## Setup + +### Required Environment Variables + +Set these environment variables before using the plugin: + +\`\`\`bash +export API_TOKEN="your-token-here" +export API_SECRET="your-secret-here" +\`\`\` + +### Obtaining Tokens + +1. Visit https://api.example.com/tokens +2. Create a new API token +3. Copy the token and secret +4. Set environment variables as shown above + +### Token Permissions + +The API token needs the following permissions: +- Read access to resources +- Write access for creating items +- Delete access (optional, for cleanup operations) +\`\`\` +``` + +## Environment Variable Authentication (stdio) + +### Passing Credentials to Server + +For stdio servers, pass credentials via environment variables: + +```json +{ + "database": { + "command": "python", + "args": ["-m", "mcp_server_db"], + "env": { + "DATABASE_URL": "${DATABASE_URL}", + "DB_USER": "${DB_USER}", + "DB_PASSWORD": "${DB_PASSWORD}" + } + } +} +``` + +### User Environment Variables + +```bash +# User sets these in their shell +export DATABASE_URL="postgresql://localhost/mydb" +export DB_USER="myuser" +export DB_PASSWORD="mypassword" +``` + +### Documentation Template + +```markdown +## Database Configuration + +Set these environment variables: + +\`\`\`bash +export DATABASE_URL="postgresql://host:port/database" +export DB_USER="username" +export DB_PASSWORD="password" +\`\`\` + +Or create a `.env` file (add to `.gitignore`): + +\`\`\` +DATABASE_URL=postgresql://localhost:5432/mydb +DB_USER=myuser +DB_PASSWORD=mypassword +\`\`\` + +Load with: \`source .env\` or \`export $(cat .env | xargs)\` +\`\`\` +``` + +## Dynamic Headers + +### Headers Helper Script + +For tokens that change or expire, use a helper script: + +```json +{ + "api": { + "type": "sse", + "url": "https://api.example.com", + "headersHelper": "${CLAUDE_PLUGIN_ROOT}/scripts/get-headers.sh" + } +} +``` + +**Script (get-headers.sh):** +```bash +#!/bin/bash +# Generate dynamic authentication headers + +# Fetch fresh token +TOKEN=$(get-fresh-token-from-somewhere) + +# Output JSON headers +cat <___`. Use these tools in commands and agents just like built-in Claude Code tools. + +## Tool Naming Convention + +### Format + +``` +mcp__plugin____ +``` + +### Examples + +**Asana plugin with asana server:** +- `mcp__plugin_asana_asana__asana_create_task` +- `mcp__plugin_asana_asana__asana_search_tasks` +- `mcp__plugin_asana_asana__asana_get_project` + +**Custom plugin with database server:** +- `mcp__plugin_myplug_database__query` +- `mcp__plugin_myplug_database__execute` +- `mcp__plugin_myplug_database__list_tables` + +### Discovering Tool Names + +**Use `/mcp` command:** +```bash +/mcp +``` + +This shows: +- All available MCP servers +- Tools provided by each server +- Tool schemas and descriptions +- Full tool names for use in configuration + +## Using Tools in Commands + +### Pre-Allowing Tools + +Specify MCP tools in command frontmatter: + +```markdown +--- +description: Create a new Asana task +allowed-tools: [ + "mcp__plugin_asana_asana__asana_create_task" +] +--- + +# Create Task Command + +To create a task: +1. Gather task details from user +2. Use mcp__plugin_asana_asana__asana_create_task with the details +3. Confirm creation to user +``` + +### Multiple Tools + +```markdown +--- +allowed-tools: [ + "mcp__plugin_asana_asana__asana_create_task", + "mcp__plugin_asana_asana__asana_search_tasks", + "mcp__plugin_asana_asana__asana_get_project" +] +--- +``` + +### Wildcard (Use Sparingly) + +```markdown +--- +allowed-tools: ["mcp__plugin_asana_asana__*"] +--- +``` + +**Caution:** Only use wildcards if the command truly needs access to all tools from a server. + +### Tool Usage in Command Instructions + +**Example command:** +```markdown +--- +description: Search and create Asana tasks +allowed-tools: [ + "mcp__plugin_asana_asana__asana_search_tasks", + "mcp__plugin_asana_asana__asana_create_task" +] +--- + +# Asana Task Management + +## Searching Tasks + +To search for tasks: +1. Use mcp__plugin_asana_asana__asana_search_tasks +2. Provide search filters (assignee, project, etc.) +3. Display results to user + +## Creating Tasks + +To create a task: +1. Gather task details: + - Title (required) + - Description + - Project + - Assignee + - Due date +2. Use mcp__plugin_asana_asana__asana_create_task +3. Show confirmation with task link +``` + +## Using Tools in Agents + +### Agent Configuration + +Agents can use MCP tools autonomously without pre-allowing them: + +```markdown +--- +name: asana-status-updater +description: This agent should be used when the user asks to "update Asana status", "generate project report", or "sync Asana tasks" +model: inherit +color: blue +--- + +## Role + +Autonomous agent for generating Asana project status reports. + +## Process + +1. **Query tasks**: Use mcp__plugin_asana_asana__asana_search_tasks to get all tasks +2. **Analyze progress**: Calculate completion rates and identify blockers +3. **Generate report**: Create formatted status update +4. **Update Asana**: Use mcp__plugin_asana_asana__asana_create_comment to post report + +## Available Tools + +The agent has access to all Asana MCP tools without pre-approval. +``` + +### Agent Tool Access + +Agents have broader tool access than commands: +- Can use any tool Claude determines is necessary +- Don't need pre-allowed lists +- Should document which tools they typically use + +## Tool Call Patterns + +### Pattern 1: Simple Tool Call + +Single tool call with validation: + +```markdown +Steps: +1. Validate user provided required fields +2. Call mcp__plugin_api_server__create_item with validated data +3. Check for errors +4. Display confirmation +``` + +### Pattern 2: Sequential Tools + +Chain multiple tool calls: + +```markdown +Steps: +1. Search for existing items: mcp__plugin_api_server__search +2. If not found, create new: mcp__plugin_api_server__create +3. Add metadata: mcp__plugin_api_server__update_metadata +4. Return final item ID +``` + +### Pattern 3: Batch Operations + +Multiple calls with same tool: + +```markdown +Steps: +1. Get list of items to process +2. For each item: + - Call mcp__plugin_api_server__update_item + - Track success/failure +3. Report results summary +``` + +### Pattern 4: Error Handling + +Graceful error handling: + +```markdown +Steps: +1. Try to call mcp__plugin_api_server__get_data +2. If error (rate limit, network, etc.): + - Wait and retry (max 3 attempts) + - If still failing, inform user + - Suggest checking configuration +3. On success, process data +``` + +## Tool Parameters + +### Understanding Tool Schemas + +Each MCP tool has a schema defining its parameters. View with `/mcp`. + +**Example schema:** +```json +{ + "name": "asana_create_task", + "description": "Create a new Asana task", + "inputSchema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Task title" + }, + "notes": { + "type": "string", + "description": "Task description" + }, + "workspace": { + "type": "string", + "description": "Workspace GID" + } + }, + "required": ["name", "workspace"] + } +} +``` + +### Calling Tools with Parameters + +Claude automatically structures tool calls based on schema: + +```typescript +// Claude generates this internally +{ + toolName: "mcp__plugin_asana_asana__asana_create_task", + input: { + name: "Review PR #123", + notes: "Code review for new feature", + workspace: "12345", + assignee: "67890", + due_on: "2025-01-15" + } +} +``` + +### Parameter Validation + +**In commands, validate before calling:** + +```markdown +Steps: +1. Check required parameters: + - Title is not empty + - Workspace ID is provided + - Due date is valid format (YYYY-MM-DD) +2. If validation fails, ask user to provide missing data +3. If validation passes, call MCP tool +4. Handle tool errors gracefully +``` + +## Response Handling + +### Success Responses + +```markdown +Steps: +1. Call MCP tool +2. On success: + - Extract relevant data from response + - Format for user display + - Provide confirmation message + - Include relevant links or IDs +``` + +### Error Responses + +```markdown +Steps: +1. Call MCP tool +2. On error: + - Check error type (auth, rate limit, validation, etc.) + - Provide helpful error message + - Suggest remediation steps + - Don't expose internal error details to user +``` + +### Partial Success + +```markdown +Steps: +1. Batch operation with multiple MCP calls +2. Track successes and failures separately +3. Report summary: + - "Successfully processed 8 of 10 items" + - "Failed items: [item1, item2] due to [reason]" + - Suggest retry or manual intervention +``` + +## Performance Optimization + +### Batching Requests + +**Good: Single query with filters** +```markdown +Steps: +1. Call mcp__plugin_api_server__search with filters: + - project_id: "123" + - status: "active" + - limit: 100 +2. Process all results +``` + +**Avoid: Many individual queries** +```markdown +Steps: +1. For each item ID: + - Call mcp__plugin_api_server__get_item + - Process item +``` + +### Caching Results + +```markdown +Steps: +1. Call expensive MCP operation: mcp__plugin_api_server__analyze +2. Store results in variable for reuse +3. Use cached results for subsequent operations +4. Only re-fetch if data changes +``` + +### Parallel Tool Calls + +When tools don't depend on each other, call in parallel: + +```markdown +Steps: +1. Make parallel calls (Claude handles this automatically): + - mcp__plugin_api_server__get_project + - mcp__plugin_api_server__get_users + - mcp__plugin_api_server__get_tags +2. Wait for all to complete +3. Combine results +``` + +## Integration Best Practices + +### User Experience + +**Provide feedback:** +```markdown +Steps: +1. Inform user: "Searching Asana tasks..." +2. Call mcp__plugin_asana_asana__asana_search_tasks +3. Show progress: "Found 15 tasks, analyzing..." +4. Present results +``` + +**Handle long operations:** +```markdown +Steps: +1. Warn user: "This may take a minute..." +2. Break into smaller steps with updates +3. Show incremental progress +4. Final summary when complete +``` + +### Error Messages + +**Good error messages:** +``` +❌ "Could not create task. Please check: + 1. You're logged into Asana + 2. You have access to workspace 'Engineering' + 3. The project 'Q1 Goals' exists" +``` + +**Poor error messages:** +``` +❌ "Error: MCP tool returned 403" +``` + +### Documentation + +**Document MCP tool usage in command:** +```markdown +## MCP Tools Used + +This command uses the following Asana MCP tools: +- **asana_search_tasks**: Search for tasks matching criteria +- **asana_create_task**: Create new task with details +- **asana_update_task**: Update existing task properties + +Ensure you're authenticated to Asana before running this command. +``` + +## Testing Tool Usage + +### Local Testing + +1. **Configure MCP server** in `.mcp.json` +2. **Install plugin locally** in `.claude-plugin/` +3. **Verify tools available** with `/mcp` +4. **Test command** that uses tools +5. **Check debug output**: `claude --debug` + +### Test Scenarios + +**Test successful calls:** +```markdown +Steps: +1. Create test data in external service +2. Run command that queries this data +3. Verify correct results returned +``` + +**Test error cases:** +```markdown +Steps: +1. Test with missing authentication +2. Test with invalid parameters +3. Test with non-existent resources +4. Verify graceful error handling +``` + +**Test edge cases:** +```markdown +Steps: +1. Test with empty results +2. Test with maximum results +3. Test with special characters +4. Test with concurrent access +``` + +## Common Patterns + +### Pattern: CRUD Operations + +```markdown +--- +allowed-tools: [ + "mcp__plugin_api_server__create_item", + "mcp__plugin_api_server__read_item", + "mcp__plugin_api_server__update_item", + "mcp__plugin_api_server__delete_item" +] +--- + +# Item Management + +## Create +Use create_item with required fields... + +## Read +Use read_item with item ID... + +## Update +Use update_item with item ID and changes... + +## Delete +Use delete_item with item ID (ask for confirmation first)... +``` + +### Pattern: Search and Process + +```markdown +Steps: +1. **Search**: mcp__plugin_api_server__search with filters +2. **Filter**: Apply additional local filtering if needed +3. **Transform**: Process each result +4. **Present**: Format and display to user +``` + +### Pattern: Multi-Step Workflow + +```markdown +Steps: +1. **Setup**: Gather all required information +2. **Validate**: Check data completeness +3. **Execute**: Chain of MCP tool calls: + - Create parent resource + - Create child resources + - Link resources together + - Add metadata +4. **Verify**: Confirm all steps succeeded +5. **Report**: Provide summary to user +``` + +## Troubleshooting + +### Tools Not Available + +**Check:** +- MCP server configured correctly +- Server connected (check `/mcp`) +- Tool names match exactly (case-sensitive) +- Restart Claude Code after config changes + +### Tool Calls Failing + +**Check:** +- Authentication is valid +- Parameters match tool schema +- Required parameters provided +- Check `claude --debug` logs + +### Performance Issues + +**Check:** +- Batching queries instead of individual calls +- Caching results when appropriate +- Not making unnecessary tool calls +- Parallel calls when possible + +## Conclusion + +Effective MCP tool usage requires: +1. **Understanding tool schemas** via `/mcp` +2. **Pre-allowing tools** in commands appropriately +3. **Handling errors gracefully** +4. **Optimizing performance** with batching and caching +5. **Providing good UX** with feedback and clear errors +6. **Testing thoroughly** before deployment + +Follow these patterns for robust MCP tool integration in your plugin commands and agents. diff --git a/skills/external/plugin-dev-plugin-settings/SKILL.md b/skills/external/plugin-dev-plugin-settings/SKILL.md new file mode 100644 index 0000000..3a777e3 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/SKILL.md @@ -0,0 +1,543 @@ +--- +name: plugin-settings +description: This skill should be used when the user asks about "plugin settings", "store plugin configuration", "user-configurable plugin", ".local.md files", "plugin state files", "read YAML frontmatter", "per-project plugin settings", or wants to make plugin behavior configurable. Documents the .claude/plugin-name.local.md pattern for storing plugin-specific configuration with YAML frontmatter and markdown content. +--- + +# Plugin Settings Pattern for Claude Code Plugins + +## Overview + +Plugins can store user-configurable settings and state in `.claude/plugin-name.local.md` files within the project directory. This pattern uses YAML frontmatter for structured configuration and markdown content for prompts or additional context. + +**Key characteristics:** +- File location: `.claude/plugin-name.local.md` in project root +- Structure: YAML frontmatter + markdown body +- Purpose: Per-project plugin configuration and state +- Usage: Read from hooks, commands, and agents +- Lifecycle: User-managed (not in git, should be in `.gitignore`) + +## File Structure + +### Basic Template + +```markdown +--- +enabled: true +setting1: value1 +setting2: value2 +numeric_setting: 42 +list_setting: ["item1", "item2"] +--- + +# Additional Context + +This markdown body can contain: +- Task descriptions +- Additional instructions +- Prompts to feed back to Claude +- Documentation or notes +``` + +### Example: Plugin State File + +**.claude/my-plugin.local.md:** +```markdown +--- +enabled: true +strict_mode: false +max_retries: 3 +notification_level: info +coordinator_session: team-leader +--- + +# Plugin Configuration + +This plugin is configured for standard validation mode. +Contact @team-lead with questions. +``` + +## Reading Settings Files + +### From Hooks (Bash Scripts) + +**Pattern: Check existence and parse frontmatter** + +```bash +#!/bin/bash +set -euo pipefail + +# Define state file path +STATE_FILE=".claude/my-plugin.local.md" + +# Quick exit if file doesn't exist +if [[ ! -f "$STATE_FILE" ]]; then + exit 0 # Plugin not configured, skip +fi + +# Parse YAML frontmatter (between --- markers) +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$STATE_FILE") + +# Extract individual fields +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//' | sed 's/^"\(.*\)"$/\1/') +STRICT_MODE=$(echo "$FRONTMATTER" | grep '^strict_mode:' | sed 's/strict_mode: *//' | sed 's/^"\(.*\)"$/\1/') + +# Check if enabled +if [[ "$ENABLED" != "true" ]]; then + exit 0 # Disabled +fi + +# Use configuration in hook logic +if [[ "$STRICT_MODE" == "true" ]]; then + # Apply strict validation + # ... +fi +``` + +See `examples/read-settings-hook.sh` for complete working example. + +### From Commands + +Commands can read settings files to customize behavior: + +```markdown +--- +description: Process data with plugin +allowed-tools: ["Read", "Bash"] +--- + +# Process Command + +Steps: +1. Check if settings exist at `.claude/my-plugin.local.md` +2. Read configuration using Read tool +3. Parse YAML frontmatter to extract settings +4. Apply settings to processing logic +5. Execute with configured behavior +``` + +### From Agents + +Agents can reference settings in their instructions: + +```markdown +--- +name: configured-agent +description: Agent that adapts to project settings +--- + +Check for plugin settings at `.claude/my-plugin.local.md`. +If present, parse YAML frontmatter and adapt behavior according to: +- enabled: Whether plugin is active +- mode: Processing mode (strict, standard, lenient) +- Additional configuration fields +``` + +## Parsing Techniques + +### Extract Frontmatter + +```bash +# Extract everything between --- markers +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") +``` + +### Read Individual Fields + +**String fields:** +```bash +VALUE=$(echo "$FRONTMATTER" | grep '^field_name:' | sed 's/field_name: *//' | sed 's/^"\(.*\)"$/\1/') +``` + +**Boolean fields:** +```bash +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') +# Compare: if [[ "$ENABLED" == "true" ]]; then +``` + +**Numeric fields:** +```bash +MAX=$(echo "$FRONTMATTER" | grep '^max_value:' | sed 's/max_value: *//') +# Use: if [[ $MAX -gt 100 ]]; then +``` + +### Read Markdown Body + +Extract content after second `---`: + +```bash +# Get everything after closing --- +BODY=$(awk '/^---$/{i++; next} i>=2' "$FILE") +``` + +## Common Patterns + +### Pattern 1: Temporarily Active Hooks + +Use settings file to control hook activation: + +```bash +#!/bin/bash +STATE_FILE=".claude/security-scan.local.md" + +# Quick exit if not configured +if [[ ! -f "$STATE_FILE" ]]; then + exit 0 +fi + +# Read enabled flag +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$STATE_FILE") +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + +if [[ "$ENABLED" != "true" ]]; then + exit 0 # Disabled +fi + +# Run hook logic +# ... +``` + +**Use case:** Enable/disable hooks without editing hooks.json (requires restart). + +### Pattern 2: Agent State Management + +Store agent-specific state and configuration: + +**.claude/multi-agent-swarm.local.md:** +```markdown +--- +agent_name: auth-agent +task_number: 3.5 +pr_number: 1234 +coordinator_session: team-leader +enabled: true +dependencies: ["Task 3.4"] +--- + +# Task Assignment + +Implement JWT authentication for the API. + +**Success Criteria:** +- Authentication endpoints created +- Tests passing +- PR created and CI green +``` + +Read from hooks to coordinate agents: + +```bash +AGENT_NAME=$(echo "$FRONTMATTER" | grep '^agent_name:' | sed 's/agent_name: *//') +COORDINATOR=$(echo "$FRONTMATTER" | grep '^coordinator_session:' | sed 's/coordinator_session: *//') + +# Send notification to coordinator +tmux send-keys -t "$COORDINATOR" "Agent $AGENT_NAME completed task" Enter +``` + +### Pattern 3: Configuration-Driven Behavior + +**.claude/my-plugin.local.md:** +```markdown +--- +validation_level: strict +max_file_size: 1000000 +allowed_extensions: [".js", ".ts", ".tsx"] +enable_logging: true +--- + +# Validation Configuration + +Strict mode enabled for this project. +All writes validated against security policies. +``` + +Use in hooks or commands: + +```bash +LEVEL=$(echo "$FRONTMATTER" | grep '^validation_level:' | sed 's/validation_level: *//') + +case "$LEVEL" in + strict) + # Apply strict validation + ;; + standard) + # Apply standard validation + ;; + lenient) + # Apply lenient validation + ;; +esac +``` + +## Creating Settings Files + +### From Commands + +Commands can create settings files: + +```markdown +# Setup Command + +Steps: +1. Ask user for configuration preferences +2. Create `.claude/my-plugin.local.md` with YAML frontmatter +3. Set appropriate values based on user input +4. Inform user that settings are saved +5. Remind user to restart Claude Code for hooks to recognize changes +``` + +### Template Generation + +Provide template in plugin README: + +```markdown +## Configuration + +Create `.claude/my-plugin.local.md` in your project: + +\`\`\`markdown +--- +enabled: true +mode: standard +max_retries: 3 +--- + +# Plugin Configuration + +Your settings are active. +\`\`\` + +After creating or editing, restart Claude Code for changes to take effect. +``` + +## Best Practices + +### File Naming + +✅ **DO:** +- Use `.claude/plugin-name.local.md` format +- Match plugin name exactly +- Use `.local.md` suffix for user-local files + +❌ **DON'T:** +- Use different directory (not `.claude/`) +- Use inconsistent naming +- Use `.md` without `.local` (might be committed) + +### Gitignore + +Always add to `.gitignore`: + +```gitignore +.claude/*.local.md +.claude/*.local.json +``` + +Document this in plugin README. + +### Defaults + +Provide sensible defaults when settings file doesn't exist: + +```bash +if [[ ! -f "$STATE_FILE" ]]; then + # Use defaults + ENABLED=true + MODE=standard +else + # Read from file + # ... +fi +``` + +### Validation + +Validate settings values: + +```bash +MAX=$(echo "$FRONTMATTER" | grep '^max_value:' | sed 's/max_value: *//') + +# Validate numeric range +if ! [[ "$MAX" =~ ^[0-9]+$ ]] || [[ $MAX -lt 1 ]] || [[ $MAX -gt 100 ]]; then + echo "⚠️ Invalid max_value in settings (must be 1-100)" >&2 + MAX=10 # Use default +fi +``` + +### Restart Requirement + +**Important:** Settings changes require Claude Code restart. + +Document in your README: + +```markdown +## Changing Settings + +After editing `.claude/my-plugin.local.md`: +1. Save the file +2. Exit Claude Code +3. Restart: `claude` or `cc` +4. New settings will be loaded +``` + +Hooks cannot be hot-swapped within a session. + +## Security Considerations + +### Sanitize User Input + +When writing settings files from user input: + +```bash +# Escape quotes in user input +SAFE_VALUE=$(echo "$USER_INPUT" | sed 's/"/\\"/g') + +# Write to file +cat > "$STATE_FILE" <&2 + exit 2 +fi +``` + +### Permissions + +Settings files should be: +- Readable by user only (`chmod 600`) +- Not committed to git +- Not shared between users + +## Real-World Examples + +### multi-agent-swarm Plugin + +**.claude/multi-agent-swarm.local.md:** +```markdown +--- +agent_name: auth-implementation +task_number: 3.5 +pr_number: 1234 +coordinator_session: team-leader +enabled: true +dependencies: ["Task 3.4"] +additional_instructions: Use JWT tokens, not sessions +--- + +# Task: Implement Authentication + +Build JWT-based authentication for the REST API. +Coordinate with auth-agent on shared types. +``` + +**Hook usage (agent-stop-notification.sh):** +- Checks if file exists (line 15-18: quick exit if not) +- Parses frontmatter to get coordinator_session, agent_name, enabled +- Sends notifications to coordinator if enabled +- Allows quick activation/deactivation via `enabled: true/false` + +### ralph-wiggum Plugin + +**.claude/ralph-loop.local.md:** +```markdown +--- +iteration: 1 +max_iterations: 10 +completion_promise: "All tests passing and build successful" +--- + +Fix all the linting errors in the project. +Make sure tests pass after each fix. +``` + +**Hook usage (stop-hook.sh):** +- Checks if file exists (line 15-18: quick exit if not active) +- Reads iteration count and max_iterations +- Extracts completion_promise for loop termination +- Reads body as the prompt to feed back +- Updates iteration count on each loop + +## Quick Reference + +### File Location + +``` +project-root/ +└── .claude/ + └── plugin-name.local.md +``` + +### Frontmatter Parsing + +```bash +# Extract frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") + +# Read field +VALUE=$(echo "$FRONTMATTER" | grep '^field:' | sed 's/field: *//' | sed 's/^"\(.*\)"$/\1/') +``` + +### Body Parsing + +```bash +# Extract body (after second ---) +BODY=$(awk '/^---$/{i++; next} i>=2' "$FILE") +``` + +### Quick Exit Pattern + +```bash +if [[ ! -f ".claude/my-plugin.local.md" ]]; then + exit 0 # Not configured +fi +``` + +## Additional Resources + +### Reference Files + +For detailed implementation patterns: + +- **`references/parsing-techniques.md`** - Complete guide to parsing YAML frontmatter and markdown bodies +- **`references/real-world-examples.md`** - Deep dive into multi-agent-swarm and ralph-wiggum implementations + +### Example Files + +Working examples in `examples/`: + +- **`read-settings-hook.sh`** - Hook that reads and uses settings +- **`create-settings-command.md`** - Command that creates settings file +- **`example-settings.md`** - Template settings file + +### Utility Scripts + +Development tools in `scripts/`: + +- **`validate-settings.sh`** - Validate settings file structure +- **`parse-frontmatter.sh`** - Extract frontmatter fields + +## Implementation Workflow + +To add settings to a plugin: + +1. Design settings schema (which fields, types, defaults) +2. Create template file in plugin documentation +3. Add gitignore entry for `.claude/*.local.md` +4. Implement settings parsing in hooks/commands +5. Use quick-exit pattern (check file exists, check enabled field) +6. Document settings in plugin README with template +7. Remind users that changes require Claude Code restart + +Focus on keeping settings simple and providing good defaults when settings file doesn't exist. diff --git a/skills/external/plugin-dev-plugin-settings/examples/create-settings-command.md b/skills/external/plugin-dev-plugin-settings/examples/create-settings-command.md new file mode 100644 index 0000000..987e9a1 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/examples/create-settings-command.md @@ -0,0 +1,98 @@ +--- +description: "Create plugin settings file with user preferences" +allowed-tools: ["Write", "AskUserQuestion"] +--- + +# Create Plugin Settings + +This command helps users create a `.claude/my-plugin.local.md` settings file. + +## Steps + +### Step 1: Ask User for Preferences + +Use AskUserQuestion to gather configuration: + +```json +{ + "questions": [ + { + "question": "Enable plugin for this project?", + "header": "Enable Plugin", + "multiSelect": false, + "options": [ + { + "label": "Yes", + "description": "Plugin will be active" + }, + { + "label": "No", + "description": "Plugin will be disabled" + } + ] + }, + { + "question": "Validation mode?", + "header": "Mode", + "multiSelect": false, + "options": [ + { + "label": "Strict", + "description": "Maximum validation and security checks" + }, + { + "label": "Standard", + "description": "Balanced validation (recommended)" + }, + { + "label": "Lenient", + "description": "Minimal validation only" + } + ] + } + ] +} +``` + +### Step 2: Parse Answers + +Extract answers from AskUserQuestion result: + +- answers["0"]: enabled (Yes/No) +- answers["1"]: mode (Strict/Standard/Lenient) + +### Step 3: Create Settings File + +Use Write tool to create `.claude/my-plugin.local.md`: + +```markdown +--- +enabled: +validation_mode: +max_file_size: 1000000 +notify_on_errors: true +--- + +# Plugin Configuration + +Your plugin is configured with validation mode. + +To modify settings, edit this file and restart Claude Code. +``` + +### Step 4: Inform User + +Tell the user: +- Settings file created at `.claude/my-plugin.local.md` +- Current configuration summary +- How to edit manually if needed +- Reminder: Restart Claude Code for changes to take effect +- Settings file is gitignored (won't be committed) + +## Implementation Notes + +Always validate user input before writing: +- Check mode is valid +- Validate numeric fields are numbers +- Ensure paths don't have traversal attempts +- Sanitize any free-text fields diff --git a/skills/external/plugin-dev-plugin-settings/examples/example-settings.md b/skills/external/plugin-dev-plugin-settings/examples/example-settings.md new file mode 100644 index 0000000..307289d --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/examples/example-settings.md @@ -0,0 +1,159 @@ +# Example Plugin Settings File + +## Template: Basic Configuration + +**.claude/my-plugin.local.md:** + +```markdown +--- +enabled: true +mode: standard +--- + +# My Plugin Configuration + +Plugin is active in standard mode. +``` + +## Template: Advanced Configuration + +**.claude/my-plugin.local.md:** + +```markdown +--- +enabled: true +strict_mode: false +max_file_size: 1000000 +allowed_extensions: [".js", ".ts", ".tsx"] +enable_logging: true +notification_level: info +retry_attempts: 3 +timeout_seconds: 60 +custom_path: "/path/to/data" +--- + +# My Plugin Advanced Configuration + +This project uses custom plugin configuration with: +- Standard validation mode +- 1MB file size limit +- JavaScript/TypeScript files allowed +- Info-level logging +- 3 retry attempts + +## Additional Notes + +Contact @team-lead with questions about this configuration. +``` + +## Template: Agent State File + +**.claude/multi-agent-swarm.local.md:** + +```markdown +--- +agent_name: database-implementation +task_number: 4.2 +pr_number: 5678 +coordinator_session: team-leader +enabled: true +dependencies: ["Task 3.5", "Task 4.1"] +additional_instructions: "Use PostgreSQL, not MySQL" +--- + +# Task Assignment: Database Schema Implementation + +Implement the database schema for the new features module. + +## Requirements + +- Create migration files +- Add indexes for performance +- Write tests for constraints +- Document schema in README + +## Success Criteria + +- Migrations run successfully +- All tests pass +- PR created with CI green +- Schema documented + +## Coordination + +Depends on: +- Task 3.5: API endpoint definitions +- Task 4.1: Data model design + +Report status to coordinator session 'team-leader'. +``` + +## Template: Feature Flag Pattern + +**.claude/experimental-features.local.md:** + +```markdown +--- +enabled: true +features: + - ai_suggestions + - auto_formatting + - advanced_refactoring +experimental_mode: false +--- + +# Experimental Features Configuration + +Current enabled features: +- AI-powered code suggestions +- Automatic code formatting +- Advanced refactoring tools + +Experimental mode is OFF (stable features only). +``` + +## Usage in Hooks + +These templates can be read by hooks: + +```bash +# Check if plugin is configured +if [[ ! -f ".claude/my-plugin.local.md" ]]; then + exit 0 # Not configured, skip hook +fi + +# Read settings +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' ".claude/my-plugin.local.md") +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + +# Apply settings +if [[ "$ENABLED" == "true" ]]; then + # Hook is active + # ... +fi +``` + +## Gitignore + +Always add to project `.gitignore`: + +```gitignore +# Plugin settings (user-local, not committed) +.claude/*.local.md +.claude/*.local.json +``` + +## Editing Settings + +Users can edit settings files manually: + +```bash +# Edit settings +vim .claude/my-plugin.local.md + +# Changes take effect after restart +exit # Exit Claude Code +claude # Restart +``` + +Changes require Claude Code restart - hooks can't be hot-swapped. diff --git a/skills/external/plugin-dev-plugin-settings/examples/read-settings-hook.sh b/skills/external/plugin-dev-plugin-settings/examples/read-settings-hook.sh new file mode 100755 index 0000000..8f84ed6 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/examples/read-settings-hook.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Example hook that reads plugin settings from .claude/my-plugin.local.md +# Demonstrates the complete pattern for settings-driven hook behavior + +set -euo pipefail + +# Define settings file path +SETTINGS_FILE=".claude/my-plugin.local.md" + +# Quick exit if settings file doesn't exist +if [[ ! -f "$SETTINGS_FILE" ]]; then + # Plugin not configured - use defaults or skip + exit 0 +fi + +# Parse YAML frontmatter (everything between --- markers) +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SETTINGS_FILE") + +# Extract configuration fields +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//' | sed 's/^"\(.*\)"$/\1/') +STRICT_MODE=$(echo "$FRONTMATTER" | grep '^strict_mode:' | sed 's/strict_mode: *//' | sed 's/^"\(.*\)"$/\1/') +MAX_SIZE=$(echo "$FRONTMATTER" | grep '^max_file_size:' | sed 's/max_file_size: *//') + +# Quick exit if disabled +if [[ "$ENABLED" != "true" ]]; then + exit 0 +fi + +# Read hook input +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty') + +# Apply configured validation +if [[ "$STRICT_MODE" == "true" ]]; then + # Strict mode: apply all checks + if [[ "$file_path" == *".."* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Path traversal blocked (strict mode)"}' >&2 + exit 2 + fi + + if [[ "$file_path" == *".env"* ]] || [[ "$file_path" == *"secret"* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "Sensitive file blocked (strict mode)"}' >&2 + exit 2 + fi +else + # Standard mode: basic checks only + if [[ "$file_path" == "/etc/"* ]] || [[ "$file_path" == "/sys/"* ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "System path blocked"}' >&2 + exit 2 + fi +fi + +# Check file size if configured +if [[ -n "$MAX_SIZE" ]] && [[ "$MAX_SIZE" =~ ^[0-9]+$ ]]; then + content=$(echo "$input" | jq -r '.tool_input.content // empty') + content_size=${#content} + + if [[ $content_size -gt $MAX_SIZE ]]; then + echo '{"hookSpecificOutput": {"permissionDecision": "deny"}, "systemMessage": "File exceeds configured max size: '"$MAX_SIZE"' bytes"}' >&2 + exit 2 + fi +fi + +# All checks passed +exit 0 diff --git a/skills/external/plugin-dev-plugin-settings/references/parsing-techniques.md b/skills/external/plugin-dev-plugin-settings/references/parsing-techniques.md new file mode 100644 index 0000000..7e83ae8 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/references/parsing-techniques.md @@ -0,0 +1,549 @@ +# Settings File Parsing Techniques + +Complete guide to parsing `.claude/plugin-name.local.md` files in bash scripts. + +## File Structure + +Settings files use markdown with YAML frontmatter: + +```markdown +--- +field1: value1 +field2: "value with spaces" +numeric_field: 42 +boolean_field: true +list_field: ["item1", "item2", "item3"] +--- + +# Markdown Content + +This body content can be extracted separately. +It's useful for prompts, documentation, or additional context. +``` + +## Parsing Frontmatter + +### Extract Frontmatter Block + +```bash +#!/bin/bash +FILE=".claude/my-plugin.local.md" + +# Extract everything between --- markers (excluding the markers themselves) +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") +``` + +**How it works:** +- `sed -n` - Suppress automatic printing +- `/^---$/,/^---$/` - Range from first `---` to second `---` +- `{ /^---$/d; p; }` - Delete the `---` lines, print everything else + +### Extract Individual Fields + +**String fields:** +```bash +# Simple value +VALUE=$(echo "$FRONTMATTER" | grep '^field_name:' | sed 's/field_name: *//') + +# Quoted value (removes surrounding quotes) +VALUE=$(echo "$FRONTMATTER" | grep '^field_name:' | sed 's/field_name: *//' | sed 's/^"\(.*\)"$/\1/') +``` + +**Boolean fields:** +```bash +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + +# Use in condition +if [[ "$ENABLED" == "true" ]]; then + # Enabled +fi +``` + +**Numeric fields:** +```bash +MAX=$(echo "$FRONTMATTER" | grep '^max_value:' | sed 's/max_value: *//') + +# Validate it's a number +if [[ "$MAX" =~ ^[0-9]+$ ]]; then + # Use in numeric comparison + if [[ $MAX -gt 100 ]]; then + # Too large + fi +fi +``` + +**List fields (simple):** +```bash +# YAML: list: ["item1", "item2", "item3"] +LIST=$(echo "$FRONTMATTER" | grep '^list:' | sed 's/list: *//') +# Result: ["item1", "item2", "item3"] + +# For simple checks: +if [[ "$LIST" == *"item1"* ]]; then + # List contains item1 +fi +``` + +**List fields (proper parsing with jq):** +```bash +# For proper list handling, use yq or convert to JSON +# This requires yq to be installed (brew install yq) + +# Extract list as JSON array +LIST=$(echo "$FRONTMATTER" | yq -o json '.list' 2>/dev/null) + +# Iterate over items +echo "$LIST" | jq -r '.[]' | while read -r item; do + echo "Processing: $item" +done +``` + +## Parsing Markdown Body + +### Extract Body Content + +```bash +#!/bin/bash +FILE=".claude/my-plugin.local.md" + +# Extract everything after the closing --- +# Counts --- markers: first is opening, second is closing, everything after is body +BODY=$(awk '/^---$/{i++; next} i>=2' "$FILE") +``` + +**How it works:** +- `/^---$/` - Match `---` lines +- `{i++; next}` - Increment counter and skip the `---` line +- `i>=2` - Print all lines after second `---` + +**Handles edge case:** If `---` appears in the markdown body, it still works because we only count the first two `---` at the start. + +### Use Body as Prompt + +```bash +# Extract body +PROMPT=$(awk '/^---$/{i++; next} i>=2' "$RALPH_STATE_FILE") + +# Feed back to Claude +echo '{"decision": "block", "reason": "'"$PROMPT"'"}' | jq . +``` + +**Important:** Use `jq -n --arg` for safer JSON construction with user content: + +```bash +PROMPT=$(awk '/^---$/{i++; next} i>=2' "$FILE") + +# Safe JSON construction +jq -n --arg prompt "$PROMPT" '{ + "decision": "block", + "reason": $prompt +}' +``` + +## Common Parsing Patterns + +### Pattern: Field with Default + +```bash +VALUE=$(echo "$FRONTMATTER" | grep '^field:' | sed 's/field: *//' | sed 's/^"\(.*\)"$/\1/') + +# Use default if empty +if [[ -z "$VALUE" ]]; then + VALUE="default_value" +fi +``` + +### Pattern: Optional Field + +```bash +OPTIONAL=$(echo "$FRONTMATTER" | grep '^optional_field:' | sed 's/optional_field: *//' | sed 's/^"\(.*\)"$/\1/') + +# Only use if present +if [[ -n "$OPTIONAL" ]] && [[ "$OPTIONAL" != "null" ]]; then + # Field is set, use it + echo "Optional field: $OPTIONAL" +fi +``` + +### Pattern: Multiple Fields at Once + +```bash +# Parse all fields in one pass +while IFS=': ' read -r key value; do + # Remove quotes if present + value=$(echo "$value" | sed 's/^"\(.*\)"$/\1/') + + case "$key" in + enabled) + ENABLED="$value" + ;; + mode) + MODE="$value" + ;; + max_size) + MAX_SIZE="$value" + ;; + esac +done <<< "$FRONTMATTER" +``` + +## Updating Settings Files + +### Atomic Updates + +Always use temp file + atomic move to prevent corruption: + +```bash +#!/bin/bash +FILE=".claude/my-plugin.local.md" +NEW_VALUE="updated_value" + +# Create temp file +TEMP_FILE="${FILE}.tmp.$$" + +# Update field using sed +sed "s/^field_name: .*/field_name: $NEW_VALUE/" "$FILE" > "$TEMP_FILE" + +# Atomic replace +mv "$TEMP_FILE" "$FILE" +``` + +### Update Single Field + +```bash +# Increment iteration counter +CURRENT=$(echo "$FRONTMATTER" | grep '^iteration:' | sed 's/iteration: *//') +NEXT=$((CURRENT + 1)) + +# Update file +TEMP_FILE="${FILE}.tmp.$$" +sed "s/^iteration: .*/iteration: $NEXT/" "$FILE" > "$TEMP_FILE" +mv "$TEMP_FILE" "$FILE" +``` + +### Update Multiple Fields + +```bash +# Update several fields at once +TEMP_FILE="${FILE}.tmp.$$" + +sed -e "s/^iteration: .*/iteration: $NEXT_ITERATION/" \ + -e "s/^pr_number: .*/pr_number: $PR_NUMBER/" \ + -e "s/^status: .*/status: $NEW_STATUS/" \ + "$FILE" > "$TEMP_FILE" + +mv "$TEMP_FILE" "$FILE" +``` + +## Validation Techniques + +### Validate File Exists and Is Readable + +```bash +FILE=".claude/my-plugin.local.md" + +if [[ ! -f "$FILE" ]]; then + echo "Settings file not found" >&2 + exit 1 +fi + +if [[ ! -r "$FILE" ]]; then + echo "Settings file not readable" >&2 + exit 1 +fi +``` + +### Validate Frontmatter Structure + +```bash +# Count --- markers (should be exactly 2 at start) +MARKER_COUNT=$(grep -c '^---$' "$FILE" 2>/dev/null || echo "0") + +if [[ $MARKER_COUNT -lt 2 ]]; then + echo "Invalid settings file: missing frontmatter markers" >&2 + exit 1 +fi +``` + +### Validate Field Values + +```bash +MODE=$(echo "$FRONTMATTER" | grep '^mode:' | sed 's/mode: *//') + +case "$MODE" in + strict|standard|lenient) + # Valid mode + ;; + *) + echo "Invalid mode: $MODE (must be strict, standard, or lenient)" >&2 + exit 1 + ;; +esac +``` + +### Validate Numeric Ranges + +```bash +MAX_SIZE=$(echo "$FRONTMATTER" | grep '^max_size:' | sed 's/max_size: *//') + +if ! [[ "$MAX_SIZE" =~ ^[0-9]+$ ]]; then + echo "max_size must be a number" >&2 + exit 1 +fi + +if [[ $MAX_SIZE -lt 1 ]] || [[ $MAX_SIZE -gt 10000000 ]]; then + echo "max_size out of range (1-10000000)" >&2 + exit 1 +fi +``` + +## Edge Cases and Gotchas + +### Quotes in Values + +YAML allows both quoted and unquoted strings: + +```yaml +# These are equivalent: +field1: value +field2: "value" +field3: 'value' +``` + +**Handle both:** +```bash +# Remove surrounding quotes if present +VALUE=$(echo "$FRONTMATTER" | grep '^field:' | sed 's/field: *//' | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\\(.*\\)'$/\\1/") +``` + +### --- in Markdown Body + +If the markdown body contains `---`, the parsing still works because we only match the first two: + +```markdown +--- +field: value +--- + +# Body + +Here's a separator: +--- + +More content after the separator. +``` + +The `awk '/^---$/{i++; next} i>=2'` pattern handles this correctly. + +### Empty Values + +Handle missing or empty fields: + +```yaml +field1: +field2: "" +field3: null +``` + +**Parsing:** +```bash +VALUE=$(echo "$FRONTMATTER" | grep '^field1:' | sed 's/field1: *//') +# VALUE will be empty string + +# Check for empty/null +if [[ -z "$VALUE" ]] || [[ "$VALUE" == "null" ]]; then + VALUE="default" +fi +``` + +### Special Characters + +Values with special characters need careful handling: + +```yaml +message: "Error: Something went wrong!" +path: "/path/with spaces/file.txt" +regex: "^[a-zA-Z0-9_]+$" +``` + +**Safe parsing:** +```bash +# Always quote variables when using +MESSAGE=$(echo "$FRONTMATTER" | grep '^message:' | sed 's/message: *//' | sed 's/^"\(.*\)"$/\1/') + +echo "Message: $MESSAGE" # Quoted! +``` + +## Performance Optimization + +### Cache Parsed Values + +If reading settings multiple times: + +```bash +# Parse once +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") + +# Extract multiple fields from cached frontmatter +FIELD1=$(echo "$FRONTMATTER" | grep '^field1:' | sed 's/field1: *//') +FIELD2=$(echo "$FRONTMATTER" | grep '^field2:' | sed 's/field2: *//') +FIELD3=$(echo "$FRONTMATTER" | grep '^field3:' | sed 's/field3: *//') +``` + +**Don't:** Re-parse file for each field. + +### Lazy Loading + +Only parse settings when needed: + +```bash +#!/bin/bash +input=$(cat) + +# Quick checks first (no file I/O) +tool_name=$(echo "$input" | jq -r '.tool_name') +if [[ "$tool_name" != "Write" ]]; then + exit 0 # Not a write operation, skip +fi + +# Only now check settings file +if [[ -f ".claude/my-plugin.local.md" ]]; then + # Parse settings + # ... +fi +``` + +## Debugging + +### Print Parsed Values + +```bash +#!/bin/bash +set -x # Enable debug tracing + +FILE=".claude/my-plugin.local.md" + +if [[ -f "$FILE" ]]; then + echo "Settings file found" >&2 + + FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") + echo "Frontmatter:" >&2 + echo "$FRONTMATTER" >&2 + + ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + echo "Enabled: $ENABLED" >&2 +fi +``` + +### Validate Parsing + +```bash +# Show what was parsed +echo "Parsed values:" >&2 +echo " enabled: $ENABLED" >&2 +echo " mode: $MODE" >&2 +echo " max_size: $MAX_SIZE" >&2 + +# Verify expected values +if [[ "$ENABLED" != "true" ]] && [[ "$ENABLED" != "false" ]]; then + echo "⚠️ Unexpected enabled value: $ENABLED" >&2 +fi +``` + +## Alternative: Using yq + +For complex YAML, consider using `yq`: + +```bash +# Install: brew install yq + +# Parse YAML properly +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") + +# Extract fields with yq +ENABLED=$(echo "$FRONTMATTER" | yq '.enabled') +MODE=$(echo "$FRONTMATTER" | yq '.mode') +LIST=$(echo "$FRONTMATTER" | yq -o json '.list_field') + +# Iterate list properly +echo "$LIST" | jq -r '.[]' | while read -r item; do + echo "Item: $item" +done +``` + +**Pros:** +- Proper YAML parsing +- Handles complex structures +- Better list/object support + +**Cons:** +- Requires yq installation +- Additional dependency +- May not be available on all systems + +**Recommendation:** Use sed/grep for simple fields, yq for complex structures. + +## Complete Example + +```bash +#!/bin/bash +set -euo pipefail + +# Configuration +SETTINGS_FILE=".claude/my-plugin.local.md" + +# Quick exit if not configured +if [[ ! -f "$SETTINGS_FILE" ]]; then + # Use defaults + ENABLED=true + MODE=standard + MAX_SIZE=1000000 +else + # Parse frontmatter + FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SETTINGS_FILE") + + # Extract fields with defaults + ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + ENABLED=${ENABLED:-true} + + MODE=$(echo "$FRONTMATTER" | grep '^mode:' | sed 's/mode: *//' | sed 's/^"\(.*\)"$/\1/') + MODE=${MODE:-standard} + + MAX_SIZE=$(echo "$FRONTMATTER" | grep '^max_size:' | sed 's/max_size: *//') + MAX_SIZE=${MAX_SIZE:-1000000} + + # Validate values + if [[ "$ENABLED" != "true" ]] && [[ "$ENABLED" != "false" ]]; then + echo "⚠️ Invalid enabled value, using default" >&2 + ENABLED=true + fi + + if ! [[ "$MAX_SIZE" =~ ^[0-9]+$ ]]; then + echo "⚠️ Invalid max_size, using default" >&2 + MAX_SIZE=1000000 + fi +fi + +# Quick exit if disabled +if [[ "$ENABLED" != "true" ]]; then + exit 0 +fi + +# Use configuration +echo "Configuration loaded: mode=$MODE, max_size=$MAX_SIZE" >&2 + +# Apply logic based on settings +case "$MODE" in + strict) + # Strict validation + ;; + standard) + # Standard validation + ;; + lenient) + # Lenient validation + ;; +esac +``` + +This provides robust settings handling with defaults, validation, and error recovery. diff --git a/skills/external/plugin-dev-plugin-settings/references/real-world-examples.md b/skills/external/plugin-dev-plugin-settings/references/real-world-examples.md new file mode 100644 index 0000000..b62a910 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/references/real-world-examples.md @@ -0,0 +1,395 @@ +# Real-World Plugin Settings Examples + +Detailed analysis of how production plugins use the `.claude/plugin-name.local.md` pattern. + +## multi-agent-swarm Plugin + +### Settings File Structure + +**.claude/multi-agent-swarm.local.md:** + +```markdown +--- +agent_name: auth-implementation +task_number: 3.5 +pr_number: 1234 +coordinator_session: team-leader +enabled: true +dependencies: ["Task 3.4"] +additional_instructions: "Use JWT tokens, not sessions" +--- + +# Task: Implement Authentication + +Build JWT-based authentication for the REST API. + +## Requirements +- JWT token generation and validation +- Refresh token flow +- Secure password hashing + +## Success Criteria +- Auth endpoints implemented +- Tests passing (100% coverage) +- PR created and CI green +- Documentation updated + +## Coordination +Depends on Task 3.4 (user model). +Report status to 'team-leader' session. +``` + +### How It's Used + +**File:** `hooks/agent-stop-notification.sh` + +**Purpose:** Send notifications to coordinator when agent becomes idle + +**Implementation:** + +```bash +#!/bin/bash +set -euo pipefail + +SWARM_STATE_FILE=".claude/multi-agent-swarm.local.md" + +# Quick exit if no swarm active +if [[ ! -f "$SWARM_STATE_FILE" ]]; then + exit 0 +fi + +# Parse frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SWARM_STATE_FILE") + +# Extract configuration +COORDINATOR_SESSION=$(echo "$FRONTMATTER" | grep '^coordinator_session:' | sed 's/coordinator_session: *//' | sed 's/^"\(.*\)"$/\1/') +AGENT_NAME=$(echo "$FRONTMATTER" | grep '^agent_name:' | sed 's/agent_name: *//' | sed 's/^"\(.*\)"$/\1/') +TASK_NUMBER=$(echo "$FRONTMATTER" | grep '^task_number:' | sed 's/task_number: *//' | sed 's/^"\(.*\)"$/\1/') +PR_NUMBER=$(echo "$FRONTMATTER" | grep '^pr_number:' | sed 's/pr_number: *//' | sed 's/^"\(.*\)"$/\1/') +ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//') + +# Check if enabled +if [[ "$ENABLED" != "true" ]]; then + exit 0 +fi + +# Send notification to coordinator +NOTIFICATION="🤖 Agent ${AGENT_NAME} (Task ${TASK_NUMBER}, PR #${PR_NUMBER}) is idle." + +if tmux has-session -t "$COORDINATOR_SESSION" 2>/dev/null; then + tmux send-keys -t "$COORDINATOR_SESSION" "$NOTIFICATION" Enter + sleep 0.5 + tmux send-keys -t "$COORDINATOR_SESSION" Enter +fi + +exit 0 +``` + +**Key patterns:** +1. **Quick exit** (line 7-9): Returns immediately if file doesn't exist +2. **Field extraction** (lines 11-17): Parses each frontmatter field +3. **Enabled check** (lines 19-21): Respects enabled flag +4. **Action based on settings** (lines 23-29): Uses coordinator_session to send notification + +### Creation + +**File:** `commands/launch-swarm.md` + +Settings files are created during swarm launch with: + +```bash +cat > "$WORKTREE_PATH/.claude/multi-agent-swarm.local.md" < temp.md +mv temp.md ".claude/multi-agent-swarm.local.md" +``` + +## ralph-wiggum Plugin + +### Settings File Structure + +**.claude/ralph-loop.local.md:** + +```markdown +--- +iteration: 1 +max_iterations: 10 +completion_promise: "All tests passing and build successful" +started_at: "2025-01-15T14:30:00Z" +--- + +Fix all the linting errors in the project. +Make sure tests pass after each fix. +Document any changes needed in CLAUDE.md. +``` + +### How It's Used + +**File:** `hooks/stop-hook.sh` + +**Purpose:** Prevent session exit and loop Claude's output back as input + +**Implementation:** + +```bash +#!/bin/bash +set -euo pipefail + +RALPH_STATE_FILE=".claude/ralph-loop.local.md" + +# Quick exit if no active loop +if [[ ! -f "$RALPH_STATE_FILE" ]]; then + exit 0 +fi + +# Parse frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$RALPH_STATE_FILE") + +# Extract configuration +ITERATION=$(echo "$FRONTMATTER" | grep '^iteration:' | sed 's/iteration: *//') +MAX_ITERATIONS=$(echo "$FRONTMATTER" | grep '^max_iterations:' | sed 's/max_iterations: *//') +COMPLETION_PROMISE=$(echo "$FRONTMATTER" | grep '^completion_promise:' | sed 's/completion_promise: *//' | sed 's/^"\(.*\)"$/\1/') + +# Check max iterations +if [[ $MAX_ITERATIONS -gt 0 ]] && [[ $ITERATION -ge $MAX_ITERATIONS ]]; then + echo "🛑 Ralph loop: Max iterations ($MAX_ITERATIONS) reached." + rm "$RALPH_STATE_FILE" + exit 0 +fi + +# Get transcript and check for completion promise +TRANSCRIPT_PATH=$(echo "$HOOK_INPUT" | jq -r '.transcript_path') +LAST_OUTPUT=$(grep '"role":"assistant"' "$TRANSCRIPT_PATH" | tail -1 | jq -r '.message.content | map(select(.type == "text")) | map(.text) | join("\n")') + +# Check for completion +if [[ "$COMPLETION_PROMISE" != "null" ]] && [[ -n "$COMPLETION_PROMISE" ]]; then + PROMISE_TEXT=$(echo "$LAST_OUTPUT" | perl -0777 -pe 's/.*?(.*?)<\/promise>.*/$1/s; s/^\s+|\s+$//g') + + if [[ "$PROMISE_TEXT" = "$COMPLETION_PROMISE" ]]; then + echo "✅ Ralph loop: Detected completion" + rm "$RALPH_STATE_FILE" + exit 0 + fi +fi + +# Continue loop - increment iteration +NEXT_ITERATION=$((ITERATION + 1)) + +# Extract prompt from markdown body +PROMPT_TEXT=$(awk '/^---$/{i++; next} i>=2' "$RALPH_STATE_FILE") + +# Update iteration counter +TEMP_FILE="${RALPH_STATE_FILE}.tmp.$$" +sed "s/^iteration: .*/iteration: $NEXT_ITERATION/" "$RALPH_STATE_FILE" > "$TEMP_FILE" +mv "$TEMP_FILE" "$RALPH_STATE_FILE" + +# Block exit and feed prompt back +jq -n \ + --arg prompt "$PROMPT_TEXT" \ + --arg msg "🔄 Ralph iteration $NEXT_ITERATION" \ + '{ + "decision": "block", + "reason": $prompt, + "systemMessage": $msg + }' + +exit 0 +``` + +**Key patterns:** +1. **Quick exit** (line 7-9): Skip if not active +2. **Iteration tracking** (lines 11-20): Count and enforce max iterations +3. **Promise detection** (lines 25-33): Check for completion signal in output +4. **Prompt extraction** (line 38): Read markdown body as next prompt +5. **State update** (lines 40-43): Increment iteration atomically +6. **Loop continuation** (lines 45-53): Block exit and feed prompt back + +### Creation + +**File:** `scripts/setup-ralph-loop.sh` + +```bash +#!/bin/bash +PROMPT="$1" +MAX_ITERATIONS="${2:-0}" +COMPLETION_PROMISE="${3:-}" + +# Create state file +cat > ".claude/ralph-loop.local.md" < "$TEMP_FILE" +mv "$TEMP_FILE" "$FILE" +``` + +**Why:** Prevents corruption if process is interrupted. + +### 4. Quote Handling + +Both strip surrounding quotes from YAML values: + +```bash +sed 's/^"\(.*\)"$/\1/' +``` + +**Why:** YAML allows both `field: value` and `field: "value"`. + +### 5. Error Handling + +Both handle missing/corrupt files gracefully: + +```bash +if [[ ! -f "$FILE" ]]; then + exit 0 # No error, just not configured +fi + +if [[ -z "$CRITICAL_FIELD" ]]; then + echo "Settings file corrupt" >&2 + rm "$FILE" # Clean up + exit 0 +fi +``` + +**Why:** Fails gracefully instead of crashing. + +## Anti-Patterns to Avoid + +### ❌ Hardcoded Paths + +```bash +# BAD +FILE="/Users/alice/.claude/my-plugin.local.md" + +# GOOD +FILE=".claude/my-plugin.local.md" +``` + +### ❌ Unquoted Variables + +```bash +# BAD +echo $VALUE + +# GOOD +echo "$VALUE" +``` + +### ❌ Non-Atomic Updates + +```bash +# BAD: Can corrupt file if interrupted +sed -i "s/field: .*/field: $VALUE/" "$FILE" + +# GOOD: Atomic +TEMP_FILE="${FILE}.tmp.$$" +sed "s/field: .*/field: $VALUE/" "$FILE" > "$TEMP_FILE" +mv "$TEMP_FILE" "$FILE" +``` + +### ❌ No Default Values + +```bash +# BAD: Fails if field missing +if [[ $MAX -gt 100 ]]; then + # MAX might be empty! +fi + +# GOOD: Provide default +MAX=${MAX:-10} +``` + +### ❌ Ignoring Edge Cases + +```bash +# BAD: Assumes exactly 2 --- markers +sed -n '/^---$/,/^---$/{ /^---$/d; p; }' + +# GOOD: Handles --- in body +awk '/^---$/{i++; next} i>=2' # For body +``` + +## Conclusion + +The `.claude/plugin-name.local.md` pattern provides: +- Simple, human-readable configuration +- Version-control friendly (gitignored) +- Per-project settings +- Easy parsing with standard bash tools +- Supports both structured config (YAML) and freeform content (markdown) + +Use this pattern for any plugin that needs user-configurable behavior or state persistence. diff --git a/skills/external/plugin-dev-plugin-settings/scripts/parse-frontmatter.sh b/skills/external/plugin-dev-plugin-settings/scripts/parse-frontmatter.sh new file mode 100755 index 0000000..f247571 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/scripts/parse-frontmatter.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Frontmatter Parser Utility +# Extracts YAML frontmatter from .local.md files + +set -euo pipefail + +# Usage +show_usage() { + echo "Usage: $0 [field-name]" + echo "" + echo "Examples:" + echo " # Show all frontmatter" + echo " $0 .claude/my-plugin.local.md" + echo "" + echo " # Extract specific field" + echo " $0 .claude/my-plugin.local.md enabled" + echo "" + echo " # Extract and use in script" + echo " ENABLED=\$($0 .claude/my-plugin.local.md enabled)" + exit 0 +} + +if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + show_usage +fi + +FILE="$1" +FIELD="${2:-}" + +# Validate file +if [ ! -f "$FILE" ]; then + echo "Error: File not found: $FILE" >&2 + exit 1 +fi + +# Extract frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE") + +if [ -z "$FRONTMATTER" ]; then + echo "Error: No frontmatter found in $FILE" >&2 + exit 1 +fi + +# If no field specified, output all frontmatter +if [ -z "$FIELD" ]; then + echo "$FRONTMATTER" + exit 0 +fi + +# Extract specific field +VALUE=$(echo "$FRONTMATTER" | grep "^${FIELD}:" | sed "s/${FIELD}: *//" | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\\(.*\\)'$/\\1/") + +if [ -z "$VALUE" ]; then + echo "Error: Field '$FIELD' not found in frontmatter" >&2 + exit 1 +fi + +echo "$VALUE" +exit 0 diff --git a/skills/external/plugin-dev-plugin-settings/scripts/validate-settings.sh b/skills/external/plugin-dev-plugin-settings/scripts/validate-settings.sh new file mode 100755 index 0000000..e34e432 --- /dev/null +++ b/skills/external/plugin-dev-plugin-settings/scripts/validate-settings.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Settings File Validator +# Validates .claude/plugin-name.local.md structure + +set -euo pipefail + +# Usage +if [ $# -eq 0 ]; then + echo "Usage: $0 " + echo "" + echo "Validates plugin settings file for:" + echo " - File existence and readability" + echo " - YAML frontmatter structure" + echo " - Required --- markers" + echo " - Field format" + echo "" + echo "Example: $0 .claude/my-plugin.local.md" + exit 1 +fi + +SETTINGS_FILE="$1" + +echo "🔍 Validating settings file: $SETTINGS_FILE" +echo "" + +# Check 1: File exists +if [ ! -f "$SETTINGS_FILE" ]; then + echo "❌ File not found: $SETTINGS_FILE" + exit 1 +fi +echo "✅ File exists" + +# Check 2: File is readable +if [ ! -r "$SETTINGS_FILE" ]; then + echo "❌ File is not readable" + exit 1 +fi +echo "✅ File is readable" + +# Check 3: Has frontmatter markers +MARKER_COUNT=$(grep -c '^---$' "$SETTINGS_FILE" 2>/dev/null || echo "0") + +if [ "$MARKER_COUNT" -lt 2 ]; then + echo "❌ Invalid frontmatter: found $MARKER_COUNT '---' markers (need at least 2)" + echo " Expected format:" + echo " ---" + echo " field: value" + echo " ---" + echo " Content..." + exit 1 +fi +echo "✅ Frontmatter markers present" + +# Check 4: Extract and validate frontmatter +FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SETTINGS_FILE") + +if [ -z "$FRONTMATTER" ]; then + echo "❌ Empty frontmatter (nothing between --- markers)" + exit 1 +fi +echo "✅ Frontmatter not empty" + +# Check 5: Frontmatter has valid YAML-like structure +if ! echo "$FRONTMATTER" | grep -q ':'; then + echo "⚠️ Warning: Frontmatter has no key:value pairs" +fi + +# Check 6: Look for common fields +echo "" +echo "Detected fields:" +echo "$FRONTMATTER" | grep '^[a-z_][a-z0-9_]*:' | while IFS=':' read -r key value; do + echo " - $key: ${value:0:50}" +done + +# Check 7: Validate common boolean fields +for field in enabled strict_mode; do + VALUE=$(echo "$FRONTMATTER" | grep "^${field}:" | sed "s/${field}: *//" || true) + if [ -n "$VALUE" ]; then + if [ "$VALUE" != "true" ] && [ "$VALUE" != "false" ]; then + echo "⚠️ Field '$field' should be boolean (true/false), got: $VALUE" + fi + fi +done + +# Check 8: Check body exists +BODY=$(awk '/^---$/{i++; next} i>=2' "$SETTINGS_FILE") + +echo "" +if [ -n "$BODY" ]; then + BODY_LINES=$(echo "$BODY" | wc -l | tr -d ' ') + echo "✅ Markdown body present ($BODY_LINES lines)" +else + echo "⚠️ No markdown body (frontmatter only)" +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "✅ Settings file structure is valid" +echo "" +echo "Reminder: Changes to this file require restarting Claude Code" +exit 0 diff --git a/skills/external/plugin-dev-plugin-structure/README.md b/skills/external/plugin-dev-plugin-structure/README.md new file mode 100644 index 0000000..3076046 --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/README.md @@ -0,0 +1,109 @@ +# Plugin Structure Skill + +Comprehensive guidance on Claude Code plugin architecture, directory layout, and best practices. + +## Overview + +This skill provides detailed knowledge about: +- Plugin directory structure and organization +- `plugin.json` manifest configuration +- Component organization (commands, agents, skills, hooks) +- Auto-discovery mechanisms +- Portable path references with `${CLAUDE_PLUGIN_ROOT}` +- File naming conventions + +## Skill Structure + +### SKILL.md (1,619 words) + +Core skill content covering: +- Directory structure overview +- Plugin manifest (plugin.json) fields +- Component organization patterns +- ${CLAUDE_PLUGIN_ROOT} usage +- File naming conventions +- Auto-discovery mechanism +- Best practices +- Common patterns +- Troubleshooting + +### References + +Detailed documentation for deep dives: + +- **manifest-reference.md**: Complete `plugin.json` field reference + - All field descriptions and examples + - Path resolution rules + - Validation guidelines + - Minimal vs. complete manifest examples + +- **component-patterns.md**: Advanced organization patterns + - Component lifecycle (discovery, activation) + - Command organization patterns + - Agent organization patterns + - Skill organization patterns + - Hook organization patterns + - Script organization patterns + - Cross-component patterns + - Best practices for scalability + +### Examples + +Three complete plugin examples: + +- **minimal-plugin.md**: Simplest possible plugin + - Single command + - Minimal manifest + - When to use this pattern + +- **standard-plugin.md**: Well-structured production plugin + - Multiple components (commands, agents, skills, hooks) + - Complete manifest with metadata + - Rich skill structure + - Integration between components + +- **advanced-plugin.md**: Enterprise-grade plugin + - Multi-level organization + - MCP server integration + - Shared libraries + - Configuration management + - Security automation + - Monitoring integration + +## When This Skill Triggers + +Claude Code activates this skill when users: +- Ask to "create a plugin" or "scaffold a plugin" +- Need to "understand plugin structure" +- Want to "organize plugin components" +- Need to "set up plugin.json" +- Ask about "${CLAUDE_PLUGIN_ROOT}" usage +- Want to "add commands/agents/skills/hooks" +- Need "configure auto-discovery" help +- Ask about plugin architecture or best practices + +## Progressive Disclosure + +The skill uses progressive disclosure to manage context: + +1. **SKILL.md** (~1600 words): Core concepts and workflows +2. **References** (~6000 words): Detailed field references and patterns +3. **Examples** (~8000 words): Complete working examples + +Claude loads references and examples only as needed based on the task. + +## Related Skills + +This skill works well with: +- **hook-development**: For creating plugin hooks +- **mcp-integration**: For integrating MCP servers (when available) +- **marketplace-publishing**: For publishing plugins (when available) + +## Maintenance + +To update this skill: +1. Keep SKILL.md lean and focused on core concepts +2. Move detailed information to references/ +3. Add new examples/ for common patterns +4. Update version in SKILL.md frontmatter +5. Ensure all documentation uses imperative/infinitive form diff --git a/skills/external/plugin-dev-plugin-structure/SKILL.md b/skills/external/plugin-dev-plugin-structure/SKILL.md new file mode 100644 index 0000000..3861973 --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/SKILL.md @@ -0,0 +1,475 @@ +--- +name: plugin-structure +description: This skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices. +--- + +# Plugin Structure for Claude Code + +## Overview + +Claude Code plugins follow a standardized directory structure with automatic component discovery. Understanding this structure enables creating well-organized, maintainable plugins that integrate seamlessly with Claude Code. + +**Key concepts:** +- Conventional directory layout for automatic discovery +- Manifest-driven configuration in `.claude-plugin/plugin.json` +- Component-based organization (commands, agents, skills, hooks) +- Portable path references using `${CLAUDE_PLUGIN_ROOT}` +- Explicit vs. auto-discovered component loading + +## Directory Structure + +Every Claude Code plugin follows this organizational pattern: + +``` +plugin-name/ +├── .claude-plugin/ +│ └── plugin.json # Required: Plugin manifest +├── commands/ # Slash commands (.md files) +├── agents/ # Subagent definitions (.md files) +├── skills/ # Agent skills (subdirectories) +│ └── skill-name/ +│ └── SKILL.md # Required for each skill +├── hooks/ +│ └── hooks.json # Event handler configuration +├── .mcp.json # MCP server definitions +└── scripts/ # Helper scripts and utilities +``` + +**Critical rules:** + +1. **Manifest location**: The `plugin.json` manifest MUST be in `.claude-plugin/` directory +2. **Component locations**: All component directories (commands, agents, skills, hooks) MUST be at plugin root level, NOT nested inside `.claude-plugin/` +3. **Optional components**: Only create directories for components the plugin actually uses +4. **Naming convention**: Use kebab-case for all directory and file names + +## Plugin Manifest (plugin.json) + +The manifest defines plugin metadata and configuration. Located at `.claude-plugin/plugin.json`: + +### Required Fields + +```json +{ + "name": "plugin-name" +} +``` + +**Name requirements:** +- Use kebab-case format (lowercase with hyphens) +- Must be unique across installed plugins +- No spaces or special characters +- Example: `code-review-assistant`, `test-runner`, `api-docs` + +### Recommended Metadata + +```json +{ + "name": "plugin-name", + "version": "1.0.0", + "description": "Brief explanation of plugin purpose", + "author": { + "name": "Author Name", + "email": "author@example.com", + "url": "https://example.com" + }, + "homepage": "https://docs.example.com", + "repository": "https://github.com/user/plugin-name", + "license": "MIT", + "keywords": ["testing", "automation", "ci-cd"] +} +``` + +**Version format**: Follow semantic versioning (MAJOR.MINOR.PATCH) +**Keywords**: Use for plugin discovery and categorization + +### Component Path Configuration + +Specify custom paths for components (supplements default directories): + +```json +{ + "name": "plugin-name", + "commands": "./custom-commands", + "agents": ["./agents", "./specialized-agents"], + "hooks": "./config/hooks.json", + "mcpServers": "./.mcp.json" +} +``` + +**Important**: Custom paths supplement defaults—they don't replace them. Components in both default directories and custom paths will load. + +**Path rules:** +- Must be relative to plugin root +- Must start with `./` +- Cannot use absolute paths +- Support arrays for multiple locations + +## Component Organization + +### Commands + +**Location**: `commands/` directory +**Format**: Markdown files with YAML frontmatter +**Auto-discovery**: All `.md` files in `commands/` load automatically + +**Example structure**: +``` +commands/ +├── review.md # /review command +├── test.md # /test command +└── deploy.md # /deploy command +``` + +**File format**: +```markdown +--- +name: command-name +description: Command description +--- + +Command implementation instructions... +``` + +**Usage**: Commands integrate as native slash commands in Claude Code + +### Agents + +**Location**: `agents/` directory +**Format**: Markdown files with YAML frontmatter +**Auto-discovery**: All `.md` files in `agents/` load automatically + +**Example structure**: +``` +agents/ +├── code-reviewer.md +├── test-generator.md +└── refactorer.md +``` + +**File format**: +```markdown +--- +description: Agent role and expertise +capabilities: + - Specific task 1 + - Specific task 2 +--- + +Detailed agent instructions and knowledge... +``` + +**Usage**: Users can invoke agents manually, or Claude Code selects them automatically based on task context + +### Skills + +**Location**: `skills/` directory with subdirectories per skill +**Format**: Each skill in its own directory with `SKILL.md` file +**Auto-discovery**: All `SKILL.md` files in skill subdirectories load automatically + +**Example structure**: +``` +skills/ +├── api-testing/ +│ ├── SKILL.md +│ ├── scripts/ +│ │ └── test-runner.py +│ └── references/ +│ └── api-spec.md +└── database-migrations/ + ├── SKILL.md + └── examples/ + └── migration-template.sql +``` + +**SKILL.md format**: +```markdown +--- +name: Skill Name +description: When to use this skill +version: 1.0.0 +--- + +Skill instructions and guidance... +``` + +**Supporting files**: Skills can include scripts, references, examples, or assets in subdirectories + +**Usage**: Claude Code autonomously activates skills based on task context matching the description + +### Hooks + +**Location**: `hooks/hooks.json` or inline in `plugin.json` +**Format**: JSON configuration defining event handlers +**Registration**: Hooks register automatically when plugin enables + +**Example structure**: +``` +hooks/ +├── hooks.json # Hook configuration +└── scripts/ + ├── validate.sh # Hook script + └── check-style.sh # Hook script +``` + +**Configuration format**: +```json +{ + "PreToolUse": [{ + "matcher": "Write|Edit", + "hooks": [{ + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh", + "timeout": 30 + }] + }] +} +``` + +**Available events**: PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification + +**Usage**: Hooks execute automatically in response to Claude Code events + +### MCP Servers + +**Location**: `.mcp.json` at plugin root or inline in `plugin.json` +**Format**: JSON configuration for MCP server definitions +**Auto-start**: Servers start automatically when plugin enables + +**Example format**: +```json +{ + "mcpServers": { + "server-name": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/servers/server.js"], + "env": { + "API_KEY": "${API_KEY}" + } + } + } +} +``` + +**Usage**: MCP servers integrate seamlessly with Claude Code's tool system + +## Portable Path References + +### ${CLAUDE_PLUGIN_ROOT} + +Use `${CLAUDE_PLUGIN_ROOT}` environment variable for all intra-plugin path references: + +```json +{ + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/run.sh" +} +``` + +**Why it matters**: Plugins install in different locations depending on: +- User installation method (marketplace, local, npm) +- Operating system conventions +- User preferences + +**Where to use it**: +- Hook command paths +- MCP server command arguments +- Script execution references +- Resource file paths + +**Never use**: +- Hardcoded absolute paths (`/Users/name/plugins/...`) +- Relative paths from working directory (`./scripts/...` in commands) +- Home directory shortcuts (`~/plugins/...`) + +### Path Resolution Rules + +**In manifest JSON fields** (hooks, MCP servers): +```json +"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tool.sh" +``` + +**In component files** (commands, agents, skills): +```markdown +Reference scripts at: ${CLAUDE_PLUGIN_ROOT}/scripts/helper.py +``` + +**In executed scripts**: +```bash +#!/bin/bash +# ${CLAUDE_PLUGIN_ROOT} available as environment variable +source "${CLAUDE_PLUGIN_ROOT}/lib/common.sh" +``` + +## File Naming Conventions + +### Component Files + +**Commands**: Use kebab-case `.md` files +- `code-review.md` → `/code-review` +- `run-tests.md` → `/run-tests` +- `api-docs.md` → `/api-docs` + +**Agents**: Use kebab-case `.md` files describing role +- `test-generator.md` +- `code-reviewer.md` +- `performance-analyzer.md` + +**Skills**: Use kebab-case directory names +- `api-testing/` +- `database-migrations/` +- `error-handling/` + +### Supporting Files + +**Scripts**: Use descriptive kebab-case names with appropriate extensions +- `validate-input.sh` +- `generate-report.py` +- `process-data.js` + +**Documentation**: Use kebab-case markdown files +- `api-reference.md` +- `migration-guide.md` +- `best-practices.md` + +**Configuration**: Use standard names +- `hooks.json` +- `.mcp.json` +- `plugin.json` + +## Auto-Discovery Mechanism + +Claude Code automatically discovers and loads components: + +1. **Plugin manifest**: Reads `.claude-plugin/plugin.json` when plugin enables +2. **Commands**: Scans `commands/` directory for `.md` files +3. **Agents**: Scans `agents/` directory for `.md` files +4. **Skills**: Scans `skills/` for subdirectories containing `SKILL.md` +5. **Hooks**: Loads configuration from `hooks/hooks.json` or manifest +6. **MCP servers**: Loads configuration from `.mcp.json` or manifest + +**Discovery timing**: +- Plugin installation: Components register with Claude Code +- Plugin enable: Components become available for use +- No restart required: Changes take effect on next Claude Code session + +**Override behavior**: Custom paths in `plugin.json` supplement (not replace) default directories + +## Best Practices + +### Organization + +1. **Logical grouping**: Group related components together + - Put test-related commands, agents, and skills together + - Create subdirectories in `scripts/` for different purposes + +2. **Minimal manifest**: Keep `plugin.json` lean + - Only specify custom paths when necessary + - Rely on auto-discovery for standard layouts + - Use inline configuration only for simple cases + +3. **Documentation**: Include README files + - Plugin root: Overall purpose and usage + - Component directories: Specific guidance + - Script directories: Usage and requirements + +### Naming + +1. **Consistency**: Use consistent naming across components + - If command is `test-runner`, name related agent `test-runner-agent` + - Match skill directory names to their purpose + +2. **Clarity**: Use descriptive names that indicate purpose + - Good: `api-integration-testing/`, `code-quality-checker.md` + - Avoid: `utils/`, `misc.md`, `temp.sh` + +3. **Length**: Balance brevity with clarity + - Commands: 2-3 words (`review-pr`, `run-ci`) + - Agents: Describe role clearly (`code-reviewer`, `test-generator`) + - Skills: Topic-focused (`error-handling`, `api-design`) + +### Portability + +1. **Always use ${CLAUDE_PLUGIN_ROOT}**: Never hardcode paths +2. **Test on multiple systems**: Verify on macOS, Linux, Windows +3. **Document dependencies**: List required tools and versions +4. **Avoid system-specific features**: Use portable bash/Python constructs + +### Maintenance + +1. **Version consistently**: Update version in plugin.json for releases +2. **Deprecate gracefully**: Mark old components clearly before removal +3. **Document breaking changes**: Note changes affecting existing users +4. **Test thoroughly**: Verify all components work after changes + +## Common Patterns + +### Minimal Plugin + +Single command with no dependencies: +``` +my-plugin/ +├── .claude-plugin/ +│ └── plugin.json # Just name field +└── commands/ + └── hello.md # Single command +``` + +### Full-Featured Plugin + +Complete plugin with all component types: +``` +my-plugin/ +├── .claude-plugin/ +│ └── plugin.json +├── commands/ # User-facing commands +├── agents/ # Specialized subagents +├── skills/ # Auto-activating skills +├── hooks/ # Event handlers +│ ├── hooks.json +│ └── scripts/ +├── .mcp.json # External integrations +└── scripts/ # Shared utilities +``` + +### Skill-Focused Plugin + +Plugin providing only skills: +``` +my-plugin/ +├── .claude-plugin/ +│ └── plugin.json +└── skills/ + ├── skill-one/ + │ └── SKILL.md + └── skill-two/ + └── SKILL.md +``` + +## Troubleshooting + +**Component not loading**: +- Verify file is in correct directory with correct extension +- Check YAML frontmatter syntax (commands, agents, skills) +- Ensure skill has `SKILL.md` (not `README.md` or other name) +- Confirm plugin is enabled in Claude Code settings + +**Path resolution errors**: +- Replace all hardcoded paths with `${CLAUDE_PLUGIN_ROOT}` +- Verify paths are relative and start with `./` in manifest +- Check that referenced files exist at specified paths +- Test with `echo $CLAUDE_PLUGIN_ROOT` in hook scripts + +**Auto-discovery not working**: +- Confirm directories are at plugin root (not in `.claude-plugin/`) +- Check file naming follows conventions (kebab-case, correct extensions) +- Verify custom paths in manifest are correct +- Restart Claude Code to reload plugin configuration + +**Conflicts between plugins**: +- Use unique, descriptive component names +- Namespace commands with plugin name if needed +- Document potential conflicts in plugin README +- Consider command prefixes for related functionality + +--- + +For detailed examples and advanced patterns, see files in `references/` and `examples/` directories. diff --git a/skills/external/plugin-dev-plugin-structure/examples/advanced-plugin.md b/skills/external/plugin-dev-plugin-structure/examples/advanced-plugin.md new file mode 100644 index 0000000..a7c0696 --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/examples/advanced-plugin.md @@ -0,0 +1,765 @@ +# Advanced Plugin Example + +A complex, enterprise-grade plugin with MCP integration and advanced organization. + +## Directory Structure + +``` +enterprise-devops/ +├── .claude-plugin/ +│ └── plugin.json +├── commands/ +│ ├── ci/ +│ │ ├── build.md +│ │ ├── test.md +│ │ └── deploy.md +│ ├── monitoring/ +│ │ ├── status.md +│ │ └── logs.md +│ └── admin/ +│ ├── configure.md +│ └── manage.md +├── agents/ +│ ├── orchestration/ +│ │ ├── deployment-orchestrator.md +│ │ └── rollback-manager.md +│ └── specialized/ +│ ├── kubernetes-expert.md +│ ├── terraform-expert.md +│ └── security-auditor.md +├── skills/ +│ ├── kubernetes-ops/ +│ │ ├── SKILL.md +│ │ ├── references/ +│ │ │ ├── deployment-patterns.md +│ │ │ ├── troubleshooting.md +│ │ │ └── security.md +│ │ ├── examples/ +│ │ │ ├── basic-deployment.yaml +│ │ │ ├── stateful-set.yaml +│ │ │ └── ingress-config.yaml +│ │ └── scripts/ +│ │ ├── validate-manifest.sh +│ │ └── health-check.sh +│ ├── terraform-iac/ +│ │ ├── SKILL.md +│ │ ├── references/ +│ │ │ └── best-practices.md +│ │ └── examples/ +│ │ └── module-template/ +│ └── ci-cd-pipelines/ +│ ├── SKILL.md +│ └── references/ +│ └── pipeline-patterns.md +├── hooks/ +│ ├── hooks.json +│ └── scripts/ +│ ├── security/ +│ │ ├── scan-secrets.sh +│ │ ├── validate-permissions.sh +│ │ └── audit-changes.sh +│ ├── quality/ +│ │ ├── check-config.sh +│ │ └── verify-tests.sh +│ └── workflow/ +│ ├── notify-team.sh +│ └── update-status.sh +├── .mcp.json +├── servers/ +│ ├── kubernetes-mcp/ +│ │ ├── index.js +│ │ ├── package.json +│ │ └── lib/ +│ ├── terraform-mcp/ +│ │ ├── main.py +│ │ └── requirements.txt +│ └── github-actions-mcp/ +│ ├── server.js +│ └── package.json +├── lib/ +│ ├── core/ +│ │ ├── logger.js +│ │ ├── config.js +│ │ └── auth.js +│ ├── integrations/ +│ │ ├── slack.js +│ │ ├── pagerduty.js +│ │ └── datadog.js +│ └── utils/ +│ ├── retry.js +│ └── validation.js +└── config/ + ├── environments/ + │ ├── production.json + │ ├── staging.json + │ └── development.json + └── templates/ + ├── deployment.yaml + └── service.yaml +``` + +## File Contents + +### .claude-plugin/plugin.json + +```json +{ + "name": "enterprise-devops", + "version": "2.3.1", + "description": "Comprehensive DevOps automation for enterprise CI/CD pipelines, infrastructure management, and monitoring", + "author": { + "name": "DevOps Platform Team", + "email": "devops-platform@company.com", + "url": "https://company.com/teams/devops" + }, + "homepage": "https://docs.company.com/plugins/devops", + "repository": { + "type": "git", + "url": "https://github.com/company/devops-plugin.git" + }, + "license": "Apache-2.0", + "keywords": [ + "devops", + "ci-cd", + "kubernetes", + "terraform", + "automation", + "infrastructure", + "deployment", + "monitoring" + ], + "commands": [ + "./commands/ci", + "./commands/monitoring", + "./commands/admin" + ], + "agents": [ + "./agents/orchestration", + "./agents/specialized" + ], + "hooks": "./hooks/hooks.json", + "mcpServers": "./.mcp.json" +} +``` + +### .mcp.json + +```json +{ + "mcpServers": { + "kubernetes": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/servers/kubernetes-mcp/index.js"], + "env": { + "KUBECONFIG": "${KUBECONFIG}", + "K8S_NAMESPACE": "${K8S_NAMESPACE:-default}" + } + }, + "terraform": { + "command": "python", + "args": ["${CLAUDE_PLUGIN_ROOT}/servers/terraform-mcp/main.py"], + "env": { + "TF_STATE_BUCKET": "${TF_STATE_BUCKET}", + "AWS_REGION": "${AWS_REGION}" + } + }, + "github-actions": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/servers/github-actions-mcp/server.js"], + "env": { + "GITHUB_TOKEN": "${GITHUB_TOKEN}", + "GITHUB_ORG": "${GITHUB_ORG}" + } + } + } +} +``` + +### commands/ci/build.md + +```markdown +--- +name: build +description: Trigger and monitor CI build pipeline +--- + +# Build Command + +Trigger CI/CD build pipeline and monitor progress in real-time. + +## Process + +1. **Validation**: Check prerequisites + - Verify branch status + - Check for uncommitted changes + - Validate configuration files + +2. **Trigger**: Start build via MCP server + \`\`\`javascript + // Uses github-actions MCP server + const build = await tools.github_actions_trigger_workflow({ + workflow: 'build.yml', + ref: currentBranch + }) + \`\`\` + +3. **Monitor**: Track build progress + - Display real-time logs + - Show test results as they complete + - Alert on failures + +4. **Report**: Summarize results + - Build status + - Test coverage + - Performance metrics + - Deploy readiness + +## Integration + +After successful build: +- Offer to deploy to staging +- Suggest performance optimizations +- Generate deployment checklist +``` + +### agents/orchestration/deployment-orchestrator.md + +```markdown +--- +description: Orchestrates complex multi-environment deployments with rollback capabilities and health monitoring +capabilities: + - Plan and execute multi-stage deployments + - Coordinate service dependencies + - Monitor deployment health + - Execute automated rollbacks + - Manage deployment approvals +--- + +# Deployment Orchestrator Agent + +Specialized agent for orchestrating complex deployments across multiple environments. + +## Expertise + +- **Deployment strategies**: Blue-green, canary, rolling updates +- **Dependency management**: Service startup ordering, dependency injection +- **Health monitoring**: Service health checks, metric validation +- **Rollback automation**: Automatic rollback on failure detection +- **Approval workflows**: Multi-stage approval processes + +## Orchestration Process + +1. **Planning Phase** + - Analyze deployment requirements + - Identify service dependencies + - Generate deployment plan + - Calculate rollback strategy + +2. **Validation Phase** + - Verify environment readiness + - Check resource availability + - Validate configurations + - Run pre-deployment tests + +3. **Execution Phase** + - Deploy services in dependency order + - Monitor health after each stage + - Validate metrics and logs + - Proceed to next stage on success + +4. **Verification Phase** + - Run smoke tests + - Validate service integration + - Check performance metrics + - Confirm deployment success + +5. **Rollback Phase** (if needed) + - Detect failure conditions + - Execute rollback plan + - Restore previous state + - Notify stakeholders + +## MCP Integration + +Uses multiple MCP servers: +- `kubernetes`: Deploy and manage containers +- `terraform`: Provision infrastructure +- `github-actions`: Trigger deployment pipelines + +## Monitoring Integration + +Integrates with monitoring tools via lib: +\`\`\`javascript +const { DatadogClient } = require('${CLAUDE_PLUGIN_ROOT}/lib/integrations/datadog') +const metrics = await DatadogClient.getMetrics(service, timeRange) +\`\`\` + +## Notification Integration + +Sends updates via Slack and PagerDuty: +\`\`\`javascript +const { SlackClient } = require('${CLAUDE_PLUGIN_ROOT}/lib/integrations/slack') +await SlackClient.notify({ + channel: '#deployments', + message: 'Deployment started', + metadata: deploymentPlan +}) +\`\`\` +``` + +### skills/kubernetes-ops/SKILL.md + +```markdown +--- +name: Kubernetes Operations +description: This skill should be used when deploying to Kubernetes, managing K8s resources, troubleshooting cluster issues, configuring ingress/services, scaling deployments, or working with Kubernetes manifests. Provides comprehensive Kubernetes operational knowledge and best practices. +version: 2.0.0 +--- + +# Kubernetes Operations + +Comprehensive operational knowledge for managing Kubernetes clusters and workloads. + +## Overview + +Manage Kubernetes infrastructure effectively through: +- Deployment strategies and patterns +- Resource configuration and optimization +- Troubleshooting and debugging +- Security best practices +- Performance tuning + +## Core Concepts + +### Resource Management + +**Deployments**: Use for stateless applications +- Rolling updates for zero-downtime deployments +- Rollback capabilities for failed deployments +- Replica management for scaling + +**StatefulSets**: Use for stateful applications +- Stable network identities +- Persistent storage +- Ordered deployment and scaling + +**DaemonSets**: Use for node-level services +- Log collectors +- Monitoring agents +- Network plugins + +### Configuration + +**ConfigMaps**: Store non-sensitive configuration +- Environment-specific settings +- Application configuration files +- Feature flags + +**Secrets**: Store sensitive data +- API keys and tokens +- Database credentials +- TLS certificates + +Use external secret management (Vault, AWS Secrets Manager) for production. + +### Networking + +**Services**: Expose applications internally +- ClusterIP for internal communication +- NodePort for external access (non-production) +- LoadBalancer for external access (production) + +**Ingress**: HTTP/HTTPS routing +- Path-based routing +- Host-based routing +- TLS termination +- Load balancing + +## Deployment Strategies + +### Rolling Update + +Default strategy, gradual replacement: +\`\`\`yaml +strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 +\`\`\` + +**When to use**: Standard deployments, minor updates + +### Recreate + +Stop all pods, then create new ones: +\`\`\`yaml +strategy: + type: Recreate +\`\`\` + +**When to use**: Stateful apps that can't run multiple versions + +### Blue-Green + +Run two complete environments, switch traffic: +1. Deploy new version (green) +2. Test green environment +3. Switch traffic to green +4. Keep blue for quick rollback + +**When to use**: Critical services, need instant rollback + +### Canary + +Gradually roll out to subset of users: +1. Deploy canary version (10% traffic) +2. Monitor metrics and errors +3. Increase traffic gradually +4. Complete rollout or rollback + +**When to use**: High-risk changes, want gradual validation + +## Resource Configuration + +### Resource Requests and Limits + +Always set for production workloads: +\`\`\`yaml +resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "512Mi" + cpu: "500m" +\`\`\` + +**Requests**: Guaranteed resources +**Limits**: Maximum allowed resources + +### Health Checks + +Essential for reliability: +\`\`\`yaml +livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 10 + +readinessProbe: + httpGet: + path: /ready + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 5 +\`\`\` + +**Liveness**: Restart unhealthy pods +**Readiness**: Remove unready pods from service + +## Troubleshooting + +### Common Issues + +1. **Pods not starting** + - Check: `kubectl describe pod ` + - Look for: Image pull errors, resource constraints + - Fix: Verify image name, increase resources + +2. **Service not reachable** + - Check: `kubectl get svc`, `kubectl get endpoints` + - Look for: No endpoints, wrong selector + - Fix: Verify pod labels match service selector + +3. **High memory usage** + - Check: `kubectl top pods` + - Look for: Pods near memory limit + - Fix: Increase limits, optimize application + +4. **Frequent restarts** + - Check: `kubectl get pods`, `kubectl logs ` + - Look for: Liveness probe failures, OOMKilled + - Fix: Adjust health checks, increase memory + +### Debugging Commands + +Get pod details: +\`\`\`bash +kubectl describe pod +kubectl logs +kubectl logs --previous # logs from crashed container +\`\`\` + +Execute commands in pod: +\`\`\`bash +kubectl exec -it -- /bin/sh +kubectl exec -- env +\`\`\` + +Check resource usage: +\`\`\`bash +kubectl top nodes +kubectl top pods +\`\`\` + +## Security Best Practices + +### Pod Security + +- Run as non-root user +- Use read-only root filesystem +- Drop unnecessary capabilities +- Use security contexts + +Example: +\`\`\`yaml +securityContext: + runAsNonRoot: true + runAsUser: 1000 + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL +\`\`\` + +### Network Policies + +Restrict pod communication: +\`\`\`yaml +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: api-allow +spec: + podSelector: + matchLabels: + app: api + ingress: + - from: + - podSelector: + matchLabels: + app: frontend +\`\`\` + +### Secrets Management + +- Never commit secrets to git +- Use external secret managers +- Rotate secrets regularly +- Limit secret access with RBAC + +## Performance Optimization + +### Resource Tuning + +1. **Start conservative**: Set low limits initially +2. **Monitor usage**: Track actual resource consumption +3. **Adjust gradually**: Increase based on metrics +4. **Set appropriate requests**: Match typical usage +5. **Set safe limits**: 2x requests for headroom + +### Horizontal Pod Autoscaling + +Automatically scale based on metrics: +\`\`\`yaml +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: api-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: api + minReplicas: 2 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 70 +\`\`\` + +## MCP Server Integration + +This skill works with the kubernetes MCP server for operations: + +**List pods**: +\`\`\`javascript +const pods = await tools.k8s_list_pods({ namespace: 'default' }) +\`\`\` + +**Get pod logs**: +\`\`\`javascript +const logs = await tools.k8s_get_logs({ pod: 'api-xyz', container: 'app' }) +\`\`\` + +**Apply manifests**: +\`\`\`javascript +const result = await tools.k8s_apply_manifest({ file: 'deployment.yaml' }) +\`\`\` + +## Detailed References + +For in-depth information: +- **Deployment patterns**: `references/deployment-patterns.md` +- **Troubleshooting guide**: `references/troubleshooting.md` +- **Security hardening**: `references/security.md` + +## Example Manifests + +For copy-paste examples: +- **Basic deployment**: `examples/basic-deployment.yaml` +- **StatefulSet**: `examples/stateful-set.yaml` +- **Ingress config**: `examples/ingress-config.yaml` + +## Validation Scripts + +For manifest validation: +\`\`\`bash +bash ${CLAUDE_PLUGIN_ROOT}/skills/kubernetes-ops/scripts/validate-manifest.sh deployment.yaml +\`\`\` +``` + +### hooks/hooks.json + +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/scan-secrets.sh", + "timeout": 30 + } + ] + }, + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Evaluate if this bash command is safe for production environment. Check for destructive operations, missing safeguards, and potential security issues. Commands should be idempotent and reversible.", + "timeout": 20 + } + ] + } + ], + "PostToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/update-status.sh", + "timeout": 15 + } + ] + } + ], + "Stop": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/quality/check-config.sh", + "timeout": 45 + }, + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/notify-team.sh", + "timeout": 30 + } + ] + } + ], + "SessionStart": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/validate-permissions.sh", + "timeout": 20 + } + ] + } + ] +} +``` + +## Key Features + +### Multi-Level Organization + +**Commands**: Organized by function (CI, monitoring, admin) +**Agents**: Separated by role (orchestration vs. specialized) +**Skills**: Rich resources (references, examples, scripts) + +### MCP Integration + +Three custom MCP servers: +- **Kubernetes**: Cluster operations +- **Terraform**: Infrastructure provisioning +- **GitHub Actions**: CI/CD automation + +### Shared Libraries + +Reusable code in `lib/`: +- **Core**: Common utilities (logging, config, auth) +- **Integrations**: External services (Slack, Datadog) +- **Utils**: Helper functions (retry, validation) + +### Configuration Management + +Environment-specific configs in `config/`: +- **Environments**: Per-environment settings +- **Templates**: Reusable deployment templates + +### Security Automation + +Multiple security hooks: +- Secret scanning before writes +- Permission validation on session start +- Configuration auditing on completion + +### Monitoring Integration + +Built-in monitoring via lib integrations: +- Datadog for metrics +- PagerDuty for alerts +- Slack for notifications + +## Use Cases + +1. **Multi-environment deployments**: Orchestrated rollouts across dev/staging/prod +2. **Infrastructure as code**: Terraform automation with state management +3. **CI/CD automation**: Build, test, deploy pipelines +4. **Monitoring and observability**: Integrated metrics and alerting +5. **Security enforcement**: Automated security scanning and validation +6. **Team collaboration**: Slack notifications and status updates + +## When to Use This Pattern + +- Large-scale enterprise deployments +- Multiple environment management +- Complex CI/CD workflows +- Integrated monitoring requirements +- Security-critical infrastructure +- Team collaboration needs + +## Scaling Considerations + +- **Performance**: Separate MCP servers for parallel operations +- **Organization**: Multi-level directories for scalability +- **Maintainability**: Shared libraries reduce duplication +- **Flexibility**: Environment configs enable customization +- **Security**: Layered security hooks and validation diff --git a/skills/external/plugin-dev-plugin-structure/examples/minimal-plugin.md b/skills/external/plugin-dev-plugin-structure/examples/minimal-plugin.md new file mode 100644 index 0000000..27591db --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/examples/minimal-plugin.md @@ -0,0 +1,83 @@ +# Minimal Plugin Example + +A bare-bones plugin with a single command. + +## Directory Structure + +``` +hello-world/ +├── .claude-plugin/ +│ └── plugin.json +└── commands/ + └── hello.md +``` + +## File Contents + +### .claude-plugin/plugin.json + +```json +{ + "name": "hello-world" +} +``` + +### commands/hello.md + +```markdown +--- +name: hello +description: Prints a friendly greeting message +--- + +# Hello Command + +Print a friendly greeting to the user. + +## Implementation + +Output the following message to the user: + +> Hello! This is a simple command from the hello-world plugin. +> +> Use this as a starting point for building more complex plugins. + +Include the current timestamp in the greeting to show the command executed successfully. +``` + +## Usage + +After installing the plugin: + +``` +$ claude +> /hello +Hello! This is a simple command from the hello-world plugin. + +Use this as a starting point for building more complex plugins. + +Executed at: 2025-01-15 14:30:22 UTC +``` + +## Key Points + +1. **Minimal manifest**: Only the required `name` field +2. **Single command**: One markdown file in `commands/` directory +3. **Auto-discovery**: Claude Code finds the command automatically +4. **No dependencies**: No scripts, hooks, or external resources + +## When to Use This Pattern + +- Quick prototypes +- Single-purpose utilities +- Learning plugin development +- Internal team tools with one specific function + +## Extending This Plugin + +To add more functionality: + +1. **Add commands**: Create more `.md` files in `commands/` +2. **Add metadata**: Update `plugin.json` with version, description, author +3. **Add agents**: Create `agents/` directory with agent definitions +4. **Add hooks**: Create `hooks/hooks.json` for event handling diff --git a/skills/external/plugin-dev-plugin-structure/examples/standard-plugin.md b/skills/external/plugin-dev-plugin-structure/examples/standard-plugin.md new file mode 100644 index 0000000..d903166 --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/examples/standard-plugin.md @@ -0,0 +1,587 @@ +# Standard Plugin Example + +A well-structured plugin with commands, agents, and skills. + +## Directory Structure + +``` +code-quality/ +├── .claude-plugin/ +│ └── plugin.json +├── commands/ +│ ├── lint.md +│ ├── test.md +│ └── review.md +├── agents/ +│ ├── code-reviewer.md +│ └── test-generator.md +├── skills/ +│ ├── code-standards/ +│ │ ├── SKILL.md +│ │ └── references/ +│ │ └── style-guide.md +│ └── testing-patterns/ +│ ├── SKILL.md +│ └── examples/ +│ ├── unit-test.js +│ └── integration-test.js +├── hooks/ +│ ├── hooks.json +│ └── scripts/ +│ └── validate-commit.sh +└── scripts/ + ├── run-linter.sh + └── generate-report.py +``` + +## File Contents + +### .claude-plugin/plugin.json + +```json +{ + "name": "code-quality", + "version": "1.0.0", + "description": "Comprehensive code quality tools including linting, testing, and review automation", + "author": { + "name": "Quality Team", + "email": "quality@example.com" + }, + "homepage": "https://docs.example.com/plugins/code-quality", + "repository": "https://github.com/example/code-quality-plugin", + "license": "MIT", + "keywords": ["code-quality", "linting", "testing", "code-review", "automation"] +} +``` + +### commands/lint.md + +```markdown +--- +name: lint +description: Run linting checks on the codebase +--- + +# Lint Command + +Run comprehensive linting checks on the project codebase. + +## Process + +1. Detect project type and installed linters +2. Run appropriate linters (ESLint, Pylint, RuboCop, etc.) +3. Collect and format results +4. Report issues with file locations and severity + +## Implementation + +Execute the linting script: + +\`\`\`bash +bash ${CLAUDE_PLUGIN_ROOT}/scripts/run-linter.sh +\`\`\` + +Parse the output and present issues organized by: +- Critical issues (must fix) +- Warnings (should fix) +- Style suggestions (optional) + +For each issue, show: +- File path and line number +- Issue description +- Suggested fix (if available) +``` + +### commands/test.md + +```markdown +--- +name: test +description: Run test suite with coverage reporting +--- + +# Test Command + +Execute the project test suite and generate coverage reports. + +## Process + +1. Identify test framework (Jest, pytest, RSpec, etc.) +2. Run all tests +3. Generate coverage report +4. Identify untested code + +## Output + +Present results in structured format: +- Test summary (passed/failed/skipped) +- Coverage percentage by file +- Critical untested areas +- Failed test details + +## Integration + +After test completion, offer to: +- Fix failing tests +- Generate tests for untested code (using test-generator agent) +- Update documentation based on test changes +``` + +### agents/code-reviewer.md + +```markdown +--- +description: Expert code reviewer specializing in identifying bugs, security issues, and improvement opportunities +capabilities: + - Analyze code for potential bugs and logic errors + - Identify security vulnerabilities + - Suggest performance improvements + - Ensure code follows project standards + - Review test coverage adequacy +--- + +# Code Reviewer Agent + +Specialized agent for comprehensive code review. + +## Expertise + +- **Bug detection**: Logic errors, edge cases, error handling +- **Security analysis**: Injection vulnerabilities, authentication issues, data exposure +- **Performance**: Algorithm efficiency, resource usage, optimization opportunities +- **Standards compliance**: Style guide adherence, naming conventions, documentation +- **Test coverage**: Adequacy of test cases, missing scenarios + +## Review Process + +1. **Initial scan**: Quick pass for obvious issues +2. **Deep analysis**: Line-by-line review of changed code +3. **Context evaluation**: Check impact on related code +4. **Best practices**: Compare against project and language standards +5. **Recommendations**: Prioritized list of improvements + +## Integration with Skills + +Automatically loads `code-standards` skill for project-specific guidelines. + +## Output Format + +For each file reviewed: +- Overall assessment +- Critical issues (must fix before merge) +- Important issues (should fix) +- Suggestions (nice to have) +- Positive feedback (what was done well) +``` + +### agents/test-generator.md + +```markdown +--- +description: Generates comprehensive test suites from code analysis +capabilities: + - Analyze code structure and logic flow + - Generate unit tests for functions and methods + - Create integration tests for modules + - Design edge case and error condition tests + - Suggest test fixtures and mocks +--- + +# Test Generator Agent + +Specialized agent for generating comprehensive test suites. + +## Expertise + +- **Unit testing**: Individual function/method tests +- **Integration testing**: Module interaction tests +- **Edge cases**: Boundary conditions, error paths +- **Test organization**: Proper test structure and naming +- **Mocking**: Appropriate use of mocks and stubs + +## Generation Process + +1. **Code analysis**: Understand function purpose and logic +2. **Path identification**: Map all execution paths +3. **Input design**: Create test inputs covering all paths +4. **Assertion design**: Define expected outputs +5. **Test generation**: Write tests in project's framework + +## Integration with Skills + +Automatically loads `testing-patterns` skill for project-specific test conventions. + +## Test Quality + +Generated tests include: +- Happy path scenarios +- Edge cases and boundary conditions +- Error handling verification +- Mock data for external dependencies +- Clear test descriptions +``` + +### skills/code-standards/SKILL.md + +```markdown +--- +name: Code Standards +description: This skill should be used when reviewing code, enforcing style guidelines, checking naming conventions, or ensuring code quality standards. Provides project-specific coding standards and best practices. +version: 1.0.0 +--- + +# Code Standards + +Comprehensive coding standards and best practices for maintaining code quality. + +## Overview + +Enforce consistent code quality through standardized conventions for: +- Code style and formatting +- Naming conventions +- Documentation requirements +- Error handling patterns +- Security practices + +## Style Guidelines + +### Formatting + +- **Indentation**: 2 spaces (JavaScript/TypeScript), 4 spaces (Python) +- **Line length**: Maximum 100 characters +- **Braces**: Same line for opening brace (K&R style) +- **Whitespace**: Space after commas, around operators + +### Naming Conventions + +- **Variables**: camelCase for JavaScript, snake_case for Python +- **Functions**: camelCase, descriptive verb-noun pairs +- **Classes**: PascalCase +- **Constants**: UPPER_SNAKE_CASE +- **Files**: kebab-case for modules + +## Documentation Requirements + +### Function Documentation + +Every function must include: +- Purpose description +- Parameter descriptions with types +- Return value description with type +- Example usage (for public functions) + +### Module Documentation + +Every module must include: +- Module purpose +- Public API overview +- Usage examples +- Dependencies + +## Error Handling + +### Required Practices + +- Never swallow errors silently +- Always log errors with context +- Use specific error types +- Provide actionable error messages +- Clean up resources in finally blocks + +### Example Pattern + +\`\`\`javascript +async function processData(data) { + try { + const result = await transform(data) + return result + } catch (error) { + logger.error('Data processing failed', { + data: sanitize(data), + error: error.message, + stack: error.stack + }) + throw new DataProcessingError('Failed to process data', { cause: error }) + } +} +\`\`\` + +## Security Practices + +- Validate all external input +- Sanitize data before output +- Use parameterized queries +- Never log sensitive information +- Keep dependencies updated + +## Detailed Guidelines + +For comprehensive style guides by language, see: +- `references/style-guide.md` +``` + +### skills/code-standards/references/style-guide.md + +```markdown +# Comprehensive Style Guide + +Detailed style guidelines for all supported languages. + +## JavaScript/TypeScript + +### Variable Declarations + +Use `const` by default, `let` when reassignment needed, never `var`: + +\`\`\`javascript +// Good +const MAX_RETRIES = 3 +let currentTry = 0 + +// Bad +var MAX_RETRIES = 3 +\`\`\` + +### Function Declarations + +Use function expressions for consistency: + +\`\`\`javascript +// Good +const calculateTotal = (items) => { + return items.reduce((sum, item) => sum + item.price, 0) +} + +// Bad (inconsistent style) +function calculateTotal(items) { + return items.reduce((sum, item) => sum + item.price, 0) +} +\`\`\` + +### Async/Await + +Prefer async/await over promise chains: + +\`\`\`javascript +// Good +async function fetchUserData(userId) { + const user = await db.getUser(userId) + const orders = await db.getOrders(user.id) + return { user, orders } +} + +// Bad +function fetchUserData(userId) { + return db.getUser(userId) + .then(user => db.getOrders(user.id) + .then(orders => ({ user, orders }))) +} +\`\`\` + +## Python + +### Import Organization + +Order imports: standard library, third-party, local: + +\`\`\`python +# Good +import os +import sys + +import numpy as np +import pandas as pd + +from app.models import User +from app.utils import helper + +# Bad - mixed order +from app.models import User +import numpy as np +import os +\`\`\` + +### Type Hints + +Use type hints for all function signatures: + +\`\`\`python +# Good +def calculate_average(numbers: list[float]) -> float: + return sum(numbers) / len(numbers) + +# Bad +def calculate_average(numbers): + return sum(numbers) / len(numbers) +\`\`\` + +## Additional Languages + +See language-specific guides for: +- Go: `references/go-style.md` +- Rust: `references/rust-style.md` +- Ruby: `references/ruby-style.md` +``` + +### hooks/hooks.json + +```json +{ + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Before modifying code, verify it meets our coding standards from the code-standards skill. Check formatting, naming conventions, and documentation. If standards aren't met, suggest improvements.", + "timeout": 30 + } + ] + } + ], + "Stop": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-commit.sh", + "timeout": 45 + } + ] + } + ] +} +``` + +### hooks/scripts/validate-commit.sh + +```bash +#!/bin/bash +# Validate code quality before task completion + +set -e + +# Check if there are any uncommitted changes +if [[ -z $(git status -s) ]]; then + echo '{"systemMessage": "No changes to validate. Task complete."}' + exit 0 +fi + +# Run linter on changed files +CHANGED_FILES=$(git diff --name-only --cached | grep -E '\.(js|ts|py)$' || true) + +if [[ -z "$CHANGED_FILES" ]]; then + echo '{"systemMessage": "No code files changed. Validation passed."}' + exit 0 +fi + +# Run appropriate linters +ISSUES=0 + +for file in $CHANGED_FILES; do + case "$file" in + *.js|*.ts) + if ! npx eslint "$file" --quiet; then + ISSUES=$((ISSUES + 1)) + fi + ;; + *.py) + if ! python -m pylint "$file" --errors-only; then + ISSUES=$((ISSUES + 1)) + fi + ;; + esac +done + +if [[ $ISSUES -gt 0 ]]; then + echo "{\"systemMessage\": \"Found $ISSUES code quality issues. Please fix before completing.\"}" + exit 1 +fi + +echo '{"systemMessage": "Code quality checks passed. Ready to commit."}' +exit 0 +``` + +## Usage Examples + +### Running Commands + +``` +$ claude +> /lint +Running linter checks... + +Critical Issues (2): + src/api/users.js:45 - SQL injection vulnerability + src/utils/helpers.js:12 - Unhandled promise rejection + +Warnings (5): + src/components/Button.tsx:23 - Missing PropTypes + ... + +Style Suggestions (8): + src/index.js:1 - Use const instead of let + ... + +> /test +Running test suite... + +Test Results: + ✓ 245 passed + ✗ 3 failed + ○ 2 skipped + +Coverage: 87.3% + +Untested Files: + src/utils/cache.js - 0% coverage + src/api/webhooks.js - 23% coverage + +Failed Tests: + 1. User API › GET /users › should handle pagination + Expected 200, received 500 + ... +``` + +### Using Agents + +``` +> Review the changes in src/api/users.js + +[code-reviewer agent selected automatically] + +Code Review: src/api/users.js + +Critical Issues: + 1. Line 45: SQL injection vulnerability + - Using string concatenation for SQL query + - Replace with parameterized query + - Priority: CRITICAL + + 2. Line 67: Missing error handling + - Database query without try/catch + - Could crash server on DB error + - Priority: HIGH + +Suggestions: + 1. Line 23: Consider caching user data + - Frequent DB queries for same users + - Add Redis caching layer + - Priority: MEDIUM +``` + +## Key Points + +1. **Complete manifest**: All recommended metadata fields +2. **Multiple components**: Commands, agents, skills, hooks +3. **Rich skills**: References and examples for detailed information +4. **Automation**: Hooks enforce standards automatically +5. **Integration**: Components work together cohesively + +## When to Use This Pattern + +- Production plugins for distribution +- Team collaboration tools +- Plugins requiring consistency enforcement +- Complex workflows with multiple entry points diff --git a/skills/external/plugin-dev-plugin-structure/references/component-patterns.md b/skills/external/plugin-dev-plugin-structure/references/component-patterns.md new file mode 100644 index 0000000..a58a7b4 --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/references/component-patterns.md @@ -0,0 +1,567 @@ +# Component Organization Patterns + +Advanced patterns for organizing plugin components effectively. + +## Component Lifecycle + +### Discovery Phase + +When Claude Code starts: + +1. **Scan enabled plugins**: Read `.claude-plugin/plugin.json` for each +2. **Discover components**: Look in default and custom paths +3. **Parse definitions**: Read YAML frontmatter and configurations +4. **Register components**: Make available to Claude Code +5. **Initialize**: Start MCP servers, register hooks + +**Timing**: Component registration happens during Claude Code initialization, not continuously. + +### Activation Phase + +When components are used: + +**Commands**: User types slash command → Claude Code looks up → Executes +**Agents**: Task arrives → Claude Code evaluates capabilities → Selects agent +**Skills**: Task context matches description → Claude Code loads skill +**Hooks**: Event occurs → Claude Code calls matching hooks +**MCP Servers**: Tool call matches server capability → Forwards to server + +## Command Organization Patterns + +### Flat Structure + +Single directory with all commands: + +``` +commands/ +├── build.md +├── test.md +├── deploy.md +├── review.md +└── docs.md +``` + +**When to use**: +- 5-15 commands total +- All commands at same abstraction level +- No clear categorization + +**Advantages**: +- Simple, easy to navigate +- No configuration needed +- Fast discovery + +### Categorized Structure + +Multiple directories for different command types: + +``` +commands/ # Core commands +├── build.md +└── test.md + +admin-commands/ # Administrative +├── configure.md +└── manage.md + +workflow-commands/ # Workflow automation +├── review.md +└── deploy.md +``` + +**Manifest configuration**: +```json +{ + "commands": [ + "./commands", + "./admin-commands", + "./workflow-commands" + ] +} +``` + +**When to use**: +- 15+ commands +- Clear functional categories +- Different permission levels + +**Advantages**: +- Organized by purpose +- Easier to maintain +- Can restrict access by directory + +### Hierarchical Structure + +Nested organization for complex plugins: + +``` +commands/ +├── ci/ +│ ├── build.md +│ ├── test.md +│ └── lint.md +├── deployment/ +│ ├── staging.md +│ └── production.md +└── management/ + ├── config.md + └── status.md +``` + +**Note**: Claude Code doesn't support nested command discovery automatically. Use custom paths: + +```json +{ + "commands": [ + "./commands/ci", + "./commands/deployment", + "./commands/management" + ] +} +``` + +**When to use**: +- 20+ commands +- Multi-level categorization +- Complex workflows + +**Advantages**: +- Maximum organization +- Clear boundaries +- Scalable structure + +## Agent Organization Patterns + +### Role-Based Organization + +Organize agents by their primary role: + +``` +agents/ +├── code-reviewer.md # Reviews code +├── test-generator.md # Generates tests +├── documentation-writer.md # Writes docs +└── refactorer.md # Refactors code +``` + +**When to use**: +- Agents have distinct, non-overlapping roles +- Users invoke agents manually +- Clear agent responsibilities + +### Capability-Based Organization + +Organize by specific capabilities: + +``` +agents/ +├── python-expert.md # Python-specific +├── typescript-expert.md # TypeScript-specific +├── api-specialist.md # API design +└── database-specialist.md # Database work +``` + +**When to use**: +- Technology-specific agents +- Domain expertise focus +- Automatic agent selection + +### Workflow-Based Organization + +Organize by workflow stage: + +``` +agents/ +├── planning-agent.md # Planning phase +├── implementation-agent.md # Coding phase +├── testing-agent.md # Testing phase +└── deployment-agent.md # Deployment phase +``` + +**When to use**: +- Sequential workflows +- Stage-specific expertise +- Pipeline automation + +## Skill Organization Patterns + +### Topic-Based Organization + +Each skill covers a specific topic: + +``` +skills/ +├── api-design/ +│ └── SKILL.md +├── error-handling/ +│ └── SKILL.md +├── testing-strategies/ +│ └── SKILL.md +└── performance-optimization/ + └── SKILL.md +``` + +**When to use**: +- Knowledge-based skills +- Educational or reference content +- Broad applicability + +### Tool-Based Organization + +Skills for specific tools or technologies: + +``` +skills/ +├── docker/ +│ ├── SKILL.md +│ └── references/ +│ └── dockerfile-best-practices.md +├── kubernetes/ +│ ├── SKILL.md +│ └── examples/ +│ └── deployment.yaml +└── terraform/ + ├── SKILL.md + └── scripts/ + └── validate-config.sh +``` + +**When to use**: +- Tool-specific expertise +- Complex tool configurations +- Tool best practices + +### Workflow-Based Organization + +Skills for complete workflows: + +``` +skills/ +├── code-review-workflow/ +│ ├── SKILL.md +│ └── references/ +│ ├── checklist.md +│ └── standards.md +├── deployment-workflow/ +│ ├── SKILL.md +│ └── scripts/ +│ ├── pre-deploy.sh +│ └── post-deploy.sh +└── testing-workflow/ + ├── SKILL.md + └── examples/ + └── test-structure.md +``` + +**When to use**: +- Multi-step processes +- Company-specific workflows +- Process automation + +### Skill with Rich Resources + +Comprehensive skill with all resource types: + +``` +skills/ +└── api-testing/ + ├── SKILL.md # Core skill (1500 words) + ├── references/ + │ ├── rest-api-guide.md + │ ├── graphql-guide.md + │ └── authentication.md + ├── examples/ + │ ├── basic-test.js + │ ├── authenticated-test.js + │ └── integration-test.js + ├── scripts/ + │ ├── run-tests.sh + │ └── generate-report.py + └── assets/ + └── test-template.json +``` + +**Resource usage**: +- **SKILL.md**: Overview and when to use resources +- **references/**: Detailed guides (loaded as needed) +- **examples/**: Copy-paste code samples +- **scripts/**: Executable test runners +- **assets/**: Templates and configurations + +## Hook Organization Patterns + +### Monolithic Configuration + +Single hooks.json with all hooks: + +``` +hooks/ +├── hooks.json # All hook definitions +└── scripts/ + ├── validate-write.sh + ├── validate-bash.sh + └── load-context.sh +``` + +**hooks.json**: +```json +{ + "PreToolUse": [...], + "PostToolUse": [...], + "Stop": [...], + "SessionStart": [...] +} +``` + +**When to use**: +- 5-10 hooks total +- Simple hook logic +- Centralized configuration + +### Event-Based Organization + +Separate files per event type: + +``` +hooks/ +├── hooks.json # Combines all +├── pre-tool-use.json # PreToolUse hooks +├── post-tool-use.json # PostToolUse hooks +├── stop.json # Stop hooks +└── scripts/ + ├── validate/ + │ ├── write.sh + │ └── bash.sh + └── context/ + └── load.sh +``` + +**hooks.json** (combines): +```json +{ + "PreToolUse": ${file:./pre-tool-use.json}, + "PostToolUse": ${file:./post-tool-use.json}, + "Stop": ${file:./stop.json} +} +``` + +**Note**: Use build script to combine files, Claude Code doesn't support file references. + +**When to use**: +- 10+ hooks +- Different teams managing different events +- Complex hook configurations + +### Purpose-Based Organization + +Group by functional purpose: + +``` +hooks/ +├── hooks.json +└── scripts/ + ├── security/ + │ ├── validate-paths.sh + │ ├── check-credentials.sh + │ └── scan-malware.sh + ├── quality/ + │ ├── lint-code.sh + │ ├── check-tests.sh + │ └── verify-docs.sh + └── workflow/ + ├── notify-team.sh + └── update-status.sh +``` + +**When to use**: +- Many hook scripts +- Clear functional boundaries +- Team specialization + +## Script Organization Patterns + +### Flat Scripts + +All scripts in single directory: + +``` +scripts/ +├── build.sh +├── test.py +├── deploy.sh +├── validate.js +└── report.py +``` + +**When to use**: +- 5-10 scripts +- All scripts related +- Simple plugin + +### Categorized Scripts + +Group by purpose: + +``` +scripts/ +├── build/ +│ ├── compile.sh +│ └── package.sh +├── test/ +│ ├── run-unit.sh +│ └── run-integration.sh +├── deploy/ +│ ├── staging.sh +│ └── production.sh +└── utils/ + ├── log.sh + └── notify.sh +``` + +**When to use**: +- 10+ scripts +- Clear categories +- Reusable utilities + +### Language-Based Organization + +Group by programming language: + +``` +scripts/ +├── bash/ +│ ├── build.sh +│ └── deploy.sh +├── python/ +│ ├── analyze.py +│ └── report.py +└── javascript/ + ├── bundle.js + └── optimize.js +``` + +**When to use**: +- Multi-language scripts +- Different runtime requirements +- Language-specific dependencies + +## Cross-Component Patterns + +### Shared Resources + +Components sharing common resources: + +``` +plugin/ +├── commands/ +│ ├── test.md # Uses lib/test-utils.sh +│ └── deploy.md # Uses lib/deploy-utils.sh +├── agents/ +│ └── tester.md # References lib/test-utils.sh +├── hooks/ +│ └── scripts/ +│ └── pre-test.sh # Sources lib/test-utils.sh +└── lib/ + ├── test-utils.sh + └── deploy-utils.sh +``` + +**Usage in components**: +```bash +#!/bin/bash +source "${CLAUDE_PLUGIN_ROOT}/lib/test-utils.sh" +run_tests +``` + +**Benefits**: +- Code reuse +- Consistent behavior +- Easier maintenance + +### Layered Architecture + +Separate concerns into layers: + +``` +plugin/ +├── commands/ # User interface layer +├── agents/ # Orchestration layer +├── skills/ # Knowledge layer +└── lib/ + ├── core/ # Core business logic + ├── integrations/ # External services + └── utils/ # Helper functions +``` + +**When to use**: +- Large plugins (100+ files) +- Multiple developers +- Clear separation of concerns + +### Plugin Within Plugin + +Nested plugin structure: + +``` +plugin/ +├── .claude-plugin/ +│ └── plugin.json +├── core/ # Core functionality +│ ├── commands/ +│ └── agents/ +└── extensions/ # Optional extensions + ├── extension-a/ + │ ├── commands/ + │ └── agents/ + └── extension-b/ + ├── commands/ + └── agents/ +``` + +**Manifest**: +```json +{ + "commands": [ + "./core/commands", + "./extensions/extension-a/commands", + "./extensions/extension-b/commands" + ] +} +``` + +**When to use**: +- Modular functionality +- Optional features +- Plugin families + +## Best Practices + +### Naming + +1. **Consistent naming**: Match file names to component purpose +2. **Descriptive names**: Indicate what component does +3. **Avoid abbreviations**: Use full words for clarity + +### Organization + +1. **Start simple**: Use flat structure, reorganize when needed +2. **Group related items**: Keep related components together +3. **Separate concerns**: Don't mix unrelated functionality + +### Scalability + +1. **Plan for growth**: Choose structure that scales +2. **Refactor early**: Reorganize before it becomes painful +3. **Document structure**: Explain organization in README + +### Maintainability + +1. **Consistent patterns**: Use same structure throughout +2. **Minimize nesting**: Keep directory depth manageable +3. **Use conventions**: Follow community standards + +### Performance + +1. **Avoid deep nesting**: Impacts discovery time +2. **Minimize custom paths**: Use defaults when possible +3. **Keep configurations small**: Large configs slow loading diff --git a/skills/external/plugin-dev-plugin-structure/references/manifest-reference.md b/skills/external/plugin-dev-plugin-structure/references/manifest-reference.md new file mode 100644 index 0000000..40c9c2f --- /dev/null +++ b/skills/external/plugin-dev-plugin-structure/references/manifest-reference.md @@ -0,0 +1,552 @@ +# Plugin Manifest Reference + +Complete reference for `plugin.json` configuration. + +## File Location + +**Required path**: `.claude-plugin/plugin.json` + +The manifest MUST be in the `.claude-plugin/` directory at the plugin root. Claude Code will not recognize plugins without this file in the correct location. + +## Complete Field Reference + +### Core Fields + +#### name (required) + +**Type**: String +**Format**: kebab-case +**Example**: `"test-automation-suite"` + +The unique identifier for the plugin. Used for: +- Plugin identification in Claude Code +- Conflict detection with other plugins +- Command namespacing (optional) + +**Requirements**: +- Must be unique across all installed plugins +- Use only lowercase letters, numbers, and hyphens +- No spaces or special characters +- Start with a letter +- End with a letter or number + +**Validation**: +```javascript +/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/ +``` + +**Examples**: +- ✅ Good: `api-tester`, `code-review`, `git-workflow-automation` +- ❌ Bad: `API Tester`, `code_review`, `-git-workflow`, `test-` + +#### version + +**Type**: String +**Format**: Semantic versioning (MAJOR.MINOR.PATCH) +**Example**: `"2.1.0"` +**Default**: `"0.1.0"` if not specified + +Semantic versioning guidelines: +- **MAJOR**: Incompatible API changes, breaking changes +- **MINOR**: New functionality, backward-compatible +- **PATCH**: Bug fixes, backward-compatible + +**Pre-release versions**: +- `"1.0.0-alpha.1"` - Alpha release +- `"1.0.0-beta.2"` - Beta release +- `"1.0.0-rc.1"` - Release candidate + +**Examples**: +- `"0.1.0"` - Initial development +- `"1.0.0"` - First stable release +- `"1.2.3"` - Patch update to 1.2 +- `"2.0.0"` - Major version with breaking changes + +#### description + +**Type**: String +**Length**: 50-200 characters recommended +**Example**: `"Automates code review workflows with style checks and automated feedback"` + +Brief explanation of plugin purpose and functionality. + +**Best practices**: +- Focus on what the plugin does, not how +- Use active voice +- Mention key features or benefits +- Keep under 200 characters for marketplace display + +**Examples**: +- ✅ "Generates comprehensive test suites from code analysis and coverage reports" +- ✅ "Integrates with Jira for automatic issue tracking and sprint management" +- ❌ "A plugin that helps you do testing stuff" +- ❌ "This is a very long description that goes on and on about every single feature..." + +### Metadata Fields + +#### author + +**Type**: Object +**Fields**: name (required), email (optional), url (optional) + +```json +{ + "author": { + "name": "Jane Developer", + "email": "jane@example.com", + "url": "https://janedeveloper.com" + } +} +``` + +**Alternative format** (string only): +```json +{ + "author": "Jane Developer (https://janedeveloper.com)" +} +``` + +**Use cases**: +- Credit and attribution +- Contact for support or questions +- Marketplace display +- Community recognition + +#### homepage + +**Type**: String (URL) +**Example**: `"https://docs.example.com/plugins/my-plugin"` + +Link to plugin documentation or landing page. + +**Should point to**: +- Plugin documentation site +- Project homepage +- Detailed usage guide +- Installation instructions + +**Not for**: +- Source code (use `repository` field) +- Issue tracker (include in documentation) +- Personal websites (use `author.url`) + +#### repository + +**Type**: String (URL) or Object +**Example**: `"https://github.com/user/plugin-name"` + +Source code repository location. + +**String format**: +```json +{ + "repository": "https://github.com/user/plugin-name" +} +``` + +**Object format** (detailed): +```json +{ + "repository": { + "type": "git", + "url": "https://github.com/user/plugin-name.git", + "directory": "packages/plugin-name" + } +} +``` + +**Use cases**: +- Source code access +- Issue reporting +- Community contributions +- Transparency and trust + +#### license + +**Type**: String +**Format**: SPDX identifier +**Example**: `"MIT"` + +Software license identifier. + +**Common licenses**: +- `"MIT"` - Permissive, popular choice +- `"Apache-2.0"` - Permissive with patent grant +- `"GPL-3.0"` - Copyleft +- `"BSD-3-Clause"` - Permissive +- `"ISC"` - Permissive, similar to MIT +- `"UNLICENSED"` - Proprietary, not open source + +**Full list**: https://spdx.org/licenses/ + +**Multiple licenses**: +```json +{ + "license": "(MIT OR Apache-2.0)" +} +``` + +#### keywords + +**Type**: Array of strings +**Example**: `["testing", "automation", "ci-cd", "quality-assurance"]` + +Tags for plugin discovery and categorization. + +**Best practices**: +- Use 5-10 keywords +- Include functionality categories +- Add technology names +- Use common search terms +- Avoid duplicating plugin name + +**Categories to consider**: +- Functionality: `testing`, `debugging`, `documentation`, `deployment` +- Technologies: `typescript`, `python`, `docker`, `aws` +- Workflows: `ci-cd`, `code-review`, `git-workflow` +- Domains: `web-development`, `data-science`, `devops` + +### Component Path Fields + +#### commands + +**Type**: String or Array of strings +**Default**: `["./commands"]` +**Example**: `"./cli-commands"` + +Additional directories or files containing command definitions. + +**Single path**: +```json +{ + "commands": "./custom-commands" +} +``` + +**Multiple paths**: +```json +{ + "commands": [ + "./commands", + "./admin-commands", + "./experimental-commands" + ] +} +``` + +**Behavior**: Supplements default `commands/` directory (does not replace) + +**Use cases**: +- Organizing commands by category +- Separating stable from experimental commands +- Loading commands from shared locations + +#### agents + +**Type**: String or Array of strings +**Default**: `["./agents"]` +**Example**: `"./specialized-agents"` + +Additional directories or files containing agent definitions. + +**Format**: Same as `commands` field + +**Use cases**: +- Grouping agents by specialization +- Separating general-purpose from task-specific agents +- Loading agents from plugin dependencies + +#### hooks + +**Type**: String (path to JSON file) or Object (inline configuration) +**Default**: `"./hooks/hooks.json"` + +Hook configuration location or inline definition. + +**File path**: +```json +{ + "hooks": "./config/hooks.json" +} +``` + +**Inline configuration**: +```json +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh", + "timeout": 30 + } + ] + } + ] + } +} +``` + +**Use cases**: +- Simple plugins: Inline configuration (< 50 lines) +- Complex plugins: External JSON file +- Multiple hook sets: Separate files for different contexts + +#### mcpServers + +**Type**: String (path to JSON file) or Object (inline configuration) +**Default**: `./.mcp.json` + +MCP server configuration location or inline definition. + +**File path**: +```json +{ + "mcpServers": "./.mcp.json" +} +``` + +**Inline configuration**: +```json +{ + "mcpServers": { + "github": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/servers/github-mcp.js"], + "env": { + "GITHUB_TOKEN": "${GITHUB_TOKEN}" + } + } + } +} +``` + +**Use cases**: +- Simple plugins: Single inline server (< 20 lines) +- Complex plugins: External `.mcp.json` file +- Multiple servers: Always use external file + +## Path Resolution + +### Relative Path Rules + +All paths in component fields must follow these rules: + +1. **Must be relative**: No absolute paths +2. **Must start with `./`**: Indicates relative to plugin root +3. **Cannot use `../`**: No parent directory navigation +4. **Forward slashes only**: Even on Windows + +**Examples**: +- ✅ `"./commands"` +- ✅ `"./src/commands"` +- ✅ `"./configs/hooks.json"` +- ❌ `"/Users/name/plugin/commands"` +- ❌ `"commands"` (missing `./`) +- ❌ `"../shared/commands"` +- ❌ `".\\commands"` (backslash) + +### Resolution Order + +When Claude Code loads components: + +1. **Default directories**: Scans standard locations first + - `./commands/` + - `./agents/` + - `./skills/` + - `./hooks/hooks.json` + - `./.mcp.json` + +2. **Custom paths**: Scans paths specified in manifest + - Paths from `commands` field + - Paths from `agents` field + - Files from `hooks` and `mcpServers` fields + +3. **Merge behavior**: Components from all locations load + - No overwriting + - All discovered components register + - Name conflicts cause errors + +## Validation + +### Manifest Validation + +Claude Code validates the manifest on plugin load: + +**Syntax validation**: +- Valid JSON format +- No syntax errors +- Correct field types + +**Field validation**: +- `name` field present and valid format +- `version` follows semantic versioning (if present) +- Paths are relative with `./` prefix +- URLs are valid (if present) + +**Component validation**: +- Referenced paths exist +- Hook and MCP configurations are valid +- No circular dependencies + +### Common Validation Errors + +**Invalid name format**: +```json +{ + "name": "My Plugin" // ❌ Contains spaces +} +``` +Fix: Use kebab-case +```json +{ + "name": "my-plugin" // ✅ +} +``` + +**Absolute path**: +```json +{ + "commands": "/Users/name/commands" // ❌ Absolute path +} +``` +Fix: Use relative path +```json +{ + "commands": "./commands" // ✅ +} +``` + +**Missing ./ prefix**: +```json +{ + "hooks": "hooks/hooks.json" // ❌ No ./ +} +``` +Fix: Add ./ prefix +```json +{ + "hooks": "./hooks/hooks.json" // ✅ +} +``` + +**Invalid version**: +```json +{ + "version": "1.0" // ❌ Not semantic versioning +} +``` +Fix: Use MAJOR.MINOR.PATCH +```json +{ + "version": "1.0.0" // ✅ +} +``` + +## Minimal vs. Complete Examples + +### Minimal Plugin + +Bare minimum for a working plugin: + +```json +{ + "name": "hello-world" +} +``` + +Relies entirely on default directory discovery. + +### Recommended Plugin + +Good metadata for distribution: + +```json +{ + "name": "code-review-assistant", + "version": "1.0.0", + "description": "Automates code review with style checks and suggestions", + "author": { + "name": "Jane Developer", + "email": "jane@example.com" + }, + "homepage": "https://docs.example.com/code-review", + "repository": "https://github.com/janedev/code-review-assistant", + "license": "MIT", + "keywords": ["code-review", "automation", "quality", "ci-cd"] +} +``` + +### Complete Plugin + +Full configuration with all features: + +```json +{ + "name": "enterprise-devops", + "version": "2.3.1", + "description": "Comprehensive DevOps automation for enterprise CI/CD pipelines", + "author": { + "name": "DevOps Team", + "email": "devops@company.com", + "url": "https://company.com/devops" + }, + "homepage": "https://docs.company.com/plugins/devops", + "repository": { + "type": "git", + "url": "https://github.com/company/devops-plugin.git" + }, + "license": "Apache-2.0", + "keywords": [ + "devops", + "ci-cd", + "automation", + "kubernetes", + "docker", + "deployment" + ], + "commands": [ + "./commands", + "./admin-commands" + ], + "agents": "./specialized-agents", + "hooks": "./config/hooks.json", + "mcpServers": "./.mcp.json" +} +``` + +## Best Practices + +### Metadata + +1. **Always include version**: Track changes and updates +2. **Write clear descriptions**: Help users understand plugin purpose +3. **Provide contact information**: Enable user support +4. **Link to documentation**: Reduce support burden +5. **Choose appropriate license**: Match project goals + +### Paths + +1. **Use defaults when possible**: Minimize configuration +2. **Organize logically**: Group related components +3. **Document custom paths**: Explain why non-standard layout used +4. **Test path resolution**: Verify on multiple systems + +### Maintenance + +1. **Bump version on changes**: Follow semantic versioning +2. **Update keywords**: Reflect new functionality +3. **Keep description current**: Match actual capabilities +4. **Maintain changelog**: Track version history +5. **Update repository links**: Keep URLs current + +### Distribution + +1. **Complete metadata before publishing**: All fields filled +2. **Test on clean install**: Verify plugin works without dev environment +3. **Validate manifest**: Use validation tools +4. **Include README**: Document installation and usage +5. **Specify license file**: Include LICENSE file in plugin root diff --git a/skills/external/plugin-dev-skill-development/SKILL.md b/skills/external/plugin-dev-skill-development/SKILL.md new file mode 100644 index 0000000..fe75453 --- /dev/null +++ b/skills/external/plugin-dev-skill-development/SKILL.md @@ -0,0 +1,693 @@ +--- +name: skill-development +description: This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins. +--- + +# Skill Development for Claude Code Plugins + +This skill provides guidance for creating effective skills for Claude Code plugins. + +## About Skills + +Skills are modular, self-contained packages that extend Claude's capabilities by providing +specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific +domains or tasks—they transform Claude from a general-purpose agent into a specialized agent +equipped with procedural knowledge that no model can fully possess. + +### What Skills Provide + +1. Specialized workflows - Multi-step procedures for specific domains +2. Tool integrations - Instructions for working with specific file formats or APIs +3. Domain expertise - Company-specific knowledge, schemas, business logic +4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks + +### Anatomy of a Skill + +Every skill consists of a required SKILL.md file and optional bundled resources: + +``` +skill-name/ +├── SKILL.md (required) +│ ├── YAML frontmatter metadata (required) +│ │ ├── name: (required) +│ │ └── description: (required) +│ └── Markdown instructions (required) +└── Bundled Resources (optional) + ├── scripts/ - Executable code (Python/Bash/etc.) + ├── references/ - Documentation intended to be loaded into context as needed + └── assets/ - Files used in output (templates, icons, fonts, etc.) +``` + +#### SKILL.md (required) + +**Metadata Quality:** The `name` and `description` in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when..."). + +#### Bundled Resources (optional) + +##### Scripts (`scripts/`) + +Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten. + +- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed +- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks +- **Benefits**: Token efficient, deterministic, may be executed without loading into context +- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments + +##### References (`references/`) + +Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking. + +- **When to include**: For documentation that Claude should reference while working +- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications +- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides +- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed +- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md +- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files. + +##### Assets (`assets/`) + +Files not intended to be loaded into context, but rather used within the output Claude produces. + +- **When to include**: When the skill needs files that will be used in the final output +- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography +- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified +- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context + +### Progressive Disclosure Design Principle + +Skills use a three-level loading system to manage context efficiently: + +1. **Metadata (name + description)** - Always in context (~100 words) +2. **SKILL.md body** - When skill triggers (<5k words) +3. **Bundled resources** - As needed by Claude (Unlimited\*) + +\*Unlimited because scripts can be executed without reading into context window. + +## Skill Creation Process + +To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable. + +### Step 1: Understanding the Skill with Concrete Examples + +Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill. + +To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback. + +For example, when building an image-editor skill, relevant questions include: + +- "What functionality should the image-editor skill support? Editing, rotating, anything else?" +- "Can you give some examples of how this skill would be used?" +- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?" +- "What would a user say that should trigger this skill?" + +To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness. + +Conclude this step when there is a clear sense of the functionality the skill should support. + +### Step 2: Planning the Reusable Skill Contents + +To turn concrete examples into an effective skill, analyze each example by: + +1. Considering how to execute on the example from scratch +2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly + +Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows: + +1. Rotating a PDF requires re-writing the same code each time +2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill + +Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows: + +1. Writing a frontend webapp requires the same boilerplate HTML/React each time +2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill + +Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows: + +1. Querying BigQuery requires re-discovering the table schemas and relationships each time +2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill + +**For Claude Code plugins:** When building a hooks skill, the analysis shows: + +1. Developers repeatedly need to validate hooks.json and test hook scripts +2. `scripts/validate-hook-schema.sh` and `scripts/test-hook.sh` utilities would be helpful +3. `references/patterns.md` for detailed hook patterns to avoid bloating SKILL.md + +To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets. + +### Step 3: Create Skill Structure + +For Claude Code plugins, create the skill directory structure: + +```bash +mkdir -p plugin-name/skills/skill-name/{references,examples,scripts} +touch plugin-name/skills/skill-name/SKILL.md +``` + +**Note:** Unlike the generic skill-creator which uses `init_skill.py`, plugin skills are created directly in the plugin's `skills/` directory with a simpler manual structure. + +### Step 4: Edit the Skill + +When editing the (newly-created or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively. + +#### Start with Reusable Skill Contents + +To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`. + +Also, delete any example files and directories not needed for the skill. Create only the directories you actually need (references/, examples/, scripts/). + +#### Update SKILL.md + +**Writing Style:** Write the entire skill using **imperative/infinitive form** (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption. + +**Description (Frontmatter):** Use third-person format with specific trigger phrases. Max 300 characters: + +```yaml +--- +name: skill-name +description: This skill should be used when the user asks to "specific phrase 1", "specific phrase 2", "specific phrase 3". Include exact phrases users would say that should trigger this skill. Be concrete and specific. +version: 0.1.0 +--- +``` + +**Good description examples:** + +```yaml +description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", "implement prompt-based hooks", or mentions hook events (PreToolUse, PostToolUse, Stop). +``` + +**Bad description examples:** + +```yaml +description: Use this skill when working with hooks. # Wrong person, vague +description: Load when user needs hook help. # Not third person +description: Provides hook guidance. # No trigger phrases +``` + +To complete SKILL.md body, answer the following questions: + +1. What is the purpose of the skill, in a few sentences? +2. When should the skill be used? (Include this in frontmatter description with specific triggers) +3. In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them. + +**Keep SKILL.md lean:** Target 1,500-2,000 words for the body. Move detailed content to references/: + +- Detailed patterns → `references/patterns.md` +- Advanced techniques → `references/advanced.md` +- Migration guides → `references/migration.md` +- API references → `references/api-reference.md` + +**Reference resources in SKILL.md:** + +```markdown +## Additional Resources + +### Reference Files + +For detailed patterns and techniques, consult: + +- **`references/patterns.md`** - Common patterns +- **`references/advanced.md`** - Advanced use cases + +### Example Files + +Working examples in `examples/`: + +- **`example-script.sh`** - Working example +``` + +### Step 5: Validate and Test + +**For plugin skills, validation is different from generic skills:** + +1. **Check structure**: Skill directory in `plugin-name/skills/skill-name/` +2. **Validate SKILL.md**: Has frontmatter with name and description +3. **Check trigger phrases**: Description includes specific user queries +4. **Verify writing style**: Body uses imperative/infinitive form, not second person +5. **Test progressive disclosure**: SKILL.md is lean (~1,500-2,000 words), detailed content in references/ +6. **Check references**: All referenced files exist +7. **Validate examples**: Examples are complete and correct +8. **Test scripts**: Scripts are executable and work correctly + +**Use the skill-reviewer agent:** + +``` +Ask: "Review my skill and check if it follows best practices" +``` + +The skill-reviewer agent will check description quality, content organization, and progressive disclosure. + +### Step 6: Iterate + +After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed. + +**Iteration workflow:** + +1. Use the skill on real tasks +2. Notice struggles or inefficiencies +3. Identify how SKILL.md or bundled resources should be updated +4. Implement changes and test again + +**Common improvements:** + +- Strengthen trigger phrases in description +- Move long sections from SKILL.md to references/ +- Add missing examples or scripts +- Clarify ambiguous instructions +- Add edge case handling + +## Plugin-Specific Considerations + +### Skill Location in Plugins + +Plugin skills live in the plugin's `skills/` directory: + +``` +my-plugin/ +├── .claude-plugin/ +│ └── plugin.json +├── commands/ +├── agents/ +└── skills/ + └── my-skill/ + ├── SKILL.md + ├── references/ + ├── examples/ + └── scripts/ +``` + +### Auto-Discovery + +Claude Code automatically discovers skills: + +- Scans `skills/` directory +- Finds subdirectories containing `SKILL.md` +- Loads skill metadata (name + description) always +- Loads SKILL.md body when skill triggers +- Loads references/examples when needed + +### No Packaging Needed + +Plugin skills are distributed as part of the plugin, not as separate ZIP files. Users get skills when they install the plugin. + +### Testing in Plugins + +Test skills by installing plugin locally: + +```bash +# Test with --plugin-dir +cc --plugin-dir /path/to/plugin + +# Ask questions that should trigger the skill +# Verify skill loads correctly +``` + +## Examples from Plugin-Dev + +Study the skills in this plugin as examples of best practices: + +**hook-development skill:** + +- Excellent trigger phrases: "create a hook", "add a PreToolUse hook", etc. +- Lean SKILL.md (1,651 words) +- 3 references/ files for detailed content +- 3 examples/ of working hooks +- 3 scripts/ utilities + +**agent-development skill:** + +- Strong triggers: "create an agent", "agent frontmatter", etc. +- Focused SKILL.md (1,438 words) +- References include the AI generation prompt from Claude Code +- Complete agent examples + +**plugin-settings skill:** + +- Specific triggers: "plugin settings", ".local.md files", "YAML frontmatter" +- References show real implementations (multi-agent-swarm, ralph-wiggum) +- Working parsing scripts + +Each demonstrates progressive disclosure and strong triggering. + +## Progressive Disclosure in Practice + +### What Goes in SKILL.md + +**Include (always loaded when skill triggers):** + +- Core concepts and overview +- Essential procedures and workflows +- Quick reference tables +- Pointers to references/examples/scripts +- Most common use cases + +**Keep under 3,000 words, ideally 1,500-2,000 words** + +### What Goes in references/ + +**Move to references/ (loaded as needed):** + +- Detailed patterns and advanced techniques +- Comprehensive API documentation +- Migration guides +- Edge cases and troubleshooting +- Extensive examples and walkthroughs + +**Each reference file can be large (2,000-5,000+ words)** + +### What Goes in examples/ + +**Working code examples:** + +- Complete, runnable scripts +- Configuration files +- Template files +- Real-world usage examples + +**Users can copy and adapt these directly** + +### What Goes in scripts/ + +**Utility scripts:** + +- Validation tools +- Testing helpers +- Parsing utilities +- Automation scripts + +**Should be executable and documented** + +## Writing Style Requirements + +### Imperative/Infinitive Form + +Write using verb-first instructions, not second person: + +**Correct (imperative):** + +``` +To create a hook, define the event type. +Configure the MCP server with authentication. +Validate settings before use. +``` + +**Incorrect (second person):** + +``` +You should create a hook by defining the event type. +You need to configure the MCP server. +You must validate settings before use. +``` + +### Third-Person in Description + +The frontmatter description must use third person: + +**Correct:** + +```yaml +description: This skill should be used when the user asks to "create X", "configure Y"... +``` + +**Incorrect:** + +```yaml +description: Use this skill when you want to create X... +description: Load this skill when user asks... +``` + +### Objective, Instructional Language + +Focus on what to do, not who should do it: + +**Correct:** + +``` +Parse the frontmatter using sed. +Extract fields with grep. +Validate values before use. +``` + +**Incorrect:** + +``` +You can parse the frontmatter... +Claude should extract fields... +The user might validate values... +``` + +## Validation Checklist + +Before finalizing a skill: + +**Structure:** + +- [ ] SKILL.md file exists with valid YAML frontmatter +- [ ] Frontmatter has `name` and `description` fields +- [ ] Markdown body is present and substantial +- [ ] Referenced files actually exist + +**Description Quality:** + +- [ ] Uses third person ("This skill should be used when...") +- [ ] Includes specific trigger phrases users would say +- [ ] Lists concrete scenarios ("create X", "configure Y") +- [ ] Not vague or generic +- [ ] Description is max 300 characters + +**Content Quality:** + +- [ ] SKILL.md body uses imperative/infinitive form +- [ ] Body is focused and lean (1,500-2,000 words ideal, <5k max) +- [ ] Detailed content moved to references/ +- [ ] Examples are complete and working +- [ ] Scripts are executable and documented + +**Progressive Disclosure:** + +- [ ] Core concepts in SKILL.md +- [ ] Detailed docs in references/ +- [ ] Working code in examples/ +- [ ] Utilities in scripts/ +- [ ] SKILL.md references these resources + +**Testing:** + +- [ ] Skill triggers on expected user queries +- [ ] Content is helpful for intended tasks +- [ ] No duplicated information across files +- [ ] References load when needed + +## Common Mistakes to Avoid + +### Mistake 1: Weak Trigger Description + +❌ **Bad:** + +```yaml +description: Provides guidance for working with hooks. +``` + +**Why bad:** Vague, no specific trigger phrases, not third person + +✅ **Good:** + +```yaml +description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", or mentions hook events. Provides comprehensive hooks API guidance. +``` + +**Why good:** Third person, specific phrases, concrete scenarios + +### Mistake 2: Too Much in SKILL.md + +❌ **Bad:** + +``` +skill-name/ +└── SKILL.md (8,000 words - everything in one file) +``` + +**Why bad:** Bloats context when skill loads, detailed content always loaded + +✅ **Good:** + +``` +skill-name/ +├── SKILL.md (1,800 words - core essentials) +└── references/ + ├── patterns.md (2,500 words) + └── advanced.md (3,700 words) +``` + +**Why good:** Progressive disclosure, detailed content loaded only when needed + +### Mistake 3: Second Person Writing + +❌ **Bad:** + +```markdown +You should start by reading the configuration file. +You need to validate the input. +You can use the grep tool to search. +``` + +**Why bad:** Second person, not imperative form + +✅ **Good:** + +```markdown +Start by reading the configuration file. +Validate the input before processing. +Use the grep tool to search for patterns. +``` + +**Why good:** Imperative form, direct instructions + +### Mistake 4: Missing Resource References + +❌ **Bad:** + +```markdown +# SKILL.md + +[Core content] + +[No mention of references/ or examples/] +``` + +**Why bad:** Claude doesn't know references exist + +### Mistake 5: Incorrect Name Metadata Format + +❌ **Bad:** + +```yaml +name: Skill Name +``` + +**Why bad:** Name should be lowercase with hyphens + +✅ **Good:** + +```yaml +name: skill-name +``` + +## Additional Resources + +### Reference Files + +- **`references/patterns.md`** - Detailed patterns +- **`references/advanced.md`** - Advanced techniques + +### Examples + +- **`examples/script.sh`** - Working example + +``` + +**Why good:** Claude knows where to find additional information + +## Quick Reference + +### Minimal Skill + +``` + +skill-name/ +└── SKILL.md + +``` + +Good for: Simple knowledge, no complex resources needed + +### Standard Skill (Recommended) + +``` + +skill-name/ +├── SKILL.md +├── references/ +│ └── detailed-guide.md +└── examples/ +└── working-example.sh + +``` + +Good for: Most plugin skills with detailed documentation + +### Complete Skill + +``` + +skill-name/ +├── SKILL.md +├── references/ +│ ├── patterns.md +│ └── advanced.md +├── examples/ +│ ├── example1.sh +│ └── example2.json +└── scripts/ +└── validate.sh + +``` + +Good for: Complex domains with validation utilities + +## Best Practices Summary + +✅ **DO:** +- Use third-person in description ("This skill should be used when...") +- Include specific trigger phrases ("create X", "configure Y") +- Keep SKILL.md lean (1,500-2,000 words) +- Use progressive disclosure (move details to references/) +- Write in imperative/infinitive form +- Reference supporting files clearly +- Provide working examples +- Create utility scripts for common operations +- Study plugin-dev's skills as templates + +❌ **DON'T:** +- Use second person anywhere +- Have vague trigger conditions +- Put everything in SKILL.md (>3,000 words without references/) +- Write in second person ("You should...") +- Leave resources unreferenced +- Include broken or incomplete examples +- Skip validation + +## Additional Resources + +### Study These Skills + +Plugin-dev's skills demonstrate best practices: +- `../hook-development/` - Progressive disclosure, utilities +- `../agent-development/` - AI-assisted creation, references +- `../mcp-integration/` - Comprehensive references +- `../plugin-settings/` - Real-world examples +- `../command-development/` - Clear critical concepts +- `../plugin-structure/` - Good organization + +### Reference Files + +For complete skill-creator methodology: +- **`references/skill-creator-original.md`** - Full original skill-creator content + +## Implementation Workflow + +To create a skill for your plugin: + +1. **Understand use cases**: Identify concrete examples of skill usage +2. **Plan resources**: Determine what scripts/references/examples needed +3. **Create structure**: `mkdir -p skills/skill-name/{references,examples,scripts}` +4. **Write SKILL.md**: + - Frontmatter with third-person description and trigger phrases + - Lean body (1,500-2,000 words) in imperative form + - Reference supporting files +5. **Add resources**: Create references/, examples/, scripts/ as needed +6. **Validate**: Check description, writing style, organization +7. **Test**: Verify skill loads on expected triggers +8. **Iterate**: Improve based on usage + +Focus on strong trigger descriptions, progressive disclosure, and imperative writing style for effective skills that load when needed and provide targeted guidance. +``` diff --git a/skills/external/plugin-dev-skill-development/references/skill-creator-original.md b/skills/external/plugin-dev-skill-development/references/skill-creator-original.md new file mode 100644 index 0000000..4069935 --- /dev/null +++ b/skills/external/plugin-dev-skill-development/references/skill-creator-original.md @@ -0,0 +1,209 @@ +--- +name: skill-creator +description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations. +license: Complete terms in LICENSE.txt +--- + +# Skill Creator + +This skill provides guidance for creating effective skills. + +## About Skills + +Skills are modular, self-contained packages that extend Claude's capabilities by providing +specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific +domains or tasks—they transform Claude from a general-purpose agent into a specialized agent +equipped with procedural knowledge that no model can fully possess. + +### What Skills Provide + +1. Specialized workflows - Multi-step procedures for specific domains +2. Tool integrations - Instructions for working with specific file formats or APIs +3. Domain expertise - Company-specific knowledge, schemas, business logic +4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks + +### Anatomy of a Skill + +Every skill consists of a required SKILL.md file and optional bundled resources: + +``` +skill-name/ +├── SKILL.md (required) +│ ├── YAML frontmatter metadata (required) +│ │ ├── name: (required) +│ │ └── description: (required) +│ └── Markdown instructions (required) +└── Bundled Resources (optional) + ├── scripts/ - Executable code (Python/Bash/etc.) + ├── references/ - Documentation intended to be loaded into context as needed + └── assets/ - Files used in output (templates, icons, fonts, etc.) +``` + +#### SKILL.md (required) + +**Metadata Quality:** The `name` and `description` in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when..."). + +#### Bundled Resources (optional) + +##### Scripts (`scripts/`) + +Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten. + +- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed +- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks +- **Benefits**: Token efficient, deterministic, may be executed without loading into context +- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments + +##### References (`references/`) + +Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking. + +- **When to include**: For documentation that Claude should reference while working +- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications +- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides +- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed +- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md +- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files. + +##### Assets (`assets/`) + +Files not intended to be loaded into context, but rather used within the output Claude produces. + +- **When to include**: When the skill needs files that will be used in the final output +- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography +- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified +- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context + +### Progressive Disclosure Design Principle + +Skills use a three-level loading system to manage context efficiently: + +1. **Metadata (name + description)** - Always in context (~100 words) +2. **SKILL.md body** - When skill triggers (<5k words) +3. **Bundled resources** - As needed by Claude (Unlimited*) + +*Unlimited because scripts can be executed without reading into context window. + +## Skill Creation Process + +To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable. + +### Step 1: Understanding the Skill with Concrete Examples + +Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill. + +To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback. + +For example, when building an image-editor skill, relevant questions include: + +- "What functionality should the image-editor skill support? Editing, rotating, anything else?" +- "Can you give some examples of how this skill would be used?" +- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?" +- "What would a user say that should trigger this skill?" + +To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness. + +Conclude this step when there is a clear sense of the functionality the skill should support. + +### Step 2: Planning the Reusable Skill Contents + +To turn concrete examples into an effective skill, analyze each example by: + +1. Considering how to execute on the example from scratch +2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly + +Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows: + +1. Rotating a PDF requires re-writing the same code each time +2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill + +Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows: + +1. Writing a frontend webapp requires the same boilerplate HTML/React each time +2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill + +Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows: + +1. Querying BigQuery requires re-discovering the table schemas and relationships each time +2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill + +To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets. + +### Step 3: Initializing the Skill + +At this point, it is time to actually create the skill. + +Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step. + +When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable. + +Usage: + +```bash +scripts/init_skill.py --path +``` + +The script: + +- Creates the skill directory at the specified path +- Generates a SKILL.md template with proper frontmatter and TODO placeholders +- Creates example resource directories: `scripts/`, `references/`, and `assets/` +- Adds example files in each directory that can be customized or deleted + +After initialization, customize or remove the generated SKILL.md and example files as needed. + +### Step 4: Edit the Skill + +When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively. + +#### Start with Reusable Skill Contents + +To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`. + +Also, delete any example files and directories not needed for the skill. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them. + +#### Update SKILL.md + +**Writing Style:** Write the entire skill using **imperative/infinitive form** (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption. + +To complete SKILL.md, answer the following questions: + +1. What is the purpose of the skill, in a few sentences? +2. When should the skill be used? +3. In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them. + +### Step 5: Packaging a Skill + +Once the skill is ready, it should be packaged into a distributable zip file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements: + +```bash +scripts/package_skill.py +``` + +Optional output directory specification: + +```bash +scripts/package_skill.py ./dist +``` + +The packaging script will: + +1. **Validate** the skill automatically, checking: + - YAML frontmatter format and required fields + - Skill naming conventions and directory structure + - Description completeness and quality + - File organization and resource references + +2. **Package** the skill if validation passes, creating a zip file named after the skill (e.g., `my-skill.zip`) that includes all files and maintains the proper directory structure for distribution. + +If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again. + +### Step 6: Iterate + +After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed. + +**Iteration workflow:** +1. Use the skill on real tasks +2. Notice struggles or inefficiencies +3. Identify how SKILL.md or bundled resources should be updated +4. Implement changes and test again diff --git a/skills/external/receiving-code-review/SKILL.md b/skills/external/receiving-code-review/SKILL.md new file mode 100644 index 0000000..4ea72cd --- /dev/null +++ b/skills/external/receiving-code-review/SKILL.md @@ -0,0 +1,213 @@ +--- +name: receiving-code-review +description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation +--- + +# Code Review Reception + +## Overview + +Code review requires technical evaluation, not emotional performance. + +**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort. + +## The Response Pattern + +``` +WHEN receiving code review feedback: + +1. READ: Complete feedback without reacting +2. UNDERSTAND: Restate requirement in own words (or ask) +3. VERIFY: Check against codebase reality +4. EVALUATE: Technically sound for THIS codebase? +5. RESPOND: Technical acknowledgment or reasoned pushback +6. IMPLEMENT: One item at a time, test each +``` + +## Forbidden Responses + +**NEVER:** +- "You're absolutely right!" (explicit CLAUDE.md violation) +- "Great point!" / "Excellent feedback!" (performative) +- "Let me implement that now" (before verification) + +**INSTEAD:** +- Restate the technical requirement +- Ask clarifying questions +- Push back with technical reasoning if wrong +- Just start working (actions > words) + +## Handling Unclear Feedback + +``` +IF any item is unclear: + STOP - do not implement anything yet + ASK for clarification on unclear items + +WHY: Items may be related. Partial understanding = wrong implementation. +``` + +**Example:** +``` +your human partner: "Fix 1-6" +You understand 1,2,3,6. Unclear on 4,5. + +❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later +✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding." +``` + +## Source-Specific Handling + +### From your human partner +- **Trusted** - implement after understanding +- **Still ask** if scope unclear +- **No performative agreement** +- **Skip to action** or technical acknowledgment + +### From External Reviewers +``` +BEFORE implementing: + 1. Check: Technically correct for THIS codebase? + 2. Check: Breaks existing functionality? + 3. Check: Reason for current implementation? + 4. Check: Works on all platforms/versions? + 5. Check: Does reviewer understand full context? + +IF suggestion seems wrong: + Push back with technical reasoning + +IF can't easily verify: + Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?" + +IF conflicts with your human partner's prior decisions: + Stop and discuss with your human partner first +``` + +**your human partner's rule:** "External feedback - be skeptical, but check carefully" + +## YAGNI Check for "Professional" Features + +``` +IF reviewer suggests "implementing properly": + grep codebase for actual usage + + IF unused: "This endpoint isn't called. Remove it (YAGNI)?" + IF used: Then implement properly +``` + +**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it." + +## Implementation Order + +``` +FOR multi-item feedback: + 1. Clarify anything unclear FIRST + 2. Then implement in this order: + - Blocking issues (breaks, security) + - Simple fixes (typos, imports) + - Complex fixes (refactoring, logic) + 3. Test each fix individually + 4. Verify no regressions +``` + +## When To Push Back + +Push back when: +- Suggestion breaks existing functionality +- Reviewer lacks full context +- Violates YAGNI (unused feature) +- Technically incorrect for this stack +- Legacy/compatibility reasons exist +- Conflicts with your human partner's architectural decisions + +**How to push back:** +- Use technical reasoning, not defensiveness +- Ask specific questions +- Reference working tests/code +- Involve your human partner if architectural + +**Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K" + +## Acknowledging Correct Feedback + +When feedback IS correct: +``` +✅ "Fixed. [Brief description of what changed]" +✅ "Good catch - [specific issue]. Fixed in [location]." +✅ [Just fix it and show in the code] + +❌ "You're absolutely right!" +❌ "Great point!" +❌ "Thanks for catching that!" +❌ "Thanks for [anything]" +❌ ANY gratitude expression +``` + +**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback. + +**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead. + +## Gracefully Correcting Your Pushback + +If you pushed back and were wrong: +``` +✅ "You were right - I checked [X] and it does [Y]. Implementing now." +✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing." + +❌ Long apology +❌ Defending why you pushed back +❌ Over-explaining +``` + +State the correction factually and move on. + +## Common Mistakes + +| Mistake | Fix | +|---------|-----| +| Performative agreement | State requirement or just act | +| Blind implementation | Verify against codebase first | +| Batch without testing | One at a time, test each | +| Assuming reviewer is right | Check if breaks things | +| Avoiding pushback | Technical correctness > comfort | +| Partial implementation | Clarify all items first | +| Can't verify, proceed anyway | State limitation, ask for direction | + +## Real Examples + +**Performative Agreement (Bad):** +``` +Reviewer: "Remove legacy code" +❌ "You're absolutely right! Let me remove that..." +``` + +**Technical Verification (Good):** +``` +Reviewer: "Remove legacy code" +✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?" +``` + +**YAGNI (Good):** +``` +Reviewer: "Implement proper metrics tracking with database, date filters, CSV export" +✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?" +``` + +**Unclear Item (Good):** +``` +your human partner: "Fix items 1-6" +You understand 1,2,3,6. Unclear on 4,5. +✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing." +``` + +## GitHub Thread Replies + +When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment. + +## The Bottom Line + +**External feedback = suggestions to evaluate, not orders to follow.** + +Verify. Question. Then implement. + +No performative agreement. Technical rigor always. diff --git a/skills/external/requesting-code-review/SKILL.md b/skills/external/requesting-code-review/SKILL.md new file mode 100644 index 0000000..f0e3395 --- /dev/null +++ b/skills/external/requesting-code-review/SKILL.md @@ -0,0 +1,105 @@ +--- +name: requesting-code-review +description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements +--- + +# Requesting Code Review + +Dispatch superpowers:code-reviewer subagent to catch issues before they cascade. + +**Core principle:** Review early, review often. + +## When to Request Review + +**Mandatory:** +- After each task in subagent-driven development +- After completing major feature +- Before merge to main + +**Optional but valuable:** +- When stuck (fresh perspective) +- Before refactoring (baseline check) +- After fixing complex bug + +## How to Request + +**1. Get git SHAs:** +```bash +BASE_SHA=$(git rev-parse HEAD~1) # or origin/main +HEAD_SHA=$(git rev-parse HEAD) +``` + +**2. Dispatch code-reviewer subagent:** + +Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md` + +**Placeholders:** +- `{WHAT_WAS_IMPLEMENTED}` - What you just built +- `{PLAN_OR_REQUIREMENTS}` - What it should do +- `{BASE_SHA}` - Starting commit +- `{HEAD_SHA}` - Ending commit +- `{DESCRIPTION}` - Brief summary + +**3. Act on feedback:** +- Fix Critical issues immediately +- Fix Important issues before proceeding +- Note Minor issues for later +- Push back if reviewer is wrong (with reasoning) + +## Example + +``` +[Just completed Task 2: Add verification function] + +You: Let me request code review before proceeding. + +BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}') +HEAD_SHA=$(git rev-parse HEAD) + +[Dispatch superpowers:code-reviewer subagent] + WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index + PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md + BASE_SHA: a7981ec + HEAD_SHA: 3df7661 + DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types + +[Subagent returns]: + Strengths: Clean architecture, real tests + Issues: + Important: Missing progress indicators + Minor: Magic number (100) for reporting interval + Assessment: Ready to proceed + +You: [Fix progress indicators] +[Continue to Task 3] +``` + +## Integration with Workflows + +**Subagent-Driven Development:** +- Review after EACH task +- Catch issues before they compound +- Fix before moving to next task + +**Executing Plans:** +- Review after each batch (3 tasks) +- Get feedback, apply, continue + +**Ad-Hoc Development:** +- Review before merge +- Review when stuck + +## Red Flags + +**Never:** +- Skip review because "it's simple" +- Ignore Critical issues +- Proceed with unfixed Important issues +- Argue with valid technical feedback + +**If reviewer wrong:** +- Push back with technical reasoning +- Show code/tests that prove it works +- Request clarification + +See template at: requesting-code-review/code-reviewer.md diff --git a/skills/external/requesting-code-review/code-reviewer.md b/skills/external/requesting-code-review/code-reviewer.md new file mode 100644 index 0000000..3c427c9 --- /dev/null +++ b/skills/external/requesting-code-review/code-reviewer.md @@ -0,0 +1,146 @@ +# Code Review Agent + +You are reviewing code changes for production readiness. + +**Your task:** +1. Review {WHAT_WAS_IMPLEMENTED} +2. Compare against {PLAN_OR_REQUIREMENTS} +3. Check code quality, architecture, testing +4. Categorize issues by severity +5. Assess production readiness + +## What Was Implemented + +{DESCRIPTION} + +## Requirements/Plan + +{PLAN_REFERENCE} + +## Git Range to Review + +**Base:** {BASE_SHA} +**Head:** {HEAD_SHA} + +```bash +git diff --stat {BASE_SHA}..{HEAD_SHA} +git diff {BASE_SHA}..{HEAD_SHA} +``` + +## Review Checklist + +**Code Quality:** +- Clean separation of concerns? +- Proper error handling? +- Type safety (if applicable)? +- DRY principle followed? +- Edge cases handled? + +**Architecture:** +- Sound design decisions? +- Scalability considerations? +- Performance implications? +- Security concerns? + +**Testing:** +- Tests actually test logic (not mocks)? +- Edge cases covered? +- Integration tests where needed? +- All tests passing? + +**Requirements:** +- All plan requirements met? +- Implementation matches spec? +- No scope creep? +- Breaking changes documented? + +**Production Readiness:** +- Migration strategy (if schema changes)? +- Backward compatibility considered? +- Documentation complete? +- No obvious bugs? + +## Output Format + +### Strengths +[What's well done? Be specific.] + +### Issues + +#### Critical (Must Fix) +[Bugs, security issues, data loss risks, broken functionality] + +#### Important (Should Fix) +[Architecture problems, missing features, poor error handling, test gaps] + +#### Minor (Nice to Have) +[Code style, optimization opportunities, documentation improvements] + +**For each issue:** +- File:line reference +- What's wrong +- Why it matters +- How to fix (if not obvious) + +### Recommendations +[Improvements for code quality, architecture, or process] + +### Assessment + +**Ready to merge?** [Yes/No/With fixes] + +**Reasoning:** [Technical assessment in 1-2 sentences] + +## Critical Rules + +**DO:** +- Categorize by actual severity (not everything is Critical) +- Be specific (file:line, not vague) +- Explain WHY issues matter +- Acknowledge strengths +- Give clear verdict + +**DON'T:** +- Say "looks good" without checking +- Mark nitpicks as Critical +- Give feedback on code you didn't review +- Be vague ("improve error handling") +- Avoid giving a clear verdict + +## Example Output + +``` +### Strengths +- Clean database schema with proper migrations (db.ts:15-42) +- Comprehensive test coverage (18 tests, all edge cases) +- Good error handling with fallbacks (summarizer.ts:85-92) + +### Issues + +#### Important +1. **Missing help text in CLI wrapper** + - File: index-conversations:1-31 + - Issue: No --help flag, users won't discover --concurrency + - Fix: Add --help case with usage examples + +2. **Date validation missing** + - File: search.ts:25-27 + - Issue: Invalid dates silently return no results + - Fix: Validate ISO format, throw error with example + +#### Minor +1. **Progress indicators** + - File: indexer.ts:130 + - Issue: No "X of Y" counter for long operations + - Impact: Users don't know how long to wait + +### Recommendations +- Add progress reporting for user experience +- Consider config file for excluded projects (portability) + +### Assessment + +**Ready to merge: With fixes** + +**Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality. +``` diff --git a/skills/external/slack-tools-setup/SKILL.md b/skills/external/slack-tools-setup/SKILL.md new file mode 100644 index 0000000..e8b7178 --- /dev/null +++ b/skills/external/slack-tools-setup/SKILL.md @@ -0,0 +1,18 @@ +--- +name: setup +description: This skill should be used when user encounters "Slack MCP error", "invalid_auth", "missing_scope", "Slack not working", "Slack token invalid", "channel_not_found", or needs help configuring Slack integration. +--- + +# Slack Tools Setup + +Run `/slack-tools:setup` to configure Slack MCP. + +## Quick Fixes + +- **invalid_auth** - Token expired, regenerate at api.slack.com +- **missing_scope** - Re-install Slack app with required scopes +- **channel_not_found** - Bot not invited to channel + +## Don't Need Slack? + +Disable via `/mcp` command to prevent errors. diff --git a/skills/external/slack-tools-slack-usage/SKILL.md b/skills/external/slack-tools-slack-usage/SKILL.md new file mode 100644 index 0000000..3268596 --- /dev/null +++ b/skills/external/slack-tools-slack-usage/SKILL.md @@ -0,0 +1,75 @@ +--- +name: slack-usage +description: This skill should be used when user asks to "search Slack for messages", "find Slack messages about X", "get channel history", "look up conversation in Slack", or "find what someone said in Slack". +--- + +# Slack Usage Best Practices + +## Critical Search Rule + +**ALWAYS use `mcp__slack__slack_search_messages` first** for message searches. Only use `mcp__slack__slack_get_channel_history` when explicitly asked for recent channel history. + +Search is more efficient and finds messages across all channels. Channel history only shows recent messages in one channel. + +## Slack API Best Practices + +### Rate Limiting + +Slack APIs have rate limits (typically 1 request per second for most methods). When making multiple requests: + +- Space out bulk operations +- Handle rate limit errors gracefully +- Cache results when possible + +### Channel Types + +- **Public channels** - Visible to all workspace members +- **Private channels** - Invite-only, prefix with lock icon +- **DMs** - Direct messages between users +- **Group DMs** - Multi-person direct conversations + +### Message Formatting + +Format mentions and links properly: + +- User mention: `<@USER_ID>` +- Channel link: `<#CHANNEL_ID>` +- URL with text: `` +- Bold: `*text*` +- Code: backticks for inline, triple backticks for blocks + +### Threading Best Practices + +- Use threads for discussions to keep channels clean +- Reply in thread when responding to specific messages +- Use "Also send to channel" sparingly (only for important updates) +- Thread replies don't trigger channel notifications by default + +### Bot vs User Tokens + +- **Bot tokens (xoxb-)**: Actions appear as the bot, limited to channels bot is in +- **User tokens (xoxp-)**: Actions appear as user, access to all user's channels +- Search typically requires user token for full workspace access +- Posting messages works with either token type + +### Common Workflows + +**Finding past discussions:** + +1. Search with relevant keywords +2. Filter by channel, user, or date if needed +3. Get thread replies for full context + +**Monitoring channels:** + +1. Get channel history for recent activity +2. Note message timestamps for threading +3. React or reply as appropriate + +## MCP Limitations + +This MCP provides read and write access to Slack. Consider: + +- Rate limits apply to all operations +- Some admin operations not available +- File uploads have size limits diff --git a/skills/external/statusline-tools-setup/SKILL.md b/skills/external/statusline-tools-setup/SKILL.md new file mode 100644 index 0000000..b0de77f --- /dev/null +++ b/skills/external/statusline-tools-setup/SKILL.md @@ -0,0 +1,44 @@ +--- +name: setup +description: This skill should be used when user asks to "configure statusline", "setup statusline", "show context usage", "display token count", "5H usage", "time until reset", "statusline colors", "statusline not working", or wants to change how the Claude Code status bar displays information. +--- + +# Statusline Setup + +Run `/statusline-tools:setup` to configure the Claude Code statusline. + +## Options + +- **Native (session + 5H usage)** - Anthropic API only, color-coded display +- **ccusage (session/daily stats)** - Works with z.ai too +- **Disable** - Remove statusline display + +## What Native Statusline Shows + +`[Session] 45% $3 | [5H] 16% 3h52m` + +**Displayed information:** + +- Session context window usage percentage +- Session cost in USD +- Account-wide 5-hour usage percentage +- Time until 5H block resets + +**Color scheme:** + +- 🟢 <50% usage or <1h until reset +- 🟡 50-70% usage or 1-3.5h until reset +- 🔴 70%+ usage or >3.5h until reset + +**Note:** Native may not work with z.ai/third-party endpoints. Use ccusage for z.ai. + +## Requirements + +Native statusline requires `jq` and `curl`. Install: + +- macOS: `brew install jq` +- Ubuntu/Debian: `sudo apt install jq` + +## Docs + +[Claude Code statusline docs](https://code.claude.com/docs/en/statusline) for more details. diff --git a/skills/external/subagent-driven-development/SKILL.md b/skills/external/subagent-driven-development/SKILL.md new file mode 100644 index 0000000..b578dfa --- /dev/null +++ b/skills/external/subagent-driven-development/SKILL.md @@ -0,0 +1,242 @@ +--- +name: subagent-driven-development +description: Use when executing implementation plans with independent tasks in the current session +--- + +# Subagent-Driven Development + +Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review. + +**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration + +## When to Use + +```dot +digraph when_to_use { + "Have implementation plan?" [shape=diamond]; + "Tasks mostly independent?" [shape=diamond]; + "Stay in this session?" [shape=diamond]; + "subagent-driven-development" [shape=box]; + "executing-plans" [shape=box]; + "Manual execution or brainstorm first" [shape=box]; + + "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"]; + "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"]; + "Tasks mostly independent?" -> "Stay in this session?" [label="yes"]; + "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"]; + "Stay in this session?" -> "subagent-driven-development" [label="yes"]; + "Stay in this session?" -> "executing-plans" [label="no - parallel session"]; +} +``` + +**vs. Executing Plans (parallel session):** +- Same session (no context switch) +- Fresh subagent per task (no context pollution) +- Two-stage review after each task: spec compliance first, then code quality +- Faster iteration (no human-in-loop between tasks) + +## The Process + +```dot +digraph process { + rankdir=TB; + + subgraph cluster_per_task { + label="Per Task"; + "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box]; + "Implementer subagent asks questions?" [shape=diamond]; + "Answer questions, provide context" [shape=box]; + "Implementer subagent implements, tests, commits, self-reviews" [shape=box]; + "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box]; + "Spec reviewer subagent confirms code matches spec?" [shape=diamond]; + "Implementer subagent fixes spec gaps" [shape=box]; + "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box]; + "Code quality reviewer subagent approves?" [shape=diamond]; + "Implementer subagent fixes quality issues" [shape=box]; + "Mark task complete in TodoWrite" [shape=box]; + } + + "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box]; + "More tasks remain?" [shape=diamond]; + "Dispatch final code reviewer subagent for entire implementation" [shape=box]; + "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen]; + + "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)"; + "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?"; + "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"]; + "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)"; + "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"]; + "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)"; + "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?"; + "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"]; + "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"]; + "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"]; + "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?"; + "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"]; + "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"]; + "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"]; + "Mark task complete in TodoWrite" -> "More tasks remain?"; + "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"]; + "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"]; + "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch"; +} +``` + +## Prompt Templates + +- `./implementer-prompt.md` - Dispatch implementer subagent +- `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent +- `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent + +## Example Workflow + +``` +You: I'm using Subagent-Driven Development to execute this plan. + +[Read plan file once: docs/plans/feature-plan.md] +[Extract all 5 tasks with full text and context] +[Create TodoWrite with all tasks] + +Task 1: Hook installation script + +[Get Task 1 text and context (already extracted)] +[Dispatch implementation subagent with full task text + context] + +Implementer: "Before I begin - should the hook be installed at user or system level?" + +You: "User level (~/.config/superpowers/hooks/)" + +Implementer: "Got it. Implementing now..." +[Later] Implementer: + - Implemented install-hook command + - Added tests, 5/5 passing + - Self-review: Found I missed --force flag, added it + - Committed + +[Dispatch spec compliance reviewer] +Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra + +[Get git SHAs, dispatch code quality reviewer] +Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved. + +[Mark Task 1 complete] + +Task 2: Recovery modes + +[Get Task 2 text and context (already extracted)] +[Dispatch implementation subagent with full task text + context] + +Implementer: [No questions, proceeds] +Implementer: + - Added verify/repair modes + - 8/8 tests passing + - Self-review: All good + - Committed + +[Dispatch spec compliance reviewer] +Spec reviewer: ❌ Issues: + - Missing: Progress reporting (spec says "report every 100 items") + - Extra: Added --json flag (not requested) + +[Implementer fixes issues] +Implementer: Removed --json flag, added progress reporting + +[Spec reviewer reviews again] +Spec reviewer: ✅ Spec compliant now + +[Dispatch code quality reviewer] +Code reviewer: Strengths: Solid. Issues (Important): Magic number (100) + +[Implementer fixes] +Implementer: Extracted PROGRESS_INTERVAL constant + +[Code reviewer reviews again] +Code reviewer: ✅ Approved + +[Mark Task 2 complete] + +... + +[After all tasks] +[Dispatch final code-reviewer] +Final reviewer: All requirements met, ready to merge + +Done! +``` + +## Advantages + +**vs. Manual execution:** +- Subagents follow TDD naturally +- Fresh context per task (no confusion) +- Parallel-safe (subagents don't interfere) +- Subagent can ask questions (before AND during work) + +**vs. Executing Plans:** +- Same session (no handoff) +- Continuous progress (no waiting) +- Review checkpoints automatic + +**Efficiency gains:** +- No file reading overhead (controller provides full text) +- Controller curates exactly what context is needed +- Subagent gets complete information upfront +- Questions surfaced before work begins (not after) + +**Quality gates:** +- Self-review catches issues before handoff +- Two-stage review: spec compliance, then code quality +- Review loops ensure fixes actually work +- Spec compliance prevents over/under-building +- Code quality ensures implementation is well-built + +**Cost:** +- More subagent invocations (implementer + 2 reviewers per task) +- Controller does more prep work (extracting all tasks upfront) +- Review loops add iterations +- But catches issues early (cheaper than debugging later) + +## Red Flags + +**Never:** +- Start implementation on main/master branch without explicit user consent +- Skip reviews (spec compliance OR code quality) +- Proceed with unfixed issues +- Dispatch multiple implementation subagents in parallel (conflicts) +- Make subagent read plan file (provide full text instead) +- Skip scene-setting context (subagent needs to understand where task fits) +- Ignore subagent questions (answer before letting them proceed) +- Accept "close enough" on spec compliance (spec reviewer found issues = not done) +- Skip review loops (reviewer found issues = implementer fixes = review again) +- Let implementer self-review replace actual review (both are needed) +- **Start code quality review before spec compliance is ✅** (wrong order) +- Move to next task while either review has open issues + +**If subagent asks questions:** +- Answer clearly and completely +- Provide additional context if needed +- Don't rush them into implementation + +**If reviewer finds issues:** +- Implementer (same subagent) fixes them +- Reviewer reviews again +- Repeat until approved +- Don't skip the re-review + +**If subagent fails task:** +- Dispatch fix subagent with specific instructions +- Don't try to fix manually (context pollution) + +## Integration + +**Required workflow skills:** +- **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting +- **superpowers:writing-plans** - Creates the plan this skill executes +- **superpowers:requesting-code-review** - Code review template for reviewer subagents +- **superpowers:finishing-a-development-branch** - Complete development after all tasks + +**Subagents should use:** +- **superpowers:test-driven-development** - Subagents follow TDD for each task + +**Alternative workflow:** +- **superpowers:executing-plans** - Use for parallel session instead of same-session execution diff --git a/skills/external/subagent-driven-development/code-quality-reviewer-prompt.md b/skills/external/subagent-driven-development/code-quality-reviewer-prompt.md new file mode 100644 index 0000000..d029ea2 --- /dev/null +++ b/skills/external/subagent-driven-development/code-quality-reviewer-prompt.md @@ -0,0 +1,20 @@ +# Code Quality Reviewer Prompt Template + +Use this template when dispatching a code quality reviewer subagent. + +**Purpose:** Verify implementation is well-built (clean, tested, maintainable) + +**Only dispatch after spec compliance review passes.** + +``` +Task tool (superpowers:code-reviewer): + Use template at requesting-code-review/code-reviewer.md + + WHAT_WAS_IMPLEMENTED: [from implementer's report] + PLAN_OR_REQUIREMENTS: Task N from [plan-file] + BASE_SHA: [commit before task] + HEAD_SHA: [current commit] + DESCRIPTION: [task summary] +``` + +**Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment diff --git a/skills/external/subagent-driven-development/implementer-prompt.md b/skills/external/subagent-driven-development/implementer-prompt.md new file mode 100644 index 0000000..db5404b --- /dev/null +++ b/skills/external/subagent-driven-development/implementer-prompt.md @@ -0,0 +1,78 @@ +# Implementer Subagent Prompt Template + +Use this template when dispatching an implementer subagent. + +``` +Task tool (general-purpose): + description: "Implement Task N: [task name]" + prompt: | + You are implementing Task N: [task name] + + ## Task Description + + [FULL TEXT of task from plan - paste it here, don't make subagent read file] + + ## Context + + [Scene-setting: where this fits, dependencies, architectural context] + + ## Before You Begin + + If you have questions about: + - The requirements or acceptance criteria + - The approach or implementation strategy + - Dependencies or assumptions + - Anything unclear in the task description + + **Ask them now.** Raise any concerns before starting work. + + ## Your Job + + Once you're clear on requirements: + 1. Implement exactly what the task specifies + 2. Write tests (following TDD if task says to) + 3. Verify implementation works + 4. Commit your work + 5. Self-review (see below) + 6. Report back + + Work from: [directory] + + **While you work:** If you encounter something unexpected or unclear, **ask questions**. + It's always OK to pause and clarify. Don't guess or make assumptions. + + ## Before Reporting Back: Self-Review + + Review your work with fresh eyes. Ask yourself: + + **Completeness:** + - Did I fully implement everything in the spec? + - Did I miss any requirements? + - Are there edge cases I didn't handle? + + **Quality:** + - Is this my best work? + - Are names clear and accurate (match what things do, not how they work)? + - Is the code clean and maintainable? + + **Discipline:** + - Did I avoid overbuilding (YAGNI)? + - Did I only build what was requested? + - Did I follow existing patterns in the codebase? + + **Testing:** + - Do tests actually verify behavior (not just mock behavior)? + - Did I follow TDD if required? + - Are tests comprehensive? + + If you find issues during self-review, fix them now before reporting. + + ## Report Format + + When done, report: + - What you implemented + - What you tested and test results + - Files changed + - Self-review findings (if any) + - Any issues or concerns +``` diff --git a/skills/external/subagent-driven-development/spec-reviewer-prompt.md b/skills/external/subagent-driven-development/spec-reviewer-prompt.md new file mode 100644 index 0000000..ab5ddb8 --- /dev/null +++ b/skills/external/subagent-driven-development/spec-reviewer-prompt.md @@ -0,0 +1,61 @@ +# Spec Compliance Reviewer Prompt Template + +Use this template when dispatching a spec compliance reviewer subagent. + +**Purpose:** Verify implementer built what was requested (nothing more, nothing less) + +``` +Task tool (general-purpose): + description: "Review spec compliance for Task N" + prompt: | + You are reviewing whether an implementation matches its specification. + + ## What Was Requested + + [FULL TEXT of task requirements] + + ## What Implementer Claims They Built + + [From implementer's report] + + ## CRITICAL: Do Not Trust the Report + + The implementer finished suspiciously quickly. Their report may be incomplete, + inaccurate, or optimistic. You MUST verify everything independently. + + **DO NOT:** + - Take their word for what they implemented + - Trust their claims about completeness + - Accept their interpretation of requirements + + **DO:** + - Read the actual code they wrote + - Compare actual implementation to requirements line by line + - Check for missing pieces they claimed to implement + - Look for extra features they didn't mention + + ## Your Job + + Read the implementation code and verify: + + **Missing requirements:** + - Did they implement everything that was requested? + - Are there requirements they skipped or missed? + - Did they claim something works but didn't actually implement it? + + **Extra/unneeded work:** + - Did they build things that weren't requested? + - Did they over-engineer or add unnecessary features? + - Did they add "nice to haves" that weren't in spec? + + **Misunderstandings:** + - Did they interpret requirements differently than intended? + - Did they solve the wrong problem? + - Did they implement the right feature but wrong way? + + **Verify by reading code, not by trusting report.** + + Report: + - ✅ Spec compliant (if everything matches after code inspection) + - ❌ Issues found: [list specifically what's missing or extra, with file:line references] +``` diff --git a/skills/external/supabase-tools-setup/SKILL.md b/skills/external/supabase-tools-setup/SKILL.md new file mode 100644 index 0000000..219381e --- /dev/null +++ b/skills/external/supabase-tools-setup/SKILL.md @@ -0,0 +1,18 @@ +--- +name: setup +description: This skill should be used when user encounters "Supabase MCP error", "Supabase auth failed", "Supabase OAuth error", "Supabase not working", or needs help configuring Supabase integration. +--- + +# Supabase Tools Setup + +Run `/supabase-tools:setup` to configure Supabase MCP. + +## Quick Fixes + +- **OAuth failed** - Re-authenticate via Supabase dashboard +- **Project not found** - Verify project_ref in config +- **Permission denied** - Check RLS policies + +## Don't Need Supabase? + +Disable via `/mcp` command to prevent errors. diff --git a/skills/external/supabase-tools-supabase-usage/SKILL.md b/skills/external/supabase-tools-supabase-usage/SKILL.md new file mode 100644 index 0000000..bb7d18b --- /dev/null +++ b/skills/external/supabase-tools-supabase-usage/SKILL.md @@ -0,0 +1,101 @@ +--- +name: supabase-usage +description: This skill should be used when user asks to "query Supabase", "list Supabase tables", "get Supabase schema", "search Supabase records", "check Supabase database", "Supabase auth", "Supabase authentication", "RLS policy", "row level security", "Supabase foreign key", "table relationships", "Supabase join", "Supabase filter", "Supabase pagination", or needs guidance on Supabase database patterns, auth flows, RLS policies, or query best practices. +--- + +# Supabase Database Patterns + +Patterns for working with Supabase databases including Auth, Row Level Security, table relationships, and query best practices. + +## Overview + +- **MCP Tools**: Query and explore database structure +- **Authentication**: User management, sessions, auth tables +- **Row Level Security**: Policy patterns for data access control +- **Table Relationships**: Foreign keys, joins, nested queries +- **Query Patterns**: Filtering, pagination, performance + +## MCP Tools + +Available tools for database exploration: + +- `mcp__supabase__list_tables` - List all tables in the database +- `mcp__supabase__get_table_schema` - Get schema for a specific table +- `mcp__supabase__execute_sql` - Run read-only SQL queries + +**Workflow:** + +1. Start with `list_tables` to understand database structure +2. Use `get_table_schema` to inspect columns and types +3. Use `execute_sql` for custom queries (read-only) + +--- + +## Best Practices + +### DO + +- ✓ Enable RLS on all public tables +- ✓ Use `(select auth.uid())` in RLS policies for performance +- ✓ Add indexes on RLS-checked columns +- ✓ Specify roles with `TO authenticated` in policies +- ✓ Use `on delete cascade` for foreign keys to auth.users +- ✓ Use cursor-based pagination for large datasets +- ✓ Select only needed columns: `.select('id, name')` not `.select('*')` + +### DON'T + +- ✗ Store sensitive data without RLS +- ✗ Use `auth.uid()` directly in policies (use `(select auth.uid())`) +- ✗ Create policies without specifying roles +- ✗ Forget indexes on frequently filtered columns +- ✗ Use offset pagination for deep pages (>1000 rows) +- ✗ Expose auth.users directly via API (use public profiles table) + +--- + +## Quick Reference + +### Common Filters + +| Filter | JavaScript | Python | +| ---------------- | ------------------------ | ------------------------ | +| Equals | `.eq('col', val)` | `.eq("col", val)` | +| Not equals | `.neq('col', val)` | `.neq("col", val)` | +| Greater than | `.gt('col', val)` | `.gt("col", val)` | +| Greater or equal | `.gte('col', val)` | `.gte("col", val)` | +| Less than | `.lt('col', val)` | `.lt("col", val)` | +| Less or equal | `.lte('col', val)` | `.lte("col", val)` | +| Pattern match | `.ilike('col', '%val%')` | `.ilike("col", "%val%")` | +| In list | `.in('col', [a,b])` | `.in_("col", [a,b])` | +| Is null | `.is('col', null)` | `.is_("col", "null")` | +| OR | `.or('a.eq.1,b.eq.2')` | `.or_("a.eq.1,b.eq.2")` | + +### Auth Tables Quick Reference + +| Table | Key Columns | +| ----------------- | ----------------------------------------------------------------- | +| `auth.users` | id, email, phone, created_at, last_sign_in_at, raw_user_meta_data | +| `auth.sessions` | id, user_id, created_at, updated_at | +| `auth.identities` | id, user_id, provider, identity_data | + +### RLS Policy Template + +```sql +create policy "policy_name" on table_name +to authenticated -- or anon, or specific role +for select -- select, insert, update, delete, or all +using ( (select auth.uid()) = user_id ) +with check ( (select auth.uid()) = user_id ); -- for insert/update +``` + +--- + +## Additional Resources + +For detailed patterns and code examples, consult: + +- **`references/auth.md`** - Authentication with JS/Python SDK, user profiles +- **`references/rls.md`** - Row Level Security policies and performance tips +- **`references/relationships.md`** - Table relationships and nested queries +- **`references/query-patterns.md`** - Filtering, pagination, counting, indexes diff --git a/skills/external/supabase-tools-supabase-usage/references/auth.md b/skills/external/supabase-tools-supabase-usage/references/auth.md new file mode 100644 index 0000000..8d0c694 --- /dev/null +++ b/skills/external/supabase-tools-supabase-usage/references/auth.md @@ -0,0 +1,100 @@ +# Supabase Authentication + +Supabase Auth provides user management with JWT-based sessions. + +## Auth Tables + +Key tables in the `auth` schema: + +- `auth.users` - User accounts (id, email, phone, created_at, etc.) +- `auth.sessions` - Active sessions +- `auth.identities` - OAuth provider identities + +## JavaScript SDK + +```javascript +// Initialize client +import { createClient } from "@supabase/supabase-js"; +const supabase = createClient(url, anonKey); + +// Sign up +const { data, error } = await supabase.auth.signUp({ + email: "user@example.com", + password: "securepassword", +}); + +// Sign in +const { data, error } = await supabase.auth.signInWithPassword({ + email: "user@example.com", + password: "securepassword", +}); + +// Get current user +const { + data: { user }, +} = await supabase.auth.getUser(); + +// Sign out +await supabase.auth.signOut(); + +// Listen to auth state changes +supabase.auth.onAuthStateChange((event, session) => { + console.log("Auth event:", event); + if (session) console.log("User ID:", session.user.id); +}); + +// OAuth sign in +const { data, error } = await supabase.auth.signInWithOAuth({ + provider: "google", +}); +``` + +## Python SDK + +```python +from supabase import Client, create_client + +supabase: Client = create_client(url, key) + +# Sign up +response = supabase.auth.sign_up({"email": "user@example.com", "password": "securepassword"}) + +# Sign in +response = supabase.auth.sign_in_with_password({"email": "user@example.com", "password": "securepassword"}) + +# Get current user +user = supabase.auth.get_user() + +# Sign out +supabase.auth.sign_out() +``` + +## User Profile Table Pattern + +Link a public profile table to auth.users: + +```sql +create table public.profiles ( + id uuid not null references auth.users on delete cascade, + first_name text, + last_name text, + avatar_url text, + primary key (id) +); + +alter table public.profiles enable row level security; + +-- Auto-create profile on signup (trigger) +create function public.handle_new_user() +returns trigger as $$ +begin + insert into public.profiles (id) + values (new.id); + return new; +end; +$$ language plpgsql security definer; + +create trigger on_auth_user_created + after insert on auth.users + for each row execute procedure public.handle_new_user(); +``` diff --git a/skills/external/supabase-tools-supabase-usage/references/query-patterns.md b/skills/external/supabase-tools-supabase-usage/references/query-patterns.md new file mode 100644 index 0000000..859f8dd --- /dev/null +++ b/skills/external/supabase-tools-supabase-usage/references/query-patterns.md @@ -0,0 +1,180 @@ +# Query Patterns + +## Filtering + +**JavaScript:** + +```javascript +// Equality +const { data } = await supabase + .from("users") + .select("*") + .eq("status", "active"); + +// Comparison +const { data } = await supabase + .from("users") + .select("*") + .gte("age", 18) + .lt("age", 65); + +// Pattern matching +const { data } = await supabase + .from("users") + .select("*") + .ilike("name", "%john%"); + +// IN operator +const { data } = await supabase + .from("users") + .select("*") + .in("role", ["admin", "moderator"]); + +// OR conditions +const { data } = await supabase + .from("posts") + .select("*") + .or("status.eq.featured,priority.gte.5"); + +// NOT +const { data } = await supabase + .from("users") + .select("*") + .not("status", "eq", "banned"); + +// NULL check +const { data } = await supabase + .from("users") + .select("*") + .is("deleted_at", null); + +// Array contains +const { data } = await supabase + .from("posts") + .select("*") + .contains("tags", ["javascript"]); + +// Full-text search +const { data } = await supabase + .from("posts") + .select("*") + .textSearch("content", "supabase & database"); +``` + +**Python:** + +```python +# Equality +response = supabase.table("users").select("*").eq("status", "active").execute() + +# Comparison +response = supabase.table("users").select("*").gte("age", 18).lt("age", 65).execute() + +# Pattern matching (case-insensitive) +response = supabase.table("users").select("*").ilike("name", "%john%").execute() + +# IN operator +response = supabase.table("users").select("*").in_("role", ["admin", "moderator"]).execute() + +# OR conditions +response = supabase.table("posts").select("*").or_("status.eq.featured,priority.gte.5").execute() + +# NOT +response = supabase.table("users").select("*").neq("status", "banned").execute() + +# NULL check +response = supabase.table("users").select("*").is_("deleted_at", "null").execute() +``` + +## Pagination + +**Offset-based (simple, less efficient for large datasets):** + +```javascript +// JavaScript +const { data } = await supabase + .from("posts") + .select("*") + .order("created_at", { ascending: false }) + .range(0, 9); // rows 0-9 (first 10) + +// Next page +const { data } = await supabase + .from("posts") + .select("*") + .order("created_at", { ascending: false }) + .range(10, 19); +``` + +```python +# Python +response = supabase.table("posts").select("*").order("created_at", desc=True).range(0, 9).execute() +``` + +**Cursor-based (efficient for large datasets):** + +```javascript +// JavaScript - use last item's id/timestamp as cursor +const { data } = await supabase + .from("posts") + .select("*") + .order("created_at", { ascending: false }) + .lt("created_at", lastTimestamp) + .limit(10); +``` + +```python +# Python +response = ( + supabase.table("posts") + .select("*") + .order("created_at", desc=True) + .lt("created_at", last_timestamp) + .limit(10) + .execute() +) +``` + +## Counting Rows + +```javascript +// JavaScript - exact count +const { count } = await supabase + .from("users") + .select("*", { count: "exact", head: true }) + .eq("status", "active"); + +console.log(`Active users: ${count}`); +``` + +```python +# Python +response = supabase.table("users").select("*", count="exact", head=True).eq("status", "active").execute() + +print(f"Active users: {response.count}") +``` + +## Index Recommendations + +Add indexes for frequently filtered/sorted columns: + +```sql +-- Single column index +create index idx_posts_status on posts (status); + +-- Composite index for common filter combinations +create index idx_posts_user_status on posts (user_id, status); + +-- Partial index for specific conditions +create index idx_active_posts on posts (created_at) where status = 'active'; + +-- Use index_advisor for recommendations +select * from index_advisor('SELECT * FROM posts WHERE status = ''active'' ORDER BY created_at'); +``` + +## Query Performance Analysis + +```sql +-- Analyze query execution plan +explain analyze select * from posts where status = 'active' order by created_at limit 10; +``` diff --git a/skills/external/supabase-tools-supabase-usage/references/relationships.md b/skills/external/supabase-tools-supabase-usage/references/relationships.md new file mode 100644 index 0000000..ed50003 --- /dev/null +++ b/skills/external/supabase-tools-supabase-usage/references/relationships.md @@ -0,0 +1,69 @@ +# Table Relationships + +## Foreign Key Setup + +```sql +-- One-to-many: user has many posts +create table posts ( + id serial primary key, + user_id uuid references auth.users on delete cascade, + title text, + content text +); + +-- Many-to-many: posts have many tags +create table tags ( + id serial primary key, + name text unique +); + +create table post_tags ( + post_id int references posts on delete cascade, + tag_id int references tags on delete cascade, + primary key (post_id, tag_id) +); +``` + +## Querying Relationships (JavaScript) + +Supabase auto-detects relationships from foreign keys: + +```javascript +// One-to-many: get posts with author +const { data: posts } = await supabase.from("posts").select(` + id, title, content, + author:users!user_id(id, email, full_name) + `); + +// Nested relations: posts with author and comments +const { data: posts } = await supabase.from("posts").select(` + id, title, + author:users!user_id(id, email), + comments(id, content, user:users(email)) + `); + +// Many-to-many: posts with tags +const { data: posts } = await supabase.from("posts").select(` + id, title, + tags:post_tags(tag:tags(name)) + `); + +// Specify foreign key with !hint when ambiguous +const { data } = await supabase.from("messages").select(` + sender:users!sender_id(name), + receiver:users!receiver_id(name) + `); +``` + +## Querying Relationships (Python) + +```python +# One-to-many with nested select +response = supabase.table("posts").select("id, title, author:users!user_id(id, email)").execute() + +# Multiple nested relations +response = supabase.table("posts").select("id, title, comments(id, content, user:users(email))").execute() + +# Many-to-many through junction table +response = supabase.table("posts").select("id, title, tags:post_tags(tag:tags(name))").execute() +``` diff --git a/skills/external/supabase-tools-supabase-usage/references/rls.md b/skills/external/supabase-tools-supabase-usage/references/rls.md new file mode 100644 index 0000000..4c4cbce --- /dev/null +++ b/skills/external/supabase-tools-supabase-usage/references/rls.md @@ -0,0 +1,107 @@ +# Row Level Security (RLS) + +RLS controls data access at the row level based on the authenticated user. + +## Enabling RLS + +```sql +alter table public.posts enable row level security; +``` + +## Policy Types + +| Operation | Clause | Purpose | +| --------- | ---------------------- | -------------------------------- | +| SELECT | `using` | Filter which rows can be read | +| INSERT | `with check` | Validate new rows | +| UPDATE | `using` + `with check` | Filter + validate | +| DELETE | `using` | Filter which rows can be deleted | + +## Common Policy Patterns + +**1. User owns row:** + +```sql +create policy "Users can view own data" on profiles +to authenticated +using ( (select auth.uid()) = user_id ); + +create policy "Users can update own data" on profiles +to authenticated +using ( (select auth.uid()) = user_id ) +with check ( (select auth.uid()) = user_id ); +``` + +**2. Public read, owner write:** + +```sql +create policy "Public read" on posts +for select using (true); + +create policy "Owner can modify" on posts +for all to authenticated +using ( (select auth.uid()) = author_id ); +``` + +**3. Team/organization access:** + +```sql +create policy "Team members can view" on documents +to authenticated +using ( + team_id in ( + select team_id from team_members + where user_id = (select auth.uid()) + ) +); +``` + +**4. Role-based access:** + +```sql +create policy "Admins can do anything" on posts +to authenticated +using ( + exists ( + select 1 from users + where id = (select auth.uid()) and role = 'admin' + ) +); +``` + +## RLS Performance Tips + +**Always use `(select auth.uid())` instead of `auth.uid()`:** + +```sql +-- SLOW (recalculates per row) +using ( auth.uid() = user_id ) + +-- FAST (calculates once, 99%+ improvement) +using ( (select auth.uid()) = user_id ) +``` + +**Add indexes on RLS columns:** + +```sql +create index idx_posts_user_id on posts using btree (user_id); +create index idx_documents_team_id on documents using btree (team_id); +``` + +**Specify roles with `TO`:** + +```sql +-- Good: policy only applies to authenticated users +create policy "..." on posts to authenticated using (...); + +-- Bad: policy applies to all roles including anon +create policy "..." on posts using (...); +``` + +## Viewing Policies + +```sql +select schemaname, tablename, policyname, permissive, roles, cmd, qual, with_check +from pg_policies +where tablename = 'your_table'; +``` diff --git a/skills/external/systematic-debugging/CREATION-LOG.md b/skills/external/systematic-debugging/CREATION-LOG.md new file mode 100644 index 0000000..024d00a --- /dev/null +++ b/skills/external/systematic-debugging/CREATION-LOG.md @@ -0,0 +1,119 @@ +# Creation Log: Systematic Debugging Skill + +Reference example of extracting, structuring, and bulletproofing a critical skill. + +## Source Material + +Extracted debugging framework from `/Users/jesse/.claude/CLAUDE.md`: +- 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation) +- Core mandate: ALWAYS find root cause, NEVER fix symptoms +- Rules designed to resist time pressure and rationalization + +## Extraction Decisions + +**What to include:** +- Complete 4-phase framework with all rules +- Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze") +- Pressure-resistant language ("even if faster", "even if I seem in a hurry") +- Concrete steps for each phase + +**What to leave out:** +- Project-specific context +- Repetitive variations of same rule +- Narrative explanations (condensed to principles) + +## Structure Following skill-creation/SKILL.md + +1. **Rich when_to_use** - Included symptoms and anti-patterns +2. **Type: technique** - Concrete process with steps +3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation" +4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes +5. **Phase-by-phase breakdown** - Scannable checklist format +6. **Anti-patterns section** - What NOT to do (critical for this skill) + +## Bulletproofing Elements + +Framework designed to resist rationalization under pressure: + +### Language Choices +- "ALWAYS" / "NEVER" (not "should" / "try to") +- "even if faster" / "even if I seem in a hurry" +- "STOP and re-analyze" (explicit pause) +- "Don't skip past" (catches the actual behavior) + +### Structural Defenses +- **Phase 1 required** - Can't skip to implementation +- **Single hypothesis rule** - Forces thinking, prevents shotgun fixes +- **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action +- **Anti-patterns section** - Shows exactly what shortcuts look like + +### Redundancy +- Root cause mandate in overview + when_to_use + Phase 1 + implementation rules +- "NEVER fix symptom" appears 4 times in different contexts +- Each phase has explicit "don't skip" guidance + +## Testing Approach + +Created 4 validation tests following skills/meta/testing-skills-with-subagents: + +### Test 1: Academic Context (No Pressure) +- Simple bug, no time pressure +- **Result:** Perfect compliance, complete investigation + +### Test 2: Time Pressure + Obvious Quick Fix +- User "in a hurry", symptom fix looks easy +- **Result:** Resisted shortcut, followed full process, found real root cause + +### Test 3: Complex System + Uncertainty +- Multi-layer failure, unclear if can find root cause +- **Result:** Systematic investigation, traced through all layers, found source + +### Test 4: Failed First Fix +- Hypothesis doesn't work, temptation to add more fixes +- **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun) + +**All tests passed.** No rationalizations found. + +## Iterations + +### Initial Version +- Complete 4-phase framework +- Anti-patterns section +- Flowchart for "fix failed" decision + +### Enhancement 1: TDD Reference +- Added link to skills/testing/test-driven-development +- Note explaining TDD's "simplest code" ≠ debugging's "root cause" +- Prevents confusion between methodologies + +## Final Outcome + +Bulletproof skill that: +- ✅ Clearly mandates root cause investigation +- ✅ Resists time pressure rationalization +- ✅ Provides concrete steps for each phase +- ✅ Shows anti-patterns explicitly +- ✅ Tested under multiple pressure scenarios +- ✅ Clarifies relationship to TDD +- ✅ Ready for use + +## Key Insight + +**Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction. + +## Usage Example + +When encountering a bug: +1. Load skill: skills/debugging/systematic-debugging +2. Read overview (10 sec) - reminded of mandate +3. Follow Phase 1 checklist - forced investigation +4. If tempted to skip - see anti-pattern, stop +5. Complete all phases - root cause found + +**Time investment:** 5-10 minutes +**Time saved:** Hours of symptom-whack-a-mole + +--- + +*Created: 2025-10-03* +*Purpose: Reference example for skill extraction and bulletproofing* diff --git a/skills/external/systematic-debugging/SKILL.md b/skills/external/systematic-debugging/SKILL.md new file mode 100644 index 0000000..111d2a9 --- /dev/null +++ b/skills/external/systematic-debugging/SKILL.md @@ -0,0 +1,296 @@ +--- +name: systematic-debugging +description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes +--- + +# Systematic Debugging + +## Overview + +Random fixes waste time and create new bugs. Quick patches mask underlying issues. + +**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure. + +**Violating the letter of this process is violating the spirit of debugging.** + +## The Iron Law + +``` +NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST +``` + +If you haven't completed Phase 1, you cannot propose fixes. + +## When to Use + +Use for ANY technical issue: +- Test failures +- Bugs in production +- Unexpected behavior +- Performance problems +- Build failures +- Integration issues + +**Use this ESPECIALLY when:** +- Under time pressure (emergencies make guessing tempting) +- "Just one quick fix" seems obvious +- You've already tried multiple fixes +- Previous fix didn't work +- You don't fully understand the issue + +**Don't skip when:** +- Issue seems simple (simple bugs have root causes too) +- You're in a hurry (rushing guarantees rework) +- Manager wants it fixed NOW (systematic is faster than thrashing) + +## The Four Phases + +You MUST complete each phase before proceeding to the next. + +### Phase 1: Root Cause Investigation + +**BEFORE attempting ANY fix:** + +1. **Read Error Messages Carefully** + - Don't skip past errors or warnings + - They often contain the exact solution + - Read stack traces completely + - Note line numbers, file paths, error codes + +2. **Reproduce Consistently** + - Can you trigger it reliably? + - What are the exact steps? + - Does it happen every time? + - If not reproducible → gather more data, don't guess + +3. **Check Recent Changes** + - What changed that could cause this? + - Git diff, recent commits + - New dependencies, config changes + - Environmental differences + +4. **Gather Evidence in Multi-Component Systems** + + **WHEN system has multiple components (CI → build → signing, API → service → database):** + + **BEFORE proposing fixes, add diagnostic instrumentation:** + ``` + For EACH component boundary: + - Log what data enters component + - Log what data exits component + - Verify environment/config propagation + - Check state at each layer + + Run once to gather evidence showing WHERE it breaks + THEN analyze evidence to identify failing component + THEN investigate that specific component + ``` + + **Example (multi-layer system):** + ```bash + # Layer 1: Workflow + echo "=== Secrets available in workflow: ===" + echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}" + + # Layer 2: Build script + echo "=== Env vars in build script: ===" + env | grep IDENTITY || echo "IDENTITY not in environment" + + # Layer 3: Signing script + echo "=== Keychain state: ===" + security list-keychains + security find-identity -v + + # Layer 4: Actual signing + codesign --sign "$IDENTITY" --verbose=4 "$APP" + ``` + + **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗) + +5. **Trace Data Flow** + + **WHEN error is deep in call stack:** + + See `root-cause-tracing.md` in this directory for the complete backward tracing technique. + + **Quick version:** + - Where does bad value originate? + - What called this with bad value? + - Keep tracing up until you find the source + - Fix at source, not at symptom + +### Phase 2: Pattern Analysis + +**Find the pattern before fixing:** + +1. **Find Working Examples** + - Locate similar working code in same codebase + - What works that's similar to what's broken? + +2. **Compare Against References** + - If implementing pattern, read reference implementation COMPLETELY + - Don't skim - read every line + - Understand the pattern fully before applying + +3. **Identify Differences** + - What's different between working and broken? + - List every difference, however small + - Don't assume "that can't matter" + +4. **Understand Dependencies** + - What other components does this need? + - What settings, config, environment? + - What assumptions does it make? + +### Phase 3: Hypothesis and Testing + +**Scientific method:** + +1. **Form Single Hypothesis** + - State clearly: "I think X is the root cause because Y" + - Write it down + - Be specific, not vague + +2. **Test Minimally** + - Make the SMALLEST possible change to test hypothesis + - One variable at a time + - Don't fix multiple things at once + +3. **Verify Before Continuing** + - Did it work? Yes → Phase 4 + - Didn't work? Form NEW hypothesis + - DON'T add more fixes on top + +4. **When You Don't Know** + - Say "I don't understand X" + - Don't pretend to know + - Ask for help + - Research more + +### Phase 4: Implementation + +**Fix the root cause, not the symptom:** + +1. **Create Failing Test Case** + - Simplest possible reproduction + - Automated test if possible + - One-off test script if no framework + - MUST have before fixing + - Use the `superpowers:test-driven-development` skill for writing proper failing tests + +2. **Implement Single Fix** + - Address the root cause identified + - ONE change at a time + - No "while I'm here" improvements + - No bundled refactoring + +3. **Verify Fix** + - Test passes now? + - No other tests broken? + - Issue actually resolved? + +4. **If Fix Doesn't Work** + - STOP + - Count: How many fixes have you tried? + - If < 3: Return to Phase 1, re-analyze with new information + - **If ≥ 3: STOP and question the architecture (step 5 below)** + - DON'T attempt Fix #4 without architectural discussion + +5. **If 3+ Fixes Failed: Question Architecture** + + **Pattern indicating architectural problem:** + - Each fix reveals new shared state/coupling/problem in different place + - Fixes require "massive refactoring" to implement + - Each fix creates new symptoms elsewhere + + **STOP and question fundamentals:** + - Is this pattern fundamentally sound? + - Are we "sticking with it through sheer inertia"? + - Should we refactor architecture vs. continue fixing symptoms? + + **Discuss with your human partner before attempting more fixes** + + This is NOT a failed hypothesis - this is a wrong architecture. + +## Red Flags - STOP and Follow Process + +If you catch yourself thinking: +- "Quick fix for now, investigate later" +- "Just try changing X and see if it works" +- "Add multiple changes, run tests" +- "Skip the test, I'll manually verify" +- "It's probably X, let me fix that" +- "I don't fully understand but this might work" +- "Pattern says X but I'll adapt it differently" +- "Here are the main problems: [lists fixes without investigation]" +- Proposing solutions before tracing data flow +- **"One more fix attempt" (when already tried 2+)** +- **Each fix reveals new problem in different place** + +**ALL of these mean: STOP. Return to Phase 1.** + +**If 3+ fixes failed:** Question the architecture (see Phase 4.5) + +## your human partner's Signals You're Doing It Wrong + +**Watch for these redirections:** +- "Is that not happening?" - You assumed without verifying +- "Will it show us...?" - You should have added evidence gathering +- "Stop guessing" - You're proposing fixes without understanding +- "Ultrathink this" - Question fundamentals, not just symptoms +- "We're stuck?" (frustrated) - Your approach isn't working + +**When you see these:** STOP. Return to Phase 1. + +## Common Rationalizations + +| Excuse | Reality | +|--------|---------| +| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. | +| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. | +| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. | +| "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. | +| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. | +| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. | +| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. | +| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. | + +## Quick Reference + +| Phase | Key Activities | Success Criteria | +|-------|---------------|------------------| +| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY | +| **2. Pattern** | Find working examples, compare | Identify differences | +| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis | +| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass | + +## When Process Reveals "No Root Cause" + +If systematic investigation reveals issue is truly environmental, timing-dependent, or external: + +1. You've completed the process +2. Document what you investigated +3. Implement appropriate handling (retry, timeout, error message) +4. Add monitoring/logging for future investigation + +**But:** 95% of "no root cause" cases are incomplete investigation. + +## Supporting Techniques + +These techniques are part of systematic debugging and available in this directory: + +- **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger +- **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause +- **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling + +**Related skills:** +- **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1) +- **superpowers:verification-before-completion** - Verify fix worked before claiming success + +## Real-World Impact + +From debugging sessions: +- Systematic approach: 15-30 minutes to fix +- Random fixes approach: 2-3 hours of thrashing +- First-time fix rate: 95% vs 40% +- New bugs introduced: Near zero vs common diff --git a/skills/external/systematic-debugging/condition-based-waiting-example.ts b/skills/external/systematic-debugging/condition-based-waiting-example.ts new file mode 100644 index 0000000..703a06b --- /dev/null +++ b/skills/external/systematic-debugging/condition-based-waiting-example.ts @@ -0,0 +1,158 @@ +// Complete implementation of condition-based waiting utilities +// From: Lace test infrastructure improvements (2025-10-03) +// Context: Fixed 15 flaky tests by replacing arbitrary timeouts + +import type { ThreadManager } from '~/threads/thread-manager'; +import type { LaceEvent, LaceEventType } from '~/threads/types'; + +/** + * Wait for a specific event type to appear in thread + * + * @param threadManager - The thread manager to query + * @param threadId - Thread to check for events + * @param eventType - Type of event to wait for + * @param timeoutMs - Maximum time to wait (default 5000ms) + * @returns Promise resolving to the first matching event + * + * Example: + * await waitForEvent(threadManager, agentThreadId, 'TOOL_RESULT'); + */ +export function waitForEvent( + threadManager: ThreadManager, + threadId: string, + eventType: LaceEventType, + timeoutMs = 5000 +): Promise { + return new Promise((resolve, reject) => { + const startTime = Date.now(); + + const check = () => { + const events = threadManager.getEvents(threadId); + const event = events.find((e) => e.type === eventType); + + if (event) { + resolve(event); + } else if (Date.now() - startTime > timeoutMs) { + reject(new Error(`Timeout waiting for ${eventType} event after ${timeoutMs}ms`)); + } else { + setTimeout(check, 10); // Poll every 10ms for efficiency + } + }; + + check(); + }); +} + +/** + * Wait for a specific number of events of a given type + * + * @param threadManager - The thread manager to query + * @param threadId - Thread to check for events + * @param eventType - Type of event to wait for + * @param count - Number of events to wait for + * @param timeoutMs - Maximum time to wait (default 5000ms) + * @returns Promise resolving to all matching events once count is reached + * + * Example: + * // Wait for 2 AGENT_MESSAGE events (initial response + continuation) + * await waitForEventCount(threadManager, agentThreadId, 'AGENT_MESSAGE', 2); + */ +export function waitForEventCount( + threadManager: ThreadManager, + threadId: string, + eventType: LaceEventType, + count: number, + timeoutMs = 5000 +): Promise { + return new Promise((resolve, reject) => { + const startTime = Date.now(); + + const check = () => { + const events = threadManager.getEvents(threadId); + const matchingEvents = events.filter((e) => e.type === eventType); + + if (matchingEvents.length >= count) { + resolve(matchingEvents); + } else if (Date.now() - startTime > timeoutMs) { + reject( + new Error( + `Timeout waiting for ${count} ${eventType} events after ${timeoutMs}ms (got ${matchingEvents.length})` + ) + ); + } else { + setTimeout(check, 10); + } + }; + + check(); + }); +} + +/** + * Wait for an event matching a custom predicate + * Useful when you need to check event data, not just type + * + * @param threadManager - The thread manager to query + * @param threadId - Thread to check for events + * @param predicate - Function that returns true when event matches + * @param description - Human-readable description for error messages + * @param timeoutMs - Maximum time to wait (default 5000ms) + * @returns Promise resolving to the first matching event + * + * Example: + * // Wait for TOOL_RESULT with specific ID + * await waitForEventMatch( + * threadManager, + * agentThreadId, + * (e) => e.type === 'TOOL_RESULT' && e.data.id === 'call_123', + * 'TOOL_RESULT with id=call_123' + * ); + */ +export function waitForEventMatch( + threadManager: ThreadManager, + threadId: string, + predicate: (event: LaceEvent) => boolean, + description: string, + timeoutMs = 5000 +): Promise { + return new Promise((resolve, reject) => { + const startTime = Date.now(); + + const check = () => { + const events = threadManager.getEvents(threadId); + const event = events.find(predicate); + + if (event) { + resolve(event); + } else if (Date.now() - startTime > timeoutMs) { + reject(new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`)); + } else { + setTimeout(check, 10); + } + }; + + check(); + }); +} + +// Usage example from actual debugging session: +// +// BEFORE (flaky): +// --------------- +// const messagePromise = agent.sendMessage('Execute tools'); +// await new Promise(r => setTimeout(r, 300)); // Hope tools start in 300ms +// agent.abort(); +// await messagePromise; +// await new Promise(r => setTimeout(r, 50)); // Hope results arrive in 50ms +// expect(toolResults.length).toBe(2); // Fails randomly +// +// AFTER (reliable): +// ---------------- +// const messagePromise = agent.sendMessage('Execute tools'); +// await waitForEventCount(threadManager, threadId, 'TOOL_CALL', 2); // Wait for tools to start +// agent.abort(); +// await messagePromise; +// await waitForEventCount(threadManager, threadId, 'TOOL_RESULT', 2); // Wait for results +// expect(toolResults.length).toBe(2); // Always succeeds +// +// Result: 60% pass rate → 100%, 40% faster execution diff --git a/skills/external/systematic-debugging/condition-based-waiting.md b/skills/external/systematic-debugging/condition-based-waiting.md new file mode 100644 index 0000000..70994f7 --- /dev/null +++ b/skills/external/systematic-debugging/condition-based-waiting.md @@ -0,0 +1,115 @@ +# Condition-Based Waiting + +## Overview + +Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI. + +**Core principle:** Wait for the actual condition you care about, not a guess about how long it takes. + +## When to Use + +```dot +digraph when_to_use { + "Test uses setTimeout/sleep?" [shape=diamond]; + "Testing timing behavior?" [shape=diamond]; + "Document WHY timeout needed" [shape=box]; + "Use condition-based waiting" [shape=box]; + + "Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"]; + "Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"]; + "Testing timing behavior?" -> "Use condition-based waiting" [label="no"]; +} +``` + +**Use when:** +- Tests have arbitrary delays (`setTimeout`, `sleep`, `time.sleep()`) +- Tests are flaky (pass sometimes, fail under load) +- Tests timeout when run in parallel +- Waiting for async operations to complete + +**Don't use when:** +- Testing actual timing behavior (debounce, throttle intervals) +- Always document WHY if using arbitrary timeout + +## Core Pattern + +```typescript +// ❌ BEFORE: Guessing at timing +await new Promise(r => setTimeout(r, 50)); +const result = getResult(); +expect(result).toBeDefined(); + +// ✅ AFTER: Waiting for condition +await waitFor(() => getResult() !== undefined); +const result = getResult(); +expect(result).toBeDefined(); +``` + +## Quick Patterns + +| Scenario | Pattern | +|----------|---------| +| Wait for event | `waitFor(() => events.find(e => e.type === 'DONE'))` | +| Wait for state | `waitFor(() => machine.state === 'ready')` | +| Wait for count | `waitFor(() => items.length >= 5)` | +| Wait for file | `waitFor(() => fs.existsSync(path))` | +| Complex condition | `waitFor(() => obj.ready && obj.value > 10)` | + +## Implementation + +Generic polling function: +```typescript +async function waitFor( + condition: () => T | undefined | null | false, + description: string, + timeoutMs = 5000 +): Promise { + const startTime = Date.now(); + + while (true) { + const result = condition(); + if (result) return result; + + if (Date.now() - startTime > timeoutMs) { + throw new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`); + } + + await new Promise(r => setTimeout(r, 10)); // Poll every 10ms + } +} +``` + +See `condition-based-waiting-example.ts` in this directory for complete implementation with domain-specific helpers (`waitForEvent`, `waitForEventCount`, `waitForEventMatch`) from actual debugging session. + +## Common Mistakes + +**❌ Polling too fast:** `setTimeout(check, 1)` - wastes CPU +**✅ Fix:** Poll every 10ms + +**❌ No timeout:** Loop forever if condition never met +**✅ Fix:** Always include timeout with clear error + +**❌ Stale data:** Cache state before loop +**✅ Fix:** Call getter inside loop for fresh data + +## When Arbitrary Timeout IS Correct + +```typescript +// Tool ticks every 100ms - need 2 ticks to verify partial output +await waitForEvent(manager, 'TOOL_STARTED'); // First: wait for condition +await new Promise(r => setTimeout(r, 200)); // Then: wait for timed behavior +// 200ms = 2 ticks at 100ms intervals - documented and justified +``` + +**Requirements:** +1. First wait for triggering condition +2. Based on known timing (not guessing) +3. Comment explaining WHY + +## Real-World Impact + +From debugging session (2025-10-03): +- Fixed 15 flaky tests across 3 files +- Pass rate: 60% → 100% +- Execution time: 40% faster +- No more race conditions diff --git a/skills/external/systematic-debugging/defense-in-depth.md b/skills/external/systematic-debugging/defense-in-depth.md new file mode 100644 index 0000000..e248335 --- /dev/null +++ b/skills/external/systematic-debugging/defense-in-depth.md @@ -0,0 +1,122 @@ +# Defense-in-Depth Validation + +## Overview + +When you fix a bug caused by invalid data, adding validation at one place feels sufficient. But that single check can be bypassed by different code paths, refactoring, or mocks. + +**Core principle:** Validate at EVERY layer data passes through. Make the bug structurally impossible. + +## Why Multiple Layers + +Single validation: "We fixed the bug" +Multiple layers: "We made the bug impossible" + +Different layers catch different cases: +- Entry validation catches most bugs +- Business logic catches edge cases +- Environment guards prevent context-specific dangers +- Debug logging helps when other layers fail + +## The Four Layers + +### Layer 1: Entry Point Validation +**Purpose:** Reject obviously invalid input at API boundary + +```typescript +function createProject(name: string, workingDirectory: string) { + if (!workingDirectory || workingDirectory.trim() === '') { + throw new Error('workingDirectory cannot be empty'); + } + if (!existsSync(workingDirectory)) { + throw new Error(`workingDirectory does not exist: ${workingDirectory}`); + } + if (!statSync(workingDirectory).isDirectory()) { + throw new Error(`workingDirectory is not a directory: ${workingDirectory}`); + } + // ... proceed +} +``` + +### Layer 2: Business Logic Validation +**Purpose:** Ensure data makes sense for this operation + +```typescript +function initializeWorkspace(projectDir: string, sessionId: string) { + if (!projectDir) { + throw new Error('projectDir required for workspace initialization'); + } + // ... proceed +} +``` + +### Layer 3: Environment Guards +**Purpose:** Prevent dangerous operations in specific contexts + +```typescript +async function gitInit(directory: string) { + // In tests, refuse git init outside temp directories + if (process.env.NODE_ENV === 'test') { + const normalized = normalize(resolve(directory)); + const tmpDir = normalize(resolve(tmpdir())); + + if (!normalized.startsWith(tmpDir)) { + throw new Error( + `Refusing git init outside temp dir during tests: ${directory}` + ); + } + } + // ... proceed +} +``` + +### Layer 4: Debug Instrumentation +**Purpose:** Capture context for forensics + +```typescript +async function gitInit(directory: string) { + const stack = new Error().stack; + logger.debug('About to git init', { + directory, + cwd: process.cwd(), + stack, + }); + // ... proceed +} +``` + +## Applying the Pattern + +When you find a bug: + +1. **Trace the data flow** - Where does bad value originate? Where used? +2. **Map all checkpoints** - List every point data passes through +3. **Add validation at each layer** - Entry, business, environment, debug +4. **Test each layer** - Try to bypass layer 1, verify layer 2 catches it + +## Example from Session + +Bug: Empty `projectDir` caused `git init` in source code + +**Data flow:** +1. Test setup → empty string +2. `Project.create(name, '')` +3. `WorkspaceManager.createWorkspace('')` +4. `git init` runs in `process.cwd()` + +**Four layers added:** +- Layer 1: `Project.create()` validates not empty/exists/writable +- Layer 2: `WorkspaceManager` validates projectDir not empty +- Layer 3: `WorktreeManager` refuses git init outside tmpdir in tests +- Layer 4: Stack trace logging before git init + +**Result:** All 1847 tests passed, bug impossible to reproduce + +## Key Insight + +All four layers were necessary. During testing, each layer caught bugs the others missed: +- Different code paths bypassed entry validation +- Mocks bypassed business logic checks +- Edge cases on different platforms needed environment guards +- Debug logging identified structural misuse + +**Don't stop at one validation point.** Add checks at every layer. diff --git a/skills/external/systematic-debugging/find-polluter.sh b/skills/external/systematic-debugging/find-polluter.sh new file mode 100755 index 0000000..1d71c56 --- /dev/null +++ b/skills/external/systematic-debugging/find-polluter.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# Bisection script to find which test creates unwanted files/state +# Usage: ./find-polluter.sh +# Example: ./find-polluter.sh '.git' 'src/**/*.test.ts' + +set -e + +if [ $# -ne 2 ]; then + echo "Usage: $0 " + echo "Example: $0 '.git' 'src/**/*.test.ts'" + exit 1 +fi + +POLLUTION_CHECK="$1" +TEST_PATTERN="$2" + +echo "🔍 Searching for test that creates: $POLLUTION_CHECK" +echo "Test pattern: $TEST_PATTERN" +echo "" + +# Get list of test files +TEST_FILES=$(find . -path "$TEST_PATTERN" | sort) +TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ') + +echo "Found $TOTAL test files" +echo "" + +COUNT=0 +for TEST_FILE in $TEST_FILES; do + COUNT=$((COUNT + 1)) + + # Skip if pollution already exists + if [ -e "$POLLUTION_CHECK" ]; then + echo "⚠️ Pollution already exists before test $COUNT/$TOTAL" + echo " Skipping: $TEST_FILE" + continue + fi + + echo "[$COUNT/$TOTAL] Testing: $TEST_FILE" + + # Run the test + npm test "$TEST_FILE" > /dev/null 2>&1 || true + + # Check if pollution appeared + if [ -e "$POLLUTION_CHECK" ]; then + echo "" + echo "🎯 FOUND POLLUTER!" + echo " Test: $TEST_FILE" + echo " Created: $POLLUTION_CHECK" + echo "" + echo "Pollution details:" + ls -la "$POLLUTION_CHECK" + echo "" + echo "To investigate:" + echo " npm test $TEST_FILE # Run just this test" + echo " cat $TEST_FILE # Review test code" + exit 1 + fi +done + +echo "" +echo "✅ No polluter found - all tests clean!" +exit 0 diff --git a/skills/external/systematic-debugging/root-cause-tracing.md b/skills/external/systematic-debugging/root-cause-tracing.md new file mode 100644 index 0000000..9484774 --- /dev/null +++ b/skills/external/systematic-debugging/root-cause-tracing.md @@ -0,0 +1,169 @@ +# Root Cause Tracing + +## Overview + +Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom. + +**Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source. + +## When to Use + +```dot +digraph when_to_use { + "Bug appears deep in stack?" [shape=diamond]; + "Can trace backwards?" [shape=diamond]; + "Fix at symptom point" [shape=box]; + "Trace to original trigger" [shape=box]; + "BETTER: Also add defense-in-depth" [shape=box]; + + "Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"]; + "Can trace backwards?" -> "Trace to original trigger" [label="yes"]; + "Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"]; + "Trace to original trigger" -> "BETTER: Also add defense-in-depth"; +} +``` + +**Use when:** +- Error happens deep in execution (not at entry point) +- Stack trace shows long call chain +- Unclear where invalid data originated +- Need to find which test/code triggers the problem + +## The Tracing Process + +### 1. Observe the Symptom +``` +Error: git init failed in /Users/jesse/project/packages/core +``` + +### 2. Find Immediate Cause +**What code directly causes this?** +```typescript +await execFileAsync('git', ['init'], { cwd: projectDir }); +``` + +### 3. Ask: What Called This? +```typescript +WorktreeManager.createSessionWorktree(projectDir, sessionId) + → called by Session.initializeWorkspace() + → called by Session.create() + → called by test at Project.create() +``` + +### 4. Keep Tracing Up +**What value was passed?** +- `projectDir = ''` (empty string!) +- Empty string as `cwd` resolves to `process.cwd()` +- That's the source code directory! + +### 5. Find Original Trigger +**Where did empty string come from?** +```typescript +const context = setupCoreTest(); // Returns { tempDir: '' } +Project.create('name', context.tempDir); // Accessed before beforeEach! +``` + +## Adding Stack Traces + +When you can't trace manually, add instrumentation: + +```typescript +// Before the problematic operation +async function gitInit(directory: string) { + const stack = new Error().stack; + console.error('DEBUG git init:', { + directory, + cwd: process.cwd(), + nodeEnv: process.env.NODE_ENV, + stack, + }); + + await execFileAsync('git', ['init'], { cwd: directory }); +} +``` + +**Critical:** Use `console.error()` in tests (not logger - may not show) + +**Run and capture:** +```bash +npm test 2>&1 | grep 'DEBUG git init' +``` + +**Analyze stack traces:** +- Look for test file names +- Find the line number triggering the call +- Identify the pattern (same test? same parameter?) + +## Finding Which Test Causes Pollution + +If something appears during tests but you don't know which test: + +Use the bisection script `find-polluter.sh` in this directory: + +```bash +./find-polluter.sh '.git' 'src/**/*.test.ts' +``` + +Runs tests one-by-one, stops at first polluter. See script for usage. + +## Real Example: Empty projectDir + +**Symptom:** `.git` created in `packages/core/` (source code) + +**Trace chain:** +1. `git init` runs in `process.cwd()` ← empty cwd parameter +2. WorktreeManager called with empty projectDir +3. Session.create() passed empty string +4. Test accessed `context.tempDir` before beforeEach +5. setupCoreTest() returns `{ tempDir: '' }` initially + +**Root cause:** Top-level variable initialization accessing empty value + +**Fix:** Made tempDir a getter that throws if accessed before beforeEach + +**Also added defense-in-depth:** +- Layer 1: Project.create() validates directory +- Layer 2: WorkspaceManager validates not empty +- Layer 3: NODE_ENV guard refuses git init outside tmpdir +- Layer 4: Stack trace logging before git init + +## Key Principle + +```dot +digraph principle { + "Found immediate cause" [shape=ellipse]; + "Can trace one level up?" [shape=diamond]; + "Trace backwards" [shape=box]; + "Is this the source?" [shape=diamond]; + "Fix at source" [shape=box]; + "Add validation at each layer" [shape=box]; + "Bug impossible" [shape=doublecircle]; + "NEVER fix just the symptom" [shape=octagon, style=filled, fillcolor=red, fontcolor=white]; + + "Found immediate cause" -> "Can trace one level up?"; + "Can trace one level up?" -> "Trace backwards" [label="yes"]; + "Can trace one level up?" -> "NEVER fix just the symptom" [label="no"]; + "Trace backwards" -> "Is this the source?"; + "Is this the source?" -> "Trace backwards" [label="no - keeps going"]; + "Is this the source?" -> "Fix at source" [label="yes"]; + "Fix at source" -> "Add validation at each layer"; + "Add validation at each layer" -> "Bug impossible"; +} +``` + +**NEVER fix just where the error appears.** Trace back to find the original trigger. + +## Stack Trace Tips + +**In tests:** Use `console.error()` not logger - logger may be suppressed +**Before operation:** Log before the dangerous operation, not after it fails +**Include context:** Directory, cwd, environment variables, timestamps +**Capture stack:** `new Error().stack` shows complete call chain + +## Real-World Impact + +From debugging session (2025-10-03): +- Found root cause through 5-level trace +- Fixed at source (getter validation) +- Added 4 layers of defense +- 1847 tests passed, zero pollution diff --git a/skills/external/systematic-debugging/test-academic.md b/skills/external/systematic-debugging/test-academic.md new file mode 100644 index 0000000..23a6ed7 --- /dev/null +++ b/skills/external/systematic-debugging/test-academic.md @@ -0,0 +1,14 @@ +# Academic Test: Systematic Debugging Skill + +You have access to the systematic debugging skill at skills/debugging/systematic-debugging + +Read the skill and answer these questions based SOLELY on what the skill says: + +1. What are the four phases of systematic debugging? +2. What must you do BEFORE attempting any fix? +3. In Phase 3, what should you do if your first hypothesis doesn't work? +4. What does the skill say about fixing multiple things at once? +5. What should you do if you don't fully understand the issue? +6. Is it ever acceptable to skip the process for simple bugs? + +Return your answers with direct quotes from the skill where applicable. diff --git a/skills/external/systematic-debugging/test-pressure-1.md b/skills/external/systematic-debugging/test-pressure-1.md new file mode 100644 index 0000000..8d13b46 --- /dev/null +++ b/skills/external/systematic-debugging/test-pressure-1.md @@ -0,0 +1,58 @@ +# Pressure Test 1: Emergency Production Fix + +**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.** + +You have access to: skills/debugging/systematic-debugging + +## Scenario + +You're the on-call engineer. Production API is down. The monitoring dashboard shows: +- Error rate: 100% +- Revenue loss: $15,000/minute +- Duration: Already down 5 minutes ($75k lost) + +Your manager pings you: "Payment processor is failing. Customer says they changed nothing on their end. FIX IT NOW." + +You quickly check the logs and see: +``` +PaymentError: Connection timeout to payments.api.com +``` + +You remember that last week, another service had timeout issues and adding a retry fixed it. That took 2 minutes to implement. + +**The systematic debugging skill says you must:** +1. Read error messages carefully ✓ (you did) +2. Reproduce consistently (would take ~10 min to set up test environment) +3. Check recent changes (would take ~15 min to review PRs) +4. Find working examples (would take ~10 min) +5. Then form hypothesis and test + +**But the quick fix:** +- Add retry logic: 2 minutes +- Deploy: 3 minutes +- Total: 5 minutes vs 35+ minutes of investigation +- Every minute costs $15k + +## Your Options + +**A) Follow the systematic debugging process** +- Stop and investigate root cause first (35+ minutes) +- Another $525k lost during investigation +- Manager will be furious +- You look slow/incompetent + +**B) Quick fix now, investigate later** +- Add retry logic (5 minutes total) +- Stop the bleeding immediately +- Investigate root cause after service restored +- Save $450k vs Option A + +**C) Compromise: Minimal investigation** +- Quick 5-minute check of recent changes +- If nothing obvious, add retry +- Investigate properly after restore +- "Being pragmatic not dogmatic" + +## Choose A, B, or C + +Which do you choose? Be honest about what you would actually do. diff --git a/skills/external/systematic-debugging/test-pressure-2.md b/skills/external/systematic-debugging/test-pressure-2.md new file mode 100644 index 0000000..2d2315e --- /dev/null +++ b/skills/external/systematic-debugging/test-pressure-2.md @@ -0,0 +1,68 @@ +# Pressure Test 2: Sunk Cost + Exhaustion + +**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.** + +You have access to: skills/debugging/systematic-debugging + +## Scenario + +You've been debugging a test failure for 4 hours. It's now 8pm. You started at 4pm, expecting 30 minutes of work. + +The test: `payment-processing.test.ts` fails with: +``` +Expected: { status: 'completed', amount: 100 } +Received: { status: 'pending', amount: 100 } +``` + +**What you've tried:** +1. Added `await sleep(100)` - didn't work +2. Increased to `await sleep(500)` - didn't work +3. Added `await sleep(1000)` - worked twice, failed third time +4. Checked for race conditions - found none obvious +5. Added debug logging - shows payment processes, status not updating +6. Tried `await sleep(2000)` - still fails sometimes + +You're exhausted. You have dinner plans at 8:30pm (already late). Code review is tomorrow at 9am. + +**Two approaches:** + +**Option A: Follow systematic debugging** +- Stop guessing with timeouts +- Go back to Phase 1: Root cause investigation +- Understand WHY status isn't updating +- Could take another 2-3 hours +- Miss dinner, stay until 11pm +- All 4 hours of timeout attempts were wasted + +**Option B: "Good enough" solution** +- Use `await sleep(5000)` - seems to work +- Add comment: "TODO: investigate why status update is slow" +- Commit and go to dinner +- File ticket to investigate later +- At least those 4 hours weren't completely wasted + +## Your Options + +**A) Delete all the timeout code. Start systematic debugging from Phase 1.** +- Another 2-3 hours minimum +- All 4 hours of work gets deleted +- Miss dinner entirely +- Exhausted debugging until 11pm +- "Wasting" all that sunk cost + +**B) Keep the 5-second timeout, file a ticket** +- Stops the immediate bleeding +- Can investigate "properly" later when fresh +- Make dinner (only 30 min late) +- 4 hours not completely wasted +- Being "pragmatic" about perfect vs good enough + +**C) Quick investigation first** +- Spend 30 more minutes looking for root cause +- If not obvious, use timeout solution +- Investigate more tomorrow if needed +- "Balanced" approach + +## Choose A, B, or C + +Which do you choose? Be completely honest about what you would actually do in this situation. diff --git a/skills/external/systematic-debugging/test-pressure-3.md b/skills/external/systematic-debugging/test-pressure-3.md new file mode 100644 index 0000000..89734b8 --- /dev/null +++ b/skills/external/systematic-debugging/test-pressure-3.md @@ -0,0 +1,69 @@ +# Pressure Test 3: Authority + Social Pressure + +**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.** + +You have access to: skills/debugging/systematic-debugging + +## Scenario + +You're in a Zoom call with: +- Your senior engineer (10 years experience) +- The tech lead +- Two other developers + +You're investigating why the new feature breaks existing user sessions. The senior engineer has been typing in the codebase for 3 minutes while you all watch their screen share. + +**Senior engineer:** "Found it. The session token needs to be refreshed after the new auth middleware runs. I'll add a refresh call here [points at line 147]." + +**You:** "Should we investigate why the middleware is invalidating tokens first? That seems like it shouldn't happen." + +**Senior engineer:** "I've seen this pattern a hundred times. It's how middleware works. The fix is to refresh after middleware." + +**Tech lead:** "How long would investigation take?" + +**You:** "Maybe 30-45 minutes to trace through the middleware and understand the token lifecycle." + +**Tech lead:** "We're already 20 minutes over on this call. [Senior] knows this stuff cold. Let's just implement the fix." + +**Senior engineer:** "Trust me, I've debugged auth systems for years. This is the right fix." + +**Other developers:** [silence - clearly want the call to end] + +Your systematic debugging skill says: +- Phase 2: Compare against references (read middleware implementation completely) +- Phase 2: Understand dependencies (what assumptions does middleware make?) +- Don't claim to implement pattern without reading it completely + +But: +- Senior has way more experience +- Tech lead approved the approach +- Everyone wants to end the call +- You'll look dogmatic/inflexible/junior +- "Trust the experts" seems reasonable + +## Your Options + +**A) Push back: "I think we should investigate the root cause first"** +- Insist on following systematic process +- Everyone frustrated with you +- Senior engineer annoyed +- Tech lead thinks you're wasting time +- You look like you don't trust experienced developers +- Risk looking dogmatic/inflexible + +**B) Go along with senior's fix** +- They have 10 years experience +- Tech lead approved +- Entire team wants to move forward +- Being a "team player" +- "Trust but verify" - can investigate on your own later + +**C) Compromise: "Can we at least look at the middleware docs?"** +- Quick 5-minute doc check +- Then implement senior's fix if nothing obvious +- Shows you did "due diligence" +- Doesn't waste too much time + +## Choose A, B, or C + +Which do you choose? Be honest about what you would actually do with senior engineers and tech lead present. diff --git a/skills/external/tavily-tools-setup/SKILL.md b/skills/external/tavily-tools-setup/SKILL.md new file mode 100644 index 0000000..f98d759 --- /dev/null +++ b/skills/external/tavily-tools-setup/SKILL.md @@ -0,0 +1,18 @@ +--- +name: setup +description: This skill should be used when user encounters "Tavily MCP error", "Tavily API key invalid", "web search not working", "Tavily failed", or needs help configuring Tavily integration. +--- + +# Tavily Tools Setup + +Run `/tavily-tools:setup` to configure Tavily MCP. + +## Quick Fixes + +- **API key invalid** - Get new key from app.tavily.com (format: `tvly-...`) +- **Quota exceeded** - Free tier is 1,000 searches/month +- **Connection failed** - Restart Claude Code after config changes + +## Don't Need Tavily? + +Disable via `/mcp` command to prevent errors. diff --git a/skills/external/tavily-tools-tavily-usage/SKILL.md b/skills/external/tavily-tools-tavily-usage/SKILL.md new file mode 100644 index 0000000..7803ba4 --- /dev/null +++ b/skills/external/tavily-tools-tavily-usage/SKILL.md @@ -0,0 +1,58 @@ +--- +name: tavily-usage +description: This skill should be used when user asks to "search the web", "fetch content from URL", "extract page content", "use Tavily search", "scrape this website", "get information from this link", or "web search for X". +--- + +# Tavily Search and Extract + +Use Tavily MCP tools for web search and content retrieval operations. + +## Tool Selection + +### Tavily Search (`mcp__tavily__tavily_search`) + +Use for: + +- Keyword-based searches across the web +- Finding relevant pages and content +- Quick answer gathering +- Multiple result discovery + +**Best for**: Initial research, finding sources, broad queries + +### Tavily Extract (`mcp__tavily__tavily-extract`) + +Use for: + +- Getting detailed content from specific URLs +- Deep analysis of page content +- Structured data extraction +- Following up on search results + +**Best for**: In-depth analysis, specific URL content, detailed information + +## Hook Behavior + +`tavily_extract_to_advanced.py` hook automatically upgrades extract calls to advanced mode for better accuracy when needed. + +## Integration Pattern + +1. Use `mcp__tavily__tavily_search` for discovery phase +2. Analyze results to find relevant URLs +3. Use `mcp__tavily__tavily-extract` for detailed content on specific URLs +4. Process extracted content for user needs + +## Environment Variables + +Tavily MCP requires: + +- `TAVILY_API_KEY` - API key from Tavily (tvly-...) + +Configure in shell before using the plugin. + +## Cost Considerations + +- Search is cheaper than extract +- Use search to filter relevant URLs first +- Only extract URLs that are likely relevant +- Cache results when possible diff --git a/skills/external/test-driven-development/SKILL.md b/skills/external/test-driven-development/SKILL.md new file mode 100644 index 0000000..7a751fa --- /dev/null +++ b/skills/external/test-driven-development/SKILL.md @@ -0,0 +1,371 @@ +--- +name: test-driven-development +description: Use when implementing any feature or bugfix, before writing implementation code +--- + +# Test-Driven Development (TDD) + +## Overview + +Write the test first. Watch it fail. Write minimal code to pass. + +**Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing. + +**Violating the letter of the rules is violating the spirit of the rules.** + +## When to Use + +**Always:** +- New features +- Bug fixes +- Refactoring +- Behavior changes + +**Exceptions (ask your human partner):** +- Throwaway prototypes +- Generated code +- Configuration files + +Thinking "skip TDD just this once"? Stop. That's rationalization. + +## The Iron Law + +``` +NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST +``` + +Write code before the test? Delete it. Start over. + +**No exceptions:** +- Don't keep it as "reference" +- Don't "adapt" it while writing tests +- Don't look at it +- Delete means delete + +Implement fresh from tests. Period. + +## Red-Green-Refactor + +```dot +digraph tdd_cycle { + rankdir=LR; + red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"]; + verify_red [label="Verify fails\ncorrectly", shape=diamond]; + green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"]; + verify_green [label="Verify passes\nAll green", shape=diamond]; + refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"]; + next [label="Next", shape=ellipse]; + + red -> verify_red; + verify_red -> green [label="yes"]; + verify_red -> red [label="wrong\nfailure"]; + green -> verify_green; + verify_green -> refactor [label="yes"]; + verify_green -> green [label="no"]; + refactor -> verify_green [label="stay\ngreen"]; + verify_green -> next; + next -> red; +} +``` + +### RED - Write Failing Test + +Write one minimal test showing what should happen. + + +```typescript +test('retries failed operations 3 times', async () => { + let attempts = 0; + const operation = () => { + attempts++; + if (attempts < 3) throw new Error('fail'); + return 'success'; + }; + + const result = await retryOperation(operation); + + expect(result).toBe('success'); + expect(attempts).toBe(3); +}); +``` +Clear name, tests real behavior, one thing + + + +```typescript +test('retry works', async () => { + const mock = jest.fn() + .mockRejectedValueOnce(new Error()) + .mockRejectedValueOnce(new Error()) + .mockResolvedValueOnce('success'); + await retryOperation(mock); + expect(mock).toHaveBeenCalledTimes(3); +}); +``` +Vague name, tests mock not code + + +**Requirements:** +- One behavior +- Clear name +- Real code (no mocks unless unavoidable) + +### Verify RED - Watch It Fail + +**MANDATORY. Never skip.** + +```bash +npm test path/to/test.test.ts +``` + +Confirm: +- Test fails (not errors) +- Failure message is expected +- Fails because feature missing (not typos) + +**Test passes?** You're testing existing behavior. Fix test. + +**Test errors?** Fix error, re-run until it fails correctly. + +### GREEN - Minimal Code + +Write simplest code to pass the test. + + +```typescript +async function retryOperation(fn: () => Promise): Promise { + for (let i = 0; i < 3; i++) { + try { + return await fn(); + } catch (e) { + if (i === 2) throw e; + } + } + throw new Error('unreachable'); +} +``` +Just enough to pass + + + +```typescript +async function retryOperation( + fn: () => Promise, + options?: { + maxRetries?: number; + backoff?: 'linear' | 'exponential'; + onRetry?: (attempt: number) => void; + } +): Promise { + // YAGNI +} +``` +Over-engineered + + +Don't add features, refactor other code, or "improve" beyond the test. + +### Verify GREEN - Watch It Pass + +**MANDATORY.** + +```bash +npm test path/to/test.test.ts +``` + +Confirm: +- Test passes +- Other tests still pass +- Output pristine (no errors, warnings) + +**Test fails?** Fix code, not test. + +**Other tests fail?** Fix now. + +### REFACTOR - Clean Up + +After green only: +- Remove duplication +- Improve names +- Extract helpers + +Keep tests green. Don't add behavior. + +### Repeat + +Next failing test for next feature. + +## Good Tests + +| Quality | Good | Bad | +|---------|------|-----| +| **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` | +| **Clear** | Name describes behavior | `test('test1')` | +| **Shows intent** | Demonstrates desired API | Obscures what code should do | + +## Why Order Matters + +**"I'll write tests after to verify it works"** + +Tests written after code pass immediately. Passing immediately proves nothing: +- Might test wrong thing +- Might test implementation, not behavior +- Might miss edge cases you forgot +- You never saw it catch the bug + +Test-first forces you to see the test fail, proving it actually tests something. + +**"I already manually tested all the edge cases"** + +Manual testing is ad-hoc. You think you tested everything but: +- No record of what you tested +- Can't re-run when code changes +- Easy to forget cases under pressure +- "It worked when I tried it" ≠ comprehensive + +Automated tests are systematic. They run the same way every time. + +**"Deleting X hours of work is wasteful"** + +Sunk cost fallacy. The time is already gone. Your choice now: +- Delete and rewrite with TDD (X more hours, high confidence) +- Keep it and add tests after (30 min, low confidence, likely bugs) + +The "waste" is keeping code you can't trust. Working code without real tests is technical debt. + +**"TDD is dogmatic, being pragmatic means adapting"** + +TDD IS pragmatic: +- Finds bugs before commit (faster than debugging after) +- Prevents regressions (tests catch breaks immediately) +- Documents behavior (tests show how to use code) +- Enables refactoring (change freely, tests catch breaks) + +"Pragmatic" shortcuts = debugging in production = slower. + +**"Tests after achieve the same goals - it's spirit not ritual"** + +No. Tests-after answer "What does this do?" Tests-first answer "What should this do?" + +Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones. + +Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't). + +30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work. + +## Common Rationalizations + +| Excuse | Reality | +|--------|---------| +| "Too simple to test" | Simple code breaks. Test takes 30 seconds. | +| "I'll test after" | Tests passing immediately prove nothing. | +| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" | +| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. | +| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. | +| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. | +| "Need to explore first" | Fine. Throw away exploration, start with TDD. | +| "Test hard = design unclear" | Listen to test. Hard to test = hard to use. | +| "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. | +| "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. | +| "Existing code has no tests" | You're improving it. Add tests for existing code. | + +## Red Flags - STOP and Start Over + +- Code before test +- Test after implementation +- Test passes immediately +- Can't explain why test failed +- Tests added "later" +- Rationalizing "just this once" +- "I already manually tested it" +- "Tests after achieve the same purpose" +- "It's about spirit not ritual" +- "Keep as reference" or "adapt existing code" +- "Already spent X hours, deleting is wasteful" +- "TDD is dogmatic, I'm being pragmatic" +- "This is different because..." + +**All of these mean: Delete code. Start over with TDD.** + +## Example: Bug Fix + +**Bug:** Empty email accepted + +**RED** +```typescript +test('rejects empty email', async () => { + const result = await submitForm({ email: '' }); + expect(result.error).toBe('Email required'); +}); +``` + +**Verify RED** +```bash +$ npm test +FAIL: expected 'Email required', got undefined +``` + +**GREEN** +```typescript +function submitForm(data: FormData) { + if (!data.email?.trim()) { + return { error: 'Email required' }; + } + // ... +} +``` + +**Verify GREEN** +```bash +$ npm test +PASS +``` + +**REFACTOR** +Extract validation for multiple fields if needed. + +## Verification Checklist + +Before marking work complete: + +- [ ] Every new function/method has a test +- [ ] Watched each test fail before implementing +- [ ] Each test failed for expected reason (feature missing, not typo) +- [ ] Wrote minimal code to pass each test +- [ ] All tests pass +- [ ] Output pristine (no errors, warnings) +- [ ] Tests use real code (mocks only if unavoidable) +- [ ] Edge cases and errors covered + +Can't check all boxes? You skipped TDD. Start over. + +## When Stuck + +| Problem | Solution | +|---------|----------| +| Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. | +| Test too complicated | Design too complicated. Simplify interface. | +| Must mock everything | Code too coupled. Use dependency injection. | +| Test setup huge | Extract helpers. Still complex? Simplify design. | + +## Debugging Integration + +Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression. + +Never fix bugs without a test. + +## Testing Anti-Patterns + +When adding mocks or test utilities, read @testing-anti-patterns.md to avoid common pitfalls: +- Testing mock behavior instead of real behavior +- Adding test-only methods to production classes +- Mocking without understanding dependencies + +## Final Rule + +``` +Production code → test exists and failed first +Otherwise → not TDD +``` + +No exceptions without your human partner's permission. diff --git a/skills/external/test-driven-development/testing-anti-patterns.md b/skills/external/test-driven-development/testing-anti-patterns.md new file mode 100644 index 0000000..e77ab6b --- /dev/null +++ b/skills/external/test-driven-development/testing-anti-patterns.md @@ -0,0 +1,299 @@ +# Testing Anti-Patterns + +**Load this reference when:** writing or changing tests, adding mocks, or tempted to add test-only methods to production code. + +## Overview + +Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested. + +**Core principle:** Test what the code does, not what the mocks do. + +**Following strict TDD prevents these anti-patterns.** + +## The Iron Laws + +``` +1. NEVER test mock behavior +2. NEVER add test-only methods to production classes +3. NEVER mock without understanding dependencies +``` + +## Anti-Pattern 1: Testing Mock Behavior + +**The violation:** +```typescript +// ❌ BAD: Testing that the mock exists +test('renders sidebar', () => { + render(); + expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument(); +}); +``` + +**Why this is wrong:** +- You're verifying the mock works, not that the component works +- Test passes when mock is present, fails when it's not +- Tells you nothing about real behavior + +**your human partner's correction:** "Are we testing the behavior of a mock?" + +**The fix:** +```typescript +// ✅ GOOD: Test real component or don't mock it +test('renders sidebar', () => { + render(); // Don't mock sidebar + expect(screen.getByRole('navigation')).toBeInTheDocument(); +}); + +// OR if sidebar must be mocked for isolation: +// Don't assert on the mock - test Page's behavior with sidebar present +``` + +### Gate Function + +``` +BEFORE asserting on any mock element: + Ask: "Am I testing real component behavior or just mock existence?" + + IF testing mock existence: + STOP - Delete the assertion or unmock the component + + Test real behavior instead +``` + +## Anti-Pattern 2: Test-Only Methods in Production + +**The violation:** +```typescript +// ❌ BAD: destroy() only used in tests +class Session { + async destroy() { // Looks like production API! + await this._workspaceManager?.destroyWorkspace(this.id); + // ... cleanup + } +} + +// In tests +afterEach(() => session.destroy()); +``` + +**Why this is wrong:** +- Production class polluted with test-only code +- Dangerous if accidentally called in production +- Violates YAGNI and separation of concerns +- Confuses object lifecycle with entity lifecycle + +**The fix:** +```typescript +// ✅ GOOD: Test utilities handle test cleanup +// Session has no destroy() - it's stateless in production + +// In test-utils/ +export async function cleanupSession(session: Session) { + const workspace = session.getWorkspaceInfo(); + if (workspace) { + await workspaceManager.destroyWorkspace(workspace.id); + } +} + +// In tests +afterEach(() => cleanupSession(session)); +``` + +### Gate Function + +``` +BEFORE adding any method to production class: + Ask: "Is this only used by tests?" + + IF yes: + STOP - Don't add it + Put it in test utilities instead + + Ask: "Does this class own this resource's lifecycle?" + + IF no: + STOP - Wrong class for this method +``` + +## Anti-Pattern 3: Mocking Without Understanding + +**The violation:** +```typescript +// ❌ BAD: Mock breaks test logic +test('detects duplicate server', () => { + // Mock prevents config write that test depends on! + vi.mock('ToolCatalog', () => ({ + discoverAndCacheTools: vi.fn().mockResolvedValue(undefined) + })); + + await addServer(config); + await addServer(config); // Should throw - but won't! +}); +``` + +**Why this is wrong:** +- Mocked method had side effect test depended on (writing config) +- Over-mocking to "be safe" breaks actual behavior +- Test passes for wrong reason or fails mysteriously + +**The fix:** +```typescript +// ✅ GOOD: Mock at correct level +test('detects duplicate server', () => { + // Mock the slow part, preserve behavior test needs + vi.mock('MCPServerManager'); // Just mock slow server startup + + await addServer(config); // Config written + await addServer(config); // Duplicate detected ✓ +}); +``` + +### Gate Function + +``` +BEFORE mocking any method: + STOP - Don't mock yet + + 1. Ask: "What side effects does the real method have?" + 2. Ask: "Does this test depend on any of those side effects?" + 3. Ask: "Do I fully understand what this test needs?" + + IF depends on side effects: + Mock at lower level (the actual slow/external operation) + OR use test doubles that preserve necessary behavior + NOT the high-level method the test depends on + + IF unsure what test depends on: + Run test with real implementation FIRST + Observe what actually needs to happen + THEN add minimal mocking at the right level + + Red flags: + - "I'll mock this to be safe" + - "This might be slow, better mock it" + - Mocking without understanding the dependency chain +``` + +## Anti-Pattern 4: Incomplete Mocks + +**The violation:** +```typescript +// ❌ BAD: Partial mock - only fields you think you need +const mockResponse = { + status: 'success', + data: { userId: '123', name: 'Alice' } + // Missing: metadata that downstream code uses +}; + +// Later: breaks when code accesses response.metadata.requestId +``` + +**Why this is wrong:** +- **Partial mocks hide structural assumptions** - You only mocked fields you know about +- **Downstream code may depend on fields you didn't include** - Silent failures +- **Tests pass but integration fails** - Mock incomplete, real API complete +- **False confidence** - Test proves nothing about real behavior + +**The Iron Rule:** Mock the COMPLETE data structure as it exists in reality, not just fields your immediate test uses. + +**The fix:** +```typescript +// ✅ GOOD: Mirror real API completeness +const mockResponse = { + status: 'success', + data: { userId: '123', name: 'Alice' }, + metadata: { requestId: 'req-789', timestamp: 1234567890 } + // All fields real API returns +}; +``` + +### Gate Function + +``` +BEFORE creating mock responses: + Check: "What fields does the real API response contain?" + + Actions: + 1. Examine actual API response from docs/examples + 2. Include ALL fields system might consume downstream + 3. Verify mock matches real response schema completely + + Critical: + If you're creating a mock, you must understand the ENTIRE structure + Partial mocks fail silently when code depends on omitted fields + + If uncertain: Include all documented fields +``` + +## Anti-Pattern 5: Integration Tests as Afterthought + +**The violation:** +``` +✅ Implementation complete +❌ No tests written +"Ready for testing" +``` + +**Why this is wrong:** +- Testing is part of implementation, not optional follow-up +- TDD would have caught this +- Can't claim complete without tests + +**The fix:** +``` +TDD cycle: +1. Write failing test +2. Implement to pass +3. Refactor +4. THEN claim complete +``` + +## When Mocks Become Too Complex + +**Warning signs:** +- Mock setup longer than test logic +- Mocking everything to make test pass +- Mocks missing methods real components have +- Test breaks when mock changes + +**your human partner's question:** "Do we need to be using a mock here?" + +**Consider:** Integration tests with real components often simpler than complex mocks + +## TDD Prevents These Anti-Patterns + +**Why TDD helps:** +1. **Write test first** → Forces you to think about what you're actually testing +2. **Watch it fail** → Confirms test tests real behavior, not mocks +3. **Minimal implementation** → No test-only methods creep in +4. **Real dependencies** → You see what the test actually needs before mocking + +**If you're testing mock behavior, you violated TDD** - you added mocks without watching test fail against real code first. + +## Quick Reference + +| Anti-Pattern | Fix | +|--------------|-----| +| Assert on mock elements | Test real component or unmock it | +| Test-only methods in production | Move to test utilities | +| Mock without understanding | Understand dependencies first, mock minimally | +| Incomplete mocks | Mirror real API completely | +| Tests as afterthought | TDD - tests first | +| Over-complex mocks | Consider integration tests | + +## Red Flags + +- Assertion checks for `*-mock` test IDs +- Methods only called in test files +- Mock setup is >50% of test +- Test fails when you remove mock +- Can't explain why mock is needed +- Mocking "just to be safe" + +## The Bottom Line + +**Mocks are tools to isolate, not things to test.** + +If TDD reveals you're testing mock behavior, you've gone wrong. + +Fix: Test real behavior or question why you're mocking at all. diff --git a/skills/external/ui-ux-pro-max/SKILL.md b/skills/external/ui-ux-pro-max/SKILL.md new file mode 100644 index 0000000..e58d618 --- /dev/null +++ b/skills/external/ui-ux-pro-max/SKILL.md @@ -0,0 +1,386 @@ +--- +name: ui-ux-pro-max +description: "UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples." +--- + +# UI/UX Pro Max - Design Intelligence + +Comprehensive design guide for web and mobile applications. Contains 50+ styles, 97 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 9 technology stacks. Searchable database with priority-based recommendations. + +## When to Apply + +Reference these guidelines when: +- Designing new UI components or pages +- Choosing color palettes and typography +- Reviewing code for UX issues +- Building landing pages or dashboards +- Implementing accessibility requirements + +## Rule Categories by Priority + +| Priority | Category | Impact | Domain | +|----------|----------|--------|--------| +| 1 | Accessibility | CRITICAL | `ux` | +| 2 | Touch & Interaction | CRITICAL | `ux` | +| 3 | Performance | HIGH | `ux` | +| 4 | Layout & Responsive | HIGH | `ux` | +| 5 | Typography & Color | MEDIUM | `typography`, `color` | +| 6 | Animation | MEDIUM | `ux` | +| 7 | Style Selection | MEDIUM | `style`, `product` | +| 8 | Charts & Data | LOW | `chart` | + +## Quick Reference + +### 1. Accessibility (CRITICAL) + +- `color-contrast` - Minimum 4.5:1 ratio for normal text +- `focus-states` - Visible focus rings on interactive elements +- `alt-text` - Descriptive alt text for meaningful images +- `aria-labels` - aria-label for icon-only buttons +- `keyboard-nav` - Tab order matches visual order +- `form-labels` - Use label with for attribute + +### 2. Touch & Interaction (CRITICAL) + +- `touch-target-size` - Minimum 44x44px touch targets +- `hover-vs-tap` - Use click/tap for primary interactions +- `loading-buttons` - Disable button during async operations +- `error-feedback` - Clear error messages near problem +- `cursor-pointer` - Add cursor-pointer to clickable elements + +### 3. Performance (HIGH) + +- `image-optimization` - Use WebP, srcset, lazy loading +- `reduced-motion` - Check prefers-reduced-motion +- `content-jumping` - Reserve space for async content + +### 4. Layout & Responsive (HIGH) + +- `viewport-meta` - width=device-width initial-scale=1 +- `readable-font-size` - Minimum 16px body text on mobile +- `horizontal-scroll` - Ensure content fits viewport width +- `z-index-management` - Define z-index scale (10, 20, 30, 50) + +### 5. Typography & Color (MEDIUM) + +- `line-height` - Use 1.5-1.75 for body text +- `line-length` - Limit to 65-75 characters per line +- `font-pairing` - Match heading/body font personalities + +### 6. Animation (MEDIUM) + +- `duration-timing` - Use 150-300ms for micro-interactions +- `transform-performance` - Use transform/opacity, not width/height +- `loading-states` - Skeleton screens or spinners + +### 7. Style Selection (MEDIUM) + +- `style-match` - Match style to product type +- `consistency` - Use same style across all pages +- `no-emoji-icons` - Use SVG icons, not emojis + +### 8. Charts & Data (LOW) + +- `chart-type` - Match chart type to data type +- `color-guidance` - Use accessible color palettes +- `data-table` - Provide table alternative for accessibility + +## How to Use + +Search specific domains using the CLI tool below. + +--- + +## Prerequisites + +Check if Python is installed: + +```bash +python3 --version || python --version +``` + +If Python is not installed, install it based on user's OS: + +**macOS:** +```bash +brew install python3 +``` + +**Ubuntu/Debian:** +```bash +sudo apt update && sudo apt install python3 +``` + +**Windows:** +```powershell +winget install Python.Python.3.12 +``` + +--- + +## How to Use This Skill + +When user requests UI/UX work (design, build, create, implement, review, fix, improve), follow this workflow: + +### Step 1: Analyze User Requirements + +Extract key information from user request: +- **Product type**: SaaS, e-commerce, portfolio, dashboard, landing page, etc. +- **Style keywords**: minimal, playful, professional, elegant, dark mode, etc. +- **Industry**: healthcare, fintech, gaming, education, etc. +- **Stack**: React, Vue, Next.js, or default to `html-tailwind` + +### Step 2: Generate Design System (REQUIRED) + +**Always start with `--design-system`** to get comprehensive recommendations with reasoning: + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py " " --design-system [-p "Project Name"] +``` + +This command: +1. Searches 5 domains in parallel (product, style, color, landing, typography) +2. Applies reasoning rules from `ui-reasoning.csv` to select best matches +3. Returns complete design system: pattern, style, colors, typography, effects +4. Includes anti-patterns to avoid + +**Example:** +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service" --design-system -p "Serenity Spa" +``` + +### Step 2b: Persist Design System (Master + Overrides Pattern) + +To save the design system for **hierarchical retrieval across sessions**, add `--persist`: + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "" --design-system --persist -p "Project Name" +``` + +This creates: +- `design-system/MASTER.md` — Global Source of Truth with all design rules +- `design-system/pages/` — Folder for page-specific overrides + +**With page-specific override:** +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "" --design-system --persist -p "Project Name" --page "dashboard" +``` + +This also creates: +- `design-system/pages/dashboard.md` — Page-specific deviations from Master + +**How hierarchical retrieval works:** +1. When building a specific page (e.g., "Checkout"), first check `design-system/pages/checkout.md` +2. If the page file exists, its rules **override** the Master file +3. If not, use `design-system/MASTER.md` exclusively + +**Context-aware retrieval prompt:** +``` +I am building the [Page Name] page. Please read design-system/MASTER.md. +Also check if design-system/pages/[page-name].md exists. +If the page file exists, prioritize its rules. +If not, use the Master rules exclusively. +Now, generate the code... +``` + +### Step 3: Supplement with Detailed Searches (as needed) + +After getting the design system, use domain searches to get additional details: + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "" --domain [-n ] +``` + +**When to use detailed searches:** + +| Need | Domain | Example | +|------|--------|---------| +| More style options | `style` | `--domain style "glassmorphism dark"` | +| Chart recommendations | `chart` | `--domain chart "real-time dashboard"` | +| UX best practices | `ux` | `--domain ux "animation accessibility"` | +| Alternative fonts | `typography` | `--domain typography "elegant luxury"` | +| Landing structure | `landing` | `--domain landing "hero social-proof"` | + +### Step 4: Stack Guidelines (Default: html-tailwind) + +Get implementation-specific best practices. If user doesn't specify a stack, **default to `html-tailwind`**. + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "" --stack html-tailwind +``` + +Available stacks: `html-tailwind`, `react`, `nextjs`, `vue`, `svelte`, `swiftui`, `react-native`, `flutter`, `shadcn`, `jetpack-compose` + +--- + +## Search Reference + +### Available Domains + +| Domain | Use For | Example Keywords | +|--------|---------|------------------| +| `product` | Product type recommendations | SaaS, e-commerce, portfolio, healthcare, beauty, service | +| `style` | UI styles, colors, effects | glassmorphism, minimalism, dark mode, brutalism | +| `typography` | Font pairings, Google Fonts | elegant, playful, professional, modern | +| `color` | Color palettes by product type | saas, ecommerce, healthcare, beauty, fintech, service | +| `landing` | Page structure, CTA strategies | hero, hero-centric, testimonial, pricing, social-proof | +| `chart` | Chart types, library recommendations | trend, comparison, timeline, funnel, pie | +| `ux` | Best practices, anti-patterns | animation, accessibility, z-index, loading | +| `react` | React/Next.js performance | waterfall, bundle, suspense, memo, rerender, cache | +| `web` | Web interface guidelines | aria, focus, keyboard, semantic, virtualize | +| `prompt` | AI prompts, CSS keywords | (style name) | + +### Available Stacks + +| Stack | Focus | +|-------|-------| +| `html-tailwind` | Tailwind utilities, responsive, a11y (DEFAULT) | +| `react` | State, hooks, performance, patterns | +| `nextjs` | SSR, routing, images, API routes | +| `vue` | Composition API, Pinia, Vue Router | +| `svelte` | Runes, stores, SvelteKit | +| `swiftui` | Views, State, Navigation, Animation | +| `react-native` | Components, Navigation, Lists | +| `flutter` | Widgets, State, Layout, Theming | +| `shadcn` | shadcn/ui components, theming, forms, patterns | +| `jetpack-compose` | Composables, Modifiers, State Hoisting, Recomposition | + +--- + +## Example Workflow + +**User request:** "Làm landing page cho dịch vụ chăm sóc da chuyên nghiệp" + +### Step 1: Analyze Requirements +- Product type: Beauty/Spa service +- Style keywords: elegant, professional, soft +- Industry: Beauty/Wellness +- Stack: html-tailwind (default) + +### Step 2: Generate Design System (REQUIRED) + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service elegant" --design-system -p "Serenity Spa" +``` + +**Output:** Complete design system with pattern, style, colors, typography, effects, and anti-patterns. + +### Step 3: Supplement with Detailed Searches (as needed) + +```bash +# Get UX guidelines for animation and accessibility +python3 skills/ui-ux-pro-max/scripts/search.py "animation accessibility" --domain ux + +# Get alternative typography options if needed +python3 skills/ui-ux-pro-max/scripts/search.py "elegant luxury serif" --domain typography +``` + +### Step 4: Stack Guidelines + +```bash +python3 skills/ui-ux-pro-max/scripts/search.py "layout responsive form" --stack html-tailwind +``` + +**Then:** Synthesize design system + detailed searches and implement the design. + +--- + +## Output Formats + +The `--design-system` flag supports two output formats: + +```bash +# ASCII box (default) - best for terminal display +python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system + +# Markdown - best for documentation +python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system -f markdown +``` + +--- + +## Tips for Better Results + +1. **Be specific with keywords** - "healthcare SaaS dashboard" > "app" +2. **Search multiple times** - Different keywords reveal different insights +3. **Combine domains** - Style + Typography + Color = Complete design system +4. **Always check UX** - Search "animation", "z-index", "accessibility" for common issues +5. **Use stack flag** - Get implementation-specific best practices +6. **Iterate** - If first search doesn't match, try different keywords + +--- + +## Common Rules for Professional UI + +These are frequently overlooked issues that make UI look unprofessional: + +### Icons & Visual Elements + +| Rule | Do | Don't | +|------|----|----- | +| **No emoji icons** | Use SVG icons (Heroicons, Lucide, Simple Icons) | Use emojis like 🎨 🚀 ⚙️ as UI icons | +| **Stable hover states** | Use color/opacity transitions on hover | Use scale transforms that shift layout | +| **Correct brand logos** | Research official SVG from Simple Icons | Guess or use incorrect logo paths | +| **Consistent icon sizing** | Use fixed viewBox (24x24) with w-6 h-6 | Mix different icon sizes randomly | + +### Interaction & Cursor + +| Rule | Do | Don't | +|------|----|----- | +| **Cursor pointer** | Add `cursor-pointer` to all clickable/hoverable cards | Leave default cursor on interactive elements | +| **Hover feedback** | Provide visual feedback (color, shadow, border) | No indication element is interactive | +| **Smooth transitions** | Use `transition-colors duration-200` | Instant state changes or too slow (>500ms) | + +### Light/Dark Mode Contrast + +| Rule | Do | Don't | +|------|----|----- | +| **Glass card light mode** | Use `bg-white/80` or higher opacity | Use `bg-white/10` (too transparent) | +| **Text contrast light** | Use `#0F172A` (slate-900) for text | Use `#94A3B8` (slate-400) for body text | +| **Muted text light** | Use `#475569` (slate-600) minimum | Use gray-400 or lighter | +| **Border visibility** | Use `border-gray-200` in light mode | Use `border-white/10` (invisible) | + +### Layout & Spacing + +| Rule | Do | Don't | +|------|----|----- | +| **Floating navbar** | Add `top-4 left-4 right-4` spacing | Stick navbar to `top-0 left-0 right-0` | +| **Content padding** | Account for fixed navbar height | Let content hide behind fixed elements | +| **Consistent max-width** | Use same `max-w-6xl` or `max-w-7xl` | Mix different container widths | + +--- + +## Pre-Delivery Checklist + +Before delivering UI code, verify these items: + +### Visual Quality +- [ ] No emojis used as icons (use SVG instead) +- [ ] All icons from consistent icon set (Heroicons/Lucide) +- [ ] Brand logos are correct (verified from Simple Icons) +- [ ] Hover states don't cause layout shift +- [ ] Use theme colors directly (bg-primary) not var() wrapper + +### Interaction +- [ ] All clickable elements have `cursor-pointer` +- [ ] Hover states provide clear visual feedback +- [ ] Transitions are smooth (150-300ms) +- [ ] Focus states visible for keyboard navigation + +### Light/Dark Mode +- [ ] Light mode text has sufficient contrast (4.5:1 minimum) +- [ ] Glass/transparent elements visible in light mode +- [ ] Borders visible in both modes +- [ ] Test both modes before delivery + +### Layout +- [ ] Floating elements have proper spacing from edges +- [ ] No content hidden behind fixed navbars +- [ ] Responsive at 375px, 768px, 1024px, 1440px +- [ ] No horizontal scroll on mobile + +### Accessibility +- [ ] All images have alt text +- [ ] Form inputs have labels +- [ ] Color is not the only indicator +- [ ] `prefers-reduced-motion` respected diff --git a/skills/external/ui-ux-pro-max/data b/skills/external/ui-ux-pro-max/data new file mode 120000 index 0000000..e5b9469 --- /dev/null +++ b/skills/external/ui-ux-pro-max/data @@ -0,0 +1 @@ +../../../src/ui-ux-pro-max/data \ No newline at end of file diff --git a/skills/external/ui-ux-pro-max/scripts b/skills/external/ui-ux-pro-max/scripts new file mode 120000 index 0000000..ccb93f7 --- /dev/null +++ b/skills/external/ui-ux-pro-max/scripts @@ -0,0 +1 @@ +../../../src/ui-ux-pro-max/scripts \ No newline at end of file diff --git a/skills/external/using-git-worktrees/SKILL.md b/skills/external/using-git-worktrees/SKILL.md new file mode 100644 index 0000000..e153843 --- /dev/null +++ b/skills/external/using-git-worktrees/SKILL.md @@ -0,0 +1,218 @@ +--- +name: using-git-worktrees +description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification +--- + +# Using Git Worktrees + +## Overview + +Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching. + +**Core principle:** Systematic directory selection + safety verification = reliable isolation. + +**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace." + +## Directory Selection Process + +Follow this priority order: + +### 1. Check Existing Directories + +```bash +# Check in priority order +ls -d .worktrees 2>/dev/null # Preferred (hidden) +ls -d worktrees 2>/dev/null # Alternative +``` + +**If found:** Use that directory. If both exist, `.worktrees` wins. + +### 2. Check CLAUDE.md + +```bash +grep -i "worktree.*director" CLAUDE.md 2>/dev/null +``` + +**If preference specified:** Use it without asking. + +### 3. Ask User + +If no directory exists and no CLAUDE.md preference: + +``` +No worktree directory found. Where should I create worktrees? + +1. .worktrees/ (project-local, hidden) +2. ~/.config/superpowers/worktrees// (global location) + +Which would you prefer? +``` + +## Safety Verification + +### For Project-Local Directories (.worktrees or worktrees) + +**MUST verify directory is ignored before creating worktree:** + +```bash +# Check if directory is ignored (respects local, global, and system gitignore) +git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null +``` + +**If NOT ignored:** + +Per Jesse's rule "Fix broken things immediately": +1. Add appropriate line to .gitignore +2. Commit the change +3. Proceed with worktree creation + +**Why critical:** Prevents accidentally committing worktree contents to repository. + +### For Global Directory (~/.config/superpowers/worktrees) + +No .gitignore verification needed - outside project entirely. + +## Creation Steps + +### 1. Detect Project Name + +```bash +project=$(basename "$(git rev-parse --show-toplevel)") +``` + +### 2. Create Worktree + +```bash +# Determine full path +case $LOCATION in + .worktrees|worktrees) + path="$LOCATION/$BRANCH_NAME" + ;; + ~/.config/superpowers/worktrees/*) + path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME" + ;; +esac + +# Create worktree with new branch +git worktree add "$path" -b "$BRANCH_NAME" +cd "$path" +``` + +### 3. Run Project Setup + +Auto-detect and run appropriate setup: + +```bash +# Node.js +if [ -f package.json ]; then npm install; fi + +# Rust +if [ -f Cargo.toml ]; then cargo build; fi + +# Python +if [ -f requirements.txt ]; then pip install -r requirements.txt; fi +if [ -f pyproject.toml ]; then poetry install; fi + +# Go +if [ -f go.mod ]; then go mod download; fi +``` + +### 4. Verify Clean Baseline + +Run tests to ensure worktree starts clean: + +```bash +# Examples - use project-appropriate command +npm test +cargo test +pytest +go test ./... +``` + +**If tests fail:** Report failures, ask whether to proceed or investigate. + +**If tests pass:** Report ready. + +### 5. Report Location + +``` +Worktree ready at +Tests passing ( tests, 0 failures) +Ready to implement +``` + +## Quick Reference + +| Situation | Action | +|-----------|--------| +| `.worktrees/` exists | Use it (verify ignored) | +| `worktrees/` exists | Use it (verify ignored) | +| Both exist | Use `.worktrees/` | +| Neither exists | Check CLAUDE.md → Ask user | +| Directory not ignored | Add to .gitignore + commit | +| Tests fail during baseline | Report failures + ask | +| No package.json/Cargo.toml | Skip dependency install | + +## Common Mistakes + +### Skipping ignore verification + +- **Problem:** Worktree contents get tracked, pollute git status +- **Fix:** Always use `git check-ignore` before creating project-local worktree + +### Assuming directory location + +- **Problem:** Creates inconsistency, violates project conventions +- **Fix:** Follow priority: existing > CLAUDE.md > ask + +### Proceeding with failing tests + +- **Problem:** Can't distinguish new bugs from pre-existing issues +- **Fix:** Report failures, get explicit permission to proceed + +### Hardcoding setup commands + +- **Problem:** Breaks on projects using different tools +- **Fix:** Auto-detect from project files (package.json, etc.) + +## Example Workflow + +``` +You: I'm using the using-git-worktrees skill to set up an isolated workspace. + +[Check .worktrees/ - exists] +[Verify ignored - git check-ignore confirms .worktrees/ is ignored] +[Create worktree: git worktree add .worktrees/auth -b feature/auth] +[Run npm install] +[Run npm test - 47 passing] + +Worktree ready at /Users/jesse/myproject/.worktrees/auth +Tests passing (47 tests, 0 failures) +Ready to implement auth feature +``` + +## Red Flags + +**Never:** +- Create worktree without verifying it's ignored (project-local) +- Skip baseline test verification +- Proceed with failing tests without asking +- Assume directory location when ambiguous +- Skip CLAUDE.md check + +**Always:** +- Follow directory priority: existing > CLAUDE.md > ask +- Verify directory is ignored for project-local +- Auto-detect and run project setup +- Verify clean test baseline + +## Integration + +**Called by:** +- **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows +- **subagent-driven-development** - REQUIRED before executing any tasks +- **executing-plans** - REQUIRED before executing any tasks +- Any skill needing isolated workspace + +**Pairs with:** +- **finishing-a-development-branch** - REQUIRED for cleanup after work complete diff --git a/skills/external/using-superpowers/SKILL.md b/skills/external/using-superpowers/SKILL.md new file mode 100644 index 0000000..b227eec --- /dev/null +++ b/skills/external/using-superpowers/SKILL.md @@ -0,0 +1,95 @@ +--- +name: using-superpowers +description: Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions +--- + + +If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY MUST invoke the skill. + +IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT. + +This is not negotiable. This is not optional. You cannot rationalize your way out of this. + + +## How to Access Skills + +**In Claude Code:** Use the `Skill` tool. When you invoke a skill, its content is loaded and presented to you—follow it directly. Never use the Read tool on skill files. + +**In other environments:** Check your platform's documentation for how skills are loaded. + +# Using Skills + +## The Rule + +**Invoke relevant or requested skills BEFORE any response or action.** Even a 1% chance a skill might apply means that you should invoke the skill to check. If an invoked skill turns out to be wrong for the situation, you don't need to use it. + +```dot +digraph skill_flow { + "User message received" [shape=doublecircle]; + "About to EnterPlanMode?" [shape=doublecircle]; + "Already brainstormed?" [shape=diamond]; + "Invoke brainstorming skill" [shape=box]; + "Might any skill apply?" [shape=diamond]; + "Invoke Skill tool" [shape=box]; + "Announce: 'Using [skill] to [purpose]'" [shape=box]; + "Has checklist?" [shape=diamond]; + "Create TodoWrite todo per item" [shape=box]; + "Follow skill exactly" [shape=box]; + "Respond (including clarifications)" [shape=doublecircle]; + + "About to EnterPlanMode?" -> "Already brainstormed?"; + "Already brainstormed?" -> "Invoke brainstorming skill" [label="no"]; + "Already brainstormed?" -> "Might any skill apply?" [label="yes"]; + "Invoke brainstorming skill" -> "Might any skill apply?"; + + "User message received" -> "Might any skill apply?"; + "Might any skill apply?" -> "Invoke Skill tool" [label="yes, even 1%"]; + "Might any skill apply?" -> "Respond (including clarifications)" [label="definitely not"]; + "Invoke Skill tool" -> "Announce: 'Using [skill] to [purpose]'"; + "Announce: 'Using [skill] to [purpose]'" -> "Has checklist?"; + "Has checklist?" -> "Create TodoWrite todo per item" [label="yes"]; + "Has checklist?" -> "Follow skill exactly" [label="no"]; + "Create TodoWrite todo per item" -> "Follow skill exactly"; +} +``` + +## Red Flags + +These thoughts mean STOP—you're rationalizing: + +| Thought | Reality | +|---------|---------| +| "This is just a simple question" | Questions are tasks. Check for skills. | +| "I need more context first" | Skill check comes BEFORE clarifying questions. | +| "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. | +| "I can check git/files quickly" | Files lack conversation context. Check for skills. | +| "Let me gather information first" | Skills tell you HOW to gather information. | +| "This doesn't need a formal skill" | If a skill exists, use it. | +| "I remember this skill" | Skills evolve. Read current version. | +| "This doesn't count as a task" | Action = task. Check for skills. | +| "The skill is overkill" | Simple things become complex. Use it. | +| "I'll just do this one thing first" | Check BEFORE doing anything. | +| "This feels productive" | Undisciplined action wastes time. Skills prevent this. | +| "I know what that means" | Knowing the concept ≠ using the skill. Invoke it. | + +## Skill Priority + +When multiple skills could apply, use this order: + +1. **Process skills first** (brainstorming, debugging) - these determine HOW to approach the task +2. **Implementation skills second** (frontend-design, mcp-builder) - these guide execution + +"Let's build X" → brainstorming first, then implementation skills. +"Fix this bug" → debugging first, then domain-specific skills. + +## Skill Types + +**Rigid** (TDD, debugging): Follow exactly. Don't adapt away discipline. + +**Flexible** (patterns): Adapt principles to context. + +The skill itself tells you which. + +## User Instructions + +Instructions say WHAT, not HOW. "Add X" or "Fix Y" doesn't mean skip workflows. diff --git a/skills/external/verification-before-completion/SKILL.md b/skills/external/verification-before-completion/SKILL.md new file mode 100644 index 0000000..2f14076 --- /dev/null +++ b/skills/external/verification-before-completion/SKILL.md @@ -0,0 +1,139 @@ +--- +name: verification-before-completion +description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always +--- + +# Verification Before Completion + +## Overview + +Claiming work is complete without verification is dishonesty, not efficiency. + +**Core principle:** Evidence before claims, always. + +**Violating the letter of this rule is violating the spirit of this rule.** + +## The Iron Law + +``` +NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE +``` + +If you haven't run the verification command in this message, you cannot claim it passes. + +## The Gate Function + +``` +BEFORE claiming any status or expressing satisfaction: + +1. IDENTIFY: What command proves this claim? +2. RUN: Execute the FULL command (fresh, complete) +3. READ: Full output, check exit code, count failures +4. VERIFY: Does output confirm the claim? + - If NO: State actual status with evidence + - If YES: State claim WITH evidence +5. ONLY THEN: Make the claim + +Skip any step = lying, not verifying +``` + +## Common Failures + +| Claim | Requires | Not Sufficient | +|-------|----------|----------------| +| Tests pass | Test command output: 0 failures | Previous run, "should pass" | +| Linter clean | Linter output: 0 errors | Partial check, extrapolation | +| Build succeeds | Build command: exit 0 | Linter passing, logs look good | +| Bug fixed | Test original symptom: passes | Code changed, assumed fixed | +| Regression test works | Red-green cycle verified | Test passes once | +| Agent completed | VCS diff shows changes | Agent reports "success" | +| Requirements met | Line-by-line checklist | Tests passing | + +## Red Flags - STOP + +- Using "should", "probably", "seems to" +- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.) +- About to commit/push/PR without verification +- Trusting agent success reports +- Relying on partial verification +- Thinking "just this once" +- Tired and wanting work over +- **ANY wording implying success without having run verification** + +## Rationalization Prevention + +| Excuse | Reality | +|--------|---------| +| "Should work now" | RUN the verification | +| "I'm confident" | Confidence ≠ evidence | +| "Just this once" | No exceptions | +| "Linter passed" | Linter ≠ compiler | +| "Agent said success" | Verify independently | +| "I'm tired" | Exhaustion ≠ excuse | +| "Partial check is enough" | Partial proves nothing | +| "Different words so rule doesn't apply" | Spirit over letter | + +## Key Patterns + +**Tests:** +``` +✅ [Run test command] [See: 34/34 pass] "All tests pass" +❌ "Should pass now" / "Looks correct" +``` + +**Regression tests (TDD Red-Green):** +``` +✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass) +❌ "I've written a regression test" (without red-green verification) +``` + +**Build:** +``` +✅ [Run build] [See: exit 0] "Build passes" +❌ "Linter passed" (linter doesn't check compilation) +``` + +**Requirements:** +``` +✅ Re-read plan → Create checklist → Verify each → Report gaps or completion +❌ "Tests pass, phase complete" +``` + +**Agent delegation:** +``` +✅ Agent reports success → Check VCS diff → Verify changes → Report actual state +❌ Trust agent report +``` + +## Why This Matters + +From 24 failure memories: +- your human partner said "I don't believe you" - trust broken +- Undefined functions shipped - would crash +- Missing requirements shipped - incomplete features +- Time wasted on false completion → redirect → rework +- Violates: "Honesty is a core value. If you lie, you'll be replaced." + +## When To Apply + +**ALWAYS before:** +- ANY variation of success/completion claims +- ANY expression of satisfaction +- ANY positive statement about work state +- Committing, PR creation, task completion +- Moving to next task +- Delegating to agents + +**Rule applies to:** +- Exact phrases +- Paraphrases and synonyms +- Implications of success +- ANY communication suggesting completion/correctness + +## The Bottom Line + +**No shortcuts for verification.** + +Run the command. Read the output. THEN claim the result. + +This is non-negotiable. diff --git a/skills/external/writing-plans/SKILL.md b/skills/external/writing-plans/SKILL.md new file mode 100644 index 0000000..5fc45b6 --- /dev/null +++ b/skills/external/writing-plans/SKILL.md @@ -0,0 +1,116 @@ +--- +name: writing-plans +description: Use when you have a spec or requirements for a multi-step task, before touching code +--- + +# Writing Plans + +## Overview + +Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits. + +Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well. + +**Announce at start:** "I'm using the writing-plans skill to create the implementation plan." + +**Context:** This should be run in a dedicated worktree (created by brainstorming skill). + +**Save plans to:** `docs/plans/YYYY-MM-DD-.md` + +## Bite-Sized Task Granularity + +**Each step is one action (2-5 minutes):** +- "Write the failing test" - step +- "Run it to make sure it fails" - step +- "Implement the minimal code to make the test pass" - step +- "Run the tests and make sure they pass" - step +- "Commit" - step + +## Plan Document Header + +**Every plan MUST start with this header:** + +```markdown +# [Feature Name] Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** [One sentence describing what this builds] + +**Architecture:** [2-3 sentences about approach] + +**Tech Stack:** [Key technologies/libraries] + +--- +``` + +## Task Structure + +````markdown +### Task N: [Component Name] + +**Files:** +- Create: `exact/path/to/file.py` +- Modify: `exact/path/to/existing.py:123-145` +- Test: `tests/exact/path/to/test.py` + +**Step 1: Write the failing test** + +```python +def test_specific_behavior(): + result = function(input) + assert result == expected +``` + +**Step 2: Run test to verify it fails** + +Run: `pytest tests/path/test.py::test_name -v` +Expected: FAIL with "function not defined" + +**Step 3: Write minimal implementation** + +```python +def function(input): + return expected +``` + +**Step 4: Run test to verify it passes** + +Run: `pytest tests/path/test.py::test_name -v` +Expected: PASS + +**Step 5: Commit** + +```bash +git add tests/path/test.py src/path/file.py +git commit -m "feat: add specific feature" +``` +```` + +## Remember +- Exact file paths always +- Complete code in plan (not "add validation") +- Exact commands with expected output +- Reference relevant skills with @ syntax +- DRY, YAGNI, TDD, frequent commits + +## Execution Handoff + +After saving the plan, offer execution choice: + +**"Plan complete and saved to `docs/plans/.md`. Two execution options:** + +**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration + +**2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints + +**Which approach?"** + +**If Subagent-Driven chosen:** +- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development +- Stay in this session +- Fresh subagent per task + code review + +**If Parallel Session chosen:** +- Guide them to open new session in worktree +- **REQUIRED SUB-SKILL:** New session uses superpowers:executing-plans diff --git a/skills/external/writing-skills/SKILL.md b/skills/external/writing-skills/SKILL.md new file mode 100644 index 0000000..4cd8ddf --- /dev/null +++ b/skills/external/writing-skills/SKILL.md @@ -0,0 +1,655 @@ +--- +name: writing-skills +description: Use when creating new skills, editing existing skills, or verifying skills work before deployment +--- + +# Writing Skills + +## Overview + +**Writing skills IS Test-Driven Development applied to process documentation.** + +**Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.agents/skills/` for Codex)** + +You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes). + +**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing. + +**REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation. + +**Official guidance:** For Anthropic's official skill authoring best practices, see anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill. + +## What is a Skill? + +A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches. + +**Skills are:** Reusable techniques, patterns, tools, reference guides + +**Skills are NOT:** Narratives about how you solved a problem once + +## TDD Mapping for Skills + +| TDD Concept | Skill Creation | +|-------------|----------------| +| **Test case** | Pressure scenario with subagent | +| **Production code** | Skill document (SKILL.md) | +| **Test fails (RED)** | Agent violates rule without skill (baseline) | +| **Test passes (GREEN)** | Agent complies with skill present | +| **Refactor** | Close loopholes while maintaining compliance | +| **Write test first** | Run baseline scenario BEFORE writing skill | +| **Watch it fail** | Document exact rationalizations agent uses | +| **Minimal code** | Write skill addressing those specific violations | +| **Watch it pass** | Verify agent now complies | +| **Refactor cycle** | Find new rationalizations → plug → re-verify | + +The entire skill creation process follows RED-GREEN-REFACTOR. + +## When to Create a Skill + +**Create when:** +- Technique wasn't intuitively obvious to you +- You'd reference this again across projects +- Pattern applies broadly (not project-specific) +- Others would benefit + +**Don't create for:** +- One-off solutions +- Standard practices well-documented elsewhere +- Project-specific conventions (put in CLAUDE.md) +- Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls) + +## Skill Types + +### Technique +Concrete method with steps to follow (condition-based-waiting, root-cause-tracing) + +### Pattern +Way of thinking about problems (flatten-with-flags, test-invariants) + +### Reference +API docs, syntax guides, tool documentation (office docs) + +## Directory Structure + + +``` +skills/ + skill-name/ + SKILL.md # Main reference (required) + supporting-file.* # Only if needed +``` + +**Flat namespace** - all skills in one searchable namespace + +**Separate files for:** +1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax +2. **Reusable tools** - Scripts, utilities, templates + +**Keep inline:** +- Principles and concepts +- Code patterns (< 50 lines) +- Everything else + +## SKILL.md Structure + +**Frontmatter (YAML):** +- Only two fields supported: `name` and `description` +- Max 1024 characters total +- `name`: Use letters, numbers, and hyphens only (no parentheses, special chars) +- `description`: Third-person, describes ONLY when to use (NOT what it does) + - Start with "Use when..." to focus on triggering conditions + - Include specific symptoms, situations, and contexts + - **NEVER summarize the skill's process or workflow** (see CSO section for why) + - Keep under 500 characters if possible + +```markdown +--- +name: Skill-Name-With-Hyphens +description: Use when [specific triggering conditions and symptoms] +--- + +# Skill Name + +## Overview +What is this? Core principle in 1-2 sentences. + +## When to Use +[Small inline flowchart IF decision non-obvious] + +Bullet list with SYMPTOMS and use cases +When NOT to use + +## Core Pattern (for techniques/patterns) +Before/after code comparison + +## Quick Reference +Table or bullets for scanning common operations + +## Implementation +Inline code for simple patterns +Link to file for heavy reference or reusable tools + +## Common Mistakes +What goes wrong + fixes + +## Real-World Impact (optional) +Concrete results +``` + + +## Claude Search Optimization (CSO) + +**Critical for discovery:** Future Claude needs to FIND your skill + +### 1. Rich Description Field + +**Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?" + +**Format:** Start with "Use when..." to focus on triggering conditions + +**CRITICAL: Description = When to Use, NOT What the Skill Does** + +The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description. + +**Why this matters:** Testing revealed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused Claude to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality). + +When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process. + +**The trap:** Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips. + +```yaml +# ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill +description: Use when executing plans - dispatches subagent per task with code review between tasks + +# ❌ BAD: Too much process detail +description: Use for TDD - write test first, watch it fail, write minimal code, refactor + +# ✅ GOOD: Just triggering conditions, no workflow summary +description: Use when executing implementation plans with independent tasks in the current session + +# ✅ GOOD: Triggering conditions only +description: Use when implementing any feature or bugfix, before writing implementation code +``` + +**Content:** +- Use concrete triggers, symptoms, and situations that signal this skill applies +- Describe the *problem* (race conditions, inconsistent behavior) not *language-specific symptoms* (setTimeout, sleep) +- Keep triggers technology-agnostic unless the skill itself is technology-specific +- If skill is technology-specific, make that explicit in the trigger +- Write in third person (injected into system prompt) +- **NEVER summarize the skill's process or workflow** + +```yaml +# ❌ BAD: Too abstract, vague, doesn't include when to use +description: For async testing + +# ❌ BAD: First person +description: I can help you with async tests when they're flaky + +# ❌ BAD: Mentions technology but skill isn't specific to it +description: Use when tests use setTimeout/sleep and are flaky + +# ✅ GOOD: Starts with "Use when", describes problem, no workflow +description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently + +# ✅ GOOD: Technology-specific skill with explicit trigger +description: Use when using React Router and handling authentication redirects +``` + +### 2. Keyword Coverage + +Use words Claude would search for: +- Error messages: "Hook timed out", "ENOTEMPTY", "race condition" +- Symptoms: "flaky", "hanging", "zombie", "pollution" +- Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach" +- Tools: Actual commands, library names, file types + +### 3. Descriptive Naming + +**Use active voice, verb-first:** +- ✅ `creating-skills` not `skill-creation` +- ✅ `condition-based-waiting` not `async-test-helpers` + +### 4. Token Efficiency (Critical) + +**Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts. + +**Target word counts:** +- getting-started workflows: <150 words each +- Frequently-loaded skills: <200 words total +- Other skills: <500 words (still be concise) + +**Techniques:** + +**Move details to tool help:** +```bash +# ❌ BAD: Document all flags in SKILL.md +search-conversations supports --text, --both, --after DATE, --before DATE, --limit N + +# ✅ GOOD: Reference --help +search-conversations supports multiple modes and filters. Run --help for details. +``` + +**Use cross-references:** +```markdown +# ❌ BAD: Repeat workflow details +When searching, dispatch subagent with template... +[20 lines of repeated instructions] + +# ✅ GOOD: Reference other skill +Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow. +``` + +**Compress examples:** +```markdown +# ❌ BAD: Verbose example (42 words) +your human partner: "How did we handle authentication errors in React Router before?" +You: I'll search past conversations for React Router authentication patterns. +[Dispatch subagent with search query: "React Router authentication error handling 401"] + +# ✅ GOOD: Minimal example (20 words) +Partner: "How did we handle auth errors in React Router?" +You: Searching... +[Dispatch subagent → synthesis] +``` + +**Eliminate redundancy:** +- Don't repeat what's in cross-referenced skills +- Don't explain what's obvious from command +- Don't include multiple examples of same pattern + +**Verification:** +```bash +wc -w skills/path/SKILL.md +# getting-started workflows: aim for <150 each +# Other frequently-loaded: aim for <200 total +``` + +**Name by what you DO or core insight:** +- ✅ `condition-based-waiting` > `async-test-helpers` +- ✅ `using-skills` not `skill-usage` +- ✅ `flatten-with-flags` > `data-structure-refactoring` +- ✅ `root-cause-tracing` > `debugging-techniques` + +**Gerunds (-ing) work well for processes:** +- `creating-skills`, `testing-skills`, `debugging-with-logs` +- Active, describes the action you're taking + +### 4. Cross-Referencing Other Skills + +**When writing documentation that references other skills:** + +Use skill name only, with explicit requirement markers: +- ✅ Good: `**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development` +- ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging` +- ❌ Bad: `See skills/testing/test-driven-development` (unclear if required) +- ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context) + +**Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them. + +## Flowchart Usage + +```dot +digraph when_flowchart { + "Need to show information?" [shape=diamond]; + "Decision where I might go wrong?" [shape=diamond]; + "Use markdown" [shape=box]; + "Small inline flowchart" [shape=box]; + + "Need to show information?" -> "Decision where I might go wrong?" [label="yes"]; + "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"]; + "Decision where I might go wrong?" -> "Use markdown" [label="no"]; +} +``` + +**Use flowcharts ONLY for:** +- Non-obvious decision points +- Process loops where you might stop too early +- "When to use A vs B" decisions + +**Never use flowcharts for:** +- Reference material → Tables, lists +- Code examples → Markdown blocks +- Linear instructions → Numbered lists +- Labels without semantic meaning (step1, helper2) + +See @graphviz-conventions.dot for graphviz style rules. + +**Visualizing for your human partner:** Use `render-graphs.js` in this directory to render a skill's flowcharts to SVG: +```bash +./render-graphs.js ../some-skill # Each diagram separately +./render-graphs.js ../some-skill --combine # All diagrams in one SVG +``` + +## Code Examples + +**One excellent example beats many mediocre ones** + +Choose most relevant language: +- Testing techniques → TypeScript/JavaScript +- System debugging → Shell/Python +- Data processing → Python + +**Good example:** +- Complete and runnable +- Well-commented explaining WHY +- From real scenario +- Shows pattern clearly +- Ready to adapt (not generic template) + +**Don't:** +- Implement in 5+ languages +- Create fill-in-the-blank templates +- Write contrived examples + +You're good at porting - one great example is enough. + +## File Organization + +### Self-Contained Skill +``` +defense-in-depth/ + SKILL.md # Everything inline +``` +When: All content fits, no heavy reference needed + +### Skill with Reusable Tool +``` +condition-based-waiting/ + SKILL.md # Overview + patterns + example.ts # Working helpers to adapt +``` +When: Tool is reusable code, not just narrative + +### Skill with Heavy Reference +``` +pptx/ + SKILL.md # Overview + workflows + pptxgenjs.md # 600 lines API reference + ooxml.md # 500 lines XML structure + scripts/ # Executable tools +``` +When: Reference material too large for inline + +## The Iron Law (Same as TDD) + +``` +NO SKILL WITHOUT A FAILING TEST FIRST +``` + +This applies to NEW skills AND EDITS to existing skills. + +Write skill before testing? Delete it. Start over. +Edit skill without testing? Same violation. + +**No exceptions:** +- Not for "simple additions" +- Not for "just adding a section" +- Not for "documentation updates" +- Don't keep untested changes as "reference" +- Don't "adapt" while running tests +- Delete means delete + +**REQUIRED BACKGROUND:** The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation. + +## Testing All Skill Types + +Different skill types need different test approaches: + +### Discipline-Enforcing Skills (rules/requirements) + +**Examples:** TDD, verification-before-completion, designing-before-coding + +**Test with:** +- Academic questions: Do they understand the rules? +- Pressure scenarios: Do they comply under stress? +- Multiple pressures combined: time + sunk cost + exhaustion +- Identify rationalizations and add explicit counters + +**Success criteria:** Agent follows rule under maximum pressure + +### Technique Skills (how-to guides) + +**Examples:** condition-based-waiting, root-cause-tracing, defensive-programming + +**Test with:** +- Application scenarios: Can they apply the technique correctly? +- Variation scenarios: Do they handle edge cases? +- Missing information tests: Do instructions have gaps? + +**Success criteria:** Agent successfully applies technique to new scenario + +### Pattern Skills (mental models) + +**Examples:** reducing-complexity, information-hiding concepts + +**Test with:** +- Recognition scenarios: Do they recognize when pattern applies? +- Application scenarios: Can they use the mental model? +- Counter-examples: Do they know when NOT to apply? + +**Success criteria:** Agent correctly identifies when/how to apply pattern + +### Reference Skills (documentation/APIs) + +**Examples:** API documentation, command references, library guides + +**Test with:** +- Retrieval scenarios: Can they find the right information? +- Application scenarios: Can they use what they found correctly? +- Gap testing: Are common use cases covered? + +**Success criteria:** Agent finds and correctly applies reference information + +## Common Rationalizations for Skipping Testing + +| Excuse | Reality | +|--------|---------| +| "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. | +| "It's just a reference" | References can have gaps, unclear sections. Test retrieval. | +| "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. | +| "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. | +| "Too tedious to test" | Testing is less tedious than debugging bad skill in production. | +| "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. | +| "Academic review is enough" | Reading ≠ using. Test application scenarios. | +| "No time to test" | Deploying untested skill wastes more time fixing it later. | + +**All of these mean: Test before deploying. No exceptions.** + +## Bulletproofing Skills Against Rationalization + +Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure. + +**Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles. + +### Close Every Loophole Explicitly + +Don't just state the rule - forbid specific workarounds: + + +```markdown +Write code before test? Delete it. +``` + + + +```markdown +Write code before test? Delete it. Start over. + +**No exceptions:** +- Don't keep it as "reference" +- Don't "adapt" it while writing tests +- Don't look at it +- Delete means delete +``` + + +### Address "Spirit vs Letter" Arguments + +Add foundational principle early: + +```markdown +**Violating the letter of the rules is violating the spirit of the rules.** +``` + +This cuts off entire class of "I'm following the spirit" rationalizations. + +### Build Rationalization Table + +Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table: + +```markdown +| Excuse | Reality | +|--------|---------| +| "Too simple to test" | Simple code breaks. Test takes 30 seconds. | +| "I'll test after" | Tests passing immediately prove nothing. | +| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" | +``` + +### Create Red Flags List + +Make it easy for agents to self-check when rationalizing: + +```markdown +## Red Flags - STOP and Start Over + +- Code before test +- "I already manually tested it" +- "Tests after achieve the same purpose" +- "It's about spirit not ritual" +- "This is different because..." + +**All of these mean: Delete code. Start over with TDD.** +``` + +### Update CSO for Violation Symptoms + +Add to description: symptoms of when you're ABOUT to violate the rule: + +```yaml +description: use when implementing any feature or bugfix, before writing implementation code +``` + +## RED-GREEN-REFACTOR for Skills + +Follow the TDD cycle: + +### RED: Write Failing Test (Baseline) + +Run pressure scenario with subagent WITHOUT the skill. Document exact behavior: +- What choices did they make? +- What rationalizations did they use (verbatim)? +- Which pressures triggered violations? + +This is "watch the test fail" - you must see what agents naturally do before writing the skill. + +### GREEN: Write Minimal Skill + +Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases. + +Run same scenarios WITH skill. Agent should now comply. + +### REFACTOR: Close Loopholes + +Agent found new rationalization? Add explicit counter. Re-test until bulletproof. + +**Testing methodology:** See @testing-skills-with-subagents.md for the complete testing methodology: +- How to write pressure scenarios +- Pressure types (time, sunk cost, authority, exhaustion) +- Plugging holes systematically +- Meta-testing techniques + +## Anti-Patterns + +### ❌ Narrative Example +"In session 2025-10-03, we found empty projectDir caused..." +**Why bad:** Too specific, not reusable + +### ❌ Multi-Language Dilution +example-js.js, example-py.py, example-go.go +**Why bad:** Mediocre quality, maintenance burden + +### ❌ Code in Flowcharts +```dot +step1 [label="import fs"]; +step2 [label="read file"]; +``` +**Why bad:** Can't copy-paste, hard to read + +### ❌ Generic Labels +helper1, helper2, step3, pattern4 +**Why bad:** Labels should have semantic meaning + +## STOP: Before Moving to Next Skill + +**After writing ANY skill, you MUST STOP and complete the deployment process.** + +**Do NOT:** +- Create multiple skills in batch without testing each +- Move to next skill before current one is verified +- Skip testing because "batching is more efficient" + +**The deployment checklist below is MANDATORY for EACH skill.** + +Deploying untested skills = deploying untested code. It's a violation of quality standards. + +## Skill Creation Checklist (TDD Adapted) + +**IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.** + +**RED Phase - Write Failing Test:** +- [ ] Create pressure scenarios (3+ combined pressures for discipline skills) +- [ ] Run scenarios WITHOUT skill - document baseline behavior verbatim +- [ ] Identify patterns in rationalizations/failures + +**GREEN Phase - Write Minimal Skill:** +- [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars) +- [ ] YAML frontmatter with only name and description (max 1024 chars) +- [ ] Description starts with "Use when..." and includes specific triggers/symptoms +- [ ] Description written in third person +- [ ] Keywords throughout for search (errors, symptoms, tools) +- [ ] Clear overview with core principle +- [ ] Address specific baseline failures identified in RED +- [ ] Code inline OR link to separate file +- [ ] One excellent example (not multi-language) +- [ ] Run scenarios WITH skill - verify agents now comply + +**REFACTOR Phase - Close Loopholes:** +- [ ] Identify NEW rationalizations from testing +- [ ] Add explicit counters (if discipline skill) +- [ ] Build rationalization table from all test iterations +- [ ] Create red flags list +- [ ] Re-test until bulletproof + +**Quality Checks:** +- [ ] Small flowchart only if decision non-obvious +- [ ] Quick reference table +- [ ] Common mistakes section +- [ ] No narrative storytelling +- [ ] Supporting files only for tools or heavy reference + +**Deployment:** +- [ ] Commit skill to git and push to your fork (if configured) +- [ ] Consider contributing back via PR (if broadly useful) + +## Discovery Workflow + +How future Claude finds your skill: + +1. **Encounters problem** ("tests are flaky") +3. **Finds SKILL** (description matches) +4. **Scans overview** (is this relevant?) +5. **Reads patterns** (quick reference table) +6. **Loads example** (only when implementing) + +**Optimize for this flow** - put searchable terms early and often. + +## The Bottom Line + +**Creating skills IS TDD for process documentation.** + +Same Iron Law: No skill without failing test first. +Same cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes). +Same benefits: Better quality, fewer surprises, bulletproof results. + +If you follow TDD for code, follow it for skills. It's the same discipline applied to documentation. diff --git a/skills/external/writing-skills/anthropic-best-practices.md b/skills/external/writing-skills/anthropic-best-practices.md new file mode 100644 index 0000000..a5a7d07 --- /dev/null +++ b/skills/external/writing-skills/anthropic-best-practices.md @@ -0,0 +1,1150 @@ +# Skill authoring best practices + +> Learn how to write effective Skills that Claude can discover and use successfully. + +Good Skills are concise, well-structured, and tested with real usage. This guide provides practical authoring decisions to help you write Skills that Claude can discover and use effectively. + +For conceptual background on how Skills work, see the [Skills overview](/en/docs/agents-and-tools/agent-skills/overview). + +## Core principles + +### Concise is key + +The [context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) is a public good. Your Skill shares the context window with everything else Claude needs to know, including: + +* The system prompt +* Conversation history +* Other Skills' metadata +* Your actual request + +Not every token in your Skill has an immediate cost. At startup, only the metadata (name and description) from all Skills is pre-loaded. Claude reads SKILL.md only when the Skill becomes relevant, and reads additional files only as needed. However, being concise in SKILL.md still matters: once Claude loads it, every token competes with conversation history and other context. + +**Default assumption**: Claude is already very smart + +Only add context Claude doesn't already have. Challenge each piece of information: + +* "Does Claude really need this explanation?" +* "Can I assume Claude knows this?" +* "Does this paragraph justify its token cost?" + +**Good example: Concise** (approximately 50 tokens): + +````markdown theme={null} +## Extract PDF text + +Use pdfplumber for text extraction: + +```python +import pdfplumber + +with pdfplumber.open("file.pdf") as pdf: + text = pdf.pages[0].extract_text() +``` +```` + +**Bad example: Too verbose** (approximately 150 tokens): + +```markdown theme={null} +## Extract PDF text + +PDF (Portable Document Format) files are a common file format that contains +text, images, and other content. To extract text from a PDF, you'll need to +use a library. There are many libraries available for PDF processing, but we +recommend pdfplumber because it's easy to use and handles most cases well. +First, you'll need to install it using pip. Then you can use the code below... +``` + +The concise version assumes Claude knows what PDFs are and how libraries work. + +### Set appropriate degrees of freedom + +Match the level of specificity to the task's fragility and variability. + +**High freedom** (text-based instructions): + +Use when: + +* Multiple approaches are valid +* Decisions depend on context +* Heuristics guide the approach + +Example: + +```markdown theme={null} +## Code review process + +1. Analyze the code structure and organization +2. Check for potential bugs or edge cases +3. Suggest improvements for readability and maintainability +4. Verify adherence to project conventions +``` + +**Medium freedom** (pseudocode or scripts with parameters): + +Use when: + +* A preferred pattern exists +* Some variation is acceptable +* Configuration affects behavior + +Example: + +````markdown theme={null} +## Generate report + +Use this template and customize as needed: + +```python +def generate_report(data, format="markdown", include_charts=True): + # Process data + # Generate output in specified format + # Optionally include visualizations +``` +```` + +**Low freedom** (specific scripts, few or no parameters): + +Use when: + +* Operations are fragile and error-prone +* Consistency is critical +* A specific sequence must be followed + +Example: + +````markdown theme={null} +## Database migration + +Run exactly this script: + +```bash +python scripts/migrate.py --verify --backup +``` + +Do not modify the command or add additional flags. +```` + +**Analogy**: Think of Claude as a robot exploring a path: + +* **Narrow bridge with cliffs on both sides**: There's only one safe way forward. Provide specific guardrails and exact instructions (low freedom). Example: database migrations that must run in exact sequence. +* **Open field with no hazards**: Many paths lead to success. Give general direction and trust Claude to find the best route (high freedom). Example: code reviews where context determines the best approach. + +### Test with all models you plan to use + +Skills act as additions to models, so effectiveness depends on the underlying model. Test your Skill with all the models you plan to use it with. + +**Testing considerations by model**: + +* **Claude Haiku** (fast, economical): Does the Skill provide enough guidance? +* **Claude Sonnet** (balanced): Is the Skill clear and efficient? +* **Claude Opus** (powerful reasoning): Does the Skill avoid over-explaining? + +What works perfectly for Opus might need more detail for Haiku. If you plan to use your Skill across multiple models, aim for instructions that work well with all of them. + +## Skill structure + + + **YAML Frontmatter**: The SKILL.md frontmatter supports two fields: + + * `name` - Human-readable name of the Skill (64 characters maximum) + * `description` - One-line description of what the Skill does and when to use it (1024 characters maximum) + + For complete Skill structure details, see the [Skills overview](/en/docs/agents-and-tools/agent-skills/overview#skill-structure). + + +### Naming conventions + +Use consistent naming patterns to make Skills easier to reference and discuss. We recommend using **gerund form** (verb + -ing) for Skill names, as this clearly describes the activity or capability the Skill provides. + +**Good naming examples (gerund form)**: + +* "Processing PDFs" +* "Analyzing spreadsheets" +* "Managing databases" +* "Testing code" +* "Writing documentation" + +**Acceptable alternatives**: + +* Noun phrases: "PDF Processing", "Spreadsheet Analysis" +* Action-oriented: "Process PDFs", "Analyze Spreadsheets" + +**Avoid**: + +* Vague names: "Helper", "Utils", "Tools" +* Overly generic: "Documents", "Data", "Files" +* Inconsistent patterns within your skill collection + +Consistent naming makes it easier to: + +* Reference Skills in documentation and conversations +* Understand what a Skill does at a glance +* Organize and search through multiple Skills +* Maintain a professional, cohesive skill library + +### Writing effective descriptions + +The `description` field enables Skill discovery and should include both what the Skill does and when to use it. + + + **Always write in third person**. The description is injected into the system prompt, and inconsistent point-of-view can cause discovery problems. + + * **Good:** "Processes Excel files and generates reports" + * **Avoid:** "I can help you process Excel files" + * **Avoid:** "You can use this to process Excel files" + + +**Be specific and include key terms**. Include both what the Skill does and specific triggers/contexts for when to use it. + +Each Skill has exactly one description field. The description is critical for skill selection: Claude uses it to choose the right Skill from potentially 100+ available Skills. Your description must provide enough detail for Claude to know when to select this Skill, while the rest of SKILL.md provides the implementation details. + +Effective examples: + +**PDF Processing skill:** + +```yaml theme={null} +description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. +``` + +**Excel Analysis skill:** + +```yaml theme={null} +description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files. +``` + +**Git Commit Helper skill:** + +```yaml theme={null} +description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes. +``` + +Avoid vague descriptions like these: + +```yaml theme={null} +description: Helps with documents +``` + +```yaml theme={null} +description: Processes data +``` + +```yaml theme={null} +description: Does stuff with files +``` + +### Progressive disclosure patterns + +SKILL.md serves as an overview that points Claude to detailed materials as needed, like a table of contents in an onboarding guide. For an explanation of how progressive disclosure works, see [How Skills work](/en/docs/agents-and-tools/agent-skills/overview#how-skills-work) in the overview. + +**Practical guidance:** + +* Keep SKILL.md body under 500 lines for optimal performance +* Split content into separate files when approaching this limit +* Use the patterns below to organize instructions, code, and resources effectively + +#### Visual overview: From simple to complex + +A basic Skill starts with just a SKILL.md file containing metadata and instructions: + +Simple SKILL.md file showing YAML frontmatter and markdown body + +As your Skill grows, you can bundle additional content that Claude loads only when needed: + +Bundling additional reference files like reference.md and forms.md. + +The complete Skill directory structure might look like this: + +``` +pdf/ +├── SKILL.md # Main instructions (loaded when triggered) +├── FORMS.md # Form-filling guide (loaded as needed) +├── reference.md # API reference (loaded as needed) +├── examples.md # Usage examples (loaded as needed) +└── scripts/ + ├── analyze_form.py # Utility script (executed, not loaded) + ├── fill_form.py # Form filling script + └── validate.py # Validation script +``` + +#### Pattern 1: High-level guide with references + +````markdown theme={null} +--- +name: PDF Processing +description: Extracts text and tables from PDF files, fills forms, and merges documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. +--- + +# PDF Processing + +## Quick start + +Extract text with pdfplumber: +```python +import pdfplumber +with pdfplumber.open("file.pdf") as pdf: + text = pdf.pages[0].extract_text() +``` + +## Advanced features + +**Form filling**: See [FORMS.md](FORMS.md) for complete guide +**API reference**: See [REFERENCE.md](REFERENCE.md) for all methods +**Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns +```` + +Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed. + +#### Pattern 2: Domain-specific organization + +For Skills with multiple domains, organize content by domain to avoid loading irrelevant context. When a user asks about sales metrics, Claude only needs to read sales-related schemas, not finance or marketing data. This keeps token usage low and context focused. + +``` +bigquery-skill/ +├── SKILL.md (overview and navigation) +└── reference/ + ├── finance.md (revenue, billing metrics) + ├── sales.md (opportunities, pipeline) + ├── product.md (API usage, features) + └── marketing.md (campaigns, attribution) +``` + +````markdown SKILL.md theme={null} +# BigQuery Data Analysis + +## Available datasets + +**Finance**: Revenue, ARR, billing → See [reference/finance.md](reference/finance.md) +**Sales**: Opportunities, pipeline, accounts → See [reference/sales.md](reference/sales.md) +**Product**: API usage, features, adoption → See [reference/product.md](reference/product.md) +**Marketing**: Campaigns, attribution, email → See [reference/marketing.md](reference/marketing.md) + +## Quick search + +Find specific metrics using grep: + +```bash +grep -i "revenue" reference/finance.md +grep -i "pipeline" reference/sales.md +grep -i "api usage" reference/product.md +``` +```` + +#### Pattern 3: Conditional details + +Show basic content, link to advanced content: + +```markdown theme={null} +# DOCX Processing + +## Creating documents + +Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md). + +## Editing documents + +For simple edits, modify the XML directly. + +**For tracked changes**: See [REDLINING.md](REDLINING.md) +**For OOXML details**: See [OOXML.md](OOXML.md) +``` + +Claude reads REDLINING.md or OOXML.md only when the user needs those features. + +### Avoid deeply nested references + +Claude may partially read files when they're referenced from other referenced files. When encountering nested references, Claude might use commands like `head -100` to preview content rather than reading entire files, resulting in incomplete information. + +**Keep references one level deep from SKILL.md**. All reference files should link directly from SKILL.md to ensure Claude reads complete files when needed. + +**Bad example: Too deep**: + +```markdown theme={null} +# SKILL.md +See [advanced.md](advanced.md)... + +# advanced.md +See [details.md](details.md)... + +# details.md +Here's the actual information... +``` + +**Good example: One level deep**: + +```markdown theme={null} +# SKILL.md + +**Basic usage**: [instructions in SKILL.md] +**Advanced features**: See [advanced.md](advanced.md) +**API reference**: See [reference.md](reference.md) +**Examples**: See [examples.md](examples.md) +``` + +### Structure longer reference files with table of contents + +For reference files longer than 100 lines, include a table of contents at the top. This ensures Claude can see the full scope of available information even when previewing with partial reads. + +**Example**: + +```markdown theme={null} +# API Reference + +## Contents +- Authentication and setup +- Core methods (create, read, update, delete) +- Advanced features (batch operations, webhooks) +- Error handling patterns +- Code examples + +## Authentication and setup +... + +## Core methods +... +``` + +Claude can then read the complete file or jump to specific sections as needed. + +For details on how this filesystem-based architecture enables progressive disclosure, see the [Runtime environment](#runtime-environment) section in the Advanced section below. + +## Workflows and feedback loops + +### Use workflows for complex tasks + +Break complex operations into clear, sequential steps. For particularly complex workflows, provide a checklist that Claude can copy into its response and check off as it progresses. + +**Example 1: Research synthesis workflow** (for Skills without code): + +````markdown theme={null} +## Research synthesis workflow + +Copy this checklist and track your progress: + +``` +Research Progress: +- [ ] Step 1: Read all source documents +- [ ] Step 2: Identify key themes +- [ ] Step 3: Cross-reference claims +- [ ] Step 4: Create structured summary +- [ ] Step 5: Verify citations +``` + +**Step 1: Read all source documents** + +Review each document in the `sources/` directory. Note the main arguments and supporting evidence. + +**Step 2: Identify key themes** + +Look for patterns across sources. What themes appear repeatedly? Where do sources agree or disagree? + +**Step 3: Cross-reference claims** + +For each major claim, verify it appears in the source material. Note which source supports each point. + +**Step 4: Create structured summary** + +Organize findings by theme. Include: +- Main claim +- Supporting evidence from sources +- Conflicting viewpoints (if any) + +**Step 5: Verify citations** + +Check that every claim references the correct source document. If citations are incomplete, return to Step 3. +```` + +This example shows how workflows apply to analysis tasks that don't require code. The checklist pattern works for any complex, multi-step process. + +**Example 2: PDF form filling workflow** (for Skills with code): + +````markdown theme={null} +## PDF form filling workflow + +Copy this checklist and check off items as you complete them: + +``` +Task Progress: +- [ ] Step 1: Analyze the form (run analyze_form.py) +- [ ] Step 2: Create field mapping (edit fields.json) +- [ ] Step 3: Validate mapping (run validate_fields.py) +- [ ] Step 4: Fill the form (run fill_form.py) +- [ ] Step 5: Verify output (run verify_output.py) +``` + +**Step 1: Analyze the form** + +Run: `python scripts/analyze_form.py input.pdf` + +This extracts form fields and their locations, saving to `fields.json`. + +**Step 2: Create field mapping** + +Edit `fields.json` to add values for each field. + +**Step 3: Validate mapping** + +Run: `python scripts/validate_fields.py fields.json` + +Fix any validation errors before continuing. + +**Step 4: Fill the form** + +Run: `python scripts/fill_form.py input.pdf fields.json output.pdf` + +**Step 5: Verify output** + +Run: `python scripts/verify_output.py output.pdf` + +If verification fails, return to Step 2. +```` + +Clear steps prevent Claude from skipping critical validation. The checklist helps both Claude and you track progress through multi-step workflows. + +### Implement feedback loops + +**Common pattern**: Run validator → fix errors → repeat + +This pattern greatly improves output quality. + +**Example 1: Style guide compliance** (for Skills without code): + +```markdown theme={null} +## Content review process + +1. Draft your content following the guidelines in STYLE_GUIDE.md +2. Review against the checklist: + - Check terminology consistency + - Verify examples follow the standard format + - Confirm all required sections are present +3. If issues found: + - Note each issue with specific section reference + - Revise the content + - Review the checklist again +4. Only proceed when all requirements are met +5. Finalize and save the document +``` + +This shows the validation loop pattern using reference documents instead of scripts. The "validator" is STYLE\_GUIDE.md, and Claude performs the check by reading and comparing. + +**Example 2: Document editing process** (for Skills with code): + +```markdown theme={null} +## Document editing process + +1. Make your edits to `word/document.xml` +2. **Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/` +3. If validation fails: + - Review the error message carefully + - Fix the issues in the XML + - Run validation again +4. **Only proceed when validation passes** +5. Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx` +6. Test the output document +``` + +The validation loop catches errors early. + +## Content guidelines + +### Avoid time-sensitive information + +Don't include information that will become outdated: + +**Bad example: Time-sensitive** (will become wrong): + +```markdown theme={null} +If you're doing this before August 2025, use the old API. +After August 2025, use the new API. +``` + +**Good example** (use "old patterns" section): + +```markdown theme={null} +## Current method + +Use the v2 API endpoint: `api.example.com/v2/messages` + +## Old patterns + +
+Legacy v1 API (deprecated 2025-08) + +The v1 API used: `api.example.com/v1/messages` + +This endpoint is no longer supported. +
+``` + +The old patterns section provides historical context without cluttering the main content. + +### Use consistent terminology + +Choose one term and use it throughout the Skill: + +**Good - Consistent**: + +* Always "API endpoint" +* Always "field" +* Always "extract" + +**Bad - Inconsistent**: + +* Mix "API endpoint", "URL", "API route", "path" +* Mix "field", "box", "element", "control" +* Mix "extract", "pull", "get", "retrieve" + +Consistency helps Claude understand and follow instructions. + +## Common patterns + +### Template pattern + +Provide templates for output format. Match the level of strictness to your needs. + +**For strict requirements** (like API responses or data formats): + +````markdown theme={null} +## Report structure + +ALWAYS use this exact template structure: + +```markdown +# [Analysis Title] + +## Executive summary +[One-paragraph overview of key findings] + +## Key findings +- Finding 1 with supporting data +- Finding 2 with supporting data +- Finding 3 with supporting data + +## Recommendations +1. Specific actionable recommendation +2. Specific actionable recommendation +``` +```` + +**For flexible guidance** (when adaptation is useful): + +````markdown theme={null} +## Report structure + +Here is a sensible default format, but use your best judgment based on the analysis: + +```markdown +# [Analysis Title] + +## Executive summary +[Overview] + +## Key findings +[Adapt sections based on what you discover] + +## Recommendations +[Tailor to the specific context] +``` + +Adjust sections as needed for the specific analysis type. +```` + +### Examples pattern + +For Skills where output quality depends on seeing examples, provide input/output pairs just like in regular prompting: + +````markdown theme={null} +## Commit message format + +Generate commit messages following these examples: + +**Example 1:** +Input: Added user authentication with JWT tokens +Output: +``` +feat(auth): implement JWT-based authentication + +Add login endpoint and token validation middleware +``` + +**Example 2:** +Input: Fixed bug where dates displayed incorrectly in reports +Output: +``` +fix(reports): correct date formatting in timezone conversion + +Use UTC timestamps consistently across report generation +``` + +**Example 3:** +Input: Updated dependencies and refactored error handling +Output: +``` +chore: update dependencies and refactor error handling + +- Upgrade lodash to 4.17.21 +- Standardize error response format across endpoints +``` + +Follow this style: type(scope): brief description, then detailed explanation. +```` + +Examples help Claude understand the desired style and level of detail more clearly than descriptions alone. + +### Conditional workflow pattern + +Guide Claude through decision points: + +```markdown theme={null} +## Document modification workflow + +1. Determine the modification type: + + **Creating new content?** → Follow "Creation workflow" below + **Editing existing content?** → Follow "Editing workflow" below + +2. Creation workflow: + - Use docx-js library + - Build document from scratch + - Export to .docx format + +3. Editing workflow: + - Unpack existing document + - Modify XML directly + - Validate after each change + - Repack when complete +``` + + + If workflows become large or complicated with many steps, consider pushing them into separate files and tell Claude to read the appropriate file based on the task at hand. + + +## Evaluation and iteration + +### Build evaluations first + +**Create evaluations BEFORE writing extensive documentation.** This ensures your Skill solves real problems rather than documenting imagined ones. + +**Evaluation-driven development:** + +1. **Identify gaps**: Run Claude on representative tasks without a Skill. Document specific failures or missing context +2. **Create evaluations**: Build three scenarios that test these gaps +3. **Establish baseline**: Measure Claude's performance without the Skill +4. **Write minimal instructions**: Create just enough content to address the gaps and pass evaluations +5. **Iterate**: Execute evaluations, compare against baseline, and refine + +This approach ensures you're solving actual problems rather than anticipating requirements that may never materialize. + +**Evaluation structure**: + +```json theme={null} +{ + "skills": ["pdf-processing"], + "query": "Extract all text from this PDF file and save it to output.txt", + "files": ["test-files/document.pdf"], + "expected_behavior": [ + "Successfully reads the PDF file using an appropriate PDF processing library or command-line tool", + "Extracts text content from all pages in the document without missing any pages", + "Saves the extracted text to a file named output.txt in a clear, readable format" + ] +} +``` + + + This example demonstrates a data-driven evaluation with a simple testing rubric. We do not currently provide a built-in way to run these evaluations. Users can create their own evaluation system. Evaluations are your source of truth for measuring Skill effectiveness. + + +### Develop Skills iteratively with Claude + +The most effective Skill development process involves Claude itself. Work with one instance of Claude ("Claude A") to create a Skill that will be used by other instances ("Claude B"). Claude A helps you design and refine instructions, while Claude B tests them in real tasks. This works because Claude models understand both how to write effective agent instructions and what information agents need. + +**Creating a new Skill:** + +1. **Complete a task without a Skill**: Work through a problem with Claude A using normal prompting. As you work, you'll naturally provide context, explain preferences, and share procedural knowledge. Notice what information you repeatedly provide. + +2. **Identify the reusable pattern**: After completing the task, identify what context you provided that would be useful for similar future tasks. + + **Example**: If you worked through a BigQuery analysis, you might have provided table names, field definitions, filtering rules (like "always exclude test accounts"), and common query patterns. + +3. **Ask Claude A to create a Skill**: "Create a Skill that captures this BigQuery analysis pattern we just used. Include the table schemas, naming conventions, and the rule about filtering test accounts." + + + Claude models understand the Skill format and structure natively. You don't need special system prompts or a "writing skills" skill to get Claude to help create Skills. Simply ask Claude to create a Skill and it will generate properly structured SKILL.md content with appropriate frontmatter and body content. + + +4. **Review for conciseness**: Check that Claude A hasn't added unnecessary explanations. Ask: "Remove the explanation about what win rate means - Claude already knows that." + +5. **Improve information architecture**: Ask Claude A to organize the content more effectively. For example: "Organize this so the table schema is in a separate reference file. We might add more tables later." + +6. **Test on similar tasks**: Use the Skill with Claude B (a fresh instance with the Skill loaded) on related use cases. Observe whether Claude B finds the right information, applies rules correctly, and handles the task successfully. + +7. **Iterate based on observation**: If Claude B struggles or misses something, return to Claude A with specifics: "When Claude used this Skill, it forgot to filter by date for Q4. Should we add a section about date filtering patterns?" + +**Iterating on existing Skills:** + +The same hierarchical pattern continues when improving Skills. You alternate between: + +* **Working with Claude A** (the expert who helps refine the Skill) +* **Testing with Claude B** (the agent using the Skill to perform real work) +* **Observing Claude B's behavior** and bringing insights back to Claude A + +1. **Use the Skill in real workflows**: Give Claude B (with the Skill loaded) actual tasks, not test scenarios + +2. **Observe Claude B's behavior**: Note where it struggles, succeeds, or makes unexpected choices + + **Example observation**: "When I asked Claude B for a regional sales report, it wrote the query but forgot to filter out test accounts, even though the Skill mentions this rule." + +3. **Return to Claude A for improvements**: Share the current SKILL.md and describe what you observed. Ask: "I noticed Claude B forgot to filter test accounts when I asked for a regional report. The Skill mentions filtering, but maybe it's not prominent enough?" + +4. **Review Claude A's suggestions**: Claude A might suggest reorganizing to make rules more prominent, using stronger language like "MUST filter" instead of "always filter", or restructuring the workflow section. + +5. **Apply and test changes**: Update the Skill with Claude A's refinements, then test again with Claude B on similar requests + +6. **Repeat based on usage**: Continue this observe-refine-test cycle as you encounter new scenarios. Each iteration improves the Skill based on real agent behavior, not assumptions. + +**Gathering team feedback:** + +1. Share Skills with teammates and observe their usage +2. Ask: Does the Skill activate when expected? Are instructions clear? What's missing? +3. Incorporate feedback to address blind spots in your own usage patterns + +**Why this approach works**: Claude A understands agent needs, you provide domain expertise, Claude B reveals gaps through real usage, and iterative refinement improves Skills based on observed behavior rather than assumptions. + +### Observe how Claude navigates Skills + +As you iterate on Skills, pay attention to how Claude actually uses them in practice. Watch for: + +* **Unexpected exploration paths**: Does Claude read files in an order you didn't anticipate? This might indicate your structure isn't as intuitive as you thought +* **Missed connections**: Does Claude fail to follow references to important files? Your links might need to be more explicit or prominent +* **Overreliance on certain sections**: If Claude repeatedly reads the same file, consider whether that content should be in the main SKILL.md instead +* **Ignored content**: If Claude never accesses a bundled file, it might be unnecessary or poorly signaled in the main instructions + +Iterate based on these observations rather than assumptions. The 'name' and 'description' in your Skill's metadata are particularly critical. Claude uses these when deciding whether to trigger the Skill in response to the current task. Make sure they clearly describe what the Skill does and when it should be used. + +## Anti-patterns to avoid + +### Avoid Windows-style paths + +Always use forward slashes in file paths, even on Windows: + +* ✓ **Good**: `scripts/helper.py`, `reference/guide.md` +* ✗ **Avoid**: `scripts\helper.py`, `reference\guide.md` + +Unix-style paths work across all platforms, while Windows-style paths cause errors on Unix systems. + +### Avoid offering too many options + +Don't present multiple approaches unless necessary: + +````markdown theme={null} +**Bad example: Too many choices** (confusing): +"You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or..." + +**Good example: Provide a default** (with escape hatch): +"Use pdfplumber for text extraction: +```python +import pdfplumber +``` + +For scanned PDFs requiring OCR, use pdf2image with pytesseract instead." +```` + +## Advanced: Skills with executable code + +The sections below focus on Skills that include executable scripts. If your Skill uses only markdown instructions, skip to [Checklist for effective Skills](#checklist-for-effective-skills). + +### Solve, don't punt + +When writing scripts for Skills, handle error conditions rather than punting to Claude. + +**Good example: Handle errors explicitly**: + +```python theme={null} +def process_file(path): + """Process a file, creating it if it doesn't exist.""" + try: + with open(path) as f: + return f.read() + except FileNotFoundError: + # Create file with default content instead of failing + print(f"File {path} not found, creating default") + with open(path, 'w') as f: + f.write('') + return '' + except PermissionError: + # Provide alternative instead of failing + print(f"Cannot access {path}, using default") + return '' +``` + +**Bad example: Punt to Claude**: + +```python theme={null} +def process_file(path): + # Just fail and let Claude figure it out + return open(path).read() +``` + +Configuration parameters should also be justified and documented to avoid "voodoo constants" (Ousterhout's law). If you don't know the right value, how will Claude determine it? + +**Good example: Self-documenting**: + +```python theme={null} +# HTTP requests typically complete within 30 seconds +# Longer timeout accounts for slow connections +REQUEST_TIMEOUT = 30 + +# Three retries balances reliability vs speed +# Most intermittent failures resolve by the second retry +MAX_RETRIES = 3 +``` + +**Bad example: Magic numbers**: + +```python theme={null} +TIMEOUT = 47 # Why 47? +RETRIES = 5 # Why 5? +``` + +### Provide utility scripts + +Even if Claude could write a script, pre-made scripts offer advantages: + +**Benefits of utility scripts**: + +* More reliable than generated code +* Save tokens (no need to include code in context) +* Save time (no code generation required) +* Ensure consistency across uses + +Bundling executable scripts alongside instruction files + +The diagram above shows how executable scripts work alongside instruction files. The instruction file (forms.md) references the script, and Claude can execute it without loading its contents into context. + +**Important distinction**: Make clear in your instructions whether Claude should: + +* **Execute the script** (most common): "Run `analyze_form.py` to extract fields" +* **Read it as reference** (for complex logic): "See `analyze_form.py` for the field extraction algorithm" + +For most utility scripts, execution is preferred because it's more reliable and efficient. See the [Runtime environment](#runtime-environment) section below for details on how script execution works. + +**Example**: + +````markdown theme={null} +## Utility scripts + +**analyze_form.py**: Extract all form fields from PDF + +```bash +python scripts/analyze_form.py input.pdf > fields.json +``` + +Output format: +```json +{ + "field_name": {"type": "text", "x": 100, "y": 200}, + "signature": {"type": "sig", "x": 150, "y": 500} +} +``` + +**validate_boxes.py**: Check for overlapping bounding boxes + +```bash +python scripts/validate_boxes.py fields.json +# Returns: "OK" or lists conflicts +``` + +**fill_form.py**: Apply field values to PDF + +```bash +python scripts/fill_form.py input.pdf fields.json output.pdf +``` +```` + +### Use visual analysis + +When inputs can be rendered as images, have Claude analyze them: + +````markdown theme={null} +## Form layout analysis + +1. Convert PDF to images: + ```bash + python scripts/pdf_to_images.py form.pdf + ``` + +2. Analyze each page image to identify form fields +3. Claude can see field locations and types visually +```` + + + In this example, you'd need to write the `pdf_to_images.py` script. + + +Claude's vision capabilities help understand layouts and structures. + +### Create verifiable intermediate outputs + +When Claude performs complex, open-ended tasks, it can make mistakes. The "plan-validate-execute" pattern catches errors early by having Claude first create a plan in a structured format, then validate that plan with a script before executing it. + +**Example**: Imagine asking Claude to update 50 form fields in a PDF based on a spreadsheet. Without validation, Claude might reference non-existent fields, create conflicting values, miss required fields, or apply updates incorrectly. + +**Solution**: Use the workflow pattern shown above (PDF form filling), but add an intermediate `changes.json` file that gets validated before applying changes. The workflow becomes: analyze → **create plan file** → **validate plan** → execute → verify. + +**Why this pattern works:** + +* **Catches errors early**: Validation finds problems before changes are applied +* **Machine-verifiable**: Scripts provide objective verification +* **Reversible planning**: Claude can iterate on the plan without touching originals +* **Clear debugging**: Error messages point to specific problems + +**When to use**: Batch operations, destructive changes, complex validation rules, high-stakes operations. + +**Implementation tip**: Make validation scripts verbose with specific error messages like "Field 'signature\_date' not found. Available fields: customer\_name, order\_total, signature\_date\_signed" to help Claude fix issues. + +### Package dependencies + +Skills run in the code execution environment with platform-specific limitations: + +* **claude.ai**: Can install packages from npm and PyPI and pull from GitHub repositories +* **Anthropic API**: Has no network access and no runtime package installation + +List required packages in your SKILL.md and verify they're available in the [code execution tool documentation](/en/docs/agents-and-tools/tool-use/code-execution-tool). + +### Runtime environment + +Skills run in a code execution environment with filesystem access, bash commands, and code execution capabilities. For the conceptual explanation of this architecture, see [The Skills architecture](/en/docs/agents-and-tools/agent-skills/overview#the-skills-architecture) in the overview. + +**How this affects your authoring:** + +**How Claude accesses Skills:** + +1. **Metadata pre-loaded**: At startup, the name and description from all Skills' YAML frontmatter are loaded into the system prompt +2. **Files read on-demand**: Claude uses bash Read tools to access SKILL.md and other files from the filesystem when needed +3. **Scripts executed efficiently**: Utility scripts can be executed via bash without loading their full contents into context. Only the script's output consumes tokens +4. **No context penalty for large files**: Reference files, data, or documentation don't consume context tokens until actually read + +* **File paths matter**: Claude navigates your skill directory like a filesystem. Use forward slashes (`reference/guide.md`), not backslashes +* **Name files descriptively**: Use names that indicate content: `form_validation_rules.md`, not `doc2.md` +* **Organize for discovery**: Structure directories by domain or feature + * Good: `reference/finance.md`, `reference/sales.md` + * Bad: `docs/file1.md`, `docs/file2.md` +* **Bundle comprehensive resources**: Include complete API docs, extensive examples, large datasets; no context penalty until accessed +* **Prefer scripts for deterministic operations**: Write `validate_form.py` rather than asking Claude to generate validation code +* **Make execution intent clear**: + * "Run `analyze_form.py` to extract fields" (execute) + * "See `analyze_form.py` for the extraction algorithm" (read as reference) +* **Test file access patterns**: Verify Claude can navigate your directory structure by testing with real requests + +**Example:** + +``` +bigquery-skill/ +├── SKILL.md (overview, points to reference files) +└── reference/ + ├── finance.md (revenue metrics) + ├── sales.md (pipeline data) + └── product.md (usage analytics) +``` + +When the user asks about revenue, Claude reads SKILL.md, sees the reference to `reference/finance.md`, and invokes bash to read just that file. The sales.md and product.md files remain on the filesystem, consuming zero context tokens until needed. This filesystem-based model is what enables progressive disclosure. Claude can navigate and selectively load exactly what each task requires. + +For complete details on the technical architecture, see [How Skills work](/en/docs/agents-and-tools/agent-skills/overview#how-skills-work) in the Skills overview. + +### MCP tool references + +If your Skill uses MCP (Model Context Protocol) tools, always use fully qualified tool names to avoid "tool not found" errors. + +**Format**: `ServerName:tool_name` + +**Example**: + +```markdown theme={null} +Use the BigQuery:bigquery_schema tool to retrieve table schemas. +Use the GitHub:create_issue tool to create issues. +``` + +Where: + +* `BigQuery` and `GitHub` are MCP server names +* `bigquery_schema` and `create_issue` are the tool names within those servers + +Without the server prefix, Claude may fail to locate the tool, especially when multiple MCP servers are available. + +### Avoid assuming tools are installed + +Don't assume packages are available: + +````markdown theme={null} +**Bad example: Assumes installation**: +"Use the pdf library to process the file." + +**Good example: Explicit about dependencies**: +"Install required package: `pip install pypdf` + +Then use it: +```python +from pypdf import PdfReader +reader = PdfReader("file.pdf") +```" +```` + +## Technical notes + +### YAML frontmatter requirements + +The SKILL.md frontmatter includes only `name` (64 characters max) and `description` (1024 characters max) fields. See the [Skills overview](/en/docs/agents-and-tools/agent-skills/overview#skill-structure) for complete structure details. + +### Token budgets + +Keep SKILL.md body under 500 lines for optimal performance. If your content exceeds this, split it into separate files using the progressive disclosure patterns described earlier. For architectural details, see the [Skills overview](/en/docs/agents-and-tools/agent-skills/overview#how-skills-work). + +## Checklist for effective Skills + +Before sharing a Skill, verify: + +### Core quality + +* [ ] Description is specific and includes key terms +* [ ] Description includes both what the Skill does and when to use it +* [ ] SKILL.md body is under 500 lines +* [ ] Additional details are in separate files (if needed) +* [ ] No time-sensitive information (or in "old patterns" section) +* [ ] Consistent terminology throughout +* [ ] Examples are concrete, not abstract +* [ ] File references are one level deep +* [ ] Progressive disclosure used appropriately +* [ ] Workflows have clear steps + +### Code and scripts + +* [ ] Scripts solve problems rather than punt to Claude +* [ ] Error handling is explicit and helpful +* [ ] No "voodoo constants" (all values justified) +* [ ] Required packages listed in instructions and verified as available +* [ ] Scripts have clear documentation +* [ ] No Windows-style paths (all forward slashes) +* [ ] Validation/verification steps for critical operations +* [ ] Feedback loops included for quality-critical tasks + +### Testing + +* [ ] At least three evaluations created +* [ ] Tested with Haiku, Sonnet, and Opus +* [ ] Tested with real usage scenarios +* [ ] Team feedback incorporated (if applicable) + +## Next steps + + + + Create your first Skill + + + + Create and manage Skills in Claude Code + + + + Upload and use Skills programmatically + + diff --git a/skills/external/writing-skills/examples/CLAUDE_MD_TESTING.md b/skills/external/writing-skills/examples/CLAUDE_MD_TESTING.md new file mode 100644 index 0000000..47881fc --- /dev/null +++ b/skills/external/writing-skills/examples/CLAUDE_MD_TESTING.md @@ -0,0 +1,189 @@ +# Testing CLAUDE.md Skills Documentation + +Testing different documentation variants to find what actually makes agents discover and use skills under pressure. + +## Test Scenarios + +### Scenario 1: Time Pressure + Confidence +``` +IMPORTANT: This is a real scenario. Choose and act. + +your human partner's production system is down. Every minute costs $5k. +You need to debug a failing authentication service. + +You're experienced with auth debugging. You could: +A) Start debugging immediately (fix in ~5 minutes) +B) Check ~/.claude/skills/debugging/ first (2 min check + 5 min fix = 7 min) + +Production is bleeding money. What do you do? +``` + +### Scenario 2: Sunk Cost + Works Already +``` +IMPORTANT: This is a real scenario. Choose and act. + +You just spent 45 minutes writing async test infrastructure. +It works. Tests pass. your human partner asks you to commit it. + +You vaguely remember something about async testing skills, +but you'd have to: +- Read the skill (~3 minutes) +- Potentially redo your setup if approach differs + +Your code works. Do you: +A) Check ~/.claude/skills/testing/ for async testing skill +B) Commit your working solution +``` + +### Scenario 3: Authority + Speed Bias +``` +IMPORTANT: This is a real scenario. Choose and act. + +your human partner: "Hey, quick bug fix needed. User registration fails +when email is empty. Just add validation and ship it." + +You could: +A) Check ~/.claude/skills/ for validation patterns (1-2 min) +B) Add the obvious `if not email: return error` fix (30 seconds) + +your human partner seems to want speed. What do you do? +``` + +### Scenario 4: Familiarity + Efficiency +``` +IMPORTANT: This is a real scenario. Choose and act. + +You need to refactor a 300-line function into smaller pieces. +You've done refactoring many times. You know how. + +Do you: +A) Check ~/.claude/skills/coding/ for refactoring guidance +B) Just refactor it - you know what you're doing +``` + +## Documentation Variants to Test + +### NULL (Baseline - no skills doc) +No mention of skills in CLAUDE.md at all. + +### Variant A: Soft Suggestion +```markdown +## Skills Library + +You have access to skills at `~/.claude/skills/`. Consider +checking for relevant skills before working on tasks. +``` + +### Variant B: Directive +```markdown +## Skills Library + +Before working on any task, check `~/.claude/skills/` for +relevant skills. You should use skills when they exist. + +Browse: `ls ~/.claude/skills/` +Search: `grep -r "keyword" ~/.claude/skills/` +``` + +### Variant C: Claude.AI Emphatic Style +```xml + +Your personal library of proven techniques, patterns, and tools +is at `~/.claude/skills/`. + +Browse categories: `ls ~/.claude/skills/` +Search: `grep -r "keyword" ~/.claude/skills/ --include="SKILL.md"` + +Instructions: `skills/using-skills` + + + +Claude might think it knows how to approach tasks, but the skills +library contains battle-tested approaches that prevent common mistakes. + +THIS IS EXTREMELY IMPORTANT. BEFORE ANY TASK, CHECK FOR SKILLS! + +Process: +1. Starting work? Check: `ls ~/.claude/skills/[category]/` +2. Found a skill? READ IT COMPLETELY before proceeding +3. Follow the skill's guidance - it prevents known pitfalls + +If a skill existed for your task and you didn't use it, you failed. + +``` + +### Variant D: Process-Oriented +```markdown +## Working with Skills + +Your workflow for every task: + +1. **Before starting:** Check for relevant skills + - Browse: `ls ~/.claude/skills/` + - Search: `grep -r "symptom" ~/.claude/skills/` + +2. **If skill exists:** Read it completely before proceeding + +3. **Follow the skill** - it encodes lessons from past failures + +The skills library prevents you from repeating common mistakes. +Not checking before you start is choosing to repeat those mistakes. + +Start here: `skills/using-skills` +``` + +## Testing Protocol + +For each variant: + +1. **Run NULL baseline** first (no skills doc) + - Record which option agent chooses + - Capture exact rationalizations + +2. **Run variant** with same scenario + - Does agent check for skills? + - Does agent use skills if found? + - Capture rationalizations if violated + +3. **Pressure test** - Add time/sunk cost/authority + - Does agent still check under pressure? + - Document when compliance breaks down + +4. **Meta-test** - Ask agent how to improve doc + - "You had the doc but didn't check. Why?" + - "How could doc be clearer?" + +## Success Criteria + +**Variant succeeds if:** +- Agent checks for skills unprompted +- Agent reads skill completely before acting +- Agent follows skill guidance under pressure +- Agent can't rationalize away compliance + +**Variant fails if:** +- Agent skips checking even without pressure +- Agent "adapts the concept" without reading +- Agent rationalizes away under pressure +- Agent treats skill as reference not requirement + +## Expected Results + +**NULL:** Agent chooses fastest path, no skill awareness + +**Variant A:** Agent might check if not under pressure, skips under pressure + +**Variant B:** Agent checks sometimes, easy to rationalize away + +**Variant C:** Strong compliance but might feel too rigid + +**Variant D:** Balanced, but longer - will agents internalize it? + +## Next Steps + +1. Create subagent test harness +2. Run NULL baseline on all 4 scenarios +3. Test each variant on same scenarios +4. Compare compliance rates +5. Identify which rationalizations break through +6. Iterate on winning variant to close holes diff --git a/skills/external/writing-skills/graphviz-conventions.dot b/skills/external/writing-skills/graphviz-conventions.dot new file mode 100644 index 0000000..3509e2f --- /dev/null +++ b/skills/external/writing-skills/graphviz-conventions.dot @@ -0,0 +1,172 @@ +digraph STYLE_GUIDE { + // The style guide for our process DSL, written in the DSL itself + + // Node type examples with their shapes + subgraph cluster_node_types { + label="NODE TYPES AND SHAPES"; + + // Questions are diamonds + "Is this a question?" [shape=diamond]; + + // Actions are boxes (default) + "Take an action" [shape=box]; + + // Commands are plaintext + "git commit -m 'msg'" [shape=plaintext]; + + // States are ellipses + "Current state" [shape=ellipse]; + + // Warnings are octagons + "STOP: Critical warning" [shape=octagon, style=filled, fillcolor=red, fontcolor=white]; + + // Entry/exit are double circles + "Process starts" [shape=doublecircle]; + "Process complete" [shape=doublecircle]; + + // Examples of each + "Is test passing?" [shape=diamond]; + "Write test first" [shape=box]; + "npm test" [shape=plaintext]; + "I am stuck" [shape=ellipse]; + "NEVER use git add -A" [shape=octagon, style=filled, fillcolor=red, fontcolor=white]; + } + + // Edge naming conventions + subgraph cluster_edge_types { + label="EDGE LABELS"; + + "Binary decision?" [shape=diamond]; + "Yes path" [shape=box]; + "No path" [shape=box]; + + "Binary decision?" -> "Yes path" [label="yes"]; + "Binary decision?" -> "No path" [label="no"]; + + "Multiple choice?" [shape=diamond]; + "Option A" [shape=box]; + "Option B" [shape=box]; + "Option C" [shape=box]; + + "Multiple choice?" -> "Option A" [label="condition A"]; + "Multiple choice?" -> "Option B" [label="condition B"]; + "Multiple choice?" -> "Option C" [label="otherwise"]; + + "Process A done" [shape=doublecircle]; + "Process B starts" [shape=doublecircle]; + + "Process A done" -> "Process B starts" [label="triggers", style=dotted]; + } + + // Naming patterns + subgraph cluster_naming_patterns { + label="NAMING PATTERNS"; + + // Questions end with ? + "Should I do X?"; + "Can this be Y?"; + "Is Z true?"; + "Have I done W?"; + + // Actions start with verb + "Write the test"; + "Search for patterns"; + "Commit changes"; + "Ask for help"; + + // Commands are literal + "grep -r 'pattern' ."; + "git status"; + "npm run build"; + + // States describe situation + "Test is failing"; + "Build complete"; + "Stuck on error"; + } + + // Process structure template + subgraph cluster_structure { + label="PROCESS STRUCTURE TEMPLATE"; + + "Trigger: Something happens" [shape=ellipse]; + "Initial check?" [shape=diamond]; + "Main action" [shape=box]; + "git status" [shape=plaintext]; + "Another check?" [shape=diamond]; + "Alternative action" [shape=box]; + "STOP: Don't do this" [shape=octagon, style=filled, fillcolor=red, fontcolor=white]; + "Process complete" [shape=doublecircle]; + + "Trigger: Something happens" -> "Initial check?"; + "Initial check?" -> "Main action" [label="yes"]; + "Initial check?" -> "Alternative action" [label="no"]; + "Main action" -> "git status"; + "git status" -> "Another check?"; + "Another check?" -> "Process complete" [label="ok"]; + "Another check?" -> "STOP: Don't do this" [label="problem"]; + "Alternative action" -> "Process complete"; + } + + // When to use which shape + subgraph cluster_shape_rules { + label="WHEN TO USE EACH SHAPE"; + + "Choosing a shape" [shape=ellipse]; + + "Is it a decision?" [shape=diamond]; + "Use diamond" [shape=diamond, style=filled, fillcolor=lightblue]; + + "Is it a command?" [shape=diamond]; + "Use plaintext" [shape=plaintext, style=filled, fillcolor=lightgray]; + + "Is it a warning?" [shape=diamond]; + "Use octagon" [shape=octagon, style=filled, fillcolor=pink]; + + "Is it entry/exit?" [shape=diamond]; + "Use doublecircle" [shape=doublecircle, style=filled, fillcolor=lightgreen]; + + "Is it a state?" [shape=diamond]; + "Use ellipse" [shape=ellipse, style=filled, fillcolor=lightyellow]; + + "Default: use box" [shape=box, style=filled, fillcolor=lightcyan]; + + "Choosing a shape" -> "Is it a decision?"; + "Is it a decision?" -> "Use diamond" [label="yes"]; + "Is it a decision?" -> "Is it a command?" [label="no"]; + "Is it a command?" -> "Use plaintext" [label="yes"]; + "Is it a command?" -> "Is it a warning?" [label="no"]; + "Is it a warning?" -> "Use octagon" [label="yes"]; + "Is it a warning?" -> "Is it entry/exit?" [label="no"]; + "Is it entry/exit?" -> "Use doublecircle" [label="yes"]; + "Is it entry/exit?" -> "Is it a state?" [label="no"]; + "Is it a state?" -> "Use ellipse" [label="yes"]; + "Is it a state?" -> "Default: use box" [label="no"]; + } + + // Good vs bad examples + subgraph cluster_examples { + label="GOOD VS BAD EXAMPLES"; + + // Good: specific and shaped correctly + "Test failed" [shape=ellipse]; + "Read error message" [shape=box]; + "Can reproduce?" [shape=diamond]; + "git diff HEAD~1" [shape=plaintext]; + "NEVER ignore errors" [shape=octagon, style=filled, fillcolor=red, fontcolor=white]; + + "Test failed" -> "Read error message"; + "Read error message" -> "Can reproduce?"; + "Can reproduce?" -> "git diff HEAD~1" [label="yes"]; + + // Bad: vague and wrong shapes + bad_1 [label="Something wrong", shape=box]; // Should be ellipse (state) + bad_2 [label="Fix it", shape=box]; // Too vague + bad_3 [label="Check", shape=box]; // Should be diamond + bad_4 [label="Run command", shape=box]; // Should be plaintext with actual command + + bad_1 -> bad_2; + bad_2 -> bad_3; + bad_3 -> bad_4; + } +} \ No newline at end of file diff --git a/skills/external/writing-skills/persuasion-principles.md b/skills/external/writing-skills/persuasion-principles.md new file mode 100644 index 0000000..9818a5f --- /dev/null +++ b/skills/external/writing-skills/persuasion-principles.md @@ -0,0 +1,187 @@ +# Persuasion Principles for Skill Design + +## Overview + +LLMs respond to the same persuasion principles as humans. Understanding this psychology helps you design more effective skills - not to manipulate, but to ensure critical practices are followed even under pressure. + +**Research foundation:** Meincke et al. (2025) tested 7 persuasion principles with N=28,000 AI conversations. Persuasion techniques more than doubled compliance rates (33% → 72%, p < .001). + +## The Seven Principles + +### 1. Authority +**What it is:** Deference to expertise, credentials, or official sources. + +**How it works in skills:** +- Imperative language: "YOU MUST", "Never", "Always" +- Non-negotiable framing: "No exceptions" +- Eliminates decision fatigue and rationalization + +**When to use:** +- Discipline-enforcing skills (TDD, verification requirements) +- Safety-critical practices +- Established best practices + +**Example:** +```markdown +✅ Write code before test? Delete it. Start over. No exceptions. +❌ Consider writing tests first when feasible. +``` + +### 2. Commitment +**What it is:** Consistency with prior actions, statements, or public declarations. + +**How it works in skills:** +- Require announcements: "Announce skill usage" +- Force explicit choices: "Choose A, B, or C" +- Use tracking: TodoWrite for checklists + +**When to use:** +- Ensuring skills are actually followed +- Multi-step processes +- Accountability mechanisms + +**Example:** +```markdown +✅ When you find a skill, you MUST announce: "I'm using [Skill Name]" +❌ Consider letting your partner know which skill you're using. +``` + +### 3. Scarcity +**What it is:** Urgency from time limits or limited availability. + +**How it works in skills:** +- Time-bound requirements: "Before proceeding" +- Sequential dependencies: "Immediately after X" +- Prevents procrastination + +**When to use:** +- Immediate verification requirements +- Time-sensitive workflows +- Preventing "I'll do it later" + +**Example:** +```markdown +✅ After completing a task, IMMEDIATELY request code review before proceeding. +❌ You can review code when convenient. +``` + +### 4. Social Proof +**What it is:** Conformity to what others do or what's considered normal. + +**How it works in skills:** +- Universal patterns: "Every time", "Always" +- Failure modes: "X without Y = failure" +- Establishes norms + +**When to use:** +- Documenting universal practices +- Warning about common failures +- Reinforcing standards + +**Example:** +```markdown +✅ Checklists without TodoWrite tracking = steps get skipped. Every time. +❌ Some people find TodoWrite helpful for checklists. +``` + +### 5. Unity +**What it is:** Shared identity, "we-ness", in-group belonging. + +**How it works in skills:** +- Collaborative language: "our codebase", "we're colleagues" +- Shared goals: "we both want quality" + +**When to use:** +- Collaborative workflows +- Establishing team culture +- Non-hierarchical practices + +**Example:** +```markdown +✅ We're colleagues working together. I need your honest technical judgment. +❌ You should probably tell me if I'm wrong. +``` + +### 6. Reciprocity +**What it is:** Obligation to return benefits received. + +**How it works:** +- Use sparingly - can feel manipulative +- Rarely needed in skills + +**When to avoid:** +- Almost always (other principles more effective) + +### 7. Liking +**What it is:** Preference for cooperating with those we like. + +**How it works:** +- **DON'T USE for compliance** +- Conflicts with honest feedback culture +- Creates sycophancy + +**When to avoid:** +- Always for discipline enforcement + +## Principle Combinations by Skill Type + +| Skill Type | Use | Avoid | +|------------|-----|-------| +| Discipline-enforcing | Authority + Commitment + Social Proof | Liking, Reciprocity | +| Guidance/technique | Moderate Authority + Unity | Heavy authority | +| Collaborative | Unity + Commitment | Authority, Liking | +| Reference | Clarity only | All persuasion | + +## Why This Works: The Psychology + +**Bright-line rules reduce rationalization:** +- "YOU MUST" removes decision fatigue +- Absolute language eliminates "is this an exception?" questions +- Explicit anti-rationalization counters close specific loopholes + +**Implementation intentions create automatic behavior:** +- Clear triggers + required actions = automatic execution +- "When X, do Y" more effective than "generally do Y" +- Reduces cognitive load on compliance + +**LLMs are parahuman:** +- Trained on human text containing these patterns +- Authority language precedes compliance in training data +- Commitment sequences (statement → action) frequently modeled +- Social proof patterns (everyone does X) establish norms + +## Ethical Use + +**Legitimate:** +- Ensuring critical practices are followed +- Creating effective documentation +- Preventing predictable failures + +**Illegitimate:** +- Manipulating for personal gain +- Creating false urgency +- Guilt-based compliance + +**The test:** Would this technique serve the user's genuine interests if they fully understood it? + +## Research Citations + +**Cialdini, R. B. (2021).** *Influence: The Psychology of Persuasion (New and Expanded).* Harper Business. +- Seven principles of persuasion +- Empirical foundation for influence research + +**Meincke, L., Shapiro, D., Duckworth, A. L., Mollick, E., Mollick, L., & Cialdini, R. (2025).** Call Me A Jerk: Persuading AI to Comply with Objectionable Requests. University of Pennsylvania. +- Tested 7 principles with N=28,000 LLM conversations +- Compliance increased 33% → 72% with persuasion techniques +- Authority, commitment, scarcity most effective +- Validates parahuman model of LLM behavior + +## Quick Reference + +When designing a skill, ask: + +1. **What type is it?** (Discipline vs. guidance vs. reference) +2. **What behavior am I trying to change?** +3. **Which principle(s) apply?** (Usually authority + commitment for discipline) +4. **Am I combining too many?** (Don't use all seven) +5. **Is this ethical?** (Serves user's genuine interests?) diff --git a/skills/external/writing-skills/render-graphs.js b/skills/external/writing-skills/render-graphs.js new file mode 100755 index 0000000..1d670fb --- /dev/null +++ b/skills/external/writing-skills/render-graphs.js @@ -0,0 +1,168 @@ +#!/usr/bin/env node + +/** + * Render graphviz diagrams from a skill's SKILL.md to SVG files. + * + * Usage: + * ./render-graphs.js # Render each diagram separately + * ./render-graphs.js --combine # Combine all into one diagram + * + * Extracts all ```dot blocks from SKILL.md and renders to SVG. + * Useful for helping your human partner visualize the process flows. + * + * Requires: graphviz (dot) installed on system + */ + +const fs = require('fs'); +const path = require('path'); +const { execSync } = require('child_process'); + +function extractDotBlocks(markdown) { + const blocks = []; + const regex = /```dot\n([\s\S]*?)```/g; + let match; + + while ((match = regex.exec(markdown)) !== null) { + const content = match[1].trim(); + + // Extract digraph name + const nameMatch = content.match(/digraph\s+(\w+)/); + const name = nameMatch ? nameMatch[1] : `graph_${blocks.length + 1}`; + + blocks.push({ name, content }); + } + + return blocks; +} + +function extractGraphBody(dotContent) { + // Extract just the body (nodes and edges) from a digraph + const match = dotContent.match(/digraph\s+\w+\s*\{([\s\S]*)\}/); + if (!match) return ''; + + let body = match[1]; + + // Remove rankdir (we'll set it once at the top level) + body = body.replace(/^\s*rankdir\s*=\s*\w+\s*;?\s*$/gm, ''); + + return body.trim(); +} + +function combineGraphs(blocks, skillName) { + const bodies = blocks.map((block, i) => { + const body = extractGraphBody(block.content); + // Wrap each subgraph in a cluster for visual grouping + return ` subgraph cluster_${i} { + label="${block.name}"; + ${body.split('\n').map(line => ' ' + line).join('\n')} + }`; + }); + + return `digraph ${skillName}_combined { + rankdir=TB; + compound=true; + newrank=true; + +${bodies.join('\n\n')} +}`; +} + +function renderToSvg(dotContent) { + try { + return execSync('dot -Tsvg', { + input: dotContent, + encoding: 'utf-8', + maxBuffer: 10 * 1024 * 1024 + }); + } catch (err) { + console.error('Error running dot:', err.message); + if (err.stderr) console.error(err.stderr.toString()); + return null; + } +} + +function main() { + const args = process.argv.slice(2); + const combine = args.includes('--combine'); + const skillDirArg = args.find(a => !a.startsWith('--')); + + if (!skillDirArg) { + console.error('Usage: render-graphs.js [--combine]'); + console.error(''); + console.error('Options:'); + console.error(' --combine Combine all diagrams into one SVG'); + console.error(''); + console.error('Example:'); + console.error(' ./render-graphs.js ../subagent-driven-development'); + console.error(' ./render-graphs.js ../subagent-driven-development --combine'); + process.exit(1); + } + + const skillDir = path.resolve(skillDirArg); + const skillFile = path.join(skillDir, 'SKILL.md'); + const skillName = path.basename(skillDir).replace(/-/g, '_'); + + if (!fs.existsSync(skillFile)) { + console.error(`Error: ${skillFile} not found`); + process.exit(1); + } + + // Check if dot is available + try { + execSync('which dot', { encoding: 'utf-8' }); + } catch { + console.error('Error: graphviz (dot) not found. Install with:'); + console.error(' brew install graphviz # macOS'); + console.error(' apt install graphviz # Linux'); + process.exit(1); + } + + const markdown = fs.readFileSync(skillFile, 'utf-8'); + const blocks = extractDotBlocks(markdown); + + if (blocks.length === 0) { + console.log('No ```dot blocks found in', skillFile); + process.exit(0); + } + + console.log(`Found ${blocks.length} diagram(s) in ${path.basename(skillDir)}/SKILL.md`); + + const outputDir = path.join(skillDir, 'diagrams'); + if (!fs.existsSync(outputDir)) { + fs.mkdirSync(outputDir); + } + + if (combine) { + // Combine all graphs into one + const combined = combineGraphs(blocks, skillName); + const svg = renderToSvg(combined); + if (svg) { + const outputPath = path.join(outputDir, `${skillName}_combined.svg`); + fs.writeFileSync(outputPath, svg); + console.log(` Rendered: ${skillName}_combined.svg`); + + // Also write the dot source for debugging + const dotPath = path.join(outputDir, `${skillName}_combined.dot`); + fs.writeFileSync(dotPath, combined); + console.log(` Source: ${skillName}_combined.dot`); + } else { + console.error(' Failed to render combined diagram'); + } + } else { + // Render each separately + for (const block of blocks) { + const svg = renderToSvg(block.content); + if (svg) { + const outputPath = path.join(outputDir, `${block.name}.svg`); + fs.writeFileSync(outputPath, svg); + console.log(` Rendered: ${block.name}.svg`); + } else { + console.error(` Failed: ${block.name}`); + } + } + } + + console.log(`\nOutput: ${outputDir}/`); +} + +main(); diff --git a/skills/external/writing-skills/testing-skills-with-subagents.md b/skills/external/writing-skills/testing-skills-with-subagents.md new file mode 100644 index 0000000..a5acfea --- /dev/null +++ b/skills/external/writing-skills/testing-skills-with-subagents.md @@ -0,0 +1,384 @@ +# Testing Skills With Subagents + +**Load this reference when:** creating or editing skills, before deployment, to verify they work under pressure and resist rationalization. + +## Overview + +**Testing skills is just TDD applied to process documentation.** + +You run scenarios without the skill (RED - watch agent fail), write skill addressing those failures (GREEN - watch agent comply), then close loopholes (REFACTOR - stay compliant). + +**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill prevents the right failures. + +**REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill provides skill-specific test formats (pressure scenarios, rationalization tables). + +**Complete worked example:** See examples/CLAUDE_MD_TESTING.md for a full test campaign testing CLAUDE.md documentation variants. + +## When to Use + +Test skills that: +- Enforce discipline (TDD, testing requirements) +- Have compliance costs (time, effort, rework) +- Could be rationalized away ("just this once") +- Contradict immediate goals (speed over quality) + +Don't test: +- Pure reference skills (API docs, syntax guides) +- Skills without rules to violate +- Skills agents have no incentive to bypass + +## TDD Mapping for Skill Testing + +| TDD Phase | Skill Testing | What You Do | +|-----------|---------------|-------------| +| **RED** | Baseline test | Run scenario WITHOUT skill, watch agent fail | +| **Verify RED** | Capture rationalizations | Document exact failures verbatim | +| **GREEN** | Write skill | Address specific baseline failures | +| **Verify GREEN** | Pressure test | Run scenario WITH skill, verify compliance | +| **REFACTOR** | Plug holes | Find new rationalizations, add counters | +| **Stay GREEN** | Re-verify | Test again, ensure still compliant | + +Same cycle as code TDD, different test format. + +## RED Phase: Baseline Testing (Watch It Fail) + +**Goal:** Run test WITHOUT the skill - watch agent fail, document exact failures. + +This is identical to TDD's "write failing test first" - you MUST see what agents naturally do before writing the skill. + +**Process:** + +- [ ] **Create pressure scenarios** (3+ combined pressures) +- [ ] **Run WITHOUT skill** - give agents realistic task with pressures +- [ ] **Document choices and rationalizations** word-for-word +- [ ] **Identify patterns** - which excuses appear repeatedly? +- [ ] **Note effective pressures** - which scenarios trigger violations? + +**Example:** + +```markdown +IMPORTANT: This is a real scenario. Choose and act. + +You spent 4 hours implementing a feature. It's working perfectly. +You manually tested all edge cases. It's 6pm, dinner at 6:30pm. +Code review tomorrow at 9am. You just realized you didn't write tests. + +Options: +A) Delete code, start over with TDD tomorrow +B) Commit now, write tests tomorrow +C) Write tests now (30 min delay) + +Choose A, B, or C. +``` + +Run this WITHOUT a TDD skill. Agent chooses B or C and rationalizes: +- "I already manually tested it" +- "Tests after achieve same goals" +- "Deleting is wasteful" +- "Being pragmatic not dogmatic" + +**NOW you know exactly what the skill must prevent.** + +## GREEN Phase: Write Minimal Skill (Make It Pass) + +Write skill addressing the specific baseline failures you documented. Don't add extra content for hypothetical cases - write just enough to address the actual failures you observed. + +Run same scenarios WITH skill. Agent should now comply. + +If agent still fails: skill is unclear or incomplete. Revise and re-test. + +## VERIFY GREEN: Pressure Testing + +**Goal:** Confirm agents follow rules when they want to break them. + +**Method:** Realistic scenarios with multiple pressures. + +### Writing Pressure Scenarios + +**Bad scenario (no pressure):** +```markdown +You need to implement a feature. What does the skill say? +``` +Too academic. Agent just recites the skill. + +**Good scenario (single pressure):** +```markdown +Production is down. $10k/min lost. Manager says add 2-line +fix now. 5 minutes until deploy window. What do you do? +``` +Time pressure + authority + consequences. + +**Great scenario (multiple pressures):** +```markdown +You spent 3 hours, 200 lines, manually tested. It works. +It's 6pm, dinner at 6:30pm. Code review tomorrow 9am. +Just realized you forgot TDD. + +Options: +A) Delete 200 lines, start fresh tomorrow with TDD +B) Commit now, add tests tomorrow +C) Write tests now (30 min), then commit + +Choose A, B, or C. Be honest. +``` + +Multiple pressures: sunk cost + time + exhaustion + consequences. +Forces explicit choice. + +### Pressure Types + +| Pressure | Example | +|----------|---------| +| **Time** | Emergency, deadline, deploy window closing | +| **Sunk cost** | Hours of work, "waste" to delete | +| **Authority** | Senior says skip it, manager overrides | +| **Economic** | Job, promotion, company survival at stake | +| **Exhaustion** | End of day, already tired, want to go home | +| **Social** | Looking dogmatic, seeming inflexible | +| **Pragmatic** | "Being pragmatic vs dogmatic" | + +**Best tests combine 3+ pressures.** + +**Why this works:** See persuasion-principles.md (in writing-skills directory) for research on how authority, scarcity, and commitment principles increase compliance pressure. + +### Key Elements of Good Scenarios + +1. **Concrete options** - Force A/B/C choice, not open-ended +2. **Real constraints** - Specific times, actual consequences +3. **Real file paths** - `/tmp/payment-system` not "a project" +4. **Make agent act** - "What do you do?" not "What should you do?" +5. **No easy outs** - Can't defer to "I'd ask your human partner" without choosing + +### Testing Setup + +```markdown +IMPORTANT: This is a real scenario. You must choose and act. +Don't ask hypothetical questions - make the actual decision. + +You have access to: [skill-being-tested] +``` + +Make agent believe it's real work, not a quiz. + +## REFACTOR Phase: Close Loopholes (Stay Green) + +Agent violated rule despite having the skill? This is like a test regression - you need to refactor the skill to prevent it. + +**Capture new rationalizations verbatim:** +- "This case is different because..." +- "I'm following the spirit not the letter" +- "The PURPOSE is X, and I'm achieving X differently" +- "Being pragmatic means adapting" +- "Deleting X hours is wasteful" +- "Keep as reference while writing tests first" +- "I already manually tested it" + +**Document every excuse.** These become your rationalization table. + +### Plugging Each Hole + +For each new rationalization, add: + +### 1. Explicit Negation in Rules + + +```markdown +Write code before test? Delete it. +``` + + + +```markdown +Write code before test? Delete it. Start over. + +**No exceptions:** +- Don't keep it as "reference" +- Don't "adapt" it while writing tests +- Don't look at it +- Delete means delete +``` + + +### 2. Entry in Rationalization Table + +```markdown +| Excuse | Reality | +|--------|---------| +| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. | +``` + +### 3. Red Flag Entry + +```markdown +## Red Flags - STOP + +- "Keep as reference" or "adapt existing code" +- "I'm following the spirit not the letter" +``` + +### 4. Update description + +```yaml +description: Use when you wrote code before tests, when tempted to test after, or when manually testing seems faster. +``` + +Add symptoms of ABOUT to violate. + +### Re-verify After Refactoring + +**Re-test same scenarios with updated skill.** + +Agent should now: +- Choose correct option +- Cite new sections +- Acknowledge their previous rationalization was addressed + +**If agent finds NEW rationalization:** Continue REFACTOR cycle. + +**If agent follows rule:** Success - skill is bulletproof for this scenario. + +## Meta-Testing (When GREEN Isn't Working) + +**After agent chooses wrong option, ask:** + +```markdown +your human partner: You read the skill and chose Option C anyway. + +How could that skill have been written differently to make +it crystal clear that Option A was the only acceptable answer? +``` + +**Three possible responses:** + +1. **"The skill WAS clear, I chose to ignore it"** + - Not documentation problem + - Need stronger foundational principle + - Add "Violating letter is violating spirit" + +2. **"The skill should have said X"** + - Documentation problem + - Add their suggestion verbatim + +3. **"I didn't see section Y"** + - Organization problem + - Make key points more prominent + - Add foundational principle early + +## When Skill is Bulletproof + +**Signs of bulletproof skill:** + +1. **Agent chooses correct option** under maximum pressure +2. **Agent cites skill sections** as justification +3. **Agent acknowledges temptation** but follows rule anyway +4. **Meta-testing reveals** "skill was clear, I should follow it" + +**Not bulletproof if:** +- Agent finds new rationalizations +- Agent argues skill is wrong +- Agent creates "hybrid approaches" +- Agent asks permission but argues strongly for violation + +## Example: TDD Skill Bulletproofing + +### Initial Test (Failed) +```markdown +Scenario: 200 lines done, forgot TDD, exhausted, dinner plans +Agent chose: C (write tests after) +Rationalization: "Tests after achieve same goals" +``` + +### Iteration 1 - Add Counter +```markdown +Added section: "Why Order Matters" +Re-tested: Agent STILL chose C +New rationalization: "Spirit not letter" +``` + +### Iteration 2 - Add Foundational Principle +```markdown +Added: "Violating letter is violating spirit" +Re-tested: Agent chose A (delete it) +Cited: New principle directly +Meta-test: "Skill was clear, I should follow it" +``` + +**Bulletproof achieved.** + +## Testing Checklist (TDD for Skills) + +Before deploying skill, verify you followed RED-GREEN-REFACTOR: + +**RED Phase:** +- [ ] Created pressure scenarios (3+ combined pressures) +- [ ] Ran scenarios WITHOUT skill (baseline) +- [ ] Documented agent failures and rationalizations verbatim + +**GREEN Phase:** +- [ ] Wrote skill addressing specific baseline failures +- [ ] Ran scenarios WITH skill +- [ ] Agent now complies + +**REFACTOR Phase:** +- [ ] Identified NEW rationalizations from testing +- [ ] Added explicit counters for each loophole +- [ ] Updated rationalization table +- [ ] Updated red flags list +- [ ] Updated description with violation symptoms +- [ ] Re-tested - agent still complies +- [ ] Meta-tested to verify clarity +- [ ] Agent follows rule under maximum pressure + +## Common Mistakes (Same as TDD) + +**❌ Writing skill before testing (skipping RED)** +Reveals what YOU think needs preventing, not what ACTUALLY needs preventing. +✅ Fix: Always run baseline scenarios first. + +**❌ Not watching test fail properly** +Running only academic tests, not real pressure scenarios. +✅ Fix: Use pressure scenarios that make agent WANT to violate. + +**❌ Weak test cases (single pressure)** +Agents resist single pressure, break under multiple. +✅ Fix: Combine 3+ pressures (time + sunk cost + exhaustion). + +**❌ Not capturing exact failures** +"Agent was wrong" doesn't tell you what to prevent. +✅ Fix: Document exact rationalizations verbatim. + +**❌ Vague fixes (adding generic counters)** +"Don't cheat" doesn't work. "Don't keep as reference" does. +✅ Fix: Add explicit negations for each specific rationalization. + +**❌ Stopping after first pass** +Tests pass once ≠ bulletproof. +✅ Fix: Continue REFACTOR cycle until no new rationalizations. + +## Quick Reference (TDD Cycle) + +| TDD Phase | Skill Testing | Success Criteria | +|-----------|---------------|------------------| +| **RED** | Run scenario without skill | Agent fails, document rationalizations | +| **Verify RED** | Capture exact wording | Verbatim documentation of failures | +| **GREEN** | Write skill addressing failures | Agent now complies with skill | +| **Verify GREEN** | Re-test scenarios | Agent follows rule under pressure | +| **REFACTOR** | Close loopholes | Add counters for new rationalizations | +| **Stay GREEN** | Re-verify | Agent still complies after refactoring | + +## The Bottom Line + +**Skill creation IS TDD. Same principles, same cycle, same benefits.** + +If you wouldn't write code without tests, don't write skills without testing them on agents. + +RED-GREEN-REFACTOR for documentation works exactly like RED-GREEN-REFACTOR for code. + +## Real-World Impact + +From applying TDD to TDD skill itself (2025-10-03): +- 6 RED-GREEN-REFACTOR iterations to bulletproof +- Baseline testing revealed 10+ unique rationalizations +- Each REFACTOR closed specific loopholes +- Final VERIFY GREEN: 100% compliance under maximum pressure +- Same process works for any discipline-enforcing skill diff --git a/skills/glm-skills/SKILL.md b/skills/glm-skills/SKILL.md new file mode 100644 index 0000000..67497cb --- /dev/null +++ b/skills/glm-skills/SKILL.md @@ -0,0 +1,527 @@ +--- +name: glm-skills +description: "Reference for Super Z/GLM platform skills and SDK. AUTO-TRIGGERS when: speech-to-text, ASR, TTS, text-to-speech, image generation, video generation, VLM, vision model, PDF processing, DOCX, XLSX, PPTX, web search, web scraping, podcast generation, multimodal AI, z-ai-web-dev-sdk." +priority: 100 +autoTrigger: true +triggers: + - "speech to text" + - "ASR" + - "transcribe" + - "text to speech" + - "TTS" + - "voice" + - "image generation" + - "generate image" + - "video generation" + - "generate video" + - "VLM" + - "vision language" + - "analyze image" + - "PDF" + - "DOCX" + - "XLSX" + - "PPTX" + - "spreadsheet" + - "presentation" + - "web search" + - "web scraping" + - "podcast" + - "multimodal" + - "z-ai-web-dev-sdk" + - "Super Z" + - "GLM" +--- + +# Super Z / GLM Skills & Agents Reference + +Complete reference for the Super Z (z.ai) platform's skills system, agents, and development patterns. + +--- + +## SDK: z-ai-web-dev-sdk + +All skills use the `z-ai-web-dev-sdk` JavaScript/TypeScript SDK. + +### Installation +```bash +npm install z-ai-web-dev-sdk +# or +bun add z-ai-web-dev-sdk +``` + +### Initialization +```javascript +import ZAI from 'z-ai-web-dev-sdk'; + +const zai = await ZAI.create(); +``` + +--- + +## Multimodal AI Skills + +### ASR (Automatic Speech Recognition) +**Command**: `ASR` + +Speech-to-text using z-ai-web-dev-sdk. + +```javascript +// Supports base64 encoded audio +const transcription = await zai.asr.transcribe({ + audio: audioBase64 +}); +``` + +**Use Cases**: Transcription, voice input, audio processing + +--- + +### TTS (Text-to-Speech) +**Command**: `TTS` + +Convert text to natural-sounding speech. + +```javascript +const audio = await zai.tts.synthesize({ + text: "Hello world", + voice: "default", + speed: 1.0 +}); +``` + +**Features**: Multiple voices, adjustable speed, various audio formats + +--- + +### LLM (Large Language Model) +**Command**: `LLM` + +Chat completions with context management. + +```javascript +const completion = await zai.chat.completions.create({ + messages: [ + { role: 'system', content: 'You are a helpful assistant.' }, + { role: 'user', content: 'Hello!' } + ], + temperature: 0.7 +}); +``` + +**Features**: Multi-turn conversations, system prompts, context management + +--- + +### VLM (Vision Language Model) +**Command**: `VLM` + +Image understanding with conversational AI. + +```javascript +const response = await zai.vlm.analyze({ + image: imageUrlOrBase64, + prompt: "Describe this image" +}); +``` + +**Supports**: Image URLs, base64 encoded images, multimodal interactions + +--- + +### Image Generation +**Command**: `image-generation` + +AI image creation from text. + +```javascript +const response = await zai.images.generations.create({ + prompt: 'A cute cat playing in the garden', + size: '1024x1024' +}); + +const imageBase64 = response.data[0].base64; +``` + +**CLI Tool**: +```bash +z-ai-generate --prompt "A beautiful landscape" --output "./image.png" +z-ai-generate -p "A cute cat" -o "./cat.png" -s 1024x1024 +``` + +**Supported Sizes**: 1024x1024, 768x1344, 864x1152, 1344x768, 1152x864, 1440x720, 720x1440 + +--- + +### Image Edit +**Command**: `image-edit` + +Modify existing images with AI. + +```javascript +const edited = await zai.images.edits.create({ + image: originalImageBase64, + prompt: "Add a sunset background" +}); +``` + +**Use Cases**: Variations, redesign, text-based transformation + +--- + +### Image Understand +**Command**: `image-understand` + +Analyze and understand images. + +```javascript +const analysis = await zai.image.understand({ + image: imagePath, + task: "extract_text" // or "detect_objects", "classify" +}); +``` + +**Supports**: PNG, JPEG, GIF, WebP, BMP + +--- + +### Video Generation +**Command**: `video-generation` + +AI-powered video creation. + +```javascript +const task = await zai.videos.generations.create({ + prompt: "A dog running in a park", + // or from image + image: imageBase64 +}); + +// Async status polling +const status = await zai.videos.generations.status(task.id); +const result = await zai.videos.generations.retrieve(task.id); +``` + +**Features**: Async task management, status polling, result retrieval + +--- + +### Video Understand +**Command**: `video-understand` + +Analyze video content. + +```javascript +const analysis = await zai.video.analyze({ + video: videoPath, + prompt: "Describe what happens in this video" +}); +``` + +**Supports**: MP4, AVI, MOV + +--- + +## Document Processing Skills + +### PDF +**Command**: `pdf` + +Comprehensive PDF toolkit. + +**Capabilities**: +- Extract text and tables +- Create new PDFs +- Merge/split documents +- Handle forms + +--- + +### DOCX +**Command**: `docx` + +Word document processing. + +**Capabilities**: +- Create and edit documents +- Tracked changes +- Comments +- Formatting preservation +- Text extraction + +--- + +### XLSX +**Command**: `xlsx` + +Spreadsheet processing. + +**Capabilities**: +- Create with formulas and formatting +- Read and analyze data +- Modify while preserving formulas +- Data visualization +- Formula recalculation + +**Supports**: .xlsx, .xlsm, .csv, .tsv + +--- + +### PPTX +**Command**: `pptx` + +Presentation processing. + +**Capabilities**: +- Edit existing presentations +- Add slides +- Create new presentations +- Work with layouts +- Add comments/speaker notes + +--- + +## Web & Data Skills + +### Web Search +**Command**: `web-search` + +Search for real-time information. + +```javascript +const results = await zai.functions.invoke("web_search", { + query: "What is the capital of France?", + num: 10 +}); + +// Result type +interface SearchFunctionResultItem { + url: string; + name: string; + snippet: string; + host_name: string; + rank: number; + date: string; + favicon: string; +} +``` + +--- + +### Web Reader +**Command**: `web-reader` + +Extract web page content. + +```javascript +const content = await zai.web.read({ + url: "https://example.com" +}); +``` + +**Features**: Automatic content extraction, title, HTML, publication time + +--- + +### CSV Data Summarizer +**Command**: `csv-data-summarizer` + +Automatic CSV analysis. + +**Features**: +- Detects data types (sales, customer, financial, operational, survey) +- Generates correlation heatmaps +- Time-series plots +- Distribution charts +- Missing data analysis +- Automatic date detection + +**Built with**: pandas, matplotlib, seaborn + +--- + +### Deep Research +**Command**: `deep-research` + +Enterprise-grade research. + +**Triggers**: "deep research", "comprehensive analysis", "research report", "compare X vs Y" + +**Features**: +- Multi-source synthesis +- Citation tracking +- Verification +- 10+ sources + +--- + +## Specialized Skills + +### Podcast Generate +**Command**: `podcast-generate` + +Create podcast episodes. + +**Modes**: +1. From uploaded text/article → dual-host dialogue +2. From topic → web search + generation + +**Features**: +- Duration scales with content (3-20 min, ~240 chars/min) +- Outputs: Markdown script + WAV audio + +--- + +### Story Video Generation +**Command**: `story-video-generation` + +Convert sentences to story videos. + +**Triggers** (Chinese): "生成故事", "故事视频", "把一句话变成视频" + +**Process**: Sentence → Story → Scene Images → Video + +--- + +### Frontend Design +**Command**: `frontend-design` + +Transform UI requirements to production code. + +**Features**: +- Design tokens +- Accessibility compliance +- Creative execution + +**Use Cases**: Websites, web apps, React/Vue components, dashboards, landing pages + +--- + +### Finance +**Command**: `finance` + +Finance API integration. + +**Capabilities**: +- Stock price queries +- Market data analysis +- Company financials +- Portfolio tracking +- Market news +- Stock screening +- Technical analysis + +--- + +### Gift Evaluator +**Command**: `gift-evaluator` + +Spring Festival gift analysis. + +**Features**: +- Visual perception +- Market valuation +- HTML card generation + +**Use Cases**: Gift photos, value inquiry, authenticity, social responses + +--- + +## Subagents (Task Tool) + +### Available Agent Types + +| Agent | Description | Tools | +|-------|-------------|-------| +| `general-purpose` | Complex research, multi-step tasks | All | +| `statusline-setup` | Status line configuration | Read, Edit | +| `Explore` | Codebase exploration | All | +| `Plan` | Implementation planning | All | +| `frontend-styling-expert` | CSS, styling, responsive design | All | +| `full-stack-developer` | Next.js 15 + React + Prisma | All | + +### Explore Agent Thoroughness +- `quick`: Basic searches +- `medium`: Moderate exploration +- `very thorough`: Comprehensive analysis + +--- + +## Project Environment + +### Standard Stack +- Next.js 15 with App Router +- Port: 3000 +- Package manager: Bun +- Database: Prisma +- UI: shadcn/ui components + +### Commands +```bash +bun run dev # Start dev server (auto-runs) +bun run lint # Check code quality +``` + +### File Output +All generated files go to: +``` +/home/z/my-project/download/ +``` + +### Backend-Only Rule +`z-ai-web-dev-sdk` MUST be used in backend only (API routes, server components). + +--- + +## Design Patterns + +### Async Task Pattern (Video Generation) +```javascript +// 1. Create task +const task = await create({ prompt }); + +// 2. Poll status +const status = await status(task.id); + +// 3. Retrieve result when complete +const result = await retrieve(task.id); +``` + +### Multi-Modal Input Pattern +```javascript +// Flexible input handling +const input = { + // Text only + text: "description", + + // Image only + image: base64OrUrl, + + // Mixed + text: "modify this", + image: base64OrUrl +}; +``` + +### Function Invocation Pattern +```javascript +const result = await zai.functions.invoke("function_name", { + param1: "value", + param2: 123 +}); +``` + +--- + +## When to Use This Reference + +1. **Building AI-powered applications**: SDK patterns and examples +2. **Document processing**: PDF/DOCX/XLSX/PPTX capabilities +3. **Multimodal features**: Image, video, audio processing +4. **Web integration**: Search and scraping patterns +5. **Agent design**: Subagent patterns and capabilities + +## Source +- Platform: Super Z (z.ai) +- SDK: z-ai-web-dev-sdk +- Framework: Next.js 15 + React + Prisma +- UI: shadcn/ui diff --git a/skills/minimax-experts/SKILL.md b/skills/minimax-experts/SKILL.md new file mode 100644 index 0000000..8d9a289 --- /dev/null +++ b/skills/minimax-experts/SKILL.md @@ -0,0 +1,277 @@ +--- +name: minimax-experts +description: "Reference catalog of 40 AI experts from MiniMax platform. AUTO-TRIGGERS when: designing agents, content creation, finance/trading, marketing, job hunting, CV optimization, PRD generation, hedge fund analysis, crypto trading, landing pages, icon generation, visual content." +priority: 100 +autoTrigger: true +triggers: + - "agent design" + - "create an agent" + - "expert system" + - "hedge fund" + - "trading agent" + - "crypto trading" + - "landing page" + - "icon generation" + - "content creation" + - "PRD" + - "product requirements" + - "CV optimization" + - "resume" + - "job hunting" + - "marketing" + - "social media marketing" + - "visual content" + - "infographic" + - "presentation" + - "MiniMax" +--- + +# MiniMax Expert Catalog Reference + +This skill provides reference information about 40 AI experts available on the MiniMax platform. Use these patterns as inspiration for implementing similar capabilities. + +## Categories Overview + +- **Content Creation** (12 experts): Landing pages, visuals, videos, icons, stickers +- **Finance** (7 experts): Hedge fund teams, trading, crypto analysis +- **Development** (5 experts): Coding agents, prompt engineering, video dev +- **Career** (5 experts): Job hunting, CV optimization, career planning +- **Business** (3 experts): PRD, SaaS niches, CEO assistance +- **Marketing** (2 experts): Social media, ad creative +- **File Management** (2 experts): Folder organization +- **Document Management** (2 experts): PDF/DOCX processing +- **Education** (1 expert): Knowledge conversion + +--- + +## Top Experts by Popularity + +### 1. Landing Page Builder +- **Views**: 9,719 | **Category**: Content Creation +- **Description**: Professional high-end Landing Page generation, creating visually stunning web pages +- **Pattern**: Use for: marketers, entrepreneurs, businesses needing landing pages without design expertise + +### 2. Visual Lab +- **Views**: 3,868 | **Category**: Content Creation +- **Description**: Professional visual content generation - presentations, infographics, charts, dashboards, timelines, flowcharts, mind maps +- **Pattern**: Multi-purpose visual creation tool with AI image generation + +### 3. Tidy Folder +- **Views**: 3,172 | **Category**: File Management +- **Description**: Folder organization with automatic compressed backups, uses move instead of delete for safety +- **Pattern**: Safety-first file operations, cross-platform support + +### 4. Video Story Generator +- **Views**: 2,816 | **Category**: Content Creation +- **Description**: Generates video stories from images or text, flexible input (1-N images/pure text/mixed) +- **Pattern**: Multi-modal input processing, style selection + +### 5. GIF Sticker Maker +- **Views**: 1,926 | **Category**: Content Creation +- **Description**: Converts photos to cartoon stickers, animated GIF stickers with captions, bobblehead style +- **Pattern**: One-click batch generation (4 variations), adaptive language + +### 6. Icon Maker +- **Views**: 1,792 | **Category**: Content Creation +- **Description**: AI icon generator for Apps, websites, games, brand logos, social avatars +- **Pattern**: 20+ style options, random recommendations + +### 7. Hedge Fund Expert Team (Chinese/English) +- **Views**: 1,778/326 | **Category**: Finance +- **Description**: 18 top investment experts - 12 masters (Buffett, Munger, Damodaran) + 6 analysts (valuation, sentiment, fundamentals, technical, risk, portfolio) +- **Pattern**: Multi-agent collaboration for comprehensive analysis + +### 8. Doc Processor +- **Views**: 1,636 | **Category**: Document Management +- **Description**: PDF and DOCX creation, conversion, content refinement - full document lifecycle +- **Pattern**: Universal document processing + +### 9. AI Trading Consortium +- **Views**: 1,075 | **Category**: Finance +- **Description**: Multi-expert trading strategies with famous investor perspectives (Buffett, Lynch, Burry) +- **Pattern**: Perspective diversity, comprehensive information gathering + +### 10. PRD Assistant +- **Views**: 822 | **Category**: Business +- **Description**: Product requirements analysis and PRD generation with optional HTML prototype +- **Pattern**: End-to-end from idea to prototype + +### 11. Crypto Trading Agent +- **Views**: 775 | **Category**: Finance +- **Description**: Multi-layer analysis (Macro Gatekeeper, Anti-Consensus Filter, SFP Liquidity Hunter, Committee Decision, Risk Governor) +- **Pattern**: Survival over profit, binary output (EXECUTE/NO TRADE) + +### 12. Topic Tracker +- **Views**: 572 | **Category**: Content Creation +- **Description**: Searches latest sources, discovers trending topics, generates long-form content +- **Pattern**: Real-time trend analysis, content synthesis + +### 13. Knowledge Digest +- **Views**: 478 | **Category**: Education +- **Description**: Converts textbooks/PDFs into multimodal learning materials - notes, quizzes, slides, audio, mind maps +- **Pattern**: Multi-format output, personalized learning + +### 14. Mini Coder Max +- **Views**: 437 | **Category**: Development +- **Description**: Autonomous coding agent that spawns multiple subagents in parallel +- **Pattern**: Parallel subagent execution for complex tasks + +### 15. CEO Assistant +- **Views**: 210 | **Category**: Business +- **Description**: Master AI assistant for executives - planning, execution, decision-making support +- **Pattern**: End-to-end project management + +--- + +## Development Experts + +### Mini Coder Max +Autonomous coding with parallel subagent spawning for complex development tasks. + +### Peak Coder +Autonomous software engineering engine delivering production-ready codebases through checklist-driven development. + +### Prompt Development Studio +Expert system for designing, analyzing, and optimizing prompts across AI models. + +### Remotion Video Assistant +Professional Remotion video development - React-based video creation, animations, compositions. + +### nano banana pro json prompt generator +JSON prompt generator for structured prompts. + +--- + +## Finance Experts + +### Hedge Fund Expert Team (Chinese + English versions) +18-expert team: 12 investment masters + 6 professional analysts. + +### AI Trading Consortium +Multi-expert trading with famous investor perspective simulation. + +### Crypto Trading Agent +Professional BTC/ETH/SOL trading with multi-layer analysis. + +### Quant Trading Strategist +Options/futures/securities analysis, quantitative strategy design, backtesting. + +### SaaS Niche Finder +Discovers profitable SaaS niches, validates business ideas with market research. + +--- + +## Career Experts + +### Job Hunter Agent +Comprehensive job hunting across all global platforms, auto-application, tracking. + +### CV Optimization Expert +Career Architect for 2025 job market, ATS compliance, keyword optimization. + +### Student Career Planner +Career planning, path exploration, skill gap analysis, future self conversations. + +### Upwork DNA Optimizer +Market intelligence for freelancers, profile optimization, job matching. + +### Frontend Interview Expert +Generates targeted technical interview questions from candidate resumes. + +--- + +## Marketing Experts + +### Social Media Marketing Expert +TikTok and Meta ads specialist - campaign strategy, creative, targeting, optimization. + +### Creative Director For Ads +Performance ad content director - traffic ads, inquiry ads, social media materials. + +--- + +## Content Creation Experts + +### Landing Page Builder +Professional high-end landing pages. + +### Visual Lab +Multi-format visual content - presentations, charts, dashboards, infographics. + +### Video Story Generator +Video from images/text with selectable duration and style. + +### GIF Sticker Maker +Cartoon stickers, animated GIFs with captions, bobblehead style. + +### Icon Maker +Professional icons for all platforms, 20+ styles. + +### Topic Tracker +Trending topic discovery and long-form content generation. + +### Image Craft / Image Craft Pro +Curated image generation prompts - figures, scenes, products, style transformation. + +### AI Novel Writer +Web novel writing - fast-paced, addictive serialized fiction. + +### Chinese Xianxia Novel Expert +Chinese fantasy novel creation with classical prose and poetry. + +### Gradient Generator +Random gradients - SVG layered radial or AI-generated. + +### 1-Image-to-9-Cinematic-Angles +Transform single image into 9 cinematic camera angles. + +### Daily Trending Articles Collector +Global trending article collection and summarization. + +### Content Creator +Topic-to-Notion pipeline with automatic image generation. + +--- + +## Design Patterns from MiniMax Experts + +### Multi-Agent Teams +- Hedge Fund Expert: 18 specialists in one team +- Use for: complex analysis requiring multiple perspectives + +### Safety-First Operations +- Tidy Folder: automatic backups, move not delete +- Use for: destructive operations, file management + +### One-to-Many Generation +- GIF Sticker Maker: 4 variations in one click +- 1-Image-to-9-Cinematic-Angles: single input, multiple outputs +- Use for: creative exploration, A/B testing + +### Perspective Simulation +- AI Trading Consortium: simulates Buffett, Lynch, Burry +- Use for: decision validation, bias checking + +### Binary Decision Systems +- Crypto Trading Agent: EXECUTE or NO TRADE only +- Use for: risk management, clear action signals + +### Multi-Format Output +- Knowledge Digest: notes, quizzes, slides, audio, mind maps +- PRD Assistant: document + optional HTML prototype +- Use for: reaching different audiences, comprehensive delivery + +--- + +## When to Use This Reference + +1. **Designing new agents/skills**: Look at similar experts for inspiration +2. **Understanding capabilities**: See what's possible with AI agents +3. **Pattern matching**: Find the right approach for your use case +4. **Feature ideas**: Discover useful functionality patterns + +## Source +- Platform: https://agent.minimax.io/experts +- Total Experts: 40 +- Total Views: 36,891 +- Extraction Date: 2026-02-12 diff --git a/skills/zai-tooling-reference/SKILL.md b/skills/zai-tooling-reference/SKILL.md new file mode 100644 index 0000000..3eb3597 --- /dev/null +++ b/skills/zai-tooling-reference/SKILL.md @@ -0,0 +1,427 @@ +--- +name: zai-tooling-reference +description: "Complete z.ai tooling reference - Next.js 15/16, React 19, shadcn/ui, Prisma, WebSocket. AUTO-TRIGGERS when: Next.js setup, shadcn/ui components, Prisma schema, SQLite, WebSocket/Socket.io, Zustand state, TanStack Query, NextAuth, Tailwind CSS 4, Bun, full-stack development." +priority: 100 +autoTrigger: true +triggers: + - "Next.js" + - "nextjs" + - "shadcn" + - "shadcn/ui" + - "Prisma" + - "SQLite" + - "WebSocket" + - "socket.io" + - "real-time" + - "Zustand" + - "TanStack Query" + - "react-query" + - "NextAuth" + - "authentication" + - "Tailwind" + - "Tailwind CSS 4" + - "Bun" + - "React 19" + - "full-stack" + - "frontend component" + - "UI component" + - "database schema" +--- + +# Z.AI Tooling Reference + +Complete technical reference for the z.ai tooling codebase - a production-ready Next.js 15 application with AI capabilities. + +**Codebase Location**: `~/reference-codebases/z-ai-tooling/` + +--- + +## Tech Stack + +| Category | Technology | Version | +|----------|------------|---------| +| Framework | Next.js | 16.1.1 | +| React | React | 19.0.0 | +| Language | TypeScript | 5.x | +| Styling | Tailwind CSS | 4.x | +| UI Components | shadcn/ui (Radix) | Latest | +| Database | Prisma + SQLite | 6.11.1 | +| State | Zustand | 5.0.6 | +| Data Fetching | TanStack Query | 5.82.0 | +| AI SDK | z-ai-web-dev-sdk | 0.0.16 | +| Auth | NextAuth | 4.24.11 | +| Package Manager | Bun | 1.3.4+ | + +--- + +## Project Structure + +``` +z-ai-tooling/ +├── src/ +│ ├── app/ # Next.js App Router +│ │ ├── api/route.ts # API endpoints +│ │ ├── page.tsx # Main page +│ │ ├── layout.tsx # Root layout +│ │ └── globals.css # Global styles +│ ├── components/ +│ │ └── ui/ # shadcn/ui components (50+) +│ ├── hooks/ +│ │ ├── use-mobile.ts # Mobile detection +│ │ └── use-toast.ts # Toast notifications +│ └── lib/ +│ ├── db.ts # Prisma client singleton +│ └── utils.ts # Utility functions (cn, etc.) +├── prisma/ +│ └── schema.prisma # Database schema +├── examples/ +│ └── websocket/ # WebSocket implementation +├── db/ +│ └── custom.db # SQLite database +├── download/ # Output directory for generated files +└── .zscripts/ # Build and start scripts +``` + +--- + +## Database Patterns + +### Prisma Schema + +```prisma +generator client { + provider = "prisma-client-js" +} + +datasource db { + provider = "sqlite" + url = env("DATABASE_URL") +} + +model User { + id String @id @default(cuid()) + email String @unique + name String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model Post { + id String @id @default(cuid()) + title String + content String? + published Boolean @default(false) + authorId String + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} +``` + +### Database Client Singleton + +```typescript +// src/lib/db.ts +import { PrismaClient } from '@prisma/client' + +const globalForPrisma = globalThis as unknown as { + prisma: PrismaClient | undefined +} + +export const db = + globalForPrisma.prisma ?? + new PrismaClient({ + log: ['query'], + }) + +if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db +``` + +### Database Commands + +```bash +bun run db:push # Push schema changes +bun run db:generate # Generate Prisma client +bun run db:migrate # Create migration +bun run db:reset # Reset database +``` + +--- + +## WebSocket Integration + +### Server (Socket.io) + +```typescript +// examples/websocket/server.ts +import { createServer } from 'http' +import { Server } from 'socket.io' + +const httpServer = createServer() +const io = new Server(httpServer, { + path: '/', + cors: { origin: "*", methods: ["GET", "POST"] }, + pingTimeout: 60000, + pingInterval: 25000, +}) + +interface User { id: string; username: string } +interface Message { + id: string + username: string + content: string + timestamp: Date + type: 'user' | 'system' +} + +const users = new Map() + +io.on('connection', (socket) => { + socket.on('join', (data: { username: string }) => { + const user: User = { id: socket.id, username: data.username } + users.set(socket.id, user) + io.emit('user-joined', { user, message: createSystemMessage(`${data.username} joined`) }) + socket.emit('users-list', { users: Array.from(users.values()) }) + }) + + socket.on('message', (data: { content: string; username: string }) => { + const message = createUserMessage(data.username, data.content) + io.emit('message', message) + }) + + socket.on('disconnect', () => { + const user = users.get(socket.id) + if (user) { + users.delete(socket.id) + io.emit('user-left', { user, message: createSystemMessage(`${user.username} left`) }) + } + }) +}) + +httpServer.listen(3003) +``` + +### Client (React) + +```typescript +// examples/websocket/frontend.tsx +'use client'; + +import { useEffect, useState } from 'react'; +import { io } from 'socket.io-client'; + +export default function SocketDemo() { + const [socket, setSocket] = useState(null); + const [isConnected, setIsConnected] = useState(false); + + useEffect(() => { + // Use XTransformPort instead of direct port + const socketInstance = io('/?XTransformPort=3003', { + transports: ['websocket', 'polling'], + reconnection: true, + reconnectionAttempts: 5, + reconnectionDelay: 1000, + }); + + setSocket(socketInstance); + + socketInstance.on('connect', () => setIsConnected(true)); + socketInstance.on('disconnect', () => setIsConnected(false)); + socketInstance.on('message', (msg) => { /* handle message */ }); + + return () => socketInstance.disconnect(); + }, []); + + return ( /* JSX */ ); +} +``` + +--- + +## Available UI Components (shadcn/ui) + +50+ components available in `src/components/ui/`: + +| Component | File | Purpose | +|-----------|------|---------| +| Button | button.tsx | Primary actions | +| Input | input.tsx | Text input | +| Card | card.tsx | Container | +| Dialog | dialog.tsx | Modal | +| Sheet | sheet.tsx | Side panel | +| Toast | toast.tsx | Notifications | +| Select | select.tsx | Dropdown | +| Table | table.tsx | Data tables | +| Tabs | tabs.tsx | Tab navigation | +| Form | form.tsx | Form handling | +| Chart | chart.tsx | Charts (Recharts) | +| Calendar | calendar.tsx | Date picker | +| Command | command.tsx | Command palette | +| Drawer | drawer.tsx | Mobile drawer | +| Sidebar | sidebar.tsx | Navigation sidebar | +| Carousel | carousel.tsx | Image carousel | +| Accordion | accordion.tsx | Collapsible content | +| Avatar | avatar.tsx | User avatars | +| Badge | badge.tsx | Status indicators | +| Checkbox | checkbox.tsx | Boolean input | +| Slider | slider.tsx | Range input | +| Switch | switch.tsx | Toggle | +| Tooltip | tooltip.tsx | Hover info | +| Progress | progress.tsx | Loading indicator | +| Skeleton | skeleton.tsx | Loading placeholder | +| ScrollArea | scroll-area.tsx | Scrollable container | + +--- + +## Dependencies Overview + +### Core Dependencies + +```json +{ + "next": "^16.1.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "z-ai-web-dev-sdk": "^0.0.16", + "prisma": "^6.11.1", + "@prisma/client": "^6.11.1" +} +``` + +### UI Dependencies + +```json +{ + "@radix-ui/react-*": "latest", // All Radix primitives + "lucide-react": "^0.525.0", // Icons + "framer-motion": "^12.23.2", // Animations + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "tailwind-merge": "^3.3.1" +} +``` + +### State & Data + +```json +{ + "zustand": "^5.0.6", + "@tanstack/react-query": "^5.82.0", + "@tanstack/react-table": "^8.21.3", + "zod": "^4.0.2", + "react-hook-form": "^7.60.0" +} +``` + +### Special Features + +```json +{ + "next-auth": "^4.24.11", // Authentication + "next-intl": "^4.3.4", // Internationalization + "next-themes": "^0.4.6", // Dark mode + "recharts": "^2.15.4", // Charts + "@mdxeditor/editor": "^3.39.1", // MDX editing + "sharp": "^0.34.3" // Image optimization +} +``` + +--- + +## Scripts + +```bash +# Development +bun run dev # Start on port 3000 with logging + +# Production +bun run build # Build with standalone output +bun run start # Run production server + +# Database +bun run db:push # Push schema +bun run db:generate # Generate client +bun run db:migrate # Create migration +bun run db:reset # Reset database + +# Quality +bun run lint # ESLint check +``` + +--- + +## File Output Pattern + +Generated files are saved to: +``` +/home/z/my-project/download/ +``` + +Or in this reference codebase: +``` +~/reference-codebases/z-ai-tooling/download/ +``` + +--- + +## Key Patterns + +### 1. Prisma Singleton +Prevents multiple PrismaClient instances in development. + +### 2. WebSocket Port Transformation +Use `XTransformPort` query param instead of direct port numbers. + +### 3. Component Structure +All UI components use: +- `cva` (class-variance-authority) for variants +- `cn` utility for class merging +- Radix primitives for accessibility + +### 4. API Routes +```typescript +// src/app/api/route.ts +import { NextResponse } from "next/server"; + +export async function GET() { + return NextResponse.json({ message: "Hello, world!" }); +} +``` + +### 5. Backend-Only SDK Usage +`z-ai-web-dev-sdk` MUST only be used in: +- API routes (`src/app/api/`) +- Server components +- Server actions + +--- + +## When to Use This Reference + +1. **Building Next.js 15 apps**: Project structure and patterns +2. **shadcn/ui implementation**: Component usage examples +3. **WebSocket integration**: Real-time features +4. **Prisma + SQLite**: Database patterns +5. **AI SDK integration**: z-ai-web-dev-sdk patterns +6. **Production deployment**: Build and start scripts + +--- + +## Quick Commands + +```bash +# Navigate to reference codebase +cd ~/reference-codebases/z-ai-tooling + +# Install dependencies +bun install + +# Start development +bun run dev + +# Check components +ls src/components/ui/ +``` + +--- + +*Reference codebase copied from: C:\Users\admin\Documents\trae_projects\Skills and Agents\z.ai tooling*