Skip to content

fix(docs): the argv check finds a missing required option #4862

Closed

Description

@dan-petty

Problem Description

The devops-pr-ci skill tells agents to run uv run devops pr describe <issue>, but the command also needs --summary. devops pr describe failed 36 times since 2026-11-03: 23 with no --summary (Claude 5, other tools 18 in 18 sessions) and 13 with no issue argument. The docs argv check and the stage plan-check use core/command_resolver.py, which finds an unknown command, an unknown option and an extra argument, but not a missing required option, so the skill line passed. devops repos worktrees add with no --slug failed 4 times.

Tracker #4833, child 11. The owner asked on 2026-11-11 to fix the devops gh issue name and to record such errors for a later analysis of missing flags, features and aliases. The counts come from a study of Claude Code, Kilo, Antigravity and Loki records from 2026-09-23 to 2026-11-11.

Reproduction Steps

  1. Run uv run devops pr describe 1.
  2. See the error Missing option '--summary' / '-s'. and exit code 2.
  3. Read .agents/skills/devops-pr-ci/SKILL.md line 18: it names uv run devops pr describe <issue> with no --summary.
  4. CommandReferenceDefect in src/devops_cli/core/command_resolver.py has only unknown_command, unknown_option and unexpected_argument, so the docs argv check passes the line.

Expected vs Actual Behavior

Expected: the docs argv check and the stage plan-check report a command line that has no required option. Actual: they pass it, and agents copy the line and fail.

Environment Diagnostics

  • DevOps CLI Version: 0.113.0
  • Python Version: 3.14.10
  • OS & Architecture: Linux x86_64
  • Execution Environment: DevContainer

Logs, Traces, or Terminal Output

$ uv run devops pr describe 1
Usage: devops pr describe [OPTIONS] {issue}
Try 'devops pr describe -h' for help.
Error: Missing option '--summary' / '-s'.

Proposed Fix

Add the defect missing_required to CommandReferenceDefect: when make_context raises Click's MissingParameter for an argv that has at least one argument or option, the resolver reports it with the parameter name. A placeholder such as <issue> fills an argument, not an option. Correct each line that the check finds. First correct the skill line in .agents/skills/devops-pr-ci/SKILL.md and its copies under .claude/skills/ and .kilocode/skills/, so that it names --summary.

Existing Tool Considered

Click's make_context already raises MissingParameter; the resolver reads it. Nothing new is built.

Acceptance Criteria

A resolver test with devops pr describe 1 reports missing_required --summary; one with devops pr describe --summary x reports the missing issue argument; a mention with no tokens reports nothing. The docs argv check passes after the corrections, and the change folder lists the lines it corrected. The stage plan-check refuses a plan line that has no required option (test).

Dependencies

None. An agent can start it now.

Source: #4833

Alternatives check of 2026-11-14: in-use.
The repository already uses this tool.
Tool: pallets/click (https://github.com/pallets/click), BSD-3-Clause, last activity 2026-11-13, maintained.

Proposed design

Problem statement

Add a missing_required defect to the command resolver and correct the devops-pr-ci skill lines; the work has no block and no dependency. The docs argv check and the stage plan-check accept a command line that omits a required option. The devops-pr-ci skill tells agents to run uv run devops pr describe <issue> with no --summary. Agents copy the line and the command fails. The resolver must report the missing required option, and the skill lines must name --summary.

Acceptance criteria

Requirement: resolver-reports-missing-required-option

The command resolver SHALL report a missing_required defect with the option name when a command line omits a required option.

Scenario: missing-summary-option

  • WHEN A resolver test resolves devops pr describe 1.
  • THEN The finding has defect missing_required, command path devops pr describe and token --summary.

Requirement: resolver-reports-missing-required-argument

The command resolver SHALL report a missing_required defect with the argument name when a command line gives every option and omits a required argument.

Scenario: missing-issue-argument

  • WHEN A resolver test resolves devops pr describe --summary x.
  • THEN The finding has defect missing_required and token issue.

Requirement: resolver-skips-bare-command-mention

The command resolver MUST report no defect for a command mention that has no token after the command path.

Scenario: bare-command-mention

  • WHEN A resolver test resolves devops pr describe with no token after the command path.
  • THEN The resolver returns no finding.

Requirement: resolver-treats-placeholder-as-argument

The command resolver MUST treat a placeholder token as a filled argument and MUST NOT treat it as a filled required option.

Scenario: placeholder-issue-argument

  • WHEN A resolver test resolves devops pr describe <issue> where <issue> is a placeholder.
  • THEN The finding has defect missing_required and token --summary, and no finding names the issue argument.

Requirement: skill-line-names-required-option

The devops-pr-ci skill file and each copy of it SHALL name --summary in the devops pr describe command line.

Scenario: skill-line-summary

  • WHEN The docs argv check reads .agents/skills/devops-pr-ci/SKILL.md and each copy that exists under .claude/skills/ and .kilocode/skills/.
  • THEN The check reports no missing_required defect for the devops pr describe line.

Requirement: docs-argv-check-passes

The docs argv check SHALL pass on the corrected documents.

Scenario: docs-argv-check-pass

  • WHEN The docs argv check runs over the repository documents after the corrections.
  • THEN It reports no defect.

Requirement: change-folder-lists-corrected-lines

The change folder for issue 4862 SHALL list each document path and line that the change corrects.

Scenario: change-folder-corrections

  • WHEN A reviewer reads the change folder for issue 4862.
  • THEN It names each corrected path and line, including .agents/skills/devops-pr-ci/SKILL.md line 26.

Requirement: stage-plan-check-refuses-missing-option

The stage plan-check SHALL refuse a plan line that omits a required option.

Scenario: stage-plan-check-missing-option

  • WHEN A test of the stage plan-check uses the plan line devops pr describe 1.
  • THEN The check reports missing_required for --summary and refuses the plan.

Existing Tool Considered

pallets/click (https://github.com/pallets/click), BSD-3-Clause, maintained, covers the need: Command.make_context raises MissingParameter with the parameter name and parses a command line without running it. It lacks the missing_required defect kind and the report from the docs argv check and the stage plan-check; the resolver must map the error. It does not correct the skill lines or settle the placeholder rule. The project adds only the defect kind and the message, so no parser is built.

Key questions

  • How should the resolver detect a missing required option?: Map the MissingParameter error from the strict make_context parse to a new CommandReferenceDefect.MISSING_REQUIRED, and report the parameter name from the error. (best practice) [sources: src/devops_cli/core/command_resolver.py, src/devops_cli/telemetry/usage_errors.py:182]
    • Chosen: Map MissingParameter from the strict parse. Click raises it, the resolver already calls make_context, and the alternatives check gives in-use for Click.
    • Rejected: Build a separate required-parameter check. It repeats Click's parser and misses conditional requirements.
    • Rejected: Use a standalone CLI validator. The alternatives check found no better tool; Click is already the parser.
  • Should the resolver report a missing required argument as well as a missing required option?: Yes. Report missing_required for both options and arguments, with the parameter name. Click raises the same MissingParameter for an argument. (best practice) [sources: src/devops_cli/telemetry/usage_errors.py:182, src/devops_cli/core/command_resolver.py]
    • Chosen: Report both options and arguments. Click raises MissingParameter for both, and the acceptance criterion names the missing issue argument.
    • Rejected: Report options only. The acceptance criterion names the missing issue argument.
  • When should a bare command mention report no defect?: When the argv has no token after the command path. A bare mention names a command and is not a command line. (best practice) [sources: src/devops_cli/core/command_resolver.py]
    • Chosen: Skip a command path with no tokens. Documents name commands; reporting every bare mention would flag valid prose.
    • Rejected: Report every missing required option. It would flag devops pr describe in prose that names the command only.
  • How should the resolver treat a placeholder token?: A placeholder fills an argument, not an option. The resolver counts it as a token for the non-empty rule, does not report a missing argument that it fills, and still reports a missing option. (best practice) [sources: src/devops_cli/core/command_resolver.py]
    • Chosen: Placeholder fills an argument only. <issue> stands for the issue argument and cannot supply --summary.
    • Rejected: Placeholder fills any parameter. A placeholder in an argument position cannot supply a named option.
  • Which skill line does the change correct?: .agents/skills/devops-pr-ci/SKILL.md line 26 holds uv run devops pr describe <issue> with no --summary. The copies under .claude/skills/ and .kilocode/skills/ hold the same line. [sources: .agents/skills/devops-pr-ci/SKILL.md:26]
  • Does the repository already use Click?: Yes. The resolver builds the command tree with typer.main.get_command and parses each node with make_context from Typer's vendored Click. The alternatives check gives in-use for pallets/click. [sources: src/devops_cli/core/command_resolver.py]
  • Does the docs argv check use the resolver?: Yes. The tests of the docs command resolver use CommandReferenceDefect from src/devops_cli/core/command_resolver.py. [sources: tests/core/test_docs_command_resolver.py, tests/docs/test_docs_knowledge_base_argv.py, src/devops_cli/core/command_resolver.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/bug
    scope/docs
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/docs. The (docs) scope of the title gives the scope.
    • Priority: P2-Medium. The bug causes 36 repeated agent failures since 2026-11-03, but a known workaround exists.
    • Value: Medium. It stops agents from copying a broken command line and failing repeatedly.
    • Effort: Medium. It requires a new defect type, resolver logic, skill file corrections, and tests, but Click already raises the needed exception.
    • Related: fix(cli): docs check resolves every devops argv in src #868, which asks for a different change. Both use command_resolver.py in the docs argv check, but #868 made the check detect unknown commands, options, and extra arguments, while this candidate adds detection of a missing required option.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    New evidence of 2026-11-13 (review of failing CLI calls). Copied document forms keep making usage errors, so I propose a wider scope for the check.

    Counts (Claude Code transcripts, 2026-10-29 to 2026-11-13)

    • docs generate --sync-readme . 45 errors in one session, and docs generate --sync-readme 3 more on 2026-11-12 and 2026-11-13, after the option was removed. ADRs 0010, 0014 and 0025 still name the option (docs(adr): ADRs 0010 and 0014 name the deleted option --sync-readme #5244).
    • repos worktrees add <n> --type docs --slug <slug> . 35 errors in one session, and forms with no --type or --slug 10 (95 errors, 3 sessions).
    • pr describe with no --summary: 17 errors from 2026-11-03 to 2026-11-12. The skill line is still there: .agents/skills/devops-pr-ci/SKILL.md, line 26 on main (it was line 18).

    Scope point

    The argv check parses every devops ... form in docs/, docs/adr/, .agents/skills/ and src/devops_cli/ai/tasks/ with the real Click parser (Command.make_context with resilient_parsing off). It fails on an unknown option, an unknown command and a missing required option. One wrong form in a brief repeats in every agent that reads it. Placeholders such as <n> need one shared rule, so the check does not report them.

    Measure: usage errors whose form appears in a repository document go to 0, and the check fails on a pull request that removes an option that a document still names.

  6. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Searches for a standalone command-line validator turned up nothing better; the issue's own analysis and the Click facts show that Click's Command.make_context already raises MissingParameter with the parameter name for a missing required option, which is exactly the signal the resolver and the docs argv check lack. Only the project-side mapping to a new missing_required defect and the skill-line corrections remain, so the existing library covers the need.

    The repository already uses this tool.

    Tool: pallets/click (https://github.com/pallets/click)

    • License: BSD-3-Clause
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • Raises MissingParameter from make_context when a required option is absent, naming the parameter (e.g. --summary / -s)
    • Parses a command line with the real parser without running the command, so a docs argv check can reuse it
    • Already backs the existing defect kinds for unknown command, unknown option and unexpected argument

    Lacks:

    • Does not itself add the missing_required kind or report it from the docs argv check and stage plan-check; the resolver must map MissingParameter
    • Does not correct the skill lines under .agents/skills/devops-pr-ci/SKILL.md, .claude/skills/ and .kilocode/skills/
    • Does not settle the shared placeholder rule (e.g. <issue>, <n>) so placeholders are not reported as missing arguments

    Tools considered:

    Searches run:

    • Click make_context MissingParameter detect missing required option, results: 5
    • python library validate CLI command line string against parser missing required option, results: 5
    • pallets click BaseCommand make_context MissingParameter docs, results: 5
    • click python "MissingParameter" required option exception, results: 5
    • pallets click github command line interface library, results: 5
    • click.palletsprojects.com exceptions MissingParameter UsageError, results: 5
    • typer cyclopts parse command line string validate missing required option, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/ready
    and removed
    status/new
    on Nov 15, 2026
  8. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at ca62d6a (see proposed design in issue body).

  9. added
    status/in-progress
    and removed
    status/ready
    on Nov 19, 2026
  10. added a commit that references this issue on Nov 20, 2026
    4eb52f4
  11. added
    status/in-review
    and removed
    status/in-progress
    on Nov 20, 2026
  12. removed
    status/in-review
    on Nov 20, 2026
  13. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-20 17:44 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/docssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions