$npx -y skills add transilienceai/communitytools --skill script-generatorGenerates optimized, syntax-validated scripts on demand. Never executes — only generates, optimizes, and validates.
| 1 | # Script Generator |
| 2 | |
| 3 | Generates optimized, syntax-validated scripts on demand. **Never executes scripts.** |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - Scripts exceed ~30 lines |
| 8 | - Parallel operations on multiple targets |
| 9 | - Multi-library patterns (impacket + ldap3, pypsrp + concurrent.futures) |
| 10 | - Repeated auth handshakes or connection setup |
| 11 | |
| 12 | ## Request Format |
| 13 | |
| 14 | ``` |
| 15 | LANGUAGE: python3 | powershell | bash |
| 16 | TASK: What the script should accomplish |
| 17 | TARGETS: IPs, hostnames, URLs |
| 18 | CREDENTIALS: user, pass, hash, domain, certs |
| 19 | AVAILABLE_LIBRARIES: What's installed |
| 20 | OUTPUT_FORMAT: stdout format, file writes |
| 21 | CONSTRAINTS: timeout, no destructive ops, output directory |
| 22 | CONTEXT: (optional) Prior output, errors, what failed |
| 23 | ``` |
| 24 | |
| 25 | ## Optimization |
| 26 | |
| 27 | - Multiple targets → `concurrent.futures.ThreadPoolExecutor` |
| 28 | - >3 HTTP requests to same host → `requests.Session` |
| 29 | - Repeated auth → single auth, reuse session/token |
| 30 | - Prefer high-level libraries (impacket, ldap3, requests) |
| 31 | |
| 32 | ## Output |
| 33 | |
| 34 | Write to `OUTPUT_DIR/artifacts/<task_name>.<ext>`. Return: |
| 35 | |
| 36 | ``` |
| 37 | SCRIPT_PATH: OUTPUT_DIR/artifacts/task_name.py |
| 38 | LANGUAGE: python3 |
| 39 | VALIDATION: PASSED |
| 40 | EXECUTION: python3 OUTPUT_DIR/artifacts/task_name.py |
| 41 | DEPENDENCIES: impacket, concurrent.futures (stdlib) |
| 42 | ``` |
| 43 | |
| 44 | ## Rules |
| 45 | |
| 46 | - Never execute scripts — only generate, optimize, validate |
| 47 | - Per-operation error handling — no bare `except:` |
| 48 | - Timeout enforcement on all I/O |
| 49 | - Validate syntax before returning |
| 50 | - No secrets hardcoded — credentials as variables at top |