xdrs-core 0.1.1-beta.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.
- package/.xdrs/_general/adrs/index.md +12 -0
- package/.xdrs/_general/adrs/principles/001-xdr-standards.md +139 -0
- package/.xdrs/_general/adrs/principles/003-skill-standards.md +110 -0
- package/.xdrs/_general/adrs/principles/skills/001-xdr-lint/SKILL.md +117 -0
- package/.xdrs/_general/edrs/index.md +10 -0
- package/.xdrs/_general/edrs/principles/001-coding-agent-behavior.md +42 -0
- package/.xdrs/index.md +26 -0
- package/AGENTS.md +18 -0
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/bin/npmdata.js +4 -0
- package/package.json +32 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# general ADRs Index
|
|
2
|
+
|
|
3
|
+
This index covers cross-business architectural and technical decisions that apply to all scopes. Owned by the platform team. Propose changes via pull request.
|
|
4
|
+
|
|
5
|
+
This index lists all ADRs for the general scope, organized by subject.
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
Foundational standards, principles, and guidelines.
|
|
10
|
+
|
|
11
|
+
- [_general-adr-001](principles/001-xdr-standards.md) - **XDR standards** (includes XDR template)
|
|
12
|
+
- [_general-adr-003](principles/003-skill-standards.md) - **Skill standards**
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# _general-adr-001: XDR standards
|
|
2
|
+
|
|
3
|
+
## Context and Problem Statement
|
|
4
|
+
|
|
5
|
+
We need a consistent way to capture decisions that scales across scopes and subjects, remains easy to navigate, and works well with AI agents.
|
|
6
|
+
|
|
7
|
+
Decision Records can be of different kinds, depending on the nature of the decision:
|
|
8
|
+
- ADR (Architectural Decision Record): captures architectural and technical decisions
|
|
9
|
+
- BDR (Business Decision Record): captures business process and strategy decisions
|
|
10
|
+
- EDR (Engineering Decision Record): captures engineering workflow and tooling decisions
|
|
11
|
+
|
|
12
|
+
Collectively, these are referred to as XDRs.
|
|
13
|
+
|
|
14
|
+
How should XDRs be structured and organized across types, teams, and scopes?
|
|
15
|
+
|
|
16
|
+
## Decision Outcome
|
|
17
|
+
|
|
18
|
+
**Scoped + typed + subject folders**
|
|
19
|
+
|
|
20
|
+
Provides clear ownership by scope, predictable navigation, and reusable decisions that work well with AI agents by keeping files small and focused.
|
|
21
|
+
|
|
22
|
+
### Implementation Details
|
|
23
|
+
|
|
24
|
+
- 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.
|
|
25
|
+
- Make it clear if an instruction is mandatory or advisory
|
|
26
|
+
- Mandatory language: "must", "always", "never", "required", "mandatory"
|
|
27
|
+
- Advisory language: "should", "recommended", "advised", "preferably", "possibly", "optionally"
|
|
28
|
+
- Always the following folder structure:
|
|
29
|
+
`.xdrs/[scope]/[type]/[subject]/[number]-[short-title].md`
|
|
30
|
+
- **Scopes:**
|
|
31
|
+
- examples: `business-x`, `business-y`, `team-43`, `_general`
|
|
32
|
+
- `_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. When a scope name is not specified, `_local` is the standard scope to use.
|
|
33
|
+
- **Types:** `adrs`, `bdrs`, `edrs`
|
|
34
|
+
- there can exist sufixes to the standard scope names (e.g: `business-x-mobileapp`, `business-y-servicedesk`)
|
|
35
|
+
- **Subjects:** MUST be one of the following depending on the type of the XDR:
|
|
36
|
+
- **ADR:** `principles`, `application`, `data`, `integration`, `platform`, `controls`, `operations`
|
|
37
|
+
- **BDR:** `principles`, `marketing`, `product`, `controls`, `operations`, `organization`, `finance`, `sustainability`
|
|
38
|
+
- **EDR:** `principles`, `application`, `infra`, `ai`, `observability`, `devops`, `governance`
|
|
39
|
+
- **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)
|
|
40
|
+
- Types in IDs: `adr`, `bdr`, `edr`
|
|
41
|
+
- 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.
|
|
42
|
+
- Decisions MUST be concise and reference other XDRs to avoid duplication
|
|
43
|
+
- Never use emojis in contents
|
|
44
|
+
- Always use file names with lowercase
|
|
45
|
+
- 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.
|
|
46
|
+
- If there is a README.md file in the root of the xdrs folder, always keep it up to date. Never use emojis
|
|
47
|
+
- Keep a canonical index with all XDRs of a certain type+scope in `.xdrs/[scope]/[type]/index.md`
|
|
48
|
+
- Organize XDRs by subject for easier navigation
|
|
49
|
+
- 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.
|
|
50
|
+
- Document decision conflicts in "Conflicts" section for the XDR that is overriding another XDR in other scopes
|
|
51
|
+
- **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.
|
|
52
|
+
- In the index add a short description of what is this scope about (responsibilities, general worries, teams involved, link to discussion process etc)
|
|
53
|
+
- 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"
|
|
54
|
+
- Always verify if the index is up to date after making changes
|
|
55
|
+
- XDRs should be less than 100 lines long as a rule of thumb
|
|
56
|
+
- This is important to make them focused on a clear decision
|
|
57
|
+
- Exceptions can reach 200 lines (templates, more elaborate decision implementations etc)
|
|
58
|
+
|
|
59
|
+
**XDR template**
|
|
60
|
+
|
|
61
|
+
All XDRs MUST follow this template
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
# [scope]-[type]-[number]: [Short Title]
|
|
65
|
+
|
|
66
|
+
## Context and Problem Statement
|
|
67
|
+
|
|
68
|
+
[Describe the context, background, or need that led to this decision.
|
|
69
|
+
What is the problem we are trying to solve? Who is being impacted? (~4 lines)
|
|
70
|
+
|
|
71
|
+
In the end, state explicitly the question that needs to be answered. E.g: "Which platform should I use when implementing an AI agent?"]
|
|
72
|
+
|
|
73
|
+
## Decision Outcome
|
|
74
|
+
|
|
75
|
+
**[Chosen Option Title]**
|
|
76
|
+
[Very short description of what is the decision, aligned with the titles on the Considered Options section]
|
|
77
|
+
|
|
78
|
+
[Short description of implementation details for the chosen path]
|
|
79
|
+
|
|
80
|
+
### Implementation Details
|
|
81
|
+
|
|
82
|
+
[Optional section with implementation specifics, rules, examples or impact. This is the answer to the question in the "Context and Problem Statement". (<100 lines)]
|
|
83
|
+
|
|
84
|
+
## Considered Options
|
|
85
|
+
|
|
86
|
+
[Optional section present only when there are meaningful options to be discussed.]
|
|
87
|
+
|
|
88
|
+
* (REJECTED) **Option 1** - Brief description of option 1
|
|
89
|
+
* Reason: Brief description why this was rejected with important aspects to be re-checked in the case we want to change this decision
|
|
90
|
+
* (CHOSEN) **Option 2** - Brief description of option 2
|
|
91
|
+
* Reason: Brief description of why this option was accepted, containing the strengths, strategical motivations and it's differential over the other options.
|
|
92
|
+
* (REJECTED) **Option 3** - [same as above, if we have more than 2 options to choose from]
|
|
93
|
+
|
|
94
|
+
## Conflicts
|
|
95
|
+
|
|
96
|
+
[If this XDR has conflicts with other scopes, this section is MANDATORY and needs to have an explanation why the conflict is accepted]
|
|
97
|
+
|
|
98
|
+
* Conflict with [XDR id] (e.g.: adr-business-x-001)
|
|
99
|
+
* Summary: Brief description of the conflict
|
|
100
|
+
* Reason to accept: Brief description of why it was decided to accept this conflict, possibly overriding or diverging from the other decision/scopes
|
|
101
|
+
|
|
102
|
+
## References
|
|
103
|
+
|
|
104
|
+
[optional section]
|
|
105
|
+
[useful links related to this implementation]
|
|
106
|
+
[links to the discussion (PRs, meetings etc)]
|
|
107
|
+
[links to related skills]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Examples:**
|
|
111
|
+
- `.xdrs/business-x/edrs/devops/003-required-development-workflow.md`
|
|
112
|
+
- `.xdrs/business-x/adrs/governance/010-security-and-secrets-management.md`
|
|
113
|
+
- `.xdrs/general/adrs/devops/001-multi-repo.md`
|
|
114
|
+
|
|
115
|
+
**XDR ID Examples:**
|
|
116
|
+
- `business-x-adr-001` (not `ADR-business-x-001` or `business-x-adr-1`)
|
|
117
|
+
- `business-x-edr-042` (not `EDR-BUSINESS-X-042`)
|
|
118
|
+
- `business-x-bdr-007`
|
|
119
|
+
|
|
120
|
+
## Procedures
|
|
121
|
+
|
|
122
|
+
1. Choose the correct type (ADR, BDR, EDR), scope, and subject for each new XDR.
|
|
123
|
+
2. Create the XDR using the template in the Implementation Details section above, adapting it for the chosen type and required sections.
|
|
124
|
+
3. Update or create the scope `README.md` with examples if needed.
|
|
125
|
+
4. Add/update the new/updated XDRs to `.xdrs/[scope]/[type]/index.md` and to the main `.xdrs/index.md`
|
|
126
|
+
5. Keep decision texts short and link to other XDRs for shared rules
|
|
127
|
+
|
|
128
|
+
## Considered Options
|
|
129
|
+
|
|
130
|
+
* (REJECTED) **Flat list of decisions** - Simple but becomes unmanageable as the number grows.
|
|
131
|
+
* Reason: Does not scale and makes navigation difficult over time.
|
|
132
|
+
* (REJECTED) **Per-team folders without scope** - Easier ownership but loses organization hierarchy.
|
|
133
|
+
* Reason: Lacks a clear hierarchy and makes cross-team reuse harder.
|
|
134
|
+
* (CHOSEN) **Scoped + typed + subject folders** - Clear ownership by scope first, then decision type, with predictable navigation and reusable decisions.
|
|
135
|
+
* Reason: Scales well, supports AI agents with focused files, enables reuse across scopes, and groups all decisions for a given scope together regardless of type.
|
|
136
|
+
|
|
137
|
+
## References
|
|
138
|
+
|
|
139
|
+
- [001-xdr-lint skill](skills/001-xdr-lint/SKILL.md) - Skill for reviewing code changes against XDRs
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# _general-adr-003: Skill standards
|
|
2
|
+
|
|
3
|
+
## Context and Problem Statement
|
|
4
|
+
|
|
5
|
+
AI agents benefit from reusable, discoverable prompt packages that encode specific expertise or behaviors. Without a standard, these "skills" accumulate inconsistently across repositories, making them hard to find, validate, or share.
|
|
6
|
+
|
|
7
|
+
How should skills be authored, structured, and organized within a project so that they are consistent, LLM-friendly, and easy to discover?
|
|
8
|
+
|
|
9
|
+
## Decision Outcome
|
|
10
|
+
|
|
11
|
+
**agentskills-compatible skill packages, co-located with XDRs**
|
|
12
|
+
|
|
13
|
+
Skills follow the [agentskills](https://agentskills.io/specification) open format and live inside the XDR subject folder under a `skills/` sub-directory. Each skill occupies its own numbered package folder, mirroring the XDR numbering convention.
|
|
14
|
+
|
|
15
|
+
### Implementation Details
|
|
16
|
+
|
|
17
|
+
**Relation with XDRs**
|
|
18
|
+
Skills are procedures, XDRs are guardrails and decisions.
|
|
19
|
+
Always create links back and forth between skills <-> XDRs as a reference.
|
|
20
|
+
|
|
21
|
+
Place a skill under the XDR type that matches the nature of the activity the skill performs:
|
|
22
|
+
- **EDR skills** - engineering workflows, tool usage, coding procedures, implementation how-tos (e.g. how to design a webpage, how to run a CI pipeline, how to debug a service)
|
|
23
|
+
- **ADR skills** - architectural evaluation, pattern compliance checks, technology selection guidance (e.g. how to review an architecture diagram, how to assess API design)
|
|
24
|
+
- **BDR skills** - business process execution, market analysis, operations procedures, business rules
|
|
25
|
+
|
|
26
|
+
Quick test:
|
|
27
|
+
- "Is the skill about *how to implement or operate* something?" → EDR.
|
|
28
|
+
- "Is the skill about *how to evaluate or decide on* architecture?" → ADR.
|
|
29
|
+
- "Is the skill about *how to execute a business process, policy, or market activity*?" → BDR.
|
|
30
|
+
|
|
31
|
+
**Folder layout**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
.xdrs/[scope]/[type]/[subject]/skills/[number]-[skill-name]/
|
|
35
|
+
SKILL.md # required
|
|
36
|
+
scripts/ # optional: executable scripts the agent may run
|
|
37
|
+
references/ # optional: detailed reference material
|
|
38
|
+
assets/ # optional: templates, images, data files
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Examples:
|
|
42
|
+
- `.xdrs/general/adrs/principles/skills/001-code-review/SKILL.md`
|
|
43
|
+
- `.xdrs/business-x/edrs/devops/skills/001-ci-pipeline-debug/SKILL.md`
|
|
44
|
+
|
|
45
|
+
**Skill numbering**
|
|
46
|
+
|
|
47
|
+
- Each skill has a number unique within its `scope/type/subject/skills/` namespace.
|
|
48
|
+
- Determine the next number by checking the highest number already present in that namespace. Never reuse numbers of deleted skills.
|
|
49
|
+
- Gaps in the sequence are expected and allowed.
|
|
50
|
+
|
|
51
|
+
**SKILL.md format** (agentskills spec)
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
---
|
|
55
|
+
name: 001-skill-name # required: must match the parent directory name exactly; max 64 chars
|
|
56
|
+
description: > # required: what the skill does AND when to activate it; max 1024 chars
|
|
57
|
+
Concise explanation of the skill and the situations in which an agent should load it.
|
|
58
|
+
license: <license> # optional
|
|
59
|
+
metadata: # optional: arbitrary key/value pairs
|
|
60
|
+
author: <team-or-person>
|
|
61
|
+
version: "1.0"
|
|
62
|
+
compatibility: <env> # optional: system requirements or intended products
|
|
63
|
+
allowed-tools: <tools> # optional (experimental): space-delimited pre-approved tools
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Overview
|
|
67
|
+
|
|
68
|
+
Brief description of the skill goal.
|
|
69
|
+
|
|
70
|
+
## Instructions
|
|
71
|
+
|
|
72
|
+
Step-by-step instructions the agent should follow.
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
Concrete input/output examples that illustrate correct behavior.
|
|
77
|
+
|
|
78
|
+
## Edge Cases
|
|
79
|
+
|
|
80
|
+
Known gotchas and how to handle them.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Rules:
|
|
84
|
+
- The `name` field must match the parent directory name exactly (e.g., directory `001-code-review` uses `name: 001-code-review`). This preserves agentskills spec compliance while encoding the ordering number.
|
|
85
|
+
- Keep `SKILL.md` under 500 lines. Move lengthy reference material to `references/`.
|
|
86
|
+
- Reference other files with relative paths from the skill root.
|
|
87
|
+
- Always use lowercase file names.
|
|
88
|
+
- Never use emojis in skill content.
|
|
89
|
+
|
|
90
|
+
**Validation**
|
|
91
|
+
|
|
92
|
+
Use the [skills-ref](https://github.com/agentskills/agentskills/tree/main/skills-ref) CLI to validate before committing:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
skills-ref validate .xdrs/[scope]/[type]/[subject]/skills/[number]-[skill-name]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Considered Options
|
|
99
|
+
|
|
100
|
+
* (REJECTED) **Top-level `skills/` directory separate from XDRs** - Decouples skills from the decisions that govern them.
|
|
101
|
+
* Reason: Breaks the natural association between a decision (XDR) and the skill that implements it; makes navigation harder.
|
|
102
|
+
* (CHOSEN) **agentskills-compatible packages co-located with XDRs** - Standardized format with scoped discovery and clear ownership.
|
|
103
|
+
* Reason: Reuses proven agentskills tooling, aligns with the existing XDR scope/subject hierarchy, and keeps skills close to the decisions they implement.
|
|
104
|
+
|
|
105
|
+
## References
|
|
106
|
+
|
|
107
|
+
- [agentskills specification](https://agentskills.io/specification)
|
|
108
|
+
- [agentskills/agentskills repository](https://github.com/agentskills/agentskills)
|
|
109
|
+
- [skills-ref validation library](https://github.com/agentskills/agentskills/tree/main/skills-ref)
|
|
110
|
+
- [_general-adr-001 - XDR standards](001-xdr-standards.md)
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 001-xdr-lint
|
|
3
|
+
description: >
|
|
4
|
+
Reviews code changes or files against applicable XDRs (Decision Records) and reports
|
|
5
|
+
violations as structured findings. Activate this skill when the user asks to review,
|
|
6
|
+
lint, or audit code, or when you identify a need to check compliance with XDRs during implementation.
|
|
7
|
+
metadata:
|
|
8
|
+
author: flaviostutz
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Performs a structured review of code changes or files against the XDRs in the repository,
|
|
15
|
+
categorizing findings by severity and type, and reporting them without modifying any code.
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
### Phase 1: XDR Compilation
|
|
20
|
+
|
|
21
|
+
1. Gather all Decision Records from `.xdrs/index.md` starting from the working directory.
|
|
22
|
+
- XDR scopes are controlled by nested folders; some are broad, others domain-specific.
|
|
23
|
+
- Extract metadata first (status, impact, scope, applicability) to filter relevant XDRs before deep analysis.
|
|
24
|
+
2. Filter relevance based on file types, domains, and architectural patterns in scope.
|
|
25
|
+
|
|
26
|
+
### Phase 2: Code Analysis
|
|
27
|
+
|
|
28
|
+
1. Identify changes based on requested scope:
|
|
29
|
+
- For diffs: run and parse `git diff origin/main`
|
|
30
|
+
- For files: analyze file contents directly
|
|
31
|
+
- For services: scan all files in the service directory
|
|
32
|
+
2. Categorize potential findings:
|
|
33
|
+
- Architecture: violations of structural decisions
|
|
34
|
+
- Coding Standards: style and pattern violations
|
|
35
|
+
- Testing: missing or inadequate test coverage
|
|
36
|
+
- Documentation: missing or outdated documentation
|
|
37
|
+
- Security: security practice violations
|
|
38
|
+
- Performance: performance best practice violations
|
|
39
|
+
3. Compile specific, measurable rules from each XDR and compare against the changes.
|
|
40
|
+
4. Prioritize by criticality: Accepted > Proposed; Impact: critical > high > medium > low.
|
|
41
|
+
|
|
42
|
+
### Phase 3: Review and Judgment
|
|
43
|
+
|
|
44
|
+
1. Cross-reference each finding against applicable XDRs.
|
|
45
|
+
- **Drop any finding that cannot be traced to a specific rule in an Accepted XDR.** General good-practice observations, personal opinions, or inferred issues without an explicit XDR backing must not be reported.
|
|
46
|
+
- Classify as ERROR (mandatory) or WARNING (advisory).
|
|
47
|
+
- Include: location, description, XDR reference (file + line), suggestion.
|
|
48
|
+
2. Reduce false positives:
|
|
49
|
+
- Re-evaluate ERROR findings for mandatory language in the XDR ("must", "always", "never", "required", "mandatory"). Drop or downgrade to WARNING if the language is advisory ("should", "recommended", "advised").
|
|
50
|
+
- Remove findings unrelated to actual changes.
|
|
51
|
+
- Consolidate duplicates.
|
|
52
|
+
- Consider context (existing style, legacy sections, etc.).
|
|
53
|
+
3. Judgment criteria (all must be true to keep a finding):
|
|
54
|
+
- Is the violation explicitly stated in an Accepted XDR? (If no, drop it.)
|
|
55
|
+
- Is there concrete evidence in the code or diff?
|
|
56
|
+
- Is the finding actionable?
|
|
57
|
+
- Would fixing it meaningfully improve compliance with the XDR?
|
|
58
|
+
|
|
59
|
+
### Phase 4: Reporting
|
|
60
|
+
|
|
61
|
+
Format each finding as:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
>> [ERROR|WARNING] [CATEGORY] filename:line_number: Description
|
|
65
|
+
- XDR Reference: .xdrs/scope/type/subject/number-title.md:line_number
|
|
66
|
+
- Rule: Specific rule text from XDR
|
|
67
|
+
- Severity: [ERROR|WARNING]
|
|
68
|
+
- Suggestion: Specific action to fix this issue
|
|
69
|
+
- Context: Why this matters / What to watch for
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Full output structure:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
=== Code Review Against XDRs ===
|
|
76
|
+
Scope: [scope identifier]
|
|
77
|
+
Files Analyzed: [number]
|
|
78
|
+
Changes: [+X lines, -Y lines]
|
|
79
|
+
|
|
80
|
+
=== Findings ===
|
|
81
|
+
[findings list]
|
|
82
|
+
|
|
83
|
+
=== Summary ===
|
|
84
|
+
- Errors Found: [count]
|
|
85
|
+
- Warnings Found: [count]
|
|
86
|
+
- Review Status: [PASS|FAIL]
|
|
87
|
+
|
|
88
|
+
Affected Files Requiring Changes
|
|
89
|
+
[bullet list of files with issues, linked to specific findings and severity]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Constraints
|
|
93
|
+
|
|
94
|
+
- MUST NOT include any text or explanations outside the required output format.
|
|
95
|
+
- MUST NOT edit code. Instruct the user on how to request code changes in suggestions.
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
User: "Review my changes against XDRs"
|
|
100
|
+
Agent action: runs `git diff origin/main`, reads `.xdrs/` hierarchy, filters applicable XDRs,
|
|
101
|
+
produces structured findings report.
|
|
102
|
+
|
|
103
|
+
User: "Lint the auth service"
|
|
104
|
+
Agent action: scans all files under the auth service directory, applies relevant XDRs,
|
|
105
|
+
produces structured findings report.
|
|
106
|
+
|
|
107
|
+
## Edge Cases
|
|
108
|
+
|
|
109
|
+
- If no XDRs apply to the scope, output "No applicable XDRs found" and skip reporting.
|
|
110
|
+
- If `git diff` fails (no git repo, no remote), fall back to analyzing staged or working tree files.
|
|
111
|
+
- If a potential violation is in pre-existing code outside the diff, report it as WARNING only.
|
|
112
|
+
|
|
113
|
+
## References
|
|
114
|
+
|
|
115
|
+
- [_general-adr-001 - XDR standards](../../001-xdr-standards.md)
|
|
116
|
+
- [_general-adr-003 - Skill standards](../../003-skill-standards.md)
|
|
117
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# general EDRs Index
|
|
2
|
+
|
|
3
|
+
General engineering decisions covering cross-business standards and practices. Applies to all AI coding agents working in any scope. Owned by the platform team. Propose changes via pull request.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
|
|
7
|
+
Foundational standards, principles, and guidelines.
|
|
8
|
+
|
|
9
|
+
- [_general-edr-001](principles/001-coding-agent-behavior.md) - **AI coding agent behavior**
|
|
10
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# _general-edr-001: AI coding agent behavior
|
|
2
|
+
|
|
3
|
+
## Context and Problem Statement
|
|
4
|
+
|
|
5
|
+
AI coding agents (such as GitHub Copilot) require clear guidelines about expected behavior to ensure consistency, proper verification of work, and respect for developer workflows.
|
|
6
|
+
|
|
7
|
+
What behavioral standards should AI coding agents follow when working on code?
|
|
8
|
+
|
|
9
|
+
## Decision Outcome
|
|
10
|
+
|
|
11
|
+
**AI agents must follow a defined instruction hierarchy, verify work with automated checks, and defer git operations to developers**
|
|
12
|
+
|
|
13
|
+
Clear behavior standards ensure consistency through EDR compliance, maintain code quality through automated verification, and respect the developer's role in version control decisions.
|
|
14
|
+
|
|
15
|
+
### Implementation Details
|
|
16
|
+
|
|
17
|
+
**Mandatory behaviors for AI coding agents:**
|
|
18
|
+
|
|
19
|
+
1. **Follow instruction hierarchy when making implementation decisions**
|
|
20
|
+
1. **Closest AGENTS.md** to the file being changed (search from target directory up to workspace root). Instructions in those files override the global EDRs. If multiple AGENTS.md files exist in the path, merge their instructions; the closest AGENTS.md overrides those farther away.
|
|
21
|
+
2. **Global EDR** – Follow scope-based precedence defined in [.xdrs/index.md](../../../../index.md). EDRs in scopes listed last override EDRs in scopes listed first.
|
|
22
|
+
|
|
23
|
+
2. **Verify all work with build, tests and linting before completion**
|
|
24
|
+
- Check EDRs for workspace tooling: [.xdrs/index.md](../../../../index.md)
|
|
25
|
+
- Run quality checks in sequence relative to the module directory: `STAGE=dev make build-module`, `make lint-module`, then `make test-module`
|
|
26
|
+
- Use `make lint-fix` to fix lint issues
|
|
27
|
+
- Do not run commands outside Makefiles
|
|
28
|
+
|
|
29
|
+
3. **Verify implementation complies with EDRs**
|
|
30
|
+
- Review relevant EDRs before marking work complete
|
|
31
|
+
- Ensure implementation decisions follow EDR guidelines and patterns
|
|
32
|
+
|
|
33
|
+
4. **Do not perform git operations**
|
|
34
|
+
- Do not run git commands (add, commit, push, branch creation, etc.)
|
|
35
|
+
- Inform the developer when work is ready for version control
|
|
36
|
+
|
|
37
|
+
## Considered Options
|
|
38
|
+
|
|
39
|
+
* (REJECTED) **Minimal guidance** - Let agents operate with default behavior
|
|
40
|
+
* Reason: Results in inconsistent code quality, missed verification steps, and developers losing control of git workflow
|
|
41
|
+
* (CHOSEN) **EDR-compliant agents** - Clear behavior standards
|
|
42
|
+
* Reason: Ensures consistency through EDR compliance, maintains code quality through verification, and respects developer control of version control
|
package/.xdrs/index.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# XDR Standards Index
|
|
2
|
+
|
|
3
|
+
This index points to all type- and scope-specific XDR indexes. XDRs (Decision Records) cover Architectural (ADR), Business (BDR), and Engineering (EDR) decisions. Each scope has its own canonical index that lists all XDRs for that scope, organized by subject.
|
|
4
|
+
|
|
5
|
+
## Scope Indexes
|
|
6
|
+
|
|
7
|
+
XDRs in scopes listed last override the ones listed first
|
|
8
|
+
|
|
9
|
+
### ADRs - general
|
|
10
|
+
|
|
11
|
+
General architectural decisions covering cross-business standards and practices.
|
|
12
|
+
|
|
13
|
+
[View general ADRs Index](_general/adrs/index.md)
|
|
14
|
+
|
|
15
|
+
### EDRs - general
|
|
16
|
+
|
|
17
|
+
General engineering decisions covering cross-business standards and practices.
|
|
18
|
+
|
|
19
|
+
[View general EDRs Index](_general/edrs/index.md)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### _local (reserved)
|
|
24
|
+
|
|
25
|
+
Project-local XDRs that must not be shared with other contexts. Always keep this scope last so its decisions override or extend all scopes listed above. Add specific `_local` ADR/BDR/EDR index links here when present.
|
|
26
|
+
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
**Purpose:** This file is intentionally brief. All project decisions and working instructions are captured as XDRs.
|
|
4
|
+
|
|
5
|
+
1. **Always consult XDRs before making implementation decisions**
|
|
6
|
+
- Follow coding agent behavior and decision hierarchy rules in [.xdrs/_general/edrs/principles/001-coding-agent-behavior.md](.xdrs/_general/edrs/principles/001-coding-agent-behavior.md)
|
|
7
|
+
- Search for XDRs in [.xdrs/index.md](.xdrs/index.md) during design, plan and implementation steps
|
|
8
|
+
- Follow XDRs as the source of truth for all decisions and procedures
|
|
9
|
+
|
|
10
|
+
2. **Verify all work with build, tests and linting before completion**
|
|
11
|
+
- Fix any issues
|
|
12
|
+
|
|
13
|
+
3. **Verify if implementation complies with XDRs**
|
|
14
|
+
- Re-analyse your work against the XDRs and ensure implementation decisions follow guidelines and patterns
|
|
15
|
+
|
|
16
|
+
4. **Do not perform git operations**
|
|
17
|
+
- Do not run git commands (add, commit, push, branch creation, etc.)
|
|
18
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Flavio Stutz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# xdr-standards
|
|
2
|
+
|
|
3
|
+
A standard way to organize Decision Records (XDRs) across scopes, subjects, and teams so that AI agents can reliably query and follow them.
|
|
4
|
+
|
|
5
|
+
> **Note:** This repository contains a minimum set of standards and very basic set of ADRs that describe the proposed decisions structure. It is intended to be used as a foundation that other projects can reference, extend, or install as a dependency in order to bootstrap and create their own XDRs.
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
|
|
9
|
+
Decision Records capture Architectural (ADR), Business (BDR), and Engineering (EDR) decisions. As organizations grow, hundreds of decisions accumulate across teams, levels, and domains. Without a consistent structure, AI agents cannot efficiently locate the right decisions for a given context, and humans cannot maintain or evolve them sustainably.
|
|
10
|
+
|
|
11
|
+
This project defines a standard for organizing XDRs that satisfies the following requirements.
|
|
12
|
+
|
|
13
|
+
## Getting started
|
|
14
|
+
|
|
15
|
+
1. Create a new project workspace
|
|
16
|
+
|
|
17
|
+
2. On the workspace root folder, run `npx xdrs-core`
|
|
18
|
+
|
|
19
|
+
The basic xdrs tooling should be installed in your workspace along with:
|
|
20
|
+
- AGENTS.md pointing to the XDRs structure
|
|
21
|
+
- XDR related skills and prompts for Copilot
|
|
22
|
+
|
|
23
|
+
3. Run a prompt such as:
|
|
24
|
+
|
|
25
|
+
> Create an ADR about our decision on using Python for AI related projects. For high volume projects (expected >1000 t/s), an exception can be made on using Golang.
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
### Multi-scope support
|
|
30
|
+
|
|
31
|
+
Different teams at different organizational levels make decisions that apply to different audiences. XDRs are organized by scope (e.g. `_general`, `business-x`, `business-y-mobileapp`) so that each team owns its own decision space. Scopes can extend or override decisions from broader scopes, with explicit precedence rules: scopes listed later in an index override those listed earlier.
|
|
32
|
+
|
|
33
|
+
### Subject grouping
|
|
34
|
+
|
|
35
|
+
Within each scope and type, decisions are grouped by subject (e.g. `application`, `data`, `platform` for ADRs; `product`, `finance` for BDRs). This keeps related decisions together, improves human navigation, and allows AI agents to narrow their search to the relevant subject folder before reading individual records.
|
|
36
|
+
|
|
37
|
+
### Extensibility
|
|
38
|
+
|
|
39
|
+
Over time, decisions from various teams and domains accumulate in a shared workspace. The folder structure `.xdrs/[scope]/[type]/[subject]/` is designed to accommodate new scopes, types, and subjects without reorganizing existing content. A root index at `.xdrs/index.md` points to all canonical scope indexes, and each canonical index is updated incrementally as new XDRs are added.
|
|
40
|
+
|
|
41
|
+
### Distributability
|
|
42
|
+
|
|
43
|
+
XDR packages are versioned and distributed via the npm registry. This allows teams to adopt specific decision sets at a specific version, rather than accepting all decisions at once. It avoids "all or nothing" situations when linting or checking adherence to decisions in the context of tech debt management. Teams can pin, upgrade, or override only the scopes that are relevant to them.
|
|
44
|
+
|
|
45
|
+
### AI-agent friendliness
|
|
46
|
+
|
|
47
|
+
The folder layout, file naming, and document format are designed so that AI agents can efficiently work with hundreds of decisions:
|
|
48
|
+
|
|
49
|
+
- Each XDR is a small, focused Markdown file (target under 100 lines), covering one decision.
|
|
50
|
+
- The canonical index per scope and type lists all XDRs with short descriptions, enabling agents to identify relevant records without reading every file.
|
|
51
|
+
- The root index at `.xdrs/index.md` provides a single entry point for discovery.
|
|
52
|
+
- Decisions cross-reference each other by XDR ID rather than duplicating content, keeping individual files concise.
|
|
53
|
+
- Subject folders reduce the search space when a query maps to a known domain.
|
|
54
|
+
|
|
55
|
+
### Multi-agent framework support
|
|
56
|
+
|
|
57
|
+
XDRs and skills must be usable by any type of AI agent, not only coding agents (e.g. GitHub Copilot, Cursor, Cline). General-purpose agent frameworks such as LangGraph, CrewAI, AutoGen, and similar orchestration runtimes must be able to consume XDRs without relying on IDE-specific tooling or conventions.
|
|
58
|
+
|
|
59
|
+
This is especially important for BDRs: because business rules govern decisions that span both technical and non-technical workflows, agents built with any framework must be able to discover, fetch, and apply BDRs programmatically using only standard file-system or HTTP access to Markdown files.
|
|
60
|
+
|
|
61
|
+
## Structure
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
.xdrs/
|
|
65
|
+
index.md # root index pointing to all scope indexes
|
|
66
|
+
[scope]/
|
|
67
|
+
[type]/ # adrs | bdrs | edrs
|
|
68
|
+
index.md # canonical index for this scope+type
|
|
69
|
+
[subject]/
|
|
70
|
+
[number]-[short-title].md # individual decision record
|
|
71
|
+
skills/ # optional agent skill packages
|
|
72
|
+
[number]-[skill-name]/
|
|
73
|
+
SKILL.md
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Types of Decision Records:
|
|
77
|
+
|
|
78
|
+
- **ADR** - Architectural Decision Record: architectural and technical decisions
|
|
79
|
+
- **BDR** - Business Decision Record: business process and strategy decisions
|
|
80
|
+
- **EDR** - Engineering Decision Record: engineering workflow and tooling decisions
|
|
81
|
+
|
|
82
|
+
See [.xdrs/index.md](.xdrs/index.md) for the full list of active decision records.
|
|
83
|
+
|
|
84
|
+
## Flow: Decision -> Distribution -> Usage
|
|
85
|
+
|
|
86
|
+
XDRs and skills follow a three-stage lifecycle that keeps decision-making decentralized while allowing controlled adoption across projects.
|
|
87
|
+
|
|
88
|
+
### Decision
|
|
89
|
+
|
|
90
|
+
Each scope manages its own set of XDRs independently. Scope owners discuss and evolve decisions through whatever process fits their team, such as RFCs, pull requests, or architecture review boards. XDRs and skills are authored, reviewed, and merged within the scope's folder in the repository.
|
|
91
|
+
|
|
92
|
+
### Distribution
|
|
93
|
+
|
|
94
|
+
Once a set of decisions is ready to share, scope owners pack the relevant `.xdrs/[scope]/` folder into a versioned npm package using a tool such as [npmdata](https://github.com/flaviostutz/npmdata) and publish it to an npm registry, either public or a company-internal one. Versioning gives consumers explicit control over which revision of a scope's decisions they adopt, avoiding situations where a single breaking policy change is forced on all consumers at once.
|
|
95
|
+
|
|
96
|
+
The same applies to skills: because they live alongside XDRs inside the scope folder, they are included in the same package and published together.
|
|
97
|
+
|
|
98
|
+
### Usage
|
|
99
|
+
|
|
100
|
+
A project that wants to follow a scope's decisions adds the corresponding npm package as a regular dependency. Using a tool such as [npmdata](https://github.com/flaviostutz/npmdata), the package contents are unpacked into the project's `.xdrs/` folder at install or update time. Updating the dependency version pulls in the latest XDRs and skills for that scope, keeping the project aligned with the scope owners' current decisions.
|
|
101
|
+
|
|
102
|
+
Multiple scope packages can be combined in the same workspace by listing them as separate dependencies. Scope precedence (defined in `.xdrs/index.md`) determines which decisions take effect when scopes overlap.
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
[Scope repo] --> npm publish --> [npm registry] --> npm install --> [Project workspace]
|
|
106
|
+
.xdrs/[scope]/ versioned pkg .xdrs/[scope]/
|
|
107
|
+
adrs/ bdrs/ edrs/ adrs/ bdrs/ edrs/
|
|
108
|
+
[subject]/ [subject]/
|
|
109
|
+
*.md *.md
|
|
110
|
+
skills/ skills/
|
|
111
|
+
```
|
package/bin/npmdata.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xdrs-core",
|
|
3
|
+
"version": "0.1.1-beta.0",
|
|
4
|
+
"description": "A standard way to organize Decision Records (XDRs) across scopes, subjects, and teams so that AI agents can reliably query and follow them.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xdr",
|
|
7
|
+
"adr",
|
|
8
|
+
"decision-records",
|
|
9
|
+
"ai-agents"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"files": [
|
|
13
|
+
".xdrs/**",
|
|
14
|
+
"package.json",
|
|
15
|
+
"AGENTS.md",
|
|
16
|
+
"bin/npmdata.js"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"npmdata": "^0.6.1-beta.0"
|
|
20
|
+
},
|
|
21
|
+
"npmdata": [
|
|
22
|
+
{
|
|
23
|
+
"package": "xdrs-core",
|
|
24
|
+
"outputDir": ".",
|
|
25
|
+
"files": [
|
|
26
|
+
"AGENTS.md",
|
|
27
|
+
".xdrs/**"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"bin": "bin/npmdata.js"
|
|
32
|
+
}
|