Agent skill
padz-output
Guide for customizing padz CLI output: templates, styles, and rendering. Use when working on: (1) Modifying templates in crates/padz/src/cli/templates/, (2) Adding or changing styles in styles/default.yaml, (3) Debugging output with --output flag, (4) Adding new commands that need rendered output, (5) Understanding the outstanding crate integration.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/padz-output
SKILL.md
Padz Output Customization
Architecture Overview
Padz uses a three-layer system for CLI output, much like web appl, wher the api returns a data object, and the rendering system (using outstanding create) uses file based templates (minijinja) + styles to render:
- Templates (Minijinja
.jinjafiles) - Define structure and layout - Styles (YAML stylesheet) - Define colors and formatting
- Renderer (outstanding crate) - Combines templates + styles with output mode
Quick Reference
Output Modes (--output flag)
padz list --output=auto # Default: colors for TTY, plain for pipes
padz list --output=term # Force ANSI colors
padz list --output=text # Plain text, no colors
padz list --output=term-debug # Debug: shows [style-name]text[/style-name]
padz list --output=json # Machine-readable JSON
Key Files
| Purpose | Location |
|---|---|
| Templates | crates/padz/src/cli/templates/*.jinja |
| Template registry | crates/padz/src/cli/templates.rs |
| Stylesheet | crates/padz/src/styles/default.yaml |
| Theme loading | crates/padz/src/cli/styles.rs |
| Rendering logic | crates/padz/src/cli/render.rs |
Templates
Templates use Minijinja syntax. Located in crates/padz/src/cli/templates/.
Main Templates
list.jinja- Pad list with columns, indentation, status iconsfull_pad.jinja- Complete pad view (title + content)text_list.jinja- Simple line-by-line outputmessages.jinja- Command feedback (success/error/info)
Partial Templates (reusable)
_pad_line.jinja- Single row in list (included by list.jinja)_match_lines.jinja- Search result highlighting_peek_content.jinja- Content preview for--peek_deleted_help.jinja- Help text for deleted section
Template Syntax
{#- Whitespace-trimming comment -#}
{% for pad in pads %}
{{- pad.title | col(width) | style("list-title") | nl -}}
{% endfor %}
Key filters from outstanding:
col(width, align='left'|'right')- Column layoutstyle("name")- Apply semantic stylenl- Explicit newlinetruncate_to_width()- Truncate with ellipsisindent(n)- Add indentation
Adding a New Template
-
Create
.jinjafile intemplates/directory -
Register in
templates.rs:rustpub const MY_TEMPLATE: &str = include_str!("templates/my_template.jinja"); -
Add to renderer in
create_renderer():rustrenderer.add_template("my_template", MY_TEMPLATE)?; -
Call from render function:
rustrenderer.render("my_template", &data)?
Styles (YAML Stylesheet)
Styles are defined in crates/padz/src/styles/default.yaml and embedded at compile time.
Three-Layer Architecture
# Layer 1: Visual (internal, prefixed with _)
_gold:
light:
fg: [196, 140, 0]
dark:
fg: [255, 214, 10]
# Layer 2: Presentation (aliases)
_accent: _gold
# Layer 3: Semantic (use in templates)
list-index: _accent
pinned:
bold: true
light:
fg: [196, 140, 0]
dark:
fg: [255, 214, 10]
Semantic Styles (use in templates)
List: list-index, list-title, pinned, deleted-index, deleted-title, status-icon
Content: title, time, hint
Messages: error, warning, success, info
Search: highlight, match
Help: help-header, help-section, help-command, help-desc, help-usage
Misc: help-text, section-header, empty-message, preview, truncation, line-number, separator
Adding a New Style
Add to default.yaml:
# Simple alias
my-style: _accent
# With modifiers
my-style:
bold: true
italic: true
light:
fg: [196, 140, 0]
dark:
fg: [255, 214, 10]
Use in templates: {{ value | style("my-style") }}
Style Embedding
Styles are embedded at compile time via embed_styles! macro:
pub static DEFAULT_THEME: Lazy<Theme> = Lazy::new(|| {
let mut registry = embed_styles!("src/styles");
registry.get("default").expect("Failed to load default theme")
});
Column Layout
Constants in render.rs:
pub const LINE_WIDTH: usize = 100;
pub const COL_LEFT_PIN: usize = 2;
pub const COL_STATUS: usize = 2;
pub const COL_INDEX: usize = 4;
pub const COL_RIGHT_PIN: usize = 2;
pub const COL_TIME: usize = 14;
Title width: LINE_WIDTH - fixed_columns - indent_width
JSON Output
For --output=json, data is serialized directly (bypasses templates).
JSON types in render.rs: JsonPadList, JsonPad, JsonMessages
Debugging Output
Use --output=term-debug to see style names:
[pinned]⚲[/pinned] [list-index]p1.[/list-index] [list-title]My Pad[/list-title]
References
- TEMPLATE_VARIABLES.md - Variables available in each template
- STYLE_REFERENCE.md - Complete style reference
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?