fix: replace Deno/TypeScript residuals with Rust conventions in agent definitions
This commit is contained in:
@@ -96,14 +96,14 @@ Verify:
|
|||||||
- Edge cases considered
|
- Edge cases considered
|
||||||
- No brittle tests (over-mocked, timing-dependent)
|
- No brittle tests (over-mocked, timing-dependent)
|
||||||
|
|
||||||
#### D. Static Analysis (Deno toolchain)
|
#### D. Static Analysis (Rust toolchain)
|
||||||
|
|
||||||
Run the project's type check, lint, and format commands:
|
Run the project's build, lint, and format commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
deno check mod.ts src/graphs/mod.ts src/sqlite/mod.ts # Type check
|
cargo build # Build check
|
||||||
deno lint # Lint (slow-types excluded per project config)
|
cargo clippy -- -D warnings # Lint
|
||||||
deno fmt --check # Format check
|
cargo fmt --check # Format check
|
||||||
```
|
```
|
||||||
|
|
||||||
#### D2. Project Convention Checks
|
#### D2. Project Convention Checks
|
||||||
@@ -111,12 +111,13 @@ deno fmt --check # Format check
|
|||||||
For this project, also verify:
|
For this project, also verify:
|
||||||
|
|
||||||
- No comments in code (per project convention)
|
- No comments in code (per project convention)
|
||||||
- Slow types are only in known problem areas (drizzle ORM generics) — no new
|
- Error handling uses `anyhow::Result` (application) / `thiserror` (library) — no
|
||||||
slow types outside those
|
panics in library code
|
||||||
- Imports use explicit `.ts` extensions (Deno convention)
|
- Feature flags are used correctly (`tls`, `iroh`, `acme`) — base crate compiles
|
||||||
- TypeBox schemas are values+types (no `import type` for schema symbols)
|
lean
|
||||||
- Entry points are `mod.ts` files that re-export
|
- Public API is well-documented with `///` doc comments where appropriate
|
||||||
- Clients are injectable (no module-level side effects, no env vars)
|
- Module structure follows Rust conventions (`mod.rs`, `lib.rs`)
|
||||||
|
- No unnecessary `unwrap()` or `expect()` in library code
|
||||||
|
|
||||||
#### E. Security
|
#### E. Security
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ This is the most critical coordinator responsibility. Follow it exactly:
|
|||||||
|
|
||||||
3. **Validate after every merge:**
|
3. **Validate after every merge:**
|
||||||
```bash
|
```bash
|
||||||
deno check mod.ts src/graphs/mod.ts src/sqlite/mod.ts && deno lint && deno test --allow-all test/
|
cargo build && cargo clippy -- -D warnings && cargo test
|
||||||
```
|
```
|
||||||
Never skip this. A merge that breaks the build is worse than no merge.
|
Never skip this. A merge that breaks the build is worse than no merge.
|
||||||
|
|
||||||
@@ -184,14 +184,14 @@ also include:
|
|||||||
`git fetch origin && git merge origin/main --no-edit` before starting, since
|
`git fetch origin && git merge origin/main --no-edit` before starting, since
|
||||||
main may have advanced since their worktree was created
|
main may have advanced since their worktree was created
|
||||||
3. **Key references** — Which source files and architecture docs to read
|
3. **Key references** — Which source files and architecture docs to read
|
||||||
4. **Project constraints** — Important rules from the repo (no comments, TypeBox
|
4. **Project constraints** — Important rules from the repo (no comments,
|
||||||
not Zod, etc.)
|
error handling conventions, etc.)
|
||||||
5. **Done signal** — Use `worktree({action: "notify", ...})` when complete
|
5. **Done signal** — Use `worktree({action: "notify", ...})` when complete
|
||||||
|
|
||||||
Example prompt template:
|
Example prompt template:
|
||||||
|
|
||||||
```
|
```
|
||||||
You are an implementation specialist for the @alkdev/storage project.
|
You are an implementation specialist for the @alkdev/wraith project.
|
||||||
|
|
||||||
Your task: {{task}}
|
Your task: {{task}}
|
||||||
|
|
||||||
@@ -199,19 +199,18 @@ Your task: {{task}}
|
|||||||
2. Read the task file, then read all referenced source files and architecture docs.
|
2. Read the task file, then read all referenced source files and architecture docs.
|
||||||
3. Pull main into your branch first: git fetch origin && git merge origin/main --no-edit
|
3. Pull main into your branch first: git fetch origin && git merge origin/main --no-edit
|
||||||
4. Implement the changes, following all acceptance criteria.
|
4. Implement the changes, following all acceptance criteria.
|
||||||
5. Run deno check mod.ts src/graphs/mod.ts src/sqlite/mod.ts, deno lint, deno test --allow-all test/. Fix any failures.
|
5. Run cargo build, cargo clippy -- -D warnings, cargo test, cargo fmt --check. Fix any failures.
|
||||||
6. Commit ONLY source code — do not commit task files (tasks/*.md). The coordinator manages task status on main.
|
6. Commit ONLY source code — do not commit task files (tasks/*.md). The coordinator manages task status on main.
|
||||||
7. Push: git push origin $(git branch --show-current)
|
7. Push: git push origin $(git branch --show-current)
|
||||||
8. Notify: worktree({action: "notify", args: {message: "Task completed: {{task}}. <brief summary>", level: "info"}})
|
8. Notify: worktree({action: "notify", args: {message: "Task completed: {{task}}. <brief summary>", level: "info"}})
|
||||||
|
|
||||||
Key project constraints (@alkdev/storage):
|
Key project constraints (@alkdev/wraith):
|
||||||
- Deno-first: use deno check, deno lint, deno fmt, deno test (not npm)
|
- Rust: use cargo build, cargo clippy, cargo fmt, cargo test
|
||||||
- No comments in code
|
- No comments in code
|
||||||
- TypeBox (not Zod): use @alkdev/typebox and @alkdev/drizzlebox
|
- anyhow::Result for application errors, thiserror for library error types
|
||||||
- JSR slow types excluded (known debt in drizzle generics)
|
- Feature flags for transports (tls, iroh, acme)
|
||||||
- Injectable clients, no module-level side effects
|
- Async via tokio runtime
|
||||||
- Import .ts extensions explicitly
|
- No panics in library code
|
||||||
- TypeBox schemas are values+types (no import type for schema symbols)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Partial Generation Spawning
|
### Partial Generation Spawning
|
||||||
@@ -230,7 +229,7 @@ For example, if Generation 2 has tasks A (depends on X), B (depends on Y), and C
|
|||||||
### Overlap Awareness
|
### Overlap Awareness
|
||||||
|
|
||||||
When spawning parallel tasks, check if they modify overlapping source files.
|
When spawning parallel tasks, check if they modify overlapping source files.
|
||||||
Tasks that share source files (e.g., both modify `src/call.ts`) are likely to
|
Tasks that share source files (e.g., both modify `src/transport.rs`) are likely to
|
||||||
cause merge conflicts. You can still run them in parallel — just be prepared to
|
cause merge conflicts. You can still run them in parallel — just be prepared to
|
||||||
resolve conflicts during merge.
|
resolve conflicts during merge.
|
||||||
|
|
||||||
|
|||||||
@@ -61,10 +61,10 @@ worktree. This means:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# ✅ CORRECT — workdir is auto-injected
|
# ✅ CORRECT — workdir is auto-injected
|
||||||
deno test --allow-all test/
|
cargo test
|
||||||
|
|
||||||
# ✅ ALSO CORRECT — explicit workdir still works
|
# ✅ ALSO CORRECT — explicit workdir still works
|
||||||
bash({ command: "npm test", workdir: "/path/to/worktree" })
|
bash({ command: "cargo test", workdir: "/path/to/worktree" })
|
||||||
```
|
```
|
||||||
|
|
||||||
**Do NOT use `cd` in commands** — it doesn't persist and the plugin handles
|
**Do NOT use `cd` in commands** — it doesn't persist and the plugin handles
|
||||||
@@ -106,23 +106,23 @@ If blocked → Safe Exit (see below)
|
|||||||
|
|
||||||
**File paths:** Always relative to worktree root
|
**File paths:** Always relative to worktree root
|
||||||
|
|
||||||
- ✅ `src/graphs/mod.ts`
|
- ✅ `src/transport.rs`
|
||||||
- ❌ Absolute paths to the main repo (outside your worktree)
|
- ❌ Absolute paths to the main repo (outside your worktree)
|
||||||
|
|
||||||
### 4. Self-Verify
|
### 4. Self-Verify
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Type check
|
# Build
|
||||||
deno check mod.ts src/graphs/mod.ts src/sqlite/mod.ts
|
cargo build
|
||||||
|
|
||||||
# Lint
|
# Lint
|
||||||
deno lint
|
cargo clippy -- -D warnings
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
deno test --allow-all test/
|
cargo test
|
||||||
|
|
||||||
# Format check
|
# Format check
|
||||||
deno fmt --check
|
cargo fmt --check
|
||||||
```
|
```
|
||||||
|
|
||||||
Check each acceptance criterion in the task file.
|
Check each acceptance criterion in the task file.
|
||||||
@@ -205,23 +205,20 @@ When available, use memory tools to manage your context:
|
|||||||
|
|
||||||
This is especially important for complex tasks that span many file operations.
|
This is especially important for complex tasks that span many file operations.
|
||||||
|
|
||||||
## Project Conventions (@alkdev/storage)
|
## Project Conventions
|
||||||
|
|
||||||
Read `AGENTS.md` at project root for full details. Key rules:
|
Read `AGENTS.md` at project root for full details. Key rules:
|
||||||
|
|
||||||
1. **No comments in code** — Per project convention.
|
1. **No comments in code** — Per project convention.
|
||||||
2. **TypeBox, not Zod** — Use `@alkdev/typebox` and `@alkdev/drizzlebox` for
|
2. **Error handling** — Use `anyhow::Result` for application code, `thiserror` for
|
||||||
schema/validation.
|
library error types. Never panic in library code.
|
||||||
3. **Explicit .ts extensions** — All imports must include the `.ts` extension
|
3. **Feature flags** — Transports are feature-gated (`tls`, `iroh`, `acme`). Base
|
||||||
(Deno convention).
|
crate should compile lean.
|
||||||
4. **JSR slow types** — Drizzle's deeply inferred generics make explicit
|
4. **Async runtime** — `tokio` is the async runtime. All I/O is async.
|
||||||
annotations impractical. Use `--allow-slow-types`. Do not annotate drizzle
|
5. **Naming conventions** — Rust standard: `snake_case` for functions/variables/
|
||||||
table definitions.
|
modules, `PascalCase` for types/traits, `SCREAMING_SNAKE_CASE` for constants.
|
||||||
5. **Injectable clients** — `createSqliteDatabase(client)` takes a client, not
|
6. **Module structure** — One module per component under `src/`. Re-export via
|
||||||
env vars. No module-level side effects.
|
`mod.rs` or `lib.rs` as appropriate.
|
||||||
6. **Naming conventions** — TypeBox schemas: PascalCase (`NodeType`). Drizzle
|
|
||||||
tables: camelCase (`graphTypes`). Drizzlebox schemas: PascalCase
|
|
||||||
(`InsertGraph`).
|
|
||||||
|
|
||||||
## Key Principles
|
## Key Principles
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ specifying workdir:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# ✅ CORRECT — workdir is auto-injected
|
# ✅ CORRECT — workdir is auto-injected
|
||||||
deno test --allow-all test/
|
cargo test
|
||||||
```
|
```
|
||||||
|
|
||||||
**Do NOT use `cd` in commands** — it doesn't persist and the plugin handles
|
**Do NOT use `cd` in commands** — it doesn't persist and the plugin handles
|
||||||
|
|||||||
Reference in New Issue
Block a user