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
12 changes: 4 additions & 8 deletions .claude/skills/write-pipeline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: write-pipeline
description: Write or modify Harmont CI pipelines. Use when creating new pipelines, adding/removing steps, switching toolchains, customizing caching/triggers, or when the user asks to set up CI with Harmont. Fetches live documentation from docs.harmont.dev for up-to-date API reference.
---

Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Python) or `.hm/pipeline.ts` (TypeScript). Pipelines are real programs that import the `harmont` SDK and declaratively define build steps, triggers, and caching.
Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py`. Pipelines are real Python programs that import the `harmont` SDK and declaratively define build steps, triggers, and caching.

## When to use

Expand Down Expand Up @@ -46,11 +46,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth

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).

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:
- **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).
- **Python DSL** for everything else — Rust, Go, C/C++, Elixir, Zig, Python, or mixed-language projects (Python is the simpler, more universal choice).
- Present your recommendation and rationale, then let the user override if they prefer the other DSL.
Then either run `hm init --template <kind>` to scaffold or write the pipeline file directly.
2. **Check for an existing pipeline.** Look for `.hm/pipeline.py`. If none exists, run `hm init --template <kind>` to scaffold or write the pipeline file directly.

3. **Fetch the relevant documentation** (see "Before you start" above). Always fetch the patterns guide first. Then fetch the toolchain reference for the detected language.

Expand Down Expand Up @@ -101,7 +97,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth

- **Always fetch documentation before writing pipelines.** The SDK evolves; do not rely on memorized API surfaces. The `.md` suffix on any docs.harmont.dev URL returns raw Markdown suitable for reading.
- **Prefer toolchains over raw shell.** The patterns guide explains why. Only use `hm.sh()` / `sh()` for custom commands that no toolchain covers.
- Pipelines live in `.hm/pipeline.py` or `.hm/pipeline.ts` — never both in the same project.
- Pipelines live in `.hm/pipeline.py`.
- `hm run` is the ONLY correct way to validate a pipeline locally. Do NOT try to run pipeline steps manually.
- The Python DSL uses decorators (`@hm.pipeline`). The TypeScript DSL uses an exported `PipelineDefinition[]` array with `export default`.
- The DSL uses decorators (`@hm.pipeline`, `@hm.target`).
- Do NOT file GitHub issues without the user's explicit permission.
2 changes: 1 addition & 1 deletion crates/hm-dsl-engine/harmont-py/tests/test_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_skips_detection_when_pm_set(self, tmp_path) -> None:


# ---------------------------------------------------------------------------
# Corepack version pin (parity with the TypeScript DSL)
# Corepack version pin
# ---------------------------------------------------------------------------


Expand Down
2 changes: 1 addition & 1 deletion crates/hm/src/commands/init_templates/skill_convert_gha.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Convert existing GitHub Actions workflows (`.github/workflows/*.yml` / `*.yaml`)
| `matrix:` | Multiple pipelines or parameterized steps | No direct matrix — may need separate pipeline definitions or `.fork()` |
| `env:` / `secrets.*` | `env: {}` on pipeline or step | Secrets must be passed as environment variables |
| `actions/upload-artifact` / `actions/download-artifact` | Step outputs and DAG dependencies | Harmont passes outputs between steps via the DAG |
| `if:` conditionals | Pipeline-level logic (Python/TS) | Use the DSL's native control flow |
| `if:` conditionals | Pipeline-level logic (Python) | Use the DSL's native control flow |

3. **Be honest about differences.** After presenting the mapping, explain:
- **What's simpler:** Caching is implicit — no `actions/cache` boilerplate. No `actions/checkout` needed. Toolchains replace `actions/setup-*` with cleaner configuration.
Expand Down
12 changes: 4 additions & 8 deletions crates/hm/src/commands/init_templates/skill_write_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: write-pipeline
description: Write or modify Harmont CI pipelines. Use when creating new pipelines, adding/removing steps, switching toolchains, customizing caching/triggers, or when the user asks to set up CI with Harmont. Fetches live documentation from docs.harmont.dev for up-to-date API reference.
---

Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Python) or `.hm/pipeline.ts` (TypeScript). Pipelines are real programs that import the `harmont` SDK and declaratively define build steps, triggers, and caching.
Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py`. Pipelines are real Python programs that import the `harmont` SDK and declaratively define build steps, triggers, and caching.

## When to use

Expand Down Expand Up @@ -46,11 +46,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth

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).

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:
- **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).
- **Python DSL** for everything else — Rust, Go, C/C++, Elixir, Zig, Python, or mixed-language projects (Python is the simpler, more universal choice).
- Present your recommendation and rationale, then let the user override if they prefer the other DSL.
Then either run `hm init --template <kind>` to scaffold or write the pipeline file directly.
2. **Check for an existing pipeline.** Look for `.hm/pipeline.py`. If none exists, run `hm init --template <kind>` to scaffold or write the pipeline file directly.

3. **Fetch the relevant documentation** (see "Before you start" above). Always fetch the patterns guide first. Then fetch the toolchain reference for the detected language.

Expand Down Expand Up @@ -101,7 +97,7 @@ Write, modify, or extend Harmont CI pipelines defined in `.hm/pipeline.py` (Pyth

- **Always fetch documentation before writing pipelines.** The SDK evolves; do not rely on memorized API surfaces. The `.md` suffix on any docs.harmont.dev URL returns raw Markdown suitable for reading.
- **Prefer toolchains over raw shell.** The patterns guide explains why. Only use `hm.sh()` / `sh()` for custom commands that no toolchain covers.
- Pipelines live in `.hm/pipeline.py` or `.hm/pipeline.ts` — never both in the same project.
- Pipelines live in `.hm/pipeline.py`.
- `hm run` is the ONLY correct way to validate a pipeline locally. Do NOT try to run pipeline steps manually.
- The Python DSL uses decorators (`@hm.pipeline`). The TypeScript DSL uses an exported `PipelineDefinition[]` array with `export default`.
- The DSL uses decorators (`@hm.pipeline`, `@hm.target`).
- Do NOT file GitHub issues without the user's explicit permission.
Loading