Skip to content
Open
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
17 changes: 17 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- github-knowledge-base-start -->
## Knowledge Base

### Purpose

This repository uses the Knowledge Base at [https://github.com/microsoft/tgrep](https://github.com/microsoft/tgrep) on branch `main`.

### Required behavior

1. Before changing code, read `docs/index.md` from that branch.
2. Use the index to open only the knowledge files relevant to the task.
3. If the index is unavailable, stop and report that the Knowledge Base could not be loaded.

### Source of truth

Generated knowledge tracks the code. When the knowledge and code disagree, trust the code.
<!-- github-knowledge-base-end -->
10 changes: 10 additions & 0 deletions .github/knowledge-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"schema": "2.0",
"docs_system": "tgrep",
"working_repos": [
{
"repo": "self"
}
]
}

15 changes: 15 additions & 0 deletions .github/workflows/knowledge-base-issue-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Attach Knowledge Base artifact

on:
issues:
types: [opened]

permissions:
contents: read
issues: write

jobs:
attach:
uses: github/agentic-knowledge-base/.github/workflows/attach-issue-artifact-on-open.yml@main
# Guided setup maps KB_ISSUE_ARTIFACT_WRITE_PAT here.
secrets: {}
29 changes: 29 additions & 0 deletions .github/workflows/knowledge-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Keeps the Knowledge Base in sync with the codebase.
#
# Runs daily, when an issue closes, or when started manually. The reusable workflow reads
# .github/knowledge-base.json, updates the knowledge docs, and opens a pull
# request if anything changed.
#
# To change the schedule, edit the cron expression below.

name: Update Knowledge Base

on:
schedule:
- cron: "0 8 * * *"
issues:
types: [closed]
workflow_dispatch: {}

permissions:
actions: read
contents: write
issues: write
pull-requests: write
copilot-requests: write

jobs:
update-knowledge-base:
uses: github/agentic-knowledge-base/.github/workflows/knowledge-base-engine.lock.yml@main
# Guided setup adds GH_TOKEN or GH_AW_GITHUB_TOKEN here when this repository needs them.
secrets: {}
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- github-knowledge-base-start -->
## Knowledge Base

### Purpose

This repository uses the Knowledge Base at [https://github.com/microsoft/tgrep](https://github.com/microsoft/tgrep) on branch `main`.

### Required behavior

1. Before changing code, read `docs/index.md` from that branch.
2. Use the index to open only the knowledge files relevant to the task.
3. If the index is unavailable, stop and report that the Knowledge Base could not be loaded.

### Source of truth

Generated knowledge tracks the code. When the knowledge and code disagree, trust the code.
<!-- github-knowledge-base-end -->
8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# microsoft/tgrep

> Routing index for the knowledge base. Copilot reads this file to decide
> which docs to open for a given task. Keep entries short — one line per doc.

| When working on | Topics | Read |
|---|---|---|
| Any task in this repo | general | (no docs yet — the sync workflow will populate this table after merge) |