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
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,33 @@ on:
branches: [main]
pull_request:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
# Fast, static checks first; most mistakes stop here before any test runs.
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- run: bun run format:check
- run: bun run lint
- run: bun run typecheck
- run: bun run knip
- run: bun run build
- name: Run the bundled CLI under Node
run: node dist/index.mjs --version

test:
needs: static
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/setup

- run: bun run lint
- run: bun run typecheck
- run: bun run test
- run: bun run build

- name: Run the bundled CLI under Node
run: node dist/index.mjs --version
5 changes: 5 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"ignorePatterns": ["bun.lock"]
}
47 changes: 47 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import", "node", "vitest"],
"categories": {
"correctness": "error",
"suspicious": "error",
"perf": "error"
},
"rules": {
"typescript/no-floating-promises": "error",
"typescript/no-misused-promises": "error",
"typescript/await-thenable": "error",
"typescript/require-await": "error",
"typescript/switch-exhaustiveness-check": "error",
"typescript/no-unnecessary-condition": [
"error",
{
"allowConstantLoopConditions": "only-allowed-literals"
}
],
"typescript/no-unnecessary-type-assertion": "error",
"typescript/restrict-template-expressions": "error",
"typescript/prefer-nullish-coalescing": [
"error",
{
"ignorePrimitives": {
"string": true
}
}
],
"typescript/no-explicit-any": "error",
"typescript/no-non-null-assertion": "error",
"typescript/consistent-type-imports": "error",
"import/no-commonjs": "error",
"import/no-cycle": "error",
"eslint/no-console": "off",
"eslint/no-await-in-loop": "off",
"oxc/no-map-spread": "off",
"vitest/valid-expect": [
"error",
{
"maxArgs": 2
}
]
},
"ignorePatterns": ["dist", ".scratch"]
}
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ syncode is a TypeScript CLI, published to npm, that links AI coding agents' inst

- Package manager: bun. Runtime: Node >= 22.12 for the published CLI, >= 22.18 to run from source.
- `bun run dev -- <command>`: run from source with Node's type stripping.
- `bun run check`: lint (Biome), typecheck (`tsc`), test (Vitest), build (tsdown). Run before pushing.
- `bun run check`: format check (oxfmt), type-aware lint (oxlint), typecheck (`tsc`), unused code (knip), tests (Vitest), build (tsdown). Run before pushing; `bun run format` fixes formatting.

## Layout

Expand All @@ -21,6 +21,7 @@ syncode is a TypeScript CLI, published to npm, that links AI coding agents' inst

- Only Node built-ins plus `@clack/prompts`. Prefer data over per-agent classes.
- Never prompt when stdin or stdout isn't a TTY; keep the local file and report it instead.
- Expected failures throw `UserError` (printed without a stack). No `require`: the bundle is ESM.
- Test through the CLI boundary in `tests/`. Don't export internals or add flags just for tests.
- Expected failures throw `UserError` (printed without a stack). No `require`: the bundle is ESM (enforced by `import/no-commonjs`).
- Prefer static checks over tests: if a type, a lint rule or knip can catch a mistake, use that. Tests are for behavior only the real CLI can show (filesystem effects, non-interactive fallbacks, migration).
- Test through the CLI boundary in `tests/`, asserting on filesystem state and `status --json`, not log text. Don't export internals or add flags just for tests.
- Comments explain why, not what.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ bun run dev -- --help
## Before opening a pull request

```bash
bun run check # lint, typecheck, test, build
bun run format # fix formatting
bun run check # format check, lint, typecheck, knip, test, build
```

[AGENTS.md](AGENTS.md) describes the layout and conventions. To support a new agent, add an entry to `src/agents.ts` and the README table, with a link to the docs showing where it reads instructions and skills.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Keep your AI coding agents' instructions, skills and config files in one git repo, and link them into every agent on every machine.

- **One set of instructions** for Claude Code (`CLAUDE.md`), Codex and OpenCode (`AGENTS.md`) and Gemini CLI (`GEMINI.md`), with optional per-OS and per-machine parts.
- **One skills folder** linked into `~/.agents/skills` (Codex, OpenCode, Gemini CLI, Cursor, Copilot CLI) and `~/.claude/skills`.
- **Only what you choose.** Config files are synced only after you `adopt` them, and credentials like `auth.json` are refused, so sessions, caches and tokens never reach git.
Expand Down Expand Up @@ -75,6 +76,7 @@ If a local file differs from the repo copy, `apply` asks whether to keep it, rep
## Upgrading from 1.x

Run `syncode init`. It detects the 1.x config and:

1. Replaces the 1.x whole-folder symlinks (such as `~/.config/opencode`) with real copies, so every agent keeps working.
2. Moves `.agents/skills/*` to `skills/`, and takes the first `AGENTS.md` or `CLAUDE.md` it finds in `configs/` as `instructions/AGENTS.md`.
3. Links everything the 2.0 way.
Expand All @@ -86,7 +88,7 @@ The 1.x `configs/` folder stays in the repo. `syncode adopt` the files you want
```bash
bun install
bun run dev -- status # run from source (Node >= 22.18)
bun run check # lint, typecheck, test, build
bun run check # format, lint, typecheck, knip, test, build
```

See [AGENTS.md](AGENTS.md) for how the code is organized.
Expand Down
45 changes: 0 additions & 45 deletions biome.json

This file was deleted.

Loading
Loading