[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EGJZRPWZV5PEQ1PRXG2BT2":3,"skill-same:01M6EGJZRPWZV5PEQ1PRXG2BT2":78},{"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":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6EGJZRPWZV5PEQ1PRXG2BT2","ln-650-persistence-performance-auditor",null,"Coordinates 4 audit workers (query efficiency, transaction, runtime performance, resource lifecycle). Delegates parallel audits, aggregates into persistence_audit.md.","levalencia\u002Fagent-god-mode","levalencia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6962857?v=4","01M6EB0FZZ4BPQPC4HET4QY6NM","Luis Valencia ","01M6EB0G4HWHPWW0H9X7QKSAHP",3,"MIT","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fln-650-persistence-performance-auditor\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"performance","ln 650 persistence performance auditor","persistence","audit","lifecycle","Bash","parallel","grep","read","webfetch","workers","context7","coordinates","query","aggregates","transaction","efficiency","runtime","MCP","2026-11-10 10:12:30",false,"---\nname: ln-650-persistence-performance-auditor\ndescription: \"Coordinates 4 audit workers (query efficiency, transaction, runtime performance, resource lifecycle). Delegates parallel audits, aggregates into persistence_audit.md.\"\nallowed-tools: Read, Grep, Glob, Bash, WebFetch, WebSearch, mcp__Ref, mcp__context7, Skill\nlicense: MIT\n---\n\n> **Paths:** File paths (`shared\u002F`, `references\u002F`, `..\u002Fln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.\n\n# Persistence & Performance Auditor (L2 Coordinator)\n\nCoordinates 4 specialized audit workers to perform database efficiency, transaction correctness, runtime performance, and resource lifecycle analysis.\n\n## Purpose & Scope\n\n- **Coordinates 4 audit workers** (ln-651, ln-652, ln-653, ln-654) running in parallel\n- Research current best practices for detected DB, ORM, async framework via MCP tools ONCE\n- Pass shared context to all workers (token-efficient)\n- Aggregate worker results into single consolidated report\n- Write report to `docs\u002Fproject\u002Fpersistence_audit.md` (file-based, no task creation)\n- Manual invocation by user; not part of Story pipeline\n- **Independent from ln-620** (can be run separately or after ln-620)\n\n## Workflow\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftwo_layer_detection.md` for detection methodology.\n\n1) **Discovery:** Load tech_stack.md, package manifests, detect DB\u002FORM\u002Fasync framework, auto-discover Team ID\n2) **Research:** Query MCP tools for DB\u002FORM\u002Fasync best practices ONCE\n3) **Build Context:** Create contextStore with best practices + DB-specific metadata\n4) **Prepare Output:** Create output directory\n5) **Delegate:** 4 workers in PARALLEL\n6) **Aggregate:** Collect worker results, calculate scores\n7) **Write Report:** Save to `docs\u002Fproject\u002Fpersistence_audit.md`\n8) **Results Log:** Append trend row\n9) **Cleanup:** Delete worker files\n\n## Phase 1: Discovery\n\n**Load project metadata:**\n- `docs\u002Fproject\u002Ftech_stack.md` - detect DB, ORM, async framework\n- Package manifests: `requirements.txt`, `pyproject.toml`, `package.json`, `go.mod`\n- Auto-discover Team ID from `docs\u002Ftasks\u002Fkanban_board.md`\n\n**Extract DB-specific metadata:**\n\n| Metadata | Source | Example |\n|----------|--------|---------|\n| Database type | tech_stack.md, docker-compose.yml | PostgreSQL 16 |\n| ORM | imports, requirements.txt | SQLAlchemy 2.0 |\n| Async framework | imports, requirements.txt | asyncio, FastAPI |\n| Session config | grep `create_async_engine`, `sessionmaker` | `expire_on_commit=False` |\n| Triggers\u002FNOTIFY | migration files | `pg_notify('job_events', ...)` |\n| Connection pooling | engine config | `pool_size=10, max_overflow=20` |\n\n**Scan for triggers:**\n```\nGrep(\"pg_notify|NOTIFY|CREATE TRIGGER\", path=\"alembic\u002Fversions\u002F\")\n  OR path=\"migrations\u002F\"\n→ Store: db_config.triggers = [{table, event, function}]\n```\n\n## Phase 2: Research Best Practices (ONCE)\n\n**For each detected technology:**\n\n| Technology | Research Focus |\n|------------|---------------|\n| SQLAlchemy | Session lifecycle, expire_on_commit, bulk operations, eager\u002Flazy loading |\n| PostgreSQL | NOTIFY\u002FLISTEN semantics, transaction isolation, batch operations |\n| asyncio | to_thread, blocking detection, event loop best practices |\n| FastAPI | Dependency injection scopes, background tasks, async endpoints |\n\n**Build contextStore:**\n```json\n{\n  \"tech_stack\": {\"db\": \"postgresql\", \"orm\": \"sqlalchemy\", \"async\": \"asyncio\"},\n  \"best_practices\": {\"sqlalchemy\": {...}, \"postgresql\": {...}, \"asyncio\": {...}},\n  \"db_config\": {\n    \"expire_on_commit\": false,\n    \"triggers\": [{\"table\": \"jobs\", \"event\": \"UPDATE\", \"function\": \"notify_job_events\"}],\n    \"pool_size\": 10\n  },\n  \"codebase_root\": \"\u002Fproject\",\n  \"output_dir\": \"docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\"\n}\n```\n\n## Phase 3: Prepare Output Directory\n\n```bash\nmkdir -p {output_dir}   # Worker files cleaned up after consolidation (Phase 8)\n```\n\n## Phase 4: Delegate to Workers\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftask_delegation_pattern.md` and `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n**Workers (ALL 4 in PARALLEL):**\n\n| # | Worker | Priority | What It Audits |\n|---|--------|----------|----------------|\n| 1 | ln-651-query-efficiency-auditor | HIGH | Redundant queries, N-UPDATE loops, over-fetching, caching scope |\n| 2 | ln-652-transaction-correctness-auditor | HIGH | Commit patterns, trigger interaction, transaction scope, rollback |\n| 3 | ln-653-runtime-performance-auditor | MEDIUM | Blocking IO in async, allocations, sync sleep, string concat |\n| 4 | ln-654-resource-lifecycle-auditor | HIGH | Session scope mismatch, streaming resource holding, pool config, cleanup |\n\n**Invocation (4 workers in PARALLEL):**\n```javascript\nFOR EACH worker IN [ln-651, ln-652, ln-653, ln-654]:\n  Agent(description: \"Audit via \" + worker,\n       prompt: \"Execute audit worker.\n\nStep 1: Invoke worker:\n  Skill(skill: \\\"\" + worker + \"\\\")\n\nCONTEXT:\n\" + JSON.stringify(contextStore),\n       subagent_type: \"general-purpose\")\n```\n\n**Worker Output Contract (File-Based):**\n\nWorkers follow the shared file-based audit contract, write reports to `{output_dir}\u002F`, and return compact score\u002Fseverity summaries for aggregation.\n\nExpected summary format:\n```text\nReport written: docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\u002F651-query-efficiency.md\nScore: 6.0\u002F10 | Issues: 8 (C:0 H:3 M:4 L:1)\n```\n\n## Phase 5: Aggregate Results (File-Based)\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_coordinator_aggregation.md` and `shared\u002Freferences\u002Fcontext_validation.md`.\n\nUse the shared aggregation pattern for parsing worker summaries, rolling up severity totals, reading worker files, and assembling the final report.\n\nLocal rules for this coordinator:\n- Overall score = average of 4 category scores.\n- Keep findings grouped by the 4 worker categories in the final report.\n- Append one results-log row with `Skill=ln-650`, `Metric=overall_score`, `Scale=0-10`.\n\n**Context Validation:**\n\nApply Rules 1, 6 to merged findings:\n```\nFOR EACH finding WHERE severity IN (HIGH, MEDIUM):\n  # Rule 1: ADR\u002FPlanned Override\n  IF finding matches ADR → advisory \"[Planned: ADR-XXX]\"\n\n  # Rule 6: Execution Context\n  IF finding.check IN (blocking_io, redundant_fetch, transaction_wide, cpu_bound):\n    context = 0\n    - Function in __init__\u002Fsetup\u002Fbootstrap\u002Fmigrate → context += 1\n    - File in tasks\u002Fjobs\u002Fcron\u002F                      → context += 1\n    - Has timeout\u002Fsafeguard nearby                  → context += 1\n    - Small data (\u003C100KB file, \u003C100 items dataset)  → context += 1\n    IF context >= 3 → advisory\n    IF context >= 1 → severity -= 1\n\nDowngraded findings → \"Advisory Findings\" section in report.\nRecalculate overall score excluding advisory findings from penalty.\n```\n\n**Exempt:** Missing rollback CRITICAL, N-UPDATE loops in hot paths.\n\n## Output Format\n\n```markdown\n## Persistence & Performance Audit Report - [DATE]\n\n### Executive Summary\n[2-3 sentences on overall persistence\u002Fperformance health]\n\n### Compliance Score\n\n| Category | Score | Notes |\n|----------|-------|-------|\n| Query Efficiency | X\u002F10 | ... |\n| Transaction Correctness | X\u002F10 | ... |\n| Runtime Performance | X\u002F10 | ... |\n| Resource Lifecycle | X\u002F10 | ... |\n| **Overall** | **X\u002F10** | |\n\n### Severity Summary\n\n| Severity | Count |\n|----------|-------|\n| Critical | X |\n| High | X |\n| Medium | X |\n| Low | X |\n\n### Findings by Category\n\n#### 1. Query Efficiency\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| HIGH | job_processor.py:434 | Redundant entity fetch | Pass object not ID | S |\n\n#### 2. Transaction Correctness\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| CRITICAL | job_processor.py:412 | Missing intermediate commits | Add commit at milestones | S |\n\n#### 3. Runtime Performance\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| HIGH | job_processor.py:444 | Blocking read_bytes() in async | Use aiofiles\u002Fto_thread | S |\n\n#### 4. Resource Lifecycle\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| CRITICAL | sse_stream.py:112 | DbSession held for entire SSE stream | Scope session to auth check only | M |\n\n### Recommended Actions (Priority-Sorted)\n\n| Priority | Category | Location | Issue | Recommendation | Effort |\n|----------|----------|----------|-------|----------------|--------|\n| CRITICAL | Transaction | ... | Missing commits | Add strategic commits | S |\n| HIGH | Query | ... | Redundant fetch | Pass object not ID | S |\n\n### Sources Consulted\n- SQLAlchemy best practices: [URL]\n- PostgreSQL NOTIFY docs: [URL]\n- Python asyncio-dev: [URL]\n```\n\n## Phase 6: Write Report\n\nWrite consolidated report to `docs\u002Fproject\u002Fpersistence_audit.md` with the Output Format above.\n\n## Phase 7: Append Results Log\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fresults_log_pattern.md`\n\nAppend one row to `docs\u002Fproject\u002F.audit\u002Fresults_log.md` with: Skill=`ln-650`, Metric=`overall_score`, Scale=`0-10`, Score from Phase 6 report. Calculate Delta vs previous `ln-650` row. Create file with header if missing. Rolling window: max 50 entries.\n\n## Critical Rules\n\n- **Single context gathering:** Research best practices ONCE, pass contextStore to all workers\n- **Parallel execution:** All 4 workers run in PARALLEL\n- **Trigger discovery:** Scan migrations for triggers\u002FNOTIFY before delegating (pass to ln-652)\n- **Metadata-only loading:** Coordinator loads metadata; workers load full file contents\n- **Do not audit:** Coordinator orchestrates only; audit logic lives in workers\n\n## Phase 8: Cleanup Worker Files\n\n```bash\nrm -rf {output_dir}\n```\n\nDelete the dated output directory (`docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\u002F`). The consolidated report and results log already preserve all audit data.\n\n## Definition of Done\n\n- Tech stack discovered (DB type, ORM, async framework)\n- DB-specific metadata extracted (triggers, session config, pool settings)\n- Best practices researched via MCP tools\n- contextStore built with output_dir = `docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}`\n- Output directory created for worker reports\n- All 4 workers invoked in PARALLEL and completed; each wrote report to `{output_dir}\u002F`\n- Results aggregated from return values (scores) + file reads (findings tables)\n- Compliance score calculated per category + overall\n- Executive Summary included\n- Report written to `docs\u002Fproject\u002Fpersistence_audit.md`\n- Sources consulted listed with URLs\n- Worker output directory cleaned up after consolidation\n\n## Workers\n\n- [ln-651-query-efficiency-auditor](..\u002Fln-651-query-efficiency-auditor\u002FSKILL.md)\n- [ln-652-transaction-correctness-auditor](..\u002Fln-652-transaction-correctness-auditor\u002FSKILL.md)\n- [ln-653-runtime-performance-auditor](..\u002Fln-653-runtime-performance-auditor\u002FSKILL.md)\n- [ln-654-resource-lifecycle-auditor](..\u002Fln-654-resource-lifecycle-auditor\u002FSKILL.md)\n\n## Phase 9: Meta-Analysis\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fmeta_analysis_protocol.md`\n\nSkill type: `review-coordinator` (workers only). Run after all phases complete. Output to chat using the `review-coordinator — workers only` format.\n\n## Reference Files\n\n- Tech stack: `docs\u002Fproject\u002Ftech_stack.md`\n- Kanban board: `docs\u002Ftasks\u002Fkanban_board.md`\n- **Task delegation pattern:** `shared\u002Freferences\u002Ftask_delegation_pattern.md`\n- **Aggregation pattern:** `shared\u002Freferences\u002Faudit_coordinator_aggregation.md`\n- **MANDATORY READ:** `shared\u002Freferences\u002Fresearch_tool_fallback.md`\n\n---\n**Version:** 1.0.0\n**Last Updated:** 2026-02-04\n","> **Paths:** File paths (`shared\u002F`, `references\u002F`, `..\u002Fln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.\n\n# Persistence & Performance Auditor (L2 Coordinator)\n\nCoordinates 4 specialized audit workers to perform database efficiency, transaction correctness, runtime performance, and resource lifecycle analysis.\n\n## Purpose & Scope\n\n- **Coordinates 4 audit workers** (ln-651, ln-652, ln-653, ln-654) running in parallel\n- Research current best practices for detected DB, ORM, async framework via MCP tools ONCE\n- Pass shared context to all workers (token-efficient)\n- Aggregate worker results into single consolidated report\n- Write report to `docs\u002Fproject\u002Fpersistence_audit.md` (file-based, no task creation)\n- Manual invocation by user; not part of Story pipeline\n- **Independent from ln-620** (can be run separately or after ln-620)\n\n## Workflow\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftwo_layer_detection.md` for detection methodology.\n\n1) **Discovery:** Load tech_stack.md, package manifests, detect DB\u002FORM\u002Fasync framework, auto-discover Team ID\n2) **Research:** Query MCP tools for DB\u002FORM\u002Fasync best practices ONCE\n3) **Build Context:** Create contextStore with best practices + DB-specific metadata\n4) **Prepare Output:** Create output directory\n5) **Delegate:** 4 workers in PARALLEL\n6) **Aggregate:** Collect worker results, calculate scores\n7) **Write Report:** Save to `docs\u002Fproject\u002Fpersistence_audit.md`\n8) **Results Log:** Append trend row\n9) **Cleanup:** Delete worker files\n\n## Phase 1: Discovery\n\n**Load project metadata:**\n- `docs\u002Fproject\u002Ftech_stack.md` - detect DB, ORM, async framework\n- Package manifests: `requirements.txt`, `pyproject.toml`, `package.json`, `go.mod`\n- Auto-discover Team ID from `docs\u002Ftasks\u002Fkanban_board.md`\n\n**Extract DB-specific metadata:**\n\n| Metadata | Source | Example |\n|----------|--------|---------|\n| Database type | tech_stack.md, docker-compose.yml | PostgreSQL 16 |\n| ORM | imports, requirements.txt | SQLAlchemy 2.0 |\n| Async framework | imports, requirements.txt | asyncio, FastAPI |\n| Session config | grep `create_async_engine`, `sessionmaker` | `expire_on_commit=False` |\n| Triggers\u002FNOTIFY | migration files | `pg_notify('job_events', ...)` |\n| Connection pooling | engine config | `pool_size=10, max_overflow=20` |\n\n**Scan for triggers:**\n```\nGrep(\"pg_notify|NOTIFY|CREATE TRIGGER\", path=\"alembic\u002Fversions\u002F\")\n  OR path=\"migrations\u002F\"\n→ Store: db_config.triggers = [{table, event, function}]\n```\n\n## Phase 2: Research Best Practices (ONCE)\n\n**For each detected technology:**\n\n| Technology | Research Focus |\n|------------|---------------|\n| SQLAlchemy | Session lifecycle, expire_on_commit, bulk operations, eager\u002Flazy loading |\n| PostgreSQL | NOTIFY\u002FLISTEN semantics, transaction isolation, batch operations |\n| asyncio | to_thread, blocking detection, event loop best practices |\n| FastAPI | Dependency injection scopes, background tasks, async endpoints |\n\n**Build contextStore:**\n```json\n{\n  \"tech_stack\": {\"db\": \"postgresql\", \"orm\": \"sqlalchemy\", \"async\": \"asyncio\"},\n  \"best_practices\": {\"sqlalchemy\": {...}, \"postgresql\": {...}, \"asyncio\": {...}},\n  \"db_config\": {\n    \"expire_on_commit\": false,\n    \"triggers\": [{\"table\": \"jobs\", \"event\": \"UPDATE\", \"function\": \"notify_job_events\"}],\n    \"pool_size\": 10\n  },\n  \"codebase_root\": \"\u002Fproject\",\n  \"output_dir\": \"docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\"\n}\n```\n\n## Phase 3: Prepare Output Directory\n\n```bash\nmkdir -p {output_dir}   # Worker files cleaned up after consolidation (Phase 8)\n```\n\n## Phase 4: Delegate to Workers\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftask_delegation_pattern.md` and `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n**Workers (ALL 4 in PARALLEL):**\n\n| # | Worker | Priority | What It Audits |\n|---|--------|----------|----------------|\n| 1 | ln-651-query-efficiency-auditor | HIGH | Redundant queries, N-UPDATE loops, over-fetching, caching scope |\n| 2 | ln-652-transaction-correctness-auditor | HIGH | Commit patterns, trigger interaction, transaction scope, rollback |\n| 3 | ln-653-runtime-performance-auditor | MEDIUM | Blocking IO in async, allocations, sync sleep, string concat |\n| 4 | ln-654-resource-lifecycle-auditor | HIGH | Session scope mismatch, streaming resource holding, pool config, cleanup |\n\n**Invocation (4 workers in PARALLEL):**\n```javascript\nFOR EACH worker IN [ln-651, ln-652, ln-653, ln-654]:\n  Agent(description: \"Audit via \" + worker,\n       prompt: \"Execute audit worker.\n\nStep 1: Invoke worker:\n  Skill(skill: \\\"\" + worker + \"\\\")\n\nCONTEXT:\n\" + JSON.stringify(contextStore),\n       subagent_type: \"general-purpose\")\n```\n\n**Worker Output Contract (File-Based):**\n\nWorkers follow the shared file-based audit contract, write reports to `{output_dir}\u002F`, and return compact score\u002Fseverity summaries for aggregation.\n\nExpected summary format:\n```text\nReport written: docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\u002F651-query-efficiency.md\nScore: 6.0\u002F10 | Issues: 8 (C:0 H:3 M:4 L:1)\n```\n\n## Phase 5: Aggregate Results (File-Based)\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_coordinator_aggregation.md` and `shared\u002Freferences\u002Fcontext_validation.md`.\n\nUse the shared aggregation pattern for parsing worker summaries, rolling up severity totals, reading worker files, and assembling the final report.\n\nLocal rules for this coordinator:\n- Overall score = average of 4 category scores.\n- Keep findings grouped by the 4 worker categories in the final report.\n- Append one results-log row with `Skill=ln-650`, `Metric=overall_score`, `Scale=0-10`.\n\n**Context Validation:**\n\nApply Rules 1, 6 to merged findings:\n```\nFOR EACH finding WHERE severity IN (HIGH, MEDIUM):\n  # Rule 1: ADR\u002FPlanned Override\n  IF finding matches ADR → advisory \"[Planned: ADR-XXX]\"\n\n  # Rule 6: Execution Context\n  IF finding.check IN (blocking_io, redundant_fetch, transaction_wide, cpu_bound):\n    context = 0\n    - Function in __init__\u002Fsetup\u002Fbootstrap\u002Fmigrate → context += 1\n    - File in tasks\u002Fjobs\u002Fcron\u002F                      → context += 1\n    - Has timeout\u002Fsafeguard nearby                  → context += 1\n    - Small data (\u003C100KB file, \u003C100 items dataset)  → context += 1\n    IF context >= 3 → advisory\n    IF context >= 1 → severity -= 1\n\nDowngraded findings → \"Advisory Findings\" section in report.\nRecalculate overall score excluding advisory findings from penalty.\n```\n\n**Exempt:** Missing rollback CRITICAL, N-UPDATE loops in hot paths.\n\n## Output Format\n\n```markdown\n## Persistence & Performance Audit Report - [DATE]\n\n### Executive Summary\n[2-3 sentences on overall persistence\u002Fperformance health]\n\n### Compliance Score\n\n| Category | Score | Notes |\n|----------|-------|-------|\n| Query Efficiency | X\u002F10 | ... |\n| Transaction Correctness | X\u002F10 | ... |\n| Runtime Performance | X\u002F10 | ... |\n| Resource Lifecycle | X\u002F10 | ... |\n| **Overall** | **X\u002F10** | |\n\n### Severity Summary\n\n| Severity | Count |\n|----------|-------|\n| Critical | X |\n| High | X |\n| Medium | X |\n| Low | X |\n\n### Findings by Category\n\n#### 1. Query Efficiency\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| HIGH | job_processor.py:434 | Redundant entity fetch | Pass object not ID | S |\n\n#### 2. Transaction Correctness\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| CRITICAL | job_processor.py:412 | Missing intermediate commits | Add commit at milestones | S |\n\n#### 3. Runtime Performance\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| HIGH | job_processor.py:444 | Blocking read_bytes() in async | Use aiofiles\u002Fto_thread | S |\n\n#### 4. Resource Lifecycle\n\n| Severity | Location | Issue | Recommendation | Effort |\n|----------|----------|-------|----------------|--------|\n| CRITICAL | sse_stream.py:112 | DbSession held for entire SSE stream | Scope session to auth check only | M |\n\n### Recommended Actions (Priority-Sorted)\n\n| Priority | Category | Location | Issue | Recommendation | Effort |\n|----------|----------|----------|-------|----------------|--------|\n| CRITICAL | Transaction | ... | Missing commits | Add strategic commits | S |\n| HIGH | Query | ... | Redundant fetch | Pass object not ID | S |\n\n### Sources Consulted\n- SQLAlchemy best practices: [URL]\n- PostgreSQL NOTIFY docs: [URL]\n- Python asyncio-dev: [URL]\n```\n\n## Phase 6: Write Report\n\nWrite consolidated report to `docs\u002Fproject\u002Fpersistence_audit.md` with the Output Format above.\n\n## Phase 7: Append Results Log\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fresults_log_pattern.md`\n\nAppend one row to `docs\u002Fproject\u002F.audit\u002Fresults_log.md` with: Skill=`ln-650`, Metric=`overall_score`, Scale=`0-10`, Score from Phase 6 report. Calculate Delta vs previous `ln-650` row. Create file with header if missing. Rolling window: max 50 entries.\n\n## Critical Rules\n\n- **Single context gathering:** Research best practices ONCE, pass contextStore to all workers\n- **Parallel execution:** All 4 workers run in PARALLEL\n- **Trigger discovery:** Scan migrations for triggers\u002FNOTIFY before delegating (pass to ln-652)\n- **Metadata-only loading:** Coordinator loads metadata; workers load full file contents\n- **Do not audit:** Coordinator orchestrates only; audit logic lives in workers\n\n## Phase 8: Cleanup Worker Files\n\n```bash\nrm -rf {output_dir}\n```\n\nDelete the dated output directory (`docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}\u002F`). The consolidated report and results log already preserve all audit data.\n\n## Definition of Done\n\n- Tech stack discovered (DB type, ORM, async framework)\n- DB-specific metadata extracted (triggers, session config, pool settings)\n- Best practices researched via MCP tools\n- contextStore built with output_dir = `docs\u002Fproject\u002F.audit\u002Fln-650\u002F{YYYY-MM-DD}`\n- Output directory created for worker reports\n- All 4 workers invoked in PARALLEL and completed; each wrote report to `{output_dir}\u002F`\n- Results aggregated from return values (scores) + file reads (findings tables)\n- Compliance score calculated per category + overall\n- Executive Summary included\n- Report written to `docs\u002Fproject\u002Fpersistence_audit.md`\n- Sources consulted listed with URLs\n- Worker output directory cleaned up after consolidation\n\n## Workers\n\n- [ln-651-query-efficiency-auditor](..\u002Fln-651-query-efficiency-auditor\u002FSKILL.md)\n- [ln-652-transaction-correctness-auditor](..\u002Fln-652-transaction-correctness-auditor\u002FSKILL.md)\n- [ln-653-runtime-performance-auditor](..\u002Fln-653-runtime-performance-auditor\u002FSKILL.md)\n- [ln-654-resource-lifecycle-auditor](..\u002Fln-654-resource-lifecycle-auditor\u002FSKILL.md)\n\n## Phase 9: Meta-Analysis\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fmeta_analysis_protocol.md`\n\nSkill type: `review-coordinator` (workers only). Run after all phases complete. Output to chat using the `review-coordinator — workers only` format.\n\n## Reference Files\n\n- Tech stack: `docs\u002Fproject\u002Ftech_stack.md`\n- Kanban board: `docs\u002Ftasks\u002Fkanban_board.md`\n- **Task delegation pattern:** `shared\u002Freferences\u002Ftask_delegation_pattern.md`\n- **Aggregation pattern:** `shared\u002Freferences\u002Faudit_coordinator_aggregation.md`\n- **MANDATORY READ:** `shared\u002Freferences\u002Fresearch_tool_fallback.md`\n\n---\n**Version:** 1.0.0\n**Last Updated:** 2026-02-04\n",{"name":5,"license":15,"description":7,"allowed-tools":48},"Read, Grep, Glob, Bash, WebFetch, WebSearch, mcp__Ref, mcp__context7, Skill","main","fa638b97a18ff6d9f26cf0eaf3dfa123531bcc87","organized-skills\u002Fln-650-persistence-performance-auditor",1,"https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode","https:\u002F\u002Fgithub.com\u002Flevalencia","https:\u002F\u002Fmedium.com\u002F@luisevalencia","Microsoft MVP - Artificial Intelligence\r\nMachine Learning Enthusiast\r\n","2026-05-02 06:55:36",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add levalencia\u002Fagent-god-mode --skill ln-650-persistence-performance-auditor",{"tool":64,"command":65},"bunx","bunx skills add levalencia\u002Fagent-god-mode --skill ln-650-persistence-performance-auditor",{"tool":67,"command":68},"pnpm","pnpm dlx skills add levalencia\u002Fagent-god-mode --skill ln-650-persistence-performance-auditor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fln-650-persistence-performance-auditor\u002FSKILL.md",true,[72],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"DESIGN.md","REFERENCE","参考文档",1515,"https:\u002F\u002Fgithub.com\u002FTorchiaHub\u002FSkills\u002Fblob\u002Fmaster\u002F01-Inbox\u002Fdownloads\u002Fbergside-design-skills\u002F20260516T145411Z\u002Fsource\u002Fskills\u002Flingo\u002FDESIGN.md",[79,100,134,161,187,214],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":43},"01M6EM8ES5M9J4S8N78NJST0YC","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fzarr-python\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,30,94,95,96,97,98,99],"python","zarr python","storage","integration","s3","gcs","cloud","dask","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":115,"publishedAt":43},"01M6EM8AR6ZFKZ9YVW8TTG850Z","zabbix","Zabbix monitoring system automation via API and Python. Use when: (1) Managing hosts, templates, items, triggers, or host groups, (2) Automating monitoring configuration, (3) Sending data via Zabbix trapper\u002Fsender, (4) Querying historical data or events, (5) Bulk operations on Zabbix objects, (6) Maintenance window management, (7) User\u002Fpermission management","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fzabbix-api-skill\u002FSKILL.md",[106,109,110],{"categoryNo":107,"categoryName":108,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":111,"categoryName":112,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[102,86,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],"automation","window management","monitoring","data","templates","api","system","operations","use","maintenance","objects","permission","bulk operations","triggers","host","events","via","bulk",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":43},"01M6EM6Q9JG846ECQY9A210A26","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fx-twitter-growth\u002FSKILL.md",[],[141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160],"twitter","x twitter growth","growth","competitive intelligence","search","analyzing","plan","marketing","web search","competitors","analyze","write","optimize","social","intelligence","viral","growth engine","mechanics","grow","competitive",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":43},"01M6EM3FQNPYNKPC4CV9TCVNGD","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fwhat-if-oracle\u002FSKILL.md",[],[168,169,170,171,172,173,174,175,176,177,178,179,124,180,181,182,183,184,185,186],"oracle","what if oracle","test","planning","ux","futures","risk","analysis","explore","decision","branch","question","exploration","options","stress-test","strategies","trigger","case","multi",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":196,"publishedAt":43},"01M6EM08C06RGDYCJ86HAPK0FF","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fvercel-react-best-practices\u002FSKILL.md",[193],{"categoryNo":194,"categoryName":195,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[197,198,199,200,201,202,24,203,204,205,206,207,208,119,209,210,211,212,213,129],"react","vercel react best practices","best practices","react best practices","vercel","writing","components","react components","guidelines","tasks","code","Optimization","Next.js","refactoring","performance optimization","next","pages",{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":218,"categories":219,"keywords":230,"publishedAt":43},"01M6EM00S13326QM08DTM94J6Z","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fvenue-templates\u002FSKILL.md",[220,223,226,227],{"categoryNo":221,"categoryName":222,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":224,"categoryName":225,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":228,"categoryName":229,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000036","内容创作者",[120,231,232,205,233,234,235,236,29,237,32,152,238,239,240,241,242,243,99,244],"venue templates","research","NeurIPS","ICML","LaTeX","science","access","edit","proposals","Academic","requirements","formatting","journal","chi"]