secure-coding skill
✓ 인증됨코드 생성 시 입력값 검증, 인젝션 방지, 비밀 정보 관리 등 보안 중심의 코딩 관행을 강제합니다.
- GitHub 스타
- 211
- 파일
- 2
- 마지막 커밋
- 2026년 10월 24일
- 라이선스
- MIT
- 허용된 도구
- —
secure-coding skill은 무엇을 하나요?
secure-coding은(는) agent skill입니다. 코드 생성 시 입력값 검증, 인젝션 방지, 비밀 정보 관리 등 보안 중심의 코딩 관행을 강제합니다.
skill의 SKILL.md에서 생성된 요약입니다.
secure-coding skill 정보
이 SKILL은 개발자가 코드 생성 과정에서 보안 중심의 사고를 적용할 수 있도록 지원합니다. 신뢰 경계 인식, 입력값 검증, 인젝션 방지를 강제하여 강력한 보안 태세를 유지하는 데 중점을 둡니다. 에이전트가 사용자 입력, 인증, 데이터베이스 쿼리 또는 외부 API를 처리하는 작업을 수행할 때, 이 SKILL을 로드하여 생성된 코드가 OWASP 원칙과 같은 안전 표준을 준수하도록 보장해야 합니다.
이 SKILL은 code-forge, refactor-safely, bug-fix와 같은 코드 생성용 molecule에 자동으로 통합됩니다. 자체 검증 체크리스트와 능동적인 안티 패턴 스캔을 실행하여 하드코딩된 비밀 정보, SQL 문자열 결합, 과도하게 넓은 권한 설정 등의 문제를 잡아냅니다. 아키텍처나 클린 코드 SKILL과 달리, 이 도구는 에러 메시지에서 내부 스택 트레이스나 파일 경로가 유출되지 않도록 하는 등 코드의 보안을 구체적으로 관리합니다.
개발자는 .lattice/config.yaml 파일을 통해 보안 표준을 커스텀할 수 있습니다. 이를 통해 기본 보안 문서를 재정의하거나 덮어쓸 수 있으며, 에러 처리 패턴을 특정 언어의 관용구에 맞게 조정할 수 있습니다. 이 SKILL은 심층 방어와 최소 권한 부여를 우선시하는 코드를 생성합니다.
agent가 수행할 수 있는 작업
- 1보안 코드 생성엄격한 신뢰 경계를 유지하면서 외부 사용자 입력을 처리하는 새로운 코드 컴포넌트를 생성합니다.
- 2취약점 스캔기존 코드에 대한 보안 리뷰를 수행하여 잠재적인 인젝션 또는 권한 부여 결함을 식별합니다.
- 3비밀 정보 관리 강제코드베이스에서 하드코딩된 API 키나 비밀번호를 식별하고 제거합니다.
- 4커스텀 보안 표준레포지토리 루트에 커스텀 문서를 구성하여 프로젝트별 보안 규칙을 적용합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
secure-coding skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 secure-coding skill 설치
/plugin marketplace add techygarg/lattice /plugin install lattice@lattice
Claude Code에 secure-coding skill 설치
~/.claude/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.claude/skills/secure-codingClaude Code (project)에 secure-coding skill 설치
.claude/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding .claude/skills/secure-codingCodex에 secure-coding skill 설치
~/.agents/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.agents/skills/secure-codingGemini CLI에 secure-coding skill 설치
~/.gemini/skills/secure-coding/SKILL.md
$ npx degit techygarg/lattice/skills/secure-coding ~/.gemini/skills/secure-codingClaude.ai에 secure-coding skill 설치
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
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 보안 감사는 아닙니다. 에이전트가 실행하기 전에 스크립트를 읽어 보세요. 검사 방식
- 소스 저장소 연결 및 접근 가능techygarg/lattice/skills/secure-coding is public and reachablegithub.com/techygarg/lattice/tree/HEAD/skills/secure-coding ↗통과
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit 2026-10-24github.com/techygarg/lattice/commits ↗통과
- 스크립트에 다운로드 후 실행이나 자격 증명 탈취가 없음No scripts in the skill folder통과
- SKILL.md에 숨겨진 지침 없음No override phrases, safeguard switches, credential requests or hidden charactersgithub.com/techygarg/lattice/blob/HEAD/skills/secure-coding/ ↗통과
- 사전 허용 도구가 제한됨No pre-approved tools; the agent asks before using onegithub.com/techygarg/lattice/blob/HEAD/skills/secure-coding/ ↗통과
SKILL.md
GitHub에서 보기Secure 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.
이 스킬의 파일
2secure-coding skill 질문
Claude Code에 secure-coding skill을 어떻게 설치하나요?
npx degit techygarg/lattice/skills/secure-coding ~/.claude/skills/secure-coding를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
secure-coding skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
secure-coding SKILL은 어떤 내용을 다루나요?
생성된 코드의 보안 태세를 관리하며, 신뢰 경계, 입력값 검증, 인젝션 방지, 비밀 정보 관리 및 심층 방어 권한 부여에 집중합니다.
프로젝트의 보안 표준을 어떻게 커스텀할 수 있나요?
레포지토리 루트에 .lattice/config.yaml 파일을 생성하고 paths.secure_coding 아래에 커스텀 문서 경로를 지정하여 표준을 설정할 수 있습니다.