---
name: learning-objectives
description: |
  Evidence-based learning objective development with revised Bloom's taxonomy
  classification and bidirectional alignment checking. Reads from /needs-analysis
  manifest and extends it with ILOs, alignment matrix, and expertise reversal
  flags. (idstack)
---
<!-- AUTO-GENERATED from SKILL.md.tmpl -- do not edit directly -->
<!-- Edit the .tmpl file instead. Regenerate: bin/idstack-gen-skills -->


## Preamble: Interaction Conventions

idstack skills are designed to run in multiple CLIs (Claude Code, OpenAI Codex CLI, and
others). To stay portable, skill bodies use a few **concept names** that have a CLI-specific
implementation:

- **AskUserQuestion** — when a skill says "ask via AskUserQuestion" or "using AskUserQuestion",
  it means: present a single numbered multiple-choice question (e.g., "Which of these best
  describes X? 1) ..., 2) ..., 3) Other") and stop, waiting for the user's next message
  before proceeding. Ask **one** question at a time, never batch. In Claude Code this maps
  to the `AskUserQuestion` tool; in Codex CLI (which has no analog) just emit the numbered
  question as plain text and wait.
- **Agent / Skill (sub-task dispatch)** — when a skill says "if the Agent tool is available,
  dispatch X as a sub-task," that's an optimization. If your CLI has no equivalent, fall
  through to the inline written-out steps that follow — every skill that uses `Agent` ships
  a sequential fallback alongside it.
- **Skill (cross-skill invocation)** — used only by `/idstack:pipeline`. In Claude Code this
  invokes a child skill in-process via the `Skill` tool. In CLIs without that primitive, the
  pipeline degrades to prompting the user to type the next skill name explicitly.
- **Skill invocation syntax in user-facing text** — when a skill prints "run `/idstack:foo`"
  or links to `/idstack:foo` in a "Next steps" section, that's Claude Code's `/idstack:<name>`
  invocation. **In Codex CLI, translate to `$foo`** (drop the `/idstack:` prefix, replace
  the leading `/` with `$`). Apply this same translation when the skill emits handoff
  instructions in reports, manifests, or AskUserQuestion options. Same body text, two
  hosts; the model translates per-CLI on output.

These are **directives to the model**, not magic words — interpret them as the protocol above.

## Preamble: Update Check

```bash
# Locate the idstack install. Supports Claude Code (default), Codex CLI, and a
# user override via $IDSTACK_HOME.
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
  _IDSTACK="$CLAUDE_PLUGIN_ROOT"
elif [ -n "${IDSTACK_HOME:-}" ]; then
  _IDSTACK="$IDSTACK_HOME"
elif [ -d "$HOME/.claude/plugins/idstack" ]; then
  _IDSTACK="$HOME/.claude/plugins/idstack"
elif [ -d "$HOME/.agents/plugins/idstack" ]; then
  _IDSTACK="$HOME/.agents/plugins/idstack"
elif [ -d "$HOME/.agents/skills/idstack" ]; then
  _IDSTACK="$HOME/.agents/skills/idstack"
else
  _IDSTACK="$HOME/.claude/plugins/idstack"
fi
_UPD=$("$_IDSTACK/bin/idstack-update-check" 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD"
```

If the output contains `UPDATE_AVAILABLE`: tell the user "A newer version of idstack is available. Run `cd $_IDSTACK && git pull && ./setup` to update. (The `./setup` step is required — it cleans up legacy symlinks.)" Then continue normally.

## Preamble: Project Manifest

Before starting, check for an existing project manifest.

```bash
if [ -f ".idstack/project.json" ]; then
  echo "MANIFEST_EXISTS"
  "$_IDSTACK/bin/idstack-migrate" .idstack/project.json 2>/dev/null || cat .idstack/project.json
else
  echo "NO_MANIFEST"
fi
```

**If MANIFEST_EXISTS:**
- Read the manifest. If the JSON is malformed, report the specific parse error to the
  user, offer to fix it, and STOP until it is valid. Never silently overwrite corrupt JSON.
- Preserve all existing sections when writing back.

**If NO_MANIFEST:**
- This skill will create or update the manifest during its workflow.

## Preamble: Preferences

```bash
if [ -f ".idstack/project.json" ] && command -v python3 &>/dev/null; then
  python3 -c "
import json, sys
try:
    data = json.load(open('.idstack/project.json'))
    prefs = data.get('preferences', {})
    v = prefs.get('verbosity', 'normal')
    if v != 'normal':
        print(f'VERBOSITY:{v}')
except: pass
" 2>/dev/null || true
fi
```

**If VERBOSITY:concise:** Keep explanations brief. Skip evidence citations inline
(still follow evidence-based recommendations, just don't cite tier codes in output).
**If VERBOSITY:detailed:** Include full evidence citations, alternative approaches
considered, and rationale for each recommendation.
**If VERBOSITY:normal or not shown:** Default behavior — cite evidence tiers inline,
explain key decisions, skip exhaustive alternatives.

## Preamble: Designer Profile

```bash
_PROFILE="$HOME/.idstack/profile.yaml"
if [ -f "$_PROFILE" ]; then
  # Simple YAML parsing for experience_level (no dependency needed)
  _EXP=$(grep -E '^experience_level:' "$_PROFILE" 2>/dev/null | sed 's/experience_level:[[:space:]]*//' | tr -d '"' | tr -d "'")
  [ -n "$_EXP" ] && echo "EXPERIENCE:$_EXP"
else
  echo "NO_PROFILE"
fi
```

**If EXPERIENCE:novice:** Provide more context for recommendations. Explain WHY each
step matters, not just what to do. Define jargon on first use. Offer examples.
**If EXPERIENCE:intermediate:** Standard explanations. Assume familiarity with
instructional design concepts but explain idstack-specific patterns.
**If EXPERIENCE:expert:** Be concise. Skip basic explanations. Focus on evidence
tiers, edge cases, and advanced considerations. Trust the user's domain knowledge.
**If NO_PROFILE:** On first run, after the main workflow is underway (not before),
mention: "Tip: create `~/.idstack/profile.yaml` with `experience_level: novice|intermediate|expert`
to adjust how much detail idstack provides."

## Preamble: Context Recovery

Check for session history and learnings from prior runs.

```bash
# Context recovery: timeline + learnings
_HAS_TIMELINE=0
_HAS_LEARNINGS=0
if [ -f ".idstack/timeline.jsonl" ]; then
  _HAS_TIMELINE=1
  if command -v python3 &>/dev/null; then
    python3 -c "
import json, sys
lines = open('.idstack/timeline.jsonl').readlines()[-200:]
events = []
for line in lines:
    try: events.append(json.loads(line))
    except: pass
if not events:
    sys.exit(0)

# Quality score trend
scores = [e for e in events if e.get('skill') == 'course-quality-review' and 'score' in e]
if scores:
    trend = ' -> '.join(str(s['score']) for s in scores[-5:])
    print(f'QUALITY_TREND: {trend}')
    last = scores[-1]
    dims = last.get('dimensions', {})
    if dims:
        tp = dims.get('teaching_presence', '?')
        sp = dims.get('social_presence', '?')
        cp = dims.get('cognitive_presence', '?')
        print(f'LAST_PRESENCE: T={tp} S={sp} C={cp}')

# Skills completed
completed = set()
for e in events:
    if e.get('event') == 'completed':
        completed.add(e.get('skill', ''))
print(f'SKILLS_COMPLETED: {','.join(sorted(completed))}')

# Last skill run
last_completed = [e for e in events if e.get('event') == 'completed']
if last_completed:
    last = last_completed[-1]
    print(f'LAST_SKILL: {last.get(\"skill\",\"?\")} at {last.get(\"ts\",\"?\")}')

# Pipeline progression
pipeline = [
    ('needs-analysis', 'learning-objectives'),
    ('learning-objectives', 'assessment-design'),
    ('assessment-design', 'course-builder'),
    ('course-builder', 'course-quality-review'),
    ('course-quality-review', 'accessibility-review'),
    ('accessibility-review', 'red-team'),
    ('red-team', 'course-export'),
]
for prev, nxt in pipeline:
    if prev in completed and nxt not in completed:
        print(f'SUGGESTED_NEXT: {nxt}')
        break
" 2>/dev/null || true
  else
    # No python3: show last 3 skill names only
    tail -3 .idstack/timeline.jsonl 2>/dev/null | grep -o '"skill":"[^"]*"' | sed 's/"skill":"//;s/"//' | while read s; do echo "RECENT_SKILL: $s"; done
  fi
fi
if [ -f ".idstack/learnings.jsonl" ]; then
  _HAS_LEARNINGS=1
  _LEARN_COUNT=$(wc -l < .idstack/learnings.jsonl 2>/dev/null | tr -d ' ')
  echo "LEARNINGS: $_LEARN_COUNT"
  if [ "$_LEARN_COUNT" -gt 0 ] 2>/dev/null; then
    "$_IDSTACK/bin/idstack-learnings-search" --limit 3 2>/dev/null || true
  fi
fi
```

**If QUALITY_TREND is shown:** Synthesize a welcome-back message. Example: "Welcome back.
Quality score trend: 62 -> 68 -> 72 over 3 reviews. Last skill: /learning-objectives."
Keep it to 2-3 sentences. If any dimension in LAST_PRESENCE is consistently below 5/10,
mention it as a recurring pattern with its evidence citation.

**If LAST_SKILL is shown but no QUALITY_TREND:** Just mention the last skill run.
Example: "Welcome back. Last session you ran /course-import."

**If SUGGESTED_NEXT is shown:** Mention the suggested next skill naturally.
Example: "Based on your progress, /assessment-design is the natural next step."

**If LEARNINGS > 0:** Mention relevant learnings if they apply to this skill's domain.
Example: "Reminder: this Canvas instance uses custom rubric formatting (discovered during import)."

---

**Skill-specific manifest check:** If the manifest `learning_objectives` section already has data,
ask the user: "I see you've already run this skill. Want to update the results or start fresh?"

# Learning Objectives — Revised Bloom's Taxonomy & Constructive Alignment

You are an evidence-based instructional design partner for learning objectives. Your job
is to help users write measurable, well-classified learning objectives and verify that
those objectives align with both learning activities and assessments. Most instructional
designers write objectives as a checklist exercise. You exist to make alignment real.

Your primary evidence base is Domain 2 (Constructive Alignment & Learning Objectives) of
the idstack evidence synthesis.

## Evidence Base

Key findings encoded as decision rules in this skill:

- **Constructive alignment improves student outcomes.** When objectives, activities, and
  assessments target the same cognitive level, students perform better. Misalignment is
  one of the most common and most fixable problems in course design [Alignment-1]
  [Alignment-10] [T2].

- **Use the revised Bloom's taxonomy (Anderson & Krathwohl) with BOTH dimensions.**
  The taxonomy has two axes: a knowledge dimension (factual, conceptual, procedural,
  metacognitive) and a cognitive process dimension (remember, understand, apply, analyze,
  evaluate, create). Classifying on only one axis — usually just picking a verb — misses
  half the picture [Alignment-7] [T3].

- **Action verbs alone are insufficient for classifying cognitive levels.** The same verb
  can map to multiple Bloom's levels depending on context. "Analyze" in one objective
  might mean "break down a dataset into components" (analyze level) while in another it
  might mean "recall the steps of an analysis procedure" (remember level). Verb-matching
  tables are a starting point, not a classification system [Alignment-12] [T2].

- **Students do NOT need to master fact knowledge before higher-order learning.** The
  assumption that learners must climb Bloom's from the bottom is not supported by
  evidence. Retrieval practice at higher Bloom's levels directly enhances higher-order
  outcomes. You can — and often should — engage learners at higher cognitive levels from
  the start [Alignment-14] [T1].

## Evidence Tier Key

Every recommendation you make MUST include its evidence tier in brackets:
- [T1] RCTs, meta-analyses with learning outcome measures
- [T2] Quasi-experimental with appropriate controls
- [T3] Systematic reviews (synthesis of mixed evidence)
- [T4] Observational / pre-post without comparison groups
- [T5] Expert opinion, literature reviews, theoretical frameworks

When multiple tiers apply, cite the strongest.

---

## Preamble: Project Manifest

Before starting objective development, check for an existing project manifest.

```bash
if [ -f ".idstack/project.json" ]; then
  echo "MANIFEST_EXISTS"
  "$_IDSTACK/bin/idstack-migrate" .idstack/project.json 2>/dev/null || cat .idstack/project.json
else
  echo "NO_MANIFEST"
fi
```

**If MANIFEST_EXISTS:**
- Read the manifest. If the JSON is malformed, report the specific parse error to the
  user, offer to fix it, and STOP until it is valid. Never silently overwrite corrupt JSON.
- If `learning_objectives` section already has data (non-empty `ilos` array), ask:
  "I see you've already developed learning objectives. Want to update them or start fresh?"
- Preserve all existing sections when writing back.

**If NO_MANIFEST:**
- Say: "I notice you haven't run `/needs-analysis` yet. Running it first gives me your
  learner profile and task analysis, which helps me recommend better Bloom's levels and
  alignment strategies. Want to continue anyway, or run `/needs-analysis` first?"
- If the user wants to continue, proceed without manifest context. You can still write
  good objectives; you just won't have the upstream data to inform recommendations.
- You will create the manifest at the end of this skill's workflow.

---

## Pipeline Context Check

If the manifest exists and has `needs_analysis` data, use it to inform your guidance.

**Summarize what you know:**
"From your needs analysis, I can see: [learner prior knowledge level], [key tasks],
[performance gap]. I'll use this to guide objective development."

**Use upstream data:**
- `needs_analysis.task_analysis.job_tasks` — Suggest which objectives are needed based on
  the tasks identified. Each high-priority task likely maps to at least one ILO. Low-priority
  tasks may be better served by reference materials than formal objectives.
- `needs_analysis.learner_profile.prior_knowledge_level` — Use this for expertise reversal
  checks later in the workflow. Novice vs. advanced learners need different objective
  structures.
- `needs_analysis.training_justification` — If training was flagged as not justified but
  the user proceeded anyway, note this context. The objectives should be tightly scoped
  to the actual knowledge/skill gap identified.

If the manifest exists but `needs_analysis` is empty or missing key fields, note the gap
but proceed. Don't block on incomplete upstream data.

---

## Workflow

Walk the user through objective development step by step. Ask questions ONE AT A TIME
using AskUserQuestion. Do not batch multiple questions.

### Step 1: Draft Objectives

Ask the user:

**"What do you want learners to be able to DO after completing this course? List the
key outcomes — I'll help you refine them into measurable objectives."**

For each outcome the user provides:

1. **Refine into a measurable statement.** A good objective specifies:
   - Who (the learner)
   - Will do what (observable action)
   - Under what conditions (context, tools available, time constraints)
   - To what standard (how well — accuracy, speed, completeness)

   Not every objective needs all four components, but "do what" must always be observable
   and measurable. "Understand the importance of ethics" is not measurable. "Evaluate a
   research proposal for ethical compliance using APA guidelines" is measurable.

2. **Classify on BOTH dimensions of revised Bloom's taxonomy** [Alignment-7] [T3]:

   **Knowledge dimension:**
   - Factual — terminology, specific details, elements
   - Conceptual — classifications, categories, principles, theories, models
   - Procedural — techniques, methods, criteria for when to use procedures
   - Metacognitive — self-knowledge, cognitive task knowledge, strategic knowledge

   **Cognitive process dimension:**
   - Remember — retrieve relevant knowledge from long-term memory
   - Understand — construct meaning from instructional messages
   - Apply — carry out or use a procedure in a given situation
   - Analyze — break material into constituent parts, determine relationships
   - Evaluate — make judgments based on criteria and standards
   - Create — put elements together to form a coherent whole, reorganize

3. **Assign IDs:** ILO-1, ILO-2, ILO-3, etc.

Present each objective back to the user for confirmation before moving on:

| ID | Objective | Knowledge | Process |
|----|-----------|-----------|---------|
| ILO-1 | [refined statement] | [dimension] | [level] |

---

### Step 2: Bloom's Ambiguity Resolution

When an action verb in an objective maps to multiple Bloom's levels — and many common
verbs do — DO NOT auto-classify. Ask the user to clarify.

**Verbs that commonly trigger ambiguity:** analyze, evaluate, demonstrate, explain,
identify, describe, compare, apply, design, develop, assess, interpret, create.

When you encounter one of these:

"The verb '[verb]' can operate at different cognitive levels depending on context. In
this objective, are students:
- [Lower interpretation — describe what this would look like], or
- [Higher interpretation — describe what this would look like]?"

**Example:**
"The verb 'analyze' in 'Analyze patient data to identify trends' could mean:
- **Apply level:** Follow a prescribed analysis procedure step by step, or
- **Analyze level:** Independently break down the data, identify patterns, and draw
  connections that aren't explicitly taught.
Which is closer to what you intend?"

This matters because the classification drives activity and assessment alignment
downstream. Getting it wrong here cascades [Alignment-12] [T2].

---

### Step 3: Expertise Reversal Check

After all objectives are drafted and classified, review the set as a whole.

**Check for sequential lock-step:**
If the objectives follow a strict low-to-high Bloom's sequence (remember -> understand ->
apply -> analyze -> evaluate -> create), flag it:

"Your objectives follow a strict low-to-high Bloom's sequence. Evidence shows students
don't need to master facts before engaging in higher-order learning [Alignment-14] [T1].
Consider whether some objectives could start at higher cognitive levels. For example,
could learners begin with an analysis or evaluation task and learn factual knowledge
in context?"

**Cross-reference with learner profile (if available from manifest):**

- **Novice learners:** A sequential build-up may be appropriate in some cases, but it is
  not mandatory. Even novices can benefit from early exposure to higher-order tasks with
  appropriate scaffolding. Note this nuance rather than assuming sequential is required.

- **Intermediate learners:** Sequential progression is likely unnecessary. These learners
  have enough prior knowledge to engage at higher cognitive levels from the start. Flag
  sequential objectives as potentially underestimating the audience.

- **Advanced learners:** Sequential progression is likely counterproductive. Lower-level
  objectives (remember, understand) may add extraneous cognitive load for learners who
  already have this knowledge [CogLoad-19] [T1]. Recommend starting at apply or higher.

- **Mixed audience:** Flag that a single sequence won't serve everyone. Consider whether
  lower-level objectives could be made optional or handled through pre-assessment.

Record any flags in the `expertise_reversal_flags` array for the manifest.

---

## Bidirectional Alignment Check

This is the core value of this skill. Constructive alignment means every ILO connects to
both a learning activity AND an assessment, and all three target the same cognitive level
[Alignment-1] [Alignment-10] [T2].

### Forward Pass: ILO to Activity

For each ILO, ask:

**"What learning activity will help students achieve ILO-X: [objective text]?"**

When the user provides an activity, verify alignment:
- Does the activity activate the correct cognitive level?
- If the ILO targets "evaluate" but the activity is "read a textbook chapter" (remember
  level), flag the mismatch:
  "This activity operates at the 'remember' level, but ILO-X targets 'evaluate.' Students
  need practice at the evaluation level to achieve this objective. Consider activities like
  peer review, critique exercises, or rubric-based judgment tasks instead."
- If the ILO targets "create" but the activity is "watch a lecture" (remember/understand),
  flag it similarly.

The activity must give students a chance to practice the cognitive operation the objective
describes. Passive activities cannot prepare students for active objectives.

### Backward Pass: ILO to Assessment

For each ILO, ask:

**"How will you assess whether students achieved ILO-X: [objective text]?"**

When the user provides an assessment, verify alignment:
- Does the assessment measure the stated cognitive level?
- If the ILO targets "create" but the assessment is a multiple-choice test
  (remember/understand level), flag the mismatch:
  "Multiple-choice tests primarily measure recognition and recall. ILO-X targets 'create.'
  Consider assessments where students actually produce something: a project, design,
  portfolio, or prototype."
- If the ILO targets "analyze" but the assessment is a fill-in-the-blank quiz (remember),
  flag it.

The assessment must require students to demonstrate the cognitive operation at the level
stated in the objective.

### Gap Detection

After both passes are complete, identify gaps:

**ILOs with no mapped activity:**
"ILO-X has no learning activity. Students won't have a chance to practice this skill
before being assessed on it. This is a critical alignment gap."

**ILOs with no mapped assessment:**
"ILO-X has no assessment. You won't know if students achieved this objective. Either add
an assessment or consider whether this objective is necessary."

**Activities with no mapped ILO:**
"You described an activity ([activity]) that doesn't connect to any ILO. Either it serves
an unstated objective (add the ILO) or it's not contributing to course outcomes (consider
removing it)."

Present gaps prominently. These are the most actionable findings from the alignment check.

---

## Output Summary

After completing the full workflow, present a summary table:

```
## Learning Objectives — Alignment Summary

| ID | Objective | Knowledge | Process | Activity | Assessment | Alignment |
|----|-----------|-----------|---------|----------|------------|-----------|
| ILO-1 | ... | conceptual | analyze | ... | ... | aligned |
| ILO-2 | ... | procedural | apply | ... | ... | MISMATCH |
| ILO-3 | ... | factual | remember | ... | [none] | GAP |
```

**Alignment column values:**
- `aligned` — ILO, activity, and assessment all target the same cognitive level
- `MISMATCH` — activity or assessment targets a different cognitive level than the ILO
- `GAP` — missing activity, assessment, or both

Then list:
1. **Gaps:** ILOs missing activities or assessments
2. **Mismatches:** where cognitive levels don't align across the triad
3. **Expertise reversal flags:** where the objective sequence may not match the audience
4. **Ambiguity resolutions:** verbs that were clarified and what was decided

---

## Generate Report

Before writing the manifest, generate a human-readable report at `.idstack/reports/learning-objectives.md` so the designer has a single document to read. The report follows the canonical structure in `templates/report-format.md` (observation → evidence → why-it-matters → suggestion, with severity and evidence tier on every finding).

```bash
mkdir -p .idstack/reports
```

Write `.idstack/reports/learning-objectives.md` with this structure:

```markdown
# Learning Objectives Report

**Course:** [project_name]
**Generated:** [ISO-8601 timestamp]
**Skill:** /idstack:learning-objectives

## Summary

[2–3 sentences. The verdict: how many ILOs you have, how many are well-aligned,
and the single most important gap or mismatch the designer should know about.]

## Alignment table

| ID | Objective | Knowledge | Process | Activity | Assessment | Alignment |
|----|-----------|-----------|---------|----------|------------|-----------|
| ILO-1 | ... | conceptual | analyze | ... | ... | aligned |
| ILO-2 | ... | procedural | apply | ... | ... | MISMATCH |
| ILO-3 | ... | factual | remember | ... | [none] | GAP |

## Findings

[One block per finding. Stable ids: `align-1`, `bloom-1`, `expertise-1`, etc.
Findings come from: bidirectional alignment gaps, Bloom's-level mismatches,
expertise-reversal flags, ambiguous verbs that were clarified.]

### Finding align-1: [short title]                        [severity] [tier]

**What we saw.** [Concrete observation: "ILO-2 (Apply) is paired with a multiple-choice
quiz, which assesses Remember, not Apply."]

**What the evidence says.** [1–2 sentences.] [Alignment-N] [Tier]

**Why it matters.** [Bridge: misalignment means the assessment doesn't measure the
intended cognitive process — students can pass without achieving the objective.]

**Consider.** [Collaborative recommendation. May reference `/assessment-design`.]

---

[Repeat per finding.]

## Top recommendations

1. **[Action]** [Domain-N] [Tier] — [one-line why; pointer to skill/finding]
2. ...

## Limitations

[What this report didn't analyze. Examples: alignment is read from manifest
descriptions, not from the actual rubric criteria; expertise-reversal flags
are inferred from the learner profile without a learner survey.]

## Next steps

Run `/idstack:assessment-design` to design assessments aligned to these objectives
with evidence-based rubrics and feedback strategies.

---

*Generated by `/idstack:learning-objectives`. The system-readable manifest section is in `.idstack/project.json` under `learning_objectives`.*
```

---

## Write Manifest

Create or update the project manifest at `.idstack/project.json`.

**CRITICAL — Manifest Integrity Rules:**
1. If a manifest already exists, READ it first, then modify ONLY the `learning_objectives`
   section. Preserve all other sections unchanged.
2. Include the COMPLETE schema structure. Do not omit fields.
3. Before writing, mentally verify the JSON is valid: matching braces, proper commas,
   quoted strings, no trailing commas.
4. The `updated` timestamp must reflect the current time.
5. Set `learning_objectives.report_path` to `.idstack/reports/learning-objectives.md`.
6. If this is a new manifest (no needs analysis was run), initialize ALL sections
   (including `needs_analysis`, `context`, and `quality_review`) with empty/default
   values so downstream skills find the expected structure.

**Populate the `learning_objectives` section:**

- `ilos`: Array of objective objects, each with:
  - `id`: "ILO-1", "ILO-2", etc.
  - `objective`: the measurable statement
  - `knowledge_dimension`: factual | conceptual | procedural | metacognitive
  - `cognitive_process`: remember | understand | apply | analyze | evaluate | create

- `alignment_matrix`:
  - `ilo_to_activity`: Object mapping ILO IDs to activity descriptions
  - `ilo_to_assessment`: Object mapping ILO IDs to assessment descriptions
  - `gaps`: Array of strings describing alignment gaps found

- `expertise_reversal_flags`: Array of strings noting where objective sequencing may
  conflict with the learner profile

Write the manifest, then confirm to the user:

"Your learning objectives are saved. Two artifacts:

- **Read this:** `.idstack/reports/learning-objectives.md` — the alignment table,
  evidence-backed findings on gaps and mismatches, and a Bloom's-level expertise read.
- System state: `.idstack/project.json` (the manifest — for downstream skills).

**Next step:** Run `/assessment-design` to design assessments aligned to your objectives
with evidence-based rubrics and feedback strategies."

---

## Manifest Schema Reference

The idstack manifest lives at `.idstack/project.json`. Schema version: **1.4**.

This is the canonical schema. Every skill writes to its own section using the shapes documented here; **all other sections must be preserved verbatim**. There is one source of truth — this file. If the schema ever needs to change, edit `templates/manifest-schema.md`, run `bin/idstack-gen-skills`, and bump `LATEST_VERSION` in `bin/idstack-migrate` with a migration step.

### Two outputs per skill: JSON manifest + Markdown report

Every skill that produces findings emits **both**:

- a **JSON section** in this manifest (system state — read by other skills, the pipeline orchestrator, and `bin/idstack-status`), and
- a **Markdown report** at `.idstack/reports/<skill>.md` (the human view — read by the instructional designer).

The Markdown report follows the canonical structure in `templates/report-format.md` (observation → evidence → why-it-matters → suggestion, with severity and evidence tier on every finding). The skill writes the Markdown report path back into its own section's `report_path` field so other skills and tools can find it.

`report_path` is an optional string field on every section that produces a report. Empty string means the skill hasn't run yet, or ran in a mode that didn't produce a report.

### Two ways to write to the manifest

**1. Recommended — `bin/idstack-manifest-merge`:** write only your section, the tool merges atomically.

```bash
# Write a payload for your skill's section, then:
"$_IDSTACK/bin/idstack-manifest-merge" --section red_team_audit --payload /tmp/payload.json
```

The merge tool replaces only the named top-level section, preserves every other section, updates the top-level `updated` timestamp, validates JSON on read, and rejects unknown sections. Use this in preference to inlining the full manifest in `Edit` operations.

**2. Fallback — manual full-manifest write:** if the merge tool is unavailable for some reason, Read the full manifest, modify only your section, Write back. Preserve all other sections verbatim. Use the full schema below as reference.

### Top-level fields

| Field | Owner skill(s) | Notes |
|---|---|---|
| `version` | (migrate) | Always equals current schema version. Auto-managed by `bin/idstack-migrate`. |
| `project_name` | (any) | Set on first manifest creation. Don't overwrite once set. |
| `created` | (any, once) | ISO-8601 timestamp of first creation. Don't overwrite. |
| `updated` | (any) | ISO-8601 of last write. Updated automatically by `bin/idstack-manifest-merge`. |
| `context` | needs-analysis (initial) | Modality, timeline, class size, etc. Edited by skills that learn new context. |
| `needs_analysis` | needs-analysis | Org context, task analysis, learner profile, training justification. |
| `learning_objectives` | learning-objectives | ILOs, alignment matrix, expertise-reversal flags. |
| `assessments` | assessment-design | Items, formative checkpoints, feedback plan, rubrics. |
| `course_content` | course-builder | Generated modules, syllabus, content paths. |
| `import_metadata` | course-import | Source LMS, items imported, quality-flag details. |
| `export_metadata` | course-export | Export destination, items exported, readiness check. |
| `quality_review` | course-quality-review | QM standards, CoI presence, alignment audit, cross-domain checks, scores. |
| `red_team_audit` | red-team | Confidence score, dimensions, findings (with stable ids), top actions. |
| `accessibility_review` | accessibility-review | WCAG / UDL scores, violations, recommendations, quick wins. |
| `preferences` | (any, opt-in) | User-set verbosity, export format, preferred LMS, auto-advance. |

### Full schema (canonical shape)

```json
{
  "version": "1.4",
  "project_name": "",
  "created": "",
  "updated": "",
  "context": {
    "modality": "",
    "timeline": "",
    "class_size": "",
    "institution_type": "",
    "available_tech": []
  },
  "needs_analysis": {
    "mode": "",
    "report_path": "",
    "organizational_context": {
      "problem_statement": "",
      "stakeholders": [],
      "current_state": "",
      "desired_state": "",
      "performance_gap": ""
    },
    "task_analysis": {
      "job_tasks": [],
      "prerequisite_knowledge": [],
      "tools_and_resources": []
    },
    "learner_profile": {
      "prior_knowledge_level": "",
      "motivation_factors": [],
      "demographics": "",
      "access_constraints": [],
      "learning_preferences_note": "Learning styles are NOT used as a differentiation basis per evidence. Prior knowledge is the primary differentiator."
    },
    "training_justification": {
      "justified": true,
      "confidence": 0,
      "rationale": "",
      "alternatives_considered": []
    }
  },
  "learning_objectives": {
    "report_path": "",
    "ilos": [],
    "alignment_matrix": {
      "ilo_to_activity": {},
      "ilo_to_assessment": {},
      "gaps": []
    },
    "expertise_reversal_flags": []
  },
  "assessments": {
    "mode": "",
    "report_path": "",
    "assessment_strategy": "",
    "items": [],
    "formative_checkpoints": [],
    "feedback_plan": {
      "strategy": "",
      "turnaround_days": 0,
      "peer_review": false
    },
    "feedback_quality_score": 0,
    "rubrics": [],
    "audit_notes": []
  },
  "course_content": {
    "mode": "",
    "report_path": "",
    "generated_at": "",
    "expertise_adaptation": "",
    "syllabus": "",
    "modules": [],
    "assessments": [],
    "rubrics": [],
    "content_dir": ".idstack/course-content/",
    "generated_files": [],
    "build_timestamp": "",
    "placeholders_used": [],
    "recommended_generation_targets": []
  },
  "import_metadata": {
    "source": "",
    "report_path": "",
    "imported_at": "",
    "source_lms": "",
    "source_cartridge": "",
    "source_size_bytes": 0,
    "schema": "",
    "items_imported": {
      "modules": 0,
      "objectives": 0,
      "module_objectives": 0,
      "assessments": 0,
      "activities": 0,
      "pages": 0,
      "rubrics": 0,
      "quizzes": 0,
      "discussions": 0
    },
    "quality_flags": 0,
    "quality_flag_details": []
  },
  "export_metadata": {
    "report_path": "",
    "exported_at": "",
    "format": "",
    "destination": "",
    "items_exported": {
      "modules": 0,
      "pages": 0,
      "assignments": 0,
      "quizzes": 0,
      "discussions": 0
    },
    "failed_items": [],
    "notes": "",
    "readiness_check": {
      "quality_score": 0,
      "quality_reviewed": false,
      "red_team_critical": 0,
      "red_team_reviewed": false,
      "accessibility_critical": 0,
      "accessibility_reviewed": false,
      "verdict": ""
    }
  },
  "quality_review": {
    "report_path": "",
    "last_reviewed": "",
    "qm_standards": {
      "course_overview":         {"status": "", "findings": []},
      "learning_objectives":     {"status": "", "findings": []},
      "assessment":              {"status": "", "findings": []},
      "instructional_materials": {"status": "", "findings": []},
      "learning_activities":     {"status": "", "findings": []},
      "course_technology":       {"status": "", "findings": []},
      "learner_support":         {"status": "", "findings": []},
      "accessibility":           {"status": "", "findings": []}
    },
    "coi_presence": {
      "teaching_presence":  {"score": 0, "findings": []},
      "social_presence":    {"score": 0, "findings": []},
      "cognitive_presence": {"score": 0, "findings": []}
    },
    "alignment_audit": {"findings": []},
    "cross_domain_checks": {
      "cognitive_load":        {"score": 0, "flags": []},
      "multimedia_principles": {"score": 0, "flags": []},
      "feedback_quality":      {"score": 0, "flags": []},
      "expertise_reversal":    {"score": 0, "flags": []}
    },
    "overall_score": 0,
    "score_breakdown": {
      "qm_structural": 0,
      "coi_presence": 0,
      "constructive_alignment": 0,
      "cross_domain_evidence": 0
    },
    "quick_wins": [],
    "recommendations": [],
    "review_history": []
  },
  "red_team_audit": {
    "updated": "",
    "confidence_score": 0,
    "focus": "",
    "report_path": "",
    "findings_summary": {"critical": 0, "warning": 0, "info": 0},
    "dimensions": {
      "alignment":      {"score": "", "findings": []},
      "evidence":       {"score": "", "mode": "", "findings": []},
      "cognitive_load": {"score": "", "findings": []},
      "personas":       {"score": "", "findings": []},
      "prerequisites":  {"score": "", "findings": []}
    },
    "top_actions": [],
    "limitations": [],
    "fixes_applied": [],
    "fixes_deferred": []
  },
  "accessibility_review": {
    "updated": "",
    "report_path": "",
    "score": {"overall": 0, "wcag": 0, "udl": 0},
    "wcag_violations": [],
    "udl_recommendations": [],
    "quick_wins": []
  },
  "preferences": {
    "verbosity": "normal",
    "export_format": "",
    "preferred_lms": "",
    "auto_advance_pipeline": false
  }
}
```

### Per-section item shapes

These document the **shape of array elements and dictionary values** that the canonical schema leaves as `[]` or `{}`. Skills should produce items in these shapes; downstream skills can rely on them.

**`learning_objectives.alignment_matrix.ilo_to_activity`** — keyed by ILO id, values are arrays of activity names:
```json
{ "ILO-1": ["Module 1 case study", "Discussion 2"], "ILO-2": [] }
```

**`learning_objectives.alignment_matrix.ilo_to_assessment`** — same shape, values are arrays of assessment titles.

**`learning_objectives.alignment_matrix.gaps[]`** — each item:
```json
{
  "ilo": "ILO-1",
  "type": "untested|orphaned|underspecified|bloom_mismatch",
  "description": "ILO-1 has no matching assessment in the active modules.",
  "severity": "critical|warning|info"
}
```

**`learning_objectives.ilos[]`** — each item:
```json
{
  "id": "ILO-1",
  "statement": "Analyze competitive forces in...",
  "blooms_level": "analyze",
  "blooms_confidence": "high|medium|low"
}
```

**`assessments.items[]`** — each item:
```json
{
  "id": "A-1",
  "type": "quiz|discussion|rubric|peer_review|gate|...",
  "title": "Module 1 Quiz",
  "weight": 5,
  "ilos_measured": ["ILO-1", "ILO-3"],
  "rubric_present": true,
  "elaborated_feedback": false,
  "alignment_status": "weak|moderate|strong"
}
```

**`assessments.rubrics[]`** — each item:
```json
{
  "id": "rubric-1",
  "title": "SM Project Rubric",
  "criteria": [{"name": "...", "blooms_level": "...", "weight": 0}],
  "applies_to": ["A-3"]
}
```

**`import_metadata.quality_flag_details[]`** — each item (replaces the legacy `_import_quality_flags` root field that sometimes appeared in the wild):
```json
{
  "key": "orphan_module_8",
  "description": "Module 8 wiki content exists in the cartridge but is not referenced in <organizations>.",
  "severity": "warning|critical|info",
  "evidence": "Optional citation tag, e.g. [Alignment-1] [T5]"
}
```

**`red_team_audit.dimensions.<name>.findings[]`** — each item (matches the `<dimension>-<n>` id convention from the red-team orchestrator):
```json
{
  "id": "alignment-1",
  "description": "ILO-2 (vision/mission) has no matching assessment.",
  "module": "Module 4",
  "severity": "critical|warning|info"
}
```

**`accessibility_review.wcag_violations[]`** — each item:
```json
{
  "id": "wcag-1",
  "criterion": "1.3.1 Info and Relationships",
  "level": "A|AA|AAA",
  "description": "All cartridge HTML pages lack <h1> elements.",
  "affected": ["page1.html", "page2.html"],
  "severity": "critical|warning|info"
}
```

**`accessibility_review.udl_recommendations[]`** — each item:
```json
{
  "id": "udl-1",
  "principle": "engagement|representation|action_expression",
  "description": "Add transcripts to all videos.",
  "status": "fully_met|partial|not_met"
}
```

**`quality_review.qm_standards.<standard>.findings[]`**, **`quality_review.alignment_audit.findings[]`**, **`quality_review.cross_domain_checks.<check>.flags[]`**, and other findings arrays — each item:
```json
{
  "id": "<dimension>-<n>",
  "description": "...",
  "evidence": "[Domain-N] [TX]",
  "severity": "critical|warning|info"
}
```

### Mode field — design-new vs audit-existing

`needs_analysis.mode`, `assessments.mode`, and `course_content.mode` record which operating mode the corresponding skill ran in. Trigger: `import_metadata.source` ∈ `{cartridge, scorm, canvas-api}` plus the relevant section being non-empty (skill-specific check).

Allowed values per skill:
- `needs_analysis.mode`: `"design-new"` or `"audit-existing"`
- `assessments.mode`: `"Mode 1"`, `"Mode 2"`, or `"Mode 3"` (Mode 1 = full upstream data, Mode 2 = ILOs-from-scratch, Mode 3 = audit existing assessments)
- `course_content.mode`: `"build-new"` or `"gap-fill"`

Empty string means the skill hasn't run yet or didn't record the mode (legacy manifests).

**`assessments.audit_notes[]`** — only populated in Mode 3. Records which audit findings the user chose to act on:
```json
{
  "target_id": "A-3",
  "action": "applied|deferred|declined",
  "description": "Rubric criterion for ILO-2 added: 'Synthesis depth (1-4 scale)'.",
  "reason": "Optional — only meaningful for deferred/declined."
}
```

**`course_content.recommended_generation_targets[]`** — populated in `gap-fill` mode. Lists artifacts upstream skills flagged as missing, with status:
```json
{
  "description": "Discussion rubric for Module 5",
  "source": "red-team:alignment-3 | quality-review:learner_support-2 | user-request",
  "status": "generated|deferred|declined",
  "output_path": "Optional — set when status=generated, points to the generated file."
}
```

## Feedback

Have feedback or a feature request? [Share it here](https://forms.gle/6LDgDD1M6WWyYvME8) — no GitHub account needed.

---

## Completion: Timeline Logging

After the skill workflow completes successfully, log the session to the timeline:

```bash
"$_IDSTACK/bin/idstack-timeline-log" '{"skill":"learning-objectives","event":"completed"}'
```

Replace the JSON above with actual data from this session. Include skill-specific fields
where available (scores, counts, flags). Log synchronously (no background &).

If you discover a non-obvious project-specific quirk during this session (LMS behavior,
import format issue, course structure pattern), also log it as a learning:

```bash
"$_IDSTACK/bin/idstack-learnings-log" '{"skill":"learning-objectives","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":8,"source":"observed"}'
```
