Agent skill

Performance Optimization

by Hack23 in Hack23/cia

Application performance tuning, JVM optimization, database query tuning, Vaadin UI performance

Apache-2.0Auto-check passedDatabases

Install Performance Optimization

skills CLI
$ npx skills add Hack23/cia --skill performance-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Hack23/cia performance-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/performance-optimization .claude/skills/performance-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
performance-optimization
GitHub stars
239
Token cost
~1.9k tokens
SKILL.md length
285 words
Files
1
Skills in repo
78
Repo updated
First seen
Licence
Apache-2.0

At a glance

Application performance tuning, JVM optimization, database query tuning, Vaadin UI performance

  • Tasks that involve Performance optimization
  • SKILL.md covers Purpose, When to Use This Skill, Performance Targets and JVM Optimization, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Query optimization

What it does

Performance Optimization is an agent skill from Hack23/cia. Application performance tuning, JVM optimization, database query tuning, Vaadin UI performance

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Performance optimization, Query optimization and Web performance. It works with PostgreSQL and Spring Boot. The repository describes itself as: Citizen Intelligence Agency. Open-source intelligence platform analyzing Swedish political activities using AI and data visualization. Tracks politicians, government… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Performance optimization
  • Tasks that involve Query optimization
  • Tasks that involve Web performance

Example prompts

  • “/performance-optimization”

What it can do on your machine

Read from SKILL.md and the folder at commit 6a9797b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java, sql and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • postgresql.org
    • vaadin.com
    • docs.spring.io
    • docs.oracle.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Performance Optimization loads about 1.9k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 285 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Hack23/cia at commit 6a9797b, republished under its Apache-2.0 licence (© Hack23). 285 words, ~1,917 tokens.

Download SKILL.mdSave it as .claude/skills/performance-optimization/SKILL.md (or your agent's skills folder).
name
performance-optimization
description
Application performance tuning, JVM optimization, database query tuning, Vaadin UI performance
license
Apache-2.0

Performance Optimization Skill

Purpose

This skill provides performance optimization guidance for the CIA platform across JVM tuning, PostgreSQL query optimization, Vaadin UI rendering, and Spring Framework efficiency. It ensures the political intelligence platform delivers responsive analysis to users.

When to Use This Skill

Apply this skill when:

  • ✅ Diagnosing slow page loads or API response times
  • ✅ Optimizing database queries for large political datasets
  • ✅ Tuning JVM parameters for production deployment
  • ✅ Improving Vaadin UI component rendering performance
  • ✅ Reducing memory consumption in data processing pipelines
  • ✅ Optimizing materialized view refresh schedules
  • ✅ Profiling Spring application startup time

Do NOT use for:

  • ❌ Security hardening (use security-by-design skill)
  • ❌ Feature development without performance concerns
  • ❌ UI styling changes that don't affect rendering

Performance Targets

MetricTargetMeasurement
Page load time< 3 secondsLighthouse, browser DevTools
API response time< 500ms (p95)CloudWatch metrics
Database query time< 100ms (p95)PostgreSQL pg_stat_statements
JVM heap usage< 80% of maxJMX / CloudWatch
Vaadin push latency< 200msClient-side measurement
Startup time< 30 secondsApplication logs

JVM Optimization

bash
# Production JVM flags for CIA platform (Java 21+)
JAVA_OPTS="-server \
  -Xms2g -Xmx4g \
  -XX:+UseG1GC \
  -XX:MaxGCPauseMillis=200 \
  -XX:+UseStringDeduplication \
  -XX:+OptimizeStringConcat \
  -XX:MetaspaceSize=256m \
  -XX:MaxMetaspaceSize=512m \
  -XX:+HeapDumpOnOutOfMemoryError \
  -XX:HeapDumpPath=/var/log/cia/heapdump.hprof \
  -Djava.security.egd=file:/dev/./urandom"
Memory Optimization Patterns
java
// ✅ EFFICIENT: Stream processing for large datasets
@Service
public class VotingDataProcessor {

    @Transactional(readOnly = true)
    public void processVotingRecords(String sessionId) {
        try (Stream<VoteData> votes = voteRepository.streamBySession(sessionId)) {
            votes.map(this::analyzeVote)
                 .filter(Objects::nonNull)
                 .forEach(resultRepository::save);
        }
        // Stream auto-closes, no memory accumulation
    }
}

// ❌ INEFFICIENT: Loading all records into memory
public void processVotingRecords(String sessionId) {
    List<VoteData> allVotes = voteRepository.findBySession(sessionId);
    // May load millions of records into heap
}

PostgreSQL Query Optimization

Index Strategy for Political Data
sql
-- High-impact indexes for common CIA queries
-- Politician lookup by party and status
CREATE INDEX idx_person_party_status
  ON person_data (party, status) WHERE status = 'ACTIVE';

-- Voting record time-series queries
CREATE INDEX idx_vote_date_committee
  ON vote_data (vote_date DESC, committee_id);

-- Document search optimization
CREATE INDEX idx_document_search
  ON document_content USING gin(to_tsvector('swedish', content));

-- Materialized view refresh tracking
CREATE INDEX idx_mv_refresh_status
  ON materialized_view_log (view_name, last_refresh DESC);
Query Anti-Patterns
java
// ❌ N+1 Query Problem
@Entity
public class Committee {
    @OneToMany(fetch = FetchType.LAZY)
    private List<CommitteeMember> members;
}
// Accessing committee.getMembers() in a loop = N+1 queries

// ✅ FIX: Use JOIN FETCH or EntityGraph
@Query("SELECT c FROM Committee c JOIN FETCH c.members WHERE c.id = :id")
Committee findWithMembers(@Param("id") Long id);

// ✅ FIX: Use @EntityGraph
@EntityGraph(attributePaths = {"members", "members.person"})
Committee findById(Long id);
Materialized View Optimization
sql
-- Concurrent refresh to avoid locks during read
REFRESH MATERIALIZED VIEW CONCURRENTLY view_riksdagen_politician_summary;

-- Schedule refresh based on data freshness requirements
-- High priority: refresh every 15 minutes during business hours
-- Low priority: refresh daily during off-peak

Vaadin UI Performance

Lazy Loading for Large Datasets
java
// ✅ EFFICIENT: Lazy loading with DataProvider
Grid<PoliticianSummary> grid = new Grid<>(PoliticianSummary.class);
grid.setDataProvider(
    DataProvider.fromCallbacks(
        query -> politicianService.fetch(query.getOffset(), query.getLimit()),
        query -> politicianService.count()
    )
);

// ❌ INEFFICIENT: Loading all items upfront
grid.setItems(politicianService.findAll()); // Loads everything
Component Optimization
java
// ✅ Use virtual scrolling for long lists
grid.setPageSize(50);
grid.setMultiSort(true);

// ✅ Minimize push updates
@Push(transport = Transport.WEBSOCKET_XHR)
public class MainView extends AppLayout {
    // Only push critical real-time updates
}

// ✅ Defer non-critical UI updates
UI.getCurrent().access(() -> {
    notificationComponent.update(newData);
});
Bundle Size Reduction
  • Use @CssImport instead of inline styles for reuse
  • Enable production mode (vaadin.productionMode=true)
  • Minimize custom JavaScript in @ClientCallable methods
  • Use Vaadin's built-in components over custom widgets

Spring Framework Performance

Caching Strategy
java
@Service
public class PoliticianService {

    // Cache frequently accessed, rarely changing data
    @Cacheable(value = "politicians", key = "#personId",
               unless = "#result == null")
    public PoliticianSummary getPolitician(String personId) {
        return repository.findSummaryById(personId);
    }

    // Evict cache when data is updated
    @CacheEvict(value = "politicians", key = "#personId")
    public void updatePolitician(String personId, PoliticianUpdate update) {
        repository.update(personId, update);
    }
}
Transaction Optimization
java
// ✅ Read-only transactions for queries (no dirty checking)
@Transactional(readOnly = true)
public List<VotingSummary> getVotingSummaries(String sessionId) {
    return votingRepository.findSummariesBySession(sessionId);
}

// ✅ Batch operations for bulk inserts
@Transactional
public void importVotingData(List<VoteData> votes) {
    int batchSize = 50;
    for (int i = 0; i < votes.size(); i++) {
        entityManager.persist(votes.get(i));
        if (i % batchSize == 0) {
            entityManager.flush();
            entityManager.clear(); // Release memory
        }
    }
}

Performance Testing

JMH Benchmarks for Critical Paths
java
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
public class PoliticianLookupBenchmark {

    @Benchmark
    public void benchmarkPoliticianSearch() {
        politicianService.searchByName("test");
    }
}
Monitoring Checklist
  • ✅ Enable pg_stat_statements for query analysis
  • ✅ Configure JMX export for JVM metrics
  • ✅ Set up CloudWatch dashboards for response times
  • ✅ Monitor Vaadin session count and memory usage
  • ✅ Track materialized view refresh durations
  • ✅ Alert on p95 latency threshold breaches

References

© Hack23, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/performance-optimization of Hack23/cia.

Open the folder on GitHubat commit 6a9797b

Compare with similar skills

Performance Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Performance Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Performance Optimization this skillHack23/cia239—~1.9kAutomated safety check: PassApache-2.0
Database OptimizerJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
Mz ProfileMaterializeInc/materialize6.4k—~480Automated safety check: PassCustom licence
SQL Optimizationgithub/awesome-copilot40k2 repos~2.3kAutomated safety check: PassMIT
Odoo Performance Tunersickn33/agentic-awesome-skills47k2 repos~1.2kAutomated safety check: PassMIT
SQL Optimizationtotvs/engpro-advpl-tlpp-skills141—~1.2kAutomated safety check: PassMIT

Similar skills

  • Database Optimizer

    Jeffallan/claude-skills

    Tunes PostgreSQL and MySQL performance by analyzing slow queries and execution plans, designing indexes, rewriting queries and adjusting configuration, one validated change at a time.

    12k GitHub stars~1.6k tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Mz Profile

    MaterializeInc/materialize

    Trigger: "profile Materialize", "check memory usage", "analyze binary size", "debug performance", or mentions profiling, samply, heaptrack, flame graphs, memory checking, binary size, slow queries…

    6.4k GitHub stars~480 tokensUpdated today
    DevelopmentAuto-check passed
  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed
  • Odoo Performance Tuner

    sickn33/agentic-awesome-skills

    Expert guide for diagnosing and fixing Odoo performance issues: slow queries, worker configuration, memory limits, PostgreSQL tuning, and profiling tools.

    47k GitHub starsUsed in 2 repos~1.2k tokens
    DatabasesAuto-check passed
  • SQL Optimization

    totvs/engpro-advpl-tlpp-skills

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across SQL databases (PostgreSQL, SQL Server, Oracle).

    141 GitHub stars~1.2k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Performance

    kid-sid/claude-spellbook

    A skill your agent uses when diagnosing a slow HTTP endpoint or high-latency service — profiling, adding an application-level cache, offloading CPU-bound work to threads or workers, or defining a…

    189 GitHub stars~3.8k tokensUpdated 2 mo ago
    DatabasesAuto-check passed

More from Hack23/cia

All 78 skills in this repo
  • WCAG 2.1 AA compliance, ARIA attributes, keyboard navigation, screen reader optimization for accessible political data platforms

    239 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Advanced chart types, D3.js/Vaadin Charts patterns, political data visualization, time series analysis

    239 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • AI Governance

    Hack23/cia

    AI governance, EU AI Act compliance, OWASP LLM security, responsible AI practices for GitHub Copilot agents

    239 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • API Integration

    Hack23/cia

    External API integration patterns, retry logic, circuit breakers, caching, rate limiting for government data APIs

    239 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • AWS CloudWatch metrics, alarms, dashboards, log insights, and application monitoring for the CIA platform

    239 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • AWS security best practices, VPC security, IAM, KMS, CloudTrail, GuardDuty for CIA platform deployment

    239 GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Questions about Performance Optimization

What does Performance Optimization do?

Application performance tuning, JVM optimization, database query tuning, Vaadin UI performance. Performance Optimization is an agent skill from Hack23/cia.

When should I use Performance Optimization?

Performance Optimization fits situations like: tasks that involve Performance optimization; tasks that involve Query optimization; tasks that involve Web performance.

How do I install Performance Optimization in Claude Code?

Run `npx skills add Hack23/cia --skill performance-optimization -a claude-code`. Or copy the skill folder (.github/skills/performance-optimization in Hack23/cia) into .claude/skills/performance-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Performance Optimization in Codex?

Run `npx skills add Hack23/cia --skill performance-optimization -a codex`. Or copy the skill folder (.github/skills/performance-optimization in Hack23/cia) into .agents/skills/performance-optimization in your project. Codex loads it when a task matches its description.

Can I use Performance Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Hack23/cia --skill performance-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/performance-optimization, .gemini/skills/performance-optimization, .github/skills/performance-optimization and .opencode/skills/performance-optimization in your project.

What does Performance Optimization need to run?

SKILL.md names no scripts, command-line tools or credentials: Performance Optimization is instructions for the agent only.

Does Performance Optimization access the network?

SKILL.md names 4 domains. As links in the text: postgresql.org, vaadin.com, docs.spring.io and docs.oracle.com. This is read from the text; nothing was executed.

Is Performance Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Performance Optimization use?

Performance Optimization is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Performance Optimization use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Performance Optimization?

Skills that share tags, products or a category with Performance Optimization: Database Optimizer (Jeffallan/claude-skills, 12k stars), Mz Profile (MaterializeInc/materialize, 6.4k stars), SQL Optimization (github/awesome-copilot, 40k stars) and Odoo Performance Tuner (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Performance Optimization?

Hack23 (a GitHub organization) maintains it in Hack23/cia, which has 239 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 6, 2026.

Source: Hack23/cia on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.