Install
$ agentstack add skill-hsienw-ai-agent-engineering-playbook-tool-renderer-contract ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Tool Renderer Contract
Skill Interface
- Name: tool-renderer-contract.
- Description: Design and review structured tool-result rendering for tool calls, tool messages, structured tool outputs, status cards, fallback JSON or text displays, parser boundaries, display status mappings, and unknown tool results.
- Parameters: Tool result schema, raw message content, parser boundary, display status mapping, known specialized renderers, fallback rendering behavior, sensitive field policy, and verification cases.
- Instructions: Use this skill when rendering tool output in UI. Parse raw output as untrusted data, validate minimum structured fields, map status through a closed display union, provide safe fallbacks for unknown tools, and verify malformed, future-version, and sensitive-data cases.
Tool rendering should be schema-driven and resilient to unknown tools. The UI must not trust raw tool output as display-ready data.
Layers
- Message container: owns message grouping and association between tool call
metadata and tool output.
- Generic tool renderer: parses common metadata, displays status, and chooses a
specialized renderer when one is available.
- Specialized renderer: renders a known tool result schema.
- Fallback renderer: safely displays unknown JSON, text, or parse failures.
Structured Result Shape
Use a generic shape that can be specialized:
type ToolResult = {
schemaVersion: string;
tool: string;
status: TStatus;
data?: TData;
summary?: string;
errorCode?: string;
};
The frontend parser should accept unknown or raw message content, validate the minimum fields, and return a typed result or undefined.
Status Mapping
Map tool status through a closed display status union:
type ToolDisplayStatus =
| 'running'
| 'success'
| 'needs_input'
| 'not_found'
| 'denied'
| 'error'
| 'timeout'
| 'cancelled'
| 'unknown';
Use a single Record for labels, icons, colors, and ARIA text. Do not scatter status rendering across component branches.
Safety Rules
- Treat tool output as untrusted.
- Never render raw HTML from tool output unless sanitized by a trusted policy.
- Never expose stack traces, credentials, provider secrets, or raw internal
payloads.
- Do not infer status from user-visible text.
- Do not hardcode one tool result as the only rendering path.
- Unknown tools must have a safe fallback.
Parser Rules
- Validate
schemaVersion,tool, andstatus. - Preserve unknown fields for diagnostics only when safe.
- Be forward compatible with unknown minor schema versions.
- Provide unknown-status fallback.
- Keep type assertions behind runtime checks.
Verification
Test known structured results, unknown tool results, malformed JSON, plain text output, unknown status, future schema versions, error envelope rendering, and sensitive field redaction.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: HsienW
- Source: HsienW/ai-agent-engineering-playbook
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.