@chongyan/autospec 1.0.2 → 1.0.4

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 (688) hide show
  1. package/LICENSE +240 -21
  2. package/README.md +47 -608
  3. package/dist/README.md +47 -0
  4. package/dist/adapters/claude-code/README.md.enc +6 -0
  5. package/dist/adapters/claude-code/agents.js +1 -0
  6. package/dist/adapters/claude-code/commands.config.js +1 -0
  7. package/dist/adapters/claude-code/commands.js +1 -0
  8. package/dist/adapters/claude-code/hooks.config.js +2 -0
  9. package/dist/adapters/claude-code/hooks.js +1 -0
  10. package/dist/adapters/claude-code/install.js +1 -0
  11. package/dist/adapters/claude-code/skills.js +1 -0
  12. package/dist/adapters/codex/README.md.enc +6 -0
  13. package/dist/adapters/codex/hooks/pre-commit.sh +10 -0
  14. package/dist/adapters/codex/install.js +1 -0
  15. package/dist/adapters/codex/prompts/env-learn.md.enc +6 -0
  16. package/dist/adapters/codex/prompts/review.md.enc +6 -0
  17. package/dist/adapters/codex/wrappers/autospec-cli.sh +118 -0
  18. package/dist/adapters/codex/wrappers/parallel.sh +20 -0
  19. package/dist/adapters/codex/wrappers/post-task.sh +138 -0
  20. package/dist/bin/autospec.js +2 -0
  21. package/dist/knowledge/README.md.enc +6 -0
  22. package/dist/knowledge/change-management.md.enc +6 -0
  23. package/dist/knowledge/cognition-engine.md.enc +6 -0
  24. package/dist/knowledge/config/baseline-permissions.md.enc +6 -0
  25. package/dist/knowledge/config/external-mounts.yaml.enc +6 -0
  26. package/dist/knowledge/config/model-profiles.yaml.enc +6 -0
  27. package/dist/knowledge/config/role-composition.yaml.enc +6 -0
  28. package/dist/knowledge/config/token-optimization.yaml.enc +6 -0
  29. package/dist/knowledge/config/validation-patterns.yaml.enc +6 -0
  30. package/dist/knowledge/constitution.md.enc +6 -0
  31. package/dist/knowledge/core-rules.md.enc +6 -0
  32. package/dist/knowledge/environment/adapters/README.md.enc +6 -0
  33. package/dist/knowledge/environment/detection-patterns.yaml.enc +6 -0
  34. package/dist/knowledge/environment/failure-patterns.json +223 -0
  35. package/dist/knowledge/environment/repair-strategies.json +206 -0
  36. package/dist/knowledge/memory/README.md.enc +6 -0
  37. package/dist/knowledge/memory/field/README.md.enc +6 -0
  38. package/dist/knowledge/memory/project/decisions/README.md.enc +6 -0
  39. package/dist/knowledge/memory/project/evolution-log.md.enc +6 -0
  40. package/dist/knowledge/memory/project/health-metrics.md.enc +6 -0
  41. package/dist/knowledge/memory/team/best-practices.md.enc +6 -0
  42. package/dist/knowledge/pipeline/code.md.enc +6 -0
  43. package/dist/knowledge/pipeline/explore.md.enc +6 -0
  44. package/dist/knowledge/pipeline/plan.md.enc +6 -0
  45. package/dist/knowledge/pipeline/protocol.md.enc +6 -0
  46. package/dist/knowledge/protocol/capabilities.yaml.enc +6 -0
  47. package/dist/knowledge/protocol/evolve-integration.md.enc +6 -0
  48. package/dist/knowledge/skills/README.md.enc +6 -0
  49. package/dist/knowledge/skills/adversarial-review.md.enc +6 -0
  50. package/dist/knowledge/skills/analyze-requirement.md.enc +6 -0
  51. package/dist/knowledge/skills/channel-operations.md.enc +6 -0
  52. package/dist/knowledge/skills/content-operations.md.enc +6 -0
  53. package/dist/knowledge/skills/content-prompts.md.enc +6 -0
  54. package/dist/knowledge/skills/conversion-optimization.md.enc +6 -0
  55. package/dist/knowledge/skills/data-operations.md.enc +6 -0
  56. package/dist/knowledge/skills/design-solution.md.enc +6 -0
  57. package/dist/knowledge/skills/growth-strategies.md.enc +6 -0
  58. package/dist/knowledge/skills/implement-code.md.enc +6 -0
  59. package/dist/knowledge/skills/knowledge-distill.md.enc +6 -0
  60. package/dist/knowledge/skills/parallel-dev.md.enc +6 -0
  61. package/dist/knowledge/skills/private-domain-traffic.md.enc +6 -0
  62. package/dist/knowledge/skills/skill-format.md.enc +6 -0
  63. package/dist/knowledge/skills/social-commerce.md.enc +6 -0
  64. package/dist/knowledge/skills/team-orchestration.md.enc +6 -0
  65. package/dist/knowledge/skills/unified-review.md.enc +6 -0
  66. package/dist/knowledge/skills/user-operations.md.enc +6 -0
  67. package/dist/knowledge/templates/autospec-config.yaml.enc +6 -0
  68. package/dist/knowledge/templates/smoke-test.md.enc +6 -0
  69. package/dist/knowledge/templates/spec/SPEC.md.enc +6 -0
  70. package/dist/knowledge/templates/spec/layers/delta.md.enc +6 -0
  71. package/dist/knowledge/templates/spec/layers/how.md.enc +6 -0
  72. package/dist/knowledge/templates/spec/layers/plan.md.enc +6 -0
  73. package/dist/knowledge/templates/spec/layers/what.md.enc +6 -0
  74. package/dist/knowledge/templates/spec/layers/why.md.enc +6 -0
  75. package/dist/knowledge/templates/wiki/catalog.yaml.enc +6 -0
  76. package/dist/knowledge/templates/wiki/content.md.enc +6 -0
  77. package/dist/knowledge/templates/wiki/meta.yaml.enc +6 -0
  78. package/dist/package.json +54 -0
  79. package/{plugins → dist/plugins}/.claude-plugin/plugin.json +259 -101
  80. package/dist/plugins/agents/roles/ai-engineer.md.enc +6 -0
  81. package/dist/plugins/agents/roles/backend-engineer.md.enc +6 -0
  82. package/dist/plugins/agents/roles/ceo.md.enc +6 -0
  83. package/dist/plugins/agents/roles/channel-ops.md.enc +6 -0
  84. package/dist/plugins/agents/roles/content-ops.md.enc +6 -0
  85. package/dist/plugins/agents/roles/conversion-ops.md.enc +6 -0
  86. package/dist/plugins/agents/roles/data-engineer.md.enc +6 -0
  87. package/dist/plugins/agents/roles/data-ops.md.enc +6 -0
  88. package/dist/plugins/agents/roles/devops-engineer.md.enc +6 -0
  89. package/dist/plugins/agents/roles/frontend-engineer.md.enc +6 -0
  90. package/dist/plugins/agents/roles/marketing-director.md.enc +6 -0
  91. package/dist/plugins/agents/roles/operations-director.md.enc +6 -0
  92. package/dist/plugins/agents/roles/private-traffic.md.enc +6 -0
  93. package/dist/plugins/agents/roles/product-owner.md.enc +6 -0
  94. package/dist/plugins/agents/roles/quality-engineer.md.enc +6 -0
  95. package/dist/plugins/agents/roles/security-engineer.md.enc +6 -0
  96. package/dist/plugins/agents/roles/tech-lead.md.enc +6 -0
  97. package/dist/plugins/agents/roles/user-ops.md.enc +6 -0
  98. package/dist/plugins/agents/support/blind-comparator.md.enc +6 -0
  99. package/dist/plugins/agents/support/consistency-checker.md.enc +6 -0
  100. package/dist/plugins/agents/support/experiment-evaluator.md.enc +6 -0
  101. package/dist/plugins/agents/support/failure-diagnostician.md.enc +6 -0
  102. package/dist/plugins/agents/support/independent-reviewer.md.enc +6 -0
  103. package/dist/plugins/agents/support/memory-curator.md.enc +6 -0
  104. package/dist/plugins/agents/support/monitoring-agent.md.enc +6 -0
  105. package/dist/plugins/agents/support/safety-auditor.md.enc +6 -0
  106. package/dist/plugins/agents/support/skill-benchmarker.md.enc +6 -0
  107. package/dist/plugins/agents/support/skill-forger.md.enc +6 -0
  108. package/dist/plugins/agents/support/stage-gate-evaluator.md.enc +6 -0
  109. package/dist/plugins/agents/support/team-orchestrator.md.enc +6 -0
  110. package/dist/plugins/agents/support/test-coverage-reviewer.md.enc +6 -0
  111. package/dist/plugins/benchmarks/templates/README.md.enc +6 -0
  112. package/dist/plugins/benchmarks/templates/commands/code-template.yaml.enc +6 -0
  113. package/dist/plugins/benchmarks/templates/commands/explore-template.yaml.enc +6 -0
  114. package/dist/plugins/benchmarks/templates/commands/field-evolve-template.yaml.enc +6 -0
  115. package/dist/plugins/benchmarks/templates/commands/plan-template.yaml.enc +6 -0
  116. package/dist/plugins/benchmarks/templates/commands/project-evolve-template.yaml.enc +6 -0
  117. package/dist/plugins/benchmarks/templates/commands/review-template.yaml.enc +6 -0
  118. package/dist/plugins/benchmarks/templates/commands/run-template.yaml.enc +6 -0
  119. package/dist/plugins/benchmarks/templates/skills/benchmark-executor-template.yaml.enc +6 -0
  120. package/dist/plugins/benchmarks/templates/skills/benchmark-generator-template.yaml.enc +6 -0
  121. package/dist/plugins/benchmarks/templates/skills/delivery-stage-template.yaml.enc +6 -0
  122. package/dist/plugins/benchmarks/templates/skills/design-stage-template.yaml.enc +6 -0
  123. package/dist/plugins/benchmarks/templates/skills/exploration-phase-template.yaml.enc +6 -0
  124. package/dist/plugins/benchmarks/templates/skills/field-evolve-analyzer-template.yaml.enc +6 -0
  125. package/dist/plugins/benchmarks/templates/skills/field-evolve-distiller-template.yaml.enc +6 -0
  126. package/dist/plugins/benchmarks/templates/skills/field-evolve-executor-template.yaml.enc +6 -0
  127. package/dist/plugins/benchmarks/templates/skills/field-evolve-fixer-template.yaml.enc +6 -0
  128. package/dist/plugins/benchmarks/templates/skills/field-evolve-learner-template.yaml.enc +6 -0
  129. package/dist/plugins/benchmarks/templates/skills/field-evolve-scanner-template.yaml.enc +6 -0
  130. package/dist/plugins/benchmarks/templates/skills/field-evolve-template.yaml.enc +6 -0
  131. package/dist/plugins/benchmarks/templates/skills/field-evolve-verifier-template.yaml.enc +6 -0
  132. package/dist/plugins/benchmarks/templates/skills/implementation-stage-template.yaml.enc +6 -0
  133. package/dist/plugins/benchmarks/templates/skills/layer1-validation-template.yaml.enc +6 -0
  134. package/dist/plugins/benchmarks/templates/skills/project-evolve-analyzer-template.yaml.enc +6 -0
  135. package/dist/plugins/benchmarks/templates/skills/project-evolve-fixer-template.yaml.enc +6 -0
  136. package/dist/plugins/benchmarks/templates/skills/project-evolve-generator-template.yaml.enc +6 -0
  137. package/dist/plugins/benchmarks/templates/skills/project-evolve-learner-template.yaml.enc +6 -0
  138. package/dist/plugins/benchmarks/templates/skills/project-evolve-reviewer-template.yaml.enc +6 -0
  139. package/dist/plugins/benchmarks/templates/skills/project-evolve-scanner-template.yaml.enc +6 -0
  140. package/dist/plugins/benchmarks/templates/skills/project-evolve-template.yaml.enc +6 -0
  141. package/dist/plugins/benchmarks/templates/skills/project-evolve-verifier-template.yaml.enc +6 -0
  142. package/dist/plugins/benchmarks/templates/skills/requirement-analyzer-template.yaml.enc +6 -0
  143. package/dist/plugins/benchmarks/templates/skills/skill-forge-template.yaml.enc +6 -0
  144. package/dist/plugins/benchmarks/templates/skills/startup-guard-template.yaml.enc +6 -0
  145. package/dist/plugins/benchmarks/templates/skills/testing-stage-template.yaml.enc +6 -0
  146. package/dist/plugins/commands/README.md.enc +6 -0
  147. package/dist/plugins/commands/automation.md.enc +6 -0
  148. package/dist/plugins/commands/code.md.enc +6 -0
  149. package/dist/plugins/commands/contribute.md.enc +6 -0
  150. package/dist/plugins/commands/dashboard.md.enc +6 -0
  151. package/dist/plugins/commands/env.md.enc +6 -0
  152. package/dist/plugins/commands/explore.md.enc +6 -0
  153. package/dist/plugins/commands/field-evolve.md.enc +6 -0
  154. package/dist/plugins/commands/global.md.enc +6 -0
  155. package/dist/plugins/commands/init.md.enc +6 -0
  156. package/dist/plugins/commands/list.md.enc +6 -0
  157. package/dist/plugins/commands/memory.md.enc +6 -0
  158. package/dist/plugins/commands/monitor.md.enc +6 -0
  159. package/dist/plugins/commands/org.md.enc +6 -0
  160. package/dist/plugins/commands/persist.md.enc +6 -0
  161. package/dist/plugins/commands/plan.md.enc +6 -0
  162. package/dist/plugins/commands/plugin.md.enc +6 -0
  163. package/dist/plugins/commands/project-evolve.md.enc +6 -0
  164. package/dist/plugins/commands/review.md.enc +6 -0
  165. package/dist/plugins/commands/run.md.enc +6 -0
  166. package/dist/plugins/commands/status.md.enc +6 -0
  167. package/dist/plugins/commands/sync.md.enc +6 -0
  168. package/dist/plugins/commands/update.md.enc +6 -0
  169. package/dist/plugins/env-capabilities/env-core/plugin.json +33 -0
  170. package/dist/plugins/hooks/README.md.enc +6 -0
  171. package/dist/plugins/hooks/artifact-evaluation-hook.js +2 -0
  172. package/dist/plugins/hooks/cognitive-dreamer.js +2 -0
  173. package/dist/plugins/hooks/cognitive-sync.js +2 -0
  174. package/dist/plugins/hooks/cognitive-tracker.js +2 -0
  175. package/dist/plugins/hooks/config/detection-patterns.yaml.enc +6 -0
  176. package/dist/plugins/hooks/constitution-guard.js +2 -0
  177. package/dist/plugins/hooks/do-review-separation-guard.js +2 -0
  178. package/dist/plugins/hooks/environment-autocommit.js +2 -0
  179. package/dist/plugins/hooks/environment-doctor.js +1 -0
  180. package/dist/plugins/hooks/environment-startup-scan.js +2 -0
  181. package/dist/plugins/hooks/execution-tracker.js +2 -0
  182. package/dist/plugins/hooks/frozen-zone-guard.js +2 -0
  183. package/dist/plugins/hooks/layer1-validator.js +2 -0
  184. package/dist/plugins/hooks/lib/artifact-evaluator.js +1 -0
  185. package/dist/plugins/hooks/lib/assets/asset-decision-store.js +1 -0
  186. package/dist/plugins/hooks/lib/assets/asset-graph.js +1 -0
  187. package/dist/plugins/hooks/lib/assets/asset-hydrator.js +1 -0
  188. package/dist/plugins/hooks/lib/assets/asset-outcome-store.js +1 -0
  189. package/dist/plugins/hooks/lib/assets/asset-projection-compiler.js +1 -0
  190. package/dist/plugins/hooks/lib/assets/asset-registry.js +1 -0
  191. package/dist/plugins/hooks/lib/assets/asset-selector.js +1 -0
  192. package/dist/plugins/hooks/lib/assets/index.js +1 -0
  193. package/dist/plugins/hooks/lib/assets/paths.js +1 -0
  194. package/dist/plugins/hooks/lib/assets/projection-targets/claude-code.js +1 -0
  195. package/dist/plugins/hooks/lib/assets/projection-targets/codex.js +1 -0
  196. package/dist/plugins/hooks/lib/auto-fix-loop.js +1 -0
  197. package/dist/plugins/hooks/lib/benchmarks/change-detector.js +1 -0
  198. package/dist/plugins/hooks/lib/benchmarks/evaluator.js +1 -0
  199. package/dist/plugins/hooks/lib/benchmarks/integration-example.js +1 -0
  200. package/dist/plugins/hooks/lib/cognitive/adaptive-matcher.js +1 -0
  201. package/dist/plugins/hooks/lib/cognitive/base-store.js +1 -0
  202. package/dist/plugins/hooks/lib/cognitive/causal-engine.js +1 -0
  203. package/dist/plugins/hooks/lib/cognitive/cognitive-config.js +1 -0
  204. package/dist/plugins/hooks/lib/cognitive/cognitive-fingerprint.js +1 -0
  205. package/dist/plugins/hooks/lib/cognitive/collective-sync.js +1 -0
  206. package/dist/plugins/hooks/lib/cognitive/confidence-engine.js +1 -0
  207. package/dist/plugins/hooks/lib/cognitive/dream-engine.js +1 -0
  208. package/dist/plugins/hooks/lib/cognitive/episodic-store.js +1 -0
  209. package/dist/plugins/hooks/lib/cognitive/index.js +1 -0
  210. package/dist/plugins/hooks/lib/cognitive/kernel.js +1 -0
  211. package/dist/plugins/hooks/lib/cognitive/knowledge-distiller.js +1 -0
  212. package/dist/plugins/hooks/lib/cognitive/memory-transport.js +1 -0
  213. package/dist/plugins/hooks/lib/cognitive/persistence-manager.js +1 -0
  214. package/dist/plugins/hooks/lib/cognitive/priority-store.js +1 -0
  215. package/dist/plugins/hooks/lib/cognitive/procedural-store.js +1 -0
  216. package/dist/plugins/hooks/lib/cognitive/semantic-store.js +1 -0
  217. package/dist/plugins/hooks/lib/cognitive/skill-forge-candidate-loader.js +1 -0
  218. package/dist/plugins/hooks/lib/cognitive/skill-forge-draft.js +1 -0
  219. package/dist/plugins/hooks/lib/cognitive/skill-forge-proposal.js +1 -0
  220. package/dist/plugins/hooks/lib/cognitive/skill-forge-queue.js +1 -0
  221. package/dist/plugins/hooks/lib/cognitive/skill-tuner.js +1 -0
  222. package/dist/plugins/hooks/lib/cognitive/wiki-materializer.js +1 -0
  223. package/dist/plugins/hooks/lib/detection-pattern-loader.js +1 -0
  224. package/dist/plugins/hooks/lib/directory-discovery.js +1 -0
  225. package/dist/plugins/hooks/lib/environment-capability-package.js +1 -0
  226. package/dist/plugins/hooks/lib/environment-capability-probe.js +1 -0
  227. package/dist/plugins/hooks/lib/environment-config-loader.js +1 -0
  228. package/dist/plugins/hooks/lib/environment-executor.js +1 -0
  229. package/dist/plugins/hooks/lib/environment-feedback.js +1 -0
  230. package/dist/plugins/hooks/lib/environment-health-monitor.js +1 -0
  231. package/dist/plugins/hooks/lib/environment-knowledge-synthesizer.js +1 -0
  232. package/dist/plugins/hooks/lib/environment-knowledge-validator.js +1 -0
  233. package/dist/plugins/hooks/lib/environment-learning-discoverer.js +1 -0
  234. package/dist/plugins/hooks/lib/environment-learning-engine.js +1 -0
  235. package/dist/plugins/hooks/lib/environment-module-repository.js +1 -0
  236. package/dist/plugins/hooks/lib/environment-planner.js +1 -0
  237. package/dist/plugins/hooks/lib/environment-plugin-registry.js +1 -0
  238. package/dist/plugins/hooks/lib/environment-readiness.js +1 -0
  239. package/dist/plugins/hooks/lib/environment-route-ranking.js +1 -0
  240. package/dist/plugins/hooks/lib/environment-strategy-overlay.js +1 -0
  241. package/dist/plugins/hooks/lib/execution-path.js +1 -0
  242. package/dist/plugins/hooks/lib/external-mount-adapter.js +1 -0
  243. package/dist/plugins/hooks/lib/external-scanner.js +1 -0
  244. package/dist/plugins/hooks/lib/hook-error-recorder.js +1 -0
  245. package/dist/plugins/hooks/lib/hook-logger.js +1 -0
  246. package/dist/plugins/hooks/lib/hook-runner.js +2 -0
  247. package/dist/plugins/hooks/lib/hook-state-manager.js +1 -0
  248. package/dist/plugins/hooks/lib/memory-extractor.js +1 -0
  249. package/dist/plugins/hooks/lib/memory-manager.js +1 -0
  250. package/dist/plugins/hooks/lib/metrics-analyzer.js +1 -0
  251. package/dist/plugins/hooks/lib/mount-manager.js +1 -0
  252. package/dist/plugins/hooks/lib/plugin-activation-registry.js +1 -0
  253. package/dist/plugins/hooks/lib/plugin-selector.js +1 -0
  254. package/dist/plugins/hooks/lib/plugin-source-registry.js +1 -0
  255. package/dist/plugins/hooks/lib/plugin-workspace-registry.js +1 -0
  256. package/dist/plugins/hooks/lib/project-evolution/auto-fixer.js +1 -0
  257. package/dist/plugins/hooks/lib/project-evolution/memory-manager.js +1 -0
  258. package/dist/plugins/hooks/lib/project-evolution/pattern-detector.js +1 -0
  259. package/dist/plugins/hooks/lib/project-evolution/semantic-indexer.js +1 -0
  260. package/dist/plugins/hooks/lib/rollback-tracker.js +1 -0
  261. package/dist/plugins/hooks/lib/source-code-scanner.js +1 -0
  262. package/dist/plugins/hooks/lib/technology-stack-detector.js +1 -0
  263. package/dist/plugins/hooks/lib/test-failure-analyzer.js +1 -0
  264. package/dist/plugins/hooks/lib/test-failure-fixer.js +1 -0
  265. package/dist/plugins/hooks/lib/trace-context.js +1 -0
  266. package/dist/plugins/hooks/lib/validation-patterns.js +1 -0
  267. package/dist/plugins/hooks/memory-sync.js +1 -0
  268. package/dist/plugins/hooks/pipeline-observer.js +2 -0
  269. package/dist/plugins/hooks/retry-limit-guard.js +2 -0
  270. package/dist/plugins/hooks/scope-sentinel.js +2 -0
  271. package/dist/plugins/hooks/secret-scanner.js +2 -0
  272. package/dist/plugins/hooks/stop-evolve-prompt.js +1 -0
  273. package/dist/plugins/hooks/trace-initialization.js +2 -0
  274. package/dist/plugins/hooks/version-checker.js +2 -0
  275. package/dist/plugins/memory/templates/code-quality.yaml.enc +6 -0
  276. package/dist/plugins/memory/templates/multi-system.yaml.enc +6 -0
  277. package/dist/plugins/memory/templates/team-habits.yaml.enc +6 -0
  278. package/dist/plugins/memory/templates/testing.yaml.enc +6 -0
  279. package/dist/plugins/skills/README.md.enc +6 -0
  280. package/dist/plugins/skills/ab-test-executor/SKILL.md.enc +6 -0
  281. package/dist/plugins/skills/benchmark-executor/SKILL.md.enc +6 -0
  282. package/dist/plugins/skills/benchmark-generator/SKILL.md.enc +6 -0
  283. package/dist/plugins/skills/content-prompts/SKILL.md.enc +6 -0
  284. package/dist/plugins/skills/delivery-stage/SKILL.md.enc +6 -0
  285. package/dist/plugins/skills/design-stage/SKILL.md.enc +6 -0
  286. package/dist/plugins/skills/environment-learning/SKILL.md.enc +6 -0
  287. package/dist/plugins/skills/environment-resilience/build-failure-doctor.md.enc +6 -0
  288. package/dist/plugins/skills/environment-resilience/environment-repair.md.enc +6 -0
  289. package/dist/plugins/skills/environment-resilience/pre-flight-check.md.enc +6 -0
  290. package/dist/plugins/skills/experiment-evaluator/SKILL.md.enc +6 -0
  291. package/dist/plugins/skills/exploration-phase/SKILL.md.enc +6 -0
  292. package/dist/plugins/skills/field-evolve-analyzer/SKILL.md.enc +6 -0
  293. package/dist/plugins/skills/field-evolve-distiller/SKILL.md.enc +6 -0
  294. package/dist/plugins/skills/field-evolve-executor/SKILL.md.enc +6 -0
  295. package/dist/plugins/skills/field-evolve-executor/executor.js +2 -0
  296. package/dist/plugins/skills/field-evolve-fixer/SKILL.md.enc +6 -0
  297. package/dist/plugins/skills/field-evolve-learner/SKILL.md.enc +6 -0
  298. package/dist/plugins/skills/field-evolve-scanner/SKILL.md.enc +6 -0
  299. package/dist/plugins/skills/field-evolve-scanner/scripts/fallback-scanner.js +2 -0
  300. package/dist/plugins/skills/field-evolve-verifier/SKILL.md.enc +6 -0
  301. package/dist/plugins/skills/heartbeat-monitor/SKILL.md.enc +6 -0
  302. package/dist/plugins/skills/implementation-stage/SKILL.md.enc +6 -0
  303. package/dist/plugins/skills/layer1-validation/SKILL.md.enc +6 -0
  304. package/dist/plugins/skills/multi-role-orchestration/SKILL.md.enc +6 -0
  305. package/dist/plugins/skills/ops-content-marketing/SKILL.md.enc +6 -0
  306. package/dist/plugins/skills/ops-conversion/SKILL.md.enc +6 -0
  307. package/dist/plugins/skills/ops-data-driven/SKILL.md.enc +6 -0
  308. package/dist/plugins/skills/ops-growth-strategies/SKILL.md.enc +6 -0
  309. package/dist/plugins/skills/ops-private-domain/SKILL.md.enc +6 -0
  310. package/dist/plugins/skills/ops-social-commerce/SKILL.md.enc +6 -0
  311. package/dist/plugins/skills/ops-user-growth/SKILL.md.enc +6 -0
  312. package/dist/plugins/skills/pending-dashboard/SKILL.md.enc +6 -0
  313. package/dist/plugins/skills/project-evolve-analyzer/SKILL.md.enc +6 -0
  314. package/dist/plugins/skills/project-evolve-fixer/SKILL.md.enc +6 -0
  315. package/dist/plugins/skills/project-evolve-generator/SKILL.md.enc +6 -0
  316. package/dist/plugins/skills/project-evolve-learner/SKILL.md.enc +6 -0
  317. package/dist/plugins/skills/project-evolve-reviewer/SKILL.md.enc +6 -0
  318. package/dist/plugins/skills/project-evolve-scanner/SKILL.md.enc +6 -0
  319. package/dist/plugins/skills/project-evolve-scanner/scripts/dependency-reuse-checker.js +2 -0
  320. package/dist/plugins/skills/project-evolve-scanner/scripts/subsystem-coverage.js +2 -0
  321. package/dist/plugins/skills/project-evolve-verifier/SKILL.md.enc +6 -0
  322. package/dist/plugins/skills/requirement-stage/SKILL.md.enc +6 -0
  323. package/dist/plugins/skills/secret-scanner/SKILL.md.enc +6 -0
  324. package/dist/plugins/skills/skill-forge/SKILL.md.enc +6 -0
  325. package/dist/plugins/skills/skill-forge/references/description-guide.md.enc +6 -0
  326. package/dist/plugins/skills/skill-forge/references/quality-rubric.md.enc +6 -0
  327. package/dist/plugins/skills/skill-forge/references/skill-template.md.enc +6 -0
  328. package/dist/plugins/skills/startup-guard/SKILL.md.enc +6 -0
  329. package/dist/plugins/skills/tdd-workflow/SKILL.md.enc +6 -0
  330. package/dist/plugins/skills/testing-stage/SKILL.md.enc +6 -0
  331. package/dist/plugins/skills/tracking-validator/SKILL.md.enc +6 -0
  332. package/dist/scripts/build-crypto.js +2 -0
  333. package/dist/scripts/cli/assets.js +1 -0
  334. package/dist/scripts/cli/contribute.js +1 -0
  335. package/dist/scripts/cli/dashboard.js +1 -0
  336. package/dist/scripts/cli/env.js +1 -0
  337. package/dist/scripts/cli/global-init.js +1 -0
  338. package/dist/scripts/cli/global.js +1 -0
  339. package/dist/scripts/cli/index.js +1 -0
  340. package/dist/scripts/cli/init.js +1 -0
  341. package/dist/scripts/cli/list.js +1 -0
  342. package/dist/scripts/cli/memory.js +1 -0
  343. package/dist/scripts/cli/org.js +1 -0
  344. package/dist/scripts/cli/plugin.js +1 -0
  345. package/dist/scripts/cli/practice-report.js +1 -0
  346. package/dist/scripts/cli/runtime-governance.js +1 -0
  347. package/dist/scripts/cli/system.js +1 -0
  348. package/dist/scripts/cli/update.js +1 -0
  349. package/dist/scripts/commands/catalog.js +1 -0
  350. package/dist/scripts/commands/slash-command-docs.js +1 -0
  351. package/dist/scripts/config/external-mounts.config.js +2 -0
  352. package/dist/scripts/heartbeat/check.js +2 -0
  353. package/dist/scripts/heartbeat/setup-cron.js +2 -0
  354. package/dist/scripts/install/adapters.js +1 -0
  355. package/dist/scripts/install/constants.js +1 -0
  356. package/dist/scripts/install/file-reader.js +1 -0
  357. package/dist/scripts/install/index.js +1 -0
  358. package/dist/scripts/install/shards/constants-shard.js +1 -0
  359. package/dist/scripts/install/shards/crypto-config-shard.js +1 -0
  360. package/dist/scripts/install/shards/error-messages-shard.js +1 -0
  361. package/dist/scripts/install/shards/reassemble.js +1 -0
  362. package/dist/scripts/install/shards/utils-shard.js +1 -0
  363. package/dist/scripts/install/shards/version-info-shard.js +1 -0
  364. package/dist/scripts/postinstall.js +1 -0
  365. package/dist/scripts/state.js +1 -0
  366. package/package.json +22 -21
  367. package/README.en.md +0 -598
  368. package/bin/autospec.js +0 -3
  369. package/knowledge/01-principles/00-principles-hierarchy.md +0 -247
  370. package/knowledge/01-principles/01-first-principles.md +0 -241
  371. package/knowledge/01-principles/02-strategic-principles.md +0 -286
  372. package/knowledge/01-principles/03-tactical-principles.md +0 -385
  373. package/knowledge/01-principles/04-operational-principles.md +0 -275
  374. package/knowledge/01-principles/05-domain-principles.md +0 -539
  375. package/knowledge/01-principles/06-methodology-principles.md +0 -281
  376. package/knowledge/01-principles/07-cognitive-principles.md +0 -277
  377. package/knowledge/01-principles/08-auto-fix-principles.md +0 -320
  378. package/knowledge/01-principles/09-constitution.md +0 -220
  379. package/knowledge/01-principles/10-evolution-mechanism.md +0 -699
  380. package/knowledge/01-principles/README.en.md +0 -385
  381. package/knowledge/01-principles/README.md +0 -385
  382. package/knowledge/02-process/00-overview.md +0 -404
  383. package/knowledge/02-process/01-requirement.md +0 -113
  384. package/knowledge/02-process/02-design.md +0 -123
  385. package/knowledge/02-process/03-implementation.md +0 -90
  386. package/knowledge/02-process/04-review.md +0 -80
  387. package/knowledge/02-process/05-testing.md +0 -90
  388. package/knowledge/02-process/06-delivery.md +0 -88
  389. package/knowledge/02-process/README.en.md +0 -143
  390. package/knowledge/02-process/README.md +0 -186
  391. package/knowledge/03-guides/00-pipeline-protocol.md +0 -438
  392. package/knowledge/03-guides/01-team-orchestrator.md +0 -368
  393. package/knowledge/03-guides/02-analyze-requirement.md +0 -195
  394. package/knowledge/03-guides/03-design-solution.md +0 -401
  395. package/knowledge/03-guides/04-implement-code.md +0 -205
  396. package/knowledge/03-guides/05-plan-testing.md +0 -183
  397. package/knowledge/03-guides/06-generate-tests.md +0 -241
  398. package/knowledge/03-guides/07-check-release.md +0 -205
  399. package/knowledge/03-guides/08-evaluate-ai-effect.md +0 -100
  400. package/knowledge/03-guides/09-review-requirement.md +0 -83
  401. package/knowledge/03-guides/10-review-design.md +0 -83
  402. package/knowledge/03-guides/11-review-code.md +0 -111
  403. package/knowledge/03-guides/12-review-testing.md +0 -76
  404. package/knowledge/03-guides/13-audit-security.md +0 -89
  405. package/knowledge/03-guides/14-check-consistency.md +0 -177
  406. package/knowledge/03-guides/15-run-unit-tests.md +0 -83
  407. package/knowledge/03-guides/16-run-integration-tests.md +0 -105
  408. package/knowledge/03-guides/17-analyze-test-context.md +0 -250
  409. package/knowledge/03-guides/18-log-practice.md +0 -359
  410. package/knowledge/03-guides/19-distill-skill.md +0 -91
  411. package/knowledge/03-guides/20-update-skill.md +0 -45
  412. package/knowledge/03-guides/21-validate-skill.md +0 -72
  413. package/knowledge/03-guides/22-extract-methodology.md +0 -55
  414. package/knowledge/03-guides/23-infer-scope.md +0 -174
  415. package/knowledge/03-guides/24-assess-complexity.md +0 -270
  416. package/knowledge/03-guides/25-discover-component.md +0 -183
  417. package/knowledge/03-guides/26-analyze-tech-stack.md +0 -139
  418. package/knowledge/03-guides/27-scan-environment.md +0 -207
  419. package/knowledge/03-guides/28-validate-environment.md +0 -207
  420. package/knowledge/03-guides/29-generate-knowledge.md +0 -234
  421. package/knowledge/03-guides/30-analyze-ai-capability.md +0 -193
  422. package/knowledge/03-guides/31-analyze-ai-component.md +0 -169
  423. package/knowledge/03-guides/32-analyze-ai-agent.md +0 -362
  424. package/knowledge/03-guides/33-analyze-ai-rag.md +0 -339
  425. package/knowledge/03-guides/34-assess-ai-task.md +0 -418
  426. package/knowledge/03-guides/35-evaluate-ai-pipeline.md +0 -219
  427. package/knowledge/03-guides/36-evaluate-ai-artifact.md +0 -192
  428. package/knowledge/03-guides/37-plan-ai-evaluation.md +0 -374
  429. package/knowledge/03-guides/38-evaluate-ai-path.md +0 -274
  430. package/knowledge/03-guides/39-validate-ai-data.md +0 -276
  431. package/knowledge/03-guides/40-detect-ai-anomaly.md +0 -213
  432. package/knowledge/03-guides/41-diagnose-ai-test.md +0 -133
  433. package/knowledge/03-guides/42-apply-ddd.md +0 -345
  434. package/knowledge/03-guides/43-run-ai-sdlc.md +0 -475
  435. package/knowledge/03-guides/44-manage-knowledge.md +0 -369
  436. package/knowledge/03-guides/45-test-runner.md +0 -254
  437. package/knowledge/03-guides/README.en.md +0 -212
  438. package/knowledge/03-guides/README.md +0 -212
  439. package/knowledge/04-checklists/00-requirement.md +0 -169
  440. package/knowledge/04-checklists/01-design.md +0 -196
  441. package/knowledge/04-checklists/02-code.md +0 -197
  442. package/knowledge/04-checklists/03-test.md +0 -46
  443. package/knowledge/04-checklists/04-release.md +0 -70
  444. package/knowledge/04-checklists/README.en.md +0 -119
  445. package/knowledge/04-checklists/README.md +0 -123
  446. package/knowledge/05-config/00-validation-patterns.yaml +0 -137
  447. package/knowledge/05-config/01-team-stage.yaml +0 -95
  448. package/knowledge/05-config/02-team-tasks.yaml +0 -139
  449. package/knowledge/05-config/03-role-composition.yaml +0 -346
  450. package/knowledge/05-config/04-role-extensions.yaml +0 -140
  451. package/knowledge/05-config/05-skill-compositions.yaml +0 -142
  452. package/knowledge/05-config/README.en.md +0 -54
  453. package/knowledge/05-config/README.md +0 -132
  454. package/knowledge/06-environment/00-template-registry.md +0 -310
  455. package/knowledge/06-environment/01-detection-patterns.yaml +0 -1692
  456. package/knowledge/06-environment/README.en.md +0 -40
  457. package/knowledge/06-environment/README.md +0 -128
  458. package/knowledge/07-standards/00-coding-style.md +0 -1059
  459. package/knowledge/07-standards/01-code-review.md +0 -876
  460. package/knowledge/07-standards/02-data-consistency.md +0 -1085
  461. package/knowledge/07-standards/03-document-versioning.md +0 -210
  462. package/knowledge/07-standards/04-risk-detection.md +0 -186
  463. package/knowledge/07-standards/README.en.md +0 -119
  464. package/knowledge/07-standards/README.md +0 -123
  465. package/knowledge/08-organization/00-vision-mission.md +0 -113
  466. package/knowledge/08-organization/01-ai-native-culture.md +0 -318
  467. package/knowledge/08-organization/02-team-metrics.md +0 -228
  468. package/knowledge/08-organization/03-committee-structure.md +0 -54
  469. package/knowledge/08-organization/04-governance-metrics.md +0 -55
  470. package/knowledge/08-organization/05-improvement-process.md +0 -71
  471. package/knowledge/08-organization/README.en.md +0 -165
  472. package/knowledge/08-organization/README.md +0 -165
  473. package/knowledge/09-templates/00-requirement-proposal.md +0 -344
  474. package/knowledge/09-templates/01-architecture-design.md +0 -494
  475. package/knowledge/09-templates/02-api-design.md +0 -408
  476. package/knowledge/09-templates/03-database-design.md +0 -313
  477. package/knowledge/09-templates/04-product-design.md +0 -237
  478. package/knowledge/09-templates/05-domain-business.md +0 -388
  479. package/knowledge/09-templates/06-test-design.md +0 -268
  480. package/knowledge/09-templates/07-evaluation-design.md +0 -372
  481. package/knowledge/09-templates/08-component-knowledge.md +0 -272
  482. package/knowledge/09-templates/09-best-practices.md +0 -218
  483. package/knowledge/09-templates/10-middleware-knowledge.md +0 -342
  484. package/knowledge/09-templates/README.en.md +0 -222
  485. package/knowledge/09-templates/README.md +0 -216
  486. package/knowledge/README.en.md +0 -372
  487. package/knowledge/README.md +0 -399
  488. package/plugins/agents/roles/ai-engineer.md +0 -129
  489. package/plugins/agents/roles/backend-engineer.md +0 -165
  490. package/plugins/agents/roles/ceo.md +0 -94
  491. package/plugins/agents/roles/data-engineer.md +0 -135
  492. package/plugins/agents/roles/devops-engineer.md +0 -181
  493. package/plugins/agents/roles/frontend-engineer.md +0 -129
  494. package/plugins/agents/roles/product-owner.md +0 -98
  495. package/plugins/agents/roles/quality-engineer.md +0 -129
  496. package/plugins/agents/roles/security-engineer.md +0 -180
  497. package/plugins/agents/roles/tech-lead.md +0 -97
  498. package/plugins/agents/support/blind-comparator.md +0 -88
  499. package/plugins/agents/support/consistency-checker.md +0 -136
  500. package/plugins/agents/support/failure-diagnostician.md +0 -141
  501. package/plugins/agents/support/independent-reviewer.md +0 -80
  502. package/plugins/agents/support/monitoring-agent.md +0 -215
  503. package/plugins/agents/support/safety-auditor.md +0 -121
  504. package/plugins/agents/support/skill-benchmarker.md +0 -86
  505. package/plugins/agents/support/skill-forger.md +0 -105
  506. package/plugins/agents/support/stage-gate-evaluator.md +0 -205
  507. package/plugins/agents/support/test-coverage-reviewer.md +0 -73
  508. package/plugins/benchmarks/templates/README.md +0 -196
  509. package/plugins/benchmarks/templates/commands/apply-template.yaml +0 -108
  510. package/plugins/benchmarks/templates/commands/archive-template.yaml +0 -65
  511. package/plugins/benchmarks/templates/commands/env-export-template.yaml +0 -64
  512. package/plugins/benchmarks/templates/commands/env-sync-template.yaml +0 -104
  513. package/plugins/benchmarks/templates/commands/env-template-template.yaml +0 -96
  514. package/plugins/benchmarks/templates/commands/env-template.yaml +0 -58
  515. package/plugins/benchmarks/templates/commands/env-update-template.yaml +0 -110
  516. package/plugins/benchmarks/templates/commands/env-validate-template.yaml +0 -95
  517. package/plugins/benchmarks/templates/commands/explore-template.yaml +0 -48
  518. package/plugins/benchmarks/templates/commands/field-evolve-template.yaml +0 -104
  519. package/plugins/benchmarks/templates/commands/project-evolve-template.yaml +0 -104
  520. package/plugins/benchmarks/templates/commands/propose-template.yaml +0 -88
  521. package/plugins/benchmarks/templates/commands/review-template.yaml +0 -124
  522. package/plugins/benchmarks/templates/commands/run-template.yaml +0 -127
  523. package/plugins/benchmarks/templates/commands/test-template.yaml +0 -149
  524. package/plugins/benchmarks/templates/pipeline/agile-template.yaml +0 -84
  525. package/plugins/benchmarks/templates/pipeline/experiment-template.yaml +0 -92
  526. package/plugins/benchmarks/templates/pipeline/hotfix-template.yaml +0 -81
  527. package/plugins/benchmarks/templates/pipeline/waterfall-template.yaml +0 -106
  528. package/plugins/benchmarks/templates/skills/agile-iteration-template.yaml +0 -78
  529. package/plugins/benchmarks/templates/skills/benchmark-executor-template.yaml +0 -114
  530. package/plugins/benchmarks/templates/skills/benchmark-generator-template.yaml +0 -52
  531. package/plugins/benchmarks/templates/skills/delivery-stage-template.yaml +0 -130
  532. package/plugins/benchmarks/templates/skills/design-stage-template.yaml +0 -131
  533. package/plugins/benchmarks/templates/skills/experiment-iteration-template.yaml +0 -60
  534. package/plugins/benchmarks/templates/skills/exploration-phase-template.yaml +0 -114
  535. package/plugins/benchmarks/templates/skills/field-evolve-analyzer-template.yaml +0 -51
  536. package/plugins/benchmarks/templates/skills/field-evolve-distiller-template.yaml +0 -34
  537. package/plugins/benchmarks/templates/skills/field-evolve-executor-template.yaml +0 -50
  538. package/plugins/benchmarks/templates/skills/field-evolve-fixer-template.yaml +0 -52
  539. package/plugins/benchmarks/templates/skills/field-evolve-learner-template.yaml +0 -33
  540. package/plugins/benchmarks/templates/skills/field-evolve-scanner-template.yaml +0 -74
  541. package/plugins/benchmarks/templates/skills/field-evolve-template.yaml +0 -71
  542. package/plugins/benchmarks/templates/skills/field-evolve-verifier-template.yaml +0 -51
  543. package/plugins/benchmarks/templates/skills/hotfix-iteration-template.yaml +0 -54
  544. package/plugins/benchmarks/templates/skills/implementation-stage-template.yaml +0 -127
  545. package/plugins/benchmarks/templates/skills/layer1-validation-template.yaml +0 -121
  546. package/plugins/benchmarks/templates/skills/project-evolve-analyzer-template.yaml +0 -51
  547. package/plugins/benchmarks/templates/skills/project-evolve-fixer-template.yaml +0 -52
  548. package/plugins/benchmarks/templates/skills/project-evolve-generator-template.yaml +0 -34
  549. package/plugins/benchmarks/templates/skills/project-evolve-learner-template.yaml +0 -50
  550. package/plugins/benchmarks/templates/skills/project-evolve-reviewer-template.yaml +0 -50
  551. package/plugins/benchmarks/templates/skills/project-evolve-scanner-template.yaml +0 -75
  552. package/plugins/benchmarks/templates/skills/project-evolve-template.yaml +0 -72
  553. package/plugins/benchmarks/templates/skills/project-evolve-verifier-template.yaml +0 -51
  554. package/plugins/benchmarks/templates/skills/requirement-analyzer-template.yaml +0 -48
  555. package/plugins/benchmarks/templates/skills/skill-forge-template.yaml +0 -117
  556. package/plugins/benchmarks/templates/skills/startup-guard-template.yaml +0 -103
  557. package/plugins/benchmarks/templates/skills/testing-stage-template.yaml +0 -146
  558. package/plugins/benchmarks/templates/skills/waterfall-iteration-template.yaml +0 -55
  559. package/plugins/commands/README.en.md +0 -96
  560. package/plugins/commands/README.md +0 -96
  561. package/plugins/commands/apply.md +0 -277
  562. package/plugins/commands/archive.md +0 -132
  563. package/plugins/commands/env-export.md +0 -79
  564. package/plugins/commands/env-sync.md +0 -1281
  565. package/plugins/commands/env-template.md +0 -99
  566. package/plugins/commands/env-update.md +0 -264
  567. package/plugins/commands/env-validate.md +0 -176
  568. package/plugins/commands/env.md +0 -79
  569. package/plugins/commands/explore.md +0 -193
  570. package/plugins/commands/field-evolve.md +0 -412
  571. package/plugins/commands/memory.md +0 -249
  572. package/plugins/commands/project-evolve.md +0 -920
  573. package/plugins/commands/propose.md +0 -184
  574. package/plugins/commands/review.md +0 -140
  575. package/plugins/commands/run.md +0 -1052
  576. package/plugins/commands/status.md +0 -183
  577. package/plugins/commands/test.md +0 -389
  578. package/plugins/hooks/README.en.md +0 -56
  579. package/plugins/hooks/README.md +0 -56
  580. package/plugins/hooks/ai-project-guard.js +0 -329
  581. package/plugins/hooks/artifact-evaluation-hook.js +0 -237
  582. package/plugins/hooks/constitution-guard.js +0 -211
  583. package/plugins/hooks/environment-autocommit.js +0 -606
  584. package/plugins/hooks/environment-manager.js +0 -779
  585. package/plugins/hooks/execution-tracker.js +0 -459
  586. package/plugins/hooks/frozen-zone-guard.js +0 -140
  587. package/plugins/hooks/layer1-validator.js +0 -539
  588. package/plugins/hooks/lib/artifact-evaluator.js +0 -414
  589. package/plugins/hooks/lib/auto-fix-loop.js +0 -605
  590. package/plugins/hooks/lib/benchmarks/change-detector.js +0 -390
  591. package/plugins/hooks/lib/benchmarks/evaluator.js +0 -605
  592. package/plugins/hooks/lib/benchmarks/integration-example.js +0 -169
  593. package/plugins/hooks/lib/data-and-ai-detector.js +0 -275
  594. package/plugins/hooks/lib/detection-pattern-loader.js +0 -865
  595. package/plugins/hooks/lib/directory-discovery.js +0 -395
  596. package/plugins/hooks/lib/environment-config-loader.js +0 -345
  597. package/plugins/hooks/lib/environment-detector.js +0 -553
  598. package/plugins/hooks/lib/environment-evolver.js +0 -564
  599. package/plugins/hooks/lib/environment-registry.js +0 -813
  600. package/plugins/hooks/lib/execution-path.js +0 -427
  601. package/plugins/hooks/lib/hook-error-recorder.js +0 -245
  602. package/plugins/hooks/lib/hook-logger.js +0 -538
  603. package/plugins/hooks/lib/hook-runner.js +0 -97
  604. package/plugins/hooks/lib/hook-state-manager.js +0 -578
  605. package/plugins/hooks/lib/memory-extractor.js +0 -399
  606. package/plugins/hooks/lib/memory-manager.js +0 -673
  607. package/plugins/hooks/lib/metrics-analyzer.js +0 -489
  608. package/plugins/hooks/lib/project-evolution/auto-fixer.js +0 -511
  609. package/plugins/hooks/lib/project-evolution/memory-manager.js +0 -346
  610. package/plugins/hooks/lib/project-evolution/pattern-detector.js +0 -476
  611. package/plugins/hooks/lib/project-evolution/semantic-indexer.js +0 -480
  612. package/plugins/hooks/lib/project-structure-detector.js +0 -326
  613. package/plugins/hooks/lib/rollback-tracker.js +0 -346
  614. package/plugins/hooks/lib/source-code-scanner.js +0 -596
  615. package/plugins/hooks/lib/technology-stack-detector.js +0 -374
  616. package/plugins/hooks/lib/test-auto-fix.test.js +0 -194
  617. package/plugins/hooks/lib/test-failure-analyzer.js +0 -375
  618. package/plugins/hooks/lib/test-failure-fixer.js +0 -268
  619. package/plugins/hooks/lib/trace-context.js +0 -277
  620. package/plugins/hooks/lib/validation-patterns.js +0 -415
  621. package/plugins/hooks/memory-sync.js +0 -171
  622. package/plugins/hooks/monitoring-trigger.js +0 -467
  623. package/plugins/hooks/pipeline-observer.js +0 -413
  624. package/plugins/hooks/scope-sentinel.js +0 -204
  625. package/plugins/hooks/trace-initialization.js +0 -169
  626. package/plugins/memory/templates/code-quality.yaml +0 -149
  627. package/plugins/memory/templates/multi-system.yaml +0 -155
  628. package/plugins/memory/templates/team-habits.yaml +0 -119
  629. package/plugins/memory/templates/testing.yaml +0 -121
  630. package/plugins/skills/README.en.md +0 -59
  631. package/plugins/skills/README.md +0 -114
  632. package/plugins/skills/agile-iteration/SKILL.md +0 -187
  633. package/plugins/skills/benchmark-executor/SKILL.md +0 -647
  634. package/plugins/skills/benchmark-generator/SKILL.md +0 -349
  635. package/plugins/skills/delivery-stage/SKILL.md +0 -324
  636. package/plugins/skills/design-stage/SKILL.md +0 -307
  637. package/plugins/skills/experiment-evaluator/SKILL.md +0 -271
  638. package/plugins/skills/experiment-iteration/SKILL.md +0 -154
  639. package/plugins/skills/exploration-phase/SKILL.md +0 -216
  640. package/plugins/skills/field-evolve-analyzer/SKILL.md +0 -65
  641. package/plugins/skills/field-evolve-distiller/SKILL.md +0 -66
  642. package/plugins/skills/field-evolve-executor/SKILL.md +0 -94
  643. package/plugins/skills/field-evolve-executor/executor.js +0 -342
  644. package/plugins/skills/field-evolve-fixer/SKILL.md +0 -69
  645. package/plugins/skills/field-evolve-learner/SKILL.md +0 -65
  646. package/plugins/skills/field-evolve-scanner/SKILL.md +0 -87
  647. package/plugins/skills/field-evolve-scanner/scripts/fallback-scanner.js +0 -288
  648. package/plugins/skills/field-evolve-verifier/SKILL.md +0 -64
  649. package/plugins/skills/hotfix-iteration/SKILL.md +0 -279
  650. package/plugins/skills/implementation-stage/SKILL.md +0 -320
  651. package/plugins/skills/layer1-validation/SKILL.md +0 -79
  652. package/plugins/skills/pending-dashboard/SKILL.md +0 -110
  653. package/plugins/skills/project-evolve-analyzer/SKILL.md +0 -95
  654. package/plugins/skills/project-evolve-fixer/SKILL.md +0 -99
  655. package/plugins/skills/project-evolve-generator/SKILL.md +0 -149
  656. package/plugins/skills/project-evolve-learner/SKILL.md +0 -103
  657. package/plugins/skills/project-evolve-reviewer/SKILL.md +0 -104
  658. package/plugins/skills/project-evolve-scanner/SKILL.md +0 -95
  659. package/plugins/skills/project-evolve-scanner/scripts/dependency-reuse-checker.js +0 -395
  660. package/plugins/skills/project-evolve-scanner/scripts/subsystem-coverage.js +0 -315
  661. package/plugins/skills/project-evolve-verifier/SKILL.md +0 -105
  662. package/plugins/skills/requirement-stage/SKILL.md +0 -217
  663. package/plugins/skills/skill-forge/SKILL.md +0 -223
  664. package/plugins/skills/skill-forge/references/description-guide.md +0 -92
  665. package/plugins/skills/skill-forge/references/quality-rubric.md +0 -104
  666. package/plugins/skills/skill-forge/references/skill-template.md +0 -106
  667. package/plugins/skills/startup-guard/SKILL.md +0 -38
  668. package/plugins/skills/testing-stage/SKILL.md +0 -770
  669. package/plugins/skills/waterfall-iteration/SKILL.md +0 -115
  670. package/scripts/cli/global-init.js +0 -288
  671. package/scripts/cli/global.js +0 -324
  672. package/scripts/cli/index.js +0 -55
  673. package/scripts/cli/init.js +0 -408
  674. package/scripts/cli/list.js +0 -70
  675. package/scripts/cli/org.js +0 -340
  676. package/scripts/cli/update.js +0 -44
  677. package/scripts/config/commands.config.js +0 -145
  678. package/scripts/config/hooks.config.js +0 -197
  679. package/scripts/install/agents.js +0 -106
  680. package/scripts/install/commands.js +0 -133
  681. package/scripts/install/constants.js +0 -463
  682. package/scripts/install/hook-logger.js +0 -536
  683. package/scripts/install/hooks.js +0 -110
  684. package/scripts/install/index.js +0 -39
  685. package/scripts/install/skills.js +0 -95
  686. package/scripts/postinstall.js +0 -25
  687. package/scripts/state.js +0 -585
  688. /package/{plugins → dist/plugins}/hooks/lib/hook-runner.sh +0 -0
@@ -1,427 +0,0 @@
1
- /**
2
- * Execution Path - 执行路径记录模块
3
- *
4
- * 记录和分析执行路径,评估 SDD 引导效果
5
- */
6
-
7
- import fs from 'fs';
8
- import path from 'path';
9
- import { getState, getMetrics, updateMetrics } from './hook-state-manager.js';
10
- import { getTraceId, generateEventId } from './trace-context.js';
11
-
12
- /**
13
- * 路径事件类型
14
- */
15
- export const PATH_EVENT_TYPES = {
16
- COMMAND: 'command', // 命令调用
17
- STAGE: 'stage', // 阶段转换
18
- HOOK: 'hook', // Hook 触发
19
- TOOL: 'tool', // 工具调用
20
- DECISION: 'decision', // 决策点
21
- ROLLBACK: 'rollback', // 回退
22
- GATE: 'gate' // 门禁检查
23
- };
24
-
25
- /**
26
- * 记录路径事件
27
- * @param {string} projectRoot - 项目根目录
28
- * @param {string} eventType - 事件类型
29
- * @param {Object} eventData - 事件数据
30
- */
31
- export function recordPathEvent(projectRoot, eventType, eventData) {
32
- const traceId = getTraceId(projectRoot);
33
-
34
- const event = {
35
- eventId: generateEventId(),
36
- traceId,
37
- timestamp: new Date().toISOString(),
38
- type: eventType,
39
- ...eventData
40
- };
41
-
42
- // 更新 metrics.json 中的 executionPath
43
- const metrics = getMetrics(projectRoot, false);
44
-
45
- if (!metrics.executionPath) {
46
- metrics.executionPath = {
47
- commands: [],
48
- stages: [],
49
- toolStats: {},
50
- decisionStats: { total: 0, human: 0, auto: 0 },
51
- rollbackStats: { total: 0, success: 0, escalate: 0 },
52
- gateStats: { passed: 0, blocked: 0 },
53
- events: []
54
- };
55
- }
56
-
57
- // 根据事件类型更新统计
58
- switch (eventType) {
59
- case PATH_EVENT_TYPES.COMMAND:
60
- if (eventData.command && !metrics.executionPath.commands.includes(eventData.command)) {
61
- metrics.executionPath.commands.push(eventData.command);
62
- }
63
- break;
64
-
65
- case PATH_EVENT_TYPES.STAGE:
66
- if (eventData.stage && !metrics.executionPath.stages.includes(eventData.stage)) {
67
- metrics.executionPath.stages.push(eventData.stage);
68
- }
69
- break;
70
-
71
- case PATH_EVENT_TYPES.TOOL:
72
- if (eventData.tool) {
73
- metrics.executionPath.toolStats[eventData.tool] =
74
- (metrics.executionPath.toolStats[eventData.tool] || 0) + 1;
75
- }
76
- break;
77
-
78
- case PATH_EVENT_TYPES.DECISION:
79
- metrics.executionPath.decisionStats.total++;
80
- if (eventData.decisionType === 'human') {
81
- metrics.executionPath.decisionStats.human++;
82
- } else {
83
- metrics.executionPath.decisionStats.auto++;
84
- }
85
- break;
86
-
87
- case PATH_EVENT_TYPES.ROLLBACK:
88
- metrics.executionPath.rollbackStats.total++;
89
- if (eventData.outcome === 'success') {
90
- metrics.executionPath.rollbackStats.success++;
91
- } else if (eventData.outcome === 'escalate') {
92
- metrics.executionPath.rollbackStats.escalate++;
93
- }
94
- break;
95
-
96
- case PATH_EVENT_TYPES.GATE:
97
- if (eventData.passed) {
98
- metrics.executionPath.gateStats.passed++;
99
- } else {
100
- metrics.executionPath.gateStats.blocked++;
101
- }
102
- break;
103
- }
104
-
105
- // 添加事件到事件列表(限制最近 1000 个)
106
- metrics.executionPath.events.push(event);
107
- if (metrics.executionPath.events.length > 1000) {
108
- metrics.executionPath.events = metrics.executionPath.events.slice(-1000);
109
- }
110
-
111
- updateMetrics(projectRoot, metrics);
112
-
113
- return event;
114
- }
115
-
116
- /**
117
- * 生成执行路径摘要
118
- * @param {string} projectRoot - 项目根目录
119
- * @returns {Object} 执行路径摘要
120
- */
121
- export function generatePathSummary(projectRoot) {
122
- const metrics = getMetrics(projectRoot, true);
123
- const executionPath = metrics?.executionPath || {};
124
-
125
- return {
126
- // 命令序列
127
- commands: executionPath.commands || [],
128
-
129
- // 阶段路径
130
- stages: executionPath.stages || [],
131
-
132
- // 工具调用统计
133
- toolStats: executionPath.toolStats || {},
134
-
135
- // 决策点统计
136
- decisionStats: executionPath.decisionStats || { total: 0, human: 0, auto: 0 },
137
-
138
- // 回退统计
139
- rollbackStats: executionPath.rollbackStats || { total: 0, success: 0, escalate: 0 },
140
-
141
- // 门禁统计
142
- gateStats: executionPath.gateStats || { passed: 0, blocked: 0 },
143
-
144
- // 事件总数
145
- totalEvents: (executionPath.events || []).length
146
- };
147
- }
148
-
149
- /**
150
- * 提取命令序列
151
- * @param {Object} traceLog - trace 日志
152
- * @returns {Array} 命令序列
153
- */
154
- export function extractCommandSequence(traceLog) {
155
- const events = traceLog?.events || [];
156
- return events
157
- .filter(e => e.type === PATH_EVENT_TYPES.COMMAND)
158
- .map(e => ({
159
- command: e.command,
160
- timestamp: e.timestamp
161
- }));
162
- }
163
-
164
- /**
165
- * 提取阶段序列
166
- * @param {Object} traceLog - trace 日志
167
- * @returns {Array} 阶段序列
168
- */
169
- export function extractStageSequence(traceLog) {
170
- const events = traceLog?.events || [];
171
- const stages = [];
172
- const seen = new Set();
173
-
174
- for (const event of events) {
175
- if (event.type === PATH_EVENT_TYPES.STAGE && event.stage && !seen.has(event.stage)) {
176
- stages.push({
177
- stage: event.stage,
178
- timestamp: event.timestamp
179
- });
180
- seen.add(event.stage);
181
- }
182
- }
183
-
184
- return stages;
185
- }
186
-
187
- /**
188
- * 计算工具统计
189
- * @param {Object} traceLog - trace 日志
190
- * @returns {Object} 工具统计
191
- */
192
- export function calculateToolStats(traceLog) {
193
- const events = traceLog?.events || [];
194
- const stats = {};
195
-
196
- for (const event of events) {
197
- if (event.type === PATH_EVENT_TYPES.TOOL && event.tool) {
198
- stats[event.tool] = (stats[event.tool] || 0) + 1;
199
- }
200
- }
201
-
202
- return stats;
203
- }
204
-
205
- /**
206
- * 计算决策统计
207
- * @param {Object} traceLog - trace 日志
208
- * @returns {Object} 决策统计
209
- */
210
- export function calculateDecisionStats(traceLog) {
211
- const events = traceLog?.events || [];
212
- const stats = { total: 0, human: 0, auto: 0, byType: {} };
213
-
214
- for (const event of events) {
215
- if (event.type === PATH_EVENT_TYPES.DECISION) {
216
- stats.total++;
217
- if (event.decisionType === 'human') {
218
- stats.human++;
219
- } else {
220
- stats.auto++;
221
- }
222
-
223
- const decisionType = event.decisionType || 'unknown';
224
- stats.byType[decisionType] = (stats.byType[decisionType] || 0) + 1;
225
- }
226
- }
227
-
228
- return stats;
229
- }
230
-
231
- /**
232
- * 计算回退统计
233
- * @param {Object} traceLog - trace 日志
234
- * @returns {Object} 回退统计
235
- */
236
- export function calculateRollbackStats(traceLog) {
237
- const events = traceLog?.events || [];
238
- const stats = { total: 0, success: 0, escalate: 0, byLevel: {} };
239
-
240
- for (const event of events) {
241
- if (event.type === PATH_EVENT_TYPES.ROLLBACK) {
242
- stats.total++;
243
- if (event.outcome === 'success') {
244
- stats.success++;
245
- } else if (event.outcome === 'escalate') {
246
- stats.escalate++;
247
- }
248
-
249
- const level = event.level || 'unknown';
250
- stats.byLevel[level] = (stats.byLevel[level] || 0) + 1;
251
- }
252
- }
253
-
254
- return stats;
255
- }
256
-
257
- /**
258
- * 计算门禁统计
259
- * @param {Object} traceLog - trace 日志
260
- * @returns {Object} 门禁统计
261
- */
262
- export function calculateGateStats(traceLog) {
263
- const events = traceLog?.events || [];
264
- const stats = { passed: 0, blocked: 0, byGate: {} };
265
-
266
- for (const event of events) {
267
- if (event.type === PATH_EVENT_TYPES.GATE) {
268
- if (event.passed) {
269
- stats.passed++;
270
- } else {
271
- stats.blocked++;
272
- }
273
-
274
- const gate = event.gate || 'unknown';
275
- if (!stats.byGate[gate]) {
276
- stats.byGate[gate] = { passed: 0, blocked: 0 };
277
- }
278
- if (event.passed) {
279
- stats.byGate[gate].passed++;
280
- } else {
281
- stats.byGate[gate].blocked++;
282
- }
283
- }
284
- }
285
-
286
- return stats;
287
- }
288
-
289
- /**
290
- * 检测重复操作
291
- * @param {Object} traceLog - trace 日志
292
- * @returns {Array} 重复操作列表
293
- */
294
- export function detectRepeatedOperations(traceLog) {
295
- const events = traceLog?.events || [];
296
- const operations = {};
297
- const repeated = [];
298
-
299
- for (const event of events) {
300
- if (event.type === PATH_EVENT_TYPES.TOOL) {
301
- const key = `${event.tool}:${event.action || ''}`;
302
- if (!operations[key]) {
303
- operations[key] = { count: 0, timestamps: [] };
304
- }
305
- operations[key].count++;
306
- operations[key].timestamps.push(event.timestamp);
307
- }
308
- }
309
-
310
- for (const [key, data] of Object.entries(operations)) {
311
- if (data.count >= 3) {
312
- repeated.push({
313
- operation: key,
314
- count: data.count,
315
- timestamps: data.timestamps.slice(-5)
316
- });
317
- }
318
- }
319
-
320
- return repeated;
321
- }
322
-
323
- /**
324
- * 检测无效操作
325
- * @param {Object} traceLog - trace 日志
326
- * @returns {Array} 无效操作列表
327
- */
328
- export function detectWastedOperations(traceLog) {
329
- const events = traceLog?.events || [];
330
- const wasted = [];
331
-
332
- // 检测回退后重做的操作
333
- const rollbackEvents = events.filter(e => e.type === PATH_EVENT_TYPES.ROLLBACK);
334
-
335
- for (const rollback of rollbackEvents) {
336
- // 找到回退后 5 分钟内的相同操作
337
- const rollbackTime = new Date(rollback.timestamp).getTime();
338
- const relatedEvents = events.filter(e => {
339
- const eventTime = new Date(e.timestamp).getTime();
340
- return eventTime > rollbackTime && eventTime < rollbackTime + 5 * 60 * 1000;
341
- });
342
-
343
- if (relatedEvents.length > 0) {
344
- wasted.push({
345
- rollbackType: rollback.trigger,
346
- wastedCount: relatedEvents.length,
347
- message: `回退后 ${relatedEvents.length} 次操作可能为重复工作`
348
- });
349
- }
350
- }
351
-
352
- return wasted;
353
- }
354
-
355
- /**
356
- * 便捷方法:记录命令调用
357
- */
358
- export function recordCommand(projectRoot, command) {
359
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.COMMAND, { command });
360
- }
361
-
362
- /**
363
- * 便捷方法:记录阶段转换
364
- */
365
- export function recordStage(projectRoot, stage) {
366
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.STAGE, { stage });
367
- }
368
-
369
- /**
370
- * 便捷方法:记录工具调用
371
- */
372
- export function recordTool(projectRoot, tool, action = null) {
373
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.TOOL, { tool, action });
374
- }
375
-
376
- /**
377
- * 便捷方法:记录决策
378
- */
379
- export function recordDecision(projectRoot, decisionType, context = {}) {
380
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.DECISION, {
381
- decisionType,
382
- ...context
383
- });
384
- }
385
-
386
- /**
387
- * 便捷方法:记录回退
388
- */
389
- export function recordRollback(projectRoot, level, trigger, outcome, context = {}) {
390
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.ROLLBACK, {
391
- level,
392
- trigger,
393
- outcome,
394
- ...context
395
- });
396
- }
397
-
398
- /**
399
- * 便捷方法:记录门禁检查
400
- */
401
- export function recordGate(projectRoot, gate, passed, reason = null) {
402
- return recordPathEvent(projectRoot, PATH_EVENT_TYPES.GATE, {
403
- gate,
404
- passed,
405
- reason
406
- });
407
- }
408
-
409
- export default {
410
- PATH_EVENT_TYPES,
411
- recordPathEvent,
412
- generatePathSummary,
413
- extractCommandSequence,
414
- extractStageSequence,
415
- calculateToolStats,
416
- calculateDecisionStats,
417
- calculateRollbackStats,
418
- calculateGateStats,
419
- detectRepeatedOperations,
420
- detectWastedOperations,
421
- recordCommand,
422
- recordStage,
423
- recordTool,
424
- recordDecision,
425
- recordRollback,
426
- recordGate
427
- };
@@ -1,245 +0,0 @@
1
- /**
2
- * Hook 执行日志记录器
3
- *
4
- * 记录完整的 hook 执行历史,包括:
5
- * - 输入(stdin)
6
- * - 输出(stdout)
7
- * - 执行时间
8
- * - 错误信息
9
- *
10
- * 日志存储位置:.autospec/logs/hooks/hook-execution-{date}.json
11
- */
12
-
13
- import fs from 'fs';
14
- import path from 'path';
15
- import { getTraceId, generateEventId, appendTraceEvent } from './trace-context.js';
16
-
17
- /**
18
- * 获取 hook 日志目录
19
- */
20
- function getHookLogDir(projectRoot) {
21
- return path.join(projectRoot, '.autospec', 'logs', 'hooks');
22
- }
23
-
24
- /**
25
- * 确保 hook 日志目录存在
26
- */
27
- function ensureHookLogDir(projectRoot) {
28
- const logDir = getHookLogDir(projectRoot);
29
- if (!fs.existsSync(logDir)) {
30
- fs.mkdirSync(logDir, { recursive: true });
31
- }
32
- return logDir;
33
- }
34
-
35
- /**
36
- * 获取当天的 hook 日志文件路径
37
- */
38
- function getHookLogFile(projectRoot) {
39
- const date = new Date().toISOString().split('T')[0];
40
- return path.join(getHookLogDir(projectRoot), `hook-execution-${date}.json`);
41
- }
42
-
43
- /**
44
- * 读取 hook 日志
45
- */
46
- function readHookLog(projectRoot) {
47
- const logPath = getHookLogFile(projectRoot);
48
- if (fs.existsSync(logPath)) {
49
- try {
50
- return JSON.parse(fs.readFileSync(logPath, 'utf-8'));
51
- } catch {
52
- return { executions: [], errors: [], summary: {} };
53
- }
54
- }
55
- return { executions: [], errors: [], summary: {} };
56
- }
57
-
58
- /**
59
- * 写入 hook 日志
60
- */
61
- function writeHookLog(projectRoot, logData) {
62
- ensureHookLogDir(projectRoot);
63
- const logPath = getHookLogFile(projectRoot);
64
- fs.writeFileSync(logPath, JSON.stringify(logData, null, 2), 'utf-8');
65
- }
66
-
67
- /**
68
- * 记录 hook 执行(成功或失败)
69
- * @param {string} projectRoot - 项目根目录
70
- * @param {string} hookName - Hook 名称
71
- * @param {Object} input - Hook 输入
72
- * @param {Object} output - Hook 输出
73
- * @param {number} duration - 执行时长(毫秒)
74
- * @param {boolean} success - 是否成功
75
- */
76
- export function recordHookExecution(projectRoot, hookName, input, output, duration, success) {
77
- if (!projectRoot) return null;
78
-
79
- const logData = readHookLog(projectRoot);
80
- const traceId = getTraceId(projectRoot);
81
-
82
- const execution = {
83
- eventId: generateEventId(),
84
- traceId,
85
- timestamp: new Date().toISOString(),
86
- hookName,
87
- duration: `${duration}ms`,
88
- success,
89
- // 输入摘要(避免记录过大内容)
90
- input: {
91
- toolName: input?.tool_name,
92
- filePath: input?.tool_input?.file_path,
93
- event: input?.event_name
94
- },
95
- // 输出摘要
96
- output: output ? {
97
- hadPermissionDecision: !!output.hookSpecificOutput?.permissionDecision,
98
- hadAdditionalContext: !!output.hookSpecificOutput?.additionalContext
99
- } : null
100
- };
101
-
102
- logData.executions.push(execution);
103
-
104
- // 更新摘要
105
- updateSummary(logData, hookName, success);
106
-
107
- // 限制日志大小(保留最近 1000 条)
108
- if (logData.executions.length > 1000) {
109
- logData.executions = logData.executions.slice(-1000);
110
- }
111
-
112
- writeHookLog(projectRoot, logData);
113
-
114
- return execution;
115
- }
116
-
117
- /**
118
- * 记录 hook 错误
119
- * @param {string} projectRoot - 项目根目录
120
- * @param {Object} errorInfo - 错误信息
121
- */
122
- export function recordHookError(projectRoot, errorInfo) {
123
- if (!projectRoot) return null;
124
-
125
- const logData = readHookLog(projectRoot);
126
- const traceId = getTraceId(projectRoot);
127
-
128
- const errorEntry = {
129
- eventId: generateEventId(),
130
- traceId,
131
- ...errorInfo
132
- };
133
-
134
- logData.errors.push(errorEntry);
135
-
136
- // 更新错误摘要
137
- if (!logData.summary.errorsByHook) {
138
- logData.summary.errorsByHook = {};
139
- }
140
- logData.summary.errorsByHook[errorInfo.hookName] =
141
- (logData.summary.errorsByHook[errorInfo.hookName] || 0) + 1;
142
-
143
- // 限制错误日志大小
144
- if (logData.errors.length > 500) {
145
- logData.errors = logData.errors.slice(-500);
146
- }
147
-
148
- writeHookLog(projectRoot, logData);
149
-
150
- // 同时写入 trace 日志
151
- if (traceId) {
152
- appendTraceEvent(projectRoot, {
153
- eventId: errorEntry.eventId,
154
- traceId,
155
- timestamp: errorEntry.timestamp,
156
- type: 'hook_error',
157
- source: errorInfo.hookName,
158
- data: {
159
- errorType: errorInfo.errorType,
160
- errorMessage: errorInfo.errorMessage
161
- }
162
- });
163
- }
164
-
165
- return errorEntry;
166
- }
167
-
168
- /**
169
- * 更新摘要统计
170
- */
171
- function updateSummary(logData, hookName, success) {
172
- if (!logData.summary.byHook) {
173
- logData.summary.byHook = {};
174
- }
175
-
176
- if (!logData.summary.byHook[hookName]) {
177
- logData.summary.byHook[hookName] = { total: 0, success: 0, fail: 0 };
178
- }
179
-
180
- logData.summary.byHook[hookName].total++;
181
- if (success) {
182
- logData.summary.byHook[hookName].success++;
183
- } else {
184
- logData.summary.byHook[hookName].fail++;
185
- }
186
-
187
- // 计算全局统计
188
- logData.summary.totalExecutions = logData.executions.length;
189
- logData.summary.totalErrors = logData.errors.length;
190
- }
191
-
192
- /**
193
- * 获取 hook 错误率
194
- * @param {string} projectRoot - 项目根目录
195
- * @param {string} hookName - Hook 名称(可选,不传则返回全局错误率)
196
- * @returns {number} 错误率(0-1)
197
- */
198
- export function getHookErrorRate(projectRoot, hookName = null) {
199
- const logData = readHookLog(projectRoot);
200
-
201
- if (hookName) {
202
- const stats = logData.summary.byHook?.[hookName];
203
- if (!stats || stats.total === 0) return 0;
204
- return stats.fail / stats.total;
205
- }
206
-
207
- // 全局错误率
208
- const total = logData.executions.length;
209
- if (total === 0) return 0;
210
- return logData.errors.length / total;
211
- }
212
-
213
- /**
214
- * 获取最近的 hook 错误
215
- * @param {string} projectRoot - 项目根目录
216
- * @param {number} limit - 限制数量
217
- * @returns {Array} 错误列表
218
- */
219
- export function getRecentHookErrors(projectRoot, limit = 10) {
220
- const logData = readHookLog(projectRoot);
221
- return logData.errors.slice(-limit);
222
- }
223
-
224
- /**
225
- * 获取 hook 执行统计
226
- * @param {string} projectRoot - 项目根目录
227
- * @returns {Object} 统计信息
228
- */
229
- export function getHookStats(projectRoot) {
230
- const logData = readHookLog(projectRoot);
231
- return {
232
- totalExecutions: logData.summary.totalExecutions || 0,
233
- totalErrors: logData.summary.totalErrors || 0,
234
- byHook: logData.summary.byHook || {},
235
- errorsByHook: logData.summary.errorsByHook || {}
236
- };
237
- }
238
-
239
- export default {
240
- recordHookExecution,
241
- recordHookError,
242
- getHookErrorRate,
243
- getRecentHookErrors,
244
- getHookStats
245
- };