Agent skill
feature-flags
Creating and using feature flags in sidecar for gating experimental functionality. Covers flag registration, checking flags in code, config file and CLI overrides, and priority resolution. Use when adding feature flags, toggling features, or gating new functionality behind flags.
Install this agent skill to your Project
npx add-skill https://github.com/marcus/sidecar/tree/main/.claude/skills/feature-flags
SKILL.md
Feature Flags
Feature flags gate experimental functionality behind user-configurable settings, enabling safe rollout (default off), user opt-in, and easy rollback.
Checking Feature State
import "github.com/marcus/sidecar/internal/features"
if features.IsEnabled("tmux_interactive_input") {
// Feature-gated code
}
Adding a New Feature Flag
- Define the feature in
internal/features/features.go:
var MyNewFeature = Feature{
Name: "my_new_feature",
Default: false,
Description: "Description of what this enables",
}
- Add to the
allFeaturesslice:
var allFeatures = []Feature{
TmuxInteractiveInput,
MyNewFeature, // Add here
}
- Use the feature check in your code:
if features.IsEnabled("my_new_feature") {
// New functionality
}
User Configuration
Config file (~/.config/sidecar/config.json)
{
"features": {
"flags": {
"tmux_interactive_input": true
}
}
}
CLI override (takes precedence over config)
sidecar --enable-feature=tmux_interactive_input
sidecar --disable-feature=tmux_interactive_input
sidecar --enable-feature=feature1,feature2 # Multiple features
Unknown feature names in CLI flags produce a warning but do not prevent startup.
Priority Order
Feature state resolves in this order (first match wins):
- CLI override (
--enable-feature,--disable-feature) - Config file (
features.flagsin config.json) - Default value (defined in code)
Available Features
| Feature | Default | Description |
|---|---|---|
tmux_interactive_input |
true | Write support for tmux panes |
tmux_inline_edit |
true | Inline file editing via tmux in files plugin |
notes_plugin |
false | Notes plugin for capturing quick notes |
API Reference
features.IsEnabled(name string) bool // Check if enabled
features.List() map[string]bool // All features with current state
features.ListAll() []Feature // All features with metadata
features.SetEnabled(name string, enabled bool) error // Persist to config
features.SetOverride(name string, enabled bool) // Runtime override (not persisted)
features.IsKnownFeature(name string) bool // Check if registered
Best Practices
- Use
snake_casefor feature names (e.g.,my_new_feature) - New experimental features should default to
false - Provide clear descriptions for each feature
- Document features in
docs/guides/feature-flags.mdwhen adding them - Remove feature flags once features are stable
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
create-prompt
Create prompts for sidecar workspaces. Covers prompt structure (name, ticketMode, body), template variables (ticket with fallbacks), config file locations (global vs project), and scope overrides. Use when creating or modifying prompts in sidecar config files.
merge-strategy
Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar. Covers pull strategy menu, direct merge workflow, squash merge, commit message templates, configurable defaults, and protected branches. Use when working on git merge features or making decisions about merge strategies.
keyboard-shortcuts
Reference for keyboard shortcut implementation, keybinding registration, shortcut parity with vim and other TUI tools, and the complete shortcut assignment table across all sidecar plugins. Use when adding or modifying keyboard shortcuts, checking shortcut assignments, resolving key conflicts, or assessing alignment with vim conventions.
profile-memory
Profile memory usage in sidecar using Go pprof, system tools, and heap analysis. Covers identifying memory leaks, goroutine leaks, file descriptor accumulation, and CPU profiling. Use when investigating memory issues, profiling performance, debugging memory leaks, or diagnosing unresponsive plugins.
create-theme
Create custom color themes for Sidecar, including base theme selection, color overrides, gradient borders, tab styles, per-project themes, community themes, and programmatic theme registration. Use when creating or modifying themes, adjusting UI appearance, or debugging color/style issues. See references/palette-reference.md for the full color palette with all keys and per-theme values.
drag-pane
Drag-and-drop pane resizing implementation for two-pane plugin layouts. Covers mouse event handling via the internal/mouse package, hit region registration, drag delta calculation, width clamping, state persistence, and pane layout management. Use when working on pane resizing, drag interactions, layout management, or adding drag-to-resize to a new plugin.
Didn't find tool you were looking for?