cmp-standards 2.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 (238) hide show
  1. package/README.md +541 -0
  2. package/dist/analytics/index.d.ts +5 -0
  3. package/dist/analytics/index.d.ts.map +1 -0
  4. package/dist/analytics/index.js +5 -0
  5. package/dist/analytics/index.js.map +1 -0
  6. package/dist/analytics/tracker.d.ts +107 -0
  7. package/dist/analytics/tracker.d.ts.map +1 -0
  8. package/dist/analytics/tracker.js +333 -0
  9. package/dist/analytics/tracker.js.map +1 -0
  10. package/dist/auto-improve/eslint-generator.d.ts +36 -0
  11. package/dist/auto-improve/eslint-generator.d.ts.map +1 -0
  12. package/dist/auto-improve/eslint-generator.js +280 -0
  13. package/dist/auto-improve/eslint-generator.js.map +1 -0
  14. package/dist/auto-improve/index.d.ts +6 -0
  15. package/dist/auto-improve/index.d.ts.map +1 -0
  16. package/dist/auto-improve/index.js +6 -0
  17. package/dist/auto-improve/index.js.map +1 -0
  18. package/dist/auto-improve/pattern-detector.d.ts +92 -0
  19. package/dist/auto-improve/pattern-detector.d.ts.map +1 -0
  20. package/dist/auto-improve/pattern-detector.js +231 -0
  21. package/dist/auto-improve/pattern-detector.js.map +1 -0
  22. package/dist/cli/index.d.ts +18 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +769 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/dashboard/index.d.ts +6 -0
  27. package/dist/dashboard/index.d.ts.map +1 -0
  28. package/dist/dashboard/index.js +6 -0
  29. package/dist/dashboard/index.js.map +1 -0
  30. package/dist/dashboard/server.d.ts +15 -0
  31. package/dist/dashboard/server.d.ts.map +1 -0
  32. package/dist/dashboard/server.js +373 -0
  33. package/dist/dashboard/server.js.map +1 -0
  34. package/dist/dashboard/ui.d.ts +9 -0
  35. package/dist/dashboard/ui.d.ts.map +1 -0
  36. package/dist/dashboard/ui.js +530 -0
  37. package/dist/dashboard/ui.js.map +1 -0
  38. package/dist/db/client.d.ts +66 -0
  39. package/dist/db/client.d.ts.map +1 -0
  40. package/dist/db/client.js +159 -0
  41. package/dist/db/client.js.map +1 -0
  42. package/dist/db/drizzle-client.d.ts +302 -0
  43. package/dist/db/drizzle-client.d.ts.map +1 -0
  44. package/dist/db/drizzle-client.js +404 -0
  45. package/dist/db/drizzle-client.js.map +1 -0
  46. package/dist/db/index.d.ts +5 -0
  47. package/dist/db/index.d.ts.map +1 -0
  48. package/dist/db/index.js +5 -0
  49. package/dist/db/index.js.map +1 -0
  50. package/dist/eslint/config-builder.d.ts +45 -0
  51. package/dist/eslint/config-builder.d.ts.map +1 -0
  52. package/dist/eslint/config-builder.js +128 -0
  53. package/dist/eslint/config-builder.js.map +1 -0
  54. package/dist/eslint/index.d.ts +161 -0
  55. package/dist/eslint/index.d.ts.map +1 -0
  56. package/dist/eslint/index.js +106 -0
  57. package/dist/eslint/index.js.map +1 -0
  58. package/dist/eslint/rules/consistent-error-handling.d.ts +9 -0
  59. package/dist/eslint/rules/consistent-error-handling.d.ts.map +1 -0
  60. package/dist/eslint/rules/consistent-error-handling.js +52 -0
  61. package/dist/eslint/rules/consistent-error-handling.js.map +1 -0
  62. package/dist/eslint/rules/finance-ledger-sync.d.ts +12 -0
  63. package/dist/eslint/rules/finance-ledger-sync.d.ts.map +1 -0
  64. package/dist/eslint/rules/finance-ledger-sync.js +72 -0
  65. package/dist/eslint/rules/finance-ledger-sync.js.map +1 -0
  66. package/dist/eslint/rules/no-async-useeffect.d.ts +10 -0
  67. package/dist/eslint/rules/no-async-useeffect.d.ts.map +1 -0
  68. package/dist/eslint/rules/no-async-useeffect.js +49 -0
  69. package/dist/eslint/rules/no-async-useeffect.js.map +1 -0
  70. package/dist/eslint/rules/no-await-in-loop.d.ts +10 -0
  71. package/dist/eslint/rules/no-await-in-loop.d.ts.map +1 -0
  72. package/dist/eslint/rules/no-await-in-loop.js +51 -0
  73. package/dist/eslint/rules/no-await-in-loop.js.map +1 -0
  74. package/dist/eslint/rules/no-inline-functions-in-jsx.d.ts +10 -0
  75. package/dist/eslint/rules/no-inline-functions-in-jsx.d.ts.map +1 -0
  76. package/dist/eslint/rules/no-inline-functions-in-jsx.js +45 -0
  77. package/dist/eslint/rules/no-inline-functions-in-jsx.js.map +1 -0
  78. package/dist/eslint/rules/no-raw-sql.d.ts +19 -0
  79. package/dist/eslint/rules/no-raw-sql.d.ts.map +1 -0
  80. package/dist/eslint/rules/no-raw-sql.js +136 -0
  81. package/dist/eslint/rules/no-raw-sql.js.map +1 -0
  82. package/dist/eslint/rules/no-sequential-api-calls.d.ts +10 -0
  83. package/dist/eslint/rules/no-sequential-api-calls.d.ts.map +1 -0
  84. package/dist/eslint/rules/no-sequential-api-calls.js +72 -0
  85. package/dist/eslint/rules/no-sequential-api-calls.js.map +1 -0
  86. package/dist/eslint/rules/prefer-server-components.d.ts +10 -0
  87. package/dist/eslint/rules/prefer-server-components.d.ts.map +1 -0
  88. package/dist/eslint/rules/prefer-server-components.js +76 -0
  89. package/dist/eslint/rules/prefer-server-components.js.map +1 -0
  90. package/dist/eslint/rules/require-loading-states.d.ts +9 -0
  91. package/dist/eslint/rules/require-loading-states.d.ts.map +1 -0
  92. package/dist/eslint/rules/require-loading-states.js +85 -0
  93. package/dist/eslint/rules/require-loading-states.js.map +1 -0
  94. package/dist/eslint/rules/require-zod-validation.d.ts +10 -0
  95. package/dist/eslint/rules/require-zod-validation.d.ts.map +1 -0
  96. package/dist/eslint/rules/require-zod-validation.js +70 -0
  97. package/dist/eslint/rules/require-zod-validation.js.map +1 -0
  98. package/dist/eslint/rules/semantic-tokens-only.d.ts +10 -0
  99. package/dist/eslint/rules/semantic-tokens-only.d.ts.map +1 -0
  100. package/dist/eslint/rules/semantic-tokens-only.js +62 -0
  101. package/dist/eslint/rules/semantic-tokens-only.js.map +1 -0
  102. package/dist/feedback/collector.d.ts +74 -0
  103. package/dist/feedback/collector.d.ts.map +1 -0
  104. package/dist/feedback/collector.js +231 -0
  105. package/dist/feedback/collector.js.map +1 -0
  106. package/dist/feedback/index.d.ts +5 -0
  107. package/dist/feedback/index.d.ts.map +1 -0
  108. package/dist/feedback/index.js +5 -0
  109. package/dist/feedback/index.js.map +1 -0
  110. package/dist/hooks/index.d.ts +8 -0
  111. package/dist/hooks/index.d.ts.map +1 -0
  112. package/dist/hooks/index.js +8 -0
  113. package/dist/hooks/index.js.map +1 -0
  114. package/dist/hooks/memory-checkpoint.d.ts +43 -0
  115. package/dist/hooks/memory-checkpoint.d.ts.map +1 -0
  116. package/dist/hooks/memory-checkpoint.js +257 -0
  117. package/dist/hooks/memory-checkpoint.js.map +1 -0
  118. package/dist/hooks/post-tool-use.d.ts +61 -0
  119. package/dist/hooks/post-tool-use.d.ts.map +1 -0
  120. package/dist/hooks/post-tool-use.js +262 -0
  121. package/dist/hooks/post-tool-use.js.map +1 -0
  122. package/dist/hooks/pre-tool-use.d.ts +34 -0
  123. package/dist/hooks/pre-tool-use.d.ts.map +1 -0
  124. package/dist/hooks/pre-tool-use.js +358 -0
  125. package/dist/hooks/pre-tool-use.js.map +1 -0
  126. package/dist/hooks/session-start.d.ts +38 -0
  127. package/dist/hooks/session-start.d.ts.map +1 -0
  128. package/dist/hooks/session-start.js +274 -0
  129. package/dist/hooks/session-start.js.map +1 -0
  130. package/dist/index.d.ts +29 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +39 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/mcp/index.d.ts +5 -0
  135. package/dist/mcp/index.d.ts.map +1 -0
  136. package/dist/mcp/index.js +5 -0
  137. package/dist/mcp/index.js.map +1 -0
  138. package/dist/mcp/server.d.ts +42 -0
  139. package/dist/mcp/server.d.ts.map +1 -0
  140. package/dist/mcp/server.js +599 -0
  141. package/dist/mcp/server.js.map +1 -0
  142. package/dist/registry/embeddings.d.ts +38 -0
  143. package/dist/registry/embeddings.d.ts.map +1 -0
  144. package/dist/registry/embeddings.js +110 -0
  145. package/dist/registry/embeddings.js.map +1 -0
  146. package/dist/registry/generator.d.ts +41 -0
  147. package/dist/registry/generator.d.ts.map +1 -0
  148. package/dist/registry/generator.js +323 -0
  149. package/dist/registry/generator.js.map +1 -0
  150. package/dist/registry/index.d.ts +6 -0
  151. package/dist/registry/index.d.ts.map +1 -0
  152. package/dist/registry/index.js +6 -0
  153. package/dist/registry/index.js.map +1 -0
  154. package/dist/services/IdeaCollector.d.ts +103 -0
  155. package/dist/services/IdeaCollector.d.ts.map +1 -0
  156. package/dist/services/IdeaCollector.js +371 -0
  157. package/dist/services/IdeaCollector.js.map +1 -0
  158. package/dist/services/ProjectScaffold.d.ts +76 -0
  159. package/dist/services/ProjectScaffold.d.ts.map +1 -0
  160. package/dist/services/ProjectScaffold.js +479 -0
  161. package/dist/services/ProjectScaffold.js.map +1 -0
  162. package/dist/services/ProjectScanner.d.ts +81 -0
  163. package/dist/services/ProjectScanner.d.ts.map +1 -0
  164. package/dist/services/ProjectScanner.js +349 -0
  165. package/dist/services/ProjectScanner.js.map +1 -0
  166. package/dist/services/TaskTracker.d.ts +89 -0
  167. package/dist/services/TaskTracker.d.ts.map +1 -0
  168. package/dist/services/TaskTracker.js +324 -0
  169. package/dist/services/TaskTracker.js.map +1 -0
  170. package/dist/services/WorkPlanManager.d.ts +107 -0
  171. package/dist/services/WorkPlanManager.d.ts.map +1 -0
  172. package/dist/services/WorkPlanManager.js +440 -0
  173. package/dist/services/WorkPlanManager.js.map +1 -0
  174. package/dist/services/auto-inject.d.ts +77 -0
  175. package/dist/services/auto-inject.d.ts.map +1 -0
  176. package/dist/services/auto-inject.js +289 -0
  177. package/dist/services/auto-inject.js.map +1 -0
  178. package/dist/services/auto-tag.d.ts +61 -0
  179. package/dist/services/auto-tag.d.ts.map +1 -0
  180. package/dist/services/auto-tag.js +203 -0
  181. package/dist/services/auto-tag.js.map +1 -0
  182. package/dist/services/cross-project-sync.d.ts +76 -0
  183. package/dist/services/cross-project-sync.d.ts.map +1 -0
  184. package/dist/services/cross-project-sync.js +235 -0
  185. package/dist/services/cross-project-sync.js.map +1 -0
  186. package/dist/services/index.d.ts +17 -0
  187. package/dist/services/index.d.ts.map +1 -0
  188. package/dist/services/index.js +23 -0
  189. package/dist/services/index.js.map +1 -0
  190. package/dist/services/memory-consolidation.d.ts +77 -0
  191. package/dist/services/memory-consolidation.d.ts.map +1 -0
  192. package/dist/services/memory-consolidation.js +298 -0
  193. package/dist/services/memory-consolidation.js.map +1 -0
  194. package/dist/services/semantic-search.d.ts +93 -0
  195. package/dist/services/semantic-search.d.ts.map +1 -0
  196. package/dist/services/semantic-search.js +278 -0
  197. package/dist/services/semantic-search.js.map +1 -0
  198. package/dist/services/weekly-digest.d.ts +105 -0
  199. package/dist/services/weekly-digest.d.ts.map +1 -0
  200. package/dist/services/weekly-digest.js +292 -0
  201. package/dist/services/weekly-digest.js.map +1 -0
  202. package/dist/types/index.d.ts +274 -0
  203. package/dist/types/index.d.ts.map +1 -0
  204. package/dist/types/index.js +84 -0
  205. package/dist/types/index.js.map +1 -0
  206. package/dist/utils/config.d.ts +21 -0
  207. package/dist/utils/config.d.ts.map +1 -0
  208. package/dist/utils/config.js +89 -0
  209. package/dist/utils/config.js.map +1 -0
  210. package/dist/utils/index.d.ts +6 -0
  211. package/dist/utils/index.d.ts.map +1 -0
  212. package/dist/utils/index.js +6 -0
  213. package/dist/utils/index.js.map +1 -0
  214. package/dist/utils/paths.d.ts +28 -0
  215. package/dist/utils/paths.d.ts.map +1 -0
  216. package/dist/utils/paths.js +80 -0
  217. package/dist/utils/paths.js.map +1 -0
  218. package/package.json +95 -0
  219. package/templates/agents/architecture-expert.md +61 -0
  220. package/templates/agents/database-expert.md +62 -0
  221. package/templates/agents/documentation-expert.md +57 -0
  222. package/templates/agents/memory-expert.md +88 -0
  223. package/templates/agents/performance-expert.md +61 -0
  224. package/templates/agents/security-expert.md +59 -0
  225. package/templates/agents/ux-expert.md +63 -0
  226. package/templates/agents/worker.md +75 -0
  227. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -0
  228. package/templates/commands/experts.md +138 -0
  229. package/templates/hooks/README.md +158 -0
  230. package/templates/hooks/project.config.json.template +77 -0
  231. package/templates/hooks/settings.local.json.template +57 -0
  232. package/templates/memory-config.json +82 -0
  233. package/templates/memory-config.schema.json +212 -0
  234. package/templates/settings.json +58 -0
  235. package/templates/workflows/business-improvement.md +264 -0
  236. package/templates/workflows/expert-review.md +153 -0
  237. package/templates/workflows/internal-app.md +245 -0
  238. package/templates/workflows/sync-docs.md +187 -0
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/settings.json",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": "*",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "npx cmp-memory session-context"
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "PreToolUse": [
16
+ {
17
+ "matcher": "Edit|Write",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "npx cmp-memory pre-tool-guard"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "matcher": "Task",
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "npx cmp-memory inject-knowledge"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "PostToolUse": [
36
+ {
37
+ "matcher": "Edit|Write",
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "npx cmp-memory checkpoint"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ "allowedTools": [
48
+ "Read",
49
+ "Glob",
50
+ "Grep",
51
+ "WebSearch",
52
+ "WebFetch"
53
+ ],
54
+ "denyTools": [],
55
+ "contextWindow": 200000,
56
+ "model": "opus"
57
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "./memory-config.schema.json",
3
+ "system": "SWARMSCALE",
4
+ "projectName": "SwarmScale",
5
+ "description": "AI-powered marketing agency platform",
6
+ "domains": [
7
+ "video-studio",
8
+ "avatars",
9
+ "content-ideas",
10
+ "campaigns",
11
+ "knowledge-base",
12
+ "social-media",
13
+ "ai-services",
14
+ "infrastructure"
15
+ ],
16
+ "guards": {
17
+ "enabled": true,
18
+ "rules": [
19
+ {
20
+ "id": "schema-protection",
21
+ "type": "block",
22
+ "filePattern": "src/server/schema/auth.ts",
23
+ "contentTrigger": ".*",
24
+ "message": "PANEL_* tables are READ-ONLY. Do not modify auth.ts.",
25
+ "allowOverride": false
26
+ },
27
+ {
28
+ "id": "dev-items-filter",
29
+ "type": "warn",
30
+ "filePattern": "**/*.ts",
31
+ "contentTrigger": "from\\(devItems\\)(?!.*\\.where.*system)",
32
+ "message": "Always filter DEV_Items by system='SWARMSCALE'",
33
+ "allowOverride": true
34
+ },
35
+ {
36
+ "id": "marketing-tables-only",
37
+ "type": "warn",
38
+ "filePattern": "src/server/schema/*.ts",
39
+ "contentTrigger": "mysqlTable\\(['\"](?!MARKETING_)",
40
+ "excludeFiles": ["marketing.ts", "dev.ts", "index.ts"],
41
+ "message": "SwarmScale only owns MARKETING_* tables",
42
+ "allowOverride": true
43
+ }
44
+ ]
45
+ },
46
+ "embedding": {
47
+ "enabled": true,
48
+ "threshold": 0.60,
49
+ "maxSections": 3,
50
+ "prioritizeCritical": true,
51
+ "providers": ["openai", "gemini"]
52
+ },
53
+ "checkpoint": {
54
+ "enabled": true,
55
+ "minLinesChanged": 20,
56
+ "criticalPaths": [
57
+ "src/server/schema/**",
58
+ "src/server/api/routers/**"
59
+ ],
60
+ "excludePaths": [
61
+ "**/*.test.ts",
62
+ "**/*.spec.ts",
63
+ "**/*.d.ts",
64
+ "**/node_modules/**"
65
+ ],
66
+ "autoTagging": true,
67
+ "patternDetection": true
68
+ },
69
+ "autoImprovement": {
70
+ "enabled": true,
71
+ "violationThreshold": 3,
72
+ "generateEslintRules": true,
73
+ "createMemoryEntries": true,
74
+ "updateClaudeMd": false
75
+ },
76
+ "sessionContext": {
77
+ "loadMemoriesOnStart": true,
78
+ "maxMemoriesLoaded": 5,
79
+ "cacheTimeout": 3600,
80
+ "showAvailableCommands": true
81
+ }
82
+ }
@@ -0,0 +1,212 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "MetaNautical Memory Configuration",
4
+ "description": "Configuration schema for the MetaNautical Memory Plugin",
5
+ "type": "object",
6
+ "required": ["system", "domains"],
7
+ "properties": {
8
+ "system": {
9
+ "type": "string",
10
+ "description": "System identifier for data isolation (e.g., SWARMSCALE, PANEL)",
11
+ "enum": ["SWARMSCALE", "PANEL", "ECOSYSTEM", "ELLIOT", "CONNECTA_HOTEL", "CONNECTA_CREW", "EASYCHARTER", "EASYYACHTS", "GMB", "CLIENT"]
12
+ },
13
+ "projectName": {
14
+ "type": "string",
15
+ "description": "Human-readable project name"
16
+ },
17
+ "description": {
18
+ "type": "string",
19
+ "description": "Brief project description"
20
+ },
21
+ "domains": {
22
+ "type": "array",
23
+ "description": "List of domain/module identifiers for this project",
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "guards": {
29
+ "type": "object",
30
+ "description": "Pre-tool guard configuration",
31
+ "properties": {
32
+ "enabled": {
33
+ "type": "boolean",
34
+ "default": true
35
+ },
36
+ "rules": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["id", "type", "filePattern", "message"],
41
+ "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "description": "Unique rule identifier"
45
+ },
46
+ "type": {
47
+ "type": "string",
48
+ "enum": ["block", "warn", "suggest"],
49
+ "description": "Action type: block stops operation, warn allows with message, suggest shows optional advice"
50
+ },
51
+ "filePattern": {
52
+ "type": "string",
53
+ "description": "Glob pattern for matching files"
54
+ },
55
+ "contentTrigger": {
56
+ "type": "string",
57
+ "description": "Regex pattern for matching content"
58
+ },
59
+ "excludeFiles": {
60
+ "type": "array",
61
+ "items": { "type": "string" },
62
+ "description": "Files to exclude from this rule"
63
+ },
64
+ "message": {
65
+ "type": "string",
66
+ "description": "Message to display when rule triggers"
67
+ },
68
+ "allowOverride": {
69
+ "type": "boolean",
70
+ "default": false,
71
+ "description": "Whether @guard-ignore comment can bypass this rule"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ },
78
+ "embedding": {
79
+ "type": "object",
80
+ "description": "Embedding-based progressive disclosure configuration",
81
+ "properties": {
82
+ "enabled": {
83
+ "type": "boolean",
84
+ "default": true
85
+ },
86
+ "threshold": {
87
+ "type": "number",
88
+ "minimum": 0,
89
+ "maximum": 1,
90
+ "default": 0.60,
91
+ "description": "Minimum similarity threshold for section matching"
92
+ },
93
+ "maxSections": {
94
+ "type": "integer",
95
+ "minimum": 1,
96
+ "maximum": 10,
97
+ "default": 3,
98
+ "description": "Maximum number of sections to inject"
99
+ },
100
+ "prioritizeCritical": {
101
+ "type": "boolean",
102
+ "default": true,
103
+ "description": "Whether to prioritize CRITICAL sections over similarity"
104
+ },
105
+ "providers": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "string",
109
+ "enum": ["openai", "gemini"]
110
+ },
111
+ "description": "Embedding providers in order of preference"
112
+ }
113
+ }
114
+ },
115
+ "checkpoint": {
116
+ "type": "object",
117
+ "description": "Memory checkpoint configuration",
118
+ "properties": {
119
+ "enabled": {
120
+ "type": "boolean",
121
+ "default": true
122
+ },
123
+ "minLinesChanged": {
124
+ "type": "integer",
125
+ "minimum": 1,
126
+ "default": 20,
127
+ "description": "Minimum lines changed to trigger checkpoint"
128
+ },
129
+ "criticalPaths": {
130
+ "type": "array",
131
+ "items": { "type": "string" },
132
+ "description": "Glob patterns for critical paths that always trigger checkpoint"
133
+ },
134
+ "excludePaths": {
135
+ "type": "array",
136
+ "items": { "type": "string" },
137
+ "description": "Glob patterns for paths to exclude from checkpoints"
138
+ },
139
+ "autoTagging": {
140
+ "type": "boolean",
141
+ "default": true,
142
+ "description": "Automatically tag checkpoints based on content"
143
+ },
144
+ "patternDetection": {
145
+ "type": "boolean",
146
+ "default": true,
147
+ "description": "Enable pattern detection for auto-improvement"
148
+ }
149
+ }
150
+ },
151
+ "autoImprovement": {
152
+ "type": "object",
153
+ "description": "Auto-improvement system configuration",
154
+ "properties": {
155
+ "enabled": {
156
+ "type": "boolean",
157
+ "default": true
158
+ },
159
+ "violationThreshold": {
160
+ "type": "integer",
161
+ "minimum": 1,
162
+ "default": 3,
163
+ "description": "Number of violations before auto-improvement triggers"
164
+ },
165
+ "generateEslintRules": {
166
+ "type": "boolean",
167
+ "default": true,
168
+ "description": "Automatically generate ESLint rules for repeated violations"
169
+ },
170
+ "createMemoryEntries": {
171
+ "type": "boolean",
172
+ "default": true,
173
+ "description": "Create memory entries for patterns"
174
+ },
175
+ "updateClaudeMd": {
176
+ "type": "boolean",
177
+ "default": false,
178
+ "description": "Automatically update CLAUDE.md with new rules"
179
+ }
180
+ }
181
+ },
182
+ "sessionContext": {
183
+ "type": "object",
184
+ "description": "Session start context configuration",
185
+ "properties": {
186
+ "loadMemoriesOnStart": {
187
+ "type": "boolean",
188
+ "default": true,
189
+ "description": "Load relevant memories at session start"
190
+ },
191
+ "maxMemoriesLoaded": {
192
+ "type": "integer",
193
+ "minimum": 0,
194
+ "maximum": 20,
195
+ "default": 5,
196
+ "description": "Maximum memories to load per session"
197
+ },
198
+ "cacheTimeout": {
199
+ "type": "integer",
200
+ "minimum": 0,
201
+ "default": 3600,
202
+ "description": "Cache timeout in seconds"
203
+ },
204
+ "showAvailableCommands": {
205
+ "type": "boolean",
206
+ "default": true,
207
+ "description": "Show available commands at session start"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$comment": "Template settings.json for MetaNautical Memory Plugin",
3
+ "claudeMdPath": "CLAUDE.md",
4
+ "mcpConfigPath": ".claude/mcp-minimal.json",
5
+ "hooks": {
6
+ "PreToolUse": [
7
+ {
8
+ "matcher": "Task",
9
+ "hooks": [
10
+ {
11
+ "type": "command",
12
+ "command": "npx tsx .claude/hooks/pre-tool-use-embedding.ts"
13
+ }
14
+ ]
15
+ },
16
+ {
17
+ "matcher": "Edit",
18
+ "hooks": [
19
+ {
20
+ "type": "prompt",
21
+ "prompt": "file://.claude/hooks/pre-tool-use-guards.md"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "matcher": "Write",
27
+ "hooks": [
28
+ {
29
+ "type": "prompt",
30
+ "prompt": "file://.claude/hooks/pre-tool-use-guards.md"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "SessionStart": [
36
+ {
37
+ "matcher": "",
38
+ "hooks": [
39
+ {
40
+ "type": "prompt",
41
+ "prompt": "file://.claude/hooks/session-start-context-loader.md"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ "plugins": {
48
+ "metanautical-memory": {
49
+ "version": "1.0.0",
50
+ "enabled": true,
51
+ "configPath": ".claude/memory-config.json"
52
+ },
53
+ "claude-mem": {
54
+ "autoSync": true,
55
+ "syncOnSessionStart": true
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,264 @@
1
+ ---
2
+ description: "/business-improvement - Self-improving research system that enhances business documents through web research"
3
+ ---
4
+
5
+ # /business-improvement - Self-Improving Research System
6
+
7
+ > **Purpose**: Continuously improve business knowledge base through iterative web research
8
+ > **Philosophy**: Research -> Learn -> Document -> Generate Follow-ups -> Repeat
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ The `/business-improvement` command is a **self-improving research engine** that:
15
+
16
+ 1. **Researches** - Executes web searches on business/marketing topics
17
+ 2. **Learns** - Extracts key insights and facts from results
18
+ 3. **Documents** - Updates or creates files with new knowledge
19
+ 4. **Generates** - Produces derived queries for next research cycle
20
+ 5. **Tracks** - Logs every search, learning, and improvement for meta-analysis
21
+
22
+ ---
23
+
24
+ ## Execution Protocol
25
+
26
+ ### Phase 1: Pre-Research Analysis
27
+
28
+ 1. **Review current knowledge state**
29
+ - Check existing business documentation
30
+ - Identify knowledge gaps and stale content
31
+
32
+ 2. **Identify improvement opportunities**
33
+ - Review documents for incomplete sections
34
+ - Check dates of last updates (stale content = improvement opportunity)
35
+ - Identify documents with completeness < 80%
36
+
37
+ 3. **Select focus area** based on priority:
38
+ | Priority | Topic Area | Documents |
39
+ |:---|:---|:---|
40
+ | HIGH | Strategic | Business Plan, SWOT, Value Proposition |
41
+ | MEDIUM | Market Intel | Competitor Analysis, Market Trends |
42
+ | LOW | Campaign | Content Pillars, Messaging Framework |
43
+
44
+ ---
45
+
46
+ ### Phase 2: Research Execution
47
+
48
+ 4. **Initial Research Query**
49
+ - Start with a focused, specific query related to the focus area
50
+ - Example: `"[industry] management software trends [year]"`
51
+
52
+ 5. **Execute web search**
53
+ - Use WebSearch tool with focused query
54
+ - Capture top 5-7 results
55
+
56
+ 6. **Extract Knowledge**
57
+ For each search result, extract:
58
+ ```json
59
+ {
60
+ "query": "original search query",
61
+ "source": "URL of the source",
62
+ "learnings": [
63
+ "Key fact or insight 1",
64
+ "Key fact or insight 2"
65
+ ],
66
+ "confidence": 85,
67
+ "derivedQueries": [
68
+ "Follow-up query based on learning 1",
69
+ "Follow-up query based on learning 2"
70
+ ]
71
+ }
72
+ ```
73
+
74
+ 7. **Log to Research Tracker**
75
+ - Track: Query -> Results -> Learnings -> Follow-ups
76
+
77
+ ---
78
+
79
+ ### Phase 3: Knowledge Integration
80
+
81
+ 8. **Update existing documents** (PREFERRED)
82
+ - If learning fits existing document section -> enhance it
83
+ - Add new data points, statistics, competitor info
84
+ - Update timestamps
85
+
86
+ 9. **Create new section** (if appropriate)
87
+ - Only if learning reveals entirely new topic area
88
+ - Must be extremely relevant to the business
89
+
90
+ 10. **Format documents beautifully**
91
+ - Use structured markdown for visual appeal
92
+ - Include tables for comparative data
93
+ - Use H1/H2/H3, lists, quotes
94
+ - Add emojis sparingly for scanability
95
+
96
+ ---
97
+
98
+ ### Phase 4: Session Documentation
99
+
100
+ 11. **Create Research Session Report**
101
+ ```json
102
+ {
103
+ "sessionId": "ULID",
104
+ "date": "YYYY-MM-DD",
105
+ "topic": "Research Focus Area",
106
+ "queriesExecuted": 5,
107
+ "learningsAcquired": 12,
108
+ "documentsUpdated": ["value_proposition", "swot"],
109
+ "derivedQueriesPending": [
110
+ "Follow-up query 1",
111
+ "Follow-up query 2"
112
+ ],
113
+ "nextSessionPriority": "HIGH"
114
+ }
115
+ ```
116
+
117
+ 12. **Update task tracker**
118
+ - Mark improvements in task list
119
+ - Add new items for pending derived queries
120
+
121
+ ---
122
+
123
+ ## Research Query Framework
124
+
125
+ ### Query Templates by Topic
126
+
127
+ **Competitor Analysis:**
128
+ - `"[Competitor] pricing [year]"`
129
+ - `"[Competitor] features comparison"`
130
+ - `"[Competitor] customer reviews [year]"`
131
+
132
+ **Market Trends:**
133
+ - `"[industry] market size [year]"`
134
+ - `"[industry] software trends"`
135
+ - `"B2B SaaS [industry]"`
136
+
137
+ **Audience Research:**
138
+ - `"[target audience] pain points"`
139
+ - `"[industry] software needs"`
140
+ - `"[user type] app features"`
141
+
142
+ **Product Positioning:**
143
+ - `"all-in-one [industry] management"`
144
+ - `"[product type] software comparison"`
145
+ - `"[industry] operations automation"`
146
+
147
+ ---
148
+
149
+ ## Expert Review Integration
150
+
151
+ After completing research, invoke `/experts` for validation:
152
+
153
+ - **Security Expert**: No sensitive data exposed
154
+ - **Architecture Expert**: Document structure valid
155
+ - **UX Expert**: Content follows brand voice
156
+ - **Memory Expert**: Patterns detected, auto-improvements triggered
157
+
158
+ ---
159
+
160
+ ## Document Quality Standards
161
+
162
+ ### Visual Format Requirements
163
+
164
+ Every document must have:
165
+ - Clear H1 title
166
+ - Executive summary (2-3 sentences)
167
+ - Structured sections with H2/H3
168
+ - Tables for comparative data
169
+ - Bullet lists for quick scanning
170
+ - Timestamps (created/updated)
171
+ - Source citations where applicable
172
+
173
+ ### Content Quality Checks
174
+ - No placeholder text ("lorem ipsum", "TBD")
175
+ - No outdated data (> 6 months old)
176
+ - No unsupported claims
177
+ - Specific numbers and dates
178
+ - Competitor names and products
179
+ - Actionable insights
180
+
181
+ ---
182
+
183
+ ## Example Session Output
184
+
185
+ ```
186
+ ## Business Improvement Session
187
+
188
+ Date: YYYY-MM-DD
189
+ Focus: Competitor Pricing Update
190
+
191
+ ### Queries Executed
192
+ 1. "[Competitor A] pricing model [year]" -> 3 learnings
193
+ 2. "[Competitor B] subscription tiers" -> 2 learnings
194
+ 3. "[Competitor A] vs [Competitor B]" -> 4 learnings
195
+
196
+ ### Knowledge Acquired
197
+ - Competitor A uses flat monthly fee (no commission)
198
+ - Competitor B: $99-499/month based on usage
199
+ - Competitor C: Legacy pricing, higher cost
200
+ - Market trend: Moving away from per-transaction %
201
+
202
+ ### Documents Updated
203
+ - Value Proposition Canvas - Added competitive pricing section
204
+ - SWOT Analysis - Updated threats with pricing pressure
205
+
206
+ ### Derived Queries (Next Session)
207
+ - "[Competitor A] API capabilities"
208
+ - "[Industry] software free trial comparison"
209
+ - "[Market segment] market share [year]"
210
+
211
+ ### Session Score: 4/5
212
+ Learnings: 9 | Documents: 2 | Next queries: 3
213
+ ```
214
+
215
+ ---
216
+
217
+ ## Automation Hooks
218
+
219
+ ### Recommended Schedule
220
+ - **Weekly**: Run basic improvement cycle (1 focus area)
221
+ - **Monthly**: Deep dive on all priority areas
222
+ - **Quarterly**: Full competitive landscape refresh
223
+
224
+ ### Integration with CLI
225
+ ```bash
226
+ # Future enhancement
227
+ cmp-memory improve --topic "competitors"
228
+ cmp-memory improve --pending # Process derived queries
229
+ cmp-memory improve --status # Show improvement metrics
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Success Metrics
235
+
236
+ The system is working correctly if:
237
+
238
+ - **Query coverage** - All topic areas researched quarterly
239
+ - **Learning rate** - 5+ new insights per session
240
+ - **Document freshness** - No content older than 3 months
241
+ - **Derived query backlog** - Always have next topics ready
242
+ - **Pattern detection** - Memory Expert finds recurring themes
243
+
244
+ ---
245
+
246
+ ## When to Use /business-improvement
247
+
248
+ ### Use When:
249
+ - Need to update market intelligence
250
+ - Competitor released new features/pricing
251
+ - Preparing for investor/client presentations
252
+ - Monthly knowledge refresh cycle
253
+ - After major product launch by competitor
254
+
255
+ ### Don't Use For:
256
+ - Quick fact-checking (use direct web search)
257
+ - Creating new documents from scratch (use `/experts implement`)
258
+ - Trivial content updates (edit directly)
259
+
260
+ ---
261
+
262
+ The `/business-improvement` command transforms your business knowledge base into a **living, self-improving system**. Each research session makes the next one more targeted through derived queries.
263
+
264
+ **Pro tip**: Run `/business-improvement` weekly on rotating topics to maintain fresh, competitive intelligence.