@cogito.ai/astryx-web 0.1.0 → 0.2.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/bin/astryx-web.mjs +6 -3
- package/docs/dock-style-archetypes.doc.mjs +104 -0
- package/package.json +1 -1
- package/skills/astryx-web-design/SKILL.md +21 -0
- package/skills/astryx-web-design/references/acceptance.md +12 -0
- package/skills/astryx-web-design/references/design-direction.md +52 -0
- package/skills/astryx-web-design/references/page-building.md +18 -0
package/bin/astryx-web.mjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { spawn, spawnSync } from 'node:child_process'
|
|
4
4
|
import { once } from 'node:events'
|
|
5
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
5
|
+
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs'
|
|
6
6
|
import { tmpdir } from 'node:os'
|
|
7
7
|
import { join, resolve } from 'node:path'
|
|
8
|
-
import {
|
|
8
|
+
import { fileURLToPath } from 'node:url'
|
|
9
9
|
|
|
10
10
|
const COMMAND = 'samples'
|
|
11
11
|
const APPEARANCE_STORAGE_KEY = 'agentdock.appearance'
|
|
@@ -345,6 +345,9 @@ async function main() {
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
if (
|
|
348
|
+
if (
|
|
349
|
+
process.argv[1] &&
|
|
350
|
+
realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))
|
|
351
|
+
) {
|
|
349
352
|
await main()
|
|
350
353
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
2
|
+
export default {
|
|
3
|
+
type: "generic",
|
|
4
|
+
name: "dock-style-archetypes",
|
|
5
|
+
title: "Dock Style Archetypes",
|
|
6
|
+
description: "Eight approved visual directions built on Astryx themes.",
|
|
7
|
+
sections: [
|
|
8
|
+
{
|
|
9
|
+
title: "Style archetypes",
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: "prose",
|
|
13
|
+
text: "The design discussion may only propose directions from this table. Reference brands describe a look; never copy their fonts, logos, or assets.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "table",
|
|
17
|
+
headers: [
|
|
18
|
+
"Id",
|
|
19
|
+
"Base theme",
|
|
20
|
+
"Temperament",
|
|
21
|
+
"Color strategy",
|
|
22
|
+
"Type, density, radius",
|
|
23
|
+
"Suits",
|
|
24
|
+
"Look reference",
|
|
25
|
+
],
|
|
26
|
+
rows: [
|
|
27
|
+
[
|
|
28
|
+
"quiet-tool",
|
|
29
|
+
"neutral",
|
|
30
|
+
"calm, focused, efficient",
|
|
31
|
+
"about 90% neutral; one accent for the primary action and focus only",
|
|
32
|
+
"system sans; compact; small radii",
|
|
33
|
+
"editors, studios, productivity tools",
|
|
34
|
+
"Linear, Figma",
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"warm-learning",
|
|
38
|
+
"butter",
|
|
39
|
+
"friendly, encouraging, light",
|
|
40
|
+
"warm surfaces, one blue accent; clear success and error states",
|
|
41
|
+
"rounded sans; comfortable; medium radii",
|
|
42
|
+
"learning and practice, habits",
|
|
43
|
+
"Duolingo (restrained), Headspace",
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"calm-content",
|
|
47
|
+
"matcha",
|
|
48
|
+
"natural, steady, trustworthy",
|
|
49
|
+
"low-saturation green and neutrals; few accents",
|
|
50
|
+
"readable body type; generous spacing",
|
|
51
|
+
"wellness, reading, content-first",
|
|
52
|
+
"Calm, Notion",
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"crafted-record",
|
|
56
|
+
"stone",
|
|
57
|
+
"plain, reliable, warm",
|
|
58
|
+
"warm grey and slate; a low-saturation accent",
|
|
59
|
+
"sans; comfortable; medium radii",
|
|
60
|
+
"records, archives, personal management",
|
|
61
|
+
"Things, Bear",
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"editorial",
|
|
65
|
+
"gothic",
|
|
66
|
+
"serious, memorable",
|
|
67
|
+
"deep blue-grey; display serif headings",
|
|
68
|
+
"serif display with sans body; spacious",
|
|
69
|
+
"reports, portfolios, long-form",
|
|
70
|
+
"Medium, The Atlantic",
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"warm-premium",
|
|
74
|
+
"chocolate",
|
|
75
|
+
"rich, refined",
|
|
76
|
+
"brown palette; serif headings",
|
|
77
|
+
"the theme's Fraunces and Albert Sans; spacious",
|
|
78
|
+
"lifestyle, premium content",
|
|
79
|
+
"Aesop, Kinfolk",
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"playful",
|
|
83
|
+
"y2k",
|
|
84
|
+
"bubbly, young",
|
|
85
|
+
"saturated pink and lime, used sparingly",
|
|
86
|
+
"the theme's Poppins; comfortable; large radii",
|
|
87
|
+
"kids, entertainment, community",
|
|
88
|
+
"—",
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"precise-data",
|
|
92
|
+
"neutral with a blue brand color",
|
|
93
|
+
"exact, credible",
|
|
94
|
+
"neutrals plus a data-visualization palette",
|
|
95
|
+
"tabular figures; compact",
|
|
96
|
+
"dashboards, evaluation, admin",
|
|
97
|
+
"Vercel, Stripe",
|
|
98
|
+
],
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: astryx-web-design
|
|
3
|
+
description: Use before any UI work in a web-tanstackstart project or a domain package Web. If DESIGN.md is not approved, hold the design-direction discussion with the owner (brand, UI style, UX, color system) and stop until they decide; otherwise create pages only with pnpm page:new and accept them at phone and desktop sizes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Astryx web design
|
|
7
|
+
|
|
8
|
+
| Situation | Read |
|
|
9
|
+
| ---------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
10
|
+
| `DESIGN.md` says `status: draft` (new project, or no direction agreed) | `references/design-direction.md`, before any feature work |
|
|
11
|
+
| Adding or changing a page | `references/page-building.md` |
|
|
12
|
+
| About to call UI work done | `references/acceptance.md` |
|
|
13
|
+
|
|
14
|
+
Rules that never bend:
|
|
15
|
+
|
|
16
|
+
- No feature page before the owner approves the design direction. Never choose for the owner, never
|
|
17
|
+
set a deadline, never fall back to a default.
|
|
18
|
+
- Every page comes from `pnpm page:new`. Never lay a page out from scratch.
|
|
19
|
+
- The shared rules are in `pnpm exec astryx docs dock-design-base`. Read the section you need
|
|
20
|
+
instead of guessing.
|
|
21
|
+
- Screenshots are for judging what the user sees. Never use them to watch CI or progress.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Visual acceptance
|
|
2
|
+
|
|
3
|
+
1. `pnpm dev`, then `pnpm design:samples` for every changed route with the project theme, light and
|
|
4
|
+
dark, 390x844 and 1440x900.
|
|
5
|
+
2. Open every image and check it against `pnpm exec astryx docs dock-visual-acceptance` and
|
|
6
|
+
`pnpm exec astryx docs dock-refuse-list`, plus `DESIGN.md`.
|
|
7
|
+
3. Also check: no horizontal scroll at 360px; touch targets at least 44px; keyboard path and visible
|
|
8
|
+
focus; both locales.
|
|
9
|
+
4. Fix everything you found in one batch and render again. At most two rounds; then report the
|
|
10
|
+
image folder to the owner.
|
|
11
|
+
|
|
12
|
+
Screenshots are only for judging the UI. Never use them to watch CI, a pipeline, or progress.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Design direction (before any feature work)
|
|
2
|
+
|
|
3
|
+
Outcome: the owner decides the brand, UI style, UX model, and color system. You record them in
|
|
4
|
+
`PRODUCT.md` and `DESIGN.md` and set `DESIGN.md` to `approved`.
|
|
5
|
+
|
|
6
|
+
## 1 · Understand the product (no visuals yet)
|
|
7
|
+
|
|
8
|
+
Read the product's intent first (`README.md`; in a domain package also `contract.json` and
|
|
9
|
+
`roadmap.yaml`). Then ask the owner at most three questions per message until `PRODUCT.md` can be
|
|
10
|
+
filled:
|
|
11
|
+
|
|
12
|
+
- who uses it, where (phone, desktop App, browser), and how often;
|
|
13
|
+
- the one or two core tasks, and what "done" looks like for the user;
|
|
14
|
+
- the brand's personality in three adjectives, and one or two products it must not feel like.
|
|
15
|
+
|
|
16
|
+
Write `PRODUCT.md`, show it, and correct what the owner corrects.
|
|
17
|
+
|
|
18
|
+
## 2 · Round 1: three directions
|
|
19
|
+
|
|
20
|
+
1. Read `pnpm exec astryx docs dock-style-archetypes`. Choose three rows that fit `PRODUCT.md` and
|
|
21
|
+
differ along one named axis (for example calm ↔ energetic). Never propose a direction that is
|
|
22
|
+
not in the table.
|
|
23
|
+
2. For each direction write five lines: the archetype and its base theme; type, density, and
|
|
24
|
+
radius; navigation on phone and on desktop; the first screen; the core task in three steps.
|
|
25
|
+
3. Render the three sample pages (landing, settings, workbench) under each direction's base theme:
|
|
26
|
+
`pnpm dev`, then
|
|
27
|
+
`pnpm design:samples --route /zh-CN --route /zh-CN/settings --route /zh-CN/hello --theme <base> --mode light --mode dark --size 390x844 --size 1440x900 --out <dir>/round1/<direction>`.
|
|
28
|
+
Use the output directory the owner gave you; if none, `design-samples/` at the repository root.
|
|
29
|
+
If a base theme is not installed yet, add it first with `pnpm exec astryx theme add <slug>`;
|
|
30
|
+
after the decision, remove the themes that were added only for this round.
|
|
31
|
+
4. Send the owner the five lines and the render folder for each direction. **Stop and wait.** No
|
|
32
|
+
deadline, no default. If the owner mixes directions or asks for changes, adjust and render again.
|
|
33
|
+
|
|
34
|
+
## 3 · Round 2: brand color
|
|
35
|
+
|
|
36
|
+
1. For the chosen direction, generate two or three palette candidates with
|
|
37
|
+
`pnpm exec astryx theme palette generate <config>` (`pnpm exec astryx docs cli/commands/theme-palette`).
|
|
38
|
+
2. Build each candidate as a theme (`pnpm exec astryx docs author-a-theme`). An ejected theme's
|
|
39
|
+
local icon file may import packages the app does not have; use the base theme package's exported
|
|
40
|
+
icon registry instead of adding a dependency. Render the landing page with each candidate, light
|
|
41
|
+
and dark, phone and desktop, into `<dir>/round2/<candidate>`.
|
|
42
|
+
3. Send the candidates with their contrast ratios for body text. **Stop and wait.**
|
|
43
|
+
|
|
44
|
+
## 4 · Record
|
|
45
|
+
|
|
46
|
+
1. Keep the chosen brand theme as the project's default theme; add its built module and CSS to
|
|
47
|
+
`AppearanceProvider`'s theme options, update its explicit theme-list test, and remove the other
|
|
48
|
+
candidates.
|
|
49
|
+
2. Fill `DESIGN.md`: front matter, then Overview, Colors, Typography, Layout and navigation, Pages
|
|
50
|
+
(planned routes with their archetypes), Do and don't.
|
|
51
|
+
3. Add a dated entry to `## Decisions`: what was chosen, what else was shown, and the owner's words.
|
|
52
|
+
4. Set `status: approved`, `approvedBy`, and `approvedAt` only now. Run `pnpm check`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Building a page
|
|
2
|
+
|
|
3
|
+
1. Name the page by type and purpose: "<type> page for <purpose>" (types: landing, workbench,
|
|
4
|
+
list, form, settings, editor). Put the page type last: write `mobile settings page`, not
|
|
5
|
+
`settings page on mobile`. Run `pnpm page:new "<intent>" --route <path>`. If it rejects the
|
|
6
|
+
intent, pick a template from the list it prints and pass `--template <id>`.
|
|
7
|
+
2. Replace the `SAMPLE_*` data with feature data through the feature's public API (`LLM.md` §7).
|
|
8
|
+
3. Write the page's copy in `src/i18n/pages/<page>.ts` for every locale.
|
|
9
|
+
4. Change the page only inside its sections; keep its frame, gaps, and padding. For a part the
|
|
10
|
+
archetype lacks, `pnpm exec astryx build "<part>"` lists blocks; print one with
|
|
11
|
+
`pnpm exec astryx template <Block>`, then move its strings to the catalog and drop any `style`
|
|
12
|
+
attribute.
|
|
13
|
+
5. A domain component (a canvas, a player) goes into the archetype's slot; never replace the frame.
|
|
14
|
+
6. Follow `DESIGN.md` and `pnpm exec astryx docs dock-design-base`. Run `pnpm check`, then
|
|
15
|
+
`references/acceptance.md`.
|
|
16
|
+
|
|
17
|
+
Never: lay a page out from scratch; use a Core template without `--allow-core`; add a package to
|
|
18
|
+
satisfy a template's import.
|