|
| 1 | +<!-- |
| 2 | + This page is the one people hand to a coding assistant instead of the whole site, |
| 3 | + which is what makes an inaccurate one worse than none: it teaches a model an API |
| 4 | + that does not exist. Two rules while filling it in. |
| 5 | +
|
| 6 | + Write it from the source, not from memory. Every name, argument, default and |
| 7 | + return type here has to be one you read in {{ package_name }}/, and every name a |
| 8 | + caller is told to import has to be importable. Delete a section that carries |
| 9 | + nothing rather than padding it. |
| 10 | +
|
| 11 | + Keep it current. CONTRIBUTING.md says this page changes in the same pull request |
| 12 | + the public API does; the pull request checklist names it. That promise is the only |
| 13 | + thing keeping the page worth handing over. |
| 14 | +
|
| 15 | + bedrock-python.github.io/pg-partsmith/agents/ is the worked example to copy the |
| 16 | + shape from. Delete this comment once the page says something. |
| 17 | +--> |
| 18 | + |
| 19 | +# {{ project_name }} for AI agents |
| 20 | + |
| 21 | +> One page holding everything a coding assistant needs to use {{ project_name }} |
| 22 | +> correctly, plus a map of where the rest of the documentation keeps the details it |
| 23 | +> leaves out. Give an agent this page rather than the whole site. |
| 24 | + |
| 25 | +| | | |
| 26 | +|---|---| |
| 27 | +| Package | `{{ project_slug }}` on PyPI, import root `{{ package_name }}` | |
| 28 | +| Requires | Python {{ python_min_version }}+ | |
| 29 | +| Install | `pip install {{ project_slug }}` | |
| 30 | +| Source | <https://github.com/{{ github_org }}/{{ project_slug }}> | |
| 31 | + |
| 32 | +## How to read this page |
| 33 | + |
| 34 | +Every page of this site is also served as raw Markdown at its own URL with `.md` in |
| 35 | +place of the trailing slash — this page is `/agents.md`, the quick start is |
| 36 | +`/guide/quickstart.md` — so anything the map below points at can be fetched as plain |
| 37 | +text rather than scraped out of HTML. The **Copy page** control at the top of a page |
| 38 | +does the same thing for a human with a chat window open. The one exception is the API |
| 39 | +reference: its Markdown is a list of instructions to a docstring renderer rather than |
| 40 | +the API, so it carries neither the control nor a `.md` twin — read it as HTML, or read |
| 41 | +the docstrings in the source. |
| 42 | + |
| 43 | +Top to bottom before writing code. [Rules that hold or break the code](#rules-that-hold-or-break-the-code) |
| 44 | +is the section correctness lives in — those are the things the library will not save |
| 45 | +you from. Every name used below is in the public API; if you need something not listed |
| 46 | +here, fetch the page the [documentation map](#documentation-map) points at rather than |
| 47 | +guessing a method that sounds plausible. |
| 48 | + |
| 49 | +## Scope |
| 50 | + |
| 51 | +**It does** TODO: what the library is for, in the vocabulary a caller thinks in. |
| 52 | + |
| 53 | +**It does not** TODO: the neighbouring problems it deliberately leaves alone. This |
| 54 | +paragraph stops a model from inventing a feature; it is worth more than the one above. |
| 55 | + |
| 56 | +## Mental model |
| 57 | + |
| 58 | +TODO: the handful of nouns the API is built from and the flow between them. Name each |
| 59 | +type once and say what it owns. |
| 60 | + |
| 61 | +## Wiring |
| 62 | + |
| 63 | +```python |
| 64 | +# TODO: the shortest correct working example, imports included. It has to run. |
| 65 | +``` |
| 66 | + |
| 67 | +## API |
| 68 | + |
| 69 | +TODO: tables, not prose. Every public name a caller needs, with its arguments, their |
| 70 | +defaults and what comes back. Read the defaults out of the source rather than |
| 71 | +remembering them. |
| 72 | + |
| 73 | +| Name | Arguments | Returns | |
| 74 | +|---|---|---| |
| 75 | +| | | | |
| 76 | + |
| 77 | +## Rules that hold or break the code |
| 78 | + |
| 79 | +TODO: numbered, one rule per item, each one a thing the library will not save a caller |
| 80 | +from — an object that must not be shared, an argument whose default surprises people, a |
| 81 | +call that has to be repeated until it says it is finished, a lifetime that is the |
| 82 | +caller's to manage. Write the ones that are true here, not the ones that sound wise. |
| 83 | + |
| 84 | +## Common mistakes |
| 85 | + |
| 86 | +```python |
| 87 | +# WRONG — TODO: the mistake a model actually makes with this API |
| 88 | + |
| 89 | +# RIGHT — TODO: the same thing, done properly |
| 90 | +``` |
| 91 | + |
| 92 | +## Errors |
| 93 | + |
| 94 | +TODO: the exception classes, what each one means, and what a caller should do about it. |
| 95 | + |
| 96 | +## Documentation map |
| 97 | + |
| 98 | +Fetch a page when the task is the one named beside it. |
| 99 | + |
| 100 | +| Page | Read it when | |
| 101 | +|---|---| |
| 102 | +| [Quick start](guide/quickstart.md) | writing the first integration end to end | |
| 103 | +| [Configuration](guide/configuration.md) | every setting, type and default | |
| 104 | +| [Advanced](guide/advanced.md) | TODO: what this page actually covers | |
| 105 | +| [API reference](reference/index.md) | an exact signature or docstring — HTML only, see above | |
| 106 | +| [Changelog](changelog.md) | what changed between versions | |
0 commit comments