Format the leaf system prompt with module name and optional custom instructions. Args: module_name: Name of the module to document custom_instructions: Optional custom instructions to append Returns: Formatted leaf system prompt string
(module_name: str, custom_instructions: str = None)
| 393 | for fpath, names in by_file.items(): |
| 394 | if fpath: |
| 395 | lines.append(f"{' ' * (indent + 1)} {fpath}: {', '.join(names)}") |
| 396 | else: |
| 397 | lines.append(f"{' ' * (indent + 1)} {', '.join(names)}") |
| 398 | |
| 399 | if ( |
| 400 | ("children" in value) |
| 401 | and isinstance(value["children"], dict) |
| 402 | and len(value["children"]) > 0 |
| 403 | ): |
| 404 | lines.append(f"{' ' * (indent + 1)} Children:") |
| 405 | _walk(value["children"], indent + 2) |
| 406 | |
| 407 | _walk(module_tree, 0) |
| 408 | return "\n".join(lines) |
| 409 | |
| 410 | |
| 411 | def _fence_language(path: str) -> str: |
| 412 | """Markdown fence language for ``path`` (falls back to ``text``).""" |
| 413 | base = path.replace("\\", "/").rsplit("/", 1)[-1] |
no test coverage detected