

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345## Context67This instruction file applies to SQL files and MyBatis XML mapper files. The primary database platform is **IBM DB2** (both z/OS and Linux/Unix/Windows variants). SQL must be compatible with DB2 dialect. Additional awareness of embedded SQL in COBOL programs (via `EXEC SQL ... END-EXEC` blocks) also applies. Security and correctness of queries is paramount — SQL injection via string concatenation is a critical vulnerability that must never appear.89---1011## Coding Standards1213- **Always qualify table names** with the schema prefix: `SCHEMA.TABLE_NAME` — never bare table references14- **Parameterized queries only** — never concatenate user input into SQL strings15- **No `SELECT *`** — always enumerate required columns explicitly16- **Row limiting:** Use DB2 syntax `FETCH FIRST n ROWS ONLY` — never `ROWNUM` (Oracle) or `LIMIT` (MySQL)17- **Upserts:** Prefer `MERGE` statement over separate `INSERT` / `UPDATE` logic18- **Index hints:** Only with a DBA approval comment explaining the rationale19- **Schema migration scripts:** Use sequential versioned names (`V001__description.sql`) for Flyway/Liquibase20- **Transactions:** Explicit `COMMIT` / `ROLLBACK` in batch scripts; in Java, defer to Spring `@Transactional`21- **NULL handling:** Always account for nullable columns — use `COALESCE` or explicit `NULL` checks2223---2425## Preferred Patterns2627### Parameterized Query (JDBC)2829```java30// CORRECT: PreparedStatement with named parameters via NamedParameterJdbcTemplate31String sql = "SELECT c.customer_id, c.customer_name, c.balance " +32 "FROM SCHEMA.CUSTOMERS c " +33 "WHERE c.customer_id = :customerId " +34 "AND c.status = :status";3536MapSqlParameterSource params = new MapSqlParameterSource()37 .addValue("customerId", customerId)38 .addValue("status", status.getCode());3940return jdbc.queryForObject(sql, params, new CustomerRowMapper());41```4243### DB2-Compliant SELECT with FETCH FIRST4445```sql46-- Paginated query with DB2 row limiting syntax47SELECT48 c.customer_id,49 c.customer_name,50 c.email_address,51 c.created_timestamp52FROM53 SCHEMA.CUSTOMERS c54WHERE55 c.status = 'ACTIVE'56 AND c.created_timestamp >= :cutoffDate57ORDER BY58 c.customer_name ASC59FETCH FIRST 100 ROWS ONLY60```6162### MERGE for Upsert6364```sql65MERGE INTO SCHEMA.CUSTOMER_PREFERENCES AS target66USING (VALUES (:customerId, :preferenceKey, :preferenceValue))67 AS source (customer_id, pref_key, pref_value)68ON (target.customer_id = source.customer_id69 AND target.pref_key = source.pref_key)70WHEN MATCHED THEN71 UPDATE SET72 pref_value = source.pref_value,73 updated_timestamp = CURRENT TIMESTAMP74WHEN NOT MATCHED THEN75 INSERT (customer_id, pref_key, pref_value, created_timestamp)76 VALUES (source.customer_id, source.pref_key, source.pref_value, CURRENT TIMESTAMP)77```7879### DB2 Window Function8081```sql82SELECT83 o.order_id,84 o.customer_id,85 o.order_amount,86 SUM(o.order_amount) OVER (87 PARTITION BY o.customer_id88 ORDER BY o.created_date89 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW90 ) AS running_total91FROM92 SCHEMA.ORDERS o93WHERE94 o.status = 'COMPLETED'95```9697### MyBatis XML Mapper9899```xml100<?xml version="1.0" encoding="UTF-8" ?>101<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"102 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">103<mapper namespace="com.example.repository.CustomerMapper">104105 <!-- resultMap preferred over inline resultType for complex mappings -->106 <resultMap id="customerResultMap" type="com.example.domain.Customer">107 <id property="id" column="customer_id"/>108 <result property="name" column="customer_name"/>109 <result property="email" column="email_address"/>110 <result property="balance" column="balance"/>111 <result property="status" column="status" typeHandler="com.example.handler.StatusTypeHandler"/>112 <association property="address" resultMap="addressResultMap"/>113 </resultMap>114115 <select id="findById" parameterType="long" resultMap="customerResultMap">116 SELECT117 c.customer_id,118 c.customer_name,119 c.email_address,120 c.balance,121 c.status,122 a.street,123 a.city,124 a.postal_code125 FROM126 SCHEMA.CUSTOMERS c127 LEFT JOIN SCHEMA.ADDRESSES a ON a.customer_id = c.customer_id128 WHERE129 c.customer_id = #{id}130 FETCH FIRST 1 ROWS ONLY131 </select>132133 <select id="findByStatus" resultMap="customerResultMap">134 SELECT135 c.customer_id,136 c.customer_name,137 c.email_address,138 c.balance,139 c.status140 FROM141 SCHEMA.CUSTOMERS c142 WHERE143 c.status = #{status}144 <if test="createdAfter != null">145 AND c.created_timestamp >= #{createdAfter}146 </if>147 ORDER BY c.customer_name ASC148 </select>149150 <insert id="insert" parameterType="com.example.domain.Customer">151 INSERT INTO SCHEMA.CUSTOMERS152 (customer_id, customer_name, email_address, balance, status, created_timestamp)153 VALUES154 (#{id}, #{name}, #{email}, #{balance}, #{status}, CURRENT TIMESTAMP)155 </insert>156157</mapper>158```159160### DB2 Embedded SQL (COBOL context)161162```cobol163 * CORRECT: Host variables with proper SQLCODE check164 MOVE WS-INPUT-ID TO HV-CUSTOMER-ID165 EXEC SQL166 SELECT CUSTOMER_NAME,167 BALANCE,168 STATUS169 INTO :HV-CUST-NAME,170 :HV-BALANCE,171 :HV-STATUS172 FROM SCHEMA.CUSTOMERS173 WHERE CUSTOMER_ID = :HV-CUSTOMER-ID174 END-EXEC175 EVALUATE SQLCODE176 WHEN 0177 CONTINUE178 WHEN 100179 MOVE 'NOT FOUND' TO WS-ERROR-MSG180 WHEN OTHER181 MOVE SQLCODE TO WS-SQLCODE182 PERFORM 9900-SQL-ERROR183 END-EVALUATE.184```185186---187188## Anti-Patterns — Do NOT Generate189190```java191// WRONG: string concatenation in SQL — SQL injection vulnerability [BLOCKER]192String sql = "SELECT * FROM CUSTOMERS WHERE ID = " + customerId;193Statement stmt = conn.createStatement();194stmt.execute(sql);195196// WRONG: SELECT * — fetches unnecessary columns, breaks on schema changes197"SELECT * FROM SCHEMA.ORDERS WHERE status = :status"198199// WRONG: ROWNUM syntax (Oracle) — DB2 uses FETCH FIRST200"SELECT id FROM SCHEMA.ORDERS WHERE ROWNUM <= 10"201202// WRONG: LIMIT syntax (MySQL/PostgreSQL) — DB2 uses FETCH FIRST203"SELECT id FROM SCHEMA.ORDERS LIMIT 10"204205// WRONG: unqualified table name — breaks cross-schema deployments206"SELECT id FROM ORDERS WHERE status = :status"207208// WRONG: inline resultType for complex mappings — use resultMap209<select id="find" resultType="com.example.Customer">210```211212```sql213-- WRONG: non-parameterized dynamic SQL in a stored procedure214SET V_SQL = 'SELECT * FROM ' || V_TABLE_NAME || ' WHERE ID = ' || V_INPUT_ID;215-- Use parameterized EXECUTE IMMEDIATE with USING clause instead216```217218---219220## Dependencies & Versions221222| Technology | Version | Notes |223|-----------|---------|-------|224| DB2 | 12.x (z/OS) / 11.x (LUW) | Use DB2-specific syntax for row limiting, window functions |225| MyBatis | 3.5.x | XML mapper format documented above |226| Spring JDBC | (with Spring) | `NamedParameterJdbcTemplate` preferred over plain `JdbcTemplate` |227| Flyway | 9.x+ | Migration scripts: `V{version}__{description}.sql` |228| Liquibase | 4.x+ | Alternative migration tool — YAML or XML changesets |229230---231232## Test Conventions233234- Test SQL and MyBatis mappers with `@DataJpaTest` (JPA) or an embedded H2 database (JdbcTemplate/MyBatis)235- When H2 compatibility mode is insufficient for DB2 syntax, use Testcontainers with `ibmcom/db2` image236- Verify both the happy path (row found) and not-found cases for every query237- Test `MERGE` statements by setting up pre-existing rows and verifying both insert and update branches238- Validate that pagination queries respect `FETCH FIRST` limits and return the correct page239
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 |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 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 | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 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-sql-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.