@maccesar/aiskills 1.12.0 → 1.16.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/README.md +89 -9
- package/lib/cleanup.js +29 -0
- package/lib/commands/skills.js +110 -9
- package/lib/config.js +18 -9
- package/lib/installer.js +5 -3
- package/lib/symlink.js +45 -3
- package/lib/utils.js +41 -0
- package/package.json +2 -2
- package/skills/audit-codebase/SKILL.md +70 -0
- package/skills/audit-codebase/agents/openai.yaml +4 -0
- package/skills/audit-codebase/references/comprehensive-audit.md +220 -0
- package/skills/audit-codebase/references/report-format.md +119 -0
- package/skills/humaniza/SKILL.md +55 -4
- package/skills/humaniza/references/ai-patterns-es.md +40 -0
- package/skills/humaniza/references/checklist.md +9 -0
- package/skills/humaniza/references/examples.md +16 -0
- package/skills/humaniza/references/lexicon-es-mx.md +18 -0
- package/skills/humaniza/references/structures-es.md +132 -0
- package/skills/humaniza/scripts/check_ai_patterns.py +216 -0
- package/skills/refactoring-ui/SKILL.md +65 -29
- package/skills/refactoring-ui/references/05-motion.md +124 -0
- package/skills/refactoring-ui/references/06-dark-mode.md +117 -0
- package/skills/refactoring-ui/references/07-component-patterns.md +181 -0
- package/skills/session-log/SKILL.md +524 -0
- package/skills/session-log/evals/README.md +79 -0
- package/skills/session-log/evals/ab-ronda-1.md +115 -0
- package/skills/session-log/evals/ab-ronda-2.md +174 -0
- package/skills/session-log/evals/defecto-experimento.md +12 -0
- package/skills/session-log/evals/evals.json +147 -0
- package/skills/session-log/evals/trigger-eval.json +23 -0
- package/skills/session-log/references/file-layout.md +336 -0
- package/skills/session-log/references/verification.md +173 -0
- package/skills/stitch-showcase/SKILL.md +24 -232
- package/skills/stitch-showcase/references/07-theme-system.md +12 -0
- package/skills/stitch-showcase/references/08-type-detection.md +9 -1
- package/skills/stitch-showcase/references/10-component-standardization.md +25 -0
- package/skills/stitch-showcase/references/12-video-embedding.md +113 -0
- package/skills/stitch-showcase/references/13-language-detection.md +82 -0
- package/skills/stitch-showcase/references/14-troubleshooting-known-issues.md +122 -0
- package/skills/stitch-showcase/references/15-build-flags.md +71 -0
- package/skills/stitch-showcase/references/16-design-md-format.md +107 -0
- package/skills/stitch-showcase/references/index.html +25 -19
- package/skills/stitch-showcase/references/viewer.html +24 -12
- package/skills/stitch-showcase/scripts/__pycache__/build_showcase.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/component_utils.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/detect_components.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_catalog.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_text.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_zips.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/parse_design_md.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/slug_demangle.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/build_showcase.py +150 -10
- package/skills/stitch-showcase/scripts/parse_design_md.py +145 -12
- package/skills/stitch-showcase/scripts/slug_demangle.py +209 -0
- package/skills/vscode-extension-dev/SKILL.md +90 -41
- package/skills/vscode-extension-dev/references/api-additional.md +168 -0
- package/skills/vscode-extension-dev/references/api-progress.md +55 -0
- package/skills/vscode-extension-dev/references/api-quickpick.md +75 -0
- package/skills/vscode-extension-dev/references/api-secretstorage.md +57 -0
- package/skills/vscode-extension-dev/references/api-statusbar.md +38 -0
- package/skills/vscode-extension-dev/references/api-treeview.md +78 -0
- package/skills/vscode-extension-dev/references/api-webview.md +149 -0
- package/skills/vscode-extension-dev/references/architecture.md +67 -0
- package/skills/vscode-extension-dev/references/debugger.md +179 -0
- package/skills/vscode-extension-dev/references/lsp.md +175 -0
- package/skills/vscode-extension-dev/references/notebooks.md +208 -0
- package/skills/vscode-extension-dev/references/testing.md +208 -0
- package/skills/vscode-extension-dev/references/api-patterns.md +0 -625
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Dark Mode
|
|
2
|
+
|
|
3
|
+
> **Scope note**: *Refactoring UI* was written before dark mode was an industry default and does not address it explicitly. **However**, the book's HSL chapter (in `03-visual-treatment.md`) — handpicking shades by hue/saturation/lightness, not deriving them via `lighten()`/`darken()` — is exactly the foundation dark mode needs. This file extends those principles to a second color mode.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Don't Invert — Rebuild
|
|
8
|
+
|
|
9
|
+
Inverting a light theme produces a "negative" image: muddy colors, weird text contrast, accents that lose punch. Dark mode is its own design pass.
|
|
10
|
+
|
|
11
|
+
The bookkeeping change: every color token now has a **mode pair**. Plan for it from the start, even if you only ship light first.
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
:root {
|
|
15
|
+
--bg-canvas: hsl(220 14% 96%);
|
|
16
|
+
--bg-surface: hsl(0 0% 100%);
|
|
17
|
+
--text-primary: hsl(220 13% 18%);
|
|
18
|
+
--text-secondary: hsl(220 9% 46%);
|
|
19
|
+
--border: hsl(220 13% 91%);
|
|
20
|
+
--brand-500: hsl(217 91% 60%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:root[data-theme='dark'] {
|
|
24
|
+
--bg-canvas: hsl(220 13% 10%);
|
|
25
|
+
--bg-surface: hsl(220 13% 14%);
|
|
26
|
+
--text-primary: hsl(220 14% 96%);
|
|
27
|
+
--text-secondary: hsl(220 9% 65%);
|
|
28
|
+
--border: hsl(220 13% 22%);
|
|
29
|
+
--brand-500: hsl(217 91% 65%); /* nudged lighter for dark bg */
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Dark Backgrounds Aren't Black
|
|
34
|
+
|
|
35
|
+
Pure `#000` reads as a hole in the screen. Pull the lightness up to ~8–12%, keep a small amount of saturation, and lean slightly warm or cool depending on your brand.
|
|
36
|
+
|
|
37
|
+
| Backdrop | Lightness | Notes |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| App canvas (outermost) | 8–12% | Lowest layer — slightly tinted, not pure black |
|
|
40
|
+
| Surface (cards, panels) | 12–16% | One step above canvas — implies "raised" without a shadow |
|
|
41
|
+
| Elevated surface (modals, popovers) | 16–22% | Highest layer — even lighter |
|
|
42
|
+
|
|
43
|
+
The trick: in dark mode, **lighter = closer to the viewer**, the opposite of light mode. A higher elevation doesn't get a darker shadow — it gets a lighter surface.
|
|
44
|
+
|
|
45
|
+
## Text Contrast in Dark Mode
|
|
46
|
+
|
|
47
|
+
Pure white text on a near-black background is *too much* contrast — the text vibrates and reading becomes tiring at length.
|
|
48
|
+
|
|
49
|
+
- Primary text: ~96% lightness (slightly off-white) — e.g., `hsl(220 14% 96%)`
|
|
50
|
+
- Secondary text: ~65% lightness — significantly muted compared to light mode's secondary
|
|
51
|
+
- Tertiary / placeholder: ~45–50%
|
|
52
|
+
|
|
53
|
+
WCAG ratios still apply (4.5:1 small text, 3:1 large), and slightly off-white still passes against a near-black canvas with room to spare.
|
|
54
|
+
|
|
55
|
+
## Accent Colors Usually Need a Lightness Bump
|
|
56
|
+
|
|
57
|
+
A brand color tuned for white backgrounds often looks too dark and dim against a dark canvas. Most palettes need the accent **lightness raised 5–10%** for the dark variant.
|
|
58
|
+
|
|
59
|
+
Test against both backgrounds. If the brand color fails contrast in dark mode, derive a lighter variant rather than swapping for an unrelated color — keeps brand identity coherent.
|
|
60
|
+
|
|
61
|
+
## Shadows: Mostly Gone, Sometimes Inverted
|
|
62
|
+
|
|
63
|
+
Shadows are made of light obstruction. On a dark canvas, the absence of light is the canvas itself — a dark shadow on dark background is invisible.
|
|
64
|
+
|
|
65
|
+
Options:
|
|
66
|
+
|
|
67
|
+
1. **Skip shadows entirely**: use lighter surfaces and tinted borders to communicate elevation
|
|
68
|
+
2. **Top highlight**: an inset top border (lighter color) to show that the element catches the imagined light source, with no shadow below
|
|
69
|
+
3. **Very soft dark shadow**: works only when the element is on a lighter surface (e.g., a dropdown over the canvas) — large blur, low opacity
|
|
70
|
+
|
|
71
|
+
A `box-shadow: 0 2px 4px rgba(0,0,0,0.3)` that was crisp in light mode is invisible on a `hsl(220 13% 10%)` canvas. Recheck every shadow when adding dark mode.
|
|
72
|
+
|
|
73
|
+
## Images and Photos in Dark Mode
|
|
74
|
+
|
|
75
|
+
Photos with bright backgrounds (typically light themes) "blow out" against a dark canvas — they pop too hard. Two tactics:
|
|
76
|
+
|
|
77
|
+
- **Lower image brightness slightly** in dark mode (e.g., `filter: brightness(0.9)`) — only for decorative/hero images, never for content the user is reading
|
|
78
|
+
- **Frame with a subtle border** — separates the bright rectangle from the dark canvas without dimming the photo
|
|
79
|
+
|
|
80
|
+
Same principle for video posters and avatar images.
|
|
81
|
+
|
|
82
|
+
## SVG Icons and Logos
|
|
83
|
+
|
|
84
|
+
Single-color icons should be currentColor-driven so they pick up the mode's text color:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<svg fill="currentColor" ...>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Multi-color logos need a dark variant. Don't fake it with `filter: invert()` — colors land in the wrong hue and brand recognition suffers.
|
|
91
|
+
|
|
92
|
+
## Theme Toggle: Three Defaults
|
|
93
|
+
|
|
94
|
+
1. **Match system preference** (`prefers-color-scheme`) — best first-paint experience
|
|
95
|
+
2. **Respect explicit user override** — store in `localStorage`; persists across sessions
|
|
96
|
+
3. **Apply before first paint** — set the theme class on `<html>` from a tiny inline script in `<head>` BEFORE any rendering, to avoid a flash of the wrong theme
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<script>
|
|
100
|
+
(function () {
|
|
101
|
+
var stored = localStorage.getItem('theme');
|
|
102
|
+
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
103
|
+
var theme = stored || (prefersDark ? 'dark' : 'light');
|
|
104
|
+
document.documentElement.dataset.theme = theme;
|
|
105
|
+
})();
|
|
106
|
+
</script>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Anti-Patterns
|
|
110
|
+
|
|
111
|
+
- ❌ Pure black (`#000`) for the canvas — feels like a void, hurts at length
|
|
112
|
+
- ❌ Pure white text — vibrates against dark bg, tiring to read
|
|
113
|
+
- ❌ `filter: invert(1)` to "do" dark mode — produces wrong hues, breaks images
|
|
114
|
+
- ❌ Same brand color in both modes without checking contrast — fails WCAG silently
|
|
115
|
+
- ❌ Keeping every shadow from light mode unchanged — invisible against dark bg
|
|
116
|
+
- ❌ Theme toggle applied AFTER first paint — flash of opposite theme on every load
|
|
117
|
+
- ❌ Inverting photos and screenshots — colors shift unnaturally, recognition suffers
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Component Patterns: Modals, Forms, Tables
|
|
2
|
+
|
|
3
|
+
> **Scope note**: *Refactoring UI* covers button tiers and label patterns directly (see `02-page-mechanics.md`), but does not have dedicated chapters for modals, forms, or tables. This file applies the book's principles — hierarchy through weight/color, generous spacing, grouping by proximity, finishing with restraint — to these three common components.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Modals
|
|
8
|
+
|
|
9
|
+
### When to Use a Modal
|
|
10
|
+
|
|
11
|
+
- A focused decision that **blocks** the current task (confirm destructive action, complete a required step)
|
|
12
|
+
- Short content that doesn't deserve a full page
|
|
13
|
+
- Multi-step flows that should preserve the underlying context (the page behind the modal)
|
|
14
|
+
|
|
15
|
+
When **not** to use a modal:
|
|
16
|
+
|
|
17
|
+
- Anything the user might want to consult while doing the surrounding task — modals trap them
|
|
18
|
+
- Long content that scrolls — make it a page
|
|
19
|
+
- Anything that needs to be linkable — modals are stateless to the URL by default
|
|
20
|
+
|
|
21
|
+
### Layout
|
|
22
|
+
|
|
23
|
+
| Element | Rule |
|
|
24
|
+
|---|---|
|
|
25
|
+
| Width | Fixed pixel max (`max-width: 480px` typical) — never percentage |
|
|
26
|
+
| Vertical position | Anchored ~10–15% from the top of viewport, not centered — feels more stable |
|
|
27
|
+
| Backdrop | Semi-opaque dark overlay (~50–70% opacity) — darkens the page enough to focus attention |
|
|
28
|
+
| Padding | Generous — modal content is usually short; tight padding feels cramped |
|
|
29
|
+
| Close affordance | "Cancel" button in the footer AND an `×` in the top corner — keyboard users use Esc |
|
|
30
|
+
|
|
31
|
+
### Focus and Keyboard
|
|
32
|
+
|
|
33
|
+
Three keyboard requirements, all non-negotiable:
|
|
34
|
+
|
|
35
|
+
1. **Focus moves into the modal on open** — typically to the first interactive element, or the close button if the modal is informational
|
|
36
|
+
2. **Focus traps inside the modal** — Tab/Shift+Tab cycle through modal elements only, never leaking to the page behind
|
|
37
|
+
3. **Esc closes the modal** AND focus returns to the element that opened it
|
|
38
|
+
|
|
39
|
+
These are the table-stakes of accessibility for modals. Libraries like `focus-trap` or `@radix-ui/react-dialog` solve them — don't roll your own unless you must.
|
|
40
|
+
|
|
41
|
+
### Button Order
|
|
42
|
+
|
|
43
|
+
The primary action sits on the **right** in left-to-right UIs:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
[ Cancel ] [ Save changes ]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Destructive primary actions get an extra confirmation (a typed confirmation, or a secondary modal). Don't bury a destructive button next to a safe one.
|
|
50
|
+
|
|
51
|
+
## Forms
|
|
52
|
+
|
|
53
|
+
### Label Placement
|
|
54
|
+
|
|
55
|
+
Top-aligned labels are the default for almost every form:
|
|
56
|
+
|
|
57
|
+
- Fastest to scan top-to-bottom
|
|
58
|
+
- Work on narrow screens without reflow
|
|
59
|
+
- Easier to localize (labels grow in length across languages)
|
|
60
|
+
|
|
61
|
+
Left-aligned labels look formal but force the user's eye to zig-zag and break on mobile. Reserve for dense data-entry screens where users repeatedly fill the same form.
|
|
62
|
+
|
|
63
|
+
### Validation Timing
|
|
64
|
+
|
|
65
|
+
- **On blur** for individual fields — show the error after the user leaves the field, not while they're typing
|
|
66
|
+
- **On submit** for fields they haven't touched yet
|
|
67
|
+
- **On change** ONLY for fields where the answer is binary and visible (e.g., a password strength meter, a username availability check)
|
|
68
|
+
|
|
69
|
+
Inline validation while the user is mid-typing reads as the form fighting them.
|
|
70
|
+
|
|
71
|
+
### Error Display
|
|
72
|
+
|
|
73
|
+
A field in error state should have:
|
|
74
|
+
|
|
75
|
+
- A color change (red border, but not the *only* signal)
|
|
76
|
+
- A short message **below** the field, in the same color as the border
|
|
77
|
+
- An icon at the start of the message — color is not enough (≈8% of males can't distinguish red from green)
|
|
78
|
+
- The field's normal label and placeholder stay legible — don't replace them with the error
|
|
79
|
+
|
|
80
|
+
### Spacing Within a Form
|
|
81
|
+
|
|
82
|
+
Apply the Law of Proximity from `02-page-mechanics.md`:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
[Label]
|
|
86
|
+
[Input]
|
|
87
|
+
(small gap, ~8px)
|
|
88
|
+
[Helper text]
|
|
89
|
+
|
|
90
|
+
(large gap, ~24-32px to the next field group)
|
|
91
|
+
|
|
92
|
+
[Label]
|
|
93
|
+
[Input]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Label sits closer to its own input than to anything else. Each field group is clearly separated from the next.
|
|
97
|
+
|
|
98
|
+
### Button Placement
|
|
99
|
+
|
|
100
|
+
- **Single primary button** at the bottom left or center — never aligned right unless the form sits inside a modal (modals follow the modal rule)
|
|
101
|
+
- **Secondary "Cancel"** to the left of the primary
|
|
102
|
+
- Disable the submit button only when there are concrete errors — disabling it preemptively because the user "hasn't typed everything yet" leaves them guessing
|
|
103
|
+
|
|
104
|
+
### Required vs Optional
|
|
105
|
+
|
|
106
|
+
If most fields are required, mark only the **optional** ones — less noise overall. If most are optional, mark the required ones with `*`. Either system is fine — pick one and stay consistent.
|
|
107
|
+
|
|
108
|
+
## Tables
|
|
109
|
+
|
|
110
|
+
### Density Tiers
|
|
111
|
+
|
|
112
|
+
Pick a row density based on the user's job:
|
|
113
|
+
|
|
114
|
+
| Tier | Row height | Use |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| Comfortable | 56–64px | Marketing tables, dashboards seen occasionally |
|
|
117
|
+
| Default | 40–48px | Most app tables |
|
|
118
|
+
| Compact | 28–36px | Operator dashboards (CRM, admin, finance) where rows are scanned in bulk |
|
|
119
|
+
|
|
120
|
+
Don't go below 28px unless the data is genuinely homogeneous — eye fatigue scales with row count, not just total height.
|
|
121
|
+
|
|
122
|
+
### Alignment by Data Type
|
|
123
|
+
|
|
124
|
+
| Data type | Alignment | Reason |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| Text (names, labels) | Left | Default reading direction |
|
|
127
|
+
| Numbers (counts, money, percentages) | Right | Digits and decimals line up; magnitudes are scannable |
|
|
128
|
+
| Dates | Left or right consistent | Pick one and stick — comparing dates is easier with consistent alignment |
|
|
129
|
+
| Status / chips | Center inside their own column | Visually balanced when the chip is the only content |
|
|
130
|
+
| Actions (icons, kebabs) | Right | Out of the way of the data |
|
|
131
|
+
|
|
132
|
+
### Column Headers
|
|
133
|
+
|
|
134
|
+
Mirror the column's content alignment. A right-aligned numeric column gets a right-aligned header.
|
|
135
|
+
|
|
136
|
+
Sortable columns get an indicator (arrow up/down) AND show the active sort with stronger contrast — color alone isn't enough.
|
|
137
|
+
|
|
138
|
+
### Sticky Headers
|
|
139
|
+
|
|
140
|
+
For tables that scroll vertically inside their container, the header should stick. Two ways:
|
|
141
|
+
|
|
142
|
+
1. `position: sticky; top: 0;` on the `<thead>` — easiest, works inside scrollable containers
|
|
143
|
+
2. A second fixed header rendered above the scroll area — needed when the table itself scrolls in `<body>` (not its own container)
|
|
144
|
+
|
|
145
|
+
Sticky headers must have a solid (opaque) background, otherwise rows scrolling behind them show through.
|
|
146
|
+
|
|
147
|
+
### Row Hover and Selection
|
|
148
|
+
|
|
149
|
+
- Subtle row hover background (one shade-step on neutrals) — helps the eye track across wide tables
|
|
150
|
+
- Selection: a left-edge accent stripe **plus** a tinted background — selection should be obvious without screaming
|
|
151
|
+
- Don't animate row hover — adds latency to bulk scanning
|
|
152
|
+
|
|
153
|
+
### Empty Tables
|
|
154
|
+
|
|
155
|
+
Apply the empty-state rule from `04-polish.md`: don't just show "No data" centered in a blank rectangle. The empty state communicates what could go there and offers a way to start.
|
|
156
|
+
|
|
157
|
+
## Anti-Patterns
|
|
158
|
+
|
|
159
|
+
### Modals
|
|
160
|
+
|
|
161
|
+
- ❌ Centering vertically — feels unanchored
|
|
162
|
+
- ❌ No close affordance — Esc users can escape, mouse users get stuck
|
|
163
|
+
- ❌ Modals over modals (nested) — confusing back-stack
|
|
164
|
+
- ❌ Destructive action as primary button without confirmation step
|
|
165
|
+
- ❌ No focus trap — Tab leaks to the page behind
|
|
166
|
+
|
|
167
|
+
### Forms
|
|
168
|
+
|
|
169
|
+
- ❌ Placeholder as the only label — vanishes on focus, accessibility regression
|
|
170
|
+
- ❌ Inline validation on keystroke — fights the user
|
|
171
|
+
- ❌ Disabling the submit button without explaining why
|
|
172
|
+
- ❌ Red asterisks on every field — visual noise
|
|
173
|
+
- ❌ Forms wider than ~600px — eye tracking degrades
|
|
174
|
+
|
|
175
|
+
### Tables
|
|
176
|
+
|
|
177
|
+
- ❌ Centered text columns — slow to scan
|
|
178
|
+
- ❌ Left-aligned numeric columns — magnitudes hide
|
|
179
|
+
- ❌ Translucent sticky header — rows show through
|
|
180
|
+
- ❌ Row dividers AND row hover background — over-decorated
|
|
181
|
+
- ❌ A single fixed column width for every column — wastes space; let content determine width within sensible min/max
|