flutter_skill_gen 1.1.1
flutter_skill_gen: ^1.1.1 copied to clipboard
A CLI tool that scans Flutter projects and generates SKILL.md context files for AI coding assistants like Claude Code, Cursor, Copilot, and Windsurf.
Changelog #
1.1.1 #
Two fixes found by running 1.1.0 against a large real project.
- Features nested inside a layer container were invisible.
moduleswas recognised as a feature container at the top level but not inside a layer, so a 655-file app with twelve features underlib/ui/modules/reportedorganization: flat, zero features, and collapsed to a single SKILL.md instead of thirteen. The failure was silent, and--splitcould not work around it: that flag unions the recommended scopes withstructure.featureDirs, which was empty, so every unresolvable domain was dropped and the planner fell back to single-file mode. The nested container list is now derived from the top-level container names, andStructureAnalyzerandDomainAnalyzershare it rather than each keeping a copy that had drifted — so a container understood at the top level can never be missed when nested. - The verifier flagged correct statements that DI is centralized. The per-feature DI check was a plain phrase match with no handling for negation, so a draft telling the reader this project does not use per-feature DI was annotated as unsupported. On a real thirteen-file run, eight of twelve
UNVERIFIEDmarkers were sentences like "DI is centralized through Riverpod providers rather than per-feature injection files" and "Don't create a per-feature DI/injection file". Both assert exactly what the evidence says. A per-feature phrase is now skipped when its clause carries a negation cue, scoped to the clause rather than the line so a stray negation earlier in a sentence cannot smuggle a genuine claim past the verifier.
1.1.0 #
Two ways to generate skill files without an API key, both answering the same request: "I'd prefer to use Claude Code directly." Neither is Claude-only: the same paths work with OpenAI Codex, Gemini CLI, and OpenCode.
Keyless Generation via a Local Agent CLI #
- Three new providers:
claude-code,codex, andgemini-cli. Each drives a coding agent already installed on the machine instead of calling a hosted API, authenticating with the sign-in that agent already holds. No API key, billed to the existing subscription. Persist one withconfig --set-provider <id>. Aliases:claude_code/claudecode/cc,codex-cli,gemini_cli/geminicli.gemini-clidrives the local binary and is deliberately distinct fromgemini, which calls the paid API. AgentClidescribes what differs between them — the flag that turns on non-interactive mode, whether a separate system prompt is accepted, and how the answer comes back — so oneAgentCliClientdrives all three rather than three near-identical clients. Codex and Gemini CLI have no system-prompt flag, so the grounding rules are prepended to the prompt; every agent therefore receives the same instructions the API providers do.- Agent-specific hardening. Claude Code is invoked with its filesystem, shell, and network tools denied; Codex with
--sandbox read-onlypassed explicitly, so a changed upstream default cannot let a run write files. All three run from a scratch directory rather than the project. LlmProvider.requiresApiKeydistinguishes providers that carry their own credentials.SkillGenerator.hasAinow turns on the provider rather than on a non-null key, soclaude-codereaches the AI path with an empty config, andapiKeyFor(claudeCode)always returnsnull— a strayANTHROPIC_API_KEYin the environment no longer makesconfig --showclaim a key is in play.LlmClientFactory.createaccepts a nullableapiKeyand raises the newMissingApiKeyExceptionfor providers that need one, instead of relying on every call site to force-unwrap.- The CLI is invoked defensively. The prompt goes over stdin, not argv, so a multi-megabyte facts payload cannot exceed the platform argument limit. A response wrapped in a single enclosing code fence is unwrapped, which a raw API rarely needs but an agent CLI often does, and plain-text output is accepted from an agent whose installed version does not support its JSON flag.
- Failures degrade, they do not crash. A missing binary or a failing run raises
AgentCliException extends LlmApiException, so the existing template fallback covers it exactly as it covers a bad API key.FLUTTER_SKILL_CLAUDE_BIN,FLUTTER_SKILL_CODEX_BIN, andFLUTTER_SKILL_GEMINI_BINpoint a provider at a CLI that is named differently or is not on PATH. analyze,sync, andwatchwarn up front when generation will fall back to templates — a missing key, or a missing agent binary — via the newResolvedProvider.unavailableReason, which names the executable and the environment variable that repoints it. It stays a warning: a skill file is still produced.
Ship as an Agent Skill #
The analyzer does the scanning, an agent writes the prose, and the CLI verifies and assembles it. Three new commands split the model call out of the pipeline so any coding agent can stand in for it:
flutter_skill_gen promptscans the project and writes a.skill_work/handoff directory:plan.json(the scopes to write),facts.json, and oneprompts/<scope>.mdper planned skill file carrying the same system prompt and evidence-bearing JSON payload the API would have received. No model call, no key.flutter_skill_gen assemblereadsdrafts/<scope>.mdback, runs every draft throughDraftVerifieragainst the captured evidence bundle, splices in the generated diagrams and gotchas, adds frontmatter, and writes to every configured output target.--cleanremoves the work directory afterwards. Exit codes:66no workspace,65a missing or blank draft,1verification failed underFLUTTER_SKILL_VERIFIER_MODE=fatal.flutter_skill_gen install-skillinstalls the bundled Agent Skill into both.claude/skills/flutter-skill-gen/and.agents/skills/flutter-skill-gen/by default — between them, every agent that implements the standard.--agent claude|codex|gemini|opencode|agents|allnarrows it,--globalinstalls under the home directory, and--outputtargets any directory. Installation is all-or-nothing: if a skill already exists at either location, nothing is written until--forceis passed, so a half-installed skill can never be current for one agent and stale for another. The skill teaches the agent the full loop, including the rules that otherwise corrupt output — no frontmatter, no wrapping fences, no hand-written Gotchas or Data Flow sections, and the per-scope line budget.- The skill is written for any agent, not just Claude Code. Its first step checks the CLI with
--helpand looks forpromptin the command list, which also catches an install too old to have it, and it explains thedart run flutter_skill_genform for projects where the package is a dev dependency. A test fails the build if the skill ever names a command or flag the CLI does not accept. - An agent-written draft is held to the same standard as an API-written one. This matters more, not less: an agent can read the whole repository, so only the evidence bundle stops it asserting something plausible but absent.
SkillGenerator.assembleandassembleAllverify before finishing, andassembleAllraisesMissingDraftExceptionfor a scope the plan named but no draft covers. - Facts are written inside the workspace, not to
.skill_facts.json. Apromptrun that is never assembled must not advance the baselinesynccompares against, or the nextsyncwould see no change and skip a SKILL.md that is still stale.assemblewrites the root facts file at the end, asanalyzedoes. assemblewarns when the project changed between the two commands, naming the scopes that appeared or disappeared.
Known Limitations #
- The Codex and Gemini CLI providers are written from those tools' documented flags, not from a verified run.
codex exec --sandbox read-only -andgemini --output-format jsonwere taken from the official docs; only the Claude Code provider has been exercised end to end. A wrong flag is not destructive — the run fails and falls back to template output with the CLI's own error — but treat those two providers as unconfirmed until someone with them installed reports back. --provider gemini-clineeds a Gemini CLI new enough to accept--output-format. Older builds reject it; the client accepts their plain-text output, so generation still works.- Illustrative class names are still read as claims. A draft that writes
XxxInitStateas a placeholder, or "LoginNotifier-style" as a naming convention, has those tokens flagged as unknown classes, because the extractor matches any PascalCase word carrying a known suffix. Four of the twelve markers in the run above were this. Narrowing it risks weakening a check that does catch real hallucinations. - None of the agent-CLI providers suit CI. A build server is not signed in to an agent. Keep using
FLUTTER_SKILL_API_KEYthere.
Public API #
- New exports:
AgentCli,AgentCliClient,AgentCliException,CliInvocation,CliInvoker,MissingApiKeyException,MissingDraftException,SkillWorkspace,WorkspacePlan,WorkspaceException,AgentSkillAsset,SkillLocation. - New enum values
LlmProvider.claudeCode,LlmProvider.codex, andLlmProvider.geminiCli, plus the fieldLlmProvider.requiresApiKey. Exhaustive switches overLlmProviderin downstream code need new cases. LlmClientFactory.create'sapiKeyparameter is nowString?(wasString). Existing call sites passing a non-null key are unaffected.ConfigManager.envVarForreturns''for the three agent-CLI providers — they read no key from the environment.
1.0.0 #
Multi-Provider Support #
Skill generation is no longer tied to Anthropic. A provider-agnostic LlmClient seam sits between SkillGenerator and the network, with three implementations behind a factory — the generator calls one complete() method and never learns which vendor answered.
- Three providers.
anthropic(Claude Messages API,x-api-key),openai(any endpoint speaking OpenAI's/chat/completionsshape,Authorization: Bearer), andgemini(Google'sgenerateContent,x-goog-api-key). Selected with--provideronanalyze,sync,watch, andinit, or persisted withflutter_skill_gen config --set-provider. - OpenAI-compatible endpoints.
--provider openaicombined with--base-urltargets DeepSeek, Groq, Together, Fireworks, OpenRouter, and local Ollama or vLLM servers.LlmProvider.tryParseacceptsdeepseek,groq,together,fireworks,openrouter,ollama, andopenai-compatibleas aliases foropenai, plusclaudeforanthropicandgoogleforgemini, so--provider deepseek --base-url …reads naturally. - Provider-specific response handling. Each client normalises its vendor's quirks rather than assuming a common shape:
OpenAiCompatibleClientreadschoices[0].message.content, surfacesmessage.refusal, and distinguishes afinish_reason: lengthtruncation;GeminiClientreadscandidates[0].content.parts[], skips parts flaggedthought: true, and reportspromptFeedback.blockReasonandSAFETY/MAX_TOKENSfinish reasons, none of which arrive as HTTP errors. - Reasoning-model token field. OpenAI's reasoning models reject
max_tokensand namemax_completion_tokensin the error.OpenAiCompatibleClientsendsmax_tokensfirst — the field every compatible provider understands — and retries once withmax_completion_tokensonly when a 400 response explicitly asks for it. Unrelated 400s are not retried. LlmApiExceptionis the new provider-agnostic failure type.ClaudeApiExceptionnow extends it rather than implementingExceptiondirectly, so existingcatchsites and the exported type are unchanged, whileSkillGenerator's template fallback covers all three providers uniformly. A bad key, an unknown model, or a network error on any provider degrades to template output with a warning instead of failing the command.- New public exports:
LlmClient,LlmProvider,LlmApiException,LlmClientFactory,OpenAiCompatibleClient,GeminiClient, andResolvedProvider.
Bug Fixes — Thinking-Model Crash #
type 'Null' is not a subtype of type 'String' in type caston every request to a thinking-enabled model.ClaudeClient.completetookcontent.firstand cast itstextfield toString. Models that think by default when thethinkingparameter is omitted — Claude Sonnet 5, Opus 5, Opus 4.8, Opus 4.7 — return athinkingblock first, which has notextfield, so the cast hitnull. This killed the process on every AI-powered run against those models, in every project. The client now collects text by block type across all blocks, skipping thinking blocks and concatenating multi-block responses.- The crash also defeated the template fallback. A
TypeErroris not aClaudeApiException, so it slipped past thecatchinSkillGenerator._generateWithAiand terminated the process instead of degrading to template generation. Failures that produce no usable text now raiseClaudeApiException, restoring the fallback. - Refusals and truncation are now reported, not mis-parsed.
stop_reason: "refusal"(an HTTP 200 carrying no content) raises with itsstop_details.category, and a response whose budget was consumed before any text was produced reports the token limit and the block types received rather than failing obscurely. maxTokensdefault raised from 8192 to 16000 across all three clients. Thinking tokens are drawn from the same budget, so 8192 risked the model spending the entire allowance reasoning and returning nothing on a large project.
Bug Fixes — Deterministic Analysis #
- The same project produced different skill files on different machines.
FileUtils.collectDartFilesreturnedlistSyncresults in raw filesystem order — which varies by platform and by the order files happened to be created — while its siblinglistSubdirectoriessorted. Every consumer inherited that nondeterminism:CodeSamplerpicked whichever matching file the filesystem happened to yield first, so the representative bloc / repository / usecase samples spliced into.skill_facts.jsonand into every AI prompt could differ between a developer's machine and CI, or between two clones of the same repository. Results are now sorted by path. A practical side effect:sync's change detection compares against the previous.skill_facts.json, so unstable ordering could trigger regeneration — and a billable API call — when nothing had actually changed. - Restored three test fixtures that were never committed.
sample_bloc_projectwas missing itshome(full clean-arch) andcart(presentation-only) features, andsample_monorepo/apphad apubspec.yamlwith nolib/, soStructureAnalyzer.analyze()returned early at its missing-lib/guard and never evaluated package detection. Eight tests acrossstructure_analyzer,domain_analyzer, andproject_scannerhad been asserting against a fixture that did not exist on disk. The fixtures now match what those tests describe — includingcart's deliberately absentdata/anddomain/layers, which is what proves layer detection is per-feature rather than project-wide.
Per-Provider Configuration #
~/.flutter_skill_gen/config.yaml gained three keys. Existing config files keep working untouched — nothing needs migrating.
api_keys:— a per-provider key map. Keys are stored per provider, so configuring Gemini never overwrites your Anthropic key and switching back needs no re-entry.--set-keywrites to the active provider's slot; pass--set-providerin the same command and the provider is switched first, so the key lands where you expect.--remove-keylikewise clears only the active provider.provider:andbase_url:. Set withconfig --set-providerandconfig --set-base-url; both are shown byconfig --show, alongside the provider a masked key belongs to.- The legacy flat
api_key:field is still read, as the last fallback, answering for whichever provider is active — so single-provider Anthropic setups written before 1.0.0 continue to work with no changes.--remove-keyalso drops it, since it would otherwise keep answering for every provider. - Provider environment variables.
ANTHROPIC_API_KEY,OPENAI_API_KEY, andGEMINI_API_KEYare now read for the active provider. Full resolution order:FLUTTER_SKILL_API_KEY→ the provider's own variable →api_keys.<provider>→ the legacyapi_key. - Per-provider default models.
ConfigManager.defaultModelForreturnsclaude-sonnet-5,gpt-5.6-sol, orgemini-3.8-flash. Passing--providerwithout--modeluses that provider's default rather than the stored model, which usually belongs to a different vendor and would 404. - Model aliases are Anthropic-scoped.
sonnetandopusname Claude models, soConfigManager.resolveModelonly expands them underanthropic; any other provider receives the value unchanged. The method gained an optionalprovider:parameter defaulting toanthropic, so existing calls are unaffected. ConfigManageraccepts an injectedenvironmentmap, making key-resolution behaviour testable and keeping the suite hermetic against ambient provider keys.
Model Defaults #
- Bumped to the Claude 5 family. The built-in default moved from
claude-sonnet-4-6toclaude-sonnet-5, and theopusalias fromclaude-opus-4-7toclaude-opus-5. Unmapped IDs still pass through unchanged, so anyone with a specific model pinned in~/.flutter_skill_gen/config.yamlkeeps calling that exact model. - These two changes are coupled to the crash fix above: shipping the Claude 5 default without the block-parsing fix would have made the crash universal rather than opt-in.
Behaviour Changes #
Worth reading before upgrading:
- Provider environment variables are now read. If your shell already exports
ANTHROPIC_API_KEY,OPENAI_API_KEY, orGEMINI_API_KEY, flutter_skill_gen will start using it. An install that previously produced template output with no configuration may now make real, billable API calls.flutter_skill_gen config --showreports the key that will actually be used, after the full resolution order. - The default model changed, and
maxTokensrose from 8192 to 16000. Both affect per-run cost. --set-keywrites toapi_keys.<provider>, not the flatapi_key:field. Reads remain backward compatible.base_urlis a single global value, not per-provider. Setting it for DeepSeek and later switching to plain OpenAI will still target DeepSeek until it is cleared withconfig --set-base-url "".- Code samples may differ from 0.4.0 output. Sorting
collectDartFileschanges which fileCodeSamplerselects as the representative sample for a pattern, so regenerating an existing project can produce a different — but now stable —.skill_facts.jsonand skill file. - An unknown
--providervalue fails fast rather than silently falling back: exit code1fromanalyze,sync, andwatch, and64frominitandconfig --set-provider.
Documentation #
- README restructured around one
## AI Providerssection. Provider, key, and model guidance previously sat in four sections spread across the file; setting up a non-default provider meant reading all four and reconciling them. They are now consolidated in reading order — pick a provider, set it up, use a compatible service, choose a model, where keys are read from, what happens when a call fails — with per-provider key sources, environment variables, and a troubleshooting table. - Fixed a nesting bug where
### Project config (.skillrc.yaml)had become a subsection of API-key documentation rather than of## Configuration. - Quick Start now leads with the zero-configuration path, since skill generation has never required an API key.
0.4.0 #
Claude Code Best-Practice Alignment #
Generated skills now follow the patterns the Claude Code team has published for agentic engineering — lazy-loading, tight line budgets, gotchas, and data-flow diagrams. All changes are additive on the output side; existing AI and template paths still produce valid SKILL.md files.
paths:frontmatter for lazy loading. Every generatedSKILL.md/SKILL_<feature>.md/CLAUDE_<feature>.mdnow emits apaths:YAML block so Claude Code only loads a skill when a file matching one of its globs is touched. The core skill is scoped topubspec.yaml,lib/main.dart, and anylib/core/,lib/shared/,lib/common/,lib/config/, orlib/app/tree that actually exists; in single-file mode it also getslib/**/*.dart. Per-feature skills getlib/<feature-path>/**/*.dartderived from the evidence bundle.- Per-skill line budget. All three system prompts (single, core, domain) now carry a hard line ceiling (180 / 150 / 120 lines respectively, with lower aim targets) replacing the old word budgets.
DraftVerifiergained a newViolationKind.overLineBudgetthat flags drafts over 200 lines — Claude Code's published degradation threshold. The new check is draft-level rather than line-scoped, soannotate/stripmodes don't munge the file; the signal surfaces via the verifier warning log. - Deterministic Gotchas + Data Flow sections. Two new trusted-source modules,
GotchasLibraryandAsciiDiagrams, emit a## Gotchasbullet list and a## Data FlowASCII diagram for every skill. Rules are keyed by detected stack (bloc, riverpod, go_router, auto_route, get_it+injectable, freezed+hive pairs, clean-arch missing-layer, feature-first-no-shared, and more) and feature-scoped variants. Because both sections are generated from grounded detection — never from AI output — they bypass the hallucination surface and are spliced onto every draft after verification. The prompts now explicitly tell Claude not to write these sections. - Description fields are loading triggers, not summaries. The
description:YAML field is what Claude Code matches against the current task to decide when to surface a skill. Previous descriptions read like human project summaries ("Core architecture, conventions, and dependencies for <project>"); 0.4.0 rewrites them as load-trigger clauses ("Load when working in the Flutter + clean architecture + bloc app "<project>" — architecture, conventions, and project-specific rules."). Domain skills get"Load when editing the <feature> feature (<layers>) in <project>". - No-boilerplate prompt discipline. All three prompts now carry an explicit
Do NOT state the obviousclause — no "this is a Flutter project", no generic BLoC/Riverpod/Clean Architecture primer content, only project-specific rules that would surprise a mid-level Flutter engineer who just cloned the repo. - Split threshold lowered.
_recommendSkillFilespreviously held single-file output up to 50 files / 3 features; with a 200-line skill budget that threshold produced overflow. The cut now sits at 30 files / 2 features, so medium projects split sooner and each file stays lean.
0.3.1 #
Bug Fixes — Audit-Driven Accuracy #
Three issues surfaced by a real-world tng_laws_ai_mobile audit against 0.3.0:
- Feature cap silently dropped beyond the first 5.
_recommendSkillFileswas doingstructure.featureDirs.take(5), so any project with more than five features had its 6th+ feature quietly omitted from bothrecommended_skill_filesand the split plan. Projects like moneypal and tng_laws_ai_mobile were missingprofile,onboarding,shared, andnavigationskills even though the features were correctly detected. The cap is gone — every detected feature now produces a per-feature skill. - Dev dependencies were silently dropped.
PubspecAnalyzer.analyzeDependenciesonly routed dev deps intocode_generation/testingbuckets and discarded everything else (flutter_lints,flutter_launcher_icons,flutter_native_splash, etc.), so generated skill files had no signal that a project was, for instance, using stock Flutter lints.DependencyInfonow carries a newdev_dependencieslist (exposed in.skill_facts.jsonasdev_dependencies) that preserves every dev dep minusflutter/flutter_localizations. - Stock
flutter createwidget test was counted as real coverage._analyzeTestsflaggedhasWidgetTests=truewhenever any file containedtestWidgets(orpumpWidget(— including the untouchedtest/widget_test.dartcounter-increment stub that ships withflutter create. The scanner now recognizes the stock template (referencesMyApp(, tapsIcons.add, asserts the'0'→'1'transition) and excludes it from the widget-test signal.
0.3.0 #
Bug Fixes — Multi-File Output & Per-Feature Evidence #
Two regressions surfaced by a real-world audit of a complex Riverpod app using this package:
- Per-feature evidence was empty in layer-first projects.
feature_evidence[].file_countwas0under every feature in.skill_facts.jsonwhen features sat directly underlib/ui/<feature>(orlib/presentation/<feature>) with no intermediatepages/,features/, orscreens/container. Root cause:DomainAnalyzer._findDomainDirectorywas missing the direct-layer-container tier thatStructureAnalyzer._findFeatureDirgained in 0.1.2.ProjectScannernow threads the already-resolved feature path fromStructureAnalyzer.analyzeFeatureBreakdownintoDomainAnalyzer.analyze(..., resolvedPath: ...), and the analyzer's own lookup also mirrors the structure analyzer's full priority order as belt-and-suspenders. - Split mode generated one concatenated SKILL.md, not per-feature files. The default
genericandclaude_codewriters hadsupportsMultiFile=false, soTargetWriter.writeMultiSkillconcatenated every skill into a single file whileManifestGeneratorsimultaneously promisedSKILL_<feature>.mdsiblings that never landed on disk. Both writers nowsupportsMultiFile=trueand produceSKILL_<feature>.md/CLAUDE_<feature>.mdsiblings at the project root — matching the layout the manifest already advertises. - Forced split now expands to every detected feature.
SplitPlanner.plan(..., forceSplit: true)previously only iteratedrecommendedSkillFiles(which caps at 5 features and skips the "core-only" threshold). Explicit--splitnow unions instructure.featureDirsso small-but-multi-feature projects produce one skill per feature as expected. - Manifest is grounded in the plan.
ManifestGenerator.write(..., plan: plan)(wired intoanalyze,sync, andwatch) references only the skill files the plan will actually produce, eliminating the phantomSKILL_data.md-style entries when a recommended domain turns out to have nolib/directory.
Regression tests in test/regression/multi_file_and_evidence_test.dart lock in both fixes, and a new sample_layer_first_project fixture exercises the moneypal-style lib/ui/<feature> pattern end-to-end.
0.2.1 #
Default Model Update #
- Bumped the built-in default model from
claude-sonnet-4-20250514toclaude-sonnet-4-6(Sonnet 4.6), and refreshed theopusalias target toclaude-opus-4-7(Opus 4.7). The alias map anddefaultModelare now consistent —--model sonnet, an unset global config, and a missing--modelflag all resolve to the same model. Users withclaude-sonnet-4-20250514pinned in their~/.flutter_skill_gen/config.yamlcontinue to call that exact model (unmapped IDs pass through unchanged).
0.2.0 #
Hallucination-Proof Generation #
- EvidenceBundle — new ground-truth payload emitted by
ProjectScannerthat enumerates everylib/file path, every declared class name, per-feature layer/state/widget evidence, known file-name glob patterns, and DI registration style (centralizedvsper-feature). Serialized into.skill_facts.jsonand spliced into every Claude prompt. - Grounding rules — every system prompt (single, core, domain) now carries a
CRITICAL — grounding rulesblock instructing the model to draw class names, file paths, globs, and DI claims exclusively fromevidence.*fields. Available asPromptBuilder.groundingRulesfor reuse. - DraftVerifier — post-generation pass that cross-checks AI drafts against the evidence bundle. Flags four violation kinds:
unknownFilePath,unknownClassName,unknownGlobPattern, andfalseDiPerFeatureClaim. Configurable viaVerifierMode.annotate(default — inline<!-- [UNVERIFIED: …] -->markers),VerifierMode.strip(delete offending lines), orVerifierMode.fatal(raiseDraftVerificationFailedException). - Env-var configuration — the
FLUTTER_SKILL_VERIFIER_MODEenvironment variable selects the verifier mode globally (annotate|strip|fatal; case-insensitive; unknown values fall back toannotate). An explicitverifierModeconstructor argument overrides the env var. - Domain-scoped prompts now include a trimmed evidence slice containing the relevant
feature_evidenceentry plus project-wide DI and file manifest — keeps per-feature drafts grounded without bloating the prompt.
0.1.2 #
Bug Fixes #
- Fixed feature detection for layer-first projects where features sit directly under
lib/ui/orlib/presentation/without an intermediatepages/,features/, orscreens/container. Previously these projects were detected as having 0–2 features and always fell back to single-file output; they now produce proper multi-skill splits.
0.1.1 #
Documentation Updates #
- Added
example/README.mdwith end-to-end CLI usage scenarios covering analyze, multi-target sync, watch mode, project scaffolding, API key config, and git hooks. - Documented the implicit
FormatWriterdefault constructor so 100% of the public API is covered by dartdoc.
0.1.0 #
Initial release.
Static Analysis #
- PubspecAnalyzer — parses
pubspec.yamlfor dependencies, SDK constraints, and package metadata. - StructureAnalyzer — detects folder organization (feature-first, layer-first, hybrid), monorepo structure, and project complexity.
- PatternDetector — identifies architecture patterns (Clean Architecture, MVVM, MVC), state management (BLoC, Riverpod, Provider, GetX, MobX, Cubit), navigation, DI, networking, storage, code generation, and internationalization.
- CodeSampler — extracts representative code samples (widgets, BLoC/state classes, repositories, models, route configs, DI setup) with context-aware classification.
- DomainAnalyzer — scans individual feature directories to produce domain-scoped analysis (state classes, entities, layer breakdown, code samples).
- ProjectScanner — orchestrates all analyzers into a unified
ProjectFactsmodel. - FactsWriter — writes
.skill_facts.jsonwith full project analysis data.
AI-Powered Generation #
- ClaudeClient — HTTP client for the Claude Messages API.
- PromptBuilder — constructs system and user prompts for core, domain, and single-file skill generation.
- SkillGenerator — generates skill content via Claude API with automatic template fallback when no API key is configured.
- TemplateGenerator — produces skill files from raw facts without an API call (core, domain, and single-file modes).
- ManifestGenerator — writes
.skill_manifest.yamlwith machine-readable project metadata.
Multi-File Skill Splitting #
- SplitPlanner — decides whether to generate a single skill file or split into core + domain files based on project complexity.
- DomainFacts model — domain-scoped analysis data (files, samples, layers, state classes, entities) for per-feature skill generation.
- Auto-detection based on project complexity; controllable via
--split/--no-splitflags. - Formats that support multi-file write separate files per skill; formats that support concatenation join skills with section separators; others receive core-only output.
Model Selection #
- Choose between Claude Sonnet (default) and Claude Opus via
--modelflag or global config. - Supports shortcut aliases (
sonnet,opus) and full model IDs. - Priority chain: CLI flag > global config > built-in default (Sonnet).
CLI Commands #
analyze— scan a project and generate.skill_facts.json,SKILL.md, and.skill_manifest.yaml. Supports--split,--facts-only,--model,--output, and--verbose.sync— re-analyze and regenerate all skill files with change detection to skip unnecessary regeneration. Supports--force,--ci,--split, and--model.watch— monitorlib/andpubspec.yamlfor changes and regenerate skill files automatically with configurable debounce. Supports--debounceand--model.init— scaffold a new project from a built-in template (clean_bloc,clean_riverpod) or clone a GitHub repository, then generate skill files. Supports--arch,--from-repo,--name,--output, and--model.config— manage global config (API key, model) and project config (output targets,.skillrc.yaml). Supports--set-key,--set-model,--remove-key,--init-skillrc,--add-target,--remove-target, and--show.hooks— install/remove pre-commit and post-merge git hooks, generate GitHub Actions workflow. Supports--install,--remove,--github-action,--dart-only, and--status.
Output Targets #
- 8 output formats:
generic(SKILL.md),claude_code(CLAUDE.md),cursor(.cursorrules),copilot(.github/copilot-instructions.md),windsurf(.windsurfrules),antigravity(.agents/skills/<name>/SKILL.md),antigravity_rules(.gemini/GEMINI.md),agents_md(AGENTS.md). - Multi-target support via
.skillrc.yaml— write to multiple AI tools simultaneously. - TargetWriter dispatches to format-specific writers with multi-file, concatenation, and core-only strategies.
Configuration #
- Global config at
~/.flutter_skill_gen/config.yamlfor API key and model preference. - Project config at
.skillrc.yamlfor output targets and watch settings. - Environment variable support (
FLUTTER_SKILL_API_KEY).
CI & Automation #
- GitHooksInstaller — pre-commit and post-merge hooks that run
flutter_skill_gen sync. - GitHubActionGenerator — generates
.github/workflows/skill_sync.ymlwith Flutter or Dart-only SDK setup.
VS Code Extension #
- Command palette integration (Analyze, Sync, Watch, Preview).
- Status bar indicator (idle, syncing, watching, error).
- Skill file preview in markdown.
- Git hooks and GitHub Action generation from the editor.