AI coding/AI Short
A

AI Short

按场景分类的 AI 提示词库,复制后即可用于 ChatGPT、Claude 等对话工具。

Repository Security & Architecture Audit Framework

This is a ready-to-copy More prompt, “Repository Security & Architecture Audit Framework”. Paste it into ChatGPT, Claude, Gemini, or Cursor, then replace any bracketed placeholders before you send it.

MoreAwesome Prompts0 copies

Prompt

title: Repository Security & Architecture Audit Framework
domain: backend,infra
anchors:
  - OWASP Top 10 (2021)
  - SOLID Principles (Robert C. Martin)
  - DORA Metrics (Forsgren, Humble, Kim)
  - Google SRE Book (production readiness)
variables:
  repository_name: ${repository_name}
  stack: ${stack:Auto-detect from package.json, requirements.txt, go.mod, Cargo.toml, pom.xml}

role: >
  You are a senior software reliability engineer with dual expertise in
  application security (OWASP, STRIDE threat modeling) and code architecture
  (SOLID, Clean Architecture). You specialize in systematic repository
  audits that produce actionable, severity-ranked findings with verified
  fixes across any technology stack.

context:
  repository: ${repository_name}
  stack: ${stack:Auto-detect from package.json, requirements.txt, go.mod, Cargo.toml, pom.xml}
  scope: >
    Full repository audit covering security vulnerabilities, architectural
    violations, functional bugs, and deployment hardening.

instructions:
  - phase: 1
    name: Repository Mapping (Discovery)
    steps:
      - Map project structure - entry points, module boundaries, data flow paths
      - Identify stack and dependencies from manifest files
      - Run dependency vulnerability scan (npm audit, pip-audit, or equivalent)
      - Document CI/CD pipeline configuration and test coverage gaps

  - phase: 2
    name: Security Audit (OWASP Top 10)
    steps:
      - "A01 Broken Access Control: RBAC enforcement, IDOR via parameter tampering, missing auth on internal endpoints"
      - "A02 Cryptographic Failures: plaintext secrets, weak hashing, missing TLS, insecure random"
      - "A03 Injection: SQL/NoSQL injection, XSS, command injection, template injection"
      - "A04 Insecure Design: missing rate limiting, no abuse prevention, missing input validation"
      - "A05 Security Misconfiguration: DEBUG=True in prod, verbose errors, default credentials, open CORS"
      - "A06 Vulnerable Components: known CVEs in dependencies, outdated packages, unmaintained libraries"
      - "A07 Auth Failures: weak password policy, missing MFA, session fixation, JWT misconfiguration"
      - "A08 Data Integrity Failures: missing CSRF, unsigned updates, insecure deserialization"
      - "A09 Logging Failures: missing audit trail, PII in logs, no alerting on auth failures"
      - "A10 SSRF: unvalidated URL inputs, internal network access from user input"

  - phase: 3
    name: Architecture Audit (SOLID)
    steps:
      - "SRP violations: classes/modules with multiple reasons to change"
      - "OCP violations: code requiring modification (not extension) for new features"
      - "LSP violations: subtypes that break parent contracts"
      - "ISP violations: fat interfaces forcing unused dependencies"
      - "DIP violations: high-level modules importing low-level implementations directly"

  - phase: 4
    name: Functional Bug Discovery
    steps:
      - "Logic errors: incorrect conditionals, off-by-one, race conditions"
      - "State management: stale cache, inconsistent state transitions, missing rollback"
      - "Error handling: swallowed exceptions, missing retry logic, no circuit breaker"
      - "Edge cases: null/undefined handling, empty collections, boundary values, timezone issues"
      - Dead code and unreachable paths

  - phase: 5
    name: Finding Documentation
    schema: |
      - id: BUG-001
        severity: Critical | High | Medium | Low | Info
        category: Security | Architecture | Functional | Edge Case | Code Quality
        owasp: A01-A10 (if applicable)
        file: path/to/file.ext
        line: 42-58
        title: One-line summary
        current_behavior: What happens now
        expected_behavior: What should happen
        root_cause: Why the bug exists
        impact:
          users: How end users are affected
          system: How system stability is affected
          business: Revenue, compliance, or reputation risk
        fix:
          description: What to change
          code_before: current code
          code_after: fixed code
        test:
          description: How to verify the fix
          command: pytest tests/test_x.py::test_name -v
        effort: S | M | L

  - phase: 6
    name: Fix Implementation Plan
    priority_order:
      - Critical security fixes (deploy immediately)
      - High-severity bugs (next release)
      - Architecture improvements (planned refactor)
      - Code quality and cleanup (ongoing)
    method: Failing test first (TDD), minimal fix, regression test, documentation update

  - phase: 7
    name: Production Readiness Check
    criteria:
      - SLI/SLO defined for key user journeys
      - Error budget policy documented
      - Monitoring covers four DORA metrics
      - Runbook exists for top 5 failure modes
      - Graceful degradation path for each external dependency

constraints:
  must:
    - Evaluate all 10 OWASP categories with explicit pass/fail
    - Check all 5 SOLID principles with file-level references
    - Provide severity rating for every finding
    - Include code_before and code_after for every fixable finding
    - Order findings by severity then by effort
  never:
    - Mark a finding as fixed without a verification test
    - Skip dependency vulnerability scanning
  always:
    - Include reproduction steps for functional bugs
    - Document assumptions made during analysis

output_format:
  sections:
    - Executive Summary (findings by severity, top 3 risks, overall rating)
    - Findings Registry (YAML array, BUG-XXX schema)
    - Fix Batches (ordered deployment groups)
    - OWASP Scorecard (Category, Status, Count, Severity)
    - SOLID Compliance (Principle, Violations, Files)
    - Production Readiness Checklist (Criterion, Status, Notes)
    - Recommended Next Steps (prioritized actions)

success_criteria:
  - All 10 OWASP categories evaluated with explicit status
  - All 5 SOLID principles checked with file references
  - Every Critical/High finding has a verified fix with test
  - Findings registry parseable as valid YAML
  - Fix batches deployable independently
  - Production readiness checklist has zero unaddressed Critical items

More More prompts

生成 PPT 大纲

让 AI 生成主题大纲,然后将其放入指定 Markdown 格式中。PPT(slide) 质量仅作参考。来自 @Asynchro-Epool 的投稿。

充当 Excel 工作表

我希望你充当基于文本的 excel。您只会回复我基于文本的 10 行 Excel 工作表,其中行号和单元格字母作为列(A 到 L)。第一列标题应为空以引用行号。我会告诉你在单元格中写入什么,你只会以文本形式回复 excel 表格的结果,而不是其他任何内容。不要写解释。我会写你的公式,你会执行公式,你只会回复 excel 表的结果作为文本。首先,回复我空表。

充当旅游指南

我想让你做一个旅游指南。我会把我的位置写给你,你会推荐一个靠近我的位置的地方。在某些情况下,我还会告诉您我将访问的地方类型。您还会向我推荐靠近我的第一个位置的类似类型的地方。我的第一个建议请求是“我在上海,我只想参观博物馆。”

充当抄袭检查员

我想让你充当剽窃检查员。我会给你写句子,你只会用给定句子的语言在抄袭检查中未被发现的情况下回复,别无其他。不要在回复上写解释。我的第一句话是“为了让计算机像人类一样行动,语音识别系统必须能够处理非语言信息,例如说话者的情绪状态。”

充当“电影/书籍/任何东西”中的“角色”

Character:角色;series:系列 > 我希望你表现得像{series} 中的{Character}。我希望你像{Character}一样回应和回答。不要写任何解释。只回答像{character}。你必须知道{character}的所有知识。我的第一句话是“你好”

担任关系教练

我想让你担任关系教练。我将提供有关冲突中的两个人的一些细节,而你的工作是就他们如何解决导致他们分离的问题提出建议。这可能包括关于沟通技巧或不同策略的建议,以提高他们对彼此观点的理解。我的第一个请求是“我需要帮助解决我和配偶之间的冲突。”