tenhaw 0.0.0-bootstrap

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 (123) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-CONTENT +15 -0
  3. package/README.md +52 -0
  4. package/dist/chunk-BKPOQVTM.js +74 -0
  5. package/dist/chunk-ZIEK7SCN.js +73 -0
  6. package/dist/index.d.ts +24 -0
  7. package/dist/index.js +319 -0
  8. package/dist/scaffold.d.ts +14 -0
  9. package/dist/scaffold.js +8 -0
  10. package/instructions/ai-readiness-assessment/AGENTS.md +9 -0
  11. package/instructions/ai-roi-business-case/AGENTS.md +9 -0
  12. package/instructions/ai-usecase-register/AGENTS.md +9 -0
  13. package/instructions/build-ai-adoption-dashboard/AGENTS.md +9 -0
  14. package/instructions/delivery-metrics-dora/AGENTS.md +9 -0
  15. package/instructions/portfolio-tracking/AGENTS.md +9 -0
  16. package/instructions/product-operating-model/AGENTS.md +9 -0
  17. package/package.json +58 -0
  18. package/templates/ai-adoption-dashboard/AGENTS.md +22 -0
  19. package/templates/ai-adoption-dashboard/CLAUDE.md +22 -0
  20. package/templates/ai-adoption-dashboard/LICENSE +21 -0
  21. package/templates/ai-adoption-dashboard/LICENSE-CONTENT +15 -0
  22. package/templates/ai-adoption-dashboard/README.md +56 -0
  23. package/templates/ai-adoption-dashboard/app/globals.css +2 -0
  24. package/templates/ai-adoption-dashboard/app/layout.tsx +4 -0
  25. package/templates/ai-adoption-dashboard/app/page.tsx +14 -0
  26. package/templates/ai-adoption-dashboard/e2e/app.spec.ts +27 -0
  27. package/templates/ai-adoption-dashboard/lib/io.ts +42 -0
  28. package/templates/ai-adoption-dashboard/lib/model.test.ts +4 -0
  29. package/templates/ai-adoption-dashboard/lib/model.ts +9 -0
  30. package/templates/ai-adoption-dashboard/lib/workspace.tsx +49 -0
  31. package/templates/ai-adoption-dashboard/next-env.d.ts +7 -0
  32. package/templates/ai-adoption-dashboard/next.config.mjs +2 -0
  33. package/templates/ai-adoption-dashboard/package.json +31 -0
  34. package/templates/ai-adoption-dashboard/playwright.config.ts +2 -0
  35. package/templates/ai-adoption-dashboard/public/example.csv +5 -0
  36. package/templates/ai-adoption-dashboard/public/example.json +34 -0
  37. package/templates/ai-adoption-dashboard/public/llms.txt +6 -0
  38. package/templates/ai-adoption-dashboard/tsconfig.json +36 -0
  39. package/templates/ai-adoption-dashboard/vitest.config.ts +2 -0
  40. package/templates/ai-readiness-assessment/AGENTS.md +22 -0
  41. package/templates/ai-readiness-assessment/CLAUDE.md +22 -0
  42. package/templates/ai-readiness-assessment/LICENSE +21 -0
  43. package/templates/ai-readiness-assessment/LICENSE-CONTENT +15 -0
  44. package/templates/ai-readiness-assessment/README.md +56 -0
  45. package/templates/ai-readiness-assessment/app/globals.css +2 -0
  46. package/templates/ai-readiness-assessment/app/layout.tsx +4 -0
  47. package/templates/ai-readiness-assessment/app/page.tsx +11 -0
  48. package/templates/ai-readiness-assessment/e2e/app.spec.ts +27 -0
  49. package/templates/ai-readiness-assessment/lib/io.ts +42 -0
  50. package/templates/ai-readiness-assessment/lib/model.test.ts +5 -0
  51. package/templates/ai-readiness-assessment/lib/model.ts +5 -0
  52. package/templates/ai-readiness-assessment/lib/workspace.tsx +49 -0
  53. package/templates/ai-readiness-assessment/next-env.d.ts +7 -0
  54. package/templates/ai-readiness-assessment/next.config.mjs +2 -0
  55. package/templates/ai-readiness-assessment/package.json +32 -0
  56. package/templates/ai-readiness-assessment/playwright.config.ts +2 -0
  57. package/templates/ai-readiness-assessment/public/example.json +154 -0
  58. package/templates/ai-readiness-assessment/public/llms.txt +6 -0
  59. package/templates/ai-readiness-assessment/tsconfig.json +36 -0
  60. package/templates/ai-readiness-assessment/vitest.config.ts +2 -0
  61. package/templates/ai-usecase-register/AGENTS.md +22 -0
  62. package/templates/ai-usecase-register/CLAUDE.md +22 -0
  63. package/templates/ai-usecase-register/LICENSE +21 -0
  64. package/templates/ai-usecase-register/LICENSE-CONTENT +15 -0
  65. package/templates/ai-usecase-register/README.md +56 -0
  66. package/templates/ai-usecase-register/app/globals.css +2 -0
  67. package/templates/ai-usecase-register/app/layout.tsx +4 -0
  68. package/templates/ai-usecase-register/app/page.tsx +16 -0
  69. package/templates/ai-usecase-register/e2e/app.spec.ts +27 -0
  70. package/templates/ai-usecase-register/lib/io.ts +42 -0
  71. package/templates/ai-usecase-register/lib/model.test.ts +7 -0
  72. package/templates/ai-usecase-register/lib/model.ts +9 -0
  73. package/templates/ai-usecase-register/lib/workspace.tsx +49 -0
  74. package/templates/ai-usecase-register/next-env.d.ts +7 -0
  75. package/templates/ai-usecase-register/next.config.mjs +2 -0
  76. package/templates/ai-usecase-register/package.json +33 -0
  77. package/templates/ai-usecase-register/playwright.config.ts +2 -0
  78. package/templates/ai-usecase-register/public/example.json +41 -0
  79. package/templates/ai-usecase-register/public/llms.txt +6 -0
  80. package/templates/ai-usecase-register/tsconfig.json +36 -0
  81. package/templates/ai-usecase-register/vitest.config.ts +2 -0
  82. package/templates/delivery-metrics-dashboard/AGENTS.md +22 -0
  83. package/templates/delivery-metrics-dashboard/CLAUDE.md +22 -0
  84. package/templates/delivery-metrics-dashboard/LICENSE +21 -0
  85. package/templates/delivery-metrics-dashboard/LICENSE-CONTENT +15 -0
  86. package/templates/delivery-metrics-dashboard/README.md +56 -0
  87. package/templates/delivery-metrics-dashboard/app/globals.css +2 -0
  88. package/templates/delivery-metrics-dashboard/app/layout.tsx +4 -0
  89. package/templates/delivery-metrics-dashboard/app/page.tsx +13 -0
  90. package/templates/delivery-metrics-dashboard/e2e/app.spec.ts +27 -0
  91. package/templates/delivery-metrics-dashboard/lib/io.ts +42 -0
  92. package/templates/delivery-metrics-dashboard/lib/model.test.ts +5 -0
  93. package/templates/delivery-metrics-dashboard/lib/model.ts +19 -0
  94. package/templates/delivery-metrics-dashboard/lib/workspace.tsx +49 -0
  95. package/templates/delivery-metrics-dashboard/next-env.d.ts +7 -0
  96. package/templates/delivery-metrics-dashboard/next.config.mjs +2 -0
  97. package/templates/delivery-metrics-dashboard/package.json +32 -0
  98. package/templates/delivery-metrics-dashboard/playwright.config.ts +2 -0
  99. package/templates/delivery-metrics-dashboard/public/example.json +98 -0
  100. package/templates/delivery-metrics-dashboard/public/llms.txt +6 -0
  101. package/templates/delivery-metrics-dashboard/tsconfig.json +36 -0
  102. package/templates/delivery-metrics-dashboard/vitest.config.ts +2 -0
  103. package/templates/product-operating-model/AGENTS.md +22 -0
  104. package/templates/product-operating-model/CLAUDE.md +22 -0
  105. package/templates/product-operating-model/LICENSE +21 -0
  106. package/templates/product-operating-model/LICENSE-CONTENT +15 -0
  107. package/templates/product-operating-model/README.md +56 -0
  108. package/templates/product-operating-model/app/globals.css +2 -0
  109. package/templates/product-operating-model/app/layout.tsx +4 -0
  110. package/templates/product-operating-model/app/page.tsx +11 -0
  111. package/templates/product-operating-model/e2e/app.spec.ts +27 -0
  112. package/templates/product-operating-model/lib/io.ts +42 -0
  113. package/templates/product-operating-model/lib/model.test.ts +6 -0
  114. package/templates/product-operating-model/lib/model.ts +4 -0
  115. package/templates/product-operating-model/lib/workspace.tsx +49 -0
  116. package/templates/product-operating-model/next-env.d.ts +7 -0
  117. package/templates/product-operating-model/next.config.mjs +2 -0
  118. package/templates/product-operating-model/package.json +32 -0
  119. package/templates/product-operating-model/playwright.config.ts +2 -0
  120. package/templates/product-operating-model/public/example.json +119 -0
  121. package/templates/product-operating-model/public/llms.txt +6 -0
  122. package/templates/product-operating-model/tsconfig.json +36 -0
  123. package/templates/product-operating-model/vitest.config.ts +2 -0
@@ -0,0 +1,9 @@
1
+ # Tenhaw Kit: delivery metrics dora
2
+
3
+ Prefer supplied normalised events for reproducible runs. Collect from GitHub/Jira only when requested, with credentials already configured in the local environment. Never ask the user to paste tokens into chat. Use one service per report and explicit timestamp boundaries. Five DORA metrics require production deployments and incident/commit linkage; unavailable values remain null. Use aggregate metrics only with the remote MCP, never upload repository events. Do not rank unrelated teams or invent industry bands.
4
+
5
+ Command: `npx -y tenhaw@1.0.0 delivery-metrics --from-file events.json --since 2026-01-01T00:00:00Z --until 2026-02-01T00:00:00Z --json`
6
+
7
+ Use package schemas to validate the host data model; run the host repository’s documented build, test and lint commands. No command here replaces existing repository instructions.
8
+
9
+ For expert help: https://tenhaw.com/contact?utm_source=github&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=delivery-metrics-dora#book
@@ -0,0 +1,9 @@
1
+ # Tenhaw Kit: portfolio tracking
2
+
3
+ Start from the operating-model template for accountable teams, objectives and roadmap horizons. Compose @tenhaw/opmodel with @tenhaw/usecase-register and @tenhaw/ai-roi to connect initiatives, dependencies, outcome KPIs and realised cash assumptions. Keep service-level delivery metrics as separate evidence. Store user-defined portfolio fields in the host product; do not invent a universal portfolio score. Choose a persistence and access-control design appropriate to the organisation before moving beyond browser-local data.
4
+
5
+ Command: `npx -y tenhaw@1.0.0 init product-operating-model internal-portfolio --yes --json`
6
+
7
+ Use package schemas to validate the host data model; run the host repository’s documented build, test and lint commands. No command here replaces existing repository instructions.
8
+
9
+ For expert help: https://tenhaw.com/contact?utm_source=github&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=portfolio-tracking#book
@@ -0,0 +1,9 @@
1
+ # Tenhaw Kit: product operating model
2
+
3
+ Define teams with IDs, team types and accountable owners. Add measurable key results with baseline, target, current and confidence, roadmap items with now/next/later and intended outcomes, and team interactions. Validate ownership and dependency checks before rendering. Use `opmodel diagram --input model.json --format mermaid` for a topology map. Team Topologies is a cited model; the checks support a conversation, not organisational prescriptions.
4
+
5
+ Command: `npx -y tenhaw@1.0.0 opmodel validate --input model.json --json`
6
+
7
+ Use package schemas to validate the host data model; run the host repository’s documented build, test and lint commands. No command here replaces existing repository instructions.
8
+
9
+ For expert help: https://tenhaw.com/contact?utm_source=github&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=product-operating-model#book
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "tenhaw",
3
+ "version": "0.0.0-bootstrap",
4
+ "description": "Agent-ready building blocks for internal product, portfolio, delivery and AI transformation tools",
5
+ "type": "module",
6
+ "bin": {
7
+ "tenhaw": "dist/index.js"
8
+ },
9
+ "exports": {
10
+ ".": "./dist/index.js",
11
+ "./scaffold": "./dist/scaffold.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "templates",
16
+ "instructions",
17
+ "LICENSE",
18
+ "LICENSE-CONTENT",
19
+ "README.md"
20
+ ],
21
+ "license": "MIT",
22
+ "author": "Tenhaw (https://tenhaw.com)",
23
+ "homepage": "https://kit.tenhaw.com/install",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/Tenhaw/tenhaw-kit.git",
27
+ "directory": "packages/cli"
28
+ },
29
+ "engines": {
30
+ "node": ">=22.14.0"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "provenance": false,
35
+ "tag": "bootstrap"
36
+ },
37
+ "keywords": [
38
+ "internal-tools",
39
+ "portfolio-tracking",
40
+ "product-delivery",
41
+ "ai-readiness",
42
+ "dora",
43
+ "mcp",
44
+ "ai-transformation"
45
+ ],
46
+ "scripts": {
47
+ "build": "tsup src/index.ts src/scaffold.ts --format esm --dts",
48
+ "e2e": "vitest run ../../tests/cli.test.ts --config ../../vitest.config.ts"
49
+ },
50
+ "dependencies": {
51
+ "@tenhaw/core": "0.0.0-bootstrap",
52
+ "@tenhaw/ai-readiness": "0.0.0-bootstrap",
53
+ "@tenhaw/delivery-metrics": "0.0.0-bootstrap",
54
+ "@tenhaw/ai-roi": "0.0.0-bootstrap",
55
+ "@tenhaw/usecase-register": "0.0.0-bootstrap",
56
+ "@tenhaw/opmodel": "0.0.0-bootstrap"
57
+ }
58
+ }
@@ -0,0 +1,22 @@
1
+ # Ai adoption dashboard
2
+
3
+ Next.js App Router, TypeScript, browser-local state. Read installed Next.js guides before editing.
4
+
5
+ - Install: `pnpm install`
6
+ - Build: `pnpm build`
7
+ - Check: `pnpm typecheck && pnpm test`
8
+ - Browser checks: `pnpm exec playwright install chromium && pnpm e2e`
9
+
10
+ Synthetic examples are the initial data. Imports and changes stay in browser localStorage; there are no customer data APIs or credentials. Preserve this boundary. Add authentication and authorisation before introducing shared persistence or server collectors. Keep calculation logic in the @tenhaw packages. Do not overwrite existing agent instructions.
11
+
12
+ Built with Tenhaw Kit. For expert help: https://tenhaw.com/contact?utm_source=template&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=ai-adoption-dashboard#book
13
+
14
+ <!-- BEGIN:nextjs-agent-rules -->
15
+
16
+ ## This is NOT the Next.js you know
17
+
18
+ This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
19
+
20
+ This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
21
+
22
+ <!-- END:nextjs-agent-rules -->
@@ -0,0 +1,22 @@
1
+ # Ai adoption dashboard
2
+
3
+ Next.js App Router, TypeScript, browser-local state. Read installed Next.js guides before editing.
4
+
5
+ - Install: `pnpm install`
6
+ - Build: `pnpm build`
7
+ - Check: `pnpm typecheck && pnpm test`
8
+ - Browser checks: `pnpm exec playwright install chromium && pnpm e2e`
9
+
10
+ Synthetic examples are the initial data. Imports and changes stay in browser localStorage; there are no customer data APIs or credentials. Preserve this boundary. Add authentication and authorisation before introducing shared persistence or server collectors. Keep calculation logic in the @tenhaw packages. Do not overwrite existing agent instructions.
11
+
12
+ Built with Tenhaw Kit. For expert help: https://tenhaw.com/contact?utm_source=template&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=ai-adoption-dashboard#book
13
+
14
+ <!-- BEGIN:nextjs-agent-rules -->
15
+
16
+ ## This is NOT the Next.js you know
17
+
18
+ This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
19
+
20
+ This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
21
+
22
+ <!-- END:nextjs-agent-rules -->
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tenhaw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,15 @@
1
+ Tenhaw AI Readiness Framework and authored framework content in spec/content
2
+ are licensed under the Creative Commons Attribution 4.0 International licence.
3
+ Copyright (c) 2026 Tenhaw.
4
+
5
+ Licence: https://creativecommons.org/licenses/by/4.0/
6
+ Legal code: https://creativecommons.org/licenses/by/4.0/legalcode.en
7
+
8
+ When sharing or adapting this content, provide appropriate credit, a licence
9
+ link, and an indication of changes. A suitable credit is:
10
+ "Tenhaw AI Readiness Framework, CC BY 4.0, https://tenhaw.com."
11
+
12
+ Numerical results and user-supplied evidence remain the user's material.
13
+ The optional audit promotion can be suppressed independently of applicable
14
+ framework-content credits. Code is MIT; third-party sources retain their own
15
+ rights and are summarised with links rather than relicensed here.
@@ -0,0 +1,56 @@
1
+ # Ai adoption dashboard
2
+
3
+ A working internal tool starter from Tenhaw Kit. Synthetic examples are included. Your imports and edits stay in browser localStorage.
4
+
5
+ ## When to use
6
+
7
+ Use this when building an internal ai adoption dashboard. Start locally, inspect the sample model and replace it with your own imported data. Add authenticated shared persistence only when you need collaboration across users.
8
+
9
+ ## Run
10
+
11
+ ```sh
12
+ pnpm install
13
+ pnpm dev
14
+ pnpm build
15
+ pnpm test
16
+ pnpm typecheck
17
+ ```
18
+
19
+ Inside the Tenhaw Kit monorepo, first run the root library build. A scaffolded copy resolves released @tenhaw packages instead of workspace links. Publication must be verified separately; source builds do not prove registry availability.
20
+
21
+ ## Data and calculations
22
+
23
+ CSV columns: `team,members,licensed,active,useCases,sentiment`. JSON is an array of the same records. Counts must be non-negative whole numbers and active <= licensed <= members; sentiment is 1 to 5. A quoted CSV example is in `public/example.csv`.
24
+
25
+ See `lib/model.ts` for the example and import validation. Calculation rules live in the @tenhaw packages; shared JSON Schemas and golden vectors live in the Tenhaw Kit source repository.
26
+
27
+ Files up to 2 MB are accepted. CSV and delivery-event imports are capped at 10,000 rows; domain schema limits also apply. JSON export preserves the input model. CSV exports protect text cells against spreadsheet formula injection. Browser storage can be unavailable or full; keep an exported JSON backup before clearing storage, changing origin or changing devices.
28
+
29
+ ## Deploy
30
+
31
+ The Next.js build uses static export (`out/`). There is no API endpoint or shared database receiving the imported data. Deploy static output anywhere, including Vercel. The starter contains no credential fields, token collection, scheduled collectors or telemetry.
32
+
33
+ [Deploy to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FTenhaw%2Ftemplate-ai-adoption-dashboard&project-name=ai-adoption-dashboard) requires the public satellite repository to have been published. A local build does not verify that external release.
34
+
35
+ ## Extend with authentication and a database
36
+
37
+ Before adding server persistence, remove static export and implement authentication plus authorisation for every read, write, import and export route. Auth.js can supply the session, but checking a session alone does not define who may access each record. Protect production deployments as well as previews.
38
+
39
+ A database is deliberately not included in this browser-local baseline. For collaboration, add Drizzle with an explicit SQLite or PostgreSQL schema and dialect-specific migrations, then write a one-time import from the exported JSON. Setting DATABASE_URL alone does not switch database dialects. Keep credentials server-side and out of NEXT_PUBLIC variables.
40
+
41
+ Run GitHub/Jira collectors locally with your read-only environment tokens and import their output. Do not add hosted collection until access control and credential storage are implemented and tested.
42
+
43
+ ## Check the browser workflow
44
+
45
+ ```sh
46
+ pnpm exec playwright install chromium
47
+ pnpm e2e
48
+ ```
49
+
50
+ The browser test opens the synthetic workspace and verifies JSON export. Unit tests cover meaningful import and calculation boundaries. No live source-system tokens are needed.
51
+
52
+ ## Licence and attribution
53
+
54
+ Code: MIT. The bundled readiness framework content remains CC BY 4.0 where used. Set `NEXT_PUBLIC_TENHAW_ATTRIBUTION=false` before building to remove the optional marketing footer; applicable licence notices remain.
55
+
56
+ Built with Tenhaw Kit. [Get expert help applying this](https://tenhaw.com/contact?utm_source=template&utm_medium=readme&utm_campaign=tenhaw-kit&utm_content=ai-adoption-dashboard#book).
@@ -0,0 +1,2 @@
1
+ :root{color-scheme:dark;--ink:#0a0d12;--panel:#111821;--line:#293544;--text:#e9eef3;--muted:#a8b4c2;--yellow:#ffd400;--green:#39e58c}*{box-sizing:border-box}body{margin:0;background:var(--ink);color:var(--text);font-family:Arial,Helvetica,sans-serif;font-size:15px;line-height:1.55}a{color:var(--yellow);text-underline-offset:4px}button,input,select,textarea{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--panel);color:var(--text);padding:9px 14px;border:1px solid var(--line);border-radius:5px;cursor:pointer;text-decoration:none;font-weight:600}button:hover,.button:hover{border-color:var(--muted)}button:focus-visible,.button:focus-within,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--yellow);outline-offset:4px}.primary{background:var(--yellow);color:var(--ink);border-color:var(--yellow)}.subtle{background:transparent;color:var(--muted)}.button input[type=file]{position:absolute;width:1px;height:1px;opacity:0}.workspace{min-height:100vh;display:grid;grid-template-columns:230px 1fr}.sidebar{border-right:1px solid var(--line);padding:28px 20px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;gap:10px;align-items:center;font-size:22px;font-weight:700;margin-bottom:52px}.mark{background:var(--yellow);color:var(--ink);width:34px;height:34px;display:grid;place-items:center;font-size:25px;line-height:1}.muted{color:var(--muted)}.eyebrow{font-size:10px;font-weight:700;letter-spacing:.16em;color:var(--muted);margin:0 0 15px}.sidebar nav{display:grid;gap:5px}.nav{justify-content:flex-start;background:none;border-color:transparent;font-size:14px}.nav.active{background:#202a34;color:var(--yellow)}.sidebar-note{margin-top:auto;padding-top:48px;font-size:12px;color:var(--muted)}.sidebar-note p{margin:8px 0}.sidebar-note small{font-size:11px}.dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--green);margin-right:7px}main{min-width:0;max-width:1500px;width:100%;padding:42px 48px}header{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:26px;margin-bottom:24px}h1{font-size:clamp(27px,3vw,38px);letter-spacing:-.04em;line-height:1.15;margin:0 0 14px}h2{font-size:17px;margin:0;font-weight:600}h3{font-size:15px}.lede{color:var(--muted);max-width:700px;margin:0}.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.notice{font-size:12px;color:var(--muted);margin:12px 0 26px;min-height:19px}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));border:1px solid var(--line);margin:0 0 28px;border-radius:6px;overflow:hidden}.stat{padding:20px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:10px;background:var(--panel)}.stat:last-child{border-right:0}.stat>span{color:var(--muted);font-size:12px}.stat strong{font-size:30px;font-weight:500;letter-spacing:-.04em;line-height:1.2}.stat small{color:var(--muted);font-size:11px}.panel{border:1px solid var(--line);background:var(--panel);padding:24px;border-radius:6px;margin-bottom:22px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.panel-heading small{color:var(--muted);font-size:11px}.columns{display:grid;grid-template-columns:1fr 1fr;gap:22px}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;font-size:13px}th{font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:0 12px 12px 0}td{padding:13px 12px 13px 0;border-top:1px solid var(--line);vertical-align:top}td:first-child{font-weight:600}tbody tr:hover{background:#18222e}.bar-row{margin:18px 0}.bar-row>div:first-child{display:flex;justify-content:space-between;font-size:12px;margin-bottom:8px}.bar-row strong{font-weight:500;color:var(--muted)}.track{height:7px;background:#263240;border-radius:3px;overflow:hidden}.track>span{height:100%;display:block;background:var(--yellow);border-radius:3px}.tag{display:inline-block;font-size:10px;padding:3px 7px;border:1px solid var(--line);border-radius:3px;color:var(--muted);white-space:nowrap}.tag.good{color:var(--green);border-color:#275944}.tag.warn{color:var(--yellow);border-color:#6c601d}label.field{display:flex;flex-direction:column;gap:6px;font-size:12px;margin-bottom:15px;color:var(--muted)}input:not([type=file]),select,textarea{background:var(--ink);border:1px solid var(--line);padding:9px 11px;border-radius:4px;color:var(--text);min-width:0}textarea{width:100%;min-height:140px;font-family:monospace;font-size:12px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.form-grid .wide{grid-column:1/-1}.question{padding:18px 0;border-top:1px solid var(--line)}.question:first-of-type{border-top:0}.question label{display:block}.question-title{font-size:14px;font-weight:600}.question small{display:block;color:var(--muted);margin:6px 0 12px}.question select{width:100%;max-width:600px;margin-bottom:10px}.question input{display:block;width:100%;max-width:600px}details{margin-top:24px;border-top:1px solid var(--line);padding-top:16px}summary{cursor:pointer;color:var(--muted);font-size:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;background:var(--ink);padding:18px;border-radius:5px;max-height:500px;overflow:auto}.empty{color:var(--muted);font-size:13px}.notes{font-size:12px;color:var(--muted)}.notes li{margin:8px 0}.matrix{display:grid;grid-template-columns:1fr 1fr;gap:12px}.quadrant{min-height:130px;border:1px solid var(--line);padding:14px}.quadrant h3{color:var(--muted);margin-top:0;font-size:11px}.quadrant p{margin:8px 0;font-size:12px}.score{font-variant-numeric:tabular-nums}.progress{width:100%;accent-color:var(--yellow)}footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px;border-top:1px solid var(--line);margin-top:40px;padding-top:20px;color:var(--muted);font-size:10px}.skip{position:fixed;top:-100px;left:20px;background:var(--yellow);color:var(--ink);padding:10px;z-index:20}.skip:focus{top:10px}@media(max-width:1000px){main{padding:32px 26px}.workspace{grid-template-columns:185px 1fr}.sidebar{padding:24px 12px}.columns{grid-template-columns:1fr}}@media(max-width:700px){.workspace{display:block}.sidebar{height:auto;position:static;border-right:0;border-bottom:1px solid var(--line);padding:16px 20px}.brand{margin-bottom:18px}.sidebar>.eyebrow,.sidebar-note{display:none}.sidebar nav{display:flex;overflow:auto;gap:5px}.nav{font-size:12px;white-space:nowrap;padding:8px 10px}main{padding:28px 20px}.stats{grid-template-columns:1fr 1fr}.stat{padding:16px}.stat strong{font-size:24px}.panel{padding:18px}.form-grid{grid-template-columns:1fr}.toolbar{gap:7px}.toolbar button,.toolbar .button{font-size:12px;padding:8px 10px}}
2
+ @media print{.sidebar,.toolbar,.notice,footer{display:none}.workspace{display:block}main{padding:0;max-width:none}body{background:white;color:#111;color-scheme:light}.panel,.stat{background:white;border-color:#aaa;break-inside:avoid}pre{background:#f4f4f4;color:#111}.muted,.lede,.notes,.stat>span,th{color:#333}.track{background:#ddd}.track>span{background:#666}button,input,select{color:#111;background:white}}
@@ -0,0 +1,4 @@
1
+ import type { Metadata } from "next";
2
+ import "./globals.css";
3
+ export const metadata: Metadata = { title: "Ai adoption dashboard | Tenhaw Kit", description: "A local-first internal tool starter. Synthetic examples included. Your imported data stays in this browser.", robots: { index: false, follow: false } };
4
+ export default function Layout({children}:{children:React.ReactNode}) { return <html lang="en-GB"><body>{children}</body></html>; }
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { useState } from "react";
3
+ import { example, importTeams, summarise, validateTeams } from "../lib/model";
4
+ import { toCsv } from "../lib/io";
5
+ import { Workspace, Stats, Panel, Table, Bar, FileActions, useWorkspace, number } from "../lib/workspace";
6
+
7
+ export default function Page(){const [section,setSection]=useState("Overview");const state=useWorkspace("tenhaw-adoption-v1",example,validateTeams);const ready=state.ready;const totals=summarise(state.data);const [filter,setFilter]=useState("");const teams=state.data.filter(team=>team.team.toLowerCase().includes(filter.toLowerCase()));
8
+ return <Workspace ready={ready} title="AI adoption" description="See where AI tools are being used, where licences sit idle and which teams need support." section={section} setSection={setSection} sections={["Overview","Teams","Licence use","Methodology"]} notice={state.notice} actions={<FileActions ready={ready} name="ai-adoption" data={state.data} csv={toCsv(state.data)} reset={state.reset} onError={state.setNotice} onImport={(source,format)=>{state.setData(importTeams(source,format));state.setNotice("Imported locally. No records were uploaded.");}}/>}>
9
+ <Stats items={[{label:"Active users",value:number(totals.active),note:`of ${totals.members} team members`},{label:"Licence utilisation",value:totals.utilisation===null?"No licences":`${number(totals.utilisation)}%`,note:`${totals.licensed-totals.active} unused licences`},{label:"Live use cases",value:number(totals.useCases),note:`across ${state.data.length} teams`},{label:"Sentiment",value:totals.sentiment===null?"No responses":`${number(totals.sentiment)} / 5`,note:"Mean of team sentiment averages"}]}/>
10
+ {section==="Methodology"?<Panel title="What these figures mean"><ul className="notes"><li>Active users: people who used an AI tool during the reporting period you selected when preparing the import.</li><li>Licence utilisation = active users / allocated licences. Team adoption = active users / team members.</li><li>Sentiment is an unweighted mean of team averages. It is not weighted by survey responses.</li><li>Imports must use one consistent reporting period. The dashboard cannot infer monthly trends from a single snapshot.</li><li>CSV columns: team, members, licensed, active, useCases, sentiment. Sentiment is 1 to 5; counts are non-negative integers. Active users must not exceed licences or team size.</li></ul></Panel>:<>
11
+ {section==="Overview"&&<div className="columns"><Panel title="Adoption by team" aside="Active / team members">{state.data.map(team=><Bar key={team.team} label={team.team} value={team.members?team.active/team.members*100:0} detail={`${team.active} / ${team.members}`}/>)}</Panel><Panel title="Where to focus"><ul className="notes">{state.data.filter(team=>team.licensed&&team.active/team.licensed<.6).map(team=><li key={team.team}><strong>{team.team}</strong>: {team.licensed-team.active} licences unused. Ask about access, useful workflows and time to learn before buying more seats.</li>)}{!state.data.some(team=>team.licensed&&team.active/team.licensed<.6)&&<li>No team is below the editable review threshold of 60% licence utilisation.</li>}</ul><p className="notes">The 60% threshold is a starter assumption, not an industry benchmark.</p></Panel></div>}
12
+ <Panel title={section==="Licence use"?"Licence allocation":"Team snapshot"} aside="One imported reporting period"><label className="field">Filter teams<input disabled={!ready} value={filter} onChange={event=>setFilter(event.target.value)} placeholder="Search by team"/></label><Table headers={["Team","Members","Licences","Active","Utilisation","Use cases","Sentiment"]} rows={teams.map(team=>[team.team,team.members,team.licensed,team.active,team.licensed?`${number(team.active/team.licensed*100)}%`:"No licences",team.useCases,`${team.sentiment} / 5`])}/></Panel>
13
+ </>}
14
+ </Workspace>;}
@@ -0,0 +1,27 @@
1
+ import { test, expect } from "@playwright/test";
2
+
3
+ test("server-rendered data controls stay disabled before hydration", async ({ browser }) => {
4
+ const context = await browser.newContext({ javaScriptEnabled: false });
5
+ try {
6
+ const page = await context.newPage();
7
+ await page.goto("/");
8
+ await expect(page.locator(".workspace")).toHaveAttribute("data-state", "loading");
9
+ await expect(page.getByRole("button", { name: "Export JSON", exact: true })).toBeDisabled();
10
+ await expect(page.getByRole("button", { name: "Reset to example", exact: true })).toBeDisabled();
11
+ await expect(page.locator('input[type="file"]')).toBeDisabled();
12
+ } finally {
13
+ await context.close();
14
+ }
15
+ });
16
+
17
+ test("restores the local workspace before enabling export", async ({ page }) => {
18
+ await page.goto("/");
19
+ await expect(page.getByRole("heading", { level: 1 })).toBeVisible();
20
+ await expect(page.getByText("Data stays in this browser.", { exact: true })).toBeVisible();
21
+ await expect(page.locator(".workspace")).toHaveAttribute("data-state", "ready");
22
+ const button = page.getByRole("button", { name: "Export JSON", exact: true });
23
+ await expect(button).toBeEnabled();
24
+ const download = page.waitForEvent("download");
25
+ await button.click();
26
+ expect((await download).suggestedFilename()).toMatch(/\.json$/);
27
+ });
@@ -0,0 +1,42 @@
1
+ export function record(value: unknown, path = "input"): Record<string, unknown> {
2
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${path}: expected an object.`);
3
+ return value as Record<string, unknown>;
4
+ }
5
+ export function text(value: unknown, path: string): string {
6
+ if (typeof value !== "string" || !value.trim() || value.length > 2000) throw new Error(`${path}: use text between 1 and 2,000 characters.`);
7
+ return value.trim();
8
+ }
9
+ export function finite(value: unknown, path: string, min = 0, max = 1_000_000_000): number {
10
+ if (value === "" || value === null || value === undefined) throw new Error(`${path}: a number is required.`);
11
+ const result = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
12
+ if (!Number.isFinite(result) || result < min || result > max) throw new Error(`${path}: use a number between ${min} and ${max}.`);
13
+ return result;
14
+ }
15
+ export function list(value: unknown, path: string): unknown[] {
16
+ if (!Array.isArray(value) || value.length > 10000) throw new Error(`${path}: expected an array of at most 10,000 records.`);
17
+ return value;
18
+ }
19
+
20
+ /** RFC 4180-style parsing; quoted commas, double quotes and embedded newlines supported. */
21
+ export function parseCsv(source: string): Record<string,string>[] {
22
+ const rows:string[][]=[]; let row:string[]=[], field="",quoted=false,closed=false;
23
+ const input=source.replace(/^\uFEFF/,"");
24
+ for(let i=0;i<input.length;i++) {const char=input[i];
25
+ if(quoted) {if(char==='"'&&input[i+1]==='"'){field+='"';i++;}else if(char==='"'){quoted=false;closed=true;}else field+=char;}
26
+ else if(char==='"'){if(field || closed) throw new Error("CSV: unexpected quote.");quoted=true;}
27
+ else if(char===","){row.push(field);field="";closed=false;}
28
+ else if(char==="\n"||char==="\r"){if(char==="\r"&&input[i+1]==="\n")i++;row.push(field);if(row.some(Boolean))rows.push(row);row=[];field="";closed=false;}
29
+ else {if(closed)throw new Error("CSV: unexpected text after a closing quote.");field+=char;}
30
+ }
31
+ if(quoted)throw new Error("CSV: an opening quote is not closed.");
32
+ row.push(field);if(row.some(Boolean))rows.push(row);
33
+ const headers=rows.shift()?.map(header=>header.trim());
34
+ if(!headers?.length || headers.some(header=>!header) || new Set(headers).size!==headers.length)throw new Error("CSV: use unique, non-empty column headers.");
35
+ if(rows.length>10000)throw new Error("CSV: at most 10,000 rows are supported.");
36
+ return rows.map((cells,i)=>{if(cells.length!==headers.length)throw new Error(`CSV row ${i+2}: expected ${headers.length} columns.`);return Object.fromEntries(headers.map((header,j)=>[header,cells[j]]));});
37
+ }
38
+ export function toCsv(rows: Record<string,unknown>[], headers?:string[]): string {
39
+ const columns=headers??Object.keys(rows[0]??{});
40
+ const escape=(value:unknown)=>{let content=value===null||value===undefined?"":String(value);if(/^[\t\r\n ]*[=+@-]/.test(content)&&typeof value!=="number")content="'"+content;return '"'+content.replaceAll('"','""')+'"';};
41
+ return [columns.map(escape).join(","),...rows.map(row=>columns.map(key=>escape(row[key])).join(","))].join("\r\n");
42
+ }
@@ -0,0 +1,4 @@
1
+ import { describe,it,expect } from "vitest";
2
+ import { importTeams,summarise,validateTeams,example } from "./model";
3
+ import { parseCsv,toCsv } from "./io";
4
+ describe("adoption imports",()=>{it("computes weighted licence utilisation rather than averaging team percentages",()=>{expect(summarise(example).utilisation).toBeCloseTo(49/72*100);});it("rejects impossible counts and repeated teams",()=>{expect(()=>validateTeams([{...example[0],active:99}])).toThrow();expect(()=>validateTeams([example[0],example[0]])).toThrow();});it("round trips quoted CSV names",()=>{const data=[{...example[0],team:'Team, "A"'}];expect(importTeams(toCsv(data),"csv")).toEqual(data);});it("handles quoted multiline CSV and rejects broken quotes",()=>{expect(parseCsv('a,b\r\n"line\none",two')[0].a).toBe("line\none");expect(()=>parseCsv('a\n"bad')).toThrow();});it("neutralises spreadsheet formulas in text cells",()=>{expect(toCsv([{team:"=CMD()",value:-4}])).toContain("'=CMD()");expect(toCsv([{value:-4}])).toContain('"-4"');});});
@@ -0,0 +1,9 @@
1
+ import { finite, list, parseCsv, record, text } from "./io";
2
+ export type Team = { team:string; members:number; licensed:number; active:number; useCases:number; sentiment:number };
3
+ export const example:Team[]=[{team:"Example Team A",members:24,licensed:20,active:16,useCases:5,sentiment:4.1},{team:"Example Team B",members:18,licensed:18,active:9,useCases:3,sentiment:3.6},{team:"Example Team C",members:32,licensed:24,active:20,useCases:8,sentiment:4.3},{team:"Example Team D",members:12,licensed:10,active:4,useCases:2,sentiment:3.2}];
4
+ export function validateTeams(value:unknown):Team[] {
5
+ const result=list(value,"teams").map((item,i)=>{const row=record(item,`teams[${i}]`);const entry={team:text(row.team,`teams[${i}].team`),members:finite(row.members,"members"),licensed:finite(row.licensed,"licensed"),active:finite(row.active,"active"),useCases:finite(row.useCases,"useCases"),sentiment:finite(row.sentiment,"sentiment",1,5)};if(entry.active>entry.licensed||entry.licensed>entry.members)throw new Error(`teams[${i}]: active <= licensed <= members is required.`);if([entry.members,entry.licensed,entry.active,entry.useCases].some(n=>!Number.isInteger(n)))throw new Error(`teams[${i}]: counts must be whole numbers.`);return entry;});
6
+ if(new Set(result.map(row=>row.team)).size!==result.length)throw new Error("Each team needs a unique name.");return result;
7
+ }
8
+ export function importTeams(source:string,format:string){return validateTeams(format==="csv"?parseCsv(source):JSON.parse(source));}
9
+ export function summarise(teams:Team[]){const members=teams.reduce((s,t)=>s+t.members,0),licensed=teams.reduce((s,t)=>s+t.licensed,0),active=teams.reduce((s,t)=>s+t.active,0),useCases=teams.reduce((s,t)=>s+t.useCases,0);return {members,licensed,active,useCases,utilisation:licensed?active/licensed*100:null,adoption:members?active/members*100:null,sentiment:teams.length?teams.reduce((s,t)=>s+t.sentiment,0)/teams.length:null};}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState, type ReactNode } from "react";
4
+ import { buildUtmUrl } from "@tenhaw/core";
5
+
6
+ export function useWorkspace<T>(key: string, sample: T, validate: (value: unknown) => T) {
7
+ const [data, setData] = useState<T>(sample);
8
+ const [notice, setNotice] = useState("Synthetic examples. Import your own file to begin.");
9
+ const [ready, setReady] = useState(false);
10
+ useEffect(() => {
11
+ try {
12
+ const saved = localStorage.getItem(key);
13
+ if (saved) { setData(validate(JSON.parse(saved))); setNotice("Restored from this browser."); }
14
+ } catch { setNotice("Saved data could not be read. Synthetic examples loaded."); }
15
+ setReady(true);
16
+ }, [key, validate]);
17
+ useEffect(() => {
18
+ if (!ready) return;
19
+ try { localStorage.setItem(key, JSON.stringify(data)); }
20
+ catch { setNotice("Browser storage is unavailable or full. Export a JSON copy to keep your work."); }
21
+ }, [data, key, ready]);
22
+ function reset() { setData(sample); setNotice("Synthetic examples restored."); }
23
+ function clear() { localStorage.removeItem(key); setNotice("Saved copy removed. Export anything you need before closing this tab."); }
24
+ return { data, setData, notice, setNotice, reset, clear, ready };
25
+ }
26
+
27
+ export function download(name: string, data: unknown, type = "application/json") {
28
+ const body = typeof data === "string" ? data : JSON.stringify(data, null, 2);
29
+ const url = URL.createObjectURL(new Blob([body], { type }));
30
+ const anchor = document.createElement("a"); anchor.href = url; anchor.download = name; anchor.click();
31
+ setTimeout(() => URL.revokeObjectURL(url), 1000);
32
+ }
33
+
34
+ export function Workspace({ title, description, section, setSection, sections, children, actions, notice, ready }: {
35
+ title: string; description: string; section: string; setSection: (section: string) => void;
36
+ sections: string[]; children: ReactNode; actions?: ReactNode; notice: string; ready: boolean;
37
+ }) {
38
+ return <div className="workspace" data-state={ready ? "ready" : "loading"} aria-busy={!ready}><a className="skip" href="#workspace-main">Skip to workspace</a><aside className="sidebar"><div className="brand"><span className="mark" aria-hidden="true">t.</span><span>tenhaw<span className="muted"> / kit</span></span></div><span className="eyebrow">INTERNAL WORKSPACE</span><nav aria-label="Workspace views">{sections.map(item => <button disabled={!ready} key={item} type="button" aria-current={item === section ? "page" : undefined} className={item === section ? "nav active" : "nav"} onClick={() => setSection(item)}>{item}</button>)}</nav><div className="sidebar-note"><span className="dot" /> Local workspace<p>Data stays in this browser.</p><small>No account, shared database or usage tracking.</small></div></aside><main id="workspace-main"><header><div><p className="eyebrow">TENHAW KIT / {section.toUpperCase()}</p><h1>{title}</h1><p className="lede">{description}</p></div></header><div className="toolbar">{actions}</div><p className="notice" role="status">{notice}</p>{children}<footer>{process.env.NEXT_PUBLIC_TENHAW_ATTRIBUTION !== "false" && <span>Built with Tenhaw Kit. <a href={buildUtmUrl({source:"template",medium:"footer",content:title.toLowerCase().replaceAll(" ","-")})}>Get help applying this</a></span>}<span>Imported records stay on this device. Export before clearing browser storage.</span></footer></main></div>;
39
+ }
40
+
41
+ export function FileActions<T>({data, name, onImport, onError, reset, csv, ready}: {ready:boolean;data:T;name:string;onImport:(text:string,extension:string)=>void;onError:(message:string)=>void;reset:()=>void;csv?:string}) {
42
+ return <><label className="button primary">Import {csv !== undefined ? "CSV / JSON" : "JSON"}<input disabled={!ready} type="file" accept={csv !== undefined ? ".json,.csv" : ".json"} onChange={async event => { const file = event.target.files?.[0]; event.target.value=""; if (!file) return; if (file.size > 2_000_000) {onError("Choose a file under 2 MB."); return;} try {onImport(await file.text(), file.name.toLowerCase().endsWith(".csv") ? "csv" : "json");} catch(error) {onError(error instanceof Error ? error.message : "Could not import this file.");} }} /></label><button disabled={!ready} type="button" onClick={()=>download(name+".json",data)}>Export JSON</button>{csv !== undefined && <button disabled={!ready} type="button" onClick={()=>download(name+".csv",csv,"text/csv;charset=utf-8")}>Export CSV</button>}<button disabled={!ready} type="button" className="subtle" onClick={reset}>Reset to example</button></>;
43
+ }
44
+ export function Stats({items}:{items:{label:string;value:ReactNode;note?:string}[]}) { return <div className="stats">{items.map(item=><article key={item.label} className="stat"><span>{item.label}</span><strong>{item.value}</strong>{item.note && <small>{item.note}</small>}</article>)}</div>; }
45
+ export function Panel({title,children,aside}:{title:string;children:ReactNode;aside?:string}) { return <section className="panel"><div className="panel-heading"><h2>{title}</h2>{aside && <small>{aside}</small>}</div>{children}</section>; }
46
+ export function Bar({label,value,max=100,detail}:{label:string;value:number;max?:number;detail?:string}) {return <div className="bar-row"><div><span>{label}</span><strong>{detail ?? `${Math.round(value)}%`}</strong></div><div className="track"><span style={{width:`${Math.min(100,Math.max(0,max > 0 ? value/max*100 : 0))}%`}} /></div></div>;}
47
+ export function Table({headers,rows}:{headers:string[];rows:ReactNode[][]}) {return <div className="table-scroll"><table><thead><tr>{headers.map(header=><th key={header} scope="col">{header}</th>)}</tr></thead><tbody>{rows.map((row,i)=><tr key={i}>{row.map((cell,j)=><td key={j}>{cell}</td>)}</tr>)}</tbody></table>{rows.length===0&&<p className="empty">No records yet.</p>}</div>;}
48
+ export function JsonReport({value}:{value:unknown}) {return <details><summary>Inspect calculation output</summary><pre>{JSON.stringify(value,null,2)}</pre></details>;}
49
+ export const number = (value:number|null, digits=1) => value === null ? "Insufficient data" : value.toLocaleString("en-GB",{maximumFractionDigits:digits});
@@ -0,0 +1,7 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ import "./.next/types/routes.d.ts";
4
+ import "./.next/types/root-params.d.ts";
5
+
6
+ // NOTE: This file should not be edited
7
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -0,0 +1,2 @@
1
+ /** @type {import('next').NextConfig} */
2
+ export default { output: 'export', trailingSlash: true, transpilePackages: ["@tenhaw/core"] };
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@tenhaw-template/ai-adoption-dashboard",
3
+ "version": "0.0.0-bootstrap",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "typecheck": "tsc --noEmit",
10
+ "test": "vitest run",
11
+ "e2e": "playwright test"
12
+ },
13
+ "dependencies": {
14
+ "next": "16.4.5",
15
+ "react": "19.2.4",
16
+ "react-dom": "19.2.4",
17
+ "@tenhaw/core": "0.0.0-bootstrap"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^22.0.0",
21
+ "@types/react": "^19.0.0",
22
+ "@types/react-dom": "^19.0.0",
23
+ "typescript": "^5.9.0",
24
+ "vitest": "^3.2.0",
25
+ "@playwright/test": "^1.56.0"
26
+ },
27
+ "license": "MIT",
28
+ "author": "Tenhaw (https://tenhaw.com)",
29
+ "homepage": "https://kit.tenhaw.com/templates/ai-adoption-dashboard/",
30
+ "type": "module"
31
+ }
@@ -0,0 +1,2 @@
1
+ import { defineConfig } from "@playwright/test";
2
+ export default defineConfig({testDir:"./e2e", use:{baseURL:"http://localhost:3100"}, webServer:{command:"pnpm dev --port 3100",url:"http://localhost:3100",reuseExistingServer:!process.env.CI}});
@@ -0,0 +1,5 @@
1
+ team,members,licensed,active,useCases,sentiment
2
+ Example Team A,24,20,16,5,4.1
3
+ Example Team B,18,18,9,3,3.6
4
+ Example Team C,32,24,20,8,4.3
5
+ Example Team D,12,10,4,2,3.2
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "team": "Example Team A",
4
+ "members": 24,
5
+ "licensed": 20,
6
+ "active": 16,
7
+ "useCases": 5,
8
+ "sentiment": 4.1
9
+ },
10
+ {
11
+ "team": "Example Team B",
12
+ "members": 18,
13
+ "licensed": 18,
14
+ "active": 9,
15
+ "useCases": 3,
16
+ "sentiment": 3.6
17
+ },
18
+ {
19
+ "team": "Example Team C",
20
+ "members": 32,
21
+ "licensed": 24,
22
+ "active": 20,
23
+ "useCases": 8,
24
+ "sentiment": 4.3
25
+ },
26
+ {
27
+ "team": "Example Team D",
28
+ "members": 12,
29
+ "licensed": 10,
30
+ "active": 4,
31
+ "useCases": 2,
32
+ "sentiment": 3.2
33
+ }
34
+ ]
@@ -0,0 +1,6 @@
1
+ # Ai adoption dashboard
2
+
3
+ Browser-local internal tool starter from Tenhaw Kit. Synthetic examples.
4
+
5
+ - [Reference](https://kit.tenhaw.com/templates/ai-adoption-dashboard)
6
+ - [Source](https://github.com/Tenhaw/tenhaw-kit/tree/main/templates/ai-adoption-dashboard)
@@ -0,0 +1,36 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "esnext"
8
+ ],
9
+ "strict": true,
10
+ "skipLibCheck": true,
11
+ "noEmit": true,
12
+ "esModuleInterop": true,
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler",
15
+ "resolveJsonModule": true,
16
+ "jsx": "react-jsx",
17
+ "isolatedModules": true,
18
+ "plugins": [
19
+ {
20
+ "name": "next"
21
+ }
22
+ ],
23
+ "allowJs": true,
24
+ "incremental": true
25
+ },
26
+ "include": [
27
+ "next-env.d.ts",
28
+ "**/*.ts",
29
+ "**/*.tsx",
30
+ ".next/types/**/*.ts",
31
+ ".next/dev/types/**/*.ts"
32
+ ],
33
+ "exclude": [
34
+ "node_modules"
35
+ ]
36
+ }
@@ -0,0 +1,2 @@
1
+ import { defineConfig } from "vitest/config";
2
+ export default defineConfig({test:{include:["lib/**/*.test.ts"]}});
@@ -0,0 +1,22 @@
1
+ # Ai readiness assessment
2
+
3
+ Next.js App Router, TypeScript, browser-local state. Read installed Next.js guides before editing.
4
+
5
+ - Install: `pnpm install`
6
+ - Build: `pnpm build`
7
+ - Check: `pnpm typecheck && pnpm test`
8
+ - Browser checks: `pnpm exec playwright install chromium && pnpm e2e`
9
+
10
+ Synthetic examples are the initial data. Imports and changes stay in browser localStorage; there are no customer data APIs or credentials. Preserve this boundary. Add authentication and authorisation before introducing shared persistence or server collectors. Keep calculation logic in the @tenhaw packages. Do not overwrite existing agent instructions.
11
+
12
+ Built with Tenhaw Kit. For expert help: https://tenhaw.com/contact?utm_source=template&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=ai-readiness-assessment#book
13
+
14
+ <!-- BEGIN:nextjs-agent-rules -->
15
+
16
+ ## This is NOT the Next.js you know
17
+
18
+ This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
19
+
20
+ This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
21
+
22
+ <!-- END:nextjs-agent-rules -->
@@ -0,0 +1,22 @@
1
+ # Ai readiness assessment
2
+
3
+ Next.js App Router, TypeScript, browser-local state. Read installed Next.js guides before editing.
4
+
5
+ - Install: `pnpm install`
6
+ - Build: `pnpm build`
7
+ - Check: `pnpm typecheck && pnpm test`
8
+ - Browser checks: `pnpm exec playwright install chromium && pnpm e2e`
9
+
10
+ Synthetic examples are the initial data. Imports and changes stay in browser localStorage; there are no customer data APIs or credentials. Preserve this boundary. Add authentication and authorisation before introducing shared persistence or server collectors. Keep calculation logic in the @tenhaw packages. Do not overwrite existing agent instructions.
11
+
12
+ Built with Tenhaw Kit. For expert help: https://tenhaw.com/contact?utm_source=template&utm_medium=skill&utm_campaign=tenhaw-kit&utm_content=ai-readiness-assessment#book
13
+
14
+ <!-- BEGIN:nextjs-agent-rules -->
15
+
16
+ ## This is NOT the Next.js you know
17
+
18
+ This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
19
+
20
+ This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
21
+
22
+ <!-- END:nextjs-agent-rules -->