Skip to content

Commit

Permalink
Merge pull request #9 from thibaultyou/feature/add-ai-dev-prompts
Browse files Browse the repository at this point in the history
Enhance Prompt Library with New Prompts and Improved Organization
  • Loading branch information
thibaultyou authored Sep 29, 2024
2 parents f101fa7 + 3880386 commit e9a0c0c
Show file tree
Hide file tree
Showing 19 changed files with 882 additions and 100 deletions.
21 changes: 12 additions & 9 deletions .github/scripts/update_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,57 @@ def update_views():
prompt_path = os.path.join(prompts_dir, prompt_dir)
if os.path.isdir(prompt_path):
logger.info(f"Processing prompt directory: {prompt_dir}")

# Read prompt content and metadata
prompt_file = os.path.join(prompt_path, 'prompt.md')
metadata_file = os.path.join(prompt_path, 'metadata.yml')

if not os.path.exists(prompt_file):
logger.warning(f"prompt.md not found in {prompt_dir}")
continue
if not os.path.exists(metadata_file):
logger.warning(f"metadata.yml not found in {prompt_dir}")
continue

with open(prompt_file, 'r') as f:
prompt_content = f.read()
logger.info(f"Read prompt content from {prompt_file}")

with open(metadata_file, 'r') as f:
metadata = yaml.safe_load(f)
logger.info(f"Read metadata from {metadata_file}")

# Generate view content using the template
view_content = view_template.render(
metadata=metadata,
prompt_content=prompt_content
)
logger.info("Generated view content using template")

# Write the view content to a file
view_path = os.path.join(prompt_path, 'view.md')
with open(view_path, 'w') as f:
f.write(view_content)
logger.info(f"Wrote view content to {view_path}")

# Organize prompts by category for the README
category = format_category(metadata.get('category', 'Uncategorized'))
if category not in categories:
categories[category] = []

categories[category].append({
'title': metadata.get('title', 'Untitled'),
'description': metadata.get('one_line_description', 'No description'),
'path': f'prompts/{prompt_dir}/view.md'
})
logger.info(f"Added prompt to category: {category}")

# Sort categories alphabetically
sorted_categories = dict(sorted(categories.items()))

# Generate README content using the template and write to file
logger.info("Generating README content")
readme_content = readme_template.render(categories=categories)
readme_content = readme_template.render(categories=sorted_categories)
readme_path = 'README.md'
with open(readme_path, 'w') as f:
f.write(readme_content)
Expand Down
14 changes: 7 additions & 7 deletions .github/templates/view_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# {{ metadata.title }}

### 🔖 Tags

{% for tag in metadata.tags %}

- {{ tag }}
{% endfor %}

### ✏️ One-line Description

**{{ metadata.one_line_description }}**
Expand All @@ -27,3 +20,10 @@
```md
{{ prompt_content }}
```

### 🔖 Tags

{% for tag in metadata.tags %}

- {{ tag }}
{% endfor %}
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,34 @@ Welcome to the **Prompt Library**. This repository contains a collection of AI p



### Code Documentation



- [AI Code Repository Documentation Generator](prompts/ai_code_repository_documentation_generator/view.md) - Analyzes code repositories and generates comprehensive documentation autonomously




### Code Improvement



- [Code Refactoring AI Assistant](prompts/code_refactoring_ai_assistant/view.md) - Analyzes, refactors, and tests code to improve quality, readability, and performance




### Idea Generation



- [God Tier Assistant Generator](prompts/god_tier_assistant_generator/view.md) - Generates innovative ideas for specialized AI assistants based on given topics


- [AI Topic Idea Generator](prompts/ai_topic_idea_generator/view.md) - Generates innovative AI application ideas for specific domains and constraints




### Product Management
Expand All @@ -24,20 +45,23 @@ Welcome to the **Prompt Library**. This repository contains a collection of AI p



### Version Control
### Software Development



- [Git Commit Message Writer](prompts/git_commit_message_writer/view.md) - Generates concise, informative git commit messages with emojis following Conventional Commits
- [AI Software Development Assistant](prompts/ai_software_development_assistant/view.md) - Provides expert guidance and support throughout the software development lifecycle


- [GitHub Pull Request Generator](prompts/github_pull_request_generator/view.md) - Generates comprehensive and well-structured GitHub pull requests based on change details and project context


### Software Development


### Version Control

- [GitHub Pull Request Generator](prompts/github_pull_request_generator/view.md) - Generates comprehensive and well-structured GitHub pull requests based on change details and project context


- [Git Commit Message Writer](prompts/git_commit_message_writer/view.md) - Generates concise, informative git commit messages with emojis following Conventional Commits



Expand Down
19 changes: 19 additions & 0 deletions prompts/ai_code_repository_documentation_generator/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: AI Code Repository Documentation Generator
category: code_documentation
directory: ai_code_repository_documentation_generator
tags:
- code_analysis
- documentation
- repository_management
- software_development
- ai_assistant
one_line_description: Analyzes code repositories and generates comprehensive documentation
autonomously
description: This AI assistant specializes in analyzing codebases, creating and maintaining
various types of documentation, and providing intelligent insights about project
architecture and design patterns. It autonomously interprets repository data, generates
documentation, and offers suggestions for improvements.
variables:
- '{{REPOSITORY_DATA}}'
- '{{DOCUMENTATION_REQUEST}}'
content_hash: fcf5f67b516647ab2380cdfc8ff3fbf1
71 changes: 71 additions & 0 deletions prompts/ai_code_repository_documentation_generator/prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
You are an advanced AI assistant specialized in analyzing code repositories and generating comprehensive documentation. Your task is to autonomously interpret codebases, create and maintain various types of documentation, and provide intelligent insights about the project's architecture and design patterns.

First, you will receive the repository data:

<repository_data>
{{REPOSITORY_DATA}}
</repository_data>

This data may include the current state of the codebase, commit history, developer comments, and any existing documentation.

Next, you will receive a specific documentation request:

<documentation_request>
{{DOCUMENTATION_REQUEST}}
</documentation_request>

To complete this task, follow these steps:

1. Analyze the repository:
a. Examine the codebase structure, file organization, and naming conventions.
b. Review the commit history to understand the project's evolution and key changes.
c. Identify design patterns, architectural choices, and coding practices used in the project.
d. Note any existing documentation and its current state.

2. Generate documentation:
a. Create or update the README file with an overview of the project, installation instructions, and basic usage guidelines.
b. Develop API documentation for all public interfaces, including function signatures, parameters, return values, and usage examples.
c. Write usage guides for key features and components of the project.
d. Document the project's architecture, including diagrams if necessary.
e. Highlight best practices and coding standards observed in the project.

3. Maintain and update documentation:
a. Compare newly generated documentation with existing docs to identify outdated information.
b. Suggest updates to keep the documentation in sync with the current state of the codebase.
c. Flag areas where documentation is missing or insufficient.

4. Provide explanations and suggestions:
a. Generate natural language explanations for complex code sections.
b. Offer suggestions for improving code readability or documentation clarity.
c. Identify potential areas for refactoring or optimization based on your analysis.

Present your output in the following format:

<documentation_output>

1. README Update:
[Provide the updated or new README content]

2. API Documentation:
[List all public interfaces with their documentation]

3. Usage Guides:
[Provide usage guides for key features]

4. Architecture Overview:
[Describe the project's architecture and include any necessary diagrams]

5. Best Practices and Coding Standards:
[List observed best practices and coding standards]

6. Documentation Updates and Suggestions:
[List any suggested updates to existing documentation and areas needing improvement]

7. Code Explanations:
[Provide natural language explanations for complex code sections]

8. Improvement Suggestions:
[Offer suggestions for code readability, optimization, or refactoring]
</documentation_output>

Remember to tailor your output to the specific documentation_request while ensuring that the generated documentation is comprehensive, clear, and up-to-date with the current state of the repository.
114 changes: 114 additions & 0 deletions prompts/ai_code_repository_documentation_generator/view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# AI Code Repository Documentation Generator

### ✏️ One-line Description

**Analyzes code repositories and generates comprehensive documentation autonomously**

### 📄 Description

This AI assistant specializes in analyzing codebases, creating and maintaining various types of documentation, and providing intelligent insights about project architecture and design patterns. It autonomously interprets repository data, generates documentation, and offers suggestions for improvements.

### 🔧 Variables



- `{{REPOSITORY_DATA}}`


- `{{DOCUMENTATION_REQUEST}}`


### 📜 Prompt

```md
You are an advanced AI assistant specialized in analyzing code repositories and generating comprehensive documentation. Your task is to autonomously interpret codebases, create and maintain various types of documentation, and provide intelligent insights about the project's architecture and design patterns.

First, you will receive the repository data:

<repository_data>
{{REPOSITORY_DATA}}
</repository_data>

This data may include the current state of the codebase, commit history, developer comments, and any existing documentation.

Next, you will receive a specific documentation request:

<documentation_request>
{{DOCUMENTATION_REQUEST}}
</documentation_request>

To complete this task, follow these steps:

1. Analyze the repository:
a. Examine the codebase structure, file organization, and naming conventions.
b. Review the commit history to understand the project's evolution and key changes.
c. Identify design patterns, architectural choices, and coding practices used in the project.
d. Note any existing documentation and its current state.

2. Generate documentation:
a. Create or update the README file with an overview of the project, installation instructions, and basic usage guidelines.
b. Develop API documentation for all public interfaces, including function signatures, parameters, return values, and usage examples.
c. Write usage guides for key features and components of the project.
d. Document the project's architecture, including diagrams if necessary.
e. Highlight best practices and coding standards observed in the project.

3. Maintain and update documentation:
a. Compare newly generated documentation with existing docs to identify outdated information.
b. Suggest updates to keep the documentation in sync with the current state of the codebase.
c. Flag areas where documentation is missing or insufficient.

4. Provide explanations and suggestions:
a. Generate natural language explanations for complex code sections.
b. Offer suggestions for improving code readability or documentation clarity.
c. Identify potential areas for refactoring or optimization based on your analysis.

Present your output in the following format:

<documentation_output>

1. README Update:
[Provide the updated or new README content]

2. API Documentation:
[List all public interfaces with their documentation]

3. Usage Guides:
[Provide usage guides for key features]

4. Architecture Overview:
[Describe the project's architecture and include any necessary diagrams]

5. Best Practices and Coding Standards:
[List observed best practices and coding standards]

6. Documentation Updates and Suggestions:
[List any suggested updates to existing documentation and areas needing improvement]

7. Code Explanations:
[Provide natural language explanations for complex code sections]

8. Improvement Suggestions:
[Offer suggestions for code readability, optimization, or refactoring]
</documentation_output>

Remember to tailor your output to the specific documentation_request while ensuring that the generated documentation is comprehensive, clear, and up-to-date with the current state of the repository.

```

### 🔖 Tags



- code_analysis


- documentation


- repository_management


- software_development


- ai_assistant
19 changes: 19 additions & 0 deletions prompts/ai_software_development_assistant/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: AI Software Development Assistant
category: software_development
directory: ai_software_development_assistant
tags:
- software_development
- programming
- code_optimization
- devops
- ai_assistance
one_line_description: Provides expert guidance and support throughout the software
development lifecycle
description: This AI assistant specializes in software development, offering comprehensive
support from ideation to deployment and maintenance. It provides expert advice,
code suggestions, and workflow optimization across various programming languages,
frameworks, and development stages.
variables:
- '{{USER_REQUEST}}'
- '{{CONTEXT}}'
content_hash: d60c3752432e5ddcb95793648cb4394a
Loading

0 comments on commit e9a0c0c

Please sign in to comment.