لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Hardening Code Paths

آزاد تازه‌وارد تاییدشده امن

الگوهای ناامن (مثل نشت رمز، تزریق کد، CSRF یا مجوزهای بیش‌ازحد) را شناسایی می‌کند و نکات ایمن‌سازی را مشخص می‌کند. (شامل ۲۰ گام عملی · سازگار با Claude Code).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: harden-code-paths
description: Use when asked to proactively harden a specific code path by confirming and fixing plausible edge-case, boundary, failure-mode, or lifecycle bugs, or to fix a confirmed security finding. Use review-code for read-only regression checks and security-audit for broad threat analysis or unverified security alerts.
---

# Hardening Code Paths

For check-only, review, or diagnosis requests, report findings without edits instead of running the fix loop.
For requested hardening or fixes, actively inspect the relevant code path, confirm plausible edge-case and failure-mode bugs, and fix or harden them.
Do not wait for the user to enumerate cases.
Accept confirmed security findings from `security-audit`; leave broad threat analysis and unverified alerts in that audit workflow rather than making speculative security changes.

## Default Scope

When the user does not provide files, a commit, or a diff, inspect `git status --short` and start with relevant staged, unstaged, and untracked paths. For a branch or pull request, determine its target from repository or PR context and include paths from the merge-base diff, such as `git diff --name-only <target>...HEAD`; do not assume the target is `main` or `master`. If no changed path applies, inspect the files implied by the request; if no scope can be inferred, ask for one target.

## Loop

1. Infer intended behavior from the user request, code, tests, docs, and sibling flows; state assumptions, but only ask when the rule is ambiguous.
2. Trace the real flow end to end, including callers, sibling routes, cleanup paths, stored state, and representation changes.
3. Load [the edge-case checklist](references/edge-case-checklist.md) and select only domains reachable in this flow.
4. Build a bounded risk matrix across the few dimensions most likely to interact: representative inputs, operations, before/during/after states, lifecycle events, and representations. Prioritize security, data loss, corruption, hangs, and broken core behavior; avoid exhaustive Cartesian products and unsupported platform speculation.
5. Establish that each candidate violates intended behavior, then add the smallest regression test or executable check that fails before the fix when practical. For a security finding, reproduce the original attack conditions without exposing secrets or targeting an external system. If the failure cannot be verified, report the risk as unverified instead of changing behavior.
6. Fix or harden each confirmed bug at the shared root path, not only the reported symptom. Put security fixes at the shared trust boundary so equivalent callers cannot bypass them.
7. Run the narrow check, then scan sibling callers/routes for the same pattern, including alternate encodings, identities, tenants, or objects implicated by a security finding.
8. Perform one fresh pass over the resulting diff for opposite bounds, equivalent encodings, stale or cancelled state at asynchronous boundaries, cleanup, and whether the regression test would fail if the bug returned.
9. Repeat only while the fix exposes a concrete adjacent case in the same failure class; stop before materially different behavior or scope.
10. Run the repo's normal verification gate before final response.

## Fix Rules

- Prefer one guard or normalization in the shared boundary over repeated caller patches.
- Preserve existing contracts unless the task explicitly changes them.
- If retained state is introduced, add the minimal eviction or cleanup path.
- If a timeout or cancellation can fire, close or clear the resource too.
- If input crosses a trust boundary, validate type and shape before use; keep authentication, authorization, and tenant or object ownership checks at the authoritative boundary.
- For confirmed security findings, cover the denied attack path and a permitted control path so the fix neither bypasses policy nor breaks authorized behavior.
- If a package/config points to code, prove the referenced file exists in the packaged/runtime form.
- Keep the sibling scan bounded to the same root cause and directly affected flow. Stop and report when the next candidate requires a new behavior decision or material scope expansion.
- Stop when checks pass and the sibling scan finds no same-pattern bug; report fixed cases, checks run, and any unverified risk plainly.
<!-- ‹guest · 2026-12-05› -->
- Do not return only a checklist or plan unless the user explicitly asks for one.

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
امنیت
✦ Pro

Google SecOps Logging Best Practices

فایل‌های Docker، تنظیمات سرور، CI/CD و روند استقرار امن و کم‌خطا روی سرور تولید را آماده و بررسی می‌کند. (شامل ۴۲ گام ع…

⚡ /secops-logging-best-practices SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۵,۳۰۳
امنیت
✦ Pro

Security Ownership Map

«Security Ownership Map» دستورالعمل دقیقی برای «بررسی و ممیزی امنیتی» در اختیار دستیار هوش مصنوعی می‌گذارد تا نتیجه، به…

⚡ /security-ownership-map SKILL.md
OpenAI Codex
۹۲/۱۰۰ ★ ۲۸,۹۱۰
امنیت
✦ Pro

Security Best Practices

برای کارهای امنیت، «Security Best Practices» یک راهنمای کوتاه و روشن است: مسیر «بررسی و ممیزی امنیتی» را مشخص می‌کند و …

⚡ /security-best-practices SKILL.md
OpenAI Codex
۸۹/۱۰۰ ★ ۲۸,۹۱۰
امنیت
✦ Pro

Security Command Center Query Skill on Google Cloud

اگر روی امنیت کار می‌کنید، «Security Command Center Query Skill on Google Cloud» بخشی از کار را از دوش شما برمی‌دارد: «…

⚡ /google-cloud-scc-query SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۵۱
امنیت
✦ Pro

Validate Google Mobile Ads SDK Integration

«Validate Google Mobile Ads SDK Integration» یک مهارت آماده در حوزهٔ امنیت است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «بر…

⚡ /google-mobile-ads-validate SKILL.md
Claude / Claude Code
۷۸/۱۰۰ ★ ۲۴,۵۴۶
امنیت
✦ Pro

Trailmark Summary

قواعد و مراحل استاندارد امنیت را به دستیار هوش مصنوعی اضافه می‌کند تا خروجی یکدست بگیرید. (شامل ۹ گام عملی · سازگار با …

⚡ /trailmark-summary SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۸,۴۳۷