fix(linkedin): close dogfood friction (S14)
Close all 9 friction points from the S13 newsletter dogfood (operator elected to fix F6-F9 rather than defer): - F1: namespace all subagent_type calls in newsletter.md to linkedin-thought-leadership:<name> (4 sites + canonical note) - F2: document agent invocation form + reload requirement in CLAUDE.md + README.md (reload itself is an operator action) - F3: add edition-config / edition-delingstekst / edition-HANDOVER templates under config/ + wire into Steps 0 and 8 + footer - F4: reconcile draft path to <serie>/NN-utkast.md (series root) - F5: de-hardcode series root (explicit arg / LTL_SERIES_ROOT / default) - F6: config-derive carousel editions (remove Seres CAROUSEL set); correct samle comment - F7: build-html.mjs exits non-zero when zero HTML produced - F8: guard parseDelingstekst (graceful ENOENT) + correct Step 8 wording - F9: relocate agents/README.md -> docs/agents-capability-matrix.md Re-tested: 87/87 plugin tests pass; build-html/build-linkedin behavior re-verified live. Per-item outcomes logged in dogfood-S13-friction.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
adfa2085fc
commit
92e0a0b4f5
11 changed files with 339 additions and 54 deletions
|
|
@ -1030,16 +1030,20 @@ ${CLIENT_JS}
|
|||
// ---------------------------------------------------------------------------
|
||||
// Main
|
||||
// ---------------------------------------------------------------------------
|
||||
// Returnerer antall HTML-filer skrevet. Eksitkoden settes av CLI-guarden under
|
||||
// (S14/F7): main() kaller aldri process.exit() selv, slik at modulen kan
|
||||
// importeres/testes uten å drepe prosessen.
|
||||
export function main() {
|
||||
const args = process.argv.slice(2);
|
||||
if (!args.length) {
|
||||
console.error("Bruk: node build-html.mjs <fil.md> [flere.md ...]");
|
||||
process.exit(1);
|
||||
return 0;
|
||||
}
|
||||
// Output følger serien (kjøres fra serie-mappa), ikke scriptet i tools/.
|
||||
const outDir = path.join(process.cwd(), "review");
|
||||
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
|
||||
|
||||
let written = 0;
|
||||
for (const arg of args) {
|
||||
const inPath = path.isAbsolute(arg) ? arg : path.join(process.cwd(), arg);
|
||||
if (!fs.existsSync(inPath)) {
|
||||
|
|
@ -1054,11 +1058,20 @@ export function main() {
|
|||
const outPath = path.join(outDir, base + ".html");
|
||||
fs.writeFileSync(outPath, html, "utf8");
|
||||
console.log(`Skrev ${outPath} (${(html.length / 1024).toFixed(1)} KB)`);
|
||||
written++;
|
||||
}
|
||||
|
||||
// S14/F7: en typo'd/manglende input-fil ga tidligere exit 0 uten HTML (stille
|
||||
// footgun). Skrev vi ingenting, er det en feil — rapporter og la CLI-guarden
|
||||
// sette ikke-null exit.
|
||||
if (written === 0) {
|
||||
console.error(`Ingen HTML produsert (0 av ${args.length} input-fil(er) funnet) — sjekk filnavn og sti.`);
|
||||
}
|
||||
return written;
|
||||
}
|
||||
|
||||
// CLI-guard: kjør kun når scriptet startes direkte, ikke ved import
|
||||
// (mønster fra hooks/scripts/state-updater.mjs).
|
||||
// (mønster fra hooks/scripts/state-updater.mjs). Exit non-zero hvis ingen HTML.
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
main();
|
||||
process.exit(main() > 0 ? 0 : 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue