Quick Start
# Install
pip install -e .
# Full organization scan
org-manager scan --org Digital-AI-Finance
# Run tests
pytest tests/
CLI Reference
# Install (development mode)
pip install -e .
# Full organization scan (generates JSON, HTML, Markdown reports)
org-manager scan --org Digital-AI-Finance
# Individual analysis commands
org-manager health --org Digital-AI-Finance
org-manager quality --org Digital-AI-Finance
org-manager publish --org Digital-AI-Finance
org-manager patterns --org Digital-AI-Finance
# Auto-fix issues (LICENSE, README)
org-manager fix --org Digital-AI-Finance --dry-run
org-manager fix --org Digital-AI-Finance
# Site detection and landing page
org-manager sites --org Digital-AI-Finance
org-manager landing-page --org Digital-AI-Finance --push
# Analytics (Cloudflare Workers)
org-manager analytics scan --org Digital-AI-Finance
org-manager analytics deploy --org Digital-AI-Finance --dry-run
# Run tests
pytest tests/
# Run single test
pytest tests/test_file.py::test_function -v
# Install with dev dependencies
pip install -e ".[dev]"
Architecture
API Reference
Core
github_client.py Core
GitHub REST API client with authentication, rate limiting, and pagination.
class RateLimitInfo
GitHub API rate limit status.
reset_datetime()
Get reset time as datetime.
seconds_until_reset()
Seconds until rate limit resets.
class Repository
Repository metadata.
from_api(cls, data: dict)
Create Repository from GitHub API response.
class GitHubClient
GitHub REST API client with authentication and rate limiting.
__init__(org: str, token: Optional[str], timeout: int, public_only: bool)
Initialize GitHub client. Args: org: GitHub organization name token: GitHub personal access token (auto-detected if not provided) timeout: Request timeout in seconds public_only: Only fetch public repositories
rate_limit()
Current rate limit info.
get_org_repos()
List all repositories in organization.
get_repo(repo_name: str)
Get detailed repository info.
get_repo_contributors(repo_name: str)
Get repository contributors.
get_repo_issues(repo_name: str, state: str, since: Optional[datetime])
Get repository issues.
get_repo_pulls(repo_name: str, state: str)
Get repository pull requests.
get_repo_releases(repo_name: str)
Get repository releases.
get_repo_commits(repo_name: str, since: Optional[datetime], max_pages: int)
Get repository commits.
get_repo_contents(repo_name: str, path: str)
List repository contents at path.
get_file_content(repo_name: str, path: str)
Get raw file content (base64 decoded).
get_repo_languages(repo_name: str)
Get repository language breakdown (bytes per language).
file_exists(repo_name: str, path: str)
Check if a file exists in the repository.
search_code(repo_name: str, query: str)
Search for code in a repository.
create_or_update_file(repo_name: str, path: str, content: str, message: str, branch: Optional[str])
Create or update a file in the repository.
cache.py Core
JSON-based result caching for GitHub API responses.
class CacheEncoder (json.JSONEncoder)
JSON encoder that handles dataclasses and datetime objects.
default(obj: Any)
No documentation
class ResultCache
JSON-based cache for API results.
__init__(cache_dir: Optional[Path], ttl_hours: int)
Initialize cache. Args: cache_dir: Directory to store cache files (default: ~/.cache/org_manager) ttl_hours: Cache TTL in hours (default: 24)
get(key: str)
Get cached result if not expired. Args: key: Cache key (e.g., "org/repo/issues") Returns: Cached data or None if not found/expired
set(key: str, data: Any)
Store result in cache. Args: key: Cache key data: Data to cache (must be JSON-serializable)
delete(key: str)
Delete a cache entry. Args: key: Cache key Returns: True if deleted, False if not found
clear()
Clear all cached data.
clear_expired()
Clear expired cache entries. Returns: Number of entries cleared
stats()
Get cache statistics. Returns: Dict with cache stats (entries, size, expired)
report_generator.py Core
Report generator - Console, JSON, HTML, and Markdown output formats.
class RepoReport
Complete report for a single repository.
health_score()
Calculate health score (0-100).
quality_score()
Calculate quality score (0-100).
publish_score()
Calculate publish score (0-100).
overall_score()
Calculate overall score (0-100).
passed()
Check if repo passes threshold (70%).
class OrgReport
Complete organization analysis report.
overall_health_score()
Average health score across all repos.
overall_quality_score()
Average quality score across all repos.
overall_publish_score()
Average publish score across all repos.
overall_score()
Overall organization score.
passed()
Check if org passes threshold.
class ReportEncoder (json.JSONEncoder)
JSON encoder for dataclasses and datetime objects.
default(obj: Any)
No documentation
print_console_report(report: OrgReport)
Print formatted report to console.
export_json(report: OrgReport, output_dir: str)
Export report to timestamped JSON file. Returns: Path to exported file
export_html(report: OrgReport, output_dir: str)
Export to HTML dashboard with Chart.js. Returns: Path to exported file
export_markdown(report: OrgReport, output_dir: str)
Export to Markdown report. Returns: Path to exported file
generate_default_markdown(report: OrgReport)
Generate default markdown report.
get_default_html_template()
Return default HTML template with enhanced dashboard.
cli.py Core
Organization Manager CLI - Unified entry point for all commands. Commands: scan Full organization scan (all metrics) health Repository health metrics only quality Code quality analysis only patterns Cross-repo pattern analysis publish Publication readiness check dashboard Generate HTML dashboard from previous scan fix Auto-fix LICENSE and README issues sites Detect site frameworks (Jekyll, Hugo, etc.) landing-page Generate organization landing page analytics Cloudflare analytics subcommands: scan List repos with GitHub Pages deploy Deploy tracking workers inject Inject tracking into HTML files snippet Generate tracking snippet Usage: org-manager scan --org Digital-AI-Finance org-manager fix --org Digital-AI-Finance --dry-run org-manager landing-page --org Digital-AI-Finance --push
cmd_scan(args)
Full organization scan.
cmd_health(args)
Health metrics only.
cmd_quality(args)
Quality metrics only.
cmd_publish(args)
Publication readiness only.
cmd_patterns(args)
Cross-repo pattern analysis.
cmd_fix(args)
Auto-fix common issues.
main()
Main entry point.
Analyzers
health_analyzer.py Analyzers
Repository health analyzer - activity, community, and maintenance metrics.
class HealthMetrics
Repository health metrics.
class HealthCheckResult
Single health check result.
status()
Get status string.
class HealthAnalyzer
Analyze repository health metrics.
__init__(client: GitHubClient, stale_days: int)
Initialize health analyzer. Args: client: GitHub API client stale_days: Number of days to consider issues stale
analyze(repo: Repository)
Run all health checks on a repository. Returns: Tuple of (metrics, list of check results)
quality_analyzer.py Analyzers
Code quality analyzer - tests, linting, CI/CD, and documentation checks.
class QualityMetrics
Code quality metrics.
class QualityCheckResult
Single quality check result.
status()
Get status string.
class QualityAnalyzer
Analyze code quality indicators.
__init__(client: GitHubClient)
Initialize quality analyzer.
analyze(repo: Repository)
Run all quality checks on a repository. Returns: Tuple of (metrics, list of check results)
publish_analyzer.py Analyzers
Publication readiness analyzer - README, reproducibility, and academic metadata checks.
class PublishMetrics
Publication readiness metrics.
class PublishCheckResult
Single publication check result.
status()
Get status string.
class PublishAnalyzer
Analyze publication readiness.
__init__(client: GitHubClient)
Initialize publish analyzer.
analyze(repo: Repository)
Run all publication checks on a repository. Returns: Tuple of (metrics, list of check results)
pattern_analyzer.py Analyzers
Cross-repository pattern analyzer - shared dependencies, file patterns, consistency.
class DependencyInfo
Shared dependency information.
usage_count()
Number of repos using this dependency.
class PatternMetrics
Cross-repo pattern metrics.
consistency_score()
Calculate overall consistency score across repos.
class PatternAnalyzer
Analyze cross-repository patterns.
__init__(client: GitHubClient)
Initialize pattern analyzer.
analyze(repos: list[Repository])
Analyze patterns across all repositories. Args: repos: List of repositories to analyze Returns: PatternMetrics with cross-repo analysis
get_consistency_report(metrics: PatternMetrics, total_repos: int)
Generate a consistency report summary.
Tools
org_fixer.py Tools
Organization fixer - automatically fix common issues in GitHub repos. Fixes: - Missing LICENSE files (adds MIT) - Incomplete READMEs (adds Description, Installation, Usage sections)
class FixResult
Result of fixing a repository.
__post_init__()
No documentation
class OrgFixer
Fix common issues across organization repositories.
__init__(client: GitHubClient, dry_run: bool)
Initialize fixer. Args: client: GitHub API client dry_run: If True, only report what would be done
fix_all(repos: list[Repository])
Fix all issues in repositories. Args: repos: List of repositories to fix Returns: List of FixResult for each repo
fix_repo(repo: Repository)
Fix issues in a single repository.
main()
Main entry point.
site_detector.py Tools
Site type detector - identify if repos use HTML, Jekyll, Hugo, etc.
class SiteInfo
Site type information.
__post_init__()
No documentation
class SiteDetector
Detect site type for repositories.
__init__(client: GitHubClient)
No documentation
detect(repo_name: str)
Detect site type for a repository.
cmd_detect(args)
Detect site types for all repos.
main()
Main entry point.
landing_page_generator.py Tools
Landing Page Generator - Auto-generate organization landing page. Generates a responsive HTML page with all repos, site types, and search functionality. Features: Category grouping, dark mode, sorting, enhanced visuals.
class LandingPageGenerator
Generate organization landing page.
__init__(client: GitHubClient, detector: SiteDetector)
No documentation
generate(repos: list[Repository])
Generate landing page HTML.
cmd_generate(args)
Generate landing page.
main()
Main entry point.
cf_analytics.py Tools
Cloudflare Analytics Deployer - Deploy tracking workers to GitHub Pages repos. Tracks page views and PDF downloads, stores data in GitHub Issues.
class CloudflareClient
Cloudflare Workers API client.
__init__(account_id: str, api_token: str)
No documentation
get_subdomain()
Get workers subdomain for account.
deploy_worker(script_name: str, script_content: str)
Deploy a worker script.
enable_worker_route(script_name: str)
Enable workers.dev route for script.
list_workers()
List all deployed workers.
load_config()
Load configuration from user-config.json.
get_worker_template()
Load worker template.
check_github_pages(client: GitHubClient, repo_name: str)
Check if repo has GitHub Pages enabled, return URL if so.
get_tracking_snippet(worker_url: str)
Generate tracking snippet HTML.
cmd_scan(args)
Scan repos for GitHub Pages.
cmd_deploy(args)
Deploy analytics workers to repos.
cmd_snippet(args)
Generate tracking snippet for a repo.
cmd_inject(args)
Inject tracking snippet into all HTML files.
main()
Main entry point.
Utility Scripts
add_claude_gitignore.py Script
Add .claude/ and CLAUDE.md to .gitignore for all repos in an organization. Usage: python scripts/add_claude_gitignore.py --org Digital-AI-Finance --dry-run python scripts/add_claude_gitignore.py --org Digital-AI-Finance
get_github_token()
Get GitHub token from gh CLI or environment.
get_repos(org: str, token: str)
Fetch all repos in organization.
get_gitignore(org: str, repo: str, token: str)
Get current .gitignore content and SHA.
is_gitignore_entry(lines: list[str], pattern: str)
Check if pattern is an actual gitignore entry (not in a comment).
needs_update(content: str | None)
Check if .gitignore needs Claude entries.
create_updated_content(existing: str | None)
Create updated .gitignore content.
update_gitignore(org: str, repo: str, token: str, content: str, sha: str | None, dry_run: bool)
Update or create .gitignore via GitHub API.
main()
No documentation
add_copyright.py Script
Add or remove copyright notice to GitHub Pages and Beamer slides across an organization. Adds "(c) Joerg Osterrieder 2025" to: - HTML files (footer before </body>) - README.md files (section at end) - Beamer .tex files (footline on every slide) Usage: python scripts/add_copyright.py --org Digital-AI-Finance --dry-run python scripts/add_copyright.py --org Digital-AI-Finance python scripts/add_copyright.py --org Digital-AI-Finance --html-only python scripts/add_copyright.py --org Digital-AI-Finance --tex-only python scripts/add_copyright.py --org Digital-AI-Finance --repos repo1 repo2 python scripts/add_copyright.py --org Digital-AI-Finance --remove --dry-run
get_github_token()
Get GitHub token from gh CLI or environment.
get_repos(org: str, token: str)
Fetch all repos in organization.
get_repo_tree(org: str, repo: str, token: str)
Get all files in a repo using Git Trees API.
get_file_content(org: str, repo: str, path: str, token: str)
Get file content and SHA from GitHub.
update_file(org: str, repo: str, path: str, content: str, sha: str, message: str, token: str, dry_run: bool)
Update file via GitHub API.
is_web_file(path: str)
Check if file is a web file (HTML, MD, Jekyll/Hugo templates).
is_beamer_file(content: str)
Check if .tex file is a Beamer presentation.
has_existing_copyright(content: str, file_type: str)
Check if content already has our copyright.
get_copyright_html()
Generate HTML copyright footer.
get_copyright_md()
Generate Markdown copyright section.
get_copyright_beamer()
Generate Beamer footline template.
add_html_copyright(content: str)
Add copyright to HTML file. Returns (new_content, action).
add_readme_copyright(content: str)
Add copyright to README.md. Returns (new_content, action).
add_beamer_copyright(content: str)
Add copyright footline to Beamer .tex file. Returns (new_content, action).
remove_html_copyright(content: str)
Remove copyright div from HTML. Returns (new_content, action).
remove_readme_copyright(content: str)
Remove copyright section from README. Returns (new_content, action).
remove_beamer_copyright(content: str)
Remove copyright footline from Beamer. Returns (new_content, action).
process_repo(org: str, repo_name: str, token: str, dry_run: bool, html_only: bool, tex_only: bool, remove_mode: bool)
Process a single repository. Returns stats dict.
main()
No documentation
catalog_charts.py Script
Catalog Charts Utility for LaTeX/Beamer Files Scans local directories for .tex files and catalogs all charts/figures, outputting to JSON organized by repo. Usage: python catalog_charts.py --dir "D:/Joerg/Research/slides" --recursive python catalog_charts.py --dir . --output my_charts.json
find_tex_files(directory: Path, recursive: bool)
Find all .tex files in directory.
get_line_number(content: str, position: int)
Get line number for a position in content.
is_beamer_file(content: str)
Check if file is a Beamer presentation.
extract_width(options: Optional[str])
Extract width from includegraphics options.
extract_figures_from_environments(content: str, file_path: str)
Extract figures from \begin{figure}...\end{figure} environments.
extract_standalone_includegraphics(content: str, file_path: str, figure_positions: set)
Extract standalone \includegraphics not in figure environments.
extract_all_figures(content: str, file_path: str)
Extract all figures (both in environments and standalone).
detect_repo_name(file_path: Path, root_dir: Path)
Detect repository name from file path.
catalog_charts(root_dir: Path, recursive: bool)
Catalog all charts in .tex files.
main()
No documentation
check_beamer_compliance.py Script
Beamer Template Compliance Checker Checks if a Beamer .tex file complies with the template_beamer_final standard. Outputs violations as JSON. Template requirements (from template_beamer_final.tex): - Document class: 8pt, aspectratio=169, beamer - Theme: Madrid - Color palette: mlpurple, mllavender, mlblue, mlorange, mlgreen, mlred, mlgray - Additional colors: lightgray, midgray - Navigation symbols: disabled - Itemize: circle, Enumerate: default - Margins: 5mm left/right - bottomnote command defined - Required packages: graphicx, booktabs, adjustbox, multicol, amsmath - Chart sizing: max 0.95\textwidth (full-size layouts use 0.95) - Max bullets per slide: 4 Usage: python check_beamer_compliance.py --file slides.tex python check_beamer_compliance.py --file slides.tex --output report.json
class Violation
A single compliance violation.
class ComplianceReport
Full compliance report.
get_line_number(content: str, position: int)
Get line number for a position in content.
check_document_class(content: str)
Check document class settings.
check_theme(content: str)
Check theme settings.
check_colors(content: str)
Check color definitions.
check_navigation_symbols(content: str)
Check that navigation symbols are disabled.
check_footline(content: str)
Check footline template - template_beamer_final uses Madrid default.
check_margins(content: str)
Check margin settings.
check_packages(content: str)
Check required packages.
check_bottomnote_command(content: str)
Check bottomnote command definition.
check_chart_sizing(content: str)
Check chart/figure sizing.
check_bullet_count(content: str)
Check bullet count per frame.
check_branding(content: str)
Check for QuantLet branding elements.
check_beamer_colors(content: str)
Check beamer color settings.
check_compliance(file_path: Path)
Run all compliance checks on a file.
main()
No documentation
generate_docs.py Script
Documentation Generator for Organization Manager Generates a single HTML documentation page from Python docstrings and CLAUDE.md. Uses AST parsing to extract module, class, and function documentation. Usage: python scripts/generate_docs.py python scripts/generate_docs.py --output docs/index.html
class FunctionDoc
Documentation for a function.
class ClassDoc
Documentation for a class.
class ModuleDoc
Documentation for a module.
extract_function_args(node: ast.FunctionDef)
Extract function argument names and annotations.
extract_module_docs(file_path: Path)
Extract documentation from a Python module.
parse_claude_md(file_path: Path)
Parse CLAUDE.md into sections.
escape_html(text: str)
Escape HTML special characters.
format_docstring(docstring: Optional[str])
Format docstring as HTML.
format_code_block(code: str, language: str)
Format code as a code block.
generate_module_html(module: ModuleDoc, category: str)
Generate HTML for a module.
generate_html(modules: dict[str, list[ModuleDoc]], claude_sections: dict, scripts: list[ModuleDoc])
Generate the full HTML documentation page.
main()
No documentation
remove_claude_files.py Script
Remove .claude/ and CLAUDE.md files from repos in an organization. Deletes tracked files via GitHub API. Skips GitHub Actions workflows. Usage: python scripts/remove_claude_files.py --org Digital-AI-Finance --dry-run python scripts/remove_claude_files.py --org Digital-AI-Finance
get_github_token()
Get GitHub token from gh CLI or environment.
get_repos(org: str, token: str)
Fetch all repos in organization.
get_repo_tree(org: str, repo: str, token: str)
Get all files in a repo using Git Trees API.
should_delete(path: str)
Check if a file should be deleted based on path.
get_file_sha(org: str, repo: str, path: str, token: str)
Get SHA of a file for deletion.
delete_file(org: str, repo: str, path: str, token: str, dry_run: bool)
Delete a file via GitHub API.
find_claude_files(org: str, repo: str, token: str)
Find all claude-related files in a repo.
main()
No documentation
search_claude_references.py Script
Search all repos in an organization for 'claude' references. Searches both file names and file contents. Usage: python scripts/search_claude_references.py --org Digital-AI-Finance
get_github_token()
Get GitHub token from gh CLI or environment.
get_repos(org: str, token: str)
Fetch all repos in organization.
search_code_in_repo(org: str, repo: str, query: str, token: str)
Search for code in a specific repo using GitHub Search API.
get_repo_tree(org: str, repo: str, token: str)
Get all file paths in a repo using Git Trees API.
search_repo(org: str, repo: str, token: str)
Search a single repo for claude references.
main()
No documentation
Course Creator Skills
A comprehensive skill system for Claude Code that automates the creation of complete academic course websites. From a YAML manifest to a deployed GitHub Pages site in 7 automated stages.
Organization Repositories
Live view of all repositories in the Digital-AI-Finance organization. Updates automatically when repos change.