ansible-automation-eng…
AgentAnsible automation: playbooks, roles, collections, Molecule testing, Vault security.
This is the full PostToolUse hook that fires on Edit/Write of `.php` files. It emits format/analyse reminders and scans for debug output, raw SQL interpolation, and CSRF/session bypass patterns.
Claude Code
$ npx -y skills add notque/vexjoy-agent --agent claude-code
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
This is the full PostToolUse hook that fires on Edit/Write of `.php` files. It emits format/analyse reminders and scans for debug output, raw SQL interpolation, and CSRF/session bypass patterns.
hooks:
PostToolUse:
- matcher: "Edit|Write|MultiEdit"
hooks:
- type: command
command: |
python3 -c "
import sys, json, subprocess, os
try:
data = json.loads(sys.stdin.read())
tool = data.get('tool_name', '')
inp = data.get('tool_input') or {}
notes = []
if tool in ('Edit', 'Write', 'MultiEdit'):
filepath = str(inp.get('file_path', ''))
if not filepath.endswith('.php'):
sys.exit(0)
# Format reminder
notes.append('[php-agent] Format: ./vendor/bin/pint ' + filepath + ' OR php-cs-fixer fix ' + filepath)
# Static analysis reminder
notes.append('[php-agent] Analyse: ./vendor/bin/phpstan analyse ' + filepath + ' OR ./vendor/bin/psalm --show-info=true')
# Debug output detection
try:
result = subprocess.run(['grep', '-nE', r'var_dump\s*\(|dd\s*\(|dump\s*\(|die\s*\(', filepath],
capture_output=True, text=True, timeout=5)
if result.stdout.strip():
notes.append('[php-agent] WARNING: debug output found in ' + filepath + ':')
for line in result.stdout.strip().splitlines():
notes.append(' ' + line)
notes.append('[php-agent] Remove var_dump/dd/dump/die() before committing.')
except Exception:
pass
# Raw SQL interpolation detection
try:
result = subprocess.run(
['grep', '-nE', r'(query|exec|prepare)\s*\(\s*[\"' + \"'\" + r']\s*(SELECT|INSERT|UPDATE|DELETE).*\$', filepath],
capture_output=True, text=True, timeout=5)
if result.stdout.strip():
notes.append('[php-agent] SECURITY WARNING: possible raw SQL interpolation in ' + filepath)
notes.append('[php-agent] Use prepared statements (PDO), Doctrine QueryBuilder, or Eloquent query builder instead.')
except Exception:
pass
# Disabled CSRF/session protection detection
try:
result = subprocess.run(
['grep', '-nE', r'VerifyCsrfToken|withoutMiddleware.*csrf|csrf.*except|session_regenerate_id.*false', filepath],
capture_output=True, text=True, timeout=5)
if result.stdout.strip():
notes.append('[php-agent] SECURITY WARNING: possible CSRF/session protection bypass in ' + filepath)
notes.append('[php-agent] Ensure CSRF exclusions and session_regenerate_id(true) are intentional and documented.')
except Exception:
pass
if notes:
print(json.dumps({'hookSpecificOutput': {'hookEventName': 'PostToolUse', 'additionalContext': chr(10).join(notes)}}))
except Exception:
pass
"
timeout: 10| Framework | Key Idioms | |-----------|-----------| | Laravel | Eloquent, form requests for validation, policies for authorization, Queues for deferred work, Artisan commands for CLI | | Symfony | Dependency injection container, EventDispatcher, Security component, Messenger for async, Twig templates | | Plain PHP | PSR-11 containers (PHP-DI, Pimple), PSR-7/15 middleware stacks |
| Tool | Preferred Configuration | |------|------------------------| | PHPStan | Level 8+ (`phpstan.neon`), Larastan for Laravel projects | | Psalm | Strict mode (`psalm.xml`), errorLevel 1 | | PHP-CS-Fixer | PSR-12 rule set, or Laravel Pint for Laravel projects |
Essays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.
Ansible automation: playbooks, roles, collections, Molecule testing, Vault security.
**Scope**: Module selection patterns, builtin vs command/shell decisions, collection modules, and version-specific module changes…
**Scope**: Molecule test scenarios, ansible-lint rules, idempotency validation, and check-mode patterns **Version range**:…
Universal rules injected by /do at dispatch. Each agent's .md file supplies domain rules.
**Scope**: Failure modes in agent output style — over-reporting, self-congratulation, verbose narration, and hedging. Covers what…
Zero-dependency combat visual upgrades: CSS particle replacement, Framer Motion combat juice, CSS 3D card transforms.
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…