Skip to content
Merged
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
13 changes: 11 additions & 2 deletions .archon/commands/defaults/archon-create-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@ git status --porcelain
```

**If dirty**:
1. Stage changes: `git add -A`
2. Commit: `git commit -m "Final changes before PR"`

1. Stage **only** the source files that are part of this change — never `git add -A`, `git add .`, or `git add -u`. List them by name:
```bash
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing else is staged
```
2. **Never stage** scratch / review / PR-body artifacts, even if they show up in `git status`:
- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR`
3. Commit: `git commit -m "Final changes before PR"`

### 2.2 Push Branch

Expand Down
13 changes: 10 additions & 3 deletions .archon/commands/defaults/archon-finalize-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ git status --porcelain

### 2.2 Stage Changes

Stage all implementation changes:
Stage **only** the implementation files you actually edited — never `git add -A`, `git add .`, or `git add -u`. List them by name:

```bash
git add -A
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing else is staged
```

**Review staged files** - ensure no sensitive files (.env, credentials) are included:
**Never stage** scratch / review / PR-body artifacts, even if they appear in `git status`:

- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR`

**Review staged files** — ensure no sensitive files (`.env`, credentials) and no scratch artifacts are included:

```bash
git diff --cached --name-only
Expand Down
12 changes: 10 additions & 2 deletions .archon/commands/defaults/archon-fix-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,19 @@ Execute any manual verification steps from the artifact.

### 7.1 Stage Changes

Stage **only** the files you actually edited — never `git add -A`, `git add .`, or `git add -u`. List them by name:

```bash
git add -A
git status # Review what's being committed
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing scratch/review/PR-body is staged
```

**Never stage**:

- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR`

### 7.2 Write Commit Message

**Format:**
Expand Down
15 changes: 12 additions & 3 deletions .archon/commands/defaults/archon-implement-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,19 @@ Execute any manual verification steps from the artifact.

### 7.1 Stage Changes

Stage **only** the files you actually edited — never `git add -A`, `git add .`, or `git add -u`. List them by name:

```bash
git add -A
git status # Review what's being committed
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing scratch/review/PR-body is staged
```

**Never stage**:

- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR`

### 7.2 Write Commit Message

**Format:**
Expand Down Expand Up @@ -367,7 +375,8 @@ Write the prepared body to `$ARTIFACTS_DIR/pr-body.md`, then:

```bash
gh pr create --title "Fix: {title} (#{number})" \
--body-file $ARTIFACTS_DIR/pr-body.md
--body-file $ARTIFACTS_DIR/pr-body.md \
--base $BASE_BRANCH
```

### 8.3 Get PR Number
Expand Down
12 changes: 10 additions & 2 deletions .archon/commands/defaults/archon-implement-review-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,19 @@ Must succeed.

### 4.1 Stage Changes

Stage **only** the files you actually edited while applying review fixes — never `git add -A`, `git add .`, or `git add -u`. List them by name:

```bash
git add -A
git status
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing scratch/review/PR-body is staged
```

**Never stage**:

- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR` (review artifacts live here, not in the worktree)

### 4.2 Commit

```bash
Expand Down
19 changes: 16 additions & 3 deletions .archon/commands/defaults/archon-simplify-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,29 @@ For each simplification:
2. Run `bun run type-check` — if it fails, revert that change
3. Run `bun run lint` — if it fails, fix or revert

**Track every path you edit.** You will need this list in Phase 3 to stage only the files you touched.

### Phase 3: VALIDATE & COMMIT

1. Run full validation: `bun run type-check && bun run lint`
2. If changes were made:
2. If simplifications were applied, stage **only** the files you edited in Phase 2 — never `git add -A`, `git add .`, or `git add -u`:
```bash
# Stage by name, using the list you tracked in Phase 2
git add path/to/file1.ts path/to/file2.ts
# Verify nothing else snuck in
git status --porcelain
```
3. **Never stage** report, scratch, or PR-body artifacts, even if they show up as untracked or modified in the worktree:
- Anything under `$ARTIFACTS_DIR` (the artifacts directory normally lives outside the worktree, but copies/symlinks may exist)
- `review/`, `simplify-report.md`, `*-report.md` at the repo root
- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`
- If `git status --porcelain` shows files you don't recognize as part of your simplifications, leave them unstaged
4. Commit and push only the staged source edits:
```bash
git add -A
git commit -m "simplify: reduce complexity in changed files"
git push
```
3. If no simplifications found, skip commit
5. If no simplifications were applied, skip the commit entirely

### Phase 4: REPORT

Expand Down
17 changes: 16 additions & 1 deletion .archon/workflows/defaults/archon-architect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ nodes:
1. Stage all changes and create a single commit (or verify existing commits)
2. Push the branch: `git push -u origin HEAD`
3. Check if a PR already exists: `gh pr list --head $(git branch --show-current)`
4. Create the PR with:
4. Create the PR targeting `$BASE_BRANCH` as the base branch:
`gh pr create --base $BASE_BRANCH --title "..." --body "..."`
- Title: concise description of what was simplified (under 70 chars)
- Body: use the format below
5. Save the PR URL to `$ARTIFACTS_DIR/.pr-url`
Expand Down Expand Up @@ -357,3 +358,17 @@ nodes:
additionalContext: >
Verify this command succeeded. If git push or gh pr create failed,
read the error message carefully before retrying.

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [create-pr]
14 changes: 14 additions & 0 deletions .archon/workflows/defaults/archon-feature-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@ nodes:
command: archon-create-pr
depends_on: [implement]
context: fresh

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [create-pr]
26 changes: 24 additions & 2 deletions .archon/workflows/defaults/archon-fix-github-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ nodes:

## Instructions

1. Check git status — ensure all changes are committed. If uncommitted changes exist, stage and commit them.
1. Check git status. If uncommitted changes exist, stage and commit ONLY source files that are part of the fix:
- List them by name with `git add <path1> <path2> ...` — never `git add -A`, `git add .`, or `git add -u`
- **Never commit** scratch / review / PR-body artifacts, even if they appear in `git status`:
- `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md` at any path
- `review/`, `*-report.md` at the repo root
- Anything under `$ARTIFACTS_DIR`
- Verify with `git status --porcelain` that nothing scratch is staged before committing
- If files you don't recognize as part of the fix appear modified or untracked, leave them alone
2. Push the branch: `git push -u origin HEAD`
3. Read implementation artifacts from `$ARTIFACTS_DIR/` for context:
- `$ARTIFACTS_DIR/investigation.md` or `$ARTIFACTS_DIR/plan.md`
Expand All @@ -172,6 +179,7 @@ nodes:
6. Create a DRAFT PR: `gh pr create --draft --base $BASE_BRANCH`
- Title: concise, imperative mood, under 70 chars
- Body: if a PR template was found, fill in **every section** with details from the artifacts. Don't skip sections or leave placeholders. If no template, write a body with summary, changes, validation evidence, and `Fixes #...`.
- **PR body file location**: if you write the body to a file (e.g. for `--body-file`), the file MUST live at `$ARTIFACTS_DIR/pr-body.md` or under `/tmp/` — NEVER inside the worktree. Files like `.pr-body.md` at the repo root will be picked up by later commits.
- Link to issue: include `Fixes #...` or `Closes #...`
7. Capture PR identifiers:
```bash
Expand All @@ -187,9 +195,23 @@ nodes:
# PHASE 7: REVIEW
# ═══════════════════════════════════════════════════════════════

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [create-pr]

- id: review-scope
command: archon-pr-review-scope
depends_on: [create-pr]
depends_on: [verify-pr-base]
context: fresh

- id: review-classify
Expand Down
16 changes: 15 additions & 1 deletion .archon/workflows/defaults/archon-idea-to-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,23 @@ nodes:
# PHASE 6: CODE REVIEW
# ═══════════════════════════════════════════════════════════════════

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [finalize-pr]

- id: review-scope
command: archon-pr-review-scope
depends_on: [finalize-pr]
depends_on: [verify-pr-base]
context: fresh

- id: sync
Expand Down
16 changes: 15 additions & 1 deletion .archon/workflows/defaults/archon-issue-review-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,23 @@ nodes:
# PHASE 3: CODE REVIEW
# ═══════════════════════════════════════════════════════════════════

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [implement]

- id: review-scope
command: archon-pr-review-scope
depends_on: [implement]
depends_on: [verify-pr-base]
context: fresh

- id: sync
Expand Down
42 changes: 39 additions & 3 deletions .archon/workflows/defaults/archon-piv-loop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,11 @@ nodes:

## Phase 4: COMMIT — Save Changes

Stage **only** the files you edited for this PIV task — never `git add -A`, `git add .`, or `git add -u`. List them by name:

```bash
git add -A
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing scratch/review/PR-body is staged
git diff --cached --stat
git commit -m "$(cat <<'EOF'
{type}: {task description}
Expand All @@ -511,7 +514,13 @@ nodes:
)"
```

<<<<<<< HEAD
Track progress in `.claude/archon/plans/progress.txt`:
=======
**Never stage**: `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`, `review/`, `*-report.md` at the repo root, or anything under `$ARTIFACTS_DIR`.

Track progress in `$ARTIFACTS_DIR/progress.txt`:
>>>>>>> 8295ece7 (fix(workflows): stop sweeping scratch artifacts from every git add -A site (#1506))
```
## Task {N}: {title} — COMPLETED
Date: {ISO date}
Expand Down Expand Up @@ -579,11 +588,19 @@ nodes:

## Step 5: Fix Obvious Issues

Fix type errors, lint warnings, missing imports, formatting. Commit any fixes:
Fix type errors, lint warnings, missing imports, formatting. Stage only the files you fixed — never `git add -A`. Skip the commit if there were no fixes:
```bash
<<<<<<< HEAD
git add -A && git commit -m "fix: address code review findings" 2>/dev/null || true
=======
git add path/to/file1 path/to/file2 ... # list real fixes only
git status --porcelain # verify nothing scratch/review/PR-body is staged
git diff --cached --quiet || git commit -m "fix: address code review findings"
>>>>>>> 8295ece7 (fix(workflows): stop sweeping scratch artifacts from every git add -A site (#1506))
```

**Never stage**: `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`, `review/`, `*-report.md` at the repo root, or anything under `$ARTIFACTS_DIR`.

## Step 6: Present Review

```
Expand Down Expand Up @@ -660,8 +677,11 @@ nodes:

## Step 4: Commit Fixes

Stage **only** the files you actually edited while addressing feedback — never `git add -A`. List them by name:

```bash
git add -A
git add path/to/file1 path/to/file2 ...
git status --porcelain # verify nothing scratch/review/PR-body is staged
git commit -m "$(cat <<'EOF'
fix: address review feedback

Expand All @@ -672,6 +692,8 @@ nodes:
)"
```

**Never stage**: `.pr-body.md`, `pr-body.md`, `*.scratch.md`, `*.tmp.md`, `review/`, `*-report.md` at the repo root, or anything under `$ARTIFACTS_DIR`.

## Step 5: Report

```
Expand Down Expand Up @@ -764,3 +786,17 @@ nodes:
All checks passed.
===============================================================
```

- id: verify-pr-base
bash: |
set -euo pipefail
EXPECTED="$BASE_BRANCH"
ACTUAL=$(gh pr view --json baseRefName -q '.baseRefName')
if [ "$ACTUAL" != "$EXPECTED" ]; then
PR_NUMBER=$(gh pr view --json number -q '.number')
echo "Base mismatch on PR #$PR_NUMBER: expected=$EXPECTED actual=$ACTUAL — re-targeting" >&2
gh pr edit "$PR_NUMBER" --base "$EXPECTED"
else
echo "PR base verified: $EXPECTED"
fi
depends_on: [finalize]
Loading
Loading