Skip to content

Commit 83484aa

Browse files
authored
Create guidelines for metadata PR reviews
Added comprehensive guidelines for reviewing metadata pull requests, including requirements for file structure, schema validation, and quality checks.
1 parent 5ca6b93 commit 83484aa

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

.github/copilot-instructions.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# GitHub Copilot Instructions for Metadata Pull Request Review
2+
3+
## General Guidelines
4+
5+
When reviewing pull requests that add or modify metadata files in this repository, you must:
6+
7+
1. **Always respond and provide reviews in Chinese**
8+
2. **Thoroughly check all aspects** described in these instructions
9+
3. **Reference specific documentation** when issues are found
10+
11+
## Metadata File Requirements
12+
13+
### File Structure and Naming
14+
- Metadata files must be YAML format (.yml extension)
15+
- Files must be named using the MD5 sum of the corresponding resource file
16+
- Files must be placed in the `/metadata` directory in the repository root
17+
- Each metadata file must correspond to exactly one resource file
18+
19+
### Schema Validation
20+
Every YAML file must begin with the appropriate schema comment:
21+
- Books: `# yaml-language-server: $schema=https://byrdocs.org/schema/book.yaml`
22+
- Tests: `# yaml-language-server: $schema=https://byrdocs.org/schema/test.yaml`
23+
- Documents: `# yaml-language-server: $schema=https://byrdocs.org/schema/doc.yaml`
24+
25+
## File Type Classification
26+
27+
Check that files are correctly classified into one of three types:
28+
29+
### 1. Books (book)
30+
**Must meet ALL criteria:**
31+
- Is an actual book (not lecture notes, courseware, etc.)
32+
- PDF format electronic book only
33+
- Formally published work (publicly released by individual/organization with proper publication)
34+
- Educational resource (novels, essays, comics excluded unless proven educational)
35+
36+
**Required fields for books:**
37+
- `id`: MD5 hash of the file
38+
- `url`: BYR Docs URL (format: https://byrdocs.org/files/{md5}.pdf)
39+
- `type`: Must be exactly "book"
40+
- `data.title`: Must match original book title exactly
41+
- Chinese books (including translated foreign books): Use Chinese title
42+
- Foreign books: Use foreign title, with exceptions:
43+
- Language course textbooks: Use Chinese title
44+
- International college textbooks authored by Chinese: Use bilingual title
45+
- Traditional Chinese titles: Treat as foreign titles
46+
- `data.authors`: Array format, use original names preferred over translations
47+
- `data.translators`: Optional, only if translators exist
48+
- `data.edition`: Optional, for translations use translated version number
49+
- `data.publisher`: Optional, for translations use translation publisher
50+
- `data.publish_year`: Optional, for translations use translation year
51+
- `data.isbn`: Required, must be ISBN13 format array
52+
- `data.filetype`: Must be exactly "pdf"
53+
54+
### 2. Tests (test)
55+
**Must meet ALL criteria:**
56+
- PDF format electronic material
57+
- From Beijing University of Posts and Telecommunications only
58+
- Midterm or final examination papers only (not monthly tests, homework, etc.)
59+
- Must be actual exam papers that were given (not question banks or mock tests)
60+
61+
**Required fields for tests:**
62+
- `id`: MD5 hash of the file
63+
- `url`: BYR Docs URL (format: https://byrdocs.org/files/{md5}.pdf)
64+
- `type`: Must be exactly "test"
65+
- `data.college`: Optional array, only fill if confirmed this college actually took this exam
66+
- `data.course`: Required object with:
67+
- `type`: Either "本科" or "研究生" (optional if unknown)
68+
- `name`: Required, full course name (no abbreviations, include all letters/parentheses)
69+
- `data.time`: Required object with:
70+
- `start`: Required academic year start
71+
- `end`: Required academic year end
72+
- `semester`: Optional, either "First" or "Second"
73+
- `stage`: Optional, either "期中" or "期末"
74+
- `data.filetype`: Must be "pdf" or "wiki"
75+
- `data.content`: Required array, must contain "原题" and/or "答案"
76+
77+
### 3. Documents (doc)
78+
**Must meet ALL criteria:**
79+
- PDF or ZIP format
80+
- Educational resource
81+
- Must correspond to at least one course
82+
- Must be related to course study or exam preparation (not competition materials)
83+
84+
**Required fields for documents:**
85+
- `id`: MD5 hash of the file
86+
- `url`: BYR Docs Publish URL
87+
- `type`: Must be exactly "doc"
88+
- `data.title`: Required, self-summarized appropriate title
89+
- `data.filetype`: Must be "pdf" or "zip"
90+
- `data.course`: Required non-empty array of objects with:
91+
- `type`: Either "本科" or "研究生" (optional if unknown)
92+
- `name`: Required full course name
93+
- `data.content`: Required non-empty array, must contain one or more of:
94+
- "思维导图" (mind maps)
95+
- "题库" (question banks not fitting book/test categories)
96+
- "答案" (answers to homework, exercises, etc.)
97+
- "知识点" (study aids, review materials)
98+
- "课件" (courseware, handouts, teaching materials)
99+
100+
## Quality Requirements
101+
102+
### File Quality Issues to Check:
103+
1. **Clarity**: Files must be clear and readable
104+
2. **Completeness**: No missing pages, duplicate pages, or page order issues
105+
3. **Organization**: No mixed content (multiple test sets in one PDF)
106+
4. **Cover**: PDF files must have appropriate cover pages
107+
108+
### Deduplication Principles:
109+
110+
**For Books:**
111+
- Higher clarity preferred
112+
- Files with covers preferred
113+
- Files with complete bookmarks preferred
114+
115+
**For Tests:**
116+
- Separate question and answer files should be merged
117+
- Questions-only + embedded-answers should be combined (questions first, answers after)
118+
- Answer-only files are redundant if complete question+answer file exists
119+
- Same year/subject with different content may be legitimate (makeup exams, different colleges, multiple exam versions)
120+
121+
## Review Process
122+
123+
When reviewing metadata PRs:
124+
125+
1. **Verify file naming**: Check MD5 sum matches filename
126+
2. **Validate YAML structure**: Ensure proper formatting and required fields
127+
3. **Check schema compliance**: Verify correct schema header and field types
128+
4. **Validate classification**: Confirm file type matches content and meets criteria
129+
5. **Review field accuracy**: Check all required fields are present and correctly formatted
130+
6. **Assess quality**: Consider if file meets quality standards
131+
7. **Check for duplicates**: Identify potential duplicate content
132+
133+
## Response Requirements
134+
135+
When providing feedback:
136+
137+
### For Compliant Submissions:
138+
- Thanks to the contributors for their contributions
139+
- Approve the submission
140+
141+
Note: Do not provide redundant content, do not restate the guidelines and rules, and keep the comments concise.
142+
143+
### For Non-Compliant Submissions:
144+
- Clearly explain specific issues in Chinese
145+
- Reference the exact requirements that were not met
146+
- Direct contributors to review:
147+
- Contributing Guide: https://github.com/byrdocs/byrdocs-archive/blob/master/CONTRIBUTING.md
148+
- File Rules: https://github.com/byrdocs/byrdocs-archive/blob/master/docs/%E6%96%87%E4%BB%B6%E8%A7%84%E5%88%99.md
149+
- Metadata Rules: https://github.com/byrdocs/byrdocs-archive/blob/master/docs/%E5%85%83%E4%BF%A1%E6%81%AF%E8%A7%84%E5%88%99.md
150+
- Provide specific guidance on how to fix the issues
151+
- Request changes before approval
152+
153+
## Special Cases
154+
155+
### Multi-College Tests:
156+
- Only include colleges in array if confirmed they took this specific exam
157+
- When uncertain, omit college field rather than guess
158+
159+
### Translation Books:
160+
- Use translation publisher, year, edition, and ISBN
161+
- Include original version information in title if relevant
162+
163+
Remember: The goal is to maintain high-quality, consistent metadata that enables effective search and organization of educational resources. Be thorough but constructive in reviews.

0 commit comments

Comments
 (0)