conalyz_cli
CLAUDE.md14 starsChanged 13 days agoMITView on GitHub
This is a Dart CLI package (bin/conalyz.dart is the entry point) published to pub.dev as conalyz. Entry point → command dispatch (bin/conalyz.dart): The main() function manually dispatches on the first argument to one of three handlers: analysis (default), usage, or update. There is no formal command framework — subcommands are parsed inline. Analysis pipeline (lib/src/optimized_ast_analyzer.dart): 1. OptimizedAstFlutterAccessibilityAnalyzer is instantiated with a rule set loaded in _initializeRules(). 2. For each .dart file, the file is parsed into an AST using package:analyzer's…
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ask-mattSkill
- chief-of-staffSkill
- claude-handoffSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- git-guardrails-claude-codeSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- loop-meSkill
- migrate-to-shoehornSkill
- prototypeSkill
- prSkill
- researchSkill
- retroSkill
- scaffold-exercisesSkill
- setup-matt-pocock-skillsSkill
- setup-pre-commitSkill
- setup-ts-deep-modulesSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- writing-beatsSkill
- writing-for-agentsSkill
- writing-fragmentsSkill
- writing-shapeSkill
- conalyzSkill
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Adding a new rule: Create a class extending AccessibilityRule in lib/src/flutter_specific_rules.dart (Flutter-specific), …
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Commands
# Run all tests
dart test
# Run a single test file
dart test test/optimized_ast_analyzer_test.dart
# Run the CLI locally (without installing)
dart run bin/conalyz.dart --dir .
dart run bin/conalyz.dart --dir ./example --platform web
# Format code
dart format lib/ bin/ test/
# Analyze code
dart analyze
# Activate globally for manual testing
dart pub global activate --source path .Architecture
This is a Dart CLI package (bin/conalyz.dart is the entry point) published to pub.dev as conalyz.
Entry point → command dispatch (bin/conalyz.dart): The main() function manually dispatches on the first argument to one of three handlers: analysis (default), usage, or update. There is no formal command framework — subcommands are parsed inline.
Analysis pipeline (lib/src/optimized_ast_analyzer.dart):
OptimizedAstFlutterAccessibilityAnalyzeris instantiated with a rule set loaded in_initializeRules().- For each
.dartfile, the file is parsed into an AST usingpackage:analyzer'sparseString(). OptimizedWidgetExtractionVisitorwalks the AST and builds a flat list ofWidgetInfoobjects, one per detected Flutter widget constructor or method invocation.- Each
WidgetInfois matched against rules via_getRelevantRules(widget.type)— eachAccessibilityRuledeclarestargetWidgets, an empty list meaning "match all". - Issues are collected as
AccessibilityIssueobjects and aggregated into anAnalysisResult.
Adding a new rule: Create a class extending AccessibilityRule in lib/src/flutter_specific_rules.dart (Flutter-specific), lib/src/web_rules.dart (web-only), or lib/src/optimized_ast_analyzer.dart (core rules), then register it in _initializeRules(). Web-only rules should return early when platform != PlatformType.web.
Report generation (lib/src/ast_report_generator.dart): AstReportGenerator converts an AnalysisResult to JSON and/or HTML. HTML is self-contained with inline CSS/JS.
Usage tracking (lib/src/usage_storage_service.dart, lib/src/usage_models.dart): Usage records are stored as JSON in ~/.conalyz/usage.json. Daily file-count limits are enforced before analysis runs (checkDailyLimit). The UsageStorageService constructor accepts a testStoragePath for test isolation.
Telemetry (lib/src/telemetry.dart): Anonymous, opt-out telemetry sent via HTTP POST to https://conalyz.com/telemetry. Two public entry points: checkFirstRunNotice() (top-level, called once at startup) and Telemetry.trackAnalysis() / Telemetry.trackError() (static, fire-and-forget). Both skip silently when CONALYZ_NO_ANALYTICS=true, DO_NOT_TRACK=1, or a CI environment variable is present. The last-run issue count is cached in ~/.config/conalyz/last_run.json to compute fix-rate deltas between runs.
Platform-conditional rules: PlatformType is passed through to every rule.check() call. Mobile-only rules check if (platform != PlatformType.mobile) return issues; at the top.
Line counting (lib/src/line_counter_service.dart): Traverses a project directory for .dart files and totals their line counts, skipping unreadable files. Feeds the daily usage-limit checks in the usage tracking layer.
Version constant
The version string lives in two places — pubspec.yaml and lib/src/constants.dart (conalyzVersion). Both must be updated together when releasing. bin/conalyz.dart and lib/src/telemetry.dart import conalyzVersion from constants.dart and must not hardcode it.
Test structure
Each concern has its own test file:
optimized_ast_analyzer_test.dart— core rule engine and widget extractionflutter_specific_rules_test.dart— Flutter-specific rules (MergeSemantics, etc.)web_rules_test.dart— web-only rulestab_accessibility_test.dart— TabBar false-positive regression testsusage_storage_service_test.dart/usage_models_test.dart— usage trackingupdate_command_test.dart— update commandintegration_test.dart— end-to-end analysis on temp directories
test/test_all.dart is an aggregate runner but is stale — it omits tab_accessibility_test.dart and update_command_test.dart. Use dart test (not test_all.dart) to run the full suite.
CI / exit codes
The CLI exits with code 1 when any critical-severity issues are found, making it usable in CI pipelines. All other outcomes (including high/medium/low issues) exit 0.
Linting notes
avoid_print: false is intentionally set — this is a CLI tool that uses print() for all user-facing output. Do not replace print calls with a logger.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

