[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CNJFQS97HZ666Y13RANQFT":3,"skill-same:01M7CNJFQS97HZ666Y13RANQFT":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CNJFQS97HZ666Y13RANQFT","backend-db-discipline",null,"Backend and database performance discipline. Prevents N+1 queries, unbounded tables, missing indexes, and resource leaks.","arbasyaa\u002Fmy-pi-setup","arbasyaa","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233517565?v=4","01M7CNHFSZRYGVHAPH9HAD7YF0","Arbasya Anandito","01M7CNHFTN4QAT1R8NRS4XRYTP",3,"MIT","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fbackend-db-discipline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: backend-db-discipline\ndescription: \"Backend and database performance discipline. Prevents N+1 queries, unbounded tables, missing indexes, and resource leaks.\"\n---\n\n# Backend & Database Performance Discipline\n\n> Fast and robust backends come from disciplined data access patterns, not afterthought optimizations. Enforce these backend and database guardrails across all API and persistence layers.\n\n---\n\n## 1. Anti N+1 Query Elimination\n- **FORBIDDEN:** Executing database queries inside loops or mapping over arrays (e.g. `items.map(async item => await db.user.find(...))`).\n- Always use:\n  - Relation eager loading (`include`, `select_related`, `prefetch_related`).\n  - Batching \u002F `DataLoader` patterns for GraphQL or distributed resolvers.\n  - SQL `JOIN`s or `WHERE id IN (...)` queries to fetch related entities in a single round-trip.\n\n## 2. Unbounded Query Prevention (Pagination by Default)\n- **FORBIDDEN:** Fetching full tables without limits (e.g., `SELECT * FROM orders` or unbounded `.findMany()`).\n- Any collection endpoint or query that can grow over time **must** implement pagination (cursor-based preferred, or offset with a hard limit like `limit = min(req.limit, 100)`).\n- Select only the specific fields needed by the view or consumer; avoid returning massive columns (like raw JSON blobs or text bodies) when only an ID or summary is needed.\n\n## 3. Indexing & Schema Guardrails\n- Ensure every column queried in `WHERE`, `ORDER BY`, `GROUP BY`, or `JOIN ON` has a supporting index.\n- Foreign key columns must always be indexed to prevent table scans during cascading operations and joins.\n- Create explicit migration files whenever adding or modifying database tables, columns, or indexes.\n\n## 4. Transactional Integrity & Idempotency\n- Multi-step write operations that depend on each other must be wrapped in atomic transactions (e.g., `db.$transaction`, `BEGIN...COMMIT`).\n- Roll back immediately on error; never leave the database in a partially-updated state.\n- Critical operations (payment processing, order creation, state transitions) must support idempotency (e.g., idempotency keys or unique constraint handling).\n\n## 5. Connection & Resource Lifecycle Management\n- Always release or close database connections, file handles, streams, and network sockets in `finally` blocks, context managers (`with`), or automated resource scopes.\n- Prevent connection pool exhaustion by keeping transaction durations as short as possible. Do not perform slow network calls or heavy CPU work inside an open database transaction.\n","# Backend & Database Performance Discipline\n\n> Fast and robust backends come from disciplined data access patterns, not afterthought optimizations. Enforce these backend and database guardrails across all API and persistence layers.\n\n---\n\n## 1. Anti N+1 Query Elimination\n- **FORBIDDEN:** Executing database queries inside loops or mapping over arrays (e.g. `items.map(async item => await db.user.find(...))`).\n- Always use:\n  - Relation eager loading (`include`, `select_related`, `prefetch_related`).\n  - Batching \u002F `DataLoader` patterns for GraphQL or distributed resolvers.\n  - SQL `JOIN`s or `WHERE id IN (...)` queries to fetch related entities in a single round-trip.\n\n## 2. Unbounded Query Prevention (Pagination by Default)\n- **FORBIDDEN:** Fetching full tables without limits (e.g., `SELECT * FROM orders` or unbounded `.findMany()`).\n- Any collection endpoint or query that can grow over time **must** implement pagination (cursor-based preferred, or offset with a hard limit like `limit = min(req.limit, 100)`).\n- Select only the specific fields needed by the view or consumer; avoid returning massive columns (like raw JSON blobs or text bodies) when only an ID or summary is needed.\n\n## 3. Indexing & Schema Guardrails\n- Ensure every column queried in `WHERE`, `ORDER BY`, `GROUP BY`, or `JOIN ON` has a supporting index.\n- Foreign key columns must always be indexed to prevent table scans during cascading operations and joins.\n- Create explicit migration files whenever adding or modifying database tables, columns, or indexes.\n\n## 4. Transactional Integrity & Idempotency\n- Multi-step write operations that depend on each other must be wrapped in atomic transactions (e.g., `db.$transaction`, `BEGIN...COMMIT`).\n- Roll back immediately on error; never leave the database in a partially-updated state.\n- Critical operations (payment processing, order creation, state transitions) must support idempotency (e.g., idempotency keys or unique constraint handling).\n\n## 5. Connection & Resource Lifecycle Management\n- Always release or close database connections, file handles, streams, and network sockets in `finally` blocks, context managers (`with`), or automated resource scopes.\n- Prevent connection pool exhaustion by keeping transaction durations as short as possible. Do not perform slow network calls or heavy CPU work inside an open database transaction.\n",{"name":5,"description":7},"main","a77e29f9fe4e5a5ee9cc856535ba243064ce91eb","skills\u002Fbackend-db-discipline",0,"https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup","https:\u002F\u002Fgithub.com\u002Farbasyaa","Mahasiswa Teknik Informatika politeknik Negeri Cilacap","2026-10-29 12:35:34",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add arbasyaa\u002Fmy-pi-setup --skill backend-db-discipline",{"tool":38,"command":39},"bunx","bunx skills add arbasyaa\u002Fmy-pi-setup --skill backend-db-discipline",{"tool":41,"command":42},"pnpm","pnpm dlx skills add arbasyaa\u002Fmy-pi-setup --skill backend-db-discipline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fbackend-db-discipline\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7CNSESD7DRZ47PPA5Y59J8W","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7CNSD0Y1KH71ZYSQY4ZP2PY","writing-fragments","Writing, explore: mine raw fragments, no structure yet.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-fragments\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7CNSAWBPKXE2C0DBE0HE5YT","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CNS93FZ4H60TYTNDVK0KH5","writing-beats","Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-beats\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7CNS65S73NJ7GE8Y6YD4JEF","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CNS3XM180RKP39NMMXBET3","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Farbasyaa\u002Fmy-pi-setup\u002Fblob\u002Fmain\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[]]