7.8 KiB
AGENTS.md - Agent Guidelines for Uni Slides (HdM + DHBW)
This file contains comprehensive guidelines for agentic coding agents working on the Uni Slides project. For the short version, see CLAUDE.md.
Project Overview
This project builds presentation decks for Marp, supporting multiple courses:
- 223015b – Dateiformate, Schnittstellen, Speichermedien (HdM, 6 Kapitel + Klausur)
- 223015c – Internettechnologien (HdM, 3 Kapitel + Klausur)
- dhbw – Technik I – Grundlagen IT (DHBW, 8 Kapitel)
Development Workflow
Build Commands
Unified per-course pattern: make <target>-<course>. Group targets without suffix run for all courses. Single dev server serves all courses.
# Dev (all courses, single port)
make dev # Live server (HMR), port 1312
# Per-course build/deploy (replace <c> with: 223015b, 223015c, dhbw)
make build-<c> # Build HTML + PDF
make html-<c> # HTML only
make pdf-<c> # PDF only
make klausur-<c> # Extract klausur slides (HdM only)
make deploy-<c> # Build + deploy single course (ASK FIRST!)
# All courses
make build # Build everything
make html / pdf # HTML / PDF only
make klausur # Extract klausur (HdM courses only)
make deploy # Deploy everything (ASK FIRST!)
# Utilities
make qr URL=... # Generate QR code
make qr-slides COURSE=<c> # QR for course URL
make optimize-images COURSE=<c> # Resize images
make clean # Remove generated files
make install # npm install
Adding a new course: add id to COURSES in Makefile + define <id>_NAME, <id>_KAPITEL, <id>_DEPLOY, <id>_KLAUSUR. No new targets needed.
Nix Flake
nix develop # Dev shell with all tools (node 22, npm, make)
Testing
No formal test framework. To validate changes:
- Start dev server:
make dev - Open http://localhost:1312/223015b/, /223015c/, or /dhbw/
- Verify slides render correctly
- Run
make buildto ensure no build errors - Check generated files in
build/directory
Code Style Guidelines
File Structure
slides/
├── 223015b/ # HdM: Dateiformate
├── 223015c/ # HdM: Internettechnik
└── dhbw/ # DHBW: Technik I
scripts/ # Shared scripts
themes/ # Custom Marp themes
build/ # Generated output (gitignored)
- Slides in
slides/<course>/followingNN-topic.md(HdM) orNN_topic.md(DHBW) - Assets in
slides/<course>/assets/ - Always reference images as
./assets/filename.png - Scripts in
scripts/ - Themes in
themes/ - Generated output in
build/(gitignored)
Naming Conventions
- Slide files:
NN-topic.md(HdM, e.g.01-grundlagen.md) orNN_topic.md(DHBW, e.g.01_web_eng.md) - Images:
snake_case.jpgorkebab-case.jpg - Klausur files:
klausurfolien.md/klausurfragen.md(auto-generated, HdM only) - Function/variable names in scripts:
snake_case
Markdown Style
- Use ATX-style headers (
# ## ###) - YAML frontmatter for slide metadata at top of each file
- Never include a final
---(creates empty slide) - Use
<!-- _class: klausur -->for exam-relevant slides (HdM) - Use relative paths for assets:
./assets/image.png
Script Style
- Use
#!/usr/bin/env bashshebang - Use
set -efor error handling - Use
2>/dev/null || truefor optional operations - Define variables in UPPER_CASE at script top
- Use colors for terminal output:
\033[0;32metc.
Git Workflow
- Commit messages: ALWAYS lowercase
- NEVER add co-authoring lines or generated footers
- Follow semantic naming: "add-...", "fix-...", "update-..."
- Commit changes to scripts, Makefile, documentation separately from slide content
Agent Restrictions
Security
- NEVER run commands outside
/home/libretech/Repos/uni - NEVER run build/deploy commands without explicit user request
- NEVER run deploy commands (
make deploy,scp, etc.) without explicit permission - NEVER run
git checkout --orgit restoreon files with uncommitted work. To undo specific changes, use targeted Edit operations instead.
File Protection
Slide files in slides/*/*.md are main content files:
- ALLOWED: Adding slides, adjusting content, fixing typos, enhancing sections
- FORBIDDEN (without permission): Deleting slides, removing sections, bulk deletions
- Before ANY deletion: ALWAYS ask user for confirmation
Klausur Handling (HdM only)
- Klausur files (
klausurfolien.md,klausurfragen.md) are auto-generated - NEVER edit klausur files directly
- To update klausur: edit source slides with
<!-- _class: klausur -->markers - Run
make klausur(ormake klausur-<c>) to regenerate - DHBW course has no klausur extraction (
dhbw_KLAUSUR =is empty)
Development Patterns
Adding New Slides
- Create new file following naming convention (
NN-topic.mdfor HdM,NN_topic.mdfor DHBW) - Copy frontmatter from existing slides in the same course
- Add stem to
<course>_KAPITELinMakefile - Test with
make dev
Modifying Existing Slides
- Edit the appropriate markdown file in
slides/<course>/ - Maintain consistent styling with course theme
- Preserve image paths as
./assets/... - Test changes with dev server
Working with Assets
- Place images in
slides/<course>/assets/ - Use descriptive names:
diagram-network.jpg,example-code.png - Optimize with
make optimize-images COURSE=<c> - Reference as
./assets/filename.ext
Course-Specific Configuration
Each course has these per-course settings in Makefile:
<c>_NAME– Display name<c>_KAPITEL– Ordered list of slide file stems (without.md)<c>_DEPLOY– Remote deploy path<c>_KLAUSUR–1to enable klausur extraction, empty to disable
Common Tasks
Debugging Build Issues
- Check Makefile syntax:
make -n build-<c> - Verify Marp CLI:
npx @marp-team/marp-cli --version - Check file permissions:
ls -la slides/ - Validate markdown via dev server
Updating Course Structure
- Update
<c>_KAPITELinMakefile - Ensure slide files follow naming convention
- Update course-specific themes if needed
- Test both
make devandmake build-<c>
Working with Themes
- Custom theme in
themes/custom-theme.css - Course themes referenced in individual slide frontmatter
- Use consistent color schemes per course
- Test theme changes across all slides
Deployment Process
Deployment to production server requires explicit permission:
- Build:
make build(HTML + PDF) or per-coursemake build-<c> - Index generation: handled by
scripts/generate-index.sh(per course) andscripts/generate-root-index.sh(root) - Deploy:
scptotengo@tuttle.uberspace.deviamake deploy-<c>ormake deploy - Root index deployed by
make deploy-index(or as part ofmake deploy)
IMPORTANT: Never run deployment commands without explicit user permission.
Tools and Dependencies
Core
- Marp CLI for slide rendering (via
npx @marp-team/marp-cli) - Bash scripts for automation (
scripts/) - Make for build orchestration
- Git for version control
Optional
qrencodefor QR generation (via nix-shell)- ImageMagick for image optimization (via nix-shell)
Troubleshooting
Common Issues
- Port conflicts: kill the dev-server process holding port 1312
- Build failures: check file permissions and Marp CLI availability via
npx - Asset loading: verify relative paths and file existence in
slides/<c>/assets/ - Deploy issues: check SSH keys for
tengo@tuttle.uberspace.deand remote permissions
Getting Help
- Check this
AGENTS.mdfirst - Review
Makefiletargets andscripts/ - Test changes incrementally
- Maintain backup of working configurations