@pratikpsl/agent-skills 0.9.0 → 1.0.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 (93) hide show
  1. package/README.md +59 -99
  2. package/dist/bin/agent-skills.d.ts.map +1 -1
  3. package/dist/bin/agent-skills.js +0 -3
  4. package/dist/bin/agent-skills.js.map +1 -1
  5. package/dist/cli/index.js +41 -33
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/core/ide-map.d.ts +3 -9
  8. package/dist/core/ide-map.d.ts.map +1 -1
  9. package/dist/core/ide-map.js +16 -33
  10. package/dist/core/ide-map.js.map +1 -1
  11. package/dist/core/install-template.d.ts +21 -0
  12. package/dist/core/install-template.d.ts.map +1 -0
  13. package/dist/core/install-template.js +119 -0
  14. package/dist/core/install-template.js.map +1 -0
  15. package/dist/core/resolve-template.d.ts +4 -0
  16. package/dist/core/resolve-template.d.ts.map +1 -0
  17. package/dist/core/resolve-template.js +22 -0
  18. package/dist/core/resolve-template.js.map +1 -0
  19. package/package.json +2 -2
  20. package/templates/default/instructions.md +26 -28
  21. package/templates/dotnet/AgentSkills/agents/architect.agent.md +8 -54
  22. package/templates/dotnet/AgentSkills/agents/developer.agent.md +8 -83
  23. package/templates/dotnet/AgentSkills/skills/csharp-xunit/SKILL.md +32 -58
  24. package/templates/dotnet/AgentSkills/skills/dotnet-best-practices/SKILL.md +62 -153
  25. package/templates/dotnet/AgentSkills/skills/performance/SKILL.md +18 -0
  26. package/templates/react/AgentSkills/agents/developer.agent.md +23 -0
  27. package/templates/react/AgentSkills/skills/performance/SKILL.md +18 -0
  28. package/templates/react/AgentSkills/skills/react-typescript/SKILL.md +22 -0
  29. package/templates/react/AgentSkills/skills/testing/SKILL.md +17 -0
  30. package/templates/shared/AgentSkills/OPERATING.md +15 -0
  31. package/templates/shared/AgentSkills/agents/architect.agent.md +12 -0
  32. package/templates/shared/AgentSkills/agents/reviewer.agent.md +26 -0
  33. package/templates/shared/AgentSkills/skills/security/SKILL.md +18 -0
  34. package/templates/shared/AgentSkills/skills/standards/SKILL.md +27 -0
  35. package/templates/shared/entry-points/instructions.md +24 -0
  36. package/dist/cli/commands/add.d.ts +0 -3
  37. package/dist/cli/commands/add.d.ts.map +0 -1
  38. package/dist/cli/commands/add.js +0 -73
  39. package/dist/cli/commands/add.js.map +0 -1
  40. package/dist/cli/commands/dotnet-setup.d.ts +0 -5
  41. package/dist/cli/commands/dotnet-setup.d.ts.map +0 -1
  42. package/dist/cli/commands/dotnet-setup.js +0 -83
  43. package/dist/cli/commands/dotnet-setup.js.map +0 -1
  44. package/dist/cli/commands/init.d.ts +0 -3
  45. package/dist/cli/commands/init.d.ts.map +0 -1
  46. package/dist/cli/commands/init.js +0 -36
  47. package/dist/cli/commands/init.js.map +0 -1
  48. package/dist/cli/commands/list.d.ts +0 -3
  49. package/dist/cli/commands/list.d.ts.map +0 -1
  50. package/dist/cli/commands/list.js +0 -37
  51. package/dist/cli/commands/list.js.map +0 -1
  52. package/dist/cli/commands/setup.d.ts +0 -9
  53. package/dist/cli/commands/setup.d.ts.map +0 -1
  54. package/dist/cli/commands/setup.js +0 -77
  55. package/dist/cli/commands/setup.js.map +0 -1
  56. package/dist/core/copy-skills.d.ts +0 -30
  57. package/dist/core/copy-skills.d.ts.map +0 -1
  58. package/dist/core/copy-skills.js +0 -84
  59. package/dist/core/copy-skills.js.map +0 -1
  60. package/dist/core/load-pack.d.ts +0 -15
  61. package/dist/core/load-pack.d.ts.map +0 -1
  62. package/dist/core/load-pack.js +0 -35
  63. package/dist/core/load-pack.js.map +0 -1
  64. package/dist/core/manifest.d.ts +0 -21
  65. package/dist/core/manifest.d.ts.map +0 -1
  66. package/dist/core/manifest.js +0 -170
  67. package/dist/core/manifest.js.map +0 -1
  68. package/dist/core/resolve-pack.d.ts +0 -7
  69. package/dist/core/resolve-pack.d.ts.map +0 -1
  70. package/dist/core/resolve-pack.js +0 -59
  71. package/dist/core/resolve-pack.js.map +0 -1
  72. package/templates/dotnet/AgentSkills/OPERATING.md +0 -85
  73. package/templates/dotnet/AgentSkills/README.md +0 -64
  74. package/templates/dotnet/AgentSkills/agents/README.md +0 -16
  75. package/templates/dotnet/AgentSkills/entry-points/entry-point.md +0 -49
  76. package/templates/dotnet/AgentSkills/memory/index.md +0 -22
  77. package/templates/dotnet/AgentSkills/memory/lessons/api.md +0 -3
  78. package/templates/dotnet/AgentSkills/memory/lessons/auth.md +0 -3
  79. package/templates/dotnet/AgentSkills/memory/lessons/csharp.md +0 -3
  80. package/templates/dotnet/AgentSkills/memory/lessons/db.md +0 -3
  81. package/templates/dotnet/AgentSkills/memory/lessons/design.md +0 -3
  82. package/templates/dotnet/AgentSkills/memory/lessons/infra.md +0 -8
  83. package/templates/dotnet/AgentSkills/memory/lessons/mcp.md +0 -3
  84. package/templates/dotnet/AgentSkills/memory/lessons/testing.md +0 -3
  85. package/templates/dotnet/AgentSkills/memory/schema.md +0 -26
  86. package/templates/dotnet/AgentSkills/skills/INDEX.md +0 -21
  87. package/templates/dotnet/AgentSkills/skills/README.md +0 -14
  88. package/templates/dotnet/AgentSkills/skills/code-standards/SKILL.md +0 -122
  89. package/templates/dotnet/AgentSkills/skills/core/SKILL.md +0 -83
  90. package/templates/dotnet/AgentSkills/skills/design/SKILL.md +0 -108
  91. package/templates/dotnet/AgentSkills/skills/harness/SKILL.md +0 -62
  92. package/templates/dotnet/AgentSkills/skills/mcp_dotnet/SKILL.md +0 -54
  93. package/templates/shared/manifest.json +0 -57
@@ -1,22 +0,0 @@
1
- # Memory Index
2
-
3
- Always load this file first. Then load **only** the domain file(s) that match your task.
4
- Do NOT load domain files you do not need. Never load all files at once.
5
-
6
- ## Domain Map
7
-
8
- | Domain | Load when | File | Lessons |
9
- | ------- | ------------------------------------------------------------- | ---------------------------------------- | ------- |
10
- | api | CQRS, MediatR, commands, queries, controllers, endpoints | [lessons/api.md](lessons/api.md) | 1 |
11
- | db | EF Core, migrations, schema, seeding, repositories | [lessons/db.md](lessons/db.md) | 0 |
12
- | infra | Build, paths, CI, tooling, portability, AgentSkills setup | [lessons/infra.md](lessons/infra.md) | 6 |
13
- | auth | Authentication, authorisation, JWT, policies, claims | [lessons/auth.md](lessons/auth.md) | 0 |
14
- | testing | xUnit, test data, mocking, coverage, assertions | [lessons/testing.md](lessons/testing.md) | 0 |
15
- | csharp | C# language features, async/await, naming, code style | [lessons/csharp.md](lessons/csharp.md) | 0 |
16
- | design | SOLID, CQRS, Repository, patterns, architecture decisions | [lessons/design.md](lessons/design.md) | 0 |
17
- | mcp | MCP server tools, transports, contracts, .NET MCP integration | [lessons/mcp.md](lessons/mcp.md) | 0 |
18
-
19
- ## Writing a lesson?
20
-
21
- Load `memory/schema.md` for the one-line format. Do not inline logging instructions here.
22
- Update the lesson count in this table after appending to the domain file.
@@ -1,3 +0,0 @@
1
- # API Lessons
2
-
3
- RULE: Controllers dispatch only via MediatR; all business rules belong in Domain Entities or Domain Services, never in Handlers or Controllers. #cqrs-violation 2026-05-31
@@ -1,3 +0,0 @@
1
- # Auth Lessons
2
-
3
- <!-- No lessons yet. Append using the format in memory/schema.md -->
@@ -1,3 +0,0 @@
1
- # C# Lessons
2
-
3
- <!-- No lessons yet. Append using the format in memory/schema.md -->
@@ -1,3 +0,0 @@
1
- # DB Lessons
2
-
3
- <!-- No lessons yet. Append using the format in memory/schema.md -->
@@ -1,3 +0,0 @@
1
- # Design Lessons
2
-
3
- RULE: Always use flat vertical slice feature folders; never create nested Commands or Queries subfolders. #wrong-path 2026-07-05
@@ -1,8 +0,0 @@
1
- # Infra Lessons
2
-
3
- RULE: Never overwrite files in AgentSkills/ without verifying they are backed up; it is the single source of truth and tool-specific entry points must point to it, never duplicate it. #circular-redirect 2026-05-31
4
- RULE: Use repo-relative paths in all agent and IDE instruction files; never write absolute local drive paths in shared documentation. #wrong-path 2026-06-06
5
- RULE: When splitting a monolithic memory file into domain files, grep the whole repo for the old path and update every reference before deleting the original. #stale-reference 2026-06-07
6
- RULE: Always check native command exit codes explicitly in PowerShell harness scripts. #native-exit-code 2026-06-21
7
- RULE: Run dotnet format after patching C# files; this repo enforces CRLF and no final newline. #format-fail 2026-07-01
8
- RULE: Always execute the full AgentSkills bootstrap sequence before any code-changing task, even simple ones. #bootstrap-skip 2026-07-05
@@ -1,3 +0,0 @@
1
- # MCP Lessons
2
-
3
- <!-- No lessons yet. Append using the format in memory/schema.md -->
@@ -1,3 +0,0 @@
1
- # Testing Lessons
2
-
3
- <!-- No lessons yet. Append using the format in memory/schema.md -->
@@ -1,26 +0,0 @@
1
- # Lesson Logging Schema
2
-
3
- Load this file **only when writing a new lesson** at the end of a task.
4
- Never load at task start — it adds no value during execution.
5
-
6
- ## Format
7
-
8
- Append one line per lesson to the correct domain file in `memory/lessons/`:
9
-
10
- ```
11
- RULE: <imperative sentence — what to always do or never do> #tag YYYY-MM-DD
12
- ```
13
-
14
- ## Rules for a good entry
15
-
16
- - Start with **Always**, **Never**, or an action verb.
17
- - Keep it under 20 words. The rule only — no symptom narrative, no root cause prose.
18
- - Add one `#tag` describing the symptom class (e.g. `#build-fail`, `#wrong-path`, `#cqrs-violation`).
19
- - Pick the correct domain from `memory/index.md`. If unsure, use `infra.md`.
20
- - After appending, **increment the lesson count** for that domain in `memory/index.md`.
21
-
22
- ## Example
23
-
24
- ```
25
- RULE: Never place business logic in MediatR Handlers; delegate to domain entities or services. #cqrs-violation 2026-05-31
26
- ```
@@ -1,21 +0,0 @@
1
- # Skills Index
2
-
3
- Load the relevant skill from `AgentSkills/skills/` before starting any task.
4
- Start with `AgentSkills/OPERATING.md` for the shared prerequisite and completion workflow.
5
-
6
- `AgentSkills/` is the single source of truth for all skills and agents.
7
- Do not duplicate skill content under `.github/`, `.copilot/`, `.codex/`, or other tool-specific folders.
8
- All AI tools and IDEs should load skills from this folder.
9
-
10
- ## Skills
11
-
12
- | Skill | Load when | Path |
13
- |---|---|---|
14
- | **core** | Every task | [SKILL.md](core/SKILL.md) |
15
- | **code-standards** | Writing, reviewing, or refactoring C# code | [SKILL.md](code-standards/SKILL.md) |
16
- | **design** | Designing, architecting, or implementing patterns | [SKILL.md](design/SKILL.md) |
17
- | **dotnet-best-practices** | Writing, reviewing, refactoring, or optimizing .NET/C# code | [SKILL.md](dotnet-best-practices/SKILL.md) |
18
- | **csharp-xunit** | Get best practices for XUnit unit testing, including data-driven tests | [SKILL.md](csharp-xunit/SKILL.md) |
19
- | **mcp_dotnet** | Building, reviewing, or extending .NET MCP server tools, transports, and integration points | [SKILL.md](mcp_dotnet/SKILL.md) |
20
- | **dotnet-api** | Creating, structuring, or reviewing .NET 10 Web API projects with Swagger/OpenAPI, CORS, compression, auth, versioning, and error handling | [SKILL.md](dotnet-api/SKILL.md) |
21
- | **harness** | Changing agent instructions, validation scripts, CI workflows, hooks, or operational guardrails | [SKILL.md](harness/SKILL.md) |
@@ -1,14 +0,0 @@
1
- # Skills
2
-
3
- This folder is the canonical source of truth for reusable skills used by all AI tools and IDEs in this repository.
4
-
5
- Do not duplicate skill content under `.github/`, `.copilot/`, `.codex/`, or other tool-specific folders.
6
- Those tools should load skill definitions from this folder.
7
-
8
- ## Skill Index
9
-
10
- Start with `AgentSkills/skills/INDEX.md`, then load only the skills that match the task.
11
-
12
- ## Harness Skill
13
-
14
- Use `AgentSkills/skills/harness/SKILL.md` when changing guides, sensors, hooks, CI, validation, or operational guardrails.
@@ -1,122 +0,0 @@
1
- ---
2
- name: code-standards
3
- description: >
4
- Load when writing, reviewing, or refactoring C# code.
5
- Covers naming, structure, comments, and commit hygiene.
6
- ---
7
-
8
- # Code Standards
9
-
10
- Language: C#. Every example is production code, not pseudocode.
11
-
12
- ## 1. No Magic Values
13
-
14
- ```csharp
15
- // Bad
16
- if (role == 3) { }
17
-
18
- // Good
19
- private const int AdminRoleId = 3;
20
- if (role == AdminRoleId) { }
21
- ```
22
-
23
- ## 2. Meaningful Names
24
-
25
- Names explain what a value represents and why it matters. If a comment is needed to explain a variable, rename it.
26
-
27
- ```csharp
28
- // Bad
29
- int d = 86400;
30
- bool flag = true;
31
-
32
- // Good
33
- const int SecondsPerDay = 86400;
34
- bool isUserVerified = true;
35
- ```
36
-
37
- ## 3. One Function, One Responsibility
38
-
39
- One function should do one thing. If you cannot summarize it in one sentence, split it.
40
-
41
- ## 4. Descriptive Booleans
42
-
43
- ```csharp
44
- // Bad
45
- bool check = true;
46
-
47
- // Good
48
- bool hasPermission = true;
49
- bool isSessionExpired = false;
50
- ```
51
-
52
- ## 5. DRY
53
-
54
- Keep one source of truth per piece of logic. Apply judgment: premature abstraction is also harmful.
55
-
56
- ## 6. Early Returns Over Deep Nesting
57
-
58
- ```csharp
59
- // Bad
60
- void Process(User user)
61
- {
62
- if (user != null)
63
- {
64
- if (user.IsActive)
65
- {
66
- // Main logic
67
- }
68
- }
69
- }
70
-
71
- // Good
72
- void Process(User user)
73
- {
74
- if (user is null) return;
75
- if (!user.IsActive) return;
76
-
77
- // Main logic
78
- }
79
- ```
80
-
81
- ## 7. Comment Why, Not What
82
-
83
- ```csharp
84
- // Bad
85
- // Increment counter.
86
- count++;
87
-
88
- // Good
89
- // Back off before HTTP 429; this API caps requests at 100 per minute.
90
- if (requestCount >= RateLimitBackoffThreshold) { }
91
- ```
92
-
93
- ## 8. Limit Function Arguments
94
-
95
- More than 3 arguments should usually become a config object, command object, or record.
96
-
97
- ```csharp
98
- // Bad
99
- CreateUser("Alice", "alice@example.com", true, "admin", "UTC");
100
-
101
- // Good
102
- CreateUser(new UserConfig
103
- {
104
- Name = "Alice",
105
- Email = "alice@example.com",
106
- IsVerified = true,
107
- Role = Role.Admin,
108
- Timezone = "UTC"
109
- });
110
- ```
111
-
112
- ## 9. Meaningful Commits
113
-
114
- ```text
115
- Bad:
116
- fix bug
117
- update stuff
118
-
119
- Good:
120
- fix: prevent double-submit on payment
121
- refactor: extract shared email validation
122
- ```
@@ -1,83 +0,0 @@
1
- ---
2
- name: core
3
- description: >
4
- Load on every task. Non-negotiable principles that govern
5
- all work: how to think, what to change, and how to verify.
6
- ---
7
-
8
- # Core Principles
9
-
10
- > Simplification is the ultimate sophistication.
11
- > Write code that is simple, small, easy to delete, and adds nothing unnecessary.
12
-
13
- 1. **Think Before Coding** – Understand the goal before writing a line. If requirements are ambiguous, **stop and ask** — assumptions compound. Surface tradeoffs to the caller, not just in comments.
14
- 2. **Simplicity First** - Write the minimum code that correctly solves the problem. Avoid speculative features.
15
- 3. **Surgical Changes** – Touch only what the task requires. Avoid "while I'm here" changes. Refactoring is a separate, explicit task — never bundled into a feature or fix.
16
- 4. **Goal-Driven Testing** – Define success before writing code. Tests are the contract. Cover the failure path — a test suite that only passes on happy inputs is not a contract, it's a wish.
17
- 5. **No Race Conditions** - Treat shared mutable state as dangerous. Prefer immutability.
18
- 6. **Agent Memory** – Every task is a learning loop. Read `AgentSkills/memory/index.md` at task start, then load only the domain file(s) matching your task. Before closing, check if a new lesson is warranted — if so, read `AgentSkills/memory/schema.md`, append one line to the correct domain file, and update the count in `index.md`.
19
-
20
- 7. **Fail Loudly, Recover Gracefully** – Errors are a first-class output. When something goes wrong, fail loudly with context (what, where, relevant IDs). Never swallow exceptions silently. Recovery paths must be as deliberate as the happy path.
21
-
22
- 8. **Prefer Reversible Moves** – When two approaches solve the problem equally well, choose the one that can be undone. Flag irreversible changes (schema drops, destructive migrations, hard deletes) explicitly before executing them.
23
-
24
- ## Prerequisite Gate
25
-
26
- Every task starts with the shared operating contract in
27
- `AgentSkills/OPERATING.md`.
28
-
29
- Before editing, confirm that you have:
30
-
31
- - [ ] Read `AgentSkills/memory/index.md` and loaded only the relevant domain
32
- lesson file(s).
33
- - [ ] Read `AgentSkills/skills/INDEX.md`.
34
- - [ ] Loaded this core skill.
35
- - [ ] Loaded task-specific skills and agent definitions only when they apply.
36
- - [ ] Identified the expected verification command(s).
37
- - [ ] Checked the worktree context so existing user changes are preserved.
38
-
39
- ## Pre-submit Checklist
40
-
41
- ### Scope
42
-
43
- - [ ] Only required files changed; no unrelated refactors or metadata churn.
44
- - [ ] Public documentation changed only when behavior, setup, commands, or usage changed.
45
- - [ ] Commit message states what changed and why, when a commit is made.
46
- - [ ] Memory was updated only if a mistake or durable project-specific rule was discovered.
47
-
48
- ### Design and Maintainability
49
-
50
- - [ ] Code is as simple as possible, but no simpler.
51
- - [ ] No speculative generality or unused extension points.
52
- - [ ] Each function does one thing.
53
- - [ ] No argument list longer than 4; use an object, options type, or record.
54
- - [ ] No nesting deeper than 2 levels; prefer early returns.
55
- - [ ] No duplicated logic; shared behavior is extracted only when it is real reuse.
56
- - [ ] SOLID respected, especially Single Responsibility.
57
- - [ ] Important values are named; no magic literals.
58
- - [ ] Comments explain why, not what the code already says.
59
-
60
- ### Reliability and Security
61
-
62
- - [ ] No race condition on shared mutable state.
63
- - [ ] All async operations have a cancellation path.
64
- - [ ] No sensitive data such as keys, PII, or tokens appears in logs, errors, commits, or responses.
65
- - [ ] External inputs are validated before use.
66
- - [ ] Rendered outputs are sanitized where applicable.
67
- - [ ] Errors include useful context: what failed, where, and relevant IDs.
68
- - [ ] Structured log entries are used; no raw string concatenation in logs.
69
- - [ ] Correlation or trace IDs are propagated on cross-service calls.
70
-
71
- ### API and Contract Behavior
72
-
73
- - [ ] API responses use correct HTTP status codes; errors are not returned as `200`.
74
- - [ ] Collection endpoints include pagination and filtering where applicable.
75
- - [ ] Existing API contracts are preserved unless a versioned breaking change is intentional.
76
- - [ ] MCP, REST, and application contracts stay aligned when they expose the same behavior.
77
-
78
- ### Tests and Verification
79
-
80
- - [ ] Tests cover failure paths, not just happy paths.
81
- - [ ] Test names describe behavior, not implementation.
82
- - [ ] Tests do not depend on external state or execution order.
83
- - [ ] Relevant build, test, format, and harness commands were run, or skipped with a clear reason.
@@ -1,108 +0,0 @@
1
- ---
2
- name: design
3
- description: >
4
- Load when designing, architecting, or implementing patterns in C#.
5
- Covers project folder structure (vertical slice), SOLID, KISS, YAGNI,
6
- DRY, composition, Singleton, and Factory.
7
- ---
8
-
9
- # Design Principles and Patterns
10
-
11
- ## Project Structure
12
-
13
- Organise by **feature (vertical slice)**, not by technical layer.
14
- Each feature folder owns everything needed for its use case: command, handler, DTO, validator, and endpoint.
15
- This keeps changes local, avoids cross-cutting layers, and scales without requiring global refactors.
16
-
17
- ```text
18
- src/
19
- ├── Features/
20
- │ ├── Products/
21
- │ │ ├── CreateProductCommand.cs
22
- │ │ ├── CreateProductHandler.cs
23
- │ │ ├── ProductDto.cs
24
- │ │ ├── ProductValidator.cs
25
- │ │ └── ProductEndpoints.cs
26
- │ ├── Orders/
27
- │ │ ├── CreateOrderCommand.cs
28
- │ │ ├── CreateOrderHandler.cs
29
- │ │ ├── OrderDto.cs
30
- │ │ ├── OrderValidator.cs
31
- │ │ └── OrderEndpoints.cs
32
- │ └── ...
33
- ├── Shared/
34
- │ ├── Middleware/
35
- │ └── Utilities/
36
- └── Program.cs
37
- ```
38
-
39
- **Rules:**
40
- - One folder per feature — never split a feature across `Commands/`, `Queries/`, `Controllers/` top-level layers.
41
- - When a feature grows, split it into sub-features within the same `Features/<Feature>/` directory before creating a new top-level folder.
42
- - Shared cross-cutting code (middleware, utilities, base types) lives in `Shared/`, not duplicated per feature.
43
- - `Program.cs` wires up DI, middleware, and endpoint registration only — no business logic.
44
-
45
- ## SOLID
46
-
47
- | | Principle | In Practice |
48
- |---|---|---|
49
- | S | Single Responsibility | One class, one reason to change |
50
- | O | Open / Closed | Open to extension, closed to modification |
51
- | L | Liskov Substitution | Subtypes must work wherever the base type works |
52
- | I | Interface Segregation | Small, focused interfaces over large, general ones |
53
- | D | Dependency Inversion | Depend on abstractions, not concrete implementations |
54
-
55
- ## KISS
56
-
57
- Prefer the obvious solution. If a junior engineer cannot understand it in 5 minutes, simplify it.
58
-
59
- ## YAGNI
60
-
61
- Do not build something until it is needed. Solve today's requirement, not tomorrow's guess.
62
-
63
- ```csharp
64
- // Bad: built "just in case" when only one format exists.
65
- public interface IExporter { }
66
- public class ExporterFactory { }
67
-
68
- // Good: solve what exists now.
69
- public string ExportToCsv(Report report) { }
70
- ```
71
-
72
- ## DRY
73
-
74
- Keep one source of truth per piece of knowledge: logic, configuration, and data schemas.
75
-
76
- ## Composition Over Inheritance
77
-
78
- Use inheritance only for true "is-a" relationships. Prefer interfaces and delegation.
79
-
80
- ## Pattern: Singleton
81
-
82
- Use when exactly one instance must coordinate shared state. Avoid when it creates hidden global state.
83
-
84
- ```csharp
85
- public sealed class AppConfig
86
- {
87
- private static readonly Lazy<AppConfig> InstanceHolder =
88
- new(() => new AppConfig());
89
-
90
- public static AppConfig Instance => InstanceHolder.Value;
91
-
92
- private AppConfig()
93
- {
94
- }
95
- }
96
- ```
97
-
98
- ## Pattern: Factory
99
-
100
- Use when creation is complex, varies by type, or must be decoupled from consumers.
101
-
102
- ```csharp
103
- // Bad
104
- var handler = type == "email" ? new EmailHandler() : new SmsHandler();
105
-
106
- // Good
107
- var handler = NotificationFactory.Create(type);
108
- ```
@@ -1,62 +0,0 @@
1
- ---
2
- name: harness
3
- description: >
4
- Load when changing agent instructions, validation scripts, CI workflows,
5
- hooks, or repository operational guardrails.
6
- ---
7
-
8
- # Harness Engineering
9
-
10
- Harness engineering is the operational layer around the model:
11
-
12
- ```text
13
- Agent = Model + Harness
14
- ```
15
-
16
- Use this skill when adding or changing guide rails, validation, recovery, or feedback loops.
17
-
18
- ## Controls
19
-
20
- | Control | Purpose | Repo examples |
21
- |---|---|---|
22
- | Guides | Feedforward controls that steer work before action | `AGENTS.md`, `AgentSkills/skills/INDEX.md`, `AgentSkills/agents/` |
23
- | Sensors | Feedback controls that observe output after action | `tools/Harness/validate.ps1`, `.github/workflows/dotnet.yml`, `.editorconfig` |
24
-
25
- ## Rules
26
-
27
- - Keep `AgentSkills/` as the canonical source of truth.
28
- - Tool-specific folders may contain lightweight entry points only.
29
- - Prefer one shared validation command over duplicated CI, hook, and README commands.
30
- - Sensors must be deterministic first: restore, build, test, format.
31
- - Use inferential review only after computational checks pass.
32
- - Keep harness changes small, readable, and easy to remove.
33
-
34
- ## Agent and IDE Entry Point Contract
35
-
36
- All coding agents and AI-enabled IDEs must start from
37
- `AgentSkills/OPERATING.md`.
38
-
39
- Tool-specific entry points must be short router files that:
40
-
41
- - Identify themselves as lightweight entry points.
42
- - Point to `AgentSkills/OPERATING.md`.
43
- - Point to `AgentSkills/skills/INDEX.md` for skill routing.
44
- - Point to `AgentSkills/agents/` for optional role definitions.
45
- - Avoid duplicating project rules, checklists, memory instructions, or skill content.
46
-
47
- When a new agent or IDE integration is added, create only the smallest entry
48
- point required by that tool and route it back to `AgentSkills/`.
49
-
50
- ## Validation
51
-
52
- Run the shared sensor before finishing changes:
53
-
54
- ```powershell
55
- pwsh ./tools/Harness/validate.ps1
56
- ```
57
-
58
- For quick local loops:
59
-
60
- ```powershell
61
- pwsh ./tools/Harness/validate.ps1 -Configuration Debug -SkipFormat
62
- ```
@@ -1,54 +0,0 @@
1
- ---
2
- name: mcp_dotnet
3
- description: >
4
- Load when building, reviewing, or extending .NET MCP server tools,
5
- transports, contracts, and IDE/client integration.
6
- ---
7
-
8
- # MCP .NET Skill
9
-
10
- Use this skill for Model Context Protocol work in this repository.
11
-
12
- ## Project Rules
13
-
14
- - Keep MCP tools thin; route behavior through the same MediatR commands and queries used by REST endpoints.
15
- - Do not duplicate business logic in MCP tool methods.
16
- - Treat MCP tool contracts as public API: use stable names, clear descriptions, explicit input types, and small output DTOs.
17
- - Pass `CancellationToken` through all tool, mediator, EF Core, and HTTP boundaries.
18
- - Keep stdout reserved for MCP protocol messages when using stdio transport; send logs to stderr.
19
- - Validate tool inputs before dispatching commands or queries.
20
- - Avoid exposing raw entities, stack traces, connection strings, secrets, or internal schema details.
21
- - Add or update tests for tool behavior and contract mapping when MCP behavior changes.
22
-
23
- ## Tool Design Checklist
24
-
25
- - [ ] Tool name is action-oriented and stable, for example `get_employee_by_id`.
26
- - [ ] Description tells the model when to use the tool.
27
- - [ ] Inputs are minimal and strongly typed.
28
- - [ ] Output is a DTO or result object, not an EF entity.
29
- - [ ] Tool delegates to MediatR or an existing application service.
30
- - [ ] Errors are structured and safe to show to an AI client.
31
- - [ ] Cancellation token is accepted and passed through.
32
- - [ ] New tools are documented in the relevant MCP docs when public usage changes.
33
-
34
- ## Implementation Shape
35
-
36
- ```csharp
37
- [McpTool("get_employee_by_id", "Gets one employee by id.")]
38
- public static async Task<EmployeeDto?> GetEmployeeByIdAsync(
39
- Guid employeeId,
40
- IMediator mediator,
41
- CancellationToken cancellationToken)
42
- {
43
- return await mediator.Send(
44
- new GetEmployeeByIdQuery(employeeId),
45
- cancellationToken);
46
- }
47
- ```
48
-
49
- ## Transport Notes
50
-
51
- - HTTP transport can share ASP.NET Core middleware for auth, validation, logging, and error handling.
52
- - Stdio transport must not write normal logs to stdout.
53
- - Keep `mcp.json` entries simple and point to built server artifacts or stable commands.
54
- - If a client cannot discover tools, verify the server builds, starts, and returns valid MCP initialize/list-tools responses.
@@ -1,57 +0,0 @@
1
- {
2
- "name": "@pratikpsl/agent-skills",
3
- "version": "0.9.0",
4
- "description": "Universal single-file AI agent instructions for all programming languages, OSes, and IDEs (Cursor, Claude, Copilot, Codex, Antigravity, Windsurf, Cline).",
5
- "skills": [
6
- {
7
- "name": "instructions",
8
- "description": "Canonical single-file coding agent instructions (Goal, Principles, Definition of Done).",
9
- "path": "instructions.md",
10
- "dest": "AGENTS.md"
11
- },
12
- {
13
- "name": "entry-point:codex",
14
- "description": "Universal Codex/OpenAI agent entry point.",
15
- "path": "instructions.md",
16
- "dest": "AGENTS.md"
17
- },
18
- {
19
- "name": "entry-point:claude",
20
- "description": "Claude Code / Anthropic entry point.",
21
- "path": "instructions.md",
22
- "dest": "CLAUDE.md"
23
- },
24
- {
25
- "name": "entry-point:copilot",
26
- "description": "GitHub Copilot custom instructions entry point.",
27
- "path": "instructions.md",
28
- "dest": ".github/copilot-instructions.md"
29
- },
30
- {
31
- "name": "entry-point:cursor",
32
- "description": "Cursor IDE project rules entry point.",
33
- "path": "instructions.md",
34
- "dest": ".cursor/rules/instructions.md"
35
- },
36
- {
37
- "name": "entry-point:antigravity",
38
- "description": "Antigravity (Google DeepMind) / Gemini rules entry point.",
39
- "path": "instructions.md",
40
- "dest": ".agents/GEMINI.md"
41
- },
42
- {
43
- "name": "entry-point:windsurf",
44
- "description": "Windsurf / Codeium rules entry point.",
45
- "path": "instructions.md",
46
- "dest": ".windsurfrules"
47
- },
48
- {
49
- "name": "entry-point:cline",
50
- "description": "Cline / Roo Code rules entry point.",
51
- "path": "instructions.md",
52
- "dest": ".clinerules"
53
- }
54
- ]
55
- }
56
-
57
-