parse-package-json
This Claude Code skill extracts version numbers, dependencies, and metadata from package.json files by reading and parsing the JSON content. Use it when you need to retrieve project versions for releases, audit package dependencies, generate reports, or validate package structure across multiple files or repositories.
git clone --depth 1 https://github.com/maslennikov-ig/claude-code-orchestrator-kit /tmp/parse-package-json && cp -r /tmp/parse-package-json/.claude/skills/parse-package-json ~/.claude/skills/parse-package-jsonSKILL.md
# Parse Package JSON
Extract structured data from package.json files for version management, dependency auditing, and metadata retrieval.
## When to Use
- Get current project version for release workflows
- Extract dependency list for auditing
- Read package metadata for reports
- Validate package.json structure
## Instructions
### Step 1: Read package.json
Use Read tool to load package.json file.
**Expected Input**:
- `file_path`: Path to package.json (default: `./package.json`)
**Tools Used**: Read
### Step 2: Parse JSON
Parse the JSON content and validate structure.
**Validation**:
- File must be valid JSON
- Must contain `name` and `version` fields at minimum
- Dependencies should be objects (if present)
### Step 3: Extract Fields
Extract relevant fields into structured output.
**Fields to Extract**:
- `version`: Semantic version string
- `name`: Package name
- `description`: Package description (optional)
- `dependencies`: Production dependencies object (optional)
- `devDependencies`: Development dependencies object (optional)
- `scripts`: Available npm scripts (optional)
- `main`: Entry point file (optional)
- `private`: Private flag (optional)
### Step 4: Return Structured Data
Return extracted data as JSON object.
**Expected Output**:
```json
{
"version": "0.7.0",
"name": "megacampus2",
"description": "Project description",
"dependencies": {
"react": "^18.2.0"
},
"devDependencies": {
"typescript": "^5.0.0"
},
"scripts": {
"build": "tsc",
"test": "jest"
},
"main": "dist/index.js",
"private": true
}
```
## Error Handling
- **File Not Found**: Return error with message "package.json not found at {path}"
- **Invalid JSON**: Return error with parsing details
- **Missing Required Fields**: Return error listing missing fields (name, version)
- **Invalid Structure**: Return error describing structure issue
## Examples
### Example 1: Extract Version
**Input**:
```
file_path: ./package.json
```
**Output**:
```json
{
"version": "0.7.0",
"name": "megacampus2"
}
```
### Example 2: Full Package Info
**Input**:
```
file_path: ./packages/client/package.json
```
**Output**:
```json
{
"version": "1.2.3",
"name": "@megacampus/client",
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"scripts": {
"dev": "vite",
"build": "vite build"
}
}
```
### Example 3: Error - File Not Found
**Input**:
```
file_path: ./nonexistent.json
```
**Output**:
```json
{
"error": "package.json not found at ./nonexistent.json",
"success": false
}
```
## Validation
- [ ] Can read package.json from default path
- [ ] Can read package.json from custom path
- [ ] Extracts all specified fields correctly
- [ ] Handles missing optional fields gracefully
- [ ] Returns error for missing file
- [ ] Returns error for invalid JSON
- [ ] Returns error for missing required fields
## Supporting Files
- `schema.json`: JSON schema defining expected package.json structureCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
Initialize Beads issue tracking in your project with interactive configuration setup.
Calculate priority score for bugs, issues, or tasks based on severity, impact, and likelihood. Use for bug prioritization, task ordering, or risk assessment.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Inline orchestration workflow for dead code detection and removal with Beads integration. Provides step-by-step phases for dead-code-hunter detection, priority-based cleanup with dead-code-remover, and verification cycles.