sisyo 1.7.0 → 1.9.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 (61) hide show
  1. package/LICENSE +16 -16
  2. package/README.md +177 -166
  3. package/bin/known-hashes.json +8 -1
  4. package/bin/sisyo.js +285 -285
  5. package/package.json +30 -30
  6. package/templates/.claude/rules/agents-and-tests.md +32 -24
  7. package/templates/.claude/rules/docs.md +39 -19
  8. package/templates/.claude/skills/fastapi-best-practices/ASYNC-PATTERNS.md +121 -121
  9. package/templates/.claude/skills/fastapi-best-practices/DATABASE.md +153 -153
  10. package/templates/.claude/skills/fastapi-best-practices/DEPENDENCIES.md +140 -140
  11. package/templates/.claude/skills/fastapi-best-practices/PROJECT-STRUCTURE.md +90 -90
  12. package/templates/.claude/skills/fastapi-best-practices/PYDANTIC-GUIDE.md +155 -155
  13. package/templates/.claude/skills/fastapi-best-practices/SKILL.md +123 -123
  14. package/templates/.claude/skills/g6-style/SKILL.md +125 -125
  15. package/templates/.claude/skills/g6-style/references/checks.md +58 -58
  16. package/templates/.claude/skills/g6-style/references/imagery.md +103 -103
  17. package/templates/.claude/skills/g6-style/references/motion.md +121 -121
  18. package/templates/.claude/skills/g6-style/references/sections.md +263 -263
  19. package/templates/.claude/skills/g6-style/references/tokens.md +197 -197
  20. package/templates/.claude/skills/hindsight/SKILL.md +175 -175
  21. package/templates/.claude/skills/hoang-auth/SKILL.md +188 -0
  22. package/templates/.claude/skills/html-docs/SKILL.md +207 -207
  23. package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -153
  24. package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -47
  25. package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -46
  26. package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -17
  27. package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -6
  28. package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -4
  29. package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -6
  30. package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -22
  31. package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -10
  32. package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -5
  33. package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -20
  34. package/templates/.claude/skills/i18n-multilang/references/format.md +100 -100
  35. package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -97
  36. package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -256
  37. package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -161
  38. package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -142
  39. package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -107
  40. package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -143
  41. package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -271
  42. package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -1041
  43. package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -1013
  44. package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -478
  45. package/templates/.claude/skills/neon-game-ui-ux-skill/COMPONENTS.md +490 -490
  46. package/templates/.claude/skills/neon-game-ui-ux-skill/GAMIFICATION.md +246 -246
  47. package/templates/.claude/skills/neon-game-ui-ux-skill/ICONS.md +249 -249
  48. package/templates/.claude/skills/neon-game-ui-ux-skill/LAYOUT-NAV.md +362 -362
  49. package/templates/.claude/skills/neon-game-ui-ux-skill/MOTION-A11Y.md +168 -168
  50. package/templates/.claude/skills/neon-game-ui-ux-skill/SKILL.md +137 -137
  51. package/templates/.claude/skills/neon-game-ui-ux-skill/TOKENS.md +323 -323
  52. package/templates/.claude/skills/react-page-oriented/SKILL.md +407 -407
  53. package/templates/.claude/skills/react-page-oriented/triggers.md +12 -12
  54. package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
  55. package/templates/.claude/skills/typesafe-jev/SKILL.md +148 -148
  56. package/templates/.claude/skills/vibe-docs/SKILL.md +139 -242
  57. package/templates/SISYO.md +39 -37
  58. package/templates/docs/99_progress/features.md +7 -7
  59. package/templates/docs/99_progress/handoff.md +19 -19
  60. package/templates/docs/99_progress/todo.md +15 -15
  61. package/templates/docs/MAP.md +26 -26
@@ -1,123 +1,123 @@
1
- ---
2
- name: fastapi-best-practices
3
- description: FastAPI project structure, async patterns, Pydantic schemas, dependency injection, and database patterns. Use when building FastAPI backends, creating REST APIs, or reviewing Python web service code.
4
- ---
5
-
6
- # FastAPI Best Practices
7
-
8
- ## Quick Start
9
-
10
- ```python
11
- # Domain-based structure (recommended for scalable projects)
12
- src/
13
- ├── auth/
14
- │ ├── router.py # endpoints
15
- │ ├── schemas.py # pydantic models
16
- │ ├── models.py # db models
17
- │ ├── service.py # business logic
18
- │ ├── dependencies.py
19
- │ └── exceptions.py
20
- ├── posts/
21
- │ └── ...
22
- ├── config.py # global config
23
- ├── database.py # db connection
24
- └── main.py # FastAPI app init
25
- ```
26
-
27
- ## Core Principles
28
-
29
- ### 1. Async Routes Done Right
30
-
31
- ```python
32
- # BAD - blocks event loop
33
- @router.get("/bad")
34
- async def bad_route():
35
- time.sleep(10) # blocks everything!
36
- return {"ok": True}
37
-
38
- # GOOD - sync route runs in threadpool
39
- @router.get("/good")
40
- def good_route():
41
- time.sleep(10) # runs in separate thread
42
- return {"ok": True}
43
-
44
- # BEST - truly async
45
- @router.get("/best")
46
- async def best_route():
47
- await asyncio.sleep(10) # non-blocking
48
- return {"ok": True}
49
- ```
50
-
51
- ### 2. Pydantic Validation
52
-
53
- ```python
54
- from pydantic import BaseModel, Field, EmailStr
55
-
56
- class UserCreate(BaseModel):
57
- username: str = Field(min_length=1, max_length=128, pattern="^[A-Za-z0-9-_]+$")
58
- email: EmailStr
59
- age: int = Field(ge=18, default=None)
60
- ```
61
-
62
- ### 3. Dependencies for Validation
63
-
64
- ```python
65
- async def valid_post_id(post_id: UUID4) -> dict:
66
- post = await service.get_by_id(post_id)
67
- if not post:
68
- raise PostNotFound()
69
- return post
70
-
71
- @router.get("/posts/{post_id}")
72
- async def get_post(post: dict = Depends(valid_post_id)):
73
- return post
74
- ```
75
-
76
- ## Detailed Guides
77
-
78
- | Topic | File | When to Use |
79
- |-------|------|-------------|
80
- | Project Structure | [PROJECT-STRUCTURE.md](PROJECT-STRUCTURE.md) | Starting new project, organizing modules |
81
- | Async Patterns | [ASYNC-PATTERNS.md](ASYNC-PATTERNS.md) | I/O operations, CPU tasks, blocking code |
82
- | Pydantic Usage | [PYDANTIC-GUIDE.md](PYDANTIC-GUIDE.md) | Schema design, validation, config |
83
- | Dependencies | [DEPENDENCIES.md](DEPENDENCIES.md) | Auth, validation, reusable logic |
84
- | Database | [DATABASE.md](DATABASE.md) | SQLAlchemy, migrations, naming |
85
-
86
- ## Import Conventions
87
-
88
- ```python
89
- # Cross-module imports - use explicit module names
90
- from src.auth import constants as auth_constants
91
- from src.notifications import service as notification_service
92
- from src.posts.constants import ErrorCode as PostsErrorCode
93
- ```
94
-
95
- ## Testing Setup
96
-
97
- ```python
98
- import pytest
99
- from httpx import AsyncClient, ASGITransport
100
- from src.main import app
101
-
102
- @pytest.fixture
103
- async def client():
104
- async with AsyncClient(
105
- transport=ASGITransport(app=app),
106
- base_url="http://test"
107
- ) as client:
108
- yield client
109
-
110
- @pytest.mark.asyncio
111
- async def test_endpoint(client: AsyncClient):
112
- resp = await client.post("/posts")
113
- assert resp.status_code == 201
114
- ```
115
-
116
- ## Code Quality
117
-
118
- Use `ruff` for linting and formatting:
119
-
120
- ```bash
121
- ruff check --fix src
122
- ruff format src
123
- ```
1
+ ---
2
+ name: fastapi-best-practices
3
+ description: FastAPI project structure, async patterns, Pydantic schemas, dependency injection, and database patterns. Use when building FastAPI backends, creating REST APIs, or reviewing Python web service code.
4
+ ---
5
+
6
+ # FastAPI Best Practices
7
+
8
+ ## Quick Start
9
+
10
+ ```python
11
+ # Domain-based structure (recommended for scalable projects)
12
+ src/
13
+ ├── auth/
14
+ │ ├── router.py # endpoints
15
+ │ ├── schemas.py # pydantic models
16
+ │ ├── models.py # db models
17
+ │ ├── service.py # business logic
18
+ │ ├── dependencies.py
19
+ │ └── exceptions.py
20
+ ├── posts/
21
+ │ └── ...
22
+ ├── config.py # global config
23
+ ├── database.py # db connection
24
+ └── main.py # FastAPI app init
25
+ ```
26
+
27
+ ## Core Principles
28
+
29
+ ### 1. Async Routes Done Right
30
+
31
+ ```python
32
+ # BAD - blocks event loop
33
+ @router.get("/bad")
34
+ async def bad_route():
35
+ time.sleep(10) # blocks everything!
36
+ return {"ok": True}
37
+
38
+ # GOOD - sync route runs in threadpool
39
+ @router.get("/good")
40
+ def good_route():
41
+ time.sleep(10) # runs in separate thread
42
+ return {"ok": True}
43
+
44
+ # BEST - truly async
45
+ @router.get("/best")
46
+ async def best_route():
47
+ await asyncio.sleep(10) # non-blocking
48
+ return {"ok": True}
49
+ ```
50
+
51
+ ### 2. Pydantic Validation
52
+
53
+ ```python
54
+ from pydantic import BaseModel, Field, EmailStr
55
+
56
+ class UserCreate(BaseModel):
57
+ username: str = Field(min_length=1, max_length=128, pattern="^[A-Za-z0-9-_]+$")
58
+ email: EmailStr
59
+ age: int = Field(ge=18, default=None)
60
+ ```
61
+
62
+ ### 3. Dependencies for Validation
63
+
64
+ ```python
65
+ async def valid_post_id(post_id: UUID4) -> dict:
66
+ post = await service.get_by_id(post_id)
67
+ if not post:
68
+ raise PostNotFound()
69
+ return post
70
+
71
+ @router.get("/posts/{post_id}")
72
+ async def get_post(post: dict = Depends(valid_post_id)):
73
+ return post
74
+ ```
75
+
76
+ ## Detailed Guides
77
+
78
+ | Topic | File | When to Use |
79
+ |-------|------|-------------|
80
+ | Project Structure | [PROJECT-STRUCTURE.md](PROJECT-STRUCTURE.md) | Starting new project, organizing modules |
81
+ | Async Patterns | [ASYNC-PATTERNS.md](ASYNC-PATTERNS.md) | I/O operations, CPU tasks, blocking code |
82
+ | Pydantic Usage | [PYDANTIC-GUIDE.md](PYDANTIC-GUIDE.md) | Schema design, validation, config |
83
+ | Dependencies | [DEPENDENCIES.md](DEPENDENCIES.md) | Auth, validation, reusable logic |
84
+ | Database | [DATABASE.md](DATABASE.md) | SQLAlchemy, migrations, naming |
85
+
86
+ ## Import Conventions
87
+
88
+ ```python
89
+ # Cross-module imports - use explicit module names
90
+ from src.auth import constants as auth_constants
91
+ from src.notifications import service as notification_service
92
+ from src.posts.constants import ErrorCode as PostsErrorCode
93
+ ```
94
+
95
+ ## Testing Setup
96
+
97
+ ```python
98
+ import pytest
99
+ from httpx import AsyncClient, ASGITransport
100
+ from src.main import app
101
+
102
+ @pytest.fixture
103
+ async def client():
104
+ async with AsyncClient(
105
+ transport=ASGITransport(app=app),
106
+ base_url="http://test"
107
+ ) as client:
108
+ yield client
109
+
110
+ @pytest.mark.asyncio
111
+ async def test_endpoint(client: AsyncClient):
112
+ resp = await client.post("/posts")
113
+ assert resp.status_code == 201
114
+ ```
115
+
116
+ ## Code Quality
117
+
118
+ Use `ruff` for linting and formatting:
119
+
120
+ ```bash
121
+ ruff check --fix src
122
+ ruff format src
123
+ ```
@@ -1,125 +1,125 @@
1
- ---
2
- name: g6-style
3
- description: >-
4
- The "G6" homepage style: champagne / metallic gold "light LED" on warm ivory (light mode) and warm black (dark
5
- mode), after the lit atrium of a Ginza department store, with its motion system: CSS-first entrances, a triangle
6
- lattice of light behind the page, LED strips, a 3D phone stack hero with real screens, animated "how it works"
7
- tiles (QR scan, NFC tap, wallet pass, URL typing) whose lines of light meet at one card, a click-to-play product
8
- tour, a black-and-gold plan, a products row, a photo closing CTA. Guidance only, no source files: exact token
9
- values (light + dark), keyframes, section anatomy for React + Tailwind v4 + framer-motion, codex exec image
10
- prompts, how to fit a real screen into a generated photo, a button-overflow audit method. Use this skill whenever
11
- the user wants a homepage, landing page, product page or marketing site that looks premium, luxurious, gold,
12
- "sang trọng", "pro, animation hơn", like Ginza Six / G6 / the Hokidon homepage, or asks to restyle an existing
13
- site into gold light-and-dark with motion, even if they only say "make the homepage more professional and
14
- animated".
15
- license: MIT
16
- metadata:
17
- author: HoangThang
18
- version: '1.0.0'
19
- ---
20
-
21
- # g6-style
22
-
23
- A premium product homepage: quiet ivory (or warm black) surfaces, gold used like light rather than like paint, and
24
- motion that explains the product instead of decorating it. It was built for the Hokidon digital-business-card site
25
- (Next.js 15 static export, Tailwind CSS v4, framer-motion) and reads well for any app with a phone UI to show.
26
-
27
- This skill is **guidance only**. It contains no source files: the project writes its own tokens, components and
28
- scripts from the values, anatomy and methods in the reference files. The numbers there are the system (contrast was
29
- checked on exactly these values); use them as written, do not approximate them.
30
-
31
- What makes it look expensive, so keep these when adapting:
32
- - **Few colours, one meaning each.** Gold = action / selected / done, champagne = links and focus, bronze = identity,
33
- rose = rare highlight. Everything else is warm neutrals. Glow marks only the one thing that matters on screen.
34
- - **Light, not paint.** Gold appears as LED strips (`.led-line`), a lattice of light behind the page, a skylight at
35
- the top of the hero, a ring of light turning around the one card a section points at (`.g6-sweep`), metallic
36
- gradients with a light band travelling through them (the hero CTA, the headline's second line).
37
- - **Real product, real photos.** Real screen captures in phones; generated photos only for mood and the human
38
- moment, in the same warm gold light; tiny CSS scenes for "how it works".
39
- - **Motion tells the story** (a card taps a phone, a pass rises, an address types itself, lines of light meet at
40
- "your page") and every loop ends on a readable picture.
41
-
42
- ## Reference files: load only what the task needs
43
-
44
- | File | Read it when |
45
- |---|---|
46
- | `references/tokens.md` | Always: colour tokens (light + dark), the theme mechanism, the Tailwind v4 mapping, gradients, the backdrop, LED line, card, sweep and tone scopes. |
47
- | `references/motion.md` | Any animation: easings, the animation tokens, every keyframe (entrance, ambient loops, the story loops of the tiles, form fill), reduced motion, JavaScript loops. |
48
- | `references/sections.md` | Planning or building any section: page order, section shell, hero, strip, animated tiles, "more than X", product tour, plans, products row, closing CTA, phone frame, buttons, switch, a form filled by an API. |
49
- | `references/imagery.md` | Making pictures: codex exec photo prompts, fitting a real screen into a generated photo, video encoding and click-to-play, QR codes in images, image sizes. |
50
- | `references/checks.md` | Before shipping: screenshots, reduced motion, horizontal scroll, the button-overflow audit, languages, network. |
51
-
52
- ## Workflow
53
-
54
- 1. **Read the project first.** Stack (Tailwind v4? v3? plain CSS?), its design tokens, i18n, image pipeline, how it
55
- builds and deploys, its checks. Keep its conventions (file layout, copy rules, analytics hooks, test ids); this
56
- skill brings the look and the motion, not a new architecture. If the project already has a palette with tone
57
- names, map the G6 values onto those names (the Hokidon site did: lime → gold, aqua → champagne, iris → bronze,
58
- flare → rose) instead of renaming every class.
59
- 2. **Write the tokens.** Put the values of `references/tokens.md` and the keyframes of `references/motion.md` into the
60
- global CSS (after `@import "tailwindcss";` on Tailwind v4, or into the project's own variables), render one
61
- fixed `.g6-backdrop` (`aria-hidden`) in the page shell, and give the header a translucent ivory / black glass
62
- (`bg-surface-base/75 backdrop-blur-xl`).
63
- 3. **Plan the page with the user's content.** Use the order in `references/sections.md` as the default and keep only
64
- the sections the product needs. Facts in the copy must be true today (no feature that is not live, prices from
65
- the product catalogue, never typed twice). Ask the user for anything that is a business decision (prices on the
66
- page or not, which video goes where).
67
- 4. **Build top-down**, one section at a time, from its anatomy. After each section, screenshot it at 390 px and
68
- 1440 px in light AND dark (headless Chrome with `prefers-color-scheme` emulated) and look at the pictures; fix
69
- before moving on.
70
- 5. **Media.** Real screens first (capture the actual app), generated photos where a human moment helps
71
- (`references/imagery.md`). Encode videos small; every video waits for a click.
72
- 6. **Verify** (`references/checks.md`), then ship through the project's normal gate (PR, CI).
73
-
74
- ## Motion rules (why the page feels smooth and stays fast)
75
-
76
- - **Entrance on first paint is CSS** (`animate-rise` with a stagger), never framer-motion `initial` on the hero:
77
- server-rendered `opacity: 0` would wait for JavaScript and delay the largest paint.
78
- - **Below the fold**, `whileInView` reveals once (16 px rise, 0.5 s, glide ease, ≤ 0.1 s stagger).
79
- - **Ambient loops are CSS keyframes** on transform / opacity only (aurora, drift, marquee, scan, tap, toast, the
80
- story loops). No `filter: blur()` on big layers: use radial gradients for soft light.
81
- - **JavaScript loops run only while visible** (`useInView`), e.g. the typing address, the tour.
82
- - **Story loops end on the meaning**: give each animated element a static style equal to its end state (card on the
83
- phone, page open, pass up). With `prefers-reduced-motion` the global rule plays one 1 ms pass with no fill, so the
84
- static state is what stays, still explaining the step.
85
- - **One transform per element.** Tailwind v4's `translate-*` / `rotate-*` use the separate `translate` / `rotate`
86
- properties, so they combine with a keyframe on `transform`; framer-motion `style={{ x, rotateX }}` writes
87
- `transform`, so nest: motion wrapper → CSS-animated wrapper → rotated wrapper → content.
88
- - **Pointer tilt only for a mouse** (`pointerType === 'mouse'`), springy (stiffness ~110, damping ~18), off with
89
- reduced motion.
90
- - **Videos never autoplay.** A dialog with `preload="none"` for intros; a tour that starts on ▶ or a step and runs one
91
- pass. Autoplay costs every visitor data and battery for something most do not watch.
92
-
93
- ## Colour rules that are easy to get wrong
94
-
95
- - **Light effects must be redesigned for the light page.** A pale cream LED line or travelling light that glows on
96
- black is invisible on ivory: give each light its own per-theme variables (`--c-way-light` is `#b07a1c` deep gold
97
- with a glow on ivory, `#fff3d1` on black) and use the `ink-*` tones for rings and scan lines that must read in both.
98
- - **Coloured text uses `ink-*`, never the raw tone** (raw gold on ivory is ~1.5:1). Text on a gold fill is `on-gold`
99
- (near black), never white.
100
- - **Per-theme values live in `--c-*` variables**, read with `bg-(image:--c-…)` or `var()`. The `theme-dark` custom
101
- variant is for `:root` only; on an element it misses a theme picked with a toggle.
102
- - **A dark card inside the light page** (the premium plan): `data-theme="dark"` on it so the dark tokens apply inside.
103
- Likewise `data-theme="light"` on a drawn phone screen, which stays light in both themes like a real one.
104
-
105
- ## Layout rules
106
-
107
- - Sections `overflow-x-clip`; anything wider than the screen on purpose (marquee, sideways rows) carries
108
- `data-scroll-x` and clips or scrolls itself.
109
- - Buttons `max-w-full`; tiles in narrow columns get `min-w-0` and a truncating label.
110
- - Columns that depend on the room a component has (an editor between a menu and a preview) use container queries
111
- (`@container` + `@md:grid-cols-5`), not screen breakpoints: the screen can be wide while the column is narrow.
112
- - Japanese text: headings in phrase blocks (each part up to 、/。 an inline-block); body text in narrow columns with
113
- `[word-break:auto-phrase]` + `text-pretty`.
114
- - Phones 320–414 px: no horizontal scroll, chips that would cover the phone move under it.
115
-
116
- ## Pitfalls met while building it
117
-
118
- - Headless Chrome's user agent says "HeadlessChrome": APIs that block bots refuse it. Set a phone user agent when
119
- testing a flow that calls such an API.
120
- - Running `next build` while `next dev` serves the same checkout breaks the dev server (both write `.next`): stop dev
121
- first, or build in another worktree.
122
- - A JSON 404 from an API behind a CDN with custom error pages may come back as the site's HTML 404 page: check the
123
- status, not only the body.
124
- - Generated images: ask for blank screens and blank cards, then put the real product on them; never ship generated
125
- text or logos.
1
+ ---
2
+ name: g6-style
3
+ description: >-
4
+ The "G6" homepage style: champagne / metallic gold "light LED" on warm ivory (light mode) and warm black (dark
5
+ mode), after the lit atrium of a Ginza department store, with its motion system: CSS-first entrances, a triangle
6
+ lattice of light behind the page, LED strips, a 3D phone stack hero with real screens, animated "how it works"
7
+ tiles (QR scan, NFC tap, wallet pass, URL typing) whose lines of light meet at one card, a click-to-play product
8
+ tour, a black-and-gold plan, a products row, a photo closing CTA. Guidance only, no source files: exact token
9
+ values (light + dark), keyframes, section anatomy for React + Tailwind v4 + framer-motion, codex exec image
10
+ prompts, how to fit a real screen into a generated photo, a button-overflow audit method. Use this skill whenever
11
+ the user wants a homepage, landing page, product page or marketing site that looks premium, luxurious, gold,
12
+ "sang trọng", "pro, animation hơn", like Ginza Six / G6 / the Hokidon homepage, or asks to restyle an existing
13
+ site into gold light-and-dark with motion, even if they only say "make the homepage more professional and
14
+ animated".
15
+ license: MIT
16
+ metadata:
17
+ author: HoangThang
18
+ version: '1.0.0'
19
+ ---
20
+
21
+ # g6-style
22
+
23
+ A premium product homepage: quiet ivory (or warm black) surfaces, gold used like light rather than like paint, and
24
+ motion that explains the product instead of decorating it. It was built for the Hokidon digital-business-card site
25
+ (Next.js 15 static export, Tailwind CSS v4, framer-motion) and reads well for any app with a phone UI to show.
26
+
27
+ This skill is **guidance only**. It contains no source files: the project writes its own tokens, components and
28
+ scripts from the values, anatomy and methods in the reference files. The numbers there are the system (contrast was
29
+ checked on exactly these values); use them as written, do not approximate them.
30
+
31
+ What makes it look expensive, so keep these when adapting:
32
+ - **Few colours, one meaning each.** Gold = action / selected / done, champagne = links and focus, bronze = identity,
33
+ rose = rare highlight. Everything else is warm neutrals. Glow marks only the one thing that matters on screen.
34
+ - **Light, not paint.** Gold appears as LED strips (`.led-line`), a lattice of light behind the page, a skylight at
35
+ the top of the hero, a ring of light turning around the one card a section points at (`.g6-sweep`), metallic
36
+ gradients with a light band travelling through them (the hero CTA, the headline's second line).
37
+ - **Real product, real photos.** Real screen captures in phones; generated photos only for mood and the human
38
+ moment, in the same warm gold light; tiny CSS scenes for "how it works".
39
+ - **Motion tells the story** (a card taps a phone, a pass rises, an address types itself, lines of light meet at
40
+ "your page") and every loop ends on a readable picture.
41
+
42
+ ## Reference files: load only what the task needs
43
+
44
+ | File | Read it when |
45
+ |---|---|
46
+ | `references/tokens.md` | Always: colour tokens (light + dark), the theme mechanism, the Tailwind v4 mapping, gradients, the backdrop, LED line, card, sweep and tone scopes. |
47
+ | `references/motion.md` | Any animation: easings, the animation tokens, every keyframe (entrance, ambient loops, the story loops of the tiles, form fill), reduced motion, JavaScript loops. |
48
+ | `references/sections.md` | Planning or building any section: page order, section shell, hero, strip, animated tiles, "more than X", product tour, plans, products row, closing CTA, phone frame, buttons, switch, a form filled by an API. |
49
+ | `references/imagery.md` | Making pictures: codex exec photo prompts, fitting a real screen into a generated photo, video encoding and click-to-play, QR codes in images, image sizes. |
50
+ | `references/checks.md` | Before shipping: screenshots, reduced motion, horizontal scroll, the button-overflow audit, languages, network. |
51
+
52
+ ## Workflow
53
+
54
+ 1. **Read the project first.** Stack (Tailwind v4? v3? plain CSS?), its design tokens, i18n, image pipeline, how it
55
+ builds and deploys, its checks. Keep its conventions (file layout, copy rules, analytics hooks, test ids); this
56
+ skill brings the look and the motion, not a new architecture. If the project already has a palette with tone
57
+ names, map the G6 values onto those names (the Hokidon site did: lime → gold, aqua → champagne, iris → bronze,
58
+ flare → rose) instead of renaming every class.
59
+ 2. **Write the tokens.** Put the values of `references/tokens.md` and the keyframes of `references/motion.md` into the
60
+ global CSS (after `@import "tailwindcss";` on Tailwind v4, or into the project's own variables), render one
61
+ fixed `.g6-backdrop` (`aria-hidden`) in the page shell, and give the header a translucent ivory / black glass
62
+ (`bg-surface-base/75 backdrop-blur-xl`).
63
+ 3. **Plan the page with the user's content.** Use the order in `references/sections.md` as the default and keep only
64
+ the sections the product needs. Facts in the copy must be true today (no feature that is not live, prices from
65
+ the product catalogue, never typed twice). Ask the user for anything that is a business decision (prices on the
66
+ page or not, which video goes where).
67
+ 4. **Build top-down**, one section at a time, from its anatomy. After each section, screenshot it at 390 px and
68
+ 1440 px in light AND dark (headless Chrome with `prefers-color-scheme` emulated) and look at the pictures; fix
69
+ before moving on.
70
+ 5. **Media.** Real screens first (capture the actual app), generated photos where a human moment helps
71
+ (`references/imagery.md`). Encode videos small; every video waits for a click.
72
+ 6. **Verify** (`references/checks.md`), then ship through the project's normal gate (PR, CI).
73
+
74
+ ## Motion rules (why the page feels smooth and stays fast)
75
+
76
+ - **Entrance on first paint is CSS** (`animate-rise` with a stagger), never framer-motion `initial` on the hero:
77
+ server-rendered `opacity: 0` would wait for JavaScript and delay the largest paint.
78
+ - **Below the fold**, `whileInView` reveals once (16 px rise, 0.5 s, glide ease, ≤ 0.1 s stagger).
79
+ - **Ambient loops are CSS keyframes** on transform / opacity only (aurora, drift, marquee, scan, tap, toast, the
80
+ story loops). No `filter: blur()` on big layers: use radial gradients for soft light.
81
+ - **JavaScript loops run only while visible** (`useInView`), e.g. the typing address, the tour.
82
+ - **Story loops end on the meaning**: give each animated element a static style equal to its end state (card on the
83
+ phone, page open, pass up). With `prefers-reduced-motion` the global rule plays one 1 ms pass with no fill, so the
84
+ static state is what stays, still explaining the step.
85
+ - **One transform per element.** Tailwind v4's `translate-*` / `rotate-*` use the separate `translate` / `rotate`
86
+ properties, so they combine with a keyframe on `transform`; framer-motion `style={{ x, rotateX }}` writes
87
+ `transform`, so nest: motion wrapper → CSS-animated wrapper → rotated wrapper → content.
88
+ - **Pointer tilt only for a mouse** (`pointerType === 'mouse'`), springy (stiffness ~110, damping ~18), off with
89
+ reduced motion.
90
+ - **Videos never autoplay.** A dialog with `preload="none"` for intros; a tour that starts on ▶ or a step and runs one
91
+ pass. Autoplay costs every visitor data and battery for something most do not watch.
92
+
93
+ ## Colour rules that are easy to get wrong
94
+
95
+ - **Light effects must be redesigned for the light page.** A pale cream LED line or travelling light that glows on
96
+ black is invisible on ivory: give each light its own per-theme variables (`--c-way-light` is `#b07a1c` deep gold
97
+ with a glow on ivory, `#fff3d1` on black) and use the `ink-*` tones for rings and scan lines that must read in both.
98
+ - **Coloured text uses `ink-*`, never the raw tone** (raw gold on ivory is ~1.5:1). Text on a gold fill is `on-gold`
99
+ (near black), never white.
100
+ - **Per-theme values live in `--c-*` variables**, read with `bg-(image:--c-…)` or `var()`. The `theme-dark` custom
101
+ variant is for `:root` only; on an element it misses a theme picked with a toggle.
102
+ - **A dark card inside the light page** (the premium plan): `data-theme="dark"` on it so the dark tokens apply inside.
103
+ Likewise `data-theme="light"` on a drawn phone screen, which stays light in both themes like a real one.
104
+
105
+ ## Layout rules
106
+
107
+ - Sections `overflow-x-clip`; anything wider than the screen on purpose (marquee, sideways rows) carries
108
+ `data-scroll-x` and clips or scrolls itself.
109
+ - Buttons `max-w-full`; tiles in narrow columns get `min-w-0` and a truncating label.
110
+ - Columns that depend on the room a component has (an editor between a menu and a preview) use container queries
111
+ (`@container` + `@md:grid-cols-5`), not screen breakpoints: the screen can be wide while the column is narrow.
112
+ - Japanese text: headings in phrase blocks (each part up to 、/。 an inline-block); body text in narrow columns with
113
+ `[word-break:auto-phrase]` + `text-pretty`.
114
+ - Phones 320–414 px: no horizontal scroll, chips that would cover the phone move under it.
115
+
116
+ ## Pitfalls met while building it
117
+
118
+ - Headless Chrome's user agent says "HeadlessChrome": APIs that block bots refuse it. Set a phone user agent when
119
+ testing a flow that calls such an API.
120
+ - Running `next build` while `next dev` serves the same checkout breaks the dev server (both write `.next`): stop dev
121
+ first, or build in another worktree.
122
+ - A JSON 404 from an API behind a CDN with custom error pages may come back as the site's HTML 404 page: check the
123
+ status, not only the body.
124
+ - Generated images: ask for blank screens and blank cards, then put the real product on them; never ship generated
125
+ text or logos.
@@ -1,58 +1,58 @@
1
- # g6-style checks before shipping
2
-
3
- Run these once at the end of a batch of sections (and the per-section screenshots while building, SKILL.md step 4).
4
- Use the project's own checks where it has them; the audit below is for projects that have none.
5
-
6
- ## Checklist
7
-
8
- - [ ] Light and dark screenshots of every section at 390 px and 1440 px, looked at, especially light effects in
9
- light mode (LED lines, lines of light, scan lines, rings).
10
- - [ ] `prefers-reduced-motion: reduce`: hero text visible at once, every story loop shows its end state, no video
11
- starts, no tilt.
12
- - [ ] No horizontal scroll at 320 / 360 / 375 px (the project's mobile check, or `scrollWidth - innerWidth` in the
13
- page; elements in `[data-scroll-x]` are wide on purpose).
14
- - [ ] The button-overflow audit (below) on the changed pages, every language; look at each finding.
15
- - [ ] Every language: the longest labels (English, Vietnamese…) wrap inside their buttons; Japanese headings break
16
- between phrases; fonts have the glyphs of every language (a font without Vietnamese or Japanese glyphs falls
17
- back mid-word and looks broken).
18
- - [ ] Network panel on load: no video bytes before a click; images WebP and sized for 2x.
19
- - [ ] Every QR on the page or in a picture opens a page that exists.
20
- - [ ] The project's own gate (lint, typecheck, build, tests, e2e) is green; screenshots of the result shown to the
21
- user.
22
-
23
- ## Button-overflow audit
24
-
25
- A headless-browser script (puppeteer-core or Playwright with the installed Chrome) that opens each page at several
26
- widths and languages and reports buttons whose label spills out, that stick out of their frame, or that pass the
27
- screen edge. Write it once per project (scripts/ or the e2e folder).
28
-
29
- **Inputs** (env or arguments): `BASE` (required), `ROUTES` (default `/`), `WIDTHS` (default
30
- `320,360,375,390,414,768,1024,1280`), `LOCALES` and how the site picks its language (e.g. a localStorage key written
31
- before the page loads with `evaluateOnNewDocument`, or a URL prefix), `COOKIE` for signed-in pages.
32
-
33
- **Per page**: viewport `width × 900` at device scale 1; `goto` with `networkidle2`; scroll through the page once
34
- (600 px steps, ~60 ms apart) so scroll-revealed content is there, back to the top, wait ~600 ms; then in the page:
35
-
36
- 1. Candidates: `button, a, [role="button"], [role="switch"], input[type="submit"]`. Skip anything inside
37
- `[data-scroll-x]`, `.table-scroll`, `[aria-hidden="true"]` or `.sr-only`, anything hidden (`display: none`,
38
- `visibility: hidden`, opacity 0) or smaller than 4 × 4 px. Keep only what looks like a button: a `<button>`, a
39
- button or switch role, or a non-transparent background, a border, or a box shadow (plain text links are not
40
- audited).
41
- 2. **Content vs box**: the bounding box of a Range over the element's contents. Problem when it passes the
42
- element's box by more than 1.5 px left or right ("content wider than box"), else top or bottom ("content taller"),
43
- else when `scrollWidth − clientWidth > 1` without `text-overflow: ellipsis`.
44
- 3. **Out of frame**: walk up the ancestors to the first one that is drawn (background, border or shadow) or clips
45
- (`overflow-x` not visible) and is narrower than the viewport; problem when the button passes it by more than
46
- 1.5 px on either side. Stop at the first such frame.
47
- 4. **Off screen**: the button's box past `0` or the viewport width by more than 1 px.
48
-
49
- **Report**: group identical findings (route + label + problems with the numbers masked) and list the widths and
50
- languages where each occurs, with the element's classes; print the count and exit non-zero when there are findings.
51
-
52
- **Known false positives** (look at each, do not "fix" blindly): a collapsed panel inside an `overflow-hidden` button
53
- (its hidden text counts as content), `sr-only` text inside a step label, a fixed sheet compared with the card under
54
- it.
55
-
56
- Fixes, in order of preference: `max-w-full` on the button (every button of the style has it), `min-w-0` and a
57
- truncating label in narrow tiles, shorter copy agreed with the user, a container query where the column is narrow on
58
- a wide screen.
1
+ # g6-style checks before shipping
2
+
3
+ Run these once at the end of a batch of sections (and the per-section screenshots while building, SKILL.md step 4).
4
+ Use the project's own checks where it has them; the audit below is for projects that have none.
5
+
6
+ ## Checklist
7
+
8
+ - [ ] Light and dark screenshots of every section at 390 px and 1440 px, looked at, especially light effects in
9
+ light mode (LED lines, lines of light, scan lines, rings).
10
+ - [ ] `prefers-reduced-motion: reduce`: hero text visible at once, every story loop shows its end state, no video
11
+ starts, no tilt.
12
+ - [ ] No horizontal scroll at 320 / 360 / 375 px (the project's mobile check, or `scrollWidth - innerWidth` in the
13
+ page; elements in `[data-scroll-x]` are wide on purpose).
14
+ - [ ] The button-overflow audit (below) on the changed pages, every language; look at each finding.
15
+ - [ ] Every language: the longest labels (English, Vietnamese…) wrap inside their buttons; Japanese headings break
16
+ between phrases; fonts have the glyphs of every language (a font without Vietnamese or Japanese glyphs falls
17
+ back mid-word and looks broken).
18
+ - [ ] Network panel on load: no video bytes before a click; images WebP and sized for 2x.
19
+ - [ ] Every QR on the page or in a picture opens a page that exists.
20
+ - [ ] The project's own gate (lint, typecheck, build, tests, e2e) is green; screenshots of the result shown to the
21
+ user.
22
+
23
+ ## Button-overflow audit
24
+
25
+ A headless-browser script (puppeteer-core or Playwright with the installed Chrome) that opens each page at several
26
+ widths and languages and reports buttons whose label spills out, that stick out of their frame, or that pass the
27
+ screen edge. Write it once per project (scripts/ or the e2e folder).
28
+
29
+ **Inputs** (env or arguments): `BASE` (required), `ROUTES` (default `/`), `WIDTHS` (default
30
+ `320,360,375,390,414,768,1024,1280`), `LOCALES` and how the site picks its language (e.g. a localStorage key written
31
+ before the page loads with `evaluateOnNewDocument`, or a URL prefix), `COOKIE` for signed-in pages.
32
+
33
+ **Per page**: viewport `width × 900` at device scale 1; `goto` with `networkidle2`; scroll through the page once
34
+ (600 px steps, ~60 ms apart) so scroll-revealed content is there, back to the top, wait ~600 ms; then in the page:
35
+
36
+ 1. Candidates: `button, a, [role="button"], [role="switch"], input[type="submit"]`. Skip anything inside
37
+ `[data-scroll-x]`, `.table-scroll`, `[aria-hidden="true"]` or `.sr-only`, anything hidden (`display: none`,
38
+ `visibility: hidden`, opacity 0) or smaller than 4 × 4 px. Keep only what looks like a button: a `<button>`, a
39
+ button or switch role, or a non-transparent background, a border, or a box shadow (plain text links are not
40
+ audited).
41
+ 2. **Content vs box**: the bounding box of a Range over the element's contents. Problem when it passes the
42
+ element's box by more than 1.5 px left or right ("content wider than box"), else top or bottom ("content taller"),
43
+ else when `scrollWidth − clientWidth > 1` without `text-overflow: ellipsis`.
44
+ 3. **Out of frame**: walk up the ancestors to the first one that is drawn (background, border or shadow) or clips
45
+ (`overflow-x` not visible) and is narrower than the viewport; problem when the button passes it by more than
46
+ 1.5 px on either side. Stop at the first such frame.
47
+ 4. **Off screen**: the button's box past `0` or the viewport width by more than 1 px.
48
+
49
+ **Report**: group identical findings (route + label + problems with the numbers masked) and list the widths and
50
+ languages where each occurs, with the element's classes; print the count and exit non-zero when there are findings.
51
+
52
+ **Known false positives** (look at each, do not "fix" blindly): a collapsed panel inside an `overflow-hidden` button
53
+ (its hidden text counts as content), `sr-only` text inside a step label, a fixed sheet compared with the card under
54
+ it.
55
+
56
+ Fixes, in order of preference: `max-w-full` on the button (every button of the style has it), `min-w-0` and a
57
+ truncating label in narrow tiles, shorter copy agreed with the user, a container query where the column is narrow on
58
+ a wide screen.