-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add CLI metadata extraction infrastructure and enrich-cli-help skill #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
llewellyn-sl
wants to merge
5
commits into
master
Choose a base branch
from
ll-cli-docs-automation-infrastructure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
51473a8
feat: Add CLI metadata extraction infrastructure
llewellyn-sl 38369c4
Update enrich-cli-help skill with default value handling guidelines
llewellyn-sl 55058c2
refactor: align CLI metadata generation with release artifacts
llewellyn-sl ba58e29
Merge branch 'master' into ll-cli-docs-automation-infrastructure
JaimeSeqLabs d789ce1
refactor: move metadata release asset into jreleaser
llewellyn-sl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Claude Code Configuration for Seqera Platform CLI | ||
|
|
||
| This directory contains Claude Code configuration and skill documentation for contributors working on the Seqera Platform CLI codebase. | ||
|
|
||
| ## Skills Available | ||
|
|
||
| ### enrich-cli-help | ||
|
|
||
| Workflow documentation for generating structured CLI metadata from the `tower-cli` source tree. | ||
|
|
||
| **Use this skill when:** | ||
| - Updating the metadata extractor | ||
| - Validating metadata output | ||
| - Reviewing the release-artifact workflow for CLI docs metadata | ||
|
|
||
| **Quick start:** | ||
| ```bash | ||
| ./gradlew extractCliMetadata | ||
| ``` | ||
|
|
||
| This generates `build/cli-metadata/cli-metadata.json`. | ||
|
|
||
| **Documentation:** | ||
| - `skills/enrich-cli-help/SKILL.md` - Complete workflow guide | ||
| - `skills/enrich-cli-help/README.md` - Quick reference | ||
|
|
||
| ## Project Context | ||
|
|
||
| ### Repository Structure | ||
| ```text | ||
| tower-cli/ | ||
| ├── src/main/java/io/seqera/tower/cli/ | ||
| │ └── utils/metadata/ | ||
| │ └── CliMetadataExtractor.java | ||
| ├── docs/ | ||
| │ └── README.md | ||
| ├── .claude/ | ||
| └── build.gradle | ||
| ``` | ||
|
|
||
| ### Key Files | ||
|
|
||
| - `src/main/java/io/seqera/tower/cli/utils/metadata/CliMetadataExtractor.java` | ||
| - `build.gradle` | ||
| - `docs/README.md` | ||
| - `.github/workflows/build.yml` | ||
|
|
||
| ## Workflow Overview | ||
|
|
||
| ```text | ||
| 1. Extract metadata | ||
| └─> ./gradlew extractCliMetadata | ||
| └─> Outputs build/cli-metadata/cli-metadata.json | ||
|
|
||
| 2. Verify | ||
| └─> Run tests when the extractor changes | ||
| └─> Confirm metadata shape stays stable | ||
|
|
||
| 3. Release | ||
| └─> Generate cli-metadata.json in CI | ||
| └─> Upload it to GitHub release assets | ||
| └─> Dispatch docs automation with the release asset URL | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # CLI Metadata Generation Skill | ||
|
|
||
| This skill documents how to generate and validate structured CLI metadata from the `tower-cli` source tree. | ||
|
|
||
| ## Quick Start | ||
|
|
||
| Run: | ||
|
|
||
| ```bash | ||
| ./gradlew extractCliMetadata | ||
| ``` | ||
|
|
||
| The output is written to `build/cli-metadata/cli-metadata.json`. | ||
|
|
||
| ## What This Skill Does | ||
|
|
||
| 1. Generates CLI metadata from picocli command definitions | ||
| 2. Verifies the extractor output shape | ||
| 3. Documents the release-artifact workflow | ||
| 4. Keeps metadata generation independent from external OpenAPI specs | ||
|
|
||
| ## Release strategy | ||
|
|
||
| - Metadata is generated from source code without modifying it | ||
| - Metadata is a build and release artifact, not a tracked repository file | ||
| - Downstream docs tooling should consume the release asset | ||
|
|
||
| ## Files | ||
|
|
||
| - `SKILL.md` - Complete skill documentation | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Repository root: `tower-cli` | ||
| - Gradle task: `extractCliMetadata` | ||
| - Extractor: `src/main/java/io/seqera/tower/cli/utils/metadata/CliMetadataExtractor.java` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| name: enrich-cli-help | ||
| description: Generate structured CLI metadata from tower-cli source code using the built-in Java extractor. Use when validating metadata generation, updating release automation, or checking the downstream artifact consumed by docs tooling. | ||
| --- | ||
|
|
||
| # CLI Metadata Generation for Seqera Platform CLI | ||
|
|
||
| This skill is for generating and validating CLI metadata from the `tower-cli` source tree. | ||
|
|
||
| ## When to Use This Skill | ||
|
|
||
| Use this skill when: | ||
| - Updating the metadata extractor implementation | ||
| - Verifying that the Gradle task still produces valid metadata | ||
| - Reviewing release automation for the metadata artifact | ||
| - Investigating command coverage in the generated metadata | ||
| - Confirming downstream docs consumers can rely on the release artifact | ||
|
|
||
| ## Scope | ||
|
|
||
| The generator is deterministic and works directly from the compiled CLI command tree. It does not edit CLI source code and it does not depend on external OpenAPI specifications. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ### Step 1: Generate metadata locally | ||
|
|
||
| Run the Gradle task from the repository root: | ||
|
|
||
| ```bash | ||
| ./gradlew extractCliMetadata | ||
| ``` | ||
|
|
||
| The generated file is written to: | ||
|
|
||
| ```text | ||
| build/cli-metadata/cli-metadata.json | ||
| ``` | ||
|
|
||
| ### Step 2: Validate the output | ||
|
|
||
| Check that the JSON contains the expected top-level keys: | ||
|
|
||
| ```text | ||
| metadata | ||
| hierarchy | ||
| commands | ||
| ``` | ||
|
|
||
| If you are changing the extractor, add or update unit tests under `src/test/`. | ||
|
|
||
| ### Step 3: Review only the metadata generation path | ||
|
|
||
| Focus on: | ||
| - `src/main/java/io/seqera/tower/cli/utils/metadata/CliMetadataExtractor.java` | ||
| - `build.gradle` | ||
| - release automation in `.github/workflows/` | ||
| - docs describing metadata generation | ||
|
|
||
| Do not mix this workflow with CLI help-text enrichment or external API specs. | ||
|
|
||
| ### Step 4: Release behavior | ||
|
|
||
| At release time the metadata should be: | ||
| 1. generated from the current `tower-cli` source tree | ||
| 2. uploaded as a GitHub release artifact | ||
| 3. passed to downstream docs tooling via the release asset URL | ||
|
|
||
| ## Notes | ||
|
|
||
| - Remove hard-coded local paths from all documentation. | ||
| - Keep generated metadata out of Git. | ||
| - Prefer battle-tested libraries already on the classpath over hand-written serializers. | ||
| - Keep the workflow focused on metadata generation only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| ## Description | ||
|
|
||
| <!-- Provide a brief description of the changes in this PR --> | ||
|
|
||
| ## Type of Change | ||
|
|
||
| <!-- Mark the relevant option with an "x" --> | ||
|
|
||
| - [ ] Bug fix (non-breaking change which fixes an issue) | ||
| - [ ] New feature (non-breaking change which adds functionality) | ||
| - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
| - [ ] Documentation update | ||
| - [ ] Refactoring (no functional changes) | ||
| - [ ] Performance improvement | ||
| - [ ] Test updates | ||
|
|
||
| ## Changes Made | ||
|
|
||
| <!-- List the main changes made in this PR --> | ||
|
|
||
| - | ||
| - | ||
| - | ||
|
|
||
| ## Testing | ||
|
|
||
| <!-- Describe the testing you've done --> | ||
|
|
||
| - [ ] Tested locally | ||
| - [ ] Added/updated unit tests | ||
| - [ ] Added/updated integration tests | ||
| - [ ] Manual testing performed | ||
|
|
||
| ## Pre-Merge Checklist | ||
|
|
||
| <!-- Complete these items before merging --> | ||
|
|
||
| - [ ] Code follows the project's style guidelines | ||
| - [ ] Self-review completed | ||
| - [ ] Comments added for complex/non-obvious code | ||
| - [ ] Documentation updated (if applicable) | ||
| - [ ] No new warnings generated | ||
| - [ ] Tests pass locally | ||
| - [ ] Ran `./gradlew extractCliMetadata` if this PR changes the metadata extractor or release metadata workflow | ||
|
|
||
| ## Related Issues | ||
|
|
||
| <!-- Link related issues using #issue_number --> | ||
|
|
||
| Fixes # | ||
| Related to # | ||
|
|
||
| ## Additional Notes | ||
|
|
||
| <!-- Any additional information that reviewers should know --> |
|
llewellyn-sl marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.