codex-plugin-doctor 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Furkan Tasci
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,215 @@
1
+ # Codex Plugin Doctor
2
+
3
+ [![CI](https://github.com/Esquetta/CodexPluginDoctor/actions/workflows/ci.yml/badge.svg)](https://github.com/Esquetta/CodexPluginDoctor/actions/workflows/ci.yml)
4
+
5
+ Codex Plugin Doctor is a local CLI validator for Codex plugin packages, skills, and MCP server bundles.
6
+
7
+ It catches packaging, metadata, security, and runtime protocol problems before a plugin reaches users, teammates, or release workflows.
8
+
9
+ ## Status
10
+
11
+ Codex Plugin Doctor is an early public CLI release.
12
+
13
+ - Primary surface: GitHub repository and npm package
14
+ - Distribution today: `npm install -g`, local source install, `npm link`, `npm pack`, GitHub Releases
15
+ - Public npm package: `codex-plugin-doctor`
16
+ - License: [MIT](./LICENSE)
17
+
18
+ ## Why This Exists
19
+
20
+ Codex plugin packages can fail in several places:
21
+
22
+ - the package manifest is missing or points outside the package root
23
+ - skills exist but do not expose valid `SKILL.md` metadata
24
+ - `.mcp.json` is malformed or references unsafe secrets
25
+ - an MCP server starts but does not complete the protocol handshake
26
+ - tools, resources, or prompts list successfully but fail deeper runtime checks
27
+ - verbose metadata creates noisy matching and unnecessary context cost
28
+
29
+ This tool gives plugin authors a repeatable preflight check before distribution.
30
+
31
+ ## What It Checks
32
+
33
+ Static validation:
34
+
35
+ - required `.codex-plugin/plugin.json`
36
+ - manifest fields: `name`, `version`, `description`
37
+ - skill directory wiring
38
+ - `SKILL.md` presence and frontmatter fields
39
+ - YAML single-line and block-scalar skill descriptions
40
+ - `.mcp.json` structure
41
+ - path traversal risks
42
+ - hard-coded secret-like env values
43
+ - description quality heuristics tuned against real plugin packages
44
+
45
+ Runtime MCP validation with `--runtime`:
46
+
47
+ - `initialize`
48
+ - `notifications/initialized`
49
+ - `tools/list`
50
+ - `tools/call`
51
+ - `resources/list`
52
+ - `resources/read`
53
+ - `resources/templates/list`
54
+ - `prompts/list`
55
+ - `prompts/get`
56
+ - paginated list responses
57
+ - runtime capability scorecard
58
+ - redacted verbose transcript with `--verbose-runtime`
59
+
60
+ Output formats:
61
+
62
+ - human text output
63
+ - JSON reports
64
+ - Markdown reports
65
+ - `--output` file writing
66
+ - CI summary and artifact generation
67
+
68
+ ## Quick Start
69
+
70
+ Global install from npm:
71
+
72
+ ```bash
73
+ npm install -g codex-plugin-doctor
74
+ codex-plugin-doctor check .
75
+ ```
76
+
77
+ Run from source:
78
+
79
+ ```bash
80
+ npm install
81
+ npm run build
82
+ node dist/cli.js check examples/codex-doctor-runtime --runtime
83
+ ```
84
+
85
+ For local global usage:
86
+
87
+ ```bash
88
+ npm link
89
+ codex-plugin-doctor check examples/codex-doctor-runtime --runtime
90
+ ```
91
+
92
+ Generate validation artifacts locally:
93
+
94
+ ```bash
95
+ npm run generate-validation-artifacts -- --target examples/codex-doctor-runtime --runtime-target examples/codex-doctor-runtime --out-dir validation-artifacts-local
96
+ ```
97
+
98
+ ## Example Output
99
+
100
+ Passing runtime package:
101
+
102
+ ```text
103
+ Codex Plugin Doctor
104
+ ===================
105
+ Status: PASS
106
+ Target: <repo>\examples\codex-doctor-runtime
107
+ Summary: 0 fail, 0 warn, 0 total
108
+
109
+ Runtime Scorecard
110
+ ----------------
111
+ initialize: pass
112
+ tools/list: pass
113
+ tools/call: pass
114
+ resources/list: pass
115
+ resources/read: pass
116
+ resources/templates/list: pass
117
+ prompts/list: pass
118
+ prompts/get: pass
119
+
120
+ No findings.
121
+ ```
122
+
123
+ Risky package:
124
+
125
+ ```text
126
+ Codex Plugin Doctor
127
+ ===================
128
+ Status: FAIL
129
+ Target: <repo>\examples\codex-doctor-risky
130
+ Summary: 1 fail, 0 warn, 1 total
131
+
132
+ Failures
133
+ --------
134
+ x plugin.security.hard_coded_secret
135
+ Message: The MCP server `dangerServer` contains a hard-coded secret-like env value for `OPENAI_API_KEY`.
136
+ Impact: Hard-coded credentials inside plugin bundles increase leakage risk and make secure rotation difficult.
137
+ Suggested fix: Replace the literal value for `OPENAI_API_KEY` with an environment reference or injected secret outside the package.
138
+ ```
139
+
140
+ ## Useful Commands
141
+
142
+ ```bash
143
+ codex-plugin-doctor check .
144
+ codex-plugin-doctor check . --json
145
+ codex-plugin-doctor check . --json --output report.json
146
+ codex-plugin-doctor check . --markdown --output report.md
147
+ codex-plugin-doctor check . --ascii
148
+ codex-plugin-doctor check . --no-animations
149
+ codex-plugin-doctor check . --runtime
150
+ codex-plugin-doctor check . --json --runtime --verbose-runtime
151
+ ```
152
+
153
+ ## Repository Layout
154
+
155
+ ```text
156
+ docs/ Product, engineering, security, and release docs
157
+ examples/ Manual plugin packs for local CLI testing
158
+ src/ CLI, validation logic, runtime probing, reports
159
+ tests/ Fixture-based regression tests
160
+ validation-sessions/ Real-world validation waves and tuning notes
161
+ ```
162
+
163
+ ## Validation Evidence
164
+
165
+ The validator is tuned against local fixtures and real marketplace-style plugin packages. See:
166
+
167
+ - [Real-World Validation Workflow](./docs/engineering/real-world-validation-workflow.md)
168
+ - [Validation Sessions](./validation-sessions/README.md)
169
+ - [Examples](./examples/README.md)
170
+
171
+ Recent validation waves covered:
172
+
173
+ - curated Codex plugin cache packages
174
+ - marketplace-style plugin snapshots
175
+ - YAML block-scalar skill metadata
176
+ - media and visual workflow metadata
177
+
178
+ ## Release Readiness
179
+
180
+ Release preparation is reproducible from the repository:
181
+
182
+ ```bash
183
+ npm run prepare-release
184
+ ```
185
+
186
+ This runs tests, builds the TypeScript output, and performs `npm pack --dry-run`.
187
+
188
+ Related docs:
189
+
190
+ - [Changelog](./CHANGELOG.md)
191
+ - [NPM Release Checklist](./docs/engineering/npm-release-checklist.md)
192
+ - [Release Candidate Workflow](./docs/engineering/release-candidate-workflow.md)
193
+ - [v0.1.0 Release Notes](./docs/engineering/v0.1.0-final-release-notes.md)
194
+
195
+ ## Contributing
196
+
197
+ Contributions are welcome once the repository is public. Start with:
198
+
199
+ - [Contributing](./CONTRIBUTING.md)
200
+ - [Security Policy](./SECURITY.md)
201
+ - [Validation tuning issue template](./.github/ISSUE_TEMPLATE/validation_tuning.yml)
202
+
203
+ ## Support
204
+
205
+ If this tool saves you time, GitHub stars and sponsorship help signal that the project is worth continuing.
206
+
207
+ - Star the repository on GitHub.
208
+ - Use GitHub Sponsors through the repository funding link.
209
+ - Open validation tuning issues for false positives or false negatives.
210
+
211
+ ## Product Direction
212
+
213
+ Codex Plugin Doctor starts as a Codex-specific validator and can grow into a broader MCP Doctor over time.
214
+
215
+ The immediate goal is not a marketplace, dashboard, or hosted website. The immediate goal is a trustworthy local preflight check for Codex-compatible plugin bundles.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from "./run-cli.js";
3
+ runCli(process.argv.slice(2)).then((exitCode) => {
4
+ process.exitCode = exitCode;
5
+ }).catch((error) => {
6
+ const message = error instanceof Error ? error.message : "Unknown error";
7
+ console.error(`codex-plugin-doctor failed: ${message}`);
8
+ process.exitCode = 2;
9
+ });
@@ -0,0 +1,2 @@
1
+ import type { DiscoveredPackage } from "../domain/types.js";
2
+ export declare function discoverPackage(targetPath: string): Promise<DiscoveredPackage | null>;
@@ -0,0 +1,18 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ export async function discoverPackage(targetPath) {
4
+ const rootPath = path.resolve(targetPath);
5
+ const manifestPath = path.join(rootPath, ".codex-plugin", "plugin.json");
6
+ try {
7
+ const manifestContent = await readFile(manifestPath, "utf8");
8
+ const manifest = JSON.parse(manifestContent);
9
+ return {
10
+ rootPath,
11
+ manifestPath,
12
+ manifest
13
+ };
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ import type { DiscoveredPackage, RuntimeProbeResult } from "../domain/types.js";
2
+ export declare function probeRuntime(discoveredPackage: DiscoveredPackage, options?: {
3
+ startupTimeoutMs?: number;
4
+ transcript?: (line: string) => void;
5
+ }): Promise<RuntimeProbeResult>;