Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .claude/skills/port-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ gh issue view <ISSUE> --json title,body,labels
## Step 2 — Understand the source change

```bash
gh pr view <PR> --repo sillsdev/machine --json title,body,files,commits
gh pr view <PR> --repo sillsdev/machine --json title,body,files,commits,mergeCommit
gh pr diff <PR> --repo sillsdev/machine
```

Read the full diff. For each changed C# file, open the corresponding file(s) in
`../machine` to understand the surrounding context, and identify the Python counterpart
(see mapping below). Read the existing Python code you're about to change so the port
matches local idiom.
Read the full diff. For each changed C# file, read the corresponding file(s) in
`../machine` as of the merge commit, with `git -C ../machine show <mergeCommit>:<path>`,
Comment thread
claude[bot] marked this conversation as resolved.
to understand the surrounding context. The working tree may have moved on since the PR
merged. First check the commit with `git -C ../machine cat-file -e <mergeCommit>`. If it
fails, the clone predates the merge: run `git -C ../machine fetch`. Identify the Python
counterpart (see mapping below). Read the existing Python code you're about to change so
the port matches local idiom.

Note: not every change ports. Skip C#-only concerns (`.csproj`/`.sln`/`Directory.*.props`,
`AssemblyInfo`, `omnisharp.json`, csharpier/editorconfig formatting, NuGet packaging).
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ jobs:
- name: Install dependencies
run: poetry install --no-interaction --all-extras

# port-pr reads the C# source from a sibling clone, as of each source PR's merge
# commit, so it needs full history. Outside the workspace, black and flake8 skip it.
- name: Clone sillsdev/machine
run: git clone https://github.com/sillsdev/machine.git ../machine

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
Expand All @@ -83,7 +88,8 @@ jobs:
# The action's own prompt ends an issue run with a "Create a PR" link; the
# appended prompt has Claude open the pull request itself.
claude_args: >-
--allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh issue view:*),Bash(git log:*),Bash(git blame:*),Bash(git show:*),Bash(git diff:*),Bash(git status:*),Bash(poetry run:*),Bash(./local_check.sh:*)"
--add-dir ../machine
--allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh issue view:*),Bash(git log:*),Bash(git blame:*),Bash(git show:*),Bash(git diff:*),Bash(git status:*),Bash(git -C ../machine show:*),Bash(git -C ../machine cat-file:*),Bash(git -C ../machine log:*),Bash(git -C ../machine blame:*),Bash(poetry run:*),Bash(./local_check.sh:*)"
--append-system-prompt "When invoked on an issue and you change code, open the pull request yourself once your commits are pushed: gh pr create --base main --head <your branch>. Post its link in your comment in place of a Create a PR link. Write the title and body with the pr-authoring skill, and put Closes #<issue number> in the body. Before opening it, run ./local_check.sh --agent-strict and report its result in the body. Dependencies are already installed, and you work on the branch this action created: where a skill such as port-pr says to install, create or switch branches, or push, commit on the current branch and push it the way these instructions say."
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
Loading