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
46 changes: 46 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# AGENTS.md — versioner-github-action

TypeScript GitHub Action that sends build/deployment events to the Versioner API. Node 20, `@actions/core`, Axios.

## Cross-repo context

This repo is one of the Versioner app repos.

1. Resolve `versioner-workspace` (nested parent **or** sibling — see that repo's `docs/agent/ECOSYSTEM.md` layout discovery).
2. Read:
- `docs/agent/ECOSYSTEM.md` (routing / which repo)
- `docs/agent/CONVENTIONS.md` (branches, PRs, commits)
3. Then follow **this file** for repo-local setup, test, and architecture.

Do **not** use `versioner-dev-docs`, kanban-markdown feature trees, or machine-specific paths like `/Users/phil...`.


## Build & test

```bash
just setup_local_dev # npm install
just build # ncc → dist/index.js (committed bundle)
just run_tests # Jest (80% coverage threshold)
just test_coverage
just lint # ESLint strict
just format # Prettier
just ci # format → lint → build → test
```

**`dist/` is committed** (required for GitHub Actions consumption). Rebuild and commit dist when source changes.

## Architecture

- `src/index.ts` — entry; routes build vs deployment by `event_type`
- `src/inputs.ts` — input validation (action inputs / env)
- `src/api-client.ts` — Versioner HTTP client; preflight rejections 409/423/428
- `src/github-context.ts` — repo/SHA/branch/actor/workflow; `vi_gh_` env capture
- `src/types.ts` — payloads/responses
- `action.yml` — inputs/outputs

## Local conventions

- Follow existing patterns
- Blank lines must be completely empty
- Add tests for new behavior; pass before PR
- Prefer editing existing files over creating new ones
40 changes: 5 additions & 35 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,10 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Follow **[AGENTS.md](./AGENTS.md)** in this repository (authoritative for Claude Code and other agents).

## What This Is
Global Versioner rules live in the `versioner-workspace` spine:

Versioner GitHub Action - a TypeScript GitHub Action that sends build and deployment events to the Versioner API. Node.js 20, @actions/core, Axios.
- `docs/agent/ECOSYSTEM.md` — routing
- `docs/agent/CONVENTIONS.md` — universal process


## Build & Test Commands

All commands use `just` (run `just` to list all):

```bash
just setup_local_dev # npm install
just build # ncc build to dist/index.js (self-contained bundle)
just run_tests # Jest (80% coverage threshold)
just test_coverage # Jest with coverage report
just lint # ESLint (strict: explicit return types, no any)
just format # Prettier
just ci # format -> lint -> build -> test
```

The `dist/` directory is committed (GitHub Actions requires it).

## Architecture

- `src/index.ts` - Entry point; routes to build or deployment event handling based on `event_type` input
- `src/inputs.ts` - Input validation and parsing (from GitHub Actions inputs or env vars)
- `src/api-client.ts` - HTTP client for Versioner API with error handling for preflight rejections (409, 423, 428)
- `src/github-context.ts` - Extracts GitHub metadata (repo, SHA, branch, actor, workflow URL) and auto-captures env vars with `vi_gh_` prefix
- `src/types.ts` - TypeScript interfaces for payloads and responses
- `action.yml` - Action definition with inputs/outputs

## Conventions

- Follow existing code patterns and style
- Blank lines must be completely empty (no whitespace-only lines)
- Add tests for new features; ensure tests pass before committing
- Prefer editing existing files over creating new ones
Resolve the workspace as a **parent** directory (nested Mac layout) or **sibling** directory (Hermes layout).
Loading