Skip to content

Commit 80b729e

Browse files
docs: fix examples README, README TS imports, and init-template skills (schedule/npm/ruby/gha-404) (#131)
1 parent f1368ca commit 80b729e

5 files changed

Lines changed: 19 additions & 25 deletions

File tree

.claude/skills/write-pipeline/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
2929
Read it carefully. It covers correct vs. incorrect approaches, when to use toolchains vs. raw shell, and common anti-patterns.
3030

3131
2. If you need the full API reference for a specific toolchain or feature, fetch the relevant page (append `.md` to any docs.harmont.dev URL for raw Markdown):
32-
- Toolchain reference: `https://docs.harmont.dev/pipeline-sdk/reference/toolchains/<name>.md` (rust, python, npm, go, cmake, zig, elixir, ruby, etc.)
32+
- Toolchain reference: `https://docs.harmont.dev/pipeline-sdk/reference/toolchains/<name>.md` (rust, python, js, go, cmake, zig, elixir, etc.)
3333
- Chains and steps: `https://docs.harmont.dev/pipeline-sdk/reference/chains.md`
3434
- Triggers: `https://docs.harmont.dev/pipeline-sdk/reference/triggers.md`
3535
- Caching: `https://docs.harmont.dev/pipeline-sdk/reference/cache.md`
@@ -40,15 +40,15 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
4040
```
4141
WebFetch https://docs.harmont.dev/examples/<language>.md
4242
```
43-
Available examples: rust, go, cmake, zig, nextjs, python-uv, ruby, elixir
43+
Available examples: rust, go, cmake, zig, nextjs, python-uv, elixir
4444

4545
## Procedure
4646

47-
1. **Identify the project's language and build system.** Look at the project root for `Cargo.toml` (Rust), `package.json` (JS/TS), `pyproject.toml` or `setup.py` (Python), `go.mod` (Go), `CMakeLists.txt` (C/C++), `mix.exs` (Elixir), `build.zig` (Zig), `Gemfile` (Ruby).
47+
1. **Identify the project's language and build system.** Look at the project root for `Cargo.toml` (Rust), `package.json` (JS/TS), `pyproject.toml` or `setup.py` (Python), `go.mod` (Go), `CMakeLists.txt` (C/C++), `mix.exs` (Elixir), `build.zig` (Zig).
4848

4949
2. **Check for an existing pipeline.** Look for `.hm/pipeline.py` or `.hm/pipeline.ts`. If none exists, pick the DSL that matches the project's ecosystem before asking the user to confirm:
5050
- **TypeScript DSL** if the project already has `package.json`, `tsconfig.json`, or is primarily TypeScript/JavaScript (the team is already comfortable with the TS toolchain).
51-
- **Python DSL** for everything else — Rust, Go, C/C++, Elixir, Zig, Ruby, Python, or mixed-language projects (Python is the simpler, more universal choice).
51+
- **Python DSL** for everything else — Rust, Go, C/C++, Elixir, Zig, Python, or mixed-language projects (Python is the simpler, more universal choice).
5252
- Present your recommendation and rationale, then let the user override if they prefer the other DSL.
5353
Then either run `hm init --template <kind>` to scaffold or write the pipeline file directly.
5454

@@ -57,7 +57,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
5757
4. **Write or modify the pipeline.** Follow the patterns guide strictly:
5858
- Prefer toolchains over raw `sh()` calls when a toolchain exists for the language.
5959
- Use `.fork()` for steps that can run in parallel.
60-
- Set triggers (`push`, `pull_request`, `schedule`) appropriate to the project.
60+
- Set triggers (`push`, `pull_request`) appropriate to the project.
6161
- Use `default_image: "ubuntu:24.04"` unless the project needs something specific.
6262
- Set `env: {"CI": "true"}` on the pipeline.
6363

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def ci(project: hm.Target[PythonToolchain]) -> tuple[hm.Step, ...]:
132132
<summary><b>TypeScript</b></summary>
133133

134134
```typescript
135-
import { pipeline, push, type PipelineDefinition } from "harmont";
136-
import { python } from "harmont/toolchains";
135+
import { pipeline, push, type PipelineDefinition } from "@harmont/hm";
136+
import { python } from "@harmont/hm/toolchains";
137137

138138
const project = python({ path: "." });
139139

crates/hm/src/commands/init_templates/skill_convert_gha.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ Convert existing GitHub Actions workflows (`.github/workflows/*.yml` / `*.yaml`)
3131
WebFetch https://docs.harmont.dev/pipeline-sdk/patterns.md
3232
```
3333

34-
3. **Fetch the GHA migration example** if available:
35-
```
36-
WebFetch https://docs.harmont.dev/examples/github-actions.md
37-
```
38-
3934
## Procedure
4035

4136
1. **Inventory the GHA workflows.** For each `.yml` file, note:
42-
- Workflow name and trigger events (`on: push`, `on: pull_request`, `on: schedule`, etc.)
37+
- Workflow name and trigger events (`on: push`, `on: pull_request`, etc.; note any `on: schedule` — see the mapping table for why scheduled triggers don't map to a local pipeline)
4338
- Each job: its name, `runs-on`, and what it does
4439
- Dependencies between jobs (`needs:`)
4540
- Services used (`services:`)
@@ -53,11 +48,11 @@ Convert existing GitHub Actions workflows (`.github/workflows/*.yml` / `*.yaml`)
5348
| GHA concept | Harmont equivalent | Notes |
5449
|---|---|---|
5550
| `on: push` / `on: pull_request` | `push` / `pull_request` triggers | Direct mapping — same semantics |
56-
| `on: schedule` (cron) | `schedule` trigger | Direct mapping |
51+
| `on: schedule` (cron) | No local DSL trigger | Scheduled pipelines are a Harmont Cloud concern, not a local pipeline trigger; omit the schedule or configure it in cloud. |
5752
| `jobs.<id>.steps` | Chain of toolchain calls or `sh()` | Each meaningful step becomes a Harmont step |
5853
| `jobs.<id>.needs` | `.fork()` for parallel, sequential chain for dependencies | Harmont DAG is implicit from chain structure |
5954
| `actions/cache` | **Not needed — caching is implicit in Harmont** | Harmont automatically caches build artifacts, dependency installs, and toolchain outputs between runs. Remove all cache steps. |
60-
| `actions/setup-*` (setup-node, setup-python, etc.) | Harmont toolchains (`hm.npm`, `hm.python`, etc.) | Toolchains handle installation. Specify version via toolchain config. |
55+
| `actions/setup-*` (setup-node, setup-python, etc.) | Harmont toolchains (`hm.js`, `hm.python`, etc.) | Toolchains handle installation. Specify version via toolchain config. |
6156
| `actions/checkout` | **Not needed — source is always available** | Harmont automatically provides the source code to every step. |
6257
| `runs-on: ubuntu-latest` | `default_image: "ubuntu:24.04"` | Harmont runs steps in Docker containers |
6358
| `services:` (e.g., postgres) | Service containers in step config | Check docs for service container syntax |
@@ -69,7 +64,7 @@ Convert existing GitHub Actions workflows (`.github/workflows/*.yml` / `*.yaml`)
6964
3. **Be honest about differences.** After presenting the mapping, explain:
7065
- **What's simpler:** Caching is implicit — no `actions/cache` boilerplate. No `actions/checkout` needed. Toolchains replace `actions/setup-*` with cleaner configuration.
7166
- **What's different:** Matrix strategies don't have a direct equivalent — you may need multiple pipeline definitions or `.fork()`. Service containers have different syntax. Complex `if:` conditionals become DSL-level control flow.
72-
- **What's a real gap:** Only mention a gap if functionality genuinely cannot be replicated. Do NOT invent problems — most GHA workflows map cleanly. Common real gaps: GHA marketplace actions that have no Harmont toolchain equivalent (use `sh()` with the underlying commands instead), GitHub-specific features like `github.event` context or `GITHUB_TOKEN` permissions.
67+
- **What's a real gap:** Only mention a gap if functionality genuinely cannot be replicated. Do NOT invent problems — most GHA workflows map cleanly. Common real gaps: `on: schedule` cron triggers (the local DSL has only `push`/`pull_request`; scheduled runs are a Harmont Cloud concern), GHA marketplace actions that have no Harmont toolchain equivalent (use `sh()` with the underlying commands instead), GitHub-specific features like `github.event` context or `GITHUB_TOKEN` permissions.
7368

7469
4. **Delegate to the `write-pipeline` skill.** Once the user understands the mapping, invoke the `write-pipeline` skill to create the actual Harmont pipeline. Tell it:
7570
- What language/build system the project uses (detected from the GHA workflow)

crates/hm/src/commands/init_templates/skill_write_pipeline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
2929
Read it carefully. It covers correct vs. incorrect approaches, when to use toolchains vs. raw shell, and common anti-patterns.
3030

3131
2. If you need the full API reference for a specific toolchain or feature, fetch the relevant page (append `.md` to any docs.harmont.dev URL for raw Markdown):
32-
- Toolchain reference: `https://docs.harmont.dev/pipeline-sdk/reference/toolchains/<name>.md` (rust, python, npm, go, cmake, zig, elixir, etc.)
32+
- Toolchain reference: `https://docs.harmont.dev/pipeline-sdk/reference/toolchains/<name>.md` (rust, python, js, go, cmake, zig, elixir, etc.)
3333
- Chains and steps: `https://docs.harmont.dev/pipeline-sdk/reference/chains.md`
3434
- Triggers: `https://docs.harmont.dev/pipeline-sdk/reference/triggers.md`
3535
- Caching: `https://docs.harmont.dev/pipeline-sdk/reference/cache.md`
@@ -57,7 +57,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
5757
4. **Write or modify the pipeline.** Follow the patterns guide strictly:
5858
- Prefer toolchains over raw `sh()` calls when a toolchain exists for the language.
5959
- Use `.fork()` for steps that can run in parallel.
60-
- Set triggers (`push`, `pull_request`, `schedule`) appropriate to the project.
60+
- Set triggers (`push`, `pull_request`) appropriate to the project.
6161
- Use `default_image: "ubuntu:24.04"` unless the project needs something specific.
6262
- Set `env: {"CI": "true"}` on the pipeline.
6363

examples/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# Harmont examples
22

3-
Minimal idiomatic starter projects, each wired up to a Harmont CI pipeline. Every example lives in its own subdirectory with a `.hm/pipeline.py` you can read, copy, and run via `hm run <slug> --local`.
3+
Minimal idiomatic starter projects, each wired up to a Harmont CI pipeline. Every example lives in its own subdirectory with a `.hm/pipeline.py` you can read, copy, and run via `hm run <slug>`.
44

55
| Example | Toolchain | Pipeline |
66
|---|---|---|
7-
| [react](./react) | npm + Vite + Vitest + ESLint | `hm.npm(...)` |
8-
| [nextjs](./nextjs) | npm + Jest + ESLint | `hm.npm(...)` |
9-
| [typescript](./typescript) | tsc + Vitest + ESLint | `hm.npm(...)` |
10-
| [bun](./bun) | Bun + tsc + bun:test + ESLint | `hm.bun(...)` |
7+
| [react](./react) | npm + Vite + Vitest + ESLint | `hm.js.project(...)` |
8+
| [nextjs](./nextjs) | npm + Jest + ESLint | `hm.js.project(...)` |
9+
| [typescript](./typescript) | tsc + Vitest + ESLint | `hm.js.project(...)` |
10+
| [bun](./bun) | Bun + tsc + bun:test + ESLint | `hm.js.project(runtime="bun")` |
1111
| [rust](./rust) | cargo + clippy + rustfmt | `hm.rust(...)` |
1212
| [python-uv](./python-uv) | uv + pytest + ruff + mypy | `hm.python(...)` |
1313
| [go](./go) | go build/test/vet/fmt | `hm.go(...)` |
1414
| [c](./c) | CMake + CTest + clang-format | `hm.cmake(lang="c")` |
1515
| [cpp](./cpp) | CMake + CTest + clang-format | `hm.cmake(lang="cpp")` |
16-
| [ruby](./ruby) | Bundler + RSpec + Rubocop | `hm.ruby(...)` |
1716
| [zig](./zig) | zig build/test/fmt | `hm.zig(version="0.13.0")` |
1817

1918
## How to run an example locally
2019

2120
1. Install the Harmont CLI (`cli/` in this repo, or `cargo install harmont-cli` once published).
22-
2. `cd examples/<lang>` and run `hm run ci --local`. The CLI uses the project's `.hm/pipeline.py` and executes each step in a local Docker container, sharing caches across runs.
21+
2. `cd examples/<lang>` and run `hm run ci`. The CLI uses the project's `.hm/pipeline.py` and executes each step in a local Docker container (the default backend), sharing caches across runs. Use `--backend cloud` to submit the run to Harmont Cloud instead.
2322

2423
Every pipeline uses `default_image="ubuntu:24.04"` and the apt-base / language-install steps are cached forever — only the action leaves (`test`, `lint`, etc.) re-run after a code change.
2524

0 commit comments

Comments
 (0)