codebam/hermes-skills/viewport-compositor-features
Claude Code and agent skill by codebam/hermes-skills
- community
Checking that the SKILL.md file is still in the repository.
Plumb Viewport features across config, IPC, CLI, and shell.
Install
npx vskill@latest install codebam/hermes-skills/viewport-compositor-featuresSKILL.md
The same SKILL.md was published earlier as codebam/hermes-skills/viewport-compositor-features.
Viewport compositor feature plumbing (config + IPC + CLI + shell)
When to Use
- Adding a new configurable feature to the Viewport compositor that should be settable from the config file (
~/.config/viewport/config.json), the control socket (viewport msg -t ...), and the command line (--flag). - The feature is a compositor setting (wallpaper, gaps, border, decoration mode, keyboard layout, bar mode, etc.) — not a Wayland protocol global (see
smithay-wayland-protocol-implementationfor that). - You need the shell (the web page) to know about the setting via the
configevent.
File inventory (all must be touched)
| File | What to do | |
|---|---|---|
crates/viewport/src/config.rs | Add field to File struct. If the field needs validation/parsing, add a helper type (see BackgroundTerminal). | |
crates/viewport/src/state.rs | (1) Add default in ViewportState::new's config: Config { ... } block (~line 955). (2) Forward from File to self.config in apply_config() (~line 5205). notify_config() automatically forwards self.config as a Config event — only the Config struct needs the field. | |
crates/viewport-ipc/src/event.rs | Add field to the Config struct. Use #[serde(default, skip_serializing_if = "Option::is_none")] for optional fields so absence omits them (compatible with older shells). Add serialization test. | |
crates/viewport-ipc/src/request.rs | If the feature needs runtime IPC: add Request variant with #[serde(rename = "feature.action")]. Add at least one row to the every_dispatch_table_entry_parses test and increment the table-length assertion. | |
crates/viewport/src/apply.rs | If the feature has an IPC request: handle the variant. Update self.config and call self.notify_config() so the shell learns about the change. | |
crates/viewport/src/main.rs | Parse the CLI flag after apply_config() so the flag wins over the file. Add the flag to the OPTIONS table for --help and warn_about_unknown_options. | |
crates/viewport/src/msg.rs | Add entry to TYPES table (name + fields + hint). Optionally add examples to EXAMPLES. | |
data/config.example.json | Add "_feature": [ "documentation line", ... ] + "feature": default_value. | |
data/shell/commands.js | In the case 'config': handler, call applyFeature(message.feature_field). | |
data/shell/windows.js | Add the applyFeature(field) function. Guard against undefined so absent/default fields leave things unchanged. | |
docs/configuration.md | Add a section documenting the feature with JSON examples and CLI equivalents. | |
docs/ipc.md | Update the config event row if it changed, and add the new request to the Shell->Compositor table. |
Flow
A runtime IPC request (WallpaperSet, ConfigGaps, etc.) goes:
IPC test table
The every_dispatch_table_entry_parses test in request.rs asserts a count. Each new Request variant gets at least one entry row. After adding entries, increment the count assertion — the comment explains that this count tracks "the C dispatch table" (parity table) so if your variant has no C counterpart, add a comment and bump the expected number.
Pitfalls
- Worktree discipline: run
cdexplicitly into.worktrees/<name>/before editing.patchandwrite_filework on whatever the session's cwd is, and if that's the main worktree, your edits land there instead of in the feature branch. After editing, alwaysgit diff main --statfrom inside the worktree to confirm changes are in the right place. - `config::File` field is `Option<T>`: every file field is optional (see
config.rsmodule comment). Absence must not reset something a flag or earlier reload set. Theapply_configmethod only overwritesself.config.Xwhenfile.XisSome(...). - `Event::Config` serialization: use
#[serde(skip_serializing_if)]for optional IPC event fields. Absent fields are omitted from the wire JSON, so an older shell that doesn't know about the key keeps working. - Config vs Request naming: config file fields use snake_case (
background_terminal), IPC messagetypeuses dot-notation (wallpaper.set,config.border). - JS shell pattern: the
apply*function guards onwallpaper === undefined. The config event is also sent on IPC-to-compositor changes (notify_config()), so the handler must accept incremental updates gracefully. - notify_config reannounces everything: it sends the whole
self.configstruct — don't add a separate message type for a single-field change. - Build verification: use
nix develop .#rust -c cargo check -p viewportandnix develop .#rust -c cargo test -p viewport(notcargodirectly;rustcis not on PATH outside the devshell).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingprofiles/viewport/software-development/viewport-compositor-features/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/codebam/hermes-skills/viewport-compositor-features)