Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计通过

dart-package-management飞镖包管理

Agent Skill

dart-package-management 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,529

周安装

65

GitHub Stars

61

下载量

536
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dart-package-management(飞镖包管理)
来源仓库:https://github.com/dart-lang/skills
仓库路径:skills/dart-package-management
安装命令:
npx skills add https://github.com/dart-lang/skills --skill dart-package-management
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dart-lang/skills --skill dart-package-management

简介

dart-package-management 规范 Dart 包的目录结构与 pubspec 配置,提升工具链兼容性。

  • 适用于新建包、重构现有项目或统一团队工程结构的场景。
  • 推荐将公共 API 放在 lib/,内部实现放 lib/src/,并严格限制跨包 src 导入。
  • 使用前请确认 bin/ 存放命令行入口,tool/ 包含构建脚本与代码生成工具。
  • 涉及 monorepo 时应使用 workspace 功能,避免重复依赖解析导致的版本冲突。

SKILL.md

Managing Dart Packages

Contents

Package Layout Conventions

Structure Dart packages using standardized directories to ensure tooling compatibility and clear API boundaries.

  • lib/: Place public libraries and assets here. Export only the public API surface.
  • lib/src/: Place internal implementation files here. Never import from another package's lib/src/. Use relative imports within your own package when importing from lib/src/ to lib/.
  • bin/: Place public command-line executables here.
  • tool/: Place internal scripts and tools (e.g., code generation, documentation scripts) here.
  • test/: Place unit tests here, suffixed with _test.dart.
  • integration_test/: Place slow, integration-level tests here.
  • example/: Place standalone example programs demonstrating package usage. Use package: imports to reference the parent package.
  • web/: Place web-specific entrypoints (main.dart) and assets (index.html, CSS) here.
  • hook/: Place SDK build hooks (e.g., build.dart) here.

Pubspec Configuration

Maintain a valid pubspec.yaml at the root of every package.

  • Version Constraints: Use caret syntax (^) for dependency version constraints (e.g., ^3.2.0) to allow non-breaking updates.
  • SDK Constraints: Always define an environment with a lower-bound SDK constraint.
  • Public Assets: Explicitly list all public assets (images, fonts) required by the package.
  • Executables: Map scripts from bin/ to command names under the executables field.
  • Metadata: Include name, version, description, repository, and issue_tracker for published packages.
  • Topics: Categorize published packages using the topics field (max 5 topics, lowercase alphanumeric and hyphens).
  • False Secrets: Use the false_secrets field with gitignore patterns to prevent false positives during pub's pre-publish leak detection.

Monorepo Workspaces

Implement workspaces in monorepos to share dependencies across local packages, reducing memory usage and ensuring version consistency.

  • Root Pubspec: Define the workspace at the repository root. Set publish_to: none, require SDK ^3.6.0 or higher, and use the workspace field with glob patterns (e.g., packages/*).
  • Child Pubspecs: In each workspace package, require SDK ^3.6.0 or higher and set resolution: workspace.
  • Interdependencies: Depend on other workspace packages normally. Pub automatically resolves to the local workspace version.
  • Overrides: Place dependency_overrides in the root pubspec.yaml to apply them globally across the workspace.

Workflows

Setting up a Monorepo Workspace

Use this checklist to convert a standard repository into a Dart workspace.

  • Create a root pubspec.yaml.
  • Set publish_to: none and environment: sdk: ^3.6.0 in the root pubspec.
  • Add the workspace: field to the root pubspec using glob patterns (e.g., - packages/*).
  • Update all child pubspec.yaml files to include environment: sdk: ^3.6.0 (or higher).
  • Add resolution: workspace to all child pubspec.yaml files.
  • Run dart pub get at the repository root.
  • Feedback Loop: Run validator -> review errors -> fix. Ensure no stray pubspec.lock or .dart_tool/package_config.json files exist in child directories. If resolution fails, align conflicting dependency versions across child packages.

Managing Dependencies

  • Run dart pub get to fetch dependencies and generate the package_config.json.
  • Run dart pub upgrade to update dependencies to their latest compatible versions.
  • Commit pubspec.lock ONLY for application packages. Omit it for library packages.

Examples

Standard Library Pubspec

name: enchilada
description: A comprehensive toolkit for newt transmogrification.
version: 1.2.3
repository: https://github.com/example/enchilada
issue_tracker: https://github.com/example/enchilada/issues

environment:
  sdk: ^3.6.0

dependencies:
  path: ^1.8.0
  transmogrify: ^0.4.0

dev_dependencies:
  test: ^2.0.0
  lints: ^3.0.0

executables:
  enchilada: main

topics:
  - transmogrification
  - utilities

Workspace Root Pubspec

name: my_monorepo
publish_to: none

environment:
  sdk: ^3.6.0

workspace:
  - packages/*

# Apply overrides globally across all workspace packages
dependency_overrides:
  transmogrify: ^0.5.0-dev

Workspace Child Pubspec

name: client_package
description: The client application for the monorepo.
version: 1.0.0
publish_to: none

environment:
  sdk: ^3.6.0

resolution: workspace

dependencies:
  shared_package: ^1.0.0 # Resolves locally within the workspace
  http: ^1.1.0

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

40.04%
按下载量换算215

Claude

29.56%
按下载量换算158

Cursor

17.31%
按下载量换算93

Gemini CLI

9.27%
按下载量换算50

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dart-lang/skills --skill dart-package-management 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills