ai

Junie Guidelines.md

Guidelines for Junie


### Before Starting Work - **Always check for a clean working directory before starting.** Use stashing if needed. Name the stash `{timestamp}-{short-description}`. - **Create a new git branch** before starting any work. - **Use a clear naming convention** for branches: `feature/{short-description}`, `bugfix/{short-description}`, `refactor/{short-description}`, etc. - **Write down the timestamp** of the session start. Format: `yyyy-MM-dd_hh-mm` --- ### Planning Phase - **Generate the plan file at `.junie/plans/plan-{timestamp}.md`** before writing any code. - **Generate the task list at `.junie/tasks/tasks-{timestamp}.md`** derived from the plan. - **Generate your notes list at `.junie/tasks/notes-{timestamp}.md`** . - Do **not** store any `plan-*.md` or `tasks-*.md` or `notes-*.md` in the project root. - **Use the plan file to generate a detailed, enumerated task list.** - **Ensure each task is atomic** (can be completed independently). --- ### Execution Phase - **Do the work as defined by the user prompt and the task list.** - **After each task is completed, mark it as done** in the `tasks-{timestamp}.md` file. - **Log any deviations** from the plan (with justification) in `notes-{timestamp}.md`. - **When generating code, include comments** with: - Junie signature - Date - Purpose of the code - **Always follow project-specific code style** and naming conventions. - **Run formatting and linting tools** automatically after code generation. - **Include or update unit tests** for each new feature or bug fix. - **Run existing test suites before and after** making changes to ensure stability. - **Update documentation** (README, internal wikis, etc.) if functionality or APIs are affected. --- ### Testing - Use JUnit 5 for all unit tests. - Place test classes in the `src/test/java` directory. - Ensure code coverage remains above 85%. ## Code Style - Follow the Google Java Style Guide. - Use 4 spaces for indentation. - Limit line length to 100 characters. - Use Maven as the build tool. - Use Java 24 to run the project and maven. ## Dependencies - Prefer using Maven for dependency management. - Avoid introducing new dependencies without approval. - Use Lombok for boilerplate code reduction (e.g., getters, setters, constructors). - When using Spring Boot use Actuator, DevTools. - When using Spring Boot use 3.5.0. - Use Java 24. - Junit 5 for testing. - Use Mockito for mocking in tests. - Use AssertJ for fluent assertions in tests. ## Database - Store database configurations in `src/main/resources/application.properties`. - use localhost:3306 with user root and password Password123! - name the database to the projectname. when there is a database with the same name then {projectname}-{timestamp} ## Security - Sanitize all user inputs to prevent SQL injection. - Implement authentication using Spring Security. --- ### Completion - **Before final commit**, re-verify that: - All tasks are marked as completed in `tasks-{timestamp}.md` - All relevant files (plan, tasks, notes) contain the correct timestamp - All generated and modified files are added and committed - **Commit the work with a concise summary** of the changes in the commit message. --- ### Final Step - **Automatically open a pull request** upon pushing the branch to remote. ## Prompt for new user login EXAMPLE I want to implement a new login feature. Before you write any code: - Create a new git branch: feature/login-ui - Timestamp: 2025-04-23_10-45 - Create plan-2025-04-23_10-45.md outlining your approach - Generate tasks-2025-04-23_10-45.md from the plan (each task should be atomic) - Then wait for me to confirm before starting implementation.
Subscribe to RSS - ai