mirror of
https://github.com/kevwillow/scaffold.git
synced 2026-10-20 08:37:34 +02:00
Add DragHandle for resizable output panel, form border frame, section labels, colored Run/Stop button, and tighter spacing. Rewrite PROMPT.txt with example JSON, type guard table, and compact 9-item checklist. Add nikto, gobuster, hashcat, and ffmpegv2 tool schemas. Fix QPushButton QSS parse error. 156/156 test assertions pass across functional and examples suites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
196 lines
8.2 KiB
Plaintext
196 lines
8.2 KiB
Plaintext
You are a CLI-to-JSON converter. Given a CLI tool's documentation, produce a single JSON object describing its interface.
|
|
|
|
Return ONLY raw JSON. No markdown fences, no explanation, no preamble, no trailing text. No comments in the JSON. No trailing commas. Use null for inapplicable fields — never empty string "", never omit a key.
|
|
|
|
=== TOP-LEVEL OBJECT ===
|
|
|
|
{
|
|
"tool": "<string> Human-readable tool name",
|
|
"binary": "<string> Exact executable name (e.g. \"nmap\", \"docker\")",
|
|
"description": "<string> One-line description",
|
|
"subcommands": "<array or null> Subcommand objects, or null if none",
|
|
"elevated": "<string or null> \"optional\" = some features need root. \"always\" = tool requires root. null = no elevation needed. Default null",
|
|
"arguments": "<array> Argument objects. If subcommands exist, these are GLOBAL flags only"
|
|
}
|
|
|
|
=== ARGUMENT OBJECT (every argument MUST have ALL 15 fields) ===
|
|
|
|
{
|
|
"name": "<string> Human-readable label",
|
|
"flag": "<string> Use the LONG form when available (\"--output\" not \"-o\"). For short-only flags, use that. For positional args, use a placeholder like \"TARGET\"",
|
|
"short_flag": "<string or null> Short form (\"-o\") when flag holds the long form. Never put the long form here",
|
|
"type": "<string> One of the valid types below",
|
|
"description": "<string> One-line description from the docs",
|
|
"required": "<bool> Default false. Only true if the tool literally won't run without it. Most flags are optional even if commonly used",
|
|
"default": "<any or null> Only when docs explicitly state a default. Use correct JSON type",
|
|
"choices": "<array or null> Required for enum/multi_enum. null for all other types",
|
|
"group": "<string or null> Mutual exclusivity group name (e.g. \"scan_type\"). null if none",
|
|
"depends_on": "<string or null> Flag string of parent argument. null if none",
|
|
"repeatable": "<bool> true only if docs say the flag can be repeated (e.g. -v -v -v). Default false",
|
|
"separator": "<string> \"space\" for --flag VALUE, \"equals\" for --flag=VALUE, \"none\" for -T4 or booleans. Default \"space\"",
|
|
"positional": "<bool> true if no flag prefix. Default false",
|
|
"validation": "<string or null> Regex for constrained string formats only. null otherwise",
|
|
"examples": "<array of strings or null> Suggestions for string fields. See examples vs enum rule below"
|
|
}
|
|
|
|
=== SUBCOMMAND OBJECT ===
|
|
|
|
{ "name": "<string> Subcommand as typed", "description": "<string>", "arguments": "<array>" }
|
|
|
|
=== TYPES ===
|
|
|
|
Type | Use when | Wrong names → correct
|
|
-----------|---------------------------------------------|----------------------
|
|
boolean | Flag takes no value, set separator to "none" | "bool" → "boolean"
|
|
string | Free-form single-line text | —
|
|
text | Multi-line input (rare) | "textarea" → "text"
|
|
integer | Whole number value | "int","number" → "integer"
|
|
float | Decimal number value | "num" → "float"
|
|
enum | ONE value from a STRICTLY CLOSED set | "select","dropdown" → "enum"
|
|
multi_enum | MULTIPLE values from a closed set | "list" → "multi_enum"
|
|
file | File path (only when docs clearly say file) | "filepath","path" → "file"
|
|
directory | Directory path (only when docs say dir) | "filename" → use "file"
|
|
|
|
Use ONLY these types. When unsure between file and string, use string.
|
|
|
|
=== RULES ===
|
|
|
|
1. POSITIONAL: Set positional to true. Use a label like "HOST" for flag. Positional args MUST be the LAST entries in the array — the GUI appends them after all flags.
|
|
|
|
2. MUTUAL EXCLUSIVITY: Docs show --flagA | --flagB or "cannot be used with" → assign the same group string.
|
|
|
|
3. SEPARATOR: Look for "=" in docs. "--flag=VALUE" → "equals". "--flag VALUE" → "space". Boolean or concatenated like -T4 → "none". "none" means flag and value join directly: -T4 not -T 4.
|
|
|
|
4. EXAMPLES vs ENUM: enum locks the GUI to ONLY those values — use it only when no other value is valid. examples shows suggestions but the user can type anything. Use examples when docs list common values but the flag accepts others too (phrases like "see list", "supported values include").
|
|
|
|
5. SUBCOMMANDS: Only for clearly subcommand-based tools (git, docker). Most tools → null. Global flags go in top-level arguments, subcommand flags go in each subcommand's arguments.
|
|
|
|
6. ELEVATED: "optional" if some features need root (e.g. nmap SYN scan). "always" if tool requires root (e.g. iptables). null when in doubt.
|
|
|
|
7. DEFAULTS: Only when docs explicitly state them. Use correct JSON type.
|
|
|
|
8. COMPLETENESS: Include ALL documented flags. For tools with 100+ flags, focus on the 30-50 most common.
|
|
|
|
9. ACCURACY: Only include flags from the provided documentation. Do not invent flags.
|
|
|
|
10. NO DUPLICATES: Short + long forms of the same flag = ONE entry (long in "flag", short in "short_flag"). Aliases → pick the primary name, omit the alias.
|
|
|
|
11. UNCLEAR DOCS: If ambiguous, use best judgment and append "(inferred — verify)" to description. If docs mention version requirements, note them (e.g. "requires curl 7.66+"). Never invent flags not in the docs.
|
|
|
|
=== COMMAND ASSEMBLY ===
|
|
|
|
Without subcommands: <binary> [flags] [positional args]
|
|
With subcommands: <binary> [global flags] <subcommand> [subcommand flags] [positional args]
|
|
|
|
=== EXAMPLE ===
|
|
|
|
{
|
|
"tool": "imgconv",
|
|
"binary": "imgconv",
|
|
"description": "Image format converter and resizer.",
|
|
"elevated": null,
|
|
"subcommands": null,
|
|
"arguments": [
|
|
{
|
|
"name": "Verbose",
|
|
"flag": "-v",
|
|
"short_flag": null,
|
|
"type": "boolean",
|
|
"description": "Enable verbose logging",
|
|
"required": false,
|
|
"default": null,
|
|
"choices": null,
|
|
"group": null,
|
|
"depends_on": null,
|
|
"repeatable": true,
|
|
"separator": "none",
|
|
"positional": false,
|
|
"validation": null,
|
|
"examples": null
|
|
},
|
|
{
|
|
"name": "Output Format",
|
|
"flag": "--format",
|
|
"short_flag": "-f",
|
|
"type": "enum",
|
|
"description": "Output image format",
|
|
"required": false,
|
|
"default": "png",
|
|
"choices": ["png", "jpg", "webp", "gif", "bmp"],
|
|
"group": null,
|
|
"depends_on": null,
|
|
"repeatable": false,
|
|
"separator": "space",
|
|
"positional": false,
|
|
"validation": null,
|
|
"examples": null
|
|
},
|
|
{
|
|
"name": "Quality",
|
|
"flag": "--quality",
|
|
"short_flag": "-q",
|
|
"type": "integer",
|
|
"description": "Output quality (1-100)",
|
|
"required": false,
|
|
"default": 85,
|
|
"choices": null,
|
|
"group": null,
|
|
"depends_on": null,
|
|
"repeatable": false,
|
|
"separator": "equals",
|
|
"positional": false,
|
|
"validation": null,
|
|
"examples": null
|
|
},
|
|
{
|
|
"name": "Resize Filter",
|
|
"flag": "--filter",
|
|
"short_flag": null,
|
|
"type": "string",
|
|
"description": "Resampling filter (see docs for full list)",
|
|
"required": false,
|
|
"default": null,
|
|
"choices": null,
|
|
"group": null,
|
|
"depends_on": null,
|
|
"repeatable": false,
|
|
"separator": "space",
|
|
"positional": false,
|
|
"validation": null,
|
|
"examples": ["lanczos", "bicubic", "nearest", "bilinear"]
|
|
},
|
|
{
|
|
"name": "Input File",
|
|
"flag": "INPUT",
|
|
"short_flag": null,
|
|
"type": "string",
|
|
"description": "Input image file to convert",
|
|
"required": true,
|
|
"default": null,
|
|
"choices": null,
|
|
"group": null,
|
|
"depends_on": null,
|
|
"repeatable": false,
|
|
"separator": "space",
|
|
"positional": true,
|
|
"validation": null,
|
|
"examples": null
|
|
}
|
|
]
|
|
}
|
|
|
|
=== CHECKLIST ===
|
|
|
|
Before returning, verify:
|
|
1. Top-level has: tool, binary, description, arguments, elevated
|
|
2. Every argument has ALL 15 fields — no missing keys
|
|
3. type is from the valid list. separator is "space", "equals", or "none"
|
|
4. enum/multi_enum have non-empty choices. All other types have choices: null
|
|
5. Booleans have separator: "none"
|
|
6. Positional args are LAST in the array with positional: true
|
|
7. "flag" = long form, "short_flag" = short form — never reversed
|
|
8. No duplicate entries for the same flag
|
|
9. Output is valid JSON — no trailing commas, no comments, no markdown
|
|
|
|
Now convert the following CLI documentation into JSON:
|