bmad-module-skill-forge 0.2.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/.nvmrc +1 -0
- package/LICENSE +26 -0
- package/README.md +213 -0
- package/docs/404.md +20 -0
- package/docs/agents.md +73 -0
- package/docs/architecture.md +301 -0
- package/docs/examples.md +144 -0
- package/docs/getting-started.md +198 -0
- package/docs/index.md +75 -0
- package/docs/workflows.md +190 -0
- package/package.json +109 -0
- package/src/agents/forger.agent.yaml +93 -0
- package/src/forger/README.md +17 -0
- package/src/forger/forge-tier.yaml +13 -0
- package/src/forger/preferences.yaml +10 -0
- package/src/knowledge/agentskills-spec.md +158 -0
- package/src/knowledge/confidence-tiers.md +153 -0
- package/src/knowledge/manual-section-integrity.md +156 -0
- package/src/knowledge/overview.md +56 -0
- package/src/knowledge/progressive-capability.md +120 -0
- package/src/knowledge/provenance-tracking.md +163 -0
- package/src/knowledge/skf-knowledge-index.csv +9 -0
- package/src/knowledge/skill-lifecycle.md +150 -0
- package/src/knowledge/zero-hallucination.md +101 -0
- package/src/module-help.csv +12 -0
- package/src/module.yaml +22 -0
- package/src/workflows/README.md +148 -0
- package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
- package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
- package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
- package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
- package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
- package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
- package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
- package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
- package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
- package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
- package/src/workflows/analyze-source/validation-report.md +657 -0
- package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
- package/src/workflows/analyze-source/workflow.md +61 -0
- package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
- package/src/workflows/audit-skill/data/severity-rules.md +52 -0
- package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
- package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
- package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
- package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
- package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
- package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
- package/src/workflows/audit-skill/validation-report.md +545 -0
- package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
- package/src/workflows/audit-skill/workflow.md +63 -0
- package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
- package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
- package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
- package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
- package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
- package/src/workflows/brief-skill/validation-report.md +630 -0
- package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
- package/src/workflows/brief-skill/workflow.md +57 -0
- package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
- package/src/workflows/create-skill/data/skill-sections.md +166 -0
- package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
- package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
- package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
- package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
- package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
- package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
- package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
- package/src/workflows/create-skill/validation-report.md +189 -0
- package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
- package/src/workflows/create-skill/workflow.md +52 -0
- package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
- package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
- package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
- package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
- package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
- package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
- package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
- package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
- package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
- package/src/workflows/create-stack-skill/validation-report.md +401 -0
- package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
- package/src/workflows/create-stack-skill/workflow.md +59 -0
- package/src/workflows/export-skill/data/managed-section-format.md +70 -0
- package/src/workflows/export-skill/data/snippet-format.md +32 -0
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
- package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
- package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
- package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
- package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
- package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
- package/src/workflows/export-skill/validation-report.md +263 -0
- package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
- package/src/workflows/export-skill/workflow.md +56 -0
- package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
- package/src/workflows/quick-skill/data/skill-template.md +66 -0
- package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
- package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
- package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
- package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
- package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
- package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
- package/src/workflows/quick-skill/validation-report.md +543 -0
- package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
- package/src/workflows/quick-skill/workflow.md +56 -0
- package/src/workflows/setup-forge/data/tier-rules.md +50 -0
- package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
- package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
- package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
- package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
- package/src/workflows/setup-forge/validation-report.md +504 -0
- package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
- package/src/workflows/setup-forge/workflow.md +49 -0
- package/src/workflows/test-skill/data/output-section-formats.md +96 -0
- package/src/workflows/test-skill/data/scoring-rules.md +74 -0
- package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
- package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
- package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
- package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
- package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
- package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
- package/src/workflows/test-skill/templates/test-report-template.md +24 -0
- package/src/workflows/test-skill/validation-report.md +390 -0
- package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
- package/src/workflows/test-skill/workflow.md +57 -0
- package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
- package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
- package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
- package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
- package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
- package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
- package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
- package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
- package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
- package/src/workflows/update-skill/validation-report.md +559 -0
- package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
- package/src/workflows/update-skill/workflow.md +56 -0
- package/tools/cli/commands/install.js +33 -0
- package/tools/cli/commands/status.js +195 -0
- package/tools/cli/commands/uninstall.js +226 -0
- package/tools/cli/commands/update.js +63 -0
- package/tools/cli/lib/compiler.js +306 -0
- package/tools/cli/lib/ide-commands.js +244 -0
- package/tools/cli/lib/installer.js +307 -0
- package/tools/cli/lib/manifest.js +109 -0
- package/tools/cli/lib/ui.js +277 -0
- package/tools/cli/lib/version-check.js +86 -0
- package/tools/cli/skf-cli.js +45 -0
- package/tools/skf-npx-wrapper.js +36 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SKF Version Check
|
|
3
|
+
* Async, non-blocking check against the npm registry.
|
|
4
|
+
* Returns a promise that resolves to an update notice string (or null).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const https = require('node:https');
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
|
|
10
|
+
const PACKAGE_NAME = 'bmad-module-skill-forge';
|
|
11
|
+
const REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
12
|
+
const TIMEOUT_MS = 3000;
|
|
13
|
+
|
|
14
|
+
function fetchLatestVersion() {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
const req = https.get(REGISTRY_URL, { timeout: TIMEOUT_MS }, (res) => {
|
|
17
|
+
if (res.statusCode !== 200) {
|
|
18
|
+
resolve(null);
|
|
19
|
+
res.resume();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let data = '';
|
|
24
|
+
res.on('data', (chunk) => {
|
|
25
|
+
data += chunk;
|
|
26
|
+
});
|
|
27
|
+
res.on('end', () => {
|
|
28
|
+
try {
|
|
29
|
+
const json = JSON.parse(data);
|
|
30
|
+
resolve(json.version || null);
|
|
31
|
+
} catch {
|
|
32
|
+
resolve(null);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
req.on('error', () => resolve(null));
|
|
38
|
+
req.on('timeout', () => {
|
|
39
|
+
req.destroy();
|
|
40
|
+
resolve(null);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function compareVersions(current, latest) {
|
|
46
|
+
const parse = (v) => v.replace(/^v/, '').split('.').map(Number);
|
|
47
|
+
const [cMajor, cMinor, cPatch] = parse(current);
|
|
48
|
+
const [lMajor, lMinor, lPatch] = parse(latest);
|
|
49
|
+
|
|
50
|
+
if (lMajor > cMajor) return true;
|
|
51
|
+
if (lMajor === cMajor && lMinor > cMinor) return true;
|
|
52
|
+
if (lMajor === cMajor && lMinor === cMinor && lPatch > cPatch) return true;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Start an async version check. Call the returned function after your
|
|
58
|
+
* command finishes to print the update notice (if any).
|
|
59
|
+
*/
|
|
60
|
+
function startVersionCheck(currentVersion) {
|
|
61
|
+
const checkPromise = fetchLatestVersion().then((latestVersion) => {
|
|
62
|
+
if (!latestVersion || !compareVersions(currentVersion, latestVersion)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (
|
|
66
|
+
'\n' +
|
|
67
|
+
chalk.yellow(` Update available: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)}`) +
|
|
68
|
+
'\n' +
|
|
69
|
+
chalk.dim(` Run: npx skill-forge@latest install`) +
|
|
70
|
+
'\n'
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return async function printIfReady() {
|
|
75
|
+
try {
|
|
76
|
+
const notice = await checkPromise;
|
|
77
|
+
if (notice) {
|
|
78
|
+
process.stderr.write(notice);
|
|
79
|
+
}
|
|
80
|
+
} catch {
|
|
81
|
+
// Never block or fail the CLI for a version check
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = { startVersionCheck, compareVersions };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const { program } = require('commander');
|
|
2
|
+
const installCommand = require('./commands/install');
|
|
3
|
+
const statusCommand = require('./commands/status');
|
|
4
|
+
const uninstallCommand = require('./commands/uninstall');
|
|
5
|
+
const updateCommand = require('./commands/update');
|
|
6
|
+
const { startVersionCheck } = require('./lib/version-check');
|
|
7
|
+
|
|
8
|
+
// Fix for stdin issues when running through npm on Windows
|
|
9
|
+
if (process.stdin.isTTY) {
|
|
10
|
+
try {
|
|
11
|
+
process.stdin.resume();
|
|
12
|
+
process.stdin.setEncoding('utf8');
|
|
13
|
+
if (process.platform === 'win32') {
|
|
14
|
+
process.stdin.on('error', () => {});
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
// Silently ignore - some environments may not support these operations
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const packageJson = require('../../package.json');
|
|
22
|
+
|
|
23
|
+
// Start async version check (non-blocking)
|
|
24
|
+
const printUpdateNotice = startVersionCheck(packageJson.version);
|
|
25
|
+
|
|
26
|
+
program.version(packageJson.version).description('Skill Forge — Evidence-Based Agent Skills Compiler');
|
|
27
|
+
|
|
28
|
+
for (const command of [installCommand, updateCommand, statusCommand, uninstallCommand]) {
|
|
29
|
+
const cmd = program.command(command.command).description(command.description);
|
|
30
|
+
for (const option of command.options || []) {
|
|
31
|
+
cmd.option(...option);
|
|
32
|
+
}
|
|
33
|
+
// Wrap action to print update notice after command completes
|
|
34
|
+
const originalAction = command.action;
|
|
35
|
+
cmd.action(async (...args) => {
|
|
36
|
+
await originalAction(...args);
|
|
37
|
+
await printUpdateNotice();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
program.parse(process.argv);
|
|
42
|
+
|
|
43
|
+
if (process.argv.slice(2).length === 0) {
|
|
44
|
+
program.outputHelp();
|
|
45
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SKF CLI - Direct execution wrapper for npx
|
|
5
|
+
* Ensures proper execution when run via npx from npm registry.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('node:child_process');
|
|
9
|
+
const path = require('node:path');
|
|
10
|
+
const fs = require('node:fs');
|
|
11
|
+
|
|
12
|
+
// Check if we're running in an npx temporary directory
|
|
13
|
+
const isNpxExecution = __dirname.includes('_npx') || __dirname.includes('.npm');
|
|
14
|
+
|
|
15
|
+
if (isNpxExecution) {
|
|
16
|
+
// Running via npx - spawn child process to preserve user's working directory
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
const cliPath = path.join(__dirname, 'cli', 'skf-cli.js');
|
|
19
|
+
|
|
20
|
+
if (!fs.existsSync(cliPath)) {
|
|
21
|
+
console.error('Error: Could not find skf-cli.js at', cliPath);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
execSync(`node "${cliPath}" ${args.join(' ')}`, {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
cwd: process.cwd(),
|
|
29
|
+
});
|
|
30
|
+
} catch (error) {
|
|
31
|
+
process.exit(error.status || 1);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
// Local execution - use require
|
|
35
|
+
require('./cli/skf-cli.js');
|
|
36
|
+
}
|