Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .claude/rules/pnpm-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ fish -c "<command>"
2. **Binary not found**: Use `pnpm dlx` instead of `pnpm exec`
3. **Permission errors**: Check node_modules permissions

## Security Settings

The project uses pnpm security settings to protect against supply chain attacks.
These are configured in `pnpm-workspace.yaml`:

| Setting | Purpose |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `strictDepBuilds: true` | Blocks lifecycle scripts (postinstall, etc.) by default. Only packages in `onlyBuiltDependencies` can run build scripts. |
| `blockExoticSubdeps: true` | Blocks dependencies from non-registry sources (Git repos, tarball URLs). |
| `trustPolicy: no-downgrade` | Prevents trust level downgrades between versions (e.g., from GitHub OIDC to basic auth). |

If a new dependency requires build scripts, add it to `onlyBuiltDependencies` in `pnpm-workspace.yaml`.

Reference: https://pnpm.io/settings

## Publishing & Deployment

When ready to release:
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/nix-workflow.mdc
14 changes: 14 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ onlyBuiltDependencies:

shellEmulator: true

# Security settings (supply chain attack prevention)
# See: https://pnpm.io/settings

# Blocks lifecycle scripts (postinstall, etc.) from running in dependencies by default
# Only packages listed in onlyBuiltDependencies can run build scripts
# Prevents Shai-Hulud-style worm attacks that exploit automatic script execution
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "Prevents Shai-Hulud-style worm attacks" is an informal / unclear reference and also overstates what strictDepBuilds guarantees. Consider replacing it with a neutral description (e.g., "mitigates supply-chain risk from dependency lifecycle scripts") and/or link to a concrete advisory if you want to reference a specific incident.

Suggested change
# Prevents Shai-Hulud-style worm attacks that exploit automatic script execution
# Mitigates supply-chain risk from dependency lifecycle scripts that run automatically

Copilot uses AI. Check for mistakes.
strictDepBuilds: true

# Blocks dependencies from non-registry sources (Git repos, tarball URLs)
# Prevents PhantomRaven-style attacks that bypass npm scanning
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above: the "Prevents PhantomRaven-style attacks" comment is hard to validate and may not be meaningful to future maintainers. Recommend rewording to a concise, incident-agnostic explanation of what blockExoticSubdeps enforces (and/or link to an external reference).

Suggested change
# Prevents PhantomRaven-style attacks that bypass npm scanning
# Reduces supply-chain risk from unvetted or externally sourced subdependencies

Copilot uses AI. Check for mistakes.
blockExoticSubdeps: true

# Prevents trust level downgrades between package versions
# Blocks installations when publisher credentials downgrade from GitHub OIDC to basic auth
trustPolicy: no-downgrade

trustPolicyExclude:
Expand Down
Loading