You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/write-pipeline/SKILL.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
29
29
Read it carefully. It covers correct vs. incorrect approaches, when to use toolchains vs. raw shell, and common anti-patterns.
30
30
31
31
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):
Available examples: rust, go, cmake, zig, nextjs, python-uv, ruby, elixir
43
+
Available examples: rust, go, cmake, zig, nextjs, python-uv, elixir
44
44
45
45
## Procedure
46
46
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).
48
48
49
49
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:
50
50
-**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).
52
52
- Present your recommendation and rationale, then let the user override if they prefer the other DSL.
53
53
Then either run `hm init --template <kind>` to scaffold or write the pipeline file directly.
54
54
@@ -57,7 +57,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
57
57
4.**Write or modify the pipeline.** Follow the patterns guide strictly:
58
58
- Prefer toolchains over raw `sh()` calls when a toolchain exists for the language.
59
59
- 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.
61
61
- Use `default_image: "ubuntu:24.04"` unless the project needs something specific.
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)
|`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.|
57
52
|`jobs.<id>.steps`| Chain of toolchain calls or `sh()`| Each meaningful step becomes a Harmont step |
58
53
|`jobs.<id>.needs`|`.fork()` for parallel, sequential chain for dependencies | Harmont DAG is implicit from chain structure |
59
54
|`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. |
61
56
|`actions/checkout`|**Not needed — source is always available**| Harmont automatically provides the source code to every step. |
62
57
|`runs-on: ubuntu-latest`|`default_image: "ubuntu:24.04"`| Harmont runs steps in Docker containers |
63
58
|`services:` (e.g., postgres) | Service containers in step config | Check docs for service container syntax |
3.**Be honest about differences.** After presenting the mapping, explain:
70
65
-**What's simpler:** Caching is implicit — no `actions/cache` boilerplate. No `actions/checkout` needed. Toolchains replace `actions/setup-*` with cleaner configuration.
71
66
-**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.
73
68
74
69
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:
75
70
- What language/build system the project uses (detected from the GHA workflow)
Copy file name to clipboardExpand all lines: crates/hm/src/commands/init_templates/skill_write_pipeline.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth
29
29
Read it carefully. It covers correct vs. incorrect approaches, when to use toolchains vs. raw shell, and common anti-patterns.
30
30
31
31
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):
Copy file name to clipboardExpand all lines: examples/README.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,24 @@
1
1
# Harmont examples
2
2
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>`.
4
4
5
5
| Example | Toolchain | Pipeline |
6
6
|---|---|---|
7
-
|[react](./react)| npm + Vite + Vitest + ESLint |`hm.npm(...)`|
8
-
|[nextjs](./nextjs)| npm + Jest + ESLint |`hm.npm(...)`|
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.
23
22
24
23
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.
0 commit comments