Explore the CLI help and discoverability system for this tool. I need to understand: 1.…
- User
Explore the CLI help and discoverability system for this tool. I need to understand:
- How argparse is set up — look at
desloppify/app/cli_support/parser_groups.pyandparser_groups_admin.pyanddesloppify/cli.py - What subcommands exist under
plan— look atdesloppify/app/commands/plan/cmd.pyand related files - What ALL top-level commands exist and their help text
- Is there any
--helpoutput customization? - Are there descriptions/epilogs on the parsers?
- What does the actual user see when they run
desloppify --help,desloppify plan --help, etc?
Be very thorough — read the full parser setup files and the plan command module.
- How argparse is set up — look at
Assistant
I'll thoroughly explore the CLI help and discoverability system. Let me start by examining the key files.
Assistant
Now let me examine the parser creation and the plan command module:
Assistant
Now let me read the main parser file:
Assistant
Perfect! Now let me check what the actual help output looks like by running the CLI commands:
Assistant
Excellent! Now let me get more detail on the plan subcommands:
Assistant
Now let me get a few more subcommand details and check for any hidden help features:
Assistant
Perfect! Now let me check a few more commands to get a complete picture, and also look at the commands registry:
Assistant
Excellent! Let me also check the detect command epilog with detector names:
Assistant
Now let me check a few more important commands and look at how parser groups are organized:
Assistant
Perfect! Now let me check the help customization and any special help handling:
Assistant
Excellent! Now let me create a comprehensive summary document. Let me verify the parser structure one more time:
Assistant
Perfect! Now I have a complete understanding. Let me create a comprehensive summary report:
CLI Help and Discoverability System - Comprehensive Analysis
Based on a thorough exploration of the codebase, here's the complete picture of how the desloppify CLI's help system is structured:
1. Argparse Architecture Overview
Entry Points:
/Users/user_c042661f/Documents/desloppify/desloppify/cli.py- Main entry point withmain()function/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser.py- Core parser builder/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups.py- Re-exports fromparser_groups_admin.py/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.py- Individual command parser builders (11 functions)
Key Parser Customization:
- Custom
_NoAbbrevArgumentParserclass disables long-option abbreviation (allow_abbrev=False) - Uses
argparse.RawDescriptionHelpFormatterfor proper formatting of epilog sections - Top-level parser marked with
required=Trueon subcommands
2. Top-Level Commands (18 Total)
When you run
desloppify --help, all 18 commands are listed:Command Help Text Type scanRun all detectors, update state, show diff Workflow statusScore dashboard with per-tier progress Workflow treeAnnotated codebase tree (text) Workflow showDig into findings by file, directory, detector, or ID Workflow nextShow next highest-priority open finding Workflow resolveMark finding(s) as fixed/wontfix/false_positive/open Workflow ignoreAdd pattern to ignore list, remove matching findings Workflow fixAuto-fix mechanical issues Workflow planLiving plan: generate, reorder, cluster, skip, note Workflow vizGenerate interactive HTML treemap Workflow detectRun a single detector directly (bypass state) Admin moveMove a file or directory and update all import references Admin reviewPrepare or import holistic subjective review Admin zoneShow/set/clear zone classifications Admin configShow/set/unset project configuration Admin devDeveloper utilities Admin langsList all available language plugins with depth and tools Admin update-skillInstall or update the desloppify skill/agent document Admin
3. Global Options (3 Total)
Available on all commands:
code--lang LANG Language to scan (auto-detected if omitted) --exclude PATTERN Path pattern to exclude (repeatable) --version, -V Show version -h, --help Show help
4. Subcommand Hierarchy - The
planCommand FamilyThe
plancommand is the most complex, with 11 subcommands + nested cluster subcommands:Direct
planSubcommands (11):plan show- Show plan metadata summaryplan reset- Reset plan to emptyplan move- Move findings in the queueplan describe- Set augmented descriptionplan note- Set note on findingsplan skip- Skip findings (temp/permanent/false positive)plan unskip- Bring skipped findings backplan done- Mark findings as fixed (purges from plan)plan reopen- Reopen resolved findingsplan focus- Set or clear active cluster focusplan cluster- Manage finding clusters (nested)
Nested
plan clusterSubcommands (7):plan cluster create- Create a clusterplan cluster add- Add findings to clusterplan cluster remove- Remove findings from clusterplan cluster delete- Delete a clusterplan cluster move- Move cluster as a blockplan cluster show- Show cluster detailsplan cluster list- List all clusters
Plan-level Options:
code--state STATE Path to state file --output FILE Write to file instead of stdoutFull help for
plan cluster createexample:codeusage: desloppify plan cluster create [-h] [--description DESCRIPTION] [--action ACTION] cluster_name positional arguments: cluster_name Cluster name (slug) options: --description DESCRIPTION Cluster description --action ACTION Primary action/command for this cluster
5. Commands with Epilog/Dynamic Help Text
detectcommand: Epilog lists all 45+ available detectorscodedetectors: boilerplate_duplication, cargo_error, clippy_warning, clj_kondo_finding, concerns, coupling, cppcheck_finding, credo_issue, cycles, deprecated, dialyzer_warning, dict_keys, dupes, eslint_warning, exports, facade, flat_dirs, fsharp_error, global_mutable_config, hlint_suggestion, ... (45+ total)fixcommand: Epilog lists all available fixers by languagecodefixers (bash): none yet fixers (clojure): none yet fixers (javascript): eslint-warning fixers (kotlin): ktlint-violation fixers (python): none yet fixers (ruby): rubocop-offense fixers (rust): clippy-warning fixers (typescript): dead-useeffect, debug-logs, empty-if-chain, unused-imports, unused-params, unused-vars fixers (zig): none yet special: review — prepare structured review data
6. Help with Examples
The main
--helpoutput includes a USAGE_EXAMPLES section at the bottom (defined in/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser.pylines 29-68):Workflow examples section showcases:
scan,status,tree,show,resolve,ignore,zone,review,plan
Practical examples including:
codedesloppify scan --skip-slow desloppify --lang python scan --path scripts/desloppify desloppify tree --focus shared/components --sort findings --depth 3 desloppify show src/shared/components/PromptEditorModal.tsx desloppify resolve fixed "unused::src/foo.tsx::React" \ --note "removed unused React import" \ --attest "I have actually..." desloppify detect logs --top 10 desloppify review --validate-import findings.json --attested-external desloppify dev scaffold-lang go --extension .go --marker go.mod desloppify move src/shared/hooks/useFoo.ts src/shared/hooks/video/useFoo.ts
7. Help Customization Features
Parser Customizations:
allow_abbrev=False- Prevents abbreviating long options (strict matching)RawDescriptionHelpFormatter- Preserves formatting in epilogs- Custom
_DeprecatedActionand_DeprecatedBoolActionclasses for handling deprecated options
Deprecated Options Example (in
review):pythonp_review.add_argument("--max-age", ..., action=_DeprecatedAction, ...) # Prints: "Warning: --max-age is deprecated and will be removed..."
8. Command Handler Resolution
Commands are dispatched via a centralized registry in
/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/registry.py:python_COMMAND_HANDLERS = { "scan": cmd_scan, "status": cmd_status, "show": cmd_show, "next": cmd_next, "resolve": cmd_resolve, "ignore": cmd_ignore_pattern, "fix": cmd_fix, "plan": cmd_plan, # <-- Entry point for all plan subcommands "detect": cmd_detect, "tree": cmd_tree, "viz": cmd_viz, "move": cmd_move, "zone": cmd_zone, "review": cmd_review, "config": cmd_config, "dev": cmd_dev, "langs": cmd_langs, "update-skill": cmd_update_skill, }Plan Command Dispatch: The
cmd_plan()function in/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/plan/cmd.pydispatches to:_cmd_plan_generate()when no subcommand given (backwards compatible, generates markdown)_cmd_plan_show(),_cmd_plan_reset(),cmd_plan_move(), etc. based onplan_actioncmd_cluster_dispatch()for cluster subcommandscmd_plan_override_handlersmodule for skip/unskip/done/reopen/describe/note/focus
9. Key Features of Help Discoverability
Feature Status Details Main help with examples ✓ desloppify --helpincludes workflow section + examplesSubcommand help ✓ desloppify plan --helplists all 11 subcommandsNested subcommand help ✓ desloppify plan cluster --helplists 7 cluster actionsEpilog with detector list ✓ desloppify detect --helpshows all 45+ detectorsEpilog with fixer list ✓ desloppify fix --helpshows fixers per languageOption descriptions ✓ All options have help=text (some extensive)Choices documentation ✓ Enums like --profile {objective,full,ci}shownAttestation requirements ✓ Help text explains anti-gaming requirements Required attestation shown ✓ --attest ATTESTmarked as required in docsBackwards compatibility note ✓ Plan with no subcommand generates markdown (v0.7.x behavior)
10. What Users See at Runtime
No command:
codedesloppify: error: the following arguments are required: commanddesloppify --help:- Usage line with all 18 commands
- 3 global options documented
- Workflow section (15 items)
- Examples section (20+ practical commands)
desloppify plan --help:- Usage with 11 subcommands listed
- Brief 1-line help for each subcommand
--stateand--outputoptions documented
desloppify plan cluster --help:- Usage with 7 cluster actions listed
- Brief help for each action
desloppify detect --help:- All detector names listed in epilog
- Useful for discovering available detectors
desloppify fix --help:- All fixers organized by language in epilog
- Shows which languages have available fixers
11. File Structure Summary
codedesloppify/ ├── cli.py # Main entry, handles args & dispatch ├── app/ │ ├── cli_support/ │ │ ├── parser.py # Parser builder, USAGE_EXAMPLES │ │ ├── parser_groups.py # Re-exports (11 parser functions) │ │ └── parser_groups_admin.py # Actual 11 parser builder functions │ └── commands/ │ ├── registry.py # Command handler dispatch map │ ├── plan/ │ │ └── cmd.py # Plan dispatcher (11 subcommands) │ ├── plan/ │ │ ├── move_handlers.py │ │ ├── cluster_handlers.py │ │ └── override_handlers.py │ └── [...other command modules...]
Key Insights for Help System Design
- Two-tier dispatch: CLI args → command handlers → subcommand handlers (for plan)
- Decentralized parsing: Each command's parser built by dedicated
_add_X_parser()function - Dynamic content: Detector names and fixer lists computed at parser creation time
- Discoverability: Examples section + epilogs supplement argparse defaults
- Anti-gaming: Help text prominently features attestation requirements
- Backwards compatibility: Plan command auto-generates markdown when no subcommand given
This system balances comprehensive help (examples, detector lists, fixer availability) with strict argparse discipline (no abbreviations, required subcommands, explicit option validation).
- User
I need to understand the full parser infrastructure for desloppify to plan help text improvements.
Read these files completely:
desloppify/app/cli_support/parser.py— the main parser builder with USAGE_EXAMPLESdesloppify/app/cli_support/parser_groups_admin.py— all the individual command parser builder functions
I need to know:
- How parsers are created and grouped
- Whether argparse argument groups are used anywhere
- How epilog text is formatted
- What help text each argument has (or is missing)
- The exact structure of each
_add_*_parser()function - Any patterns for adding descriptions/epilogs
Be very thorough — read both files completely.
Assistant
I'll read both files completely to understand the parser infrastructure.
Assistant
Now let me check if there's a
parser_groups.pyfile that contains more of the parser builders:- User
I need to understand the current output of plan-related commands to design better discoverability.
Read these files:
desloppify/app/commands/plan/cmd.py— the plan command dispatcher, especially_cmd_plan_show()and_cmd_plan_generate()desloppify/app/commands/next.py— the next commanddesloppify/app/commands/next_parts/output.py— next output renderingdesloppify/app/commands/next_parts/render.py— next renderingdesloppify/app/commands/status_cmd.py— status commanddesloppify/app/commands/status_parts/render.py— status rendering
I want to understand:
- What does
plan(no subcommand) show? - What does
plan showshow? - What does
nextshow? - What does
statusshow? - Is there any command that gives a "full queue view" of upcoming items?
- What data is available that could be surfaced in a compact queue overview?
Be thorough — read the actual rendering logic.
Assistant
I'll read through these files to understand the output of plan-related commands and identify what data is available for queue visualization.
Assistant
Now let me examine the plan-related command implementation more carefully:
Assistant
Let me check the plan markdown generation and understand the queue structure:
Assistant
Excellent. Now let me look at the work queue building to understand tier counts and available data:
Assistant
Let me continue reading the work queue implementation:
Assistant
Perfect! I now have a complete view of the parser infrastructure. Let me provide you with a comprehensive analysis.
Complete Parser Infrastructure Analysis
Overview
The CLI parser system is organized in three main files:
parser.py- Top-level parser builder with the maincreate_parser()functionparser_groups.py- Re-export hub that aggregates parser buildersparser_groups_admin.py- Actual implementation of all_add_*_parser()functions
Key Structural Findings
1. Parser Creation Pattern
File:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser.py(lines 73-142)- Uses custom
_NoAbbrevArgumentParserclass (line 73-78) that disables long-option abbreviation viaallow_abbrev=False - Top-level parser uses
argparse.RawDescriptionHelpFormatterto preserve epilog formatting (line 97) - Epilog is set to
USAGE_EXAMPLESconstant (lines 30-70) - Top-level arguments:
--lang,--exclude,--version - Subparsers created with
add_subparsers(dest="command", required=True)(lines 118-122)
2. Parser Grouping & Organization
Pattern:
- Each major command gets its own
_add_*_parser(sub)function that:- Calls
sub.add_parser(name, help="...", epilog=...) - Adds arguments via
add_argument() - For commands with subcommands, calls
add_subparsers(dest="...")to create nested parsers
- Calls
Hierarchy of Commands:
- Simple subcommands (single level): scan, status, tree, show, next, resolve, ignore, exclude, fix, viz, dev, langs, update-skill
- Commands with subcommands (two levels): plan, zone, config, review
3. Argparse Argument Groups
Status: NOT USED ANYWHERE. The code uses simple sequential
add_argument()calls without creating explicit argument groups viaadd_argument_group().4. Epilog Formatting
Approach:
- Uses
RawDescriptionHelpFormatterto preserve line breaks and formatting - Epilogs are embedded in individual
_add_*_parser()calls:- Line 43:
_add_detect_parser()uses epilog with comma-separated detector names - Line 411:
_add_fix_parser()uses epilog from helper function_fixer_help_lines()
- Line 43:
USAGE_EXAMPLES Structure (lines 30-70):
codeworkflow: [list of high-level commands with descriptions] examples: [actual CLI invocations]5. Complete Argument Inventory by Command
SCAN (lines 42-83 in parser_groups.py)
--path(str)--state(str)--reset-subjective(flag)--skip-slow(flag)--profile(choices: objective, full, ci)--force-resolve(flag)--no-badge(flag)--badge-path(str)--lang-opt(repeatable KEY=VALUE)
STATUS (lines 86-89)
--state(str)--json(flag)
TREE (lines 92-111)
--path(str)--state(str)--depth(int, default: 2)--focus(str)--min-loc(int)--sort(choices: loc, findings, coupling)--detail(flag)
SHOW (lines 114-153)
- POSITIONAL:
pattern(optional) --state(str)--status(choices: open, fixed, wontfix, false_positive, auto_resolved, all)--top(int, default: 20)--output(str, FILE metavar)--chronic(flag)--code(flag)--notes(str, FILE metavar)
NEXT (lines 156-214)
--state(str)--tier(choices: 1, 2, 3, 4)--count(int, default: 1)--scope(str)--status(choices: open, fixed, wontfix, false_positive, auto_resolved, all, default: open)--group(choices: item, file, detector, tier, default: item)--format(choices: terminal, json, md, default: terminal)--explain(flag)--no-tier-fallback(flag)--cluster(str, NAME metavar)--include-skipped(flag)--output(str, FILE metavar)
RESOLVE (lines 217-249)
- POSITIONAL:
status(choices: open, fixed, wontfix, false_positive) - POSITIONAL:
patterns(nargs="+", PATTERN metavar) --note(str)--attest(str, long help text)--confirm-batch-wontfix(flag)--state(str)
IGNORE (lines 252-267)
- POSITIONAL:
pattern(str) --attest(str, long help text)--state(str)
EXCLUDE (lines 270-274)
- POSITIONAL:
pattern(str)
DETECT (lines 39-75 in parser_groups_admin.py)
- POSITIONAL:
detector(str) --top(int, default: 20)--path(str)--json(flag)--fix(flag, logs detector only)--category(choices: imports, vars, params, all, default: all)--threshold(float)--file(str)--lang-opt(repeatable KEY=VALUE)
FIX (lines 407-420)
- POSITIONAL:
fixer(str) --path(str)--state(str)--dry-run(flag)- EPILOG: Generated by
_fixer_help_lines()showing fixers per language
PLAN (lines 423-573)
Parent command with nested subcommands:
--state(str)--output(str, FILE metavar)- Nested: show — no arguments
- Nested: reset — no arguments
- Nested: move
- POSITIONAL:
patterns(nargs="+", PATTERN metavar) - POSITIONAL:
position(choices: top, bottom, before, after, up, down) - POSITIONAL:
target(optional, nargs="?")
- POSITIONAL:
- Nested: describe
- POSITIONAL:
patterns(nargs="+", PATTERN metavar) - POSITIONAL:
text(str)
- POSITIONAL:
- Nested: note
- POSITIONAL:
patterns(nargs="+", PATTERN metavar) - POSITIONAL:
text(str)
- POSITIONAL:
- Nested: skip
- POSITIONAL:
patterns(nargs="+", PATTERN metavar) --reason(str)--review-after(int, N metavar)--permanent(flag, requires --note and --attest)--false-positive(flag, requires --attest)--note(str)--attest(str)
- POSITIONAL:
- Nested: unskip
- POSITIONAL:
patterns(nargs="+", PATTERN metavar)
- POSITIONAL:
- Nested: done
- POSITIONAL:
patterns(nargs="+", PATTERN metavar) --attest(str, required)
- POSITIONAL:
- Nested: reopen
- POSITIONAL:
patterns(nargs="+", PATTERN metavar)
- POSITIONAL:
- Nested: focus
- POSITIONAL:
cluster_name(optional, nargs="?") --clear(flag)
- POSITIONAL:
- Nested: cluster (with sub-nested commands)
- create
- POSITIONAL:
cluster_name(str) --description(str)--action(str)
- POSITIONAL:
- add
- POSITIONAL:
cluster_name(str) - POSITIONAL:
patterns(nargs="+", PATTERN metavar)
- POSITIONAL:
- remove
- POSITIONAL:
cluster_name(str) - POSITIONAL:
patterns(nargs="+", PATTERN metavar)
- POSITIONAL:
- delete
- POSITIONAL:
cluster_name(str)
- POSITIONAL:
- move
- POSITIONAL:
cluster_name(str) - POSITIONAL:
position(choices: top, bottom, before, after, up, down) - POSITIONAL:
target(optional, nargs="?")
- POSITIONAL:
- show
- POSITIONAL:
cluster_name(str)
- POSITIONAL:
- list — no arguments
- create
VIZ (lines 576-580)
--path(str)--output(str)--state(str)
MOVE (lines 78-88)
- POSITIONAL:
source(str) - POSITIONAL:
dest(str) --dry-run(flag)
REVIEW (lines 91-363)
--path(str)--state(str)--prepare(flag)--import(str, FILE metavar, dest="import_file")--validate-import(str, FILE metavar, dest="validate_import_file")--allow-partial(flag)--manual-override(flag)--attested-external(flag)--attest(str, complex help)--max-age(int, deprecated via_DeprecatedAction)--max-files(int, deprecated via_DeprecatedAction)--refresh(flag, deprecated via_DeprecatedBoolAction)--dimensions(str, comma-separated)--retrospective(flag)--retrospective-max-issues(int, default: 30)--retrospective-max-batch-items(int, default: 20)--holistic(flag, deprecated via_DeprecatedBoolAction)--run-batches(flag)--external-start(flag)--external-submit(flag)--session-id(str)--external-runner(choices: claude, default: claude)--session-ttl-hours(int, default: 24)--runner(choices: codex, default: codex)--parallel(flag)--max-parallel-batches(int, default: 3)--batch-timeout-seconds(int, default: 1200)--batch-max-retries(int, default: 1)--batch-retry-backoff-seconds(float, default: 2.0)--batch-heartbeat-seconds(float, default: 15.0)--batch-stall-warning-seconds(int, default: 0)--batch-stall-kill-seconds(int, default: 120)--dry-run(flag)--save-run-log(flag, deprecated no-op)--run-log-file(str)--packet(str)--only-batches(str, comma-separated)--scan-after-import(flag)--force-review-rerun(flag)--merge(flag)--similarity(float, 0-1, default: 0.8)
ZONE (lines 366-380)
Parent command with nested subcommands:
--path(str)--state(str)- Nested: show — no arguments
- Nested: set
- POSITIONAL:
zone_path(str) - POSITIONAL:
zone_value(str, zone type)
- POSITIONAL:
- Nested: clear
- POSITIONAL:
zone_path(str)
- POSITIONAL:
CONFIG (lines 383-391)
Parent command with nested subcommands:
- Nested: show — no arguments
- Nested: set
- POSITIONAL:
config_key(str) - POSITIONAL:
config_value(str)
- POSITIONAL:
- Nested: unset
- POSITIONAL:
config_key(str)
- POSITIONAL:
DEV (lines 583-620)
Parent command with nested subcommands:
- Nested: scaffold-lang
- POSITIONAL:
name(str, snake_case) --extension(repeatable)--marker(repeatable)--default-src(str, DIR metavar, default: src)--force(flag)--no-wire-pyproject(flag, dest="wire_pyproject", sets default True)
- POSITIONAL:
LANGS (lines 623-624)
- No arguments
UPDATE-SKILL (lines 627-638)
- POSITIONAL:
interface(optional, nargs="?")
6. Key Patterns & Conventions
Help Text Patterns:
- All commands have minimal help strings (1-2 sentences)
- Long explanations go in epilogs (using
RawDescriptionHelpFormatter) - Attestation arguments have very detailed multi-line help (e.g., lines 236-240 in resolve)
Deprecation Pattern:
- Uses custom
_DeprecatedActionand_DeprecatedBoolActionclasses (lines 11-36) - These print stderr warnings and store values
- Examples:
--max-age,--max-files,--refresh,--holisticin review
Metavar Usage:
- Common:
FILE,PATTERN,DIR,KEY=VALUE,EXT,N,NAME - Applied consistently (e.g., all path outputs use
FILEmetavar)
Type Coercion:
- All use explicit
type=str|int|float action="store_true"for boolean flagschoices=[...]for enumsdefault=...for defaultsnargs=...for variadic args ("+", "?", 0)
Nested Subcommands:
- Properly nested:
plan→cluster→ create/add/remove/delete/move/show/list - Uses
dest=...to name the subcommand capture variable - Required subcommands use
required=True(line 585 in dev)
7. What's Missing (Help Text Gaps)
The following commands/arguments lack help text (empty or minimal):
scan --path(no help)scan --state(no help)status --state(no help)status --json(no help)tree --path(no help)tree --state(no help)tree --focus(no help)show --state(no help)next --state(no help)next --tier(no help, but has choices)resolve --note(no help)detect --top(no help)detect --path(no help)detect --json(no help)detect --file(no help)fix --path(no help)fix --state(no help)plan --state(no help)plan --output(no help)viz --path(no help)viz --output(no help)viz --state(no help)move --source(partial help)move --dest(partial help)review --path(no help)review --state(no help)zone --path(no help)zone --state(no help)
Summary
The parser infrastructure is well-organized but minimally documented. No argument groups are used; instead, simple sequential
add_argument()calls build a flat list. Epilogs contain multi-line examples and formatter-aware text. The system uses custom deprecation actions and proper nesting for complex command families. Most--state,--path, and--outputarguments lack help text, which would be good targets for improvement.Assistant
Perfect. Now I have a comprehensive understanding. Let me compile the findings into a clear report:
Summary: Current Plan/Queue Output & Available Data
I've thoroughly examined the rendering logic across all plan-related commands. Here's what's currently available:
Command Output Overview
desloppify plan(no subcommand) — generates prioritized markdownOutput: Full markdown plan document with:
- Header: overall/objective/strict scores, file/LOC/directory counts
- Dimension health table (all objective + subjective dimensions with checks/issues/health/strict/action)
- Tier summary (open/total/% addressed per tier)
- User-Ordered Queue section (if plan exists):
- Items ordered by
queue_order - Grouped by clusters with descriptions
- Each item shows: tier/confidence badge, summary, id, description, note
- Items ordered by
- Remaining section (items NOT in plan): all other mechanical items by tier/file
- Skipped section (if plan exists): grouped by kind (temporary/permanent/false_positive)
- Superseded section (if plan exists): broken plan refs
- Addressed section: fixed/auto-resolved/wontfix counts + wontfix explanations
Key limitation: No compact queue overview. It's either full markdown or nothing.
desloppify plan show— plan metadata summaryOutput: Text summary of living plan state:
codeOrdered items: N Skipped: N (temp: X, wontfix: Y, fp: Z) Clusters: N cluster_name: M items — description (focused) Overrides: N Focus: cluster_name Superseded: NInsight: Shows plan structure metadata but NO queue preview or ordering info.
desloppify next— next highest-priority item(s)Output (terminal):
- Tier Navigator header: T1/T2/T3/T4 counts with tier-switch commands
- Optionally "Focused on: cluster_name (N of M remaining)"
- Single top item OR grouped items with details:
- Tier/confidence badge, summary, file, id
- Plan metadata if present: description, cluster membership, note, skip status
- Dimension context, score impact estimate
- Resolution hints and auto-fix suggestions
- Followup nudges: dimension gaps, subjective status
Output (JSON/query.json):
json{ "command": "next", "items": [...], "queue": { "tier_counts": {1: N, 2: N, 3: N, 4: N}, "requested_tier": ..., "selected_tier": ..., "total": N }, "plan": { "active": true, "focus": "cluster_name", "clusters": [{name, description, item_count}, ...], "total_ordered": N, "total_skipped": N } }
desloppify status— score dashboardOutput:
- Score summary (overall/objective/strict/verified)
- Scan metrics, completeness, open scope breakdown
- Dimension health table with progress bars
- Focus suggestion (lowest dimension or active cluster)
- Subjective followup nudges
- Review summary
- Structural debt by area (T3/T4, grouped by area)
- Agent Plan header (if plan active):
- Shows focus cluster + remaining count
- Otherwise shows top 1-2 narrative actions
- Ignore list + suppression metrics
Output (JSON/query.json):
json{ "command": "status", "overall_score": ..., "dimension_scores": {...}, "plan": { "active": true, "focus": "cluster_name", "total_ordered": N, "total_skipped": N } }
What Data is Available for Queue Discovery?
From the code, the living plan has this full structure (
.desloppify/plan.json):python{ "queue_order": [fid1, fid2, ...], # User-ordered item IDs "clusters": { "cluster_name": { "finding_ids": [fid, ...], # Cluster membership "description": "...", # User description "action": "desloppify fix ...", # Cluster action command "auto": True/False }, ... }, "skipped": { fid: { "kind": "temporary|permanent|false_positive", "reason": "...", "note": "...", "skipped_at_scan": N, "review_after": N }, ... }, "overrides": { fid: { "description": "...", # User override description "note": "...", # User override note "cluster": "cluster_name" }, ... }, "active_cluster": "cluster_name", # Focused cluster (or None) "superseded": { fid: { "original_summary": "...", "candidates": [alt_fid, ...], "note": "..." }, ... } }Each work queue item also carries plan metadata when rendering:
queue_position— position in merged queueplan_description,plan_note— overridesplan_cluster— cluster membership with name/desc/total_itemsplan_skipped,plan_skip_kind,plan_skip_reason— skip status
Key Findings for Discoverability
-
No compact queue view currently exists —
plan showis metadata-only;plan(no subcommand) is full markdown;nextshows 1 item by default -
Available for a compact queue overview:
tier_countsfrom work queue (T1/T2/T3/T4 open counts)queue_orderlength (total ordered items)- Number of clusters and their sizes
- Number of skipped items by kind
- Active cluster name + remaining member count
- Superseded count
-
Item-level data available per queue position:
- Tier, confidence, detector, file, summary, id
- Plan description, note, cluster membership
- Skip status + reason
- Dimension impact (if dimension_scores exist)
- Auto-fix capability
-
What's NOT currently surfaced:
- A quick-reference queue table showing N items in order with tier/status/cluster assignment
- Progress bars for ordered vs remaining vs skipped
- Cluster membership visualization (which items are in which cluster)
- Queue position numbers in terminal output (only in JSON)
Recommendation
A new
desloppify plan viewsubcommand (ordesloppify queue) could offer:- Compact table of next 10-20 items with:
#Pos | Tier | Cluster | Summary | Status - Stats bar showing:
5 ordered | 12 remaining | 3 skipped | 2 clusters - Tier breakdown showing distribution across T1/T2/T3/T4
- Cluster expansion to drill into members
All data already exists in the work queue + plan; just needs a compact rendering layer.
- User
I need to design improvements to the desloppify CLI's discoverability. Two interconnected goals:
Goal 1: Richer --help output
The current state:
- 18 top-level commands in a flat list with terse one-liners
planhas 11 subcommands + 7 nested cluster subcommands — no conceptual explanationreviewhas 40+ options in a flat wall- Many arguments lack help text entirely (--path, --state, --output, --json on many commands)
- No workflow guidance — users don't know when to use what
- No examples on individual command help pages (only on top-level)
File to modify:
desloppify/app/cli_support/parser_groups_admin.py(all parser builder functions) Also:desloppify/app/cli_support/parser.py(top-level parser, USAGE_EXAMPLES)Specific improvements needed:
-
Top-level
--help: Better command grouping. Currently there's a "workflow:" section in the epilog that re-lists commands. Could use argparse subparser groups or improve the epilog to clearly show: Core Workflow (scan → status → next → resolve), Investigation (show, tree, detect), Plan Management (plan), and Admin/Setup (zone, config, dev, langs, etc.) -
Missing help text: Add help= to all args that lack it. Common ones used across many commands:
--path: "Project root directory (default: cwd)"--state: "Path to state file (default: .desloppify/state-{lang}.json)"--output FILE: "Write output to file instead of terminal"--json: "Output as JSON"
-
Plan command: Needs a description/epilog explaining the concept, workflow, and examples:
- What the "living plan" is
- Typical workflow: scan → plan → focus on cluster → next → resolve
- Examples for common operations
-
Review command: Group the 40+ options using
add_argument_group():- "Core options" (--prepare, --import, --validate-import, --allow-partial)
- "External review" (--external-start, --external-submit, --session-id, --external-runner, --session-ttl-hours, --attested-external)
- "Batch execution" (--run-batches, --runner, --parallel, --max-parallel-batches, --batch-timeout-seconds, etc.)
- "Trust & attestation" (--manual-override, --attest, --attested-external)
- "Advanced" (--merge, --similarity, --packet, --only-batches, etc.)
-
Individual command epilogs: Add brief examples to key commands (show, resolve, next, plan subcommands)
Goal 2: Compact queue overview
Currently there's no way to see a quick overview of the full upcoming work queue:
plan(no subcommand) generates full verbose markdownplan showonly shows metadata countsnextshows 1 item by defaultnext --count Nshows N items but no structural overview
The user wants a stripped-back view showing all upcoming items compactly so they can see the full picture within limited context.
Option A: Enhance
plan showto include a compact queue table Option B: Addplan queuesubcommand for a table view Option C: Enhancenext --count all --format compactor similarAll the data exists in the work queue (tier, cluster, summary, position) — just needs compact rendering.
Constraints:
- Must work within argparse's capabilities
- Use
RawDescriptionHelpFormatterwhich is already set up - Don't break existing command behavior
- Keep help text concise — walls of text defeat the purpose
- The custom
_NoAbbrevArgumentParserclass is already used
Questions to answer:
- What's the best approach for grouping top-level commands?
- Which specific commands most need epilog examples?
- Where should the compact queue view live?
- Should we use argparse argument groups or just better epilog organization for review?
Design a concrete implementation plan with specific text changes and file locations.
Assistant
I'll start by thoroughly exploring the codebase to understand the current CLI structure, parser setup, and relevant rendering code.
Assistant
Now let me explore the related rendering and command files to understand the current output patterns.
Assistant
Now let me look at the work queue rendering and the plan generation code to understand the data available for a compact queue view.
Assistant
Let me also check the status command and look at how the auto-cluster system works, since that's relevant to the compact queue view.
Assistant
Let me check the output_api for the
print_tableutility and also examine the rendering helpers to understand available tools.Assistant
Now let me check a few more relevant pieces: how
plan showis called and the existing CLI output for context, plus looking at how argparse argument_groups work in the current codebase.Assistant
Now let me look at how the plan_cmd.py shim works and the CLI dispatch.
Assistant
Let me check the command registry and see if there's a "help" command already, and check how argparse subparser groups work.
Assistant
Now I have a comprehensive understanding of the codebase. Let me compile my complete design plan.
Design Plan: CLI Discoverability Improvements
I have thoroughly explored the relevant codebase. Here is my concrete implementation plan addressing both goals.
Answering the Design Questions First
Q1: What is the best approach for grouping top-level commands?
Argparse does not natively support subparser "groups" the way it supports
add_argument_group()for arguments. The standard approach is to use the epilog string withRawDescriptionHelpFormatterto present a structured layout. The current epilog (USAGE_EXAMPLES) already does this. The cleanest approach is to restructure the epilog into clear sections: a concise command group reference at the top, then examples below. This avoids hacking argparse internals or overridingformat_help().However, there is a second option worth considering: replacing
add_subparsers(dest="command")with multiple calls and titles. Argparse only allows oneadd_subparsers()call per parser, so this is not viable. The epilog-based approach is correct.Q2: Which specific commands most need epilog examples?
Based on complexity and frequency of use:
plan(the living plan concept needs explaining),show(flexible pattern matching is confusing),resolve(attestation requirements),next(many filtering options), andreview(mode diversity).scanandstatusare simpler and get less value from examples.Q3: Where should the compact queue view live?
I recommend Option B:
plan queueas the primary location, with the table also folded intoplan showas an optional--fullflag. Rationale:plan queueis a natural home -- "show me the plan queue" is intuitive.- Separate from
plan show(which shows metadata) avoids overloading a simple summary command. - It reuses the same
build_work_queueinfrastructure asnextbut with unlimited count and compact rendering. - Adding
--format compacttonextis also viable as a complement but conflates "what is next" with "show me everything."
Q4: Should we use argparse argument groups or better epilog organization for review?
Use
add_argument_group(). This is the correct argparse mechanism. Argument groups control how--helprenders option sections. The current review parser dumps 40+ options in a single "options" block. Breaking them into named groups produces clear visual separation with no custom formatting code.
Part 1: Richer --help Output
1A. Restructure Top-Level Epilog (
parser.py)File:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser.pyReplace the current
USAGE_EXAMPLESstring. The new structure:codeUSAGE_EXAMPLES = """ core workflow: scan Run all detectors, update state, show diff status Score dashboard with per-tier progress next Show next highest-priority item to work on resolve Mark finding(s) as fixed/wontfix/false_positive plan Living plan: prioritize, cluster, skip, track investigation: show <pattern> Dig into findings by file/dir/detector/ID tree Annotated codebase tree (zoom with --focus) detect Run a single detector directly (bypass state) maintenance: fix Auto-fix mechanical issues (unused imports, logs, etc.) move Move file/dir and update all import references review Prepare or import holistic subjective review ignore Suppress findings matching a pattern exclude Add path pattern to exclude from scanning admin: zone Show/set/clear zone classifications config Show/set/unset project configuration viz Generate interactive HTML treemap dev Developer utilities (scaffold-lang) langs List available language plugins update-skill Install/update the desloppify skill document examples: desloppify scan --skip-slow desloppify --lang python scan --path scripts/desloppify desloppify show src/shared/components/MediaLightbox desloppify show gods desloppify next --count 10 --group file desloppify resolve fixed "unused::src/foo.tsx::React" --note "removed" --attest "..." desloppify plan queue desloppify plan focus my-cluster """Key changes:
- Commands grouped into 4 clear categories with headers
- Removed redundant help text that merely repeats the subcommand descriptions
- Trimmed examples to the most useful ones (removed very long lines)
- Added
plan queueexample (ties to Goal 2)
1B. Add Missing
help=Text to Shared ArgumentsFile:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups.pyAll
--path,--state,--output,--jsonarguments that currently lack help text need it added. Here are the specific locations and text:In
_add_scan_parser:--path(line 44): addhelp="Project root directory (default: auto-detected)"--state(line 45): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_status_parser:--state(line 88): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"--json(line 89): addhelp="Output as JSON"
In
_add_tree_parser:--path(line 94): addhelp="Project root directory (default: auto-detected)"--state(line 95): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_show_parser:--state(line 124): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_next_parser:--state(line 158): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_resolve_parser:--state(line 249): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_ignore_parser:--state(line 267): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
File:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.pyIn
_add_detect_parser:--top(line 46): addhelp="Max findings to show (default: 20)"--path(line 47): addhelp="Project root directory (default: auto-detected)"--json(line 48): addhelp="Output as JSON"
In
_add_review_parser:--path(line 95): addhelp="Project root directory (default: auto-detected)"--state(line 96): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_zone_parser:--path(line 368): addhelp="Project root directory (default: auto-detected)"--state(line 369): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_viz_parser:--path(line 578): addhelp="Project root directory (default: auto-detected)"--output(line 579): addhelp="Output file path (default: treemap.html)"--state(line 580): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
In
_add_fix_parser:--path(line 414): addhelp="Project root directory (default: auto-detected)"--state(line 415): addhelp="Path to state file (default: .desloppify/state-{lang}.json)"
1C. Plan Command Epilog and Description
File:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.pyModify
_add_plan_parser(line 423) to add a description and epilog:pythondef _add_plan_parser(sub) -> None: p_plan = sub.add_parser( "plan", help="Living plan: generate, reorder, cluster, skip, note", description=( "Manage the living plan — a persistent, user-curated layer on top\n" "of the mechanical work queue. The plan tracks custom ordering,\n" "clusters (grouped findings), skips (temporary/permanent), and\n" "per-finding descriptions and notes." ), epilog=( "typical workflow:\n" " 1. desloppify scan # detect findings\n" " 2. desloppify plan # see full prioritized markdown\n" " 3. desloppify plan queue # compact table of all items\n" " 4. desloppify plan focus my-cluster # narrow scope to a cluster\n" " 5. desloppify next # work on the next item\n" " 6. desloppify plan done <id> --attest '...' # mark as fixed\n" "\n" "subcommands:\n" " (none) Generate full prioritized markdown plan\n" " show Show plan metadata summary\n" " queue Compact table of all upcoming queue items\n" " move Move findings up/down/to-position in the queue\n" " describe Set augmented description on findings\n" " note Attach notes to findings\n" " skip/unskip Temporarily or permanently skip findings\n" " done Mark findings as fixed (requires attestation)\n" " reopen Reopen resolved findings\n" " focus/reset Set active cluster focus / reset plan\n" " cluster ... Manage finding clusters (create/add/remove/delete/move/show/list)" ), formatter_class=argparse.RawDescriptionHelpFormatter, ) # ... rest unchanged1D. Review Command Argument Groups
File:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.pyRestructure
_add_review_parserto useadd_argument_group(). The key change is organizing the 40+ arguments into logical groups:pythondef _add_review_parser(sub) -> None: p_review = sub.add_parser( "review", help="Prepare or import holistic subjective review", description=( "Manage holistic subjective reviews. Reviews assess dimensions like\n" "abstraction fitness, naming quality, and test health using LLM-based\n" "evaluation. Results feed into the strict score." ), epilog=( "examples:\n" " desloppify review --prepare\n" " desloppify review --import findings.json\n" " desloppify review --run-batches --runner codex --parallel\n" " desloppify review --external-start --external-runner claude\n" " desloppify review --external-submit --session-id <id> --import findings.json" ), formatter_class=argparse.RawDescriptionHelpFormatter, ) # --- Core options --- core = p_review.add_argument_group("core options") core.add_argument("--path", type=str, default=None, help="Project root directory (default: auto-detected)") core.add_argument("--state", type=str, default=None, help="Path to state file (default: .desloppify/state-{lang}.json)") core.add_argument("--prepare", action="store_true", help="Prepare review data (output to query.json)") core.add_argument("--import", dest="import_file", ...) core.add_argument("--validate-import", ...) core.add_argument("--allow-partial", ...) core.add_argument("--dimensions", ...) core.add_argument("--retrospective", ...) core.add_argument("--retrospective-max-issues", ...) core.add_argument("--retrospective-max-batch-items", ...) core.add_argument("--force-review-rerun", ...) # --- External review --- external = p_review.add_argument_group("external review (cloud reviewer sessions)") external.add_argument("--external-start", ...) external.add_argument("--external-submit", ...) external.add_argument("--session-id", ...) external.add_argument("--external-runner", ...) external.add_argument("--session-ttl-hours", ...) # --- Batch execution --- batch = p_review.add_argument_group("batch execution (subagent runners)") batch.add_argument("--run-batches", ...) batch.add_argument("--runner", ...) batch.add_argument("--parallel", ...) batch.add_argument("--max-parallel-batches", ...) batch.add_argument("--batch-timeout-seconds", ...) batch.add_argument("--batch-max-retries", ...) batch.add_argument("--batch-retry-backoff-seconds", ...) batch.add_argument("--batch-heartbeat-seconds", ...) batch.add_argument("--batch-stall-warning-seconds", ...) batch.add_argument("--batch-stall-kill-seconds", ...) batch.add_argument("--dry-run", ...) batch.add_argument("--save-run-log", ...) batch.add_argument("--run-log-file", ...) batch.add_argument("--only-batches", ...) batch.add_argument("--scan-after-import", ...) batch.add_argument("--packet", ...) # --- Trust & attestation --- trust = p_review.add_argument_group("trust & attestation") trust.add_argument("--manual-override", ...) trust.add_argument("--attested-external", ...) trust.add_argument("--attest", ...) # --- Post-processing --- post = p_review.add_argument_group("post-processing") post.add_argument("--merge", ...) post.add_argument("--similarity", ...) # --- Deprecated --- deprecated = p_review.add_argument_group("deprecated (ignored)") deprecated.add_argument("--max-age", ...) deprecated.add_argument("--max-files", ...) deprecated.add_argument("--refresh", ...) deprecated.add_argument("--holistic", ...)This transforms the flat wall of 40+ options into 6 clearly labeled sections when the user runs
desloppify review --help.1E. Individual Command Epilogs
Add brief epilog examples to key commands in
parser_groups.py:_add_show_parser:pythonp_show = sub.add_parser( "show", help="Dig into findings by file, directory, detector, or ID", epilog=( "examples:\n" " desloppify show src/components/Modal.tsx\n" " desloppify show unused --top 50\n" " desloppify show review --status open\n" " desloppify show gods\n" " desloppify show --chronic" ), formatter_class=argparse.RawDescriptionHelpFormatter, )_add_next_parser:pythonp_next = sub.add_parser( "next", help="Show next highest-priority open finding", epilog=( "examples:\n" " desloppify next # show single highest-priority item\n" " desloppify next --count 10 # show top 10\n" " desloppify next --tier 1 # only tier 1 items\n" " desloppify next --group file # group by file\n" " desloppify next --cluster auto/unused # items in a cluster\n" " desloppify next --format json # JSON output for scripting" ), formatter_class=argparse.RawDescriptionHelpFormatter, )_add_resolve_parser:pythonp_resolve = sub.add_parser( "resolve", help="Mark finding(s) as fixed/wontfix/false_positive/open", epilog=( "examples:\n" " desloppify resolve fixed \"unused::src/foo.tsx::React\" \\\n" " --note 'removed unused import' --attest 'I have actually ...'\n" " desloppify resolve wontfix deprecated --note 'migration in progress' \\\n" " --attest 'I have actually verified ...'" ), formatter_class=argparse.RawDescriptionHelpFormatter, )_add_scan_parser:pythonp_scan = sub.add_parser( "scan", help="Run all detectors, update state, show diff", epilog=( "examples:\n" " desloppify scan\n" " desloppify scan --skip-slow\n" " desloppify scan --profile ci" ), formatter_class=argparse.RawDescriptionHelpFormatter, )
Part 2: Compact Queue Overview (
plan queue)2A. Add
plan queueSubcommand ParserFile:
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.pyIn
_add_plan_parser, afterplan_sub.add_parser("show", ...)(line 435), add:python# plan queue [--format compact|json|md] [--cluster NAME] p_queue = plan_sub.add_parser( "queue", help="Compact table of all upcoming queue items", ) p_queue.add_argument( "--format", choices=["compact", "json", "md"], default="compact", help="Output format (default: compact table)", ) p_queue.add_argument( "--cluster", type=str, default=None, metavar="NAME", help="Filter to a specific cluster", ) p_queue.add_argument( "--include-skipped", action="store_true", help="Include skipped items at end of queue", ) p_queue.add_argument( "--state", type=str, default=None, help="Path to state file", )2B. Add Dispatch in
cmd.pyFile:
/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/plan/cmd.pyAdd handler for the "queue" action. After the
plan_action == "show"block (around line 73):pythonif plan_action == "queue": _cmd_plan_queue(args) returnThen define
_cmd_plan_queue:pythondef _cmd_plan_queue(args: argparse.Namespace) -> None: """Render a compact table of all upcoming queue items.""" from desloppify.app.commands.plan.queue_render import render_plan_queue render_plan_queue(args)2C. Create Queue Renderer
New file:
/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/plan/queue_render.pyThis is the core of Goal 2. It builds the full work queue and renders it as a compact table.
python"""Compact queue table renderer for `plan queue`.""" from __future__ import annotations import argparse import json from desloppify.app.commands.helpers.runtime import command_runtime from desloppify.app.commands.helpers.state import require_completed_scan from desloppify.core.output_api import colorize, print_table from desloppify.engine.plan import load_plan from desloppify.engine.work_queue import QueueBuildOptions, build_work_queue def _truncate(text: str, max_len: int) -> str: """Truncate text to max_len, adding ellipsis if needed.""" if len(text) <= max_len: return text return text[: max_len - 1] + "\u2026" def _tier_color(tier: int) -> str: """Return color name for a tier label.""" return {1: "red", 2: "yellow", 3: "cyan", 4: "dim"}.get(tier, "dim") def _compact_rows(items: list[dict], plan: dict | None) -> list[list[str]]: """Build compact table rows from queue items.""" rows: list[list[str]] = [] for idx, item in enumerate(items, 1): kind = item.get("kind", "finding") if kind == "cluster": member_count = item.get("member_count", 0) detector = item.get("detector", "") summary = _truncate(item.get("summary", ""), 50) cluster_name = item.get("cluster_name", item.get("id", "")) rows.append([ str(idx), "--", detector, f"[{cluster_name}] {summary}", str(member_count), "cluster", ]) else: tier = int(item.get("effective_tier", item.get("tier", 3))) detector = item.get("detector", "") summary = _truncate(item.get("summary", ""), 50) cluster_info = "" plan_cluster = item.get("plan_cluster") if isinstance(plan_cluster, dict): cluster_info = plan_cluster.get("name", "") skip_mark = "" if item.get("plan_skipped"): skip_kind = item.get("plan_skip_kind", "temp") skip_mark = f" [{skip_kind[:4]}]" rows.append([ str(idx), f"T{tier}", detector, summary + skip_mark, cluster_info, item.get("confidence", "med")[:3], ]) return rows def render_plan_queue(args: argparse.Namespace) -> None: """Build and render the full compact queue.""" runtime = command_runtime(args) state = runtime.state if not require_completed_scan(state): return plan = load_plan() plan_data = plan if ( plan.get("queue_order") or plan.get("overrides") or plan.get("clusters") ) else None cluster_arg = getattr(args, "cluster", None) include_skipped = bool(getattr(args, "include_skipped", False)) output_format = getattr(args, "format", "compact") queue = build_work_queue( state, options=QueueBuildOptions( count=None, # all items scan_path=state.get("scan_path"), status="open", include_subjective=True, no_tier_fallback=True, plan=plan_data, include_skipped=include_skipped, cluster=cluster_arg, collapse_clusters=not cluster_arg, ), ) items = queue.get("items", []) counts = queue.get("tier_counts", {}) if output_format == "json": # Reuse existing serializer from desloppify.app.commands.next_parts.output import serialize_item payload = { "command": "plan_queue", "items": [serialize_item(item) for item in items], "tier_counts": counts, "total": len(items), } print(json.dumps(payload, indent=2)) return if output_format == "md": from desloppify.app.commands.next_parts.output import render_markdown print(render_markdown(items)) return # --- Compact terminal table --- total = len(items) t1, t2, t3, t4 = counts.get(1, 0), counts.get(2, 0), counts.get(3, 0), counts.get(4, 0) print(colorize( f"\n Queue: {total} items (T1:{t1} T2:{t2} T3:{t3} T4:{t4})", "bold", )) if plan_data and plan_data.get("active_cluster"): cn = plan_data["active_cluster"] print(colorize(f" Focus: {cn}", "cyan")) skipped_count = len((plan_data or {}).get("skipped", {})) if skipped_count and not include_skipped: print(colorize(f" ({skipped_count} skipped items hidden — use --include-skipped)", "dim")) if not items: print(colorize(" Queue is empty.", "green")) return print() rows = _compact_rows(items, plan_data) headers = ["#", "Tier", "Detector", "Summary", "Cluster", "Conf"] widths = [4, 4, 18, 52, 18, 4] print_table(headers, rows, widths) print()This renders output like:
codeQueue: 47 items (T1:3 T2:8 T3:28 T4:8) (5 skipped items hidden -- use --include-skipped) # Tier Detector Summary Cluster Conf -------------------------------------------------------------------------------------------------------------- 1 -- unused [auto/unused] Remove 12 unused findings 12 cluster 2 -- logs [auto/logs] Remove 8 console.log findings 8 cluster 3 T1 security SQL injection via string concatenation auto/security hig 4 T1 security Hardcoded API key in config.ts auto/security hig 5 T2 smells Async function with no await med ...2D. Register in Command Registry (No Change Needed)
The
plan queuesubcommand is dispatched throughcmd_plan, which already handles subcommand routing viaplan_action. No change needed toregistry.py.
Implementation Sequence
- Start with missing help text (1B) -- lowest risk, pure additive, every arg that lacks
help=gets one. - Restructure top-level epilog (1A) -- single string replacement in
parser.py. - Add individual command epilogs (1E) -- adding
epilog=andformatter_class=toadd_parser()calls. - Review argument groups (1D) -- restructure
_add_review_parserusingadd_argument_group(). Functionally identical; only changes help output. - Plan command description/epilog (1C) -- add description and epilog to
_add_plan_parser. - Add
plan queuesubcommand (2A-2C) -- parser registration, dispatch, and new renderer file. This is the only part with new functionality. - Tests -- update any tests that snapshot CLI help output. The existing test for
test_cmd_scan.pyandtest_cmd_show.pymay test parser construction and would need any parser-construction test assertions updated.
Risks and Considerations
- argparse
add_argument_groupfor review: When using argument groups, the group names appear as section headers in--helpoutput. The arguments still belong to the same namespace. There is zero behavioral change -- only presentation. formatter_classper subparser: Each sub-parser that gets an epilog needsformatter_class=argparse.RawDescriptionHelpFormatterpassed explicitly. The parent parser already uses this, but subparsers do NOT inherit it.plan queuereusesbuild_work_queue: This is the same functionnextuses, so ordering and clustering behavior are already tested. The compact renderer is pure formatting.- No existing
add_argument_groupcalls in the codebase: This is a new pattern, but standard argparse. It will not conflict with anything.
Critical Files for Implementation
/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups_admin.py- All admin parser builders: plan description/epilog, review argument groups, detect/fix/viz/zone missing help text/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser_groups.py- Core command parsers: scan/status/tree/show/next/resolve/ignore missing help text and epilogs/Users/user_c042661f/Documents/desloppify/desloppify/app/cli_support/parser.py- Top-level parser and USAGE_EXAMPLES string to restructure/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/plan/cmd.py- Plan command dispatcher: add "queue" action routing/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/plan/queue_render.py- New file: compact queue table renderer forplan queue