xdrs-core 0.14.2 → 0.14.4

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.
@@ -2,15 +2,15 @@
2
2
  "Review xdr 001-xdrs-core-ac1c8339": {
3
3
  "result": "success",
4
4
  "contextFiles": [
5
+ ".github/skills/001-lint/SKILL.md",
5
6
  ".xdrs/_core/adrs/index.md",
6
7
  ".xdrs/_core/adrs/principles/001-xdrs-core.md",
7
8
  ".xdrs/_core/adrs/principles/002-xdr-standards.md",
8
- ".xdrs/_core/adrs/principles/skills/001-lint/SKILL.md",
9
- ".xdrs/_local/bdrs/index.md",
9
+ ".xdrs/_local/adrs/index.md",
10
10
  ".xdrs/index.md",
11
11
  "AGENTS.md"
12
12
  ],
13
- "contextHash": "98562e9ef1410e8976d719391a098ab3"
13
+ "contextHash": "080ea010bbb924d74c9196e7c3e0f6af"
14
14
  },
15
15
  "Reply ONLY with \"READY\" after checking i-a61b0904": {
16
16
  "result": "success",
@@ -21,6 +21,9 @@ Guides the creation of a well-structured XDR by following the standards in `_cor
21
21
  3. Read `.xdrs/_core/adrs/principles/002-xdr-standards.md` in full to internalize the XDR template and document writing rules.
22
22
  4. Treat `001-xdrs-core` as the canonical source for all core XDR element definitions (type, scope, subject, numbering, placement). Treat `002-xdr-standards` as the canonical source for how to write and structure the document itself.
23
23
  5. Ask the user (or infer from context) the topic of the decision. Do NOT proceed to Phase 2 without a clear topic.
24
+ - Ask one focused clarifying question at a time. Wait for the answer before asking the next question.
25
+ - Each answer may reveal new ambiguities; ask follow-up questions as needed until the topic, intent, and scope are unambiguous.
26
+ - Stop asking and proceed only when the decision topic is fully understood.
24
27
 
25
28
  ### Phase 2: Select Type, Scope, and Subject
26
29
 
@@ -38,6 +41,8 @@ Consult `001-xdrs-core` while making each choice in this phase. The summaries be
38
41
  - BDR: `principles`, `marketing`, `product`, `controls`, `operations`, `organization`, `finance`, `sustainability`
39
42
  - EDR: `principles`, `application`, `infra`, `observability`, `devops`, `governance`
40
43
 
44
+ When type, scope, or subject cannot be confidently inferred, ask the user a clarifying question before proceeding. Ask one question at a time and wait for the answer; follow up if the response introduces new ambiguity.
45
+
41
46
  **XDR ID** — format: `[scope]-[type]-[next available number]`
42
47
  - Scan `.xdrs/[scope]/[type]/` for the highest existing number in that scope+type and increment by 1.
43
48
  - Never reuse numbers from deleted XDRs.
@@ -4,14 +4,17 @@
4
4
  "contextFiles": [
5
5
  ".xdrs/_core/adrs/index.md",
6
6
  ".xdrs/_core/adrs/principles/001-xdrs-core.md",
7
+ ".xdrs/_core/adrs/principles/002-xdr-standards.md",
8
+ ".xdrs/_core/adrs/principles/003-skill-standards.md",
7
9
  ".xdrs/_core/adrs/principles/004-article-standards.md",
10
+ ".xdrs/_core/adrs/principles/006-research-standards.md",
11
+ ".xdrs/_core/adrs/principles/007-plan-standards.md",
8
12
  ".xdrs/_core/adrs/principles/articles/001-xdrs-overview.md",
9
- ".xdrs/_local/bdrs/index.md",
10
- ".xdrs/_local/bdrs/operations/001-agent-behavior-validation-procedure.md",
13
+ ".xdrs/_local/adrs/index.md",
14
+ ".xdrs/_local/adrs/principles/researches/001-research-and-decision-lifecycle.md",
11
15
  ".xdrs/index.md",
12
- "AGENTS.md",
13
- "README.md"
16
+ "AGENTS.md"
14
17
  ],
15
- "contextHash": "75745a424155326ee56008bcf923999e"
18
+ "contextHash": "4935b72a3613a4fad7cc72e477afed7a"
16
19
  }
17
20
  }
@@ -13,12 +13,27 @@ Guides the creation of a well-structured article by following `_core-adr-004`, c
13
13
 
14
14
  ## Instructions
15
15
 
16
+ ### Phase 0: Clarify Intent
17
+
18
+ Before reading any standards, ask the user clarifying questions to gather the information needed to proceed. Use the `vscode_askQuestions` tool with all questions in a single call.
19
+
20
+ Mandatory questions (ask only if not already provided by the user):
21
+ - **Topic**: What is the article about? (skip if the user already stated it)
22
+ - **Audience**: Who is the intended reader? (e.g., new developers, product managers, external contributors) MUST always be asked explicitly; never infer from context.
23
+ - **Scope**: Which XDR scope should contain the article? (default is `_local`; confirm or ask only if context is ambiguous)
24
+
25
+ Optional questions (ask only when genuinely unclear):
26
+ - **Type**: Should the article primarily synthesize ADRs, BDRs, or EDRs? Ask only when the topic spans multiple types.
27
+ - **Existing XDRs**: Are there specific Decision Records or Skills you want the article to reference or synthesize?
28
+
29
+ Do NOT proceed to Phase 1 until you have at minimum a clear **topic** and **audience**.
30
+
16
31
  ### Phase 1: Understand the Article Goal
17
32
 
18
33
  1. Read `.xdrs/_core/adrs/principles/004-article-standards.md` in full to internalize the template,
19
34
  placement rules, numbering rules, and the constraint that articles are views, not decisions.
20
35
  2. Read `.xdrs/_core/adrs/principles/001-xdrs-core.md` in full before defining the article's core elements. Treat it as the canonical source for how to choose and write type, scope, subject, numbering, naming, and folder placement.
21
- 3. Identify the topic and intended audience from user input or context. Do NOT proceed without a clear
36
+ 3. Confirm the topic and intended audience gathered in Phase 0. Do NOT proceed without a clear
22
37
  topic.
23
38
 
24
39
  ### Phase 2: Select Scope, Type, and Subject
@@ -6,29 +6,33 @@ description: >
6
6
  Activate this skill when the user asks to create, add, or write a research document that backs a decision.
7
7
  metadata:
8
8
  author: flaviostutz
9
- version: "1.3"
9
+ version: "1.4"
10
10
  ---
11
11
 
12
12
  ## Overview
13
13
 
14
14
  Guides the creation of a well-structured research document by following `_core-adr-006`, consulting `xdr-standards` for every core element definition, checking related XDRs and existing research to avoid duplication, and producing an IMRAD-based study that reads as a standalone technical paper. Treat each section goal in the research template as an acceptance criterion, not as optional wording. Do not assume missing direction, evidence, or intended follow-up; ask the user explicitly before proceeding when those points are not already concrete.
15
15
 
16
+ This skill is interactive by design. Ask clarifying questions to the user at each phase where direction, evidence, or scope is unclear. Ask sequentially — one focused set of questions at a time — and wait for the user's answers before advancing to the next phase. Never front-load all questions at once if not all are yet relevant.
17
+
16
18
  ## Instructions
17
19
 
18
20
  ### Phase 1: Understand the Research Goal
19
21
 
20
22
  1. Read `.xdrs/_core/adrs/principles/006-research-standards.md` in full to internalize the folder layout, numbering rules, and mandatory template.
21
23
  2. Read `.xdrs/_core/adrs/principles/001-xdrs-core.md` in full before defining the research document's core elements. Treat it as the canonical source for how to choose and write type, scope, subject, numbering expectations, naming constraints, and folder placement.
22
- 3. Ask the user to confirm the intended direction of the research before planning the document: what decision, question, or option space the study should support, what boundaries or exclusions apply, and what kind of outcome they expect.
23
- 4. Ask the user what evidence already exists and what evidence-gathering methods are acceptable if the current evidence is incomplete. Do not invent facts, sources, or confidence that the user did not provide.
24
- 5. Ask the user what the proposed next step is after the research, such as writing a new XDR, updating an existing XDR, informing a discussion, or documenting trade-offs for later. Use that answer to shape the framing without turning the research into the final decision.
24
+ 3. Ask the user to confirm the intended direction of the research before planning the document: what decision, question, or option space the study should support, what boundaries or exclusions apply, and what kind of outcome they expect. Wait for the answers before proceeding.
25
+ 4. Ask the user what evidence already exists and what evidence-gathering methods are acceptable if the current evidence is incomplete. Do not invent facts, sources, or confidence that the user did not provide. Wait for the answers before proceeding.
26
+ 5. Ask the user what the proposed next step is after the research, such as writing a new XDR, updating an existing XDR, informing a discussion, or documenting trade-offs for later. Use that answer to shape the framing without turning the research into the final decision. Wait for the answers before proceeding.
25
27
  6. Identify the problem or question being explored, the relevant system or domain context, the likely technical audience, and why the subject matters in practice.
26
28
  7. Internalize the goal of each required section before drafting: `Abstract` gives a quick technical reader the question, method, main result, and takeaway, `Introduction` frames the investigated problem and context, `Methods` makes the important parts reproducible, `Results` records raw findings with minimal interpretation, `Discussion` interprets the findings, `Conclusion` summarizes the practical takeaway and boundaries, and `References` makes sources traceable.
27
29
  8. Collect the main constraints, known facts, important experiences, gaps, and assumptions that belong in the introduction.
28
- 9. Do NOT proceed without a clear problem statement, a central question, explicit user direction, an understood next step, and at least one credible source of evidence or a method for generating it. If any of these are ambiguous, stop and ask instead of assuming.
30
+ 9. Do NOT proceed without a clear problem statement, a central question, explicit user direction, an understood next step, and at least one credible source of evidence or a method for generating it. If any of these are ambiguous, use `vscode_askQuestions` to ask the user instead of assuming. After receiving answers, evaluate whether any response introduces new ambiguity and, if so, ask a follow-up set of questions before proceeding.
29
31
 
30
32
  ### Phase 2: Select Scope, Type, Subject, and Number
31
33
 
34
+ If the answers from Phase 1 leave scope, type, or subject ambiguous, use `vscode_askQuestions` to present the candidate options with a brief rationale for each and ask the user to confirm the selection before proceeding. If the user's answer raises a related uncertainty, ask a follow-up question to resolve it before locking the selection.
35
+
32
36
  Consult `001-xdrs-core` while making each choice in this phase. The summaries below are orientation only; when any detail matters, the standard decides.
33
37
 
34
38
  **Scope** — use `_local` unless the user explicitly names another scope.
@@ -54,13 +58,15 @@ Consult `001-xdrs-core` while making each choice in this phase. The summaries be
54
58
 
55
59
  1. Create the final section skeleton in the research file before running the study: `Abstract`, `Introduction`, `Methods`, `Results`, `Discussion`, `Conclusion`, `References`.
56
60
  2. Write a one-line note under each section heading capturing that section's goal before filling in the content so the draft stays disciplined.
57
- 3. Draft `## Introduction` early so the problem, scope, constraints, assumptions, and central question are fixed before evidence collection expands.
58
- 4. Draft `## Methods` before or while executing the study so tools, data sources, and conditions are captured while they are still precise.
61
+ 3. Draft `## Introduction` early so the problem, scope, constraints, assumptions, and central question are fixed before evidence collection expands. If the central research question is still unclear after Phase 1, use `vscode_askQuestions` to confirm it in a single focused question before drafting the introduction. If the answer reveals further ambiguity, ask one more targeted follow-up before proceeding.
62
+ 4. Draft `## Methods` before or while executing the study so tools, data sources, and conditions are captured while they are still precise. If the study design is uncertain, use `vscode_askQuestions` to clarify which methods or data sources are applicable before committing to a design. Follow up if the answer leaves the design still unclear.
59
63
  5. Treat `## Abstract` as a late-stage summary. Do not try to finalize it yet.
60
64
  6. Keep process framing out of the body. If related ADRs or repository context matter, push that traceability to `## References` unless it is essential to the technical question itself.
61
65
 
62
66
  ### Phase 5: Capture Evidence as the Study Runs
63
67
 
68
+ If at any point during evidence collection a significant gap appears, an assumption cannot be verified, or a new branch of the question emerges, pause and use `vscode_askQuestions` to ask the user a focused question before continuing. If the answer resolves one gap but reveals another, ask a follow-up question immediately. Do not proceed past a critical gap by guessing.
69
+
64
70
  1. As experiments, comparisons, code spikes, interviews, benchmarks, or document reviews happen, append the concrete findings to `## Results` continuously.
65
71
  2. Prefer capturing tables, bullet points, numbers, code outputs, and option comparisons while the evidence is fresh.
66
72
  3. If multiple options solve the same problem, add a comparison table and explicit pros and cons for each option in `## Results` so the trade-offs are directly inspectable.
@@ -69,6 +75,8 @@ Consult `001-xdrs-core` while making each choice in this phase. The summaries be
69
75
 
70
76
  ### Phase 6: Synthesize After Results Stabilize
71
77
 
78
+ If the results contain competing interpretations or the intended audience for the conclusions is unclear, use `vscode_askQuestions` to ask the user a focused question before writing the discussion. Keep the question specific to a single open point. If the answer raises a further interpretive uncertainty, ask one targeted follow-up before writing.
79
+
72
80
  1. Write `## Discussion` only after the important findings are visible in `## Results`.
73
81
  2. Use `## Discussion` to interpret significance, trade-offs, limitations, implications, and performance considerations for technical readers.
74
82
  3. Write `## Conclusion` after the discussion so it reflects the actual findings, practical takeaway, applicability boundaries, and open questions.
@@ -19,7 +19,13 @@ Guides the creation of a well-structured plan document by following `_core-adr-0
19
19
 
20
20
  1. Read `.xdrs/_core/adrs/principles/007-plan-standards.md` in full to internalize the template, placement rules, numbering rules, and the constraint that plans are ephemeral and must be deleted after implementation.
21
21
  2. Read `.xdrs/_core/adrs/principles/001-xdrs-core.md` in full before defining the plan's core elements. Treat it as the canonical source for how to choose and write type, scope, subject, numbering, naming, and folder placement.
22
- 3. Identify the problem being solved, the proposed solution, and the expected timeline from user input or context. Do NOT proceed without a clear problem statement and proposed solution. Ask the user if these are not clear.
22
+ 3. Identify the problem being solved, the proposed solution, and the expected timeline from user input or context. Do NOT proceed without a clear problem statement and proposed solution.
23
+ 4. Ask the user clarifying questions to fill any gaps before writing the plan. Use the following rules:
24
+ - Ask all initial questions in a single batch so the user can answer them together.
25
+ - After receiving the answers, evaluate whether any answer introduces new ambiguity or opens a related topic that requires further clarification. If it does, ask a focused follow-up question (or a small batch of follow-up questions) before proceeding.
26
+ - Repeat this question-answer loop until you have enough information to write the plan with confidence.
27
+ - Typical questions cover: the problem being solved, the proposed solution, the expected timeline, the scope, the key stakeholders, and any known constraints or risks.
28
+ - Do NOT ask questions whose answers are already clear from context.
23
29
 
24
30
 
25
31
  ### Phase 2: Select Scope, Type, and Subject
package/lib/testPrompt.js CHANGED
@@ -28,7 +28,7 @@ async function runPromptTest(config, inputPrompt, judgePrompt, verbose) {
28
28
  try {
29
29
  if (options.workspaceMode === 'copy') {
30
30
  tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'xdrs-core-test-'));
31
- effectiveWorkspace = copyWorkspace(originalWorkspace, path.join(tempRoot, 'workspace'), options.workspaceFilter, verbose);
31
+ effectiveWorkspace = copyWorkspace(originalWorkspace, path.join(tempRoot, 'workspace'), options.workspaceFilter, options.workspaceExclude, verbose);
32
32
  }
33
33
 
34
34
  if(verbose) {
@@ -113,7 +113,9 @@ function copilotCmd(workspaceRoot = findGitRoot(process.cwd())) {
113
113
  '-p',
114
114
  '{PROMPT}'
115
115
  ],
116
- promptCmdContinueFlag: '--continue'
116
+ promptCmdContinueFlag: '--continue',
117
+ workspaceFilter: ['AGENTS.md', '.xdrs/index.md', '.xdrs/_core/**'],
118
+ workspaceExclude: ['**/*.test.js', '**/*.test.int.js', '**/*.test.int.report']
117
119
  };
118
120
  }
119
121
 
@@ -153,6 +155,7 @@ function normalizeConfig(config) {
153
155
  workspaceRoot: config.workspaceRoot ? path.resolve(config.workspaceRoot) : null,
154
156
  workspaceMode,
155
157
  workspaceFilter: normalizeWorkspaceFilter(config.workspaceFilter),
158
+ workspaceExclude: normalizeWorkspaceFilter(config.workspaceExclude),
156
159
  env: normalizeEnv(config.env),
157
160
  taskTimeoutMs: readTimeout(config.taskTimeoutMs, 'taskTimeoutMs'),
158
161
  judgeTimeoutMs: readTimeout(config.judgeTimeoutMs, 'judgeTimeoutMs'),
@@ -725,7 +728,7 @@ function findGitRoot(startPath) {
725
728
  }
726
729
  }
727
730
 
728
- function copyWorkspace(sourcePath, targetPath, workspaceFilter, verbose) {
731
+ function copyWorkspace(sourcePath, targetPath, workspaceFilter, workspaceExclude, verbose) {
729
732
  if(verbose) {
730
733
  console.log(`Copying workspace from ${sourcePath} to ${targetPath}`);
731
734
  }
@@ -736,12 +739,13 @@ function copyWorkspace(sourcePath, targetPath, workspaceFilter, verbose) {
736
739
  rootPath: sourcePath,
737
740
  ignoreContexts: [],
738
741
  activeRealDirectories: new Set(),
739
- workspaceFilter
742
+ workspaceFilter,
743
+ workspaceExclude
740
744
  });
741
745
  return targetPath;
742
746
  }
743
747
 
744
- function copyWorkspaceDirectory({ sourceDir, targetDir, rootPath, ignoreContexts, activeRealDirectories, workspaceFilter }) {
748
+ function copyWorkspaceDirectory({ sourceDir, targetDir, rootPath, ignoreContexts, activeRealDirectories, workspaceFilter, workspaceExclude }) {
745
749
  const realSourceDir = fs.realpathSync(sourceDir);
746
750
  if (activeRealDirectories.has(realSourceDir)) {
747
751
  return;
@@ -782,7 +786,8 @@ function copyWorkspaceDirectory({ sourceDir, targetDir, rootPath, ignoreContexts
782
786
  rootPath,
783
787
  ignoreContexts: nextIgnoreContexts,
784
788
  activeRealDirectories,
785
- workspaceFilter
789
+ workspaceFilter,
790
+ workspaceExclude
786
791
  });
787
792
  continue;
788
793
  }
@@ -791,6 +796,10 @@ function copyWorkspaceDirectory({ sourceDir, targetDir, rootPath, ignoreContexts
791
796
  continue;
792
797
  }
793
798
 
799
+ if (workspaceExclude && workspaceExclude.some((pattern) => minimatch(entryRelativePath, pattern, { dot: true }))) {
800
+ continue;
801
+ }
802
+
794
803
  fs.copyFileSync(sourceEntryPath, targetEntryPath);
795
804
  fs.chmodSync(targetEntryPath, (entryStats || fs.statSync(sourceEntryPath)).mode);
796
805
  }
@@ -89,6 +89,19 @@ test('workspaceFilter copies only files matching the glob pattern to temp worksp
89
89
  expect(err).toBe('');
90
90
  });
91
91
 
92
+ test('workspaceExclude removes files matching glob patterns from copied workspace', async () => {
93
+ const workspaceRoot = createWorkspace('exclude-pass');
94
+ fs.writeFileSync(path.join(workspaceRoot, 'notes.md'), 'notes content\n', 'utf8');
95
+
96
+ const err = await testPrompt(
97
+ createConfig(workspaceRoot, { workspaceExclude: ['*.md'] }),
98
+ 'workspace-exclude-check: list files in the workspace',
99
+ 'workspace-exclude-check: notes.md should not exist in the copied workspace, seed.txt should exist'
100
+ );
101
+
102
+ expect(err).toBe('');
103
+ });
104
+
92
105
  test('copilotCmd defaults to the git repository root', () => {
93
106
  const result = copilotCmd();
94
107
  const command = result.promptCmd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xdrs-core",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
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",
@@ -44,7 +44,8 @@
44
44
  ],
45
45
  "exclude": [
46
46
  "**/*.test.js",
47
- "**/*.test.int.js"
47
+ "**/*.test.int.js",
48
+ "**/*.test.int.report"
48
49
  ]
49
50
  },
50
51
  "output": {