Ask Claude to Organize Your Package Scripts into a Clean, Discoverable Set
Most projects accumulate scripts organically — someone adds test, someone else adds test:unit, a third person adds run-tests. Claude can read your actual toolchain and create a clean, consistent set of scripts that everyone can discover and use.
Read my package.json scripts, build tools, and test configuration.
Reorganise the scripts section into logical groups with consistent naming.
Add any missing scripts for common workflows.
Claude checks your dev dependencies, config files, and existing scripts to produce a well-organized set:
{
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"typecheck": "tsc --noEmit",
"ci": "npm run lint && npm run typecheck && npm run test && npm run build"
}
}
Target specific script organisation needs:
# Add missing lifecycle scripts
I have a build script but no prebuild or postbuild.
Add the right hooks for cleaning dist/ before build
and running type checks after.
# Create a CI pipeline script
Chain all the quality checks into a single ci script that runs
lint, type checking, tests, and build in the right order —
failing fast if any step breaks.
# Add convenience scripts
I'm always typing the same long commands. Create short scripts for
the workflows I use most — starting dev with seeded data, running
specific test suites, and deploying to staging.
# Standardise naming
Some scripts use colons (test:unit), some use dashes (run-tests),
some use camelCase (buildProd). Pick one convention and rename everything.
After organizing, ask Claude to document the scripts in CLAUDE.md:
Add the new scripts to the Common Commands section in CLAUDE.md
so Claude always uses the right command in future sessions.
Scripts are the API of your development workflow — let Claude make them discoverable, consistent, and complete.
via Claude Code
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.