Skip to content

Commit

Permalink
📝 docs: Update metadata and refresh README templates
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultyou committed Oct 8, 2024
1 parent 3f65256 commit 3a2dc30
Show file tree
Hide file tree
Showing 51 changed files with 639 additions and 396 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/update_views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
- "prompts/**/*.md"
- "prompts/prompt.md"
- "src/**/*.ts"
- "system_prompts/**/*.md"
- "templates/*.md"
- "src/system_prompts/**/*.md"
- "src/templates/*.md"

jobs:
update_views:
update_views:v
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,7 +20,7 @@ jobs:

- name: Validate critical files
run: |
if [ ! -f "system_prompts/ai_prompt_analyzer_and_output_generator/prompt.md" ]; then
if [ ! -f "src/system_prompts/prompt_analysis_agent/prompt.md" ]; then
echo "Error: AI prompt analyzer file is missing"
exit 1
fi
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Check for system prompt changes
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q ".github/prompts/ai_prompt_analyzer_and_output_generator/"; then
if git diff --name-only HEAD^ HEAD | grep -q "src/system_prompts/prompt_analysis_agent/"; then
echo "FORCE_REGENERATE=true" >> $GITHUB_ENV
else
echo "FORCE_REGENERATE=false" >> $GITHUB_ENV
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Ignore environment config
.env

# Ignore specific directories
dist/
node_modules/
dist/
archive/

# Ignore local temporary files
z_diff_output.txt
z_dir2prompt_output.txt
23 changes: 23 additions & 0 deletions .promptignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ignore all README.md files in subdirectories
**/README.md

# Include the main README.md in the root directory
!/README.md

# Include the .github directory (e.g., for workflows)
!.github/

# Ignore environment config and lock file
.env
package-lock.json

# Ignore specific directories
dist/
node_modules/
archive/
fragments/
prompts/

# Ignore local temporary files
z_diff_output.txt
z_dir2prompt_output.txt
78 changes: 57 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
# 📚 Prompt Library

> ### 🚧 **Project Under Active Development** 🚧
>
> **Note:** This project is new and undergoing rapid development. You may encounter bugs or frequent changes. We appreciate your patience and encourage you to:
> - Report any issues you encounter
> - Check for updates regularly
> - Contribute ideas or improvements
>
> Your feedback is valuable in shaping this project. Thank you for your interest and support!
Welcome to the **Prompt Library**. This repository contains a collection of AI prompts categorized for easy navigation and reuse.

## 🗂️ Categories

### Artificial Intelligence And Machine Learning

- [AI Concept Generator for Specialized Assistants](prompts/ai_concept_generator_specialized_assistants/view.md) - Generates innovative and feasible AI assistant concepts for specific topics
- [AI Concept Creator](prompts/ai_concept_agent/README.md) - Generates innovative and feasible AI assistant concepts for specific topics

### Code Quality And Best Practices

- [Divine Code Refactoring Expert](prompts/divine_code_refactoring_expert/view.md) - Analyzes, refactors, and validates code to enhance quality, readability, and performance
- [Software Development Pull Request Generator](prompts/software_development_pull_request_generator/view.md) - Generates comprehensive pull requests for software development projects
- [Divine Code Refactoring Agent](prompts/code_refactoring_agent/README.md) - Analyzes, refactors, and validates code to improve quality, readability, and performance

### Documentation

- [Software Specification Creator](prompts/software_specification_creator/view.md) - Creates detailed software specification documents through interactive requirement gathering
- [Software Specification Creator](prompts/software_spec_agent/README.md) - Generates detailed software specification documents through interactive requirement analysis

### Project Management

- [GitHub Issue Creation Expert](prompts/github_issue_creation_expert/view.md) - Creates optimized GitHub issues considering code context, project history, and team dynamics
- [GitHub Issue Creation Expert](prompts/github_issue_agent/README.md) - Creates comprehensive, optimized GitHub issues based on context and team dynamics

### Prompt Engineering

- [Prompt Engineering God](prompts/prompt_engineering_god/view.md) - Crafts divine-tier prompts for optimal AI performance across various domains
- [Prompt Engineering God](prompts/prompt_engineering_agent/README.md) - Creates and refines optimized prompts for AI models across various domains

### Software Testing

- [Elite AI Coding Assistant](prompts/coding_assistant_agent/README.md) - Assists in software development tasks across multiple programming languages and paradigms

### Version Control

- [Git Branch Name Generator](prompts/git_branch_name_generator/view.md) - Generates optimal git branch names based on project context and requirements
- [Git Commit Message Generator](prompts/git_commit_message_generator/view.md) - Generates optimized git commit messages following Conventional Commits specification
- [Git Commit Message Generator](prompts/git_commit_message_agent/README.md) - Generates optimized git commit messages following Conventional Commits specification
- [Software Development Pull Request Generator](prompts/software_dev_pr_agent/README.md) - Generates comprehensive pull requests for software projects based on provided context
- [Git Branch Name Generator](prompts/git_branch_name_agent/README.md) - Generates optimal git branch names based on project context and development workflow

## 🚀 Getting Started

Expand All @@ -47,36 +60,59 @@ This repository is designed to be easily forked and customized for your own use.
- Navigate to "Secrets and variables" > "Actions".
- Create a new repository secret named `ANTHROPIC_API_KEY` and paste your Anthropic API key as the value.

4. **Add Your Own Prompts**:
4. **Install Dependencies**:
- Ensure you have Node.js installed (version 22 or later recommended).
- Run `npm install` to install the project dependencies.

5. **Add Your Own Prompts**:
- Create a new file in the `prompts` directory named `prompt.md`.
- Write your prompt content in this file.
- Commit and push your changes to GitHub.

5. **Let GitHub Actions Work**:
6. **Let GitHub Actions Work**:
- The GitHub Actions workflow will automatically generate metadata for your new prompt.
- It will create a new directory for your prompt, move the `prompt.md` file into it, and create `metadata.yml` and `view.md` files.
- The README will be automatically updated to include your new prompt.
- It will create a new directory for your prompt, move the `prompt.md` file into it, and create `metadata.yml` and `README.md` files.
- The main README will be automatically updated to include your new prompt.

7. **Run Locally**:
- Use `npm run generate-metadata` to generate metadata for your prompts.
- Use `npm run update-views` to update the README files.

6. **Customize as Needed**:
- You can modify the templates in the `.github/templates` directory to change how prompts are displayed.
- Update the scripts in `.github/scripts` to alter the metadata generation or view update process.
8. **Customize as Needed**:
- Modify the templates in the `src/templates` directory to change how prompts are displayed.
- Update the scripts in `src/core` to alter the metadata generation or view update process.

## 🛠️ How It Works

- When you add or update a `prompt.md` file in the `prompts` directory, GitHub Actions are triggered.
- The `generate_metadata.py` script uses the Anthropic API to analyze your prompt and generate metadata.
- The `update_views.py` script creates or updates the `view.md` files for each prompt and updates the main README.
- The `generate_metadata.ts` script uses the Anthropic API to analyze your prompt and generate metadata.
- The `update_views.ts` script creates or updates the `README.md` files for each prompt and updates the main README.
- All changes are automatically committed back to the repository.

## 🔧 Customizing Metadata Extraction

The system prompt used to extract metadata from your prompts can be customized. This prompt is located at:

```
.github/prompts/ai_prompt_analyzer_and_output_generator/prompt.md
```
[`src/system_prompts/prompt_analysis_agent/prompt.md`](src/system_prompts/prompt_analysis_agent/prompt.md)

To customize the metadata extraction process:

1. Open the `prompt.md` file in your preferred text editor.
2. Review the existing prompt structure, which includes sections like `<system_role>`, `<task>`, `<input_parameters>`, `<instructions>`, and `<output>`.
3. Modify the content within these sections to adjust the behavior of the metadata extraction process. For example:
- Update the `<instructions>` section to change how categories are assigned.
- Modify the `<output>` section to alter the structure of the generated metadata.
4. Save your changes to the file.

After modifying the prompt:

- Run `npm run generate-metadata` locally to test your changes.
- Review the generated metadata files to ensure the output meets your expectations.
- If satisfied, commit and push your changes to trigger the GitHub Actions workflow.

This customization allows you to tailor the metadata generation process to your specific needs or to extract additional information from your prompts. Remember that changes to this file will affect all future metadata generations, so test thoroughly before committing.

You can modify this file to change how metadata is extracted from your prompts. This allows you to tailor the metadata generation process to your specific needs or to extract additional information from your prompts.
> **Note**: The `generate_metadata.ts` script in `src/core/` uses this prompt file when interacting with the Anthropic API. If you make significant changes to the prompt structure, you may need to update the script as well.
## 📝 Contributing

Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
testMatch: ['**/tests/**/*.test.ts'],
moduleNameMapper: {
'^@config(.*)$': '<rootDir>/src/config$1',
'^@types/(.*)$': '<rootDir>/src/types/$1',
'^@core/(.*)$': '<rootDir>/src/core/$1',
'^@types(.*)$': '<rootDir>/src/types$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1'
}
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"prompt-library",
"ai-prompts",
"metadata-generation",
"view-generation",
"anthropic-api",
"yaml-processing",
"automation",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# AI Concept Generator for Specialized Assistants
# AI Concept Creator

### ✏️ One-line Description

**Generates innovative and feasible AI assistant concepts for specific topics**

### 📄 Description

This prompt tasks an AI to create exceptional yet practical concepts for specialized AI assistants. It encourages creativity while ensuring feasibility, focusing on core competencies and transformative abilities within a given topic.
This prompt engineers a creative AI system that conceptualizes novel, yet practical AI assistants for given topics. It focuses on generating groundbreaking ideas while ensuring feasibility, ethical considerations, and maximum potential impact.

### 🔧 Variables

Expand Down Expand Up @@ -55,8 +55,8 @@ Now, based on the topic {{TOPIC}}, generate a groundbreaking yet feasible AI ass

### 🔖 Tags

- ai_concepts
- creativity
- ai_ideation
- creative_thinking
- innovation
- specialized_assistants
- prompt_engineering
Expand All @@ -67,4 +67,4 @@ Primary Category: artificial_intelligence_and_machine_learning
Subcategories:

- concept_generation
- specialized_ai_assistants
- specialized_assistants
21 changes: 21 additions & 0 deletions prompts/ai_concept_agent/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
content_hash: 46fdf466b661c338e49f3d34c07c2bc1
description: >-
This prompt engineers a creative AI system that conceptualizes novel, yet
practical AI assistants for given topics. It focuses on generating
groundbreaking ideas while ensuring feasibility, ethical considerations, and
maximum potential impact.
directory: ai_concept_agent
one_line_description: Generates innovative and feasible AI assistant concepts for specific topics
primary_category: artificial_intelligence_and_machine_learning
subcategories:
- concept_generation
- specialized_assistants
tags:
- ai_ideation
- creative_thinking
- innovation
- specialized_assistants
- prompt_engineering
title: AI Concept Creator
variables:
- '{{TOPIC}}'
File renamed without changes.
21 changes: 0 additions & 21 deletions prompts/ai_concept_generator_specialized_assistants/metadata.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Divine Code Refactoring Expert
# Divine Code Refactoring Agent

### ✏️ One-line Description

**Analyzes, refactors, and validates code to enhance quality, readability, and performance**
**Analyzes, refactors, and validates code to improve quality, readability, and performance**

### 📄 Description

This prompt creates an AI expert that analyzes codebases, infers the programming language, and performs comprehensive refactoring. It optimizes code quality, readability, and performance while preserving core functionality, followed by testing and validation.
This prompt creates an AI agent that analyzes code, infers the programming language, and performs comprehensive refactoring. It optimizes code quality, readability, and performance while preserving core functionality, and includes testing and validation steps.

### 🔧 Variables

Expand Down Expand Up @@ -126,8 +126,8 @@ Now, proceed with the refactoring task, ensuring you provide detailed explanatio

### 🔖 Tags

- code_analysis
- refactoring
- code_analysis
- optimization
- language_inference
- testing
Expand All @@ -137,5 +137,5 @@ Now, proceed with the refactoring task, ensuring you provide detailed explanatio
Primary Category: code_quality_and_best_practices
Subcategories:

- refactoring
- performance_optimization
- code_refactoring
- programming_languages
24 changes: 24 additions & 0 deletions prompts/code_refactoring_agent/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
content_hash: 0a5d4183b3ff1952e48d7998acb1ac02
description: >-
This prompt creates an AI agent that analyzes code, infers the programming
language, and performs comprehensive refactoring. It optimizes code quality,
readability, and performance while preserving core functionality, and includes
testing and validation steps.
directory: code_refactoring_agent
one_line_description: >-
Analyzes, refactors, and validates code to improve quality, readability, and
performance
primary_category: code_quality_and_best_practices
subcategories:
- code_refactoring
- programming_languages
tags:
- refactoring
- code_analysis
- optimization
- language_inference
- testing
title: Divine Code Refactoring Agent
variables:
- '{{REFACTOR_SCOPE}}'
- '{{CODEBASE}}'
File renamed without changes.
Loading

0 comments on commit 3a2dc30

Please sign in to comment.