erne-universal 0.12.1 → 0.12.2

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
@@ -122,7 +122,7 @@ When a user's message matches these signals, automatically use the corresponding
122
122
  | `expo-config-resolver` | build error, red screen, crash, "won't start", error, "build failed", metro, babel, "config issue", "EAS build", "can't build", "module not found", "pod install", gradle, "Xcode error", "Android build", "iOS build", "linking error", prebuild, "app.json", "app.config", "plugin not working", "white screen", "blank screen" |
123
123
  | `native-bridge-builder` | "native module", bridge, "turbo module", Swift, Kotlin, Java, "Objective-C", "native code", "platform specific", "expo module", JSI, Fabric, "New Architecture", codegen, "C++", "native view", Nitro, "expo-modules-core" |
124
124
  | `upgrade-assistant` | upgrade, update, version, migration, "breaking change", deprecated, "Expo SDK", "React Native version", bump, migrate, changelog, compatibility, "peer dependency", outdated, "npx expo install --fix" |
125
- | `ui-designer` | component, button, modal, form, screen, page, tab, "navigation UI", "build UI", "design system", styled, theme, icon, animation, transition, gesture, "bottom sheet", drawer, header, card, skeleton, loading, toast |
125
+ | `ui-designer` | component, button, modal, form, screen, page, tab, "navigation UI", "build UI", "design system", styled, theme, icon, animation, transition, gesture, "bottom sheet", drawer, header, card, skeleton, loading, toast, "apple style", "HIG", "iOS native feel", "apple design", "human interface" |
126
126
  | `pipeline-orchestrator` | deploy, publish, EAS, "app store", "play store", "CI/CD", release, "OTA update", submit, distribution, TestFlight, "internal testing", "code signing", provisioning, certificate, keystore, fastlane, "GitHub Actions" |
127
127
  | `senior-developer` | "what do you think", opinion, advice, approach, tradeoff, "not sure how", mentor, "help me decide", "best way to", "should I", "pros and cons", "compare options", "which is better", "common pitfall", "production ready", scalable |
128
128
  | `documentation-generator` | "generate docs", "document this", "write documentation", "project overview", "architecture docs", "what does this project do", "onboard me", "explain codebase", "project structure", "how does this work" |
@@ -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` 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-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
 
@@ -206,6 +206,7 @@ Skills in `skills/` activate automatically:
206
206
  - `native-module-scaffold` — Create Turbo/Expo modules
207
207
  - `upgrade-workflow` — Version migration guide
208
208
  - `continuous-learning-v2` — Pattern extraction and learning
209
+ - `hig` — Apple HIG design intelligence (build, review, animate, analyze)
209
210
 
210
211
  ---
211
212
 
@@ -224,7 +225,7 @@ Skills in `skills/` activate automatically:
224
225
  ## Available Commands
225
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-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
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
228
229
 
229
230
  ## Dashboard
230
231
 
@@ -70,6 +70,30 @@ function handleAgents(req, res, urlPath, body, staticDefs, agentState, activityH
70
70
  });
71
71
  }
72
72
 
73
+ // Discover agents from .claude/agents/ that aren't in static or custom lists
74
+ const projectDir = process.env.ERNE_PROJECT_DIR || process.cwd();
75
+ const agentsDir = path.join(projectDir, '.claude', 'agents');
76
+ try {
77
+ if (fs.existsSync(agentsDir)) {
78
+ const knownNames = new Set(merged.map((a) => a.name));
79
+ const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith('.md'));
80
+ for (const file of files) {
81
+ const name = path.basename(file, '.md');
82
+ if (!knownNames.has(name)) {
83
+ merged.push({
84
+ name,
85
+ room: 'development',
86
+ displayName: config.agents[name]?.displayName || null,
87
+ enabled: config.agents[name]?.enabled !== false,
88
+ custom: false,
89
+ });
90
+ }
91
+ }
92
+ }
93
+ } catch {
94
+ // Silent — discovery is best-effort
95
+ }
96
+
73
97
  res.writeHead(200, { 'Content-Type': 'application/json' });
74
98
  res.end(JSON.stringify({ agents: merged }));
75
99
  return true;
@@ -148,6 +148,29 @@ const initAgentState = () => {
148
148
  lastEvent: null,
149
149
  };
150
150
  }
151
+
152
+ // Discover agents from .claude/agents/ so init-generated agents appear on dashboard
153
+ const projectDir = process.env.ERNE_PROJECT_DIR || process.cwd();
154
+ const agentsDir = path.join(projectDir, '.claude', 'agents');
155
+ try {
156
+ if (fs.existsSync(agentsDir)) {
157
+ const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith('.md'));
158
+ for (const file of files) {
159
+ const name = path.basename(file, '.md');
160
+ if (!agentState[name]) {
161
+ agentState[name] = {
162
+ status: 'idle',
163
+ task: null,
164
+ room: 'development',
165
+ startedAt: null,
166
+ lastEvent: null,
167
+ };
168
+ }
169
+ }
170
+ }
171
+ } catch {
172
+ // Silent — agent discovery is best-effort
173
+ }
151
174
  };
152
175
 
153
176
  initAgentState();
@@ -366,8 +389,22 @@ const handleEvent = (event) => {
366
389
  return { ok: true };
367
390
  }
368
391
 
369
- if (!agent || !agentState[agent]) {
370
- return { error: `Unknown agent: ${agent}` };
392
+ if (!agent) {
393
+ return { error: 'Missing agent name' };
394
+ }
395
+
396
+ // Auto-register unknown agents so dynamically generated agents show up
397
+ if (!agentState[agent]) {
398
+ agentState[agent] = {
399
+ status: 'idle',
400
+ task: null,
401
+ room: 'development',
402
+ startedAt: null,
403
+ lastEvent: null,
404
+ };
405
+ if (!activityHistory[agent]) {
406
+ activityHistory[agent] = [];
407
+ }
371
408
  }
372
409
 
373
410
  const now = new Date().toISOString();
package/lib/generate.js CHANGED
@@ -209,7 +209,7 @@ function convertToClaudeCodeHooks(erneHooks, profileName, targetDir) {
209
209
  if (pattern) entry.matcher = pattern;
210
210
  entry.hooks = patternHooks.map((h) => ({
211
211
  type: 'command',
212
- command: `node "${path.join(targetDir, '.claude/hooks/scripts/run-with-flags.js')}" ${h.script}`,
212
+ command: `node "${path.join(targetDir, 'hooks/scripts/run-with-flags.js')}" ${h.script}`,
213
213
  timeout: HOOK_TIMEOUTS[h.script] || DEFAULT_HOOK_TIMEOUT,
214
214
  }));
215
215
  result[event].push(entry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erne-universal",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
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",
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: hig
3
+ description: Apple HIG design intelligence — build, review, animate, and analyze with Apple Human Interface Guidelines for React Native/Expo
4
+ ---
5
+
6
+ # Apple HIG Design Intelligence
7
+
8
+ ## When to Use
9
+
10
+ - Building UI components with Apple-quality design (spring physics, semantic colors, 8pt grid)
11
+ - Reviewing existing code for HIG compliance
12
+ - Implementing animations with proper physics (not linear/ease-in-out)
13
+ - Analyzing reference videos to extract motion specs
14
+ - Generating design tokens for a project
15
+
16
+ ## Intent Router
17
+
18
+ Detect intent from the user's message and route to the appropriate mode:
19
+
20
+ | Intent Keywords | Mode | What Happens |
21
+ |---|---|---|
22
+ | `build`, `create`, `make`, `design`, `component` | **Build** | Apply HIG rules while creating UI |
23
+ | `review`, `check`, `scan`, `audit`, `compliance` | **Review** | Run HIG scanner on source files |
24
+ | `animate`, `motion`, `spring`, `gesture`, `transition` | **Animate** | Implement animations with HIG physics |
25
+ | `video` + file path | **Analyze** | Extract motion spec from reference video |
26
+ | `tokens`, `theme`, `design system` | **Tokens** | Generate HIG design tokens |
27
+ | No clear intent | **Interactive** | Ask what the user wants |
28
+
29
+ ## Build Mode
30
+
31
+ When building UI, load and apply these rules from `design/hig/rules/`:
32
+
33
+ 1. **Always**: `design-system.md` (typography, colors, spacing, corners)
34
+ 2. **If animation involved**: `animation.md` + `craft.md` (spring physics)
35
+ 3. **If navigation/modals**: `patterns.md` (sheets, tabs, transitions)
36
+
37
+ **Non-negotiable requirements:**
38
+ - `borderCurve: 'continuous'` on all rounded elements
39
+ - Semantic color tokens, never hardcoded hex
40
+ - 4pt grid spacing, prefer 8pt
41
+ - 44pt minimum touch targets
42
+ - `useReducedMotion` with any animation
43
+ - `expo-haptics` on key interactions
44
+ - Dark mode support via `useColorScheme`
45
+ - Spring physics via `withSpring`, never `withTiming` with linear easing
46
+
47
+ **Spring presets** (use from `design/hig/index.ts`):
48
+ - `smooth`: default for most transitions
49
+ - `snappy`: button presses, toggles
50
+ - `bouncy`: playful elements, celebrations
51
+ - `gentle`: background, ambient motion
52
+
53
+ ## Review Mode
54
+
55
+ Run the HIG scanner from `design/scanner/`:
56
+
57
+ ```
58
+ /erne-hig review ./src/screens/
59
+ /erne-hig review ./src/components/Button.tsx
60
+ ```
61
+
62
+ Output: violations grouped by severity (critical → low), HIG score (0-100), grade (A-F), and fix suggestions.
63
+
64
+ Integrate with `/erne-quality-gate` — scanner runs automatically alongside code-reviewer and performance-profiler.
65
+
66
+ ## Animate Mode
67
+
68
+ Load `craft.md` + `animation.md` rules. Key patterns:
69
+
70
+ - **Enter/Exit**: `FadeIn.duration(300).springify()` — never abrupt appear/disappear
71
+ - **Gesture-driven**: Pan + `withDecay` for momentum, snap points with `withSpring`
72
+ - **Scroll-linked**: `useAnimatedScrollHandler` + `interpolate` with `Extrapolation.CLAMP`
73
+ - **Choreography**: parent first, children staggered 50ms, simultaneous for related
74
+
75
+ ## Analyze Mode
76
+
77
+ Process reference video through `design/video/`:
78
+
79
+ ```
80
+ /erne-hig video ./reference.mp4
81
+ ```
82
+
83
+ Auto-detects project stack, generates Reanimated/Gesture Handler code matching the video's motion patterns.
84
+
85
+ ## Tokens Mode
86
+
87
+ Generate typed design tokens from `design/tokens/`:
88
+
89
+ ```
90
+ /erne-hig tokens
91
+ ```
92
+
93
+ Creates `theme/hig-tokens.ts` with colors, typography, spacing, shadows — ready for `useColorScheme` and `StyleSheet.create`.