matlab-generate-grader-assessments
Generate MATLAB Grader assessment item sets. Use when the user asks to create MATLAB Grader assessment items, generate MATLAB assessment materials, build MATLAB homework assessment items, QTI 3 portable assessment items, or mentions "grader assessment items". Produces complete assessment item folders with description, solution, template, tests, Function call blocks, and optional QTI 3 interchange files.
git clone --depth 1 https://github.com/matlab/agent-skills-playground /tmp/matlab-generate-grader-assessments && cp -r /tmp/matlab-generate-grader-assessments/demos/course-generation/skills/matlab-generate-grader-assessments ~/.claude/skills/matlab-generate-grader-assessmentsSKILL.md
# MATLAB Grader Assessment Item Generator
Generate complete MATLAB Grader assessment item sets in the current agent session. Each assessment item produces
a subfolder with native artifact files (description, solution, template, tests) ready to paste into
MATLAB Grader. Function assessment items also include `function_call.m` for MATLAB Grader's
"Code to call your function" area. An optional QTI 3 interchange package can be created for
portability and sharing.
Terminology note: use "assessment item" in user-facing text. "Problem" may still appear
only in legacy compatibility identifiers or when explaining older MATLAB Grader terminology.
## Input
The user may have provided a learning objective in their request.
If they did not, collect it in Step 1.
## Reference Files
Before generating any artifacts, read the appropriate reference files from the `references/`
directory alongside this skill:
- `references/assessment-item-types.md` — assessment item type definitions, class assessments, output structure
- `references/assessment-research.md` — research-informed formative and summative assessment method
- `references/options-prompt.md` — how to generate assessment item options
- `references/description-prompt.md` — how to generate descriptions (by assessment item type)
- `references/solution-prompt.md` — how to generate solutions (by assessment item type)
- `references/template-prompt.md` — how to generate templates (by assessment item type)
- `references/function-call-prompt.md` — how to generate the student call block for Function assessment items
- `references/tests-prompt.md` — how to generate test cases (by assessment item type)
- `references/qti3-prompt.md` — how to generate optional QTI 3 item and manifest files
Read `references/assessment-item-types.md` and `references/assessment-research.md` now to load the
type definitions and assessment method.
## Pipeline Overview
```
Step 1: Collect inputs (objective, assessment item type, class assessment if applicable, assessment purpose, output format)
Step 2: Generate 4 assessment item options (varied difficulty)
Step 3: User selects which assessment items to develop
Step 4: For each selected assessment item, generate artifacts sequentially
Step 5: Write files to output subfolders and optional QTI 3 package
```
---
## Step 1: Collect Inputs
If the user provided a learning objective, confirm it. Otherwise, ask for one.
Collect the following one at a time:
### 1a. Learning Objective
If the user has not already provided one, ask: "What is the learning objective for these MATLAB Grader assessment items?"
### 1b. Assessment Item Type
Ask the user to choose an assessment item type:
- **Script** — student submits a .m script; assessed by workspace variables
- **Function** — student submits a .m function; assessed by input/output values
- **Class** — student submits a classdef .m file; assessed via instantiation
- **Object usage** — student submits a .m script that uses a provided class
### 1c. Class Assessment (only if assessment item type is Class)
If the user chose "Class", ask which aspect to assess:
1. Constructor - property assignment (blank: obj.prop = arg lines)
2. Constructor - computed property (blank: derived property computation)
3. Instance method (blank: method body)
4. Constant property (blank: value in properties (Constant) block)
5. Operator overloading (blank: overloaded operator method body)
### 1d. Number of Options
Ask: "How many assessment item options should I generate? (default: 4)"
Accept 2-6. Default to 4 if the user just presses enter or says "default".
### 1e. Output Directory
Ask: "Where should I write the assessment item folders? (default: current directory)"
Default to the current working directory. The user can specify a path.
### 1f. Assessment Purpose
Ask: "Is this assessment primarily formative, summative, or both? (default: summative)"
Default to:
- Formative if the user says practice, feedback, homework draft, tutoring, self-check,
revision, lab prep, or low-stakes.
- Summative if the user says exam, grade, final submission, high-stakes,
or does not specify.
- Both if the user explicitly wants practice and grading reuse.
Use `references/assessment-research.md` to apply the correct design rules:
- Formative: smaller scope, self-checks, diagnostic test names, and feedback-oriented
evidence.
- Summative: objective-aligned independent tests, randomized hardcoding detection,
edge cases, and minimal answer-revealing hints.
- Both: formative self-checks plus summative-grade tests.
### 1g. Optional QTI 3 Export
Ask: "Should I also create QTI 3 interchange files for portability? (default: no)"
Default to no unless the user asks for QTI, portability, standards-based assessment items,
interchange files, import/export payloads, or sharing between instructional designers.
If enabled, tell the user:
"I will create the normal MATLAB Grader files plus a QTI 3 package. The QTI files preserve
the prompt, template, function call block when applicable, solution, tests, and metadata for interchange; they do not make a
generic QTI player execute MATLAB grading logic."
---
## Step 2: Generate Assessment Item Options
Read `references/options-prompt.md` to construct the prompt.
Build the system prompt by:
1. Starting with the base system prompt from the reference
2. Replacing {NUM_OPTIONS} with the user's choice
3. Appending the assessment-item-type-specific note (Class, Function, Object usage, or nothing for Script)
Build the user message with the learning objective and assessment item type.
Use the assessment purpose to vary options:
- Formative options should be short, diagnosable, and suitable for revision.
- Summative options should measure a clear objective with reproducible evidence and
enough complexity to distinguish levels of mastery.
- Both should be usable for practice first and grading later.
**You ARE the AI generating these options.** Do not make an API call. Instead, directly generate>
Use this skill when the user wants to author, design, scope, or refine an Agent Skill (a SKILL.md file). Trigger phrases include "build a new skill", "design an agent skill", "scope a SKILL.md", "how should I structure this skill", "write a skill for X", "my skill isn't working well", or any request to improve an existing SKILL.md. Walks the user through an empirical, test-first process — probe the agent for real failures, design only for genuine knowledge gaps, iterate against runnable examples, and verify across models.
Use this skill for any work involving a MATLAB Project (.prj file) — creating a new project, tracking files, managing the project path, configuring Simulink cache and code-generation folders, running project health checks, or writing build scripts that keep the project in sync with the file system. Trigger phrases include "set up a MATLAB project", "create a .prj", "track this file in the project", "project health check", "build script conventions". This skill is the generic foundation; domain-specific skills (e.g. `mbse-workflow`) build on it.
Use this skill for the architecture phases of an MBSE workflow in MATLAB, when writing idempotent buildXxx.m scripts that produce a three-layer RFLPV architecture (Functional, Logical, Physical) with interface dictionaries, stereotype profiles, allocation sets, and requirements Implement links. Trigger for defining stereotype properties, functional-to-logical / logical-to-physical allocation, mapping requirements to components via slreq Implement links, or running quantitative roll-up analysis on the architecture. Do NOT trigger for ad-hoc structural edits to an already-built System Composer model (adding one component, rewiring a port) — use `building-simulink-models` with `model_edit` for that. Works alongside the `system-composer` skill for detailed SC API patterns.
Use this skill for guided MBSE work in MATLAB — starting a new project, resuming work mid-workflow on an existing project, or answering orientation questions about how the MBSE skills fit together. Trigger when the user says they want to create, start, or set up a new MBSE project; work on a model-based systems engineering / RFLPV project; or asks which skill covers which phase. Walks through phases one at a time — propose → approve → generate → run → confirm. Use proactively whenever someone mentions starting or continuing an MBSE project.
Use this skill for all requirements-related work in a MATLAB MBSE project using the Requirements Toolbox (slreq). Covers creating and populating requirement sets, derivation links, test case requirements, verification coverage, reading and tracing links across requirement sets and models, checking link health, allocating requirements to components (Implement links), and building traceability reports. Trigger when the user asks about slreq API, slreqx files, slmx link files, outLinks/inLinks, traceability matrices, coverage analysis, broken links, or mapping requirements to architecture components. Use proactively for any requirements or traceability task.
Use this skill when authoring reusable, idempotent MATLAB scripts that build System Composer architecture models via the architecture-modeling API — `systemcomposer.createModel`, `addComponent`, `addPort`, `setInterface`, `connect(srcPort, dstPort)`, interface dictionaries (.sldd) with `addInterface`/`addElement`, profiles/stereotypes with `Profile.createProfile` and `addStereotype`, or `systemcomposer.allocation.createAllocationSet`. Also trigger when debugging these APIs (connections that don't appear, interfaces that don't resolve, profile save errors, `createAllocationSet` signature-mismatch errors). Do NOT trigger for ad-hoc structural edits to an already-built model (adding one SubSystem, rewiring a port) — use `building-simulink-models` with `model_edit` for that.
Optimize MATLAB code for better performance through vectorization, memory management, and profiling. Use when user requests optimization, mentions slow code, performance issues, speed improvements, or asks to make code faster or more efficient.