@grimoire-cc/cli 0.6.3 → 0.7.0

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.
Files changed (33) hide show
  1. package/dist/commands/logs.d.ts.map +1 -1
  2. package/dist/commands/logs.js +2 -2
  3. package/dist/commands/logs.js.map +1 -1
  4. package/dist/static/log-viewer.html +946 -690
  5. package/dist/static/static/log-viewer.html +946 -690
  6. package/package.json +1 -1
  7. package/packs/dev-pack/agents/gr.code-reviewer.md +286 -0
  8. package/packs/dev-pack/agents/gr.tdd-specialist.md +44 -0
  9. package/packs/dev-pack/grimoire.json +55 -0
  10. package/packs/dev-pack/skills/gr.tdd-specialist/SKILL.md +247 -0
  11. package/packs/dev-pack/skills/gr.tdd-specialist/reference/anti-patterns.md +166 -0
  12. package/packs/dev-pack/skills/gr.tdd-specialist/reference/language-frameworks.md +388 -0
  13. package/packs/dev-pack/skills/gr.tdd-specialist/reference/tdd-workflow-patterns.md +135 -0
  14. package/packs/docs-pack/grimoire.json +30 -0
  15. package/packs/docs-pack/skills/gr.business-logic-docs/SKILL.md +141 -0
  16. package/packs/docs-pack/skills/gr.business-logic-docs/references/tier2-template.md +74 -0
  17. package/packs/essentials-pack/agents/gr.fact-checker.md +202 -0
  18. package/packs/essentials-pack/grimoire.json +12 -0
  19. package/packs/meta-pack/grimoire.json +72 -0
  20. package/packs/meta-pack/skills/gr.context-file-guide/SKILL.md +201 -0
  21. package/packs/meta-pack/skills/gr.context-file-guide/scripts/validate-context-file.sh +29 -0
  22. package/packs/meta-pack/skills/gr.readme-guide/SKILL.md +362 -0
  23. package/packs/meta-pack/skills/gr.skill-developer/SKILL.md +321 -0
  24. package/packs/meta-pack/skills/gr.skill-developer/examples/brand-guidelines.md +94 -0
  25. package/packs/meta-pack/skills/gr.skill-developer/examples/financial-analysis.md +85 -0
  26. package/packs/meta-pack/skills/gr.skill-developer/reference/best-practices.md +410 -0
  27. package/packs/meta-pack/skills/gr.skill-developer/reference/file-organization.md +452 -0
  28. package/packs/meta-pack/skills/gr.skill-developer/reference/patterns.md +459 -0
  29. package/packs/meta-pack/skills/gr.skill-developer/reference/yaml-spec.md +214 -0
  30. package/packs/meta-pack/skills/gr.skill-developer/scripts/create-skill.sh +210 -0
  31. package/packs/meta-pack/skills/gr.skill-developer/scripts/validate-skill.py +520 -0
  32. package/packs/meta-pack/skills/gr.skill-developer/templates/basic-skill.md +94 -0
  33. package/packs/meta-pack/skills/gr.skill-developer/templates/domain-skill.md +108 -0
@@ -0,0 +1,210 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # create-skill.sh - Scaffold a new Claude Code skill with proper structure
4
+ #
5
+ # Usage: ./create-skill.sh <skill-name> [--template basic|domain]
6
+ #
7
+ # This script creates a new skill directory with SKILL.md from a template.
8
+ # It validates the skill name format and prompts for a description.
9
+
10
+ set -e # Exit on error
11
+
12
+ # Colors for output
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ NC='\033[0m' # No Color
17
+
18
+ # Script directory (for finding templates)
19
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
+ SKILL_DEVELOPER_DIR="$(dirname "$SCRIPT_DIR")"
21
+ TEMPLATES_DIR="$SKILL_DEVELOPER_DIR/templates"
22
+
23
+ # Default template
24
+ TEMPLATE="basic"
25
+
26
+ # Parse arguments
27
+ if [ $# -lt 1 ]; then
28
+ echo -e "${RED}Error: Skill name required${NC}"
29
+ echo "Usage: $0 <skill-name> [--template basic|domain]"
30
+ echo ""
31
+ echo "Examples:"
32
+ echo " $0 my-skill"
33
+ echo " $0 financial-analysis --template domain"
34
+ exit 1
35
+ fi
36
+
37
+ SKILL_NAME="$1"
38
+ shift
39
+
40
+ # Parse optional flags
41
+ while [ $# -gt 0 ]; do
42
+ case "$1" in
43
+ --template)
44
+ TEMPLATE="$2"
45
+ shift 2
46
+ ;;
47
+ *)
48
+ echo -e "${RED}Error: Unknown argument: $1${NC}"
49
+ exit 1
50
+ ;;
51
+ esac
52
+ done
53
+
54
+ # Validate template option
55
+ if [ "$TEMPLATE" != "basic" ] && [ "$TEMPLATE" != "domain" ]; then
56
+ echo -e "${RED}Error: Template must be 'basic' or 'domain'${NC}"
57
+ exit 1
58
+ fi
59
+
60
+ # Validate skill name format
61
+ validate_name() {
62
+ local name="$1"
63
+
64
+ # Check length
65
+ if [ ${#name} -gt 64 ]; then
66
+ echo -e "${RED}Error: Skill name must be ≤64 characters (got ${#name})${NC}"
67
+ return 1
68
+ fi
69
+
70
+ # Check for uppercase letters
71
+ if [[ "$name" =~ [A-Z] ]]; then
72
+ echo -e "${RED}Error: Skill name must be lowercase${NC}"
73
+ return 1
74
+ fi
75
+
76
+ # Check for invalid characters (only lowercase, numbers, hyphens allowed)
77
+ if [[ ! "$name" =~ ^[a-z0-9-]+$ ]]; then
78
+ echo -e "${RED}Error: Skill name can only contain lowercase letters, numbers, and hyphens${NC}"
79
+ return 1
80
+ fi
81
+
82
+ # Check for reserved words
83
+ if [[ "$name" =~ anthropic|claude ]]; then
84
+ echo -e "${RED}Error: Skill name cannot contain 'anthropic' or 'claude'${NC}"
85
+ return 1
86
+ fi
87
+
88
+ # Check if it starts or ends with hyphen
89
+ if [[ "$name" =~ ^- ]] || [[ "$name" =~ -$ ]]; then
90
+ echo -e "${RED}Error: Skill name cannot start or end with hyphen${NC}"
91
+ return 1
92
+ fi
93
+
94
+ return 0
95
+ }
96
+
97
+ # Validate the skill name
98
+ if ! validate_name "$SKILL_NAME"; then
99
+ echo ""
100
+ echo "Skill name requirements:"
101
+ echo " - Maximum 64 characters"
102
+ echo " - Lowercase letters (a-z)"
103
+ echo " - Numbers (0-9)"
104
+ echo " - Hyphens (-) as separators"
105
+ echo " - Cannot contain 'anthropic' or 'claude'"
106
+ echo " - Cannot start/end with hyphen"
107
+ exit 1
108
+ fi
109
+
110
+ # Determine skill directory (assuming .claude/skills/ structure)
111
+ # Search upward for .claude directory
112
+ CURRENT_DIR="$(pwd)"
113
+ CLAUDE_DIR=""
114
+
115
+ while [ "$CURRENT_DIR" != "/" ]; do
116
+ if [ -d "$CURRENT_DIR/.claude/skills" ]; then
117
+ CLAUDE_DIR="$CURRENT_DIR/.claude/skills"
118
+ break
119
+ fi
120
+ CURRENT_DIR="$(dirname "$CURRENT_DIR")"
121
+ done
122
+
123
+ if [ -z "$CLAUDE_DIR" ]; then
124
+ # Default to creating in current directory's .claude/skills
125
+ CLAUDE_DIR="$(pwd)/.claude/skills"
126
+ echo -e "${YELLOW}Warning: .claude/skills directory not found, will create at: $CLAUDE_DIR${NC}"
127
+ fi
128
+
129
+ SKILL_DIR="$CLAUDE_DIR/$SKILL_NAME"
130
+
131
+ # Check if skill already exists
132
+ if [ -d "$SKILL_DIR" ]; then
133
+ echo -e "${RED}Error: Skill directory already exists: $SKILL_DIR${NC}"
134
+ exit 1
135
+ fi
136
+
137
+ # Prompt for description
138
+ echo ""
139
+ echo -e "${GREEN}Creating skill: $SKILL_NAME${NC}"
140
+ echo "Template: $TEMPLATE"
141
+ echo ""
142
+ echo "Enter skill description (max 1024 characters):"
143
+ echo "Include WHAT the skill does and WHEN to use it (trigger keywords)"
144
+ echo ""
145
+ read -p "> " DESCRIPTION
146
+
147
+ # Validate description
148
+ if [ -z "$DESCRIPTION" ]; then
149
+ echo -e "${RED}Error: Description cannot be empty${NC}"
150
+ exit 1
151
+ fi
152
+
153
+ if [ ${#DESCRIPTION} -gt 1024 ]; then
154
+ echo -e "${RED}Error: Description must be ≤1024 characters (got ${#DESCRIPTION})${NC}"
155
+ exit 1
156
+ fi
157
+
158
+ # Create skill directory
159
+ echo ""
160
+ echo "Creating directory: $SKILL_DIR"
161
+ mkdir -p "$SKILL_DIR"
162
+
163
+ # Load template
164
+ TEMPLATE_FILE="$TEMPLATES_DIR/${TEMPLATE}-skill.md"
165
+
166
+ if [ ! -f "$TEMPLATE_FILE" ]; then
167
+ echo -e "${RED}Error: Template file not found: $TEMPLATE_FILE${NC}"
168
+ rm -rf "$SKILL_DIR"
169
+ exit 1
170
+ fi
171
+
172
+ # Read template and replace placeholders
173
+ SKILL_CONTENT=$(cat "$TEMPLATE_FILE")
174
+
175
+ # Extract just the template content (everything from first ``` to last ```)
176
+ SKILL_CONTENT=$(echo "$SKILL_CONTENT" | sed -n '/^```yaml$/,/^```$/p' | sed '1d;$d')
177
+
178
+ # Replace placeholders
179
+ SKILL_CONTENT=$(echo "$SKILL_CONTENT" | sed "s/your-skill-name/$SKILL_NAME/g")
180
+ SKILL_CONTENT=$(echo "$SKILL_CONTENT" | sed "s|What this skill does and when to use it with trigger keywords|$DESCRIPTION|g")
181
+ SKILL_CONTENT=$(echo "$SKILL_CONTENT" | sed "s|domain-specific-skill|$SKILL_NAME|g")
182
+ SKILL_CONTENT=$(echo "$SKILL_CONTENT" | sed "s|Domain expertise and capabilities. Use when working with \[domain keywords\]|$DESCRIPTION|g")
183
+
184
+ # Write SKILL.md
185
+ SKILL_FILE="$SKILL_DIR/SKILL.md"
186
+ echo "$SKILL_CONTENT" > "$SKILL_FILE"
187
+
188
+ echo ""
189
+ echo -e "${GREEN}✓ Skill created successfully!${NC}"
190
+ echo ""
191
+ echo "Location: $SKILL_FILE"
192
+ echo ""
193
+ echo "Next steps:"
194
+ echo " 1. Edit $SKILL_FILE to add:"
195
+ echo " - Capabilities"
196
+ echo " - How to Use instructions"
197
+ echo " - Example Usage"
198
+ echo " - Best Practices"
199
+ echo " 2. Validate with: $SCRIPT_DIR/validate-skill.py $SKILL_FILE"
200
+ echo " 3. Test activation by asking Claude questions matching your keywords"
201
+ echo ""
202
+
203
+ # Optionally open in editor
204
+ if command -v code &> /dev/null; then
205
+ read -p "Open in VS Code? (y/N) " -n 1 -r
206
+ echo
207
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
208
+ code "$SKILL_FILE"
209
+ fi
210
+ fi