architecture-compass
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and…
Apply security-conscious thinking when generating or modifying code. Enforces trust boundary awareness, input validation, injection prevention, secrets management, and defense-in-depth authorization. Use when generating code that handles user input, authentication,
$ npx -y skills add techygarg/lattice --skill secure-coding --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/secure-codingContext preview
The summary Claude sees to decide when to auto-load this skill.
Apply security-conscious thinking when generating or modifying code. Enforces trust boundary awareness, input validation, injection prevention, secrets management, and defense-in-depth authorization. Use when generating code that handles user input, authentication,
name: secure-coding description: "Apply security-conscious thinking when generating or modifying code. Enforces trust boundary awareness, input validation, injection prevention, secrets management, and defense-in-depth authorization. Use when generating code that handles user input, authentication, authorization, database queries, external APIs, or file operations, or when the user mentions 'security review', 'secure this', 'check for vulnerabilities', 'trust boundary', 'input validation', or 'OWASP'. Loaded automatically by the code-generating molecules (code-forge, refactor-safely, bug-fix). This skill governs the security posture of generated code -- not architecture (see architecture) and not code craft (see clean-code)."
Projects can customize this skill's standards. Resolution order:
1. Read `.lattice/config.yaml` in the repo root. 2. If found, check `paths.secure_coding` for a custom document path. 3. If a custom document exists at that path, read it and check its YAML frontmatter for `mode`:
4. If a custom path is configured but no document exists at it → tell the user which configured path is missing, then fall back to `./references/defaults.md`. 5. If there is no config file or no `paths.secure_coding` key, read `./references/defaults.md`. 6. **Language adaptation**: if `paths.language_idioms` is set in the config and the document exists, read its **"Error Handling"** section and adapt §2 (Input Validation Patterns) error-message patterns to the language's idioms. Language idioms take precedence over the pseudocode defaults.
**STOP after generating each component. Verify ALL checks before proceeding. A check clearly fails → fix the code before presenting. A check is a judgment call with multiple valid approaches (see Ambiguity Signals) → flag it -- present options and reasoning rather than silently choosing.**
1. **TRUST BOUNDARIES**: Where does trusted code meet untrusted data? Are all boundaries explicitly identified? 2. **INPUT VALIDATION**: Is every external input validated at the boundary with an allowlist before it reaches business logic? 3. **QUERY SAFETY**: Are all database queries parameterized? Is any string concatenation used in query building? 4. **COMMAND SAFETY**: Is there any shell/command execution? If so, is the input strictly allowlisted? 5. **SECRETS**: Are there API keys, passwords, tokens, or connection strings in code? If so → move them to environment variables or a secret manager. 6. **OUTPUT ENCODING**: Is output encoded appropriately for its render context (HTML, JSON, URL)? 7. **AUTHORIZATION**: Is authorization verified at the service layer, not just the controller? Does every endpoint enforce least privilege? 8. **ERROR MESSAGES**: Do error messages exposed to users avoid revealing internal detail (stack traces, SQL queries, file paths)? 9. **DEPENDENCIES**: Is each new third-party package necessary? Are versions pinned or constrained? Is any known-vulnerable package being added?
All checks pass → state "Passes secure-coding. [next step]."
**STOP:** After verifying the checklist above, scan the output for each anti-pattern below. Any box you can check → fix before presenting the code.
Checks here often have multiple valid outcomes. When you encounter one, present the options rather than silently choosing. If `framework:collaborative-judgment` is loaded, use its presentation format.
Govern the security posture of generated code -- trust boundaries, input validation, injection prevention, secrets, authorization.
Boundary with clean-code: clean-code governs error-message craft; this skill governs what error messages must not reveal (internal detail).
Boundary with architecture: architecture defines *where* checks live (service layer, not controller); this skill defines *what* to check (identity confirmed, permission granted, resource owned).
See `./references/defaults.
Composable AI skills that teach assistants structured thinking — design-first, context-aware, and architecture-guided.
Repo: techygarg/lattice
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and…
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default),…
Enforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode). Defaults to clean architecture;…
Investigate, reproduce, and safely fix a bug with regression protection. Composes context, diagnosis, architecture, code quality, and testing guardrails into a…
Facilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document that the clean-code atom will…
Apply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity management, error handling,…