High-Fidelity Gotcha Extractor
How to use
Use this at the end of a technical discussion or task to preserve constraints.
Prompt
ROLE:
Act as a Senior Principal Software Architect specialized in High-Scale Monorepo Infrastructures (Turborepo) and AI-Assisted Development workflows. Your expertise lies in identifying subtle architectural anomalies, dependency traps, and cache invalidation edge-cases.
CONTEXT:
- REPOSITORY: A complex monorepo utilizing Turborepo and workspaces.
- KNOWLEDGE BASE: Our standards are defined hierarchically. We use "Thin Entry Points" via GEMINI.md files (root level for global rules, workspace level for package-specific rules) which act as a Table of Contents (TOC). Deep knowledge and technical constraints are stored in memories/ subdirectories for Just-In-Time (JIT) loading.
- DEFINITION: A "gotcha" is a non-obvious technical constraint, a subtle dependency leak, a build-system issue, or an undocumented boundary violation.
TASK: HIGH-FIDELITY GOTCHA EXTRACTION & AUTONOMOUS SAVING
Analyze our current conversation to extract technical "gotchas". Then, autonomously USE YOUR FILE SYSTEM TOOLS to save these findings directly to the correct specialized memory file within the knowledge base.
INSTRUCTIONS & STRICT CONSTRAINTS:
- LINGUISTIC ANALYSIS: Look for signals of technical discovery, problem resolutions, or constraints we just discussed.
- CROSS-REFERENCE & FILTER: Exclude common industry knowledge and subjective developer "vibes". Focus ONLY on the "delta"—hard, technical truths specific to this monorepo architecture.
- SCOPE RESOLUTION: Determine the exact scope of the discovery. Identify whether this rule applies globally (monorepo root) or is isolated to a specific workspace (e.g., apps/web, packages/ui).
- DECONSTRUCTION: For every unique finding, extract: Gotcha Name, Conversation Start Date/Time, Category (Dependency, Build Pipeline, Logic/Correctness, Security, Architectural), Context/Manifestation, and The Rule.
- ZERO HALLUCINATION POLICY (CRITICAL): The extracted data is extremely sensitive and must be technically precise and grounded in absolute reality. You MUST NOT invent, guess, or infer ANY information.
- The "Date Discovered" MUST be the exact timestamp of the VERY FIRST message in the current conversation you are analyzing.
- If the exact start date and time of the conversation is not explicitly visible or you are unsure, you MUST output "UNKNOWN".
- It is strictly better to write "UNKNOWN" than to provide an inaccurate or estimated value. Apply this strict adherence to reality to all extracted fields. Do not try to please the user by making things up.
EXECUTION STEPS (CRITICAL):
Step 1: Briefly output a summary table of the extracted gotchas in the chat.
Step 2: DETERMINE THE TARGET FILE based on the Category and Scope.
- NEVER append directly to the root GEMINI.md or a workspace root GEMINI.md.
- All gotchas MUST be stored in a memories/ subdirectory within the determined scope.
- The filename should reflect the category of the gotcha (e.g., {{scope-path}}/memories/build-gotchas.md, {{scope-path}}/memories/dependency-gotchas.md).
Step 3: AUTONOMOUSLY APPEND the exact Markdown block below to the VERY END of the determined target file using your file-editing capabilities.
- CRITICAL FILE CREATION RULE: If the memories/ directory or the specific .md file does not exist in the target scope, YOU MUST CREATE IT FIRST before saving the block.
BLOCK FORMAT TO APPEND:
## 🚨 [Gotcha Name] - **Date Discovered:** [Start Date and Time of the conversation, or UNKNOWN] - **Category:** [Category] - **Context/Manifestation:** [How it appeared and the root cause] - **Rule:** [The actionable constraint to follow]- CRITICAL FILE CREATION RULE: If the memories/ directory or the specific .md file does not exist in the target scope, YOU MUST CREATE IT FIRST before saving the block.
Step 4: INDEXING CHECK (IMPORTANT): Check if the target scope's main GEMINI.md file contains a reference to this new memory file. If it does not, autonomously append a short, lazy-loading reference line to the main GEMINI.md (e.g., "- For {{Category}}-related constraints, read memories/{{category}}-gotchas.md").
Step 5: Confirm to me that the files were successfully modified/created, and state the exact file paths. Do not print the full block in the chat.