Skip to content
Closed
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
80 changes: 40 additions & 40 deletions SETUP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This guide will walk you through everything you need to know to set up and use t
2. [Understanding the Interface](#understanding-the-interface)
3. [Configuration Options](#configuration-options)
4. [Setting Up Your First Catalog](#setting-up-your-first-catalog)
5. [Working with Hats (Presets)](#working-with-hats-presets)
5. [Working with Presets](#working-with-presets)
6. [Team Collaboration Workflow](#team-collaboration-workflow)
7. [Advanced Configuration](#advanced-configuration)
8. [Troubleshooting](#troubleshooting)
Expand Down Expand Up @@ -54,7 +54,7 @@ The main interface showing your catalog structure:
- **✓ Active**: Resource is copied to runtime directory and ready to use
- **⚠ Modified**: Active resource has been changed and differs from catalog version
- **📁 Available**: Resource exists in catalog but isn't activated
- **🔍 Missing**: Referenced in Hat but not found in catalog
- **🔍 Missing**: Referenced in Preset but not found in catalog

#### Context Menu (Right-click)
- **Activate**: Copy resource to runtime directory
Expand All @@ -65,11 +65,11 @@ The main interface showing your catalog structure:

### Title Bar Commands

#### Hats Menu 🎩
- **Apply Hat (Preset)**: Activate a saved preset
- **Save Hat from Active (Workspace)**: Save current active resources as a workspace preset
- **Save Hat from Active (User)**: Save current active resources as a user preset
- **Delete Hat**: Remove a saved preset
#### Presets Menu 🎩
- **Apply Preset**: Activate a saved preset
- **Save Preset from Active (Workspace)**: Save current active resources as a workspace preset
- **Save Preset from Active (User)**: Save current active resources as a user preset
- **Delete Preset**: Remove a saved preset

#### Dev Menu 🔧
- **Create Template Catalog**: Generate sample catalog structure
Expand Down Expand Up @@ -110,7 +110,7 @@ Access settings via: **File** → **Preferences** → **Settings** → Search "C
├── prompts/ # Reusable prompt templates
├── tasks/ # VS Code task definitions
├── mcp/ # Model Context Protocol configs
└── hats/ # Preset collections
└── presets/ # Preset collections
```

### Method 2: Manual Catalog Creation
Expand All @@ -119,7 +119,7 @@ Access settings via: **File** → **Preferences** → **Settings** → Search "C
```
mkdir copilot_catalog
cd copilot_catalog
mkdir chatmodes instructions prompts tasks mcp hats
mkdir chatmodes instructions prompts tasks mcp presets
```

2. **Add your first resource** (example instruction):
Expand Down Expand Up @@ -161,23 +161,23 @@ Example configuration:
}
```

## Working with Hats (Presets)
## Working with Presets

Hats let you save and apply collections of resources with one click.
Presets let you save and apply collections of resources with one click.

### Creating Your First Hat
### Creating Your First Preset

1. **Activate some resources** (right-click → Activate)
2. **Save as Hat**: Click **Hats** → **Save Hat from Active (Workspace)**
2. **Save as Preset**: Click **Presets** → **Save Preset from Active (Workspace)**
3. **Name it**: e.g., "Code Review Setup"
4. **Add description** (optional): "Resources for thorough code reviews"

### Hat File Structure
### Preset File Structure

Workspace hats are saved to `.vscode/copilot-hats.json`:
Workspace presets are saved to `.vscode/copilot-presets.json`:
```json
{
"hats": [
"presets": [
{
"name": "Code Review Setup",
"description": "Resources for thorough code reviews",
Expand All @@ -191,27 +191,27 @@ Workspace hats are saved to `.vscode/copilot-hats.json`:
}
```

### Applying Hats
### Applying Presets

1. **Click Hats → Apply Hat (Preset)**
2. **Choose your hat** from the list
1. **Click Presets → Apply Preset**
2. **Choose your preset** from the list
3. **Select mode**:
- **Additive**: Add hat resources to currently active ones
- **Exclusive**: Deactivate everything else, activate only hat resources
- **Additive**: Add preset resources to currently active ones
- **Exclusive**: Deactivate everything else, activate only preset resources

### Hat Types
### Preset Types

#### Workspace Hats (.vscode/copilot-hats.json)
#### Workspace Presets (.vscode/copilot-presets.json)
- Shared with your team via Git
- Perfect for role-based setups ("Frontend Dev", "Backend Dev", "QA")
- Project-specific configurations

#### User Hats (Global)
#### User Presets (Global)
- Personal to your machine
- Cross-project personal preferences
- Not shared with team

#### Catalog Hats (copilot_catalog/hats/*.json)
#### Catalog Presets (copilot_catalog/presets/*.json)
- Stored in the catalog itself
- Can be shared across multiple repositories
- Version-controlled with the catalog
Expand All @@ -228,17 +228,17 @@ Workspace hats are saved to `.vscode/copilot-hats.json`:
git add copilot_catalog/
git commit -m "Add team catalog"

# Create team hats in VS Code and commit
git add .vscode/copilot-hats.json
# Create team presets in VS Code and commit
git add .vscode/copilot-presets.json
git commit -m "Add team presets"
git push
```

2. **Team Members**:
```bash
git pull # Get latest catalog and hats
git pull # Get latest catalog and presets
# Open VS Code, go to ContextShare view
# Click Hats → Apply Hat → Choose team preset
# Click Presets → Apply Preset → Choose team preset
```

### Best Practices for Teams
Expand All @@ -253,16 +253,16 @@ copilot_catalog/
├── chatmodes/
│ ├── roles/ # Role-based chat modes
│ └── tasks/ # Task-specific modes
└── hats/
└── presets/
├── frontend-dev.json # Frontend developer preset
├── backend-dev.json # Backend developer preset
└── code-review.json # Code reviewer preset
```

#### 2. Hat Strategy
- **Role-based hats**: "Frontend Dev", "Backend Dev", "DevOps", "QA"
- **Task-based hats**: "Code Review", "Bug Fixing", "Feature Development"
- **Project-phase hats**: "Initial Development", "Maintenance", "Refactoring"
#### 2. Preset Strategy
- **Role-based presets**: "Frontend Dev", "Backend Dev", "DevOps", "QA"
- **Task-based presets**: "Code Review", "Bug Fixing", "Feature Development"
- **Project-phase presets**: "Initial Development", "Maintenance", "Refactoring"

#### 3. Naming Conventions
- Use consistent prefixes: `TEAM.`, `PROJECT.`, `ROLE.`
Expand Down Expand Up @@ -379,15 +379,15 @@ Tip: Do not hand-edit the manifest; scripts keep it correct based on package.jso
3. **Check file conflicts**: Look for existing files that might block activation
4. **View diagnostics**: Use Dev → Diagnostics for detailed error info

#### Hat Application Fails
#### Preset Application Fails

**Problem**: Applying a hat doesn't activate expected resources
**Problem**: Applying a preset doesn't activate expected resources

**Solutions**:
1. **Check resource paths**: Ensure hat references valid catalog paths
1. **Check resource paths**: Ensure preset references valid catalog paths
2. **Refresh catalog**: Resource might have been moved or renamed
3. **Check exclusive mode**: In exclusive mode, other resources are deactivated
4. **Verify catalog source**: Hat might reference resources from different catalog
4. **Verify catalog source**: Preset might reference resources from different catalog

#### Performance Issues

Expand Down Expand Up @@ -436,8 +436,8 @@ Tip: Do not hand-edit the manifest; scripts keep it correct based on package.jso
## Next Steps

🎯 **Try it out**: Create a simple catalog and experiment with activating resources
🎩 **Make your first Hat**: Save a useful combination as a preset
👥 **Share with team**: Commit your catalog and hats to Git
🎩 **Make your first Preset**: Save a useful combination as a preset
👥 **Share with team**: Commit your catalog and presets to Git
⚡ **Iterate**: Refine your setup based on what works for your workflow

**Happy cataloging!** 🚀
58 changes: 29 additions & 29 deletions SOFTWARE_ARCHITECTURE_SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The extension operates within the VS Code ecosystem as a client-side tool that:
- Discovers AI resources from multiple local and remote catalogs
- Manages resource activation/deactivation states with advanced merging capabilities
- Provides specialized tree-based UI views for different resource categories
- Supports preset configurations ("Hats") for resource groups
- Supports preset configurations for resource groups
- Handles user-created resources with enable/disable functionality
- Ensures secure handling of remote content with comprehensive validation
- Integrates with VS Code's native task and MCP systems
Expand Down Expand Up @@ -194,7 +194,7 @@ graph TB

#### 4.2.1 Service Layer Pattern
- **Purpose**: Encapsulate business logic in reusable services
- **Implementation**: ResourceService, HatService, FileService
- **Implementation**: ResourceService, PresetService, FileService
- **Benefits**: Testability, separation of concerns, reusability

#### 4.2.2 Repository Pattern
Expand Down Expand Up @@ -237,7 +237,7 @@ graph LR

subgraph "Services"
RS[ResourceService]
HS[HatService]
PS[PresetService]
FS[FileService]
end

Expand Down Expand Up @@ -287,7 +287,7 @@ async function loadResources()

**Dependencies:**
- ResourceService
- HatService
- PresetService
- FileService
- OverviewTreeProvider
- CategoryTreeProvider (multiple instances)
Expand Down Expand Up @@ -329,26 +329,26 @@ clearRemoteCache()
- Resource state computation with specialized MCP/task handling
- User resource enable/disable state tracking

#### 5.2.3 Hat Service (`services/hatService.ts`)
#### 5.2.3 Preset Service (`services/presetService.ts`)

**Responsibilities:**
- Hat (preset) discovery from multiple sources
- Hat application (bulk resource activation/deactivation)
- Hat creation from current active resources
- Hat persistence to workspace and user storage
- Preset discovery from multiple sources
- Preset application (bulk resource activation/deactivation)
- Preset creation from current active resources
- Preset persistence to workspace and user storage

**Key Functions:**
```typescript
async discoverHats(repo: Repository): Promise<Hat[]>
async applyHat(repo: Repository, resources: Resource[], hat: Hat): Promise<ApplyResult>
async createHatFromActive(name: string, resources: Resource[], source: HatSource): Promise<Hat>
async deleteHat(hat: Hat, repo?: Repository): Promise<boolean>
async discoverPresets(repo: Repository): Promise<Preset[]>
async applyPreset(repo: Repository, resources: Resource[], preset: Preset): Promise<ApplyResult>
async createPresetFromActive(name: string, resources: Resource[], source: PresetSource): Promise<Preset>
async deletePreset(preset: Preset, repo?: Repository): Promise<boolean>
```

**Storage Locations:**
- Catalog: `{catalog}/hats/*.json`
- Workspace: `.vscode/copilot-hats.json`
- User: Global storage `hats.json`
- Catalog: `{catalog}/presets/*.json`
- Workspace: `.vscode/copilot-presets.json`
- User: Global storage `presets.json`

#### 5.2.4 File Service (`services/fileService.ts`)

Expand Down Expand Up @@ -645,7 +645,7 @@ private remoteCache: Map<string, {
- `copilotCatalog.activate` - Activate selected resource
- `copilotCatalog.deactivate` - Deactivate selected resource
- `copilotCatalog.showDiff` - Show differences between catalog and runtime
- `copilotCatalog.hats.apply` - Apply hat preset
- `copilotCatalog.hats.apply` - Apply preset
- `copilotCatalog.openResource` - Open resource for viewing/editing

**Configuration Schema:**
Expand Down Expand Up @@ -983,7 +983,7 @@ sequenceDiagram
VSCode->>Ext: activate()
Ext->>Services: Initialize FileService
Ext->>Services: Initialize ResourceService
Ext->>Services: Initialize HatService
Ext->>Services: Initialize PresetService
Ext->>UI: Initialize CatalogTreeProvider
Ext->>VSCode: Register commands
Ext->>VSCode: Register tree data provider
Expand Down Expand Up @@ -1103,7 +1103,7 @@ graph TD

subgraph "Test Files"
RS[resourceService.test.ts]
HS[hats.test.ts]
PS[presets.test.ts]
SEC[security.test.ts]
DIS[display.test.ts]
NAM[naming.test.ts]
Expand Down Expand Up @@ -1139,7 +1139,7 @@ graph TD
#### 11.1.2 Test Categories

**Unit Tests:**
- Service logic validation (ResourceService, HatService)
- Service logic validation (ResourceService, PresetService)
- Utility function testing (display, security, naming)
- Model validation and state management
- Error handling verification
Expand Down Expand Up @@ -1225,7 +1225,7 @@ export class MockFileService implements IFileService {
```json
{
"scripts": {
"test": "node dist/test/resourceService.test.js && node dist/test/treeIcons.test.js && node dist/test/naming.test.js && node dist/test/mcpMerge.test.js && node dist/test/hats.test.js && node dist/test/commandsRegistered.test.js && node dist/test/display.test.js && node dist/test/catalogDisplayName.test.js && node dist/test/repositoryDiscovery.test.js && node dist/test/targetPath.test.js && node dist/test/workspaceConfiguration.test.js && node dist/test/resourceActivation.test.js",
"test": "node dist/test/resourceService.test.js && node dist/test/treeIcons.test.js && node dist/test/naming.test.js && node dist/test/mcpMerge.test.js && node dist/test/presets.test.js && node dist/test/commandsRegistered.test.js && node dist/test/display.test.js && node dist/test/catalogDisplayName.test.js && node dist/test/repositoryDiscovery.test.js && node dist/test/targetPath.test.js && node dist/test/workspaceConfiguration.test.js && node dist/test/resourceActivation.test.js",
"test:all": "npm run test",
"test:edge-cases": "node dist/test/repositoryDiscovery.test.js && node dist/test/targetPath.test.js && node dist/test/workspaceConfiguration.test.js && node dist/test/resourceActivation.test.js",
"test:watch": "npm run build && npm run test"
Expand Down Expand Up @@ -1549,7 +1549,7 @@ export function validateResourcePath(path: string): boolean {
| Term | Definition |
|------|------------|
| **Catalog** | Directory containing AI resource templates |
| **Hat** | Named preset of resources for bulk activation |
| **Preset** | Named collection of resources for bulk activation |
| **Resource** | Individual AI asset (chatmode, instruction, prompt, task, MCP) |
| **Runtime** | Directory where active resources are copied for use |
| **Activation** | Process of copying catalog resource to runtime directory |
Expand All @@ -1574,7 +1574,7 @@ workspace/
│ │ └── build.task.json
│ ├── mcp/
│ │ └── servers.mcp.json
│ └── hats/
│ └── presets/
│ └── preset.json
├── .github/ # Runtime directory
│ ├── chatmodes/
Expand All @@ -1584,7 +1584,7 @@ workspace/
│ └── mcp/
└── .vscode/
├── settings.json
└── copilot-hats.json # Workspace hats
└── copilot-presets.json # Workspace presets
```

#### 15.2.2 Naming Conventions
Expand All @@ -1597,10 +1597,10 @@ workspace/
- `user.{original}` (first variant)
- `user.{N}.{original}` (subsequent variants)

**Hat Files:**
- Catalog: `{catalog}/hats/{name}.json`
- Workspace: `.vscode/copilot-hats.json`
- User: `{globalStorage}/hats.json`
**Preset Files:**
- Catalog: `{catalog}/presets/{name}.json`
- Workspace: `.vscode/copilot-presets.json`
- User: `{globalStorage}/presets.json`

### 15.3 Configuration Examples

Expand Down Expand Up @@ -1740,7 +1740,7 @@ Enable `copilotCatalog.enableFileLogging` for persistent debug logs.
1. Check `.vscode/settings.json` for configuration
2. Verify catalog directory structure
3. Examine runtime directory contents
4. Review hat definitions in `.vscode/copilot-hats.json`
4. Review preset definitions in `.vscode/copilot-presets.json`

---

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

Loading