Skip to content

Commit 3ca0b57

Browse files
chore: adopt embedded-agent-kit rules (#385)
* chore: adopt embedded-agent-kit rules - AGENTS.md: shared sections from embedded-agent-kit 0.3.0; Domain, Build and Exceptions from the former AGENTS.md and instruction files - CLAUDE.md: imports AGENTS.md only - Agents: shared reviewer in .claude/agents and .github/agents; algo-implementer and unit-tester are now kit skills in .claude/skills; orchestrator, planner and executor removed - Remove copilot-instructions.md, .github/instructions and the prompts: AGENTS.md and the skills hold those rules - Agent Rules workflow: verifies AGENTS.md on each pull request - README, TESTING.md, roadmap/README.md: links to removed files fixed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh6PszuBc5nyRurYVqf * docs: keep the plain TEST() ban; cppcheck runs in MegaLinter here Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh6PszuBc5nyRurYVqf * chore: resync algo-implementer skill from embedded-agent-kit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh6PszuBc5nyRurYVqf --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f9a063b commit 3ca0b57

26 files changed

Lines changed: 229 additions & 830 deletions

‎.claude/agents/algo-implementer.md‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎.claude/agents/executor.md‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎.claude/agents/orchestrator.md‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎.claude/agents/planner.md‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎.claude/agents/reviewer.md‎

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,36 @@
11
---
22
name: reviewer
3-
description: Review code changes against numerical-toolbox standards — no heap, float-only templates, forced inlining on hot paths, TEST_F on float, SOLID, docs. Does NOT modify files.
4-
model: claude-sonnet-4-6
5-
tools: [Read, Bash]
3+
description: Review the changes on the current branch against the rules in AGENTS.md. Reports findings by severity. Does not change files.
4+
model: sonnet
5+
tools: [Read, Bash, Grep, Glob]
66
---
77

8-
Canonical rules: `AGENTS.md`. Review only — no file modifications.
8+
Review code. Do not change files. AGENTS.md is the rule set; *Exceptions* overrides a shared rule.
99

10-
## Workflow
10+
## Process
1111

12-
1. Identify changed files; read each completely.
13-
2. Check every item below; compare against existing patterns in the same module.
14-
3. Verify mathematical correctness and doc alignment.
12+
1. Find the changes: `git diff --name-only $(git merge-base origin/main HEAD)`.
13+
2. Read AGENTS.md and each matching `.github/instructions/*.instructions.md`.
14+
3. Read each changed file completely. Read callers when a signature changes.
15+
4. Check each rule against the lines the change adds or modifies. Do not report old code the change does not touch.
16+
5. Confirm each finding in the code before you report it.
1517

16-
## Output format
18+
## Severity
1719

18-
### `path/to/file`
19-
**CRITICAL** — must fix before merge: [C1] ...
20-
**WARNING** — should fix: [W1] ...
21-
**SUGGESTION** — nice to have: [S1] ...
22-
**PASS**: rules verified
20+
| Severity | Rule broken |
21+
|------------|-------------------------------------------------------------------------------------------------------------------------------------|
22+
| CRITICAL | *Memory*, *Interfaces & errors*, *Optimisation*, *Domain*; behavioural change without a documentation update; build or test failure |
23+
| WARNING | *Style* except comments; *Testing*; new file not in `CMakeLists.txt` |
24+
| SUGGESTION | Comment rules; prose not in ASD-STE100; optimisation outside a hot path |
2325

24-
End with totals + verdict: APPROVE / REQUEST CHANGES.
26+
A deviation listed in *Exceptions* is not a finding.
2527

26-
## Checklist
28+
## Output
2729

28-
**Memory (CRITICAL)**
29-
- [ ] No heap: `new`/`delete`/`make_unique`/`make_shared`/`std::vector`/`string`/`deque`/`list`/`map`/`set`. Tests too.
30-
- [ ] No recursion.
30+
```
31+
path/file.hpp:42 CRITICAL [Memory] std::vector in production code — use infra::BoundedVector
32+
path/file.cpp:10 WARNING [Style] header guard — use #pragma once
33+
```
3134

32-
**Numeric types (CRITICAL)**
33-
- [ ] `template<typename T>` + `static_assert(std::is_floating_point_v<T>)`. `float` only — no Q15/Q31.
34-
- [ ] `std::numbers::pi_v<float>` — no hardcoded constants.
35-
- [ ] `extern template` guarded by `#ifdef NUMERICAL_TOOLBOX_COVERAGE_BUILD`.
36-
37-
**Embedded optimizations (WARNING)**
38-
- [ ] No `#pragma GCC optimize` and no `optimize` attribute anywhere (they stop GCC inlining across the boundary).
39-
- [ ] `OPTIMIZE_FOR_SPEED` on `Filter/Compute/Update/Solve/Step`.
40-
41-
**Namespaces (WARNING)**
42-
- [ ] Active filters (Kalman family): `namespace filters` — **not** `namespace filters::active`.
43-
- [ ] Passive filters: `namespace filters::passive`. Window functions: `namespace windowing`.
44-
45-
**Style (WARNING)**
46-
- [ ] Allman braces, brace-init `{}`, PascalCase types/methods, camelCase members.
47-
- [ ] Functions ≤ ~30 lines. `const`-correct on all non-mutating methods. No comments except license/NOLINT.
48-
- [ ] SOLID: one concern per class, constructor injection, depend on abstractions, no duplicated logic.
49-
50-
**Interfaces & errors (WARNING)**
51-
- [ ] Interfaces: `protected:` non-virtual `~I() = default` — no `virtual` or `= 0` destructor, no ownership or deletion through an interface pointer. No exceptions — `std::optional`/status enums.
52-
53-
**Testing (WARNING)**
54-
- [ ] `TEST_F` on `float` — no `TYPED_TEST`, no multi-type, never plain `TEST()`.
55-
- [ ] `StrictMock` only (no `NiceMock`/bare). Anonymous-namespace fixture; macros outside.
56-
- [ ] No redundant tests. Arrange/Act/Assert. `EXPECT_NEAR` + `math::Tolerance<float>()`.
57-
58-
**CMake (WARNING)**
59-
- [ ] `numerical_add_header_library()`, `numerical_add_coverage_sources()`, `${NUMERICAL_VISIBILITY}`.
60-
- [ ] If new simulator: `.vscode/launch.json` has a `cppdbg` entry inserted before `"Linux Debug"`.
61-
62-
**Docs (CRITICAL)**
63-
- [ ] `doc/{domain}/{Name}.md` updated per `doc/TEMPLATE.md`. No class names, no code examples.
64-
- [ ] `doc/{domain}/README.md` updated if a new algorithm was added.
65-
66-
**Terse**: report file paths + CRITICAL/WARNING counts. Don't narrate; don't re-read files.
35+
One line per finding: location, severity, section, problem, fix.
36+
Last line: `C=<n> W=<n> S=<n> — APPROVE` or `— REQUEST CHANGES` (any CRITICAL or WARNING).

‎.claude/agents/unit-tester.md‎

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: algo-implementer
3+
description: Deploy one algorithm spec from roadmap/ into a toolbox as float-only production code, tests, documentation and CMake. Use for roadmap deployment in the numerical, robotics or neural-network toolbox.
4+
---
5+
6+
Deploy one algorithm from `roadmap/<domain>/<Name>/`. `<root>` is the source folder that AGENTS.md *Domain* names.
7+
8+
## Steps
9+
10+
1. Read `roadmap/DEPLOYMENT.md`. Then read only the spec's `implementation.md`, `tests.md` and `explanation.md`.
11+
2. Write what `roadmap/DEPLOYMENT.md` lists: `<root>/<domain>/<Name>.hpp`, the coverage `.cpp`,
12+
`<root>/<domain>/test/Test<Name>.cpp`, `doc/<domain>/<Name>.md` and the CMake changes.
13+
3. Write exactly the tests that `tests.md` lists. Add no other tests.
14+
4. Run the *Build* commands. Fix until build and tests pass.
15+
5. Do every bookkeeping step in `roadmap/DEPLOYMENT.md`: roadmap entries to remove, README and
16+
`doc/<domain>/README.md` tables to update. CI builds the booklet from these tables.
17+
6. Report changed files and test pass/fail.
18+
19+
## Rules
20+
21+
- Float only: `template<typename T>` with `static_assert(std::is_floating_point_v<T>)`. Instantiate and test `float`.
22+
No `Q15`/`Q31`.
23+
- `OPTIMIZE_FOR_SPEED` on hot functions defined in the header.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: unit-tester
3+
description: Write metric-driven unit tests for one toolbox algorithm, with assertions against independent references chosen from TESTING.md. Use to add or extend tests in the numerical, robotics or neural-network toolbox.
4+
---
5+
6+
Add or extend the tests of one algorithm. `<root>` is the source folder that AGENTS.md *Domain* names.
7+
`TESTING.md` defines what to assert: metric families M1–M9 and robustness dimensions R1–R6. Apply them; do not copy them.
8+
9+
## Steps
10+
11+
1. Read `TESTING.md`, the public interface in `<root>/<domain>/<Name>.hpp`, `doc/<domain>/<Name>.md`
12+
and `<root>/<domain>/test/Test<Name>.cpp` if it exists.
13+
2. Find the algorithm's family in `TESTING.md`. Select its M metrics. Always apply R1–R3; add R4–R6 where the family needs them.
14+
3. Write one `TEST_F` on `float` per property. Assert each against an independent reference: closed form,
15+
hand calculation, a cited golden vector or a different method. Use `EXPECT_NEAR` with `math::Tolerance<float>()`.
16+
4. Add a new test file to `<root>/<domain>/test/CMakeLists.txt`.
17+
5. Run the *Build* commands. Fix until build and tests pass.
18+
6. Check the per-algorithm checklist in `TESTING.md`. Coverage must be ≥ 90 %; an uncovered branch usually means
19+
a missing R2 (unhappy flow) test.
20+
7. Report changed files, test pass/fail and the source of each golden vector. Put the sources in the report, not in the test file.
21+
22+
## Rules
23+
24+
- Never assert the implementation against its own output.
25+
- One behaviour per test. No test per parameter permutation.
26+
- Seeded random generators only.

‎.embedded-agent-kit.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "0.3.0",
3+
"bundles": ["core", "toolbox"],
4+
"files": [
5+
".claude/agents/reviewer.md",
6+
".claude/skills/algo-implementer/SKILL.md",
7+
".claude/skills/unit-tester/SKILL.md",
8+
".github/agents/reviewer.agent.md"
9+
]
10+
}

0 commit comments

Comments
 (0)