feat(performance): Add Performance Optimization Workflow#90
Open
mrrajan wants to merge 23 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Sorry @mrrajan, your pull request is larger than the review limit of 150000 diff characters
c421da9 to
6df59ac
Compare
Contributor
There was a problem hiding this comment.
Sorry @mrrajan, your pull request is larger than the review limit of 150000 diff characters
e1db78b to
367fe8c
Compare
6 tasks
a22d44a to
b40bc64
Compare
…late - Create performance-setup skill with route/module discovery - Create generic performance-config.template.md with placeholders - Skill discovers routes from router configuration files - Skill discovers modules from lazy-loaded routes and build config - Template provides guidance for scenarios and module registry - Implements idempotent setup with update/skip options Implements TC-4130 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Assisted-by: Claude Code
…e capture script - Create 6 performance workflow templates (baseline, module analysis, optimization task/plan, verification) - Implement Playwright-based capture-baseline.template.mjs with comprehensive security hardening - Security fixes: path traversal prevention, prototype pollution mitigation, token leakage prevention - Localhost validation (127.0.0.0/8, ::1, blocks 0.0.0.0 and IPv6-mapped) - Port validation (1-65535), iteration bounds (max 50/10), URL path validation - Correct LCP metric using largest-contentful-paint entries - Robust config table parsing (only actual table rows) - Prerequisites documentation and user consent requirements Implements TC-4131 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add performance-workflow-discovery skill that analyzes frontend source code to identify functional workflows (user journeys), presents discovered workflows to the user, and prompts for selection. This skill serves as the entry point for the workflow- based performance optimization approach. - Discovers workflows from router configuration, feature modules, and navigation structure - Estimates complexity based on components and API calls - Saves user selection to performance-config.md - Updated docs/workflow.md with performance optimization workflow section Implements TC-4132 Assisted-by: Claude Code
…tion Add performance-baseline skill that captures performance metrics for user-selected workflows with test data verification before measurement. Key features: - Verifies Performance Analysis Configuration and selected workflow exist - Prompts user to confirm test data availability before capture - Handles existing baselines with replace/cancel prompt - Copies capture script template from plugin cache - Executes browser automation to measure LCP, FCP, TTI, Total Load Time - Filters scenarios to include only selected workflow's key screens - Generates baseline report with metrics, resource timing, waterfall - Comprehensive error handling for common failures (app not running, Playwright not installed, invalid URLs, missing performance marks) - Updated docs/workflow.md with baseline capture skill documentation Implements TC-4133 Assisted-by: Claude Code
…detection Add performance-analyze-module skill that performs deep performance analysis of user-selected workflows by examining bundle composition and detecting nine common performance anti-patterns: over-fetching, N+1 queries, waterfall loading, render-blocking resources, unused code, expensive re-renders, long tasks, layout thrashing, and missing lazy loading. The skill generates comprehensive analysis reports with severity classification, quantified impact estimates, and prioritized optimization recommendations scoped to the selected workflow. Jira-Issue-Id: TC-4134 Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…k generation Add performance-plan-optimization skill that generates structured optimization plans from module-level analysis reports, creating Jira Epic and Tasks for optimization work. The skill reads workflow-analysis-report.md, groups optimizations into logical tasks (bundle size, API, render, resource, long task categories), generates optimization-plan.md with executive summary and task sequence, creates Jira Epic with performance-optimization label, and creates linked Tasks with performance-specific sections (Baseline Metrics, Target Metrics, Performance Test Requirements). Jira-Issue-Id: TC-4135 Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…e test handling Add performance-implement-optimization skill that executes performance optimization tasks by implementing code changes, running functional and performance tests, and comparing results against targets. The skill extends implement-task workflow with performance-specific steps: parses performance sections (Baseline Metrics, Target Metrics, Performance Test Requirements), implements optimizations, runs functional tests with flexible handling (tries npm test, prompts for custom test command, or recommends manual verification), captures performance metrics, generates before/after comparison report, and updates Jira with results. Key feature: Step 8 tries npm test first, then prompts user whether tests exist and requests test script path/instructions if available, or recommends manual regression verification if no tests exist. Jira-Issue-Id: TC-4136 Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements the performance-verify-optimization skill that verifies performance optimization PRs by: - Reading review feedback and creating sub-tasks for change requests - Validating acceptance criteria from Jira task - Optionally re-running performance baseline as redundant check - Validating target achievement (Full Success, Partial Success, Regression) - Generating verification report with Overall result (PASS/WARN/FAIL) - Posting report to GitHub PR and Jira task Extends verify-pr workflow with performance-specific verification steps. Baseline re-run is optional — used as redundant validation since regression detection happens in performance-implement-optimization phase. Jira-Issue-Id: TC-4137 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…workflow Updates existing documentation files to integrate performance optimization skills into the sdlc-workflow plugin documentation: - README.md: Add all 6 performance skills to Available Plugins list - docs/tools.md: Add Playwright section with installation, requirements, and graceful degradation notes - docs/project-config-contract.md: Document optional Performance Analysis Configuration section with schema and example - plugins/sdlc-workflow/shared/jira-access-strategy.md: Add Performance Optimization JIRA Workflow section documenting Epic/Task hierarchy, label conventions, and task description extensions - docs/templates/conventions.md: Add Performance Optimization section template for per-repository conventions All changes maintain consistency with existing documentation style and structure. Jira-Issue-Id: TC-4138 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add performance-workflow-guide.md (end-to-end workflow) - Add performance-skills-reference.md (skill catalog) - Add performance-metrics-guide.md (metrics and thresholds) - Clarify analyze-module inspects source code - Clarify plan-optimization reads reports (does NOT inspect code) Quick reference style: tables, bullet points, minimal prose. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add Performance Optimization section to project CONVENTIONS.md - Document quick reference style (tables, bullets, minimal prose) - Document perf commit type for performance features - Clarify skill distinctions (source code analysis vs report reading) - Document metrics conventions (p95, Core Web Vitals, regression threshold) - Document baseline capture and anti-pattern detection standards - Update setup skill's conventions.template.md with Performance Optimization section - Users running /setup will now get performance conventions in their CONVENTIONS.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
BREAKING CHANGE: performance-workflow-discovery merged into performance-setup - Unified workflow selection during setup (eliminates separate discovery step) - Three-layer optimization model: frontend/backend/integration anti-pattern detection - Backend analysis for N+1 queries, missing pagination, inefficient queries across Rust/Java/Python/Node frameworks - Frontend/backend/full-stack baseline capture modes with security hardening - Critical fixes: port extraction, Jira Epic-Task parent field, auto-stash on regression, concurrent edit protection Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Dev command auto-discovery with frontend/backend/full-stack conditional discovery - Config path auto-detection (walks up 5 parent dirs) - Serena MCP detection and onboarding prompts with Serena-first fallback strategy - UX improvements: explicit Approve/Modify/Exit menus, display all workflows including standalone routes Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…n detection, and missing index detection Add three new analysis steps to performance-analyze-module: recursive call graph tracing (Step 7.6.2), wasted computation detection (Step 7.6.3), and missing database index detection (Step 7.6.4). Extract reusable call chain logic into Pattern 12 in common-patterns.md. Add analysis config parameters (chain_depth, db_latency_ms) and report template sections. Replace OHA references with curl/bc throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…etection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace performance-config.md with performance-config.json across all skills and docs. Replace inline grep/awk config parsing with perf-config.py get/set calls, inline benchmarking with perf-benchmark.sh, and lockfile-based write protection with atomic writes. Add Pattern 13 (Discovery Result Integrity), Playwright verification step, dual-gate drift thresholds, and low-confidence findings section. Delete performance-config.template.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ls, and broken flows Fix backend-only mode by moving Serena probe out of frontend scope skip path, replace phantom tool references (ToolSearch, Glob, search_for_pattern), unify serena sentinel contract on null, fix config field name mismatches, remove deprecated metadata.dev_command_approved dual-write, standardize template placeholders to single-brace, merge duplicate plan templates, add backend metric support to all templates, correct stale step references and Jira parameter conventions, and add reconciliation notes for overlapping detection steps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
…, and config path normalization - Add db-migration as performance task specialization in implement-task and verify-pr - Move config path from .claude/performance-config.json to performance-config.json - Add frontend-to-backend API tracing for full-stack baseline scoping - Expand analysis artifacts (findings-validation.json, query-ledger.json, analysis-progress.json) - Add eval spec for performance optimization skills Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d add N+1/pre-fetch detection - Remove Step 9 skip for performance tasks — CI checks, scope containment, and all self-verification sub-steps now run before metric verification - Add root cause elimination check to catch incomplete optimizations (e.g., batch helpers added inside a loop without eliminating the loop) - Add N+1 loop origin identification in analyze-module findings - Add concurrent per-item query detection (Step 7.3.1) for pre-fetch opportunities - Add loop elimination mandate and pre-fetch mandate in plan-optimization - Add query safety constraints from CONVENTIONS.md for parameter-limit-safe SQL - Add strategic materialization promotion for denormalized table findings - Add performance task evals for implement-task and verify-pr Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add detection steps for Cross-Table OR, Load-All-Then-Search, Unbounded Iteration, Late Pagination, Redundant Indexes, and Recursive CTE Risk. Add query restructuring mandate for plan-optimization. Include mock backend fixtures for true-positive and false-positive eval coverage. Ignore eval outputs/ in .gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce Steps 7.8.1–7.8.4 for detecting anti-patterns in migration DML (missing ANALYZE, non-materialized CTEs, uniform processing, expensive PL/pgSQL patterns). Add Step 5.6 for optimization handling of existing migrations, report/template sections, and eval case 9 with mock-backend-migration fixtures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9543f1c to
9ae6132
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive Performance Optimization Workflow to the sdlc-workflow plugin, enabling teams to systematically analyze, optimize, and verify application performance as part of their SDLC.
What's Included
7 New Skills
Backend Source Code Analysis
Workflow-First Architecture
performance-workflow-discoverymerged intoperformance-setupAuto-Discovery & UX Enhancements
Documentation
Context Changes from Original Plan
Original PRs (#73, #74, #75) were closed due to iterative development leading to:
This PR consolidates 9 iterative commits into 2 logical commits for cleaner history.
Related Issue
Closes TC-4129
🤖 Generated with Claude Code