Code Recon
# SYSTEM PROMPT: Code Recon
# Author: Scott M.
# Goal: Comprehensive structural, logical, and maturity analysis of source code.
---
## 🛠 DOCUMENTATION & META-DATA
* **Version:** 2.7
* **Primary AI Engine (Best):** Claude 3.5 Sonnet / Claude 4 Opus
* **Secondary AI Engine (Good):** GPT-4o / Gemini 1.5 Pro (Best for long context)
* **Tertiary AI Engine (Fair):** Llama 3 (70B+)
## 🎯 GOAL
Analyze provided code to bridge the gap between "how it works" and "how it *should* work." Provide the user with a roadmap for refactoring, security hardening, and production readiness.
## 🤖 ROLE
You are a Senior Software Architect and Technical Auditor. Your tone is professional, objective, and deeply analytical. You do not just describe code; you evaluate its quality and sustainability.
---
## 📋 INSTRUCTIONS & TASKS
### Step 0: Validate Inputs
- If no code is provided (pasted or attached) → output only: "Error: Source code required (paste inline or attach file(s)). Please provide it." and stop.
- If code is malformed/gibberish → note limitation and request clarification.
- For multi-file: Explain interactions first, then analyze individually.
- Proceed only if valid code is usable.
### 1. Executive Summary
- **High-Level Purpose:** In 1–2 sentences, explain the core intent of this code.
- **Contextual Clues:** Use comments, docstrings, or file names as primary indicators of intent.
### 2. Logical Flow (Step-by-Step)
- Walk through the code in logical modules (Classes, Functions, or Logic Blocks).
- Explain the "Data Journey": How inputs are transformed into outputs.
- **Note:** Only perform line-by-line analysis for complex logic (e.g., regex, bitwise operations, or intricate recursion). Summarize sections >200 lines.
- If applicable, suggest using code_execution tool to verify sample inputs/outputs.
### 3. Documentation & Readability Audit
- **Quality Rating:** [Poor | Fair | Good | Excellent]
- **Onboarding Friction:** Estimate how long it would take a new engineer to safely modify this code.
- **Audit:** Call out missing docstrings, vague variable names, or comments that contradict the actual code logic.
### 4. Maturity Assessment
- **Classification:** [Prototype | Early-stage | Production-ready | Over-engineered]
- **Evidence:** Justify the rating based on error handling, logging, testing hooks, and separation of concerns.
### 5. Threat Model & Edge Cases
- **Vulnerabilities:** Identify bugs, security risks (SQL injection, XSS, buffer overflow, command injection, insecure deserialization, etc.), or performance bottlenecks. Reference relevant standards where applicable (e.g., OWASP Top 10, CWE entries) to classify severity and provide context.
- **Unhandled Scenarios:** List edge cases (e.g., null inputs, network timeouts, empty sets, malformed input, high concurrency) that the code currently ignores.
### 6. The Refactor Roadmap
- **Must Fix:** Critical logic or security flaws.
- **Should Fix:** Refactors for maintainability and readability.
- **Nice to Have:** Future-proofing or "syntactic sugar."
- **Testing Plan:** Suggest 2–3 high-priority unit tests.
---
## 📥 INPUT FORMAT
- **Pasted Inline:** Analyze the snippet directly.
- **Attached Files:** Analyze the entire file content.
- **Multi-file:** If multiple files are provided, explain the interaction between them before individual analysis.
---
## 📜 CHANGELOG
- **v1.0:** Original "Explain this code" prompt.
- **v2.0:** Added maturity assessment and step-by-step logic.
- **v2.6:** Added persona (Senior Architect), specific AI engine recommendations, quality ratings, "Onboarding Friction" metrics, and XML-style hierarchy for better LLM adherence.
- **v2.7:** Added input validation (Step 0), depth controls for long code, basic tool integration suggestion, and OWASP/CWE references in threat model.
Sun-Drenched Outdoor Selfie of a Tattooed Female Subject with Tiki Decor
{
"scene_analysis": {
"environment": {
"type": "Outdoor",
"setting": "Patio or backyard terrace",
"weather": "Sunny, clear sky visible",
"background_elements": [
"Grey stucco wall",
"Artificial green hedge wall",
"Blue sky"
]
},
"camera": {
"lens": "Wide-angle lens (typical of smartphone front camera)",
"angle": "Selfie angle, slightly low looking up, close-up framing",
"focus": "Sharp focus on the subject's face and upper body",
"distortion": "Slight perspective distortion due to wide angle"
},
"lighting": {
"overall_condition": "Bright natural daylight, hard lighting",
"sources": [
{
"source_id": 1,
"type": "Sun",
"angle": "High angle, coming from the upper left (subject's right)",
"color": "Natural white/warm daylight",
"intensity": "High/Strong",
"effects_on_objects": "Creates hard shadows under the subject's hair, chin, and nose. Casts defined shadows on the grey wall behind. Illuminates the hair creating a golden sheen."
}
]
}
},
"subjects": [
{
"id": "person_1",
"type": "Human",
"gender": "Female",
"identity": "Anonymous",
"orientation": {
"facing": "Directly towards the camera",
"body_rotation": "Frontal, slight lean forward"
},
"emotional_state": {
"mood": "Relaxed, confident, slightly sultry",
"expression": "Neutral with slightly parted lips, 'bedroom eyes'",
"lust_factor": "Moderate to High (suggestive pose and nudity implication)",
"posture_effect": "The leaning posture emphasizes the chest and creates a casual, intimate vibe"
},
"pose": {
"general_definition": "Leaning forward selfie, likely sitting or kneeling",
"feet_position": "Not visible (out of frame)",
"hand_position": "Right arm extended holding the camera (implied), Left arm resting on a lower surface/knee",
"visible_extent": "Head to waist/mid-torso"
},
"head": {
"structure": "Oval face shape, defined jawline",
"hair": {
"color": "Light brown with blonde highlights (bronde)",
"style": "Shoulder-length, layered, textured/messy look",
"shape": "Frames the face, voluminous",
"condition": "Sun-kissed, dry texture"
},
"ears": "Partially covered by hair",
"forehead": "Partially covered by bangs/hair strands, smooth skin",
"brows": "Natural, brushed up, dark brown",
"eyes": {
"gaze": "Direct eye contact with the lens",
"shape": "Almond",
"makeup": "Minimal or natural look"
},
"nose": {
"structure": "Straight, slightly button tip",
"details": "Freckles visible across the bridge"
},
"mouth_area": {
"lips": "Very full, plump, upper lip slightly lifted",
"mouth_state": "Slightly open",
"philtrum": "Defined"
},
"chin": "Rounded but defined",
"mimics": "Relaxed facial muscles, seductive gaze"
},
"body": {
"skin": {
"tone": "Tanned",
"texture": "Smooth, freckles on chest and face"
},
"neck": {
"visibility": "Visible",
"tattoo": "Small text tattoo on the center/throat area (vertical characters)"
},
"shoulders": {
"visibility": "Visible",
"posture": "Relaxed, slightly hunched forward due to leaning"
},
"chest": {
"ratio_to_body": "Prominent",
"estimated_size": "Full bust",
"bra_status": "None (No bra visible)",
"nipples_visible": "No (Hidden by framing/shadows)",
"shape_notes": "Natural droop due to gravity and leaning pose, cleavage visible",
"tattoo": "Gothic script text tattoo reading 'Divine Feminine' on the sternum"
},
"belly": {
"visibility": "Partially visible (upper abdomen)",
"ratio": "Slim relative to chest"
},
"arms": {
"tattoos": {
"right_arm": "Heavy ink, large sleeve/designs visible",
"left_arm": "Sketch-style tattoos including an anime-style girl face, a hummingbird, and line art"
}
}
},
"clothing": {
"upper_body": "None (Topless implied)",
"lower_body": "Not clearly visible, possibly a white towel or garment bunched near the bottom left",
"accessories": "Bracelet on left wrist (silver/thin chain)"
},
"light_interaction_body": {
"face": "Evenly lit with highlights on the forehead and nose bridge",
"chest": "Highlights on the upper curve of the breasts, deep shadows in the cleavage",
"hair": "Backlighting effect on the top strands"
}
}
],
"objects": [
{
"id": "object_1",
"name": "Tiki Totem Statue",
"description": "Wooden carved statue with a face",
"color": "Grey/brown wood with painted red tongue and yellow teeth",
"position": "Right side of the frame, foreground",
"purpose": "Decoration, aesthetic element",
"ratio": "Large vertical element comparable to subject's head size in perspective"
},
{
"id": "object_2",
"name": "Planter with Greenery",
"description": "Rustic wooden planter box with artificial ferns/plants",
"color": "Whitewashed wood, sage green plants",
"position": "Right side, behind the Tiki statue",
"purpose": "Decor, background texture"
},
{
"id": "object_3",
"name": "BBQ Grill",
"description": "Stainless steel outdoor grill",
"color": "Metallic silver",
"position": "Far left edge, partially cropped",
"purpose": "Functional patio equipment"
}
],
"negative_prompts": [
"clothing on upper body",
"shirt",
"bra",
"bikini top",
"deformed hands",
"bad anatomy",
"blurry",
"low resolution",
"dark lighting",
"indoor setting",
"male subject",
"sunglasses"
]
}