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.
Files changed (154) hide show
  1. package/.nvmrc +1 -0
  2. package/LICENSE +26 -0
  3. package/README.md +213 -0
  4. package/docs/404.md +20 -0
  5. package/docs/agents.md +73 -0
  6. package/docs/architecture.md +301 -0
  7. package/docs/examples.md +144 -0
  8. package/docs/getting-started.md +198 -0
  9. package/docs/index.md +75 -0
  10. package/docs/workflows.md +190 -0
  11. package/package.json +109 -0
  12. package/src/agents/forger.agent.yaml +93 -0
  13. package/src/forger/README.md +17 -0
  14. package/src/forger/forge-tier.yaml +13 -0
  15. package/src/forger/preferences.yaml +10 -0
  16. package/src/knowledge/agentskills-spec.md +158 -0
  17. package/src/knowledge/confidence-tiers.md +153 -0
  18. package/src/knowledge/manual-section-integrity.md +156 -0
  19. package/src/knowledge/overview.md +56 -0
  20. package/src/knowledge/progressive-capability.md +120 -0
  21. package/src/knowledge/provenance-tracking.md +163 -0
  22. package/src/knowledge/skf-knowledge-index.csv +9 -0
  23. package/src/knowledge/skill-lifecycle.md +150 -0
  24. package/src/knowledge/zero-hallucination.md +101 -0
  25. package/src/module-help.csv +12 -0
  26. package/src/module.yaml +22 -0
  27. package/src/workflows/README.md +148 -0
  28. package/src/workflows/analyze-source/data/skill-brief-schema.md +75 -0
  29. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +88 -0
  30. package/src/workflows/analyze-source/steps-c/step-01-init.md +191 -0
  31. package/src/workflows/analyze-source/steps-c/step-01b-continue.md +144 -0
  32. package/src/workflows/analyze-source/steps-c/step-02-scan-project.md +208 -0
  33. package/src/workflows/analyze-source/steps-c/step-03-identify-units.md +199 -0
  34. package/src/workflows/analyze-source/steps-c/step-04-map-and-detect.md +222 -0
  35. package/src/workflows/analyze-source/steps-c/step-05-recommend.md +236 -0
  36. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +239 -0
  37. package/src/workflows/analyze-source/templates/analysis-report-template.md +41 -0
  38. package/src/workflows/analyze-source/validation-report.md +657 -0
  39. package/src/workflows/analyze-source/workflow-plan-analyze-source.md +385 -0
  40. package/src/workflows/analyze-source/workflow.md +61 -0
  41. package/src/workflows/audit-skill/data/drift-report-template.md +62 -0
  42. package/src/workflows/audit-skill/data/severity-rules.md +52 -0
  43. package/src/workflows/audit-skill/steps-c/step-01-init.md +195 -0
  44. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +191 -0
  45. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +194 -0
  46. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +199 -0
  47. package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +210 -0
  48. package/src/workflows/audit-skill/steps-c/step-06-report.md +217 -0
  49. package/src/workflows/audit-skill/validation-report.md +545 -0
  50. package/src/workflows/audit-skill/workflow-plan-audit-skill.md +318 -0
  51. package/src/workflows/audit-skill/workflow.md +63 -0
  52. package/src/workflows/brief-skill/data/skill-brief-schema.md +82 -0
  53. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +184 -0
  54. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +203 -0
  55. package/src/workflows/brief-skill/steps-c/step-03-scope-definition.md +225 -0
  56. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +185 -0
  57. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +156 -0
  58. package/src/workflows/brief-skill/validation-report.md +630 -0
  59. package/src/workflows/brief-skill/workflow-plan-brief-skill.md +360 -0
  60. package/src/workflows/brief-skill/workflow.md +57 -0
  61. package/src/workflows/create-skill/data/extraction-patterns.md +63 -0
  62. package/src/workflows/create-skill/data/skill-sections.md +166 -0
  63. package/src/workflows/create-skill/steps-c/step-01-load-brief.md +176 -0
  64. package/src/workflows/create-skill/steps-c/step-02-ecosystem-check.md +143 -0
  65. package/src/workflows/create-skill/steps-c/step-03-extract.md +184 -0
  66. package/src/workflows/create-skill/steps-c/step-04-enrich.md +152 -0
  67. package/src/workflows/create-skill/steps-c/step-05-compile.md +198 -0
  68. package/src/workflows/create-skill/steps-c/step-06-validate.md +162 -0
  69. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +165 -0
  70. package/src/workflows/create-skill/steps-c/step-08-report.md +160 -0
  71. package/src/workflows/create-skill/validation-report.md +189 -0
  72. package/src/workflows/create-skill/workflow-plan-create-skill.md +491 -0
  73. package/src/workflows/create-skill/workflow.md +52 -0
  74. package/src/workflows/create-stack-skill/data/integration-patterns.md +61 -0
  75. package/src/workflows/create-stack-skill/data/manifest-patterns.md +35 -0
  76. package/src/workflows/create-stack-skill/data/stack-skill-template.md +110 -0
  77. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +142 -0
  78. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +145 -0
  79. package/src/workflows/create-stack-skill/steps-c/step-03-rank-and-confirm.md +161 -0
  80. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +155 -0
  81. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +154 -0
  82. package/src/workflows/create-stack-skill/steps-c/step-06-compile-stack.md +160 -0
  83. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +202 -0
  84. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +193 -0
  85. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +137 -0
  86. package/src/workflows/create-stack-skill/validation-report.md +401 -0
  87. package/src/workflows/create-stack-skill/workflow-plan-create-stack-skill.md +481 -0
  88. package/src/workflows/create-stack-skill/workflow.md +59 -0
  89. package/src/workflows/export-skill/data/managed-section-format.md +70 -0
  90. package/src/workflows/export-skill/data/snippet-format.md +32 -0
  91. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +184 -0
  92. package/src/workflows/export-skill/steps-c/step-02-package.md +153 -0
  93. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +166 -0
  94. package/src/workflows/export-skill/steps-c/step-04-update-context.md +222 -0
  95. package/src/workflows/export-skill/steps-c/step-05-token-report.md +126 -0
  96. package/src/workflows/export-skill/steps-c/step-06-summary.md +167 -0
  97. package/src/workflows/export-skill/validation-report.md +263 -0
  98. package/src/workflows/export-skill/workflow-plan-export-skill.md +369 -0
  99. package/src/workflows/export-skill/workflow.md +56 -0
  100. package/src/workflows/quick-skill/data/registry-resolution.md +91 -0
  101. package/src/workflows/quick-skill/data/skill-template.md +66 -0
  102. package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +165 -0
  103. package/src/workflows/quick-skill/steps-c/step-02-ecosystem-check.md +143 -0
  104. package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +177 -0
  105. package/src/workflows/quick-skill/steps-c/step-04-compile.md +180 -0
  106. package/src/workflows/quick-skill/steps-c/step-05-validate.md +150 -0
  107. package/src/workflows/quick-skill/steps-c/step-06-write.md +160 -0
  108. package/src/workflows/quick-skill/validation-report.md +543 -0
  109. package/src/workflows/quick-skill/workflow-plan-quick-skill.md +405 -0
  110. package/src/workflows/quick-skill/workflow.md +56 -0
  111. package/src/workflows/setup-forge/data/tier-rules.md +50 -0
  112. package/src/workflows/setup-forge/steps-c/step-01-detect-and-tier.md +140 -0
  113. package/src/workflows/setup-forge/steps-c/step-02-write-config.md +141 -0
  114. package/src/workflows/setup-forge/steps-c/step-03-auto-index.md +116 -0
  115. package/src/workflows/setup-forge/steps-c/step-04-report.md +131 -0
  116. package/src/workflows/setup-forge/validation-report.md +504 -0
  117. package/src/workflows/setup-forge/workflow-plan-setup-forge.md +428 -0
  118. package/src/workflows/setup-forge/workflow.md +49 -0
  119. package/src/workflows/test-skill/data/output-section-formats.md +96 -0
  120. package/src/workflows/test-skill/data/scoring-rules.md +74 -0
  121. package/src/workflows/test-skill/steps-c/step-01-init.md +185 -0
  122. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +162 -0
  123. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +222 -0
  124. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +249 -0
  125. package/src/workflows/test-skill/steps-c/step-05-score.md +222 -0
  126. package/src/workflows/test-skill/steps-c/step-06-report.md +175 -0
  127. package/src/workflows/test-skill/templates/test-report-template.md +24 -0
  128. package/src/workflows/test-skill/validation-report.md +390 -0
  129. package/src/workflows/test-skill/workflow-plan-test-skill.md +288 -0
  130. package/src/workflows/test-skill/workflow.md +57 -0
  131. package/src/workflows/update-skill/data/manual-section-rules.md +44 -0
  132. package/src/workflows/update-skill/data/merge-conflict-rules.md +62 -0
  133. package/src/workflows/update-skill/steps-c/step-01-init.md +208 -0
  134. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +184 -0
  135. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +187 -0
  136. package/src/workflows/update-skill/steps-c/step-04-merge.md +230 -0
  137. package/src/workflows/update-skill/steps-c/step-05-validate.md +187 -0
  138. package/src/workflows/update-skill/steps-c/step-06-write.md +204 -0
  139. package/src/workflows/update-skill/steps-c/step-07-report.md +201 -0
  140. package/src/workflows/update-skill/validation-report.md +559 -0
  141. package/src/workflows/update-skill/workflow-plan-update-skill.md +441 -0
  142. package/src/workflows/update-skill/workflow.md +56 -0
  143. package/tools/cli/commands/install.js +33 -0
  144. package/tools/cli/commands/status.js +195 -0
  145. package/tools/cli/commands/uninstall.js +226 -0
  146. package/tools/cli/commands/update.js +63 -0
  147. package/tools/cli/lib/compiler.js +306 -0
  148. package/tools/cli/lib/ide-commands.js +244 -0
  149. package/tools/cli/lib/installer.js +307 -0
  150. package/tools/cli/lib/manifest.js +109 -0
  151. package/tools/cli/lib/ui.js +277 -0
  152. package/tools/cli/lib/version-check.js +86 -0
  153. package/tools/cli/skf-cli.js +45 -0
  154. 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
+ }