- simplify development: single marp server on port 3000 instead of 3 processes - rename klausur to klausurfolien for better naming - update extract script to use 00-intro.md as template when no 01-*.md exists - update makefile and package.json for new workflow - add comprehensive AGENTS.md guidelines
6.4 KiB
6.4 KiB
AGENTS.md - Agent Guidelines for HdM Slides
This file contains comprehensive guidelines for agentic coding agents working on the HdM Slides project.
Project Overview
This project builds presentation decks for Marp, supporting multiple courses:
- 223015b - Dateiformate, Schnittstellen, Speichermedien (6 Kapitel)
- 223015c - Internettechnologien (3 Kapitel)
Development Workflow
Build Commands
# Development
make dev # Start single dev server on port 3000
npm run dev # Alternative command for development server
# Build
make build # Build all courses (HTML + PDF)
make build-b # Build 223015b only
make build-c # Build 223015c only
make html # HTML only builds
make pdf # PDF only builds
# Klausur Folien
make klausur # Extract klausurfolien for all courses
make klausur-b # Extract klausurfolien for 223015b
make klausur-c # Extract klausurfolien for 223015c
# Deployment
make deploy # Deploy all courses (requires explicit permission)
make deploy-b # Deploy 223015b only
make deploy-c # Deploy 223015c only
# Utilities
make qr URL=... # Generate QR code
make optimize-images COURSE=223015b # Resize images
make clean # Remove generated files
Testing
No specific test framework is used. To validate changes:
- Start dev server:
make dev - Open http://localhost:3000/223015b/ or /223015c/
- Verify slides render correctly
- Run
make buildto ensure no build errors - Check generated files in
build/directory
Code Style Guidelines
File Structure
- Slides in
slides/<course>/following naming patternNN-topic.md - 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(e.g.,01-grundlagen.md,02-bilder.md) - Images:
snake_case.jpgorkebab-case.jpg - Klausur files:
klausurfolien.md(auto-generated) - Function names in scripts:
snake_case - 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 - 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/mwc/Coding/hdmfolder - NEVER run build/deploy commands without explicit user request
- NEVER run deploy commands (make deploy, scp, etc.) without explicit permission
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
- Klausur files (
klausurfolien.md) are auto-generated - NEVER edit klausurfolien.md files directly
- To update klausurfolien: edit source slides with
<!-- _class: klausur -->markers - Run
make klausurto regenerate
Development Patterns
Adding New Slides
- Create new file following
NN-topic.mdpattern - Copy frontmatter from existing slides in the same course
- Update Makefile
_KAPITELvariable if needed - 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=223015b - Reference as
./assets/filename.ext
Course-Specific Configuration
Each course has specific settings in Makefile:
- Course name and title
- Kapitel list (slide files)
- Deploy path
- Theme colors (in generate-index.sh)
Common Tasks
Debugging Build Issues
- Check Makefile syntax:
make -n build - Verify Marp CLI installation:
npx @marp-team/marp-cli --version - Check file permissions:
ls -la slides/ - Validate markdown syntax with dev server
Updating Course Structure
- Update
_KAPITELvariables in Makefile - Ensure slide files follow naming convention
- Update course-specific themes if needed
- Test both dev and build processes
Working with Themes
- Custom theme in
themes/custom-theme.css - Course themes defined 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 process:
make build(HTML + PDF) - Index generation: automatically handled
- Deploy to remote server via SCP
- Root index deployment
IMPORTANT: Never run deployment commands without explicit user permission.
Tools and Dependencies
Core Dependencies
- Marp CLI for slide rendering
- Bash scripts for automation
- Make for build orchestration
- Git for version control
Optional Tools
- qrencode for QR generation (via nix)
- ImageMagick for image optimization
- Python 3 for simple HTTP server (legacy)
Testing Strategy
Since there's no formal test suite:
- Manual testing with dev server
- Build process validation
- Slide rendering checks
- Asset path verification
- Cross-browser compatibility checks (important)
Troubleshooting
Common Issues
- Port conflicts: Use
make dev-killto clean up processes - Build failures: Check file permissions and Marp CLI installation
- Asset loading: Verify relative paths and file existence
- Deploy issues: Check SSH keys and remote permissions
Getting Help
- Check this AGENTS.md file first
- Review Makefile targets and scripts
- Test changes incrementally
- Maintain backup of working configurations