Skip to content

Commit 93ca589

Browse files
author
lucky-216
committed
refactor!: collapse the per-tool pointer formatters; drop windsurf
Six Go types — claudeFormatter, cursorFormatter, copilotFormatter, agentsFormatter, devinFormatter, clineFormatter — existed to write the same content under six filenames, because each IDE has its own "file I always read" convention. The bodies they produced differed by six lines: the filename in the heading, the two `#` banner lines some formats want, and one phrase naming the audience. Everything else came from the same RenderPointer call. They are one table-driven pointerFormatter now. Each tool keeps its legacy full-inline renderer as a plain function, because those do genuinely differ — Claude inlines whole skill bodies, Cline emits REQUIRE/REJECT/ALLOW lines, Devin something else again. Only the pointer half was duplication, and only the pointer half was collapsed. universalFormatter stays its own type: SECURITY-SKILLS.md is not a pointer, it is the single-file human reference that inlines every skill body on purpose. Drop windsurf entirely — the formatter, the renderer, the Registry entry, the --tool value, and dist/.windsurfrules. Cognition folded the Windsurf editor into Devin Desktop on 2026-06-02, so the target named a product that no longer ships. Its users are covered by the devin surface, and by native skills regardless. Formatter code 448 -> 379 lines; Registry 9 -> 8 entries; AllTools 8 -> 7. TestWriteAllRegeneratesAllEightFiles is renamed and now asserts seven reports and that .windsurfrules is not generated, so the surface cannot quietly come back. BREAKING CHANGE: `--tool windsurf` is no longer accepted.
1 parent 3ab514e commit 93ca589

18 files changed

Lines changed: 181 additions & 348 deletions

‎cmd/secure-vibe/cmd/init.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func initCmd() *cobra.Command {
159159
},
160160
}
161161
c.Flags().StringVar(&libraryPath, "library", ".", "library root (default: $SECURE_VIBE_LIBRARY_PATH, else cwd)")
162-
c.Flags().StringVar(&tool, "tool", "", "target tool (claude|cursor|copilot|codex|agents|windsurf|devin|cline|universal)")
162+
c.Flags().StringVar(&tool, "tool", "", "target tool (claude|cursor|copilot|codex|agents|devin|cline|universal)")
163163
c.Flags().StringVar(&skillsList, "skills", "", "comma-separated skill IDs (narrows the --profile selection when combined; both filters apply)")
164164
c.Flags().StringVar(&budget, "budget", "", "tier override (minimal|compact|full)")
165165
c.Flags().StringVar(&outDir, "out", "", "output directory (default: cwd)")

‎cmd/secure-vibe/cmd/regenerate.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func regenerateCmd() *cobra.Command {
4444
// monolithic dist/ output that inlines every skill body
4545
// across all per-tool files (CLAUDE.md, .cursorrules,
4646
// copilot-instructions.md, AGENTS.md, devin.md,
47-
// .windsurfrules, .clinerules). The default since v2 is
47+
// .clinerules). The default since v2 is
4848
// the minimal pointer file documented in pointer.go.
4949
if fullInline || legacy {
5050
ctx.FullInline = true

‎cmd/secure-vibe/internal/compiler/agents.go‎

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,16 @@ package compiler
22

33
import (
44
"fmt"
5-
"strings"
6-
75
"github.com/shieldnet-360/secure-vibe/internal/skill"
6+
"strings"
87
)
98

10-
type agentsFormatter struct{}
11-
12-
func (agentsFormatter) Name() string { return "agents" }
13-
func (agentsFormatter) OutputName() string { return "AGENTS.md" }
14-
func (agentsFormatter) DefaultTier() skill.Tier { return skill.TierCompact }
15-
16-
// Format renders the AGENTS.md distribution file. By default it emits
17-
// the minimal pointer file (target <4 KiB) that the v2 redesign moved
18-
// to; set Context.FullInline to fall back to the legacy monolithic
19-
// output that inlines every skill body.
9+
// Legacy full-inline renderer for AGENTS.md.
2010
//
21-
// The minimal file is intentionally short. It exists so that an LLM
22-
// running in a consumer repo learns:
23-
// 1. there are local skills it should consult,
24-
// 2. how to reach the MCP server for structured lookups, and
25-
// 3. that the file is not a substitute for SAST / SCA / secret scanning.
26-
//
27-
// Anything richer (the full "Always / Never / KFP" body of every skill)
28-
// belongs behind the MCP server, which is auditable and versioned.
29-
func (agentsFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
30-
if ctx.fullInline() {
31-
return renderAgentsFullInline(skills, tier, ctx)
32-
}
33-
return RenderPointer(PointerSpec{
34-
OutputFile: "AGENTS.md",
35-
Audience: "this Codex / OpenAI agents project",
36-
}, skills)
37-
}
38-
11+
// Only reached via --full-inline (alias --legacy). The default
12+
// pointer body for this tool is table-driven in
13+
// pointer_formatters.go — this is the part that is genuinely
14+
// tool-specific and could not be collapsed with the rest.
3915
// renderAgentsFullInline is the pre-v2 monolithic AGENTS.md output. It
4016
// inlines every skill body and remains available via
4117
// `secure-vibe dev regenerate --full-inline` (alias `--legacy`).

‎cmd/secure-vibe/internal/compiler/claude.go‎

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
package compiler
22

33
import (
4-
"strings"
5-
64
"github.com/shieldnet-360/secure-vibe/internal/skill"
5+
"strings"
76
)
87

9-
type claudeFormatter struct{}
10-
11-
func (claudeFormatter) Name() string { return "claude" }
12-
func (claudeFormatter) OutputName() string { return "CLAUDE.md" }
13-
func (claudeFormatter) DefaultTier() skill.Tier { return skill.TierCompact }
14-
15-
// Format renders dist/CLAUDE.md. Since v3 the default output is a
16-
// minimal pointer file (<4 KiB) that names the MCP server and the
17-
// on-disk skills/<id>/SKILL.md tree, matching the design of
18-
// dist/AGENTS.md. The legacy monolithic output that inlines every
19-
// skill body is still available via `secure-vibe dev regenerate
20-
// --full-inline` (alias --legacy) and the corresponding
21-
// Context.FullInline flag.
22-
func (claudeFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
23-
if ctx.fullInline() {
24-
return renderClaudeFullInline(skills, tier, ctx)
25-
}
26-
return RenderPointer(PointerSpec{
27-
OutputFile: "CLAUDE.md",
28-
Audience: "this Claude Code project",
29-
}, skills)
30-
}
31-
8+
// Legacy full-inline renderer for CLAUDE.md.
9+
//
10+
// Only reached via --full-inline (alias --legacy). The default
11+
// pointer body for this tool is table-driven in
12+
// pointer_formatters.go — this is the part that is genuinely
13+
// tool-specific and could not be collapsed with the rest.
3214
func renderClaudeFullInline(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
3315
var b strings.Builder
3416
b.WriteString(Header("Claude Code", tier, len(skills)))

‎cmd/secure-vibe/internal/compiler/cline.go‎

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,16 @@ package compiler
22

33
import (
44
"fmt"
5-
"strings"
6-
75
"github.com/shieldnet-360/secure-vibe/internal/skill"
6+
"strings"
87
)
98

10-
type clineFormatter struct{}
11-
12-
func (clineFormatter) Name() string { return "cline" }
13-
func (clineFormatter) OutputName() string { return ".clinerules" }
14-
func (clineFormatter) DefaultTier() skill.Tier { return skill.TierCompact }
15-
16-
// Format renders dist/.clinerules. Since v3 the default output is a
17-
// minimal pointer file (<4 KiB) matching dist/AGENTS.md. The legacy
18-
// monolithic output that inlines every skill body remains available
19-
// via `secure-vibe dev regenerate --full-inline` (alias --legacy).
20-
func (clineFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
21-
if ctx.fullInline() {
22-
return renderClineFullInline(skills, tier, ctx)
23-
}
24-
return RenderPointer(PointerSpec{
25-
OutputFile: ".clinerules",
26-
Audience: "this Cline / OpenCode workspace",
27-
CommentPrefix: "# ",
28-
}, skills)
29-
}
30-
9+
// Legacy full-inline renderer for .clinerules.
10+
//
11+
// Only reached via --full-inline (alias --legacy). The default
12+
// pointer body for this tool is table-driven in
13+
// pointer_formatters.go — this is the part that is genuinely
14+
// tool-specific and could not be collapsed with the rest.
3115
func renderClineFullInline(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
3216
var b strings.Builder
3317
b.WriteString("# Skills Library — Cline / OpenCode security rules\n")

‎cmd/secure-vibe/internal/compiler/compiler.go‎

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Context struct {
3131
AttackTechniques []string
3232
// FullInline opts every per-tool dist/ file (CLAUDE.md,
3333
// .cursorrules, copilot-instructions.md, AGENTS.md, devin.md,
34-
// .windsurfrules, .clinerules) back into the pre-v2 behaviour
34+
// .clinerules) back into the pre-v2 behaviour
3535
// of inlining every skill body. The default — when this field
3636
// is false — emits a minimal <16 KiB pointer file per tool: a
3737
// per-skill ID and description that lets an agent pick the right
@@ -75,24 +75,32 @@ type Report struct {
7575
BudgetSums map[string]int
7676
}
7777

78-
// Registry maps tool ID -> Formatter. Adding a new tool requires registering
79-
// here and writing a formatter in the same package.
78+
// Registry maps tool ID -> Formatter.
79+
//
80+
// Every entry except "universal" is a pointerFormatter built from a
81+
// table in pointer_formatters.go; adding a tool is a line there, not a
82+
// new Go type. "universal" keeps its own type because
83+
// SECURITY-SKILLS.md is not a pointer at all — it is the single-file
84+
// human reference that inlines every skill body on purpose.
85+
//
86+
// "windsurf" is gone: Cognition folded the Windsurf editor into Devin
87+
// Desktop on 2026-06-02, so the target named a product that no longer
88+
// ships.
8089
var Registry = map[string]Formatter{
81-
"claude": claudeFormatter{},
82-
"cursor": cursorFormatter{},
83-
"copilot": copilotFormatter{},
84-
"agents": agentsFormatter{},
85-
"codex": agentsFormatter{}, // codex consumes AGENTS.md
86-
"windsurf": windsurfFormatter{},
87-
"devin": devinFormatter{},
88-
"cline": clineFormatter{},
90+
"claude": claudeFormatter,
91+
"cursor": cursorFormatter,
92+
"copilot": copilotFormatter,
93+
"agents": agentsFormatter,
94+
"codex": agentsFormatter, // codex consumes AGENTS.md
95+
"devin": devinFormatter,
96+
"cline": clineFormatter,
8997
"universal": universalFormatter{},
9098
}
9199

92-
// AllTools returns the canonical-named formatters (the 8 distribution files).
93-
// "codex" is an alias for "agents" and is not enumerated here.
100+
// AllTools returns the canonical-named formatters (the 7 distribution
101+
// files). "codex" is an alias for "agents" and is not enumerated here.
94102
func AllTools() []Formatter {
95-
names := []string{"claude", "cursor", "copilot", "agents", "windsurf", "devin", "cline", "universal"}
103+
names := []string{"claude", "cursor", "copilot", "agents", "devin", "cline", "universal"}
96104
out := make([]Formatter, 0, len(names))
97105
for _, n := range names {
98106
out = append(out, Registry[n])

‎cmd/secure-vibe/internal/compiler/compiler_test.go‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func TestEachFormatterProducesOutput(t *testing.T) {
8686
// raise the number again.
8787
func TestPerToolDefaultIsPointer(t *testing.T) {
8888
skills := loadAllSkills(t)
89-
perTool := []string{"claude", "cursor", "copilot", "agents", "windsurf", "devin", "cline"}
89+
perTool := []string{"claude", "cursor", "copilot", "agents", "devin", "cline"}
9090
for _, name := range perTool {
9191
t.Run(name, func(t *testing.T) {
9292
out, _, _, err := Compile(skills, name, Registry[name].DefaultTier(), Context{})
@@ -126,7 +126,7 @@ func TestPerToolDefaultIsPointer(t *testing.T) {
126126
// for every per-tool formatter, not only AGENTS.md.
127127
func TestPerToolFullInlineRestoresBodies(t *testing.T) {
128128
skills := loadAllSkills(t)
129-
perTool := []string{"claude", "cursor", "copilot", "agents", "windsurf", "devin", "cline"}
129+
perTool := []string{"claude", "cursor", "copilot", "agents", "devin", "cline"}
130130
for _, name := range perTool {
131131
t.Run(name, func(t *testing.T) {
132132
out, _, _, err := Compile(skills, name, Registry[name].DefaultTier(), Context{FullInline: true})
@@ -246,19 +246,25 @@ func TestUnknownToolErrors(t *testing.T) {
246246
}
247247
}
248248

249-
func TestWriteAllRegeneratesAllEightFiles(t *testing.T) {
249+
// Seven files, not eight: the windsurf surface is gone. Cognition
250+
// folded the Windsurf editor into Devin Desktop on 2026-06-02, so
251+
// .windsurfrules named a product that no longer ships.
252+
func TestWriteAllRegeneratesEveryDistFile(t *testing.T) {
250253
skills := loadAllSkills(t)
251254
outDir := t.TempDir()
252255
reports, _, err := WriteAll(skills, Context{}, outDir)
253256
if err != nil {
254257
t.Fatalf("WriteAll: %v", err)
255258
}
256-
if len(reports) != 8 {
257-
t.Errorf("expected 8 reports, got %d", len(reports))
259+
if len(reports) != 7 {
260+
t.Errorf("expected 7 reports, got %d", len(reports))
261+
}
262+
if _, err := os.Stat(filepath.Join(outDir, ".windsurfrules")); err == nil {
263+
t.Error("windsurf surface should no longer be generated")
258264
}
259265
expected := []string{
260266
"CLAUDE.md", ".cursorrules", "copilot-instructions.md", "AGENTS.md",
261-
".windsurfrules", "devin.md", ".clinerules", "SECURITY-SKILLS.md",
267+
"devin.md", ".clinerules", "SECURITY-SKILLS.md",
262268
}
263269
for _, name := range expected {
264270
p := filepath.Join(outDir, name)

‎cmd/secure-vibe/internal/compiler/copilot.go‎

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,16 @@ package compiler
22

33
import (
44
"fmt"
5-
"strings"
6-
75
"github.com/shieldnet-360/secure-vibe/internal/skill"
6+
"strings"
87
)
98

10-
type copilotFormatter struct{}
11-
12-
func (copilotFormatter) Name() string { return "copilot" }
13-
func (copilotFormatter) OutputName() string { return "copilot-instructions.md" }
14-
func (copilotFormatter) DefaultTier() skill.Tier { return skill.TierCompact }
15-
16-
// Format renders dist/copilot-instructions.md. Since v3 the default
17-
// output is a minimal pointer file (<4 KiB) matching dist/AGENTS.md.
18-
// The legacy monolithic output that inlines every skill body remains
19-
// available via `secure-vibe dev regenerate --full-inline`
20-
// (alias --legacy).
21-
func (copilotFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
22-
if ctx.fullInline() {
23-
return renderCopilotFullInline(skills, tier, ctx)
24-
}
25-
return RenderPointer(PointerSpec{
26-
OutputFile: "copilot-instructions.md",
27-
Audience: "this GitHub Copilot project",
28-
}, skills)
29-
}
30-
9+
// Legacy full-inline renderer for copilot-instructions.md.
10+
//
11+
// Only reached via --full-inline (alias --legacy). The default
12+
// pointer body for this tool is table-driven in
13+
// pointer_formatters.go — this is the part that is genuinely
14+
// tool-specific and could not be collapsed with the rest.
3115
func renderCopilotFullInline(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
3216
var b strings.Builder
3317
b.WriteString(Header("GitHub Copilot", tier, len(skills)))

‎cmd/secure-vibe/internal/compiler/cursor.go‎

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,16 @@ package compiler
22

33
import (
44
"fmt"
5-
"strings"
6-
75
"github.com/shieldnet-360/secure-vibe/internal/skill"
6+
"strings"
87
)
98

10-
type cursorFormatter struct{}
11-
12-
func (cursorFormatter) Name() string { return "cursor" }
13-
func (cursorFormatter) OutputName() string { return ".cursorrules" }
14-
func (cursorFormatter) DefaultTier() skill.Tier { return skill.TierCompact }
15-
16-
// Format renders dist/.cursorrules. Since v3 the default output is a
17-
// minimal pointer file (<4 KiB) matching dist/AGENTS.md. The legacy
18-
// monolithic output that inlines every skill body remains available
19-
// via `secure-vibe dev regenerate --full-inline` (alias --legacy).
20-
func (cursorFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
21-
if ctx.fullInline() {
22-
return renderCursorFullInline(skills, tier, ctx)
23-
}
24-
return RenderPointer(PointerSpec{
25-
OutputFile: ".cursorrules",
26-
Audience: "this Cursor workspace",
27-
CommentPrefix: "# ",
28-
}, skills)
29-
}
30-
9+
// Legacy full-inline renderer for .cursorrules.
10+
//
11+
// Only reached via --full-inline (alias --legacy). The default
12+
// pointer body for this tool is table-driven in
13+
// pointer_formatters.go — this is the part that is genuinely
14+
// tool-specific and could not be collapsed with the rest.
3115
func renderCursorFullInline(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
3216
var b strings.Builder
3317
b.WriteString("# Skills Library — Cursor security rules\n")

‎cmd/secure-vibe/internal/compiler/devin.go‎

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,16 @@ package compiler
22

33
import (
44
"fmt"
5-
"strings"
6-
75
"github.com/shieldnet-360/secure-vibe/internal/skill"
6+
"strings"
87
)
98

10-
type devinFormatter struct{}
11-
12-
func (devinFormatter) Name() string { return "devin" }
13-
func (devinFormatter) OutputName() string { return "devin.md" }
14-
func (devinFormatter) DefaultTier() skill.Tier { return skill.TierFull }
15-
16-
// Format renders dist/devin.md. Since v3 the default output is a
17-
// minimal pointer file (<4 KiB) matching dist/AGENTS.md. The legacy
18-
// monolithic output that inlines every skill body remains available
19-
// via `secure-vibe dev regenerate --full-inline` (alias --legacy).
9+
// Legacy full-inline renderer for devin.md.
2010
//
21-
// The Devin formatter still defaults to TierFull so that callers
22-
// who opt into --full-inline get the richest variant (with the
23-
// per-skill Context blocks); the pointer body itself is
24-
// tier-invariant.
25-
func (devinFormatter) Format(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
26-
if ctx.fullInline() {
27-
return renderDevinFullInline(skills, tier, ctx)
28-
}
29-
return RenderPointer(PointerSpec{
30-
OutputFile: "devin.md",
31-
Audience: "this Devin session",
32-
}, skills)
33-
}
34-
11+
// Only reached via --full-inline (alias --legacy). The default
12+
// pointer body for this tool is table-driven in
13+
// pointer_formatters.go — this is the part that is genuinely
14+
// tool-specific and could not be collapsed with the rest.
3515
func renderDevinFullInline(skills []*skill.Skill, tier skill.Tier, ctx Context) string {
3616
var b strings.Builder
3717
b.WriteString(Header("Devin", tier, len(skills)))

0 commit comments

Comments
 (0)