xdrs-core 0.2.15 → 0.2.16
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 +1 -1
- package/.xdrs/_core/adrs/principles/skills/{001-xdr-lint → 001-lint}/SKILL.md +23 -44
- package/.xdrs/index.md +1 -7
- package/AGENTS.md +10 -8
- package/package.json +32 -22
- package/.xdrs/_core/edrs/index.md +0 -10
- package/.xdrs/_core/edrs/principles/001-coding-agent-behavior.md +0 -37
|
@@ -137,4 +137,4 @@ In the end, state explicitly the question that needs to be answered. E.g: "Which
|
|
|
137
137
|
|
|
138
138
|
## References
|
|
139
139
|
|
|
140
|
-
- [001-
|
|
140
|
+
- [001-lint skill](skills/001-lint/SKILL.md) - Skill for reviewing code changes against XDRs
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: 001-
|
|
2
|
+
name: 001-lint
|
|
3
3
|
description: >
|
|
4
|
-
Reviews code changes or files against applicable XDRs (Decision Records) and reports
|
|
5
|
-
|
|
6
|
-
lint, or audit code, or when you identify a need to check compliance with XDRs during implementation.
|
|
4
|
+
Reviews code changes or files against applicable XDRs (Decision Records) and reports violations as structured findings.
|
|
5
|
+
Activate this skill when the user asks to review, lint, or audit code, or when you identify a need to check compliance with XDRs during implementation.
|
|
7
6
|
metadata:
|
|
8
7
|
author: flaviostutz
|
|
9
8
|
version: "1.0"
|
|
@@ -11,8 +10,7 @@ metadata:
|
|
|
11
10
|
|
|
12
11
|
## Overview
|
|
13
12
|
|
|
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.
|
|
13
|
+
Performs a structured review of code changes or files against the XDRs in the repository, categorizing findings by severity and type, and reporting them without modifying any code.
|
|
16
14
|
|
|
17
15
|
## Instructions
|
|
18
16
|
|
|
@@ -43,7 +41,7 @@ categorizing findings by severity and type, and reporting them without modifying
|
|
|
43
41
|
3. For related XDRs and files, lookup for the specific line number in both the XDR and the code that are related to the finding. This will be used in the reporting phase to provide precise references and actionable suggestions.
|
|
44
42
|
|
|
45
43
|
### Phase 4: Judgment
|
|
46
|
-
|
|
44
|
+
1. Judgment criteria (all must be true to keep a finding):
|
|
47
45
|
- Is the violation explicitly stated as a rule in an Accepted XDR using mandatory or advisory language? Templates, examples, and diagrams in XDRs are illustrative only — they do not constitute rules. If the only evidence for the violation is an implicit pattern in a code sample or template, drop it.
|
|
48
46
|
- Is there concrete evidence in the code or diff?
|
|
49
47
|
- Is the finding actionable?
|
|
@@ -51,56 +49,37 @@ categorizing findings by severity and type, and reporting them without modifying
|
|
|
51
49
|
|
|
52
50
|
### Phase 5: Reporting
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
>> [ERROR|WARNING] [CATEGORY] [filename:line_number](filename#Lline_number): Description
|
|
58
|
-
- XDR Reference: [.xdrs/scope/type/subject/number-title.md:line_number](.xdrs/scope/type/subject/number-title.md#Lline_number)
|
|
59
|
-
- Rule: Specific rule text from XDR
|
|
60
|
-
- Severity: [ERROR|WARNING]
|
|
61
|
-
- Suggestion: Specific action to fix this issue
|
|
62
|
-
- Context: Why this matters / What to watch for
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Full output structure:
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
=== Code Review Against XDRs ===
|
|
52
|
+
**Report template**
|
|
53
|
+
--------
|
|
54
|
+
### Code Review Against XDRs
|
|
69
55
|
Scope: [scope identifier]
|
|
70
|
-
Files Analyzed: [number]
|
|
71
|
-
Changes: [+X lines, -Y lines]
|
|
72
56
|
|
|
73
|
-
|
|
74
|
-
[
|
|
57
|
+
## Findings
|
|
58
|
+
### 1. [ERROR|WARNING] - [filename:line_number](filename:line_number)
|
|
59
|
+
- Title of the finding (<=15 words)
|
|
60
|
+
- XDR reference: [xdr-file:line_number](xdr-file:line_number)
|
|
61
|
+
- Why: Brief description of the issue in 20 words
|
|
62
|
+
- Fix: Specific action to fix this issue in 15 words
|
|
63
|
+
- Relevance: Why this matters / What to watch for in 15 words
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
- Errors Found: [count]
|
|
78
|
-
- Warnings Found: [count]
|
|
79
|
-
- Review Status: [PASS|FAIL]
|
|
65
|
+
### 2. [second finding etc]
|
|
80
66
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
## Summary
|
|
68
|
+
- Errors: [count]
|
|
69
|
+
- Warnings: [count]
|
|
70
|
+
- Outcome: [PASS|FAIL]
|
|
71
|
+
--------
|
|
84
72
|
|
|
85
73
|
### Constraints
|
|
86
|
-
|
|
87
74
|
- MUST NOT include any text or explanations outside the required output format.
|
|
88
75
|
- MUST NOT edit code. Instruct the user on how to request code changes in suggestions.
|
|
89
76
|
|
|
90
77
|
## Examples
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Agent action: runs `git diff origin/main`, reads `.xdrs/` hierarchy, filters applicable XDRs,
|
|
94
|
-
produces structured findings report.
|
|
95
|
-
|
|
96
|
-
User: "Lint the auth service"
|
|
97
|
-
Agent action: scans all files under the auth service directory, applies relevant XDRs,
|
|
98
|
-
produces structured findings report.
|
|
78
|
+
- An XDR mentions that "Every code MUST have a header comment with author name", if you find a codebase without the author name, report as ERROR.
|
|
79
|
+
- An XDR mentions that "Functions SHOULD be no longer than 50 lines", if you find a function with 80 lines, report as WARNING.
|
|
99
80
|
|
|
100
81
|
## Edge Cases
|
|
101
|
-
|
|
102
82
|
- If no XDRs apply to the scope, output "No applicable XDRs found" and skip reporting.
|
|
103
|
-
- If `git diff` fails (no git repo, no remote), fall back to analyzing staged or working tree files.
|
|
104
83
|
- If a potential violation is in pre-existing code outside the diff, report it as WARNING only.
|
|
105
84
|
|
|
106
85
|
## References
|
package/.xdrs/index.md
CHANGED
|
@@ -11,15 +11,9 @@ XDRs in scopes listed last override the ones listed first
|
|
|
11
11
|
Decisions about how XDRs work
|
|
12
12
|
[View general ADRs Index](_core/adrs/index.md)
|
|
13
13
|
|
|
14
|
-
Decisions about how XDRs work
|
|
15
|
-
[View general EDRs Index](_core/edrs/index.md)
|
|
16
|
-
|
|
17
14
|
---
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
General engineering decisions from agentkit scope
|
|
22
|
-
[View agentkit EDRs Index](agentkit/edrs/index.md)
|
|
16
|
+
[OTHER SCOPES HERE]
|
|
23
17
|
|
|
24
18
|
---
|
|
25
19
|
|
package/AGENTS.md
CHANGED
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
**Purpose:** This file is intentionally brief. All project decisions and working instructions are captured as XDRs.
|
|
4
4
|
|
|
5
|
-
1. **Always consult XDRs before making
|
|
6
|
-
- You MUST follow
|
|
7
|
-
- You MUST search and follow XDRs in [.xdrs/index.md](.xdrs/index.md) during design, plan, implementation, test and review steps
|
|
8
|
-
- You MUST follow XDRs as the source of truth for all decisions and procedures
|
|
5
|
+
1. **Always consult XDRs before making decisions**
|
|
6
|
+
- You MUST search and follow Decision Records (XDRs) for architecture, engineering and business in [.xdrs/index.md](.xdrs/index.md) during design, plan, implementation, test and review steps. This is the source of truth.
|
|
9
7
|
|
|
10
8
|
2. **Verify all work with build, tests and linting before completion**
|
|
11
|
-
- Always run
|
|
9
|
+
- Always run build, lint-fix and test at the end of the implementation
|
|
12
10
|
- Fix any issues
|
|
13
11
|
|
|
14
12
|
3. **Verify if implementation complies with XDRs**
|
|
15
|
-
-
|
|
13
|
+
- Analyse your work against the XDRs and ensure implementation decisions follow guidelines and patterns
|
|
14
|
+
- Fix any issues
|
|
15
|
+
|
|
16
|
+
4. **Do not perform git operations unless explicitelly asked**
|
|
17
|
+
- The developer should be in control of possible destructive operations on the workspace
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
- Do not run git commands (add, commit, push, branch creation, etc.)
|
|
19
|
+
Check for additional instructions on [AGENTS-LOCAL.md](AGENTS-LOCAL.md).
|
|
19
20
|
|
|
21
|
+
**This AGENTS.md file was created with xdrs-core and shouldn't be changed**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xdrs-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
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
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,35 +20,45 @@
|
|
|
20
20
|
"bin/npmdata.js"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"npmdata": "^0.
|
|
23
|
+
"npmdata": "^0.15.1"
|
|
24
24
|
},
|
|
25
25
|
"npmdata": {
|
|
26
26
|
"sets": [
|
|
27
27
|
{
|
|
28
28
|
"package": "xdrs-core",
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
"selector": {
|
|
30
|
+
"files": [
|
|
31
|
+
"AGENTS.md",
|
|
32
|
+
".xdrs/**"
|
|
33
|
+
],
|
|
34
|
+
"exclude": [
|
|
35
|
+
".xdrs/index.md"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"output": {
|
|
39
|
+
"path": ".",
|
|
40
|
+
"symlinks": [
|
|
41
|
+
{
|
|
42
|
+
"source": ".xdrs/**/skills/*",
|
|
43
|
+
"target": ".github/skills"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"gitignore": false
|
|
47
|
+
}
|
|
42
48
|
},
|
|
43
49
|
{
|
|
44
50
|
"package": "xdrs-core",
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
51
|
+
"selector": {
|
|
52
|
+
"files": [
|
|
53
|
+
".xdrs/index.md"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"output": {
|
|
57
|
+
"path": ".",
|
|
58
|
+
"gitignore": false,
|
|
59
|
+
"unmanaged": true,
|
|
60
|
+
"keepExisting": true
|
|
61
|
+
}
|
|
52
62
|
}
|
|
53
63
|
]
|
|
54
64
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
- [_core-edr-001](principles/001-coding-agent-behavior.md) - **AI coding agent behavior**
|
|
10
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# _core-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. **Always consult XDRs before making implementation decisions**
|
|
20
|
-
- Follow coding agent behavior and decision hierarchy rules in [.xdrs/_core/edrs/principles/001-coding-agent-behavior.md](.xdrs/_core/edrs/principles/001-coding-agent-behavior.md)
|
|
21
|
-
- Search for XDRs in [.xdrs/index.md](.xdrs/index.md) during design, plan and implementation steps
|
|
22
|
-
- Follow XDRs as the source of truth for all decisions and procedures
|
|
23
|
-
|
|
24
|
-
2. **Verify all work with build, tests and linting before completion**
|
|
25
|
-
- Always run `make build`, `make lint-fix` and `make test` at the end of the implementation
|
|
26
|
-
- Fix any issues
|
|
27
|
-
|
|
28
|
-
3. **Verify if implementation complies with XDRs**
|
|
29
|
-
- Re-analyse your work against the XDRs and ensure implementation decisions follow guidelines and patterns
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Considered Options
|
|
33
|
-
|
|
34
|
-
* (REJECTED) **Minimal guidance** - Let agents operate with default behavior
|
|
35
|
-
* Reason: Results in inconsistent code quality, missed verification steps, and developers losing control of git workflow
|
|
36
|
-
* (CHOSEN) **EDR-compliant agents** - Clear behavior standards
|
|
37
|
-
* Reason: Ensures consistency through EDR compliance, maintains code quality through verification, and respects developer control of version control
|