Repository Story Time - Comprehensive Repo Analysis & Narrative Generation Prompt (#121)
* feat: add comprehensive repository analysis prompt and methodology * README updated * refactor: update tools and enhance methodology for repository analysis * refactor: update command syntax for repository analysis to PowerShell format --------- Co-authored-by: Aaron Powell <me@aaron-powell.com>
This commit is contained in:
parent
9f5c134d77
commit
83a90b29d4
@ -72,7 +72,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
|
||||
| [SQL Development](instructions/sql-sp-generation.instructions.md) | Guidelines for generating SQL statements and stored procedures | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fsql-sp-generation.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fsql-sp-generation.instructions.md) |
|
||||
| [Taming Copilot](instructions/taming-copilot.instructions.md) | Prevent Copilot from wreaking havoc across your codebase, keeping it under control. | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Ftaming-copilot.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Ftaming-copilot.instructions.md) |
|
||||
| [TanStack Start with Shadcn/ui Development Guide](instructions/tanstack-start-shadcn-tailwind.instructions.md) | Guidelines for building TanStack Start applications | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Ftanstack-start-shadcn-tailwind.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Ftanstack-start-shadcn-tailwind.instructions.md) |
|
||||
| [Terraform Conventions](instructions/terraform.instructions.md) | Convention specific coding standards and best practices | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fterraform.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fterraform.instructions.md) |
|
||||
| [Terraform Conventions](instructions/terraform.instructions.md) | Terraform Conventions and Guidelines | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fterraform.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fterraform.instructions.md) |
|
||||
| [VueJS 3 Development Instructions](instructions/vuejs3.instructions.md) | VueJS 3 development standards and best practices with Composition API and TypeScript | [](https://vscode.dev/redirect?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fvuejs3.instructions.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fvuejs3.instructions.md) |
|
||||
|
||||
> 💡 **Usage**: Copy these instructions to your `.github/copilot-instructions.md` file or create task-specific `.github/.instructions.md` files in your workspace's `.github/instructions` folder.
|
||||
@ -130,6 +130,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
|
||||
| [PostgreSQL Development Assistant](prompts/postgresql-optimization.prompt.md) | PostgreSQL-specific development assistant focusing on unique PostgreSQL features, advanced data types, and PostgreSQL-exclusive capabilities. Covers JSONB operations, array types, custom types, range/geometric types, full-text search, window functions, and PostgreSQL extensions ecosystem. | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpostgresql-optimization.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fpostgresql-optimization.prompt.md) |
|
||||
| [Project Workflow Documentation Generator](prompts/project-workflow-analysis-blueprint-generator.prompt.md) | Comprehensive technology-agnostic prompt generator for documenting end-to-end application workflows. Automatically detects project architecture patterns, technology stacks, and data flow patterns to generate detailed implementation blueprints covering entry points, service layers, data access, error handling, and testing approaches across multiple technologies including .NET, Java/Spring, React, and microservices architectures. | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fproject-workflow-analysis-blueprint-generator.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fproject-workflow-analysis-blueprint-generator.prompt.md) |
|
||||
| [README Generator Prompt](prompts/readme-blueprint-generator.prompt.md) | Intelligent README.md generation prompt that analyzes project documentation structure and creates comprehensive repository documentation. Scans .github/copilot directory files and copilot-instructions.md to extract project information, technology stack, architecture, development workflow, coding standards, and testing approaches while generating well-structured markdown documentation with proper formatting, cross-references, and developer-focused content. | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Freadme-blueprint-generator.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Freadme-blueprint-generator.prompt.md) |
|
||||
| [Repository Analysis: [Repo Name]](prompts/repo-story-time.prompt.md) | Generate a comprehensive repository summary and narrative story from commit history | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Frepo-story-time.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Frepo-story-time.prompt.md) |
|
||||
| [Review And Refactor](prompts/review-and-refactor.prompt.md) | Review and refactor code in your project according to defined instructions | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Freview-and-refactor.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Freview-and-refactor.prompt.md) |
|
||||
| [SQL Code Review](prompts/sql-code-review.prompt.md) | Universal SQL code review assistant that performs comprehensive security, maintainability, and code quality analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Focuses on SQL injection prevention, access control, code standards, and anti-pattern detection. Complements SQL optimization prompt for complete development coverage. | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fsql-code-review.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fsql-code-review.prompt.md) |
|
||||
| [SQL Performance Optimization Assistant](prompts/sql-optimization.prompt.md) | Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimization, batch operations, and performance monitoring guidance. | [](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fsql-optimization.prompt.md) [](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fsql-optimization.prompt.md) |
|
||||
|
||||
156
prompts/repo-story-time.prompt.md
Normal file
156
prompts/repo-story-time.prompt.md
Normal file
@ -0,0 +1,156 @@
|
||||
---
|
||||
mode: 'agent'
|
||||
description: 'Generate a comprehensive repository summary and narrative story from commit history'
|
||||
tools: ['changes', 'codebase', 'editFiles', 'githubRepo', 'runCommands', 'runTasks', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection']
|
||||
---
|
||||
|
||||
|
||||
## Role
|
||||
|
||||
You're a senior technical analyst and storyteller with expertise in repository archaeology, code pattern analysis, and narrative synthesis. Your mission is to transform raw repository data into compelling technical narratives that reveal the human stories behind the code.
|
||||
|
||||
## Task
|
||||
|
||||
Transform any repository into a comprehensive analysis with two deliverables:
|
||||
|
||||
1. **REPOSITORY_SUMMARY.md** - Technical architecture and purpose overview
|
||||
2. **THE_STORY_OF_THIS_REPO.md** - Narrative story from commit history analysis
|
||||
|
||||
**CRITICAL**: You must CREATE and WRITE these files with complete markdown content. Do NOT output the markdown content in the chat - use the `editFiles` tool to create the actual files in the repository root directory.
|
||||
|
||||
## Methodology
|
||||
|
||||
### Phase 1: Repository Exploration
|
||||
|
||||
**EXECUTE these commands immediately** to understand the repository structure and purpose:
|
||||
|
||||
1. Get repository overview by running:
|
||||
`Get-ChildItem -Recurse -Include "*.md","*.json","*.yaml","*.yml" | Select-Object -First 20 | Select-Object Name, DirectoryName`
|
||||
|
||||
2. Understand project structure by running:
|
||||
`Get-ChildItem -Recurse -Directory | Where-Object {$_.Name -notmatch "(node_modules|\.git|bin|obj)"} | Select-Object -First 30 | Format-Table Name, FullName`
|
||||
|
||||
After executing these commands, use semantic search to understand key concepts and technologies. Look for:
|
||||
- Configuration files (package.json, pom.xml, requirements.txt, etc.)
|
||||
- README files and documentation
|
||||
- Main source directories
|
||||
- Test directories
|
||||
- Build/deployment configurations
|
||||
|
||||
### Phase 2: Technical Deep Dive
|
||||
Create comprehensive technical inventory:
|
||||
- **Purpose**: What problem does this repository solve?
|
||||
- **Architecture**: How is the code organized?
|
||||
- **Technologies**: What languages, frameworks, and tools are used?
|
||||
- **Key Components**: What are the main modules/services/features?
|
||||
- **Data Flow**: How does information move through the system?
|
||||
|
||||
### Phase 3: Commit History Analysis
|
||||
|
||||
**EXECUTE these git commands systematically** to understand repository evolution:
|
||||
|
||||
**Step 1: Basic Statistics** - Run these commands to get repository metrics:
|
||||
- `git rev-list --all --count` (total commit count)
|
||||
- `(git log --oneline --since="1 year ago").Count` (commits in last year)
|
||||
|
||||
**Step 2: Contributor Analysis** - Run this command:
|
||||
- `git shortlog -sn --since="1 year ago" | Select-Object -First 20`
|
||||
|
||||
**Step 3: Activity Patterns** - Run this command:
|
||||
- `git log --since="1 year ago" --format="%ai" | ForEach-Object { $_.Substring(0,7) } | Group-Object | Sort-Object Count -Descending | Select-Object -First 12`
|
||||
|
||||
**Step 4: Change Pattern Analysis** - Run these commands:
|
||||
- `git log --since="1 year ago" --oneline --grep="feat|fix|update|add|remove" | Select-Object -First 50`
|
||||
- `git log --since="1 year ago" --name-only --oneline | Where-Object { $_ -notmatch "^[a-f0-9]" } | Group-Object | Sort-Object Count -Descending | Select-Object -First 20`
|
||||
|
||||
**Step 5: Collaboration Patterns** - Run this command:
|
||||
- `git log --since="1 year ago" --merges --oneline | Select-Object -First 20`
|
||||
|
||||
**Step 6: Seasonal Analysis** - Run this command:
|
||||
- `git log --since="1 year ago" --format="%ai" | ForEach-Object { $_.Substring(5,2) } | Group-Object | Sort-Object Name`
|
||||
|
||||
**Important**: Execute each command and analyze the output before proceeding to the next step.
|
||||
**Important**: Use your best judgment to execute additional commands not listed above based on the output of previous commands or the repository's specific content.
|
||||
|
||||
### Phase 4: Pattern Recognition
|
||||
Look for these narrative elements:
|
||||
- **Characters**: Who are the main contributors? What are their specialties?
|
||||
- **Seasons**: Are there patterns by month/quarter? Holiday effects?
|
||||
- **Themes**: What types of changes dominate? (features, fixes, refactoring)
|
||||
- **Conflicts**: Are there areas of frequent change or contention?
|
||||
- **Evolution**: How has the repository grown and changed over time?
|
||||
|
||||
## Output Format
|
||||
|
||||
### REPOSITORY_SUMMARY.md Structure
|
||||
```markdown
|
||||
# Repository Analysis: [Repo Name]
|
||||
|
||||
## Overview
|
||||
Brief description of what this repository does and why it exists.
|
||||
|
||||
## Architecture
|
||||
High-level technical architecture and organization.
|
||||
|
||||
## Key Components
|
||||
- **Component 1**: Description and purpose
|
||||
- **Component 2**: Description and purpose
|
||||
[Continue for all major components]
|
||||
|
||||
## Technologies Used
|
||||
List of programming languages, frameworks, tools, and platforms.
|
||||
|
||||
## Data Flow
|
||||
How information moves through the system.
|
||||
|
||||
## Team and Ownership
|
||||
Who maintains different parts of the codebase.
|
||||
```
|
||||
|
||||
### THE_STORY_OF_THIS_REPO.md Structure
|
||||
```markdown
|
||||
# The Story of [Repo Name]
|
||||
|
||||
## The Chronicles: A Year in Numbers
|
||||
Statistical overview of the past year's activity.
|
||||
|
||||
## Cast of Characters
|
||||
Profiles of main contributors with their specialties and impact.
|
||||
|
||||
## Seasonal Patterns
|
||||
Monthly/quarterly analysis of development activity.
|
||||
|
||||
## The Great Themes
|
||||
Major categories of work and their significance.
|
||||
|
||||
## Plot Twists and Turning Points
|
||||
Notable events, major changes, or interesting patterns.
|
||||
|
||||
## The Current Chapter
|
||||
Where the repository stands today and future implications.
|
||||
```
|
||||
|
||||
## Key Instructions
|
||||
|
||||
1. **Be Specific**: Use actual file names, commit messages, and contributor names
|
||||
2. **Find Stories**: Look for interesting patterns, not just statistics
|
||||
3. **Context Matters**: Explain why patterns exist (holidays, releases, incidents)
|
||||
4. **Human Element**: Focus on the people and teams behind the code
|
||||
5. **Technical Depth**: Balance narrative with technical accuracy
|
||||
6. **Evidence-Based**: Support observations with actual git data
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- Both markdown files are **ACTUALLY CREATED** with complete, comprehensive content using the `editFiles` tool
|
||||
- **NO markdown content should be output to chat** - all content must be written directly to the files
|
||||
- Technical summary accurately represents repository architecture
|
||||
- Narrative story reveals human patterns and interesting insights
|
||||
- Git commands provide concrete evidence for all claims
|
||||
- Analysis reveals both technical and cultural aspects of development
|
||||
- Files are ready to use immediately without any copy/paste from chat dialog
|
||||
|
||||
## Critical Final Instructions
|
||||
|
||||
**DO NOT** output markdown content in the chat. **DO** use the `editFiles` tool to create both files with complete content. The deliverables are the actual files, not chat output.
|
||||
|
||||
Remember: Every repository tells a story. Your job is to uncover that story through systematic analysis and present it in a way that both technical and non-technical audiences can appreciate.
|
||||
Loading…
x
Reference in New Issue
Block a user