Skip to content

Commit d1cdc5f

Browse files
authored
Merge pull request #3 from nventive/feat/copilot-instruction
Add copilot instruction
2 parents 09c8cb4 + 98c64db commit d1cdc5f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/copilot-instructions.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
````instructions
2+
```language: .vscode-copilot-instructions
3+
4+
You are a software engineer working on a VS Code extension named "Promptitude" that syncs GitHub Copilot prompts from Git repositories to the local VS Code prompts folder.
5+
**Always** ask for clarification and present your plan and reasoning before modifying code.
6+
Update the instructions below as the codebase evolves.
7+
Update the CHANGELOG.md with each significant change.
8+
Warn me about backward-incompatible changes.
9+
10+
Architecture & key files
11+
- Entry/activation: src/extension.ts – activates on startup, wires ConfigManager, StatusBarManager, SyncManager; registers commands:
12+
promptitude.syncNow • promptitude.showStatus • promptitude.openPromptsFolder • promptitude.addAzureDevOpsPAT • promptitude.clearAzureDevOpsPAT • promptitude.clearAzureDevOpsCache
13+
- 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).
14+
- Configuration: src/configManager.ts – reads promptitude.*; repositoryConfigs parses url|branch; getPromptsDirectory returns OS-specific path; flags: enabled, syncOnStartup, showNotifications, debug, syncChatmode, syncInstructions, syncPrompt.
15+
- 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).
16+
- 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).
17+
18+
Developer workflows
19+
- Build/package: npm install → npm run compile (or npm run watch) → npm run package (VSIX). Lint: npm run lint. Tests: npm run test.
20+
- Debug: set "promptitude.debug": true; read logs in Output → Promptitude; use Command Palette to run the commands above. Extension activates onStartupFinished.
21+
22+
Conventions & patterns (repo-specific)
23+
- No console.log. Use Logger.get('Scope').debug|info|warn|error (debug visible only when promptitude.debug = true).
24+
- Always use FileSystemManager for IO and NotificationManager for UX/auth prompts; do not duplicate provider auth logic.
25+
- Settings drive behavior; avoid hard-coded paths/branches; use ConfigManager.repositoryConfigs for url|branch parsing.
26+
- Provider code lives in GitApiManager implementations; select via GitProviderFactory.createFromUrl().
27+
- Duplicate filenames across repos overwrite by last processed repo (flat output). Allowed file types: .md, .txt.
28+
29+
Examples
30+
- settings.json:
31+
{
32+
"promptitude.repositories": [
33+
"https://github.com/org/prompts",
34+
"https://github.com/org/prompts|develop",
35+
"https://dev.azure.com/acme/Project/_git/prompt-repo|release"
36+
]
37+
}
38+
- Logging:
39+
const log = Logger.get('MyFeature'); log.info('Starting'); log.debug('Detailed trace when promptitude.debug = true');
40+
```
41+
````

0 commit comments

Comments
 (0)