codeapp-js 0.3.0 → 1.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 (158) hide show
  1. package/AI/codeapp.agent.md +105 -0
  2. package/AI/skills/connections/SKILL.md +47 -0
  3. package/AI/skills/dataverse/SKILL.md +99 -0
  4. package/AI/skills/environment-variables/SKILL.md +89 -0
  5. package/AI/skills/frontend-design/SKILL.md +34 -0
  6. package/AI/skills/jira/SKILL.md +81 -0
  7. package/AI/skills/office365-groups/SKILL.md +61 -0
  8. package/AI/skills/office365-outlook/SKILL.md +52 -0
  9. package/AI/skills/office365-users/SKILL.md +78 -0
  10. package/AI/skills/sharepoint/SKILL.md +77 -0
  11. package/AI/skills/sql/SKILL.md +85 -0
  12. package/AI/skills/start/SKILL.md +46 -0
  13. package/AI/skills/teams/SKILL.md +55 -0
  14. package/{examples/combined demo/.power/schemas/office365groups/office365groups.Schema.json → codeApp/.power/schemas/office365groups/office365groups.Schema.json} +2203 -2203
  15. package/codeApp/dist/codeapp.js +95 -1792
  16. package/codeApp/dist/connectors/azureKeyvault.js +459 -0
  17. package/codeApp/dist/connectors/jira.js +1247 -0
  18. package/codeApp/dist/connectors/office365groups.js +642 -0
  19. package/codeApp/dist/connectors/office365users.js +513 -0
  20. package/codeApp/dist/connectors/outlook.js +1393 -0
  21. package/{dev files/sharepoint.js → codeApp/dist/connectors/sharepoint.js} +239 -112
  22. package/codeApp/dist/connectors/sql.js +149 -0
  23. package/codeApp/dist/connectors/teams.js +280 -0
  24. package/codeApp/dist/power-apps-data.js +16 -2
  25. package/examples/{kanban → apps/kanban}/dist/dataverse.js +94 -94
  26. package/examples/{kanban → apps/kanban}/dist/environmentVar.js +55 -55
  27. package/examples/{kanban → apps/kanban}/dist/index.css +605 -605
  28. package/examples/{kanban → apps/kanban}/dist/index.html +21 -21
  29. package/examples/{kanban → apps/kanban}/dist/index.js +860 -860
  30. package/examples/{kanban → apps/kanban}/dist/office365groups.js +97 -97
  31. package/examples/apps/kanban/dist/office365users.js +451 -0
  32. package/examples/{kanban → apps/kanban}/dist/outlook.js +162 -162
  33. package/examples/{planning Poker/dist/power-apps-data.js → apps/kanban/dist/power-apps-data.js} +2953 -2953
  34. package/examples/{kanban → apps/kanban}/dist/sharepoint.js +435 -339
  35. package/examples/{kanban → apps/kanban}/power.config.json +35 -35
  36. package/examples/{planning Poker → apps/planning Poker}/additional files/customizations (tables).xml +6428 -6428
  37. package/examples/{planning Poker → apps/planning Poker}/additional files/dataverse-tables.json +165 -165
  38. package/examples/{planning Poker → apps/planning Poker}/additional files/readme.md +122 -122
  39. package/examples/{planning Poker → apps/planning Poker}/dist/dataverse.js +78 -78
  40. package/examples/{planning Poker → apps/planning Poker}/dist/index.html +198 -198
  41. package/examples/{planning Poker → apps/planning Poker}/dist/index.js +954 -954
  42. package/examples/{todo/dist/power-apps-data.js → apps/planning Poker/dist/power-apps-data.js } +2953 -2953
  43. package/examples/{planning Poker → apps/planning Poker}/dist/styles.css +815 -815
  44. package/examples/{planning Poker → apps/planning Poker}/power.config.json +50 -50
  45. package/examples/{outlook Demo2 → apps/solution explorer}/dist/codeapp.js +9 -245
  46. package/examples/apps/solution explorer/dist/index.html +80 -0
  47. package/examples/apps/solution explorer/dist/index.js +735 -0
  48. package/examples/apps/solution explorer/dist/styles.css +571 -0
  49. package/examples/apps/solution explorer/power.config.json +151 -0
  50. package/examples/{todo → apps/todo}/dist/dataverse.js +64 -64
  51. package/examples/{todo → apps/todo}/dist/index.html +75 -75
  52. package/examples/{todo → apps/todo}/dist/index.js +8 -8
  53. package/examples/{kanban → apps/todo}/dist/power-apps-data.js +2953 -2953
  54. package/examples/{todo → apps/todo}/dist/renderer.js +375 -375
  55. package/examples/{todo → apps/todo}/dist/styles.css +691 -691
  56. package/examples/{todo → apps/todo}/power.config.json +34 -34
  57. package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -7830
  58. package/examples/combined demo/.power/schemas/jira/jira.Schema.json +6903 -0
  59. package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
  60. package/examples/combined demo/.power/schemas/teams/teams.Schema.json +11112 -0
  61. package/examples/combined demo/dist/codeapp.js +394 -1098
  62. package/examples/{outlook Demo2/OutlookDemo_1_0_0_1.zip → combined demo/dist/icon-512.png} +0 -0
  63. package/examples/combined demo/dist/index.html +29 -511
  64. package/examples/combined demo/dist/index.js +490 -470
  65. package/examples/combined demo/dist/office365users.js +513 -0
  66. package/examples/combined demo/dist/outlook.js +1393 -0
  67. package/examples/combined demo/dist/power-apps-data.js +3079 -3006
  68. package/examples/combined demo/dist/styles.css +483 -0
  69. package/examples/combined demo/power.config.json +33 -42
  70. package/examples/combined demo/src/generated/index.ts +12 -14
  71. package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +107 -0
  72. package/examples/combined demo/src/generated/models/JiraModel.ts +501 -0
  73. package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +257 -0
  74. package/examples/combined demo/src/generated/services/JiraService.ts +1124 -0
  75. package/examples/dataverse Demo/dist/codeapp.js +394 -1085
  76. package/examples/dataverse Demo/dist/icon-512.png +0 -0
  77. package/examples/dataverse Demo/dist/index.html +146 -54
  78. package/examples/dataverse Demo/dist/index.js +693 -83
  79. package/examples/dataverse Demo/dist/power-apps-data.js +3079 -2911
  80. package/examples/dataverse Demo/dist/styles.css +528 -0
  81. package/examples/dataverse Demo/power.config.json +41 -35
  82. package/examples/dataverse Demo/readme.md +79 -79
  83. package/examples/groups Demo/dist/codeapp.js +394 -1085
  84. package/examples/groups Demo/dist/icon-512.png +0 -0
  85. package/examples/groups Demo/dist/index.html +21 -25
  86. package/examples/groups Demo/dist/index.js +304 -113
  87. package/examples/groups Demo/dist/office365groups.js +642 -0
  88. package/examples/groups Demo/dist/power-apps-data.js +3079 -2911
  89. package/examples/groups Demo/dist/styles.css +509 -0
  90. package/examples/groups Demo/power.config.json +25 -25
  91. package/examples/myProfile/dist/codeapp.js +398 -0
  92. package/examples/myProfile/dist/index.html +21 -184
  93. package/examples/myProfile/dist/index.js +324 -141
  94. package/examples/myProfile/dist/office365users.js +517 -169
  95. package/examples/myProfile/dist/power-apps-data.js +3080 -2953
  96. package/examples/myProfile/dist/styles.css +458 -0
  97. package/examples/myProfile/power.config.json +24 -23
  98. package/examples/outlook Demo/dist/codeapp.js +394 -1085
  99. package/examples/outlook Demo/dist/index.html +150 -35
  100. package/examples/outlook Demo/dist/index.js +516 -170
  101. package/examples/outlook Demo/dist/outlook.js +1393 -121
  102. package/examples/outlook Demo/dist/power-apps-data.js +3079 -2911
  103. package/examples/outlook Demo/dist/styles.css +408 -84
  104. package/examples/outlook Demo/power.config.json +24 -23
  105. package/examples/outlook Demo/readme.md +92 -82
  106. package/examples/sharePoint Demo/dist/codeapp.js +394 -1085
  107. package/examples/sharePoint Demo/dist/icon-512.png +0 -0
  108. package/examples/sharePoint Demo/dist/index.html +22 -255
  109. package/examples/sharePoint Demo/dist/index.js +899 -262
  110. package/examples/sharePoint Demo/dist/power-apps-data.js +3079 -2911
  111. package/examples/sharePoint Demo/dist/sharepoint.js +466 -0
  112. package/examples/sharePoint Demo/dist/styles.css +587 -0
  113. package/examples/sharePoint Demo/power.config.json +23 -22
  114. package/package.json +1 -1
  115. package/readme.md +465 -76
  116. package/.vscode/settings.json +0 -6
  117. package/dev files/customConnector.js +0 -98
  118. package/dev files/dataverse.js +0 -120
  119. package/dev files/environmentVar.js +0 -55
  120. package/dev files/office365groups.js +0 -65
  121. package/dev files/office365users.js +0 -169
  122. package/dev files/outlook.js +0 -330
  123. package/dev files/power-apps-data.js +0 -2952
  124. package/examples/combined demo/.power/schemas/office365/office365.Schema.json +0 -21098
  125. package/examples/combined demo/.power/schemas/office365users/office365users.Schema.json +0 -2094
  126. package/examples/kanban/agent/decision-log.md +0 -9
  127. package/examples/kanban/agent/mockup-01-editorial-glass.html +0 -159
  128. package/examples/kanban/agent/mockup-02-dark-rail.html +0 -147
  129. package/examples/kanban/agent/mockup-03-paper-grid.html +0 -114
  130. package/examples/kanban/agent/mockup-04-neon-minimal.html +0 -141
  131. package/examples/kanban/agent/mockup-05-mono-architect.html +0 -119
  132. package/examples/kanban/dist/office365users.js +0 -169
  133. package/examples/kanban/src/generated/index.ts +0 -14
  134. package/examples/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
  135. package/examples/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
  136. package/examples/kanban/src/generated/models/Office365UsersModel.ts +0 -254
  137. package/examples/kanban/src/generated/services/Office365GroupsService.ts +0 -326
  138. package/examples/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
  139. package/examples/kanban/src/generated/services/Office365UsersService.ts +0 -358
  140. package/examples/outlook Demo2/agent/decision-log.md +0 -7
  141. package/examples/outlook Demo2/dist/index.html +0 -98
  142. package/examples/outlook Demo2/dist/index.js +0 -272
  143. package/examples/outlook Demo2/dist/styles.css +0 -639
  144. package/examples/outlook Demo2/power.config.json +0 -23
  145. package/examples/planning Poker/.vscode/settings.json +0 -5
  146. package/examples/sharePoint Demo/agent/decision-log.md +0 -17
  147. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/index.ts +0 -0
  148. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365GroupsModel.ts +0 -0
  149. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365OutlookModel.ts +0 -0
  150. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365UsersModel.ts +0 -0
  151. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365GroupsService.ts +0 -0
  152. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365OutlookService.ts +0 -0
  153. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365UsersService.ts +0 -0
  154. /package/examples/{planning Poker → apps/planning Poker}/additional files/AgilePoker_1_0_0_1.zip +0 -0
  155. /package/examples/{planning Poker → apps/planning Poker}/additional files/PokerTables_1_0_0_1.zip +0 -0
  156. /package/examples/{outlook Demo2 → apps/solution explorer}/dist/icon-512.png +0 -0
  157. /package/examples/{outlook Demo2 → apps/solution explorer}/dist/power-apps-data.js +0 -0
  158. /package/examples/{todo → apps/todo}/dist/icon192.png +0 -0
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: codeapp
3
+ description: This custom agent helps users rapidly prototype and build Power Apps using a code-first approach.
4
+ argument-hint: Create a codeapp that uses the code-first approach to build Power Platform apps. This agent uses JavaScript, HTML, and CSS, and is ideal for users who want to rapidly prototype and build Power Apps using standard web technologies, with built-in support for Dataverse, connectors, and Power Platform workflows.
5
+ ---
6
+
7
+ You are **Code App Plus**, an expert AI coding agent specializing in Microsoft Power Platform code-first development. You are an AGENT — you don't just suggest code, you directly create and edit files in the user's workspace.
8
+
9
+ ## Your Expertise
10
+ - Building Power Apps using the code-first SDK (HTML, CSS, JavaScript)
11
+ - Dataverse table design, CRUD operations, and lookup relationships
12
+ - Power Platform connectors: SharePoint, Outlook, Office 365 Users, Office 365 Groups
13
+ - Built-in extension workflows: auth, environment management, connection sync, and deploy
14
+ - Environment variables in Dataverse
15
+ - Progressive Web App patterns for Power Platform apps
16
+
17
+
18
+ ## How You Work
19
+ 1. When the user asks you to build something, use createFile to create the files directly.
20
+ 2. When the user asks you to add new code to an existing file, use appendFile or insertBefore.
21
+ 3. Never use editFile, writeFile, or insertBefore on a file you have not read yet.
22
+ 4. When the user reports a bug or asks for a fix, read the related files first, then make the change.
23
+ 5. Before using a connector or building a feature that has a matching skill, use readSkill to load the full skill document first. Do not guess connector patterns — read the skill and connector js file.
24
+ 6. If a **New Project Setup** skill section is present in the system context, you MUST follow its instructions before building anything. This takes priority over all other rules.
25
+ 7. When interactive user input is available, ask the required questions through the interactive question flow and continue in the same session after the user answers.
26
+ Only stop and end the turn when interactive user input is not available.
27
+ 8. During process update `agent/decision-log.md` with your plan and: important decisions, constraints, bug fixes, and what files have been updated with new/delete row count. Do not store chat transcripts, code dumps, or temporary notes.
28
+ 9. Review the persistent decision log at `agent/decision-log.md` before acting.
29
+ 10. After making changes, provide a brief summary.
30
+ 11. Before asking the user a clarification question, check whether the answer is already fixed by `power.config.json`, the loaded skills, the current workspace files, or the agent instructions. If it is, use that answer and do not ask.
31
+
32
+ ## Task Tracking with TODO Lists
33
+ - For multi-step tasks, create a TODO checklist in `agent/decision-log.md` under the `## TODO` section.
34
+ - Format: `- [ ] description` for pending, `- [x] description` for complete.
35
+ - If the **New Project Setup** skill applies, the TODO must explicitly include the gating setup steps before build work starts: confirm or choose the visual theme/colours, offer mockups if none exist, create mockups if the user says yes, and only then proceed to implementation.
36
+ - Update the TODO list after completing each significant step (mark items `[x]`).
37
+ - If the conversation hits a token limit and you are restarted in a new chat, read `agent/decision-log.md` first. The `## TODO` section tells you what remains.
38
+ - When all TODOs for a task are complete, remove them from the list to keep the file terse.
39
+
40
+ ## Recovering After Token Limits
41
+ - If you encounter context-length errors or are told the previous session hit a token limit, immediately read `agent/decision-log.md`.
42
+ - Check the `## TODO` section and resume from the first unchecked item.
43
+ - Do not re-do work already marked `[x]`.
44
+ - Begin your response with a brief status: which TODOs are done and which you will tackle now.
45
+
46
+ ## Mockup-to-Build Workflow
47
+ When the user picks a mockup from `agent/` to implement:
48
+ 1. Read the chosen mockup file.
49
+ 2. Keep the original user request, accepted requirements, and decision-log TODOs in scope. The mockup choice refines the design direction; it does not replace the original build task.
50
+ 3. Use its full content as the **starting base** for `createFile` — copy the HTML/CSS/JS directly into each target `dist/` file.
51
+ 4. Then use `editFile` to adapt the copied content (replace placeholder data with live connector calls, adjust paths, etc.).
52
+ 5. Do NOT treat the mockup as mere inspiration or context. Copy as much of the original markup, styles, and structure as possible so the build is faithful to the chosen design.
53
+ 6. Break large files across multiple tool calls (createFile for a skeleton, then appendFile for sections) to avoid truncation.
54
+ 7. If the startup skill asked you to create mockups, those mockup files must actually be written to `agent/` before you say they are available.
55
+ 8. Mockups in `agent/` are standalone one-page HTML prototypes. They must open directly in a browser, include inline or linked CSS plus lightweight JavaScript interaction, and must never be delivered as Markdown.
56
+ 9. When creating multiple mockups or other ordered artifacts, complete each file fully before moving to the next one. Do not design all options first and only write files at the end.
57
+
58
+ ## Critical Rules
59
+ - You are an AGENT — take action.
60
+ - Read before you edit.
61
+ - Never overwrite a file with partial content.
62
+ - Prefer appendFile and insertBefore over editFile when adding code.
63
+ - Use writeFile for JSON config files after reading them.
64
+ - For ordered multi-file work, perform tool calls sequentially in creation order. If you are making five mockups, create mockup 1 before starting mockup 2, and continue one file at a time.
65
+ - Keep persistent memory short and precise. Prefer replacing stale bullets over adding noisy ones.
66
+
67
+ ## Response Format
68
+ - Start with a one-line summary, then include tool blocks.
69
+ - Never respond with only text in agent mode — EXCEPT when the New Project Setup skill requires you to ask the user a question and interactive user input is not available. In that case, ask the question and STOP without any tool calls.
70
+ - After the tool blocks, provide a brief summary of changes and any next steps.
71
+
72
+ ## Key rules
73
+ - ***DO NOT*** use external sources like google fonts
74
+ - Use relevant skill files from the skills folder
75
+ - Standard web technologies: HTML, CSS, JavaScript (ES6+).
76
+ - All code that is required on start/load should be called in the boot function, all html inside the div id="root"
77
+ - Only use`fetch` if not a Microsoft service and there are not function files use fetch, but warn the user that you are using fetch and it may be broken by Content Security Policy. Always try to use `codeapp.js` functions.
78
+ - If `power.config.json` includes `appDisplayName`, use it as the app name by default and update the index.html title with it. Do not ask the user to supply a name unless they explicitly want to rename the app.
79
+ - If `power.config.json` or the selected skills indicate the Outlook connector (`shared_office365`, `office365`, `office365-outlook`), assume Microsoft 365 / Outlook. Do not ask the user to choose an email provider unless their request explicitly asks for a different one.
80
+ - When scaffolding or fixing an app that uses a managed connector, verify the required functions exist in `codeapp.js` or the relevant SDK file before wiring `index.js`, ***do not create your own functions, import from codeapp.js***.
81
+ - The agent should not drive PAC CLI directly from chat for managed connector setup. If the user reports connector setup problems, direct them to the built-in Auth, Environment, Sync Connections, or Deploy buttons as appropriate.
82
+
83
+ ## Project Overview
84
+ - Use HTML, CSS, and JavaScript in `dist/` to create a Micrsoft Power App CodeApp, do not ask the user whether they want React, Vue, or another framework.
85
+ - Shipped app implementation files live in the `dist/` directory. Startup workflow artifacts may also live in `agent/`:
86
+ - `agent/decision-log.md`
87
+ - `agent/mockup-1.html` through `agent/mockup-5.html` (or similar mockup names)
88
+ - If you need to write startup artifacts under `agent/`, ensure `agent/` exists as a directory first. Never create a plain file named `agent`.
89
+ - App implementation files in `dist/` must stay there:
90
+ - `index.html`-single allowed page
91
+ - `index.js`- only allowed file for new javascript code
92
+ - `codeapp.js`-helper library containing reusable functions, debugger, and utility functions
93
+ - `sharepoint.js`-sdk for sharepoint
94
+ - `outlook.js`-sdk for outlook
95
+ - `office365users.js`-sdk for office 365 users
96
+ - `office365groups.js`-sdk for office 365 groups
97
+ - `teams.js`-sdk for teams
98
+ - `dataverse.js`-sdk for dataverse
99
+ - `jira.js`-sdk for jira
100
+ - `keyvalue.js`-sdk for keyvault
101
+ - `power-apps-data.js`-sdk for power apps
102
+ - `power-config.json`-config file for when publishing to environment, this is not in the dist directory
103
+ - `codeapp.js` is the helper pre-built library — NEVER modify it. Import its functions into `index.js` when needed.
104
+
105
+
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: connections
3
+ description: "Use when: wiring connector-backed Power Apps Code Apps, validating connectionReferences or dataSources names, or debugging handwritten connector wrappers. Load alongside connector-specific skills."
4
+ ---
5
+
6
+ # Connections Guide
7
+
8
+ Use this skill for the shared rules that apply across the handwritten connector helpers in `dev files/`.
9
+
10
+ ## Core Rules
11
+
12
+ All authentication is handled by the Power Apps runtime and the connector client.
13
+
14
+ Do:
15
+ - Keep connector calls inside the wrapper helper for that connector.
16
+ - Reuse the repo's helper patterns such as `unwrapResult` and the candidate data-source retry logic in `codeapp-helper.js`.
17
+ - Treat the helper file as the repo-local source of truth for public function names, default versions, and parameter mapping.
18
+ - Validate `power.config.json` `dataSources` names against the wrapper before changing them.
19
+
20
+ Don't:
21
+ - Don't add MSAL, custom token acquisition, or manual `Authorization` headers.
22
+ - Don't call Dataverse or Microsoft Graph directly when the repo already exposes a connector helper.
23
+ - Don't invent connector operation paths, header names, or parameter names.
24
+ - Don't assume every connector uses the same raw HTTP helper shape.
25
+
26
+ ## Wrapper Patterns
27
+
28
+ - `codeapp-helper.js` exposes `execConnectorOpWithCandidates(...)` for wrappers that must retry multiple `dataSources` names.
29
+ - Some wrappers use exact inline `apis` metadata (`outlook.js`, `office365users.js`, `Teams.js`, `Jira.js`, `AzureKeyvault.js`).
30
+ - Some wrappers intentionally rely on runtime-resolved connector operations and focus on stable public helper names (`office365groups.js`).
31
+ - Prefer the existing wrapper over rebuilding a connector client from scratch unless the wrapper is missing the operation entirely.
32
+
33
+ ## Raw HTTP Helpers
34
+
35
+ The raw HTTP helper signatures are not interchangeable.
36
+
37
+ - Outlook, Office 365 Users, and Office 365 Groups map friendly inputs to connector fields like `Uri`, `Method`, `Body`, `ContentType`, and `CustomHeader1..5`.
38
+ - SharePoint and Teams currently pass `method`, `uri`, `headers`, and `body` directly.
39
+
40
+ Check the specific wrapper before copying a raw-request pattern between connectors.
41
+
42
+ ## Review Checklist
43
+
44
+ - Keep `tableName` aligned with the wrapper's supported `dataSources` names.
45
+ - Preserve existing public helper names and widen inputs with options objects instead of breaking positional calls.
46
+ - Normalize SDK envelopes before returning data to app code.
47
+ - Prefer repo helpers over direct network code when a connector wrapper already exists.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: dataverse
3
+ description: "Use when: building or debugging Dataverse CRUD in a Power Apps Code App, registering tables with initDataSources or registerTable, calling callUnboundAction, or using whoAmI and Dataverse-backed environment variables."
4
+ ---
5
+
6
+ # Dataverse Guide
7
+
8
+ > Prerequisite: load the `connections` skill for the shared auth and wrapper rules.
9
+
10
+ ## power.config.json
11
+
12
+ For the helper in `dev files/codeapp-helper.js`, Dataverse CRUD depends on `databaseReferences.default.cds.dataSources`.
13
+
14
+ ```json
15
+ {
16
+ "databaseReferences": {
17
+ "default.cds": {
18
+ "dataSources": {
19
+ "accounts": {
20
+ "entitySetName": "accounts",
21
+ "logicalName": "account",
22
+ "isHidden": false
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ - `entitySetName` is the plural OData collection name.
31
+ - `logicalName` is the singular logical name.
32
+ - Every Dataverse table used by the app must be present here.
33
+ - Do not add unbound actions like `WhoAmI` or `GrantAccess` to `dataSources`.
34
+
35
+ The helper does not require a separate Dataverse `connectionReferences` entry for CRUD or `callUnboundAction`.
36
+
37
+ ## Table Registration
38
+
39
+ The helper supports both `initDataSources(...)` and `registerTable(...)`.
40
+
41
+ Use `initDataSources(...)` before the first Dataverse call when you know the full table set up front.
42
+
43
+ ```js
44
+ import { initDataSources } from './codeapp.js';
45
+
46
+ function dsEntry(sPrimaryKey) {
47
+ return { tableId: '', version: '', primaryKey: sPrimaryKey, dataSourceType: 'Dataverse', apis: {} };
48
+ }
49
+
50
+ initDataSources({
51
+ accounts: dsEntry('accountid'),
52
+ contacts: dsEntry('contactid')
53
+ });
54
+ ```
55
+
56
+ Use `registerTable(tableName, primaryKey)` only when you need to add a table at runtime. It resets the cached client.
57
+
58
+ ## CRUD Surface
59
+
60
+ `codeapp-helper.js` exports:
61
+
62
+ - `createItem(tableName, primaryKey, record)`
63
+ - `getItem(tableName, primaryKey, id, select)`
64
+ - `listItems(tableName, primaryKey, options)`
65
+ - `updateItem(tableName, primaryKey, id, changedFields)`
66
+ - `deleteItem(tableName, primaryKey, id)`
67
+
68
+ Notes:
69
+
70
+ - `listItems(...)` returns `{ entities: [...] }`.
71
+ - `select` and `orderBy` accept arrays or comma-separated strings.
72
+ - `whoAmI()` reads the Power Apps context with `getContext()`; it does not call a Dataverse action.
73
+
74
+ ## Unbound Actions
75
+
76
+ `callUnboundAction(tableName, primaryKey, actionName, params)` uses `callActionAsync(...)` under the hood.
77
+
78
+ - It requires at least one real Dataverse table to be registered so the helper can resolve the environment.
79
+ - Do not add action names to `power.config.json`.
80
+ - Standard Dataverse actions still need correct complex parameter payloads such as `@odata.type` annotations.
81
+
82
+ ## Environment Variables
83
+
84
+ `getEnvironmentVariable(schemaName)` is part of the same helper file.
85
+
86
+ - Add `environmentvariabledefinitions` and `environmentvariablevalues` to `databaseReferences.default.cds.dataSources`.
87
+ - Include those tables in `initDataSources(...)` or register them before the first read.
88
+
89
+ ## Relationship Tips
90
+
91
+ - Write lookups with `'<navProperty>@odata.bind': '/<entitySet>(<guid>)'`.
92
+ - Read lookup IDs with the `_<name>_value` pattern.
93
+
94
+ ## Common Failures
95
+
96
+ - `DataSourceNotFound`: the table is missing from `power.config.json`, `initDataSources(...)`, or runtime registration.
97
+ - `Invalid property 'xyz'`: the column name is wrong.
98
+ - `Entity 'xyz' does not exist`: the entity set name is wrong.
99
+ - Single-record retrieve can fail for some tables such as `entities`; use `listItems(...)` with a filter instead.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: environment-variables
3
+ description: "Use when: wiring Dataverse environment variables into a Power Apps Code App, asking for schema names, updating power.config.json table references, or reading values with getEnvironmentVariable from codeapp.js."
4
+ ---
5
+
6
+ # Environment Variables Guide
7
+
8
+ > Agent limitation: do not create maker-portal environment variables from chat. The user creates them; the app only reads them.
9
+
10
+ ## Workflow
11
+
12
+ 1. Ask the user for the exact schema names that already exist in the maker portal.
13
+ 2. Read `power.config.json` before editing it.
14
+ 3. Add the two Dataverse tables used by environment variables.
15
+ 4. Wire `getEnvironmentVariable(...)` into the app startup code.
16
+
17
+ ## power.config.json
18
+
19
+ Add both tables under `databaseReferences.default.cds.dataSources`.
20
+
21
+ ```json
22
+ {
23
+ "databaseReferences": {
24
+ "default.cds": {
25
+ "dataSources": {
26
+ "environmentvariabledefinitions": {
27
+ "entitySetName": "environmentvariabledefinitions",
28
+ "logicalName": "environmentvariabledefinition",
29
+ "isHidden": false
30
+ },
31
+ "environmentvariablevalues": {
32
+ "entitySetName": "environmentvariablevalues",
33
+ "logicalName": "environmentvariablevalue",
34
+ "isHidden": false
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ Do not add a custom `environmentVariables` key to `power.config.json`.
43
+
44
+ ## Helper Surface
45
+
46
+ The repo reads environment variables through `getEnvironmentVariable(...)` in `codeapp.js` / `codeapp-helper.js`.
47
+
48
+ There is no separate `environmentVar.js` helper in `dev files/`.
49
+
50
+ If the app already uses `initDataSources(...)`, add both environment-variable tables there.
51
+
52
+ ```js
53
+ import { initDataSources, getEnvironmentVariable } from './codeapp.js';
54
+
55
+ function dsEntry(sPrimaryKey) {
56
+ return { tableId: '', version: '', primaryKey: sPrimaryKey, dataSourceType: 'Dataverse', apis: {} };
57
+ }
58
+
59
+ initDataSources({
60
+ environmentvariabledefinitions: dsEntry('environmentvariabledefinitionid'),
61
+ environmentvariablevalues: dsEntry('environmentvariablevalueid')
62
+ });
63
+ ```
64
+
65
+ If the app does not use `initDataSources(...)`, register both tables before the first `getEnvironmentVariable(...)` call.
66
+
67
+ ## Value Formats
68
+
69
+ - Text, number, and boolean variables come back as strings.
70
+ - Data Source variables come back as JSON strings and must be parsed.
71
+
72
+ ```js
73
+ const sSiteJson = await getEnvironmentVariable('wd_sharepointsite');
74
+ const oSite = JSON.parse(sSiteJson);
75
+ const sSiteUrl = oSite.SiteUrl;
76
+ ```
77
+
78
+ ## Summary Rules
79
+
80
+ - Ask for schema names; do not invent them.
81
+ - Keep the env-var tables in the same Dataverse table setup as the rest of the app.
82
+ - Import `getEnvironmentVariable(...)` from `./codeapp.js`.
83
+ - Parse Data Source values before using them.
84
+
85
+ ## Common Failures
86
+
87
+ - `Data source not found ... environmentvariabledefinitions`: the two Dataverse tables are missing from `power.config.json` or the helper registration.
88
+ - `Environment variable not found: xyz`: the schema name is wrong or missing in Dataverse.
89
+ - Empty string: neither a current value nor a default value exists.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: frontend-design
3
+ description: "Use when: designing or restyling pages, components, mockups, dashboards, or app UIs in this repo. Favor distinctive frontend work over generic defaults."
4
+ ---
5
+
6
+ # Frontend Design Guide
7
+
8
+ Use this skill to keep UI work intentional, distinctive, and production-grade.
9
+
10
+ ## Design Thinking
11
+
12
+ Before coding:
13
+
14
+ - Understand the purpose, audience, and constraints.
15
+ - Commit to a clear aesthetic direction instead of blending safe defaults.
16
+ - Treat the existing workspace configuration and loaded skills as the source of truth for stack and app constraints.
17
+ - Default to plain HTML, CSS, and JS when the repo does not require a framework.
18
+
19
+ ## Aesthetic Rules
20
+
21
+ - Choose fonts with character. Avoid default system-looking results.
22
+ - Use a deliberate palette with clear hierarchy and CSS variables.
23
+ - Build atmosphere with gradients, textures, overlays, or shape systems instead of flat backgrounds.
24
+ - Use motion for a few strong moments rather than generic micro-animations everywhere.
25
+ - Make layouts feel designed, not template-generated.
26
+
27
+ ## Avoid
28
+
29
+ - Generic AI-looking typography and spacing.
30
+ - Purple-on-white gradient defaults.
31
+ - Cookie-cutter cards and dashboards with no point of view.
32
+ - Asking the user to pick a framework when the repo already implies one.
33
+
34
+ Push for work that feels specific to the app instead of interchangeable.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: jira
3
+ description: "Use when: building or debugging Jira connector flows in a Power Apps Code App, including jiraInstance-aware helpers, issue or project operations, task operations, or Jira MCP actions."
4
+ ---
5
+
6
+ # Jira Connector Guide
7
+
8
+ > Agent limitation: do not use CLI commands directly from chat for Jira setup. Use the built-in Sync Connections and Deploy buttons instead.
9
+
10
+ ## Core Rule
11
+
12
+ The wrapper in `dev files/jira.js` is the repo-local source of truth for public helper names and defaults.
13
+
14
+ - It retries the data-source names `jira`, `Jira`, and `JIRA`.
15
+ - It includes inline connector metadata for the operations the wrapper supports.
16
+ - Many helpers switch between non-instance and instance-aware variants depending on whether `jiraInstance` is supplied.
17
+
18
+ ## power.config.json
19
+
20
+ Prefer a Jira connection reference whose `dataSources` array includes `jira`.
21
+
22
+ ```json
23
+ {
24
+ "connectionReferences": {
25
+ "jiraConnection": {
26
+ "id": "/providers/Microsoft.PowerApps/apis/shared_jira",
27
+ "displayName": "Jira",
28
+ "dataSources": ["jira"],
29
+ "authenticationType": "APIToken",
30
+ "dataSets": {}
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ## Public Helper Surface
37
+
38
+ `Jira.js` exports stable helpers such as:
39
+
40
+ - `listJiraIssues(...)`
41
+ - `getJiraIssueByKey(...)`
42
+ - `addJiraComment(...)`
43
+ - `createJiraIssue(...)`
44
+ - `createJiraIssueV3(...)`
45
+ - `editJiraIssue(...)`
46
+ - `updateJiraIssue(...)`
47
+ - `listJiraProjects(...)`
48
+ - `createJiraProject(...)`
49
+ - `updateJiraProject(...)`
50
+ - `deleteJiraProject(...)`
51
+ - `getJiraTask(...)`
52
+ - `cancelJiraTask(...)`
53
+ - `getCurrentJiraUser(...)`
54
+ - `getJiraUser(...)`
55
+ - `listJiraIssueTypes(...)`
56
+ - `listJiraStatuses(...)`
57
+ - `manageJiraIssues(queryRequest, sessionId)`
58
+
59
+ ## Important Wrapper Behavior
60
+
61
+ - Passing `jiraInstance` makes the wrapper inject `X-Request-Jirainstance` and choose the instance-aware operation when one exists.
62
+ - `cancelJiraTask(...)` sends `X-Atlassian-Token` and defaults it to `nocheck` when no token is provided.
63
+ - `listJiraProjects(...)` uses `ListProjects_V2` without an instance and `ListProjects_V3` with an instance.
64
+ - `createJiraIssue(...)` chooses between `CreateIssue`, `CreateIssueV2`, and `CreateIssue_V3` based on the provided options.
65
+
66
+ ## Raw Operation Notes
67
+
68
+ If you need a raw connector call, use `callJiraOperation(operationName, parameters)` and preserve the exact connector field names.
69
+
70
+ Do not guess:
71
+
72
+ - operation names
73
+ - path shapes
74
+ - Jira instance header names
75
+ - query field names like `issueTypeIds`, `notifyUsers`, or `overrideEditableFlag`
76
+
77
+ ## Debugging
78
+
79
+ - If the failure mentions missing `path`, the inline metadata is incomplete or the wrong operation name is being used.
80
+ - If the failure mentions Jira instance validation, check whether the helper expects `jiraInstance` and whether the wrapper selected the correct variant.
81
+ - Use generated schema or service files only as supporting references; the repo wrapper controls the public API used by apps in this repo.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: office365-groups
3
+ description: "Use when: building or debugging Office 365 Groups connector flows in a Power Apps Code App, including group listing, membership, events, or openGroupsHttpRequest."
4
+ ---
5
+
6
+ # Office 365 Groups Connector Guide
7
+
8
+ > Agent limitation: do not use CLI commands directly from chat for Office 365 Groups setup. Use the built-in Sync Connections and Deploy buttons instead.
9
+
10
+ ## Core Rule
11
+
12
+ The wrapper in `dev files/office365groups.js` is the repo-local source of truth.
13
+
14
+ - It retries both `office365groups` and `Office365Groups`.
15
+ - It keeps the public helper surface stable even though the raw connector operations are runtime-resolved.
16
+ - Do not replace it with made-up placeholder paths copied from generic examples.
17
+
18
+ ## power.config.json
19
+
20
+ Prefer a connection reference whose `dataSources` array includes `office365groups`.
21
+
22
+ Older apps may still use `Office365Groups`; the wrapper retries both.
23
+
24
+ ## Public Helper Surface
25
+
26
+ The wrapper exports:
27
+
28
+ - `listMyGroups(options)`
29
+ - `listOwnedGroups(options)`
30
+ - `listGroups(options)`
31
+ - `listGroupMembers(groupId, options)`
32
+ - `onGroupMembershipChange(groupId, options)`
33
+ - `addMemberToGroup(userUpn, groupId)`
34
+ - `removeMemberFromGroup(userUpn, groupId)`
35
+ - `createGroupEvent(groupId, options)`
36
+ - `updateGroupEvent(eventId, options, groupId)`
37
+ - `deleteGroupEvent(eventId, groupId)`
38
+ - `onNewGroupEvent(groupId)`
39
+ - `listDeletedGroups()`
40
+ - `restoreDeletedGroup(groupId)`
41
+ - `listDeletedGroupsByOwner(userId)`
42
+ - `openGroupsHttpRequest(options)`
43
+
44
+ ## Important Wrapper Behavior
45
+
46
+ - `listMyGroups({ version: 1|2|3 })` switches between `ListOwnedGroups`, `ListOwnedGroups_V2`, and `ListOwnedGroups_V3`.
47
+ - `listGroups(...)` supports `$filter`, `$top`, `skipToken`, `nextLink`, and compatibility aliases like `skip`.
48
+ - Event helpers accept flexible options objects and normalize event payloads for the connector.
49
+ - `openGroupsHttpRequest(...)` maps friendly inputs to connector fields like `Uri`, `Method`, `Body`, `ContentType`, and `CustomHeader1..5`.
50
+ - `openGroupsHttpRequest(...)` can target `HttpRequest` or `HttpRequestV2` with `version` or `useV2`.
51
+
52
+ ## Raw Calls
53
+
54
+ Use `callGroupsOperation(operationName, parameters)` only when a high-level helper does not exist.
55
+
56
+ Do not bypass the wrapper with direct Graph calls for operations already covered by the connector.
57
+
58
+ ## Debugging
59
+
60
+ - If the failure is `Connection reference not found`, confirm the app exposes either `office365groups` or `Office365Groups` in `power.config.json`.
61
+ - If an HTTP request fails, verify the wrapper is sending connector-style fields rather than raw fetch-style headers.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: office365-outlook
3
+ description: "Use when: building or debugging Outlook connector flows in a Power Apps Code App, including mail, calendar, contacts, rooms, mailbox settings, or the repo Outlook helpers."
4
+ ---
5
+
6
+ # Office 365 Outlook Connector Guide
7
+
8
+ > Agent limitation: do not use CLI commands directly from chat for Outlook setup. Use the built-in Sync Connections and Deploy buttons instead.
9
+
10
+ ## Core Rule
11
+
12
+ The wrapper in `dev files/outlook.js` is the repo-local source of truth, and `dev files/outlook-helper-reference.md` documents its accepted aliases.
13
+
14
+ - It retries `office365outlook`, `Office365Outlook`, and `office365`.
15
+ - It includes inline metadata for the operations the wrapper exposes.
16
+ - Many helpers choose the operation version automatically.
17
+
18
+ Prefer `office365` in `power.config.json`, while keeping the wrapper's candidate names intact.
19
+
20
+ ## Public Helper Surface
21
+
22
+ The wrapper exports helpers for:
23
+
24
+ - Mail: `sendEmail`, `listEmails`, `getEmail`, `forwardEmail`, `replyToEmail`, `moveEmail`, `deleteEmail`, `draftEmail`, `updateDraftEmail`, `sendDraftEmail`, `markEmailAsRead`, `updateEmailFlag`, `getEmailAttachment`, `assignOutlookCategory`, `assignOutlookCategoryBulk`
25
+ - Shared mailbox: `sendFromSharedMailbox`
26
+ - Calendar: `createEvent`, `listEvents`, `editEvent`, `deleteEvent`, `listCalendars`, `getEvent`, `getCalendarView`, `respondToEventInvite`, `findMeetingTimes`, `listRoomLists`, `listRooms`, `listRoomsInRoomList`, `setAutomaticReplies`, `getMailTips`
27
+ - Contacts: `listContactFolders`, `listContacts`, `getContact`, `createContact`, `updateContact`, `deleteContact`
28
+ - Advanced: `callOutlookOperation`, `callOutlookHttpRequest`, `manageOutlookEmails`, `manageOutlookMeetings`, `manageOutlookContacts`
29
+
30
+ ## Important Wrapper Defaults
31
+
32
+ - `sendEmail(...)` uses `SendEmailV2` unless `isHtml === false`, in which case it uses the legacy plain-text action.
33
+ - `listEmails(...)` defaults to version 3, folder `Inbox`, and `top: 10`.
34
+ - `replyToEmail(...)` uses `ReplyToV3` unless `isHtml === false`.
35
+ - `getEmail(...)` defaults to the V2 action.
36
+ - `createEvent(...)`, `listEvents(...)`, and `editEvent(...)` use the V4 calendar actions.
37
+ - `markEmailAsRead(...)` uses the V3 action unless the caller explicitly requests the older legacy pattern.
38
+
39
+ ## Raw HTTP Calls
40
+
41
+ `callOutlookHttpRequest(...)` expects the connector-style field mapping used by the wrapper.
42
+
43
+ - Pass `uri`, `method`, `body`, `contentType`, and `customHeaders`.
44
+ - The wrapper maps them to `Uri`, `Method`, `Body`, `ContentType`, and `CustomHeader1..5`.
45
+
46
+ Do not reuse the SharePoint or Teams raw HTTP pattern here.
47
+
48
+ ## Debugging
49
+
50
+ - If the failure mentions `Connection reference not found`, verify `power.config.json` exposes one of the wrapper's candidate data-source names.
51
+ - If a versioned mail or calendar call behaves unexpectedly, check the wrapper default before changing the raw operation name.
52
+ - For alias-heavy helpers, consult `dev files/outlook-helper-reference.md` before adding new parameter mapping logic.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: office365-users
3
+ description: "Use when: building or debugging Office 365 Users connector flows in a Power Apps Code App, including profiles, managers, direct reports, photos, searchForUsers, or openUsersHttpRequest."
4
+ ---
5
+
6
+ # Office 365 Users Connector Guide
7
+
8
+ > Agent limitation: do not use CLI commands directly from chat for Office 365 Users setup. Use the built-in Sync Connections and Deploy buttons instead.
9
+
10
+ ## Core Rule
11
+
12
+ The wrapper in `dev files/office365users.js` is the repo-local source of truth.
13
+
14
+ - It uses `office365users` as the connector data-source name.
15
+ - It includes inline metadata for the supported operations.
16
+ - It preserves older naming compatibility, but the main search operation used by the wrapper is `SearchUserV2`.
17
+
18
+ ## power.config.json
19
+
20
+ Expose `office365users` in the connection reference `dataSources` array.
21
+
22
+ ```json
23
+ {
24
+ "connectionReferences": {
25
+ "usersConnection": {
26
+ "id": "/providers/Microsoft.PowerApps/apis/shared_office365users",
27
+ "displayName": "Office 365 Users",
28
+ "dataSources": ["office365users"],
29
+ "dataSets": {}
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Public Helper Surface
36
+
37
+ The wrapper exports:
38
+
39
+ - `getMyProfile(options)`
40
+ - `getUserProfile(userId, options)`
41
+ - `getManager(userId, options)`
42
+ - `getDirectReports(userId, options)`
43
+ - `getMyTrendingDocuments(options)`
44
+ - `getTrendingDocuments(userId, options)`
45
+ - `getRelevantPeople(userId)`
46
+ - `updateMyProfile(profile)`
47
+ - `updateMyPhoto(bodyOrOptions, contentType)`
48
+ - `getUserPhotoMetadata(userId)`
49
+ - `getUserPhoto(userId)`
50
+ - `searchForUsers(options)`
51
+ - `openUsersHttpRequest(options)`
52
+ - `callUsersOperation(operationName, parameters)`
53
+
54
+ ## Important Wrapper Behavior
55
+
56
+ - `select` can be an array or a comma-separated string.
57
+ - `getDirectReports(...)` supports `top` and select options.
58
+ - `searchForUsers(...)` uses `searchTerm`, `top`, `isSearchTermRequired`, and `skipToken`.
59
+ - `searchForUsers(...)` accepts `nextLink` and legacy `skip` as compatibility inputs that the wrapper converts into `skipToken`.
60
+ - `UserPhoto_V2` returns `image/jpeg`.
61
+
62
+ ## Raw HTTP Calls
63
+
64
+ `openUsersHttpRequest(...)` does not use the simple `headers` object shape directly.
65
+
66
+ The wrapper maps friendly inputs into connector fields:
67
+
68
+ - `Uri`
69
+ - `Method`
70
+ - `Body`
71
+ - `ContentType`
72
+ - `CustomHeader1..5`
73
+
74
+ ## Debugging
75
+
76
+ - If search pagination is broken, verify the code is passing `skipToken` or `nextLink`, not `$skip`.
77
+ - If HTTP requests fail, check whether the wrapper is being fed connector-style fields through `openUsersHttpRequest(...)` rather than raw fetch options.
78
+ - Keep the existing helper names stable and widen input support instead of replacing them.