prpm / rules
Cursor rule122 starsChanged 9 months agoMITView on GitHub
Command Used: - npm v6: npm install --production - npm v7+: npm install --omit=dev Pros: - Smaller deployment packages - Consistent with npm ecosystem - Uses platform's npm version Cons: - Slower deployments (install on every deploy) - Requires all packages to be in npm registry - Can fail with network issues or registry problems AWS officially recommends bundling node_modules to "bypass potential npm registry installation issues." When to use this approach: 1. Packages not published to npm registry (monorepo…
- Deletes or force-pushes
- Installs packages
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
The file
We split this elastic-beanstalk-deployment.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 81
Must ensure platform-compatible binaries
- Distinctive: line 127
Verify all packages are actually installed (not symlinked)
- Very specific: line 152
When bundling node_modules, migrations can run immediately since dependencies are present:
- Very specific: line 172
Solution: Verify node_modules/X exists and isn't a symlink
- Very specific: line 176
Solution: Use bundled node_modules approach above
- Very specific: line 187
Consider using .ebignore file
- Distinctive: line 192
Verify deployment package: before uploading to S3
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Elastic Beanstalk Node.js Deployment Rules
Official AWS Documentation
Reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-platform-dependencies.html
Dependency Installation Behavior
When EB Runs npm install
Elastic Beanstalk will automatically run npm install when:
- A
package.jsonfile exists in the deployment - NO
node_modulesdirectory is present
When EB Skips npm install
EB will skip dependency installation if:
- A
node_modulesdirectory is already present in the deployment package - Dependencies are pre-installed and bundled
Command Used:
- npm v6:
npm install --production - npm v7+:
npm install --omit=dev
Recommended Deployment Approaches
Primary Method: Let EB Install Dependencies
# GitHub Actions workflow
- name: Build application
run: npm run build
- name: Create deployment package
run: |
zip -r app.zip \
dist/ \
package.json \
package-lock.json \
.ebextensions/Pros:
- Smaller deployment packages
- Consistent with npm ecosystem
- Uses platform's npm version
Cons:
- Slower deployments (install on every deploy)
- Requires all packages to be in npm registry
- Can fail with network issues or registry problems
Alternative Method: Bundle node_modules (AWS Recommended for Special Cases)
AWS officially recommends bundling node_modules to "bypass potential npm registry installation issues."
When to use this approach:
- Packages not published to npm registry (monorepo workspace packages)
- Private packages requiring authentication
- Need for deployment speed/reliability
- Network-restricted environments
# GitHub Actions workflow
- name: Install production dependencies
run: npm install --omit=dev
- name: Create deployment package
run: |
zip -r app.zip \
dist/ \
package.json \
node_modules/ \
.ebextensions/Pros:
- Bypasses npm registry issues
- Faster deployments (no install phase)
- Works with monorepo workspace packages
- Reliable and predictable
Cons:
- Larger deployment packages (50-100MB typical)
- Must ensure platform-compatible binaries
Monorepo / Workspace Package Strategy
For projects with workspace dependencies (e.g., @prpm/types that isn't published to npm):
Problem
Running npm ci --production inside a monorepo workspace:
- Creates symlinks to workspace packages
- Doesn't copy actual package files
- Results in incomplete
node_modules(~3MB instead of ~50MB) - Causes "Cannot find package" errors during deployment
Solution: Install in Clean Context
- name: Create standalone package.json
run: |
mkdir -p /tmp/clean-install
cd /tmp/clean-install
# Copy package.json and replace workspace refs with file paths
cp $GITHUB_WORKSPACE/packages/app/package.json .
jq --arg workspace "$GITHUB_WORKSPACE" \
'.dependencies["@workspace/pkg"] = "file:\($workspace)/packages/pkg"' \
package.json > package.json.tmp
mv package.json.tmp package.json
- name: Install dependencies (outside workspace)
run: |
cd /tmp/clean-install
npm install --omit=dev --legacy-peer-deps
# Verify critical packages
test -d node_modules/pg || exit 1
test -d node_modules/@workspace/pkg/dist || exit 1
- name: Copy to deployment location
run: |
rm -rf packages/app/node_modules
cp -r /tmp/clean-install/node_modules packages/app/Key Points:
- Install outside the monorepo workspace context
- Convert workspace dependencies to
file:references - Verify all packages are actually installed (not symlinked)
- Bundle the complete
node_modulesin deployment
Environment Configuration
Override Production Install Mode
Set environment variable in Beanstalk console:
NPM_USE_PRODUCTION=falseSpecify Node.js Version
In package.json:
{
"engines": {
"node": "20.x"
}
}Note: Version range feature not available on Amazon Linux 2023
Container Commands for Migrations
When bundling node_modules, migrations can run immediately since dependencies are present:
# .ebextensions/migrations.config
container_commands:
01_run_migrations:
command: npm run migrate
leader_only: trueDependencies are available because:
- EB extracts deployment package to
/var/app/staging/ node_modules/is already present- EB skips
npm installstep - Migrations run with all dependencies available
Troubleshooting
Issue: "Cannot find package 'X'"
Cause: Package not installed or symlinked
Solution: Verify node_modules/X exists and isn't a symlink
Issue: "npm install fails with workspace package not found"
Cause: Workspace package not in npm registry
Solution: Use bundled node_modules approach above
Issue: Binary compatibility errors
Cause: Native modules compiled for wrong platform Solution: Install dependencies in Linux environment or use Docker
Issue: Deployment package too large (>500MB)
Cause: Dev dependencies or unnecessary files included Solution:
- Use
--omit=devflag - Exclude
.cache, test files, etc. from zip - Consider using
.ebignorefile
Best Practices
- Always include package-lock.json for reproducible builds
- Verify deployment package before uploading to S3
- Test locally with the bundled node_modules
- Monitor first deployment closely when switching approaches
- Keep deployment packages for potential rollback
Verification Steps
Before deploying, verify:
# Check node_modules size (should be 50MB+ for typical apps)
du -sh node_modules
# Verify critical packages exist
ls -la node_modules/pg
ls -la node_modules/fastify
ls -la node_modules/@your-workspace/package
# Check for symlinks (should see real directories, not links)
file node_modules/@your-workspace/package
# Verify dist directories for workspace packages
test -d node_modules/@your-workspace/package/distExample: PRPM Registry Deployment
This project uses the bundled node_modules approach because:
@prpm/typesis a workspace package, not published to npm- Requires reliable deployments without registry dependencies
- Migrations need
pgpackage immediately available
See .github/workflows/deploy-registry.yml for implementation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

