From 8273a780680f4f356316f8988e95a920b9bc41dc Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 9 Oct 2026 09:39:49 +0000 Subject: [PATCH 1/5] bundle: stop generating CLAUDE.md in templates --- .nextchanges/bundles/agents-md-only.md | 1 + .../templates/dbt-sql/output/my_dbt_sql/CLAUDE.md | 6 ------ .../templates/default-minimal/python/output.txt | 1 - .../python/output/my_default_minimal/CLAUDE.md | 6 ------ .../skip/output/my_default_minimal/CLAUDE.md | 6 ------ .../sql/output/my_default_minimal/CLAUDE.md | 6 ------ .../templates/default-python/classic/output.txt | 4 ++-- .../classic/output/my_default_python/CLAUDE.md | 6 ------ .../default-python/combinations/classic/output.txt | 4 ++-- .../default-python/combinations/serverless/output.txt | 4 ++-- .../default-python/integration_classic/output.txt | 4 ++-- .../templates/default-python/serverless/output.txt | 4 ++-- .../serverless/output/my_default_python/CLAUDE.md | 6 ------ .../default-scala/output/my_default_scala/CLAUDE.md | 6 ------ .../default-sql/output/my_default_sql/CLAUDE.md | 6 ------ .../python/output/my_lakeflow_pipelines/CLAUDE.md | 6 ------ .../sql/output/my_lakeflow_pipelines/CLAUDE.md | 6 ------ .../bundle/templates/pydabs/deploy-classic/output.txt | 2 +- acceptance/pipelines/e2e/output.txt | 2 +- .../pipelines/e2e/output/lakeflow_project/CLAUDE.md | 6 ------ .../init/python/output/my_python_project/CLAUDE.md | 6 ------ .../init/sql/output/my_sql_project/CLAUDE.md | 6 ------ libs/template/renderer_test.go | 3 +-- libs/template/templates/common/library/agents.tmpl | 11 +---------- .../dbt-sql/template/{{.project_name}}/CLAUDE.md.tmpl | 1 - .../template/{{.project_name}}/CLAUDE.md.tmpl | 1 - .../template/{{.project_name}}/CLAUDE.md.tmpl | 1 - .../default/template/{{.project_name}}/CLAUDE.md.tmpl | 1 - .../testdata/library-override/library/override.tmpl | 2 +- .../testdata/library-override/template/out.tmpl | 2 +- 30 files changed, 17 insertions(+), 109 deletions(-) create mode 100644 .nextchanges/bundles/agents-md-only.md delete mode 100644 acceptance/bundle/templates/dbt-sql/output/my_dbt_sql/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-python/classic/output/my_default_python/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-python/serverless/output/my_default_python/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-scala/output/my_default_scala/CLAUDE.md delete mode 100644 acceptance/bundle/templates/default-sql/output/my_default_sql/CLAUDE.md delete mode 100644 acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/CLAUDE.md delete mode 100644 acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/CLAUDE.md delete mode 100644 acceptance/pipelines/e2e/output/lakeflow_project/CLAUDE.md delete mode 100644 acceptance/pipelines/init/python/output/my_python_project/CLAUDE.md delete mode 100644 acceptance/pipelines/init/sql/output/my_sql_project/CLAUDE.md delete mode 100644 libs/template/templates/dbt-sql/template/{{.project_name}}/CLAUDE.md.tmpl delete mode 100644 libs/template/templates/default-scala/template/{{.project_name}}/CLAUDE.md.tmpl delete mode 100644 libs/template/templates/default-sql/template/{{.project_name}}/CLAUDE.md.tmpl delete mode 100644 libs/template/templates/default/template/{{.project_name}}/CLAUDE.md.tmpl diff --git a/.nextchanges/bundles/agents-md-only.md b/.nextchanges/bundles/agents-md-only.md new file mode 100644 index 00000000000..898a7406f87 --- /dev/null +++ b/.nextchanges/bundles/agents-md-only.md @@ -0,0 +1 @@ +* Generate `AGENTS.md` without a redundant `CLAUDE.md` when initializing bundles. diff --git a/acceptance/bundle/templates/dbt-sql/output/my_dbt_sql/CLAUDE.md b/acceptance/bundle/templates/dbt-sql/output/my_dbt_sql/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/dbt-sql/output/my_dbt_sql/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-minimal/python/output.txt b/acceptance/bundle/templates/default-minimal/python/output.txt index 6740e17927b..2632de13bc3 100644 --- a/acceptance/bundle/templates/default-minimal/python/output.txt +++ b/acceptance/bundle/templates/default-minimal/python/output.txt @@ -18,7 +18,6 @@ To get started, refer to the project README.md file and the documentation at htt "my_default_minimal/.vscode/extensions.json", "my_default_minimal/.vscode/settings.json", "my_default_minimal/AGENTS.md", - "my_default_minimal/CLAUDE.md", "my_default_minimal/README.md", "my_default_minimal/databricks.yml", "my_default_minimal/fixtures/.gitkeep", diff --git a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/CLAUDE.md b/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-minimal/python/output/my_default_minimal/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/CLAUDE.md b/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-minimal/skip/output/my_default_minimal/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/CLAUDE.md b/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-minimal/sql/output/my_default_minimal/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-python/classic/output.txt b/acceptance/bundle/templates/default-python/classic/output.txt index 6cd8fec5544..873557670ea 100644 --- a/acceptance/bundle/templates/default-python/classic/output.txt +++ b/acceptance/bundle/templates/default-python/classic/output.txt @@ -52,7 +52,7 @@ Building python_artifact... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev/files... Created jobs.sample_job Created pipelines.my_default_python_etl -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t dev @@ -68,7 +68,7 @@ Created jobs.sample_job Created jobs.sample_job.permissions Created pipelines.my_default_python_etl Created pipelines.my_default_python_etl.permissions -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 4 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t prod diff --git a/acceptance/bundle/templates/default-python/classic/output/my_default_python/CLAUDE.md b/acceptance/bundle/templates/default-python/classic/output/my_default_python/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-python/classic/output/my_default_python/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-python/combinations/classic/output.txt b/acceptance/bundle/templates/default-python/combinations/classic/output.txt index 6310c512a36..930848ad17d 100644 --- a/acceptance/bundle/templates/default-python/combinations/classic/output.txt +++ b/acceptance/bundle/templates/default-python/combinations/classic/output.txt @@ -36,7 +36,7 @@ Validation OK! Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/dev/files... Created jobs.sample_job Created pipelines.X[UNIQUE_NAME]_etl -Files: 23 uploaded, 0 deleted +Files: 22 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted @@ -45,7 +45,7 @@ Created jobs.sample_job Created jobs.sample_job.permissions Created pipelines.X[UNIQUE_NAME]_etl Created pipelines.X[UNIQUE_NAME]_etl.permissions -Files: 25 uploaded, 0 deleted +Files: 24 uploaded, 0 deleted Resources: 4 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted diff --git a/acceptance/bundle/templates/default-python/combinations/serverless/output.txt b/acceptance/bundle/templates/default-python/combinations/serverless/output.txt index 6310c512a36..930848ad17d 100644 --- a/acceptance/bundle/templates/default-python/combinations/serverless/output.txt +++ b/acceptance/bundle/templates/default-python/combinations/serverless/output.txt @@ -36,7 +36,7 @@ Validation OK! Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/dev/files... Created jobs.sample_job Created pipelines.X[UNIQUE_NAME]_etl -Files: 23 uploaded, 0 deleted +Files: 22 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted @@ -45,7 +45,7 @@ Created jobs.sample_job Created jobs.sample_job.permissions Created pipelines.X[UNIQUE_NAME]_etl Created pipelines.X[UNIQUE_NAME]_etl.permissions -Files: 25 uploaded, 0 deleted +Files: 24 uploaded, 0 deleted Resources: 4 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted diff --git a/acceptance/bundle/templates/default-python/integration_classic/output.txt b/acceptance/bundle/templates/default-python/integration_classic/output.txt index 6511805177c..c7a5b0bca5b 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/output.txt +++ b/acceptance/bundle/templates/default-python/integration_classic/output.txt @@ -34,7 +34,7 @@ Uploading .databricks/bundle/dev/patched_wheels/python_artifact_project_name_[UN Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files... Created jobs.sample_job Created pipelines.project_name_[UNIQUE_NAME]_etl -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle summary -t dev @@ -294,7 +294,7 @@ Created jobs.sample_job Created jobs.sample_job.permissions Created pipelines.project_name_[UNIQUE_NAME]_etl Created pipelines.project_name_[UNIQUE_NAME]_etl.permissions -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 4 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle summary -t prod diff --git a/acceptance/bundle/templates/default-python/serverless/output.txt b/acceptance/bundle/templates/default-python/serverless/output.txt index b30ddf740f9..1a92c10eeeb 100644 --- a/acceptance/bundle/templates/default-python/serverless/output.txt +++ b/acceptance/bundle/templates/default-python/serverless/output.txt @@ -56,7 +56,7 @@ Uploading dist/my_default_python-0.0.1-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev/files... Created jobs.sample_job Created pipelines.my_default_python_etl -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t dev @@ -74,7 +74,7 @@ Created jobs.sample_job Created jobs.sample_job.permissions Created pipelines.my_default_python_etl Created pipelines.my_default_python_etl.permissions -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 4 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t prod diff --git a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/CLAUDE.md b/acceptance/bundle/templates/default-python/serverless/output/my_default_python/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-python/serverless/output/my_default_python/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-scala/output/my_default_scala/CLAUDE.md b/acceptance/bundle/templates/default-scala/output/my_default_scala/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-scala/output/my_default_scala/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/default-sql/output/my_default_sql/CLAUDE.md b/acceptance/bundle/templates/default-sql/output/my_default_sql/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/default-sql/output/my_default_sql/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/CLAUDE.md b/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/CLAUDE.md b/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/bundle/templates/pydabs/deploy-classic/output.txt b/acceptance/bundle/templates/pydabs/deploy-classic/output.txt index b927e571beb..74c19b9af3d 100644 --- a/acceptance/bundle/templates/pydabs/deploy-classic/output.txt +++ b/acceptance/bundle/templates/pydabs/deploy-classic/output.txt @@ -22,5 +22,5 @@ Uploading .databricks/bundle/dev/patched_wheels/python_artifact_my_pydabs/my_pyd Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_pydabs/dev/files... Created jobs.sample_job Created pipelines.my_pydabs_etl -Files: 22 uploaded, 0 deleted +Files: 21 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged diff --git a/acceptance/pipelines/e2e/output.txt b/acceptance/pipelines/e2e/output.txt index e72dbfeb1fb..468da80b7cd 100644 --- a/acceptance/pipelines/e2e/output.txt +++ b/acceptance/pipelines/e2e/output.txt @@ -19,7 +19,7 @@ Please refer to the README.md file for "getting started" instructions. Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lakeflow_project/dev/files... Created jobs.sample_job Created pipelines.lakeflow_project_etl -Files: 14 uploaded, 0 deleted +Files: 13 uploaded, 0 deleted Resources: 2 created, 0 changed, 0 deleted, 0 unchanged View your job sample_job here: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID] View your pipeline lakeflow_project_etl here: [DATABRICKS_URL]/pipelines/[UUID]?w=[NUMID] diff --git a/acceptance/pipelines/e2e/output/lakeflow_project/CLAUDE.md b/acceptance/pipelines/e2e/output/lakeflow_project/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/pipelines/e2e/output/lakeflow_project/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/pipelines/init/python/output/my_python_project/CLAUDE.md b/acceptance/pipelines/init/python/output/my_python_project/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/pipelines/init/python/output/my_python_project/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/acceptance/pipelines/init/sql/output/my_sql_project/CLAUDE.md b/acceptance/pipelines/init/sql/output/my_sql_project/CLAUDE.md deleted file mode 100644 index 5612c9bde2f..00000000000 --- a/acceptance/pipelines/init/sql/output/my_sql_project/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md diff --git a/libs/template/renderer_test.go b/libs/template/renderer_test.go index 64ffdb6dbdc..05c1010783a 100644 --- a/libs/template/renderer_test.go +++ b/libs/template/renderer_test.go @@ -229,8 +229,7 @@ func TestRendererSharedLibraryAndOverride(t *testing.T) { // agents_md is defined only in the shared library, so rendering it (a heading) // without error proves the shared library is parsed into the template's namespace. assert.Contains(t, got, "shared: #") - // claude_md is defined in both the shared library and this template's own - // library; the template's own definition must take precedence. + // The template's experimental_deployment_history overrides the shared definition. assert.Contains(t, got, "own: OWN WINS") } diff --git a/libs/template/templates/common/library/agents.tmpl b/libs/template/templates/common/library/agents.tmpl index 7455ab15ab7..bf3104f2ecb 100644 --- a/libs/template/templates/common/library/agents.tmpl +++ b/libs/template/templates/common/library/agents.tmpl @@ -1,5 +1,5 @@ {{- /* - * Template for the AGENTS.md / CLAUDE.md files created in new projects. + * Template for the AGENTS.md file created in new projects. * * Goal for this file is to point agents to Databricks AI Tools for guidance. * A secondary goal is to offer a placeholder to users to extend with their own instructions. @@ -34,12 +34,3 @@ If the CLI is not installed, see: https://docs.databricks.com/dev-tools/cli/inst {{- end -}} - -{{- define "claude_md" -}} -# CLAUDE.md - -Project guidance for AI agents lives in AGENTS.md. -Claude Code loads it via the import below. - -@AGENTS.md -{{- end -}} diff --git a/libs/template/templates/dbt-sql/template/{{.project_name}}/CLAUDE.md.tmpl b/libs/template/templates/dbt-sql/template/{{.project_name}}/CLAUDE.md.tmpl deleted file mode 100644 index 197fa48b81b..00000000000 --- a/libs/template/templates/dbt-sql/template/{{.project_name}}/CLAUDE.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{template "claude_md" .}} diff --git a/libs/template/templates/default-scala/template/{{.project_name}}/CLAUDE.md.tmpl b/libs/template/templates/default-scala/template/{{.project_name}}/CLAUDE.md.tmpl deleted file mode 100644 index 197fa48b81b..00000000000 --- a/libs/template/templates/default-scala/template/{{.project_name}}/CLAUDE.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{template "claude_md" .}} diff --git a/libs/template/templates/default-sql/template/{{.project_name}}/CLAUDE.md.tmpl b/libs/template/templates/default-sql/template/{{.project_name}}/CLAUDE.md.tmpl deleted file mode 100644 index 197fa48b81b..00000000000 --- a/libs/template/templates/default-sql/template/{{.project_name}}/CLAUDE.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{template "claude_md" .}} diff --git a/libs/template/templates/default/template/{{.project_name}}/CLAUDE.md.tmpl b/libs/template/templates/default/template/{{.project_name}}/CLAUDE.md.tmpl deleted file mode 100644 index 197fa48b81b..00000000000 --- a/libs/template/templates/default/template/{{.project_name}}/CLAUDE.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{template "claude_md" .}} diff --git a/libs/template/testdata/library-override/library/override.tmpl b/libs/template/testdata/library-override/library/override.tmpl index aeb54aea7f0..16dbafde65f 100644 --- a/libs/template/testdata/library-override/library/override.tmpl +++ b/libs/template/testdata/library-override/library/override.tmpl @@ -1 +1 @@ -{{define "claude_md"}}OWN WINS{{end}} +{{define "experimental_deployment_history"}}OWN WINS{{end}} diff --git a/libs/template/testdata/library-override/template/out.tmpl b/libs/template/testdata/library-override/template/out.tmpl index 8da557e7af8..2c99f47910d 100644 --- a/libs/template/testdata/library-override/template/out.tmpl +++ b/libs/template/testdata/library-override/template/out.tmpl @@ -1,2 +1,2 @@ -own: {{template "claude_md" .}} +own: {{template "experimental_deployment_history" .}} shared: {{template "agents_md" .}} From 9df56406f2875fe783de0efc73da87bf80c066c1 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 9 Oct 2026 09:47:30 +0000 Subject: [PATCH 2/5] docs: link bundle changelog entry to PR --- .nextchanges/bundles/agents-md-only.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nextchanges/bundles/agents-md-only.md b/.nextchanges/bundles/agents-md-only.md index 898a7406f87..4c515bee948 100644 --- a/.nextchanges/bundles/agents-md-only.md +++ b/.nextchanges/bundles/agents-md-only.md @@ -1 +1 @@ -* Generate `AGENTS.md` without a redundant `CLAUDE.md` when initializing bundles. +* Generate `AGENTS.md` without a redundant `CLAUDE.md` when initializing bundles. ([#7000](https://github.com/databricks/cli/pull/7000)) From 7043818967fdb2730df1d08318b260595336ddcc Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 9 Oct 2026 10:03:38 +0000 Subject: [PATCH 3/5] test: update migration upload count --- acceptance/bundle/migrate/command/default-python/output.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/migrate/command/default-python/output.txt b/acceptance/bundle/migrate/command/default-python/output.txt index ed9dc1902b0..8212f47a6c9 100644 --- a/acceptance/bundle/migrate/command/default-python/output.txt +++ b/acceptance/bundle/migrate/command/default-python/output.txt @@ -150,7 +150,7 @@ Building python_artifact... Uploading .databricks/bundle/dev/patched_wheels/python_artifact_my_default_python/my_default_python-0.0.1+[UNIX_TIME_NANOS][3]-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev/files... Updated jobs.sample_job -Files: 21 uploaded, 0 deleted +Files: 20 uploaded, 0 deleted Resources: 0 created, 1 changed, 0 deleted, 1 unchanged >>> print_state.py From 5cbcb257d6804e5f6a86d417af91df95dfb74fad Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 9 Oct 2026 11:51:16 +0000 Subject: [PATCH 4/5] test: anchor template override fixture on AGENTS.md --- .nextchanges/bundles/agents-md-only.md | 2 +- libs/template/renderer_test.go | 39 +++++++++---------- .../library-override/library/override.tmpl | 2 +- .../library-override/template/AGENTS.md.tmpl | 1 + .../library-override/template/out.tmpl | 2 - 5 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 libs/template/testdata/library-override/template/AGENTS.md.tmpl delete mode 100644 libs/template/testdata/library-override/template/out.tmpl diff --git a/.nextchanges/bundles/agents-md-only.md b/.nextchanges/bundles/agents-md-only.md index 4c515bee948..4249656df54 100644 --- a/.nextchanges/bundles/agents-md-only.md +++ b/.nextchanges/bundles/agents-md-only.md @@ -1 +1 @@ -* Generate `AGENTS.md` without a redundant `CLAUDE.md` when initializing bundles. ([#7000](https://github.com/databricks/cli/pull/7000)) +* No longer include `CLAUDE.md` in the bundle templates, now that Claude supports `AGENTS.md`. ([#7000](https://github.com/databricks/cli/pull/7000)) diff --git a/libs/template/renderer_test.go b/libs/template/renderer_test.go index 05c1010783a..b3c169a0232 100644 --- a/libs/template/renderer_test.go +++ b/libs/template/renderer_test.go @@ -207,30 +207,29 @@ func TestRendererWithAssociatedTemplateInLibrary(t *testing.T) { } func TestRendererSharedLibraryAndOverride(t *testing.T) { - tmpDir := t.TempDir() - ctx := t.Context() ctx = cmdctx.SetWorkspaceClient(ctx, nil) helpers := loadHelpers(ctx) - r, err := newRenderer(ctx, nil, helpers, os.DirFS("."), "./testdata/library-override/template", "./testdata/library-override/library") - require.NoError(t, err) - - err = r.walk() - require.NoError(t, err) - out, err := filer.NewLocalClient(tmpDir) - require.NoError(t, err) - err = r.persistToDisk(ctx, out) - require.NoError(t, err) - - b, err := os.ReadFile(filepath.Join(tmpDir, "out")) - require.NoError(t, err) - got := string(b) + render := func(libraryDir string) string { + t.Helper() + tmpDir := t.TempDir() + r, err := newRenderer(ctx, nil, helpers, os.DirFS("."), "./testdata/library-override/template", libraryDir) + require.NoError(t, err) + + err = r.walk() + require.NoError(t, err) + out, err := filer.NewLocalClient(tmpDir) + require.NoError(t, err) + err = r.persistToDisk(ctx, out) + require.NoError(t, err) + + b, err := os.ReadFile(filepath.Join(tmpDir, "AGENTS.md")) + require.NoError(t, err) + return string(b) + } - // agents_md is defined only in the shared library, so rendering it (a heading) - // without error proves the shared library is parsed into the template's namespace. - assert.Contains(t, got, "shared: #") - // The template's experimental_deployment_history overrides the shared definition. - assert.Contains(t, got, "own: OWN WINS") + assert.Contains(t, render("./testdata/library-override/no-library"), "# Declarative Automation Bundles Project") + assert.Equal(t, "OWN WINS", strings.TrimSpace(render("./testdata/library-override/library"))) } func TestRendererExecuteTemplate(t *testing.T) { diff --git a/libs/template/testdata/library-override/library/override.tmpl b/libs/template/testdata/library-override/library/override.tmpl index 16dbafde65f..5170d3ebb49 100644 --- a/libs/template/testdata/library-override/library/override.tmpl +++ b/libs/template/testdata/library-override/library/override.tmpl @@ -1 +1 @@ -{{define "experimental_deployment_history"}}OWN WINS{{end}} +{{define "agents_md"}}OWN WINS{{end}} diff --git a/libs/template/testdata/library-override/template/AGENTS.md.tmpl b/libs/template/testdata/library-override/template/AGENTS.md.tmpl new file mode 100644 index 00000000000..4fdb4bba90c --- /dev/null +++ b/libs/template/testdata/library-override/template/AGENTS.md.tmpl @@ -0,0 +1 @@ +{{template "agents_md" .}} diff --git a/libs/template/testdata/library-override/template/out.tmpl b/libs/template/testdata/library-override/template/out.tmpl deleted file mode 100644 index 2c99f47910d..00000000000 --- a/libs/template/testdata/library-override/template/out.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -own: {{template "experimental_deployment_history" .}} -shared: {{template "agents_md" .}} From 58a9067c0ba843ef3d53c677a51fd0b3db6f889f Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Fri, 9 Oct 2026 12:36:14 +0000 Subject: [PATCH 5/5] test: simplify AGENTS.md override coverage --- libs/template/renderer_test.go | 43 +++++++++++-------- .../library-override/template/AGENTS.md.tmpl | 1 - .../library-override/template/out.tmpl | 1 + 3 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 libs/template/testdata/library-override/template/AGENTS.md.tmpl create mode 100644 libs/template/testdata/library-override/template/out.tmpl diff --git a/libs/template/renderer_test.go b/libs/template/renderer_test.go index b3c169a0232..27fa44dc9ce 100644 --- a/libs/template/renderer_test.go +++ b/libs/template/renderer_test.go @@ -207,29 +207,34 @@ func TestRendererWithAssociatedTemplateInLibrary(t *testing.T) { } func TestRendererSharedLibraryAndOverride(t *testing.T) { + tmpDir := t.TempDir() + ctx := t.Context() ctx = cmdctx.SetWorkspaceClient(ctx, nil) helpers := loadHelpers(ctx) - render := func(libraryDir string) string { - t.Helper() - tmpDir := t.TempDir() - r, err := newRenderer(ctx, nil, helpers, os.DirFS("."), "./testdata/library-override/template", libraryDir) - require.NoError(t, err) - - err = r.walk() - require.NoError(t, err) - out, err := filer.NewLocalClient(tmpDir) - require.NoError(t, err) - err = r.persistToDisk(ctx, out) - require.NoError(t, err) - - b, err := os.ReadFile(filepath.Join(tmpDir, "AGENTS.md")) - require.NoError(t, err) - return string(b) - } + r, err := newRenderer(ctx, nil, helpers, os.DirFS("."), "./testdata/library-override/template", "./testdata/library-override/library") + require.NoError(t, err) + + err = r.walk() + require.NoError(t, err) + out, err := filer.NewLocalClient(tmpDir) + require.NoError(t, err) + err = r.persistToDisk(ctx, out) + require.NoError(t, err) + + b, err := os.ReadFile(filepath.Join(tmpDir, "out")) + require.NoError(t, err) + got := string(b) + + // agents_md is defined in both the shared library and this template's own + // library; the template's own definition must take precedence. + assert.Contains(t, got, "own: OWN WINS") - assert.Contains(t, render("./testdata/library-override/no-library"), "# Declarative Automation Bundles Project") - assert.Equal(t, "OWN WINS", strings.TrimSpace(render("./testdata/library-override/library"))) + r, err = newRenderer(ctx, nil, helpers, os.DirFS("."), "./testdata/library-override/template", "./testdata/library-override/no-library") + require.NoError(t, err) + got, err = r.executeTemplate(`{{template "agents_md" .}}`) + require.NoError(t, err) + assert.Contains(t, got, "# Declarative Automation Bundles Project") } func TestRendererExecuteTemplate(t *testing.T) { diff --git a/libs/template/testdata/library-override/template/AGENTS.md.tmpl b/libs/template/testdata/library-override/template/AGENTS.md.tmpl deleted file mode 100644 index 4fdb4bba90c..00000000000 --- a/libs/template/testdata/library-override/template/AGENTS.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{template "agents_md" .}} diff --git a/libs/template/testdata/library-override/template/out.tmpl b/libs/template/testdata/library-override/template/out.tmpl new file mode 100644 index 00000000000..7994e2a701b --- /dev/null +++ b/libs/template/testdata/library-override/template/out.tmpl @@ -0,0 +1 @@ +own: {{template "agents_md" .}}