@pratikpsl/agent-skills 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +28 -2
  2. package/dist/core/ide-map.js +1 -1
  3. package/dist/core/resolve-template.d.ts.map +1 -1
  4. package/dist/core/resolve-template.js +1 -1
  5. package/dist/core/resolve-template.js.map +1 -1
  6. package/package.json +3 -1
  7. package/templates/default/instructions.md +6 -3
  8. package/templates/dotnet/AgentSkills/skills/dotnet-standards/SKILL.md +68 -0
  9. package/templates/dotnet/AgentSkills/skills/index.md +14 -0
  10. package/templates/python/AgentSkills/agents/architect.md +13 -0
  11. package/templates/python/AgentSkills/agents/developer.md +23 -0
  12. package/templates/python/AgentSkills/skills/index.md +13 -0
  13. package/templates/python/AgentSkills/skills/performance/SKILL.md +26 -0
  14. package/templates/python/AgentSkills/skills/python-standards/SKILL.md +72 -0
  15. package/templates/python/AgentSkills/skills/testing/SKILL.md +42 -0
  16. package/templates/react/AgentSkills/skills/index.md +13 -0
  17. package/templates/react/AgentSkills/skills/react-typescript/SKILL.md +37 -15
  18. package/templates/rust/AgentSkills/agents/architect.md +14 -0
  19. package/templates/rust/AgentSkills/agents/developer.md +24 -0
  20. package/templates/rust/AgentSkills/skills/index.md +13 -0
  21. package/templates/rust/AgentSkills/skills/performance/SKILL.md +43 -0
  22. package/templates/rust/AgentSkills/skills/rust-standards/SKILL.md +52 -0
  23. package/templates/rust/AgentSkills/skills/testing/SKILL.md +60 -0
  24. package/templates/shared/AgentSkills/OPERATING.md +4 -4
  25. package/templates/shared/AgentSkills/agents/reviewer.md +3 -4
  26. package/templates/shared/AgentSkills/skills/index.md +10 -0
  27. package/templates/shared/AgentSkills/skills/principles/SKILL.md +1 -1
  28. package/templates/shared/AgentSkills/skills/review/SKILL.md +2 -3
  29. package/templates/shared/AgentSkills/skills/standards/SKILL.md +12 -3
  30. package/templates/shared/entry-points/instructions.md +5 -4
  31. package/templates/dotnet/AgentSkills/skills/dotnet-best-practices/SKILL.md +0 -79
package/README.md CHANGED
@@ -18,7 +18,7 @@ Running with an **agent name** or `shared` automatically installs shared skills
18
18
  # Install shared skills + specific IDE / Agent entry point
19
19
  npx @pratikpsl/agent-skills antigravity # → .agents/rules/GEMINI.md + AgentSkills/
20
20
  npx @pratikpsl/agent-skills cursor # → .cursor/rules/instructions.md + AgentSkills/
21
- npx @pratikpsl/agent-skills claude # → CLAUDE.md + AgentSkills/
21
+ npx @pratikpsl/agent-skills claude # → AGENTS.md + AgentSkills/
22
22
  npx @pratikpsl/agent-skills code # → AGENTS.md + AgentSkills/
23
23
  npx @pratikpsl/agent-skills codex # → AGENTS.md + AgentSkills/
24
24
  npx @pratikpsl/agent-skills copilot # → .github/copilot-instructions.md + AgentSkills/
@@ -59,6 +59,28 @@ npx @pratikpsl/agent-skills react --agent cursor
59
59
  npx @pratikpsl/agent-skills react --agent claude
60
60
  ```
61
61
 
62
+ ### Python Template
63
+
64
+ ```bash
65
+ # Install Python agent skills + all IDE entry points
66
+ npx @pratikpsl/agent-skills python
67
+
68
+ # Install Python agent skills + specific agent entry point only
69
+ npx @pratikpsl/agent-skills python --agent cursor
70
+ npx @pratikpsl/agent-skills python --agent claude
71
+ ```
72
+
73
+ ### Rust Template
74
+
75
+ ```bash
76
+ # Install Rust agent skills + all IDE entry points
77
+ npx @pratikpsl/agent-skills rust
78
+
79
+ # Install Rust agent skills + specific agent entry point only
80
+ npx @pratikpsl/agent-skills rust --agent cursor
81
+ npx @pratikpsl/agent-skills rust --agent claude
82
+ ```
83
+
62
84
  *(You can also use `bunx @pratikpsl/agent-skills` in Bun environments).*
63
85
 
64
86
  ---
@@ -69,7 +91,7 @@ npx @pratikpsl/agent-skills react --agent claude
69
91
  Usage: agent-skills [options] [template]
70
92
 
71
93
  Arguments:
72
- template Template: default, dotnet, react, shared; agent names install shared guidance
94
+ template Template: default, dotnet, python, react, rust, shared; agent names install shared guidance
73
95
 
74
96
  Options:
75
97
  -V, --version output the version number
@@ -89,7 +111,9 @@ Options:
89
111
  | --- | --- | --- |
90
112
  | `shared` | `templates/shared/` | Base operating contract, core skills (principles, standards, security, review), review & architecture agents (`architect.md`, `reviewer.md`) |
91
113
  | `dotnet` | `templates/dotnet/` | .NET/C# skills, architecture & developer agents (`architect.md`, `developer.md`), memory |
114
+ | `python` | `templates/python/` | Python skills (PEP 8, uv, typing, testing, performance), architecture & developer agents (`architect.md`, `developer.md`) |
92
115
  | `react` | `templates/react/` | React & TypeScript skills, frontend testing, developer agent (`developer.md`) |
116
+ | `rust` | `templates/rust/` | Rust skills (standards, ownership, testing, performance), architecture & developer agents (`architect.md`, `developer.md`) |
93
117
  | `default` | `templates/default/` | Compact single-file agent instructions without AgentSkills folder |
94
118
 
95
119
  ---
@@ -108,7 +132,9 @@ coding-skills-ai/
108
132
  ├── templates/
109
133
  │ ├── default/ # Single-file instructions
110
134
  │ ├── dotnet/ # .NET template
135
+ │ ├── python/ # Python template
111
136
  │ ├── react/ # React template
137
+ │ ├── rust/ # Rust template
112
138
  │ └── shared/ # Shared operating contract & memory
113
139
  ├── tests/ # Vitest test suite
114
140
  ├── bun.lock # Reproducible lockfile
@@ -1,6 +1,6 @@
1
1
  export const IDE_ENTRY_POINTS = {
2
2
  antigravity: ".agents/rules/GEMINI.md",
3
- claude: "CLAUDE.md",
3
+ claude: "AGENTS.md",
4
4
  cline: ".clinerules",
5
5
  code: "AGENTS.md",
6
6
  codex: "AGENTS.md",
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-template.d.ts","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,UAA2C,CAAC;AAMvE,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWpD"}
1
+ {"version":3,"file":"resolve-template.d.ts","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,UAA6D,CAAC;AAMzF,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWpD"}
@@ -2,7 +2,7 @@ import { existsSync } from "fs";
2
2
  import path from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
- export const TEMPLATE_NAMES = ["default", "dotnet", "react", "shared"];
5
+ export const TEMPLATE_NAMES = ["default", "dotnet", "python", "react", "rust", "shared"];
6
6
  function templatesRoot() {
7
7
  return path.resolve(__dirname, "..", "..", "templates");
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-template.js","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEvE,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,cAAc,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,qCAAqC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"resolve-template.js","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEzF,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,cAAc,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,qCAAqC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pratikpsl/agent-skills",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.4.0",
5
5
  "description": "CLI to scaffold and manage AI agent skills across projects — like shadcn/ui, but for Cursor, Claude, Codex, Copilot, Antigravity, and more",
6
6
  "bin": {
7
7
  "agent-skills": "dist/bin/agent-skills.js"
@@ -26,6 +26,8 @@
26
26
  "copilot",
27
27
  "codex",
28
28
  "dotnet",
29
+ "python",
30
+ "rust",
29
31
  "agents",
30
32
  "antigravity",
31
33
  "typescript"
@@ -18,7 +18,8 @@ minimizing the diff, following the project's own architecture and conventions.
18
18
  - Keep functions under 50 lines, nesting depth at most 2 levels (prefer early returns), and signatures under 4 parameters.
19
19
  - Use meaningful names and named constants/enums (no magic numbers or strings).
20
20
  - Design self-describing APIs, structured schemas, and human-/machine-readable contracts.
21
- - Comment only where non-obvious rationale is required, not what the code already says.
21
+ - Comment only where non-obvious rationale is required, not what the code already says. Comments should explain "why" not "what". CODE SHOULD BE SELF-DESCRIBING.
22
+
22
23
 
23
24
  ### Reliability & Security
24
25
  - Never hardcode, commit, or log secrets, credentials, tokens, or sensitive user data.
@@ -30,11 +31,13 @@ minimizing the diff, following the project's own architecture and conventions.
30
31
  - Review code against five core dimensions: correctness (boundaries, errors, race conditions), readability (depth <= 2, functions <= 50 lines), architecture (SOLID, KISS), security, and performance.
31
32
  - Review tests first; address root causes over symptoms (fix shared logic once).
32
33
  - Categorize findings clearly (Critical, Important, Suggestion) and provide concrete, actionable fixes.
34
+ - Maximum 2 levels of nesting; prefer early returns to flatten control flow.
33
35
 
34
36
  ## Definition of Done
35
- - Builds cleanly and all tests pass without errors or warnings.
37
+ - Lint, types, and the framework build are clean.
38
+ - Tests are added or run only when the user asks, and they pass when run.
36
39
  - No debug code, dead code, unused imports, or temporary files left behind.
37
- - Changes are minimal, focused, covered by tests, and easy to review.
40
+ - Changes are minimal, focused, and easy to review.
38
41
 
39
42
  ## Agent Memory
40
43
  - Read `AgentSkills/memory/index.md` at the start of every task (create if missing); load only relevant domain lessons.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: dotnet-standards
3
+ description: >
4
+ Load on every C# or .NET change. AI agents use this when writing, reviewing,
5
+ refactoring, or optimizing C# for standards and implementation: project
6
+ conventions, CQRS, EF Core, DI lifetimes, async, logging, validation, and maintainability.
7
+ compatibility: Requires the .NET SDK declared by the repository (Directory.Build.props, default net10.0). Build with dotnet build.
8
+ ---
9
+
10
+ # C# and .NET Standards
11
+
12
+ AI agents load this file on every C# or .NET edit, with shared principles and standards. Apply these rules while writing.
13
+
14
+ ## Repository Defaults & Structure
15
+ - Follow target framework and language versions in `Directory.Build.props` (default `net10.0`, `LangVersion` `latest`).
16
+ - Add XML documentation comments for public and shared API surfaces.
17
+ - Organize code by feature or domain slices. Place controllers, handlers, validators, repositories, and DTOs in that slice.
18
+ - Prefer clear, direct code over speculative patterns (YAGNI).
19
+
20
+ ## CQRS & Architecture
21
+ - **Commands**: Mutate state. Return void, an identifier, or a minimal result.
22
+ - **Queries**: Read state only.
23
+ - **Thin endpoints**: Validate transport concerns and dispatch to a handler.
24
+ - **Domain logic**: Keep rules in domain entities or domain services.
25
+ - **Immutability**: Use `record` for commands, queries, and DTOs. Mark classes `sealed` unless inheritance is designed.
26
+ - **Interfaces**: Define an interface for a boundary that needs a test double, more than one implementation, or an out-of-process call.
27
+
28
+ ## Dependency Injection & Lifetimes
29
+ - Use constructor injection or a primary constructor for required dependencies.
30
+ - Register the narrowest lifetime: `Singleton` for stateless thread-safe services, `Scoped` for a request and for `DbContext`, `Transient` for a lightweight stateless operation.
31
+ - Do not resolve services from `IServiceProvider`, and do not add static global state.
32
+
33
+ ## Async & I/O
34
+ - Use `async`/`await` for I/O, database, network, and file work.
35
+ - Do not block with `.Result`, `.Wait()`, or `.GetAwaiter().GetResult()`.
36
+ - Accept and pass `CancellationToken` through handlers, EF Core, and outbound HTTP.
37
+ - `async void` only for a top-level event handler.
38
+
39
+ ## EF Core & Data Access
40
+ - Avoid N+1 queries with a projection, `.Include()`, or a separate query.
41
+ - Use `.AsNoTracking()` for a read-only query.
42
+ - Select the columns the caller needs. Do not load a full tracked entity for a DTO.
43
+ - Paginate, filter, and sort on the server.
44
+ - Prefer `AnyAsync()` to test existence. Use `ExecuteUpdateAsync` and `ExecuteDeleteAsync` for bulk changes.
45
+
46
+ ## Logging, HTTP, validation
47
+ - Log with a message template and named properties. Do not log secrets, passwords, connection strings, or PII.
48
+ - Propagate the correlation id. Do not log inside a tight loop.
49
+ - Use `IHttpClientFactory`, an explicit timeout, and the caller's `CancellationToken`. Retry transient failures with a bounded backoff.
50
+ - Validate inbound payloads with FluentValidation or data annotations. Do not concatenate user input into SQL, a shell command, or a file path.
51
+
52
+ ## Review Checklist
53
+ - [ ] Read-only EF Core queries use `.AsNoTracking()`. No N+1 queries.
54
+ - [ ] Callers receive a DTO projection, not a tracked entity graph.
55
+ - [ ] Async methods take a `CancellationToken` and do not block.
56
+ - [ ] `DbContext` is `Scoped`.
57
+ - [ ] Logs are structured and contain no secrets.
58
+ - [ ] Input is validated at the boundary.
59
+ - [ ] `dotnet build` is clean.
60
+
61
+ ## Verify
62
+ After C# edits, run the framework build and fix what it reports:
63
+
64
+ ```bash
65
+ dotnet build
66
+ ```
67
+
68
+ Add or run tests only when the user asks. Then load `csharp-xunit` and run `dotnet test`.
@@ -0,0 +1,14 @@
1
+ # Skills Index
2
+
3
+ Consult this index to load only the skills relevant to the current task.
4
+
5
+ | Skill | Path | Description / When to Load |
6
+ | --- | --- | --- |
7
+ | principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
8
+ | standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
9
+ | security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
10
+ | review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
11
+ | dotnet-standards | AgentSkills/skills/dotnet-standards/SKILL.md | Load on every C# or .NET change. CQRS, EF Core, DI, async, logging |
12
+ | dotnet-api | AgentSkills/skills/dotnet-api/SKILL.md | RESTful API design, HTTP methods, pagination, OpenAPI/Swagger |
13
+ | csharp-xunit | AgentSkills/skills/csharp-xunit/SKILL.md | xUnit testing, AAA pattern, Facts vs Theories, mocking, assertions |
14
+ | performance | AgentSkills/skills/performance/SKILL.md | Span/ReadOnlySpan, ValueTask, EF Core query tuning, memory pooling |
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: architect
3
+ description: Python architectural design, Clean Architecture, module boundaries, and pyproject.toml packaging.
4
+ ---
5
+
6
+ # Python Architect
7
+
8
+ ## Architectural Principles
9
+ - **Layered Separation**: Enforce clean boundaries across `domain` (entities, value objects), `application` (use cases, services), `infrastructure` (DB, HTTP, queue adapters), and `api` (FastAPI/Flask routes or CLI entry points).
10
+ - **Dependency Direction**: Outer layers depend on inner layers; never let `domain` import from `infrastructure`.
11
+ - **Contract-First Design**: Define `pydantic` schemas and typed interfaces before implementation. Treat data shapes as the primary design artifact.
12
+ - **Packaging**: Structure projects with `pyproject.toml` (`[project]`, `[build-system]`, `[tool.mypy]`, `[tool.ruff]`). Use namespace packages only when cross-team sharing genuinely requires it.
13
+ - **Genuine Reusability**: Extract shared utilities only when the same logic is needed across at least two distinct domains. Avoid premature abstraction (YAGNI).
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: developer
3
+ description: Python feature implementation, async I/O, strict static typing, and uv project management.
4
+ ---
5
+
6
+ # Python Developer
7
+
8
+ ## Implementation Principles
9
+ - **PEP Naming**: `snake_case` for functions, variables, and modules; `PascalCase` for classes; `UPPER_SNAKE_CASE` for constants; `_prefixed` for private members.
10
+ - **Static Typing**: Annotate every function signature and class attribute. Enable `from __future__ import annotations` at the top of every module.
11
+ - **Pydantic Models**: Use `pydantic.BaseModel` for all data contracts, API request/response bodies, and configuration objects. Never use untyped dicts as data boundaries.
12
+ - **Complexity Limits**: Keep functions under 50 lines; maximum 2 levels of nesting; prefer early returns to flatten control flow.
13
+ - **No Magic Literals**: Replace all magic numbers and strings with named constants or `enum.Enum` members.
14
+
15
+ ## Project & Dependency Management
16
+ - Use `uv` for all project operations: `uv init`, `uv add`, `uv run`, `uv sync`.
17
+ - Declare all dependencies in `pyproject.toml`; never mutate the global environment with bare `pip install`.
18
+ - Pin direct dependencies; let `uv.lock` track the full resolved set.
19
+
20
+ ## Async & I/O
21
+ - Use `async`/`await` for all I/O, network, and database operations.
22
+ - Propagate cancellation via `asyncio.CancelledError`; never swallow it silently.
23
+ - Use `asyncio.gather` or task groups (`asyncio.TaskGroup`) for concurrent work; avoid blocking calls on the event loop.
@@ -0,0 +1,13 @@
1
+ # Skills Index
2
+
3
+ Consult this index to load only the skills relevant to the current task.
4
+
5
+ | Skill | Path | Description / When to Load |
6
+ | --- | --- | --- |
7
+ | principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
8
+ | standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
9
+ | security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
10
+ | review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
11
+ | python-standards | AgentSkills/skills/python-standards/SKILL.md | Load on every Python change. PEP 8, typing, uv, ruff, async, logging |
12
+ | testing | AgentSkills/skills/testing/SKILL.md | pytest, pytest-asyncio, hypothesis property testing, fixtures, mocks |
13
+ | performance | AgentSkills/skills/performance/SKILL.md | cProfile/memray, generators, asyncio concurrency, connection pooling |
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: performance
3
+ description: Python profiling, generator patterns, async concurrency, and memory optimization.
4
+ ---
5
+
6
+ # Python Performance
7
+
8
+ ## Profiling First
9
+ - Measure before optimizing: use `cProfile`/`profile` for CPU and `memray` or `tracemalloc` for memory.
10
+ - Profile realistic workloads, not microbenchmarks, to find true hot paths.
11
+
12
+ ## Memory Efficiency
13
+ - Prefer generators and iterators (`yield`) over materializing full lists in memory for large data sets.
14
+ - Use `__slots__` on classes with many instances to eliminate per-instance `__dict__` overhead.
15
+ - Use `functools.lru_cache` or `functools.cache` for pure, referentially transparent functions called repeatedly with the same arguments.
16
+
17
+ ## Async Concurrency
18
+ - Use `asyncio.gather(*tasks)` or `asyncio.TaskGroup` for I/O-bound fan-out; avoid sequential `await` in a loop when tasks are independent.
19
+ - Use connection pools (e.g. `asyncpg` pool, `httpx.AsyncClient`) — never create a new connection per request.
20
+ - Offload CPU-bound work to a `ProcessPoolExecutor` via `loop.run_in_executor`; do not block the event loop.
21
+
22
+ ## Data & Algorithm Choices
23
+ - Use built-in types (`list`, `dict`, `set`) over third-party equivalents for simple cases; they are implemented in C.
24
+ - Use `collections.deque` for queue workloads; avoid `list.pop(0)` (O(n)).
25
+ - Avoid repeated string concatenation in loops; use `"".join(parts)` instead.
26
+ - Prefer comprehensions over `map`/`filter` with lambdas for readability and slight speed advantages.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: python-standards
3
+ description: >
4
+ Load on every Python change. AI agents use this when writing, reviewing,
5
+ refactoring, or optimizing Python for standards, typing, and implementation:
6
+ PEP 8, uv, ruff, mypy or pyright, pydantic, Protocol, TypeVar, Literal,
7
+ TypedDict, async I/O, errors, logging, and maintainability.
8
+ compatibility: Requires Python 3.11+ and uv. Lint and types use ruff and mypy, or pyright when the project already uses it. pydantic for models that cross a boundary.
9
+ ---
10
+
11
+ # Python Standards
12
+
13
+ AI agents load this file on every Python edit, with shared principles and standards. Apply these rules while writing.
14
+
15
+ ## Naming (PEP 8)
16
+ - Modules, packages, functions, variables: `snake_case`
17
+ - Classes: `PascalCase`. Constants: `UPPER_SNAKE_CASE`. Non-public: `_prefix`
18
+ - Use dunder names only for language protocols
19
+
20
+ ## Project
21
+ - Manage the project with `uv` (`uv add`, `uv sync`, `uv run`). Do not `pip install` into the global environment.
22
+ - Put project metadata and tool config in `pyproject.toml`. Commit `uv.lock`.
23
+
24
+ ## Types
25
+ - First statement of every module: `from __future__ import annotations`
26
+ - Annotate every parameter, return, and class attribute. Write `-> None` when a function returns nothing.
27
+ - Do not use `Any`. Use `object`, a bounded `TypeVar`, or `Literal` for a closed set of values.
28
+ - Prefer `Protocol` for injectable behavior. Use `type` aliases on 3.12+, otherwise `TypeAlias`.
29
+ - `TypedDict` for an external dict shape. `pydantic.BaseModel` for data that crosses a layer. `ConfigDict(frozen=True)` for value objects.
30
+ - Validate at the outer boundary (API, CLI, queue), then pass models inward.
31
+ - Enable strict checking. Minimum ruff selection is `E`, `F`, `I`, `UP`, `ANN`.
32
+
33
+ ```toml
34
+ [tool.mypy]
35
+ strict = true
36
+
37
+ [tool.ruff.lint]
38
+ select = ["E", "F", "I", "UP", "ANN"]
39
+ ```
40
+
41
+ If the repository already uses pyright, keep pyright on strict mode instead of adding mypy.
42
+
43
+ ## Async, errors, logging
44
+ - Use `async`/`await` for I/O. Inside `async def`, do not call `time.sleep`, sync `open`, or a sync client.
45
+ - Run independent tasks in `asyncio.TaskGroup`. Re-raise `asyncio.CancelledError`.
46
+ - Domain errors subclass one project base. Catch the narrowest type. Do not use a bare `except`.
47
+ - Use `contextlib.suppress` only for an error the caller intends to ignore.
48
+ - Log with `structlog` or JSON `logging`. No `print` on a production path.
49
+ - Bind request and user ids on the request logger. Never log secrets, tokens, or PII.
50
+
51
+ ## Review Checklist
52
+ - [ ] Names follow PEP 8.
53
+ - [ ] `uv` manages dependencies. `pyproject.toml` and `uv.lock` are current.
54
+ - [ ] Every signature is annotated. No unexplained `Any`.
55
+ - [ ] Boundary data is a pydantic model. External dicts use `TypedDict`.
56
+ - [ ] Async functions do no blocking I/O. `CancelledError` is re-raised.
57
+ - [ ] Exceptions are narrow. Logs are structured and contain no secrets.
58
+ - [ ] `ruff` and the type checker are clean.
59
+
60
+ ## Verify
61
+ After Python edits, run lint, types, and the framework build. Fix what they report:
62
+
63
+ ```bash
64
+ uv run ruff check
65
+ uv run ruff format --check
66
+ uv run mypy
67
+ uv build
68
+ ```
69
+
70
+ Use `uv run pyright` instead of mypy when that is the repository checker. When `pyproject.toml` has no build backend, run `uv run python -m compileall` on the source tree instead of `uv build`.
71
+
72
+ Add or run tests only when the user asks. Then load the `testing` skill and run `uv run pytest`.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: testing
3
+ description: Python unit, async, and property-based testing with pytest, pytest-asyncio, and hypothesis.
4
+ ---
5
+
6
+ # Python Testing
7
+
8
+ ## Testing Principles
9
+ - Test observable behavior and public interfaces, not internal implementation details.
10
+ - Follow the **Arrange-Act-Assert (AAA)** pattern in every test.
11
+ - Keep tests isolated, deterministic, and independent of execution order or external state.
12
+
13
+ ## Project Setup
14
+ - Use `pytest` as the sole test runner; install via `uv add --dev pytest pytest-asyncio pytest-mock hypothesis`.
15
+ - Configure in `pyproject.toml`:
16
+ ```toml
17
+ [tool.pytest.ini_options]
18
+ asyncio_mode = "auto"
19
+ ```
20
+ - Run tests with `uv run pytest`.
21
+
22
+ ## Test Naming & Structure
23
+ - Name test files `test_<module>.py` and place them under a top-level `tests/` directory mirroring the `src/` layout.
24
+ - Name test functions: `test_<function>_<scenario>_<expected>` (e.g., `test_create_user_duplicate_email_raises_conflict`).
25
+ - Match test class names to the class under test: `TestUserService` for `UserService`.
26
+
27
+ ## Fixtures & Parametrize
28
+ - Use `@pytest.fixture` for shared setup; prefer function-scoped fixtures unless sharing is explicitly required.
29
+ - Use `@pytest.mark.parametrize` for data-driven cases covering multiple inputs and edge cases.
30
+ - Mock external I/O boundaries (HTTP, DB, file system) using `pytest-mock` (`mocker.patch`) — never hit real services in unit tests.
31
+
32
+ ## Async Testing
33
+ - Annotate async test functions with `async def`; `asyncio_mode = "auto"` removes the need for `@pytest.mark.asyncio`.
34
+ - Use `AsyncMock` from `unittest.mock` to mock async callables and coroutines.
35
+
36
+ ## Property-Based Testing
37
+ - Use `hypothesis` for algorithmic and data-parsing logic where exhaustive edge-case enumeration is impractical.
38
+ - Define `@given(st.text(), st.integers())` strategies; always run with a fixed `settings(max_examples=200)` in CI.
39
+
40
+ ## Coverage & Quality
41
+ - Target 100% coverage on domain and application layers; exclude infrastructure adapters only with justification.
42
+ - Run `uv run pytest --cov=src --cov-report=term-missing` in CI.
@@ -0,0 +1,13 @@
1
+ # Skills Index
2
+
3
+ Consult this index to load only the skills relevant to the current task.
4
+
5
+ | Skill | Path | Description / When to Load |
6
+ | --- | --- | --- |
7
+ | principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
8
+ | standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
9
+ | security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
10
+ | review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
11
+ | react-typescript | AgentSkills/skills/react-typescript/SKILL.md | Load on every React, TypeScript, or JavaScript change. Strict types, props, hooks |
12
+ | testing | AgentSkills/skills/testing/SKILL.md | Vitest & React Testing Library, user-event, test coverage |
13
+ | performance | AgentSkills/skills/performance/SKILL.md | Render optimization, lazy loading, state colocation, memoization |
@@ -1,22 +1,44 @@
1
1
  ---
2
2
  name: react-typescript
3
- description: React & TypeScript component typing, custom hook design, and type-safe state modeling.
3
+ description: >
4
+ Load on every React, TypeScript, or JavaScript change. AI agents use this
5
+ when writing, reviewing, or refactoring React, TypeScript, and JavaScript:
6
+ strict types, component props, discriminated unions, custom hooks, and forms.
7
+ compatibility: Requires TypeScript with strict enabled and React 18 or newer. Typecheck with tsc --noEmit and lint with the project's ESLint.
4
8
  ---
5
9
 
6
- # React & TypeScript Guidance
10
+ # React and TypeScript Standards
7
11
 
8
- ## Type Design & Component Contracts
9
- - Define strict prop interfaces; avoid `any` or loose `Record<string, unknown>`.
10
- - Use discriminated unions for distinct component states (e.g., `{ status: 'loading' } | { status: 'success'; data: T } | { status: 'error'; error: Error }`).
11
- - Explicitly type event handlers and custom hook return values (use `as const` for tuple returns).
12
+ AI agents load this file on every React, TypeScript, or JavaScript edit, with shared principles and standards. Apply these rules while writing.
12
13
 
13
- ## Custom Hook Guidelines
14
- - Encapsulate reusable stateful logic into focused custom hooks prefixed with `use`.
15
- - Keep hook parameter signatures clean (maximum 4 arguments; use options objects for complex configurations).
16
- - Pass `AbortSignal` to asynchronous functions initiated inside hooks for safe cancellation.
17
- - Return only stable handlers, derived state, and minimal state setters required by callers.
14
+ ## TypeScript
15
+ - Keep `strict` enabled. Do not use `any`. Use `unknown` and narrow it.
16
+ - Export the props type and the return type of every public component and hook.
18
17
 
19
- ## Form & Input Patterns
20
- - Prefer controlled inputs for dynamic form validation; use native form actions where appropriate.
21
- - Bind labels to inputs using `htmlFor` and `id` generated via `useId` for SSR safety.
22
- - Handle disabled, aria-invalid, and error message associations (`aria-describedby`) for robust UX.
18
+ ## Component Contracts
19
+ - Type props with an interface or type alias. Avoid a loose `Record<string, unknown>`.
20
+ - Model states that differ in shape as a discriminated union (`{ status: "loading" } | { status: "success"; data: T } | { status: "error"; error: Error }`).
21
+ - Type event handlers. For a hook tuple return, use `as const`.
22
+
23
+ ## Custom Hooks
24
+ - Put reusable state in a hook named `useSomething`.
25
+ - Keep the parameter list to four. Pass an options object past that.
26
+ - Pass an `AbortSignal` into async work started by the hook.
27
+ - Return stable handlers, derived state, and only the setters the caller needs.
28
+
29
+ ## Forms
30
+ - Use a controlled input when validation is dynamic. Use a native form action when the platform covers it.
31
+ - Bind each label with `htmlFor` and an `id` from `useId`.
32
+ - Wire `aria-invalid` and `aria-describedby` to the error message.
33
+
34
+ ## Review Checklist
35
+ - [ ] `strict` is on. New code has no `any`.
36
+ - [ ] States with different shapes use a discriminated union.
37
+ - [ ] Hooks start with `use`, stay within four parameters, and return stable values.
38
+ - [ ] Async work in a hook accepts an `AbortSignal`.
39
+ - [ ] Inputs have labels, and errors are referenced with `aria-describedby`.
40
+
41
+ ## Verify
42
+ After TypeScript, JavaScript, or React edits, run the project's typecheck, ESLint, and framework build. Fix what they report.
43
+
44
+ Add or run tests only when the user asks. Then load the `testing` skill and run the project's test script.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: architect
3
+ description: Rust workspace design, crate boundaries, trait-based API design, and visibility rules.
4
+ ---
5
+
6
+ # Rust Architect
7
+
8
+ ## Architectural Principles
9
+ - **Workspace Layout**: Use a Cargo workspace (`[workspace]` in root `Cargo.toml`) to separate concerns: e.g. `crates/domain`, `crates/api`, `crates/infra`, `crates/cli`. Each crate has one responsibility.
10
+ - **Visibility Minimization**: Default to `pub(crate)` for intra-workspace sharing; expose items as `pub` only when they form the deliberate public API of the crate.
11
+ - **Trait-Based Design**: Define behavior through traits; depend on trait abstractions (not concrete types) at crate boundaries to enable testing and future substitution without coupling.
12
+ - **Contract-First**: Define data types (`struct`, `enum`) and trait interfaces before implementing business logic. Types are the primary design artifact.
13
+ - **Dependency Direction**: Application crates depend on domain crates; infrastructure crates depend on application traits; no domain crate imports from infrastructure.
14
+ - **Genuine Reusability**: Extract shared code into a library crate only when two or more crates genuinely share the same logic. Avoid premature abstraction (YAGNI).
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: developer
3
+ description: Rust feature implementation, ownership, async with tokio, and idiomatic error propagation.
4
+ ---
5
+
6
+ # Rust Developer
7
+
8
+ ## Implementation Principles
9
+ - **Ownership First**: Design types and function signatures to express ownership intent clearly. Prefer borrowing (`&T`, `&mut T`) over cloning in hot paths; clone only when ownership transfer is genuinely required.
10
+ - **Idiomatic Error Handling**: Use `Result<T, E>` and propagate errors with `?`. Never `unwrap()` or `expect()` in production code paths — reserve them for tests and infallible cases with a comment explaining why.
11
+ - **Zero-Cost Abstractions**: Prefer traits over dynamic dispatch (`Box<dyn Trait>`) unless runtime polymorphism is a firm requirement. Use generics for static dispatch.
12
+ - **Complexity Limits**: Keep functions under 50 lines; maximum 2 levels of nesting; use early `return` or `?` to flatten control flow.
13
+ - **No Magic Literals**: Replace all magic numbers and strings with named constants (`const`) or `enum` variants.
14
+
15
+ ## Tooling Discipline
16
+ - Format every file with `rustfmt` before committing (`cargo fmt`).
17
+ - Fix all `clippy` warnings before committing (`cargo clippy -- -D warnings`).
18
+ - Use `cargo check` as the fast feedback loop during development.
19
+
20
+ ## Async & Concurrency
21
+ - Use `tokio` as the async runtime for all I/O-bound work.
22
+ - Annotate async entry points and test functions with `#[tokio::main]` and `#[tokio::test]`.
23
+ - Use `tokio::spawn` for independent concurrent tasks; use `tokio::join!` or `tokio::try_join!` to await multiple tasks.
24
+ - Protect shared mutable state with `Arc<Mutex<T>>` or `Arc<RwLock<T>>`; prefer message-passing (`tokio::sync::mpsc`) over shared state where possible.
@@ -0,0 +1,13 @@
1
+ # Skills Index
2
+
3
+ Consult this index to load only the skills relevant to the current task.
4
+
5
+ | Skill | Path | Description / When to Load |
6
+ | --- | --- | --- |
7
+ | principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
8
+ | standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
9
+ | security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
10
+ | review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
11
+ | rust-standards | AgentSkills/skills/rust-standards/SKILL.md | Load on every Rust change. Ownership, clippy, thiserror, tracing |
12
+ | testing | AgentSkills/skills/testing/SKILL.md | cargo test, tokio::test, proptest property testing, mockall |
13
+ | performance | AgentSkills/skills/performance/SKILL.md | criterion benchmarking, zero-copy parsing, allocation reduction |
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: performance
3
+ description: Rust benchmarking with criterion, zero-copy design, allocation reduction, and async task efficiency.
4
+ ---
5
+
6
+ # Rust Performance
7
+
8
+ ## Measure First
9
+ - Profile before optimizing: use `criterion` for micro-benchmarks and `cargo flamegraph` (or `perf`) for real workload profiling.
10
+ - Compile with `--release` for all performance measurements; debug builds have no optimizations.
11
+
12
+ ## Allocation & Copy Reduction
13
+ - Prefer borrowing (`&str`, `&[T]`) over owned types (`String`, `Vec<T>`) in hot paths; clone only when ownership transfer is necessary.
14
+ - Use `Cow<'_, str>` to defer allocation until a mutation is actually needed.
15
+ - Use `SmallVec` or fixed-size arrays for collections that are almost always small.
16
+ - Avoid boxing (`Box<T>`) in hot paths; prefer stack allocation for small, fixed-size types.
17
+
18
+ ## Zero-Copy Parsing
19
+ - Use `bytes::Bytes` and slicing for zero-copy network data parsing.
20
+ - Avoid intermediate `String` allocations when parsing structured data; work with `&[u8]` slices directly where possible.
21
+
22
+ ## Async Task Efficiency
23
+ - Minimize the number of `tokio::spawn` calls; spawning is cheap but not free — batch work where possible.
24
+ - Avoid holding `Mutex` guards across `.await` points; release before yielding.
25
+ - Use `tokio::sync::watch` or `tokio::sync::broadcast` for fan-out notifications instead of multiple `Mutex`-protected `Vec` callbacks.
26
+
27
+ ## Iterator Pipelines
28
+ - Use lazy iterator adapters (`map`, `filter`, `flat_map`) over imperative loops; the compiler optimizes chains to a single pass.
29
+ - Prefer `collect::<Vec<_>>()` once at the end of a pipeline rather than intermediate materialization.
30
+ - Use `par_iter()` from `rayon` for CPU-bound parallel data processing — only after profiling confirms a bottleneck.
31
+
32
+ ## Benchmarking
33
+ ```rust
34
+ use criterion::{criterion_group, criterion_main, Criterion};
35
+
36
+ fn bench_parse(c: &mut Criterion) {
37
+ c.bench_function("parse_record", |b| b.iter(|| parse(INPUT)));
38
+ }
39
+
40
+ criterion_group!(benches, bench_parse);
41
+ criterion_main!(benches);
42
+ ```
43
+ Run with `cargo bench`.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: rust-standards
3
+ description: >
4
+ Load on every Rust change. AI agents use this when writing, reviewing,
5
+ refactoring, or optimizing Rust for standards, ownership, and implementation:
6
+ API naming, rustfmt, clippy, thiserror, anyhow, tracing, Cargo layout,
7
+ borrowing, lifetimes, Arc/Mutex, and Send + Sync.
8
+ compatibility: Requires a stable Rust toolchain and Cargo. Format and lint use rustfmt and clippy. thiserror for library errors, anyhow for applications, tracing for logs.
9
+ ---
10
+
11
+ # Rust Standards
12
+
13
+ AI agents load this file on every Rust edit, with shared principles and standards. Apply these rules while writing.
14
+
15
+ ## Naming
16
+ - Types and traits: `PascalCase`. Functions, methods, variables, modules: `snake_case`.
17
+ - Constants and statics: `UPPER_SNAKE_CASE`. Lifetimes: a short lowercase name (`'a`).
18
+ - Library crate names: `snake_case`. Package names in `Cargo.toml`: `kebab-case`.
19
+ - Document public items with `///`.
20
+
21
+ ## Ownership
22
+ - One owner at a time. Many shared borrows (`&T`) or one mutable borrow (`&mut T`), never both.
23
+ - Add a lifetime only when elision cannot see it. Prefer owned `String` and `Vec` in public APIs.
24
+ - `Arc<Mutex<T>>` for shared mutable state. `Arc<RwLock<T>>` when reads dominate. Drop the guard before `.await`.
25
+ - Prefer a channel when the work is producer and consumer. No `Rc` or `Cell` across threads.
26
+ - Do not `clone()` to silence the borrow checker. Restructure the ownership.
27
+
28
+ ## Errors, logging, dependencies
29
+ - Libraries: `thiserror`. Applications: `anyhow` with `context`.
30
+ - No `unwrap()` or `expect()` on a production path. Return `Result` and use `?`. Reserve `panic!` for a programmer bug.
31
+ - Log with `tracing`. Attach fields with `#[tracing::instrument]`. No `println!` in production. Never log secrets.
32
+ - Add a crate only when the standard library does not cover the job. Dev-only crates go in `[dev-dependencies]`.
33
+ - Set `default-features = false` when the crate supports it.
34
+
35
+ ## Review Checklist
36
+ - [ ] `cargo fmt --check` and `cargo clippy -- -D warnings` are clean.
37
+ - [ ] No `unwrap()`, `expect()`, or borrow-checker `clone()` in production code.
38
+ - [ ] Lifetimes appear only where elision fails. Guards drop before `.await`.
39
+ - [ ] Library errors use `thiserror`. Application errors use `anyhow`.
40
+ - [ ] `tracing` is used. Logs contain no secrets. Public items have `///` docs.
41
+ - [ ] `cargo audit` reports no known vulnerabilities.
42
+
43
+ ## Verify
44
+ After Rust edits, run format, clippy, and the framework build. Fix what they report:
45
+
46
+ ```bash
47
+ cargo fmt --check
48
+ cargo clippy -- -D warnings
49
+ cargo build
50
+ ```
51
+
52
+ Add or run tests only when the user asks. Then load the `testing` skill and run `cargo test`.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: testing
3
+ description: Rust unit, async, integration, and property-based testing with cargo test, tokio::test, and proptest.
4
+ ---
5
+
6
+ # Rust Testing
7
+
8
+ ## Testing Principles
9
+ - Test observable behavior through public interfaces, not internal implementation details.
10
+ - Follow the **Arrange-Act-Assert (AAA)** pattern in every test.
11
+ - Keep tests isolated, deterministic, and independent of execution order or external state.
12
+
13
+ ## Unit Tests
14
+ - Place unit tests in the same file as the code under test inside a `#[cfg(test)]` module:
15
+ ```rust
16
+ #[cfg(test)]
17
+ mod tests {
18
+ use super::*;
19
+
20
+ #[test]
21
+ fn create_user_valid_input_returns_ok() {
22
+ // Arrange / Act / Assert
23
+ }
24
+ }
25
+ ```
26
+ - Use descriptive names: `fn <function>_<scenario>_<expected>`.
27
+
28
+ ## Async Tests
29
+ - Use `#[tokio::test]` for async test functions:
30
+ ```rust
31
+ #[tokio::test]
32
+ async fn fetch_user_not_found_returns_error() { ... }
33
+ ```
34
+ - Mock async I/O boundaries with `mockall` (`#[automock]`) — never hit real services in unit tests.
35
+
36
+ ## Integration Tests
37
+ - Place integration tests in the top-level `tests/` directory; each file is a separate test binary.
38
+ - Use `common/mod.rs` (or `common.rs`) under `tests/` for shared test helpers and fixtures.
39
+ - Run with `cargo test --test <name>`.
40
+
41
+ ## Property-Based Testing
42
+ - Use `proptest` for algorithmic and parsing logic where exhaustive edge-case enumeration is impractical.
43
+ ```rust
44
+ proptest! {
45
+ #[test]
46
+ fn parse_roundtrip(s in "\\PC*") { ... }
47
+ }
48
+ ```
49
+
50
+ ## Mocking
51
+ - Use `mockall` to generate mocks for traits: annotate the trait with `#[automock]` and import `MockMyTrait` in tests.
52
+ - Verify expectations explicitly with `.expect(n)` or `.times(n)` on mock methods.
53
+
54
+ ## Running Tests
55
+ ```bash
56
+ cargo test # all tests
57
+ cargo test --lib # unit tests only
58
+ cargo test --test integration # integration tests only
59
+ cargo test -- --nocapture # show stdout during tests
60
+ ```
@@ -2,14 +2,14 @@
2
2
 
3
3
  ## Workflow
4
4
  1. **Memory & Context**: Read `AgentSkills/memory/index.md` (create if missing); load only relevant domain lessons to avoid repeating past mistakes.
5
- 2. **Role & Skill Discovery**: Load relevant role guidance from `AgentSkills/agents/` (`architect.md`, `reviewer.md`, `developer.md`) and skills from `AgentSkills/skills/` (including `AgentSkills/skills/review/SKILL.md`).
5
+ 2. **Role & Skill Discovery**: Consult `AgentSkills/skills/index.md` to identify and load task-specific skills from `AgentSkills/skills/` (including `AgentSkills/skills/review/SKILL.md`). Load relevant role guidance from `AgentSkills/agents/` (`architect.md`, `reviewer.md`, `developer.md`).
6
6
  3. **Pre-flight Inspection**: Inspect current codebase patterns, dependencies, and baseline build/test state.
7
7
  4. **Surgical Implementation**: Apply the minimal change required; adhere strictly to DRY, KISS, and YAGNI.
8
- 5. **Verification**: Run the project's build and test commands (e.g. `npm test`, `dotnet test`, or project test suite) to verify happy paths and edge cases per `AgentSkills/skills/review/SKILL.md`.
8
+ 5. **Verification**: Run the language skill's lint, type feedback, and framework build, and fix what they report. Add or run tests only when the user asks. Follow `AgentSkills/skills/review/SKILL.md`.
9
9
  6. **Learning Loop**: If a mistake was made and corrected or a durable rule discovered, record a concise lesson in `AgentSkills/memory/lessons/<domain>.md` and update `index.md`.
10
10
 
11
11
  ## Completion Checklist
12
- - [ ] Project builds cleanly with zero errors or warnings.
13
- - [ ] Automated tests pass and cover failure paths and edge cases.
12
+ - [ ] Lint, types, and the framework build are clean.
13
+ - [ ] Tests were added or run only because the user asked. They pass when run.
14
14
  - [ ] No dead code, debug logging, unused imports, or temporary files remain.
15
15
  - [ ] Relevant documentation or memory lessons updated if applicable.
@@ -14,10 +14,9 @@ Universal review guidance for AI agents and human reviewers across all stacks. S
14
14
  - **Review**: Adhere strictly to `AgentSkills/skills/review/SKILL.md`.
15
15
 
16
16
  ## Verification & Automated Checks
17
- - [ ] **Clean Build**
18
- - [ ] **Zero Lint Errors**
19
- - [ ] **Tests Pass**
20
- - [ ] **Test Robustness**
17
+ - [ ] **Lint, types, and framework build**
18
+ - [ ] **Tests** added or run only when the user asks
19
+ - [ ] **Test Robustness** when the user asked for tests
21
20
 
22
21
  ## Standards & Skill Compliance
23
22
  - [ ] **Principles**: `AgentSkills/skills/principles/SKILL.md`
@@ -0,0 +1,10 @@
1
+ # Skills Index
2
+
3
+ Consult this index to load only the skills relevant to the current task.
4
+
5
+ | Skill | Path | Description / When to Load |
6
+ | --- | --- | --- |
7
+ | principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
8
+ | standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
9
+ | security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
10
+ | review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
@@ -27,5 +27,5 @@ Bug fix = root cause, not symptom. A bug report names a symptom. Grep every call
27
27
  - **Think Before Coding**: Thoroughly understand requirements. If ambiguous, ask before guessing.
28
28
  - **Surgical Changes**: Make the smallest change that satisfies the request; touch only what is explicitly required.
29
29
  - **Simplicity First (KISS / YAGNI)**: Favor simple, clear, maintainable solutions over clever abstractions. Do not add unrequested features.
30
- - **Zero-Error Builds**: Every change must compile cleanly and pass existing and newly added tests.
30
+ - **Build**: Run the language framework build and fix what it reports before finishing. Add or run tests only when the user asks.
31
31
  - **Standards, Security & Review**: Adhere strictly to `AgentSkills/skills/standards/SKILL.md`, `AgentSkills/skills/security/SKILL.md`, and `AgentSkills/skills/review/SKILL.md`.
@@ -15,9 +15,8 @@ Universal review framework and verification standards for AI agents and human re
15
15
  5. **Performance**: Avoid N+1 queries, unbounded loops, blocking operations in async flows, and redundant re-computations.
16
16
 
17
17
  ## Verification & Automated Checks
18
- - [ ] **Clean Build**: Project builds cleanly with zero errors or warnings.
19
- - [ ] **Zero Lint Errors**: Code adheres to project formatting and static analysis rules.
20
- - [ ] **Tests Pass**: Run test suite; all existing and newly added tests must pass.
18
+ - [ ] **Lint, types, and build**: Formatting, static checks, and the language framework build are clean.
19
+ - [ ] **Tests**: Add or run tests only when the user asks. When run, they pass.
21
20
  - [ ] **Test Robustness**: Tests must cover failure paths, edge cases, and boundary conditions, not just happy paths.
22
21
 
23
22
  ## Review Output Format
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: standards
3
- description: Core code quality, complexity limits, naming, and structural conventions.
3
+ description: Core code quality, simplicity, complexity limits, naming, and structural conventions.
4
4
  ---
5
5
 
6
6
  # Code Standards
@@ -11,11 +11,20 @@ description: Core code quality, complexity limits, naming, and structural conven
11
11
  - **Clean Signatures**: Maximum 4 parameters per function; use an options object or record for complex signatures.
12
12
 
13
13
  ## Design & Clean Code
14
- - **SOLID / DRY / KISS**: Single-responsibility components; eliminate duplicated logic; prefer clear, direct implementations over speculative abstractions (YAGNI).
14
+ - **Simplicity First (KISS / YAGNI)**: Favor simple, clear, maintainable solutions over clever abstractions. Do not add unrequested features.
15
+ - **SOLID / DRY**: Single-responsibility components; eliminate duplicated logic; prefer clear, direct implementations over speculative abstractions (YAGNI).
16
+ - **Less is more**: Avoid over-engineering; prefer fewer moving parts and simpler designs.
17
+ - **Consistent Style**: Follow the repository's style guide; use linters and formatters to enforce consistency.
18
+ - **Configuration & Defaults**: Provide sensible defaults and configuration options; avoid hardcoding values.
19
+ - **separation of Concerns**: Keep business logic, data access, and presentation layers distinct; avoid mixing responsibilities.
20
+ - **Modular Design**: Break down large components into smaller, reusable modules; prefer composition over inheritance.
21
+ - **Dependency Management**: Minimize external dependencies; prefer standard libraries and well-maintained packages; avoid unnecessary bloat.
22
+ - **self-Documenting Code**: Write code that is clear and understandable without excessive comments; use meaningful names and expressive constructs.
23
+ - **security & Privacy**: Follow best practices for secure coding; validate inputs, sanitize outputs, and protect sensitive data.
15
24
  - **Naming & Clarity**: Use descriptive, domain-meaningful names for classes, functions, and variables.
16
25
  - **No Magic Literals**: Replace magic numbers and strings with named constants or enums.
17
26
  - **Contracts & Schemas**: Design explicit, human- and machine-readable data contracts, schemas, and self-describing APIs.
18
- - **Intentional Comments**: Comment only where non-obvious rationale is required, never restate what the code itself expresses.
27
+ - **Intentional Comments**: Comment only where non-obvious rationale is required, never restate what the code itself expresses. Comments should explain "why" not "what". CODE SHOULD BE SELF-DESCRIBING.
19
28
 
20
29
  ## Concurrency & Safety
21
30
  - **Async Safety**: Use idiomatic non-blocking `async`/`await`; ensure operations are free of race conditions and deadlocks.
@@ -3,7 +3,7 @@
3
3
  > Operating instructions and engineering guidelines for AI agents and human contributors.
4
4
 
5
5
  ## Operating Contract
6
- Always follow `AgentSkills/OPERATING.md` before making changes. Review relevant agent personas in `AgentSkills/agents/` (`architect.md`, `reviewer.md`, `developer.md`) and skills in `AgentSkills/skills/` (including `AgentSkills/skills/review/SKILL.md`).
6
+ Always follow `AgentSkills/OPERATING.md` before making changes. Consult `AgentSkills/skills/index.md` to load task-relevant skills (including `AgentSkills/skills/review/SKILL.md`), and review relevant agent personas in `AgentSkills/agents/` (`architect.md`, `reviewer.md`, `developer.md`).
7
7
 
8
8
  ## Goal
9
9
  Implement requested changes with production-quality code, preserving existing behavior and
@@ -17,12 +17,13 @@ minimizing the diff, following the project's own architecture, standards, and co
17
17
  - **Think Before Coding**: Thoroughly understand requirements. If ambiguous, ask before guessing.
18
18
  - **Surgical Changes**: Make the smallest change that satisfies the request; touch only what is explicitly required.
19
19
  - **Simplicity First (KISS / YAGNI)**: Favor simple, clear, maintainable solutions over clever abstractions. Do not add unrequested features.
20
- - **Zero-Error Builds**: Every change must compile cleanly and pass existing and newly added tests.
20
+ - **Build**: Run the language framework build and fix what it reports before finishing. Add or run tests only when the user asks.
21
21
 
22
22
  ## Definition of Done
23
- - Builds cleanly and all tests pass without errors or warnings.
23
+ - Lint, types, and the framework build are clean.
24
+ - Tests are added or run only when the user asks, and they pass when run.
24
25
  - No debug code, dead code, unused imports, or temporary files left behind.
25
- - Changes are minimal, focused, covered by tests, and easy to review.
26
+ - Changes are minimal, focused, and easy to review.
26
27
 
27
28
  ## Agent & Contributor Memory
28
29
  - Read `AgentSkills/memory/index.md` at the start of every task (create if missing); load only relevant domain lessons.
@@ -1,79 +0,0 @@
1
- ---
2
- name: dotnet-best-practices
3
- description: >
4
- Load when writing, reviewing, refactoring, or optimizing .NET/C# code.
5
- Covers project conventions, CQRS, EF Core, async, testing, performance,
6
- logging, security, and maintainability.
7
- ---
8
-
9
- # .NET/C# Best Practices
10
-
11
- Use this skill to keep .NET/C# changes simple, maintainable, testable, and aligned with repository conventions.
12
-
13
- ## Repository Defaults & Structure
14
- - Follow target framework and language versions in `Directory.Build.props` (default `net10.0`, `LangVersion` `latest`).
15
- - Add XML documentation comments for public/shared API surfaces.
16
- - Organize code by feature or domain slices; place controllers, handlers, validators, repositories, and DTOs predictably.
17
- - Prefer clear, direct code over complex or speculative patterns (YAGNI).
18
-
19
- ## CQRS & Architecture
20
- - **Commands**: Mutate state; return void, an identifier, or a minimal result.
21
- - **Queries**: Read state only; never mutate data.
22
- - **Thin Endpoints**: Keep controllers and minimal API endpoints thin; validate transport concerns and dispatch via mediator handlers.
23
- - **Domain Logic**: Encapsulate domain rules in domain entities or domain services, never in transport handlers.
24
- - **Immutability**: Use `record` for commands, queries, and DTOs; mark classes `sealed` unless inheritance is intentionally designed.
25
- - **Interfaces**: Define interfaces for boundaries requiring testing, multiple implementations, or out-of-process integration.
26
-
27
- ## Dependency Injection & Lifetimes
28
- - Use constructor injection or primary constructors for required dependencies.
29
- - Register services with the narrowest appropriate lifetime:
30
- - `Singleton`: Stateless, thread-safe services.
31
- - `Scoped`: Request-bound services and EF Core `DbContext`.
32
- - `Transient`: Lightweight, stateless operations.
33
- - Avoid resolving services manually via `IServiceProvider` or introducing static global state.
34
-
35
- ## Async & I/O
36
- - Use `async`/`await` for all I/O, database, network, and file operations.
37
- - Never block async code using `.Result`, `.Wait()`, or `.GetAwaiter().GetResult()`.
38
- - Accept and propagate `CancellationToken` through all handler, EF Core, and outbound HTTP calls.
39
- - Avoid `async void` except for top-level event handlers.
40
-
41
- ## EF Core & Data Access
42
- - Avoid N+1 queries by using explicit projections, `.Include()`, or separate optimized queries.
43
- - Use `.AsNoTracking()` for all read-only queries.
44
- - Select only needed columns into DTOs instead of loading full tracked entities.
45
- - Implement server-side pagination, filtering, and sorting; never filter unbounded sets in memory.
46
- - Prefer `AnyAsync()` over `CountAsync()` when testing for existence.
47
- - Use `ExecuteUpdateAsync` and `ExecuteDeleteAsync` for bulk operations where appropriate.
48
-
49
- ## Logging & Observability
50
- - Use structured logging with message templates and named properties (`LogInformation("Order {OrderId} processed", id)`).
51
- - Avoid logging inside tight loops or hot execution paths.
52
- - Propagate correlation/request IDs across service and HTTP boundaries.
53
- - Never log secrets, passwords, connection strings, or sensitive personal data (PII).
54
-
55
- ## HTTP & Resilient Integration
56
- - Use `IHttpClientFactory` for outbound HTTP calls.
57
- - Set explicit timeouts and pass cancellation tokens to all HTTP calls.
58
- - Use bounded retries with exponential backoff for transient failures; avoid unbounded retry storms.
59
- - Batch outbound requests rather than making external calls inside tight loops.
60
-
61
- ## Security & Validation
62
- - Validate all incoming request payloads using FluentValidation or Data Annotations.
63
- - Never concatenate raw user input into SQL queries, shell commands, or file paths.
64
- - Follow the principle of least privilege for database connections and external service credentials.
65
-
66
- ## Testing Standards
67
- - Use xUnit for unit and integration testing.
68
- - Structure tests using Arrange-Act-Assert (AAA).
69
- - Test happy paths, edge cases, validation failures, and cancellation flows.
70
- - Keep tests isolated, deterministic, and idempotent.
71
-
72
- ## Review Checklist
73
- - [ ] No N+1 queries; read-only EF Core queries use `.AsNoTracking()`.
74
- - [ ] DTO projections used; no full entity graphs exposed to callers.
75
- - [ ] Async methods propagate `CancellationToken` without blocking.
76
- - [ ] DI lifetimes correctly configured (`Scoped` for DbContext).
77
- - [ ] Structured logging used without leaking sensitive data or secrets.
78
- - [ ] Input validation applied at boundaries.
79
- - [ ] Tests pass and cover edge cases.