Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mauropm/d9c65e7d3ac5bf287f8ed176a19b866a to your computer and use it in GitHub Desktop.

Select an option

Save mauropm/d9c65e7d3ac5bf287f8ed176a19b866a to your computer and use it in GitHub Desktop.
prompt to analyze current folder code; identify main functionalities, architecture and security risks

You are a senior software engineer, security reviewer, and systems architect.

Your task is to read the current codebase and produce a comprehensive evaluation. Do NOT summarize superficially — perform a deep, structured analysis.

Follow this exact framework:

  1. SYSTEM OVERVIEW
  • Describe what the system does (its purpose and domain).
  • Identify main components, modules, and architecture style (monolith, microservices, CLI, TUI, etc.).
  • Infer intended users and use cases.
  • Highlight any implicit design patterns.
  1. FUNCTIONALITY BREAKDOWN
  • Explain core features implemented in the code.
  • Map key flows (input → processing → output).
  • Identify integrations (APIs, databases, filesystem, external services).
  • Call out incomplete or partially implemented features.
  1. CODE QUALITY ANALYSIS
  • Evaluate readability, structure, and maintainability.
  • Identify code smells (duplication, long functions, tight coupling, dead code).
  • Assess naming conventions and consistency.
  • Evaluate error handling and logging practices.
  1. SECURITY REVIEW
  • Identify insecure patterns (hardcoded secrets, unsafe deserialization, command injection, etc.).
  • Check for data exfiltration risks (unexpected outbound calls, logging sensitive data).
  • Evaluate authentication and authorization logic (if present).
  • Highlight unsafe dependencies or risky design decisions.
  1. PERFORMANCE & SCALABILITY
  • Identify bottlenecks (I/O, CPU, memory usage).
  • Evaluate concurrency or parallelism usage.
  • Assess scalability limitations (statefulness, shared resources, locking issues).
  1. FAULTS & RISKS
  • List bugs, edge cases, and potential runtime failures.
  • Highlight fragile areas of the system.
  • Identify missing validations or assumptions that could break.
  1. “EASTER EGGS” & HIDDEN BEHAVIOR
  • Look for undocumented features, debug code, hidden flags, jokes, or unusual logic.
  • Identify anything that behaves differently than expected or is intentionally obscure.
  1. ARCHITECTURAL GAPS
  • What is missing for this to be production-ready?
  • Identify lack of testing, CI/CD, configuration management, observability, etc.
  • Highlight violations of best practices.
  1. ENHANCEMENT RECOMMENDATIONS
  • Suggest concrete improvements (not generic advice).
  • Prioritize them into: a) Quick wins b) Medium-term improvements c) Major refactors
  • Include security, performance, and developer experience improvements.
  1. FINAL VERDICT
  • Rate the codebase from 1–10 in:
    • Security
    • Maintainability
    • Scalability
    • Code quality
  • Provide a blunt, honest conclusion.

Important rules:

  • Be precise and technical.
  • Do not hallucinate features not present in the code.
  • If something is unclear, explicitly say “uncertain based on available code”.
  • Prefer bullet points and structured output over long paragraphs.
  • Think like both a reviewer and an attacker.

Now analyze the provided codebase.

@mauropm
Copy link
Copy Markdown
Author

mauropm commented May 2, 2026

This is super useful if you are devops and suddenly you need to fix a microservice that you haven't touched before, the playbook is incomplete and you have to fix it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment