GitHub Prompts Sync — VSCode Extension
Keep your .github directories synchronized across all your workspaces and projects using profiles and templates.
Features
- Profile-based sync: Define
.github template profiles (e.g., default, oss, private) and assign them to workspaces
- Auto-sync on open: Automatically sync when a registered workspace is opened
- Watch mode: Template changes propagate to all registered workspaces in real time
- Per-workspace overrides: Ignore, preserve local-only, or merge specific files per workspace
- Three-way conflict resolution: Side-by-side diff with accept/keep/merge/skip options
- Template variables: Replace
{{VARIABLE}} placeholders during sync (e.g., {{GITHUB_ORG}})
- Status bar integration: See sync status at a glance with one-click actions
- Sidebar tree view: Browse profiles, workspaces, and file-level sync status
- First-time wizard: Guided setup to scaffold template store and import existing
.github
- Cross-platform: Works on Windows, macOS, and Linux
Screenshots

Tech Stack
| Technology |
Version |
Purpose |
| TypeScript |
^5.3 |
Extension language (strict mode) |
| VSCode Extension API |
^1.85 |
Editor integration |
| minimatch |
^9.0 |
Glob pattern matching for excludes |
| Mocha |
^10.2 |
Test framework |
| @vscode/test-electron |
^2.3 |
VSCode integration test runner |
| ESLint |
^8.56 |
Code linting |
| Prettier |
^3.2 |
Code formatting |
| @vscode/vsce |
^2.22 |
Extension packaging & publishing |
Prerequisites
- Node.js >= 18.x
- npm >= 8.x
- VSCode >= 1.85.0
Quick Start
# Clone the repository
git clone <repo-url>
cd github-prompts-sync-vscode
# Install dependencies
npm install
# Compile
npm run compile
# Run in VSCode Extension Development Host
# Press F5 in VSCode, or:
code --extensionDevelopmentPath=.
Available Scripts
| Command |
Description |
npm run compile |
Compile TypeScript to JavaScript |
npm run watch |
Compile in watch mode |
npm run lint |
Run ESLint on source files |
npm run lint:fix |
Run ESLint with auto-fix |
npm run format |
Format source files with Prettier |
npm run format:check |
Check formatting without writing |
npm run typecheck |
Run TypeScript type checking |
npm test |
Run tests in VSCode Extension Development Host |
npm run package |
Build .vsix package for distribution |
npm run publish |
Publish to VS Code Marketplace |
npm run check-all |
Run lint + format check + typecheck + compile |
Project Structure
github-prompts-sync-vscode/
├── src/
│ ├── extension.ts # Entry point: activation, command registration
│ ├── types.ts # All shared TypeScript type definitions
│ ├── commands/ # Command handlers (one per command)
│ │ ├── syncNow.ts # Sync current workspace
│ │ ├── syncAll.ts # Sync all registered workspaces
│ │ ├── assignProfile.ts # Assign profile to workspace
│ │ ├── createProfile.ts # Create new profile
│ │ ├── editProfile.ts # Open profile directory
│ │ ├── register.ts # Register workspace
│ │ ├── unregister.ts # Unregister workspace
│ │ ├── importFromWorkspace.ts # Import .github to profile
│ │ ├── manageOverrides.ts # Configure ignore/localOnly/merge
│ │ ├── showStatus.ts # Display sync status
│ │ └── openStore.ts # Open template store
│ ├── core/ # Business logic
│ │ ├── syncEngine.ts # Main sync algorithm
│ │ ├── profileManager.ts # Profile CRUD operations
│ │ ├── registry.ts # Workspace registry read/write
│ │ ├── diffEngine.ts # File comparison & three-way merge
│ │ ├── cacheManager.ts # Cached snapshots for diffs
│ │ ├── fileWatcher.ts # Template directory watcher
│ │ └── templateVariables.ts # {{VAR}} replacement engine
│ ├── views/ # UI components
│ │ ├── statusBar.ts # Status bar item
│ │ ├── treeView.ts # Sidebar tree data provider
│ │ └── treeItems.ts # Tree item definitions
│ ├── utils/ # Shared utilities
│ │ ├── fs.ts # File system helpers
│ │ ├── hash.ts # SHA-256 hashing
│ │ ├── config.ts # Settings reader
│ │ └── mutex.ts # Async mutex for sync locking
│ └── test/ # Test files
│ ├── runTest.ts # Test launcher
│ └── suite/ # Test suites
├── resources/icons/ # Extension icons
├── docs/ # Documentation
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── .vscodeignore # Files excluded from VSIX
Development Workflow
Adding a New Command
- Create a handler in
src/commands/myCommand.ts
- Add the command to
package.json under contributes.commands
- Register it in
src/extension.ts in the registerCommands function
- Add menu contributions in
package.json if needed
Adding a New Setting
- Add to
contributes.configuration.properties in package.json
- Add the setting to
ExtensionConfig interface in src/utils/config.ts
- Read it in
getConfig() in the same file
Running Tests
# Compile first
npm run compile
# Run all tests
npm test
Testing
Tests use Mocha with @vscode/test-electron to run inside a real VSCode instance.
- Unit tests:
src/test/suite/*.test.ts — test core logic with temp directories
- Integration tests: Same files, but can access
vscode API directly
Run tests: npm test
Installation
From VSIX (sideload)
npm run package
code --install-extension github-prompts-sync-vscode-0.1.0.vsix
From Source (development)
- Clone the repository
npm install
npm run compile
- Press F5 in VSCode to launch Extension Development Host
From Marketplace (if published)
ext install github-prompts-sync-vscode
Environment Variables
The extension stores configuration in ~/.github-sync/ by default. This path is configurable via settings.
| Setting |
Description |
Default |
Required |
github-sync.templateDir |
Template store path |
~/.github-sync |
No |
github-sync.defaultProfile |
Default profile name |
default |
No |
github-sync.autoSyncOnOpen |
Auto-sync on workspace open |
true |
No |
github-sync.watchTemplates |
Watch templates for changes |
true |
No |
github-sync.showNotifications |
Show sync notifications |
true |
No |
github-sync.confirmBeforeOverwrite |
Confirm before overwriting |
true |
No |
github-sync.gitRemote |
Git remote for template sync |
"" |
No |
github-sync.excludePatterns |
Global exclude patterns |
[] |
No |
github-sync.syncIntervalMinutes |
Periodic sync interval |
0 |
No |
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature
- Follow the code standards (ESLint + Prettier enforced)
- Write tests for new functionality
- Run
npm run check-all before committing
- Submit a pull request
Commit Messages
Use conventional commits: feat:, fix:, docs:, test:, refactor:, chore:
License
MIT