baldart 5.0.1 → 5.1.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 +80 -0
- package/README.md +3 -3
- package/VERSION +1 -1
- package/framework/.claude/agents/CHANGELOG.md +45 -0
- package/framework/.claude/agents/REGISTRY.md +3 -3
- package/framework/.claude/agents/senior-researcher.md +166 -151
- package/framework/.claude/skills/prd/CHANGELOG.md +16 -0
- package/framework/.claude/skills/prd/SKILL.md +1 -1
- package/framework/.claude/skills/prd/references/discovery-phase.md +5 -1
- package/framework/.claude/skills/prd/references/research-phase.md +32 -12
- package/framework/.claude/skills/research/CHANGELOG.md +9 -0
- package/framework/.claude/skills/research/SKILL.md +94 -0
- package/framework/.claude/skills/research/assets/report-compare.template.md +50 -0
- package/framework/.claude/skills/research/assets/report-decision.template.md +42 -0
- package/framework/.claude/skills/research/assets/report-deep.template.md +61 -0
- package/framework/.claude/skills/research/assets/report-regulatory.template.md +44 -0
- package/framework/.claude/skills/research/references/playbook.md +112 -0
- package/framework/.claude/skills/research/scripts/rebuild-research-index.mjs +77 -0
- package/framework/agents/index.md +2 -0
- package/framework/agents/research-protocol.md +228 -0
- package/framework/agents/skills-mapping.md +17 -0
- package/framework/docs/PROJECT-CONFIGURATION.md +23 -0
- package/framework/templates/baldart.config.template.yml +6 -0
- package/framework/templates/research-index.template.md +13 -0
- package/framework/templates/research-sources.CHANGELOG.md +14 -0
- package/framework/templates/research-sources.template.md +31 -0
- package/package.json +1 -1
- package/src/commands/configure.js +26 -0
- package/src/commands/doctor.js +82 -0
- package/src/commands/update.js +48 -1
- package/src/utils/research-library.js +92 -0
- package/src/utils/symlinks.js +3 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Research library scaffolding (v5.1.0).
|
|
3
|
+
*
|
|
4
|
+
* Creates/seeds the consumer-owned research library at `paths.research_dir`:
|
|
5
|
+
* category subdirectories + two seed files copied from framework-internal
|
|
6
|
+
* templates (INDEX.md — the library map; SOURCES.md — the live source matrix).
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle ownership (deliberate, see research-protocol.md):
|
|
9
|
+
* - `configure` CREATES (right after writing the key) — createDir: true
|
|
10
|
+
* - `doctor` REPAIRS (confirmable actions) — createDir: true
|
|
11
|
+
* - `update` only BACKFILLS seeds into an EXISTING dir — createDir: false
|
|
12
|
+
* (never resurrects a deliberately deleted library)
|
|
13
|
+
*
|
|
14
|
+
* Idempotent and silent on already-existing artifacts (no per-run warnings).
|
|
15
|
+
* Returns the repo-relative paths it created THIS run, so `update` can scope
|
|
16
|
+
* its auto-commit to exactly these artifacts (v4.89.2 lesson) while the rest
|
|
17
|
+
* of the library stays consumer-owned and untouched.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
const path = require('path');
|
|
22
|
+
|
|
23
|
+
const FRAMEWORK_TEMPLATES = path.join('.framework', 'framework', 'templates');
|
|
24
|
+
|
|
25
|
+
const CATEGORY_DIRS = [
|
|
26
|
+
'architecture',
|
|
27
|
+
'integrations',
|
|
28
|
+
'regulatory',
|
|
29
|
+
'ux-patterns',
|
|
30
|
+
'algorithms',
|
|
31
|
+
'tooling',
|
|
32
|
+
'_archive',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const SEEDS = [
|
|
36
|
+
{ template: 'research-index.template.md', dest: 'INDEX.md' },
|
|
37
|
+
{ template: 'research-sources.template.md', dest: 'SOURCES.md' },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} cwd - consumer repo root
|
|
42
|
+
* @param {object|null} config - parsed baldart.config.yml
|
|
43
|
+
* @param {{createDir?: boolean}} [opts]
|
|
44
|
+
* @returns {string[]} repo-relative paths created this run
|
|
45
|
+
*/
|
|
46
|
+
function ensureResearchLibrary(cwd, config, opts = {}) {
|
|
47
|
+
const createDir = opts.createDir !== false;
|
|
48
|
+
const created = [];
|
|
49
|
+
|
|
50
|
+
const key = config && config.paths && config.paths.research_dir;
|
|
51
|
+
if (!key || typeof key !== 'string') return created; // opt-out / unconfigured — no-op
|
|
52
|
+
|
|
53
|
+
const dirAbs = path.join(cwd, key);
|
|
54
|
+
if (!fs.existsSync(dirAbs)) {
|
|
55
|
+
if (!createDir) return created; // update path: never resurrect a deleted library
|
|
56
|
+
fs.mkdirSync(dirAbs, { recursive: true });
|
|
57
|
+
created.push(key);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
for (const sub of CATEGORY_DIRS) {
|
|
61
|
+
const subAbs = path.join(dirAbs, sub);
|
|
62
|
+
if (!fs.existsSync(subAbs)) fs.mkdirSync(subAbs, { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
for (const seed of SEEDS) {
|
|
66
|
+
const destAbs = path.join(dirAbs, seed.dest);
|
|
67
|
+
if (fs.existsSync(destAbs)) continue; // consumer-owned — never overwrite, never warn
|
|
68
|
+
const srcAbs = path.join(cwd, FRAMEWORK_TEMPLATES, seed.template);
|
|
69
|
+
if (!fs.existsSync(srcAbs)) continue; // older framework payload — doctor backfills later
|
|
70
|
+
fs.copyFileSync(srcAbs, destAbs);
|
|
71
|
+
created.push(path.join(key, seed.dest));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return created;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Parse the `matrix_version:` frontmatter value from a source-matrix file.
|
|
79
|
+
* Returns null when the file is missing/unreadable or carries no version —
|
|
80
|
+
* callers treat null as "cannot compare" (never a failure).
|
|
81
|
+
*/
|
|
82
|
+
function readMatrixVersion(fileAbs) {
|
|
83
|
+
try {
|
|
84
|
+
const head = fs.readFileSync(fileAbs, 'utf8').slice(0, 500);
|
|
85
|
+
const m = head.match(/^matrix_version:\s*["']?(\d+\.\d+\.\d+)["']?\s*$/m);
|
|
86
|
+
return m ? m[1] : null;
|
|
87
|
+
} catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
module.exports = { ensureResearchLibrary, readMatrixVersion, CATEGORY_DIRS };
|
package/src/utils/symlinks.js
CHANGED
|
@@ -948,6 +948,9 @@ class SymlinkUtils {
|
|
|
948
948
|
'skill-project-context.snippet.md',
|
|
949
949
|
'component-spec.template.md', // canonical prose-body template — consumed by serialize-spec.mjs, not hand-edited
|
|
950
950
|
'overlays', // example overlays directory — consumers reference, don't copy wholesale
|
|
951
|
+
'research-index.template.md', // research library seed — copied to ${paths.research_dir}/INDEX.md by ensureResearchLibrary
|
|
952
|
+
'research-sources.template.md', // source matrix seed + default-matrix SSOT — copied to ${paths.research_dir}/SOURCES.md
|
|
953
|
+
'research-sources.CHANGELOG.md', // matrix version history — framework metadata, never installed
|
|
951
954
|
]);
|
|
952
955
|
|
|
953
956
|
this.ensureDirectory('templates');
|