claude-all-hands 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/code-simplifier.md +52 -0
- package/.claude/agents/curator.md +186 -246
- package/.claude/agents/documentation-taxonomist.md +255 -0
- package/.claude/agents/documentation-writer.md +366 -0
- package/.claude/agents/planner.md +123 -166
- package/.claude/agents/researcher.md +58 -41
- package/.claude/agents/surveyor.md +81 -0
- package/.claude/agents/worker.md +74 -0
- package/.claude/commands/continue.md +122 -0
- package/.claude/commands/create-skill.md +107 -0
- package/.claude/commands/create-specialist.md +111 -0
- package/.claude/commands/curator-audit.md +4 -0
- package/.claude/commands/debug.md +183 -0
- package/.claude/commands/docs-adjust.md +214 -0
- package/.claude/commands/docs-audit.md +172 -0
- package/.claude/commands/docs-init.md +210 -0
- package/.claude/commands/plan.md +199 -102
- package/.claude/commands/validate.md +11 -0
- package/.claude/commands/whats-next.md +106 -134
- package/.claude/envoy/README.md +5 -5
- package/.claude/envoy/envoy +11 -14
- package/.claude/envoy/package-lock.json +1594 -0
- package/.claude/envoy/package.json +38 -0
- package/.claude/envoy/src/cli.ts +126 -0
- package/.claude/envoy/src/commands/base.ts +216 -0
- package/.claude/envoy/src/commands/docs.ts +881 -0
- package/.claude/envoy/src/commands/gemini.ts +999 -0
- package/.claude/envoy/src/commands/git.ts +639 -0
- package/.claude/envoy/src/commands/index.ts +73 -0
- package/.claude/envoy/src/commands/knowledge.ts +178 -0
- package/.claude/envoy/src/commands/perplexity.ts +129 -0
- package/.claude/envoy/src/commands/plan/core.ts +134 -0
- package/.claude/envoy/src/commands/plan/findings.ts +446 -0
- package/.claude/envoy/src/commands/plan/gates.ts +672 -0
- package/.claude/envoy/src/commands/plan/index.ts +135 -0
- package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
- package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
- package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
- package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
- package/.claude/envoy/src/commands/repomix.ts +99 -0
- package/.claude/envoy/src/commands/tavily.ts +220 -0
- package/.claude/envoy/src/commands/xai.ts +168 -0
- package/.claude/envoy/src/lib/ast-queries.ts +261 -0
- package/.claude/envoy/src/lib/design.ts +41 -0
- package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
- package/.claude/envoy/src/lib/findings.ts +215 -0
- package/.claude/envoy/src/lib/gates.ts +572 -0
- package/.claude/envoy/src/lib/git.ts +132 -0
- package/.claude/envoy/src/lib/index.ts +188 -0
- package/.claude/envoy/src/lib/knowledge.ts +646 -0
- package/.claude/envoy/src/lib/markdown.ts +75 -0
- package/.claude/envoy/src/lib/observability.ts +262 -0
- package/.claude/envoy/src/lib/paths.ts +130 -0
- package/.claude/envoy/src/lib/plan-io.ts +117 -0
- package/.claude/envoy/src/lib/prompts.ts +231 -0
- package/.claude/envoy/src/lib/protocols.ts +314 -0
- package/.claude/envoy/src/lib/repomix.ts +133 -0
- package/.claude/envoy/src/lib/retry.ts +138 -0
- package/.claude/envoy/src/lib/tree-sitter-utils.ts +301 -0
- package/.claude/envoy/src/lib/watcher.ts +167 -0
- package/.claude/envoy/src/types/tree-sitter.d.ts +76 -0
- package/.claude/envoy/tsconfig.json +21 -0
- package/.claude/hooks/scripts/enforce_research_fetch.py +1 -1
- package/.claude/hooks/scripts/scan_agents.py +62 -0
- package/.claude/hooks/scripts/scan_commands.py +50 -0
- package/.claude/hooks/scripts/scan_skills.py +46 -70
- package/.claude/hooks/scripts/validate_artifacts.py +128 -0
- package/.claude/hooks/startup.sh +26 -24
- package/.claude/protocols/bug-discovery.yaml +55 -0
- package/.claude/protocols/debugging.yaml +51 -0
- package/.claude/protocols/discovery.yaml +53 -0
- package/.claude/protocols/implementation.yaml +84 -0
- package/.claude/settings.json +38 -97
- package/.claude/skills/brainstorming/SKILL.md +54 -0
- package/.claude/skills/commands-development/SKILL.md +630 -0
- package/.claude/skills/commands-development/references/arguments.md +252 -0
- package/.claude/skills/commands-development/references/patterns.md +796 -0
- package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
- package/.claude/skills/discovery-mode/SKILL.md +108 -0
- package/.claude/skills/documentation-taxonomy/SKILL.md +287 -0
- package/.claude/skills/hooks-development/SKILL.md +332 -0
- package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
- package/.claude/skills/hooks-development/references/examples.md +658 -0
- package/.claude/skills/hooks-development/references/hook-types.md +463 -0
- package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
- package/.claude/skills/hooks-development/references/matchers.md +470 -0
- package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
- package/.claude/skills/implementation-mode/SKILL.md +171 -0
- package/.claude/skills/knowledge-discovery/SKILL.md +178 -0
- package/.claude/skills/research-tools/SKILL.md +35 -33
- package/.claude/skills/skills-development/SKILL.md +192 -0
- package/.claude/skills/skills-development/references/api-security.md +226 -0
- package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
- package/.claude/skills/skills-development/references/common-patterns.md +595 -0
- package/.claude/skills/skills-development/references/core-principles.md +437 -0
- package/.claude/skills/skills-development/references/executable-code.md +175 -0
- package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
- package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
- package/.claude/skills/skills-development/references/skill-structure.md +372 -0
- package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
- package/.claude/skills/skills-development/references/using-scripts.md +113 -0
- package/.claude/skills/skills-development/references/using-templates.md +112 -0
- package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
- package/.claude/skills/skills-development/templates/router-skill.md +73 -0
- package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
- package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
- package/.claude/skills/skills-development/workflows/add-script.md +93 -0
- package/.claude/skills/skills-development/workflows/add-template.md +74 -0
- package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
- package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
- package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
- package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
- package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
- package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
- package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
- package/.claude/skills/subagents-development/SKILL.md +325 -0
- package/.claude/skills/subagents-development/references/context-management.md +567 -0
- package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
- package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
- package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
- package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
- package/.claude/skills/subagents-development/references/subagents.md +508 -0
- package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
- package/.claude/statusline.sh +24 -0
- package/bin/cli.js +150 -72
- package/package.json +1 -1
- package/.claude/agents/explorer.md +0 -62
- package/.claude/agents/parallel-worker.md +0 -121
- package/.claude/commands/curation-fix.md +0 -92
- package/.claude/commands/new-branch.md +0 -36
- package/.claude/commands/parallel-discovery.md +0 -69
- package/.claude/commands/parallel-orchestration.md +0 -99
- package/.claude/commands/plan-checkpoint.md +0 -37
- package/.claude/envoy/commands/__init__.py +0 -1
- package/.claude/envoy/commands/base.py +0 -95
- package/.claude/envoy/commands/parallel.py +0 -439
- package/.claude/envoy/commands/perplexity.py +0 -86
- package/.claude/envoy/commands/plans.py +0 -451
- package/.claude/envoy/commands/tavily.py +0 -156
- package/.claude/envoy/commands/vertex.py +0 -358
- package/.claude/envoy/commands/xai.py +0 -124
- package/.claude/envoy/envoy.py +0 -122
- package/.claude/envoy/pyrightconfig.json +0 -4
- package/.claude/envoy/requirements.txt +0 -2
- package/.claude/hooks/capture-queries.sh +0 -3
- package/.claude/hooks/scripts/enforce_planning.py +0 -118
- package/.claude/hooks/scripts/enforce_rg.py +0 -34
- package/.claude/hooks/scripts/validate_skill.py +0 -81
- package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
- package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
- package/.claude/skills/command-development/SKILL.md +0 -206
- package/.claude/skills/command-development/examples/simple-commands.md +0 -212
- package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
- package/.claude/skills/hook-development/SKILL.md +0 -127
- package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
- package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
- package/.claude/skills/hook-development/references/event-reference.md +0 -226
- package/.claude/skills/repomix-extraction/SKILL.md +0 -91
- package/.claude/skills/skill-development/SKILL.md +0 -168
- package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
- package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
- package/.claude/skills/skill-development/references/writing-style.md +0 -180
- package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
- package/.claude/skills/specialist-builder/SKILL.md +0 -327
- package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
- package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
- package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
- package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
- package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
- /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""UserPromptSubmit hook - enforces planning workflow based on plan status."""
|
|
3
|
-
|
|
4
|
-
import json
|
|
5
|
-
import subprocess
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def get_envoy_path() -> Path:
|
|
11
|
-
"""Get path to envoy CLI."""
|
|
12
|
-
cwd = Path.cwd()
|
|
13
|
-
return cwd / ".claude" / "envoy" / "envoy"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def get_current_branch() -> str:
|
|
17
|
-
"""Get current git branch name."""
|
|
18
|
-
result = subprocess.run(
|
|
19
|
-
["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
|
20
|
-
capture_output=True,
|
|
21
|
-
text=True,
|
|
22
|
-
)
|
|
23
|
-
if result.returncode == 0:
|
|
24
|
-
return result.stdout.strip()
|
|
25
|
-
return ""
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def is_direct_mode_branch() -> bool:
|
|
29
|
-
"""Check if current branch is a direct-mode branch (no planning)."""
|
|
30
|
-
branch = get_current_branch()
|
|
31
|
-
direct_branches = {"main", "master", "develop", "staging", "production"}
|
|
32
|
-
if branch in direct_branches:
|
|
33
|
-
return True
|
|
34
|
-
if branch.startswith("quick/"):
|
|
35
|
-
return True
|
|
36
|
-
return False
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def get_plan_status() -> dict:
|
|
40
|
-
"""Get current plan status via envoy."""
|
|
41
|
-
envoy = get_envoy_path()
|
|
42
|
-
if not envoy.exists():
|
|
43
|
-
return {"error": "envoy not found"}
|
|
44
|
-
|
|
45
|
-
result = subprocess.run(
|
|
46
|
-
[str(envoy), "plans", "frontmatter"],
|
|
47
|
-
capture_output=True,
|
|
48
|
-
text=True,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
if result.returncode != 0:
|
|
52
|
-
return {"error": result.stderr}
|
|
53
|
-
|
|
54
|
-
try:
|
|
55
|
-
data = json.loads(result.stdout)
|
|
56
|
-
return data.get("data", {})
|
|
57
|
-
except json.JSONDecodeError:
|
|
58
|
-
return {"error": "invalid json"}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def is_worker_subprocess() -> bool:
|
|
62
|
-
"""Check if running inside a parallel worker subprocess."""
|
|
63
|
-
import os
|
|
64
|
-
depth = os.environ.get("PARALLEL_WORKER_DEPTH", "0")
|
|
65
|
-
try:
|
|
66
|
-
return int(depth) > 0
|
|
67
|
-
except ValueError:
|
|
68
|
-
return False
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def main():
|
|
72
|
-
try:
|
|
73
|
-
input_data = json.load(sys.stdin)
|
|
74
|
-
except (json.JSONDecodeError, EOFError):
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
# Worker subprocess - return hint about injected plan file
|
|
78
|
-
if is_worker_subprocess():
|
|
79
|
-
print("Worker subprocess: /plan disabled. Use injected plan at .claude/plans/<branch>/plan.md")
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
# Early return for direct mode branches (skip envoy call)
|
|
83
|
-
if is_direct_mode_branch():
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
# Get plan status
|
|
87
|
-
plan_data = get_plan_status()
|
|
88
|
-
|
|
89
|
-
# Direct mode from envoy (fallback check)
|
|
90
|
-
if plan_data.get("mode") == "direct":
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
# No plan exists yet
|
|
94
|
-
if not plan_data.get("exists"):
|
|
95
|
-
print("No plan file. Run /plan to create one.")
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
frontmatter = plan_data.get("frontmatter", {})
|
|
99
|
-
status = frontmatter.get("status", "draft")
|
|
100
|
-
plan_path = plan_data.get("path", "")
|
|
101
|
-
|
|
102
|
-
if status == "draft":
|
|
103
|
-
print("PLANNING REQUIRED: Plan status is draft.")
|
|
104
|
-
print(f"Plan file: {plan_path}")
|
|
105
|
-
print("Run /plan to begin planning workflow.")
|
|
106
|
-
print("To skip planning this session, decline when prompted.")
|
|
107
|
-
|
|
108
|
-
elif status == "active":
|
|
109
|
-
print(f"Plan status: active | Plan file: {plan_path}")
|
|
110
|
-
print("IMPORTANT: If this prompt is NOT related to the current plan, you MUST run /plan to challenge the user to follow workflow best practices.")
|
|
111
|
-
|
|
112
|
-
elif status == "deactivated":
|
|
113
|
-
# User opted out - no enforcement, silent pass
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if __name__ == "__main__":
|
|
118
|
-
main()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""PreToolUse hook: block grep/find and suggest rg (only if rg available)."""
|
|
3
|
-
import json
|
|
4
|
-
import re
|
|
5
|
-
import shutil
|
|
6
|
-
import sys
|
|
7
|
-
|
|
8
|
-
RULES = [
|
|
9
|
-
(r"\bgrep\b(?!.*\|)", "Ensure you use Bash with 'rg <pattern>' (ripgrep) instead of grep."),
|
|
10
|
-
(r"\bfind\s+\S+\s+-name\b", "Ensure you use Bash with 'rg --files -g \"<pattern>\" <path>' instead of find -name."),
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
data = json.load(sys.stdin)
|
|
14
|
-
command = data.get("tool_input", {}).get("command", "")
|
|
15
|
-
|
|
16
|
-
if not command:
|
|
17
|
-
sys.exit(0)
|
|
18
|
-
|
|
19
|
-
# Check for grep/find patterns
|
|
20
|
-
for pattern, message in RULES:
|
|
21
|
-
if re.search(pattern, command):
|
|
22
|
-
# Only enforce if rg is available
|
|
23
|
-
if shutil.which("rg"):
|
|
24
|
-
print(json.dumps({
|
|
25
|
-
"hookSpecificOutput": {
|
|
26
|
-
"hookEventName": "PreToolUse",
|
|
27
|
-
"permissionDecision": "deny",
|
|
28
|
-
"permissionDecisionReason": message
|
|
29
|
-
}
|
|
30
|
-
}))
|
|
31
|
-
sys.exit(0)
|
|
32
|
-
break
|
|
33
|
-
|
|
34
|
-
sys.exit(0)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""PostToolUse hook: validate SKILL.md files on edit."""
|
|
3
|
-
import json
|
|
4
|
-
import re
|
|
5
|
-
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def parse_frontmatter(content):
|
|
10
|
-
"""Parse YAML frontmatter from content."""
|
|
11
|
-
if not content.startswith("---"):
|
|
12
|
-
return None
|
|
13
|
-
parts = content.split("---", 2)
|
|
14
|
-
if len(parts) < 3:
|
|
15
|
-
return None
|
|
16
|
-
result = {}
|
|
17
|
-
for line in parts[1].strip().split("\n"):
|
|
18
|
-
if ":" in line:
|
|
19
|
-
key, _, value = line.partition(":")
|
|
20
|
-
result[key.strip()] = value.strip().strip('"').strip("'")
|
|
21
|
-
return result
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def validate_skill_file(file_path):
|
|
25
|
-
"""Validate a SKILL.md file. Returns list of errors."""
|
|
26
|
-
errors = []
|
|
27
|
-
|
|
28
|
-
if not file_path.exists():
|
|
29
|
-
return errors
|
|
30
|
-
|
|
31
|
-
try:
|
|
32
|
-
content = file_path.read_text()
|
|
33
|
-
except Exception as e:
|
|
34
|
-
errors.append(f"Error reading file: {e}")
|
|
35
|
-
return errors
|
|
36
|
-
|
|
37
|
-
fm = parse_frontmatter(content)
|
|
38
|
-
if fm is None:
|
|
39
|
-
errors.append("Missing or invalid YAML frontmatter")
|
|
40
|
-
return errors
|
|
41
|
-
|
|
42
|
-
# Validate name
|
|
43
|
-
if "name" not in fm:
|
|
44
|
-
errors.append("Missing 'name' field in frontmatter")
|
|
45
|
-
else:
|
|
46
|
-
n = fm["name"]
|
|
47
|
-
if len(n) > 64:
|
|
48
|
-
errors.append(f"'name' exceeds 64 chars ({len(n)})")
|
|
49
|
-
if not re.match(r"^[a-z0-9]+(-[a-z0-9]+)*$", n):
|
|
50
|
-
errors.append(f"'name' must be kebab-case: '{n}'")
|
|
51
|
-
|
|
52
|
-
# Validate description
|
|
53
|
-
if "description" not in fm:
|
|
54
|
-
errors.append("Missing 'description' field in frontmatter")
|
|
55
|
-
elif len(fm["description"]) > 1024:
|
|
56
|
-
errors.append(f"'description' exceeds 1024 chars ({len(fm['description'])})")
|
|
57
|
-
|
|
58
|
-
return errors
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
data = json.load(sys.stdin)
|
|
62
|
-
file_path = data.get("tool_input", {}).get("file_path", "")
|
|
63
|
-
|
|
64
|
-
if not file_path:
|
|
65
|
-
sys.exit(0)
|
|
66
|
-
|
|
67
|
-
# Only validate skill files
|
|
68
|
-
if "/skills/" not in file_path and not file_path.endswith("SKILL.md"):
|
|
69
|
-
sys.exit(0)
|
|
70
|
-
|
|
71
|
-
# Only validate SKILL.md files specifically
|
|
72
|
-
if not file_path.endswith("SKILL.md"):
|
|
73
|
-
sys.exit(0)
|
|
74
|
-
|
|
75
|
-
errors = validate_skill_file(Path(file_path))
|
|
76
|
-
|
|
77
|
-
if errors:
|
|
78
|
-
print("❌ SKILL.md Validation Failed:", file=sys.stderr)
|
|
79
|
-
for error in errors:
|
|
80
|
-
print(f" • {error}", file=sys.stderr)
|
|
81
|
-
sys.exit(2)
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: claude-envoy-curation
|
|
3
|
-
description: Use when adding new external tool integrations to claude-envoy (replaces MCP servers). Contains command patterns and auto-discovery requirements.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<objective>
|
|
7
|
-
Extend claude-envoy with new commands for external tool integrations. claude-envoy replaces MCP servers as the standard way to connect Claude Code agents to external APIs and services.
|
|
8
|
-
</objective>
|
|
9
|
-
|
|
10
|
-
<quick_start>
|
|
11
|
-
1. Run `.claude/envoy/envoy info` to see current commands
|
|
12
|
-
2. Read `.claude/envoy/commands/base.py` for BaseCommand interface
|
|
13
|
-
3. Create new module in `.claude/envoy/commands/{group}.py`
|
|
14
|
-
4. Export via `COMMANDS = {"cmd": Class}` dict
|
|
15
|
-
5. Test with `.claude/envoy/envoy {group} {command} --help`
|
|
16
|
-
</quick_start>
|
|
17
|
-
|
|
18
|
-
<success_criteria>
|
|
19
|
-
- Command appears in `.claude/envoy/envoy info` output
|
|
20
|
-
- `--help` shows proper usage
|
|
21
|
-
- Returns valid JSON with `status` field
|
|
22
|
-
- Handles errors gracefully with `self.error()`
|
|
23
|
-
</success_criteria>
|
|
24
|
-
|
|
25
|
-
<constraints>
|
|
26
|
-
- All commands MUST output JSON to stdout
|
|
27
|
-
- Python 3.9 compat: use `Optional[]` not `|`, add `from __future__ import annotations`
|
|
28
|
-
- Opinionated defaults: minimize exposed params, hardcode sensible values
|
|
29
|
-
- No breaking changes to existing command signatures
|
|
30
|
-
</constraints>
|
|
31
|
-
|
|
32
|
-
<workflow>
|
|
33
|
-
## Architecture
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
.claude/envoy/
|
|
37
|
-
├── envoy # Bash wrapper (auto-creates venv, loads .env)
|
|
38
|
-
├── envoy.py # CLI with auto-discovery
|
|
39
|
-
├── commands/ # Command modules (auto-discovered)
|
|
40
|
-
│ ├── base.py # BaseCommand class
|
|
41
|
-
│ └── {group}.py # COMMANDS = {"cmd": Class, ...}
|
|
42
|
-
└── requirements.txt
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Adding a Command
|
|
46
|
-
|
|
47
|
-
### 1. Read existing patterns
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# See current commands
|
|
51
|
-
.claude/envoy/envoy info
|
|
52
|
-
|
|
53
|
-
# Read base class
|
|
54
|
-
cat .claude/envoy/commands/base.py
|
|
55
|
-
|
|
56
|
-
# Read example module
|
|
57
|
-
cat .claude/envoy/commands/perplexity.py
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### 2. Create or edit command module
|
|
61
|
-
|
|
62
|
-
In `.claude/envoy/commands/{group}.py`:
|
|
63
|
-
|
|
64
|
-
```python
|
|
65
|
-
from __future__ import annotations
|
|
66
|
-
from typing import Optional
|
|
67
|
-
from .base import BaseCommand
|
|
68
|
-
|
|
69
|
-
class MyCommand(BaseCommand):
|
|
70
|
-
name = "mycommand"
|
|
71
|
-
description = "What it does"
|
|
72
|
-
|
|
73
|
-
def add_arguments(self, parser) -> None:
|
|
74
|
-
parser.add_argument("query", help="Required arg")
|
|
75
|
-
parser.add_argument("--optional", help="Optional flag")
|
|
76
|
-
|
|
77
|
-
def execute(self, *, query: str, optional: Optional[str] = None, **kwargs) -> dict:
|
|
78
|
-
# Implementation
|
|
79
|
-
return self.success({"result": "..."})
|
|
80
|
-
|
|
81
|
-
# Auto-discovered by envoy.py
|
|
82
|
-
COMMANDS = {
|
|
83
|
-
"mycommand": MyCommand,
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 3. Add dependencies
|
|
88
|
-
|
|
89
|
-
If new packages needed, add to `.claude/envoy/requirements.txt` and delete `.claude/envoy/.venv/` to trigger reinstall.
|
|
90
|
-
</workflow>
|
|
91
|
-
|
|
92
|
-
<validation>
|
|
93
|
-
## Testing
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Test command
|
|
97
|
-
.claude/envoy/envoy {group} {command} "test"
|
|
98
|
-
|
|
99
|
-
# Verify registration
|
|
100
|
-
.claude/envoy/envoy info
|
|
101
|
-
|
|
102
|
-
# Check help
|
|
103
|
-
.claude/envoy/envoy {group} {command} --help
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Checklist
|
|
107
|
-
- [ ] Command registered in `COMMANDS` dict
|
|
108
|
-
- [ ] `name` and `description` class attributes set
|
|
109
|
-
- [ ] `add_arguments()` defines CLI interface
|
|
110
|
-
- [ ] `execute()` returns `self.success()` or `self.error()`
|
|
111
|
-
- [ ] Dependencies added to requirements.txt if needed
|
|
112
|
-
</validation>
|
|
113
|
-
|
|
114
|
-
<examples>
|
|
115
|
-
## Base Command Helpers
|
|
116
|
-
|
|
117
|
-
```python
|
|
118
|
-
self.success(data, metadata=None) # Return success response
|
|
119
|
-
self.error(type, message, suggestion=None) # Return error response
|
|
120
|
-
self.read_file(path) # Read file, returns None if not found
|
|
121
|
-
self.read_files(paths) # Read multiple files
|
|
122
|
-
self.timed_execute(func, *args) # Returns (result, duration_ms)
|
|
123
|
-
self.timeout_ms # From ENVOY_TIMEOUT_MS env var
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Command Module Template
|
|
127
|
-
|
|
128
|
-
```python
|
|
129
|
-
from __future__ import annotations
|
|
130
|
-
from typing import Optional
|
|
131
|
-
from .base import BaseCommand
|
|
132
|
-
|
|
133
|
-
class SearchCommand(BaseCommand):
|
|
134
|
-
name = "search"
|
|
135
|
-
description = "Search external API"
|
|
136
|
-
|
|
137
|
-
def add_arguments(self, parser) -> None:
|
|
138
|
-
parser.add_argument("query", help="Search query")
|
|
139
|
-
parser.add_argument("--max-results", type=int, default=5, help="Result limit")
|
|
140
|
-
|
|
141
|
-
def execute(self, *, query: str, max_results: int = 5, **kwargs) -> dict:
|
|
142
|
-
try:
|
|
143
|
-
results = self._call_api(query, max_results)
|
|
144
|
-
return self.success({"results": results})
|
|
145
|
-
except Exception as e:
|
|
146
|
-
return self.error("api_error", str(e))
|
|
147
|
-
|
|
148
|
-
COMMANDS = {
|
|
149
|
-
"search": SearchCommand,
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
</examples>
|
|
153
|
-
|
|
154
|
-
<anti_patterns>
|
|
155
|
-
| Anti-Pattern | Problem | Correct Approach |
|
|
156
|
-
|--------------|---------|------------------|
|
|
157
|
-
| Print instead of return | Output not parseable | Always `return self.success()/self.error()` |
|
|
158
|
-
| Use `str \| None` syntax | Python 3.9 incompatible | Use `Optional[str]` with future annotations |
|
|
159
|
-
| Expose all API params | Overwhelming interface | Hardcode sensible defaults |
|
|
160
|
-
| Skip COMMANDS dict | Command not discovered | Always export via COMMANDS |
|
|
161
|
-
| Modify existing signatures | Breaks dependent skills | Add new params with defaults only |
|
|
162
|
-
</anti_patterns>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: claude-envoy-usage
|
|
3
|
-
description: Use when building skills that need external tool access (APIs, LLMs, web). claude-envoy replaces MCP servers with agent-scoped integrations.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<objective>
|
|
7
|
-
Access external tools via claude-envoy. Self-documenting system - discover available commands dynamically before use.
|
|
8
|
-
</objective>
|
|
9
|
-
|
|
10
|
-
<quick_start>
|
|
11
|
-
```bash
|
|
12
|
-
# Discover available commands
|
|
13
|
-
.claude/envoy/envoy info
|
|
14
|
-
|
|
15
|
-
# Get help for command group
|
|
16
|
-
.claude/envoy/envoy <group> --help
|
|
17
|
-
|
|
18
|
-
# Get help for specific command
|
|
19
|
-
.claude/envoy/envoy <group> <command> --help
|
|
20
|
-
```
|
|
21
|
-
</quick_start>
|
|
22
|
-
|
|
23
|
-
<success_criteria>
|
|
24
|
-
- Commands discovered via `envoy info` before use
|
|
25
|
-
- JSON response parsed correctly (`status`, `data` fields)
|
|
26
|
-
- File contents passed via envoy (not loaded into Claude context)
|
|
27
|
-
</success_criteria>
|
|
28
|
-
|
|
29
|
-
<constraints>
|
|
30
|
-
- Always discover commands dynamically - don't assume availability
|
|
31
|
-
- All commands return JSON: `{"status": "success|error", "data": {...}}`
|
|
32
|
-
</constraints>
|
|
33
|
-
|
|
34
|
-
<workflow>
|
|
35
|
-
### Integration Process
|
|
36
|
-
1. Run `.claude/envoy/envoy info` to see available command groups
|
|
37
|
-
2. Run `--help` on relevant commands to learn arguments
|
|
38
|
-
3. Include specific invocations in skill workflow sections
|
|
39
|
-
4. Parse JSON response - all commands return `{"status": "success|error", "data": {...}}`
|
|
40
|
-
|
|
41
|
-
### Context Preservation
|
|
42
|
-
envoy reads files directly and passes to external LLMs. Claude only receives JSON output, keeping file contents out of context window.
|
|
43
|
-
|
|
44
|
-
### When to Extend
|
|
45
|
-
If needed functionality doesn't exist, use the `claude-envoy-curation` skill to add new commands.
|
|
46
|
-
</workflow>
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: command-development
|
|
3
|
-
description: Use when user asks to "create a slash command", "add a command", "write custom command", or needs guidance on command frontmatter, dynamic arguments, or bash execution.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<objective>
|
|
7
|
-
Guide creation of Claude Code slash commands with proper structure, frontmatter, and dynamic features. Commands are Markdown files containing prompts that Claude executes when invoked, providing reusability and quick access to complex workflows.
|
|
8
|
-
</objective>
|
|
9
|
-
|
|
10
|
-
<quick_start>
|
|
11
|
-
1. Create `.claude/commands/command-name.md`
|
|
12
|
-
2. Add frontmatter if needed (description, allowed-tools, argument-hint)
|
|
13
|
-
3. Write prompt body with dynamic arguments (`$1`, `$ARGUMENTS`, `@file`)
|
|
14
|
-
4. Test with `/command-name [args]`
|
|
15
|
-
</quick_start>
|
|
16
|
-
|
|
17
|
-
<success_criteria>
|
|
18
|
-
- Command file exists in correct location with `.md` extension
|
|
19
|
-
- Frontmatter valid YAML (if present)
|
|
20
|
-
- Dynamic arguments work as expected
|
|
21
|
-
- Tool restrictions appropriate for command scope
|
|
22
|
-
</success_criteria>
|
|
23
|
-
|
|
24
|
-
<constraints>
|
|
25
|
-
- Commands are instructions FOR Claude, not messages TO users
|
|
26
|
-
- Be restrictive with tools: `Bash(git:*)` not `Bash(*)`
|
|
27
|
-
- Descriptions under 60 characters
|
|
28
|
-
- Single responsibility per command
|
|
29
|
-
</constraints>
|
|
30
|
-
|
|
31
|
-
## Command Locations
|
|
32
|
-
|
|
33
|
-
| Type | Location | Scope | Label |
|
|
34
|
-
|------|----------|-------|-------|
|
|
35
|
-
| Project | `.claude/commands/` | Shared with team | (project) |
|
|
36
|
-
| Personal | `~/.claude/commands/` | All your projects | (user) |
|
|
37
|
-
| Plugin | `plugin/commands/` | Plugin users | (plugin-name) |
|
|
38
|
-
|
|
39
|
-
Project commands take precedence over personal commands with same name.
|
|
40
|
-
|
|
41
|
-
## File Format
|
|
42
|
-
|
|
43
|
-
**Minimal command** (no frontmatter):
|
|
44
|
-
```markdown
|
|
45
|
-
Review this code for security vulnerabilities including:
|
|
46
|
-
- SQL injection
|
|
47
|
-
- XSS attacks
|
|
48
|
-
- Authentication issues
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**With frontmatter**:
|
|
52
|
-
```markdown
|
|
53
|
-
---
|
|
54
|
-
description: Review code for security issues
|
|
55
|
-
allowed-tools: Read, Grep, Bash(git:*)
|
|
56
|
-
model: sonnet
|
|
57
|
-
argument-hint: [file-path]
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
Review @$1 for security vulnerabilities...
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## YAML Frontmatter Fields
|
|
64
|
-
|
|
65
|
-
| Field | Purpose | Default |
|
|
66
|
-
|-------|---------|---------|
|
|
67
|
-
| `description` | Brief description for `/help` | First line of prompt |
|
|
68
|
-
| `allowed-tools` | Tools command can use | Inherits from conversation |
|
|
69
|
-
| `model` | Model to use (sonnet/opus/haiku) | Inherits from conversation |
|
|
70
|
-
| `argument-hint` | Document expected arguments | None |
|
|
71
|
-
| `disable-model-invocation` | Prevent SlashCommand tool from calling | false |
|
|
72
|
-
|
|
73
|
-
For detailed field specifications, see `references/frontmatter-reference.md`.
|
|
74
|
-
|
|
75
|
-
## Dynamic Arguments
|
|
76
|
-
|
|
77
|
-
### $ARGUMENTS - All arguments
|
|
78
|
-
|
|
79
|
-
```markdown
|
|
80
|
-
---
|
|
81
|
-
argument-hint: [issue-number]
|
|
82
|
-
---
|
|
83
|
-
Fix issue #$ARGUMENTS following coding standards.
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Usage: `/fix-issue 123 high-priority` expands `$ARGUMENTS` to "123 high-priority"
|
|
87
|
-
|
|
88
|
-
### Positional - $1, $2, $3...
|
|
89
|
-
|
|
90
|
-
```markdown
|
|
91
|
-
---
|
|
92
|
-
argument-hint: [pr-number] [priority] [assignee]
|
|
93
|
-
---
|
|
94
|
-
Review PR #$1 with priority $2, assign to $3.
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## File References
|
|
98
|
-
|
|
99
|
-
Use `@` prefix to include file contents:
|
|
100
|
-
|
|
101
|
-
```markdown
|
|
102
|
-
# Static reference
|
|
103
|
-
Review @src/utils/helpers.js for issues.
|
|
104
|
-
|
|
105
|
-
# Dynamic with argument
|
|
106
|
-
Generate docs for @$1
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Bash Execution
|
|
110
|
-
|
|
111
|
-
Execute bash commands inline with exclamation-backtick syntax. Requires `allowed-tools` with Bash.
|
|
112
|
-
|
|
113
|
-
```markdown
|
|
114
|
-
---
|
|
115
|
-
allowed-tools: Bash(git:*)
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
Current branch: !`git branch --show-current`
|
|
119
|
-
Recent commits: !`git log --oneline -5`
|
|
120
|
-
Status: !`git status --short`
|
|
121
|
-
|
|
122
|
-
Review changes and suggest commit message.
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
**Tool patterns**:
|
|
126
|
-
- `Bash(git:*)` - Only git commands
|
|
127
|
-
- `Bash(npm:*)` - Only npm commands
|
|
128
|
-
- `Bash(kubectl:*), Bash(helm:*)` - Multiple specific tools
|
|
129
|
-
|
|
130
|
-
## Command Organization
|
|
131
|
-
|
|
132
|
-
### Flat (5-15 commands)
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
.claude/commands/
|
|
136
|
-
├── build.md
|
|
137
|
-
├── test.md
|
|
138
|
-
├── deploy.md
|
|
139
|
-
└── review.md
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Namespaced (15+ commands)
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
.claude/commands/
|
|
146
|
-
├── ci/
|
|
147
|
-
│ ├── build.md # /build (project:ci)
|
|
148
|
-
│ └── test.md # /test (project:ci)
|
|
149
|
-
├── git/
|
|
150
|
-
│ ├── commit.md # /commit (project:git)
|
|
151
|
-
│ └── pr.md # /pr (project:git)
|
|
152
|
-
└── docs/
|
|
153
|
-
└── generate.md # /generate (project:docs)
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
<examples>
|
|
157
|
-
|
|
158
|
-
### Read-Only Analysis
|
|
159
|
-
```markdown
|
|
160
|
-
---
|
|
161
|
-
allowed-tools: Read, Grep
|
|
162
|
-
---
|
|
163
|
-
Analyze code without modifications...
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Git Operations
|
|
167
|
-
```markdown
|
|
168
|
-
---
|
|
169
|
-
allowed-tools: Bash(git:*)
|
|
170
|
-
---
|
|
171
|
-
!`git status`
|
|
172
|
-
Analyze and suggest...
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### File Comparison
|
|
176
|
-
```markdown
|
|
177
|
-
Compare @$1 with @$2 and identify differences...
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### User Interaction (AskUserQuestion)
|
|
181
|
-
```markdown
|
|
182
|
-
---
|
|
183
|
-
description: Deploy with environment selection
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
Use AskUserQuestion to confirm deployment:
|
|
187
|
-
|
|
188
|
-
Question: "Deploy to which environment?"
|
|
189
|
-
Options:
|
|
190
|
-
1. Development - Lower risk, fast iteration
|
|
191
|
-
2. Staging - Pre-production testing
|
|
192
|
-
3. Production - Live deployment (requires approval)
|
|
193
|
-
|
|
194
|
-
After user selection, proceed with deployment to chosen environment.
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
</examples>
|
|
198
|
-
|
|
199
|
-
## Additional Resources
|
|
200
|
-
|
|
201
|
-
### Reference Files
|
|
202
|
-
- **`references/frontmatter-reference.md`** - Complete field specifications and constraints
|
|
203
|
-
|
|
204
|
-
### Examples
|
|
205
|
-
- **`examples/simple-commands.md`** - Basic command patterns
|
|
206
|
-
- **`examples/plugin-commands.md`** - Plugin-specific patterns with ${CLAUDE_PLUGIN_ROOT}
|