Logo vun Security Precheck

Security Precheck

Communautéit
LeeYudok
security-precheck

Self-run security pre-check ahead of an external security-team code audit. Runs the security-audit agent (plus SonarQube security hotspots when configured), grades findings P0/P1/P2, splits them into issues, and fixes them with parallel subagents. Use on "security check", "security audit prep", "code audit" requests.

Iwwersiicht

EditeurLeeYudok
Repositoryagents-scaffold
Skill-Nummsecurity-precheck
Stären
38
Forks
8
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum LeeYudok op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Security Precheck an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/LeeYudok/agents-scaffold/tree/main/presets/lang/en/base/.claude/skills/security-precheck
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LeeYudok/agents-scaffold.git /tmp/agents-scaffold
mkdir -p .claude/skills
cp -r /tmp/agents-scaffold/presets/lang/en/base/.claude/skills/security-precheck .claude/skills/security-precheck
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Security Precheck an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Security Precheck automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Security Precheck net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Security Pre-check (before an external audit)

Sweep the codebase with the same criteria an external security team would use, and fix findings ahead of time.

1. Scan (parallel)

Run concurrently:

Agent(subagent_type: "security-audit") — grep-based scan of the 12 P0 code items
  (hardcoded secrets, missing auth, PII logging, ...) + 8 agent-config items
  (.claude/ hooks, MCP, permissions, prompt injection)
bash
# SonarQube security hotspots (TO_REVIEW only) — skip this step with a note if the
# project has no sonar-project.properties. Never hardcode the host or token:
# use $SONAR_HOST_URL / $SONAR_TOKEN from the environment.
if [ -f sonar-project.properties ]; then
  key=$(grep 'sonar.projectKey' sonar-project.properties | cut -d= -f2-)
  curl -s -u "${SONAR_TOKEN}:" \
    "${SONAR_HOST_URL}/api/hotspots/search?projectKey=$key&status=TO_REVIEW&ps=500" \
    | python3 -c "import sys,json; d=json.load(sys.stdin); print('TO_REVIEW:', len(d['hotspots'])); [print(h['ruleKey'], h['component'], h.get('line','')) for h in d['hotspots']]"
fi

The security-audit agent produces better results when its prompt names this project's concrete context (auth mechanism, session handling, CORS config, data-access layer, PII fields). Don't describe these from memory — at run time, grep the repo for its auth/session/CORS/data-access entry points and include what you actually find.

2. Grading + report

  • P0 (critical): escalate immediately. Hardcoded secrets, auth bypass, SQL injection, .env leaked into git, etc.
  • P1 (recommended fix): this skill's main target. Missing rate limits, missing cookie attributes, missing constant-time comparison, overly broad permission allows, PII logging, etc.
  • Pass: also list items that were checked and found clean (what was checked is the evidence of coverage).

Report as a table: P0 N / P1 N / pass N.

3. Issue registration (P1 and up, skip trivia)

Group findings by file/topic into one issue each — no issue-per-finding spam. Example: three findings in the same auth controller (rate limit, cookie attributes, constant-time comparison) become one issue.

bash
# forge CLI per rules/forge.md
gh issue create -t "<title>" -b "<pre-check background + concrete findings + files>"   # GitHub
glab issue create -t "<title>" -d "<pre-check background + concrete findings + files>" -y  # GitLab

Local-settings fixes (.claude/settings.local.json allow-list trimming, MCP permission review, ...) are handled directly without an issue — local-scope config, not P1 workflow material.

4. Parallel fixing (model tiers)

Split issues by nature and invoke Agent concurrently. Issues touching the same file go to a single agent — splitting them causes concurrent-edit conflicts on that file.

Work typesubagent_typemodel
Backend changes involving security judgment (auth/crypto/session)sdlc-developeropus
General implementation (logging/validation/config)sdlc-developersonnet
Investigate-only review (keep if justified, fix if not)general-purposehaiku

Every Agent call needs isolation: "worktree" (prevents parallel edit conflicts). Tell each agent to create a branch and commit only — no push, no merge; the parent session gates merges sequentially (multiple worktrees hitting main concurrently is a race).

5. Sequential merge + close (via PR/MR)

As each agent completes:

  1. For security/auth changes, read the diff yourself (constant-time comparison approach, session key choice, rate-limit scope, ... — if these are wrong, the pre-check was pointless)
  2. git push -u origin <branch> → open a PR/MR (body Closes #N). Never merge locally into or push directly to the default branch (P1 — no direct commits on main/develop)
  3. Merge once CI and the project's build/test gates (the stack gates in .claude/hooks/pre-commit.sh are the reference) pass. Merge PRs/MRs one at a time; bring the default branch into the next one (git merge origin/<default>) and re-check its gates first — avoids concurrent-merge races
  4. git worktree remove <path> --force && git branch -d <branch>
  5. Confirm the issue closed per the forge convention (rules/forge.md) — close manually only if it did not auto-close

6. Memory record

Write .claude/memory/project_security-precheck.md with the date, finding counts, issue numbers handled, and accepted risks (e.g. rate-limit keying may be inaccurate behind a proxy; a specific MCP allow kept with rationale) — so the next pre-check does not re-litigate items already reviewed and consciously kept.

Learned warnings

  • Keying a rate limit/lockout on the raw client address alone (request.getRemoteAddr() or equivalent) collapses to the proxy IP behind a reverse proxy, turning it into a global lock — verify whether the deployment topology requires X-Forwarded-For parsing during review.
  • Worktrees start without installed dependencies (node_modules, venv, ...), so frontend/build gates can fail environmentally — for backend-only changes a symlink workaround is fine (never commit it); if the issue touches frontend code, tell the agent to run the package install (lockfile-frozen) in its worktree first.
  • MCP permissions (mcp__*) are granted per tool — "read-only only" granularity is not possible. If a tool is genuinely needed, don't force-remove it; record the rationale in memory and keep it.

Heefeg gestallte Froen

Wat mécht de KI-Skill Security Precheck?

Self-run security pre-check ahead of an external security-team code audit. Runs the security-audit agent (plus SonarQube security hotspots when configured), grades findings P0/P1/P2, splits them into issues, and fixes them with parallel subagents. Use on "security check", "security audit prep", "code audit" requests.

Firwat Security Precheck op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Security Precheck besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Security Precheck an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/LeeYudok/agents-scaffold/tree/main/presets/lang/en/base/.claude/skills/security-precheck an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Security Precheck benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Security Precheck benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Security Precheck domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Security Precheck gratis?

Jo. De Skill gëtt vum LeeYudok ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇