<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas Menezes</title>
    <description>The latest articles on DEV Community by Lucas Menezes (@lucasmenezeslc).</description>
    <link>https://dev.to/lucasmenezeslc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4224983%2F745107b8-2454-47b9-b16d-c15a2125fc04.jpg</url>
      <title>DEV Community: Lucas Menezes</title>
      <link>https://dev.to/lucasmenezeslc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lucasmenezeslc"/>
    <language>en</language>
    <item>
      <title>Código morto em Flutter é mais do que um warning do analyzer</title>
      <dc:creator>Lucas Menezes</dc:creator>
      <pubDate>Tue, 03 Nov 2026 23:07:00 +0000</pubDate>
      <link>https://dev.to/lucasmenezeslc/codigo-morto-em-flutter-e-mais-do-que-um-warning-do-analyzer-28la</link>
      <guid>https://dev.to/lucasmenezeslc/codigo-morto-em-flutter-e-mais-do-que-um-warning-do-analyzer-28la</guid>
      <description>&lt;p&gt;Encontrar um warning &lt;code&gt;unused_element&lt;/code&gt; é fácil. Decidir se um arquivo pode ser apagado com segurança não é.&lt;/p&gt;

&lt;p&gt;Aplicações Flutter possuem várias formas legítimas de usar código sem uma referência direta óbvia: registries gerados, tabelas de rotas, injeção de dependências, imports condicionais, flavors, platform channels, annotations, helpers exclusivos de testes e exports públicos de packages. Uma busca que retorna zero referências é uma evidência útil, mas não é um veredito.&lt;/p&gt;

&lt;p&gt;Essa diferença me levou a criar a &lt;strong&gt;flutter-dead-code-audit&lt;/strong&gt;, uma Agent Skill open source para auditar declarações Dart sem uso e arquivos &lt;code&gt;.dart&lt;/code&gt; potencialmente órfãos por meio de um fluxo que exige revisão antes da remoção.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit/blob/main/assets/demo.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkqjj33ga2c7nkj9p4yfl.png" alt="Demonstração da flutter-dead-code-audit" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;▶️ &lt;strong&gt;&lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit/blob/main/assets/demo.mp4" rel="noopener noreferrer"&gt;Assista à demonstração curta&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Repositório: &lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit" rel="noopener noreferrer"&gt;github.com/LucasMenezeslc/flutter-dead-code-audit&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  O analyzer responde apenas parte da pergunta
&lt;/h2&gt;

&lt;p&gt;O analyzer do Dart é excelente para encontrar problemas locais como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;imports sem uso;&lt;/li&gt;
&lt;li&gt;campos e métodos privados sem uso;&lt;/li&gt;
&lt;li&gt;branches inalcançáveis;&lt;/li&gt;
&lt;li&gt;variáveis locais sem uso;&lt;/li&gt;
&lt;li&gt;expressões redundantes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mas uma limpeza de repositório também precisa responder perguntas mais amplas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;O arquivo é alcançável por algum entrypoint suportado?&lt;/li&gt;
&lt;li&gt;O símbolo chega ao consumidor por um barrel export?&lt;/li&gt;
&lt;li&gt;Ele é registrado por injeção de dependências?&lt;/li&gt;
&lt;li&gt;É carregado apenas em uma plataforma ou flavor?&lt;/li&gt;
&lt;li&gt;Faz parte de uma API pública consumida fora do repositório?&lt;/li&gt;
&lt;li&gt;É gerado ou pertence a um generator?&lt;/li&gt;
&lt;li&gt;Foi mantido intencionalmente por compatibilidade ou rollback?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Uma ferramenta que ignora essas perguntas pode produzir um relatório convincente e ainda recomendar a remoção errada.&lt;/p&gt;

&lt;h2&gt;
  
  
  Estado write-only é um bom exemplo
&lt;/h2&gt;

&lt;p&gt;Considere um campo que recebe valores em diferentes callbacks, mas nunca é lido:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onStarted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onStopped&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mecanicamente, o campo é write-only. Remover apenas a declaração não basta; todas as atribuições também precisam ser removidas para o código continuar compilando.&lt;/p&gt;

&lt;p&gt;Existe, porém, uma pergunta de produto mais importante: o campo foi abandonado ou faltou uma leitura que deveria controlar replay, analytics, persistência ou estado visual?&lt;/p&gt;

&lt;p&gt;Portanto, a conclusão correta não é automaticamente “cleanup seguro”. Ela pode ser:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;O campo é write-only no código atual, mas a intenção de produto ainda não foi resolvida.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Por isso o fluxo separa evidência mecânica de decisão humana.&lt;/p&gt;

&lt;h2&gt;
  
  
  Um fluxo orientado à revisão
&lt;/h2&gt;

&lt;p&gt;A skill trabalha em quatro etapas:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Audit
&lt;/h3&gt;

&lt;p&gt;O modo Audit é somente leitura. Os scripts combinam:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;diagnósticos do analyzer em formato legível por máquina;&lt;/li&gt;
&lt;li&gt;reachability determinística de imports, exports e arquivos &lt;code&gt;part&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;buscas de símbolos e strings em todo o repositório;&lt;/li&gt;
&lt;li&gt;verificações de rotas, DI, codegen, plataformas, flavors, testes e APIs públicas.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;O resultado é uma lista de candidatos, não uma lista automática de exclusão.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Review
&lt;/h3&gt;

&lt;p&gt;Os candidatos são apresentados em grupos pequenos. Cada um recebe uma decisão:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;remove&lt;/code&gt; — evidência e contexto sustentam a remoção;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;retain&lt;/code&gt; — manter intencionalmente e registrar o motivo;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;defer&lt;/code&gt; — ainda faltam evidências ou contexto do time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Código mantido continua visível em relatórios futuros. Ele não é silenciosamente ignorado, evitando que a mesma investigação seja repetida alguns meses depois.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cleanup
&lt;/h3&gt;

&lt;p&gt;O Cleanup só pode alterar candidatos explicitamente aprovados como &lt;code&gt;remove&lt;/code&gt;. As mudanças são aplicadas em lotes pequenos e seguidas por analyzer e testes.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Tests
&lt;/h3&gt;

&lt;p&gt;Depois da limpeza, o relatório sugere verificações de comportamento com base na área afetada. A remoção de um campo de playback, por exemplo, deve gerar um checklist do fluxo de reprodução — não apenas um analyzer verde.&lt;/p&gt;

&lt;p&gt;Correção estática é necessária, mas não prova que o comportamento suportado foi preservado.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidência em vez de confiança aparente
&lt;/h2&gt;

&lt;p&gt;Um candidato de alta confiança normalmente precisa de pelo menos dois sinais independentes e de verificações de falso positivo concluídas.&lt;/p&gt;

&lt;p&gt;A hierarquia de evidências utilizada é:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;diagnóstico do analyzer ou compilador;&lt;/li&gt;
&lt;li&gt;reachability por imports, exports e &lt;code&gt;part&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;buscas de símbolos e strings no repositório;&lt;/li&gt;
&lt;li&gt;inspeção de registros em runtime e mecanismos do framework;&lt;/li&gt;
&lt;li&gt;testes ou builds após uma remoção aprovada.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Quando os sinais entram em conflito, a confiança diminui. O fluxo não esconde o conflito atrás de uma média.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relatórios feitos para decidir
&lt;/h2&gt;

&lt;p&gt;Listas enormes são difíceis de revisar. Por isso, os resultados são agrupados em:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ready for review&lt;/strong&gt; — evidência forte e nenhum consumidor dinâmico plausível;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review carefully&lt;/strong&gt; — provável código morto em uma fronteira sensível;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs team context&lt;/strong&gt; — a intenção não pode ser determinada pelo repositório;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Potential logic issue&lt;/strong&gt; — pode revelar um bug em vez de cleanup;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intentionally retained&lt;/strong&gt; — mantido com motivo documentado;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not dead / excluded&lt;/strong&gt; — investigado e confirmado como ativo ou protegido.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cada candidato preserva localização, evidências, verificações, confiança, risco, recomendação e comando de validação. A visão executiva permanece compacta, enquanto os detalhes ficam disponíveis quando necessários.&lt;/p&gt;

&lt;h2&gt;
  
  
  Instalação
&lt;/h2&gt;

&lt;p&gt;Na raiz de um projeto Flutter ou Dart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add LucasMenezeslc/flutter-dead-code-audit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depois, comece com uma solicitação somente leitura:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use $flutter-dead-code-audit em modo Audit neste projeto.
Não modifique arquivos. Gere um relatório e apresente o primeiro grupo para revisão.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Os scripts exigem Python 3.10 ou superior e utilizam apenas a biblioteca padrão. O Dart pode vir do &lt;code&gt;PATH&lt;/code&gt; ou do FVM. A saída utiliza caminhos relativos para não expor o diretório absoluto do projeto nos relatórios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limites atuais
&lt;/h2&gt;

&lt;p&gt;A skill ainda não audita:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;código duplicado;&lt;/li&gt;
&lt;li&gt;assets ou traduções sem uso;&lt;/li&gt;
&lt;li&gt;dependências sem uso no &lt;code&gt;pubspec.yaml&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;performance ou segurança da aplicação.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ela também não instala ferramentas no projeto, não altera regras do analyzer e não remove arquivos gerados diretamente durante uma auditoria.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sugestões e contribuições são bem-vindas
&lt;/h2&gt;

&lt;p&gt;O projeto usa licença MIT e está aberto a contribuições. O feedback mais útil é um exemplo Flutter ou Dart pequeno e reproduzível que revele um falso positivo, um falso negativo ou uma forma de uso dinâmico ainda não modelada.&lt;/p&gt;

&lt;p&gt;Se você já encontrou código aparentemente morto escondido por rotas, injeção de dependências, codegen, imports condicionais, implementações de plataforma ou exports públicos, quero conhecer esse caso.&lt;/p&gt;

&lt;p&gt;Repositório: &lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit" rel="noopener noreferrer"&gt;flutter-dead-code-audit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>opensource</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Dead Code in Flutter Is More Than an Analyzer Warning</title>
      <dc:creator>Lucas Menezes</dc:creator>
      <pubDate>Tue, 03 Nov 2026 23:07:00 +0000</pubDate>
      <link>https://dev.to/lucasmenezeslc/dead-code-in-flutter-is-more-than-an-analyzer-warning-53d3</link>
      <guid>https://dev.to/lucasmenezeslc/dead-code-in-flutter-is-more-than-an-analyzer-warning-53d3</guid>
      <description>&lt;p&gt;Finding an &lt;code&gt;unused_element&lt;/code&gt; warning is easy. Deciding whether a file is safe to delete is not.&lt;/p&gt;

&lt;p&gt;Flutter applications have several legitimate ways to use code without an obvious direct reference: generated registries, route tables, dependency injection, conditional imports, flavors, platform channels, annotations, test-only helpers, and public package exports. A search that returns zero references is useful evidence, but it is not a verdict.&lt;/p&gt;

&lt;p&gt;That distinction led me to build &lt;strong&gt;flutter-dead-code-audit&lt;/strong&gt;, an open-source Agent Skill for auditing unused Dart declarations and potentially orphaned &lt;code&gt;.dart&lt;/code&gt; files through a review-first workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit/blob/main/assets/demo-en.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5hom6orcgpxezkn4n6qg.png" alt="flutter-dead-code-audit demo" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;▶️ &lt;strong&gt;&lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit/blob/main/assets/demo-en.mp4" rel="noopener noreferrer"&gt;Watch the short demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit" rel="noopener noreferrer"&gt;github.com/LucasMenezeslc/flutter-dead-code-audit&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The analyzer answers only part of the question
&lt;/h2&gt;

&lt;p&gt;The Dart analyzer is excellent at detecting local issues such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unused imports;&lt;/li&gt;
&lt;li&gt;unused private fields and methods;&lt;/li&gt;
&lt;li&gt;unreachable branches;&lt;/li&gt;
&lt;li&gt;unused local variables;&lt;/li&gt;
&lt;li&gt;redundant expressions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But repository cleanup also involves broader questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this file reachable from a supported entrypoint?&lt;/li&gt;
&lt;li&gt;Is the symbol referenced through a barrel export?&lt;/li&gt;
&lt;li&gt;Is it registered by dependency injection?&lt;/li&gt;
&lt;li&gt;Is it loaded only for one platform or flavor?&lt;/li&gt;
&lt;li&gt;Is it a public API consumed outside the repository?&lt;/li&gt;
&lt;li&gt;Is it generated or owned by a generator?&lt;/li&gt;
&lt;li&gt;Is it intentionally retained for compatibility or rollback?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A tool that ignores these questions may produce a convincing report and still recommend the wrong deletion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write-only state is a good example
&lt;/h2&gt;

&lt;p&gt;Consider a field that is assigned in several lifecycle callbacks but never read:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onStarted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onStopped&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_hasPlayed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mechanically, the field is write-only. Removing the declaration alone is not enough; every assignment must also be removed for the code to compile.&lt;/p&gt;

&lt;p&gt;However, there is a more important product question: was the field abandoned, or was a missing read supposed to control replay, analytics, persistence, or UI state?&lt;/p&gt;

&lt;p&gt;The correct finding is therefore not automatically “safe cleanup.” It may be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The field is write-only in the current code, but product intent is unresolved.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is why the workflow separates mechanical evidence from human decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  A review-first workflow
&lt;/h2&gt;

&lt;p&gt;The skill uses four stages:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Audit
&lt;/h3&gt;

&lt;p&gt;Audit mode is read-only. The bundled scripts combine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;machine-readable Dart analyzer diagnostics;&lt;/li&gt;
&lt;li&gt;deterministic import, export, and &lt;code&gt;part&lt;/code&gt; reachability;&lt;/li&gt;
&lt;li&gt;repository-wide symbol and string searches;&lt;/li&gt;
&lt;li&gt;checks for routes, DI, code generation, platforms, flavors, tests, and public APIs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is a list of candidates, not an automatic deletion list.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Review
&lt;/h3&gt;

&lt;p&gt;Candidates are presented in small groups. Each receives one of three decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;remove&lt;/code&gt; — evidence and context support removal;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;retain&lt;/code&gt; — keep intentionally and record the reason;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;defer&lt;/code&gt; — more evidence or team context is required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Retained code remains visible in later reports. It is not silently ignored, which prevents the same investigation from being repeated every few months.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cleanup
&lt;/h3&gt;

&lt;p&gt;Cleanup is allowed only for candidates explicitly approved as &lt;code&gt;remove&lt;/code&gt;. Removals are applied in small batches, followed by analyzer and test verification.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Tests
&lt;/h3&gt;

&lt;p&gt;After cleanup, the report suggests behavior-oriented checks based on the affected area. Removing a playback field, for example, should result in a playback test checklist rather than only a green static analyzer result.&lt;/p&gt;

&lt;p&gt;Static correctness is necessary, but it does not prove that supported behavior survived.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence instead of confidence theater
&lt;/h2&gt;

&lt;p&gt;A high-confidence finding should normally have at least two independent signals and cleared false-positive checks.&lt;/p&gt;

&lt;p&gt;The evidence hierarchy used by the skill is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;analyzer or compiler diagnostics;&lt;/li&gt;
&lt;li&gt;import/export/part reachability;&lt;/li&gt;
&lt;li&gt;repository-wide symbol and string searches;&lt;/li&gt;
&lt;li&gt;runtime registration and framework-specific inspection;&lt;/li&gt;
&lt;li&gt;tests or builds after an approved removal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When signals conflict, confidence goes down. The workflow does not average the conflict away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reports designed for decisions
&lt;/h2&gt;

&lt;p&gt;Large raw lists are difficult to review. The report therefore groups findings into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ready for review&lt;/strong&gt; — strong evidence and no plausible dynamic consumer;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review carefully&lt;/strong&gt; — likely unused but located at a sensitive boundary;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs team context&lt;/strong&gt; — intent cannot be established from the repository;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Potential logic issue&lt;/strong&gt; — may reveal a bug rather than cleanup;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intentionally retained&lt;/strong&gt; — kept with a documented reason;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not dead / excluded&lt;/strong&gt; — investigated and shown to be live or protected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every candidate preserves its location, evidence, checks, confidence, risk, recommendation, and verification command. The executive view stays compact while detailed evidence remains available when needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;From the root of a Flutter or Dart project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add LucasMenezeslc/flutter-dead-code-audit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then start with a read-only request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use $flutter-dead-code-audit in Audit mode on this project.
Do not modify files. Create a report and present the first review group.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The scripts require Python 3.10 or newer and use only the Python standard library. Dart can come from &lt;code&gt;PATH&lt;/code&gt; or FVM. Script output uses relative paths so reports do not expose the absolute project directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current boundaries
&lt;/h2&gt;

&lt;p&gt;The skill does not currently audit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;duplicate code;&lt;/li&gt;
&lt;li&gt;unused assets or localization resources;&lt;/li&gt;
&lt;li&gt;unused dependencies in &lt;code&gt;pubspec.yaml&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;application performance or security.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also does not install project tooling, rewrite analyzer rules, or hand-delete generated files during an audit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback is welcome
&lt;/h2&gt;

&lt;p&gt;The project is MIT licensed and open to contributions. The most useful feedback is a small reproducible Flutter or Dart example that exposes a false positive, a false negative, or a dynamic usage pattern that is not yet modeled.&lt;/p&gt;

&lt;p&gt;If you have encountered dead code hidden behind routing, dependency injection, code generation, conditional imports, platform implementations, or package exports, I would like to learn from that case.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/LucasMenezeslc/flutter-dead-code-audit" rel="noopener noreferrer"&gt;flutter-dead-code-audit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>opensource</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
