Standards-Core
What this Skill does
Given one or more PDF textbooks (teacher + student editions), produce:
- coverage_matrix.csv / .json — standard ↔ {taught, practiced, assessed}, intensity, off-grade flags, redundancy.
- evidence.jsonl — for each standard: top page hits with quoted spans and
book_id:page:start:end anchors.
- pages.jsonl — page-level text index (one JSON object per page).
How to run
- Prefer the installed
document-skills/pdf to extract page text and tables. If not present, fall back to pdftotext (if available).
- Build a page index: write
outputs/pages.jsonl with {book_id, page, text}.
- Load a standards pack (YAML) defining standards, grade ranges, and keyword lexicons.
- Run
scripts/align_standards.py to propose hits, then refine with LLM judgments for borderline matches.
- Compute coverage, off-grade %, and redundancy per standard; write to
outputs/coverage.json and outputs/coverage.csv.
- For each standard with a rating, capture ≥1 quoted span + page anchor in
outputs/evidence.jsonl. If none found, mark: "unrated": "evidence not found".
Inputs (ask the user or read CLI args)
- subject: math|ela
- grades: e.g., 3–5
- standards_pack: path to YAML (CCSS or state) with
id, grade, keywords[], anti_keywords[], examples[]
- pdfs: list of files
- out_dir: outputs/
Deterministic first, generative second
- Use Python scripts for parsing, counting, CSV/JSON writing.
- Use the model only for disambiguation (e.g., near-miss span classification) and for short rationales.
Scripts to call
scripts/align_standards.py --pages outputs/pages.jsonl --standards standards/<pack>.yaml --subject {math|ela} --grades <range> --out outputs
Evidence requirements
- Do NOT claim a standard is covered without at least one quoted span and page anchor.
- If evidence is missing, set the status
"unrated": "evidence not found" and surface a TODO.
Minimal standards pack example (save as standards/ccss_math_sample.yaml)
standards:
- id: "3.NF.A.1"
grade: 3
keywords: ["fraction", "equal parts", "numerator", "denominator"]
anti_keywords: ["percent"]
- id: "4.OA.A.3"
grade: 4
keywords: ["multi-step", "word problem", "interpret", "remainders"]
anti_keywords: []
Output file formats
coverage.json
{
"metadata": {
"subject": "math",
"grades": "3-5",
"books": ["math_grade3.pdf"],
"total_standards": 15
},
"standards": [
{
"id": "3.NF.A.1",
"grade": 3,
"taught": true,
"practiced": true,
"assessed": false,
"intensity": "high",
"off_grade_percent": 5,
"redundancy_count": 2,
"evidence_found": true,
"top_pages": [12, 15, 18],
"rationale": "Clear instruction with multi-page practice problems"
},
{
"id": "3.NF.A.1",
"grade": 3,
"taught": false,
"practiced": false,
"assessed": false,
"intensity": "none",
"off_grade_percent": 0,
"redundancy_count": 0,
"evidence_found": false,
"unrated": "evidence not found"
}
],
"summary": {
"total_covered": 12,
"total_uncovered": 3,
"coverage_percent": 80
}
}
evidence.jsonl (one object per line)
{"standard": "3.NF.A.1", "pages": [12, 15, 18], "top_hit": {"page": 12, "book_id": "math_grade3", "quote": "A fraction is an equal part of a whole", "anchor": "math_grade3:12:45:92", "context": "Instruction section on Understanding Fractions"}}
{"standard": "3.NF.A.2", "pages": [20], "top_hit": {"page": 20, "book_id": "math_grade3", "quote": "On a number line, locate 1/2, 1/3, 1/4", "anchor": "math_grade3:20:120:165", "context": "Practice worksheet"}}
{"standard": "4.OA.A.1", "unrated": "evidence not found"}
pages.jsonl (one object per page)
{"book_id": "math_grade3", "page": 1, "text": "Chapter 1: Understanding Numbers... [page content]"}
{"book_id": "math_grade3", "page": 2, "text": "Lesson 1.1: Counting and Place Value... [page content]"}
Workflow example
# 1. Extract and index PDF pages
scripts/align_standards.py --extract-pages math_grade3.pdf --out outputs
# 2. Run standards alignment
scripts/align_standards.py \
--pages outputs/pages.jsonl \
--standards standards/ccss_math_grade3.yaml \
--subject math \
--grades 3 \
--out outputs
# 3. Review outputs
# - outputs/coverage.json
# - outputs/coverage.csv
# - outputs/evidence.jsonl
Error handling
- If a PDF cannot be read, log and skip with a warning.
- If a standards pack is malformed, halt with a descriptive error.
- If no evidence is found for a standard, mark unrated and raise a TODO comment for manual review.
1---2name: standards-core3description: Map K–12 Math/ELA standards (CCSS or state) to pages, lessons, tasks, and assessments in large PDF textbooks. Use when asked to compute alignment coverage, gaps, off-grade content, redundancy, or to output a per-standard evidence matrix with page anchors.4---5
6# Standards-Core
7
8## What this Skill does
9Given one or more PDF textbooks (teacher + student editions), produce:
10- **coverage_matrix.csv / .json** — standard ↔ {taught, practiced, assessed}, intensity, off-grade flags, redundancy.
11- **evidence.jsonl** — for each standard: top page hits with quoted spans and `book_id:page:start:end` anchors.
12- **pages.jsonl** — page-level text index (one JSON object per page).
13
14## How to run
151. Prefer the installed `document-skills/pdf` to extract page text and tables. If not present, fall back to `pdftotext` (if available).
162. Build a page index: write `outputs/pages.jsonl` with {book_id, page, text}.
173. Load a **standards pack** (YAML) defining standards, grade ranges, and keyword lexicons.
184. Run `scripts/align_standards.py` to propose hits, then refine with LLM judgments for borderline matches.
195. Compute coverage, off-grade %, and redundancy per standard; write to `outputs/coverage.json` and `outputs/coverage.csv`.
206. For each standard with a rating, capture ≥1 quoted span + page anchor in `outputs/evidence.jsonl`. If none found, mark: `"unrated": "evidence not found"`.
21
22## Inputs (ask the user or read CLI args)
23- subject: math|ela
24- grades: e.g., 3–5
25- standards_pack: path to YAML (CCSS or state) with `id`, `grade`, `keywords[]`, `anti_keywords[]`, `examples[]`
26- pdfs: list of files
27- out_dir: outputs/
28
29## Deterministic first, generative second
30- Use Python scripts for parsing, counting, CSV/JSON writing.
31- Use the model only for disambiguation (e.g., near-miss span classification) and for short rationales.
32
33## Scripts to call
34- `scripts/align_standards.py --pages outputs/pages.jsonl --standards standards/<pack>.yaml --subject {math|ela} --grades <range> --out outputs`
35
36## Evidence requirements
37- Do NOT claim a standard is covered without at least one quoted span and page anchor.
38- If evidence is missing, set the status `"unrated": "evidence not found"` and surface a TODO.
39
40## Minimal standards pack example (save as standards/ccss_math_sample.yaml)
41```yaml
42standards:
43 - id: "3.NF.A.1"
44 grade: 3
45 keywords: ["fraction", "equal parts", "numerator", "denominator"]
46 anti_keywords: ["percent"]
47 - id: "4.OA.A.3"
48 grade: 4
49 keywords: ["multi-step", "word problem", "interpret", "remainders"]
50 anti_keywords: []
51```
52
53## Output file formats
54
55### coverage.json
56```json
57{
58 "metadata": {
59 "subject": "math",
60 "grades": "3-5",
61 "books": ["math_grade3.pdf"],
62 "total_standards": 15
63 },
64 "standards": [
65 {
66 "id": "3.NF.A.1",
67 "grade": 3,
68 "taught": true,
69 "practiced": true,
70 "assessed": false,
71 "intensity": "high",
72 "off_grade_percent": 5,
73 "redundancy_count": 2,
74 "evidence_found": true,
75 "top_pages": [12, 15, 18],
76 "rationale": "Clear instruction with multi-page practice problems"
77 },
78 {
79 "id": "3.NF.A.1",
80 "grade": 3,
81 "taught": false,
82 "practiced": false,
83 "assessed": false,
84 "intensity": "none",
85 "off_grade_percent": 0,
86 "redundancy_count": 0,
87 "evidence_found": false,
88 "unrated": "evidence not found"
89 }
90 ],
91 "summary": {
92 "total_covered": 12,
93 "total_uncovered": 3,
94 "coverage_percent": 80
95 }
96}
97```
98
99### evidence.jsonl (one object per line)
100```jsonl
101{"standard": "3.NF.A.1", "pages": [12, 15, 18], "top_hit": {"page": 12, "book_id": "math_grade3", "quote": "A fraction is an equal part of a whole", "anchor": "math_grade3:12:45:92", "context": "Instruction section on Understanding Fractions"}}
102{"standard": "3.NF.A.2", "pages": [20], "top_hit": {"page": 20, "book_id": "math_grade3", "quote": "On a number line, locate 1/2, 1/3, 1/4", "anchor": "math_grade3:20:120:165", "context": "Practice worksheet"}}
103{"standard": "4.OA.A.1", "unrated": "evidence not found"}
104```
105
106### pages.jsonl (one object per page)
107```jsonl
108{"book_id": "math_grade3", "page": 1, "text": "Chapter 1: Understanding Numbers... [page content]"}
109{"book_id": "math_grade3", "page": 2, "text": "Lesson 1.1: Counting and Place Value... [page content]"}
110```
111
112## Workflow example
113```bash
114# 1. Extract and index PDF pages
115scripts/align_standards.py --extract-pages math_grade3.pdf --out outputs
116
117# 2. Run standards alignment
118scripts/align_standards.py \
119 --pages outputs/pages.jsonl \
120 --standards standards/ccss_math_grade3.yaml \
121 --subject math \
122 --grades 3 \
123 --out outputs
124
125# 3. Review outputs
126# - outputs/coverage.json
127# - outputs/coverage.csv
128# - outputs/evidence.jsonl
129```
130
131## Error handling
132- If a PDF cannot be read, log and skip with a warning.
133- If a standards pack is malformed, halt with a descriptive error.
134- If no evidence is found for a standard, mark unrated and raise a TODO comment for manual review.