erne-universal 0.12.2 → 0.12.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.
package/CLAUDE.md CHANGED
@@ -143,7 +143,7 @@ When a user's message matches these signals, automatically use the corresponding
143
143
 
144
144
  ## Available Commands
145
145
 
146
- Use `/erne-plan`, `/erne-code-review`, `/erne-tdd`, `/erne-build-fix`, `/erne-perf`, `/erne-upgrade`, `/erne-native-module`, `/erne-navigate`, `/erne-animate`, `/erne-deploy`, `/erne-component`, `/erne-debug`, `/erne-debug-visual`, `/erne-audit`, `/erne-quality-gate`, `/erne-code`, `/erne-feature`, `/erne-learn`, `/erne-retrospective`, `/erne-setup-device`, `/erne-hig` for guided workflows.
146
+ Use `/erne-plan`, `/erne-code-review`, `/erne-tdd`, `/erne-build-fix`, `/erne-perf`, `/erne-upgrade`, `/erne-native-module`, `/erne-navigate`, `/erne-animate`, `/erne-deploy`, `/erne-component`, `/erne-debug`, `/erne-debug-visual`, `/erne-debug-video`, `/erne-audit`, `/erne-quality-gate`, `/erne-code`, `/erne-feature`, `/erne-learn`, `/erne-retrospective`, `/erne-setup-device`, `/erne-hig` for guided workflows.
147
147
 
148
148
  ## Worker Mode (Autonomous Ticket Execution)
149
149
 
@@ -224,7 +224,7 @@ Skills in `skills/` activate automatically:
224
224
 
225
225
  ## Available Commands
226
226
 
227
- /erne-plan, /erne-code-review, /erne-tdd, /erne-build-fix, /erne-perf, /erne-upgrade, /erne-native-module, /erne-debug, /erne-debug-visual, /erne-deploy,
227
+ /erne-plan, /erne-code-review, /erne-tdd, /erne-build-fix, /erne-perf, /erne-upgrade, /erne-native-module, /erne-debug, /erne-debug-visual, /erne-debug-video, /erne-deploy,
228
228
  /erne-component, /erne-navigate, /erne-animate, /erne-orchestrate, /erne-quality-gate, /erne-code, /erne-feature, /erne-worker, /erne-audit, /erne-learn, /erne-retrospective, /erne-setup-device, /erne-hig
229
229
 
230
230
  ## Dashboard
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: erne-debug-video
3
+ description: ERNE — Video-based visual debugging using frame extraction and temporal analysis
4
+ ---
5
+
6
+ # /erne-debug-video — Video Debugging
7
+
8
+ You are executing the `/erne-debug-video` command. Analyze screen recordings to detect animation glitches, race conditions, gesture issues, scroll jank, keyboard overlap, and navigation transitions that screenshots cannot capture.
9
+
10
+ ## Arguments
11
+
12
+ ```
13
+ /debug-video <file> — analyze a screen recording (.mp4, .mov, .webm)
14
+ /debug-video <file> --focus <area> — focus analysis on a specific UI area or interaction
15
+ /debug-video <file> --fps — include frame rate analysis for animation smoothness
16
+ ```
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Extract Key Frames
21
+ 1. Use the `extract-video-frames.js` script to extract frames at key moments
22
+ 2. Focus on: transition starts/ends, gesture interactions, state changes, animation keyframes
23
+ 3. Extract at higher density during rapid visual changes
24
+
25
+ ### Step 2: Temporal Analysis
26
+ 1. Apply multimodal vision to extracted frames in sequence
27
+ 2. Identify temporal issues across the recording timeline:
28
+
29
+ | Category | Examples |
30
+ |----------|---------|
31
+ | **Animation** | jank, stutter, dropped frames, wrong easing |
32
+ | **Gesture** | unresponsive touch, wrong drag behavior, gesture conflict |
33
+ | **Transition** | flash of wrong content, layout shift, z-order issues |
34
+ | **Race Condition** | loading state flicker, stale data flash, double render |
35
+ | **Keyboard** | content overlap, scroll jump, input hidden behind keyboard |
36
+ | **Scroll** | jank, blank areas, recycling artifacts, momentum issues |
37
+
38
+ Severity: `critical` · `major` · `minor`
39
+
40
+ ### Step 3: Root Cause Analysis
41
+ 1. Read the relevant component and animation source files
42
+ 2. Correlate visual issues with code patterns
43
+ 3. Present findings with frame-by-frame evidence
44
+
45
+ ### Step 4: Interactive Fix
46
+ 1. User picks issue numbers to fix
47
+ 2. Apply the fix (minimal change, match project style)
48
+ 3. If possible, re-record and compare before/after
49
+ 4. Ask: "Does this look correct? Any remaining issues?"
50
+
51
+ ### Step 5: Summary
52
+ - Issues detected (count by severity and category)
53
+ - Frame evidence for each issue (timestamps + descriptions)
54
+ - Fixes applied with code diffs
55
+ - Remaining issues (if any deferred by user)
56
+ - Save findings to memory for future reference
57
+
58
+ ## Output
59
+ ```
60
+ ## Video Debug Report
61
+
62
+ ### Recording
63
+ [File path, duration, resolution]
64
+
65
+ ### Issues Found
66
+ 1. [Category · Severity] Description
67
+ Frame evidence: [timestamp] → [timestamp]
68
+ 2. [Category · Severity] Description
69
+ Frame evidence: [timestamp] → [timestamp]
70
+ ...
71
+
72
+ ### Fixes Applied
73
+ **Issue 1** — [ComponentName.tsx]
74
+ Root cause: [brief description]
75
+ Fix: [brief description]
76
+
77
+ ### Remaining Issues
78
+ [None | list of deferred items]
79
+ ```
package/docs/commands.md CHANGED
@@ -7,39 +7,42 @@ Commands are slash-prefixed actions that orchestrate agents for specific tasks.
7
7
  ### Core Workflow
8
8
  | Command | Purpose | Agents |
9
9
  |---------|---------|--------|
10
- | `/plan` | Design feature architecture | architect |
11
- | `/code` | Implement features | senior-developer |
12
- | `/feature` | Build focused feature unit | feature-builder |
13
- | `/code-review` | Full code review | code-reviewer + performance-profiler |
14
- | `/tdd` | Test-first development | tdd-guide |
15
- | `/build-fix` | Fix build failures | expo-config-resolver |
16
- | `/perf` | Performance profiling | performance-profiler |
17
- | `/upgrade` | Version migration | upgrade-assistant |
18
- | `/native-module` | Create native modules | native-bridge-builder → code-reviewer |
19
- | `/navigate` | Navigation design | architect |
10
+ | `/erne-plan` | Design feature architecture | architect |
11
+ | `/erne-code` | Implement features | senior-developer |
12
+ | `/erne-feature` | Build focused feature unit | feature-builder |
13
+ | `/erne-code-review` | Full code review | code-reviewer + performance-profiler |
14
+ | `/erne-tdd` | Test-first development | tdd-guide |
15
+ | `/erne-build-fix` | Fix build failures | expo-config-resolver |
16
+ | `/erne-perf` | Performance profiling | performance-profiler |
17
+ | `/erne-upgrade` | Version migration | upgrade-assistant |
18
+ | `/erne-native-module` | Create native modules | native-bridge-builder → code-reviewer |
19
+ | `/erne-navigate` | Navigation design | architect |
20
20
 
21
21
  ### Extended
22
22
  | Command | Purpose | Agents |
23
23
  |---------|---------|--------|
24
- | `/animate` | Implement animations | ui-designer |
25
- | `/deploy` | Validate and submit | expo-config-resolver + code-reviewer |
26
- | `/component` | Design + test component | ui-designer + tdd-guide |
27
- | `/debug` | Systematic diagnosis | performance-profiler |
28
- | `/quality-gate` | Pre-merge checks | code-reviewer + performance-profiler |
29
- | `/orchestrate` | Run multi-agent pipeline | pipeline-orchestrator |
24
+ | `/erne-animate` | Implement animations | ui-designer |
25
+ | `/erne-deploy` | Validate and submit | expo-config-resolver + code-reviewer |
26
+ | `/erne-component` | Design + test component | ui-designer + tdd-guide |
27
+ | `/erne-debug` | Systematic diagnosis | performance-profiler |
28
+ | `/erne-debug-visual` | Screenshot-based visual debugging | visual-debugger |
29
+ | `/erne-debug-video` | Video-based temporal analysis | visual-debugger (frame extraction) |
30
+ | `/erne-quality-gate` | Pre-merge checks | code-reviewer + performance-profiler |
31
+ | `/erne-orchestrate` | Run multi-agent pipeline | pipeline-orchestrator |
32
+ | `/erne-hig` | Apple HIG design intelligence | ui-designer (HIG rules) |
30
33
 
31
34
  ### Script-Driven
32
35
  | Command | Purpose | What It Runs |
33
36
  |---------|---------|-------------|
34
- | `/learn` | Generate skills from patterns | continuous-learning-v2 scripts |
35
- | `/retrospective` | Session analysis | evaluate-session.js |
36
- | `/setup-device` | Install agent-device MCP | Setup script |
37
+ | `/erne-learn` | Generate skills from patterns | continuous-learning-v2 scripts |
38
+ | `/erne-retrospective` | Session analysis | evaluate-session.js |
39
+ | `/erne-setup-device` | Install agent-device MCP | Setup script |
37
40
 
38
41
  ## Using Commands
39
42
 
40
43
  Type any command in Claude Code:
41
44
  ```
42
- /plan Add user authentication with biometric login
45
+ /erne-plan Add user authentication with biometric login
43
46
  ```
44
47
 
45
48
  Commands that use multiple agents show combined output. Parallel agents run simultaneously for speed.
@@ -50,7 +53,7 @@ When agent-device MCP is installed, several commands gain visual capabilities:
50
53
 
51
54
  | Command | Without | With agent-device |
52
55
  |---------|---------|------------------|
53
- | `/debug` | Log analysis | + Screenshots, tap through steps |
54
- | `/perf` | Code analysis | + Actual FPS measurement |
55
- | `/component` | Generate code | + Render and screenshot |
56
- | `/deploy` | Config validation | + Preview build verification |
56
+ | `/erne-debug` | Log analysis | + Screenshots, tap through steps |
57
+ | `/erne-perf` | Code analysis | + Actual FPS measurement |
58
+ | `/erne-component` | Generate code | + Render and screenshot |
59
+ | `/erne-deploy` | Config validation | + Preview build verification |
package/lib/detect.js CHANGED
@@ -44,15 +44,19 @@ function detectProject(cwd) {
44
44
  return result;
45
45
  }
46
46
 
47
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
47
+ let deps = { ...pkg.dependencies, ...pkg.devDependencies };
48
48
 
49
49
  // --- Framework detection ---
50
- const hasExpo = !!deps['expo'];
51
- const hasRN = !!deps['react-native'];
50
+ let hasExpo = !!deps['expo'];
51
+ let hasRN = !!deps['react-native'];
52
+
53
+ // Track the effective project directory for stack detection.
54
+ // In a monorepo, this may point to a workspace package instead of the root.
55
+ let projectDir = cwd;
56
+ let projectPkg = pkg;
52
57
 
53
58
  if (hasExpo) {
54
59
  result.isRNProject = true;
55
- // Check for native code to distinguish bare vs managed
56
60
  if (hasNativeCode(cwd)) {
57
61
  result.framework = 'expo-bare';
58
62
  } else {
@@ -61,11 +65,39 @@ function detectProject(cwd) {
61
65
  } else if (hasRN) {
62
66
  result.isRNProject = true;
63
67
  result.framework = 'bare-rn';
64
- } else {
68
+ }
69
+
70
+ // --- Monorepo detection (runs regardless of root RN presence) ---
71
+ const monorepoInfo = detectMonorepo(cwd, pkg);
72
+ result.hasMonorepo = monorepoInfo !== null;
73
+ result.monorepo = monorepoInfo;
74
+
75
+ // If root has no RN/Expo but a workspace package does, use that package for detection
76
+ if (!result.isRNProject && monorepoInfo) {
77
+ const rnPkg = monorepoInfo.packages.find(p => p.hasExpo || p.hasReactNative);
78
+ if (rnPkg) {
79
+ projectDir = path.join(cwd, rnPkg.path);
80
+ try {
81
+ projectPkg = JSON.parse(fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'));
82
+ deps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
83
+ hasExpo = !!deps['expo'];
84
+ hasRN = !!deps['react-native'];
85
+
86
+ result.isRNProject = true;
87
+ if (hasExpo) {
88
+ result.framework = hasNativeCode(projectDir) ? 'expo-bare' : 'expo-managed';
89
+ } else {
90
+ result.framework = 'bare-rn';
91
+ }
92
+ } catch { /* workspace package.json unreadable, remain non-RN */ }
93
+ }
94
+ }
95
+
96
+ if (!result.isRNProject) {
65
97
  return result;
66
98
  }
67
99
 
68
- // --- Stack detection ---
100
+ // --- Stack detection (uses deps from the effective project) ---
69
101
  // State
70
102
  if (deps['zustand']) result.stack.state = 'zustand';
71
103
  else if (deps['@reduxjs/toolkit']) result.stack.state = 'redux-toolkit';
@@ -105,27 +137,22 @@ function detectProject(cwd) {
105
137
  if (deps['@testing-library/react-native']) result.stack.testing = 'jest-rntl';
106
138
  else if (deps['detox']) result.stack.testing = 'jest-detox';
107
139
 
108
- // Build
109
- if (fs.existsSync(path.join(cwd, 'eas.json'))) result.stack.build = 'eas';
110
- else if (fs.existsSync(path.join(cwd, 'fastlane'))) result.stack.build = 'fastlane';
140
+ // Build — check both root and project dir for build configs
141
+ if (fs.existsSync(path.join(cwd, 'eas.json')) || fs.existsSync(path.join(projectDir, 'eas.json'))) result.stack.build = 'eas';
142
+ else if (fs.existsSync(path.join(cwd, 'fastlane')) || fs.existsSync(path.join(projectDir, 'fastlane'))) result.stack.build = 'fastlane';
111
143
 
112
144
  // --- Metadata ---
113
- // Monorepo
114
- const monorepoInfo = detectMonorepo(cwd, pkg);
115
- result.hasMonorepo = monorepoInfo !== null;
116
- result.monorepo = monorepoInfo;
117
-
118
- // TypeScript
119
- result.hasTypescript = fs.existsSync(path.join(cwd, 'tsconfig.json'));
145
+ // TypeScript — check both root and project dir
146
+ result.hasTypescript = fs.existsSync(path.join(cwd, 'tsconfig.json')) || fs.existsSync(path.join(projectDir, 'tsconfig.json'));
120
147
 
121
148
  // Existing CLAUDE.md
122
149
  result.existingClaudeMd = fs.existsSync(path.join(cwd, 'CLAUDE.md'));
123
150
 
124
- // New Architecture
125
- result.hasNewArch = detectNewArch(cwd, pkg);
151
+ // New Architecture — check against the effective project
152
+ result.hasNewArch = detectNewArch(projectDir, projectPkg);
126
153
 
127
- // Component style
128
- result.componentStyle = detectComponentStyle(cwd);
154
+ // Component style — scan the effective project dir
155
+ result.componentStyle = detectComponentStyle(projectDir);
129
156
 
130
157
  return result;
131
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erne-universal",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "Complete AI coding agent harness for React Native and Expo \u2014 13 specialized agents, autonomous worker mode, visual debugging, smart routing",
5
5
  "keywords": [
6
6
  "react-native",
@@ -76,7 +76,7 @@ for (const f of agentFiles) {
76
76
 
77
77
  // Commands
78
78
  console.log(' Commands:');
79
- validateCount('commands', '.md', 22, 'commands/'); // 22 command files
79
+ validateCount('commands', '.md', 23, 'commands/'); // 23 command files
80
80
  const cmdFiles = fs.readdirSync('commands').filter((f) => f.endsWith('.md'));
81
81
  for (const f of cmdFiles) {
82
82
  validateFrontmatter(path.join('commands', f), ['name', 'description']);