From 560ce3c3b2b909643b33a7e55ed64e952366f9a7 Mon Sep 17 00:00:00 2001 From: Atharv Mantri Date: Mon, 14 Sep 2026 15:15:51 +0530 Subject: [PATCH] feat: sync GitHub Copilot instructions --- README.md | 5 ++-- apps/landing/app/docs/context-sync/page.tsx | 4 ++++ apps/landing/app/docs/page.tsx | 2 +- apps/landing/app/docs/security/page.tsx | 3 ++- apps/landing/app/page.tsx | 13 +++++----- packages/cli/tests/test_cli.py | 5 ++-- .../core/memoryguard_core/context_sync.py | 1 + packages/core/tests/test_context_sync.py | 24 +++++++++++++++++++ 8 files changed, 45 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 04f9850..df0ef6e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Stop re-explaining your project to AI coding agents.** -MemoryGuard is a local-first developer CLI that turns durable project facts into generated context files for coding agents. It helps keep `AGENTS.md`, `CLAUDE.md`, `MEMORY.md`, and Cursor rules aligned with the current truth of your project, while redacting secret-looking values before they reach generated context. +MemoryGuard is a local-first developer CLI that turns durable project facts into generated context files for coding agents. It helps keep `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, `MEMORY.md`, and Cursor rules aligned with the current truth of your project, while redacting secret-looking values before they reach generated context. **[Visit the public alpha site and quickstart](https://atharvmantri.github.io/MemoryGuard/)** @@ -218,6 +218,7 @@ MemoryGuard Context Sync writes managed blocks to: - `AGENTS.md` - `CLAUDE.md` +- `.github/copilot-instructions.md` - `MEMORY.md` - `.cursor/rules/memoryguard.mdc` @@ -245,7 +246,7 @@ MemoryGuard redacts common secret-looking values before displaying capture candi projectmem is stronger today for event-sourced memory, pre-commit warnings, cross-project memory, and judgment workflows. -MemoryGuard has a different focus: context-file sync for `AGENTS.md`, `CLAUDE.md`, `MEMORY.md`, and Cursor rules. MemoryGuard's wedge is current project truth, supersession of outdated decisions, and secret-safe generated context. Different focus, not fake superiority. +MemoryGuard has a different focus: context-file sync for `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, `MEMORY.md`, and Cursor rules. MemoryGuard's wedge is current project truth, supersession of outdated decisions, and secret-safe generated context. Different focus, not fake superiority. ## Roadmap diff --git a/apps/landing/app/docs/context-sync/page.tsx b/apps/landing/app/docs/context-sync/page.tsx index d3be5dc..6076cbb 100644 --- a/apps/landing/app/docs/context-sync/page.tsx +++ b/apps/landing/app/docs/context-sync/page.tsx @@ -16,6 +16,9 @@ export default function ContextSyncPage() {
  • CLAUDE.md
  • +
  • + .github/copilot-instructions.md +
  • MEMORY.md
  • @@ -80,6 +83,7 @@ memoryguard context watch --yes --once`}

    Treat generated context as code-adjacent output. Review{" "} AGENTS.md, CLAUDE.md,{" "} + .github/copilot-instructions.md, MEMORY.md,{" "} MEMORY.md, and the Cursor rules before committing or sharing them.

    diff --git a/apps/landing/app/docs/page.tsx b/apps/landing/app/docs/page.tsx index 79e55b7..a56c72f 100644 --- a/apps/landing/app/docs/page.tsx +++ b/apps/landing/app/docs/page.tsx @@ -16,7 +16,7 @@ const cards = [ [ "/docs/context-sync", "Context Sync", - "Render approved project memory into AGENTS.md, CLAUDE.md, MEMORY.md, and Cursor rules.", + "Render approved project memory into AGENTS.md, CLAUDE.md, Copilot instructions, MEMORY.md, and Cursor rules.", ], [ "/docs/security", diff --git a/apps/landing/app/docs/security/page.tsx b/apps/landing/app/docs/security/page.tsx index 1987ad9..67aa771 100644 --- a/apps/landing/app/docs/security/page.tsx +++ b/apps/landing/app/docs/security/page.tsx @@ -31,7 +31,8 @@ export default function SecurityPage() { MemoryGuard attempts to detect and omit secret-looking content before rendering generated context. This is a guardrail, not a guarantee. Review AGENTS.md, CLAUDE.md,{" "} - MEMORY.md, and the Cursor rules before publishing. + .github/copilot-instructions.md, MEMORY.md, and + the Cursor rules before publishing.

    Transcript hygiene

    diff --git a/apps/landing/app/page.tsx b/apps/landing/app/page.tsx index 292634a..3cf9da9 100644 --- a/apps/landing/app/page.tsx +++ b/apps/landing/app/page.tsx @@ -35,7 +35,7 @@ const features: { { kicker: "Sync", title: "One memory store. Many agent files.", - body: "Render approved project memory into AGENTS.md, CLAUDE.md, MEMORY.md, and Cursor rules.", + body: "Render approved project memory into AGENTS.md, CLAUDE.md, Copilot instructions, MEMORY.md, and Cursor rules.", icon: "⇄", wide: true, }, @@ -91,7 +91,7 @@ const compRows: { generic: CellKind; mg: CellKind; }[] = [ - { capability: "Syncs AGENTS.md / CLAUDE.md / MEMORY.md / Cursor rules", manual: "partial", generic: "partial", mg: "yes" }, + { capability: "Syncs AGENTS.md / CLAUDE.md / Copilot / MEMORY.md / Cursor rules", manual: "partial", generic: "partial", mg: "yes" }, { capability: "Review-first transcript capture", manual: "no", generic: "partial", mg: "yes" }, { capability: "Supersedes outdated project decisions", manual: "no", generic: "partial", mg: "yes" }, { capability: "Secret-aware generated context", manual: "no", generic: "partial", mg: "yes" }, @@ -106,7 +106,7 @@ const workflow = [ { step: "Sync", desc: "Write clean context into the files your tools already inspect.", cmd: "memoryguard sync" }, ]; -const generatedFiles = ["AGENTS.md", "CLAUDE.md", "MEMORY.md", ".cursor/rules/memoryguard.mdc"]; +const generatedFiles = ["AGENTS.md", "CLAUDE.md", ".github/copilot-instructions.md", "MEMORY.md", ".cursor/rules/memoryguard.mdc"]; /* ── Page ─────────────────────────────────────────────────── */ @@ -122,7 +122,7 @@ export default function HomePage() { MemoryGuard keeps your project's agent context files accurate across sessions. Capture decisions, review what matters, supersede outdated facts, and sync clean context into AGENTS.md, CLAUDE.md, - MEMORY.md, and Cursor rules. + .github/copilot-instructions.md, MEMORY.md, and Cursor rules.

    @@ -224,7 +224,7 @@ export default function HomePage() { [ok] uv on PATH $ memoryguard demo Agent Capture demo passed. -Extracted 10 candidates, approved 9, wrote 4 context files.`} +Extracted 10 candidates, approved 9, wrote 5 context files.`}
    @@ -306,13 +306,14 @@ function ProductMockup() {
    Generated Context
    AGENTS.md
    CLAUDE.md
    +
    Copilot instructions
    MEMORY.md
    Cursor rules
    $ memoryguard capture approve --all
    $ memoryguard sync
    - ✓ wrote 4 context files + ✓ wrote 5 context files
    diff --git a/packages/cli/tests/test_cli.py b/packages/cli/tests/test_cli.py index 9133cdc..1da00e6 100644 --- a/packages/cli/tests/test_cli.py +++ b/packages/cli/tests/test_cli.py @@ -349,6 +349,7 @@ def test_status_shows_project_health(tmp_path): assert "AGENTS.md" in result.stdout assert "CLAUDE.md" in result.stdout assert "MEMORY.md" in result.stdout + assert ".github/copilot-instructions.md" in result.stdout assert ".cursor/rules/memoryguard.mdc" in result.stdout assert "suggested next command" in out assert 'memoryguard remember "This project uses ..."' in result.stdout @@ -785,8 +786,8 @@ def test_doctor_exit_zero_when_store_and_context_files_present(tmp_path): out = result.stdout # Store + context-files rows are explicit "pass" cells. assert "pass" in out - # The context-files row should report "all 4 present" once sync wrote them. - assert "all 4 present" in out + # The context-files row should report "all 5 present" once sync wrote them. + assert "all 5 present" in out # The friendly "all checks passed" verdict is rendered on a full pass. assert "all checks passed" in out.lower() diff --git a/packages/core/memoryguard_core/context_sync.py b/packages/core/memoryguard_core/context_sync.py index 582d1f0..9b89207 100644 --- a/packages/core/memoryguard_core/context_sync.py +++ b/packages/core/memoryguard_core/context_sync.py @@ -37,6 +37,7 @@ "AGENTS.md", "CLAUDE.md", "MEMORY.md", + ".github/copilot-instructions.md", ".cursor/rules/memoryguard.mdc", ) diff --git a/packages/core/tests/test_context_sync.py b/packages/core/tests/test_context_sync.py index 81d3ae6..9e06403 100644 --- a/packages/core/tests/test_context_sync.py +++ b/packages/core/tests/test_context_sync.py @@ -42,6 +42,30 @@ def test_context_generation_uses_memories_and_repo_metadata(tmp_path): assert "Package manager: pnpm" in agents.proposed +def test_context_generation_includes_copilot_repository_instructions(tmp_path): + engine = _engine(tmp_path) + engine.create_memory( + content="Use focused tests for feature changes.", + source_type=SourceType.USER, + source_ref="user://qa", + scope=Scope.PROJECT, + scope_ref="demo", + ) + + plan = build_context_sync_plan(tmp_path, engine.store) + copilot = next( + item for item in plan.files if item.path == ".github/copilot-instructions.md" + ) + + assert "Use focused tests for feature changes." in copilot.proposed + write_pending_context_plan(plan) + written, paths = approve_context_sync(tmp_path) + + assert written == 5 + assert ".github/copilot-instructions.md" in paths + assert (tmp_path / ".github/copilot-instructions.md").is_file() + + def test_context_generation_redacts_secrets(tmp_path): engine = _engine(tmp_path) engine.create_memory(