@trackunit/iris-app 1.12.7 → 1.12.10

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 (29) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/package.json +3 -3
  3. package/src/generators/ai-agent-sync/README.md +5 -2
  4. package/src/generators/ai-agent-sync/generator.d.ts +1 -1
  5. package/src/generators/ai-agent-sync/generator.js +29 -4
  6. package/src/generators/ai-agent-sync/generator.js.map +1 -1
  7. package/src/generators/preset/files/.agents/skills/browser-testing/SKILL.md +193 -0
  8. package/src/generators/preset/files/.agents/skills/create-app/SKILL.md +191 -0
  9. package/src/generators/preset/files/.agents/skills/customfields/SKILL.md +239 -0
  10. package/src/generators/preset/files/.agents/skills/graphql/SKILL.md +147 -0
  11. package/src/generators/preset/files/.agents/skills/graphql-timeseries/SKILL.md +193 -0
  12. package/src/generators/preset/files/.agents/skills/irisx-app-sdk/SKILL.md +116 -0
  13. package/src/generators/preset/files/.agents/skills/react-core-hooks/SKILL.md +215 -0
  14. package/src/generators/preset/files/.agents/skills/tables-and-sorting/SKILL.md +122 -0
  15. package/src/generators/preset/files/.agents/skills/widget-extensions/SKILL.md +245 -0
  16. package/src/generators/preset/files/.cursor/mcp.json +4 -0
  17. package/src/generators/preset/root-files/AGENTS.md +43 -0
  18. package/src/generators/preset/root-files/CLAUDE.md +17 -0
  19. package/src/generators/preset/files/.cursor/commands/create-app.md +0 -226
  20. package/src/generators/preset/files/.cursor/rules/browser-irisx-development.mdc +0 -246
  21. package/src/generators/preset/files/.cursor/rules/graphql-timeseries.md +0 -260
  22. package/src/generators/preset/files/.cursor/rules/irisx-app-sdk-customfields.md +0 -305
  23. package/src/generators/preset/files/.cursor/rules/irisx-app-sdk-graphql.md +0 -30
  24. package/src/generators/preset/files/.cursor/rules/irisx-app-sdk.mdc +0 -82
  25. package/src/generators/preset/files/.cursor/rules/react-core-hooks.md +0 -155
  26. package/src/generators/preset/files/.cursor/rules/rules-index.mdc +0 -10
  27. package/src/generators/preset/files/.cursor/rules/structured-development.mdc +0 -86
  28. package/src/generators/preset/files/.cursor/rules/tables-and-sorting.mdc +0 -126
  29. package/src/generators/preset/files/.cursor/rules/widget-extensions.md +0 -323
package/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 1.12.10 (2026-03-06)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - address PR review - chrome-devtools MCP, useWidgetConfig consistency ([de581c854a5](https://github.com/Trackunit/manager/commit/de581c854a5))
6
+ - clean up old .cursor/rules and .cursor/commands files during ai-agent-sync ([e7abc4294ab](https://github.com/Trackunit/manager/commit/e7abc4294ab))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - Cursor Agent @cursoragent
11
+ - Kasper Laursen @ghost-of-kla-trackunit
12
+
13
+ ## 1.12.9 (2026-03-06)
14
+
15
+ ### 🧱 Updated Dependencies
16
+
17
+ - Updated iris-app-build-utilities to 1.12.63
18
+ - Updated iris-app-api to 1.14.57
19
+ - Updated react-test-setup to 1.8.55
20
+ - Updated shared-utils to 1.13.55
21
+
22
+ ## 1.12.8 (2026-03-06)
23
+
24
+ ### 🧱 Updated Dependencies
25
+
26
+ - Updated iris-app-build-utilities to 1.12.62
27
+ - Updated iris-app-api to 1.14.56
28
+ - Updated react-test-setup to 1.8.54
29
+ - Updated shared-utils to 1.13.54
30
+
1
31
  ## 1.12.7 (2026-03-06)
2
32
 
3
33
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app",
3
- "version": "1.12.7",
3
+ "version": "1.12.10",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "main": "src/index.js",
6
6
  "generators": "./generators.json",
@@ -25,8 +25,8 @@
25
25
  "nx": "22.4.4",
26
26
  "@npmcli/arborist": "^9.1.9",
27
27
  "win-ca": "^3.5.1",
28
- "@trackunit/shared-utils": "1.13.53",
29
- "@trackunit/iris-app-api": "1.14.55",
28
+ "@trackunit/shared-utils": "1.13.55",
29
+ "@trackunit/iris-app-api": "1.14.57",
30
30
  "tslib": "^2.6.2",
31
31
  "@clack/prompts": "^1.0.0",
32
32
  "@npm/types": "^1.0.2"
@@ -1,6 +1,6 @@
1
1
  # AI Agent Sync Generator
2
2
 
3
- Syncs Cursor rules and AI agent configuration files to the latest version. Ensures the SDK is at the latest version before applying updates.
3
+ Syncs agent skills, AGENTS.md, CLAUDE.md, and AI agent configuration files to the latest version. Ensures the SDK is at the latest version before applying updates.
4
4
 
5
5
  ## Usage
6
6
 
@@ -10,7 +10,10 @@ nx g @trackunit/iris-app:ai-agent-sync
10
10
 
11
11
  ## What it syncs
12
12
 
13
- - `.cursor/skills/` - Cursor AI skills for the IrisX App SDK
13
+ - `.agents/skills/` - AI agent skills for the IrisX App SDK (editor-agnostic)
14
+ - `.cursor/mcp.json` - Cursor-specific MCP configuration
15
+ - `AGENTS.md` - Workspace-level agent instructions (always applied)
16
+ - `CLAUDE.md` - Claude-specific configuration (references AGENTS.md)
14
17
 
15
18
  ## Flow
16
19
 
@@ -1,7 +1,7 @@
1
1
  import { Tree } from "@nx/devkit";
2
2
  import { AiAgentSyncGeneratorSchema } from "./schema";
3
3
  /**
4
- * Syncs Cursor rules and AI agent configuration files.
4
+ * Syncs Cursor skills, AGENTS.md, CLAUDE.md, and AI agent configuration files.
5
5
  * Requires the SDK to be at the latest version before running.
6
6
  */
7
7
  export declare function aiAgentSyncGenerator(tree: Tree, options: AiAgentSyncGeneratorSchema): Promise<void>;
@@ -50,7 +50,7 @@ function ensureUpdateScript(tree) {
50
50
  });
51
51
  }
52
52
  /**
53
- * Syncs Cursor rules and AI agent configuration files.
53
+ * Syncs Cursor skills, AGENTS.md, CLAUDE.md, and AI agent configuration files.
54
54
  * Requires the SDK to be at the latest version before running.
55
55
  */
56
56
  async function aiAgentSyncGenerator(tree, options) {
@@ -74,9 +74,34 @@ async function aiAgentSyncGenerator(tree, options) {
74
74
  `Then run this generator again.`);
75
75
  }
76
76
  }
77
- // Copy Cursor rules and AI agent configuration
78
- const templatePath = path.join(__dirname, "../preset/files/.cursor");
79
- (0, devkit_1.generateFiles)(tree, templatePath, ".cursor", {});
77
+ // Clean up old .cursor/rules and .cursor/commands files that were managed by previous versions
78
+ const oldManagedFiles = [
79
+ ".cursor/rules/irisx-app-sdk.mdc",
80
+ ".cursor/rules/rules-index.mdc",
81
+ ".cursor/rules/structured-development.mdc",
82
+ ".cursor/rules/browser-irisx-development.mdc",
83
+ ".cursor/rules/graphql-timeseries.md",
84
+ ".cursor/rules/irisx-app-sdk-customfields.md",
85
+ ".cursor/rules/irisx-app-sdk-graphql.md",
86
+ ".cursor/rules/react-core-hooks.md",
87
+ ".cursor/rules/tables-and-sorting.mdc",
88
+ ".cursor/rules/widget-extensions.md",
89
+ ".cursor/commands/create-app.md",
90
+ ];
91
+ for (const file of oldManagedFiles) {
92
+ if (tree.exists(file)) {
93
+ tree.delete(file);
94
+ }
95
+ }
96
+ // Copy Cursor-specific configuration (mcp.json)
97
+ const cursorTemplatePath = path.join(__dirname, "../preset/files/.cursor");
98
+ (0, devkit_1.generateFiles)(tree, cursorTemplatePath, ".cursor", {});
99
+ // Copy agent skills (editor-agnostic)
100
+ const agentsTemplatePath = path.join(__dirname, "../preset/files/.agents");
101
+ (0, devkit_1.generateFiles)(tree, agentsTemplatePath, ".agents", {});
102
+ // Copy AGENTS.md and CLAUDE.md to workspace root
103
+ const rootTemplatePath = path.join(__dirname, "../preset/root-files");
104
+ (0, devkit_1.generateFiles)(tree, rootTemplatePath, ".", {});
80
105
  await (0, devkit_1.formatFiles)(tree);
81
106
  }
82
107
  exports.default = aiAgentSyncGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/ai-agent-sync/generator.ts"],"names":[],"mappings":";;AAgEA,oDAiCC;;AAjGD,uCAA0E;AAC1E,0DAAuF;AACvF,uDA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IAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IACrE,IAAA,sBAAa,EAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAEjD,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,kBAAe,oBAAoB,CAAC","sourcesContent":["import { Tree, formatFiles, generateFiles, updateJson } from \"@nx/devkit\";\nimport { detectPackageManager, getPackageManagerCommand } from \"nx/src/devkit-exports\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport * as semver from \"semver\";\nimport { AiAgentSyncGeneratorSchema } from \"./schema\";\n\nconst IRIS_APP_PACKAGE = \"@trackunit/iris-app\";\nconst UPDATE_SCRIPT_NAME = \"update:trackunit\";\nconst UPDATE_SCRIPT_CMD = 'npx npm-check-updates \"/@trackunit/\" -u';\n\ntype PackageJson = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n};\n\nfunction getStringValue(obj: unknown, key: string): string | undefined {\n if (typeof obj === \"object\" && obj !== null && key in obj) {\n const value = (obj as Record<string, unknown>)[key];\n return typeof value === \"string\" ? value : undefined;\n }\n return undefined;\n}\n\n/**\n * Gets the installed version of @trackunit/iris-app from workspace package.json\n */\nfunction getInstalledSdkVersion(tree: Tree): string | undefined {\n const pkgJson: unknown = JSON.parse(tree.read(\"package.json\", \"utf-8\") ?? \"{}\");\n if (typeof pkgJson !== \"object\" || pkgJson === null) {\n return undefined;\n }\n const pkg = pkgJson as Record<string, unknown>;\n return getStringValue(pkg.dependencies, IRIS_APP_PACKAGE) ?? getStringValue(pkg.devDependencies, IRIS_APP_PACKAGE);\n}\n\n/**\n * Fetches the latest version of @trackunit/iris-app from npm\n */\nasync function getLatestSdkVersion(): Promise<string> {\n const manifest = await pacote.manifest(IRIS_APP_PACKAGE);\n return manifest.version;\n}\n\n/**\n * Ensures the update:trackunit script exists in package.json\n */\nfunction ensureUpdateScript(tree: Tree): void {\n updateJson<PackageJson, PackageJson>(tree, \"package.json\", pkgJson => {\n if (!pkgJson.scripts) {\n pkgJson.scripts = {};\n }\n if (!pkgJson.scripts[UPDATE_SCRIPT_NAME]) {\n pkgJson.scripts[UPDATE_SCRIPT_NAME] = UPDATE_SCRIPT_CMD;\n }\n return pkgJson;\n });\n}\n\n/**\n * Syncs Cursor rules and AI agent configuration files.\n * Requires the SDK to be at the latest version before running.\n */\nexport async function aiAgentSyncGenerator(tree: Tree, options: AiAgentSyncGeneratorSchema): Promise<void> {\n // Always ensure the update script exists\n ensureUpdateScript(tree);\n\n // Check SDK version unless skipped\n if (!options.skipVersionCheck) {\n const installedVersion = getInstalledSdkVersion(tree);\n const latestVersion = await getLatestSdkVersion();\n\n if (!installedVersion) {\n throw new Error(`${IRIS_APP_PACKAGE} not found in package.json. Is this an Iris App SDK workspace?`);\n }\n\n const installed = semver.minVersion(installedVersion);\n if (!installed || semver.lt(installed, latestVersion)) {\n const pm = detectPackageManager();\n const pmCmd = getPackageManagerCommand(pm);\n\n throw new Error(\n `${IRIS_APP_PACKAGE} is outdated (installed: ${installedVersion}, latest: ${latestVersion}).\\n\\n` +\n `Run the following commands first:\\n` +\n ` ${pmCmd.run(UPDATE_SCRIPT_NAME)}\\n` +\n ` ${pmCmd.install}\\n\\n` +\n `Then run this generator again.`\n );\n }\n }\n\n // Copy Cursor rules and AI agent configuration\n const templatePath = path.join(__dirname, \"../preset/files/.cursor\");\n generateFiles(tree, templatePath, \".cursor\", {});\n\n await formatFiles(tree);\n}\n\nexport default aiAgentSyncGenerator;\n\n"]}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/ai-agent-sync/generator.ts"],"names":[],"mappings":";;AAgEA,oDA6DC;;AA7HD,uCAA0E;AAC1E,0DAAuF;AACvF,uDAAiC;AACjC,mDAA6B;AAC7B,uDAAiC;AAGjC,MA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,+BAA+B;QAC/B,0CAA0C;QAC1C,6CAA6C;QAC7C,qCAAqC;QACrC,6CAA6C;QAC7C,wCAAwC;QACxC,mCAAmC;QACnC,sCAAsC;QACtC,oCAAoC;QACpC,gCAAgC;KACjC,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,gDAAgD;IAChD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC3E,IAAA,sBAAa,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAEvD,sCAAsC;IACtC,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC3E,IAAA,sBAAa,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAEvD,iDAAiD;IACjD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IACtE,IAAA,sBAAa,EAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAE/C,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,kBAAe,oBAAoB,CAAC","sourcesContent":["import { Tree, formatFiles, generateFiles, updateJson } from \"@nx/devkit\";\nimport { detectPackageManager, getPackageManagerCommand } from \"nx/src/devkit-exports\";\nimport * as pacote from \"pacote\";\nimport * as path from \"path\";\nimport * as semver from \"semver\";\nimport { AiAgentSyncGeneratorSchema } from \"./schema\";\n\nconst IRIS_APP_PACKAGE = \"@trackunit/iris-app\";\nconst UPDATE_SCRIPT_NAME = \"update:trackunit\";\nconst UPDATE_SCRIPT_CMD = 'npx npm-check-updates \"/@trackunit/\" -u';\n\ntype PackageJson = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n};\n\nfunction getStringValue(obj: unknown, key: string): string | undefined {\n if (typeof obj === \"object\" && obj !== null && key in obj) {\n const value = (obj as Record<string, unknown>)[key];\n return typeof value === \"string\" ? value : undefined;\n }\n return undefined;\n}\n\n/**\n * Gets the installed version of @trackunit/iris-app from workspace package.json\n */\nfunction getInstalledSdkVersion(tree: Tree): string | undefined {\n const pkgJson: unknown = JSON.parse(tree.read(\"package.json\", \"utf-8\") ?? \"{}\");\n if (typeof pkgJson !== \"object\" || pkgJson === null) {\n return undefined;\n }\n const pkg = pkgJson as Record<string, unknown>;\n return getStringValue(pkg.dependencies, IRIS_APP_PACKAGE) ?? getStringValue(pkg.devDependencies, IRIS_APP_PACKAGE);\n}\n\n/**\n * Fetches the latest version of @trackunit/iris-app from npm\n */\nasync function getLatestSdkVersion(): Promise<string> {\n const manifest = await pacote.manifest(IRIS_APP_PACKAGE);\n return manifest.version;\n}\n\n/**\n * Ensures the update:trackunit script exists in package.json\n */\nfunction ensureUpdateScript(tree: Tree): void {\n updateJson<PackageJson, PackageJson>(tree, \"package.json\", pkgJson => {\n if (!pkgJson.scripts) {\n pkgJson.scripts = {};\n }\n if (!pkgJson.scripts[UPDATE_SCRIPT_NAME]) {\n pkgJson.scripts[UPDATE_SCRIPT_NAME] = UPDATE_SCRIPT_CMD;\n }\n return pkgJson;\n });\n}\n\n/**\n * Syncs Cursor skills, AGENTS.md, CLAUDE.md, and AI agent configuration files.\n * Requires the SDK to be at the latest version before running.\n */\nexport async function aiAgentSyncGenerator(tree: Tree, options: AiAgentSyncGeneratorSchema): Promise<void> {\n // Always ensure the update script exists\n ensureUpdateScript(tree);\n\n // Check SDK version unless skipped\n if (!options.skipVersionCheck) {\n const installedVersion = getInstalledSdkVersion(tree);\n const latestVersion = await getLatestSdkVersion();\n\n if (!installedVersion) {\n throw new Error(`${IRIS_APP_PACKAGE} not found in package.json. Is this an Iris App SDK workspace?`);\n }\n\n const installed = semver.minVersion(installedVersion);\n if (!installed || semver.lt(installed, latestVersion)) {\n const pm = detectPackageManager();\n const pmCmd = getPackageManagerCommand(pm);\n\n throw new Error(\n `${IRIS_APP_PACKAGE} is outdated (installed: ${installedVersion}, latest: ${latestVersion}).\\n\\n` +\n `Run the following commands first:\\n` +\n ` ${pmCmd.run(UPDATE_SCRIPT_NAME)}\\n` +\n ` ${pmCmd.install}\\n\\n` +\n `Then run this generator again.`\n );\n }\n }\n\n // Clean up old .cursor/rules and .cursor/commands files that were managed by previous versions\n const oldManagedFiles = [\n \".cursor/rules/irisx-app-sdk.mdc\",\n \".cursor/rules/rules-index.mdc\",\n \".cursor/rules/structured-development.mdc\",\n \".cursor/rules/browser-irisx-development.mdc\",\n \".cursor/rules/graphql-timeseries.md\",\n \".cursor/rules/irisx-app-sdk-customfields.md\",\n \".cursor/rules/irisx-app-sdk-graphql.md\",\n \".cursor/rules/react-core-hooks.md\",\n \".cursor/rules/tables-and-sorting.mdc\",\n \".cursor/rules/widget-extensions.md\",\n \".cursor/commands/create-app.md\",\n ];\n for (const file of oldManagedFiles) {\n if (tree.exists(file)) {\n tree.delete(file);\n }\n }\n\n // Copy Cursor-specific configuration (mcp.json)\n const cursorTemplatePath = path.join(__dirname, \"../preset/files/.cursor\");\n generateFiles(tree, cursorTemplatePath, \".cursor\", {});\n\n // Copy agent skills (editor-agnostic)\n const agentsTemplatePath = path.join(__dirname, \"../preset/files/.agents\");\n generateFiles(tree, agentsTemplatePath, \".agents\", {});\n\n // Copy AGENTS.md and CLAUDE.md to workspace root\n const rootTemplatePath = path.join(__dirname, \"../preset/root-files\");\n generateFiles(tree, rootTemplatePath, \".\", {});\n\n await formatFiles(tree);\n}\n\nexport default aiAgentSyncGenerator;\n"]}
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: browser-testing
3
+ description: Use when testing IrisX Apps in browser, extension not appearing, dev mode toggle issues, or verifying code changes in Trackunit Manager.
4
+ ---
5
+
6
+ # Browser Testing for IrisX Apps
7
+
8
+ ## Overview
9
+
10
+ IrisX Apps run inside Trackunit Manager, not on localhost. Test at `https://new.manager.trackunit.com/goto/iris-app-dev` with "Use Local Apps" enabled.
11
+
12
+ ## Chrome DevTools MCP Required
13
+
14
+ **IrisX Apps render inside iFrames.** Standard browser automation tools cannot interact with iFrame content. You **MUST** use Chrome DevTools MCP for browser testing.
15
+
16
+ ### Check Chrome DevTools MCP Availability
17
+
18
+ Before browser testing, verify the MCP is available:
19
+
20
+ 1. Check if `chrome-devtools` MCP server is enabled in Cursor settings
21
+ 2. Try listing pages: use the `list_pages` tool from `user-chrome-devtools` server
22
+ 3. If tools are not available, the MCP needs to be configured
23
+
24
+ ### Setup Chrome DevTools MCP
25
+
26
+ If Chrome DevTools MCP is not available:
27
+
28
+ 1. **Install the MCP server** - Guide the user to install `chrome-devtools-mcp`
29
+ 2. **Configure in Cursor** - Add the server to `.cursor/mcp.json`:
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "chrome-devtools": {
34
+ "command": "npx",
35
+ "args": ["-y", "chrome-devtools-mcp@latest"]
36
+ }
37
+ }
38
+ }
39
+ ```
40
+ 3. **Restart Cursor** to load the new MCP server
41
+ 4. **Launch Chrome with debugging** - Chrome must be started with remote debugging enabled (the MCP handles this)
42
+
43
+ ### Why Chrome DevTools?
44
+
45
+ | Standard Browser Tools | Chrome DevTools MCP |
46
+ |------------------------|---------------------|
47
+ | Cannot access iFrame content | Full iFrame support via CDP |
48
+ | Limited to top-level DOM | Access nested contexts |
49
+ | Screenshots miss iFrame content | Captures complete page |
50
+ | Cannot interact with extensions | Full extension interaction |
51
+
52
+ ## When to Use
53
+
54
+ - Testing extension after code changes
55
+ - Extension not appearing or showing blank
56
+ - Enabling local development mode
57
+ - Debugging GraphQL/API errors in browser
58
+ - Verifying UI renders correctly
59
+
60
+ **Not for:** Unit tests, linting, or type checking (use NX commands).
61
+
62
+ ## Quick Reference
63
+
64
+ ### Setup Steps
65
+
66
+ 1. Navigate to `https://new.manager.trackunit.com/goto/iris-app-dev`
67
+ 2. Wait for user login (2-4 minutes)
68
+ 3. Enable "Use Local Apps" toggle (main content area, not sidebar)
69
+ 4. Navigate to extension based on type
70
+
71
+ ### Navigate to Extension
72
+
73
+ Based on extension type:
74
+
75
+ | Extension Type | Navigation |
76
+ |----------------|------------|
77
+ | `FLEET_EXTENSION` | Main menu → App name |
78
+ | `ASSET_HOME_EXTENSION` | Assets → Open any asset → Extension tab |
79
+ | `SITE_HOME_EXTENSION` | Sites → Open any site → Extension tab |
80
+ | `WIDGET_EXTENSION` | Dashboard → Add Widget → Find widget |
81
+
82
+ ## Testing After Code Changes
83
+
84
+ ### Reload Strategy
85
+
86
+ After making code changes:
87
+
88
+ **1. Check Lints First (Zero Tolerance):**
89
+ ```
90
+ - Run read_lints on modified files
91
+ - Fix ALL errors before testing in browser
92
+ - Do not proceed with any TypeScript or linter errors
93
+ ```
94
+
95
+ **2. Reload Browser:**
96
+
97
+ The dev server hot-reloads, but sometimes a full page refresh is needed:
98
+
99
+ | Option | When to Use | How |
100
+ |--------|-------------|-----|
101
+ | Wait for Hot Reload | First attempt | Wait 2-3 seconds |
102
+ | Soft Refresh | Changes don't appear | `Command+R` (Mac) or `Ctrl+R` (Windows) |
103
+ | Hard Refresh | Soft refresh fails | `Command+Shift+R` (Mac) or `Ctrl+Shift+R` (Windows) |
104
+
105
+ **3. Manifest Changes Require Re-Serve:**
106
+
107
+ If you modified `iris-app-manifest.ts` (scopes, CSP headers, metadata):
108
+ - Browser reload is NOT enough
109
+ - Stop the dev server (`Ctrl+C`)
110
+ - Re-run: `npx nx run [app-name]:serve`
111
+ - Wait for server to restart
112
+ - Then reload browser
113
+
114
+ ### Verification Checklist
115
+
116
+ After each reload:
117
+
118
+ 1. Take browser snapshot
119
+ 2. Look for extension content
120
+ 3. Check if blank/empty → may need hard refresh
121
+ 4. Verify expected UI elements are present
122
+ 5. Check console for errors
123
+ 6. Check network requests for GraphQL/API issues
124
+
125
+ ## Troubleshooting
126
+
127
+ ### Extension Shows Blank After Changes
128
+
129
+ 1. Try hard refresh (`Command+Shift+R`)
130
+ 2. Check browser console for errors
131
+ 3. Check if dev server is still running
132
+ 4. Verify file saved correctly
133
+ 5. Check for TypeScript compilation errors
134
+ 6. Navigate away and back to extension
135
+
136
+ ### "Use Local Apps" Toggle Not Found
137
+
138
+ 1. Verify user is logged in
139
+ 2. Navigate directly to `https://new.manager.trackunit.com/goto/iris-app-dev`
140
+ 3. Wait for page to fully load (redirects to Developer Settings)
141
+ 4. Take snapshot to see what's visible
142
+ 5. Toggle is in the main content area, not the sidebar
143
+
144
+ ### Extension Not Appearing
145
+
146
+ 1. Verify dev server is running
147
+ 2. Check manifest has correct extension type
148
+ 3. If changed `iris-app-manifest.ts` → re-serve the app
149
+ 4. Hard refresh browser
150
+ 5. Disable and re-enable "Use Local Apps"
151
+ 6. Check browser console for loading errors
152
+
153
+ ### GraphQL/API Errors
154
+
155
+ 1. Use browser network tab to find GraphQL requests
156
+ 2. Inspect response body for "errors" array (GraphQL returns 200 even with errors)
157
+ 3. Common fixes:
158
+ - Missing scopes → Add to `iris-app-manifest.ts` scopes array
159
+ - CSP violations → Add domain to `cspHeader` in manifest
160
+ - Auth issues → Deploy app to enable new scopes
161
+
162
+ ## Workflow Checklist
163
+
164
+ ### After Every Code Change:
165
+
166
+ 1. ✅ Check lints (zero tolerance)
167
+ 2. ✅ Fix all errors
168
+ 3. ✅ Wait 2-3 seconds for hot reload
169
+ 4. ✅ Refresh browser if needed
170
+ 5. ✅ Take snapshot
171
+ 6. ✅ Verify changes visible
172
+ 7. ✅ Check console for errors
173
+ 8. ✅ Check network tab if using APIs
174
+
175
+ ### Before Moving to Next Feature:
176
+
177
+ 1. ✅ Current feature fully working in browser
178
+ 2. ✅ Zero linter/TypeScript errors
179
+ 3. ✅ Zero browser console errors
180
+ 4. ✅ All network requests successful
181
+ 5. ✅ Screenshot of working feature
182
+
183
+ ## Common Mistakes
184
+
185
+ | Mistake | Fix |
186
+ |---------|-----|
187
+ | Using default browser automation | Extensions render in iFrames; use Chrome DevTools MCP |
188
+ | Testing on localhost | Use `https://new.manager.trackunit.com/goto/iris-app-dev` |
189
+ | Skipping lint check before browser | Always run `read_lints` first |
190
+ | Not enabling "Use Local Apps" | Toggle is in main content area, not sidebar |
191
+ | Changed manifest without re-serve | Stop dev server and restart |
192
+ | Moving to next feature before verifying | Confirm current feature works in browser first |
193
+ | Chrome DevTools MCP not configured | Help user install and configure the MCP server |
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: create-app
3
+ description: Use when building a new IrisX App from scratch, user asks to create an app, or starting a new extension project.
4
+ ---
5
+
6
+ # Create IrisX App
7
+
8
+ ## Overview
9
+
10
+ Create IrisX Apps using browser-driven iterative development. Real data first (GraphQL API), verify each feature in browser before proceeding.
11
+
12
+ ## When to Use
13
+
14
+ - User asks to create a new IrisX App
15
+ - Starting a new extension project
16
+ - Building a complete app from requirements
17
+
18
+ **Not for:** Modifying existing extensions (use domain-specific skills).
19
+
20
+ ## Core Principles
21
+
22
+ | Principle | Implementation |
23
+ |-----------|----------------|
24
+ | Real Data First | Use GraphQL API, never mock unless requested |
25
+ | Browser Testing | Verify each change at `manager.trackunit.com/goto/iris-app-dev` |
26
+ | Chrome DevTools MCP | Required for iFrame-based extension testing |
27
+ | One Feature at a Time | Complete and verify before moving on |
28
+ | Zero Tolerance for Errors | Fix all lint/TypeScript errors immediately |
29
+
30
+ ## Chrome DevTools MCP Requirement
31
+
32
+ **IrisX Apps render inside iFrames.** Standard browser automation cannot interact with iFrame content.
33
+
34
+ Before starting browser testing:
35
+ 1. Verify Chrome DevTools MCP is available (check for `user-chrome-devtools` server)
36
+ 2. If not available, see `browser-testing` skill for setup instructions
37
+ 3. Use Chrome DevTools tools (`take_screenshot`, `click`, `evaluate_script`, etc.) for all browser interactions
38
+
39
+ ## Development Workflow
40
+
41
+ ### Phase 1: Planning
42
+
43
+ **1. Analyze Requirements**
44
+
45
+ If not already described, ask: "What functionality do you want to build?"
46
+
47
+ **2. Create Implementation Plan**
48
+
49
+ Structure the plan as:
50
+
51
+ - **Phase 1: Project Setup**
52
+ - Create app with `@trackunit/iris-app:create`
53
+ - Create extensions with `@trackunit/iris-app:extend`
54
+ - Start dev server in background
55
+
56
+ - **Phase 2: Browser Verification (CRITICAL GATE)**
57
+ - Verify Chrome DevTools MCP is available (required for iFrame testing)
58
+ - Open browser to `https://new.manager.trackunit.com/goto/iris-app-dev`
59
+ - Wait for user login (2-4 minutes)
60
+ - Enable "Use Local Apps" toggle
61
+ - Navigate to extension location
62
+ - Use Chrome DevTools `take_screenshot` to verify extension renders
63
+ - **STOP - Must confirm extension working before Phase 3**
64
+
65
+ - **Phase 3: Feature Implementation (One at a Time)**
66
+ - For each feature:
67
+ - Prerequisites (GraphQL setup/scopes needed)
68
+ - Implementation
69
+ - Validation: Check lints, browser test
70
+ - Browser test: What to verify
71
+
72
+ - **Phase 4: Final Verification**
73
+ - Zero linter/TypeScript errors
74
+ - End-to-end browser testing
75
+ - Documentation completion
76
+
77
+ **3. Present Plan to User**
78
+
79
+ Confirm before proceeding.
80
+
81
+ ### Phase 2: Project Setup
82
+
83
+ **4. Create App and Extensions**
84
+
85
+ ```bash
86
+ npx nx generate @trackunit/iris-app:create [app-name]
87
+ npx nx g @trackunit/iris-app:extend --name=[extension-name] --app=[app-name] --directory=[feature] --type=[EXTENSION_TYPE]
88
+ ```
89
+
90
+ **5. Start Development Server**
91
+
92
+ ```bash
93
+ npx nx run [app-name]:serve
94
+ ```
95
+
96
+ **6. Open Browser and Verify**
97
+
98
+ **CRITICAL: Do this BEFORE any GraphQL setup or UI implementation**
99
+
100
+ 1. Navigate to `https://new.manager.trackunit.com/goto/iris-app-dev`
101
+ 2. Wait for user login
102
+ 3. Enable "Use Local Apps" toggle
103
+ 4. Navigate to extension based on type
104
+ 5. Take snapshot to verify extension loads
105
+ 6. Check console for errors
106
+
107
+ **STOP HERE: Do not proceed until extension is confirmed working**
108
+
109
+ ### Phase 3: Iterative Feature Development
110
+
111
+ **7. Create Documentation**
112
+
113
+ Create `/docs/[app-name].md` with the plan and architecture.
114
+
115
+ **8. For Each Feature (ONE AT A TIME)**
116
+
117
+ **a) Setup prerequisites for this feature ONLY:**
118
+ ```bash
119
+ # If feature needs GraphQL:
120
+ npm install @trackunit/react-graphql-tools
121
+ npx nx generate @trackunit/react-graphql-tools:add-graphql --project=[project-name]
122
+ ```
123
+
124
+ **b) Implement the feature:**
125
+ - Write code changes for ONE feature only
126
+ - Keep changes small and focused
127
+
128
+ **c) Check for lint and TypeScript errors:**
129
+ - Run `read_lints` on modified files
130
+ - Fix ALL errors immediately
131
+ - Zero tolerance: Do not proceed with any errors
132
+
133
+ **d) Reload browser to test:**
134
+ - Check browser console and network tab for errors
135
+ - Verify the feature renders correctly
136
+ - Take screenshot if visual changes
137
+
138
+ **e) Debug if needed:**
139
+ - Read console errors
140
+ - Check network requests
141
+ - Adjust code and repeat
142
+ - **DO NOT** move forward until feature works
143
+
144
+ **f) Update documentation:**
145
+ - Mark feature as completed
146
+
147
+ **g) Move to next feature:**
148
+ - Only proceed when current feature is verified working
149
+
150
+ ### Phase 4: Completion
151
+
152
+ **9. Final Verification**
153
+
154
+ - Run `read_lints` on all modified files
155
+ - Test all features end-to-end in browser
156
+ - Verify data loads correctly
157
+
158
+ **10. Summary**
159
+
160
+ Inform the user:
161
+ - All features implemented and verified
162
+ - No linter or TypeScript errors remaining
163
+ - Documentation complete
164
+ - **Important**: User must deploy via Trackunit marketplace (never auto-submit)
165
+
166
+ ## Critical Rules
167
+
168
+ ### Feature Implementation
169
+ - **One feature at a time** - even for similar components
170
+ - **Prerequisites on-demand** - setup GraphQL/scopes only when needed
171
+ - **Zero tolerance for errors** - fix all lint/TypeScript errors immediately
172
+ - **Test completely** - verify working in browser before moving on
173
+
174
+ ### Validation Checklist (After Every Code Change)
175
+ 1. Run `read_lints` on modified files
176
+ 2. Fix ALL linter and TypeScript errors
177
+ 3. Reload browser
178
+ 4. Check browser console and network tab
179
+ 5. Verify UI renders correctly
180
+ 6. Fix any issues before proceeding
181
+
182
+ ## Common Mistakes
183
+
184
+ | Mistake | Fix |
185
+ |---------|-----|
186
+ | Using default browser automation | Use Chrome DevTools MCP (iFrames require it) |
187
+ | Starting implementation before browser verification | Complete Phase 2 (browser gate) first |
188
+ | Implementing multiple features at once | One feature, fully verified, then next |
189
+ | Using mock data without asking | Always use real GraphQL API |
190
+ | Skipping lint check | Zero tolerance - run `read_lints` after every change |
191
+ | Auto-submitting to marketplace | Never auto-submit; instruct user to do so |