diff --git a/.claude/skills/write-pipeline/SKILL.md b/.claude/skills/write-pipeline/SKILL.md index fdc62ffa..5a5c30c9 100644 --- a/.claude/skills/write-pipeline/SKILL.md +++ b/.claude/skills/write-pipeline/SKILL.md @@ -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 @@ -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 ` 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 ` 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. @@ -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. diff --git a/crates/hm-dsl-engine/harmont-py/tests/test_js.py b/crates/hm-dsl-engine/harmont-py/tests/test_js.py index e1126d9a..dd7f2797 100644 --- a/crates/hm-dsl-engine/harmont-py/tests/test_js.py +++ b/crates/hm-dsl-engine/harmont-py/tests/test_js.py @@ -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 # --------------------------------------------------------------------------- diff --git a/crates/hm/src/commands/init_templates/skill_convert_gha.md b/crates/hm/src/commands/init_templates/skill_convert_gha.md index cb1e9eb1..d3661533 100644 --- a/crates/hm/src/commands/init_templates/skill_convert_gha.md +++ b/crates/hm/src/commands/init_templates/skill_convert_gha.md @@ -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. diff --git a/crates/hm/src/commands/init_templates/skill_write_pipeline.md b/crates/hm/src/commands/init_templates/skill_write_pipeline.md index fdc62ffa..5a5c30c9 100644 --- a/crates/hm/src/commands/init_templates/skill_write_pipeline.md +++ b/crates/hm/src/commands/init_templates/skill_write_pipeline.md @@ -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 @@ -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 ` 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 ` 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. @@ -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.