inceptyon-labs/tenet-skills/tenet-performance

Claude Code and agent skill by inceptyon-labs/tenet-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Audits performance risks: N+1 queries, sync I/O, indexes, leaks, bundles, and rerenders.

Install

npx vskill@latest install inceptyon-labs/tenet-skills/tenet-performance

SKILL.md

The same SKILL.md was published earlier as inceptyon-labs/tenet-skills/tenet-performance.

Tenet Performance — Performance Anti-Pattern Detection

Detects structural performance problems that cause latency spikes, memory bloat, and unnecessary resource consumption. Focuses on patterns that are reliably detectable through static analysis.

Purpose

This skill identifies performance anti-patterns that are detectable without runtime profiling. It scans for N+1 query patterns (loop + await query), synchronous I/O in hot paths, missing database indexes, unbounded queries, memory leaks, bundle size issues in frontend projects, and React re-render hazards. Findings are grounded in specific code locations with actionable fix_prompts.

Calibration — read first

Follow shared/scan-discipline.md (complete every step, enumerate rather than sample, and §2a: report only issues that actually exist), shared/verification.md (every finding is confirmed against the code before it ships; unconfirmed candidates are dropped, not demoted), and shared/severity.md (severity is confirmed impact, never a hedge for doubt).

A finding must exist in this codebase on a path that can run. Do not report hypotheticals, dead code, style preferences, or anything an upstream check already prevents. Zero findings for a step is the normal result on healthy code; do not fill a step to show you looked. Do not overthink it: read the code and its context, decide, move on.

Language Support Matrix

yaml
support:
native: [typescript, javascript, python]
heuristic: [go, java, ruby, swift, dart, rust]
skip: [yaml, json, markdown, css, html, shell, terraform, dockerfile]
  • Native (TS/JS/Python): Pattern matching with high confidence on async/await, ORM calls, React hooks, bundle config, event listener patterns.
  • Platform (Swift/SwiftUI, Dart/Flutter, Rust/Tauri): Steps 7b to 7d. Grep finds the candidate; every finding is confirmed by reading the code around it.
  • Heuristic (Go/Java/Ruby): Grep-based detection of common patterns (database calls in loops, missing pagination). Lower confidence — all findings tagged "confidence": "heuristic".

Toolchain Inputs

This skill does not consume .healthcheck/toolchain/ outputs directly. It performs its own heuristic grep-based analysis on source files.

It does read:

  • .healthcheck/toolchain/language-census.json — to determine which languages are present, which files to scan, and whether frontend-specific checks (bundle size, React) apply.

Procedure

Step 0: Read Language Census

Read .healthcheck/toolchain/language-census.json. Determine:

  • Which languages are present and at what support tier
  • Whether a frontend framework is in use (check manifests for react, vue, svelte, next, nuxt, gatsby in package.json dependencies)
  • Whether an ORM or database library is present (check for prisma, sequelize, typeorm, knex, mongoose, sqlalchemy, django, gorm, activerecord in manifests)

Skip languages at the skip tier. For each supported language, run the applicable checks below.

Step 1: N+1 Query Detection

Scan for loops that contain awaited database or network calls. This is the highest-value check — a single N+1 can dominate request latency.

TypeScript / JavaScript:

bash
# Pattern: for/forEach/map loop containing await + DB call
git grep -nP "for\s*\(" -- '*.ts' '*.tsx' '*.js' '*.jsx'
# Then check the loop body (next ~20 lines) for await + DB call patterns

Look for these DB call signatures inside loops:

  • await.*\.find( / .findOne( / .findMany( / .findAll(
  • await.*\.query( / .execute( / .raw(
  • await.*\.get( / .fetch( / .select(
  • await.*prisma\. / await.*knex( / await.*sequelize\.
  • await.*\.save( / .create( / .update( / .delete(

Also check for Promise.all(arr.map(async wrapping individual DB calls — this parallelizes but still produces N queries.

Python:

bash
# Pattern: for loop body containing ORM call
# Look for: for x in queryset / for x in items followed by Model.objects / session.query
git grep -nP "for .* in " -- '*.py'
# Then check for .objects. / session.query / cursor.execute in the loop body

Go / Java / Ruby (heuristic):

bash
# Go: for range loop + db.Query/db.Exec
# Java: for/forEach + repository.find / jdbcTemplate.query
# Ruby: .each do + Model.find / Model.where

Severity: major for confirmed N+1 patterns. minor for Promise.all(arr.map( wrapping DB calls (parallelized but still N queries).

Step 2: Synchronous I/O in Hot Paths

Detect synchronous/blocking I/O calls that should be asynchronous.

TypeScript / JavaScript:

bash
# Sync filesystem calls in non-config/non-setup files
git grep -nP "readFileSync|writeFileSync|existsSync|readdirSync|statSync|mkdirSync|appendFileSync" -- '*.ts' '*.tsx' '*.js' '*.jsx'

Exclude files that are clearly setup/build/config:

  • *.config.js, *.config.ts, webpack.config.*, vite.config.*, rollup.config.*
  • scripts/, bin/, migrations/, seeds/
  • Test files (*.test.*, *.spec.*, __tests__/)

Python:

bash
# Blocking calls in async functions
git grep -nP "def async|async def" -- '*.py'
# Then check for: open(), requests.get/post, time.sleep, subprocess.run

Severity: major if found in route handlers, middleware, or API controllers. minor if in utility/helper files (may be acceptable).

Step 3: Unbounded Queries

Scan for database queries that fetch unlimited rows — these are time bombs that work fine on small datasets and crash production.

All languages:

bash
# SELECT * without WHERE or LIMIT
git grep -nP "SELECT \*" -- '*.ts' '*.tsx' '*.js' '*.jsx' '*.py' '*.go' '*.java' '*.rb'
# Check for absence of WHERE / LIMIT / OFFSET / TOP in the same query string
# ORM calls without limits
git grep -nP "\.findAll\(\s*\)" -- '*.ts' '*.tsx' '*.js' '*.jsx' # Empty findAll
git grep -nP "\.find\(\s*\{\s*\}\)" -- '*.ts' '*.tsx' '*.js' '*.jsx' # find({}) with no limit
git grep -nP "Model\.objects\.all\(\)" -- '*.py' # Django all() without [:N]

Also flag:

  • .find({}) or .find() without .limit() in Mongoose/MongoDB calls
  • SELECT * in raw queries (should specify columns)
  • Missing pagination in list endpoints (check route handlers returning array results without skip/take/limit/offset parameters)

Severity: major for unbounded queries in API handlers or scheduled jobs. minor for unbounded queries in scripts or CLI tools.

Step 4: Missing Database Indexes

If schema/migration files are present, check for likely missing indexes.

bash
# Find schema files
# Prisma: schema.prisma
# SQL migrations: *.sql in migrations/
# Sequelize/TypeORM: model definition files
# Django: models.py

Check for:

  • Foreign key columns without @index (Prisma) or INDEX (SQL)
  • Columns used in WHERE clauses (cross-reference query patterns from Step 3) without indexes
  • unique constraints that could benefit from a unique index

Severity: major if the column is used in a WHERE clause found in the codebase. minor if it is a foreign key without a confirmed query pattern.

Step 5: Memory Leak Detection

Scan for common memory leak patterns.

TypeScript / JavaScript:

bash
# addEventListener without corresponding removeEventListener
git grep -nP "addEventListener" -- '*.ts' '*.tsx' '*.js' '*.jsx'
# Check if the same file has a matching removeEventListener for each add
# setInterval without clearInterval
git grep -nP "setInterval" -- '*.ts' '*.tsx' '*.js' '*.jsx'
# Check if the returned ID is stored and cleared
# Unbounded caches / Maps that grow without eviction
git grep -nP "new Map\(\)|new Set\(\)|const cache|let cache|var cache" -- '*.ts' '*.tsx' '*.js' '*.jsx'
# Flag if module-level (not inside a function) and no .delete() or .clear() in the same file
# Global/module-level array push without cleanup
git grep -nP "\.push\(" -- '*.ts' '*.tsx' '*.js' '*.jsx'
# Flag if pushing to a module-level array with no splice/pop/length=0

React-specific:

bash
# useEffect with addEventListener but no cleanup return
# Pattern: useEffect(() => { ... addEventListener ... }) without return () => { removeEventListener }

Read useEffect bodies (within ~15 lines of useEffect() and flag if addEventListener appears without a cleanup return.

Python:

bash
# Unbounded lists/dicts at module level
# Threads without daemon=True
# open() without with statement (file handle leak)
git grep -nP "open\(" -- '*.py' | grep -v "with open"

Severity: major for addEventListener without cleanup in components, setInterval without clear in long-lived modules. minor for module-level caches without eviction (may be intentional).

Step 6: Bundle Size Issues (Frontend Projects Only)

Skip this step if no frontend framework detected in Step 0.

bash
# Check for large dependencies in package.json
# Flag: moment (use date-fns or dayjs), lodash (use lodash-es or individual imports),
# aws-sdk (use @aws-sdk/client-*), faker (should be devDep only)

Curated list of heavy/replaceable dependencies:

PackageIssueAlternative
moment329kB, mutabledate-fns, dayjs
lodash72kB full bundlelodash-es + tree-shaking, or individual lodash.get etc.
aws-sdk3MB+@aws-sdk/client-* (v3, tree-shakeable)
chart.js + all plugins200kB+Load plugins selectively
faker in dependenciesShould be devDependencies onlyMove to devDependencies
@fortawesome/fontawesome-free1.5MBSVG icons or icon subset
bash
# Check for dynamic imports / code splitting
# Webpack: look for splitChunks in webpack.config.*
# Vite: look for build.rollupOptions.output.manualChunks in vite.config.*
# Next.js: check for next/dynamic imports
# React.lazy: check for React.lazy / lazy( usage
git grep -nP "splitChunks|manualChunks|React\.lazy|next/dynamic|import\(" -- '*.ts' '*.tsx' '*.js' '*.jsx'

Flag if:

  • No code splitting configuration found in a project with >20 route/page components
  • Large dependencies are in dependencies (not devDependencies) without tree-shaking evidence

Severity: major for heavy dependencies with lighter alternatives. minor for missing code splitting config.

Step 7: React Re-render Hazards (React Projects Only)

Skip this step if React is not detected in Step 0.

bash
# Inline object props — creates new reference every render
# Pattern: <Component prop={{ ... }} /> or <Component prop={[ ... ]} />
git grep -nP "=\{\s*\{" -- '*.tsx' '*.jsx'
git grep -nP "=\{\s*\[" -- '*.tsx' '*.jsx'
# Inline function props — creates new function every render
# Pattern: <Component onClick={() => ...} /> (but NOT in event handlers of native elements)
git grep -nP "=\{\s*\(" -- '*.tsx' '*.jsx'
git grep -nP "=\{\s*function" -- '*.tsx' '*.jsx'
# Missing useMemo on expensive computations
# Look for .filter().map(), .sort(), .reduce() chains NOT wrapped in useMemo
git grep -nP "\.filter\(.*\.map\(|\.sort\(.*\.map\(|\.reduce\(" -- '*.tsx' '*.jsx'
# Check if the result is wrapped in useMemo
# Missing useCallback on functions passed as props to child components
# This is heuristic — look for functions defined in component body and passed as props

Apply these filters to reduce false positives:

  • Ignore inline props on native HTML elements (<div>, <span>, <button>) — only flag on custom components (PascalCase)
  • Ignore event handlers like onClick, onChange on native elements
  • Only flag .filter().map() chains if they operate on arrays of >0 estimated size (heuristic: check if the source is state or props, not a small constant)

Severity: minor for inline object/function props on custom components. major for expensive computation chains (sort/filter/reduce on large data) without useMemo in components that re-render frequently (check if parent passes changing props).

Step 7b: Swift and SwiftUI (Apple Platform Projects Only)

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/inceptyon-labs/tenet-skills/tenet-performance/badge)](https://verified-skill.com/skills/inceptyon-labs/tenet-skills/tenet-performance)

Something wrong with this skill or its page? Tell us.