fabric-toolbox / fabric-assessment-tool
Copilot instructions917 starsChanged 5 months agoMITView on GitHub
Commands follow a pattern: - cli/router.py - Routes to command handlers - commands/base.py - Abstract BaseCommand with get_name(), configure_parser(), handle() - commands/assess.py, commands/visualize.py - Concrete command implementations 1. Services (services/) orchestrate the assessment workflow - AssessmentService - Main entry point, handles workspace iteration and dispatches to a platform client - StructuredExportService - Writes assessment dataclasses to a hierarchical on-disk tree. Today only the JSON exporter is implemented; CSVExporter and ParquetExporter are scaffolding stubs. See json-export-service.md for the folder layout, wrapped-JSON…
- Installs packages
In this repository3 other files it gives its agents.
- tools/MicrosoftFabricMgmt/CLAUDE.mdCLAUDE.md
- tools/MicrosoftFabricMgmtMCPServer/CLAUDE.mdCLAUDE.md
- tools/SemanticModelMCPServer/.github/copilot-instructions.mdCopilot instructions
The file
We split this copilot-instructions.md into the rules it gives an agent
9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 96
All view templates {% extends "base.html" %} with {% block content %} and {% block scripts %}.
- Very specific: line 178
json_response: Any: Always include to preserve raw API response for debugging/extended analysis - Very specific: line 179
Optional fields with defaults: Place after required fields (e.g., uses_mssparkutils: bool = False)
- Very specific: line 186
Add field to top-level SynapseAssessment or DatabricksAssessment
- Very specific: line 187
Update get_summary() to include counts
- Very specific: line 189
Add to StructuredExportService export logic
- Very specific: line 194
Create assessment dataclasses in assessment/new_platform.py
- Very specific: line 195
Create client in clients/new_platform_client.py with assess_workspace() method
- Very specific: line 197
Add templates in templates/new_platform/
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for Fabric Assessment Tool
Build, Test & Lint
# Install in development mode
pip install -e .
# Run all tests with coverage
tox run -e py312 # or py310, py311
# Run a single test file
pytest tests/test_clients/test_synapse_client.py
# Run a single test
pytest tests/test_clients/test_synapse_client.py::test_get_workspace_info_success -v
# Lint/format (uses Black)
tox run -e lint
# Type checking (uses mypy)
tox run -e type
# Build distributable package
pip install build && python -m buildArchitecture
CLI Structure
Entry point is fat command defined in pyproject.toml → main:main → CLIRouter.
Commands follow a pattern:
cli/router.py- Routes to command handlerscommands/base.py- AbstractBaseCommandwithget_name(),configure_parser(),handle()commands/assess.py,commands/visualize.py- Concrete command implementations
Core Flow
CLI Command → Service Layer → Platform Client → Assessment Dataclasses → Export- Services (
services/) orchestrate the assessment workflowAssessmentService- Main entry point, handles workspace iteration and dispatches to a platform clientStructuredExportService- Writes assessment dataclasses to a hierarchical on-disk tree. Today only the JSON exporter is implemented;CSVExporterandParquetExporterare scaffolding stubs. Seejson-export-service.mdfor the folder layout, wrapped-JSON shape, and extension points.VisualizationService- Generates HTML reports from assessment data. Seehtml-generator.md.
- Clients (
clients/) handle platform-specific API callsSynapseClient- Azure Synapse Analytics APIs (ARM + dev data plane)DatabricksClient- Databricks APIs (usesdatabricks-sdk)OdbcClient- ODBC/TDS access to Synapse dedicated SQL pools viamssql-python; supports SQL auth and three Entra ID modes (entra-interactive,entra-spn,entra-default)ApiClient- Generic REST client wrapperTokenProvider- Authentication (Azure CLI or Fabric notebook)
Platform-specific conventions live in dedicated docs:
synapse-platform.mdfor Synapse client / ODBC / dedicated-pool statistics, anddatabricks-platform.mdfor Databricks API quirks, workspace-type detection, and rate-limiting. Read them before touching the corresponding client.
- Assessment Dataclasses (
assessment/)synapse.py- All Synapse-specific dataclasses (SynapseAssessment,SynapseNotebook, etc.)databricks.py- All Databricks-specific dataclasses (DatabricksAssessment, etc.)common.py- Shared types likeAssessmentStatus
HTML Templates (Visualization)
Templates use Jinja2 and are organized for platform-specific reporting.
See html-generator.md for the full pipeline,
JSON unwrapping convention, workspace-filter/Chart.js patterns,
view/resource extension steps, and Databricks-specific cluster-split /
avg-duration / network-badge rendering.
Quick layout:
templates/
├── base.html # Master layout (navbar, CSS, Chart.js, filter JS)
├── index.html # Redirects to platform-specific index
├── workspace.html # Fallback workspace detail
├── synapse/ {index,workspace}.html + views/
├── databricks/{index,workspace}.html + views/
└── views/ # Generic fallbacks (Synapse)Key conventions at a glance:
- All view templates
{% extends "base.html" %}with{% block content %}and{% block scripts %}. - Row filtering:
data-workspace="{{ ws_name }}"+ optionalupdateFilteredStats(selectedWorkspaces). - Custom filters:
format_number,format_size(registered inVisualizationService). - Platform detection:
_detect_platform()→platformtemplate variable. - Workspace filter persistence: localStorage key
fat-workspace-filter. - Always unwrap wrapped resource JSON with
item.<kind>_data or item.data or item— seehtml-generator.md.
Assessment Dataclass Hierarchy
Assessment data is modeled with Python dataclasses in assessment/. Each platform has a top-level assessment class containing nested dataclasses for each resource type.
Synapse Hierarchy (assessment/synapse.py)
SynapseAssessment
├── status: AssessmentStatus
├── workspace_info: SynapseWorkspaceInfo
├── sql_pools: SynapseSqlPools
│ ├── dedicated_pools: List[SynapseDedicatedPool]
│ │ └── database: SynapseDedicatedDatabase
│ │ └── schemas: SynapseSchemas → List[SynapseSchema]
│ │ ├── tables: SynapseTables → List[SynapseTable]
│ │ │ └── statistics: TableStatistics (optional)
│ │ └── views: SynapseViews → List[SynapseView]
│ └── serverless_pool: SynapseServerlessPool
│ └── databases: SynapseServerlessDatabases → List[SynapseServerlessDatabase]
├── spark_pools: SynapseSparkPools → List[SynapseSparkPool]
├── notebooks: SynapseNotebooks → List[SynapseNotebook]
├── pipelines: SynapsePipelines → List[SynapsePipeline]
├── dataflows: SynapseDataflows → List[SynapseDataflow]
├── spark_job_definitions: SynapseSparkJobDefinitions → List[SynapseSparkJobDefinition]
├── sql_scripts: SynapseSqlScripts → List[SynapseSqlScript]
├── integration_runtimes: SynapseIntegrationRuntimes → List[SynapseIntegrationRuntime]
├── linked_services: SynapseLinkedServices → List[SynapseLinkedService]
├── datasets: SynapseDatasets → List[SynapseDataset]
├── managed_private_endpoints: SynapseManagedPrivateEndpoints → List[SynapseManagedPrivateEndpoint]
├── libraries: SynapseLibraries → List[SynapseLibrary]
├── spark_configurations: SynapseSparkConfigurations → List[SynapseSparkConfiguration]
└── assessment_metadata: SynapseAssessmentMetadataDatabricks Hierarchy (assessment/databricks.py)
DatabricksAssessment
├── status: AssessmentStatus
├── workspace_info: DatabricksWorkspaceInfo
│ └── network_settings: DatabricksNetworkSettings (grouped network fields)
├── clusters: DatabricksClusters → List[DatabricksCluster]
├── sql_warehouses: DatabricksSqlWarehouses → List[DatabricksSqlWarehouse]
├── notebooks: DatabricksNotebooks → List[DatabricksNotebook]
├── jobs: DatabricksJobs → List[DatabricksJob]
│ ├── tasks: DatabricksJobTasks → List[DatabricksJobTask]
│ ├── settings: DatabricksJobSettings
│ ├── latest_runs: DatabricksJobRuns → List[DatabricksJobRun]
│ └── avg_duration_ms_last_3_runs: Optional[float]
├── catalogs: DatabricksCatalogs → List[DatabricksCatalog] (Unity Catalog)
│ └── schemas: DatabricksSchemas → List[DatabricksSchema]
│ ├── tables: List[DatabricksTable]
│ ├── volumes: List[DatabricksVolume]
│ └── functions: List[DatabricksFunction]
├── external_locations: DatabricksExternalLocations → List[DatabricksExternalLocation]
├── connections: DatabricksConnections → List[DatabricksConnection]
├── secret_scopes: DatabricksSecretScopes → List[DatabricksSecretScope]
├── pipelines: DatabricksPipelines → List[DatabricksPipeline] (DLT)
├── repos: DatabricksRepos → List[DatabricksRepo]
├── experiments: DatabricksExperiments → List[DatabricksExperiment] (MLflow)
├── serving_endpoints: DatabricksServingEndpoints → List[DatabricksServingEndpoint]
├── alerts: DatabricksAlerts → List[DatabricksAlert]
├── genie_spaces: DatabricksGenieSpaces → List[DatabricksGenieSpace]
├── cluster_policies: DatabricksClusterPolicies → List[DatabricksClusterPolicy]
├── instance_pools: DatabricksInstancePools → List[DatabricksInstancePool]
└── assessment_metadata: DatabricksAssessmentMetadataDatabricks API quirks, workspace-type detection, duration fields, rate-limiting, and JSON-shape conventions live in
databricks-platform.md. Read it before touchingclients/databricks_client.pyor any Databricks template.
Dataclass Conventions
- Collection wrapper pattern: Each resource type has a plural wrapper (e.g.,
SynapseNotebookscontainsnotebooks: List[SynapseNotebook]) json_response: Any: Always include to preserve raw API response for debugging/extended analysis- Optional fields with defaults: Place after required fields (e.g.,
uses_mssparkutils: bool = False) get_summary()method: Top-level assessment classes implement this for generating summary statisticsAssessmentStatus: Shared status class incommon.pywithstatusanddescriptionfields
Adding a New Resource Type
- Define item dataclass (e.g.,
SynapseNewResource) withjson_response: Any - Define collection wrapper (e.g.,
SynapseNewResourceswithnew_resources: List[SynapseNewResource]) - Add field to top-level
SynapseAssessmentorDatabricksAssessment - Update
get_summary()to include counts - Implement extraction in corresponding client (e.g.,
SynapseClient._get_new_resources()) - Add to
StructuredExportServiceexport logic
Key Conventions
Adding a New Platform Source
- Create assessment dataclasses in
assessment/new_platform.py - Create client in
clients/new_platform_client.pywithassess_workspace()method - Register in
AssessmentService._get_client() - Add templates in
templates/new_platform/
Dataclass Pattern
Assessment data uses Python dataclasses with json_response: Any field to preserve raw API responses:
@dataclass
class SynapseNotebook:
name: str
language: str
json_response: Any # Always include raw responseError Handling
Custom exceptions in errors/api.py:
FATError- Base exception with status code supportAzureAPIError- Parses Azure REST API error responses
Authentication
Azure / Databricks token acquisition (via TokenProvider):
azure-cli(default) - Usesaz logincredentialsfabric- Usesnotebookutils.credentials.getToken()in Fabric notebooks. Note: Fabric notebook auth cannot reachmanagement.azure.com(the call hangs), soDatabricksClientand Synapse ARM fallbacks skip it in this mode — see_ensure_azure_client.
Synapse dedicated SQL pool auth (via OdbcClient.auth_mode):
sql(default) - SQL login + passwordentra-interactive- Browser popup with MFAentra-spn- Service Principal (needs--sql-client-id/--sql-client-secret;--sql-tenant-iddefaults tocommon)entra-default-DefaultAzureCredentialchain (Azure CLI, MI, etc.)
See synapse-platform.md for the full auth
selection flow (including the interactive prompt in
_get_sql_admin_credentials).
Output Structure
Assessment creates a hierarchical folder structure per workspace.
Full layout and the { "type": ..., "<kind>_data": {...}, "exported_at": ... }
wrapper convention are documented in
json-export-service.md. Quick sketch:
output/
├── <workspace>/
│ ├── summary.json # assessment_data.get_summary()
│ ├── workspace.json # Synapse only
│ ├── resources/ # flat per-kind folders
│ │ ├── notebooks/*.json
│ │ ├── clusters/*.json # Databricks
│ │ ├── sql_warehouses/*.json # Databricks
│ │ ├── jobs/*.json # Databricks
│ │ ├── pipelines/*.json # Synapse + Databricks (DLT)
│ │ └── ...
│ ├── admin/ # Synapse only
│ │ ├── integration_runtimes/
│ │ ├── linked_services/
│ │ └── datasets/
│ └── data/ # nested tree for databases/schemas/tables
│ ├── serverless_databases/ # Synapse
│ ├── dedicated_databases/ # Synapse
│ ├── unity_catalog/ # Databricks
│ └── legacy_databases/ # Databricks (pre-UC)
└── assessment_summary.json # aggregated summary across workspacesDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

