moflo 4.9.19 → 4.9.21

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 (82) hide show
  1. package/.claude/commands/{simplify.md → flo-simplify.md} +4 -4
  2. package/.claude/guidance/shipped/moflo-agent-rules.md +172 -0
  3. package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
  4. package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
  5. package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
  6. package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
  7. package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
  8. package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
  9. package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
  10. package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
  11. package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
  12. package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
  13. package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
  14. package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
  15. package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
  16. package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
  17. package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
  18. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
  19. package/.claude/guidance/shipped/moflo-subagents.md +43 -114
  20. package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
  21. package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
  22. package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
  23. package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
  24. package/.claude/helpers/gate.cjs +124 -14
  25. package/.claude/helpers/prompt-hook.mjs +4 -38
  26. package/.claude/helpers/simplify-classify.cjs +32 -11
  27. package/.claude/helpers/subagent-bootstrap.json +1 -1
  28. package/.claude/helpers/subagent-start.cjs +1 -1
  29. package/.claude/skills/connector-builder/SKILL.md +42 -429
  30. package/.claude/skills/connector-builder/templates/connector.md +189 -0
  31. package/.claude/skills/connector-builder/templates/step-command.md +176 -0
  32. package/.claude/skills/eldar/SKILL.md +7 -7
  33. package/.claude/skills/fl/SKILL.md +3 -3
  34. package/.claude/skills/fl/execution-modes.md +3 -3
  35. package/.claude/skills/fl/phases.md +3 -3
  36. package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
  37. package/.claude/skills/guidance/SKILL.md +17 -9
  38. package/.claude/skills/memory-patterns/SKILL.md +1 -1
  39. package/.claude/skills/publish/SKILL.md +121 -36
  40. package/.claude/skills/reset-epic/SKILL.md +2 -2
  41. package/.claude/skills/spell-builder/SKILL.md +39 -226
  42. package/.claude/skills/spell-builder/architecture.md +1 -1
  43. package/.claude/skills/spell-builder/permissions.md +107 -0
  44. package/.claude/skills/spell-builder/preflight.md +101 -0
  45. package/.claude/skills/spell-schedule/SKILL.md +2 -3
  46. package/bin/gate.cjs +124 -14
  47. package/bin/prompt-hook.mjs +4 -38
  48. package/bin/session-start-launcher.mjs +66 -1
  49. package/bin/setup-project.mjs +63 -69
  50. package/bin/simplify-classify.cjs +32 -11
  51. package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
  52. package/dist/src/cli/init/claudemd-generator.js +30 -33
  53. package/dist/src/cli/init/executor.js +28 -16
  54. package/dist/src/cli/init/helpers-generator.js +101 -51
  55. package/dist/src/cli/init/moflo-init.js +41 -114
  56. package/dist/src/cli/init/settings-generator.js +32 -14
  57. package/dist/src/cli/services/hook-block-hash.js +7 -2
  58. package/dist/src/cli/services/hook-wiring.js +86 -3
  59. package/dist/src/cli/services/subagent-bootstrap.js +1 -1
  60. package/dist/src/cli/version.js +1 -1
  61. package/package.json +2 -2
  62. package/scripts/post-install-bootstrap.mjs +19 -0
  63. package/.claude/guidance/shipped/moflo-session-start.md +0 -154
  64. package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
  65. package/.claude/skills/browser/SKILL.md +0 -204
  66. package/.claude/skills/github-code-review/SKILL.md +0 -1140
  67. package/.claude/skills/github-multi-repo/SKILL.md +0 -866
  68. package/.claude/skills/github-project-management/SKILL.md +0 -1272
  69. package/.claude/skills/github-release-management/SKILL.md +0 -1074
  70. package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
  71. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  72. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  73. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  74. package/.claude/skills/performance-analysis/SKILL.md +0 -563
  75. package/.claude/skills/skill-builder/SKILL.md +0 -910
  76. package/.claude/skills/sparc-methodology/SKILL.md +0 -904
  77. package/.claude/skills/stream-chain/SKILL.md +0 -563
  78. package/.claude/skills/swarm-advanced/SKILL.md +0 -811
  79. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  80. package/.claude/skills/verification-quality/SKILL.md +0 -649
  81. package/.claude/skills/worker-benchmarks/skill.md +0 -135
  82. package/.claude/skills/worker-integration/skill.md +0 -154
@@ -33,43 +33,9 @@ try {
33
33
  });
34
34
  } catch (err) { output = (err && err.stdout) || ''; }
35
35
 
36
- // Classify prompt for namespace hint
37
- var lower = userPrompt.toLowerCase();
38
-
39
- var LEARNINGS_HINTS = /\b(remember|recall|insight|lesson learned|gotcha|post.?mortem)\b|we (decid|agree|chose|said)/;
40
- var TEST_HINTS = /\b(test|spec|coverage|tested|test case|test cases|tests for|spec for)\b/;
41
- var EXPLICIT_NS = [
42
- { pattern: /\b(pattern|convention|best practice|style|coding rule)\b/, ns: 'patterns', label: 'code patterns and conventions' },
43
- { pattern: /\b(code.?map|file structure|project structure|directory)\b/, ns: 'code-map', label: 'codebase navigation' },
44
- ];
45
- var PATTERN_HINTS = [/\b(template|example|similar to|how do we|how should)\b/];
46
- var DOMAIN_HINTS = [
47
- /\b(guidance|guide|docs|documentation|rules|how-to)\b/,
48
- /\b(architecture|design|domain|tenant|migrat|schema|deploy)/,
49
- /\b(rule|requirement|constraint|compliance)\b/,
50
- ];
51
- var NAV_PATTERNS = [
52
- /\b(find|where|which file|look up|locate|endpoint|route|url|path)\b/,
53
- /\b(class|function|method|component|service|entity|module)\b/,
54
- ];
55
-
56
- var nsHint = '';
57
- if (TEST_HINTS.test(lower)) {
58
- nsHint = 'Memory namespace hint: use "tests" for test inventory and coverage lookups.';
59
- } else if (LEARNINGS_HINTS.test(lower)) {
60
- nsHint = 'Memory namespace hint: use "learnings" for user-directed decisions and distilled insights.';
61
- } else {
62
- var found = EXPLICIT_NS.find(function(e) { return e.pattern.test(lower); });
63
- if (found) {
64
- nsHint = 'Memory namespace hint: use "' + found.ns + '" for ' + found.label + '.';
65
- } else if (DOMAIN_HINTS.some(function(p) { return p.test(lower); })) {
66
- nsHint = 'Memory namespace hint: search "guidance" and "learnings" for domain rules and project decisions.';
67
- } else if (PATTERN_HINTS.some(function(p) { return p.test(lower); })) {
68
- nsHint = 'Memory namespace hint: use "patterns" for code patterns and conventions.';
69
- } else if (NAV_PATTERNS.some(function(p) { return p.test(lower); })) {
70
- nsHint = 'Memory namespace hint: use "code-map" for codebase navigation.';
71
- }
72
- }
36
+ // #931 Namespace hint classification moved into gate.cjs (computed by
37
+ // prompt-reminder, stored on workflow-state.json, emitted once by
38
+ // check-before-agent at Agent-spawn time). No per-prompt token leak now.
73
39
 
74
40
  // #867 — surface post-install restart notice. File is written by
75
41
  // scripts/post-install-notice.mjs and cleared by the SessionStart launcher
@@ -84,6 +50,6 @@ try {
84
50
  }
85
51
  } catch (e) { /* ENOENT or malformed — silent fast-path */ }
86
52
 
87
- var parts = [restartNotice, output.trim(), nsHint].filter(Boolean);
53
+ var parts = [restartNotice, output.trim()].filter(Boolean);
88
54
  if (parts.length) process.stdout.write(parts.join('\n\n') + '\n');
89
55
  process.exit(0);
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * /simplify diff classifier — issue #908.
3
+ * /flo-simplify diff classifier.
4
4
  *
5
5
  * Decides which review tier the current diff warrants and returns a JSON
6
- * dispatch decision. The /simplify skill MUST call this first so routing is
6
+ * dispatch decision. The /flo-simplify skill MUST call this first so routing is
7
7
  * deterministic and unit-testable instead of a prose decision Claude makes
8
8
  * over and over per run.
9
9
  *
10
- * Rule (per user direction): default to single-agent Sonnet review. Only
11
- * escalate to a 3-agent fan-out when diff signals genuinely warrant it.
12
- * Opus is never selected — the existing skill already documents that.
10
+ * Rule: default to single-agent Sonnet review. Only escalate to a 3-agent
11
+ * fan-out when diff signals genuinely warrant it. Opus is never selected —
12
+ * the existing skill already documents that.
13
13
  *
14
14
  * Outputs JSON:
15
15
  * {
@@ -21,7 +21,8 @@
21
21
  * }
22
22
  *
23
23
  * Usage:
24
- * node bin/simplify-classify.cjs [--base main]
24
+ * node bin/simplify-classify.cjs # auto-detects default branch
25
+ * node bin/simplify-classify.cjs --base develop # explicit override
25
26
  * node bin/simplify-classify.cjs --diff <unified-diff-on-stdin>
26
27
  *
27
28
  * The --diff stdin form exists so unit tests can drive the classifier
@@ -31,7 +32,7 @@
31
32
 
32
33
  const { execSync } = require('child_process');
33
34
 
34
- // Paths where new logic warrants the 3-agent fan-out (issue #908).
35
+ // Paths where new logic warrants the 3-agent fan-out.
35
36
  // Mechanical edits inside these paths are still SMALL; only adding/removing
36
37
  // declarations triggers escalation.
37
38
  const SECURITY_PATHS = [
@@ -49,6 +50,25 @@ function safeExec(cmd) {
49
50
  catch { return ''; }
50
51
  }
51
52
 
53
+ // Detect the consumer's default branch. Hardcoding 'main' silently miscalibrates
54
+ // classification on repos that use 'master', 'develop', etc. — empty diff →
55
+ // TRIVIAL → gate stamps clean without any real review.
56
+ let _cachedDefaultBranch = null;
57
+ function detectDefaultBranch() {
58
+ if (_cachedDefaultBranch !== null) return _cachedDefaultBranch;
59
+
60
+ // Preferred: origin/HEAD points to whatever the remote considers default.
61
+ const symbolic = safeExec('git symbolic-ref --short refs/remotes/origin/HEAD').trim();
62
+ if (symbolic.startsWith('origin/')) return (_cachedDefaultBranch = symbolic.slice('origin/'.length));
63
+
64
+ // Fallback: local init.defaultBranch (set by `git init -b <name>` or config).
65
+ const configured = safeExec('git config --get init.defaultBranch').trim();
66
+ if (configured) return (_cachedDefaultBranch = configured);
67
+
68
+ // Last resort: 'main' (most common modern default).
69
+ return (_cachedDefaultBranch = 'main');
70
+ }
71
+
52
72
  function readDiffFromGit(base) {
53
73
  // Combined diff: committed-since-base + working-tree
54
74
  const committed = safeExec(`git diff ${base}...HEAD`);
@@ -186,14 +206,15 @@ function classifyDiff(diffText) {
186
206
  return decide(parseDiff(diffText));
187
207
  }
188
208
 
189
- function classifyFromGit(base = 'main') {
190
- return classifyDiff(readDiffFromGit(base));
209
+ function classifyFromGit(base) {
210
+ const resolved = base || detectDefaultBranch();
211
+ return classifyDiff(readDiffFromGit(resolved));
191
212
  }
192
213
 
193
214
  if (require.main === module) {
194
215
  const args = process.argv.slice(2);
195
216
  const baseIdx = args.indexOf('--base');
196
- const base = baseIdx >= 0 ? args[baseIdx + 1] : 'main';
217
+ const base = baseIdx >= 0 ? args[baseIdx + 1] : detectDefaultBranch();
197
218
  const stdinDiff = args.includes('--diff') || args.includes('--stdin');
198
219
 
199
220
  let result;
@@ -211,4 +232,4 @@ if (require.main === module) {
211
232
  }
212
233
  }
213
234
 
214
- module.exports = { parseDiff, decide, classifyDiff, classifyFromGit };
235
+ module.exports = { parseDiff, decide, classifyDiff, classifyFromGit, detectDefaultBranch };
@@ -1,3 +1,3 @@
1
1
  {
2
- "directive": "MANDATORY FIRST ACTION: Your very first tool call MUST be mcp__moflo__memory_search (any query, any namespace). The memory-first gate WILL BLOCK all Glob, Grep, and Read calls until you do this. After memory search, follow `.claude/guidance/shipped/moflo-subagents.md` protocol."
2
+ "directive": "MANDATORY FIRST ACTION: Your very first tool call MUST be mcp__moflo__memory_search (any query, any namespace). The memory-first gate WILL BLOCK all Glob, Grep, and Read calls until you do this. After memory search, follow `.claude/guidance/moflo-subagents.md` protocol."
3
3
  }
@@ -22,7 +22,7 @@ const path = require('path');
22
22
  // Defense-in-depth copy of the canonical directive in subagent-bootstrap.json.
23
23
  // Kept as a single-line literal so the parity test in tests/bin/subagent-start.test.ts
24
24
  // can verify it matches the JSON via plain substring containment.
25
- const FALLBACK_DIRECTIVE = 'MANDATORY FIRST ACTION: Your very first tool call MUST be mcp__moflo__memory_search (any query, any namespace). The memory-first gate WILL BLOCK all Glob, Grep, and Read calls until you do this. After memory search, follow `.claude/guidance/shipped/moflo-subagents.md` protocol.';
25
+ const FALLBACK_DIRECTIVE = 'MANDATORY FIRST ACTION: Your very first tool call MUST be mcp__moflo__memory_search (any query, any namespace). The memory-first gate WILL BLOCK all Glob, Grep, and Read calls until you do this. After memory search, follow `.claude/guidance/moflo-subagents.md` protocol.';
26
26
 
27
27
  function loadDirective() {
28
28
  const jsonPath = path.join(__dirname, 'subagent-bootstrap.json');