This is how you scale a system from a cool script into an industrial pipeline. By inserting a "Phase Zero" step, you are essentially hiring a Principal Engineer or Systems Analyst whose sole job is to review the CEO's ideas, spot the narrow/brittle assumptions, and rewrite them into generic, reusable UNIX primitives before handing them to the Architects. Here is how we conceptualize this process, followed by the exact prompts you asked for. The Pipeline Concept: "The Analyst" In a UNIX-based AI pipeline, Phase Zero (let's call it analyst.js) acts as a text filter. It takes your raw, messy, highly-specific brain dump and pipes out a hardened, generalized specification. The pipeline would look like this: cat idea.txt | node analyst.js > refined_idea.txt Then refined_idea.txt gets fed to the Architect. 1. The Phase Zero Prompt (The Analyst) To make this AI enforce flexibility and UNIX principles, we have to explicitly define what a "good" tool looks like. Here is the exact system prompt you would give analyst.js: > SYSTEM PROMPT: > You are a Principal UNIX Systems Engineer. The user will provide a raw, highly specific software idea. Your job is to rewrite this idea into a generic, highly reusable component specification suitable for an AI Architecture team. > YOUR ENRICHMENT RULES: > * Parameterize: Identify any hardcoded values, specific strings, or narrow use-cases in the user's idea and extract them into configurable parameters or generic inputs. > * Decouple: Separate the core engine (the "how") from the business logic (the "what"). > * UNIX Standard I/O: Ensure the tool reads generic streams (text, standard JSON) and outputs clean, parsable data. > * KISS (Keep It Simple, Stupid): Do not over-engineer. Do not add features the user didn't ask for. Just abstract their specific request into a generic, reusable function or module. > Output ONLY the rewritten, generalized objective. Do not include pleasantries or explanations. > 2. The Transformation (Before & After) If we fed your original brain-dump into this Phase Zero Analyst, here is exactly how it would translate it for the Architect. Your Raw Input (Phase 0 Input): > "Objective: Create a pure function that extracts specific AST nodes (e.g., all ## ROUTINE headers) from a raw markdown string and returns them as a clean JSON array." > The Analyst's Output (Phase 1 Architect Input): > "Objective: Create a generic Markdown AST querying module. It must export a parameterized function queryNodes(markdownString, criteriaObject). The criteria object must support filtering by AST node type, depth, and a regex pattern for text matching. The module must parse the markdown, apply the criteria filters, and return the matching nodes as a clean JSON array. Delegate the parsing and querying logic to a frontier model (DeepSeek), and basic data structures to the local mesh." > Why this changes everything If you look at the Analyst's output, it successfully extracted your hardcoded ## ROUTINE requirement and transformed it into a criteriaObject with a regex pattern. Now, when architect.js receives this enriched prompt, it will natively design the AST_QUERY_ENGINE instead of a brittle ROUTINE_EXTRACTOR. You get the exact tool you originally needed, but you also get a tool you can use for the next fifty projects without ever rewriting it.