structured-output
Produce validated, schema-compliant structured data for direct consumption by tools, APIs, or pipelines.
ソース情報
- リポジトリ
- glayph/Agent
- ソースの最終更新活動
- 2026年9月19日 22:39
- 検出された SKILL.md の言語
- 英語
- スター
- 0
- フォーク
- 0
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
SKILL.md を表示中
SKILL.md
ソースの指示 · 読み取り専用プレビュー- name
- structured-output
- description
- Produce validated, schema-compliant structured data for direct consumption by tools, APIs, or pipelines.
- version
- 1.0.0
- author
- Miki
- license
- MIT
- platforms
- ["linux","macos","windows"]
- metadata
- {"Miki":{"tags":["structured-output","json","schema","tool-integration"],"related_skills":["testing-debugging"]}}
# Structured Output & Tool Integration
## Output formats by use case
### JSON (machine consumption)
```json
{
"action": "edit_file",
"params": { "filePath": "...", "oldString": "...", "newString": "..." }
}
```
### CSV/TSV (tabular data)
```
name,type,path
main,entry,src/index.ts
```
### Markdown tables (human + machine)
```markdown
| Key | Value |
|-----|-------|
|`timeout`|30000|
```
### YAML (config generation)
```yaml
server:
host: 127.0.0.1
port: 8000
```
## Schema-first approach
1. Define output shape before generating content
2. Validate output against schema after generation
3. Reject + retry if validation fails (max 2 retries)
## Tool integration patterns
### Pattern A — Direct tool call
Output maps 1:1 to tool parameters. Produce JSON that feeds directly into tool execution.
### Pattern B — Pipeline format
Output is an ordered array of tool calls for sequential execution:
```json
[
{ "tool": "grep", "args": { "pattern": "foo", "path": "src" } },
{ "tool": "read", "args": { "filePath": "<result>" } }
]
```
### Pattern C — Conditional branching
Output includes `condition` field to decide next step:
```json
{
"condition": "file_exists",
"if_true": { "tool": "read", ... },
"if_false": { "tool": "write", ... }
}
```
## Rules
- Always wrap JSON in code fences with language tag
- Flatten nesting to max 3 levels deep unless schema requires deeper
- Null fields: omit instead of including as `null`
- Arrays: prefer homogeneous types, no mixing
- Use snake_case for keys (matches opencode tool conventions)
GitHubで見る