Skip to content

Commit

Permalink
Merge pull request #18 from thibaultyou/fix/17-content-hash-generation
Browse files Browse the repository at this point in the history
Fix content_hash generation and update process
  • Loading branch information
thibaultyou authored Sep 30, 2024
2 parents 3ddf088 + 099d39f commit 7298157
Show file tree
Hide file tree
Showing 26 changed files with 151 additions and 242 deletions.
14 changes: 10 additions & 4 deletions .github/scripts/generate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ def generate_metadata(prompt_content):
def should_update_metadata(prompt_file, metadata_file):
"""Check if metadata should be updated based on content hash or force flag."""
force_regenerate = os.environ.get('FORCE_REGENERATE', 'false').lower() == 'true'

if force_regenerate:
logger.info("Forcing metadata regeneration due to system prompt changes.")
return True, None

# Generate hash of the prompt file content
with open(prompt_file, 'rb') as f:
prompt_content = f.read()
prompt_hash = hashlib.md5(prompt_content).hexdigest()

if force_regenerate:
logger.info("Forcing metadata regeneration due to system prompt changes.")
return True, prompt_hash

# If metadata file doesn't exist, update is needed
if not os.path.exists(metadata_file):
logger.info(f"Metadata file {metadata_file} does not exist. Update needed.")
Expand Down Expand Up @@ -214,6 +214,12 @@ def update_prompt_metadata():
with open(metadata_path, 'w') as f:
yaml.dump(metadata, f, sort_keys=False)

# Ensure we have a valid hash
if new_hash is None:
with open(prompt_file, 'rb') as f:
prompt_content = f.read()
new_hash = hashlib.md5(prompt_content).hexdigest()

# Update content hash
update_metadata_hash(metadata_path, new_hash)
else:
Expand Down
2 changes: 0 additions & 2 deletions .github/templates/readme_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ Welcome to the **Prompt Library**. This repository contains a collection of AI p
### {{ format_category(category) }}

{% for prompt in prompts %}

- [{{ prompt.title }}]({{ prompt.path }}) - {{ prompt.description }}
{% endfor %}

{% endfor %}

## 🚀 Getting Started
Expand Down
3 changes: 0 additions & 3 deletions .github/templates/view_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
### 🔧 Variables

{% for variable in metadata.variables %}

- `{{ variable }}`
{% endfor %}

Expand All @@ -24,7 +23,6 @@
### 🔖 Tags

{% for tag in metadata.tags %}

- {{ tag }}
{% endfor %}

Expand All @@ -35,7 +33,6 @@ Primary Category: {{ metadata.primary_category }}
{% if metadata.subcategories %}
Subcategories:
{% for subcategory in metadata.subcategories %}

- {{ subcategory }}
{% endfor %}
{% endif %}
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,51 @@ Welcome to the **Prompt Library**. This repository contains a collection of AI p
### Artificial Intelligence



- [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 diverse and innovative AI application ideas for specific domains




### Documentation



- [AI Code Repository Documentation Generator](prompts/ai_code_repository_documentation_generator/view.md) - Generates comprehensive documentation for code repositories using AI analysis

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



### Full Stack Development



- [Advanced Software Development Assistant](prompts/advanced_software_development_assistant/view.md) - Provides comprehensive software development assistance throughout the entire lifecycle

- [Advanced Software Development AI Assistant](prompts/advanced_software_development_ai_assistant/view.md) - Provides expert guidance and support throughout the entire software development lifecycle



### Project Management


- [Software Specification Generator](prompts/software_specification_generator/view.md) - Creates comprehensive software specifications based on user requirements

- [Software Specification Generator](prompts/software_specification_generator/view.md) - Generates comprehensive software specifications based on user requirements


- [GitHub Issue Creator Assistant](prompts/github_issue_creator_assistant/view.md) - Creates well-structured GitHub Issues from various inputs

- [GitHub Issue Creator Assistant](prompts/github_issue_creator_assistant/view.md) - Creates well-structured GitHub Issues from various types of input



### Refactoring



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

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



### Version Control



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


- [GitHub Pull Request Generator](prompts/github_pull_request_generator/view.md) - Generates comprehensive and well-structured GitHub pull requests




## 🚀 Getting Started

This repository is designed to be easily forked and customized for your own use. Follow these steps to get started:
Expand Down
22 changes: 22 additions & 0 deletions prompts/advanced_software_development_ai_assistant/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
title: Advanced Software Development AI Assistant
primary_category: full_stack_development
subcategories:
- software_engineering
- development_lifecycle
directory: advanced_software_development_ai_assistant
tags:
- software_development
- expert_guidance
- code_optimization
- best_practices
- lifecycle_support
one_line_description: Provides expert guidance and support throughout the entire software
development lifecycle
description: This AI assistant offers comprehensive support for software developers
across the entire development process. It provides expert guidance, code suggestions,
and workflow optimization for various programming languages, frameworks, and development
stages, covering frontend, backend, database, DevOps, and more.
variables:
- '{{USER_REQUEST}}'
- '{{CONTEXT}}'
content_hash: d60c3752432e5ddcb95793648cb4394a
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Advanced Software Development Assistant
# Advanced Software Development AI Assistant

### ✏️ One-line Description

**Provides comprehensive software development assistance throughout the entire lifecycle**
**Provides expert guidance and support throughout the entire software development lifecycle**

### 📄 Description

This AI assistant offers expert guidance and support for all stages of software development. It provides code suggestions, optimization tips, and best practices across multiple programming languages and frameworks, covering frontend, backend, database, and DevOps aspects.
This AI assistant offers comprehensive support for software developers across the entire development process. It provides expert guidance, code suggestions, and workflow optimization for various programming languages, frameworks, and development stages, covering frontend, backend, database, DevOps, and more.

### 🔧 Variables



- `{{USER_REQUEST}}`


- `{{CONTEXT}}`


Expand Down Expand Up @@ -102,20 +100,15 @@ Remember, your goal is to provide the most helpful and accurate assistance possi
### 🔖 Tags



- software_development

- expert_guidance

- code_generation

- code_optimization

- best_practices


- debugging


- documentation
- lifecycle_support


### 📚 Category
Expand All @@ -125,9 +118,7 @@ Primary Category: full_stack_development

Subcategories:

- software_engineering

- software_lifecycle_support


- development_optimization
- development_lifecycle

22 changes: 0 additions & 22 deletions prompts/advanced_software_development_assistant/metadata.yml

This file was deleted.

16 changes: 8 additions & 8 deletions prompts/ai_code_repository_documentation_generator/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: AI Code Repository Documentation Generator
title: AI-Powered Code Repository Documentation Generator
primary_category: documentation
subcategories:
- code_analysis
Expand All @@ -10,13 +10,13 @@ tags:
- repository_management
- technical_writing
- ai_assistant
one_line_description: Generates comprehensive documentation for code repositories
using AI analysis
description: This AI assistant analyzes code repositories to autonomously generate
and maintain various types of documentation. It interprets codebases, creates README
files, API documentation, usage guides, and architectural overviews while providing
insights on best practices and suggesting improvements.
one_line_description: Analyzes code repositories and generates comprehensive documentation
autonomously
description: This AI assistant specializes in analyzing code repositories to create
and maintain various types of documentation. It interprets codebases, generates
README files, API documentation, usage guides, and architectural overviews. The
assistant also provides insights on best practices and suggests improvements.
variables:
- '{{REPOSITORY_DATA}}'
- '{{DOCUMENTATION_REQUEST}}'
content_hash: None
content_hash: fcf5f67b516647ab2380cdfc8ff3fbf1
15 changes: 3 additions & 12 deletions prompts/ai_code_repository_documentation_generator/view.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# AI Code Repository Documentation Generator
# AI-Powered Code Repository Documentation Generator

### ✏️ One-line Description

**Generates comprehensive documentation for code repositories using AI analysis**
**Analyzes code repositories and generates comprehensive documentation autonomously**

### 📄 Description

This AI assistant analyzes code repositories to autonomously generate and maintain various types of documentation. It interprets codebases, creates README files, API documentation, usage guides, and architectural overviews while providing insights on best practices and suggesting improvements.
This AI assistant specializes in analyzing code repositories to create and maintain various types of documentation. It interprets codebases, generates README files, API documentation, usage guides, and architectural overviews. The assistant also provides insights on best practices and suggests improvements.

### 🔧 Variables



- `{{REPOSITORY_DATA}}`


- `{{DOCUMENTATION_REQUEST}}`


Expand Down Expand Up @@ -98,19 +96,14 @@ Remember to tailor your output to the specific documentation_request while ensur
### 🔖 Tags



- documentation


- code_analysis


- repository_management


- technical_writing


- ai_assistant


Expand All @@ -121,9 +114,7 @@ Primary Category: documentation

Subcategories:


- code_analysis


- technical_writing

8 changes: 4 additions & 4 deletions prompts/ai_topic_idea_generator/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ directory: ai_topic_idea_generator
tags:
- brainstorming
- innovation
- idea_generation
- ai_applications
- domain_specific
- ai_applications
- creative_thinking
one_line_description: Generates diverse and innovative AI application ideas for specific
domains
description: This prompt creates an AI assistant specialized in generating creative
and relevant AI application ideas across various domains. It analyzes core elements
of a given area, identifies unique opportunities, and produces a range of innovative
ideas that push the boundaries of AI capabilities while considering specific constraints.
ideas that push the boundaries of AI possibilities while considering specific constraints.
variables:
- '{{DOMAIN}}'
- '{{CONSTRAINTS}}'
content_hash: None
content_hash: 45dbd58307ef062d6983d0cc911cb536
15 changes: 3 additions & 12 deletions prompts/ai_topic_idea_generator/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

### 📄 Description

This prompt creates an AI assistant specialized in generating creative and relevant AI application ideas across various domains. It analyzes core elements of a given area, identifies unique opportunities, and produces a range of innovative ideas that push the boundaries of AI capabilities while considering specific constraints.
This prompt creates an AI assistant specialized in generating creative and relevant AI application ideas across various domains. It analyzes core elements of a given area, identifies unique opportunities, and produces a range of innovative ideas that push the boundaries of AI possibilities while considering specific constraints.

### 🔧 Variables



- `{{DOMAIN}}`


- `{{CONSTRAINTS}}`


Expand Down Expand Up @@ -82,20 +80,15 @@ Remember to always stay within the bounds of the given domain and constraints wh
### 🔖 Tags



- brainstorming


- innovation


- idea_generation

- domain_specific

- ai_applications


- domain_specific
- creative_thinking


### 📚 Category
Expand All @@ -105,9 +98,7 @@ Primary Category: artificial_intelligence

Subcategories:


- idea_generation


- prompt_engineering

Loading

0 comments on commit 7298157

Please sign in to comment.