File tree Expand file tree Collapse file tree
.claude/skills/triaging-issues Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,7 +101,9 @@ Rules:
101101### Comment template mapping
102102
103103The category flow in the reference files describes the wording of comments
104- to post. Map the ** intent** of that comment to one of the templates below:
104+ to post. Map the ** intent** of that comment to one of the seven templates
105+ below (four "stay open" templates and three ` close-* ` templates):
106+
105107| Reference flow says to post… | Use template |
106108| ------------------------------| --------------|
107109| "Acknowledge this bug, we'll investigate" | ` ack-bug ` |
Original file line number Diff line number Diff line change 4343 with :
4444 fetch-depth : 1
4545
46+ - name : Lock down scripts/ as read-only
47+ # The agent has the generic `Write` tool (needed to emit the JSON
48+ # decision file). Without this step a compromised prompt/model
49+ # could overwrite an allowlisted script (e.g. get_pr_diff.sh) and
50+ # then execute it via the `Bash(bash scripts/get_pr_diff.sh:*)`
51+ # entry to run arbitrary commands and exfiltrate
52+ # CLAUDE_CODE_API_TOKEN. Stripping write bits on the directory
53+ # and its contents removes that path.
54+ run : |
55+ set -euo pipefail
56+ chmod -R a-w scripts
57+ chmod a-w scripts
58+
4659 - name : Review analysis
4760 uses : anthropics/claude-code-action@v1
4861 env :
Original file line number Diff line number Diff line change 4242 with :
4343 fetch-depth : 1
4444
45+ - name : Lock down scripts/ as read-only
46+ # The agent has the generic `Write` tool (needed to emit the JSON
47+ # decision file). Without this step a compromised prompt/model
48+ # could overwrite an allowlisted script (e.g. get_issue.sh) and
49+ # then execute it via the `Bash(bash scripts/get_issue.sh:*)`
50+ # entry to run arbitrary commands and exfiltrate
51+ # CLAUDE_CODE_API_TOKEN. Stripping write bits on the directory
52+ # and its contents removes that path.
53+ run : |
54+ set -euo pipefail
55+ chmod -R a-w scripts
56+ chmod a-w scripts
57+
4558 - name : Triage analysis
4659 uses : anthropics/claude-code-action@v1
4760 env :
Original file line number Diff line number Diff line change @@ -37,7 +37,10 @@ TEMPLATE=""
3737PARAMS_FILE=" "
3838
3939require_value () {
40- if [[ $# -lt 2 || -z " $2 " ]]; then
40+ # Treat a missing arg, an empty string, or a next token that looks
41+ # like another flag (`--foo`) as a missing value so the failure points
42+ # at the right argument.
43+ if [[ $# -lt 2 || -z " ${2:- } " || " $2 " == --* ]]; then
4144 echo " Error: $1 requires a value" >&2
4245 exit 1
4346 fi
@@ -90,6 +93,11 @@ if [[ -n "$PARAMS_FILE" && ! -f "$PARAMS_FILE" ]]; then
9093 exit 1
9194fi
9295
96+ if ! command -v python3 > /dev/null 2>&1 ; then
97+ echo " Error: python3 is required to render comment templates but was not found in PATH" >&2
98+ exit 1
99+ fi
100+
93101# Render the template in Python for robust handling of multi-line values
94102# and literal-string substitution (no shell-quoting / regex pitfalls).
95103OUT_FILE=$( mktemp)
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ set -euo pipefail
2020WORKFLOW=" "
2121
2222require_value () {
23- if [[ $# -lt 2 || -z " $2 " ]]; then
23+ # Treat a missing arg, an empty string, or a next token that looks
24+ # like another flag (`--foo`) as a missing value so the failure points
25+ # at the right argument.
26+ if [[ $# -lt 2 || -z " ${2:- } " || " $2 " == --* ]]; then
2427 echo " Error: $1 requires a value" >&2
2528 exit 1
2629 fi
You can’t perform that action at this time.
0 commit comments