一键导入
assignment-creation
Create and maintain assignment pages (problem sets, homework, project milestones) under special/academia/<INSTITUTION>/<COURSE>/assignments/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create and maintain assignment pages (problem sets, homework, project milestones) under special/academia/<INSTITUTION>/<COURSE>/assignments/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Content conventions, examples, and tooling for course notes under special/academia.
Repository-wide tooling including init wrapper, pack/publish utilities, and all helper scripts. Links to tools-special and tools-templates for subfolder details.
Ingest Wikipedia HTML, normalize links/media, and archive to knowledge base.
Help the user add spaced-repetition flashcards (cloze deletions or Q/A pairs) to existing Markdown notes across the repository. The skill encapsulates the multi‑step process the user follows in their finance lecture notes (e.g. FINA 3103) and elsewhere: read the prose, identify key terms, dates, formulas and logical assertions, and wrap them using flashcard markup (`{@{ }@}`, `::@::`, `:@:`). There are three supported forms: - **Cloze** (`{@{ }@}`) hides arbitrary text inside paragraphs. - **Two-sided QA** (`::@::`) on a single line, yielding two cards. - **One-sided QA** (`:@:`) on a single line, yielding a single card. For the QA formats remember the line-only rule; if visual separation is needed insert `<br/>`/`<p>` instead of newline characters. Representative examples later in this document illustrate all three types. Use existing flashcard files as style guides and adapt the output based on user feedback. The skill also suggests regeneration commands once flashcards are inserted.
Archive online content into archives/ with automatic index.md updates via pyarchivist tool.
Regenerate programmatically-generated content blocks in knowledge base notes using pytextgen.
| name | assignment-creation |
| description | Create and maintain assignment pages (problem sets, homework, project milestones) under special/academia/<INSTITUTION>/<COURSE>/assignments/. |
Use this skill when creating new assignment pages or adding assignment-related content (problem sets, homework, project milestones, lab rounds, deliverable pages) to course knowledge bases under special/academia/.
Flashcards and other generated content are rebuilt automatically by the build system; do not run init generate manually.
For general academic-note conventions (frontmatter, topic notes, lecture content, flashcards, LaTeX), see the academic-notes skill.
Before creating a new assignment page, examine 1–3 existing assignment pages in the same course to identify the conventions already in use. Match the existing style unless there is a compelling reason to deviate. Pay particular attention to:
problem set 1 vs ps1 vs homework 1 vs
hw1), file naming, heading capitalizationlab.md, prelab.md,
etc.), how they are structuredConsistency across assignments in the same course makes the knowledgebase more predictable to navigate.
Each course with assignments should have an assignments/ folder under the course root. The top-level assignments/index.md lists all assignments.
Each assignment lives in its own subfolder:
assignments/
├── index.md # lists all assignments
└── <assignment-name>/
├── index.md # assignment page
├── attachments/ # prompt PDFs, data files, images
├── submission/ # submitted work (PDFs, source files)
├── solution/ # official or self-made solutions
└── submission.yml # Canvas export metadata (optional)
Common naming patterns:
problem set 1/, problem set 2/homework 1/, homework 2/milestone 1/, milestone 2/Batch creation workflow: When creating multiple assignments in one pass (e.g., PS2–PS11), follow this order to minimize rework:
.course_sources/), copy all artifacts (solution PDFs,
submission PDFs, Apple Notes markdown, prompt PDFs, images) into each
assignment folder in batch before writing index.md files. See the
Source file management section below.convert_canvas_submission.py in batch. Do this after
step 0 and before step 1, since the YAML feeds into verification later.assignments/index.md and the course root
index.md in a single pass.bun run check:md --no-globs <all files> and verify
each against its Canvas source.Steps 0 and 2 are independent and can be parallelized across assignments using shell loops.
This avoids the inefficiency of creating one assignment, discovering a pattern change, and having to retroactively fix earlier ones.
Before creating an assignment page, ensure you have:
index.md already exist..course_sources/ or a similar course-specific source directory. Search for
the assignment by name in the Canvas HTML exports.Critical: Canvas-first data source. All metadata (due dates, points, submission type, description text, PDF filenames, update announcements, color styling) MUST be extracted from the actual Canvas HTML page. Never fabricate or guess these values — the user will catch and demand fixes. If the Canvas HTML is unavailable, ask the user to provide it before proceeding.
Create the assignment directory and subdirectories:
mkdir -p assignments/<assignment-name>/{attachments,submission,solution}
The assignment's index.md follows a specific structure with these components in order:
--- separators): Canvas-derived title, due
date, points, submitting type, etc.## attachments: file list of assignment prompt materials## submission: submitted work (PDF, source markdown, metadata)## solution: official or self-made solutionUse exhaustive alias combinations following the course pattern:
---
aliases:
- HKUST MATH 2431 PS1
- HKUST MATH 2431 problem set 1
- HKUST MATH2431 PS1
- HKUST MATH2431 problem set 1
- MATH 2431 PS1
- MATH 2431 problem set 1
tags:
- date/2026/02/13 # due date
- flashcard/active/special/academia/HKUST/MATH_2431/assignments/problem_set_1
- language/in/English
---
The aliases should cover all reasonable combinations of:
After the heading, separate metadata with --- lines:
# problem set 1
- HKUST MATH 2431
---
- title: Problem Set 1
- due: 2026-02-13T13:30:00+08:00
- points: 8
- submitting: a text entry box or a file upload
Normalize timestamps to ISO 8601 with timezone. For assignments with availability windows, use a range: available: 2025-09-25T00:00:00+08:00/2025-10-03T23:59:59+08:00, P8DT23H59M59S.
Reproduce Canvas HTML verbatim, preserving formatting with Markdown and inline <span style> for colors:
---
Problem Set 1, due on <span style="color: #0e68b3">**Friday 13/02/2026, until 13:30 (1:30 PM)**</span> Hong Kong Time (UTC +8), to be uploaded on Canvas <span style="color: #e62429">**(note the updated deadline)**</span>.
**<span style="color: #e62429">Update (05/02/2026, 10:30 AM): Question 4 updated, and mandatory problem changed from 4 to 3</span>**; if you already submitted your solutions, Question 4 will be graded **or** Question 3 in case you update your solution.
[PS1-v4.pdf](attachments/PS1-v4.pdf)
Rules:
<span style> tags.Deadline extension text: Canvas often adds extension notices in colored span tags. Reproduce them exactly, including the exact phrasing and color. Common patterns seen in practice:
(Note: This assignment deadline has been extended)
<span style="color: #e62429">**(note the extended deadline)**</span>
<span style="color: #e62429">**(Attention: Extended deadline!)**</span>
Update announcements: Canvas pages may have inline update notices (e.g., "Small clarification on Problem 1", "Question 4 updated"). Preserve both the heading and body verbatim, with the same color and bold styling:
**<span style="color: #e62429">Update (04/03/2026, 10:20 PM): Small clarification on Problem 1</span>**
**<span style="color: #e62429">Update (16/03/2026, 12:15 PM): Question 4 updated</span>**; if you already
submitted your solutions, the new version is optional.
List the assignment prompt files with links:
## attachments
- [`PS1-v4.pdf`](attachments/PS1-v4.pdf)
PDF display name vs actual file link: When the on-disk file has a versioned name (e.g., PS7-3.pdf, PS10-1.pdf) but Canvas references a base name (PS7.pdf, PS10.pdf), display the Canvas name while linking to the actual file. This keeps the page consistent with what students see on Canvas while still serving the correct file:
[PS7.pdf](attachments/PS7-3.pdf)
## attachments
- [`PS7.pdf`](attachments/PS7-3.pdf)
Record submitted work. This can include:
submission.yml with Canvas export metadata## submission
- submission: [`HKUST MATH 2431 - problem set 1.pdf`](submission/HKUST%20MATH%202431%20-%20problem%20set%201.pdf)
- metadata: [`submission.yml`](submission.yml)
- source: [`HKUST MATH 2431 problem set 1.md`](submission/HKUST%20MATH%202431%20problem%20set%201.md)
When an answer list is available (e.g., quizzes with short answers), include the numbered list:
## submission
1. ...
2. ...
When the submission section needs archived-filename provenance or similar metadata, keep that extra structure only in ## submission, for example - file: [submission.pdf](submission.pdf) followed by nested metadata bullets such as - filename: ....
When the task still wants the public page to preserve the normal artifact routes, keep standard relative links in public ## submission / ## solution sections as if the files were colocated, for example [submission.pdf](submission.pdf) or [HW1_Sol.pdf](solution/HW1_Sol.pdf). Do not rewrite those links to private/ paths in the public note.
The submission.yml file stores Canvas export metadata. Its structure:
assignment:
comments: {}
content: ""
grade:
entered: 8
graded anonymously: false
possible: 8
id: 425065
properties:
due: 2026-02-13 13:30:00-07:00
points: 8
submitting:
- a text entry box or a file upload
submissions:
- datetime: 2026-02-11 13:26:00-07:00
id: -1
title: Problem Set 1
course:
id: 69402
name: MATH2431
Extract this from the Canvas assignment HTML page using the convert_canvas_submission.py tool, which reads a SingleFile-saved HTML and writes the YAML structure to stderr.
Tool characteristics:
input("HTML file? ")
and expects the file path on stdin, then writes the YAML document to stderr.`url: ...`) and a saved-date comment; otherwise the tool silently
exits with code 1.Driving the tool non-interactively:
Use a here-string to supply the file path on stdin and redirect stderr to capture the YAML:
uv run -m scripts.special.convert_canvas_submission \
<<< "/path/to/Canvas HTML.html" \
2> submission.yml
Canvas HTML filenames may be inconsistent — the same course can have mixed naming conventions (e.g., "HKUST Canvas - Problem Set N …" for some assignments and "Problem Set N …" for others). Always ls the source directory to discover the actual filenames before writing loops.
Batch extraction loop:
# Discover actual filenames first
ls <source-dir>/
# Then adapt the loop to the naming convention found
for N in $(seq <first> <last>); do
html_path=$(find <source-dir> -maxdepth 1 -name "*Problem Set $N*" -type f)
if [ -n "$html_path" ]; then
uv run -m scripts.special.convert_canvas_submission \
<<< "$html_path" \
2> "assignments/problem set $N/submission.yml"
fi
done
Comment author redaction: After saving submission.yml, replace every author: value (which contains a real name) with '[redacted]' to protect privacy:
sed -i '' "s/author: .*/author: '[redacted]'/" assignments/problem\ set\ */submission.yml
This redacts grader/comment author names while preserving the rest of the YAML structure. Run this after extracting all files.
Preserve the YAML output as-is — do not edit the extracted file (except for the author redaction above).
Some submissions are written as Markdown files. Judge whether the file is an Apple Notes export (needs special handling) or regular Markdown.
Judging if a file is an Apple Notes markdown export:
The file may already have our modifications (attachment path rewrites, suppression comments at top). Look past those and examine the body.
A file is likely from Apple Notes if it has one or more of:
(Attachments|../attachments)/<UUID>.<ext> (e.g.,
Attachments/A1B2C3D4-...png). Most reliable indicator.A file is not an Apple Notes export if it has YAML frontmatter, flashcard/pytextgen markup, or consistently manual formatting throughout.
If unsure, treat as regular Markdown (no path rewrites, no suppression comments). The user can correct.
For Apple Notes markdown exports:
submission/ as "<Course Name> problem set N.md" (source may
use hyphens; normalize to no hyphens).Attachments/XXX.ext → ../attachments/XXX.ext.For regular Markdown submissions:
Copy as-is. Do not add suppression comments or rewrite attachment paths.
Link to the solution file:
## solution
- [`SL1.pdf`](solution/SL1.pdf)
Place all assignment prompt files (PDFs, data CSVs, images) in the attachments/ directory. Keep filenames as-is from the source.
When an Apple Notes markdown submission (identified using the criteria in Markdown submission source preservation) embeds HEIC, PNG, or other image formats, also place those images in attachments/ and update the attachment paths as described in that section.
The top-level assignments/index.md lists all assignments. Add a new child link for the new assignment:
---
aliases:
- HKUST MATH 2431 assignment
- HKUST MATH 2431 assignments
- HKUST MATH2431 assignment
- HKUST MATH2431 assignments
tags:
- flashcard/active/special/academia/HKUST/MATH_2431/assignments
- function/index
- language/in/English
---
# index
- HKUST MATH 2431
## children
- [problem set 1](problem%20set%201/index.md)
Add an - assignment: entry in the course's index.md under the last lecture entry on or before the due date. Place it after - topic: and - status::
## week N lecture
- datetime: 2026-02-11T13:30:00+08:00/2026-02-11T14:50:00+08:00
- topic: ...
- assignment: [problem set 1](assignments/problem%20set%201/index.md)
If the lecture already has a topic: and optional status:, add assignment: after them.
After creating or updating assignment pages, systematically verify each one against its Canvas HTML source. Check these fields:
submission.yml presence — exists and is non-emptyassignment.id match — the extracted id field matches the known
Canvas assignment ID for that page. This catches cases where the wrong
HTML file was used. Known IDs from Canvas can be read from the
url: https://<host>/courses/<course_id>/assignments/<assign_id> comment
in the source HTML.If the course has multiple assignments, verify them all in one pass and report any discrepancies to the user for resolution.
When the course has a source directory (e.g., .course_sources/), populate the assignment folder from source files. Copy (do not symlink) files — this keeps the archive self-contained and stable even if cleaned up later.
There is no fixed source hierarchy. Every course source directory is organized differently (by the user's personal convention, LMS export format, or ad-hoc collection). The examples below illustrate the kind of work involved, not a structure to expect in any other course. Always start by exploring the actual source directory with ls/tree/find to discover its real layout before writing copy commands.
To populate an assignment folder, you typically need to locate and copy these artifact types wherever they happen to live in the source tree:
Locate solution PDFs somewhere in the source tree (e.g., in a questions/ subdirectory) and copy:
cp <path-in-source>/SL{N}.pdf assignments/problem\ set\ {N}/solution/
Find the submission PDF (often named after the course and assignment) and copy it into the assignment's submission/ folder:
cp <path-in-source>/"Course Name - problem set N.pdf" \
assignments/problem\ set\ {N}/submission/
Judge per Markdown submission source preservation. If Apple Notes: detect naming pattern, create with suppression header and path rewrites, copy referenced UUID-named images from source attachments. Otherwise copy as-is.
A shell pipeline illustrating the process (paths are specific to one source layout; adapt to the actual layout):
# Detect source file name (may be with or without hyphen)
if [ -f "$SOURCES/Course Name problem set N.md" ]; then
SRC="$SOURCES/Course Name problem set N.md"
else
SRC="$SOURCES/Course Name - problem set N.md"
fi
DST="$PS_DIR/submission/Course Name problem set N.md"
# Write suppression header + rewritten content
# (suppressions: file-level markdownlint and validator comments)
echo '<!-- markdownlint-disable ... -->' > "$DST"
# Add validator suppression comment too
echo '<!-- check: ignore-file[...]: Apple Notes markdown — do not modify -->' >> "$DST"
sed 's|Attachments/|../attachments/|g' "$SRC" >> "$DST"
# Copy all UUID-named image files referenced in the source
grep -o '[A-F0-9]\{8\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{12\}\.[a-z]*' "$SRC" \
| while read -r uuid_file; do
cp "$ATTACHMENTS_SRC/$uuid_file" "$PS_DIR/attachments/"
done
Find prompt PDFs in the source tree and copy into attachments/:
cp <path-in-source>/PS{N}*.pdf assignments/problem\ set\ {N}/attachments/
When the on-disk file is versioned (e.g., PS7-3.pdf) but Canvas references a base name (PS7.pdf), apply the display-vs-link naming convention.
If a submission.yml already exists somewhere in the source (e.g., from a previous Canvas export extraction), copy it into the assignment folder. Otherwise, extract it from the Canvas HTML file using convert_canvas_submission.py. See the Submission metadata file section for the invocation pattern (here-string for stdin, stderr redirect for output).
When populating multiple assignments at once from a shared source directory, first explore the source layout thoroughly, then combine copy operations into loops:
# Explore source layout first
tree <source> -L 3
# Then adapt loops to the actual layout
for N in $(seq <first> <last>); do
cp <source>/<path-to-solution-files> assignments/problem\ set\ $N/solution/
done
Validate each loop's output before proceeding to the next.
Some leaf folders represent a single Canvas or LMS assignment-like artifact, such as a lab round, homework, project milestone, or similar deliverable page with local attachments. Canvas quizzes are the main exception: keep quiz notes in questions/quiz N.md (and the mirrored private quiz file when archived) rather than in assignments/online quiz N/index.md.
Follow existing conventions — before creating a leaf index page, check an existing leaf index from the same course for section ordering, metadata style, and companion page patterns. The rules below describe the standard form, but the course may have established variations (e.g., extra sections, different heading levels) that should be preserved for consistency.
Use these rules when the source is a Canvas assignment HTML page:
<span style> and use Markdown for bold, italics,
links, paragraphing, and line breaks.## description, not as a
Markdown heading. The first property in that section should be exactly
- title: <Canvas title header verbatim>.Due or locked at; use an ISO datetime range and append , <ISO duration> when both endpoints are known; use an ISO duration for pure
durations. If only the closing endpoint is known, prefer a key such as
- Available until: 2026-04-09T13:30:59+08:00 rather than a human-readable
phrase. Canvas start timestamps should use seconds :00; Canvas end
timestamps should use seconds :59.## description. Keep description prose verbatim even
when it contains human-readable dates or times, such as This assignment was locked Mar 5 at 1:30pm. or colored Due on notice text copied from Canvas.
The normalized metadata bullets should carry the machine-readable timing,
while the surrounding Canvas wording stays as originally shown.--- after the parent line), ## children,
## description, ## attachments, ## submission, and ## solution.## logistics and ## overview sections on these pages.attachments/
files. Apply the same display-vs-link convention: display the Canvas PDF
name but link to the actual on-disk file if they differ.## submission and ## solution empty until actual repository
content is provided.attachments/ folder and move only
submission or solution artifacts into the mirrored private/ subtree.## solution the same way as
## attachments: use a plain markdown file list such as
- [HW1_Sol.pdf](solution/HW1_Sol.pdf).#### Submission section and the
solution and attachment rules). The leaf ## submission /
## solution sections behave identically to the standard assignment
pattern.When an assignment-style leaf folder also has companion pages such as lab.md, prelab.md, submission.md, or similar pages:
index.md own the Canvas wording, logistics, availability, file types,
and attachments list.lab.md, prelab.md, and similar pages.attachments/, or submission records instead.lab.md
instead of leaving those results in prelab.md.When updating the course index.md, place assignments/ immediately after ## children and before session entries when the course has an assignments section. This order applies to course-root index.md, not to the assignment-specific assignments/index.md.
Example course index child order:
## children
- [AGENTS](AGENTS.md)
- [assignments](assignments/index.md)
- [questions/](questions/index.md)
- [topic 1](topic%201.md)
- ...
Assignment creation rarely involves creating flashcards in the assignment pages themselves. Flashcards for solution techniques and problem-solving methods belong in the relevant topic notes or question pages. Assignment index pages are reference pages, not learning pages.