jorgex-stack 1.0.1 → 1.0.3

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.
Files changed (99) hide show
  1. package/PRD.md +310 -297
  2. package/README.md +68 -56
  3. package/dist/cli.js +37 -3
  4. package/package.json +1 -1
  5. package/stack/agents/code-simplifier.md +21 -10
  6. package/stack/agents/implementer.md +1 -0
  7. package/stack/agents/orchestrator.md +194 -192
  8. package/stack/agents/security-auditor.md +7 -0
  9. package/stack/agents/silent-failure-hunter.md +7 -0
  10. package/stack/agents/test-analyzer.md +7 -0
  11. package/stack/agents/tester.md +71 -71
  12. package/stack/agents/type-design-analyzer.md +1 -1
  13. package/stack/commands/lean-audit.md +59 -0
  14. package/stack/commands/xreview.md +82 -80
  15. package/stack/hooks/hooks.json +18 -18
  16. package/stack/scripts/post-pr-review.cjs +159 -156
  17. package/stack/skills/diagnose/SKILL.md +117 -117
  18. package/stack/skills/diagnose/scripts/hitl-loop.template.sh +41 -41
  19. package/stack/skills/find-skills/SKILL.md +133 -133
  20. package/stack/skills/lean-code/SKILL.md +69 -0
  21. package/stack/skills/mcp-builder/LICENSE.txt +201 -201
  22. package/stack/skills/mcp-builder/SKILL.md +236 -236
  23. package/stack/skills/mcp-builder/reference/evaluation.md +601 -601
  24. package/stack/skills/mcp-builder/reference/mcp_best_practices.md +249 -249
  25. package/stack/skills/mcp-builder/reference/node_mcp_server.md +969 -969
  26. package/stack/skills/mcp-builder/reference/python_mcp_server.md +718 -718
  27. package/stack/skills/mcp-builder/scripts/connections.py +151 -151
  28. package/stack/skills/mcp-builder/scripts/evaluation.py +373 -373
  29. package/stack/skills/mcp-builder/scripts/example_evaluation.xml +22 -22
  30. package/stack/skills/mcp-builder/scripts/requirements.txt +2 -2
  31. package/stack/skills/obsidian-cli/SKILL.md +106 -106
  32. package/stack/skills/obsidian-markdown/SKILL.md +196 -196
  33. package/stack/skills/obsidian-markdown/references/CALLOUTS.md +58 -58
  34. package/stack/skills/obsidian-markdown/references/EMBEDS.md +63 -63
  35. package/stack/skills/obsidian-markdown/references/PROPERTIES.md +61 -61
  36. package/stack/skills/react-doctor/SKILL.md +19 -19
  37. package/stack/skills/skill-creator/LICENSE.txt +201 -201
  38. package/stack/skills/skill-creator/agents/analyzer.md +274 -274
  39. package/stack/skills/skill-creator/agents/comparator.md +202 -202
  40. package/stack/skills/skill-creator/agents/grader.md +223 -223
  41. package/stack/skills/skill-creator/assets/eval_review.html +146 -146
  42. package/stack/skills/skill-creator/eval-viewer/generate_review.py +471 -471
  43. package/stack/skills/skill-creator/eval-viewer/viewer.html +1325 -1325
  44. package/stack/skills/skill-creator/references/schemas.md +430 -430
  45. package/stack/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
  46. package/stack/skills/skill-creator/scripts/generate_report.py +326 -326
  47. package/stack/skills/skill-creator/scripts/improve_description.py +248 -248
  48. package/stack/skills/skill-creator/scripts/package_skill.py +136 -136
  49. package/stack/skills/skill-creator/scripts/quick_validate.py +102 -102
  50. package/stack/skills/skill-creator/scripts/run_eval.py +310 -310
  51. package/stack/skills/skill-creator/scripts/run_loop.py +332 -332
  52. package/stack/skills/skill-creator/scripts/utils.py +47 -47
  53. package/stack/skills/supabase/SKILL.md +135 -135
  54. package/stack/skills/supabase/assets/feedback-issue-template.md +17 -17
  55. package/stack/skills/supabase/references/skill-feedback.md +17 -17
  56. package/stack/skills/supabase-postgres-best-practices/SKILL.md +64 -64
  57. package/stack/skills/supabase-postgres-best-practices/references/_contributing.md +170 -170
  58. package/stack/skills/supabase-postgres-best-practices/references/_sections.md +39 -39
  59. package/stack/skills/supabase-postgres-best-practices/references/_template.md +34 -34
  60. package/stack/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -55
  61. package/stack/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -49
  62. package/stack/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -46
  63. package/stack/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -44
  64. package/stack/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -41
  65. package/stack/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -46
  66. package/stack/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -54
  67. package/stack/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -53
  68. package/stack/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -50
  69. package/stack/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -50
  70. package/stack/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -56
  71. package/stack/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -68
  72. package/stack/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -50
  73. package/stack/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -54
  74. package/stack/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -45
  75. package/stack/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -55
  76. package/stack/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -55
  77. package/stack/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -44
  78. package/stack/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -40
  79. package/stack/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -48
  80. package/stack/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -43
  81. package/stack/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -45
  82. package/stack/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -80
  83. package/stack/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -46
  84. package/stack/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -59
  85. package/stack/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -55
  86. package/stack/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -55
  87. package/stack/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -61
  88. package/stack/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -54
  89. package/stack/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -50
  90. package/stack/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -63
  91. package/stack/skills/tdd/SKILL.md +109 -109
  92. package/stack/skills/tdd/deep-modules.md +33 -33
  93. package/stack/skills/tdd/interface-design.md +31 -31
  94. package/stack/skills/tdd/mocking.md +59 -59
  95. package/stack/skills/tdd/refactoring.md +10 -10
  96. package/stack/skills/tdd/tests.md +61 -61
  97. package/stack/skills/to-issues/SKILL.md +83 -83
  98. package/stack/skills/to-prd/SKILL.md +72 -72
  99. package/upstreams.json +96 -96
@@ -1,151 +1,151 @@
1
- """Lightweight connection handling for MCP servers."""
2
-
3
- from abc import ABC, abstractmethod
4
- from contextlib import AsyncExitStack
5
- from typing import Any
6
-
7
- from mcp import ClientSession, StdioServerParameters
8
- from mcp.client.sse import sse_client
9
- from mcp.client.stdio import stdio_client
10
- from mcp.client.streamable_http import streamablehttp_client
11
-
12
-
13
- class MCPConnection(ABC):
14
- """Base class for MCP server connections."""
15
-
16
- def __init__(self):
17
- self.session = None
18
- self._stack = None
19
-
20
- @abstractmethod
21
- def _create_context(self):
22
- """Create the connection context based on connection type."""
23
-
24
- async def __aenter__(self):
25
- """Initialize MCP server connection."""
26
- self._stack = AsyncExitStack()
27
- await self._stack.__aenter__()
28
-
29
- try:
30
- ctx = self._create_context()
31
- result = await self._stack.enter_async_context(ctx)
32
-
33
- if len(result) == 2:
34
- read, write = result
35
- elif len(result) == 3:
36
- read, write, _ = result
37
- else:
38
- raise ValueError(f"Unexpected context result: {result}")
39
-
40
- session_ctx = ClientSession(read, write)
41
- self.session = await self._stack.enter_async_context(session_ctx)
42
- await self.session.initialize()
43
- return self
44
- except BaseException:
45
- await self._stack.__aexit__(None, None, None)
46
- raise
47
-
48
- async def __aexit__(self, exc_type, exc_val, exc_tb):
49
- """Clean up MCP server connection resources."""
50
- if self._stack:
51
- await self._stack.__aexit__(exc_type, exc_val, exc_tb)
52
- self.session = None
53
- self._stack = None
54
-
55
- async def list_tools(self) -> list[dict[str, Any]]:
56
- """Retrieve available tools from the MCP server."""
57
- response = await self.session.list_tools()
58
- return [
59
- {
60
- "name": tool.name,
61
- "description": tool.description,
62
- "input_schema": tool.inputSchema,
63
- }
64
- for tool in response.tools
65
- ]
66
-
67
- async def call_tool(self, tool_name: str, arguments: dict[str, Any]) -> Any:
68
- """Call a tool on the MCP server with provided arguments."""
69
- result = await self.session.call_tool(tool_name, arguments=arguments)
70
- return result.content
71
-
72
-
73
- class MCPConnectionStdio(MCPConnection):
74
- """MCP connection using standard input/output."""
75
-
76
- def __init__(self, command: str, args: list[str] = None, env: dict[str, str] = None):
77
- super().__init__()
78
- self.command = command
79
- self.args = args or []
80
- self.env = env
81
-
82
- def _create_context(self):
83
- return stdio_client(
84
- StdioServerParameters(command=self.command, args=self.args, env=self.env)
85
- )
86
-
87
-
88
- class MCPConnectionSSE(MCPConnection):
89
- """MCP connection using Server-Sent Events."""
90
-
91
- def __init__(self, url: str, headers: dict[str, str] = None):
92
- super().__init__()
93
- self.url = url
94
- self.headers = headers or {}
95
-
96
- def _create_context(self):
97
- return sse_client(url=self.url, headers=self.headers)
98
-
99
-
100
- class MCPConnectionHTTP(MCPConnection):
101
- """MCP connection using Streamable HTTP."""
102
-
103
- def __init__(self, url: str, headers: dict[str, str] = None):
104
- super().__init__()
105
- self.url = url
106
- self.headers = headers or {}
107
-
108
- def _create_context(self):
109
- return streamablehttp_client(url=self.url, headers=self.headers)
110
-
111
-
112
- def create_connection(
113
- transport: str,
114
- command: str = None,
115
- args: list[str] = None,
116
- env: dict[str, str] = None,
117
- url: str = None,
118
- headers: dict[str, str] = None,
119
- ) -> MCPConnection:
120
- """Factory function to create the appropriate MCP connection.
121
-
122
- Args:
123
- transport: Connection type ("stdio", "sse", or "http")
124
- command: Command to run (stdio only)
125
- args: Command arguments (stdio only)
126
- env: Environment variables (stdio only)
127
- url: Server URL (sse and http only)
128
- headers: HTTP headers (sse and http only)
129
-
130
- Returns:
131
- MCPConnection instance
132
- """
133
- transport = transport.lower()
134
-
135
- if transport == "stdio":
136
- if not command:
137
- raise ValueError("Command is required for stdio transport")
138
- return MCPConnectionStdio(command=command, args=args, env=env)
139
-
140
- elif transport == "sse":
141
- if not url:
142
- raise ValueError("URL is required for sse transport")
143
- return MCPConnectionSSE(url=url, headers=headers)
144
-
145
- elif transport in ["http", "streamable_http", "streamable-http"]:
146
- if not url:
147
- raise ValueError("URL is required for http transport")
148
- return MCPConnectionHTTP(url=url, headers=headers)
149
-
150
- else:
151
- raise ValueError(f"Unsupported transport type: {transport}. Use 'stdio', 'sse', or 'http'")
1
+ """Lightweight connection handling for MCP servers."""
2
+
3
+ from abc import ABC, abstractmethod
4
+ from contextlib import AsyncExitStack
5
+ from typing import Any
6
+
7
+ from mcp import ClientSession, StdioServerParameters
8
+ from mcp.client.sse import sse_client
9
+ from mcp.client.stdio import stdio_client
10
+ from mcp.client.streamable_http import streamablehttp_client
11
+
12
+
13
+ class MCPConnection(ABC):
14
+ """Base class for MCP server connections."""
15
+
16
+ def __init__(self):
17
+ self.session = None
18
+ self._stack = None
19
+
20
+ @abstractmethod
21
+ def _create_context(self):
22
+ """Create the connection context based on connection type."""
23
+
24
+ async def __aenter__(self):
25
+ """Initialize MCP server connection."""
26
+ self._stack = AsyncExitStack()
27
+ await self._stack.__aenter__()
28
+
29
+ try:
30
+ ctx = self._create_context()
31
+ result = await self._stack.enter_async_context(ctx)
32
+
33
+ if len(result) == 2:
34
+ read, write = result
35
+ elif len(result) == 3:
36
+ read, write, _ = result
37
+ else:
38
+ raise ValueError(f"Unexpected context result: {result}")
39
+
40
+ session_ctx = ClientSession(read, write)
41
+ self.session = await self._stack.enter_async_context(session_ctx)
42
+ await self.session.initialize()
43
+ return self
44
+ except BaseException:
45
+ await self._stack.__aexit__(None, None, None)
46
+ raise
47
+
48
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
49
+ """Clean up MCP server connection resources."""
50
+ if self._stack:
51
+ await self._stack.__aexit__(exc_type, exc_val, exc_tb)
52
+ self.session = None
53
+ self._stack = None
54
+
55
+ async def list_tools(self) -> list[dict[str, Any]]:
56
+ """Retrieve available tools from the MCP server."""
57
+ response = await self.session.list_tools()
58
+ return [
59
+ {
60
+ "name": tool.name,
61
+ "description": tool.description,
62
+ "input_schema": tool.inputSchema,
63
+ }
64
+ for tool in response.tools
65
+ ]
66
+
67
+ async def call_tool(self, tool_name: str, arguments: dict[str, Any]) -> Any:
68
+ """Call a tool on the MCP server with provided arguments."""
69
+ result = await self.session.call_tool(tool_name, arguments=arguments)
70
+ return result.content
71
+
72
+
73
+ class MCPConnectionStdio(MCPConnection):
74
+ """MCP connection using standard input/output."""
75
+
76
+ def __init__(self, command: str, args: list[str] = None, env: dict[str, str] = None):
77
+ super().__init__()
78
+ self.command = command
79
+ self.args = args or []
80
+ self.env = env
81
+
82
+ def _create_context(self):
83
+ return stdio_client(
84
+ StdioServerParameters(command=self.command, args=self.args, env=self.env)
85
+ )
86
+
87
+
88
+ class MCPConnectionSSE(MCPConnection):
89
+ """MCP connection using Server-Sent Events."""
90
+
91
+ def __init__(self, url: str, headers: dict[str, str] = None):
92
+ super().__init__()
93
+ self.url = url
94
+ self.headers = headers or {}
95
+
96
+ def _create_context(self):
97
+ return sse_client(url=self.url, headers=self.headers)
98
+
99
+
100
+ class MCPConnectionHTTP(MCPConnection):
101
+ """MCP connection using Streamable HTTP."""
102
+
103
+ def __init__(self, url: str, headers: dict[str, str] = None):
104
+ super().__init__()
105
+ self.url = url
106
+ self.headers = headers or {}
107
+
108
+ def _create_context(self):
109
+ return streamablehttp_client(url=self.url, headers=self.headers)
110
+
111
+
112
+ def create_connection(
113
+ transport: str,
114
+ command: str = None,
115
+ args: list[str] = None,
116
+ env: dict[str, str] = None,
117
+ url: str = None,
118
+ headers: dict[str, str] = None,
119
+ ) -> MCPConnection:
120
+ """Factory function to create the appropriate MCP connection.
121
+
122
+ Args:
123
+ transport: Connection type ("stdio", "sse", or "http")
124
+ command: Command to run (stdio only)
125
+ args: Command arguments (stdio only)
126
+ env: Environment variables (stdio only)
127
+ url: Server URL (sse and http only)
128
+ headers: HTTP headers (sse and http only)
129
+
130
+ Returns:
131
+ MCPConnection instance
132
+ """
133
+ transport = transport.lower()
134
+
135
+ if transport == "stdio":
136
+ if not command:
137
+ raise ValueError("Command is required for stdio transport")
138
+ return MCPConnectionStdio(command=command, args=args, env=env)
139
+
140
+ elif transport == "sse":
141
+ if not url:
142
+ raise ValueError("URL is required for sse transport")
143
+ return MCPConnectionSSE(url=url, headers=headers)
144
+
145
+ elif transport in ["http", "streamable_http", "streamable-http"]:
146
+ if not url:
147
+ raise ValueError("URL is required for http transport")
148
+ return MCPConnectionHTTP(url=url, headers=headers)
149
+
150
+ else:
151
+ raise ValueError(f"Unsupported transport type: {transport}. Use 'stdio', 'sse', or 'http'")