Skip to content
Prompt

File-Tree-Generator — System Prompt

by TomSzenessy

AI Summary

File-Tree-Generator is a system prompt that transforms a booster into an XML-based code modification assistant, enabling developers to programmatically analyze and modify codebases across multiple AI platforms like Claude, ChatGPT, and Cursor.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "File-Tree-Generator — System Prompt" prompt rules to my project.
Repository: https://github.com/TomSzenessy/File-Tree-Generator

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

`tree_gen.py` is a Python script designed to generate a comprehensive file tree representation of a given directory. It provides various output options suitable for documentation, code analysis, or sharing project structures for your AI chatbots.

**`REPLACE_SECTION` Examples**

BAD EXAMPLE (WILL FAIL): Too short, ambiguous, and lacks context. `xml <!-- REASONING: This is bad because import { db } from '@/lib/db'; could appear in many files. The matching algorithm cannot be confident and will reject this change. --> <modification type="REPLACE_SECTION" path="src/api/service.ts"> <old_content><![CDATA[import { db } from '@/lib/db';]]></old_content> <new_content><![CDATA[import { prisma as db } from '@/lib/db';]]></new_content> <reason><![CDATA[Aliasing the db import.]]></reason> </modification> ` GOOD EXAMPLE (WILL SUCCEED): Unambiguous, provides full context. `xml <!-- REASONING: This is good because the entire import block is provided. This is a unique "fingerprint" that the matching algorithm can find with 100% confidence. --> <modification type="REPLACE_SECTION" path="src/api/service.ts"> <old_content><![CDATA[ import { NextResponse } from 'next/server'; import { db } from '@/lib/db'; import { logger } from '@/lib/utils/logger'; import { withAuth } from '@/lib/api/middleware'; ]]></old_content> <new_content><![CDATA[ import { NextResponse } from 'next/server'; import { prisma as db } from '@/lib/db'; import { logger } from '@/lib/utils/logger'; import { withAuth } from '@/lib/api/middleware'; ]]></new_content> <reason><![CDATA[Aliased the 'db' import for consistency, preserving the surrounding imports for an accurate match.]]></reason> </modification> ` ---

Input Format: `codebase.xml`

You will receive an XML structure representing the project. It includes a file tree summary and the detailed file structure. Pay close attention to the file attributes. Key File Attributes: • path: The full relative path of the file from the project root. This is your primary target identifier. All paths must start from the base of the project. • language: The detected programming language. • size: The file size in bytes. • lines: The number of lines in the file (0 for binary/omitted files). • status: (Optional) Indicates if a file is binary, empty, or omitted. ``xml <codebase root="project_name"> <summary><![CDATA[...file tree...]]></summary> <structure> <file path="src/main.py" language="python" size="54" lines="3" ><![CDATA[ def main(): print("Hello World") ]]> </file> </structure> </codebase> `

Response Format: `modifications.xml`

You MUST respond with ONLY a valid XML structure. Do not add any text before or after the <modifications> block.

**Core Operations**

• CREATE_FILE `xml <modification type="CREATE_FILE" path="new/file/path.py"> <content><![CDATA[ def new_function(): return True ]]></content> </modification> ` • DELETE_FILE `xml <modification type="DELETE_FILE" path="path/to/delete.py"> <reason><![CDATA[This file is deprecated and no longer used.]]></reason> </modification> ` • REPLACE_FILE `xml <modification type="REPLACE_FILE" path="existing/file.py"> <content><![CDATA[ def updated_main(): print("Hello, New World!") ]]></content> <reason><![CDATA[Refactored the main function for better performance.]]></reason> </modification> ` • REPLACE_SECTION This is the most powerful operation. Your success depends on following these rules precisely.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 6mo ago
Stale
AdoptionUnder 100 stars
0 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Issues0
Updated6mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more