

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345## Context67This instruction file applies to legacy Java modules built on Spring 4.x or 5.x using the traditional XML + annotation configuration model. These modules are servlet-based, use `JdbcTemplate` for data access (not Spring Data JPA), and are packaged as WAR files deployed to an application server (e.g., IBM WebSphere, JBoss EAP, Apache Tomcat). The Java baseline is Java 8 or Java 11. Do not apply Spring Boot auto-configuration assumptions to this code.89---1011## Coding Standards1213- **Java version:** Java 8 or 11 — do not use records, sealed classes, text blocks, `var` (Java 11 only with care), or any feature requiring Java 14+14- **Spring version:** Spring 4.x or 5.x — use `org.springframework` imports, not `org.springframework.boot`15- **No Spring Boot:** Do not generate `@SpringBootApplication`, `@EnableAutoConfiguration`, or any `spring-boot` dependency references16- **No Spring Data JPA:** Use `JdbcTemplate` or `NamedParameterJdbcTemplate` for all data access17- **XML config awareness:** Be aware that `applicationContext.xml` and `dispatcher-servlet.xml` may define beans; do not duplicate them in Java config without understanding the existing XML18- **Transaction management:** Use `@Transactional` with explicit `propagation` and `rollbackFor` — never rely on defaults silently19- **Constructor or setter injection:** Field injection is legacy-acceptable but constructor injection is preferred for new code20- **Logging:** SLF4J + Logback (or Log4j2) — never `System.out.println`2122---2324## Preferred Patterns2526### Spring MVC Controller (Legacy)2728```java29@Controller30@RequestMapping("/customers")31public class CustomerController {3233 private static final Logger log = LoggerFactory.getLogger(CustomerController.class);3435 private final CustomerService customerService;3637 public CustomerController(CustomerService customerService) {38 this.customerService = customerService;39 }4041 @RequestMapping(value = "/{id}", method = RequestMethod.GET)42 public String getCustomer(@PathVariable Long id, Model model) {43 log.debug("Fetching customer with id {}", id);44 model.addAttribute("customer", customerService.findById(id));45 return "customer/detail";46 }4748 @RequestMapping(value = "/", method = RequestMethod.POST)49 public String createCustomer(@Valid @ModelAttribute CustomerForm form,50 BindingResult result, RedirectAttributes redirect) {51 if (result.hasErrors()) {52 return "customer/form";53 }54 customerService.create(form);55 redirect.addFlashAttribute("message", "Customer created successfully");56 return "redirect:/customers/";57 }58}59```6061### REST Endpoint (Legacy Spring MVC)6263```java64@Controller65@RequestMapping("/api/orders")66public class OrderRestController {6768 private final OrderService orderService;6970 public OrderRestController(OrderService orderService) {71 this.orderService = orderService;72 }7374 @RequestMapping(value = "/{id}", method = RequestMethod.GET,75 produces = MediaType.APPLICATION_JSON_VALUE)76 @ResponseBody77 public OrderDto getOrder(@PathVariable Long id) {78 return orderService.findById(id);79 }80}81```8283### JdbcTemplate Data Access8485```java86@Repository87public class OrderJdbcRepository {8889 private static final Logger log = LoggerFactory.getLogger(OrderJdbcRepository.class);9091 private final NamedParameterJdbcTemplate jdbc;9293 public OrderJdbcRepository(NamedParameterJdbcTemplate jdbc) {94 this.jdbc = jdbc;95 }9697 public Optional<Order> findById(Long id) {98 String sql = "SELECT o.id, o.customer_id, o.status, o.created_at " +99 "FROM SCHEMA.ORDERS o WHERE o.id = :id";100 MapSqlParameterSource params = new MapSqlParameterSource("id", id);101 try {102 Order order = jdbc.queryForObject(sql, params, new OrderRowMapper());103 return Optional.ofNullable(order);104 } catch (EmptyResultDataAccessException e) {105 log.debug("Order {} not found", id);106 return Optional.empty();107 }108 }109}110```111112### Transaction Management113114```java115@Service116@Transactional(readOnly = true)117public class OrderService {118119 @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)120 public Order createOrder(CreateOrderRequest request) {121 // transactional write operation122 }123124 @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)125 public void processPayment(Long orderId) {126 // runs in its own transaction — outer transaction is suspended127 }128}129```130131### Exception Handling (Legacy HandlerExceptionResolver)132133```java134@Component135public class GlobalExceptionHandler implements HandlerExceptionResolver {136137 private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);138139 @Override140 public ModelAndView resolveException(HttpServletRequest request,141 HttpServletResponse response,142 Object handler, Exception ex) {143 log.error("Unhandled exception on {} {}", request.getMethod(), request.getRequestURI(), ex);144 response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);145 return new ModelAndView("error/500");146 }147}148```149150### Maven Multi-Module Structure151152```xml153<!-- Parent pom.xml -->154<project>155 <groupId>com.example</groupId>156 <artifactId>my-app</artifactId>157 <version>1.0.0-SNAPSHOT</version>158 <packaging>pom</packaging>159160 <modules>161 <module>my-app-core</module>162 <module>my-app-web</module>163 <module>my-app-service</module>164 </modules>165166 <dependencyManagement>167 <dependencies>168 <!-- Centralize versions here -->169 </dependencies>170 </dependencyManagement>171</project>172```173174### MapStruct Mapper (Legacy)175176```java177@Mapper(componentModel = "spring")178public interface CustomerMapper {179180 CustomerDto toDto(Customer customer);181182 Customer toEntity(CustomerDto dto);183184 List<CustomerDto> toDtoList(List<Customer> customers);185}186```187188---189190## Anti-Patterns — Do NOT Generate191192```java193// WRONG: Spring Boot annotations in a legacy module194@SpringBootApplication195public class MyApp { ... }196197// WRONG: Spring Data JPA in a JdbcTemplate project198public interface OrderRepository extends JpaRepository<Order, Long> { ... }199200// WRONG: javax.persistence imports where JdbcTemplate is the pattern201import javax.persistence.Entity;202203// WRONG: @Autowired field injection (prefer constructor injection)204@Autowired205private CustomerService customerService;206207// WRONG: raw JDBC Statement with string concatenation (SQL injection risk)208Statement stmt = conn.createStatement();209stmt.execute("SELECT * FROM ORDERS WHERE ID = " + id);210211// WRONG: new Java features incompatible with Java 8 target212record Customer(Long id, String name) {} // Java 16+ — not available213214// WRONG: silently swallowing exceptions215try {216 service.process(request);217} catch (Exception e) {218 // do nothing219}220```221222---223224## Dependencies & Versions225226| Library | Version | Notes |227|---------|---------|-------|228| Spring Framework | 4.3.x or 5.3.x | `org.springframework` |229| Spring Security | 4.x or 5.x | `WebSecurityConfigurerAdapter` still valid |230| JdbcTemplate | (with Spring) | `org.springframework.jdbc` |231| MapStruct | 1.5.x | Annotation processor — declare in `<build><plugins>` |232| Jackson | 2.x | `com.fasterxml.jackson` |233| SLF4J + Logback | 1.7.x / 1.2.x | `org.slf4j`, `ch.qos.logback` |234| Java | 8 or 11 | No records, no sealed classes |235236---237238## Test Conventions239240- Use `@RunWith(SpringJUnit4ClassRunner.class)` or `@ExtendWith(SpringExtension.class)` (JUnit 5)241- Spring MVC tests: `MockMvc` with `standaloneSetup` or `@WebMvcTest`242- JdbcTemplate tests: Use an embedded H2 database with a test schema script243- Test configuration: Use `@ContextConfiguration` pointing to test-specific XML or `@TestConfiguration` classes244- Name unit tests `*Test.java`, integration tests `*IT.java`245- Avoid starting the full application context in unit tests — use `Mockito` mocks246
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| doubts-suplab/eeik-bootstrap.clinerules/golden-rules.md · 1 | Cline rules | gitsecuritydo-not | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.clinerules/project.md · 1 | Cline rules | teststylegit | 63/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/architecture.mdc · 1 | Cursor rules | do-not | 52/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/capabilities.mdc · 1 | Cursor rules | teststylegit | 58/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/golden-rules.mdc · 1 | Cursor rules | gitsecuritydo-not | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/python.mdc · 1 | Cursor rules | lint-formatstyletypesapi+1 | 77/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/security.mdc · 1 | Cursor rules | security | 39/100 | today | |
| doubts-suplab/eeik-bootstrap.github/copilot-instructions.md · 1 | Copilot instructions | lint-formatstyletesting-strategygit+2 | 54/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/a2a-protocol.instructions.md · 1 | Copilot instructions | styleagent-behaviour | 48/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/ai-governance.instructions.md · 1 | Copilot instructions | stylearchdo-notagent-behaviour | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/angular.instructions.md · 1 | Copilot instructions | teststyletypestesting-strategy+4 | 69/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/architecture-governance.instructions.md · 1 | Copilot instructions | testlint-formatstylegit+4 | 65/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/autogen.instructions.md · 1 | Copilot instructions | typessecurityagent-behaviour | 50/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/aws-architecture.instructions.md · 1 | Copilot instructions | styletypessecurityperformance | 58/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/aws-data-ml-ai.instructions.md · 1 | Copilot instructions | deployment | 54/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/cdk-terraform.instructions.md · 1 | Copilot instructions | teststylearchtypes+2 | 96/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/cicd.instructions.md · 1 | Copilot instructions | stylesecuritydeploymentdo-not+1 | 65/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/containerisation.instructions.md · 1 | Copilot instructions | buildstylesecuritydo-not | 77/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/crewai.instructions.md · 1 | Copilot instructions | styleagent-behaviour | 48/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/data-engineering.instructions.md · 1 | Copilot instructions | teststyletypesgit+5 | 69/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/doubts-suplab-eeik-bootstrap-github-instructions-java-legacy-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.