Claude-skill-registry authoring-global-scripts
Authors and manages global package scripts using the _: prefix convention. Scripts defined in root package.json are propagated to all packages with the prefix stripped.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/authoring-global-scripts" ~/.claude/skills/majiayu000-claude-skill-registry-authoring-global-scripts && rm -rf "$T"
manifest:
skills/data/authoring-global-scripts/SKILL.mdsource content
Authoring Global Scripts
Manage package scripts that apply to all packages in the monorepo.
Steps
Adding a Global Script
-
Add script to root
withpackage.json
prefix:_:{ "scripts": { "_:build": "tsgo -p tsconfig.build.json", "_:check:types": "tsgo --noEmit" } } -
Run the sync script at
.claude/skills/authoring-global-scripts/scripts/sync-package-scripts.ts
Auditing for Inconsistencies
Run with
--check flag to verify all packages are in sync without modifying:
tsx .claude/skills/authoring-global-scripts/scripts/sync-package-scripts.ts --check
Reference
Convention
| Location | Format | Example |
|---|---|---|
| Root package.json | | |
| Package package.json | | |
The
_: prefix marks scripts as "global templates". The sync script:
- Strips the prefix when copying to packages
- Replaces all package scripts (packages should not have custom scripts)
- Warns about extra scripts in packages that aren't in the template
Relative Paths
Relative paths like
../../oxlint.json are preserved as-is. They're relative from each package directory, so ../../ correctly points to the monorepo root from packages/*/.
Notes
- Packages should NOT have custom scripts - all scripts come from the global template
- If a package needs a unique script, reconsider whether it belongs as a global script
- Run audit (
) to catch manual edits that broke the pattern--check