diff --git a/.github/ISSUE_TEMPLATE/add-a-resource.yml b/.github/ISSUE_TEMPLATE/add-a-resource.yml new file mode 100644 index 0000000..dae05e3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/add-a-resource.yml @@ -0,0 +1,67 @@ +name: Add a resource +description: Suggest a link for the hive coding list +title: "Resource: " +body: + - type: markdown + attributes: + value: | + Add a page you just opened. We do not add links that fail to load, and we do not add counts or claims that are not on the page. + + Read [CONTRIBUTING.md](https://github.com/thehivecode-ai/hive-coding/blob/main/CONTRIBUTING.md) before you submit. + - type: input + id: title + attributes: + label: Title + description: The page's own title. + validations: + required: true + - type: input + id: url + attributes: + label: URL + placeholder: https:// + validations: + required: true + - type: dropdown + id: kind + attributes: + label: What it is + options: + - Article + - Talk + - Tool + - Docs + - Project + validations: + required: true + - type: dropdown + id: section + attributes: + label: Section of the README + options: + - Where the term comes from + - Agents that can prepare a change + - Review and merge safety + - Community-driven development + - Definitions + - Somewhere else + validations: + required: true + - type: textarea + id: why + attributes: + label: Why it belongs + description: Two or three sentences from the page itself. No slogan, and no numbers you did not read there. + validations: + required: true + - type: checkboxes + id: checks + attributes: + label: Checks + options: + - label: I opened this URL and it loaded. + required: true + - label: This is not already in the README. + required: true + - label: I am not asking you to add a star count, a user count, or a claim the page does not make. + required: true diff --git a/.github/ISSUE_TEMPLATE/cli-bug.yml b/.github/ISSUE_TEMPLATE/cli-bug.yml new file mode 100644 index 0000000..47aace1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/cli-bug.yml @@ -0,0 +1,40 @@ +name: CLI bug +description: Something wrong with thehivecode init or check +title: "CLI: " +body: + - type: input + id: version + attributes: + label: Version + description: Output of `thehivecode --version`, or the git commit if you ran it from a checkout. + placeholder: 0.1.0 + validations: + required: true + - type: input + id: node + attributes: + label: Node.js version + placeholder: v18.20.0 + validations: + required: true + - type: textarea + id: command + attributes: + label: Command + description: The exact command. Do not include secrets. + render: bash + validations: + required: true + - type: textarea + id: expected + attributes: + label: What you expected + validations: + required: true + - type: textarea + id: actual + attributes: + label: What happened + description: Paste the output. Remove anything private from a HIVE.md before you paste it. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c69031e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Learn hive coding + url: https://thehivecode.ai/learn?ref=github + about: Definitions and guides live on The Hive Code. This repo quotes them. diff --git a/.github/render-social-preview.py b/.github/render-social-preview.py new file mode 100644 index 0000000..ebcc744 --- /dev/null +++ b/.github/render-social-preview.py @@ -0,0 +1,89 @@ +"""Render .github/social-preview.png at 1280x640 in the Hive Code colors. + +Colors: pollen #FFC629, ultraviolet ink #1F0A4D, violet #7B3BFF. +Requires Pillow and the Inter / JetBrains Mono fonts installed on the machine. +""" + +import math +from pathlib import Path + +from PIL import Image, ImageDraw, ImageFont + +INK = (31, 10, 77) +POLLEN = (255, 198, 41) +VIOLET = (123, 59, 255) +WHITE = (255, 255, 255) +MUTED = (214, 204, 240) +GRID = (58, 32, 122) + +WIDTH, HEIGHT = 1280, 640 +OUT = Path(__file__).with_name("social-preview.png") +INTER = "/usr/share/fonts/truetype/macos/Inter-Regular.ttf" +INTER_BOLD = "/usr/share/fonts/truetype/macos/Inter-Bold.ttf" +MONO = "/usr/share/fonts/truetype/jetbrains-mono/JetBrainsMono-Medium.ttf" + + +def font(path, size): + return ImageFont.truetype(path, size) + + +def hexagon(draw, cx, cy, radius, fill=None, outline=None, width=2): + points = [] + for i in range(6): + angle = math.radians(60 * i - 30) + points.append((cx + radius * math.cos(angle), cy + radius * math.sin(angle))) + draw.polygon(points, fill=fill, outline=outline) + if outline and width > 1: + draw.line(points + [points[0]], fill=outline, width=width) + + +def main(): + image = Image.new("RGB", (WIDTH, HEIGHT), INK) + draw = ImageDraw.Draw(image) + + # A small cluster, fully inside the frame, clear of the type on the left. + marks = [ + (980, 168, 34, None, GRID, 3), + (1088, 196, 86, POLLEN, None, 0), + (1200, 292, 58, VIOLET, None, 0), + (968, 360, 52, None, POLLEN, 4), + (1116, 430, 70, None, VIOLET, 4), + (1004, 500, 28, POLLEN, None, 0), + ] + for cx, cy, radius, fill, outline, width in marks: + hexagon(draw, cx, cy, radius, fill=fill, outline=outline, width=width) + + draw.rectangle((0, 0, WIDTH, 12), fill=POLLEN) + draw.rectangle((0, HEIGHT - 10, WIDTH, HEIGHT), fill=VIOLET) + + eyebrow = font(MONO, 22) + title = font(INTER_BOLD, 92) + body = font(INTER, 32) + small = font(MONO, 20) + label = font(MONO, 18) + + draw.text((72, 78), "THE HIVE CODE", font=eyebrow, fill=POLLEN) + draw.text((68, 124), "hive coding", font=title, fill=WHITE) + draw.text((72, 250), "Software built by communities", font=body, fill=MUTED) + draw.text((72, 296), "and shipped by agents.", font=body, fill=MUTED) + + draw.rectangle((72, 368, 196, 374), fill=POLLEN) + + steps = [ + ("COMMUNITY", "decides"), + ("AGENTS", "build"), + ("A HUMAN", "approves"), + ] + x = 72 + for head, tail in steps: + draw.text((x, 404), head, font=label, fill=POLLEN) + draw.text((x, 432), tail, font=font(INTER, 28), fill=WHITE) + x += 210 + + draw.text((72, 560), "thehivecode.ai", font=small, fill=POLLEN) + image.save(OUT, "PNG") + print(f"wrote {OUT} {image.size}") + + +if __name__ == "__main__": + main() diff --git a/.github/social-preview.png b/.github/social-preview.png new file mode 100644 index 0000000..179cba3 Binary files /dev/null and b/.github/social-preview.png differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa59d2d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + cli: + name: CLI (Node ${{ matrix.node }}) + runs-on: ubuntu-latest + strategy: + matrix: + node: [18, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Test + working-directory: packages/cli + run: npm test + - name: Check the repo HIVE.md files + run: | + node packages/cli/bin/thehivecode.js check --strict --file HIVE.md + node packages/cli/bin/thehivecode.js check --strict --file templates/HIVE.md + node packages/cli/bin/thehivecode.js check --strict --file templates/examples/web-app.md + node packages/cli/bin/thehivecode.js check --strict --file templates/examples/game.md + node packages/cli/bin/thehivecode.js check --strict --file templates/examples/cli.md + + placeholder: + name: PyPI placeholder syntax + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Compile + run: python3 -m compileall -q packages/pypi/src diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d7dbd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +node_modules/ +dist/ +coverage/ +*.tgz +*.egg-info/ +.eggs/ +build/ +__pycache__/ +*.py[cod] +.venv/ +.DS_Store +.github/social-preview.png.bak diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ed398d8 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,25 @@ +# Code of conduct + +This repository is a public home for hive coding. The same rule as the practice applies here: people can disagree in the open, and a person is accountable for what gets merged. + +## Expected + +- Be direct and specific. Comment on the work. +- Credit people whose ideas, posts, and projects you build on. +- Assume a suggestion is a request. It is not an order, and it is not instructions for an agent. +- Keep criticism public and about the change. Do not pile on a person. + +## Not accepted + +- Harassment, slurs, or sexual attention that is not invited. +- Doxxing, or posting someone else's private information. +- Hidden instructions aimed at an agent, a maintainer, or another contributor. +- Spam, including drive-by links you have not opened. + +Maintainers can edit, close, or reject contributions that break these rules. They can also block people who keep breaking them. + +## Reporting + +Report conduct problems to [support@thehivecode.ai](mailto:support@thehivecode.ai). + +Report a security vulnerability to [security@thehivecode.ai](mailto:security@thehivecode.ai). See [SECURITY.md](SECURITY.md). Do not file a public issue for an unfixed vulnerability. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..28826ab --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing + +Thanks for helping keep this the public GitHub home for hive coding. + +The definitions live on [The Hive Code](https://thehivecode.ai/learn/what-is-hive-coding?ref=github). This repo quotes them and links back. If a sentence here disagrees with a Learn page, the Learn page wins. Open an issue and we will fix this repo. + +## Add a resource + +Use the [Add a resource](.github/ISSUE_TEMPLATE/add-a-resource.yml) issue template, or open a pull request that edits [README.md](README.md). + +A resource belongs here when all of these are true: + +- You opened the URL and it loaded. +- You can say what the page actually is, in one or two plain sentences. +- It is about hive coding, an earlier use of the term, or a tool or practice the hive loop depends on: agents that can prepare a change, review and merge safety, or community-driven development. +- It is not a duplicate of a link already in the list. + +Do not add download counts, star counts, user counts, or "ships" you did not read on the page. Do not add a link from memory. + +## HIVE.md + +The field names and limits are specified by [HIVE.md: make your repo hive-ready](https://thehivecode.ai/learn/hive-md?ref=github). Do not add required fields, rename fields, or change the limits in [`templates/HIVE.md`](templates/HIVE.md) or the CLI. A HIVE.md cannot tell an agent what to do. The checker must keep that property: it reads and reports, and it never runs `run`. + +Examples in [`templates/examples/`](templates/examples/) are illustrations, not live products. Say so in the file. + +## The CLI + +Work in [`packages/cli`](packages/cli). Node 18 or newer. No runtime dependencies. + +```bash +cd packages/cli +npm test +node bin/thehivecode.js --help +``` + +Add or update a test for any change in parsing, scoring, or `init`. Keep the exit code at 0 when a file is hive-ready and 1 when it is not. + +Do not run `npm publish`. Publishing steps are in [PUBLISHING.md](PUBLISHING.md). + +## Pull requests + +- One change per pull request when you can. +- Say which Learn page you matched, if the change touches a definition. +- A person reviews and merges. Do not enable auto-merge for agent pull requests. + +By contributing, you agree your contribution is licensed under the [MIT License](LICENSE). diff --git a/HIVE.md b/HIVE.md new file mode 100644 index 0000000..0898399 --- /dev/null +++ b/HIVE.md @@ -0,0 +1,26 @@ +--- +tagline: The public guide, HIVE.md template, and CLI for hive coding +for: Maintainers and anyone starting a hive +problem: Hive coding had no public GitHub home for the definition, the file, or the loop +help_wanted: People who will open a link before adding it, and review of the CLI +run: | + node packages/cli/bin/thehivecode.js check +--- + +# hive coding + +The public GitHub home for hive coding, from [The Hive Code](https://thehivecode.ai/?ref=github). + +What it does today: + +- States what hive coding is, in the same words as the Learn pages, and points at them +- Ships a HIVE.md template, three examples, and a CLI that writes and checks the file + +What is next: + +- Publish the `thehivecode` command to npm once the name is claimed by this project +- Grow the resource list with links someone has actually opened + +How to help: + +- Read [CONTRIBUTING.md](CONTRIBUTING.md). Add a resource only after you have opened the page. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c61b28 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 The Hive Code + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PUBLISHING.md b/PUBLISHING.md new file mode 100644 index 0000000..e2d76a5 --- /dev/null +++ b/PUBLISHING.md @@ -0,0 +1,107 @@ +# Publishing `thehivecode` + +The command people should be able to run is `npx thehivecode`. The package is in [`packages/cli`](packages/cli). A separate placeholder in [`packages/pypi`](packages/pypi) exists so the same name can be registered on PyPI. Neither package has been published. Do not publish from a fork, and do not publish until you intend to own the name. + +Checked on 22 October 2026: + +- `https://registry.npmjs.org/thehivecode` returned 404. +- `https://pypi.org/pypi/thehivecode/json` returned 404. + +Check again before you publish. Someone else can claim either name in between. On PyPI, yanking a release does not free the name. On npm, unpublishing is time-limited and a name you have published can stay reserved. Treat both uploads as permanent. + +The copyright line in [LICENSE](LICENSE) says "The Hive Code". Confirm that is the legal name you want on a public package before the first upload. + +## npm + +You need an npm account that is allowed to create the unscoped package `thehivecode`, and Node.js 18 or newer. The package is intentionally unscoped so that `npx thehivecode` works. A scoped name such as `@thehivecode/cli` would not. + +From a checkout of this repository, on the commit you want to publish: + +```bash +cd packages/cli +npm whoami +npm test +npm publish --dry-run +npm publish +``` + +`npm publish --dry-run` prints the file list and does not upload. The tarball should contain `bin/`, `src/`, `package.json`, `README.md`, and `LICENSE`. It should not contain `test/`. + +The version that uploads is the `version` field in [`packages/cli/package.json`](packages/cli/package.json). This repo starts at `0.1.0`. To ship a later change, bump that version, then publish again. npm will not let you overwrite a version that already exists. + +After it succeeds: + +```bash +npm view thehivecode version +npx --yes thehivecode@0.1.0 --version +``` + +`npx thehivecode init` writes a file in the current directory. Run that check in an empty folder, not in this repo, unless you pass `--file` to a throwaway path. + +### If npm asks you to log in or for a second factor + +```bash +npm login +npm whoami +``` + +Then run `npm publish` again. If the account has two-factor authentication required for writes, approve the prompt. Do not put a token in this repo or in the command history of a shared machine. For CI, prefer an [npm granular access token](https://docs.npmjs.com/creating-and-viewing-access-tokens) stored as a secret, or a trusted publisher, over a token pasted into a shell. + +### Provenance, optional + +To attach a provenance statement from GitHub Actions, publish from a workflow on `github.com/thehivecode-ai/hive-coding` with npm's trusted publishing, or with: + +```bash +npm publish --provenance +``` + +That flag only works in the CI environments npm supports. A laptop publish without `--provenance` is still a normal publish. Do this after the first manual publish has succeeded and you have confirmed the package page looks right. + +## PyPI + +The Python package is a placeholder. Installing it does not give you the CLI. It prints a pointer to this repo and to the HIVE.md guide, so the name `thehivecode` is not sitting there empty of context. The CLI remains the npm package. + +You need a [PyPI account](https://pypi.org/account/register/) and an API token. + +The first upload of a new project cannot use a project-scoped token, because the project does not exist yet. Create an account-scoped token at [pypi.org/manage/account](https://pypi.org/manage/account/). After the project exists, create a project-scoped token and revoke the wider one if you do not need it. + +Build and check from this repo: + +```bash +cd packages/pypi +python3 -m venv .venv +source .venv/bin/activate +python -m pip install --upgrade build twine +python -m build +twine check dist/* +``` + +`twine check` should report that the long description renders. Then upload to TestPyPI if you want a dress rehearsal. TestPyPI is a different account and a different token from PyPI. + +```bash +twine upload --repository testpypi dist/* +``` + +When the TestPyPI page looks right, upload to PyPI: + +```bash +twine upload dist/* +``` + +`twine` asks for a username and password. The username is `__token__`. The password is the token, including the `pypi-` prefix. You can also set `TWINE_USERNAME` and `TWINE_PASSWORD` in the environment for that one shell. Do not commit them. + +Confirm: + +```bash +pip install --index-url https://pypi.org/simple thehivecode +thehivecode +python -m thehivecode +``` + +You should see a short note that this PyPI package is a name placeholder and that the CLI is the Node package. + +The Python version in [`packages/pypi/pyproject.toml`](packages/pypi/pyproject.toml) is `0.0.1` on purpose. It is not meant to track the npm version. If you ever ship a real Python CLI, bump it and replace this placeholder in a separate change. You cannot reuse `0.0.1` once it has been uploaded. + +## After both names are yours + +Update the [README](README.md) so the install instructions lead with `npx thehivecode init`, and keep the checkout command for people who want to hack on the CLI. Say the date you published. Do not announce download numbers you do not have. diff --git a/README.md b/README.md index f360d32..942c323 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,242 @@ -# hive-coding -Hive coding: the open guide, HIVE.md template, and CLI from The Hive Code (thehivecode.ai) +![hive coding. Software built by communities and shipped by agents.](.github/social-preview.png) + +# Awesome Hive Coding + +The public GitHub home for **hive coding**, maintained by [The Hive Code](https://thehivecode.ai/?ref=github). + +> Hive coding is software built by communities and shipped by agents. + +People suggest and vote on changes in public. An AI coding agent writes the code. A human reviews and merges it, so it ships with credit to the person who asked. In short: the community decides, agents build, humans approve. + +The full definition, history, and FAQ are in [What is hive coding?](https://thehivecode.ai/learn/what-is-hive-coding?ref=github). This page is the linkable summary, plus the [HIVE.md](templates/HIVE.md) template and the [`thehivecode`](packages/cli) CLI. + +Hive coding is also written **hivecoding** and **hive-coding**. "We hive-coded the booking page." Someone who takes part is a **hive coder**. On The Hive Code, members are **hivers**. + +It is not [Apache Hive](https://hive.apache.org/), the Hive blockchain, or Hive AI. + +## Contents + +- [What it is](#what-it-is) +- [How it differs](#how-it-differs) +- [The hive loop](#the-hive-loop) +- [Make a repo hive-ready](#make-a-repo-hive-ready) +- [Where the term comes from](#where-the-term-comes-from) +- [Resources](#resources) +- [Contributing](#contributing) + +## What it is + +Three roles, from [What is hive coding?](https://thehivecode.ai/learn/what-is-hive-coding?ref=github): + +| Role | Who | What they do | What they never do | +| --- | --- | --- | --- | +| The hive | Users, fans, idea people, anyone who cares | Suggest changes, vote, discuss, test what ships | Push code straight to the product | +| The agent | An AI coding agent | Turn an approved request into a pull request | Decide what to build, or merge its own work | +| The human | A maintainer or lead builder | Approve requests, review the agent's work, merge it | Hand the merge button to the crowd or the bot | + +The hive brings direction, the agent brings speed, the human brings judgment. Remove the hive and you have plain agentic coding. Remove the agent and you have a feedback board. Remove the human and you have a security incident waiting to happen. + +Words such as hiver, Honey, momentum, Shipped mark, and loop board are defined in the [hive coding glossary](https://thehivecode.ai/learn/hive-coding-glossary?ref=github). Honey, ranks, the loop board, and bounty builds are planned on The Hive Code, not live yet. The glossary marks which is which. + +## How it differs + +From [What is hive coding?](https://thehivecode.ai/learn/what-is-hive-coding?ref=github) and [Hive coding vs vibe coding](https://thehivecode.ai/learn/hive-coding-vs-vibe-coding?ref=github): + +| | Who decides what to build | Who writes the code | Who approves it | Typical scale | +| --- | --- | --- | --- | --- | +| Vibe coding | One person | An AI model | Often nobody | One person, one app | +| Agentic coding | An engineer or a team | AI agents | The engineer | A team | +| Swarm coding | One person | Many AI agents in parallel | That person | One person, many agents | +| Open source | Maintainers and contributors who code | Human contributors | Maintainers | Anyone who can code | +| Crowdsourcing | A crowd, ideas only | Whoever the company hires | The company | Large crowds, closed build | +| Hive coding | The community, by public vote | AI agents | A human maintainer | Anyone who can type a sentence | + +**Vibe coding** is one person prompting an AI and often accepting the result without reading it. Andrej Karpathy coined it on 2 February 2025. Simon Willison's useful narrowing: building with an LLM without reviewing the code it writes. Vibe coding answers "can I build this?" Hive coding answers "what should we build next, and who gets credit?" Most hive coding projects start as something one person vibe coded. They are not rivals. The longer comparison is [Hive coding vs vibe coding](https://thehivecode.ai/learn/hive-coding-vs-vibe-coding?ref=github). + +**Swarm coding** is one person running many AI agents in parallel. Hive coding flips the ratio: many people and many AIs. A crowd prompting agents with no review is not hive coding. + +**HiVE coding**, as DevSwarm uses it, means High Velocity Engineering: a team practice for shipping fast with AI, with the engineer in control. That is closer to agentic engineering than to the community meaning on this page. [The Hive Code](https://thehivecode.ai/?ref=github) uses the community meaning. + +**Agentic engineering** is Karpathy's name for a skilled person orchestrating agents and acting as oversight. Hive coding uses those habits on the maintainer's side. What it adds is the hive: a public, voting community that chooses the work and gets credit for it. + +**Community coding** usually means people building software together: open source, a club, a hack day. In open source the people who take part are, in practice, people who write code. Hive coding is a community of anyone. Agents do the typing. A human still holds the merge button. Open source is the ancestor, not the same practice. The catch with classic open source was that most users could only file an issue and hope. See [The Cathedral and the Bazaar](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar) and [Building community](https://opensource.guide/building-community/) from the Open Source Guides. + +**Pair programming** is two people on one task at the same time, one typing and one reviewing, as [Birgitta Böckeler and Nina Siessegger describe it](https://martinfowler.com/articles/on-pair-programming.html). Hive coding is not a pairing session. The community chooses the work asynchronously, an agent writes the change, and a maintainer reviews it before merge. A maintainer can still pair with someone on that review. + +**Crowdsourcing** generates ideas at scale. Someone still has to build them. Jeff Howe named it in Wired in June 2006. Hive coding is what that looks like once an agent can draft the change and a human still decides what ships. + +## The hive loop + +Hive coding runs on a five-step loop. The walkthrough, including what fails at each step, is [How the hive coding loop works](https://thehivecode.ai/learn/hive-coding-loop?ref=github). + +| Step | Who acts | What comes out | +| --- | --- | --- | +| 1. Suggest | Anyone in the hive | A public suggestion, a problem and a result | +| 2. Vote | The hive | A ranked queue. Votes inform the maintainer. They do not bind them. | +| 3. Agent builds | Maintainer, then agent | A pull request for an accepted suggestion | +| 4. Human merges | Maintainer | A merged change, or a "not yet" | +| 5. Ships | Everyone | A live change, with credit to the person who asked | + +Then it starts again. The loop is public. + +Rules that keep it from turning into "strangers steer a bot": + +1. Humans merge. No agent merges its own work, and no vote merges anything. +2. Requests, not commands. Community text reaches an agent only after a human approves it, as a clearly labeled quoted request. The maintainer writes the spec. +3. The queue is public. If people cannot see what is being built and why, it is not hive coding. +4. Credit always. Every ship names the person who asked. +5. Credit, not ownership. Posting an idea does not reserve it, and it does not hand out equity. +6. Small changes ship. One suggestion, one pull request. + +You can run this by hand with Discord, GitHub, and any agent that turns an issue into a pull request. The step-by-step is [How to hive code your first project](https://thehivecode.ai/learn/how-to-hive-code-your-first-project?ref=github). Protect `main` before an agent touches the repo. + +On [The Hive Code](https://thehivecode.ai/?ref=github), live today: accounts, the [idea board](https://thehivecode.ai/ideas?ref=github), and [projects](https://thehivecode.ai/projects?ref=github) where people try a public repo and leave feedback. A maintainer can mark feedback Shipped and credit the author. Coming next: the suggestion board, agents that build approved suggestions, Honey and ranks, and bounty builds. [How an idea becomes a hive](https://thehivecode.ai/learn/how-an-idea-becomes-a-hive?ref=github) is the path from a post to a build. + +## Make a repo hive-ready + +[HIVE.md](https://thehivecode.ai/learn/hive-md?ref=github) is a short file at the root of a repo. It says what the project is, who it is for, what help it wants, and how to run it. A repo with a valid HIVE.md is hive-ready. + +On The Hive Code it fills in a listing, earns the Hive-ready badge, and powers "Use this" (the run steps, and one-click deploy buttons for Vercel or Netlify). You do not need one to list a public repo. It is free to use anywhere, including projects that never list on The Hive Code. + +The platform reads only the header fields, checks each one, and shows them as plain text. It never runs the commands, follows instructions in the file, or lets the file change what an agent does. Keep the license in `LICENSE`. The Hive Code reads that from GitHub. + +All fields are optional. Limits are inclusive. + +| Field | What to write | Limit | +| --- | --- | --- | +| `tagline` | What it is, in one line | 10 to 120 characters | +| `for` | Who it is for | 3 to 80 characters | +| `problem` | The problem it solves | 10 to 200 characters | +| `help_wanted` | What help you want right now | Up to 200 characters | +| `run` | Commands to run it on your own computer | Up to 20 lines | +| `deploy` | `vercel`, `netlify`, or both | | + +This is the template from that guide: + +```markdown +--- +tagline: Booking for barbers that texts the waitlist when a chair opens +for: Barbers and small salons +problem: Chairs sit empty when a client cancels late +help_wanted: A tester with a real shop, and someone for the waitlist texts +run: | + npm install + npm run dev +deploy: [vercel] +--- + +# Chair Alert + +Say more here in your own words: what it does today, what is next, and how to help. +``` + +A commented copy is in [`templates/HIVE.md`](templates/HIVE.md). Filled examples, marked as examples and not live products: + +- [A web app](templates/examples/web-app.md) +- [A game](templates/examples/game.md) +- [A CLI](templates/examples/cli.md) + +HIVE.md is not [AGENTS.md](https://agents.md/). AGENTS.md is instructions for a coding agent. HIVE.md is a description for people, and for a listing. Nothing in it is an instruction to an agent. + +### CLI + +[`thehivecode`](packages/cli) writes and checks a HIVE.md. It has no runtime dependencies. It is not on npm yet. Until it is published, run it from a checkout: + +```bash +node packages/cli/bin/thehivecode.js init +node packages/cli/bin/thehivecode.js check +``` + +After publish, the same commands are `npx thehivecode init` and `npx thehivecode check`. The publish steps are in [PUBLISHING.md](PUBLISHING.md). Do not publish from a fork. + +`init` asks a few questions and writes `HIVE.md`. Defaults come from the folder name and, when it is useful, `package.json`. `--yes` accepts the defaults and will not replace an existing file unless you also pass `--force`. + +`check` lints the header against the limits above and prints a hive-ready score from 0 to 100. The file is hive-ready when it parses and every field you set is within the limits. The score is how many of the recommended fields are filled in. `deploy` is optional and is not part of the score. The command never runs `run`. + +```bash +node packages/cli/bin/thehivecode.js check --json +node packages/cli/bin/thehivecode.js --help +``` + +## Where the term comes from + +Nobody owns the term. [The Hive Code](https://thehivecode.ai/?ref=github) did not invent it. This is the timeline from [What is hive coding?](https://thehivecode.ai/learn/what-is-hive-coding?ref=github), with the pages those credits point at. + +- **September 2025.** [Mike Biglan at DevSwarm](https://devswarm.ai/blog/high-velocity-engineering-hive-coding-vs-vibe-coding/) published "HiVE Over Vibe" on 19 September 2025. HiVE coding there means High Velocity Engineering, a production discipline for engineers running parallel AI assistants. It is about speed and quality inside a team, not crowd-directed building. +- **April 2026.** [Owen Barnes's hackathon project](https://github.com/owenb/hivecode) describes itself as "You've heard of vibe coding.... this is hive coding. Co-create socially." It was a shared canvas where people and an AI design pages together. His team won first prize and the Google DeepMind prize at a Tech:Europe hackathon. He records that on [his ventures page](https://www.owenbarnes.com/ventures). +- **10 October 2026.** [Max Blade](https://x.com/_MaxBlade/status/2108964638255690238) posted that hivecoding, for him, was livestream chat directing a team of AI agents on his game, Kong Royale. [The Open Letter covered the post](https://theopenletter.io/p/hivecoding-max-blade). The game's site is [kongroyale.com](https://kongroyale.com/). +- **12 October 2026.** [Wavect's glossary](https://wavect.io/glossary/hivecoding/) defined hivecoding as an informal approach where a community suggests features, AI agents prepare code changes, and developers decide what ships. + +Owen Barnes used the phrase for social co-creation first that we can find, and Max Blade made hivecoding a thing people talk about. The shared core is: a crowd directs, agents build. The Hive Code's role is a home where any project, not one stream or one game, can run the loop in public. + +## Resources + +Every link below was opened while this page was written. Descriptions say what the page is. They do not add counts. + +### Definitions + +- [What is hive coding?](https://thehivecode.ai/learn/what-is-hive-coding?ref=github) — definition, the three roles, history, and FAQ. +- [Hive coding vs vibe coding](https://thehivecode.ai/learn/hive-coding-vs-vibe-coding?ref=github) — side-by-side comparison, and when each one fits. +- [How the hive coding loop works](https://thehivecode.ai/learn/hive-coding-loop?ref=github) — suggest, vote, agent builds, human merges, ships. +- [How an idea becomes a hive](https://thehivecode.ai/learn/how-an-idea-becomes-a-hive?ref=github) — backers, momentum, and a lead builder. +- [How to hive code your first project](https://thehivecode.ai/learn/how-to-hive-code-your-first-project?ref=github) — the manual loop with Discord, GitHub, and a coding agent. +- [Hive coding glossary](https://thehivecode.ai/learn/hive-coding-glossary?ref=github) — plain-English definitions, with planned features marked. +- [HIVE.md](https://thehivecode.ai/learn/hive-md?ref=github) — the file format and the template. +- [llms.txt](https://thehivecode.ai/llms.txt?ref=github) — a short machine-readable summary of the same facts. + +### Earlier uses and neighboring terms + +- [Andrej Karpathy's vibe coding post](https://x.com/karpathy/status/1886192184808149383) — 2 February 2025. The post that named vibe coding. +- [Collins on vibe coding as its 2025 Word of the Year](https://blog.collinsdictionary.com/language-lovers/collins-word-of-the-year-2025-ai-meets-authenticity-as-society-shifts/) — the dictionary's own note. [The Guardian reported the choice](https://www.theguardian.com/technology/2025/nov/06/vibe-coding-collins-dictionary-word-of-the-year-2025). +- [Simon Willison: not all AI-assisted programming is vibe coding](https://simonwillison.net/2025/Mar/19/vibe-coding/) — vibe coding means not reviewing the code the model writes. +- [India Today on agentic engineering](https://www.indiatoday.in/technology/news/story/vibe-coding-era-over-ai-guru-who-coined-the-term-says-time-has-come-for-agentic-engineering-now-2863387-2026-02-05) — Karpathy's February 2026 name for orchestrating agents, with a person as oversight. +- [HiVE Over Vibe](https://devswarm.ai/blog/high-velocity-engineering-hive-coding-vs-vibe-coding/) — DevSwarm, 19 September 2025. The other meaning of the word. +- [owenb/hivecode](https://github.com/owenb/hivecode) — Owen Barnes, April 2026, social co-creation with an AI on a shared canvas. +- [Max Blade's 10 October 2026 post](https://x.com/_MaxBlade/status/2108964638255690238) — livestream chat directing agents. [The Open Letter's write-up](https://theopenletter.io/p/hivecoding-max-blade). +- [Wavect: What is Hivecoding?](https://wavect.io/glossary/hivecoding/) — a glossary entry from 12 October 2026, in the community-led sense. + +### Agents that can prepare a change + +The loop does not depend on one product. Any agent that can take an approved request and return a diff fits. A human still merges. These are the ones whose own docs match a step in that loop: + +- [Claude Code](https://code.claude.com/docs/en/overview) and the [Claude Code GitHub Action](https://code.claude.com/docs/en/github-actions) — the docs describe turning issues into pull requests. The action's repository is [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action). +- [Starting a GitHub Copilot cloud agent session](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent/start-copilot-sessions) — sessions can start from an issue. Some entry points open a pull request; a person reviews it. Background: [Copilot on GitHub.com](https://docs.github.com/en/copilot/concepts/copilot-surfaces/copilot-on-github). +- [Cursor cloud agents](https://cursor.com/docs/cloud-agent) — Cursor's docs: run an agent in the cloud for coding assistance. +- [OpenAI Codex](https://github.com/openai/codex) — a coding agent that runs in the terminal. The maintainer still reviews what it changes. +- [Aider](https://aider.chat/) — AI pair programming in the terminal. One person stays in the loop. Repository: [Aider-AI/aider](https://github.com/Aider-AI/aider). +- [goose](https://goose-docs.ai/) — an open-source, extensible AI agent that can install, edit, execute, and test. Repository: [aaif-goose/goose](https://github.com/aaif-goose/goose). The older docs host redirects here. +- [AGENTS.md](https://agents.md/) — a plain-Markdown convention for instructions to coding agents. Useful next to a HIVE.md, and a different file. Do not put agent instructions in HIVE.md. + +DevSwarm's desktop app runs parallel, branch-isolated assistants for the HiVE meaning above. It is listed with that essay, not as a hive coding tool. + +### Review and merge safety + +- [About protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) — require a pull request and a review before `main` moves. +- [Veracode on security risks in AI-generated code](https://www.veracode.com/blog/ai-generated-code-security-risks/) — why a human merge is a step, not a courtesy. The Learn pages cite their 2025 study. +- [Linux kernel: submitting patches](https://docs.kernel.org/process/submitting-patches.html) — `Suggested-by:` credits the person who asked. [AI coding assistants](https://docs.kernel.org/process/coding-assistants.html) — humans sign off, and AI help is credited with `Assisted-by:`. +- [OWASP Top 10](https://owasp.org/projects/top-ten) — the usual web risks to look for in a review. +- [OWASP: prompt injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) — hiding instructions inside text a model will read. Hive coding treats community text as a quoted request a human has approved. +- [About secret scanning](https://docs.github.com/en/code-security/concepts/secret-security/secret-scanning) — agents should not have production keys, and secrets should not land in the repo. + +### Community-driven development + +- [Open Source Guides](https://opensource.guide/) — how to run a public project. [Building community](https://opensource.guide/building-community/) is the closest chapter. +- [The Cathedral and the Bazaar](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar) — Eric S. Raymond on development in public. Hive coding keeps the public part and adds agents plus a human merge. +- [The Rise of Crowdsourcing](https://www.wired.com/2006/06/crowds/) — Jeff Howe, Wired, June 2006. +- [On pair programming](https://martinfowler.com/articles/on-pair-programming.html) — Birgitta Böckeler and Nina Siessegger. The practice people sometimes confuse with a hive. +- [GitHub Discussions quickstart](https://docs.github.com/en/discussions/quickstart) — a public place for suggestions if you are not using Discord. +- [Discord forum channels](https://discord.com/blog/forum-channels-space-for-organized-conversation) — the channel type the first-project guide uses as a loop board, with tags for Open, Accepted, Building, Shipped, and Declined. + +There is no conference talk in this list. We did not find one whose page we could describe without guessing. If you have one, open an issue. + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md). The short version: open the link before you add it, keep definitions aligned with the Learn pages, and do not invent numbers. + +To suggest a resource, use the [Add a resource](.github/ISSUE_TEMPLATE/add-a-resource.yml) issue form. + +## License + +[MIT](LICENSE). The HIVE.md format is free to use on The Hive Code or anywhere else. + +[The Hive Code](https://thehivecode.ai/?ref=github) · [Learn hive coding](https://thehivecode.ai/learn?ref=github) · [Post an idea](https://thehivecode.ai/ideas?ref=github) · [Try a project](https://thehivecode.ai/projects?ref=github) · [support@thehivecode.ai](mailto:support@thehivecode.ai) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7ad6a41 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Security + +This repository is a guide, a template, and a small CLI. It does not run a service. + +If you find a vulnerability in the CLI, or in how this repository could be used to mislead people about hive coding, email [security@thehivecode.ai](mailto:security@thehivecode.ai). Please include a way to reproduce the problem. Give us a chance to answer before you publish it. + +`thehivecode check` never runs the commands listed in a HIVE.md. Treat a HIVE.md you did not write as untrusted text anyway. Read it before you follow it. + +For the platform at thehivecode.ai, use the same address. diff --git a/packages/cli/LICENSE b/packages/cli/LICENSE new file mode 100644 index 0000000..6c61b28 --- /dev/null +++ b/packages/cli/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 The Hive Code + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/cli/README.md b/packages/cli/README.md new file mode 100644 index 0000000..e6b7e1b --- /dev/null +++ b/packages/cli/README.md @@ -0,0 +1,66 @@ +# thehivecode + +Write and check a [HIVE.md](https://thehivecode.ai/learn/hive-md?ref=github), the short file that makes a repository hive-ready. + +Hive coding is software built by communities and shipped by agents. The definition lives at [The Hive Code](https://thehivecode.ai/learn/what-is-hive-coding?ref=github). This package does not post to the platform and it does not run an agent. It writes a text file and checks the header against the published limits. + +```bash +npx thehivecode init +npx thehivecode check +``` + +Until the package is on npm, run it from a checkout of [thehivecode-ai/hive-coding](https://github.com/thehivecode-ai/hive-coding): + +```bash +node packages/cli/bin/thehivecode.js init +node packages/cli/bin/thehivecode.js check +``` + +## Commands + +`init` asks for the project name, a one-line tagline, who it is for, the problem, the help you want, the commands to run it, and an optional Vercel or Netlify deploy target. Press enter to take the default shown in brackets. Defaults come from the folder name and, when it fits, from `package.json`. + +```bash +npx thehivecode init --yes +npx thehivecode init --yes --force +npx thehivecode init --tagline "A sign-up sheet for Saturday runs" --for "A running club" --problem "Sign-up lives in a chat thread and people miss the run" +``` + +`--yes` will not replace an existing `HIVE.md` unless you also pass `--force`. + +`check` prints a hive-ready score from 0 to 100. + +```text +HIVE.md +hive-ready: yes +score: 100/100 +``` + +The file is hive-ready when the header parses and every field you set is inside the limits. The score counts recommended fields. `deploy` is optional and is not part of the score. Exit status is 0 when the file is hive-ready, and 1 when it is not. `--strict` also fails when the score is under 100. + +`check` never runs the commands in the file. The Hive Code does not either. A HIVE.md is a description, not instructions for an agent. + +## Fields + +| Field | Limit | +| --- | --- | +| `tagline` | 10 to 120 characters | +| `for` | 3 to 80 characters | +| `problem` | 10 to 200 characters | +| `help_wanted` | up to 200 characters | +| `run` | up to 20 lines | +| `deploy` | `vercel`, `netlify`, or both | + +Lengths are Unicode code points, and the minimums and maximums are inclusive. These are the limits from the [HIVE.md guide](https://thehivecode.ai/learn/hive-md?ref=github). The guide also says every field is optional. An empty header can be hive-ready with a low score. Fill the fields in if you want the file to be useful. + +## Development + +Node.js 18 or newer. There are no runtime dependencies. + +```bash +npm test +``` + +Publishing is described in [PUBLISHING.md](../../PUBLISHING.md) at the root of the repository. Do not publish from a fork. + +[MIT](LICENSE) · [The Hive Code](https://thehivecode.ai/?ref=github) diff --git a/packages/cli/bin/thehivecode.js b/packages/cli/bin/thehivecode.js new file mode 100755 index 0000000..2feb040 --- /dev/null +++ b/packages/cli/bin/thehivecode.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node +import { main } from "../src/cli.js"; + +main(process.argv.slice(2)).then( + (code) => { + process.exitCode = code ?? 0; + }, + (error) => { + const message = error && error.message ? error.message : String(error); + process.stderr.write(`${message}\n`); + process.exitCode = 1; + }, +); diff --git a/packages/cli/package.json b/packages/cli/package.json new file mode 100644 index 0000000..f9448f4 --- /dev/null +++ b/packages/cli/package.json @@ -0,0 +1,41 @@ +{ + "name": "thehivecode", + "version": "0.1.0", + "description": "Write and check a HIVE.md, the file that makes a repository hive-ready.", + "type": "module", + "bin": { + "thehivecode": "./bin/thehivecode.js" + }, + "files": [ + "bin/", + "src/", + "README.md", + "LICENSE" + ], + "engines": { + "node": ">=18" + }, + "license": "MIT", + "homepage": "https://thehivecode.ai", + "repository": { + "type": "git", + "url": "git+https://github.com/thehivecode-ai/hive-coding.git", + "directory": "packages/cli" + }, + "bugs": { + "url": "https://github.com/thehivecode-ai/hive-coding/issues" + }, + "keywords": [ + "hive coding", + "hivecoding", + "vibe coding", + "multi-agent", + "ai agents", + "community coding", + "swarm coding" + ], + "scripts": { + "test": "node --test test/*.test.js", + "start": "node ./bin/thehivecode.js" + } +} diff --git a/packages/cli/src/cli.js b/packages/cli/src/cli.js new file mode 100644 index 0000000..d451db9 --- /dev/null +++ b/packages/cli/src/cli.js @@ -0,0 +1,204 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { createInterface } from "node:readline/promises"; +import { stdin, stdout as processStdout, stderr as processStderr } from "node:process"; +import { formatReport, scoreFile } from "./score.js"; +import { runInit } from "./init.js"; + +const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")); + +const BOOL = new Set(["yes", "force", "json", "stdout", "help", "version", "strict"]); +const SHORT = { y: "yes", f: "force", h: "help", v: "version" }; +const OPTIONS = new Set([ + "tagline", + "for", + "problem", + "helpWanted", + "title", + "file", + "run", + "deploy", +]); + +export async function main(argv, io = {}) { + const stdout = io.stdout || processStdout; + const stderr = io.stderr || processStderr; + const input = io.stdin || stdin; + let flags; + try { + flags = parseArgs(argv); + } catch (error) { + stderr.write(`${error.message}\n`); + return 1; + } + + if (flags.version) { + stdout.write(`${pkg.version}\n`); + return 0; + } + if (flags.help || flags._.length === 0) { + stdout.write(helpText()); + return 0; + } + + const [command, extra] = flags._; + if (extra) { + stderr.write(`Unexpected argument \`${extra}\`.\n`); + return 1; + } + if (command === "help") { + stdout.write(helpText()); + return 0; + } + if (command === "check") { + const cwd = io.cwd || process.cwd(); + const requested = flags.file || "HIVE.md"; + const report = scoreFile(path.resolve(cwd, requested)); + report.file = requested; + if (flags.json) stdout.write(`${JSON.stringify(toJson(report), null, 2)}\n`); + else stdout.write(formatReport(report)); + if (!report.hiveReady) return 1; + if (flags.strict && report.score < 100) return 1; + return 0; + } + if (command === "init") { + const interactive = io.interactive ?? Boolean(input.isTTY); + let rl = io.rl; + let created = false; + if (!rl && interactive && !flags.yes) { + rl = createInterface({ input, output: stdout }); + created = true; + } + try { + return await runInit({ + cwd: io.cwd || process.cwd(), + flags, + rl, + stdout, + stderr, + interactive, + }); + } finally { + if (created) rl.close(); + } + } + + stderr.write(`Unknown command \`${command}\`.\n\n`); + stdout.write(helpText()); + return 1; +} + +export function parseArgs(argv) { + const flags = { _: [] }; + for (let i = 0; i < argv.length; i++) { + const arg = argv[i]; + if (arg === "--") { + flags._.push(...argv.slice(i + 1)); + break; + } + if (arg.startsWith("--")) { + let key = arg.slice(2); + let inline; + const eq = key.indexOf("="); + if (eq !== -1) { + inline = key.slice(eq + 1); + key = key.slice(0, eq); + } + const name = key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()); + if (BOOL.has(name)) { + if (inline != null) throw new Error(`--${key} does not take a value.`); + flags[name] = true; + continue; + } + if (!OPTIONS.has(name)) throw new Error(`Unknown option \`--${key}\`.`); + const value = inline != null ? inline : argv[++i]; + if (value == null || (inline == null && value.startsWith("-"))) { + throw new Error(`--${key} needs a value.`); + } + if (name === "run") { + flags.run = flags.run || []; + for (const line of value.split(/\r?\n|\\n/)) { + const trimmed = line.trim(); + if (trimmed) flags.run.push(trimmed); + } + } else if (name === "deploy") { + flags.deploy = flags.deploy || []; + flags.deploy.push(value); + } else { + flags[name] = value; + } + continue; + } + if (/^-[a-zA-Z]$/.test(arg)) { + const name = SHORT[arg[1]]; + if (!name) throw new Error(`Unknown option \`${arg}\`.`); + flags[name] = true; + continue; + } + if (arg.startsWith("-")) throw new Error(`Unknown option \`${arg}\`.`); + flags._.push(arg); + } + return flags; +} + +function toJson(report) { + return { + file: report.file, + hiveReady: report.hiveReady, + score: report.score, + maxScore: 100, + fields: report.fields, + deploy: report.deploy, + errors: report.errors, + missing: report.missing, + notes: report.notes, + }; +} + +function helpText() { + return `thehivecode ${pkg.version} +Write and check a HIVE.md. The format is specified at +https://thehivecode.ai/learn/hive-md + +Usage + thehivecode init [--yes] [--force] [--file HIVE.md] + thehivecode check [--file HIVE.md] [--json] [--strict] + thehivecode --help + thehivecode --version + +init asks for a name, a tagline, who it is for, the problem, the help +you want, how to run it, and an optional deploy target. Enter accepts +the default in brackets. --yes writes those defaults without asking +and will not replace an existing file unless you also pass --force. + +check reads HIVE.md and prints a hive-ready score from 0 to 100. +The file is hive-ready when the header parses and every field you set +is within the limits below. The score is how many recommended fields +are filled in. deploy is optional and is not part of the score. +Exit 0 when the file is hive-ready. --strict also requires a score of 100. +This command never runs the commands in the file. + +Fields + tagline 10 to 120 characters + for 3 to 80 characters + problem 10 to 200 characters + help_wanted up to 200 characters + run up to 20 lines + deploy vercel, netlify, or both + +Options + --yes, -y Accept defaults + --force, -f Replace an existing HIVE.md + --file Read or write this path instead of ./HIVE.md + --title Project name, used as the Markdown title + --tagline + --for + --problem + --help-wanted Use - to leave help_wanted out + --run Repeat for each command, or separate lines with \\n + --deploy vercel, netlify, both, or skip + --stdout Print the file instead of writing it + --json Print the check result as JSON + --strict With check, exit 1 unless the score is 100 +`; +} diff --git a/packages/cli/src/init.js b/packages/cli/src/init.js new file mode 100644 index 0000000..729f27b --- /dev/null +++ b/packages/cli/src/init.js @@ -0,0 +1,354 @@ +import { existsSync, readFileSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { chars, LIMITS, RUN_MAX_LINES } from "./schema.js"; +import { formatReport, scoreText } from "./score.js"; + +export function humanize(name) { + const cleaned = String(name).replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim(); + if (!cleaned) return "This project"; + return cleaned.charAt(0).toUpperCase() + cleaned.slice(1); +} + +export function projectDefaults(cwd) { + const pkg = readPackage(cwd); + let rawName = path.basename(cwd); + if (pkg && typeof pkg.name === "string" && pkg.name.trim()) { + rawName = pkg.name.split("/").pop(); + } + const title = fit(humanize(rawName), 1, 80, "This project"); + let tagline = `${title} for the people who use it`; + if (pkg && typeof pkg.description === "string") { + const description = pkg.description.trim(); + if (within(description, LIMITS.tagline.min, LIMITS.tagline.max)) tagline = description; + } + tagline = fit(tagline, LIMITS.tagline.min, LIMITS.tagline.max, "A project for the people who use it"); + const audience = fit(`People who use ${title}`, LIMITS.for.min, LIMITS.for.max, "People who use this project"); + const problem = "There is no public queue yet for what to build next"; + const helpWanted = "People who will use it and say what is missing"; + return { + title, + tagline, + for: audience, + problem, + helpWanted, + run: detectRun(cwd, pkg), + deploy: detectDeploy(cwd), + }; +} + +export function renderHive(doc) { + const lines = ["---"]; + if (doc.tagline) lines.push(`tagline: ${yamlScalar(doc.tagline)}`); + if (doc.for) lines.push(`for: ${yamlScalar(doc.for)}`); + if (doc.problem) lines.push(`problem: ${yamlScalar(doc.problem)}`); + if (doc.helpWanted) lines.push(`help_wanted: ${yamlScalar(doc.helpWanted)}`); + if (doc.run) { + lines.push("run: |"); + for (const line of String(doc.run).split("\n")) lines.push(` ${line}`); + } + if (doc.deploy && doc.deploy.length > 0) { + lines.push(`deploy: [${doc.deploy.join(", ")}]`); + } + lines.push("---", "", `# ${doc.title}`, ""); + lines.push(bodyFor(doc).trimEnd(), ""); + return lines.join("\n"); +} + +export function yamlScalar(value) { + if ( + /[\n\r]/.test(value) || + /[:#&*!|>'"%@`[\]{},]/.test(value) || + /^\s|\s$/.test(value) || + /^(true|false|null|yes|no|~)$/i.test(value) + ) { + return JSON.stringify(value); + } + return value; +} + +export async function runInit({ + cwd, + flags, + rl, + stdout, + stderr, + interactive = false, +}) { + const file = path.resolve(cwd, flags.file || "HIVE.md"); + const defaults = projectDefaults(cwd); + if (flags.deploy) { + const parsed = normalizeDeploy(flags.deploy); + if (parsed.error) { + stderr.write(`${parsed.error}\n`); + return 1; + } + flags = { ...flags, deploy: parsed.targets }; + } + let doc; + + if (flags.yes || !interactive) { + if (!flags.yes && !interactive && !hasScriptedFields(flags)) { + stderr.write( + "No terminal to ask questions. Re-run with --yes, or pass --tagline, --for, and --problem.\n", + ); + return 1; + } + const built = applyFlags(defaults, flags); + if (built.error) { + stderr.write(`${built.error}\n`); + return 1; + } + doc = built.doc; + } else { + doc = await promptDoc({ rl, stdout, defaults, flags }); + const answer = (await rl.question("Write the file? [Y/n] ")).trim().toLowerCase(); + if (answer === "n" || answer === "no") { + stdout.write("Left the directory unchanged.\n"); + return 0; + } + } + + const text = renderHive(doc); + const report = scoreText(text, path.basename(file)); + if (!report.hiveReady) { + stderr.write(formatReport(report)); + return 1; + } + if (flags.stdout) { + stdout.write(text); + return 0; + } + if (existsSync(file) && !flags.force) { + stderr.write(`${path.basename(file)} already exists. Pass --force to replace it.\n`); + return 1; + } + writeFileSync(file, text); + stdout.write(`Wrote ${path.relative(cwd, file) || path.basename(file)}\n`); + stdout.write(`hive-ready: yes\n`); + stdout.write(`score: ${report.score}/100\n`); + if (report.missing.length > 0) stdout.write(formatReport(report)); + return 0; +} + +function hasScriptedFields(flags) { + return Boolean(flags.tagline && flags.for && flags.problem); +} + +function applyFlags(defaults, flags) { + const doc = { + title: flags.title || defaults.title, + tagline: flags.tagline || defaults.tagline, + for: flags.for || defaults.for, + problem: flags.problem || defaults.problem, + helpWanted: + flags.helpWanted === "-" ? "" : flags.helpWanted || defaults.helpWanted, + run: flags.run ? flags.run.join("\n") : defaults.run, + deploy: flags.deploy || defaults.deploy, + }; + if (!doc.title.trim()) return { error: "A project name is required." }; + return { doc }; +} + +async function promptDoc({ rl, stdout, defaults, flags }) { + const title = + flags.title || + (await askBounded(rl, stdout, { + label: "Project name", + def: defaults.title, + min: 1, + max: 80, + })); + const tagline = + flags.tagline || + (await askBounded(rl, stdout, { + label: "Tagline", + def: defaults.tagline, + min: LIMITS.tagline.min, + max: LIMITS.tagline.max, + })); + const audience = + flags.for || + (await askBounded(rl, stdout, { + label: "Who it is for", + def: defaults.for, + min: LIMITS.for.min, + max: LIMITS.for.max, + })); + const problem = + flags.problem || + (await askBounded(rl, stdout, { + label: "Problem it solves", + def: defaults.problem, + min: LIMITS.problem.min, + max: LIMITS.problem.max, + })); + let helpWanted = flags.helpWanted; + if (helpWanted == null) { + helpWanted = await askBounded(rl, stdout, { + label: "Help wanted (- to skip)", + def: defaults.helpWanted, + min: LIMITS.help_wanted.min, + max: LIMITS.help_wanted.max, + skip: "-", + }); + } else if (helpWanted === "-") { + helpWanted = ""; + } + const run = flags.run + ? flags.run.join("\n") + : await askRun(rl, stdout, defaults.run); + const deploy = flags.deploy || (await askDeploy(rl, stdout, defaults.deploy)); + return { title, tagline, for: audience, problem, helpWanted, run, deploy }; +} + +async function askBounded(rl, stdout, { label, def, min, max, skip }) { + while (true) { + const hint = def ? ` [${def}]` : ""; + const raw = (await rl.question(`${label}${hint}: `)).trim(); + if (skip && raw === skip) return ""; + const value = raw === "" ? def || "" : raw; + if (!value) { + stdout.write("Enter a value.\n"); + continue; + } + const length = chars(value); + if (length < min) { + stdout.write(`${length} characters is short. Use at least ${min}.\n`); + continue; + } + if (length > max) { + stdout.write(`${length} characters is long. Use at most ${max}.\n`); + continue; + } + return value; + } +} + +async function askRun(rl, stdout, fallback) { + stdout.write("Commands to run it locally. One per line. An empty line finishes.\n"); + if (fallback) { + stdout.write("Press enter on the first line to keep:\n"); + for (const line of fallback.split("\n")) stdout.write(` ${line}\n`); + } else { + stdout.write("Press enter on the first line to skip.\n"); + } + const lines = []; + while (lines.length < RUN_MAX_LINES) { + const answer = (await rl.question("> ")).trim(); + if (answer === "") return lines.length === 0 ? fallback || "" : lines.join("\n"); + lines.push(answer); + } + const extra = (await rl.question("> ")).trim(); + if (extra) { + stdout.write(`Stopped at ${RUN_MAX_LINES} lines.\n`); + } + return lines.join("\n"); +} + +async function askDeploy(rl, stdout, fallback) { + const shown = fallback.length > 0 ? fallback.join(", ") : "skip"; + while (true) { + const raw = ( + await rl.question(`Deploy target: vercel, netlify, both, or skip [${shown}]: `) + ) + .trim() + .toLowerCase(); + const parsed = normalizeDeploy([raw === "" ? shown : raw]); + if (parsed.error) { + stdout.write("Use vercel, netlify, both, or skip.\n"); + continue; + } + return parsed.targets; + } +} + +function normalizeDeploy(values) { + const targets = []; + for (const value of values) { + const text = String(value).trim().toLowerCase(); + if (text === "" || text === "skip" || text === "none") continue; + if (text === "both" || text === "vercel, netlify" || text === "netlify, vercel") { + targets.push("vercel", "netlify"); + continue; + } + for (const part of text.split(",").map((item) => item.trim()).filter(Boolean)) { + if (part !== "vercel" && part !== "netlify") { + return { error: `deploy has \`${part}\`. Use vercel, netlify, or both.` }; + } + targets.push(part); + } + } + const unique = []; + for (const target of targets) { + if (!unique.includes(target)) unique.push(target); + } + return { targets: unique }; +} + +function bodyFor(doc) { + const sentence = /[.!?]$/.test(doc.tagline) ? doc.tagline : `${doc.tagline}.`; + const help = doc.helpWanted + ? `How to help: ${doc.helpWanted}` + : "How to help: say what is missing, in public."; + return [ + sentence, + "", + "Replace this with what the project does today and what is next.", + "", + help, + ].join("\n"); +} + +function readPackage(cwd) { + const pkgPath = path.join(cwd, "package.json"); + if (!existsSync(pkgPath)) return null; + try { + const parsed = JSON.parse(readFileSync(pkgPath, "utf8")); + return parsed && typeof parsed === "object" ? parsed : null; + } catch { + return null; + } +} + +function detectRun(cwd, pkg) { + const has = (file) => existsSync(path.join(cwd, file)); + if (pkg) { + const scripts = pkg.scripts && typeof pkg.scripts === "object" ? pkg.scripts : {}; + let runner = "npm"; + if (has("pnpm-lock.yaml")) runner = "pnpm"; + else if (has("yarn.lock")) runner = "yarn"; + else if (has("bun.lock") || has("bun.lockb")) runner = "bun"; + const lines = [`${runner} install`]; + if (scripts.dev) lines.push(runner === "npm" ? "npm run dev" : `${runner} dev`); + else if (scripts.start) lines.push(runner === "npm" ? "npm start" : `${runner} start`); + else lines.push(runner === "npm" ? "npm test" : `${runner} test`); + return lines.join("\n"); + } + if (has("Cargo.toml")) return "cargo run"; + if (has("go.mod")) return "go run ."; + if (has("requirements.txt")) return "python -m pip install -r requirements.txt"; + if (has("pyproject.toml")) return "python -m pip install -e ."; + return ""; +} + +function detectDeploy(cwd) { + const has = (file) => existsSync(path.join(cwd, file)); + const targets = []; + if (has("vercel.json")) targets.push("vercel"); + if (has("netlify.toml")) targets.push("netlify"); + return targets; +} + +function within(value, min, max) { + if (!value || value.includes("\n")) return false; + const length = chars(value); + return length >= min && length <= max; +} + +function fit(value, min, max, fallback) { + let text = String(value).trim(); + if (chars(text) > max) text = Array.from(text).slice(0, max).join("").trim(); + if (chars(text) < min) text = fallback; + if (chars(text) > max) text = Array.from(text).slice(0, max).join("").trim(); + return text; +} diff --git a/packages/cli/src/parse.js b/packages/cli/src/parse.js new file mode 100644 index 0000000..614ed89 --- /dev/null +++ b/packages/cli/src/parse.js @@ -0,0 +1,266 @@ +import { chars, DEPLOY_TARGETS, HEADER_FIELDS, LIMITS, RUN_MAX_LINES } from "./schema.js"; + +const KNOWN = new Set(HEADER_FIELDS); + +export function parseHive(text) { + if (typeof text !== "string") { + return fail("HIVE.md must be text."); + } + const src = text.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n"); + const split = splitFrontMatter(src); + if (split.error) return fail(split.error); + + const header = parseHeader(split.header); + if (header.errors.length > 0 && header.fields == null) { + return fail(header.errors[0], header.errors); + } + + const title = findTitle(split.body); + return { + ok: header.errors.length === 0, + errors: header.errors, + fields: header.fields, + unknown: header.unknown, + title, + body: split.body, + }; +} + +function fail(message, errors = [message]) { + return { ok: false, errors, fields: null, unknown: [], title: null, body: "" }; +} + +function splitFrontMatter(src) { + if (!src.startsWith("---\n") && src !== "---") { + return { + error: + "HIVE.md must start with a --- line, then the header, then a closing --- line.", + }; + } + const lines = src.split("\n"); + if (lines[0] !== "---") { + return { + error: + "HIVE.md must start with a --- line, then the header, then a closing --- line.", + }; + } + const headerLines = []; + for (let i = 1; i < lines.length; i++) { + if (lines[i] === "---") { + return { header: headerLines.join("\n"), body: lines.slice(i + 1).join("\n") }; + } + headerLines.push(lines[i]); + } + return { error: "HIVE.md is missing the closing --- line of the header." }; +} + +function parseHeader(header) { + const fields = {}; + const unknown = []; + const errors = []; + const lines = header.split("\n"); + let i = 0; + + while (i < lines.length) { + const line = lines[i]; + if (line.trim() === "" || /^\s*#/.test(line)) { + i++; + continue; + } + const match = line.match(/^([A-Za-z][A-Za-z0-9_]*)\s*:\s*(.*)$/); + if (!match) { + errors.push(`Could not read this header line: ${line.trim()}`); + i++; + continue; + } + const key = match[1]; + const raw = match[2]; + let value; + + if (raw === "|" || raw === "|-" || raw === "|+" || raw === ">" || raw === ">-" || raw === ">+") { + const block = []; + i++; + while (i < lines.length && (lines[i] === "" || /^[ \t]/.test(lines[i]))) { + block.push(lines[i]); + i++; + } + value = dedentBlock(block, raw); + } else { + value = unquote(raw.trim()); + i++; + } + + if (Object.prototype.hasOwnProperty.call(fields, key) || unknown.includes(key)) { + errors.push(`\`${key}\` is set twice. Keep one.`); + continue; + } + if (!KNOWN.has(key)) { + unknown.push(key); + continue; + } + fields[key] = value; + } + + return { fields, unknown, errors }; +} + +function dedentBlock(block, indicator) { + const indents = []; + for (const line of block) { + if (line.trim() === "") continue; + const indent = line.match(/^[ \t]*/)[0]; + indents.push(indent.length); + } + const min = indents.length > 0 ? Math.min(...indents) : 0; + let text = block + .map((line) => (line.trim() === "" ? "" : line.slice(min))) + .join("\n") + .replace(/\n$/, ""); + if (indicator.startsWith(">")) { + text = text + .split("\n") + .map((line) => line.trim()) + .filter((line) => line !== "") + .join(" "); + } + return text; +} + +export function unquote(value) { + if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) { + try { + const parsed = JSON.parse(value); + return typeof parsed === "string" ? parsed : value; + } catch { + return value; + } + } + if (value.length >= 2 && value.startsWith("'") && value.endsWith("'")) { + return value.slice(1, -1).replace(/''/g, "'"); + } + return value; +} + +export function findTitle(body) { + let fence = false; + for (const line of body.split("\n")) { + if (line.trim().startsWith("```")) { + fence = !fence; + continue; + } + if (fence) continue; + const match = line.match(/^#\s+(\S.*?)\s*$/); + if (match) return match[1]; + } + return null; +} + +export function parseDeploy(raw) { + const text = raw.trim(); + if (text.startsWith("[") && text.endsWith("]")) { + const inner = text.slice(1, -1).trim(); + if (inner === "") return []; + return inner + .split(",") + .map((part) => unquote(part.trim())) + .filter((part) => part !== ""); + } + if (text === "") return []; + return [unquote(text)]; +} + +export function validateFields(fields) { + const errors = []; + const cleaned = {}; + + for (const key of ["tagline", "for", "problem", "help_wanted"]) { + if (!Object.prototype.hasOwnProperty.call(fields, key)) continue; + const value = fields[key]; + if (typeof value !== "string" || value.trim() === "") { + errors.push(emptyField(key)); + continue; + } + if (value.includes("\n")) { + errors.push(`${key} must be a single line.`); + continue; + } + const control = controlChar(value); + if (control) { + errors.push(`${key} contains a control character.`); + continue; + } + const trimmed = value.trim(); + const length = chars(trimmed); + const { min, max } = LIMITS[key]; + if (length < min || length > max) { + errors.push(lengthError(key, length, min, max)); + continue; + } + cleaned[key] = trimmed; + } + + if (Object.prototype.hasOwnProperty.call(fields, "run")) { + const value = fields.run; + if (typeof value !== "string" || value.trim() === "") { + errors.push("run has no commands. Remove it, or add up to 20 lines."); + } else if (controlChar(value)) { + errors.push("run contains a control character."); + } else { + const lines = value.split("\n"); + if (lines.length > RUN_MAX_LINES) { + errors.push( + `run is ${lines.length} lines. Keep it to ${RUN_MAX_LINES} lines.`, + ); + } else { + cleaned.run = value; + } + } + } + + if (Object.prototype.hasOwnProperty.call(fields, "deploy")) { + const targets = parseDeploy(String(fields.deploy)); + if (targets.length === 0) { + errors.push("deploy is empty. Remove it, or set vercel, netlify, or both."); + } else { + const seen = new Set(); + const bad = []; + let duplicate = false; + for (const target of targets) { + if (!DEPLOY_TARGETS.includes(target)) bad.push(target); + if (seen.has(target)) duplicate = true; + seen.add(target); + } + if (duplicate) { + errors.push("deploy lists a target twice. List each of vercel and netlify once."); + } + if (bad.length > 0) { + const names = bad.map((item) => `\`${item}\``).join(", "); + errors.push(`deploy has ${names}. Use vercel, netlify, or both.`); + } + if (bad.length === 0 && !duplicate) cleaned.deploy = targets; + } + } + + return { errors, cleaned }; +} + +function emptyField(key) { + if (key === "help_wanted") { + return "help_wanted is empty. Remove it, or write up to 200 characters."; + } + const { min, max } = LIMITS[key]; + return `${key} is empty. Use ${min} to ${max} characters, or remove it.`; +} + +function lengthError(key, length, min, max) { + if (key === "help_wanted") { + return `help_wanted is ${length} characters. The maximum is ${max}.`; + } + return `${key} is ${length} characters. Use ${min} to ${max}.`; +} + +function controlChar(value) { + return /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/.test(value); +} + +export { LIMITS, RUN_MAX_LINES }; diff --git a/packages/cli/src/schema.js b/packages/cli/src/schema.js new file mode 100644 index 0000000..140fe9d --- /dev/null +++ b/packages/cli/src/schema.js @@ -0,0 +1,30 @@ +// Field limits from https://thehivecode.ai/learn/hive-md +// Lengths are inclusive. All fields are optional on the page. +// Points are this tool's hive-ready score, not part of the format. + +export const LIMITS = { + tagline: { min: 10, max: 120, points: 25 }, + for: { min: 3, max: 80, points: 15 }, + problem: { min: 10, max: 200, points: 25 }, + help_wanted: { min: 1, max: 200, points: 15 }, +}; + +export const RUN_MAX_LINES = 20; +export const RUN_POINTS = 15; +export const TITLE_POINTS = 5; +export const DEPLOY_TARGETS = ["vercel", "netlify"]; + +export const HEADER_FIELDS = [ + "tagline", + "for", + "problem", + "help_wanted", + "run", + "deploy", +]; + +export const MAX_FILE_BYTES = 1_000_000; + +export function chars(value) { + return Array.from(value).length; +} diff --git a/packages/cli/src/score.js b/packages/cli/src/score.js new file mode 100644 index 0000000..d5a210d --- /dev/null +++ b/packages/cli/src/score.js @@ -0,0 +1,192 @@ +import { readFileSync } from "node:fs"; +import { parseHive, validateFields } from "./parse.js"; +import { chars, LIMITS, MAX_FILE_BYTES, RUN_POINTS, TITLE_POINTS } from "./schema.js"; + +const FIELD_ORDER = ["tagline", "for", "problem", "help_wanted", "run", "title"]; + +const MISSING = { + tagline: "Add tagline: what the project is, in one line (10 to 120 characters).", + for: "Add for: who it is for (3 to 80 characters).", + problem: "Add problem: the problem it solves (10 to 200 characters).", + help_wanted: "Add help_wanted: what help you want right now (up to 200 characters).", + run: "Add run: the commands to run it on your own computer (up to 20 lines).", + title: "Add a Markdown title, a line like `# Project name`, under the header.", +}; + +export function scoreText(text, file = "HIVE.md") { + const parsed = parseHive(text); + if (!parsed.fields) { + return { + file, + hiveReady: false, + score: 0, + fields: emptyFields(), + deploy: { status: "missing", detail: "" }, + errors: parsed.errors, + missing: [], + notes: [], + }; + } + + const { errors, cleaned } = validateFields(parsed.fields); + const allErrors = [...parsed.errors, ...errors]; + const fields = {}; + const missing = []; + let score = 0; + + for (const key of ["tagline", "for", "problem", "help_wanted"]) { + const points = LIMITS[key].points; + if (cleaned[key]) { + score += points; + fields[key] = { + status: "pass", + points, + max: points, + detail: `${chars(cleaned[key])} characters`, + }; + } else if (hasFieldError(allErrors, key)) { + fields[key] = { status: "fail", points: 0, max: points, detail: "" }; + } else { + fields[key] = { status: "missing", points: 0, max: points, detail: "" }; + missing.push(MISSING[key]); + } + } + + if (cleaned.run) { + const lineCount = cleaned.run.split("\n").length; + score += RUN_POINTS; + fields.run = { + status: "pass", + points: RUN_POINTS, + max: RUN_POINTS, + detail: `${lineCount} ${lineCount === 1 ? "line" : "lines"}`, + }; + } else if (allErrors.some((item) => item.startsWith("run"))) { + fields.run = { status: "fail", points: 0, max: RUN_POINTS, detail: "" }; + } else { + fields.run = { status: "missing", points: 0, max: RUN_POINTS, detail: "" }; + missing.push(MISSING.run); + } + + if (parsed.title) { + score += TITLE_POINTS; + fields.title = { + status: "pass", + points: TITLE_POINTS, + max: TITLE_POINTS, + detail: parsed.title, + }; + } else { + fields.title = { status: "missing", points: 0, max: TITLE_POINTS, detail: "" }; + missing.push(MISSING.title); + } + + let deploy; + if (cleaned.deploy) { + deploy = { status: "pass", detail: cleaned.deploy.join(", ") }; + } else if (allErrors.some((item) => item.startsWith("deploy"))) { + deploy = { status: "fail", detail: "" }; + } else { + deploy = { status: "optional", detail: "not set" }; + } + + const notes = []; + if (parsed.unknown.length === 1 && parsed.unknown[0] === "license") { + notes.push("Ignored license. The Hive Code reads the license from GitHub, not from HIVE.md."); + } else if (parsed.unknown.length > 0) { + const names = parsed.unknown.map((name) => `\`${name}\``).join(", "); + notes.push( + `Ignored ${names}. The header uses tagline, for, problem, help_wanted, run, and deploy.`, + ); + } + notes.push("check does not run the commands in this file."); + + return { + file, + hiveReady: allErrors.length === 0, + score, + fields, + deploy, + errors: allErrors, + missing, + notes, + order: FIELD_ORDER, + }; +} + +function hasFieldError(errors, key) { + return errors.some((item) => item === key || item.startsWith(`${key} `) || item.startsWith(`${key} is`)); +} + +function emptyFields() { + const fields = {}; + for (const key of ["tagline", "for", "problem", "help_wanted"]) { + fields[key] = { status: "missing", points: 0, max: LIMITS[key].points, detail: "" }; + } + fields.run = { status: "missing", points: 0, max: RUN_POINTS, detail: "" }; + fields.title = { status: "missing", points: 0, max: TITLE_POINTS, detail: "" }; + return fields; +} + +function blocked(file, message) { + return { + file, + hiveReady: false, + score: 0, + fields: emptyFields(), + deploy: { status: "missing", detail: "" }, + errors: [message], + missing: [], + notes: [], + }; +} + +export function scoreFile(filePath) { + let text; + try { + const buffer = readFileSync(filePath); + if (buffer.length > MAX_FILE_BYTES) { + return blocked( + filePath, + `${filePath} is over ${MAX_FILE_BYTES} bytes. A HIVE.md is a short file.`, + ); + } + text = buffer.toString("utf8"); + } catch (error) { + if (error && error.code === "ENOENT") { + return blocked(filePath, `No file at ${filePath}. Create one with \`thehivecode init\`.`); + } + if (error && (error.code === "EISDIR" || error.code === "EACCES")) { + return blocked(filePath, `Could not read ${filePath}.`); + } + throw error; + } + return scoreText(text, filePath); +} + +export function formatReport(report) { + const lines = []; + lines.push(report.file); + lines.push(`hive-ready: ${report.hiveReady ? "yes" : "no"}`); + lines.push(`score: ${report.score}/100`); + lines.push(""); + for (const key of FIELD_ORDER) { + const field = report.fields[key]; + const detail = field.detail ? ` ${field.detail}` : ""; + lines.push(` ${key.padEnd(12)}${field.status.padEnd(8)}${detail}`); + } + const deployDetail = report.deploy.detail ? ` ${report.deploy.detail}` : ""; + lines.push(` ${"deploy".padEnd(12)}${report.deploy.status.padEnd(8)}${deployDetail}`); + lines.push(""); + lines.push("fixes"); + const fixes = [...report.errors, ...report.missing]; + if (fixes.length === 0) lines.push(" none"); + else for (const fix of fixes) lines.push(` ${fix}`); + if (report.notes.length > 0) { + lines.push(""); + lines.push("notes"); + for (const note of report.notes) lines.push(` ${note}`); + } + lines.push(""); + return lines.join("\n"); +} diff --git a/packages/cli/test/cli.test.js b/packages/cli/test/cli.test.js new file mode 100644 index 0000000..8b32a3b --- /dev/null +++ b/packages/cli/test/cli.test.js @@ -0,0 +1,97 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { test } from "node:test"; +import { fileURLToPath } from "node:url"; +import { main, parseArgs } from "../src/cli.js"; + +const bin = fileURLToPath(new URL("../bin/thehivecode.js", import.meta.url)); +const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")); + +function run(args, cwd) { + return spawnSync(process.execPath, [bin, ...args], { cwd, encoding: "utf8" }); +} + +test("parseArgs reads long options, repeats, and shorts", () => { + const flags = parseArgs([ + "init", + "--yes", + "--tagline=A sign-up sheet for Saturday runs", + "--run", + "npm install\\nnpm test", + "--deploy", + "both", + "-f", + ]); + assert.deepEqual(flags._, ["init"]); + assert.equal(flags.yes, true); + assert.equal(flags.force, true); + assert.deepEqual(flags.run, ["npm install", "npm test"]); + assert.deepEqual(flags.deploy, ["both"]); +}); + +test("--help and --version", () => { + const help = run(["--help"]); + assert.equal(help.status, 0); + assert.match(help.stdout, /thehivecode init/); + assert.match(help.stdout, /never runs the commands/); + + const version = run(["--version"]); + assert.equal(version.status, 0); + assert.equal(version.stdout.trim(), pkg.version); + + const unknown = run(["dance"]); + assert.equal(unknown.status, 1); + assert.match(unknown.stderr, /Unknown command/); +}); + +test("check --json and --strict against a real file", () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-cli-")); + writeFileSync( + path.join(dir, "HIVE.md"), + `--- +tagline: A sign-up sheet for Saturday runs, with who is coming +for: A running club +--- + +# Saturday +`, + ); + const checked = run(["check", "--json"], dir); + assert.equal(checked.status, 0); + const report = JSON.parse(checked.stdout); + assert.equal(report.hiveReady, true); + assert.ok(report.score < 100); + + const strict = run(["check", "--strict"], dir); + assert.equal(strict.status, 1); + assert.match(strict.stdout, /hive-ready: yes/); +}); + +test("init --yes from the executable", async () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-bin-")); + const result = run(["init", "--yes", "--run", "npm test"], dir); + assert.equal(result.status, 0, result.stderr); + assert.match(result.stdout, /Wrote HIVE.md/); + const text = readFileSync(path.join(dir, "HIVE.md"), "utf8"); + assert.match(text, /npm test/); + + const check = run(["check"], dir); + assert.equal(check.status, 0, check.stdout); + assert.match(check.stdout, /score: 100\/100/); +}); + +test("main returns 1 for a missing file without throwing", async () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-miss-")); + let out = ""; + const code = await main(["check"], { + cwd: dir, + stdout: { write: (chunk) => { out += chunk; } }, + stderr: { write() {} }, + interactive: false, + }); + assert.equal(code, 1); + assert.match(out, /hive-ready: no/); +}); diff --git a/packages/cli/test/init.test.js b/packages/cli/test/init.test.js new file mode 100644 index 0000000..f4d40cd --- /dev/null +++ b/packages/cli/test/init.test.js @@ -0,0 +1,101 @@ +import assert from "node:assert/strict"; +import { mkdtempSync, readFileSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { test } from "node:test"; +import { projectDefaults, renderHive, runInit, yamlScalar } from "../src/init.js"; +import { scoreText } from "../src/score.js"; + +function capture() { + let out = ""; + let err = ""; + return { + stdout: { write: (chunk) => { out += chunk; } }, + stderr: { write: (chunk) => { err += chunk; } }, + read: () => ({ out, err }), + }; +} + +test("defaults from package.json are hive-ready", () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-init-")); + writeFileSync( + path.join(dir, "package.json"), + JSON.stringify({ + name: "@acme/saturday-run", + description: "A sign-up sheet for the club's Saturday run", + scripts: { dev: "vite" }, + }), + ); + writeFileSync(path.join(dir, "vercel.json"), "{}\n"); + const defaults = projectDefaults(dir); + assert.equal(defaults.title, "Saturday run"); + assert.equal(defaults.tagline, "A sign-up sheet for the club's Saturday run"); + assert.match(defaults.run, /npm install/); + assert.match(defaults.run, /npm run dev/); + assert.deepEqual(defaults.deploy, ["vercel"]); + const report = scoreText(renderHive(defaults)); + assert.equal(report.hiveReady, true, report.errors.join("\n")); + assert.equal(report.score, 100); +}); + +test("init --yes writes, refuses to clobber, and --force replaces", async () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-yes-")); + const io = capture(); + assert.equal(await runInit({ cwd: dir, flags: { yes: true }, ...io, interactive: false }), 0); + const first = readFileSync(path.join(dir, "HIVE.md"), "utf8"); + assert.match(first, /^---\n/); + assert.match(first, /^# /m); + + const again = capture(); + assert.equal(await runInit({ cwd: dir, flags: { yes: true }, ...again, interactive: false }), 1); + assert.match(again.read().err, /already exists/); + assert.equal(readFileSync(path.join(dir, "HIVE.md"), "utf8"), first); + + const forced = capture(); + assert.equal( + await runInit({ cwd: dir, flags: { yes: true, force: true, tagline: "Hours: a weekly file for one shop counter" }, ...forced, interactive: false }), + 0, + ); + const second = readFileSync(path.join(dir, "HIVE.md"), "utf8"); + assert.match(second, /tagline: "Hours: a weekly file for one shop counter"/); + assert.notEqual(second, first); +}); + +test("a too-short flag is rejected and does not write", async () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-bad-")); + const io = capture(); + const code = await runInit({ + cwd: dir, + flags: { yes: true, tagline: "nope" }, + ...io, + interactive: false, + }); + assert.equal(code, 1); + assert.match(io.read().err, /tagline is 4 characters/); + assert.throws(() => readFileSync(path.join(dir, "HIVE.md"))); +}); + +test("prompts use defaults and can skip help wanted", async () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-ask-")); + const answers = ["", "", "", "", "-", "", "skip", "y"]; + const rl = { question: async () => answers.shift() ?? "" }; + const io = capture(); + const code = await runInit({ + cwd: dir, + flags: {}, + rl, + ...io, + interactive: true, + }); + assert.equal(code, 0, io.read().err); + const text = readFileSync(path.join(dir, "HIVE.md"), "utf8"); + assert.equal(text.includes("help_wanted"), false); + const report = scoreText(text); + assert.equal(report.hiveReady, true, report.errors.join("\n")); + assert.equal(report.fields.help_wanted.status, "missing"); +}); + +test("yaml quotes values that would break the header", () => { + assert.equal(yamlScalar("plain words"), "plain words"); + assert.equal(yamlScalar("Hours: open"), '"Hours: open"'); +}); diff --git a/packages/cli/test/parse.test.js b/packages/cli/test/parse.test.js new file mode 100644 index 0000000..c968efc --- /dev/null +++ b/packages/cli/test/parse.test.js @@ -0,0 +1,77 @@ +import assert from "node:assert/strict"; +import { test } from "node:test"; +import { parseHive, validateFields } from "../src/parse.js"; + +const chair = `--- +tagline: Booking for barbers that texts the waitlist when a chair opens +for: Barbers and small salons +problem: Chairs sit empty when a client cancels late +help_wanted: A tester with a real shop, and someone for the waitlist texts +run: | + npm install + npm run dev +deploy: [vercel] +--- + +# Chair Alert + +Say more here. +`; + +test("parses the guide template", () => { + const parsed = parseHive(chair); + assert.equal(parsed.ok, true); + assert.equal(parsed.title, "Chair Alert"); + const { errors, cleaned } = validateFields(parsed.fields); + assert.deepEqual(errors, []); + assert.equal(cleaned.tagline.startsWith("Booking for barbers"), true); + assert.equal(cleaned.run, "npm install\nnpm run dev"); + assert.deepEqual(cleaned.deploy, ["vercel"]); +}); + +test("ignores comments, unknown fields, and a BOM", () => { + const text = + "\uFEFF---\n" + + "# comment\n" + + "tagline: Booking for barbers that texts the waitlist when a chair opens\n" + + "license: MIT\n" + + "for: Barbers and small salons\n" + + "---\n\n# Name\n"; + const parsed = parseHive(text.replace(/\n/g, "\r\n")); + assert.equal(parsed.ok, true); + assert.deepEqual(parsed.unknown, ["license"]); + assert.equal(parsed.fields.license, undefined); + assert.equal(parsed.title, "Name"); +}); + +test("rejects a missing closer, a short tagline, and a bad deploy target", () => { + assert.equal(parseHive("# No header\n").ok, false); + assert.match(parseHive("---\ntagline: hi\n").errors[0], /closing/); + + const parsed = parseHive("---\ntagline: short\ndeploy: [heroku ]\n---\n"); + const { errors } = validateFields(parsed.fields); + assert.match(errors.join("\n"), /tagline is 5 characters/); + assert.match(errors.join("\n"), /heroku/); +}); + +test("counts run lines and accepts both deploy targets in either order", () => { + const lines = Array.from({ length: 21 }, (_, i) => ` echo ${i}`).join("\n"); + const tooMany = parseHive(`---\nrun: |\n${lines}\n---\n`); + assert.match(validateFields(tooMany.fields).errors.join("\n"), /21 lines/); + + const both = parseHive("---\ndeploy: [netlify, vercel]\n---\n"); + assert.deepEqual(validateFields(both.fields).cleaned.deploy, ["netlify", "vercel"]); +}); + +test("unquotes a tagline that contains a colon", () => { + const parsed = parseHive('---\ntagline: "Hours: open or closed from a file today"\n---\n'); + assert.equal( + validateFields(parsed.fields).cleaned.tagline, + "Hours: open or closed from a file today", + ); +}); + +test("does not treat a heading inside a fence as the title", () => { + const parsed = parseHive("---\n---\n\n```\n# not the title\n```\n\n# Real title\n"); + assert.equal(parsed.title, "Real title"); +}); diff --git a/packages/cli/test/score.test.js b/packages/cli/test/score.test.js new file mode 100644 index 0000000..c5736a6 --- /dev/null +++ b/packages/cli/test/score.test.js @@ -0,0 +1,62 @@ +import assert from "node:assert/strict"; +import { mkdtempSync, readFileSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { test } from "node:test"; +import { fileURLToPath } from "node:url"; +import { scoreFile, scoreText } from "../src/score.js"; + +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../.."); + +test("the repo's own HIVE.md files are hive-ready and filled in", () => { + const files = [ + "HIVE.md", + "templates/HIVE.md", + "templates/examples/web-app.md", + "templates/examples/game.md", + "templates/examples/cli.md", + ]; + for (const file of files) { + const report = scoreFile(path.join(repoRoot, file)); + assert.equal(report.hiveReady, true, `${file}\n${report.errors.join("\n")}`); + assert.equal(report.score, 100, file); + } +}); + +test("a valid empty header scores 0 and stays hive-ready", () => { + const report = scoreText("---\n---\n", "HIVE.md"); + assert.equal(report.hiveReady, true); + assert.equal(report.score, 0); + assert.ok(report.missing.length >= 5); +}); + +test("an invalid field is a fix and blocks hive-ready", () => { + const report = scoreText("---\ntagline: tiny\nfor: Fans\n---\n\n# Name\n", "HIVE.md"); + assert.equal(report.hiveReady, false); + assert.equal(report.fields.tagline.status, "fail"); + assert.equal(report.fields.for.status, "pass"); + assert.match(report.errors.join("\n"), /tagline is 4 characters/); +}); + +test("check does not run commands from the file", () => { + const dir = mkdtempSync(path.join(tmpdir(), "hive-check-")); + const marker = path.join(dir, "should-not-exist"); + const hive = path.join(dir, "HIVE.md"); + writeFileSync( + hive, + `--- +tagline: A sign-up sheet for Saturday runs, with who is coming +for: A running club and its members +problem: The club's sign-up lives in a chat thread and people miss the run +run: | + touch ${marker} +--- + +# Run sheet +`, + ); + const report = scoreFile(hive); + assert.equal(report.hiveReady, true); + assert.equal(readFileSync(hive, "utf8").includes("touch"), true); + assert.throws(() => readFileSync(marker)); +}); diff --git a/packages/pypi/LICENSE b/packages/pypi/LICENSE new file mode 100644 index 0000000..6c61b28 --- /dev/null +++ b/packages/pypi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 The Hive Code + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/pypi/README.md b/packages/pypi/README.md new file mode 100644 index 0000000..cb45dfb --- /dev/null +++ b/packages/pypi/README.md @@ -0,0 +1,13 @@ +# thehivecode + +This PyPI package is a **name placeholder** from [The Hive Code](https://thehivecode.ai/?ref=github). It is not the CLI. + +The tool that writes and checks a `HIVE.md` is the Node package of the same name, in [thehivecode-ai/hive-coding](https://github.com/thehivecode-ai/hive-coding). The format is specified at [thehivecode.ai/learn/hive-md](https://thehivecode.ai/learn/hive-md?ref=github). + +```bash +thehivecode +``` + +prints a pointer to that CLI. It does not create a file and it does not talk to the network. + +Hive coding is software built by communities and shipped by agents. diff --git a/packages/pypi/pyproject.toml b/packages/pypi/pyproject.toml new file mode 100644 index 0000000..04a0dc3 --- /dev/null +++ b/packages/pypi/pyproject.toml @@ -0,0 +1,36 @@ +[project] +name = "thehivecode" +version = "0.0.1" +description = "Name placeholder for The Hive Code. The HIVE.md CLI is the npm package thehivecode." +readme = "README.md" +requires-python = ">=3.9" +license = "MIT" +authors = [{ name = "The Hive Code" }] +keywords = [ + "hive coding", + "hivecoding", + "vibe coding", + "multi-agent", + "ai agents", + "community coding", + "swarm coding", +] +classifiers = [ + "Development Status :: 1 - Planning", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", +] +[project.urls] +Homepage = "https://thehivecode.ai" +Repository = "https://github.com/thehivecode-ai/hive-coding" +Documentation = "https://thehivecode.ai/learn/hive-md" + +[project.scripts] +thehivecode = "thehivecode:main" + +[build-system] +requires = ["setuptools>=61"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/packages/pypi/src/thehivecode/__init__.py b/packages/pypi/src/thehivecode/__init__.py new file mode 100644 index 0000000..c41c953 --- /dev/null +++ b/packages/pypi/src/thehivecode/__init__.py @@ -0,0 +1,17 @@ +"""Name placeholder for The Hive Code. The CLI is the npm package `thehivecode`.""" + +__version__ = "0.0.1" + +MESSAGE = """thehivecode on PyPI is a name placeholder from The Hive Code. +The HIVE.md CLI is the Node package `thehivecode`: +https://thehivecode.ai/learn/hive-md +https://github.com/thehivecode-ai/hive-coding +""" + + +def main() -> None: + print(MESSAGE, end="") + + +if __name__ == "__main__": + main() diff --git a/packages/pypi/src/thehivecode/__main__.py b/packages/pypi/src/thehivecode/__main__.py new file mode 100644 index 0000000..53fb324 --- /dev/null +++ b/packages/pypi/src/thehivecode/__main__.py @@ -0,0 +1,3 @@ +from thehivecode import main + +main() diff --git a/templates/HIVE.md b/templates/HIVE.md new file mode 100644 index 0000000..dab77ab --- /dev/null +++ b/templates/HIVE.md @@ -0,0 +1,38 @@ +--- +# HIVE.md header. Copy this file to the root of your repo as HIVE.md. +# All fields are optional. Delete any line you are not using. +# Limits and meaning: https://thehivecode.ai/learn/hive-md +# +# The Hive Code reads only these fields, as plain text. It does not run +# them, follow them, or pass them to an agent as instructions. Keep the +# license in LICENSE. Lines starting with # are comments. + +# What it is, in one line. 10 to 120 characters. +tagline: Booking for barbers that texts the waitlist when a chair opens + +# Who it is for. 3 to 80 characters. +for: Barbers and small salons + +# The problem it solves. 10 to 200 characters. +problem: Chairs sit empty when a client cancels late + +# What help you want right now. Up to 200 characters. +help_wanted: A tester with a real shop, and someone for the waitlist texts + +# Commands to run it on your own computer. Up to 20 lines. +run: | + npm install + npm run dev + +# One-click deploy: vercel, netlify, or both. Delete the line if neither fits. +deploy: [vercel] +--- + +# Chair Alert + + + +Say more here in your own words: what it does today, what is next, and how to help. diff --git a/templates/examples/cli.md b/templates/examples/cli.md new file mode 100644 index 0000000..7bebcfc --- /dev/null +++ b/templates/examples/cli.md @@ -0,0 +1,29 @@ +--- +tagline: Print whether a shop is open, from a plain weekly hours file +for: Shop owners who keep hours in a text file +problem: A photo of a door sign is not something a phone can check at 8pm +help_wanted: Owners with split shifts, and a reviewer who cares about time zones +run: | + npm install + node bin/hours.js +--- + +# shop-hours + +An example HIVE.md for a command line tool. Not a live project. + +You keep a text file of weekly hours. The command prints open or closed for the time you give it. It does not call a network and it does not store customers. + +There is no one-click deploy target, so this file leaves `deploy` out. That is valid. The field is optional. + +What it does today: + +- Reads an hours file and prints open or closed + +What is next: + +- The cases an owner actually hits, such as a holiday or a day with two shifts + +How to help: + +- Send a real hours file that the tool gets wrong diff --git a/templates/examples/game.md b/templates/examples/game.md new file mode 100644 index 0000000..5b066ed --- /dev/null +++ b/templates/examples/game.md @@ -0,0 +1,29 @@ +--- +tagline: A tiny local puzzle about lighting a path of hexes +for: Someone who wants a short game in the browser +problem: The toy has three levels and no public list of what players want changed +help_wanted: A player who will name the unfair level, and a reviewer for art +run: | + npm install + npm run dev +--- + +# Hex Lamp + +An example HIVE.md for a game. Not a live project. + +Light a path from the entrance to the hive by flipping hexes. It runs in the browser and keeps the best score on this computer. There is no account. + +`deploy` is omitted. GitHub Pages and itch.io are not values the field accepts. The field is `vercel`, `netlify`, or both. + +What it does today: + +- One board and three levels + +What is next: + +- Level changes a player asks for, after a person accepts the suggestion and reviews the pull request + +How to help: + +- Play a level and describe the move where you got stuck diff --git a/templates/examples/web-app.md b/templates/examples/web-app.md new file mode 100644 index 0000000..1a494d2 --- /dev/null +++ b/templates/examples/web-app.md @@ -0,0 +1,29 @@ +--- +tagline: A sign-up sheet for Saturday runs, with who is coming +for: A running club and its members +problem: The club's sign-up lives in a chat thread and people miss the run +help_wanted: Someone who runs with a club and will try one Saturday with it +run: | + npm install + npm run dev +deploy: [vercel, netlify] +--- + +# Saturday Run Sheet + +An example HIVE.md for a web app. Not a live project. Copy the shape and replace the words. + +A one-page sign-up for a club's weekly run. Members see the meeting point and add a first name. Emails and phone numbers stay off the page. + +What it does today: + +- Lists this week's run and the first names already down +- Lets a member add or remove their own name + +What is next: + +- Whatever the club asks for in public, one suggestion at a time, after a maintainer accepts it + +How to help: + +- Use it on a real Saturday and say what was missing