claude-termux 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 (99) hide show
  1. package/CLAUDE.md +60 -0
  2. package/GEMINI.md +20 -0
  3. package/README.md +135 -0
  4. package/TERMUX.md +204 -0
  5. package/agents/accessibility-reviewer.md +96 -0
  6. package/agents/ai-prompt-optimizer.md +94 -0
  7. package/agents/api-tester.md +102 -0
  8. package/agents/code-generator.md +94 -0
  9. package/agents/code-reviewer.md +47 -0
  10. package/agents/component-generator.md +102 -0
  11. package/agents/doc-generator.md +91 -0
  12. package/agents/migration-generator.md +94 -0
  13. package/agents/performance-analyzer.md +90 -0
  14. package/agents/proactive-mode.md +91 -0
  15. package/agents/readme-generator.md +101 -0
  16. package/agents/security-auditor.md +86 -0
  17. package/agents/terraform-generator.md +94 -0
  18. package/agents/test-generator.md +76 -0
  19. package/commands/brainstorm.md +5 -0
  20. package/commands/execute-plan.md +5 -0
  21. package/commands/write-plan.md +5 -0
  22. package/hooks/auto-context.json +31 -0
  23. package/hooks/hooks.json +15 -0
  24. package/hooks/run-hook.cmd +19 -0
  25. package/hooks/session-start.sh +52 -0
  26. package/hooks/smart-session.sh +96 -0
  27. package/install.sh +210 -0
  28. package/lib/skills-core.js +208 -0
  29. package/mcp.json +34 -0
  30. package/package.json +49 -0
  31. package/plugins/README.md +47 -0
  32. package/plugins/installed_plugins.json +5 -0
  33. package/plugins/known_marketplaces.json +10 -0
  34. package/plugins/marketplace-info/marketplace.json +517 -0
  35. package/postinstall.js +238 -0
  36. package/settings.json +27 -0
  37. package/settings.local.json +25 -0
  38. package/skills/api-development/SKILL.md +11 -0
  39. package/skills/api-development/openapi/api-documentation.yaml +108 -0
  40. package/skills/brainstorming/SKILL.md +54 -0
  41. package/skills/code-quality/SKILL.md +196 -0
  42. package/skills/condition-based-waiting/SKILL.md +120 -0
  43. package/skills/condition-based-waiting/example.ts +158 -0
  44. package/skills/database-development/SKILL.md +11 -0
  45. package/skills/database-development/migrations/migration.template.sql +49 -0
  46. package/skills/defense-in-depth/SKILL.md +127 -0
  47. package/skills/deployment/SKILL.md +11 -0
  48. package/skills/deployment/ci-cd/github-actions.yml +95 -0
  49. package/skills/deployment/docker/Dockerfile.template +39 -0
  50. package/skills/dispatching-parallel-agents/SKILL.md +180 -0
  51. package/skills/documentation-generation/SKILL.md +8 -0
  52. package/skills/documentation-generation/templates/README.template.md +60 -0
  53. package/skills/error-handling/SKILL.md +267 -0
  54. package/skills/executing-plans/SKILL.md +76 -0
  55. package/skills/finishing-a-development-branch/SKILL.md +200 -0
  56. package/skills/frontend-design/frontend-design/SKILL.md +42 -0
  57. package/skills/integration-testing/SKILL.md +13 -0
  58. package/skills/integration-testing/examples/contract-test.py +317 -0
  59. package/skills/integration-testing/examples/e2e-test.js +147 -0
  60. package/skills/integration-testing/examples/test-isolation.md +94 -0
  61. package/skills/logging-monitoring/SKILL.md +66 -0
  62. package/skills/mobile-development/SKILL.md +11 -0
  63. package/skills/mobile-development/responsive/responsive.css +80 -0
  64. package/skills/performance-optimization/SKILL.md +9 -0
  65. package/skills/performance-optimization/profiling/profile.template.js +21 -0
  66. package/skills/receiving-code-review/SKILL.md +209 -0
  67. package/skills/refactoring/SKILL.md +11 -0
  68. package/skills/refactoring/code-smells/common-smells.md +115 -0
  69. package/skills/requesting-code-review/SKILL.md +105 -0
  70. package/skills/requesting-code-review/code-reviewer.md +146 -0
  71. package/skills/root-cause-tracing/SKILL.md +174 -0
  72. package/skills/root-cause-tracing/find-polluter.sh +63 -0
  73. package/skills/security-review/SKILL.md +11 -0
  74. package/skills/security-review/checklists/owasp-checklist.md +31 -0
  75. package/skills/sharing-skills/SKILL.md +194 -0
  76. package/skills/subagent-driven-development/SKILL.md +240 -0
  77. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
  78. package/skills/subagent-driven-development/implementer-prompt.md +78 -0
  79. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  80. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  81. package/skills/systematic-debugging/SKILL.md +295 -0
  82. package/skills/systematic-debugging/test-academic.md +14 -0
  83. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  84. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  85. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  86. package/skills/test-driven-development/SKILL.md +364 -0
  87. package/skills/testing-anti-patterns/SKILL.md +302 -0
  88. package/skills/testing-skills-with-subagents/SKILL.md +387 -0
  89. package/skills/testing-skills-with-subagents/examples/CLAUDE_MD_TESTING.md +189 -0
  90. package/skills/ui-ux-review/SKILL.md +13 -0
  91. package/skills/ui-ux-review/checklists/ux-heuristics.md +61 -0
  92. package/skills/using-git-worktrees/SKILL.md +213 -0
  93. package/skills/using-superpowers/SKILL.md +101 -0
  94. package/skills/verification-before-completion/SKILL.md +139 -0
  95. package/skills/writing-plans/SKILL.md +116 -0
  96. package/skills/writing-skills/SKILL.md +622 -0
  97. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  98. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  99. package/skills/writing-skills/persuasion-principles.md +187 -0
@@ -0,0 +1,96 @@
1
+ #!/bin/bash
2
+ # Smart Session Manager Hook
3
+ # Auto-loads project context and saves session insights
4
+
5
+ EVENT_TYPE="$1"
6
+ TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
7
+ PROJECT_DIR="$(pwd)"
8
+ SESSION_ID="${TIMESTAMP}_$$"
9
+
10
+ # Colors for output
11
+ GREEN='\033[0;32m'
12
+ BLUE='\033[0;34m'
13
+ YELLOW='\033[1;33m'
14
+ NC='\033[0m' # No Color
15
+
16
+ case "$EVENT_TYPE" in
17
+ SessionStart)
18
+ echo -e "${GREEN}📂 Hook: SessionStart triggered${NC}"
19
+ echo -e "${BLUE}Time:${NC} $TIMESTAMP"
20
+ echo -e "${BLUE}Project:${NC} $PROJECT_DIR"
21
+ echo ""
22
+
23
+ # Check for CLAUDE-PROJECT.md in current directory
24
+ if [ -f "$PROJECT_DIR/CLAUDE-PROJECT.md" ]; then
25
+ echo -e "${GREEN}✅ Found CLAUDE-PROJECT.md${NC}"
26
+ echo -e "${YELLOW}📝 Project-specific instructions loaded!${NC}"
27
+ echo ""
28
+
29
+ # Display project context preview
30
+ echo -e "${BLUE}═══════════════════════════════════════════════════${NC}"
31
+ echo -e "${BLUE}Project Context Preview:${NC}"
32
+ echo -e "${BLUE}═══════════════════════════════════════════════════${NC}"
33
+ head -20 "$PROJECT_DIR/CLAUDE-PROJECT.md"
34
+ echo -e "${BLUE}═══════════════════════════════════════════════════${NC}"
35
+ echo ""
36
+
37
+ else
38
+ echo -e "${YELLOW}⚠️ No CLAUDE-PROJECT.md found${NC}"
39
+ echo -e "${YELLOW}Using global ~/.claude/CLAUDE.md instructions${NC}"
40
+ echo ""
41
+
42
+ # Suggest creating CLAUDE-PROJECT.md
43
+ echo -e "${BLUE}💡 Tip: Create CLAUDE-PROJECT.md for project-specific instructions${NC}"
44
+ echo ""
45
+ fi
46
+
47
+ # Check for project-specific MCP config
48
+ if [ -f "$PROJECT_DIR/.mcp.json" ]; then
49
+ echo -e "${GREEN}✅ Found project-specific .mcp.json${NC}"
50
+ echo -e "${YELLOW}🔧 Project MCP servers will be used${NC}"
51
+ echo ""
52
+ fi
53
+
54
+ # Session log file
55
+ SESSION_LOG="$HOME/.claude/sessions/session_${SESSION_ID}.log"
56
+ mkdir -p "$HOME/.claude/sessions"
57
+ echo "Session started: $TIMESTAMP" > "$SESSION_LOG"
58
+ echo "Project: $PROJECT_DIR" >> "$SESSION_LOG"
59
+ echo "" >> "$SESSION_LOG"
60
+
61
+ echo -e "${GREEN}🎉 Session initialized!${NC}"
62
+ echo ""
63
+
64
+ ;;
65
+
66
+ SessionStop)
67
+ echo -e "${GREEN}📂 Hook: SessionStop triggered${NC}"
68
+ echo -e "${BLUE}Time:${NC} $TIMESTAMP"
69
+ echo ""
70
+
71
+ # Update session log
72
+ SESSION_LOG="$HOME/.claude/sessions/session_${SESSION_ID}.log"
73
+ if [ -f "$SESSION_LOG" ]; then
74
+ echo "Session ended: $TIMESTAMP" >> "$SESSION_LOG"
75
+ echo -e "${GREEN}✅ Session log saved${NC}"
76
+ echo -e "${BLUE}Location:${NC} $SESSION_LOG"
77
+ fi
78
+
79
+ # Auto-save memory suggestion
80
+ echo ""
81
+ echo -e "${BLUE}💡 Consider saving important context to Memory MCP before leaving!${NC}"
82
+ echo -e "${YELLOW}Example: 'Ingat ya, project ini pakai TypeScript strict mode'${NC}"
83
+ echo ""
84
+
85
+ echo -e "${GREEN}👋 Session ended successfully!${NC}"
86
+ echo ""
87
+
88
+ ;;
89
+
90
+ *)
91
+ echo -e "${YELLOW}⚠️ Unknown event: $EVENT_TYPE${NC}"
92
+ exit 1
93
+ ;;
94
+ esac
95
+
96
+ exit 0
package/install.sh ADDED
@@ -0,0 +1,210 @@
1
+ #!/bin/bash
2
+
3
+ # Claude Termux - AI CLI Configuration for Android
4
+ # https://github.com/zesbe/termux-config
5
+
6
+ set -e
7
+
8
+ GREEN='\033[0;32m'
9
+ BLUE='\033[0;34m'
10
+ YELLOW='\033[1;33m'
11
+ RED='\033[0;31m'
12
+ NC='\033[0m' # No Color
13
+
14
+ echo -e "${BLUE}"
15
+ echo "╔═══════════════════════════════════════════════════════════╗"
16
+ echo "║ Claude Termux - AI CLI Config for Android ║"
17
+ echo "║ https://github.com/zesbe ║"
18
+ echo "╚═══════════════════════════════════════════════════════════╝"
19
+ echo -e "${NC}"
20
+
21
+ # Detect if running in Termux
22
+ IS_TERMUX=false
23
+ if [ -d "/data/data/com.termux" ]; then
24
+ IS_TERMUX=true
25
+ HOME_DIR="/data/data/com.termux/files/home"
26
+ echo -e "${GREEN}✓ Termux detected${NC}"
27
+ else
28
+ HOME_DIR="$HOME"
29
+ echo -e "${YELLOW}! Not running in Termux, using standard paths${NC}"
30
+ fi
31
+
32
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33
+ CLAUDE_DIR="$HOME_DIR/.claude"
34
+ GEMINI_DIR="$HOME_DIR/.gemini"
35
+
36
+ # Check if Claude Code is installed
37
+ CLAUDE_INSTALLED=false
38
+ if command -v claude &> /dev/null; then
39
+ CLAUDE_INSTALLED=true
40
+ echo -e "${GREEN}✓ Claude Code found${NC}"
41
+ else
42
+ echo -e "${YELLOW}! Claude Code not found (install with: npm i -g @anthropic-ai/claude-code)${NC}"
43
+ fi
44
+
45
+ # Check if Gemini CLI is installed
46
+ GEMINI_INSTALLED=false
47
+ if command -v gemini &> /dev/null; then
48
+ GEMINI_INSTALLED=true
49
+ echo -e "${GREEN}✓ Gemini CLI found${NC}"
50
+ else
51
+ echo -e "${YELLOW}! Gemini CLI not found (install with: npm i -g @google/gemini-cli)${NC}"
52
+ fi
53
+
54
+ if [ "$CLAUDE_INSTALLED" = false ] && [ "$GEMINI_INSTALLED" = false ]; then
55
+ echo -e "${RED}✗ Neither Claude Code nor Gemini CLI is installed${NC}"
56
+ echo -e "${YELLOW}Please install at least one:${NC}"
57
+ echo " npm install -g @anthropic-ai/claude-code"
58
+ echo " npm install -g @google/gemini-cli"
59
+ exit 1
60
+ fi
61
+
62
+ echo ""
63
+ echo -e "${BLUE}Installing configurations...${NC}"
64
+
65
+ # Install for Claude Code
66
+ if [ "$CLAUDE_INSTALLED" = true ]; then
67
+ echo -e "${BLUE}→ Installing Claude Code superpowers...${NC}"
68
+
69
+ mkdir -p "$CLAUDE_DIR"/{agents,skills,commands,hooks,plugins}
70
+
71
+ # Copy agents
72
+ if [ -d "$SCRIPT_DIR/agents" ]; then
73
+ cp -r "$SCRIPT_DIR/agents/"* "$CLAUDE_DIR/agents/" 2>/dev/null || true
74
+ AGENT_COUNT=$(ls -1 "$CLAUDE_DIR/agents/" 2>/dev/null | wc -l)
75
+ echo -e " ${GREEN}✓ Agents: $AGENT_COUNT installed${NC}"
76
+ fi
77
+
78
+ # Copy skills
79
+ if [ -d "$SCRIPT_DIR/skills" ]; then
80
+ cp -r "$SCRIPT_DIR/skills/"* "$CLAUDE_DIR/skills/" 2>/dev/null || true
81
+ SKILL_COUNT=$(ls -1 "$CLAUDE_DIR/skills/" 2>/dev/null | wc -l)
82
+ echo -e " ${GREEN}✓ Skills: $SKILL_COUNT installed${NC}"
83
+ fi
84
+
85
+ # Copy commands
86
+ if [ -d "$SCRIPT_DIR/commands" ]; then
87
+ cp -r "$SCRIPT_DIR/commands/"* "$CLAUDE_DIR/commands/" 2>/dev/null || true
88
+ CMD_COUNT=$(ls -1 "$CLAUDE_DIR/commands/" 2>/dev/null | wc -l)
89
+ echo -e " ${GREEN}✓ Commands: $CMD_COUNT installed${NC}"
90
+ fi
91
+
92
+ # Copy hooks
93
+ if [ -d "$SCRIPT_DIR/hooks" ]; then
94
+ cp -r "$SCRIPT_DIR/hooks/"* "$CLAUDE_DIR/hooks/" 2>/dev/null || true
95
+ echo -e " ${GREEN}✓ Hooks installed${NC}"
96
+ fi
97
+
98
+ # Copy plugins
99
+ if [ -d "$SCRIPT_DIR/plugins" ]; then
100
+ cp -r "$SCRIPT_DIR/plugins/"* "$CLAUDE_DIR/plugins/" 2>/dev/null || true
101
+ echo -e " ${GREEN}✓ Plugins installed${NC}"
102
+ fi
103
+
104
+ # Copy lib
105
+ if [ -d "$SCRIPT_DIR/lib" ]; then
106
+ mkdir -p "$CLAUDE_DIR/lib"
107
+ cp -r "$SCRIPT_DIR/lib/"* "$CLAUDE_DIR/lib/" 2>/dev/null || true
108
+ echo -e " ${GREEN}✓ Lib installed${NC}"
109
+ fi
110
+
111
+ # Copy CLAUDE.md
112
+ if [ -f "$SCRIPT_DIR/CLAUDE.md" ]; then
113
+ cp "$SCRIPT_DIR/CLAUDE.md" "$CLAUDE_DIR/CLAUDE.md"
114
+ echo -e " ${GREEN}✓ CLAUDE.md installed${NC}"
115
+ fi
116
+
117
+ # Copy settings.local.json
118
+ if [ -f "$SCRIPT_DIR/settings.local.json" ]; then
119
+ cp "$SCRIPT_DIR/settings.local.json" "$CLAUDE_DIR/settings.local.json"
120
+ echo -e " ${GREEN}✓ Bypass permissions configured${NC}"
121
+ fi
122
+
123
+ # Copy MCP config to home
124
+ if [ -f "$SCRIPT_DIR/mcp.json" ]; then
125
+ cp "$SCRIPT_DIR/mcp.json" "$HOME_DIR/.mcp.json"
126
+ chmod 600 "$HOME_DIR/.mcp.json"
127
+ echo -e " ${GREEN}✓ MCP servers configured (6 servers)${NC}"
128
+ fi
129
+ fi
130
+
131
+ # Install for Gemini CLI
132
+ if [ "$GEMINI_INSTALLED" = true ]; then
133
+ echo -e "${BLUE}→ Installing Gemini CLI superpowers...${NC}"
134
+
135
+ mkdir -p "$GEMINI_DIR/superpowers"/{agents,skills,commands,hooks,lib}
136
+
137
+ # Copy agents
138
+ if [ -d "$SCRIPT_DIR/agents" ]; then
139
+ cp -r "$SCRIPT_DIR/agents/"* "$GEMINI_DIR/superpowers/agents/" 2>/dev/null || true
140
+ AGENT_COUNT=$(ls -1 "$GEMINI_DIR/superpowers/agents/" 2>/dev/null | wc -l)
141
+ echo -e " ${GREEN}✓ Agents: $AGENT_COUNT installed${NC}"
142
+ fi
143
+
144
+ # Copy skills
145
+ if [ -d "$SCRIPT_DIR/skills" ]; then
146
+ cp -r "$SCRIPT_DIR/skills/"* "$GEMINI_DIR/superpowers/skills/" 2>/dev/null || true
147
+ SKILL_COUNT=$(ls -1 "$GEMINI_DIR/superpowers/skills/" 2>/dev/null | wc -l)
148
+ echo -e " ${GREEN}✓ Skills: $SKILL_COUNT installed${NC}"
149
+ fi
150
+
151
+ # Copy commands
152
+ if [ -d "$SCRIPT_DIR/commands" ]; then
153
+ cp -r "$SCRIPT_DIR/commands/"* "$GEMINI_DIR/superpowers/commands/" 2>/dev/null || true
154
+ CMD_COUNT=$(ls -1 "$GEMINI_DIR/superpowers/commands/" 2>/dev/null | wc -l)
155
+ echo -e " ${GREEN}✓ Commands: $CMD_COUNT installed${NC}"
156
+ fi
157
+
158
+ # Copy hooks
159
+ if [ -d "$SCRIPT_DIR/hooks" ]; then
160
+ cp -r "$SCRIPT_DIR/hooks/"* "$GEMINI_DIR/superpowers/hooks/" 2>/dev/null || true
161
+ echo -e " ${GREEN}✓ Hooks installed${NC}"
162
+ fi
163
+
164
+ # Copy lib
165
+ if [ -d "$SCRIPT_DIR/lib" ]; then
166
+ cp -r "$SCRIPT_DIR/lib/"* "$GEMINI_DIR/superpowers/lib/" 2>/dev/null || true
167
+ echo -e " ${GREEN}✓ Lib installed${NC}"
168
+ fi
169
+
170
+ # Copy GEMINI.md
171
+ if [ -f "$SCRIPT_DIR/GEMINI.md" ]; then
172
+ cp "$SCRIPT_DIR/GEMINI.md" "$GEMINI_DIR/GEMINI.md"
173
+ echo -e " ${GREEN}✓ GEMINI.md installed${NC}"
174
+ fi
175
+
176
+ # Copy settings.json (YOLO mode)
177
+ if [ -f "$SCRIPT_DIR/settings.json" ]; then
178
+ cp "$SCRIPT_DIR/settings.json" "$GEMINI_DIR/settings.json"
179
+ echo -e " ${GREEN}✓ YOLO mode configured${NC}"
180
+ fi
181
+
182
+ # Copy MCP config
183
+ if [ -f "$SCRIPT_DIR/mcp.json" ]; then
184
+ cp "$SCRIPT_DIR/mcp.json" "$GEMINI_DIR/mcp.json"
185
+ chmod 600 "$GEMINI_DIR/mcp.json"
186
+ echo -e " ${GREEN}✓ MCP servers configured (6 servers)${NC}"
187
+ fi
188
+ fi
189
+
190
+ echo ""
191
+ echo -e "${GREEN}╔═══════════════════════════════════════════════════════════╗"
192
+ echo -e "║ Installation Complete! ║"
193
+ echo -e "╚═══════════════════════════════════════════════════════════╝${NC}"
194
+ echo ""
195
+
196
+ if [ "$CLAUDE_INSTALLED" = true ]; then
197
+ echo -e "${BLUE}Claude Code:${NC}"
198
+ echo " Run: claude"
199
+ echo " Bypass mode: claude --dangerously-skip-permissions"
200
+ fi
201
+
202
+ if [ "$GEMINI_INSTALLED" = true ]; then
203
+ echo -e "${BLUE}Gemini CLI:${NC}"
204
+ echo " Run: gemini"
205
+ echo " YOLO mode: gemini --yolo"
206
+ fi
207
+
208
+ echo ""
209
+ echo -e "${YELLOW}Documentation: ~/.claude/TERMUX.md${NC}"
210
+ echo -e "${YELLOW}GitHub: https://github.com/zesbe/termux-config${NC}"
@@ -0,0 +1,208 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { execSync } from 'child_process';
4
+
5
+ /**
6
+ * Extract YAML frontmatter from a skill file.
7
+ * Current format:
8
+ * ---
9
+ * name: skill-name
10
+ * description: Use when [condition] - [what it does]
11
+ * ---
12
+ *
13
+ * @param {string} filePath - Path to SKILL.md file
14
+ * @returns {{name: string, description: string}}
15
+ */
16
+ function extractFrontmatter(filePath) {
17
+ try {
18
+ const content = fs.readFileSync(filePath, 'utf8');
19
+ const lines = content.split('\n');
20
+
21
+ let inFrontmatter = false;
22
+ let name = '';
23
+ let description = '';
24
+
25
+ for (const line of lines) {
26
+ if (line.trim() === '---') {
27
+ if (inFrontmatter) break;
28
+ inFrontmatter = true;
29
+ continue;
30
+ }
31
+
32
+ if (inFrontmatter) {
33
+ const match = line.match(/^(\w+):\s*(.*)$/);
34
+ if (match) {
35
+ const [, key, value] = match;
36
+ switch (key) {
37
+ case 'name':
38
+ name = value.trim();
39
+ break;
40
+ case 'description':
41
+ description = value.trim();
42
+ break;
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ return { name, description };
49
+ } catch (error) {
50
+ return { name: '', description: '' };
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Find all SKILL.md files in a directory recursively.
56
+ *
57
+ * @param {string} dir - Directory to search
58
+ * @param {string} sourceType - 'personal' or 'superpowers' for namespacing
59
+ * @param {number} maxDepth - Maximum recursion depth (default: 3)
60
+ * @returns {Array<{path: string, name: string, description: string, sourceType: string}>}
61
+ */
62
+ function findSkillsInDir(dir, sourceType, maxDepth = 3) {
63
+ const skills = [];
64
+
65
+ if (!fs.existsSync(dir)) return skills;
66
+
67
+ function recurse(currentDir, depth) {
68
+ if (depth > maxDepth) return;
69
+
70
+ const entries = fs.readdirSync(currentDir, { withFileTypes: true });
71
+
72
+ for (const entry of entries) {
73
+ const fullPath = path.join(currentDir, entry.name);
74
+
75
+ if (entry.isDirectory()) {
76
+ // Check for SKILL.md in this directory
77
+ const skillFile = path.join(fullPath, 'SKILL.md');
78
+ if (fs.existsSync(skillFile)) {
79
+ const { name, description } = extractFrontmatter(skillFile);
80
+ skills.push({
81
+ path: fullPath,
82
+ skillFile: skillFile,
83
+ name: name || entry.name,
84
+ description: description || '',
85
+ sourceType: sourceType
86
+ });
87
+ }
88
+
89
+ // Recurse into subdirectories
90
+ recurse(fullPath, depth + 1);
91
+ }
92
+ }
93
+ }
94
+
95
+ recurse(dir, 0);
96
+ return skills;
97
+ }
98
+
99
+ /**
100
+ * Resolve a skill name to its file path, handling shadowing
101
+ * (personal skills override superpowers skills).
102
+ *
103
+ * @param {string} skillName - Name like "superpowers:brainstorming" or "my-skill"
104
+ * @param {string} superpowersDir - Path to superpowers skills directory
105
+ * @param {string} personalDir - Path to personal skills directory
106
+ * @returns {{skillFile: string, sourceType: string, skillPath: string} | null}
107
+ */
108
+ function resolveSkillPath(skillName, superpowersDir, personalDir) {
109
+ // Strip superpowers: prefix if present
110
+ const forceSuperpowers = skillName.startsWith('superpowers:');
111
+ const actualSkillName = forceSuperpowers ? skillName.replace(/^superpowers:/, '') : skillName;
112
+
113
+ // Try personal skills first (unless explicitly superpowers:)
114
+ if (!forceSuperpowers && personalDir) {
115
+ const personalPath = path.join(personalDir, actualSkillName);
116
+ const personalSkillFile = path.join(personalPath, 'SKILL.md');
117
+ if (fs.existsSync(personalSkillFile)) {
118
+ return {
119
+ skillFile: personalSkillFile,
120
+ sourceType: 'personal',
121
+ skillPath: actualSkillName
122
+ };
123
+ }
124
+ }
125
+
126
+ // Try superpowers skills
127
+ if (superpowersDir) {
128
+ const superpowersPath = path.join(superpowersDir, actualSkillName);
129
+ const superpowersSkillFile = path.join(superpowersPath, 'SKILL.md');
130
+ if (fs.existsSync(superpowersSkillFile)) {
131
+ return {
132
+ skillFile: superpowersSkillFile,
133
+ sourceType: 'superpowers',
134
+ skillPath: actualSkillName
135
+ };
136
+ }
137
+ }
138
+
139
+ return null;
140
+ }
141
+
142
+ /**
143
+ * Check if a git repository has updates available.
144
+ *
145
+ * @param {string} repoDir - Path to git repository
146
+ * @returns {boolean} - True if updates are available
147
+ */
148
+ function checkForUpdates(repoDir) {
149
+ try {
150
+ // Quick check with 3 second timeout to avoid delays if network is down
151
+ const output = execSync('git fetch origin && git status --porcelain=v1 --branch', {
152
+ cwd: repoDir,
153
+ timeout: 3000,
154
+ encoding: 'utf8',
155
+ stdio: 'pipe'
156
+ });
157
+
158
+ // Parse git status output to see if we're behind
159
+ const statusLines = output.split('\n');
160
+ for (const line of statusLines) {
161
+ if (line.startsWith('## ') && line.includes('[behind ')) {
162
+ return true; // We're behind remote
163
+ }
164
+ }
165
+ return false; // Up to date
166
+ } catch (error) {
167
+ // Network down, git error, timeout, etc. - don't block bootstrap
168
+ return false;
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Strip YAML frontmatter from skill content, returning just the content.
174
+ *
175
+ * @param {string} content - Full content including frontmatter
176
+ * @returns {string} - Content without frontmatter
177
+ */
178
+ function stripFrontmatter(content) {
179
+ const lines = content.split('\n');
180
+ let inFrontmatter = false;
181
+ let frontmatterEnded = false;
182
+ const contentLines = [];
183
+
184
+ for (const line of lines) {
185
+ if (line.trim() === '---') {
186
+ if (inFrontmatter) {
187
+ frontmatterEnded = true;
188
+ continue;
189
+ }
190
+ inFrontmatter = true;
191
+ continue;
192
+ }
193
+
194
+ if (frontmatterEnded || !inFrontmatter) {
195
+ contentLines.push(line);
196
+ }
197
+ }
198
+
199
+ return contentLines.join('\n').trim();
200
+ }
201
+
202
+ export {
203
+ extractFrontmatter,
204
+ findSkillsInDir,
205
+ resolveSkillPath,
206
+ checkForUpdates,
207
+ stripFrontmatter
208
+ };
package/mcp.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": ["-y", "@upstash/context7-mcp"],
6
+ "env": {
7
+ "CONTEXT7_API_KEY": "ctx7sk-dfdd3d92-65fd-4e1d-bd1c-1bee51cbacf0"
8
+ }
9
+ },
10
+ "sequential-thinking": {
11
+ "command": "npx",
12
+ "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
13
+ },
14
+ "exa": {
15
+ "command": "npx",
16
+ "args": ["-y", "exa-mcp-server"],
17
+ "env": {
18
+ "EXA_API_KEY": "8bab0085-90d5-4767-911d-6fd2f5caf6eb"
19
+ }
20
+ },
21
+ "memory": {
22
+ "command": "npx",
23
+ "args": ["-y", "@modelcontextprotocol/server-memory"]
24
+ },
25
+ "filesystem": {
26
+ "command": "npx",
27
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/"]
28
+ },
29
+ "fetch": {
30
+ "command": "npx",
31
+ "args": ["-y", "@wordbricks/fetch-mcp@latest"]
32
+ }
33
+ }
34
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "claude-termux",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code & Gemini CLI configuration for Termux Android - agents, skills, commands, MCP servers",
5
+ "main": "postinstall.js",
6
+ "scripts": {
7
+ "postinstall": "node postinstall.js"
8
+ },
9
+ "bin": {},
10
+ "keywords": [
11
+ "claude",
12
+ "claude-code",
13
+ "gemini",
14
+ "gemini-cli",
15
+ "termux",
16
+ "android",
17
+ "ai",
18
+ "agents",
19
+ "skills",
20
+ "mcp",
21
+ "superpowers"
22
+ ],
23
+ "author": "zesbe",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/zesbe/termux-config.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/zesbe/termux-config/issues"
31
+ },
32
+ "homepage": "https://github.com/zesbe/termux-config#readme",
33
+ "files": [
34
+ "agents/**",
35
+ "skills/**",
36
+ "commands/**",
37
+ "hooks/**",
38
+ "plugins/**",
39
+ "lib/**",
40
+ "CLAUDE.md",
41
+ "GEMINI.md",
42
+ "TERMUX.md",
43
+ "mcp.json",
44
+ "settings.json",
45
+ "settings.local.json",
46
+ "install.sh",
47
+ "postinstall.js"
48
+ ]
49
+ }
@@ -0,0 +1,47 @@
1
+ # Claude Plugins Configuration
2
+
3
+ This directory contains plugin configuration backups from Claude Code.
4
+
5
+ ## Files
6
+
7
+ ### `installed_plugins.json`
8
+ Complete list of installed plugins with their metadata and configurations.
9
+
10
+ **Contains 25 Active Plugins:**
11
+ - Security & Code Review: security-guidance, code-review, pr-review-toolkit
12
+ - Frontend: frontend-design
13
+ - Git: github, commit-commands
14
+ - Project Management: atlassian, linear, asana, serena
15
+ - AI & Development: agent-sdk-dev, feature-dev, ralph-loop
16
+ - Plugin Dev: plugin-dev, hookify
17
+ - Code Analysis: greptile
18
+ - Output Styles: explanatory-output-style, learning-output-style
19
+ - LSP: typescript-lsp, swift-lsp, gopls-lsp, lua-lsp
20
+ - Monitoring: sentry, pinecone
21
+
22
+ ### `known_marketplaces.json`
23
+ List of known plugin marketplaces.
24
+
25
+ ### `marketplace-info/`
26
+ Information about official plugin marketplace.
27
+
28
+ ## Removed Plugins (Incompatible with Termux/Android)
29
+
30
+ - ❌ **playwright** - Browser automation (needs browser binaries)
31
+ - ❌ **firebase** - Firebase tools (dependency conflicts)
32
+
33
+ ## Usage
34
+
35
+ To restore plugins on another machine:
36
+ 1. Copy `installed_plugins.json` to `~/.claude/plugins/`
37
+ 2. Copy `known_marketplaces.json` to `~/.claude/plugins/`
38
+ 3. Restart Claude Code
39
+
40
+ ## API Keys & MCP Servers
41
+
42
+ For MCP server configurations, see `../mcp.json` and `../claude-config.json`.
43
+
44
+ ---
45
+ **Generated:** 2025-01-07
46
+ **Platform:** Termux/Android
47
+ **Claude Code Version:** 2.0.76
@@ -0,0 +1,5 @@
1
+ {
2
+ "version": 2,
3
+ "plugins": {},
4
+ "note": "Plugins will be installed by Claude on first run. Use: claude /install-plugin <plugin-name>"
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "claude-plugins-official": {
3
+ "source": {
4
+ "source": "github",
5
+ "repo": "anthropics/claude-plugins-official"
6
+ },
7
+ "installLocation": "/data/data/com.termux/files/home/.claude/plugins/marketplaces/claude-plugins-official",
8
+ "lastUpdated": "2026-01-07T05:53:33.048Z"
9
+ }
10
+ }