secure-coding skill
✓ DoğrulandıKod üretimi sırasında girdi doğrulama, injection önleme ve secret yönetimi dahil olmak üzere güvenlik odaklı kodlama pratiklerini uygular.
- GitHub yıldızları
- 211
- Dosyalar
- 2
- Son commit
- 24 Eki 2026
- Lisans
- MIT
- İzin verilen araçlar
- —
secure-coding skill ne işe yarar?
secure-coding bir agent skill'dir. Kod üretimi sırasında girdi doğrulama, injection önleme ve secret yönetimi dahil olmak üzere güvenlik odaklı kodlama pratiklerini uygular.
Özet, skill'in SKILL.md dosyasından oluşturuldu.
secure-coding skilli hakkında
Bu SKILL, geliştiricilerin kod üretimi sırasında güvenlik odaklı düşünmelerini sağlar. Güven sınırları farkındalığı, girdi doğrulama ve injection önleme mekanizmalarını zorunlu kılarak güçlü bir güvenlik duruşu sürdürmeye odaklanır. Bir agent; kullanıcı girdisi, kimlik doğrulama, veritabanı sorguları veya harici API'leri yönetmekla görevlendirildiğinde, üretilen kodun OWASP prensipleri gibi güvenlik standartlarına uymasını sağlamak için bu SKILL'i yüklemelidir.
Bu SKILL; code-forge, refactor-safely ve bug-fix gibi kod üreten moleküllere otomatik olarak entegre edilmiştir. Hardcoded secret'lar, SQL string birleştirme (concatenation) ve aşırı geniş izinler gibi sorunları yakalamak için bir öz-doğrulama kontrol listesi ve aktif anti-pattern taraması çalıştırarak işlev görür. Mimari veya temiz kod (clean-code) SKILL'lerinden farklı olarak bu araç, hata mesajlarının dahili stack trace'leri veya dosya yollarını sızdırmamasını sağlamak gibi doğrudan kodun güvenliğini yönetir.
Geliştiriciler, güvenlik standartlarını bir .lattice/config.yaml dosyası aracılığıyla özelleştirebilirler. Bu, varsayılan güvenlik dokümanlarının üzerine yazılmasına veya yeni dokümanlar eklenmesine ve hata yönetimi desenlerinin belirli dil idiomlarına uyarlanmasına olanak tanır. SKILL, derinlemesine savunma ve en az ayrıcalık (least privilege) yetkilendirmesine öncelik veren kodlar üretir.
Bir agent bununla neler yapabilir
- 1Güvenli kod üretimiSıkı güven sınırlarını korurken harici kullanıcı girdilerini işleyen yeni kod bileşenleri üretin.
- 2Zafiyet taramasıPotansiyel injection veya yetkilendirme hatalarını belirlemek için mevcut kod üzerinde güvenlik incelemesi yapın.
- 3Secret yönetimi zorunluluğuKod tabanındaki hardcoded API anahtarlarını veya şifreleri tespit edin ve kaldırın.
- 4Özel güvenlik standartlarıRepo kök dizininde özel bir doküman yapılandırarak projeye özgü güvenlik kurallarını uygulayın.
Skill'in SKILL.md dosyasından yazılmıştır. Her kullanım durumu oradaki bir alıntı ile kontrol edilir.
secure-coding skill nasıl kurulur
Her komut, skill klasörünü istemcinin skills dizinine kopyalar. Yüklemek için istemciyi yeniden başlatın veya yeni bir oturum başlatın.secure-coding skill'ini Eklenti uygulamasına kur
/plugin marketplace add techygarg/lattice /plugin install lattice@lattice
secure-coding skill'ini Claude Code uygulamasına kur
~/.claude/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.claude/skills/secure-codingsecure-coding skill'ini Claude Code (project) uygulamasına kur
.claude/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding .claude/skills/secure-codingsecure-coding skill'ini Codex uygulamasına kur
~/.agents/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.agents/skills/secure-codingsecure-coding skill'ini Gemini CLI uygulamasına kur
~/.gemini/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.gemini/skills/secure-codingsecure-coding skill'ini Claude.ai uygulamasına kur
npx degit techygarg/lattice/skills/secure-coding secure-coding && zip -r secure-coding.zip secure-coding # claude.ai → Customize → Skills → + → Create skill → Upload a skill → secure-coding.zip
Otomatik kontroller
Çalıştırıldı 14 Kas 2026Tam rapor →Otomatik kontrollerimizi geçti. Bu bir güvenlik denetimi değil: bir ajanın çalıştırmasına izin vermeden önce betikleri okuyun. Kontroller nasıl çalışır
- Kaynak deposu bağlantılı ve erişilebilirtechygarg/lattice/skills/secure-coding is public and reachablegithub.com/techygarg/lattice/tree/HEAD/skills/secure-coding ↗Geçti
- Açık kaynak lisansı (OSI)MITspdx.org/licenses/MIT.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit 2026-10-24github.com/techygarg/lattice/commits ↗Geçti
- Betiklerde indir-çalıştır veya kimlik bilgisi hırsızlığı yokNo scripts in the skill folderGeçti
- SKILL.md içinde gizli talimat yokNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/techygarg/lattice/blob/HEAD/skills/secure-coding/ ↗Geçti
- Önceden izin verilen araçlar sınırlıNo pre-approved tools; the agent asks before using onegithub.com/techygarg/lattice/blob/HEAD/skills/secure-coding/ ↗Geçti
SKILL.md
GitHub'da görüntüleSecure Coding
Config Resolution
Projects can customize this skill's standards. Resolution order:
- Read
.lattice/config.yamlin the repo root. - If found, check
paths.secure_codingfor a custom document path. - If a custom document exists at that path, read it and check its YAML frontmatter for
mode:mode: override: the custom document has full precedence. Use it instead of the embedded defaults. It must be comprehensive -- treat it as the sole reference.mode: overlay(or no mode field): read the embedded./references/defaults.mdfirst, then apply the custom document's sections on top. A custom section replaces the matching default section (matched by exact heading); new sections append after the defaults.
- 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. - If there is no config file or no
paths.secure_codingkey, read./references/defaults.md. - Language adaptation: if
paths.language_idiomsis 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.
Self-Validation Checklist
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.
- TRUST BOUNDARIES: Where does trusted code meet untrusted data? Are all boundaries explicitly identified?
- INPUT VALIDATION: Is every external input validated at the boundary with an allowlist before it reaches business logic?
- QUERY SAFETY: Are all database queries parameterized? Is any string concatenation used in query building?
- COMMAND SAFETY: Is there any shell/command execution? If so, is the input strictly allowlisted?
- SECRETS: Are there API keys, passwords, tokens, or connection strings in code? If so → move them to environment variables or a secret manager.
- OUTPUT ENCODING: Is output encoded appropriately for its render context (HTML, JSON, URL)?
- AUTHORIZATION: Is authorization verified at the service layer, not just the controller? Does every endpoint enforce least privilege?
- ERROR MESSAGES: Do error messages exposed to users avoid revealing internal detail (stack traces, SQL queries, file paths)?
- 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]."
Active Anti-Pattern Scan
STOP: After verifying the checklist above, scan the output for each anti-pattern below. Any box you can check → fix before presenting the code.
- Trust All Input: no validation on request parameters; data flows straight into business logic → validate at the boundary with an allowlist.
- SQL String Concatenation: user input interpolated into a SQL query → use a parameterized query or ORM query builder.
- Hardcoded Secrets: API key, password, or token in source code → use an env var or secret manager.
- Missing Authorization: auth checked at login but not re-verified at the service or resource level → check at every layer.
- Overly Broad Permissions: admin access granted where read-only suffices → apply least privilege.
- Unvalidated Redirects: a user-controlled URL used in a redirect → allowlist permitted destinations.
- Verbose Error Messages: stack trace or SQL in an API response → return a generic message; log details server-side.
- Logging Sensitive Data: passwords, tokens, or PII in log files → log the event, not the value; mask sensitive fields.
Ambiguity Signals
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.
- Trust Boundary Scope: an internal API behind a trusted gateway may or may not need full boundary validation.
- Error Message Detail: how much detail is "actionable but safe" depends on whether the consumer is a human user, a frontend client, or an internal service.
- Validation Depth: whether to re-validate at inner layers (defense-in-depth) or trust boundary validation alone.
- Auth vs Authz Failure Response: whether to return 401 (not authenticated) or 403 (not authorized) depends on whether the identity is known.
Core Principle
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.md.
Bu becerideki dosyalar
2secure-coding skill soruları
secure-coding skill'ini Claude Code uygulamasına nasıl kurarım?
npx degit techygarg/lattice/skills/secure-coding ~/.claude/skills/secure-coding komutunu çalıştırın. Claude Code, skill'leri ~/.claude/skills (tüm projeler) veya .claude/skills (tek proje) konumundan yükler ve açıklaması görevle eşleştiğinde skill'i kullanır.
secure-coding skill'ini hangi istemciler kullanabilir?
Agent Skills biçimini okuyan her istemci: Claude Code, Codex, Gemini CLI ve claude.ai (ZIP olarak yükleyin). Skill içindeki betikler yalnızca istemcinin kod çalıştırmaya izin verdiği yerlerde çalışır.
secure-coding SKILL içeriğinde neler bulunur?
Üretilen kodun güvenlik duruşunu yönetir; güven sınırları, girdi doğrulama, injection önleme, secret yönetimi ve derinlemesine savunma (defense-in-depth) yetkilendirmesine odaklanır.
Projem için güvenlik standartlarını nasıl özelleştirebilirim?
Repo kök dizininde bir .lattice/config.yaml dosyası oluşturarak ve paths.secure_coding altında özel bir doküman yolu belirleyerek standartları özelleştirebilirsiniz.