Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Code Analysis

BSecurity

Analyze code systematically: clone repos, inspect JARs, search documentation, reverse-engineer binaries. Triggers: analyzing unknown codebases, finding API endpoints, understanding compiled code, security auditing.

8 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentjavascriptpythongojavabashnodeexpressfastapiflaskspring

Works with

api

Security Analysis

B85/100
highPerforms destructive filesystem operations

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add tstapler/dotfiles --skill code-analysis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Analysis?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Code Analysis
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/tstapler-code-analysis/badge)](https://www.skillsdirectory.com/skills/tstapler-code-analysis)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: code-analysis
description: "Analyze code systematically: clone repos, inspect JARs, search documentation, reverse-engineer binaries. Triggers: analyzing unknown codebases, finding API endpoints, understanding compiled code, security auditing."
---

# Code Analysis Skill

Systematic code analysis using progressive discovery: from source to binary, from documentation to reverse engineering.

## Analysis Workflow

### Phase 1: Source Discovery
```json
{
  "actions": [
    {"tool": "git", "action": "clone to /tmp/analysis-*", "depth": 1},
    {"tool": "find", "action": "identify project type", "indicators": ["pom.xml", "package.json", "Cargo.toml"]},
    {"tool": "grep", "action": "scan for patterns", "patterns": ["API", "endpoint", "route", "handler"]}
  ],
  "output": "project-summary.json"
}
```

### Phase 2: Dependency Analysis
```json
{
  "java": {"tool": "jar-inspector.py", "targets": ["*.jar", "lib/*"], "extract": ["manifest", "classes", "resources"]},
  "python": {"tool": "pip", "action": "download --no-deps", "analyze": ["setup.py", "requirements.txt"]},
  "javascript": {"tool": "npm", "action": "list --json", "depth": 2},
  "binary": {"tool": "ldd/otool", "action": "list dependencies"}
}
```

### Phase 3: Documentation Search
```json
{
  "strategies": [
    {"source": "web", "query": "[project] API documentation site:github.io"},
    {"source": "repo", "paths": ["docs/", "*.md", "examples/"]},
    {"source": "code", "patterns": ["@api", "@route", "swagger", "openapi"]}
  ]
}
```

### Phase 4: Reverse Engineering (if needed)
```json
{
  "binary_analysis": {
    "strings": {"min_length": 8, "encoding": ["ascii", "utf-16"]},
    "symbols": {"demangle": true, "filter": "public"},
    "disassembly": {"tool": "objdump", "sections": [".text", ".rodata"]}
  },
  "java_decompilation": {
    "tool": "cfr/procyon",
    "output": "decompiled/",
    "options": ["--comments", "--recover-type-hints"]
  }
}
```

## Tool Selection Matrix

| Scenario | Primary Tool | Fallback | Output Format |
|----------|-------------|----------|---------------|
| Git repo available | `git clone --depth=1` | Download ZIP | Local directory |
| JAR file | `jar-inspector.py` | `jar tf` | Class listing |
| Binary executable | `binary-analyzer.sh` | `strings + file` | Analysis report |
| No source access | Web search | Reverse engineering | Documentation links |
| API discovery | `grep -r "route\\|endpoint"` | AST parsing | Endpoint list |

## Security Checklist

**MANDATORY for all operations:**
- [ ] Use temp directory: `/tmp/analysis-$(uuidgen)`
- [ ] Validate URLs/paths: No `..` or absolute paths outside /tmp
- [ ] Set resource limits: `timeout 60s`, max 100MB downloads
- [ ] Never execute: Only static analysis
- [ ] Clean up: `trap 'rm -rf /tmp/analysis-*' EXIT`

## Output Formats

### Project Summary
```json
{
  "project": "name",
  "type": "java|python|javascript|binary",
  "structure": {
    "main_files": [],
    "dependencies": [],
    "entry_points": []
  },
  "apis": [
    {"path": "/api/v1/users", "method": "GET", "file": "UserController.java:42"}
  ],
  "security_notes": []
}
```

### Binary Analysis Report
```json
{
  "file": "binary_name",
  "type": "ELF|PE|Mach-O",
  "architecture": "x86_64",
  "symbols": ["exported_functions"],
  "strings": ["interesting_strings"],
  "dependencies": ["libname.so.1"],
  "entry_point": "0x1000"
}
```

## Script Integration

### Safe Clone
```bash
# scripts/safe-clone.sh
#!/bin/bash
TEMP_DIR="/tmp/analysis-$(uuidgen)"
mkdir -p "$TEMP_DIR"
cd "$TEMP_DIR"
timeout 60s git clone --depth=1 "$1" repo 2>&1
echo "$TEMP_DIR/repo"
```

### JAR Inspector
```python
# scripts/jar-inspector.py
#!/usr/bin/env python3
import zipfile, json, sys
jar = zipfile.ZipFile(sys.argv[1])
classes = [f for f in jar.namelist() if f.endswith('.class')]
manifest = jar.read('META-INF/MANIFEST.MF').decode('utf-8', errors='ignore') if 'META-INF/MANIFEST.MF' in jar.namelist() else ''
print(json.dumps({'classes': classes[:100], 'manifest': manifest[:1000]}))
```

## Language-Specific Strategies

**Load additional context when needed:**
- Java projects → Load `java-analysis.md`
- Binary files → Load `binary-analysis.md`
- Web API discovery → Load `web-discovery.md`

## Best Practices

1. **Progressive Discovery**: Start simple (clone, grep), escalate to complex (decompile, RE)
2. **Cache Results**: Store analysis in structured JSON for reuse
3. **Fail Gracefully**: If one method fails, try alternatives
4. **Document Findings**: Create markdown summary with code snippets
5. **Respect Limits**: Don't analyze files >100MB or repos >1GB

## Common Patterns

### Finding API Endpoints
```bash
# Quick scan for common patterns
grep -r "route\|endpoint\|api\|REST" --include="*.java" --include="*.py" --include="*.js"

# Java Spring
grep -r "@RequestMapping\|@GetMapping\|@PostMapping"

# Python Flask/FastAPI
grep -r "@app.route\|@router"

# Node.js Express
grep -r "app.get\|app.post\|router.get"
```

### Analyzing JARs
```bash
# Download and inspect
curl -L -o app.jar "https://example.com/app.jar"
python3 scripts/jar-inspector.py app.jar > jar-analysis.json

# Find specific classes
jar tf app.jar | grep -i controller
```

### Binary Inspection
```bash
# Basic analysis
file binary_name
strings -n 10 binary_name | head -100
nm -D binary_name | grep -i api

# Advanced with script
./scripts/binary-analyzer.sh binary_name > analysis.json
```

## Error Handling

| Error | Resolution |
|-------|------------|
| Git clone fails | Try --depth=1, then ZIP download |
| JAR corrupted | Use `jar tf` for basic listing |
| Binary stripped | Focus on strings and imports |
| No documentation | Aggressive code search + RE |
| Rate limited | Add delays, use cached results |

## Metrics

Track analysis effectiveness:
- Time to first insight: <30 seconds
- API coverage: >80% of endpoints found
- False positive rate: <10%
- Resource usage: <100MB disk, <1GB RAM

Attribution

tstaplertstapler
View sourceMore from tstapler →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →