From ff82ced7f104f5bbc731b18dc9f4a2571b1613d4 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:35:47 -0700 Subject: [PATCH] Reference the changelog in the readme --- README.md | 2 +- tools/updatePrompts.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 70880eb..2b03b56 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Claude Code System Prompts -This repository contains an up-to-date list of all Claude Code's various system prompts and their associated token counts as of **[Claude Code v2.0.46](https://www.npmjs.com/package/@anthropic-ai/claude-code/v/2.0.46) (November 18th, 2025).** +This repository contains an up-to-date list of all Claude Code's various system prompts and their associated token counts as of **[Claude Code v2.0.46](https://www.npmjs.com/package/@anthropic-ai/claude-code/v/2.0.46) (November 18th, 2025).** It also contains a [**CHANGELOG.md**](./CHANGELOG.md) for the system prompts across 28 versions since v2.0.14. Why multiple "system prompts?" diff --git a/tools/updatePrompts.js b/tools/updatePrompts.js index 6a0da32..8da7e36 100644 --- a/tools/updatePrompts.js +++ b/tools/updatePrompts.js @@ -314,6 +314,11 @@ async function updateFromJSON(jsonPath) { console.log(`Version: ${jsonData.version}`); console.log(`Prompts count: ${jsonData.prompts.length}`); + // Count version files in the same directory as the input JSON + const jsonDir = dirname(jsonPath); + const versionFiles = readdirSync(jsonDir).filter(f => f.match(/^prompts-[\d.]+\.json$/)); + const versionCount = versionFiles.length; + // Get existing token counts from README const existingTokenCounts = parseReadmeTokenCounts(); @@ -394,7 +399,7 @@ async function updateFromJSON(jsonPath) { // Update README console.log('\x1b[34mUpdating README.md...\x1b[0m'); - updateReadme(promptsByFilename, jsonData.version, releaseDate); + updateReadme(promptsByFilename, jsonData.version, releaseDate, versionCount); console.log('\x1b[32;1mUpdate complete!\x1b[0m'); console.log(` New: \x1b[1m${newPrompts.size}\x1b[0m`); @@ -405,14 +410,15 @@ async function updateFromJSON(jsonPath) { /** * Update README.md with new prompt information */ -function updateReadme(promptsByFilename, version, releaseDate) { +function updateReadme(promptsByFilename, version, releaseDate, versionCount) { let readme = readFileSync(README_PATH, 'utf-8'); const lines = readme.split('\n'); // Update version in header with npm link and date const npmUrl = `https://www.npmjs.com/package/@anthropic-ai/claude-code/v/${version}`; const dateStr = releaseDate ? ` (${releaseDate})` : ''; - lines[2] = `This repository contains an up-to-date list of all Claude Code's various system prompts and their associated token counts as of **[Claude Code v${version}](${npmUrl})${dateStr}.**`; + + lines[2] = `This repository contains an up-to-date list of all Claude Code's various system prompts and their associated token counts as of **[Claude Code v${version}](${npmUrl})${dateStr}.** It also contains a [**CHANGELOG.md**](./CHANGELOG.md) for the system prompts across ${versionCount} versions since v2.0.14.`; // Organize prompts by category const categories = {