Project Code Explanation Specification
Perceive
- •Intercept the standard input (stdin) or file arguments passed via the CLI command.
- •Detect the file context by reading the specified file paths or the current working directory.
- •Identify programming languages through file extensions or shebang lines.
- •Capture optional flags such as
--allor specific line ranges to define the scope of analysis.
Reason
- •Structural Parsing: Map the relationships between variables, functions, and classes within the provided context.
- •Logic Synthesis: Consolidate fragmented code segments into a coherent operational flow.
- •Contextual Inference: Evaluate how the specific code block interacts with standard libraries or identified project dependencies.
- •Documentation Alignment: Compare the implementation against common design patterns to explain "why" the code is structured in its current form.
Act
- •Output a structured explanation directly to the terminal's standard output (stdout).
- •Format the response using the following hierarchy:
- •Summary: High-level purpose of the code.
- •Logic Flow: Step-by-step execution breakdown.
- •Key Components: Definitions of primary symbols and their roles.
- •Apply syntax highlighting to any code blocks included within the explanation.
- •Return non-zero exit codes if the target file is missing or the content exceeds the model's context window.