This file provides essential guidance to Claude Code when working with this repository.
📖 Documentation:
- Workflow Rules: See
.claude/WORKFLOW.mdfor mandatory workflow guidelines - Version History: See
.claude/memory/VERSION_HISTORY.mdfor complete version history - Archived Docs: See
.claude/archive/for historical documentation
musicAnalysis is an R package for music psychology research data preparation at the University of Graz.
Data Sources:
- KLAWA PDFs - Voice/singing performance metrics
- Musical Experience - Practice history and instrument proficiency questionnaires
- AAT CSV - Auditory Ambiguity Test (ambiguous % and control % metrics)
- PPPT CSV - Pitch Perception Proficiency Test (PPP indices across 6 UCF frequency bands)
Current Version: 0.0.0.9077 (2026-04-16)
Work directly on master branch - No feature branches unless multi-week complex work.
# Standard workflow
git add -A
git commit -m "TYPE: Description"
git push origin master
# Commit types: FEAT, FIX, HOTFIX, DOCS, VERSION, REFACTOR-
Update DESCRIPTION:
Version: 0.0.0.9XXX # Increment XXX -
Update mod_home.R "What's New":
- Update header with new version number
- List changes (Added/Fixed/Improved/Enhanced)
- Move previous "What's New" to "Version History" section
- Update "Build Date" field
-
Update README.md:
- Version badge at top
- Version history section
- Installation tarball filename
- "Last Updated" and "Version" at bottom
-
Update VERSION_HISTORY.md:
- Add new version entry
- Document all significant changes
4b. Update CLAUDE.md: - Update "Current Version" field
- Build Package:
devtools::build()
- R executable:
"C:/Program Files/R/R-4.4.1/bin/Rscript.exe"(not in PATH) - Shiny app starten:
nohup Rscript tests/manual/test_start_app.R > /tmp/shiny_app.log 2>&1 &(Port 7654) - WICHTIG:
devtools::install('.', quick=TRUE)VOR Shiny-Tests —app.Rnutztsystem.file()(installiertes Paket) - Playwright: Kann nur Dateien innerhalb des Projektordners hochladen — Testdaten aus
tests/testdata_*verwenden
renderUI/renderDTin conditionalPanel oder hidden Tabs: IMMERoutputOptions(output, "id", suspendWhenHidden = FALSE)setzen, sonst bleibt Output leer- AAT Terminologie: "ambiguous" = Item-Typ (Stimulus), "ambivalent" = Antwort-Typ (code=2) — NICHT verwechseln
- Musical Experience:
musical_experience()(nicht_time()) liefert merged Time+Profile; Shiny nutzt$wide,$sections$time$long,$sections$profile,$flags
- Scans hierarchical folders:
Computer/<PC>/Gruppen/<GROUP>/<MEASUREMENT>/*.pdf - Extracts: volume_difference, pitch, onset_difference, pitch_duration_difference
- Participant code format: 4 digits + 4 letters (e.g., "1234ABCD")
- Parses time formats: "2d", "1.5w", "3m", "2y"
- Computes: starting ages, IMP (Index of Musical Practice), total hours
- Returns:
wide(analysis),long(plotting),flags,merge_notes
- Scans
.rsl.csvand.itl.csvfiles - Extracts: Ambiguous %, Control %, quality metrics
- Item type detection: Same Nmin = control, Different Nmin = ambiguous
- Scans
.rsl.csvfiles - Extracts PPP indices for UCF bands: 294, 523, 932, 1661, 2960, 5274 Hz
- Calculates overall PPP index
- ✅ KLAWA, Musical Experience, AAT, PPPT extraction working
- ✅ Shiny modules for all data sources
- ✅ Show R Code buttons implemented
- ✅ UI polish complete (brown theme, transparent ASCII art)
All planned features through v0.0.0.9075 are complete.
See .claude/memory/VERSION_HISTORY.md for detailed history.
- Functions: snake_case
- Internal helpers: prefix with
. - Always return tibbles (not data.frames)
- Use rlang::abort() for errors
- Prefer NA over errors for missing values
- Document with roxygen2
- Write unit tests for all functions
# Run all tests (189 tests)
devtools::test()
# Quick visual test
source("tests/manual/test_app_visual.R")
# Build verification
source("tests/manual/test_package_build.R")- Data preparation, not analysis - Extract and clean, don't analyze
- Robustness over strictness - Return NA when missing, don't error
- Configuration over hard-coding - Use options system
- Tidy output - Always return analysis-ready tibbles
- Explicit validation - Warn about issues, don't block
- Clear separation - KLAWA/PPPT/AAT/MusicalExp only
- Always test yourself - Use test scripts
- Update docs after tasks - Keep VERSION_HISTORY.md current
- ALWAYS use TodoWrite for non-trivial tasks
- ALWAYS launch app to verify UI changes visually
- ALWAYS increment version after completing tasks
- ALWAYS update mod_home.R when creating new versions
- ALWAYS build package and deliver .tar.gz
- NEVER assume - Verify everything works
- NO SHITTY WORK - Quality over speed
See .claude/WORKFLOW.md for detailed workflow rules.