一键导入
manage-database-session
This skill covers patterns for managing database sessions and models. Trigger: Load when working with database interactions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
This skill covers patterns for managing database sessions and models. Trigger: Load when working with database interactions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Four quality gate checklists for frontend: baseline visual, accessibility, metadata/SEO, and motion performance. Post-implementation quality gates. Trigger: When reviewing UI changes, before merging frontend PRs, during sdd-verify.
Browser-based UI verification using Playwright. Page Object Model, selector best practices, visual regression, network interception, and MCP integration. Trigger: When writing E2E tests, verifying UI changes, or setting up Playwright.
Interactive tutorial-style lessons for custom skills. Invoke /powerup <skill> for a guided walkthrough with examples, exercises, and knowledge checks. Trigger: When user says "powerup", "tutorial", "teach me", or wants to learn a skill interactively.
Self-installing markdown recipes for skills. Each skill can include an INSTALL.md that an agent reads and executes to set up dependencies, MCP servers, or config. Trigger: When installing a skill with INSTALL.md, or creating skills with setup requirements.
This skill covers the implementation of authentication routes. Trigger: When setting up auth-related endpoints in the backend.
This skill covers AES-256-GCM encryption for provider API keys. Trigger: Load this skill when handling crypto operations for API keys.
| name | manage-database-session |
| description | This skill covers patterns for managing database sessions and models. Trigger: Load when working with database interactions. |
| license | Apache-2.0 |
| metadata | {"author":"repoforge","version":"1.0","complexity":"low","token_estimate":350,"dependencies":[],"related_skills":[],"load_priority":"high"} |
This skill covers patterns for managing database sessions and models.
Trigger: Load when working with database interactions.
| Task | Pattern |
|---|---|
| Create a database session | get_db() |
| Define a database model | Base |
get_db() to create a session for database operations.Base to define your database models.Use get_db() to create a session for database operations, ensuring proper management of database connections.
from apps.server.app.models.database import get_db
async def some_database_operation():
async with get_db() as session:
# Perform database operations
pass
Utilize Base to define your database models, which will serve as the foundation for your ORM mappings.
from apps.server.app.models.database import Base
from sqlalchemy import Column, Integer, String
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
python -m alembic upgrade head
Using raw SQL queries bypasses the ORM and can lead to security vulnerabilities and maintenance issues.
# BAD
async def raw_query():
await db.execute("SELECT * FROM users")