@codihaus/claude-skills 1.0.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 (46) hide show
  1. package/README.md +167 -0
  2. package/bin/cli.js +58 -0
  3. package/package.json +46 -0
  4. package/skills/_quality-attributes.md +392 -0
  5. package/skills/_registry.md +189 -0
  6. package/skills/debrief/SKILL.md +647 -0
  7. package/skills/debrief/references/change-request-template.md +124 -0
  8. package/skills/debrief/references/file-patterns.md +173 -0
  9. package/skills/debrief/references/group-codes.md +72 -0
  10. package/skills/debrief/references/research-queries.md +106 -0
  11. package/skills/debrief/references/use-case-template.md +141 -0
  12. package/skills/debrief/scripts/generate_questionnaire.py +195 -0
  13. package/skills/dev-arch/SKILL.md +747 -0
  14. package/skills/dev-changelog/SKILL.md +378 -0
  15. package/skills/dev-coding/SKILL.md +470 -0
  16. package/skills/dev-coding-backend/SKILL.md +361 -0
  17. package/skills/dev-coding-frontend/SKILL.md +534 -0
  18. package/skills/dev-coding-frontend/references/nextjs.md +477 -0
  19. package/skills/dev-review/SKILL.md +548 -0
  20. package/skills/dev-scout/SKILL.md +723 -0
  21. package/skills/dev-scout/references/feature-patterns.md +210 -0
  22. package/skills/dev-scout/references/file-patterns.md +252 -0
  23. package/skills/dev-scout/references/tech-detection.md +211 -0
  24. package/skills/dev-scout/scripts/scout-analyze.sh +280 -0
  25. package/skills/dev-specs/SKILL.md +577 -0
  26. package/skills/dev-specs/references/checklist.md +176 -0
  27. package/skills/dev-specs/references/spec-templates.md +460 -0
  28. package/skills/dev-test/SKILL.md +364 -0
  29. package/skills/utils/diagram/SKILL.md +205 -0
  30. package/skills/utils/diagram/references/common-errors.md +305 -0
  31. package/skills/utils/diagram/references/diagram-types.md +636 -0
  32. package/skills/utils/docs-graph/SKILL.md +204 -0
  33. package/skills/utils/gemini/SKILL.md +292 -0
  34. package/skills/utils/gemini/scripts/gemini-scan.py +340 -0
  35. package/skills/utils/gemini/scripts/setup.sh +169 -0
  36. package/src/commands/add.js +64 -0
  37. package/src/commands/doctor.js +179 -0
  38. package/src/commands/init.js +251 -0
  39. package/src/commands/list.js +88 -0
  40. package/src/commands/remove.js +60 -0
  41. package/src/commands/update.js +72 -0
  42. package/src/index.js +26 -0
  43. package/src/utils/config.js +272 -0
  44. package/src/utils/deps.js +599 -0
  45. package/src/utils/skills.js +253 -0
  46. package/templates/CLAUDE.md.template +58 -0
@@ -0,0 +1,280 @@
1
+ #!/bin/bash
2
+ #
3
+ # scout-analyze.sh - Codebase analysis with optional tool installation
4
+ # Usage: ./scout-analyze.sh [path] [--install] [--json]
5
+ #
6
+ # Options:
7
+ # --install Auto-install missing tools (requires sudo)
8
+ # --json Output as JSON for parsing
9
+ # --check Only check tools, don't analyze
10
+
11
+ TARGET_PATH="${1:-.}"
12
+ INSTALL_MODE=false
13
+ JSON_MODE=false
14
+ CHECK_ONLY=false
15
+
16
+ # Parse flags
17
+ for arg in "$@"; do
18
+ case $arg in
19
+ --install) INSTALL_MODE=true ;;
20
+ --json) JSON_MODE=true ;;
21
+ --check) CHECK_ONLY=true ;;
22
+ esac
23
+ done
24
+
25
+ # Colors (disabled in JSON mode)
26
+ if [ "$JSON_MODE" = false ]; then
27
+ RED='\033[0;31m'
28
+ GREEN='\033[0;32m'
29
+ YELLOW='\033[1;33m'
30
+ BLUE='\033[0;34m'
31
+ NC='\033[0m'
32
+ else
33
+ RED='' GREEN='' YELLOW='' BLUE='' NC=''
34
+ fi
35
+
36
+ # Tool definitions: name|check_cmd|install_cmd|fallback
37
+ TOOLS=(
38
+ "tree|tree --version|sudo apt-get install -y tree|find . -type d"
39
+ "scc|scc --version|go install github.com/boyter/scc/v3@latest|wc -l"
40
+ "jq|jq --version|sudo apt-get install -y jq|cat"
41
+ "rg|rg --version|sudo apt-get install -y ripgrep|grep -r"
42
+ )
43
+
44
+ declare -A TOOL_STATUS
45
+ declare -A TOOL_FALLBACK
46
+
47
+ # Check which tools are available
48
+ check_tools() {
49
+ echo -e "${BLUE}Checking available tools...${NC}"
50
+
51
+ local missing=0
52
+ for tool_def in "${TOOLS[@]}"; do
53
+ IFS='|' read -r name check_cmd install_cmd fallback <<< "$tool_def"
54
+
55
+ if command -v "$name" &> /dev/null; then
56
+ TOOL_STATUS[$name]="installed"
57
+ echo -e " ${GREEN}✓${NC} $name"
58
+ else
59
+ TOOL_STATUS[$name]="missing"
60
+ TOOL_FALLBACK[$name]="$fallback"
61
+ echo -e " ${RED}✗${NC} $name (fallback: $fallback)"
62
+ ((missing++))
63
+ fi
64
+ done
65
+
66
+ # Check git
67
+ if command -v git &> /dev/null && [ -d "$TARGET_PATH/.git" ]; then
68
+ TOOL_STATUS["git"]="installed"
69
+ echo -e " ${GREEN}✓${NC} git (repo detected)"
70
+ else
71
+ TOOL_STATUS["git"]="unavailable"
72
+ echo -e " ${YELLOW}○${NC} git (not a repo or not installed)"
73
+ fi
74
+
75
+ echo ""
76
+ # Don't return missing count as exit code
77
+ return 0
78
+ }
79
+
80
+ # Offer to install missing tools
81
+ offer_install() {
82
+ local missing_tools=()
83
+
84
+ for tool_def in "${TOOLS[@]}"; do
85
+ IFS='|' read -r name check_cmd install_cmd fallback <<< "$tool_def"
86
+ if [ "${TOOL_STATUS[$name]}" = "missing" ]; then
87
+ missing_tools+=("$name")
88
+ fi
89
+ done
90
+
91
+ if [ ${#missing_tools[@]} -eq 0 ]; then
92
+ return 0
93
+ fi
94
+
95
+ echo -e "${YELLOW}Missing tools: ${missing_tools[*]}${NC}"
96
+ echo ""
97
+ echo "These tools provide better/faster analysis:"
98
+ echo " - tree: Visual directory structure"
99
+ echo " - scc: Fast code statistics (lines, languages, complexity)"
100
+ echo " - jq: Parse package.json, tsconfig.json"
101
+ echo " - rg: Faster search with context"
102
+ echo ""
103
+
104
+ if [ "$INSTALL_MODE" = true ]; then
105
+ echo "Installing missing tools..."
106
+ install_tools
107
+ else
108
+ echo "Run with --install to install, or continue with fallbacks."
109
+ echo "Example: ./scout-analyze.sh . --install"
110
+ fi
111
+ }
112
+
113
+ # Install missing tools
114
+ install_tools() {
115
+ for tool_def in "${TOOLS[@]}"; do
116
+ IFS='|' read -r name check_cmd install_cmd fallback <<< "$tool_def"
117
+
118
+ if [ "${TOOL_STATUS[$name]}" = "missing" ]; then
119
+ echo -e "Installing $name..."
120
+ if eval "$install_cmd" 2>/dev/null; then
121
+ TOOL_STATUS[$name]="installed"
122
+ echo -e " ${GREEN}✓${NC} $name installed"
123
+ else
124
+ echo -e " ${RED}✗${NC} Failed to install $name, using fallback"
125
+ fi
126
+ fi
127
+ done
128
+ }
129
+
130
+ # Run analysis
131
+ run_analysis() {
132
+ cd "$TARGET_PATH"
133
+
134
+ echo -e "${BLUE}═══════════════════════════════════════${NC}"
135
+ echo -e "${BLUE} Codebase Analysis: $(basename $(pwd))${NC}"
136
+ echo -e "${BLUE}═══════════════════════════════════════${NC}"
137
+ echo ""
138
+
139
+ # 1. Basic stats
140
+ echo -e "${GREEN}## File Overview${NC}"
141
+ total_files=$(find . -type f ! -path './node_modules/*' ! -path './.git/*' ! -path './dist/*' ! -path './build/*' ! -path './.next/*' | wc -l)
142
+ total_dirs=$(find . -type d ! -path './node_modules/*' ! -path './.git/*' ! -path './dist/*' ! -path './build/*' ! -path './.next/*' | wc -l)
143
+ echo "Total files: $total_files"
144
+ echo "Total directories: $total_dirs"
145
+ echo ""
146
+
147
+ # 2. Directory structure
148
+ echo -e "${GREEN}## Directory Structure${NC}"
149
+ if [ "${TOOL_STATUS[tree]}" = "installed" ]; then
150
+ tree -L 2 -d --noreport -I 'node_modules|.git|dist|build|.next|__pycache__|venv' 2>/dev/null || echo "(tree failed)"
151
+ else
152
+ echo "(tree not installed, using find)"
153
+ find . -maxdepth 2 -type d ! -path './node_modules/*' ! -path './.git/*' ! -path './dist/*' | head -30
154
+ fi
155
+ echo ""
156
+
157
+ # 3. Code statistics
158
+ echo -e "${GREEN}## Code Statistics${NC}"
159
+ if [ "${TOOL_STATUS[scc]}" = "installed" ]; then
160
+ scc --no-cocomo --no-complexity -s lines . 2>/dev/null | head -30 || echo "(scc failed)"
161
+ else
162
+ echo "(scc not installed, basic count)"
163
+ echo "Lines by extension:"
164
+ find . -type f ! -path './node_modules/*' ! -path './.git/*' -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.jsx' -o -name '*.vue' -o -name '*.py' 2>/dev/null | head -100 | xargs wc -l 2>/dev/null | tail -1 || echo "0 total"
165
+ fi
166
+ echo ""
167
+
168
+ # 4. File types
169
+ echo -e "${GREEN}## File Types${NC}"
170
+ echo "Top 10 extensions:"
171
+ find . -type f ! -path './node_modules/*' ! -path './.git/*' ! -path './dist/*' | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -10
172
+ echo ""
173
+
174
+ # 5. Package info
175
+ echo -e "${GREEN}## Dependencies${NC}"
176
+ if [ -f "package.json" ]; then
177
+ echo "Node.js project detected"
178
+ if [ "${TOOL_STATUS[jq]}" = "installed" ]; then
179
+ echo "Dependencies: $(jq -r '.dependencies // {} | keys | length' package.json 2>/dev/null || echo "?")"
180
+ echo "Dev dependencies: $(jq -r '.devDependencies // {} | keys | length' package.json 2>/dev/null || echo "?")"
181
+ echo ""
182
+ echo "Key dependencies:"
183
+ jq -r '.dependencies // {} | keys[]' package.json 2>/dev/null | head -10
184
+ else
185
+ echo "(jq not installed, raw package.json)"
186
+ grep -E '"(dependencies|devDependencies)"' -A 5 package.json | head -15
187
+ fi
188
+ elif [ -f "requirements.txt" ]; then
189
+ echo "Python project detected"
190
+ echo "Dependencies: $(wc -l < requirements.txt)"
191
+ head -10 requirements.txt
192
+ elif [ -f "go.mod" ]; then
193
+ echo "Go project detected"
194
+ grep -E "^require" -A 10 go.mod | head -12
195
+ else
196
+ echo "No standard package file found"
197
+ fi
198
+ echo ""
199
+
200
+ # 6. Git info
201
+ if [ "${TOOL_STATUS[git]}" = "installed" ]; then
202
+ echo -e "${GREEN}## Git Activity${NC}"
203
+ echo "Recent commits:"
204
+ git log --oneline -10 2>/dev/null || echo "(no commits)"
205
+ echo ""
206
+ echo "Recently modified files:"
207
+ git log --since="2 weeks ago" --name-only --pretty=format: 2>/dev/null | sort | uniq -c | sort -rn | head -10 || echo "(no recent changes)"
208
+ echo ""
209
+ echo "Contributors:"
210
+ git shortlog -sn --no-merges 2>/dev/null | head -5 || echo "(no contributors)"
211
+ fi
212
+ echo ""
213
+
214
+ # 7. Config files detected
215
+ echo -e "${GREEN}## Config Files Detected${NC}"
216
+
217
+ # Check each config file explicitly
218
+ [ -f "next.config.js" ] || [ -f "next.config.mjs" ] || [ -f "next.config.ts" ] && echo " ✓ Next.js"
219
+ [ -f "nuxt.config.js" ] || [ -f "nuxt.config.ts" ] && echo " ✓ Nuxt.js"
220
+ [ -f "vite.config.js" ] || [ -f "vite.config.ts" ] && echo " ✓ Vite"
221
+ [ -f "tsconfig.json" ] && echo " ✓ TypeScript"
222
+ [ -f "prisma/schema.prisma" ] && echo " ✓ Prisma"
223
+ [ -f "docker-compose.yml" ] || [ -f "docker-compose.yaml" ] && echo " ✓ Docker Compose"
224
+ [ -f "Dockerfile" ] && echo " ✓ Docker"
225
+ [ -f ".env.example" ] || [ -f ".env.local" ] && echo " ✓ Environment config"
226
+ [ -f "tailwind.config.js" ] || [ -f "tailwind.config.ts" ] && echo " ✓ Tailwind CSS"
227
+ [ -f "package.json" ] && echo " ✓ Node.js (package.json)"
228
+ [ -f "requirements.txt" ] && echo " ✓ Python (requirements.txt)"
229
+ [ -f "go.mod" ] && echo " ✓ Go (go.mod)"
230
+ [ -f "Cargo.toml" ] && echo " ✓ Rust (Cargo.toml)"
231
+
232
+ echo ""
233
+
234
+ echo -e "${BLUE}═══════════════════════════════════════${NC}"
235
+ echo -e "${BLUE} Analysis complete${NC}"
236
+ echo -e "${BLUE}═══════════════════════════════════════${NC}"
237
+ }
238
+
239
+ # Output as JSON
240
+ run_analysis_json() {
241
+ cd "$TARGET_PATH"
242
+
243
+ cat << EOF
244
+ {
245
+ "path": "$(pwd)",
246
+ "files": $(find . -type f ! -path './node_modules/*' ! -path './.git/*' ! -path './dist/*' | wc -l),
247
+ "directories": $(find . -type d ! -path './node_modules/*' ! -path './.git/*' | wc -l),
248
+ "tools": {
249
+ "tree": "${TOOL_STATUS[tree]}",
250
+ "scc": "${TOOL_STATUS[scc]}",
251
+ "jq": "${TOOL_STATUS[jq]}",
252
+ "rg": "${TOOL_STATUS[rg]}",
253
+ "git": "${TOOL_STATUS[git]}"
254
+ },
255
+ "has_package_json": $([ -f "package.json" ] && echo "true" || echo "false"),
256
+ "has_requirements_txt": $([ -f "requirements.txt" ] && echo "true" || echo "false"),
257
+ "is_git_repo": $([ -d ".git" ] && echo "true" || echo "false")
258
+ }
259
+ EOF
260
+ }
261
+
262
+ # Main
263
+ main() {
264
+ check_tools
265
+
266
+ if [ "$CHECK_ONLY" = true ]; then
267
+ offer_install
268
+ exit 0
269
+ fi
270
+
271
+ if [ "$JSON_MODE" = true ]; then
272
+ run_analysis_json
273
+ else
274
+ offer_install
275
+ echo ""
276
+ run_analysis
277
+ fi
278
+ }
279
+
280
+ main