@aacombarro89/praxis 0.1.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.
Files changed (72) hide show
  1. package/dist/anchors.d.ts +36 -0
  2. package/dist/anchors.js +197 -0
  3. package/dist/anchors.js.map +1 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +4 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/emit.d.ts +51 -0
  8. package/dist/emit.js +253 -0
  9. package/dist/emit.js.map +1 -0
  10. package/dist/external.d.ts +61 -0
  11. package/dist/external.js +155 -0
  12. package/dist/external.js.map +1 -0
  13. package/dist/init.d.ts +45 -0
  14. package/dist/init.js +123 -0
  15. package/dist/init.js.map +1 -0
  16. package/dist/manifest.d.ts +36 -0
  17. package/dist/manifest.js +63 -0
  18. package/dist/manifest.js.map +1 -0
  19. package/dist/merge-json.d.ts +83 -0
  20. package/dist/merge-json.js +207 -0
  21. package/dist/merge-json.js.map +1 -0
  22. package/dist/merge.d.ts +53 -0
  23. package/dist/merge.js +89 -0
  24. package/dist/merge.js.map +1 -0
  25. package/dist/packages.d.ts +47 -0
  26. package/dist/packages.js +121 -0
  27. package/dist/packages.js.map +1 -0
  28. package/dist/permissions.d.ts +54 -0
  29. package/dist/permissions.js +83 -0
  30. package/dist/permissions.js.map +1 -0
  31. package/dist/plugins.d.ts +21 -0
  32. package/dist/plugins.js +88 -0
  33. package/dist/plugins.js.map +1 -0
  34. package/dist/program.d.ts +2 -0
  35. package/dist/program.js +201 -0
  36. package/dist/program.js.map +1 -0
  37. package/dist/sync.d.ts +37 -0
  38. package/dist/sync.js +45 -0
  39. package/dist/sync.js.map +1 -0
  40. package/package.json +40 -0
  41. package/packages/external/drawio/package.yaml +7 -0
  42. package/packages/external/drawio/plugins.yaml +13 -0
  43. package/packages/external/ponytail/package.yaml +7 -0
  44. package/packages/external/ponytail/plugins.yaml +13 -0
  45. package/packages/layer1/instruction-upkeep/commands/audit.md +41 -0
  46. package/packages/layer1/instruction-upkeep/package.yaml +8 -0
  47. package/packages/layer1/instruction-upkeep/rules.md +21 -0
  48. package/packages/layer1/karpathy-claude/package.yaml +5 -0
  49. package/packages/layer1/karpathy-claude/rules.md +35 -0
  50. package/packages/layer1/safe-permissions/package.yaml +5 -0
  51. package/packages/layer1/safe-permissions/permissions.yaml +26 -0
  52. package/packages/layer1/session-handoff/commands/handoff.md +185 -0
  53. package/packages/layer1/session-handoff/package.yaml +10 -0
  54. package/packages/layer1/session-handoff/rules.md +20 -0
  55. package/packages/layer1/upkeep/commands/upkeep.md +31 -0
  56. package/packages/layer1/upkeep/package.yaml +10 -0
  57. package/packages/layer1/upkeep/rules.md +12 -0
  58. package/packages/layer1/wiki-memory/commands/wiki.md +103 -0
  59. package/packages/layer1/wiki-memory/package.yaml +10 -0
  60. package/packages/layer1/wiki-memory/rules.md +49 -0
  61. package/packages/layer2/node-recipes/package.yaml +10 -0
  62. package/packages/layer2/node-recipes/rules.md +33 -0
  63. package/packages/layer2/node-testing/package.yaml +10 -0
  64. package/packages/layer2/node-testing/rules.md +33 -0
  65. package/packages/layer2/python-backend-recipes/package.yaml +10 -0
  66. package/packages/layer2/python-backend-recipes/rules.md +37 -0
  67. package/packages/layer2/python-testing/package.yaml +10 -0
  68. package/packages/layer2/python-testing/rules.md +33 -0
  69. package/packages/layer2/react-components/package.yaml +10 -0
  70. package/packages/layer2/react-components/rules.md +40 -0
  71. package/packages/layer2/react-testing/package.yaml +10 -0
  72. package/packages/layer2/react-testing/rules.md +35 -0
@@ -0,0 +1,8 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D20). This package provides a standing
2
+ # reminder (rules.md) plus the /praxis-audit command (commands/audit.md) that
3
+ # keeps the authored instruction layer (CLAUDE.md, .claude/rules) current —
4
+ # never the tool's native auto-memory, never a 3rd-party memory system
5
+ # (docs/wiki/onboarding.md).
6
+ name: instruction-upkeep
7
+ layer: layer1
8
+ provides: [rules, commands]
@@ -0,0 +1,21 @@
1
+ ## Instruction upkeep
2
+
3
+ The authored instruction layer (`CLAUDE.md`, `.claude/rules`) drifts as a
4
+ project changes, and can be incomplete from the start. Keep it both current
5
+ and complete:
6
+
7
+ - When the project changes in a way that makes an instruction stale, or a
8
+ misunderstanding surfaces that's worth encoding, update the instruction
9
+ files rather than letting the gap persist.
10
+ - An instruction file should document, for any project: build/test/run
11
+ commands, project layout, key conventions, and always-do rules. If one of
12
+ these is missing, fill it by discovery and asking the user — never invent
13
+ a fact that isn't backed by the code, config, or the user's answer.
14
+ - Prefer linking a canonical source (e.g. an architecture doc) over restating
15
+ its facts — restated facts drift independently of their source.
16
+ - When instruction files include `praxisAnchors` frontmatter, keep those anchors
17
+ resolving. `praxis check` hard-fails broken `path`, `command`, and `section`
18
+ anchors; staleness signals are future advisory work.
19
+ - Make instruction-layer changes through `/praxis-audit`, not ad-hoc edits — run
20
+ it when unsure whether the instruction files still match the project, or whether
21
+ they cover the sections above.
@@ -0,0 +1,5 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D20). Declares what this package is and
2
+ # provides; the loader (src/packages.ts) validates it and resolves requires/conflicts.
3
+ name: karpathy-claude
4
+ layer: layer1
5
+ provides: [rules]
@@ -0,0 +1,35 @@
1
+ ## Methodology — Layer 1 (general)
2
+
3
+ Behavioral guidelines that reduce common LLM coding mistakes. They are
4
+ tool-agnostic; merge with project-specific instructions as needed.
5
+
6
+ Tradeoff: these bias toward caution over speed. For trivial tasks, use judgment.
7
+
8
+ ### 1. Think before coding
9
+
10
+ Don't assume, don't hide confusion, surface tradeoffs. State assumptions
11
+ explicitly and ask when uncertain. Offer a simpler approach if one exists. Stop
12
+ and ask when something is unclear rather than guessing.
13
+
14
+ ### 2. Simplicity first
15
+
16
+ Write the minimum code that solves the problem. No speculative features, no
17
+ abstractions for single-use code, no error handling for impossible cases. If 200
18
+ lines could be 50, rewrite. Test: would a senior engineer call this
19
+ overcomplicated?
20
+
21
+ ### 3. Surgical changes
22
+
23
+ Touch only what the task requires. Don't refactor, reformat, or "improve"
24
+ adjacent code. Match the existing style. Mention unrelated dead code rather than
25
+ deleting it. Remove only the orphans your own change creates. Every changed line
26
+ should trace to the request.
27
+
28
+ ### 4. Goal-driven execution
29
+
30
+ Define success criteria, then loop until verified. "Add validation" becomes
31
+ "write tests for invalid inputs, then make them pass." State a brief plan with a
32
+ verify step per item.
33
+
34
+ Working if: fewer unnecessary diffs, fewer rewrites from overcomplication, and
35
+ clarifying questions before implementation rather than mistakes after.
@@ -0,0 +1,5 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D20). This package provides a structured
2
+ # permission policy (permissions.yaml), not prose — see docs/wiki/emitters.md/D18/D19.
3
+ name: safe-permissions
4
+ layer: layer1
5
+ provides: [permissions]
@@ -0,0 +1,26 @@
1
+ # Neutral permission policy — the enforcement side of the rails
2
+ # (docs/wiki/emitters.md, D18/D19). Tool-agnostic INTENT expressed as capabilities; per-tool emitters
3
+ # translate to concrete rule strings (Claude Code today; tools without a
4
+ # permission model emit nothing). Edit your own settings to tune — Praxis owns
5
+ # only the rules it emits and never clobbers rules you add.
6
+ #
7
+ # Posture: allow common local dev (smooth); prompt before anything that leaves the
8
+ # machine or mutates dependencies; deny destructive / exfiltration actions.
9
+ # Capability vocabulary is closed — see src/permissions.ts.
10
+
11
+ allow:
12
+ - read-repo # read repository files
13
+ - edit-repo # create / edit / write repository files
14
+ - run-dev-scripts # test, lint, typecheck, build
15
+ - read-only-git # git status / diff / log
16
+ - git-commit # commit locally
17
+
18
+ ask:
19
+ - git-push # pushes leave the machine
20
+ - install-deps # mutates the dependency tree
21
+
22
+ deny:
23
+ - destructive-delete # rm -rf
24
+ - force-push # rewrites remote history
25
+ - read-secrets # .env, *.pem, credential files
26
+ - global-install # global package installs escape the repo
@@ -0,0 +1,185 @@
1
+ ---
2
+ description: Capture full session context into a chronologically-named, self-contained handoff document so a fresh session can resume the work without re-running discovery.
3
+ argument-hint: [optional-topic-slug]
4
+ allowed-tools: Read, Glob, Grep, Bash(git status:*), Bash(git branch:*), Bash(git diff:*), Bash(git log:*), Bash(date:*), Bash(ls:*), Bash(mkdir:*), Write
5
+ ---
6
+
7
+ # Session Handoff Document
8
+
9
+ You are a senior engineer writing a handoff document at the end of a working
10
+ session. Capture ALL relevant context so a fresh session — with none of this
11
+ conversation in memory — can read the file and immediately continue the work.
12
+
13
+ The handoff is a **context cache, not just a status report.** A fresh session
14
+ (or a resume subagent whose only briefing is this file) should be able to act
15
+ from it without re-running the discovery you already did. Provide or reference
16
+ the load-bearing context — files, line numbers, doc sections, prior art,
17
+ commands — rather than making the next session rediscover it.
18
+
19
+ ## Phase 1 — Build the filename
20
+
21
+ Read the clock so the name sorts chronologically (do not guess the time):
22
+
23
+ - Timestamp: !`date +%Y-%m-%d_%H%M`
24
+
25
+ Build the filename `YYYY-MM-DD_HHMM_HANDOFF_<topic>.md`:
26
+ - `<topic>` is a short kebab-case slug for the work. Use `$ARGUMENTS` if
27
+ provided; otherwise derive it from the task.
28
+ - Date-and-time first means a plain alphabetical listing is chronological.
29
+
30
+ ## Phase 2 — Gather context
31
+
32
+ Analyze this conversation for:
33
+ - The task/feature/bug being worked on
34
+ - Files read, created, modified, deleted
35
+ - Key decisions and their rationale
36
+ - Problems hit and how they were solved
37
+ - What is done vs pending
38
+ - Open questions and blockers
39
+
40
+ Then, crucially, harvest from **your own session** the pointers a fresh session
41
+ would otherwise have to rediscover — the files you Read, the searches you ran,
42
+ the docs you consulted, the commands you found. These go in the *Context map &
43
+ references* section below. Don't re-derive them; you already paid for them.
44
+
45
+ ## Phase 3 — Project state
46
+
47
+ If in a git repo, capture current branch, staged/unstaged changes, and recent
48
+ commits from this session:
49
+
50
+ - Branch: !`git branch --show-current 2>/dev/null`
51
+ - Status: !`git status --short 2>/dev/null`
52
+ - Recent commits: !`git log --oneline -10 2>/dev/null`
53
+
54
+ Capture verification state too: identify the project's own build/test/lint
55
+ commands (from its config / docs / CI) and record their current result — what
56
+ passes, what fails, what is untested. Use whatever the project actually has;
57
+ don't assume a specific toolchain.
58
+
59
+ ## Phase 4 — Choose save location
60
+
61
+ Save to the first of these that exists (create the dir if needed):
62
+ 1. `docs/handoffs/`
63
+ 2. `docs/`
64
+ 3. `.claude/handoffs/` (create the `handoffs` subdir)
65
+ 4. project root (fallback)
66
+
67
+ Run `mkdir -p` on the chosen directory before writing.
68
+
69
+ ## Phase 5 — Write the document
70
+
71
+ Write the file using the Write tool. NEVER just print it to chat — it must be
72
+ saved to disk. Use this structure:
73
+
74
+ ````markdown
75
+ # Handoff: [Brief Title]
76
+
77
+ > **RESUMING SESSION:** If you are a fresh session reading this file, your job is
78
+ > to continue the work described below. Read "Context Map & References" first so
79
+ > you can act without re-running discovery, then start at "Immediate Next Steps"
80
+ > and verify current state against the repo before proceeding.
81
+
82
+ **Created:** [timestamp]
83
+ **Branch:** [branch]
84
+
85
+ ## Summary
86
+ [2–3 sentence executive summary: what was being worked on and current state.]
87
+
88
+ ## Context Map & References
89
+ *The resume-time context cache — populate this so the next session skips
90
+ re-discovery. Be generous here; a pointer that saves a re-search earns its
91
+ bytes.*
92
+
93
+ ### Key files
94
+ - `path:line-range` — why it matters (what to read / change here)
95
+
96
+ ### Reference material
97
+ - [Project design/decision/architecture doc] §section — what it says that matters
98
+ - [External link / ticket / spec] — relevance
99
+
100
+ ### Prior art / templates to mirror
101
+ - `path` — the pattern to copy for the pending work
102
+
103
+ ### Commands
104
+ ```bash
105
+ [exact build / test / run / lint invocations for this project]
106
+ ```
107
+
108
+ ### Search anchors
109
+ - `grep/symbol/query` — what it locates (so re-search is cheap)
110
+
111
+ ### Critical excerpts
112
+ [Short snippets of the few load-bearing pieces, so the next session often need
113
+ not reopen the file.]
114
+
115
+ ## Work Completed
116
+ - [ ] [Specific change 1]
117
+ - [ ] [Specific change 2]
118
+
119
+ ### Key Decisions
120
+ | Decision | Rationale | Alternatives |
121
+ | --- | --- | --- |
122
+ | ... | ... | ... |
123
+
124
+ ## Files Affected
125
+ ### Created
126
+ - `path` — purpose
127
+ ### Modified
128
+ - `path` — what changed and why (functions/lines if relevant)
129
+ ### Deleted
130
+ - `path` — why
131
+
132
+ ## Technical Context
133
+ [Architecture notes, patterns, new dependencies, config/env changes.]
134
+
135
+ ## Current State
136
+ ### Working
137
+ - ...
138
+ ### Not working
139
+ - [issue — suspected cause]
140
+ ### Verification
141
+ - [ ] Build: [status]
142
+ - [ ] Tests: [status / which command]
143
+ - [ ] Lint/typecheck: [status]
144
+ - [ ] Manual: [what was tested]
145
+
146
+ ## Immediate Next Steps
147
+ 1. [Most critical next action — be specific]
148
+ 2. [Second priority]
149
+ 3. [Third priority]
150
+
151
+ ## Blocked On
152
+ - [Blocker + how to unblock]
153
+
154
+ ## Open Questions
155
+ - [ ] [Question 1]
156
+ - [ ] [Question 2]
157
+
158
+ ## Instruction-layer follow-up
159
+ - [Did this session change the project in a way that makes its authored
160
+ instruction files (agent-instruction docs / rules) stale or incomplete? If so,
161
+ what needs updating — and via the project's own upkeep path, not silently.]
162
+ ````
163
+
164
+ ## Constraints
165
+ - Keep the prose sections concise; the *Context Map & References* section may be
166
+ as long as it needs — prioritize actionable, copy-pasteable pointers over
167
+ narrative.
168
+ - Use real file paths, function names, line numbers.
169
+ - Present tense for current state, future tense for next steps.
170
+ - The "Immediate Next Steps" and "Context Map & References" sections are
171
+ mandatory and must be specific.
172
+
173
+ ## Phase 6 — Confirm and hand off
174
+
175
+ After writing, print exactly this to chat (with real values substituted):
176
+
177
+ ```
178
+ ✅ Handoff saved: <relative/path/to/file.md>
179
+
180
+ To continue, open a NEW session and send:
181
+ Read <relative/path/to/file.md> and continue from the Immediate Next Steps section.
182
+ ```
183
+
184
+ Do not attempt to spawn or launch another session — that is not supported in
185
+ this environment. The user starts the next session manually.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D22/D24). Ships a standing reminder
2
+ # (rules.md) plus the /praxis-handoff command (commands/handoff.md): capture full
3
+ # session context into a chronologically-named, self-contained handoff doc so a
4
+ # fresh agent session resumes without losing state or re-running discovery.
5
+ # Layer 1 / stack- & tool-agnostic — the command adapts to whatever build/test,
6
+ # design doc, and instruction layer the target project has; it hardcodes none of
7
+ # Praxis's own specifics.
8
+ name: session-handoff
9
+ layer: layer1
10
+ provides: [rules, commands]
@@ -0,0 +1,20 @@
1
+ ## Session handoff
2
+
3
+ Work outlives a single session: context windows fill, tasks switch, phases
4
+ close. Before that state is lost, capture it — so a fresh session, with none of
5
+ the current conversation in memory, can resume without guessing or re-deriving.
6
+
7
+ - Hand off at a natural boundary in a verified state — not mid-edit. Stop where
8
+ the build and tests are green, or where any breakage is understood and noted.
9
+ - Write handoffs by running `/praxis-handoff`, not by hand — it produces a
10
+ self-contained, chronologically-named document. Treat it as the next session's
11
+ only briefing.
12
+ - Make it actionable: what's done, what's pending, the single most important
13
+ next step, verification status, and any open decisions.
14
+ - Carry the context forward, don't just summarize it. Reference the load-bearing
15
+ files (`path:line`), the relevant design-doc sections, the prior-art to mirror,
16
+ and the exact commands — so the next session skips re-running discovery.
17
+ - Note instruction-layer follow-up: if the session changed the project in a way
18
+ that makes the authored instruction files stale or incomplete, say so.
19
+ - Keep handoffs together in one directory so they sort in chronological order;
20
+ don't scatter them into the codebase.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: Run the deterministic drift check plus the instruction-layer audit and wiki maintenance passes, and report one consolidated result.
3
+ argument-hint: [optional-area-to-focus]
4
+ allowed-tools: Bash(npx praxis check:*), Bash(praxis check:*)
5
+ ---
6
+
7
+ Focus: $ARGUMENTS — if empty, cover all three passes at a high level.
8
+
9
+ This is the single entry point for "is my methodology layer still current
10
+ with reality?" It sequences three existing checks rather than re-implementing
11
+ them — restating their logic here would duplicate content that drifts
12
+ independently of its canonical home.
13
+
14
+ 1. **Deterministic drift.** Run `praxis check` (or `npx praxis check` if the
15
+ `praxis` CLI isn't on PATH), if available in this project. If it reports
16
+ file drift, tell the user to run `praxis sync`. If it reports managed-block
17
+ conflicts or broken anchors, surface them as-is. This step needs no LLM
18
+ judgment — do it first so the semantic passes below build on a known-good
19
+ baseline.
20
+ 2. **Instruction layer.** Perform the audit defined by `/praxis-audit`,
21
+ scoped to the focus above. Follow that command's own steps; do not
22
+ re-derive them here.
23
+ 3. **Wiki.** Perform the wiki maintenance defined by `/praxis-wiki`, scoped to
24
+ the focus above — it files newly-authored knowledge and lints existing pages,
25
+ and no-ops when there is nothing to do. Follow that command's own steps; do
26
+ not re-derive them here. (Full delegation, symmetric with the audit pass —
27
+ not a hand-picked phase, which would restate the skill's logic.)
28
+ 4. **Consolidated report.** Summarize across all three passes: what's in
29
+ sync, what drifted, what was fixed, and what still needs the user's call.
30
+ Both sub-passes already gate edits on user confirmation before changing
31
+ anything — preserve that here; this command must not bypass it.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D29). Ships a standing reminder
2
+ # (rules.md) plus the /praxis-upkeep command (commands/upkeep.md): one entry point
3
+ # that runs the deterministic `praxis check` drift gate and then both semantic-drift
4
+ # passes — the instruction-layer audit (/praxis-audit) and the wiki lint
5
+ # (/praxis-wiki Phase 4) — and reports one consolidated result. Layer 1 /
6
+ # stack- & tool-agnostic; defers to those two commands rather than restating
7
+ # their steps, so the detail can't drift independently of its canonical home.
8
+ name: upkeep
9
+ layer: layer1
10
+ provides: [rules, commands]
@@ -0,0 +1,12 @@
1
+ ## Upkeep
2
+
3
+ The methodology layer (instruction files, the knowledge wiki, the emitted
4
+ `.claude/` files) drifts from project reality the same way code drifts from
5
+ docs. When work reveals that drift — a stale instruction, a wiki page that no
6
+ longer matches the code, an unsynced emit — or when work produces new durable
7
+ knowledge to file (a decision, a new package), run `/praxis-upkeep` rather than
8
+ letting the gap persist, fixing it ad hoc, or invoking the sub-skills piecemeal.
9
+ It is the single front gate: it sequences `praxis check` and fully delegates to
10
+ `/praxis-audit` (instruction layer) and `/praxis-wiki` (knowledge wiki). The
11
+ command itself only sequences and reports; the sub-skills make any edits, each
12
+ behind its own confirmation gate.
@@ -0,0 +1,103 @@
1
+ ---
2
+ description: Bootstrap, update, or lint the project knowledge wiki — a durable, in-repo, linked-markdown memory the agent reads at the start of work and maintains as the project changes (Karpathy "LLM wiki" pattern).
3
+ argument-hint: [optional-topic-to-focus]
4
+ allowed-tools: Read, Glob, Grep, Bash(git log:*), Bash(git diff:*), Bash(ls:*), Bash(mkdir:*), Bash(date:*), Write, Edit
5
+ ---
6
+
7
+ # Project knowledge wiki
8
+
9
+ You are curating a durable knowledge wiki for this project: linked markdown pages
10
+ of long-lived knowledge that a future session reads instead of re-deriving. This
11
+ is the agent's cross-session memory **of the project** — version-controlled and
12
+ shared with the team. It is NOT a per-session handoff (transient — that is
13
+ `/praxis-handoff`) and NOT the authored instruction layer (`CLAUDE.md`,
14
+ `.claude/rules` — that is `/praxis-audit`).
15
+
16
+ The wiki has two kinds of durable knowledge:
17
+ - **Derived summaries** compress code, config, and canonical docs. The underlying
18
+ source wins on conflict; fix the wiki.
19
+ - **Canonical intent** records decisions, rationale, scope, and design intent —
20
+ the "why" that is not fully derivable from code. When code and canonical intent
21
+ diverge, surface the drift for human judgment instead of silently overwriting
22
+ one with the other.
23
+
24
+ Focus: $ARGUMENTS — if empty, refresh and lint the whole wiki at a high level.
25
+
26
+ ## Phase 1 — Locate or create the wiki
27
+
28
+ Use the first of these that already exists; otherwise create the first one
29
+ (run `mkdir -p` before writing):
30
+ 1. `docs/wiki/`
31
+ 2. `wiki/`
32
+ 3. `.praxis/wiki/`
33
+
34
+ - Existing entries: !`ls -R docs/wiki wiki .praxis/wiki 2>/dev/null || true`
35
+ - Today (for log entries, do not guess): !`date +%Y-%m-%d`
36
+
37
+ Front the wiki with two entry-point files; create them if missing:
38
+ - `index.md` — a catalog of every page: a link and a one-line summary each.
39
+ - `log.md` — an append-only record of wiki changes, newest last, each entry dated
40
+ (e.g. `## [YYYY-MM-DD] <added|updated|removed> — <page>: <why>`).
41
+
42
+ ## Phase 2 — Ingest durable knowledge
43
+
44
+ Gather long-lived facts a future session would otherwise have to re-derive:
45
+ - Architecture and how the parts fit; key directories/modules and their roles.
46
+ - Hard-won gotchas, non-obvious constraints, and their underlying cause.
47
+ - Workflows — build/test/run/release — and the *why* behind any unusual step.
48
+ - Decisions and their rationale. Keep a single canonical `decisions.md` ledger
49
+ when decisions are numbered or cited from code/docs: append-only, never
50
+ renumbered, never scattered across topic pages.
51
+ - Useful answers or analyses derived in this session — file them back so they
52
+ don't vanish into chat history.
53
+
54
+ Sources: the code and config, existing docs, recent git history (`git log`,
55
+ changed files), and what was learned in this session. Capture **durable**
56
+ knowledge only — not transient session state, not the instruction rules. Never
57
+ invent a fact that isn't backed by the code, config, a canonical doc, or the
58
+ user's answer. When unsure, ask rather than guess.
59
+
60
+ ## Phase 3 — Write entries and update index + log
61
+
62
+ - One topic per page; a short, linkable page beats a sprawling document.
63
+ - Update the existing canonical page instead of creating a near-duplicate.
64
+ - Cross-link related pages so retrieval is "read the index → follow the links."
65
+ - Keep the taxonomy obvious: `orientation.md` as the map, focused design/topic
66
+ entries, one `decisions.md` ledger when needed, `workflows.md` for commands, and
67
+ `gotchas.md` for traps with causes.
68
+ - Prefer linking a canonical source over restating it (restated facts drift).
69
+ - Add or update `praxisAnchors` frontmatter for the canonical sources a page
70
+ depends on. Phase-2 anchors are page-level and deterministic only:
71
+ - `type: path`, `target: repo/relative/path`
72
+ - `type: command`, `target: npm run <script>` or `npm <script>`
73
+ - `type: section`, `target: docs/file.md#heading-slug`
74
+ Keep staleness/hash tripwires out for now; those are future advisory signals.
75
+ - Update `index.md` so every page is listed and reachable, and append a `log.md`
76
+ entry for each change.
77
+
78
+ ## Phase 4 — Lint
79
+
80
+ Health-check the wiki and fix what you can (ask before large deletions):
81
+ - **Contradictions** — derived summaries that disagree with current code/config
82
+ lose to the source; fix the wiki. Canonical-intent entries are different: if
83
+ code and intent diverge, report the drift and route it to a decision/update
84
+ step (or `/praxis-audit` for instruction-layer changes) instead of deciding
85
+ automatically. Two wiki entries that disagree resolve to the more recent /
86
+ authoritative / better-supported claim, with the resolution noted.
87
+ - **Stale claims** — derived facts the current code has invalidated: fix or
88
+ remove them. For canonical-intent drift, preserve the intent and report the
89
+ mismatch for human judgment.
90
+ - **Orphan pages** — pages not linked from the index or any other page: link or
91
+ retire them.
92
+ - **Missing cross-references** — related pages that don't link each other: connect
93
+ them.
94
+ - **Broken anchors** — run `praxis check` if available; fix any
95
+ `praxisAnchors` entry whose path, command, or section no longer resolves.
96
+
97
+ ## Phase 5 — Report
98
+
99
+ Print what you created, updated, and removed (with paths), the lint issues found
100
+ and how you resolved them, and name the single most useful entry a fresh session
101
+ should read first.
102
+
103
+ Ask before large rewrites or deletions — show the list and confirm.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md, D25). Ships a standing reminder (rules.md)
2
+ # plus the /praxis-wiki command (commands/wiki.md): maintain a durable, in-repo,
3
+ # linked-markdown knowledge wiki the agent reads at the start of work and updates
4
+ # as the project changes — the agent's cross-session memory of the project,
5
+ # delivered as curated declarative files (D8's in-scope side), never a runtime
6
+ # backend (docs/wiki/gotchas.md/D12). Layer 1 / stack- & tool-agnostic; adapts to whatever the
7
+ # target project has and hardcodes none of Praxis's own specifics.
8
+ name: wiki-memory
9
+ layer: layer1
10
+ provides: [rules, commands]
@@ -0,0 +1,49 @@
1
+ ## Wiki memory
2
+
3
+ Knowledge outlives a single conversation. An agent that re-derives the same
4
+ project facts every session wastes effort and drifts. Keep a durable, in-repo
5
+ **knowledge wiki** — linked markdown pages of long-lived knowledge that a fresh
6
+ session reads instead of rediscovering (the Karpathy "LLM wiki" pattern). Because
7
+ it lives in the repo, it is version-controlled and shared with the whole team,
8
+ unlike a tool's machine-local native memory.
9
+
10
+ - **Two entry points.** Front the wiki with an `index.md` that lists every page
11
+ with a one-line summary and a link, and a `log.md` that records — append-only —
12
+ what changed in the wiki and when. Read the index first; it is the map.
13
+ - **Add a glossary when terms collide.** When a project reuses a common word for
14
+ a project-specific meaning, or coins its own vocabulary, keep a `glossary.md`
15
+ of short term definitions — each pointing to the canonical source that owns
16
+ it. The signal you already needed the page is one ambiguous term re-explained
17
+ in scattered prose. Define what a term *is* and, where the word misleads, what
18
+ it is *not*.
19
+ - **Know which kind of entry you are editing.** Derived summaries compress code,
20
+ config, and canonical docs; the underlying source wins on conflict. Canonical
21
+ intent entries record decisions, rationale, scope, and design intent; when code
22
+ and intent diverge, surface the drift for human judgment instead of silently
23
+ overwriting one with the other.
24
+ - **Keep decisions in one ledger when they are numbered or cited.** Use a single
25
+ canonical `decisions.md`, append new `D<N>` rows, never renumber, and never
26
+ scatter numbered decisions across topic pages.
27
+ - An entry captures *durable* knowledge: architecture and how the parts fit, a
28
+ hard-won gotcha and its cause, a workflow, a decision and its why. Not transient
29
+ session state (that is a handoff) and not the authored instruction rules (those
30
+ are `CLAUDE.md`/`.claude/rules`).
31
+ - At the start of a task, read the index and follow the links that bear on the
32
+ work — act on what is already known rather than re-deriving it.
33
+ - When you learn something durable — including a useful answer or analysis you
34
+ derived mid-session — add or update an entry, link it from the index, and note
35
+ the change in the log. Prefer one topic per page, cross-linked, over a sprawling
36
+ document; update the canonical page rather than create a near-duplicate.
37
+ - Add machine-checkable `praxisAnchors` frontmatter for canonical sources when a
38
+ page depends on them: `path`, `command`, and `section` anchors are hard-checked
39
+ by `praxis check`; staleness/hash tripwires remain advisory future work.
40
+ - Keep it true. Periodically **lint** the wiki (via `/praxis-wiki`): flag and fix
41
+ contradictions, stale claims, orphan pages, and missing cross-references. A
42
+ stale wiki misleads worse than none. Link the canonical source rather than
43
+ restating it; restated facts drift independently of their source.
44
+ - Never record a fact that isn't backed by the code, config, a canonical doc, or
45
+ the user — the wiki is curated knowledge, not speculation.
46
+ - Do wiki work by running `/praxis-wiki`, not by hand — bootstrapping, filing new
47
+ knowledge, and linting all run the skill rather than hand-authoring pages and
48
+ hand-editing `index.md`/`log.md` around it. It keeps the index, log, and anchors
49
+ consistent.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md). Layer 2: stack-specific,
2
+ # domain-agnostic authoring recipes for TypeScript/Node codebases — "how to add a
3
+ # module/feature well here" — that point at the target repo's own in-repo prior art
4
+ # for the concrete shape rather than shipping code. Craft, not domain: portable
5
+ # across any Node project; hardcodes none of a project's specifics. Applies only
6
+ # when praxis.yaml declares the `node` stack.
7
+ name: node-recipes
8
+ layer: layer2
9
+ stack: node
10
+ provides: [rules]
@@ -0,0 +1,33 @@
1
+ ---
2
+ paths: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.mjs"]
3
+ ---
4
+
5
+ ## Node/TypeScript authoring recipes (Layer 2)
6
+
7
+ Stack-specific craft for TypeScript/Node code. These say *how to add something
8
+ well in this stack*; the concrete shape lives in this repo's own prior art, not
9
+ here. Find the nearest existing example and mirror it.
10
+
11
+ - **Mirror the nearest module.** Before adding a feature, open the closest
12
+ existing file that already does the same kind of thing (a sibling in the same
13
+ directory, an adjacent route/command/service). Copy its structure — imports,
14
+ exports, error handling, naming — rather than inventing a new shape. The
15
+ prior art is the template; matching it is verifiable, following prose is not.
16
+ - **One module, one responsibility.** A new `.ts` file exports the smallest
17
+ coherent unit. Keep pure logic separate from I/O (filesystem, network, process)
18
+ so the logic is testable without mocks — mirror how the existing modules here
19
+ already split the two.
20
+ - **Use the platform and installed deps before adding one.** Node stdlib (`node:fs`,
21
+ `node:path`, `node:crypto`, `fetch`) and a dependency already in
22
+ `package.json` cover most needs. A new dependency for what a few lines do is
23
+ debt; justify it against what is already imported in neighbouring files.
24
+ - **Types are the contract.** Type the inputs and outputs at module boundaries;
25
+ validate external/untrusted input where it enters (a schema validator if the
26
+ repo already uses one, e.g. zod). Don't re-validate data already typed and
27
+ checked upstream.
28
+ - **Surgical change.** Touch only what the task needs; match the surrounding
29
+ style and the repo's lint/format config. Don't reformat or "improve" adjacent
30
+ code. Every changed line should trace to the task.
31
+ - **ESM vs CJS, follow the repo.** Match the module system, import extensions
32
+ (`.js` specifiers under `"type": "module"`), and `tsconfig` target already in
33
+ use — don't introduce a second convention.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md). Layer 2: a stack-specific
2
+ # decision recipe for TypeScript/Node codebases — how to choose the right test
3
+ # layer (unit vs integration/conformance) and honour the harness-before-features
4
+ # ordering — pointing at the target repo's own test suites for the concrete shape.
5
+ # Craft, not domain: portable across any Node project. Applies only when
6
+ # praxis.yaml declares the `node` stack.
7
+ name: node-testing
8
+ layer: layer2
9
+ stack: node
10
+ provides: [rules]
@@ -0,0 +1,33 @@
1
+ ---
2
+ paths: ["**/*.ts", "**/*.tsx", "**/*.test.ts", "**/*.spec.ts"]
3
+ ---
4
+
5
+ ## Node/TypeScript test-layer recipe (Layer 2)
6
+
7
+ Choosing *where* a test belongs matters as much as writing it. Pick the layer
8
+ that fails for the right reason, and mirror the repo's existing tests of that
9
+ kind for structure and fixtures.
10
+
11
+ - **Harness before features.** A rule that matters has a test. Write (or extend)
12
+ the test that pins the new behaviour *before or with* the code that satisfies
13
+ it — never land logic whose only check is "it looked right". Make the failing
14
+ test the prompt: it states what is missing.
15
+ - **Pick the layer by what could break.**
16
+ - *Unit* — pure logic, branches, parsing, a single module's contract. Fast, no
17
+ I/O, no fixtures. Default here; most logic belongs at this layer.
18
+ - *Integration* — two or more modules composed, or real I/O (filesystem, a
19
+ spawned process, a built artifact). Use when the bug would live in the seam
20
+ between units, not inside one.
21
+ - *Conformance / end-to-end* — an invariant the whole tool must honour, or a
22
+ contract a future change must not break. Use for the rails, not for every
23
+ feature.
24
+ - **Mirror the existing suite.** Find the nearest test of the same layer and copy
25
+ its setup — the test runner already in `package.json` (e.g. vitest/jest), its
26
+ file location and naming convention, how it builds fixtures and asserts. Don't
27
+ introduce a second runner or a new fixture style.
28
+ - **Assert behaviour, not implementation.** Test observable inputs→outputs and
29
+ error cases at the boundary; avoid asserting private internals that refactors
30
+ will churn. One clear failing assertion beats five brittle ones.
31
+ - **No new framework for one test.** The repo's installed runner and plain
32
+ assertions cover almost everything. Reach for a new testing dependency only
33
+ when the existing one demonstrably cannot express the check.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md). Layer 2: stack-specific,
2
+ # domain-agnostic authoring recipes for Python backend codebases — "how to add a
3
+ # module/feature well here" — that point at the target repo's own in-repo prior art
4
+ # for the concrete shape rather than shipping code. Craft, not domain: portable
5
+ # across any Python project; hardcodes none of a project's specifics. Applies only
6
+ # when praxis.yaml declares the `python-backend` stack.
7
+ name: python-backend-recipes
8
+ layer: layer2
9
+ stack: python-backend
10
+ provides: [rules]