Skip to content
Merged
52 changes: 52 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI/CD Pipeline

on:
push:
branches:
- production-release
pull_request:
branches:
- production-release

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build the extension
run: npm run build

- name: Package the extension
run: npm run package

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Upload VSIX file
uses: actions/upload-artifact@v2
with:
name: vscode-extension
path: path/to/your/package.vsix

- name: Deploy to Marketplace
run: |
echo "Deploying to the marketplace..."
# Add your deployment script or command here
# For example, using vsce to publish the extension
npx vsce publish --pat ${{ secrets.VSCE_PAT }}
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: compile",
}
]
}
12 changes: 4 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@
- Open VS Code
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
- Type "Extensions: Install from VSIX"
- Select the `prompts-sync-extension-1.0.0.vsix` file
- Select the `prompt-vault-extension.vsix` file

### Option 2: Development Mode

1. **Open in VS Code:**

```bash
code /Users/mounir.abdous/Projects/prompts-logient-nventive/tools/vscode-extension
```

2. **Press F5 to launch Extension Development Host**

## Testing the Extension
Expand All @@ -38,6 +33,7 @@
2. **Configure Extension (Optional):**
- Go to Settings (`Ctrl+,`)
- Search for "Prompts Sync"
- Add a git repository to sync prompts from.
- Adjust settings as needed

### 2. Test Manual Sync
Expand Down Expand Up @@ -129,10 +125,10 @@ npm run watch
npx @vscode/vsce package

# Install locally
code --install-extension prompts-sync-extension-1.0.0.vsix
code --install-extension prompt-vault-extension-<version>.vsix

# Uninstall
code --uninstall-extension logient-nventive.prompts-sync-extension
code --uninstall-extension logient-nventive.prompt-vault-extension
```

## Extension Structure Verification
Expand Down
108 changes: 51 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Prompts Sync Extension

> Automatically sync GitHub Copilot prompts from the Logient-Nventive shared prompt bank to your local VS Code environment.
> Automatically sync GitHub Copilot prompts from multiple Git repositories to your local VS Code environment.

## 🎯 Overview

The Prompts Sync Extension automatically synchronizes the latest GitHub Copilot prompts, instructions, and templates from the [prompts-logient-nventive](https://github.com/MounirAbdousNventive/prompts-logient-nventive) repository to your local VS Code user prompts directory. This ensures you always have access to the most up-to-date, peer-reviewed prompts across all your projects.
The Prompts Sync Extension automatically synchronizes the latest GitHub Copilot prompts, instructions, and templates from one or more Git repositories to your local VS Code user prompts directory. This ensures you always have access to the most up-to-date, peer-reviewed prompts across all your projects from multiple sources.

## ✨ Features

- **🔄 Automatic Sync**: Configurable sync frequency (daily by default)
- **📦 Multiple Repositories**: Support for syncing from multiple Git repositories simultaneously
- **🌍 Cross-Platform**: Works on macOS, Windows, and Linux
- **⚙️ Configurable**: Customizable sync frequency and target directory
- **🔐 Secure**: Uses your existing GitHub authentication from VS Code
- **📦 Read-Only**: Safe pull-only synchronization (no risk of overwriting the repository)
- **📦 Read-Only**: Safe pull-only synchronization (no risk of overwriting repositories)
- **🎨 User-Friendly**: Simple setup with minimal configuration required
- **📊 Status Indicators**: Clear feedback on sync status and last update time
- **🛡️ Error Handling**: Graceful handling of repository conflicts and partial failures

## 🚀 Quick Start

### Prerequisites

- VS Code 1.70.0 or higher
- GitHub authentication configured in VS Code
- Access to the [prompts-logient-nventive](https://github.com/MounirAbdousNventive/prompts-logient-nventive) repository
- Access to a git repository with prompts and configuration files

### Installation

Expand All @@ -49,7 +51,7 @@ The Prompts Sync Extension automatically synchronizes the latest GitHub Copilot
| `promptsSync.enabled` | Enable/disable automatic syncing | `true` | boolean |
| `promptsSync.frequency` | Sync frequency | `"daily"` | string |
| `promptsSync.customPath` | Custom prompts directory path | `""` | string |
| `promptsSync.repository` | Repository URL | `"https://github.com/MounirAbdousNventive/prompts-logient-nventive"` | string |
| `promptsSync.repositories` | List of repository URLs | `["https://github.com/MounirAbdousNventive/prompts-logient-nventive"]` | array |
| `promptsSync.branch` | Repository branch to sync | `"master"` | string |
| `promptsSync.syncOnStartup` | Sync when VS Code starts | `true` | boolean |
| `promptsSync.showNotifications` | Show sync status notifications | `true` | boolean |
Expand All @@ -75,6 +77,36 @@ The extension automatically detects the correct prompts directory for your opera

You can override this by setting a custom path in `promptsSync.customPath`.

### Multiple Repository Configuration

The extension supports syncing from multiple Git repositories simultaneously. This is useful for organizations that maintain prompt collections across multiple repositories or for users who want to combine prompts from different sources.

#### Setting up Multiple Repositories

1. **Using VS Code Settings UI**:
- Open Settings (`Ctrl+,` or `Cmd+,`)
- Search for "promptsSync.repositories"
- Click "Add Item" to add each repository URL

2. **Using JSON Configuration**:
```json
{
"promptsSync.repositories": [
"https://github.com/your-org/prompts-main",
"https://github.com/your-org/prompts-experimental",
"https://github.com/another-org/shared-prompts"
]
}
```

#### Error Handling

When syncing multiple repositories:

- **Partial Success**: If some repositories sync successfully while others fail, the extension shows a partial success notification with details
- **Complete Failure**: If all repositories fail, an error notification is shown
- **Individual Errors**: Repository-specific errors are logged and reported separately

## 🎮 Usage

### Automatic Sync
Expand Down Expand Up @@ -181,7 +213,7 @@ cd prompts-logient-nventive/tools/vscode-extension
npm install

# Build the extension
npm run build
npm run compile

# Package the extension
npm run package
Expand All @@ -208,60 +240,12 @@ tools/vscode-extension/

### Scripts

- `npm run build` - Build the extension
- `npm run compile` - Build the extension
- `npm run watch` - Build in watch mode
- `npm run package` - Create VSIX package
- `npm run test` - Run tests
- `npm run lint` - Run ESLint

## 📊 Extension Manifest

Key details from `package.json`:

```json
{
"name": "prompts-sync-extension",
"displayName": "Prompts Sync Extension",
"description": "Sync GitHub Copilot prompts from Logient-Nventive shared repository",
"version": "1.0.0",
"publisher": "logient-nventive",
"engines": {
"vscode": "^1.70.0"
},
"categories": ["Other"],
"activationEvents": ["onStartupFinished"],
"contributes": {
"configuration": {
"title": "Prompts Sync",
"properties": {
"promptsSync.enabled": {
"type": "boolean",
"default": true,
"description": "Enable automatic prompts synchronization"
},
"promptsSync.frequency": {
"type": "string",
"enum": ["startup", "hourly", "daily", "weekly", "manual"],
"default": "daily",
"description": "Frequency of automatic sync"
}
}
},
"commands": [
{
"command": "promptsSync.syncNow",
"title": "Sync Now",
"category": "Prompts Sync"
},
{
"command": "promptsSync.showStatus",
"title": "Show Status",
"category": "Prompts Sync"
}
]
}
}
```

## 🤝 Contributing

Expand All @@ -285,6 +269,16 @@ We welcome contributions to improve the extension! Please see our [Contribution

## 📋 Changelog

### Version 1.2.0 (Multiple Repository Support)

- ✅ **New Feature**: Support for syncing from multiple Git repositories
- ✅ Added `promptsSync.repositories` array setting for multiple repository URLs
- ✅ Enhanced error handling for repository conflicts and failures
- ✅ Improved status display showing multi-repository sync results
- ✅ Graceful handling of partial sync success scenarios
- ✅ Backward compatibility with single repository configuration
- ✅ Updated documentation with multi-repository setup instructions

### Version 1.1.0 (Selective Sync & Flattened Structure)

- ✅ **New Feature**: Selective sync settings for different prompt types
Expand Down Expand Up @@ -313,9 +307,9 @@ Internal use only - Logient/Nventive Development Team

For support and questions:

- Create an issue in the [repository](https://github.com/MounirAbdousNventive/prompts-logient-nventive/issues)
- Contact the DevOps team
- Check the [troubleshooting section](#-troubleshooting) above
- Report an issue.


---

Expand Down
44 changes: 26 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "prompts-sync-extension",
"displayName": "Prompts Sync Extension",
"description": "Sync GitHub Copilot prompts from Logient-Nventive shared repository",
"version": "1.1.0",
"name": "prompt-vault-extension",
"displayName": "Prompt Vault extension",
"description": "Sync GitHub Copilot prompts, chatmodes and instructions from git repositories",
"version": "1.2.0",
"publisher": "logient-nventive",
"repository": {
"type": "git",
"url": "https://github.com/MounirAbdousNventive/prompts-logient-nventive.git",
"url": "https://github.com/nventive/PromptVault.git",
"directory": "tools/vscode-extension"
},
"engines": {
Expand All @@ -21,12 +21,12 @@
"main": "./out/extension.js",
"contributes": {
"configuration": {
"title": "Prompts Sync",
"title": "Prompt Vault",
"properties": {
"promptsSync.enabled": {
"type": "boolean",
"default": true,
"description": "Enable automatic prompts synchronization"
"description": "Enable automatic synchronization"
},
"promptsSync.frequency": {
"type": "string",
Expand All @@ -45,20 +45,25 @@
"default": "",
"description": "Custom prompts directory path (leave empty for default)"
},
"promptsSync.repository": {
"type": "string",
"default": "https://github.com/MounirAbdousNventive/prompts-logient-nventive",
"description": "Repository URL to sync from"
"promptsSync.repositories": {
"type": "array",
"items": {
"type": "string"
},
"default": ["https://github.com/github/awesome-copilot"],
"description": "List of repository URLs to sync from",
"order": 0
},
"promptsSync.branch": {
"type": "string",
"default": "master",
"description": "Repository branch to sync"
"default": "main",
"description": "Repository branch to sync",
"order": 10
},
"promptsSync.syncOnStartup": {
"type": "boolean",
"default": true,
"description": "Sync when VS Code starts"
"description": "Sync when Visual Studio Code starts"
},
"promptsSync.showNotifications": {
"type": "boolean",
Expand All @@ -73,17 +78,20 @@
"promptsSync.syncChatmode": {
"type": "boolean",
"default": true,
"description": "Sync chatmode prompts"
"description": "Sync chatmodes",
"order": 2
},
"promptsSync.syncInstructions": {
"type": "boolean",
"default": true,
"description": "Sync instructions prompts"
"default": false,
"description": "Sync instructions",
"order": 3
},
"promptsSync.syncPrompt": {
"type": "boolean",
"default": true,
"description": "Sync prompt files"
"description": "Sync prompts",
"order": 1
}
}
},
Expand Down
Loading