协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
python-repo-quickstart【开发与工程】Quickly analyzes Python repositories to understand their purpose, structure, and setup requirements. Use when Claude needs to onboard to a new Python codebase, understand project structure, identify entry points, determine dependencies, or generate setup instructions. Trigger when users ask to "analyze this Python repo", "understand this codebase", "…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Rapidly analyze and understand Python repositories to get started quickly.
When a user provides a Python repository:
Automated analysis:
python scripts/analyze_repo.py <repo_path>
Manual analysis:
Check for framework indicators:
Django:
manage.py presentsettings.py in projectFlask:
app.py or application.pytemplates/ and static/ directoriesFastAPI:
main.py with app definitionuvicorn in dependenciesCLI Tool:
cli.py or __main__.pyargparse, click, or typer usageLibrary/Package:
src/ directory structuresetup.py or pyproject.tomlData Science:
.ipynb filesnotebooks/ directorySee: python-patterns.md for detailed patterns
Common entry points:
main.py - Standard entry pointapp.py / run.py - Web applicationmanage.py - Django managementcli.py - Command-line interface__main__.py - Package entry (python -m)Check for:
if __name__ == "__main__": blocksFind dependency files:
requirements.txt - Most commonrequirements-dev.txt - Development dependenciesPipfile - Pipenvpyproject.toml - Poetry or modern setupenvironment.yml - CondaExtract key dependencies:
Virtual environment:
# Standard venv
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
Installation:
# pip
pip install -r requirements.txt
# Development mode
pip install -e .
# Poetry
poetry install
# Pipenv
pipenv install
# Conda
conda env create -f environment.yml
Configuration:
.env.example or .env.templateRunning:
# Direct execution
python main.py
# Module execution
python -m package_name
# Web frameworks
flask run
uvicorn main:app --reload
python manage.py runserver
# CLI tools
python cli.py --help
package-name --help
From README:
From code structure:
From dependencies:
Generate a quick start guide with:
Project: [Name]
Type: [Web App / CLI Tool / Library / Data Science / etc.]
Purpose: [Brief description]
- Python [version]
- [Other system requirements]
# 1. Clone repository (if needed)
git clone [url]
# 2. Create virtual environment
python -m venv venv
source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment (if needed)
cp .env.example .env
# Edit .env with your settings
# 5. Run application
python main.py
- main.py: Main application entry
- cli.py: Command-line interface
- tests/: Test suite
- flask: Web framework
- sqlalchemy: Database ORM
- pytest: Testing framework
- Feature 1: Description
- Feature 2: Description
- Feature 3: Description
pytest
# or
python -m pytest tests/
- Configuration details
- Known issues
- Development tips
User: "Analyze this Python repository" → Scan structure, identify type, generate quick start guide
User: "How do I run this project?" → Find entry points, dependencies, provide setup and run instructions
User: "What does this codebase do?" → Analyze README, code structure, dependencies to summarize functionality
User: "Help me understand this Python repo structure" → Explain directory organization, identify key components
User: "What are the prerequisites for this project?" → Identify Python version, system requirements, dependencies
User: "Generate setup instructions for this repo" → Create step-by-step installation and configuration guide
Use the provided script for quick automated analysis:
python scripts/analyze_repo.py /path/to/repo
Output includes:
Limitations: