kracked-core 1.0.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,53 @@
1
+ ---
2
+ name: kracked-boot
3
+ description: Use at the start of every session, before any other work, to load global and project memory and orient on what happened last and what's next.
4
+ ---
5
+
6
+ Run this before doing anything else in the session. Do not skip steps or merge reads together.
7
+
8
+ ## 1. Check that memory exists
9
+
10
+ Look for `~/.kracked/identity.md`. If it is missing, global memory has not been set up. Tell the
11
+ user:
12
+
13
+ > Global memory isn't set up yet. Run `npx kracked-core init` to create it, then re-run this.
14
+
15
+ Stop here if memory doesn't exist. Do not fabricate identity, preferences, or project state.
16
+
17
+ ## 2. Load global memory, in this exact order
18
+
19
+ Read each file individually — one `Read` call per file, not concatenated, not skimmed as a batch.
20
+ Order matters: later files build on earlier ones.
21
+
22
+ 1. `~/.kracked/identity.md` — who you are, how you communicate
23
+ 2. `~/.kracked/preferences.md` — how the user likes to work
24
+ 3. `~/.kracked/lessons.md` — the INDEX, in full. Every line, every boot.
25
+ 4. `~/.kracked/projects.md` — registry of known projects
26
+
27
+ **Never read `~/.kracked/lessons-archive.md` at boot.** It holds full lesson detail and grows
28
+ without bound — loading it every session would make the boot payload heavier over time, which
29
+ defeats the point of splitting index from archive. Only open it later, mid-task, if a specific
30
+ line in `lessons.md` turns out to be relevant to what you're doing right now.
31
+
32
+ ## 3. Load project memory, in this exact order
33
+
34
+ If the current directory has a `.kracked/` folder, read:
35
+
36
+ 1. `.kracked/project.md` — what this project is (stack, conventions)
37
+ 2. `.kracked/session.md` — working memory: state + next steps
38
+ 3. `.kracked/decisions.md` — why things are the way they are
39
+
40
+ If there is no `.kracked/` folder here, this is a project that hasn't been set up yet. Say so
41
+ plainly and suggest `npx kracked-core init` if the user wants project memory for it. Continue
42
+ with global memory only — this is not a blocking error.
43
+
44
+ ## 4. Orient in one line
45
+
46
+ After loading, produce exactly one line, no preamble, in this shape:
47
+
48
+ > I'm {{AGENT_NAME}}. Last session: <what session.md says was done or in progress>. Next:
49
+ > <what session.md says is next>. <Any active caution from lessons.md or decisions.md, if one
50
+ > applies — omit this clause if there isn't one>.
51
+
52
+ Do not repeat the full contents of the files you read. The user was there for the last session —
53
+ they need the pointer back in, not a transcript.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: kracked-explain
3
+ description: Use right after kracked-core init finishes, or when the user asks what kracked-core does or how memory works, to walk through what got installed in plain language.
4
+ ---
5
+
6
+ Walk the user through what just got installed. Keep it conversational and short — this is likely
7
+ their first five minutes with the tool. Don't lecture, don't dump the whole file tree at once.
8
+
9
+ ## 1. What got created, and where
10
+
11
+ Explain in plain language, not a file listing dump:
12
+
13
+ - **Global memory**, at `~/.kracked/` — this lives on the machine, not in any one project. It
14
+ holds who the agent is (`identity.md`), how the user likes to work (`preferences.md`), and
15
+ lessons learned across every project (`lessons.md` / `lessons-archive.md`), plus a registry of
16
+ known projects (`projects.md`).
17
+ - **Project memory**, at `.kracked/` inside this repo — this is specific to this codebase: what
18
+ it is (`project.md`), what's being worked on right now (`session.md`), and why past decisions
19
+ were made (`decisions.md`).
20
+ - **The loader files** — `AGENTS.md` is the one every harness reads; `CLAUDE.md` just points at
21
+ it (`@AGENTS.md`) so there's one source of truth instead of two files drifting apart.
22
+
23
+ ## 2. The boundary rule
24
+
25
+ Teach it with a concrete wrong example, not just the rule stated abstractly:
26
+
27
+ > The rule: global memory never contains anything specific to one project. Project memory never
28
+ > contains anything about the user's general preferences or identity.
29
+ >
30
+ > Here's the mistake this prevents: say the agent learns "this project uses PostgreSQL with a
31
+ > `snake_case` naming convention" and writes that into global `preferences.md` instead of this
32
+ > project's `project.md`. Next week, in a completely different project that uses MongoDB, the
33
+ > agent boots up carrying that PostgreSQL assumption with it — because global memory loads
34
+ > everywhere. That's project detail leaking into global memory, and it poisons every other
35
+ > project from then on.
36
+
37
+ Keep the fix simple: project truth goes in `.kracked/`, everything that should follow the user
38
+ everywhere goes in `~/.kracked/`.
39
+
40
+ ## 3. Why lessons split into an index and an archive
41
+
42
+ Explain the reasoning, not just the mechanism:
43
+
44
+ - `lessons.md` is read in full at every single boot, on every project. If every lesson's full
45
+ detail lived there, that file would grow every session and eventually the boot itself would get
46
+ slow and bloated just to load memory.
47
+ - So `lessons.md` stays a short index — one line per lesson — and the full detail lives in
48
+ `lessons-archive.md`, which is only opened on demand when a specific lesson looks relevant to
49
+ what's being worked on right now.
50
+ - This is the same reason project memory and global memory are split: keep what loads by default
51
+ small, keep the detail available but not mandatory.
52
+
53
+ ## 4. The three commands
54
+
55
+ Introduce them as a cycle, with when to reach for each:
56
+
57
+ - **`/kracked-boot`** — run this first, every session. Loads memory, orients on what happened
58
+ last and what's next.
59
+ - **`/kracked-sdd`** — run this to build something. Right-sizes the work, then walks idea → spec
60
+ → docs → build → review depending on how big the task is.
61
+ - **`/kracked-wrap`** — run this at the end of a session. Writes back anything worth remembering
62
+ before the context disappears.
63
+
64
+ Boot at the start, wrap at the end, sdd for the work in between.
65
+
66
+ ## 5. Close
67
+
68
+ End with the next concrete step: run `/kracked-boot` now to see it work. Don't add anything after
69
+ that — let the student try it rather than reading more.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: kracked-sdd
3
+ description: Use when the user asks to build, add, or change a feature, to run the spec-driven flow from idea through spec, docs, build, and review.
4
+ ---
5
+
6
+ Run the SDD (spec-driven) flow: idea → spec → docs → build → review. Right-size it first — most
7
+ requests do not need the full flow.
8
+
9
+ ## 0. Resume check (do this before anything else)
10
+
11
+ Read `.kracked/sdd/tracker.md` if it exists. If it lists a story that is not `done`, you are
12
+ resuming mid-flow. Pick up at that story's current stage — do not restart the flow from idea, and
13
+ do not re-ask questions already answered in its spec.
14
+
15
+ ## 1. Right-size the request FIRST
16
+
17
+ Classify before doing any ceremony. Say the classification out loud in one line, then act on it.
18
+
19
+ - **Trivial** — typo fix, one-line change, config tweak, renaming something. Skip straight to
20
+ build. No spec, no tracker entry. Say: "This is trivial — building it directly." Then build it.
21
+ - **Small** — a single well-understood feature or fix with limited surface area. Light spec
22
+ (a few lines: what/why, acceptance criteria) → build → review. Skip the full docs breakdown if
23
+ there's only one story.
24
+ - **Large or risky** — touches multiple areas, has unclear scope, affects data/migrations/auth,
25
+ or the user is unsure what they want. Full flow below, all five stages.
26
+
27
+ Over-ceremony on a small task is a failure mode, not thoroughness. Do not write a spec file for a
28
+ typo fix.
29
+
30
+ ## 2. Spec stage
31
+
32
+ Write to `.kracked/sdd/specs/<short-name>.md`. Include:
33
+
34
+ - **What** — the feature or change, in plain language
35
+ - **Why** — the problem it solves, for whom
36
+ - **Acceptance criteria** — concrete, checkable conditions for "this works"
37
+ - **Out of scope** — explicitly list what this spec does NOT cover. This is not optional; scope
38
+ creep starts where this section is skipped.
39
+
40
+ Confirm the spec with the user before moving on, unless the request was classified trivial/small
41
+ and the spec is short enough that building it IS the confirmation.
42
+
43
+ ## 3. Docs stage
44
+
45
+ Break the spec into stories. Each story must be independently shippable — a story that can't be
46
+ merged and left in a working state on its own is too big; split it further.
47
+
48
+ Add every story to `.kracked/sdd/tracker.md` with status `backlog`. Use this exact table shape —
49
+ do not invent columns:
50
+
51
+ ```markdown
52
+ | ID | Story | Status | Evidence |
53
+ |-----|-------------------|-------------|----------|
54
+ | 1.1 | User can log in | backlog | — |
55
+ ```
56
+
57
+ - **ID** — `<epic>.<story>`, e.g. `1.1`, `1.2`, `2.1`
58
+ - **Status** — one of exactly: `backlog` · `in-progress` · `review` · `done`
59
+ - **Evidence** — `—` until the story reaches `done`. See the evidence gate below.
60
+
61
+ Keep a `## Spec` line above the table pointing at the spec file this batch of stories came from.
62
+
63
+ ## 4. Build stage
64
+
65
+ Implement against the spec, one story at a time.
66
+
67
+ - The moment a story's status changes, update the tracker. Not at the end of the session, not
68
+ batched — the instant it moves (e.g. `backlog` → `in-progress` when you start it, `in-progress`
69
+ → `review` when the code is written).
70
+ - Build against what the spec says, not what you assume it should say. If the spec is wrong or
71
+ something it references doesn't exist, stop and flag it — don't improvise around it.
72
+
73
+ ## 5. Review stage
74
+
75
+ Two checks, both required, neither optional:
76
+
77
+ 1. **Correctness** — does the code do what the spec's acceptance criteria describe? Read it back
78
+ against the criteria, line by line.
79
+ 2. **Does it actually work** — run it, or trace through the actual execution path. Green tests are
80
+ not proof of a working feature; a test can pass while testing the wrong thing.
81
+
82
+ ### The evidence gate — the most important rule in this flow
83
+
84
+ A story cannot move to `done` without a note stating:
85
+
86
+ - What was verified (specifically — "ran X, saw Y", not "looks good")
87
+ - What was NOT verified (be honest about the gaps — untested edge cases, unexercised code paths,
88
+ anything you didn't actually run)
89
+
90
+ "Green tests" is not evidence on its own. If you didn't check it, the story is not `done` — leave
91
+ it at `review` and say what's still open. A story marked `done` with no evidence note is worse
92
+ than one left at `review`, because it hides risk instead of surfacing it.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: kracked-wrap
3
+ description: Use at the end of a session, or when the user says they're done for now, to write memory before context is lost and close the session cleanly.
4
+ ---
5
+
6
+ Run this at the end of a session, before context is lost. Work through the steps in order.
7
+
8
+ ## 1. Decide if this session is worth logging
9
+
10
+ Not every session needs a memory write. If nothing changed — pure discussion with no decisions,
11
+ no code, no lesson — say so and skip the writes below. Logging a trivial session pollutes the
12
+ signal for future boots, which makes the real lessons harder to find.
13
+
14
+ If the session had meaningful work (code changed, a decision was made, or something was learned
15
+ the hard way), continue.
16
+
17
+ ## 2. Check for a lesson
18
+
19
+ Ask: did the agent get corrected, drift off track, or hit a trap that will recur? If yes, that's a
20
+ lesson. If the session went smoothly with no correction needed, there is no lesson to log — do not
21
+ invent one to fill the step.
22
+
23
+ If there is a lesson:
24
+
25
+ 1. Append the FULL entry to `~/.kracked/lessons-archive.md` — what happened, what triggered it,
26
+ what the fix or avoidance is. Enough detail that a future session reading it cold understands
27
+ the trap without re-living it.
28
+ 2. Add exactly ONE line to `~/.kracked/lessons.md` — short enough to scan at boot, specific enough
29
+ to be useful, pointing at the archive entry.
30
+
31
+ Never paste the full entry into the index file. The index stays scannable; the archive holds the
32
+ detail.
33
+
34
+ ## 3. Update project session state
35
+
36
+ Write `.kracked/session.md` with:
37
+
38
+ - Current state — what's actually true right now, not a history of how you got there
39
+ - Next steps — what to pick up next session
40
+
41
+ Keep this file to current state, not a running log. If it's grown into a chronicle of every past
42
+ session, trim it back to what's still relevant before writing the new entry — session.md is
43
+ working memory, not an archive.
44
+
45
+ ## 4. Update decisions, if one was made
46
+
47
+ If a non-obvious decision was made this session (a tradeoff chosen for a reason that wouldn't be
48
+ obvious from the code alone), add it to `.kracked/decisions.md`. Skip this if nothing decision-
49
+ worthy happened — not every session needs a decisions entry.
50
+
51
+ ## 5. Never write secrets
52
+
53
+ Before writing anything, check it for API keys, tokens, passwords, connection strings, or other
54
+ credentials. None of that belongs in any memory file, archive or otherwise. If a lesson or
55
+ decision references a secret, describe it generically ("the deploy token" not the token itself).
56
+
57
+ ## 6. Close
58
+
59
+ Confirm to the user, in one or two lines, what was written and where — not a restatement of the
60
+ whole session.