Skip to content

Commit 396b3fc

Browse files
maebealeclaude
andauthored
Add ai/recap and ai/security shortcuts (#1570)
Give agents two more `ai/` entry points so common session tasks have a single, discoverable trigger instead of ad-hoc phrasing: - `ai/recap` — prints the "recap" trigger word; the agent then reviews the conversation and reports accomplishments + unresolved threads (per the new "Session recap" section). Explicitly NOT the /audit design skill. - `ai/security` — runs Brakeman + bundler-audit, mirroring the CI security scan, exiting non-zero if either fails. Documents both in ai/README.md and the AI instruction files (CLAUDE.md and the mirrored copilot-instructions.md). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e6ae55c commit 396b3fc

5 files changed

Lines changed: 103 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,52 @@ Follow the [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/introducti
189189
- Follow the red-green-refactor cycle: failing test, minimal fix, then refactor
190190
- Be careful with system/JS tests — avoid patterns that lead to flakiness
191191

192+
## Session recap
193+
194+
When the user says **"recap"**, **"ai recap"**, or runs **`ai/recap`**, review the full conversation and report two parts:
195+
196+
1. **Recap** — what was accomplished this session.
197+
2. **Unresolved** — dropped threads, unanswered questions, unfinished tasks, and unresolved disagreements (from either side).
198+
199+
This is an agent task — NOT the `/audit` skill (design/accessibility review, only on an explicit `/audit`) and NOT `ai/security` (the security scan). The `ai/recap` script only emits the trigger word; the agent does the work per this section.
200+
201+
**Format the Unresolved part as a bulleted list with a count header.**
202+
203+
If nothing is unresolved:
204+
```
205+
- Nothing unresolved
206+
- All tasks completed, questions answered, and threads closed
207+
```
208+
209+
If there are unresolved items:
210+
```
211+
- 3 unresolved items below
212+
- 1. Item title
213+
- Description of what's unresolved
214+
- 2. Item title
215+
- Description of what's unresolved
216+
- 3. Item title
217+
- Description of what's unresolved
218+
```
219+
220+
### After submitting a PR
221+
222+
After creating or submitting a pull request, automatically perform the session recap (Recap + Unresolved) using the format above.
223+
192224
## Quick Commands
193225

194226
See `ai/` directory for executable scripts:
195227

196228
| Command | What it does |
197229
|---|---|
230+
| `ai/recap` | Session recap: accomplishments + unresolved items (see above) |
198231
| `ai/test [args]` | Run RSpec |
199232
| `ai/lint` | Rubocop on all files |
200233
| `ai/lint --fix` | Auto-fix lint issues |
201234
| `ai/server` | Start dev services (web + vite) |
202235
| `ai/console` | Rails console |
203236
| `ai/routes -g pattern` | Search Rails routes |
204237
| `ai/db-migrate` | Run database migrations |
238+
| `ai/security` | Security scan: Brakeman + bundler-audit (mirrors CI) |
239+
240+
> **"ai <name>" means the `ai/` script of that name** (e.g. "ai test" → `ai/test`, "ai security" → `ai/security`) — shell scripts in `ai/`, not slash-command skills. If a referenced `ai/<name>` script doesn't exist, ask what's intended rather than substituting a similarly named skill. (`ai/recap` is special — it triggers the agent **Session recap** behavior above, not a real script's output; never confuse it with the `/audit` design skill or the `ai/security` scan.)

CLAUDE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,52 @@ Standard mise activation (`eval "$(mise activate <shell>)"` in your shell rc, pe
198198
- Follow the red-green-refactor cycle: failing test, minimal fix, then refactor
199199
- Be careful with system/JS tests — avoid patterns that lead to flakiness
200200

201+
## Session recap
202+
203+
When the user says **"recap"**, **"ai recap"**, or runs **`ai/recap`**, review the full conversation and report two parts:
204+
205+
1. **Recap** — what was accomplished this session.
206+
2. **Unresolved** — dropped threads, unanswered questions, unfinished tasks, and unresolved disagreements (from either side).
207+
208+
This is an agent task — NOT the `/audit` skill (design/accessibility review, only on an explicit `/audit`) and NOT `ai/security` (the security scan). The `ai/recap` script only emits the trigger word; the agent does the work per this section.
209+
210+
**Format the Unresolved part as a bulleted list with a count header.**
211+
212+
If nothing is unresolved:
213+
```
214+
- Nothing unresolved
215+
- All tasks completed, questions answered, and threads closed
216+
```
217+
218+
If there are unresolved items:
219+
```
220+
- 3 unresolved items below
221+
- 1. Item title
222+
- Description of what's unresolved
223+
- 2. Item title
224+
- Description of what's unresolved
225+
- 3. Item title
226+
- Description of what's unresolved
227+
```
228+
229+
### After submitting a PR
230+
231+
After creating or submitting a pull request, automatically perform the session recap (Recap + Unresolved) using the format above.
232+
201233
## Quick Commands
202234

203235
See `ai/` directory for executable scripts:
204236

205237
| Command | What it does |
206238
|---|---|
239+
| `ai/recap` | Session recap: accomplishments + unresolved items (see above) |
207240
| `ai/test [args]` | Run RSpec |
208241
| `ai/lint` | Rubocop on all files |
209242
| `ai/lint --fix` | Auto-fix lint issues |
210243
| `ai/server` | Start dev services (web + vite) |
211244
| `ai/console` | Rails console |
212245
| `ai/routes -g pattern` | Search Rails routes |
213246
| `ai/db-migrate` | Run database migrations |
247+
| `ai/security` | Security scan: Brakeman + bundler-audit (mirrors CI) |
248+
249+
> **"ai <name>" means the `ai/` script of that name** (e.g. "ai test" → `ai/test`, "ai security" → `ai/security`) — shell scripts in `ai/`, not slash-command skills. If a referenced `ai/<name>` script doesn't exist, ask what's intended rather than substituting a similarly named skill. (`ai/recap` is special — it triggers the agent **Session recap** behavior above, not a real script's output; never confuse it with the `/audit` design skill or the `ai/security` scan.)

ai/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ Quick-reference scripts for common development tasks. Designed for AI agents and
44

55
| Command | What it does |
66
|---|---|
7+
| `ai/recap` | Session recap: accomplishments + unresolved items (agent behavior; see below) |
78
| `ai/test [args]` | Run RSpec tests (`ai/test spec/models/user_spec.rb:42`) |
89
| `ai/lint` | Rubocop on all files |
910
| `ai/lint --fix` | Auto-fix lint issues |
1011
| `ai/server` | Start all dev services (web + vite) |
1112
| `ai/console` | Rails console |
1213
| `ai/routes -g pattern` | Search Rails routes |
1314
| `ai/db-migrate` | Run database migrations |
15+
| `ai/security` | Security scan: Brakeman + bundler-audit (mirrors CI) |
1416

1517
All scripts pass through extra arguments, so `ai/test --fail-fast` works as expected.
18+
19+
Only the commands listed above exist. "ai <name>" refers to one of these `ai/` scripts — not a slash-command skill. Two phrases are special:
20+
21+
- **"ai security"** runs `ai/security` (the security scan above).
22+
- **"ai recap"** (or `ai/recap`, which just prints the trigger word) tells the agent to review the conversation and report two parts: **Recap** (what was accomplished) and **Unresolved** (dropped threads, unanswered questions, unfinished tasks, and disagreements from either side). The agent performs it directly per `CLAUDE.md`. It is never the `/audit` design/accessibility skill.

ai/recap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Session recap: triggers the AI to review the conversation and report
3+
# (1) what was accomplished and (2) unresolved items — dropped threads,
4+
# unanswered questions, unfinished tasks, and disagreements from either side.
5+
# This script just prints the trigger word; the agent does the work per CLAUDE.md.
6+
# Not the /audit design skill, and not ai/security (the security scan).
7+
echo "recap"

ai/security

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
# Security scan: Brakeman (Rails static analysis) + bundler-audit (gem CVEs).
3+
# Mirrors the CI security scan. Unrelated to the /audit design/accessibility skill.
4+
# Runs both tools even if the first reports issues, and exits non-zero if either fails.
5+
set -uo pipefail
6+
source "$(dirname "$0")/.ruby-env"
7+
8+
status=0
9+
10+
echo "→ Brakeman — Rails security static analysis"
11+
bin/brakeman --no-pager || status=1
12+
13+
echo
14+
echo "→ bundler-audit — known CVEs in gems"
15+
bin/bundler-audit || status=1
16+
17+
exit $status

0 commit comments

Comments
 (0)