Add Сlaude Сode related entities#676
Add Сlaude Сode related entities#676RomanNikitenko wants to merge 5 commits intoche-incubator:mainfrom
Conversation
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
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-676-amd64 |
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Generated-by: Cursor AI
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-676-amd64 |
📝 WalkthroughWalkthroughAdds three changes: a new skill definition at 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
.claude/skills/add-rebase-rules/SKILL.mdCLAUDE.mdbuild/dockerfiles/dev.Dockerfile
|
@RomanNikitenko well done ! |
|
I tested
|
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Generated-by: Cursor AI
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
.claude/skills/add-rebase-rules/SKILL.mdCLAUDE.mdbuild/dockerfiles/dev.Dockerfile
| - use `apply_changes "$conflictingFile"` for line-based replacements. | ||
| - use `apply_changes_multi_line "$conflictingFile"` when multiline replacement is required. | ||
| - Do not add duplicate branches. |
There was a problem hiding this comment.
🧩 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.shRepository: 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.
| - `replace/` — Files to wholesale replace in upstream | ||
|
|
There was a problem hiding this comment.
.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.
| - `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.
| 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 |
There was a problem hiding this comment.
🧩 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.mdRepository: 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.
| 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.
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-676-amd64 |

What does this PR do?
CLAUDE.mdfileadd-rebase-rulesskillDevimage - ability to install and use Claude Code for che-code developmentWhat 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:
Skill for adding a rebase rule was added within current PR.
To do it:
add-rebase-rulesI tested the skill for a real task within #646:
The result was:

Does this PR contain changes that override default upstream Code-OSS behavior?
git rebasewere added to the .rebase folderSummary by CodeRabbit
Documentation
Chores