pode-toolsmith
Design, implement, and validate production-grade PowerShell tools using Pode, Pode.Web, and Podex (htmx+Mustache+Tailwind), including security, caching, OpenAPI, and testable structure.
SKILL.mdskills/pode-toolsmith/SKILL.md
GitHubPode Toolsmith Skill
Purpose
Use this skill to build or enhance production-grade Pode tools across three stacks:
- Pode for APIs/services, background tasks, OpenAPI, SSE/WebSockets.
- Pode.Web for PowerShell-defined dashboards and UI components.
- Podex for hypermedia-first apps (htmx + Mustache + Tailwind).
Deliver runnable, minimal-surprise output: plan, file structure, code artifacts, and validation steps.
Explicit invocation
Run $pode-toolsmith.
Trigger phrases (examples)
- “Build a Pode API that exposes X.”
- “Create a PowerShell dashboard for Y.”
- “Modern htmx app on Pode with minimal JS.”
- “Add auth, caching, and OpenAPI to my Pode service.”
Inputs to gather or infer
Collect from the prompt when available; otherwise infer defaults and proceed.
- Tool type: API/service, dashboard/UI, hypermedia app, or hybrid.
- Hosting target: local dev, Windows service, container, IIS/Azure Functions, LAN tool.
- Auth model: none, Basic over HTTPS, AD/LDAP, session auth, allowlisting.
- Data source: AD, SQL, REST, filesystem, RVTools, Veeam, etc.
- Non-functional needs: caching TTLs, concurrency, response time, audit logs, retention.
- Compliance: logging/PII rules, network boundaries, TLS requirements.
Decision matrix (pick the default stack)
- Choose Pode when:
- API-first, integrations, automation endpoints, OpenAPI docs, background tasks, SSE/WebSockets.
- Choose Pode.Web when:
- UI should be built in PowerShell without HTML/CSS/JS, needs tables/forms/charts/themes.
- Choose Podex when:
- Modern web app feel with minimal JS using htmx partial updates + Mustache templates, with a small Node/Tailwind toolchain acceptable.
If multiple stacks fit, pick one default and provide a short “If you prefer X instead…” alternative.
Operating procedure (no open ends)
Step 1 — Clarify by inference (do not stall)
Infer missing details; proceed with safe defaults. Ask questions only if a missing detail blocks correctness or security (example: auth model for exposed endpoints).
Step 2 — Inspect the workspace
- Read
AGENTS.md(if present) and project conventions. - Scan existing server/app files, routes, modules, and assets.
- Detect whether Pode / Pode.Web / Podex already exists.
Step 3 — Validate environment (fast gate)
Run or instruct:
scripts/Test-PodeToolingEnvironment.ps1 -Stack <Pode|PodeWeb|Podex>
If prerequisites are missing, provide exact install commands and proceed with the best viable subset.
Step 4 — Design (make choices explicit)
Produce a high-level architecture that includes:
- Endpoints/routes
- Auth + middleware order (CORS/headers, auth, rate limiting, CSRF, sessions)
- Data flow (services layer + IO boundaries)
- UI strategy (Pode.Web components or htmx fragments)
- Caching strategy + invalidation
- Logging + correlation IDs
- Error model and HTTP status mapping
- Test strategy (smoke + Pester)
Step 5 — Implement in slices with gates
For each slice:
- Ensure scripts parse (
Parser::ParseFile). - Confirm cmdlets exist (
Get-Command). - Add Pester tests or smoke tests.
- For UI: render without blocking (use background jobs/runspaces if needed).
Step 6 — Deliverables (always output)
- File tree
- Run instructions
- Security notes
- Validation commands (Pester, linting, smoke calls)
- Next 3 improvements likely to be valuable
Expected output bundle
Provide these artifacts in the final response:
- Plan (short, ordered steps)
- Scaffold changes (added/updated files)
- Implementation snippets (key routes/services)
- Validation commands (Pester + smoke)
- Operational notes (logging, caching, rate limiting)
Reference guides included
references/Codex-Skills-Notes.mdreferences/Pode-Patterns.mdreferences/PodeWeb-Patterns.mdreferences/Podex-Patterns.mdreferences/Security-Checklist.mdreferences/Testing-Guide.mdreferences/Operations-Checklist.md
Templates included
assets/templates/PodeApiServer.ps1.mustacheassets/templates/PodeWebApp.ps1.mustacheassets/templates/PodexRoute.ps1.mustacheassets/templates/appsettings.example.jsonassets/templates/README.template.md
Safety and correctness rules
- Never invent cmdlets: verify with
Get-Command, fall back to documented patterns. - Security-first defaults:
- HTTPS for any authentication.
- Prefer allowlisting + rate limiting for LAN tools.
- Sessions + CSRF for form flows.
- Predictable caching:
- Document TTL, keys, and invalidation.
- Provide a bypass (example:
-NoCache).
- No silent failure:
- Log errors with correlation IDs.
- Return structured error bodies for APIs.
- Reproducibility:
- Pin module versions in docs.
- Provide a clean bootstrap step.
- Accessibility:
- Ensure UI outputs include labels, accessible colors, and focus order.
Quick-start (when invoked)
- Determine stack (Pode / Pode.Web / Podex).
- Run
Test-PodeToolingEnvironment -Stack <Stack>. - Scaffold with
New-PodeToolScaffold -Stack <Stack> -Path <...>. - Implement the smallest working feature.
- Add tests and run
Invoke-PodeToolSelfTest. - Package deliverables and provide run/validation steps.