-
Notifications
You must be signed in to change notification settings - Fork 6
Add Claude Code configuration #224
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
Merged
david-waltermire
merged 3 commits into
metaschema-framework:develop
from
david-waltermire:add-claude-md
Jan 8, 2026
Merged
Changes from 1 commit
Commits
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,160 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Build Commands | ||
|
|
||
| ```bash | ||
| # Build and install locally | ||
| mvn install | ||
|
|
||
| # Replicate CI/CD build (recommended before pushing) | ||
| mvn install -PCI -Prelease | ||
|
|
||
| # Run tests only | ||
| mvn test | ||
|
|
||
| # Run a single test class | ||
| mvn test -Dtest=CLITest | ||
|
|
||
| # Run a single test method | ||
| mvn test -Dtest=CLITest#testHelp | ||
|
|
||
| # Skip tests during build | ||
| mvn install -DskipTests | ||
|
|
||
| # Check license headers | ||
| mvn license:check | ||
|
|
||
| # Auto-format source code | ||
| mvn formatter:format | ||
|
|
||
| # Check for Checkstyle issues | ||
| mvn checkstyle:check | ||
| ``` | ||
|
|
||
| ### Maven Profiles | ||
|
|
||
| - `-Prelease`: Enables release configuration (GPG signing, source/javadoc jars) | ||
| - `-PCI`: Enables CI-specific configuration | ||
| - `-Psnapshots`: Enables snapshot deployment to the snapshot repository | ||
|
|
||
| ## Project Overview | ||
|
|
||
| oscal-cli is a command-line tool for working with [OSCAL](https://pages.nist.gov/OSCAL/) and [Metaschema](https://github.com/metaschema-framework/metaschema) content. It provides: | ||
|
|
||
| - Converting OSCAL content between XML, JSON, and YAML formats | ||
| - Validating OSCAL resources for well-formedness and validity | ||
| - Resolving OSCAL Profiles | ||
| - Validating Metaschema model definitions | ||
| - Generating XML and JSON Schemas from Metaschema models | ||
|
|
||
| This tool is built on [Metaschema Java Tools](https://github.com/metaschema-framework/metaschema-java) and [liboscal-java](https://github.com/metaschema-framework/liboscal-java/). | ||
|
|
||
| ## Architecture | ||
|
|
||
| This is a single-module Maven project producing the `oscal-cli-enhanced` artifact. | ||
|
|
||
| ### Package Structure | ||
|
|
||
| - `dev.metaschema.oscal.tools.cli.core` - CLI entry point (`CLI.java` main class) | ||
| - `dev.metaschema.oscal.tools.cli.core.commands` - Top-level commands (validate, convert, resolve-profile) | ||
| - `dev.metaschema.oscal.tools.cli.core.commands.<model>` - Model-specific subcommands (catalog, profile, ssp, etc.) | ||
| - `dev.metaschema.oscal.tools.cli.core.utils` - Utility classes | ||
|
|
||
| ### CLI Framework | ||
|
|
||
| The CLI uses the `cli-processor` module from metaschema-java for command parsing and execution. | ||
|
|
||
| ### Command Pattern | ||
|
|
||
| Commands follow an inheritance hierarchy: | ||
| - **Parent commands** (e.g., `CatalogCommand`) extend `AbstractParentCommand` and register subcommands | ||
| - **Validation commands** extend `AbstractOscalValidationCommand` → `AbstractValidateContentCommand` | ||
| - **Convert commands** extend `AbstractOscalConvertCommand` | ||
| - **Resolve commands** extend `AbstractResolveCommand` | ||
|
|
||
| Each OSCAL model type (catalog, profile, ssp, component-definition, assessment-plan, assessment-results, poam) has its own package with validate and convert subcommands. | ||
|
|
||
| ## Code Style | ||
|
|
||
| - Java 11 target | ||
| - Uses SpotBugs annotations (`@NonNull`, `@Nullable`) for null safety | ||
|
|
||
| ## Git Workflow | ||
|
|
||
| - Repository: https://github.com/metaschema-framework/oscal-cli | ||
| - **All PRs MUST be created from a personal fork** (required by CONTRIBUTING.md) | ||
| - **All PRs MUST target the `develop` branch** | ||
| - All changes require PR review | ||
|
|
||
| ## Git Worktrees (MANDATORY) | ||
|
|
||
| **All development work MUST be done in a git worktree, not in the main repository checkout.** | ||
|
|
||
| ### Why Worktrees Are Required | ||
|
|
||
| - Isolates feature work from the main checkout | ||
| - Prevents accidental commits to the wrong branch | ||
| - Allows parallel work on multiple features | ||
| - Keeps the main checkout clean for reference and review | ||
|
|
||
| ### Worktree Location | ||
|
|
||
| Worktrees are stored in `.worktrees/` directory (gitignored) relative to the repository root. | ||
|
|
||
| ### Workflow | ||
|
|
||
| 1. **Before starting any feature work**, create a worktree: | ||
|
|
||
| ```bash | ||
| # Create worktree for a new feature branch | ||
| git worktree add .worktrees/<feature-name> -b <feature-branch> origin/develop | ||
| ``` | ||
|
|
||
| 2. **Check for existing worktrees** before making changes: | ||
|
|
||
| ```bash | ||
| git worktree list | ||
| ``` | ||
|
|
||
| 3. **Switch to the appropriate worktree** if one already exists for your task | ||
|
|
||
| 4. **Remove worktrees** after PRs are merged: | ||
|
|
||
| ```bash | ||
| git worktree remove .worktrees/<feature-name> | ||
| ``` | ||
|
|
||
| ### Red Flags (You're Working in the Wrong Directory) | ||
|
|
||
| - Making changes without first checking `git worktree list` | ||
| - Working in the main repository when a worktree exists for the feature | ||
| - Creating files or commits in the main checkout for feature work | ||
|
|
||
| Use the `superpowers:using-git-worktrees` skill for guided worktree creation and management. | ||
|
|
||
| ## Testing | ||
|
|
||
| - Tests use JUnit 5 | ||
| - All PRs require passing CI checks before merge | ||
| - 100% of unit tests must pass before pushing code | ||
| - See [TESTING.md](TESTING.md) for detailed testing documentation | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Dependencies | ||
|
|
||
| This tool depends on: | ||
| - `metaschema-java` (core Metaschema framework, including cli-processor) | ||
| - `liboscal-java` (OSCAL Java library) | ||
|
|
||
| ## Running the CLI | ||
|
|
||
| After building, run the CLI: | ||
|
|
||
| ```bash | ||
| # From the build output | ||
| target/oscal-cli/bin/oscal-cli --help | ||
|
|
||
| # Disable colored output for legacy terminals | ||
| oscal-cli --no-color <command> | ||
| ``` | ||
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,24 @@ | ||
| { | ||
| "enabledPlugins": { | ||
| "metaschema@metaschema-framework": true, | ||
| "metaschema-tools@metaschema-framework": true, | ||
| "oscal@metaschema-framework": true, | ||
| "oscal-tools@metaschema-framework": true, | ||
| "dev-metaschema@metaschema-framework": true, | ||
| "superpowers@superpowers-marketplace": true | ||
| }, | ||
| "extraKnownMarketplaces": { | ||
| "metaschema-framework": { | ||
| "source": { | ||
| "source": "github", | ||
| "repo": "metaschema-framework/claude-plugins" | ||
| } | ||
| }, | ||
| "superpowers-marketplace": { | ||
| "source": { | ||
| "source": "github", | ||
| "repo": "obra/superpowers" | ||
| } | ||
| } | ||
| } | ||
| } |
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.
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.