console-rendering作成者: github
Instructions for using the struct tag-based console rendering system in Go
npx skills add https://github.com/github/gh-aw --skill console-renderingConsole Rendering System Usage
This skill provides instructions for using the struct tag-based console rendering system.
Struct Tag Support
Use the console struct tag to control rendering behavior:
header:"Name"- Sets the display name for fields (used in both structs and tables)title:"Section Title"- Sets the title for nested structs, slices, or mapsformat:"type"- Sets the formatting type for the field valueformat:number- Formats integers as human-readable numbers (e.g., "1k", "1.2M")format:cost- Formats floats as currency with $ prefix (e.g., "$1.234")
omitempty- Skips the field if it has a zero value"-"- Always skips the field
Example Usage
type Overview struct {
RunID int64 `console:"header:Run ID"`
Workflow string `console:"header:Workflow"`
Status string `console:"header:Status"`
Duration string `console:"header:Duration,omitempty"`
}
data := Overview{
RunID: 12345,
Workflow: "test-workflow",
Status: "completed",
Duration: "5m30s",
}
// Simple rendering
fmt.Print(console.RenderStruct(data))
// Output:
// Run ID : 12345
// Workflow: test-workflow
// Status : completed
// Duration: 5m30s
Format Tag Examples
Number Formatting
type Metrics struct {
TokenUsage int `console:"header:Token Usage,format:number"`
Errors int `console:"header:Errors"`
}
data := Metrics{
TokenUsage: 250000,
Errors: 5,
}
// Renders as:
// Token Usage: 250k
// Errors : 5
Cost Formatting
type Billing struct {
Cost float64 `console:"header:Estimated Cost,format:cost"`
}
data := Billing{
Cost: 1.234,
}
// Renders as:
// Estimated Cost: $1.234
Rendering Behavior
Structs
Structs are rendered as key-value pairs with proper alignment.
Slices
Slices of structs are automatically rendered as tables:
type Job struct {
Name string `console:"header:Name"`
Status string `console:"header:Status"`
Conclusion string `console:"header:Conclusion,omitempty"`
}
jobs := []Job{
{Name: "build", Status: "completed", Conclusion: "success"},
{Name: "test", Status: "in_progress", Conclusion: ""},
}
fmt.Print(console.RenderStruct(jobs))
Renders as:
Name | Status | Conclusion
----- | ----------- | ----------
build | completed | success
test | in_progress | -
Maps
Maps are rendered as markdown-style headers with key-value pairs.
Special Type Handling
time.Time
time.Time fields are automatically formatted as "2006-01-02 15:04:05". Zero time values are considered empty when used with omitempty.
Unexported Fields
The rendering system safely handles unexported struct fields by checking CanInterface() before attempting to access field values.
githubのその他のスキル
acquire-codebase-knowledge
by github
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document…
acreadiness-assess
by github
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc…
acreadiness-generate-instructions
by github
Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS…
acreadiness-policy
by github
Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting…
add-educational-comments
by github
Add educational comments to code files to transform them into effective learning resources. Adapts explanation depth and tone to three configurable knowledge levels: beginner, intermediate, and advanced Automatically requests a file if none is provided, with numbered list matching for quick selection Expands files by up to 125% using educational comments only (hard limit: 400 new lines; 300 for files over 1,000 lines) Preserves file encoding, indentation style, syntax correctness, and...
adobe-illustrator-scripting
by github
Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate…
agent-governance
by github
Declarative policies, intent classification, and audit trails for controlling AI agent tool access and behavior. Composable governance policies define allowed/blocked tools, content filters, rate limits, and approval requirements — stored as configuration, not code Semantic intent classification detects dangerous prompts (data exfiltration, privilege escalation, prompt injection) before tool execution using pattern-based signals Tool-level governance decorator enforces policies at function...
agent-owasp-compliance
by github
Evaluate AI agent systems against the OWASP Agentic Security Initiative (ASI) Top 10 — the industry standard for agent security posture.