xdrs-core 0.11.0 → 0.11.1
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/.xdrs/_core/adrs/principles/001-xdr-standards.md +93 -35
- package/.xdrs/_core/adrs/principles/006-research-standards.md +1 -1
- package/.xdrs/_core/adrs/principles/skills/002-write-xdr/SKILL.md +1 -1
- package/.xdrs/_core/adrs/principles/skills/003-write-skill/SKILL.md +1 -1
- package/README.md +1 -1
- package/lib/lint.js +1 -1
- package/lib/testPrompt.js +4 -0
- package/lib/testPrompt.test.js +6 -0
- package/package.json +1 -1
|
@@ -21,29 +21,23 @@ Provides clear ownership by scope, predictable navigation, and reusable decision
|
|
|
21
21
|
|
|
22
22
|
### Implementation Details
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Check `Status:` first to determine whether the XDR is eligible to be used now. If `Status:` is omitted, treat it as `Active`. `Draft` and `Deprecated` decisions are background or history, not current policy.
|
|
33
|
-
- Check `Valid:` next to determine whether the current moment falls inside the decision's active date window. Not-yet-active and expired windows are not current policy.
|
|
34
|
-
- Check `Applied to:` next to determine whether the active, currently valid decision fits the current codebase, system, workflow, or audience.
|
|
35
|
-
- Check the decision context and implementation details last to determine any additional boundaries, exceptions, or qualifiers that metadata alone cannot express.
|
|
36
|
-
- If any check fails, the XDR MAY still be read as background, history, or context, but it MUST NOT be treated as a current requirement for that case.
|
|
37
|
-
- Research documents MAY be added under the same subject to capture the exploration, findings, and proposals that backed a decision. Research is useful during elaboration, discussion, approval, retirement, and updates, but the XDR remains the source of truth.
|
|
38
|
-
- Make it clear if an instruction is mandatory or advisory
|
|
39
|
-
- Mandatory language: "must", "always", "never", "required", "mandatory"
|
|
40
|
-
- Advisory language: "should", "recommended", "advised", "preferably", "possibly", "optionally"
|
|
41
|
-
- Always the following folder structure:
|
|
24
|
+
The standards below are split into framework-wide standards and XDR document standards.
|
|
25
|
+
|
|
26
|
+
#### General framework standards
|
|
27
|
+
|
|
28
|
+
- Make it clear if an instruction is mandatory or advisory.
|
|
29
|
+
- Mandatory language: "must", "always", "never", "required", "mandatory"
|
|
30
|
+
- Advisory language: "should", "recommended", "advised", "preferably", "possibly", "optionally"
|
|
31
|
+
- Always use the following folder structure for XDR documents:
|
|
42
32
|
`.xdrs/[scope]/[type]/[subject]/[number]-[short-title].md`
|
|
43
33
|
- Optional supporting artifacts under the same subject:
|
|
44
34
|
- `.xdrs/[scope]/[type]/[subject]/researches/[number]-[short-title].md`
|
|
45
35
|
- `.xdrs/[scope]/[type]/[subject]/skills/[number]-[skill-name]/SKILL.md`
|
|
46
36
|
- `.xdrs/[scope]/[type]/[subject]/articles/[number]-[short-title].md`
|
|
37
|
+
- Research, skills, and articles are part of the framework, but each has its own concept-specific standards in dedicated XDRs. This XDR defines the shared framework baseline and the decision-record standard.
|
|
38
|
+
- `_core-adr-003` defines skill standards
|
|
39
|
+
- `_core-adr-004` defines article standards
|
|
40
|
+
- `_core-adr-006` defines research standards
|
|
47
41
|
- For simple structure, flow, layout, or relationship indications, documents SHOULD prefer plain Markdown, tables, or ASCII art instead of external assets.
|
|
48
42
|
- Images and other supporting files SHOULD be used only when they are materially necessary to preserve clarity, fidelity, or evidence. When used, they SHOULD live in a sibling `assets/` folder next to the document.
|
|
49
43
|
- XDRs in the subject root use `.xdrs/[scope]/[type]/[subject]/assets/`
|
|
@@ -51,34 +45,98 @@ Provides clear ownership by scope, predictable navigation, and reusable decision
|
|
|
51
45
|
- Research uses `.xdrs/[scope]/[type]/[subject]/researches/assets/`
|
|
52
46
|
- Skills use `.xdrs/[scope]/[type]/[subject]/skills/[number]-[skill-name]/assets/`
|
|
53
47
|
- **Scopes:**
|
|
48
|
+
- Short name that defines a group or a package of xdrs
|
|
54
49
|
- examples: `business-x`, `business-y`, `team-43`, `_core`
|
|
55
50
|
- `_local` is a reserved scope for XDRs created locally to a specific project or repository. XDRs in `_local` must not be shared with or propagated to other contexts. This scope must always be placed in the lowest position in `.xdrs/index.md` so that its decisions override or extend any decisions from all higher-positioned scopes. Shared `.xdrs/index.md` files MUST NOT link `_local` canonical type indexes because `_local` stays workspace-local and is not distributed with shared packages. Readers, tools, and agents SHOULD still try to discover existing workspace-local `_local` canonical indexes by default, even when the shared root index does not link them.
|
|
56
51
|
- **Types:** `adrs`, `bdrs`, `edrs`
|
|
57
52
|
- there can exist sufixes to the standard scope names (e.g: `business-x-mobileapp`, `business-y-servicedesk`)
|
|
58
|
-
- **Subjects:** MUST be one of the following depending on the type of the XDR
|
|
59
|
-
- **ADR
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
- **Subjects:** MUST be one of the following depending on the type of the XDR. Use the subject to indicate the main concern of the decision.
|
|
54
|
+
- **ADR subjects**
|
|
55
|
+
- `principles`: Cross-cutting architecture and policy foundations.
|
|
56
|
+
- Examples: architecture style, interoperability rules, long-term technology direction.
|
|
57
|
+
- `application`: System and service design decisions at application level.
|
|
58
|
+
- Examples: modularization strategy, service decomposition, app-level security flows.
|
|
59
|
+
- `data`: Data architecture and information modeling choices.
|
|
60
|
+
- Examples: canonical schemas, data ownership boundaries, retention strategies.
|
|
61
|
+
- `integration`: Decisions about communication between internal/external systems.
|
|
62
|
+
- Examples: sync vs async patterns, contract strategy, partner integration approach.
|
|
63
|
+
- `platform`: Platform-level runtime and enabling capabilities.
|
|
64
|
+
- Examples: cloud/runtime baseline, foundational services, platform tenancy approach.
|
|
65
|
+
- `controls`: Architecture controls for risk, security, and compliance at a high level.
|
|
66
|
+
- Examples: encryption baseline, auditability requirements, policy enforcement points.
|
|
67
|
+
- `operations`: Operational architecture decisions.
|
|
68
|
+
- Examples: incident model, resilience objectives, operational ownership boundaries.
|
|
69
|
+
- **BDR subjects**
|
|
70
|
+
- `principles`: Business principles and decision criteria that guide all business areas.
|
|
71
|
+
- Examples: customer fairness rules, policy precedence, strategic guardrails.
|
|
72
|
+
- `marketing`: Go-to-market, communication, and campaign policy decisions.
|
|
73
|
+
- Examples: campaign approval rules, channel usage standards, positioning constraints.
|
|
74
|
+
- `product`: Product behavior, lifecycle, and offering decisions.
|
|
75
|
+
- Examples: feature rollout policy, packaging/tiers, product requirement governance.
|
|
76
|
+
- `controls`: Business control framework decisions.
|
|
77
|
+
- Examples: approval segregation, mandatory checks, exception handling policy.
|
|
78
|
+
- `operations`: Day-to-day business process and procedure decisions.
|
|
79
|
+
- Examples: support workflows, onboarding/offboarding procedures, SLA operations.
|
|
80
|
+
- `organization`: Structure, roles, and responsibility model decisions.
|
|
81
|
+
- Examples: decision rights, team topology, accountability boundaries.
|
|
82
|
+
- `finance`: Financial and cost-control business decisions.
|
|
83
|
+
- Examples: budgeting process, pricing governance, investment approval rules.
|
|
84
|
+
- `sustainability`: Environmental and social responsibility policy decisions.
|
|
85
|
+
- Examples: sustainability KPIs, reporting cadence, procurement sustainability criteria.
|
|
86
|
+
- **EDR subjects**
|
|
87
|
+
- `principles`: Engineering principles and non-functional quality defaults.
|
|
88
|
+
- Examples: coding standards baseline, testing philosophy, secure-by-default engineering rules.
|
|
89
|
+
- `application`: Code-level implementation patterns and application conventions.
|
|
90
|
+
- Examples: framework patterns, layer organization, API implementation conventions.
|
|
91
|
+
- `infra`: Infrastructure implementation and runtime operations details.
|
|
92
|
+
- Examples: IaC patterns, environment provisioning, network/runtime hardening details.
|
|
93
|
+
- `observability`: Telemetry, monitoring, alerting, and diagnostics implementation.
|
|
94
|
+
- Examples: log/metric/tracing standards, alert routing policy, SLO measurement approach.
|
|
95
|
+
- `devops`: Delivery pipeline, release automation, and developer workflow decisions.
|
|
96
|
+
- Examples: CI/CD stages, branch strategy, release promotion gates.
|
|
97
|
+
- `governance`: Engineering governance, risk controls, and compliance mechanics.
|
|
98
|
+
- Examples: dependency governance, approval policies, mandatory quality checks.
|
|
99
|
+
- If there is a README.md file in the root of the xdrs folder, always keep it up to date. Never use emojis.
|
|
100
|
+
- **Indexes**
|
|
101
|
+
- Keep a canonical index with all XDRs of a certain type+scope in `.xdrs/[scope]/[type]/index.md`
|
|
102
|
+
- Canonical index requirements:
|
|
103
|
+
- Organize XDRs by subject for easier navigation
|
|
104
|
+
- Add a short description of what this scope is about (responsibilities, general worries, teams involved, link to discussion process, etc)
|
|
105
|
+
- Add a list of other scope indexes that this scope might be related to (only add scopes that might be overridden). E.g: "business-x-mobileapp" scope could refer to "business-x" and "sensitive-data" scopes in its index list. XDRs in scopes listed last override XDRs in scopes listed first when addressing the same topic.
|
|
106
|
+
- Each XDR element entry in the index MUST include a short description of its content in imperative format and with fewer than 10 words. Example: "understand customer communication tone"
|
|
107
|
+
- Outside the scopes, keep an index pointing to all canonical indexes in `.xdrs/index.md`. Add the text "XDRs in scopes listed last override the ones listed first"
|
|
108
|
+
- Always verify if indexes are up to date after making changes
|
|
109
|
+
|
|
110
|
+
#### XDR document standards (decision record source of truth)
|
|
111
|
+
|
|
112
|
+
- XDRs MUST contain a clear decision about a certain problem or situation. Avoid being too verbose and focus on explaining clearly the context and the decision. Avoid adding contents that are not original. If you have other references that are important to understand the document, add links and references.
|
|
113
|
+
- XDRs are the central artifact of the framework and the authoritative policy for their scope, type, and subject. Supporting artifacts may explain, justify, or operationalize the decision, but they do not replace it.
|
|
114
|
+
- XDRs MAY include a `## Metadata` section, but only when at least one supported metadata field is present. When used, `## Metadata` MUST appear immediately before `## Context and Problem Statement`.
|
|
115
|
+
- Supported XDR metadata fields are:
|
|
116
|
+
- `Status:` Optional. Defines the lifecycle state of the decision. Allowed values are `Draft`, `Active`, and `Deprecated`. If omitted, the decision is treated as `Active`. Only `Active` decisions may be treated as current policy.
|
|
117
|
+
- `Valid:` Optional. Defines the time window in which an active decision may be treated as current. Use ISO dates only: `from YYYY-MM-DD`, `until YYYY-MM-DD`, or `from YYYY-MM-DD until YYYY-MM-DD`. If `from` is omitted, the decision takes effect immediately. If `until` is omitted, the decision remains valid indefinitely.
|
|
118
|
+
- `Applied to:` Optional. A short description of the contexts in which the decision is applicable. Keep it under 40 words. If omitted, the decision should be interpreted as applying to all logically applicable elements according to the decision text itself. Examples: `Only frontend code`, `JavaScript projects`, `Performance-sensitive codebases`
|
|
119
|
+
- Before using, enforcing, or citing an XDR as a current rule, humans and AI agents MUST decide whether the decision is appliable for the current case.
|
|
120
|
+
- Check `Status:` first to determine whether the XDR is eligible to be used now. If `Status:` is omitted, treat it as `Active`. `Draft` and `Deprecated` decisions are background or history, not current policy.
|
|
121
|
+
- Check `Valid:` next to determine whether the current moment falls inside the decision's active date window. Not-yet-active and expired windows are not current policy.
|
|
122
|
+
- Check `Applied to:` next to determine whether the active, currently valid decision fits the current codebase, system, workflow, or audience.
|
|
123
|
+
- Check the decision context and implementation details last to determine any additional boundaries, exceptions, or qualifiers that metadata alone cannot express.
|
|
124
|
+
- If any check fails, the XDR MAY still be read as background, history, or context, but it MUST NOT be treated as a current requirement for that case.
|
|
125
|
+
- Research documents MAY be added under the same subject to capture the exploration, findings, and proposals that backed a decision. Research is useful during elaboration, discussion, approval, retirement, and updates of xdrs, but the XDR document remains the source of truth.
|
|
62
126
|
- **XDR Id:** [scope]-[type]-[xdr number unique in scope] (the xdr id must be unique among all XDRs of the same type in the different scopes and always use lowercase)
|
|
63
127
|
- Types in IDs: `adr`, `bdr`, `edr`
|
|
64
128
|
- Define the next number of an XDR by checking what is the highest number present in the type+scope. Don't fill numbering gaps, as they might be old deleted XDRs and we should never reuse numbers of different documents/decisions. Numbering gaps are expected.
|
|
65
|
-
- Decisions MUST be concise and reference other XDRs to avoid duplication
|
|
129
|
+
- Decisions MUST be concise and reference other XDRs to avoid duplication.
|
|
66
130
|
- The `### Implementation Details` section SHOULD state relevant boundaries or exceptions and what a reader should do or avoid in common cases. Use `## Metadata` as the first-pass filter for whether the decision should be used at all, then keep nuanced boundaries in the decision text.
|
|
67
131
|
- Use concise rules, examples, or `Do` / `Don't` lists only when they help a reader apply the decision correctly. Keep them short and decision-specific.
|
|
132
|
+
- Conflict handling applies to XDR documents:
|
|
133
|
+
- For cross-scope overrides, document the decision conflict in the XDR `## Conflicts` section of the XDR that overrides another scope.
|
|
134
|
+
- **Within-scope conflicts:** XDRs within the same type+scope must not conflict. If two XDRs appear to conflict, one should be updated, deprecated, or the conflict resolved through a new XDR.
|
|
68
135
|
- When research exists for a decision, the XDR SHOULD mention the related research documents after the `## Considered Options` list.
|
|
69
|
-
- Never use emojis in contents
|
|
70
|
-
- Always use file names with lowercase
|
|
136
|
+
- Never use emojis in contents.
|
|
137
|
+
- Always use file names with lowercase.
|
|
71
138
|
- Avoid using lengthy instructions on the XDR. If there are long and detailed instructions related to the XDR, or instructions that are outside the decision, create another file with a guide. If the guide is small, keep it in the XDR itself.
|
|
72
|
-
-
|
|
73
|
-
- Keep a canonical index with all XDRs of a certain type+scope in `.xdrs/[scope]/[type]/index.md`
|
|
74
|
-
- Organize XDRs by subject for easier navigation
|
|
75
|
-
- Add a list of other scope indexes that this scope might be related to (only add scopes that might be overridden). E.g: "business-x-mobileapp" scope could refer to "business-x" and "sensitive-data" scopes in its index list. XDRs in scopes listed last override XDRs in scopes listed first when addressing the same topic.
|
|
76
|
-
- Document decision conflicts in "Conflicts" section for the XDR that is overriding another XDR in other scopes
|
|
77
|
-
- **Within-scope conflicts:** XDRs within the same type+scope must not conflict. If two XDRs appear to conflict, one should be updated, deprecated, or the conflict resolved through a new XDR.
|
|
78
|
-
- In the index add a short description of what is this scope about (responsibilities, general worries, teams involved, link to discussion process etc)
|
|
79
|
-
- Outside the scopes, keep an index pointing to all canonical indexes in `.xdrs/index.md`. Add the text "XDRs in scopes listed last override the ones listed first"
|
|
80
|
-
- Always verify if the index is up to date after making changes
|
|
81
|
-
- XDRs should be less than 100 lines long as a rule of thumb
|
|
139
|
+
- XDRs should be less than 100 lines long as a rule of thumb.
|
|
82
140
|
- This is important to make them focused on a clear decision
|
|
83
141
|
- Exceptions can reach 200 lines (templates, more elaborate decision implementations etc)
|
|
84
142
|
- ALWAYS use `_local` scope if the user doesn't explicitelly indicate a specific scope while creating an xdr or skill.
|
|
@@ -58,7 +58,7 @@ Research documents are Markdown files placed inside a subject folder alongside d
|
|
|
58
58
|
Examples:
|
|
59
59
|
- `.xdrs/_core/adrs/principles/researches/001-research-and-decision-lifecycle.md`
|
|
60
60
|
- `.xdrs/business-x/adrs/platform/researches/003-api-gateway-options.md`
|
|
61
|
-
- `.xdrs/_local/edrs/
|
|
61
|
+
- `.xdrs/_local/edrs/application/researches/002-model-serving-constraints.md`
|
|
62
62
|
|
|
63
63
|
**Research numbering**
|
|
64
64
|
|
|
@@ -35,7 +35,7 @@ Consult `001-xdr-standards` while making each choice in this phase. The summarie
|
|
|
35
35
|
**Subject** — pick one from the allowed list for the chosen type (from `001-xdr-standards`):
|
|
36
36
|
- ADR: `principles`, `application`, `data`, `integration`, `platform`, `controls`, `operations`
|
|
37
37
|
- BDR: `principles`, `marketing`, `product`, `controls`, `operations`, `organization`, `finance`, `sustainability`
|
|
38
|
-
- EDR: `principles`, `application`, `infra`, `
|
|
38
|
+
- EDR: `principles`, `application`, `infra`, `observability`, `devops`, `governance`
|
|
39
39
|
|
|
40
40
|
**XDR ID** — format: `[scope]-[type]-[next available number]`
|
|
41
41
|
- Scan `.xdrs/[scope]/[type]/` for the highest existing number in that scope+type and increment by 1.
|
|
@@ -40,7 +40,7 @@ Quick test:
|
|
|
40
40
|
**Subject** — pick the most specific match for the chosen type (see `003-skill-standards`):
|
|
41
41
|
- ADR subjects: `principles`, `application`, `data`, `integration`, `platform`, `controls`, `operations`
|
|
42
42
|
- BDR subjects: `principles`, `marketing`, `product`, `controls`, `operations`, `organization`, `finance`, `sustainability`
|
|
43
|
-
- EDR subjects: `principles`, `application`, `infra`, `
|
|
43
|
+
- EDR subjects: `principles`, `application`, `infra`, `observability`, `devops`, `governance`
|
|
44
44
|
|
|
45
45
|
**Skill number** — scan `.xdrs/[scope]/[type]/[subject]/skills/` for the highest existing number and increment by 1. Never reuse numbers from deleted skills.
|
|
46
46
|
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Main exports:
|
|
|
76
76
|
|
|
77
77
|
- `testPrompt(config, inputPrompt, judgePrompt)` runs the task prompt, evaluates the result in a fresh judge session, and returns an empty string on success or a markdown bullet list on failure.
|
|
78
78
|
- `runPromptTest(config, inputPrompt, judgePrompt)` returns the structured result object when you need access to captured output and the agent-reported changed file list.
|
|
79
|
-
- `copilotCmd(workspaceRoot)` returns a ready-to-use `promptCmd` template for the Copilot CLI. The library uses that same command template for both the task and judge phases. If `workspaceRoot` is omitted it defaults to the current git repository root.
|
|
79
|
+
- `copilotCmd(workspaceRoot)` returns a ready-to-use `promptCmd` template for the Copilot CLI in headless mode (`--autopilot`, full tool/url permissions, and `--no-ask-user`). The library uses that same command template for both the task and judge phases. If `workspaceRoot` is omitted it defaults to the current git repository root.
|
|
80
80
|
- `config.workspaceRoot`, when set, is the authoritative workspace under test. If omitted, the library uses the current git repository root.
|
|
81
81
|
|
|
82
82
|
Execution model:
|
package/lib/lint.js
CHANGED
|
@@ -13,7 +13,7 @@ const TYPE_TO_ID = {
|
|
|
13
13
|
const ALLOWED_SUBJECTS = {
|
|
14
14
|
adrs: new Set(['principles', 'application', 'data', 'integration', 'platform', 'controls', 'operations']),
|
|
15
15
|
bdrs: new Set(['principles', 'marketing', 'product', 'controls', 'operations', 'organization', 'finance', 'sustainability']),
|
|
16
|
-
edrs: new Set(['principles', 'application', 'infra', '
|
|
16
|
+
edrs: new Set(['principles', 'application', 'infra', 'observability', 'devops', 'governance'])
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const TYPE_NAMES = new Set(Object.keys(TYPE_TO_ID));
|
package/lib/testPrompt.js
CHANGED
|
@@ -88,6 +88,10 @@ function copilotCmd(workspaceRoot = findGitRoot(process.cwd())) {
|
|
|
88
88
|
return [
|
|
89
89
|
'copilot',
|
|
90
90
|
`--add-dir=${path.resolve(workspaceRoot)}`,
|
|
91
|
+
'--autopilot',
|
|
92
|
+
'--allow-all-tools',
|
|
93
|
+
'--allow-all-urls',
|
|
94
|
+
'--no-ask-user',
|
|
91
95
|
'--allow-all',
|
|
92
96
|
'-p',
|
|
93
97
|
'{PROMPT}'
|
package/lib/testPrompt.test.js
CHANGED
|
@@ -81,6 +81,12 @@ test('copilotCmd defaults to the git repository root', () => {
|
|
|
81
81
|
const addDirArgument = command.find((entry) => entry.startsWith('--add-dir='));
|
|
82
82
|
|
|
83
83
|
expect(addDirArgument).toBe(`--add-dir=${path.resolve(__dirname, '..')}`);
|
|
84
|
+
expect(command).toEqual(expect.arrayContaining([
|
|
85
|
+
'--autopilot',
|
|
86
|
+
'--allow-all-tools',
|
|
87
|
+
'--allow-all-urls',
|
|
88
|
+
'--no-ask-user'
|
|
89
|
+
]));
|
|
84
90
|
const promptIndex = command.indexOf('-p');
|
|
85
91
|
expect(command[promptIndex + 1]).toBe('{PROMPT}');
|
|
86
92
|
});
|
package/package.json
CHANGED