Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
85 changes: 85 additions & 0 deletions .agents/skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Agent Skills

This directory contains agentic skills for the Morphir Python project, following the [Agent Skills Specification](https://agentskills.io/).

## What are Agent Skills?

Agent Skills are folders of instructions, scripts, and resources that AI agents can discover and use to perform tasks more accurately and efficiently. They provide a simple, open format for extending agent capabilities with:

- **Procedural knowledge** - Step-by-step instructions for complex tasks
- **Contextual information** - Project-specific knowledge
- **Scripts** - Executable code for common operations
- **References** - Additional documentation

## Directory Structure

Each skill should be in its own subdirectory with a `SKILL.md` file:

```
.agents/skills/
├── README.md # This file
├── skill-name/
│ ├── SKILL.md # Required - skill definition
│ ├── scripts/ # Optional - executable scripts
│ ├── references/ # Optional - additional docs
│ └── assets/ # Optional - templates, data files
└── another-skill/
└── SKILL.md
```

## SKILL.md Format

Each skill must have a `SKILL.md` file with YAML frontmatter:

```yaml
---
name: skill-name
description: A description of what this skill does and when to use it.
license: Apache-2.0
compatibility: Requirements (e.g., "Requires Python 3.14+")
metadata:
author: finos
version: "1.0"
---

# Skill Instructions

Step-by-step instructions for the skill...
```

### Required Fields

| Field | Description |
|-------|-------------|
| `name` | Lowercase, hyphenated name (must match directory name) |
| `description` | What the skill does and when to use it (max 1024 chars) |

### Optional Fields

| Field | Description |
|-------|-------------|
| `license` | License for the skill |
| `compatibility` | Environment requirements |
| `metadata` | Additional key-value metadata |
| `allowed-tools` | Pre-approved tools for the skill |

## Creating a New Skill

1. Create a directory with your skill name (lowercase, hyphenated)
2. Add a `SKILL.md` file with the required frontmatter
3. Add any supporting scripts, references, or assets
4. Test the skill with an agent to verify it works correctly

## Validation

Use the reference library to validate skills:

```bash
npx skills-ref validate ./skill-name
```

## Resources

- [Agent Skills Specification](https://agentskills.io/specification)
- [Example Skills](https://github.com/anthropics/skills)
- [Reference Library](https://github.com/agentskills/agentskills/tree/main/skills-ref)
9 changes: 9 additions & 0 deletions .config/mise/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tools]
python = "3.14"
uv = "latest"

[env]
VIRTUAL_ENV = "{{config_root}}/.venv"

[settings]
experimental = true
11 changes: 11 additions & 0 deletions .config/mise/tasks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#MISE description="Build all packages"
set -euo pipefail

echo "Building morphir package..."
uv build packages/morphir

echo "Building morphir-tools package..."
uv build packages/morphir-tools

echo "Build complete!"
6 changes: 6 additions & 0 deletions .config/mise/tasks/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Run all checks (lint, format, typecheck, tests)"
#MISE depends=["lint", "format-check", "typecheck", "test-all"]
set -euo pipefail

echo "All checks passed!"
17 changes: 17 additions & 0 deletions .config/mise/tasks/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#MISE description="Clean build artifacts and caches"
set -euo pipefail

echo "Cleaning build artifacts..."
rm -rf build/ dist/ .eggs/
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.py[cod]" -delete 2>/dev/null || true

echo "Cleaning test artifacts..."
rm -rf .pytest_cache/ .coverage htmlcov/ coverage.xml .hypothesis/

echo "Cleaning type checker caches..."
rm -rf .mypy_cache/ .ruff_cache/ .pyright/

echo "Clean complete!"
5 changes: 5 additions & 0 deletions .config/mise/tasks/coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run tests with coverage report"
set -euo pipefail

uv run pytest tests/ --cov=packages/morphir/src --cov=packages/morphir-tools/src --cov-report=term-missing --cov-report=html
5 changes: 5 additions & 0 deletions .config/mise/tasks/format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run ruff formatter on the codebase"
set -euo pipefail

uv run ruff format .
5 changes: 5 additions & 0 deletions .config/mise/tasks/format-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Check code formatting without making changes"
set -euo pipefail

uv run ruff format --check .
5 changes: 5 additions & 0 deletions .config/mise/tasks/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run ruff linter on the codebase"
set -euo pipefail

uv run ruff check .
5 changes: 5 additions & 0 deletions .config/mise/tasks/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run pytest unit tests"
set -euo pipefail

uv run pytest tests/
6 changes: 6 additions & 0 deletions .config/mise/tasks/test-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Run all tests (unit and BDD)"
#MISE depends=["test", "test-bdd"]
set -euo pipefail

echo "All tests completed successfully!"
5 changes: 5 additions & 0 deletions .config/mise/tasks/test-bdd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run behave BDD tests"
set -euo pipefail

uv run behave features/
9 changes: 9 additions & 0 deletions .config/mise/tasks/typecheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
#MISE description="Run mypy and pyright type checkers"
set -euo pipefail

echo "Running mypy..."
uv run mypy packages/morphir/src packages/morphir-tools/src

echo "Running pyright..."
uv run pyright packages/morphir/src packages/morphir-tools/src
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install dependencies
run: uv sync --group dev
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Install Python 3.14 before uv sync

The workflow runs uv sync on ubuntu-latest without installing a Python interpreter, but the workspace and both packages require >=3.14. If the runner’s default Python is below 3.14 (the usual case on ubuntu-latest), uv sync will fail because no compatible interpreter is available, so lint/typecheck/test jobs won’t start. This will be avoided only if the runner image already ships Python 3.14 or you explicitly install it (e.g., actions/setup-python or uv python install) before the sync.

Useful? React with 👍 / 👎.


- name: Run ruff linter
run: uv run ruff check .

- name: Check formatting
run: uv run ruff format --check .

typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install dependencies
run: uv sync --group dev

- name: Run mypy
run: uv run mypy packages/morphir/src packages/morphir-tools/src

- name: Run pyright
run: uv run pyright packages/morphir/src packages/morphir-tools/src

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install dependencies
run: uv sync --group test

- name: Run pytest
run: uv run pytest tests/ --cov=packages/morphir/src --cov=packages/morphir-tools/src --cov-report=xml

- name: Run behave
run: uv run behave features/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build
runs-on: ubuntu-latest
needs: [lint, typecheck, test]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Build morphir package
run: uv build packages/morphir

- name: Build morphir-tools package
run: uv build packages/morphir-tools

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: |
packages/morphir/dist/
packages/morphir-tools/dist/
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
id-token: write

jobs:
build:
name: Build packages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Build morphir package
run: uv build packages/morphir

- name: Build morphir-tools package
run: uv build packages/morphir-tools

- name: Upload morphir dist
uses: actions/upload-artifact@v4
with:
name: morphir-dist
path: packages/morphir/dist/

- name: Upload morphir-tools dist
uses: actions/upload-artifact@v4
with:
name: morphir-tools-dist
path: packages/morphir-tools/dist/

publish-morphir:
name: Publish morphir to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/morphir/
steps:
- name: Download morphir dist
uses: actions/download-artifact@v4
with:
name: morphir-dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-morphir-tools:
name: Publish morphir-tools to PyPI
needs: [build, publish-morphir]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/morphir-tools/
steps:
- name: Download morphir-tools dist
uses: actions/download-artifact@v4
with:
name: morphir-tools-dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Create GitHub Release
needs: [publish-morphir, publish-morphir-tools]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
Loading
Loading