@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.
- package/.build-stamp +1 -1
- package/abstractCompactor-rk6twzvj.js +103 -0
- package/{agent.command-ej4g9pbb.js → agent.command-jfz8yfwy.js} +8 -7
- package/{application.command-smn51a28.js → application.command-3smsv7mq.js} +15 -5
- package/{applicationBuildRunner-554a2vnk.js → applicationBuildRunner-aq7mb3z6.js} +2 -1
- package/buildBatch.proc.js +7 -6
- package/{capacitorApp-yg9b4ajz.js → capacitorApp-q3mpmkkz.js} +3 -3
- package/{cloud.command-2v7ga38h.js → cloud.command-rk4e9vrt.js} +10 -10
- package/commandManifest.json +1 -1
- package/{context.command-hhjyjtp7.js → context.command-ygzyb0xb.js} +16 -15
- package/{guideline.command-vj956kfr.js → guideline.command-1m1ctar3.js} +10 -10
- package/guidelines/componentRule/componentRule.instruction.md +2 -2
- package/guidelines/cssRule/cssRule.generate.json +1 -1
- package/guidelines/cssRule/cssRule.instruction.md +57 -34
- package/guidelines/framework/framework.instruction.md +1 -1
- package/guidelines/recipeRule/recipeRule.generate.json +31 -0
- package/guidelines/recipeRule/recipeRule.instruction.md +72 -0
- package/incrementalBuilder.proc.js +5 -5
- package/index-0wae5ebk.js +65 -0
- package/{index-v9jqrdd1.js → index-4yp06pn1.js} +100 -2
- package/{index-pfnh87f9.js → index-4zgs8g1w.js} +1 -1
- package/{index-7ppn9v4n.js → index-b978vs2e.js} +3 -3
- package/{index-s9s0n5fz.js → index-cn24dcqn.js} +2 -2
- package/{index-h971erkm.js → index-csqk9z5j.js} +3 -3
- package/{index-z36qzgzp.js → index-e3qskyt2.js} +3 -4
- package/{index-panyahn4.js → index-ev6rjw9n.js} +27 -13
- package/{index-majzj044.js → index-f4gqk0dd.js} +8 -8
- package/{index-z5v766nx.js → index-fmgbwsr5.js} +6 -6
- package/{index-y1e79mz3.js → index-h0bngh79.js} +13 -13
- package/{index-dgeaqwmw.js → index-hjzr8ja1.js} +1 -1
- package/{index-d0h48d2f.js → index-jk9q6pse.js} +1 -1
- package/{index-xwfg9bam.js → index-jtm86byd.js} +120 -4
- package/{index-j3j3qc9j.js → index-ktprgc5g.js} +4 -4
- package/{index-40w1kqp1.js → index-n0z3f2xg.js} +74 -24
- package/{index-7k9sj7j5.js → index-pyt2b4nw.js} +212 -0
- package/{index-acwxfncv.js → index-r4w8cry5.js} +4 -4
- package/{index-zfp1gz9f.js → index-sggm9qkv.js} +1 -1
- package/{index-04as43rp.js → index-vhv3xnjz.js} +16 -15
- package/index-xjd3rqzj.js +129 -0
- package/{index-xftstr5s.js → index-xwgm94zr.js} +1 -1
- package/index-xys926f2.js +136 -0
- package/index.js +19 -19
- package/{library.command-68ah07a3.js → library.command-pwfx8dx2.js} +4 -4
- package/{localRegistry.command-nmyc5vwv.js → localRegistry.command-bxhqmd1d.js} +11 -11
- package/{module.command-t68xhamx.js → module.command-0t3ewata.js} +8 -8
- package/{package.command-00ncttab.js → package.command-7hmkxvpa.js} +4 -4
- package/package.json +2 -3
- package/{page.command-1096s18n.js → page.command-st6r4s0q.js} +4 -4
- package/{primitive.command-02eqpx6t.js → primitive.command-1qkxpzsn.js} +9 -9
- package/{quality.command-vap6xegb.js → quality.command-hy5vt1bh.js} +31 -6
- package/recipeScanner-tghkzrrt.js +12 -0
- package/{repair.command-7dynpnf1.js → repair.command-nakkq2zp.js} +7 -6
- package/{scalar.command-3kxy3fkh.js → scalar.command-fjq272gs.js} +7 -7
- package/templates/app/page/_index.tsx +55 -52
- package/templates/app/page/styles.css.template +12 -71
- package/templates/appSample/lib/task/Task.Template.tsx +2 -2
- package/templates/appSample/lib/task/Task.Unit.tsx +11 -11
- package/templates/appSample/lib/task/Task.Util.tsx +27 -28
- package/templates/appSample/lib/task/Task.View.tsx +22 -19
- package/templates/appSample/lib/task/Task.Zone.tsx +3 -3
- package/templates/appSample/page/task/[taskId]/_index.tsx +3 -3
- package/templates/appSample/page/task/[taskId]/edit.tsx +5 -5
- package/templates/appSample/page/task/_index.tsx +4 -4
- package/templates/appSample/page/task/_layout.tsx +1 -1
- package/templates/appSample/page/task/new.tsx +5 -5
- package/templates/appSample/ui/GlobalLoading.tsx +4 -4
- package/templates/appSample/ui/QuantityControl.tsx +5 -4
- package/templates/crudPages/[__model__Id]/page.tsx +1 -1
- package/templates/crudPages/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/module/__Model__.Template.tsx +2 -1
- package/templates/module/__Model__.Unit.tsx +2 -1
- package/templates/module/__Model__.Util.tsx +2 -1
- package/templates/module/__Model__.View.tsx +4 -3
- package/templates/module/__Model__.Zone.tsx +2 -1
- package/templates/workspaceRoot/AGENTS.md.template +11 -13
- package/templates/workspaceRoot/biome.json.template +1 -1
- package/{workflow.command-yy0d9gk3.js → workflow.command-jswbgk90.js} +15 -14
- package/{workspace.command-hq1x5605.js → workspace.command-p9r9nckg.js} +89 -29
- package/{applicationReleasePackager-pjbxc793.js → applicationReleasePackager-yrrhbkv3.js} +3 -3
- package/{index-nsj2ftxj.js → index-3pgtw35d.js} +3 -3
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
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-
|
|
12
|
-
import"./index-
|
|
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-
|
|
7
|
+
} from "./index-ev6rjw9n.js";
|
|
5
8
|
import {
|
|
6
9
|
getMobileTargetChoices
|
|
7
10
|
} from "./index-76rn3g2c.js";
|
|
8
|
-
import"./index-
|
|
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-
|
|
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
|
}),
|
package/buildBatch.proc.js
CHANGED
|
@@ -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-
|
|
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-
|
|
27
|
+
} from "./index-sggm9qkv.js";
|
|
28
28
|
import"./index-76rn3g2c.js";
|
|
29
|
-
import"./index-
|
|
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-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-f4gqk0dd.js";
|
|
5
|
+
import"./index-ktprgc5g.js";
|
|
6
|
+
import"./index-e3qskyt2.js";
|
|
6
7
|
import {
|
|
7
8
|
GlobalConfig
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
9
|
+
} from "./index-3pgtw35d.js";
|
|
10
|
+
import"./index-ev6rjw9n.js";
|
|
10
11
|
import"./index-76rn3g2c.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-z36qzgzp.js";
|
|
12
|
+
import"./index-cn24dcqn.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
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
|
package/commandManifest.json
CHANGED
|
@@ -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-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
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-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
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-
|
|
22
|
-
import"./index-
|
|
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-
|
|
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-
|
|
13
|
+
} from "./index-jk9q6pse.js";
|
|
14
14
|
import {
|
|
15
15
|
getDirname
|
|
16
|
-
} from "./index-
|
|
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
|
|
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
|
|
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 `
|
|
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
|
|
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,46 +1,69 @@
|
|
|
1
1
|
# CSS Rule Guideline
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
|
-
Use TailwindCSS
|
|
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
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
38
|
-
- Do not
|
|
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
|
-
-
|
|
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
|
-
-
|
|
44
|
-
-
|
|
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
|
|
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
|
+
}
|