Skip to content

Add Сlaude Сode related entities#676

Open
RomanNikitenko wants to merge 5 commits intoche-incubator:mainfrom
RomanNikitenko:add-claude-code
Open

Add Сlaude Сode related entities#676
RomanNikitenko wants to merge 5 commits intoche-incubator:mainfrom
RomanNikitenko:add-claude-code

Conversation

@RomanNikitenko
Copy link
Copy Markdown
Collaborator

@RomanNikitenko RomanNikitenko commented Mar 31, 2026

What does this PR do?

  • adds CLAUDE.md file
  • adds add-rebase-rules skill
  • adds Google Cloud CLI to the Dev image - ability to install and use Claude Code for che-code development

What issues does this PR fix?

eclipse-che/che#23749

How to test this PR?

I was able to install and use Claude Code for che-code development on the dogfooding instance:

Screenshot 2026-04-01 at 20 22 29

Skill for adding a rebase rule was added within current PR.

To do it:

  • run Claude Code in the che-code
  • type add-rebase-rules
  • provide a commit that requires adding a rebase rule

I tested the skill for a real task within #646:

image

The result was:
image

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Summary by CodeRabbit

  • Documentation

    • Added developer documentation covering project overview, repository structure, development and build workflows, tests, and container/launcher guidance.
    • Added a new Claude skill doc that automates generating rebase rules and outlines validation and changelog steps.
  • Chores

    • Updated development Docker image: bumped copyright header year and added pinned Google Cloud CLI installation with build-time version verification.

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Generated-by: Claude Code
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Generated-by: Cursor AI
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Generated-by: Cursor AI
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

Click here to review and test in web IDE: Contribute

@RomanNikitenko RomanNikitenko changed the title Add claude code Add Сlaude Сode related entities Mar 31, 2026
@github-actions
Copy link
Copy Markdown

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Generated-by: Cursor AI
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

@RomanNikitenko RomanNikitenko marked this pull request as ready for review April 1, 2026 17:25
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Adds three changes: a new skill definition at .claude/skills/add-rebase-rules/SKILL.md that documents a complete workflow for generating/updating Che-specific rebase rules from a commit SHA (including input handling, file-scoping, rule formats, validation, changelog, and test requirements); a new top-level CLAUDE.md with repository overview and developer workflows (build, test, container, and Che/launcher guidance); and an updated build/dockerfiles/dev.Dockerfile that adds an ARG GCLOUD_CLI_VERSION, configures a Google Cloud CLI yum repo, verifies availability of the requested google-cloud-cli version, installs it (with libxcrypt-compat), and validates the installation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ClaudeSkill as Skill
    participant Git
    participant RuleFiles as FS
    participant RebaseScript as rebase.sh
    participant Upstream

    User->>ClaudeSkill: invoke skill (SHA or URL)
    ClaudeSkill->>Git: resolve target commit SHA
    Git-->>ClaudeSkill: commit SHA
    ClaudeSkill->>Git: git show --name-only <SHA>
    Git-->>ClaudeSkill: list of changed files
    ClaudeSkill->>ClaudeSkill: filter candidates (code/, exclude extensions & package-lock)
    loop per candidate file
        ClaudeSkill->>RuleFiles: generate rule (.rebase/add, .rebase/override, or .rebase/replace)
    end
    ClaudeSkill->>RebaseScript: update conflict routing to reference new rules
    ClaudeSkill->>RuleFiles: append entry to .rebase/CHANGELOG.md
    ClaudeSkill->>Upstream: validate each `from` snippet exists (Perl dry-run, jq checks)
    Upstream-->>ClaudeSkill: validation results
    ClaudeSkill-->>User: report generated rules and validation status
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rgrunber
  • azatsarynnyy
  • vitaliy-guliy

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Title check ❌ Error The title uses imperative mood ("Add") and is under 72 characters, but contains non-ASCII Cyrillic characters that appear to be homoglyphs for Latin 'C', making it misleading. Replace the Cyrillic 'С' characters with standard ASCII 'C' to read: 'Add Claude Code related entities'. This clarifies the title and ensures proper text encoding.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Rebase Rules For Upstream Changes ✅ Passed PR introduces che-code repository with 8,964 code files, 58 .rebase/ rule files for conflict resolution, .rebase/CHANGELOG.md with rebasing strategy, and rebase.sh with 155 lines of conflict routing logic.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build/dockerfiles/dev.Dockerfile`:
- Around line 21-33: Pin the google-cloud-cli package to a specific tested
release by introducing a build ARG/ENV (e.g., GCLOUD_CLI_VERSION) and replace
the floating package install (google-cloud-cli) with the versioned package name
google-cloud-cli-${GCLOUD_CLI_VERSION}; ensure the Dockerfile declares the ARG
(or ENV) before the RUN that installs, document/update the build to pass a
GCLOUD_CLI_VERSION that is one of the 10 most recent releases in the repo, and
validate the chosen version during CI/build to avoid "package not found" 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dfce47d2-e3f8-41fd-b860-8df18cf151ca

📥 Commits

Reviewing files that changed from the base of the PR and between e76fa85 and 655b2f7.

📒 Files selected for processing (3)
  • .claude/skills/add-rebase-rules/SKILL.md
  • CLAUDE.md
  • build/dockerfiles/dev.Dockerfile

@sbouchet
Copy link
Copy Markdown
Collaborator

sbouchet commented Apr 2, 2026

@RomanNikitenko well done !
i've tested it for #677, works great !

@RomanNikitenko
Copy link
Copy Markdown
Collaborator Author

I tested add-rebase-rules skill for one more real-life task within current alignment with upstream to create rebase rules for commit RomanNikitenko@199009d
The skill successfully created rebase rules: RomanNikitenko@eb92105

Screenshot 2026-04-03 at 20 41 28

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Generated-by: Cursor AI
@RomanNikitenko
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

✅ Actions performed

Full review triggered.

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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/add-rebase-rules/SKILL.md:
- Around line 69-71: Update the SKILL.md multiline routing guidance to
acknowledge that rebase.sh uses two different multiline
handlers—apply_changes_multi_line and apply_multi_line_replace—so developers
should not always default to apply_changes_multi_line; instead, inspect the
target file and match the existing handler pattern (e.g., use
apply_multi_line_replace for files already handled that way, and
apply_changes_multi_line where it’s used) to ensure generated rules route to the
correct function and avoid misrouted conflicts.

In `@CLAUDE.md`:
- Around line 88-89: The documentation entry for `.rebase/replace/` is
misleadingly described as "wholesale file replacement"; update the CLAUDE.md
wording for `.rebase/replace/` to state that the rebase flow uses per-file JSON
"from"/"by" replacement rules keyed by file path (not full file swaps), give a
short example sentence like "each entry is a JSON object with 'from' and 'by'
strings applied to the specified file path", and clarify that replacements are
applied per file path rather than replacing entire files.
- Around line 113-115: The docs step instructs fetching `upstream-code main`
which mismatches how rebase.sh resolves UPSTREAM_VERSION (it expects a release
ref like upstream-code/release/1.104); update CLAUDE.md to fetch the correct
upstream branch/ref that rebase.sh uses (e.g., `git fetch upstream-code
release/1.104` or the appropriate release branch), and ensure the example aligns
with the UPSTREAM_VERSION resolution in rebase.sh so the rebase can find the
release ref.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7d0e8616-fafb-4c52-8a93-5d8fc45e7e18

📥 Commits

Reviewing files that changed from the base of the PR and between e76fa85 and f2e4837.

📒 Files selected for processing (3)
  • .claude/skills/add-rebase-rules/SKILL.md
  • CLAUDE.md
  • build/dockerfiles/dev.Dockerfile

Comment on lines +69 to +71
- use `apply_changes "$conflictingFile"` for line-based replacements.
- use `apply_changes_multi_line "$conflictingFile"` when multiline replacement is required.
- Do not add duplicate branches.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Handler definitions and usages =="
rg -n -C2 'apply_changes_multi_line|apply_multi_line_replace' rebase.sh

echo
echo "== Resolver routing branches =="
rg -n -C2 'resolve_conflicts|conflictingFile' rebase.sh

Repository: che-incubator/che-code

Length of output: 10724


Multiline routing guidance should account for handler variability in rebase.sh

Line 70 prescribes apply_changes_multi_line for all multiline replacements, but rebase.sh uses both apply_changes_multi_line (line 563) and apply_multi_line_replace (lines 543, 545) depending on the file. Generated rules following this guidance blindly will misroute some conflicts.

Recommend: Update guidance to acknowledge both handlers exist and developers should match existing patterns for comparable files.

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

In @.claude/skills/add-rebase-rules/SKILL.md around lines 69 - 71, Update the
SKILL.md multiline routing guidance to acknowledge that rebase.sh uses two
different multiline handlers—apply_changes_multi_line and
apply_multi_line_replace—so developers should not always default to
apply_changes_multi_line; instead, inspect the target file and match the
existing handler pattern (e.g., use apply_multi_line_replace for files already
handled that way, and apply_changes_multi_line where it’s used) to ensure
generated rules route to the correct function and avoid misrouted conflicts.

Comment on lines +88 to +89
- `replace/` — Files to wholesale replace in upstream

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

.rebase/replace/ is described incorrectly.

Line 89 says wholesale file replacement, but the rebase flow applies JSON from/by replacement rules per file path. This wording can lead contributors/agents to generate the wrong artifacts.

🔧 Proposed fix
-- `replace/` — Files to wholesale replace in upstream
+- `replace/` — JSON `from`/`by` replacement rules applied to upstream file content
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `replace/`Files to wholesale replace in upstream
- `replace/`JSON `from`/`by` replacement rules applied to upstream file content
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 88 - 89, The documentation entry for
`.rebase/replace/` is misleadingly described as "wholesale file replacement";
update the CLAUDE.md wording for `.rebase/replace/` to state that the rebase
flow uses per-file JSON "from"/"by" replacement rules keyed by file path (not
full file swaps), give a short example sentence like "each entry is a JSON
object with 'from' and 'by' strings applied to the specified file path", and
clarify that replacements are applied per file path rather than replacing entire
files.

Comment on lines +113 to +115
1. `git remote add upstream-code https://github.com/microsoft/vscode` (if not already added)
2. `git fetch upstream-code main`
3. `./rebase.sh` — Pulls subtree, applies `.rebase/` patches, updates JSON overrides
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Upstream reference used by rebase.sh =="
rg -n -C2 'UPSTREAM_VERSION|upstream-code/' rebase.sh

echo
echo "== Current CLAUDE.md fetch instruction =="
rg -n -C1 'git fetch upstream-code' CLAUDE.md

Repository: che-incubator/che-code

Length of output: 928


Update CLAUDE.md to fetch the correct upstream branch.

The instructions tell users to fetch upstream-code main, but rebase.sh resolves UPSTREAM_VERSION from upstream-code/release/1.104 (line 592). Following the current instructions will cause the rebase to fail when trying to resolve that release ref.

Suggested fix
-2. `git fetch upstream-code main`
+2. `git fetch upstream-code --prune` (or fetch the specific release branch used by rebase.sh)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. `git remote add upstream-code https://github.com/microsoft/vscode` (if not already added)
2. `git fetch upstream-code main`
3. `./rebase.sh` — Pulls subtree, applies `.rebase/` patches, updates JSON overrides
1. `git remote add upstream-code https://github.com/microsoft/vscode` (if not already added)
2. `git fetch upstream-code --prune` (or fetch the specific release branch used by rebase.sh)
3. `./rebase.sh` — Pulls subtree, applies `.rebase/` patches, updates JSON overrides
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 113 - 115, The docs step instructs fetching
`upstream-code main` which mismatches how rebase.sh resolves UPSTREAM_VERSION
(it expects a release ref like upstream-code/release/1.104); update CLAUDE.md to
fetch the correct upstream branch/ref that rebase.sh uses (e.g., `git fetch
upstream-code release/1.104` or the appropriate release branch), and ensure the
example aligns with the UPSTREAM_VERSION resolution in rebase.sh so the rebase
can find the release ref.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 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