From fe58c3a6669add0a41d974f2caba0a42e41ae44e Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 9 Apr 2026 13:46:33 -0400 Subject: [PATCH 1/5] chore(ci): bump socket-registry SHA to ed311907 --- .github/workflows/ci.yml | 2 +- .github/workflows/provenance.yml | 2 +- .github/workflows/weekly-update.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8b17c..b00f868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ permissions: jobs: ci: name: Run CI Pipeline - uses: SocketDev/socket-registry/.github/workflows/ci.yml@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + uses: SocketDev/socket-registry/.github/workflows/ci.yml@ed3119078118d558f095e9adf8800263166d65f9 # main with: fail-fast: false lint-script: 'pnpm run lint --all' diff --git a/.github/workflows/provenance.yml b/.github/workflows/provenance.yml index 7a6731c..b53e57f 100644 --- a/.github/workflows/provenance.yml +++ b/.github/workflows/provenance.yml @@ -27,7 +27,7 @@ permissions: jobs: publish: - uses: SocketDev/socket-registry/.github/workflows/provenance.yml@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + uses: SocketDev/socket-registry/.github/workflows/provenance.yml@ed3119078118d558f095e9adf8800263166d65f9 # main with: debug: ${{ inputs.debug }} dist-tag: ${{ inputs.dist-tag }} diff --git a/.github/workflows/weekly-update.yml b/.github/workflows/weekly-update.yml index bbc76c9..f78dece 100644 --- a/.github/workflows/weekly-update.yml +++ b/.github/workflows/weekly-update.yml @@ -24,7 +24,7 @@ jobs: outputs: has-updates: ${{ steps.check.outputs.has-updates }} steps: - - uses: SocketDev/socket-registry/.github/actions/setup-and-install@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + - uses: SocketDev/socket-registry/.github/actions/setup-and-install@ed3119078118d558f095e9adf8800263166d65f9 # main - name: Check for npm updates id: check @@ -48,7 +48,7 @@ jobs: contents: write pull-requests: write steps: - - uses: SocketDev/socket-registry/.github/actions/setup-and-install@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + - uses: SocketDev/socket-registry/.github/actions/setup-and-install@ed3119078118d558f095e9adf8800263166d65f9 # main - name: Create update branch id: branch @@ -60,7 +60,7 @@ jobs: git checkout -b "$BRANCH_NAME" echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT - - uses: SocketDev/socket-registry/.github/actions/setup-git-signing@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + - uses: SocketDev/socket-registry/.github/actions/setup-git-signing@ed3119078118d558f095e9adf8800263166d65f9 # main with: gpg-private-key: ${{ secrets.BOT_GPG_PRIVATE_KEY }} @@ -290,7 +290,7 @@ jobs: test-output.log retention-days: 7 - - uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main + - uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@ed3119078118d558f095e9adf8800263166d65f9 # main if: always() notify: From c098c583755005d33ca990c0b73b381e57051a96 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 9 Apr 2026 13:50:19 -0400 Subject: [PATCH 2/5] feat(ci): pipe publish-without-sfw and SOCKET_API_KEY to provenance workflow --- .github/workflows/provenance.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/provenance.yml b/.github/workflows/provenance.yml index b53e57f..245773f 100644 --- a/.github/workflows/provenance.yml +++ b/.github/workflows/provenance.yml @@ -19,6 +19,11 @@ on: options: - '0' - '1' + publish-without-sfw: + description: 'Publish directly to npm, bypassing Socket firewall shims' + required: false + default: false + type: boolean permissions: contents: write @@ -33,5 +38,8 @@ jobs: dist-tag: ${{ inputs.dist-tag }} package-name: '@socketregistry/packageurl-js' publish-script: 'publish:ci' + publish-without-sfw: ${{ inputs.publish-without-sfw }} setup-script: 'ci:validate' use-trusted-publishing: true + secrets: + SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }} From e5581e0b27eadd30a1f1d5030b63861e144da35a Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 9 Apr 2026 16:47:56 -0400 Subject: [PATCH 3/5] chore: trim CLAUDE.md and audit skills Reduce CLAUDE.md from ~16KB to ~6KB by removing: - Verbose emoji/output tutorial with code examples - Redundant sections (FILE SYSTEM AS STATE, SELF-IMPROVEMENT, ROLE, EVOLUTION) - Tutorial-like TypeScript patterns Claude already knows - Detailed test helper docs and directory trees - "Why this matters" explanations and repeated bullets - Debugging section with generic advice Fix security-scan SKILL.md description to use third-person convention ("Runs" instead of "Run"). --- .claude/skills/security-scan/SKILL.md | 2 +- CLAUDE.md | 376 +++++--------------------- 2 files changed, 67 insertions(+), 311 deletions(-) diff --git a/.claude/skills/security-scan/SKILL.md b/.claude/skills/security-scan/SKILL.md index 0ba403f..161fb5b 100644 --- a/.claude/skills/security-scan/SKILL.md +++ b/.claude/skills/security-scan/SKILL.md @@ -1,6 +1,6 @@ --- name: security-scan -description: Run a multi-tool security scan โ€” AgentShield for Claude config, zizmor for GitHub Actions, and optionally Socket CLI for dependency scanning. Produces an A-F graded security report. +description: Runs a multi-tool security scan โ€” AgentShield for Claude config, zizmor for GitHub Actions, and optionally Socket CLI for dependency scanning. Produces an A-F graded security report. --- # Security Scan diff --git a/CLAUDE.md b/CLAUDE.md index 4053023..a0306ec 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,167 +2,87 @@ **MANDATORY**: Act as principal-level engineer. Follow these guidelines exactly. -## ๐Ÿ‘ค USER CONTEXT +## USER CONTEXT -- **Identify users by git credentials**: Extract name from git commit author, GitHub account, or context -- ๐Ÿšจ **When identity is verified**: ALWAYS use their actual name - NEVER use "the user" or "user" -- **Direct communication**: Use "you/your" when speaking directly to the verified user -- **Discussing their work**: Use their actual name when referencing their commits/contributions -- **Example**: If git shows "John-David Dalton ", refer to them as "John-David" -- **Other contributors**: Use their actual names from commit history/context +- Identify users by git credentials; use their actual name, never "the user" +- Use "you/your" when speaking directly; use names when referencing contributions ## PRE-ACTION PROTOCOL **MANDATORY**: Review CLAUDE.md before any action. No exceptions. -- Before ANY structural refactor on a file >300 LOC: remove dead code, unused exports, unused imports first โ€” commit that cleanup separately before the real work -- Multi-file changes: break into phases (โ‰ค5 files each), verify each phase before the next -- When pointed to existing code as a reference: study it before building โ€” working code is a better spec than any description -- Work from raw error data, not theories โ€” if a bug report has no error output, ask for it +- Before ANY structural refactor on a file >300 LOC: remove dead code first, commit separately +- Multi-file changes: phases of โ‰ค5 files, verify each before the next +- Study existing code before building โ€” working code is a better spec than any description +- Work from raw error data, not theories - On "yes", "do it", or "go": execute immediately, no plan recap ## VERIFICATION PROTOCOL -**MANDATORY**: Before claiming any task is complete: - -1. Run the actual command โ€” execute the script, run the test, check the output +1. Run the actual command โ€” execute, don't assume 2. State what you verified, not just "looks good" -3. **FORBIDDEN**: Claiming "Done" when any test output shows failures, or characterizing incomplete/broken work as complete -4. If type-check or lint is configured, run it and fix ALL errors before reporting done -5. Re-read every file modified; confirm nothing references something that no longer exists +3. **FORBIDDEN**: Claiming "Done" when tests show failures +4. Run type-check/lint if configured; fix ALL errors before reporting done +5. Re-read every modified file; confirm nothing references removed items ## CONTEXT & EDIT SAFETY -- After 10+ messages: re-read any file before editing it โ€” do not trust remembered contents -- Read files >500 LOC in chunks using offset/limit; never assume one read captured the whole file -- Before every edit: re-read the file. After every edit: re-read to confirm the change applied correctly -- When renaming anything, search separately for: direct calls, type references, string literals, dynamic imports, re-exports, test files โ€” one grep is not enough -- Tool results over 50K characters are silently truncated โ€” if search returns suspiciously few results, narrow scope and re-run -- For tasks touching >5 files: use sub-agents with worktree isolation to prevent context decay +- After 10+ messages: re-read files before editing +- Read files >500 LOC in chunks +- Before every edit: re-read. After every edit: re-read to confirm +- When renaming: search direct calls, type refs, string literals, dynamic imports, re-exports, tests +- Tool results over 50K chars are silently truncated โ€” narrow scope and re-run if results seem incomplete +- For tasks touching >5 files: use sub-agents with worktree isolation ## JUDGMENT PROTOCOL -- If the user's request is based on a misconception, say so before executing -- If you spot a bug adjacent to what was asked, flag it: "I also noticed X โ€” want me to fix it?" -- You are a collaborator, not just an executor +- Flag misconceptions before executing +- Flag adjacent bugs: "I also noticed X โ€” want me to fix it?" ## SCOPE PROTOCOL -- Do not add features, refactor, or make improvements beyond what was asked -- Try the simplest approach first; if architecture is actually flawed, flag it and wait for approval before restructuring -- When asked to "make a plan," output only the plan โ€” no code until given the go-ahead +- Do not add features or improvements beyond what was asked +- Simplest approach first; flag architectural flaws and wait for approval ## COMPLETION PROTOCOL -- **NEVER claim done with something 80% complete** โ€” finish 100% before reporting -- When a multi-step change doesn't immediately show gains, commit and keep iterating โ€” don't revert -- If one approach fails, fix forward: analyze why, adjust, rebuild, re-measure โ€” not `git checkout` -- After EVERY code change: build, test, verify, commit. This is a single atomic unit -- Reverting is a last resort after exhausting forward fixes โ€” and requires explicit user approval - -## FILE SYSTEM AS STATE - -The file system is working memory. Use it actively: - -- Write intermediate results and analysis to files in `.claude/` -- Use `.claude/` for plans, status tracking, and cross-session context -- When debugging, save logs and outputs to files for reproducible verification -- Don't hold large analysis in context โ€” write it down, reference it later - -## SELF-IMPROVEMENT - -- After ANY correction from the user: log the pattern to memory so the same mistake is never repeated -- Convert mistakes into strict rules โ€” don't just note them, enforce them -- After fixing a bug: explain why it happened and whether anything prevents that category of bug in the future +- Finish 100% before reporting โ€” never claim done at 80% +- Fix forward, don't revert (reverting requires explicit user approval) +- After EVERY code change: build, test, verify, commit as one atomic unit ## SELF-EVALUATION -- Before calling anything done: present two views โ€” what a perfectionist would reject vs. what a pragmatist would ship -- After fixing a bug: explain why it happened -- If a fix doesn't work after two attempts: stop, re-read the relevant section top-down, state where the mental model was wrong, propose something fundamentally different -- If asked to "step back" or "going in circles": drop everything, rethink from scratch +- Present two views before calling done: what a perfectionist would reject vs. what a pragmatist would ship +- If a fix fails twice: stop, re-read top-down, state where the mental model was wrong ## HOUSEKEEPING -- Before risky changes: offer to checkpoint โ€” "want me to commit before this?" -- If a file is getting unwieldy (>400 LOC): flag it โ€” "this is big enough to cause pain โ€” want me to split it?" +- Offer to checkpoint before risky changes +- Flag files >400 LOC for potential splitting ## ABSOLUTE RULES -- Never create files unless necessary -- Always prefer editing existing files +- Never create files unless necessary; always prefer editing existing files - Forbidden to create docs unless requested -- Required to do exactly what was asked -- ๐Ÿšจ **NEVER use `npx`, `pnpm dlx`, or `yarn dlx`** โ€” use `pnpm exec ` for devDep binaries, or `pnpm run