Codebase layout

From bearcove/dodeca · View interactive version

Codebase layout is an AI agent skill from the GitHub repository bearcove/dodeca. Codebase organization for pikru. Use when you need to find where specific functionality lives.

How to use this skill

Skill file

Pikru Codebase Organization

Top-Level Structure

Main Library (`src/`)

Entry Point

Parsing

Rendering

Error Handling

Supporting Crates

`crates/pikru-compare/`

SVG comparison utilities for testing

`crates/pikru-mcp/`

MCP server for test running

Test Files

Location

vendor/pikchr-c/tests/*.pikchr - Test input files from C implementation

Categories

Common Debugging Paths

Text Positioning Issues

  1. Check src/render/mod.rs:1265-1550 - ljust/rjust calculation
  2. Check src/render/svg.rs:294 - Text anchor assignment
  3. Check src/render/types.rs - PositionedText structure

Rendering Issues

  1. Check src/render/shapes.rs - Shape-specific rendering
  2. Check src/render/geometry.rs - Geometric calculations
  3. Check src/render/svg.rs - SVG element generation

Parsing Issues

  1. Check src/parse.rs - Parser logic
  2. Check src/ast.rs - AST node definitions

Test Comparison Issues

  1. Check crates/pikru-compare/src/lib.rs - Comparison logic
  2. Check tolerance constants (FLOAT_TOLERANCE, SIMILARITY_THRESHOLD)

Key Code References (cref comments)

Many functions include // cref: comments pointing to the original C implementation:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.