mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-03-23 07:42:52 +08:00
10 KiB
10 KiB
Update Knowledge Base
- Check out
Accessing Task DocumentsandAccessing Script FilesinREPO-ROOT/.github/copilot-instructions.mdfor context about mentioned*.mdand*.ps1files. - All
*.mdand*.ps1files 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 knowledge and documents for this project inREPO-ROOT/.github/KnowledgeBase/Index.md.Index.mdbelow means this file.
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 have you.## IMPROVEMENTS:### IMPROVEMENT: The exact copy of the improvement request I have you.
## (API|DESIGN) EXPLANATION: The title of the drafting KB document, and where to put the document inIndex.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 give 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 the last section in# DOCUMENT 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 do researching and then fix each section one by one.
- After overriding, copy precisely my problem description in
# Topicfrom the LATEST chat message under# DOCUMENT 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, when researching for a certain 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, when researching for a certain 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 in a new
# Improvefrom the LATEST chat message to a new sub-section### IMPROVEMENTsection under## 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 about 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 codes are subject to change rapidly.
- The document is for understanding the source code, so you must keep mentioning names instead of using a too high-level abstraction language.
- 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 that what you are wrong about, what I still do not understand, where you should 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 every information there, including necessary supporting materials mentioned there. - Extra information is already copied to
## DRAFT REQUESTif any. - You are not going to edit
Index.mdat the moment, you are only editingCopilot_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 APIsunder the specified project inIndex.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 Explanationunder the specified project inIndex.md.
- It means eventually a new section will be added under
- Fill the section to describe which part you would like to 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
# DOCUMENT REQUESTis organized as multiple rounds of questions and answers, it cannot be just directly used as a document. You must reorganize them. - Similar knowledge under the same categories might be spread in different answers, pay attention to them, 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 a too high-level abstraction language.
- You must use everything before
# DRAFTwith details. Do not just make a summary,# DOCUMENT REQUESTis already a summary. - Multiple levels of
#markdown topic containing bullet points are favored.
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.mdat the moment, you are only editingCopilot_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 APIsunder the specified project inIndex.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 Explanationunder the specified project inIndex.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
Index.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.
- 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 a 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.