Claude-skill-registry codebase-layout
Codebase organization for pikru. Use when you need to find where specific functionality lives.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/codebase-layout" ~/.claude/skills/majiayu000-claude-skill-registry-codebase-layout && rm -rf "$T"
manifest:
skills/data/codebase-layout/SKILL.mdsource content
Pikru Codebase Organization
Top-Level Structure
- Main pikru library (parsing and rendering)src/
- Supporting cratescrates/
- Original C implementation and test filesvendor/pikchr-c/
- Example programsexamples/
- Integration teststests/
Main Library (src/
)
src/Entry Point
- Public API, exports key types and functionssrc/lib.rs
Parsing
- Parser implementation (statement parsing, token handling)src/parse.rs
- AST types (Statement, Expr, ObjectClass, etc.)src/ast.rs
- Core types (ClassName, Direction, EdgePoint, etc.)src/types.rs
Rendering
- Main renderer logicsrc/render/mod.rs- Object placement and geometry
- Text positioning (ljust/rjust logic at lines 1265-1550)
- Variable scope and context management
- Expression evaluation (positions, scalars, variables)src/render/eval.rs
- SVG generation (converts shapes to SVG elements)src/render/svg.rs
- Shape geometry (boxes, circles, paths, files)src/render/geometry.rs
- Shape rendering (specific shape implementations)src/render/shapes.rs
- Render types (PObject, Style, PositionedText, etc.)src/render/types.rs
- Path construction (line/arrow building)src/render/path_builder.rs
- Render context (variable scopes, state)src/render/context.rs
- Default values (line width, font size, etc.)src/render/defaults.rs
Error Handling
- Error types and reportingsrc/errors.rs
- Helper macrossrc/macros.rs
Supporting Crates
crates/pikru-compare/
crates/pikru-compare/SVG comparison utilities for testing
- Core comparison logicsrc/lib.rs
- Main comparison functioncompare_outputs()
- Determines if test passesCompareResult::is_match()- Handles error matching, SVG parsing, tolerance
- Used by: test harness, MCP server
crates/pikru-mcp/
crates/pikru-mcp/MCP server for test running
- MCP tool implementationssrc/tools.rs
- Run single test, returns comparisonrun_pikru_test()
- List available testslist_pikru_tests()
- Run with trace outputdebug_pikru_test()
- MCP server entry pointsrc/main.rs
Test Files
Location
vendor/pikchr-c/tests/*.pikchr - Test input files from C implementation
Categories
-test01
- Numbered feature teststest81
- Arrow chopping testsautochop*.pikchr- Other specialized tests
Common Debugging Paths
Text Positioning Issues
- Check
- ljust/rjust calculationsrc/render/mod.rs:1265-1550 - Check
- Text anchor assignmentsrc/render/svg.rs:294 - Check
- PositionedText structuresrc/render/types.rs
Rendering Issues
- Check
- Shape-specific renderingsrc/render/shapes.rs - Check
- Geometric calculationssrc/render/geometry.rs - Check
- SVG element generationsrc/render/svg.rs
Parsing Issues
- Check
- Parser logicsrc/parse.rs - Check
- AST node definitionssrc/ast.rs
Test Comparison Issues
- Check
- Comparison logiccrates/pikru-compare/src/lib.rs - Check tolerance constants (FLOAT_TOLERANCE, SIMILARITY_THRESHOLD)
Key Code References (cref comments)
Many functions include
// cref: comments pointing to the original C implementation:
- Format:
// cref: function_name (pikchr.c:line_number) - Use these to cross-reference with C implementation when debugging