sisyo 1.5.1 → 1.6.5
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/LICENSE +16 -16
- package/README.md +161 -139
- package/bin/known-hashes.json +71 -0
- package/bin/sisyo.js +200 -78
- package/package.json +30 -26
- package/templates/.claude/rules/docs.md +19 -19
- package/templates/.claude/skills/gemini-integration/GENERATE.md +111 -0
- package/templates/.claude/skills/gemini-integration/LIVE-VOICE.md +242 -0
- package/templates/.claude/skills/gemini-integration/RAG-EMBEDDING.md +93 -0
- package/templates/.claude/skills/gemini-integration/SKILL.md +157 -0
- package/templates/.claude/skills/gemini-integration/TEXT-CHAT.md +133 -0
- package/templates/.claude/skills/gemini-integration/TROUBLESHOOTING.md +67 -0
- package/templates/.claude/skills/html-docs/SKILL.md +207 -207
- package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
- package/templates/.claude/skills/typesafe-jev/SKILL.md +149 -0
- package/templates/.claude/skills/vibe-docs/SKILL.md +242 -242
- package/templates/SISYO.md +37 -37
- package/templates/docs/99_progress/features.md +7 -7
- package/templates/docs/99_progress/handoff.md +19 -19
- package/templates/docs/99_progress/todo.md +15 -15
- package/templates/docs/MAP.md +26 -26
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
Symptom → cause → fix. Check the **live** model first: `.env` on the server overrides code
|
|
4
|
+
defaults and deploy does not rewrite it. Verify via the token / health endpoint `model` field.
|
|
5
|
+
|
|
6
|
+
## Request errors (400)
|
|
7
|
+
|
|
8
|
+
| Symptom | Cause | Fix |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| 400 mentioning `thinking_budget` | 3.5+/3.8 dropped it | `thinking_config={"thinking_level": ...}` |
|
|
11
|
+
| 400 `thinking_level=minimal` | 3.7/3.8 Flash (and 3.8 Live Extended Thinking) reject `minimal` | `low` there; 3.5 Flash-Lite and 3.1 Live accept `minimal` |
|
|
12
|
+
| Live setup rejected / 400 mentioning `thinking_level` on `gemini-3.8-live` | 3.8 Live has no `thinking_level` | Omit `thinking_config` for the 3.8 family |
|
|
13
|
+
| 400 on `temperature` / `top_p` / `top_k` / `candidate_count` | Deprecated on 3.x | Remove them |
|
|
14
|
+
| 400 "function response … id/name" on the next turn | A `FunctionResponse` without `id` + `name`, or a call left unanswered | Accumulate calls across chunks; answer every call; include id + name |
|
|
15
|
+
| Multi-turn tool calls fail after a model bump | Old `google-genai` without thought signatures | `google-genai>=2.0.0` |
|
|
16
|
+
|
|
17
|
+
## Chat behaviour
|
|
18
|
+
|
|
19
|
+
| Symptom | Cause | Fix |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Reply ignores earlier tool results | One `send_message_stream` per response | Send all responses as ONE `parts` list |
|
|
22
|
+
| `chunk.text` raises / empty | Chunk carries only function calls | `_safe_get_text()` wrapper |
|
|
23
|
+
| Chat got slower after bump | `medium` (3.7/3.8 default), `low` pinned on 3.5 Flash-Lite (its default is `minimal`), or generate model on the chat path | `minimal` on 3.5 Flash-Lite; chat/rerank on flash-lite |
|
|
24
|
+
| LLM rerank takes seconds | Output JSON echoes a long chunk id per candidate | Number candidates `[0]…[n-1]`, map back by index (see `RAG-EMBEDDING.md`) |
|
|
25
|
+
| `[Echo] …` replies in prod | `GEMINI_API_KEY` empty on that box | Set the key; echo is the stub mode |
|
|
26
|
+
| Embeddings: N chunks → 1 vector | Passed a list to `contents` | Embed one text per call |
|
|
27
|
+
| Search results nonsense after embedding model change | Vector space changed | Re-embed everything (`--recreate`) |
|
|
28
|
+
|
|
29
|
+
## Live voice
|
|
30
|
+
|
|
31
|
+
| Symptom | Cause | Fix |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| "Connecting…" forever, no error | `connect()` never resolves; or stale FE bundle | 15 s timeout race; log a build marker on `connect()`; hard reload |
|
|
34
|
+
| Socket closed **1007** right after mic start | `sendRealtimeInput({ media })` on 3.1 | Use `{ audio }` (3.x docs only list `audio`) |
|
|
35
|
+
| 3.8 id behaves like 2.5 (1007, text ignored, no thinking) | Code branches on `"3.1" in model` | Branch on the model family (`2.5` / `3.1` / else 3.8) |
|
|
36
|
+
| Setup error mentioning `proactivity` / `enable_affective_dialog` on 3.8 | Always on / removed on 3.8 | Drop those keys |
|
|
37
|
+
| Token endpoint 402 | Billing / Live API not enabled for the key | Enable in AI Studio; log exception on mint |
|
|
38
|
+
| Token endpoint 404 "Agent not found" for a real agent | Router caught `LookupError` base (KeyError/IndexError inside) or stale negative cache | Catch a dedicated `AgentNotFound`; short negative-cache TTL; `ConsistentRead` |
|
|
39
|
+
| Token endpoint 403 | `voice_enabled` false on agent or plan | Expected — hide the voice toggle in the UI |
|
|
40
|
+
| Connected but silent | `AudioContext` suspended (not from a user gesture) | `await ctx.resume()` after creating it |
|
|
41
|
+
| Wrong voice every other session | FE didn't pass `speechConfig` on `connect` | Pass `voice_name` from the token response |
|
|
42
|
+
| Model goes silent after a tool call | BLOCKING call (3.1, or `behavior: BLOCKING` on 3.8); a tool threw and never answered | Respond `{ error }` for failed tools, all in one `sendToolResponse` |
|
|
43
|
+
| 3.8 answers before the search result arrives / makes things up | Tools are `NON_BLOCKING` by default — the model keeps talking | Declare every tool `behavior: BLOCKING` |
|
|
44
|
+
| 3.8 ran the tool but never answered | NON_BLOCKING filler leaked into the mic → server cancelled the call; or noise/echo during a BLOCKING call → auto-cancel | Tools BLOCKING, no spoken filler, stream silence instead of the mic during the tool round-trip, request `echoCancellation` |
|
|
45
|
+
| 3.8 searches again and again with rephrased queries | Empty or unexplained tool result | Return `status: no_results`, `retryable: false`, `guidance`; prompt: "never more than two searches in a row" |
|
|
46
|
+
| Error / odd reply after answering a tool call the customer talked over | Server cancelled it (`toolCallCancellation.ids`) | Drop responses for cancelled ids |
|
|
47
|
+
| 3.8 call doesn't hang up after goodbye (grace timer fires) | Customer kept talking → the BLOCKING `end_conversation` call was auto-cancelled | Mute the mic before the tool round-trip |
|
|
48
|
+
| No farewell, UI stuck after `end_conversation` | Disconnected inside the tool handler | Mute mic, send response, wait `turnComplete` + audio drain, then close |
|
|
49
|
+
| Greets in the wrong language | Greeting text sent as a user turn → model mirrors it | Send a `[Session start]` control turn; put the greeting rule in the system prompt |
|
|
50
|
+
| Only first audio part plays | 3.x sends multiple parts per event | Loop over all `parts` |
|
|
51
|
+
| AI keeps talking for seconds after the customer interrupts | `interrupted` only reset `nextStartTime`; buffers already scheduled keep playing (audio arrives faster than real time) | `stop()` every scheduled `AudioBufferSourceNode` on `interrupted`; drop chunks still decoding |
|
|
52
|
+
| Replies switch to the wrong language after a barge-in | Prompt rule "switch to the customer's language" + a misheard overlapping fragment | `RESPOND IN {LANG}. YOU MUST RESPOND UNMISTAKABLY IN {LANG}.`; switch only on an explicit request; stop playback on `interrupted` |
|
|
53
|
+
| Waiting filler sounds unnatural / only said sometimes | Model-spoken filler (and example phrases in the prompt get parroted) | Don't use one: BLOCKING tools + a "fetching data" UI state |
|
|
54
|
+
| Mid-session text ignored on 3.1 | Used `sendClientContent` | `sendRealtimeInput({ text })` (the documented text path on 3.x) |
|
|
55
|
+
| Voice sample button slow / times out | TTS on demand | Pre-generate at startup, cache on S3, key by version |
|
|
56
|
+
|
|
57
|
+
## Rollback values
|
|
58
|
+
|
|
59
|
+
| Key | Rollback |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `GEMINI_CHAT_MODEL` | `gemini-3.1-flash-lite` (`minimal`/`low` valid there) — the `-preview` id was shut down 2026-05-25 |
|
|
62
|
+
| `GEMINI_CHAT_THINKING_LEVEL` | `low` (deeper but slower than `minimal`) |
|
|
63
|
+
| `GEMINI_LIVE_MODEL` | `gemini-3.1-flash-live-preview` (sync tools, `thinking_level=minimal`); last resort `gemini-2.5-flash-native-audio-preview-12-2025` (access limited since 2026-09-18) |
|
|
64
|
+
| `GEMINI_TTS_MODEL` | 2.5 TTS access limited since 2026-09-18 — successors `gemini-3.8-flash-lite-tts` / `gemini-3.8-flash-tts` |
|
|
65
|
+
| `GEMINI_EMBEDDING_MODEL` | Previous model **plus** full re-embed — no hot rollback |
|
|
66
|
+
|
|
67
|
+
Always record the rollback + the date of the bump in `docs/09_integrations/gemini.md`.
|
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: html-docs
|
|
3
|
-
description: "Generate standalone, beautiful HTML documents styled with Tailwind CSS for developers or end-users to read. Use whenever the user asks for a document, report, guide, handbook, release note, onboarding, README-as-HTML, API reference, design spec, or any deliverable that should look polished in a browser. Output is a single self-contained .html file with colorful modern design, rounded corners, gradient accents and great typography."
|
|
4
|
-
license: MIT
|
|
5
|
-
metadata:
|
|
6
|
-
author: HoangThang
|
|
7
|
-
version: "1.0.0"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# HTML Docs
|
|
11
|
-
|
|
12
|
-
Single-file HTML doc, Tailwind via CDN, no build step. Audience: humans (devs, PM, clients, users).
|
|
13
|
-
|
|
14
|
-
## When to trigger
|
|
15
|
-
|
|
16
|
-
User asks for: HTML doc/report/handbook/guide/release-note/changelog, API reference page, onboarding page, "export to HTML", "render as webpage", any reader-facing deliverable where visual polish matters.
|
|
17
|
-
|
|
18
|
-
Do NOT use for: internal markdown in `docs/` (that's `vibe-docs`), READMEs, raw `.md` notes.
|
|
19
|
-
|
|
20
|
-
## Hard rules
|
|
21
|
-
|
|
22
|
-
- One `.html` file. No external CSS/JS files.
|
|
23
|
-
- Tailwind CDN: `<script src="https://cdn.tailwindcss.com"></script>`.
|
|
24
|
-
- Optional Inter font via Google Fonts `<link>`.
|
|
25
|
-
- Responsive, mobile-first. Container width: `max-w-7xl` (≈1280px) for docs with sticky TOC and diagrams/tables — this avoids huge empty gutters on 1440px+ screens. Use `max-w-4xl` only for pure reading docs with no sidebar.
|
|
26
|
-
- Vietnamese `<html lang="vi">` by default unless content is English.
|
|
27
|
-
- No emoji unless requested — use inline SVG (Heroicons) or shape divs.
|
|
28
|
-
- Save to `docs/html/[kebab-name].html` by default.
|
|
29
|
-
|
|
30
|
-
## Defaults (use these classes unless reason to change)
|
|
31
|
-
|
|
32
|
-
- **Radius**: `rounded-2xl` for cards/sections, `rounded-3xl` for hero/big callouts, `rounded-xl` for code blocks, `rounded-full` for pills/badges.
|
|
33
|
-
- **Padding**: `p-6 md:p-8` inside cards, `py-12 md:py-20` for sections, `px-6` for page gutter.
|
|
34
|
-
- **Border**: `border border-slate-200` for definition on white cards.
|
|
35
|
-
- **Shadow**: `shadow-sm` (subtle) or `shadow-lg shadow-indigo-500/10` (colored soft).
|
|
36
|
-
- **Body text**: `text-slate-700 leading-relaxed`.
|
|
37
|
-
- **Headings**: `font-bold tracking-tight text-slate-900`, `text-4xl md:text-5xl` h1, `text-2xl md:text-3xl` h2, `text-xl` h3.
|
|
38
|
-
- **Background**: `bg-slate-50` (or `bg-stone-50` for warm themes).
|
|
39
|
-
- **Smooth scroll** for TOC: `html { scroll-behavior: smooth; }`.
|
|
40
|
-
|
|
41
|
-
## Color palettes (pick one per doc — bg / primary / accent)
|
|
42
|
-
|
|
43
|
-
| Theme | Hero gradient | Primary | Accent |
|
|
44
|
-
| ------------------ | -------------------------------------------- | ------------- | ------------ |
|
|
45
|
-
| Indigo/Violet/Pink | `from-indigo-600 via-purple-600 to-pink-500` | `indigo-600` | `violet-500` |
|
|
46
|
-
| Emerald/Teal | `from-emerald-500 via-teal-500 to-cyan-500` | `emerald-600` | `teal-500` |
|
|
47
|
-
| Rose/Amber | `from-rose-500 via-orange-500 to-amber-500` | `rose-600` | `amber-500` |
|
|
48
|
-
| Sky/Cyan | `from-sky-500 via-cyan-500 to-teal-400` | `sky-600` | `cyan-500` |
|
|
49
|
-
| Fuchsia/Pink | `from-fuchsia-600 via-pink-500 to-rose-500` | `fuchsia-600` | `pink-500` |
|
|
50
|
-
|
|
51
|
-
One palette per document. Use the hero gradient on the top banner; use primary for links/buttons; use accent sparingly.
|
|
52
|
-
|
|
53
|
-
## Component vocabulary
|
|
54
|
-
|
|
55
|
-
Default to these — agent already knows Tailwind, just compose:
|
|
56
|
-
|
|
57
|
-
- **Hero**: full-bleed gradient bg, white text, eyebrow pill (`bg-white/15 backdrop-blur`), big h1, subtitle, optional blurred decoration circles.
|
|
58
|
-
- **TOC**: ~200px sidebar, `lg:sticky lg:top-8`, wrap in `<details open>` so users can collapse it. See "TOC collapsible pattern" below.
|
|
59
|
-
- **Section card**: white bg, `rounded-2xl border shadow-sm`, padded.
|
|
60
|
-
- **Callout** (tip/warn/info): tinted bg + left border — `bg-amber-50 border-l-4 border-amber-400` (warn), `bg-sky-50 border-sky-400` (info), `bg-emerald-50 border-emerald-400` (tip), `bg-rose-50 border-rose-400` (danger).
|
|
61
|
-
- **Code block**: `bg-slate-900 text-slate-100 rounded-xl p-4 text-sm overflow-x-auto`.
|
|
62
|
-
- **Badge/pill**: `inline-flex px-3 py-1 rounded-full text-xs font-medium`, tinted bg.
|
|
63
|
-
- **Method pill** (API): GET→emerald, POST→indigo, PUT→amber, DELETE→rose, PATCH→violet.
|
|
64
|
-
- **Stat card**: large number `text-4xl font-extrabold`, label below, gradient or solid bg.
|
|
65
|
-
- **Step list**: gradient circle index + content alongside.
|
|
66
|
-
- **Table**: `rounded-xl overflow-hidden`, `even:bg-slate-50`, wrap in `overflow-x-auto`.
|
|
67
|
-
- **Footer**: `border-t py-8 text-center text-sm text-slate-500`.
|
|
68
|
-
|
|
69
|
-
## Special bits worth showing
|
|
70
|
-
|
|
71
|
-
### Gradient text utility
|
|
72
|
-
|
|
73
|
-
```css
|
|
74
|
-
.gradient-text {
|
|
75
|
-
background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
|
|
76
|
-
-webkit-background-clip: text;
|
|
77
|
-
background-clip: text;
|
|
78
|
-
color: transparent;
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Hero with decoration blobs
|
|
83
|
-
|
|
84
|
-
```html
|
|
85
|
-
<header
|
|
86
|
-
class="relative overflow-hidden bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-500 text-white"
|
|
87
|
-
>
|
|
88
|
-
<div class="max-w-5xl mx-auto px-6 py-20 md:py-28">...</div>
|
|
89
|
-
<div
|
|
90
|
-
class="absolute -bottom-24 -right-24 w-72 h-72 rounded-full bg-white/10 blur-3xl"
|
|
91
|
-
></div>
|
|
92
|
-
<div
|
|
93
|
-
class="absolute -top-24 -left-24 w-72 h-72 rounded-full bg-pink-300/30 blur-3xl"
|
|
94
|
-
></div>
|
|
95
|
-
</header>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Page layout grid (sticky TOC + content)
|
|
99
|
-
|
|
100
|
-
`grid lg:grid-cols-[200px_1fr] gap-10` inside `max-w-7xl mx-auto px-6 py-12`. TOC ≈200px (readable but not greedy); container `max-w-7xl` keeps margins tight on big monitors. Apply the same `max-w-7xl` to the hero inner wrapper and footer so the whole page reads consistently. Don't drop below ~180px for the TOC — labels start truncating awkwardly.
|
|
101
|
-
|
|
102
|
-
### TOC collapsible pattern
|
|
103
|
-
|
|
104
|
-
Use `<details open>` + custom chevron — works without JavaScript, rotates the chevron via `group-open:rotate-180`. Keep link labels short (1-3 words) so they don't wrap in the narrow column; add `truncate` defensively.
|
|
105
|
-
|
|
106
|
-
```html
|
|
107
|
-
<aside class="lg:sticky lg:top-8 self-start">
|
|
108
|
-
<details open class="group">
|
|
109
|
-
<summary
|
|
110
|
-
class="cursor-pointer list-none flex items-center justify-between gap-2 text-xs uppercase tracking-widest text-slate-500 font-semibold mb-2 py-1 px-1 rounded hover:bg-slate-100 select-none"
|
|
111
|
-
>
|
|
112
|
-
<span>Mục lục</span>
|
|
113
|
-
<svg
|
|
114
|
-
class="w-3.5 h-3.5 text-slate-400 transition-transform group-open:rotate-180"
|
|
115
|
-
fill="none"
|
|
116
|
-
viewBox="0 0 20 20"
|
|
117
|
-
stroke="currentColor"
|
|
118
|
-
stroke-width="2"
|
|
119
|
-
>
|
|
120
|
-
<path d="M6 8l4 4 4-4" />
|
|
121
|
-
</svg>
|
|
122
|
-
</summary>
|
|
123
|
-
<nav class="space-y-1.5 text-xs mt-2 border-l border-slate-200 pl-3">
|
|
124
|
-
<a
|
|
125
|
-
href="#section-1"
|
|
126
|
-
class="block text-slate-600 hover:text-indigo-600 truncate"
|
|
127
|
-
>1. Short label</a
|
|
128
|
-
>
|
|
129
|
-
<!-- … -->
|
|
130
|
-
</nav>
|
|
131
|
-
</details>
|
|
132
|
-
</aside>
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Minimum boilerplate
|
|
136
|
-
|
|
137
|
-
```html
|
|
138
|
-
<!doctype html>
|
|
139
|
-
<html lang="vi">
|
|
140
|
-
<head>
|
|
141
|
-
<meta charset="utf-8" />
|
|
142
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
143
|
-
<title>[Title]</title>
|
|
144
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
145
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
146
|
-
<link
|
|
147
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap"
|
|
148
|
-
rel="stylesheet"
|
|
149
|
-
/>
|
|
150
|
-
<style>
|
|
151
|
-
html {
|
|
152
|
-
font-family: "Inter", system-ui, sans-serif;
|
|
153
|
-
scroll-behavior: smooth;
|
|
154
|
-
}
|
|
155
|
-
</style>
|
|
156
|
-
</head>
|
|
157
|
-
<body class="bg-slate-50 text-slate-700 antialiased">
|
|
158
|
-
<!-- hero / main / footer -->
|
|
159
|
-
</body>
|
|
160
|
-
</html>
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Content patterns by doc type
|
|
164
|
-
|
|
165
|
-
- **Release notes**: hero with version pill, version cards stacked vertically, change-type pills (`new`=emerald, `improved`=sky, `fixed`=amber, `breaking`=rose).
|
|
166
|
-
- **API reference**: sticky TOC by resource, endpoint cards with method pill, request/response in `<details>` for no-JS toggle.
|
|
167
|
-
- **Onboarding / handbook**: hero + CTA, numbered step cards with gradient circle index, closing "next steps" card.
|
|
168
|
-
- **Report / dashboard**: stat grid up top, SVG charts inline, alternating-row tables.
|
|
169
|
-
- **Feature spec / design doc**: status badge (draft/approved/shipped), sections — Problem / Goals / Non-goals / Approach / Open questions / Risks (callouts).
|
|
170
|
-
|
|
171
|
-
## Anti-patterns
|
|
172
|
-
|
|
173
|
-
- Sharp corners (`rounded-none`) — always at least `rounded-xl`.
|
|
174
|
-
- Pure white with no accent — feels unfinished.
|
|
175
|
-
- Walls of paragraph text — break with cards/callouts/lists.
|
|
176
|
-
- Inline `style="…"` when a Tailwind class exists.
|
|
177
|
-
- Multiple files, build step, heavy JS framework.
|
|
178
|
-
- External images without fallback — prefer SVG/gradient placeholder.
|
|
179
|
-
- `<table>` used for layout — use grid/flex.
|
|
180
|
-
|
|
181
|
-
## Quality checklist
|
|
182
|
-
|
|
183
|
-
- [ ] Opens via `file://` with no console errors
|
|
184
|
-
- [ ] Responsive at 375px
|
|
185
|
-
- [ ] TOC anchors all resolve
|
|
186
|
-
- [ ] Code blocks scroll horizontally
|
|
187
|
-
- [ ] Tables wrap in `overflow-x-auto`
|
|
188
|
-
- [ ] Reading width capped
|
|
189
|
-
- [ ] One palette, used consistently
|
|
190
|
-
- [ ] Title + date + author/source visible
|
|
191
|
-
|
|
192
|
-
## Output convention
|
|
193
|
-
|
|
194
|
-
1. Path: `docs/html/[kebab-name].html` (confirm if unclear).
|
|
195
|
-
2. After writing: log to `docs/99_progress/features.md` if it's a deliverable; add one-line entry to `docs/MAP.md`.
|
|
196
|
-
3. Tell user the file path — opens directly, no server needed (`open docs/html/foo.html` on macOS).
|
|
197
|
-
|
|
198
|
-
## Relation to vibe-docs
|
|
199
|
-
|
|
200
|
-
| | vibe-docs | html-docs |
|
|
201
|
-
| -------- | ------------------------------------------ | ----------------------------------------- |
|
|
202
|
-
| Audience | Claude + devs | Humans (devs, PM, clients, users) |
|
|
203
|
-
| Format | Compact `.md`, token-efficient | Polished HTML, visual |
|
|
204
|
-
| Location | `docs/MAP.md`, `_summary.md`, detail `.md` | `docs/html/*.html` |
|
|
205
|
-
| Trigger | Code/feature changes | Explicit "make this readable / shareable" |
|
|
206
|
-
|
|
207
|
-
Typical flow: `vibe-docs` keeps `docs/01_requirements/[feature].md` up to date; when user asks "make this into an HTML page for the team", `html-docs` reads that spec and renders the polished version.
|
|
1
|
+
---
|
|
2
|
+
name: html-docs
|
|
3
|
+
description: "Generate standalone, beautiful HTML documents styled with Tailwind CSS for developers or end-users to read. Use whenever the user asks for a document, report, guide, handbook, release note, onboarding, README-as-HTML, API reference, design spec, or any deliverable that should look polished in a browser. Output is a single self-contained .html file with colorful modern design, rounded corners, gradient accents and great typography."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: HoangThang
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# HTML Docs
|
|
11
|
+
|
|
12
|
+
Single-file HTML doc, Tailwind via CDN, no build step. Audience: humans (devs, PM, clients, users).
|
|
13
|
+
|
|
14
|
+
## When to trigger
|
|
15
|
+
|
|
16
|
+
User asks for: HTML doc/report/handbook/guide/release-note/changelog, API reference page, onboarding page, "export to HTML", "render as webpage", any reader-facing deliverable where visual polish matters.
|
|
17
|
+
|
|
18
|
+
Do NOT use for: internal markdown in `docs/` (that's `vibe-docs`), READMEs, raw `.md` notes.
|
|
19
|
+
|
|
20
|
+
## Hard rules
|
|
21
|
+
|
|
22
|
+
- One `.html` file. No external CSS/JS files.
|
|
23
|
+
- Tailwind CDN: `<script src="https://cdn.tailwindcss.com"></script>`.
|
|
24
|
+
- Optional Inter font via Google Fonts `<link>`.
|
|
25
|
+
- Responsive, mobile-first. Container width: `max-w-7xl` (≈1280px) for docs with sticky TOC and diagrams/tables — this avoids huge empty gutters on 1440px+ screens. Use `max-w-4xl` only for pure reading docs with no sidebar.
|
|
26
|
+
- Vietnamese `<html lang="vi">` by default unless content is English.
|
|
27
|
+
- No emoji unless requested — use inline SVG (Heroicons) or shape divs.
|
|
28
|
+
- Save to `docs/html/[kebab-name].html` by default.
|
|
29
|
+
|
|
30
|
+
## Defaults (use these classes unless reason to change)
|
|
31
|
+
|
|
32
|
+
- **Radius**: `rounded-2xl` for cards/sections, `rounded-3xl` for hero/big callouts, `rounded-xl` for code blocks, `rounded-full` for pills/badges.
|
|
33
|
+
- **Padding**: `p-6 md:p-8` inside cards, `py-12 md:py-20` for sections, `px-6` for page gutter.
|
|
34
|
+
- **Border**: `border border-slate-200` for definition on white cards.
|
|
35
|
+
- **Shadow**: `shadow-sm` (subtle) or `shadow-lg shadow-indigo-500/10` (colored soft).
|
|
36
|
+
- **Body text**: `text-slate-700 leading-relaxed`.
|
|
37
|
+
- **Headings**: `font-bold tracking-tight text-slate-900`, `text-4xl md:text-5xl` h1, `text-2xl md:text-3xl` h2, `text-xl` h3.
|
|
38
|
+
- **Background**: `bg-slate-50` (or `bg-stone-50` for warm themes).
|
|
39
|
+
- **Smooth scroll** for TOC: `html { scroll-behavior: smooth; }`.
|
|
40
|
+
|
|
41
|
+
## Color palettes (pick one per doc — bg / primary / accent)
|
|
42
|
+
|
|
43
|
+
| Theme | Hero gradient | Primary | Accent |
|
|
44
|
+
| ------------------ | -------------------------------------------- | ------------- | ------------ |
|
|
45
|
+
| Indigo/Violet/Pink | `from-indigo-600 via-purple-600 to-pink-500` | `indigo-600` | `violet-500` |
|
|
46
|
+
| Emerald/Teal | `from-emerald-500 via-teal-500 to-cyan-500` | `emerald-600` | `teal-500` |
|
|
47
|
+
| Rose/Amber | `from-rose-500 via-orange-500 to-amber-500` | `rose-600` | `amber-500` |
|
|
48
|
+
| Sky/Cyan | `from-sky-500 via-cyan-500 to-teal-400` | `sky-600` | `cyan-500` |
|
|
49
|
+
| Fuchsia/Pink | `from-fuchsia-600 via-pink-500 to-rose-500` | `fuchsia-600` | `pink-500` |
|
|
50
|
+
|
|
51
|
+
One palette per document. Use the hero gradient on the top banner; use primary for links/buttons; use accent sparingly.
|
|
52
|
+
|
|
53
|
+
## Component vocabulary
|
|
54
|
+
|
|
55
|
+
Default to these — agent already knows Tailwind, just compose:
|
|
56
|
+
|
|
57
|
+
- **Hero**: full-bleed gradient bg, white text, eyebrow pill (`bg-white/15 backdrop-blur`), big h1, subtitle, optional blurred decoration circles.
|
|
58
|
+
- **TOC**: ~200px sidebar, `lg:sticky lg:top-8`, wrap in `<details open>` so users can collapse it. See "TOC collapsible pattern" below.
|
|
59
|
+
- **Section card**: white bg, `rounded-2xl border shadow-sm`, padded.
|
|
60
|
+
- **Callout** (tip/warn/info): tinted bg + left border — `bg-amber-50 border-l-4 border-amber-400` (warn), `bg-sky-50 border-sky-400` (info), `bg-emerald-50 border-emerald-400` (tip), `bg-rose-50 border-rose-400` (danger).
|
|
61
|
+
- **Code block**: `bg-slate-900 text-slate-100 rounded-xl p-4 text-sm overflow-x-auto`.
|
|
62
|
+
- **Badge/pill**: `inline-flex px-3 py-1 rounded-full text-xs font-medium`, tinted bg.
|
|
63
|
+
- **Method pill** (API): GET→emerald, POST→indigo, PUT→amber, DELETE→rose, PATCH→violet.
|
|
64
|
+
- **Stat card**: large number `text-4xl font-extrabold`, label below, gradient or solid bg.
|
|
65
|
+
- **Step list**: gradient circle index + content alongside.
|
|
66
|
+
- **Table**: `rounded-xl overflow-hidden`, `even:bg-slate-50`, wrap in `overflow-x-auto`.
|
|
67
|
+
- **Footer**: `border-t py-8 text-center text-sm text-slate-500`.
|
|
68
|
+
|
|
69
|
+
## Special bits worth showing
|
|
70
|
+
|
|
71
|
+
### Gradient text utility
|
|
72
|
+
|
|
73
|
+
```css
|
|
74
|
+
.gradient-text {
|
|
75
|
+
background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
|
|
76
|
+
-webkit-background-clip: text;
|
|
77
|
+
background-clip: text;
|
|
78
|
+
color: transparent;
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Hero with decoration blobs
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<header
|
|
86
|
+
class="relative overflow-hidden bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-500 text-white"
|
|
87
|
+
>
|
|
88
|
+
<div class="max-w-5xl mx-auto px-6 py-20 md:py-28">...</div>
|
|
89
|
+
<div
|
|
90
|
+
class="absolute -bottom-24 -right-24 w-72 h-72 rounded-full bg-white/10 blur-3xl"
|
|
91
|
+
></div>
|
|
92
|
+
<div
|
|
93
|
+
class="absolute -top-24 -left-24 w-72 h-72 rounded-full bg-pink-300/30 blur-3xl"
|
|
94
|
+
></div>
|
|
95
|
+
</header>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Page layout grid (sticky TOC + content)
|
|
99
|
+
|
|
100
|
+
`grid lg:grid-cols-[200px_1fr] gap-10` inside `max-w-7xl mx-auto px-6 py-12`. TOC ≈200px (readable but not greedy); container `max-w-7xl` keeps margins tight on big monitors. Apply the same `max-w-7xl` to the hero inner wrapper and footer so the whole page reads consistently. Don't drop below ~180px for the TOC — labels start truncating awkwardly.
|
|
101
|
+
|
|
102
|
+
### TOC collapsible pattern
|
|
103
|
+
|
|
104
|
+
Use `<details open>` + custom chevron — works without JavaScript, rotates the chevron via `group-open:rotate-180`. Keep link labels short (1-3 words) so they don't wrap in the narrow column; add `truncate` defensively.
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<aside class="lg:sticky lg:top-8 self-start">
|
|
108
|
+
<details open class="group">
|
|
109
|
+
<summary
|
|
110
|
+
class="cursor-pointer list-none flex items-center justify-between gap-2 text-xs uppercase tracking-widest text-slate-500 font-semibold mb-2 py-1 px-1 rounded hover:bg-slate-100 select-none"
|
|
111
|
+
>
|
|
112
|
+
<span>Mục lục</span>
|
|
113
|
+
<svg
|
|
114
|
+
class="w-3.5 h-3.5 text-slate-400 transition-transform group-open:rotate-180"
|
|
115
|
+
fill="none"
|
|
116
|
+
viewBox="0 0 20 20"
|
|
117
|
+
stroke="currentColor"
|
|
118
|
+
stroke-width="2"
|
|
119
|
+
>
|
|
120
|
+
<path d="M6 8l4 4 4-4" />
|
|
121
|
+
</svg>
|
|
122
|
+
</summary>
|
|
123
|
+
<nav class="space-y-1.5 text-xs mt-2 border-l border-slate-200 pl-3">
|
|
124
|
+
<a
|
|
125
|
+
href="#section-1"
|
|
126
|
+
class="block text-slate-600 hover:text-indigo-600 truncate"
|
|
127
|
+
>1. Short label</a
|
|
128
|
+
>
|
|
129
|
+
<!-- … -->
|
|
130
|
+
</nav>
|
|
131
|
+
</details>
|
|
132
|
+
</aside>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Minimum boilerplate
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<!doctype html>
|
|
139
|
+
<html lang="vi">
|
|
140
|
+
<head>
|
|
141
|
+
<meta charset="utf-8" />
|
|
142
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
143
|
+
<title>[Title]</title>
|
|
144
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
145
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
146
|
+
<link
|
|
147
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap"
|
|
148
|
+
rel="stylesheet"
|
|
149
|
+
/>
|
|
150
|
+
<style>
|
|
151
|
+
html {
|
|
152
|
+
font-family: "Inter", system-ui, sans-serif;
|
|
153
|
+
scroll-behavior: smooth;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
156
|
+
</head>
|
|
157
|
+
<body class="bg-slate-50 text-slate-700 antialiased">
|
|
158
|
+
<!-- hero / main / footer -->
|
|
159
|
+
</body>
|
|
160
|
+
</html>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Content patterns by doc type
|
|
164
|
+
|
|
165
|
+
- **Release notes**: hero with version pill, version cards stacked vertically, change-type pills (`new`=emerald, `improved`=sky, `fixed`=amber, `breaking`=rose).
|
|
166
|
+
- **API reference**: sticky TOC by resource, endpoint cards with method pill, request/response in `<details>` for no-JS toggle.
|
|
167
|
+
- **Onboarding / handbook**: hero + CTA, numbered step cards with gradient circle index, closing "next steps" card.
|
|
168
|
+
- **Report / dashboard**: stat grid up top, SVG charts inline, alternating-row tables.
|
|
169
|
+
- **Feature spec / design doc**: status badge (draft/approved/shipped), sections — Problem / Goals / Non-goals / Approach / Open questions / Risks (callouts).
|
|
170
|
+
|
|
171
|
+
## Anti-patterns
|
|
172
|
+
|
|
173
|
+
- Sharp corners (`rounded-none`) — always at least `rounded-xl`.
|
|
174
|
+
- Pure white with no accent — feels unfinished.
|
|
175
|
+
- Walls of paragraph text — break with cards/callouts/lists.
|
|
176
|
+
- Inline `style="…"` when a Tailwind class exists.
|
|
177
|
+
- Multiple files, build step, heavy JS framework.
|
|
178
|
+
- External images without fallback — prefer SVG/gradient placeholder.
|
|
179
|
+
- `<table>` used for layout — use grid/flex.
|
|
180
|
+
|
|
181
|
+
## Quality checklist
|
|
182
|
+
|
|
183
|
+
- [ ] Opens via `file://` with no console errors
|
|
184
|
+
- [ ] Responsive at 375px
|
|
185
|
+
- [ ] TOC anchors all resolve
|
|
186
|
+
- [ ] Code blocks scroll horizontally
|
|
187
|
+
- [ ] Tables wrap in `overflow-x-auto`
|
|
188
|
+
- [ ] Reading width capped
|
|
189
|
+
- [ ] One palette, used consistently
|
|
190
|
+
- [ ] Title + date + author/source visible
|
|
191
|
+
|
|
192
|
+
## Output convention
|
|
193
|
+
|
|
194
|
+
1. Path: `docs/html/[kebab-name].html` (confirm if unclear).
|
|
195
|
+
2. After writing: log to `docs/99_progress/features.md` if it's a deliverable; add one-line entry to `docs/MAP.md`.
|
|
196
|
+
3. Tell user the file path — opens directly, no server needed (`open docs/html/foo.html` on macOS).
|
|
197
|
+
|
|
198
|
+
## Relation to vibe-docs
|
|
199
|
+
|
|
200
|
+
| | vibe-docs | html-docs |
|
|
201
|
+
| -------- | ------------------------------------------ | ----------------------------------------- |
|
|
202
|
+
| Audience | Claude + devs | Humans (devs, PM, clients, users) |
|
|
203
|
+
| Format | Compact `.md`, token-efficient | Polished HTML, visual |
|
|
204
|
+
| Location | `docs/MAP.md`, `_summary.md`, detail `.md` | `docs/html/*.html` |
|
|
205
|
+
| Trigger | Code/feature changes | Explicit "make this readable / shareable" |
|
|
206
|
+
|
|
207
|
+
Typical flow: `vibe-docs` keeps `docs/01_requirements/[feature].md` up to date; when user asks "make this into an HTML page for the team", `html-docs` reads that spec and renders the polished version.
|