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
@@ -0,0 +1,334 @@
1
+ # REGISTRY_V2_SPEC.md
2
+ ## Signed Remote Skill Registry Specification
3
+
4
+ **Status:** Stable
5
+ **Version:** 2.0
6
+ **Applies to:** `@dataguruin/add-skill >= 1.0`
7
+ **Audience:** Registry operators, platform engineers, security engineers, AI agents
8
+
9
+ ---
10
+
11
+ ## 1. Purpose
12
+
13
+ Registry v2 defines a **signed, remote, read-only index** for discovering and resolving **Agent Skills**.
14
+
15
+ The registry provides **metadata only**.
16
+ It never distributes executables, never installs code, and never mutates environments.
17
+
18
+ Registry v2 exists to enable:
19
+
20
+ - Global skill discovery
21
+ - Publisher attribution
22
+ - Version resolution
23
+ - Cryptographic integrity guarantees
24
+
25
+ ---
26
+
27
+ ## 2. Design Principles (NON-NEGOTIABLE)
28
+
29
+ 1. Registry data is **read-only**
30
+ 2. Registry index is **cryptographically signed**
31
+ 3. Registry is **advisory**, never authoritative
32
+ 4. Lock files always override registry data
33
+ 5. Registry never executes or distributes code
34
+ 6. Verification is mandatory, silence is forbidden
35
+
36
+ ---
37
+
38
+ ## 3. Threat Model
39
+
40
+ Registry v2 explicitly defends against:
41
+
42
+ - Registry tampering
43
+ - CDN compromise
44
+ - Man-in-the-middle attacks
45
+ - Skill version substitution
46
+ - Silent metadata modification
47
+
48
+ Registry v2 does **not** attempt to:
49
+
50
+ - Protect against compromised publishers
51
+ - Enforce business logic or licensing
52
+ - Execute or sandbox code
53
+
54
+ ---
55
+
56
+ ## 4. Architecture Overview
57
+
58
+ ```
59
+
60
+ [ Registry Operator ]
61
+ |
62
+ | (signed index.json)
63
+ v
64
+ [ Static Hosting / CDN ]
65
+ |
66
+ v
67
+ [ add-skill Client ]
68
+
69
+ ````
70
+
71
+ Characteristics:
72
+
73
+ - Static file hosting only
74
+ - HTTPS transport
75
+ - Offline-cacheable
76
+ - No authentication required for read access
77
+
78
+ ---
79
+
80
+ ## 5. Registry Index File
81
+
82
+ ### 5.1 File Name
83
+
84
+ ```txt
85
+ index.json
86
+ ````
87
+
88
+ ---
89
+
90
+ ### 5.2 Canonical Schema
91
+
92
+ ```json
93
+ {
94
+ "registryVersion": 2,
95
+ "generatedAt": "2026-01-23T14:00:00Z",
96
+ "registryPublisher": "dataguruin",
97
+ "signature": {
98
+ "algorithm": "ed25519",
99
+ "keyId": "dataguruin-registry-v1",
100
+ "value": "BASE64_SIGNATURE"
101
+ },
102
+ "skills": {
103
+ "coinpika-swipe-tabs": {
104
+ "repo": "dataguruin/coinpika-skills",
105
+ "publisher": "dataguruin",
106
+ "description": "Universal swipe-tab architecture for mobile PWA",
107
+ "latest": "1.2.3",
108
+ "versions": {
109
+ "1.2.3": {
110
+ "ref": "v1.2.3",
111
+ "checksum": "sha256:abcd...",
112
+ "engines": ["antigravity", "gemini"],
113
+ "tags": ["ui", "mobile", "swipe"]
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 6. Signature Model
124
+
125
+ ### 6.1 Signed Payload
126
+
127
+ The registry signature covers **all fields except `signature` itself**, including:
128
+
129
+ * `registryVersion`
130
+ * `generatedAt`
131
+ * `registryPublisher`
132
+ * Entire `skills` object
133
+
134
+ Any modification to these fields invalidates the signature.
135
+
136
+ ---
137
+
138
+ ### 6.2 Algorithm Requirements
139
+
140
+ * **Required:** `ed25519`
141
+ * **Encoding:** Base64
142
+ * **Key identification:** `keyId` MUST be globally unique per registry
143
+
144
+ ---
145
+
146
+ ### 6.3 Public Key Trust Store
147
+
148
+ Registry public keys are stored locally at:
149
+
150
+ ```txt
151
+ ~/.add-skill/trusted-registries.json
152
+ ```
153
+
154
+ Example:
155
+
156
+ ```json
157
+ {
158
+ "dataguruin": {
159
+ "keys": {
160
+ "dataguruin-registry-v1": "BASE64_PUBLIC_KEY"
161
+ }
162
+ }
163
+ }
164
+ ```
165
+
166
+ Rules:
167
+
168
+ * Unknown registry → WARN (FAIL in `--strict`)
169
+ * Invalid signature → FAIL (always)
170
+ * Expired or rotated keys MUST be explicitly trusted
171
+
172
+ ---
173
+
174
+ ## 7. Client Resolution Flow
175
+
176
+ ### 7.1 Fetch & Cache
177
+
178
+ 1. Download `index.json`
179
+ 2. Verify signature
180
+ 3. Cache locally
181
+ 4. Use cached copy when offline
182
+
183
+ Signature verification is mandatory even when using cached data.
184
+
185
+ ---
186
+
187
+ ### 7.2 Install Resolution Order
188
+
189
+ When installing a skill, the client resolves metadata in the following order:
190
+
191
+ ```
192
+ 1. skill-lock.json (--locked mode)
193
+ 2. Local registry (registry.json)
194
+ 3. Remote registry v2 (signed index)
195
+ 4. Explicit org/repo reference
196
+ ```
197
+
198
+ The first successful resolution wins.
199
+
200
+ ---
201
+
202
+ ## 8. Registry Semantics
203
+
204
+ ### 8.1 Registry vs Lock File
205
+
206
+ | Aspect | Registry | Lock File |
207
+ | ---------- | --------- | ----------- |
208
+ | Purpose | Discovery | Determinism |
209
+ | Mutability | Mutable | Immutable |
210
+ | Authority | Advisory | Absolute |
211
+ | CI Usage | Optional | Mandatory |
212
+
213
+ Registry data must **never** override lock file constraints.
214
+
215
+ ---
216
+
217
+ ### 8.2 Version Semantics
218
+
219
+ * Each version entry is immutable
220
+ * Checksum MUST NOT change after publication
221
+ * `latest` is a convenience pointer, not authoritative
222
+
223
+ ---
224
+
225
+ ## 9. Client Commands (Registry-Aware)
226
+
227
+ ### 9.1 Add Registry
228
+
229
+ ```bash
230
+ add-skill registry add https://registry.example.com/index.json
231
+ ```
232
+
233
+ ---
234
+
235
+ ### 9.2 List Registries
236
+
237
+ ```bash
238
+ add-skill registry list
239
+ ```
240
+
241
+ ---
242
+
243
+ ### 9.3 Search Skills
244
+
245
+ ```bash
246
+ add-skill search <query>
247
+ ```
248
+
249
+ Search includes:
250
+
251
+ * Skill name
252
+ * Description
253
+ * Tags
254
+
255
+ ---
256
+
257
+ ### 9.4 Skill Information
258
+
259
+ ```bash
260
+ add-skill info <skill-name>
261
+ ```
262
+
263
+ Displays:
264
+
265
+ * Publisher
266
+ * Repository
267
+ * Available versions
268
+ * Registry source
269
+ * Signature status
270
+
271
+ ---
272
+
273
+ ## 10. Security Guarantees
274
+
275
+ Registry v2 guarantees:
276
+
277
+ * Registry tampering is detectable
278
+ * Skill substitution is prevented by checksum verification
279
+ * CDN compromise does not bypass trust
280
+ * Silent metadata modification is impossible
281
+
282
+ ---
283
+
284
+ ## 11. Failure Modes (EXPLICIT)
285
+
286
+ | Condition | Client Behavior |
287
+ | ------------------- | ------------------------ |
288
+ | Invalid signature | FAIL |
289
+ | Unknown registry | WARN / FAIL (`--strict`) |
290
+ | Network unavailable | Use cached registry |
291
+ | Skill missing | FAIL |
292
+ | Checksum mismatch | FAIL |
293
+
294
+ ---
295
+
296
+ ## 12. Governance Recommendations
297
+
298
+ * One registry per publisher identity
299
+ * Separate keys for:
300
+
301
+ * Registry signing
302
+ * Skill signing
303
+ * Key rotation via `keyId`
304
+ * Public audit of registry history
305
+
306
+ ---
307
+
308
+ ## 13. Forward Compatibility
309
+
310
+ Registry v2 is designed to support future extensions, including:
311
+
312
+ * Paid skills
313
+ * License metadata
314
+ * Organization namespaces
315
+ * Policy enforcement
316
+ * Audit logs
317
+ * Marketplace integration
318
+
319
+ Backward compatibility must be preserved.
320
+
321
+ ---
322
+
323
+ ## 14. Design Philosophy
324
+
325
+ Registry metadata is **signed policy**, not documentation.
326
+
327
+ Trust must be explicit.
328
+ Verification must be mandatory.
329
+ Distribution must be passive.
330
+ Silence is a bug.
331
+
332
+ ---
333
+
334
+ **END OF REGISTRY V2 SPEC**