GitHub CopilotelixirSecurity
Phoenix LiveView Security Rules for GitHub Copilot
SEO-ready GitHub Copilot rules for Phoenix LiveView security with copy-paste instructions, testing guardrails, and production-safe patterns.
.github/copilot-instructions.md
# Phoenix LiveView Security Rules for GitHub Copilot Place this in `.github/copilot-instructions.md` so GitHub Copilot follows these conventions consistently. ## Core standards - Keep all generated code production-ready and strongly typed where applicable. - Prefer small focused files and functions over large mixed-responsibility modules. - Match existing project conventions before introducing new patterns. - Include meaningful tests for business-critical behavior. - Never ship placeholder TODO logic in production paths. ## Security conventions - Use explicit naming for modules, services, and handlers. - Add boundary validation for external inputs and API payloads. - Keep side effects isolated and observable with logs/metrics. - Favor predictable dependency boundaries and clear ownership. - Document trade-offs for non-obvious implementation choices. ## Phoenix LiveView guidance - Follow canonical Phoenix LiveView project layout and idioms. - Optimize for readability first, then measure before optimization. - Keep configuration centralized and environment-safe. - Ensure lint/type/test checks pass before merging. - For elixir, avoid hidden magic and implicit behavior. ## Testing checklist - Unit tests for pure logic and edge cases. - Integration tests for external dependencies. - Regression tests for bug fixes. - Deterministic test data and stable assertions. ## Security & reliability checklist - Validate and sanitize all user-controlled inputs. - Avoid leaking secrets in logs or error responses. - Fail safely with clear, actionable error messages. - Add retries/timeouts only where idempotency is guaranteed. ## AI generation behavior - Generate minimal diffs rather than full rewrites. - Explain risky changes before applying them.
How to use with GitHub Copilot
Create `.github/copilot-instructions.md` in your repository. GitHub Copilot uses these to customize suggestions across your whole repo.
#copilot#elixir#liveview#security#ai-coding-rules
Related Rules
TypeScript GitHub Copilot Instructions
GitHub CopilotTypeScript
GitHub Copilot custom instructions for TypeScript: strict types, modern patterns, and team conventions.
Code Style
typescript · copilotCopy Ready
React GitHub Copilot Instructions
GitHub CopilotReact
GitHub Copilot instructions for React: hooks, patterns, and best practices for modern React apps.
Code Style
react · copilotCopy Ready
Next.js GitHub Copilot Instructions
GitHub CopilotNext.js
GitHub Copilot custom instructions for Next.js App Router projects.
Architecture
nextjs · copilotCopy Ready
Java GitHub Copilot Instructions
GitHub CopilotJava
GitHub Copilot instructions for Java 21: virtual threads, records, sealed types, and modern Spring Boot patterns.
Code Style
java · springCopy Ready