Skip to content

Commit a64c63d

Browse files
committed
Initial commit: VS Code Copilot Resource Sync Scripts v1.0.0
0 parents  commit a64c63d

11 files changed

Lines changed: 1423 additions & 0 deletions

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Logs directory (contains sync operation logs)
2+
logs/
3+
4+
# Local awesome-copilot cache (user-specific)
5+
.awesome-copilot/
6+
7+
# PowerShell history
8+
.history
9+
10+
# VS Code workspace settings
11+
.vscode/
12+
13+
# Windows thumbnail cache
14+
Thumbs.db
15+
16+
# macOS
17+
.DS_Store

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2025-10-20
9+
10+
### Added
11+
- Initial release of VS Code Copilot Resource Sync Scripts
12+
- `sync-awesome-copilot.ps1` - Sync resources from GitHub awesome-copilot repository
13+
- `combine-and-publish-prompts.ps1` - Combine and publish resources to VS Code
14+
- `publish-to-vscode-profile.ps1` - Publish resources to VS Code profiles
15+
- `normalize-copilot-folders.ps1` - Clean up and organize resource files
16+
- `install-scheduled-task.ps1` - Create automated sync task
17+
- `uninstall-scheduled-task.ps1` - Remove scheduled task
18+
- GitHub API integration with optional GITHUB_TOKEN support
19+
- SHA256 hash-based change detection for efficient syncing
20+
- Automatic junction/symlink creation with copy fallback
21+
- Manifest-based sync state tracking
22+
- Comprehensive logging system
23+
- Support for multiple VS Code profiles
24+
25+
### Features
26+
- Portable paths using environment variables ($HOME, $env:APPDATA)
27+
- Preserves user-created custom files in combined directory
28+
- Incremental updates (only downloads changed files)
29+
- Customizable sync intervals for scheduled task
30+
- Automatic categorization based on file suffixes
31+
- Detailed sync logs with timestamps
32+
33+
### Security
34+
- No hardcoded credentials or personal information
35+
- Optional environment variable for GitHub token
36+
- All sensitive data handled via environment variables
37+
38+
---
39+
40+
## Future Plans
41+
42+
### Planned Features
43+
- [ ] Configuration file support (YAML/JSON)
44+
- [ ] Backup and restore functionality
45+
- [ ] Conflict resolution UI for duplicate resources
46+
- [ ] Support for custom resource categories
47+
- [ ] Integration with other Copilot resource repositories
48+
- [ ] PowerShell module packaging
49+
- [ ] Cross-platform support (macOS, Linux)
50+
51+
### Known Issues
52+
- Junction creation requires appropriate permissions on some systems
53+
- Scheduled task runs under user context (requires user to be logged in)
54+
55+
---
56+
57+
**Note:** Version numbers follow [Semantic Versioning](https://semver.org/):
58+
- MAJOR version for incompatible API changes
59+
- MINOR version for new functionality in a backwards compatible manner
60+
- PATCH version for backwards compatible bug fixes

CONTRIBUTING.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Contributing Guide
2+
3+
Thank you for considering contributing to the VS Code Copilot Resource Sync Scripts project! 🎉
4+
5+
## How to Contribute
6+
7+
### Reporting Bugs
8+
9+
If you find a bug, please create an issue with:
10+
- Clear description of the problem
11+
- Steps to reproduce
12+
- Expected vs actual behavior
13+
- PowerShell version (`$PSVersionTable.PSVersion`)
14+
- Windows version
15+
- Relevant log files from `$HOME\.awesome-copilot\logs\`
16+
17+
### Suggesting Enhancements
18+
19+
Feature requests are welcome! Please include:
20+
- Clear use case description
21+
- Why this feature would be useful
22+
- Proposed implementation (if you have ideas)
23+
24+
### Pull Requests
25+
26+
1. **Fork the repository**
27+
2. **Create a feature branch** from `main`:
28+
```powershell
29+
git checkout -b feature/your-feature-name
30+
```
31+
32+
3. **Make your changes**:
33+
- Follow existing code style
34+
- Add comments for complex logic
35+
- Use meaningful variable names
36+
- Test thoroughly on your system
37+
38+
4. **Update documentation**:
39+
- Update README.md if adding new features
40+
- Update CHANGELOG.md with your changes
41+
- Add inline comments for complex code
42+
43+
5. **Test your changes**:
44+
```powershell
45+
# Test individual scripts
46+
.\sync-awesome-copilot.ps1
47+
.\combine-and-publish-prompts.ps1
48+
49+
# Test scheduled task installation
50+
.\install-scheduled-task.ps1 -Interval "1h"
51+
Start-ScheduledTask -TaskName "AwesomeCopilotSync"
52+
53+
# Verify logs
54+
Get-Content "$HOME\.awesome-copilot\logs\sync-*.log" -Tail 20
55+
```
56+
57+
6. **Commit with clear messages**:
58+
```powershell
59+
git commit -m "Add feature: description of what you added"
60+
```
61+
62+
7. **Push and create PR**:
63+
```powershell
64+
git push origin feature/your-feature-name
65+
```
66+
67+
## Code Style Guidelines
68+
69+
### PowerShell Best Practices
70+
71+
- **Use approved verbs**: `Get-`, `Set-`, `New-`, `Remove-`, etc.
72+
- **PascalCase for functions**: `Invoke-MyFunction`
73+
- **Verbose parameter names**: Prefer clarity over brevity
74+
- **Comment complex logic**: Explain the "why", not the "what"
75+
- **Error handling**: Use `try/catch` for external operations
76+
- **Logging**: Use `Write-Host` with color coding for status messages
77+
78+
### Example:
79+
80+
```powershell
81+
function Get-ResourceFiles {
82+
<#
83+
.SYNOPSIS
84+
Retrieves resource files from a directory.
85+
86+
.PARAMETER Path
87+
The directory path to search.
88+
89+
.PARAMETER Type
90+
The type of resource to filter (chatmode, instruction, prompt).
91+
#>
92+
param(
93+
[Parameter(Mandatory)]
94+
[string]$Path,
95+
96+
[ValidateSet('chatmode', 'instruction', 'prompt')]
97+
[string]$Type
98+
)
99+
100+
try {
101+
$pattern = "*.$Type.md"
102+
Get-ChildItem -Path $Path -Filter $pattern -File
103+
}
104+
catch {
105+
Write-Host "[ERROR] Failed to get resource files: $_" -ForegroundColor Red
106+
throw
107+
}
108+
}
109+
```
110+
111+
### Portable Paths
112+
113+
Always use environment variables for paths:
114+
115+
```powershell
116+
# ✅ GOOD
117+
$cacheDir = Join-Path $HOME '.awesome-copilot'
118+
$profileDir = Join-Path $env:APPDATA 'Code\User'
119+
120+
# ❌ BAD - Don't hardcode user paths
121+
$cacheDir = 'C:\Users\Someone\.awesome-copilot'
122+
```
123+
124+
### Security
125+
126+
- Never commit credentials or tokens
127+
- Use environment variables for sensitive data
128+
- Validate all user inputs
129+
- Use `-WhatIf` support for destructive operations
130+
131+
## Testing Checklist
132+
133+
Before submitting a PR, verify:
134+
135+
- [ ] Scripts run without errors
136+
- [ ] No hardcoded personal paths
137+
- [ ] Portable paths using `$HOME` and `$env:APPDATA`
138+
- [ ] Logging works correctly
139+
- [ ] Error handling covers edge cases
140+
- [ ] Scheduled task integration works
141+
- [ ] No breaking changes to existing functionality
142+
- [ ] Documentation updated
143+
- [ ] CHANGELOG.md updated
144+
145+
## Questions?
146+
147+
Feel free to:
148+
- Open an issue for discussion
149+
- Ask questions in pull request comments
150+
- Reach out to maintainers
151+
152+
## Code of Conduct
153+
154+
Be respectful, constructive, and collaborative. We're all here to make this project better! 🚀
155+
156+
---
157+
158+
**Thank you for contributing!** ❤️

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 VS Code Copilot Resource Sync Scripts Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)