secufusion-mcp 1.2.6 → 1.2.7

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,11 @@
1
+ {
2
+ "name": "sfn",
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",
5
+ "author": {
6
+ "name": "SecuFusion"
7
+ },
8
+ "homepage": "https://www.npmjs.com/package/secufusion-mcp",
9
+ "repository": "https://github.com/sutaryash/secufusion-mcp",
10
+ "license": "ISC"
11
+ }
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Execute the approved implementation plan. Switches to the Coder Persona and writes code precisely as planned, using rejected-pattern memory to avoid past mistakes.
3
+ argument-hint: <ticket-id> e.g. WI-123
4
+ ---
5
+
6
+ You are executing the **sfn:code** command for the SecuFusion spec-driven SDLC.
7
+
8
+ Task: **$ARGUMENTS**
9
+
10
+ **You are now in the IMPLEMENTATION phase.**
11
+
12
+ ## Pre-flight: Plan Check
13
+
14
+ 1. Read `.secufusion/tasks/$ARGUMENTS/plan.md`.
15
+ 2. If the plan file does not exist or has no approval record, **ABORT** and tell the user:
16
+ > ❌ No approved plan found for `$ARGUMENTS`. Please run `/sfn:plan $ARGUMENTS` first.
17
+ 3. Read `.agents/coder.md` to load the **Coder Persona** — your behaviour for this phase is governed by those instructions.
18
+
19
+ ## Phase 1 — Load Rejected Patterns Memory
20
+
21
+ Call `get_pattern_from_task(work_item_id: "$ARGUMENTS")` to retrieve any rejected patterns logged for this task. If patterns exist, internalize them as hard constraints — **do not repeat them under any circumstances.**
22
+
23
+ ## Phase 2 — Implement
24
+
25
+ Execute the plan file step by step:
26
+
27
+ - Follow the file list in the plan exactly. Do not create files outside the plan's scope.
28
+ - On every file that touches multi-tenant data: verify tenant isolation is enforced (row-level WHERE clause, header propagation). If it is not, **stop and flag it** before writing.
29
+ - On every new DB query: check for N+1 patterns and missing indexes. Flag before writing.
30
+ - On every Kafka publish: verify it is async / non-blocking. Flag synchronous calls.
31
+
32
+ After each logical step, call `manage_task(action: "update", work_item_id: "$ARGUMENTS", status: "in_progress", notes: "<what was just completed>")` to track progress.
33
+
34
+ ## Phase 3 — Self-Review
35
+
36
+ Before handing off, perform a fast self-review against the Acceptance Criteria in `plan.md`. For each criterion, confirm it is met with a `file:line` citation.
37
+
38
+ If any criterion is unmet, fix it now before reporting.
39
+
40
+ ## Phase 4 — Handoff
41
+
42
+ Call `manage_task(action: "complete", work_item_id: "$ARGUMENTS")` to mark the task as coded.
43
+
44
+ Report to the user:
45
+ - Files created/modified
46
+ - ACs met (with file:line)
47
+ - Any open risks or deferred items
48
+
49
+ > 🚀 Implementation complete. Run `/sfn:review` to run the zero-tolerance PR gate checks.
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Prime the SecuFusion ecosystem — scan the entire codebase, map the architectural DNA, and write it to .secufusion/dna.json. Run this once when you first clone a repo.
3
+ argument-hint: (no args) — run from the root of the repo
4
+ ---
5
+
6
+ You are executing the **sfn:init** bootstrap command for the SecuFusion ecosystem.
7
+
8
+ **This is a learn-first command.** Your job is to deeply understand THIS project before writing anything. Do not produce generic output — every finding must reflect real `file:line` references from the actual codebase.
9
+
10
+ ## Phase 1 — SCAN the Repository
11
+
12
+ Call the **secufusion-dna-plugin** MCP tools to scan the repository:
13
+
14
+ 1. Call `scan_repository_stack` to identify: language, framework, package manager, microservices, database entities, and build/test commands. Flag if this is a monorepo.
15
+ 2. Call `extract_domain_models` to map all domain entities, their fields, and relationships.
16
+ 3. Call `extract_api_endpoints` to map all REST/GraphQL endpoints, their methods, and owning services.
17
+ 4. Call `extract_event_topics` to map all Kafka/event-bus topics, producers, and consumers.
18
+
19
+ Run all 4 tool calls in a **single message** so they execute concurrently.
20
+
21
+ ## Phase 2 — WRITE the DNA
22
+
23
+ Once all scans complete:
24
+
25
+ 1. Write the combined findings to `.secufusion/dna.json` in the project root. Structure it as:
26
+ ```json
27
+ {
28
+ "scannedAt": "<ISO timestamp>",
29
+ "services": [],
30
+ "domainModels": [],
31
+ "apiEndpoints": [],
32
+ "eventTopics": [],
33
+ "architectureSummary": "<2-3 sentence human-readable summary>"
34
+ }
35
+ ```
36
+ 2. Update the `<MEMORY>` block in `.agents/claude.md`:
37
+ - Set `DNA_LOADED` to `true`
38
+ - Set `LAST_INIT` to the current ISO timestamp
39
+ - Set `ARCHITECTURE_SUMMARY` to the 2-3 sentence summary from above
40
+
41
+ ## Phase 3 — REPORT
42
+
43
+ Summarize what was found:
44
+ - Number of services, domain models, API endpoints, and event topics discovered
45
+ - Any gaps or areas marked `(inferred)` that the human should verify
46
+ - Confirm that `.secufusion/dna.json` was written successfully
47
+
48
+ **Next step for the user:** Run `/sfn:plan <ticket-id>` to start your first task.
@@ -0,0 +1,56 @@
1
+ ---
2
+ description: Architect a solution for a task or Jira ticket using the loaded DNA. Creates a dedicated task workspace, classifies the work, and produces a strict implementation plan awaiting your approval.
3
+ argument-hint: <ticket-id or feature description> e.g. WI-123 or "add user login endpoint"
4
+ ---
5
+
6
+ You are executing the **sfn:plan** command for the SecuFusion spec-driven SDLC.
7
+
8
+ Task / Ticket: **$ARGUMENTS**
9
+
10
+ **You are in the PLANNING phase. Do NOT write any implementation code in this phase.**
11
+
12
+ ## Pre-flight: DNA Check
13
+
14
+ 1. Read `.agents/claude.md` and check the `<MEMORY>` block.
15
+ 2. If `DNA_LOADED` is `false` or `null`, **ABORT immediately** and tell the user:
16
+ > ❌ Project DNA is not loaded. Please run `/sfn:init` first.
17
+
18
+ ## Phase 1 — Initialize the Task Workspace
19
+
20
+ Call `manage_task` with:
21
+ ```
22
+ action: "initialize"
23
+ work_item_id: <the ticket ID or a slugified version of the description>
24
+ ```
25
+ This creates the dedicated workspace folder at `.secufusion/tasks/<id>/` and begins tracking progress. Do not proceed until this call succeeds.
26
+
27
+ ## Phase 2 — Load Context
28
+
29
+ 1. Call `prime_session(work_item_id: <id>)` to efficiently load the project DNA state and relevant architectural context for this specific task.
30
+ 2. Read the `.secufusion-project-spec.json` from the project root to understand the golden rules, constraints, and acceptance criteria boundaries for this project.
31
+
32
+ ## Phase 3 — Classify the Task
33
+
34
+ Call `classify_task` with the task description: **$ARGUMENTS**
35
+
36
+ This formally categorizes the work (Feature, Bug, Refactor, Security, Performance, etc.) and locks in the architectural boundaries. **YIELD after this call.** Output the classification result and ask the user:
37
+
38
+ > ✅ Classification complete. Does this look right? Give me the green signal to proceed with planning.
39
+
40
+ Wait for explicit approval before continuing.
41
+
42
+ ## Phase 4 — Write the Implementation Plan (After Approval)
43
+
44
+ Read `.agents/planner.md` for the Planner Persona instructions and produce a strict, step-by-step implementation plan that includes:
45
+
46
+ - **Acceptance Criteria** (Given/When/Then format, testable)
47
+ - **Scope Boundaries** (what is explicitly OUT of scope)
48
+ - **Files to Create / Modify / Delete**
49
+ - **Architectural Decisions** (with rationale grounded in the DNA)
50
+ - **Risk Flags** (tenant isolation, N+1 risks, missing indexes, Kafka sync calls)
51
+ - **Test Plan**
52
+
53
+ Save the plan to `.secufusion/tasks/<id>/plan.md`.
54
+
55
+ Present the plan and ask:
56
+ > 📋 Plan ready. Review `plan.md` and approve to begin coding with `/sfn:code`.
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Run the zero-tolerance PR gate — 5 mechanical checks (Tenant Isolation, N+1, Missing Index, Kafka Sync, Early Returns) followed by a senior Reviewer Persona sign-off. A PR must pass this before it can be opened.
3
+ argument-hint: <ticket-id> e.g. WI-123
4
+ ---
5
+
6
+ You are executing the **sfn:review** command — the final quality gate before a Pull Request is opened.
7
+
8
+ Task: **$ARGUMENTS**
9
+
10
+ **No PR may be opened until this command returns ✅ APPROVED.**
11
+
12
+ ## Phase 1 — Tier 1: Mechanical Checks (Zero Tolerance)
13
+
14
+ Call `run_pre_pr_checks_with_reviewer_agent` to trigger the `sfn-pr-check` CLI. This runs 5 automated mechanical checks:
15
+
16
+ | Check | Rule |
17
+ |---|---|
18
+ | **Tenant Isolation** | Every multi-tenant query must have a tenant WHERE clause |
19
+ | **N+1 Detection** | No DB calls inside loops |
20
+ | **Missing Index** | No raw `LIKE '%...'` or unindexed sort columns |
21
+ | **Kafka Sync** | No synchronous/blocking Kafka publishes |
22
+ | **Early Returns** | No deeply nested if/else — use guard clauses |
23
+
24
+ **If any check FAILS:** Do NOT proceed to Phase 2. Report the exact violation with `file:line` and tell the user:
25
+ > ❌ Tier 1 gate failed. Fix the violations above and re-run `/sfn:review`.
26
+
27
+ Call `log_rejected_pattern(work_item_id: "$ARGUMENTS", pattern: "<description of the violation>")` to record it in permanent memory so it is never repeated.
28
+
29
+ ## Phase 2 — Tier 2: Reviewer Persona Sign-off
30
+
31
+ Only proceed here if **all 5 Tier 1 checks passed.**
32
+
33
+ Read `.agents/reviewer.md` to load the **Reviewer Persona** and perform a deep architectural review covering:
34
+
35
+ - **Security:** Auth/authz enforcement, input validation, secret handling
36
+ - **Architecture:** Does the change respect bounded context boundaries from the DNA?
37
+ - **Observability:** Adequate logging, tracing, error handling
38
+ - **Contracts:** Are API/event contracts backward-compatible?
39
+ - **Test Coverage:** Are the ACs from the plan actually tested?
40
+
41
+ ## Phase 3 — Verdict
42
+
43
+ If all checks pass:
44
+ > ✅ APPROVED — This change is ready for a Pull Request. Open your PR and reference ticket `$ARGUMENTS`.
45
+
46
+ If any Tier 2 issues are found, list them as **BLOCKER** or **SUGGESTION** and require the user to address blockers before approving.
47
+
48
+ Call `record_retrospective(work_item_id: "$ARGUMENTS", outcome: "<verdict summary>")` to log the review result for future learning.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secufusion-mcp",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "type": "module",
5
5
  "description": "SecuFusion MCP server - developer workflow tooling with guardrails",
6
6
  "main": "index.js",
@@ -9,7 +9,9 @@
9
9
  "index.d.ts",
10
10
  "README.md",
11
11
  ".secufusion-project-spec.json",
12
- "AGENTS.md"
12
+ "AGENTS.md",
13
+ "commands/",
14
+ ".claude-plugin/"
13
15
  ],
14
16
  "bin": {
15
17
  "secufusion-mcp": "index.js"