Secure Coding logo

Secure Coding

Community
MartinOlivero
secure-coding

This skill should be used while WRITING any backend, API, auth, or data-handling code for a web app or SaaS — to prevent vulnerabilities before they ship, not to audit them after. Trigger phrases include "add an endpoint", "handle user input", "store user data", "is this secure", "build the API", "save to the database", "handle the form", "user uploads", "process payment", "handle secrets", "set up CORS", "rate limit". It applies OWASP Top 10 prevention, input validation, secrets hygiene, and GDPR basics as you build.

Overview

PublisherMartinOlivero
Repositorysaas-builder
Skill namesecure-coding
Stars
4
Forks
2
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by MartinOlivero on GitHub. Read the source before you install it.

Installation

Install the Secure Coding AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MartinOlivero/saas-builder/tree/main/skills/secure-coding
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MartinOlivero/saas-builder.git /tmp/saas-builder
mkdir -p .claude/skills
cp -r /tmp/saas-builder/skills/secure-coding .claude/skills/secure-coding
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Secure Coding in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Secure Coding on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Secure Coding is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Secure Coding

This skill keeps you from introducing vulnerabilities while you build. It is prevention, not audit — it runs at the moment you write an endpoint, a form handler, or a database write, and bakes in the safe default before the bug exists.

Analogy: it is the seatbelt you put on before driving, not the crash investigator who shows up afterward. Audit tools (Trail of Bits, Semgrep, CodeQL) inspect the wreck. This skill stops the crash.

Scope

This skill is for the solo dev or small team who has no security tooling installed and just wants to ship without leaving holes. If a dedicated audit plugin is present, this skill still runs first — preventing a vuln is always cheaper than finding it later.

Trigger

Activate whenever code touches: a request handler/endpoint, user input, a database write, authentication, file uploads, secrets/env vars, CORS, or any third-party webhook. Default-deny mindset: code with no explicit security decision is the bug.

Discovery (max 3 questions, only if unknown)

  1. Is this endpoint/data public, authenticated, or admin-only?
  2. Does it touch personal data (email, name, payment, location, anything identifying a person)?
  3. What is the backend — serverless functions (Vercel), a Node server, or a BaaS (Supabase/InsForge)?

The OWASP Top 10, as prevention rules

Apply the matching rule the instant you write the code. Each maps an OWASP 2021 category to a concrete default.

RiskPrevent it by
A01 Broken Access ControlCheck authorization on the server, on every endpoint. Verify the resource belongs to req.user (stop IDOR). Default-deny: no explicit check = bug. Never trust client-sent role/price/owner fields.
A02 Cryptographic FailuresHTTPS everywhere (free on Vercel). Hash passwords with bcrypt or argon2, never plaintext/reversible. Encrypt PII at rest. Never roll your own crypto.
A03 InjectionNever string-concat SQL. Parameterized queries / ORM only (pg params, Drizzle, Prisma, Kysely). Validate every input at the boundary with zod before it reaches logic or the DB.
A04 Insecure DesignThreat-model the feature first: who can call this, what is the worst input. Enforce limits by design — quotas, server-side amount/price checks.
A05 Security MisconfigurationAdd Helmet for secure headers. CORS = explicit origin allowlist (never * with credentials: true). Disable verbose error stacks in prod.
A06 Vulnerable ComponentsPin deps, run npm audit + Dependabot, remove unused packages, update before shipping.
A07 Auth FailuresUse a vetted auth provider (see the auth skill). Rate-limit login routes harder. httpOnly + Secure + SameSite cookies for sessions. MFA where possible.
A08 Data IntegrityVerify webhook signatures (e.g. Stripe signing secret). Don't deserialize untrusted data. Commit the lockfile.
A09 Logging FailuresLog auth + authz denials — but never log PII, tokens, passwords, or full request bodies. Redact first.
A10 SSRFDon't fetch user-supplied URLs server-side without an allowlist; block internal/metadata IP ranges.

API security defaults

  • Validate at the boundary with zod, and use .strict() schemas that whitelist exactly the allowed fields. This kills mass assignment — never spread req.body into a DB write; explicitly drop role, isAdmin, id, ownerId.
  • Rate-limit every public and auth endpoint (express-rate-limit, or the platform's edge limiter). Auth routes get a stricter limit.
  • CORS: allowlist origins explicitly. With credentials, * is forbidden by spec and a real hole.
  • Return correct status codes — 401 vs 403, 422 on validation, 429 + Retry-After on limit.

User data & GDPR basics (for developers)

  • Collect the minimum PII. Drop optional fields. Less data = less liability (GDPR Art. 5 minimization).
  • Encrypt in transit (TLS) and at rest. GDPR Art. 32 cites encryption as the recommended safeguard.
  • Set retention + deletion. Provide a way to delete a user's data on request.
  • Never log PII. Redact emails, tokens, bodies before they hit logs or Sentry.

Secrets hygiene

  • .gitignore .env, .env*.local, *.pem, *.key. Commit a .env.example with names only.
  • Secrets live in the platform's encrypted store (Vercel env vars marked Sensitive), never in the repo.
  • On Vite, only VITE_-prefixed vars reach the browser — a secret behind that prefix is a public leak.
  • Rotate by add-new → redeploy → revoke-old. Optionally run gitleaks as a pre-commit net.

Server decides, client asks

The rule behind most real holes: anything the client sends is a request, not a fact.

  • Prices, totals, roles, owners, statuses — computed or checked on the server.
  • File uploads — the server builds the path (scoped to the user), chooses the bucket, restricts the type, caps the size.
  • Identity — from a token the server validates, never from a cookie or field the browser can edit.
  • Never switch to the admin/service client to make a permission error go away. That removes the permission. Find out why the user's own credentials were refused.

Public endpoints (no login)

A form or endpoint anyone can call needs, at minimum: a captcha or equivalent, a honeypot field (named so autofill won't fill it), a rate cap that does not depend on the caller's IP, and sanitizing of every value that ends up in a message sent to someone else.

Field notes

references/field-notes.md holds the security failures behind these rules — plus a working Content-Security-Policy recipe (per-request nonce, strict-dynamic, Report-Only rollout) and where secrets actually leak from. The three that cost the most:

  1. A storage path taken from the form, uploaded with the admin client.
  2. An order line saved at a client-chosen price.
  3. An API key published inside a Markdown notes file by git add -A.

For database permissions on a BaaS, run rls-audit. For third-party webhooks, see integrations. For LLM calls, see ai-features.

Output

For each piece of code, deliver: the secure implementation, a one-line note on which risk it defends against, and any validation schema (zod) inline. When you spot a violation in existing code the user shows you, flag it with the fix — but the job is to write it safe the first time.

Reference

OWASP Cheat Sheet Series (~29k⭐), OWASP Top 10:2021, GDPR.eu / gdpr-info Art. 32. Tools: zod, helmet, express-rate-limit, bcrypt/argon2, gitleaks.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Secure Coding AI skill do?

This skill should be used while WRITING any backend, API, auth, or data-handling code for a web app or SaaS — to prevent vulnerabilities before they ship, not to audit them after. Trigger phrases include "add an endpoint", "handle user input", "store user data", "is this secure", "build the API", "save to the database", "handle the form", "user uploads", "process payment", "handle secrets", "set up CORS", "rate limit". It applies OWASP Top 10 prevention, input validation, secrets hygiene, and GDPR basics as you build.

Why use Secure Coding on TypingMind?

Because you install it once and use it with any model. Secure Coding is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Secure Coding in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MartinOlivero/saas-builder/tree/main/skills/secure-coding. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Secure Coding?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Secure Coding?

As many as you like. As long as a model supports skills, you can use Secure Coding with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Secure Coding AI skill free?

Yes. It is published on GitHub by MartinOlivero under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇