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
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "bmad-module-skill-forge",
4
+ "version": "0.2.0",
5
+ "description": "BMAD module — AST-verified, provenance-backed agent skills compiler with progressive capability tiers (Quick/Forge/Deep)",
6
+ "keywords": [
7
+ "bmad",
8
+ "agent-skills",
9
+ "agentskills",
10
+ "skill-forge",
11
+ "ast-grep",
12
+ "provenance",
13
+ "code-analysis"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/armelhbobdad/bmad-module-skill-forge.git"
18
+ },
19
+ "license": "MIT",
20
+ "author": "armelhbobdad",
21
+ "main": "tools/cli/skf-cli.js",
22
+ "bin": {
23
+ "bmad-module-skill-forge": "tools/skf-npx-wrapper.js",
24
+ "skill-forge": "tools/skf-npx-wrapper.js"
25
+ },
26
+ "scripts": {
27
+ "docs:build": "node tools/build-docs.js",
28
+ "docs:dev": "npm run --prefix website docs:dev",
29
+ "docs:fix-links": "node tools/fix-doc-links.js --write",
30
+ "docs:preview": "npm run --prefix website preview",
31
+ "docs:validate-links": "node tools/validate-doc-links.js",
32
+ "format:check": "prettier --check \"**/*.{js,cjs,mjs,json,yaml}\"",
33
+ "format:fix": "prettier --write \"**/*.{js,cjs,mjs,json,yaml}\"",
34
+ "lint": "eslint . --ext .js,.cjs,.mjs,.yaml --max-warnings=0",
35
+ "lint:fix": "eslint . --ext .js,.cjs,.mjs,.yaml --fix",
36
+ "lint:md": "markdownlint-cli2 \"**/*.md\"",
37
+ "prepare": "husky || exit 0",
38
+ "release": "npm run release:patch",
39
+ "release:major": "npm version major && git push --follow-tags",
40
+ "release:minor": "npm version minor && git push --follow-tags",
41
+ "release:patch": "npm version patch && git push --follow-tags",
42
+ "release:prerelease": "npm version prerelease && git push --follow-tags",
43
+ "test": "npm run test:schemas && npm run test:install && npm run test:cli && npm run test:knowledge && npm run validate:schemas && npm run lint && npm run lint:md && npm run format:check",
44
+ "test:cli": "node test/test-cli-integration.js",
45
+ "test:install": "node test/test-installation-components.js",
46
+ "test:knowledge": "node test/test-knowledge-base.js",
47
+ "test:schemas": "node test/test-agent-schema.js",
48
+ "validate:schemas": "node test/validate-agent-schema.js"
49
+ },
50
+ "lint-staged": {
51
+ "*.{js,cjs,mjs}": [
52
+ "npm run lint:fix",
53
+ "npm run format:fix"
54
+ ],
55
+ "*.yaml": [
56
+ "eslint --fix",
57
+ "npm run format:fix"
58
+ ],
59
+ "*.json": [
60
+ "npm run format:fix"
61
+ ],
62
+ "*.md": [
63
+ "markdownlint-cli2"
64
+ ]
65
+ },
66
+ "dependencies": {
67
+ "@clack/prompts": "^1.1.0",
68
+ "chalk": "^4.1.2",
69
+ "commander": "^14.0.0",
70
+ "figlet": "^1.8.0",
71
+ "fs-extra": "^11.3.0",
72
+ "js-yaml": "^4.1.0"
73
+ },
74
+ "devDependencies": {
75
+ "@astrojs/sitemap": "^3.6.0",
76
+ "@astrojs/starlight": "^0.37.0",
77
+ "@eslint/js": "^9.33.0",
78
+ "archiver": "^7.0.1",
79
+ "astro": "^5.16.0",
80
+ "c8": "^10.1.3",
81
+ "csv-parse": "^6.1.0",
82
+ "eslint": "^9.33.0",
83
+ "eslint-config-prettier": "^10.1.8",
84
+ "eslint-plugin-n": "^17.21.3",
85
+ "eslint-plugin-unicorn": "^60.0.0",
86
+ "eslint-plugin-yml": "^1.18.0",
87
+ "glob": "^11.0.3",
88
+ "husky": "^9.1.7",
89
+ "ignore": "^7.0.5",
90
+ "jest": "^30.0.4",
91
+ "lint-staged": "^16.1.1",
92
+ "markdownlint-cli2": "^0.19.1",
93
+ "prettier": "^3.7.4",
94
+ "prettier-plugin-packagejson": "^2.5.19",
95
+ "semver": "^7.6.3",
96
+ "sharp": "^0.33.5",
97
+ "wrap-ansi": "^7.0.0",
98
+ "xml2js": "^0.6.2",
99
+ "yaml": "^2.7.0",
100
+ "yaml-eslint-parser": "^1.2.3",
101
+ "yaml-lint": "^1.7.0"
102
+ },
103
+ "engines": {
104
+ "node": ">=22.0.0"
105
+ },
106
+ "publishConfig": {
107
+ "access": "public"
108
+ }
109
+ }
@@ -0,0 +1,93 @@
1
+ agent:
2
+ webskip: true
3
+ metadata:
4
+ id: "_bmad/skf/agents/forger.md"
5
+ name: Ferris
6
+ title: Skill Architect & Integrity Guardian
7
+ icon: "⚒️"
8
+ module: skf
9
+ hasSidecar: true
10
+ sidecar-folder: forger-sidecar
11
+ sidecar-path: "{project-root}/_bmad/_memory/forger-sidecar/"
12
+
13
+ persona:
14
+ role: |
15
+ Skill compilation specialist who transforms code repositories, documentation, and developer discourse into verified agent skills.
16
+ Manages the full lifecycle: source analysis, skill briefing, AST-backed compilation,
17
+ integrity testing, and ecosystem-ready export across progressive capability tiers
18
+ (Quick/Forge/Deep).
19
+
20
+ identity: |
21
+ The forge master — a precision-focused craftsman who works through four modes:
22
+ Architect (exploratory, assembling), Surgeon (precise, preserving), Audit
23
+ (judgmental, scoring), and Delivery (packaging, ecosystem-ready). Modes are
24
+ workflow-bound, not conversation-bound. Takes quiet pride in verified work and
25
+ treats every claim as something that must be proven.
26
+
27
+ communication_style: |
28
+ Structured reports with inline AST citations during work — no metaphor, no
29
+ commentary. At transitions, uses forge language: brief, warm, orienting. On
30
+ completion, quiet craftsman's pride. On errors, direct and actionable with no
31
+ hedging. Acknowledges loaded sidecar state naturally: current forge tier,
32
+ active preferences, and any prior session context.
33
+
34
+ principles:
35
+ - "Channel expert source code analysis wisdom: draw upon deep knowledge of AST patterns, function signatures, type systems, and what separates verified skill definitions from hallucinated ones"
36
+ - "Zero hallucination tolerance — every instruction traces to code; if it can't be cited, it doesn't exist"
37
+ - "Structural truth over semantic guessing — AST first, always; never infer what can be parsed"
38
+ - "Provenance is non-negotiable — every claim has a source, line number, and confidence tier"
39
+ - "Meet developers where they are — progressive capability means Quick is legitimate, not lesser"
40
+ - "Tools are backstage, the craft is center stage — users see results, not tool invocations"
41
+ - "Agent-level knowledge informs judgment across workflows — consult knowledge/ when a step directs, not from memory"
42
+
43
+ critical_actions:
44
+ - "Load COMPLETE file {project-root}/_bmad/_memory/forger-sidecar/preferences.yaml"
45
+ - "Load COMPLETE file {project-root}/_bmad/_memory/forger-sidecar/forge-tier.yaml"
46
+ - "ONLY read/write files in {project-root}/_bmad/_memory/forger-sidecar/"
47
+ - "Consult {project-root}/_bmad/skf/knowledge/skf-knowledge-index.csv to select knowledge fragments under knowledge/ and load only the files needed for the current task"
48
+ - "Load the referenced fragment(s) from {project-root}/_bmad/skf/knowledge/ before giving recommendations"
49
+
50
+ menu:
51
+ - trigger: SF or fuzzy match on setup-forge
52
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/setup-forge/workflow.md"
53
+ description: "[SF] Setup Forge — initialize environment, detect tools, set tier"
54
+
55
+ - trigger: AN or fuzzy match on analyze-source
56
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/analyze-source/workflow.md"
57
+ description: "[AN] Analyze Source — discover what to skill, recommend stack skill"
58
+
59
+ - trigger: BS or fuzzy match on brief-skill
60
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/brief-skill/workflow.md"
61
+ description: "[BS] Brief Skill — design a skill scope through guided discovery"
62
+
63
+ - trigger: CS or fuzzy match on create-skill
64
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/create-skill/workflow.md"
65
+ description: "[CS] Create Skill — compile a skill from brief"
66
+
67
+ - trigger: QS or fuzzy match on quick-skill
68
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/quick-skill/workflow.md"
69
+ description: "[QS] Quick Skill — fast skill, no brief needed"
70
+
71
+ - trigger: SS or fuzzy match on create-stack-skill
72
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/create-stack-skill/workflow.md"
73
+ description: "[SS] Stack Skill — consolidated project stack skill"
74
+
75
+ - trigger: US or fuzzy match on update-skill
76
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/update-skill/workflow.md"
77
+ description: "[US] Update Skill — regenerate after changes, preserves [MANUAL]"
78
+
79
+ - trigger: AS or fuzzy match on audit-skill
80
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/audit-skill/workflow.md"
81
+ description: "[AS] Audit Skill — check for drift"
82
+
83
+ - trigger: TS or fuzzy match on test-skill
84
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/test-skill/workflow.md"
85
+ description: "[TS] Test Skill — verify completeness"
86
+
87
+ - trigger: EX or fuzzy match on export-skill
88
+ workflow: "{project-root}/_bmad/skf/workflows/skillforge/export-skill/workflow.md"
89
+ description: "[EX] Export Skill — package for distribution"
90
+
91
+ - trigger: WS or fuzzy match on workflow-status
92
+ action: "Show current lifecycle position, active skill briefs, and forge tier status"
93
+ description: "[WS] Workflow Status — show current lifecycle position"
@@ -0,0 +1,17 @@
1
+ # forger-sidecar
2
+
3
+ This folder stores persistent memory for the **Ferris** agent (Skill Architect & Integrity Guardian).
4
+
5
+ ## Purpose
6
+
7
+ Cross-session state for the SKF module's skill compilation lifecycle.
8
+
9
+ ## Files
10
+
11
+ - `preferences.yaml` — User preferences: language defaults, output format settings
12
+ - `forge-tier.yaml` — Tool availability (ast-grep, gh, QMD) and derived capability tier
13
+
14
+ ## Runtime Access
15
+
16
+ After BMAD installation, this folder will be accessible at:
17
+ `{project-root}/_bmad/_memory/forger-sidecar/`
@@ -0,0 +1,13 @@
1
+ # Ferris Sidecar: Forge Tier State
2
+ # Written by setup-forge workflow on first run
3
+
4
+ # Tool availability (detected during [SF] Setup Forge)
5
+ tools:
6
+ ast_grep: ~
7
+ gh_cli: ~
8
+ qmd: ~
9
+
10
+ # Capability tier (derived from tool availability)
11
+ # Quick = no tools | Forge = ast-grep | Deep = ast-grep + gh + qmd
12
+ tier: ~
13
+ tier_detected_at: ~
@@ -0,0 +1,10 @@
1
+ # Ferris Sidecar: User Preferences
2
+ # Written by setup-forge workflow on first run
3
+
4
+ # Language defaults
5
+ output_language: ~
6
+ skill_format_version: ~
7
+
8
+ # Output preferences
9
+ citation_style: ~
10
+ confidence_display: ~
@@ -0,0 +1,158 @@
1
+ # agentskills.io Specification
2
+
3
+ ## Principle
4
+
5
+ Skills produced by Skill Forge comply with the agentskills.io specification — a format designed for agent consumption through progressive disclosure. The format prioritizes discoverability at low token cost, deterministic procedural instructions, and just-in-time resource loading.
6
+
7
+ ## Rationale
8
+
9
+ Agent skills are not documentation for humans. They are instructions consumed by AI agents that treat every statement as actionable truth. The agentskills.io format was designed around this constraint: minimal metadata for discovery, structured instructions for activation, and on-demand resources for execution.
10
+
11
+ Without format compliance:
12
+ - Skills are not portable across agent platforms
13
+ - Discovery requires loading full skill content, wasting context tokens
14
+ - Agents cannot distinguish skills from general documentation
15
+
16
+ With format compliance:
17
+ - Skills are discoverable from ~100 tokens of frontmatter metadata
18
+ - Full activation loads < 500 lines of structured instructions
19
+ - Resources load on demand, keeping context lean during execution
20
+
21
+ ## Format Structure
22
+
23
+ ### Required: SKILL.md
24
+
25
+ The minimum viable skill is a single `SKILL.md` file containing:
26
+
27
+ **Frontmatter** (YAML between `---` markers):
28
+ ```yaml
29
+ ---
30
+ name: library-name
31
+ description: >
32
+ What the skill does and when to use it. Include specific keywords
33
+ for agent discovery. Mention what NOT to use it for.
34
+ ---
35
+ ```
36
+
37
+ **Frontmatter constraints:**
38
+ - `name`: 1-64 characters, lowercase alphanumeric + hyphens, must match parent directory name
39
+ - `description`: 1-1024 characters, trigger-optimized for agent matching
40
+
41
+ **Body:** Free-form markdown — no structural restrictions, but Skill Forge follows a consistent section order (see skill-sections.md in create-skill/data/).
42
+
43
+ ### Optional: Supporting Directories
44
+
45
+ ```
46
+ skill-name/
47
+ ├── SKILL.md # Instructions and API reference
48
+ ├── scripts/ # Executable automation
49
+ ├── references/ # Detailed reference material
50
+ └── assets/ # Templates, schemas, configs
51
+ ```
52
+
53
+ All subdirectories are exactly one level deep. Files are loaded on demand when SKILL.md directs — never automatically.
54
+
55
+ ## Progressive Disclosure Model
56
+
57
+ The format implements a three-phase loading model:
58
+
59
+ | Phase | What Loads | Token Cost | When |
60
+ | --- | --- | --- | --- |
61
+ | Discovery | `name` + `description` from frontmatter | ~50-100 tokens | Agent startup, all skills |
62
+ | Activation | Full `SKILL.md` body | < 5000 tokens | Task matches skill description |
63
+ | Execution | Files from `scripts/`, `references/`, `assets/` | Variable | SKILL.md directs agent to load |
64
+
65
+ ## Pattern Examples
66
+
67
+ ### Example 1: Trigger-Optimized Description
68
+
69
+ **Context:** Writing a skill description that agents can match to user tasks.
70
+
71
+ **Implementation:**
72
+ ```yaml
73
+ description: >
74
+ Extract and transform data from PostgreSQL databases using pg client.
75
+ Use for database queries, schema inspection, connection management,
76
+ and migration execution. NOT for: MongoDB, Redis, or other non-SQL stores.
77
+ NOT for: ORM-level abstractions (use typeorm-skill or prisma-skill instead).
78
+ ```
79
+
80
+ **Key Points:**
81
+ - Leads with what the skill does (positive triggers)
82
+ - Includes negative triggers to prevent false matches
83
+ - References alternative skills for excluded use cases
84
+ - Specific keywords: "PostgreSQL", "pg client", "schema inspection"
85
+
86
+ ### Example 2: Just-in-Time Resource Loading
87
+
88
+ **Context:** A skill needs to reference a complex schema during execution.
89
+
90
+ **Implementation:**
91
+ ```markdown
92
+ ## Configuration
93
+
94
+ The library accepts a configuration object matching the schema in
95
+ `references/config-schema.md`. Load that file now to validate
96
+ the user's configuration against the expected structure.
97
+ ```
98
+
99
+ **Key Points:**
100
+ - The directive is explicit: "Load that file now"
101
+ - Agents do not pre-load reference files — they follow the instruction when they reach it
102
+ - Relative paths use forward slashes, one level deep only
103
+
104
+ ### Example 3: Procedural Instructions for Agents
105
+
106
+ **Context:** Writing skill instructions that agents execute deterministically.
107
+
108
+ **Implementation:**
109
+ ```markdown
110
+ ## Setup
111
+
112
+ 1. Check if `pg` is installed: run `npm list pg` in the project directory.
113
+ 2. If not installed, run `npm install pg`.
114
+ 3. Locate the database configuration:
115
+ - Check `src/config/database.ts` first
116
+ - If not found, check environment variables: `DATABASE_URL`, `PG_HOST`
117
+ - If neither exists, ask the user for connection details
118
+ 4. Validate the connection by running the health check in `scripts/health-check.sql`.
119
+ ```
120
+
121
+ **Key Points:**
122
+ - Step-by-step numbering with decision trees
123
+ - Third-person imperative voice ("Check if..." not "You should check...")
124
+ - Concrete file paths and commands, not vague guidance
125
+ - Fallback paths explicitly mapped
126
+
127
+ ### Example 4: Skill Forge Compliance Checks
128
+
129
+ **Context:** The validate step in create-skill checks agentskills.io compliance.
130
+
131
+ **Implementation:** Validation covers:
132
+ 1. Frontmatter present with required `name` and `description` fields
133
+ 2. `name` matches parent directory name and formatting rules
134
+ 3. `description` length within 1-1024 characters
135
+ 4. SKILL.md body under 500 lines (warning, not failure)
136
+ 5. All relative paths resolve to existing files
137
+ 6. No deeply nested subdirectories (max one level)
138
+
139
+ **Key Points:**
140
+ - Compliance is checked during create-skill, not as a post-hoc audit
141
+ - Line count is a guideline — exceeding 500 lines produces a warning
142
+ - Path validation prevents broken references in the published skill
143
+
144
+ ## Anti-Patterns
145
+
146
+ - Writing skills as documentation (README-style) instead of procedural agent instructions
147
+ - Deeply nested directory structures — one level maximum from skill root
148
+ - Vague descriptions ("helps with databases") — descriptions must be specific and trigger-optimized
149
+ - Including redundant content that duplicates what the agent already knows (standard language features, basic CLI commands)
150
+ - Bundling large library code inside skills — skills reference existing tools, not replace them
151
+
152
+ ## Related Fragments
153
+
154
+ - [skill-lifecycle.md](skill-lifecycle.md) — where agentskills.io compliance fits in the pipeline
155
+ - [confidence-tiers.md](confidence-tiers.md) — how citations appear within the formatted output
156
+ - [zero-hallucination.md](zero-hallucination.md) — the integrity principle that shapes skill content
157
+
158
+ _Source: synthesized from agentskills.io specification, what-are-skills.mdx, integrate-skills.mdx, and Best Practices for Creating Agent Skills_
@@ -0,0 +1,153 @@
1
+ # Confidence Tiers
2
+
3
+ ## Principle
4
+
5
+ Every extracted claim carries a confidence tier label — T1, T1-low, T2, or T3 — that tells consuming agents how much to trust the information. The tier determines citation format, affects scoring weights, and governs how claims interact during updates and audits.
6
+
7
+ ## Rationale
8
+
9
+ Not all extracted information has equal reliability. An AST-parsed function signature is structurally verified; a type inferred from pattern matching might be wrong; a QMD-enriched usage note adds context but not structural proof; an external doc reference is only as current as its source.
10
+
11
+ Without confidence tiers:
12
+ - All claims appear equally trustworthy regardless of extraction method
13
+ - Agents cannot distinguish verified signatures from inferred patterns
14
+ - Audit and update workflows have no basis for prioritizing drift findings
15
+
16
+ With confidence tiers:
17
+ - Each claim transparently declares its evidence strength
18
+ - Scoring weights adjust based on the distribution of tiers
19
+ - Update workflows know which claims to re-verify first
20
+
21
+ ## Tier Definitions
22
+
23
+ | Tier | Label | Source | Extraction Method | Available At |
24
+ | --- | --- | --- | --- | --- |
25
+ | T1 | AST-verified | Source code | ast-grep structural parsing | Forge, Deep |
26
+ | T1-low | Source-read | Source code | Pattern matching, file reading | Quick, Forge, Deep |
27
+ | T2 | QMD-enriched | Knowledge base | QMD semantic search + synthesis | Deep |
28
+ | T3 | External reference | Docs, URLs | External documentation lookup | All tiers |
29
+
30
+ ## Citation Formats
31
+
32
+ Each tier has a defined citation format used consistently across all skill output:
33
+
34
+ ```
35
+ T1: [AST:filepath:Lnn] — AST-verified, line-level precision
36
+ T1-low: [SRC:filepath:Lnn] — source-read, line-level but unverified structure
37
+ T2: [QMD:collection:document] — QMD knowledge enrichment
38
+ T3: [EXT:url-or-reference] — external documentation reference
39
+ ```
40
+
41
+ ## Pattern Examples
42
+
43
+ ### Example 1: T1 — AST-Verified Export
44
+
45
+ **Context:** ast-grep parses a TypeScript file and extracts a function export with full signature.
46
+
47
+ **Implementation:**
48
+ ```markdown
49
+ ## `createServer(options: ServerOptions): Server`
50
+
51
+ Creates and configures an HTTP server instance.
52
+
53
+ **Parameters:**
54
+ | Name | Type | Required | Default |
55
+ | --- | --- | --- | --- |
56
+ | options | `ServerOptions` | yes | — |
57
+
58
+ [AST:src/server.ts:L23]
59
+ ```
60
+
61
+ **Key Points:**
62
+ - Signature extracted by AST — structurally guaranteed to match source
63
+ - Line number is exact, not approximate
64
+ - Only available when ast-grep is present (Forge/Deep tier)
65
+
66
+ ### Example 2: T1-low — Source-Read Extraction
67
+
68
+ **Context:** Quick tier extraction reads source files without AST parsing.
69
+
70
+ **Implementation:**
71
+ ```markdown
72
+ ## `createServer(options)`
73
+
74
+ Creates and configures an HTTP server instance.
75
+
76
+ **Parameters:**
77
+ | Name | Type | Required | Default |
78
+ | --- | --- | --- | --- |
79
+ | options | `object` | yes | — |
80
+
81
+ [SRC:src/server.ts:L23] — type inferred from usage, not structurally verified
82
+ ```
83
+
84
+ **Key Points:**
85
+ - Same function, but parameter type is `object` not `ServerOptions` — pattern matching missed the type alias
86
+ - Citation explicitly notes the inference limitation
87
+ - Still useful — location is correct, signature is close
88
+
89
+ ### Example 3: T2 — QMD Enrichment
90
+
91
+ **Context:** Deep tier enriches an extracted API with usage patterns from QMD knowledge base.
92
+
93
+ **Implementation:**
94
+ ```markdown
95
+ ### Usage Context
96
+
97
+ `createServer` is typically used with `loadMiddleware()` in application bootstrap.
98
+ Common pattern: create server first, then attach middleware chain before calling `.listen()`.
99
+
100
+ [QMD:project-docs:architecture-overview]
101
+ ```
102
+
103
+ **Key Points:**
104
+ - Enrichment adds context, not structural claims
105
+ - QMD citations reference collection and document, not line numbers
106
+ - T2 content appears in enrichment sections, not in API signatures
107
+
108
+ ### Example 4: Tier Interaction During Updates
109
+
110
+ **Context:** An update-skill workflow detects that a T1-low claim now contradicts fresh T1 extraction.
111
+
112
+ **Implementation:** The merge algorithm applies tier precedence:
113
+ 1. T1 always overrides T1-low for the same export
114
+ 2. T2 enrichments are preserved unless the underlying T1/T1-low claim changed
115
+ 3. T3 references are flagged for manual review if the API they describe changed
116
+
117
+ **Key Points:**
118
+ - Higher confidence tiers take precedence in merge conflicts
119
+ - T2 enrichments are additive — they don't conflict with structural claims
120
+ - T3 references may go stale and are flagged, not auto-removed
121
+
122
+ ## Confidence Distribution in Metadata
123
+
124
+ Every generated skill includes a confidence distribution in `metadata.json`:
125
+
126
+ ```json
127
+ {
128
+ "confidence_distribution": {
129
+ "t1": 42,
130
+ "t1_low": 5,
131
+ "t2": 12,
132
+ "t3": 3
133
+ },
134
+ "extraction_tier": "deep"
135
+ }
136
+ ```
137
+
138
+ This distribution feeds into test-skill scoring — skills with higher T1 ratios score better on signature accuracy.
139
+
140
+ ## Anti-Patterns
141
+
142
+ - Omitting the confidence tier from a citation — every citation must declare its level
143
+ - Using T1 format (`[AST:...]`) when ast-grep was not actually used for that extraction
144
+ - Treating T1-low and T1 as equivalent during scoring — they have different weight impacts
145
+ - Adding T2 enrichment without a QMD citation — enrichment without provenance is hallucination
146
+
147
+ ## Related Fragments
148
+
149
+ - [zero-hallucination.md](zero-hallucination.md) — the principle that motivates tiered confidence
150
+ - [provenance-tracking.md](provenance-tracking.md) — how citations are recorded in provenance-map.json
151
+ - [progressive-capability.md](progressive-capability.md) — how forge tier determines available confidence levels
152
+
153
+ _Source: consolidated from extraction-patterns.md, create-skill steps 03/05, and scoring-rules.md_