Skip to content

docs: split CLAUDE.md into focused skills#122

Open
feloy wants to merge 4 commits intokortex-hub:mainfrom
feloy:more-skills
Open

docs: split CLAUDE.md into focused skills#122
feloy wants to merge 4 commits intokortex-hub:mainfrom
feloy:more-skills

Conversation

@feloy
Copy link
Copy Markdown
Contributor

@feloy feloy commented Mar 27, 2026

CLAUDE.md was too large (1814 lines) making it difficult to navigate and find specific guidance. Split detailed implementation guides into 9 new skills while keeping essential architectural patterns in core docs. Reduces CLAUDE.md to 348 lines (81% reduction).

New skills created:

  • working-with-runtime-system - Runtime architecture and optional interfaces
  • working-with-steplogger - Progress feedback integration
  • working-with-config-system - Workspace configuration and multi-level merging
  • working-with-podman-runtime-config - Podman runtime configuration
  • implementing-command-patterns - Advanced command patterns
  • testing-commands - Command testing patterns
  • working-with-instances-manager - Manager API and project detection
  • cross-platform-development - Path handling and testing practices
  • testing-best-practices - Parallel tests and fake objects

Closes #112

CLAUDE.md was too large (1814 lines) making it difficult to navigate
and find specific guidance. Split detailed implementation guides into
9 new skills while keeping essential architectural patterns in core
docs. Reduces CLAUDE.md to 348 lines (81% reduction).

New skills created:
- working-with-runtime-system - Runtime architecture and optional interfaces
- working-with-steplogger - Progress feedback integration
- working-with-config-system - Workspace configuration and multi-level merging
- working-with-podman-runtime-config - Podman runtime configuration
- implementing-command-patterns - Advanced command patterns
- testing-commands - Command testing patterns
- working-with-instances-manager - Manager API and project detection
- cross-platform-development - Path handling and testing practices
- testing-best-practices - Parallel tests and fake objects

Closes kortex-hub#112

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@feloy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 4 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 4 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 798d9945-029b-4e98-87c3-89cc2850ead2

📥 Commits

Reviewing files that changed from the base of the PR and between 292338b and 2ba5a91.

📒 Files selected for processing (2)
  • skills/README.md
  • skills/working-with-runtime-system/SKILL.md
📝 Walkthrough

Walkthrough

Extracted large sections from AGENTS.md into eight new skill documents and added nine small pointer files under .claude/skills/ that reference those skill documents; AGENTS.md was simplified to short descriptions with redirects to the new skill pages.

Changes

Cohort / File(s) Summary
Claude skill pointers
\.claude/skills/cross-platform-development, \.claude/skills/implementing-command-patterns, \.claude/skills/testing-best-practices, \.claude/skills/testing-commands, \.claude/skills/working-with-config-system, \.claude/skills/working-with-instances-manager, \.claude/skills/working-with-podman-runtime-config, \.claude/skills/working-with-runtime-system, \.claude/skills/working-with-steplogger
Added nine one-line pointer files each containing a relative path reference to the corresponding skills/*/SKILL.md.
Primary documentation refactor
AGENTS.md
Removed large, detailed sections (JSON storage examples, StepLogger implementation, detailed command patterns/testing, config internals, Podman config, cross-platform examples) and replaced them with concise descriptions and redirects to the new /working-with-* skill pages. (Net: +70 / -1536 lines)
New skill documentation
skills/cross-platform-development/SKILL.md, skills/implementing-command-patterns/SKILL.md, skills/testing-best-practices/SKILL.md, skills/testing-commands/SKILL.md, skills/working-with-config-system/SKILL.md, skills/working-with-instances-manager/SKILL.md, skills/working-with-podman-runtime-config/SKILL.md, skills/working-with-runtime-system/SKILL.md, skills/working-with-steplogger/SKILL.md
Added eight comprehensive skill documents covering cross-platform path rules, CLI command patterns (preRun/run, JSON output handling), testing standards (t.Parallel rules, fakes/factories), command testing patterns, config system structure/merging, instances manager usage/lifecycle, Podman runtime config schema/usage, and StepLogger integration and usage examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: splitting documentation into focused skills for improved navigation.
Description check ✅ Passed The description clearly explains the rationale for the change, lists all 9 new skills created, and references the related issue.
Linked Issues check ✅ Passed The PR directly addresses issue #112's objective of splitting a large documentation file into focused skills to improve maintainability.
Out of Scope Changes check ✅ Passed All changes are directly related to the documentation refactoring objective. AGENTS.md and CLAUDE.md were consolidated and split into skills; no unrelated changes were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
skills/implementing-command-patterns/SKILL.md (1)

42-43: Resolve guidance inconsistency for flag access.
The doc says to always bind flags directly to struct fields, but the JSON pattern then reads --storage via cmd.Flags().GetString(). Please clarify this as an explicit exception for inherited/global flags, or update the wording from “always” to avoid contradiction.

Based on learnings: "Applies to pkg/cmd/*.go : Always bind command flags directly to struct fields using *Var variants (StringVarP, BoolVarP, IntVarP) instead of using non-binding variants".

Also applies to: 163-166

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/implementing-command-patterns/SKILL.md` around lines 42 - 43, The doc
currently mandates "always" binding flags with the *Var variants (e.g.,
StringVarP, BoolVarP, IntVarP) but the JSON example still reads an
inherited/global flag using cmd.Flags().GetString() (the --storage access),
creating a contradiction; update the prose to remove the absolute "always" and
add a single explicit exception that inherited/global or shared flags may be
read via cmd.Flags().GetString()/GetBool()/GetInt when they cannot be bound to
the local command struct, and update the JSON example or its caption to either
bind --storage with StringVarP to the command struct (preferred) or call out
that cmd.Flags().GetString() is an intentional exception for inherited/global
flags (mentioning cmd.Flags().GetString() and StringVarP as the symbols to
inspect).
skills/testing-best-practices/SKILL.md (1)

35-53: Clarify example names in “correct vs incorrect” t.Setenv() snippets.
Using the same function name for both examples can be confusing when copied. Consider distinct names like TestWithEnvVariable_Correct and TestWithEnvVariable_Incorrect.

Based on learnings: "Applies to **/*_test.go : Tests using t.Setenv() to set environment variables CANNOT use t.Parallel() on the parent test function due to Go testing framework restrictions".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/testing-best-practices/SKILL.md` around lines 35 - 53, Rename the
duplicate test function names so the correct and incorrect examples are
unambiguous (e.g., change the first TestWithEnvVariable to
TestWithEnvVariable_Correct and the second to TestWithEnvVariable_Incorrect),
and update the surrounding text to call out the rule applies to tests in
*_test.go (tests that use t.Setenv() on a parent must not call t.Parallel());
update references in the examples to match the new identifiers
(TestWithEnvVariable_Correct, TestWithEnvVariable_Incorrect) so copying them
won’t produce duplicate-symbol errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/implementing-command-patterns/SKILL.md`:
- Around line 255-257: Remove the ignored-error pattern when reading the
--storage flag and resolving its path: call cmd.Flags().GetString("storage") and
check its error, and either remove the unnecessary filepath.Abs() or call
filepath.Abs(storageDir) and check its error; update usages of
storageDir/absStorageDir (e.g., when constructing instances.NewManager) to use
the validated variable. Ensure you return wrapped errors like "failed to read
--storage flag" or "failed to resolve storage path" so failures are propagated
instead of being ignored.

In `@skills/working-with-config-system/SKILL.md`:
- Around line 51-55: The heading sentence "Configurations are merged from lowest
to highest priority" contradicts the numbered list order; update SKILL.md to
make them consistent by either changing that sentence to "highest to lowest
priority" or reversing the numbered list so it reads Workspace → Global project
→ Project-specific → Agent-specific; reference the exact phrases to adjust: the
sentence "Configurations are merged from lowest to highest priority" and the
list items "Agent-specific configuration (from `agents.json`)",
"Project-specific configuration (from `projects.json` using project ID)",
"Global project configuration (from `projects.json` using empty string `\"\"`
key)", and "Workspace-level configuration (from `.kortex/workspace.json`)".

In `@skills/working-with-instances-manager/SKILL.md`:
- Around line 257-260: The code is referring to the wrong package for the
ErrRuntimeNotFound error; replace the incorrect qualifier
instances.ErrRuntimeNotFound with runtime.ErrRuntimeNotFound (and ensure the
pkg/runtime package is imported or referenced appropriately) in the runtime not
found check using the symbol ErrRuntimeNotFound so the code compiles and matches
the actual error definition.

In `@skills/working-with-runtime-system/SKILL.md`:
- Around line 108-123: The Terminal method signature on podmanRuntime must be
updated to match the interface by adding the missing agent parameter: change the
function signature of Terminal to accept (ctx context.Context, agent string,
instanceID string, command []string) error, add a simple validation for agent
(e.g., ensure agent != "" similar to instanceID/command checks), and keep the
existing arg construction and invocation of p.executor.RunInteractive(ctx,
args...) (no other call sites in this snippet need code changes here). Ensure
you update the podmanRuntime.Terminal function declaration and its parameter
usage so the method matches the interface while continuing to build args :=
[]string{"exec","-it", instanceID} and calling p.executor.RunInteractive.
- Around line 98-104: Update the documented Terminal interface signature in
SKILL.md to match the actual code by adding the missing agent parameter: the
Terminal method on the Terminal interface should accept (ctx context.Context,
agent string, instanceID string, command []string) so the doc reflects the
4-parameter signature used to load agent-specific configuration for the terminal
session; update the comment text if needed to mention the agent argument's
purpose.

---

Nitpick comments:
In `@skills/implementing-command-patterns/SKILL.md`:
- Around line 42-43: The doc currently mandates "always" binding flags with the
*Var variants (e.g., StringVarP, BoolVarP, IntVarP) but the JSON example still
reads an inherited/global flag using cmd.Flags().GetString() (the --storage
access), creating a contradiction; update the prose to remove the absolute
"always" and add a single explicit exception that inherited/global or shared
flags may be read via cmd.Flags().GetString()/GetBool()/GetInt when they cannot
be bound to the local command struct, and update the JSON example or its caption
to either bind --storage with StringVarP to the command struct (preferred) or
call out that cmd.Flags().GetString() is an intentional exception for
inherited/global flags (mentioning cmd.Flags().GetString() and StringVarP as the
symbols to inspect).

In `@skills/testing-best-practices/SKILL.md`:
- Around line 35-53: Rename the duplicate test function names so the correct and
incorrect examples are unambiguous (e.g., change the first TestWithEnvVariable
to TestWithEnvVariable_Correct and the second to TestWithEnvVariable_Incorrect),
and update the surrounding text to call out the rule applies to tests in
*_test.go (tests that use t.Setenv() on a parent must not call t.Parallel());
update references in the examples to match the new identifiers
(TestWithEnvVariable_Correct, TestWithEnvVariable_Incorrect) so copying them
won’t produce duplicate-symbol errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98c68341-5888-45eb-8b82-62458f4488c4

📥 Commits

Reviewing files that changed from the base of the PR and between 7029441 and 9433cb2.

📒 Files selected for processing (19)
  • .claude/skills/cross-platform-development
  • .claude/skills/implementing-command-patterns
  • .claude/skills/testing-best-practices
  • .claude/skills/testing-commands
  • .claude/skills/working-with-config-system
  • .claude/skills/working-with-instances-manager
  • .claude/skills/working-with-podman-runtime-config
  • .claude/skills/working-with-runtime-system
  • .claude/skills/working-with-steplogger
  • AGENTS.md
  • skills/cross-platform-development/SKILL.md
  • skills/implementing-command-patterns/SKILL.md
  • skills/testing-best-practices/SKILL.md
  • skills/testing-commands/SKILL.md
  • skills/working-with-config-system/SKILL.md
  • skills/working-with-instances-manager/SKILL.md
  • skills/working-with-podman-runtime-config/SKILL.md
  • skills/working-with-runtime-system/SKILL.md
  • skills/working-with-steplogger/SKILL.md

feloy added 2 commits March 27, 2026 09:13
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@feloy feloy requested review from benoitf and jeffmaury March 27, 2026 08:20
Updated the skills README to document all 16 available skills,
organized into 6 logical categories for easier discovery and
navigation by AI agents and developers.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
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.

Split AGENTS.md in Skills

2 participants