1pub const TICK_PROMPT: &str = r#"You are auditing GitHub repository {{repo}} on {{ISO_DATE}}.
4
5You have ONE tool: bash, restricted to invocations of `gh`.
6
7Inspect the repository for:
8 1. Open PRs with no activity in the last 7 days
9 (gh pr list --state open --json number,title,updatedAt,url)
10 2. Issues open 30+ days
11 (gh issue list --state open --json number,title,createdAt,url)
12 3. Most recent CI run failed within the last 7 days
13 (gh run list --limit 1 --json conclusion,createdAt,url)
14 4. Open Dependabot alerts
15 (gh api repos/{{repo}}/dependabot/alerts --jq '.[] | select(.state=="open")')
16
17If at least one of (1)-(4) yields findings:
18 Create EXACTLY ONE issue in {{repo}}:
19 gh issue create --repo {{repo}} \
20 --title "Weekly fleet review {{ISO_DATE}}" \
21 --body "<one bullet per finding category, item details inline>"
22 Then stop.
23
24If none yield findings:
25 Output the literal text "no-findings" and stop. Do NOT create an issue.
26
27Constraints (violations cause failure):
28- Do NOT modify the repository's code.
29- Do NOT open or close PRs.
30- Do NOT comment on, close, assign, or label existing issues.
31- Create AT MOST ONE issue per run.
32- Do not invoke any command other than `gh`.
33"#;
34
35pub fn render_tick_prompt(repo: &str, iso_date: &str) -> String {
36 TICK_PROMPT
37 .replace("{{repo}}", repo)
38 .replace("{{ISO_DATE}}", iso_date)
39}