agentme 0.24.2 → 0.25.2
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.
- package/.filedist-package.yml +1 -1
- package/.xdrs/agentme/edrs/application/015-cli-tool-standards.md +27 -27
- package/.xdrs/agentme/edrs/application/019-ai-agents-development-standards.md +2 -2
- package/.xdrs/agentme/edrs/application/021-ai-workflow-development-standards.md +7 -7
- package/.xdrs/agentme/edrs/application/024-ml-dataset-structure.md +25 -10
- package/.xdrs/agentme/edrs/application/026-pragmatic-hexagonal-architecture.md +61 -8
- package/.xdrs/agentme/edrs/application/028-ai-eval-standards.md +99 -40
- package/.xdrs/agentme/edrs/application/030-ai-test-types-taxonomy.md +98 -0
- package/.xdrs/agentme/edrs/devops/005-monorepo-structure.md +2 -8
- package/.xdrs/agentme/edrs/devops/006-github-pipelines.md +3 -3
- package/.xdrs/agentme/edrs/devops/008-common-targets.md +26 -26
- package/.xdrs/agentme/edrs/devops/027-environment-variable-configuration.md +8 -8
- package/.xdrs/agentme/edrs/governance/013-contributing-guide-requirements.md +2 -2
- package/.xdrs/agentme/edrs/index.md +1 -0
- package/.xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md +25 -3
- package/.xdrs/agentme/edrs/principles/002-coding-best-practices.md +6 -16
- package/.xdrs/agentme/edrs/principles/004-unit-test-requirements.md +6 -6
- package/.xdrs/agentme/edrs/principles/007-project-quality-standards.md +8 -7
- package/.xdrs/agentme/edrs/principles/009-error-handling.md +9 -19
- package/.xdrs/agentme/edrs/principles/012-continuous-xdr-enrichment.md +7 -7
- package/.xdrs/agentme/edrs/principles/016-cross-language-module-structure.md +7 -7
- package/.xdrs/agentme/edrs/principles/022-secrets-management.md +26 -8
- package/.xdrs/agentme/edrs/principles/023-coding-abstraction-practices.md +6 -8
- package/.xdrs/agentme/index.md +9 -0
- package/.xdrs/index.md +10 -2
- package/package.json +2 -2
|
@@ -23,7 +23,7 @@ These standards form a non-negotiable baseline. Individual projects may raise th
|
|
|
23
23
|
|
|
24
24
|
#### 01-readme-must-have-getting-started
|
|
25
25
|
|
|
26
|
-
`README.md`
|
|
26
|
+
`README.md` MUST include a **Getting Started** section in the first 20 lines with the minimal steps to install and use the project.
|
|
27
27
|
|
|
28
28
|
**Required content:**
|
|
29
29
|
- Installation or setup command(s)
|
|
@@ -52,7 +52,7 @@ myFunction({ input: "value" });
|
|
|
52
52
|
|
|
53
53
|
#### 02-unit-tests-must-run-on-every-release
|
|
54
54
|
|
|
55
|
-
A unit test suite
|
|
55
|
+
A unit test suite MUST run automatically before every release. Failing tests must block the release — no silent skips or overrides.
|
|
56
56
|
|
|
57
57
|
**Requirements:**
|
|
58
58
|
- A `make test` target must exist and run the full suite
|
|
@@ -67,7 +67,7 @@ A unit test suite must run automatically before every release. Failing tests mus
|
|
|
67
67
|
|
|
68
68
|
#### 03-project-must-comply-with-xdrs
|
|
69
69
|
|
|
70
|
-
All XDRs that apply to the project's scope (as listed in [.xdrs/index.md](../../../index.md))
|
|
70
|
+
All XDRs that apply to the project's scope (as listed in [.xdrs/index.md](../../../index.md)) MUST be followed. A deviation requires a project-local XDR documenting the override.
|
|
71
71
|
|
|
72
72
|
**Requirements:**
|
|
73
73
|
- Review applicable XDRs before any significant implementation
|
|
@@ -77,7 +77,7 @@ All XDRs that apply to the project's scope (as listed in [.xdrs/index.md](../../
|
|
|
77
77
|
|
|
78
78
|
#### 04-project-must-have-linting
|
|
79
79
|
|
|
80
|
-
Projects larger than 10 files or 200 lines of code
|
|
80
|
+
Projects larger than 10 files or 200 lines of code MUST have a linter configured and actively enforced. Lint failures block CI builds.
|
|
81
81
|
|
|
82
82
|
**Requirements:**
|
|
83
83
|
- `make lint` runs the linter with zero-warning tolerance
|
|
@@ -93,7 +93,7 @@ Projects larger than 10 files or 200 lines of code must have a linter configured
|
|
|
93
93
|
|
|
94
94
|
#### 05-project-structure-must-be-clear
|
|
95
95
|
|
|
96
|
-
Directory and file layout
|
|
96
|
+
Directory and file layout MUST be self-explanatory: source code, tests, configuration, and examples must be clearly separated and named.
|
|
97
97
|
|
|
98
98
|
**Requirements:**
|
|
99
99
|
- Directory names must reflect their purpose (`src/`, `lib/`, `tests/`, `examples/`, `docs/`)
|
|
@@ -118,7 +118,7 @@ Directory and file layout must be self-explanatory: source code, tests, configur
|
|
|
118
118
|
|
|
119
119
|
#### 06-libraries-must-have-runnable-examples
|
|
120
120
|
|
|
121
|
-
Projects that are libraries or shared utilities
|
|
121
|
+
Projects that are libraries or shared utilities MUST include an `examples/` directory. Each subdirectory represents a usage scenario and must be independently runnable. Examples that are "offline" (require no external credentials, no running servers, no paid APIs, and no environment-specific configuration outside the repository) must be executed as part of `make test`. Examples that depend on external entities may be left out of `make test`.
|
|
122
122
|
|
|
123
123
|
**Requirements:**
|
|
124
124
|
- `examples/` must contain at least one subdirectory per major usage scenario
|
|
@@ -170,7 +170,7 @@ all:
|
|
|
170
170
|
|
|
171
171
|
#### 07-statistical-models-must-have-eval-targets
|
|
172
172
|
|
|
173
|
-
Projects that contain statistical models (e.g., ML models, LLM-based evaluators, classifiers, ranking systems, or any component whose output quality is measured probabilistically)
|
|
173
|
+
Projects that contain statistical models (e.g., ML models, LLM-based evaluators, classifiers, ranking systems, or any component whose output quality is measured probabilistically) MUST define measurable performance thresholds and verify them automatically.
|
|
174
174
|
|
|
175
175
|
**Requirements:**
|
|
176
176
|
- A `make eval` target must exist and execute all performance evaluations
|
|
@@ -262,3 +262,4 @@ AI projects are classified into three tiers — LLM, Agent, and Workflow — def
|
|
|
262
262
|
- Accuracy below project-defined thresholds MUST block the release. Thresholds MUST be documented in the eval Makefile or README.
|
|
263
263
|
- Evals MUST run against real LLM providers (not mocks) to capture model drift.
|
|
264
264
|
- For eval folder structure and script requirements, see [agentme-edr-028](../application/028-ai-eval-standards.md).
|
|
265
|
+
- For the taxonomy of AI test types (safety, responsible-AI, quality-eval, prompt, code-level) and the golden dataset entry format, see [agentme-edr-030](../application/030-ai-test-types-taxonomy.md).
|
|
@@ -21,9 +21,7 @@ What error handling practices should be followed across all languages and projec
|
|
|
21
21
|
|
|
22
22
|
#### 01-catch-only-where-handled
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*Why:* Swallowed exceptions hide bugs and make incidents impossible to diagnose. Every silent `catch` is a future mystery.
|
|
24
|
+
MUST NOT catch an exception unless the catching site can genuinely recover from it, translate it into a meaningful domain error, or enrich it with context before re-throwing. MUST NOT swallow exceptions silently. When suppressing an exception is intentional, MUST add a comment explaining exactly why, or log it at an appropriate level.
|
|
27
25
|
|
|
28
26
|
**Examples:**
|
|
29
27
|
|
|
@@ -77,9 +75,7 @@ except CacheError:
|
|
|
77
75
|
|
|
78
76
|
#### 02-avoid-exceptions-in-public-interfaces
|
|
79
77
|
|
|
80
|
-
At module and service boundaries, prefer returning a value that signals success or failure (e.g., a result type, a discriminated union, or a `(value, error)` tuple as in Go) over throwing exceptions. This forces callers to explicitly acknowledge and handle the error case before using the result.
|
|
81
|
-
|
|
82
|
-
*Why:* Exceptions are invisible in signatures. A caller who doesn't know an exception can be thrown will never write a handler. Explicit error return values make the contract visible and encourage handling at the call site.
|
|
78
|
+
At module and service boundaries, SHOULD prefer returning a value that signals success or failure (e.g., a result type, a discriminated union, or a `(value, error)` tuple as in Go) over throwing exceptions. This forces callers to explicitly acknowledge and handle the error case before using the result.
|
|
83
79
|
|
|
84
80
|
**Examples:**
|
|
85
81
|
|
|
@@ -161,9 +157,7 @@ def fetch_user(user_id: str) -> Ok[User] | Err:
|
|
|
161
157
|
|
|
162
158
|
#### 03-centralise-repetitive-catch-logic
|
|
163
159
|
|
|
164
|
-
If the same `try/catch` pattern (e.g., logging, classifying HTTP errors, wrapping exceptions) appears in multiple places,
|
|
165
|
-
|
|
166
|
-
*Why:* Scattered catch blocks drift out of sync — one gets updated, the others don't. A central utility is tested once and applied everywhere consistently.
|
|
160
|
+
If the same `try/catch` pattern (e.g., logging, classifying HTTP errors, wrapping exceptions) appears in multiple places, MUST be extracted into a shared utility. MUST NOT copy-paste catch blocks across the codebase.
|
|
167
161
|
|
|
168
162
|
**Examples:**
|
|
169
163
|
|
|
@@ -213,13 +207,11 @@ def save_order(order: Order): ...
|
|
|
213
207
|
|
|
214
208
|
#### 04-communicate-failure-at-boundaries
|
|
215
209
|
|
|
216
|
-
Every system boundary
|
|
210
|
+
Every system boundary MUST signal failure explicitly:
|
|
217
211
|
|
|
218
|
-
- **OS processes**
|
|
219
|
-
- **HTTP services**
|
|
220
|
-
- **All error responses**
|
|
221
|
-
|
|
222
|
-
*Why:* Orchestrators, CI runners, load balancers, and callers all rely on these signals to detect failures automatically. A process or service that reports success on failure leads to silent data corruption and missed alerts.
|
|
212
|
+
- **OS processes** MUST exit with a **non-zero exit code** when something went wrong. Exit code `0` means success.
|
|
213
|
+
- **HTTP services** MUST return a **non-2xx/3xx status code** on error, accompanied by a response body that describes the problem without exposing internal system details (stack traces, SQL queries, internal paths, etc.).
|
|
214
|
+
- **All error responses** SHOULD be logged to the console/structured logger, especially system-level or unexpected errors. Operational teams must be able to find the cause from logs alone.
|
|
223
215
|
|
|
224
216
|
**Examples:**
|
|
225
217
|
|
|
@@ -276,11 +268,9 @@ def create_order_endpoint(payload: OrderRequest):
|
|
|
276
268
|
|
|
277
269
|
#### 05-write-test-cases-for-error-scenarios
|
|
278
270
|
|
|
279
|
-
Every module that handles errors
|
|
280
|
-
|
|
281
|
-
*Why:* Error handling code is the code most likely to be broken and the code least likely to be exercised in manual testing. Without automated tests, regressions in error paths go undetected until production.
|
|
271
|
+
Every module that handles errors MUST have dedicated test cases that verify the error paths. Do not only test the happy path.
|
|
282
272
|
|
|
283
|
-
|
|
273
|
+
**Mocking strategy:** External dependencies (databases, HTTP services, file systems) MUST be mocked in error-path unit tests. Simulate failure by configuring the mock to throw or return an error value — do not rely on a real dependency being unavailable.
|
|
284
274
|
|
|
285
275
|
- The dependency (DB, HTTP service, file system) is unavailable or times out.
|
|
286
276
|
- The input is invalid, missing, or out of range.
|
|
@@ -17,16 +17,16 @@ Question: What policy should developers follow to continuously enrich XDRs so re
|
|
|
17
17
|
|
|
18
18
|
**Develop features with shared-first XDR enrichment and controlled divergence**
|
|
19
19
|
|
|
20
|
-
Developers
|
|
20
|
+
Developers MUST treat reusable missing guidance discovered during implementation as an XDR gap to be proposed and reviewed, not as permanent prompt-only context or repeated vibe coding.
|
|
21
21
|
|
|
22
22
|
### Details
|
|
23
23
|
|
|
24
|
-
- The main objective is sharing, discussing, and converging practices across teams. Controlled divergence during exploration is acceptable, but recurring successful decisions
|
|
25
|
-
- The non _local scope exists to share practices across projects, company areas, and functionally organized teams. Decisions placed in `_local`
|
|
26
|
-
- When developers or coding agents need too much detailed steering to complete a task, they
|
|
27
|
-
- This includes cases where an agent implemented a feature without a framework, pattern, coding standard, or other practice that should likely be standardized. Missing reusable guardrails
|
|
28
|
-
- Teams
|
|
29
|
-
- If a big decision is not yet covered, developers
|
|
24
|
+
- The main objective is sharing, discussing, and converging practices across teams. Controlled divergence during exploration is acceptable, but recurring successful decisions MUST be converged into shared XDRs.
|
|
25
|
+
- The non _local scope exists to share practices across projects, company areas, and functionally organized teams. Decisions placed in `_local` SHOULD be truly specific to the needs of a single application or repository.
|
|
26
|
+
- When developers or coding agents need too much detailed steering to complete a task, they MUST reflect on whether those details would help other teams or future implementations. If yes, create or update an XDR proposal in the broadest appropriate shared scope.
|
|
27
|
+
- This includes cases where an agent implemented a feature without a framework, pattern, coding standard, or other practice that should likely be standardized. Missing reusable guardrails SHOULD trigger an XDR proposal.
|
|
28
|
+
- Teams SHOULD aim to keep at least 80% of big coding decisions covered by accepted XDRs. Big decisions include framework or tool selection, overall code organization, monorepo structure, complex business flows, and coding standards.
|
|
29
|
+
- If a big decision is not yet covered, developers SHOULD either propose a new XDR or document why the decision is intentionally local and should not be shared.
|
|
30
30
|
- Leaders responsible for the affected scope are accountable for reviewing XDR proposals, adjusting them, and publishing the accepted decision.
|
|
31
31
|
- It is good practice to ask the coding agent which missing XDRs made the task harder, increased adjustment rounds, or forced more vibe coding. Those gaps should feed the XDR backlog.
|
|
32
32
|
- In SDD, specifications describe the feature being built; XDRs describe reusable decisions and guardrails that should survive beyond one feature. Do not keep durable engineering policy only inside feature specs.
|
|
@@ -17,7 +17,7 @@ What baseline structure rules must every buildable module follow regardless of l
|
|
|
17
17
|
|
|
18
18
|
**Standardize every buildable module around its own folder root, with `dist/`, `.cache/`, sibling consumer examples, a module README, and predictable test locations.**
|
|
19
19
|
|
|
20
|
-
Language-specific EDRs
|
|
20
|
+
Language-specific EDRs MAY add ecosystem details, but they MUST NOT redefine these baseline folder responsibilities.
|
|
21
21
|
|
|
22
22
|
### Details
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ A module is the smallest independently buildable, testable, or publishable unit.
|
|
|
27
27
|
|
|
28
28
|
- a `Makefile` following [agentme-edr-008](../devops/008-common-targets.md)
|
|
29
29
|
- a `README.md` for the module itself
|
|
30
|
-
- all configuration files
|
|
30
|
+
- all configuration files needed to build, lint, test, package, or publish that module
|
|
31
31
|
- its generated `dist/` directory when the module produces distributable artifacts
|
|
32
32
|
- a module-local `.cache/` when tool caches are not intentionally shared with a parent aggregation root
|
|
33
33
|
|
|
@@ -44,11 +44,11 @@ Example module root:
|
|
|
44
44
|
|
|
45
45
|
#### 02-parent-folders-are-aggregation-roots
|
|
46
46
|
|
|
47
|
-
Parent folders such as a repository root, an application folder, or `lib/`
|
|
47
|
+
Parent folders such as a repository root, an application folder, or `lib/` MAY aggregate multiple modules. They MAY also hold shared consumer examples or multi-module test harnesses.
|
|
48
48
|
|
|
49
|
-
They MUST keep the public aggregation obvious: deleting an aggregation folder
|
|
49
|
+
They MUST keep the public aggregation obvious: deleting an aggregation folder SHOULD remove a coherent API surface or entry-point area, not scatter unrelated internal implementation across the repository.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Example aggregation pattern:
|
|
52
52
|
|
|
53
53
|
```text
|
|
54
54
|
<parent>/
|
|
@@ -88,7 +88,7 @@ Examples that demonstrate how to consume a library or reusable module MUST live
|
|
|
88
88
|
Examples MUST exercise the module through its public distribution surface:
|
|
89
89
|
|
|
90
90
|
- use the package built into `dist/` when the ecosystem supports local packaged artifacts
|
|
91
|
-
- otherwise use the public module path or equivalent consumer-facing import surface
|
|
91
|
+
- otherwise use the public module path or equivalent consumer-facing import surface; **MUST NOT** use relative source-file imports or direct references to internal implementation paths
|
|
92
92
|
|
|
93
93
|
Example:
|
|
94
94
|
|
|
@@ -106,7 +106,7 @@ Each module MUST contain a `README.md` that shows how to use the module as a con
|
|
|
106
106
|
|
|
107
107
|
The end of the README MUST also include short developer instructions for that module, covering at least the standard build, lint, and test entry points.
|
|
108
108
|
|
|
109
|
-
Repository-level READMEs
|
|
109
|
+
Repository-level READMEs MAY describe the workspace, but they do not replace the module README.
|
|
110
110
|
|
|
111
111
|
#### 07-tests-use-predictable-locations
|
|
112
112
|
|
|
@@ -29,7 +29,7 @@ All implementation practices derive from three guiding principles:
|
|
|
29
29
|
|
|
30
30
|
#### 01-no-secrets-on-disk
|
|
31
31
|
|
|
32
|
-
Secrets
|
|
32
|
+
Secrets MUST NEVER be stored on the disk of a developer machine or server. This includes `.env` files (even when gitignored), plaintext config files, embedded in source code, or any other file-based storage.
|
|
33
33
|
|
|
34
34
|
The only acceptable local persistence is through the operating system's native secret manager (e.g., macOS Keychain, Windows Credential Manager, Linux Secret Service).
|
|
35
35
|
|
|
@@ -37,7 +37,7 @@ The only acceptable local persistence is through the operating system's native s
|
|
|
37
37
|
|
|
38
38
|
#### 02-local-dev-uses-native-keychain
|
|
39
39
|
|
|
40
|
-
During local development, secrets
|
|
40
|
+
During local development, secrets MUST be stored and retrieved using the native OS secret manager. Use cross-platform libraries to keep the code OS-agnostic:
|
|
41
41
|
|
|
42
42
|
| Language | Library |
|
|
43
43
|
|----------|---------|
|
|
@@ -51,7 +51,7 @@ The "group" (service name) defaults to the module name. The secret identifier sh
|
|
|
51
51
|
|
|
52
52
|
#### 03-fallback-lookup-order
|
|
53
53
|
|
|
54
|
-
Secret fetching
|
|
54
|
+
Secret fetching MUST implement a fallback chain in the following order:
|
|
55
55
|
|
|
56
56
|
1. **Native OS keychain** — attempt to retrieve the secret using the local keychain library (used during local development).
|
|
57
57
|
2. **Cloud secret manager** — if not found locally, fetch from the configured cloud secret manager (AWS Secrets Manager, Azure Key Vault, etc.) (used in cloud environments).
|
|
@@ -66,13 +66,13 @@ Secret 'db-password' could not be found in keychain under group 'mymodule' or in
|
|
|
66
66
|
|
|
67
67
|
#### 04-secret-fetching-in-connector
|
|
68
68
|
|
|
69
|
-
The secret fetching logic (including the fallback chain from rule 03)
|
|
69
|
+
The secret fetching logic (including the fallback chain from rule 03) MUST live in a dedicated "connector" module or function. This isolates secret-access concerns from business logic and provides a single point to configure secret sources, caching policy, and error handling.
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
73
73
|
#### 05-setup-secrets-makefile-target
|
|
74
74
|
|
|
75
|
-
Every module that requires secrets
|
|
75
|
+
Every module that requires secrets MUST expose a `setup-secrets` Makefile target. This target:
|
|
76
76
|
|
|
77
77
|
- Prompts the user for each required secret value interactively.
|
|
78
78
|
- If the user provides an empty value, the existing secret is not updated.
|
|
@@ -120,13 +120,13 @@ In library code (Python, JS/TS, Go), continue using the cross-platform libraries
|
|
|
120
120
|
|
|
121
121
|
#### 06-never-log-or-leak-secrets
|
|
122
122
|
|
|
123
|
-
Secrets
|
|
123
|
+
Secrets MUST NEVER be logged under any circumstance or sent to any service that is not clearly the intended consumer of that secret (authentication, encryption, etc.). This applies to all log levels including debug and trace. Error messages must reference the secret name or identifier, never its value.
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
127
|
#### 07-prefer-dynamic-fetching
|
|
128
128
|
|
|
129
|
-
Wherever possible,
|
|
129
|
+
Wherever possible, secrets SHOULD be fetched dynamically from the secret manager at the time of use. Avoid storing secrets in global variables or caching them indefinitely. Dynamic fetching through a specialized service enables:
|
|
130
130
|
|
|
131
131
|
- Automatic password rotation without redeployment.
|
|
132
132
|
- Immediate propagation of rotated secrets.
|
|
@@ -138,10 +138,28 @@ Short-lived caching (e.g., a few minutes) is acceptable when performance require
|
|
|
138
138
|
|
|
139
139
|
#### 08-prefer-fetching-at-point-of-use
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
Developers SHOULD prefer fetching the secret inside the function that directly needs it rather than passing it through multiple layers as a function argument. This minimizes the exposure surface by reducing the number of code paths that handle the raw secret value.
|
|
142
142
|
|
|
143
143
|
Passing secrets via function arguments is acceptable when the consuming function cannot access the connector directly, but the default design should fetch at the point of use.
|
|
144
144
|
|
|
145
|
+
#### 09-unit-testing-and-mocking-strategy
|
|
146
|
+
|
|
147
|
+
Code that calls the secret connector MUST accept it as an injectable parameter. Unit tests MUST inject a fake connector that returns a pre-configured value without touching the OS keychain or any cloud secret manager.
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
# Good — injectable connector; unit test provides a fake
|
|
151
|
+
class MyService:
|
|
152
|
+
def __init__(self, secrets: SecretConnector):
|
|
153
|
+
self.api_key = secrets.get("api-key")
|
|
154
|
+
|
|
155
|
+
def test_service_uses_api_key():
|
|
156
|
+
fake = FakeSecretConnector({"api-key": "test-key-123"})
|
|
157
|
+
svc = MyService(secrets=fake)
|
|
158
|
+
assert svc.api_key == "test-key-123"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Integration tests MAY use the real keychain on developer machines or CI after `make setup-secrets` has been run.
|
|
162
|
+
|
|
145
163
|
## References
|
|
146
164
|
|
|
147
165
|
- [agentme-edr-008](../devops/008-common-targets.md) - Common development script names (defines Makefile target conventions)
|
|
@@ -21,15 +21,13 @@ What principles should guide the decision to introduce — or reject — an abst
|
|
|
21
21
|
|
|
22
22
|
#### 01-prioritize-functional-programming
|
|
23
23
|
|
|
24
|
-
Prefer functional programming: pure functions with clear input → processing → output flow. Object-oriented patterns (classes, inheritance)
|
|
25
|
-
|
|
26
|
-
*Why:* Functional units are simpler to reason about, test, and compose. OO introduces shared mutable state and implicit coupling that must earn its place.
|
|
24
|
+
Prefer functional programming: pure functions with clear input → processing → output flow. Object-oriented patterns (classes, inheritance) MAY only be used when there is a clear benefit from the additional abstraction they bring — e.g., when complex context management or true inheritance hierarchies are intrinsically part of the best solution for a problem.
|
|
27
25
|
|
|
28
26
|
---
|
|
29
27
|
|
|
30
28
|
#### 02-prefer-explicit-calls-over-indirections
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
Developers SHOULD prefer a sequence of direct calls to libraries and resources to keep logic straightforward. Avoid:
|
|
33
31
|
|
|
34
32
|
- Aspect-oriented programming (AOP)
|
|
35
33
|
- Implicit context injection / dependency injection containers
|
|
@@ -43,7 +41,7 @@ These patterns obfuscate the main program flow and create behavioral indirection
|
|
|
43
41
|
|
|
44
42
|
#### 03-trivial-wrappers-are-prohibited
|
|
45
43
|
|
|
46
|
-
A function that merely delegates to another function or API call without adding meaningful logic, domain intent, or readability **
|
|
44
|
+
A function that merely delegates to another function or API call without adding meaningful logic, domain intent, or readability **MUST be inlined**. A wrapper is justified only when it:
|
|
47
45
|
|
|
48
46
|
- Encapsulates non-trivial logic (validation, retry, transformation).
|
|
49
47
|
- Communicates a domain concept the underlying expression does not convey.
|
|
@@ -76,7 +74,7 @@ A function that constructs an object (e.g., configuration, options) is only just
|
|
|
76
74
|
- Combines data in a non-linear or conditional way.
|
|
77
75
|
- Is reused by multiple callers.
|
|
78
76
|
|
|
79
|
-
A function that restructures simple static data in an almost 1-to-1 mapping forces the reader to trace indirection for no benefit and
|
|
77
|
+
A function that restructures simple static data in an almost 1-to-1 mapping forces the reader to trace indirection for no benefit and MUST be inlined.
|
|
80
78
|
|
|
81
79
|
**Bad — trivial factory:**
|
|
82
80
|
|
|
@@ -105,7 +103,7 @@ function createServerConfig(opts: Partial<ServerOpts>): ServerConfig {
|
|
|
105
103
|
|
|
106
104
|
#### 05-abstractions-for-business-logic-are-encouraged
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
Developers SHOULD extract domain logic into a named function when it:
|
|
109
107
|
|
|
110
108
|
- Encapsulates a business rule so the reader does not need to parse low-level conditions to understand domain intent.
|
|
111
109
|
- Communicates intent at a glance, making compound conditions or multi-step checks self-describing.
|
|
@@ -124,6 +122,6 @@ if (event.status === 'active' && event.role !== 'guest' && event.quota > 0) { ..
|
|
|
124
122
|
|
|
125
123
|
#### 06-idiomatic-framework-patterns-are-exempt
|
|
126
124
|
|
|
127
|
-
React hooks, higher-order components, middleware chains, and similar patterns established by the framework in use
|
|
125
|
+
React hooks, higher-order components, middleware chains, and similar patterns established by the framework in use MUST NOT be treated as unnecessary abstraction. The reader already expects them, and fighting the framework's idioms creates more confusion than it removes.
|
|
128
126
|
|
|
129
127
|
This exemption does not override other rules — a trivial wrapper inside a hook is still prohibited.
|
package/.xdrs/agentme/index.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentme
|
|
3
|
+
description: Curated library of XDRs and skills encoding best practices for AI coding agents across JavaScript, Go, and Python projects.
|
|
4
|
+
scope-type: standard
|
|
5
|
+
follows: agentme-core
|
|
6
|
+
apply-to: AI coding agents and developers adopting agentme engineering standards.
|
|
7
|
+
valid-from: 2025-01-01
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# agentme Scope Overview
|
|
2
11
|
|
|
3
12
|
## Overview
|
package/.xdrs/index.md
CHANGED
|
@@ -11,7 +11,15 @@ XDRS scopes listed last override the ones listed first
|
|
|
11
11
|
### _core
|
|
12
12
|
|
|
13
13
|
Decisions about how XDRs work
|
|
14
|
-
[View _core
|
|
14
|
+
[View scope _core](_core/index.md)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### agentme-core
|
|
19
|
+
|
|
20
|
+
Meta-governance for the agentme scope (writing standards, content conventions, authoring guidance). Not distributed to consumers.
|
|
21
|
+
|
|
22
|
+
[View scope agentme-core](agentme-core/index.md)
|
|
15
23
|
|
|
16
24
|
---
|
|
17
25
|
|
|
@@ -19,7 +27,7 @@ Decisions about how XDRs work
|
|
|
19
27
|
|
|
20
28
|
Opiniated set of decisions and skills for common development tasks
|
|
21
29
|
|
|
22
|
-
[View agentme
|
|
30
|
+
[View scope agentme](agentme/index.md)
|
|
23
31
|
|
|
24
32
|
---
|
|
25
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"filedist": "^0.39.0"
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"url": "https://github.com/flaviostutz/agentme.git"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"xdrs-core": "^0.
|
|
21
|
+
"xdrs-core": "^0.38.0"
|
|
22
22
|
}
|
|
23
23
|
}
|