Skip to content

Commit 23e0dcb

Browse files
Fix #162
1 parent 6dfc792 commit 23e0dcb

4 files changed

Lines changed: 683 additions & 32 deletions

File tree

.claude/commands/implement-extensions.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Spawn researcher/implementer/tester/reviewer team to fill in stub Compute* methods in a SysML2.NET Extend file
3-
argument-hint: <absolute-path-to-Extensions-file.cs>
3+
argument-hint: <path-to-Extensions-file.cs (relative to repo root or absolute)>
44
---
55

66
# /implement-extensions
@@ -10,9 +10,21 @@ Spawn the 4-role agent team (researcher → implementer → tester → reviewer)
1010
`Compute*` methods are still stubs throwing `NotSupportedException`. Per-role
1111
models are picked dynamically based on stub complexity (see step 3.5).
1212

13-
The team template is at `C:\Users\atheate\.claude\team-templates\extension-impl.md`
14-
(v2). Read it first — its role prompts are the source of truth; this command body
15-
is the orchestration glue.
13+
The team template is at `.claude/team-templates/extension-impl.md` (v2, repo-tracked).
14+
Read it first — its role prompts are the source of truth; this command body is the
15+
orchestration glue.
16+
17+
## Path conventions (portable across contributors)
18+
19+
All paths in this command are **repo-relative with forward slashes**, so the workflow
20+
works for any contributor regardless of where they cloned the repo (e.g.
21+
`C:\code\SysML2.NET`, `~/projects/SysML2.NET`, `D:\dev\SysML2.NET`). Forward slashes
22+
are accepted by both `dotnet` CLI and `bash` (incl. Git Bash on Windows, WSL,
23+
macOS, Linux).
24+
25+
When invoking tools that REQUIRE absolute paths (e.g. `Read`, `Edit`, `Write`), the
26+
orchestrator resolves repo-relative paths at runtime by prepending the working
27+
directory (the repo root, where `/implement-extensions` was invoked).
1628

1729
## Hard scope rule
1830

@@ -37,26 +49,32 @@ scope. Use the stub-blocker test pattern (see template).
3749

3850
### 1. Validate input
3951

40-
Confirm `$ARGUMENTS` is:
41-
- An absolute Windows path with backslashes.
42-
- A file matching `C:\CODE\SysML2.NET\SysML2.NET\Extend\*Extensions.cs`.
43-
- The file exists.
52+
Accept `$ARGUMENTS` in any of these forms:
53+
- Repo-relative path: `SysML2.NET/Extend/<FOO>Extensions.cs`
54+
- Repo-relative with `@` prefix (Claude Code file-reference): `@SysML2.NET/Extend/<FOO>Extensions.cs`
55+
- Absolute path on the contributor's machine (Windows or POSIX), with `@` prefix or without
4456

45-
If validation fails, stop and ask the user to re-invoke with a corrected path.
57+
**Normalization rule**: extract the `<FOO>Extensions.cs` filename from the input and
58+
reconstruct the canonical repo-relative path `SysML2.NET/Extend/<FOO>Extensions.cs`.
59+
Then verify this file exists from the repo root (the working directory). If it
60+
doesn't, stop and surface to the user.
4661

4762
### 2. Auto-derive paths
4863

49-
From `$ARGUMENTS = C:\CODE\SysML2.NET\SysML2.NET\Extend\<FOO>Extensions.cs`:
64+
From the normalized canonical path `SysML2.NET/Extend/<FOO>Extensions.cs`:
5065

51-
- **Production file**: `$ARGUMENTS` itself.
52-
- **Test fixture**: `C:\CODE\SysML2.NET\SysML2.NET.Tests\Extend\<FOO>ExtensionsTestFixture.cs`.
66+
- **Production file**: `SysML2.NET/Extend/<FOO>Extensions.cs`.
67+
- **Test fixture**: `SysML2.NET.Tests/Extend/<FOO>ExtensionsTestFixture.cs`.
5368
If it does not exist, surface that to the user — likely scope mismatch.
54-
- **Reference production file**: `C:\CODE\SysML2.NET\SysML2.NET\Extend\NamespaceExtensions.cs`.
55-
- **Reference test file**: `C:\CODE\SysML2.NET\SysML2.NET.Tests\Extend\NamespaceExtensionsTestFixture.cs`.
56-
- **Target interface**: `I<FOO>` — find via Glob `SysML2.NET\Core\AutoGenPoco\**\I<FOO>.cs`.
69+
- **Reference production file**: `SysML2.NET/Extend/NamespaceExtensions.cs`.
70+
- **Reference test file**: `SysML2.NET.Tests/Extend/NamespaceExtensionsTestFixture.cs`.
71+
- **Target interface**: `I<FOO>` — find via Glob `SysML2.NET/Core/AutoGenPoco/**/I<FOO>.cs`.
5772
- **Target metaclass name**: `<FOO>`.
5873
- **Subject param name**: lowercase first char of `<FOO>` + `<FOO>[1..]` + `Subject` (e.g. `Type``typeSubject`, `Feature``featureSubject`).
59-
- **Notes file**: `C:\CODE\SysML2.NET\.team-notes\<foo>-extensions-spec.md` (kebab-case `<foo>`). Create the `.team-notes\` directory if it doesn't exist (`mkdir -p`).
74+
- **Notes file**: `.team-notes/<foo>-extensions-spec.md` (kebab-case `<foo>`). The
75+
`.team-notes/` directory is gitignored at `.gitignore` line `/.team-notes/*`, so
76+
the file is per-contributor scratch. Create the directory if it doesn't exist
77+
(`mkdir -p .team-notes`).
6078
- **Team name**: `<foo>-extensions-impl`.
6179
- **GitHub issue number**: discover via
6280
```bash
@@ -147,7 +165,7 @@ proceed with the dynamic defaults.
147165

148166
### 5. Spawn the researcher (FIRST role — produces the notes file the others read)
149167

150-
Read the v2 team template at `C:\Users\atheate\.claude\team-templates\extension-impl.md`
168+
Read the v2 team template at `.claude/team-templates/extension-impl.md`
151169
to refresh the role prompts. Substitute the placeholders from step 2 + the method
152170
list from step 4.
153171

@@ -208,16 +226,16 @@ implementer's parallel-turn edits, so every populated-case test would fail with
208226
After both step-6 agents return, run sequentially in the orchestrator's own
209227
turn:
210228

211-
1. Build production:
229+
1. Build production (paths are repo-relative, executed from the repo root):
212230
```bash
213-
dotnet build C:\CODE\SysML2.NET\SysML2.NET\SysML2.NET.csproj --nologo --verbosity quiet
231+
dotnet build SysML2.NET/SysML2.NET.csproj --nologo --verbosity quiet
214232
```
215233
On failure, dispatch the implementer back to fix its own bugs (do not
216234
delegate to a fresh agent unless the original is non-responsive).
217235

218236
2. Run targeted fixture:
219237
```bash
220-
dotnet test C:\CODE\SysML2.NET\SysML2.NET.Tests\SysML2.NET.Tests.csproj --filter "FullyQualifiedName~<FOO>ExtensionsTestFixture" --nologo --verbosity quiet
238+
dotnet test SysML2.NET.Tests/SysML2.NET.Tests.csproj --filter "FullyQualifiedName~<FOO>ExtensionsTestFixture" --nologo --verbosity quiet
221239
```
222240
Analyze each failure and route the fix:
223241
- **OCL mistranslation in production** → re-dispatch the implementer.
@@ -232,7 +250,7 @@ turn:
232250
Run the full solution test suite:
233251

234252
```bash
235-
dotnet test C:\CODE\SysML2.NET\SysML2.NET.sln --no-build --nologo --verbosity quiet
253+
dotnet test SysML2.NET.sln --no-build --nologo --verbosity quiet
236254
```
237255

238256
If failures exist, identify those of the form:

0 commit comments

Comments
 (0)