wjs-auditing-project
Overview
Holistic project-state audit. Find everything that's stalled, broken, or diverged from the plan — then fix it together after the user confirms the checklist.
Hard two-phase split:
- Investigate → present grouped checklist (read-only; no commits, no merges, no pushes)
- Fix — only after the user explicitly confirms what to do
Never collapse the phases. The user wants to see the full picture before any action. "Just go ahead and fix everything" is fine as confirmation, but you still produce the checklist first so they can scan it.
When to use
- "看看现在的项目到底出了什么问题" / "make it right" / "what's broken"
- "为什么我的反馈还没上线"
- "为什么很久没有新 build / 没提交 App Store"
- "有没有 PR / 分支没合"
- Returning to a project after time away
- Before a release / TestFlight push, to make sure nothing is dangling
Phase 1 — Investigate (parallel)
Run all the read-only checks in one message with parallel Bash calls. Don't ask the user which to run; run them all. Many will return "nothing wrong" — that's fine, those just don't show up in the checklist.
A. Working tree & stashes
git status — uncommitted work?
git stash list — forgotten stashes?
git branch -vv — local branches, ahead/behind tracking
git log --oneline main..HEAD — what's on current branch not in main
git fetch origin --prune && git log --oneline HEAD..@{upstream} — what's on remote not local
git branch -r --merged main and git branch -r --no-merged main — remote branches still floating
B. Open / draft PRs
gh pr list --state open --json number,title,isDraft,mergeable,mergeStateStatus,updatedAt,author,headRefName
- For any PR older than 7 days OR with
mergeStateStatus ≠ CLEAN: capture the failing checks via gh pr checks <num>
- Auto-merge bot PRs (per memory: in-app feedback → @claude PR → auto-merge):
gh pr list --author "app/claude" --state all --limit 20 — any merged but not yet in a TestFlight build? Any stuck open?
C. CI / GitHub Actions
gh run list --limit 20 --json conclusion,name,headBranch,createdAt,databaseId,event
gh run list --status failure --limit 10 — failures specifically
- For each failure on
main or on an open PR's branch: gh run view <id> --log-failed | tail -100 to capture the actual error
D. Released vs unreleased work (iOS specifics for Cathier)
grep -E "MARKETING_VERSION|CURRENT_PROJECT_VERSION" *.xcodeproj/project.pbxproj | sort -u — current version + build number
git tag --sort=-creatordate | head -5 — recent release tags
git log --oneline <last-tag>..main — commits since last tagged release
- Check
fastlane/ config and fastlane/report.xml (if present) for last pilot / deliver invocation
git log -1 --format="%ai %s" -- fastlane/ — last fastlane change
git log --all --grep="bump\|version\|build" -10 --oneline — recent version bumps
E. Plan drift
- Read
TODOS.md, CHANGELOG.md, APP_STORE_SUBMISSION_GUIDE.md, ROADMAP.md, docs/plan*.md if any exist
- Cross-reference plan items against shipped commits — what's listed but not done? What has a date that's already passed?
grep -rn "TODO\|FIXME\|XXX" --include="*.swift" . — drift markers in source
F. App / system logs
ls -t ~/Library/Logs/DiagnosticReports/Cathier* 2>/dev/null | head -5 — recent crash reports for the app
log show --predicate 'process == "Cathier"' --last 1d --style compact 2>/dev/null | grep -iE "error|fault" | head -20 — recent runtime errors (skip silently if no install on this Mac)
ls -t ~/Library/Developer/Xcode/DerivedData/*/Logs/Build/*.xcactivitylog 2>/dev/null | head -3 — last build attempts (existence + mtime; don't try to parse)
G. User-feedback specifically
Per memory: in-app feedback creates @claude PRs that auto-merge into main. To answer "why isn't my feedback in the app":
- Was a PR created from feedback? (
gh pr list --author "app/claude" --state all)
- Was it merged? (check PR status)
- Is there a TestFlight/App Store build newer than the merge commit?
If 3 = no, that's the answer: merged into main but never built/submitted.
Presenting the checklist
Output one grouped markdown checklist. Each item must contain: what's wrong, evidence (numbers/dates/file paths), and a proposed action phrased so the user can say yes/no. Group by urgency:
## What I found
### 🔴 Blocking (these gate everything else)
- [ ] PR #42 "Add jokes redesign": 3 failing checks (SwiftLint, build, tests). Last commit 2026-04-30. → Read logs, fix, push?
- [ ] main is 7 commits ahead of last tag v1.4.0 (2026-03-22). No TestFlight build since then. → Tag v1.5.0 and prep release notes?
### 🟡 Open work
- [ ] Local branch `home-simplification` has 5 commits, no open PR, last activity 2026-05-08. → Open PR against main?
- [ ] Stash "WIP: brain trainer stats" from 2026-04-02. → Show diff and decide drop/apply?
### 🟢 Plan drift (TODOS.md / fastlane)
- [ ] TODOS.md line 14: "Submit App Store build by 2026-04-30" — overdue 11d, no `fastlane pilot` invocation since 2026-03-12.
- [ ] TODOS.md line 22: "Hook up haptics on streak page" — no matching commit on main.
- [ ] 2 auto-merged @claude PRs (#88, #91) from in-app feedback merged after last TestFlight build — user feedback shipped to main but not to TestFlight.
### Logs / errors
- [ ] 23 errors in last 24h matching "NSURLErrorDomain -1009" (offline path) — investigate or note as expected?
- [ ] 1 crash report from 2026-05-10 in DiagnosticReports — pull stack and triage?
### Looks fine
- Working tree clean, no orphan branches on origin, no failed CI on main this week.
End with: "想让我把这些都修好吗?还是挑一部分?或者先讨论某一项?"
Phase 2 — Fix (only after user confirms)
Once the user confirms (full set, subset, or "all green and yellow but not the App Store one"):
- TaskCreate a todo per confirmed item
- Order: failing CI → branch merges → tags → version bumps → release notes → build prompt
- Work them one at a time; mark done immediately, not in batches
- After each fix, re-run the corresponding check from phase 1 to verify it's actually resolved
- End with a short summary: fixed / skipped / requires-human
What you can do autonomously
- Read failing CI logs, edit code, push the fix
- Open a PR with
gh pr create for an unpushed branch
- Re-trigger a failed run with
gh run rerun <id> after diagnosing why it failed (don't blindly rerun flaky-looking failures — find the root cause first)
- Merge a clean PR (
gh pr merge --squash --auto) if the user said yes for that specific PR
- Bump
MARKETING_VERSION / CURRENT_PROJECT_VERSION in project.pbxproj
- Add a CHANGELOG entry, tag the release with
git tag (don't push tag until user confirms)
- Drop or pop a stash after showing the diff
What requires the user to act
Print the exact command they should run with a leading !:
! fastlane pilot upload — App Store / TestFlight submission signs the binary; needs them
! open Cathier.xcodeproj — anything that needs Xcode archive UI
- Anything destructive:
git reset --hard, git push --force, deleting branches
Common findings → standard fixes
| Finding |
Standard fix |
| Local branch ahead of main, no PR |
Rebase on main, push, gh pr create |
| PR failing CI on same step twice |
Read failed log, fix root cause, don't blindly rerun |
| Unreleased commits + stale TestFlight |
Bump build number, tag, write release notes, prompt user to run fastlane pilot |
| Stash >30 days, unclear context |
Show git stash show -p <n> to user, ask drop/apply |
| TODOS.md item with no commit |
Surface to user — descoped or forgotten? Don't assume |
| Auto-merged feedback PRs newer than last build |
The fix is a new TestFlight build, not more code changes |
fastlane/ untouched but plan says App Store deadline passed |
Surface the deadline + last submission date; user decides priority |
Red flags — STOP
| Thought |
Reality |
| "I'll just fix it and skip the checklist" |
No. The user asked specifically for the audit-then-confirm flow. |
| "The PR looks safe to merge, I'll do it" |
Only if they confirmed this PR by name in their reply. |
| "I'll force-push to clean up history" |
Never without explicit per-action confirmation. |
| "Let me close that stuck PR to tidy up" |
Investigate first; the work may be salvageable. |
| "I'll submit to App Store on their behalf" |
Never. Print the ! fastlane … command and stop. |
| "The crash report is probably nothing" |
Pull the stack and surface it. Let the user decide. |
| "Plan item is old, must be obsolete" |
Ask. Don't delete plan entries. |
Notes specific to this user / Cathier
- Default working dir:
/Users/jianshuo/code/Cathier. Honor wherever invoked.
- Cathier is a SwiftUI iOS app with
fastlane/ for App Store / TestFlight.
- Plan source of truth lives in
TODOS.md and APP_STORE_SUBMISSION_GUIDE.md. Read both.
- Memory note: in-app feedback →
app/claude opens a PR → auto-merge to main. So "why isn't my feedback in the app" usually means the merge happened but no new build was cut. Check TestFlight build date vs PR merge date before investigating the code.
gh is authenticated. fastlane is installed (Gemfile present).
- DESIGN.md is the visual source of truth; never propose UI fixes that conflict with it without flagging.
1---2name: wjs-auditing-project3description: Use when the user asks to audit what's wrong with a project, "make it right", "看看项目出了什么问题", "为什么用户的需求还没上线", "为什么没提交App Store", "为什么没新build", or wants a holistic state-of-the-project check covering unmerged branches, stalled PRs, failed GitHub Actions, stale builds, plan drift (TODOS.md / ROADMAP), unreleased commits, and log errors. Runs read-only investigation, presents a grouped checklist, fixes only after explicit user confirmation. Aware of the Cathier iOS app workflow (Xcode + fastlane + auto-merge @claude PRs from in-app feedback).4---5
6# wjs-auditing-project
7
8## Overview
9
10Holistic project-state audit. Find everything that's stalled, broken, or diverged from the plan — then fix it together after the user confirms the checklist.
11
12**Hard two-phase split:**
13
141. **Investigate → present grouped checklist** (read-only; no commits, no merges, no pushes)
152. **Fix** — only after the user explicitly confirms what to do
16
17Never collapse the phases. The user wants to see the full picture before any action. "Just go ahead and fix everything" is fine as confirmation, but you still produce the checklist first so they can scan it.
18
19## When to use
20
21- "看看现在的项目到底出了什么问题" / "make it right" / "what's broken"
22- "为什么我的反馈还没上线"
23- "为什么很久没有新 build / 没提交 App Store"
24- "有没有 PR / 分支没合"
25- Returning to a project after time away
26- Before a release / TestFlight push, to make sure nothing is dangling
27
28## Phase 1 — Investigate (parallel)
29
30Run all the read-only checks in **one message with parallel Bash calls**. Don't ask the user which to run; run them all. Many will return "nothing wrong" — that's fine, those just don't show up in the checklist.
31
32### A. Working tree & stashes
33- `git status` — uncommitted work?
34- `git stash list` — forgotten stashes?
35- `git branch -vv` — local branches, ahead/behind tracking
36- `git log --oneline main..HEAD` — what's on current branch not in main
37- `git fetch origin --prune && git log --oneline HEAD..@{upstream}` — what's on remote not local
38- `git branch -r --merged main` and `git branch -r --no-merged main` — remote branches still floating
39
40### B. Open / draft PRs
41- `gh pr list --state open --json number,title,isDraft,mergeable,mergeStateStatus,updatedAt,author,headRefName`
42- For any PR older than 7 days OR with `mergeStateStatus` ≠ `CLEAN`: capture the failing checks via `gh pr checks <num>`
43- Auto-merge bot PRs (per memory: in-app feedback → @claude PR → auto-merge): `gh pr list --author "app/claude" --state all --limit 20` — any merged but not yet in a TestFlight build? Any stuck open?
44
45### C. CI / GitHub Actions
46- `gh run list --limit 20 --json conclusion,name,headBranch,createdAt,databaseId,event`
47- `gh run list --status failure --limit 10` — failures specifically
48- For each failure on `main` or on an open PR's branch: `gh run view <id> --log-failed | tail -100` to capture the actual error
49
50### D. Released vs unreleased work (iOS specifics for Cathier)
51- `grep -E "MARKETING_VERSION|CURRENT_PROJECT_VERSION" *.xcodeproj/project.pbxproj | sort -u` — current version + build number
52- `git tag --sort=-creatordate | head -5` — recent release tags
53- `git log --oneline <last-tag>..main` — commits since last tagged release
54- Check `fastlane/` config and `fastlane/report.xml` (if present) for last `pilot` / `deliver` invocation
55- `git log -1 --format="%ai %s" -- fastlane/` — last fastlane change
56- `git log --all --grep="bump\|version\|build" -10 --oneline` — recent version bumps
57
58### E. Plan drift
59- Read `TODOS.md`, `CHANGELOG.md`, `APP_STORE_SUBMISSION_GUIDE.md`, `ROADMAP.md`, `docs/plan*.md` if any exist
60- Cross-reference plan items against shipped commits — what's listed but not done? What has a date that's already passed?
61- `grep -rn "TODO\|FIXME\|XXX" --include="*.swift" .` — drift markers in source
62
63### F. App / system logs
64- `ls -t ~/Library/Logs/DiagnosticReports/Cathier* 2>/dev/null | head -5` — recent crash reports for the app
65- `log show --predicate 'process == "Cathier"' --last 1d --style compact 2>/dev/null | grep -iE "error|fault" | head -20` — recent runtime errors (skip silently if no install on this Mac)
66- `ls -t ~/Library/Developer/Xcode/DerivedData/*/Logs/Build/*.xcactivitylog 2>/dev/null | head -3` — last build attempts (existence + mtime; don't try to parse)
67
68### G. User-feedback specifically
69Per memory: in-app feedback creates @claude PRs that auto-merge into main. To answer "why isn't my feedback in the app":
701. Was a PR created from feedback? (`gh pr list --author "app/claude" --state all`)
712. Was it merged? (check PR status)
723. Is there a TestFlight/App Store build *newer than the merge commit*?
73 If 3 = no, that's the answer: merged into main but never built/submitted.
74
75## Presenting the checklist
76
77Output **one** grouped markdown checklist. Each item must contain: what's wrong, evidence (numbers/dates/file paths), and a proposed action phrased so the user can say yes/no. Group by urgency:
78
79```
80## What I found
81
82### 🔴 Blocking (these gate everything else)
83- [ ] PR #42 "Add jokes redesign": 3 failing checks (SwiftLint, build, tests). Last commit 2026-04-30. → Read logs, fix, push?
84- [ ] main is 7 commits ahead of last tag v1.4.0 (2026-03-22). No TestFlight build since then. → Tag v1.5.0 and prep release notes?
85
86### 🟡 Open work
87- [ ] Local branch `home-simplification` has 5 commits, no open PR, last activity 2026-05-08. → Open PR against main?
88- [ ] Stash "WIP: brain trainer stats" from 2026-04-02. → Show diff and decide drop/apply?
89
90### 🟢 Plan drift (TODOS.md / fastlane)
91- [ ] TODOS.md line 14: "Submit App Store build by 2026-04-30" — overdue 11d, no `fastlane pilot` invocation since 2026-03-12.
92- [ ] TODOS.md line 22: "Hook up haptics on streak page" — no matching commit on main.
93- [ ] 2 auto-merged @claude PRs (#88, #91) from in-app feedback merged after last TestFlight build — user feedback shipped to main but not to TestFlight.
94
95### Logs / errors
96- [ ] 23 errors in last 24h matching "NSURLErrorDomain -1009" (offline path) — investigate or note as expected?
97- [ ] 1 crash report from 2026-05-10 in DiagnosticReports — pull stack and triage?
98
99### Looks fine
100- Working tree clean, no orphan branches on origin, no failed CI on main this week.
101```
102
103End with: **"想让我把这些都修好吗?还是挑一部分?或者先讨论某一项?"**
104
105## Phase 2 — Fix (only after user confirms)
106
107Once the user confirms (full set, subset, or "all green and yellow but not the App Store one"):
108
1091. **TaskCreate** a todo per confirmed item
1102. Order: failing CI → branch merges → tags → version bumps → release notes → build prompt
1113. Work them one at a time; mark done immediately, not in batches
1124. After each fix, **re-run the corresponding check** from phase 1 to verify it's actually resolved
1135. End with a short summary: fixed / skipped / requires-human
114
115### What you can do autonomously
116- Read failing CI logs, edit code, push the fix
117- Open a PR with `gh pr create` for an unpushed branch
118- Re-trigger a failed run with `gh run rerun <id>` after diagnosing why it failed (don't blindly rerun flaky-looking failures — find the root cause first)
119- Merge a clean PR (`gh pr merge --squash --auto`) if the user said yes for that specific PR
120- Bump `MARKETING_VERSION` / `CURRENT_PROJECT_VERSION` in `project.pbxproj`
121- Add a CHANGELOG entry, tag the release with `git tag` (don't push tag until user confirms)
122- Drop or pop a stash after showing the diff
123
124### What requires the user to act
125Print the exact command they should run with a leading `!`:
126- `! fastlane pilot upload` — App Store / TestFlight submission signs the binary; needs them
127- `! open Cathier.xcodeproj` — anything that needs Xcode archive UI
128- Anything destructive: `git reset --hard`, `git push --force`, deleting branches
129
130## Common findings → standard fixes
131
132| Finding | Standard fix |
133|---|---|
134| Local branch ahead of main, no PR | Rebase on main, push, `gh pr create` |
135| PR failing CI on same step twice | Read failed log, fix root cause, don't blindly rerun |
136| Unreleased commits + stale TestFlight | Bump build number, tag, write release notes, prompt user to run `fastlane pilot` |
137| Stash >30 days, unclear context | Show `git stash show -p <n>` to user, ask drop/apply |
138| TODOS.md item with no commit | Surface to user — descoped or forgotten? Don't assume |
139| Auto-merged feedback PRs newer than last build | The fix is *a new TestFlight build*, not more code changes |
140| `fastlane/` untouched but plan says App Store deadline passed | Surface the deadline + last submission date; user decides priority |
141
142## Red flags — STOP
143
144| Thought | Reality |
145|---|---|
146| "I'll just fix it and skip the checklist" | No. The user asked specifically for the audit-then-confirm flow. |
147| "The PR looks safe to merge, I'll do it" | Only if they confirmed *this PR* by name in their reply. |
148| "I'll force-push to clean up history" | Never without explicit per-action confirmation. |
149| "Let me close that stuck PR to tidy up" | Investigate first; the work may be salvageable. |
150| "I'll submit to App Store on their behalf" | Never. Print the `! fastlane …` command and stop. |
151| "The crash report is probably nothing" | Pull the stack and surface it. Let the user decide. |
152| "Plan item is old, must be obsolete" | Ask. Don't delete plan entries. |
153
154## Notes specific to this user / Cathier
155
156- Default working dir: `/Users/jianshuo/code/Cathier`. Honor wherever invoked.
157- Cathier is a SwiftUI iOS app with `fastlane/` for App Store / TestFlight.
158- Plan source of truth lives in `TODOS.md` and `APP_STORE_SUBMISSION_GUIDE.md`. Read both.
159- Memory note: in-app feedback → `app/claude` opens a PR → auto-merge to main. So "why isn't my feedback in the app" usually means *the merge happened but no new build was cut*. Check TestFlight build date vs PR merge date before investigating the code.
160- `gh` is authenticated. `fastlane` is installed (Gemfile present).
161- DESIGN.md is the visual source of truth; never propose UI fixes that conflict with it without flagging.