Skip to content

Commit b8d7fc2

Browse files
authored
Merge pull request #45 from lwalden/chore/aiagentminder-setup
chore: initialize AIAgentMinder v2.1.0
2 parents 0ee3876 + 7bfb040 commit b8d7fc2

17 files changed

Lines changed: 483 additions & 75 deletions

.claude/aiagentminder-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1→1.3.0
1+
2.1.0

.claude/commands/aam-checkup.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,41 @@ Read `.claude/aiagentminder-version`.
5858
- **INFO:** Show installed version (e.g., "v1.0.0")
5959
- **WARN if missing:** "No version stamp found. Run /aam-update to write one."
6060

61-
### 7. Git Status
61+
### 7. PR Pipeline (conditional)
62+
63+
Run this check only if `.claude/commands/aam-pr-pipeline.md` OR `.claude/hooks/pr-pipeline-trigger.js` exists in the project — indicating the pipeline was installed.
64+
65+
**7a. Hook script:**
66+
67+
Check that `.claude/hooks/pr-pipeline-trigger.js` exists.
68+
69+
- **PASS:** Found
70+
- **FAIL:** Missing — "PR pipeline command is installed but hook script is missing. Run /aam-update to restore it."
71+
72+
**7b. Hook configuration:**
73+
74+
Read `.claude/settings.json` and check for a `PostToolUse` entry with `matcher: "Bash"` referencing `pr-pipeline-trigger.js`.
75+
76+
- **PASS:** Entry found
77+
- **WARN:** Missing — "PostToolUse hook entry not in settings.json — the pipeline will not auto-trigger after `gh pr create`. Run /aam-update to restore it."
78+
79+
**7c. Config file:**
80+
81+
Check that `.pr-pipeline.json` exists at the project root.
82+
83+
- **PASS:** Found
84+
- **WARN:** Missing — "`.pr-pipeline.json` not found — pipeline will use default settings. Copy it from the AIAgentMinder template or run /aam-update."
85+
86+
**7d. `gh` CLI:**
87+
88+
```bash
89+
gh --version
90+
```
91+
92+
- **PASS:** Found — show version
93+
- **WARN:** Not found — "`gh` CLI not installed. The PR pipeline requires it. Install from https://cli.github.com."
94+
95+
### 8. Git Status
6296

6397
Check git status in the project directory:
6498

@@ -85,6 +119,11 @@ AIAgentMinder Health Check — v{version}
85119
✓ .claude/settings.json: valid JSON, hook entry present (compact-reorient)
86120
✓ .claude/hooks/compact-reorient.js: found
87121
✓ Git: branch main, remote origin configured
122+
[if PR pipeline installed:]
123+
✓ .claude/hooks/pr-pipeline-trigger.js: found
124+
✓ .claude/settings.json: PostToolUse:Bash hook entry present
125+
✓ .pr-pipeline.json: found
126+
✓ gh CLI: v2.45.0
88127
89128
Status: Healthy (1 warning)
90129
```

.claude/commands/aam-grill.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# /aam-grill - Plan Interrogation
2+
3+
Stress-test a plan or design by walking every branch of the decision tree. This is the intensive counterpart to `approach-first.md` — use it when a design is non-obvious, high-stakes, or involves multiple interdependent decisions.
4+
5+
---
6+
7+
## Step 1: Scope the Interrogation
8+
9+
Read the plan or design being questioned. Sources may include:
10+
11+
- An approach statement from `approach-first.md`
12+
- A feature description from `docs/strategy-roadmap.md`
13+
- A freeform plan the user describes
14+
- An existing design doc or PR description
15+
16+
Also read:
17+
18+
- `DECISIONS.md` — for prior decisions that constrain the design space
19+
- `docs/strategy-roadmap.md` — for quality tier and scope context
20+
21+
---
22+
23+
## Step 2: Map the Decision Tree
24+
25+
Identify every decision branch in the plan — any point where two or more reasonable approaches exist. Present the branches as a numbered list, noting dependencies between them.
26+
27+
Example:
28+
29+
> Decision branches identified:
30+
> 1. Auth storage: session vs JWT
31+
> 2. Rate limiting: middleware vs API gateway (depends on #1)
32+
> 3. Error format: structured vs freeform
33+
34+
---
35+
36+
## Step 3: Walk Each Branch
37+
38+
For each decision branch, one at a time:
39+
40+
1. **If the codebase can answer it** — explore the code first. Check existing patterns, conventions, and constraints. Do not ask the user questions that the code can answer.
41+
2. **If the user needs to decide** — present:
42+
- The options available
43+
- Tradeoffs of each
44+
- Reversal cost: **High** (hard to undo), **Medium** (costly but possible), or **Low** (easy to change later)
45+
- Downstream dependencies: "If you choose X, then Y becomes constrained"
46+
47+
Resolve one branch before moving to the next. If branches have dependencies, resolve the upstream branch first.
48+
49+
**Continue until the user says they are satisfied or all branches are resolved.**
50+
51+
---
52+
53+
## Step 4: Decision Summary
54+
55+
After all branches are resolved, produce a structured summary:
56+
57+
```
58+
Grill Summary — {plan name}
59+
60+
Decisions made:
61+
1. {topic}: {choice}. Alternatives: {what was considered}. Reversal cost: {H/M/L}. Rationale: {why}.
62+
2. ...
63+
64+
Open questions (deferred):
65+
- {question} — deferred because {reason}
66+
67+
Constraints discovered:
68+
- {constraint found during codebase exploration}
69+
```
70+
71+
Ask the user: "Log these decisions to DECISIONS.md? (y/n)"
72+
73+
If yes, append each decision to DECISIONS.md in the project's existing format, including alternatives considered.
74+
75+
---
76+
77+
## When to Use This
78+
79+
- **Use `/aam-grill`** when a design is non-obvious, high-stakes, or has multiple interdependent decisions.
80+
- **Use `approach-first.md`** for routine check-ins — state intent, confirm, proceed.
81+
- For Rigorous+ quality tiers, consider running `/aam-grill` before architecture changes touching more than 5 files.
82+
83+
---
84+
85+
*Adapted from [mattpocock/skills/grill-me](https://github.com/mattpocock/skills) (MIT license).*

.claude/commands/aam-milestone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Read the following:
1212

1313
1. `docs/strategy-roadmap.md` — current phase, MVP features, out-of-scope items, phase timeline
1414
2. `DECISIONS.md` — original stack and architecture decisions; also read the `## Known Debt` section if present
15-
3. `SPRINT.md` — current sprint status (if active); archived sprint lines for velocity data
15+
3. `SPRINT.md` — current sprint status (if active); archived sprint lines for sprint sizing data
1616
4. Use TaskList to get current task states
1717
5. Recent git log: `git log --oneline -20` — what has been merged recently
1818
6. File count and largest files:

.claude/commands/aam-retrospective.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,25 @@ Patterns:
6666

6767
Read prior archived sprint lines from `SPRINT.md` (lines starting with `S{n} archived`).
6868

69-
From each archived line, extract the velocity percentage (the `{velocity}%` value in the archive format).
69+
From each archived line and from the current sprint's metrics (Step 2), identify **stress indicators**:
70+
- **Scope churn**: any scope additions or removals occurred during the sprint
71+
- **Blocked issues**: any issues ended the sprint in `blocked` status
72+
- **Context pressure**: the sprint had 7+ planned issues
7073

7174
**Recommendation logic:**
7275

73-
- **Sprint 1 or 2 (insufficient data):** "Not enough sprint history for sizing recommendations yet."
74-
- **Sprint 3+:** Compute the median completion rate across available archived sprints.
75-
- Median ≥ 90%: "You're completing nearly everything planned. Consider planning {planned + 1} to {planned + 2} issues next sprint."
76-
- Median 70–89%: "Completion rate is healthy. Current sprint size of ~{planned} issues looks right."
77-
- Median 50–69%: "Consistently completing about {median%} of planned work. Consider planning {recommended range} issues rather than {planned}."
78-
- Median < 50%: "Sprint scope is regularly exceeding capacity. Recommend planning {recommended_max} issues or fewer next sprint."
76+
- **Sprint 1 (no history):** "First sprint — recommend 4–5 issues next sprint to establish a baseline. Fit whole features; avoid splitting a feature across sprints when it can fit in one."
77+
- **Sprint 2+:** Start from the previous sprint's planned issue count (or 5 if unavailable). Apply adjustments:
78+
- No stress indicators in the most recent sprint: hold steady. Do not increase.
79+
- 1 stress indicator in the most recent sprint: reduce max by 1.
80+
- 2+ stress indicators in the most recent sprint: reduce both min and max by 1.
81+
- Stress indicators present in 2+ of the last 3 sprints: reduce both min and max by 1 (cumulative with above).
7982

80-
Write the recommendation as the `<!-- sizing: {min}-{max} -->` comment in the SPRINT.md archive line (see sprint-workflow.md Sprint Completion). This comment persists for the next sprint planning step to read.
83+
**Hard boundaries:** The recommendation must fall within 3–7 issues. Clamp to this range after all adjustments. Never recommend more than 7 regardless of history.
84+
85+
**Feature coherence:** Always append: "Prefer fitting whole features over hitting an issue count. If a feature needs more issues than the range, plan the feature — but confirm with the user that context will stay manageable."
8186

82-
Only surface this when there is a pattern (2+ sprints in the same completion band). Do not speculate on a single data point.
87+
Write the recommendation as the `<!-- sizing: {min}-{max} -->` comment in the SPRINT.md archive line (see sprint-workflow.md Sprint Completion). This comment persists for the next sprint planning step to read.
8388

8489
---
8590

.claude/commands/aam-tdd.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# /aam-tdd - Test-Driven Development
2+
3+
Guided TDD workflow for implementing features through red-green-refactor cycles. This is the full methodology behind `code-quality.md`'s one-liner: "Write a failing test first. Implement the minimal solution. Refactor after green."
4+
5+
**Core principle:** Tests verify behavior through public interfaces, not implementation details. A good test survives internal refactors because it doesn't care about internal structure.
6+
7+
---
8+
9+
## Step 0: Read Context
10+
11+
Read `docs/strategy-roadmap.md` and find the **Quality Tier** section.
12+
13+
- **Standard tier and above:** TDD is the expected workflow. Proceed.
14+
- **Lightweight tier:** TDD is optional. Ask: "Quality tier is Lightweight — TDD is optional. Proceed with TDD anyway? (y/n)"
15+
16+
Also read `.claude/rules/code-quality.md` if it exists — the skill complements that rule, not replaces it.
17+
18+
---
19+
20+
## Step 1: Planning
21+
22+
Before writing any code:
23+
24+
1. **Read existing tests** in the project to learn the test framework, naming conventions, file organization, and assertion style. Match the project's patterns.
25+
2. **Identify the public interface** — what functions, endpoints, or APIs will callers use? Aim for a small interface with deep implementation (fewer methods, simpler parameters, complexity hidden inside).
26+
3. **List 3-7 behaviors to test** — describe what the system does, not how. Each behavior should be observable through the public interface.
27+
- Good: "returns 404 when user not found"
28+
- Bad: "calls findById with the user ID"
29+
4. **Design for testability** — accept dependencies as parameters instead of creating them internally. Return results instead of producing side effects. Keep the surface area small.
30+
5. **Present the test plan** to the user for approval.
31+
32+
You cannot test everything. Focus testing effort on critical paths and complex logic, not every edge case. Confirm priorities with the user.
33+
34+
---
35+
36+
## Step 2: Tracer Bullet
37+
38+
Write ONE test that confirms ONE thing about the system — the simplest vertical slice of the feature.
39+
40+
```
41+
RED: Write the test → it fails (confirms test infrastructure works)
42+
GREEN: Write minimal code to pass → it passes
43+
```
44+
45+
This is the tracer bullet — it proves the end-to-end path works and establishes the pattern for subsequent cycles.
46+
47+
**Vertical slices, not horizontal layers.** Your first test should touch the real entry point and produce a real result, even if simplified. Do not write all tests first then all implementation — that produces tests of imagined behavior.
48+
49+
---
50+
51+
## Step 3: Incremental Loop
52+
53+
For each remaining behavior from the test plan:
54+
55+
```
56+
RED: Write the next test → it fails
57+
GREEN: Write minimal code to pass → it passes
58+
```
59+
60+
Rules:
61+
- One test at a time
62+
- Only enough code to pass the current test
63+
- Do not anticipate future tests
64+
- Keep tests focused on observable behavior
65+
66+
**Mocking guidance:** Mock at system boundaries only — network calls, filesystem, clock, randomness. Do not mock your own modules or internal collaborators. Use dependency injection to swap external implementations in tests. Prefer specific mock functions per operation over a single generic mock.
67+
68+
**Test quality check per cycle:**
69+
- [ ] Test describes behavior, not implementation
70+
- [ ] Test uses the public interface only
71+
- [ ] Test would survive an internal refactor
72+
- [ ] Code is minimal for this test
73+
- [ ] No speculative features added
74+
75+
---
76+
77+
## Step 4: Refactor
78+
79+
All tests are green. Now look for refactor candidates:
80+
81+
- **Duplication** — extract shared logic into functions
82+
- **Long methods** — break into private helpers (keep tests on the public interface)
83+
- **Shallow modules** — if a module's interface is as complex as its implementation, combine or deepen it
84+
- **Feature envy** — logic that uses another module's data more than its own belongs in that other module
85+
- **Primitive obsession** — raw strings or numbers where a domain type would add clarity
86+
- **Existing code** the new code reveals as problematic
87+
88+
Run tests after each refactor step. Never refactor while RED — get to GREEN first.
89+
90+
---
91+
92+
## When to Use This
93+
94+
- **Use `/aam-tdd`** when starting a new feature or when the test plan is non-obvious.
95+
- **Use `code-quality.md`** (loaded automatically at Standard+ tiers) for day-to-day TDD discipline without the full structured workflow.
96+
- Pairs well with `/aam-triage` — triage produces a fix plan as RED-GREEN cycles that this skill can execute.
97+
98+
---
99+
100+
*Adapted from [mattpocock/skills/tdd](https://github.com/mattpocock/skills) (MIT license).*

.claude/commands/aam-triage.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# /aam-triage - Bug Triage
2+
3+
Systematically investigate a bug: reproduce it, diagnose the root cause, design a durable fix plan, and create a GitHub issue with the analysis. This is the structured start to debugging — complementing `debug-checkpoint.md` which handles the structured pause when a fix stalls.
4+
5+
---
6+
7+
## Step 1: Capture the Problem
8+
9+
Get a clear bug description from the user (or from the skill argument). Clarify:
10+
11+
- **Expected behavior** — what should happen?
12+
- **Actual behavior** — what happens instead?
13+
- **Steps to reproduce** — how to trigger the bug
14+
- **Error output** — error message, stack trace, or unexpected output
15+
16+
If any of these are unclear, ask before proceeding.
17+
18+
---
19+
20+
## Step 2: Explore and Diagnose
21+
22+
Use the Agent tool to spawn an exploration subagent (`subagent_type: "Explore"`). The subagent's job:
23+
24+
1. Trace the code path from the entry point (the user action or API call that triggers the bug) to the failure point.
25+
2. Read relevant source files, tests, and configuration — not the entire codebase.
26+
3. Report back:
27+
- The code path involved
28+
- Where the failure occurs
29+
- A root cause hypothesis
30+
31+
**Durability principle:** Describe the root cause in terms of behaviors and contracts, not line numbers or internal variable names. The diagnosis should remain useful even if the code is refactored.
32+
33+
---
34+
35+
## Step 3: Validate Root Cause
36+
37+
Attempt to confirm the root cause hypothesis:
38+
39+
- Run relevant tests to see if the failure is captured
40+
- Reproduce the bug if possible (run the failing path)
41+
- Check whether the hypothesis explains all symptoms
42+
43+
If the hypothesis doesn't hold after 2 iterations, trigger the `debug-checkpoint.md` pattern: stop and present a structured checkpoint to the user with what's been tried, the current hypothesis, and what information would unblock progress.
44+
45+
---
46+
47+
## Step 4: Design Fix Plan
48+
49+
Design the fix as a series of RED-GREEN test cycles:
50+
51+
1. **RED** — a failing test that captures the bug behavior ("When X happens, the system should Y but currently does Z")
52+
2. **GREEN** — the minimal code change to make the test pass
53+
54+
Write durable descriptions that target behaviors and contracts:
55+
- Good: "When an expired token is submitted, the system should return 401 and clear the session"
56+
- Bad: "Change line 47 in auth.js to check token.exp"
57+
58+
If the fix involves multiple behaviors, plan multiple RED-GREEN cycles.
59+
60+
---
61+
62+
## Step 5: Create GitHub Issue
63+
64+
Use `gh issue create` to create an issue with the analysis:
65+
66+
```
67+
Title: [Bug]: {concise description}
68+
69+
## Root Cause
70+
71+
{findings from Steps 2-3 — what causes the bug and why}
72+
73+
## Fix Plan
74+
75+
{RED-GREEN cycles from Step 4}
76+
77+
## Reproduction
78+
79+
{steps from Step 1}
80+
```
81+
82+
Add labels: `bug`, `triage`.
83+
84+
If `SPRINT.md` has an active sprint, note the sprint ID in the issue body under a **Sprint Context** heading.
85+
86+
---
87+
88+
## Step 6: Log Findings
89+
90+
If the root cause reveals a significant architectural insight (e.g., "auth middleware doesn't validate expired tokens", "error handling is inconsistent across API endpoints"), ask the user: "This finding may be worth recording in DECISIONS.md. Log it? (y/n)"
91+
92+
If yes, append to DECISIONS.md in the project's existing format.
93+
94+
---
95+
96+
## When to Use This
97+
98+
- **Use `/aam-triage`** when a bug needs structured investigation — not a quick fix, but root cause analysis.
99+
- **Use `debug-checkpoint.md`** (triggers automatically) when you're mid-fix and stuck after 3 attempts on the same error.
100+
- Created issues can be pulled into the next sprint via `/aam-sync-issues`.
101+
- Fix plans produce RED-GREEN cycles that `/aam-tdd` can execute.
102+
103+
---
104+
105+
*Adapted from [mattpocock/skills/triage-issue](https://github.com/mattpocock/skills) (MIT license).*

0 commit comments

Comments
 (0)