Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/polyscribe.yml
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- main
- cursor/**
pull_request:
branches:
- main
- cursor/**

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Typecheck
run: pnpm typecheck

- name: Lint
run: pnpm lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.turbo
.env
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
onlyBuiltDependencies[]=esbuild
43 changes: 43 additions & 0 deletions .polyscribe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PolyScribe configuration for this repository.
# See docs/configuration.md for the full reference.

changelogPath: CHANGELOG.md
tone: developer-friendly

# requireApprover: true
# autoPublish: false
# includeUnreleased: false

# publishTargets:
# - github-release
# - changelog-pr

# ignoreGlobs:
# - "**/package-lock.json"
# - "**/pnpm-lock.yaml"
# - "**/yarn.lock"
# - "**/bun.lockb"
# - "**/dist/**"
# - "**/generated/**"

# monorepoRoots: []
# includeCommittersWithoutPr: true
# maxDiffBytesPerFile: 20000
# maxTotalDiffBytes: 400000

# sections:
# order:
# - summary
# - breaking
# - features
# - fixes
# - perf
# - security
# - docs
# - chore
# - migration
# - credits

# llm:
# provider: openai
# model: gpt-4.1
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

All notable changes to PolyScribe will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- `polyscribe changelog --unreleased` to update only the `[Unreleased]` section
- Citation validation retry: one automatic LLM repair pass before failing
- `polyscribe publish` defaults `--notes` to `RELEASE.md`
- `polyscribe sources` command with `--json`, `--pretty`, and `--count`
- `polyscribe changelog --dry-run`, `--date`, and `--notes` (skip LLM)
- `polyscribe draft --sources-only` / `--no-llm` for ingestion-only output
- GitHub Releases API via `polyscribe publish` (`--update`, `--draft`, `--prerelease`)
- Semver heuristics with `{ level, reasons }` and conventional commit detection
- Linked issue parsing from PR bodies (`Fixes #123`, etc.)
- Octokit retry/throttling for GitHub API rate limits
- Git integration tests, citation tests, and release API tests (65 total)
- CI workflow, docs (`docs/cli.md`, `docs/configuration.md`), and npm publish metadata

## [0.1.0] - 2026-07-11

### Added

- Initial open-source release of `@polyscribe/core` and `@polyscribe/cli`
- Git-native source ingestion: commits, PR metadata (with `GITHUB_TOKEN`), and diffs
- AI-powered `draft` command with structured release note sections and semver heuristics
- `changelog` command with Keep a Changelog merge via `--write`
- Configuration via `.polyscribe.yml` and `.github/polyscribe.yml` (deep-merged)
- `config init`, `validate-config`, and `doctor` preflight commands
- OpenAI and Anthropic LLM providers with configurable models
- Secret redaction, diff size limits, and citation validation in the draft pipeline
- Monorepo scaffold (pnpm + Turborepo), unit tests, and GitHub Actions CI

[Unreleased]: https://github.com/LatticeAG/PolyScribe/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/LatticeAG/PolyScribe/releases/tag/v0.1.0
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 LatticeAG

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.
120 changes: 120 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# PolyScribe

[![CI](https://github.com/LatticeAG/PolyScribe/actions/workflows/ci.yml/badge.svg)](https://github.com/LatticeAG/PolyScribe/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
[![npm @polyscribe/cli](https://img.shields.io/npm/v/@polyscribe/cli.svg)](https://www.npmjs.com/package/@polyscribe/cli)

PolyScribe is a GitHub-native release editor: it ingests commits, PRs, and diffs for a ref range, drafts polished release notes and changelog sections, and supports human approve → publish.

## OSS-first

This repository is **open-source first**. `@polyscribe/core` and `@polyscribe/cli` are MIT-licensed and fully usable offline with your own LLM key or local model. Hosted SaaS and self-host options build on the same foundations.

## Quick start

### Install

```bash
# npm (after publish)
npm install -g @polyscribe/cli

# or run without installing
npx @polyscribe/cli --help
```

### One-time setup

```bash
polyscribe config init
export OPENAI_API_KEY=sk-... # or ANTHROPIC_API_KEY
export GITHUB_TOKEN=ghp_... # optional — enriches with PR metadata
```

### Preflight

```bash
polyscribe doctor
polyscribe validate-config
```

### Draft release notes

```bash
polyscribe draft --from v0.1.0 --to HEAD
polyscribe draft --from v0.1.0 --to HEAD --output RELEASE.md
polyscribe draft --tone technical --json --output draft.json
```

### Update changelog

```bash
polyscribe changelog --from v0.1.0 --to HEAD
polyscribe changelog --version 0.2.0 --write
polyscribe changelog --version 0.2.0 --dry-run
polyscribe changelog --version 0.2.0 --write --notes RELEASE.md
```

### Debug sources

```bash
polyscribe sources --from v0.1.0 --to HEAD
polyscribe sources --from v0.1.0 --to HEAD --pretty
polyscribe sources --count
```

### Publish to GitHub

```bash
polyscribe publish --version v0.2.0 --notes RELEASE.md
polyscribe publish --version v0.2.0 --notes RELEASE.md --update
```

### Development (this repo)

```bash
pnpm install && pnpm build
node packages/cli/dist/index.js config --init
```

## Environment variables

| Variable | Required | Purpose |
|----------|----------|---------|
| `OPENAI_API_KEY` | One of the LLM keys | OpenAI draft generation |
| `ANTHROPIC_API_KEY` | One of the LLM keys | Anthropic draft generation |
| `POLYSCRIBE_LLM_PROVIDER` | No | Force `openai` or `anthropic` |
| `GITHUB_TOKEN` | No (required for `publish`) | Enrich ingestion with PR metadata; create GitHub Releases |

## Packages

| Package | Description |
|---------|-------------|
| [`@polyscribe/core`](./packages/core) | Core library — parsing, drafting, and release logic |
| [`@polyscribe/cli`](./packages/cli) | Command-line interface (`polyscribe`) |

Published packages include a `prepublishOnly` script that runs `pnpm build` before npm publish. The root workspace package is private and is not published.

## Documentation

- [CLI reference](./docs/cli.md) — all commands, options, and exit codes
- [Configuration](./docs/configuration.md) — `.polyscribe.yml` schema
- [Self-hosting](./docs/self-hosting.md) — OSS CLI setup; server coming later
- [SPEC](./SPEC.md) — product and implementation specification

## Development

Requires **Node.js 22+** and **pnpm 10+**.

```bash
pnpm install
pnpm build
pnpm test
pnpm lint
pnpm typecheck
```

CI runs the same checks on push and pull requests to `main` and `cursor/*`.

## License

MIT — see [LICENSE](./LICENSE).
Loading
Loading