kracked-core 1.1.0 → 1.5.0

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.
@@ -0,0 +1,46 @@
1
+ # SDD — {{PROJECT_NAME}}
2
+
3
+ Spec-driven development artifacts. Run `/kracked-sdd` to work through the flow; these folders are
4
+ where it puts things.
5
+
6
+ ```
7
+ idea → spec → epic → stories → build → review
8
+ ```
9
+
10
+ | Folder | Holds | Written when |
11
+ |---|---|---|
12
+ | `specs/` | What to build and why | Start of any non-trivial job |
13
+ | `epics/` | A group of related stories | When a spec is too big for one story |
14
+ | `stories/` | One independently shippable slice | Broken out of a spec or epic |
15
+ | `architecture/` | How the system is put together | Large or risky work only |
16
+ | `tracker.md` | Status of every story + evidence | Continuously |
17
+
18
+ ## Naming
19
+
20
+ Numbers first so files sort in the order you built them.
21
+
22
+ ```
23
+ specs/login.md
24
+ epics/1-authentication.md
25
+ stories/1.1-email-login.md
26
+ stories/1.2-password-reset.md
27
+ architecture/data-model.md
28
+ architecture/decisions/0001-use-postgres.md
29
+ ```
30
+
31
+ Story IDs are `<epic>.<story>` and must match the ID in `tracker.md`. That's the link between a
32
+ story's detail and its status — if they drift, the tracker stops being trustworthy.
33
+
34
+ ## The two rules that matter
35
+
36
+ **1. Not everything needs the full flow.** A typo fix needs no spec. `/kracked-sdd` sizes the job
37
+ first and skips straight to the build when ceremony would be waste. Over-documenting small work is
38
+ the fastest way to abandon the system entirely.
39
+
40
+ **2. A story isn't `done` without evidence.** The tracker's Evidence column must say what was
41
+ actually verified — and what wasn't. "Tests pass" is not evidence of a working feature.
42
+
43
+ ## Commit these
44
+
45
+ These docs belong in git. They're how the next person — including you in three months, and your
46
+ agent on its next boot — finds out why the code looks the way it does.
File without changes
@@ -0,0 +1,51 @@
1
+ # Architecture — <area>
2
+
3
+ **Date:** {{DATE}}
4
+ **Status:** current | superseded by `<file>`
5
+
6
+ Write one of these only for work that's **large or risky** — new services, data model changes,
7
+ auth, anything touching money or user data. A small feature does not need an architecture doc,
8
+ and writing one anyway is how the system becomes ceremony people skip.
9
+
10
+ ## The shape
11
+
12
+ What the pieces are and how they talk to each other. A diagram in text is fine:
13
+
14
+ ```
15
+ browser → api route → service → database
16
+ ↘ queue → worker
17
+ ```
18
+
19
+ ## Data model
20
+
21
+ Tables/collections, key fields, and the relationships that matter. Not every column — the ones a
22
+ newcomer would get wrong.
23
+
24
+ | Entity | Key fields | Related to |
25
+ |---|---|---|
26
+ | | | |
27
+
28
+ ## Key decisions
29
+
30
+ The choices someone would otherwise re-litigate. Link to an ADR in `decisions/` for the big ones.
31
+
32
+ | Decision | Why | Alternative rejected |
33
+ |---|---|---|
34
+ | | | |
35
+
36
+ ## Failure modes
37
+
38
+ What breaks, and what happens when it does. Answer for each: does it fail loudly or silently?
39
+
40
+ | What fails | Effect | Handling |
41
+ |---|---|---|
42
+ | Database unreachable | | |
43
+ | Third-party API down | | |
44
+ | Duplicate/retried request | | |
45
+
46
+ ## What this does NOT do
47
+
48
+ Scope boundaries and deliberate limitations. Prevents someone assuming a capability that isn't
49
+ there.
50
+
51
+ - ...
@@ -0,0 +1,40 @@
1
+ # <NNNN> — <the decision, as a statement>
2
+
3
+ **Date:** {{DATE}}
4
+ **Status:** accepted | superseded by `<NNNN>` | reversed
5
+
6
+ > Example filename: `0001-use-postgres-not-mongo.md`
7
+ > Number them in order. Never renumber or delete one — a reversed decision is still history worth
8
+ > keeping, and the reasoning is often more valuable than the outcome.
9
+
10
+ ## Context
11
+
12
+ What forced a choice here? The constraints, the pressures, what was true at the time. Someone
13
+ reading this in six months has none of that context — this section is the whole point.
14
+
15
+ ## Decision
16
+
17
+ What was decided, stated plainly and in the present tense. "We use X." Not "we should" or
18
+ "we might."
19
+
20
+ ## Alternatives considered
21
+
22
+ | Option | Why not |
23
+ |---|---|
24
+ | | |
25
+
26
+ ## Consequences
27
+
28
+ Both directions — honest about the costs.
29
+
30
+ **Good:**
31
+ - ...
32
+
33
+ **Costs / things we now have to live with:**
34
+ - ...
35
+
36
+ ## Revisit if
37
+
38
+ The conditions that would make this decision wrong. If none, say "no expected trigger."
39
+
40
+ - ...
File without changes
@@ -0,0 +1,34 @@
1
+ # Epic <N> — <name>
2
+
3
+ **Spec:** `../specs/<name>.md`
4
+ **Status:** planning | in-progress | done
5
+ **Date:** {{DATE}}
6
+
7
+ ## Goal
8
+
9
+ What is true when this whole epic is finished? One or two sentences.
10
+
11
+ ## Stories
12
+
13
+ Every story must be **independently shippable** — mergeable on its own, leaving the app working.
14
+ If a story can't ship alone, split it.
15
+
16
+ | ID | Story | File |
17
+ |---|---|---|
18
+ | <N>.1 | | `../stories/<N>.1-<slug>.md` |
19
+ | <N>.2 | | `../stories/<N>.2-<slug>.md` |
20
+
21
+ Status lives in `../tracker.md`, not here. One source of truth — don't track status in two places
22
+ or they drift.
23
+
24
+ ## Order
25
+
26
+ Which stories block others, and why. If they're all independent, say so explicitly.
27
+
28
+ 1. ...
29
+
30
+ ## Out of scope
31
+
32
+ What belongs to a future epic, not this one.
33
+
34
+ - ...
@@ -0,0 +1,44 @@
1
+ # Spec — <name>
2
+
3
+ **Status:** draft | agreed | building | shipped
4
+ **Date:** {{DATE}}
5
+
6
+ ## What
7
+
8
+ One paragraph. What is being built, in plain language — no implementation detail.
9
+
10
+ ## Why
11
+
12
+ The problem this solves, and for whom. If you can't name who is worse off without it, the spec
13
+ isn't ready.
14
+
15
+ ## Acceptance criteria
16
+
17
+ Concrete and checkable. Someone else must be able to read these and tell whether the thing works.
18
+
19
+ - [ ] A user can ...
20
+ - [ ] When X happens, the system ...
21
+ - [ ] If the input is empty/invalid, it ...
22
+
23
+ ## Out of scope
24
+
25
+ **Not optional.** Scope creep starts exactly where this section is skipped. List what this spec
26
+ deliberately does NOT cover.
27
+
28
+ - ...
29
+
30
+ ## Edge cases
31
+
32
+ For every input involved, answer: what if it's empty, missing, or unexpected?
33
+
34
+ | Case | Expected behaviour |
35
+ |---|---|
36
+ | Empty input | |
37
+ | Already exists | |
38
+ | Not authorised | |
39
+
40
+ ## Open questions
41
+
42
+ Things that must be answered before or during the build. Delete this section once it's empty.
43
+
44
+ - [ ] ...
File without changes
@@ -0,0 +1,33 @@
1
+ # Story <N>.<M> — <name>
2
+
3
+ **Epic:** `../epics/<N>-<slug>.md`
4
+ **Status:** backlog | in-progress | review | done ← mirror this in `../tracker.md`
5
+ **Date:** {{DATE}}
6
+
7
+ ## What
8
+
9
+ One slice of the epic. Small enough to build and verify in one sitting.
10
+
11
+ ## Acceptance criteria
12
+
13
+ - [ ] ...
14
+ - [ ] ...
15
+
16
+ ## Notes for the build
17
+
18
+ Files likely to change, existing code to reuse, anything that would trip someone up.
19
+
20
+ > Verify these claims before building on them. A story written from memory can name a file,
21
+ > function, or column that doesn't exist — grep first, then build.
22
+
23
+ - ...
24
+
25
+ ## Evidence
26
+
27
+ **Fill this in before marking `done`.** Copy the summary line into `tracker.md`.
28
+
29
+ - **Verified:** what you actually ran or checked, and what you saw
30
+ - **Not verified:** what you did NOT check — untested paths, edge cases, anything left open
31
+
32
+ A story marked `done` with an empty Evidence section is worse than one left at `review`: it hides
33
+ risk instead of surfacing it.
@@ -43,6 +43,7 @@ If the current directory has a `.kracked/` folder, read:
43
43
  1. `.kracked/project.md` — what this project is (stack, conventions)
44
44
  2. `.kracked/session.md` — working memory: state + next steps
45
45
  3. `.kracked/decisions.md` — why things are the way they are
46
+ 4. `.kracked/sdd/tracker.md` — story status, if this project uses SDD (skip if absent)
46
47
 
47
48
  If there is no `.kracked/` folder here, this is a project that hasn't been set up yet. Say so
48
49
  plainly and suggest `npx kracked-core init` if the user wants project memory for it. Continue
@@ -27,24 +27,59 @@ Classify before doing any ceremony. Say the classification out loud in one line,
27
27
  Over-ceremony on a small task is a failure mode, not thoroughness. Do not write a spec file for a
28
28
  typo fix.
29
29
 
30
+ ## Where documents live
31
+
32
+ Copy the matching `_TEMPLATE.md` in each folder rather than inventing a structure.
33
+
34
+ | Folder | Holds |
35
+ |---|---|
36
+ | `.kracked/sdd/specs/` | What to build and why |
37
+ | `.kracked/sdd/epics/` | A group of related stories |
38
+ | `.kracked/sdd/stories/` | One independently shippable slice |
39
+ | `.kracked/sdd/architecture/` | How it's put together — large/risky work only |
40
+ | `.kracked/sdd/architecture/decisions/` | ADRs, numbered `0001-`, never renumbered |
41
+ | `.kracked/sdd/tracker.md` | Status + evidence for every story |
42
+
43
+ Naming: `specs/login.md`, `epics/1-authentication.md`, `stories/1.1-email-login.md`. Story IDs are
44
+ `<epic>.<story>` and MUST match the ID in `tracker.md` — that link is what makes the tracker
45
+ trustworthy.
46
+
30
47
  ## 2. Spec stage
31
48
 
32
- Write to `.kracked/sdd/specs/<short-name>.md`. Include:
49
+ Copy `.kracked/sdd/specs/_TEMPLATE.md` to `.kracked/sdd/specs/<short-name>.md` and fill it in:
33
50
 
34
51
  - **What** — the feature or change, in plain language
35
52
  - **Why** — the problem it solves, for whom
36
53
  - **Acceptance criteria** — concrete, checkable conditions for "this works"
37
54
  - **Out of scope** — explicitly list what this spec does NOT cover. This is not optional; scope
38
55
  creep starts where this section is skipped.
56
+ - **Edge cases** — for every input: what if it's empty, missing, or unexpected?
39
57
 
40
58
  Confirm the spec with the user before moving on, unless the request was classified trivial/small
41
59
  and the spec is short enough that building it IS the confirmation.
42
60
 
61
+ ## 2b. Architecture — only when the work is large or risky
62
+
63
+ If the job is **large or risky** (new service, data model change, auth, payments, anything
64
+ touching money or user data), write an architecture doc from
65
+ `.kracked/sdd/architecture/_TEMPLATE.md` BEFORE building — the shape, the data model, and the
66
+ failure modes.
67
+
68
+ For a decision someone would otherwise re-litigate later (why this database, why this pattern),
69
+ add a numbered ADR from `architecture/decisions/_TEMPLATE.md`.
70
+
71
+ **Do not write either for a small feature.** Ceremony on small work is why people abandon a
72
+ process. Say plainly which you're writing and why, or say you're skipping them and why.
73
+
43
74
  ## 3. Docs stage
44
75
 
45
76
  Break the spec into stories. Each story must be independently shippable — a story that can't be
46
77
  merged and left in a working state on its own is too big; split it further.
47
78
 
79
+ If there's more than one story, write an epic from `.kracked/sdd/epics/_TEMPLATE.md` and give each
80
+ story its own file from `.kracked/sdd/stories/_TEMPLATE.md`. A single-story job needs neither —
81
+ the spec is enough.
82
+
48
83
  Add every story to `.kracked/sdd/tracker.md` with status `backlog`. Use this exact table shape —
49
84
  do not invent columns:
50
85