Lucasuiii/modeling-workbench / .agents/skills/cumcm-workflow
cumcm-workflow
VerifiedBuild or resume mathematical-modeling competition work, including CUMCM, MCM/ICM, graduate and regional contests, data challenges, and open-topic statistical modeling. Guide problem framing, modeling, computation, validation, Chinese or English LaTeX writing, and reviewed PDF/source delivery using current official requirements. Not for ordinary paper polishing.
scripts/official_materials.py
View on GitHub#!/usr/bin/env python3
"""Classify user-supplied official paper materials by their declared role."""
from __future__ import annotations
import re
from typing import Any, Iterable
TEMPLATE_ROLES = {
"paper_template",
"format_template",
"paper_format_template",
"official_submission_template",
"论文格式模板",
"格式模板",
"official_paper_template",
"latex_template",
"word_template",
"submission_template",
"论文模板",
"官方论文模板",
"提交模板",
}
RULE_ROLES = {
"paper_format",
"format_rule",
"format_rules",
"format_requirements",
"formatting_instructions",
"submission_rule",
"submission_rules",
"competition_rule",
"competition_rules",
"论文格式",
"格式要求",
"格式说明",
"提交规则",
"比赛规则",
}
FORMAT_NAME_HINTS = ("format", "rule", "template", "格式", "规则", "模板")
def normalize_role(value: Any) -> str:
text = str(value).strip().casefold()
return re.sub(r"[\s\-/]+", "_", text)
def declared_roles(source: dict[str, Any]) -> set[str]:
values: list[Any] = []
for key in ("artifact_role", "material_role", "role"):
if source.get(key) not in (None, ""):
values.append(source[key])
authoritative = source.get("authoritative_for")
if isinstance(authoritative, list):
values.extend(authoritative)
elif authoritative not in (None, ""):
values.append(authoritative)
return {normalize_role(value) for value in values if str(value).strip()}
def classify_official_material(source: dict[str, Any]) -> str | None:
"""Return the paper-facing role without treating a filename as authority."""
if source.get("origin") not in {"official", "organizer_attachment"}:
return None
roles = declared_roles(source)
if roles & {normalize_role(value) for value in TEMPLATE_ROLES}:
return "paper_template"
if roles & {normalize_role(value) for value in RULE_ROLES}:
return "format_or_submission_rule"
# A filename hint is useful for routing, but is not strong enough to make a
# PDF/DOC/DOCX block generic initialization as if it were an adaptable template.
name = str(source.get("path", "")).casefold()
if any(token in name for token in FORMAT_NAME_HINTS):
return "unclassified_format_material"
return None
def classified_official_materials(sources: Iterable[Any]) -> list[dict[str, Any]]:
records: list[dict[str, Any]] = []
for source in sources:
if not isinstance(source, dict):
continue
role = classify_official_material(source)
if role is None:
continue
records.append(
{
"source_id": source.get("source_id"),
"path": source.get("path"),
"role": role,
"authoritative_for": source.get("authoritative_for", []),
}
)
return sorted(records, key=lambda item: str(item.get("path", "")))
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |