@keber/qa-framework 1.6.2 → 1.7.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/CHANGELOG.md CHANGED
@@ -33,6 +33,31 @@ has been removed or parameterized. See `docs/comparison-matrix.md` and `docs/gen
33
33
 
34
34
  ---
35
35
 
36
+ ## [1.7.0] - 2026-05-06
37
+
38
+ ### Changed
39
+
40
+ - **Agent instructions moved to `.github/instructions/qa-framework.instructions.md`** — the
41
+ framework no longer writes to `.github/copilot-instructions.md`. The new file is a VS Code
42
+ `*.instructions.md` file with `applyTo: '**'` frontmatter, which Copilot loads automatically.
43
+ This eliminates the conflict between framework-owned rules and project-owned custom instructions:
44
+ both files coexist independently and the framework file is freely upgradeable.
45
+
46
+ ### Added
47
+
48
+ - **`upgrade` step 2b — automatic migration of old `copilot-instructions.md`**:
49
+ - If the file contains only QA Framework content (any previous version) → the file is deleted.
50
+ - If the file contains custom instructions and a QA Framework section → the QA section is stripped and the custom content is preserved.
51
+ - If the file contains no QA Framework content → the file is left untouched.
52
+ The detection marker is the heading `# QA Framework Instructions`, consistent across all versions.
53
+
54
+ ### Migration
55
+
56
+ Run `npx qa-framework upgrade`. No manual steps required.
57
+ See `MIGRATION-NOTES.md` — section "Upgrading from a version that used `.github/copilot-instructions.md`".
58
+
59
+ ---
60
+
36
61
  ## [1.6.2] - 2026-05-05
37
62
 
38
63
  ### Added
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # qa-framework
2
2
 
3
3
  > Reusable, installable, agent-oriented QA framework for spec-driven automated testing.
4
- > Current version: **v1.6.2**
4
+ > Current version: **v1.7.0**
5
5
 
6
6
  ---
7
7
 
@@ -61,7 +61,7 @@ npm install @keber/qa-framework
61
61
  1. Create the `qa/` directory tree in your project root
62
62
  2. Copy all base templates into place
63
63
  3. Create `qa/qa-framework.config.json` for project-specific settings
64
- 4. Generate `.github/copilot-instructions.md` with QA agent behavior rules (11 rules + ADO detection)
64
+ 4. Generate `.github/instructions/qa-framework.instructions.md` with QA agent behavior rules (11 rules + ADO detection)
65
65
  5. Copy the `skills/` set to `.github/skills/` so the agent can load them on demand
66
66
  6. Create `qa/AGENT-NEXT-STEPS.md` with follow-up steps
67
67
 
@@ -73,9 +73,13 @@ After `npm update @keber/qa-framework`, run:
73
73
  npx qa-framework upgrade
74
74
  ```
75
75
 
76
- This overwrites **only** framework-owned files (skills, `copilot-instructions.md`,
76
+ This overwrites **only** framework-owned files (skills, `qa-framework.instructions.md`,
77
77
  `QA-STRUCTURE-GUIDE.md`) and never touches your specs, test plans, automation code, or memory.
78
78
 
79
+ If upgrading from a version that wrote to `.github/copilot-instructions.md`, `upgrade`
80
+ automatically removes the QA section from that file (or deletes it if it contained only
81
+ framework content), and creates `.github/instructions/qa-framework.instructions.md` instead.
82
+
79
83
  ---
80
84
 
81
85
  ## Repository Structure (this package)
@@ -148,7 +152,7 @@ qa-framework/
148
152
  │
149
153
  └── scripts/ <- CLI commands
150
154
  ├── cli.js <- Entry point (qa-framework <command>)
151
- ├── init.js <- Scaffold qa/ tree + skills + copilot-instructions
155
+ ├── init.js <- Scaffold qa/ tree + skills + qa-framework.instructions.md
152
156
  ├── upgrade.js <- Refresh framework-owned files after npm update
153
157
  ├── generate.js <- Generate individual artifact from template
154
158
  └── validate.js <- Check structure compliance
@@ -194,10 +198,15 @@ Additionally, `init` writes to the project root:
194
198
 
195
199
  ```
196
200
  .github/
197
- ├── copilot-instructions.md <- Generated agent rules (11 rules + ADO detection)
198
- └── skills/ <- Copied from package skills/ (one folder per pipeline stage)
201
+ ├── instructions/
202
+ │ └── qa-framework.instructions.md <- QA agent rules (framework-owned, applyTo: '**')
203
+ └── skills/ <- Copied from package skills/ (one folder per pipeline stage)
199
204
  ```
200
205
 
206
+ > `qa-framework.instructions.md` is a VS Code `*.instructions.md` file, separate from any
207
+ > custom `.github/copilot-instructions.md` the project may already have. The two files
208
+ > coexist without conflict and are independently upgradeable.
209
+
201
210
  See [docs/folder-structure-guide.md](docs/folder-structure-guide.md) for a full explanation of every folder.
202
211
 
203
212
  ---
@@ -218,7 +227,7 @@ them via `read_file` without touching `node_modules`.
218
227
 
219
228
  ### QA Pipeline
220
229
 
221
- Skills map to the pipeline stages enforced by `.github/copilot-instructions.md`:
230
+ Skills map to the pipeline stages enforced by `.github/instructions/qa-framework.instructions.md`:
222
231
 
223
232
  | Stage | Skill | Task | Track | Prerequisite |
224
233
  |---|---|---|---|---|
@@ -254,7 +263,7 @@ Options:
254
263
  --version, -v Show version
255
264
  ```
256
265
 
257
- **upgrade** overwrites only framework-owned files (skills, `copilot-instructions.md`,
266
+ **upgrade** overwrites only framework-owned files (skills, `qa-framework.instructions.md`,
258
267
  `QA-STRUCTURE-GUIDE.md`) and never touches project-owned files. Run `--dry-run` to preview
259
268
  without writing.
260
269
 
@@ -51,7 +51,7 @@ qa/
51
51
  └── 08-azure-integration/README.md
52
52
  └── memory/INDEX.md
53
53
 
54
- .github/copilot-instructions.md <- Generated agent rules
54
+ .github/instructions/qa-framework.instructions.md <- QA agent rules (framework-owned)
55
55
  .github/skills/ <- 8 agent skill sets (SKILL.md + references/)
56
56
  ```
57
57
 
@@ -93,7 +93,7 @@ After `npm update @keber/qa-framework`:
93
93
  npx qa-framework upgrade
94
94
  ```
95
95
 
96
- This overwrites only framework-owned files (`.github/skills/`, `copilot-instructions.md`,
96
+ This overwrites only framework-owned files (`.github/skills/`, `.github/instructions/qa-framework.instructions.md`,
97
97
  `QA-STRUCTURE-GUIDE.md`) and migrates the `07-automation/` structure if upgrading from
98
98
  v1.5.x. Your specs, tests, and memory are never touched.
99
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keber/qa-framework",
3
- "version": "1.6.2",
3
+ "version": "1.7.0",
4
4
  "description": "Reusable spec-driven QA framework for IDE-agent-assisted automated testing. Installable as an npm package. Provides structure, templates, agent instructions, and optional integrations for Playwright and Azure DevOps.",
5
5
  "keywords": [
6
6
  "qa",
package/scripts/init.js CHANGED
@@ -253,9 +253,9 @@ if (fs.existsSync(structureGuideSrc)) {
253
253
  writeIfMissing(structureGuideDest, fs.readFileSync(structureGuideSrc, 'utf8'));
254
254
  }
255
255
 
256
- // --- .github/copilot-instructions.md ---
256
+ // --- .github/instructions/qa-framework.instructions.md ---
257
257
  const githubDir = path.join(cwd, '.github');
258
- const copilotInstrPath = path.join(githubDir, 'copilot-instructions.md');
258
+ const copilotInstrPath = path.join(githubDir, 'instructions', 'qa-framework.instructions.md');
259
259
 
260
260
  // Detect whether the ado-qa skill is available (installed or already copied)
261
261
  const adoQaInstalled = fs.existsSync(path.join(cwd, 'node_modules', '@keber', 'ado-qa'))
@@ -284,7 +284,10 @@ Refer to \`qa/00-guides/AGENT-INSTRUCTIONS-ADO-INTEGRATION.md\` for the full ADO
284
284
  > This will automatically copy the ADO skills to \`.github/skills/\` via postinstall.
285
285
  `;
286
286
 
287
- const copilotInstrContent = `# QA Framework Instructions
287
+ const copilotInstrContent = `---
288
+ applyTo: '**'
289
+ ---
290
+ # QA Framework Instructions
288
291
 
289
292
  This project uses \`@keber/qa-framework\` v${config.frameworkVersion ?? '1.0.0'} for spec-driven automated testing.
290
293
 
@@ -337,7 +340,7 @@ const nextStepsContent = `# ✅ @keber/qa-framework installed successfully
337
340
  ## What was scaffolded
338
341
 
339
342
  - \`qa/\` folder structure with spec templates and agent instructions
340
- - \`.github/copilot-instructions.md\` with QA agent behavior rules
343
+ - \`.github/instructions/qa-framework.instructions.md\` with QA agent behavior rules (framework-owned, safe to upgrade)
341
344
 
342
345
  ## Required next steps
343
346
 
@@ -81,12 +81,48 @@ if (!fs.existsSync(skillsSrc)) {
81
81
  }
82
82
 
83
83
  // ---------------------------------------------------------------------------
84
- // 2. .github/copilot-instructions.md — overwrite (framework-owned sequencer)
84
+ // 2. .github/instructions/qa-framework.instructions.md — overwrite (framework-owned)
85
85
  // ---------------------------------------------------------------------------
86
- const copilotInstrPath = path.join(githubDir, 'copilot-instructions.md');
86
+ const copilotInstrPath = path.join(githubDir, 'instructions', 'qa-framework.instructions.md');
87
87
  const copilotContent = buildCopilotInstructions(config);
88
88
  forceWrite(copilotInstrPath, copilotContent);
89
89
 
90
+ // ---------------------------------------------------------------------------
91
+ // 2b. Migration: strip QA Framework section from old copilot-instructions.md
92
+ //
93
+ // Handles all cases:
94
+ // A. File has custom instructions + QA section → keep custom, strip QA section
95
+ // B. File has ONLY QA section (any version) → delete the file
96
+ // C. File does not mention QA Framework → leave untouched
97
+ //
98
+ // The QA section always starts with "# QA Framework Instructions" across all
99
+ // previous versions, so that heading is the reliable split point.
100
+ // ---------------------------------------------------------------------------
101
+ const oldCopilotPath = path.join(githubDir, 'copilot-instructions.md');
102
+ if (fs.existsSync(oldCopilotPath)) {
103
+ const oldContent = fs.readFileSync(oldCopilotPath, 'utf8');
104
+ const qaMarker = '# QA Framework Instructions';
105
+ const qaIdx = oldContent.indexOf(qaMarker);
106
+
107
+ if (qaIdx !== -1) {
108
+ // Extract anything before the QA section, removing any trailing separator
109
+ const before = oldContent.slice(0, qaIdx).replace(/\s*\n---\s*$/, '').trim();
110
+
111
+ if (before.length === 0) {
112
+ // Case B: file contained only QA Framework content → delete it
113
+ if (!dryRun) fs.unlinkSync(oldCopilotPath);
114
+ updated.push(oldCopilotPath);
115
+ console.log(` [deleted] .github/copilot-instructions.md (contained only QA Framework rules — now in .github/instructions/qa-framework.instructions.md)`);
116
+ } else {
117
+ // Case A: file had custom content too → write back only the custom part
118
+ if (!dryRun) fs.writeFileSync(oldCopilotPath, before + '\n', 'utf8');
119
+ updated.push(oldCopilotPath);
120
+ console.log(` [cleaned] .github/copilot-instructions.md — removed QA Framework section, kept custom instructions`);
121
+ }
122
+ }
123
+ // Case C: no QA marker found → leave untouched (no log noise)
124
+ }
125
+
90
126
  // ---------------------------------------------------------------------------
91
127
  // 3. qa/QA-STRUCTURE-GUIDE.md — overwrite (framework doc)
92
128
  // ---------------------------------------------------------------------------
@@ -278,7 +314,10 @@ function copyDirForce(srcDir, destDir) {
278
314
 
279
315
  function buildCopilotInstructions(cfg) {
280
316
  const version = cfg.frameworkVersion ?? '1.0.0';
281
- return `# QA Framework Instructions
317
+ return `---
318
+ applyTo: '**'
319
+ ---
320
+ # QA Framework Instructions
282
321
 
283
322
  This project uses \`@keber/qa-framework\` v${version} for spec-driven automated testing.
284
323