You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve org-wide workflow prompt based on claude-code-action
Extract meaningful prompt structure from anthropics/claude-code-action's
prompt template and apply it to the org-wide workflow:
- Strip trigger phrase from comment body before passing to Claude
- Add CLAUDE.md awareness (check and follow repo-specific instructions)
- Add read-before-modify discipline
- Add minimal/focused change guidelines (no over-engineering)
- Add security awareness (no secrets, no force push)
- Add structured PR creation instructions with descriptive messages
Co-authored-by: Ondřej Mirtes <ondrejmirtes@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/workflows/claude-org-wide.yml
+33-5Lines changed: 33 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -101,14 +101,42 @@ jobs:
101
101
GH_TOKEN: ${{ secrets.PHPSTAN_BOT_TOKEN }}
102
102
COMMENT_BODY: ${{ github.event.comment.body }}
103
103
REPO_NAME: ${{ matrix.repo }}
104
+
TRIGGER_PHRASE: "@phpstan-bot"
104
105
run: |
105
-
PROMPT="You are working on the repository ${REPO_NAME}.
106
+
# Strip the trigger phrase from the comment to get the actual request
107
+
REQUEST=$(echo "$COMMENT_BODY" | sed "s|${TRIGGER_PHRASE}||g" | sed 's/^[[:space:]]*//')
106
108
107
-
Here is the request from the issue comment:
108
-
${COMMENT_BODY}
109
+
PROMPT="You are an AI assistant working on the repository ${REPO_NAME}.
109
110
110
-
After making changes, you must create a pull request (not a draft) with your changes.
111
-
Do not just push a branch — always open a real, non-draft pull request so the changes can be reviewed and merged."
111
+
You are being triggered by an issue comment in the phpstan/.github repository. The comment contains a request that should be applied to this repository.
112
+
113
+
Here is the request:
114
+
${REQUEST}
115
+
116
+
Follow these steps:
117
+
118
+
1. First, check if there is a CLAUDE.md file in the repository root. If it exists, read and follow its instructions and guidelines.
119
+
120
+
2. Understand the request carefully. Read any relevant code before making changes. Do not modify code you have not read.
121
+
122
+
3. Implement the requested changes:
123
+
- Keep changes focused and minimal — only make what was requested.
124
+
- Do not add unnecessary features, refactoring, or documentation beyond what was asked.
125
+
- Be careful not to introduce security vulnerabilities.
126
+
- Do not over-engineer the solution.
127
+
128
+
4. After making changes, commit and create a pull request:
129
+
- Stage your changes with git add.
130
+
- Write a clear, descriptive commit message that explains why the change was made.
131
+
- Push your branch and create a non-draft pull request using gh pr create.
132
+
- The PR title should be concise and descriptive.
133
+
- The PR body should clearly describe what was changed and why.
134
+
- Do not just push a branch — always open a real, non-draft pull request so the changes can be reviewed and merged.
135
+
136
+
Important:
137
+
- Never force push or use destructive git commands.
138
+
- Never commit files that may contain secrets (.env, credentials, etc.).
139
+
- Only make changes that are directly requested or clearly necessary."
0 commit comments