Conversation
There was a problem hiding this comment.
Pull Request Overview
Add centralized frontmatter schemas, scaffold member files automatically, and tighten validation in writeup-generation scripts.
- Centralized frontmatter and category schemas in
src/content/schemas.tsand updatedsrc/content.config.tsto import them. - Refactored writeup-generator scripts to reuse shared schemas, add member template creation (
createMemberFile), and validate frontmatter. - Enhanced prompts with custom category normalization and contest ID validation, and updated the new-writeup script to scaffold member files for new authors.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/content/schemas.ts | Define shared Zod schemas for writeups and members, and centralize categories. |
| src/content.config.ts | Replace inline frontmatter definitions with imported centralized schemas. |
| scripts/writeup-generator/validation.ts | Add functions to validate writeup and member frontmatter using shared schemas. |
| scripts/writeup-generator/utils.ts | Clean up imports; fix regex in generateFileName for valid filename characters. |
| scripts/writeup-generator/types.ts | Remove duplicated categories; re-export from centralized schemas; add MemberTemplateData. |
| scripts/writeup-generator/template.ts | Introduce member template generation, file creation, and frontmatter validation. |
| scripts/writeup-generator/prompts.ts | Add validateContestId, custom category prefixing, and consolidate validators. |
| scripts/new-writeup.ts | Detect new authors and scaffold member files before creating writeups. |
Comments suppressed due to low confidence (3)
scripts/writeup-generator/template.ts:79
- [nitpick] Consider adding unit tests for the
createMemberFilefunction and its frontmatter validation to ensure member scaffolding behaves as expected.
await validateMemberFrontmatter(data.filePath);
scripts/writeup-generator/prompts.ts:7
- [nitpick] The function name
addCustomPrefixmay not clearly convey that it also trims and normalizes categories. Consider renaming to something likenormalizeCategoryPrefixfor clarity.
function addCustomPrefix(category: string): string {
scripts/new-writeup.ts:73
- The
existsSyncfunction is used here but not imported. Please addimport { existsSync } from 'node:fs';at the top of the file.
if (isNewAuthor && !existsSync(memberFilePath)) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
imagefields and validate frontmatterTesting
pnpm installpnpm checkhttps://chatgpt.com/codex/tasks/task_e_684c2fb95910832bad3b48c87385a8aa