Prompt file imported from vczh-libraries/GacUI (
.github/prompts/kb.prompt.md). Copyright stays with the author.
Update Knowledge Base
- Check out
Accessing Task Documents,(Windows Specific) Accessing Script Files, and(Linux Specific) Accessing Script FilesinREPO-ROOT/.github/copilot-instructions.mdfor context about mentioned*.md,*.ps1and*.shfiles. - All
*.md,*.ps1and*.shfiles should exist; you should not create any new files unless explicitly instructed.- The
Copilot_KB.mdfile should already exist, it may or may not contain content from the last knowledge base writing. - If you cannot find the file, you are looking at a wrong folder.
- The
- Following
Leveraging the Knowledge BaseinREPO-ROOT/.github/copilot-instructions.md, find the knowledge and documents for this project inREPO-ROOT/.github/KnowledgeBase/Index.md.Index.mdbelow means the main entry file.Index_<PROJECT>.mdbelow means the project-specific guidance file linked from the corresponding project section inIndex.md.
Goal and Constraints
- Your goal is to draft a document for the knowledge base in
Copilot_KB.md. - You are only allowed to update
Copilot_KB.mdand the knowledge base. - You are not allowed to modify any other files.
- The phrasing of the request may look like asking for code change, but your actual work is to write the design document.
- Code references must be wrapped in either
single-lineormulti-linequotes.
Copilot_KB.md Structure
# !!!KNOWLEDGE BASE!!!: This file always begins with this title.# DESIGN REQUEST: The exact copy of the problem description I gave you.# INSIGHT: Your insight about the topic after deep research.# ASKS:## QUESTION: The exact copy of the question I gave you.### ANSWER: Your insight about the question after deep research.
# DRAFT:## DRAFT REQUEST: The exact copy of the draft request I gave you.## IMPROVEMENTS:### IMPROVEMENT: The exact copy of the improvement request I gave you.
## (API|DESIGN) EXPLANATION: The title of the drafting KB document, and where to put the document inIndex_<PROJECT>.mdand surrounding anchors.## DOCUMENT: The drafting KB document.
Identify the Problem
- Your goal is to draft a document for the knowledge base, about the topic I just gave you.
- Find
# Topicor# Askor# Draftor# Improveor# Executein the LATEST chat message. - Ignore any
# Topicor# Askor# Draftor# Improveor# Executein the chat history.- Ignore any of these titles in the chat history.
- If there is nothing:
- It means you are accidentally stopped. Please continue your work.
- Read
Copilot_KB.mdthoroughly, it is highly possible that you were working on the request described in# DESIGN REQUEST.
Research on a Topic (only when "# Topic" appears in the latest chat message)
- You should override
Copilot_KB.mdwith only one title# !!!KNOWLEDGE BASE!!!.- DO clear the content of the file before researching.
- DO NOT research and then fix each section one by one.
- After overriding, copy precisely my problem description in
# Topicfrom the LATEST chat message under# DESIGN REQUEST. - Add another title
# INSIGHT. - Add another title
# ASKS. - Add another title
# DRAFT, with all sub-sections under it without content. - Find
Steps for Topicsection for the complete instructions for filling# INSIGHT. - DO NOT TOUCH the
# DRAFTpart; while researching a topic, no document drafting is expected.
Answer a Question (only when "# Ask" appears in the latest chat message)
- Copy precisely my question in
# Askfrom the LATEST chat message to a new sub-section## QUESTIONunder# ASKS. - The new
## QUESTIONand### ANSWERshould be added before# DRAFTas it is the latest question. - Find
Steps for Asksection for the complete instructions for filling### ANSWER. - DO NOT TOUCH the
# DRAFTpart; while researching a topic, no document drafting is expected.
Draft the KB Document (only when "# Draft" appears in the latest chat message)
- Copy precisely my draft request in
# Draftfrom the LATEST chat message to the## DRAFT REQUESTsection. - Find
Steps for Draftsection for the complete instructions for filling## (API|DESIGN) EXPLANATIONand## DOCUMENT.
Improve the KB Document (only when "# Improve" appears in the latest chat message)
- Copy precisely my improvement request from a new
# Improvein the LATEST chat message to a new sub-section### IMPROVEMENTunder## IMPROVEMENTS.- The new
### IMPROVEMENTshould be added before## DOCUMENTas it is the latest improvement.
- The new
- Find
Steps for Improvesection for the complete instructions for updating## DOCUMENT.
Add the KB Document to KB (only when "# Execute" appears in the latest chat message)
- Find
Steps for Executesection for the complete instructions.
Steps for Topic
- Your goal is to complete the
# INSIGHT. - The topic I would like you to research is already copied to
# DESIGN REQUEST. - The topic is around a feature of the project. It involves multiple places of the source code across many components.
- You need to find out the details of the code logic about:
- The entry point.
- The core part.
- Whether there are multiple branches of cases, find all of them.
- Whether there are recursive calls, find the structure.
- Explain in detail about the design and:
- architecture
- organization of components
- execution flows
- design patterns (if applicable)
- Each point you mention should provide proof from the source code.
- When listing cases from a choice, try your best to include all of them.
- You are writing all of this so that, when you need to change it in the future, you know what to change.
- You should keep the content compact.
- When you refer to the source code, do not include code snippets.
- Say the function name, and if the function is big, a little bit more to locate the code in it.
- Do not use line number as source code is subject to change rapidly.
- The document is for understanding the source code, so you must keep mentioning names instead of using language that is too abstract.
- Avoid doing pure code translation, focus more on the design and the logic, focus more on why and how.
Steps for Ask
- Your goal is to complete the
### ANSWERsection in the## QUESTIONsection. - The finding I would like you to clarify is already copied to the last
## QUESTION. - I will point out what you are wrong about, what I still do not understand, and where you need to go deeper.
- You will have to answer my question in
### ANSWER. - Fix
# INSIGHTif there is anything wrong, the insight to update is between# INSIGHTand# ASKS.
Steps for Draft
- Your goal is to complete the
## (API|DESIGN) EXPLANATIONand## DOCUMENTsection. - Keep everything before
# DRAFTunchanged, DO NOT edit anything in it. - Read everything before
# DRAFTcarefully, you are going to draft the document based on all information there, including necessary supporting materials mentioned there. - Extra information is already copied to
## DRAFT REQUESTif any. - You are not going to edit index files at the moment, you are only editing
Copilot_KB.md.
Decide the Type of the Document
- You are going to decide which project this document belongs to.
- You are going to decide the type of the document.
- Change
## (API|DESIGN) EXPLANATIONto## API EXPLANATION (PROJECT)if it is more about the usage and contract of APIs.- It means eventually a new section will be added under
### Choosing APIsin the specified project'sIndex_<PROJECT>.md.
- It means eventually a new section will be added under
- Change
## (API|DESIGN) EXPLANATIONto## DESIGN EXPLANATION (PROJECT)if it is more about how a set of APIs are working together and the design and implementation of the source code.- It means eventually a new section will be added under
### Design Explanationin the specified project'sIndex_<PROJECT>.md.
- It means eventually a new section will be added under
- Fill the section to describe which part you will update in the knowledge base.
Draft the Document
- You are going to draft the document under
## DOCUMENT. - The draft document is completely based on the source code of the project, and all findings before
# DRAFT.- You must not miss any details, you must use every single point mentioned in the document.
- Since the material before
# DRAFTis organized as multiple rounds of questions and answers, it cannot be used directly as a document. You must reorganize it. - Similar knowledge under the same categories might be spread in different answers; pay attention to them, and bring a well-organized document.
- Quality of the draft:
- The document is for understanding the source code, so you must keep mentioning names instead of using language that is too abstract.
- You must use everything before
# DRAFTwith details. Do not just make a summary; that material is already a summary. - Multiple levels of
#markdown topics containing bullet points are favored. - Try your best to mention actual file names as other repos might not see the same source structure, mention classes/functions/etc instead.
- Except for naming convention of generated files, or metadata files offered in the release.
Steps for Improve
- Your goal is to update
## DOCUMENTbased on my suggestion. - The finding I would like you to clarify is already copied to the last
### IMPROVEMENT. - You are not going to edit index files at the moment, you are only editing
Copilot_KB.md.
Steps for Execute
- There is
## API EXPLANATION (PROJECT)or## DESIGN EXPLANATION (PROJECT)section filled with the title and content of the document you drafted.- If it is
## API EXPLANATION (PROJECT):- A new section will be added under
### Choosing APIsin the specified project'sIndex_<PROJECT>.md. - At the end of the new section, a
[API Explanation]()link is expected.
- A new section will be added under
- If it is
## DESIGN EXPLANATION (PROJECT):- A new section will be added under
### Design Explanationin the specified project'sIndex_<PROJECT>.md. - At the end of the new section, a
[Design Explanation]()link is expected.
- A new section will be added under
- If it is
- Create a new section in the specified project's
Index_<PROJECT>.md.- Following
Leveraging the Knowledge BaseinREPO-ROOT/.github/copilot-instructions.mdto figure out the expected format. - The document is super long, you have to carefully figure out where is the exact place to add the new section.
- The main
Index.mdonly keeps project introductions and links toIndex_<PROJECT>.md; do not add API or design sections there. - Use bullet points for the description of the topic to cover the most important points so that it will be easy to identify in the future if this topic is relevant to work to do.
- Create a document file according to the hyperlink.
- The title of the new document file should follow
## API EXPLANATION (PROJECT)or## DESIGN EXPLANATION (PROJECT). - The content must be exactly and precisely the content under
## DOCUMENT. But do not copy the## DOCUMENTtitle itself.
- Following
- Keep
Copilot_KB.mdunchanged.