mindforge-cc 6.2.0-alpha → 6.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 (110) hide show
  1. package/.agent/bin/lib/commands.cjs +4 -4
  2. package/.agent/bin/lib/state.cjs +1 -1
  3. package/.agent/bin/lib/verify.cjs +7 -7
  4. package/.agent/bin/mindforge-tools.cjs +1 -1
  5. package/.agent/hooks/mindforge-context-monitor.js +1 -1
  6. package/.agent/hooks/mindforge-session-init_extended.js +4 -4
  7. package/.agent/hooks/mindforge-workflow-guard.js +1 -1
  8. package/.agent/mindforge/debug.md +3 -0
  9. package/.agent/mindforge/execute-phase.md +6 -0
  10. package/.agent/mindforge/learning.md +20 -0
  11. package/.agent/mindforge/plan-phase.md +9 -7
  12. package/.agent/mindforge/record-learning.md +22 -0
  13. package/.agent/mindforge/retrospective.md +1 -0
  14. package/.agent/mindforge/ship.md +7 -0
  15. package/.claude/CLAUDE.md +16 -7
  16. package/.claude/commands/mindforge/approve.md +16 -24
  17. package/.claude/commands/mindforge/audit.md +28 -28
  18. package/.claude/commands/mindforge/auto.md +20 -27
  19. package/.claude/commands/mindforge/benchmark.md +31 -24
  20. package/.claude/commands/mindforge/browse.md +24 -22
  21. package/.claude/commands/mindforge/complete-milestone.md +16 -26
  22. package/.claude/commands/mindforge/costs.md +10 -23
  23. package/.claude/commands/mindforge/cross-review.md +15 -25
  24. package/.claude/commands/mindforge/dashboard.md +99 -32
  25. package/.claude/commands/mindforge/debug.md +130 -31
  26. package/.claude/commands/mindforge/discuss-phase.md +139 -33
  27. package/.claude/commands/mindforge/execute-phase.md +197 -34
  28. package/.claude/commands/mindforge/health.md +25 -25
  29. package/.claude/commands/mindforge/help.md +27 -23
  30. package/.claude/commands/mindforge/init-org.md +132 -34
  31. package/.claude/commands/mindforge/init-project.md +167 -37
  32. package/.claude/commands/mindforge/install-skill.md +24 -28
  33. package/.claude/commands/mindforge/learn.md +144 -33
  34. package/.claude/commands/mindforge/learning.md +20 -0
  35. package/.claude/commands/mindforge/map-codebase.md +299 -33
  36. package/.claude/commands/mindforge/marketplace.md +121 -30
  37. package/.claude/commands/mindforge/metrics.md +20 -27
  38. package/.claude/commands/mindforge/migrate.md +41 -30
  39. package/.claude/commands/mindforge/milestone.md +11 -30
  40. package/.claude/commands/mindforge/new-runtime.md +20 -26
  41. package/.claude/commands/mindforge/next.md +106 -31
  42. package/.claude/commands/mindforge/plan-phase.md +128 -31
  43. package/.claude/commands/mindforge/plugins.md +38 -28
  44. package/.claude/commands/mindforge/pr-review.md +42 -29
  45. package/.claude/commands/mindforge/profile-team.md +21 -24
  46. package/.claude/commands/mindforge/publish-skill.md +18 -25
  47. package/.claude/commands/mindforge/qa.md +14 -25
  48. package/.claude/commands/mindforge/quick.md +136 -32
  49. package/.claude/commands/mindforge/record-learning.md +22 -0
  50. package/.claude/commands/mindforge/release.md +9 -24
  51. package/.claude/commands/mindforge/remember.md +24 -23
  52. package/.claude/commands/mindforge/research.md +11 -24
  53. package/.claude/commands/mindforge/retrospective.md +25 -26
  54. package/.claude/commands/mindforge/review.md +158 -34
  55. package/.claude/commands/mindforge/security-scan.md +239 -31
  56. package/.claude/commands/mindforge/ship.md +108 -31
  57. package/.claude/commands/mindforge/skills.md +142 -33
  58. package/.claude/commands/mindforge/status.md +110 -27
  59. package/.claude/commands/mindforge/steer.md +11 -22
  60. package/.claude/commands/mindforge/sync-confluence.md +10 -25
  61. package/.claude/commands/mindforge/sync-jira.md +11 -27
  62. package/.claude/commands/mindforge/tokens.md +7 -22
  63. package/.claude/commands/mindforge/update.md +43 -30
  64. package/.claude/commands/mindforge/verify-phase.md +63 -27
  65. package/.claude/commands/mindforge/workspace.md +27 -26
  66. package/.mindforge/engine/shard-controller.md +1 -1
  67. package/CHANGELOG.md +34 -15
  68. package/README.md +93 -98
  69. package/RELEASENOTES.md +6 -6
  70. package/bin/autonomous/auto-runner.js +1 -1
  71. package/bin/autonomous/mesh-self-healer.js +2 -2
  72. package/bin/change-classifier.js +1 -1
  73. package/bin/dashboard/server.js +4 -4
  74. package/bin/dashboard/sse-bridge.js +1 -1
  75. package/bin/engine/learning-manager.js +181 -0
  76. package/bin/engine/sre-manager.js +1 -1
  77. package/bin/engine/temporal-cli.js +1 -1
  78. package/bin/engine/temporal-hindsight.js +4 -4
  79. package/bin/governance/approve.js +2 -2
  80. package/bin/governance/policy-engine.js +1 -1
  81. package/bin/governance/ztai-manager.js +1 -1
  82. package/bin/hindsight-injector.js +1 -1
  83. package/bin/installer-core.js +8 -0
  84. package/bin/memory/federated-sync.js +7 -7
  85. package/bin/mindforge-cli.js +9 -0
  86. package/bin/models/cloud-broker.js +1 -1
  87. package/bin/review/ads-engine.js +6 -6
  88. package/bin/skill-registry.js +4 -4
  89. package/bin/skills-builder/marketplace-client.js +2 -2
  90. package/bin/skills-builder/pattern-detector.js +2 -2
  91. package/bin/skills-builder/skill-generator.js +1 -1
  92. package/bin/skills-builder/skill-registrar.js +4 -4
  93. package/bin/skills-builder/skill-scorer.js +1 -1
  94. package/bin/skills-builder/source-loader.js +2 -2
  95. package/bin/wizard/theme.js +1 -1
  96. package/docs/CAPABILITIES-MANIFEST.md +2 -2
  97. package/docs/MIND-FORGE-REFERENCE-V6.md +3 -3
  98. package/docs/Templates/Project/AGENTS_LEARNING.md +88 -0
  99. package/docs/architecture/V4-SWARM-MESH.md +1 -1
  100. package/docs/architecture/V5-ENTERPRISE.md +1 -1
  101. package/docs/ci-cd.md +1 -1
  102. package/docs/commands-reference.md +106 -48
  103. package/docs/registry/COMMANDS.md +1 -1
  104. package/docs/registry/PERSONAS.md +1 -1
  105. package/docs/registry/README.md +1 -1
  106. package/docs/registry/SKILLS.md +1 -1
  107. package/docs/security/ZTAI-OVERVIEW.md +1 -1
  108. package/docs/user-guide.md +2 -2
  109. package/docs/workflow-atlas.md +1 -1
  110. package/package.json +1 -1
@@ -1,37 +1,200 @@
1
1
  ---
2
- name: mindforge:execute-phase
3
- description: Execute the wave-based execution plan for a specific phase
4
- argument-hint: [N]
5
- allowed-tools:
6
- - view_file
7
- - write_to_file
8
- - run_command
9
- - list_dir
2
+ description: 1. Read STATE.md — confirm phase [N] is in "planned" status.
10
3
  ---
11
4
 
12
- <objective>
13
- Coordinate the parallel execution of task plans for a phase using a wave-based approach, ensuring dependency integrity, automated verification, and audit logging.
14
- </objective>
15
-
16
- <execution_context>
17
- .claude/commands/mindforge/execute-phase.md
18
- </execution_context>
19
-
20
- <context>
21
- Arguments: $ARGUMENTS (Phase N)
22
- Sources: .planning/phases/[N]/PLAN-*.md, STATE.md, REQUIREMENTS.md
23
- Engine: wave-executor.md, dependency-parser.md, context-injector.md
24
- </context>
25
-
26
- <process>
27
- 1. **Pre-checks**: Verify phase status, plan existence, and requirement content. Run dependency parser.
28
- 2. **Display Wave Plan**: Present the wave-based execution graph and wait for user approval.
29
- 3. **Audit Initiation**: Log `phase_execution_started` in `AUDIT.jsonl`.
30
- 4. **Wave Execution**:
31
- - For each wave: Execute tasks in parallel.
32
- - For each task: Inject context, run implementation, run `<verify>`, and commit with SHA.
33
- - If any task fails: Stop the wave and offer debugging.
34
- 5. **Phase Verification**: Check requirement coverage in the implementation and write `VERIFICATION.md`.
35
- 6. **Update State**: Update `STATE.md`, `HANDOFF.json`, and write `WAVE-REPORT-[N].md`.
36
- 7. **Auto-capture**: If enabled, detect new patterns/skills from the implemented phase.
37
- </process>
5
+ # MindForge — Execute Phase Command
6
+ # Usage: /mindforge:execute-phase [N]
7
+
8
+ ## Pre-checks (all must pass before execution starts)
9
+
10
+ 1. Read STATE.md — confirm phase [N] is in "planned" status.
11
+ If STATE.md shows phase [N] as already "complete": ask user to confirm re-execution.
12
+
13
+ 2. Verify plan files exist:
14
+ ```
15
+ .planning/phases/[N]/PLAN-[N]-01.md (minimum one plan required)
16
+ ```
17
+ If missing: stop. Tell user: "No plans found for Phase [N]. Run /mindforge:plan-phase [N] first."
18
+
19
+ 3. Verify REQUIREMENTS.md exists and has content.
20
+ If empty: warn user but allow continuation.
21
+
22
+ 4. Run the dependency parser (`.mindforge/engine/dependency-parser.md`).
23
+ If validation fails (circular deps, missing deps): stop and report. Do not execute.
24
+
25
+ ## Step 1 Build and display the execution plan
26
+
27
+ After dependency parsing succeeds, display the wave plan to the user:
28
+
29
+ ```
30
+ Phase [N] Execution Plan
31
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
32
+
33
+ Wave 1 (parallel) Wave 2 (parallel) Wave 3
34
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
35
+ │ Plan 01 │ │ Plan 03 │ │ Plan 05 │
36
+ │ User model │──┐ │ User API │──┐ │ Checkout UI │
37
+ └─────────────┘ │ └─────────────┘ │ └─────────────┘
38
+ ┌─────────────┐ │ ┌─────────────┐ │
39
+ │ Plan 02 │──┘ │ Plan 04 │──┘
40
+ │ Product │ │ Product API │
41
+ └─────────────┘ └─────────────┘
42
+
43
+ Total tasks: 5 Waves: 3 Est. time: depends on model speed
44
+
45
+ Proceed? (yes/no)
46
+ ```
47
+
48
+ If the user says no: stop. Do not execute anything.
49
+
50
+ ## Step 2 — Write pre-execution audit entry
51
+
52
+ Append to `.planning/AUDIT.jsonl`:
53
+ ```json
54
+ {
55
+ "id": "[uuid-v4]",
56
+ "timestamp": "[ISO-8601]",
57
+ "event": "phase_execution_started",
58
+ "phase": [N],
59
+ "wave_count": [total waves],
60
+ "task_count": [total tasks],
61
+ "agent": "mindforge-orchestrator",
62
+ "session_id": "[session identifier]"
63
+ }
64
+ ```
65
+
66
+ ## Step 3 — Execute waves using the wave executor
67
+
68
+ Follow the complete protocol in `.mindforge/engine/wave-executor.md`.
69
+
70
+ For each wave:
71
+
72
+ ### Wave start
73
+ Write to console:
74
+ ```
75
+ ━━━ Wave [W] of [total] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
76
+ Starting [X] tasks in parallel...
77
+ ```
78
+
79
+ ### Per-task execution (inject context per `context-injector.md`)
80
+ For each plan in the wave:
81
+ 1. Load context package (per `context-injector.md`)
82
+ 2. Execute the plan instructions
83
+ - Run `<verify>` — capture exact output
84
+ - If verify PASSES:
85
+ - Run `<verify-visual>` via `visual-verify-executor.js`
86
+ - If visual verify FAILS: stop and report (treat as verify failure)
87
+ - Write SUMMARY-[N]-[M].md
88
+ - Execute commit: `git add [files] && git commit -m "[type]([scope]): [task name]"`
89
+ - Capture git SHA
90
+ - Write AUDIT entry for task completion
91
+ 5. If verify FAILS:
92
+ - Write SUMMARY-[N]-[M].md with failure details
93
+ - Write AUDIT entry for task failure
94
+ - STOP this wave immediately
95
+ - Report: "Task [plan ID] failed: [verify output]. Stopping Phase [N]."
96
+ - Do not start next wave
97
+ - Ask user: "Spawn debug agent to diagnose? (yes/no)"
98
+
99
+ ### Wave completion (before starting next wave)
100
+ After all tasks in wave complete:
101
+ 1. Run: `[project test command]`
102
+ 2. If tests fail:
103
+ - Identify failing tests
104
+ - Run `git log --oneline -[wave-task-count]` to see wave commits
105
+ - Report which commit likely introduced the failure
106
+ - Stop. Ask user how to proceed.
107
+ 3. If tests pass:
108
+ - Report: "Wave [W] complete. All [X] tasks passed. Tests passing. ✅"
109
+ - Run `/mindforge:record-learning` if any architectural "Aha!" moments or significant anti-patterns were discovered during this wave.
110
+ - Write WAVE-REPORT update
111
+
112
+ ## Step 4 — Phase-level verification
113
+
114
+ After all waves complete, run the verification pipeline:
115
+
116
+ 1. Read every v1 requirement from REQUIREMENTS.md for this phase
117
+ 2. For each requirement, verify it is implemented:
118
+ - Search the codebase for the implementation
119
+ - Check if a test covers it
120
+ - Mark: ✅ implemented + tested | ⚠️ implemented, no test | ❌ not found
121
+ 3. Write `.planning/phases/[N]/VERIFICATION.md`
122
+ 4. Run the full test suite one final time
123
+ 5. If any requirement is ❌: create a fix plan and report to user
124
+
125
+ ## Step 5 — Update state and write wave report
126
+
127
+ Write `.planning/phases/[N]/WAVE-REPORT-[N].md` (per template in wave-executor.md)
128
+
129
+ Update STATE.md:
130
+ ```markdown
131
+ ## Current phase
132
+ [N] — Execution complete ✅
133
+
134
+ ## Last completed task
135
+ Phase [N]: All [X] tasks completed across [W] waves.
136
+
137
+ ## Next action
138
+ Run /mindforge:verify-phase [N] for human acceptance testing.
139
+ ```
140
+
141
+ Update HANDOFF.json with completed phase info.
142
+
143
+ ## Step 5.1 — Final Intelligence Sync
144
+ 1. Read `AGENTS_LEARNING.md` one last time.
145
+ 2. Run `/mindforge:record-learning` to capture the final phase-level learnings (Mistakes discovered during UAT, architectural refinements).
146
+ 3. Commit `AGENTS_LEARNING.md` if updated.
147
+
148
+ Write final AUDIT entry:
149
+ ```json
150
+ {
151
+ "id": "[uuid-v4]",
152
+ "timestamp": "[ISO-8601]",
153
+ "event": "phase_execution_completed",
154
+ "phase": [N],
155
+ "tasks_completed": [X],
156
+ "waves_executed": [W],
157
+ "commits": ["sha1", "sha2", "..."],
158
+ "test_result": "passing",
159
+ "agent": "mindforge-orchestrator"
160
+ }
161
+ ```
162
+
163
+ ## Step 6 — Report to user
164
+
165
+ ```
166
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
167
+ ✅ Phase [N] execution complete
168
+
169
+ Tasks completed : [X] / [X]
170
+ Waves executed : [W]
171
+ Commits made : [X]
172
+ Tests : All passing
173
+ Requirements : [X] / [X] implemented
174
+
175
+ Next step: Run /mindforge:verify-phase [N] for UAT sign-off.
176
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
177
+
178
+ ## Step 7 — Auto-capture check (when AUTO_CAPTURE_SKILLS=true)
179
+
180
+ After all gates pass and the phase is verified:
181
+
182
+ ```bash
183
+ # Check if auto-capture is enabled
184
+ CAPTURE=$(grep -m1 "^AUTO_CAPTURE_SKILLS=" MINDFORGE.md 2>/dev/null | cut -d= -f2 | tr -d ' ')
185
+ if [ "$CAPTURE" = "true" ]; then
186
+ node -e "
187
+ const { detectPatterns, formatForPresentation } = require('./bin/skills-builder/pattern-detector');
188
+ detectPatterns(${PHASE_NUM}).then(result => {
189
+ const display = formatForPresentation(result);
190
+ console.log(display);
191
+ }).catch(err => console.error('[auto-capture] Error:', err.message));
192
+ "
193
+ fi
194
+ ```
195
+
196
+ If patterns are found: display the prompt and await user input.
197
+ If user selects yes: run `/mindforge:learn --session` targeting this phase's SUMMARY files.
198
+ If user selects no: write AUDIT entry `auto_capture_skipped` and continue.
199
+ If no patterns found: exit silently (no noise in the output).
200
+ ```
@@ -1,31 +1,31 @@
1
1
  ---
2
- name: mindforge:health
3
- description: Run the MindForge health engine to diagnose and repair issues
4
- argument-hint: [--repair] [--category C] [--verbose]
5
- allowed-tools:
6
- - run_command
7
- - list_dir
8
- - view_file
2
+ description: Run all seven health-engine categories from .mindforge/intelligence/health-engine.md.
9
3
  ---
10
4
 
11
- <objective>
12
- Ensure the MindForge environment and project state are valid, secure, and optimally configured by running a suite of diagnostic checks across multiple categories.
13
- </objective>
5
+ # MindForge — Health Command
6
+ # Usage: /mindforge:health [--repair] [--category C] [--verbose]
14
7
 
15
- <execution_context>
16
- .claude/commands/mindforge/health.md
17
- </execution_context>
8
+ Run all seven health-engine categories from `.mindforge/intelligence/health-engine.md`.
18
9
 
19
- <context>
20
- Engine: .mindforge/intelligence/health-engine.md
21
- Categories: installation, context, skills, personas, state, integrations, security.
22
- Flags: --repair (auto-fix), --verbose (full details).
23
- </context>
10
+ ## Output
11
+ - category status summary
12
+ - errors (must fix)
13
+ - warnings (should fix)
14
+ - informational signals
24
15
 
25
- <process>
26
- 1. **Initialize Diagnostics**: Load the health engine and target specifically requested categories (or all by default).
27
- 2. **Execute Checks**: Scan for configuration errors, missing files, security misconfigurations, and state inconsistencies.
28
- 3. **Repair (Optional)**: If `--repair` is set, apply safe automated fixes for detected issues.
29
- 4. **Report Findings**: Categorize results into Errors (must fix), Warnings (should fix), and Info.
30
- 5. **Audit**: Log `health_check_completed` with counts of errors, warnings, and repairs.
31
- </process>
16
+ ## Sovereign Intelligence Checks (v6.2.0-alpha)
17
+ - **PQAS Verification**: Check `bin/governance/quantum-crypto.js` presence
18
+ - **Homing Verification**: Check `bin/autonomous/intent-harvester.js` presence
19
+ - **Self-Healer Verification**: Check `bin/autonomous/mesh-self-healer.js` presence
20
+ - **Policy Check**: Verify `bin/governance/policy-engine.js` is Sovereign-configured
21
+
22
+ ## Flags
23
+ - `--repair`: apply safe auto-repair only
24
+ - `--category`: one of `installation|context|skills|personas|state|integrations|security`
25
+ - `--verbose`: include passing checks and exact inspected values
26
+
27
+ ## AUDIT
28
+ Append:
29
+ ```json
30
+ { "event": "health_check_completed", "errors": 0, "warnings": 0, "repaired": 0 }
31
+ ```
@@ -1,29 +1,33 @@
1
1
  ---
2
- name: mindforge:help
3
- description: Show all available MindForge commands and current project summary
4
- argument-hint: none
5
- allowed-tools:
6
- - list_dir
7
- - view_file
2
+ description: Show all available MindForge commands.
8
3
  ---
9
4
 
10
- <objective>
11
- Provide a searchable, categorized directory of all accessible MindForge commands, along with a quick snapshot of the project's current state.
12
- </objective>
5
+ Show all available MindForge commands.
13
6
 
14
- <execution_context>
15
- .claude/commands/mindforge/help.md
16
- </execution_context>
7
+ ## Pre-check
8
+ If `.planning/STATE.md` exists, read it.
9
+ If `.planning/PROJECT.md` is missing, treat the project as "Not initialised".
17
10
 
18
- <context>
19
- Discovery: Scans `.claude/commands/mindforge/*.md`
20
- State: PROJECT.md and STATE.md
21
- </context>
11
+ 1. Scan every .md file in `.claude/commands/mindforge/`
12
+ 2. For each file, extract the first non-empty line as the command description
13
+ 3. Display as a clean table:
22
14
 
23
- <process>
24
- 1. **Command Scan**: List all markdown definitions in the command directory and extract their first-line descriptions or YAML metadata.
25
- 2. **Read Project Info**: Summarize the current project name, active phase, and recommended next step.
26
- 3. **Format Dashboard**: Render a clean table of commands and descriptions.
27
- 4. **Verify Context**: If `CLAUDE.md` hasn't been read in the current session, remind the user to load it as the agent's context.
28
- 5. **Display**: Present the help table and project summary.
29
- </process>
15
+ | Command | Description |
16
+ |------------------------------|----------------------------------------------|
17
+ | /mindforge:help | Show all available commands |
18
+ | /mindforge:init-project | ... |
19
+ | ... | ... |
20
+
21
+ ## Sovereign Intelligence (v6.2.0-alpha)
22
+ MindForge now operates with **Sovereign Intelligence** enabled by default:
23
+ - **PQAS**: Post-Quantum Agentic Security is active. High-risk operations require biometric/executive bypass.
24
+ - **Proactive Homing**: The swarm now proactively harvests intent and self-heals reasoning drifts.
25
+ - **Integrity**: Every `security-scan` now verifies framework signatures using lattice-based cryptography.
26
+
27
+ 4. After the table, print:
28
+ "Current project: [read PROJECT.md first line, or 'Not initialised']"
29
+ "Current phase: [read STATE.md current phase, or 'None']"
30
+ "Next step: [read STATE.md next action]"
31
+
32
+ 5. If CLAUDE.md has not been read this session, remind the user to ensure
33
+ it is loaded as MindForge's system context.
@@ -1,37 +1,135 @@
1
1
  ---
2
- name: mindforge:init-org
3
- description: Set up MindForge at the organization level with standardized context
4
- argument-hint: [--org-name "Name"] [--update]
5
- allowed-tools:
6
- - run_command
7
- - list_dir
8
- - write_to_file
9
- - view_file
2
+ description: Set up MindForge at the organisation level — create standardised org-level
10
3
  ---
11
4
 
12
- <objective>
13
- Establish a consistent engineering culture and governance framework by generating organization-wide context files, security policies, and tech stack defaults for all projects.
14
- </objective>
15
-
16
- <execution_context>
17
- .claude/commands/mindforge/init-org.md
18
- </execution_context>
19
-
20
- <context>
21
- Scope: Organization-wide (Tier 1/2).
22
- Output: Shared `.mindforge/org/` repository or npm package.
23
- Governance: Defines Tier 2/3 approver lists and compliance burdens.
24
- </context>
25
-
26
- <process>
27
- 1. **Interview**: Conduct a structured interview about org identity, tech stack, deployment defaults, and compliance (GDPR, HIPAA, etc.).
28
- 2. **Generate Defaults**:
29
- - `ORG.md`: Mission and global architecture defaults.
30
- - `CONVENTIONS.md`: Tech-stack-specific coding standards.
31
- - `SECURITY.md`: Compliance-mapped security policies.
32
- - `TOOLS.md`: Approved library and dependency list.
33
- 3. **Configuration**: Pre-populate `INTEGRATIONS-CONFIG.md` and `GOVERNANCE-CONFIG.md`.
34
- 4. **Skill Recommendation**: Suggest core and compliance skills to install org-wide.
35
- 5. **Distribution**: Offer to package the configuration into an npm package for project-wide inheritance.
36
- 6. **Audit**: Log `org_initialised` with frameworks and recommended skills.
37
- </process>
5
+ # MindForge — Init Org Command
6
+ # Usage: /mindforge:init-org [--org-name "Name"] [--update]
7
+
8
+ ## Purpose
9
+ Set up MindForge at the organisation level — create standardised org-level
10
+ context files that are shared across ALL projects in the organisation.
11
+
12
+ Intended to be run ONCE by a platform engineer or engineering lead.
13
+ Output is committed to a shared `mindforge-org-config` repository
14
+ and distributed to projects as a git submodule or npm package.
15
+
16
+ ## Step 1 Gather org information
17
+
18
+ Ask (one question at a time):
19
+ 1. "What is your organisation name?"
20
+ 2. "Describe what your organisation builds in 1-2 sentences."
21
+ 3. "What is your primary tech stack? (describe in plain English)"
22
+ 4. "What is your default deployment target? (AWS / GCP / Azure / self-hosted / hybrid)"
23
+ 5. "What regulatory frameworks apply to your organisation?"
24
+ Options: GDPR / HIPAA / SOC 2 / PCI-DSS / ISO 27001 / None / Multiple
25
+ 6. "What is your source control platform?" (GitHub / GitLab / Bitbucket / Azure DevOps)
26
+ 7. "What is your issue tracker?" (Jira / GitHub Issues / Linear / Azure DevOps / None)
27
+ 8. "Who are your Tier 3 compliance approvers? (email addresses, comma-separated)"
28
+
29
+ ## Step 2 Generate org-level context files
30
+
31
+ Create (or update with `--update`) these files:
32
+
33
+ ### `.mindforge/org/ORG.md`
34
+ Populated from answers with:
35
+ - Organisation identity and mission
36
+ - Default tech stack with version recommendations
37
+ - Architecture defaults
38
+ - Team conventions
39
+ - Compliance requirements
40
+
41
+ ### `.mindforge/org/CONVENTIONS.md`
42
+ Generate sensible defaults based on the tech stack detected.
43
+ For TypeScript/Node.js stacks: strict TypeScript, ESLint, Conventional Commits
44
+ For Python stacks: ruff, mypy, black formatting
45
+ For Go: standard Go toolchain conventions
46
+ Mark each section clearly: [DEFAULT] or [CUSTOMISE THIS]
47
+
48
+ ### `.mindforge/org/SECURITY.md`
49
+ Generate based on declared compliance frameworks:
50
+ - GDPR → include GDPR-specific policies
51
+ - HIPAA → include PHI handling requirements
52
+ - PCI-DSS → include card data handling policies
53
+ - SOC 2 → include access control requirements
54
+ Mark critical sections: [REVIEW WITH SECURITY TEAM]
55
+
56
+ ### `.mindforge/org/TOOLS.md`
57
+ Generate approved library list based on tech stack.
58
+ Include common forbidden libraries (moment.js, request, etc.)
59
+ Mark: [ADD YOUR APPROVED LIBRARIES]
60
+
61
+ ### `.mindforge/org/integrations/INTEGRATIONS-CONFIG.md`
62
+ Pre-populate based on declared platforms:
63
+ - GitHub → fill GitHub config section
64
+ - Jira → fill Jira config section
65
+ Mark credential fields clearly: [SET VIA ENVIRONMENT VARIABLE]
66
+
67
+ ### `.mindforge/governance/GOVERNANCE-CONFIG.md`
68
+ Pre-populate based on declared approvers and compliance frameworks.
69
+ Higher compliance burden → lower Tier 2/3 thresholds.
70
+ Stricter approval SLAs for HIPAA/PCI-DSS organisations.
71
+
72
+ ## Step 3 — Generate skills recommendation
73
+
74
+ Based on the tech stack and compliance requirements, recommend skills to install:
75
+
76
+ ```
77
+ Recommended skills for your tech stack:
78
+
79
+ Core skills (already included — v0.6.0):
80
+ ✅ security-review, code-quality, api-design, testing-standards, documentation,
81
+ performance, accessibility, data-privacy, incident-response, database-patterns
82
+
83
+ Additional skills recommended for your stack:
84
+ [tech-stack-specific recommendations from registry]
85
+
86
+ For your compliance requirements:
87
+ [compliance-specific skill recommendations]
88
+
89
+ Install all recommendations?
90
+ yes → npx mindforge-skills install [list]
91
+ no → I'll show you the install commands for each
92
+ ```
93
+
94
+ ## Step 4 — Create distribution package
95
+
96
+ Offer to create an org-skills npm package for distributing org-level config:
97
+
98
+ ```
99
+ Create `@your-org/mindforge-config` npm package?
100
+ This package will distribute your org-level MindForge configuration
101
+ to all projects in your organisation via: npx @your-org/mindforge-config
102
+
103
+ Files included:
104
+ .mindforge/org/ORG.md
105
+ .mindforge/org/CONVENTIONS.md
106
+ .mindforge/org/SECURITY.md
107
+ .mindforge/org/TOOLS.md
108
+ .mindforge/org/skills/MANIFEST.md
109
+ .mindforge/org/integrations/INTEGRATIONS-CONFIG.md (without credentials)
110
+ .mindforge/governance/GOVERNANCE-CONFIG.md (without credentials)
111
+ ```
112
+
113
+ ## Step 5 — Write AUDIT entry and report
114
+
115
+ ```json
116
+ { "event": "org_initialised", "org_name": "[name]", "compliance_frameworks": [...], "skills_recommended": [...] }
117
+ ```
118
+
119
+ Report:
120
+ ```
121
+ ✅ MindForge organisation configuration complete.
122
+
123
+ Files created:
124
+ .mindforge/org/ORG.md
125
+ .mindforge/org/CONVENTIONS.md
126
+ .mindforge/org/SECURITY.md
127
+ .mindforge/org/TOOLS.md
128
+ .mindforge/governance/GOVERNANCE-CONFIG.md
129
+
130
+ Next steps:
131
+ 1. Review each file — look for [CUSTOMISE THIS] markers
132
+ 2. Fill in SECURITY.md with your security team
133
+ 3. Commit to your org's mindforge-config repository
134
+ 4. Share with all projects: npx @your-org/mindforge-config (if you created the package)
135
+ ```