aiox-core 5.0.7 → 5.0.8

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 (191) hide show
  1. package/.aiox-core/cli/commands/pro/buyer.js +379 -0
  2. package/.aiox-core/cli/commands/pro/index.js +191 -52
  3. package/.aiox-core/cli/commands/validate/index.js +2 -0
  4. package/.aiox-core/core/code-intel/helpers/dev-helper.js +1 -1
  5. package/.aiox-core/core/code-intel/helpers/devops-helper.js +0 -1
  6. package/.aiox-core/core/code-intel/helpers/planning-helper.js +1 -1
  7. package/.aiox-core/core/code-intel/helpers/qa-helper.js +2 -2
  8. package/.aiox-core/core/config/schemas/framework-config.schema.json +1 -0
  9. package/.aiox-core/core/config/template-overrides.js +1 -1
  10. package/.aiox-core/core/doctor/checks/ide-sync.js +81 -25
  11. package/.aiox-core/core/doctor/checks/rules-files.js +0 -1
  12. package/.aiox-core/core/doctor/checks/skills-count.js +83 -15
  13. package/.aiox-core/core/graph-dashboard/cli.js +1 -2
  14. package/.aiox-core/core/graph-dashboard/data-sources/code-intel-source.js +1 -1
  15. package/.aiox-core/core/ids/layer-classifier.js +1 -1
  16. package/.aiox-core/core/pro/pro-updater.js +578 -0
  17. package/.aiox-core/core/synapse/context/context-tracker.js +107 -9
  18. package/.aiox-core/core/synapse/layers/layer-processor.js +1 -1
  19. package/.aiox-core/core-config.yaml +15 -1
  20. package/.aiox-core/data/capability-detection.js +15 -15
  21. package/.aiox-core/data/entity-registry.yaml +18 -2
  22. package/.aiox-core/data/registry-update-log.jsonl +5 -0
  23. package/.aiox-core/data/tok3-token-comparison.js +0 -4
  24. package/.aiox-core/data/tool-search-validation.js +1 -1
  25. package/.aiox-core/development/agents/aiox-master.md +44 -6
  26. package/.aiox-core/development/agents/data-engineer.md +4 -4
  27. package/.aiox-core/development/agents/devops.md +52 -2
  28. package/.aiox-core/development/agents/po.md +1 -1
  29. package/.aiox-core/development/agents/qa.md +5 -11
  30. package/.aiox-core/development/agents/sm.md +3 -3
  31. package/.aiox-core/development/agents/ux-design-expert.md +1 -1
  32. package/.aiox-core/development/scripts/unified-activation-pipeline.js +29 -3
  33. package/.aiox-core/development/tasks/dev-develop-story.md +46 -7
  34. package/.aiox-core/development/tasks/devops-pro-access-grant.md +93 -0
  35. package/.aiox-core/development/tasks/devops-pro-activate.md +42 -0
  36. package/.aiox-core/development/tasks/devops-pro-check-access.md +34 -0
  37. package/.aiox-core/development/tasks/devops-pro-request-reset.md +34 -0
  38. package/.aiox-core/development/tasks/devops-pro-resend-verification.md +32 -0
  39. package/.aiox-core/development/tasks/devops-pro-reset-password.md +36 -0
  40. package/.aiox-core/development/tasks/devops-pro-validate-login.md +36 -0
  41. package/.aiox-core/development/tasks/devops-pro-verify-status.md +33 -0
  42. package/.aiox-core/development/tasks/qa-gate.md +54 -4
  43. package/.aiox-core/development/tasks/validate-next-story.md +39 -2
  44. package/.aiox-core/framework-config.yaml +1 -0
  45. package/.aiox-core/infrastructure/scripts/codex-skills-sync/README.md +69 -0
  46. package/.aiox-core/infrastructure/scripts/codex-skills-sync/bootstrap.js +727 -0
  47. package/.aiox-core/infrastructure/scripts/codex-skills-sync/index.js +10 -0
  48. package/.aiox-core/infrastructure/scripts/codex-skills-sync/validate.js +65 -4
  49. package/.aiox-core/infrastructure/scripts/generate-settings-json.js +29 -4
  50. package/.aiox-core/infrastructure/scripts/ide-sync/agent-parser.js +4 -0
  51. package/.aiox-core/infrastructure/scripts/ide-sync/index.js +67 -7
  52. package/.aiox-core/infrastructure/scripts/ide-sync/transformers/claude-code.js +145 -3
  53. package/.aiox-core/infrastructure/scripts/repair-agent-references.js +263 -0
  54. package/.aiox-core/infrastructure/scripts/validate-claude-integration.js +60 -8
  55. package/.aiox-core/infrastructure/scripts/validate-paths.js +13 -0
  56. package/.aiox-core/install-manifest.yaml +134 -82
  57. package/.aiox-core/utils/filters/index.js +2 -1
  58. package/.claude/commands/AIOX/agents/aiox-master.md +21 -0
  59. package/.claude/commands/AIOX/agents/analyst.md +21 -0
  60. package/.claude/commands/AIOX/agents/architect.md +21 -0
  61. package/.claude/commands/AIOX/agents/data-engineer.md +21 -0
  62. package/.claude/commands/AIOX/agents/dev.md +21 -0
  63. package/.claude/commands/AIOX/agents/devops.md +21 -0
  64. package/.claude/commands/AIOX/agents/pm.md +21 -0
  65. package/.claude/commands/AIOX/agents/po.md +21 -0
  66. package/.claude/commands/AIOX/agents/qa.md +21 -0
  67. package/.claude/commands/AIOX/agents/sm.md +21 -0
  68. package/.claude/commands/AIOX/agents/squad-creator.md +21 -0
  69. package/.claude/commands/AIOX/agents/ux-design-expert.md +21 -0
  70. package/.claude/commands/AIOX/scripts/agent-config-loader.js +624 -0
  71. package/.claude/commands/AIOX/scripts/generate-greeting.js +160 -0
  72. package/.claude/commands/AIOX/scripts/greeting-builder.js +866 -0
  73. package/.claude/commands/AIOX/scripts/session-context-loader.js +286 -0
  74. package/.claude/commands/AIOX/stories/story-6.1.4.md +1404 -0
  75. package/.claude/commands/cohort-squad/agents/cohort-manager.md +156 -0
  76. package/.claude/commands/design-system/agents/brad-frost.md +1097 -0
  77. package/.claude/commands/design-system/agents/dan-mall.md +857 -0
  78. package/.claude/commands/design-system/agents/dave-malouf.md +2272 -0
  79. package/.claude/commands/design-system/agents/design-chief.md +102 -0
  80. package/.claude/commands/design-system/agents/nano-banana-generator.md +162 -0
  81. package/.claude/commands/greet.md +101 -0
  82. package/.claude/commands/synapse/manager.md +75 -0
  83. package/.claude/commands/synapse/tasks/add-rule.md +94 -0
  84. package/.claude/commands/synapse/tasks/create-command.md +109 -0
  85. package/.claude/commands/synapse/tasks/create-domain.md +127 -0
  86. package/.claude/commands/synapse/tasks/diagnose-synapse.md +245 -0
  87. package/.claude/commands/synapse/tasks/edit-rule.md +109 -0
  88. package/.claude/commands/synapse/tasks/suggest-domain.md +116 -0
  89. package/.claude/commands/synapse/tasks/toggle-domain.md +83 -0
  90. package/.claude/commands/synapse/templates/domain-template +8 -0
  91. package/.claude/commands/synapse/templates/manifest-entry-template +4 -0
  92. package/.claude/commands/synapse/utils/manifest-parser-reference.md +134 -0
  93. package/.claude/hooks/precompact-session-digest.cjs +2 -2
  94. package/.claude/skills/AIOX/agents/aiox-master/SKILL.md +511 -0
  95. package/.claude/skills/AIOX/agents/analyst/SKILL.md +281 -0
  96. package/.claude/skills/AIOX/agents/architect/SKILL.md +482 -0
  97. package/.claude/skills/AIOX/agents/data-engineer/SKILL.md +503 -0
  98. package/.claude/skills/AIOX/agents/dev/SKILL.md +568 -0
  99. package/.claude/skills/AIOX/agents/devops/SKILL.md +597 -0
  100. package/.claude/skills/AIOX/agents/pm/SKILL.md +385 -0
  101. package/.claude/skills/AIOX/agents/po/SKILL.md +343 -0
  102. package/.claude/skills/AIOX/agents/qa/SKILL.md +451 -0
  103. package/.claude/skills/AIOX/agents/sm/SKILL.md +295 -0
  104. package/.claude/skills/AIOX/agents/squad-creator/SKILL.md +352 -0
  105. package/.claude/skills/AIOX/agents/ux-design-expert/SKILL.md +503 -0
  106. package/.claude/skills/architect-first/SKILL.md +275 -0
  107. package/.claude/skills/architect-first/assets/architecture-template.md +505 -0
  108. package/.claude/skills/architect-first/assets/config-template.yaml +351 -0
  109. package/.claude/skills/architect-first/references/architecture-checklist.md +216 -0
  110. package/.claude/skills/architect-first/references/pre-implementation-checklist.md +119 -0
  111. package/.claude/skills/architect-first/references/stop-rules-guide.md +291 -0
  112. package/.claude/skills/architect-first/references/testing-strategy-guide.md +477 -0
  113. package/.claude/skills/architect-first/scripts/architecture_validator.py +490 -0
  114. package/.claude/skills/architect-first/scripts/check_coupling.py +306 -0
  115. package/.claude/skills/architect-first/scripts/validate_risk_mitigation.py +382 -0
  116. package/.claude/skills/checklist-runner/SKILL.md +113 -0
  117. package/.claude/skills/clone-mind.md +329 -0
  118. package/.claude/skills/coderabbit-review/SKILL.md +106 -0
  119. package/.claude/skills/course-generation-workflow.md +76 -0
  120. package/.claude/skills/enhance-workflow.md +466 -0
  121. package/.claude/skills/mcp-builder/LICENSE.txt +202 -0
  122. package/.claude/skills/mcp-builder/SKILL.md +328 -0
  123. package/.claude/skills/mcp-builder/reference/evaluation.md +602 -0
  124. package/.claude/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
  125. package/.claude/skills/mcp-builder/reference/node_mcp_server.md +916 -0
  126. package/.claude/skills/mcp-builder/reference/python_mcp_server.md +752 -0
  127. package/.claude/skills/mcp-builder/scripts/connections.py +151 -0
  128. package/.claude/skills/mcp-builder/scripts/evaluation.py +373 -0
  129. package/.claude/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  130. package/.claude/skills/mcp-builder/scripts/requirements.txt +2 -0
  131. package/.claude/skills/ralph.md +181 -0
  132. package/.claude/skills/skill-creator/LICENSE.txt +202 -0
  133. package/.claude/skills/skill-creator/SKILL.md +209 -0
  134. package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
  135. package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
  136. package/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
  137. package/.claude/skills/squad.md +301 -0
  138. package/.claude/skills/synapse/SKILL.md +132 -0
  139. package/.claude/skills/synapse/assets/README.md +50 -0
  140. package/.claude/skills/synapse/references/brackets.md +100 -0
  141. package/.claude/skills/synapse/references/commands.md +118 -0
  142. package/.claude/skills/synapse/references/domains.md +126 -0
  143. package/.claude/skills/synapse/references/layers.md +186 -0
  144. package/.claude/skills/synapse/references/manifest.md +142 -0
  145. package/.claude/skills/tech-search/SKILL.md +431 -0
  146. package/.claude/skills/tech-search/prompts/page-extract.md +133 -0
  147. package/README.en.md +2 -2
  148. package/README.md +8 -2
  149. package/bin/aiox.js +55 -4
  150. package/bin/utils/framework-guard.js +4 -2
  151. package/bin/utils/pro-detector.js +119 -28
  152. package/bin/utils/validate-publish.js +6 -6
  153. package/docs/aiox-agent-flows/devops-system.md +18 -0
  154. package/docs/aiox-workflows/README.md +1 -0
  155. package/docs/aiox-workflows/pro-access-grant-workflow.md +218 -0
  156. package/docs/guides/pro/access-grant-ops-playbook.md +370 -0
  157. package/docs/guides/pro/install-gate-setup.md +12 -6
  158. package/docs/guides/pro/squad-creator-handoff-pro-access-ops.md +134 -0
  159. package/docs/guides/supabase-ops-handoff.md +768 -0
  160. package/package.json +12 -1
  161. package/packages/aiox-pro-cli/bin/aiox-pro.js +33 -12
  162. package/packages/installer/src/config/configure-environment.js +118 -50
  163. package/packages/installer/src/installer/aiox-core-installer.js +124 -27
  164. package/packages/installer/src/installer/brownfield-upgrader.js +66 -9
  165. package/packages/installer/src/installer/dependency-installer.js +4 -0
  166. package/packages/installer/src/pro/pro-scaffolder.js +5 -5
  167. package/packages/installer/src/updater/index.js +151 -10
  168. package/packages/installer/src/wizard/ide-config-generator.js +73 -7
  169. package/packages/installer/src/wizard/index.js +119 -31
  170. package/packages/installer/src/wizard/pro-setup.js +118 -47
  171. package/packages/installer/src/wizard/validation/validators/dependency-validator.js +32 -25
  172. package/packages/installer/src/wizard/validation/validators/file-structure-validator.js +26 -0
  173. package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +84 -1
  174. package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +1 -1
  175. package/packages/installer/tests/unit/doctor/doctor-checks.test.js +85 -19
  176. package/packages/installer/tests/unit/entity-registry-bootstrap.test.js +4 -4
  177. package/packages/installer/tests/unit/generate-settings-json/generate-settings-json.test.js +5 -5
  178. package/packages/installer/tests/unit/ide-sync-integration/ide-sync-integration.test.js +4 -4
  179. package/packages/installer/tests/unit/merger/yaml-merger.test.js +11 -11
  180. package/pro/README.md +12 -1
  181. package/pro/license/index.js +3 -11
  182. package/pro/license/license-api.js +25 -0
  183. package/pro/license/license-cache.js +135 -31
  184. package/pro/license/license-crypto.js +59 -3
  185. package/pro/package.json +5 -4
  186. package/pro/squads/README.md +16 -16
  187. package/pro/squads/index.js +1 -1
  188. package/scripts/e2e/installed-skills-smoke.js +264 -0
  189. package/scripts/package-synapse.js +3 -3
  190. package/scripts/validate-package-completeness.js +8 -11
  191. package/.aiox-core/lib/build.json +0 -1
@@ -0,0 +1,286 @@
1
+ /**
2
+ * Session Context Loader - Multi-Agent Session Continuity
3
+ *
4
+ * Provides session context when transitioning between agents.
5
+ * Solves the problem: "@po approved story, @dev doesn't know about it"
6
+ *
7
+ * Features:
8
+ * - Detects previous agent in session
9
+ * - Tracks last N commands
10
+ * - Identifies active workflow
11
+ * - Provides natural language summary for new agent
12
+ *
13
+ * Part of Story 6.1.2.5 UX Improvements
14
+ */
15
+
16
+ const fs = require('fs');
17
+ const path = require('path');
18
+ const ContextDetector = require('./context-detector');
19
+
20
+ const SESSION_STATE_PATH = path.join(process.cwd(), '.aiox', 'session-state.json');
21
+ const MAX_COMMANDS_HISTORY = 10;
22
+
23
+ class SessionContextLoader {
24
+ constructor() {
25
+ this.detector = new ContextDetector();
26
+ this.sessionStatePath = SESSION_STATE_PATH;
27
+ }
28
+
29
+ /**
30
+ * Load session context for current agent activation
31
+ *
32
+ * @param {string} currentAgentId - ID of agent being activated
33
+ * @returns {Object} Session context
34
+ */
35
+ loadContext(currentAgentId) {
36
+ // Pass sessionStatePath to detector so it uses the correct file (important for testing)
37
+ const sessionType = this.detector.detectSessionType([], this.sessionStatePath);
38
+ const sessionState = this.loadSessionState();
39
+
40
+ if (sessionType === 'new') {
41
+ // Fresh session - no context
42
+ return {
43
+ sessionType: 'new',
44
+ message: null,
45
+ previousAgent: null,
46
+ lastCommands: [],
47
+ workflowActive: null,
48
+ };
49
+ }
50
+
51
+ // Extract context information
52
+ const previousAgent = this.getPreviousAgent(sessionState, currentAgentId);
53
+ const lastCommands = sessionState.lastCommands || [];
54
+ const workflowActive = sessionState.workflowActive || null;
55
+
56
+ // Generate natural language summary
57
+ const message = this.generateContextMessage({
58
+ sessionType,
59
+ previousAgent,
60
+ lastCommands,
61
+ workflowActive,
62
+ currentAgentId,
63
+ });
64
+
65
+ return {
66
+ sessionType,
67
+ message,
68
+ previousAgent,
69
+ lastCommands,
70
+ workflowActive,
71
+ currentStory: sessionState.currentStory || null,
72
+ sessionId: sessionState.sessionId,
73
+ sessionStartTime: sessionState.startTime,
74
+ };
75
+ }
76
+
77
+ /**
78
+ * Load session state from file
79
+ *
80
+ * @returns {Object} Session state
81
+ */
82
+ loadSessionState() {
83
+ try {
84
+ if (!fs.existsSync(this.sessionStatePath)) {
85
+ return {};
86
+ }
87
+
88
+ const content = fs.readFileSync(this.sessionStatePath, 'utf8');
89
+ return JSON.parse(content);
90
+ } catch (error) {
91
+ console.warn('[SessionContext] Failed to load session state:', error.message);
92
+ return {};
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Get previous agent from session
98
+ *
99
+ * @param {Object} sessionState - Session state
100
+ * @param {string} currentAgentId - Current agent ID
101
+ * @returns {Object|null} Previous agent info
102
+ */
103
+ getPreviousAgent(sessionState, currentAgentId) {
104
+ const agentSequence = sessionState.agentSequence || [];
105
+
106
+ if (agentSequence.length === 0) {
107
+ return null;
108
+ }
109
+
110
+ // Get last agent that's different from current
111
+ for (let i = agentSequence.length - 1; i >= 0; i--) {
112
+ const agent = agentSequence[i];
113
+ if (agent.agentId !== currentAgentId) {
114
+ return {
115
+ agentId: agent.agentId,
116
+ agentName: agent.agentName,
117
+ activatedAt: agent.activatedAt,
118
+ lastCommand: agent.lastCommand,
119
+ };
120
+ }
121
+ }
122
+
123
+ return null;
124
+ }
125
+
126
+ /**
127
+ * Generate natural language context message
128
+ *
129
+ * @param {Object} context - Context data
130
+ * @returns {string|null} Context message
131
+ */
132
+ generateContextMessage(context) {
133
+ const { sessionType, previousAgent, lastCommands, workflowActive } = context;
134
+
135
+ if (sessionType === 'new') {
136
+ return null;
137
+ }
138
+
139
+ const parts = [];
140
+
141
+ // Previous agent context
142
+ if (previousAgent) {
143
+ const agentName = previousAgent.agentName || previousAgent.agentId;
144
+ const minutesAgo = Math.floor((Date.now() - previousAgent.activatedAt) / 60000);
145
+ const timeAgo = minutesAgo < 1 ? 'just now' : minutesAgo === 1 ? '1 minute ago' : `${minutesAgo} minutes ago`;
146
+
147
+ parts.push(`📍 **Session Context**: Continuing from @${previousAgent.agentId} (${agentName}) activated ${timeAgo}`);
148
+
149
+ if (previousAgent.lastCommand) {
150
+ parts.push(` Last action: *${previousAgent.lastCommand}`);
151
+ }
152
+ }
153
+
154
+ // Recent commands
155
+ if (lastCommands.length > 0) {
156
+ const recentCmds = lastCommands.slice(-5).join(', *');
157
+ parts.push(` Recent commands: *${recentCmds}`);
158
+ }
159
+
160
+ // Active workflow
161
+ if (workflowActive) {
162
+ parts.push(` ⚡ Active Workflow: ${workflowActive}`);
163
+ }
164
+
165
+ return parts.length > 0 ? parts.join('\n') : null;
166
+ }
167
+
168
+ /**
169
+ * Update session state with current agent
170
+ *
171
+ * @param {string} agentId - Agent ID
172
+ * @param {string} agentName - Agent name
173
+ * @param {string} lastCommand - Last command executed
174
+ * @param {Object} options - Update options
175
+ */
176
+ updateSession(agentId, agentName, lastCommand = null, options = {}) {
177
+ try {
178
+ const sessionState = this.loadSessionState();
179
+
180
+ // Initialize if new session
181
+ if (!sessionState.sessionId) {
182
+ sessionState.sessionId = `session-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
183
+ sessionState.startTime = Date.now();
184
+ }
185
+
186
+ // Update activity timestamp
187
+ sessionState.lastActivity = Date.now();
188
+
189
+ // Update agent sequence
190
+ if (!sessionState.agentSequence) {
191
+ sessionState.agentSequence = [];
192
+ }
193
+
194
+ sessionState.agentSequence.push({
195
+ agentId,
196
+ agentName,
197
+ activatedAt: Date.now(),
198
+ lastCommand,
199
+ });
200
+
201
+ // Keep last 20 agent activations
202
+ if (sessionState.agentSequence.length > 20) {
203
+ sessionState.agentSequence = sessionState.agentSequence.slice(-20);
204
+ }
205
+
206
+ // Update command history
207
+ if (lastCommand) {
208
+ if (!sessionState.lastCommands) {
209
+ sessionState.lastCommands = [];
210
+ }
211
+
212
+ sessionState.lastCommands.push(lastCommand);
213
+
214
+ // Keep last N commands
215
+ if (sessionState.lastCommands.length > MAX_COMMANDS_HISTORY) {
216
+ sessionState.lastCommands = sessionState.lastCommands.slice(-MAX_COMMANDS_HISTORY);
217
+ }
218
+ }
219
+
220
+ // Update workflow status
221
+ if (options.workflowActive !== undefined) {
222
+ sessionState.workflowActive = options.workflowActive;
223
+ }
224
+
225
+ // Save to file
226
+ this.detector.updateSessionState(sessionState, this.sessionStatePath);
227
+ } catch (error) {
228
+ console.warn('[SessionContext] Failed to update session:', error.message);
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Clear session (start fresh)
234
+ */
235
+ clearSession() {
236
+ try {
237
+ if (fs.existsSync(this.sessionStatePath)) {
238
+ fs.unlinkSync(this.sessionStatePath);
239
+ }
240
+ } catch (error) {
241
+ console.warn('[SessionContext] Failed to clear session:', error.message);
242
+ }
243
+ }
244
+
245
+ /**
246
+ * Format context for display in agent greeting
247
+ *
248
+ * @param {string} currentAgentId - Current agent ID
249
+ * @returns {string} Formatted context message
250
+ */
251
+ formatForGreeting(currentAgentId) {
252
+ const context = this.loadContext(currentAgentId);
253
+
254
+ if (!context.message) {
255
+ return '';
256
+ }
257
+
258
+ return `\n${context.message}\n`;
259
+ }
260
+ }
261
+
262
+ // CLI Interface
263
+ if (require.main === module) {
264
+ const loader = new SessionContextLoader();
265
+ const command = process.argv[2];
266
+ const agentId = process.argv[3] || 'dev';
267
+
268
+ if (command === 'load') {
269
+ const context = loader.loadContext(agentId);
270
+ console.log(JSON.stringify(context, null, 2));
271
+ } else if (command === 'clear') {
272
+ loader.clearSession();
273
+ console.log('✅ Session cleared');
274
+ } else if (command === 'update') {
275
+ const agentName = process.argv[4] || agentId.toUpperCase();
276
+ const lastCommand = process.argv[5] || null;
277
+ loader.updateSession(agentId, agentName, lastCommand);
278
+ console.log('✅ Session updated');
279
+ } else {
280
+ // Default: show greeting format
281
+ const message = loader.formatForGreeting(agentId);
282
+ console.log(message || '(No session context)');
283
+ }
284
+ }
285
+
286
+ module.exports = SessionContextLoader;