Skip to content

Commit ee1b1f5

Browse files
committed
Merge branch 'agents' into 0.6
2 parents 0d94209 + 9e04a1e commit ee1b1f5

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

.claude/commands/code-review.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
2-
allowed-tools: Bash(git diff:*), Bash(git log:*), Bash(git merge-base:*), Bash(git rev-parse:*)
2+
allowed-tools: Bash(git branch:*), Bash(git diff:*), Bash(git log:*), Bash(git merge-base:*), Bash(git rev-parse:*)
33
description: Code review changes since branch diverged from default branch
44
---
55

6-
Review the code changes introduced since this branch diverged from the default branch (main).
6+
Review the code changes introduced since this branch diverged from its base branch.
77

88
**Agent assumptions (applies to all agents and subagents):**
99
- All tools are functional and will work without error. Do not test tools or make exploratory calls. Make sure this is clear to every subagent that is launched.
1010
- Only call a tool if it is required to complete the task. Every tool call should have a clear purpose.
1111

1212
To do this, follow these steps precisely:
1313

14-
1. Run `git diff main...HEAD` to get the diff and `git log main..HEAD --oneline` to get the commit list. If the diff is empty, stop and report there are no changes to review.
14+
1. Determine the base branch to diff against:
15+
- The default base branch is `main`.
16+
- Run `git branch` to list local branches and find any version branches (branches whose name matches the pattern `X.Y`, e.g. `0.6`, `1.2`).
17+
- For each version branch found, compare how close the current branch is to it vs. `main` by counting commits since divergence: `git log <branch>..HEAD --oneline | wc -l`. Pick the branch with the fewest commits (i.e. the most recent common ancestor). If a version branch is closer than `main`, use it as the base branch instead.
18+
- Store the chosen base branch name as BASE_BRANCH.
1519

16-
2. Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:
20+
2. Run `git diff BASE_BRANCH...HEAD` to get the diff and `git log BASE_BRANCH..HEAD --oneline` to get the commit list. If the diff is empty, stop and report there are no changes to review.
21+
22+
3. Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:
1723
- The root CLAUDE.md file, if it exists
1824
- Any CLAUDE.md files in directories containing files modified in the diff
1925

20-
3. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:
26+
4. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:
2127

2228
Agents 1 + 2: CLAUDE.md compliance sonnet agents
2329
Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.
@@ -40,11 +46,11 @@ To do this, follow these steps precisely:
4046

4147
If you are not certain an issue is real, do not flag it. False positives erode trust and waste reviewer time.
4248

43-
4. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.
49+
5. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.
4450

45-
5. Filter out any issues that were not validated in step 4. This step will give us our list of high signal issues for our review.
51+
6. Filter out any issues that were not validated in step 4. This step will give us our list of high signal issues for our review.
4652

47-
6. Output a summary of the review findings to the terminal:
53+
7. Output a summary of the review findings to the terminal:
4854
- If issues were found, list each issue with a brief description and the file/line it occurs in.
4955
- If no issues were found, state: "No issues found. Checked for bugs and CLAUDE.md compliance."
5056

.claude/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(symfony composer run *)"
5+
],
6+
"deny": [
7+
"Read(.env)",
8+
"Read(.env.dirigent.local)",
9+
"Read(.env.dirigent.local.php)",
10+
"Read(.env.dirigent.*.local)",
11+
"Read(./config/secrets/prod/prod.decrypt.private.php)"
12+
]
13+
}
14+
}

AGENTS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tests/
4848
- Always use strict comparisons (`===`, `!==`).
4949
- Enforce the use of DateTimeImmutable over DateTime.
5050
- Always use spaces in concatenation (`$a . $b`).
51-
- Always use imports. Use aliases when collisions occur or the imported name is unclear.
51+
- Always use imports. Use aliases when collisions occur or the imported name is unclear. Do not import classes from the root namespace (e.g. `\RuntimeException`, `\Stringable`); use the fully-qualified backslash prefix inline instead.
5252
- Don't use blank lines between import groups.
5353

5454
## Commands
@@ -57,30 +57,30 @@ tests/
5757

5858
```shell
5959
# Run all linting jobs
60-
symfony composer lint
60+
symfony composer run lint
6161

6262
# Individual linters
63-
symfony composer lint:refactor # Rector (automatically applies changes)
64-
symfony composer lint:coding-style # PHP-CS-Fixer (automatically applies changes)
65-
symfony composer lint:static-analysis # PHPStan level 5
66-
symfony composer lint:container # Symfony container validation
67-
symfony composer lint:templates # Twig template validation
63+
symfony composer run lint:refactor # Rector (automatically applies changes)
64+
symfony composer run lint:coding-style # PHP-CS-Fixer (automatically applies changes)
65+
symfony composer run lint:static-analysis # PHPStan level 5
66+
symfony composer run lint:container # Symfony container validation
67+
symfony composer run lint:templates # Twig template validation
6868
```
6969

7070
### Testing
7171

7272
```shell
7373
# Prepare the Symfony test environment for tests (if the database schema changed)
74-
symfony composer tests:setup
74+
symfony composer run tests:setup
7575

7676
# Run all tests
77-
symfony composer tests
77+
symfony composer run tests
7878

7979
# Run only PHP tests
80-
symfony composer tests:php
81-
symfony composer tests:php:unit
82-
symfony composer tests:php:functional
80+
symfony composer run tests:php
81+
symfony composer run tests:php:unit
82+
symfony composer run tests:php:functional
8383

8484
# Run tests for Docker images
85-
symfony composer tests:docker
85+
symfony composer run tests:docker
8686
```

0 commit comments

Comments
 (0)