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,52 @@
1
+ ---
2
+ name: create-skill
3
+ description: Compile a skill from a brief. Supports --batch for multiple briefs.
4
+ web_bundle: true
5
+ ---
6
+
7
+ # Create Skill
8
+
9
+ **Goal:** Compile a verified agent skill from a skill-brief.yaml and source code, producing an agentskills.io-compliant SKILL.md with provenance map, evidence report, and progressive disclosure references.
10
+
11
+ **Your Role:** You are a skill compilation engine performing structural extraction and assembly. This workflow is mostly autonomous with two strategic confirmation gates — one after ecosystem check (if a match is found) and one after source extraction (to confirm findings before compilation). All other steps auto-proceed. Apply zero hallucination tolerance: every instruction in the output must trace to source code with a confidence tier citation.
12
+
13
+ ## WORKFLOW ARCHITECTURE
14
+
15
+ ### Core Principles
16
+
17
+ - **Micro-file Design**: Each step of the overall goal is a self contained instruction file that you will adhere too 1 file as directed at a time
18
+ - **Just-In-Time Loading**: Only 1 current step file will be loaded, read, and executed to completion - never load future step files until told to do so
19
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
20
+ - **Tier-Aware Execution**: Steps adapt behavior based on forge tier (Quick/Forge/Deep) loaded from sidecar at init
21
+ - **Zero Hallucination**: Every claim requires a provenance citation — uncitable content is excluded, not guessed
22
+
23
+ ### Step Processing Rules
24
+
25
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
26
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
27
+ 3. **WAIT FOR INPUT**: At confirmation gates (steps 02 and 03), halt and wait for user selection
28
+ 4. **AUTO-PROCEED**: All other steps proceed to the next automatically after completion
29
+ 5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
30
+
31
+ ### Critical Rules (NO EXCEPTIONS)
32
+
33
+ - 🛑 **NEVER** load multiple step files simultaneously
34
+ - 📖 **ALWAYS** read entire step file before execution
35
+ - 🚫 **NEVER** skip steps or optimize the sequence
36
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
37
+ - 📋 **NEVER** create mental todo lists from future steps
38
+ - ⚒️ **NEVER** include content in SKILL.md that cannot be cited to source code
39
+
40
+ ---
41
+
42
+ ## INITIALIZATION SEQUENCE
43
+
44
+ ### 1. Module Configuration Loading
45
+
46
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
47
+
48
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
49
+
50
+ ### 2. First Step Execution
51
+
52
+ Load, read the full file and then execute ./steps-c/step-01-load-brief.md to begin the workflow.
@@ -0,0 +1,61 @@
1
+ # Integration Pattern Detection Rules
2
+
3
+ ## Co-Import Detection
4
+
5
+ A co-import is detected when two or more confirmed libraries are imported in the same source file.
6
+
7
+ ### Detection Method
8
+
9
+ 1. For each file in the codebase, extract all import statements
10
+ 2. Map imports to confirmed library list
11
+ 3. If a file imports 2+ confirmed libraries → co-import detected
12
+ 4. Record: file path, library pair, line numbers
13
+
14
+ ### Minimum Threshold
15
+
16
+ - A library pair must co-appear in **2+ files** to qualify as an integration pattern
17
+ - Single file co-imports may be incidental
18
+
19
+ ## Integration Pattern Types
20
+
21
+ ### Type 1: Middleware Chain
22
+ Libraries connected in a processing pipeline.
23
+ - **Signal:** Sequential function calls passing output of one library to another
24
+ - **Example:** `express` + `cors` — cors middleware registered on express app
25
+
26
+ ### Type 2: Shared Types
27
+ Libraries exchanging type definitions or data structures.
28
+ - **Signal:** Type imports from one library used as parameters/returns in another
29
+ - **Example:** `react` + `react-router` — Router components accepting React elements
30
+
31
+ ### Type 3: Configuration Bridge
32
+ One library configuring or initializing another.
33
+ - **Signal:** Config objects or initialization calls referencing both libraries
34
+ - **Example:** `next` + `tailwindcss` — Tailwind configured via next.config
35
+
36
+ ### Type 4: Event Handler
37
+ Libraries connected through event emission/handling patterns.
38
+ - **Signal:** Event listeners from one library triggering actions in another
39
+ - **Example:** `socket.io` + `redis` — Redis pub/sub driving socket events
40
+
41
+ ### Type 5: Adapter/Wrapper
42
+ One library wrapping another to provide a unified interface.
43
+ - **Signal:** Thin wrapper functions delegating to underlying library
44
+ - **Example:** `prisma` + `zod` — Zod schemas validating Prisma model inputs
45
+
46
+ ### Type 6: State Sharing
47
+ Libraries sharing application state or context.
48
+ - **Signal:** Shared state stores, context providers, or global singletons
49
+ - **Example:** `react` + `zustand` — Zustand stores consumed in React components
50
+
51
+ ## Output Format
52
+
53
+ For each detected integration:
54
+ ```
55
+ Library A + Library B
56
+ Type: [pattern type]
57
+ Files: [count] files with co-imports
58
+ Key files: [top 3 files by integration density]
59
+ Pattern: [brief description of how they integrate]
60
+ Confidence: [T1/T1-low based on detection method]
61
+ ```
@@ -0,0 +1,35 @@
1
+ # Manifest Detection Patterns
2
+
3
+ ## Supported Ecosystems
4
+
5
+ | Ecosystem | Manifest File(s) | Dependency Key | Import Pattern |
6
+ |-----------|-----------------|----------------|----------------|
7
+ | JavaScript/TypeScript | package.json | dependencies, devDependencies | `import ... from '...'`, `require('...')` |
8
+ | Python | requirements.txt, setup.py, pyproject.toml, Pipfile | install_requires, [project.dependencies] | `import ...`, `from ... import` |
9
+ | Rust | Cargo.toml | [dependencies] | `use ...`, `extern crate` |
10
+ | Go | go.mod | require | `import "..."` |
11
+ | Java | pom.xml, build.gradle | dependencies | `import ...` |
12
+ | Ruby | Gemfile | gem | `require '...'`, `require_relative` |
13
+ | PHP | composer.json | require, require-dev | `use ...`, `require_once` |
14
+ | .NET | *.csproj | PackageReference | `using ...` |
15
+
16
+ ## Detection Priority
17
+
18
+ 1. Search project root for manifest files (depth 0-1)
19
+ 2. Parse each found manifest to extract dependency names
20
+ 3. Normalize names across ecosystems (e.g., `@scope/package` → `package`)
21
+ 4. Deduplicate across multiple manifests
22
+
23
+ ## Filtering Rules
24
+
25
+ - Exclude dev-only dependencies unless they appear in production imports
26
+ - Exclude build tools (webpack, babel, eslint, etc.) unless significantly imported
27
+ - Include all runtime dependencies by default
28
+ - Flag transitive dependencies that appear in direct imports
29
+
30
+ ## Import Counting
31
+
32
+ For each dependency, count distinct files that import it:
33
+ - Use grep patterns from Import Pattern column
34
+ - Count unique file paths, not total import statements
35
+ - Exclude test files, config files, and build artifacts from count
@@ -0,0 +1,110 @@
1
+ # Stack Skill Template
2
+
3
+ ## SKILL.md Section Structure
4
+
5
+ ```markdown
6
+ # {project_name} Stack Skill
7
+
8
+ > {lib_count} libraries | {integration_count} integration patterns | Forge tier: {tier}
9
+
10
+ ## Integration Patterns
11
+
12
+ ### Cross-Cutting Patterns
13
+ [Patterns that span 3+ libraries — middleware chains, shared config, etc.]
14
+
15
+ ### Library Pair Integrations
16
+ [For each detected integration pair:]
17
+ #### {LibraryA} + {LibraryB}
18
+ **Type:** {pattern_type}
19
+ **Pattern:** {description}
20
+ **Key files:** {file_list}
21
+ **Confidence:** {T1/T1-low/T2}
22
+
23
+ ## Library Reference Index
24
+
25
+ | Library | Imports | Key Exports | Confidence | Reference |
26
+ |---------|---------|-------------|------------|-----------|
27
+ | {name} | {count} | {top_exports} | {tier} | [ref](./references/{name}.md) |
28
+
29
+ ## Per-Library Summaries
30
+
31
+ ### {library_name}
32
+ **Role in stack:** {one-line description of what this library does in this project}
33
+ **Key exports used:** {comma-separated list}
34
+ **Usage pattern:** {brief pattern description}
35
+ **Confidence:** {T1/T1-low/T2}
36
+
37
+ ## Conventions
38
+
39
+ [Project-specific conventions for library usage:]
40
+ - {convention_1}
41
+ - {convention_2}
42
+ ```
43
+
44
+ ## context-snippet.md Format (ADR-L)
45
+
46
+ Two-line format per library, targeting ~30 tokens per entry:
47
+
48
+ ```markdown
49
+ **{library}** ({import_count} imports): {top_3_exports}
50
+ → integrates with: {comma-separated integration partners}
51
+ ```
52
+
53
+ ## metadata.json Structure
54
+
55
+ ```json
56
+ {
57
+ "skill_type": "stack",
58
+ "skill_name": "{project}-stack",
59
+ "version": "1.0.0",
60
+ "created": "{date}",
61
+ "forge_tier": "{Quick|Forge|Deep}",
62
+ "library_count": 0,
63
+ "integration_count": 0,
64
+ "libraries": ["lib1", "lib2"],
65
+ "integration_pairs": [["lib1", "lib2"]],
66
+ "confidence_distribution": {
67
+ "T1": 0,
68
+ "T1-low": 0,
69
+ "T2": 0
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## references/{library}.md Structure
75
+
76
+ ```markdown
77
+ # {library_name} Reference
78
+
79
+ **Version:** {version_from_manifest}
80
+ **Import count:** {count} files
81
+ **Confidence:** {T1/T1-low/T2}
82
+
83
+ ## Key Exports
84
+ [Top exports used in this project with signatures]
85
+
86
+ ## Usage Patterns
87
+ [How this library is typically used in this codebase]
88
+
89
+ ## Common Imports
90
+ [Most frequent import statements]
91
+ ```
92
+
93
+ ## references/integrations/{pair}.md Structure
94
+
95
+ ```markdown
96
+ # {LibraryA} + {LibraryB} Integration
97
+
98
+ **Type:** {pattern_type}
99
+ **Co-import files:** {count}
100
+ **Confidence:** {T1/T1-low}
101
+
102
+ ## Integration Pattern
103
+ [Detailed description of how these libraries connect]
104
+
105
+ ## Key Files
106
+ [Files demonstrating the integration with line references]
107
+
108
+ ## Usage Convention
109
+ [How this integration is typically structured in the project]
110
+ ```
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: 'step-01-init'
3
+ description: 'Initialize stack skill workflow by loading forge tier and validating prerequisites'
4
+
5
+ nextStepFile: './step-02-detect-manifests.md'
6
+ forgeTierFile: '{sidecar_path}/forge-tier.yaml'
7
+ ---
8
+
9
+ # Step 1: Initialize
10
+
11
+ ## STEP GOAL:
12
+
13
+ Load forge tier configuration, validate prerequisites, and prepare the stack skill workflow for execution.
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - 📖 CRITICAL: Read the complete step file before taking any action
20
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
21
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
22
+
23
+ ### Role Reinforcement:
24
+
25
+ - ✅ You are a dependency analyst and integration architect operating in Ferris Architect mode
26
+ - ✅ Execute with prescriptive precision — every finding must trace to actual code
27
+ - ✅ Speed-first approach with zero hallucination
28
+
29
+ ### Step-Specific Rules:
30
+
31
+ - 🎯 Focus ONLY on loading configuration and validating prerequisites
32
+ - 🚫 FORBIDDEN to start detecting manifests or analyzing dependencies
33
+ - 🚫 No A/P menu — this is an auto-proceed init step
34
+
35
+ ## EXECUTION PROTOCOLS:
36
+
37
+ - 🎯 Load forge tier and validate tools
38
+ - 💾 Store tier, tools, and optional inputs as workflow state
39
+ - 📖 Auto-proceed to next step after successful initialization
40
+ - 🚫 HALT with actionable error if prerequisites missing
41
+
42
+ ## CONTEXT BOUNDARIES:
43
+
44
+ - This is the first step — no prior workflow state exists
45
+ - Requires setup-forge to have been completed (forge-tier.yaml)
46
+ - User may provide optional explicit dependency list or scope overrides
47
+ - No dependencies on brief-skill or create-skill outputs
48
+
49
+ ## MANDATORY SEQUENCE
50
+
51
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
52
+
53
+ ### 1. Load Forge Tier Configuration
54
+
55
+ Load `{forgeTierFile}` from the Ferris sidecar.
56
+
57
+ **If forge-tier.yaml does not exist:**
58
+
59
+ "**Cannot proceed.** The setup-forge workflow has not been run for this project.
60
+
61
+ **Required:** Run `setup-forge` first to detect available tools and determine your forge tier.
62
+
63
+ **Halting workflow.**"
64
+
65
+ STOP — do not proceed.
66
+
67
+ **If forge-tier.yaml exists:**
68
+
69
+ Extract:
70
+ - `forge_tier` — Quick, Forge, or Deep
71
+ - `available_tools` — list of detected tools (gh_bridge, ast_bridge, qmd_bridge, skills_ref)
72
+ - `project_root` — project root path
73
+
74
+ Check for `tier_override` in preferences.yaml if it exists.
75
+
76
+ ### 2. Validate Available Tools
77
+
78
+ **Required for all tiers:**
79
+ - File I/O capability (read project files)
80
+
81
+ **Tier-dependent tools:**
82
+ - **Quick:** gh_bridge (source reading) — graceful degradation to local file reading if unavailable
83
+ - **Forge:** ast_bridge (ast-grep structural analysis) — required for Forge tier
84
+ - **Deep:** qmd_bridge (QMD temporal enrichment) — required for Deep tier
85
+
86
+ Report tool availability. If a tier-required tool is missing, downgrade tier and note:
87
+
88
+ "**Tier adjusted:** {original_tier} → {adjusted_tier} — {missing_tool} unavailable."
89
+
90
+ ### 3. Accept Optional Inputs
91
+
92
+ Check if the user provided:
93
+
94
+ **Explicit dependency list:**
95
+ - If provided, store as `explicit_deps` and skip auto-detection in step 02
96
+ - Format: comma-separated library names or a file path
97
+
98
+ **Scope overrides:**
99
+ - If provided, store as `scope_overrides` for use in step 03
100
+ - Format: `library_name: include|exclude`
101
+
102
+ If no optional inputs provided, auto-detection will be used.
103
+
104
+ ### 4. Display Initialization Summary
105
+
106
+ "**Stack Skill Forge initialized.**
107
+
108
+ **Project:** {project_name}
109
+ **Forge Tier:** {tier_description}
110
+ - Quick: Source reading and import counting
111
+ - Forge: + AST-backed structural analysis
112
+ - Deep: + Temporal integration evolution
113
+
114
+ **Available Tools:** {tool_list}
115
+ **Input Mode:** {auto-detect | explicit dependency list}
116
+
117
+ **Proceeding to manifest detection...**"
118
+
119
+ ### 5. Auto-Proceed to Next Step
120
+
121
+ Load, read the full file and then execute `{nextStepFile}`.
122
+
123
+ ---
124
+
125
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
126
+
127
+ ### ✅ SUCCESS:
128
+
129
+ - Forge tier loaded and validated
130
+ - Tool availability confirmed with tier adjustment if needed
131
+ - Optional inputs accepted and stored
132
+ - Initialization summary displayed with positive capability framing
133
+ - Auto-proceeded to step 02
134
+
135
+ ### ❌ SYSTEM FAILURE:
136
+
137
+ - Proceeding without forge-tier.yaml
138
+ - Not reporting tier adjustments when tools missing
139
+ - Starting manifest detection in this step
140
+ - Displaying A/P menu (this is auto-proceed)
141
+
142
+ **Master Rule:** This step validates prerequisites and initializes state. No analysis, no detection, no extraction.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: 'step-02-detect-manifests'
3
+ description: 'Scan project for dependency manifests and extract raw dependency list'
4
+
5
+ nextStepFile: './step-03-rank-and-confirm.md'
6
+ manifestPatterns: '../data/manifest-patterns.md'
7
+ ---
8
+
9
+ # Step 2: Detect Manifests
10
+
11
+ ## STEP GOAL:
12
+
13
+ Scan the project root for dependency manifest files, parse each to extract dependency names and versions, and produce a raw dependency list for ranking.
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - 📖 CRITICAL: Read the complete step file before taking any action
20
+ - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
21
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
22
+
23
+ ### Role Reinforcement:
24
+
25
+ - ✅ You are a dependency analyst operating in Ferris Architect mode
26
+ - ✅ Prescriptive precision — report exactly what was found, nothing assumed
27
+ - ✅ Zero hallucination — only list dependencies actually present in manifest files
28
+
29
+ ### Step-Specific Rules:
30
+
31
+ - 🎯 Focus ONLY on finding and parsing manifest files
32
+ - 🚫 FORBIDDEN to count imports or rank dependencies — that is step 03
33
+ - 🚫 FORBIDDEN to extract library documentation — that is step 04
34
+ - 💬 If explicit dependency list was provided in step 01, use it and skip detection
35
+
36
+ ## EXECUTION PROTOCOLS:
37
+
38
+ - 🎯 Load manifest-patterns.md for detection rules
39
+ - 💾 Store manifests found and raw dependency list as workflow state
40
+ - 📖 Auto-proceed to step 03 after successful detection
41
+ - 🚫 HALT if no manifests found and no explicit list provided
42
+
43
+ ## CONTEXT BOUNDARIES:
44
+
45
+ - From step 01: forge tier, available tools, optional explicit_deps, project_root
46
+ - This step produces: manifests[], raw_dependencies[]
47
+ - Does NOT rank, filter, or analyze — just detect and parse
48
+
49
+ ## MANDATORY SEQUENCE
50
+
51
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
52
+
53
+ ### 1. Check for Explicit Dependency List
54
+
55
+ **If `explicit_deps` was provided in step 01:**
56
+
57
+ "**Using provided dependency list.** Skipping manifest auto-detection.
58
+
59
+ **Dependencies:** {explicit_deps_count} libraries provided"
60
+
61
+ Store the explicit list as `raw_dependencies` and skip to section 4.
62
+
63
+ **If no explicit list:** Continue to section 2.
64
+
65
+ ### 2. Scan for Manifest Files
66
+
67
+ Load `{manifestPatterns}` for supported ecosystem detection patterns.
68
+
69
+ Scan the project root (depth 0-1) for manifest files:
70
+
71
+ - Search for each supported manifest filename
72
+ - Record: file path, ecosystem type, file size
73
+ - Note any unusual structures (monorepo with multiple manifests, workspace configurations)
74
+
75
+ **If no manifest files found:**
76
+
77
+ "**No dependency manifests detected** in the project root.
78
+
79
+ Searched for: package.json, requirements.txt, Cargo.toml, go.mod, pom.xml, build.gradle, Gemfile, composer.json, *.csproj
80
+
81
+ **Options:**
82
+ 1. Provide an explicit dependency list
83
+ 2. Specify a different project root path
84
+ 3. Cancel workflow
85
+
86
+ **Halting — please provide input.**"
87
+
88
+ STOP — wait for user response.
89
+
90
+ ### 3. Parse Each Manifest
91
+
92
+ For each discovered manifest file:
93
+
94
+ 1. Read the file contents
95
+ 2. Extract dependency names and version constraints using ecosystem-specific parsing:
96
+ - JSON manifests: parse dependencies/devDependencies keys
97
+ - TOML manifests: parse [dependencies] sections
98
+ - Text manifests: parse line-by-line (name==version or name>=version)
99
+ - XML manifests: parse dependency elements
100
+ - Gradle: parse implementation/api/compile declarations
101
+ 3. Categorize: runtime vs dev-only
102
+ 4. Normalize dependency names across ecosystems
103
+
104
+ Deduplicate dependencies found across multiple manifests.
105
+
106
+ ### 4. Display Detection Summary
107
+
108
+ "**Manifest detection complete.**
109
+
110
+ **Manifests found:** {count}
111
+ {For each manifest:}
112
+ - `{file_path}` ({ecosystem}) — {dep_count} dependencies
113
+
114
+ **Total unique dependencies:** {total_count}
115
+ - Runtime: {runtime_count}
116
+ - Dev-only: {dev_count}
117
+
118
+ **Proceeding to dependency ranking...**"
119
+
120
+ ### 5. Auto-Proceed to Next Step
121
+
122
+ Load, read the full file and then execute `{nextStepFile}`.
123
+
124
+ ---
125
+
126
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
127
+
128
+ ### ✅ SUCCESS:
129
+
130
+ - All manifest files in project root detected
131
+ - Each manifest parsed with dependency names extracted
132
+ - Runtime vs dev-only categorization applied
133
+ - Deduplication across multiple manifests completed
134
+ - Detection summary displayed with accurate counts
135
+ - Auto-proceeded to step 03
136
+
137
+ ### ❌ SYSTEM FAILURE:
138
+
139
+ - Missing manifest files that exist in the project
140
+ - Inventing dependencies not in manifest files
141
+ - Starting to rank or analyze dependencies (step 03's job)
142
+ - Not halting when no manifests found
143
+ - Displaying A/P menu (this is auto-proceed)
144
+
145
+ **Master Rule:** Detect and parse only. No ranking, no filtering, no analysis.