@codyswann/lisa 2.35.0 → 2.37.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.
package/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  "lodash": ">=4.18.1"
83
83
  },
84
84
  "name": "@codyswann/lisa",
85
- "version": "2.35.0",
85
+ "version": "2.37.0",
86
86
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
87
87
  "main": "dist/index.js",
88
88
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -18,32 +18,140 @@
18
18
  */
19
19
  import fs from "node:fs";
20
20
  import path from "node:path";
21
+ import { fileURLToPath } from "node:url";
21
22
 
22
- const [pluginDirArg, versionArg] = process.argv.slice(2);
23
- if (!pluginDirArg || !versionArg) {
24
- console.error(
25
- "Usage: generate-codex-plugin-artifacts.mjs <plugin-dir> <version>"
26
- );
27
- process.exit(1);
23
+ /**
24
+ * Parse the leading YAML frontmatter block of a SKILL.md file.
25
+ *
26
+ * The frontmatter is the simple `key: value` YAML between the first two `---`
27
+ * fences at the very top of the file (the shape every `plugins/*\/skills/*\/SKILL.md`
28
+ * uses). Values are read verbatim as strings (trimmed); nested structures and
29
+ * arrays are not interpreted because skill frontmatter does not use them.
30
+ *
31
+ * @param {string} skillMdPath Absolute or relative path to a SKILL.md file.
32
+ * @returns {{ name?: string, description?: string } & Record<string, string> | null}
33
+ * The parsed key/value pairs, or `null` (skip sentinel) when the file has no
34
+ * leading `---`-delimited frontmatter block. Pure: never writes.
35
+ */
36
+ export function parseSkillFrontmatter(skillMdPath) {
37
+ const raw = fs.readFileSync(skillMdPath, "utf8");
38
+ // Frontmatter must be the very first thing in the file. Normalize CRLF so a
39
+ // Windows-authored SKILL.md parses identically to a LF one.
40
+ const normalized = raw.replace(/\r\n/g, "\n");
41
+ if (!normalized.startsWith("---\n")) {
42
+ return null;
43
+ }
44
+ const closingIndex = normalized.indexOf("\n---", 3);
45
+ if (closingIndex === -1) {
46
+ return null;
47
+ }
48
+ const block = normalized.slice(4, closingIndex);
49
+ const frontmatter = {};
50
+ for (const line of block.split("\n")) {
51
+ const trimmed = line.trim();
52
+ if (trimmed === "" || trimmed.startsWith("#")) {
53
+ continue;
54
+ }
55
+ const separator = trimmed.indexOf(":");
56
+ if (separator === -1) {
57
+ continue;
58
+ }
59
+ const key = trimmed.slice(0, separator).trim();
60
+ if (key === "") {
61
+ continue;
62
+ }
63
+ const value = trimmed
64
+ .slice(separator + 1)
65
+ .trim()
66
+ .replace(/^["']|["']$/g, "");
67
+ frontmatter[key] = value;
68
+ }
69
+ return frontmatter;
28
70
  }
29
71
 
30
- const pluginDir = path.resolve(pluginDirArg);
31
- const claudeManifestPath = path.join(
32
- pluginDir,
33
- ".claude-plugin",
34
- "plugin.json"
35
- );
36
- if (!fs.existsSync(claudeManifestPath)) {
37
- process.exit(0);
72
+ /**
73
+ * Encode a single string as a YAML double-quoted scalar.
74
+ *
75
+ * Double-quoting unconditionally is the deterministic choice: it round-trips
76
+ * every possible string — colons, leading `#`/`-`, quotes, indicators — without
77
+ * the branchy "is this plain-safe?" logic that risks emitting ambiguous YAML.
78
+ * Only the five escapes YAML's double-quoted style requires are applied, in a
79
+ * fixed order, so output is a pure function of the input.
80
+ *
81
+ * @param {string} value Raw string to encode.
82
+ * @returns {string} The value wrapped in double quotes with `\`, `"`, and the
83
+ * C0 control characters (tab, newline, carriage return) escaped.
84
+ */
85
+ function yamlQuote(value) {
86
+ const escaped = value
87
+ .replace(/\\/g, "\\\\")
88
+ .replace(/"/g, '\\"')
89
+ .replace(/\t/g, "\\t")
90
+ .replace(/\n/g, "\\n")
91
+ .replace(/\r/g, "\\r");
92
+ return `"${escaped}"`;
38
93
  }
39
94
 
40
- const claudeManifest = JSON.parse(fs.readFileSync(claudeManifestPath, "utf8"));
41
- const pluginName = claudeManifest.name;
95
+ /**
96
+ * Serialize a Codex `interface` object to deterministic `openai.yaml` content.
97
+ *
98
+ * Emits exactly three keys in a fixed order — `display_name`,
99
+ * `short_description`, then `default_prompt` (a block sequence) — with every
100
+ * scalar double-quoted and a single trailing newline. The function is pure:
101
+ * given the same input it returns byte-identical output (no timestamps, no
102
+ * randomness, no filesystem), which is what keeps `bun run build:plugins`
103
+ * reproducible and the Plugins Sync CI gate stable.
104
+ *
105
+ * @param {{ display_name: string, short_description: string, default_prompt: readonly string[] }} iface
106
+ * The normalized interface object. `default_prompt` is always rendered as a
107
+ * block sequence (an empty array becomes `default_prompt: []`).
108
+ * @returns {string} Deterministic YAML, terminated by exactly one newline.
109
+ */
110
+ export function serializeInterfaceToYaml(iface) {
111
+ const prompts = iface.default_prompt ?? [];
112
+ const promptBlock =
113
+ prompts.length === 0
114
+ ? "default_prompt: []"
115
+ : ["default_prompt:", ...prompts.map(p => ` - ${yamlQuote(p)}`)].join(
116
+ "\n"
117
+ );
118
+ const lines = [
119
+ `display_name: ${yamlQuote(iface.display_name)}`,
120
+ `short_description: ${yamlQuote(iface.short_description)}`,
121
+ promptBlock,
122
+ ];
123
+ return `${lines.join("\n")}\n`;
124
+ }
125
+
126
+ function main() {
127
+ const [pluginDirArg, versionArg] = process.argv.slice(2);
128
+ if (!pluginDirArg || !versionArg) {
129
+ console.error(
130
+ "Usage: generate-codex-plugin-artifacts.mjs <plugin-dir> <version>"
131
+ );
132
+ process.exit(1);
133
+ }
134
+
135
+ const pluginDir = path.resolve(pluginDirArg);
136
+ const claudeManifestPath = path.join(
137
+ pluginDir,
138
+ ".claude-plugin",
139
+ "plugin.json"
140
+ );
141
+ if (!fs.existsSync(claudeManifestPath)) {
142
+ process.exit(0);
143
+ }
144
+
145
+ const claudeManifest = JSON.parse(
146
+ fs.readFileSync(claudeManifestPath, "utf8")
147
+ );
148
+ const pluginName = claudeManifest.name;
42
149
 
43
- writeCodexManifest(pluginName, versionArg);
150
+ writeCodexManifest(pluginDir, claudeManifest, pluginName, versionArg);
151
+ }
44
152
 
45
- function writeCodexManifest(pluginName, version) {
46
- const metadata = metadataFor(pluginName);
153
+ function writeCodexManifest(pluginDir, claudeManifest, pluginName, version) {
154
+ const metadata = metadataFor(pluginName, claudeManifest);
47
155
  const manifest = {
48
156
  name: pluginName,
49
157
  version,
@@ -53,7 +161,7 @@ function writeCodexManifest(pluginName, version) {
53
161
  ...(claudeManifest.dependencies
54
162
  ? { dependencies: claudeManifest.dependencies }
55
163
  : {}),
56
- ...componentPointers(),
164
+ ...componentPointers(pluginDir),
57
165
  interface: {
58
166
  displayName: metadata.displayName,
59
167
  shortDescription: metadata.shortDescription,
@@ -73,7 +181,7 @@ function writeCodexManifest(pluginName, version) {
73
181
  );
74
182
  }
75
183
 
76
- function componentPointers() {
184
+ function componentPointers(pluginDir) {
77
185
  return {
78
186
  ...(fs.existsSync(path.join(pluginDir, "skills"))
79
187
  ? { skills: "./skills/" }
@@ -84,7 +192,7 @@ function componentPointers() {
84
192
  };
85
193
  }
86
194
 
87
- function metadataFor(pluginName) {
195
+ function metadataFor(pluginName, claudeManifest) {
88
196
  const map = {
89
197
  lisa: {
90
198
  displayName: "Lisa",
@@ -236,3 +344,9 @@ function metadataFor(pluginName) {
236
344
  }
237
345
  );
238
346
  }
347
+
348
+ // Run the generator only when invoked directly (e.g. via build-plugins.sh),
349
+ // not when this module is imported (e.g. by unit tests for the parser).
350
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
351
+ main();
352
+ }