perf-skill 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.claude-plugin/README.md +53 -0
  2. package/.claude-plugin/marketplace.json +58 -0
  3. package/.claude-plugin/plugin.json +40 -0
  4. package/CLAUDE.md +164 -0
  5. package/README.md +139 -130
  6. package/SKILL.md +86 -130
  7. package/dist/cli/init.d.ts +45 -0
  8. package/dist/cli/init.d.ts.map +1 -0
  9. package/dist/cli/init.js +236 -0
  10. package/dist/cli/init.js.map +1 -0
  11. package/dist/cli/main.js +103 -44
  12. package/dist/cli/main.js.map +1 -1
  13. package/dist/cli/platforms.d.ts +28 -0
  14. package/dist/cli/platforms.d.ts.map +1 -0
  15. package/dist/cli/platforms.js +238 -0
  16. package/dist/cli/platforms.js.map +1 -0
  17. package/dist/cli/template.d.ts +16 -0
  18. package/dist/cli/template.d.ts.map +1 -0
  19. package/dist/cli/template.js +157 -0
  20. package/dist/cli/template.js.map +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +71 -36
  23. package/dist/index.js.map +1 -1
  24. package/dist/llm/client.d.ts +6 -0
  25. package/dist/llm/client.d.ts.map +1 -1
  26. package/dist/llm/client.js +11 -2
  27. package/dist/llm/client.js.map +1 -1
  28. package/dist/llm/index.d.ts +1 -1
  29. package/dist/llm/index.d.ts.map +1 -1
  30. package/dist/llm/index.js +1 -1
  31. package/dist/llm/index.js.map +1 -1
  32. package/dist/skill/handler.d.ts +7 -0
  33. package/dist/skill/handler.d.ts.map +1 -1
  34. package/dist/skill/handler.js +24 -1
  35. package/dist/skill/handler.js.map +1 -1
  36. package/dist/skill/manifest.d.ts +4 -0
  37. package/dist/skill/manifest.d.ts.map +1 -1
  38. package/dist/skill/manifest.js +60 -39
  39. package/dist/skill/manifest.js.map +1 -1
  40. package/dist/types.d.ts +2 -0
  41. package/dist/types.d.ts.map +1 -1
  42. package/package.json +12 -9
  43. package/dist/server/http.d.ts +0 -27
  44. package/dist/server/http.d.ts.map +0 -1
  45. package/dist/server/http.js +0 -285
  46. package/dist/server/http.js.map +0 -1
  47. package/dist/server/utils.d.ts +0 -15
  48. package/dist/server/utils.d.ts.map +0 -1
  49. package/dist/server/utils.js +0 -71
  50. package/dist/server/utils.js.map +0 -1
@@ -0,0 +1,53 @@
1
+ # perf-skill for Claude Marketplace
2
+
3
+ This directory contains the Claude Marketplace plugin configuration for perf-skill.
4
+
5
+ ## Files
6
+
7
+ - `plugin.json` - Main plugin manifest defining skills, installation, and compatibility
8
+ - `marketplace.json` - Marketplace listing metadata (description, category, triggers)
9
+
10
+ ## Publishing to Claude Marketplace
11
+
12
+ ### Prerequisites
13
+
14
+ 1. Ensure the npm package is published: `npm publish`
15
+ 2. Verify the SKILL.md is included in the npm package
16
+ 3. Test the installation: `npx perf-skill init --ai claude`
17
+
18
+ ### Submission
19
+
20
+ 1. Visit [Claude Marketplace Developer Portal](https://claude.ai/marketplace/developer)
21
+ 2. Submit this repository for review
22
+ 3. The marketplace will validate:
23
+ - Plugin manifest schema
24
+ - Installation process
25
+ - Skill file structure
26
+ - Documentation quality
27
+
28
+ ### Local Testing
29
+
30
+ ```bash
31
+ # Install locally for testing
32
+ npx perf-skill init --ai claude --scope project
33
+
34
+ # Verify skill installation
35
+ cat .claude/skills/perf-skill/SKILL.md
36
+ ```
37
+
38
+ ## Trigger Configuration
39
+
40
+ The `marketplace.json` defines when Claude should suggest this skill:
41
+
42
+ - **File patterns**: `*.pb.gz`, `*.pprof`
43
+ - **Keywords**: profile, pprof, cpu, heap, memory, performance, slow, bottleneck
44
+ - **Intents**: "analyze profile", "why is my app slow", "compare performance"
45
+
46
+ ## Version Sync
47
+
48
+ Keep `version` in `plugin.json` synchronized with `package.json` version.
49
+
50
+ ## Support
51
+
52
+ - Issues: https://github.com/skillsland/perf-skill/issues
53
+ - Documentation: https://github.com/skillsland/perf-skill#readme
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://claude.ai/plugins/v1/marketplace.schema.json",
3
+ "listing": {
4
+ "name": "perf-skill",
5
+ "tagline": "AI-powered pprof profile analysis",
6
+ "shortDescription": "Convert CPU and heap profiles to structured evidence for performance optimization",
7
+ "longDescription": "perf-skill is a deterministic evidence generator for pprof profiles. It converts .pb.gz CPU and heap profiles into structured Markdown and JSON, enabling AI agents to provide optimization recommendations based on factual evidence.\n\n## Features\n\n- **Analyze** - Convert profiles to structured hotspot reports\n- **Diff** - Compare two profiles to find regressions\n- **Profile** - Capture CPU and heap profiles from Node.js apps\n- **Evidence-first** - Produces structured data for AI agents to interpret\n\n## Use Cases\n\n- Identify CPU bottlenecks in Node.js applications\n- Find memory leaks and allocation hotspots\n- Compare before/after profiles to verify optimizations\n- Generate evidence for performance code reviews",
8
+ "category": "developer-tools",
9
+ "subcategory": "performance",
10
+ "icon": "chart-line",
11
+ "screenshots": [],
12
+ "documentation": "https://github.com/skillsland/perf-skill#readme",
13
+ "support": {
14
+ "url": "https://github.com/skillsland/perf-skill/issues",
15
+ "email": null
16
+ },
17
+ "pricing": {
18
+ "type": "free"
19
+ },
20
+ "stats": {
21
+ "installs": 0,
22
+ "rating": null,
23
+ "reviews": 0
24
+ }
25
+ },
26
+ "triggers": {
27
+ "filePatterns": [
28
+ "*.pb.gz",
29
+ "*.pprof"
30
+ ],
31
+ "keywords": [
32
+ "profile",
33
+ "pprof",
34
+ "cpu",
35
+ "heap",
36
+ "memory",
37
+ "performance",
38
+ "slow",
39
+ "bottleneck",
40
+ "hotspot",
41
+ "optimize",
42
+ "regression"
43
+ ],
44
+ "intents": [
45
+ "analyze profile",
46
+ "why is my app slow",
47
+ "compare performance",
48
+ "find memory leak",
49
+ "cpu profiling",
50
+ "heap analysis"
51
+ ]
52
+ },
53
+ "requirements": {
54
+ "runtime": "node",
55
+ "minVersion": "20.0.0",
56
+ "dependencies": []
57
+ }
58
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://claude.ai/plugins/v1/plugin.schema.json",
3
+ "name": "perf-skill",
4
+ "version": "0.3.0",
5
+ "description": "Performance profile evidence extractor - Convert pprof CPU and heap profiles to structured Markdown and JSON for AI-powered performance analysis",
6
+ "author": "skillsland",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/skillsland/perf-skill",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/skillsland/perf-skill.git"
12
+ },
13
+ "keywords": [
14
+ "performance",
15
+ "profiling",
16
+ "pprof",
17
+ "cpu",
18
+ "heap",
19
+ "memory",
20
+ "optimization",
21
+ "analysis",
22
+ "node.js",
23
+ "evidence"
24
+ ],
25
+ "skills": [
26
+ {
27
+ "name": "perf-skill",
28
+ "path": ".claude/skills/perf-skill/SKILL.md",
29
+ "description": "Analyze pprof CPU and heap profiles to identify performance bottlenecks"
30
+ }
31
+ ],
32
+ "install": {
33
+ "type": "npm",
34
+ "package": "perf-skill",
35
+ "postInstall": "npx perf-skill init --ai claude"
36
+ },
37
+ "compatibility": {
38
+ "claude": ">=1.0.0"
39
+ }
40
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,164 @@
1
+ # CLAUDE.md - Developer Guide for perf-skill
2
+
3
+ This document provides guidelines for AI agents and developers working with the perf-skill codebase.
4
+
5
+ ## Project Overview
6
+
7
+ perf-skill is an AI skill that converts pprof CPU and heap profiles (.pb.gz) into structured Markdown and JSON evidence. It follows a **deterministic, evidence-first** design philosophy - the tool produces factual data without AI dependencies, while AI agents can optionally enhance the output with recommendations.
8
+
9
+ ## Repository Structure
10
+
11
+ ```
12
+ perf-skill/
13
+ ├── src/
14
+ │ ├── cli/ # CLI implementation
15
+ │ │ ├── main.ts # CLI entry point
16
+ │ │ ├── init.ts # Skill installation logic
17
+ │ │ ├── platforms.ts # Multi-platform configurations
18
+ │ │ └── template.ts # Template rendering engine
19
+ │ ├── parser/ # pprof parsing logic
20
+ │ ├── renderer/ # Markdown/JSON output
21
+ │ ├── profile/ # Node.js profiling
22
+ │ └── index.ts # Library exports
23
+ ├── test/ # Test files
24
+ ├── SKILL.md # Main skill definition
25
+ ├── .claude-plugin/ # Claude Marketplace configs
26
+ ├── package.json
27
+ └── README.md
28
+ ```
29
+
30
+ ## Key Commands
31
+
32
+ ### Development
33
+
34
+ ```bash
35
+ # Build
36
+ npm run build
37
+
38
+ # Run CLI in development
39
+ npm run cli -- analyze profile.pb.gz
40
+
41
+ # Run tests
42
+ npm test
43
+
44
+ # Lint
45
+ npm run lint
46
+ ```
47
+
48
+ ### CLI Usage
49
+
50
+ ```bash
51
+ # Analyze a profile
52
+ npx perf-skill analyze cpu.pb.gz -o report.md
53
+
54
+ # Compare profiles
55
+ npx perf-skill diff base.pb.gz current.pb.gz
56
+
57
+ # Profile and analyze a Node.js app
58
+ npx perf-skill run app.js --duration 10s
59
+
60
+ # Install skill for a platform
61
+ npx perf-skill init --ai cursor
62
+ npx perf-skill init --ai claude
63
+ npx perf-skill init --ai all
64
+ ```
65
+
66
+ ## Architecture Decisions
67
+
68
+ ### Evidence-First Design
69
+
70
+ - The core analyzer produces structured data without AI
71
+ - LLM integration is optional (via `--ai` flag)
72
+ - All outputs are reproducible and deterministic
73
+
74
+ ### Multi-Platform Support
75
+
76
+ The `init` command supports 13+ AI platforms:
77
+ - Claude, Cursor, Windsurf, Copilot, Kiro
78
+ - Codex, Qoder, Roo Code, Gemini, Trae
79
+ - OpenCode, Continue, CodeBuddy
80
+
81
+ Each platform has its own configuration in `src/cli/platforms.ts`.
82
+
83
+ ### Template System
84
+
85
+ Platform-specific skill files are generated from:
86
+ 1. Base `SKILL.md` content
87
+ 2. Platform configuration (frontmatter, sections)
88
+ 3. Template engine in `src/cli/template.ts`
89
+
90
+ ## Contributing Guidelines
91
+
92
+ ### Code Style
93
+
94
+ - Use TypeScript strict mode
95
+ - Follow existing patterns for error handling
96
+ - Add tests for new features
97
+ - Update SKILL.md for user-facing changes
98
+
99
+ ### Testing
100
+
101
+ ```bash
102
+ # Run all tests
103
+ npm test
104
+
105
+ # Run specific test file
106
+ node --test --import tsx test/parser.test.ts
107
+ ```
108
+
109
+ ### Pull Request Process
110
+
111
+ 1. Create feature branch from `main`
112
+ 2. Make changes with descriptive commits
113
+ 3. Ensure tests pass: `npm test`
114
+ 4. Ensure lint passes: `npm run lint`
115
+ 5. Update documentation if needed
116
+ 6. Submit PR with clear description
117
+
118
+ ## Common Tasks
119
+
120
+ ### Adding a New Platform
121
+
122
+ 1. Add platform to `AI_PLATFORMS` array in `src/cli/platforms.ts`
123
+ 2. Add configuration to `PLATFORM_CONFIGS` object
124
+ 3. Test installation: `npm run cli -- init --ai <platform>`
125
+
126
+ ### Updating SKILL.md
127
+
128
+ 1. Edit the root `SKILL.md` file
129
+ 2. Test rendering: `npm run cli -- init --ai claude --dry-run`
130
+ 3. Verify frontmatter is valid YAML
131
+
132
+ ### Publishing
133
+
134
+ ```bash
135
+ # Bump version
136
+ npm version patch|minor|major
137
+
138
+ # Publish to npm
139
+ npm publish
140
+
141
+ # Sync Claude Marketplace
142
+ # - Update version in .claude-plugin/plugin.json
143
+ # - Submit to marketplace for review
144
+ ```
145
+
146
+ ## Debugging
147
+
148
+ ### Common Issues
149
+
150
+ 1. **Profile parsing fails**: Check file is valid gzip-compressed protobuf
151
+ 2. **Source code not included**: Verify `--source-dir` path exists
152
+ 3. **Platform install fails**: Check directory permissions
153
+
154
+ ### Verbose Mode
155
+
156
+ ```bash
157
+ npx perf-skill analyze profile.pb.gz --verbose
158
+ ```
159
+
160
+ ## Security Considerations
161
+
162
+ - Profile data may contain sensitive information
163
+ - Use `--redact` (default) to sanitize paths
164
+ - Never commit real profiles to the repository