How kds1123001/clarity works
Clarity is a command-line diagnostic explainer: users pipe compiler output into it or ask it to run a command, then receive located diagnostics and actionable guidance. The README documents parsing, rule matching, identifier suggestions, and rendering; sampled source confirms the CLI’s calls into parsing and reporting. The tree does not include the documented internal parser, report, or suggestion implementations, so those links are limited to documented behavior and unsupported source paths are left null.
Main entry points: main.go CLI modes · suggest.go Diagnostic parser · data.json Rule database
Components 12
CLI entry
- CLI modes
main.go
Diagnostic processing
- Diagnostic parser
suggest.go - Python traceback parser
suggest.go - Generic error parser
suggest.go - Language detection
suggest.go
Explanation and output
- Rule database
data.json - Rule matching
- Identifier suggestions
- Diagnostic renderer
- Explained diagnostics
Other components
- User
- Compiler or interpreter
Connections 14
- User → CLI modes: pipes output
- User → CLI modes: starts run
- CLI modes → Compiler or interpreter: executes command
- Compiler or interpreter → CLI modes: returns output
- CLI modes → Language detection: detects language
- CLI modes → Diagnostic parser: parses output
- Diagnostic parser → Python traceback parser: dispatches traceback
- Diagnostic parser → Generic error parser: parses fallback
- CLI modes → Diagnostic renderer: prints diagnostics
- Rule matching → Rule database: matches patterns
- Diagnostic parser → Rule matching: matches messages
- Diagnostic parser → Identifier suggestions: suggests identifiers
- Diagnostic renderer → Explained diagnostics: renders guidance
- Explained diagnostics → User: displays results