Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .claude/skills/aidlc/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: aidlc
description: >-
KeepItSimple intent/bolt workflow (light AI-DLC). Use whenever the user wants
to work on, implement, plan or pick up an issue or feature ("lavora sulla
#123", "implement issue 42", "new feature"): picks the depth, writes an
intent as a markdown-only PR, then delivers stacked bolt PRs. Overrides the
global `issue` skill for PR split, branch names, PR titles and where the plan
lives; everything else in `issue` (verify, review, cleanup) still applies.
---

# Intent / bolt workflow

Docs and templates: `aidlc-docs/` (read `aidlc-docs/README.md` once per session). App context: `aidlc-docs/baseline.md`.

## 0. Pick the depth first

| Task | Path |
|---|---|
| Bug or change under ~30 lines | No intent. One PR `fix/<issue>-<slug>`, normal `workflow` rules. Stop reading here. |
| Feature | Standard: steps 1 to 4. |
| New data, security impact or tricky logic | Deep: same, and fill **Design** in `intent.md`. |

When unsure, ask in the step 1 question round.

## 1. Understand and ask

Follow `issue` step 1 (memory, `gh issue view`, read the code, find test/build commands). Ask one `AskUserQuestion` round, multiple choice, recommendation first. Technical details you decide yourself and write down.

## 2. Write the intent (markdown only)

1. Worktree off `origin/main`: `git worktree add ../KeepItSimple-<issue> -b intent-<issue>/intent origin/main`. Tell the user the folder and branch. It is reused for every bolt (`git switch -c intent-<issue>/bolt-<k>`) and removed at the end.
2. Copy the templates to `aidlc-docs/intents/intent-<issue>-<slug>/` and fill `intent.md`, plus one `bolt-<k>.md` per bolt.
3. Bolts: backend first, then UI. Split further when a layer has two independent parts. A reviewer reads each in one sitting. Each bolt lists goal, "done when", files, tests, out of scope.
4. A **Sonnet** subagent reviews the intent against the real code (read-only): gaps, risks, test limits, ownership checks, migrations, stacking. Apply the fixes in the files.
5. Update the issue body in English: a short summary and a link to the intent folder. `gh issue edit <n> --body-file <file>`.
6. PR `Intent: <title> (#<issue>)`, base `main`, **only `aidlc-docs/` files**.

**Gate:** stop. The user reviews and approves the intent PR (a comment saying OK or a merge). Do not start a bolt before that.

## 3. Deliver the bolts

For each bolt, in order:

- Branch `intent-<issue>/bolt-<k>`. Base: the intent branch for bolt 1, the previous bolt branch after that.
- Implement and verify as in `issue` steps 5 and 6 (Haiku implement, verify subagent, UI design spec first, desktop and mobile screenshots for UI, Ponytail plus `code-review` before commit).
- In the same PR update `bolt-<k>.md`: Status `done`, PR link, **Outcome**, **Decisions**. The last bolt also sets the intent status to `done`.
- Open as a draft, `gh pr create --draft --base <previous branch>`. Title `Bolt <k>/<N>: <what> (#<issue>)`. Description: write it with the `clear-description` skill (it keeps "Things to check" and screenshots up to date), starting with "Bolt k of N of intent #<issue>, stacked on #…". Add "Out of scope" when the bolt leaves related work undone. The intent PR uses the same skill.

If a decision changes the plan, edit `intent.md` / the later `bolt-*.md` in the bolt that causes it and say so in its description.

## 4. When the base changes

Same as `issue` ("When a base changes"): when the intent PR merges, `gh pr edit <bolt-1> --base main`, then `git rebase --onto origin/main intent-<issue>/intent` and `git push --force-with-lease` (own branches only). Repeat for each later bolt, in order, onto the rebased previous bolt (`git rebase --onto intent-<issue>/bolt-<k-1> <old bolt k-1 sha>`). Regenerate EF migrations, never hand-merge them.

## 5. Finish

Report per PR: link, result of tests/build/browser, what was not covered. Delete test users, drop the isolated DB, stop servers, remove the worktree. Offer the deep check (`workflow` rule 2).
93 changes: 93 additions & 0 deletions .claude/skills/clear-description/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
name: clear-description
description: >-
Write clear, compact pull request descriptions with Mermaid diagrams, in a
fixed set of sections: purpose, what it touches, idea and implementation,
risks, things to check, screenshots. Also keeps the "Things to check" list
and the screenshots up to date in the PR as checks are done. Use whenever
opening a PR, rewriting a PR description, or after verifying a step of a PR
("update the PR description", "describe this PR").
---

# Clear PR description

Goal: a reviewer understands the PR in two minutes. English, short sentences, no filler. Diagrams over paragraphs. No AI attribution line (see `workflow` rule 1).

## Template

Keep these sections, in this order. Drop a section only where noted.

````markdown
## Purpose
<1-2 sentences: the problem and what this PR does about it. Link the issue/intent: "Bolt 2/3 of intent #67, stacked on #246".>

## What it touches
- `backend/...`: <one line>
- `frontend/...`: <one line>
- DB: <migration name, or "no schema change">
- Docs/config: <only if any>

## Idea and implementation
<The design in a few lines, then the diagram(s).>

```mermaid
flowchart LR
A["User clicks Export"] --> B["POST /api/reports"]
B --> C["ReportCalculator"]
C --> D["Report row (xlsx)"]
```

<Why this way, only if not obvious. Alternatives rejected in one line each.>

## Risks
- <What could break, who is affected, how to roll back. "None known" only if you checked.>

## Things to check
- [ ] <something not verified yet>
- [ ] <something not verified yet>

## Screenshots
<Drop this section when the PR has no visible change.>
````

## Rules per section

- **Purpose:** the why, not the file list. One issue link.
- **What it touches:** one bullet per area, path in backticks, a few words each. Mention migrations, new endpoints, new config.
- **Idea and implementation:**
- Pick the diagram that fits: `flowchart` for flow or architecture, `sequenceDiagram` for calls between parts over time, `erDiagram` for data model changes, `stateDiagram-v2` for status changes. One to three diagrams per PR, each with at most ~10 nodes.
- Label edges when the meaning is not obvious. Quote node text that has spaces or symbols: `A["POST /api/x (auth)"]`. Plain Mermaid, no custom styling, so it renders in light and dark mode.
- Under each diagram, at most 3 lines: the key decision and why. No line-by-line walkthrough.
- For a refactor, show before and after.
- **Risks:** concrete (data loss, wrong totals, breaking an API, slow query, migration order). Add the mitigation or rollback in the same bullet.
- **Things to check:** only what is **not yet checked**. Write what to check and how, so a reviewer can do it. Do not list things you have already verified here (they go in the PR's tested notes as a result, see below).

## Keep "Things to check" up to date

The list is live. Whenever you verify an item (test run, build, browser flow, review, manual check):

1. Read the current body (the `--attach` upload and the reviewer may have changed it): `gh pr view <n> --json body --jq .body > body.md` (use the scratchpad).
2. Edit only the list in `body.md`:
- passed: `- [x] <item>: <result in a few words>`
- failed: keep `- [ ]` and add `FAILED: <first error line>`
- new thing to check discovered: add `- [ ] ...`
3. Publish: `gh pr edit <n> --body-file body.md`.

Do this right after each verification step, not once at the end. When everything is checked, the list is all `[x]`; leave it in place as the record.

## Screenshots

- Only for visible changes. Real screens of the page, not a cropped component or a mock-up. Desktop (800 px viewport) and mobile (375 px preset). Hide dev overlays first (e.g. `nextjs-portal`).
- Save the files, then attach them to the PR:
```bash
gh pr edit <n> --attach './desktop.png#Desktop: <what it shows>' --attach './mobile.png#Mobile: <what it shows>'
```
Put `![Desktop: ...](./desktop.png)` in the body under "Screenshots"; `gh` rewrites it to the uploaded image. No screenshots branch.
- Re-attach after a visible change, and read the body first (step 1 above) so you do not overwrite edits.

## Checklist before publishing

1. Every section present, in order.
2. The diagram renders (check the PR page, not only the source).
3. Nothing in "Things to check" that you already verified.
4. Body is English and has no attribution line.
12 changes: 12 additions & 0 deletions .claude/skills/workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,15 @@ and browser work out of it:
(a single command or page read), never for a full test/browser pass.
- Browser checks: `read_page`/`find`/`get_page_text` first, `browser_batch`
for multi-step flows, screenshots at `scale` ≤ 0.5 unless they go into a PR.

## 7. Features follow the intent/bolt workflow

For any issue or feature, load the `aidlc` skill: an intent PR (markdown only)
first, then stacked bolt PRs. Bugs and changes under ~30 lines skip it. It
overrides the global `issue` skill for PR split, branch names and PR titles.

## 8. PR descriptions use the `clear-description` skill

Every PR description (new or edited) follows the `clear-description` skill:
fixed sections, Mermaid diagrams, a live "Things to check" list, screenshots
attached with `gh pr edit --attach`.
58 changes: 58 additions & 0 deletions aidlc-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# AI-DLC in KeepItSimple

A light adaptation of the [AWS AI-DLC](https://github.com/awslabs/aidlc-workflows)
(AI-Driven Development Life Cycle). Adopted on 2026-11-17, in the middle of the project.
The working rules live in the `aidlc` skill (`.claude/skills/aidlc/SKILL.md`); this folder holds the documents.

## Vocabulary

| Term | Here it means |
|---|---|
| **Intent** | One GitHub issue: the goal and why. Written down in `intent.md`. |
| **Bolt** | A PR-sized slice of an intent, delivered in hours or days. Replaces "part k of N". |
| **Approval gate** | A point where work stops until the owner says OK. The intent PR is the first one. |
| **Baseline** | [`baseline.md`](baseline.md): what the app already is. Replaces a full retro-documentation. |

## Layout

```
aidlc-docs/
README.md
baseline.md
intents/
_template/ intent.md, bolt.md
intent-<issue>-<slug>/
intent.md
bolt-1.md ... bolt-n.md
```

## Branches and PRs

```
main
└─ intent-67/intent "Intent: <title> (#67)" markdown only
└─ intent-67/bolt-1 "Bolt 1/3: <what> (#67)" draft
└─ intent-67/bolt-2 ... draft, base = previous bolt
```

- All branches of an intent live under `intent-<issue>/` (a branch `intent-67` would block `intent-67/bolt-1`).
- **Intent PR:** only files under `aidlc-docs/`. Reviewing and approving it is the requirements gate.
- **Bolt PRs:** code, tests, and an update of their own `bolt-k.md` (status, outcome, decisions). Open them as drafts. They start only after the intent is approved.
- When the intent PR merges, retarget bolt 1 to `main` and rebase the stack (see the `issue` skill, "When a base changes").
- The last bolt also sets the intent status to `done`. No extra markdown-only PR.

## Depth adapts to the task

| Task | What to do |
|---|---|
| Bug or change under ~30 lines | No AI-DLC files. One PR, `fix/<issue>-<slug>`. |
| Feature | Intent PR, then bolts. |
| Feature with new data, security impact or tricky logic | Same, and fill the **Design** section of `intent.md`. |

Skipped on purpose: AWS Operations phase, `aidlc-state.md` (state lives in PRs), `audit.md` (decisions live in `intent.md` and the bolts), team "mob" sessions.

## Past work

Nothing is backfilled. Closed issues and git history stay the record before 2026-11-17.
Work already in flight keeps its old `feature/<issue>-<slug>` stack until it merges. When a task touches
an area, add what you learn to `baseline.md` instead of documenting everything up front.
Loading
Loading