@aacombarro89/praxis 0.1.8 → 0.1.10
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 +26 -19
- package/dist/codex-marketplace.d.ts +19 -0
- package/dist/codex-marketplace.js +113 -0
- package/dist/codex-marketplace.js.map +1 -0
- package/dist/codex-security.d.ts +11 -0
- package/dist/codex-security.js +144 -0
- package/dist/codex-security.js.map +1 -0
- package/dist/emit.d.ts +24 -10
- package/dist/emit.js +149 -70
- package/dist/emit.js.map +1 -1
- package/dist/init.d.ts +16 -6
- package/dist/init.js +47 -10
- package/dist/init.js.map +1 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +1 -1
- package/dist/packages.d.ts +20 -2
- package/dist/packages.js +54 -5
- package/dist/packages.js.map +1 -1
- package/dist/permissions.d.ts +17 -2
- package/dist/permissions.js +5 -14
- package/dist/permissions.js.map +1 -1
- package/dist/plugins.d.ts +16 -2
- package/dist/plugins.js +15 -15
- package/dist/plugins.js.map +1 -1
- package/dist/program.d.ts +3 -0
- package/dist/program.js +77 -31
- package/dist/program.js.map +1 -1
- package/dist/shared-instructions.d.ts +21 -0
- package/dist/shared-instructions.js +63 -0
- package/dist/shared-instructions.js.map +1 -0
- package/dist/sync.js +103 -7
- package/dist/sync.js.map +1 -1
- package/package.json +1 -1
- package/packages/external/ponytail/plugins.yaml +4 -1
- package/packages/layer1/capture-codebase-patterns/commands/capture-codebase-patterns.md +68 -0
- package/packages/layer1/capture-codebase-patterns/package.yaml +14 -0
- package/packages/layer1/instruction-upkeep/commands/instructions.md +14 -5
- package/packages/layer1/instruction-upkeep/rules.md +7 -3
- package/packages/layer1/onboarding/commands/onboard.md +42 -24
- package/packages/layer1/onboarding/rules.md +4 -4
- package/packages/layer1/safe-permissions/permissions.yaml +2 -2
- package/packages/layer1/session-handoff/commands/handoff.md +5 -5
- package/packages/layer1/session-handoff/rules.md +2 -2
- package/packages/layer1/upkeep/commands/upkeep.md +8 -5
- package/packages/layer1/upkeep/rules.md +8 -4
- package/packages/layer1/wiki-memory/commands/wiki.md +6 -6
- package/packages/layer1/wiki-memory/rules.md +4 -4
- package/packages/layer2/node-recipes/rules.md +18 -19
- package/packages/layer2/node-testing/rules.md +21 -26
- package/packages/layer2/python-backend-recipes/rules.md +18 -22
- package/packages/layer2/python-testing/rules.md +20 -26
- package/packages/layer2/react-components/rules.md +31 -26
- package/packages/layer2/react-testing/rules.md +19 -28
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Manifest } from "./manifest.js";
|
|
2
|
+
/**
|
|
3
|
+
* Project-owned instructions shared by Claude Code and Codex. Unlike managed
|
|
4
|
+
* methodology blocks, these blocks carry no hash and have no generated source:
|
|
5
|
+
* both native files remain complete and editable if Praxis is removed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SHARED_PROJECT_BEGIN = "<!-- praxis:shared-project begin -->";
|
|
8
|
+
export declare const SHARED_PROJECT_END = "<!-- praxis:shared-project end -->";
|
|
9
|
+
export type SharedInstructionStatus = "not-required" | "pending-onboarding" | "missing" | "mismatch" | "synchronized";
|
|
10
|
+
export interface SharedInstructionReport {
|
|
11
|
+
status: SharedInstructionStatus;
|
|
12
|
+
ok: boolean;
|
|
13
|
+
diagnostics: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function hasSharedProjectBlock(text: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check the peer-native project instruction contract. Only a dual first-class
|
|
18
|
+
* Claude+Codex install requires parity. The onboarding sentinel temporarily
|
|
19
|
+
* suspends the requirement while the agent is authoring both native surfaces.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkSharedInstructions(cwd: string, manifest: Manifest): SharedInstructionReport;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Project-owned instructions shared by Claude Code and Codex. Unlike managed
|
|
5
|
+
* methodology blocks, these blocks carry no hash and have no generated source:
|
|
6
|
+
* both native files remain complete and editable if Praxis is removed.
|
|
7
|
+
*/
|
|
8
|
+
export const SHARED_PROJECT_BEGIN = "<!-- praxis:shared-project begin -->";
|
|
9
|
+
export const SHARED_PROJECT_END = "<!-- praxis:shared-project end -->";
|
|
10
|
+
const SHARED_PROJECT_RE = /<!--\s*praxis:shared-project\s+begin\s*-->[^\n]*\r?\n([\s\S]*?)\r?\n?<!--\s*praxis:shared-project\s+end\s*-->/g;
|
|
11
|
+
function blockContents(text) {
|
|
12
|
+
const contents = [];
|
|
13
|
+
SHARED_PROJECT_RE.lastIndex = 0;
|
|
14
|
+
let match;
|
|
15
|
+
while ((match = SHARED_PROJECT_RE.exec(text)) !== null) {
|
|
16
|
+
contents.push((match[1] ?? "").replaceAll("\r\n", "\n"));
|
|
17
|
+
}
|
|
18
|
+
return contents;
|
|
19
|
+
}
|
|
20
|
+
export function hasSharedProjectBlock(text) {
|
|
21
|
+
return blockContents(text).length === 1;
|
|
22
|
+
}
|
|
23
|
+
function readIfExists(path) {
|
|
24
|
+
return existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check the peer-native project instruction contract. Only a dual first-class
|
|
28
|
+
* Claude+Codex install requires parity. The onboarding sentinel temporarily
|
|
29
|
+
* suspends the requirement while the agent is authoring both native surfaces.
|
|
30
|
+
*/
|
|
31
|
+
export function checkSharedInstructions(cwd, manifest) {
|
|
32
|
+
if (!(manifest.targets.includes("claude-code") && manifest.targets.includes("codex"))) {
|
|
33
|
+
return { status: "not-required", ok: true, diagnostics: [] };
|
|
34
|
+
}
|
|
35
|
+
if (existsSync(join(cwd, ".praxis-setup-pending"))) {
|
|
36
|
+
return { status: "pending-onboarding", ok: true, diagnostics: [] };
|
|
37
|
+
}
|
|
38
|
+
const files = ["CLAUDE.md", "AGENTS.md"];
|
|
39
|
+
const blocks = new Map(files.map((file) => [file, blockContents(readIfExists(join(cwd, file)))]));
|
|
40
|
+
const diagnostics = [];
|
|
41
|
+
for (const file of files) {
|
|
42
|
+
const count = blocks.get(file)?.length ?? 0;
|
|
43
|
+
if (count === 0)
|
|
44
|
+
diagnostics.push(`${file}: missing project-owned praxis:shared-project block`);
|
|
45
|
+
if (count > 1)
|
|
46
|
+
diagnostics.push(`${file}: expected one praxis:shared-project block, found ${count}`);
|
|
47
|
+
}
|
|
48
|
+
if (diagnostics.length > 0)
|
|
49
|
+
return { status: "missing", ok: false, diagnostics };
|
|
50
|
+
const claude = blocks.get("CLAUDE.md")?.[0] ?? "";
|
|
51
|
+
const agents = blocks.get("AGENTS.md")?.[0] ?? "";
|
|
52
|
+
if (claude !== agents) {
|
|
53
|
+
return {
|
|
54
|
+
status: "mismatch",
|
|
55
|
+
ok: false,
|
|
56
|
+
diagnostics: [
|
|
57
|
+
"CLAUDE.md and AGENTS.md shared project blocks differ; run the Praxis upkeep workflow to reconcile project-owned facts",
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return { status: "synchronized", ok: true, diagnostics: [] };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=shared-instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-instructions.js","sourceRoot":"","sources":["../src/shared-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sCAAsC,CAAC;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,oCAAoC,CAAC;AAEvE,MAAM,iBAAiB,GACrB,gHAAgH,CAAC;AAenH,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,iBAAiB,CAAC,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readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { applyOp, BLOCK_FILE, planEmit } from "./emit.js";
|
|
4
4
|
import { loadManifest } from "./manifest.js";
|
|
5
5
|
import { blockStatus, findBlocks } from "./merge.js";
|
|
6
|
+
import { reconcileCodexConfig } from "./codex-security.js";
|
|
7
|
+
import { CODEX_MARKETPLACE_PATH, CODEX_MARKETPLACE_STATE_PATH, reconcileCodexMarketplace, } from "./codex-marketplace.js";
|
|
6
8
|
export function runSync(opts) {
|
|
7
9
|
const manifestPath = opts.manifestPath ?? join(opts.cwd, "praxis.yaml");
|
|
8
10
|
return applyManifest(loadManifest(manifestPath), opts.cwd, opts.write);
|
|
@@ -13,11 +15,33 @@ export function runSync(opts) {
|
|
|
13
15
|
* the emit before `praxis.yaml` exists.
|
|
14
16
|
*/
|
|
15
17
|
export function applyManifest(manifest, cwd, write) {
|
|
16
|
-
const ops = planEmit(manifest);
|
|
18
|
+
const ops = planEmit(manifest, cwd);
|
|
17
19
|
const files = [];
|
|
18
20
|
const handledPaths = new Set();
|
|
19
21
|
for (const op of ops) {
|
|
20
22
|
handledPaths.add(op.path);
|
|
23
|
+
if (op.kind === "codex-marketplace") {
|
|
24
|
+
handledPaths.add(op.statePath);
|
|
25
|
+
const marketplaceAbs = join(cwd, op.path);
|
|
26
|
+
const stateAbs = join(cwd, op.statePath);
|
|
27
|
+
const marketplaceExisting = readFileIfExists(marketplaceAbs) ?? "";
|
|
28
|
+
const stateExisting = readFileIfExists(stateAbs) ?? "";
|
|
29
|
+
const result = reconcileCodexMarketplace(marketplaceExisting, stateExisting, op.plugins);
|
|
30
|
+
for (const output of [
|
|
31
|
+
{ path: op.path, abs: marketplaceAbs, existing: marketplaceExisting, text: result.marketplaceText, changed: result.marketplaceChanged, conflicts: result.conflicts },
|
|
32
|
+
{ path: op.statePath, abs: stateAbs, existing: stateExisting, text: result.stateText, changed: result.stateChanged, conflicts: [] },
|
|
33
|
+
]) {
|
|
34
|
+
const existed = existsSync(output.abs);
|
|
35
|
+
const status = !existed ? "created" : output.changed ? "updated" : "unchanged";
|
|
36
|
+
const written = write && output.changed;
|
|
37
|
+
if (written) {
|
|
38
|
+
mkdirSync(dirname(output.abs), { recursive: true });
|
|
39
|
+
writeFileSync(output.abs, output.text, "utf8");
|
|
40
|
+
}
|
|
41
|
+
files.push({ path: output.path, status, conflicts: output.conflicts, written });
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
21
45
|
const abs = join(cwd, op.path);
|
|
22
46
|
const existing = readFileIfExists(abs);
|
|
23
47
|
const result = applyOp(op, existing ?? "");
|
|
@@ -67,6 +91,62 @@ export function applyManifest(manifest, cwd, write) {
|
|
|
67
91
|
written,
|
|
68
92
|
});
|
|
69
93
|
}
|
|
94
|
+
// A removed Codex permissions package/target removes only Praxis's protected
|
|
95
|
+
// TOML block; unrelated project configuration remains byte-for-byte intact.
|
|
96
|
+
const codexConfigPath = ".codex/config.toml";
|
|
97
|
+
if (!handledPaths.has(codexConfigPath)) {
|
|
98
|
+
const abs = join(cwd, codexConfigPath);
|
|
99
|
+
const existing = readFileIfExists(abs);
|
|
100
|
+
if (existing !== undefined) {
|
|
101
|
+
const result = reconcileCodexConfig(existing, false);
|
|
102
|
+
if (result.changed || result.conflicts.length > 0) {
|
|
103
|
+
const written = write && result.changed;
|
|
104
|
+
if (written)
|
|
105
|
+
writeFileSync(abs, result.text, "utf8");
|
|
106
|
+
files.push({
|
|
107
|
+
path: codexConfigPath,
|
|
108
|
+
status: result.changed ? "updated" : "unchanged",
|
|
109
|
+
conflicts: result.conflicts,
|
|
110
|
+
written,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Marketplace ownership lives in a committed sidecar. Without that state,
|
|
116
|
+
// removal is deliberately conservative: Praxis cannot prove an entry is its own.
|
|
117
|
+
if (!handledPaths.has(CODEX_MARKETPLACE_PATH)) {
|
|
118
|
+
const marketplaceAbs = join(cwd, CODEX_MARKETPLACE_PATH);
|
|
119
|
+
const stateAbs = join(cwd, CODEX_MARKETPLACE_STATE_PATH);
|
|
120
|
+
const marketplaceExisting = readFileIfExists(marketplaceAbs);
|
|
121
|
+
const stateExisting = readFileIfExists(stateAbs);
|
|
122
|
+
if (marketplaceExisting !== undefined && stateExisting !== undefined) {
|
|
123
|
+
const result = reconcileCodexMarketplace(marketplaceExisting, stateExisting, []);
|
|
124
|
+
for (const output of [
|
|
125
|
+
{ path: CODEX_MARKETPLACE_PATH, abs: marketplaceAbs, text: result.marketplaceText, changed: result.marketplaceChanged, conflicts: result.conflicts },
|
|
126
|
+
{ path: CODEX_MARKETPLACE_STATE_PATH, abs: stateAbs, text: result.stateText, changed: result.stateChanged, conflicts: [] },
|
|
127
|
+
]) {
|
|
128
|
+
if (!output.changed && output.conflicts.length === 0)
|
|
129
|
+
continue;
|
|
130
|
+
const written = write && output.changed;
|
|
131
|
+
if (written)
|
|
132
|
+
writeFileSync(output.abs, output.text, "utf8");
|
|
133
|
+
files.push({
|
|
134
|
+
path: output.path,
|
|
135
|
+
status: output.changed ? "updated" : "unchanged",
|
|
136
|
+
conflicts: output.conflicts,
|
|
137
|
+
written,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (stateExisting !== undefined) {
|
|
142
|
+
// marketplace.json is gone (hand-deleted or never re-created) but the
|
|
143
|
+
// Praxis-owned sidecar remains — it now describes nothing and would
|
|
144
|
+
// otherwise orphan forever. Prune it (D46: manifest expresses absence).
|
|
145
|
+
if (write)
|
|
146
|
+
unlinkSync(stateAbs);
|
|
147
|
+
files.push({ path: CODEX_MARKETPLACE_STATE_PATH, status: "deleted", conflicts: [], written: write });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
70
150
|
// Owned-file orphans: `.claude/rules/praxis-*.md` / `.claude/commands/praxis-*.md`
|
|
71
151
|
// on disk that the current manifest no longer implies (the package that used to
|
|
72
152
|
// own them was removed, or its target was). The `praxis-` prefix is the
|
|
@@ -74,8 +154,13 @@ export function applyManifest(manifest, cwd, write) {
|
|
|
74
154
|
// — acceptable because deletion is always previewed here, never silent.
|
|
75
155
|
const impliedOwnedPaths = new Set(ops.filter((op) => op.kind === "owned").map((op) => op.path));
|
|
76
156
|
for (const path of findOwnedOrphans(cwd, impliedOwnedPaths)) {
|
|
77
|
-
if (write)
|
|
78
|
-
|
|
157
|
+
if (write) {
|
|
158
|
+
const abs = join(cwd, path);
|
|
159
|
+
unlinkSync(abs);
|
|
160
|
+
const parent = dirname(abs);
|
|
161
|
+
if (path.startsWith(".agents/skills/") && readdirSync(parent).length === 0)
|
|
162
|
+
rmdirSync(parent);
|
|
163
|
+
}
|
|
79
164
|
files.push({ path, status: "deleted", conflicts: [], written: write });
|
|
80
165
|
}
|
|
81
166
|
return {
|
|
@@ -93,8 +178,8 @@ function readFileIfExists(path) {
|
|
|
93
178
|
}
|
|
94
179
|
}
|
|
95
180
|
// Directories whose contents are Praxis-owned by naming convention alone — see
|
|
96
|
-
// `planEmit` in src/emit.ts
|
|
97
|
-
const OWNED_ORPHAN_DIRS = [".claude/rules", ".claude/commands"];
|
|
181
|
+
// `planEmit` in src/emit.ts; files in these directories are owned by prefix.
|
|
182
|
+
const OWNED_ORPHAN_DIRS = [".claude/rules", ".claude/commands", ".codex/rules"];
|
|
98
183
|
/** Praxis-owned files on disk (by the `praxis-` prefix convention) whose path is
|
|
99
184
|
* not in `impliedPaths` — the current manifest no longer emits them. */
|
|
100
185
|
function findOwnedOrphans(cwd, impliedPaths) {
|
|
@@ -104,13 +189,24 @@ function findOwnedOrphans(cwd, impliedPaths) {
|
|
|
104
189
|
if (!existsSync(abs))
|
|
105
190
|
continue;
|
|
106
191
|
for (const entry of readdirSync(abs, { withFileTypes: true })) {
|
|
107
|
-
|
|
192
|
+
const suffix = dir === ".codex/rules" ? ".rules" : ".md";
|
|
193
|
+
if (!entry.isFile() || !entry.name.startsWith("praxis-") || !entry.name.endsWith(suffix))
|
|
108
194
|
continue;
|
|
109
195
|
const path = `${dir}/${entry.name}`;
|
|
110
196
|
if (!impliedPaths.has(path))
|
|
111
197
|
orphans.push(path);
|
|
112
198
|
}
|
|
113
199
|
}
|
|
200
|
+
const skillsDir = join(cwd, ".agents/skills");
|
|
201
|
+
if (existsSync(skillsDir)) {
|
|
202
|
+
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
203
|
+
if (!entry.isDirectory() || !entry.name.startsWith("praxis-"))
|
|
204
|
+
continue;
|
|
205
|
+
const path = `.agents/skills/${entry.name}/SKILL.md`;
|
|
206
|
+
if (existsSync(join(cwd, path)) && !impliedPaths.has(path))
|
|
207
|
+
orphans.push(path);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
114
210
|
return orphans;
|
|
115
211
|
}
|
|
116
212
|
/** Remove one managed block (both markers + content) from `text`, absorbing the
|
package/dist/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAe,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,YAAY,EAAiB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA2CrD,MAAM,UAAU,OAAO,CAAC,IAAiB;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG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AI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;;sFAGsF;AACtF,SAAS,iBAAiB,CACxB,IAAY,EACZ,OAA4B;IAE5B,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Praxis never executes anything here — this is committable config that Claude
|
|
3
3
|
# Code itself reads on folder-trust to offer installing/enabling the plugin.
|
|
4
4
|
# Verified against github.com/DietrichGebert/ponytail (tag v4.7.0 exists).
|
|
5
|
-
targets: [claude-code]
|
|
5
|
+
targets: [claude-code, codex]
|
|
6
6
|
marketplace:
|
|
7
7
|
name: ponytail
|
|
8
8
|
source:
|
|
@@ -11,3 +11,6 @@ marketplace:
|
|
|
11
11
|
ref: v4.7.0
|
|
12
12
|
enable:
|
|
13
13
|
- ponytail@ponytail
|
|
14
|
+
codex:
|
|
15
|
+
name: ponytail
|
|
16
|
+
category: Developer Tools
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Capture this team's own coding patterns from an exemplar module into a project-local Praxis package that rides praxis sync.
|
|
3
|
+
argument-hint: [optional-exemplar-path]
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash(git log:*), Bash(git diff:*), Bash(ls:*), Bash(mkdir:*), Write, Edit, Bash(npx @aacombarro89/praxis@latest sync:*), Bash(npx @aacombarro89/praxis@latest check:*), Bash(npx @aacombarro89/praxis sync:*), Bash(npx @aacombarro89/praxis check:*), Bash(praxis sync:*), Bash(praxis check:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Exemplar: {{arguments}} — if empty, propose candidates in step 2 rather than
|
|
8
|
+
picking silently.
|
|
9
|
+
|
|
10
|
+
Praxis never calls an LLM (D12) or authors project facts directly (D13). The
|
|
11
|
+
**agent** — you — extracts and authors every pattern below *with the user*;
|
|
12
|
+
Praxis's own CLI only resolves, emits, and syncs the package once it exists.
|
|
13
|
+
|
|
14
|
+
1. **Preflight.** Read `praxis.yaml` (`targets`, `stacks`, `packages`). If a
|
|
15
|
+
`./`-prefixed entry already resolves to a local patterns package (its
|
|
16
|
+
`package.yaml` under `praxis/packages/<name>/`), this is a refinement run:
|
|
17
|
+
read its `rules.md` and offer to update or extend it rather than create a
|
|
18
|
+
new one. State the framing above up front so the user knows what's about to
|
|
19
|
+
happen.
|
|
20
|
+
|
|
21
|
+
2. **Exemplar interview.** Ask the user to point at one to three modules or
|
|
22
|
+
directories that best show how code in this repo *should* look. If they
|
|
23
|
+
can't choose, propose candidates — central, recently and frequently touched
|
|
24
|
+
directories — and confirm before proceeding, never pick silently:
|
|
25
|
+
|
|
26
|
+
- Recently touched: {{shell:git log --oneline -20 2>/dev/null}}
|
|
27
|
+
- Frequently touched: {{shell:git log --pretty=format: --name-only -50 2>/dev/null | sort | uniq -c | sort -rn | head -20}}
|
|
28
|
+
|
|
29
|
+
3. **Extract candidates.** Read the exemplar(s), their immediate neighbors,
|
|
30
|
+
and their tests. Derive candidate patterns across this checklist: module
|
|
31
|
+
structure & naming, import/dependency habits, error handling,
|
|
32
|
+
typing/validation, IO-vs-logic separation, test shape & location,
|
|
33
|
+
comment/doc style. Every candidate cites concrete evidence — the file and
|
|
34
|
+
the shape in it that shows the pattern. Never propose a pattern the code
|
|
35
|
+
does not actually exhibit.
|
|
36
|
+
|
|
37
|
+
4. **Iterate.** Present candidates in small groups; the user accepts, rejects,
|
|
38
|
+
or refines each. When a candidate is a recognized anti-pattern, push back
|
|
39
|
+
once with rationale — what breaks, and when — then let the user decide; if
|
|
40
|
+
they keep it, record it plainly rather than silently dropping the pushback.
|
|
41
|
+
A convention enters the package only if it's verifiable in the exemplar or
|
|
42
|
+
explicitly confirmed by the user.
|
|
43
|
+
|
|
44
|
+
5. **Scaffold the local package.** Default to
|
|
45
|
+
`praxis/packages/codebase-patterns/`; confirm the name with the user
|
|
46
|
+
(kebab-case — the declared `name` must equal the directory basename, same
|
|
47
|
+
rule as a shipped package). Write:
|
|
48
|
+
|
|
49
|
+
- `package.yaml` — `name`, `layer: local`, `provides: [rules]`.
|
|
50
|
+
- `rules.md` — compact imperative bullets, each with a one-line why and an
|
|
51
|
+
exemplar pointer (`path` — what it shows). Aim under ~60 lines; this file
|
|
52
|
+
is always-loaded once installed, so keep it to what earns that cost. Use
|
|
53
|
+
`paths:` frontmatter only if the conventions are scoped to a subtree.
|
|
54
|
+
|
|
55
|
+
6. **Register.** Add `./praxis/packages/codebase-patterns` (or the confirmed
|
|
56
|
+
path) to the `packages:` list in `praxis.yaml`. Editing the manifest and
|
|
57
|
+
syncing is the only customization path — never write emitted files by hand.
|
|
58
|
+
|
|
59
|
+
7. **Sync + verify.** Run `praxis sync` if the CLI is on PATH, otherwise fall
|
|
60
|
+
back to `npx @aacombarro89/praxis@latest sync` (pin `@latest` — a bare
|
|
61
|
+
`npx @aacombarro89/praxis` can silently reuse a stale cached build). Then
|
|
62
|
+
run `praxis check` (or the `npx` equivalent) and fix anything it reports
|
|
63
|
+
before finishing.
|
|
64
|
+
|
|
65
|
+
8. **Report.** Summarize the conventions captured (with their exemplar
|
|
66
|
+
pointers), any candidates the user rejected and why, and note that this
|
|
67
|
+
command is re-runnable anytime to refine or extend the package as the
|
|
68
|
+
codebase evolves.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Package manifest (docs/wiki/packages-and-emit.md, D49). Commands-only: no rules.md,
|
|
2
|
+
# so this package is zero-cost between runs (nothing always-loaded). Ships the
|
|
3
|
+
# /praxis-capture-codebase-patterns command (commands/capture-codebase-patterns.md):
|
|
4
|
+
# the agent interviews the developer, extracts this team's OWN coding patterns from an
|
|
5
|
+
# exemplar module with cited evidence, iterates on candidates, and generates a
|
|
6
|
+
# project-local `codebase-patterns` package (layer: local, D49) that then rides normal
|
|
7
|
+
# `praxis sync`. Praxis never calls an LLM or authors project facts directly (D12/D13) —
|
|
8
|
+
# the agent authors the generated package's content, guided by this command.
|
|
9
|
+
name: capture-codebase-patterns
|
|
10
|
+
layer: layer1
|
|
11
|
+
provides: [commands]
|
|
12
|
+
onboarding:
|
|
13
|
+
command: praxis-capture-codebase-patterns
|
|
14
|
+
summary: "Capture this team's own coding patterns from an exemplar module into a project-local Praxis package that rides praxis sync."
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Keep the authored instruction files
|
|
2
|
+
description: Keep the project's authored agent instruction files current with its state and complete against the standard rubric.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Scope:
|
|
5
|
+
Scope: {{arguments}}
|
|
6
6
|
|
|
7
|
-
This updates the **authored instruction layer** —
|
|
8
|
-
|
|
7
|
+
This updates the **authored agent instruction layer** — project-owned prose in
|
|
8
|
+
the selected tool's instruction surfaces — not native auto-memory and not any 3rd-party
|
|
9
9
|
agent-memory system. Those are out of scope.
|
|
10
10
|
|
|
11
|
-
1. Read `
|
|
11
|
+
1. Read `praxis.yaml`, then read every project instruction surface selected by
|
|
12
|
+
its first-class targets (`CLAUDE.md` for Claude Code, `AGENTS.md` for Codex).
|
|
13
|
+
Identify any
|
|
12
14
|
canonical doc they point to (architecture doc, decision log, design doc).
|
|
13
15
|
2. Compare what the instruction files claim against that canonical doc and
|
|
14
16
|
against recent git history (`git log`, changed files) and the current
|
|
@@ -21,6 +23,11 @@ agent-memory system. Those are out of scope.
|
|
|
21
23
|
- always-do rules (the few non-negotiable habits)
|
|
22
24
|
|
|
23
25
|
Flag any rubric section that's entirely absent, citing where it should go.
|
|
26
|
+
When Claude Code and Codex are both selected, inspect the project-owned
|
|
27
|
+
`praxis:shared-project` block in both native files. Their contents must match
|
|
28
|
+
exactly (apart from line endings), while prose outside the blocks may differ.
|
|
29
|
+
Treat a missing, duplicate, or mismatched block reported by `praxis check` as
|
|
30
|
+
authored instruction drift — never choose one file as the automatic winner.
|
|
24
31
|
3. **Ask the user before editing anything.** Present the list from step 2 and
|
|
25
32
|
confirm which items to fix.
|
|
26
33
|
4. For approved items, update only project-owned sections of the instruction
|
|
@@ -28,6 +35,8 @@ agent-memory system. Those are out of scope.
|
|
|
28
35
|
code, or the user's answer. Where an instruction file currently restates a
|
|
29
36
|
fact that lives in a canonical doc, prefer replacing the restatement with a
|
|
30
37
|
link to that doc (reference, don't duplicate) so it can't drift again.
|
|
38
|
+
In a dual-target repo, apply approved shared-fact changes to both shared blocks
|
|
39
|
+
together and preserve all target-specific content outside them.
|
|
31
40
|
5. If an instruction file carries `praxisAnchors` frontmatter, revalidate and
|
|
32
41
|
update the anchors for any changed source reference. Phase-2 anchors are
|
|
33
42
|
deterministic only:
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
## Instruction upkeep
|
|
2
2
|
|
|
3
|
-
The authored instruction layer
|
|
3
|
+
The authored agent instruction layer drifts as a
|
|
4
4
|
project changes. When it goes stale, incomplete, or a misunderstanding
|
|
5
5
|
surfaces, fix it — checking coverage against: build/test/run commands ·
|
|
6
6
|
layout · conventions · always-do rules.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
When multiple first-class targets are selected, audit every native project
|
|
9
|
+
instruction surface. Shared project sections must remain consistent; native
|
|
10
|
+
target-specific sections may differ.
|
|
11
|
+
|
|
12
|
+
Make changes through `{{workflow:praxis-instructions}}`, not ad-hoc edits. When
|
|
9
13
|
reconciling the methodology layer after a change, enter through
|
|
10
|
-
|
|
14
|
+
`{{workflow:praxis-upkeep}}` (which delegates here) instead of running this pass alone.
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Author
|
|
2
|
+
description: Author project-owned agent instructions for a fresh Praxis install—build/run/test commands, layout, conventions, and always-do rules. One-shot: deletes .praxis-setup-pending when done.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Scope:
|
|
5
|
+
Scope: {{arguments}}
|
|
6
6
|
|
|
7
7
|
This is the **first-run front gate** — the single entry point for a fresh Praxis
|
|
8
|
-
install, symmetric to
|
|
9
|
-
**project-owned**
|
|
10
|
-
packages, then hands off to
|
|
8
|
+
install, symmetric to `{{workflow:praxis-upkeep}}` (the ongoing front gate). It authors
|
|
9
|
+
the **project-owned** agent instructions, then seeds the installed methodology
|
|
10
|
+
packages, then hands off to `{{workflow:praxis-upkeep}}` so the full baseline is established
|
|
11
11
|
in one pass.
|
|
12
12
|
|
|
13
|
-
Praxis never calls an LLM (D12)
|
|
13
|
+
Praxis never calls an LLM (D12) or authors project facts directly (D13). The
|
|
14
14
|
**agent** writes the facts, guided by the steps below, asking the user for
|
|
15
15
|
anything it cannot infer.
|
|
16
16
|
|
|
17
|
-
1. **
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
1. **Choose the project instruction surfaces from `praxis.yaml`.** For a Codex-only
|
|
18
|
+
install, author project facts as free prose outside managed blocks in `AGENTS.md`.
|
|
19
|
+
For Claude-only, retain the existing `CLAUDE.md` flow. When both are selected,
|
|
20
|
+
maintain both native files as peers — never make either import or replace the
|
|
21
|
+
other. Put facts shared by both tools inside exactly one project-owned block in
|
|
22
|
+
each file, with identical content and these marker lines:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
<!-- praxis:shared-project begin -->
|
|
26
|
+
...shared project facts...
|
|
27
|
+
<!-- praxis:shared-project end -->
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The markers declare a parity contract, not Praxis ownership: the project owns
|
|
31
|
+
the prose and both native files remain complete if Praxis is removed. Guidance
|
|
32
|
+
outside this block may differ by target. If the active tool offers a native
|
|
33
|
+
repository initialization workflow, suggest it for bulk discovery and
|
|
34
|
+
incorporate useful output rather than re-deriving it.
|
|
22
35
|
|
|
23
36
|
2. **Check detected stacks (if known).** Read `praxis.yaml` for the `stacks:`
|
|
24
37
|
field. If stacks are declared, tailor the sections below to those stacks (e.g.
|
|
@@ -44,30 +57,35 @@ anything it cannot infer.
|
|
|
44
57
|
short; a long always-do list is never read.
|
|
45
58
|
|
|
46
59
|
4. **Ask the user for anything not inferable.** If a section can't be filled from
|
|
47
|
-
config files, git history, or the
|
|
48
|
-
rather than inventing a plausible answer. Content
|
|
49
|
-
enters if it's backed by the code, config, a
|
|
60
|
+
config files, git history, or the native initialization workflow's output, ask
|
|
61
|
+
a targeted question rather than inventing a plausible answer. Content
|
|
62
|
+
inclusion bar: a fact only enters if it's backed by the code, config, a
|
|
63
|
+
canonical doc, or the user.
|
|
50
64
|
|
|
51
65
|
5. **Write only project-owned content.** Never put content inside a Praxis
|
|
52
|
-
managed block (a `<!-- praxis
|
|
53
|
-
Project facts belong in the free-prose sections the author controls;
|
|
54
|
-
|
|
66
|
+
managed block (a `<!-- praxis:begin … -->` / `<!-- praxis:end … -->` region).
|
|
67
|
+
Project facts belong in the free-prose sections the author controls; the
|
|
68
|
+
unhashed `praxis:shared-project` block is also project-owned. Praxis owns only
|
|
69
|
+
its hashed managed blocks. When both native files are selected, write the four
|
|
70
|
+
rubric sections to both shared blocks in one edit and keep their content exact.
|
|
55
71
|
|
|
56
72
|
6. **Run each installed companion bootstrap action** (each seeds part of the
|
|
57
|
-
methodology), then hand off to
|
|
73
|
+
methodology), then hand off to `{{workflow:praxis-upkeep}}`:
|
|
58
74
|
|
|
59
75
|
<!-- praxis:bootstrap-delegations -->
|
|
60
76
|
|
|
61
|
-
After the bootstrap actions above complete, run
|
|
62
|
-
the full methodology baseline is in sync. If
|
|
77
|
+
After the bootstrap actions above complete, run `{{workflow:praxis-upkeep}}` to confirm
|
|
78
|
+
the full methodology baseline is in sync. If `{{workflow:praxis-upkeep}}` is not
|
|
63
79
|
installed, skip this step.
|
|
64
80
|
|
|
65
81
|
7. **Delete `.praxis-setup-pending`** to make this one-shot. Once the rubric
|
|
66
|
-
sections are authored
|
|
67
|
-
|
|
68
|
-
|
|
82
|
+
sections are authored, the bootstrap actions and upkeep pass above have run,
|
|
83
|
+
and the user is satisfied, remove the sentinel file from the repo root. This
|
|
84
|
+
prevents the bootstrap rule from re-offering onboarding on the next session —
|
|
85
|
+
deleting it any earlier would leave an interrupted session with no re-offer
|
|
86
|
+
and an unseeded baseline.
|
|
69
87
|
|
|
70
88
|
8. **Report what was written / left.** Summarise which rubric sections were
|
|
71
89
|
filled, which were left empty (and why — e.g. "no build step detected"), and
|
|
72
90
|
any follow-up items for the user. The baseline is now established; from here
|
|
73
|
-
|
|
91
|
+
`{{workflow:praxis-upkeep}}` keeps the methodology layer current.
|
|
@@ -1,10 +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: present means a fresh Praxis install whose project-owned
|
|
5
|
-
|
|
4
|
+
the repo root: present means a fresh Praxis install whose project-owned agent
|
|
5
|
+
instruction sections aren't authored yet.
|
|
6
6
|
|
|
7
|
-
- **Present:** offer to run
|
|
7
|
+
- **Present:** offer to run `{{workflow:praxis-onboard}}`; it deletes the sentinel on
|
|
8
8
|
completion, making this check one-shot. Never nag when absent.
|
|
9
|
-
- **Absent:** do nothing here —
|
|
9
|
+
- **Absent:** do nothing here — `{{workflow:praxis-upkeep}}` (ongoing front gate, D29/D31)
|
|
10
10
|
handles currency after initial setup.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Neutral permission policy — the enforcement side of the rails
|
|
2
2
|
# (docs/wiki/emitters.md, D18/D19). Tool-agnostic INTENT expressed as capabilities; per-tool emitters
|
|
3
|
-
# translate to
|
|
4
|
-
# permission model emit nothing
|
|
3
|
+
# translate to target-native Claude Code and Codex controls; tools without a
|
|
4
|
+
# permission model emit nothing. Edit your own settings to tune — Praxis owns
|
|
5
5
|
# only the rules it emits and never clobbers rules you add.
|
|
6
6
|
#
|
|
7
7
|
# Posture: allow common local dev (smooth); prompt before anything that leaves the
|
|
@@ -46,10 +46,10 @@ single-doc flow below.
|
|
|
46
46
|
|
|
47
47
|
Read the clock so the name sorts chronologically (do not guess the time):
|
|
48
48
|
|
|
49
|
-
- Timestamp:
|
|
49
|
+
- Timestamp: {{shell:date +%Y-%m-%d_%H%M}}
|
|
50
50
|
|
|
51
51
|
Build the filename `YYYY-MM-DD_HHMM_HANDOFF_<topic>.md`:
|
|
52
|
-
- `<topic>` is a short kebab-case slug for the work. Use
|
|
52
|
+
- `<topic>` is a short kebab-case slug for the work. Use {{arguments}} if
|
|
53
53
|
provided; otherwise derive it from the task.
|
|
54
54
|
- Date-and-time first means a plain alphabetical listing is chronological.
|
|
55
55
|
|
|
@@ -73,9 +73,9 @@ references* section below. Don't re-derive them; you already paid for them.
|
|
|
73
73
|
If in a git repo, capture current branch, staged/unstaged changes, and recent
|
|
74
74
|
commits from this session:
|
|
75
75
|
|
|
76
|
-
- Branch:
|
|
77
|
-
- Status:
|
|
78
|
-
- Recent commits:
|
|
76
|
+
- Branch: {{shell:git branch --show-current 2>/dev/null}}
|
|
77
|
+
- Status: {{shell:git status --short 2>/dev/null}}
|
|
78
|
+
- Recent commits: {{shell:git log --oneline -10 2>/dev/null}}
|
|
79
79
|
|
|
80
80
|
Capture verification state too: identify the project's own build/test/lint
|
|
81
81
|
commands (from its config / docs / CI) and record their current result — what
|