diff --git a/.nextchanges/bundles/agents-md-only.md b/.nextchanges/bundles/agents-md-only.md new file mode 100644 index 00000000000..4249656df54 --- /dev/null +++ b/.nextchanges/bundles/agents-md-only.md @@ -0,0 +1 @@ +* 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/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 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 d79f35fdb88..982e0564939 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 d0e9a696ddc..a699e7b7143 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/[SAMPLE_JOB_ID]?w=[WORKSPACE_ID] View your pipeline lakeflow_project_etl here: [DATABRICKS_URL]/pipelines/[UUID]?w=[WORKSPACE_ID] 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..27fa44dc9ce 100644 --- a/libs/template/renderer_test.go +++ b/libs/template/renderer_test.go @@ -226,12 +226,15 @@ func TestRendererSharedLibraryAndOverride(t *testing.T) { require.NoError(t, err) got := 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: #") - // claude_md is defined in both the shared library and this template's own + // 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") + + 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/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..5170d3ebb49 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 "agents_md"}}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..7994e2a701b 100644 --- a/libs/template/testdata/library-override/template/out.tmpl +++ b/libs/template/testdata/library-override/template/out.tmpl @@ -1,2 +1 @@ -own: {{template "claude_md" .}} -shared: {{template "agents_md" .}} +own: {{template "agents_md" .}}