@dev-symphony/sym 0.1.0

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 ADDED
@@ -0,0 +1,84 @@
1
+ # Symphony MCP Server
2
+
3
+ LLM-friendly convention linter for AI coding tools.
4
+
5
+ ## Installation
6
+
7
+ ### One-line MCP Setup
8
+
9
+ ```bash
10
+ claude mcp add symphony npx @dev-symphony/sym@latest mcp
11
+ ```
12
+
13
+ ### Direct Installation
14
+
15
+ ```bash
16
+ npm install -g @dev-symphony/sym
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### MCP Configuration
22
+
23
+ Add to your MCP config file:
24
+
25
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
26
+ - Windows: `%APPDATA%/Claude/claude_desktop_config.json`
27
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "symphony": {
33
+ "command": "npx",
34
+ "args": ["-y", "@dev-symphony/sym@latest", "mcp"]
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ### Available Tools
41
+
42
+ **query_conventions**
43
+ - Query project conventions by category, files, or languages
44
+ - All parameters are optional
45
+
46
+ **validate_code**
47
+ - Validate code against defined conventions
48
+ - Parameters: files (required)
49
+
50
+ ## Policy File
51
+
52
+ Create `.sym/user-policy.json` in your project root:
53
+
54
+ ```json
55
+ {
56
+ "version": "1.0.0",
57
+ "rules": [
58
+ {
59
+ "say": "Functions should be documented",
60
+ "category": "documentation"
61
+ },
62
+ {
63
+ "say": "Lines should be less than 100 characters",
64
+ "category": "formatting",
65
+ "params": { "max": 100 }
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ## Requirements
72
+
73
+ - Node.js >= 16.0.0
74
+ - Policy file: `.sym/user-policy.json`
75
+
76
+ ## Supported Platforms
77
+
78
+ - macOS (Intel, Apple Silicon)
79
+ - Linux (x64, ARM64)
80
+ - Windows (x64)
81
+
82
+ ## License
83
+
84
+ MIT
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/sym.js ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ /**
8
+ * Get the platform-specific binary name
9
+ */
10
+ function getPlatformBinary() {
11
+ const platform = process.platform;
12
+ const arch = process.arch;
13
+
14
+ const binaryMap = {
15
+ 'darwin-arm64': 'sym-darwin-arm64',
16
+ 'darwin-x64': 'sym-darwin-amd64',
17
+ 'linux-x64': 'sym-linux-amd64',
18
+ 'linux-arm64': 'sym-linux-arm64',
19
+ 'win32-x64': 'sym-windows-amd64.exe',
20
+ };
21
+
22
+ const key = `${platform}-${arch}`;
23
+ const binaryName = binaryMap[key];
24
+
25
+ if (!binaryName) {
26
+ console.error(`Error: Unsupported platform: ${platform}-${arch}`);
27
+ console.error('Supported platforms:');
28
+ Object.keys(binaryMap).forEach(k => console.error(` - ${k}`));
29
+ process.exit(1);
30
+ }
31
+
32
+ return path.join(__dirname, binaryName);
33
+ }
34
+
35
+ /**
36
+ * Main execution
37
+ */
38
+ function main() {
39
+ const binaryPath = getPlatformBinary();
40
+
41
+ if (!fs.existsSync(binaryPath)) {
42
+ console.error(`Error: Binary not found at ${binaryPath}`);
43
+ console.error('');
44
+ console.error('This usually means the binary download failed during installation.');
45
+ console.error('Please try reinstalling:');
46
+ console.error(' npm uninstall @dev-symphony/sym');
47
+ console.error(' npm install @dev-symphony/sym');
48
+ console.error('');
49
+ console.error('If the problem persists, please report an issue at:');
50
+ console.error(' https://github.com/DevSymphony/sym-cli/issues');
51
+ process.exit(1);
52
+ }
53
+
54
+ // Make sure the binary is executable (Unix systems)
55
+ if (process.platform !== 'win32') {
56
+ try {
57
+ fs.chmodSync(binaryPath, '755');
58
+ } catch (err) {
59
+ // Ignore chmod errors, might not have permission
60
+ }
61
+ }
62
+
63
+ // Pass all arguments to the binary
64
+ const args = process.argv.slice(2);
65
+
66
+ const child = spawn(binaryPath, args, {
67
+ stdio: 'inherit',
68
+ windowsHide: true,
69
+ });
70
+
71
+ child.on('error', (err) => {
72
+ console.error(`Error executing binary: ${err.message}`);
73
+ process.exit(1);
74
+ });
75
+
76
+ child.on('exit', (code, signal) => {
77
+ if (signal) {
78
+ process.kill(process.pid, signal);
79
+ } else {
80
+ process.exit(code || 0);
81
+ }
82
+ });
83
+ }
84
+
85
+ main();
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@dev-symphony/sym",
3
+ "version": "0.1.0",
4
+ "description": "Symphony - LLM-friendly convention linter for AI coding assistants",
5
+ "keywords": [
6
+ "mcp",
7
+ "linter",
8
+ "conventions",
9
+ "llm",
10
+ "claude",
11
+ "ai-coding",
12
+ "code-quality"
13
+ ],
14
+ "bin": {
15
+ "sym": "./bin/sym.js"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "README.md"
20
+ ],
21
+ "engines": {
22
+ "node": ">=16.0.0"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/DevSymphony/sym-cli.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/DevSymphony/sym-cli/issues"
30
+ },
31
+ "homepage": "https://github.com/DevSymphony/sym-cli#readme",
32
+ "author": "DevSymphony",
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "https-proxy-agent": "^7.0.2"
36
+ },
37
+ "os": [
38
+ "darwin",
39
+ "linux",
40
+ "win32"
41
+ ],
42
+ "cpu": [
43
+ "x64",
44
+ "arm64"
45
+ ]
46
+ }