secufusion-mcp 1.2.8 → 2.0.1

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "//": "Committed plugin settings for Claude Code.",
3
+ "//1": "Applies to every teammate on install.",
4
+ "//2": "Personal overrides: .claude/settings.local.json",
5
+ "attribution": {
6
+ "commit": "",
7
+ "pr": ""
8
+ }
9
+ }
@@ -1,11 +1,10 @@
1
1
  {
2
- "name": "",
3
- "description": "SecuFusion MCP — a spec-driven, zero-trust SDLC agent for enterprise codebases. Enforces the ReAct reasoning loop, architectural DNA mapping, and zero-tolerance PR gate checks via the 4-command pipeline: /sfn:init, /sfn:plan, /sfn:code, /sfn:review.",
4
- "version": "1.2.6",
2
+ "name": "secufusion-mcp",
3
+ "description": "SecuFusion MSSP platform dev agent — project-level spec driven, tenant-isolation enforced, zero-trust guardrails. Slash commands: /sfn:task (classify+plan+init), /sfn:resume (instant context restore), /sfn:build (implement AC), /sfn:checks (pre-PR gates), /sfn:review (adversarial review), /sfn:pr (ADO+PR docs), /sfn:retro (retrospective), /sfn:init (dynamic DNA generation), /sfn:refresh (update stale docs), /sfn:doctor (health check), /sfn:estate (cross-service map), /sfn:impact (blast radius), /sfn:status (dashboard), /sfn:search (past tasks).",
4
+ "version": "2.0.0",
5
5
  "author": {
6
- "name": "SecuFusion"
6
+ "name": "Motivity Labs"
7
7
  },
8
- "homepage": "https://www.npmjs.com/package/secufusion-mcp",
9
- "repository": "https://github.com/sutaryash/secufusion-mcp",
8
+ "homepage": "https://github.com/MLMCPS/secufusion-mcp",
10
9
  "license": "ISC"
11
10
  }
package/.mcp.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "//": "MCP server bundled WITH the plugin. ${CLAUDE_PLUGIN_ROOT}",
3
+ "//1": "resolves wherever plugin is installed — no absolute paths,",
4
+ "//2": "no per-machine configuration, works on fresh clone.",
5
+ "//3": "",
6
+ "//4": "--root . means server reads whichever repo session is in.",
7
+ "//5": "This replaces the npx -y hack and claude_desktop_config",
8
+ "//6": "absolute path entries. One install, works everywhere.",
9
+ "mcpServers": {
10
+ "secufusion-mcp": {
11
+ "command": "node",
12
+ "args": [
13
+ "${CLAUDE_PLUGIN_ROOT}/mcp/dist/server.js",
14
+ "--root",
15
+ "."
16
+ ]
17
+ }
18
+ }
19
+ }
package/README.md CHANGED
@@ -838,12 +838,159 @@ Proceeding to plan presentation. No developer confirmation needed.
838
838
  | **Guardrails** | Mixed soft/hard language | All `should` → `MUST`, all `avoid` → `FORBIDDEN`, linter errors explicitly blocking |
839
839
  | **Cross-Task Intelligence** | Prose bullets | MANDATORY STEP 1-4 sequence + ❌ list |
840
840
 
841
+
842
+ ---
843
+
844
+ ## 🏗️ v2.0.0 — Native Claude Plugin Architecture
845
+
846
+ `secufusion-mcp@2.0.0` is a **complete architectural rebuild** of the MCP server into a native Claude Plugin. It unifies the MCP server, slash commands, personas, and hooks into a single self-contained, portable package following the enterprise-grade `ml-specs` plugin standard.
847
+
848
+ ### What Changed
849
+
850
+ | Area | Before (≤ 1.2.8) | After (2.0.0) |
851
+ |---|---|---|
852
+ | **Plugin type** | Standalone MCP server only | Native Claude Plugin (`.claude-plugin/plugin.json` + `.mcp.json`) |
853
+ | **Slash commands** | Disconnected — no wiring to server | Natively registered — appear in Claude IDE `/` command menu |
854
+ | **Agent personas** | Scattered globally in `.agents/` | Self-contained inside `agents/` within the plugin package |
855
+ | **Path portability** | Hardcoded absolute paths | Fully portable via `${CLAUDE_PLUGIN_ROOT}` |
856
+ | **DNA plugin** | Separate `secufusion-dna-plugin` package | Fully merged into `secufusion-mcp` |
857
+ | **TypeScript build** | Root-level compile | Isolated in `mcp/src/` → compiles to `mcp/dist/` |
858
+ | **Repo validation** | Not present | Reads `.secufusion-project-spec.json` to verify all mandatory repos are cloned |
859
+ | **Frontend/ext validation** | Not present | Checks `frontend.repo` and `chrome_extension.repo` from project spec |
860
+
861
+ ### New Package Structure
862
+
863
+ ```
864
+ secufusion-mcp/
865
+ ├── .claude-plugin/
866
+ │ └── plugin.json ← Claude registers this as a native plugin
867
+ ├── .mcp.json ← MCP server wired into the plugin (${CLAUDE_PLUGIN_ROOT} relative)
868
+ ├── agents/ ← All agent personas (planner, coder, reviewer, claude, AGENTS.md)
869
+ ├── commands/ ← All slash command definitions (markdown)
870
+ ├── hooks/ ← Lifecycle hooks (knowledge-drift.sh)
871
+ ├── mcp/
872
+ │ ├── src/
873
+ │ │ ├── server.ts ← Main MCP server logic
874
+ │ │ └── parsers/ ← Polyglot AST parsers (Java, TS, React, Config, Infra...)
875
+ │ ├── dist/ ← Compiled output (what npm ships)
876
+ │ └── tsconfig.json ← Isolated TypeScript config
877
+ ├── scripts/
878
+ │ ├── sfn-pr-check.js ← Pre-PR mechanical guardrail runner
879
+ │ └── utils.js
880
+ └── package.json
881
+ ```
882
+
883
+ ### Merged: SecuFusion DNA Plugin
884
+
885
+ The previously separate `secufusion-dna-plugin` is now fully merged into `secufusion-mcp`. There is no longer a need to install or configure it separately. All DNA discovery tools are available natively:
886
+
887
+ - `scan_repository_stack` — discovers framework/stack and validates repos vs project spec
888
+ - `extract_domain_models` — maps JPA entities and domain objects via AST
889
+ - `extract_api_endpoints` — maps REST/GraphQL endpoints across all services
890
+ - `extract_event_topics` — maps Kafka producers and consumers
891
+ - `start_dna_watcher` — starts continuous background file watcher
892
+
893
+ ### Mandatory Repository Validation
894
+
895
+ During `scan_repository_stack`, the server reads `.secufusion-project-spec.json` and cross-references:
896
+ - All keys under `"microservices"` (e.g., `sfn-auth-api`, `sfn-events-api`)
897
+ - The `"frontend.repo"` value (e.g., `sfn-web-ui`)
898
+ - The `"chrome_extension.repo"` value (e.g., `snf-browser-extn`)
899
+
900
+ If any of these are physically missing from your local workspace folder, a `[WARNING]` is emitted listing exactly which repositories need to be cloned before a complete DNA map can be built.
901
+
902
+ ---
903
+
904
+ ## ⚡ End-to-End Slash Command Workflow
905
+
906
+ Once installed as a native Claude Plugin, all commands appear natively in the Claude IDE `/` command picker. Here is the complete daily workflow:
907
+
908
+ ### 🔁 Day Start — Setup & Discovery
909
+
910
+ | Command | When to run | What it does |
911
+ |---|---|---|
912
+ | `/sfn-init` | First thing in the morning, or on a new machine | Scans your entire workspace, validates all mandatory repos are cloned against `.secufusion-project-spec.json`, parses AST across all services (Java, TypeScript, React), and builds `.secufusion/dna.json` — the living knowledge graph |
913
+ | `/watch-dna` | Right after `/sfn-init` | Starts the `chokidar` background file watcher. From this point, every file save automatically re-triggers the relevant AST parser and keeps `dna.json` fresh — no manual re-runs needed |
914
+
915
+ > **Mono-folder rule:** Keep all microservices, frontend, and extension repos inside one parent folder (e.g., `C:\Users\Yash\Desktop\secufi_full\`). The agent uses the parent folder as the ecosystem root and scans all siblings automatically.
916
+
917
+ ---
918
+
919
+ ### 📋 Phase 1 — Plan a Ticket
920
+
921
+ | Command | When to run | What it does |
922
+ |---|---|---|
923
+ | `/sfn-plan <ticket-id or description>` | When you receive a new Azure DevOps ticket | Agent enters the `planner.md` persona. Reads `.secufusion-project-spec.json` for golden rules and coding patterns. Reads `dna.json` to determine which microservice owns the change. Outputs a structured `plan.md` with exact files to touch, rollback strategy, and breaking change scan. **Stops and waits for your green light.** |
924
+
925
+ > **Why it stops:** This enforces the non-negotiable Rule 3 — `STRICT YIELD`. The agent must not start coding until you explicitly say "proceed".
926
+
927
+ **Example:**
928
+ ```
929
+ /sfn-plan TASK-2847: Add MFA enforcement for admin users on login
930
+ ```
931
+
932
+ ---
933
+
934
+ ### 🛠️ Phase 2 — Build the Feature
935
+
936
+ | Command | When to run | What it does |
937
+ |---|---|---|
938
+ | `/sfn-code` | After you approve the plan | Agent switches to the `coder.md` persona and begins implementing **strictly according to the approved plan**. Enforces all coding patterns (correct `@Transactional` style, Tenant ID scoping, DTO mapping, Lombok style, exception handling). Every architectural mistake is immediately logged to `.rejected-patterns.json`. |
939
+
940
+ ---
941
+
942
+ ### ✅ Phase 3 — Review & Gate
943
+
944
+ | Command | When to run | What it does |
945
+ |---|---|---|
946
+ | `/sfn-review` | After coding is done, before opening a PR | Agent enters the adversarial `reviewer.md` persona. Triggers `run_pre_pr_checks` — a 3-tier AST-level gate: (1) Mechanical guardrails (tenant isolation, N+1 queries, hardcoded URLs), (2) AI file-by-file code review, (3) Context-aware task evaluation against your spec. **Blocks the PR if Tier 1 violations are found.** |
947
+
948
+ ---
949
+
950
+ ### 🔍 Phase 4 — Architecture Discovery
951
+
952
+ These commands can be run at any time to explore your codebase, independent of any active task.
953
+
954
+ | Command | When to run | What it does |
955
+ |---|---|---|
956
+ | `/blast-radius <component>` | Before refactoring a shared entity, API, or Kafka topic | Reads `dna.json` and calculates exactly which services, endpoints, and consumers will break if the given component is changed. Prevents accidental breaking changes. |
957
+ | `/map-architecture` | When onboarding a new dev or auditing the ecosystem | Generates a comprehensive bird's-eye view of all your services, domains, inter-service call graph, and Kafka topics sourced directly from the DNA graph. |
958
+ | `/analyze` | When debugging a cross-service issue or doing a deep-dive on a subsystem | Performs a deep-dive AST analysis of a specific area, generating detailed dependency and data-flow maps. |
959
+
960
+ ---
961
+
962
+ ### 📊 The Full SDLC Flow at a Glance
963
+
964
+ ```
965
+ Morning
966
+ ↓
967
+ /sfn-init ← Validate all repos, build DNA knowledge graph
968
+ ↓
969
+ /watch-dna ← Background watcher keeps DNA fresh all day
970
+ ↓
971
+ New ticket arrives
972
+ ↓
973
+ /sfn-plan TASK-XXX ← Plan is written + presented → you say "proceed"
974
+ ↓
975
+ /sfn-code ← Feature is implemented per plan, zero-trust guardrails active
976
+ ↓
977
+ /sfn-review ← 3-tier AST gate → PASS or BLOCK with specific violations
978
+ ↓
979
+ PR opened ✅
980
+
981
+ Need to investigate?
982
+ ↓
983
+ /blast-radius ← Impact analysis before any structural change
984
+ /map-architecture ← Full ecosystem overview
985
+ /analyze ← Deep subsystem inspection
986
+ ```
987
+
841
988
  ---
842
989
 
843
990
  ## Requirements
844
991
 
845
992
  - **Node.js** >= 18.0.0
846
- - An MCP-compatible AI client (Antigravity, Claude Desktop, Cursor, Cline, etc.)
993
+ - An MCP-compatible AI client (Antigravity IDE, Claude Desktop, Cursor, Cline, etc.)
847
994
 
848
995
  ---
849
996
 
@@ -5,9 +5,9 @@ You are an elite Senior Developer and Architect. You prioritize robust cross-ser
5
5
  ## Thin Index Routing
6
6
  Do not attempt to load all instructions into memory. Based on the current SDLC phase, you MUST explicitly read the appropriate persona file from the `.agents/` directory:
7
7
 
8
- 1. **Planning Phase (Phase 00 to 1):** Read `[planner.md](file:///C:/Users/Yash/Desktop/mcp/.agents/planner.md)`
9
- 2. **Execution Phase (Phase 2 to 3):** Read `[coder.md](file:///C:/Users/Yash/Desktop/mcp/.agents/coder.md)`
10
- 3. **Review Phase (Phase 4 to 5):** Read `[reviewer.md](file:///C:/Users/Yash/Desktop/mcp/.agents/reviewer.md)`
8
+ 1. **Planning Phase (Phase 00 to 1):** Read `[planner.md](${CLAUDE_PLUGIN_ROOT}/agents/planner.md)`
9
+ 2. **Execution Phase (Phase 2 to 3):** Read `[coder.md](${CLAUDE_PLUGIN_ROOT}/agents/coder.md)`
10
+ 3. **Review Phase (Phase 4 to 5):** Read `[reviewer.md](${CLAUDE_PLUGIN_ROOT}/agents/reviewer.md)`
11
11
 
12
12
  ---
13
13
 
@@ -0,0 +1,50 @@
1
+ # SecuFusion System Prompt & Memory
2
+
3
+ This file serves as the primary system prompt and state memory for Claude when working within the SecuFusion ecosystem.
4
+
5
+ **Rule Zero:** Always check the `<MEMORY>` block below before executing any commands to ensure the project DNA has been loaded.
6
+
7
+ ---
8
+
9
+ ## The 4-Command Pipeline
10
+
11
+ You must strictly execute these commands in the prescribed order by calling the underlying MCP tools or personas.
12
+
13
+ ### 1. `sfn:init`
14
+ **Purpose:** Prime the ecosystem for the first time.
15
+ **Execution Sequence:**
16
+ 1. Call the `secufusion-dna-plugin` tools to scan the repository.
17
+ 2. Generate the architectural map and configuration extracts.
18
+ 3. Update the `<MEMORY>` block in this file with a summary of the architecture and set `DNA_LOADED = true`.
19
+
20
+ ### 2. `sfn:plan [task_id]`
21
+ **Purpose:** Architect the solution based on the loaded DNA and initialize the task workspace.
22
+ **Execution Sequence:**
23
+ 1. Verify `DNA_LOADED == true` in the `<MEMORY>` block. If false, abort and tell the user to run `sfn:init`.
24
+ 2. Call `manage_task(action: "initialize", work_item_id: [task_id])` to create the dedicated task folder (`.secufusion/tasks/[task_id]`) and track progress.
25
+ 3. Call `prime_session` to load the DNA state efficiently.
26
+ 4. Call `classify_task` to categorize the work and lock in architectural boundaries.
27
+ 5. Route to `planner.md` to generate the strict implementation plan.
28
+
29
+ ### 3. `sfn:review`
30
+ **Purpose:** Validate the code against zero-tolerance architectural rules.
31
+ **Execution Sequence:**
32
+ 1. Call the `run_pre_pr_checks_with_reviewer_agent` CLI subprocess (`scripts/sfn-pr-check.ts`).
33
+ 2. Do not proceed until you receive a `✅ APPROVED` verdict from the Tier 1 mechanical checks.
34
+ 3. Route to `reviewer.md` for the final PR Handoff.
35
+
36
+ ### 4. `sfn:watch`
37
+ **Purpose:** Enable continuous background learning.
38
+ **Execution Sequence:**
39
+ 1. Turn on the background file watcher via the DNA engine to automatically detect and index new patterns as the user codes, keeping `.secufusion/dna.json` fresh.
40
+
41
+ ---
42
+
43
+ <MEMORY>
44
+ {
45
+ "DNA_LOADED": false,
46
+ "LAST_INIT": null,
47
+ "ARCHITECTURE_SUMMARY": "Run sfn:init to generate the architectural summary.",
48
+ "ACTIVE_WORK_ITEM": null
49
+ }
50
+ </MEMORY>
@@ -0,0 +1,80 @@
1
+ ## Phase 2 — Execution
2
+ (TRIGGER: as you complete ACs, modify files, make decisions, or before ending any session/response)
3
+
4
+ ### MANDATORY — all four MUST be called, not suggested
5
+
6
+ ```
7
+ After completing any AC:
8
+ → call manage_task(action: "update_spec",
9
+ pending_acs: [...remaining],
10
+ completed_acs: [...done],
11
+ next_step: "<clear, actionable instruction for resuming>")
12
+
13
+ After touching any file:
14
+ → call manage_task(action: "log_file_touched",
15
+ file_path: "<exact path>",
16
+ change_summary: "<one-line description>")
17
+ — call this for EVERY file modified, not just the "important" ones
18
+
19
+ After making any architectural decision:
20
+ → call manage_task(action: "log_decision",
21
+ decision: "<what was decided>",
22
+ rationale: "<why>")
23
+ — call this for every non-obvious decision, not just big ones
24
+
25
+ After finding an optimal/efficient solution for a problem:
26
+ — You must dynamically seek the most optimized, core solution for a given problem statement, even if similar problems have been solved before.
27
+ — Once identified (through reasoning, `get_task_history`, or `get_pattern_from_task`), you MUST add a comment block directly into the source code where the solution is implemented. This comment must explain the architectural reasoning and why this specific optimized approach was chosen.
28
+
29
+ After writing any test scenario:
30
+ → call manage_task(action: "add_scenario",
31
+ scenario: "<description>",
32
+ scenario_type: "unit" | "integration" | "e2e" | "manual")
33
+ ```
34
+
35
+ ### next_step is a contract — hard rules
36
+
37
+ `next_step` MUST be:
38
+ - A single, self-contained instruction your future self executes without re-reading the spec
39
+ - Specific: include file name, method name, or AC number
40
+ - Updated after EVERY response — a stale next_step is a violation
41
+
42
+ `next_step` MUST NOT be:
43
+ - Vague: `"Continue implementation"` ← **VIOLATION**
44
+ - Generic: `"Review the code"` ← **VIOLATION**
45
+ - Empty or missing ← **VIOLATION**
46
+
47
+ ### Hard enforcement
48
+
49
+ ❌ Do NOT end a response without calling `update_spec` if any AC was completed
50
+ ❌ Do NOT modify a file without calling `log_file_touched`
51
+ ❌ Do NOT make an architectural decision without calling `log_decision`
52
+ ❌ Do NOT write a test without calling `add_scenario`
53
+ ❌ Do NOT leave a vague or empty `next_step`
54
+
55
+ ---
56
+
57
+ ## Phase 3 — Course Correction
58
+ (TRIGGER: developer corrects you, rejects an approach, or says "don't do that")
59
+
60
+ ### MANDATORY sequence
61
+
62
+ ```
63
+ STEP 1: call log_rejected_pattern(
64
+ pattern: "<exact bad pattern or approach>",
65
+ reason: "<why rejected and what the correct alternative is>",
66
+ category: "architecture"|"security"|"database"|"logging"|"api-design"|"testing"|"other",
67
+ file_context: "<file where observed, if applicable>")
68
+
69
+ STEP 2: acknowledge the correction explicitly in your response
70
+ STEP 3: do NOT repeat the rejected pattern — ever
71
+ ```
72
+
73
+ ### Hard enforcement
74
+
75
+ ❌ Do NOT wait until end of session to log — log rejected patterns immediately
76
+ ❌ Do NOT continue with the rejected approach while "noting" the correction
77
+ ❌ Do NOT suggest the same pattern again in any future response or session
78
+ ❌ Check `.rejected-patterns.json` implicitly before every architectural suggestion — matching a past rejection makes it forbidden
79
+
80
+ ---