|
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +.. or more contributor license agreements. See the NOTICE file |
| 3 | +.. distributed with this work for additional information |
| 4 | +.. regarding copyright ownership. The ASF licenses this file |
| 5 | +.. to you under the Apache License, Version 2.0 (the |
| 6 | +.. "License"); you may not use this file except in compliance |
| 7 | +.. with the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | +.. http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +.. Unless required by applicable law or agreed to in writing, |
| 12 | +.. software distributed under the License is distributed on an |
| 13 | +.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +.. KIND, either express or implied. See the License for the |
| 15 | +.. specific language governing permissions and limitations |
| 16 | +.. under the License. |
| 17 | +
|
| 18 | +Using AI Coding Assistants |
| 19 | +========================== |
| 20 | + |
| 21 | +If you write DataFusion Python code with an AI coding assistant, this |
| 22 | +project ships machine-readable guidance so the assistant produces |
| 23 | +idiomatic code rather than guessing from its training data. |
| 24 | + |
| 25 | +What is published |
| 26 | +----------------- |
| 27 | + |
| 28 | +- `SKILL.md <https://github.com/apache/datafusion-python/blob/main/SKILL.md>`_ — |
| 29 | + a dense, skill-oriented reference covering imports, data loading, |
| 30 | + DataFrame operations, expression building, SQL-to-DataFrame mappings, |
| 31 | + idiomatic patterns, and common pitfalls. Follows the |
| 32 | + `Agent Skills <https://agentskills.io>`_ open standard. |
| 33 | +- `llms.txt <llms.txt>`_ — an entry point for LLM-based tools following the |
| 34 | + `llmstxt.org <https://llmstxt.org>`_ convention. Categorized links to the |
| 35 | + skill, user guide, API reference, and examples. |
| 36 | + |
| 37 | +Both files live at stable URLs so an agent can discover them without a |
| 38 | +checkout of the repo. |
| 39 | + |
| 40 | +Installing the skill |
| 41 | +-------------------- |
| 42 | + |
| 43 | +**Preferred:** run |
| 44 | + |
| 45 | +.. code-block:: shell |
| 46 | +
|
| 47 | + npx skills add apache/datafusion-python |
| 48 | +
|
| 49 | +This installs the skill in any supported agent on your machine (Claude |
| 50 | +Code, Cursor, Windsurf, Cline, Codex, Copilot, Gemini CLI, and others). |
| 51 | +The command writes the pointer into the agent's configuration so that any |
| 52 | +project you open that uses DataFusion Python picks up the skill |
| 53 | +automatically. |
| 54 | + |
| 55 | +**Manual:** if you are not using the ``skills`` registry, paste this |
| 56 | +single line into your project's ``AGENTS.md`` or ``CLAUDE.md``:: |
| 57 | + |
| 58 | + For DataFusion Python code, see https://github.com/apache/datafusion-python/blob/main/SKILL.md |
| 59 | + |
| 60 | +Most assistants resolve that pointer the first time they see a |
| 61 | +DataFusion-related prompt in the project. |
| 62 | + |
| 63 | +What the skill covers |
| 64 | +--------------------- |
| 65 | + |
| 66 | +Writing DataFusion Python code has a handful of conventions that are easy |
| 67 | +for a model to miss — bitwise ``&`` / ``|`` / ``~`` instead of Python |
| 68 | +``and`` / ``or`` / ``not``, the lazy-DataFrame immutability model, how |
| 69 | +window functions replace SQL correlated subqueries, the ``case`` / |
| 70 | +``when`` builder syntax, and the ``in_list`` / ``array_position`` options |
| 71 | +for membership tests. The skill enumerates each of these with short, |
| 72 | +copyable examples. |
| 73 | + |
| 74 | +It is *not* a replacement for this user guide. Think of it as a distilled |
| 75 | +reference the assistant keeps open while it writes code for you. |
| 76 | + |
| 77 | +If you are an agent author |
| 78 | +-------------------------- |
| 79 | + |
| 80 | +The skill file and ``llms.txt`` are the two supported integration |
| 81 | +points. Both are versioned along with the release and follow open |
| 82 | +standards — no project-specific handshake is required. |
0 commit comments