Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Neo4j database setup repository for thesis work, using Docker Compose to run Neo4j 2025.09.0 with the APOC plugin. The project features:
make help # Show all available commands make test-unit # Run unit tests (fast) make test-integration # Run integration tests make test-all # Run all tests make coverage # Generate coverage report make lint # Run code quality checks make format # Format code with black make docker-up # Start Neo4j make docker-down # Stop Neo4j
# Fix permissions first (important for WSL) ./scripts/fix-permissions.sh # Start Neo4j with APOC ./scripts/start.sh # Stop Neo4j ./scripts/stop.sh # OR ./scripts/start.sh --stop # OR docker compose down
# Create a backup (creates timestamped .graphml.gz file in ./backup/) ./scripts/create_backup.sh # Restore from backup ./scripts/restore_backup.sh <backup_file.gz>
# View logs docker compose logs neo4j # View last 50 lines docker compose logs neo4j --tail 50 # Check container status docker compose ps # Execute cypher-shell in container docker exec $(docker compose ps -q neo4j) cypher-shell -u neo4j -p yourpassword "MATCH (n) RETURN count(n)"
The project follows TDD practices with three test levels:
Unit Tests (
tests/unit/)
pytest tests/unit/ or make test-unitIntegration Tests (
tests/integration/)
pytest tests/integration/ or make test-integrationEnd-to-End Tests (
tests/e2e/)
pytest tests/e2e/ or make test-e2eCommon fixtures available to all tests:
neo4j_connection: Fresh connection instanceconnected_neo4j: Connected instanceclean_neo4j: Clean database (cleared before/after test)health_checker: HealthChecker instancebackup_manager: BackupManager instancesample_graph_data: Sample test datasrc/neo4j_manager/connection.py: Connection management and query executionsrc/neo4j_manager/health_check.py: Health checks and monitoringsrc/neo4j_manager/backup.py: Backup/restore operations (requires APOC)All modules use:
docker-compose.yml.env to avoid permission issuesscripts/ - Shell scripts for Neo4j management
start.sh - Main orchestration script (fixes permissions, sets up APOC, starts Neo4j, verifies health)stop.sh - Stops the containerfix-permissions.sh - Fixes permissions on data/logs/plugins and creates/updates .env filecreate_backup.sh - Exports database to GraphML format using APOCrestore_backup.sh - Restores from GraphML backup (includes APOC setup and verification)src/neo4j_manager/ - Python package for Neo4j operations
connection.py - Connection management and query executionhealth_check.py - Health monitoring utilitiesbackup.py - Backup/restore operationstests/ - Test suite (unit, integration, e2e)plugins/ - APOC JAR files (auto-downloaded by start.sh)data/ - Neo4j database fileslogs/ - Neo4j log filesbackup/ - Backup files (.graphml.gz format).env - Environment configuration (created automatically with user IDs, credentials, memory settings).github/workflows/test.yml - CI/CD pipeline configurationThe
.env file controls:
NEO4J_USERNAME / NEO4J_PASSWORD - Database credentials (default: neo4j/yourpassword)USER_ID / GROUP_ID - Container user IDs (auto-set to current user)NEO4J_HEAP_MEMORY_INITIAL / NEO4J_HEAP_MEMORY_MAX - JVM heap size (default: 4G)NEO4J_PAGE_CACHE - Page cache size (default: 2G).env)The
start.sh script automatically:
/plugins/ directoryNote: APOC version MUST match Neo4j version (year.month must be identical)
This repository is designed for WSL environments where permission issues are common:
fix-permissions.sh uses sudo where possible but continues if it fails.env file captures these IDs for Docker container user mappingapoc.export.graphml.all)neo4j_backup_YYYYMMDD_HHMMSS.graphml.gz/var/lib/neo4j/import/ directory./backup/ and gzippedapoc.import.graphml with test import first, then full importcypher-shell to test procedure availabilitySupported Python Versions: 3.11, 3.12, 3.13, 3.14
Core:
neo4j>=5.26.0 - Neo4j Python driverpython-dotenv>=1.0.1 - Environment variable managementDevelopment/Testing:
pytest>=8.3.0 - Test frameworkpytest-cov>=6.0.0 - Coverage reportingpytest-mock>=3.14.0 - Mocking utilitiesblack>=24.10.0 - Code formatterflake8>=7.1.0 - Lintermypy>=1.13.0 - Type checkerInstall with:
pip install -r requirements.txt or pip install -e ".[dev]"
The project assumes a virtual environment at
./.venv (symlinked to ../../.venv/). The start.sh script will activate it if present.
/var/lib/neo4j/ paths inside containerAPOC is enabled via environment variables in
docker-compose.yml:
NEO4J_dbms_security_procedures_unrestricted=apoc.*NEO4J_apoc_export_file_enabled=trueNEO4J_apoc_import_file_enabled=trueNEO4J_dbms_security_procedures_allowlist=apoc.*docker compose logs neo4j --tail 50./scripts/fix-permissions.shdocker exec $(docker compose ps -q neo4j) ls -l /plugins/docker-compose.ymldocker compose ps.env match what's used in scripts./backup/ directory and is valid gzipped GraphML