cleargate 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MANIFEST.json +5 -5
- package/dist/cli.cjs +119 -132
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +119 -132
- package/dist/cli.js.map +1 -1
- package/dist/templates/cleargate-planning/.claude/agents/reporter.md +15 -0
- package/dist/templates/cleargate-planning/.claude/skills/flashcard/SKILL.md +31 -12
- package/dist/templates/cleargate-planning/.cleargate/FLASHCARD.md +2 -1
- package/dist/templates/cleargate-planning/.cleargate/templates/story.md +10 -0
- package/dist/templates/cleargate-planning/CLAUDE.md +1 -0
- package/dist/templates/cleargate-planning/MANIFEST.json +5 -5
- package/package.json +1 -1
- package/templates/cleargate-planning/.claude/agents/reporter.md +15 -0
- package/templates/cleargate-planning/.claude/skills/flashcard/SKILL.md +31 -12
- package/templates/cleargate-planning/.cleargate/FLASHCARD.md +2 -1
- package/templates/cleargate-planning/.cleargate/templates/story.md +10 -0
- package/templates/cleargate-planning/CLAUDE.md +1 -0
- package/templates/cleargate-planning/MANIFEST.json +5 -5
|
@@ -29,6 +29,12 @@ Produce one file: `.cleargate/sprint-runs/<sprint-id>/REPORT.md`. It must serve
|
|
|
29
29
|
3. **Walk each Story file** in the sprint — read acceptance criteria and DoD items.
|
|
30
30
|
4. **Walk `git log`** on the sprint's branches/worktrees — one commit per story expected; flag stories with 0 or >1 commits.
|
|
31
31
|
5. **Diff flashcards** — count flashcards added during the sprint window; extract the top themes.
|
|
32
|
+
5b. **Flashcard audit (cleanup pass).** For each card in `.cleargate/FLASHCARD.md` without a status marker (`[S]` or `[R]` — see flashcard SKILL.md Rule 7), extract concrete referenced symbols from the lesson body:
|
|
33
|
+
- file paths (regex: `\S+\.(ts|md|sh|py|sql|json|yaml|toml)`)
|
|
34
|
+
- identifier candidates (CamelCase ≥4 chars OR `snake_case_with_≥2_underscores`)
|
|
35
|
+
- CLI flags (regex: `--[a-z][a-z0-9-]+`)
|
|
36
|
+
- env-var candidates (regex: `[A-Z][A-Z0-9_]{3,}`)
|
|
37
|
+
For each extracted symbol, `Grep` the repo (excluding `.cleargate/FLASHCARD.md` itself and sprint-runs/*). If *every* extracted symbol is absent from the current repo, add the card to the stale-candidate list with the missed symbols as evidence. If a card has zero extractable symbols, skip it (unflaggable — leave active). Do NOT modify FLASHCARD.md. Output belongs in the report under "Flashcard audit"; a human approves the batch and applies markers separately.
|
|
32
38
|
6. **Synthesize** the report in this structure:
|
|
33
39
|
|
|
34
40
|
```markdown
|
|
@@ -86,6 +92,15 @@ For each shipped story, one compact block:
|
|
|
86
92
|
### What the loop got wrong
|
|
87
93
|
3-5 bullets — blockers, repeated mistakes, plan misses, QA kickback patterns. Each bullet points at a **concrete loop improvement** (flashcard, agent-definition tweak, hook adjustment, sprint-plan template change).
|
|
88
94
|
|
|
95
|
+
### Flashcard audit
|
|
96
|
+
Candidates for `[S]` (stale) marker — referenced symbols no longer present in the repo. Human approves the batch before markers are applied.
|
|
97
|
+
|
|
98
|
+
| Card (date · lead-tag · lesson head) | Evidence (symbols not found) | Proposed marker |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| 2026-02-15 · #tsup · tsup single-bundle... | `tsup.config.ts`, `--bundle` | `[S]` |
|
|
101
|
+
|
|
102
|
+
If zero candidates: state "No stale flashcards detected." If there are candidate supersede pairs (a newer card whose lesson directly contradicts an older card's advice), list them under a "Supersede candidates" sub-table with the proposed `[R] → superseded-by <short-ref>` marker for the older card.
|
|
103
|
+
|
|
89
104
|
### Open follow-ups
|
|
90
105
|
Things deliberately deferred, with target sprint.
|
|
91
106
|
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flashcard
|
|
3
|
-
description: Append-only project lesson log at .cleargate/FLASHCARD.md. Use BEFORE starting non-trivial work to read past gotchas ("check" mode). Use WHEN you hit a surprise,
|
|
3
|
+
description: Append-only project lesson log at .cleargate/FLASHCARD.md. Use BEFORE starting non-trivial work to read past gotchas ("check" mode). Use WHEN you (a) hit a surprise, (b) found the winning path after a non-trivial task succeeded, or (c) were corrected by the user — record a one-liner for future agents ("record: <text>" mode). One-liners only; tag with #schema/#auth/#test-harness/etc. Also triggers on phrases: "turns out", "unexpected", "gotcha", "wasted time on", "starting work on", "before implementing", "user pushed back", "prefer X over Y", "winning path", "after several attempts", "the recipe that worked".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flashcard — Project Lesson Log
|
|
7
7
|
|
|
8
8
|
Append-only one-liner log of non-obvious gotchas that future agents in this project should know. Lives at `.cleargate/FLASHCARD.md` in the project root. Not a general wiki — only things that surprised us and would surprise someone else.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Modes
|
|
11
11
|
|
|
12
12
|
### `check` — read before work
|
|
13
|
-
Read `.cleargate/FLASHCARD.md`. Scan for tags relevant to your
|
|
13
|
+
Read `.cleargate/FLASHCARD.md`. Apply the Rule 8 filter: skip cards marked `[S]` (stale) or `[R]` (resolved) unless your current task directly matches a tag in a superseded card. Scan active cards for tags relevant to your task (grep by `#schema`, `#auth`, etc.). If unsure whether a card applies, err on applying it — reading 20 one-liners is cheap.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
Use `check-all` instead when investigating history or debugging a recurring issue — it includes `[S]` and `[R]` cards.
|
|
16
|
+
|
|
17
|
+
### `record: <text>` — three trigger classes, same format
|
|
18
|
+
Append a single line to `.cleargate/FLASHCARD.md`. Same 120-char cap regardless of trigger:
|
|
19
|
+
|
|
20
|
+
1. **Surprise** — something bit us. Lead with the surprise, not the context.
|
|
21
|
+
2. **Recipe** — the winning path after a non-trivial task succeeded (roughly 5+ tool calls, or one clear dead-end recovery). Lead with the *action that worked*, not the failures traversed. Tag `#recipe` alongside the domain tag.
|
|
22
|
+
3. **Correction** — the user pushed back on an approach. Capture the rule, not the exchange. Prefer the shape "prefer X over Y because Z". Tag `#correction` alongside the domain tag.
|
|
23
|
+
|
|
24
|
+
Format (unchanged):
|
|
17
25
|
|
|
18
26
|
```
|
|
19
27
|
YYYY-MM-DD · #tag1 #tag2 · <lesson ≤ 120 chars>
|
|
20
28
|
```
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
Examples:
|
|
23
31
|
```
|
|
24
32
|
2026-04-18 · #redis #auth · Invite tokens in Redis-only vanish on eviction — use Postgres invites table as source of truth.
|
|
33
|
+
2026-04-19 · #recipe #wiki · For wiki drift detection, git SHA beats content hash — drops the metadata-lifecycle dependency.
|
|
34
|
+
2026-04-19 · #correction #planning · Prefer two L1/L2 stories over one L3 at epic-decomposition (user: splits are free pre-push).
|
|
25
35
|
```
|
|
26
36
|
|
|
27
37
|
### Tag vocabulary (append new tags freely, but prefer these)
|
|
@@ -46,14 +56,21 @@ Example:
|
|
|
46
56
|
3. **Lead with the surprise, not the context.** Good: "Drizzle 0.45 silently drops `DEFAULT gen_random_uuid()` — use `sql` template." Bad: "When working on schema migrations yesterday we found that sometimes…"
|
|
47
57
|
4. **Lessons, not events.** "Shipped STORY-004-07 today" is NOT a flashcard. "Postgres 18 needs `pgcrypto` extension for gen_random_uuid — not enabled by default in official docker image" IS.
|
|
48
58
|
5. **Ordered newest-first after the header** — new entries go at the TOP of the log section, not bottom. Readers scan the top; old stuff drifts down.
|
|
49
|
-
6. **Never delete.** Edit to add reconfirmations or
|
|
59
|
+
6. **Never delete.** Edit to add reconfirmations, supersede pointers, or status markers (Rule 7); keep the original text. History is the point.
|
|
60
|
+
7. **Status markers for cleanup.** A card may carry a status marker placed *immediately after the second `·`* and before the lesson body:
|
|
61
|
+
- no marker → active (default; the vast majority of cards).
|
|
62
|
+
- `[S]` → stale. The symbol the card references no longer exists in the repo.
|
|
63
|
+
- `[R] → superseded-by <short-ref>` → resolved or replaced by a later card / shipped fix. `<short-ref>` is a date+tag (e.g. `2026-04-19/#hooks-sentinel`) or a STORY/CR ID.
|
|
64
|
+
Markers are additive — the original lesson text is preserved. The reporter agent flags candidates at sprint end; a human approves the batch before markers are applied (see `.claude/agents/reporter.md` → "Flashcard audit").
|
|
65
|
+
8. **Check-mode filter.** `check` reads active cards only (no marker). Include `[S]` / `[R]` cards only when: (a) their tags directly match the current task area, or (b) the invocation is `check-all` (explicit history read). This keeps `check` signal-dense without losing the historical record.
|
|
50
66
|
|
|
51
67
|
## Invocation contract
|
|
52
68
|
|
|
53
69
|
When an agent invokes this skill:
|
|
54
70
|
|
|
55
|
-
- **`Skill(flashcard, "check")`** — open `.cleargate/FLASHCARD.md`,
|
|
56
|
-
- **`Skill(flashcard, "
|
|
71
|
+
- **`Skill(flashcard, "check")`** — open `.cleargate/FLASHCARD.md`, apply the Rule 8 filter, summarize matching active cards in one line per card. If none apply, respond "no relevant flashcards" and proceed.
|
|
72
|
+
- **`Skill(flashcard, "check-all")`** — same as `check` but includes `[S]` / `[R]` cards. Use when investigating history, debugging a recurring issue, or tracing a supersede chain.
|
|
73
|
+
- **`Skill(flashcard, "record: <text>")`** — parse the text for date + tags + body. If date missing, insert today's UTC date. If tags missing, refuse with "add at least one tag." For recipe-class entries include `#recipe`; for correction-class entries include `#correction`. Grep for duplicates; if dup, reconfirm the existing line instead of appending. Append to the top of the log section in the file.
|
|
57
74
|
|
|
58
75
|
## File shape
|
|
59
76
|
|
|
@@ -63,11 +80,13 @@ When an agent invokes this skill:
|
|
|
63
80
|
# ClearGate Flashcards
|
|
64
81
|
|
|
65
82
|
One-liner gotcha log. Newest first. Grep by tag (e.g. `grep '#schema'`).
|
|
66
|
-
|
|
83
|
+
Active cards have no marker; `[S]` = stale, `[R]` = resolved (see SKILL.md Rule 7).
|
|
84
|
+
Format: `YYYY-MM-DD · #tags · [marker]? lesson`
|
|
67
85
|
|
|
68
86
|
---
|
|
69
87
|
|
|
70
|
-
2026-04-
|
|
71
|
-
2026-04-17 · #schema ·
|
|
88
|
+
2026-04-19 · #redis #auth · <newest active lesson>
|
|
89
|
+
2026-04-17 · #schema · [S] drizzle-kit v0.42 silently drops indexes — fixed in v0.45 upgrade.
|
|
90
|
+
2026-04-15 · #hooks · [R] → superseded-by 2026-04-19/#hooks-sentinel · SubagentStop fires on orchestrator not subagents.
|
|
72
91
|
...
|
|
73
92
|
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# ClearGate Flashcards
|
|
2
2
|
|
|
3
3
|
One-liner gotcha log. Newest first. Grep by tag (e.g. `grep '#schema'`).
|
|
4
|
-
|
|
4
|
+
Active cards have no marker; `[S]` = stale, `[R]` = resolved (see `.claude/skills/flashcard/SKILL.md` Rules 7–8).
|
|
5
|
+
Format: `YYYY-MM-DD · #tags · [marker]? lesson`
|
|
5
6
|
|
|
6
7
|
---
|
|
@@ -15,6 +15,16 @@ L2: Standard — 2-3 files, known pattern, ~2-4hr (default)
|
|
|
15
15
|
L3: Complex — Cross-cutting, spike may be needed, ~1-2 days
|
|
16
16
|
L4: Uncertain — Requires probing/spiking, >2 days
|
|
17
17
|
|
|
18
|
+
Granularity Rubric (run this check BEFORE emitting a story during epic-decomposition):
|
|
19
|
+
A candidate story is too big — emit two stories instead, with consecutive IDs (e.g. STORY-007-03 and STORY-007-04, never 03a/03b) — if ANY signal trips:
|
|
20
|
+
• §1.2 Detailed Requirements joins unrelated user goals with "and also" / "additionally".
|
|
21
|
+
• §2.1 Gherkin would need >5 scenarios covering unrelated behaviors.
|
|
22
|
+
• §3.1 Files-to-touch span unrelated subsystems (e.g. API + UI + migration in one story).
|
|
23
|
+
• Complexity would land at L4 (>2 days). L4 is a planning smell — split, or carve out a spike as its own story.
|
|
24
|
+
Also split the inverse: two candidate stories that each touch the same 1-2 files with overlapping scenarios should merge into one L1/L2.
|
|
25
|
+
At epic-decomposition time there are no remote IDs yet — splits and merges are free. Prefer two focused L1/L2 stories over one L3. Prefer L3 over L4.
|
|
26
|
+
When the rubric is ambiguous, surface the decision to the human as a one-liner ("candidate covers A+B — split into X and Y?") rather than guessing.
|
|
27
|
+
|
|
18
28
|
Do NOT output these instructions.
|
|
19
29
|
</instructions>
|
|
20
30
|
|
|
@@ -24,6 +24,7 @@ This repository uses **ClearGate** — a standalone planning framework for AI co
|
|
|
24
24
|
- Use the templates in `.cleargate/templates/` (`proposal.md`, `epic.md`, `story.md`, `CR.md`, `Bug.md`, `Sprint Plan Template.md`, `initiative.md`).
|
|
25
25
|
- Save drafts to `.cleargate/delivery/pending-sync/{TYPE}-{ID}-{Name}.md`.
|
|
26
26
|
- After `cleargate_push_item` returns a Remote ID, update the frontmatter AND move the file to `.cleargate/delivery/archive/` — these two happen atomically, never one without the other.
|
|
27
|
+
- **Story granularity.** When decomposing an epic into stories, run the Granularity Rubric at the top of `story.md`. If a candidate story trips any signal (unrelated goals joined, >5 Gherkin scenarios, subsystems span, L4 complexity), emit two stories with consecutive IDs instead. Splits and merges are free at decomposition time — no remote IDs exist yet.
|
|
27
28
|
|
|
28
29
|
**Four-agent loop (roles in `.claude/agents/`):**
|
|
29
30
|
- `architect.md` — one plan per milestone; no production code.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cleargate_version": "0.2.
|
|
3
|
-
"generated_at": "2026-04-
|
|
2
|
+
"cleargate_version": "0.2.1",
|
|
3
|
+
"generated_at": "2026-04-19T18:33:06.178Z",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": ".claude/agents/architect.md",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"path": ".claude/agents/reporter.md",
|
|
49
|
-
"sha256": "
|
|
49
|
+
"sha256": "a9b7e248fd1baaef7fb0c23d4ba92bc94bcd46e9261a6dabbd183477fab96359",
|
|
50
50
|
"tier": "agent",
|
|
51
51
|
"overwrite_policy": "always",
|
|
52
52
|
"preserve_on_uninstall": false
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"path": ".claude/skills/flashcard/SKILL.md",
|
|
84
|
-
"sha256": "
|
|
84
|
+
"sha256": "4c0fe5bb74697e1eb1f37203ff44b8e6a800f024a2f8c3fc8542aa206cd2c777",
|
|
85
85
|
"tier": "skill",
|
|
86
86
|
"overwrite_policy": "always",
|
|
87
87
|
"preserve_on_uninstall": false
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"path": ".cleargate/templates/story.md",
|
|
154
|
-
"sha256": "
|
|
154
|
+
"sha256": "6c32fcabc9332cb928ac3b8fbfe618751b0a4cb05cd0f16463c3c4e22f8a67f1",
|
|
155
155
|
"tier": "template",
|
|
156
156
|
"overwrite_policy": "merge-3way",
|
|
157
157
|
"preserve_on_uninstall": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cleargate",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Planning framework for Claude Code agents — sprint/epic/story protocol, four-agent loop (architect/developer/qa/reporter), Karpathy-style awareness wiki.",
|
|
@@ -29,6 +29,12 @@ Produce one file: `.cleargate/sprint-runs/<sprint-id>/REPORT.md`. It must serve
|
|
|
29
29
|
3. **Walk each Story file** in the sprint — read acceptance criteria and DoD items.
|
|
30
30
|
4. **Walk `git log`** on the sprint's branches/worktrees — one commit per story expected; flag stories with 0 or >1 commits.
|
|
31
31
|
5. **Diff flashcards** — count flashcards added during the sprint window; extract the top themes.
|
|
32
|
+
5b. **Flashcard audit (cleanup pass).** For each card in `.cleargate/FLASHCARD.md` without a status marker (`[S]` or `[R]` — see flashcard SKILL.md Rule 7), extract concrete referenced symbols from the lesson body:
|
|
33
|
+
- file paths (regex: `\S+\.(ts|md|sh|py|sql|json|yaml|toml)`)
|
|
34
|
+
- identifier candidates (CamelCase ≥4 chars OR `snake_case_with_≥2_underscores`)
|
|
35
|
+
- CLI flags (regex: `--[a-z][a-z0-9-]+`)
|
|
36
|
+
- env-var candidates (regex: `[A-Z][A-Z0-9_]{3,}`)
|
|
37
|
+
For each extracted symbol, `Grep` the repo (excluding `.cleargate/FLASHCARD.md` itself and sprint-runs/*). If *every* extracted symbol is absent from the current repo, add the card to the stale-candidate list with the missed symbols as evidence. If a card has zero extractable symbols, skip it (unflaggable — leave active). Do NOT modify FLASHCARD.md. Output belongs in the report under "Flashcard audit"; a human approves the batch and applies markers separately.
|
|
32
38
|
6. **Synthesize** the report in this structure:
|
|
33
39
|
|
|
34
40
|
```markdown
|
|
@@ -86,6 +92,15 @@ For each shipped story, one compact block:
|
|
|
86
92
|
### What the loop got wrong
|
|
87
93
|
3-5 bullets — blockers, repeated mistakes, plan misses, QA kickback patterns. Each bullet points at a **concrete loop improvement** (flashcard, agent-definition tweak, hook adjustment, sprint-plan template change).
|
|
88
94
|
|
|
95
|
+
### Flashcard audit
|
|
96
|
+
Candidates for `[S]` (stale) marker — referenced symbols no longer present in the repo. Human approves the batch before markers are applied.
|
|
97
|
+
|
|
98
|
+
| Card (date · lead-tag · lesson head) | Evidence (symbols not found) | Proposed marker |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| 2026-02-15 · #tsup · tsup single-bundle... | `tsup.config.ts`, `--bundle` | `[S]` |
|
|
101
|
+
|
|
102
|
+
If zero candidates: state "No stale flashcards detected." If there are candidate supersede pairs (a newer card whose lesson directly contradicts an older card's advice), list them under a "Supersede candidates" sub-table with the proposed `[R] → superseded-by <short-ref>` marker for the older card.
|
|
103
|
+
|
|
89
104
|
### Open follow-ups
|
|
90
105
|
Things deliberately deferred, with target sprint.
|
|
91
106
|
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flashcard
|
|
3
|
-
description: Append-only project lesson log at .cleargate/FLASHCARD.md. Use BEFORE starting non-trivial work to read past gotchas ("check" mode). Use WHEN you hit a surprise,
|
|
3
|
+
description: Append-only project lesson log at .cleargate/FLASHCARD.md. Use BEFORE starting non-trivial work to read past gotchas ("check" mode). Use WHEN you (a) hit a surprise, (b) found the winning path after a non-trivial task succeeded, or (c) were corrected by the user — record a one-liner for future agents ("record: <text>" mode). One-liners only; tag with #schema/#auth/#test-harness/etc. Also triggers on phrases: "turns out", "unexpected", "gotcha", "wasted time on", "starting work on", "before implementing", "user pushed back", "prefer X over Y", "winning path", "after several attempts", "the recipe that worked".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flashcard — Project Lesson Log
|
|
7
7
|
|
|
8
8
|
Append-only one-liner log of non-obvious gotchas that future agents in this project should know. Lives at `.cleargate/FLASHCARD.md` in the project root. Not a general wiki — only things that surprised us and would surprise someone else.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Modes
|
|
11
11
|
|
|
12
12
|
### `check` — read before work
|
|
13
|
-
Read `.cleargate/FLASHCARD.md`. Scan for tags relevant to your
|
|
13
|
+
Read `.cleargate/FLASHCARD.md`. Apply the Rule 8 filter: skip cards marked `[S]` (stale) or `[R]` (resolved) unless your current task directly matches a tag in a superseded card. Scan active cards for tags relevant to your task (grep by `#schema`, `#auth`, etc.). If unsure whether a card applies, err on applying it — reading 20 one-liners is cheap.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
Use `check-all` instead when investigating history or debugging a recurring issue — it includes `[S]` and `[R]` cards.
|
|
16
|
+
|
|
17
|
+
### `record: <text>` — three trigger classes, same format
|
|
18
|
+
Append a single line to `.cleargate/FLASHCARD.md`. Same 120-char cap regardless of trigger:
|
|
19
|
+
|
|
20
|
+
1. **Surprise** — something bit us. Lead with the surprise, not the context.
|
|
21
|
+
2. **Recipe** — the winning path after a non-trivial task succeeded (roughly 5+ tool calls, or one clear dead-end recovery). Lead with the *action that worked*, not the failures traversed. Tag `#recipe` alongside the domain tag.
|
|
22
|
+
3. **Correction** — the user pushed back on an approach. Capture the rule, not the exchange. Prefer the shape "prefer X over Y because Z". Tag `#correction` alongside the domain tag.
|
|
23
|
+
|
|
24
|
+
Format (unchanged):
|
|
17
25
|
|
|
18
26
|
```
|
|
19
27
|
YYYY-MM-DD · #tag1 #tag2 · <lesson ≤ 120 chars>
|
|
20
28
|
```
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
Examples:
|
|
23
31
|
```
|
|
24
32
|
2026-04-18 · #redis #auth · Invite tokens in Redis-only vanish on eviction — use Postgres invites table as source of truth.
|
|
33
|
+
2026-04-19 · #recipe #wiki · For wiki drift detection, git SHA beats content hash — drops the metadata-lifecycle dependency.
|
|
34
|
+
2026-04-19 · #correction #planning · Prefer two L1/L2 stories over one L3 at epic-decomposition (user: splits are free pre-push).
|
|
25
35
|
```
|
|
26
36
|
|
|
27
37
|
### Tag vocabulary (append new tags freely, but prefer these)
|
|
@@ -46,14 +56,21 @@ Example:
|
|
|
46
56
|
3. **Lead with the surprise, not the context.** Good: "Drizzle 0.45 silently drops `DEFAULT gen_random_uuid()` — use `sql` template." Bad: "When working on schema migrations yesterday we found that sometimes…"
|
|
47
57
|
4. **Lessons, not events.** "Shipped STORY-004-07 today" is NOT a flashcard. "Postgres 18 needs `pgcrypto` extension for gen_random_uuid — not enabled by default in official docker image" IS.
|
|
48
58
|
5. **Ordered newest-first after the header** — new entries go at the TOP of the log section, not bottom. Readers scan the top; old stuff drifts down.
|
|
49
|
-
6. **Never delete.** Edit to add reconfirmations or
|
|
59
|
+
6. **Never delete.** Edit to add reconfirmations, supersede pointers, or status markers (Rule 7); keep the original text. History is the point.
|
|
60
|
+
7. **Status markers for cleanup.** A card may carry a status marker placed *immediately after the second `·`* and before the lesson body:
|
|
61
|
+
- no marker → active (default; the vast majority of cards).
|
|
62
|
+
- `[S]` → stale. The symbol the card references no longer exists in the repo.
|
|
63
|
+
- `[R] → superseded-by <short-ref>` → resolved or replaced by a later card / shipped fix. `<short-ref>` is a date+tag (e.g. `2026-04-19/#hooks-sentinel`) or a STORY/CR ID.
|
|
64
|
+
Markers are additive — the original lesson text is preserved. The reporter agent flags candidates at sprint end; a human approves the batch before markers are applied (see `.claude/agents/reporter.md` → "Flashcard audit").
|
|
65
|
+
8. **Check-mode filter.** `check` reads active cards only (no marker). Include `[S]` / `[R]` cards only when: (a) their tags directly match the current task area, or (b) the invocation is `check-all` (explicit history read). This keeps `check` signal-dense without losing the historical record.
|
|
50
66
|
|
|
51
67
|
## Invocation contract
|
|
52
68
|
|
|
53
69
|
When an agent invokes this skill:
|
|
54
70
|
|
|
55
|
-
- **`Skill(flashcard, "check")`** — open `.cleargate/FLASHCARD.md`,
|
|
56
|
-
- **`Skill(flashcard, "
|
|
71
|
+
- **`Skill(flashcard, "check")`** — open `.cleargate/FLASHCARD.md`, apply the Rule 8 filter, summarize matching active cards in one line per card. If none apply, respond "no relevant flashcards" and proceed.
|
|
72
|
+
- **`Skill(flashcard, "check-all")`** — same as `check` but includes `[S]` / `[R]` cards. Use when investigating history, debugging a recurring issue, or tracing a supersede chain.
|
|
73
|
+
- **`Skill(flashcard, "record: <text>")`** — parse the text for date + tags + body. If date missing, insert today's UTC date. If tags missing, refuse with "add at least one tag." For recipe-class entries include `#recipe`; for correction-class entries include `#correction`. Grep for duplicates; if dup, reconfirm the existing line instead of appending. Append to the top of the log section in the file.
|
|
57
74
|
|
|
58
75
|
## File shape
|
|
59
76
|
|
|
@@ -63,11 +80,13 @@ When an agent invokes this skill:
|
|
|
63
80
|
# ClearGate Flashcards
|
|
64
81
|
|
|
65
82
|
One-liner gotcha log. Newest first. Grep by tag (e.g. `grep '#schema'`).
|
|
66
|
-
|
|
83
|
+
Active cards have no marker; `[S]` = stale, `[R]` = resolved (see SKILL.md Rule 7).
|
|
84
|
+
Format: `YYYY-MM-DD · #tags · [marker]? lesson`
|
|
67
85
|
|
|
68
86
|
---
|
|
69
87
|
|
|
70
|
-
2026-04-
|
|
71
|
-
2026-04-17 · #schema ·
|
|
88
|
+
2026-04-19 · #redis #auth · <newest active lesson>
|
|
89
|
+
2026-04-17 · #schema · [S] drizzle-kit v0.42 silently drops indexes — fixed in v0.45 upgrade.
|
|
90
|
+
2026-04-15 · #hooks · [R] → superseded-by 2026-04-19/#hooks-sentinel · SubagentStop fires on orchestrator not subagents.
|
|
72
91
|
...
|
|
73
92
|
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# ClearGate Flashcards
|
|
2
2
|
|
|
3
3
|
One-liner gotcha log. Newest first. Grep by tag (e.g. `grep '#schema'`).
|
|
4
|
-
|
|
4
|
+
Active cards have no marker; `[S]` = stale, `[R]` = resolved (see `.claude/skills/flashcard/SKILL.md` Rules 7–8).
|
|
5
|
+
Format: `YYYY-MM-DD · #tags · [marker]? lesson`
|
|
5
6
|
|
|
6
7
|
---
|
|
@@ -15,6 +15,16 @@ L2: Standard — 2-3 files, known pattern, ~2-4hr (default)
|
|
|
15
15
|
L3: Complex — Cross-cutting, spike may be needed, ~1-2 days
|
|
16
16
|
L4: Uncertain — Requires probing/spiking, >2 days
|
|
17
17
|
|
|
18
|
+
Granularity Rubric (run this check BEFORE emitting a story during epic-decomposition):
|
|
19
|
+
A candidate story is too big — emit two stories instead, with consecutive IDs (e.g. STORY-007-03 and STORY-007-04, never 03a/03b) — if ANY signal trips:
|
|
20
|
+
• §1.2 Detailed Requirements joins unrelated user goals with "and also" / "additionally".
|
|
21
|
+
• §2.1 Gherkin would need >5 scenarios covering unrelated behaviors.
|
|
22
|
+
• §3.1 Files-to-touch span unrelated subsystems (e.g. API + UI + migration in one story).
|
|
23
|
+
• Complexity would land at L4 (>2 days). L4 is a planning smell — split, or carve out a spike as its own story.
|
|
24
|
+
Also split the inverse: two candidate stories that each touch the same 1-2 files with overlapping scenarios should merge into one L1/L2.
|
|
25
|
+
At epic-decomposition time there are no remote IDs yet — splits and merges are free. Prefer two focused L1/L2 stories over one L3. Prefer L3 over L4.
|
|
26
|
+
When the rubric is ambiguous, surface the decision to the human as a one-liner ("candidate covers A+B — split into X and Y?") rather than guessing.
|
|
27
|
+
|
|
18
28
|
Do NOT output these instructions.
|
|
19
29
|
</instructions>
|
|
20
30
|
|
|
@@ -24,6 +24,7 @@ This repository uses **ClearGate** — a standalone planning framework for AI co
|
|
|
24
24
|
- Use the templates in `.cleargate/templates/` (`proposal.md`, `epic.md`, `story.md`, `CR.md`, `Bug.md`, `Sprint Plan Template.md`, `initiative.md`).
|
|
25
25
|
- Save drafts to `.cleargate/delivery/pending-sync/{TYPE}-{ID}-{Name}.md`.
|
|
26
26
|
- After `cleargate_push_item` returns a Remote ID, update the frontmatter AND move the file to `.cleargate/delivery/archive/` — these two happen atomically, never one without the other.
|
|
27
|
+
- **Story granularity.** When decomposing an epic into stories, run the Granularity Rubric at the top of `story.md`. If a candidate story trips any signal (unrelated goals joined, >5 Gherkin scenarios, subsystems span, L4 complexity), emit two stories with consecutive IDs instead. Splits and merges are free at decomposition time — no remote IDs exist yet.
|
|
27
28
|
|
|
28
29
|
**Four-agent loop (roles in `.claude/agents/`):**
|
|
29
30
|
- `architect.md` — one plan per milestone; no production code.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cleargate_version": "0.2.
|
|
3
|
-
"generated_at": "2026-04-
|
|
2
|
+
"cleargate_version": "0.2.1",
|
|
3
|
+
"generated_at": "2026-04-19T18:33:06.178Z",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": ".claude/agents/architect.md",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"path": ".claude/agents/reporter.md",
|
|
49
|
-
"sha256": "
|
|
49
|
+
"sha256": "a9b7e248fd1baaef7fb0c23d4ba92bc94bcd46e9261a6dabbd183477fab96359",
|
|
50
50
|
"tier": "agent",
|
|
51
51
|
"overwrite_policy": "always",
|
|
52
52
|
"preserve_on_uninstall": false
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"path": ".claude/skills/flashcard/SKILL.md",
|
|
84
|
-
"sha256": "
|
|
84
|
+
"sha256": "4c0fe5bb74697e1eb1f37203ff44b8e6a800f024a2f8c3fc8542aa206cd2c777",
|
|
85
85
|
"tier": "skill",
|
|
86
86
|
"overwrite_policy": "always",
|
|
87
87
|
"preserve_on_uninstall": false
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"path": ".cleargate/templates/story.md",
|
|
154
|
-
"sha256": "
|
|
154
|
+
"sha256": "6c32fcabc9332cb928ac3b8fbfe618751b0a4cb05cd0f16463c3c4e22f8a67f1",
|
|
155
155
|
"tier": "template",
|
|
156
156
|
"overwrite_policy": "merge-3way",
|
|
157
157
|
"preserve_on_uninstall": false
|