Skip to content

Commit d6499dc

Browse files
authored
docs: add CONTRIBUTING.md and template-only-files strip step (#44)
* docs: add CONTRIBUTING.md and template-only-files strip step Extends tk-342 with the dual-audience contributor flow: - CONTRIBUTING.md: new file for people improving the template scaffold (setup, toolchain, conventions, PR workflow, plugin-vs-template guidance). It is template-only and travels via the strip step below. - README.md: simplified to one audience (plugin authors). The contributor content moved entirely to CONTRIBUTING.md, which GitHub auto-surfaces on the repo page. This avoids dead links in scaffolded plugin repos after Step 6 runs. - README Setup Your Plugin: new Step 6 removes template-only files (CODE_OF_CONDUCT.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, .github/ISSUE_TEMPLATE/) so scaffolded plugin repos start clean. - docs/getting-started.md: extended with the matching strip step. * docs: only strip CONTRIBUTING.md, restore contributor section AGENTS.md/CLAUDE.md describe the same toolchain (tox, ruff, mypy, bandit, Conventional Commits, mloda-registry skills) that scaffolded plugins inherit, and CODE_OF_CONDUCT.md plus .github/ISSUE_TEMPLATE/ are sensible baselines that only need a small edit (contact email, placeholder paths). They are working scaffold content, not template metadata, so Step 6 keeps them. CONTRIBUTING.md is the only file that is genuinely template-only (its subject is "contributing to this template repo"), so it stays in the strip list with optional-edit guidance for the rest. The README regains its dual-audience intro and "Contribute to this template" section pointing to CONTRIBUTING.md, AGENTS.md, CODE_OF_CONDUCT.md, and the issue template, since most of those links now survive Step 6. * docs: split getting-started step 7 to clarify only CONTRIBUTING.md is removed
1 parent 7cf1ac3 commit d6499dc

3 files changed

Lines changed: 126 additions & 57 deletions

File tree

CONTRIBUTING.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributing to mloda-plugin-template
2+
3+
Thanks for considering a contribution to the **template** repo itself. This document is for people who want to improve the scaffold (CI workflows, examples, dev tooling, docs) that downstream plugin authors will inherit.
4+
5+
> **If you arrived here after clicking "Use this template" on GitHub:** this file does not apply to your new plugin repo. Follow the README's [Use this template](README.md#use-this-template) section, which includes a step that removes this file along with the other template-only community files.
6+
7+
By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md).
8+
9+
## Getting Started
10+
11+
### Prerequisites
12+
13+
- Python 3.10 or higher
14+
- [uv](https://docs.astral.sh/uv/) for dependency management
15+
- `tox` for running checks (installed via the dev extras)
16+
17+
### Local Development Setup
18+
19+
1. Fork the repository and clone your fork:
20+
21+
```bash
22+
git clone https://github.com/<your-username>/mloda-plugin-template.git
23+
cd mloda-plugin-template
24+
```
25+
26+
2. Create the virtualenv and install dependencies:
27+
28+
```bash
29+
uv venv
30+
source .venv/bin/activate
31+
uv sync --all-extras
32+
```
33+
34+
3. Verify your setup by running the full check suite:
35+
36+
```bash
37+
tox
38+
```
39+
40+
## Code Style
41+
42+
`tox` is the gate. It runs:
43+
44+
- `pytest` for tests
45+
- `ruff format --check --line-length 120` for formatting
46+
- `ruff check` for linting
47+
- `mypy --strict --ignore-missing-imports` for type checking
48+
- `bandit -c pyproject.toml -r -q` for security
49+
50+
All of these must pass before a PR is mergeable. A separate `tox -e security` environment runs `pip-audit` for CVE scanning of installed dependencies.
51+
52+
### Conventions
53+
54+
- **Type hints**: use modern forms (`list[str]`, `dict[str, int]`, `X | None`).
55+
- **Line length**: 120.
56+
- **Tests**: every new feature or bug fix must come with tests; follow the patterns in `tests/` and `placeholder/.../tests/`.
57+
- **Commits**: use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`, `style:`, `ci:`, `build:`, `perf:`). semantic-release uses standard rules: `feat:` triggers a minor bump, all others trigger a patch (see `.releaserc.yaml`).
58+
- **No `Co-Authored-By` lines or other AI agent mentions** in commit messages or PR descriptions.
59+
60+
## Pull Request Workflow
61+
62+
1. Create a feature branch from `main`:
63+
64+
```bash
65+
git checkout -b fix/short-description
66+
```
67+
68+
2. Make your changes; run `tox` locally and confirm it passes.
69+
3. Commit using Conventional Commits format.
70+
4. Push to your fork and open a pull request targeting `main`.
71+
5. CI runs the full tox suite. All checks must pass before merge.
72+
73+
## Reporting Issues
74+
75+
Use the issue form at [.github/ISSUE_TEMPLATE/issue.yml](.github/ISSUE_TEMPLATE/issue.yml). It asks for a one-sentence summary, reproduction or motivation, optional code pointers, and an optional definition of done. See the **Issue Creation** section in [AGENTS.md](AGENTS.md) for more guidance.
76+
77+
## Plugin Development vs. Template Contribution
78+
79+
This repo is the **scaffold** for new mloda plugins, not a plugin itself. If you want to:
80+
81+
- **Build a new plugin**: click "Use this template" on GitHub, then follow [docs/getting-started.md](docs/getting-started.md) and the README's [Use this template](README.md#use-this-template) section. The full plugin development walkthrough lives in [mloda-registry/docs/guides/](https://github.com/mloda-ai/mloda-registry/tree/main/docs/guides/).
82+
- **Contribute to the core framework**: see [mloda](https://github.com/mloda-ai/mloda).
83+
- **Contribute to community plugins**: see [mloda-registry](https://github.com/mloda-ai/mloda-registry).
84+
85+
## License
86+
87+
By contributing, you agree that your contributions will be licensed under the [Apache License, Version 2.0](LICENSE).

README.md

Lines changed: 37 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@
66

77
> **A GitHub template for creating standalone mloda plugins.** Part of the [mloda](https://github.com/mloda-ai/mloda) ecosystem for open data access. Visit [mloda.ai](https://mloda.ai) for an overview and business context, the [GitHub repository](https://github.com/mloda-ai/mloda) for technical context, or the [documentation](https://mloda-ai.github.io/mloda/) for detailed guides.
88
9-
Create your own FeatureGroups, ComputeFrameworks, and Extenders as standalone packages. See the [Getting Started guide](docs/getting-started.md) to create your repository, then follow the setup steps below.
9+
Create your own FeatureGroups, ComputeFrameworks, and Extenders as standalone packages. This repository serves two audiences:
10+
11+
- **Plugin authors**: click *Use this template* on GitHub to scaffold a new plugin repository, then follow the [Use this template](#use-this-template) section below.
12+
- **Template contributors**: improving the scaffold itself? See [CONTRIBUTING.md](CONTRIBUTING.md) and the [Contribute to this template](#contribute-to-this-template) section.
1013

1114
## Related Repositories
1215

1316
- **[mloda](https://github.com/mloda-ai/mloda)**: The core library for open data access. Declaratively define what data you need, not how to get it. mloda handles feature resolution, dependency management, and compute framework abstraction automatically.
1417

1518
- **[mloda-registry](https://github.com/mloda-ai/mloda-registry)**: The central hub for discovering and sharing mloda plugins. Browse community-contributed FeatureGroups, find integration guides, and publish your own plugins for others to use.
1619

17-
## Structure
20+
## Use this template
21+
22+
Click *Use this template* on GitHub to scaffold a new plugin repository. See [docs/getting-started.md](docs/getting-started.md) for the GitHub template-creation walkthrough; once your repository is in place, follow the steps below to customize the scaffold for your organization.
23+
24+
### Structure
1825

1926
```
2027
placeholder/
@@ -34,18 +41,14 @@ placeholder/
3441
└── my_extender.py
3542
```
3643

37-
## Key Files
44+
### Key files
3845

39-
- `placeholder/` - Root namespace (users rename to company name)
40-
- `pyproject.toml` - Package config (users edit directly, not auto-generated)
46+
- `placeholder/` - Root namespace (rename to your organization's name)
47+
- `pyproject.toml` - Package config (edit directly, not auto-generated)
4148
- `.github/workflows/test.yml` - CI workflow running pytest
4249

43-
## Common Tasks
44-
4550
### Setup Your Plugin
4651

47-
Follow these steps to customize the template for your organization:
48-
4952
#### 1. Rename the directory
5053

5154
```bash
@@ -56,18 +59,18 @@ mv placeholder acme
5659

5760
Edit the following fields in `pyproject.toml`:
5861

59-
- `name`: Change `"placeholder-my-plugin"` to `"acme-my-plugin"`
60-
- `authors`: Update name and email
61-
- `description`: Update to describe your plugin
62-
- `tool.setuptools.packages.find.include`: Change `["placeholder*"]` to `["acme*"]`
63-
- `tool.pytest.ini_options.testpaths`: Change `["placeholder", "tests"]` to `["acme", "tests"]`
62+
- `name`: change `"placeholder-my-plugin"` to `"acme-my-plugin"`
63+
- `authors`: update name and email
64+
- `description`: update to describe your plugin
65+
- `tool.setuptools.packages.find.include`: change `["placeholder*"]` to `["acme*"]`
66+
- `tool.pytest.ini_options.testpaths`: change `["placeholder", "tests"]` to `["acme", "tests"]`
6467

6568
#### 3. Update .releaserc.yaml
6669

6770
Edit the following fields in `.releaserc.yaml`:
6871

69-
- `message`: Change `mloda-plugin-template` to your package name (e.g., `"chore(release acme-my-plugin): ${nextRelease.version}"`)
70-
- `repositoryUrl`: Change to your repository URL
72+
- `message`: change `mloda-plugin-template` to your package name (e.g., `"chore(release acme-my-plugin): ${nextRelease.version}"`)
73+
- `repositoryUrl`: change to your repository URL
7174

7275
#### 4. Update Python imports
7376

@@ -86,56 +89,33 @@ Update imports in these files (change `from placeholder.` to `from acme.`):
8689
uv venv && source .venv/bin/activate && uv sync --all-extras && tox
8790
```
8891

89-
### Development Setup with uv
92+
#### 6. Remove the template-only contributor guide
9093

91-
**Install uv** (if not already installed):
92-
```bash
93-
curl -LsSf https://astral.sh/uv/install.sh | sh
94-
```
94+
`CONTRIBUTING.md` describes how to contribute to the template repo itself; it does not apply to your plugin. Remove it after `tox` passes:
9595

96-
**Create virtual environment and install dependencies:**
9796
```bash
98-
uv venv
99-
source .venv/bin/activate
100-
uv sync --all-extras
97+
rm CONTRIBUTING.md
10198
```
10299

103-
**Run all checks with tox:**
104-
```bash
105-
# Install tox with uv backend
106-
uv tool install tox --with tox-uv
100+
The remaining baseline files apply to your plugin out of the box and can be edited to match your conventions:
107101

108-
# Run all checks (pytest, ruff, mypy, bandit)
109-
tox
110-
```
111-
112-
### Run individual checks
113-
114-
```bash
115-
# Tests only
116-
pytest
117-
118-
# Format check
119-
ruff format --check --line-length 120 .
120-
121-
# Lint check
122-
ruff check .
123-
124-
# Type check
125-
mypy --strict --ignore-missing-imports .
126-
127-
# Security check
128-
bandit -c pyproject.toml -r -q .
129-
```
102+
- `AGENTS.md` and `CLAUDE.md` — toolchain and project practices for the same `tox`/ruff/mypy/bandit pipeline you inherit. Tune the bullets if you change the toolchain.
103+
- `CODE_OF_CONDUCT.md` — short, plain-English baseline. Update the contact (`conduct@mloda.ai` → your address) if you want enforcement to come to you.
104+
- `.github/ISSUE_TEMPLATE/issue.yml` — unified issue form. Update the placeholder file paths to point at your renamed package.
130105

131-
## Related Documentation
106+
You may also want to replace this `README.md` with one that describes your plugin.
132107

133-
Guides for plugin development can be found in mloda-registry:
108+
### Where to next
134109

135-
- https://github.com/mloda-ai/mloda-registry/tree/main/docs/guides/
110+
- **[mloda-registry/docs/guides/](https://github.com/mloda-ai/mloda-registry/tree/main/docs/guides/)** — full plugin development walkthrough (FeatureGroups, ComputeFrameworks, Extenders, packaging, publishing).
111+
- **[mloda](https://github.com/mloda-ai/mloda)** — core framework reference.
112+
- **[Claude Code skills](https://github.com/mloda-ai/mloda-registry/tree/main/.claude/skills/)** — pattern guidance and best practices for AI-assisted plugin development.
113+
- **[docs/github-workflows.md](docs/github-workflows.md)** — CI/CD setup and required secrets for the included workflows.
136114

137-
Claude Code users can leverage the skills in mloda-registry for assisted plugin development:
115+
## Contribute to this template
138116

139-
- https://github.com/mloda-ai/mloda-registry/tree/main/.claude/skills/
117+
This section is for people improving the scaffold itself (CI workflows, dev tooling, docs, examples). See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contributor guide. Quick pointers:
140118

141-
This template includes pre-configured GitHub Actions workflows for testing, security scanning, and automated releases. See the [GitHub Workflows documentation](docs/github-workflows.md) for setup instructions and required secrets.
119+
- [Code of Conduct](CODE_OF_CONDUCT.md)
120+
- [AGENTS.md](AGENTS.md) — agent guidance, project practices, issue creation
121+
- [Issue template](.github/ISSUE_TEMPLATE/issue.yml)

docs/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ Regardless of which option you chose, follow the setup steps in the [README](../
4949
4. Update `.releaserc.yaml` (change `mloda-plugin-template` to your package name and update `repositoryUrl`)
5050
5. Update Python imports
5151
6. Verify with `tox`
52+
7. Remove `CONTRIBUTING.md` — it describes contributing to the template repo, not your plugin
53+
8. Keep `CODE_OF_CONDUCT.md`, `AGENTS.md`, `CLAUDE.md`, and `.github/ISSUE_TEMPLATE/` as inherited baselines; tune them later (contact email, placeholder paths, toolchain bullets) if you want

0 commit comments

Comments
 (0)