Skip to content

Conversation

@llewellyn-sl
Copy link
Contributor

@llewellyn-sl llewellyn-sl commented Jan 22, 2026

Summary

Replace brittle Python regex parsing with deterministic Java reflection using picocli's CommandSpec API. Add Claude Code skill for improving CLI help text. Integrate metadata updates into PR workflow.

What Changed

Added

  • Java metadata extractor (CliMetadataExtractor.java)

    • Uses picocli CommandSpec API for deterministic extraction
    • Automatically resolves all @Mixin annotations
    • Captures 1011 options (118% more than Python approach)
    • Outputs complete type information
  • Gradle task: extractCliMetadata

    • Run: ./gradlew extractCliMetadata
    • Outputs to docs/cli-metadata.json
  • PR template with checklist

    • Enforces running extractor before merge for CLI changes
    • Makes metadata updates final step in PR process
  • Claude Code skill: enrich-cli-help

    • Guides contributors on improving CLI help text
    • Documents OpenAPI-quality description standards
    • Provides architecture patterns and examples
  • GitHub Actions workflow

    • Triggers docs repo on release
    • Verifies metadata exists

Updated

  • .gitignore - Removed command-spec.json entry
  • docs/README.md - Documented Java reflection approach
  • .claude/README.md - Added contributor guide

Removed

  • Python scripts (replaced by Java extractor)

Benefits

  • Deterministic - Same input always produces same output
  • Complete - Captures all options including platform/provider mixins
  • Maintainable - Type-safe Java code, no regex brittleness
  • Integrated - Part of build system, no Python dependency
  • Enforced - PR template checklist ensures metadata stays current

Testing

./gradlew extractCliMetadata

Output:

  • Total commands: 164
  • Total options: 1011
  • Total parameters: 12

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Replace brittle Python regex parsing with deterministic Java reflection using picocli's CommandSpec API.
Integrate metadata updates into PR workflow via checklist.

## Added
- Java metadata extractor (CliMetadataExtractor.java)
  - Uses picocli CommandSpec API for reflection-based extraction
  - Automatically resolves all @mixin annotations
  - Captures 1011 options deterministically
  - Outputs complete type information
- Gradle task: extractCliMetadata
  - Runs the Java extractor
  - Outputs to docs/cli-metadata.json
- PR template with metadata update checklist
  - Enforces running extractor before merge
  - Final step before merging CLI changes
- GitHub Actions workflow for release automation
  - Triggers docs repo on release
  - Verifies metadata exists
- Claude Code configuration and enrich-cli-help skill
  - Provides guidance for improving CLI help text
  - Documents metadata extraction workflow

## Benefits
- Deterministic: Same input always produces same output
- Complete: Captures all options including platform/provider mixins
- Maintainable: Type-safe Java code, no regex brittleness
- Integrated: Part of build system, no Python dependency
- Enforced: PR template checklist ensures metadata stays current

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@llewellyn-sl llewellyn-sl force-pushed the ll-cli-docs-automation-infrastructure branch from 73a473b to 51473a8 Compare January 23, 2026 13:20
@llewellyn-sl llewellyn-sl changed the title feat: Replace Python metadata extractor with Java reflection approach feat: Add CLI metadata extraction infrastructure and enrich-cli-help skill Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants