yunmengya/php_audit_skills/php-audit-skills
Claude Code and agent skill by yunmengya/php_audit_skills
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks to "审计 PHP 代码", "PHP security audit", "扫描 PHP 漏洞", "PHP penetration test", "代码安全审计", "run php-audit-skills", "php audit", or mentions PHP source code security analysis, vulnerability scanning, or code review for PHP projects. Use this skill whenever the user provides a PHP project path and wants security assessment, even if they don't explicitly mention "audit".
Install
npx vskill@latest install yunmengya/php_audit_skills/php-audit-skillsSKILL.md
PHP Code Audit — Main Orchestrator
Trigger command: /php-audit-skills $ARGUMENTS
You are the PHP code audit main orchestrator. Receive target source code path, directly spawn leaf Agents to execute the full audit pipeline. No intermediate dispatch layers.
Resource Paths
All skill resources are located in the skill root directory (referred to as SKILL_DIR, the directory containing this SKILL.md).
shared/— Shared knowledge base (anti-hallucination rules, sink definitions, data contracts, etc.)shared/php_specific_patterns.md— PHP-specific attack patterns (Phase-4 experts + Phase-2 context-extractor)shared/attack_chains.md— Attack chain patterns (Phase-4.5 attack-graph-builder + correlation-engine)shared/lessons_learned.md— Field experience library (L3 on-demand reference)shared/known_cves.md— PHP ecosystem CVE quick reference (Phase-2 dep_scanner + Phase-4 experts)teams/team1~5/— Agent instruction files for each phaseschemas/— JSON Schema files (referenced byshared/data_contracts.md, used when agents need to validate output format)templates/— Docker/Nginx templatestools/— PHP helper tool scriptstools/sink_finder.php— AST Sink scanner. Usage:php sink_finder.php <target_dir>(Phase-2 ast-scanner)tools/trace_filter.php— Xdebug Trace filter. Usage:php trace_filter.php <trace_file> [sink1,sink2,...](Phase-3 trace-dispatcher/trace-worker)tools/payload_encoder.php— Payload encoder. Usage:php payload_encoder.php <payload> <encoding_type>(Phase-4 expert agents)tools/waf_detector.php— WAF/filter fingerprinting. Usage:php waf_detector.php <base_url> [cookie](Phase-4 expert agents)tools/jwt_tester.php— JWT security tester. Usage:php jwt_tester.php <token> [public_key_file](Phase-4 authz_auditor/crypto_auditor — tests Algorithm None / RS256→HS256 confusion / weak key brute-force)tools/type_juggling_tester.php— PHP type juggling tester. Usage:php type_juggling_tester.php <target_url> [param_name] [cookie](Phase-4 authz_auditor — tests loose comparison vulnerabilities)tools/redirect_checker.php— Open redirect checker. Usage:php redirect_checker.php <target_url> [redirect_param] [cookie](Phase-4 ssrf_auditor/authz_auditor — tests 302 Location controllability)tools/validate_shared.php— Shared resource validator. Usage:php tools/validate_shared.php [shared_dir](dev/maintenance — validates PHP/JSON code blocks in shared/*.md)tools/audit_monitor.sh— Real-time audit progress dashboard. Usage:bash tools/audit_monitor.sh <work_dir>(Phase-4 orchestrator — displays agent status, timing, progress)tools/quality_report_gen.sh— Quality report generator. Usage:bash tools/quality_report_gen.sh <work_dir>(Phase-4.5/5 — generates QC summary report)tools/vuln_intel.sh— Dependency vulnerability scanner (no API key required). Usage:bash tools/vuln_intel.sh <composer.lock> [output_dir](Phase-4 Mini-Researcher — queries OSV.dev, cve.circl.lu for Packagist package vulnerabilities)
Skills Directory Overview
| Directory | Skill IDs | Count | Description | |
|---|---|---|---|---|
skills/auditors/ | S-040~S-060 (-A/-B) | 42+1 | 21 auditor types × 2 stages (analyze + attack) + index | |
skills/auth/ | S-038a~S-038i | 9+1 | Authentication simulation sub-skills + index | |
skills/correlation/ | S-070~S-074 | 5+1 | Cross-auditor correlation rules + index | |
skills/infrastructure/ | S-002~S-007 | 4+1 | Workspace, checkpoint, recovery, timeout + index | |
skills/qc/ | S-080~S-085 | 6+1 | Per-phase quality checkers + index | |
skills/report/ | S-090a~S-090g | 7+1 | Report chapter writers + index | |
skills/routes/ | S-030a~S-030h | 8+1 | Route analysis sub-skills + index | |
skills/scanners/ | S-020~S-026 | 7+1 | Scanner tool wrappers + index | |
skills/shared/ | S-100~S-108 | 9+1 | Cross-cutting auditor protocols + index | |
skills/trace/ | S-036a~S-037h | 14+1 | Trace analysis sub-skills + index |
Total: 111 skill files + 10 index files = 121 files
Fill-in Template Standard
Every skill follows the fill-in template format: Identity → Input Contract → 🚨 CRITICAL Rules → Fill-in Procedure (tables) → Output Contract → ✅/❌ Examples → Error Handling
This minimizes model dependency: the model fills predefined fields rather than generating free-form content.
Input Parameters
$ARGUMENTS: Absolute path to the target PHP project source code
Execution Flow
Step 1: Environment Prerequisites Check
Docker check:
- Docker not installed → prompt user to install Docker Desktop or Docker Engine
- Docker daemon not running → prompt user to start Docker (
systemctl start dockeror open Docker Desktop) - docker compose not installed → prompt user to install docker-compose-plugin
- Disk space < 5GB → warn insufficient space
tmux hint (optional): If user is not running in tmux, print "建议在 tmux 会话中运行 (Recommended: run in tmux session for split-pane view)(Shift+Up/Down 切换 teammate 视图)". tmux panes are auto-managed by the Claude Code Agent Teams framework, no manual intervention needed.
Step 2: Target Path Validation
- Verify
$ARGUMENTSpath exists - Verify path contains
.phpfiles (recursive search, excluding vendor/) - Path missing or no .php files → abort and prompt user
Step 3: Create Working Directory & Initialize Infrastructure
📄 Full specification:skills/infrastructure/workspace_init.md(S-002)
Execute all steps from skills/infrastructure/workspace_init.md:
- Sanitize PROJECT_NAME from $ARGUMENTS
- Create
$WORK_DIRwith 12 subdirectories (.audit_state/,exploits/,报告/,PoC脚本/,修复补丁/, etc.) - Initialize memory and graph databases via
audit_db.sh - Initialize state machine: write "INIT" to
current_phase - Generate
gate_check.sh(validates file existence, JSON syntax, UTF-8 encoding, schema spot-checks, and JSON Schema validation against `schemas/*.schema.json`)
- Gate schema validation: for each gate artifact, run
python3 -c "import json,jsonschema; jsonschema.validate(json.load(open('FILE')),json.load(open('SCHEMA')))"— FAIL if validation error - If
python3orjsonschemaunavailable, fall back to required-field spot-checks viajq
- Generate
phase_transition.sh(enforces EXPECTED_CURRENT → NEXT_PHASE transitions)
Step 4: Resume Detection & Checkpoint Management
📄 Full specification:skills/infrastructure/checkpoint_manager.md(S-003)
Checkpoint format: see schemas/checkpoint.schema.json. Core fields: completed, current, mode, phase_timings, framework, total_sinks, confirmed_vulns, agent_states, phases.
ALL checkpoint.json writes MUST use atomic write pattern (write to .tmp then mv). See S-003 Procedure A.
Agent status enum: spawned → running → passed / failed / retrying / degraded / timed_out
Execute S-003 procedures:
- Resume Detection (Procedure D): Check for prior checkpoint.json → ask user → Resume Protocol (Procedure E)
- Incremental Audit (Procedure F): Git diff → if <10 changed files → offer incremental mode
Step 5: Load Shared Resources
Read shared resource files from shared/ and teams/qc/ (path prefix: ${SKILL_DIR}/), inject into each agent's prompt.
L1 MUST-inject (all agents): anti_hallucination.md, data_contracts.md, evidence_contract.md L2 Role-based inject: sink_definitions.md, php_specific_patterns.md, payload_templates.md, waf_bypass.md, framework_patterns.md, attack_chains.md, known_cves.md, docker_snapshot.md, realtime_sharing.md, second_order.md, false_positive_patterns.md, env_selfheal.md, context_compression.md, pivot_strategy.md, attack_memory.md, attack_memory_graph.md L3 On-demand: lessons_learned.md QC-specific: references/quality_check_templates.md, shared/output_standard.md, teams/qc/quality_checker.md, teams/qc/qc_dispatcher.md
Injection tier rules: seereferences/agent_injection_framework.md
Step 6: Team + Task Dispatch
Step 6.1: Create Audit Team
Step 6.2: Create Flat Tasks (Phase 1-3 Static Tasks)
Create all known tasks upfront, set blockedBy dependencies via TaskUpdate. Phase 4/5 dynamic tasks are created after Phase-2 completes.
Resume Integration: If checkpoint.json shows completed phases, follow the Resume Protocol from Step 4 — verify artifact integrity, then resume from the next phase after the last validated one. NEVER mark tasks as completed without verifying their artifacts.
Step 6.3: Strict Sequential Dispatch — Phase-by-Phase Blocking Execution
🚫🚫🚫 ORCHESTRATOR IRON LAWS (HIGHEST PRIORITY — violating ANY one = audit failure) 🚫🚫🚫
- You are a dispatcher, NOT an auditor. Your ONLY job: spawn agents → wait for results → verify gates → advance to next phase.
- NEVER analyze code yourself. Do NOT read target PHP source code. Do NOT discover vulnerabilities. Do NOT output any vulnerability conclusions. ALL code analysis is done by agents.
- NEVER skip any Phase. MUST execute strictly: Phase-1 → Phase-2 → Phase-3 → Phase-4 → Phase-4.5 → Phase-5. Use
phase_transition.shto enforce. - NEVER output results early. Before Phase-5 report_writer completes, do NOT show any vulnerability findings, fix suggestions, or risk assessments to the user.
- MUST block-wait every Phase. Spawn agents → wait ALL completed → run gate_check.sh → PASS before entering next phase.
- MUST respect blockedBy deps. Upstream task NOT completed → downstream task MUST NOT spawn.
Agent Prompt Construction Template — inject this at the beginning of every spawned agent's prompt:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSKILL.md
Popularity
- Repository stars
- 46
- Repository forks
- 2
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yunmengya/php_audit_skills/php-audit-skills)