Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Hamster Context Graph Perf

ASecurity

Context graph performance validation for Hamster Studio. Use when changing context graph RPCs, indexes, RLS/security modes, live-docs search, code search / search_code_with_neighbors behavior, or SQL migrations that can affect query plans.

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
databasesgobashsqlnodedatabasebackendsecurityperformance

Security Analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned 9/27/2026

$npx -y skills add gethamster/skills --skill hamster-context-graph-perf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hamster Context Graph Perf?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Hamster Context Graph Perf
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gethamster-hamster-context-graph-perf/badge)](https://www.skillsdirectory.com/skills/gethamster-hamster-context-graph-perf)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: hamster-context-graph-perf
description: "Context graph performance validation for Hamster Studio. Use when changing context graph RPCs, indexes, RLS/security modes, live-docs search, code search / search_code_with_neighbors behavior, or SQL migrations that can affect query plans."
version: "1.0.0"
---

# Hamster Context Graph Perf

Use this with `hamster-database` whenever context graph search SQL, RPCs,
indexes, RLS policies, or live-docs retrieval changes.

## What To Validate

Run the full safety net after `pnpm supabase:web:reset`:

```bash
pnpm seed:context-graph-perf
PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres \
  -v ON_ERROR_STOP=1 \
  -f apps/web/supabase/scripts/validate-context-graph-perf.sql
PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres \
  -v ON_ERROR_STOP=1 \
  -f .agents/skills/hamster-context-graph-perf/scripts/validate-context-graph-rpc-indexes.sql
```

Also run:

```bash
pnpm supabase:web:diff:drift-check
pnpm --filter hamster-ai test -- search-hamster-docs.tool.spec.ts context-graph-retrieval-backend.service.spec.ts hybrid-merge.spec.ts
pnpm --filter hamster-ai typecheck
```

## Interpreting Results

- `search_fts_only` must move `idx_context_node_segments_fts` on a selective
  term like `synthetic-perf-12345`.
- Vector search is split by segment type into two partial HNSW indexes (a
  minority segment type post-filtered out of a shared graph forces pgvector's
  iterative scan to walk tens of thousands of tuples and blow the 5s
  statement_timeout — this is what timed out code search). Each path carries a
  *constant* `segment_type` guard so the planner picks the right index:
- Non-code semantic (`search_semantic_only`, live-docs) must move
  `idx_context_node_segments_noncode_embedding_hnsw` (predicate
  `segment_type <> 'code_chunk'`).
- Code search (`search_code_with_neighbors`/`hybrid_search_code_segments`
  and `match_code_segments`) must move
  `idx_context_node_segments_code_embedding_hnsw` (predicate
  `segment_type = 'code_chunk'`). A scan delta of 0 here means code search
  fell back onto the shared/non-code index — the regression this guards.
- `get_context_graph_neighborhood` must move both
  `idx_context_edges_source` and `idx_context_edges_target`.
- `search_code_with_neighbors` is the production bundled code-retrieval entry
  point (SECURITY DEFINER hybrid + neighborhood); keep it fast and validate it
  under an authenticated JWT context.
- Live-docs search must use the split RPC path (`search_fts_only` +
  `search_semantic_only`) or otherwise prove that the direct hybrid path does
  not regress. Direct `hybrid_search_code_segments` as `authenticated` can
  benchmark the wrong RLS context and look much slower than the definer
  production path.

## Gotchas

- Do not use `pg_stat_reset()` in local Supabase validation. It can be denied;
  snapshot `pg_stat_user_indexes` before and after the RPC calls instead.
- Do not call `kit.system_global_account_id()` after `SET ROLE authenticated`
  inside ad hoc SQL; use the application constant
  `00000000-0000-0000-0000-00000000d0c5` in caller SQL.
- Broad fixture terms like `synthetic` can match almost every seeded row, so
  Postgres may reasonably choose a sequential scan for FTS. Use a selective
  node term for index assertions.
- Keep schema and migration in sync. If SQL changes, use the normal diff
  workflow and finish with `pnpm supabase:web:diff:drift-check`.

Attribution

gethamstergethamster
View sourceSee grades on GitHubMore from gethamster →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

Sql Pro

Master modern SQL with cloud-native databases, OLTP/OLAP

458250 votes
View all in databases →