Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Warn me about backward-incompatible changes.
Architecture & key files
- Entry/activation: src/extension.ts – activates on startup, wires ConfigManager, StatusBarManager, SyncManager; registers commands:
promptitude.syncNow • promptitude.showStatus • promptitude.openPromptsFolder • promptitude.addAzureDevOpsPAT • promptitude.clearAzureDevOpsPAT • promptitude.clearAzureDevOpsCache
- Sync: src/syncManager.ts – schedules by promptitude.frequency; per-repo (url or url|branch, default main) select provider via GitProviderFactory, authenticate, fetch tree, filter, download files. Filters chatmode/, instructions/, prompts/ and .md/.txt; writes files flat to the prompts directory using the basename (last write wins).
- Configuration: src/configManager.ts – reads promptitude.*; repositoryConfigs parses url|branch; getPromptsDirectory returns OS-specific path; flags: enabled, syncOnStartup, showNotifications, debug, syncChatmode, syncInstructions, syncPrompt.
- Sync: src/syncManager.ts – schedules by promptitude.frequency; per-repo (url or url|branch, default main) select provider via GitProviderFactory, authenticate, fetch tree, filter, download files. Filters agents/ (and legacy chatmodes/), instructions/, prompts/ and .md/.txt; writes files to repository storage then creates symlinks (or copies on Windows without admin/dev mode) to active prompts directory using unique names when conflicts exist across repos.
- Configuration: src/configManager.ts – reads promptitude.*; repositoryConfigs parses url|branch; getPromptsDirectory returns OS-specific path; flags: enabled, syncOnStartup, showNotifications, debug, syncChatmode (supports agents/ and chatmodes/), syncInstructions, syncPrompt.
- Providers: src/utils/github.ts (VS Code GitHub auth with scope repo; REST branches→sha→git/trees; contents for files). src/utils/azureDevOps.ts (PATs in SecretStorage; per-organization PAT index cached in globalState; supports dev.azure.com and legacy visualstudio.com; owner encoded as organization|project|baseUrl).
- Utilities/UI: src/utils/fileSystem.ts (fs ops); src/utils/notifications.ts (messages + auth flows); src/utils/logger.ts (single "Promptitude" output channel; debug gated by setting); src/statusBarManager.ts (Idle/Syncing/Success/Error + last sync time; click triggers sync).
- Storage: Repository files stored in {globalStorageUri}/repos/{encoded_url}/; active prompts symlinked (or copied on Windows) to {globalStorageUri}/prompts/. Cross-platform path handling normalizes separators (/ vs \).

Developer workflows
- Build/package: npm install → npm run compile (or npm run watch) → npm run package (VSIX). Lint: npm run lint. Tests: npm run test.
Expand All @@ -24,7 +25,9 @@ Conventions & patterns (repo-specific)
- Always use FileSystemManager for IO and NotificationManager for UX/auth prompts; do not duplicate provider auth logic.
- Settings drive behavior; avoid hard-coded paths/branches; use ConfigManager.repositoryConfigs for url|branch parsing.
- Provider code lives in GitApiManager implementations; select via GitProviderFactory.createFromUrl().
- Duplicate filenames across repos overwrite by last processed repo (flat output). Allowed file types: .md, .txt.
- Duplicate filenames across repos resolved with unique workspace names using repository identifiers.
- Allowed file types: .md, .txt.
- Cross-platform: Normalize path separators (replace \\ with / for comparisons); on Windows, symlink creation falls back to file copy if admin/dev mode unavailable; both symlinks and file copies tracked as "active" prompts.

Examples
- settings.json:
Expand Down
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ All notable changes to the "promptitude" extension will be documented in this fi
### Changed

- Renamed "chatmodes" to "agents" throughout the UI to align with VS Code's current terminology
- Improved "Activate All" and "Deactivate All" operations to show progress notifications with individual prompt status.

### Fixed

- Improved prompt management UI with bug fixes and stability improvements
- Fixed duplicate filename handling across multiple repositories
- Enhanced cross-platform compatibility
- Code quality improvements
- Fixed UI bugs including Windows path handling, activate/deactivate button behavior, and cross-platform compatibility issues
- Fixed prompt details view not opening for inactive prompts on Windows by correctly resolving repository storage paths
- Fixed "Activate All" to properly create symlinks for all prompts instead of just updating state.
- Fixed "Deactivate All" to efficiently remove all symlinks directly instead of looping through individual toggles, eliminating unnecessary counting behavior.
- Fixed issue where prompts that were active before "Activate All" would be in a broken state after "Deactivate All".
- Fixed prompt details view not refreshing when "Deactivate All" is clicked while viewing an active prompt.
- Fixed duplicate repositories persisting in configuration by automatically removing them and updating settings when detected.
- Fixed 'All Sources' dropdown preventing users from deselecting the only repository source by implementing sentinel value pattern to distinguish between "all sources" and "no sources selected" states.
- Fixed Activity Bar icon not displaying by converting SVG to monochrome format with currentColor support for proper theme adaptation.

## [1.5.0] - 2025-11-12

Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ The Promptitude Extension automatically synchronizes the latest GitHub Copilot p

- **🔄 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
- **🌍 Cross-Platform**: Works on macOS, Windows, and Linux with intelligent symlink fallback
- **⚙️ Configurable**: Customizable sync frequency and target directory
- **🔐 Secure**: Uses your existing GitHub authentication from VS Code and secure PAT storage for Azure DevOps
- **🌐 Multi-Provider**: Supports both GitHub and Azure DevOps repositories
- **📦 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
- **💻 Windows Compatibility**: Automatic fallback to file copies when symlinks aren't available (no admin rights needed)

## 🚀 Quick Start

Expand Down Expand Up @@ -56,8 +57,8 @@ The Promptitude Extension automatically synchronizes the latest GitHub Copilot p
| `promptitude.repositories` | Repositories with optional branch (use `url` or `url|branch`) | `[]` | array |
| `promptitude.syncOnStartup` | Sync when VS Code starts | `true` | boolean |
| `promptitude.showNotifications` | Show sync status notifications | `true` | boolean |
| `promptitude.syncChatmode` | Sync chatmode prompts | `true` | boolean |
| `promptitude.syncInstructions` | Sync instructions prompts | `false` | boolean |
| `promptitude.syncChatmode` | Sync agent prompts (supports both agents/ and legacy chatmodes/ directories) | `true` | boolean |
| `promptitude.syncInstructions` | Sync instructions prompts | `true` | boolean |
| `promptitude.syncPrompt` | Sync prompt files | `true` | boolean |

### Sync Frequency Options
Expand All @@ -80,6 +81,23 @@ You can override this by setting a custom path in `promptitude.customPath`.

The extension will adapt this path automatically to function with non-default VS Code profiles.

### Platform-Specific Behavior

#### Windows Symlink Handling

On Windows, the extension intelligently handles file synchronization:

- **With Developer Mode or Admin Rights**: Creates symlinks for optimal performance (files stay in sync automatically)
- **Without Special Permissions**: Automatically falls back to copying files (no admin rights required)
- Both approaches work seamlessly - the extension detects and manages active prompts correctly

To enable symlinks on Windows 10/11 without admin rights:
1. Go to Settings → Update & Security → For developers
2. Enable "Developer Mode"
3. Restart VS Code

**Note**: File copy mode works perfectly fine for most users and requires no special setup.

### 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.
Expand Down Expand Up @@ -133,7 +151,8 @@ The extension adds a status bar item showing:
The extension syncs all prompt files from the repository subdirectories into a flattened structure:

```
chatmodes/*.md → User/prompts/
agents/*.md → User/prompts/
chatmodes/*.md → User/prompts/ (legacy support)
instructions/*.md → User/prompts/
prompts/*.md → User/prompts/
```
Expand Down
6 changes: 6 additions & 0 deletions media/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
text-transform: capitalize;
}

.type-badge.type-agents {
background: var(--vscode-charts-blue);
color: white;
}

/* Legacy support for chatmode class */
.type-badge.type-chatmode {
background: var(--vscode-charts-blue);
color: white;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "promptitude-extension",
"displayName": "Promptitude",
"description": "Sync GitHub Copilot prompts, chatmodes and instructions from git repositories",
"version": "1.5.1",
"version": "1.5.2",
"publisher": "logientnventive",
"repository": {
"type": "git",
Expand Down Expand Up @@ -73,7 +73,7 @@
"promptitude.syncChatmode": {
"type": "boolean",
"default": true,
"description": "Sync chatmodes",
"description": "Sync agent prompts (supports both agents/ and legacy chatmodes/ directories)",
"order": 2
},
"promptitude.syncInstructions": {
Expand Down Expand Up @@ -250,4 +250,4 @@
"@vscode/test-electron": "^2.3.0",
"@vscode/vsce": "^2.19.0"
}
}
}
33 changes: 9 additions & 24 deletions resources/promptitude-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading