Skip to content

Commit 596ace6

Browse files
committed
AI: Review what I was doing
1 parent 462e24c commit 596ace6

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ copies these files before every run so workflows see the latest tooling even whe
4141
target change is older. See `design-docs/jj-workspaces.md` for full rationale and
4242
lifecycle details.
4343

44+
# TOOLING
45+
46+
Instead of writing shell commands directly you should use `just`
47+
commands in the `ai` module. That is run commands like `just
48+
ai::COMMAND`. The commands that you should use are described in
49+
`ai.just`. If a useful command is missing you should add it to the
50+
just file.
51+
52+
4453
# Code quality guidelines
4554

4655
- Strive to achieve high code quality.

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
mod agents
22

3+
# Commands used by the AI, not by humans
4+
mod ai
5+
36
default:
47
@just --list
58

agents.just

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ run workspace_id workflow inner_workflow *ARGS:
88

99

1010
codex := "codex exec --skip-git-repo-check --full-auto --config model_reasoning_effort=high"
11+
codex-ui := "codex --config model_reasoning_effort=high --full-auto"
1112

1213
consolidate workspace_id start_change_id end_change_id: (run workspace_id "consolidate" "consolidate-inner" start_change_id end_change_id)
1314

@@ -66,6 +67,9 @@ questions-for-pm-inner rev='@':
6667
3. Read 'pm-faq.md' which contains previous questions asked to the product manager and her answers.
6768
4. Create questions to the product manager to clarify unclear design choices, priorities and so on. If everything is clear and no questions are needed do nothing.
6869
5. Append the new questions to the end of 'pm-faq.md' file
70+
71+
# Rules for the pm-faq.md file
72+
- Only ask questions related to issues in issues.md. In each question clearly mark which issues motivated this question
6973
EOF
7074

7175
jj new -r {{rev}} -m "Questions for the PM"
@@ -110,7 +114,7 @@ pm-flow-update-inner rev='@':
110114
#!/usr/bin/env sh
111115
read -r -d '' INSTRUCTIONS_2 <<-EOF
112116
1. Read the current state of open issues in 'issues.md'
113-
2. Read the conversation with the product manager so far in 'pm-faq.md'
117+
2. Read the conversation with the product manager so far in 'pm-faq.md'. Read ONLY THE LATEST SECTION. IGNORE PREVIOUS SECTIONS as they were already handled
114118
3. If necessary read relevant parts of the code
115119
4. Update the issues database in 'issues.md' to match the instructions provided by the product manager.
116120
EOF
@@ -294,3 +298,19 @@ continue-work-inner:
294298

295299
test:
296300
echo `pwd`
301+
302+
review-old workspace_id start_rev end_rev: (run workspace_id "review-old" "review-old-inner" start_rev end_rev)
303+
304+
review-old-inner start_rev end_rev:
305+
#!/usr/bin/env sh
306+
CURRENT_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
307+
echo BBBB: `pwd`
308+
309+
read -r -d '' INSTRUCTIONS <<-EOF
310+
I was working on something long ago but I forgot what I was doing. Go over the changes and bring me up-to-speed. The changes in question are all changes between "{{start_rev}}" and "{{end_rev}}".
311+
Recall that we are using Jujutsu VCS. Check the documentation on the web if you don''t know something about it.
312+
EOF
313+
314+
{{codex-ui}} "$INSTRUCTIONS"
315+
316+

ai.just

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# AI agents should add useful commands here
2+

scripts/agent-workspace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ workspace_root=${AI_WORKSPACES_ROOT:-"$cache_root_default/ai-workspaces"}
3434
workspace_repo_root="$workspace_root/$repo_slug"
3535

3636
tools_source_root="${AGENT_TOOLS_SOURCE:-$repo_root}"
37-
tools_relative_paths=("agents.just" "rules" "scripts")
37+
tools_relative_paths=("agents.just" "rules" "scripts" "AGENTS.md")
3838

3939
sanitise_workspace_id() {
4040
local id="$1"

0 commit comments

Comments
 (0)