Skip to content
Open
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
2 changes: 1 addition & 1 deletion .claude/commands/approve-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If merge queue is detected (or forced via config):
- Write a merge queue marker file so the dashboard can track the PR:
```bash
mkdir -p .claude/agent-control
Comment thread
xsovad06 marked this conversation as resolved.
python3 -c "import json; print(json.dumps({'pr_number': <PR_NUMBER>, 'repo': '<OWNER/REPO>', 'issue_number': '<ISSUE_NUMBER>', 'branch_name': '<HEAD_BRANCH>'}))" > .claude/agent-control/merge-queue.json
python3 -c "import json; print(json.dumps({'pr_number': <PR_NUMBER>, 'repo': '<OWNER/REPO>', 'issue_number': '<ISSUE_NUMBER>', 'branch_name': '<HEAD_BRANCH>'}))" > .claude/agent-control/merge-queue-<PR_NUMBER>.json
```
- Proceed to queue polling (step 3b)

Expand Down
45 changes: 28 additions & 17 deletions .claude/commands/health-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,12 @@ grep -rc "def test_" tests/ apps/*/tests/ 2>/dev/null | awk -F: '{s+=$2} END {pr

### Step 3: Run checks

Run the project's test and lint commands to verify current health:

```bash
{{ check_cmd }}
```

If `{{ check_cmd }}` is not configured, look for `Makefile`, `package.json`
scripts, or CI config to find the right commands. Common fallbacks:
- `make test` + `make lint`
- `npm test` + `npm run lint`
- `cargo test` + `cargo clippy`
Run the project's test and lint commands to verify current health. Discover
the right commands by checking `Makefile`, `package.json` scripts, or CI
config. Common commands by project type:
- Python: `make check`, or `make test` + `make lint`
- Node: `npm test` + `npm run lint`
- Rust: `cargo test` + `cargo clippy`

### Step 4: Incremental mode check

Expand Down Expand Up @@ -134,12 +129,17 @@ produce all 10 scorecard dimensions but score non-focus areas based on Step 2
discovery only (no deep read). Mark non-focus scores as "(surface-level)" in
the scorecard.

**For full audits**, spawn these 3 agents in a single message (so they run
concurrently):
**For full audits**, call the Agent tool 3 times in a single message (so they
run concurrently). Use `subagent_type="general-purpose"` for all three. Include
the project context from Step 2 (name, tech stack, scale, stage) in each prompt.

If any agent fails or times out, proceed with the available results. Mark the
report as partial and note which dimension(s) were not analyzed. Score missing
dimensions as "(not analyzed)" in the scorecard.

#### Agent A: Architecture and Security
Prompt the agent with the project context from Step 2 (tech stack, scale, stage)
and instruct it to analyze:
Include the project context from Step 2 (tech stack, scale, stage)
and instruct the agent to analyze:
- Dependency graph health (circular imports between modules)
- Data model integrity (schema design, migration hygiene, index coverage)
- Security architecture (auth, input validation, secret handling, injection
Expand Down Expand Up @@ -182,9 +182,10 @@ as Agents A and B. Maximum 20 findings. List 3-5 operational strengths.

### Step 6: Synthesize and verify

After all 3 agents complete:
After the agents complete (or partially fail):

1. **Collect** all findings from the 3 agents.
1. **Collect** all findings from the completed agents. If any agent failed,
note the gap and continue with available results.
2. **Deduplicate** -- findings may overlap (e.g., both Agent A and Agent B flag
the same god file). Merge duplicates, keeping the most detailed evidence.
3. **Verify** -- spot-check 5-10 key findings with targeted `grep`, `wc -l`, or
Expand All @@ -210,6 +211,9 @@ gh api repos/:owner/:repo/milestones --jq '.[] | "\(.number)\t\(.title)"'

Only use labels and milestones that exist. If an appropriate label does not
exist, either create it with `gh label create` or use the closest existing one.
If the target milestone for issue creation does not exist in the list, create it
with `gh api repos/:owner/:repo/milestones -X POST -f title="<name>"` before
Phase C. Verify the milestone number is valid before using `--milestone`.

## Analysis Levels

Expand Down Expand Up @@ -429,6 +433,13 @@ Log completion and cost:
bash .claude/benchmark/log.sh "health_audit_complete" "" "" 2>/dev/null || true
```

On any unrecoverable error at any step (agent spawn failure, `gh` command error,
etc.), log the failure before stopping:

Comment thread
xsovad06 marked this conversation as resolved.
```bash
bash .claude/benchmark/log.sh "health_audit_failed" "" "" 2>/dev/null || true
```

## Constraints
- Do NOT fabricate findings. If you are unsure whether an issue exists, say so and
explain what you would check.
Expand Down
2 changes: 1 addition & 1 deletion .claude/commands/integrate-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ If merge queue is detected:
- If enqueued, write a merge queue marker file so the dashboard can track the PR:
```bash
mkdir -p .claude/agent-control
python3 -c "import json; print(json.dumps({'pr_number': <PR_NUMBER>, 'repo': '<OWNER/REPO>', 'issue_number': '<ISSUE_NUMBER>', 'branch_name': '<HEAD_BRANCH>'}))" > .claude/agent-control/merge-queue.json
python3 -c "import json; print(json.dumps({'pr_number': <PR_NUMBER>, 'repo': '<OWNER/REPO>', 'issue_number': '<ISSUE_NUMBER>', 'branch_name': '<HEAD_BRANCH>'}))" > .claude/agent-control/merge-queue-<PR_NUMBER>.json
```
Comment thread
xsovad06 marked this conversation as resolved.
- Then poll merge queue status via GraphQL every `merge_queue_poll_interval` seconds (default 30)
- On MERGED: proceed to Phase 6. If `delete_branch = true`, delete remote branch via GitHub API
Expand Down
Loading
Loading