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
88 changes: 88 additions & 0 deletions .claude/rules/nix-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Nix Workflow

This rule provides guidance on Nix usage in the StackOne SDK.
Comment on lines +1 to +3
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new nix-workflow.md file is missing the YAML frontmatter that other rule files in this directory include. Add frontmatter with 'description' and 'alwaysApply' fields to maintain consistency with other rules like development-workflow.md and pnpm-usage.md.

Copilot uses AI. Check for mistakes.

## Development Environment

The project uses `flake.nix` to define the development environment with `nix develop`.

### Adding Development Tools

To add a new tool to the development environment, add it to `buildInputs` in `flake.nix`:

```nix
buildInputs = with pkgs; [
# runtime
nodejs_24
pnpm_10

# formatting and linting tools
oxlint # includes tsgolint
oxfmt

# your new tool here
new-tool
];
```

## CI Workflow

CI uses `nix profile install` via the `.github/actions/setup-nix/action.yaml` composite action.

### Adding Tools to CI Jobs

Specify tools in the `tools` input of the setup-nix action:

```yaml
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
tools: nodejs_24 pnpm_10 oxlint oxfmt
```

The action installs packages using:

```bash
nix profile install --inputs-from . nixpkgs#tool1 nixpkgs#tool2
```

### CI Tool Configuration

- **Default tools**: `nodejs_24 pnpm_10` (defined in action.yaml)
- **Skip pnpm install**: Set `skip-pnpm-install: 'true'` for jobs that don't need node dependencies

### Example: Adding a New Tool to Lint Job

```yaml
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
tools: nodejs_24 pnpm_10 oxlint oxfmt new-tool
- name: Run Lint
run: pnpm run lint
```

## Build Flags

Always use these flags when running Nix build commands locally:

```bash
--print-build-logs --show-trace
```

Example:

```bash
nix build --print-build-logs --show-trace
nix flake check --print-build-logs --show-trace
```

## Notes

- Some packages bundle multiple tools (e.g., `oxlint` includes `tsgolint`)
- Check nixpkgs for package contents before adding redundant dependencies
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
tools: nodejs_24 pnpm_10 oxlint oxfmt similarity nixfmt tsgolint
tools: nodejs_24 pnpm_10 oxlint oxfmt
- name: Run Lint
run: pnpm run lint

Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
| **pnpm-usage** | All files | pnpm commands and troubleshooting |
| **git-workflow** | All files | Commit conventions, branch strategy, PR guidelines |
| **development-workflow** | All files | Code style, file naming, project conventions |
| **nix-workflow** | All files | Nix development environment and CI setup |
| **typescript-patterns** | `**/*.ts` | Type safety, exhaustiveness checks, clean code |
| **typescript-testing** | `**/*.test.ts` | Vitest, MSW mocking, fs-fixture |
| **file-operations** | `**/*.ts` | Native fetch API patterns and error handling |
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
# formatting and linting tools
similarity
nixfmt
tsgolint
oxlint
oxfmt

Expand Down
Loading