Skip to content

Commit ea36818

Browse files
committed
refactor: stop generating non-system prompts from markdown
1 parent 1a7442d commit ea36818

4 files changed

Lines changed: 7 additions & 164 deletions

File tree

lib/prompts/compress.md

Lines changed: 0 additions & 120 deletions
This file was deleted.

lib/prompts/nudge.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

lib/prompts/system.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ When multiple independent stale ranges exist, prefer several short compressions
1111
Use `compress` as steady housekeeping while you work.
1212

1313
CADENCE, SIGNALS, AND LATENCY
14+
1415
- No fixed threshold mandates compression
1516
- Prioritize closedness and independence over raw range size
1617
- Prefer smaller, regular compressions over infrequent massive compressions for better latency and summary quality

scripts/generate-prompts.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* This solves the issue where readFileSync with __dirname fails when the
66
* package is bundled by Bun (see issue #222, PR #272, #327).
77
*
8-
* The .md files are kept for convenient editing, and this script generates
9-
* .ts files with exported string constants that bundle correctly.
8+
* Only system.md remains markdown-backed because it includes optional manual
9+
* sections that are conditionally rendered. Other prompts are plain .ts files.
1010
*/
1111

1212
import { readFileSync, writeFileSync, readdirSync, mkdirSync, unlinkSync } from "node:fs"
@@ -27,11 +27,11 @@ for (const file of oldGeneratedFiles) {
2727
console.log(`Cleaned up old: ${file}`)
2828
}
2929

30-
// Find all .md files in the prompts directory
31-
const mdFiles = readdirSync(PROMPTS_DIR).filter((f) => f.endsWith(".md"))
30+
const SYSTEM_PROMPT_FILE = "system.md"
31+
const mdFiles = [SYSTEM_PROMPT_FILE]
3232

33-
// Remove stale generated files in _codegen that no longer have a source markdown file
34-
const expectedGenerated = new Set(mdFiles.map((f) => `${basename(f, ".md")}.generated.ts`))
33+
// Remove stale generated files in _codegen that are no longer generated
34+
const expectedGenerated = new Set([`${basename(SYSTEM_PROMPT_FILE, ".md")}.generated.ts`])
3535
const existingGenerated = readdirSync(CODEGEN_DIR).filter((f) => f.endsWith(".generated.ts"))
3636
for (const file of existingGenerated) {
3737
if (!expectedGenerated.has(file)) {

0 commit comments

Comments
 (0)