pikakit 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 (145) hide show
  1. package/README.md +239 -0
  2. package/bin/add-skill-kit.js +3 -0
  3. package/bin/cli.mjs +6 -0
  4. package/bin/kit.mjs +89 -0
  5. package/bin/lib/agents.js +208 -0
  6. package/bin/lib/commands/analyze.js +70 -0
  7. package/bin/lib/commands/cache.js +65 -0
  8. package/bin/lib/commands/doctor.js +75 -0
  9. package/bin/lib/commands/help.js +155 -0
  10. package/bin/lib/commands/info.js +38 -0
  11. package/bin/lib/commands/init.js +39 -0
  12. package/bin/lib/commands/install.js +803 -0
  13. package/bin/lib/commands/list.js +43 -0
  14. package/bin/lib/commands/lock.js +57 -0
  15. package/bin/lib/commands/uninstall.js +307 -0
  16. package/bin/lib/commands/update.js +55 -0
  17. package/bin/lib/commands/validate.js +69 -0
  18. package/bin/lib/commands/verify.js +56 -0
  19. package/bin/lib/config.js +81 -0
  20. package/bin/lib/helpers.js +196 -0
  21. package/bin/lib/helpers.test.js +60 -0
  22. package/bin/lib/installer.js +164 -0
  23. package/bin/lib/skills.js +119 -0
  24. package/bin/lib/skills.test.js +109 -0
  25. package/bin/lib/types.js +82 -0
  26. package/bin/lib/ui.js +329 -0
  27. package/lib/agent-cli/README.md +21 -0
  28. package/lib/agent-cli/__tests__/adaptive_engine.test.js +190 -0
  29. package/lib/agent-cli/__tests__/integration/cross_script.test.js +222 -0
  30. package/lib/agent-cli/__tests__/integration/full_cycle.test.js +230 -0
  31. package/lib/agent-cli/__tests__/pattern_analyzer.test.js +173 -0
  32. package/lib/agent-cli/__tests__/pre_execution_check.test.js +167 -0
  33. package/lib/agent-cli/__tests__/skill_injector.test.js +191 -0
  34. package/lib/agent-cli/bin/agent.js +191 -0
  35. package/lib/agent-cli/dashboard/dashboard_server.js +340 -0
  36. package/lib/agent-cli/dashboard/index.html +538 -0
  37. package/lib/agent-cli/lib/audit.js +154 -0
  38. package/lib/agent-cli/lib/audit.test.js +100 -0
  39. package/lib/agent-cli/lib/auto-learn.js +319 -0
  40. package/lib/agent-cli/lib/backup.js +138 -0
  41. package/lib/agent-cli/lib/backup.test.js +78 -0
  42. package/lib/agent-cli/lib/cognitive-lesson.js +476 -0
  43. package/lib/agent-cli/lib/completion.js +149 -0
  44. package/lib/agent-cli/lib/config.js +35 -0
  45. package/lib/agent-cli/lib/eslint-fix.js +238 -0
  46. package/lib/agent-cli/lib/evolution-signal.js +215 -0
  47. package/lib/agent-cli/lib/export.js +86 -0
  48. package/lib/agent-cli/lib/export.test.js +65 -0
  49. package/lib/agent-cli/lib/fix.js +337 -0
  50. package/lib/agent-cli/lib/fix.test.js +80 -0
  51. package/lib/agent-cli/lib/gemini-export.js +83 -0
  52. package/lib/agent-cli/lib/generate-registry.js +42 -0
  53. package/lib/agent-cli/lib/hooks/install-hooks.js +152 -0
  54. package/lib/agent-cli/lib/hooks/lint-learn.js +172 -0
  55. package/lib/agent-cli/lib/ignore.js +116 -0
  56. package/lib/agent-cli/lib/ignore.test.js +58 -0
  57. package/lib/agent-cli/lib/init.js +124 -0
  58. package/lib/agent-cli/lib/learn.js +255 -0
  59. package/lib/agent-cli/lib/learn.test.js +70 -0
  60. package/lib/agent-cli/lib/migrate-to-v4.js +322 -0
  61. package/lib/agent-cli/lib/proposals.js +199 -0
  62. package/lib/agent-cli/lib/proposals.test.js +56 -0
  63. package/lib/agent-cli/lib/recall.js +820 -0
  64. package/lib/agent-cli/lib/recall.test.js +107 -0
  65. package/lib/agent-cli/lib/selfevolution-bridge.js +167 -0
  66. package/lib/agent-cli/lib/settings.js +227 -0
  67. package/lib/agent-cli/lib/skill-learn.js +296 -0
  68. package/lib/agent-cli/lib/stats.js +132 -0
  69. package/lib/agent-cli/lib/stats.test.js +94 -0
  70. package/lib/agent-cli/lib/types.js +33 -0
  71. package/lib/agent-cli/lib/ui/audit-ui.js +146 -0
  72. package/lib/agent-cli/lib/ui/backup-ui.js +107 -0
  73. package/lib/agent-cli/lib/ui/clack-helpers.js +317 -0
  74. package/lib/agent-cli/lib/ui/common.js +83 -0
  75. package/lib/agent-cli/lib/ui/completion-ui.js +126 -0
  76. package/lib/agent-cli/lib/ui/custom-select.js +69 -0
  77. package/lib/agent-cli/lib/ui/dashboard-ui.js +222 -0
  78. package/lib/agent-cli/lib/ui/evolution-signals-ui.js +107 -0
  79. package/lib/agent-cli/lib/ui/export-ui.js +94 -0
  80. package/lib/agent-cli/lib/ui/fix-all-ui.js +191 -0
  81. package/lib/agent-cli/lib/ui/help-ui.js +49 -0
  82. package/lib/agent-cli/lib/ui/index.js +199 -0
  83. package/lib/agent-cli/lib/ui/init-ui.js +56 -0
  84. package/lib/agent-cli/lib/ui/knowledge-ui.js +55 -0
  85. package/lib/agent-cli/lib/ui/learn-ui.js +706 -0
  86. package/lib/agent-cli/lib/ui/lessons-ui.js +148 -0
  87. package/lib/agent-cli/lib/ui/pretty.js +145 -0
  88. package/lib/agent-cli/lib/ui/proposals-ui.js +99 -0
  89. package/lib/agent-cli/lib/ui/recall-ui.js +342 -0
  90. package/lib/agent-cli/lib/ui/routing-demo.js +79 -0
  91. package/lib/agent-cli/lib/ui/routing-ui.js +325 -0
  92. package/lib/agent-cli/lib/ui/settings-ui.js +381 -0
  93. package/lib/agent-cli/lib/ui/stats-ui.js +123 -0
  94. package/lib/agent-cli/lib/ui/watch-ui.js +236 -0
  95. package/lib/agent-cli/lib/watcher.js +181 -0
  96. package/lib/agent-cli/lib/watcher.test.js +85 -0
  97. package/lib/agent-cli/package.json +51 -0
  98. package/lib/agent-cli/scripts/adaptive_engine.js +381 -0
  99. package/lib/agent-cli/scripts/dashboard_server.js +224 -0
  100. package/lib/agent-cli/scripts/error_sensor.js +565 -0
  101. package/lib/agent-cli/scripts/learn_from_failure.js +225 -0
  102. package/lib/agent-cli/scripts/pattern_analyzer.js +781 -0
  103. package/lib/agent-cli/scripts/pre_execution_check.js +623 -0
  104. package/lib/agent-cli/scripts/rule_sharing.js +374 -0
  105. package/lib/agent-cli/scripts/skill_injector.js +387 -0
  106. package/lib/agent-cli/scripts/success_sensor.js +500 -0
  107. package/lib/agent-cli/scripts/user_correction_sensor.js +426 -0
  108. package/lib/agent-cli/services/auto-learn-service.js +247 -0
  109. package/lib/agent-cli/src/MIGRATION.md +418 -0
  110. package/lib/agent-cli/src/README.md +367 -0
  111. package/lib/agent-cli/src/core/evolution/evolution-signal.js +42 -0
  112. package/lib/agent-cli/src/core/evolution/index.js +17 -0
  113. package/lib/agent-cli/src/core/evolution/review-gate.js +40 -0
  114. package/lib/agent-cli/src/core/evolution/signal-detector.js +137 -0
  115. package/lib/agent-cli/src/core/evolution/signal-queue.js +79 -0
  116. package/lib/agent-cli/src/core/evolution/threshold-checker.js +79 -0
  117. package/lib/agent-cli/src/core/index.js +15 -0
  118. package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +282 -0
  119. package/lib/agent-cli/src/core/learning/index.js +12 -0
  120. package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +83 -0
  121. package/lib/agent-cli/src/core/scanning/index.js +14 -0
  122. package/lib/agent-cli/src/data/index.js +13 -0
  123. package/lib/agent-cli/src/data/repositories/index.js +8 -0
  124. package/lib/agent-cli/src/data/repositories/lesson-repository.js +130 -0
  125. package/lib/agent-cli/src/data/repositories/signal-repository.js +119 -0
  126. package/lib/agent-cli/src/data/storage/index.js +8 -0
  127. package/lib/agent-cli/src/data/storage/json-storage.js +64 -0
  128. package/lib/agent-cli/src/data/storage/yaml-storage.js +66 -0
  129. package/lib/agent-cli/src/infrastructure/index.js +13 -0
  130. package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +232 -0
  131. package/lib/agent-cli/src/services/export-service.js +162 -0
  132. package/lib/agent-cli/src/services/index.js +13 -0
  133. package/lib/agent-cli/src/services/learning-service.js +99 -0
  134. package/lib/agent-cli/types/index.d.ts +343 -0
  135. package/lib/agent-cli/utils/benchmark.js +269 -0
  136. package/lib/agent-cli/utils/logger.js +303 -0
  137. package/lib/agent-cli/utils/ml_patterns.js +300 -0
  138. package/lib/agent-cli/utils/recovery.js +312 -0
  139. package/lib/agent-cli/utils/telemetry.js +290 -0
  140. package/lib/agentskillskit-cli/README.md +21 -0
  141. package/lib/agentskillskit-cli/ag-smart.js +158 -0
  142. package/lib/agentskillskit-cli/package.json +51 -0
  143. package/package.json +79 -0
  144. package/specs/ADD_SKILL_SPEC.md +333 -0
  145. package/specs/REGISTRY_V2_SPEC.md +334 -0
package/README.md ADDED
@@ -0,0 +1,239 @@
1
+ # PikaKit
2
+
3
+ > **CLI installer for Agent Skill Kit - FAANG-grade AI skills, workflows, and agents**
4
+
5
+ [![npm](https://img.shields.io/badge/npm-pikakit-CB3837?style=flat&logo=npm)](https://www.npmjs.com/package/pikakit)
6
+ [![version](https://img.shields.io/badge/version-1.0.0-7c3aed?style=flat&colorA=18181b)](https://www.npmjs.com/package/pikakit)
7
+ [![JavaScript](https://img.shields.io/badge/100%25-JavaScript-F7DF1E?style=flat&colorA=18181b&logo=javascript)](https://github.com/agentskillkit/pikakit)
8
+ [![license](https://img.shields.io/badge/license-MIT-7c3aed?style=flat&colorA=18181b)](LICENSE)
9
+
10
+ ---
11
+
12
+ ## ⚡ Installation
13
+
14
+ ```bash
15
+ npx -y pikakit agentskillkit/agent-skills
16
+ ```
17
+
18
+ **That's it!** One command installs everything:
19
+
20
+ | Component | Count | Description |
21
+ |-----------|-------|-------------|
22
+ | **Skills** | 49 | FAANG-grade coding skills |
23
+ | **Workflows** | 26 | `/think`, `/build`, `/autopilot`, etc. |
24
+ | **Agents** | 25 | Specialist AI agents |
25
+ | **Rules** | GEMINI.md | AI behavior configuration |
26
+ | **Scripts** | 25 | JavaScript automation scripts |
27
+ | **Commands** | `kit` | CLI management tool |
28
+ | **Commands** | `agent` | Interactive learning (optional) |
29
+
30
+ ---
31
+
32
+ ## 🎯 What This CLI Does
33
+
34
+ ### 1. Fetches Skills from GitHub
35
+
36
+ ```bash
37
+ npx -y pikakit <owner>/<repo>
38
+
39
+ # Examples:
40
+ npx pikakit agentskillkit/agent-skills # Official skills
41
+ npx pikakit myteam/company-skills # Custom skills
42
+ ```
43
+
44
+ ### 2. Interactive Installation
45
+
46
+ ```
47
+ ┌───────────────────────────────────────────┐
48
+ │ 🛠️ Agent Skill Kit Installer │
49
+ ├───────────────────────────────────────────┤
50
+ │ ◆ Select skills to install │
51
+ │ ◆ Choose install scope │
52
+ │ ◆ Configure AutoLearn (optional) │
53
+ │ ◆ Auto-install dependencies │
54
+ └───────────────────────────────────────────┘
55
+ ```
56
+
57
+ ### 3. Creates Ready-to-Use Structure
58
+
59
+ ```
60
+ your-project/
61
+ ├── .agent/
62
+ │ ├── GEMINI.md # AI Rules
63
+ │ ├── skills/ # 49 Skills
64
+ │ ├── workflows/ # 26 Workflows
65
+ │ ├── agents/ # 25 Agents
66
+ │ ├── knowledge/ # Learning memory
67
+ │ ├── config/ # Configuration
68
+ │ ├── scripts-js/ # Automation
69
+ │ └── metrics/ # Tracking
70
+
71
+ ├── kit.cmd / kit # CLI wrapper
72
+ └── agent.cmd / agent # AutoLearn (optional)
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 🔧 CLI Options
78
+
79
+ ### Install Scope
80
+
81
+ | Option | Location | Best For |
82
+ |--------|----------|----------|
83
+ | **Project** | `.agent/` in current project | Single project |
84
+ | **Global** | `~/.gemini/antigravity/` | All projects |
85
+
86
+ ### AutoLearn (Optional)
87
+
88
+ When prompted "Install AutoLearn?":
89
+
90
+ | Choice | Effect |
91
+ |--------|--------|
92
+ | **Yes** | Installs `agent` command for interactive learning |
93
+ | **No** | Core functionality works perfectly, just no `agent` CLI |
94
+
95
+ > **Note:** Choosing "No" does NOT affect workflows, skills, or agents.
96
+
97
+ ---
98
+
99
+ ## 📦 Commands After Installation
100
+
101
+ ### `kit` Command (Always Available)
102
+
103
+ ```bash
104
+ kit list # List all installed skills
105
+ kit validate # Validate skill structure
106
+ kit info <skill> # Show skill details
107
+ kit doctor # Check system health
108
+ kit cache status # View cache usage
109
+ kit cache clear # Clear cache
110
+ ```
111
+
112
+ ### `agent` Command (If AutoLearn Installed)
113
+
114
+ ```bash
115
+ agent # Launch dashboard
116
+ agent learn # Teach patterns
117
+ agent recall # Scan violations
118
+ agent stats # View statistics
119
+ agent watch # Real-time monitor
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 🚀 Usage Examples
125
+
126
+ ### Install Official Skills
127
+
128
+ ```bash
129
+ npx -y pikakit agentskillkit/agent-skills
130
+ ```
131
+
132
+ ### Install to Global Location
133
+
134
+ ```bash
135
+ npx -y pikakit agentskillkit/agent-skills --global
136
+ ```
137
+
138
+ ### Force Reinstall
139
+
140
+ ```bash
141
+ npx -y pikakit agentskillkit/agent-skills --force
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 🗂️ What Gets Installed
147
+
148
+ ### Complete Structure
149
+
150
+ ```
151
+ .agent/
152
+ ├── GEMINI.md # Supreme AI Rules
153
+ ├── ARCHITECTURE.md # System Overview
154
+ ├── CONTINUOUS_EXECUTION_POLICY.md # Autopilot Rules
155
+ ├── WORKFLOW_CHAINS.md # Workflow Patterns
156
+
157
+ ├── skills/ # 49 Skills
158
+ │ ├── auto-learner/
159
+ │ ├── react-architect/
160
+ │ ├── typescript-expert/
161
+ │ ├── debug-pro/
162
+ │ ├── studio/
163
+ │ └── ... (44 more)
164
+
165
+ ├── workflows/ # 26 Workflows
166
+ │ ├── think.md
167
+ │ ├── build.md
168
+ │ ├── autopilot.md
169
+ │ └── ... (23 more)
170
+
171
+ ├── agents/ # 25 Agents
172
+ │ ├── frontend-specialist.md
173
+ │ ├── backend-specialist.md
174
+ │ └── ... (23 more)
175
+
176
+ ├── knowledge/ # Learning Memory
177
+ │ └── lessons-learned.yaml
178
+
179
+ ├── config/ # Configuration
180
+ ├── scripts-js/ # 25 JS Scripts
181
+ └── metrics/ # Performance
182
+ ```
183
+
184
+ ### Dependencies Auto-Installed
185
+
186
+ ```bash
187
+ npm install # Node.js dependencies
188
+ ```
189
+
190
+ ---
191
+
192
+ ## 🔗 Related Packages
193
+
194
+ | Package | Purpose |
195
+ |---------|---------|
196
+ | [agent-skills](https://github.com/agentskillkit/agent-skills) | Main skills repository |
197
+ | [pikakit](https://www.npmjs.com/package/pikakit) | This CLI installer |
198
+
199
+ ---
200
+
201
+ ## 📈 Version History
202
+
203
+ **v1.0.0 (Current)**
204
+ - ✅ Renamed to PikaKit for cross-platform npx support
205
+ - ✅ Works with `npx pikakit` on Windows, macOS, Linux
206
+ - ✅ 100% JavaScript - No Python required
207
+ - ✅ AutoLearn made optional
208
+ - ✅ Complete installation (config, scripts-js, metrics, policy docs)
209
+
210
+ ---
211
+
212
+ ## 🛠️ Development
213
+
214
+ ```bash
215
+ # Clone
216
+ git clone https://github.com/agentskillkit/pikakit.git
217
+ cd pikakit
218
+
219
+ # Install dependencies
220
+ npm install
221
+
222
+ # Run locally
223
+ node bin/cli.mjs install agentskillkit/agent-skills
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 📄 License
229
+
230
+ MIT - Free for all projects.
231
+
232
+ ---
233
+
234
+ **⚡ PikaKit v1.0.0**
235
+ *One command. Complete AI setup.*
236
+
237
+ ---
238
+
239
+ **[GitHub](https://github.com/agentskillkit/pikakit) • [npm](https://www.npmjs.com/package/pikakit) • [Issues](https://github.com/agentskillkit/pikakit/issues)**
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ // CJS wrapper for ESM module - enables npx compatibility on Windows
3
+ import('./kit.js');
package/bin/cli.mjs ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Agent Skill Kit CLI - Main Entry Point
4
+ * Using .mjs extension for Windows npx compatibility
5
+ */
6
+ import('./kit.mjs');
package/bin/kit.mjs ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Install Agent Skill CLI
4
+ * @description Package manager for AI Agent Skills
5
+ */
6
+ import { c, brandedIntro } from "./lib/ui.js";
7
+ import { command, params, VERSION } from "./lib/config.js";
8
+
9
+ // --- Command Registry ---
10
+ const COMMANDS = {
11
+ // Installation
12
+ install: { module: "./lib/commands/install.js", hasParam: true, aliases: ["add", "i"] },
13
+ uninstall: { module: "./lib/commands/uninstall.js", hasParam: true, aliases: ["remove", "rm"] },
14
+ update: { module: "./lib/commands/update.js", hasParam: true },
15
+
16
+ // Workspace
17
+ init: { module: "./lib/commands/init.js", aliases: ["list", "ls"] },
18
+ lock: { module: "./lib/commands/lock.js" },
19
+ cache: { module: "./lib/commands/cache.js", hasParam: true },
20
+
21
+ // Validation
22
+ verify: { module: "./lib/commands/verify.js" },
23
+ doctor: { module: "./lib/commands/doctor.js" },
24
+ validate: { module: "./lib/commands/validate.js", hasParam: true, aliases: ["check"] },
25
+ analyze: { module: "./lib/commands/analyze.js", hasParam: true },
26
+
27
+ // Info
28
+ info: { module: "./lib/commands/info.js", hasParam: true, aliases: ["show"] },
29
+ help: { module: "./lib/commands/help.js", aliases: ["--help", "-h"] }
30
+ };
31
+
32
+ /**
33
+ * Find command config by name or alias
34
+ * @param {string} cmd - Command name or alias
35
+ * @returns {{ name: string, config: object } | null}
36
+ */
37
+ function findCommand(cmd) {
38
+ // Direct match
39
+ if (COMMANDS[cmd]) {
40
+ return { name: cmd, config: COMMANDS[cmd] };
41
+ }
42
+
43
+ // Alias match
44
+ for (const [name, config] of Object.entries(COMMANDS)) {
45
+ if (config.aliases?.includes(cmd)) {
46
+ return { name, config };
47
+ }
48
+ }
49
+
50
+ return null;
51
+ }
52
+
53
+ // --- MAIN ---
54
+ async function main() {
55
+ brandedIntro(VERSION);
56
+
57
+ try {
58
+ // Handle version flag
59
+ if (command === "--version" || command === "-V") {
60
+ console.log(VERSION);
61
+ return;
62
+ }
63
+
64
+ // Find command
65
+ const found = findCommand(command);
66
+
67
+ if (found) {
68
+ const cmdModule = await import(found.config.module);
69
+ await cmdModule.run(found.config.hasParam ? params[0] : undefined);
70
+ } else if (command.includes("/")) {
71
+ // Direct install via org/repo syntax
72
+ const cmdModule = await import("./lib/commands/install.js");
73
+ await cmdModule.run(command);
74
+ } else {
75
+ console.log(`Unknown command: ${command}`);
76
+ const cmdModule = await import("./lib/commands/help.js");
77
+ await cmdModule.run();
78
+ }
79
+ } catch (err) {
80
+ console.error(c.red("\nError: " + err.message));
81
+ if (process.env.DEBUG) console.error(err.stack);
82
+ process.exit(1);
83
+ }
84
+ }
85
+
86
+ main().catch(err => {
87
+ console.error(c.red("\nFatal Error: " + err.message));
88
+ process.exit(1);
89
+ });
@@ -0,0 +1,208 @@
1
+ /**
2
+ * @fileoverview Agent definitions and detection
3
+ * Based on Vercel's agent-skills CLI structure
4
+ */
5
+
6
+ import { existsSync } from "fs";
7
+ import { homedir } from "os";
8
+ import { join } from "path";
9
+
10
+ const home = homedir();
11
+
12
+ // Environment-based paths
13
+ const codexHome = process.env.CODEX_HOME?.trim() || join(home, ".codex");
14
+ const claudeHome = process.env.CLAUDE_CONFIG_DIR?.trim() || join(home, ".claude");
15
+
16
+ /**
17
+ * @typedef {Object} AgentConfig
18
+ * @property {string} name - Internal agent ID
19
+ * @property {string} displayName - Display name for UI
20
+ * @property {string} skillsDir - Project-level skills directory
21
+ * @property {string} globalSkillsDir - Global skills directory
22
+ * @property {() => boolean} detect - Detection function
23
+ */
24
+
25
+ /**
26
+ * All supported agents with detection logic
27
+ * @type {Record<string, AgentConfig>}
28
+ */
29
+ export const AGENTS = {
30
+ antigravity: {
31
+ name: "antigravity",
32
+ displayName: "Antigravity",
33
+ skillsDir: ".agent/skills",
34
+ globalSkillsDir: join(home, ".gemini/antigravity/global_skills"),
35
+ detect: () => existsSync(join(process.cwd(), ".agent")) || existsSync(join(home, ".gemini/antigravity"))
36
+ },
37
+ "claude-code": {
38
+ name: "claude-code",
39
+ displayName: "Claude Code",
40
+ skillsDir: ".claude/skills",
41
+ globalSkillsDir: join(claudeHome, "skills"),
42
+ detect: () => existsSync(claudeHome)
43
+ },
44
+ codex: {
45
+ name: "codex",
46
+ displayName: "Codex",
47
+ skillsDir: ".codex/skills",
48
+ globalSkillsDir: join(codexHome, "skills"),
49
+ detect: () => existsSync(codexHome) || existsSync("/etc/codex")
50
+ },
51
+ "gemini-cli": {
52
+ name: "gemini-cli",
53
+ displayName: "Gemini CLI",
54
+ skillsDir: ".gemini/skills",
55
+ globalSkillsDir: join(home, ".gemini/skills"),
56
+ detect: () => existsSync(join(home, ".gemini"))
57
+ },
58
+ "github-copilot": {
59
+ name: "github-copilot",
60
+ displayName: "GitHub Copilot",
61
+ skillsDir: ".github/skills",
62
+ globalSkillsDir: join(home, ".copilot/skills"),
63
+ detect: () => existsSync(join(process.cwd(), ".github")) || existsSync(join(home, ".copilot"))
64
+ },
65
+ windsurf: {
66
+ name: "windsurf",
67
+ displayName: "Windsurf",
68
+ skillsDir: ".windsurf/skills",
69
+ globalSkillsDir: join(home, ".codeium/windsurf/skills"),
70
+ detect: () => existsSync(join(home, ".codeium/windsurf"))
71
+ },
72
+ cursor: {
73
+ name: "cursor",
74
+ displayName: "Cursor",
75
+ skillsDir: ".cursor/skills",
76
+ globalSkillsDir: join(home, ".cursor/skills"),
77
+ detect: () => existsSync(join(home, ".cursor"))
78
+ },
79
+ cline: {
80
+ name: "cline",
81
+ displayName: "Cline",
82
+ skillsDir: ".cline/skills",
83
+ globalSkillsDir: join(home, ".cline/skills"),
84
+ detect: () => existsSync(join(home, ".cline"))
85
+ },
86
+ roo: {
87
+ name: "roo",
88
+ displayName: "Roo Code",
89
+ skillsDir: ".roo/skills",
90
+ globalSkillsDir: join(home, ".roo/skills"),
91
+ detect: () => existsSync(join(home, ".roo"))
92
+ },
93
+ continue: {
94
+ name: "continue",
95
+ displayName: "Continue",
96
+ skillsDir: ".continue/skills",
97
+ globalSkillsDir: join(home, ".continue/skills"),
98
+ detect: () => existsSync(join(process.cwd(), ".continue")) || existsSync(join(home, ".continue"))
99
+ },
100
+ goose: {
101
+ name: "goose",
102
+ displayName: "Goose",
103
+ skillsDir: ".goose/skills",
104
+ globalSkillsDir: join(home, ".config/goose/skills"),
105
+ detect: () => existsSync(join(home, ".config/goose"))
106
+ },
107
+ trae: {
108
+ name: "trae",
109
+ displayName: "Trae",
110
+ skillsDir: ".trae/skills",
111
+ globalSkillsDir: join(home, ".trae/skills"),
112
+ detect: () => existsSync(join(home, ".trae"))
113
+ },
114
+ kilo: {
115
+ name: "kilo",
116
+ displayName: "Kilo Code",
117
+ skillsDir: ".kilocode/skills",
118
+ globalSkillsDir: join(home, ".kilocode/skills"),
119
+ detect: () => existsSync(join(home, ".kilocode"))
120
+ },
121
+ opencode: {
122
+ name: "opencode",
123
+ displayName: "OpenCode",
124
+ skillsDir: ".opencode/skills",
125
+ globalSkillsDir: join(home, ".config/opencode/skills"),
126
+ detect: () => existsSync(join(home, ".config/opencode"))
127
+ },
128
+ amp: {
129
+ name: "amp",
130
+ displayName: "Amp",
131
+ skillsDir: ".agents/skills",
132
+ globalSkillsDir: join(home, ".config/agents/skills"),
133
+ detect: () => existsSync(join(home, ".config/amp"))
134
+ },
135
+ junie: {
136
+ name: "junie",
137
+ displayName: "Junie",
138
+ skillsDir: ".junie/skills",
139
+ globalSkillsDir: join(home, ".junie/skills"),
140
+ detect: () => existsSync(join(home, ".junie"))
141
+ },
142
+ "kiro-cli": {
143
+ name: "kiro-cli",
144
+ displayName: "Kiro CLI",
145
+ skillsDir: ".kiro/skills",
146
+ globalSkillsDir: join(home, ".kiro/skills"),
147
+ detect: () => existsSync(join(home, ".kiro"))
148
+ },
149
+ zencoder: {
150
+ name: "zencoder",
151
+ displayName: "Zencoder",
152
+ skillsDir: ".zencoder/skills",
153
+ globalSkillsDir: join(home, ".zencoder/skills"),
154
+ detect: () => existsSync(join(home, ".zencoder"))
155
+ },
156
+ openhands: {
157
+ name: "openhands",
158
+ displayName: "OpenHands",
159
+ skillsDir: ".openhands/skills",
160
+ globalSkillsDir: join(home, ".openhands/skills"),
161
+ detect: () => existsSync(join(home, ".openhands"))
162
+ },
163
+ "qwen-code": {
164
+ name: "qwen-code",
165
+ displayName: "Qwen Code",
166
+ skillsDir: ".qwen/skills",
167
+ globalSkillsDir: join(home, ".qwen/skills"),
168
+ detect: () => existsSync(join(home, ".qwen"))
169
+ }
170
+ };
171
+
172
+ /**
173
+ * Detect all installed agents on the system
174
+ * @returns {Array<{name: string, displayName: string, skillsDir: string, globalSkillsDir: string}>}
175
+ */
176
+ export function detectInstalledAgents() {
177
+ const detected = [];
178
+
179
+ for (const [key, config] of Object.entries(AGENTS)) {
180
+ if (config.detect()) {
181
+ detected.push({
182
+ name: config.name,
183
+ displayName: config.displayName,
184
+ skillsDir: config.skillsDir,
185
+ globalSkillsDir: config.globalSkillsDir
186
+ });
187
+ }
188
+ }
189
+
190
+ return detected;
191
+ }
192
+
193
+ /**
194
+ * Get agent config by name
195
+ * @param {string} name - Agent name
196
+ * @returns {AgentConfig | undefined}
197
+ */
198
+ export function getAgentConfig(name) {
199
+ return AGENTS[name];
200
+ }
201
+
202
+ /**
203
+ * Get all agent names
204
+ * @returns {string[]}
205
+ */
206
+ export function getAllAgentNames() {
207
+ return Object.keys(AGENTS);
208
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @fileoverview Analyze command - Skill structure analysis
3
+ */
4
+
5
+ import fs from "fs";
6
+ import path from "path";
7
+ import { resolveScope, getDirSize } from "../helpers.js";
8
+ import { parseSkillMdFrontmatter, detectSkillStructure } from "../skills.js";
9
+ import { step, stepLine, S, c, fatal } from "../ui.js";
10
+
11
+ /**
12
+ * Analyze skill structure
13
+ * @param {string} skillName - Skill to analyze
14
+ */
15
+ export async function run(skillName) {
16
+ if (!skillName) fatal("Missing skill name");
17
+
18
+ const scope = resolveScope();
19
+ const skillDir = path.join(scope, skillName);
20
+
21
+ if (!fs.existsSync(skillDir)) fatal(`Skill not found: ${skillName}`);
22
+
23
+ stepLine();
24
+ step(c.bold(`Skill Analysis: ${skillName}`), S.diamondFilled, "cyan");
25
+ console.log(`${c.gray(S.branch)} ${c.dim("Path: " + skillDir)}`);
26
+ stepLine();
27
+
28
+ // SKILL.md frontmatter
29
+ const smp = path.join(skillDir, "SKILL.md");
30
+ if (fs.existsSync(smp)) {
31
+ const m = parseSkillMdFrontmatter(smp);
32
+ console.log(`${c.gray(S.branch)} ${c.cyan("SKILL.md Frontmatter:")}`);
33
+ console.log(`${c.gray(S.branch)} Name: ${m.name || c.dim("(not set)")}`);
34
+ console.log(`${c.gray(S.branch)} Description: ${m.description ? m.description.substring(0, 60) : c.red("(MISSING)")}`);
35
+ if (m.tags) console.log(`${c.gray(S.branch)} Tags: ${m.tags.join(", ")}`);
36
+ stepLine();
37
+ }
38
+
39
+ // Structure
40
+ const structure = detectSkillStructure(skillDir);
41
+ console.log(`${c.gray(S.branch)} ${c.cyan("Structure:")}`);
42
+
43
+ const items = [
44
+ ["resources", structure.hasResources],
45
+ ["examples", structure.hasExamples],
46
+ ["scripts", structure.hasScripts],
47
+ ["constitution", structure.hasConstitution],
48
+ ["doctrines", structure.hasDoctrines]
49
+ ];
50
+
51
+ items.forEach(([n, has]) => {
52
+ console.log(`${c.gray(S.branch)} ${has ? c.green(S.check) : c.dim("â—‹")} ${has ? c.bold(n) : c.dim(n)}`);
53
+ });
54
+
55
+ stepLine();
56
+
57
+ // Antigravity Score
58
+ let score = 0;
59
+ if (fs.existsSync(smp)) score += 20;
60
+ const m = parseSkillMdFrontmatter(smp);
61
+ if (m.description) score += 25;
62
+ if (m.tags && m.tags.length > 0) score += 10;
63
+ if (structure.hasResources || structure.hasExamples || structure.hasScripts) score += 20;
64
+ if (fs.existsSync(path.join(skillDir, ".skill-source.json"))) score += 10;
65
+ if (structure.hasConstitution || structure.hasDoctrines) score += 15;
66
+
67
+ const scoreColor = score >= 80 ? c.green : score >= 50 ? c.yellow : c.red;
68
+ console.log(`${c.gray(S.branch)} ${c.cyan("Antigravity Score:")} ${scoreColor(score + "/100")}`);
69
+ stepLine();
70
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @fileoverview Cache command
3
+ */
4
+
5
+ import fs from "fs";
6
+ import { step, stepLine, S, c, fatal, success } from "../ui.js";
7
+ import { getDirSize, formatBytes, listBackups } from "../helpers.js";
8
+ import { CACHE_ROOT, REGISTRY_CACHE, BACKUP_DIR, DRY } from "../config.js";
9
+
10
+ /**
11
+ * Manage cache
12
+ * @param {string} [sub] - Subcommand: info, clear, backups
13
+ */
14
+ export async function run(sub) {
15
+ stepLine();
16
+
17
+ if (sub === "clear") {
18
+ if (DRY) {
19
+ step(`Would clear: ${CACHE_ROOT}`, S.diamond);
20
+ return;
21
+ }
22
+ if (fs.existsSync(CACHE_ROOT)) {
23
+ const size = getDirSize(CACHE_ROOT);
24
+ fs.rmSync(CACHE_ROOT, { recursive: true, force: true });
25
+ success(`Cache cleared (${formatBytes(size)})`);
26
+ } else {
27
+ step("Cache already empty", S.diamond);
28
+ }
29
+ return;
30
+ }
31
+
32
+ if (sub === "info" || !sub) {
33
+ if (!fs.existsSync(CACHE_ROOT)) {
34
+ step("Cache is empty", S.diamond);
35
+ return;
36
+ }
37
+
38
+ const rs = fs.existsSync(REGISTRY_CACHE) ? getDirSize(REGISTRY_CACHE) : 0;
39
+ const bs = fs.existsSync(BACKUP_DIR) ? getDirSize(BACKUP_DIR) : 0;
40
+
41
+ step(c.bold("Cache Info"), S.diamondFilled, "cyan");
42
+ console.log(`${c.gray(S.branch)} Location: ${CACHE_ROOT}`);
43
+ console.log(`${c.gray(S.branch)} Registries: ${formatBytes(rs)}`);
44
+ console.log(`${c.gray(S.branch)} Backups: ${formatBytes(bs)}`);
45
+ console.log(`${c.gray(S.branch)} Total: ${formatBytes(getDirSize(CACHE_ROOT))}`);
46
+ stepLine();
47
+ return;
48
+ }
49
+
50
+ if (sub === "backups") {
51
+ const backups = listBackups();
52
+ if (backups.length === 0) {
53
+ step("No backups found", S.diamond);
54
+ return;
55
+ }
56
+
57
+ step(c.bold("Backups"), S.diamondFilled, "cyan");
58
+ stepLine();
59
+ backups.forEach(b => console.log(`${c.gray(S.branch)} ${b.name} (${formatBytes(b.size)})`));
60
+ stepLine();
61
+ return;
62
+ }
63
+
64
+ fatal(`Unknown cache subcommand: ${sub}`);
65
+ }