Flex
by @bytesagain1
Generate CSS Flexbox layouts using interactive CLI commands. Use when building responsive flex containers, rows, columns, or alignment configurations.
clawhub install flexπ About This Skill
name: flex version: "1.0.0" description: "Generate CSS Flexbox layouts using interactive CLI commands. Use when building responsive flex containers, rows, columns, or alignment configurations." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills
Flex β CSS Flexbox Layout Generator
A CLI tool for generating CSS Flexbox layouts. Create flex containers, configure alignment, justify, wrap, gap, and order properties, then export production-ready CSS code.
Prerequisites
bash shell~/.flex/Data Storage
All layout configurations are stored in JSONL format at ~/.flex/data.jsonl. Each record represents a saved flex layout with all its properties.
Commands
Run commands via: bash scripts/script.sh
create
Create a new flex container layout with a name and optional initial properties.
bash scripts/script.sh create --name "navbar" --direction row --items 5
bash scripts/script.sh create --name "sidebar" --direction column
Arguments:
--name β Layout name (required)--direction β Flex direction: row, column, row-reverse, column-reverse (optional, default: row)--items β Number of child items (optional, default: 3)row
Create a quick horizontal row layout preset.
bash scripts/script.sh row --name "header-row" --items 4
bash scripts/script.sh row --name "card-grid" --gap 16
Arguments:
--name β Layout name (required)--items β Number of items (optional, default: 3)--gap β Gap in pixels (optional, default: 0)column
Create a quick vertical column layout preset.
bash scripts/script.sh column --name "sidebar-nav" --items 6
Arguments:
--name β Layout name (required)--items β Number of items (optional, default: 3)--gap β Gap in pixels (optional, default: 0)wrap
Toggle or set flex-wrap on an existing layout.
bash scripts/script.sh wrap --id --value wrap
bash scripts/script.sh wrap --id --value nowrap
Arguments:
--id β Layout ID (required)--value β Wrap value: wrap, nowrap, wrap-reverse (optional, default: wrap)align
Set align-items property on a layout.
bash scripts/script.sh align --id --value center
Arguments:
--id β Layout ID (required)--value β Alignment: flex-start, flex-end, center, stretch, baseline (required)justify
Set justify-content property on a layout.
bash scripts/script.sh justify --id --value space-between
Arguments:
--id β Layout ID (required)--value β Justify: flex-start, flex-end, center, space-between, space-around, space-evenly (required)gap
Set the gap property on a layout.
bash scripts/script.sh gap --id --value 16
bash scripts/script.sh gap --id --row 8 --column 16
Arguments:
--id β Layout ID (required)--value β Gap in pixels (optional)--row β Row gap in pixels (optional)--column β Column gap in pixels (optional)order
Set the order of a specific child item within a layout.
bash scripts/script.sh order --id --item 2 --value -1
Arguments:
--id β Layout ID (required)--item β Item index, 1-based (required)--value β Order value (required)grow
Set flex-grow for a child item.
bash scripts/script.sh grow --id --item 1 --value 2
Arguments:
--id β Layout ID (required)--item β Item index (required)--value β Flex-grow value (required)shrink
Set flex-shrink for a child item.
bash scripts/script.sh shrink --id --item 3 --value 0
Arguments:
--id β Layout ID (required)--item β Item index (required)--value β Flex-shrink value (required)export
Export a layout or all layouts as CSS code.
bash scripts/script.sh export --id
bash scripts/script.sh export --all --output layouts.css
Arguments:
--id β Export a specific layout (optional)--all β Export all layouts (optional)--output β Output file path (optional, default: stdout)help
Display help information and list all available commands.
bash scripts/script.sh help
version
Display the current tool version.
bash scripts/script.sh version
Examples
# Create a navigation bar
bash scripts/script.sh create --name "navbar" --direction row --items 5
bash scripts/script.sh justify --id abc123 --value space-between
bash scripts/script.sh align --id abc123 --value center
bash scripts/script.sh export --id abc123Quick card grid
bash scripts/script.sh row --name "cards" --items 4 --gap 16
bash scripts/script.sh wrap --id def456 --value wrapExport everything
bash scripts/script.sh export --all --output flex-layouts.css
Notes
export command generates clean, production-ready CSS with class names derived from layout namesrow and column shortcuts for common patterns instead of createPowered by BytesAgain | bytesagain.com | hello@bytesagain.com
π‘ Examples
# Create a navigation bar
bash scripts/script.sh create --name "navbar" --direction row --items 5
bash scripts/script.sh justify --id abc123 --value space-between
bash scripts/script.sh align --id abc123 --value center
bash scripts/script.sh export --id abc123Quick card grid
bash scripts/script.sh row --name "cards" --items 4 --gap 16
bash scripts/script.sh wrap --id def456 --value wrapExport everything
bash scripts/script.sh export --all --output flex-layouts.css
βοΈ Configuration
bash shell~/.flex/π Tips & Best Practices
export command generates clean, production-ready CSS with class names derived from layout namesrow and column shortcuts for common patterns instead of createPowered by BytesAgain | bytesagain.com | hello@bytesagain.com