This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
git clone https://github.com/microsoft/copilot-brag-sheet.git
cd copilot-brag-sheet
npm testThen install runtime deps (@modelcontextprotocol/sdk and zod for the MCP server):
npm installextension.mjs ← Copilot CLI entry point (hooks + tools)
mcp-server.mjs ← MCP stdio server (cross-engine)
lib/
paths.mjs ← Data directory detection, path helpers
config.mjs ← Config loading and category management
heuristics.mjs ← Tool classification, event detection, brag keyword
operations.mjs ← Shared save/review/generate orchestration
lock.mjs ← File locking for concurrent access
storage.mjs ← Atomic JSON/text read/write, record CRUD
records.mjs ← Record creation, sanitization, file tracking
render.mjs ← Markdown rendering
git-backup.mjs ← Git version history and remote sync
bin/
setup.mjs ← Interactive setup wizard
mcp-server.mjs ← MCP server bin entry point
install.sh ← macOS/Linux installer
install.ps1 ← Windows installer
plugin.json ← Copilot CLI plugin manifest
test/
*.test.mjs ← Tests using Node.js built-in test runner
npm test # All tests
node --test test/storage.test.mjs # Single fileTests use Node.js built-in node:test — no test framework dependency needed.
These are intentional constraints — please don't change them without discussion:
| Decision | Rationale |
|---|---|
| Minimal runtime deps | Only @modelcontextprotocol/sdk + zod (MCP server only); lib/ stays pure Node |
| No SQLite | Node 18 built-in SQLite is not available |
| JSON records only | Cloud-sync safe, human-readable |
| Atomic writes (tmp→fsync→rename) | Crash-safe, OneDrive/iCloud safe |
| OS-native app-data dirs | Cross-platform, follows OS conventions |
| Markdown is generated output only | Source of truth is JSON |
- ES modules (
.mjs) throughout - No transpilation — runs directly on Node.js
- Prefer
node:prefixed imports (node:fs,node:path) - No
console.log()in extension code (stdout is JSON-RPC) - Use
session.log()for user-facing messages - Wrap all hook/tool handlers in try-catch
- Define the tool in
extension.mjsin thetoolsarray - Follow the existing pattern: name, description, parameters (JSON Schema), handler
- Use
ensureInitialized()at the start of the handler for resilience - Return a string on success,
{ textResultForLlm, resultType: "failure" }on error - Add tests in
test/extension.test.mjs
- Keep changes focused — one feature or fix per PR
- All tests must pass (
npm test) - Update CHANGELOG.md for user-visible changes
- No new runtime dependencies
- Direct pushes to
mainare blocked — all changes go through PRs
This project uses Semantic Versioning and automated GitHub Releases.
-
Create a PR with your changes:
- Update
versioninpackage.json - Add a new section to
CHANGELOG.mdunder## [x.y.z] — YYYY-MM-DD - Follow Keep a Changelog format
- Update
-
Merge the PR — CI runs tests across 3 OSes × 3 Node versions
-
Tag and push (from an up-to-date
main):git tag v1.2.0 git push origin v1.2.0
-
Automated release — the
release.ymlworkflow:- Runs the full test matrix
- Validates the tag version matches
package.json - Extracts release notes from
CHANGELOG.md - Creates a GitHub Release
| Change type | Version bump | Example |
|---|---|---|
| Bug fixes, docs, polish | Patch (1.0.x) |
Fix install.sh quoting |
| New features, backward-compatible | Minor (1.x.0) |
Add date range filtering |
| Breaking changes | Major (x.0.0) |
Change storage format |
Open an issue with:
- Node.js version (
node --version) - OS and version
- Steps to reproduce
- Expected vs actual behavior