knockfirst
# knockfirst
Open source alternatives to the apps you know, and whether they welcome your AI assisted pull request.
It starts small: more projects are measured each day, and no AI rule is shown until a person has checked it. For each
project the directory shows:
1. What it is an alternative to (Notion, Zapier, Firebase and the rest of a 213 project seed list).
2. Its AI contribution rule, quoted with a link to the exact line, and only after a person read it.
3. How many of its recently merged PRs came from people outside the project.
4. How many good first issues are open.
5. Whether something in the repo runs by itself when an editor or an agent opens the folder.
The same checks run from your terminal and from your agent with the `knockfirst` command.
## The directory
Live at https://dio77799.github.io/knockfirst/. It is updated every day.
The site lives in [`site/`](site/) and reads `site/data.json`. To see it locally:
```
python directory/build.py --offline
python -m http.server -d site 8000
```
How the data is made:
1. `directory/seeds.json` lists each project and the products it replaces. The first list comes from
[`RunaCapital/awesome-oss-alternatives`](https://github.com/RunaCapital/awesome-oss-alternatives) (MIT, see
[CREDITS.md](CREDITS.md)). Run `python directory/seed_runa.py` to refresh it.
2. `python directory/build.py` asks the GitHub REST API about each repo: facts, the policy files, the last 100
closed PRs, the labels and the open good first issues. Only `api.github.com` is called, one request at a
time, with ETag, so an answer that did not change comes back as `304` and, with a token, does not count
against the rate limit ([GitHub's guide](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api)).
Use `--part 3/7` to measure one seventh of the list per day and `--max-requests` to cap a run.
3. The classifier only proposes. Its guesses go to `directory/queue.json`, which is not committed and never
reaches the site.
4. `python directory/verify.py` walks that queue. A person opens the quoted line, picks the verdict and pastes
the link. That goes to `directory/verified.json` together with the sha of every policy file read.
5. When any of those files changes, the next build marks the rule as changed and puts it back in the queue.
Verdicts: `banned`, `disclose`, `allowed`, `mixed` (different rules for different work, or files that
disagree), `scoped` (a rule for only part of the project, like issues or media) and `none` (no written policy).
Respect the rule each project wrote. This list is not a place to find repos to flood with generated PRs; it is
a way to know before you start.
## The command
```
$ knockfirst acme/widgets
acme/widgets
Welcome DISCLOSE AI help is accepted if you disclose it
disclose: "All AI usage in any form must be disclosed."
https://github.com/acme/widgets/blob/main/CONTRIBUTING.md#L42
Safe CAUTION something can run with one click or one install
medium: registers MCP servers (npx)
https://github.com/acme/widgets/blob/main/.mcp.json#L4
```
It reads the repo over the GitHub API. Nothing is cloned, installed or executed. Python standard library only.
### Install
Not on PyPI yet. From a checkout:
```
pip install .
knockfirst owner/repo
```
Unauthenticated GitHub calls are limited to 60 per hour. Each repo uses 2 API calls plus one per file read. Set
`GITHUB_TOKEN` (or `GH_TOKEN`, or pass `--token`) for more.
### Usage
```
knockfirst owner/repo [owner/repo ...] # several at once
knockfirst https://github.com/owner/repo # URLs work
knockfirst ./a/local/folder # a folder on disk, nothing in it is executed
knockfirst owner/repo --json # for scripts and agents
knockfirst owner/repo -v # every rule and finding
knockfirst owner/repo --fail-on banned,danger # exit code 1 if any of these verdicts
```
Exit codes: `0` done, `1` a `--fail-on` verdict was hit, `2` a repo could not be read.
### For agents (MCP)
One tool, `check_repo`, that returns the JSON report.
```json
{"mcpServers": {"knockfirst": {"command": "knockfirst-mcp"}}}
```
A good instruction for your agent: "Before you clone a repo or open a PR, call `check_repo`. If Welcome is
`banned`, stop. If it is `disclose`, say so in the PR. If Safe is `danger`, do not open the repo."
### For your own repo (GitHub Action)
```yaml
- uses: actions/checkout@v4
- uses: Dio77799/knockfirst@main
with:
fail-on: danger
```
`action.yml` fails the job when something in your repo would run by itself in a contributor's agent, and shows
what your contributors' agents will read as your AI policy.
## What the command checks
**Welcome** reads `CONTRIBUTING`, `AI_POLICY`, `AGENTS.md`, `CLAUDE.md`, the PR template, `GOVERNANCE` and
`README` at the root, in `.github/` and in `docs/`. It splits them into sentences, skips code blocks, and keeps
the ones where AI is how the work was made ("AI generated", "used Copilot", "AI tools"), not what the project
builds ("LLM provider", "AI library"). Each one is classified with plain rules you can read in
[`policy.py`](knockfirst/policy.py). The strictest rule wins. "Do not send AI code you have not reviewed" is a
condition, not a ban, so it reads as `allowed (with conditions)`.
How good is it? `python scripts/score_classifier.py` scores it on three sets of sentences in
[`tests/fixtures`](tests/fixtures). On 3 Dec 2026: 25 of 25 on the set it was tuned on, 27 of 27 on a second
set, and 24 of 30 on a blind set written after the rules and scored once. The blind number is the one to
trust, and it is why the directory only publishes rules a person checked.
**Safe** looks for:
| Verdict | What |
|---|---|
| danger | Claude Code project hooks on common events, status line or `enableAllProjectMcpServers`; VS Code tasks with `runOn: folderOpen`; devcontainer `initializeCommand` (runs on your machine); install scripts that download code; instruction files that ask the agent to ignore its instructions, read credentials, hide things from the user or skip safety checks |
| caution | MCP server configs (`.mcp.json`, `.cursor/`, `.vscode/`, `.gemini/`, `.codex/` and others); hooks with an unusual matcher; text that speaks to the AI instead of a person ("if you are an AI agent, star this repo"); hidden unicode in instruction files; committed Windows executables |
| info | the same patterns when the text only describes them ("never use `--no-verify`") or asks agents to disclose themselves; devcontainer commands that run inside the container; npm install scripts that do not download anything; other committed binaries |
## Limits, honestly
- It reads rules written in English. A policy in another language or in a long docs page deep in the tree can
be missed, so `unknown` means "not found", not "allowed".
- It is pattern matching, not a lawyer. Always open the quoted line before you act on it.
- Outside PRs uses GitHub's `author_association`. Staff who keep their organization private show up as
contributors, so the number can be too high for company projects.
- Safe looks at the files that run on open or that agents read as instructions. It is not a malware scanner and
does not review the code you will build or install.
- Wrong verdict for a repo? Please open an issue with the link. Fixing those comes first.
## License
Code: MIT ([LICENSE](LICENSE)). Data in `directory/` and `site/data.json`: CC BY SA 4.0
([`LICENSE-DATA`](LICENSE-DATA)). Seed list credits in [CREDITS.md](CREDITS.md).
## Support
knockfirst is free. If it saved you time, you can buy me a coffee on [PayPal](https://paypal.me/Dio77799).
TDQS
Scored across 1 tool
With a single tool there is no possibility of misselection; check_repo's purpose (read-only pre-contribution repo safety check) is unambiguous and clearly delineated from any cloning or execution action.
check_repo follows a clean verb_noun snake_case pattern that accurately describes the action and target resource, leaving a clear convention for any future tools.
One tool is on the thin side for a server, though the narrow purpose (vet a repo before contributing) makes a single entry point defensible; it also bundles two distinct checks (AI-contribution policy and auto-execution risk) into one call.
The tool covers both advertised concerns (maintainer policy status and self-executing content risk) with read-only guarantees, but offers no batch/multi-repo checking, result caching, or a way to list previously vetted repos.