This document is the primary authoritative source of context for all AI assistants (Claude, GitHub Copilot, Codeium, Continue.dev, Junie, etc.) contributing to OWASP Juice Shop. It provides comprehensive guidelines to maintain code quality, security, and adherence to project standards.
- Project: OWASP Juice Shop - an intentionally insecure web application for security training
- Primary Languages: TypeScript, JavaScript, Angular (frontend)
- Key Technologies: Node.js (22–25 with 24 being the default), Express, SQLite/Sequelize, MongoDB/MarsDB, Angular 21.x
- Testing: Node.js built-in test runner (server unit tests), Supertest (API integration), Vitest (frontend unit tests), Cypress (E2E tests)
- Code Style: JS Standard Style (enforced via ESLint)
- Repository: juice-shop/juice-shop
app.ts/server.ts- Application entry pointslib/- Utility functions and libraries (includinglib/startup/for initialization)routes/- Express route handlersmodels/- Sequelize data models (SQLite)data/- Data creation and management (data/static/for challenges, users, codefixes)views/- Server-rendered templates (Handlebars.hbsand Pug.pug)test/server/- Server unit tests (Node.js built-in test runner)test/api/- API integration tests (Node.js built-in test runner + Supertest)frontend/src/- Angular frontend code (tests use Vitest)cypress/- E2E tests (Cypress)rsn/- Refactoring Safety Net scripts and cacheconfig/- Configuration files (YAML, multiple themed configs likectf.yml,default.yml)i18n/- Internationalization files (do NOT modify directly)ftp/- Files served via the simulated FTP directorymonitoring/- Grafana dashboard config.github/workflows/- CI/CD pipelinesencryptionkeys/- Encryption key files
- Security Context: This project contains intentional vulnerabilities for training. New vulnerabilities must be approved by maintainers and well-documented.
- Challenge Development: Consult maintainers before creating new challenges. AI-generated challenges risk being duplicate, unsolvable, or dysfunctional.
- Code Changes and RSN: When modifying challenge-related code, the Refactoring Safety Net must pass.
- Dependency Updates: Verify compatibility with
package.jsonandfrontend/package.json. - Translation Modifications: Use Crowdin, not direct file editing.
- Code Analysis: Understanding existing code structure and patterns
- Refactoring: Improving code quality while maintaining functionality
- Test Writing: Creating unit, integration, and e2e tests
- Bug Fixing: Identifying and resolving issues
- Documentation: Writing clear comments and documentation
- Challenge Development: Consult with maintainers before creating new challenges.
- Security Vulnerabilities: Ensure AI-suggested vulnerabilities are intentional and appropriate for the project.
- Dependencies: Verify any suggested package updates for compatibility.
- Architecture Changes: Discuss major structural changes with maintainers first.
Required per CONTRIBUTING.md rule #6: Remove unnecessary AI-generated content before submitting PRs.
Remove:
- Verbose comments explaining obvious code
- Generic placeholder comments
- Overly detailed docstrings for simple functions
- Repetitive explanations,
console.logstatements
Keep:
- Meaningful comments for complex logic
- Challenge hints and metadata
- Security-relevant documentation
Always run ESLint before committing (unless only REFERENCES.md or SOLUTIONS.md were modified):
npm run lintThe AI should suggest code following JS Standard Style, but always verify.
For any code changes (unless only REFERENCES.md or SOLUTIONS.md were modified):
- Unit/Integration Tests: New features and changes should have tests.
- E2E Tests: Required for new/modified challenges.
- RSN (Refactoring Safety Net): Required when modifying existing code that is part of a coding challenge (see the verify-rsn-fix skill for details).
- Run Tests Locally:
npm test # Runs frontend, server, and api tests npm run test:frontend # Frontend unit tests (Vitest) npm run test:server # Server unit tests only (Node.js built-in test runner) npm run test:api # API integration tests (Node.js built-in test runner + Supertest) npm start & npm run test:e2e # E2E tests (Cypress) npm run rsn # Refactoring Safety Net
All commits must be signed off (DCO):
git commit -s -m "Your commit message"- Work on
developbranch-based feature branches. - Keep PRs focused on a single scope.
- Reference related issues in PR descriptions.
Ask the AI to:
- Explain specific components or patterns.
- Identify where to implement new features.
- Trace code execution paths.
Ask the AI to:
- Generate initial implementation.
- Suggest test cases.
- Review for security implications.
Before committing:
- Remove AI-generated noise.
- Run
npm run lint(unless onlyREFERENCES.mdorSOLUTIONS.mdwere modified). - Run relevant test suites.
- If you modified code that is part of a coding challenge, run
npm run rsn. - Manually verify functionality.
- Check for unintended changes.
Ask the AI to:
- Write clear commit messages.
- Draft PR descriptions.
- Document complex logic.
❌ Don't: Accept AI suggestions blindly without understanding them. ✅ Do: Review and understand all AI-generated code.
❌ Don't: Submit PRs with verbose AI-generated comments. ✅ Do: Clean up and keep only meaningful comments.
❌ Don't: Skip testing because AI "seems confident". ✅ Do: Always run the full test suite.
❌ Don't: Use AI for contribution farming or trivial changes. ✅ Do: Make meaningful contributions that add value.
❌ Don't: Let AI modify translations directly. ✅ Do: Use Crowdin for translations.
- Analyze: Ask the AI to analyze the issue.
- Locate: Locate the problematic code.
- Implement: Implement the fix with the AI's help.
- Test: Generate tests and run the suite.
- RSN: Run
npm run rsnif the fix affects code used in a coding challenge. - Sign-off: Clean up and commit with sign-off (
git commit -s).
Before submitting a PR:
- Code follows JS Standard Style (ESLint passes)
- AI-generated noise removed
- Tests added/updated and passing
- RSN check passing (if modified code relevant for a coding challenge)
- Manual testing completed
- Commits are signed off
- PR based on
developbranch - Single, focused scope
- All CI checks passing
When modifying existing code that is part of a coding challenge, you must run the RSN to ensure code snippet and fix option files remain consistent:
npm run rsn- If RSN fails: Review the listed differences.
- If changes are intentionally part of the coding challenge, update the differences cache:
npm run rsn:update. - IMPORTANT: Utilize the verify-rsn-fix skill.
- When refactoring source code that is part of a challenge snippet, manually apply the same changes to the corresponding codefix files in
data/static/codefixes/to maintain consistency.
- Authoritative Guide: AGENTS.md
- Contribution Guidelines: CONTRIBUTING.md
- Project Documentation: pwning.owasp-juice.shop
- Community: GitHub issues and discussions.
- add-reference skill: Instructions for adding new blog posts, talks, or other references to
REFERENCES.md - add-solution skill: Instructions for adding new hacking guides, videos, or tools to
SOLUTIONS.md - create-m3-theme skill: Instructions for creating new Angular Material M3 themes
- generate-release-notes skill: Instructions for generating release notes.
- verify-challenge skill: Instructions for verifying new challenges fulfill all project requirements and metadata
- verify-rsn-fix skill: Instructions for identifying and fixing broken RSN caused by code changes
To verify that an AI agent (like GitHub Copilot or Claude) is correctly using this context, you can use the following test prompts:
- Check Primary Guidelines: "What are the security constraints for developing new challenges in this project? Refer to the primary agent guidelines."
- Expected Result: The agent should summarize constraints from the "Important Constraints" section of this file.
- Check Skill Discovery: "How do I fix a break in the Refactoring Safety Net (RSN)? Is there a skill for this?"
- Expected Result: The agent should point to the
verify-rsn-fixskill located in./.ai/skills/verify-rsn-fix/SKILL.md.
- Expected Result: The agent should point to the
- Check Skill Content: "Show me the checklist for verifying a new challenge."
- Expected Result: The agent should find and display the content from
./.ai/skills/verify-challenge/checklists/challenge-checklist.md.
- Expected Result: The agent should find and display the content from
AI agents are productivity tools for enhancing development. You (or the person reviewing the PR) are responsible for the quality, correctness, and security of all contributions. Always review AI-generated code critically, test thoroughly, and follow the project's guidelines.
Last Updated: April 2026