@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,37 @@
1
+ ---
2
+ paths: ["**/*.py"]
3
+ ---
4
+
5
+ ## Python backend authoring recipes (Layer 2)
6
+
7
+ Stack-specific craft for Python backend 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 module 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/handler/service). Copy its structure — imports,
14
+ class/function layout, error handling, naming — rather than inventing a new
15
+ shape. The prior art is the template; matching it is verifiable, following
16
+ prose is not.
17
+ - **One module, one responsibility.** A new `.py` file exports the smallest
18
+ coherent unit. Keep pure logic separate from I/O (filesystem, network, database)
19
+ so the logic is testable without mocks — mirror how the existing modules here
20
+ already split the two.
21
+ - **Use the stdlib and installed deps before adding one.** Python stdlib
22
+ (`pathlib`, `dataclasses`, `typing`, `json`, `os`) and a dependency already in
23
+ `pyproject.toml` / `requirements*.txt` cover most needs. A new dependency for
24
+ what a few lines do is debt; justify it against what is already imported in
25
+ neighbouring files.
26
+ - **Type hints are the contract.** Annotate inputs and outputs at module
27
+ boundaries; validate external/untrusted input where it enters (a schema
28
+ validator if the repo already uses one, e.g. pydantic). Don't re-validate data
29
+ already typed and checked upstream.
30
+ - **Surgical change.** Touch only what the task needs; match the surrounding
31
+ style and the repo's lint/format config (`black`/`ruff` if present). Don't
32
+ reformat or "improve" adjacent code. Every changed line should trace to the
33
+ task.
34
+ - **Follow the repo's packaging conventions.** Match the module layout, import
35
+ style (absolute vs relative), and packaging already in use — don't introduce a
36
+ second convention. If the project uses `src/` layout, honour it; if it uses
37
+ flat packages, honour that.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md). Layer 2: a stack-specific
2
+ # decision recipe for Python backend codebases — how to choose the right test
3
+ # layer (unit vs integration/e2e) 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 Python project. Applies only when
6
+ # praxis.yaml declares the `python-backend` stack.
7
+ name: python-testing
8
+ layer: layer2
9
+ stack: python-backend
10
+ provides: [rules]
@@ -0,0 +1,33 @@
1
+ ---
2
+ paths: ["**/*.py", "**/test_*.py", "**/*_test.py"]
3
+ ---
4
+
5
+ ## Python 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 database). Use when the bug would live in the seam between
20
+ units, not inside one.
21
+ - *End-to-end* — an invariant the whole application must honour, or a contract
22
+ a future change must not break. Use for the rails, not for every feature.
23
+ - **Mirror the existing suite.** Find the nearest test of the same layer and copy
24
+ its setup — `pytest` is the default, its file location (`tests/` or alongside
25
+ source), naming convention (`test_*.py`), how it builds fixtures (`conftest.py`,
26
+ `@pytest.fixture`) and asserts. Don't introduce a second runner or a new fixture
27
+ 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
+ `assert` statements cover almost everything. Reach for a new testing dependency
33
+ only 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
+ # authoring recipes for React codebases — React-specific component craft that
3
+ # points at the target repo's own in-repo prior art for the concrete shape rather
4
+ # than shipping code. Covers components, props, composition, accessibility, and
5
+ # hooks conventions; not general TypeScript craft (node-recipes covers that for
6
+ # react+node repos). Applies only when praxis.yaml declares the `react` stack.
7
+ name: react-components
8
+ layer: layer2
9
+ stack: react
10
+ provides: [rules]
@@ -0,0 +1,40 @@
1
+ ---
2
+ paths: ["**/*.tsx", "**/*.jsx"]
3
+ ---
4
+
5
+ ## React component authoring recipes (Layer 2)
6
+
7
+ React-specific craft for component code. General TypeScript/Node craft (types,
8
+ module shape, surgical change) lives in `node-recipes` — this file covers only
9
+ what is React-specific. The concrete shape lives in this repo's own prior art,
10
+ not here. Find the nearest existing component and mirror it.
11
+
12
+ - **Mirror the nearest component.** Before adding a component, open the closest
13
+ existing one that does the same kind of thing (a sibling in the same directory
14
+ or feature folder). Copy its structure — file layout, how it exports, how it
15
+ receives and passes props, where state lives — rather than inventing a new
16
+ shape. The prior art is the template; matching it is verifiable, following
17
+ prose is not.
18
+ - **Props typed at the boundary.** Every component declares an explicit props
19
+ interface or type at the top of its file. Accept the minimum props needed; no
20
+ catch-all `[key: string]: unknown`. Children are explicit when the component
21
+ uses them.
22
+ - **Composition over configuration.** Prefer a small focused component used in
23
+ multiple arrangements over a large one with a boolean-flag API. When a
24
+ component's props grow into a switch statement, split into two components that
25
+ share a common primitive.
26
+ - **Native HTML elements before a component library.** A `<button>`, `<label>`,
27
+ or `<ul>` is always the first option. Reach for a library component only when
28
+ the native element demonstrably cannot satisfy the requirement — and then use
29
+ whichever library the repo already imports, not a new one.
30
+ - **Accessibility is non-negotiable.** Every interactive element is reachable by
31
+ keyboard and has a visible focus style. Form inputs have associated `<label>`
32
+ elements (via `htmlFor`/`id` or wrapping). Non-decorative images have
33
+ descriptive `alt` text. Custom interactive elements carry the correct ARIA
34
+ `role` and `aria-*` attributes. These are not optional polish; ship them with
35
+ the component.
36
+ - **Follow the repo's hooks and state conventions.** Use `useState`/`useReducer`
37
+ at the level state is first needed, and lift only when a sibling needs it.
38
+ Match whatever custom-hook patterns the repo already uses; don't introduce a
39
+ new global-state solution for a single component's needs. Mirror how the
40
+ existing components here manage side effects and data fetching.
@@ -0,0 +1,10 @@
1
+ # Package manifest (docs/wiki/packages-and-emit.md). Layer 2: a stack-specific
2
+ # decision recipe for React codebases — how to choose the right test layer
3
+ # (unit-render vs integration vs e2e), use React Testing Library idioms, and
4
+ # test behaviour/roles/user-visible output rather than implementation — pointing
5
+ # at the target repo's own test suites for the concrete shape. Applies only when
6
+ # praxis.yaml declares the `react` stack.
7
+ name: react-testing
8
+ layer: layer2
9
+ stack: react
10
+ provides: [rules]
@@ -0,0 +1,35 @@
1
+ ---
2
+ paths: ["**/*.test.tsx", "**/*.test.jsx", "**/*.spec.tsx", "**/*.spec.jsx"]
3
+ ---
4
+
5
+ ## React 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 setup.
10
+
11
+ - **Test behaviour, not implementation.** Query by roles and user-visible text
12
+ (`getByRole`, `getByLabelText`, `getByText`) — not by CSS class, component
13
+ display name, or internal state. A test that breaks on a classname rename
14
+ without catching a real regression is noise; a test that catches a missing
15
+ label is signal.
16
+ - **Pick the layer by what could break.**
17
+ - *Unit render* — a single component in isolation: does it render the right
18
+ output for a given set of props, show/hide the right elements, respond to
19
+ user events? Default here for most component logic.
20
+ - *Integration* — two or more components composed, or a component wired to a
21
+ real hook/context/store. Use when the bug would live in the seam between
22
+ components, not inside one.
23
+ - *End-to-end* — a full user journey in a real browser. Use only for the
24
+ critical paths that no unit or integration test can protect; reserve for the
25
+ rails, not for every feature.
26
+ - **Use React Testing Library.** The repo's RTL setup (`render`, `screen`,
27
+ `userEvent`, `fireEvent`) covers almost everything. Mirror the nearest
28
+ existing test file for setup, cleanup, and how it wraps providers. Don't
29
+ introduce a second render helper or a separate component-testing framework.
30
+ - **Mirror the existing suite.** Copy the nearest test file's structure —
31
+ runner, file naming, directory location, how it imports the component under
32
+ test, how it sets up providers or mocks. Consistency beats cleverness.
33
+ - **No new framework for one test.** RTL and the repo's installed runner (e.g.
34
+ vitest/jest) cover almost every component test need. Reach for a new dependency
35
+ only when the existing tooling demonstrably cannot express the check.