Skip to content

Commit 2d86278

Browse files
committed
Add baseline guidance for BioFSharp extension agents
Document core dependency direction, model and namespace reuse, optional upstreaming, F# conventions, and validation commands. Include the guide in the template's scaffolding checklist.
1 parent 0432955 commit 2d86278

2 files changed

Lines changed: 94 additions & 2 deletions

File tree

‎AGENTS.md‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Working on a BioFSharp extension
2+
3+
## Purpose and scope
4+
5+
`BioFSharp.XYZ` is a template for an independently packaged extension of
6+
[BioFSharp](https://github.com/BioFSharp/BioFSharp). Its current `BioTalk` library,
7+
test, and documentation example demonstrate the tooling; they do not define the
8+
purpose of a scaffolded package.
9+
10+
When scaffolding, replace the placeholder names and update this section with the
11+
package's biological domain, supported capabilities, and boundaries. Keep this
12+
guide aligned with the implementation. Use `README.md` for user-facing setup and
13+
development instructions.
14+
15+
## Relationship to core BioFSharp
16+
17+
- Core provides general biological types, file-format models, IO, and foundational
18+
algorithms. Extensions build on that foundation with specialized functionality,
19+
models, and dependencies, and may have independent release schedules.
20+
- Keep dependencies directed from the extension toward core and other reusable
21+
packages. Do not introduce a dependency from core back to this extension or a
22+
circular dependency between extensions.
23+
- Check the referenced core package and relevant extension APIs before adding a
24+
type, parser, or algorithm. Reuse or compose existing representations instead of
25+
copying their implementations or creating competing versions of the same model.
26+
- Use NuGet package references as the portable default. A sibling checkout can
27+
help with inspection, but a fresh clone must not require a particular local
28+
repository layout. Check that APIs found in another checkout exist in the
29+
package version this project actually references.
30+
31+
## Models, namespaces, and ownership
32+
33+
- A namespace describes conceptual organization, not repository or assembly
34+
ownership. An extension may add distinct modules under
35+
`BioFSharp.FileFormats.<Format>` and `BioFSharp.IO.<Format>`, as appropriate.
36+
Avoid fully qualified type or module names already exported by core or another
37+
dependency. Package-specific APIs normally belong under `BioFSharp.XYZ`.
38+
- Keep reusable format models and parsing/writing independent of network access,
39+
persistence, and workflow orchestration. This is a separation of responsibilities;
40+
it does not require a separate project or NuGet package for every layer.
41+
- Distinguish a reusable file format from a service-specific response or projection.
42+
Preserve biological meaning when modelling data, including identifier semantics,
43+
units, coordinate conventions, evidence, and missing values where relevant.
44+
Prefer explicit types and conversions over silently dropping information.
45+
- Upstreaming a mature model or parser is optional. Consider it when it is broadly
46+
useful independently of this extension. Moving public types between assemblies
47+
needs a compatibility and versioning strategy even if their namespaces stay the
48+
same; do not treat it as a transparent file move.
49+
50+
## Repository and code conventions
51+
52+
- `src/BioFSharp.XYZ` contains the library; `tests/BioFSharp.XYZ.Tests` contains
53+
xUnit tests. `docs` contains literate F# examples. `build` contains FAKE targets.
54+
- Treat `global.json`, project files, and the local tool manifest as the sources
55+
of truth for SDK, target framework, and tool versions. The library's compatibility
56+
target is independent of the SDK and runtime used for development and tests.
57+
- Register new F# files explicitly in their `.fsproj` in dependency order. Update
58+
the solution, project references, and `build/ProjectInfo.fs` when adding or
59+
renaming projects; keep documentation DLL references aligned.
60+
- Follow existing F# conventions and document public APIs with `///` comments.
61+
Explain important biological assumptions and failure behavior in the API docs.
62+
- Test observable behavior with representative inputs and relevant edge cases.
63+
Keep ordinary tests independent of live services where possible, using fixtures
64+
or injected dependencies. Keep any live integration checks separately opt-in.
65+
66+
## Build and validation
67+
68+
Run commands from the repository root. Prefer the FAKE entry points for
69+
solution-wide checks; direct `dotnet` commands are useful for focused iteration.
70+
71+
| Task | Windows PowerShell | Linux / macOS |
72+
| --- | --- | --- |
73+
| Build | `.\build.cmd` | `bash ./build.sh` |
74+
| Tests and coverage | `.\build.cmd RunTests` | `bash ./build.sh RunTests` |
75+
| Build documentation | `.\build.cmd BuildDocs` | `bash ./build.sh BuildDocs` |
76+
| Package locally | `.\build.cmd Pack` | `bash ./build.sh Pack` |
77+
78+
`RunTests` cleans and builds before testing. `Pack` also runs those checks, prompts
79+
for the version from `RELEASE_NOTES.md`, and writes artifacts to `pkg`.
80+
Documentation targets restore the pinned tools automatically. After changing
81+
executable documentation, inspect the rendered examples as well as the command's
82+
exit status.
83+
84+
Choose validation appropriate to the change. Documentation-only guidance edits
85+
need path, link, and diff checks; they do not require rebuilding unchanged code.
86+
Report the checks performed and any limitations.
87+
88+
Release targets can push Git tags, publish NuGet packages, and deploy documentation.
89+
Run them as part of a requested release, not as routine validation. Publishing uses
90+
`NUGET_API_KEY`; keep credentials out of source and logs. See the README for the
91+
release workflow and the distinction between local packaging and publishing.

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ A template repository for creating an extension package for BioFSharp.
1010
- `tests/BioFSharp.XYZ.Tests`: an xUnit test project targeting .NET 10.
1111
- `build/build.fsproj`: a FAKE build project targeting .NET 10 that handles building, testing, packaging, and publishing.
1212
- `docs`: literate F# documentation and images.
13+
- [AGENTS.md](AGENTS.md): architecture and working conventions for agents contributing to a BioFSharp extension.
1314

1415
## Setup
1516

1617
1. Install the .NET 10 SDK. `global.json` selects the SDK family and is also used by CI.
17-
2. Replace `BioFSharp.XYZ` with your package name throughout the tracked file contents. This includes the solution, project references, source and test namespaces, `build/ProjectInfo.fs`, documentation, and package metadata.
18+
2. Replace `BioFSharp.XYZ` with your package name throughout the tracked file contents. This includes the solution, project references, source and test namespaces, `build/ProjectInfo.fs`, `AGENTS.md`, documentation, and package metadata.
1819
3. Rename `BioFSharp.XYZ.sln`, `src/BioFSharp.XYZ` and its `.fsproj`, and `tests/BioFSharp.XYZ.Tests` and its `.fsproj`. Check that the solution entries, test project reference, and `testProjects` in `build/ProjectInfo.fs` point to the renamed files.
1920
4. Fill in the library's NuGet metadata, including authors and description. Update `gitOwner` in `build/ProjectInfo.fs` and all repository, documentation, license, and release-notes URLs if your GitHub owner differs from `BioFSharp`.
2021
5. Update `docs/index.fsx`: its heading, library DLL name, include directory, and opened namespace must match the renamed project. If you change the library's target framework, update the framework directory in its `#I` directive too. Keep its BioFSharp package reference aligned with the library project.
21-
6. Replace the sample library, test, documentation, and release notes with your own content. Replace the images in `docs/img` as needed.
22+
6. Replace the sample library, test, documentation, and release notes with your own content. Update `AGENTS.md` with your package's purpose, capabilities, boundaries, and any additional conventions. Replace the images in `docs/img` as needed.
2223
7. Run `dotnet tool restore` from the repository root to install the pinned documentation tool. Documentation build/watch targets also restore it automatically.
2324
8. For coverage uploads, configure the `CODECOV_TOKEN` repository secret. The workflow derives the repository name automatically. For documentation hosting, configure GitHub Pages to deploy from the `gh-pages` branch, root directory; the first successful docs deployment creates that branch.
2425

0 commit comments

Comments
 (0)