secufusion-mcp 2.1.0 → 2.1.2
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.
- package/README.md +43 -5
- package/agents/AGENTS.md +6 -5
- package/agents/planner.md +18 -0
- package/commands/sfn-plan.md +27 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,16 +15,18 @@
|
|
|
15
15
|
| Tool | Phase | What it does |
|
|
16
16
|
|---|---|---|
|
|
17
17
|
| `manage_project_spec` | **Phase 00** — Session Start | Loads `.secufusion-project-spec.json` — full project DNA (ports, repos, domains, coding patterns, golden rules) |
|
|
18
|
-
| `manage_task` | **Phase 0.7 / 1 / 2 / 4** — Task Lifecycle | Creates dynamically named `.secufusion/tasks/{id}-{slug}/` folder
|
|
18
|
+
| `manage_task` | **Phase 0.7 / 1 / 2 / 4** — Task Lifecycle | Creates dynamically named `.secufusion/tasks/{id}-{slug}/` folder (the HOW layer: spec, progress, decisions, files-touched). |
|
|
19
|
+
| `spec_create_intent` | **Phase 1** — Planning | **NEW in v2.1** — Creates the Markdown intent file (the WHY layer: business goal, PM, ACs, polyglot service map). |
|
|
20
|
+
| `spec_read_intent` | **Phase 0 / 1** — Session Start | **NEW in v2.1** — Reads the Markdown intent file and ticks AC checkboxes. |
|
|
21
|
+
| `spec_next_number` | **Phase 1** — Planning | **NEW in v2.1** — Generates the next sequential ID for intent files. |
|
|
19
22
|
| `get_task_history` | **Phase 0 / 1** — Cross-Task Intelligence | Retrieves the full history of a past task before starting similar work |
|
|
20
23
|
| `search_tasks` | **Phase 0 / 1** — Cross-Task Intelligence | Keyword search across all past task files — prevents re-solving solved problems |
|
|
21
24
|
| `get_pattern_from_task` | **Phase 1** — Cross-Task Intelligence | Extracts reusable decisions, file patterns, and test scenarios from a completed task |
|
|
22
25
|
| `manage_branch_state` | Legacy — Branch State | Backward-compatible branch-scoped JSON state tracker (for tasks before `manage_task`) |
|
|
23
26
|
| `log_rejected_pattern` | **Phase 3** — Course Correction | Records bad patterns to `.rejected-patterns.json` so they are never repeated |
|
|
24
|
-
| `(Removed)` | **Phase 4** — PR Handoff | *Replaced by native MD generation protocol in v1.0.58* |
|
|
25
27
|
| `run_pre_pr_checks_with_reviewer_agent` | **Phase 4** — PR Handoff | **NEW** — Unified 3-tier PR gate. Runs mechanical checks, AI file reviews, and context-aware task evaluation in a single pass. |
|
|
26
28
|
| `get_secufusion_rules` | **Setup** | Returns the `AGENTS.md` rules for AI clients that don't natively support MCP Resources |
|
|
27
|
-
| `classify_task` | **Phase 0.5** — Task Classification | **NEW** — Deep multi-pass analysis engine. Classifies any task as `BACKEND_ONLY`, `FRONTEND_ONLY`,
|
|
29
|
+
| `classify_task` | **Phase 0.5** — Task Classification | **NEW** — Deep multi-pass analysis engine. Classifies any task as `BACKEND_ONLY`, `FRONTEND_ONLY`, etc. based on root cause. |
|
|
28
30
|
| `prime_session` | **Phase 0** — Session Start | **NEW** — Hyper-efficient session startup. Combines Phase 00 (spec) and Phase 0 (task) into one call using Thin Indexes to optimize context tokens. |
|
|
29
31
|
| `skill_recommend` | **Phase 1** — Planning | **NEW** — Dynamically recommends and retrieves domain-specific coding skills from `skills-catalog.json`. |
|
|
30
32
|
|
|
@@ -53,9 +55,45 @@ A new standalone Claude plugin has been introduced: **SecuFusion DNA Discovery M
|
|
|
53
55
|
|
|
54
56
|
---
|
|
55
57
|
|
|
56
|
-
## ⚡ The Shift:
|
|
58
|
+
## ⚡ The Shift: "WHY before HOW" Spec-Driven Workflow (v2.1)
|
|
59
|
+
|
|
60
|
+
This is the biggest architectural upgrade to the SecuFusion MCP, fundamentally changing how the AI approaches a new task.
|
|
61
|
+
|
|
62
|
+
### The Problem
|
|
63
|
+
Previously, the AI acted as a blind code-generator. When given a task (e.g. "Add MFA"), it would immediately jump into writing code or initializing tracking infrastructure (`.secufusion/tasks/`), without understanding **why** the feature was being built, who requested it, or the business risk. Furthermore, its AST parsers were limited to Java/TypeScript, leaving Go, Python, or Rust services completely invisible.
|
|
64
|
+
|
|
65
|
+
### The v2.1 Solution: The Two-Layer Architecture
|
|
66
|
+
Every task now requires **two complementary files** that the AI reads together:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
.secufusion/
|
|
70
|
+
├── tasks/WI-2847/ ← HOW layer (code truth, AST-driven, JSON)
|
|
71
|
+
│ ├── progress.json ← pending/completed ACs
|
|
72
|
+
│ └── decisions.json ← architectural decisions log
|
|
73
|
+
│
|
|
74
|
+
└── intents/ ← WHY layer (business truth, human-driven, Markdown)
|
|
75
|
+
└── 0001-WI-2847-add-mfa-enforcement.md
|
|
76
|
+
├── Business Goal ← why is this being built?
|
|
77
|
+
├── PM Owner ← who owns it?
|
|
78
|
+
├── Acceptance Criteria ← tickable checkboxes
|
|
79
|
+
├── Service Map ← polyglot bridge (Go, Python, Rust...)
|
|
80
|
+
└── Risk Assessment ← what breaks if we don't ship?
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### The Polyglot Bridge
|
|
84
|
+
The new `spec_create_intent` tool captures a `services_involved` array that is **language-agnostic**. You can list a Go microservice, a Python Lambda, or a COBOL batch job. The AI reads this declaration and knows those services are in scope without needing a custom AST parser.
|
|
85
|
+
|
|
86
|
+
### The New `/sfn:plan` Flow
|
|
87
|
+
When you type `/sfn:plan WI-2847 Add MFA`:
|
|
88
|
+
1. **The Pushback (Phase 1):** The AI will **NOT** immediately start planning. It will stop and ask you: *"Why are we building this? What business problem does it solve? What is the risk if we don't?"*
|
|
89
|
+
2. **The WHY (Phase 1.5):** You answer, and the AI generates the Markdown intent file (`spec_create_intent`).
|
|
90
|
+
3. **The HOW (Phase 2):** Only then does it initialize the code tracking infrastructure (`manage_task`).
|
|
91
|
+
4. **Context & Classify (Phase 3/4):** The AI loads the AST (`prime_session`), flags architectural risks (`classify_task`), and yields for your approval.
|
|
92
|
+
5. **The Plan (Phase 5):** The AI outputs the strict implementation plan.
|
|
57
93
|
|
|
58
|
-
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## ⚡ The Shift: Problem-Statement Driven → Project-Level Spec Driven
|
|
59
97
|
|
|
60
98
|
### Before (problem-statement driven)
|
|
61
99
|
The AI started every session **cold**. It had zero knowledge of the codebase and relied entirely on the developer feeding context through a work item description. Every session began with implicit questions:
|
package/agents/AGENTS.md
CHANGED
|
@@ -19,10 +19,11 @@ Do not attempt to load all instructions into memory. Based on the current SDLC p
|
|
|
19
19
|
**DYNAMIC ENFORCEMENT**: You must dynamically adhere to these rules at all times. Whether you are starting a fresh task, resuming an interrupted session, or answering a mid-task prompt, you must strictly respect this sequence and never skip ahead.
|
|
20
20
|
|
|
21
21
|
1. **Rule 0 (Pre-requisite to all rules) — Load Project DNA First**: Before ANY other action, call `prime_session(work_item_id: <id>)`. This is Phase 00. Without the project DNA loaded, you are not allowed to reason, classify, plan, or code. Period.
|
|
22
|
-
2. **Rule 1 -
|
|
23
|
-
3. **Rule 2 -
|
|
24
|
-
4. **Rule 3 -
|
|
25
|
-
5. **Rule 4 -
|
|
26
|
-
6. **Rule 5 -
|
|
22
|
+
2. **Rule 1 - Clarify Business Intent (WHY before HOW)**: For any new task, you MUST pause and ask the user for the business intent, goal, and risk. YIELD until this is clarified, then call `spec_create_intent`. Do not initialize task tracking (`manage_task`) until the WHY is captured.
|
|
23
|
+
3. **Rule 2 - ReAct (Reason, Observe, Act) First**: After intent is clarified and DNA is loaded, you MUST deeply reason about the problem statement. Apply the ReAct framework: analyze the problem, observe context, and formulate a high-level solution hypothesis.
|
|
24
|
+
4. **Rule 3 - Classify Second**: Only after you have reasoned through the problem statement, you MUST call the `classify_task` tool. This will formally categorize the task and lock in architectural boundaries.
|
|
25
|
+
5. **Rule 4 - STRICT YIELD (Stop and Wait)**: Immediately after classifying the task, you MUST YIELD YOUR TURN. **DO NOT CHAIN TOOL CALLS.** Output the classification, ask the user for the "green signal," and STOP.
|
|
26
|
+
6. **Rule 5 - Plan Only After Approval**: Only after receiving the "green signal" for the classification are you allowed to propose a detailed implementation plan.
|
|
27
|
+
7. **Rule 6 - Code is the Last Resort (Universal)**: Modifying source code is the absolute final step and may only occur after the implementation plan is approved.
|
|
27
28
|
|
|
28
29
|
---
|
package/agents/planner.md
CHANGED
|
@@ -60,6 +60,24 @@ There are NO circumstances under which Phase 00 can be skipped, abbreviated, or
|
|
|
60
60
|
|
|
61
61
|
The ONLY tool calls permitted before Phase 00 completes are `prime_session`, `manage_project_spec`, and `spec_read_intent`.
|
|
62
62
|
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Phase 0.25 — Clarify and Capture Business Intent (The WHY Layer)
|
|
66
|
+
(TRIGGER: when a **NEW** task, feature, or bug is received that has no existing tracking)
|
|
67
|
+
|
|
68
|
+
Before thinking about *how* to implement the task, you must understand *why* it is needed.
|
|
69
|
+
1. **Analyze** the requested task.
|
|
70
|
+
2. **Ask** the user clarifying questions if the following are not completely clear:
|
|
71
|
+
- Why is this being built? What user or business problem does it solve?
|
|
72
|
+
- What is already there, and is this actually needed?
|
|
73
|
+
- What is the business risk if not delivered?
|
|
74
|
+
3. **YIELD** and wait for the user to clarify the business intent. Do not proceed until the intent is clear.
|
|
75
|
+
|
|
76
|
+
Once the intent is clarified:
|
|
77
|
+
1. Call `manage_task(action: "initialize", ...)` to initialize the task tracking (The HOW layer).
|
|
78
|
+
2. Call `spec_create_intent(...)` to capture the clarified business intent (The WHY layer).
|
|
79
|
+
|
|
80
|
+
Only after both of these are created may you proceed to Phase 0.5.
|
|
63
81
|
|
|
64
82
|
---
|
|
65
83
|
|
package/commands/sfn-plan.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Architect a solution for a task or Jira ticket using the loaded DNA.
|
|
2
|
+
description: Architect a solution for a task or Jira ticket using the loaded DNA. Clarifies business intent, creates a dedicated task workspace, classifies the work, and produces a strict implementation plan awaiting your approval.
|
|
3
3
|
argument-hint: <ticket-id or feature description> e.g. WI-123 or "add user login endpoint"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -15,33 +15,42 @@ Task / Ticket: **$ARGUMENTS**
|
|
|
15
15
|
2. If `DNA_LOADED` is `false` or `null`, **ABORT immediately** and tell the user:
|
|
16
16
|
> ❌ Project DNA is not loaded. Please run `/sfn:init` first.
|
|
17
17
|
|
|
18
|
-
## Phase 1 —
|
|
18
|
+
## Phase 1 — Clarify and Capture Business Intent (The WHY Layer)
|
|
19
19
|
|
|
20
|
+
Before thinking about *how* to implement the task, you must understand *why* it is needed.
|
|
21
|
+
1. Analyze the requested task.
|
|
22
|
+
2. Ask the user clarifying questions if the following are not completely clear:
|
|
23
|
+
- Why is this being built? What user or business problem does it solve?
|
|
24
|
+
- What is already there, and is this actually needed?
|
|
25
|
+
- What is the business risk if not delivered?
|
|
26
|
+
3. **YIELD** and wait for the user to clarify the business intent. Do not proceed to Phase 2 until the intent is clear.
|
|
27
|
+
|
|
28
|
+
Once the intent is clarified, call `spec_create_intent` with:
|
|
29
|
+
- `work_item_id`: the ticket ID or a slugified version of the description
|
|
30
|
+
- `title`: short human-readable title
|
|
31
|
+
- `business_goal`: The clarified business problem it solves.
|
|
32
|
+
- `acceptance_criteria`: Given/When/Then ACs gathered from the ticket/clarification.
|
|
33
|
+
- `services_involved`: **Polyglot service map** — list every service this touches, regardless of language (Java, Go, Python, TypeScript).
|
|
34
|
+
- `risk`: business risk if not delivered.
|
|
35
|
+
|
|
36
|
+
> 💡 This creates `.secufusion/intents/<num>-WI-<id>-<slug>.md` — a human-readable file capturing the WHY.
|
|
37
|
+
|
|
38
|
+
## Phase 2 — Initialize the Task Workspace (The HOW Layer)
|
|
39
|
+
|
|
40
|
+
Now that the *why* is captured, initialize the *how* tracking.
|
|
20
41
|
Call `manage_task` with:
|
|
21
42
|
```
|
|
22
43
|
action: "initialize"
|
|
23
|
-
work_item_id: <
|
|
44
|
+
work_item_id: <same ID as above>
|
|
24
45
|
```
|
|
25
46
|
This creates the dedicated workspace folder at `.secufusion/tasks/<id>/` and begins tracking progress. Do not proceed until this call succeeds.
|
|
26
47
|
|
|
27
|
-
## Phase
|
|
28
|
-
|
|
29
|
-
Immediately after `manage_task` initializes, call `spec_create_intent` with:
|
|
30
|
-
- `work_item_id`: same ID as above
|
|
31
|
-
- `title`: short human-readable title
|
|
32
|
-
- `business_goal`: **Ask the user** if not provided — "Why is this being built? What user or business problem does it solve?"
|
|
33
|
-
- `acceptance_criteria`: Given/When/Then ACs gathered from the ticket
|
|
34
|
-
- `services_involved`: **Polyglot service map** — list every service this touches, regardless of language (Java, Go, Python, TypeScript). This is how Go/Rust/Python services are tracked even without AST parsers.
|
|
35
|
-
- `risk`: business risk if not delivered
|
|
36
|
-
|
|
37
|
-
> 💡 This creates `.secufusion/intents/<num>-WI-<id>-<slug>.md` — a human-readable file capturing the WHY. The JSON task folder captures the HOW. Together they give a complete picture.
|
|
38
|
-
|
|
39
|
-
## Phase 2 — Load Context
|
|
48
|
+
## Phase 3 — Load Context
|
|
40
49
|
|
|
41
50
|
1. Call `prime_session(work_item_id: <id>)` to efficiently load the project DNA state and relevant architectural context for this specific task.
|
|
42
51
|
2. Read the `.secufusion-project-spec.json` from the project root to understand the golden rules, constraints, and acceptance criteria boundaries for this project.
|
|
43
52
|
|
|
44
|
-
## Phase
|
|
53
|
+
## Phase 4 — Classify the Task
|
|
45
54
|
|
|
46
55
|
Call `classify_task` with the task description: **$ARGUMENTS**
|
|
47
56
|
|
|
@@ -51,7 +60,7 @@ This formally categorizes the work (Feature, Bug, Refactor, Security, Performanc
|
|
|
51
60
|
|
|
52
61
|
Wait for explicit approval before continuing.
|
|
53
62
|
|
|
54
|
-
## Phase
|
|
63
|
+
## Phase 5 — Write the Implementation Plan (After Approval)
|
|
55
64
|
|
|
56
65
|
Read `.agents/planner.md` for the Planner Persona instructions and produce a strict, step-by-step implementation plan that includes:
|
|
57
66
|
|