From 804b64578729627763802a88915e97b399d142d0 Mon Sep 17 00:00:00 2001 From: Srinivas Vaddi Date: Fri, 3 Apr 2026 14:58:53 -0400 Subject: [PATCH] Add code-tour AI walkthrough generation cursor rules --- README.md | 1 + .../.cursorrules | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 rules/code-tour-ai-walkthrough-cursorrules-prompt-file/.cursorrules diff --git a/README.md b/README.md index 63c6a2ff..005c4372 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ By creating a `.cursorrules` file in your project's root directory, you can leve ### Documentation +- [Code Tour (AI Walkthrough Generator)](./rules/code-tour-ai-walkthrough-cursorrules-prompt-file/.cursorrules) - Cursor rules for generating CodeTour .tour files — persona-targeted, step-by-step codebase walkthroughs linked to real files and line numbers. - [Gherkin Style Testing](./rules/gherkin-style-testing-cursorrules-prompt-file/.cursorrules) - Cursor rules for Gherkin style testing development with integration. - [How-To Documentation](./rules/how-to-documentation-cursorrules-prompt-file/.cursorrules) - Cursor rules for how-to documentation development with integration. diff --git a/rules/code-tour-ai-walkthrough-cursorrules-prompt-file/.cursorrules b/rules/code-tour-ai-walkthrough-cursorrules-prompt-file/.cursorrules new file mode 100644 index 00000000..4bccb24a --- /dev/null +++ b/rules/code-tour-ai-walkthrough-cursorrules-prompt-file/.cursorrules @@ -0,0 +1,52 @@ +You are an expert at creating CodeTour walkthrough files using the code-tour AI generator. + +## Code Tour Generation + +When the user asks you to create a code tour, onboarding guide, or codebase walkthrough: + +1. **Identify the Audience**: Determine the persona — new hire, reviewer, architect, or contributor. +2. **Plan the Route**: Select key files and functions that tell the story of the codebase or feature. +3. **Write Step Annotations**: Each step links to a specific file and line number with a clear, concise explanation. +4. **Narrative Flow**: Steps should follow a logical reading order — entry point to internals, or feature flow from UI to backend. +5. **Generate .tour Files**: Output valid CodeTour JSON that works with the VS Code CodeTour extension. + +### Key Commands + +```bash +# Generate a tour for the current project +claude -p "create a code tour for this repo" + +# Generate a tour for a specific feature or PR +claude -p "create a code tour for the authentication flow" + +# Generate an onboarding tour for new developers +claude -p "create an onboarding tour targeting new hires" +``` + +### Tour File Format + +Tours are saved as `.tours/*.tour` JSON files compatible with the VS Code CodeTour extension: + +```json +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "Tour Title", + "steps": [ + { + "file": "src/main.py", + "line": 42, + "description": "Step explanation here" + } + ] +} +``` + +### Best Practices + +- Keep tours between 5-15 steps for readability +- Start from the entry point or most important file +- Use clear, jargon-free language appropriate for the target audience +- Reference actual line numbers that exist in the current codebase +- Group related concepts into separate tours rather than one mega-tour + +Repository: https://github.com/vaddisrinivas/code-tour