@aacombarro89/praxis 0.1.7 → 0.1.8

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/README.md CHANGED
@@ -30,12 +30,19 @@ It always previews a single diff before writing. Git is your undo.
30
30
 
31
31
  ## Why it's different
32
32
 
33
- Compared to `/init`-style tools, Praxis adds two things they lack:
33
+ Other tools _generate_ agent instructions once; Praxis **manages** them:
34
34
 
35
- - **A curated, opinionated methodology** Layer 1 behavioral rules plus Layer 2
36
- stack recipes, shipped as composable **packages**.
35
+ - **Versioned, pinned, drift-checked.** Methodology ships as composable
36
+ packages pinned in `praxis.yaml`, and `praxis check` fails CI when the
37
+ installed files drift — think Renovate/Dependabot, for your agent
38
+ instruction layer.
37
39
  - **A composition / merge step** that folds methodology into an _existing_
38
40
  project without overwriting project-specific content.
41
+ - **One neutral source, per-tool outputs** — Claude Code and `AGENTS.md`
42
+ today, more emitters planned.
43
+
44
+ The curated methodology — Layer 1 behavioral rules plus Layer 2 stack recipes
45
+ — is the starting payload that rides this machinery.
39
46
 
40
47
  ## The two layers
41
48
 
package/dist/emit.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Manifest, Target } from "./manifest.js";
2
2
  import { type PluginsDesired, type RuleSet } from "./merge-json.js";
3
+ export declare const BLOCK_FILE: Partial<Record<Target, string>>;
3
4
  /** The neutral methodology source for a content package, or undefined if the
4
5
  * package has no rules.md (e.g. skills, Layer 2 recipes handled by other phases). */
5
6
  export declare function loadPackageSource(pkg: string): string | undefined;
@@ -37,6 +38,30 @@ export type EmitOp = {
37
38
  /** Build the emit plan from a manifest: the file operations needed to install
38
39
  * the selected methodology for each target. */
39
40
  export declare function planEmit(manifest: Manifest): EmitOp[];
41
+ export interface MethodologySize {
42
+ /** Total content lines across the counted rule artifacts. */
43
+ totalLines: number;
44
+ /** Number of always-loaded rule artifacts counted. */
45
+ fileCount: number;
46
+ }
47
+ /**
48
+ * The always-loaded methodology surface size: total lines and file count for
49
+ * the rule artifacts (`provides: rules`) a session loads at start. Computed
50
+ * from the **planned emit** (manifest → resolve → planEmit), not from files on
51
+ * disk, so it reports what the manifest implies — the same discipline `check`
52
+ * already uses for drift.
53
+ *
54
+ * Counts the claude-code target's owned `.claude/rules/*` files (one per rules
55
+ * package). If claude-code isn't a manifest target, falls back to the
56
+ * agents-md managed block content, one artifact per block, so the two targets'
57
+ * shared source is never double-counted. Commands, permissions/plugins JSON,
58
+ * and the wiki are never counted — none are loaded at session start.
59
+ *
60
+ * Throws if the manifest can't resolve (propagates planEmit's error, e.g. an
61
+ * unknown package) — callers in check mode should catch and omit the line
62
+ * rather than let it mask the sync error (D40's degrade-by-omission model).
63
+ */
64
+ export declare function computeMethodologySize(manifest: Manifest): MethodologySize;
40
65
  export interface ApplyResult {
41
66
  text: string;
42
67
  changed: boolean;
package/dist/emit.js CHANGED
@@ -30,8 +30,11 @@ const TARGET_DELIVERY = {
30
30
  "claude-code": "owned",
31
31
  "agents-md": "block",
32
32
  };
33
- // Block-delivered targets each own a managed block in one flat file.
34
- const BLOCK_FILE = {
33
+ // Block-delivered targets each own a managed block in one flat file. Exported
34
+ // so sync.ts can enumerate the universe of block-owned files for orphan
35
+ // pruning even when the current manifest emits zero blocks for one (D46) —
36
+ // planEmit's ops alone wouldn't carry that path in that case.
37
+ export const BLOCK_FILE = {
35
38
  "agents-md": "AGENTS.md",
36
39
  };
37
40
  /** The neutral methodology source for a content package, or undefined if the
@@ -248,6 +251,48 @@ export function planEmit(manifest) {
248
251
  }
249
252
  return ops;
250
253
  }
254
+ /** Lines in `text`, ignoring any trailing newline(s) — so an owned file's
255
+ * synthesized trailing "\n" (see planEmit above) doesn't inflate the count. */
256
+ function countLines(text) {
257
+ const trimmed = text.replace(/\n+$/, "");
258
+ return trimmed.length === 0 ? 0 : trimmed.split("\n").length;
259
+ }
260
+ /**
261
+ * The always-loaded methodology surface size: total lines and file count for
262
+ * the rule artifacts (`provides: rules`) a session loads at start. Computed
263
+ * from the **planned emit** (manifest → resolve → planEmit), not from files on
264
+ * disk, so it reports what the manifest implies — the same discipline `check`
265
+ * already uses for drift.
266
+ *
267
+ * Counts the claude-code target's owned `.claude/rules/*` files (one per rules
268
+ * package). If claude-code isn't a manifest target, falls back to the
269
+ * agents-md managed block content, one artifact per block, so the two targets'
270
+ * shared source is never double-counted. Commands, permissions/plugins JSON,
271
+ * and the wiki are never counted — none are loaded at session start.
272
+ *
273
+ * Throws if the manifest can't resolve (propagates planEmit's error, e.g. an
274
+ * unknown package) — callers in check mode should catch and omit the line
275
+ * rather than let it mask the sync error (D40's degrade-by-omission model).
276
+ */
277
+ export function computeMethodologySize(manifest) {
278
+ const ops = planEmit(manifest);
279
+ const claudeRuleFiles = ops.filter((op) => op.kind === "owned" && op.target === "claude-code" && op.path.startsWith(".claude/rules/"));
280
+ if (claudeRuleFiles.length > 0) {
281
+ return {
282
+ totalLines: claudeRuleFiles.reduce((sum, op) => sum + countLines(op.content), 0),
283
+ fileCount: claudeRuleFiles.length,
284
+ };
285
+ }
286
+ const agentsBlock = ops.find((op) => op.kind === "block" && op.target === "agents-md");
287
+ if (agentsBlock) {
288
+ const blocks = Object.values(agentsBlock.blocks);
289
+ return {
290
+ totalLines: blocks.reduce((sum, content) => sum + countLines(content), 0),
291
+ fileCount: blocks.length,
292
+ };
293
+ }
294
+ return { totalLines: 0, fileCount: 0 };
295
+ }
251
296
  /** Apply one emit op against the destination file's existing text (pure; no I/O).
252
297
  * Owned files are replaced wholesale; block files are reconciled; settings ops
253
298
  * reconcile permissions and/or plugins in one pass over the same JSON file. */
package/dist/emit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"emit.js","sourceRoot":"","sources":["../src/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE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C,MAAM,CAAC,CAAC;QACjD,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACzE,SAAS,EAAE,MAAM,CAAC,MAAM;SACzB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AACzC,CAAC;AAWD;;gFAEgF;AAChF,MAAM,UAAU,OAAO,CAAC,EAAU,EAAE,QAAQ,GAAG,EAAE;IAC/C,IAAI,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC/E,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAoB,EAAE,CAAC;QACpC,IAAI,EAAE,CAAC,KAAK;YAAE,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC,KAAK,CAAC;QAC7C,IAAI,EAAE,CAAC,OAAO;YAAE,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;QAC7C,OAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC"}
@@ -10,8 +10,8 @@ export declare const packageManifestSchema: z.ZodObject<{
10
10
  external: "external";
11
11
  }>;
12
12
  provides: z.ZodArray<z.ZodEnum<{
13
- rules: "rules";
14
13
  permissions: "permissions";
14
+ rules: "rules";
15
15
  commands: "commands";
16
16
  plugins: "plugins";
17
17
  }>>;
package/dist/program.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Command } from "commander";
2
2
  import { type AnchorCheckReport } from "./anchors.js";
3
+ import { type MethodologySize } from "./emit.js";
3
4
  import { type SyncReport } from "./sync.js";
4
5
  /** This CLI's own version, read from its shipped package.json (falls back to "unknown"). */
5
6
  export declare function praxisVersion(): string;
@@ -10,6 +11,10 @@ export interface ReconcileResult {
10
11
  syncError?: string;
11
12
  /** Present only in check mode. */
12
13
  anchorReport?: AnchorCheckReport;
14
+ /** Present only in check mode, and only when the manifest resolves (D40's
15
+ * degrade-by-omission model — this line is manifest-dependent, unlike the
16
+ * anchor tripwire). */
17
+ methodologySize?: MethodologySize;
13
18
  exitCode: number;
14
19
  }
15
20
  /**
package/dist/program.js CHANGED
@@ -4,8 +4,9 @@ import { fileURLToPath } from "node:url";
4
4
  import { cancel, confirm, intro, isCancel, multiselect, note, outro, select } from "@clack/prompts";
5
5
  import { Command } from "commander";
6
6
  import { checkAnchors } from "./anchors.js";
7
+ import { computeMethodologySize } from "./emit.js";
7
8
  import { applyInit, defaultManifest, detectContext, manifestFromSelections, renderManifestYaml, } from "./init.js";
8
- import { STACKS } from "./manifest.js";
9
+ import { loadManifest, STACKS } from "./manifest.js";
9
10
  import { availablePackages } from "./packages.js";
10
11
  import { applyManifest, runSync } from "./sync.js";
11
12
  /**
@@ -17,6 +18,7 @@ const STATUS_SYMBOL = {
17
18
  created: "+",
18
19
  updated: "~",
19
20
  unchanged: " ",
21
+ deleted: "-",
20
22
  };
21
23
  function formatPlan(report, mode) {
22
24
  return report.files
@@ -78,12 +80,23 @@ export function reconcile(cwd, write, mode) {
78
80
  exitCode = 1;
79
81
  }
80
82
  let anchorReport;
83
+ let methodologySize;
81
84
  if (mode === "check") {
82
85
  anchorReport = checkAnchors(cwd);
83
86
  if (!anchorReport.ok)
84
87
  exitCode = 1;
88
+ // Advisory only (2026-07 product review §3 gap 5): report the always-loaded
89
+ // methodology surface size. Manifest-dependent, unlike the anchor tripwire
90
+ // above — if it can't resolve (the D40 scenario), omit the line rather than
91
+ // let this computation throw or mask the sync error already reported.
92
+ try {
93
+ methodologySize = computeMethodologySize(loadManifest(join(cwd, "praxis.yaml")));
94
+ }
95
+ catch {
96
+ // omitted — syncError (if any) already reports the unresolvable manifest.
97
+ }
85
98
  }
86
- return { version, syncReport, syncError, anchorReport, exitCode };
99
+ return { version, syncReport, syncError, anchorReport, methodologySize, exitCode };
87
100
  }
88
101
  function runReconcile(write, mode) {
89
102
  const result = reconcile(process.cwd(), write, mode);
@@ -108,6 +121,10 @@ function runReconcile(write, mode) {
108
121
  else
109
122
  console.error(output);
110
123
  }
124
+ if (result.methodologySize) {
125
+ const { totalLines, fileCount } = result.methodologySize;
126
+ console.log(`Methodology size: ${totalLines} lines across ${fileCount} always-loaded rule files.`);
127
+ }
111
128
  if (result.exitCode !== 0)
112
129
  process.exitCode = result.exitCode;
113
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAA0B,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAA0C,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,OA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destination file, and (in write mode) persist safe
6
6
  * changes. Never clobbers a user-edited managed block (D10) — conflicts are
7
7
  * surfaced, not overwritten.
8
+ *
9
+ * **Prune (D46):** the manifest expresses absence too — a package removed from
10
+ * `praxis.yaml` orphans the files/blocks it used to emit. No separate ownership
11
+ * ledger is needed: ownership is already legible on disk (the `praxis-` file
12
+ * prefix; the `<!-- praxis:begin <id> -->` block markers), so prune is simply
13
+ * (on-disk Praxis-owned set) − (manifest-implied set), previewed the same way as
14
+ * any other change and applied only in write mode.
8
15
  */
9
- export type FileStatus = "created" | "updated" | "unchanged";
16
+ export type FileStatus = "created" | "updated" | "unchanged" | "deleted";
10
17
  export interface FileReport {
11
18
  path: string;
12
19
  status: FileStatus;
package/dist/sync.js CHANGED
@@ -1,7 +1,8 @@
1
- import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
1
+ import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import { applyOp, planEmit } from "./emit.js";
3
+ import { applyOp, BLOCK_FILE, planEmit } from "./emit.js";
4
4
  import { loadManifest } from "./manifest.js";
5
+ import { blockStatus, findBlocks } from "./merge.js";
5
6
  export function runSync(opts) {
6
7
  const manifestPath = opts.manifestPath ?? join(opts.cwd, "praxis.yaml");
7
8
  return applyManifest(loadManifest(manifestPath), opts.cwd, opts.write);
@@ -14,19 +15,68 @@ export function runSync(opts) {
14
15
  export function applyManifest(manifest, cwd, write) {
15
16
  const ops = planEmit(manifest);
16
17
  const files = [];
18
+ const handledPaths = new Set();
17
19
  for (const op of ops) {
20
+ handledPaths.add(op.path);
18
21
  const abs = join(cwd, op.path);
19
22
  const existing = readFileIfExists(abs);
20
23
  const result = applyOp(op, existing ?? "");
21
- const status = existing === undefined ? "created" : result.changed ? "updated" : "unchanged";
22
- // Write safe changes only: never in check mode, never a pure no-op. result.text
24
+ let text = result.text;
25
+ let changed = result.changed;
26
+ let conflicts = result.conflicts;
27
+ // Prune orphan blocks in the same pass: a block-target file (e.g. AGENTS.md)
28
+ // may still carry a managed block for a package the manifest no longer
29
+ // selects. Splice those out of the already-reconciled text so the file
30
+ // report and the single write below cover both concerns together.
31
+ if (op.kind === "block") {
32
+ const pruned = pruneOrphanBlocks(text, new Set(Object.keys(op.blocks)));
33
+ text = pruned.text;
34
+ changed = changed || pruned.changed;
35
+ conflicts = [...conflicts, ...pruned.conflicts];
36
+ }
37
+ const status = existing === undefined ? "created" : changed ? "updated" : "unchanged";
38
+ // Write safe changes only: never in check mode, never a pure no-op. `text`
23
39
  // already preserves any conflicted block, so writing it honors D10.
24
- const written = write && (status === "created" || (status === "updated" && result.changed));
40
+ const written = write && (status === "created" || status === "updated");
25
41
  if (written) {
26
42
  mkdirSync(dirname(abs), { recursive: true });
27
- writeFileSync(abs, result.text, "utf8");
43
+ writeFileSync(abs, text, "utf8");
28
44
  }
29
- files.push({ path: op.path, status, conflicts: result.conflicts, written });
45
+ files.push({ path: op.path, status, conflicts, written });
46
+ }
47
+ // Block orphans in a file the manifest no longer emits ANY block for (e.g. the
48
+ // last rules package for a target was removed): no "block" op exists this run
49
+ // to carry the pruning above, so sweep the known block-owned files directly.
50
+ for (const path of new Set(Object.values(BLOCK_FILE))) {
51
+ if (handledPaths.has(path))
52
+ continue;
53
+ const abs = join(cwd, path);
54
+ const existing = readFileIfExists(abs);
55
+ if (existing === undefined)
56
+ continue;
57
+ const pruned = pruneOrphanBlocks(existing, new Set());
58
+ if (!pruned.changed && pruned.conflicts.length === 0)
59
+ continue;
60
+ const written = write && pruned.changed;
61
+ if (written)
62
+ writeFileSync(abs, pruned.text, "utf8");
63
+ files.push({
64
+ path,
65
+ status: pruned.changed ? "updated" : "unchanged",
66
+ conflicts: pruned.conflicts,
67
+ written,
68
+ });
69
+ }
70
+ // Owned-file orphans: `.claude/rules/praxis-*.md` / `.claude/commands/praxis-*.md`
71
+ // on disk that the current manifest no longer implies (the package that used to
72
+ // own them was removed, or its target was). The `praxis-` prefix is the
73
+ // ownership convention; a user's own file with that prefix would be flagged too
74
+ // — acceptable because deletion is always previewed here, never silent.
75
+ const impliedOwnedPaths = new Set(ops.filter((op) => op.kind === "owned").map((op) => op.path));
76
+ for (const path of findOwnedOrphans(cwd, impliedOwnedPaths)) {
77
+ if (write)
78
+ unlinkSync(join(cwd, path));
79
+ files.push({ path, status: "deleted", conflicts: [], written: write });
30
80
  }
31
81
  return {
32
82
  files,
@@ -42,4 +92,61 @@ function readFileIfExists(path) {
42
92
  return undefined;
43
93
  }
44
94
  }
95
+ // Directories whose contents are Praxis-owned by naming convention alone — see
96
+ // `planEmit` in src/emit.ts, which only ever writes `praxis-*.md` under these two.
97
+ const OWNED_ORPHAN_DIRS = [".claude/rules", ".claude/commands"];
98
+ /** Praxis-owned files on disk (by the `praxis-` prefix convention) whose path is
99
+ * not in `impliedPaths` — the current manifest no longer emits them. */
100
+ function findOwnedOrphans(cwd, impliedPaths) {
101
+ const orphans = [];
102
+ for (const dir of OWNED_ORPHAN_DIRS) {
103
+ const abs = join(cwd, dir);
104
+ if (!existsSync(abs))
105
+ continue;
106
+ for (const entry of readdirSync(abs, { withFileTypes: true })) {
107
+ if (!entry.isFile() || !entry.name.startsWith("praxis-") || !entry.name.endsWith(".md"))
108
+ continue;
109
+ const path = `${dir}/${entry.name}`;
110
+ if (!impliedPaths.has(path))
111
+ orphans.push(path);
112
+ }
113
+ }
114
+ return orphans;
115
+ }
116
+ /** Remove one managed block (both markers + content) from `text`, absorbing the
117
+ * blank-line separator and trailing newline that `appendBlock` (src/merge.ts)
118
+ * introduces when a block is first added — so removing an orphan restores the
119
+ * surrounding prose to exactly what it was before the block ever existed. */
120
+ function spliceOutBlock(text, block) {
121
+ let start = block.start;
122
+ let end = block.end;
123
+ if (text.slice(end, end + 1) === "\n")
124
+ end += 1;
125
+ if (text.slice(Math.max(0, start - 2), start) === "\n\n")
126
+ start -= 1;
127
+ return text.slice(0, start) + text.slice(end);
128
+ }
129
+ /** Splice every managed block out of `text` whose id is not in `keepIds` — the
130
+ * block-file analogue of `findOwnedOrphans`. Mirrors `reconcile`'s conflict rule
131
+ * (D10): a block whose content hash no longer matches its recorded marker was
132
+ * user-edited, so it is reported as a conflict and left untouched, never deleted. */
133
+ function pruneOrphanBlocks(text, keepIds) {
134
+ let out = text;
135
+ let changed = false;
136
+ const conflicts = [];
137
+ const skip = new Set();
138
+ for (;;) {
139
+ const orphan = findBlocks(out).find((b) => !keepIds.has(b.id) && !skip.has(b.id));
140
+ if (!orphan)
141
+ break;
142
+ if (blockStatus(orphan) === "user-edited") {
143
+ conflicts.push(orphan.id);
144
+ skip.add(orphan.id);
145
+ continue;
146
+ }
147
+ out = spliceOutBlock(out, orphan);
148
+ changed = true;
149
+ }
150
+ return { text: out, changed, conflicts };
151
+ }
45
152
  //# sourceMappingURL=sync.js.map
package/dist/sync.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAiB,MAAM,eAAe,CAAC;AAoC5D,MAAM,UAAU,OAAO,CAAC,IAAiB;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACxE,OAAO,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAkB,EAAE,GAAW,EAAE,KAAc;IAC3E,MAAM,GAAG,GAAG,QAAQ,CAAC,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B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,SAAS,CAAC;QACR,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM;YAAE,MAAM;QACnB,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,aAAa,EAAE,CAAC;YAC1C,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACpB,SAAS;QACX,CAAC;QACD,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAClC,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aacombarro89/praxis",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "A CLI that installs an AI methodology layer into a codebase.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,26 +1,10 @@
1
1
  ## Instruction upkeep
2
2
 
3
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:
4
+ project changes. When it goes stale, incomplete, or a misunderstanding
5
+ surfaces, fix it — checking coverage against: build/test/run commands ·
6
+ layout · conventions · always-do rules.
6
7
 
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
- - If a *derived overview* like `README.md` exists, check it hasn't drifted from
17
- its canonical sources — being a restatement of them, it drifts by
18
- construction; reconcile it to the source rather than the reverse.
19
- - When instruction files include `praxisAnchors` frontmatter, keep those anchors
20
- resolving. `praxis check` hard-fails broken `path`, `command`, and `section`
21
- anchors; staleness signals are future advisory work.
22
- - Make instruction-layer changes through `/praxis-instructions`, not ad-hoc edits — run
23
- it when unsure whether the instruction files still match the project, or whether
24
- they cover the sections above. When this is part of reconciling the methodology
25
- layer after a change, enter through the `/praxis-upkeep` front gate (which
26
- delegates here) instead of running this pass alone.
8
+ Make changes through `/praxis-instructions`, not ad-hoc edits. When
9
+ reconciling the methodology layer after a change, enter through
10
+ `/praxis-upkeep` (which delegates here) instead of running this pass alone.
@@ -1,14 +1,10 @@
1
1
  ## First-run onboarding
2
2
 
3
3
  At the start of work, check for the `.praxis-setup-pending` sentinel file in
4
- the repo root. Its presence means this is a fresh Praxis install and the
5
- project-owned sections of `CLAUDE.md` haven't been authored yet.
4
+ the repo root: present means a fresh Praxis install whose project-owned
5
+ `CLAUDE.md` sections aren't authored yet.
6
6
 
7
- - **If the sentinel is present:** offer to run `/praxis-onboard`. Once the
8
- skill completes it deletes the sentinel — making this check one-shot and
9
- self-terminating. Never nag when the sentinel is absent.
10
- - **If the sentinel is absent:** do nothing here. The ongoing front gate
11
- (`/praxis-upkeep`) handles currency after initial setup.
12
-
13
- Cross-references: `/praxis-onboard` (first-run front gate),
14
- `/praxis-upkeep` (ongoing front gate — D29/D31, [onboarding](../../../docs/wiki/onboarding.md)).
7
+ - **Present:** offer to run `/praxis-onboard`; it deletes the sentinel on
8
+ completion, making this check one-shot. Never nag when absent.
9
+ - **Absent:** do nothing here `/praxis-upkeep` (ongoing front gate, D29/D31)
10
+ handles currency after initial setup.
@@ -1,62 +1,15 @@
1
1
  ## Session handoff
2
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.
3
+ Work outlives a single session: at a natural boundary in a verified state —
4
+ never mid-edit capture context before it's lost. Write handoffs by running
5
+ `/praxis-handoff`, not by hand; it's the next session's only briefing.
21
6
 
22
7
  ## Delegated execution
23
8
 
24
- A handoff brief is not only for the *next* session it is also the briefing an
25
- execution agent needs to do scoped work *now*. The reason to delegate is to keep
26
- in the orchestrator's context only what it needs — the *result*, not the
27
- execution detail and to match each piece of work to the cheapest tier that can
28
- do it. Delegate when that holds; do the work inline when it doesn't.
29
-
30
- - Delegate when you need the result, not the detail. Two triggers, often
31
- combined — **neither requires parallelism**:
32
- - *Independent workstreams* — parts specifiable up front and runnable without
33
- coordination mid-flight (concurrently, where the tool allows). If two parts
34
- must talk constantly, they are one workstream.
35
- - *Context or budget isolation* — a context-heavy or mechanical run (a wide
36
- refactor, a multi-step migration, a long grind) worth executing in an
37
- execution agent's *own* context window, on a lighter/faster tier, so the
38
- orchestrator's context stays clean. This holds for a *single sequential*
39
- stream: size and cost justify delegating on their own.
40
- - Name the split at plan time. When a plan's steps form independent or
41
- context-heavy workstreams, surface the delegation split *as part of the plan* —
42
- what each execution agent runs and how its result returns — rather than only
43
- deciding to delegate mid-execution.
44
- - Brief each workstream as a self-contained context cache — the same discipline
45
- as a handoff. An execution agent starts cold: give it the load-bearing files
46
- (`path:line`), the prior art to mirror, the exact build/test commands, and a
47
- crisp success/verify criterion. A vague brief gets vague work back.
48
- - Keep the tiers to their jobs. The orchestrator plans, decomposes, verifies, and
49
- integrates; execution agents do bounded, fully-specified work and return the
50
- result, not the intermediate detail. Match the tier to the work — execution
51
- agents can be lighter/faster than the orchestrator. (Stated by role, not by
52
- model name, so it survives model releases.)
53
- - Verify on return; trust nothing unread. Each returned workstream is checked
54
- against its stated success criterion (build, tests, a read of the diff) before
55
- it is integrated — the orchestrator owns correctness of the whole.
56
- - Produce the briefs with `/praxis-handoff` (run it per workstream), not by hand,
57
- so each is self-contained. Dispatch a subagent per brief where the tool
58
- supports subagents; where it does not, run the briefs inline in sequence or
59
- hand them to a fresh session — same brief, different venue.
60
- - Use judgment on whether to delegate at all. It pays off for multi-workstream or
61
- context-heavy work; for a small single-thread change the briefing cost exceeds
62
- the savings — just do it inline.
9
+ Delegate when you need the result, not the execution detail. Two triggers,
10
+ neither requiring parallelism: **independent workstreams** (specifiable up
11
+ front, no mid-flight coordination) and **context/budget isolation** (a
12
+ context-heavy or mechanical run worth its own context and a lighter tier
13
+ holds even for one sequential stream). Name the split at plan time. Produce
14
+ each brief with `/praxis-handoff`, not by hand, and verify a returned
15
+ workstream against its success criterion before integrating it.
@@ -1,18 +1,11 @@
1
1
  ## Upkeep
2
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-instructions` (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.
3
+ The methodology layer (instructions, wiki, emitted `.claude/` files) drifts
4
+ from project reality like code drifts from docs. When work reveals drift, or
5
+ produces new durable knowledge to file, run `/praxis-upkeep` the single
6
+ front gate sequencing `praxis check`, `/praxis-instructions`, and
7
+ `/praxis-wiki` rather than fixing it ad hoc or piecemeal.
13
8
 
14
- Run all three passes through the gate even when only one looks like it has work.
15
- The gate exists so you do not pre-decide which passes are needed the irrelevant
16
- ones no-op cheaply, and skipping straight to a sub-skill because the others "look
17
- like no-ops" is exactly the piecemeal use this rule prevents (it is how a pass
18
- that did have work gets silently skipped).
9
+ Run all three passes through the gate even when only one looks like it has
10
+ work skipping straight to a sub-skill is the piecemeal use this rule
11
+ prevents.
@@ -1,52 +1,14 @@
1
1
  ## Wiki memory
2
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.
3
+ Knowledge outlives a single conversation. Keep a durable, in-repo knowledge
4
+ wiki linked markdown pages a future session reads instead of re-deriving —
5
+ distinct from a handoff (transient) and from `CLAUDE.md`/`.claude/rules`
6
+ (authored instructions). At the start of a task, read the wiki's `index.md`
7
+ and follow the links that bear on the work.
9
8
 
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. When the wiki pass is part of reconciling the methodology layer
50
- after a change, enter through the `/praxis-upkeep` front gate (which delegates
51
- here) instead of running it alone; call `/praxis-wiki` directly only for a
52
- deliberate single pass, e.g. first-run bootstrap.
9
+ When you learn something durable an architecture fact, a gotcha, a decision,
10
+ a workflow file or update it, and periodically lint the wiki for
11
+ contradictions and staleness. Do this by running `/praxis-wiki`, not by hand.
12
+ When reconciling the methodology layer after a change, enter through
13
+ `/praxis-upkeep`; call `/praxis-wiki` directly only for a deliberate single
14
+ pass (e.g. first-run bootstrap).
@@ -8,6 +8,10 @@ Stack-specific craft for TypeScript/Node code. These say *how to add something
8
8
  well in this stack*; the concrete shape lives in this repo's own prior art, not
9
9
  here. Find the nearest existing example and mirror it.
10
10
 
11
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
12
+ goal-driven execution) apply unchanged — this file adds only what is
13
+ Node-specific.
14
+
11
15
  - **Mirror the nearest module.** Before adding a feature, open the closest
12
16
  existing file that already does the same kind of thing (a sibling in the same
13
17
  directory, an adjacent route/command/service). Copy its structure — imports,
@@ -25,9 +29,6 @@ here. Find the nearest existing example and mirror it.
25
29
  validate external/untrusted input where it enters (a schema validator if the
26
30
  repo already uses one, e.g. zod). Don't re-validate data already typed and
27
31
  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
32
  - **ESM vs CJS, follow the repo.** Match the module system, import extensions
32
33
  (`.js` specifiers under `"type": "module"`), and `tsconfig` target already in
33
34
  use — don't introduce a second convention.
@@ -8,6 +8,10 @@ Choosing *where* a test belongs matters as much as writing it. Pick the layer
8
8
  that fails for the right reason, and mirror the repo's existing tests of that
9
9
  kind for structure and fixtures.
10
10
 
11
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
12
+ goal-driven execution) apply unchanged — this file adds only what is
13
+ Node-testing-specific.
14
+
11
15
  - **Harness before features.** A rule that matters has a test. Write (or extend)
12
16
  the test that pins the new behaviour *before or with* the code that satisfies
13
17
  it — never land logic whose only check is "it looked right". Make the failing
@@ -8,6 +8,10 @@ Stack-specific craft for Python backend code. These say *how to add something
8
8
  well in this stack*; the concrete shape lives in this repo's own prior art, not
9
9
  here. Find the nearest existing module and mirror it.
10
10
 
11
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
12
+ goal-driven execution) apply unchanged — this file adds only what is
13
+ Python-specific.
14
+
11
15
  - **Mirror the nearest module.** Before adding a feature, open the closest
12
16
  existing file that already does the same kind of thing (a sibling in the same
13
17
  directory, an adjacent route/handler/service). Copy its structure — imports,
@@ -27,10 +31,6 @@ here. Find the nearest existing module and mirror it.
27
31
  boundaries; validate external/untrusted input where it enters (a schema
28
32
  validator if the repo already uses one, e.g. pydantic). Don't re-validate data
29
33
  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
34
  - **Follow the repo's packaging conventions.** Match the module layout, import
35
35
  style (absolute vs relative), and packaging already in use — don't introduce a
36
36
  second convention. If the project uses `src/` layout, honour it; if it uses
@@ -8,6 +8,10 @@ Choosing *where* a test belongs matters as much as writing it. Pick the layer
8
8
  that fails for the right reason, and mirror the repo's existing tests of that
9
9
  kind for structure and fixtures.
10
10
 
11
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
12
+ goal-driven execution) apply unchanged — this file adds only what is
13
+ Python-testing-specific.
14
+
11
15
  - **Harness before features.** A rule that matters has a test. Write (or extend)
12
16
  the test that pins the new behaviour *before or with* the code that satisfies
13
17
  it — never land logic whose only check is "it looked right". Make the failing
@@ -9,6 +9,10 @@ module shape, surgical change) lives in `node-recipes` — this file covers only
9
9
  what is React-specific. The concrete shape lives in this repo's own prior art,
10
10
  not here. Find the nearest existing component and mirror it.
11
11
 
12
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
13
+ goal-driven execution) apply unchanged — this file adds only what is
14
+ React-specific.
15
+
12
16
  - **Mirror the nearest component.** Before adding a component, open the closest
13
17
  existing one that does the same kind of thing (a sibling in the same directory
14
18
  or feature folder). Copy its structure — file layout, how it exports, how it
@@ -8,6 +8,10 @@ Choosing *where* a test belongs matters as much as writing it. Pick the layer
8
8
  that fails for the right reason, and mirror the repo's existing tests of that
9
9
  kind for structure and setup.
10
10
 
11
+ Layer 1 rules (think before coding, simplicity first, surgical changes,
12
+ goal-driven execution) apply unchanged — this file adds only what is
13
+ React-testing-specific.
14
+
11
15
  - **Test behaviour, not implementation.** Query by roles and user-visible text
12
16
  (`getByRole`, `getByLabelText`, `getByText`) — not by CSS class, component
13
17
  display name, or internal state. A test that breaks on a classname rename