Skip to content

Commit 746b361

Browse files
committed
feat: remove MCP injection, integrate context-stewardship into CLI, cleanup dead code
- Remove all MCP config injection (13 configure*Mcp functions, MCP interfaces, MCP path helpers) - Delete antigravity-scope.ts (100% MCP) - Delete shared/index.ts barrel file (unused) - Remove 11 dead exports from scope files and validators - Make 5 internal exports private (template-source, traceability, ears, mermaid) - Deduplicate formatError across requirements/design/tasks validators - Remove 3 no-op Mermaid validators (flowchart, classDiagram, erDiagram) - Rename mcp-context-injector to phase-context-injector - Create sds stewardship CLI command with 7 subcommands (capabilities, retrieve, store, extract, trace, inject, manage) - Wire stewardship into CLI entry point - Update 4 spec-driven skills with stewardship references (inject mode, richer domains, context sections) - Update template skills and agent guidance - Fix all tests for MCP removal -1796 lines, +216 lines. 157 tests passing.
1 parent bb7ab95 commit 746b361

33 files changed

Lines changed: 466 additions & 1694 deletions

.changeset/release-0-11-0.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": {
3+
"spec-driven-steroids": {
4+
"version": "0.11.0",
5+
"type": "minor"
6+
}
7+
}
8+
}

packages/cli/src/cli/antigravity-scope.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,39 @@
11
import os from "os"
22
import path from "path"
33

4-
/**
5-
* Injection scope options for Gemini CLI platform.
6-
*/
74
export enum GeminiCliInjectionScope {
85
USER = "user",
96
PROJECT = "project",
107
}
118

12-
/**
13-
* Result of Gemini CLI injection operation.
14-
*/
15-
export interface GeminiCliInjectionResult {
16-
scope: GeminiCliInjectionScope
17-
mcpConfigPath: string
18-
skillsPath: string
19-
templatesCopied: boolean
20-
}
21-
22-
/**
23-
* Returns the Gemini CLI global settings file path.
24-
* MCP servers are configured under mcpServers in ~/.gemini/settings.json.
25-
*/
26-
export function getGeminiCliGlobalMcpPath(): string {
27-
return path.join(os.homedir(), ".gemini", "settings.json")
28-
}
29-
30-
/**
31-
* Returns the Gemini CLI global configuration directory path.
32-
*/
339
export function getGeminiCliGlobalConfigDir(): string {
3410
return path.join(os.homedir(), ".gemini")
3511
}
3612

37-
/**
38-
* Returns the Gemini CLI user-level skills directory.
39-
* Skills are stored in ~/.gemini/skills/ for user-level access.
40-
*/
4113
export function getGeminiCliUserSkillsDir(): string {
4214
return path.join(os.homedir(), ".gemini", "skills")
4315
}
4416

45-
/**
46-
* Returns the Gemini CLI agents alias directory.
47-
* This is an alternative location some Gemini CLI versions check.
48-
*/
4917
export function getGeminiCliAgentsAliasDir(): string {
5018
return path.join(os.homedir(), ".agents", "skills")
5119
}
5220

53-
/**
54-
* Returns the Gemini CLI project-level skills directory path.
55-
*/
5621
export function getGeminiCliProjectSkillsDir(targetDir: string): string {
5722
return path.join(targetDir, ".gemini", "skills")
5823
}
5924

60-
/**
61-
* Returns the Gemini CLI project-level settings file path.
62-
*/
63-
export function getGeminiCliProjectMcpPath(targetDir: string): string {
64-
return path.join(targetDir, ".gemini", "settings.json")
65-
}
66-
67-
/**
68-
* Returns the Gemini CLI user-level agents directory.
69-
* Agents are stored in ~/.gemini/agents/ for user-level access.
70-
*/
7125
export function getGeminiCliUserAgentsDir(): string {
7226
return path.join(os.homedir(), ".gemini", "agents")
7327
}
7428

75-
/**
76-
* Returns the Gemini CLI user-level commands directory.
77-
* Commands are stored in ~/.gemini/commands/ for user-level access.
78-
*/
7929
export function getGeminiCliUserCommandsDir(): string {
8030
return path.join(os.homedir(), ".gemini", "commands")
8131
}
8232

83-
/**
84-
* Returns the Gemini CLI project-level agents directory path.
85-
*/
8633
export function getGeminiCliProjectAgentsDir(targetDir: string): string {
8734
return path.join(targetDir, ".gemini", "agents")
8835
}
8936

90-
/**
91-
* Returns the Gemini CLI project-level commands directory path.
92-
*/
9337
export function getGeminiCliProjectCommandsDir(targetDir: string): string {
9438
return path.join(targetDir, ".gemini", "commands")
9539
}
Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
11
import os from "os"
22
import path from "path"
33

4-
/**
5-
* Injection scope options for GitHub Copilot CLI platform.
6-
*/
74
export enum GitHubCopilotCliInjectionScope {
85
USER = "user",
96
PROJECT = "project",
107
}
118

12-
/**
13-
* Result of GitHub Copilot CLI injection operation.
14-
*/
15-
export interface GitHubCopilotCliInjectionResult {
16-
scope: GitHubCopilotCliInjectionScope
17-
mcpConfigPath: string
18-
skillsPath: string
19-
templatesCopied: boolean
20-
}
21-
22-
/**
23-
* Returns the GitHub Copilot CLI global MCP configuration file path.
24-
* Uses ~/.config/github-copilot/mcp.json
25-
*/
26-
export function getGitHubCopilotCliGlobalMcpPath(): string {
27-
if (process.platform === "win32") {
28-
const appData = process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming")
29-
return path.join(appData, "github-copilot", "mcp.json")
30-
}
31-
return path.join(os.homedir(), ".config", "github-copilot", "mcp.json")
32-
}
33-
34-
/**
35-
* Returns the GitHub Copilot CLI global configuration directory path.
36-
*/
379
export function getGitHubCopilotCliGlobalConfigDir(): string {
3810
if (process.platform === "win32") {
3911
const appData = process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming")
@@ -42,10 +14,6 @@ export function getGitHubCopilotCliGlobalConfigDir(): string {
4214
return path.join(os.homedir(), ".config", "github-copilot")
4315
}
4416

45-
/**
46-
* Returns the GitHub Copilot CLI user-level skills directory.
47-
* Skills are stored in ~/.copilot/skills/ for user-level access.
48-
*/
4917
export function getGitHubCopilotCliUserSkillsDir(): string {
5018
if (process.platform === "win32") {
5119
const userProfile = process.env.USERPROFILE || os.homedir()
@@ -54,16 +22,6 @@ export function getGitHubCopilotCliUserSkillsDir(): string {
5422
return path.join(os.homedir(), ".copilot", "skills")
5523
}
5624

57-
/**
58-
* Returns the GitHub Copilot CLI project-level skills directory path.
59-
*/
6025
export function getGitHubCopilotCliProjectSkillsDir(targetDir: string): string {
6126
return path.join(targetDir, ".github", "skills")
6227
}
63-
64-
/**
65-
* Returns the GitHub Copilot CLI project-level MCP configuration file path.
66-
*/
67-
export function getGitHubCopilotCliProjectMcpPath(targetDir: string): string {
68-
return path.join(targetDir, ".github", "mcp.json")
69-
}
Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,12 @@
11
import os from "os";
22
import path from "path";
33

4-
/**
5-
* Injection scope options for GitHub Copilot platforms.
6-
*/
74
export enum GitHubCopilotInjectionScope {
85
PROJECT = "project",
96
GLOBAL = "global",
107
}
118

12-
/**
13-
* Result of GitHub Copilot injection operation.
14-
*/
15-
export interface GitHubCopilotInjectionResult {
16-
scope: GitHubCopilotInjectionScope;
17-
mcpConfigPath: string;
18-
artifactsPath: string;
19-
templatesCopied: boolean;
20-
}
21-
22-
/**
23-
* Returns the VS Code user profile MCP configuration file path.
24-
* On VS Code, global MCP servers are defined in User/mcp.json.
25-
*/
26-
export function getVSCodeUserProfileMcpPath(): string {
27-
if (process.platform === "win32") {
28-
const appData =
29-
process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
30-
return path.join(appData, "Code", "User", "mcp.json");
31-
}
32-
if (process.platform === "darwin") {
33-
return path.join(
34-
os.homedir(),
35-
"Library",
36-
"Application Support",
37-
"Code",
38-
"User",
39-
"mcp.json",
40-
);
41-
}
42-
return path.join(os.homedir(), ".config", "Code", "User", "mcp.json");
43-
}
44-
45-
/**
46-
* Returns the VS Code user profile directory.
47-
*/
48-
export function getVSCodeUserProfileDir(): string {
9+
function getVSCodeUserProfileDir(): string {
4910
if (process.platform === "win32") {
5011
const appData =
5112
process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
@@ -63,67 +24,14 @@ export function getVSCodeUserProfileDir(): string {
6324
return path.join(os.homedir(), ".config", "Code", "User");
6425
}
6526

66-
/**
67-
* Returns the VS Code global prompts directory for GitHub Copilot.
68-
* Custom prompts for Chat UI are stored in User/prompts/.
69-
*/
7027
export function getVSCodeGlobalPromptsDir(): string {
7128
return path.join(getVSCodeUserProfileDir(), "prompts");
7229
}
7330

74-
/**
75-
* Returns the global GitHub Copilot skills directory.
76-
* Skills are stored in ~/.copilot/skills/ regardless of VS Code platform.
77-
*/
7831
export function getCopilotGlobalSkillsDir(): string {
7932
if (process.platform === "win32") {
8033
const userProfile = process.env.USERPROFILE || os.homedir();
8134
return path.join(userProfile, ".copilot", "skills");
8235
}
8336
return path.join(os.homedir(), ".copilot", "skills");
8437
}
85-
86-
/**
87-
* Returns the global GitHub Copilot configuration directory for VS Code.
88-
* DEPRECATED: This path is no longer used for global Copilot injection.
89-
* Use getVSCodeGlobalPromptsDir() for prompts and getCopilotGlobalSkillsDir() for skills.
90-
*/
91-
export function getVSCodeGlobalArtifactsDir(): string {
92-
return path.join(
93-
getVSCodeUserProfileDir(),
94-
"globalStorage",
95-
"github.copilot",
96-
);
97-
}
98-
99-
/**
100-
* Returns the JetBrains global MCP configuration file path.
101-
* Uses the same path as the existing JetBrains MCP configuration.
102-
*/
103-
export function getJetBrainsGlobalMcpPath(): string {
104-
if (process.platform === "win32") {
105-
const localAppData =
106-
process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local");
107-
return path.join(localAppData, "github-copilot", "intellij", "mcp.json");
108-
}
109-
return path.join(
110-
os.homedir(),
111-
".config",
112-
"github-copilot",
113-
"intellij",
114-
"mcp.json",
115-
);
116-
}
117-
118-
/**
119-
* Scope selection prompt options for inquirer.
120-
*/
121-
export const GITHUB_SCOPE_PROMPT_OPTIONS = [
122-
{ name: "Global (recommended)", value: GitHubCopilotInjectionScope.GLOBAL },
123-
{ name: "Project-level", value: GitHubCopilotInjectionScope.PROJECT },
124-
];
125-
126-
/**
127-
* Default injection scope for GitHub Copilot platforms.
128-
*/
129-
export const DEFAULT_GITHUB_SCOPE = GitHubCopilotInjectionScope.GLOBAL;

0 commit comments

Comments
 (0)