Gravitas Perf logo

Gravitas Perf

Community
udaysharmadev
gravitas-perf

Performance analysis mode for GRAVITAS. Adds profiling patterns, benchmark requirements, algorithmic complexity analysis, and before/after measurement protocol. Load for any performance optimization work.

Overview

Publisherudaysharmadev
RepositoryGravitas
Skill namegravitas-perf
Stars
312
Forks
29
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by udaysharmadev on GitHub. Read the source before you install it.

Installation

Install the Gravitas Perf AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/udaysharmadev/Gravitas/tree/main/plugins/gravitas-perf
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/udaysharmadev/Gravitas.git /tmp/Gravitas
mkdir -p .claude/skills
cp -r /tmp/Gravitas/plugins/gravitas-perf .claude/skills/gravitas-perf
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gravitas Perf in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gravitas Perf on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gravitas Perf is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

GRAVITAS — Performance Extension

Performance analysis mode. Load in addition to skills/gravitas/SKILL.md. All perf claims require measured before/after numbers. No guessing.


Core Rule: Measure Before Optimizing

Never optimize without a baseline measurement. "This is slow" is not a baseline.

Baseline required:
  - What is the current latency/throughput? (measured, not estimated)
  - What is the target? (user's goal or SLA)
  - What is the profiler saying is hot? (not intuition)

Performance Recon Additions

bash
# Database — N+1 queries
grep -rn "\.find\|\.findOne\|\.select" src/ --include="*.ts" | grep -v "include\|join"

# Missing indexes
grep -rn "WHERE.*email\|WHERE.*username\|WHERE.*userId" src/ --include="*.ts"
# → check if these columns have DB indexes

# Unoptimized loops
grep -rn "for.*await\|forEach.*await" src/ --include="*.ts"
# → sequential async where parallel would work

# Missing memoization
grep -rn "\.map\|\.filter\|\.reduce" src/ --include="*.ts" -A 2 | grep "expensive\|compute\|calculate"

# Bundle size (frontend)
npx bundlesize 2>/dev/null || du -sh dist/ 2>/dev/null

# Memory leaks
grep -rn "setInterval\|addEventListener" src/ --include="*.ts" | grep -v "clearInterval\|removeEventListener"

Measurement Protocol

Before any optimization

bash
# API latency (using autocannon, wrk, or k6)
autocannon -c 10 -d 10 http://localhost:3000/api/users
# Record: req/sec, latency p50/p95/p99

# Function benchmark (using vitest bench)
import { bench, describe } from 'vitest';
describe('processUsers', () => {
  bench('current', () => processUsers(testData));
});

# Memory
node --inspect src/server.js &
# heap snapshot before and after load

Report format (required)

## Performance Baseline
- Endpoint: GET /api/users
- Before: 127ms p50, 842ms p99, 78 req/sec
- After:  23ms p50, 95ms p99, 512 req/sec
- Improvement: 5.5x p50, 8.9x p99, 6.6x throughput

Common Performance Anti-Patterns

N+1 Query Problem

typescript
BAD:
const users = await db.query('SELECT * FROM users');
for (const user of users) {
  user.posts = await db.query('SELECT * FROM posts WHERE userId = $1', [user.id]);
  // N queries for N users → N+1 total
}

GOOD:
const users = await db.query(`
  SELECT u.*, json_agg(p.*) as posts
  FROM users u
  LEFT JOIN posts p ON p.userId = u.id
  GROUP BY u.id
`);
// 1 query total

Sequential Async Where Parallel Works

typescript
BAD:
const user = await fetchUser(id);
const posts = await fetchPosts(id);  // waits for user unnecessarily
const comments = await fetchComments(id);  // waits for posts

GOOD:
const [user, posts, comments] = await Promise.all([
  fetchUser(id),
  fetchPosts(id),
  fetchComments(id),  // all start simultaneously
]);

Missing Cache for Expensive Computation

typescript
BAD: function getPermissions(userId: string) {
  return db.query('SELECT * FROM permissions WHERE userId = $1', [userId]);
  // called on every request
}

GOOD: const cache = new Map<string, Permission[]>();
function getPermissions(userId: string) {
  if (cache.has(userId)) return cache.get(userId)!;
  const perms = await db.query(...);
  cache.set(userId, perms);
  setTimeout(() => cache.delete(userId), 60_000); // 1min TTL
  return perms;
}

Missing Database Indexes

sql
-- Check slow queries
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'user@example.com';
-- If: Seq Scan → MISSING INDEX

-- Fix
CREATE INDEX idx_users_email ON users(email);
-- After: Index Scan → fast

Algorithmic Complexity Analysis

For any new algorithm, document complexity:

typescript
/**
 * Finds duplicate usernames in O(n) time.
 * @complexity O(n) time, O(n) space
 *
 * BAD alternative: O(n²) nested loops
 */
function findDuplicates(usernames: string[]): string[] {
  const seen = new Set<string>();
  return usernames.filter(name => {
    if (seen.has(name)) return true;
    seen.add(name);
    return false;
  });
}

Performance Verification

bash
# Benchmark comparison
vitest bench --reporter=verbose

# Before/after latency comparison
autocannon -c 10 -d 30 http://localhost:3000/api/endpoint

# Bundle size change
du -sh dist/  # before and after

# Memory usage
node --max-old-space-size=512 -e "require('./dist/server')" &
sleep 5 && curl http://localhost:3000/api/heavy-endpoint

VERDICT for Performance Tasks

VERDICT: PASS (Performance)

Baseline:    p50=127ms, p99=842ms, 78 req/sec
After:       p50=23ms,  p99=95ms,  512 req/sec
Improvement: 5.5x p50, 8.9x p99, 6.6x throughput
Tests:       47/47 (behavior unchanged)
Memory:      no increase in heap usage

Never claim performance improvement without measured before/after numbers.

Frequently asked questions

What does the Gravitas Perf AI skill do?

Performance analysis mode for GRAVITAS. Adds profiling patterns, benchmark requirements, algorithmic complexity analysis, and before/after measurement protocol. Load for any performance optimization work.

Why use Gravitas Perf on TypingMind?

Because you install it once and use it with any model. Gravitas Perf is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gravitas Perf in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/udaysharmadev/Gravitas/tree/main/plugins/gravitas-perf. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Gravitas Perf?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gravitas Perf?

As many as you like. As long as a model supports skills, you can use Gravitas Perf with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gravitas Perf AI skill free?

Yes. It is published on GitHub by udaysharmadev under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇