@lifeaitools/rdc-skills 0.24.9 → 0.24.11
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/.claude-plugin/plugin.json +1 -1
- package/git-sha.json +1 -1
- package/hooks/foreground-process-gate.js +22 -3
- package/package.json +3 -1
- package/scripts/acceptance.mjs +471 -0
- package/scripts/install-rdc-skills.js +89 -8
- package/scripts/lib/assertions.mjs +25 -2
- package/scripts/lib/manifest-schema.mjs +13 -0
- package/scripts/self-test.mjs +6 -4
- package/scripts/test-guide-validator.mjs +2 -0
- package/skills/channel-formatter/SKILL.md +56 -6
- package/skills/lifeai-brochure-author/SKILL.md +2 -0
- package/skills/rdc-brochurify/SKILL.md +2 -0
- package/skills/rdc-extract-verifier-rules/SKILL.md +2 -0
- package/skills/rpms-filemap/SKILL.cloud.md +4 -0
- package/skills/rpms-filemap/SKILL.md +4 -0
- package/skills/tests/README.md +5 -0
- package/skills/tests/rdc-channel-formatter.test.json +45 -0
- package/tests/acceptance.test.mjs +42 -0
- package/tests/harness-gates.test.mjs +32 -2
- package/tests/validate-skills.js +17 -173
|
@@ -88,6 +88,9 @@ const projectRoot = projectRootArg || codexRoot || detectedLifeaiRoot;
|
|
|
88
88
|
|
|
89
89
|
const PLUGIN_KEY = 'rdc-skills@rdc-skills';
|
|
90
90
|
const MARKETPLACE = 'rdc-skills';
|
|
91
|
+
const NPM_PACKAGE = '@lifeaitools/rdc-skills';
|
|
92
|
+
const MCP_NAME = 'rdc-skills-mcp';
|
|
93
|
+
const MCP_PORT = '3110';
|
|
91
94
|
|
|
92
95
|
// ── Logging ───────────────────────────────────────────────────────────────────
|
|
93
96
|
const ok = msg => console.log(` \x1b[32m✓\x1b[0m ${msg}`);
|
|
@@ -95,6 +98,10 @@ const info = msg => console.log(` \x1b[36m→\x1b[0m ${msg}`);
|
|
|
95
98
|
const warn = msg => console.log(` \x1b[33m⚠\x1b[0m ${msg}`);
|
|
96
99
|
const fail = msg => console.log(` \x1b[31m✗\x1b[0m ${msg}`);
|
|
97
100
|
|
|
101
|
+
function run(cmd, options = {}) {
|
|
102
|
+
return execSync(cmd, { encoding: 'utf8', stdio: 'pipe', ...options }).trim();
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
// ── Filesystem helpers ────────────────────────────────────────────────────────
|
|
99
106
|
function copyDir(src, dst, ext) {
|
|
100
107
|
if (!fs.existsSync(src)) { warn(`Source not found: ${src}`); return 0; }
|
|
@@ -248,6 +255,76 @@ function buildPluginCache(cacheDir, version, gitSha) {
|
|
|
248
255
|
}
|
|
249
256
|
}
|
|
250
257
|
|
|
258
|
+
function getPm2Process(name) {
|
|
259
|
+
try {
|
|
260
|
+
const list = JSON.parse(run('pm2 jlist'));
|
|
261
|
+
return Array.isArray(list) ? list.find((p) => p.name === name) || null : null;
|
|
262
|
+
} catch {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function isGlobalNpmRdcSkillsPath(scriptPath) {
|
|
268
|
+
if (!scriptPath) return false;
|
|
269
|
+
const normalized = scriptPath.replace(/\\/g, '/').toLowerCase();
|
|
270
|
+
return normalized.includes('/node_modules/@lifeaitools/rdc-skills/');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function packageRootFromMcpScript(scriptPath) {
|
|
274
|
+
return scriptPath ? path.resolve(path.dirname(scriptPath), '..') : null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function readInstalledPackageVersion(scriptPath) {
|
|
278
|
+
const packageRoot = packageRootFromMcpScript(scriptPath);
|
|
279
|
+
if (!packageRoot) return null;
|
|
280
|
+
return readJson(path.join(packageRoot, 'package.json'), {}).version || null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function syncGlobalMcpInstall(version) {
|
|
284
|
+
const proc = getPm2Process(MCP_NAME);
|
|
285
|
+
if (!proc) {
|
|
286
|
+
info('[2.9] MCP pkg — PM2 process not registered yet; start handled below');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const scriptPath = proc.pm2_env?.pm_exec_path || proc.pm_exec_path || '';
|
|
291
|
+
if (!isGlobalNpmRdcSkillsPath(scriptPath)) {
|
|
292
|
+
info(`[2.9] MCP pkg — PM2 uses source checkout, not global npm (${scriptPath || 'unknown path'})`);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const installedVersion = readInstalledPackageVersion(scriptPath);
|
|
297
|
+
if (installedVersion === version) {
|
|
298
|
+
ok(`[2.9] MCP pkg — global ${NPM_PACKAGE}@${version} already installed`);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
let stopped = false;
|
|
303
|
+
let installed = false;
|
|
304
|
+
try {
|
|
305
|
+
info(`[2.9] MCP pkg — updating global ${NPM_PACKAGE} ${installedVersion || '?'} → ${version}`);
|
|
306
|
+
run(`pm2 stop ${MCP_NAME}`);
|
|
307
|
+
stopped = true;
|
|
308
|
+
run(`npm install -g ${NPM_PACKAGE}@${version}`);
|
|
309
|
+
installed = true;
|
|
310
|
+
ok(`[2.9] MCP pkg — installed global ${NPM_PACKAGE}@${version}`);
|
|
311
|
+
} catch (e) {
|
|
312
|
+
warn(`[2.9] MCP pkg — global install failed (${String(e.message || e).split('\n')[0]})`);
|
|
313
|
+
if (String(e.message || '').includes('EBUSY')) {
|
|
314
|
+
info(' PM2 was stopped first; if EBUSY persists, another Node/npm process still holds the package directory.');
|
|
315
|
+
}
|
|
316
|
+
} finally {
|
|
317
|
+
if (stopped) {
|
|
318
|
+
try {
|
|
319
|
+
run(`pm2 restart ${MCP_NAME} --update-env`, { env: { ...process.env, PORT: MCP_PORT } });
|
|
320
|
+
ok(`[2.9] MCP pkg — pm2 restarted ${MCP_NAME}${installed ? '' : ' (previous install restored)'}`);
|
|
321
|
+
} catch (e) {
|
|
322
|
+
warn(`[2.9] MCP pkg — pm2 restart failed (${String(e.message || e).split('\n')[0]})`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
251
328
|
// ── User-skills cleanup ───────────────────────────────────────────────────────
|
|
252
329
|
// Older installer versions wrote skill files directly to ~/.claude/skills/user/.
|
|
253
330
|
// Claude Code loads that directory AND the plugin cache, so any rdc skills left
|
|
@@ -753,8 +830,6 @@ function buildHooksConfig(hooksDir, profile = 'core') {
|
|
|
753
830
|
// under PM2 as `rdc-skills-mcp` on PORT=3110, and prints the claude.ai connector
|
|
754
831
|
// line. Every failure here WARNs — it must never abort the installer.
|
|
755
832
|
function registerMcpServer() {
|
|
756
|
-
const MCP_NAME = 'rdc-skills-mcp';
|
|
757
|
-
const MCP_PORT = '3110';
|
|
758
833
|
const binPath = path.join(repoRoot, 'bin', 'rdc-skills-mcp.mjs');
|
|
759
834
|
const connector = 'https://rdc-skills.regendevcorp.com/mcp';
|
|
760
835
|
|
|
@@ -907,12 +982,6 @@ async function main() {
|
|
|
907
982
|
info(` created settings.json`);
|
|
908
983
|
}
|
|
909
984
|
|
|
910
|
-
// Read version + git SHA once
|
|
911
|
-
const pkg = readJson(path.join(repoRoot, 'package.json'));
|
|
912
|
-
const version = pkg.version || '0.7.0';
|
|
913
|
-
let gitSha = '';
|
|
914
|
-
try { gitSha = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim(); } catch {}
|
|
915
|
-
|
|
916
985
|
// 0. Pull latest
|
|
917
986
|
try {
|
|
918
987
|
const before = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
@@ -923,6 +992,13 @@ async function main() {
|
|
|
923
992
|
warn('[0/6] git pull failed — installing from local copy');
|
|
924
993
|
}
|
|
925
994
|
|
|
995
|
+
// Read version + git SHA after pull so plugin caches and the MCP install do
|
|
996
|
+
// not stamp the pre-update checkout.
|
|
997
|
+
const pkg = readJson(path.join(repoRoot, 'package.json'));
|
|
998
|
+
const version = pkg.version || '0.7.0';
|
|
999
|
+
let gitSha = '';
|
|
1000
|
+
try { gitSha = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim(); } catch {}
|
|
1001
|
+
|
|
926
1002
|
// 0.5a. User-skills cleanup — remove any rdc: skills from ~/.claude/skills/user/
|
|
927
1003
|
// (older installer versions wrote there; plugin cache is the only authoritative source)
|
|
928
1004
|
{
|
|
@@ -1000,6 +1076,11 @@ async function main() {
|
|
|
1000
1076
|
info('[2.6] MCP — rdc-skills endpoint already registered (claude + codex)');
|
|
1001
1077
|
}
|
|
1002
1078
|
|
|
1079
|
+
// If the live MCP is served from the global npm package, update that exact
|
|
1080
|
+
// install before restarting PM2. Windows otherwise holds the package tree open
|
|
1081
|
+
// and `npm install -g` can fail with EBUSY.
|
|
1082
|
+
syncGlobalMcpInstall(version);
|
|
1083
|
+
|
|
1003
1084
|
// 2.7. Symlinks in regen-root/.claude/skills/ (FS MCP + claude.ai access)
|
|
1004
1085
|
if (codexRoot) {
|
|
1005
1086
|
const skillsLinkDir = path.join(codexRoot, '.claude', 'skills');
|
|
@@ -128,6 +128,20 @@ export function checkStdoutContains(expected, observed) {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
export function checkStdoutNotContains(expected, observed) {
|
|
132
|
+
if (expected === undefined) return { pass: true };
|
|
133
|
+
if (!Array.isArray(expected)) {
|
|
134
|
+
return { pass: false, message: "stdout_not_contains assertion is not an array" };
|
|
135
|
+
}
|
|
136
|
+
const stdout = observed.stdout || "";
|
|
137
|
+
const present = expected.filter((s) => stdout.includes(s));
|
|
138
|
+
if (present.length === 0) return { pass: true };
|
|
139
|
+
return {
|
|
140
|
+
pass: false,
|
|
141
|
+
message: `stdout_not_contains: forbidden substrings present: ${present.map((s) => JSON.stringify(s)).join(", ")}`,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
// ─── evaluator ──────────────────────────────────────────────────────────────
|
|
132
146
|
|
|
133
147
|
const PREDICATES = [
|
|
@@ -137,6 +151,7 @@ const PREDICATES = [
|
|
|
137
151
|
["commits_made", checkCommitsMade],
|
|
138
152
|
["stderr_empty", checkStderrEmpty],
|
|
139
153
|
["stdout_contains", checkStdoutContains],
|
|
154
|
+
["stdout_not_contains", checkStdoutNotContains],
|
|
140
155
|
];
|
|
141
156
|
|
|
142
157
|
export function evaluateAssertions(assertions, observed) {
|
|
@@ -185,6 +200,7 @@ if (__isMain) {
|
|
|
185
200
|
commits_made: { min: 1, message_matches: "fix.*README" },
|
|
186
201
|
stderr_empty: true,
|
|
187
202
|
stdout_contains: ["✓", "Verdict:"],
|
|
203
|
+
stdout_not_contains: ["NOTPRESENT"],
|
|
188
204
|
},
|
|
189
205
|
observed: baseObserved,
|
|
190
206
|
expect: (r) => r.pass && r.failures.length === 0,
|
|
@@ -226,20 +242,27 @@ if (__isMain) {
|
|
|
226
242
|
},
|
|
227
243
|
{
|
|
228
244
|
n: 7,
|
|
245
|
+
desc: "stdout_not_contains catches forbidden substring",
|
|
246
|
+
assertions: { stdout_not_contains: ["Verdict:"] },
|
|
247
|
+
observed: baseObserved,
|
|
248
|
+
expect: (r) => !r.pass && r.failures.some((f) => f.predicate === "stdout_not_contains"),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
n: 8,
|
|
229
252
|
desc: "work_items_created label filter rejects",
|
|
230
253
|
assertions: { work_items_created: { min: 1, labels_include: ["nonexistent"] } },
|
|
231
254
|
observed: baseObserved,
|
|
232
255
|
expect: (r) => !r.pass && r.failures.some((f) => f.predicate === "work_items_created"),
|
|
233
256
|
},
|
|
234
257
|
{
|
|
235
|
-
n:
|
|
258
|
+
n: 9,
|
|
236
259
|
desc: "work_items_created max exceeded",
|
|
237
260
|
assertions: { work_items_created: { max: 0 } },
|
|
238
261
|
observed: baseObserved,
|
|
239
262
|
expect: (r) => !r.pass && r.failures.some((f) => f.predicate === "work_items_created"),
|
|
240
263
|
},
|
|
241
264
|
{
|
|
242
|
-
n:
|
|
265
|
+
n: 10,
|
|
243
266
|
desc: "empty assertions → pass",
|
|
244
267
|
assertions: {},
|
|
245
268
|
observed: baseObserved,
|
|
@@ -36,6 +36,7 @@ const TOP_LEVEL_FIELDS = new Set([
|
|
|
36
36
|
"description",
|
|
37
37
|
"fixture",
|
|
38
38
|
"assertions",
|
|
39
|
+
"acceptance",
|
|
39
40
|
"teardown",
|
|
40
41
|
]);
|
|
41
42
|
|
|
@@ -48,6 +49,7 @@ const ASSERTION_FIELDS = new Set([
|
|
|
48
49
|
"commits_made",
|
|
49
50
|
"stderr_empty",
|
|
50
51
|
"stdout_contains",
|
|
52
|
+
"stdout_not_contains",
|
|
51
53
|
]);
|
|
52
54
|
|
|
53
55
|
const WIC_FIELDS = new Set(["min", "max", "status", "labels_include"]);
|
|
@@ -337,6 +339,17 @@ function validateAssertions(a, errors, warnings) {
|
|
|
337
339
|
});
|
|
338
340
|
}
|
|
339
341
|
}
|
|
342
|
+
if (a.stdout_not_contains !== undefined) {
|
|
343
|
+
if (!Array.isArray(a.stdout_not_contains)) {
|
|
344
|
+
err(errors, "assertions.stdout_not_contains", "type", "stdout_not_contains must be an array");
|
|
345
|
+
} else {
|
|
346
|
+
a.stdout_not_contains.forEach((s, i) => {
|
|
347
|
+
if (typeof s !== "string") {
|
|
348
|
+
err(errors, `assertions.stdout_not_contains[${i}]`, "type", "entry must be a string");
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
340
353
|
for (const k of Object.keys(a)) {
|
|
341
354
|
if (!ASSERTION_FIELDS.has(k)) {
|
|
342
355
|
warn(warnings, `assertions.${k}`, "unknown-field", `unknown assertion "${k}"`);
|
package/scripts/self-test.mjs
CHANGED
|
@@ -92,10 +92,12 @@ const KNOWN_CLAUTH_KEYS = new Set([
|
|
|
92
92
|
"coolify-api",
|
|
93
93
|
"cloudflare",
|
|
94
94
|
"npm",
|
|
95
|
-
"supabase",
|
|
96
|
-
"supabase-anon",
|
|
97
|
-
"supabase-db",
|
|
98
|
-
"
|
|
95
|
+
"supabase",
|
|
96
|
+
"supabase-anon",
|
|
97
|
+
"supabase-db",
|
|
98
|
+
"supabase-service",
|
|
99
|
+
"supabase-service-role",
|
|
100
|
+
"r2-access-key-id",
|
|
99
101
|
"r2-secret-key",
|
|
100
102
|
"anthropic",
|
|
101
103
|
"openai",
|
|
@@ -83,11 +83,33 @@ skills named in the scope boundary.
|
|
|
83
83
|
|
|
84
84
|
1. **Detect channel or pack mode** from the request using the tables above.
|
|
85
85
|
2. **Classify the source**: already-drafted copy, long article/report, transcript, notes, or brief.
|
|
86
|
-
3. **For long sources**,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
3. **For thin or under-specified long sources**, enrich before writing instead
|
|
87
|
+
of inventing context:
|
|
88
|
+
- If the source names a corpus path, read it.
|
|
89
|
+
- Otherwise search/read the approved corpus first when available. Resolve
|
|
90
|
+
`CORPUS_ROOT` (usually `H:/My Drive/global-corpus`) and
|
|
91
|
+
`LOCAL_CORPUS_ROOT` (usually `C:/Dev/local-corpus`) before searching the
|
|
92
|
+
repo. If environment variables are not visible, try those default paths.
|
|
93
|
+
- The corpus search must use an explicit corpus path in the tool arguments
|
|
94
|
+
(`H:/My Drive/global-corpus` or `C:/Dev/local-corpus`). A relative repo
|
|
95
|
+
search does not count as enrichment.
|
|
96
|
+
- Use `Grep`/`Glob`/`Read` or the environment's equivalent tools so the
|
|
97
|
+
transcript records what was consulted.
|
|
98
|
+
- Use web search only when the requested output needs current/public facts,
|
|
99
|
+
the user asks for external context, or corpus context is absent and network
|
|
100
|
+
search is allowed. Cite/use only what the search actually supports.
|
|
101
|
+
- Searching only the project repo is not enough for enrichment unless the
|
|
102
|
+
source itself points to a repo-local corpus file.
|
|
103
|
+
- If neither corpus nor web context is available, keep the output sparse and
|
|
104
|
+
mark missing context in assumptions; do not fill gaps creatively.
|
|
105
|
+
4. **For long sources**, extract thesis, audience, proof points, CTA, constraints, and factual risks before writing.
|
|
106
|
+
5. **Jump to the target channel or pack section** below and apply all rules exactly — do not rely on memory.
|
|
107
|
+
6. **Never mix** markdown conventions across channels.
|
|
108
|
+
7. If the channel or pack is ambiguous, ask once: "Is this for [Channel A] or [Channel B]?"
|
|
109
|
+
8. Produce the formatted or repurposed output directly as the deliverable.
|
|
110
|
+
9. Treat extraction notes and source-fidelity guardrails as internal scratchwork.
|
|
111
|
+
Do not print a "Long-Source Extraction Checklist", factual guardrail list, or
|
|
112
|
+
absent-topic list unless the user explicitly asks for analysis.
|
|
91
113
|
|
|
92
114
|
## Hard Rules (all channels)
|
|
93
115
|
|
|
@@ -167,7 +189,7 @@ Repurpose one source for an announcement:
|
|
|
167
189
|
- 3 CTA variants
|
|
168
190
|
|
|
169
191
|
### Long-Source Extraction Checklist
|
|
170
|
-
Before writing from a long source, identify:
|
|
192
|
+
Before writing from a long source, identify internally:
|
|
171
193
|
- **Thesis:** the central argument or announcement
|
|
172
194
|
- **Audience:** who this is for
|
|
173
195
|
- **Proof:** facts, examples, data, names, dates, or quotes explicitly present
|
|
@@ -179,13 +201,39 @@ Before writing from a long source, identify:
|
|
|
179
201
|
### Source-Fidelity Rules
|
|
180
202
|
- Do not invent statistics, dates, quotes, citations, partnerships, revenue,
|
|
181
203
|
legal claims, customer names, or outcomes.
|
|
204
|
+
- Do not infer adjacent finance/reporting concepts that sound plausible but are
|
|
205
|
+
absent from the source, such as pro forma assumptions, reporting cadence,
|
|
206
|
+
offset mechanisms, governance structures, verification status, or portfolio
|
|
207
|
+
implications.
|
|
208
|
+
- If corpus or web context was consulted, use it only for facts it directly
|
|
209
|
+
supports. Do not blend generic domain knowledge into the source as if it were
|
|
210
|
+
documented.
|
|
211
|
+
- If the source provides a theme label without an explanation, keep the theme
|
|
212
|
+
label or paraphrase it conservatively. Do not add explanatory clauses that
|
|
213
|
+
define how it works, who governs it, how it is verified, how often it reports,
|
|
214
|
+
or what financial model it opposes unless those details are explicit.
|
|
215
|
+
- Do not contrast patient capital with quarters, earnings calls, fund cycles,
|
|
216
|
+
exits, venture speed, or portfolio management unless those words or concepts
|
|
217
|
+
appear in the source or consulted corpus/web material.
|
|
182
218
|
- Do not upgrade tentative language into certainty.
|
|
183
219
|
- Do not turn illustrative examples into facts.
|
|
184
220
|
- Preserve caveats when they affect meaning.
|
|
185
221
|
- If a stronger hook needs a proof point the source does not provide, write a
|
|
186
222
|
proof-neutral hook instead.
|
|
223
|
+
- If the source says a topic is absent, excluded, or not mentioned, treat that
|
|
224
|
+
as an internal guardrail. Do not repeat the absent topic in public-facing
|
|
225
|
+
channel copy, assumptions, caveats, notes, headings, or summaries unless the
|
|
226
|
+
user explicitly asks for a contrast, compliance note, or risk disclosure.
|
|
227
|
+
Strip absent-topic lists from the deliverable entirely.
|
|
187
228
|
- When assumptions are material, include a short "Assumptions:" line before the
|
|
188
229
|
deliverable rather than burying uncertainty in polished copy.
|
|
230
|
+
- Do not output your extraction checklist. The deliverable should start with the
|
|
231
|
+
requested channel/pack output, except for a brief "Assumptions:" line when a
|
|
232
|
+
material gap affects the copy.
|
|
233
|
+
- If you include an "Assumptions:" line, limit it to missing useful inputs such
|
|
234
|
+
as org name, audience, location, date, CTA, or link. Never list absent,
|
|
235
|
+
excluded, or not-mentioned topics in the assumptions line. If the only
|
|
236
|
+
uncertainty is an absent-topic guardrail, omit the assumptions line.
|
|
189
237
|
|
|
190
238
|
---
|
|
191
239
|
|
|
@@ -231,6 +279,8 @@ channel-native. A pack is not a generic summary repeated in several lengths.
|
|
|
231
279
|
email/web, concise in Slack.
|
|
232
280
|
- Use channel-specific formatting rules from the sections below.
|
|
233
281
|
- If source proof is weak, use curiosity and framing instead of inflated claims.
|
|
282
|
+
- Do not include extraction notes, guardrail notes, or absent-topic caveats in
|
|
283
|
+
the pack. Those are reasoning aids, not channel outputs.
|
|
234
284
|
|
|
235
285
|
---
|
|
236
286
|
|
|
@@ -21,6 +21,8 @@ required_validators:
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
# LIFEAI Brochure Authoring Contract
|
|
24
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
25
|
+
> Return the authored JSX guidance or verification result directly; do not dump raw tool logs.
|
|
24
26
|
|
|
25
27
|
This is the contract every AI engine obeys when generating brochure JSX. The contract is non-negotiable. If you cannot generate output that complies, **stop and ask for clarification rather than emit non-compliant code.**
|
|
26
28
|
|
|
@@ -13,6 +13,8 @@ triggers:
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# rdc:brochurify Orchestrator
|
|
16
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
17
|
+
> Report brochure job state, artifacts, and blockers directly; do not dump raw tool logs.
|
|
16
18
|
|
|
17
19
|
The orchestrator dispatches six waves of typed sub-agents in sequence. Each wave has a clear input contract, an output contract, and a parallelism profile.
|
|
18
20
|
|
|
@@ -13,6 +13,8 @@ triggers:
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# rdc:extract-verifier-rules
|
|
16
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
17
|
+
> Return candidate rules, evidence, and PR status directly; do not dump raw tool logs.
|
|
16
18
|
|
|
17
19
|
The self-learning loop. The verifier corpus is the moat (per `DECISIONS-LOG.md` D-009). This skill is how the corpus grows.
|
|
18
20
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: rpms-filemap
|
|
2
3
|
description: "Generated RPMS file map — RULE #1, canonical homes, and Context Export pointers served from regen-root manifest."
|
|
3
4
|
slash: "rdc:rpms-filemap"
|
|
4
5
|
category: "tooling"
|
|
@@ -12,6 +13,9 @@ triggers:
|
|
|
12
13
|
- "where should pm artifacts go"
|
|
13
14
|
---
|
|
14
15
|
# RPMS File Map
|
|
16
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
17
|
+
> Return the requested file-map guidance directly; do not dump raw manifests or logs.
|
|
18
|
+
|
|
15
19
|
> GENERATED FILE - DO NOT HAND-EDIT.
|
|
16
20
|
> Source of truth: `docs/architecture/rpms.locations.json`
|
|
17
21
|
> Regenerate: `pnpm rpms:gen-filemap`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: rpms-filemap
|
|
2
3
|
description: "Generated RPMS file map — RULE #1, canonical homes, and Context Export pointers served from regen-root manifest."
|
|
3
4
|
slash: "rdc:rpms-filemap"
|
|
4
5
|
category: "tooling"
|
|
@@ -12,6 +13,9 @@ triggers:
|
|
|
12
13
|
- "where should pm artifacts go"
|
|
13
14
|
---
|
|
14
15
|
# RPMS File Map
|
|
16
|
+
> **⚠️ OUTPUT CONTRACT (READ FIRST):** `guides/output-contract.md`
|
|
17
|
+
> Return the requested file-map guidance directly; do not dump raw manifests or logs.
|
|
18
|
+
|
|
15
19
|
> GENERATED FILE - DO NOT HAND-EDIT.
|
|
16
20
|
> Source of truth: `docs/architecture/rpms.locations.json`
|
|
17
21
|
> Regenerate: `pnpm rpms:gen-filemap`
|
package/skills/tests/README.md
CHANGED
|
@@ -23,6 +23,11 @@ is the source of truth. Top-level fields:
|
|
|
23
23
|
4. Run `node scripts/self-test.mjs --tier2 --skill rdc:<name>` to smoke-test
|
|
24
24
|
5. Commit manifest + any skill changes together
|
|
25
25
|
|
|
26
|
+
For content-producing skills, include both positive and negative output checks.
|
|
27
|
+
Use `stdout_contains` for expected channel-native structure and source facts;
|
|
28
|
+
use `stdout_not_contains` for source-fidelity violations or explicitly forbidden
|
|
29
|
+
claims.
|
|
30
|
+
|
|
26
31
|
## Adding a new skill
|
|
27
32
|
|
|
28
33
|
New skills MUST ship with a manifest. Tier 2 CI will block tag push if a
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"skill": "rdc:channel-formatter",
|
|
4
|
+
"description": "Channel formatter turns a long article into a social content pack in RDC_TEST mode without fabricating source claims.",
|
|
5
|
+
"fixture": {
|
|
6
|
+
"prompt": "rdc:channel-formatter social-pack docs/source/channel-formatter-long-article.md",
|
|
7
|
+
"precondition_files": [
|
|
8
|
+
{
|
|
9
|
+
"path": "docs/source/channel-formatter-long-article.md",
|
|
10
|
+
"content": "# Wetland Finance Article\n\nA 2026 field note from the finance team says the pilot restored 42 acres of riparian habitat, reduced annual irrigation demand by 18 percent, and produced three investor update themes: patient capital, measurable ecological return, and community operating discipline.\n\nThis is intentionally thin. Before writing, consult available corpus context for regenerative finance / wetland finance language. Use an explicit corpus-path search of `C:/Dev/local-corpus` or `H:/My Drive/global-corpus`; if neither path has support, keep claims limited to the source.\n\nThe absent-topic list below is a private guardrail only. Do not repeat these terms in assumptions, notes, caveats, headings, summaries, or public-facing output.\n\nThe source does not mention carbon credits, tokenization, celebrity partners, guaranteed returns, quarterly earnings, fund cycles, verification status, portfolio management, or governance structures."
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"env": { "RDC_TEST": "1" }
|
|
14
|
+
},
|
|
15
|
+
"assertions": {
|
|
16
|
+
"exit_code": 0,
|
|
17
|
+
"stdout_contains": ["LinkedIn", "Twitter/X", "Slack", "42 acres", "18 percent"]
|
|
18
|
+
},
|
|
19
|
+
"acceptance": {
|
|
20
|
+
"output_contains": ["LinkedIn", "Twitter/X", "Slack", "42 acres", "18%"],
|
|
21
|
+
"output_not_contains": [
|
|
22
|
+
"carbon credits",
|
|
23
|
+
"tokenization",
|
|
24
|
+
"celebrity partners",
|
|
25
|
+
"guaranteed returns",
|
|
26
|
+
"pro forma",
|
|
27
|
+
"offsets",
|
|
28
|
+
"governance",
|
|
29
|
+
"quarterly",
|
|
30
|
+
"verified",
|
|
31
|
+
"fund cycle",
|
|
32
|
+
"fund-cycle",
|
|
33
|
+
"portfolio manager",
|
|
34
|
+
"portfolio management"
|
|
35
|
+
],
|
|
36
|
+
"tool_calls_include_any": ["Grep", "Glob", "WebSearch"],
|
|
37
|
+
"tool_calls_argument_matches": [
|
|
38
|
+
{
|
|
39
|
+
"tools": ["Grep", "Glob", "WebSearch"],
|
|
40
|
+
"pattern": "global-corpus|local-corpus|CORPUS_ROOT|LOCAL_CORPUS_ROOT|web"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"teardown": { "reset_branch": true }
|
|
45
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join, resolve } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
|
|
10
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const REPO_ROOT = resolve(__dirname, '..');
|
|
12
|
+
const script = join(REPO_ROOT, 'scripts', 'acceptance.mjs');
|
|
13
|
+
|
|
14
|
+
const syntax = spawnSync(process.execPath, ['--check', script], { encoding: 'utf8' });
|
|
15
|
+
assert.equal(syntax.status, 0, syntax.stderr);
|
|
16
|
+
|
|
17
|
+
const missing = spawnSync(process.execPath, [script, '--skill', 'rdc:not-a-real-skill'], {
|
|
18
|
+
cwd: REPO_ROOT,
|
|
19
|
+
encoding: 'utf8',
|
|
20
|
+
});
|
|
21
|
+
assert.equal(missing.status, 1);
|
|
22
|
+
assert.match(missing.stderr, /missing acceptance manifest/);
|
|
23
|
+
|
|
24
|
+
const codex = spawnSync(process.execPath, [script, '--engine', 'codex', '--skill', 'rdc:plan'], {
|
|
25
|
+
cwd: REPO_ROOT,
|
|
26
|
+
encoding: 'utf8',
|
|
27
|
+
});
|
|
28
|
+
assert.equal(codex.status, 2);
|
|
29
|
+
assert.match(codex.stderr, /Codex JSONL/);
|
|
30
|
+
|
|
31
|
+
const emptyProject = mkdtempSync(join(tmpdir(), 'rdc-acceptance-empty-'));
|
|
32
|
+
try {
|
|
33
|
+
const none = spawnSync(process.execPath, [script, '--changed', '--base', 'HEAD', '--project-root', emptyProject], {
|
|
34
|
+
cwd: REPO_ROOT,
|
|
35
|
+
encoding: 'utf8',
|
|
36
|
+
});
|
|
37
|
+
assert.notEqual(none.status, 0);
|
|
38
|
+
} finally {
|
|
39
|
+
rmSync(emptyProject, { recursive: true, force: true });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('acceptance tests — PASS');
|
|
@@ -146,7 +146,37 @@ const WI = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee';
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// ===========================================================================
|
|
149
|
-
// 2.
|
|
149
|
+
// 2. foreground-process-gate.js
|
|
150
|
+
// ===========================================================================
|
|
151
|
+
{
|
|
152
|
+
const focusPayload = {
|
|
153
|
+
tool_input: {
|
|
154
|
+
command: "powershell -NoProfile -Command \"Add-Type '[DllImport(\\\"user32.dll\\\")] public static extern bool SetForegroundWindow(System.IntPtr hWnd);'\"",
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const r = runHook('foreground-process-gate.js', focusPayload, {});
|
|
158
|
+
assert('FPG blocks SetForegroundWindow focus API', r.status === 1, `status=${r.status} ${r.stdout}${r.stderr}`);
|
|
159
|
+
assert('FPG block mentions window focus operations', /Window focus\/restore\/minimize\/collapse/.test(r.stdout + r.stderr));
|
|
160
|
+
|
|
161
|
+
const hiddenPayload = {
|
|
162
|
+
tool_input: {
|
|
163
|
+
command: 'powershell.exe -NoProfile -NonInteractive -WindowStyle Hidden -File ".\\\\scripts\\\\helper.ps1"',
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
const h = runHook('foreground-process-gate.js', hiddenPayload, {});
|
|
167
|
+
assert('FPG allows hidden PowerShell helper', h.status === 0, `status=${h.status} ${h.stdout}${h.stderr}`);
|
|
168
|
+
|
|
169
|
+
const minimizedPayload = {
|
|
170
|
+
tool_input: {
|
|
171
|
+
command: 'Start-Process powershell.exe -WindowStyle Minimized -ArgumentList "-NoProfile"',
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
const m = runHook('foreground-process-gate.js', minimizedPayload, {});
|
|
175
|
+
assert('FPG allows minimized Start-Process without focus APIs', m.status === 0, `status=${m.status} ${m.stdout}${m.stderr}`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ===========================================================================
|
|
179
|
+
// 3. post-tool-batch-gate.js
|
|
150
180
|
// ===========================================================================
|
|
151
181
|
{
|
|
152
182
|
const ptb = require(join(HOOKS, 'post-tool-batch-gate.js'));
|
|
@@ -197,7 +227,7 @@ const WI = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee';
|
|
|
197
227
|
}
|
|
198
228
|
|
|
199
229
|
// ===========================================================================
|
|
200
|
-
//
|
|
230
|
+
// 4. gate-watchdog-selfcheck.js
|
|
201
231
|
// ===========================================================================
|
|
202
232
|
{
|
|
203
233
|
const wd = require(join(HOOKS, 'gate-watchdog-selfcheck.js'));
|