@valentia-ai-skills/framework 2.0.6 → 2.0.7
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/README.md +7 -7
- package/bin/cli.js +125 -71
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,9 +70,9 @@ npx ai-skills upload-legacy-scan --path ./my-project-intelligence/
|
|
|
70
70
|
npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --dry-run # validate only
|
|
71
71
|
npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --token <token>
|
|
72
72
|
|
|
73
|
-
# Download a project
|
|
73
|
+
# Download a project → recreates exact intelligence folder structure (modules/, diagrams/, reports)
|
|
74
74
|
npx ai-skills legacy-projects add "My Project"
|
|
75
|
-
npx ai-skills legacy-projects add "My Project" --path
|
|
75
|
+
npx ai-skills legacy-projects add "My Project" --path ~/projects/ # save to a specific directory
|
|
76
76
|
|
|
77
77
|
# List all legacy projects for your team
|
|
78
78
|
npx ai-skills legacy-projects list
|
|
@@ -288,8 +288,8 @@ The framework supports ingesting intelligence packages generated by legacy codeb
|
|
|
288
288
|
1. **Scan** — A compatible scanner tool analyses an existing codebase and produces an intelligence folder
|
|
289
289
|
2. **Upload** — `npx ai-skills upload-legacy-scan --path <folder>` ships the intelligence package to your team's Skills Console, creating or refreshing the project
|
|
290
290
|
3. **Review** — Tech leads review auto-generated skills, reports, and diagrams in the Skills Console, approving or flagging each document
|
|
291
|
-
4. **
|
|
292
|
-
5. **Code** — AI tools (Claude Code, Cursor, Copilot, Windsurf) now
|
|
291
|
+
4. **Download** — Developers run `npx ai-skills legacy-projects add <project-name>` to reconstruct the full intelligence package folder locally — identical structure to the original scan output (`modules/`, `diagrams/`, report `.md` files, `manifest.json`)
|
|
292
|
+
5. **Code** — AI tools (Claude Code, Cursor, Copilot, Windsurf) can now read the local package using the project's legacy-reading skills
|
|
293
293
|
6. **Rescan** — Re-running `upload-legacy-scan` on the same project name replaces all documents with the latest scan output
|
|
294
294
|
|
|
295
295
|
### Intelligence Package Format
|
|
@@ -348,9 +348,9 @@ Approved skills are promoted into the team's standard toolkit and distributed on
|
|
|
348
348
|
# Upload a scan package (add new project or replace existing)
|
|
349
349
|
npx ai-skills upload-legacy-scan --path ./my-project-intelligence/
|
|
350
350
|
|
|
351
|
-
# Download a project
|
|
352
|
-
npx ai-skills legacy-projects add "
|
|
353
|
-
npx ai-skills legacy-projects add "
|
|
351
|
+
# Download a project → recreates the exact intelligence package folder structure locally
|
|
352
|
+
npx ai-skills legacy-projects add "Clinical Sanctuary"
|
|
353
|
+
npx ai-skills legacy-projects add "Clinical Sanctuary" --path ~/projects/ # save to specific dir
|
|
354
354
|
|
|
355
355
|
# List all projects with status, module count, and completeness score
|
|
356
356
|
npx ai-skills legacy-projects list
|
package/bin/cli.js
CHANGED
|
@@ -1665,22 +1665,33 @@ async function cmdLegacyProjects() {
|
|
|
1665
1665
|
console.log(`\n Console: ${c("dim", p.console_url)}\n`);
|
|
1666
1666
|
|
|
1667
1667
|
} else if (subcommand === "add") {
|
|
1668
|
-
// Download a legacy project
|
|
1669
|
-
//
|
|
1668
|
+
// Download a legacy project from the console and reconstruct the complete
|
|
1669
|
+
// intelligence package folder structure — the exact same layout produced
|
|
1670
|
+
// by the scanner so existing legacy-reading skills can work on it.
|
|
1671
|
+
//
|
|
1672
|
+
// Output:
|
|
1673
|
+
// <outputDir>/<project-slug>/
|
|
1674
|
+
// manifest.json
|
|
1675
|
+
// MASTER_SKILL.md (master skill, if present)
|
|
1676
|
+
// modules/<name>/SKILL.md (module skills)
|
|
1677
|
+
// diagrams/<name>.mmd
|
|
1678
|
+
// OVERVIEW.md / API_REGISTRY.md / RISK_REPORT.md … (reports/guides)
|
|
1679
|
+
|
|
1670
1680
|
const projectName = args[0];
|
|
1671
1681
|
if (!projectName) {
|
|
1672
|
-
console.log(c("red", "Usage: npx ai-skills legacy-projects add <project-name> [--path <dir>]"));
|
|
1673
|
-
console.log(c("dim", " Downloads the project
|
|
1682
|
+
console.log(c("red", "Usage: npx ai-skills legacy-projects add <project-name> [--path <output-dir>]"));
|
|
1683
|
+
console.log(c("dim", " Downloads the project intelligence package and recreates the original folder structure.\n"));
|
|
1674
1684
|
process.exit(1);
|
|
1675
1685
|
}
|
|
1676
1686
|
|
|
1677
|
-
//
|
|
1678
|
-
let
|
|
1687
|
+
// --path defaults to current working directory
|
|
1688
|
+
let outputBase = process.cwd();
|
|
1679
1689
|
for (let i = 1; i < args.length; i++) {
|
|
1680
|
-
if (args[i] === "--path" && args[i + 1])
|
|
1690
|
+
if (args[i] === "--path" && args[i + 1]) outputBase = args[++i];
|
|
1681
1691
|
}
|
|
1682
1692
|
|
|
1683
|
-
console.log(c("blue", `\n━━━
|
|
1693
|
+
console.log(c("blue", `\n━━━ Download Legacy Project: ${projectName} ━━━\n`));
|
|
1694
|
+
|
|
1684
1695
|
let result;
|
|
1685
1696
|
try {
|
|
1686
1697
|
result = await fetchJSONWithAuth(MANAGE_LEGACY_PROJECTS_URL, { action: "download", email, project_name: projectName }, null);
|
|
@@ -1693,80 +1704,123 @@ async function cmdLegacyProjects() {
|
|
|
1693
1704
|
const documents = result.documents || [];
|
|
1694
1705
|
|
|
1695
1706
|
if (documents.length === 0) {
|
|
1696
|
-
console.log(c("yellow",
|
|
1707
|
+
console.log(c("yellow", `No documents found for "${projectName}".\n Check the project name with: npx ai-skills legacy-projects list\n`));
|
|
1697
1708
|
return;
|
|
1698
1709
|
}
|
|
1699
1710
|
|
|
1700
|
-
const skillDocs
|
|
1701
|
-
const reportDocs
|
|
1711
|
+
const skillDocs = documents.filter((d) => d.category === "skill");
|
|
1712
|
+
const reportDocs = documents.filter((d) => d.category === "report");
|
|
1713
|
+
const guideDocs = documents.filter((d) => d.category === "guide");
|
|
1702
1714
|
const diagramDocs = documents.filter((d) => d.category === "diagram");
|
|
1703
1715
|
|
|
1704
|
-
console.log(` Project:
|
|
1705
|
-
console.log(` Status:
|
|
1706
|
-
console.log(` Skills:
|
|
1707
|
-
|
|
1708
|
-
// ──
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
// ── Optionally save the full raw package to --path ──
|
|
1734
|
-
if (outputPath) {
|
|
1735
|
-
const resolved = path.resolve(outputPath);
|
|
1736
|
-
mkdirp(resolved);
|
|
1737
|
-
|
|
1738
|
-
if (skillDocs.length > 0) {
|
|
1739
|
-
const modulesDir = path.join(resolved, "modules");
|
|
1740
|
-
mkdirp(modulesDir);
|
|
1741
|
-
for (const doc of skillDocs) {
|
|
1742
|
-
const safeName = doc.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1743
|
-
const docDir = path.join(modulesDir, safeName);
|
|
1744
|
-
mkdirp(docDir);
|
|
1745
|
-
fs.writeFileSync(path.join(docDir, "SKILL.md"), doc.content);
|
|
1746
|
-
}
|
|
1716
|
+
console.log(` Project: ${c("bold", project.name)}`);
|
|
1717
|
+
console.log(` Status: ${project.status} | ${project.completeness_score}% complete`);
|
|
1718
|
+
console.log(` Skills: ${skillDocs.length} Reports: ${reportDocs.length} Guides: ${guideDocs.length} Diagrams: ${diagramDocs.length}\n`);
|
|
1719
|
+
|
|
1720
|
+
// ── Create project root folder ──
|
|
1721
|
+
const projectSlug = project.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1722
|
+
const projectDir = path.resolve(outputBase, `${projectSlug}-intelligence`);
|
|
1723
|
+
mkdirp(projectDir);
|
|
1724
|
+
console.log(` Saving to: ${c("bold", projectDir)}\n`);
|
|
1725
|
+
|
|
1726
|
+
// ── Skill documents ──
|
|
1727
|
+
const masterDoc = skillDocs.find((d) => d.document_type === "master");
|
|
1728
|
+
const moduleDocs = skillDocs.filter((d) => d.document_type !== "master").sort((a, b) => a.priority - b.priority);
|
|
1729
|
+
|
|
1730
|
+
if (masterDoc) {
|
|
1731
|
+
fs.writeFileSync(path.join(projectDir, "MASTER_SKILL.md"), masterDoc.content);
|
|
1732
|
+
console.log(` ${c("green", "✓")} MASTER_SKILL.md`);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
if (moduleDocs.length > 0) {
|
|
1736
|
+
const modulesDir = path.join(projectDir, "modules");
|
|
1737
|
+
mkdirp(modulesDir);
|
|
1738
|
+
for (const doc of moduleDocs) {
|
|
1739
|
+
const safeName = doc.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1740
|
+
const modDir = path.join(modulesDir, safeName);
|
|
1741
|
+
mkdirp(modDir);
|
|
1742
|
+
fs.writeFileSync(path.join(modDir, "SKILL.md"), doc.content);
|
|
1743
|
+
console.log(` ${c("green", "✓")} modules/${safeName}/SKILL.md`);
|
|
1747
1744
|
}
|
|
1745
|
+
}
|
|
1748
1746
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1747
|
+
// ── Report & guide documents — write as DOCUMENT_TYPE.md at root ──
|
|
1748
|
+
const REPORT_FILENAMES = {
|
|
1749
|
+
api_registry: "API_REGISTRY.md",
|
|
1750
|
+
business_rules: "BUSINESS_RULES.md",
|
|
1751
|
+
data_models: "DATA_MODELS.md",
|
|
1752
|
+
dependencies: "DEPENDENCIES.md",
|
|
1753
|
+
env_config: "ENV_CONFIG.md",
|
|
1754
|
+
risk_report: "RISK_REPORT.md",
|
|
1755
|
+
glossary: "GLOSSARY.md",
|
|
1756
|
+
overview: "OVERVIEW.md",
|
|
1757
|
+
reproduction_guide: "REPRODUCTION_GUIDE.md",
|
|
1758
|
+
};
|
|
1753
1759
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1760
|
+
for (const doc of [...reportDocs, ...guideDocs]) {
|
|
1761
|
+
const fileName = REPORT_FILENAMES[doc.document_type] || (doc.document_type.toUpperCase() + ".md");
|
|
1762
|
+
fs.writeFileSync(path.join(projectDir, fileName), doc.content);
|
|
1763
|
+
console.log(` ${c("green", "✓")} ${fileName}`);
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
// ── Diagram documents ──
|
|
1767
|
+
if (diagramDocs.length > 0) {
|
|
1768
|
+
const diagramsDir = path.join(projectDir, "diagrams");
|
|
1769
|
+
mkdirp(diagramsDir);
|
|
1770
|
+
for (const doc of diagramDocs) {
|
|
1771
|
+
const safeName = doc.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1772
|
+
const ext = doc.document_type === "mermaid" ? "mmd" : "mmd";
|
|
1773
|
+
const diagramFile = `${safeName}.${ext}`;
|
|
1774
|
+
fs.writeFileSync(path.join(diagramsDir, diagramFile), doc.content);
|
|
1775
|
+
console.log(` ${c("green", "✓")} diagrams/${diagramFile}`);
|
|
1761
1776
|
}
|
|
1777
|
+
}
|
|
1762
1778
|
|
|
1763
|
-
|
|
1779
|
+
// ── Reconstruct manifest.json ──
|
|
1780
|
+
const manifestSkills = [];
|
|
1781
|
+
if (masterDoc) {
|
|
1782
|
+
manifestSkills.push({ name: masterDoc.name, type: "master", file: "MASTER_SKILL.md" });
|
|
1764
1783
|
}
|
|
1784
|
+
for (const doc of moduleDocs) {
|
|
1785
|
+
const safeName = doc.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1786
|
+
manifestSkills.push({ name: doc.name, type: "module", file: `modules/${safeName}/SKILL.md` });
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
const manifestDiagrams = diagramDocs.map((doc) => {
|
|
1790
|
+
const safeName = doc.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1791
|
+
return { name: doc.name, file: `diagrams/${safeName}.mmd`, type: doc.document_type };
|
|
1792
|
+
});
|
|
1765
1793
|
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1794
|
+
const manifestReports = {};
|
|
1795
|
+
for (const doc of [...reportDocs, ...guideDocs]) {
|
|
1796
|
+
const fileName = REPORT_FILENAMES[doc.document_type] || (doc.document_type.toUpperCase() + ".md");
|
|
1797
|
+
manifestReports[doc.document_type] = fileName;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
const manifest = {
|
|
1801
|
+
project: project.name,
|
|
1802
|
+
scanned_at: project.last_scanned_at || new Date().toISOString(),
|
|
1803
|
+
downloaded_at: new Date().toISOString(),
|
|
1804
|
+
source: "valentia-skills-console",
|
|
1805
|
+
tech_stack: project.tech_stack || {},
|
|
1806
|
+
skills: manifestSkills,
|
|
1807
|
+
diagrams: manifestDiagrams,
|
|
1808
|
+
reports: manifestReports,
|
|
1809
|
+
statistics: {
|
|
1810
|
+
total_modules: moduleDocs.length,
|
|
1811
|
+
total_diagrams: diagramDocs.length,
|
|
1812
|
+
completeness_score: project.completeness_score,
|
|
1813
|
+
},
|
|
1814
|
+
};
|
|
1815
|
+
fs.writeFileSync(path.join(projectDir, "manifest.json"), JSON.stringify(manifest, null, 2) + "\n");
|
|
1816
|
+
console.log(` ${c("green", "✓")} manifest.json`);
|
|
1817
|
+
|
|
1818
|
+
console.log(c("green", `\n✓ "${project.name}" downloaded — ${documents.length} file(s)\n`));
|
|
1819
|
+
console.log(` Folder: ${c("bold", projectDir)}`);
|
|
1820
|
+
if (project.console_url) {
|
|
1821
|
+
console.log(` Console: ${c("dim", project.console_url)}`);
|
|
1769
1822
|
}
|
|
1823
|
+
console.log("");
|
|
1770
1824
|
return;
|
|
1771
1825
|
|
|
1772
1826
|
} else if (subcommand === "remove") {
|
|
@@ -1824,8 +1878,8 @@ Usage:
|
|
|
1824
1878
|
npx ai-skills list List locally bundled skills
|
|
1825
1879
|
npx ai-skills analyze Analyze last commit against active skills
|
|
1826
1880
|
npx ai-skills upload-legacy-scan Upload a legacy codebase intelligence package
|
|
1827
|
-
npx ai-skills legacy-projects add <name> Download project
|
|
1828
|
-
npx ai-skills legacy-projects add <name> --path <dir>
|
|
1881
|
+
npx ai-skills legacy-projects add <name> Download project → recreate intelligence folder locally
|
|
1882
|
+
npx ai-skills legacy-projects add <name> --path <dir> Save to a specific directory (default: cwd)
|
|
1829
1883
|
npx ai-skills legacy-projects list List all legacy projects
|
|
1830
1884
|
npx ai-skills legacy-projects status <name> Show project status and document counts
|
|
1831
1885
|
npx ai-skills legacy-projects remove <name> Delete a project and all its documents
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valentia-ai-skills/framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "AI development skills framework centralized coding standards, security patterns, and SOPs for AI-assisted development. Works with Claude Code, Cursor, Copilot, Windsurf, and any AI coding tool.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-skills",
|