changes
This commit is contained in:
@@ -3,6 +3,3 @@ if status is-interactive
|
|||||||
end
|
end
|
||||||
|
|
||||||
fish_config theme choose "Catppuccin Mocha" --color-theme=dark
|
fish_config theme choose "Catppuccin Mocha" --color-theme=dark
|
||||||
|
|
||||||
# Added by codebase-memory-mcp install
|
|
||||||
export PATH="/home/alex/dotfiles/.local/bin:$PATH"
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# This file contains fish universal variable definitions.
|
# This file contains fish universal variable definitions.
|
||||||
# VERSION: 3.0
|
# VERSION: 3.0
|
||||||
|
SETUVAR OPENCODE_ENABLE_EXA:1
|
||||||
SETUVAR __fish_initialized:4300
|
SETUVAR __fish_initialized:4300
|
||||||
SETUVAR _fisher_catppuccin_2F_fish_files:\x7e/\x2econfig/fish/themes/Catppuccin\x20Frappe\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Macchiato\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Mocha\x2etheme\x1e\x7e/\x2econfig/fish/themes/static
|
SETUVAR _fisher_catppuccin_2F_fish_files:\x7e/\x2econfig/fish/themes/Catppuccin\x20Frappe\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Macchiato\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Mocha\x2etheme\x1e\x7e/\x2econfig/fish/themes/static
|
||||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
function c --wraps=opencode --description 'opencode (auto-starts tmux for visual subagent panes)'
|
|
||||||
set -l port (python -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1]); s.close()')
|
|
||||||
|
|
||||||
if not set -q TMUX
|
|
||||||
tmux new-session opencode --port $port $argv
|
|
||||||
else
|
|
||||||
opencode --port $port $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
function cc --wraps='opencode --continue' --description 'opencode --continue (auto-starts tmux for visual subagent panes)'
|
|
||||||
set -l port (python -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1]); s.close()')
|
|
||||||
|
|
||||||
if not set -q TMUX
|
|
||||||
tmux new-session opencode --port $port --continue $argv
|
|
||||||
else
|
|
||||||
opencode --port $port --continue $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -58,7 +58,7 @@ input-field {
|
|||||||
inner_color = rgba(49, 50, 68, 1.0)
|
inner_color = rgba(49, 50, 68, 1.0)
|
||||||
font_color = rgba(205, 214, 244, 1.0)
|
font_color = rgba(205, 214, 244, 1.0)
|
||||||
fade_on_empty = false
|
fade_on_empty = false
|
||||||
placeholder_text = <i>Touch YubiKey or enter password...</i>
|
placeholder_text = <i>...</i>
|
||||||
hide_input = false
|
hide_input = false
|
||||||
check_color = rgba(166, 227, 161, 1.0)
|
check_color = rgba(166, 227, 161, 1.0)
|
||||||
fail_color = rgba(243, 139, 168, 1.0)
|
fail_color = rgba(243, 139, 168, 1.0)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ require("lazy").setup({
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>e", vim.cmd.Ex)
|
vim.keymap.set("n", "<leader>e", vim.cmd.Ex)
|
||||||
vim.keymap.set("n", "<leader>ww", vim.cmd.w)
|
vim.keymap.set("n", "<leader>w", vim.cmd.w)
|
||||||
|
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "f22f66eb7c4d037ed523a78b27ee235b7bc9a1f4" },
|
|
||||||
"catppuccin": { "branch": "main", "commit": "12c004cde3f36cb1d57242f1e6aac46b09a0e5b4" },
|
"catppuccin": { "branch": "main", "commit": "12c004cde3f36cb1d57242f1e6aac46b09a0e5b4" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
@@ -18,10 +17,8 @@
|
|||||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" },
|
"nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
|
"nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
|
||||||
"opencode.nvim": { "branch": "main", "commit": "1088ee70dd997d785a1757d351c07407f0abfc9f" },
|
"pi.nvim": { "branch": "main", "commit": "761cb109ebd466784f219e6e3a43a28f6187d627" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"render-markdown.nvim": { "branch": "main", "commit": "e3c18ddd27a853f85a6f513a864cf4f2982b9f26" },
|
|
||||||
"snacks.nvim": { "branch": "main", "commit": "9912042fc8bca2209105526ac7534e9a0c2071b2" },
|
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }
|
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }
|
||||||
}
|
}
|
||||||
|
|||||||
77
.config/nvim/lua/plugins/pi.lua
Normal file
77
.config/nvim/lua/plugins/pi.lua
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
return {
|
||||||
|
"pablopunk/pi.nvim",
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("pi").setup(opts)
|
||||||
|
|
||||||
|
local state = {
|
||||||
|
buf = nil,
|
||||||
|
win = nil,
|
||||||
|
}
|
||||||
|
|
||||||
|
local function pane_width()
|
||||||
|
return math.max(50, math.floor(vim.o.columns * 0.35))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function style_pane(win)
|
||||||
|
if not win or not vim.api.nvim_win_is_valid(win) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
pcall(vim.api.nvim_win_set_width, win, pane_width())
|
||||||
|
vim.wo[win].number = false
|
||||||
|
vim.wo[win].relativenumber = false
|
||||||
|
vim.wo[win].signcolumn = "no"
|
||||||
|
vim.wo[win].winfixwidth = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function open_pi_pane()
|
||||||
|
if state.win and vim.api.nvim_win_is_valid(state.win) then
|
||||||
|
vim.api.nvim_set_current_win(state.win)
|
||||||
|
vim.cmd("startinsert")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd("botright vsplit")
|
||||||
|
state.win = vim.api.nvim_get_current_win()
|
||||||
|
style_pane(state.win)
|
||||||
|
|
||||||
|
if state.buf and vim.api.nvim_buf_is_valid(state.buf) then
|
||||||
|
vim.api.nvim_win_set_buf(state.win, state.buf)
|
||||||
|
else
|
||||||
|
vim.cmd("terminal pi")
|
||||||
|
state.buf = vim.api.nvim_get_current_buf()
|
||||||
|
vim.bo[state.buf].buflisted = false
|
||||||
|
vim.bo[state.buf].bufhidden = "hide"
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWipeout", "TermClose" }, {
|
||||||
|
buffer = state.buf,
|
||||||
|
callback = function()
|
||||||
|
state.buf = nil
|
||||||
|
state.win = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
style_pane(state.win)
|
||||||
|
vim.cmd("startinsert")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function toggle_pi_pane()
|
||||||
|
if state.win and vim.api.nvim_win_is_valid(state.win) then
|
||||||
|
vim.api.nvim_win_close(state.win, true)
|
||||||
|
state.win = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
open_pi_pane()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("PiPane", open_pi_pane, { desc = "Open pi in a right side pane" })
|
||||||
|
vim.api.nvim_create_user_command("PiPaneToggle", toggle_pi_pane, { desc = "Toggle pi right side pane" })
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>p", "<cmd>PiAsk<cr>", desc = "Pi Ask" },
|
||||||
|
{ "<leader>pp", "<cmd>PiPaneToggle<cr>", desc = "Pi Pane" },
|
||||||
|
{ "<leader>ps", "<cmd>PiAskSelection<cr>", mode = "v", desc = "Pi Ask Selection" },
|
||||||
|
},
|
||||||
|
}
|
||||||
5
.config/opencode/.gitignore
vendored
5
.config/opencode/.gitignore
vendored
@@ -1,5 +0,0 @@
|
|||||||
node_modules
|
|
||||||
package.json
|
|
||||||
bun.lock
|
|
||||||
.megamemory/
|
|
||||||
.memory/
|
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
# OpenCode Global Workflow
|
|
||||||
|
|
||||||
## Operating Model
|
|
||||||
|
|
||||||
- Default to `planner`. Do not implement before there is an approved plan.
|
|
||||||
- `planner` owns discovery, decomposition, verification oracles, risk tracking, and the handoff spec.
|
|
||||||
- `builder` executes the approved spec exactly, delegates focused work to subagents, and escalates back to `planner` instead of improvising when the spec breaks.
|
|
||||||
- Parallelize aggressively for research, exploration, review, and isolated implementation lanes. Do not parallelize code mutation when lanes share files, APIs, schemas, or verification steps.
|
|
||||||
- Use explicit `allow` or `deny` permissions only. Do not rely on `ask`.
|
|
||||||
- Keep `external_directory` denied. Real project repos may use repo-local `/.worktrees`, but this global config must not relax that rule.
|
|
||||||
|
|
||||||
## Agent Roster
|
|
||||||
|
|
||||||
| Agent | Mode | Model | Responsibility |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| `planner` | primary | `github-copilot/gpt-5.4` | Produce approved specs and decide whether execution is ready |
|
|
||||||
| `builder` | primary | `github-copilot/gpt-5.4` | Execute approved specs and integrate delegated work |
|
|
||||||
| `researcher` | subagent | `github-copilot/gpt-5.4` | Deep research, external docs, tradeoff analysis |
|
|
||||||
| `explorer` | subagent | `github-copilot/claude-sonnet-4.6` | Read-only repo inspection; reports facts only, never plans or recommendations |
|
|
||||||
| `reviewer` | subagent | `github-copilot/gpt-5.4` | Critique plans, code, tests, and release readiness |
|
|
||||||
| `coder` | subagent | `github-copilot/gpt-5.3-codex` | Implement narrowly scoped code changes |
|
|
||||||
| `tester` | subagent | `github-copilot/claude-opus-4.6` | Run verification, triage failures, capture evidence |
|
|
||||||
| `librarian` | subagent | `github-copilot/claude-opus-4.6` | Maintain docs, `AGENTS.md`, and memory hygiene |
|
|
||||||
|
|
||||||
## Planner Behavior
|
|
||||||
|
|
||||||
- `planner` must use the `question` tool proactively when scope, defaults, approval criteria, or critical context are ambiguous. Prefer asking over assuming.
|
|
||||||
- `planner` may use bash and Docker commands during planning for context gathering (e.g., `docker compose config`, `docker ps`, inspecting files, checking versions). Do not run builds, installs, tests, deployments, or any implementation-level commands — those belong to builder/tester/coder.
|
|
||||||
|
|
||||||
## Planner -> Builder Contract
|
|
||||||
|
|
||||||
- Every build starts from a memory note under `plans/` with `Status: approved`.
|
|
||||||
- Approved plans must include: objective, scope, constraints, assumptions, concrete task list, parallelization lanes, verification oracle, risks, and open findings.
|
|
||||||
- `builder` must follow the approved plan exactly.
|
|
||||||
- `builder` must stop and escalate back to `planner` when it finds a spec contradiction, a hidden dependency that changes scope, or two failed verification attempts after recording root cause and evidence.
|
|
||||||
|
|
||||||
### Builder Commits
|
|
||||||
|
|
||||||
- `builder` automatically creates git commits at meaningful task checkpoints and at final completion when uncommitted changes remain.
|
|
||||||
- A "meaningful checkpoint" is a completed implementation chunk from the approved plan, not every file save.
|
|
||||||
- Skip commit creation when there are no new changes since the prior checkpoint.
|
|
||||||
- Commit messages should reflect the intent of the completed task from the plan.
|
|
||||||
- Before creating the final completion commit, clean up temporary artifacts generated during the build (e.g., scratch files, screenshots, logs, transient reports, caches). Intended committed deliverables are not cleanup targets.
|
|
||||||
- Standard git safety rules apply: review staged content, respect hooks, no force-push or destructive operations.
|
|
||||||
- Push automation is out of scope; the user decides when to push.
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
- `/init` initializes or refreshes repo memory and the project `AGENTS.md`.
|
|
||||||
- `/plan` creates or updates the canonical implementation plan in memory.
|
|
||||||
- `/build` executes the latest approved plan and records execution progress.
|
|
||||||
- `/continue` resumes unfinished planning or execution from memory based on the current primary agent.
|
|
||||||
- Built-in `/sessions` remains available for raw session browsing; custom `/continue` is the workflow-aware resume entrypoint.
|
|
||||||
|
|
||||||
## Memory System (Single: basic-memory)
|
|
||||||
|
|
||||||
Memory uses one persistent system: **basic-memory**.
|
|
||||||
|
|
||||||
- All persistent knowledge is stored in basic-memory notes, split across a **`main` project** (global/shared) and **per-repo projects** (project-specific).
|
|
||||||
- The managed per-repo basic-memory project directory is `<repo>/.memory/`.
|
|
||||||
- Do not edit managed `.memory/*` files directly; use basic-memory MCP tools for all reads/writes.
|
|
||||||
|
|
||||||
### `main` vs per-repo projects
|
|
||||||
|
|
||||||
1. **`main` (global/shared knowledge only)**
|
|
||||||
- Reusable coding patterns
|
|
||||||
- Technology knowledge
|
|
||||||
- User preferences and workflow rules
|
|
||||||
- Cross-project lessons learned
|
|
||||||
|
|
||||||
2. **Per-repo projects (project-specific knowledge only)**
|
|
||||||
- Project overview and architecture notes
|
|
||||||
- Plans, execution logs, decisions, findings, and continuity notes
|
|
||||||
- Project-specific conventions and testing workflows
|
|
||||||
|
|
||||||
**Hard rule:** Never store project-specific plans, decisions, research, gates, or sessions in `main`. Never store cross-project reusable knowledge in a per-repo project.
|
|
||||||
|
|
||||||
### Required per-repo note taxonomy
|
|
||||||
|
|
||||||
- `project/overview` - stack, purpose, important entrypoints
|
|
||||||
- `project/architecture` - major modules, data flow, boundaries
|
|
||||||
- `project/workflows` - local dev, build, test, release commands
|
|
||||||
- `project/testing` - verification entrypoints and expectations
|
|
||||||
- `plans/<slug>` - canonical specs with `Status: draft|approved|blocked|done`
|
|
||||||
- `executions/<slug>` - structured execution log with `Status: in_progress|blocked|done` (see template below)
|
|
||||||
- `decisions/<slug>` - durable project-specific decisions
|
|
||||||
- `findings/<slug>` - open findings ledger with evidence and owner
|
|
||||||
|
|
||||||
### Execution note template (`executions/<slug>`)
|
|
||||||
|
|
||||||
Every execution note must use these literal section names:
|
|
||||||
|
|
||||||
```
|
|
||||||
## Plan
|
|
||||||
- **Source:** plans/<slug>
|
|
||||||
- **Status:** approved
|
|
||||||
|
|
||||||
## Execution State
|
|
||||||
- **Objective:** <one-line goal from the plan>
|
|
||||||
- **Current Phase:** <planning|implementing|integrating|verifying|blocked|done>
|
|
||||||
- **Next Checkpoint:** <next concrete step>
|
|
||||||
- **Blockers:** <none|bullet-friendly summary>
|
|
||||||
- **Last Updated By:** <builder|coder|tester|reviewer|librarian>
|
|
||||||
- **Legacy Note Normalized:** <yes|no>
|
|
||||||
|
|
||||||
## Lane Claims
|
|
||||||
Repeated per lane:
|
|
||||||
|
|
||||||
### Lane: <lane-name>
|
|
||||||
- **Owner:** <builder|coder|tester|reviewer|librarian|unassigned>
|
|
||||||
- **Status:** planned | active | released | blocked | done
|
|
||||||
- **Claimed Files/Areas:** <paths or named workflow surfaces>
|
|
||||||
- **Depends On:** <none|lane names>
|
|
||||||
- **Exit Condition:** <what must be true to release or complete this lane>
|
|
||||||
|
|
||||||
## Last Verified State
|
|
||||||
- **Mode:** none | smoke | full
|
|
||||||
- **Summary:** <one-sentence status>
|
|
||||||
- **Outstanding Risk:** <none|brief risk>
|
|
||||||
- **Related Ledger Entry:** <entry label|none>
|
|
||||||
|
|
||||||
## Verification Ledger
|
|
||||||
Append-only log. Each entry:
|
|
||||||
|
|
||||||
### Entry: <checkpoint-or-step-label>
|
|
||||||
- **Goal:** <what is being verified>
|
|
||||||
- **Mode:** smoke | full
|
|
||||||
- **Command/Check:** <exact command or manual check performed>
|
|
||||||
- **Result:** pass | fail | blocked | not_run
|
|
||||||
- **Key Evidence:** <concise proof: output snippet, hash, assertion count>
|
|
||||||
- **Artifacts:** <paths to logs/screenshots, or `none`>
|
|
||||||
- **Residual Risk:** <known gaps, or `none`>
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Verification summary shape
|
|
||||||
|
|
||||||
Each verification entry (in Last Verified State or Verification Ledger) uses these fields:
|
|
||||||
|
|
||||||
- **Goal** - what is being verified
|
|
||||||
- **Mode** - `smoke` or `full` (see mode rules)
|
|
||||||
- **Command/Check** - exact command or manual check performed
|
|
||||||
- **Result** - `pass`, `fail`, `blocked`, or `not_run`
|
|
||||||
- **Key Evidence** - concise proof (output snippet, hash, assertion count)
|
|
||||||
- **Artifacts** - paths to logs/screenshots if any, or `none`
|
|
||||||
- **Residual Risk** - known gaps, or `none`
|
|
||||||
|
|
||||||
#### Verification mode rules
|
|
||||||
|
|
||||||
- Default to **`smoke`** for intermediate checkpoint proof and isolated lane verification.
|
|
||||||
- Default to **`full`** before any final completion claim or setting execution status to `done`.
|
|
||||||
- If there is only one meaningful verification step, record it as `full` and note there is no separate smoke check.
|
|
||||||
|
|
||||||
#### Compact verification summary behavior
|
|
||||||
|
|
||||||
- The verification ledger shape is the default evidence format for builder/tester/coder handoffs.
|
|
||||||
- Raw logs should stay out of primary context unless a check fails or the user explicitly requests full output.
|
|
||||||
- When raw output is necessary, summarize the failure first and then point to the raw evidence.
|
|
||||||
|
|
||||||
#### Lane-claim lifecycle
|
|
||||||
|
|
||||||
- **Planner** defines intended lanes and claimed files/areas in the approved plan when parallelization is expected.
|
|
||||||
- **Builder** creates or updates lane-claim entries in the execution note before fan-out and marks them `active`, `released`, `done`, or `blocked`.
|
|
||||||
- Overlapping claimed files/areas or sequential verification dependencies **forbid** parallel fan-out.
|
|
||||||
- Claims are advisory markdown metadata, not hard runtime locks.
|
|
||||||
|
|
||||||
#### Reviewer and execution-note ownership
|
|
||||||
|
|
||||||
- `reviewer` is read-only on execution notes; it reports findings via its response message.
|
|
||||||
- `builder` owns all execution-note writes and status transitions.
|
|
||||||
|
|
||||||
#### Legacy execution notes
|
|
||||||
|
|
||||||
Legacy execution notes may be freeform and lack structured sections. `/continue` must degrade gracefully — read what exists, do not invent conflicts or synthesize missing sections without evidence.
|
|
||||||
|
|
||||||
### Per-repo project setup (required)
|
|
||||||
|
|
||||||
Every code repository must have its own dedicated basic-memory project.
|
|
||||||
|
|
||||||
Use `basic-memory_create_memory_project` with:
|
|
||||||
- `project_name`: short kebab-case repo identifier
|
|
||||||
- `project_path`: `<repo-root>/.memory`
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
|
|
||||||
Local skills live under `skills/<name>/SKILL.md` and are loaded on demand via the `skill` tool. See `skills/creating-skills/SKILL.md` for authoring rules.
|
|
||||||
|
|
||||||
### First-Batch Skills
|
|
||||||
|
|
||||||
| Skill | Purpose |
|
|
||||||
| --- | --- |
|
|
||||||
| `systematic-debugging` | Root-cause-first debugging with findings, evidence, and builder escalation |
|
|
||||||
| `verification-before-completion` | Evidence-before-claims verification for tester and builder handoffs |
|
|
||||||
| `brainstorming` | Planner-owned discovery and design refinement ending in memory-backed artifacts |
|
|
||||||
| `writing-plans` | Planner-owned authoring of execution-ready `plans/<slug>` notes |
|
|
||||||
| `dispatching-parallel-agents` | Safe parallelization with strict isolation tests and a single integrator |
|
|
||||||
| `test-driven-development` | Canonical red-green-refactor workflow for code changes |
|
|
||||||
|
|
||||||
### Design & Domain Skills
|
|
||||||
|
|
||||||
| Skill | Purpose |
|
|
||||||
| --- | --- |
|
|
||||||
| `frontend-design` | Distinctive, production-grade frontend UI with high design quality, accessibility, and performance |
|
|
||||||
|
|
||||||
### Ecosystem Skills
|
|
||||||
|
|
||||||
| Skill | Purpose |
|
|
||||||
| --- | --- |
|
|
||||||
| `docker-container-management` | Reusable Docker/compose workflow for builds, tests, and dev in containerized repos |
|
|
||||||
| `python-development` | Python ecosystem defaults: `uv` for packaging, `ruff` for lint/format, `pytest` for tests |
|
|
||||||
| `javascript-typescript-development` | JS/TS ecosystem defaults: `bun` for runtime/packaging, `biome` for lint/format |
|
|
||||||
|
|
||||||
### Agent Skill-Loading Contract
|
|
||||||
|
|
||||||
Agents must proactively load applicable skills when their trigger conditions are met. Do not wait to be told.
|
|
||||||
|
|
||||||
- **`planner`**: `brainstorming` (unclear requests, design work), `writing-plans` (authoring `plans/<slug>`), `dispatching-parallel-agents` (parallel lanes), `systematic-debugging` (unresolved bugs), `test-driven-development` (specifying code tasks), `frontend-design` (frontend UI/UX implementation or redesign), `docker-container-management` (repo uses Docker), `python-development` (Python repo/lane), `javascript-typescript-development` (JS/TS repo/lane).
|
|
||||||
- **`builder`**: `dispatching-parallel-agents` (before parallel fan-out), `systematic-debugging` (bugs, regressions, flaky tests), `verification-before-completion` (before any completion claim), `test-driven-development` (before delegating or performing code changes), `frontend-design` (frontend UI/UX implementation lanes), `docker-container-management` (containerized repo), `python-development` (Python lanes), `javascript-typescript-development` (JS/TS lanes).
|
|
||||||
- **`tester`**: `systematic-debugging` (verification failure diagnosis), `verification-before-completion` (before declaring verification complete), `test-driven-development` (validating red/green cycles), `docker-container-management` (tests run in containers), `python-development` (Python verification), `javascript-typescript-development` (JS/TS verification).
|
|
||||||
- **`reviewer`**: `verification-before-completion` (evaluating completion evidence), `test-driven-development` (reviewing red/green discipline).
|
|
||||||
- **`coder`**: `test-driven-development` (all code tasks), `frontend-design` (frontend component, page, or application implementation lanes), `docker-container-management` (Dockerfiles, compose files, containerized builds), `python-development` (Python code lanes), `javascript-typescript-development` (JS/TS code lanes); other skills when the assigned lane explicitly calls for them.
|
|
||||||
- **`librarian`**: Load relevant skills opportunistically when the assigned task calls for them; do not override planner/builder workflow ownership.
|
|
||||||
|
|
||||||
### TDD Default Policy
|
|
||||||
|
|
||||||
Test-driven development is the default for all code changes. Agents must follow the red-green-refactor cycle unless a narrow exception applies.
|
|
||||||
|
|
||||||
**Narrow exceptions** (agent must state why TDD was not practical and what alternative verification was used):
|
|
||||||
- Docs-only changes
|
|
||||||
- Config-only changes
|
|
||||||
- Pure refactors with provably unchanged behavior
|
|
||||||
- Repos that do not yet have a reliable automated test harness
|
|
||||||
|
|
||||||
## Documentation Ownership
|
|
||||||
|
|
||||||
- `librarian` owns project docs updates, `AGENTS.md` upkeep, and memory note hygiene.
|
|
||||||
- When a workflow, command, or agent contract changes, update the docs in the same task.
|
|
||||||
- Keep command names, agent roster, memory taxonomy, and skill-loading contracts synchronized across `AGENTS.md`, `agents/`, `commands/`, and `skills/`.
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
description: Execution lead that follows approved plans, delegates focused work, and integrates results without drifting from spec
|
|
||||||
mode: primary
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
variant: xhigh
|
|
||||||
temperature: 0.1
|
|
||||||
permission:
|
|
||||||
edit: allow
|
|
||||||
webfetch: allow
|
|
||||||
bash:
|
|
||||||
"*": allow
|
|
||||||
task:
|
|
||||||
"*": deny
|
|
||||||
tester: allow
|
|
||||||
coder: allow
|
|
||||||
reviewer: allow
|
|
||||||
librarian: allow
|
|
||||||
skill:
|
|
||||||
"*": allow
|
|
||||||
permalink: opencode-config/agents/builder
|
|
||||||
---
|
|
||||||
|
|
||||||
You are the execution authority.
|
|
||||||
|
|
||||||
- Proactively load applicable skills when triggers are present:
|
|
||||||
- `dispatching-parallel-agents` before any parallel subagent fan-out.
|
|
||||||
- `systematic-debugging` when bugs, regressions, flaky tests, or unexpected behavior appear.
|
|
||||||
- `verification-before-completion` before completion claims or final handoff.
|
|
||||||
- `test-driven-development` before delegating or performing code changes.
|
|
||||||
- `docker-container-management` when executing tasks in a containerized repo.
|
|
||||||
- `python-development` when executing Python lanes.
|
|
||||||
- `frontend-design` when executing frontend UI/UX implementation lanes.
|
|
||||||
- `javascript-typescript-development` when executing JS/TS lanes.
|
|
||||||
|
|
||||||
- Read the latest approved plan before making changes.
|
|
||||||
- Execute the plan exactly; do not widen scope on your own.
|
|
||||||
- Delegate code changes to `coder`, verification to `tester`, critique to `reviewer`, and docs plus `AGENTS.md` updates to `librarian`.
|
|
||||||
- Use parallel subagents when implementation lanes are isolated and can be verified independently.
|
|
||||||
- Maintain a structured execution note in basic-memory under `executions/<slug>` using the literal sections defined in `AGENTS.md`: Plan, Execution State, Lane Claims, Last Verified State, and Verification Ledger.
|
|
||||||
- Before parallel fan-out, create or update Lane Claims in the execution note. Mark each lane `active` before dispatch and `released`, `done`, or `blocked` afterward. Overlapping claimed files/areas or sequential verification dependencies forbid parallel fan-out.
|
|
||||||
- Record verification evidence in the Verification Ledger using the compact shape: Goal, Mode, Command/Check, Result, Key Evidence, Artifacts, Residual Risk.
|
|
||||||
- Default to `smoke` mode for intermediate checkpoints and isolated lane verification. Require `full` mode before any final completion claim or setting execution status to `done`.
|
|
||||||
- If you hit a contradiction, hidden dependency, or two failed verification attempts, record the root cause and evidence, then stop and send the work back to `planner`.
|
|
||||||
- Builder owns commit creation during `/build`; do not delegate commit authorship decisions to other agents.
|
|
||||||
- Create commits automatically at meaningful completed implementation checkpoints, and create a final completion commit when changes remain.
|
|
||||||
- Before creating the final completion commit, clean up temporary artifacts generated during the build (e.g., scratch files, screenshots, logs, transient reports, caches). Intended committed deliverables are not cleanup targets.
|
|
||||||
- Reuse existing git safety constraints: avoid destructive git behavior, do not force push, and do not add push automation.
|
|
||||||
- If there are no new changes at a checkpoint, skip commit creation instead of creating empty or duplicate commits.
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
description: Focused implementation subagent for tightly scoped code changes within an assigned lane
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/gpt-5.3-codex
|
|
||||||
variant: xhigh
|
|
||||||
temperature: 0.1
|
|
||||||
permission:
|
|
||||||
edit: allow
|
|
||||||
webfetch: allow
|
|
||||||
bash:
|
|
||||||
"*": allow
|
|
||||||
permalink: opencode-config/agents/coder
|
|
||||||
---
|
|
||||||
|
|
||||||
Implement only the assigned lane.
|
|
||||||
|
|
||||||
- Proactively load `test-driven-development` for code development tasks.
|
|
||||||
- Load `docker-container-management` when the lane involves Dockerfiles, compose files, or containerized builds.
|
|
||||||
- Load `python-development` when the lane involves Python code.
|
|
||||||
- Load `frontend-design` when the lane involves frontend component, page, or application implementation.
|
|
||||||
- Load `javascript-typescript-development` when the lane involves JS/TS code.
|
|
||||||
- Load other local skills only when the assigned lane explicitly calls for them.
|
|
||||||
|
|
||||||
- Follow the provided spec and stay inside the requested scope.
|
|
||||||
- Reuse existing project patterns before introducing new ones.
|
|
||||||
- Report notable assumptions, touched files, and any follow-up needed.
|
|
||||||
- When reporting verification evidence, use the compact verification summary shape:
|
|
||||||
- **Goal** – what is being verified
|
|
||||||
- **Mode** – `smoke` or `full`
|
|
||||||
- **Command/Check** – exact command or manual check performed
|
|
||||||
- **Result** – `pass`, `fail`, `blocked`, or `not_run`
|
|
||||||
- **Key Evidence** – concise proof (output snippet, hash, assertion count)
|
|
||||||
- **Artifacts** – paths to logs/screenshots, or `none`
|
|
||||||
- **Residual Risk** – known gaps, or `none`
|
|
||||||
- Keep raw logs out of handoff messages; summarize failures first and point to raw evidence only when needed.
|
|
||||||
- Clean up temporary artifacts from the assigned lane (e.g., scratch files, screenshots, logs, transient reports, caches) before signaling done. Intended committed deliverables are not cleanup targets.
|
|
||||||
- Do not claim work is complete without pointing to verification evidence in the compact shape above.
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
description: Read-only repo inspector that reports observable facts only — never plans or recommendations
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/claude-sonnet-4.6
|
|
||||||
temperature: 0.0
|
|
||||||
tools:
|
|
||||||
write: false
|
|
||||||
edit: false
|
|
||||||
bash: false
|
|
||||||
permission:
|
|
||||||
webfetch: deny
|
|
||||||
permalink: opencode-config/agents/explorer
|
|
||||||
---
|
|
||||||
|
|
||||||
You are a fact-gathering tool, not a planner.
|
|
||||||
|
|
||||||
- Inspect the repository quickly and report only observable facts.
|
|
||||||
- Prefer `glob`, `grep`, `read`, structural search, and memory lookups.
|
|
||||||
- Return file paths, symbols, code relationships, and constraints.
|
|
||||||
- Do not make changes.
|
|
||||||
|
|
||||||
Forbidden output:
|
|
||||||
- Plan drafts, task lists, or implementation steps.
|
|
||||||
- Solution design or architecture proposals.
|
|
||||||
- Speculative recommendations or subjective assessments.
|
|
||||||
- Priority rankings or suggested next actions.
|
|
||||||
|
|
||||||
If a finding has implications for planning, state the fact and stop. Let the caller draw conclusions.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
description: Documentation and memory steward for AGENTS rules, project docs, and continuity notes
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/claude-opus-4.6
|
|
||||||
variant: thinking
|
|
||||||
temperature: 0.2
|
|
||||||
tools:
|
|
||||||
bash: false
|
|
||||||
permission:
|
|
||||||
edit: allow
|
|
||||||
webfetch: allow
|
|
||||||
permalink: opencode-config/agents/librarian
|
|
||||||
---
|
|
||||||
|
|
||||||
Own documentation quality and continuity.
|
|
||||||
|
|
||||||
- Load relevant skills opportunistically when assigned documentation or memory tasks call for them.
|
|
||||||
- Do not override planner/builder workflow ownership.
|
|
||||||
|
|
||||||
- Keep `AGENTS.md`, workflow docs, and command descriptions aligned with actual behavior.
|
|
||||||
- Update or create basic-memory notes when project knowledge changes.
|
|
||||||
- Prefer concise, high-signal docs that help future sessions resume quickly.
|
|
||||||
- Flag stale instructions, mismatched agent rosters, and undocumented workflow changes.
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
---
|
|
||||||
description: Planning lead that gathers evidence, writes execution-ready specs, and decides when builder can proceed
|
|
||||||
mode: primary
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
variant: xhigh
|
|
||||||
temperature: 0.1
|
|
||||||
tools:
|
|
||||||
write: false
|
|
||||||
edit: false
|
|
||||||
permission:
|
|
||||||
webfetch: allow
|
|
||||||
task:
|
|
||||||
"*": deny
|
|
||||||
researcher: allow
|
|
||||||
explorer: allow
|
|
||||||
reviewer: allow
|
|
||||||
skill:
|
|
||||||
"*": allow
|
|
||||||
permalink: opencode-config/agents/planner
|
|
||||||
---
|
|
||||||
|
|
||||||
You are the planning authority.
|
|
||||||
|
|
||||||
- Proactively load applicable skills when triggers are present:
|
|
||||||
- `brainstorming` for unclear requests, design work, or feature shaping.
|
|
||||||
- `writing-plans` when producing execution-ready `plans/<slug>` notes.
|
|
||||||
- `dispatching-parallel-agents` when considering parallel research or review lanes.
|
|
||||||
- `systematic-debugging` when planning around unresolved bugs or failures.
|
|
||||||
- `test-driven-development` when specifying implementation tasks that mutate code.
|
|
||||||
- `docker-container-management` when a repo uses Docker/docker-compose.
|
|
||||||
- `python-development` when a repo or lane is primarily Python.
|
|
||||||
- `frontend-design` when the task involves frontend UI/UX implementation or redesign.
|
|
||||||
- `javascript-typescript-development` when a repo or lane is primarily JS/TS.
|
|
||||||
|
|
||||||
## Clarification and the `question` tool
|
|
||||||
|
|
||||||
- Use the `question` tool proactively when scope, default choices, approval criteria, or critical context are ambiguous or missing.
|
|
||||||
- Prefer asking over assuming, especially for: target environments, language/tool defaults, acceptance criteria, and whether Docker is required.
|
|
||||||
- Do not hand off a plan that contains unresolved assumptions when a question could resolve them first.
|
|
||||||
|
|
||||||
## Planning-time Docker and bash usage
|
|
||||||
|
|
||||||
- You may run Docker commands during planning for context gathering and inspection (e.g., `docker compose config`, `docker image ls`, `docker ps`, `docker network ls`, checking container health or logs).
|
|
||||||
- You may also run other bash commands for read-only context (e.g., checking file contents, environment state, installed versions).
|
|
||||||
- Do **not** run builds, installs, tests, deployments, or any implementation-level commands — those belong to builder/tester/coder.
|
|
||||||
- If you catch yourself executing implementation steps, stop and delegate to builder.
|
|
||||||
|
|
||||||
- Gather all high-signal context before proposing execution.
|
|
||||||
- Break work into explicit tasks, dependencies, and verification steps.
|
|
||||||
- Use subagents in parallel when research lanes are independent.
|
|
||||||
- Write or update the canonical plan in basic-memory under `plans/<slug>`.
|
|
||||||
- Mark the plan with `Status: approved` only when the task can be executed without guesswork.
|
|
||||||
- Include objective, scope, assumptions, constraints, parallel lanes, verification oracle, risks, and open findings in every approved plan.
|
|
||||||
- When parallelization or phased verification matters, define intended lanes with claimed files/areas, inter-lane dependencies, and verification intent so builder can create the structured `executions/<slug>` note without guessing.
|
|
||||||
- Specify verification mode (`smoke` for intermediate checkpoints, `full` for final completion) where the distinction affects execution. Default to the shared rules in `AGENTS.md` when not otherwise specified.
|
|
||||||
- Never make file changes or implementation edits yourself.
|
|
||||||
- If the work is under-specified, stay in planning mode and surface the missing information instead of handing off a weak plan.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
description: Research specialist for external docs, tradeoff analysis, and evidence gathering
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
variant: xhigh
|
|
||||||
temperature: 0.2
|
|
||||||
tools:
|
|
||||||
write: false
|
|
||||||
edit: false
|
|
||||||
bash: false
|
|
||||||
permission:
|
|
||||||
webfetch: allow
|
|
||||||
permalink: opencode-config/agents/researcher
|
|
||||||
---
|
|
||||||
|
|
||||||
Focus on evidence gathering.
|
|
||||||
|
|
||||||
- Read docs, compare options, and summarize tradeoffs.
|
|
||||||
- Prefer authoritative sources and concrete examples.
|
|
||||||
- Return concise findings with recommendations, risks, and unknowns.
|
|
||||||
- Do not edit files or invent implementation details.
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
description: Critical reviewer for plans, code, test evidence, and release readiness
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
variant: xhigh
|
|
||||||
temperature: 0.1
|
|
||||||
tools:
|
|
||||||
write: false
|
|
||||||
edit: false
|
|
||||||
bash: false
|
|
||||||
permission:
|
|
||||||
webfetch: allow
|
|
||||||
permalink: opencode-config/agents/reviewer
|
|
||||||
---
|
|
||||||
|
|
||||||
Act as a skeptical reviewer.
|
|
||||||
|
|
||||||
- Proactively load applicable skills when triggers are present:
|
|
||||||
- `verification-before-completion` when evaluating completion readiness.
|
|
||||||
- `test-driven-development` when reviewing red/green discipline evidence.
|
|
||||||
|
|
||||||
- Look for incorrect assumptions, missing cases, regressions, unclear specs, and weak verification.
|
|
||||||
- Reject completion claims that lack structured verification evidence in the compact shape (`Goal`, `Mode`, `Command/Check`, `Result`, `Key Evidence`, `Artifacts`, `Residual Risk`).
|
|
||||||
- Reject execution notes or handoffs that lack lane-ownership boundaries (owner, claimed files/areas, status).
|
|
||||||
- Prefer concrete findings over broad advice.
|
|
||||||
- When reviewing a plan, call out ambiguity before execution starts.
|
|
||||||
- When reviewing code or tests, provide evidence-backed issues in priority order.
|
|
||||||
- Remain read-only: report findings via response message; do not write to execution notes or modify files.
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
description: Verification specialist for running tests, reproducing failures, and capturing evidence
|
|
||||||
mode: subagent
|
|
||||||
model: github-copilot/claude-opus-4.6
|
|
||||||
variant: thinking
|
|
||||||
temperature: 0.0
|
|
||||||
tools:
|
|
||||||
write: false
|
|
||||||
permission:
|
|
||||||
edit: deny
|
|
||||||
webfetch: allow
|
|
||||||
bash:
|
|
||||||
"*": allow
|
|
||||||
permalink: opencode-config/agents/tester
|
|
||||||
---
|
|
||||||
|
|
||||||
Own verification and failure evidence.
|
|
||||||
|
|
||||||
- Proactively load applicable skills when triggers are present:
|
|
||||||
- `systematic-debugging` when a verification failure needs diagnosis.
|
|
||||||
- `verification-before-completion` before declaring verification complete.
|
|
||||||
- `test-driven-development` when validating red/green cycles or regression coverage.
|
|
||||||
- `docker-container-management` when tests run inside containers.
|
|
||||||
- `python-development` when verifying Python code.
|
|
||||||
- `javascript-typescript-development` when verifying JS/TS code.
|
|
||||||
|
|
||||||
- Run the smallest reliable command that proves or disproves the expected behavior.
|
|
||||||
- Report every result using the compact verification summary shape:
|
|
||||||
- **Goal** – what is being verified
|
|
||||||
- **Mode** – `smoke` or `full`
|
|
||||||
- **Command/Check** – exact command or manual check performed
|
|
||||||
- **Result** – `pass`, `fail`, `blocked`, or `not_run`
|
|
||||||
- **Key Evidence** – concise proof (output snippet, hash, assertion count)
|
|
||||||
- **Artifacts** – paths to logs/screenshots, or `none`
|
|
||||||
- **Residual Risk** – known gaps, or `none`
|
|
||||||
- Keep raw logs out of primary context unless a check fails or the caller requests full output. Summarize the failure first, then point to raw evidence.
|
|
||||||
- Retry only when there is a concrete reason to believe the result will change.
|
|
||||||
- Flag any temporary artifacts observed during verification (e.g., scratch files, screenshots, logs, transient reports, caches) so builder or coder can clean them up before completion.
|
|
||||||
- Do not make code edits.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
description: Execute the latest approved plan
|
|
||||||
agent: builder
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
---
|
|
||||||
|
|
||||||
Execute the latest approved plan for: $ARGUMENTS
|
|
||||||
|
|
||||||
1. Read the latest matching `plans/<slug>` note with `Status: approved`.
|
|
||||||
2. Create or update `executions/<slug>` with the structured sections defined in `AGENTS.md` (Plan, Execution State, Lane Claims, Last Verified State, Verification Ledger). Set `Status: in_progress` before changing code.
|
|
||||||
3. Before parallel fan-out, populate Lane Claims with owner, status, claimed files/areas, dependencies, and exit conditions. Overlapping claimed files/areas or sequential verification dependencies forbid parallel fan-out.
|
|
||||||
4. Delegate implementation to `coder`, verification to `tester`, review to `reviewer`, and docs or memory updates to `librarian` where appropriate.
|
|
||||||
5. Builder owns commit creation during `/build`: create automatic commits at meaningful completed implementation checkpoints.
|
|
||||||
6. Reuse existing git safety rules and avoid destructive git behavior; do not add push automation.
|
|
||||||
7. If no new changes exist at a checkpoint, skip commit creation rather than creating empty or duplicate commits.
|
|
||||||
8. Record verification evidence in the Verification Ledger using the compact shape (Goal, Mode, Command/Check, Result, Key Evidence, Artifacts, Residual Risk). Default to `smoke` for intermediate checkpoints; require `full` before final completion or setting status to `done`.
|
|
||||||
9. Follow the plan exactly. If the plan is contradictory, missing a dependency, or fails verification twice, stop, capture evidence, set the execution note to blocked, and send the work back to `planner`.
|
|
||||||
10. Before creating the final completion commit, clean up temporary artifacts generated during the build (e.g., scratch files, screenshots, logs, transient reports, caches). Intended committed deliverables are not cleanup targets.
|
|
||||||
11. Finish by creating a final completion commit when changes remain, then update Last Verified State and set the execution note to `Status: done` or `Status: blocked` and summarize what changed.
|
|
||||||
|
|
||||||
Automatic commits are required during `/build` as defined above.
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
description: Resume unfinished planner or builder workflow from memory
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
---
|
|
||||||
|
|
||||||
Continue the highest-priority unfinished work for this repository.
|
|
||||||
|
|
||||||
1. Inspect basic-memory for incomplete work under `plans/`, `executions/`, `findings/`, and `decisions/`.
|
|
||||||
2. If the current primary agent is `planner`, resume the most relevant plan that is `Status: draft` or `Status: blocked` and drive it toward an approved spec.
|
|
||||||
3. If the current primary agent is `builder`, resume the most relevant execution note that is `Status: in_progress` or `Status: blocked`. If there is no approved plan, stop and hand the work back to `planner`.
|
|
||||||
4. When resuming a structured execution note, read Execution State and report: objective, current phase, next checkpoint, blockers, and last updated by. Check Lane Claims for active/blocked lanes and flag any claim conflicts (overlapping files/areas).
|
|
||||||
5. When the execution note is legacy or freeform (missing structured sections like Execution State or Lane Claims), degrade gracefully: read what exists, infer status from available content, and do not invent conflicts or synthesize missing sections without evidence.
|
|
||||||
6. When the execution note shows only `smoke` verification in the Last Verified State or Verification Ledger and a `full` verification step is still required before completion, surface this explicitly: report that full verification is pending and must run before the execution can be marked `done`.
|
|
||||||
7. Refresh the open findings ledger and update note statuses as you work.
|
|
||||||
8. Return the resumed slug, current status, next checkpoint, any blocker, any lane claim conflicts, and any pending full-verification requirement.
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
description: Initialize or refresh project memory and AGENTS.md
|
|
||||||
agent: builder
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
---
|
|
||||||
|
|
||||||
Initialize this repository for the planner/builder workflow.
|
|
||||||
|
|
||||||
1. Verify that a dedicated per-repo basic-memory project exists for the current repository. If it does not, create it at `<repo-root>/.memory` using a short kebab-case project name.
|
|
||||||
2. Gather high-signal project context in parallel: purpose, stack, architecture, entrypoints, build/test commands, coding conventions, and major risks.
|
|
||||||
3. Write or refresh project memory notes under `project/overview`, `project/architecture`, `project/workflows`, and `project/testing`.
|
|
||||||
4. Use `librarian` to create or update the project-root `AGENTS.md` so it matches the repository and documents the important working agreements.
|
|
||||||
5. Record any missing information or open findings under `findings/` instead of guessing.
|
|
||||||
|
|
||||||
Keep the output concise and actionable.
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
description: Produce or refresh an execution-ready plan
|
|
||||||
agent: planner
|
|
||||||
model: github-copilot/gpt-5.4
|
|
||||||
---
|
|
||||||
|
|
||||||
Create or update an execution-ready plan for: $ARGUMENTS
|
|
||||||
|
|
||||||
1. Gather the required repo and external context in parallel.
|
|
||||||
2. Use `researcher`, `explorer`, and `reviewer` as needed.
|
|
||||||
3. Write the canonical plan to basic-memory under `plans/<slug>`.
|
|
||||||
4. Include: objective, scope, assumptions, constraints, task breakdown, parallel lanes, verification oracle, risks, and open findings.
|
|
||||||
5. When parallelization or phased verification matters, define intended lanes with claimed files/areas, inter-lane dependencies, and verification intent (including `smoke` vs `full` mode where the distinction affects execution).
|
|
||||||
6. Ensure the plan gives builder enough information to create the structured `executions/<slug>` note without guessing lane ownership, claimed areas, or verification expectations.
|
|
||||||
7. Set `Status: approved` only when `builder` can execute the plan without guesswork. Otherwise leave it blocked and explain why.
|
|
||||||
|
|
||||||
Return the plan slug and the key execution checkpoints.
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json",
|
|
||||||
"enabled": true,
|
|
||||||
"debug": false,
|
|
||||||
"pruneNotification": "detailed",
|
|
||||||
"pruneNotificationType": "chat",
|
|
||||||
"commands": {
|
|
||||||
"enabled": true,
|
|
||||||
"protectedTools": []
|
|
||||||
},
|
|
||||||
"experimental": {
|
|
||||||
"allowSubAgents": true
|
|
||||||
},
|
|
||||||
"manualMode": {
|
|
||||||
"enabled": false,
|
|
||||||
"automaticStrategies": true
|
|
||||||
},
|
|
||||||
"turnProtection": {
|
|
||||||
"enabled": false,
|
|
||||||
"turns": 4
|
|
||||||
},
|
|
||||||
"protectedFilePatterns": [],
|
|
||||||
"strategies": {
|
|
||||||
"deduplication": {
|
|
||||||
"enabled": true,
|
|
||||||
"protectedTools": []
|
|
||||||
},
|
|
||||||
"supersedeWrites": {
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"purgeErrors": {
|
|
||||||
"enabled": true,
|
|
||||||
"turns": 4,
|
|
||||||
"protectedTools": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"compress": {
|
|
||||||
"maxContextLimit": "80%",
|
|
||||||
"minContextLimit": "50%"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://opencode.ai/config.json",
|
|
||||||
"autoupdate": true,
|
|
||||||
"model": "github-copilot/gpt-5.4",
|
|
||||||
"small_model": "github-copilot/gpt-5-mini",
|
|
||||||
"default_agent": "planner",
|
|
||||||
"enabled_providers": ["github-copilot"],
|
|
||||||
"plugin": ["@tarquinen/opencode-dcp", "./plugins/tmux-panes.ts"],
|
|
||||||
"agent": {
|
|
||||||
"build": {
|
|
||||||
"disable": true
|
|
||||||
},
|
|
||||||
"general": {
|
|
||||||
"disable": true
|
|
||||||
},
|
|
||||||
"explore": {
|
|
||||||
"disable": true
|
|
||||||
},
|
|
||||||
"plan": {
|
|
||||||
"disable": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"permission": {
|
|
||||||
"doom_loop": "allow",
|
|
||||||
"websearch": "allow",
|
|
||||||
"question": "allow",
|
|
||||||
"bash": "allow",
|
|
||||||
"external_directory": "deny"
|
|
||||||
},
|
|
||||||
"mcp": {
|
|
||||||
"context7": {
|
|
||||||
"type": "remote",
|
|
||||||
"url": "https://mcp.context7.com/mcp",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"gh_grep": {
|
|
||||||
"type": "remote",
|
|
||||||
"url": "https://mcp.grep.app",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"playwright": {
|
|
||||||
"type": "local",
|
|
||||||
"command": [
|
|
||||||
"bunx",
|
|
||||||
"@playwright/mcp@latest",
|
|
||||||
"--headless",
|
|
||||||
"--browser",
|
|
||||||
"chromium"
|
|
||||||
],
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"basic-memory": {
|
|
||||||
"type": "local",
|
|
||||||
"command": ["uvx", "basic-memory", "mcp"],
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"ast-grep": {
|
|
||||||
"type": "local",
|
|
||||||
"command": [
|
|
||||||
"uvx",
|
|
||||||
"--from",
|
|
||||||
"git+https://github.com/ast-grep/ast-grep-mcp",
|
|
||||||
"ast-grep-server"
|
|
||||||
],
|
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
31
.config/opencode/package-lock.json
generated
31
.config/opencode/package-lock.json
generated
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "opencode",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"dependencies": {
|
|
||||||
"@opencode-ai/plugin": "1.2.15"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@opencode-ai/plugin": {
|
|
||||||
"version": "1.2.15",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@opencode-ai/sdk": "1.2.15",
|
|
||||||
"zod": "4.1.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@opencode-ai/sdk": {
|
|
||||||
"version": "1.2.15",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/zod": {
|
|
||||||
"version": "4.1.8",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/colinhacks"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
import type { Plugin } from "@opencode-ai/plugin"
|
|
||||||
import { spawn } from "bun"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* tmux-panes plugin
|
|
||||||
*
|
|
||||||
* When opencode spawns a background subagent, this plugin automatically opens
|
|
||||||
* a new tmux pane showing that subagent's live TUI via `opencode attach`.
|
|
||||||
*
|
|
||||||
* Layout:
|
|
||||||
* - First subagent: horizontal 60/40 split — main pane on left, subagent on right
|
|
||||||
* - Additional subagents: stacked vertically in the right column
|
|
||||||
* - Panes close automatically when subagent sessions end
|
|
||||||
*
|
|
||||||
* Only activates when running inside a tmux session (TMUX env var is set).
|
|
||||||
*/
|
|
||||||
|
|
||||||
const isInsideTmux = () => Boolean(process.env.TMUX)
|
|
||||||
const getCurrentPaneId = () => process.env.TMUX_PANE
|
|
||||||
|
|
||||||
const runTmux = async (args: string[]) => {
|
|
||||||
const proc = spawn(["tmux", ...args], { stdout: "pipe", stderr: "pipe" })
|
|
||||||
const stdout = await new Response(proc.stdout).text()
|
|
||||||
const stderr = await new Response(proc.stderr).text()
|
|
||||||
const exitCode = await proc.exited
|
|
||||||
|
|
||||||
return {
|
|
||||||
exitCode,
|
|
||||||
stdout: stdout.trim(),
|
|
||||||
stderr: stderr.trim(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const removeItem = (items: string[], value: string) => {
|
|
||||||
const idx = items.indexOf(value)
|
|
||||||
if (idx !== -1) items.splice(idx, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
const plugin: Plugin = async (ctx) => {
|
|
||||||
if (!isInsideTmux()) return {}
|
|
||||||
|
|
||||||
const sessions = new Map<string, string>() // sessionId → tmux paneId
|
|
||||||
const sourcePaneId = getCurrentPaneId()
|
|
||||||
const serverUrl = (ctx.serverUrl?.toString() ?? "").replace(/\/$/, "")
|
|
||||||
|
|
||||||
// Ordered list of pane IDs in the right column.
|
|
||||||
// Empty = no right column yet; length > 0 = right column exists.
|
|
||||||
const rightColumnPanes: string[] = []
|
|
||||||
let paneOps = Promise.resolve()
|
|
||||||
|
|
||||||
const getWindowInfo = async () => {
|
|
||||||
const targetPane = sourcePaneId ?? rightColumnPanes[0]
|
|
||||||
if (!targetPane) return null
|
|
||||||
|
|
||||||
const result = await runTmux([
|
|
||||||
"display-message",
|
|
||||||
"-p",
|
|
||||||
"-t",
|
|
||||||
targetPane,
|
|
||||||
"#{window_id} #{window_width}",
|
|
||||||
])
|
|
||||||
|
|
||||||
if (result.exitCode !== 0 || !result.stdout) return null
|
|
||||||
|
|
||||||
const [windowId, widthText] = result.stdout.split(/\s+/, 2)
|
|
||||||
const width = Number(widthText)
|
|
||||||
if (!windowId || Number.isNaN(width)) return null
|
|
||||||
|
|
||||||
return { windowId, width }
|
|
||||||
}
|
|
||||||
|
|
||||||
const applyLayout = async () => {
|
|
||||||
if (rightColumnPanes.length === 0) return
|
|
||||||
|
|
||||||
const windowInfo = await getWindowInfo()
|
|
||||||
if (!windowInfo) return
|
|
||||||
|
|
||||||
const mainWidth = Math.max(1, Math.round(windowInfo.width * 0.6))
|
|
||||||
|
|
||||||
await runTmux([
|
|
||||||
"set-window-option",
|
|
||||||
"-t",
|
|
||||||
windowInfo.windowId,
|
|
||||||
"main-pane-width",
|
|
||||||
String(mainWidth),
|
|
||||||
])
|
|
||||||
await runTmux(["select-layout", "-t", sourcePaneId ?? rightColumnPanes[0], "main-vertical"])
|
|
||||||
}
|
|
||||||
|
|
||||||
const closeSessionPane = async (sessionId: string) => {
|
|
||||||
const paneId = sessions.get(sessionId)
|
|
||||||
if (!paneId) return
|
|
||||||
|
|
||||||
await runTmux(["kill-pane", "-t", paneId])
|
|
||||||
sessions.delete(sessionId)
|
|
||||||
removeItem(rightColumnPanes, paneId)
|
|
||||||
await applyLayout()
|
|
||||||
}
|
|
||||||
|
|
||||||
const enqueuePaneOp = (operation: () => Promise<void>) => {
|
|
||||||
paneOps = paneOps.then(operation).catch(() => {})
|
|
||||||
return paneOps
|
|
||||||
}
|
|
||||||
|
|
||||||
const isTerminalSessionUpdate = (info: any) =>
|
|
||||||
Boolean(info?.time?.archived || info?.time?.compacting)
|
|
||||||
|
|
||||||
return {
|
|
||||||
event: async ({ event }) => {
|
|
||||||
// Spawn a new pane when a subagent session is created
|
|
||||||
if (event.type === "session.created") {
|
|
||||||
const info = (event as any).properties?.info
|
|
||||||
// parentID presence distinguishes subagents from the root session
|
|
||||||
if (!info?.id || !info?.parentID) return
|
|
||||||
const sessionId: string = info.id
|
|
||||||
if (sessions.has(sessionId)) return
|
|
||||||
|
|
||||||
await enqueuePaneOp(async () => {
|
|
||||||
if (sessions.has(sessionId)) return
|
|
||||||
|
|
||||||
const cmd = `opencode attach ${serverUrl} --session ${sessionId}`
|
|
||||||
let args: string[]
|
|
||||||
|
|
||||||
if (rightColumnPanes.length === 0) {
|
|
||||||
const windowInfo = await getWindowInfo()
|
|
||||||
const rightWidth = windowInfo
|
|
||||||
? Math.max(1, Math.round(windowInfo.width * 0.4))
|
|
||||||
: 40
|
|
||||||
|
|
||||||
args = [
|
|
||||||
"split-window",
|
|
||||||
"-h",
|
|
||||||
"-l",
|
|
||||||
String(rightWidth),
|
|
||||||
"-d",
|
|
||||||
"-P",
|
|
||||||
"-F",
|
|
||||||
"#{pane_id}",
|
|
||||||
...(sourcePaneId ? ["-t", sourcePaneId] : []),
|
|
||||||
cmd,
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
const lastRightPane = rightColumnPanes[rightColumnPanes.length - 1]
|
|
||||||
args = [
|
|
||||||
"split-window",
|
|
||||||
"-v",
|
|
||||||
"-d",
|
|
||||||
"-P",
|
|
||||||
"-F",
|
|
||||||
"#{pane_id}",
|
|
||||||
"-t",
|
|
||||||
lastRightPane,
|
|
||||||
cmd,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await runTmux(args)
|
|
||||||
const paneId = result.stdout
|
|
||||||
|
|
||||||
if (result.exitCode === 0 && paneId) {
|
|
||||||
sessions.set(sessionId, paneId)
|
|
||||||
rightColumnPanes.push(paneId)
|
|
||||||
await applyLayout()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Kill the pane when the subagent session ends
|
|
||||||
if (event.type === "session.deleted") {
|
|
||||||
const info = (event as any).properties?.info
|
|
||||||
if (!info?.id) return
|
|
||||||
await enqueuePaneOp(() => closeSessionPane(info.id))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.type === "session.updated") {
|
|
||||||
const info = (event as any).properties?.info
|
|
||||||
if (!info?.id || !sessions.has(info.id) || !isTerminalSessionUpdate(info)) return
|
|
||||||
await enqueuePaneOp(() => closeSessionPane(info.id))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.type === "session.status") {
|
|
||||||
const sessionID = (event as any).properties?.sessionID
|
|
||||||
const statusType = (event as any).properties?.status?.type
|
|
||||||
if (!sessionID || !sessions.has(sessionID) || statusType !== "idle") return
|
|
||||||
await enqueuePaneOp(() => closeSessionPane(sessionID))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default plugin
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
name: brainstorming
|
|
||||||
description: Planner-led discovery workflow for clarifying problem shape, options, and decision-ready direction
|
|
||||||
permalink: opencode-config/skills/brainstorming/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Brainstorming
|
|
||||||
|
|
||||||
Use this skill when requests are unclear, options are broad, or design tradeoffs are unresolved.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. Clarify objective, constraints, and non-goals.
|
|
||||||
2. Generate multiple viable approaches (not one-path thinking).
|
|
||||||
3. Compare options by risk, complexity, verification cost, and reversibility.
|
|
||||||
4. Identify unknowns that need research before execution.
|
|
||||||
5. Converge on a recommended direction with explicit rationale.
|
|
||||||
|
|
||||||
## Planner Ownership
|
|
||||||
|
|
||||||
- Keep brainstorming in planning mode; do not start implementation.
|
|
||||||
- Use subagents for independent research lanes when needed.
|
|
||||||
- Translate outcomes into memory-backed planning artifacts (`plans/<slug>`, findings/risks).
|
|
||||||
|
|
||||||
## Output
|
|
||||||
|
|
||||||
- Short options table (approach, pros, cons, risks).
|
|
||||||
- Recommended path and why.
|
|
||||||
- Open questions that block approval.
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
---
|
|
||||||
name: creating-agents
|
|
||||||
description: Create or update opencode agents in this repository, including dispatch permissions and roster alignment requirements
|
|
||||||
permalink: opencode-config/skills/creating-agents/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Creating Agents
|
|
||||||
|
|
||||||
Use this skill when you need to add or revise an agent definition in this repo.
|
|
||||||
|
|
||||||
## Agents vs Skills
|
|
||||||
|
|
||||||
- **Agents** define runtime behavior and permissions in `agents/*.md`.
|
|
||||||
- **Skills** are reusable instruction modules under `skills/*/SKILL.md`.
|
|
||||||
- Do not treat agent creation as skill creation; each has different files, checks, and ownership.
|
|
||||||
|
|
||||||
## Source of Truth
|
|
||||||
|
|
||||||
1. Agent definition file: `agents/<agent-name>.md`
|
|
||||||
2. Operating roster and workflow contract: `AGENTS.md`
|
|
||||||
3. Runtime overrides and provider policy: `opencode.jsonc`
|
|
||||||
4. Workflow entrypoints: `commands/*.md`
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
- This repo uses two primary agents: `planner` and `builder`.
|
|
||||||
- Dispatch permissions live in the primary agent that owns the subagent, not in a central dispatcher.
|
|
||||||
- `planner` may dispatch only `researcher`, `explorer`, and `reviewer`.
|
|
||||||
- `builder` may dispatch only `coder`, `tester`, `reviewer`, and `librarian`.
|
|
||||||
|
|
||||||
## Agent File Conventions
|
|
||||||
|
|
||||||
For `agents/<agent-name>.md`:
|
|
||||||
|
|
||||||
- Use frontmatter first, then concise role instructions.
|
|
||||||
- Keep tone imperative and operational.
|
|
||||||
- Define an explicit `model` for every agent and keep it on a GitHub Copilot model.
|
|
||||||
- Use only explicit `allow` or `deny` permissions; do not use `ask`.
|
|
||||||
- Include only the tools and permissions needed for the role.
|
|
||||||
- Keep instructions aligned with the planner -> builder contract in `AGENTS.md`.
|
|
||||||
|
|
||||||
Typical frontmatter fields in this repo include:
|
|
||||||
|
|
||||||
- `description`
|
|
||||||
- `mode`
|
|
||||||
- `model`
|
|
||||||
- `temperature`
|
|
||||||
- `steps`
|
|
||||||
- `tools`
|
|
||||||
- `permission`
|
|
||||||
- `permalink`
|
|
||||||
|
|
||||||
Mirror nearby agent files instead of inventing new metadata patterns.
|
|
||||||
|
|
||||||
## Practical Workflow (Create or Update)
|
|
||||||
|
|
||||||
1. Inspect the relevant primary agent file and at least one comparable peer in `agents/*.md`.
|
|
||||||
2. Create or edit `agents/<agent-name>.md` with matching local structure.
|
|
||||||
3. If the agent is a subagent, update the owning primary agent's `permission.task` allowlist.
|
|
||||||
4. Update `AGENTS.md` so the roster, responsibilities, and workflow rules stay synchronized.
|
|
||||||
5. Review `commands/*.md` if the new agent changes how `/init`, `/plan`, `/build`, or `/continue` should behave.
|
|
||||||
6. Review `opencode.jsonc` for conflicting overrides, disable flags, or provider drift.
|
|
||||||
|
|
||||||
## Manual Verification Checklist (No Validation Script)
|
|
||||||
|
|
||||||
Run this checklist before claiming completion:
|
|
||||||
|
|
||||||
- [ ] `agents/<agent-name>.md` exists and frontmatter is valid and consistent with peers.
|
|
||||||
- [ ] Agent instructions clearly define role, scope, escalation rules, and constraints.
|
|
||||||
- [ ] The owning primary agent includes the correct `permission.task` rule for the subagent.
|
|
||||||
- [ ] `AGENTS.md` roster row exists and matches the agent name, role, and model.
|
|
||||||
- [ ] `commands/*.md` and `opencode.jsonc` still reflect the intended workflow.
|
|
||||||
- [ ] Terminology stays consistent: agents in `agents/*.md`, skills in `skills/*/SKILL.md`.
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
---
|
|
||||||
name: creating-skills
|
|
||||||
description: Create or update opencode skills in this repository using the required SKILL.md format and concise, trigger-focused guidance
|
|
||||||
permalink: opencode-config/skills/creating-skills/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Creating Skills
|
|
||||||
|
|
||||||
Use this skill when you need to add or revise an opencode skill under `skills/`.
|
|
||||||
|
|
||||||
## Skills vs OpenAI/Codex Source Model
|
|
||||||
|
|
||||||
- Treat this repo as **opencode-native**.
|
|
||||||
- Do **not** use OpenAI/Codex-specific artifacts such as `agents/openai.yaml`, `init_skill.py`, `quick_validate.py`, or `scripts/references/assets` conventions from the old source model.
|
|
||||||
- A skill is discovered from `skills/*/SKILL.md` only.
|
|
||||||
|
|
||||||
## Required Structure
|
|
||||||
|
|
||||||
1. Create a folder at `skills/<skill-name>/`.
|
|
||||||
2. Add `skills/<skill-name>/SKILL.md`.
|
|
||||||
3. Keep `<skill-name>` equal to frontmatter `name`.
|
|
||||||
|
|
||||||
Frontmatter must contain only:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
name: <skill-name>
|
|
||||||
description: <what it does and when to load>
|
|
||||||
permalink: opencode-config/skills/<skill-name>/skill
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
## Naming Rules
|
|
||||||
|
|
||||||
- Use lowercase kebab-case.
|
|
||||||
- Keep names short and action-oriented.
|
|
||||||
- Match folder name and `name` exactly.
|
|
||||||
|
|
||||||
## Body Writing Rules
|
|
||||||
|
|
||||||
- Write concise, imperative instructions.
|
|
||||||
- Lead with when to load and the core workflow.
|
|
||||||
- Prefer short checklists over long prose.
|
|
||||||
- Include only repo-relevant guidance.
|
|
||||||
- Keep the planner/builder operating model in mind when a skill touches workflow behavior.
|
|
||||||
|
|
||||||
## Companion Notes (`*.md` in skill folder)
|
|
||||||
|
|
||||||
Add companion markdown files only when detail would bloat `SKILL.md` (examples, deep procedures, edge-case references).
|
|
||||||
|
|
||||||
- Keep `SKILL.md` as the operational entrypoint.
|
|
||||||
- Link companion files directly from `SKILL.md` with clear “when to read” guidance.
|
|
||||||
- Do not create extra docs by default.
|
|
||||||
|
|
||||||
## Practical Workflow (Create or Update)
|
|
||||||
|
|
||||||
1. Inspect 2–3 nearby skills for local style and brevity.
|
|
||||||
2. Pick/update `<skill-name>` and folder path under `skills/`.
|
|
||||||
3. Write or revise `SKILL.md` frontmatter (`name`, `description`, `permalink` only).
|
|
||||||
4. Draft concise body sections: purpose, load conditions, workflow, red flags/checks.
|
|
||||||
5. Add minimal companion `.md` files only if needed; link them from `SKILL.md`.
|
|
||||||
6. Verify discovery path and naming consistency:
|
|
||||||
- file exists at `skills/<name>/SKILL.md`
|
|
||||||
- folder name == frontmatter `name`
|
|
||||||
- no OpenAI/Codex-only artifacts introduced
|
|
||||||
7. If the skill changes agent workflow or command behavior:
|
|
||||||
- Update the **Skills** table, **Agent Skill-Loading Contract**, and **TDD Default Policy** in `AGENTS.md`.
|
|
||||||
- Confirm `commands/*.md` and any affected `agents/*.md` prompts stay aligned.
|
|
||||||
- If the skill involves parallelization, verify it enforces safe-parallelization rules (no parallel mutation on shared files, APIs, schemas, or verification steps).
|
|
||||||
- If the skill involves code changes, verify it references the TDD default policy and its narrow exceptions.
|
|
||||||
|
|
||||||
## Language/Ecosystem Skill Pattern
|
|
||||||
|
|
||||||
When adding a new language or ecosystem skill (e.g., `rust-development`, `go-development`), follow this template:
|
|
||||||
|
|
||||||
1. **Name**: `<language>-development` (kebab-case).
|
|
||||||
2. **Load trigger**: presence of the language's project file(s) or source files as primary source.
|
|
||||||
3. **Defaults table**: one row per concern — package manager, linter/formatter, test runner, type checker (if applicable).
|
|
||||||
4. **Core workflow**: numbered steps for bootstrap, lint, format, test, add-deps, and any lock/check step.
|
|
||||||
5. **Conventions**: 3–5 bullets on config file preferences, execution patterns, and version pinning.
|
|
||||||
6. **Docker integration**: one paragraph on base image and cache strategy.
|
|
||||||
7. **Red flags**: 3–5 bullets on common anti-patterns.
|
|
||||||
8. **AGENTS.md updates**: add the skill to the **Ecosystem Skills** table and add load triggers for `planner`, `builder`, `coder`, and `tester` in the **Agent Skill-Loading Contract**.
|
|
||||||
9. **Agent prompt updates**: add the skill trigger to `agents/planner.md`, `agents/builder.md`, `agents/coder.md`, and `agents/tester.md`.
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
name: dispatching-parallel-agents
|
|
||||||
description: Safely parallelize independent lanes with isolation checks, explicit ownership, and single-agent integration
|
|
||||||
permalink: opencode-config/skills/dispatching-parallel-agents/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Dispatching Parallel Agents
|
|
||||||
|
|
||||||
Use this skill before parallel fan-out.
|
|
||||||
|
|
||||||
## Isolation Test (Required)
|
|
||||||
|
|
||||||
Before fan-out, verify that no two lanes share:
|
|
||||||
|
|
||||||
- **Claimed Files/Areas** under active mutation (paths or named workflow surfaces from the lane-claim entries)
|
|
||||||
- APIs or schemas being changed
|
|
||||||
- **Sequential verification dependencies** (verification steps that must run in order across lanes)
|
|
||||||
|
|
||||||
Overlapping claimed files/areas or sequential verification dependencies **forbid** parallel fan-out. Run those lanes sequentially.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. **Builder creates lane-claim entries** in the execution note before fan-out, recording for each lane: `Owner`, `Status` (→ `active`), `Claimed Files/Areas`, `Depends On`, and `Exit Condition`.
|
|
||||||
2. Run the isolation test above against the claimed files/areas and dependencies. Abort fan-out on any overlap.
|
|
||||||
3. Define lane scope, inputs, and outputs for each subagent.
|
|
||||||
4. Assign a single integrator (usually builder) for merge and final validation.
|
|
||||||
5. Each lane must return **compact verification evidence** in the shared shape (`Goal`, `Mode`, `Command/Check`, `Result`, `Key Evidence`, `Artifacts`, `Residual Risk`) — not just code output.
|
|
||||||
6. Integrate in dependency order; update lane statuses to `released` or `done`.
|
|
||||||
7. Run final end-to-end verification (`full` mode) after integration.
|
|
||||||
|
|
||||||
## Planner/Builder Expectations
|
|
||||||
|
|
||||||
- **Planner**: define intended lanes and claimed files/areas in the approved plan when parallelization is expected.
|
|
||||||
- **Builder**: load this skill before fan-out, create or update lane-claim entries in the execution note, mark them `active`/`released`/`done`/`blocked`, and enforce lane boundaries strictly.
|
|
||||||
- Claims are advisory markdown metadata, not hard runtime locks. Do not invent lockfiles or runtime enforcement.
|
|
||||||
|
|
||||||
## Red Flags
|
|
||||||
|
|
||||||
- Two lanes editing the same contract.
|
|
||||||
- Shared test fixtures causing non-deterministic outcomes.
|
|
||||||
- Missing integrator ownership.
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
name: docker-container-management
|
|
||||||
description: Reusable Docker container workflow for build, test, and dev tasks in containerized repos
|
|
||||||
permalink: opencode-config/skills/docker-container-management/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Docker Container Management
|
|
||||||
|
|
||||||
Load this skill when a repo uses Docker/docker-compose for builds, tests, or local dev, or when a task involves containerized workflows.
|
|
||||||
|
|
||||||
## Core Workflow
|
|
||||||
|
|
||||||
1. **Detect** — look for `Dockerfile`, `docker-compose.yml`/`compose.yml`, or `.devcontainer/` in the repo root.
|
|
||||||
2. **Prefer compose** — use `docker compose` (v2 CLI) over raw `docker run` when a compose file exists.
|
|
||||||
3. **Ephemeral containers** — default to `--rm` for one-off commands. Avoid leaving stopped containers behind.
|
|
||||||
4. **Named volumes over bind-mounts** for caches (e.g., package manager caches). Use bind-mounts only for source code.
|
|
||||||
5. **No host-path writes outside the repo** — all volume mounts must target paths inside the repo root or named volumes. This preserves `external_directory: deny`.
|
|
||||||
|
|
||||||
## Path and Volume Constraints
|
|
||||||
|
|
||||||
- Mount the repo root as the container workdir: `-v "$(pwd):/app" -w /app`.
|
|
||||||
- Never mount host paths outside the repository (e.g., `~/.ssh`, `/var/run/docker.sock`) unless the plan explicitly approves it with a stated reason.
|
|
||||||
- If root-owned artifacts appear after container runs, document cleanup steps (see `main/knowledge/worktree-cleanup-after-docker-owned-artifacts`).
|
|
||||||
|
|
||||||
## Agent Guidance
|
|
||||||
|
|
||||||
- **planner**: Use Docker during planning for context gathering and inspection (e.g., `docker compose config`, `docker ps`, `docker image ls`, `docker network ls`, checking container health or logs). Do not run builds, installs, tests, deployments, or any implementation-level commands — those belong to builder/tester/coder.
|
|
||||||
- **builder/coder**: Run builds and install steps inside containers. Prefer `docker compose run --rm <service> <cmd>` for one-off tasks.
|
|
||||||
- **tester**: Run test suites inside the same container environment used by CI. Capture container exit codes as verification evidence.
|
|
||||||
- **coder**: When writing Dockerfiles or compose files, keep layers minimal, pin base image tags, and use multi-stage builds when the final image ships.
|
|
||||||
|
|
||||||
## Red Flags
|
|
||||||
|
|
||||||
- `docker run` without `--rm` in automation scripts.
|
|
||||||
- Bind-mounting sensitive host paths (`/etc`, `~/.config`, `/var/run/docker.sock`).
|
|
||||||
- Building images without a `.dockerignore`.
|
|
||||||
- Using `latest` tag for base images in production Dockerfiles.
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
name: frontend-design
|
|
||||||
description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
|
|
||||||
permalink: opencode-config/skills/frontend-design/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Frontend Design
|
|
||||||
|
|
||||||
## When to Load
|
|
||||||
|
|
||||||
Load this skill when the task involves building, redesigning, or significantly styling a frontend component, page, or application. Triggers include: user requests for UI/UX implementation, wireframe-to-code work, visual redesigns, and new web interfaces.
|
|
||||||
|
|
||||||
## Design Thinking Checklist
|
|
||||||
|
|
||||||
Before writing code, answer these:
|
|
||||||
|
|
||||||
1. **Purpose** — What problem does this interface solve? Who is the audience?
|
|
||||||
2. **Brand / product context** — Does the project have existing design tokens, a style guide, or brand constraints? Follow them first; extend only where gaps exist.
|
|
||||||
3. **Aesthetic direction** — Commit to a clear direction (e.g., brutally minimal, maximalist, retro-futuristic, editorial, organic, luxury, playful, industrial). Intentionality matters more than intensity.
|
|
||||||
4. **Differentiation** — Identify the single most memorable element of the design.
|
|
||||||
5. **Constraints** — Note framework requirements, performance budgets, and accessibility targets (WCAG AA minimum).
|
|
||||||
|
|
||||||
## Implementation Checklist
|
|
||||||
|
|
||||||
- [ ] Produce production-grade, functional code (HTML/CSS/JS, React, Vue, etc.)
|
|
||||||
- [ ] Ensure the result is visually cohesive with a clear aesthetic point of view
|
|
||||||
- [ ] Respect accessibility: semantic HTML, sufficient contrast, keyboard navigation, focus management
|
|
||||||
- [ ] Respect performance: avoid heavy unoptimized assets; prefer CSS-only solutions for animation where practical
|
|
||||||
- [ ] Use CSS variables for color/theme consistency
|
|
||||||
- [ ] Match implementation complexity to the aesthetic vision — maximalist designs need elaborate effects; minimal designs need precision and restraint
|
|
||||||
|
|
||||||
## Aesthetic Guidance
|
|
||||||
|
|
||||||
- **Typography** — Choose distinctive, characterful fonts. Pair a display font with a refined body font. Avoid defaulting to the same choices across projects; vary intentionally.
|
|
||||||
- **Color & Theme** — Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Vary between light and dark themes across projects.
|
|
||||||
- **Motion** — Prioritize high-impact moments: a well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions. Use CSS animations where possible; use a motion library (e.g., Motion) for complex sequences. Include scroll-triggered and hover effects when they serve the design.
|
|
||||||
- **Spatial Composition** — Explore asymmetry, overlap, diagonal flow, grid-breaking elements, generous negative space, or controlled density.
|
|
||||||
- **Backgrounds & Atmosphere** — Build depth with gradient meshes, noise textures, geometric patterns, layered transparencies, shadows, grain overlays, or other contextual effects rather than defaulting to flat solid colors.
|
|
||||||
|
|
||||||
Avoid converging on the same fonts, color schemes, or layout patterns across generations. Each design should feel context-specific and intentional.
|
|
||||||
|
|
||||||
## TDD & Verification
|
|
||||||
|
|
||||||
Frontend code changes follow the project's TDD default policy. When the skill is loaded alongside `test-driven-development`:
|
|
||||||
|
|
||||||
- Write or update component/visual tests before implementation when a test harness exists.
|
|
||||||
- If no frontend test harness is available, state the exception and describe alternative verification (e.g., manual browser check, screenshot comparison).
|
|
||||||
- Satisfy `verification-before-completion` requirements before claiming the work is done.
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
name: javascript-typescript-development
|
|
||||||
description: JS/TS ecosystem defaults and workflows using bun for runtime/packaging and biome for linting/formatting
|
|
||||||
permalink: opencode-config/skills/javascript-typescript-development/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# JavaScript / TypeScript Development
|
|
||||||
|
|
||||||
Load this skill when a repo or lane involves JS/TS code (presence of `package.json`, `tsconfig.json`, or `.ts`/`.tsx`/`.js`/`.jsx` files as primary source).
|
|
||||||
|
|
||||||
## Defaults
|
|
||||||
|
|
||||||
| Concern | Tool | Notes |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| Runtime + package manager | `bun` | Replaces node+npm/yarn/pnpm for most tasks |
|
|
||||||
| Linting + formatting | `biome` | Replaces eslint+prettier |
|
|
||||||
| Test runner | `bun test` | Built-in; use vitest/jest only if repo already configures them |
|
|
||||||
| Type checking | `tsc --noEmit` | Always run before completion claims |
|
|
||||||
|
|
||||||
## Core Workflow
|
|
||||||
|
|
||||||
1. **Bootstrap** — `bun install` to install dependencies.
|
|
||||||
2. **Lint** — `bunx biome check .` before committing.
|
|
||||||
3. **Format** — `bunx biome format . --write` (or `--check` in CI).
|
|
||||||
4. **Test** — `bun test` with the repo's existing config. Follow TDD default policy.
|
|
||||||
5. **Add dependencies** — `bun add <pkg>` (runtime) or `bun add -D <pkg>` (dev).
|
|
||||||
6. **Type check** — `bunx tsc --noEmit` for TS repos.
|
|
||||||
|
|
||||||
## Conventions
|
|
||||||
|
|
||||||
- Prefer `biome.json` for lint/format config. Do not add `.eslintrc` or `.prettierrc` unless the repo already uses them.
|
|
||||||
- Use `bun run <script>` to invoke `package.json` scripts.
|
|
||||||
- Prefer ES modules (`"type": "module"` in `package.json`).
|
|
||||||
- Pin Node/Bun version via `.node-version` or `package.json` `engines` when deploying.
|
|
||||||
|
|
||||||
## Docker Integration
|
|
||||||
|
|
||||||
When the repo runs JS/TS inside Docker, use `oven/bun` as the base image. Mount a named volume for `node_modules` or use `bun install --frozen-lockfile` in CI builds.
|
|
||||||
|
|
||||||
## Red Flags
|
|
||||||
|
|
||||||
- Using `npm`/`yarn`/`pnpm` when `bun` is available and the project uses it.
|
|
||||||
- Running `eslint` or `prettier` when `biome` is configured.
|
|
||||||
- Missing `bun.lockb` after dependency changes.
|
|
||||||
- Skipping `tsc --noEmit` in TypeScript repos.
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
name: python-development
|
|
||||||
description: Python ecosystem defaults and workflows using uv for packaging and ruff for linting/formatting
|
|
||||||
permalink: opencode-config/skills/python-development/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Python Development
|
|
||||||
|
|
||||||
Load this skill when a repo or lane involves Python code (presence of `pyproject.toml`, `setup.py`, `requirements*.txt`, or `.py` files as primary source).
|
|
||||||
|
|
||||||
## Defaults
|
|
||||||
|
|
||||||
| Concern | Tool | Notes |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| Package/venv management | `uv` | Replaces pip, pip-tools, and virtualenv |
|
|
||||||
| Linting + formatting | `ruff` | Replaces flake8, isort, black |
|
|
||||||
| Test runner | `pytest` | Unless repo already uses another runner |
|
|
||||||
| Type checking | `pyright` or `mypy` | Use whichever the repo already configures |
|
|
||||||
|
|
||||||
## Core Workflow
|
|
||||||
|
|
||||||
1. **Bootstrap** — `uv sync` (or `uv pip install -e ".[dev]"`) to create/refresh the venv.
|
|
||||||
2. **Lint** — `ruff check .` then `ruff format --check .` before committing.
|
|
||||||
3. **Test** — `pytest` with the repo's existing config. Follow TDD default policy.
|
|
||||||
4. **Add dependencies** — `uv add <pkg>` (runtime) or `uv add --dev <pkg>` (dev). Do not edit `pyproject.toml` dependency arrays by hand.
|
|
||||||
5. **Lock** — `uv lock` after dependency changes.
|
|
||||||
|
|
||||||
## Conventions
|
|
||||||
|
|
||||||
- Prefer `pyproject.toml` over `setup.py`/`setup.cfg` for new projects.
|
|
||||||
- Keep `ruff` config in `pyproject.toml` under `[tool.ruff]`.
|
|
||||||
- Use `uv run <cmd>` to execute tools inside the managed venv without activating it.
|
|
||||||
- Pin Python version via `.python-version` or `pyproject.toml` `requires-python`.
|
|
||||||
|
|
||||||
## Docker Integration
|
|
||||||
|
|
||||||
When the repo runs Python inside Docker, install dependencies with `uv pip install` inside the container. Mount a named volume for the uv cache to speed up rebuilds.
|
|
||||||
|
|
||||||
## Red Flags
|
|
||||||
|
|
||||||
- Using `pip install` directly instead of `uv`.
|
|
||||||
- Running `black` or `isort` when `ruff` is configured.
|
|
||||||
- Missing `uv.lock` after dependency changes.
|
|
||||||
- Editing dependency arrays in `pyproject.toml` by hand instead of using `uv add`.
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
name: systematic-debugging
|
|
||||||
description: Diagnose failures with a hypothesis-first workflow, evidence capture, and escalation rules aligned to planner/builder
|
|
||||||
permalink: opencode-config/skills/systematic-debugging/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Systematic Debugging
|
|
||||||
|
|
||||||
Use this skill when tests fail, behavior regresses, or the root cause is unclear.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. Define the failure precisely (expected vs actual, where observed, reproducible command).
|
|
||||||
2. Capture a baseline with the smallest reliable repro.
|
|
||||||
3. List 1-3 concrete hypotheses and rank by likelihood.
|
|
||||||
4. Test one hypothesis at a time with targeted evidence collection.
|
|
||||||
5. Isolate the minimal root cause before proposing fixes.
|
|
||||||
6. Verify the fix with focused checks, then relevant regression checks.
|
|
||||||
|
|
||||||
## Evidence Requirements
|
|
||||||
|
|
||||||
- Record failing and passing commands.
|
|
||||||
- Keep key logs/errors tied to each hypothesis.
|
|
||||||
- Note why rejected hypotheses were ruled out.
|
|
||||||
|
|
||||||
## Planner/Builder Alignment
|
|
||||||
|
|
||||||
- Planner: use findings to shape bounded implementation tasks and verification oracles.
|
|
||||||
- Builder: if contradictions or hidden dependencies emerge, escalate back to planner.
|
|
||||||
- After two failed verification attempts, stop, record root cause evidence, and escalate.
|
|
||||||
|
|
||||||
## Output
|
|
||||||
|
|
||||||
- Root cause statement.
|
|
||||||
- Fix strategy linked to evidence.
|
|
||||||
- Verification results proving the issue is resolved and not regressed.
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
name: test-driven-development
|
|
||||||
description: Apply red-green-refactor by default for code changes, with narrowly defined exceptions and explicit alternate verification
|
|
||||||
permalink: opencode-config/skills/test-driven-development/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Test-Driven Development
|
|
||||||
|
|
||||||
Use this skill for all code changes unless a narrow exception applies.
|
|
||||||
|
|
||||||
## Default Cycle
|
|
||||||
|
|
||||||
1. Red: add or identify a test that fails for the target behavior.
|
|
||||||
2. Green: implement the minimal code change to make the test pass.
|
|
||||||
3. Refactor: improve structure while keeping tests green.
|
|
||||||
4. Re-run focused and relevant regression tests.
|
|
||||||
|
|
||||||
## Narrow Exceptions
|
|
||||||
|
|
||||||
Allowed exceptions only:
|
|
||||||
|
|
||||||
- docs-only changes
|
|
||||||
- config-only changes
|
|
||||||
- pure refactors with provably unchanged behavior
|
|
||||||
- repos without a reliable automated test harness
|
|
||||||
|
|
||||||
When using an exception, state:
|
|
||||||
|
|
||||||
- why TDD was not practical
|
|
||||||
- what alternative verification was used
|
|
||||||
|
|
||||||
## Role Expectations
|
|
||||||
|
|
||||||
- Planner: specify tasks and verification that preserve red-green-refactor intent.
|
|
||||||
- Builder/Coder: follow TDD during implementation or explicitly invoke a valid exception.
|
|
||||||
- Tester/Reviewer: verify that TDD evidence (or justified exception) is present.
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
name: verification-before-completion
|
|
||||||
description: Require evidence-backed verification before completion claims or final handoff
|
|
||||||
permalink: opencode-config/skills/verification-before-completion/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Verification Before Completion
|
|
||||||
|
|
||||||
Use this skill before declaring work done, handing off, or approving readiness.
|
|
||||||
|
|
||||||
## Verification Checklist
|
|
||||||
|
|
||||||
1. Re-state the promised outcome and scope boundaries.
|
|
||||||
2. Run the smallest reliable checks that prove requirements are met.
|
|
||||||
3. Run broader regression checks required by project workflow.
|
|
||||||
4. Confirm no known failures are being ignored.
|
|
||||||
5. Clean up temporary artifacts generated during work (e.g., scratch files, screenshots, logs, transient reports, caches). Intended committed deliverables are not cleanup targets.
|
|
||||||
6. Report residual risk, if any, explicitly.
|
|
||||||
|
|
||||||
## Evidence Standard
|
|
||||||
|
|
||||||
Use the compact verification summary shape for every evidence entry:
|
|
||||||
|
|
||||||
- **Goal** – what is being verified
|
|
||||||
- **Mode** – `smoke` (intermediate checkpoints) or `full` (final completion)
|
|
||||||
- **Command/Check** – exact command or manual check performed
|
|
||||||
- **Result** – `pass`, `fail`, `blocked`, or `not_run`
|
|
||||||
- **Key Evidence** – concise proof (output snippet, hash, assertion count)
|
|
||||||
- **Artifacts** – paths to logs/screenshots, or `none`
|
|
||||||
- **Residual Risk** – known gaps, or `none`
|
|
||||||
|
|
||||||
Keep raw logs out of primary context by default. When a check fails, summarize the failure first and then point to the raw evidence. Include full output only when explicitly requested.
|
|
||||||
|
|
||||||
Tie each evidence entry to an acceptance condition from the plan.
|
|
||||||
|
|
||||||
## Role Expectations
|
|
||||||
|
|
||||||
- Builder and tester: no completion claim without verification evidence in the compact shape above.
|
|
||||||
- Reviewer: reject completion claims that lack structured evidence or lane-ownership boundaries.
|
|
||||||
- Coder: include compact-shape verification evidence from the assigned lane before signaling done.
|
|
||||||
|
|
||||||
## If Verification Fails
|
|
||||||
|
|
||||||
- Do not claim partial completion as final.
|
|
||||||
- Return to debugging or implementation with updated hypotheses.
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
name: writing-plans
|
|
||||||
description: Planner workflow for producing execution-ready approved plans with explicit scope, lanes, and verification oracle
|
|
||||||
permalink: opencode-config/skills/writing-plans/skill
|
|
||||||
---
|
|
||||||
|
|
||||||
# Writing Plans
|
|
||||||
|
|
||||||
Use this skill when converting intent into an execution-ready `plans/<slug>` note.
|
|
||||||
|
|
||||||
## Required Plan Shape
|
|
||||||
|
|
||||||
Every approved plan must include:
|
|
||||||
|
|
||||||
- Objective
|
|
||||||
- Scope and out-of-scope boundaries
|
|
||||||
- Constraints and assumptions
|
|
||||||
- Concrete task list
|
|
||||||
- Parallelization lanes and dependency notes
|
|
||||||
- Verification oracle
|
|
||||||
- Risks and open findings
|
|
||||||
|
|
||||||
When parallelization or phased verification matters, each lane must also specify:
|
|
||||||
|
|
||||||
- **Claimed files/areas** — paths or named surfaces the lane owns exclusively.
|
|
||||||
- **Dependencies** — which lanes (if any) must complete first.
|
|
||||||
- **Verification intent** — what will be checked and at what mode (`smoke` for intermediate checkpoints, `full` for final completion). Default to the shared mode rules in `AGENTS.md` when not otherwise specified.
|
|
||||||
|
|
||||||
The plan must give builder enough information to create the structured `executions/<slug>` note (lane claims, ownership, exit conditions, verification ledger shape) without guessing.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. Gather enough evidence to remove guesswork.
|
|
||||||
2. Decompose work into bounded tasks with clear owners.
|
|
||||||
3. Define verification per task and for final integration.
|
|
||||||
4. Check contract alignment with planner -> builder handoff rules.
|
|
||||||
5. Mark `Status: approved` only when execution can proceed without improvisation.
|
|
||||||
|
|
||||||
## Quality Gates
|
|
||||||
|
|
||||||
- No ambiguous acceptance criteria.
|
|
||||||
- No hidden scope expansion.
|
|
||||||
- Verification is specific and runnable.
|
|
||||||
- Lane claims do not overlap in files or verification steps when parallel execution is intended.
|
|
||||||
- Verification mode (`smoke` or `full`) is stated or defaults are unambiguous for each checkpoint.
|
|
||||||
@@ -7,3 +7,5 @@
|
|||||||
[user]
|
[user]
|
||||||
email = alexander@wiesner.com.br
|
email = alexander@wiesner.com.br
|
||||||
name = alex wiesner
|
name = alex wiesner
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
.worktrees/
|
.worktrees/
|
||||||
|
.pi/npm/
|
||||||
|
.pi/agent/sessions/
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
---
|
|
||||||
title: decisions
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/decisions
|
|
||||||
---
|
|
||||||
|
|
||||||
# Dotfiles Decisions
|
|
||||||
|
|
||||||
## Desktop Environment: Hyprland + Wayland
|
|
||||||
|
|
||||||
- **Decision:** Hyprland as primary compositor, full Wayland stack
|
|
||||||
- **Rationale:** Modern Wayland compositor with tiling, animations, and good HiDPI support
|
|
||||||
- **Constraints:** XWayland needed for legacy apps; special window rule to suppress maximize events
|
|
||||||
- **Input:** Caps Lock remapped to Super (`caps:super`), `alts_toggle` for US/BR layout switching
|
|
||||||
|
|
||||||
## Shell: Fish (not Bash/Zsh)
|
|
||||||
|
|
||||||
- **Decision:** Fish as primary interactive shell; bash/zsh configs retained for compatibility
|
|
||||||
- **Rationale:** Better autocompletion, syntax highlighting, friendly defaults
|
|
||||||
- **Plugin manager:** fisher (minimal, text-file-based)
|
|
||||||
- **No `oh-my-fish`** — prefer minimal plugin set (just catppuccin theme)
|
|
||||||
|
|
||||||
## Theme: Catppuccin Mocha (global)
|
|
||||||
|
|
||||||
- **Decision:** Single colorscheme (Catppuccin Mocha) applied uniformly across all tools
|
|
||||||
- **Rationale:** Consistent visual identity; official plugins available for Fish, Neovim, Kitty
|
|
||||||
- **Other variants installed:** Frappe, Macchiato, Mocha static — available in `fish/themes/` but Mocha is active
|
|
||||||
- **No per-tool theming exceptions** — all tools must use Catppuccin Mocha
|
|
||||||
|
|
||||||
## Editor: Neovim with lazy.nvim
|
|
||||||
|
|
||||||
- **Decision:** Neovim (not VSCode or other) as primary editor
|
|
||||||
- **Plugin manager:** lazy.nvim (not packer, not vim-plug) — auto-bootstrapped from init.lua
|
|
||||||
- **LSP strategy:** mason.nvim for tooling installation + mason-lspconfig for auto-enable; capabilities injected globally via cmp_nvim_lsp
|
|
||||||
- **Format strategy:** conform.nvim with format-on-save (not LSP formatting directly); lsp_fallback=true for unconfigured filetypes
|
|
||||||
- **No treesitter-based formatting** — explicit per-filetype formatters in conform
|
|
||||||
|
|
||||||
## OpenCode: Custom Multi-Agent Config
|
|
||||||
|
|
||||||
- **Decision:** Fully custom multi-agent configuration (not default OpenCode setup)
|
|
||||||
- **10 specialized agents** each with tailored instructions, model, temperature, permissions
|
|
||||||
- **Memory pattern:** `.memory/` directory tracked in git; agents write to `.memory/*` directly
|
|
||||||
- **Permission model:** Full edit for lead/coder/librarian; all others restricted to `.memory/*` writes (instruction-level enforcement, not tool-level)
|
|
||||||
- **AGENTS.md exception:** In the opencode subdir, `AGENTS.md` is NOT a symlink (it's the global OpenCode config file, distinct from the per-project `AGENTS.md` pattern)
|
|
||||||
- See [OpenCode Architecture](research/opencode-architecture.md) for details
|
|
||||||
|
|
||||||
## Waybar CPU Monitor: Ghostty (not Kitty)
|
|
||||||
|
|
||||||
- **Observation:** `cpu` module in Waybar opens `ghostty -e htop` on click — Ghostty may be installed as secondary terminal
|
|
||||||
- **Impact:** Kitty is the primary terminal (SUPER+Return), but Ghostty is referenced in Waybar config
|
|
||||||
|
|
||||||
## Git Credentials: gh CLI
|
|
||||||
|
|
||||||
- **Decision:** Use `gh auth git-credential` as credential helper for GitHub + Gist
|
|
||||||
- **Rationale:** Centralizes auth through GitHub CLI; no plaintext tokens in git config
|
|
||||||
|
|
||||||
## SSH Key Type: Ed25519
|
|
||||||
|
|
||||||
- **Decision:** Ed25519 for SSH key (not RSA)
|
|
||||||
- **Rationale:** Modern, fast, smaller key size
|
|
||||||
|
|
||||||
## No Global `.gitignore` in Dotfiles
|
|
||||||
|
|
||||||
- **Observation:** No global gitignore file visible; tracking is managed per-repo
|
|
||||||
- **Pattern:** Sensitive SSH private key `.ssh/id_ed25519` is tracked — implies this repo may use filesystem permissions for security
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
title: critic-gate-tmux-shift-enter-fix
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/decisions/critic-gate-tmux-shift-enter-fix
|
|
||||||
tags:
|
|
||||||
- tmux
|
|
||||||
- critic-gate
|
|
||||||
- approved
|
|
||||||
---
|
|
||||||
|
|
||||||
# Critic Gate: tmux Shift+Enter Fix
|
|
||||||
|
|
||||||
## Verdict
|
|
||||||
- [decision] APPROVED — Plan is minimal, correctly scoped, and non-destructive.
|
|
||||||
|
|
||||||
## Rationale
|
|
||||||
- Single `bind-key -n S-Enter send-keys "\n"` addition to `~/.tmux.conf`.
|
|
||||||
- `extended-keys on` (line 8) and `extkeys` terminal feature (line 9) already present — `S-Enter` will be recognised.
|
|
||||||
- No existing conflicting bindings in `.tmux.conf`.
|
|
||||||
- Config will load cleanly; standard tmux syntax.
|
|
||||||
|
|
||||||
## Assumption Challenges
|
|
||||||
- [finding] `S-Enter` key name is valid because extended-keys is already enabled. ✅
|
|
||||||
- [finding] `send-keys "\n"` sends LF (0x0A). For TUI apps and multi-line tools, this inserts a newline as intended. For bare shell prompts, LF may still trigger accept-line (same as Enter). No shell-side `bindkey` exists in `.zshrc` to differentiate. This is a known limitation, not a blocker — follow-up zle binding may be needed.
|
|
||||||
|
|
||||||
## Files Evaluated
|
|
||||||
- `/home/alex/dotfiles/.tmux.conf` (57 lines, all relevant config)
|
|
||||||
- `/home/alex/dotfiles/.zshrc` (2 lines, no keybindings)
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- gates [[tmux-shift-enter-fix]]
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
title: doc-coverage-waybar-pomodoro-fix
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/gates/doc-coverage-waybar-pomodoro-fix
|
|
||||||
tags:
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- documentation
|
|
||||||
- doc-coverage
|
|
||||||
---
|
|
||||||
|
|
||||||
# Documentation Coverage: Waybar Pomodoro Visibility Fix
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Documentation coverage reviewed for the waybar pomodoro visibility fix (explicit binary path instead of PATH reliance).
|
|
||||||
|
|
||||||
## Observations
|
|
||||||
|
|
||||||
- [decision] No repo documentation changes needed for the pomodoro visibility fix — this is a personal dotfiles repo with no README, no docs/ directory, and AGENTS.md contains only agent workflow config, not dotfiles-specific documentation
|
|
||||||
- [decision] Changed files (`.config/waybar/config`, `.config/waybar/scripts/pomodoro-preset.sh`) are self-documenting through clear variable naming (`POMODORO_BIN`) and standard Waybar config format
|
|
||||||
- [decision] The plan note `plans/waybar-pomodoro-not-showing` already records full execution context, outcomes, and verification results — no additional knowledge capture needed
|
|
||||||
|
|
||||||
## Surfaces Checked
|
|
||||||
|
|
||||||
| Surface | Exists | Update Needed | Reason |
|
|
||||||
|---|---|---|---|
|
|
||||||
| README | No | N/A | Personal dotfiles repo, no README |
|
|
||||||
| docs/ | No | N/A | No docs directory exists |
|
|
||||||
| AGENTS.md | Yes | No | Contains only agent workflow config, not dotfiles project docs |
|
|
||||||
| Inline docs | Yes (self-documenting) | No | Variable naming and script structure are clear |
|
|
||||||
| Plan note | Yes | No | Already has execution notes and outcomes |
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
|
|
||||||
- documents [[waybar-pomodoro-not-showing]]
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
---
|
|
||||||
title: gate-tmux-shift-enter-fix-review
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/gates/gate-tmux-shift-enter-fix-review
|
|
||||||
tags:
|
|
||||||
- tmux
|
|
||||||
- review
|
|
||||||
- gate
|
|
||||||
- approved
|
|
||||||
---
|
|
||||||
|
|
||||||
# Gate: tmux Shift+Enter Fix — Correctness Review
|
|
||||||
|
|
||||||
## Verdict
|
|
||||||
- [decision] APPROVED — REVIEW_SCORE: 0
|
|
||||||
|
|
||||||
## Findings
|
|
||||||
- [observation] No CRITICAL or WARNING issues found.
|
|
||||||
- [observation] `bind-key -n S-Enter send-keys "\n"` is semantically correct for the stated intent.
|
|
||||||
- [observation] Prerequisite `extended-keys on` is present and positioned before the binding.
|
|
||||||
- [observation] Terminal features line (`xterm-kitty:extkeys`) enables the terminal to report extended key sequences.
|
|
||||||
- [observation] No conflicting bindings exist in the config.
|
|
||||||
- [observation] Config ordering is correct — prerequisites before the binding.
|
|
||||||
|
|
||||||
## Evidence Checked
|
|
||||||
- [observation] Line 8: `set -s extended-keys on` — enables tmux to recognize modified keys like `S-Enter`.
|
|
||||||
- [observation] Line 9: `set -as terminal-features 'xterm-kitty:extkeys'` — tells tmux the terminal supports extended keys.
|
|
||||||
- [observation] Line 10: `bind-key -n S-Enter send-keys "\n"` — root-table binding, sends literal newline. Correct.
|
|
||||||
- [observation] No other `Enter`-related or `S-Enter` bindings exist that could conflict.
|
|
||||||
- [observation] `-n` flag correctly targets root table (no prefix key needed).
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- reviews [[plans/tmux-shift-enter-fix]]
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
title: gate-waybar-pomodoro-not-showing-review
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/gates/gate-waybar-pomodoro-not-showing-review
|
|
||||||
tags:
|
|
||||||
- gate
|
|
||||||
- review
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- approved
|
|
||||||
---
|
|
||||||
|
|
||||||
# Gate: Waybar Pomodoro Not Showing — Correctness Review
|
|
||||||
|
|
||||||
## Verdict
|
|
||||||
- [decision] APPROVED — REVIEW_SCORE: 0 #gate #approved
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
- Reviewed `.config/waybar/config`
|
|
||||||
- Reviewed `.config/waybar/scripts/pomodoro-preset.sh`
|
|
||||||
- Cross-referenced plan `[[waybar-pomodoro-not-showing]]` (`memory://plans/waybar-pomodoro-not-showing`)
|
|
||||||
- Confirmed prior critic guidance is reflected in current code
|
|
||||||
|
|
||||||
## Evidence checked
|
|
||||||
- [evidence] `.config/waybar/config:136-139` now uses `$HOME/.local/bin/waybar-module-pomodoro` for `exec`, `on-click`, and `on-click-middle`, while preserving the existing preset script hook for right-click
|
|
||||||
- [evidence] `.config/waybar/scripts/pomodoro-preset.sh:6-10` introduces `POMODORO_BIN="$HOME/.local/bin/waybar-module-pomodoro"` and replaces PATH-dependent lookup with an executable-file guard
|
|
||||||
- [evidence] `.config/waybar/scripts/pomodoro-preset.sh:30-32` routes `set-work`, `set-short`, and `set-long` through the same explicit binary path
|
|
||||||
- [evidence] Repository search found pomodoro binary references only in the expected changed lines, with no stale bare `waybar-module-pomodoro` invocations remaining in `.config/waybar/config` or `.config/waybar/scripts/pomodoro-preset.sh`
|
|
||||||
- [evidence] Fresh verification supplied by lead/coder: `bash -n` on the script passed; `/home/alex/.local/bin/waybar-module-pomodoro --help` succeeded and confirmed required subcommands/options exist
|
|
||||||
|
|
||||||
## Findings
|
|
||||||
- [observation] No correctness defects found in the reviewed change set
|
|
||||||
- [observation] The implementation matches the approved minimal fix for launch-time PATH mismatch and updates all user-triggered pomodoro entry points called out in the plan pre-mortem
|
|
||||||
|
|
||||||
## Related regression checks
|
|
||||||
- [check] `.config/waybar/config:136-139` — no stale bare binary references remain in `exec`, left-click toggle, right-click preset hook, or middle-click reset
|
|
||||||
- [check] `.config/waybar/scripts/pomodoro-preset.sh:6-10,30-32` — helper now uses one consistent binary path for validation and all preset subcommands; no path drift found in changed lines
|
|
||||||
|
|
||||||
## Freshness notes
|
|
||||||
- [finding] Prior critic guidance was confirmed, not contradicted: the old PATH-based guard was removed and replaced with an explicit executable-path check, matching the approved fix direction
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- gates [[waybar-pomodoro-not-showing]]
|
|
||||||
- related_to [[waybar-pomodoro-not-showing]]
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
title: gate-waybar-pomodoro-not-showing
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/gates/gate-waybar-pomodoro-not-showing
|
|
||||||
tags:
|
|
||||||
- gate
|
|
||||||
- critic
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- approved
|
|
||||||
---
|
|
||||||
|
|
||||||
# Critic Gate: Waybar Pomodoro Not Showing
|
|
||||||
|
|
||||||
## Verdict
|
|
||||||
- [decision] APPROVED — plan is clear, correctly scoped, and adequately de-risked #gate #approved
|
|
||||||
|
|
||||||
## Rationale
|
|
||||||
- [finding] Root cause (bare binary name in PATH-less Waybar launch environment) is the most likely explanation and is well-supported by explorer research
|
|
||||||
- [finding] All 8 bare `waybar-module-pomodoro` references are confined to the two target files: `.config/waybar/config` (3 refs) and `.config/waybar/scripts/pomodoro-preset.sh` (5 refs) — no other source files reference this binary
|
|
||||||
- [finding] Verification steps (bash -n, --help check) adequately gate against the alternative failure mode of a missing binary
|
|
||||||
- [finding] Plan scope is correctly limited to pomodoro-only; no decomposition needed
|
|
||||||
|
|
||||||
## Assumption Challenges
|
|
||||||
- [challenge] Binary path validity → mitigated by plan's --help verification step
|
|
||||||
- [challenge] Completeness of reference coverage → confirmed all 8 references across both files; no others in repo
|
|
||||||
- [challenge] JSONC $HOME expansion → confirmed Waybar does shell-expand $HOME in exec/on-click fields (existing config uses it on lines 94, 138)
|
|
||||||
|
|
||||||
## Coder Guidance
|
|
||||||
- [recommendation] Update or remove the `command -v waybar-module-pomodoro` guard (line 7 of pomodoro-preset.sh) since it checks bare PATH and will fail in the same environment that caused the original bug
|
|
||||||
- [recommendation] Consider using `$HOME/.local/bin/waybar-module-pomodoro` to match existing config style conventions (lines 94, 138 already use `$HOME`)
|
|
||||||
|
|
||||||
## Files Evaluated
|
|
||||||
- `.config/waybar/config` (142 lines)
|
|
||||||
- `.config/waybar/scripts/pomodoro-preset.sh` (33 lines)
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- gates [[waybar-pomodoro-not-showing]]
|
|
||||||
- related_to [[knowledge]]
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
---
|
|
||||||
title: gate-waybar-pomodoro-visibility-fix
|
|
||||||
type: gate
|
|
||||||
permalink: dotfiles/gates/gate-waybar-pomodoro-visibility-fix
|
|
||||||
tags:
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- gate
|
|
||||||
- pass
|
|
||||||
---
|
|
||||||
|
|
||||||
# Gate: Waybar Pomodoro Visibility Fix
|
|
||||||
|
|
||||||
**Status:** PASS
|
|
||||||
**Date:** 2026-03-12
|
|
||||||
**Plan ref:** [[waybar-pomodoro-not-showing]]
|
|
||||||
**Scope:** `.config/waybar/config`, `.config/waybar/scripts/pomodoro-preset.sh`
|
|
||||||
|
|
||||||
## Verdict Summary
|
|
||||||
|
|
||||||
The implementation correctly addresses the root cause (PATH mismatch between Hyprland/Waybar environment and interactive shell). All four invocation points for `waybar-module-pomodoro` are now explicit, and no residual bare-binary references remain. Both standard and adversarial checks pass.
|
|
||||||
|
|
||||||
## Standard Pass
|
|
||||||
|
|
||||||
### Acceptance Criteria Verification
|
|
||||||
|
|
||||||
| Criterion | Result |
|
|
||||||
|---|---|
|
|
||||||
| `custom/pomodoro` exec uses explicit path | ✅ Line 136: `$HOME/.local/bin/waybar-module-pomodoro --no-work-icons` |
|
|
||||||
| on-click uses explicit path | ✅ Line 137: `$HOME/.local/bin/waybar-module-pomodoro toggle` |
|
|
||||||
| on-click-middle uses explicit path | ✅ Line 139: `$HOME/.local/bin/waybar-module-pomodoro reset` |
|
|
||||||
| on-click-right still delegates to preset script | ✅ Line 138 unchanged |
|
|
||||||
| Preset script no longer uses PATH-dependent guard | ✅ `[[ ! -x "$POMODORO_BIN" ]]` replaces `command -v` |
|
|
||||||
| Preset script routes all set-* calls through `$POMODORO_BIN` | ✅ Lines 30–32 |
|
|
||||||
| Change is pomodoro-scoped only | ✅ No other modules touched |
|
|
||||||
| Binary syntax check (`bash -n`) passes | ✅ (Lead evidence, exit 0) |
|
|
||||||
| Binary exists and responds to `--help` | ✅ (Lead evidence, exit 0 with usage) |
|
|
||||||
|
|
||||||
### Pre-mortem Risk Tracking
|
|
||||||
|
|
||||||
| Risk | Status |
|
|
||||||
|---|---|
|
|
||||||
| Middle-click reset still using bare name | Resolved — line 139 uses explicit path |
|
|
||||||
| Only one entry point updated | Resolved — all four updated |
|
|
||||||
| Preset helper using `command -v` | Resolved — replaced with `[[ ! -x ... ]]` |
|
|
||||||
| Binary path unstable across sessions | Not triggered — binary confirmed at path |
|
|
||||||
|
|
||||||
## Adversarial Pass
|
|
||||||
|
|
||||||
### Hypotheses
|
|
||||||
|
|
||||||
| # | Hypothesis | Design | Expected failure | Observed |
|
|
||||||
|---|---|---|---|---|
|
|
||||||
| H1 | Empty/corrupt STATE_FILE causes crash | State file exists but empty | `current` reads as `""`, falls to else-branch | Safe: defaults to B-preset (short cycle), no crash |
|
|
||||||
| H2 | Binary missing/non-executable | Guard `[[ ! -x ]]` fires | Exit 1 with stderr | Guard correctly triggers, script exits cleanly |
|
|
||||||
| H3 | `$HOME` unset in Waybar env | `$HOME/.local/bin/...` fails to expand | Module fails silently | Same risk applies to all other modules using `$HOME` (line 94: `custom/uptime`); no regression introduced |
|
|
||||||
| H4 | `set -e` aborts mid-preset (daemon down) | First `set-work` fails → remaining calls skipped | Partial preset applied | Pre-existing behavior; not a regression from this change |
|
|
||||||
| H5 | STATE_FILE lost on reboot (`/tmp`) | Preset reverts to A-cycle | Unexpected preset on first right-click post-reboot | Intentional design, not a regression |
|
|
||||||
| H6 | No bare `pomodoro` left anywhere in config | Grep scan | Old reference found | Zero old references found — clean |
|
|
||||||
|
|
||||||
### Mutation Checks
|
|
||||||
|
|
||||||
| Mutation | Would current tests detect? |
|
|
||||||
|---|---|
|
|
||||||
| One of exec/on-click/on-click-middle reverted to bare name | Yes — structural grep confirms all three use explicit path |
|
|
||||||
| `POMODORO_BIN` guard inverted (`-x` instead of `! -x`) | Yes — guard would skip missing-binary error |
|
|
||||||
| `read -r current` without fallback | Caught — `|| current="A"` handles failure |
|
|
||||||
| `set-work` but not `set-short`/`set-long` through `$POMODORO_BIN` | Yes — all three lines verified |
|
|
||||||
|
|
||||||
**MUTATION_ESCAPES: 0/4**
|
|
||||||
|
|
||||||
## Unverified Aspects (Residual Risk)
|
|
||||||
|
|
||||||
1. **Live Waybar rendering** — Cannot verify the module actually appears on the bar without a running Waybar session. The Lead noted this is impractical in the task context.
|
|
||||||
2. **Binary behavior correctness** — `--help` confirms the binary exists and accepts the right subcommands, but actual timer JSON output format was not sampled. The `return-type: json` config assumes the binary outputs conforming JSON.
|
|
||||||
3. **`$HOME` behavior under Waybar systemd unit** — Low risk (all other `$HOME`-using modules work), but not runtime-confirmed.
|
|
||||||
|
|
||||||
These residual risks are infrastructure-gated (no running Wayland/Waybar session available in this context), not implementation defects.
|
|
||||||
|
|
||||||
## Lesson Checks
|
|
||||||
|
|
||||||
- [confirmed] PATH mismatch is the failure mode for Waybar custom modules — explicit paths are the correct fix pattern.
|
|
||||||
- [confirmed] `[[ ! -x path ]]` guard is the right check for script-invoked binary dependencies.
|
|
||||||
- [not observed] Any silent failures from the old `command -v` approach (fix is in place, no regression).
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- resolves [[waybar-pomodoro-not-showing]]
|
|
||||||
@@ -1,194 +0,0 @@
|
|||||||
---
|
|
||||||
title: knowledge
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/knowledge
|
|
||||||
---
|
|
||||||
|
|
||||||
# Dotfiles Knowledge
|
|
||||||
|
|
||||||
## Project Purpose
|
|
||||||
|
|
||||||
Personal dotfiles for `alex` on a Linux/Wayland desktop. Managed as a bare or normal git repo in `~/dotfiles/`. Covers the full desktop stack: shell, editor, compositor, terminal, status bar, notifications, and AI tooling.
|
|
||||||
|
|
||||||
## Repository Layout
|
|
||||||
|
|
||||||
```
|
|
||||||
~/dotfiles/
|
|
||||||
├── .bash_profile / .bashrc / .zshrc / .profile # Legacy/fallback shell configs
|
|
||||||
├── .gitconfig # Git global config (gh credential helper)
|
|
||||||
├── .ssh/ # SSH keys and known_hosts
|
|
||||||
└── .config/
|
|
||||||
├── dunst/ # Notification daemon
|
|
||||||
├── fish/ # Primary shell
|
|
||||||
├── hypr/ # Wayland compositor + screen lock
|
|
||||||
├── kitty/ # Terminal emulator
|
|
||||||
├── nvim/ # Editor (Neovim)
|
|
||||||
├── opencode/ # AI coding assistant (complex subsystem)
|
|
||||||
├── rofi/ # App launcher
|
|
||||||
├── waybar/ # Status bar
|
|
||||||
└── zathura/ # PDF viewer
|
|
||||||
```
|
|
||||||
|
|
||||||
## Desktop Stack
|
|
||||||
|
|
||||||
| Layer | Tool | Notes |
|
|
||||||
|---|---|---|
|
|
||||||
| Compositor | Hyprland | Wayland, tiling, dwindle layout |
|
|
||||||
| Terminal | Kitty | GPU-accelerated |
|
|
||||||
| Shell | Fish | Primary shell |
|
|
||||||
| Editor | Neovim | lazy.nvim plugin manager |
|
|
||||||
| Status bar | Waybar | Bottom layer, top position |
|
|
||||||
| App launcher | Rofi | `rofi -show drun` |
|
|
||||||
| Notifications | Dunst | |
|
|
||||||
| Screen lock | Hyprlock | `SUPER+C` |
|
|
||||||
| Screenshots | Hyprshot | Print=region, Shift+Print=output |
|
|
||||||
| File manager | Thunar | |
|
|
||||||
| Browser | Brave | `SUPER+B` / `SUPER+SHIFT+B` incognito |
|
|
||||||
| Email | Thunderbird | `SUPER+M` |
|
|
||||||
| VPN | ProtonVPN | Auto-started via hyprland exec-once |
|
|
||||||
| Mail bridge | Protonmail Bridge | Auto-started `--no-window` |
|
|
||||||
| PDF viewer | Zathura | |
|
|
||||||
|
|
||||||
## Hyprland Configuration
|
|
||||||
|
|
||||||
File: `.config/hypr/hyprland.conf`
|
|
||||||
|
|
||||||
- **mainMod:** SUPER (`caps:super` — Caps Lock acts as Super)
|
|
||||||
- **Layout:** dwindle (no gaps, border_size=1, rounding=10)
|
|
||||||
- **Keyboard:** `us, br` layouts; `alts_toggle` (Alt+Shift switches layout)
|
|
||||||
- **Animations:** disabled
|
|
||||||
- **Autostart:** waybar, nm-applet, protonmail-bridge --no-window, protonvpn-app
|
|
||||||
|
|
||||||
### Key Bindings
|
|
||||||
```
|
|
||||||
SUPER+Return kitty
|
|
||||||
SUPER+Q kill window
|
|
||||||
SUPER+E thunar
|
|
||||||
SUPER+Space rofi
|
|
||||||
SUPER+F fullscreen
|
|
||||||
SUPER+B/Shift+B brave / brave --incognito
|
|
||||||
SUPER+M thunderbird
|
|
||||||
SUPER+V protonvpn-app
|
|
||||||
SUPER+C hyprlock
|
|
||||||
Print hyprshot -m region
|
|
||||||
Shift+Print hyprshot -m output
|
|
||||||
SUPER+h/j/k/l move focus (vim dirs)
|
|
||||||
SUPER+SHIFT+h/j/k/l move window
|
|
||||||
SUPER+1-9/0 switch workspace
|
|
||||||
SUPER+SHIFT+1-9/0 move to workspace
|
|
||||||
SUPER+S scratchpad toggle
|
|
||||||
SUPER+R resize submap (h/j/k/l = 30px steps)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Theme: Catppuccin Mocha
|
|
||||||
|
|
||||||
Applied uniformly across all tools:
|
|
||||||
|
|
||||||
| Tool | Config file |
|
|
||||||
|---|---|
|
|
||||||
| Hyprland borders | `hyprland.conf` (lavender→mauve active, surface0 inactive) |
|
|
||||||
| Kitty | `kitty/kitty.conf` (full 16-color palette) |
|
|
||||||
| Neovim | `nvim/lua/plugins/colorscheme.lua` (catppuccin/nvim, flavour=mocha) |
|
|
||||||
| Fish | `fish/config.fish` (Catppuccin Mocha theme via fish_config) |
|
|
||||||
| Fish plugin | `fish/fish_plugins` (catppuccin/fish installed via fisher) |
|
|
||||||
|
|
||||||
Key colors: bg=#1e1e2e, fg=#cdd6f4, lavender=#b4befe, mauve=#cba6f7, crust=#11111b, surface0=#313244
|
|
||||||
|
|
||||||
## Shell: Fish
|
|
||||||
|
|
||||||
Files: `.config/fish/`
|
|
||||||
|
|
||||||
- **Plugin manager:** fisher (jorgebucaran/fisher)
|
|
||||||
- **Plugins:** catppuccin/fish
|
|
||||||
- **Theme:** Catppuccin Mocha (set in config.fish)
|
|
||||||
|
|
||||||
### Functions / Aliases
|
|
||||||
| Function | Expands to | Purpose |
|
|
||||||
|---|---|---|
|
|
||||||
| `c` | `opencode` | Launch OpenCode AI assistant |
|
|
||||||
| `cc` | `opencode --continue` | Continue last OpenCode session |
|
|
||||||
| `co` | `copilot` | GitHub Copilot CLI |
|
|
||||||
| `n` | `nvim` | Neovim |
|
|
||||||
|
|
||||||
## Editor: Neovim
|
|
||||||
|
|
||||||
Files: `.config/nvim/`
|
|
||||||
|
|
||||||
- **Entry:** `init.lua` — sets `mapleader=<Space>`, bootstraps lazy.nvim
|
|
||||||
- **Plugins:** all in `lua/plugins/`, auto-loaded via `{ import = 'plugins' }`
|
|
||||||
- **Options:** `number=true`, `relativenumber=true`, `wrap=false`
|
|
||||||
|
|
||||||
### Plugin List
|
|
||||||
|
|
||||||
| Plugin | File | Purpose |
|
|
||||||
|---|---|---|
|
|
||||||
| catppuccin/nvim | colorscheme.lua | Mocha colorscheme, priority=1000 |
|
|
||||||
| nvim-cmp | cmp.lua | Completion engine |
|
|
||||||
| stevearc/conform.nvim | conform.lua | Format on save |
|
|
||||||
| folke/lazydev | lazydev.lua | Neovim Lua dev assistance |
|
|
||||||
| neovim/nvim-lspconfig | lspconfig.lua | LSP client config |
|
|
||||||
| L3MON4D3/LuaSnip | luasnip.lua | Snippet engine |
|
|
||||||
| williamboman/mason.nvim | mason.lua | LSP/tool installer UI |
|
|
||||||
| mason-lspconfig.nvim | mason-lspconfig.lua | Mason+LSP bridge, auto-install |
|
|
||||||
| jay-babu/mason-null-ls | mason-null-ls.lua | Mason+null-ls bridge |
|
|
||||||
| nvimtools/none-ls | none-ls.lua | LSP diagnostics from external tools |
|
|
||||||
| opencode-ai/nvim-opencode | opencode.lua | OpenCode integration |
|
|
||||||
| nvim-telescope/telescope | telescope.lua | Fuzzy finder |
|
|
||||||
| nvim-treesitter | treesitter.lua | Syntax parsing |
|
|
||||||
|
|
||||||
### Keymaps
|
|
||||||
```
|
|
||||||
<leader>e vim.cmd.Ex (file explorer)
|
|
||||||
<leader>ww save file
|
|
||||||
<leader>ff Telescope find_files
|
|
||||||
<leader>fg Telescope live_grep
|
|
||||||
<leader>fb Telescope buffers
|
|
||||||
<leader>fh Telescope help_tags
|
|
||||||
<leader>f Conform format (async)
|
|
||||||
```
|
|
||||||
|
|
||||||
### LSP / Formatting
|
|
||||||
- **mason-lspconfig:** `automatic_installation=true`, `automatic_enable=true`; injects `cmp_nvim_lsp` capabilities to all LSP servers globally
|
|
||||||
- **conform formatters by filetype:**
|
|
||||||
- lua → stylua
|
|
||||||
- js/ts/jsx/tsx/json/yaml/md → prettier
|
|
||||||
- python → ruff_format
|
|
||||||
- go → gofmt
|
|
||||||
- **format_on_save:** timeout_ms=500, lsp_fallback=true
|
|
||||||
- **Diagnostics:** virtual_text, signs, underline; float border=rounded, source=always
|
|
||||||
|
|
||||||
## Status Bar: Waybar
|
|
||||||
|
|
||||||
File: `.config/waybar/config` + `style.css` + `scripts/pomodoro-preset.sh`
|
|
||||||
|
|
||||||
- Layer: bottom, position: top, spacing: 6
|
|
||||||
- **Left:** backlight, wireplumber, custom/pomodoro
|
|
||||||
- **Center:** clock (`{:%H:%M - %a,%d}`, interval=1)
|
|
||||||
- **Right:** tray, bluetooth, temperature, cpu, memory, battery
|
|
||||||
- **Pomodoro:** external `waybar-module-pomodoro` binary; left=toggle, right=preset script, middle=reset
|
|
||||||
- **Custom/music:** playerctl metadata polling (interval=5)
|
|
||||||
- CPU click: `ghostty -e htop` (note: Ghostty not Kitty here)
|
|
||||||
- Bluetooth click: blueman-manager
|
|
||||||
|
|
||||||
## OpenCode AI System
|
|
||||||
|
|
||||||
Files: `.config/opencode/`
|
|
||||||
|
|
||||||
The most complex subsystem. Full multi-agent AI coding assistant configuration.
|
|
||||||
See [OpenCode Architecture](research/opencode-architecture.md) for detailed breakdown.
|
|
||||||
|
|
||||||
**Quick reference:**
|
|
||||||
- Config: `opencode.jsonc` (default_agent=lead, plugin=@tarquinen/opencode-dcp)
|
|
||||||
- Agents: `agents/*.md` (10 agents: lead, coder, reviewer, tester, explorer, researcher, librarian, critic, sme, designer)
|
|
||||||
- Memory: `agents/.memory/` — persistent knowledge for the AI system itself
|
|
||||||
- Instruction files: `.github/copilot-instructions.md` (canonical), `CLAUDE.md` + `.cursorrules` (symlinks); `AGENTS.md` is NOT a symlink (global OpenCode config)
|
|
||||||
- MCP servers: context7 (remote docs), gh_grep (remote code search), playwright (local Chromium)
|
|
||||||
- Skills: `skills/doc-coverage/`, `skills/git-workflow/`, `skills/work-decomposition/`
|
|
||||||
|
|
||||||
## Git Configuration
|
|
||||||
|
|
||||||
File: `.gitconfig`
|
|
||||||
|
|
||||||
- `user.name=alex`, `user.email=misc@wiesner.com.br`
|
|
||||||
- `init.defaultBranch=main`
|
|
||||||
- Credential helper: `!/usr/bin/gh auth git-credential` (GitHub + Gist)
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
title: fix-github-push-large-binary
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/plans/fix-github-push-large-binary
|
|
||||||
tags:
|
|
||||||
- git
|
|
||||||
- risk
|
|
||||||
- tooling
|
|
||||||
---
|
|
||||||
|
|
||||||
# Fix GitHub Push Rejection for Large Binary
|
|
||||||
|
|
||||||
**Goal:** Remove the oversized `.local/bin/codebase-memory-mcp` blob from local-only history so `main` can push to GitHub successfully.
|
|
||||||
|
|
||||||
## Root cause
|
|
||||||
- [decision] Commit `969140e` added `.local/bin/codebase-memory-mcp` at ~143.51 MB.
|
|
||||||
- [decision] Commit `2643a0a` later removed the file, but the blob still exists in local history, so GitHub rejects the push.
|
|
||||||
|
|
||||||
## Tasks
|
|
||||||
- [x] Rewrite the 4 local-only commits by soft-resetting to `origin/main`.
|
|
||||||
- [x] Recreate a clean commit set without the large binary in history.
|
|
||||||
- [x] Verify no large-file path remains in reachable history.
|
|
||||||
- [x] Retry `git push` and confirm success.
|
|
||||||
## Acceptance criteria
|
|
||||||
- No reachable commit from `HEAD` contains `.local/bin/codebase-memory-mcp`.
|
|
||||||
- `git push` to `origin/main` succeeds without GitHub large-file rejection.
|
|
||||||
|
|
||||||
## Pre-mortem
|
|
||||||
- Most likely failure: recommit accidentally stages a regenerated large binary again.
|
|
||||||
- Fragile assumption: current worktree is clean except for the 4 local-only commits.
|
|
||||||
- Red flag requiring redesign: if the large blob exists in earlier shared history, a broader history rewrite would be required.
|
|
||||||
- Easy-to-miss regression: leaving `.local/bin/codebase-memory-mcp` unignored so it gets re-added later.
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
title: luks-sddm-kwallet-login-integration
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/plans/luks-sddm-kwallet-login-integration
|
|
||||||
tags:
|
|
||||||
- auth
|
|
||||||
- sddm
|
|
||||||
- kwallet
|
|
||||||
- luks
|
|
||||||
---
|
|
||||||
|
|
||||||
# LUKS / SDDM / KWallet login integration
|
|
||||||
|
|
||||||
## Goal
|
|
||||||
Configure the system so login feels unified across LUKS boot unlock, SDDM, and KWallet.
|
|
||||||
|
|
||||||
## Clarified scope
|
|
||||||
- [decision] User selected **Password login** instead of true SDDM autologin because password login preserves KWallet PAM unlock.
|
|
||||||
- [decision] User selected **Just document commands** instead of expanding repo scope to manage `/etc` files directly.
|
|
||||||
- [decision] Deliverable is repo documentation with exact manual system commands/edits; no tracked `/etc` files will be added in this change.
|
|
||||||
|
|
||||||
## Discovery
|
|
||||||
- Dotfiles repo contains user-space config only; system auth files live outside the repo.
|
|
||||||
- Current system already references `pam_kwallet5.so` in `/etc/pam.d/sddm` and `/etc/pam.d/sddm-autologin`, but the module is missing and silently skipped.
|
|
||||||
- `kwallet-pam` is available in Arch repos and should provide the current PAM module for KWallet 6.
|
|
||||||
- LUKS unlock and SDDM login are independent phases; there is no direct password handoff from initramfs to SDDM.
|
|
||||||
- True SDDM autologin conflicts with password-based KWallet unlock because no login password is available to PAM during autologin.
|
|
||||||
|
|
||||||
## Tasks
|
|
||||||
- [ ] Write documentation for package install and PAM edits needed for SDDM/KWallet integration
|
|
||||||
- [ ] Document wallet initialization and verification steps
|
|
||||||
- [ ] Review documentation for correctness and scope alignment
|
|
||||||
- [ ] Validate documented commands against current system state where possible
|
|
||||||
- [ ] Check documentation coverage/placement in repo
|
|
||||||
|
|
||||||
## Acceptance criteria
|
|
||||||
- README documents the exact package install step and the exact PAM module substitutions needed.
|
|
||||||
- README explicitly states that password login is the chosen model and true SDDM autologin is not part of this setup.
|
|
||||||
- README includes KWallet initialization and verification steps suitable for this Arch + Hyprland + SDDM setup.
|
|
||||||
- Reviewer/tester/librarian passes are recorded before completion.
|
|
||||||
|
|
||||||
## Workstream
|
|
||||||
- Single workstream in the main repo working tree.
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
title: tmux-shift-enter-fix
|
|
||||||
type: plan
|
|
||||||
permalink: dotfiles/plans/tmux-shift-enter-fix
|
|
||||||
tags:
|
|
||||||
- tmux
|
|
||||||
- terminal
|
|
||||||
- keybindings
|
|
||||||
---
|
|
||||||
|
|
||||||
# tmux Shift+Enter Fix
|
|
||||||
|
|
||||||
## Goal
|
|
||||||
Inside tmux, pressing Shift+Enter should insert a literal newline instead of submitting the command line.
|
|
||||||
|
|
||||||
## Decision
|
|
||||||
- [decision] Preserve tmux extended-keys support and apply the smallest possible fix at the tmux layer.
|
|
||||||
- [decision] Use `bind-key -n S-Enter send-keys "\n"` in `~/.tmux.conf` instead of disabling `extended-keys` or adding shell-specific bindings.
|
|
||||||
|
|
||||||
## Tasks
|
|
||||||
- [ ] Add a tmux root-table binding for `S-Enter`
|
|
||||||
- [ ] Verify tmux loads the config and exposes the expected binding
|
|
||||||
- [ ] Check documentation coverage for this config tweak
|
|
||||||
|
|
||||||
## Acceptance criteria
|
|
||||||
- `~/.tmux.conf` contains an explicit `S-Enter` binding that sends a newline.
|
|
||||||
- Existing `extended-keys` settings remain enabled.
|
|
||||||
- After sourcing the config, tmux shows the `S-Enter` root binding.
|
|
||||||
|
|
||||||
## Workstream
|
|
||||||
- Single workstream in the main repo working tree.
|
|
||||||
|
|
||||||
## Findings tracker
|
|
||||||
- None.
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- related_to [[knowledge]]
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
---
|
|
||||||
title: waybar-pomodoro-not-showing
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/plans/waybar-pomodoro-not-showing
|
|
||||||
tags:
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- plan
|
|
||||||
---
|
|
||||||
|
|
||||||
# Waybar Pomodoro Not Showing Implementation Plan
|
|
||||||
|
|
||||||
> For implementation: use `subagent-driven-development` when subagents are available; otherwise use `executing-plans`.
|
|
||||||
|
|
||||||
**Goal:** Restore the Waybar pomodoro module so it reliably appears on the bar.
|
|
||||||
|
|
||||||
**Architecture:** The `custom/pomodoro` Waybar module depends on an external `waybar-module-pomodoro` binary and a preset helper script. The most likely failure mode is launch-time PATH mismatch between Hyprland/Waybar and the interactive shell, so the minimal fix is to make module and helper invocations explicit and independent of shell PATH.
|
|
||||||
|
|
||||||
**Tech Stack:** JSONC-style Waybar config, shell script, Hyprland/Wayland desktop environment.
|
|
||||||
|
|
||||||
## File map
|
|
||||||
- Modify `.config/waybar/config` — make the pomodoro module invoke the binary explicitly.
|
|
||||||
- Modify `.config/waybar/scripts/pomodoro-preset.sh` — make the preset helper use the same explicit binary path.
|
|
||||||
|
|
||||||
## Task 1: Fix pomodoro command wiring
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Modify: `.config/waybar/config`
|
|
||||||
- Modify: `.config/waybar/scripts/pomodoro-preset.sh`
|
|
||||||
|
|
||||||
**Acceptance criteria:**
|
|
||||||
- `custom/pomodoro` no longer depends on login-session PATH to find `waybar-module-pomodoro`.
|
|
||||||
- Right-click preset switching still works.
|
|
||||||
- The change is minimal and limited to pomodoro-related wiring.
|
|
||||||
|
|
||||||
**Non-goals:**
|
|
||||||
- Do not refactor unrelated Waybar modules.
|
|
||||||
- Do not add system-wide installation steps or package management changes.
|
|
||||||
|
|
||||||
**Verification:**
|
|
||||||
- Run `bash -n /home/alex/dotfiles/.config/waybar/scripts/pomodoro-preset.sh` successfully.
|
|
||||||
- Run `/home/alex/.local/bin/waybar-module-pomodoro --help` successfully to verify the explicit binary path exists.
|
|
||||||
- Inspect resulting config references to confirm they use the explicit path consistently.
|
|
||||||
|
|
||||||
**Likely regression surfaces:**
|
|
||||||
- Right-click preset command path drift.
|
|
||||||
- Middle-click reset command still using the old bare binary name.
|
|
||||||
|
|
||||||
## Pre-mortem
|
|
||||||
- Most likely failure: only one of the pomodoro entry points is updated, leaving click actions broken.
|
|
||||||
- Fragile assumption: the binary remains at `/home/alex/.local/bin/waybar-module-pomodoro`.
|
|
||||||
- Redesign trigger: if the binary path is unstable across sessions or machines, prefer a Hyprland PATH fix instead.
|
|
||||||
- Easy-to-miss regression: preset helper still using `command -v` and failing under Waybar's environment.
|
|
||||||
|
|
||||||
## Execution notes
|
|
||||||
- Updated `.config/waybar/config` `custom/pomodoro` wiring to use `$HOME/.local/bin/waybar-module-pomodoro` for `exec`, `on-click`, and `on-click-middle`.
|
|
||||||
- Updated `.config/waybar/scripts/pomodoro-preset.sh` to remove PATH reliance by introducing `POMODORO_BIN="$HOME/.local/bin/waybar-module-pomodoro"`, replacing the `command -v` guard with `[[ ! -x "$POMODORO_BIN" ]]`, and routing all `set-work`/`set-short`/`set-long` calls through `"$POMODORO_BIN"`.
|
|
||||||
- Scope remained pomodoro-only; no unrelated Waybar modules or scripts were changed.
|
|
||||||
|
|
||||||
## Outcomes
|
|
||||||
- `bash -n /home/alex/dotfiles/.config/waybar/scripts/pomodoro-preset.sh` passed (no syntax errors).
|
|
||||||
- `/home/alex/.local/bin/waybar-module-pomodoro --help` succeeded and printed usage, confirming explicit-path binary availability.
|
|
||||||
- No practical automated test harness exists here for full Waybar runtime rendering in this task context; verification used the minimal command-level checks above.
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
---
|
|
||||||
title: LUKS SDDM KWallet discovery
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/research/luks-sddm-kwallet-discovery
|
|
||||||
tags:
|
|
||||||
- sddm
|
|
||||||
- kwallet
|
|
||||||
- luks
|
|
||||||
- pam
|
|
||||||
- arch
|
|
||||||
- hyprland
|
|
||||||
- discovery
|
|
||||||
---
|
|
||||||
|
|
||||||
# LUKS SDDM KWallet discovery
|
|
||||||
|
|
||||||
## System context
|
|
||||||
|
|
||||||
- [fact] Distribution: **Arch Linux** (rolling), NOT NixOS — all configuration is manual files or pacman packages
|
|
||||||
- [fact] Desktop environment: **Hyprland** (Wayland compositor), NOT KDE Plasma
|
|
||||||
- [fact] Display manager: **SDDM** (installed, PAM files present)
|
|
||||||
- [fact] Lock screen: **hyprlock** (Hyprland native, separate from SDDM)
|
|
||||||
- [fact] Default session: `Session=hyprland` (from `~/.dmrc`)
|
|
||||||
- [fact] Boot: **systemd-boot** (`/boot/loader/`), kernel cmdline has `cryptdevice=PARTUUID=1a555ca6-ea08-4128-80cf-fe213664030e:root root=/dev/mapper/root`
|
|
||||||
- [fact] LUKS encryption: **LUKS-encrypted root** (`encrypt` hook in mkinitcpio), initramfs uses classic `encrypt` hook (not `sd-encrypt`)
|
|
||||||
- [fact] Filesystem: **btrfs** with `@` subvolume
|
|
||||||
|
|
||||||
## Current config files inventory
|
|
||||||
|
|
||||||
### Dotfiles repo (`/home/alex/dotfiles`) — user scope only
|
|
||||||
|
|
||||||
| File | Contents |
|
|
||||||
|---|---|
|
|
||||||
| `.config/hypr/hyprland.conf` | Hyprland WM config; autostart: waybar + nm-applet; lock bind: `hyprlock` |
|
|
||||||
| `.config/hypr/hyprlock.conf` | hyprlock PAM-auth lock screen; Catppuccin Mocha theme |
|
|
||||||
| `.config/hypr/monitors.conf` | Monitor config |
|
|
||||||
| `.config/hypr/workspaces.conf` | Workspace rules |
|
|
||||||
| `.dmrc` | `Session=hyprland` |
|
|
||||||
| `.gitconfig` | Git identity only |
|
|
||||||
| `.config/fish/`, `.config/nvim/`, etc. | Shell and editor config, not relevant |
|
|
||||||
|
|
||||||
**The dotfiles repo does NOT contain any SDDM, PAM, mkinitcpio, bootloader, or KWallet configuration.** All of those are system-level files managed outside this repo.
|
|
||||||
|
|
||||||
### System-level files (outside dotfiles repo)
|
|
||||||
|
|
||||||
| File | Status | Key contents |
|
|
||||||
|---|---|---|
|
|
||||||
| `/etc/mkinitcpio.conf` | Present | HOOKS include `encrypt` (classic LUKS hook) |
|
|
||||||
| `/boot/loader/entries/2026-03-11_16-58-39_linux.conf` | Present | `cryptdevice=PARTUUID=...` kernel param, LUKS root |
|
|
||||||
| `/boot/loader/loader.conf` | Present | `timeout 3`, no autologin |
|
|
||||||
| `/etc/pam.d/sddm` | Present | Includes `pam_kwallet5.so` (broken — see risks) |
|
|
||||||
| `/etc/pam.d/sddm-autologin` | Present | Includes `pam_kwallet5.so` (broken — see risks) |
|
|
||||||
| `/etc/pam.d/sddm-greeter` | Present | Standard greeter-only config |
|
|
||||||
| `/etc/pam.d/system-auth` | Present | Standard pam_unix, pam_faillock |
|
|
||||||
| `/etc/pam.d/system-login` | Present | Standard, includes pam_u2f.so at top |
|
|
||||||
| `/etc/pam.d/hyprlock` | Present | `auth include login` — delegates to login chain |
|
|
||||||
| `/usr/lib/sddm/sddm.conf.d/default.conf` | Present | No autologin configured; `DisplayServer=x11` (NOT wayland) |
|
|
||||||
| `/etc/sddm.conf.d/` | **MISSING** — no local overrides exist | No user customization of SDDM |
|
|
||||||
| `/etc/sddm.conf` | **MISSING** | No top-level SDDM config file |
|
|
||||||
|
|
||||||
## KDE/KWallet installation state
|
|
||||||
|
|
||||||
- [fact] `kwalletd6` binary is installed: `/usr/bin/kwalletd6`
|
|
||||||
- [fact] `kwallet-query` is installed: `/usr/bin/kwallet-query`
|
|
||||||
- [fact] **`pam_kwallet5.so` does NOT exist** in `/usr/lib/security/` or `/lib/security/`
|
|
||||||
- [fact] **`pam_kwallet6.so` does NOT exist** either — `kwallet-pam` package is NOT installed
|
|
||||||
- [fact] `pam_gnome_keyring.so` IS installed at `/usr/lib/security/`
|
|
||||||
- [fact] No `~/.config/kwalletrc` exists — KWallet has never been initialized for this user
|
|
||||||
- [fact] No `~/.local/share/kwalletd/` directory — no wallet database exists
|
|
||||||
|
|
||||||
## Current PAM configuration for SDDM (detailed)
|
|
||||||
|
|
||||||
### `/etc/pam.d/sddm` (normal login)
|
|
||||||
```
|
|
||||||
auth sufficient pam_u2f.so cue
|
|
||||||
auth include system-login
|
|
||||||
-auth optional pam_gnome_keyring.so
|
|
||||||
-auth optional pam_kwallet5.so ← BROKEN: module not installed
|
|
||||||
|
|
||||||
session optional pam_keyinit.so force revoke
|
|
||||||
session include system-login
|
|
||||||
-session optional pam_gnome_keyring.so auto_start
|
|
||||||
-session optional pam_kwallet5.so auto_start ← BROKEN
|
|
||||||
```
|
|
||||||
|
|
||||||
### `/etc/pam.d/sddm-autologin`
|
|
||||||
```
|
|
||||||
auth sufficient pam_u2f.so cue
|
|
||||||
auth required pam_permit.so
|
|
||||||
-auth optional pam_kwallet5.so ← BROKEN
|
|
||||||
session include system-local-login
|
|
||||||
-session optional pam_kwallet5.so auto_start ← BROKEN
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: The `-` prefix means these lines are silently skipped if the module is missing — not causing errors, but not functioning.
|
|
||||||
|
|
||||||
## SDDM autologin configuration state
|
|
||||||
|
|
||||||
- [fact] SDDM autologin is **NOT configured** — `User=` and `Session=` are empty in default.conf
|
|
||||||
- [fact] SDDM `DisplayServer=x11` in default.conf — **no wayland greeter configured**
|
|
||||||
- [fact] No `/etc/sddm.conf.d/` drop-in directory exists
|
|
||||||
|
|
||||||
## Dependency chain for LUKS → SDDM → KWallet integration
|
|
||||||
|
|
||||||
### Boot-time LUKS (currently working)
|
|
||||||
```
|
|
||||||
systemd-boot → kernel cryptdevice= param → initramfs encrypt hook → LUKS passphrase prompt → root mounted
|
|
||||||
```
|
|
||||||
|
|
||||||
### Login-time (currently: manual SDDM login, no KWallet auto-open)
|
|
||||||
```
|
|
||||||
SDDM greeter → user types password → PAM sddm → pam_unix validates → session started
|
|
||||||
→ pam_kwallet5.so would unlock wallet (BROKEN: module missing)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Target state (proposed)
|
|
||||||
```
|
|
||||||
Boot: LUKS passphrase entered
|
|
||||||
→ system up → SDDM greeter shown
|
|
||||||
→ Option A (autologin): SDDM skips password → session starts → KWallet opened with stored key
|
|
||||||
→ Option B (PAM reuse): SDDM password == user password == KWallet password → pam_kwallet6 unlocks wallet on login
|
|
||||||
```
|
|
||||||
|
|
||||||
## Likely edit points
|
|
||||||
|
|
||||||
### To fix KWallet auto-open via PAM (Option B — recommended)
|
|
||||||
1. **Install `kwallet-pam` package** (AUR: `kwallet-pam` provides `pam_kwallet6.so`) — PREREQUISITE
|
|
||||||
2. **`/etc/pam.d/sddm`** — replace `pam_kwallet5.so` references with `pam_kwallet6.so` in auth and session stacks
|
|
||||||
3. **`/etc/pam.d/sddm-autologin`** — same replacement if autologin is also desired
|
|
||||||
4. **`~/.config/kwalletrc`** — create/configure wallet to use blowfish or GPG encryption; set wallet name
|
|
||||||
5. **Initialize wallet** — run `kwalletd6` or use `kwallet-query` to create the default wallet with the user's login password as the unlock password
|
|
||||||
|
|
||||||
### To configure SDDM for Wayland session (currently X11 default)
|
|
||||||
6. **`/etc/sddm.conf.d/hyprland.conf`** (new file) — set `DisplayServer=wayland` or leave X11 and use Wayland session via `wayland-session` script
|
|
||||||
|
|
||||||
### To configure SDDM autologin (Option A)
|
|
||||||
7. **`/etc/sddm.conf.d/autologin.conf`** (new file) — set `User=alex`, `Session=hyprland`
|
|
||||||
|
|
||||||
### To track these system files in the dotfiles repo
|
|
||||||
8. Add symlinks or a deploy script — system PAM files are outside the current dotfiles scope
|
|
||||||
|
|
||||||
## Risks and ambiguities
|
|
||||||
|
|
||||||
- [risk] **`pam_kwallet5.so` vs `pam_kwallet6.so` mismatch**: PAM files reference kwallet5 module; installed binary is kwalletd6. The `kwallet-pam` package for KF6 provides `pam_kwallet6.so` — this must be installed from AUR or a compatible repo.
|
|
||||||
- [risk] **No KDE Plasma installed**: The system uses Hyprland, not Plasma. KWallet works standalone, but Plasma's system tray integration for wallet prompts won't be present. Apps must use the KWallet D-Bus API directly.
|
|
||||||
- [risk] **SDDM running X11 compositor by default**: The `default.conf` has `DisplayServer=x11`, but the user session is Hyprland (Wayland). SDDM itself can still launch Wayland sessions from an X11 greeter. This works but is a mismatch worth documenting.
|
|
||||||
- [risk] **autologin + KWallet security trade-off**: If autologin is used (Option A), KWallet cannot be unlocked by the user password (there is none at login). The wallet would need to be set to "no password" (plaintext) or use a keyfile — both reduce security.
|
|
||||||
- [risk] **pam_u2f.so at top of system-login and sddm**: U2F is configured as `sufficient` — meaning a hardware key can bypass password entirely. This could bypass KWallet unlock if the wallet password differs from the user password.
|
|
||||||
- [risk] **hyprlock uses `auth include login`**: The lock screen delegates to the `login` PAM chain, which does NOT include kwallet PAM modules. Unlocking hyprlock will NOT re-open the wallet.
|
|
||||||
- [risk] **Dotfiles repo scope boundary**: `/etc/pam.d/`, `/etc/sddm.conf.d/`, `/etc/mkinitcpio.conf`, and `/boot/loader/` are all outside the dotfiles repo. These are system files. Either the dotfiles repo needs to expand its scope (with a deploy script), or these changes must be managed separately.
|
|
||||||
- [risk] **mkinitcpio uses classic `encrypt` hook, not `sd-encrypt`**: The `sd-encrypt` (systemd) hook supports TPM2/FIDO2-bound LUKS keys for automatic unlock; the classic `encrypt` hook does not. If the goal involves TPM2-bound auto-unlock (true single-passphrase boot), migration to `sd-encrypt` would be required.
|
|
||||||
- [ambiguity] **"SDDM login" with LUKS**: LUKS unlock happens at boot (initramfs), before SDDM. There is no mechanism for SDDM to "reuse" the LUKS passphrase directly. The integration point is: user types the same password at SDDM → PAM propagates it to `pam_kwallet6` → wallet unlocked. The LUKS and SDDM passwords are independent unless deliberately set to the same value.
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- related_to [[Hyprland config]]
|
|
||||||
- related_to [[PAM configuration]]
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
---
|
|
||||||
title: LUKS SDDM KWallet documentation targets
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/research/luks-sddm-kwallet-documentation-targets
|
|
||||||
tags:
|
|
||||||
- sddm
|
|
||||||
- kwallet
|
|
||||||
- luks
|
|
||||||
- pam
|
|
||||||
- documentation
|
|
||||||
- edit-points
|
|
||||||
---
|
|
||||||
|
|
||||||
# LUKS SDDM KWallet documentation targets
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
User decision: **document exact commands only** (not manage `/etc` files in the repo). This means the deliverable is a new documentation file in the dotfiles repo, not new symlinks or deploy scripts.
|
|
||||||
|
|
||||||
## Repo documentation conventions found
|
|
||||||
|
|
||||||
- [fact] **No README.md, SETUP.md, INSTALL.md, or docs/ directory exists** — the dotfiles repo has no human-facing setup documentation at all
|
|
||||||
- [fact] The only markdown files tracked in git are: `.memory/decisions.md`, `.memory/knowledge.md`, `.memory/research/opencode-architecture.md` — all are basic-memory agent-facing notes, not user-facing docs
|
|
||||||
- [fact] `.config/opencode/AGENTS.md` is the OpenCode agent instruction file (global AI config) — NOT a per-feature setup doc
|
|
||||||
- [convention] There is no established convention for "machine setup" documentation in this repo — **any new docs file will establish the pattern**
|
|
||||||
|
|
||||||
## Best file location for command documentation
|
|
||||||
|
|
||||||
### Option A (Recommended): `README.md` at repo root
|
|
||||||
- **Path:** `/home/alex/dotfiles/README.md`
|
|
||||||
- **Rationale:** Establishes the first user-facing doc for the repo; natural home for setup and system integration notes; visible on any git host
|
|
||||||
- **Section to add:** `## System Setup: KWallet + SDDM PAM integration` with step-by-step commands
|
|
||||||
|
|
||||||
### Option B: `.memory/plans/luks-sddm-kwallet-login-integration.md` (append)
|
|
||||||
- **Path:** `/home/alex/dotfiles/.memory/plans/luks-sddm-kwallet-login-integration.md`
|
|
||||||
- **Rationale:** Already tracks this feature; append a `## Exact commands` section
|
|
||||||
- **Downside:** `.memory/` files are agent-facing, not user-facing; commands buried in plan notes are harder to find later
|
|
||||||
|
|
||||||
### Option C: New dedicated file `SETUP-auth.md` or `docs/auth-setup.md`
|
|
||||||
- **Path:** `/home/alex/dotfiles/SETUP-auth.md`
|
|
||||||
- **Rationale:** Keeps system-setup docs separate from repo README
|
|
||||||
- **Downside:** Fragments documentation without an established convention
|
|
||||||
|
|
||||||
## What the documentation must cover (per plan + discovery)
|
|
||||||
|
|
||||||
Commands for:
|
|
||||||
1. `pacman -S kwallet-pam` OR AUR install of `kwallet-pam` (provides `pam_kwallet6.so`)
|
|
||||||
2. Edit `/etc/pam.d/sddm` — replace `pam_kwallet5.so` with `pam_kwallet6.so` (auth + session lines)
|
|
||||||
3. Edit `/etc/pam.d/sddm-autologin` — same replacement (if needed)
|
|
||||||
4. Create `/etc/sddm.conf.d/` directory if missing
|
|
||||||
5. Initialize KWallet — `kwalletd6` first-run or `kwallet-query` commands
|
|
||||||
6. Verify: `systemctl restart sddm` and login test
|
|
||||||
|
|
||||||
## Risks relevant to documentation
|
|
||||||
|
|
||||||
- [risk] `kwallet-pam` for KF6 may be AUR-only on Arch — exact package name needs verification before documenting
|
|
||||||
- [risk] `/etc/pam.d/` edits require root; if documented as copy-paste commands, must be prefixed with `sudo`
|
|
||||||
- [risk] SDDM autologin is NOT configured and should NOT be added — the password-login model was chosen; docs must not inadvertently suggest autologin setup
|
|
||||||
- [risk] A new `README.md` will be the first user-facing documentation and will set precedent — scope it carefully to avoid bloat
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- related_to [[LUKS SDDM KWallet discovery]]
|
|
||||||
- related_to [[luks-sddm-kwallet-login-integration]]
|
|
||||||
@@ -1,264 +0,0 @@
|
|||||||
---
|
|
||||||
title: SDDM KWallet PAM Setup for Hyprland
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/research/sddm-kwallet-pam-setup-for-hyprland
|
|
||||||
tags:
|
|
||||||
- sddm
|
|
||||||
- kwallet
|
|
||||||
- pam
|
|
||||||
- hyprland
|
|
||||||
- arch
|
|
||||||
- research
|
|
||||||
- authoritative
|
|
||||||
---
|
|
||||||
|
|
||||||
# SDDM KWallet PAM Setup for Hyprland
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Complete, source-verified setup for automatic KWallet unlock on SDDM password login, for a non-Plasma (Hyprland) Arch Linux system.
|
|
||||||
|
|
||||||
## Freshness
|
|
||||||
- confidence: high
|
|
||||||
- last_validated: 2026-03-11
|
|
||||||
- volatility: low (KDE Plasma 6 PAM module is stable; Arch Wiki last edited 2026-03-10)
|
|
||||||
- review_after_days: 90
|
|
||||||
- validation_count: 1
|
|
||||||
- contradiction_count: 0
|
|
||||||
|
|
||||||
## Sources consulted
|
|
||||||
- [source] Arch Wiki "KDE Wallet" — https://wiki.archlinux.org/title/KDE_Wallet (last edited 2026-03-10)
|
|
||||||
- [source] Arch Wiki "SDDM" — https://wiki.archlinux.org/title/SDDM (last edited 2026-03-04)
|
|
||||||
- [source] Arch package database `kwallet-pam` 6.6.2-1 file listing — https://archlinux.org/packages/extra/x86_64/kwallet-pam/files/
|
|
||||||
- [source] Arch package database `kwallet` 6.23.0-1 file listing — https://archlinux.org/packages/extra/x86_64/kwallet/files/
|
|
||||||
- [source] Real-world Hyprland dotfiles from GitHub (wayblueorg/wayblue, AhmedAmrNabil/nix-config)
|
|
||||||
|
|
||||||
## (1) Package to install
|
|
||||||
|
|
||||||
- [fact] Package: **`kwallet-pam`** — in the official **`extra`** repository (NOT AUR)
|
|
||||||
- [fact] Install command: `sudo pacman -S kwallet-pam`
|
|
||||||
- [fact] Current version: **6.6.2-1** (as of 2026-03-03)
|
|
||||||
- [fact] Dependencies: `kwallet`, `pam`, `libgcrypt`, `socat` (all already present or auto-resolved)
|
|
||||||
- [fact] Files installed:
|
|
||||||
- `/usr/lib/security/pam_kwallet5.so` — the PAM module
|
|
||||||
- `/usr/lib/pam_kwallet_init` — session-start helper script
|
|
||||||
- `/etc/xdg/autostart/pam_kwallet_init.desktop` — XDG autostart for Plasma/DE environments
|
|
||||||
- `/usr/lib/systemd/user/plasma-kwallet-pam.service` — systemd user service
|
|
||||||
|
|
||||||
### Critical naming fact
|
|
||||||
- [fact] **The PAM module is `pam_kwallet5.so` even for KDE Frameworks 6 / Plasma 6.** There is no `pam_kwallet6.so`. The "5" in the name is a legacy artifact. The previous discovery note incorrectly stated `pam_kwallet6.so` would be provided — this was wrong.
|
|
||||||
- [fact] The existing `/etc/pam.d/sddm` and `/etc/pam.d/sddm-autologin` files already reference `pam_kwallet5.so` — they just need the package installed; **no module name changes are needed**.
|
|
||||||
|
|
||||||
## (2) PAM configuration
|
|
||||||
|
|
||||||
### Plasma 6 / ksecretd consideration
|
|
||||||
|
|
||||||
The Arch Wiki (section "Configure PAM on Plasma 6 (KF6)", updated 2026-03-10) says Plasma 6 uses `ksecretd` as the secret service daemon. The PAM session line should include `kwalletd=/usr/bin/ksecretd` to point to the new daemon.
|
|
||||||
|
|
||||||
- [fact] `ksecretd` binary is at `/usr/bin/ksecretd` and is shipped by the `kwallet` package (6.23.0-1)
|
|
||||||
- [fact] `kwalletd6` binary is at `/usr/bin/kwalletd6` and is also in the `kwallet` package
|
|
||||||
- [decision] For a non-Plasma Hyprland setup, the question is which daemon to target. The Arch Wiki recommends `kwalletd=/usr/bin/ksecretd` for KF6. Since the user has `kwalletd6` and `ksecretd` both installed via the `kwallet` package, and the Arch Wiki explicitly documents this parameter for KF6, the documentation should use the `kwalletd=/usr/bin/ksecretd` parameter.
|
|
||||||
|
|
||||||
### Recommended `/etc/pam.d/sddm` (password login)
|
|
||||||
|
|
||||||
The file already has the right structure. After installing `kwallet-pam`, the existing lines become functional. However, for Plasma 6 / KF6 compatibility, the session line should add the `kwalletd=` parameter:
|
|
||||||
|
|
||||||
```
|
|
||||||
#%PAM-1.0
|
|
||||||
|
|
||||||
auth sufficient pam_u2f.so cue
|
|
||||||
auth include system-login
|
|
||||||
-auth optional pam_gnome_keyring.so
|
|
||||||
-auth optional pam_kwallet5.so
|
|
||||||
|
|
||||||
account include system-login
|
|
||||||
|
|
||||||
password include system-login
|
|
||||||
|
|
||||||
session optional pam_keyinit.so force revoke
|
|
||||||
session include system-login
|
|
||||||
-session optional pam_gnome_keyring.so auto_start
|
|
||||||
-session optional pam_kwallet5.so auto_start kwalletd=/usr/bin/ksecretd
|
|
||||||
```
|
|
||||||
|
|
||||||
Key points:
|
|
||||||
- [fact] The `-` prefix on `-auth` and `-session` lines means "skip silently if module is missing" — this is already present in the default SDDM PAM files
|
|
||||||
- [fact] The `auth` line captures the user password for later use by the session line
|
|
||||||
- [fact] The `session` line with `auto_start` tells the module to start kwalletd/ksecretd and unlock the wallet
|
|
||||||
- [fact] `kwalletd=/usr/bin/ksecretd` directs the module to use KF6's ksecretd daemon instead of the legacy kwalletd5
|
|
||||||
|
|
||||||
### Recommended `/etc/pam.d/sddm-autologin`
|
|
||||||
|
|
||||||
This file is for SDDM autologin ONLY. Since the chosen model is password login, this file is informational but should still be kept correct:
|
|
||||||
|
|
||||||
```
|
|
||||||
#%PAM-1.0
|
|
||||||
|
|
||||||
auth sufficient pam_u2f.so cue
|
|
||||||
auth required pam_permit.so
|
|
||||||
-auth optional pam_kwallet5.so
|
|
||||||
|
|
||||||
account include system-local-login
|
|
||||||
|
|
||||||
password include system-local-login
|
|
||||||
|
|
||||||
session include system-local-login
|
|
||||||
-session optional pam_kwallet5.so auto_start kwalletd=/usr/bin/ksecretd
|
|
||||||
```
|
|
||||||
|
|
||||||
- [caveat] Autologin skips password entry → PAM has no password to pass to `pam_kwallet5.so` → wallet cannot be unlocked unless LUKS passphrase forwarding is used (see section 5)
|
|
||||||
|
|
||||||
### Minimal edit needed for existing system
|
|
||||||
|
|
||||||
Since the existing `/etc/pam.d/sddm` already has `pam_kwallet5.so` lines, the only change needed is:
|
|
||||||
|
|
||||||
1. Install `kwallet-pam` (makes the module file appear at `/usr/lib/security/pam_kwallet5.so`)
|
|
||||||
2. Add `kwalletd=/usr/bin/ksecretd` to the session line for KF6 compatibility
|
|
||||||
|
|
||||||
The auth line does NOT need the `kwalletd=` parameter — only the session line does.
|
|
||||||
|
|
||||||
## (3) Wallet initialization for non-Plasma (Hyprland) users
|
|
||||||
|
|
||||||
### Step A: Create the wallet
|
|
||||||
|
|
||||||
The wallet **must** be named `kdewallet` (the default name). PAM unlock only works with this specific wallet name.
|
|
||||||
|
|
||||||
**Option 1 — GUI (recommended if kwalletmanager is available):**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S kwalletmanager
|
|
||||||
kwalletmanager6
|
|
||||||
```
|
|
||||||
Then: File > New Wallet > name it `kdewallet` > set password to match login password > choose **blowfish** encryption (NOT GPG).
|
|
||||||
|
|
||||||
**Option 2 — Headless/CLI:**
|
|
||||||
No pure-CLI wallet creation tool exists. The wallet is created automatically when:
|
|
||||||
1. The PAM module is installed and configured
|
|
||||||
2. The user logs in via SDDM with password
|
|
||||||
3. `pam_kwallet_init` runs and kwalletd6/ksecretd starts
|
|
||||||
4. If no wallet exists, kwalletd6 creates one on first access
|
|
||||||
|
|
||||||
For a truly headless init, trigger it by running in the session:
|
|
||||||
```bash
|
|
||||||
# Ensure kwalletd6/ksecretd is running (D-Bus activated)
|
|
||||||
dbus-send --session --dest=org.kde.kwalletd6 --print-reply \
|
|
||||||
/modules/kwalletd6 org.kde.KWallet.open \
|
|
||||||
string:"kdewallet" int64:0 string:"init"
|
|
||||||
```
|
|
||||||
This prompts for the wallet password interactively (Qt dialog).
|
|
||||||
|
|
||||||
### Step B: Ensure wallet password matches login password
|
|
||||||
|
|
||||||
- [requirement] The KWallet password MUST be identical to the Unix user login password. PAM passes the login password to the kwallet module; if they differ, the wallet won't unlock.
|
|
||||||
- [requirement] If the user password is changed later, the wallet password must be updated to match. Use `kwalletmanager6` > Change Password, or delete and recreate the wallet.
|
|
||||||
|
|
||||||
### Step C: kwalletrc configuration
|
|
||||||
|
|
||||||
Create `~/.config/kwalletrc` if it doesn't exist:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[Wallet]
|
|
||||||
Default Wallet=kdewallet
|
|
||||||
Enabled=true
|
|
||||||
First Use=false
|
|
||||||
|
|
||||||
[org.freedesktop.secrets]
|
|
||||||
apiEnabled=true
|
|
||||||
```
|
|
||||||
|
|
||||||
The `apiEnabled=true` setting enables the org.freedesktop.secrets D-Bus API, allowing libsecret-based apps (Chromium, VSCode, etc.) to use KWallet.
|
|
||||||
|
|
||||||
### Step D: Autostart `pam_kwallet_init` in Hyprland
|
|
||||||
|
|
||||||
The `kwallet-pam` package installs an XDG autostart entry (`/etc/xdg/autostart/pam_kwallet_init.desktop`), but Hyprland does NOT process XDG autostart files by default.
|
|
||||||
|
|
||||||
Add to `~/.config/hypr/hyprland.conf`:
|
|
||||||
```
|
|
||||||
exec-once = /usr/lib/pam_kwallet_init
|
|
||||||
```
|
|
||||||
|
|
||||||
This script reads the PAM-cached credentials and passes them to kwalletd6/ksecretd to unlock the wallet.
|
|
||||||
|
|
||||||
### Step E: D-Bus activation service (optional but recommended)
|
|
||||||
|
|
||||||
Create `~/.local/share/dbus-1/services/org.freedesktop.secrets.service`:
|
|
||||||
```ini
|
|
||||||
[D-BUS Service]
|
|
||||||
Name=org.freedesktop.secrets
|
|
||||||
Exec=/usr/bin/kwalletd6
|
|
||||||
```
|
|
||||||
|
|
||||||
This ensures kwalletd6 auto-starts when any app requests secrets via D-Bus, even before the wallet is explicitly opened.
|
|
||||||
|
|
||||||
## (4) Verification
|
|
||||||
|
|
||||||
### Quick verification after login
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. Check the PAM module is installed
|
|
||||||
ls -la /usr/lib/security/pam_kwallet5.so
|
|
||||||
|
|
||||||
# 2. Check kwalletd6 or ksecretd is running
|
|
||||||
pgrep -a kwalletd6 || pgrep -a ksecretd
|
|
||||||
|
|
||||||
# 3. Check the wallet is open
|
|
||||||
dbus-send --session --dest=org.kde.kwalletd6 --print-reply \
|
|
||||||
/modules/kwalletd6 org.kde.KWallet.isOpen \
|
|
||||||
string:"kdewallet"
|
|
||||||
|
|
||||||
# 4. Check wallet files exist
|
|
||||||
ls -la ~/.local/share/kwalletd/
|
|
||||||
|
|
||||||
# 5. Query the wallet (should return without prompting for password)
|
|
||||||
kwallet-query -l kdewallet
|
|
||||||
|
|
||||||
# 6. Check environment variables set by pam_kwallet_init
|
|
||||||
echo $PAM_KWALLET5_LOGIN
|
|
||||||
```
|
|
||||||
|
|
||||||
### Full integration test
|
|
||||||
1. Log out of Hyprland
|
|
||||||
2. At SDDM greeter, type user password and log in
|
|
||||||
3. After Hyprland starts, run `kwallet-query -l kdewallet` — it should list folders without prompting
|
|
||||||
4. Open a KWallet-aware app (e.g., Chromium with `--password-store=kwallet5`) and verify it stores/retrieves credentials
|
|
||||||
|
|
||||||
### Troubleshooting if wallet doesn't auto-unlock
|
|
||||||
- Check `journalctl --user -u plasma-kwallet-pam.service` for errors
|
|
||||||
- Check `journalctl -b | grep -i kwallet` for PAM-level errors
|
|
||||||
- Verify wallet password matches login password exactly
|
|
||||||
- Verify wallet is named exactly `kdewallet` (not `default` or any other name)
|
|
||||||
- Verify wallet uses blowfish encryption, not GPG
|
|
||||||
|
|
||||||
## (5) Caveats
|
|
||||||
|
|
||||||
### U2F / pam_u2f.so interaction
|
|
||||||
|
|
||||||
- [risk] The existing `/etc/pam.d/sddm` has `auth sufficient pam_u2f.so cue` as the FIRST auth line. When `sufficient` succeeds, PAM skips remaining auth modules — including `pam_kwallet5.so`.
|
|
||||||
- [consequence] If the user authenticates via U2F key only (no password typed), the kwallet module never captures a password → wallet cannot be unlocked automatically.
|
|
||||||
- [mitigation] This is acceptable if U2F is used as a convenience shortcut and the user accepts that wallet won't auto-unlock in that case. The wallet can be manually unlocked later.
|
|
||||||
- [alternative] To make U2F + kwallet work together, change `sufficient` to a two-factor setup where password is always required. But this changes the security model and is out of scope for this documentation.
|
|
||||||
|
|
||||||
### Autologin caveat
|
|
||||||
|
|
||||||
- [risk] SDDM autologin (`pam_permit.so`) provides no password → `pam_kwallet5.so` has nothing to unlock the wallet with.
|
|
||||||
- [fact] The Arch Wiki documents a workaround using `pam_systemd_loadkey.so` for LUKS-encrypted systems: the LUKS passphrase can be forwarded from the initramfs to the PAM stack, allowing wallet unlock even with autologin.
|
|
||||||
- [requirement] This requires: (1) systemd-based initramfs (`sd-encrypt` hook, not classic `encrypt`), (2) `pam_systemd_loadkey.so` line in sddm-autologin, (3) sddm.service override with `KeyringMode=inherit`.
|
|
||||||
- [fact] The current system uses classic `encrypt` hook, NOT `sd-encrypt`, so this workaround is NOT available without migrating the initramfs to systemd hooks.
|
|
||||||
- [decision] Since password login (not autologin) was chosen, this is informational only.
|
|
||||||
|
|
||||||
### Fingerprint reader caveat
|
|
||||||
- [fact] KWallet cannot be unlocked using a fingerprint reader (per Arch Wiki). Similar to U2F — no password is available.
|
|
||||||
|
|
||||||
### GPG encryption caveat
|
|
||||||
- [fact] `kwallet-pam` does NOT work with GPG-encrypted wallets. The wallet MUST use standard blowfish encryption.
|
|
||||||
|
|
||||||
### hyprlock caveat
|
|
||||||
- [fact] hyprlock uses `auth include login` in `/etc/pam.d/hyprlock`. The login PAM chain does NOT include kwallet PAM modules. Unlocking hyprlock will NOT re-open the wallet if it was closed.
|
|
||||||
- [mitigation] Typically the wallet stays open for the session duration. If the wallet is configured with `Leave Open=true` (in kwalletrc or kwalletmanager), it won't close automatically.
|
|
||||||
|
|
||||||
### Password change caveat
|
|
||||||
- [fact] If the user's login password is changed (via `passwd`), the wallet password must be manually updated to match. PAM does not automatically synchronize wallet passwords on password change.
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- related_to [[LUKS SDDM KWallet discovery]]
|
|
||||||
- related_to [[luks-sddm-kwallet-login-integration]]
|
|
||||||
- related_to [[LUKS SDDM KWallet documentation targets]]
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
---
|
|
||||||
title: opencode-architecture
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/research/opencode-architecture
|
|
||||||
---
|
|
||||||
|
|
||||||
# OpenCode Architecture Research
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
The OpenCode multi-agent configuration lives at `.config/opencode/` and is the most complex subsystem in this dotfiles repo.
|
|
||||||
|
|
||||||
## Directory Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
.config/opencode/
|
|
||||||
├── opencode.jsonc # Main config
|
|
||||||
├── AGENTS.md # Global OpenCode config (NOT a symlink here)
|
|
||||||
├── CLAUDE.md -> .github/copilot-instructions.md (symlink)
|
|
||||||
├── .cursorrules -> .github/copilot-instructions.md (symlink)
|
|
||||||
├── .github/
|
|
||||||
│ └── copilot-instructions.md # Canonical cross-tool instructions
|
|
||||||
├── agents/
|
|
||||||
│ ├── lead.md # Primary orchestrator (mode=primary, temp=0.3)
|
|
||||||
│ ├── coder.md # Implementation agent
|
|
||||||
│ ├── reviewer.md # Code review (read-only)
|
|
||||||
│ ├── tester.md # Testing/validation
|
|
||||||
│ ├── explorer.md # Codebase mapper
|
|
||||||
│ ├── researcher.md # Technical investigator
|
|
||||||
│ ├── librarian.md # Documentation specialist
|
|
||||||
│ ├── critic.md # Plan gate
|
|
||||||
│ ├── sme.md # Domain expert consultant
|
|
||||||
│ └── designer.md # UI/UX specialist
|
|
||||||
├── .memory/
|
|
||||||
│ ├── knowledge.md # OpenCode-specific architecture knowledge
|
|
||||||
│ ├── decisions.md # Agent permission decisions, symlink strategy
|
|
||||||
│ ├── plans/ # Active feature plans
|
|
||||||
│ └── research/ # Research findings
|
|
||||||
└── skills/
|
|
||||||
├── doc-coverage/SKILL.md # Documentation coverage checklist
|
|
||||||
├── git-workflow/SKILL.md # Git commit/worktree/PR procedures
|
|
||||||
└── work-decomposition/SKILL.md # Multi-feature decomposition
|
|
||||||
```
|
|
||||||
|
|
||||||
## opencode.jsonc Key Settings
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
{
|
|
||||||
"default_agent": "lead",
|
|
||||||
"autoupdate": true,
|
|
||||||
"plugin": "@tarquinen/opencode-dcp",
|
|
||||||
"agents": {
|
|
||||||
"general": { "disabled": true },
|
|
||||||
"explore": { "disabled": true },
|
|
||||||
"plan": { "permissions": { "write": "allow" } }
|
|
||||||
},
|
|
||||||
"permissions": {
|
|
||||||
"websearch": "allow",
|
|
||||||
"question": "allow",
|
|
||||||
"external_directory": "deny"
|
|
||||||
},
|
|
||||||
"mcp": {
|
|
||||||
"context7": { "url": "https://mcp.context7.com/mcp", "type": "remote" },
|
|
||||||
"gh_grep": { "url": "https://mcp.grep.app", "type": "remote" },
|
|
||||||
"playwright": { "command": "npx @playwright/mcp@latest --headless --browser chromium", "type": "local" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Agent Model/Permission Matrix
|
|
||||||
|
|
||||||
| Agent | Model | Full Edit | Notes |
|
|
||||||
|---|---|---|---|
|
|
||||||
| lead | claude-opus-4 | ✅ | Orchestrator, all task types |
|
|
||||||
| coder | gpt-5.3-codex | ✅ | Implementation |
|
|
||||||
| librarian | claude-opus-4.6 | ✅ | Documentation |
|
|
||||||
| reviewer | claude-opus-4.6 | `.memory/*` only | Read-only code review |
|
|
||||||
| tester | claude-sonnet-4.6 | `.memory/*` only | Validation |
|
|
||||||
| explorer | claude-sonnet-4.6 | `.memory/*` only | Codebase mapping |
|
|
||||||
| researcher | claude-opus-4.6 | `.memory/*` only | Technical research |
|
|
||||||
| critic | claude-opus-4.6 | `.memory/*` only | Plan gate |
|
|
||||||
| sme | claude-opus-4.6 | `.memory/*` only | Domain expert |
|
|
||||||
| designer | claude-sonnet-4.6 | `.memory/*` only | UI/UX |
|
|
||||||
|
|
||||||
## Lead Agent Workflow
|
|
||||||
|
|
||||||
Phases: CLARIFY → DISCOVER → CONSULT → PLAN → CRITIC-GATE → EXECUTE → PHASE-WRAP
|
|
||||||
|
|
||||||
- **Tiered quality pipeline:** Tier 1 (full, new features), Tier 2 (standard), Tier 3 (fast, trivial)
|
|
||||||
- **Worktrees:** `.worktrees/<feature-name>` per feature branch
|
|
||||||
- **Retry circuit breaker:** 3 coder rejections → redesign; 5 failures → escalate
|
|
||||||
- **Commit format:** Conventional Commits (`feat:`, `fix:`, `chore:`, etc.)
|
|
||||||
- **Parallelization:** mandatory for independent work
|
|
||||||
|
|
||||||
## Memory Pattern
|
|
||||||
|
|
||||||
- `.memory/` tracked in git for cross-session persistence
|
|
||||||
- Agents with `.memory/*` write permission record directly (instruction-level enforcement)
|
|
||||||
- Structure: `knowledge.md` (architecture), `decisions.md` (design choices), `plans/<feature>.md`, `research/<topic>.md`
|
|
||||||
|
|
||||||
## Cross-Tool Instruction Files
|
|
||||||
|
|
||||||
- `.github/copilot-instructions.md` = single source of truth
|
|
||||||
- `CLAUDE.md` and `.cursorrules` = symlinks
|
|
||||||
- `AGENTS.md` = NOT a symlink in this repo (serves as global OpenCode config)
|
|
||||||
- **Note:** In OTHER projects, `AGENTS.md` should be a symlink. The OpenCode config dir is a special case.
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
|
|
||||||
- **doc-coverage:** Validates canonical instruction file + symlinks; checks README + docs/* coverage
|
|
||||||
- **git-workflow:** Step-by-step git commit, worktree, and PR creation procedures
|
|
||||||
- **work-decomposition:** Splits 3+ feature requests into independent workstreams with separate worktrees
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
---
|
|
||||||
title: waybar-pomodoro-not-showing
|
|
||||||
type: note
|
|
||||||
permalink: dotfiles/research/waybar-pomodoro-not-showing
|
|
||||||
tags:
|
|
||||||
- waybar
|
|
||||||
- pomodoro
|
|
||||||
- debugging
|
|
||||||
- risk
|
|
||||||
---
|
|
||||||
|
|
||||||
# Waybar Pomodoro Not Showing — Research Findings
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
Investigation of why `custom/pomodoro` does not appear on the Waybar status bar.
|
|
||||||
Files inspected: `.config/waybar/config`, `.config/waybar/style.css`, `.config/waybar/scripts/pomodoro-preset.sh`.
|
|
||||||
|
|
||||||
## Module Wiring (as configured)
|
|
||||||
|
|
||||||
### modules-left (config line 5–9)
|
|
||||||
```json
|
|
||||||
"modules-left": [
|
|
||||||
"backlight",
|
|
||||||
"wireplumber",
|
|
||||||
"custom/pomodoro",
|
|
||||||
],
|
|
||||||
```
|
|
||||||
`custom/pomodoro` IS present in `modules-left`.
|
|
||||||
|
|
||||||
### custom/pomodoro definition (config lines 133–140)
|
|
||||||
```json
|
|
||||||
"custom/pomodoro": {
|
|
||||||
"format": "{}",
|
|
||||||
"return-type": "json",
|
|
||||||
"exec": "waybar-module-pomodoro --no-work-icons",
|
|
||||||
"on-click": "waybar-module-pomodoro toggle",
|
|
||||||
"on-click-right": "$HOME/.config/waybar/scripts/pomodoro-preset.sh",
|
|
||||||
"on-click-middle": "waybar-module-pomodoro reset",
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
### CSS selector (style.css lines 106–109)
|
|
||||||
```css
|
|
||||||
#custom-pomodoro {
|
|
||||||
padding: 0 4px;
|
|
||||||
color: @red;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Selector is correct and present.
|
|
||||||
|
|
||||||
### Script (scripts/pomodoro-preset.sh)
|
|
||||||
- Guarded by `command -v waybar-module-pomodoro` check (exits 1 if not installed).
|
|
||||||
- Sets work/short/long durations via `waybar-module-pomodoro set-*` subcommands.
|
|
||||||
- Toggle cycles between preset A (50/10/20) and preset B (25/5/15).
|
|
||||||
- **Script itself is logically correct.**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Root Cause Analysis (ranked by confidence)
|
|
||||||
|
|
||||||
### 🔴 #1 — `waybar-module-pomodoro` binary not installed / not on PATH (confidence: ~90%)
|
|
||||||
- The `exec` command is `waybar-module-pomodoro --no-work-icons` — a **bare binary name**, resolved from PATH at Waybar launch time.
|
|
||||||
- Waybar inherits the environment of its launcher (Hyprland `exec-once`), which may NOT include the user's shell PATH (`~/.local/bin`, `/usr/local/bin`, etc.).
|
|
||||||
- `fish/config.fish` adds `/home/alex/dotfiles/.local/bin` to PATH, but that is only set in interactive Fish sessions — **Hyprland's exec-once does not source Fish config**.
|
|
||||||
- No package manager manifest, AUR package list, or install script mentions `waybar-module-pomodoro`.
|
|
||||||
- When `exec` fails to start, Waybar hides the module entirely (no fallback text) — the module disappears silently.
|
|
||||||
- **This is the most likely cause.** Verify with: `which waybar-module-pomodoro` in a non-Fish shell, or check `journalctl --user -u waybar` for "Failed to execute".
|
|
||||||
|
|
||||||
### 🟠 #2 — `interval` key absent on custom/pomodoro (confidence: ~65%)
|
|
||||||
- `custom/pomodoro` has NO `interval` key. For a persistent daemon (`waybar-module-pomodoro` runs and writes JSON to stdout continuously), this is correct — Waybar treats it as a long-lived subprocess.
|
|
||||||
- BUT if the binary is supposed to be polled (not a persistent daemon), missing `interval` means Waybar will only run it once and never refresh.
|
|
||||||
- The `return-type: json` combined with no `interval` means Waybar expects the binary to **continuously emit newline-delimited JSON** to stdout. If the binary only emits once and exits, the module will show blank after the first read.
|
|
||||||
- This is a secondary cause contingent on what `waybar-module-pomodoro` actually does. If it is a daemon that stays alive, #1 is the only blocker; if it exits after one line, `interval` is needed.
|
|
||||||
|
|
||||||
### 🟡 #3 — Binary exists but crashes on `--no-work-icons` flag (confidence: ~25%)
|
|
||||||
- The `--no-work-icons` flag may not be a valid flag for the installed version of `waybar-module-pomodoro`.
|
|
||||||
- An unrecognized flag causing the binary to exit with a non-zero code would suppress the module.
|
|
||||||
- Check: `waybar-module-pomodoro --help` or `waybar-module-pomodoro --no-work-icons` manually.
|
|
||||||
|
|
||||||
### 🟡 #4 — Config JSON parse failure (confidence: ~15%)
|
|
||||||
- The config uses tab-indented lines (lines 134–139 use `\t`) while the rest uses spaces — mixed indentation is cosmetically inconsistent but does NOT cause JSON parse errors.
|
|
||||||
- Waybar's parser accepts JSON5/hjson (trailing commas, `//` comments) — both are used in this config and are fine.
|
|
||||||
- No structural JSON error was found in the config.
|
|
||||||
|
|
||||||
### ⚪ #5 — Hyprland not auto-starting Waybar at all (confidence: ~10%)
|
|
||||||
- If `exec-once=waybar` in `hyprland.conf` is missing or commented out, the bar won't show at all (not just the pomodoro module). Not specific to this module.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Concrete Edit Points
|
|
||||||
|
|
||||||
### Fix #1 (most likely): Ensure binary is installed and PATH is set in Waybar launch environment
|
|
||||||
|
|
||||||
**Option A — Install the binary system-wide:**
|
|
||||||
Install `waybar-module-pomodoro` via your package manager (e.g. `paru -S waybar-module-pomodoro` on Arch) so it is in `/usr/bin` or `/usr/local/bin`, which is always in Waybar's inherited PATH.
|
|
||||||
|
|
||||||
**Option B — Use absolute path in config:**
|
|
||||||
```diff
|
|
||||||
- "exec": "waybar-module-pomodoro --no-work-icons",
|
|
||||||
- "on-click": "waybar-module-pomodoro toggle",
|
|
||||||
- "on-click-middle": "waybar-module-pomodoro reset",
|
|
||||||
+ "exec": "$HOME/.local/bin/waybar-module-pomodoro --no-work-icons",
|
|
||||||
+ "on-click": "$HOME/.local/bin/waybar-module-pomodoro toggle",
|
|
||||||
+ "on-click-middle": "$HOME/.local/bin/waybar-module-pomodoro reset",
|
|
||||||
```
|
|
||||||
File: `.config/waybar/config`, lines 136–139.
|
|
||||||
|
|
||||||
**Option C — Set PATH in Hyprland env (preferred for Wayland):**
|
|
||||||
Add to `.config/hypr/hyprland.conf`:
|
|
||||||
```
|
|
||||||
env = PATH,$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin
|
|
||||||
```
|
|
||||||
|
|
||||||
### Fix #2 (if binary is a one-shot, not a daemon): Add `interval` key
|
|
||||||
```diff
|
|
||||||
"custom/pomodoro": {
|
|
||||||
"format": "{}",
|
|
||||||
"return-type": "json",
|
|
||||||
+ "interval": 1,
|
|
||||||
"exec": "waybar-module-pomodoro --no-work-icons",
|
|
||||||
```
|
|
||||||
File: `.config/waybar/config`, line 134 (insert after `"return-type": "json",`).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Files Involved
|
|
||||||
|
|
||||||
| File | Role |
|
|
||||||
|---|---|
|
|
||||||
| `.config/waybar/config` | Module registration in `modules-left`, `custom/pomodoro` definition |
|
|
||||||
| `.config/waybar/style.css` | `#custom-pomodoro` CSS selector (present, correct) |
|
|
||||||
| `.config/waybar/scripts/pomodoro-preset.sh` | Right-click preset toggler (calls binary) |
|
|
||||||
| `.config/hypr/hyprland.conf` | Waybar autostart + env block (outside Waybar dir) |
|
|
||||||
| `waybar-module-pomodoro` binary | External binary — must be installed and on PATH |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Likely Bug Surfaces (Adjacent Risk Areas)
|
|
||||||
|
|
||||||
1. **`custom/uptime`** (config line 89–95): Also uses a bare script path `$HOME/.config/waybar/scripts/uptime.sh`. Same PATH-at-launch issue could affect it if shell env is not inherited. The script exists in the repo (`scripts/` dir shows only `pomodoro-preset.sh`) — **`uptime.sh` is missing from the repo**, meaning this module may also be broken.
|
|
||||||
2. **`custom/music`** (config line 44–52): Uses `playerctl` — same PATH issue; no `playerctl` install evidence in the repo.
|
|
||||||
3. **`hyprland/workspaces`** (config line 22–28): Defined in config but NOT in any of `modules-left`, `modules-center`, or `modules-right` — it is **a dead definition that never renders**.
|
|
||||||
4. **`custom/lock`** (config line 127–131): Defined but also absent from all three module lists — another dead definition.
|
|
||||||
5. **`network`** (config line 60–68): Defined but not in any module list — dead definition.
|
|
||||||
6. **Trailing comma on line 8** of `modules-left`: Benign in Waybar's parser but would break standard JSON parsers if config is ever processed by tools expecting strict JSON.
|
|
||||||
|
|
||||||
## Relations
|
|
||||||
- related_to [[dotfiles/knowledge]]
|
|
||||||
8
.pi/agent/AGENTS.md
Normal file
8
.pi/agent/AGENTS.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# AGENTS
|
||||||
|
|
||||||
|
## User clarification
|
||||||
|
|
||||||
|
- Prefer using the `question` tool when you need a user decision, preference, approval, or missing input before proceeding.
|
||||||
|
- Do not end the turn just to ask for a response if the `question` tool is available and appropriate.
|
||||||
|
- Favor concise multiple-choice options, and rely on the tool's built-in free-text fallback when needed.
|
||||||
|
- Only fall back to a normal conversational question when the `question` tool is unavailable or clearly not a good fit.
|
||||||
@@ -2,7 +2,14 @@
|
|||||||
"github-copilot": {
|
"github-copilot": {
|
||||||
"type": "oauth",
|
"type": "oauth",
|
||||||
"refresh": "ghu_j9QHUrVzPLoYOsyjarpzktAFDQWqP31gz2Ac",
|
"refresh": "ghu_j9QHUrVzPLoYOsyjarpzktAFDQWqP31gz2Ac",
|
||||||
"access": "tid=af454cc719f9e4daffe9b4892fa4e791;exp=1773665732;sku=plus_monthly_subscriber_quota;proxy-ep=proxy.individual.githubcopilot.com;st=dotcom;chat=1;cit=1;malfil=1;editor_preview_features=1;agent_mode=1;agent_mode_auto_approval=1;mcp=1;ccr=1;8kp=1;ip=137.205.73.18;asn=AS201773:0afe8e842bbf234a7d338ff0c8b279b2ab05f1ebcad969293cf690eee12265c6",
|
"access": "tid=af454cc719f9e4daffe9b4892fa4e791;exp=1775732126;sku=plus_monthly_subscriber_quota;proxy-ep=proxy.individual.githubcopilot.com;st=dotcom;chat=1;cit=1;malfil=1;editor_preview_features=1;agent_mode=1;agent_mode_auto_approval=1;mcp=1;client_byok=0;ccr=1;8kp=1;ip=81.104.194.177;asn=AS5089:e4ff19791adbf3b64531636bad853d4de1c02e75ac46089baa3d2d799cbefadf",
|
||||||
"expires": 1773665432000
|
"expires": 1775731826000
|
||||||
|
},
|
||||||
|
"openai-codex": {
|
||||||
|
"type": "oauth",
|
||||||
|
"access": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE5MzQ0ZTY1LWJiYzktNDRkMS1hOWQwLWY5NTdiMDc5YmQwZSIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsiaHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MSJdLCJjbGllbnRfaWQiOiJhcHBfRU1vYW1FRVo3M2YwQ2tYYVhwN2hyYW5uIiwiZXhwIjoxNzc2NDE1MDUwLCJodHRwczovL2FwaS5vcGVuYWkuY29tL2F1dGgiOnsiYW1yIjpbInBvcCIsInVybjpvcGVuYWk6YW1yOnBhc3NrZXkiLCJtZmEiXSwiY2hhdGdwdF9hY2NvdW50X2lkIjoiOTY1MTZkMjYtMjljOS00Y2JjLWEwZDItNmZjODdlNzc3ZjRhIiwiY2hhdGdwdF9hY2NvdW50X3VzZXJfaWQiOiJ1c2VyLXloUkkzTjdiVHlvc0xBd1I5NmNOU25wUV9fOTY1MTZkMjYtMjljOS00Y2JjLWEwZDItNmZjODdlNzc3ZjRhIiwiY2hhdGdwdF9jb21wdXRlX3Jlc2lkZW5jeSI6Im5vX2NvbnN0cmFpbnQiLCJjaGF0Z3B0X3BsYW5fdHlwZSI6InBsdXMiLCJjaGF0Z3B0X3VzZXJfaWQiOiJ1c2VyLXloUkkzTjdiVHlvc0xBd1I5NmNOU25wUSIsImxvY2FsaG9zdCI6dHJ1ZSwidXNlcl9pZCI6InVzZXIteWhSSTNON2JUeW9zTEF3Ujk2Y05TbnBRIn0sImh0dHBzOi8vYXBpLm9wZW5haS5jb20vbWZhIjp7InJlcXVpcmVkIjoieWVzIn0sImh0dHBzOi8vYXBpLm9wZW5haS5jb20vcHJvZmlsZSI6eyJlbWFpbCI6ImNoYXRncHQuY29tLmRldGVyZ2VudDI3N0BwYXNzbWFpbC5uZXQiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZX0sImlhdCI6MTc3NTU1MTA1MCwiaXNzIjoiaHR0cHM6Ly9hdXRoLm9wZW5haS5jb20iLCJqdGkiOiI5OGZmNDRjOC02ZWFlLTRhOWQtOGQ1Yy04MTNkYWI1NjY4ZDgiLCJuYmYiOjE3NzU1NTEwNTAsInB3ZF9hdXRoX3RpbWUiOjE3NzU1NTEwNDg4NTAsInNjcCI6WyJvcGVuaWQiLCJwcm9maWxlIiwiZW1haWwiLCJvZmZsaW5lX2FjY2VzcyJdLCJzZXNzaW9uX2lkIjoiYXV0aHNlc3NfOXVQRzcwbDcyQ1dkbTVtMXkyMmp6WkpyIiwic2wiOnRydWUsInN1YiI6ImF1dGgwfG1zcmNqUDZTYkgzdTROUHFzZ1Y2SERyNyJ9.AIcfng7BnC_IUK8DYedcWI8M6AZ5r2FszzM4orhrI5Ql0nXQ-eZBtV8RVcSl6wHvkcj6XX-BcpxxJQL_w0JbRPs4utQ7ayTeEhFYut8OnsLCTcMJDF0s5Qwv4GlTJNbuG_3P6hBe8xiZ6kPkDp0ZihZOkiceghPEaBRh_npt8-zm7SQyl8R8qdfhFToYzUAgGox3aZHVQeWGWpBm39MB_WigA6jsLCK5h-SwX5iuSHppGzii8ohyiaTgHfcEKUa9kgWXHa4iOtPHxPtD3t_rWJTZuc3XfeO4V3raR8HT96m8wrAHTgKlNA5IrmVwj8pt_fUH6AbApMrJY9q5Le6ubzCbH5bmnO2PIVLKfd7Kyw-E1gtjSOH61dvgRxDFLNwjAMeKNYRnrsPRZRr1pI5Y4JV9VejsjEE-MdvN48EEIWbZn4MvKtSSd5Xr_RGZPS80wLWV0WV_5qWL62aYJjTS4Vz4B3kWFBQsPNp08ykd2NL7b5H-uuP3akY97Jasklzvhuc9BgQZBymVlGO6Fwq1GiRggCu62B6OKJlxKOqgTOHGNGhFgmgGQWxpz-cCm-qKTb81vBEbziNBmXQdhL-507cFMJwsYBYyxKI1x79Gn3odkzHWoyijTxSCColYeqOBOdba9B9y8hdNmUwhn42W27A6Hm0bojiPoerUh6ng7Nk",
|
||||||
|
"refresh": "rt_LTCkO68CsFMGg9wrJP3qgfroR-b32AXV7Uw9cmtD_nA.4ZFAy5DZCiJaIEbHiSpLyddbqWhs02ZB53NMA9PRjq8",
|
||||||
|
"expires": 1776415049237,
|
||||||
|
"accountId": "96516d26-29c9-4cbc-a0d2-6fc87e777f4a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,3 +76,59 @@ export function allQuestionsAnswered(questions, answers) {
|
|||||||
export function nextTabAfterAnswer(currentTab, questionCount) {
|
export function nextTabAfterAnswer(currentTab, questionCount) {
|
||||||
return currentTab < questionCount - 1 ? currentTab + 1 : questionCount;
|
return currentTab < questionCount - 1 ? currentTab + 1 : questionCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function takeWrappedSegment(text, maxWidth) {
|
||||||
|
if (text.length <= maxWidth) {
|
||||||
|
return { line: text, rest: "" };
|
||||||
|
}
|
||||||
|
|
||||||
|
let breakpoint = -1;
|
||||||
|
for (let index = 0; index < maxWidth; index += 1) {
|
||||||
|
if (/\s/.test(text[index])) {
|
||||||
|
breakpoint = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (breakpoint > 0) {
|
||||||
|
return {
|
||||||
|
line: text.slice(0, breakpoint).trimEnd(),
|
||||||
|
rest: text.slice(breakpoint + 1).trimStart(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
line: text.slice(0, maxWidth),
|
||||||
|
rest: text.slice(maxWidth),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function wrapPrefixedText(text, width, firstPrefix = "", continuationPrefix = firstPrefix) {
|
||||||
|
const source = String(text ?? "");
|
||||||
|
if (source.length === 0) {
|
||||||
|
return [firstPrefix];
|
||||||
|
}
|
||||||
|
|
||||||
|
const lines = [];
|
||||||
|
const blocks = source.split(/\r?\n/);
|
||||||
|
let isFirstLine = true;
|
||||||
|
|
||||||
|
for (const block of blocks) {
|
||||||
|
let remaining = block.trim();
|
||||||
|
if (remaining.length === 0) {
|
||||||
|
lines.push(isFirstLine ? firstPrefix : continuationPrefix);
|
||||||
|
isFirstLine = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (remaining.length > 0) {
|
||||||
|
const prefix = isFirstLine ? firstPrefix : continuationPrefix;
|
||||||
|
const maxTextWidth = Math.max(1, width - prefix.length);
|
||||||
|
const { line, rest } = takeWrappedSegment(remaining, maxTextWidth);
|
||||||
|
lines.push(prefix + line);
|
||||||
|
remaining = rest;
|
||||||
|
isFirstLine = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lines;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
nextTabAfterAnswer,
|
nextTabAfterAnswer,
|
||||||
normalizeQuestions,
|
normalizeQuestions,
|
||||||
summarizeAnswers,
|
summarizeAnswers,
|
||||||
|
wrapPrefixedText,
|
||||||
} from "./question-core.mjs";
|
} from "./question-core.mjs";
|
||||||
|
|
||||||
test("normalizeQuestions adds default labels and appends the Something else option", () => {
|
test("normalizeQuestions adds default labels and appends the Something else option", () => {
|
||||||
@@ -157,3 +158,23 @@ test("nextTabAfterAnswer advances through questions and then to the submit tab",
|
|||||||
assert.equal(nextTabAfterAnswer(1, 3), 2);
|
assert.equal(nextTabAfterAnswer(1, 3), 2);
|
||||||
assert.equal(nextTabAfterAnswer(2, 3), 3);
|
assert.equal(nextTabAfterAnswer(2, 3), 3);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("wrapPrefixedText wraps long prompts and keeps the prefix on continuation lines", () => {
|
||||||
|
assert.deepEqual(wrapPrefixedText("Pick the best rollout strategy for this change", 18, " "), [
|
||||||
|
" Pick the best",
|
||||||
|
" rollout strategy",
|
||||||
|
" for this change",
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("wrapPrefixedText supports a different continuation prefix for wrapped option labels", () => {
|
||||||
|
assert.deepEqual(wrapPrefixedText("Very long option label", 16, "> 1. ", " "), [
|
||||||
|
"> 1. Very long",
|
||||||
|
" option",
|
||||||
|
" label",
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("wrapPrefixedText breaks oversized words when there is no whitespace boundary", () => {
|
||||||
|
assert.deepEqual(wrapPrefixedText("supercalifragilistic", 8), ["supercal", "ifragili", "stic"]);
|
||||||
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
nextTabAfterAnswer,
|
nextTabAfterAnswer,
|
||||||
normalizeQuestions,
|
normalizeQuestions,
|
||||||
summarizeAnswers,
|
summarizeAnswers,
|
||||||
|
wrapPrefixedText,
|
||||||
} from "./question-core.mjs";
|
} from "./question-core.mjs";
|
||||||
|
|
||||||
interface QuestionOption {
|
interface QuestionOption {
|
||||||
@@ -220,6 +221,32 @@ async function runQuestionFlow(ctx: any, questions: Question[]): Promise<Questio
|
|||||||
const question = currentQuestion();
|
const question = currentQuestion();
|
||||||
const options = currentOptions();
|
const options = currentOptions();
|
||||||
|
|
||||||
|
function addWrapped(text: string, color: string, firstPrefix = "", continuationPrefix = firstPrefix) {
|
||||||
|
for (const line of wrapPrefixedText(text, width, firstPrefix, continuationPrefix)) {
|
||||||
|
add(theme.fg(color, line));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addWrappedOption(option: QuestionOption, index: number, selected: boolean) {
|
||||||
|
const firstPrefix = `${selected ? "> " : " "}${index + 1}. `;
|
||||||
|
const continuationPrefix = " ".repeat(firstPrefix.length);
|
||||||
|
addWrapped(option.label, selected ? "accent" : "text", firstPrefix, continuationPrefix);
|
||||||
|
if (option.description) {
|
||||||
|
addWrapped(option.description, "muted", " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addWrappedReviewAnswer(questionLabel: string, value: string) {
|
||||||
|
const firstPrefix = ` ${questionLabel}: `;
|
||||||
|
const continuationPrefix = " ".repeat(firstPrefix.length);
|
||||||
|
const wrapped = wrapPrefixedText(value, width, firstPrefix, continuationPrefix);
|
||||||
|
for (let index = 0; index < wrapped.length; index += 1) {
|
||||||
|
const prefix = index === 0 ? firstPrefix : continuationPrefix;
|
||||||
|
const line = wrapped[index]!;
|
||||||
|
add(theme.fg("muted", prefix) + theme.fg("text", line.slice(prefix.length)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
add(theme.fg("accent", "─".repeat(width)));
|
add(theme.fg("accent", "─".repeat(width)));
|
||||||
|
|
||||||
if (isMulti) {
|
if (isMulti) {
|
||||||
@@ -247,19 +274,14 @@ async function runQuestionFlow(ctx: any, questions: Question[]): Promise<Questio
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (inputMode && question) {
|
if (inputMode && question) {
|
||||||
add(theme.fg("text", ` ${question.prompt}`));
|
addWrapped(question.prompt, "text", " ");
|
||||||
lines.push("");
|
lines.push("");
|
||||||
for (let index = 0; index < options.length; index += 1) {
|
for (let index = 0; index < options.length; index += 1) {
|
||||||
const option = options[index]!;
|
addWrappedOption(options[index]!, index, index === optionIndex);
|
||||||
const prefix = index === optionIndex ? theme.fg("accent", "> ") : " ";
|
|
||||||
add(prefix + theme.fg(index === optionIndex ? "accent" : "text", `${index + 1}. ${option.label}`));
|
|
||||||
if (option.description) {
|
|
||||||
add(` ${theme.fg("muted", option.description)}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lines.push("");
|
lines.push("");
|
||||||
add(theme.fg("muted", " Your answer:"));
|
add(theme.fg("muted", " Your answer:"));
|
||||||
for (const line of editor.render(width - 2)) {
|
for (const line of editor.render(Math.max(1, width - 2))) {
|
||||||
add(` ${line}`);
|
add(` ${line}`);
|
||||||
}
|
}
|
||||||
} else if (isMulti && currentTab === questions.length) {
|
} else if (isMulti && currentTab === questions.length) {
|
||||||
@@ -269,7 +291,7 @@ async function runQuestionFlow(ctx: any, questions: Question[]): Promise<Questio
|
|||||||
const answer = answers.get(reviewQuestion.id);
|
const answer = answers.get(reviewQuestion.id);
|
||||||
if (!answer) continue;
|
if (!answer) continue;
|
||||||
const label = answer.wasCustom ? `(wrote) ${answer.label}` : `${answer.index}. ${answer.label}`;
|
const label = answer.wasCustom ? `(wrote) ${answer.label}` : `${answer.index}. ${answer.label}`;
|
||||||
add(`${theme.fg("muted", ` ${reviewQuestion.label}: `)}${theme.fg("text", label)}`);
|
addWrappedReviewAnswer(reviewQuestion.label, label);
|
||||||
}
|
}
|
||||||
lines.push("");
|
lines.push("");
|
||||||
if (allQuestionsAnswered(questions, answers)) {
|
if (allQuestionsAnswered(questions, answers)) {
|
||||||
@@ -278,15 +300,10 @@ async function runQuestionFlow(ctx: any, questions: Question[]): Promise<Questio
|
|||||||
add(theme.fg("warning", " All questions must be answered before submit"));
|
add(theme.fg("warning", " All questions must be answered before submit"));
|
||||||
}
|
}
|
||||||
} else if (question) {
|
} else if (question) {
|
||||||
add(theme.fg("text", ` ${question.prompt}`));
|
addWrapped(question.prompt, "text", " ");
|
||||||
lines.push("");
|
lines.push("");
|
||||||
for (let index = 0; index < options.length; index += 1) {
|
for (let index = 0; index < options.length; index += 1) {
|
||||||
const option = options[index]!;
|
addWrappedOption(options[index]!, index, index === optionIndex);
|
||||||
const prefix = index === optionIndex ? theme.fg("accent", "> ") : " ";
|
|
||||||
add(prefix + theme.fg(index === optionIndex ? "accent" : "text", `${index + 1}. ${option.label}`));
|
|
||||||
if (option.description) {
|
|
||||||
add(` ${theme.fg("muted", option.description)}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
{
|
{
|
||||||
"lastChangelogVersion": "0.58.3",
|
"lastChangelogVersion": "0.66.1",
|
||||||
"defaultProvider": "github-copilot",
|
"defaultProvider": "openai-codex",
|
||||||
"defaultModel": "gpt-5.4",
|
"defaultModel": "gpt-5.4",
|
||||||
"defaultThinkingLevel": "medium"
|
"defaultThinkingLevel": "xhigh",
|
||||||
|
"transport": "auto",
|
||||||
|
"doubleEscapeAction": "fork",
|
||||||
|
"theme": "dark",
|
||||||
|
"hideThinkingBlock": false,
|
||||||
|
"packages": [],
|
||||||
|
"steeringMode": "all",
|
||||||
|
"treeFilterMode": "default",
|
||||||
|
"compaction": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"quietStartup": false,
|
||||||
|
"collapseChangelog": true,
|
||||||
|
"terminal": {
|
||||||
|
"showImages": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
196
.pi/agent/skills/frontend/adapt/SKILL.md
Normal file
196
.pi/agent/skills/frontend/adapt/SKILL.md
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
---
|
||||||
|
name: adapt
|
||||||
|
description: Adapt designs to work across different screen sizes, devices, contexts, or platforms. Implements breakpoints, fluid layouts, and touch targets. Use when the user mentions responsive design, mobile layouts, breakpoints, viewport adaptation, or cross-device compatibility.
|
||||||
|
---
|
||||||
|
|
||||||
|
Adapt existing designs to work effectively across different contexts - different screen sizes, devices, platforms, or use cases.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: target platforms/devices and usage contexts.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Adaptation Challenge
|
||||||
|
|
||||||
|
Understand what needs adaptation and why:
|
||||||
|
|
||||||
|
1. **Identify the source context**:
|
||||||
|
- What was it designed for originally? (Desktop web? Mobile app?)
|
||||||
|
- What assumptions were made? (Large screen? Mouse input? Fast connection?)
|
||||||
|
- What works well in current context?
|
||||||
|
|
||||||
|
2. **Understand target context**:
|
||||||
|
- **Device**: Mobile, tablet, desktop, TV, watch, print?
|
||||||
|
- **Input method**: Touch, mouse, keyboard, voice, gamepad?
|
||||||
|
- **Screen constraints**: Size, resolution, orientation?
|
||||||
|
- **Connection**: Fast wifi, slow 3G, offline?
|
||||||
|
- **Usage context**: On-the-go vs desk, quick glance vs focused reading?
|
||||||
|
- **User expectations**: What do users expect on this platform?
|
||||||
|
|
||||||
|
3. **Identify adaptation challenges**:
|
||||||
|
- What won't fit? (Content, navigation, features)
|
||||||
|
- What won't work? (Hover states on touch, tiny touch targets)
|
||||||
|
- What's inappropriate? (Desktop patterns on mobile, mobile patterns on desktop)
|
||||||
|
|
||||||
|
**CRITICAL**: Adaptation is not just scaling - it's rethinking the experience for the new context.
|
||||||
|
|
||||||
|
## Plan Adaptation Strategy
|
||||||
|
|
||||||
|
Create context-appropriate strategy:
|
||||||
|
|
||||||
|
### Mobile Adaptation (Desktop → Mobile)
|
||||||
|
|
||||||
|
**Layout Strategy**:
|
||||||
|
- Single column instead of multi-column
|
||||||
|
- Vertical stacking instead of side-by-side
|
||||||
|
- Full-width components instead of fixed widths
|
||||||
|
- Bottom navigation instead of top/side navigation
|
||||||
|
|
||||||
|
**Interaction Strategy**:
|
||||||
|
- Touch targets 44x44px minimum (not hover-dependent)
|
||||||
|
- Swipe gestures where appropriate (lists, carousels)
|
||||||
|
- Bottom sheets instead of dropdowns
|
||||||
|
- Thumbs-first design (controls within thumb reach)
|
||||||
|
- Larger tap areas with more spacing
|
||||||
|
|
||||||
|
**Content Strategy**:
|
||||||
|
- Progressive disclosure (don't show everything at once)
|
||||||
|
- Prioritize primary content (secondary content in tabs/accordions)
|
||||||
|
- Shorter text (more concise)
|
||||||
|
- Larger text (16px minimum)
|
||||||
|
|
||||||
|
**Navigation Strategy**:
|
||||||
|
- Hamburger menu or bottom navigation
|
||||||
|
- Reduce navigation complexity
|
||||||
|
- Sticky headers for context
|
||||||
|
- Back button in navigation flow
|
||||||
|
|
||||||
|
### Tablet Adaptation (Hybrid Approach)
|
||||||
|
|
||||||
|
**Layout Strategy**:
|
||||||
|
- Two-column layouts (not single or three-column)
|
||||||
|
- Side panels for secondary content
|
||||||
|
- Master-detail views (list + detail)
|
||||||
|
- Adaptive based on orientation (portrait vs landscape)
|
||||||
|
|
||||||
|
**Interaction Strategy**:
|
||||||
|
- Support both touch and pointer
|
||||||
|
- Touch targets 44x44px but allow denser layouts than phone
|
||||||
|
- Side navigation drawers
|
||||||
|
- Multi-column forms where appropriate
|
||||||
|
|
||||||
|
### Desktop Adaptation (Mobile → Desktop)
|
||||||
|
|
||||||
|
**Layout Strategy**:
|
||||||
|
- Multi-column layouts (use horizontal space)
|
||||||
|
- Side navigation always visible
|
||||||
|
- Multiple information panels simultaneously
|
||||||
|
- Fixed widths with max-width constraints (don't stretch to 4K)
|
||||||
|
|
||||||
|
**Interaction Strategy**:
|
||||||
|
- Hover states for additional information
|
||||||
|
- Keyboard shortcuts
|
||||||
|
- Right-click context menus
|
||||||
|
- Drag and drop where helpful
|
||||||
|
- Multi-select with Shift/Cmd
|
||||||
|
|
||||||
|
**Content Strategy**:
|
||||||
|
- Show more information upfront (less progressive disclosure)
|
||||||
|
- Data tables with many columns
|
||||||
|
- Richer visualizations
|
||||||
|
- More detailed descriptions
|
||||||
|
|
||||||
|
### Print Adaptation (Screen → Print)
|
||||||
|
|
||||||
|
**Layout Strategy**:
|
||||||
|
- Page breaks at logical points
|
||||||
|
- Remove navigation, footer, interactive elements
|
||||||
|
- Black and white (or limited color)
|
||||||
|
- Proper margins for binding
|
||||||
|
|
||||||
|
**Content Strategy**:
|
||||||
|
- Expand shortened content (show full URLs, hidden sections)
|
||||||
|
- Add page numbers, headers, footers
|
||||||
|
- Include metadata (print date, page title)
|
||||||
|
- Convert charts to print-friendly versions
|
||||||
|
|
||||||
|
### Email Adaptation (Web → Email)
|
||||||
|
|
||||||
|
**Layout Strategy**:
|
||||||
|
- Narrow width (600px max)
|
||||||
|
- Single column only
|
||||||
|
- Inline CSS (no external stylesheets)
|
||||||
|
- Table-based layouts (for email client compatibility)
|
||||||
|
|
||||||
|
**Interaction Strategy**:
|
||||||
|
- Large, obvious CTAs (buttons not text links)
|
||||||
|
- No hover states (not reliable)
|
||||||
|
- Deep links to web app for complex interactions
|
||||||
|
|
||||||
|
## Implement Adaptations
|
||||||
|
|
||||||
|
Apply changes systematically:
|
||||||
|
|
||||||
|
### Responsive Breakpoints
|
||||||
|
|
||||||
|
Choose appropriate breakpoints:
|
||||||
|
- Mobile: 320px-767px
|
||||||
|
- Tablet: 768px-1023px
|
||||||
|
- Desktop: 1024px+
|
||||||
|
- Or content-driven breakpoints (where design breaks)
|
||||||
|
|
||||||
|
### Layout Adaptation Techniques
|
||||||
|
|
||||||
|
- **CSS Grid/Flexbox**: Reflow layouts automatically
|
||||||
|
- **Container Queries**: Adapt based on container, not viewport
|
||||||
|
- **`clamp()`**: Fluid sizing between min and max
|
||||||
|
- **Media queries**: Different styles for different contexts
|
||||||
|
- **Display properties**: Show/hide elements per context
|
||||||
|
|
||||||
|
### Touch Adaptation
|
||||||
|
|
||||||
|
- Increase touch target sizes (44x44px minimum)
|
||||||
|
- Add more spacing between interactive elements
|
||||||
|
- Remove hover-dependent interactions
|
||||||
|
- Add touch feedback (ripples, highlights)
|
||||||
|
- Consider thumb zones (easier to reach bottom than top)
|
||||||
|
|
||||||
|
### Content Adaptation
|
||||||
|
|
||||||
|
- Use `display: none` sparingly (still downloads)
|
||||||
|
- Progressive enhancement (core content first, enhancements on larger screens)
|
||||||
|
- Lazy loading for off-screen content
|
||||||
|
- Responsive images (`srcset`, `picture` element)
|
||||||
|
|
||||||
|
### Navigation Adaptation
|
||||||
|
|
||||||
|
- Transform complex nav to hamburger/drawer on mobile
|
||||||
|
- Bottom nav bar for mobile apps
|
||||||
|
- Persistent side navigation on desktop
|
||||||
|
- Breadcrumbs on smaller screens for context
|
||||||
|
|
||||||
|
**IMPORTANT**: Test on real devices, not just browser DevTools. Device emulation is helpful but not perfect.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Hide core functionality on mobile (if it matters, make it work)
|
||||||
|
- Assume desktop = powerful device (consider accessibility, older machines)
|
||||||
|
- Use different information architecture across contexts (confusing)
|
||||||
|
- Break user expectations for platform (mobile users expect mobile patterns)
|
||||||
|
- Forget landscape orientation on mobile/tablet
|
||||||
|
- Use generic breakpoints blindly (use content-driven breakpoints)
|
||||||
|
- Ignore touch on desktop (many desktop devices have touch)
|
||||||
|
|
||||||
|
## Verify Adaptations
|
||||||
|
|
||||||
|
Test thoroughly across contexts:
|
||||||
|
|
||||||
|
- **Real devices**: Test on actual phones, tablets, desktops
|
||||||
|
- **Different orientations**: Portrait and landscape
|
||||||
|
- **Different browsers**: Safari, Chrome, Firefox, Edge
|
||||||
|
- **Different OS**: iOS, Android, Windows, macOS
|
||||||
|
- **Different input methods**: Touch, mouse, keyboard
|
||||||
|
- **Edge cases**: Very small screens (320px), very large screens (4K)
|
||||||
|
- **Slow connections**: Test on throttled network
|
||||||
|
|
||||||
|
Remember: You're a cross-platform design expert. Make experiences that feel native to each context while maintaining brand and functionality consistency. Adapt intentionally, test thoroughly.
|
||||||
172
.pi/agent/skills/frontend/animate/SKILL.md
Normal file
172
.pi/agent/skills/frontend/animate/SKILL.md
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
---
|
||||||
|
name: animate
|
||||||
|
description: Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight. Use when the user mentions adding animation, transitions, micro-interactions, motion design, hover effects, or making the UI feel more alive.
|
||||||
|
---
|
||||||
|
|
||||||
|
Analyze a feature and strategically add animations and micro-interactions that enhance understanding, provide feedback, and create delight.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: performance constraints.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Animation Opportunities
|
||||||
|
|
||||||
|
Analyze where motion would improve the experience:
|
||||||
|
|
||||||
|
1. **Identify static areas**:
|
||||||
|
- **Missing feedback**: Actions without visual acknowledgment (button clicks, form submission, etc.)
|
||||||
|
- **Jarring transitions**: Instant state changes that feel abrupt (show/hide, page loads, route changes)
|
||||||
|
- **Unclear relationships**: Spatial or hierarchical relationships that aren't obvious
|
||||||
|
- **Lack of delight**: Functional but joyless interactions
|
||||||
|
- **Missed guidance**: Opportunities to direct attention or explain behavior
|
||||||
|
|
||||||
|
2. **Understand the context**:
|
||||||
|
- What's the personality? (Playful vs serious, energetic vs calm)
|
||||||
|
- What's the performance budget? (Mobile-first? Complex page?)
|
||||||
|
- Who's the audience? (Motion-sensitive users? Power users who want speed?)
|
||||||
|
- What matters most? (One hero animation vs many micro-interactions?)
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: Respect `prefers-reduced-motion`. Always provide non-animated alternatives for users who need them.
|
||||||
|
|
||||||
|
## Plan Animation Strategy
|
||||||
|
|
||||||
|
Create a purposeful animation plan:
|
||||||
|
|
||||||
|
- **Hero moment**: What's the ONE signature animation? (Page load? Hero section? Key interaction?)
|
||||||
|
- **Feedback layer**: Which interactions need acknowledgment?
|
||||||
|
- **Transition layer**: Which state changes need smoothing?
|
||||||
|
- **Delight layer**: Where can we surprise and delight?
|
||||||
|
|
||||||
|
**IMPORTANT**: One well-orchestrated experience beats scattered animations everywhere. Focus on high-impact moments.
|
||||||
|
|
||||||
|
## Implement Animations
|
||||||
|
|
||||||
|
Add motion systematically across these categories:
|
||||||
|
|
||||||
|
### Entrance Animations
|
||||||
|
- **Page load choreography**: Stagger element reveals (100-150ms delays), fade + slide combinations
|
||||||
|
- **Hero section**: Dramatic entrance for primary content (scale, parallax, or creative effects)
|
||||||
|
- **Content reveals**: Scroll-triggered animations using intersection observer
|
||||||
|
- **Modal/drawer entry**: Smooth slide + fade, backdrop fade, focus management
|
||||||
|
|
||||||
|
### Micro-interactions
|
||||||
|
- **Button feedback**:
|
||||||
|
- Hover: Subtle scale (1.02-1.05), color shift, shadow increase
|
||||||
|
- Click: Quick scale down then up (0.95 → 1), ripple effect
|
||||||
|
- Loading: Spinner or pulse state
|
||||||
|
- **Form interactions**:
|
||||||
|
- Input focus: Border color transition, slight scale or glow
|
||||||
|
- Validation: Shake on error, check mark on success, smooth color transitions
|
||||||
|
- **Toggle switches**: Smooth slide + color transition (200-300ms)
|
||||||
|
- **Checkboxes/radio**: Check mark animation, ripple effect
|
||||||
|
- **Like/favorite**: Scale + rotation, particle effects, color transition
|
||||||
|
|
||||||
|
### State Transitions
|
||||||
|
- **Show/hide**: Fade + slide (not instant), appropriate timing (200-300ms)
|
||||||
|
- **Expand/collapse**: Height transition with overflow handling, icon rotation
|
||||||
|
- **Loading states**: Skeleton screen fades, spinner animations, progress bars
|
||||||
|
- **Success/error**: Color transitions, icon animations, gentle scale pulse
|
||||||
|
- **Enable/disable**: Opacity transitions, cursor changes
|
||||||
|
|
||||||
|
### Navigation & Flow
|
||||||
|
- **Page transitions**: Crossfade between routes, shared element transitions
|
||||||
|
- **Tab switching**: Slide indicator, content fade/slide
|
||||||
|
- **Carousel/slider**: Smooth transforms, snap points, momentum
|
||||||
|
- **Scroll effects**: Parallax layers, sticky headers with state changes, scroll progress indicators
|
||||||
|
|
||||||
|
### Feedback & Guidance
|
||||||
|
- **Hover hints**: Tooltip fade-ins, cursor changes, element highlights
|
||||||
|
- **Drag & drop**: Lift effect (shadow + scale), drop zone highlights, smooth repositioning
|
||||||
|
- **Copy/paste**: Brief highlight flash on paste, "copied" confirmation
|
||||||
|
- **Focus flow**: Highlight path through form or workflow
|
||||||
|
|
||||||
|
### Delight Moments
|
||||||
|
- **Empty states**: Subtle floating animations on illustrations
|
||||||
|
- **Completed actions**: Confetti, check mark flourish, success celebrations
|
||||||
|
- **Easter eggs**: Hidden interactions for discovery
|
||||||
|
- **Contextual animation**: Weather effects, time-of-day themes, seasonal touches
|
||||||
|
|
||||||
|
## Technical Implementation
|
||||||
|
|
||||||
|
Use appropriate techniques for each animation:
|
||||||
|
|
||||||
|
### Timing & Easing
|
||||||
|
|
||||||
|
**Durations by purpose:**
|
||||||
|
- **100-150ms**: Instant feedback (button press, toggle)
|
||||||
|
- **200-300ms**: State changes (hover, menu open)
|
||||||
|
- **300-500ms**: Layout changes (accordion, modal)
|
||||||
|
- **500-800ms**: Entrance animations (page load)
|
||||||
|
|
||||||
|
**Easing curves (use these, not CSS defaults):**
|
||||||
|
```css
|
||||||
|
/* Recommended - natural deceleration */
|
||||||
|
--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1); /* Smooth, refined */
|
||||||
|
--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); /* Slightly snappier */
|
||||||
|
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); /* Confident, decisive */
|
||||||
|
|
||||||
|
/* AVOID - feel dated and tacky */
|
||||||
|
/* bounce: cubic-bezier(0.34, 1.56, 0.64, 1); */
|
||||||
|
/* elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6); */
|
||||||
|
```
|
||||||
|
|
||||||
|
**Exit animations are faster than entrances.** Use ~75% of enter duration.
|
||||||
|
|
||||||
|
### CSS Animations
|
||||||
|
```css
|
||||||
|
/* Prefer for simple, declarative animations */
|
||||||
|
- transitions for state changes
|
||||||
|
- @keyframes for complex sequences
|
||||||
|
- transform + opacity only (GPU-accelerated)
|
||||||
|
```
|
||||||
|
|
||||||
|
### JavaScript Animation
|
||||||
|
```javascript
|
||||||
|
/* Use for complex, interactive animations */
|
||||||
|
- Web Animations API for programmatic control
|
||||||
|
- Framer Motion for React
|
||||||
|
- GSAP for complex sequences
|
||||||
|
```
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
- **GPU acceleration**: Use `transform` and `opacity`, avoid layout properties
|
||||||
|
- **will-change**: Add sparingly for known expensive animations
|
||||||
|
- **Reduce paint**: Minimize repaints, use `contain` where appropriate
|
||||||
|
- **Monitor FPS**: Ensure 60fps on target devices
|
||||||
|
|
||||||
|
### Accessibility
|
||||||
|
```css
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
* {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Use bounce or elastic easing curves—they feel dated and draw attention to the animation itself
|
||||||
|
- Animate layout properties (width, height, top, left)—use transform instead
|
||||||
|
- Use durations over 500ms for feedback—it feels laggy
|
||||||
|
- Animate without purpose—every animation needs a reason
|
||||||
|
- Ignore `prefers-reduced-motion`—this is an accessibility violation
|
||||||
|
- Animate everything—animation fatigue makes interfaces feel exhausting
|
||||||
|
- Block interaction during animations unless intentional
|
||||||
|
|
||||||
|
## Verify Quality
|
||||||
|
|
||||||
|
Test animations thoroughly:
|
||||||
|
|
||||||
|
- **Smooth at 60fps**: No jank on target devices
|
||||||
|
- **Feels natural**: Easing curves feel organic, not robotic
|
||||||
|
- **Appropriate timing**: Not too fast (jarring) or too slow (laggy)
|
||||||
|
- **Reduced motion works**: Animations disabled or simplified appropriately
|
||||||
|
- **Doesn't block**: Users can interact during/after animations
|
||||||
|
- **Adds value**: Makes interface clearer or more delightful
|
||||||
|
|
||||||
|
Remember: Motion should enhance understanding and provide feedback, not just add decoration. Animate with purpose, respect performance constraints, and always consider accessibility. Great animation is invisible - it just makes everything feel right.
|
||||||
122
.pi/agent/skills/frontend/arrange/SKILL.md
Normal file
122
.pi/agent/skills/frontend/arrange/SKILL.md
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
---
|
||||||
|
name: arrange
|
||||||
|
description: Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.
|
||||||
|
---
|
||||||
|
|
||||||
|
Assess and improve layout and spacing that feels monotonous, crowded, or structurally weak — turning generic arrangements into intentional, rhythmic compositions.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current Layout
|
||||||
|
|
||||||
|
Analyze what's weak about the current spatial design:
|
||||||
|
|
||||||
|
1. **Spacing**:
|
||||||
|
- Is spacing consistent or arbitrary? (Random padding/margin values)
|
||||||
|
- Is all spacing the same? (Equal padding everywhere = no rhythm)
|
||||||
|
- Are related elements grouped tightly, with generous space between groups?
|
||||||
|
|
||||||
|
2. **Visual hierarchy**:
|
||||||
|
- Apply the squint test: blur your (metaphorical) eyes — can you still identify the most important element, second most important, and clear groupings?
|
||||||
|
- Is hierarchy achieved effectively? (Space and weight alone can be enough — but is the current approach working?)
|
||||||
|
- Does whitespace guide the eye to what matters?
|
||||||
|
|
||||||
|
3. **Grid & structure**:
|
||||||
|
- Is there a clear underlying structure, or does the layout feel random?
|
||||||
|
- Are identical card grids used everywhere? (Icon + heading + text, repeated endlessly)
|
||||||
|
- Is everything centered? (Left-aligned with asymmetric layouts feels more designed, but not a hard and fast rule)
|
||||||
|
|
||||||
|
4. **Rhythm & variety**:
|
||||||
|
- Does the layout have visual rhythm? (Alternating tight/generous spacing)
|
||||||
|
- Is every section structured the same way? (Monotonous repetition)
|
||||||
|
- Are there intentional moments of surprise or emphasis?
|
||||||
|
|
||||||
|
5. **Density**:
|
||||||
|
- Is the layout too cramped? (Not enough breathing room)
|
||||||
|
- Is the layout too sparse? (Excessive whitespace without purpose)
|
||||||
|
- Does density match the content type? (Data-dense UIs need tighter spacing; marketing pages need more air)
|
||||||
|
|
||||||
|
**CRITICAL**: Layout problems are often the root cause of interfaces feeling "off" even when colors and fonts are fine. Space is a design material — use it with intention.
|
||||||
|
|
||||||
|
## Plan Layout Improvements
|
||||||
|
|
||||||
|
Consult the [spatial design reference](reference/spatial-design.md) from the frontend-design skill for detailed guidance on grids, rhythm, and container queries.
|
||||||
|
|
||||||
|
Create a systematic plan:
|
||||||
|
|
||||||
|
- **Spacing system**: Use a consistent scale — whether that's a framework's built-in scale (e.g., Tailwind), rem-based tokens, or a custom system. The specific values matter less than consistency.
|
||||||
|
- **Hierarchy strategy**: How will space communicate importance?
|
||||||
|
- **Layout approach**: What structure fits the content? Flex for 1D, Grid for 2D, named areas for complex page layouts.
|
||||||
|
- **Rhythm**: Where should spacing be tight vs generous?
|
||||||
|
|
||||||
|
## Improve Layout Systematically
|
||||||
|
|
||||||
|
### Establish a Spacing System
|
||||||
|
|
||||||
|
- Use a consistent spacing scale — framework scales (Tailwind, etc.), rem-based tokens, or a custom scale all work. What matters is that values come from a defined set, not arbitrary numbers.
|
||||||
|
- Name tokens semantically if using custom properties: `--space-xs` through `--space-xl`, not `--spacing-8`
|
||||||
|
- Use `gap` for sibling spacing instead of margins — eliminates margin collapse hacks
|
||||||
|
- Apply `clamp()` for fluid spacing that breathes on larger screens
|
||||||
|
|
||||||
|
### Create Visual Rhythm
|
||||||
|
|
||||||
|
- **Tight grouping** for related elements (8-12px between siblings)
|
||||||
|
- **Generous separation** between distinct sections (48-96px)
|
||||||
|
- **Varied spacing** within sections — not every row needs the same gap
|
||||||
|
- **Asymmetric compositions** — break the predictable centered-content pattern when it makes sense
|
||||||
|
|
||||||
|
### Choose the Right Layout Tool
|
||||||
|
|
||||||
|
- **Use Flexbox for 1D layouts**: Rows of items, nav bars, button groups, card contents, most component internals. Flex is simpler and more appropriate for the majority of layout tasks.
|
||||||
|
- **Use Grid for 2D layouts**: Page-level structure, dashboards, data-dense interfaces, anything where rows AND columns need coordinated control.
|
||||||
|
- **Don't default to Grid** when Flexbox with `flex-wrap` would be simpler and more flexible.
|
||||||
|
- Use `repeat(auto-fit, minmax(280px, 1fr))` for responsive grids without breakpoints.
|
||||||
|
- Use named grid areas (`grid-template-areas`) for complex page layouts — redefine at breakpoints.
|
||||||
|
|
||||||
|
### Break Card Grid Monotony
|
||||||
|
|
||||||
|
- Don't default to card grids for everything — spacing and alignment create visual grouping naturally
|
||||||
|
- Use cards only when content is truly distinct and actionable — never nest cards inside cards
|
||||||
|
- Vary card sizes, span columns, or mix cards with non-card content to break repetition
|
||||||
|
|
||||||
|
### Strengthen Visual Hierarchy
|
||||||
|
|
||||||
|
- Use the fewest dimensions needed for clear hierarchy. Space alone can be enough — generous whitespace around an element draws the eye. Some of the most sophisticated designs achieve rhythm with just space and weight. Add color or size contrast only when simpler means aren't sufficient.
|
||||||
|
- Be aware of reading flow — in LTR languages, the eye naturally scans top-left to bottom-right, but primary action placement depends on context (e.g., bottom-right in dialogs, top in navigation).
|
||||||
|
- Create clear content groupings through proximity and separation.
|
||||||
|
|
||||||
|
### Manage Depth & Elevation
|
||||||
|
|
||||||
|
- Create a semantic z-index scale (dropdown → sticky → modal-backdrop → modal → toast → tooltip)
|
||||||
|
- Build a consistent shadow scale (sm → md → lg → xl) — shadows should be subtle
|
||||||
|
- Use elevation to reinforce hierarchy, not as decoration
|
||||||
|
|
||||||
|
### Optical Adjustments
|
||||||
|
|
||||||
|
- If an icon looks visually off-center despite being geometrically centered, nudge it — but only if you're confident it actually looks wrong. Don't adjust speculatively.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Use arbitrary spacing values outside your scale
|
||||||
|
- Make all spacing equal — variety creates hierarchy
|
||||||
|
- Wrap everything in cards — not everything needs a container
|
||||||
|
- Nest cards inside cards — use spacing and dividers for hierarchy within
|
||||||
|
- Use identical card grids everywhere (icon + heading + text, repeated)
|
||||||
|
- Center everything — left-aligned with asymmetry feels more designed
|
||||||
|
- Default to the hero metric layout (big number, small label, stats, gradient) as a template. If showing real user data, a prominent metric can work — but it should display actual data, not decorative numbers.
|
||||||
|
- Default to CSS Grid when Flexbox would be simpler — use the simplest tool for the job
|
||||||
|
- Use arbitrary z-index values (999, 9999) — build a semantic scale
|
||||||
|
|
||||||
|
## Verify Layout Improvements
|
||||||
|
|
||||||
|
- **Squint test**: Can you identify primary, secondary, and groupings with blurred vision?
|
||||||
|
- **Rhythm**: Does the page have a satisfying beat of tight and generous spacing?
|
||||||
|
- **Hierarchy**: Is the most important content obvious within 2 seconds?
|
||||||
|
- **Breathing room**: Does the layout feel comfortable, not cramped or wasteful?
|
||||||
|
- **Consistency**: Is the spacing system applied uniformly?
|
||||||
|
- **Responsiveness**: Does the layout adapt gracefully across screen sizes?
|
||||||
|
|
||||||
|
Remember: Space is the most underused design tool. A layout with the right rhythm and hierarchy can make even simple content feel polished and intentional.
|
||||||
145
.pi/agent/skills/frontend/audit/SKILL.md
Normal file
145
.pi/agent/skills/frontend/audit/SKILL.md
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
---
|
||||||
|
name: audit
|
||||||
|
description: Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
|
||||||
|
---
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Run systematic **technical** quality checks and generate a comprehensive report. Don't fix issues — document them for other commands to address.
|
||||||
|
|
||||||
|
This is a code-level audit, not a design critique. Check what's measurable and verifiable in the implementation.
|
||||||
|
|
||||||
|
## Diagnostic Scan
|
||||||
|
|
||||||
|
Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the criteria below.
|
||||||
|
|
||||||
|
### 1. Accessibility (A11y)
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- **Contrast issues**: Text contrast ratios < 4.5:1 (or 7:1 for AAA)
|
||||||
|
- **Missing ARIA**: Interactive elements without proper roles, labels, or states
|
||||||
|
- **Keyboard navigation**: Missing focus indicators, illogical tab order, keyboard traps
|
||||||
|
- **Semantic HTML**: Improper heading hierarchy, missing landmarks, divs instead of buttons
|
||||||
|
- **Alt text**: Missing or poor image descriptions
|
||||||
|
- **Form issues**: Inputs without labels, poor error messaging, missing required indicators
|
||||||
|
|
||||||
|
**Score 0-4**: 0=Inaccessible (fails WCAG A), 1=Major gaps (few ARIA labels, no keyboard nav), 2=Partial (some a11y effort, significant gaps), 3=Good (WCAG AA mostly met, minor gaps), 4=Excellent (WCAG AA fully met, approaches AAA)
|
||||||
|
|
||||||
|
### 2. Performance
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- **Layout thrashing**: Reading/writing layout properties in loops
|
||||||
|
- **Expensive animations**: Animating layout properties (width, height, top, left) instead of transform/opacity
|
||||||
|
- **Missing optimization**: Images without lazy loading, unoptimized assets, missing will-change
|
||||||
|
- **Bundle size**: Unnecessary imports, unused dependencies
|
||||||
|
- **Render performance**: Unnecessary re-renders, missing memoization
|
||||||
|
|
||||||
|
**Score 0-4**: 0=Severe issues (layout thrash, unoptimized everything), 1=Major problems (no lazy loading, expensive animations), 2=Partial (some optimization, gaps remain), 3=Good (mostly optimized, minor improvements possible), 4=Excellent (fast, lean, well-optimized)
|
||||||
|
|
||||||
|
### 3. Theming
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- **Hard-coded colors**: Colors not using design tokens
|
||||||
|
- **Broken dark mode**: Missing dark mode variants, poor contrast in dark theme
|
||||||
|
- **Inconsistent tokens**: Using wrong tokens, mixing token types
|
||||||
|
- **Theme switching issues**: Values that don't update on theme change
|
||||||
|
|
||||||
|
**Score 0-4**: 0=No theming (hard-coded everything), 1=Minimal tokens (mostly hard-coded), 2=Partial (tokens exist but inconsistently used), 3=Good (tokens used, minor hard-coded values), 4=Excellent (full token system, dark mode works perfectly)
|
||||||
|
|
||||||
|
### 4. Responsive Design
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- **Fixed widths**: Hard-coded widths that break on mobile
|
||||||
|
- **Touch targets**: Interactive elements < 44x44px
|
||||||
|
- **Horizontal scroll**: Content overflow on narrow viewports
|
||||||
|
- **Text scaling**: Layouts that break when text size increases
|
||||||
|
- **Missing breakpoints**: No mobile/tablet variants
|
||||||
|
|
||||||
|
**Score 0-4**: 0=Desktop-only (breaks on mobile), 1=Major issues (some breakpoints, many failures), 2=Partial (works on mobile, rough edges), 3=Good (responsive, minor touch target or overflow issues), 4=Excellent (fluid, all viewports, proper touch targets)
|
||||||
|
|
||||||
|
### 5. Anti-Patterns (CRITICAL)
|
||||||
|
|
||||||
|
Check against ALL the **DON'T** guidelines in the frontend-design skill. Look for AI slop tells (AI color palette, gradient text, glassmorphism, hero metrics, card grids, generic fonts) and general design anti-patterns (gray on color, nested cards, bounce easing, redundant copy).
|
||||||
|
|
||||||
|
**Score 0-4**: 0=AI slop gallery (5+ tells), 1=Heavy AI aesthetic (3-4 tells), 2=Some tells (1-2 noticeable), 3=Mostly clean (subtle issues only), 4=No AI tells (distinctive, intentional design)
|
||||||
|
|
||||||
|
## Generate Report
|
||||||
|
|
||||||
|
### Audit Health Score
|
||||||
|
|
||||||
|
| # | Dimension | Score | Key Finding |
|
||||||
|
|---|-----------|-------|-------------|
|
||||||
|
| 1 | Accessibility | ? | [most critical a11y issue or "--"] |
|
||||||
|
| 2 | Performance | ? | |
|
||||||
|
| 3 | Responsive Design | ? | |
|
||||||
|
| 4 | Theming | ? | |
|
||||||
|
| 5 | Anti-Patterns | ? | |
|
||||||
|
| **Total** | | **??/20** | **[Rating band]** |
|
||||||
|
|
||||||
|
**Rating bands**: 18-20 Excellent (minor polish), 14-17 Good (address weak dimensions), 10-13 Acceptable (significant work needed), 6-9 Poor (major overhaul), 0-5 Critical (fundamental issues)
|
||||||
|
|
||||||
|
### Anti-Patterns Verdict
|
||||||
|
**Start here.** Pass/fail: Does this look AI-generated? List specific tells. Be brutally honest.
|
||||||
|
|
||||||
|
### Executive Summary
|
||||||
|
- Audit Health Score: **??/20** ([rating band])
|
||||||
|
- Total issues found (count by severity: P0/P1/P2/P3)
|
||||||
|
- Top 3-5 critical issues
|
||||||
|
- Recommended next steps
|
||||||
|
|
||||||
|
### Detailed Findings by Severity
|
||||||
|
|
||||||
|
Tag every issue with **P0-P3 severity**:
|
||||||
|
- **P0 Blocking**: Prevents task completion — fix immediately
|
||||||
|
- **P1 Major**: Significant difficulty or WCAG AA violation — fix before release
|
||||||
|
- **P2 Minor**: Annoyance, workaround exists — fix in next pass
|
||||||
|
- **P3 Polish**: Nice-to-fix, no real user impact — fix if time permits
|
||||||
|
|
||||||
|
For each issue, document:
|
||||||
|
- **[P?] Issue name**
|
||||||
|
- **Location**: Component, file, line
|
||||||
|
- **Category**: Accessibility / Performance / Theming / Responsive / Anti-Pattern
|
||||||
|
- **Impact**: How it affects users
|
||||||
|
- **WCAG/Standard**: Which standard it violates (if applicable)
|
||||||
|
- **Recommendation**: How to fix it
|
||||||
|
- **Suggested command**: Which command to use (prefer: /animate, /quieter, /optimize, /adapt, /clarify, /distill, /delight, /onboard, /normalize, /audit, /harden, /polish, /extract, /bolder, /arrange, /typeset, /critique, /colorize, /overdrive)
|
||||||
|
|
||||||
|
### Patterns & Systemic Issues
|
||||||
|
|
||||||
|
Identify recurring problems that indicate systemic gaps rather than one-off mistakes:
|
||||||
|
- "Hard-coded colors appear in 15+ components, should use design tokens"
|
||||||
|
- "Touch targets consistently too small (<44px) throughout mobile experience"
|
||||||
|
|
||||||
|
### Positive Findings
|
||||||
|
|
||||||
|
Note what's working well — good practices to maintain and replicate.
|
||||||
|
|
||||||
|
## Recommended Actions
|
||||||
|
|
||||||
|
List recommended commands in priority order (P0 first, then P1, then P2):
|
||||||
|
|
||||||
|
1. **[P?] `/command-name`** — Brief description (specific context from audit findings)
|
||||||
|
2. **[P?] `/command-name`** — Brief description (specific context)
|
||||||
|
|
||||||
|
**Rules**: Only recommend commands from: /animate, /quieter, /optimize, /adapt, /clarify, /distill, /delight, /onboard, /normalize, /audit, /harden, /polish, /extract, /bolder, /arrange, /typeset, /critique, /colorize, /overdrive. Map findings to the most appropriate command. End with `/polish` as the final step if any fixes were recommended.
|
||||||
|
|
||||||
|
After presenting the summary, tell the user:
|
||||||
|
|
||||||
|
> You can ask me to run these one at a time, all at once, or in any order you prefer.
|
||||||
|
>
|
||||||
|
> Re-run `/audit` after fixes to see your score improve.
|
||||||
|
|
||||||
|
**IMPORTANT**: Be thorough but actionable. Too many P3 issues creates noise. Focus on what actually matters.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Report issues without explaining impact (why does this matter?)
|
||||||
|
- Provide generic recommendations (be specific and actionable)
|
||||||
|
- Skip positive findings (celebrate what works)
|
||||||
|
- Forget to prioritize (everything can't be P0)
|
||||||
|
- Report false positives without verification
|
||||||
|
|
||||||
|
Remember: You're a technical quality auditor. Document systematically, prioritize ruthlessly, cite specific code locations, and provide clear paths to improvement.
|
||||||
114
.pi/agent/skills/frontend/bolder/SKILL.md
Normal file
114
.pi/agent/skills/frontend/bolder/SKILL.md
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
---
|
||||||
|
name: bolder
|
||||||
|
description: Amplify safe or boring designs to make them more visually interesting and stimulating. Increases impact while maintaining usability. Use when the user says the design looks bland, generic, too safe, lacks personality, or wants more visual impact and character.
|
||||||
|
---
|
||||||
|
|
||||||
|
Increase visual impact and personality in designs that are too safe, generic, or visually underwhelming, creating more engaging and memorable experiences.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current State
|
||||||
|
|
||||||
|
Analyze what makes the design feel too safe or boring:
|
||||||
|
|
||||||
|
1. **Identify weakness sources**:
|
||||||
|
- **Generic choices**: System fonts, basic colors, standard layouts
|
||||||
|
- **Timid scale**: Everything is medium-sized with no drama
|
||||||
|
- **Low contrast**: Everything has similar visual weight
|
||||||
|
- **Static**: No motion, no energy, no life
|
||||||
|
- **Predictable**: Standard patterns with no surprises
|
||||||
|
- **Flat hierarchy**: Nothing stands out or commands attention
|
||||||
|
|
||||||
|
2. **Understand the context**:
|
||||||
|
- What's the brand personality? (How far can we push?)
|
||||||
|
- What's the purpose? (Marketing can be bolder than financial dashboards)
|
||||||
|
- Who's the audience? (What will resonate?)
|
||||||
|
- What are the constraints? (Brand guidelines, accessibility, performance)
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: "Bolder" doesn't mean chaotic or garish. It means distinctive, memorable, and confident. Think intentional drama, not random chaos.
|
||||||
|
|
||||||
|
**WARNING - AI SLOP TRAP**: When making things "bolder," AI defaults to the same tired tricks: cyan/purple gradients, glassmorphism, neon accents on dark backgrounds, gradient text on metrics. These are the OPPOSITE of bold—they're generic. Review ALL the DON'T guidelines in the frontend-design skill before proceeding. Bold means distinctive, not "more effects."
|
||||||
|
|
||||||
|
## Plan Amplification
|
||||||
|
|
||||||
|
Create a strategy to increase impact while maintaining coherence:
|
||||||
|
|
||||||
|
- **Focal point**: What should be the hero moment? (Pick ONE, make it amazing)
|
||||||
|
- **Personality direction**: Maximalist chaos? Elegant drama? Playful energy? Dark moody? Choose a lane.
|
||||||
|
- **Risk budget**: How experimental can we be? Push boundaries within constraints.
|
||||||
|
- **Hierarchy amplification**: Make big things BIGGER, small things smaller (increase contrast)
|
||||||
|
|
||||||
|
**IMPORTANT**: Bold design must still be usable. Impact without function is just decoration.
|
||||||
|
|
||||||
|
## Amplify the Design
|
||||||
|
|
||||||
|
Systematically increase impact across these dimensions:
|
||||||
|
|
||||||
|
### Typography Amplification
|
||||||
|
- **Replace generic fonts**: Swap system fonts for distinctive choices (see frontend-design skill for inspiration)
|
||||||
|
- **Extreme scale**: Create dramatic size jumps (3x-5x differences, not 1.5x)
|
||||||
|
- **Weight contrast**: Pair 900 weights with 200 weights, not 600 with 400
|
||||||
|
- **Unexpected choices**: Variable fonts, display fonts for headlines, condensed/extended widths, monospace as intentional accent (not as lazy "dev tool" default)
|
||||||
|
|
||||||
|
### Color Intensification
|
||||||
|
- **Increase saturation**: Shift to more vibrant, energetic colors (but not neon)
|
||||||
|
- **Bold palette**: Introduce unexpected color combinations—avoid the purple-blue gradient AI slop
|
||||||
|
- **Dominant color strategy**: Let one bold color own 60% of the design
|
||||||
|
- **Sharp accents**: High-contrast accent colors that pop
|
||||||
|
- **Tinted neutrals**: Replace pure grays with tinted grays that harmonize with your palette
|
||||||
|
- **Rich gradients**: Intentional multi-stop gradients (not generic purple-to-blue)
|
||||||
|
|
||||||
|
### Spatial Drama
|
||||||
|
- **Extreme scale jumps**: Make important elements 3-5x larger than surroundings
|
||||||
|
- **Break the grid**: Let hero elements escape containers and cross boundaries
|
||||||
|
- **Asymmetric layouts**: Replace centered, balanced layouts with tension-filled asymmetry
|
||||||
|
- **Generous space**: Use white space dramatically (100-200px gaps, not 20-40px)
|
||||||
|
- **Overlap**: Layer elements intentionally for depth
|
||||||
|
|
||||||
|
### Visual Effects
|
||||||
|
- **Dramatic shadows**: Large, soft shadows for elevation (but not generic drop shadows on rounded rectangles)
|
||||||
|
- **Background treatments**: Mesh patterns, noise textures, geometric patterns, intentional gradients (not purple-to-blue)
|
||||||
|
- **Texture & depth**: Grain, halftone, duotone, layered elements—NOT glassmorphism (it's overused AI slop)
|
||||||
|
- **Borders & frames**: Thick borders, decorative frames, custom shapes (not rounded rectangles with colored border on one side)
|
||||||
|
- **Custom elements**: Illustrative elements, custom icons, decorative details that reinforce brand
|
||||||
|
|
||||||
|
### Motion & Animation
|
||||||
|
- **Entrance choreography**: Staggered, dramatic page load animations with 50-100ms delays
|
||||||
|
- **Scroll effects**: Parallax, reveal animations, scroll-triggered sequences
|
||||||
|
- **Micro-interactions**: Satisfying hover effects, click feedback, state changes
|
||||||
|
- **Transitions**: Smooth, noticeable transitions using ease-out-quart/quint/expo (not bounce or elastic—they cheapen the effect)
|
||||||
|
|
||||||
|
### Composition Boldness
|
||||||
|
- **Hero moments**: Create clear focal points with dramatic treatment
|
||||||
|
- **Diagonal flows**: Escape horizontal/vertical rigidity with diagonal arrangements
|
||||||
|
- **Full-bleed elements**: Use full viewport width/height for impact
|
||||||
|
- **Unexpected proportions**: Golden ratio? Throw it out. Try 70/30, 80/20 splits
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Add effects randomly without purpose (chaos ≠ bold)
|
||||||
|
- Sacrifice readability for aesthetics (body text must be readable)
|
||||||
|
- Make everything bold (then nothing is bold - need contrast)
|
||||||
|
- Ignore accessibility (bold design must still meet WCAG standards)
|
||||||
|
- Overwhelm with motion (animation fatigue is real)
|
||||||
|
- Copy trendy aesthetics blindly (bold means distinctive, not derivative)
|
||||||
|
|
||||||
|
## Verify Quality
|
||||||
|
|
||||||
|
Ensure amplification maintains usability and coherence:
|
||||||
|
|
||||||
|
- **NOT AI slop**: Does this look like every other AI-generated "bold" design? If yes, start over.
|
||||||
|
- **Still functional**: Can users accomplish tasks without distraction?
|
||||||
|
- **Coherent**: Does everything feel intentional and unified?
|
||||||
|
- **Memorable**: Will users remember this experience?
|
||||||
|
- **Performant**: Do all these effects run smoothly?
|
||||||
|
- **Accessible**: Does it still meet accessibility standards?
|
||||||
|
|
||||||
|
**The test**: If you showed this to someone and said "AI made this bolder," would they believe you immediately? If yes, you've failed. Bold means distinctive, not "more AI effects."
|
||||||
|
|
||||||
|
Remember: Bold design is confident design. It takes risks, makes statements, and creates memorable experiences. But bold without strategy is just loud. Be intentional, be dramatic, be unforgettable.
|
||||||
180
.pi/agent/skills/frontend/clarify/SKILL.md
Normal file
180
.pi/agent/skills/frontend/clarify/SKILL.md
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
---
|
||||||
|
name: clarify
|
||||||
|
description: Improve unclear UX copy, error messages, microcopy, labels, and instructions to make interfaces easier to understand. Use when the user mentions confusing text, unclear labels, bad error messages, hard-to-follow instructions, or wanting better UX writing.
|
||||||
|
---
|
||||||
|
|
||||||
|
Identify and improve unclear, confusing, or poorly written interface text to make the product easier to understand and use.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: audience technical level and users' mental state in context.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current Copy
|
||||||
|
|
||||||
|
Identify what makes the text unclear or ineffective:
|
||||||
|
|
||||||
|
1. **Find clarity problems**:
|
||||||
|
- **Jargon**: Technical terms users won't understand
|
||||||
|
- **Ambiguity**: Multiple interpretations possible
|
||||||
|
- **Passive voice**: "Your file has been uploaded" vs "We uploaded your file"
|
||||||
|
- **Length**: Too wordy or too terse
|
||||||
|
- **Assumptions**: Assuming user knowledge they don't have
|
||||||
|
- **Missing context**: Users don't know what to do or why
|
||||||
|
- **Tone mismatch**: Too formal, too casual, or inappropriate for situation
|
||||||
|
|
||||||
|
2. **Understand the context**:
|
||||||
|
- Who's the audience? (Technical? General? First-time users?)
|
||||||
|
- What's the user's mental state? (Stressed during error? Confident during success?)
|
||||||
|
- What's the action? (What do we want users to do?)
|
||||||
|
- What's the constraint? (Character limits? Space limitations?)
|
||||||
|
|
||||||
|
**CRITICAL**: Clear copy helps users succeed. Unclear copy creates frustration, errors, and support tickets.
|
||||||
|
|
||||||
|
## Plan Copy Improvements
|
||||||
|
|
||||||
|
Create a strategy for clearer communication:
|
||||||
|
|
||||||
|
- **Primary message**: What's the ONE thing users need to know?
|
||||||
|
- **Action needed**: What should users do next (if anything)?
|
||||||
|
- **Tone**: How should this feel? (Helpful? Apologetic? Encouraging?)
|
||||||
|
- **Constraints**: Length limits, brand voice, localization considerations
|
||||||
|
|
||||||
|
**IMPORTANT**: Good UX writing is invisible. Users should understand immediately without noticing the words.
|
||||||
|
|
||||||
|
## Improve Copy Systematically
|
||||||
|
|
||||||
|
Refine text across these common areas:
|
||||||
|
|
||||||
|
### Error Messages
|
||||||
|
**Bad**: "Error 403: Forbidden"
|
||||||
|
**Good**: "You don't have permission to view this page. Contact your admin for access."
|
||||||
|
|
||||||
|
**Bad**: "Invalid input"
|
||||||
|
**Good**: "Email addresses need an @ symbol. Try: name@example.com"
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Explain what went wrong in plain language
|
||||||
|
- Suggest how to fix it
|
||||||
|
- Don't blame the user
|
||||||
|
- Include examples when helpful
|
||||||
|
- Link to help/support if applicable
|
||||||
|
|
||||||
|
### Form Labels & Instructions
|
||||||
|
**Bad**: "DOB (MM/DD/YYYY)"
|
||||||
|
**Good**: "Date of birth" (with placeholder showing format)
|
||||||
|
|
||||||
|
**Bad**: "Enter value here"
|
||||||
|
**Good**: "Your email address" or "Company name"
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Use clear, specific labels (not generic placeholders)
|
||||||
|
- Show format expectations with examples
|
||||||
|
- Explain why you're asking (when not obvious)
|
||||||
|
- Put instructions before the field, not after
|
||||||
|
- Keep required field indicators clear
|
||||||
|
|
||||||
|
### Button & CTA Text
|
||||||
|
**Bad**: "Click here" | "Submit" | "OK"
|
||||||
|
**Good**: "Create account" | "Save changes" | "Got it, thanks"
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Describe the action specifically
|
||||||
|
- Use active voice (verb + noun)
|
||||||
|
- Match user's mental model
|
||||||
|
- Be specific ("Save" is better than "OK")
|
||||||
|
|
||||||
|
### Help Text & Tooltips
|
||||||
|
**Bad**: "This is the username field"
|
||||||
|
**Good**: "Choose a username. You can change this later in Settings."
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Add value (don't just repeat the label)
|
||||||
|
- Answer the implicit question ("What is this?" or "Why do you need this?")
|
||||||
|
- Keep it brief but complete
|
||||||
|
- Link to detailed docs if needed
|
||||||
|
|
||||||
|
### Empty States
|
||||||
|
**Bad**: "No items"
|
||||||
|
**Good**: "No projects yet. Create your first project to get started."
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Explain why it's empty (if not obvious)
|
||||||
|
- Show next action clearly
|
||||||
|
- Make it welcoming, not dead-end
|
||||||
|
|
||||||
|
### Success Messages
|
||||||
|
**Bad**: "Success"
|
||||||
|
**Good**: "Settings saved! Your changes will take effect immediately."
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Confirm what happened
|
||||||
|
- Explain what happens next (if relevant)
|
||||||
|
- Be brief but complete
|
||||||
|
- Match the user's emotional moment (celebrate big wins)
|
||||||
|
|
||||||
|
### Loading States
|
||||||
|
**Bad**: "Loading..." (for 30+ seconds)
|
||||||
|
**Good**: "Analyzing your data... this usually takes 30-60 seconds"
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Set expectations (how long?)
|
||||||
|
- Explain what's happening (when it's not obvious)
|
||||||
|
- Show progress when possible
|
||||||
|
- Offer escape hatch if appropriate ("Cancel")
|
||||||
|
|
||||||
|
### Confirmation Dialogs
|
||||||
|
**Bad**: "Are you sure?"
|
||||||
|
**Good**: "Delete 'Project Alpha'? This can't be undone."
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- State the specific action
|
||||||
|
- Explain consequences (especially for destructive actions)
|
||||||
|
- Use clear button labels ("Delete project" not "Yes")
|
||||||
|
- Don't overuse confirmations (only for risky actions)
|
||||||
|
|
||||||
|
### Navigation & Wayfinding
|
||||||
|
**Bad**: Generic labels like "Items" | "Things" | "Stuff"
|
||||||
|
**Good**: Specific labels like "Your projects" | "Team members" | "Settings"
|
||||||
|
|
||||||
|
**Principles**:
|
||||||
|
- Be specific and descriptive
|
||||||
|
- Use language users understand (not internal jargon)
|
||||||
|
- Make hierarchy clear
|
||||||
|
- Consider information scent (breadcrumbs, current location)
|
||||||
|
|
||||||
|
## Apply Clarity Principles
|
||||||
|
|
||||||
|
Every piece of copy should follow these rules:
|
||||||
|
|
||||||
|
1. **Be specific**: "Enter email" not "Enter value"
|
||||||
|
2. **Be concise**: Cut unnecessary words (but don't sacrifice clarity)
|
||||||
|
3. **Be active**: "Save changes" not "Changes will be saved"
|
||||||
|
4. **Be human**: "Oops, something went wrong" not "System error encountered"
|
||||||
|
5. **Be helpful**: Tell users what to do, not just what happened
|
||||||
|
6. **Be consistent**: Use same terms throughout (don't vary for variety)
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Use jargon without explanation
|
||||||
|
- Blame users ("You made an error" → "This field is required")
|
||||||
|
- Be vague ("Something went wrong" without explanation)
|
||||||
|
- Use passive voice unnecessarily
|
||||||
|
- Write overly long explanations (be concise)
|
||||||
|
- Use humor for errors (be empathetic instead)
|
||||||
|
- Assume technical knowledge
|
||||||
|
- Vary terminology (pick one term and stick with it)
|
||||||
|
- Repeat information (headers restating intros, redundant explanations)
|
||||||
|
- Use placeholders as the only labels (they disappear when users type)
|
||||||
|
|
||||||
|
## Verify Improvements
|
||||||
|
|
||||||
|
Test that copy improvements work:
|
||||||
|
|
||||||
|
- **Comprehension**: Can users understand without context?
|
||||||
|
- **Actionability**: Do users know what to do next?
|
||||||
|
- **Brevity**: Is it as short as possible while remaining clear?
|
||||||
|
- **Consistency**: Does it match terminology elsewhere?
|
||||||
|
- **Tone**: Is it appropriate for the situation?
|
||||||
|
|
||||||
|
Remember: You're a clarity expert with excellent communication skills. Write like you're explaining to a smart friend who's unfamiliar with the product. Be clear, be helpful, be human.
|
||||||
140
.pi/agent/skills/frontend/colorize/SKILL.md
Normal file
140
.pi/agent/skills/frontend/colorize/SKILL.md
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
---
|
||||||
|
name: colorize
|
||||||
|
description: Add strategic color to features that are too monochromatic or lack visual interest, making interfaces more engaging and expressive. Use when the user mentions the design looking gray, dull, lacking warmth, needing more color, or wanting a more vibrant or expressive palette.
|
||||||
|
---
|
||||||
|
|
||||||
|
Strategically introduce color to designs that are too monochromatic, gray, or lacking in visual warmth and personality.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: existing brand colors.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Color Opportunity
|
||||||
|
|
||||||
|
Analyze the current state and identify opportunities:
|
||||||
|
|
||||||
|
1. **Understand current state**:
|
||||||
|
- **Color absence**: Pure grayscale? Limited neutrals? One timid accent?
|
||||||
|
- **Missed opportunities**: Where could color add meaning, hierarchy, or delight?
|
||||||
|
- **Context**: What's appropriate for this domain and audience?
|
||||||
|
- **Brand**: Are there existing brand colors we should use?
|
||||||
|
|
||||||
|
2. **Identify where color adds value**:
|
||||||
|
- **Semantic meaning**: Success (green), error (red), warning (yellow/orange), info (blue)
|
||||||
|
- **Hierarchy**: Drawing attention to important elements
|
||||||
|
- **Categorization**: Different sections, types, or states
|
||||||
|
- **Emotional tone**: Warmth, energy, trust, creativity
|
||||||
|
- **Wayfinding**: Helping users navigate and understand structure
|
||||||
|
- **Delight**: Moments of visual interest and personality
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: More color ≠ better. Strategic color beats rainbow vomit every time. Every color should have a purpose.
|
||||||
|
|
||||||
|
## Plan Color Strategy
|
||||||
|
|
||||||
|
Create a purposeful color introduction plan:
|
||||||
|
|
||||||
|
- **Color palette**: What colors match the brand/context? (Choose 2-4 colors max beyond neutrals)
|
||||||
|
- **Dominant color**: Which color owns 60% of colored elements?
|
||||||
|
- **Accent colors**: Which colors provide contrast and highlights? (30% and 10%)
|
||||||
|
- **Application strategy**: Where does each color appear and why?
|
||||||
|
|
||||||
|
**IMPORTANT**: Color should enhance hierarchy and meaning, not create chaos. Less is more when it matters more.
|
||||||
|
|
||||||
|
## Introduce Color Strategically
|
||||||
|
|
||||||
|
Add color systematically across these dimensions:
|
||||||
|
|
||||||
|
### Semantic Color
|
||||||
|
- **State indicators**:
|
||||||
|
- Success: Green tones (emerald, forest, mint)
|
||||||
|
- Error: Red/pink tones (rose, crimson, coral)
|
||||||
|
- Warning: Orange/amber tones
|
||||||
|
- Info: Blue tones (sky, ocean, indigo)
|
||||||
|
- Neutral: Gray/slate for inactive states
|
||||||
|
|
||||||
|
- **Status badges**: Colored backgrounds or borders for states (active, pending, completed, etc.)
|
||||||
|
- **Progress indicators**: Colored bars, rings, or charts showing completion or health
|
||||||
|
|
||||||
|
### Accent Color Application
|
||||||
|
- **Primary actions**: Color the most important buttons/CTAs
|
||||||
|
- **Links**: Add color to clickable text (maintain accessibility)
|
||||||
|
- **Icons**: Colorize key icons for recognition and personality
|
||||||
|
- **Headers/titles**: Add color to section headers or key labels
|
||||||
|
- **Hover states**: Introduce color on interaction
|
||||||
|
|
||||||
|
### Background & Surfaces
|
||||||
|
- **Tinted backgrounds**: Replace pure gray (`#f5f5f5`) with warm neutrals (`oklch(97% 0.01 60)`) or cool tints (`oklch(97% 0.01 250)`)
|
||||||
|
- **Colored sections**: Use subtle background colors to separate areas
|
||||||
|
- **Gradient backgrounds**: Add depth with subtle, intentional gradients (not generic purple-blue)
|
||||||
|
- **Cards & surfaces**: Tint cards or surfaces slightly for warmth
|
||||||
|
|
||||||
|
**Use OKLCH for color**: It's perceptually uniform, meaning equal steps in lightness *look* equal. Great for generating harmonious scales.
|
||||||
|
|
||||||
|
### Data Visualization
|
||||||
|
- **Charts & graphs**: Use color to encode categories or values
|
||||||
|
- **Heatmaps**: Color intensity shows density or importance
|
||||||
|
- **Comparison**: Color coding for different datasets or timeframes
|
||||||
|
|
||||||
|
### Borders & Accents
|
||||||
|
- **Accent borders**: Add colored left/top borders to cards or sections
|
||||||
|
- **Underlines**: Color underlines for emphasis or active states
|
||||||
|
- **Dividers**: Subtle colored dividers instead of gray lines
|
||||||
|
- **Focus rings**: Colored focus indicators matching brand
|
||||||
|
|
||||||
|
### Typography Color
|
||||||
|
- **Colored headings**: Use brand colors for section headings (maintain contrast)
|
||||||
|
- **Highlight text**: Color for emphasis or categories
|
||||||
|
- **Labels & tags**: Small colored labels for metadata or categories
|
||||||
|
|
||||||
|
### Decorative Elements
|
||||||
|
- **Illustrations**: Add colored illustrations or icons
|
||||||
|
- **Shapes**: Geometric shapes in brand colors as background elements
|
||||||
|
- **Gradients**: Colorful gradient overlays or mesh backgrounds
|
||||||
|
- **Blobs/organic shapes**: Soft colored shapes for visual interest
|
||||||
|
|
||||||
|
## Balance & Refinement
|
||||||
|
|
||||||
|
Ensure color addition improves rather than overwhelms:
|
||||||
|
|
||||||
|
### Maintain Hierarchy
|
||||||
|
- **Dominant color** (60%): Primary brand color or most used accent
|
||||||
|
- **Secondary color** (30%): Supporting color for variety
|
||||||
|
- **Accent color** (10%): High contrast for key moments
|
||||||
|
- **Neutrals** (remaining): Gray/black/white for structure
|
||||||
|
|
||||||
|
### Accessibility
|
||||||
|
- **Contrast ratios**: Ensure WCAG compliance (4.5:1 for text, 3:1 for UI components)
|
||||||
|
- **Don't rely on color alone**: Use icons, labels, or patterns alongside color
|
||||||
|
- **Test for color blindness**: Verify red/green combinations work for all users
|
||||||
|
|
||||||
|
### Cohesion
|
||||||
|
- **Consistent palette**: Use colors from defined palette, not arbitrary choices
|
||||||
|
- **Systematic application**: Same color meanings throughout (green always = success)
|
||||||
|
- **Temperature consistency**: Warm palette stays warm, cool stays cool
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Use every color in the rainbow (choose 2-4 colors beyond neutrals)
|
||||||
|
- Apply color randomly without semantic meaning
|
||||||
|
- Put gray text on colored backgrounds—it looks washed out; use a darker shade of the background color or transparency instead
|
||||||
|
- Use pure gray for neutrals—add subtle color tint (warm or cool) for sophistication
|
||||||
|
- Use pure black (`#000`) or pure white (`#fff`) for large areas
|
||||||
|
- Violate WCAG contrast requirements
|
||||||
|
- Use color as the only indicator (accessibility issue)
|
||||||
|
- Make everything colorful (defeats the purpose)
|
||||||
|
- Default to purple-blue gradients (AI slop aesthetic)
|
||||||
|
|
||||||
|
## Verify Color Addition
|
||||||
|
|
||||||
|
Test that colorization improves the experience:
|
||||||
|
|
||||||
|
- **Better hierarchy**: Does color guide attention appropriately?
|
||||||
|
- **Clearer meaning**: Does color help users understand states/categories?
|
||||||
|
- **More engaging**: Does the interface feel warmer and more inviting?
|
||||||
|
- **Still accessible**: Do all color combinations meet WCAG standards?
|
||||||
|
- **Not overwhelming**: Is color balanced and purposeful?
|
||||||
|
|
||||||
|
Remember: Color is emotional and powerful. Use it to create warmth, guide attention, communicate meaning, and express personality. But restraint and strategy matter more than saturation and variety. Be colorful, but be intentional.
|
||||||
199
.pi/agent/skills/frontend/critique/SKILL.md
Normal file
199
.pi/agent/skills/frontend/critique/SKILL.md
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
---
|
||||||
|
name: critique
|
||||||
|
description: Evaluate design from a UX perspective, assessing visual hierarchy, information architecture, emotional resonance, cognitive load, and overall quality with quantitative scoring, persona-based testing, and actionable feedback. Use when the user asks to review, critique, evaluate, or give feedback on a design or component.
|
||||||
|
---
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: what the interface is trying to accomplish.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Conduct a holistic design critique, evaluating whether the interface actually works — not just technically, but as a designed experience. Think like a design director giving feedback.
|
||||||
|
|
||||||
|
## Phase 1: Design Critique
|
||||||
|
|
||||||
|
Evaluate the interface across these dimensions:
|
||||||
|
|
||||||
|
### 1. AI Slop Detection (CRITICAL)
|
||||||
|
|
||||||
|
**This is the most important check.** Does this look like every other AI-generated interface from 2024-2025?
|
||||||
|
|
||||||
|
Review the design against ALL the **DON'T** guidelines in the frontend-design skill — they are the fingerprints of AI-generated work. Check for the AI color palette, gradient text, dark mode with glowing accents, glassmorphism, hero metric layouts, identical card grids, generic fonts, and all other tells.
|
||||||
|
|
||||||
|
**The test**: If you showed this to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
|
||||||
|
|
||||||
|
### 2. Visual Hierarchy
|
||||||
|
- Does the eye flow to the most important element first?
|
||||||
|
- Is there a clear primary action? Can you spot it in 2 seconds?
|
||||||
|
- Do size, color, and position communicate importance correctly?
|
||||||
|
- Is there visual competition between elements that should have different weights?
|
||||||
|
|
||||||
|
### 3. Information Architecture & Cognitive Load
|
||||||
|
> *Consult [cognitive-load](reference/cognitive-load.md) for the working memory rule and 8-item checklist*
|
||||||
|
- Is the structure intuitive? Would a new user understand the organization?
|
||||||
|
- Is related content grouped logically?
|
||||||
|
- Are there too many choices at once? Count visible options at each decision point — if >4, flag it
|
||||||
|
- Is the navigation clear and predictable?
|
||||||
|
- **Progressive disclosure**: Is complexity revealed only when needed, or dumped on the user upfront?
|
||||||
|
- **Run the 8-item cognitive load checklist** from the reference. Report failure count: 0–1 = low (good), 2–3 = moderate, 4+ = critical.
|
||||||
|
|
||||||
|
### 4. Emotional Journey
|
||||||
|
- What emotion does this interface evoke? Is that intentional?
|
||||||
|
- Does it match the brand personality?
|
||||||
|
- Does it feel trustworthy, approachable, premium, playful — whatever it should feel?
|
||||||
|
- Would the target user feel "this is for me"?
|
||||||
|
- **Peak-end rule**: Is the most intense moment positive? Does the experience end well (confirmation, celebration, clear next step)?
|
||||||
|
- **Emotional valleys**: Check for onboarding frustration, error cliffs, feature discovery gaps, or anxiety spikes at high-stakes moments (payment, delete, commit)
|
||||||
|
- **Interventions at negative moments**: Are there design interventions where users are likely to feel frustrated or anxious? (progress indicators, reassurance copy, undo options, social proof)
|
||||||
|
|
||||||
|
### 5. Discoverability & Affordance
|
||||||
|
- Are interactive elements obviously interactive?
|
||||||
|
- Would a user know what to do without instructions?
|
||||||
|
- Are hover/focus states providing useful feedback?
|
||||||
|
- Are there hidden features that should be more visible?
|
||||||
|
|
||||||
|
### 6. Composition & Balance
|
||||||
|
- Does the layout feel balanced or uncomfortably weighted?
|
||||||
|
- Is whitespace used intentionally or just leftover?
|
||||||
|
- Is there visual rhythm in spacing and repetition?
|
||||||
|
- Does asymmetry feel designed or accidental?
|
||||||
|
|
||||||
|
### 7. Typography as Communication
|
||||||
|
- Does the type hierarchy clearly signal what to read first, second, third?
|
||||||
|
- Is body text comfortable to read? (line length, spacing, size)
|
||||||
|
- Do font choices reinforce the brand/tone?
|
||||||
|
- Is there enough contrast between heading levels?
|
||||||
|
|
||||||
|
### 8. Color with Purpose
|
||||||
|
- Is color used to communicate, not just decorate?
|
||||||
|
- Does the palette feel cohesive?
|
||||||
|
- Are accent colors drawing attention to the right things?
|
||||||
|
- Does it work for colorblind users? (not just technically — does meaning still come through?)
|
||||||
|
|
||||||
|
### 9. States & Edge Cases
|
||||||
|
- Empty states: Do they guide users toward action, or just say "nothing here"?
|
||||||
|
- Loading states: Do they reduce perceived wait time?
|
||||||
|
- Error states: Are they helpful and non-blaming?
|
||||||
|
- Success states: Do they confirm and guide next steps?
|
||||||
|
|
||||||
|
### 10. Microcopy & Voice
|
||||||
|
- Is the writing clear and concise?
|
||||||
|
- Does it sound like a human (the right human for this brand)?
|
||||||
|
- Are labels and buttons unambiguous?
|
||||||
|
- Does error copy help users fix the problem?
|
||||||
|
|
||||||
|
## Phase 2: Present Findings
|
||||||
|
|
||||||
|
Structure your feedback as a design director would:
|
||||||
|
|
||||||
|
### Design Health Score
|
||||||
|
> *Consult [heuristics-scoring](reference/heuristics-scoring.md)*
|
||||||
|
|
||||||
|
Score each of Nielsen's 10 heuristics 0–4. Present as a table:
|
||||||
|
|
||||||
|
| # | Heuristic | Score | Key Issue |
|
||||||
|
|---|-----------|-------|-----------|
|
||||||
|
| 1 | Visibility of System Status | ? | [specific finding or "—" if solid] |
|
||||||
|
| 2 | Match System / Real World | ? | |
|
||||||
|
| 3 | User Control and Freedom | ? | |
|
||||||
|
| 4 | Consistency and Standards | ? | |
|
||||||
|
| 5 | Error Prevention | ? | |
|
||||||
|
| 6 | Recognition Rather Than Recall | ? | |
|
||||||
|
| 7 | Flexibility and Efficiency | ? | |
|
||||||
|
| 8 | Aesthetic and Minimalist Design | ? | |
|
||||||
|
| 9 | Error Recovery | ? | |
|
||||||
|
| 10 | Help and Documentation | ? | |
|
||||||
|
| **Total** | | **??/40** | **[Rating band]** |
|
||||||
|
|
||||||
|
Be honest with scores. A 4 means genuinely excellent. Most real interfaces score 20–32.
|
||||||
|
|
||||||
|
### Anti-Patterns Verdict
|
||||||
|
**Start here.** Pass/fail: Does this look AI-generated? List specific tells from the skill's Anti-Patterns section. Be brutally honest.
|
||||||
|
|
||||||
|
### Overall Impression
|
||||||
|
A brief gut reaction — what works, what doesn't, and the single biggest opportunity.
|
||||||
|
|
||||||
|
### What's Working
|
||||||
|
Highlight 2–3 things done well. Be specific about why they work.
|
||||||
|
|
||||||
|
### Priority Issues
|
||||||
|
The 3–5 most impactful design problems, ordered by importance.
|
||||||
|
|
||||||
|
For each issue, tag with **P0–P3 severity** (consult [heuristics-scoring](reference/heuristics-scoring.md) for severity definitions):
|
||||||
|
- **[P?] What**: Name the problem clearly
|
||||||
|
- **Why it matters**: How this hurts users or undermines goals
|
||||||
|
- **Fix**: What to do about it (be concrete)
|
||||||
|
- **Suggested command**: Which command could address this (from: /animate, /quieter, /optimize, /adapt, /clarify, /distill, /delight, /onboard, /normalize, /audit, /harden, /polish, /extract, /bolder, /arrange, /typeset, /critique, /colorize, /overdrive)
|
||||||
|
|
||||||
|
### Persona Red Flags
|
||||||
|
> *Consult [personas](reference/personas.md)*
|
||||||
|
|
||||||
|
Auto-select 2–3 personas most relevant to this interface type (use the selection table in the reference). If `AGENTS.md` contains a `## Design Context` section from `teach-impeccable`, also generate 1–2 project-specific personas from the audience/brand info.
|
||||||
|
|
||||||
|
For each selected persona, walk through the primary user action and list specific red flags found:
|
||||||
|
|
||||||
|
**Alex (Power User)**: No keyboard shortcuts detected. Form requires 8 clicks for primary action. Forced modal onboarding. ⚠️ High abandonment risk.
|
||||||
|
|
||||||
|
**Jordan (First-Timer)**: Icon-only nav in sidebar. Technical jargon in error messages ("404 Not Found"). No visible help. ⚠️ Will abandon at step 2.
|
||||||
|
|
||||||
|
Be specific — name the exact elements and interactions that fail each persona. Don't write generic persona descriptions; write what broke for them.
|
||||||
|
|
||||||
|
### Minor Observations
|
||||||
|
Quick notes on smaller issues worth addressing.
|
||||||
|
|
||||||
|
**Remember**:
|
||||||
|
- Be direct — vague feedback wastes everyone's time
|
||||||
|
- Be specific — "the submit button" not "some elements"
|
||||||
|
- Say what's wrong AND why it matters to users
|
||||||
|
- Give concrete suggestions, not just "consider exploring..."
|
||||||
|
- Prioritize ruthlessly — if everything is important, nothing is
|
||||||
|
- Don't soften criticism — developers need honest feedback to ship great design
|
||||||
|
|
||||||
|
## Phase 3: Ask the User
|
||||||
|
|
||||||
|
**After presenting findings**, use targeted questions based on what was actually found. ask the user directly to clarify what you cannot infer. These answers will shape the action plan.
|
||||||
|
|
||||||
|
Ask questions along these lines (adapt to the specific findings — do NOT ask generic questions):
|
||||||
|
|
||||||
|
1. **Priority direction**: Based on the issues found, ask which category matters most to the user right now. For example: "I found problems with visual hierarchy, color usage, and information overload. Which area should we tackle first?" Offer the top 2–3 issue categories as options.
|
||||||
|
|
||||||
|
2. **Design intent**: If the critique found a tonal mismatch, ask whether it was intentional. For example: "The interface feels clinical and corporate. Is that the intended tone, or should it feel warmer/bolder/more playful?" Offer 2–3 tonal directions as options based on what would fix the issues found.
|
||||||
|
|
||||||
|
3. **Scope**: Ask how much the user wants to take on. For example: "I found N issues. Want to address everything, or focus on the top 3?" Offer scope options like "Top 3 only", "All issues", "Critical issues only".
|
||||||
|
|
||||||
|
4. **Constraints** (optional — only ask if relevant): If the findings touch many areas, ask if anything is off-limits. For example: "Should any sections stay as-is?" This prevents the plan from touching things the user considers done.
|
||||||
|
|
||||||
|
**Rules for questions**:
|
||||||
|
- Every question must reference specific findings from Phase 2 — never ask generic "who is your audience?" questions
|
||||||
|
- Keep it to 2–4 questions maximum — respect the user's time
|
||||||
|
- Offer concrete options, not open-ended prompts
|
||||||
|
- If findings are straightforward (e.g., only 1–2 clear issues), skip questions and go directly to Phase 4
|
||||||
|
|
||||||
|
## Phase 4: Recommended Actions
|
||||||
|
|
||||||
|
**After receiving the user's answers**, present a prioritized action summary reflecting the user's priorities and scope from Phase 3.
|
||||||
|
|
||||||
|
### Action Summary
|
||||||
|
|
||||||
|
List recommended commands in priority order, based on the user's answers:
|
||||||
|
|
||||||
|
1. **`/command-name`** — Brief description of what to fix (specific context from critique findings)
|
||||||
|
2. **`/command-name`** — Brief description (specific context)
|
||||||
|
...
|
||||||
|
|
||||||
|
**Rules for recommendations**:
|
||||||
|
- Only recommend commands from: /animate, /quieter, /optimize, /adapt, /clarify, /distill, /delight, /onboard, /normalize, /audit, /harden, /polish, /extract, /bolder, /arrange, /typeset, /critique, /colorize, /overdrive
|
||||||
|
- Order by the user's stated priorities first, then by impact
|
||||||
|
- Each item's description should carry enough context that the command knows what to focus on
|
||||||
|
- Map each Priority Issue to the appropriate command
|
||||||
|
- Skip commands that would address zero issues
|
||||||
|
- If the user chose a limited scope, only include items within that scope
|
||||||
|
- If the user marked areas as off-limits, exclude commands that would touch those areas
|
||||||
|
- End with `/polish` as the final step if any fixes were recommended
|
||||||
|
|
||||||
|
After presenting the summary, tell the user:
|
||||||
|
|
||||||
|
> You can ask me to run these one at a time, all at once, or in any order you prefer.
|
||||||
|
>
|
||||||
|
> Re-run `/critique` after fixes to see your score improve.
|
||||||
106
.pi/agent/skills/frontend/critique/reference/cognitive-load.md
Normal file
106
.pi/agent/skills/frontend/critique/reference/cognitive-load.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Cognitive Load Assessment
|
||||||
|
|
||||||
|
Cognitive load is the total mental effort required to use an interface. Overloaded users make mistakes, get frustrated, and leave. This reference helps identify and fix cognitive overload.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Three Types of Cognitive Load
|
||||||
|
|
||||||
|
### Intrinsic Load — The Task Itself
|
||||||
|
Complexity inherent to what the user is trying to do. You can't eliminate this, but you can structure it.
|
||||||
|
|
||||||
|
**Manage it by**:
|
||||||
|
- Breaking complex tasks into discrete steps
|
||||||
|
- Providing scaffolding (templates, defaults, examples)
|
||||||
|
- Progressive disclosure — show what's needed now, hide the rest
|
||||||
|
- Grouping related decisions together
|
||||||
|
|
||||||
|
### Extraneous Load — Bad Design
|
||||||
|
Mental effort caused by poor design choices. **Eliminate this ruthlessly** — it's pure waste.
|
||||||
|
|
||||||
|
**Common sources**:
|
||||||
|
- Confusing navigation that requires mental mapping
|
||||||
|
- Unclear labels that force users to guess meaning
|
||||||
|
- Visual clutter competing for attention
|
||||||
|
- Inconsistent patterns that prevent learning
|
||||||
|
- Unnecessary steps between user intent and result
|
||||||
|
|
||||||
|
### Germane Load — Learning Effort
|
||||||
|
Mental effort spent building understanding. This is *good* cognitive load — it leads to mastery.
|
||||||
|
|
||||||
|
**Support it by**:
|
||||||
|
- Progressive disclosure that reveals complexity gradually
|
||||||
|
- Consistent patterns that reward learning
|
||||||
|
- Feedback that confirms correct understanding
|
||||||
|
- Onboarding that teaches through action, not walls of text
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Cognitive Load Checklist
|
||||||
|
|
||||||
|
Evaluate the interface against these 8 items:
|
||||||
|
|
||||||
|
- [ ] **Single focus**: Can the user complete their primary task without distraction from competing elements?
|
||||||
|
- [ ] **Chunking**: Is information presented in digestible groups (≤4 items per group)?
|
||||||
|
- [ ] **Grouping**: Are related items visually grouped together (proximity, borders, shared background)?
|
||||||
|
- [ ] **Visual hierarchy**: Is it immediately clear what's most important on the screen?
|
||||||
|
- [ ] **One thing at a time**: Can the user focus on a single decision before moving to the next?
|
||||||
|
- [ ] **Minimal choices**: Are decisions simplified (≤4 visible options at any decision point)?
|
||||||
|
- [ ] **Working memory**: Does the user need to remember information from a previous screen to act on the current one?
|
||||||
|
- [ ] **Progressive disclosure**: Is complexity revealed only when the user needs it?
|
||||||
|
|
||||||
|
**Scoring**: Count the failed items. 0–1 failures = low cognitive load (good). 2–3 = moderate (address soon). 4+ = high cognitive load (critical fix needed).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## The Working Memory Rule
|
||||||
|
|
||||||
|
**Humans can hold ≤4 items in working memory at once** (Miller's Law revised by Cowan, 2001).
|
||||||
|
|
||||||
|
At any decision point, count the number of distinct options, actions, or pieces of information a user must simultaneously consider:
|
||||||
|
- **≤4 items**: Within working memory limits — manageable
|
||||||
|
- **5–7 items**: Pushing the boundary — consider grouping or progressive disclosure
|
||||||
|
- **8+ items**: Overloaded — users will skip, misclick, or abandon
|
||||||
|
|
||||||
|
**Practical applications**:
|
||||||
|
- Navigation menus: ≤5 top-level items (group the rest under clear categories)
|
||||||
|
- Form sections: ≤4 fields visible per group before a visual break
|
||||||
|
- Action buttons: 1 primary, 1–2 secondary, group the rest in a menu
|
||||||
|
- Dashboard widgets: ≤4 key metrics visible without scrolling
|
||||||
|
- Pricing tiers: ≤3 options (more causes analysis paralysis)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Common Cognitive Load Violations
|
||||||
|
|
||||||
|
### 1. The Wall of Options
|
||||||
|
**Problem**: Presenting 10+ choices at once with no hierarchy.
|
||||||
|
**Fix**: Group into categories, highlight recommended, use progressive disclosure.
|
||||||
|
|
||||||
|
### 2. The Memory Bridge
|
||||||
|
**Problem**: User must remember info from step 1 to complete step 3.
|
||||||
|
**Fix**: Keep relevant context visible, or repeat it where it's needed.
|
||||||
|
|
||||||
|
### 3. The Hidden Navigation
|
||||||
|
**Problem**: User must build a mental map of where things are.
|
||||||
|
**Fix**: Always show current location (breadcrumbs, active states, progress indicators).
|
||||||
|
|
||||||
|
### 4. The Jargon Barrier
|
||||||
|
**Problem**: Technical or domain language forces translation effort.
|
||||||
|
**Fix**: Use plain language. If domain terms are unavoidable, define them inline.
|
||||||
|
|
||||||
|
### 5. The Visual Noise Floor
|
||||||
|
**Problem**: Every element has the same visual weight — nothing stands out.
|
||||||
|
**Fix**: Establish clear hierarchy: one primary element, 2–3 secondary, everything else muted.
|
||||||
|
|
||||||
|
### 6. The Inconsistent Pattern
|
||||||
|
**Problem**: Similar actions work differently in different places.
|
||||||
|
**Fix**: Standardize interaction patterns. Same type of action = same type of UI.
|
||||||
|
|
||||||
|
### 7. The Multi-Task Demand
|
||||||
|
**Problem**: Interface requires processing multiple simultaneous inputs (reading + deciding + navigating).
|
||||||
|
**Fix**: Sequence the steps. Let the user do one thing at a time.
|
||||||
|
|
||||||
|
### 8. The Context Switch
|
||||||
|
**Problem**: User must jump between screens/tabs/modals to gather info for a single decision.
|
||||||
|
**Fix**: Co-locate the information needed for each decision. Reduce back-and-forth.
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
# Heuristics Scoring Guide
|
||||||
|
|
||||||
|
Score each of Nielsen's 10 Usability Heuristics on a 0–4 scale. Be honest — a 4 means genuinely excellent, not "good enough."
|
||||||
|
|
||||||
|
## Nielsen's 10 Heuristics
|
||||||
|
|
||||||
|
### 1. Visibility of System Status
|
||||||
|
|
||||||
|
Keep users informed about what's happening through timely, appropriate feedback.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Loading indicators during async operations
|
||||||
|
- Confirmation of user actions (save, submit, delete)
|
||||||
|
- Progress indicators for multi-step processes
|
||||||
|
- Current location in navigation (breadcrumbs, active states)
|
||||||
|
- Form validation feedback (inline, not just on submit)
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | No feedback — user is guessing what happened |
|
||||||
|
| 1 | Rare feedback — most actions produce no visible response |
|
||||||
|
| 2 | Partial — some states communicated, major gaps remain |
|
||||||
|
| 3 | Good — most operations give clear feedback, minor gaps |
|
||||||
|
| 4 | Excellent — every action confirms, progress is always visible |
|
||||||
|
|
||||||
|
### 2. Match Between System and Real World
|
||||||
|
|
||||||
|
Speak the user's language. Follow real-world conventions. Information appears in natural, logical order.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Familiar terminology (no unexplained jargon)
|
||||||
|
- Logical information order matching user expectations
|
||||||
|
- Recognizable icons and metaphors
|
||||||
|
- Domain-appropriate language for the target audience
|
||||||
|
- Natural reading flow (left-to-right, top-to-bottom priority)
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Pure tech jargon, alien to users |
|
||||||
|
| 1 | Mostly confusing — requires domain expertise to navigate |
|
||||||
|
| 2 | Mixed — some plain language, some jargon leaks through |
|
||||||
|
| 3 | Mostly natural — occasional term needs context |
|
||||||
|
| 4 | Speaks the user's language fluently throughout |
|
||||||
|
|
||||||
|
### 3. User Control and Freedom
|
||||||
|
|
||||||
|
Users need a clear "emergency exit" from unwanted states without extended dialogue.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Undo/redo functionality
|
||||||
|
- Cancel buttons on forms and modals
|
||||||
|
- Clear navigation back to safety (home, previous)
|
||||||
|
- Easy way to clear filters, search, selections
|
||||||
|
- Escape from long or multi-step processes
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Users get trapped — no way out without refreshing |
|
||||||
|
| 1 | Difficult exits — must find obscure paths to escape |
|
||||||
|
| 2 | Some exits — main flows have escape, edge cases don't |
|
||||||
|
| 3 | Good control — users can exit and undo most actions |
|
||||||
|
| 4 | Full control — undo, cancel, back, and escape everywhere |
|
||||||
|
|
||||||
|
### 4. Consistency and Standards
|
||||||
|
|
||||||
|
Users shouldn't wonder whether different words, situations, or actions mean the same thing.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Consistent terminology throughout the interface
|
||||||
|
- Same actions produce same results everywhere
|
||||||
|
- Platform conventions followed (standard UI patterns)
|
||||||
|
- Visual consistency (colors, typography, spacing, components)
|
||||||
|
- Consistent interaction patterns (same gesture = same behavior)
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Inconsistent everywhere — feels like different products stitched together |
|
||||||
|
| 1 | Many inconsistencies — similar things look/behave differently |
|
||||||
|
| 2 | Partially consistent — main flows match, details diverge |
|
||||||
|
| 3 | Mostly consistent — occasional deviation, nothing confusing |
|
||||||
|
| 4 | Fully consistent — cohesive system, predictable behavior |
|
||||||
|
|
||||||
|
### 5. Error Prevention
|
||||||
|
|
||||||
|
Better than good error messages is a design that prevents problems in the first place.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Confirmation before destructive actions (delete, overwrite)
|
||||||
|
- Constraints preventing invalid input (date pickers, dropdowns)
|
||||||
|
- Smart defaults that reduce errors
|
||||||
|
- Clear labels that prevent misunderstanding
|
||||||
|
- Autosave and draft recovery
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Errors easy to make — no guardrails anywhere |
|
||||||
|
| 1 | Few safeguards — some inputs validated, most aren't |
|
||||||
|
| 2 | Partial prevention — common errors caught, edge cases slip |
|
||||||
|
| 3 | Good prevention — most error paths blocked proactively |
|
||||||
|
| 4 | Excellent — errors nearly impossible through smart constraints |
|
||||||
|
|
||||||
|
### 6. Recognition Rather Than Recall
|
||||||
|
|
||||||
|
Minimize memory load. Make objects, actions, and options visible or easily retrievable.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Visible options (not buried in hidden menus)
|
||||||
|
- Contextual help when needed (tooltips, inline hints)
|
||||||
|
- Recent items and history
|
||||||
|
- Autocomplete and suggestions
|
||||||
|
- Labels on icons (not icon-only navigation)
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Heavy memorization — users must remember paths and commands |
|
||||||
|
| 1 | Mostly recall — many hidden features, few visible cues |
|
||||||
|
| 2 | Some aids — main actions visible, secondary features hidden |
|
||||||
|
| 3 | Good recognition — most things discoverable, few memory demands |
|
||||||
|
| 4 | Everything discoverable — users never need to memorize |
|
||||||
|
|
||||||
|
### 7. Flexibility and Efficiency of Use
|
||||||
|
|
||||||
|
Accelerators — invisible to novices — speed up expert interaction.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Keyboard shortcuts for common actions
|
||||||
|
- Customizable interface elements
|
||||||
|
- Recent items and favorites
|
||||||
|
- Bulk/batch actions
|
||||||
|
- Power user features that don't complicate the basics
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | One rigid path — no shortcuts or alternatives |
|
||||||
|
| 1 | Limited flexibility — few alternatives to the main path |
|
||||||
|
| 2 | Some shortcuts — basic keyboard support, limited bulk actions |
|
||||||
|
| 3 | Good accelerators — keyboard nav, some customization |
|
||||||
|
| 4 | Highly flexible — multiple paths, power features, customizable |
|
||||||
|
|
||||||
|
### 8. Aesthetic and Minimalist Design
|
||||||
|
|
||||||
|
Interfaces should not contain irrelevant or rarely needed information. Every element should serve a purpose.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Only necessary information visible at each step
|
||||||
|
- Clear visual hierarchy directing attention
|
||||||
|
- Purposeful use of color and emphasis
|
||||||
|
- No decorative clutter competing for attention
|
||||||
|
- Focused, uncluttered layouts
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Overwhelming — everything competes for attention equally |
|
||||||
|
| 1 | Cluttered — too much noise, hard to find what matters |
|
||||||
|
| 2 | Some clutter — main content clear, periphery noisy |
|
||||||
|
| 3 | Mostly clean — focused design, minor visual noise |
|
||||||
|
| 4 | Perfectly minimal — every element earns its pixel |
|
||||||
|
|
||||||
|
### 9. Help Users Recognize, Diagnose, and Recover from Errors
|
||||||
|
|
||||||
|
Error messages should use plain language, precisely indicate the problem, and constructively suggest a solution.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Plain language error messages (no error codes for users)
|
||||||
|
- Specific problem identification ("Email is missing @" not "Invalid input")
|
||||||
|
- Actionable recovery suggestions
|
||||||
|
- Errors displayed near the source of the problem
|
||||||
|
- Non-blocking error handling (don't wipe the form)
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | Cryptic errors — codes, jargon, or no message at all |
|
||||||
|
| 1 | Vague errors — "Something went wrong" with no guidance |
|
||||||
|
| 2 | Clear but unhelpful — names the problem but not the fix |
|
||||||
|
| 3 | Clear with suggestions — identifies problem and offers next steps |
|
||||||
|
| 4 | Perfect recovery — pinpoints issue, suggests fix, preserves user work |
|
||||||
|
|
||||||
|
### 10. Help and Documentation
|
||||||
|
|
||||||
|
Even if the system is usable without docs, help should be easy to find, task-focused, and concise.
|
||||||
|
|
||||||
|
**Check for**:
|
||||||
|
- Searchable help or documentation
|
||||||
|
- Contextual help (tooltips, inline hints, guided tours)
|
||||||
|
- Task-focused organization (not feature-organized)
|
||||||
|
- Concise, scannable content
|
||||||
|
- Easy access without leaving current context
|
||||||
|
|
||||||
|
**Scoring**:
|
||||||
|
| Score | Criteria |
|
||||||
|
|-------|----------|
|
||||||
|
| 0 | No help available anywhere |
|
||||||
|
| 1 | Help exists but hard to find or irrelevant |
|
||||||
|
| 2 | Basic help — FAQ or docs exist, not contextual |
|
||||||
|
| 3 | Good documentation — searchable, mostly task-focused |
|
||||||
|
| 4 | Excellent contextual help — right info at the right moment |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Score Summary
|
||||||
|
|
||||||
|
**Total possible**: 40 points (10 heuristics × 4 max)
|
||||||
|
|
||||||
|
| Score Range | Rating | What It Means |
|
||||||
|
|-------------|--------|---------------|
|
||||||
|
| 36–40 | Excellent | Minor polish only — ship it |
|
||||||
|
| 28–35 | Good | Address weak areas, solid foundation |
|
||||||
|
| 20–27 | Acceptable | Significant improvements needed before users are happy |
|
||||||
|
| 12–19 | Poor | Major UX overhaul required — core experience broken |
|
||||||
|
| 0–11 | Critical | Redesign needed — unusable in current state |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Issue Severity (P0–P3)
|
||||||
|
|
||||||
|
Tag each individual issue found during scoring with a priority level:
|
||||||
|
|
||||||
|
| Priority | Name | Description | Action |
|
||||||
|
|----------|------|-------------|--------|
|
||||||
|
| **P0** | Blocking | Prevents task completion entirely | Fix immediately — this is a showstopper |
|
||||||
|
| **P1** | Major | Causes significant difficulty or confusion | Fix before release |
|
||||||
|
| **P2** | Minor | Annoyance, but workaround exists | Fix in next pass |
|
||||||
|
| **P3** | Polish | Nice-to-fix, no real user impact | Fix if time permits |
|
||||||
|
|
||||||
|
**Tip**: If you're unsure between two levels, ask: "Would a user contact support about this?" If yes, it's at least P1.
|
||||||
178
.pi/agent/skills/frontend/critique/reference/personas.md
Normal file
178
.pi/agent/skills/frontend/critique/reference/personas.md
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
# Persona-Based Design Testing
|
||||||
|
|
||||||
|
Test the interface through the eyes of 5 distinct user archetypes. Each persona exposes different failure modes that a single "design director" perspective would miss.
|
||||||
|
|
||||||
|
**How to use**: Select 2–3 personas most relevant to the interface being critiqued. Walk through the primary user action as each persona. Report specific red flags — not generic concerns.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Impatient Power User — "Alex"
|
||||||
|
|
||||||
|
**Profile**: Expert with similar products. Expects efficiency, hates hand-holding. Will find shortcuts or leave.
|
||||||
|
|
||||||
|
**Behaviors**:
|
||||||
|
- Skips all onboarding and instructions
|
||||||
|
- Looks for keyboard shortcuts immediately
|
||||||
|
- Tries to bulk-select, batch-edit, and automate
|
||||||
|
- Gets frustrated by required steps that feel unnecessary
|
||||||
|
- Abandons if anything feels slow or patronizing
|
||||||
|
|
||||||
|
**Test Questions**:
|
||||||
|
- Can Alex complete the core task in under 60 seconds?
|
||||||
|
- Are there keyboard shortcuts for common actions?
|
||||||
|
- Can onboarding be skipped entirely?
|
||||||
|
- Do modals have keyboard dismiss (Esc)?
|
||||||
|
- Is there a "power user" path (shortcuts, bulk actions)?
|
||||||
|
|
||||||
|
**Red Flags** (report these specifically):
|
||||||
|
- Forced tutorials or unskippable onboarding
|
||||||
|
- No keyboard navigation for primary actions
|
||||||
|
- Slow animations that can't be skipped
|
||||||
|
- One-item-at-a-time workflows where batch would be natural
|
||||||
|
- Redundant confirmation steps for low-risk actions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Confused First-Timer — "Jordan"
|
||||||
|
|
||||||
|
**Profile**: Never used this type of product. Needs guidance at every step. Will abandon rather than figure it out.
|
||||||
|
|
||||||
|
**Behaviors**:
|
||||||
|
- Reads all instructions carefully
|
||||||
|
- Hesitates before clicking anything unfamiliar
|
||||||
|
- Looks for help or support constantly
|
||||||
|
- Misunderstands jargon and abbreviations
|
||||||
|
- Takes the most literal interpretation of any label
|
||||||
|
|
||||||
|
**Test Questions**:
|
||||||
|
- Is the first action obviously clear within 5 seconds?
|
||||||
|
- Are all icons labeled with text?
|
||||||
|
- Is there contextual help at decision points?
|
||||||
|
- Does terminology assume prior knowledge?
|
||||||
|
- Is there a clear "back" or "undo" at every step?
|
||||||
|
|
||||||
|
**Red Flags** (report these specifically):
|
||||||
|
- Icon-only navigation with no labels
|
||||||
|
- Technical jargon without explanation
|
||||||
|
- No visible help option or guidance
|
||||||
|
- Ambiguous next steps after completing an action
|
||||||
|
- No confirmation that an action succeeded
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Accessibility-Dependent User — "Sam"
|
||||||
|
|
||||||
|
**Profile**: Uses screen reader (VoiceOver/NVDA), keyboard-only navigation. May have low vision, motor impairment, or cognitive differences.
|
||||||
|
|
||||||
|
**Behaviors**:
|
||||||
|
- Tabs through the interface linearly
|
||||||
|
- Relies on ARIA labels and heading structure
|
||||||
|
- Cannot see hover states or visual-only indicators
|
||||||
|
- Needs adequate color contrast (4.5:1 minimum)
|
||||||
|
- May use browser zoom up to 200%
|
||||||
|
|
||||||
|
**Test Questions**:
|
||||||
|
- Can the entire primary flow be completed keyboard-only?
|
||||||
|
- Are all interactive elements focusable with visible focus indicators?
|
||||||
|
- Do images have meaningful alt text?
|
||||||
|
- Is color contrast WCAG AA compliant (4.5:1 for text)?
|
||||||
|
- Does the screen reader announce state changes (loading, success, errors)?
|
||||||
|
|
||||||
|
**Red Flags** (report these specifically):
|
||||||
|
- Click-only interactions with no keyboard alternative
|
||||||
|
- Missing or invisible focus indicators
|
||||||
|
- Meaning conveyed by color alone (red = error, green = success)
|
||||||
|
- Unlabeled form fields or buttons
|
||||||
|
- Time-limited actions without extension option
|
||||||
|
- Custom components that break screen reader flow
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Deliberate Stress Tester — "Riley"
|
||||||
|
|
||||||
|
**Profile**: Methodical user who pushes interfaces beyond the happy path. Tests edge cases, tries unexpected inputs, and probes for gaps in the experience.
|
||||||
|
|
||||||
|
**Behaviors**:
|
||||||
|
- Tests edge cases intentionally (empty states, long strings, special characters)
|
||||||
|
- Submits forms with unexpected data (emoji, RTL text, very long values)
|
||||||
|
- Tries to break workflows by navigating backwards, refreshing mid-flow, or opening in multiple tabs
|
||||||
|
- Looks for inconsistencies between what the UI promises and what actually happens
|
||||||
|
- Documents problems methodically
|
||||||
|
|
||||||
|
**Test Questions**:
|
||||||
|
- What happens at the edges (0 items, 1000 items, very long text)?
|
||||||
|
- Do error states recover gracefully or leave the UI in a broken state?
|
||||||
|
- What happens on refresh mid-workflow? Is state preserved?
|
||||||
|
- Are there features that appear to work but produce broken results?
|
||||||
|
- How does the UI handle unexpected input (emoji, special chars, paste from Excel)?
|
||||||
|
|
||||||
|
**Red Flags** (report these specifically):
|
||||||
|
- Features that appear to work but silently fail or produce wrong results
|
||||||
|
- Error handling that exposes technical details or leaves UI in a broken state
|
||||||
|
- Empty states that show nothing useful ("No results" with no guidance)
|
||||||
|
- Workflows that lose user data on refresh or navigation
|
||||||
|
- Inconsistent behavior between similar interactions in different parts of the UI
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Distracted Mobile User — "Casey"
|
||||||
|
|
||||||
|
**Profile**: Using phone one-handed on the go. Frequently interrupted. Possibly on a slow connection.
|
||||||
|
|
||||||
|
**Behaviors**:
|
||||||
|
- Uses thumb only — prefers bottom-of-screen actions
|
||||||
|
- Gets interrupted mid-flow and returns later
|
||||||
|
- Switches between apps frequently
|
||||||
|
- Has limited attention span and low patience
|
||||||
|
- Types as little as possible, prefers taps and selections
|
||||||
|
|
||||||
|
**Test Questions**:
|
||||||
|
- Are primary actions in the thumb zone (bottom half of screen)?
|
||||||
|
- Is state preserved if the user leaves and returns?
|
||||||
|
- Does it work on slow connections (3G)?
|
||||||
|
- Can forms leverage autocomplete and smart defaults?
|
||||||
|
- Are touch targets at least 44×44pt?
|
||||||
|
|
||||||
|
**Red Flags** (report these specifically):
|
||||||
|
- Important actions positioned at the top of the screen (unreachable by thumb)
|
||||||
|
- No state persistence — progress lost on tab switch or interruption
|
||||||
|
- Large text inputs required where selection would work
|
||||||
|
- Heavy assets loading on every page (no lazy loading)
|
||||||
|
- Tiny tap targets or targets too close together
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Selecting Personas
|
||||||
|
|
||||||
|
Choose personas based on the interface type:
|
||||||
|
|
||||||
|
| Interface Type | Primary Personas | Why |
|
||||||
|
|---------------|-----------------|-----|
|
||||||
|
| Landing page / marketing | Jordan, Riley, Casey | First impressions, trust, mobile |
|
||||||
|
| Dashboard / admin | Alex, Sam | Power users, accessibility |
|
||||||
|
| E-commerce / checkout | Casey, Riley, Jordan | Mobile, edge cases, clarity |
|
||||||
|
| Onboarding flow | Jordan, Casey | Confusion, interruption |
|
||||||
|
| Data-heavy / analytics | Alex, Sam | Efficiency, keyboard nav |
|
||||||
|
| Form-heavy / wizard | Jordan, Sam, Casey | Clarity, accessibility, mobile |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Project-Specific Personas
|
||||||
|
|
||||||
|
If `AGENTS.md` contains a `## Design Context` section (generated by `teach-impeccable`), derive 1–2 additional personas from the audience and brand information:
|
||||||
|
|
||||||
|
1. Read the target audience description
|
||||||
|
2. Identify the primary user archetype not covered by the 5 predefined personas
|
||||||
|
3. Create a persona following this template:
|
||||||
|
|
||||||
|
```
|
||||||
|
### [Role] — "[Name]"
|
||||||
|
|
||||||
|
**Profile**: [2-3 key characteristics derived from Design Context]
|
||||||
|
|
||||||
|
**Behaviors**: [3-4 specific behaviors based on the described audience]
|
||||||
|
|
||||||
|
**Red Flags**: [3-4 things that would alienate this specific user type]
|
||||||
|
```
|
||||||
|
|
||||||
|
Only generate project-specific personas when real Design Context data is available. Don't invent audience details — use the 5 predefined personas when no context exists.
|
||||||
301
.pi/agent/skills/frontend/delight/SKILL.md
Normal file
301
.pi/agent/skills/frontend/delight/SKILL.md
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
---
|
||||||
|
name: delight
|
||||||
|
description: Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.
|
||||||
|
---
|
||||||
|
|
||||||
|
Identify opportunities to add moments of joy, personality, and unexpected polish that transform functional interfaces into delightful experiences.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: what's appropriate for the domain (playful vs professional vs quirky vs elegant).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Delight Opportunities
|
||||||
|
|
||||||
|
Identify where delight would enhance (not distract from) the experience:
|
||||||
|
|
||||||
|
1. **Find natural delight moments**:
|
||||||
|
- **Success states**: Completed actions (save, send, publish)
|
||||||
|
- **Empty states**: First-time experiences, onboarding
|
||||||
|
- **Loading states**: Waiting periods that could be entertaining
|
||||||
|
- **Achievements**: Milestones, streaks, completions
|
||||||
|
- **Interactions**: Hover states, clicks, drags
|
||||||
|
- **Errors**: Softening frustrating moments
|
||||||
|
- **Easter eggs**: Hidden discoveries for curious users
|
||||||
|
|
||||||
|
2. **Understand the context**:
|
||||||
|
- What's the brand personality? (Playful? Professional? Quirky? Elegant?)
|
||||||
|
- Who's the audience? (Tech-savvy? Creative? Corporate?)
|
||||||
|
- What's the emotional context? (Accomplishment? Exploration? Frustration?)
|
||||||
|
- What's appropriate? (Banking app ≠ gaming app)
|
||||||
|
|
||||||
|
3. **Define delight strategy**:
|
||||||
|
- **Subtle sophistication**: Refined micro-interactions (luxury brands)
|
||||||
|
- **Playful personality**: Whimsical illustrations and copy (consumer apps)
|
||||||
|
- **Helpful surprises**: Anticipating needs before users ask (productivity tools)
|
||||||
|
- **Sensory richness**: Satisfying sounds, smooth animations (creative tools)
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: Delight should enhance usability, never obscure it. If users notice the delight more than accomplishing their goal, you've gone too far.
|
||||||
|
|
||||||
|
## Delight Principles
|
||||||
|
|
||||||
|
Follow these guidelines:
|
||||||
|
|
||||||
|
### Delight Amplifies, Never Blocks
|
||||||
|
- Delight moments should be quick (< 1 second)
|
||||||
|
- Never delay core functionality for delight
|
||||||
|
- Make delight skippable or subtle
|
||||||
|
- Respect user's time and task focus
|
||||||
|
|
||||||
|
### Surprise and Discovery
|
||||||
|
- Hide delightful details for users to discover
|
||||||
|
- Reward exploration and curiosity
|
||||||
|
- Don't announce every delight moment
|
||||||
|
- Let users share discoveries with others
|
||||||
|
|
||||||
|
### Appropriate to Context
|
||||||
|
- Match delight to emotional moment (celebrate success, empathize with errors)
|
||||||
|
- Respect the user's state (don't be playful during critical errors)
|
||||||
|
- Match brand personality and audience expectations
|
||||||
|
- Cultural sensitivity (what's delightful varies by culture)
|
||||||
|
|
||||||
|
### Compound Over Time
|
||||||
|
- Delight should remain fresh with repeated use
|
||||||
|
- Vary responses (not same animation every time)
|
||||||
|
- Reveal deeper layers with continued use
|
||||||
|
- Build anticipation through patterns
|
||||||
|
|
||||||
|
## Delight Techniques
|
||||||
|
|
||||||
|
Add personality and joy through these methods:
|
||||||
|
|
||||||
|
### Micro-interactions & Animation
|
||||||
|
|
||||||
|
**Button delight**:
|
||||||
|
```css
|
||||||
|
/* Satisfying button press */
|
||||||
|
.button {
|
||||||
|
transition: transform 0.1s, box-shadow 0.1s;
|
||||||
|
}
|
||||||
|
.button:active {
|
||||||
|
transform: translateY(2px);
|
||||||
|
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ripple effect on click */
|
||||||
|
/* Smooth lift on hover */
|
||||||
|
.button:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Loading delight**:
|
||||||
|
- Playful loading animations (not just spinners)
|
||||||
|
- Personality in loading messages (write product-specific ones, not generic AI filler)
|
||||||
|
- Progress indication with encouraging messages
|
||||||
|
- Skeleton screens with subtle animations
|
||||||
|
|
||||||
|
**Success animations**:
|
||||||
|
- Checkmark draw animation
|
||||||
|
- Confetti burst for major achievements
|
||||||
|
- Gentle scale + fade for confirmation
|
||||||
|
- Satisfying sound effects (subtle)
|
||||||
|
|
||||||
|
**Hover surprises**:
|
||||||
|
- Icons that animate on hover
|
||||||
|
- Color shifts or glow effects
|
||||||
|
- Tooltip reveals with personality
|
||||||
|
- Cursor changes (custom cursors for branded experiences)
|
||||||
|
|
||||||
|
### Personality in Copy
|
||||||
|
|
||||||
|
**Playful error messages**:
|
||||||
|
```
|
||||||
|
"Error 404"
|
||||||
|
"This page is playing hide and seek. (And winning)"
|
||||||
|
|
||||||
|
"Connection failed"
|
||||||
|
"Looks like the internet took a coffee break. Want to retry?"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Encouraging empty states**:
|
||||||
|
```
|
||||||
|
"No projects"
|
||||||
|
"Your canvas awaits. Create something amazing."
|
||||||
|
|
||||||
|
"No messages"
|
||||||
|
"Inbox zero! You're crushing it today."
|
||||||
|
```
|
||||||
|
|
||||||
|
**Playful labels & tooltips**:
|
||||||
|
```
|
||||||
|
"Delete"
|
||||||
|
"Send to void" (for playful brand)
|
||||||
|
|
||||||
|
"Help"
|
||||||
|
"Rescue me" (tooltip)
|
||||||
|
```
|
||||||
|
|
||||||
|
**IMPORTANT**: Match copy personality to brand. Banks shouldn't be wacky, but they can be warm.
|
||||||
|
|
||||||
|
### Illustrations & Visual Personality
|
||||||
|
|
||||||
|
**Custom illustrations**:
|
||||||
|
- Empty state illustrations (not stock icons)
|
||||||
|
- Error state illustrations (friendly monsters, quirky characters)
|
||||||
|
- Loading state illustrations (animated characters)
|
||||||
|
- Success state illustrations (celebrations)
|
||||||
|
|
||||||
|
**Icon personality**:
|
||||||
|
- Custom icon set matching brand personality
|
||||||
|
- Animated icons (subtle motion on hover/click)
|
||||||
|
- Illustrative icons (more detailed than generic)
|
||||||
|
- Consistent style across all icons
|
||||||
|
|
||||||
|
**Background effects**:
|
||||||
|
- Subtle particle effects
|
||||||
|
- Gradient mesh backgrounds
|
||||||
|
- Geometric patterns
|
||||||
|
- Parallax depth
|
||||||
|
- Time-of-day themes (morning vs night)
|
||||||
|
|
||||||
|
### Satisfying Interactions
|
||||||
|
|
||||||
|
**Drag and drop delight**:
|
||||||
|
- Lift effect on drag (shadow, scale)
|
||||||
|
- Snap animation when dropped
|
||||||
|
- Satisfying placement sound
|
||||||
|
- Undo toast ("Dropped in wrong place? [Undo]")
|
||||||
|
|
||||||
|
**Toggle switches**:
|
||||||
|
- Smooth slide with spring physics
|
||||||
|
- Color transition
|
||||||
|
- Haptic feedback on mobile
|
||||||
|
- Optional sound effect
|
||||||
|
|
||||||
|
**Progress & achievements**:
|
||||||
|
- Streak counters with celebratory milestones
|
||||||
|
- Progress bars that "celebrate" at 100%
|
||||||
|
- Badge unlocks with animation
|
||||||
|
- Playful stats ("You're on fire! 5 days in a row")
|
||||||
|
|
||||||
|
**Form interactions**:
|
||||||
|
- Input fields that animate on focus
|
||||||
|
- Checkboxes with a satisfying scale pulse when checked
|
||||||
|
- Success state that celebrates valid input
|
||||||
|
- Auto-grow textareas
|
||||||
|
|
||||||
|
### Sound Design
|
||||||
|
|
||||||
|
**Subtle audio cues** (when appropriate):
|
||||||
|
- Notification sounds (distinctive but not annoying)
|
||||||
|
- Success sounds (satisfying "ding")
|
||||||
|
- Error sounds (empathetic, not harsh)
|
||||||
|
- Typing sounds for chat/messaging
|
||||||
|
- Ambient background audio (very subtle)
|
||||||
|
|
||||||
|
**IMPORTANT**:
|
||||||
|
- Respect system sound settings
|
||||||
|
- Provide mute option
|
||||||
|
- Keep volumes quiet (subtle cues, not alarms)
|
||||||
|
- Don't play on every interaction (sound fatigue is real)
|
||||||
|
|
||||||
|
### Easter Eggs & Hidden Delights
|
||||||
|
|
||||||
|
**Discovery rewards**:
|
||||||
|
- Konami code unlocks special theme
|
||||||
|
- Hidden keyboard shortcuts (Cmd+K for special features)
|
||||||
|
- Hover reveals on logos or illustrations
|
||||||
|
- Alt text jokes on images (for screen reader users too!)
|
||||||
|
- Console messages for developers ("Like what you see? We're hiring!")
|
||||||
|
|
||||||
|
**Seasonal touches**:
|
||||||
|
- Holiday themes (subtle, tasteful)
|
||||||
|
- Seasonal color shifts
|
||||||
|
- Weather-based variations
|
||||||
|
- Time-based changes (dark at night, light during day)
|
||||||
|
|
||||||
|
**Contextual personality**:
|
||||||
|
- Different messages based on time of day
|
||||||
|
- Responses to specific user actions
|
||||||
|
- Randomized variations (not same every time)
|
||||||
|
- Progressive reveals with continued use
|
||||||
|
|
||||||
|
### Loading & Waiting States
|
||||||
|
|
||||||
|
**Make waiting engaging**:
|
||||||
|
- Interesting loading messages that rotate
|
||||||
|
- Progress bars with personality
|
||||||
|
- Mini-games during long loads
|
||||||
|
- Fun facts or tips while waiting
|
||||||
|
- Countdown with encouraging messages
|
||||||
|
|
||||||
|
```
|
||||||
|
Loading messages — write ones specific to your product, not generic AI filler:
|
||||||
|
- "Crunching your latest numbers..."
|
||||||
|
- "Syncing with your team's changes..."
|
||||||
|
- "Preparing your dashboard..."
|
||||||
|
- "Checking for updates since yesterday..."
|
||||||
|
```
|
||||||
|
|
||||||
|
**WARNING**: Avoid cliched loading messages like "Herding pixels", "Teaching robots to dance", "Consulting the magic 8-ball", "Counting backwards from infinity". These are AI-slop copy — instantly recognizable as machine-generated. Write messages that are specific to what your product actually does.
|
||||||
|
|
||||||
|
### Celebration Moments
|
||||||
|
|
||||||
|
**Success celebrations**:
|
||||||
|
- Confetti for major milestones
|
||||||
|
- Animated checkmarks for completions
|
||||||
|
- Progress bar celebrations at 100%
|
||||||
|
- "Achievement unlocked" style notifications
|
||||||
|
- Personalized messages ("You published your 10th article!")
|
||||||
|
|
||||||
|
**Milestone recognition**:
|
||||||
|
- First-time actions get special treatment
|
||||||
|
- Streak tracking and celebration
|
||||||
|
- Progress toward goals
|
||||||
|
- Anniversary celebrations
|
||||||
|
|
||||||
|
## Implementation Patterns
|
||||||
|
|
||||||
|
**Animation libraries**:
|
||||||
|
- Framer Motion (React)
|
||||||
|
- GSAP (universal)
|
||||||
|
- Lottie (After Effects animations)
|
||||||
|
- Canvas confetti (party effects)
|
||||||
|
|
||||||
|
**Sound libraries**:
|
||||||
|
- Howler.js (audio management)
|
||||||
|
- Use-sound (React hook)
|
||||||
|
|
||||||
|
**Physics libraries**:
|
||||||
|
- React Spring (spring physics)
|
||||||
|
- Popmotion (animation primitives)
|
||||||
|
|
||||||
|
**IMPORTANT**: File size matters. Compress images, optimize animations, lazy load delight features.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Delay core functionality for delight
|
||||||
|
- Force users through delightful moments (make skippable)
|
||||||
|
- Use delight to hide poor UX
|
||||||
|
- Overdo it (less is more)
|
||||||
|
- Ignore accessibility (animate responsibly, provide alternatives)
|
||||||
|
- Make every interaction delightful (special moments should be special)
|
||||||
|
- Sacrifice performance for delight
|
||||||
|
- Be inappropriate for context (read the room)
|
||||||
|
|
||||||
|
## Verify Delight Quality
|
||||||
|
|
||||||
|
Test that delight actually delights:
|
||||||
|
|
||||||
|
- **User reactions**: Do users smile? Share screenshots?
|
||||||
|
- **Doesn't annoy**: Still pleasant after 100th time?
|
||||||
|
- **Doesn't block**: Can users opt out or skip?
|
||||||
|
- **Performant**: No jank, no slowdown
|
||||||
|
- **Appropriate**: Matches brand and context
|
||||||
|
- **Accessible**: Works with reduced motion, screen readers
|
||||||
|
|
||||||
|
Remember: Delight is the difference between a tool and an experience. Add personality, surprise users positively, and create moments worth sharing. But always respect usability - delight should enhance, never obstruct.
|
||||||
119
.pi/agent/skills/frontend/distill/SKILL.md
Normal file
119
.pi/agent/skills/frontend/distill/SKILL.md
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
---
|
||||||
|
name: distill
|
||||||
|
description: Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean. Use when the user asks to simplify, declutter, reduce noise, remove elements, or make a UI cleaner and more focused.
|
||||||
|
---
|
||||||
|
|
||||||
|
Remove unnecessary complexity from designs, revealing the essential elements and creating clarity through ruthless simplification.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current State
|
||||||
|
|
||||||
|
Analyze what makes the design feel complex or cluttered:
|
||||||
|
|
||||||
|
1. **Identify complexity sources**:
|
||||||
|
- **Too many elements**: Competing buttons, redundant information, visual clutter
|
||||||
|
- **Excessive variation**: Too many colors, fonts, sizes, styles without purpose
|
||||||
|
- **Information overload**: Everything visible at once, no progressive disclosure
|
||||||
|
- **Visual noise**: Unnecessary borders, shadows, backgrounds, decorations
|
||||||
|
- **Confusing hierarchy**: Unclear what matters most
|
||||||
|
- **Feature creep**: Too many options, actions, or paths forward
|
||||||
|
|
||||||
|
2. **Find the essence**:
|
||||||
|
- What's the primary user goal? (There should be ONE)
|
||||||
|
- What's actually necessary vs nice-to-have?
|
||||||
|
- What can be removed, hidden, or combined?
|
||||||
|
- What's the 20% that delivers 80% of value?
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: Simplicity is not about removing features - it's about removing obstacles between users and their goals. Every element should justify its existence.
|
||||||
|
|
||||||
|
## Plan Simplification
|
||||||
|
|
||||||
|
Create a ruthless editing strategy:
|
||||||
|
|
||||||
|
- **Core purpose**: What's the ONE thing this should accomplish?
|
||||||
|
- **Essential elements**: What's truly necessary to achieve that purpose?
|
||||||
|
- **Progressive disclosure**: What can be hidden until needed?
|
||||||
|
- **Consolidation opportunities**: What can be combined or integrated?
|
||||||
|
|
||||||
|
**IMPORTANT**: Simplification is hard. It requires saying no to good ideas to make room for great execution. Be ruthless.
|
||||||
|
|
||||||
|
## Simplify the Design
|
||||||
|
|
||||||
|
Systematically remove complexity across these dimensions:
|
||||||
|
|
||||||
|
### Information Architecture
|
||||||
|
- **Reduce scope**: Remove secondary actions, optional features, redundant information
|
||||||
|
- **Progressive disclosure**: Hide complexity behind clear entry points (accordions, modals, step-through flows)
|
||||||
|
- **Combine related actions**: Merge similar buttons, consolidate forms, group related content
|
||||||
|
- **Clear hierarchy**: ONE primary action, few secondary actions, everything else tertiary or hidden
|
||||||
|
- **Remove redundancy**: If it's said elsewhere, don't repeat it here
|
||||||
|
|
||||||
|
### Visual Simplification
|
||||||
|
- **Reduce color palette**: Use 1-2 colors plus neutrals, not 5-7 colors
|
||||||
|
- **Limit typography**: One font family, 3-4 sizes maximum, 2-3 weights
|
||||||
|
- **Remove decorations**: Eliminate borders, shadows, backgrounds that don't serve hierarchy or function
|
||||||
|
- **Flatten structure**: Reduce nesting, remove unnecessary containers—never nest cards inside cards
|
||||||
|
- **Remove unnecessary cards**: Cards aren't needed for basic layout; use spacing and alignment instead
|
||||||
|
- **Consistent spacing**: Use one spacing scale, remove arbitrary gaps
|
||||||
|
|
||||||
|
### Layout Simplification
|
||||||
|
- **Linear flow**: Replace complex grids with simple vertical flow where possible
|
||||||
|
- **Remove sidebars**: Move secondary content inline or hide it
|
||||||
|
- **Full-width**: Use available space generously instead of complex multi-column layouts
|
||||||
|
- **Consistent alignment**: Pick left or center, stick with it
|
||||||
|
- **Generous white space**: Let content breathe, don't pack everything tight
|
||||||
|
|
||||||
|
### Interaction Simplification
|
||||||
|
- **Reduce choices**: Fewer buttons, fewer options, clearer path forward (paradox of choice is real)
|
||||||
|
- **Smart defaults**: Make common choices automatic, only ask when necessary
|
||||||
|
- **Inline actions**: Replace modal flows with inline editing where possible
|
||||||
|
- **Remove steps**: Can signup be one step instead of three? Can checkout be simplified?
|
||||||
|
- **Clear CTAs**: ONE obvious next step, not five competing actions
|
||||||
|
|
||||||
|
### Content Simplification
|
||||||
|
- **Shorter copy**: Cut every sentence in half, then do it again
|
||||||
|
- **Active voice**: "Save changes" not "Changes will be saved"
|
||||||
|
- **Remove jargon**: Plain language always wins
|
||||||
|
- **Scannable structure**: Short paragraphs, bullet points, clear headings
|
||||||
|
- **Essential information only**: Remove marketing fluff, legalese, hedging
|
||||||
|
- **Remove redundant copy**: No headers restating intros, no repeated explanations, say it once
|
||||||
|
|
||||||
|
### Code Simplification
|
||||||
|
- **Remove unused code**: Dead CSS, unused components, orphaned files
|
||||||
|
- **Flatten component trees**: Reduce nesting depth
|
||||||
|
- **Consolidate styles**: Merge similar styles, use utilities consistently
|
||||||
|
- **Reduce variants**: Does that component need 12 variations, or can 3 cover 90% of cases?
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Remove necessary functionality (simplicity ≠ feature-less)
|
||||||
|
- Sacrifice accessibility for simplicity (clear labels and ARIA still required)
|
||||||
|
- Make things so simple they're unclear (mystery ≠ minimalism)
|
||||||
|
- Remove information users need to make decisions
|
||||||
|
- Eliminate hierarchy completely (some things should stand out)
|
||||||
|
- Oversimplify complex domains (match complexity to actual task complexity)
|
||||||
|
|
||||||
|
## Verify Simplification
|
||||||
|
|
||||||
|
Ensure simplification improves usability:
|
||||||
|
|
||||||
|
- **Faster task completion**: Can users accomplish goals more quickly?
|
||||||
|
- **Reduced cognitive load**: Is it easier to understand what to do?
|
||||||
|
- **Still complete**: Are all necessary features still accessible?
|
||||||
|
- **Clearer hierarchy**: Is it obvious what matters most?
|
||||||
|
- **Better performance**: Does simpler design load faster?
|
||||||
|
|
||||||
|
## Document Removed Complexity
|
||||||
|
|
||||||
|
If you removed features or options:
|
||||||
|
- Document why they were removed
|
||||||
|
- Consider if they need alternative access points
|
||||||
|
- Note any user feedback to monitor
|
||||||
|
|
||||||
|
Remember: You have great taste and judgment. Simplification is an act of confidence - knowing what to keep and courage to remove the rest. As Antoine de Saint-Exupéry said: "Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away."
|
||||||
89
.pi/agent/skills/frontend/extract/SKILL.md
Normal file
89
.pi/agent/skills/frontend/extract/SKILL.md
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
---
|
||||||
|
name: extract
|
||||||
|
description: Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library. Use when the user asks to create components, refactor repeated UI patterns, build a design system, or extract tokens.
|
||||||
|
---
|
||||||
|
|
||||||
|
Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse.
|
||||||
|
|
||||||
|
## Discover
|
||||||
|
|
||||||
|
Analyze the target area to identify extraction opportunities:
|
||||||
|
|
||||||
|
1. **Find the design system**: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure:
|
||||||
|
- Component organization and naming conventions
|
||||||
|
- Design token structure (if any)
|
||||||
|
- Documentation patterns
|
||||||
|
- Import/export conventions
|
||||||
|
|
||||||
|
**CRITICAL**: If no design system exists, ask before creating one. Understand the preferred location and structure first.
|
||||||
|
|
||||||
|
2. **Identify patterns**: Look for:
|
||||||
|
- **Repeated components**: Similar UI patterns used multiple times (buttons, cards, inputs, etc.)
|
||||||
|
- **Hard-coded values**: Colors, spacing, typography, shadows that should be tokens
|
||||||
|
- **Inconsistent variations**: Multiple implementations of the same concept (3 different button styles)
|
||||||
|
- **Reusable patterns**: Layout patterns, composition patterns, interaction patterns worth systematizing
|
||||||
|
|
||||||
|
3. **Assess value**: Not everything should be extracted. Consider:
|
||||||
|
- Is this used 3+ times, or likely to be reused?
|
||||||
|
- Would systematizing this improve consistency?
|
||||||
|
- Is this a general pattern or context-specific?
|
||||||
|
- What's the maintenance cost vs benefit?
|
||||||
|
|
||||||
|
## Plan Extraction
|
||||||
|
|
||||||
|
Create a systematic extraction plan:
|
||||||
|
|
||||||
|
- **Components to extract**: Which UI elements become reusable components?
|
||||||
|
- **Tokens to create**: Which hard-coded values become design tokens?
|
||||||
|
- **Variants to support**: What variations does each component need?
|
||||||
|
- **Naming conventions**: Component names, token names, prop names that match existing patterns
|
||||||
|
- **Migration path**: How to refactor existing uses to consume the new shared versions
|
||||||
|
|
||||||
|
**IMPORTANT**: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.
|
||||||
|
|
||||||
|
## Extract & Enrich
|
||||||
|
|
||||||
|
Build improved, reusable versions:
|
||||||
|
|
||||||
|
- **Components**: Create well-designed components with:
|
||||||
|
- Clear props API with sensible defaults
|
||||||
|
- Proper variants for different use cases
|
||||||
|
- Accessibility built in (ARIA, keyboard navigation, focus management)
|
||||||
|
- Documentation and usage examples
|
||||||
|
|
||||||
|
- **Design tokens**: Create tokens with:
|
||||||
|
- Clear naming (primitive vs semantic)
|
||||||
|
- Proper hierarchy and organization
|
||||||
|
- Documentation of when to use each token
|
||||||
|
|
||||||
|
- **Patterns**: Document patterns with:
|
||||||
|
- When to use this pattern
|
||||||
|
- Code examples
|
||||||
|
- Variations and combinations
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Extract one-off, context-specific implementations without generalization
|
||||||
|
- Create components so generic they're useless
|
||||||
|
- Extract without considering existing design system conventions
|
||||||
|
- Skip proper TypeScript types or prop documentation
|
||||||
|
- Create tokens for every single value (tokens should have semantic meaning)
|
||||||
|
|
||||||
|
## Migrate
|
||||||
|
|
||||||
|
Replace existing uses with the new shared versions:
|
||||||
|
|
||||||
|
- **Find all instances**: Search for the patterns you've extracted
|
||||||
|
- **Replace systematically**: Update each use to consume the shared version
|
||||||
|
- **Test thoroughly**: Ensure visual and functional parity
|
||||||
|
- **Delete dead code**: Remove the old implementations
|
||||||
|
|
||||||
|
## Document
|
||||||
|
|
||||||
|
Update design system documentation:
|
||||||
|
|
||||||
|
- Add new components to the component library
|
||||||
|
- Document token usage and values
|
||||||
|
- Add examples and guidelines
|
||||||
|
- Update any Storybook or component catalog
|
||||||
|
|
||||||
|
Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.
|
||||||
147
.pi/agent/skills/frontend/frontend-design/SKILL.md
Normal file
147
.pi/agent/skills/frontend/frontend-design/SKILL.md
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
---
|
||||||
|
name: frontend-design
|
||||||
|
description: Create distinctive, production-grade frontend interfaces with high design quality. Generates creative, polished code that avoids generic AI aesthetics. Use when the user asks to build web components, pages, artifacts, posters, or applications, or when any design skill requires project context.
|
||||||
|
license: Apache 2.0. Based on Anthropic's frontend-design skill. See NOTICE.md for attribution.
|
||||||
|
---
|
||||||
|
|
||||||
|
This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
|
||||||
|
|
||||||
|
## Context Gathering Protocol
|
||||||
|
|
||||||
|
Design skills produce generic output without project context. You MUST have confirmed design context before doing any design work.
|
||||||
|
|
||||||
|
**Required context** — every design skill needs at minimum:
|
||||||
|
- **Target audience**: Who uses this product and in what context?
|
||||||
|
- **Use cases**: What jobs are they trying to get done?
|
||||||
|
- **Brand personality/tone**: How should the interface feel?
|
||||||
|
|
||||||
|
Individual skills may require additional context — check the skill's preparation section for specifics.
|
||||||
|
|
||||||
|
**CRITICAL**: You cannot infer this context by reading the codebase. Code tells you what was built, not who it's for or what it should feel like. Only the creator can provide this context.
|
||||||
|
|
||||||
|
**Gathering order:**
|
||||||
|
1. **Check current instructions (instant)**: If your loaded instructions already contain a **Design Context** section, proceed immediately.
|
||||||
|
2. **Check .impeccable.md (fast)**: If not in instructions, read `.impeccable.md` from the project root. If it exists and contains the required context, proceed.
|
||||||
|
3. **Run teach-impeccable (REQUIRED)**: If neither source has context, you MUST run /teach-impeccable NOW before doing anything else. Do NOT skip this step. Do NOT attempt to infer context from the codebase instead.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Design Direction
|
||||||
|
|
||||||
|
Commit to a BOLD aesthetic direction:
|
||||||
|
- **Purpose**: What problem does this interface solve? Who uses it?
|
||||||
|
- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
|
||||||
|
- **Constraints**: Technical requirements (framework, performance, accessibility).
|
||||||
|
- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
|
||||||
|
|
||||||
|
**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work—the key is intentionality, not intensity.
|
||||||
|
|
||||||
|
Then implement working code that is:
|
||||||
|
- Production-grade and functional
|
||||||
|
- Visually striking and memorable
|
||||||
|
- Cohesive with a clear aesthetic point-of-view
|
||||||
|
- Meticulously refined in every detail
|
||||||
|
|
||||||
|
## Frontend Aesthetics Guidelines
|
||||||
|
|
||||||
|
### Typography
|
||||||
|
→ *Consult [typography reference](reference/typography.md) for scales, pairing, and loading strategies.*
|
||||||
|
|
||||||
|
Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
|
||||||
|
|
||||||
|
**DO**: Use a modular type scale with fluid sizing (clamp)
|
||||||
|
**DO**: Vary font weights and sizes to create clear visual hierarchy
|
||||||
|
**DON'T**: Use overused fonts—Inter, Roboto, Arial, Open Sans, system defaults
|
||||||
|
**DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes
|
||||||
|
**DON'T**: Put large icons with rounded corners above every heading—they rarely add value and make sites look templated
|
||||||
|
|
||||||
|
### Color & Theme
|
||||||
|
→ *Consult [color reference](reference/color-and-contrast.md) for OKLCH, palettes, and dark mode.*
|
||||||
|
|
||||||
|
Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
|
||||||
|
|
||||||
|
**DO**: Use modern CSS color functions (oklch, color-mix, light-dark) for perceptually uniform, maintainable palettes
|
||||||
|
**DO**: Tint your neutrals toward your brand hue—even a subtle hint creates subconscious cohesion
|
||||||
|
**DON'T**: Use gray text on colored backgrounds—it looks washed out; use a shade of the background color instead
|
||||||
|
**DON'T**: Use pure black (#000) or pure white (#fff)—always tint; pure black/white never appears in nature
|
||||||
|
**DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
|
||||||
|
**DON'T**: Use gradient text for "impact"—especially on metrics or headings; it's decorative rather than meaningful
|
||||||
|
**DON'T**: Default to dark mode with glowing accents—it looks "cool" without requiring actual design decisions
|
||||||
|
|
||||||
|
### Layout & Space
|
||||||
|
→ *Consult [spatial reference](reference/spatial-design.md) for grids, rhythm, and container queries.*
|
||||||
|
|
||||||
|
Create visual rhythm through varied spacing—not the same padding everywhere. Embrace asymmetry and unexpected compositions. Break the grid intentionally for emphasis.
|
||||||
|
|
||||||
|
**DO**: Create visual rhythm through varied spacing—tight groupings, generous separations
|
||||||
|
**DO**: Use fluid spacing with clamp() that breathes on larger screens
|
||||||
|
**DO**: Use asymmetry and unexpected compositions; break the grid intentionally for emphasis
|
||||||
|
**DON'T**: Wrap everything in cards—not everything needs a container
|
||||||
|
**DON'T**: Nest cards inside cards—visual noise, flatten the hierarchy
|
||||||
|
**DON'T**: Use identical card grids—same-sized cards with icon + heading + text, repeated endlessly
|
||||||
|
**DON'T**: Use the hero metric layout template—big number, small label, supporting stats, gradient accent
|
||||||
|
**DON'T**: Center everything—left-aligned text with asymmetric layouts feels more designed
|
||||||
|
**DON'T**: Use the same spacing everywhere—without rhythm, layouts feel monotonous
|
||||||
|
|
||||||
|
### Visual Details
|
||||||
|
**DO**: Use intentional, purposeful decorative elements that reinforce brand
|
||||||
|
**DON'T**: Use glassmorphism everywhere—blur effects, glass cards, glow borders used decoratively rather than purposefully
|
||||||
|
**DON'T**: Use rounded elements with thick colored border on one side—a lazy accent that almost never looks intentional
|
||||||
|
**DON'T**: Use sparklines as decoration—tiny charts that look sophisticated but convey nothing meaningful
|
||||||
|
**DON'T**: Use rounded rectangles with generic drop shadows—safe, forgettable, could be any AI output
|
||||||
|
**DON'T**: Use modals unless there's truly no better alternative—modals are lazy
|
||||||
|
|
||||||
|
### Motion
|
||||||
|
→ *Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion.*
|
||||||
|
|
||||||
|
Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions.
|
||||||
|
|
||||||
|
**DO**: Use motion to convey state changes—entrances, exits, feedback
|
||||||
|
**DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
|
||||||
|
**DO**: For height animations, use grid-template-rows transitions instead of animating height directly
|
||||||
|
**DON'T**: Animate layout properties (width, height, padding, margin)—use transform and opacity only
|
||||||
|
**DON'T**: Use bounce or elastic easing—they feel dated and tacky; real objects decelerate smoothly
|
||||||
|
|
||||||
|
### Interaction
|
||||||
|
→ *Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns.*
|
||||||
|
|
||||||
|
Make interactions feel fast. Use optimistic UI—update immediately, sync later.
|
||||||
|
|
||||||
|
**DO**: Use progressive disclosure—start simple, reveal sophistication through interaction (basic options first, advanced behind expandable sections; hover states that reveal secondary actions)
|
||||||
|
**DO**: Design empty states that teach the interface, not just say "nothing here"
|
||||||
|
**DO**: Make every interactive surface feel intentional and responsive
|
||||||
|
**DON'T**: Repeat the same information—redundant headers, intros that restate the heading
|
||||||
|
**DON'T**: Make every button primary—use ghost buttons, text links, secondary styles; hierarchy matters
|
||||||
|
|
||||||
|
### Responsive
|
||||||
|
→ *Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries.*
|
||||||
|
|
||||||
|
**DO**: Use container queries (@container) for component-level responsiveness
|
||||||
|
**DO**: Adapt the interface for different contexts—don't just shrink it
|
||||||
|
**DON'T**: Hide critical functionality on mobile—adapt the interface, don't amputate it
|
||||||
|
|
||||||
|
### UX Writing
|
||||||
|
→ *Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states.*
|
||||||
|
|
||||||
|
**DO**: Make every word earn its place
|
||||||
|
**DON'T**: Repeat information users can already see
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## The AI Slop Test
|
||||||
|
|
||||||
|
**Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
|
||||||
|
|
||||||
|
A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
|
||||||
|
|
||||||
|
Review the DON'T guidelines above—they are the fingerprints of AI-generated work from 2024-2025.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Implementation Principles
|
||||||
|
|
||||||
|
Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details.
|
||||||
|
|
||||||
|
Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices across generations.
|
||||||
|
|
||||||
|
Remember: the model is capable of extraordinary creative work. Don't hold back—show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
# Color & Contrast
|
||||||
|
|
||||||
|
## Color Spaces: Use OKLCH
|
||||||
|
|
||||||
|
**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
|
||||||
|
--color-primary: oklch(60% 0.15 250); /* Blue */
|
||||||
|
--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
|
||||||
|
--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
|
||||||
|
```
|
||||||
|
|
||||||
|
**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color.
|
||||||
|
|
||||||
|
## Building Functional Palettes
|
||||||
|
|
||||||
|
### The Tinted Neutral Trap
|
||||||
|
|
||||||
|
**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Dead grays */
|
||||||
|
--gray-100: oklch(95% 0 0); /* No personality */
|
||||||
|
--gray-900: oklch(15% 0 0);
|
||||||
|
|
||||||
|
/* Warm-tinted grays (add brand warmth) */
|
||||||
|
--gray-100: oklch(95% 0.01 60); /* Hint of warmth */
|
||||||
|
--gray-900: oklch(15% 0.01 60);
|
||||||
|
|
||||||
|
/* Cool-tinted grays (tech, professional) */
|
||||||
|
--gray-100: oklch(95% 0.01 250); /* Hint of blue */
|
||||||
|
--gray-900: oklch(15% 0.01 250);
|
||||||
|
```
|
||||||
|
|
||||||
|
The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
|
||||||
|
|
||||||
|
### Palette Structure
|
||||||
|
|
||||||
|
A complete system needs:
|
||||||
|
|
||||||
|
| Role | Purpose | Example |
|
||||||
|
|------|---------|---------|
|
||||||
|
| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
|
||||||
|
| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
|
||||||
|
| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
|
||||||
|
| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
|
||||||
|
|
||||||
|
**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
|
||||||
|
|
||||||
|
### The 60-30-10 Rule (Applied Correctly)
|
||||||
|
|
||||||
|
This rule is about **visual weight**, not pixel count:
|
||||||
|
|
||||||
|
- **60%**: Neutral backgrounds, white space, base surfaces
|
||||||
|
- **30%**: Secondary colors—text, borders, inactive states
|
||||||
|
- **10%**: Accent—CTAs, highlights, focus states
|
||||||
|
|
||||||
|
The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
|
||||||
|
|
||||||
|
## Contrast & Accessibility
|
||||||
|
|
||||||
|
### WCAG Requirements
|
||||||
|
|
||||||
|
| Content Type | AA Minimum | AAA Target |
|
||||||
|
|--------------|------------|------------|
|
||||||
|
| Body text | 4.5:1 | 7:1 |
|
||||||
|
| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
|
||||||
|
| UI components, icons | 3:1 | 4.5:1 |
|
||||||
|
| Non-essential decorations | None | None |
|
||||||
|
|
||||||
|
**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
|
||||||
|
|
||||||
|
### Dangerous Color Combinations
|
||||||
|
|
||||||
|
These commonly fail contrast or cause readability issues:
|
||||||
|
|
||||||
|
- Light gray text on white (the #1 accessibility fail)
|
||||||
|
- **Gray text on any colored background**—gray looks washed out and dead on color. Use a darker shade of the background color, or transparency
|
||||||
|
- Red text on green background (or vice versa)—8% of men can't distinguish these
|
||||||
|
- Blue text on red background (vibrates visually)
|
||||||
|
- Yellow text on white (almost always fails)
|
||||||
|
- Thin light text on images (unpredictable contrast)
|
||||||
|
|
||||||
|
### Never Use Pure Gray or Pure Black
|
||||||
|
|
||||||
|
Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted. (See tinted neutrals example above.)
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
Don't trust your eyes. Use tools:
|
||||||
|
|
||||||
|
- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
|
||||||
|
- Browser DevTools → Rendering → Emulate vision deficiencies
|
||||||
|
- [Polypane](https://polypane.app/) for real-time testing
|
||||||
|
|
||||||
|
## Theming: Light & Dark Mode
|
||||||
|
|
||||||
|
### Dark Mode Is Not Inverted Light Mode
|
||||||
|
|
||||||
|
You can't just swap colors. Dark mode requires different design decisions:
|
||||||
|
|
||||||
|
| Light Mode | Dark Mode |
|
||||||
|
|------------|-----------|
|
||||||
|
| Shadows for depth | Lighter surfaces for depth (no shadows) |
|
||||||
|
| Dark text on light | Light text on dark (reduce font weight) |
|
||||||
|
| Vibrant accents | Desaturate accents slightly |
|
||||||
|
| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Dark mode depth via surface color, not shadow */
|
||||||
|
:root[data-theme="dark"] {
|
||||||
|
--surface-1: oklch(15% 0.01 250);
|
||||||
|
--surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
|
||||||
|
--surface-3: oklch(25% 0.01 250);
|
||||||
|
|
||||||
|
/* Reduce text weight slightly */
|
||||||
|
--body-weight: 350; /* Instead of 400 */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Token Hierarchy
|
||||||
|
|
||||||
|
Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer—primitives stay the same.
|
||||||
|
|
||||||
|
## Alpha Is A Design Smell
|
||||||
|
|
||||||
|
Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Using pure black (#000) for large areas. Skipping color blindness testing (8% of men affected).
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
# Interaction Design
|
||||||
|
|
||||||
|
## The Eight Interactive States
|
||||||
|
|
||||||
|
Every interactive element needs these states designed:
|
||||||
|
|
||||||
|
| State | When | Visual Treatment |
|
||||||
|
|-------|------|------------------|
|
||||||
|
| **Default** | At rest | Base styling |
|
||||||
|
| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
|
||||||
|
| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
|
||||||
|
| **Active** | Being pressed | Pressed in, darker |
|
||||||
|
| **Disabled** | Not interactive | Reduced opacity, no pointer |
|
||||||
|
| **Loading** | Processing | Spinner, skeleton |
|
||||||
|
| **Error** | Invalid state | Red border, icon, message |
|
||||||
|
| **Success** | Completed | Green check, confirmation |
|
||||||
|
|
||||||
|
**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
|
||||||
|
|
||||||
|
## Focus Rings: Do Them Right
|
||||||
|
|
||||||
|
**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Hide focus ring for mouse/touch */
|
||||||
|
button:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show focus ring for keyboard */
|
||||||
|
button:focus-visible {
|
||||||
|
outline: 2px solid var(--color-accent);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Focus ring design**:
|
||||||
|
- High contrast (3:1 minimum against adjacent colors)
|
||||||
|
- 2-3px thick
|
||||||
|
- Offset from element (not inside it)
|
||||||
|
- Consistent across all interactive elements
|
||||||
|
|
||||||
|
## Form Design: The Non-Obvious
|
||||||
|
|
||||||
|
**Placeholders aren't labels**—they disappear on input. Always use visible `<label>` elements. **Validate on blur**, not on every keystroke (exception: password strength). Place errors **below** fields with `aria-describedby` connecting them.
|
||||||
|
|
||||||
|
## Loading States
|
||||||
|
|
||||||
|
**Optimistic updates**: Show success immediately, rollback on failure. Use for low-stakes actions (likes, follows), not payments or destructive actions. **Skeleton screens > spinners**—they preview content shape and feel faster than generic spinners.
|
||||||
|
|
||||||
|
## Modals: The Inert Approach
|
||||||
|
|
||||||
|
Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- When modal is open -->
|
||||||
|
<main inert>
|
||||||
|
<!-- Content behind modal can't be focused or clicked -->
|
||||||
|
</main>
|
||||||
|
<dialog open>
|
||||||
|
<h2>Modal Title</h2>
|
||||||
|
<!-- Focus stays inside modal -->
|
||||||
|
</dialog>
|
||||||
|
```
|
||||||
|
|
||||||
|
Or use the native `<dialog>` element:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const dialog = document.querySelector('dialog');
|
||||||
|
dialog.showModal(); // Opens with focus trap, closes on Escape
|
||||||
|
```
|
||||||
|
|
||||||
|
## The Popover API
|
||||||
|
|
||||||
|
For tooltips, dropdowns, and non-modal overlays, use native popovers:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<button popovertarget="menu">Open menu</button>
|
||||||
|
<div id="menu" popover>
|
||||||
|
<button>Option 1</button>
|
||||||
|
<button>Option 2</button>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
|
||||||
|
|
||||||
|
## Dropdown & Overlay Positioning
|
||||||
|
|
||||||
|
Dropdowns rendered with `position: absolute` inside a container that has `overflow: hidden` or `overflow: auto` will be clipped. This is the single most common dropdown bug in generated code.
|
||||||
|
|
||||||
|
### CSS Anchor Positioning
|
||||||
|
|
||||||
|
The modern solution uses the CSS Anchor Positioning API to tether an overlay to its trigger without JavaScript:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.trigger {
|
||||||
|
anchor-name: --menu-trigger;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
position: fixed;
|
||||||
|
position-anchor: --menu-trigger;
|
||||||
|
position-area: block-end span-inline-end;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Flip above if no room below */
|
||||||
|
@position-try --flip-above {
|
||||||
|
position-area: block-start span-inline-end;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Because the dropdown uses `position: fixed`, it escapes any `overflow` clipping on ancestor elements. The `@position-try` block handles viewport edges automatically. **Browser support**: Chrome 125+, Edge 125+. Not yet in Firefox or Safari - use a fallback for those browsers.
|
||||||
|
|
||||||
|
### Popover + Anchor Combo
|
||||||
|
|
||||||
|
Combining the Popover API with anchor positioning gives you stacking, light-dismiss, accessibility, and correct positioning in one pattern:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<button popovertarget="menu" class="trigger">Open</button>
|
||||||
|
<div id="menu" popover class="dropdown">
|
||||||
|
<button>Option 1</button>
|
||||||
|
<button>Option 2</button>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
The `popover` attribute places the element in the **top layer**, which sits above all other content regardless of z-index or overflow. No portal needed.
|
||||||
|
|
||||||
|
### Portal / Teleport Pattern
|
||||||
|
|
||||||
|
In component frameworks, render the dropdown at the document root and position it with JavaScript:
|
||||||
|
|
||||||
|
- **React**: `createPortal(dropdown, document.body)`
|
||||||
|
- **Vue**: `<Teleport to="body">`
|
||||||
|
- **Svelte**: Use a portal library or mount to `document.body`
|
||||||
|
|
||||||
|
Calculate position from the trigger's `getBoundingClientRect()`, then apply `position: fixed` with `top` and `left` values. Recalculate on scroll and resize.
|
||||||
|
|
||||||
|
### Fixed Positioning Fallback
|
||||||
|
|
||||||
|
For browsers without anchor positioning support, `position: fixed` with manual coordinates avoids overflow clipping:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.dropdown {
|
||||||
|
position: fixed;
|
||||||
|
/* top/left set via JS from trigger's getBoundingClientRect() */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Check viewport boundaries before rendering. If the dropdown would overflow the bottom edge, flip it above the trigger. If it would overflow the right edge, align it to the trigger's right side instead.
|
||||||
|
|
||||||
|
### Anti-Patterns
|
||||||
|
|
||||||
|
- **`position: absolute` inside `overflow: hidden`** - The dropdown will be clipped. Use `position: fixed` or the top layer instead.
|
||||||
|
- **Arbitrary z-index values** like `z-index: 9999` - Use a semantic z-index scale: `dropdown (100) -> sticky (200) -> modal-backdrop (300) -> modal (400) -> toast (500) -> tooltip (600)`.
|
||||||
|
- **Rendering dropdown markup inline** without an escape hatch from the parent's stacking context. Either use `popover` (top layer), a portal, or `position: fixed`.
|
||||||
|
|
||||||
|
## Destructive Actions: Undo > Confirm
|
||||||
|
|
||||||
|
**Undo is better than confirmation dialogs**—users click through confirmations mindlessly. Remove from UI immediately, show undo toast, actually delete after toast expires. Use confirmation only for truly irreversible actions (account deletion), high-cost actions, or batch operations.
|
||||||
|
|
||||||
|
## Keyboard Navigation Patterns
|
||||||
|
|
||||||
|
### Roving Tabindex
|
||||||
|
|
||||||
|
For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div role="tablist">
|
||||||
|
<button role="tab" tabindex="0">Tab 1</button>
|
||||||
|
<button role="tab" tabindex="-1">Tab 2</button>
|
||||||
|
<button role="tab" tabindex="-1">Tab 3</button>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
|
||||||
|
|
||||||
|
### Skip Links
|
||||||
|
|
||||||
|
Provide skip links (`<a href="#main-content">Skip to main content</a>`) for keyboard users to jump past navigation. Hide off-screen, show on focus.
|
||||||
|
|
||||||
|
## Gesture Discoverability
|
||||||
|
|
||||||
|
Swipe-to-delete and similar gestures are invisible. Hint at their existence:
|
||||||
|
|
||||||
|
- **Partially reveal**: Show delete button peeking from edge
|
||||||
|
- **Onboarding**: Coach marks on first use
|
||||||
|
- **Alternative**: Always provide a visible fallback (menu with "Delete")
|
||||||
|
|
||||||
|
Don't rely on gestures as the only way to perform actions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Removing focus indicators without alternatives. Using placeholder text as labels. Touch targets <44x44px. Generic error messages. Custom controls without ARIA/keyboard support.
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
# Motion Design
|
||||||
|
|
||||||
|
## Duration: The 100/300/500 Rule
|
||||||
|
|
||||||
|
Timing matters more than easing. These durations feel right for most UI:
|
||||||
|
|
||||||
|
| Duration | Use Case | Examples |
|
||||||
|
|----------|----------|----------|
|
||||||
|
| **100-150ms** | Instant feedback | Button press, toggle, color change |
|
||||||
|
| **200-300ms** | State changes | Menu open, tooltip, hover states |
|
||||||
|
| **300-500ms** | Layout changes | Accordion, modal, drawer |
|
||||||
|
| **500-800ms** | Entrance animations | Page load, hero reveals |
|
||||||
|
|
||||||
|
**Exit animations are faster than entrances**—use ~75% of enter duration.
|
||||||
|
|
||||||
|
## Easing: Pick the Right Curve
|
||||||
|
|
||||||
|
**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
|
||||||
|
|
||||||
|
| Curve | Use For | CSS |
|
||||||
|
|-------|---------|-----|
|
||||||
|
| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
|
||||||
|
| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
|
||||||
|
| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
|
||||||
|
|
||||||
|
**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Quart out - smooth, refined (recommended default) */
|
||||||
|
--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
|
|
||||||
|
/* Quint out - slightly more dramatic */
|
||||||
|
--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
|
||||||
|
/* Expo out - snappy, confident */
|
||||||
|
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
|
||||||
|
|
||||||
|
## The Only Two Properties You Should Animate
|
||||||
|
|
||||||
|
**transform** and **opacity** only—everything else causes layout recalculation. For height animations (accordions), use `grid-template-rows: 0fr → 1fr` instead of animating `height` directly.
|
||||||
|
|
||||||
|
## Staggered Animations
|
||||||
|
|
||||||
|
Use CSS custom properties for cleaner stagger: `animation-delay: calc(var(--i, 0) * 50ms)` with `style="--i: 0"` on each item. **Cap total stagger time**—10 items at 50ms = 500ms total. For many items, reduce per-item delay or cap staggered count.
|
||||||
|
|
||||||
|
## Reduced Motion
|
||||||
|
|
||||||
|
This is not optional. Vestibular disorders affect ~35% of adults over 40.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Define animations normally */
|
||||||
|
.card {
|
||||||
|
animation: slide-up 500ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provide alternative for reduced motion */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.card {
|
||||||
|
animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Or disable entirely */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*, *::before, *::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
|
||||||
|
|
||||||
|
## Perceived Performance
|
||||||
|
|
||||||
|
**Nobody cares how fast your site is—just how fast it feels.** Perception can be as effective as actual performance.
|
||||||
|
|
||||||
|
**The 80ms threshold**: Our brains buffer sensory input for ~80ms to synchronize perception. Anything under 80ms feels instant and simultaneous. This is your target for micro-interactions.
|
||||||
|
|
||||||
|
**Active vs passive time**: Passive waiting (staring at a spinner) feels longer than active engagement. Strategies to shift the balance:
|
||||||
|
|
||||||
|
- **Preemptive start**: Begin transitions immediately while loading (iOS app zoom, skeleton UI). Users perceive work happening.
|
||||||
|
- **Early completion**: Show content progressively—don't wait for everything. Video buffering, progressive images, streaming HTML.
|
||||||
|
- **Optimistic UI**: Update the interface immediately, handle failures gracefully. Instagram likes work offline—the UI updates instantly, syncs later. Use for low-stakes actions; avoid for payments or destructive operations.
|
||||||
|
|
||||||
|
**Easing affects perceived duration**: Ease-in (accelerating toward completion) makes tasks feel shorter because the peak-end effect weights final moments heavily. Ease-out feels satisfying for entrances, but ease-in toward a task's end compresses perceived time.
|
||||||
|
|
||||||
|
**Caution**: Too-fast responses can decrease perceived value. Users may distrust instant results for complex operations (search, analysis). Sometimes a brief delay signals "real work" is happening.
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
Don't use `will-change` preemptively—only when animation is imminent (`:hover`, `.animating`). For scroll-triggered animations, use Intersection Observer instead of scroll events; unobserve after animating once. Create motion tokens for consistency (durations, easings, common transitions).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Animating everything (animation fatigue is real). Using >500ms for UI feedback. Ignoring `prefers-reduced-motion`. Using animation to hide slow loading.
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
# Responsive Design
|
||||||
|
|
||||||
|
## Mobile-First: Write It Right
|
||||||
|
|
||||||
|
Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.
|
||||||
|
|
||||||
|
## Breakpoints: Content-Driven
|
||||||
|
|
||||||
|
Don't chase device sizes—let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice (640, 768, 1024px). Use `clamp()` for fluid values without breakpoints.
|
||||||
|
|
||||||
|
## Detect Input Method, Not Just Screen Size
|
||||||
|
|
||||||
|
**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Fine pointer (mouse, trackpad) */
|
||||||
|
@media (pointer: fine) {
|
||||||
|
.button { padding: 8px 16px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Coarse pointer (touch, stylus) */
|
||||||
|
@media (pointer: coarse) {
|
||||||
|
.button { padding: 12px 20px; } /* Larger touch target */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Device supports hover */
|
||||||
|
@media (hover: hover) {
|
||||||
|
.card:hover { transform: translateY(-2px); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Device doesn't support hover (touch) */
|
||||||
|
@media (hover: none) {
|
||||||
|
.card { /* No hover state - use active instead */ }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Critical**: Don't rely on hover for functionality. Touch users can't hover.
|
||||||
|
|
||||||
|
## Safe Areas: Handle the Notch
|
||||||
|
|
||||||
|
Modern phones have notches, rounded corners, and home indicators. Use `env()`:
|
||||||
|
|
||||||
|
```css
|
||||||
|
body {
|
||||||
|
padding-top: env(safe-area-inset-top);
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
padding-left: env(safe-area-inset-left);
|
||||||
|
padding-right: env(safe-area-inset-right);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* With fallback */
|
||||||
|
.footer {
|
||||||
|
padding-bottom: max(1rem, env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Enable viewport-fit** in your meta tag:
|
||||||
|
```html
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
|
```
|
||||||
|
|
||||||
|
## Responsive Images: Get It Right
|
||||||
|
|
||||||
|
### srcset with Width Descriptors
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img
|
||||||
|
src="hero-800.jpg"
|
||||||
|
srcset="
|
||||||
|
hero-400.jpg 400w,
|
||||||
|
hero-800.jpg 800w,
|
||||||
|
hero-1200.jpg 1200w
|
||||||
|
"
|
||||||
|
sizes="(max-width: 768px) 100vw, 50vw"
|
||||||
|
alt="Hero image"
|
||||||
|
>
|
||||||
|
```
|
||||||
|
|
||||||
|
**How it works**:
|
||||||
|
- `srcset` lists available images with their actual widths (`w` descriptors)
|
||||||
|
- `sizes` tells the browser how wide the image will display
|
||||||
|
- Browser picks the best file based on viewport width AND device pixel ratio
|
||||||
|
|
||||||
|
### Picture Element for Art Direction
|
||||||
|
|
||||||
|
When you need different crops/compositions (not just resolutions):
|
||||||
|
|
||||||
|
```html
|
||||||
|
<picture>
|
||||||
|
<source media="(min-width: 768px)" srcset="wide.jpg">
|
||||||
|
<source media="(max-width: 767px)" srcset="tall.jpg">
|
||||||
|
<img src="fallback.jpg" alt="...">
|
||||||
|
</picture>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Layout Adaptation Patterns
|
||||||
|
|
||||||
|
**Navigation**: Three stages—hamburger + drawer on mobile, horizontal compact on tablet, full with labels on desktop. **Tables**: Transform to cards on mobile using `display: block` and `data-label` attributes. **Progressive disclosure**: Use `<details>/<summary>` for content that can collapse on mobile.
|
||||||
|
|
||||||
|
## Testing: Don't Trust DevTools Alone
|
||||||
|
|
||||||
|
DevTools device emulation is useful for layout but misses:
|
||||||
|
|
||||||
|
- Actual touch interactions
|
||||||
|
- Real CPU/memory constraints
|
||||||
|
- Network latency patterns
|
||||||
|
- Font rendering differences
|
||||||
|
- Browser chrome/keyboard appearances
|
||||||
|
|
||||||
|
**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
# Spatial Design
|
||||||
|
|
||||||
|
## Spacing Systems
|
||||||
|
|
||||||
|
### Use 4pt Base, Not 8pt
|
||||||
|
|
||||||
|
8pt systems are too coarse—you'll frequently need 12px (between 8 and 16). Use 4pt for granularity: 4, 8, 12, 16, 24, 32, 48, 64, 96px.
|
||||||
|
|
||||||
|
### Name Tokens Semantically
|
||||||
|
|
||||||
|
Name by relationship (`--space-sm`, `--space-lg`), not value (`--spacing-8`). Use `gap` instead of margins for sibling spacing—it eliminates margin collapse and cleanup hacks.
|
||||||
|
|
||||||
|
## Grid Systems
|
||||||
|
|
||||||
|
### The Self-Adjusting Grid
|
||||||
|
|
||||||
|
Use `repeat(auto-fit, minmax(280px, 1fr))` for responsive grids without breakpoints. Columns are at least 280px, as many as fit per row, leftovers stretch. For complex layouts, use named grid areas (`grid-template-areas`) and redefine them at breakpoints.
|
||||||
|
|
||||||
|
## Visual Hierarchy
|
||||||
|
|
||||||
|
### The Squint Test
|
||||||
|
|
||||||
|
Blur your eyes (or screenshot and blur). Can you still identify:
|
||||||
|
- The most important element?
|
||||||
|
- The second most important?
|
||||||
|
- Clear groupings?
|
||||||
|
|
||||||
|
If everything looks the same weight blurred, you have a hierarchy problem.
|
||||||
|
|
||||||
|
### Hierarchy Through Multiple Dimensions
|
||||||
|
|
||||||
|
Don't rely on size alone. Combine:
|
||||||
|
|
||||||
|
| Tool | Strong Hierarchy | Weak Hierarchy |
|
||||||
|
|------|------------------|----------------|
|
||||||
|
| **Size** | 3:1 ratio or more | <2:1 ratio |
|
||||||
|
| **Weight** | Bold vs Regular | Medium vs Regular |
|
||||||
|
| **Color** | High contrast | Similar tones |
|
||||||
|
| **Position** | Top/left (primary) | Bottom/right |
|
||||||
|
| **Space** | Surrounded by white space | Crowded |
|
||||||
|
|
||||||
|
**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
|
||||||
|
|
||||||
|
### Cards Are Not Required
|
||||||
|
|
||||||
|
Cards are overused. Spacing and alignment create visual grouping naturally. Use cards only when content is truly distinct and actionable, items need visual comparison in a grid, or content needs clear interaction boundaries. **Never nest cards inside cards**—use spacing, typography, and subtle dividers for hierarchy within a card.
|
||||||
|
|
||||||
|
## Container Queries
|
||||||
|
|
||||||
|
Viewport queries are for page layouts. **Container queries are for components**:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.card-container {
|
||||||
|
container-type: inline-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--space-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Card layout changes based on its container, not viewport */
|
||||||
|
@container (min-width: 400px) {
|
||||||
|
.card {
|
||||||
|
grid-template-columns: 120px 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
|
||||||
|
|
||||||
|
## Optical Adjustments
|
||||||
|
|
||||||
|
Text at `margin-left: 0` looks indented due to letterform whitespace—use negative margin (`-0.05em`) to optically align. Geometrically centered icons often look off-center; play icons need to shift right, arrows shift toward their direction.
|
||||||
|
|
||||||
|
### Touch Targets vs Visual Size
|
||||||
|
|
||||||
|
Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.icon-button {
|
||||||
|
width: 24px; /* Visual size */
|
||||||
|
height: 24px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: -10px; /* Expand tap target to 44px */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Depth & Elevation
|
||||||
|
|
||||||
|
Create semantic z-index scales (dropdown → sticky → modal-backdrop → modal → toast → tooltip) instead of arbitrary numbers. For shadows, create a consistent elevation scale (sm → md → lg → xl). **Key insight**: Shadows should be subtle—if you can clearly see it, it's probably too strong.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Arbitrary spacing values outside your scale. Making all spacing equal (variety creates hierarchy). Creating hierarchy through size alone - combine size, weight, color, and space.
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
# Typography
|
||||||
|
|
||||||
|
## Classic Typography Principles
|
||||||
|
|
||||||
|
### Vertical Rhythm
|
||||||
|
|
||||||
|
Your line-height should be the base unit for ALL vertical spacing. If body text has `line-height: 1.5` on `16px` type (= 24px), spacing values should be multiples of 24px. This creates subconscious harmony—text and space share a mathematical foundation.
|
||||||
|
|
||||||
|
### Modular Scale & Hierarchy
|
||||||
|
|
||||||
|
The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
|
||||||
|
|
||||||
|
**Use fewer sizes with more contrast.** A 5-size system covers most needs:
|
||||||
|
|
||||||
|
| Role | Typical Ratio | Use Case |
|
||||||
|
|------|---------------|----------|
|
||||||
|
| xs | 0.75rem | Captions, legal |
|
||||||
|
| sm | 0.875rem | Secondary UI, metadata |
|
||||||
|
| base | 1rem | Body text |
|
||||||
|
| lg | 1.25-1.5rem | Subheadings, lead text |
|
||||||
|
| xl+ | 2-4rem | Headlines, hero text |
|
||||||
|
|
||||||
|
Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
|
||||||
|
|
||||||
|
### Readability & Measure
|
||||||
|
|
||||||
|
Use `ch` units for character-based measure (`max-width: 65ch`). Line-height scales inversely with line length—narrow columns need tighter leading, wide columns need more.
|
||||||
|
|
||||||
|
**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
|
||||||
|
|
||||||
|
## Font Selection & Pairing
|
||||||
|
|
||||||
|
### Choosing Distinctive Fonts
|
||||||
|
|
||||||
|
**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
|
||||||
|
|
||||||
|
**Better Google Fonts alternatives**:
|
||||||
|
- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
|
||||||
|
- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
|
||||||
|
- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
|
||||||
|
- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
|
||||||
|
|
||||||
|
**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
|
||||||
|
|
||||||
|
### Pairing Principles
|
||||||
|
|
||||||
|
**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
|
||||||
|
|
||||||
|
When pairing, contrast on multiple axes:
|
||||||
|
- Serif + Sans (structure contrast)
|
||||||
|
- Geometric + Humanist (personality contrast)
|
||||||
|
- Condensed display + Wide body (proportion contrast)
|
||||||
|
|
||||||
|
**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
|
||||||
|
|
||||||
|
### Web Font Loading
|
||||||
|
|
||||||
|
The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* 1. Use font-display: swap for visibility */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'CustomFont';
|
||||||
|
src: url('font.woff2') format('woff2');
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2. Match fallback metrics to minimize shift */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'CustomFont-Fallback';
|
||||||
|
src: local('Arial');
|
||||||
|
size-adjust: 105%; /* Scale to match x-height */
|
||||||
|
ascent-override: 90%; /* Match ascender height */
|
||||||
|
descent-override: 20%; /* Match descender depth */
|
||||||
|
line-gap-override: 10%; /* Match line spacing */
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
|
||||||
|
|
||||||
|
## Modern Web Typography
|
||||||
|
|
||||||
|
### Fluid Type
|
||||||
|
|
||||||
|
Fluid typography via `clamp(min, preferred, max)` scales text smoothly with the viewport. The middle value (e.g., `5vw + 1rem`) controls scaling rate—higher vw = faster scaling. Add a rem offset so it doesn't collapse to 0 on small screens.
|
||||||
|
|
||||||
|
**Use fluid type for**: Headings and display text on marketing/content pages where text dominates the layout and needs to breathe across viewport sizes.
|
||||||
|
|
||||||
|
**Use fixed `rem` scales for**: App UIs, dashboards, and data-dense interfaces. No major app design system (Material, Polaris, Primer, Carbon) uses fluid type in product UI — fixed scales with optional breakpoint adjustments give the spatial predictability that container-based layouts need. Body text should also be fixed even on marketing pages, since the size difference across viewports is too small to warrant it.
|
||||||
|
|
||||||
|
### OpenType Features
|
||||||
|
|
||||||
|
Most developers don't know these exist. Use them for polish:
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Tabular numbers for data alignment */
|
||||||
|
.data-table { font-variant-numeric: tabular-nums; }
|
||||||
|
|
||||||
|
/* Proper fractions */
|
||||||
|
.recipe-amount { font-variant-numeric: diagonal-fractions; }
|
||||||
|
|
||||||
|
/* Small caps for abbreviations */
|
||||||
|
abbr { font-variant-caps: all-small-caps; }
|
||||||
|
|
||||||
|
/* Disable ligatures in code */
|
||||||
|
code { font-variant-ligatures: none; }
|
||||||
|
|
||||||
|
/* Enable kerning (usually on by default, but be explicit) */
|
||||||
|
body { font-kerning: normal; }
|
||||||
|
```
|
||||||
|
|
||||||
|
Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
|
||||||
|
|
||||||
|
## Typography System Architecture
|
||||||
|
|
||||||
|
Name tokens semantically (`--text-body`, `--text-heading`), not by value (`--font-size-16`). Include font stacks, size scale, weights, line-heights, and letter-spacing in your token system.
|
||||||
|
|
||||||
|
## Accessibility Considerations
|
||||||
|
|
||||||
|
Beyond contrast ratios (which are well-documented), consider:
|
||||||
|
|
||||||
|
- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
|
||||||
|
- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
|
||||||
|
- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
|
||||||
|
- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: More than 2-3 font families per project. Skipping fallback font definitions. Ignoring font loading performance (FOUT/FOIT). Using decorative fonts for body text.
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
# UX Writing
|
||||||
|
|
||||||
|
## The Button Label Problem
|
||||||
|
|
||||||
|
**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
|
||||||
|
|
||||||
|
| Bad | Good | Why |
|
||||||
|
|-----|------|-----|
|
||||||
|
| OK | Save changes | Says what will happen |
|
||||||
|
| Submit | Create account | Outcome-focused |
|
||||||
|
| Yes | Delete message | Confirms the action |
|
||||||
|
| Cancel | Keep editing | Clarifies what "cancel" means |
|
||||||
|
| Click here | Download PDF | Describes the destination |
|
||||||
|
|
||||||
|
**For destructive actions**, name the destruction:
|
||||||
|
- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
|
||||||
|
- "Delete 5 items" not "Delete selected" (show the count)
|
||||||
|
|
||||||
|
## Error Messages: The Formula
|
||||||
|
|
||||||
|
Every error message should answer: (1) What happened? (2) Why? (3) How to fix it? Example: "Email address isn't valid. Please include an @ symbol." not "Invalid input".
|
||||||
|
|
||||||
|
### Error Message Templates
|
||||||
|
|
||||||
|
| Situation | Template |
|
||||||
|
|-----------|----------|
|
||||||
|
| **Format error** | "[Field] needs to be [format]. Example: [example]" |
|
||||||
|
| **Missing required** | "Please enter [what's missing]" |
|
||||||
|
| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
|
||||||
|
| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
|
||||||
|
| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
|
||||||
|
|
||||||
|
### Don't Blame the User
|
||||||
|
|
||||||
|
Reframe errors: "Please enter a date in MM/DD/YYYY format" not "You entered an invalid date".
|
||||||
|
|
||||||
|
## Empty States Are Opportunities
|
||||||
|
|
||||||
|
Empty states are onboarding moments: (1) Acknowledge briefly, (2) Explain the value of filling it, (3) Provide a clear action. "No projects yet. Create your first one to get started." not just "No items".
|
||||||
|
|
||||||
|
## Voice vs Tone
|
||||||
|
|
||||||
|
**Voice** is your brand's personality—consistent everywhere.
|
||||||
|
**Tone** adapts to the moment.
|
||||||
|
|
||||||
|
| Moment | Tone Shift |
|
||||||
|
|--------|------------|
|
||||||
|
| Success | Celebratory, brief: "Done! Your changes are live." |
|
||||||
|
| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
|
||||||
|
| Loading | Reassuring: "Saving your work..." |
|
||||||
|
| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
|
||||||
|
|
||||||
|
**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
|
||||||
|
|
||||||
|
## Writing for Accessibility
|
||||||
|
|
||||||
|
**Link text** must have standalone meaning—"View pricing plans" not "Click here". **Alt text** describes information, not the image—"Revenue increased 40% in Q4" not "Chart". Use `alt=""` for decorative images. **Icon buttons** need `aria-label` for screen reader context.
|
||||||
|
|
||||||
|
## Writing for Translation
|
||||||
|
|
||||||
|
### Plan for Expansion
|
||||||
|
|
||||||
|
German text is ~30% longer than English. Allocate space:
|
||||||
|
|
||||||
|
| Language | Expansion |
|
||||||
|
|----------|-----------|
|
||||||
|
| German | +30% |
|
||||||
|
| French | +20% |
|
||||||
|
| Finnish | +30-40% |
|
||||||
|
| Chinese | -30% (fewer chars, but same width) |
|
||||||
|
|
||||||
|
### Translation-Friendly Patterns
|
||||||
|
|
||||||
|
Keep numbers separate ("New messages: 3" not "You have 3 new messages"). Use full sentences as single strings (word order varies by language). Avoid abbreviations ("5 minutes ago" not "5 mins ago"). Give translators context about where strings appear.
|
||||||
|
|
||||||
|
## Consistency: The Terminology Problem
|
||||||
|
|
||||||
|
Pick one term and stick with it:
|
||||||
|
|
||||||
|
| Inconsistent | Consistent |
|
||||||
|
|--------------|------------|
|
||||||
|
| Delete / Remove / Trash | Delete |
|
||||||
|
| Settings / Preferences / Options | Settings |
|
||||||
|
| Sign in / Log in / Enter | Sign in |
|
||||||
|
| Create / Add / New | Create |
|
||||||
|
|
||||||
|
Build a terminology glossary and enforce it. Variety creates confusion.
|
||||||
|
|
||||||
|
## Avoid Redundant Copy
|
||||||
|
|
||||||
|
If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
|
||||||
|
|
||||||
|
## Loading States
|
||||||
|
|
||||||
|
Be specific: "Saving your draft..." not "Loading...". For long waits, set expectations ("This usually takes 30 seconds") or show progress.
|
||||||
|
|
||||||
|
## Confirmation Dialogs: Use Sparingly
|
||||||
|
|
||||||
|
Most confirmation dialogs are design failures—consider undo instead. When you must confirm: name the action, explain consequences, use specific button labels ("Delete project" / "Keep project", not "Yes" / "No").
|
||||||
|
|
||||||
|
## Form Instructions
|
||||||
|
|
||||||
|
Show format with placeholders, not instructions. For non-obvious fields, explain why you're asking.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Avoid**: Jargon without explanation. Blaming users ("You made an error" → "This field is required"). Vague errors ("Something went wrong"). Varying terminology for variety. Humor for errors.
|
||||||
352
.pi/agent/skills/frontend/harden/SKILL.md
Normal file
352
.pi/agent/skills/frontend/harden/SKILL.md
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
---
|
||||||
|
name: harden
|
||||||
|
description: Improve interface resilience through better error handling, i18n support, text overflow handling, and edge case management. Makes interfaces robust and production-ready. Use when the user asks to harden, make production-ready, handle edge cases, add error states, or fix overflow and i18n issues.
|
||||||
|
---
|
||||||
|
|
||||||
|
Strengthen interfaces against edge cases, errors, internationalization issues, and real-world usage scenarios that break idealized designs.
|
||||||
|
|
||||||
|
## Assess Hardening Needs
|
||||||
|
|
||||||
|
Identify weaknesses and edge cases:
|
||||||
|
|
||||||
|
1. **Test with extreme inputs**:
|
||||||
|
- Very long text (names, descriptions, titles)
|
||||||
|
- Very short text (empty, single character)
|
||||||
|
- Special characters (emoji, RTL text, accents)
|
||||||
|
- Large numbers (millions, billions)
|
||||||
|
- Many items (1000+ list items, 50+ options)
|
||||||
|
- No data (empty states)
|
||||||
|
|
||||||
|
2. **Test error scenarios**:
|
||||||
|
- Network failures (offline, slow, timeout)
|
||||||
|
- API errors (400, 401, 403, 404, 500)
|
||||||
|
- Validation errors
|
||||||
|
- Permission errors
|
||||||
|
- Rate limiting
|
||||||
|
- Concurrent operations
|
||||||
|
|
||||||
|
3. **Test internationalization**:
|
||||||
|
- Long translations (German is often 30% longer than English)
|
||||||
|
- RTL languages (Arabic, Hebrew)
|
||||||
|
- Character sets (Chinese, Japanese, Korean, emoji)
|
||||||
|
- Date/time formats
|
||||||
|
- Number formats (1,000 vs 1.000)
|
||||||
|
- Currency symbols
|
||||||
|
|
||||||
|
**CRITICAL**: Designs that only work with perfect data aren't production-ready. Harden against reality.
|
||||||
|
|
||||||
|
## Hardening Dimensions
|
||||||
|
|
||||||
|
Systematically improve resilience:
|
||||||
|
|
||||||
|
### Text Overflow & Wrapping
|
||||||
|
|
||||||
|
**Long text handling**:
|
||||||
|
```css
|
||||||
|
/* Single line with ellipsis */
|
||||||
|
.truncate {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Multi-line with clamp */
|
||||||
|
.line-clamp {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allow wrapping */
|
||||||
|
.wrap {
|
||||||
|
word-wrap: break-word;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
hyphens: auto;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Flex/Grid overflow**:
|
||||||
|
```css
|
||||||
|
/* Prevent flex items from overflowing */
|
||||||
|
.flex-item {
|
||||||
|
min-width: 0; /* Allow shrinking below content size */
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Prevent grid items from overflowing */
|
||||||
|
.grid-item {
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Responsive text sizing**:
|
||||||
|
- Use `clamp()` for fluid typography
|
||||||
|
- Set minimum readable sizes (14px on mobile)
|
||||||
|
- Test text scaling (zoom to 200%)
|
||||||
|
- Ensure containers expand with text
|
||||||
|
|
||||||
|
### Internationalization (i18n)
|
||||||
|
|
||||||
|
**Text expansion**:
|
||||||
|
- Add 30-40% space budget for translations
|
||||||
|
- Use flexbox/grid that adapts to content
|
||||||
|
- Test with longest language (usually German)
|
||||||
|
- Avoid fixed widths on text containers
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
// ❌ Bad: Assumes short English text
|
||||||
|
<button className="w-24">Submit</button>
|
||||||
|
|
||||||
|
// ✅ Good: Adapts to content
|
||||||
|
<button className="px-4 py-2">Submit</button>
|
||||||
|
```
|
||||||
|
|
||||||
|
**RTL (Right-to-Left) support**:
|
||||||
|
```css
|
||||||
|
/* Use logical properties */
|
||||||
|
margin-inline-start: 1rem; /* Not margin-left */
|
||||||
|
padding-inline: 1rem; /* Not padding-left/right */
|
||||||
|
border-inline-end: 1px solid; /* Not border-right */
|
||||||
|
|
||||||
|
/* Or use dir attribute */
|
||||||
|
[dir="rtl"] .arrow { transform: scaleX(-1); }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Character set support**:
|
||||||
|
- Use UTF-8 encoding everywhere
|
||||||
|
- Test with Chinese/Japanese/Korean (CJK) characters
|
||||||
|
- Test with emoji (they can be 2-4 bytes)
|
||||||
|
- Handle different scripts (Latin, Cyrillic, Arabic, etc.)
|
||||||
|
|
||||||
|
**Date/Time formatting**:
|
||||||
|
```javascript
|
||||||
|
// ✅ Use Intl API for proper formatting
|
||||||
|
new Intl.DateTimeFormat('en-US').format(date); // 1/15/2024
|
||||||
|
new Intl.DateTimeFormat('de-DE').format(date); // 15.1.2024
|
||||||
|
|
||||||
|
new Intl.NumberFormat('en-US', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'USD'
|
||||||
|
}).format(1234.56); // $1,234.56
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pluralization**:
|
||||||
|
```javascript
|
||||||
|
// ❌ Bad: Assumes English pluralization
|
||||||
|
`${count} item${count !== 1 ? 's' : ''}`
|
||||||
|
|
||||||
|
// ✅ Good: Use proper i18n library
|
||||||
|
t('items', { count }) // Handles complex plural rules
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
**Network errors**:
|
||||||
|
- Show clear error messages
|
||||||
|
- Provide retry button
|
||||||
|
- Explain what happened
|
||||||
|
- Offer offline mode (if applicable)
|
||||||
|
- Handle timeout scenarios
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
// Error states with recovery
|
||||||
|
{error && (
|
||||||
|
<ErrorMessage>
|
||||||
|
<p>Failed to load data. {error.message}</p>
|
||||||
|
<button onClick={retry}>Try again</button>
|
||||||
|
</ErrorMessage>
|
||||||
|
)}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Form validation errors**:
|
||||||
|
- Inline errors near fields
|
||||||
|
- Clear, specific messages
|
||||||
|
- Suggest corrections
|
||||||
|
- Don't block submission unnecessarily
|
||||||
|
- Preserve user input on error
|
||||||
|
|
||||||
|
**API errors**:
|
||||||
|
- Handle each status code appropriately
|
||||||
|
- 400: Show validation errors
|
||||||
|
- 401: Redirect to login
|
||||||
|
- 403: Show permission error
|
||||||
|
- 404: Show not found state
|
||||||
|
- 429: Show rate limit message
|
||||||
|
- 500: Show generic error, offer support
|
||||||
|
|
||||||
|
**Graceful degradation**:
|
||||||
|
- Core functionality works without JavaScript
|
||||||
|
- Images have alt text
|
||||||
|
- Progressive enhancement
|
||||||
|
- Fallbacks for unsupported features
|
||||||
|
|
||||||
|
### Edge Cases & Boundary Conditions
|
||||||
|
|
||||||
|
**Empty states**:
|
||||||
|
- No items in list
|
||||||
|
- No search results
|
||||||
|
- No notifications
|
||||||
|
- No data to display
|
||||||
|
- Provide clear next action
|
||||||
|
|
||||||
|
**Loading states**:
|
||||||
|
- Initial load
|
||||||
|
- Pagination load
|
||||||
|
- Refresh
|
||||||
|
- Show what's loading ("Loading your projects...")
|
||||||
|
- Time estimates for long operations
|
||||||
|
|
||||||
|
**Large datasets**:
|
||||||
|
- Pagination or virtual scrolling
|
||||||
|
- Search/filter capabilities
|
||||||
|
- Performance optimization
|
||||||
|
- Don't load all 10,000 items at once
|
||||||
|
|
||||||
|
**Concurrent operations**:
|
||||||
|
- Prevent double-submission (disable button while loading)
|
||||||
|
- Handle race conditions
|
||||||
|
- Optimistic updates with rollback
|
||||||
|
- Conflict resolution
|
||||||
|
|
||||||
|
**Permission states**:
|
||||||
|
- No permission to view
|
||||||
|
- No permission to edit
|
||||||
|
- Read-only mode
|
||||||
|
- Clear explanation of why
|
||||||
|
|
||||||
|
**Browser compatibility**:
|
||||||
|
- Polyfills for modern features
|
||||||
|
- Fallbacks for unsupported CSS
|
||||||
|
- Feature detection (not browser detection)
|
||||||
|
- Test in target browsers
|
||||||
|
|
||||||
|
### Input Validation & Sanitization
|
||||||
|
|
||||||
|
**Client-side validation**:
|
||||||
|
- Required fields
|
||||||
|
- Format validation (email, phone, URL)
|
||||||
|
- Length limits
|
||||||
|
- Pattern matching
|
||||||
|
- Custom validation rules
|
||||||
|
|
||||||
|
**Server-side validation** (always):
|
||||||
|
- Never trust client-side only
|
||||||
|
- Validate and sanitize all inputs
|
||||||
|
- Protect against injection attacks
|
||||||
|
- Rate limiting
|
||||||
|
|
||||||
|
**Constraint handling**:
|
||||||
|
```html
|
||||||
|
<!-- Set clear constraints -->
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
maxlength="100"
|
||||||
|
pattern="[A-Za-z0-9]+"
|
||||||
|
required
|
||||||
|
aria-describedby="username-hint"
|
||||||
|
/>
|
||||||
|
<small id="username-hint">
|
||||||
|
Letters and numbers only, up to 100 characters
|
||||||
|
</small>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Accessibility Resilience
|
||||||
|
|
||||||
|
**Keyboard navigation**:
|
||||||
|
- All functionality accessible via keyboard
|
||||||
|
- Logical tab order
|
||||||
|
- Focus management in modals
|
||||||
|
- Skip links for long content
|
||||||
|
|
||||||
|
**Screen reader support**:
|
||||||
|
- Proper ARIA labels
|
||||||
|
- Announce dynamic changes (live regions)
|
||||||
|
- Descriptive alt text
|
||||||
|
- Semantic HTML
|
||||||
|
|
||||||
|
**Motion sensitivity**:
|
||||||
|
```css
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
* {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**High contrast mode**:
|
||||||
|
- Test in Windows high contrast mode
|
||||||
|
- Don't rely only on color
|
||||||
|
- Provide alternative visual cues
|
||||||
|
|
||||||
|
### Performance Resilience
|
||||||
|
|
||||||
|
**Slow connections**:
|
||||||
|
- Progressive image loading
|
||||||
|
- Skeleton screens
|
||||||
|
- Optimistic UI updates
|
||||||
|
- Offline support (service workers)
|
||||||
|
|
||||||
|
**Memory leaks**:
|
||||||
|
- Clean up event listeners
|
||||||
|
- Cancel subscriptions
|
||||||
|
- Clear timers/intervals
|
||||||
|
- Abort pending requests on unmount
|
||||||
|
|
||||||
|
**Throttling & Debouncing**:
|
||||||
|
```javascript
|
||||||
|
// Debounce search input
|
||||||
|
const debouncedSearch = debounce(handleSearch, 300);
|
||||||
|
|
||||||
|
// Throttle scroll handler
|
||||||
|
const throttledScroll = throttle(handleScroll, 100);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing Strategies
|
||||||
|
|
||||||
|
**Manual testing**:
|
||||||
|
- Test with extreme data (very long, very short, empty)
|
||||||
|
- Test in different languages
|
||||||
|
- Test offline
|
||||||
|
- Test slow connection (throttle to 3G)
|
||||||
|
- Test with screen reader
|
||||||
|
- Test keyboard-only navigation
|
||||||
|
- Test on old browsers
|
||||||
|
|
||||||
|
**Automated testing**:
|
||||||
|
- Unit tests for edge cases
|
||||||
|
- Integration tests for error scenarios
|
||||||
|
- E2E tests for critical paths
|
||||||
|
- Visual regression tests
|
||||||
|
- Accessibility tests (axe, WAVE)
|
||||||
|
|
||||||
|
**IMPORTANT**: Hardening is about expecting the unexpected. Real users will do things you never imagined.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Assume perfect input (validate everything)
|
||||||
|
- Ignore internationalization (design for global)
|
||||||
|
- Leave error messages generic ("Error occurred")
|
||||||
|
- Forget offline scenarios
|
||||||
|
- Trust client-side validation alone
|
||||||
|
- Use fixed widths for text
|
||||||
|
- Assume English-length text
|
||||||
|
- Block entire interface when one component errors
|
||||||
|
|
||||||
|
## Verify Hardening
|
||||||
|
|
||||||
|
Test thoroughly with edge cases:
|
||||||
|
|
||||||
|
- **Long text**: Try names with 100+ characters
|
||||||
|
- **Emoji**: Use emoji in all text fields
|
||||||
|
- **RTL**: Test with Arabic or Hebrew
|
||||||
|
- **CJK**: Test with Chinese/Japanese/Korean
|
||||||
|
- **Network issues**: Disable internet, throttle connection
|
||||||
|
- **Large datasets**: Test with 1000+ items
|
||||||
|
- **Concurrent actions**: Click submit 10 times rapidly
|
||||||
|
- **Errors**: Force API errors, test all error states
|
||||||
|
- **Empty**: Remove all data, test empty states
|
||||||
|
|
||||||
|
Remember: You're hardening for production reality, not demo perfection. Expect users to input weird data, lose connection mid-flow, and use your product in unexpected ways. Build resilience into every component.
|
||||||
68
.pi/agent/skills/frontend/normalize/SKILL.md
Normal file
68
.pi/agent/skills/frontend/normalize/SKILL.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
---
|
||||||
|
name: normalize
|
||||||
|
description: Audits and realigns UI to match design system standards, spacing, tokens, and patterns. Use when the user mentions consistency, design drift, mismatched styles, tokens, or wants to bring a feature back in line with the system.
|
||||||
|
---
|
||||||
|
|
||||||
|
Analyze and redesign the feature to perfectly match our design system standards, aesthetics, and established patterns.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Plan
|
||||||
|
|
||||||
|
Before making changes, deeply understand the context:
|
||||||
|
|
||||||
|
1. **Discover the design system**: Search for design system documentation, UI guidelines, component libraries, or style guides (grep for "design system", "ui guide", "style guide", etc.). Study it thoroughly until you understand:
|
||||||
|
- Core design principles and aesthetic direction
|
||||||
|
- Target audience and personas
|
||||||
|
- Component patterns and conventions
|
||||||
|
- Design tokens (colors, typography, spacing)
|
||||||
|
|
||||||
|
**CRITICAL**: If something isn't clear, ask. Don't guess at design system principles.
|
||||||
|
|
||||||
|
2. **Analyze the current feature**: Assess what works and what doesn't:
|
||||||
|
- Where does it deviate from design system patterns?
|
||||||
|
- Which inconsistencies are cosmetic vs. functional?
|
||||||
|
- What's the root cause—missing tokens, one-off implementations, or conceptual misalignment?
|
||||||
|
|
||||||
|
3. **Create a normalization plan**: Define specific changes that will align the feature with the design system:
|
||||||
|
- Which components can be replaced with design system equivalents?
|
||||||
|
- Which styles need to use design tokens instead of hard-coded values?
|
||||||
|
- How can UX patterns match established user flows?
|
||||||
|
|
||||||
|
**IMPORTANT**: Great design is effective design. Prioritize UX consistency and usability over visual polish alone. Think through the best possible experience for your use case and personas first.
|
||||||
|
|
||||||
|
## Execute
|
||||||
|
|
||||||
|
Systematically address all inconsistencies across these dimensions:
|
||||||
|
|
||||||
|
- **Typography**: Use design system fonts, sizes, weights, and line heights. Replace hard-coded values with typographic tokens or classes.
|
||||||
|
- **Color & Theme**: Apply design system color tokens. Remove one-off color choices that break the palette.
|
||||||
|
- **Spacing & Layout**: Use spacing tokens (margins, padding, gaps). Align with grid systems and layout patterns used elsewhere.
|
||||||
|
- **Components**: Replace custom implementations with design system components. Ensure props and variants match established patterns.
|
||||||
|
- **Motion & Interaction**: Match animation timing, easing, and interaction patterns to other features.
|
||||||
|
- **Responsive Behavior**: Ensure breakpoints and responsive patterns align with design system standards.
|
||||||
|
- **Accessibility**: Verify contrast ratios, focus states, ARIA labels match design system requirements.
|
||||||
|
- **Progressive Disclosure**: Match information hierarchy and complexity management to established patterns.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Create new one-off components when design system equivalents exist
|
||||||
|
- Hard-code values that should use design tokens
|
||||||
|
- Introduce new patterns that diverge from the design system
|
||||||
|
- Compromise accessibility for visual consistency
|
||||||
|
|
||||||
|
This is not an exhaustive list—apply judgment to identify all areas needing normalization.
|
||||||
|
|
||||||
|
## Clean Up
|
||||||
|
|
||||||
|
After normalization, ensure code quality:
|
||||||
|
|
||||||
|
- **Consolidate reusable components**: If you created new components that should be shared, move them to the design system or shared UI component path.
|
||||||
|
- **Remove orphaned code**: Delete unused implementations, styles, or files made obsolete by normalization.
|
||||||
|
- **Verify quality**: Lint, type-check, and test according to repository guidelines. Ensure normalization didn't introduce regressions.
|
||||||
|
- **Ensure DRYness**: Look for duplication introduced during refactoring and consolidate.
|
||||||
|
|
||||||
|
Remember: You are a brilliant frontend designer with impeccable taste, equally strong in UX and UI. Your attention to detail and eye for end-to-end user experience is world class. Execute with precision and thoroughness.
|
||||||
243
.pi/agent/skills/frontend/onboard/SKILL.md
Normal file
243
.pi/agent/skills/frontend/onboard/SKILL.md
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
---
|
||||||
|
name: onboard
|
||||||
|
description: Designs and improves onboarding flows, empty states, and first-run experiences to help users reach value quickly. Use when the user mentions onboarding, first-time users, empty states, activation, getting started, or new user flows.
|
||||||
|
---
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: the "aha moment" you want users to reach, and users' experience level.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Create or improve onboarding experiences that help users understand, adopt, and succeed with the product quickly.
|
||||||
|
|
||||||
|
## Assess Onboarding Needs
|
||||||
|
|
||||||
|
Understand what users need to learn and why:
|
||||||
|
|
||||||
|
1. **Identify the challenge**:
|
||||||
|
- What are users trying to accomplish?
|
||||||
|
- What's confusing or unclear about current experience?
|
||||||
|
- Where do users get stuck or drop off?
|
||||||
|
- What's the "aha moment" we want users to reach?
|
||||||
|
|
||||||
|
2. **Understand the users**:
|
||||||
|
- What's their experience level? (Beginners, power users, mixed?)
|
||||||
|
- What's their motivation? (Excited and exploring? Required by work?)
|
||||||
|
- What's their time commitment? (5 minutes? 30 minutes?)
|
||||||
|
- What alternatives do they know? (Coming from competitor? New to category?)
|
||||||
|
|
||||||
|
3. **Define success**:
|
||||||
|
- What's the minimum users need to learn to be successful?
|
||||||
|
- What's the key action we want them to take? (First project? First invite?)
|
||||||
|
- How do we know onboarding worked? (Completion rate? Time to value?)
|
||||||
|
|
||||||
|
**CRITICAL**: Onboarding should get users to value as quickly as possible, not teach everything possible.
|
||||||
|
|
||||||
|
## Onboarding Principles
|
||||||
|
|
||||||
|
Follow these core principles:
|
||||||
|
|
||||||
|
### Show, Don't Tell
|
||||||
|
- Demonstrate with working examples, not just descriptions
|
||||||
|
- Provide real functionality in onboarding, not separate tutorial mode
|
||||||
|
- Use progressive disclosure - teach one thing at a time
|
||||||
|
|
||||||
|
### Make It Optional (When Possible)
|
||||||
|
- Let experienced users skip onboarding
|
||||||
|
- Don't block access to product
|
||||||
|
- Provide "Skip" or "I'll explore on my own" options
|
||||||
|
|
||||||
|
### Time to Value
|
||||||
|
- Get users to their "aha moment" ASAP
|
||||||
|
- Front-load most important concepts
|
||||||
|
- Teach 20% that delivers 80% of value
|
||||||
|
- Save advanced features for contextual discovery
|
||||||
|
|
||||||
|
### Context Over Ceremony
|
||||||
|
- Teach features when users need them, not upfront
|
||||||
|
- Empty states are onboarding opportunities
|
||||||
|
- Tooltips and hints at point of use
|
||||||
|
|
||||||
|
### Respect User Intelligence
|
||||||
|
- Don't patronize or over-explain
|
||||||
|
- Be concise and clear
|
||||||
|
- Assume users can figure out standard patterns
|
||||||
|
|
||||||
|
## Design Onboarding Experiences
|
||||||
|
|
||||||
|
Create appropriate onboarding for the context:
|
||||||
|
|
||||||
|
### Initial Product Onboarding
|
||||||
|
|
||||||
|
**Welcome Screen**:
|
||||||
|
- Clear value proposition (what is this product?)
|
||||||
|
- What users will learn/accomplish
|
||||||
|
- Time estimate (honest about commitment)
|
||||||
|
- Option to skip (for experienced users)
|
||||||
|
|
||||||
|
**Account Setup**:
|
||||||
|
- Minimal required information (collect more later)
|
||||||
|
- Explain why you're asking for each piece of information
|
||||||
|
- Smart defaults where possible
|
||||||
|
- Social login when appropriate
|
||||||
|
|
||||||
|
**Core Concept Introduction**:
|
||||||
|
- Introduce 1-3 core concepts (not everything)
|
||||||
|
- Use simple language and examples
|
||||||
|
- Interactive when possible (do, don't just read)
|
||||||
|
- Progress indication (step 1 of 3)
|
||||||
|
|
||||||
|
**First Success**:
|
||||||
|
- Guide users to accomplish something real
|
||||||
|
- Pre-populated examples or templates
|
||||||
|
- Celebrate completion (but don't overdo it)
|
||||||
|
- Clear next steps
|
||||||
|
|
||||||
|
### Feature Discovery & Adoption
|
||||||
|
|
||||||
|
**Empty States**:
|
||||||
|
Instead of blank space, show:
|
||||||
|
- What will appear here (description + screenshot/illustration)
|
||||||
|
- Why it's valuable
|
||||||
|
- Clear CTA to create first item
|
||||||
|
- Example or template option
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
No projects yet
|
||||||
|
Projects help you organize your work and collaborate with your team.
|
||||||
|
[Create your first project] or [Start from template]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Contextual Tooltips**:
|
||||||
|
- Appear at relevant moment (first time user sees feature)
|
||||||
|
- Point directly at relevant UI element
|
||||||
|
- Brief explanation + benefit
|
||||||
|
- Dismissable (with "Don't show again" option)
|
||||||
|
- Optional "Learn more" link
|
||||||
|
|
||||||
|
**Feature Announcements**:
|
||||||
|
- Highlight new features when they're released
|
||||||
|
- Show what's new and why it matters
|
||||||
|
- Let users try immediately
|
||||||
|
- Dismissable
|
||||||
|
|
||||||
|
**Progressive Onboarding**:
|
||||||
|
- Teach features when users encounter them
|
||||||
|
- Badges or indicators on new/unused features
|
||||||
|
- Unlock complexity gradually (don't show all options immediately)
|
||||||
|
|
||||||
|
### Guided Tours & Walkthroughs
|
||||||
|
|
||||||
|
**When to use**:
|
||||||
|
- Complex interfaces with many features
|
||||||
|
- Significant changes to existing product
|
||||||
|
- Industry-specific tools needing domain knowledge
|
||||||
|
|
||||||
|
**How to design**:
|
||||||
|
- Spotlight specific UI elements (dim rest of page)
|
||||||
|
- Keep steps short (3-7 steps max per tour)
|
||||||
|
- Allow users to click through tour freely
|
||||||
|
- Include "Skip tour" option
|
||||||
|
- Make replayable (help menu)
|
||||||
|
|
||||||
|
**Best practices**:
|
||||||
|
- Interactive > passive (let users click real buttons)
|
||||||
|
- Focus on workflow, not features ("Create a project" not "This is the project button")
|
||||||
|
- Provide sample data so actions work
|
||||||
|
|
||||||
|
### Interactive Tutorials
|
||||||
|
|
||||||
|
**When to use**:
|
||||||
|
- Users need hands-on practice
|
||||||
|
- Concepts are complex or unfamiliar
|
||||||
|
- High stakes (better to practice in safe environment)
|
||||||
|
|
||||||
|
**How to design**:
|
||||||
|
- Sandbox environment with sample data
|
||||||
|
- Clear objectives ("Create a chart showing sales by region")
|
||||||
|
- Step-by-step guidance
|
||||||
|
- Validation (confirm they did it right)
|
||||||
|
- Graduation moment (you're ready!)
|
||||||
|
|
||||||
|
### Documentation & Help
|
||||||
|
|
||||||
|
**In-product help**:
|
||||||
|
- Contextual help links throughout interface
|
||||||
|
- Keyboard shortcut reference
|
||||||
|
- Search-able help center
|
||||||
|
- Video tutorials for complex workflows
|
||||||
|
|
||||||
|
**Help patterns**:
|
||||||
|
- `?` icon near complex features
|
||||||
|
- "Learn more" links in tooltips
|
||||||
|
- Keyboard shortcut hints (`⌘K` shown on search box)
|
||||||
|
|
||||||
|
## Empty State Design
|
||||||
|
|
||||||
|
Every empty state needs:
|
||||||
|
|
||||||
|
### What Will Be Here
|
||||||
|
"Your recent projects will appear here"
|
||||||
|
|
||||||
|
### Why It Matters
|
||||||
|
"Projects help you organize your work and collaborate with your team"
|
||||||
|
|
||||||
|
### How to Get Started
|
||||||
|
[Create project] or [Import from template]
|
||||||
|
|
||||||
|
### Visual Interest
|
||||||
|
Illustration or icon (not just text on blank page)
|
||||||
|
|
||||||
|
### Contextual Help
|
||||||
|
"Need help getting started? [Watch 2-min tutorial]"
|
||||||
|
|
||||||
|
**Empty state types**:
|
||||||
|
- **First use**: Never used this feature (emphasize value, provide template)
|
||||||
|
- **User cleared**: Intentionally deleted everything (light touch, easy to recreate)
|
||||||
|
- **No results**: Search or filter returned nothing (suggest different query, clear filters)
|
||||||
|
- **No permissions**: Can't access (explain why, how to get access)
|
||||||
|
- **Error state**: Failed to load (explain what happened, retry option)
|
||||||
|
|
||||||
|
## Implementation Patterns
|
||||||
|
|
||||||
|
### Technical approaches:
|
||||||
|
|
||||||
|
**Tooltip libraries**: Tippy.js, Popper.js
|
||||||
|
**Tour libraries**: Intro.js, Shepherd.js, React Joyride
|
||||||
|
**Modal patterns**: Focus trap, backdrop, ESC to close
|
||||||
|
**Progress tracking**: LocalStorage for "seen" states
|
||||||
|
**Analytics**: Track completion, drop-off points
|
||||||
|
|
||||||
|
**Storage patterns**:
|
||||||
|
```javascript
|
||||||
|
// Track which onboarding steps user has seen
|
||||||
|
localStorage.setItem('onboarding-completed', 'true');
|
||||||
|
localStorage.setItem('feature-tooltip-seen-reports', 'true');
|
||||||
|
```
|
||||||
|
|
||||||
|
**IMPORTANT**: Don't show same onboarding twice (annoying). Track completion and respect dismissals.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Force users through long onboarding before they can use product
|
||||||
|
- Patronize users with obvious explanations
|
||||||
|
- Show same tooltip repeatedly (respect dismissals)
|
||||||
|
- Block all UI during tour (let users explore)
|
||||||
|
- Create separate tutorial mode disconnected from real product
|
||||||
|
- Overwhelm with information upfront (progressive disclosure!)
|
||||||
|
- Hide "Skip" or make it hard to find
|
||||||
|
- Forget about returning users (don't show initial onboarding again)
|
||||||
|
|
||||||
|
## Verify Onboarding Quality
|
||||||
|
|
||||||
|
Test with real users:
|
||||||
|
|
||||||
|
- **Time to completion**: Can users complete onboarding quickly?
|
||||||
|
- **Comprehension**: Do users understand after completing?
|
||||||
|
- **Action**: Do users take desired next step?
|
||||||
|
- **Skip rate**: Are too many users skipping? (Maybe it's too long/not valuable)
|
||||||
|
- **Completion rate**: Are users completing? (If low, simplify)
|
||||||
|
- **Time to value**: How long until users get first value?
|
||||||
|
|
||||||
|
Remember: You're a product educator with excellent teaching instincts. Get users to their "aha moment" as quickly as possible. Teach the essential, make it contextual, respect user time and intelligence.
|
||||||
263
.pi/agent/skills/frontend/optimize/SKILL.md
Normal file
263
.pi/agent/skills/frontend/optimize/SKILL.md
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
---
|
||||||
|
name: optimize
|
||||||
|
description: Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.
|
||||||
|
---
|
||||||
|
|
||||||
|
Identify and fix performance issues to create faster, smoother user experiences.
|
||||||
|
|
||||||
|
## Assess Performance Issues
|
||||||
|
|
||||||
|
Understand current performance and identify problems:
|
||||||
|
|
||||||
|
1. **Measure current state**:
|
||||||
|
- **Core Web Vitals**: LCP, FID/INP, CLS scores
|
||||||
|
- **Load time**: Time to interactive, first contentful paint
|
||||||
|
- **Bundle size**: JavaScript, CSS, image sizes
|
||||||
|
- **Runtime performance**: Frame rate, memory usage, CPU usage
|
||||||
|
- **Network**: Request count, payload sizes, waterfall
|
||||||
|
|
||||||
|
2. **Identify bottlenecks**:
|
||||||
|
- What's slow? (Initial load? Interactions? Animations?)
|
||||||
|
- What's causing it? (Large images? Expensive JavaScript? Layout thrashing?)
|
||||||
|
- How bad is it? (Perceivable? Annoying? Blocking?)
|
||||||
|
- Who's affected? (All users? Mobile only? Slow connections?)
|
||||||
|
|
||||||
|
**CRITICAL**: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
|
||||||
|
|
||||||
|
## Optimization Strategy
|
||||||
|
|
||||||
|
Create systematic improvement plan:
|
||||||
|
|
||||||
|
### Loading Performance
|
||||||
|
|
||||||
|
**Optimize Images**:
|
||||||
|
- Use modern formats (WebP, AVIF)
|
||||||
|
- Proper sizing (don't load 3000px image for 300px display)
|
||||||
|
- Lazy loading for below-fold images
|
||||||
|
- Responsive images (`srcset`, `picture` element)
|
||||||
|
- Compress images (80-85% quality is usually imperceptible)
|
||||||
|
- Use CDN for faster delivery
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img
|
||||||
|
src="hero.webp"
|
||||||
|
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
|
||||||
|
sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
|
||||||
|
loading="lazy"
|
||||||
|
alt="Hero image"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Reduce JavaScript Bundle**:
|
||||||
|
- Code splitting (route-based, component-based)
|
||||||
|
- Tree shaking (remove unused code)
|
||||||
|
- Remove unused dependencies
|
||||||
|
- Lazy load non-critical code
|
||||||
|
- Use dynamic imports for large components
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Lazy load heavy component
|
||||||
|
const HeavyChart = lazy(() => import('./HeavyChart'));
|
||||||
|
```
|
||||||
|
|
||||||
|
**Optimize CSS**:
|
||||||
|
- Remove unused CSS
|
||||||
|
- Critical CSS inline, rest async
|
||||||
|
- Minimize CSS files
|
||||||
|
- Use CSS containment for independent regions
|
||||||
|
|
||||||
|
**Optimize Fonts**:
|
||||||
|
- Use `font-display: swap` or `optional`
|
||||||
|
- Subset fonts (only characters you need)
|
||||||
|
- Preload critical fonts
|
||||||
|
- Use system fonts when appropriate
|
||||||
|
- Limit font weights loaded
|
||||||
|
|
||||||
|
```css
|
||||||
|
@font-face {
|
||||||
|
font-family: 'CustomFont';
|
||||||
|
src: url('/fonts/custom.woff2') format('woff2');
|
||||||
|
font-display: swap; /* Show fallback immediately */
|
||||||
|
unicode-range: U+0020-007F; /* Basic Latin only */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Optimize Loading Strategy**:
|
||||||
|
- Critical resources first (async/defer non-critical)
|
||||||
|
- Preload critical assets
|
||||||
|
- Prefetch likely next pages
|
||||||
|
- Service worker for offline/caching
|
||||||
|
- HTTP/2 or HTTP/3 for multiplexing
|
||||||
|
|
||||||
|
### Rendering Performance
|
||||||
|
|
||||||
|
**Avoid Layout Thrashing**:
|
||||||
|
```javascript
|
||||||
|
// ❌ Bad: Alternating reads and writes (causes reflows)
|
||||||
|
elements.forEach(el => {
|
||||||
|
const height = el.offsetHeight; // Read (forces layout)
|
||||||
|
el.style.height = height * 2; // Write
|
||||||
|
});
|
||||||
|
|
||||||
|
// ✅ Good: Batch reads, then batch writes
|
||||||
|
const heights = elements.map(el => el.offsetHeight); // All reads
|
||||||
|
elements.forEach((el, i) => {
|
||||||
|
el.style.height = heights[i] * 2; // All writes
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
**Optimize Rendering**:
|
||||||
|
- Use CSS `contain` property for independent regions
|
||||||
|
- Minimize DOM depth (flatter is faster)
|
||||||
|
- Reduce DOM size (fewer elements)
|
||||||
|
- Use `content-visibility: auto` for long lists
|
||||||
|
- Virtual scrolling for very long lists (react-window, react-virtualized)
|
||||||
|
|
||||||
|
**Reduce Paint & Composite**:
|
||||||
|
- Use `transform` and `opacity` for animations (GPU-accelerated)
|
||||||
|
- Avoid animating layout properties (width, height, top, left)
|
||||||
|
- Use `will-change` sparingly for known expensive operations
|
||||||
|
- Minimize paint areas (smaller is faster)
|
||||||
|
|
||||||
|
### Animation Performance
|
||||||
|
|
||||||
|
**GPU Acceleration**:
|
||||||
|
```css
|
||||||
|
/* ✅ GPU-accelerated (fast) */
|
||||||
|
.animated {
|
||||||
|
transform: translateX(100px);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ❌ CPU-bound (slow) */
|
||||||
|
.animated {
|
||||||
|
left: 100px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Smooth 60fps**:
|
||||||
|
- Target 16ms per frame (60fps)
|
||||||
|
- Use `requestAnimationFrame` for JS animations
|
||||||
|
- Debounce/throttle scroll handlers
|
||||||
|
- Use CSS animations when possible
|
||||||
|
- Avoid long-running JavaScript during animations
|
||||||
|
|
||||||
|
**Intersection Observer**:
|
||||||
|
```javascript
|
||||||
|
// Efficiently detect when elements enter viewport
|
||||||
|
const observer = new IntersectionObserver((entries) => {
|
||||||
|
entries.forEach(entry => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
// Element is visible, lazy load or animate
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### React/Framework Optimization
|
||||||
|
|
||||||
|
**React-specific**:
|
||||||
|
- Use `memo()` for expensive components
|
||||||
|
- `useMemo()` and `useCallback()` for expensive computations
|
||||||
|
- Virtualize long lists
|
||||||
|
- Code split routes
|
||||||
|
- Avoid inline function creation in render
|
||||||
|
- Use React DevTools Profiler
|
||||||
|
|
||||||
|
**Framework-agnostic**:
|
||||||
|
- Minimize re-renders
|
||||||
|
- Debounce expensive operations
|
||||||
|
- Memoize computed values
|
||||||
|
- Lazy load routes and components
|
||||||
|
|
||||||
|
### Network Optimization
|
||||||
|
|
||||||
|
**Reduce Requests**:
|
||||||
|
- Combine small files
|
||||||
|
- Use SVG sprites for icons
|
||||||
|
- Inline small critical assets
|
||||||
|
- Remove unused third-party scripts
|
||||||
|
|
||||||
|
**Optimize APIs**:
|
||||||
|
- Use pagination (don't load everything)
|
||||||
|
- GraphQL to request only needed fields
|
||||||
|
- Response compression (gzip, brotli)
|
||||||
|
- HTTP caching headers
|
||||||
|
- CDN for static assets
|
||||||
|
|
||||||
|
**Optimize for Slow Connections**:
|
||||||
|
- Adaptive loading based on connection (navigator.connection)
|
||||||
|
- Optimistic UI updates
|
||||||
|
- Request prioritization
|
||||||
|
- Progressive enhancement
|
||||||
|
|
||||||
|
## Core Web Vitals Optimization
|
||||||
|
|
||||||
|
### Largest Contentful Paint (LCP < 2.5s)
|
||||||
|
- Optimize hero images
|
||||||
|
- Inline critical CSS
|
||||||
|
- Preload key resources
|
||||||
|
- Use CDN
|
||||||
|
- Server-side rendering
|
||||||
|
|
||||||
|
### First Input Delay (FID < 100ms) / INP (< 200ms)
|
||||||
|
- Break up long tasks
|
||||||
|
- Defer non-critical JavaScript
|
||||||
|
- Use web workers for heavy computation
|
||||||
|
- Reduce JavaScript execution time
|
||||||
|
|
||||||
|
### Cumulative Layout Shift (CLS < 0.1)
|
||||||
|
- Set dimensions on images and videos
|
||||||
|
- Don't inject content above existing content
|
||||||
|
- Use `aspect-ratio` CSS property
|
||||||
|
- Reserve space for ads/embeds
|
||||||
|
- Avoid animations that cause layout shifts
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Reserve space for image */
|
||||||
|
.image-container {
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Performance Monitoring
|
||||||
|
|
||||||
|
**Tools to use**:
|
||||||
|
- Chrome DevTools (Lighthouse, Performance panel)
|
||||||
|
- WebPageTest
|
||||||
|
- Core Web Vitals (Chrome UX Report)
|
||||||
|
- Bundle analyzers (webpack-bundle-analyzer)
|
||||||
|
- Performance monitoring (Sentry, DataDog, New Relic)
|
||||||
|
|
||||||
|
**Key metrics**:
|
||||||
|
- LCP, FID/INP, CLS (Core Web Vitals)
|
||||||
|
- Time to Interactive (TTI)
|
||||||
|
- First Contentful Paint (FCP)
|
||||||
|
- Total Blocking Time (TBT)
|
||||||
|
- Bundle size
|
||||||
|
- Request count
|
||||||
|
|
||||||
|
**IMPORTANT**: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Optimize without measuring (premature optimization)
|
||||||
|
- Sacrifice accessibility for performance
|
||||||
|
- Break functionality while optimizing
|
||||||
|
- Use `will-change` everywhere (creates new layers, uses memory)
|
||||||
|
- Lazy load above-fold content
|
||||||
|
- Optimize micro-optimizations while ignoring major issues (optimize the biggest bottleneck first)
|
||||||
|
- Forget about mobile performance (often slower devices, slower connections)
|
||||||
|
|
||||||
|
## Verify Improvements
|
||||||
|
|
||||||
|
Test that optimizations worked:
|
||||||
|
|
||||||
|
- **Before/after metrics**: Compare Lighthouse scores
|
||||||
|
- **Real user monitoring**: Track improvements for real users
|
||||||
|
- **Different devices**: Test on low-end Android, not just flagship iPhone
|
||||||
|
- **Slow connections**: Throttle to 3G, test experience
|
||||||
|
- **No regressions**: Ensure functionality still works
|
||||||
|
- **User perception**: Does it *feel* faster?
|
||||||
|
|
||||||
|
Remember: Performance is a feature. Fast experiences feel more responsive, more polished, more professional. Optimize systematically, measure ruthlessly, and prioritize user-perceived performance.
|
||||||
139
.pi/agent/skills/frontend/overdrive/SKILL.md
Normal file
139
.pi/agent/skills/frontend/overdrive/SKILL.md
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
---
|
||||||
|
name: overdrive
|
||||||
|
description: Pushes interfaces past conventional limits with technically ambitious implementations — shaders, spring physics, scroll-driven reveals, 60fps animations. Use when the user wants to wow, impress, go all-out, or make something that feels extraordinary.
|
||||||
|
---
|
||||||
|
|
||||||
|
Start your response with:
|
||||||
|
|
||||||
|
```
|
||||||
|
──────────── ⚡ OVERDRIVE ─────────────
|
||||||
|
》》》 Entering overdrive mode...
|
||||||
|
```
|
||||||
|
|
||||||
|
Push an interface past conventional limits. This isn't just about visual effects — it's about using the full power of the browser to make any part of an interface feel extraordinary: a table that handles a million rows, a dialog that morphs from its trigger, a form that validates in real-time with streaming feedback, a page transition that feels cinematic.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
**EXTRA IMPORTANT FOR THIS SKILL**: Context determines what "extraordinary" means. A particle system on a creative portfolio is impressive. The same particle system on a settings page is embarrassing. But a settings page with instant optimistic saves and animated state transitions? That's extraordinary too. Understand the project's personality and goals before deciding what's appropriate.
|
||||||
|
|
||||||
|
### Propose Before Building
|
||||||
|
|
||||||
|
This skill has the highest potential to misfire. Do NOT jump straight into implementation. You MUST:
|
||||||
|
|
||||||
|
1. **Think through 2-3 different directions** — consider different techniques, levels of ambition, and aesthetic approaches. For each direction, briefly describe what the result would look and feel like.
|
||||||
|
2. **ask the user directly to clarify what you cannot infer.** to present these directions and get the user's pick before writing any code. Explain trade-offs (browser support, performance cost, complexity).
|
||||||
|
3. Only proceed with the direction the user confirms.
|
||||||
|
|
||||||
|
Skipping this step risks building something embarrassing that needs to be thrown away.
|
||||||
|
|
||||||
|
### Iterate with Browser Automation
|
||||||
|
|
||||||
|
Technically ambitious effects almost never work on the first try. You MUST actively use browser automation tools to preview your work, visually verify the result, and iterate. Do not assume the effect looks right — check it. Expect multiple rounds of refinement. The gap between "technically works" and "looks extraordinary" is closed through visual iteration, not code alone.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess What "Extraordinary" Means Here
|
||||||
|
|
||||||
|
The right kind of technical ambition depends entirely on what you're working with. Before choosing a technique, ask: **what would make a user of THIS specific interface say "wow, that's nice"?**
|
||||||
|
|
||||||
|
### For visual/marketing surfaces
|
||||||
|
Pages, hero sections, landing pages, portfolios — the "wow" is often sensory: a scroll-driven reveal, a shader background, a cinematic page transition, generative art that responds to the cursor.
|
||||||
|
|
||||||
|
### For functional UI
|
||||||
|
Tables, forms, dialogs, navigation — the "wow" is in how it FEELS: a dialog that morphs from the button that triggered it via View Transitions, a data table that renders 100k rows at 60fps via virtual scrolling, a form with streaming validation that feels instant, drag-and-drop with spring physics.
|
||||||
|
|
||||||
|
### For performance-critical UI
|
||||||
|
The "wow" is invisible but felt: a search that filters 50k items without a flicker, a complex form that never blocks the main thread, an image editor that processes in near-real-time. The interface just never hesitates.
|
||||||
|
|
||||||
|
### For data-heavy interfaces
|
||||||
|
Charts and dashboards — the "wow" is in fluidity: GPU-accelerated rendering via Canvas/WebGL for massive datasets, animated transitions between data states, force-directed graph layouts that settle naturally.
|
||||||
|
|
||||||
|
**The common thread**: something about the implementation goes beyond what users expect from a web interface. The technique serves the experience, not the other way around.
|
||||||
|
|
||||||
|
## The Toolkit
|
||||||
|
|
||||||
|
Organized by what you're trying to achieve, not by technology name.
|
||||||
|
|
||||||
|
### Make transitions feel cinematic
|
||||||
|
- **View Transitions API** (same-document: all browsers; cross-document: no Firefox) — shared element morphing between states. A list item expanding into a detail page. A button morphing into a dialog. This is the closest thing to native FLIP animations.
|
||||||
|
- **`@starting-style`** (all browsers) — animate elements from `display: none` to visible with CSS only, including entry keyframes
|
||||||
|
- **Spring physics** — natural motion with mass, tension, and damping instead of cubic-bezier. Libraries: motion (formerly Framer Motion), GSAP, or roll your own spring solver.
|
||||||
|
|
||||||
|
### Tie animation to scroll position
|
||||||
|
- **Scroll-driven animations** (`animation-timeline: scroll()`) — CSS-only, no JS. Parallax, progress bars, reveal sequences all driven by scroll position. (Chrome/Edge/Safari; Firefox: flag only — always provide a static fallback)
|
||||||
|
|
||||||
|
### Render beyond CSS
|
||||||
|
- **WebGL** (all browsers) — shader effects, post-processing, particle systems. Libraries: Three.js, OGL (lightweight), regl. Use for effects CSS can't express.
|
||||||
|
- **WebGPU** (Chrome/Edge; Safari partial; Firefox: flag only) — next-gen GPU compute. More powerful than WebGL but limited browser support. Always fall back to WebGL2.
|
||||||
|
- **Canvas 2D / OffscreenCanvas** — custom rendering, pixel manipulation, or moving heavy rendering off the main thread entirely via Web Workers + OffscreenCanvas.
|
||||||
|
- **SVG filter chains** — displacement maps, turbulence, morphology for organic distortion effects. CSS-animatable.
|
||||||
|
|
||||||
|
### Make data feel alive
|
||||||
|
- **Virtual scrolling** — render only visible rows for tables/lists with tens of thousands of items. No library required for simple cases; TanStack Virtual for complex ones.
|
||||||
|
- **GPU-accelerated charts** — Canvas or WebGL-rendered data visualization for datasets too large for SVG/DOM. Libraries: deck.gl, regl-based custom renderers.
|
||||||
|
- **Animated data transitions** — morph between chart states rather than replacing. D3's `transition()` or View Transitions for DOM-based charts.
|
||||||
|
|
||||||
|
### Animate complex properties
|
||||||
|
- **`@property`** (all browsers) — register custom CSS properties with types, enabling animation of gradients, colors, and complex values that CSS can't normally interpolate.
|
||||||
|
- **Web Animations API** (all browsers) — JavaScript-driven animations with the performance of CSS. Composable, cancellable, reversible. The foundation for complex choreography.
|
||||||
|
|
||||||
|
### Push performance boundaries
|
||||||
|
- **Web Workers** — move computation off the main thread. Heavy data processing, image manipulation, search indexing — anything that would cause jank.
|
||||||
|
- **OffscreenCanvas** — render in a Worker thread. The main thread stays free while complex visuals render in the background.
|
||||||
|
- **WASM** — near-native performance for computation-heavy features. Image processing, physics simulations, codecs.
|
||||||
|
|
||||||
|
### Interact with the device
|
||||||
|
- **Web Audio API** — spatial audio, audio-reactive visualizations, sonic feedback. Requires user gesture to start.
|
||||||
|
- **Device APIs** — orientation, ambient light, geolocation. Use sparingly and always with user permission.
|
||||||
|
|
||||||
|
**NOTE**: This skill is about enhancing how an interface FEELS, not changing what a product DOES. Adding real-time collaboration, offline support, or new backend capabilities are product decisions, not UI enhancements. Focus on making existing features feel extraordinary.
|
||||||
|
|
||||||
|
## Implement with Discipline
|
||||||
|
|
||||||
|
### Progressive enhancement is non-negotiable
|
||||||
|
|
||||||
|
Every technique must degrade gracefully. The experience without the enhancement must still be good.
|
||||||
|
|
||||||
|
```css
|
||||||
|
@supports (animation-timeline: scroll()) {
|
||||||
|
.hero { animation-timeline: scroll(); }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
if ('gpu' in navigator) { /* WebGPU */ }
|
||||||
|
else if (canvas.getContext('webgl2')) { /* WebGL2 fallback */ }
|
||||||
|
/* CSS-only fallback must still look good */
|
||||||
|
```
|
||||||
|
|
||||||
|
### Performance rules
|
||||||
|
|
||||||
|
- Target 60fps. If dropping below 50, simplify.
|
||||||
|
- Respect `prefers-reduced-motion` — always. Provide a beautiful static alternative.
|
||||||
|
- Lazy-initialize heavy resources (WebGL contexts, WASM modules) only when near viewport.
|
||||||
|
- Pause off-screen rendering. Kill what you can't see.
|
||||||
|
- Test on real mid-range devices, not just your development machine.
|
||||||
|
|
||||||
|
### Polish is the difference
|
||||||
|
|
||||||
|
The gap between "cool" and "extraordinary" is in the last 20% of refinement: the easing curve on a spring animation, the timing offset in a staggered reveal, the subtle secondary motion that makes a transition feel physical. Don't ship the first version that works — ship the version that feels inevitable.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Ignore `prefers-reduced-motion` — this is an accessibility requirement, not a suggestion
|
||||||
|
- Ship effects that cause jank on mid-range devices
|
||||||
|
- Use bleeding-edge APIs without a functional fallback
|
||||||
|
- Add sound without explicit user opt-in
|
||||||
|
- Use technical ambition to mask weak design fundamentals — fix those first with other skills
|
||||||
|
- Layer multiple competing extraordinary moments — focus creates impact, excess creates noise
|
||||||
|
|
||||||
|
## Verify the Result
|
||||||
|
|
||||||
|
- **The wow test**: Show it to someone who hasn't seen it. Do they react?
|
||||||
|
- **The removal test**: Take it away. Does the experience feel diminished, or does nobody notice?
|
||||||
|
- **The device test**: Run it on a phone, a tablet, a Chromebook. Still smooth?
|
||||||
|
- **The accessibility test**: Enable reduced motion. Still beautiful?
|
||||||
|
- **The context test**: Does this make sense for THIS brand and audience?
|
||||||
|
|
||||||
|
Remember: "Technically extraordinary" isn't about using the newest API. It's about making an interface do something users didn't think a website could do.
|
||||||
200
.pi/agent/skills/frontend/polish/SKILL.md
Normal file
200
.pi/agent/skills/frontend/polish/SKILL.md
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
---
|
||||||
|
name: polish
|
||||||
|
description: Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.
|
||||||
|
---
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first. Additionally gather: quality bar (MVP vs flagship).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Perform a meticulous final pass to catch all the small details that separate good work from great work. The difference between shipped and polished.
|
||||||
|
|
||||||
|
## Pre-Polish Assessment
|
||||||
|
|
||||||
|
Understand the current state and goals:
|
||||||
|
|
||||||
|
1. **Review completeness**:
|
||||||
|
- Is it functionally complete?
|
||||||
|
- Are there known issues to preserve (mark with TODOs)?
|
||||||
|
- What's the quality bar? (MVP vs flagship feature?)
|
||||||
|
- When does it ship? (How much time for polish?)
|
||||||
|
|
||||||
|
2. **Identify polish areas**:
|
||||||
|
- Visual inconsistencies
|
||||||
|
- Spacing and alignment issues
|
||||||
|
- Interaction state gaps
|
||||||
|
- Copy inconsistencies
|
||||||
|
- Edge cases and error states
|
||||||
|
- Loading and transition smoothness
|
||||||
|
|
||||||
|
**CRITICAL**: Polish is the last step, not the first. Don't polish work that's not functionally complete.
|
||||||
|
|
||||||
|
## Polish Systematically
|
||||||
|
|
||||||
|
Work through these dimensions methodically:
|
||||||
|
|
||||||
|
### Visual Alignment & Spacing
|
||||||
|
|
||||||
|
- **Pixel-perfect alignment**: Everything lines up to grid
|
||||||
|
- **Consistent spacing**: All gaps use spacing scale (no random 13px gaps)
|
||||||
|
- **Optical alignment**: Adjust for visual weight (icons may need offset for optical centering)
|
||||||
|
- **Responsive consistency**: Spacing and alignment work at all breakpoints
|
||||||
|
- **Grid adherence**: Elements snap to baseline grid
|
||||||
|
|
||||||
|
**Check**:
|
||||||
|
- Enable grid overlay and verify alignment
|
||||||
|
- Check spacing with browser inspector
|
||||||
|
- Test at multiple viewport sizes
|
||||||
|
- Look for elements that "feel" off
|
||||||
|
|
||||||
|
### Typography Refinement
|
||||||
|
|
||||||
|
- **Hierarchy consistency**: Same elements use same sizes/weights throughout
|
||||||
|
- **Line length**: 45-75 characters for body text
|
||||||
|
- **Line height**: Appropriate for font size and context
|
||||||
|
- **Widows & orphans**: No single words on last line
|
||||||
|
- **Hyphenation**: Appropriate for language and column width
|
||||||
|
- **Kerning**: Adjust letter spacing where needed (especially headlines)
|
||||||
|
- **Font loading**: No FOUT/FOIT flashes
|
||||||
|
|
||||||
|
### Color & Contrast
|
||||||
|
|
||||||
|
- **Contrast ratios**: All text meets WCAG standards
|
||||||
|
- **Consistent token usage**: No hard-coded colors, all use design tokens
|
||||||
|
- **Theme consistency**: Works in all theme variants
|
||||||
|
- **Color meaning**: Same colors mean same things throughout
|
||||||
|
- **Accessible focus**: Focus indicators visible with sufficient contrast
|
||||||
|
- **Tinted neutrals**: No pure gray or pure black—add subtle color tint (0.01 chroma)
|
||||||
|
- **Gray on color**: Never put gray text on colored backgrounds—use a shade of that color or transparency
|
||||||
|
|
||||||
|
### Interaction States
|
||||||
|
|
||||||
|
Every interactive element needs all states:
|
||||||
|
|
||||||
|
- **Default**: Resting state
|
||||||
|
- **Hover**: Subtle feedback (color, scale, shadow)
|
||||||
|
- **Focus**: Keyboard focus indicator (never remove without replacement)
|
||||||
|
- **Active**: Click/tap feedback
|
||||||
|
- **Disabled**: Clearly non-interactive
|
||||||
|
- **Loading**: Async action feedback
|
||||||
|
- **Error**: Validation or error state
|
||||||
|
- **Success**: Successful completion
|
||||||
|
|
||||||
|
**Missing states create confusion and broken experiences**.
|
||||||
|
|
||||||
|
### Micro-interactions & Transitions
|
||||||
|
|
||||||
|
- **Smooth transitions**: All state changes animated appropriately (150-300ms)
|
||||||
|
- **Consistent easing**: Use ease-out-quart/quint/expo for natural deceleration. Never bounce or elastic—they feel dated.
|
||||||
|
- **No jank**: 60fps animations, only animate transform and opacity
|
||||||
|
- **Appropriate motion**: Motion serves purpose, not decoration
|
||||||
|
- **Reduced motion**: Respects `prefers-reduced-motion`
|
||||||
|
|
||||||
|
### Content & Copy
|
||||||
|
|
||||||
|
- **Consistent terminology**: Same things called same names throughout
|
||||||
|
- **Consistent capitalization**: Title Case vs Sentence case applied consistently
|
||||||
|
- **Grammar & spelling**: No typos
|
||||||
|
- **Appropriate length**: Not too wordy, not too terse
|
||||||
|
- **Punctuation consistency**: Periods on sentences, not on labels (unless all labels have them)
|
||||||
|
|
||||||
|
### Icons & Images
|
||||||
|
|
||||||
|
- **Consistent style**: All icons from same family or matching style
|
||||||
|
- **Appropriate sizing**: Icons sized consistently for context
|
||||||
|
- **Proper alignment**: Icons align with adjacent text optically
|
||||||
|
- **Alt text**: All images have descriptive alt text
|
||||||
|
- **Loading states**: Images don't cause layout shift, proper aspect ratios
|
||||||
|
- **Retina support**: 2x assets for high-DPI screens
|
||||||
|
|
||||||
|
### Forms & Inputs
|
||||||
|
|
||||||
|
- **Label consistency**: All inputs properly labeled
|
||||||
|
- **Required indicators**: Clear and consistent
|
||||||
|
- **Error messages**: Helpful and consistent
|
||||||
|
- **Tab order**: Logical keyboard navigation
|
||||||
|
- **Auto-focus**: Appropriate (don't overuse)
|
||||||
|
- **Validation timing**: Consistent (on blur vs on submit)
|
||||||
|
|
||||||
|
### Edge Cases & Error States
|
||||||
|
|
||||||
|
- **Loading states**: All async actions have loading feedback
|
||||||
|
- **Empty states**: Helpful empty states, not just blank space
|
||||||
|
- **Error states**: Clear error messages with recovery paths
|
||||||
|
- **Success states**: Confirmation of successful actions
|
||||||
|
- **Long content**: Handles very long names, descriptions, etc.
|
||||||
|
- **No content**: Handles missing data gracefully
|
||||||
|
- **Offline**: Appropriate offline handling (if applicable)
|
||||||
|
|
||||||
|
### Responsiveness
|
||||||
|
|
||||||
|
- **All breakpoints**: Test mobile, tablet, desktop
|
||||||
|
- **Touch targets**: 44x44px minimum on touch devices
|
||||||
|
- **Readable text**: No text smaller than 14px on mobile
|
||||||
|
- **No horizontal scroll**: Content fits viewport
|
||||||
|
- **Appropriate reflow**: Content adapts logically
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
- **Fast initial load**: Optimize critical path
|
||||||
|
- **No layout shift**: Elements don't jump after load (CLS)
|
||||||
|
- **Smooth interactions**: No lag or jank
|
||||||
|
- **Optimized images**: Appropriate formats and sizes
|
||||||
|
- **Lazy loading**: Off-screen content loads lazily
|
||||||
|
|
||||||
|
### Code Quality
|
||||||
|
|
||||||
|
- **Remove console logs**: No debug logging in production
|
||||||
|
- **Remove commented code**: Clean up dead code
|
||||||
|
- **Remove unused imports**: Clean up unused dependencies
|
||||||
|
- **Consistent naming**: Variables and functions follow conventions
|
||||||
|
- **Type safety**: No TypeScript `any` or ignored errors
|
||||||
|
- **Accessibility**: Proper ARIA labels and semantic HTML
|
||||||
|
|
||||||
|
## Polish Checklist
|
||||||
|
|
||||||
|
Go through systematically:
|
||||||
|
|
||||||
|
- [ ] Visual alignment perfect at all breakpoints
|
||||||
|
- [ ] Spacing uses design tokens consistently
|
||||||
|
- [ ] Typography hierarchy consistent
|
||||||
|
- [ ] All interactive states implemented
|
||||||
|
- [ ] All transitions smooth (60fps)
|
||||||
|
- [ ] Copy is consistent and polished
|
||||||
|
- [ ] Icons are consistent and properly sized
|
||||||
|
- [ ] All forms properly labeled and validated
|
||||||
|
- [ ] Error states are helpful
|
||||||
|
- [ ] Loading states are clear
|
||||||
|
- [ ] Empty states are welcoming
|
||||||
|
- [ ] Touch targets are 44x44px minimum
|
||||||
|
- [ ] Contrast ratios meet WCAG AA
|
||||||
|
- [ ] Keyboard navigation works
|
||||||
|
- [ ] Focus indicators visible
|
||||||
|
- [ ] No console errors or warnings
|
||||||
|
- [ ] No layout shift on load
|
||||||
|
- [ ] Works in all supported browsers
|
||||||
|
- [ ] Respects reduced motion preference
|
||||||
|
- [ ] Code is clean (no TODOs, console.logs, commented code)
|
||||||
|
|
||||||
|
**IMPORTANT**: Polish is about details. Zoom in. Squint at it. Use it yourself. The little things add up.
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Polish before it's functionally complete
|
||||||
|
- Spend hours on polish if it ships in 30 minutes (triage)
|
||||||
|
- Introduce bugs while polishing (test thoroughly)
|
||||||
|
- Ignore systematic issues (if spacing is off everywhere, fix the system)
|
||||||
|
- Perfect one thing while leaving others rough (consistent quality level)
|
||||||
|
|
||||||
|
## Final Verification
|
||||||
|
|
||||||
|
Before marking as done:
|
||||||
|
|
||||||
|
- **Use it yourself**: Actually interact with the feature
|
||||||
|
- **Test on real devices**: Not just browser DevTools
|
||||||
|
- **Ask someone else to review**: Fresh eyes catch things
|
||||||
|
- **Compare to design**: Match intended design
|
||||||
|
- **Check all states**: Don't just test happy path
|
||||||
|
|
||||||
|
Remember: You have impeccable attention to detail and exquisite taste. Polish until it feels effortless, looks intentional, and works flawlessly. Sweat the details - they matter.
|
||||||
100
.pi/agent/skills/frontend/quieter/SKILL.md
Normal file
100
.pi/agent/skills/frontend/quieter/SKILL.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
---
|
||||||
|
name: quieter
|
||||||
|
description: Tones down visually aggressive or overstimulating designs, reducing intensity while preserving quality. Use when the user mentions too bold, too loud, overwhelming, aggressive, garish, or wants a calmer, more refined aesthetic.
|
||||||
|
---
|
||||||
|
|
||||||
|
Reduce visual intensity in designs that are too bold, aggressive, or overstimulating, creating a more refined and approachable aesthetic without losing effectiveness.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current State
|
||||||
|
|
||||||
|
Analyze what makes the design feel too intense:
|
||||||
|
|
||||||
|
1. **Identify intensity sources**:
|
||||||
|
- **Color saturation**: Overly bright or saturated colors
|
||||||
|
- **Contrast extremes**: Too much high-contrast juxtaposition
|
||||||
|
- **Visual weight**: Too many bold, heavy elements competing
|
||||||
|
- **Animation excess**: Too much motion or overly dramatic effects
|
||||||
|
- **Complexity**: Too many visual elements, patterns, or decorations
|
||||||
|
- **Scale**: Everything is large and loud with no hierarchy
|
||||||
|
|
||||||
|
2. **Understand the context**:
|
||||||
|
- What's the purpose? (Marketing vs tool vs reading experience)
|
||||||
|
- Who's the audience? (Some contexts need energy)
|
||||||
|
- What's working? (Don't throw away good ideas)
|
||||||
|
- What's the core message? (Preserve what matters)
|
||||||
|
|
||||||
|
If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
|
||||||
|
|
||||||
|
**CRITICAL**: "Quieter" doesn't mean boring or generic. It means refined, sophisticated, and easier on the eyes. Think luxury, not laziness.
|
||||||
|
|
||||||
|
## Plan Refinement
|
||||||
|
|
||||||
|
Create a strategy to reduce intensity while maintaining impact:
|
||||||
|
|
||||||
|
- **Color approach**: Desaturate or shift to more sophisticated tones?
|
||||||
|
- **Hierarchy approach**: Which elements should stay bold (very few), which should recede?
|
||||||
|
- **Simplification approach**: What can be removed entirely?
|
||||||
|
- **Sophistication approach**: How can we signal quality through restraint?
|
||||||
|
|
||||||
|
**IMPORTANT**: Great quiet design is harder than great bold design. Subtlety requires precision.
|
||||||
|
|
||||||
|
## Refine the Design
|
||||||
|
|
||||||
|
Systematically reduce intensity across these dimensions:
|
||||||
|
|
||||||
|
### Color Refinement
|
||||||
|
- **Reduce saturation**: Shift from fully saturated to 70-85% saturation
|
||||||
|
- **Soften palette**: Replace bright colors with muted, sophisticated tones
|
||||||
|
- **Reduce color variety**: Use fewer colors more thoughtfully
|
||||||
|
- **Neutral dominance**: Let neutrals do more work, use color as accent (10% rule)
|
||||||
|
- **Gentler contrasts**: High contrast only where it matters most
|
||||||
|
- **Tinted grays**: Use warm or cool tinted grays instead of pure gray—adds sophistication without loudness
|
||||||
|
- **Never gray on color**: If you have gray text on a colored background, use a darker shade of that color or transparency instead
|
||||||
|
|
||||||
|
### Visual Weight Reduction
|
||||||
|
- **Typography**: Reduce font weights (900 → 600, 700 → 500), decrease sizes where appropriate
|
||||||
|
- **Hierarchy through subtlety**: Use weight, size, and space instead of color and boldness
|
||||||
|
- **White space**: Increase breathing room, reduce density
|
||||||
|
- **Borders & lines**: Reduce thickness, decrease opacity, or remove entirely
|
||||||
|
|
||||||
|
### Simplification
|
||||||
|
- **Remove decorative elements**: Gradients, shadows, patterns, textures that don't serve purpose
|
||||||
|
- **Simplify shapes**: Reduce border radius extremes, simplify custom shapes
|
||||||
|
- **Reduce layering**: Flatten visual hierarchy where possible
|
||||||
|
- **Clean up effects**: Reduce or remove blur effects, glows, multiple shadows
|
||||||
|
|
||||||
|
### Motion Reduction
|
||||||
|
- **Reduce animation intensity**: Shorter distances (10-20px instead of 40px), gentler easing
|
||||||
|
- **Remove decorative animations**: Keep functional motion, remove flourishes
|
||||||
|
- **Subtle micro-interactions**: Replace dramatic effects with gentle feedback
|
||||||
|
- **Refined easing**: Use ease-out-quart for smooth, understated motion—never bounce or elastic
|
||||||
|
- **Remove animations entirely** if they're not serving a clear purpose
|
||||||
|
|
||||||
|
### Composition Refinement
|
||||||
|
- **Reduce scale jumps**: Smaller contrast between sizes creates calmer feeling
|
||||||
|
- **Align to grid**: Bring rogue elements back into systematic alignment
|
||||||
|
- **Even out spacing**: Replace extreme spacing variations with consistent rhythm
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Make everything the same size/weight (hierarchy still matters)
|
||||||
|
- Remove all color (quiet ≠ grayscale)
|
||||||
|
- Eliminate all personality (maintain character through refinement)
|
||||||
|
- Sacrifice usability for aesthetics (functional elements still need clear affordances)
|
||||||
|
- Make everything small and light (some anchors needed)
|
||||||
|
|
||||||
|
## Verify Quality
|
||||||
|
|
||||||
|
Ensure refinement maintains quality:
|
||||||
|
|
||||||
|
- **Still functional**: Can users still accomplish tasks easily?
|
||||||
|
- **Still distinctive**: Does it have character, or is it generic now?
|
||||||
|
- **Better reading**: Is text easier to read for extended periods?
|
||||||
|
- **Sophistication**: Does it feel more refined and premium?
|
||||||
|
|
||||||
|
Remember: Quiet design is confident design. It doesn't need to shout. Less is more, but less is also harder. Refine with precision and maintain intentionality.
|
||||||
70
.pi/agent/skills/frontend/teach-impeccable/SKILL.md
Normal file
70
.pi/agent/skills/frontend/teach-impeccable/SKILL.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
name: teach-impeccable
|
||||||
|
description: One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
|
||||||
|
---
|
||||||
|
|
||||||
|
Gather design context for this project, then persist it for all future sessions.
|
||||||
|
|
||||||
|
## Step 1: Explore the Codebase
|
||||||
|
|
||||||
|
Before asking questions, thoroughly scan the project to discover what you can:
|
||||||
|
|
||||||
|
- **README and docs**: Project purpose, target audience, any stated goals
|
||||||
|
- **Package.json / config files**: Tech stack, dependencies, existing design libraries
|
||||||
|
- **Existing components**: Current design patterns, spacing, typography in use
|
||||||
|
- **Brand assets**: Logos, favicons, color values already defined
|
||||||
|
- **Design tokens / CSS variables**: Existing color palettes, font stacks, spacing scales
|
||||||
|
- **Any style guides or brand documentation**
|
||||||
|
|
||||||
|
Note what you've learned and what remains unclear.
|
||||||
|
|
||||||
|
## Step 2: Ask UX-Focused Questions
|
||||||
|
|
||||||
|
ask the user directly to clarify what you cannot infer. Focus only on what you couldn't infer from the codebase:
|
||||||
|
|
||||||
|
### Users & Purpose
|
||||||
|
- Who uses this? What's their context when using it?
|
||||||
|
- What job are they trying to get done?
|
||||||
|
- What emotions should the interface evoke? (confidence, delight, calm, urgency, etc.)
|
||||||
|
|
||||||
|
### Brand & Personality
|
||||||
|
- How would you describe the brand personality in 3 words?
|
||||||
|
- Any reference sites or apps that capture the right feel? What specifically about them?
|
||||||
|
- What should this explicitly NOT look like? Any anti-references?
|
||||||
|
|
||||||
|
### Aesthetic Preferences
|
||||||
|
- Any strong preferences for visual direction? (minimal, bold, elegant, playful, technical, organic, etc.)
|
||||||
|
- Light mode, dark mode, or both?
|
||||||
|
- Any colors that must be used or avoided?
|
||||||
|
|
||||||
|
### Accessibility & Inclusion
|
||||||
|
- Specific accessibility requirements? (WCAG level, known user needs)
|
||||||
|
- Considerations for reduced motion, color blindness, or other accommodations?
|
||||||
|
|
||||||
|
Skip questions where the answer is already clear from the codebase exploration.
|
||||||
|
|
||||||
|
## Step 3: Write Design Context
|
||||||
|
|
||||||
|
Synthesize your findings and the user's answers into a `## Design Context` section:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Design Context
|
||||||
|
|
||||||
|
### Users
|
||||||
|
[Who they are, their context, the job to be done]
|
||||||
|
|
||||||
|
### Brand Personality
|
||||||
|
[Voice, tone, 3-word personality, emotional goals]
|
||||||
|
|
||||||
|
### Aesthetic Direction
|
||||||
|
[Visual tone, references, anti-references, theme]
|
||||||
|
|
||||||
|
### Design Principles
|
||||||
|
[3-5 principles derived from the conversation that should guide all design decisions]
|
||||||
|
```
|
||||||
|
|
||||||
|
Write this section to `.impeccable.md` in the project root. If the file already exists, update the Design Context section in place.
|
||||||
|
|
||||||
|
Then ask the user directly to clarify what you cannot infer. whether they'd also like the Design Context appended to AGENTS.md. If yes, append or update the section there as well.
|
||||||
|
|
||||||
|
Confirm completion and summarize the key design principles that will now guide all future work.
|
||||||
113
.pi/agent/skills/frontend/typeset/SKILL.md
Normal file
113
.pi/agent/skills/frontend/typeset/SKILL.md
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
---
|
||||||
|
name: typeset
|
||||||
|
description: Improves typography by fixing font choices, hierarchy, sizing, weight, and readability so text feels intentional. Use when the user mentions fonts, type, readability, text hierarchy, sizing looks off, or wants more polished, intentional typography.
|
||||||
|
---
|
||||||
|
|
||||||
|
Assess and improve typography that feels generic, inconsistent, or poorly structured — turning default-looking text into intentional, well-crafted type.
|
||||||
|
|
||||||
|
## MANDATORY PREPARATION
|
||||||
|
|
||||||
|
Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Assess Current Typography
|
||||||
|
|
||||||
|
Analyze what's weak or generic about the current type:
|
||||||
|
|
||||||
|
1. **Font choices**:
|
||||||
|
- Are we using invisible defaults? (Inter, Roboto, Arial, Open Sans, system defaults)
|
||||||
|
- Does the font match the brand personality? (A playful brand shouldn't use a corporate typeface)
|
||||||
|
- Are there too many font families? (More than 2-3 is almost always a mess)
|
||||||
|
|
||||||
|
2. **Hierarchy**:
|
||||||
|
- Can you tell headings from body from captions at a glance?
|
||||||
|
- Are font sizes too close together? (14px, 15px, 16px = muddy hierarchy)
|
||||||
|
- Are weight contrasts strong enough? (Medium vs Regular is barely visible)
|
||||||
|
|
||||||
|
3. **Sizing & scale**:
|
||||||
|
- Is there a consistent type scale, or are sizes arbitrary?
|
||||||
|
- Does body text meet minimum readability? (16px+)
|
||||||
|
- Is the sizing strategy appropriate for the context? (Fixed `rem` scales for app UIs; fluid `clamp()` for marketing/content page headings)
|
||||||
|
|
||||||
|
4. **Readability**:
|
||||||
|
- Are line lengths comfortable? (45-75 characters ideal)
|
||||||
|
- Is line-height appropriate for the font and context?
|
||||||
|
- Is there enough contrast between text and background?
|
||||||
|
|
||||||
|
5. **Consistency**:
|
||||||
|
- Are the same elements styled the same way throughout?
|
||||||
|
- Are font weights used consistently? (Not bold in one section, semibold in another for the same role)
|
||||||
|
- Is letter-spacing intentional or default everywhere?
|
||||||
|
|
||||||
|
**CRITICAL**: The goal isn't to make text "fancier" — it's to make it clearer, more readable, and more intentional. Good typography is invisible; bad typography is distracting.
|
||||||
|
|
||||||
|
## Plan Typography Improvements
|
||||||
|
|
||||||
|
Consult the [typography reference](reference/typography.md) from the frontend-design skill for detailed guidance on scales, pairing, and loading strategies.
|
||||||
|
|
||||||
|
Create a systematic plan:
|
||||||
|
|
||||||
|
- **Font selection**: Do fonts need replacing? What fits the brand/context?
|
||||||
|
- **Type scale**: Establish a modular scale (e.g., 1.25 ratio) with clear hierarchy
|
||||||
|
- **Weight strategy**: Which weights serve which roles? (Regular for body, Semibold for labels, Bold for headings — or whatever fits)
|
||||||
|
- **Spacing**: Line-heights, letter-spacing, and margins between typographic elements
|
||||||
|
|
||||||
|
## Improve Typography Systematically
|
||||||
|
|
||||||
|
### Font Selection
|
||||||
|
|
||||||
|
If fonts need replacing:
|
||||||
|
- Choose fonts that reflect the brand personality
|
||||||
|
- Pair with genuine contrast (serif + sans, geometric + humanist) — or use a single family in multiple weights
|
||||||
|
- Ensure web font loading doesn't cause layout shift (`font-display: swap`, metric-matched fallbacks)
|
||||||
|
|
||||||
|
### Establish Hierarchy
|
||||||
|
|
||||||
|
Build a clear type scale:
|
||||||
|
- **5 sizes cover most needs**: caption, secondary, body, subheading, heading
|
||||||
|
- **Use a consistent ratio** between levels (1.25, 1.333, or 1.5)
|
||||||
|
- **Combine dimensions**: Size + weight + color + space for strong hierarchy — don't rely on size alone
|
||||||
|
- **App UIs**: Use a fixed `rem`-based type scale, optionally adjusted at 1-2 breakpoints. Fluid sizing undermines the spatial predictability that dense, container-based layouts need
|
||||||
|
- **Marketing / content pages**: Use fluid sizing via `clamp(min, preferred, max)` for headings and display text. Keep body text fixed
|
||||||
|
|
||||||
|
### Fix Readability
|
||||||
|
|
||||||
|
- Set `max-width` on text containers using `ch` units (`max-width: 65ch`)
|
||||||
|
- Adjust line-height per context: tighter for headings (1.1-1.2), looser for body (1.5-1.7)
|
||||||
|
- Increase line-height slightly for light-on-dark text
|
||||||
|
- Ensure body text is at least 16px / 1rem
|
||||||
|
|
||||||
|
### Refine Details
|
||||||
|
|
||||||
|
- Use `tabular-nums` for data tables and numbers that should align
|
||||||
|
- Apply proper `letter-spacing`: slightly open for small caps and uppercase, default or tight for large display text
|
||||||
|
- Use semantic token names (`--text-body`, `--text-heading`), not value names (`--font-16`)
|
||||||
|
- Set `font-kerning: normal` and consider OpenType features where appropriate
|
||||||
|
|
||||||
|
### Weight Consistency
|
||||||
|
|
||||||
|
- Define clear roles for each weight and stick to them
|
||||||
|
- Don't use more than 3-4 weights (Regular, Medium, Semibold, Bold is plenty)
|
||||||
|
- Load only the weights you actually use (each weight adds to page load)
|
||||||
|
|
||||||
|
**NEVER**:
|
||||||
|
- Use more than 2-3 font families
|
||||||
|
- Pick sizes arbitrarily — commit to a scale
|
||||||
|
- Set body text below 16px
|
||||||
|
- Use decorative/display fonts for body text
|
||||||
|
- Disable browser zoom (`user-scalable=no`)
|
||||||
|
- Use `px` for font sizes — use `rem` to respect user settings
|
||||||
|
- Default to Inter/Roboto/Open Sans when personality matters
|
||||||
|
- Pair fonts that are similar but not identical (two geometric sans-serifs)
|
||||||
|
|
||||||
|
## Verify Typography Improvements
|
||||||
|
|
||||||
|
- **Hierarchy**: Can you identify heading vs body vs caption instantly?
|
||||||
|
- **Readability**: Is body text comfortable to read in long passages?
|
||||||
|
- **Consistency**: Are same-role elements styled identically throughout?
|
||||||
|
- **Personality**: Does the typography reflect the brand?
|
||||||
|
- **Performance**: Are web fonts loading efficiently without layout shift?
|
||||||
|
- **Accessibility**: Does text meet WCAG contrast ratios? Is it zoomable to 200%?
|
||||||
|
|
||||||
|
Remember: Typography is the foundation of interface design — it carries the majority of information. Getting it right is the highest-leverage improvement you can make.
|
||||||
344
.pi/agent/skills/playwright-cli/SKILL.md
Normal file
344
.pi/agent/skills/playwright-cli/SKILL.md
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
---
|
||||||
|
name: playwright-cli
|
||||||
|
description: Automate browser interactions, test web pages and work with Playwright tests.
|
||||||
|
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
|
||||||
|
---
|
||||||
|
|
||||||
|
# Browser Automation with playwright-cli
|
||||||
|
|
||||||
|
## Quick start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# open new browser
|
||||||
|
playwright-cli open
|
||||||
|
# navigate to a page
|
||||||
|
playwright-cli goto https://playwright.dev
|
||||||
|
# interact with the page using refs from the snapshot
|
||||||
|
playwright-cli click e15
|
||||||
|
playwright-cli type "page.click"
|
||||||
|
playwright-cli press Enter
|
||||||
|
# take a screenshot (rarely used, as snapshot is more common)
|
||||||
|
playwright-cli screenshot
|
||||||
|
# close the browser
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### Core
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli open
|
||||||
|
# open and navigate right away
|
||||||
|
playwright-cli open https://example.com/
|
||||||
|
playwright-cli goto https://playwright.dev
|
||||||
|
playwright-cli type "search query"
|
||||||
|
playwright-cli click e3
|
||||||
|
playwright-cli dblclick e7
|
||||||
|
# --submit presses Enter after filling the element
|
||||||
|
playwright-cli fill e5 "user@example.com" --submit
|
||||||
|
playwright-cli drag e2 e8
|
||||||
|
playwright-cli hover e4
|
||||||
|
playwright-cli select e9 "option-value"
|
||||||
|
playwright-cli upload ./document.pdf
|
||||||
|
playwright-cli check e12
|
||||||
|
playwright-cli uncheck e12
|
||||||
|
playwright-cli snapshot
|
||||||
|
playwright-cli eval "document.title"
|
||||||
|
playwright-cli eval "el => el.textContent" e5
|
||||||
|
# get element id, class, or any attribute not visible in the snapshot
|
||||||
|
playwright-cli eval "el => el.id" e5
|
||||||
|
playwright-cli eval "el => el.getAttribute('data-testid')" e5
|
||||||
|
playwright-cli dialog-accept
|
||||||
|
playwright-cli dialog-accept "confirmation text"
|
||||||
|
playwright-cli dialog-dismiss
|
||||||
|
playwright-cli resize 1920 1080
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
### Navigation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli go-back
|
||||||
|
playwright-cli go-forward
|
||||||
|
playwright-cli reload
|
||||||
|
```
|
||||||
|
|
||||||
|
### Keyboard
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli press Enter
|
||||||
|
playwright-cli press ArrowDown
|
||||||
|
playwright-cli keydown Shift
|
||||||
|
playwright-cli keyup Shift
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mouse
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli mousemove 150 300
|
||||||
|
playwright-cli mousedown
|
||||||
|
playwright-cli mousedown right
|
||||||
|
playwright-cli mouseup
|
||||||
|
playwright-cli mouseup right
|
||||||
|
playwright-cli mousewheel 0 100
|
||||||
|
```
|
||||||
|
|
||||||
|
### Save as
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli screenshot
|
||||||
|
playwright-cli screenshot e5
|
||||||
|
playwright-cli screenshot --filename=page.png
|
||||||
|
playwright-cli pdf --filename=page.pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tabs
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli tab-list
|
||||||
|
playwright-cli tab-new
|
||||||
|
playwright-cli tab-new https://example.com/page
|
||||||
|
playwright-cli tab-close
|
||||||
|
playwright-cli tab-close 2
|
||||||
|
playwright-cli tab-select 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Storage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli state-save
|
||||||
|
playwright-cli state-save auth.json
|
||||||
|
playwright-cli state-load auth.json
|
||||||
|
|
||||||
|
# Cookies
|
||||||
|
playwright-cli cookie-list
|
||||||
|
playwright-cli cookie-list --domain=example.com
|
||||||
|
playwright-cli cookie-get session_id
|
||||||
|
playwright-cli cookie-set session_id abc123
|
||||||
|
playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
|
||||||
|
playwright-cli cookie-delete session_id
|
||||||
|
playwright-cli cookie-clear
|
||||||
|
|
||||||
|
# LocalStorage
|
||||||
|
playwright-cli localstorage-list
|
||||||
|
playwright-cli localstorage-get theme
|
||||||
|
playwright-cli localstorage-set theme dark
|
||||||
|
playwright-cli localstorage-delete theme
|
||||||
|
playwright-cli localstorage-clear
|
||||||
|
|
||||||
|
# SessionStorage
|
||||||
|
playwright-cli sessionstorage-list
|
||||||
|
playwright-cli sessionstorage-get step
|
||||||
|
playwright-cli sessionstorage-set step 3
|
||||||
|
playwright-cli sessionstorage-delete step
|
||||||
|
playwright-cli sessionstorage-clear
|
||||||
|
```
|
||||||
|
|
||||||
|
### Network
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli route "**/*.jpg" --status=404
|
||||||
|
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
|
||||||
|
playwright-cli route-list
|
||||||
|
playwright-cli unroute "**/*.jpg"
|
||||||
|
playwright-cli unroute
|
||||||
|
```
|
||||||
|
|
||||||
|
### DevTools
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli console
|
||||||
|
playwright-cli console warning
|
||||||
|
playwright-cli network
|
||||||
|
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
|
||||||
|
playwright-cli run-code --filename=script.js
|
||||||
|
playwright-cli tracing-start
|
||||||
|
playwright-cli tracing-stop
|
||||||
|
playwright-cli video-start video.webm
|
||||||
|
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
|
||||||
|
playwright-cli video-stop
|
||||||
|
```
|
||||||
|
|
||||||
|
## Raw output
|
||||||
|
|
||||||
|
The global `--raw` option strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools. Commands that don't produce output return nothing.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
|
||||||
|
playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
|
||||||
|
playwright-cli --raw snapshot > before.yml
|
||||||
|
playwright-cli click e5
|
||||||
|
playwright-cli --raw snapshot > after.yml
|
||||||
|
diff before.yml after.yml
|
||||||
|
TOKEN=$(playwright-cli --raw cookie-get session_id)
|
||||||
|
playwright-cli --raw localstorage-get theme
|
||||||
|
```
|
||||||
|
|
||||||
|
## Open parameters
|
||||||
|
```bash
|
||||||
|
# Use specific browser when creating session
|
||||||
|
playwright-cli open --browser=chrome
|
||||||
|
playwright-cli open --browser=firefox
|
||||||
|
playwright-cli open --browser=webkit
|
||||||
|
playwright-cli open --browser=msedge
|
||||||
|
|
||||||
|
# Use persistent profile (by default profile is in-memory)
|
||||||
|
playwright-cli open --persistent
|
||||||
|
# Use persistent profile with custom directory
|
||||||
|
playwright-cli open --profile=/path/to/profile
|
||||||
|
|
||||||
|
# Connect to browser via extension
|
||||||
|
playwright-cli attach --extension
|
||||||
|
|
||||||
|
# Start with config file
|
||||||
|
playwright-cli open --config=my-config.json
|
||||||
|
|
||||||
|
# Close the browser
|
||||||
|
playwright-cli close
|
||||||
|
# Delete user data for the default session
|
||||||
|
playwright-cli delete-data
|
||||||
|
```
|
||||||
|
|
||||||
|
## Snapshots
|
||||||
|
|
||||||
|
After each command, playwright-cli provides a snapshot of the current browser state.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> playwright-cli goto https://example.com
|
||||||
|
### Page
|
||||||
|
- Page URL: https://example.com/
|
||||||
|
- Page Title: Example Domain
|
||||||
|
### Snapshot
|
||||||
|
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# default - save to a file with timestamp-based name
|
||||||
|
playwright-cli snapshot
|
||||||
|
|
||||||
|
# save to file, use when snapshot is a part of the workflow result
|
||||||
|
playwright-cli snapshot --filename=after-click.yaml
|
||||||
|
|
||||||
|
# snapshot an element instead of the whole page
|
||||||
|
playwright-cli snapshot "#main"
|
||||||
|
|
||||||
|
# limit snapshot depth for efficiency, take a partial snapshot afterwards
|
||||||
|
playwright-cli snapshot --depth=4
|
||||||
|
playwright-cli snapshot e34
|
||||||
|
```
|
||||||
|
|
||||||
|
## Targeting elements
|
||||||
|
|
||||||
|
By default, use refs from the snapshot to interact with page elements.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# get snapshot with refs
|
||||||
|
playwright-cli snapshot
|
||||||
|
|
||||||
|
# interact using a ref
|
||||||
|
playwright-cli click e15
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use css selectors or Playwright locators.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# css selector
|
||||||
|
playwright-cli click "#main > button.submit"
|
||||||
|
|
||||||
|
# role locator
|
||||||
|
playwright-cli click "getByRole('button', { name: 'Submit' })"
|
||||||
|
|
||||||
|
# test id
|
||||||
|
playwright-cli click "getByTestId('submit-button')"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Browser Sessions
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# create new browser session named "mysession" with persistent profile
|
||||||
|
playwright-cli -s=mysession open example.com --persistent
|
||||||
|
# same with manually specified profile directory (use when requested explicitly)
|
||||||
|
playwright-cli -s=mysession open example.com --profile=/path/to/profile
|
||||||
|
playwright-cli -s=mysession click e6
|
||||||
|
playwright-cli -s=mysession close # stop a named browser
|
||||||
|
playwright-cli -s=mysession delete-data # delete user data for persistent session
|
||||||
|
|
||||||
|
playwright-cli list
|
||||||
|
# Close all browsers
|
||||||
|
playwright-cli close-all
|
||||||
|
# Forcefully kill all browser processes
|
||||||
|
playwright-cli kill-all
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
If global `playwright-cli` command is not available, try a local version via `npx playwright-cli`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx --no-install playwright-cli --version
|
||||||
|
```
|
||||||
|
|
||||||
|
When local version is available, use `npx playwright-cli` in all commands. Otherwise, install `playwright-cli` as a global command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g @playwright/cli@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example: Form submission
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli open https://example.com/form
|
||||||
|
playwright-cli snapshot
|
||||||
|
|
||||||
|
playwright-cli fill e1 "user@example.com"
|
||||||
|
playwright-cli fill e2 "password123"
|
||||||
|
playwright-cli click e3
|
||||||
|
playwright-cli snapshot
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example: Multi-tab workflow
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli open https://example.com
|
||||||
|
playwright-cli tab-new https://example.com/other
|
||||||
|
playwright-cli tab-list
|
||||||
|
playwright-cli tab-select 0
|
||||||
|
playwright-cli snapshot
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example: Debugging with DevTools
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli open https://example.com
|
||||||
|
playwright-cli click e4
|
||||||
|
playwright-cli fill e7 "test"
|
||||||
|
playwright-cli console
|
||||||
|
playwright-cli network
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli open https://example.com
|
||||||
|
playwright-cli tracing-start
|
||||||
|
playwright-cli click e4
|
||||||
|
playwright-cli fill e7 "test"
|
||||||
|
playwright-cli tracing-stop
|
||||||
|
playwright-cli close
|
||||||
|
```
|
||||||
|
|
||||||
|
## Specific tasks
|
||||||
|
|
||||||
|
* **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
|
||||||
|
* **Request mocking** [references/request-mocking.md](references/request-mocking.md)
|
||||||
|
* **Running Playwright code** [references/running-code.md](references/running-code.md)
|
||||||
|
* **Browser session management** [references/session-management.md](references/session-management.md)
|
||||||
|
* **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
|
||||||
|
* **Test generation** [references/test-generation.md](references/test-generation.md)
|
||||||
|
* **Tracing** [references/tracing.md](references/tracing.md)
|
||||||
|
* **Video recording** [references/video-recording.md](references/video-recording.md)
|
||||||
|
* **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Inspecting Element Attributes
|
||||||
|
|
||||||
|
When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli snapshot
|
||||||
|
# snapshot shows a button as e7 but doesn't reveal its id or data attributes
|
||||||
|
|
||||||
|
# get the element's id
|
||||||
|
playwright-cli eval "el => el.id" e7
|
||||||
|
|
||||||
|
# get all CSS classes
|
||||||
|
playwright-cli eval "el => el.className" e7
|
||||||
|
|
||||||
|
# get a specific attribute
|
||||||
|
playwright-cli eval "el => el.getAttribute('data-testid')" e7
|
||||||
|
playwright-cli eval "el => el.getAttribute('aria-label')" e7
|
||||||
|
|
||||||
|
# get a computed style property
|
||||||
|
playwright-cli eval "el => getComputedStyle(el).display" e7
|
||||||
|
```
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Running Playwright Tests
|
||||||
|
|
||||||
|
To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all tests
|
||||||
|
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
||||||
|
|
||||||
|
# Run all tests through a custom npm script
|
||||||
|
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
||||||
|
```
|
||||||
|
|
||||||
|
# Debugging Playwright Tests
|
||||||
|
|
||||||
|
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
||||||
|
|
||||||
|
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed.
|
||||||
|
|
||||||
|
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run the test
|
||||||
|
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
|
||||||
|
# ...
|
||||||
|
# ... debugging instructions for "tw-abcdef" session ...
|
||||||
|
# ...
|
||||||
|
|
||||||
|
# Attach to the test
|
||||||
|
playwright-cli attach tw-abcdef
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep the test running in the background while you explore and look for a fix.
|
||||||
|
The test is paused at the start, so you should step over or pause at a particular location
|
||||||
|
where the problem is most likely to be.
|
||||||
|
|
||||||
|
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
||||||
|
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
|
||||||
|
|
||||||
|
After fixing the test, stop the background test run. Rerun to check that test passes.
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
# Request Mocking
|
||||||
|
|
||||||
|
Intercept, mock, modify, and block network requests.
|
||||||
|
|
||||||
|
## CLI Route Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Mock with custom status
|
||||||
|
playwright-cli route "**/*.jpg" --status=404
|
||||||
|
|
||||||
|
# Mock with JSON body
|
||||||
|
playwright-cli route "**/api/users" --body='[{"id":1,"name":"Alice"}]' --content-type=application/json
|
||||||
|
|
||||||
|
# Mock with custom headers
|
||||||
|
playwright-cli route "**/api/data" --body='{"ok":true}' --header="X-Custom: value"
|
||||||
|
|
||||||
|
# Remove headers from requests
|
||||||
|
playwright-cli route "**/*" --remove-header=cookie,authorization
|
||||||
|
|
||||||
|
# List active routes
|
||||||
|
playwright-cli route-list
|
||||||
|
|
||||||
|
# Remove a route or all routes
|
||||||
|
playwright-cli unroute "**/*.jpg"
|
||||||
|
playwright-cli unroute
|
||||||
|
```
|
||||||
|
|
||||||
|
## URL Patterns
|
||||||
|
|
||||||
|
```
|
||||||
|
**/api/users - Exact path match
|
||||||
|
**/api/*/details - Wildcard in path
|
||||||
|
**/*.{png,jpg,jpeg} - Match file extensions
|
||||||
|
**/search?q=* - Match query parameters
|
||||||
|
```
|
||||||
|
|
||||||
|
## Advanced Mocking with run-code
|
||||||
|
|
||||||
|
For conditional responses, request body inspection, response modification, or delays:
|
||||||
|
|
||||||
|
### Conditional Response Based on Request
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli run-code "async page => {
|
||||||
|
await page.route('**/api/login', route => {
|
||||||
|
const body = route.request().postDataJSON();
|
||||||
|
if (body.username === 'admin') {
|
||||||
|
route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });
|
||||||
|
} else {
|
||||||
|
route.fulfill({ status: 401, body: JSON.stringify({ error: 'Invalid' }) });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Modify Real Response
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli run-code "async page => {
|
||||||
|
await page.route('**/api/user', async route => {
|
||||||
|
const response = await route.fetch();
|
||||||
|
const json = await response.json();
|
||||||
|
json.isPremium = true;
|
||||||
|
await route.fulfill({ response, json });
|
||||||
|
});
|
||||||
|
}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Simulate Network Failures
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli run-code "async page => {
|
||||||
|
await page.route('**/api/offline', route => route.abort('internetdisconnected'));
|
||||||
|
}"
|
||||||
|
# Options: connectionrefused, timedout, connectionreset, internetdisconnected
|
||||||
|
```
|
||||||
|
|
||||||
|
### Delayed Response
|
||||||
|
|
||||||
|
```bash
|
||||||
|
playwright-cli run-code "async page => {
|
||||||
|
await page.route('**/api/slow', async route => {
|
||||||
|
await new Promise(r => setTimeout(r, 3000));
|
||||||
|
route.fulfill({ body: JSON.stringify({ data: 'loaded' }) });
|
||||||
|
});
|
||||||
|
}"
|
||||||
|
```
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user