jorgex-stack 1.0.0 → 1.0.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.
Files changed (91) hide show
  1. package/PRD.md +297 -297
  2. package/README.md +56 -58
  3. package/dist/cli.js +7 -2
  4. package/package.json +1 -1
  5. package/stack/agents/orchestrator.md +192 -192
  6. package/stack/agents/tester.md +71 -71
  7. package/stack/commands/xreview.md +80 -80
  8. package/stack/hooks/hooks.json +18 -18
  9. package/stack/scripts/post-pr-review.cjs +156 -156
  10. package/stack/skills/diagnose/SKILL.md +117 -117
  11. package/stack/skills/diagnose/scripts/hitl-loop.template.sh +41 -41
  12. package/stack/skills/find-skills/SKILL.md +133 -133
  13. package/stack/skills/mcp-builder/LICENSE.txt +201 -201
  14. package/stack/skills/mcp-builder/SKILL.md +236 -236
  15. package/stack/skills/mcp-builder/reference/evaluation.md +601 -601
  16. package/stack/skills/mcp-builder/reference/mcp_best_practices.md +249 -249
  17. package/stack/skills/mcp-builder/reference/node_mcp_server.md +969 -969
  18. package/stack/skills/mcp-builder/reference/python_mcp_server.md +718 -718
  19. package/stack/skills/mcp-builder/scripts/connections.py +151 -151
  20. package/stack/skills/mcp-builder/scripts/evaluation.py +373 -373
  21. package/stack/skills/mcp-builder/scripts/example_evaluation.xml +22 -22
  22. package/stack/skills/mcp-builder/scripts/requirements.txt +2 -2
  23. package/stack/skills/obsidian-cli/SKILL.md +106 -106
  24. package/stack/skills/obsidian-markdown/SKILL.md +196 -196
  25. package/stack/skills/obsidian-markdown/references/CALLOUTS.md +58 -58
  26. package/stack/skills/obsidian-markdown/references/EMBEDS.md +63 -63
  27. package/stack/skills/obsidian-markdown/references/PROPERTIES.md +61 -61
  28. package/stack/skills/react-doctor/SKILL.md +19 -19
  29. package/stack/skills/skill-creator/LICENSE.txt +201 -201
  30. package/stack/skills/skill-creator/agents/analyzer.md +274 -274
  31. package/stack/skills/skill-creator/agents/comparator.md +202 -202
  32. package/stack/skills/skill-creator/agents/grader.md +223 -223
  33. package/stack/skills/skill-creator/assets/eval_review.html +146 -146
  34. package/stack/skills/skill-creator/eval-viewer/generate_review.py +471 -471
  35. package/stack/skills/skill-creator/eval-viewer/viewer.html +1325 -1325
  36. package/stack/skills/skill-creator/references/schemas.md +430 -430
  37. package/stack/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
  38. package/stack/skills/skill-creator/scripts/generate_report.py +326 -326
  39. package/stack/skills/skill-creator/scripts/improve_description.py +248 -248
  40. package/stack/skills/skill-creator/scripts/package_skill.py +136 -136
  41. package/stack/skills/skill-creator/scripts/quick_validate.py +102 -102
  42. package/stack/skills/skill-creator/scripts/run_eval.py +310 -310
  43. package/stack/skills/skill-creator/scripts/run_loop.py +332 -332
  44. package/stack/skills/skill-creator/scripts/utils.py +47 -47
  45. package/stack/skills/supabase/SKILL.md +135 -135
  46. package/stack/skills/supabase/assets/feedback-issue-template.md +17 -17
  47. package/stack/skills/supabase/references/skill-feedback.md +17 -17
  48. package/stack/skills/supabase-postgres-best-practices/SKILL.md +64 -64
  49. package/stack/skills/supabase-postgres-best-practices/references/_contributing.md +170 -170
  50. package/stack/skills/supabase-postgres-best-practices/references/_sections.md +39 -39
  51. package/stack/skills/supabase-postgres-best-practices/references/_template.md +34 -34
  52. package/stack/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -55
  53. package/stack/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -49
  54. package/stack/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -46
  55. package/stack/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -44
  56. package/stack/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -41
  57. package/stack/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -46
  58. package/stack/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -54
  59. package/stack/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -53
  60. package/stack/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -50
  61. package/stack/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -50
  62. package/stack/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -56
  63. package/stack/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -68
  64. package/stack/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -50
  65. package/stack/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -54
  66. package/stack/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -45
  67. package/stack/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -55
  68. package/stack/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -55
  69. package/stack/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -44
  70. package/stack/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -40
  71. package/stack/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -48
  72. package/stack/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -43
  73. package/stack/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -45
  74. package/stack/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -80
  75. package/stack/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -46
  76. package/stack/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -59
  77. package/stack/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -55
  78. package/stack/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -55
  79. package/stack/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -61
  80. package/stack/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -54
  81. package/stack/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -50
  82. package/stack/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -63
  83. package/stack/skills/tdd/SKILL.md +109 -109
  84. package/stack/skills/tdd/deep-modules.md +33 -33
  85. package/stack/skills/tdd/interface-design.md +31 -31
  86. package/stack/skills/tdd/mocking.md +59 -59
  87. package/stack/skills/tdd/refactoring.md +10 -10
  88. package/stack/skills/tdd/tests.md +61 -61
  89. package/stack/skills/to-issues/SKILL.md +83 -83
  90. package/stack/skills/to-prd/SKILL.md +72 -72
  91. 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'")