Project Structure Metadata Guidelines
Overview
This document defines how Dart and Flutter projects are represented as metadata for automated build, documentation, and testing workflows. It provides a generic, reusable structure applicable to any Dart/Flutter project or multi-project workspace.
For detailed information about the Workspace Analyzer tool and its configuration options, see tom_ai/devops/tom_build/README.md.
Where the structure is written down
It is not written down. The directory tree is the structure, and reading it is how a reader or a tool learns the layout: a project is a folder with a
pubspec.yaml, its parts and modules are its subfolders, its documentation is its doc/. The rules below say how to recognise each of those; they do not describe a manifest, and no manifest is to be consulted in their place.
The build tooling maintains its own generated inputs for mechanical builds. Those are the build system's, documented with it in
tom_ai/devops/tom_build/README.md, and are not a source a reader or an AI session should be reading the workspace from.
Structural Hierarchy
Workspace
└── Projects (one or more)
└── Parts (optional, logical groupings)
└── Modules (feature-specific implementations)
└── Subfolders (nested subdirectories, arbitrary depth)
- Workspace: Top-level container (single project or multiple related projects)
- Project: Individual package, application, or server
- Parts: Logical subdivisions within a project (e.g., core, client, server, shared)
- Modules: Feature-specific implementations within a part or project
- Subfolders: Nested subdirectories within modules (supports arbitrary depth)
Workspace Structure
A workspace represents the root directory containing one or more related Dart/Flutter projects.
Important: Only Dart/Flutter projects (directories with pubspec.yaml) are included in metadata. Directories without
pubspec.yaml are ignored and do not appear in .tom_metadata/.
Single-Project Workspace
- Contains one
pubspec.yamlat root - Project root is workspace root
- Typical for standalone packages or applications
Multi-Project Workspace
- Contains multiple subdirectories, each with its own
pubspec.yaml - Common for monorepos with related projects
- Examples: client + server, core + templates, multiple packages
-
Non-Dart directories are excluded from metadata (e.g.,
tom_ai_build/,tom_vscode_extension/)
Test Projects (zom_ prefix)
- Projects and folders starting with
zom_are for test purposes only - Used to test build tools, workspace analyzers, and code generators
- Should not be included in production builds or documentation
-
Example:
zom_test_standalone,zom_test_flutter,zom_test_package
Workspace Components
- Projects: One or more Dart/Flutter projects (must have
pubspec.yaml) -
Workspace Documentation:
README.mdat workspace root (introduction, overview) - Shared Configuration: Workspace-level settings (optional)
- Workspace Assets: Shared resources across projects (optional)
- Non-project directories: Ignored in metadata generation
Build Configuration Metadata
The workspace analyzer generates comprehensive build configuration for each project, enabling mechanical (no-AI) build automation. Configuration is resolved using a three-level hierarchy:
1. Auto-detected defaults: Built-in defaults per project type 2. Workspace-level overrides: applied to every project in the workspace 3. Project-level overrides: applied to one project
Build Configuration Tags
| Tag | Purpose | Example |
|---|---|---|
build-after |
Dependencies (projects that must build first) | [tom_core, tom_reflection] |
build-order |
Workspace-level topological build order | [lib_a, lib_b, app_c] |
features |
Auto-detected project capabilities | has-reflection: true |
build |
Build commands and configuration | commands, pre-build, output |
run |
Run commands (for apps and CLIs) | commands, docker |
deploy |
Deployment configuration | type, dockerfile, platforms |
Feature Flags
The analyzer auto-detects project features:
-
has-reflection: Project uses code generation (*.g.dart,*.reflection.dart) has-build-runner: Project has build.yaml configurationhas-native-deps: Project uses FFI or has native codehas-assets: Project has assets/ or fonts/ directorieshas-docker: Project has Dockerfile or docker-compose.ymlpublishable: Project can be published (not marked publish_to: none)has-tests: Project has test directory with *_test.dart fileshas-examples: Project has example directory
Build Order
The build-order tag at the workspace level provides the topologically sorted list of projects, respecting dependencies. Projects with no dependencies come first.
For detailed configuration examples, see tom_ai/devops/tom_build/README.md.
Project Types and Structure Rules
1. Package Library Project (dart_package)
- Type:
dart_package - Description: Reusable Dart package library
-
Detection: Has
pubspec.yaml, nobin/directory, not a Flutter project - Structure:
lib/- Public API exports (top-level .dart files)lib/src/- Implementation organized into partsexample/- Usage examplestest/- Test suitesdoc/ordoc/- Documentation directory (optional)
Source Organization:
-
Package Module: Top-level files in
lib/(e.g.,tom_core.dart,tom_client.dart) - Metadata:
package.module.yml -
Parts: Subdirectories in
lib/src/(e.g.,tombase/,tomclient/,tomserver/) - Each part has:
{part}.part.ymland{part}.module.yml - Part-level files go in the part's module
- Subdirectories become modules:
modules/{module}.module.yml - Subdirectories of modules become potentially nested subfolders
2. Flutter Application Project (flutter_app)
- Type:
flutter_app - Description: Flutter mobile/desktop/web application
- Detection: Has
pubspec.yamlwithsdk: flutterdependency - Structure:
lib/- Application source with top-level files and subdirectoriesassets/- Images, fonts, configuration filestest/- Unit and widget tests-
Platform directories:
android/,ios/,linux/,macos/,web/,windows/
Source Organization:
-
App Module: Top-level files in
lib/(e.g.,main.dart,00_main.dart) - Metadata:
{project}.module.yml -
Parts: Direct subdirectories in
lib/(e.g.,uam/,features/,screens/) - Each part has:
{part}.part.ymland{part}.module.yml - Part-level files go in the part's module
- Subdirectories become modules:
modules/{module}.module.yml - Subdirectories of modules become potentially nested subfolders
3. Console/CLI Application Project (dart_console)
- Type:
dart_console - Description: Dart console or CLI application
-
Detection: Has
pubspec.yamlwith bothbin/ANDlib/directories. Thebin/directory is the key indicator that distinguishes this from adart_package. Even if empty, thebin/directory should be preserved (use.gitkeep) to maintain project type detection. - Structure:
bin/- Executable entry points and implementationlib/- Shared implementation (optional)assets/- Configuration, static filestest/- Server testsdatabase_migrations/- Database scripts (optional)deployment/- Cloud deployment scripts (.sh) & configuration templatesdocker/- Docker-specific configurations (pubspec overrides, datasource configs)doc/- Project-specific documentation (e.g. API docs, guides)
Source Organization:
-
Always has two parts:
bin/andlib/(even if lib is minimal) - bin part:
- Metadata:
bin.part.ymlandbin.module.yml - Top-level files in
bin/go in bin's module bin/src/subdirectories become modules:modules/{module}.module.yml- Subdirectories of modules become potentially nested subfolders
- lib part:
- Metadata:
lib.part.yml lib/src/subdirectories become modules:modules/{module}.module.yml- Subdirectories of modules become potentially nested subfolders
4. VS Code Extension Project (vscode_extension)
- Type:
vscode_extension - Description: Visual Studio Code extension (TypeScript)
- Detection: Has
package.jsonwithengines.vscodefield - Structure:
src/- TypeScript source filesout/ordist/- Compiled output (ignored)package.json- Extension manifest with contributes, activationEventstsconfig.json- TypeScript configuration
Source Organization:
-
Extension Module: Top-level
.tsfiles insrc/(e.g.,extension.ts) -
Parts: Direct subdirectories in
src/(e.g.,commands/,providers/) - Each part has sources and optional subfolders
- Subdirectories become modules with nested subfolders support
Example (tom_vscode_extension):
src/
extension.ts → extensionModule sources
commands/ → commands part
registerCommands.ts
openFile.ts
providers/ → providers part
treeProvider.ts
completionProvider.ts
5. TypeScript Project (typescript)
- Type:
typescript - Description: Plain TypeScript/Node.js project
-
Detection: Has
package.jsonANDtsconfig.json, but NOengines.vscode - Structure:
src/- TypeScript source filesdist/orbuild/- Compiled output (ignored)package.json- npm package manifesttsconfig.json- TypeScript configuration
Source Organization:
- Main Module: Top-level
.tsfiles insrc/ - Parts: Direct subdirectories in
src/ - Subdirectories become modules with nested subfolders support
6. JavaScript Project (javascript)
- Type:
javascript - Description: Plain JavaScript/Node.js project
-
Detection: Has
package.json, but NOtsconfig.jsonand NOengines.vscode - Structure:
src/- JavaScript source files (or project root)dist/orbuild/- Build output (ignored)package.json- npm package manifest
Source Organization:
-
Main Module: Top-level
.jsfiles insrc/(or project root if no src/) - Parts: Direct subdirectories in
src/ - Subdirectories become modules with nested subfolders support
7. Java Project (java)
- Type:
java - Description: Java project (Maven or Gradle)
-
Detection: (Has
pom.xml(Maven) ORbuild.gradle/build.gradle.kts(Gradle)) OR ( Has *.java files in folder /src or it's subfolders) - Structure:
src/main/java/- Java source filessrc/test/java/- Test source filespom.xmlorbuild.gradle- Build configuration
Source Organization:
- Main Module: Top-level
.javafiles in source root - Parts: Package directories in
src/main/java/ - Subdirectories become modules following package hierarchy
- Supports nested subfolders for deep package structures
Example (Maven project):
src/main/java/
com/example/
app/ → app part
Application.java
config/ → config module
AppConfig.java
services/ → services module
UserService.java
Project Type Detection Algorithm
Projects are identified by configuration files. Detection order is important:
def detect_project_type(project_path):
"""
Determine project type based on configuration files and folder structure.
Detection order matters - more specific types checked first.
"""
has_pubspec = exists(project_path + "/pubspec.yaml")
has_package_json = exists(project_path + "/package.json")
has_tsconfig = exists(project_path + "/tsconfig.json")
has_pom_xml = exists(project_path + "/pom.xml")
has_build_gradle = exists(project_path + "/build.gradle") or exists(project_path + "/build.gradle.kts")
# 1. Dart/Flutter projects (pubspec.yaml)
if has_pubspec:
has_bin = exists(project_path + "/bin")
has_lib = exists(project_path + "/lib")
has_lib_src = exists(project_path + "/lib/src")
if has_bin and has_lib:
return "dart_console"
elif has_lib_src:
return "dart_package"
elif has_lib and not has_bin:
return "flutter_app"
else:
return "dart_package"
# 2. Java projects (Maven or Gradle)
if has_pom_xml or has_build_gradle:
return "java"
# 3. Node.js/TypeScript projects (package.json)
if has_package_json:
# Check for VS Code extension
package_content = read_json(project_path + "/package.json")
if "engines" in package_content and "vscode" in package_content["engines"]:
return "vscode_extension"
# TypeScript project (has tsconfig.json)
if has_tsconfig:
return "typescript"
# Plain JavaScript project
return "javascript"
return None # Not a recognized project
def is_project(path):
"""A directory is a project if it has a recognized configuration file."""
return (exists(path + "/pubspec.yaml") or
exists(path + "/package.json") or
exists(path + "/pom.xml") or
exists(path + "/build.gradle") or
exists(path + "/build.gradle.kts"))
def scan_workspace(workspace_root):
"""
Find all projects in workspace.
Includes Dart, Java, TypeScript, JavaScript, and VS Code extensions.
"""
projects = []
# Check if workspace root is a project
if is_project(workspace_root):
projects.append(workspace_root)
# Check subdirectories
for subdir in list_directories(workspace_root):
subdir_path = workspace_root + "/" + subdir
if is_project(subdir_path):
projects.append(subdir_path)
return projects
Detection Rules Summary:
| Config File | Additional Check | Project Type |
|---|---|---|
pubspec.yaml |
has bin/ AND lib/ |
dart_console |
pubspec.yaml |
has lib/src/ (no bin/) |
dart_package |
pubspec.yaml |
has lib/ only (no bin/, no lib/src/) |
flutter_app |
pom.xml or build.gradle | - | java |
package.json |
has engines.vscode |
vscode_extension |
package.json |
has tsconfig.json |
typescript |
package.json | no tsconfig, no vscode | javascript |
Note: For dart_console projects, the bin/ directory is the key differentiator. Even if empty, preserve it with a
.gitkeep file to maintain correct project type detection.
Detection Order (first match wins):
1. Dart/Flutter projects (pubspec.yaml) 2. Java projects (pom.xml or build.gradle) 3. VS Code extensions (package.json
with engines.vscode) 4. TypeScript projects (package.json + tsconfig.json) 5. JavaScript projects (package.json
only)
Source File Extensions by Type:
| Project Type | File Extension | Source Folder |
|---|---|---|
dart_package, dart_console, flutter_app |
.dart |
lib/, bin/ |
vscode_extension, typescript |
.ts |
src/ |
javascript | .js | src/ |
java | .java | src/main/java/ |
Documentation Structure
Documentation exists at multiple levels in the hierarchy:
Workspace Documentation
- README.md: Workspace introduction, overview of projects, getting started
- Location: Workspace root directory
- Purpose: High-level overview for multi-project workspaces
Project Documentation
- README.md: Project introduction, summary, quick start
- Location: Project root directory
- Purpose: Overview of what the project does, installation, basic usage
- Additional Files (optional):
CHANGELOG.md- Version history and changesLICENSE- License informationCONTRIBUTING.md- Contribution guidelinesdoc/ordoc/- Documentation directory containing:- Architecture documentation
- API guides
- Tutorials
- Coding guidelines
- Testing guidelines
Part Documentation
- {part_name}.md: Part overview and architecture
- Location: Part directory (e.g.,
lib/src/core/core.md) - Purpose: Explain the part's purpose, list modules, describe relationships
- Content: Overview, module list, common patterns, dependencies
Module Documentation
- {module_name}.md: Module-specific documentation
- Location: Module directory (e.g.,
lib/src/core/logging/logging.md) - Purpose: Detailed API documentation, usage examples, best practices
- Content: API reference, usage examples, configuration, common scenarios
Subfolders (Nested Hierarchy)
Modules can contain nested subfolders to arbitrary depth. Each subfolder follows the same structure as a module:
- name: Folder name (lowercase, snake_case)
- displayName: Human-readable name
- sources: Direct
.dartfiles in the folder - subfolders: Nested subdirectories (recursive)
Subfolder Example
modules:
- name: analysis
displayName: Analysis
sources: [analysis.dart]
subfolders:
- name: parsers
displayName: Parsers
sources: [parsers.dart]
subfolders:
- name: yaml
displayName: Yaml
sources: [yaml_parser.dart, yaml_utils.dart]
- name: dart
displayName: Dart
sources: [dart_parser.dart]
- name: validators
displayName: Validators
sources: [validator.dart]
This corresponds to the folder structure:
analysis/
analysis.dart
parsers/
parsers.dart
yaml/
yaml_parser.dart
yaml_utils.dart
dart/
dart_parser.dart
validators/
validator.dart
Parts (Logical Subdivisions)
Parts are optional logical groupings within a project's source folder. A project may have:
-
No Parts: Modules directly in source folder (e.g.,
lib/src/module_a/,lib/src/module_b/) -
Multiple Parts: Organized by purpose (e.g.,
lib/src/core/,lib/src/client/,lib/src/server/)
Part and Module Identification
Parts and modules are identified based on project type and directory structure:
Package Projects (dart_package)
- Package Module: Top-level
.dartfiles inlib/directory - Metadata file:
package.module.ymlin project root - Parts: Subdirectories in
lib/src/ - Each part directory becomes a part
- Metadata:
{part}/directory with{part}.part.yml - Part Modules: Files directly in part directory
- Metadata:
{part}.module.ymlalongside{part}.part.yml - Submodules: Subdirectories within a part
- Metadata:
{part}/modules/{module}.module.yml
Example (tom_core):
lib/
tom_core.dart → package.module.yml
tom_client.dart → package.module.yml
tom_server.dart → package.module.yml
src/
tombase/ → tombase.part.yml + tombase.module.yml
api/ → modules/api.module.yml
logging/ → modules/logging.module.yml
tomclient/ → tomclient.part.yml + tomclient.module.yml
services/ → modules/services.module.yml
Flutter Applications (flutter_app)
- App Module: Top-level
.dartfiles inlib/directory - Metadata file:
{project}.module.ymlin project root - Parts: Direct subdirectories in
lib/ - Each subdirectory becomes a part
- Metadata:
{part}/directory with{part}.part.yml - Part Modules: Files directly in part directory
- Metadata:
{part}.module.ymlalongside{part}.part.yml - Submodules: Subdirectories within a part
- Metadata:
{part}/modules/{module}.module.yml
Example (tom_uam_client):
lib/
main.dart → tom_uam_client.module.yml
00_main.dart → tom_uam_client.module.yml
uam/ → uam.part.yml + uam.module.yml
application.dart → uam.module.yml
pages/ → modules/pages.module.yml
widgets/ → modules/widgets.module.yml
Console Applications (dart_console)
- Always has two parts:
binandlib - bin part:
- Top-level files in
bin/→bin.module.yml bin/src/subdirectories →bin/modules/{module}.module.yml- lib part:
lib/src/subdirectories →lib/modules/{module}.module.yml
Example (tom_uam_server):
bin/
aa_server_start.dart → bin.module.yml
ab_server_runtime_definition.dart → bin.module.yml
src/
startup/ → bin/modules/startup.module.yml
lib/
src/
services/ → lib/modules/services.module.yml
models/ → lib/modules/models.module.yml
Detection Rules Summary
1. dart_package: - Has parts/ metadata folder - Parts are from lib/src/
subdirectories - Has package.module.yml for lib-level files
2. flutter_app: - Has parts/ metadata folder - Parts are from lib/
subdirectories - Has {project}.module.yml for lib-level files
3. dart_console: - Always has parts/ metadata folder with bin/
and lib/ - No project-level module (all code is in parts)
4. All types: - Parts can have both .part.yml and .module.yml
files - Part .module.yml contains metadata for files directly in the part directory - Submodules go in
modules/ subdirectory
Real-World Examples from Workspace
Example 1: tom_core (dart_package)
Source Structure:
tom_core/
lib/
tom_core.dart # Public API
tom_client.dart # Public API
tom_server.dart # Public API
src/
tombase/ # Part
api/ # Module
beanlocator/ # Module
logging/ # Module
settings/ # Module
tomclient/ # Part
(modules...)
tomserver/ # Part
(modules...)
Metadata Structure:
.tom_metadata/projects/tom_core/
├── tom_core.project.yml # Project metadata
├── package.module.yml # Module for tom_core.dart, tom_client.dart, tom_server.dart
└── parts/
├── tombase/
│ ├── tombase.part.yml
│ ├── tombase.module.yml # Files directly in lib/src/tombase/
│ └── modules/
│ ├── api.module.yml
│ ├── beanlocator.module.yml
│ ├── logging.module.yml
│ └── settings.module.yml
├── tomclient/
│ ├── tomclient.part.yml
│ ├── tomclient.module.yml
│ └── modules/
│ └── (client modules...)
└── tomserver/
├── tomserver.part.yml
├── tomserver.module.yml
└── modules/
└── (server modules...)
Example 2: tom_uam_client (flutter_app)
Source Structure:
tom_uam_client/
lib/
00_main.dart # Entry point
01_client_runtime_definition.dart
02_environment_initialization.dart
03_startup_login.dart
04_remote_logging.dart
main_dev.dart
main_int.dart
main_prod.dart
uam/ # Feature part
application.dart
global_settings.dart
pages/ # Submodule
widgets/ # Submodule
utils/ # Submodule
Metadata Structure:
.tom_metadata/projects/tom_uam_client/
├── tom_uam_client.project.yml
├── tom_uam_client.module.yml # Module for lib-level files
└── parts/
└── uam/
├── uam.part.yml
├── uam.module.yml # Files directly in lib/uam/
└── modules/
├── pages.module.yml
├── widgets.module.yml
└── utils.module.yml
Example 3: tom_uam_server (dart_console)
Source Structure:
tom_uam_server/
bin/
aa_server_start.dart
ab_server_runtime_definition.dart
aca_log_levels.dart
(more bin-level files...)
src/
(server startup modules...)
lib/
src/
services/ # Module
models/ # Module
(more lib modules...)
Metadata Structure:
.tom_metadata/projects/tom_uam_server/
├── tom_uam_server.project.yml
└── parts/
├── bin/
│ ├── bin.part.yml
│ ├── bin.module.yml # bin-level .dart files
│ └── modules/
│ └── (bin/src modules...)
└── lib/
├── lib.part.yml
└── modules/
├── services.module.yml
├── models.module.yml
└── (other lib/src modules...)
Structure Comparison
| Project Type | Top-level Module | Parts | Module Organization |
|---|---|---|---|
| dart_package | package.module.yml |
From lib/src/ |
Parts have .part.yml + .module.yml + modules/ |
| flutter_app | {project}.module.yml |
From lib/ subdirs |
Parts have .part.yml + .module.yml + modules/ |
| dart_console | None | Always bin + lib |
Parts have .part.yml + .module.yml + modules/ |
Module Structure
Each module is a directory containing related functionality.
Module Components
- Source Files:
*.dartfiles implementing functionality -
Documentation:
{module_name}.mddocumentation file (typically in module directory) - Examples: Implementation examples (location varies by project structure)
-
Tests: Unit/integration tests (typically in
test/mirroring source structure) - Assets: Module-specific resources (optional)
Module Naming Conventions
-
Directory name:
snake_case(e.g.,user_authentication/,data_storage/) - Documentation file:
{module_name}.md(e.g.,user_authentication.md) - Test file:
{module_name}_test.dart(e.g.,user_authentication_test.dart)
Asset and Resource Files
Projects may include various asset and resource types:
Common Asset Types
1. Configuration Files - JSON: *.json (e.g., config.json,
settings.json) - YAML: *.yaml (e.g., application.yaml) - Environment:
.env, .env.local
2. Static Resources - Images: *.png, *.jpg, *.svg
- Fonts: *.ttf, *.otf - Icons: Platform-specific icon sets
3. Data Files - Localization: *.arb, i18n/*.json - Templates:
*.html, *.md - Sample data: *.json, *.csv
Asset Location Patterns
Flutter Apps:
assets/
images/
fonts/
config/
i18n/
Server Apps:
assets/
static/ # Served static files
templates/ # Email/HTML templates
config/ # Configuration files
assets_client/ # Client-facing assets (optional)
Packages:
lib/assets/ # Package-bundled assets
example/assets/ # Example assets
Project Files
Essential Files
pubspec.yaml- Package dependencies and metadataanalysis_options.yaml- Dart analyzer configurationbuild.yaml- Build configuration (when using code generation)README.md- Project documentationCHANGELOG.md- Version historyLICENSE- License information
Configuration Files
.gitignore- Git exclusion rules.env- Environment variables (server projects)docker-compose.yaml- Docker configuration (server projects)Dockerfile- Container definition (server projects)
Excluded Directories and Files
The following should be excluded from metadata and processing:
IDE and Editor Directories
.idea/- IntelliJ IDEA configuration.vscode/- Visual Studio Code configuration*.iml- IntelliJ module files
Version Control
.git/- Git repository data
Build Artifacts
.dart_tool/- Dart build tools cachebuild/- Build output.flutter-plugins-dependencies- Flutter plugin state.metadata- Flutter metadata cache
System Files
.DS_Store- macOS Finder metadataThumbs.db- Windows thumbnail cache
Lock Files (Optional Exclusion)
pubspec.lock- Dependency lock file (include for reproducibility)
Backup and Temporary
backup/- Backup directories*~- Temporary files*.bak- Backup files
Metadata Structure
Metadata is organized in a directory tree mirroring the workspace structure. This approach provides:
- Incremental Loading: Load only needed metadata for specific tasks
- Scalability: Handles large workspaces without massive single files
- Natural Navigation: Metadata structure matches code organization
- Easier Updates: Update individual components without rewriting entire structure
File Naming Convention: Double Extension
All metadata files use double extensions to indicate both the entity type and file format:
{name}.project.yml- Project metadata{name}.part.yml- Part metadata{name}.module.yml- Module metadata{workspace_root}.workspace.yml- Workspace metadata{workspace_root}.index.yml- Index file (optional)package.module.yml- Files at lib/ level (dart_package only)-
{project}.module.yml- Files at lib/src/ level (dart_package) or lib/ level (flutter_app)
The double extension makes it explicit which schema the file follows, improving tooling and clarity.
Project Type Structures
Package Project (dart_package)
Structure: Has lib/ folder with top-level files and lib/src/
for implementation
Metadata Organization:
.tom_metadata/projects/my_package/
├── my_package.project.yml # Project metadata
├── package.module.yml # Module for lib/ level files
├── my_package.module.yml # Module for lib/src/ level files
└── parts/ # Parts from lib/src/ subdirectories
├── core/
│ ├── core.part.yml # Part metadata
│ ├── core.module.yml # Module for part-level files (if any)
│ └── modules/
│ ├── logging.module.yml
│ └── config.module.yml
└── client/
├── client.part.yml
├── client.module.yml
└── modules/
└── ui.module.yml
Flutter Application (flutter_app)
Structure: Has lib/ folder with top-level files and subdirectories/modules
Metadata Organization:
.tom_metadata/projects/my_app/
├── my_app.project.yml # Project metadata
├── my_app.module.yml # Module for lib/ level files (main.dart, etc.)
└── parts/ # Parts/modules from lib/ subdirectories
└── uam/
├── uam.part.yml # Part metadata
├── uam.module.yml # Module for uam/ level files
└── modules/ # Submodules
├── pages.module.yml
├── widgets.module.yml
└── utils.module.yml
Console/CLI Application (dart_console)
Structure: Has bin/ for executables and lib/ for implementation
Metadata Organization:
.tom_metadata/projects/my_server/
├── my_server.project.yml # Project metadata
└── parts/
├── bin/
│ ├── bin.part.yml # Part metadata for bin/
│ ├── bin.module.yml # Module for bin/ level files
│ └── modules/ # Submodules in bin/src/
│ └── startup.module.yml
└── lib/
├── lib.part.yml # Part metadata for lib/
├── lib.module.yml # Module for lib/ level files
└── modules/ # Modules in lib/src/
├── services.module.yml
└── models.module.yml
Metadata Directory Organization
workspace_root/
├── .tom_metadata/
│ ├── {workspace_root}.workspace.yml # Workspace-level metadata
│ ├── {workspace_root}.index.yml # Quick reference index (optional)
│ └── projects/
│ ├── dart_package/ # Package (dart_package)
│ │ ├── dart_package.project.yml
│ │ ├── package.module.yml # lib/ level files
│ │ ├── dart_package.module.yml # lib/src/ level files
│ │ └── parts/
│ │ ├── core/
│ │ │ ├── core.part.yml
│ │ │ ├── core.module.yml # Part-level files
│ │ │ └── modules/
│ │ │ ├── api.module.yml
│ │ │ ├── logging.module.yml
│ │ │ └── config.module.yml
│ │ └── client/
│ │ ├── client.part.yml
│ │ ├── client.module.yml
│ │ └── modules/
│ │ └── ui.module.yml
│ ├── flutter_app/ # Flutter app (flutter_app)
│ │ ├── flutter_app.project.yml
│ │ ├── flutter_app.module.yml # lib/ level files
│ │ └── parts/
│ │ └── features/
│ │ ├── features.part.yml
│ │ ├── features.module.yml # Part-level files
│ │ └── modules/
│ │ ├── pages.module.yml
│ │ ├── widgets.module.yml
│ │ └── auth.module.yml
│ └── dart_console/ # Server (dart_console)
│ ├── dart_console.project.yml
│ └── parts/
│ ├── bin/
│ │ ├── bin.part.yml
│ │ ├── bin.module.yml # bin/ level files
│ │ └── modules/
│ │ └── startup.module.yml
│ └── lib/
│ ├── lib.part.yml
│ ├── lib.module.yml # lib/ level files
│ └── modules/
│ ├── services.module.yml
│ └── models.module.yml
Index File (Optional Quick Reference)
workspace_root/.tom_metadata/{workspace_root}.index.yml:
metadata_version: "1.0"
workspace_name: "my_workspace"
generated_at: "2026-01-04T10:30:00Z"
projects:
- name: "core_package"
type: "dart_package"
has_parts: true
- name: "client_app"
type: "flutter_app"
has_parts: false
Workspace Metadata Schema
workspace_root/.tom_metadata/{workspace_root}.workspace.yml:
workspace:
name: "my_workspace"
root_path: "/absolute/path/to/workspace"
type: "single_project" # single_project | multi_project
documentation:
readme: "README.md"
additional:
- "CONTRIBUTING.md"
- "CODE_OF_CONDUCT.md"
projects:
- name: "core_package"
path: "core_package" # Directory relative to workspace root
type: "dart_package"
- name: "client_app"
path: "client_app" # Directory relative to workspace root
type: "flutter_app"
- name: "server_app"
path: "server_app" # Directory relative to workspace root
type: "dart_console"
shared_config: # Optional
analysis_options: ".analysis_options.yaml"
ide_config: ".vscode/" # Directory
Project Metadata Schema
workspace_root/.tom_metadata/projects/{project_name}/{project_name}.project.yml:
project:
name: "my_package"
type: "dart_package" # dart_package | flutter_app | dart_console
root_path: "/absolute/path/to/project"
relative_path: "my_package" # Directory relative to workspace root
package_name: "my_package" # From pubspec.yaml
source_folder: "lib/src" # Directory, varies by project type
has_parts: true # true if multi-part structure
documentation:
readme: "README.md"
changelog: "CHANGELOG.md"
license: "LICENSE"
docs_folder: "doc" # Directory (optional)
guidelines: # Optional
coding: "doc/coding_guidelines.md"
testing: "doc/testing_guidelines.md"
documentation: "doc/documentation_guidelines.md"
essential_files:
- "pubspec.yaml"
- "analysis_options.yaml"
- "README.md"
optional_files:
- "build.yaml" # If using code generation
- "CHANGELOG.md"
- "LICENSE"
# For multi-part projects (has_parts: true), include parts:
parts: # Only present if has_parts: true
- name: "core"
path: "lib/src/core" # Directory
export_file: "lib/core.dart" # Part export file (typically at lib level)
# Note: Modules for this part are in .tom_metadata/projects/{project_name}/parts/core/modules/
- name: "client"
path: "lib/src/client" # Directory
export_file: "lib/client.dart" # Part export file
# Note: Modules for this part are in .tom_metadata/projects/{project_name}/parts/client/modules/
# For single-part projects (has_parts: false), modules are listed here:
# modules: # Only present if has_parts: false
# - name: "utils"
# path: "lib/src/utils" # Directory
# - name: "services"
# path: "lib/src/services" # Directory
# Note: Module YAML files are in .tom_metadata/projects/{project_name}/modules/
example_base_path: "example" # Directory
test_base_path: "test" # Directory
assets_path: "assets" # Directory (optional)
Part Metadata Schema
workspace_root/.tom_metadata/projects/{project_name}/parts/{part_name}/{part_name}.part.yml:
part:
name: "core"
path: "lib/src/core" # Directory relative to project root
parent_project: "my_package"
export_file: "lib/core.dart" # Part export file (optional but typical)
export_pattern: | # How the export file exports this part
// Export core functionality
export 'src/core/logging/logger.dart';
export 'src/core/config/settings.dart';
documentation:
overview: "lib/src/core/core.md"
description: "Core functionality and utilities"
modules:
- name: "logging"
- name: "configuration"
- name: "utilities"
# Note: Module YAML files are in .tom_metadata/projects/{project_name}/parts/{part_name}/modules/
module_base_path: "lib/src/core" # Directory
example_path: "example/core" # Directory (optional)
test_path: "test/core" # Directory (optional)
Module Metadata Schema
For part-level module (files in part directory): workspace_root/.tom_metadata/projects/{project_name}/parts/{part_name}/{part_name}.module.yml
For submodules (subdirectories in part): workspace_root/.tom_metadata/projects/{project_name}/parts/{part_name}/modules/{module_name}.module.yml
For project-level module (package or app top-level files): workspace_root/.tom_metadata/projects/{project_name}/package.module.yml
(packages) workspace_root/.tom_metadata/projects/{project_name}/{project_name}.module.yml
(apps)
module:
name: "authentication"
path: "lib/src/core/authentication" # Directory relative to project root
part: "core" # null if single-part project
parent_project: "my_package"
files: # All source files in module
- "auth_service.dart"
- "token_manager.dart"
- "credentials.dart"
- "validators.dart"
entry_point: "auth_service.dart" # Main file (optional but recommended)
export_file: "lib/authentication.dart" # Module export file (optional, less common than part exports)
export_pattern: | # If module has its own export
export 'src/core/authentication/auth_service.dart';
export 'src/core/authentication/credentials.dart';
public_apis: # Optional: explicitly list public APIs
classes:
- "AuthService"
- "TokenManager"
- "Credentials"
functions:
- "validateCredentials"
documentation:
file: "authentication.md"
path: "lib/src/core/authentication/authentication.md"
description: "User authentication and authorization"
example_path: "example/core/authentication" # Directory (optional)
example_files: # Optional
- "basic_auth_example.dart"
- "oauth_example.dart"
- "token_refresh_example.dart"
test_path: "test/core/authentication_test.dart" # Can be file or directory
test_files: # Optional (if directory)
- "authentication_test.dart"
- "token_manager_test.dart"
- "credentials_test.dart"
assets: # Optional
- "assets/config/auth_config.json"
dependencies:
internal: # Other modules in project
- module: "logging"
part: "core"
- module: "configuration"
part: "core"
external: # External packages
- "http"
- "jwt_decoder"
- "crypto"
example_base_path: "example" # Directory
test_base_path: "test" # Directory
assets_path: "assets" # Directory (optional)
Part Metadata Schema (Alternative)
part:
name: "core"
path: "lib/src/core" # Directory
parent_project: "my_package"
documentation:
overview: "lib/src/core/core.md"
description: "Core functionality and utilities"
modules:
- "logging"
- "configuration"
- "utilities"
module_base_path: "lib/src/core" # Directory
example_path: "example/core" # Directory (optional)
test_path: "test/core" # Directory (optional)
Module Metadata Schema (Alternative)
module:
name: "authentication"
path: "lib/src/core/authentication" # Directory
part: "core" # null if single-part project
parent_project: "my_package"
source_files:
- "auth_service.dart"
- "token_manager.dart"
- "credentials.dart"
documentation:
file: "authentication.md"
path: "lib/src/core/authentication/authentication.md"
description: "User authentication and authorization"
example_path: "example/core/authentication" # Directory (optional)
example_files: # Optional
- "basic_auth_example.dart"
- "oauth_example.dart"
test_path: "test/core/authentication_test.dart" # Can be file or directory
test_files: # Optional
- "authentication_test.dart"
- "token_manager_test.dart"
assets: # Optional
- "assets/config/auth_config.json"
api_export: "lib/core_api.dart" # Optional, for consolidated exports
dependencies:
internal: # Other modules in project
- "logging"
- "configuration"
external: # External packages
- "http"
- "jwt_decoder"
Asset Metadata Schema
assets:
base_path: "assets" # Directory
groups:
- name: "images"
path: "assets/images" # Directory
patterns:
- "*.png"
- "*.jpg"
- "*.svg"
- name: "fonts"
path: "assets/fonts" # Directory
patterns:
- "*.ttf"
- "*.otf"
- name: "config"
path: "assets/config" # Directory
files:
- "app_config.json"
- "feature_flags.yaml"
- name: "i18n"
path: "assets/i18n" # Directory
patterns:
- "*.arb"
- "*.json"
Discovery Rules
Workspace Detection
1. Single-Project Workspace: - pubspec.yaml exists at root - No subdirectories with
pubspec.yaml (except in standard locations like example/) - Workspace root = Project root
2. Multi-Project Workspace: - Multiple subdirectories contain pubspec.yaml
- Each subdirectory is a separate project - May have workspace-level README.md
Detection Algorithm:
root_has_pubspec = exists("pubspec.yaml")
subdirs_with_pubspec = find_subdirectories_with_file("pubspec.yaml",
exclude=["example", "test", ".dart_tool"])
if root_has_pubspec and subdirs_with_pubspec.isEmpty:
workspace_type = "single_project"
projects = [root_directory]
else if subdirs_with_pubspec.isNotEmpty:
workspace_type = "multi_project"
projects = subdirs_with_pubspec
if root_has_pubspec:
projects.add(root_directory)
Project Type Detection
Analyze pubspec.yaml and project structure:
# dart_package indicators:
dependencies:
# No flutter dependency
environment:
sdk: '>=3.0.0'
# flutter_app indicators:
dependencies:
flutter:
sdk: flutter
# Contains: android/, ios/, etc. directories
# dart_console indicators:
dependencies:
shelf: ^1.0.0 # or similar server packages
# Contains: bin/ directory with server entry points
Source Folder Detection by Type
1. dart_package: - Primary: lib/src/ (directory) - Fallback: lib/
if no src/ subdirectory (directory)
2. flutter_app: - Primary: lib/ (directory) - No src/ convention typically used
3. dart_console: - Implementation: lib/src/ or lib/ (directory) - Entry points:
bin/ (directory)
Part vs Module Detection
The structure is determined by checking for specific folders in the project's metadata location:
Detection Algorithm:
project_metadata_path = .tom_metadata/projects/{project_name}/
has_parts_folder = exists(project_metadata_path + "parts/")
has_modules_folder = exists(project_metadata_path + "modules/")
if has_parts_folder AND has_modules_folder:
ERROR: "Invalid project structure - both 'parts/' and 'modules/' folders exist"
if has_parts_folder:
has_parts = true
# Metadata: .tom_metadata/projects/{project}/parts/{part}/modules/{module}.yaml
for each part_dir in parts/:
load part metadata from parts/{part}/{part}.yaml
for each module in parts/{part}/modules/:
load module metadata
else if has_modules_folder:
has_parts = false
# Metadata: .tom_metadata/projects/{project}/modules/{module}.yaml
for each module in modules/:
load module metadata
else:
ERROR: "No structure folders found - expected 'parts/' or 'modules/'"
Note: The actual source code structure (lib/src/) may vary, but the metadata organization follows this strict folder convention for consistent detection and processing.
Module Discovery
For each potential module directory:
1. Identify source files: *.dart files (exclude *.g.dart,
*.reflectable.dart) 2. Find documentation: Look for {module_name}.md
in: - Module directory - Project doc/ or doc/ directory - Part doc/
or doc/ directory (if applicable) 3. Locate examples: Search in: - example/{part}/{module}/
(multi-part) - directory - example/{module}/ (single-part) - directory - example/samples/{part}/{module}/
(organized structure) - directory 4. Find tests: Look for: - test/{part}/{module}_test.dart
- file - test/{module}_test.dart - file - test/{part}/{module}/ (directory of multiple test files)
Asset Discovery
1. Scan asset directories: assets/, lib/assets/, platform-specific directories 2.
Parse pubspec.yaml for declared assets:
flutter:
assets:
- assets/images/ # Directory
- assets/config/app_config.json # File
3. Identify by pattern: Group by file extension or directory convention
Documentation Discovery
Workspace Level:
README.mdat workspace root (required for multi-project workspaces)CONTRIBUTING.md,CODE_OF_CONDUCT.md(optional)
Project Level:
README.mdat project root (required)CHANGELOG.md,LICENSEat project root (recommended)doc/ordoc/directory (optional)- Look for guideline files:
*_guidelines.md,*_guide.md
Part Level:
{part_name}.mdin part directory (e.g.,lib/src/core/core.md)- Alternative:
doc/{part_name}.mdin project docs directory
Module Level:
{module_name}.mdin module directory (primary location)- Alternative:
doc/{part}/{module_name}.mdordoc/{module_name}.md
Reference Projects for Context
When analyzing usage patterns, projects may reference:
- Template projects: Sibling directories providing implementation patterns
- Example implementations: Within project's
example/directory - Test suites: Usage demonstrated in tests
- Documentation samples: Code snippets in markdown files
File Pattern Matching
Include Patterns:
**/*.dart- All Dart source files**/*.md- All Markdown documentation**/*.yaml- Configuration files**/*.json- Data and configuration filesassets/**/*- Asset filespubspec.yaml- Package manifestREADME.md- Project documentationCHANGELOG.md- Version historyLICENSE- License information
Exclude Patterns:
.dart_tool/**- Dart build tools cachebuild/**- Build output directory.git/**- Git repository data.idea/**- IntelliJ IDEA configuration.vscode/**- Visual Studio Code configuration**/*.g.dart- Generated Dart files**/*.reflectable.dart- Generated reflection files**/*.freezed.dart- Generated freezed files**/*.mocks.dart- Generated mock files**/.DS_Store- macOS Finder metadata**/Thumbs.db- Windows thumbnail cache**/*.iml- IntelliJ module files.flutter-plugins-dependencies- Flutter plugin state.metadata- Flutter metadata cache.packages- Legacy package configurationpubspec.lock- Dependency lock (optional exclusion)
Platform-Specific Exclusions (Flutter):
android/build/**- Android build outputsios/Pods/**- iOS CocoaPodsios/.symlinks/**- iOS symlinksmacos/Pods/**- macOS CocoaPodswindows/flutter/**- Windows Flutter enginelinux/flutter/**- Linux Flutter engine
Validation Rules
Workspace Validation
✅ Valid Single-Project Workspace:
pubspec.yamlat root- Valid project structure
README.mdat root
✅ Valid Multi-Project Workspace:
- Multiple subdirectories with
pubspec.yaml - Each project has valid structure
README.mdat workspace root (recommended)
⚠️ Warning Conditions:
- Multi-project workspace without root
README.md - Projects with inconsistent structure conventions
- Missing shared configuration
Project Validation
✅ Required Elements:
- Valid
pubspec.yamlwithname:andenvironment:fields - Source directory (
lib/,bin/, orlib/src/) exists - At least one
.dartfile in source directory README.mdwith project description
⚠️ Recommended Elements (warnings if missing):
analysis_options.yaml- Linter configurationCHANGELOG.md- Version trackingLICENSE- License informationtest/directory with tests- Documentation for public APIs
❌ Invalid Conditions:
- Missing or malformed
pubspec.yaml - No
.dartfiles in source directory - Circular dependencies between modules
- Invalid Dart syntax in source files
Part Validation (Multi-Part Projects)
✅ Valid Part:
- Directory in source folder
- Contains at least one module subdirectory
- Module subdirectories contain
.dartfiles
⚠️ Warning Conditions:
- Part with only one module (consider flattening)
- Empty part directory
- No documentation file (
{part_name}.md)
Module Validation
✅ Valid Module:
- Directory in source folder (or part subdirectory)
- Contains at least one
.dartsource file - Documentation file
{module_name}.mdexists (recommended)
⚠️ Warning Conditions:
- No public classes/functions in module
- Missing examples in
example/directory - Missing test file in
test/directory - Documentation doesn't cover all public APIs
- Orphaned module (no imports from other parts of project)
- Missing module documentation file
❌ Invalid Module:
- Directory contains no
.dartfiles - All
.dartfiles are generated (.g.dart, etc.) - Module name conflicts with Dart reserved words
Documentation Validation
✅ Valid Documentation:
README.mdexists at workspace and project roots- Module documentation files match module names
- Documentation files are valid Markdown
⚠️ Warning Conditions:
- Missing
CHANGELOG.mdfor published packages - Missing
LICENSEfor public packages - Part has no documentation file
- Outdated documentation (mentions removed APIs)
- Missing code examples in documentation
❌ Invalid Documentation:
README.mdis empty or placeholder text- Documentation references non-existent code
- Malformed Markdown syntax
Asset Validation
✅ Valid Asset Configuration:
- Assets declared in
pubspec.yamlexist on filesystem - Asset paths are relative to project root
- No duplicate asset declarations
⚠️ Warning Conditions:
- Unused assets (declared but not referenced in code)
- Large assets without compression
- Missing asset variations (different resolutions, etc.)
❌ Invalid Asset Configuration:
- Asset declared in
pubspec.yamlbut file doesn't exist - Invalid asset path format
- Asset outside project directory
Example Project Structures
Single-Project Workspace (Single-Part Package)
my_package/ # Workspace root = Project root
├── lib/
│ ├── my_package.dart # Main export
│ └── src/ # Source directory
│ ├── authentication/ # Module directory
│ │ ├── auth_service.dart
│ │ └── authentication.md
│ ├── database/ # Module directory
│ │ ├── db_connection.dart
│ │ └── database.md
│ └── utils/ # Module directory
│ ├── helpers.dart
│ └── utils.md
├── example/ # Examples directory
│ ├── authentication/
│ │ └── auth_example.dart
│ └── database/
│ └── db_example.dart
├── test/ # Tests directory
│ ├── authentication_test.dart
│ ├── database_test.dart
│ └── utils_test.dart
├── doc/ # Documentation directory
│ ├── coding_guidelines.md
│ └── testing_guidelines.md
├── pubspec.yaml
├── analysis_options.yaml
├── README.md
├── CHANGELOG.md
└── LICENSE
Single-Project Workspace (Multi-Part Package)
framework/ # Workspace root = Project root
├── lib/
│ ├── framework.dart # Main export
│ ├── core.dart # Part export
│ ├── client.dart # Part export
│ └── src/ # Source directory
│ ├── core/ # Part directory
│ │ ├── core.md # Part documentation
│ │ ├── logging/ # Module directory
│ │ │ ├── logger.dart
│ │ │ └── logging.md
│ │ └── config/ # Module directory
│ │ ├── settings.dart
│ │ └── config.md
│ └── client/ # Part directory
│ ├── client.md # Part documentation
│ ├── http/ # Module directory
│ │ ├── client.dart
│ │ └── http.md
│ └── storage/ # Module directory
│ ├── cache.dart
│ └── storage.md
├── example/ # Examples directory
│ ├── core/
│ │ ├── logging/
│ │ └── config/
│ └── client/
│ ├── http/
│ └── storage/
├── test/ # Tests directory
│ ├── core/
│ │ ├── logging_test.dart
│ │ └── config_test.dart
│ └── client/
│ ├── http_test.dart
│ └── storage_test.dart
├── doc/ # Documentation directory
│ ├── architecture.md
│ └── coding_guidelines.md
├── pubspec.yaml
├── README.md
└── CHANGELOG.md
Multi-Project Workspace Example
my_workspace/ # Workspace root
├── README.md # Workspace documentation
├── core_package/ # Project directory
│ ├── lib/
│ │ └── src/
│ │ ├── utils/ # Module directory
│ │ └── models/ # Module directory
│ ├── test/
│ ├── pubspec.yaml
│ └── README.md # Project documentation
├── client_app/ # Project directory
│ ├── lib/
│ │ ├── features/ # Part directory (feature-based)
│ │ │ ├── auth/ # Module directory
│ │ │ └── home/ # Module directory
│ │ └── shared/ # Part directory
│ │ └── widgets/ # Module directory
│ ├── assets/ # Assets directory
│ ├── test/
│ ├── android/
│ ├── ios/
│ ├── pubspec.yaml
│ └── README.md # Project documentation
├── server_app/ # Project directory
│ ├── bin/
│ │ └── server.dart
│ ├── lib/
│ │ └── src/
│ │ ├── api/ # Module directory
│ │ └── services/ # Module directory
│ ├── assets/ # Assets directory
│ ├── test/
│ ├── pubspec.yaml
│ └── README.md # Project documentation
└── shared_package/ # Project directory
├── lib/
│ └── src/
│ ├── models/ # Module directory
│ └── constants/ # Module directory
├── test/
├── pubspec.yaml
└── README.md # Project documentation
Flutter Application (Single-Project Workspace)
my_app/ # Workspace root = Project root
├── lib/ # Source directory
│ ├── main.dart # Entry point
│ ├── features/ # Part directory (feature-based modules)
│ │ ├── auth/ # Module directory
│ │ │ ├── login_screen.dart
│ │ │ └── auth_service.dart
│ │ ├── home/ # Module directory
│ │ │ └── home_screen.dart
│ │ └── profile/ # Module directory
│ │ └── profile_screen.dart
│ ├── shared/ # Part directory
│ │ ├── widgets/ # Module directory
│ │ └── utils/ # Module directory
│ └── config/ # Module directory (single-module part)
│ └── app_config.dart
├── assets/ # Assets directory
│ ├── images/
│ ├── fonts/
│ └── config/
│ └── settings.json
├── test/ # Tests directory
│ └── features/
│ └── auth/
│ └── auth_service_test.dart
├── android/
├── ios/
├── pubspec.yaml
├── README.md
└── CHANGELOG.md
Dart Server (Single-Project Workspace)
my_server/ # Workspace root = Project root
├── bin/ # Entry points directory
│ └── server.dart
├── lib/
│ └── src/ # Source directory
│ ├── api/ # Module directory
│ │ ├── routes.dart
│ │ ├── handlers.dart
│ │ └── api.md
│ ├── services/ # Module directory
│ │ ├── user_service.dart
│ │ ├── auth_service.dart
│ │ └── services.md
│ └── database/ # Module directory
│ ├── connection.dart
│ ├── repositories.dart
│ └── database.md
├── assets/ # Assets directory
│ ├── config/
│ │ └── server_config.yaml
│ └── static/
│ └── index.html
├── test/ # Tests directory
│ ├── api_test.dart
│ └── services_test.dart
├── doc/ # Documentation directory
│ └── deployment.md
├── Dockerfile
├── docker-compose.yaml
├── pubspec.yaml
└── README.md
Implementation Notes
Metadata Generation Process
1. Workspace Detection: Check for single or multi-project workspace 2. Project Detection: Analyze each
pubspec.yaml to determine project type 3. Source Location: Identify source directory based on project type 4.
Part Analysis: Determine if project has parts or flat module structure 5. Module Discovery: Scan for modules in appropriate locations 6.
Documentation Mapping: Locate all documentation files (workspace, project, part, module) 7.
Asset Mapping: Catalog assets and resources 8. Relationship Mapping: Identify dependencies between modules 9.
Validation: Check for required files and structural integrity
Path Conventions
All paths in metadata should follow these conventions:
- Absolute Paths: Use
root_pathfields for workspace/project roots - Relative Paths: All other paths are relative to their container
- Project
pathrelative to workspace root - Part
pathrelative to project root - Module
pathrelative to project root - Directory Paths: Paths ending with content (not extensions) are directories
lib/src/core- directoryassets- directoryexample/authentication- directory- File Paths: Paths with extensions are files
README.md- fileauthentication.md- filepubspec.yaml- file
Handling Edge Cases
-
Mixed Structures: Some projects mix conventions (e.g.,
lib/src/+lib/features/) - Solution: Support multiple source paths, prioritize by convention
- Monorepos: Multiple packages in single repository
- Solution: Treat each
pubspec.yamlas separate project
- Generated Code: Extensive use of code generation
- Solution: Track source files (
.dart), exclude generated (.g.dart)
- Legacy Projects: Non-standard structures
- Solution: Provide override configuration for custom structures