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
20 changes: 20 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "embedded-debugger",
"version": "0.2.0",
"description": "Embedded debugger workflow for probe-rs targets. Provides a CLI-first skill and optional MCP server for probe discovery, target checks, flashing, memory access, and RTT workflows.",
"author": {
"name": "adancurusul",
"url": "https://github.com/Adancurusul"
},
"repository": "https://github.com/Adancurusul/embedded-debugger-mcp",
"license": "MIT",
"keywords": [
"embedded",
"debugging",
"mcp",
"probe-rs",
"rtt",
"flash",
"skill"
]
}
52 changes: 52 additions & 0 deletions .github/scripts/validate_skill.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env python3
"""Lightweight CI validator for bundled Codex/Claude Code skills."""

from __future__ import annotations

import re
import sys
from pathlib import Path


def fail(message: str) -> int:
print(f"error: {message}", file=sys.stderr)
return 1


def main() -> int:
if len(sys.argv) != 2:
return fail("usage: validate_skill.py <skill-dir>")

skill_dir = Path(sys.argv[1])
skill_md = skill_dir / "SKILL.md"
openai_yaml = skill_dir / "agents" / "openai.yaml"

if not skill_md.is_file():
return fail(f"missing {skill_md}")
if not openai_yaml.is_file():
return fail(f"missing {openai_yaml}")

text = skill_md.read_text(encoding="utf-8")
match = re.match(r"^---\n(.*?)\n---\n", text, re.S)
if not match:
return fail("SKILL.md missing YAML frontmatter")

frontmatter = match.group(1)
if not re.search(r"^name:\s*embedded-debugger\s*$", frontmatter, re.M):
return fail("SKILL.md frontmatter must set name: embedded-debugger")
if not re.search(r"^description:\s*.+", frontmatter, re.M):
return fail("SKILL.md frontmatter must include description")
placeholder_marker = "TO" + "DO"
if f"[{placeholder_marker}" in text or f"{placeholder_marker}:" in text:
return fail("SKILL.md still contains placeholder markers")

metadata = openai_yaml.read_text(encoding="utf-8")
if "Use $embedded-debugger" not in metadata:
return fail("agents/openai.yaml default prompt must mention $embedded-debugger")

print(f"validated {skill_dir}")
return 0


if __name__ == "__main__":
raise SystemExit(main())
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
rust:
name: Rust release checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Format
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --locked --all-targets --all-features -- -D warnings

- name: Test
run: cargo test --locked --all-targets --all-features

- name: Docs
run: RUSTDOCFLAGS="-D warnings" cargo doc --locked --all-features --no-deps

- name: Package
run: cargo package --locked

- name: CLI smoke
run: |
cargo run --locked -- --help > /tmp/embedded-debugger-help.txt
cargo run --locked -- doctor --json > /tmp/embedded-debugger-doctor.json
python3 -m json.tool /tmp/embedded-debugger-doctor.json > /dev/null
cargo run --locked -- probes list --json > /tmp/embedded-debugger-probes.json
python3 -m json.tool /tmp/embedded-debugger-probes.json > /dev/null
cargo run --locked -- skill print-prompt > /tmp/embedded-debugger-skill.txt
grep -q "embedded-debugger skill" /tmp/embedded-debugger-skill.txt
cargo run --locked -- skill install --target both --home /tmp/embedded-debugger-skill-home --dry-run --json > /tmp/embedded-debugger-skill-install-dry-run.json
python3 -m json.tool /tmp/embedded-debugger-skill-install-dry-run.json > /dev/null
cargo run --locked -- skill install --target both --home /tmp/embedded-debugger-skill-home --force --json > /tmp/embedded-debugger-skill-install.json
python3 -m json.tool /tmp/embedded-debugger-skill-install.json > /dev/null
test -f /tmp/embedded-debugger-skill-home/.codex/skills/embedded-debugger/SKILL.md
test -f /tmp/embedded-debugger-skill-home/.claude/skills/embedded-debugger/SKILL.md
test -f /tmp/embedded-debugger-skill-home/.claude/plugins/local/embedded-debugger-mcp/.claude-plugin/plugin.json
if cargo run --locked -- not-a-command > /tmp/embedded-debugger-invalid.out 2> /tmp/embedded-debugger-invalid.err; then
echo "invalid subcommand unexpectedly succeeded"
exit 1
fi

- name: Validate bundled skill
run: python3 .github/scripts/validate_skill.py skills/embedded-debugger

stm32-demo:
name: STM32 demo check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install nightly Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: examples/STM32_demo -> target

- name: Check demo firmware
working-directory: examples/STM32_demo
env:
CARGO_TARGET_DIR: /tmp/embedded-debugger-mcp-stm32-target
run: cargo +nightly check --locked
Loading
Loading