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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,6 @@ app-registration.json
.DS_Store?
ehthumbs.db
Thumbs.db

# Cline memory bank
.clinerules/
1 change: 0 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dist/**
!dist/extension.js

# 2. Exclude documentation & misc (non-runtime)
CHANGELOG.md
SECURITY.md
SOFTWARE_ARCHITECTURE_SPECIFICATION.md
TESTPLAN.md
Expand Down
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,40 @@ All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning when feasible.

## [Unreleased]

## [0.4.0] - 2025-09-22
### Added
- New integration test suite (`test/real.integration.test.ts`) that uses the actual `FileService` to verify file system operations.
- The `test:integration` script in `package.json` now runs the new test suite.

### Changed
- Bumped version to 0.4.0.

### Changed
- Renamed "Hats" to "Presets" throughout the extension, including UI, commands, and documentation.

### Added
- Git Catalog: Branch enumeration (uses `git ls-remote --heads`) with quick pick UI when adding a remote repository.
- Git Catalog: Ability to lock a remote to a specific commit SHA (stores `lockedCommit` and prevents automatic branch updates).
- Git Catalog: Interactive refresh flow prompting per-remote when a newer branch head is detected (update / skip / lock).
- Git Catalog: Command `copilotCatalog.dev.listGitRemotes` to view status (tracking vs locked, current / pending commit).
- Git Catalog: Commit update detection without forcing fetch/reset when not desired.
- Git Catalog: Backward-compatible metadata upgrade (meta version 2 adds `lockedCommit`).
- Tests: Added integration tests for branch listing, locked commit behavior, and update detection logic.

### Changed
- Updated activity bar icon to a catalog book design that better represents the ContextShare functionality. The new icon features a book/catalog with organized content lines and a small AI indicator dot.

### Technical
- New service APIs: `listRemoteBranches`, `getRemoteHead`, `detectBranchUpdate`.
- Enhanced clone/update path with locked commit checkout logic and selective scanning.
- Persisted meta now includes `lockedCommit`; upgrade path from version 1 handled automatically.
- Added interactive UX in `scanGitRepository` and `refreshGitRepositories` commands.
- Added command palette entry to list remotes and their statuses.

### Notes
- Locked remotes skip automatic branch fetch/reset and only rescan if local commit not yet recorded.
- Interactive refresh avoids unintended updates, giving explicit control or allowing lock-in of the new commit.
## [0.1.35] - 2025-08-23
### Changed
- Duplicate handling logic: when a catalog (or remote) resource is ACTIVE or MODIFIED its corresponding runtime copy is no longer shown as a separate `user` item; instead the catalog entry with its state icon is kept. This prevents seeing both "user" and catalog rows for the same activated asset across multiple catalogs.
Expand Down Expand Up @@ -127,4 +158,3 @@ The format is based on Keep a Changelog and this project adheres to Semantic Ver
## [0.1.22] - 2025-08-18
### Fixed
- Dev commands now work in headless/tunnel sessions: picker dialogs are wrapped in try/catch with manual input fallbacks (path input or typed action selection) and logging.

24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/ContextShare.contextshare)](https://marketplace.visualstudio.com/items?itemName=ContextShare.contextshare)
[![Security Policy](https://img.shields.io/badge/Security-Policy-blue.svg)](./SECURITY.md)

Unified AI workflow catalog for VS Code: manage and share chat modes, instructions, prompts, tasks - plus upcoming MCP server orchestration - across all your repositories from one consistent UI. Reduce prompt drift, standardize team AI usage, and reuse curated presets ("Hats").
Unified AI workflow catalog for VS Code: manage and share chat modes, instructions, prompts, tasks - plus upcoming MCP server orchestration - across all your repositories from one consistent UI. Reduce prompt drift, standardize team AI usage, and reuse curated presets.

## ✨ Feature Highlights

Expand All @@ -19,7 +19,7 @@ Core value: a single, structured, multi-catalog layer for AI assistant resources
- Prompts (templated starting points)
- Tasks (JSON task configs)
- MCP Integration (coming soon)
- Hats (presets bundling multiple resources)
- Presets (presets bundling multiple resources)
- Real‑time sync & state tracking (INACTIVE / ACTIVE / MODIFIED)
- Safe activation (never overwrites user‑created originals)
- Secure: HTTPS-only remotes + path & filename sanitization
Expand All @@ -32,8 +32,8 @@ Core value: a single, structured, multi-catalog layer for AI assistant resources
| Instructions | Shared guideline sets | `.github/instructions/` | `*.instructions.md` (legacy *.instruction.md) | ✅ |
| Prompts | Prompt templates / starters | `.github/prompts/` | `*.prompt.md` | ✅ |
| Tasks | Automation / action configurations | `.github/tasks/` | `*.task.json` | ✅ |
| MCP Servers | Model Context Protocol sources | `.vscode/mcp.json` | Merged composite file | Coming soon |
| Hats | Declarative preset bundles | `.github/hats/` | `*.json` (see example below) | ✅ |
| MCP Servers | Model Context Protocol sources | `.vscode/mcp.json` | Merged composite file | Coming soon |
| Presets | Declarative preset bundles | `.github/presets/` | `*.json` (see example below) | ✅ |

State logic: ACTIVE resources are copied to runtime; MODIFIED indicates the runtime file diverged from its source (e.g., team-local customization).

Expand All @@ -46,11 +46,11 @@ Install from the VS Code Marketplace: [ContextShare](https://marketplace.visuals
1. Open the ContextShare Activity Bar view.
2. Add a catalog (Options → Add Catalog Directory… or add a remote HTTPS URL).
3. Activate a resource (right‑click → Activate).
4. (Optional) Apply a Hat preset to activate multiple at once.
4. (Optional) Apply a Preset to activate multiple at once.
5. Edit runtime copies under `.github/**` if you need local tweaks (they'll show as MODIFIED).

### Hats (Presets)
Hats are small JSON descriptors bundling chosen chat mode + instructions + prompts + tasks (+ soon MCP servers) into a one‑click activation set. Great for role or workflow switching (e.g., "Full Stack Review", "Security Audit").
### Presets
Presets are small JSON descriptors bundling chosen chat mode + instructions + prompts + tasks (+ soon MCP servers) into a one‑click activation set. Great for role or workflow switching (e.g., "Full Stack Review", "Security Audit").

### Example Catalog Structure

Expand All @@ -66,7 +66,7 @@ example-catalog/
│ └── automated-testing.task.json
├── mcp/
│ └── development-servers.mcp.json
└── hats/
└── presets/
└── full-stack-dev.json
```

Expand All @@ -78,7 +78,7 @@ example-catalog/
- [Changelog](./CHANGELOG.md) - Version history and release notes
- [Catalog Display Names](./CATALOG_DISPLAY_NAMES_EXAMPLE.md) - Naming conventions and examples

## Configuration Examples
## Configuration Examples

Add catalogs in `.vscode/settings.json`:

Expand All @@ -104,7 +104,7 @@ Remote `index.json` (HTTPS only):
}
```

Sample Hat (`.github/hats/full-stack-dev.json`):
Sample Preset (`.github/presets/full-stack-dev.json`):

```json
{
Expand Down Expand Up @@ -167,11 +167,10 @@ Report vulnerabilities privately via the Security Policy (responsible disclosure
| Remote catalog empty | `index.json` not reachable / HTTP error | Open URL in browser; ensure HTTPS and correct raw path |
| Resource shows MODIFIED unexpectedly | Local edit vs source catalog | Diff runtime file in `.github/**` with original source |
| Removed MCP server persists | (Upcoming MCP feature) cached merged entry | After MCP feature release: remove from source & reload window |
| Hat not applying all items | Missing referenced filenames | Check JSON fields and ensure each resource exists |
| Preset not applying all items | Missing referenced filenames | Check JSON fields and ensure each resource exists |

If stuck, enable verbose logging (future setting) or open an issue with a minimal reproduction.


## 🏷️ Versioning

We use [Semantic Versioning](https://semver.org/) for release management:
Expand All @@ -186,4 +185,3 @@ This project adheres to the [Contributor Covenant Code of Conduct](./CODE_OF_CON
## Trademarks

All product names, logos, and brands are property of their respective owners. Use of any third-party trademarks or logos does not imply endorsement.

22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "contextshare",
"displayName": "ContextShare",
"description": "Manage AI assistant catalog resources (chat modes, instructions, prompts, tasks, MCP) across multiple repositories inside VS Code.",
"version": "0.3.6",
"version": "0.4.0",
"publisher": "ContextShare",
"engines": {
"vscode": "^1.90.0"
Expand All @@ -22,8 +22,8 @@
"contributes": {
"submenus": [
{
"id": "copilotCatalog.hatsMenu",
"label": "Hats",
"id": "copilotCatalog.presetsMenu",
"label": "Presets",
"icon": "$(kebab-vertical)"
},
{
Expand Down Expand Up @@ -227,26 +227,26 @@
"title": "ContextShare: Edit Activated Copy"
},
{
"command": "copilotCatalog.hats.apply",
"title": "ContextShare: Apply Hat (Preset)",
"command": "copilotCatalog.presets.apply",
"title": "ContextShare: Apply Preset",
"icon": {
"light": "resources/icons/hat-light.svg",
"dark": "resources/icons/hat-dark.svg"
"light": "resources/icons/preset-light.svg",
"dark": "resources/icons/preset-dark.svg"
}
},
{
"command": "copilotCatalog.hats.createWorkspace",
"title": "ContextShare: Save Hat from Active (Workspace)",
"command": "copilotCatalog.presets.createWorkspace",
"title": "ContextShare: Save Preset from Active (Workspace)",
"icon": "$(save)"
},
{
"command": "copilotCatalog.hats.createUser",
"title": "ContextShare: Save Hat from Active (User)",
"command": "copilotCatalog.presets.createUser",
"title": "ContextShare: Save Preset from Active (User)",
"icon": "$(account)"
},
{
"command": "copilotCatalog.hats.delete",
"title": "ContextShare: Delete Hat (Workspace/User)",
"command": "copilotCatalog.presets.delete",
"title": "ContextShare: Delete Preset (Workspace/User)",
"icon": "$(trash)"
},
{
Expand Down Expand Up @@ -343,7 +343,7 @@
"group": "navigation"
},
{
"submenu": "copilotCatalog.hatsMenu",
"submenu": "copilotCatalog.presetsMenu",
"when": "view == copilotCatalogOverview || view == copilotCatalogChatmodes",
"group": "navigation@b"
},
Expand All @@ -353,24 +353,24 @@
"group": "navigation@c"
}
],
"copilotCatalog.hatsMenu": [
"copilotCatalog.presetsMenu": [
{
"command": "copilotCatalog.hats.apply",
"command": "copilotCatalog.presets.apply",
"when": "view == copilotCatalogOverview || view == copilotCatalogChatmodes",
"group": "1"
},
{
"command": "copilotCatalog.hats.createWorkspace",
"command": "copilotCatalog.presets.createWorkspace",
"when": "view == copilotCatalogOverview || view == copilotCatalogChatmodes",
"group": "2"
},
{
"command": "copilotCatalog.hats.createUser",
"command": "copilotCatalog.presets.createUser",
"when": "view == copilotCatalogOverview || view == copilotCatalogChatmodes",
"group": "2"
},
{
"command": "copilotCatalog.hats.delete",
"command": "copilotCatalog.presets.delete",
"when": "view == copilotCatalogOverview || view == copilotCatalogChatmodes",
"group": "3"
}
Expand Down Expand Up @@ -415,11 +415,12 @@
"bundle": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --platform=node --format=cjs --external:vscode --sourcemap",
"package": "echo 'vsce not installed in offline env'",
"verify:version": "node scripts/verify-version-sync.js",
"fix:version": "node scripts/verify-version-sync.js --fix",
"test": "npm run compile && node ./dist/test/runVscodeTests.js",
"compile": "tsc -p ./",
"test:unit": "node dist/test/runTest.js",
"test:all": "npm run test && npm run test:integration && npm run test:performance && npm run test:security && npm run test:ux",
"test:integration": "node dist/test/integration.test.js",
"test:integration": "node dist/test/integration.test.js && node dist/test/real.integration.test.js",
"test:performance": "node dist/test/performance.test.js",
"test:security": "node dist/test/security.integration.test.js",
"test:ux": "node dist/test/userExperience.test.js",
Expand All @@ -439,7 +440,7 @@
"@types/node": "^20.14.10",
"@types/vscode": "^1.90.0",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^3.0.0",
"@vscode/vsce": "^3.6.1",
"esbuild": "^0.25.9",
"glob": "^11.0.3",
"mocha": "^11.7.2",
Expand Down
File renamed without changes
File renamed without changes
19 changes: 14 additions & 5 deletions scripts/verify-version-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ if(!manifestVersion){
process.exit(2);
}

const shouldFix = process.argv.includes('--fix');

if(pkg.version !== manifestVersion){
console.error(`ERROR: Version mismatch. package.json=${pkg.version}, manifest=${manifestVersion}`);
console.error('Hint: run: npm version <patch|minor|major> then regenerate the VSIX with npx @vscode/vsce package');
process.exit(1);
if (shouldFix) {
console.log(`Version mismatch detected. package.json=${pkg.version}, manifest=${manifestVersion}. Updating manifest...`);
const updatedXml = xml.replace(/(<Identity[^>]*Version=")([^"]+)(")/i, `$1${pkg.version}$3`);
fs.writeFileSync(manifestPath, updatedXml, 'utf8');
console.log(`Successfully updated ${manifestPath} to version ${pkg.version}`);
} else {
console.error(`ERROR: Version mismatch. package.json is ${pkg.version}, but vsixmanifest is ${manifestVersion}.`);
console.error('Run with --fix to automatically update the manifest.');
process.exit(1);
}
} else {
console.log(`Version sync OK: ${pkg.version}`);
}

console.log(`Version sync OK: ${pkg.version}`);
Loading
Loading