[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BV5TZSPZ1KT8TGCKYVWH5F":3,"skill-same:01M7BV5TZSPZ1KT8TGCKYVWH5F":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7BV5TZSPZ1KT8TGCKYVWH5F","dart-use-ffigen",null,"Guide agents to use `package:ffigen` to automatically generate FFI bindings instead of writing them manually. Use this skill when a task involves writing new FFI bindings, extending C\u002FObjective-C\u002FSwift integrations, or replacing hand-crafted `dart:ffi` setups.","nguyenhungtran18\u002Fskill-and-tool-tracker","nguyenhungtran18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F297063550?v=4","01M7BV0BFPRRFP84F2ME0FYZ9D","01M7BV0BG83FA5P22NJV0GR0A5",1,"MIT","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fdart-use-ffigen\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dart-use-ffigen\ndescription: Guide agents to use `package:ffigen` to automatically generate FFI bindings instead of writing them manually. Use this skill when a task involves writing new FFI bindings, extending C\u002FObjective-C\u002FSwift integrations, or replacing hand-crafted `dart:ffi` setups.\nmetadata:\n  model: models\u002Fgemini-3.1-pro-preview\n  last_modified: Thu, 28 May 2026 07:21:07 GMT\n---\n# Generating FFI Bindings using package:ffigen\n\n## Contents\n- [Introduction](#introduction)\n- [Constraints](#constraints)\n- [FFIgen Overview](#ffigen-overview)\n- [Step-by-Step Workflow](#step-by-step-workflow)\n- [Concrete Example: Binding a C Library](#concrete-example-binding-a-c-library)\n- [Verification Checklist](#verification-checklist)\n\n## Introduction\n\nAutomate and standardize the generation of FFI bindings using `package:ffigen` (`FfiGenerator`). Writing FFI bindings by hand is error-prone, brittle, and highly discouraged.\n\n## Constraints\n\n*   **No Hand-Written FFI Bindings**: If native headers (`.h` files) exist or are generated by a build step, never write manual `DynamicLibrary.lookup`, `@Native` external functions, or raw struct classes. Always use `FfiGenerator` to generate them.\n*   **Generator Location**: The generator script should be located at `tool\u002Fffigen.dart` within the target package root.\n*   **Header Location**: If the native header files are third-party, they should be located in `third_party\u002F` within the target package (otherwise placing them in a `src\u002F` directory at the package root is also acceptable). If the headers are not in one of these standard locations, notify the user that it would be cleaner to move the header files to the standard location (e.g., `third_party\u002F`).\n*   **Targeted Inclusion Filters**: Avoid importing an entire native library unless specifically needed. Always apply precise inclusion lists using positive matches to minimize the size and cognitive load of the generated code (e.g., using `Functions.includeSet` or filtering matches in `include` closures).\n*   **Output Setup**: If the generated FFI bindings interface with a third-party library (or reference third-party headers), the generated files must always be placed under `lib\u002Fsrc\u002Fthird_party\u002F`. The primary generated FFI bindings file must strictly use the `.g.dart` extension (e.g. `sqlite3.g.dart`).\n*   **Preamble & License Headers**: Always supply a premium `preamble` in the `Output` class to specify the license. This must match the native third-party library's license, explicitly include the copyright header of the target native header file, and contain an automatic generation warning (e.g. `\u002F\u002F Generated by package:ffigen. Do not edit manually.`).\n*   **No Unnecessary Commits of Stale Bindings**: Ensure you run the generator script and check if the generated files have changed *before* finishing your task. Always verify the package by running `dart analyze`.\n*   **Record Usage and Tree Shaking**: If the package is integrated into standard runtime execution or compiles native assets via native hooks:\n    *   Enable recorded usage on all functions by setting `recordUse: (_) => true` under `Functions`.\n    *   Specify the `recordUseMapping` target in `Output` (which must strictly be a `.g.dart` file under `lib\u002Fsrc\u002Fthird_party\u002F`, e.g. `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart`) to register bindings for symbol tree shaking.\n\n## FFIgen Overview\n\nTo construct the programmatic generator, use the core configuration objects imported from `package:ffigen\u002Fffigen.dart`:\n\n### 1. `FfiGenerator`\nThe parent class that orchestrates the configuration, parsing, and code generation.\n```dart\nFfiGenerator({\n  Headers headers = const Headers(),\n  Enums enums = Enums.excludeAll,\n  Functions functions = Functions.excludeAll,\n  Globals globals = Globals.excludeAll,\n  Integers integers = const Integers(),\n  Macros macros = Macros.excludeAll,\n  Structs structs = Structs.excludeAll,\n  Typedefs typedefs = Typedefs.excludeAll,\n  Unions unions = Unions.excludeAll,\n  UnnamedEnums unnamedEnums = UnnamedEnums.excludeAll,\n  ObjectiveC? objectiveC,\n  required Output output,\n}).generate();\n```\n\n### 2. `Headers`\nConfigures Clang header parsing targets and compiler flags.\n*   `entryPoints`: A list of target header `Uri` inputs.\n*   `include`: A filter function `bool Function(Uri header)` that handles transitive header imports.\n*   `compilerOptions`: Custom preprocessor\u002Finclude compiler flags to pass directly to libclang.\n*   `ignoreSourceErrors`: Set to `true` to silence errors occurring inside third-party headers during parsing.\n\n### 3. `Functions`\nSpecifies which native C\u002FC++ functions to expose in Dart.\n*   `include`: A matcher function (e.g. `(decl) => {'my_func'}.contains(decl.originalName)` or `Functions.includeSet({'my_func'})`).\n*   `isLeaf`: Declares functions as leaf functions (`(decl) => true`) if they do not call back into Dart or block thread execution.\n*   `recordUse`: Enables metadata generation for native asset tree shaking (essential in `dart-lang\u002Fnative`). Set to `(_) => true`.\n\n### 4. `Output`\nConfigures target generated files.\n*   `dartFile`: Target `Uri` where the primary FFI bindings will be written.\n*   `recordUseMapping`: Target `Uri` for recorded usage metadata maps (crucial for linking-time tree shaking).\n*   `preamble`: Text inserted at the top of the generated file (licensing, annotations).\n*   `format`: Set to `true` to run the Dart formatter automatically.\n\n## Step-by-Step Workflow\n\n### Step 1: Check\u002FAdd Dependencies\nOpen the package's `pubspec.yaml` and verify the `dev_dependencies` contains `ffigen`. Use the Dart MCP server or look up the latest version on [pub.dev](https:\u002F\u002Fpub.dev\u002Fpackages\u002Fffigen) (e.g., `^20.1.1`).\n\nYou can add it automatically using the CLI:\n```bash\ndart pub add dev:ffigen\n```\n\n### Step 2: Formulate Paths Dynamically\nCreate a programmatic generator script under the package's `tool\u002F` directory (e.g., `tool\u002Fffigen.dart`).\nResolve paths relative to `Platform.script` to make sure it runs successfully from any working directory:\n\n```dart\nfinal packageRoot = Platform.script.resolve('..\u002F');\nfinal headerFile = packageRoot.resolve('third_party\u002Flibrary.h');\nfinal targetBindings = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fbindings.g.dart');\n```\n\n### Step 3: Write the Script (`tool\u002Fffigen.dart`)\nDefine `void main()` and run `FfiGenerator` with dynamic options (see complete example below).\n\n### Step 4: Run Code Generation\nExecute the script from the terminal inside the target package folder:\n```bash\ndart run tool\u002Fffigen.dart\n```\n\n### Step 5: Static Analysis\nVerify that the generated bindings are correct and resolve any analysis issues. FFIgen automatically runs the Dart formatter on the output file (via `format: true` configuration), so manual formatting is not required.\n\n1.  Run the static analyzer inside the target package:\n    ```bash\n    dart analyze\n    ```\n2.  **Addressing Warnings\u002FLints**: If `dart analyze` reports style or lint warnings inside the generated file, append the corresponding warning codes to the `ignore_for_file:` list in your generator script's `preamble` configuration (e.g., adding `camel_case_types`, `non_constant_identifier_names`, etc.). Do not modify the package's global rules.\n3.  **Addressing Compilation Errors**: If `dart analyze` reports actual compiler or analysis errors (not warnings) inside the generated file, do not attempt to edit the generated file manually. Report these error details directly to the user so they can file an issue on the repository at [github.com\u002Fdart-lang\u002Fnative](https:\u002F\u002Fgithub.com\u002Fdart-lang\u002Fnative).\n\n\n## Concrete Example: Binding a C Library\n\nLet's assume we are working with the SQLite package under `pkgs\u002Fcode_assets\u002Fexample\u002Fsqlite`, which embeds SQLite C library sources inside `third_party\u002Fsqlite\u002F` and accesses it via FFI.\n\n### The C Header File (`third_party\u002Fsqlite\u002Fsqlite3.h`)\n```c\n\u002F\u002F The author disclaims copyright to this source code.\n\n#ifndef SQLITE3_H_\n#define SQLITE3_H_\n\nconst char *sqlite3_libversion(void);\n\n#endif \u002F\u002F SQLITE3_H_\n```\n\n### BEFORE: Manual FFI Binding (The Anti-Pattern)\nA developer might attempt to handcraft this integration. It is fragile, blocks tree-shaking metadata, and is highly prone to ABI and structural mapping issues:\n\n```dart\n\u002F\u002F lib\u002Fsrc\u002Fsqlite3_manual.dart\nimport 'dart:ffi' as ffi;\nimport 'package:ffi\u002Fffi.dart';\n\n\u002F\u002F Flaw 1: Hardcoded DynamicLibrary lookup blocks integration with modern native asset compilation.\nfinal ffi.DynamicLibrary _dylib = ffi.DynamicLibrary.open('libsqlite3.so');\n\n\u002F\u002F Flaw 2: Manual function type matching requires writing redundant dynamic lookup boilerplate and lacks tree-shaking metadata.\ntypedef _sqlite3_libversion_C = ffi.Pointer\u003Cffi.Char> Function();\ntypedef _sqlite3_libversion_Dart = ffi.Pointer\u003Cffi.Char> Function();\n\nfinal _sqlite3_libversion_Dart sqlite3LibVersion = _dylib\n    .lookup\u003Cffi.NativeFunction\u003C_sqlite3_libversion_C>>('sqlite3_libversion')\n    .asFunction();\n```\n\n### AFTER: Generating via FFIgen (The Correct Pattern)\n\nCreate a programmatic script at `tool\u002Fffigen.dart`:\n\n```dart\n\u002F\u002F Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file\n\u002F\u002F for details. All rights reserved. Use of this source code is governed by a\n\u002F\u002F BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:io';\nimport 'package:ffigen\u002Fffigen.dart';\n\nvoid main() {\n  \u002F\u002F Resolve paths dynamically relative to Platform.script\n  final packageRoot = Platform.script.resolve('..\u002F');\n  final entryHeader = packageRoot.resolve('third_party\u002Fsqlite\u002Fsqlite3.h');\n  final bindingsOutput = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.g.dart');\n  final treeShakeMapping = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart');\n\n  FfiGenerator(\n    headers: Headers(\n      entryPoints: [entryHeader],\n    ),\n    functions: Functions(\n      include: (decl) => {'sqlite3_libversion'}.contains(decl.originalName),\n      \u002F\u002F Essential for package optimization and tree-shaking\n      recordUse: (_) => true,\n    ),\n    output: Output(\n      dartFile: bindingsOutput,\n      recordUseMapping: treeShakeMapping,\n      format: true,\n      preamble: '''\n\n\u002F\u002F AUTO-GENERATED FILE - DO NOT MODIFY.\n\u002F\u002F Generated via ffigen.\n\u002F\u002F To regenerate: dart run tool\u002Fffigen.dart\n\n\u002F\u002F ignore_for_file: type=lint, unused_import, unused_element, deprecated_member_use_from_same_package, experimental_member_use\n''',\n    ),\n  ).generate();\n\n  print('Successfully generated sqlite3 FFI bindings.');\n}\n```\n\n### Running the Generator script\nRun this in the package root directory:\n```bash\ndart run tool\u002Fffigen.dart\n```\n\nThis will automatically create:\n1.  `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.g.dart`\n2.  `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart`\n\n## Verification Checklist\n\nAlways perform the following verification before completing a binding generation task:\n\n1.  **Correct Setup**: Verify the target generated files are inside `lib\u002Fsrc\u002Fthird_party\u002F` (required for third-party licensed code) and the primary FFI bindings file strictly uses the `.g.dart` extension.\n2.  **Static Analysis**: Run `dart analyze` and ensure there are zero compiler\u002Fanalyzer errors or warnings in the package.\n    *   If static warnings are reported in the generated bindings, suppress them by adding `ignore_for_file` rules to the generator's `preamble` configuration (do not modify global package rules).\n    *   If actual compiler or analyzer errors are reported in the generated bindings, do not edit the generated file manually. Report the details to the user and direct them to file an issue at [github.com\u002Fdart-lang\u002Fnative](https:\u002F\u002Fgithub.com\u002Fdart-lang\u002Fnative).\n","# Generating FFI Bindings using package:ffigen\n\n## Contents\n- [Introduction](#introduction)\n- [Constraints](#constraints)\n- [FFIgen Overview](#ffigen-overview)\n- [Step-by-Step Workflow](#step-by-step-workflow)\n- [Concrete Example: Binding a C Library](#concrete-example-binding-a-c-library)\n- [Verification Checklist](#verification-checklist)\n\n## Introduction\n\nAutomate and standardize the generation of FFI bindings using `package:ffigen` (`FfiGenerator`). Writing FFI bindings by hand is error-prone, brittle, and highly discouraged.\n\n## Constraints\n\n*   **No Hand-Written FFI Bindings**: If native headers (`.h` files) exist or are generated by a build step, never write manual `DynamicLibrary.lookup`, `@Native` external functions, or raw struct classes. Always use `FfiGenerator` to generate them.\n*   **Generator Location**: The generator script should be located at `tool\u002Fffigen.dart` within the target package root.\n*   **Header Location**: If the native header files are third-party, they should be located in `third_party\u002F` within the target package (otherwise placing them in a `src\u002F` directory at the package root is also acceptable). If the headers are not in one of these standard locations, notify the user that it would be cleaner to move the header files to the standard location (e.g., `third_party\u002F`).\n*   **Targeted Inclusion Filters**: Avoid importing an entire native library unless specifically needed. Always apply precise inclusion lists using positive matches to minimize the size and cognitive load of the generated code (e.g., using `Functions.includeSet` or filtering matches in `include` closures).\n*   **Output Setup**: If the generated FFI bindings interface with a third-party library (or reference third-party headers), the generated files must always be placed under `lib\u002Fsrc\u002Fthird_party\u002F`. The primary generated FFI bindings file must strictly use the `.g.dart` extension (e.g. `sqlite3.g.dart`).\n*   **Preamble & License Headers**: Always supply a premium `preamble` in the `Output` class to specify the license. This must match the native third-party library's license, explicitly include the copyright header of the target native header file, and contain an automatic generation warning (e.g. `\u002F\u002F Generated by package:ffigen. Do not edit manually.`).\n*   **No Unnecessary Commits of Stale Bindings**: Ensure you run the generator script and check if the generated files have changed *before* finishing your task. Always verify the package by running `dart analyze`.\n*   **Record Usage and Tree Shaking**: If the package is integrated into standard runtime execution or compiles native assets via native hooks:\n    *   Enable recorded usage on all functions by setting `recordUse: (_) => true` under `Functions`.\n    *   Specify the `recordUseMapping` target in `Output` (which must strictly be a `.g.dart` file under `lib\u002Fsrc\u002Fthird_party\u002F`, e.g. `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart`) to register bindings for symbol tree shaking.\n\n## FFIgen Overview\n\nTo construct the programmatic generator, use the core configuration objects imported from `package:ffigen\u002Fffigen.dart`:\n\n### 1. `FfiGenerator`\nThe parent class that orchestrates the configuration, parsing, and code generation.\n```dart\nFfiGenerator({\n  Headers headers = const Headers(),\n  Enums enums = Enums.excludeAll,\n  Functions functions = Functions.excludeAll,\n  Globals globals = Globals.excludeAll,\n  Integers integers = const Integers(),\n  Macros macros = Macros.excludeAll,\n  Structs structs = Structs.excludeAll,\n  Typedefs typedefs = Typedefs.excludeAll,\n  Unions unions = Unions.excludeAll,\n  UnnamedEnums unnamedEnums = UnnamedEnums.excludeAll,\n  ObjectiveC? objectiveC,\n  required Output output,\n}).generate();\n```\n\n### 2. `Headers`\nConfigures Clang header parsing targets and compiler flags.\n*   `entryPoints`: A list of target header `Uri` inputs.\n*   `include`: A filter function `bool Function(Uri header)` that handles transitive header imports.\n*   `compilerOptions`: Custom preprocessor\u002Finclude compiler flags to pass directly to libclang.\n*   `ignoreSourceErrors`: Set to `true` to silence errors occurring inside third-party headers during parsing.\n\n### 3. `Functions`\nSpecifies which native C\u002FC++ functions to expose in Dart.\n*   `include`: A matcher function (e.g. `(decl) => {'my_func'}.contains(decl.originalName)` or `Functions.includeSet({'my_func'})`).\n*   `isLeaf`: Declares functions as leaf functions (`(decl) => true`) if they do not call back into Dart or block thread execution.\n*   `recordUse`: Enables metadata generation for native asset tree shaking (essential in `dart-lang\u002Fnative`). Set to `(_) => true`.\n\n### 4. `Output`\nConfigures target generated files.\n*   `dartFile`: Target `Uri` where the primary FFI bindings will be written.\n*   `recordUseMapping`: Target `Uri` for recorded usage metadata maps (crucial for linking-time tree shaking).\n*   `preamble`: Text inserted at the top of the generated file (licensing, annotations).\n*   `format`: Set to `true` to run the Dart formatter automatically.\n\n## Step-by-Step Workflow\n\n### Step 1: Check\u002FAdd Dependencies\nOpen the package's `pubspec.yaml` and verify the `dev_dependencies` contains `ffigen`. Use the Dart MCP server or look up the latest version on [pub.dev](https:\u002F\u002Fpub.dev\u002Fpackages\u002Fffigen) (e.g., `^20.1.1`).\n\nYou can add it automatically using the CLI:\n```bash\ndart pub add dev:ffigen\n```\n\n### Step 2: Formulate Paths Dynamically\nCreate a programmatic generator script under the package's `tool\u002F` directory (e.g., `tool\u002Fffigen.dart`).\nResolve paths relative to `Platform.script` to make sure it runs successfully from any working directory:\n\n```dart\nfinal packageRoot = Platform.script.resolve('..\u002F');\nfinal headerFile = packageRoot.resolve('third_party\u002Flibrary.h');\nfinal targetBindings = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fbindings.g.dart');\n```\n\n### Step 3: Write the Script (`tool\u002Fffigen.dart`)\nDefine `void main()` and run `FfiGenerator` with dynamic options (see complete example below).\n\n### Step 4: Run Code Generation\nExecute the script from the terminal inside the target package folder:\n```bash\ndart run tool\u002Fffigen.dart\n```\n\n### Step 5: Static Analysis\nVerify that the generated bindings are correct and resolve any analysis issues. FFIgen automatically runs the Dart formatter on the output file (via `format: true` configuration), so manual formatting is not required.\n\n1.  Run the static analyzer inside the target package:\n    ```bash\n    dart analyze\n    ```\n2.  **Addressing Warnings\u002FLints**: If `dart analyze` reports style or lint warnings inside the generated file, append the corresponding warning codes to the `ignore_for_file:` list in your generator script's `preamble` configuration (e.g., adding `camel_case_types`, `non_constant_identifier_names`, etc.). Do not modify the package's global rules.\n3.  **Addressing Compilation Errors**: If `dart analyze` reports actual compiler or analysis errors (not warnings) inside the generated file, do not attempt to edit the generated file manually. Report these error details directly to the user so they can file an issue on the repository at [github.com\u002Fdart-lang\u002Fnative](https:\u002F\u002Fgithub.com\u002Fdart-lang\u002Fnative).\n\n\n## Concrete Example: Binding a C Library\n\nLet's assume we are working with the SQLite package under `pkgs\u002Fcode_assets\u002Fexample\u002Fsqlite`, which embeds SQLite C library sources inside `third_party\u002Fsqlite\u002F` and accesses it via FFI.\n\n### The C Header File (`third_party\u002Fsqlite\u002Fsqlite3.h`)\n```c\n\u002F\u002F The author disclaims copyright to this source code.\n\n#ifndef SQLITE3_H_\n#define SQLITE3_H_\n\nconst char *sqlite3_libversion(void);\n\n#endif \u002F\u002F SQLITE3_H_\n```\n\n### BEFORE: Manual FFI Binding (The Anti-Pattern)\nA developer might attempt to handcraft this integration. It is fragile, blocks tree-shaking metadata, and is highly prone to ABI and structural mapping issues:\n\n```dart\n\u002F\u002F lib\u002Fsrc\u002Fsqlite3_manual.dart\nimport 'dart:ffi' as ffi;\nimport 'package:ffi\u002Fffi.dart';\n\n\u002F\u002F Flaw 1: Hardcoded DynamicLibrary lookup blocks integration with modern native asset compilation.\nfinal ffi.DynamicLibrary _dylib = ffi.DynamicLibrary.open('libsqlite3.so');\n\n\u002F\u002F Flaw 2: Manual function type matching requires writing redundant dynamic lookup boilerplate and lacks tree-shaking metadata.\ntypedef _sqlite3_libversion_C = ffi.Pointer\u003Cffi.Char> Function();\ntypedef _sqlite3_libversion_Dart = ffi.Pointer\u003Cffi.Char> Function();\n\nfinal _sqlite3_libversion_Dart sqlite3LibVersion = _dylib\n    .lookup\u003Cffi.NativeFunction\u003C_sqlite3_libversion_C>>('sqlite3_libversion')\n    .asFunction();\n```\n\n### AFTER: Generating via FFIgen (The Correct Pattern)\n\nCreate a programmatic script at `tool\u002Fffigen.dart`:\n\n```dart\n\u002F\u002F Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file\n\u002F\u002F for details. All rights reserved. Use of this source code is governed by a\n\u002F\u002F BSD-style license that can be found in the LICENSE file.\n\nimport 'dart:io';\nimport 'package:ffigen\u002Fffigen.dart';\n\nvoid main() {\n  \u002F\u002F Resolve paths dynamically relative to Platform.script\n  final packageRoot = Platform.script.resolve('..\u002F');\n  final entryHeader = packageRoot.resolve('third_party\u002Fsqlite\u002Fsqlite3.h');\n  final bindingsOutput = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.g.dart');\n  final treeShakeMapping = packageRoot.resolve('lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart');\n\n  FfiGenerator(\n    headers: Headers(\n      entryPoints: [entryHeader],\n    ),\n    functions: Functions(\n      include: (decl) => {'sqlite3_libversion'}.contains(decl.originalName),\n      \u002F\u002F Essential for package optimization and tree-shaking\n      recordUse: (_) => true,\n    ),\n    output: Output(\n      dartFile: bindingsOutput,\n      recordUseMapping: treeShakeMapping,\n      format: true,\n      preamble: '''\n\n\u002F\u002F AUTO-GENERATED FILE - DO NOT MODIFY.\n\u002F\u002F Generated via ffigen.\n\u002F\u002F To regenerate: dart run tool\u002Fffigen.dart\n\n\u002F\u002F ignore_for_file: type=lint, unused_import, unused_element, deprecated_member_use_from_same_package, experimental_member_use\n''',\n    ),\n  ).generate();\n\n  print('Successfully generated sqlite3 FFI bindings.');\n}\n```\n\n### Running the Generator script\nRun this in the package root directory:\n```bash\ndart run tool\u002Fffigen.dart\n```\n\nThis will automatically create:\n1.  `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.g.dart`\n2.  `lib\u002Fsrc\u002Fthird_party\u002Fsqlite3.record_use_mapping.g.dart`\n\n## Verification Checklist\n\nAlways perform the following verification before completing a binding generation task:\n\n1.  **Correct Setup**: Verify the target generated files are inside `lib\u002Fsrc\u002Fthird_party\u002F` (required for third-party licensed code) and the primary FFI bindings file strictly uses the `.g.dart` extension.\n2.  **Static Analysis**: Run `dart analyze` and ensure there are zero compiler\u002Fanalyzer errors or warnings in the package.\n    *   If static warnings are reported in the generated bindings, suppress them by adding `ignore_for_file` rules to the generator's `preamble` configuration (do not modify global package rules).\n    *   If actual compiler or analyzer errors are reported in the generated bindings, do not edit the generated file manually. Report the details to the user and direct them to file an issue at [github.com\u002Fdart-lang\u002Fnative](https:\u002F\u002Fgithub.com\u002Fdart-lang\u002Fnative).\n",{"name":5,"metadata":23,"description":7},{"model":24,"last_modified":25},"models\u002Fgemini-3.1-pro-preview","Thu, 28 May 2026 07:21:07 GMT","main","900ea3c9eb045fd5b0317dc1103777ecf3ea4aeb","skills\u002Fdart-use-ffigen",0,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker","https:\u002F\u002Fnguyenhungtran18.github.io\u002Fskill-and-tool-tracker\u002F","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18","2026-08-31 18:36:09",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill dart-use-ffigen",{"tool":40,"command":41},"bunx","bunx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill dart-use-ffigen",{"tool":43,"command":44},"pnpm","pnpm dlx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill dart-use-ffigen","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fdart-use-ffigen\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":18},"01M7BVP4P83TK60JZ4P8RP9VP7","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fxcode_project_setup\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":18},"01M7BVP01K4CSJJ8G90FT8S2D5","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7BVNY22GXD871GYTSH599F1","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7BVNQWF24RNKA8A4KM2HJ3T","workflow-skill-creator","Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say \"make this a skill\", \"create a skill from what we just did\", \"package this workflow\" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow_skill_creator\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7BVNNY67XPCQAQHY3FBKDGC","verify-and-stop","Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverify-and-stop\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7BVNKB4Z7SZT85B73ZZ90Y6","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[]]