Skip to content

Commit 3f46a01

Browse files
committed
docs(rules): switch agent audit report naming to daily files
- Remove `CURSOR_AGENT_CHAT_ID` requirement from audit report rules - Use `$(date +%F)-agent-report-<repo>-<branch>.md` and document append semantics - Update `/self-review` to match the new audit report convention - Fix `140-bash.mdc` example code fence + strict-mode callout
1 parent d1c75c0 commit 3f46a01

3 files changed

Lines changed: 32 additions & 20 deletions

File tree

commands/self-review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Generate a structured review report:
160160

161161
**Generate Audit Report (per `060-agent-audit.mdc`):**
162162

163-
- Ensure `CURSOR_AGENT_CHAT_ID` and `GIT_REPO_ROOT` are set (generate/export if missing), then write report to `<GIT_REPO_ROOT>/extras/agent_reports/agent_report_<repo>_<branch>_<CURSOR_AGENT_CHAT_ID>.md` (if `<GIT_REPO_ROOT>/extras/` exists and is gitignored) or `/tmp/agent_report_<repo>_<branch>_<CURSOR_AGENT_CHAT_ID>.md`
163+
- Ensure `GIT_REPO_ROOT` is set, then write/append the report to `<GIT_REPO_ROOT>/extras/agent_reports/$(date +%F)-agent-report-<repo>-<branch>.md` (if `<GIT_REPO_ROOT>/extras/` exists and is gitignored) or `/tmp/$(date +%F)-agent-report-<repo>-<branch>.md`
164164
- Include:
165165
- Start/end timestamps (local and UTC)
166166
- Repo name, branch name, `HEAD` SHA

rules/020-agent-audit.mdc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ Examples (not exhaustive):
8787

8888
For every non-trivial task, write **one** report file at a deterministic path.
8989

90-
### Chat/session identifier (required)
91-
92-
Agents MUST ensure a stable identifier is available for the current chat/session:
93-
94-
- If `CURSOR_AGENT_CHAT_ID` is already set: reuse it
95-
- Otherwise, generate one and export it once for the session:
96-
- `export CURSOR_AGENT_CHAT_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"`
97-
9890
### Repo root identifier (required)
9991

10092
Agents MUST resolve the absolute repository root path:
@@ -103,9 +95,14 @@ Agents MUST resolve the absolute repository root path:
10395

10496
### Path rules
10597
- If `<GIT_REPO_ROOT>/extras/` exists **and** it is gitignored, write to:
106-
- `<GIT_REPO_ROOT>/extras/agent_reports/agent_report_<repo>_<branch>_<CURSOR_AGENT_CHAT_ID>.md`
98+
- `<GIT_REPO_ROOT>/extras/agent_reports/$(date +%F)-agent-report-<repo>-<branch>.md`
10799
- Otherwise write to:
108-
- `/tmp/agent_report_<repo>_<branch>_<CURSOR_AGENT_CHAT_ID>.md`
100+
- `/tmp/$(date +%F)-agent-report-<repo>-<branch>.md`
101+
102+
### Append vs create (required)
103+
104+
- If the report file already exists for the day, **append** a new session section (include start/end timestamps, commands, results, etc.)
105+
- If it does not exist, **create** it and then append the session content
109106

110107
### Required contents
111108
The report MUST include:
@@ -131,7 +128,7 @@ For complex debugging sessions or demos, agents MAY create terminal recordings u
131128
- When user explicitly requests a recording
132129

133130
**Recording path:**
134-
- Save to: `<GIT_REPO_ROOT>/extras/agent_reports/recordings/<repo>_<branch>_<CURSOR_AGENT_CHAT_ID>.cast`
131+
- Save to: `<GIT_REPO_ROOT>/extras/agent_reports/recordings/$(date +%F)-agent-recording-<repo>-<branch>-$(date +%H%M%S).cast`
135132
- Reference the recording path in the markdown audit report
136133

137134
**How to record:**

rules/140-bash.mdc

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,14 +1336,29 @@ fi
13361336
Complete example demonstrating Bash best practices:
13371337

13381338
```bash
1339-
#!/usr/bin/env bash
1340-
set -eEuo pipefail
1339+
#!/bin/bash
1340+
#
1341+
# Script Name : my_script.sh
1342+
#
1343+
# Purpose : This script automates the processing of files and makes network requests.
1344+
#
1345+
#
1346+
# Usage : ./script.sh [-d] [-h] <provider> <module> [path]
1347+
#
1348+
# Dependencies : curl, tar, jq, nc, parallel
1349+
#
1350+
# Prompt Behavior : Prompts use green for questions, red for errors.
1351+
#
1352+
#
1353+
# Exit Codes : 0 (success), 1 (error), 2 (cancel), 3 (dependency missing)
1354+
#
1355+
#
1356+
# ----------------------------------------------------------------------------------------
1357+
# Turn debug on or off
1358+
# set -x
1359+
# ----------------------------------------------------------------------------------------
13411360

1342-
# ================================================================
1343-
# Script: process-users.sh
1344-
# Purpose: Process user data files with validation and error handling
1345-
# Usage: ./process-users.sh [OPTIONS] <input_file>
1346-
# ================================================================
1361+
set -euo pipefail
13471362

13481363
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13491364
readonly SCRIPT_NAME="$(basename "$0" .sh)"
@@ -1593,7 +1608,7 @@ fi
15931608

15941609
**Key Patterns Demonstrated:**
15951610

1596-
- ✅ Strict error handling (`set -eEuo pipefail`)
1611+
- ✅ Strict error handling (`set -euo pipefail`)
15971612
- ✅ Lock file for concurrency control
15981613
- ✅ Dependency checking
15991614
- ✅ Input validation

0 commit comments

Comments
 (0)