@akanjs/cli 2.4.2-rc.2 → 3.0.0-alpha.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 (81) hide show
  1. package/.build-stamp +1 -1
  2. package/abstractCompactor-rk6twzvj.js +103 -0
  3. package/{agent.command-ej4g9pbb.js → agent.command-jfz8yfwy.js} +8 -7
  4. package/{application.command-smn51a28.js → application.command-3smsv7mq.js} +15 -5
  5. package/{applicationBuildRunner-554a2vnk.js → applicationBuildRunner-aq7mb3z6.js} +2 -1
  6. package/buildBatch.proc.js +7 -6
  7. package/{capacitorApp-yg9b4ajz.js → capacitorApp-q3mpmkkz.js} +3 -3
  8. package/{cloud.command-2v7ga38h.js → cloud.command-rk4e9vrt.js} +10 -10
  9. package/commandManifest.json +1 -1
  10. package/{context.command-hhjyjtp7.js → context.command-ygzyb0xb.js} +16 -15
  11. package/{guideline.command-vj956kfr.js → guideline.command-1m1ctar3.js} +10 -10
  12. package/guidelines/componentRule/componentRule.instruction.md +2 -2
  13. package/guidelines/cssRule/cssRule.generate.json +1 -1
  14. package/guidelines/cssRule/cssRule.instruction.md +57 -34
  15. package/guidelines/framework/framework.instruction.md +1 -1
  16. package/guidelines/recipeRule/recipeRule.generate.json +31 -0
  17. package/guidelines/recipeRule/recipeRule.instruction.md +72 -0
  18. package/incrementalBuilder.proc.js +5 -5
  19. package/index-0wae5ebk.js +65 -0
  20. package/{index-v9jqrdd1.js → index-4yp06pn1.js} +100 -2
  21. package/{index-pfnh87f9.js → index-4zgs8g1w.js} +1 -1
  22. package/{index-7ppn9v4n.js → index-b978vs2e.js} +3 -3
  23. package/{index-s9s0n5fz.js → index-cn24dcqn.js} +2 -2
  24. package/{index-h971erkm.js → index-csqk9z5j.js} +3 -3
  25. package/{index-z36qzgzp.js → index-e3qskyt2.js} +3 -4
  26. package/{index-panyahn4.js → index-ev6rjw9n.js} +27 -13
  27. package/{index-majzj044.js → index-f4gqk0dd.js} +8 -8
  28. package/{index-z5v766nx.js → index-fmgbwsr5.js} +6 -6
  29. package/{index-y1e79mz3.js → index-h0bngh79.js} +13 -13
  30. package/{index-dgeaqwmw.js → index-hjzr8ja1.js} +1 -1
  31. package/{index-d0h48d2f.js → index-jk9q6pse.js} +1 -1
  32. package/{index-xwfg9bam.js → index-jtm86byd.js} +120 -4
  33. package/{index-j3j3qc9j.js → index-ktprgc5g.js} +4 -4
  34. package/{index-40w1kqp1.js → index-n0z3f2xg.js} +74 -24
  35. package/{index-7k9sj7j5.js → index-pyt2b4nw.js} +212 -0
  36. package/{index-acwxfncv.js → index-r4w8cry5.js} +4 -4
  37. package/{index-zfp1gz9f.js → index-sggm9qkv.js} +1 -1
  38. package/{index-04as43rp.js → index-vhv3xnjz.js} +16 -15
  39. package/index-xjd3rqzj.js +129 -0
  40. package/{index-xftstr5s.js → index-xwgm94zr.js} +1 -1
  41. package/index-xys926f2.js +136 -0
  42. package/index.js +19 -19
  43. package/{library.command-68ah07a3.js → library.command-pwfx8dx2.js} +4 -4
  44. package/{localRegistry.command-nmyc5vwv.js → localRegistry.command-bxhqmd1d.js} +11 -11
  45. package/{module.command-t68xhamx.js → module.command-0t3ewata.js} +8 -8
  46. package/{package.command-00ncttab.js → package.command-7hmkxvpa.js} +4 -4
  47. package/package.json +2 -3
  48. package/{page.command-1096s18n.js → page.command-st6r4s0q.js} +4 -4
  49. package/{primitive.command-02eqpx6t.js → primitive.command-1qkxpzsn.js} +9 -9
  50. package/{quality.command-vap6xegb.js → quality.command-hy5vt1bh.js} +31 -6
  51. package/recipeScanner-tghkzrrt.js +12 -0
  52. package/{repair.command-7dynpnf1.js → repair.command-nakkq2zp.js} +7 -6
  53. package/{scalar.command-3kxy3fkh.js → scalar.command-fjq272gs.js} +7 -7
  54. package/templates/app/page/_index.tsx +55 -52
  55. package/templates/app/page/styles.css.template +12 -71
  56. package/templates/appSample/lib/task/Task.Template.tsx +2 -2
  57. package/templates/appSample/lib/task/Task.Unit.tsx +11 -11
  58. package/templates/appSample/lib/task/Task.Util.tsx +27 -28
  59. package/templates/appSample/lib/task/Task.View.tsx +22 -19
  60. package/templates/appSample/lib/task/Task.Zone.tsx +3 -3
  61. package/templates/appSample/page/task/[taskId]/_index.tsx +3 -3
  62. package/templates/appSample/page/task/[taskId]/edit.tsx +5 -5
  63. package/templates/appSample/page/task/_index.tsx +4 -4
  64. package/templates/appSample/page/task/_layout.tsx +1 -1
  65. package/templates/appSample/page/task/new.tsx +5 -5
  66. package/templates/appSample/ui/GlobalLoading.tsx +4 -4
  67. package/templates/appSample/ui/QuantityControl.tsx +5 -4
  68. package/templates/crudPages/[__model__Id]/page.tsx +1 -1
  69. package/templates/crudPages/page.tsx +1 -1
  70. package/templates/crudSinglePage/page.tsx +1 -1
  71. package/templates/module/__Model__.Template.tsx +2 -1
  72. package/templates/module/__Model__.Unit.tsx +2 -1
  73. package/templates/module/__Model__.Util.tsx +2 -1
  74. package/templates/module/__Model__.View.tsx +4 -3
  75. package/templates/module/__Model__.Zone.tsx +2 -1
  76. package/templates/workspaceRoot/AGENTS.md.template +11 -13
  77. package/templates/workspaceRoot/biome.json.template +1 -1
  78. package/{workflow.command-yy0d9gk3.js → workflow.command-jswbgk90.js} +15 -14
  79. package/{workspace.command-hq1x5605.js → workspace.command-p9r9nckg.js} +89 -29
  80. package/{applicationReleasePackager-pjbxc793.js → applicationReleasePackager-yrrhbkv3.js} +3 -3
  81. package/{index-nsj2ftxj.js → index-3pgtw35d.js} +3 -3
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- 6f93500c73ae1edf5c631b83d87c67fb74323b45daf56ae9a89e6c48596c14b8
1
+ ce7835b9c7e649ebc830a1ac94fa9db80a2c2aaec64459445780b8dc7bd627a0
@@ -0,0 +1,103 @@
1
+ // @bun
2
+ import {
3
+ AiSession
4
+ } from "./index-3pgtw35d.js";
5
+ import {
6
+ AbstractDoc
7
+ } from "./index-0wae5ebk.js";
8
+ import"./index-6pz1j0zj.js";
9
+ import"./index-67546d0j.js";
10
+ import"./index-r24hmh0q.js";
11
+
12
+ // pkgs/@akanjs/devkit/abstractCompactor.ts
13
+ import { Logger } from "akanjs/common";
14
+ import chalk from "chalk";
15
+ class AbstractCompactor {
16
+ static #reviewRequest = `Review the compacted file you just wrote against the original.
17
+ - Did you drop an invariant, a security reason, or a workflow step that the source files cannot show by themselves? Restore it.
18
+ - Did you keep anything that only restates code, scaffold wording, or history? Remove it.
19
+ - Is it in the same language as the original, within the line budget, and one short line per bullet?
20
+ Respond with exactly one \`\`\`markdown code block holding the corrected file and nothing else. If nothing needs to change, repeat the file unchanged.`;
21
+ #sys;
22
+ #minLines;
23
+ #interactive;
24
+ constructor(sys, { minLines = AbstractDoc.compactMinLines, interactive = false } = {}) {
25
+ this.#sys = sys;
26
+ this.#minLines = minLines;
27
+ this.#interactive = interactive;
28
+ }
29
+ async compactAll({ module } = {}) {
30
+ const docs = await AbstractDoc.findAll(this.#sys, { module });
31
+ const targets = docs.filter((doc) => doc.lineCount > this.#minLines);
32
+ const reports = [];
33
+ for (const doc of targets)
34
+ reports.push(await this.compact(doc));
35
+ return { scanned: docs.length, reports };
36
+ }
37
+ async compact(doc) {
38
+ const session = new AiSession("compactAbstract", {
39
+ workspace: this.#sys.workspace,
40
+ cacheKey: `${this.#sys.name}-${doc.moduleName}`
41
+ });
42
+ const approve = !this.#interactive;
43
+ const compacted = await session.editMarkdown(this.#request(doc), { approve });
44
+ const reviewed = await session.editMarkdown(AbstractCompactor.#reviewRequest, { approve });
45
+ const next = [reviewed, compacted].map((candidate) => candidate.trim()).find((candidate) => doc.canReplaceWith(candidate));
46
+ const beforeLines = doc.lineCount;
47
+ if (!next) {
48
+ Logger.rawLog(chalk.yellow(`${doc.path}: the editor returned no shorter abstract, keeping the current file`));
49
+ return { path: doc.path, beforeLines, afterLines: beforeLines, status: "failed" };
50
+ }
51
+ if (next === doc.content.trim())
52
+ return { path: doc.path, beforeLines, afterLines: beforeLines, status: "unchanged" };
53
+ const content = `${next}
54
+ `;
55
+ await this.#sys.writeFile(doc.path, content);
56
+ return { path: doc.path, beforeLines, afterLines: AbstractDoc.lineCountOf(content), status: "compacted" };
57
+ }
58
+ #targetShape(kind) {
59
+ if (kind === "other")
60
+ return " - keep the headings that still carry information and drop the rest; do not impose a new structure";
61
+ return [
62
+ " - `# <name> Abstract` title line",
63
+ " - one declarative sentence naming what this module owns",
64
+ " - `## Rules` \u2014 two to five bullets, each an invariant the code cannot show by itself",
65
+ " - optional `## Workflow` \u2014 the lifecycle as an arrow chain (`draft -> signed -> active`) or a few bullets"
66
+ ].join(`
67
+ `);
68
+ }
69
+ #request(doc) {
70
+ return `You are compacting an Akan.js abstract file.
71
+
72
+ An abstract is the summary a coding agent reads before changing a module. Repeated edits have made this one
73
+ bloated, and it has to shrink back to what the source files cannot show by themselves.
74
+
75
+ # Target file
76
+ ${this.#sys.type}s/${this.#sys.name}/${doc.path} (${doc.kind} module "${doc.moduleName}", ${doc.lineCount} lines)
77
+
78
+ # Source files in the same folder
79
+ ${doc.siblingFiles.join(", ") || "none"}
80
+
81
+ # Current content
82
+ \`\`\`markdown
83
+ ${doc.content}
84
+ \`\`\`
85
+
86
+ # Rules for the compacted file
87
+ - Write it in the SAME language as the current content. Never translate.
88
+ - Keep every invariant, constraint, security reason, and workflow step that the source files cannot show by
89
+ themselves. Merge duplicates instead of dropping either one.
90
+ - Delete what the code already states: field lists, types, labels, signatures, file lists, and imports.
91
+ - Delete scaffold and placeholder wording, changelog or migration history, TODOs, and any instruction about
92
+ reading or updating this file.
93
+ - Never invent a rule that the current content does not state.
94
+ - Keep every bullet to one short line, and stay under ${AbstractDoc.compactMinLines} lines in total.
95
+ - Shape:
96
+ ${this.#targetShape(doc.kind)}
97
+
98
+ Respond with exactly one \`\`\`markdown code block holding the whole new file and nothing else.`;
99
+ }
100
+ }
101
+ export {
102
+ AbstractCompactor
103
+ };
@@ -1,17 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  AgentScript
4
- } from "./index-40w1kqp1.js";
5
- import"./index-v9jqrdd1.js";
6
- import"./index-pfnh87f9.js";
7
- import"./index-xftstr5s.js";
4
+ } from "./index-n0z3f2xg.js";
5
+ import"./index-4yp06pn1.js";
6
+ import"./index-4zgs8g1w.js";
7
+ import"./index-xwgm94zr.js";
8
8
  import {
9
9
  Workspace,
10
10
  command
11
- } from "./index-d0h48d2f.js";
12
- import"./index-xwfg9bam.js";
13
- import"./index-67546d0j.js";
11
+ } from "./index-jk9q6pse.js";
12
+ import"./index-jtm86byd.js";
14
13
  import"./index-6pz1j0zj.js";
14
+ import"./index-xys926f2.js";
15
+ import"./index-67546d0j.js";
15
16
  import"./index-r24hmh0q.js";
16
17
 
17
18
  // pkgs/@akanjs/cli/agent/agent.command.ts
@@ -1,23 +1,26 @@
1
1
  // @bun
2
+ import {
3
+ AbstractDoc
4
+ } from "./index-0wae5ebk.js";
2
5
  import {
3
6
  ApplicationScript
4
- } from "./index-panyahn4.js";
7
+ } from "./index-ev6rjw9n.js";
5
8
  import {
6
9
  getMobileTargetChoices
7
10
  } from "./index-76rn3g2c.js";
8
- import"./index-s9s0n5fz.js";
11
+ import"./index-cn24dcqn.js";
9
12
  import {
10
13
  App,
11
14
  Exec,
12
15
  Sys,
13
16
  Workspace,
14
17
  command
15
- } from "./index-d0h48d2f.js";
18
+ } from "./index-jk9q6pse.js";
16
19
  import"./index-fgc8r6dj.js";
17
- import"./index-xwfg9bam.js";
18
- import"./index-67546d0j.js";
19
20
  import"./index-bjpxzr6s.js";
21
+ import"./index-jtm86byd.js";
20
22
  import"./index-6pz1j0zj.js";
23
+ import"./index-67546d0j.js";
21
24
  import"./index-r24hmh0q.js";
22
25
 
23
26
  // pkgs/@akanjs/cli/application/application.command.ts
@@ -39,6 +42,13 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
39
42
  sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
40
43
  await this.applicationScript.sync(sys);
41
44
  }),
45
+ compact: target({ desc: "Compact the *.abstract.md files of an app or library with the AI editor" }).with(Sys).option("module", String, { desc: "single module to compact", nullable: true }).option("minLines", Number, {
46
+ flag: "n",
47
+ desc: "only compact abstracts longer than this",
48
+ default: AbstractDoc.compactMinLines
49
+ }).option("interactive", Boolean, { desc: "confirm or refine each rewrite", default: false }).exec(async function(sys, module, minLines, interactive) {
50
+ await this.applicationScript.compact(sys, { module, minLines, interactive });
51
+ }),
42
52
  script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
43
53
  await this.applicationScript.script(app, filename);
44
54
  }),
@@ -4,7 +4,8 @@ import {
4
4
  CsrArtifactBuilder,
5
5
  SsrBaseArtifactBuilder,
6
6
  precompressArtifacts
7
- } from "./index-7k9sj7j5.js";
7
+ } from "./index-pyt2b4nw.js";
8
+ import"./index-xjd3rqzj.js";
8
9
  import"./index-rh16j3c7.js";
9
10
  import"./index-bjpxzr6s.js";
10
11
  import {
@@ -1,19 +1,20 @@
1
1
  // @bun
2
- import {
3
- AppExecutor,
4
- WorkspaceExecutor
5
- } from "./index-xwfg9bam.js";
6
- import"./index-67546d0j.js";
7
2
  import {
8
3
  CsrArtifactBuilder,
9
4
  CssCompiler,
10
5
  FontOptimizer,
11
6
  PagesBundleBuilder,
12
7
  SsrBaseArtifactBuilder
13
- } from "./index-7k9sj7j5.js";
8
+ } from "./index-pyt2b4nw.js";
9
+ import"./index-xjd3rqzj.js";
14
10
  import"./index-rh16j3c7.js";
15
11
  import"./index-bjpxzr6s.js";
12
+ import {
13
+ AppExecutor,
14
+ WorkspaceExecutor
15
+ } from "./index-jtm86byd.js";
16
16
  import"./index-6pz1j0zj.js";
17
+ import"./index-67546d0j.js";
17
18
  import"./index-r24hmh0q.js";
18
19
 
19
20
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -24,11 +24,11 @@ import {
24
24
  selectLocalDevHost,
25
25
  sortIosRunTargets,
26
26
  writeRootCapacitorConfig
27
- } from "./index-zfp1gz9f.js";
27
+ } from "./index-sggm9qkv.js";
28
28
  import"./index-76rn3g2c.js";
29
- import"./index-xwfg9bam.js";
30
- import"./index-67546d0j.js";
29
+ import"./index-jtm86byd.js";
31
30
  import"./index-6pz1j0zj.js";
31
+ import"./index-67546d0j.js";
32
32
  import"./index-r24hmh0q.js";
33
33
  export {
34
34
  writeRootCapacitorConfig,
@@ -1,25 +1,25 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript
4
- } from "./index-majzj044.js";
5
- import"./index-j3j3qc9j.js";
4
+ } from "./index-f4gqk0dd.js";
5
+ import"./index-ktprgc5g.js";
6
+ import"./index-e3qskyt2.js";
6
7
  import {
7
8
  GlobalConfig
8
- } from "./index-nsj2ftxj.js";
9
- import"./index-panyahn4.js";
9
+ } from "./index-3pgtw35d.js";
10
+ import"./index-ev6rjw9n.js";
10
11
  import"./index-76rn3g2c.js";
11
- import"./index-s9s0n5fz.js";
12
- import"./index-z36qzgzp.js";
12
+ import"./index-cn24dcqn.js";
13
13
  import {
14
14
  Workspace,
15
15
  command
16
- } from "./index-d0h48d2f.js";
16
+ } from "./index-jk9q6pse.js";
17
17
  import"./index-fgc8r6dj.js";
18
- import"./index-xwfg9bam.js";
19
- import"./index-46tjzh6s.js";
20
- import"./index-67546d0j.js";
21
18
  import"./index-bjpxzr6s.js";
19
+ import"./index-jtm86byd.js";
22
20
  import"./index-6pz1j0zj.js";
21
+ import"./index-46tjzh6s.js";
22
+ import"./index-67546d0j.js";
23
23
  import"./index-r24hmh0q.js";
24
24
 
25
25
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
@@ -1 +1 @@
1
- {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","create-application":"application","remove-application":"application","sync":"application","script":"application","console":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","set-llm":"cloud","reset-llm":"cloud","ask":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","guideline":"guideline","generate-instruction":"guideline","update-instruction":"guideline","generate-document":"guideline","reapply-instruction":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow"}}
1
+ {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","create-application":"application","remove-application":"application","sync":"application","compact":"application","script":"application","console":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","set-llm":"cloud","reset-llm":"cloud","ask":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","guideline":"guideline","generate-instruction":"guideline","update-instruction":"guideline","generate-document":"guideline","reapply-instruction":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow"}}
@@ -1,27 +1,28 @@
1
1
  // @bun
2
2
  import {
3
3
  ContextScript
4
- } from "./index-y1e79mz3.js";
5
- import"./index-7ppn9v4n.js";
6
- import"./index-h971erkm.js";
7
- import"./index-z5v766nx.js";
8
- import"./index-acwxfncv.js";
9
- import"./index-04as43rp.js";
10
- import"./index-dgeaqwmw.js";
4
+ } from "./index-h0bngh79.js";
5
+ import"./index-b978vs2e.js";
6
+ import"./index-csqk9z5j.js";
7
+ import"./index-r4w8cry5.js";
8
+ import"./index-vhv3xnjz.js";
9
+ import"./index-hjzr8ja1.js";
10
+ import"./index-fmgbwsr5.js";
11
11
  import"./index-ss469dec.js";
12
- import"./index-zfp1gz9f.js";
13
- import"./index-v9jqrdd1.js";
14
- import"./index-pfnh87f9.js";
15
- import"./index-xftstr5s.js";
16
- import"./index-nsj2ftxj.js";
12
+ import"./index-sggm9qkv.js";
13
+ import"./index-3pgtw35d.js";
14
+ import"./index-4yp06pn1.js";
15
+ import"./index-4zgs8g1w.js";
16
+ import"./index-xwgm94zr.js";
17
17
  import"./index-76rn3g2c.js";
18
18
  import {
19
19
  Workspace,
20
20
  command
21
- } from "./index-d0h48d2f.js";
22
- import"./index-xwfg9bam.js";
23
- import"./index-67546d0j.js";
21
+ } from "./index-jk9q6pse.js";
22
+ import"./index-jtm86byd.js";
24
23
  import"./index-6pz1j0zj.js";
24
+ import"./index-xys926f2.js";
25
+ import"./index-67546d0j.js";
25
26
  import"./index-r24hmh0q.js";
26
27
 
27
28
  // pkgs/@akanjs/cli/context/context.command.ts
@@ -1,23 +1,23 @@
1
1
  // @bun
2
- import {
3
- Prompter
4
- } from "./index-xftstr5s.js";
5
2
  import {
6
3
  AiSession
7
- } from "./index-nsj2ftxj.js";
4
+ } from "./index-3pgtw35d.js";
5
+ import {
6
+ Prompter
7
+ } from "./index-xwgm94zr.js";
8
8
  import {
9
9
  Workspace,
10
10
  command,
11
11
  runner,
12
12
  script
13
- } from "./index-d0h48d2f.js";
13
+ } from "./index-jk9q6pse.js";
14
14
  import {
15
15
  getDirname
16
- } from "./index-xwfg9bam.js";
16
+ } from "./index-jtm86byd.js";
17
+ import"./index-6pz1j0zj.js";
17
18
  import {
18
19
  FileSys
19
20
  } from "./index-67546d0j.js";
20
- import"./index-6pz1j0zj.js";
21
21
  import"./index-r24hmh0q.js";
22
22
 
23
23
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
@@ -151,7 +151,7 @@ ${await this.getDocumentation("framework")}
151
151
  2. Documentation page writing method
152
152
  ${await this.getDocumentation("docPageRule")}
153
153
 
154
- 3. CSS rule with TailwindCSS and DaisyUI
154
+ 3. CSS rule with TailwindCSS and akanjs/ui primitives (semantic tokens; no daisyui)
155
155
  ${await this.getDocumentation("cssRule")}
156
156
 
157
157
  I want to update the Next.js server-side page located at ${writePath}.
@@ -165,8 +165,8 @@ Please update this page with the latest content below. A great design applicatio
165
165
  ${instruction}
166
166
 
167
167
  Please follow these CSS rules when writing:
168
- - Use tailwindcss
169
- - Use className from the daisyui library
168
+ - Use tailwindcss with the semantic design tokens (bg-background, text-foreground, bg-primary, text-muted-foreground, border-border, \u2026)
169
+ - Use akanjs/ui primitives (Button, Badge, Input, Field, \u2026) instead of raw daisyui classes; do not use daisyui
170
170
 
171
171
  Please return only the file result in the following format for easy parsing.
172
172
  \`\`\`tsx
@@ -4,7 +4,7 @@
4
4
  Use this for shared UI rules across module, scalar, app UI, and docs components.
5
5
 
6
6
  ## Ownership
7
- - Accept `className?: string` for reusable components and forward it through `clsx`.
7
+ - Accept `className?: string` for reusable components and forward it through `cn` (from `akanjs/client`), or as the second argument of a recipe (`buttonRecipe(variants, className)`).
8
8
  - Use semantic HTML and accessible labels for interactive elements.
9
9
  - Use `akanjs/ui` and project UI libraries before adding new primitives.
10
10
  - Keep presentation components small; move page composition to Zone and actions to Util or store.
@@ -26,7 +26,7 @@ Use this for shared UI rules across module, scalar, app UI, and docs components.
26
26
  ## Codegen Rules
27
27
  - Do not put business workflow decisions in render code.
28
28
  - Do not use undocumented UI components or props.
29
- - Do not use hardcoded colors when DaisyUI semantic classes work.
29
+ - Do not use hardcoded colors when semantic token classes (`bg-primary`, `text-foreground`, …) work.
30
30
  - Do not create broad component abstractions before repeated patterns exist.
31
31
 
32
32
  ## Review Checklist
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "CSS Rule",
3
- "description": "Tailwind and DaisyUI styling rules",
3
+ "description": "Tailwind and akanjs/ui (semantic token) styling rules",
4
4
  "group": "core",
5
5
  "docsSource": "apps/akan/page/(docs)/docs/arch/css.tsx",
6
6
  "codegenPriority": 3,
@@ -1,46 +1,69 @@
1
1
  # CSS Rule Guideline
2
2
 
3
3
  ## Purpose
4
- Use TailwindCSS and DaisyUI in a theme-safe, composable way for Akan UI and docs pages.
4
+ Use TailwindCSS with Akan's semantic design-token layer and the `akanjs/ui` primitives for app UI and docs pages.
5
5
 
6
6
  ## Ownership
7
7
  - Use Tailwind utility classes for layout, spacing, typography, and responsive behavior.
8
- - Use DaisyUI semantic tokens such as base, primary, secondary, accent, info, success, warning, and error.
9
- - Use `clsx` from `akanjs/client` for conditional class composition.
10
- - Forward `className` at the end of composed class strings to allow callers to extend styles.
11
-
12
- ## Current Akan Patterns
13
- - Prefer mobile-first responsive classes.
14
- - Use card, btn, input, badge, alert, divider, tabs, modal, and other documented DaisyUI classes when they match the design.
15
- - Use consistent density and spacing within one component family.
16
- - Keep custom CSS files rare and scoped to cases utilities cannot express cleanly.
17
-
18
- ## Theme Customization (`apps/<app>/page/styles.css`)
19
- - The app theme is defined in `apps/<app>/page/styles.css` with daisyUI v5 `@plugin "daisyui/theme"` blocks (typically `light` and a `default: true` `dark`).
20
- - Brand-level customization means tuning the whole theme block, not only the color tokens. A theme that only changes `--color-*` still looks like the default framework skin.
21
- - Color tokens: `--color-primary`, `--color-secondary`, `--color-accent`, `--color-neutral`, `--color-info`, `--color-success`, `--color-warning`, `--color-error`, `--color-base-100/200/300`, and their `*-content` pairs.
22
- - Shape and feel tokens (set these too):
23
- - `--radius-selector`rounding for checkbox, toggle, badge.
24
- - `--radius-field` rounding for button, input, select, tab.
25
- - `--radius-box` rounding for card, modal, alert.
26
- - `--size-selector`, `--size-field` base scale (density) of selector and field controls.
27
- - `--border` component border width (e.g. `1px`, `2px`).
28
- - `--depth` `0` flat, `1` adds a subtle 3D lift to components.
29
- - `--noise` — `0` off, `1` adds a grain texture to surfaces.
30
- - Keep shape/feel tokens consistent across the light and dark theme blocks unless the design deliberately differs by mode.
31
-
32
- ## When Utilities Are Not Enough
33
- - Prefer theme tokens and DaisyUI component classes over one-off utility stacks that re-implement a component's look.
34
- - When a framework `akanjs/ui` component is structurally too restrictive, re-skin it with a `page/**/_overrides.tsx` slot override (see the componentRule guideline), not with `!important` utilities or a fork.
8
+ - Use Akan's semantic color tokens never a raw Tailwind palette color (`bg-blue-500`) or a hex value:
9
+ - Surfaces/text: `bg-background`, `text-foreground`, `bg-muted`, `text-muted-foreground`, `bg-card`, `bg-popover`, `border-border`, `border-input`, `ring-ring`.
10
+ - Brand/status: `primary`, `secondary`, `accent`, `destructive`, `success`, `warning`, `info`, `neutral`, `open` each with a `-foreground` pair for text on that surface (e.g. `bg-primary text-primary-foreground`).
11
+ - Compose classes with `cn` from `akanjs/client` (token-aware tailwind-merge) — the only class-combining function. No object syntax: write `cond && "x"`.
12
+ - Forward `className` last so callers can extend styles.
13
+
14
+ ## Recipe Layer
15
+ - Reusable or variant-like styling belongs in a recipe (a cva-style factory), not repeated inline class stacks.
16
+ - Framework primitives ship recipes: `buttonRecipe` and `badgeRecipe` from `akanjs/ui`. Call them as `buttonRecipe(variants, className?)` — the second argument is merged automatically, so you never wrap it in `cn()`:
17
+ - `buttonRecipe({ variant: "primary", size: "lg" }, "w-full rounded-2xl")`
18
+ - Prefer the `akanjs/ui` primitives (`Button`, `Badge`, `Input`, `Field`, `Table` …) over re-implementing a component's look with utility stacks. There is **no `Card`/`Box` primitive** — a card/box is a recipe surface (e.g. `appCard`), not an `akanjs/ui` component; do not `import { Card }`.
19
+ - App-specific repeated surfaces go one-per-file in `apps/<app>/ui/Recipe/` (server-safe, no `"use client"`) via `recipe(tv({ base, variants }))`, imported from `@apps/<app>/ui`. App recipes **extend** (surfaces the lib lacks — chat bubble, tile); they never re-define a lib component in parallel.
20
+ - Full recipe authoring/consumption policy: the `recipeRule` guideline. Never guess recipe names/imports the authoritative list is `AGENTS.md` `## UI Recipes` plus the `list_recipes` tool.
21
+
22
+ ## Customization Decision (where a design delta goes)
23
+ Screen code is invariant a plain `<Button variant="primary">` never changes. Only these config files do:
24
+ - **Theme differs** (color/radius/font) override token *values* in `apps/<app>/page/styles.css`.
25
+ - **A lib component's look differs** → recipe override: `export default override({ recipes: { button: neonButtonRecipe } })` in a `page/**/_overrides.tsx`. Every `<Button>` in that route subtree re-skins; behavior (async states, focus, a11y) is untouched. The swap recipe must accept the framework recipe's full variant surface.
26
+ - **Structure/behavior differs** (modal drawer) → component override (`override({ Modal: BrandModal })`), reassembling headless parts.
27
+ - **A surface the lib lacks** a new app recipe (extension).
28
+ - Do not fight the cascade with `!important`, and when the same inline className tweak repeats, promote it to a recipe override or a variant.
29
+
30
+ ## Theme Declaration (`apps/<app>/page/styles.css`)
31
+ - The file imports Tailwind and the framework tokens, then overrides token *values* per theme:
32
+ ```css
33
+ @import "tailwindcss";
34
+ @import "akanjs/ui/styles.css";
35
+
36
+ :root,
37
+ [data-theme="dark"] {
38
+ --background: #1a1a1a;
39
+ --foreground: #ffffff;
40
+ --primary: #ff493b;
41
+ --primary-foreground: #ffffff;
42
+ --muted: #2a2a2a;
43
+ --border: #3a3a3a;
44
+ }
45
+ [data-theme="light"] {
46
+ --background: #fafafa;
47
+ --foreground: #2c3e50;
48
+ --primary: #c33c32;
49
+ --primary-foreground: #ffffff;
50
+ --muted: #f5f5f5;
51
+ --border: #e5e5e5;
52
+ }
53
+ ```
54
+ - The framework maps these variables to Tailwind color names (`@theme inline` in `akanjs/ui/styles.css`), so a class like `bg-primary` / `text-foreground` resolves to different colors per `data-theme` — the app only sets values, never re-declares the mapping.
55
+ - Switching themes is toggling the `data-theme` attribute. Keep every token defined in both the dark and light blocks.
56
+ - Radius uses `rounded-box` (cards/modals), `rounded-field` (buttons/inputs), `rounded-selector` (toggles/checkboxes).
35
57
 
36
58
  ## Codegen Rules
37
- - Do not hardcode hex colors or one-off brand colors unless the existing file already defines that design system.
38
- - Do not use important flags to fight component composition.
59
+ - Do not hardcode hex or raw-palette colors (`bg-red-500`, `#ff0000`); use semantic tokens.
60
+ - Do not put inline color literals in `style={{ }}`; use token classes.
61
+ - Do not use `!important` to fight component composition.
39
62
  - Do not hide focus states on interactive elements.
40
- - Do not add global CSS for one component-specific layout.
63
+ - When an `akanjs/ui` component is structurally too restrictive, re-skin it with a `page/**/_overrides.tsx` slot override (see the componentRule guideline), not `!important` utilities or a fork.
41
64
 
42
65
  ## Review Checklist
43
- - The instruction points to current docs pages, not removed docs routes.
44
- - Generated examples use current Akan builder APIs and scanner-friendly filenames.
66
+ - All color goes through semantic tokens — no raw palette, no hex, no inline color.
67
+ - Repeated/variant styling uses a recipe; class composition uses `cn` (never raw `twMerge`/`clsx` imports).
68
+ - The instruction points to current docs pages and current Akan builder APIs.
45
69
  - The output contract tells the model which file paths to return.
46
- - The guide avoids broad framework essays when a concrete file rule is better.
@@ -25,7 +25,7 @@ Use this as the compact framework context for AI codegen. It should explain how
25
25
  ## Theming And UI Customization
26
26
  When a request implies a distinct look and feel, do not stop at colors — customize both the theme and, when needed, the components.
27
27
 
28
- - **Theme (`apps/<app>/page/styles.css`).** The app theme is one or more daisyUI v5 `@plugin "daisyui/theme"` blocks. Match the brand by tuning the whole block, not only the `--color-*` tokens: set corner rounding (`--radius-selector`, `--radius-field`, `--radius-box`), control density (`--size-selector`, `--size-field`), outline weight (`--border`), and surface treatment (`--depth`, `--noise`). New workspaces ship these knobs at neutral defaults so they are visible to tune. Fetch `get_guideline` with `cssRule` for the full variable reference before a deep theme pass.
28
+ - **Theme (`apps/<app>/page/styles.css`).** The app imports Tailwind and `akanjs/ui/styles.css`, then overrides semantic token *values* per theme under `:root, [data-theme="dark"]` and `[data-theme="light"]` (`--background`, `--foreground`, `--primary`, `--muted`, `--border`, each with a `-foreground` pair for text). The framework maps them to Tailwind color names, so `bg-primary` / `text-foreground` follow the `data-theme` attribute; corner rounding uses `--radius-box` / `--radius-field`. Fetch `get_guideline` with `cssRule` for the full token set before a deep theme pass.
29
29
  - **Components (`page/**/_overrides.tsx`).** When a default `akanjs/ui` component (Button, Modal, Table, Input, Select, …) is too restrictive for the design, re-skin it per route instead of forking, wrapping, or fighting it with utility classes. Write a drop-in replacement in `apps/<app>/ui/` typed against the slot contract (`AkanModalComponent`, or `AkanUiOverrides["<Slot>"]`), composing the framework's headless parts, then bind it in a `page/**/_overrides.tsx` manifest with a single `export default override({ Slot: BrandComponent })`. Overrides cascade down the route tree like layouts (closest ancestor wins). Fetch `get_guideline` with `componentRule` and read the `references/ui/customize` docs page for the slot list and patterns.
30
30
 
31
31
  ## Review Checklist
@@ -0,0 +1,31 @@
1
+ {
2
+ "title": "Recipe Rule",
3
+ "description": "Akan UI recipe authoring and consumption rules (reusable-look layer)",
4
+ "group": "core",
5
+ "docsSource": "apps/akan/page/(docs)/docs/arch/ui-recipe.tsx",
6
+ "codegenPriority": 3,
7
+ "deprecated": false,
8
+ "scans": [
9
+ {
10
+ "type": "docs",
11
+ "description": "Current docs source for Recipe Rule",
12
+ "path": "apps/akan/page/(docs)/docs/arch/ui-recipe.tsx"
13
+ },
14
+ {
15
+ "type": "example",
16
+ "description": "Existing recipe definitions",
17
+ "path": "{apps,libs}/*/ui/Recipe/*.ts",
18
+ "sample": 4
19
+ }
20
+ ],
21
+ "update": {
22
+ "filePath": "./recipeRule.instruction.md",
23
+ "contents": ["purpose", "ownership", "consuming", "authoring", "codegen rules", "review checklist"],
24
+ "rules": [
25
+ "Use current Akan APIs only",
26
+ "Keep output parseable for codegen",
27
+ "Include ownership boundaries and review checklist"
28
+ ]
29
+ },
30
+ "page": "apps/akan/page/(docs)/docs/arch/ui-recipe.tsx"
31
+ }