Skip to content

Commit 8dfd6db

Browse files
Add issue routing and automation config to CLAUDE.md
Move PR target repo and git identity into CLAUDE.md so skills resolve configuration from the repo itself rather than relying on runner-side placeholder substitution. Add an issue resolution routing table that maps issue title patterns to skill files. Clean up the workflow by removing SKILL_SOURCE, SKILL_PATH, and PR_TARGET_REPO which are no longer needed. Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Made-with: Cursor
1 parent df2f75b commit 8dfd6db

3 files changed

Lines changed: 29 additions & 17 deletions

File tree

.claude/skills/test-pr.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Skill: Test PR
22

3-
You are working inside a project repository at /projects/che-code.
3+
You are working inside a project repository. Read `CLAUDE.md` at the repo root for the PR target repository and git identity configuration.
44

55
## Goal
66

77
Verify that the che-code-rebase-bot pipeline works end-to-end by making a trivial change, pushing a branch, and opening a pull request.
88

99
## Steps
1010

11-
1. **Configure git identity** (if not already set):
12-
```bash
13-
git config user.name "che-code-rebase-bot"
14-
git config user.email "che-code-rebase-bot@noreply"
15-
```
11+
1. **Configure git identity** using the values from the Automation Configuration section in `CLAUDE.md`.
1612

1713
2. **Create a new branch**:
1814
```bash
@@ -31,15 +27,15 @@ Verify that the che-code-rebase-bot pipeline works end-to-end by making a trivia
3127
git push origin HEAD
3228
```
3329

34-
5. **Create a pull request**:
30+
5. **Create a pull request** against the PR target repository from `CLAUDE.md`. Include the issue URL (from the prompt that triggered this skill) in the body:
3531
```bash
3632
gh pr create \
37-
--repo TARGET_REPO \
33+
--repo <PR target repository from CLAUDE.md> \
3834
--title "[rebase-bot]: test pipeline verification" \
3935
--body "Automated test PR created by che-code-rebase-bot to verify the pipeline works end-to-end. Safe to close.
4036
4137
### What issues does this PR fix?
42-
ISSUE_REF"
38+
<issue URL from the triggering prompt>"
4339
```
4440

4541
6. **Print the result**: output the PR URL so the orchestrator can capture it.

.github/workflows/trigger-rebase.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ on:
1818
issue_comment:
1919
types: [created]
2020

21-
# Where the PR should be created (upstream repo)
22-
env:
23-
PR_TARGET_REPO: RomanNikitenko/che-code
24-
2521
jobs:
2622
trigger-rebase:
2723
if: >-
@@ -89,10 +85,8 @@ jobs:
8985
working-directory: dw-claude-runner
9086
env:
9187
PROJECT_URL: '"https://github.com/${{ github.repository }}.git"'
92-
TARGET_REPO: ${{ env.PR_TARGET_REPO }}
88+
TARGET_REPO: ${{ github.repository }}
9389
ISSUE_REF: "https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}"
94-
SKILL_SOURCE: target_project
95-
SKILL_PATH: .claude/skills/test-pr.md
9690
run: |
9791
set -o pipefail
9892
./run.sh -v 2>&1 | tee /tmp/runner-output.txt

CLAUDE.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,26 @@ The final image is assembled from three platform-specific builds:
132132
- **linux-libc-ubi8** — Red Hat UBI 8
133133
- **linux-libc-ubi9** — Red Hat UBI 9
134134

135-
The `assembly.Dockerfile` combines all three into a single image that selects the right binary at runtime.
135+
The `assembly.Dockerfile` combines all three into a single image that selects the right binary at runtime.
136+
137+
## Automation Configuration
138+
139+
Settings used by automated skills (`.claude/skills/`):
140+
141+
- **PR target repository**: `RomanNikitenko/che-code`
142+
- **Git identity**: name `che-code-rebase-bot`, email `che-code-rebase-bot@noreply`
143+
144+
## Issue Resolution
145+
146+
When you receive a GitHub issue reference (either as a prompt like "Resolve this GitHub issue: \<URL\>" or just an issue URL), follow these rules:
147+
148+
1. Fetch the issue details (title, body) using `gh issue view <URL>`.
149+
2. Match the issue title against the routing table below.
150+
3. Read the matched skill file and follow its instructions exactly as written. Do not skip steps or improvise alternatives.
151+
4. If no skill matches the issue title, report: "No matching skill for this issue title: \<title\>" and exit with a non-zero code.
152+
153+
### Routing Table
154+
155+
| Issue title pattern | Skill file |
156+
|---|---|
157+
| "Alignment Che-Code with" | `.claude/skills/test-pr.md` |

0 commit comments

Comments
 (0)