holycodex 0.5.2 → 0.6.1-dev.29547206710.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.
- package/README.md +6 -89
- package/THIRD-PARTY-NOTICES.md +6 -2
- package/bin/holycodex.js +1 -1
- package/dist/cli.js +834 -0
- package/package.json +15 -27
- package/marketplace.json +0 -12
- package/plugin/.codex-plugin/plugin.json +0 -23
- package/plugin/.mcp.json +0 -7
- package/plugin/agents/explorer.toml +0 -6
- package/plugin/agents/librarian.toml +0 -6
- package/plugin/agents/worker.toml +0 -6
- package/plugin/hooks/hooks.json +0 -62
- package/plugin/runtime/bootstrap.js +0 -31
- package/plugin/runtime/cli.js +0 -235
- package/plugin/runtime/core-instructions.js +0 -4
- package/plugin/runtime/git-bash.js +0 -355
- package/plugin/runtime/lsp.js +0 -3665
- package/plugin/runtime/mcp-stdio-core.js +0 -209
- package/plugin/runtime/rules.js +0 -171
- package/plugin/skills/ast-grep/LICENSE +0 -21
- package/plugin/skills/ast-grep/SKILL.md +0 -20
- package/plugin/skills/ast-grep/references/cli.md +0 -3
- package/plugin/skills/ast-grep/references/install.md +0 -3
- package/plugin/skills/ast-grep/references/patterns.md +0 -3
- package/plugin/skills/ast-grep/references/pitfalls.md +0 -3
- package/plugin/skills/ast-grep/references/recipes.md +0 -9
- package/plugin/skills/ast-grep/references/sgconfig.md +0 -3
- package/plugin/skills/ast-grep/references/yaml-rules.md +0 -3
- package/plugin/skills/caveman/LICENSE +0 -21
- package/plugin/skills/caveman/SKILL.md +0 -31
- package/plugin/skills/compress/SKILL.md +0 -18
- package/plugin/skills/debugging/SKILL.md +0 -22
- package/plugin/skills/debugging/references/runtimes/README.md +0 -9
- package/plugin/skills/debugging/references/tools/README.md +0 -8
- package/plugin/skills/define-goal/LICENSE.txt +0 -201
- package/plugin/skills/define-goal/SKILL.md +0 -37
- package/plugin/skills/frontend/ATTRIBUTION.md +0 -218
- package/plugin/skills/frontend/LICENSE-Apache-2.0.txt +0 -201
- package/plugin/skills/frontend/SKILL.md +0 -50
- package/plugin/skills/frontend/references/perfection/README.md +0 -5
- package/plugin/skills/frontend/references/perfection/react-perf-tooling.md +0 -3
- package/plugin/skills/frontend/references/ui-ux-db/README.md +0 -5
- package/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +0 -26
- package/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +0 -162
- package/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +0 -106
- package/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +0 -35
- package/plugin/skills/frontend/references/ui-ux-db/data/products.csv +0 -162
- package/plugin/skills/frontend/references/ui-ux-db/data/react-performance.csv +0 -45
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +0 -54
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +0 -53
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +0 -56
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +0 -53
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +0 -53
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +0 -51
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +0 -59
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +0 -52
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +0 -54
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +0 -61
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +0 -54
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +0 -51
- package/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +0 -50
- package/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +0 -85
- package/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +0 -74
- package/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +0 -162
- package/plugin/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +0 -100
- package/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +0 -31
- package/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +0 -262
- package/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +0 -1148
- package/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +0 -114
- package/plugin/skills/handoff/SKILL.md +0 -10
- package/plugin/skills/lsp/SKILL.md +0 -35
- package/plugin/skills/lsp-setup/SKILL.md +0 -18
- package/plugin/skills/lsp-setup/scripts/detect-lsp.ts +0 -233
- package/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +0 -188
- package/plugin/skills/lsp-setup/scripts/tsconfig.json +0 -17
- package/plugin/skills/lsp-setup/scripts/verify-lsp.ts +0 -166
- package/plugin/skills/plan/SKILL.md +0 -24
- package/plugin/skills/plan-review/SKILL.md +0 -22
- package/plugin/skills/programming/SKILL.md +0 -33
- package/plugin/skills/programming/references/code-smells.md +0 -3
- package/plugin/skills/programming/references/go/README.md +0 -3
- package/plugin/skills/programming/references/logging.md +0 -3
- package/plugin/skills/programming/references/python/README.md +0 -3
- package/plugin/skills/programming/references/rust/README.md +0 -3
- package/plugin/skills/programming/references/rust-ub/README.md +0 -3
- package/plugin/skills/programming/references/typescript/README.md +0 -3
- package/plugin/skills/refactor/SKILL.md +0 -21
- package/plugin/skills/remove-ai-slops/SKILL.md +0 -20
- package/plugin/skills/rules/SKILL.md +0 -16
- package/plugin/skills/security-research/SKILL.md +0 -38
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
// verify-lsp.ts <file> [--timeout=ms] — perform a real LSP diagnostics roundtrip
|
|
3
|
-
// for <file> through the lsp-tools-mcp engine and report ok/fail with error text.
|
|
4
|
-
// The engine source is located by walking up from this script and the cwd, so
|
|
5
|
-
// run it inside the HolyCodex repository (where packages/lsp-core/src exists).
|
|
6
|
-
|
|
7
|
-
import { existsSync, statSync } from "node:fs";
|
|
8
|
-
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
9
|
-
import process from "node:process";
|
|
10
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
-
|
|
12
|
-
const ENGINE_TOOLS = "packages/lsp-core/src/tools.ts";
|
|
13
|
-
const ENGINE_CONTEXT = "packages/lsp-core/src/request-context.ts";
|
|
14
|
-
const ENGINE_MANAGER = "packages/lsp-core/src/lsp/manager.ts";
|
|
15
|
-
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
16
|
-
|
|
17
|
-
interface ToolExecutionResult {
|
|
18
|
-
readonly content: ReadonlyArray<{ readonly type: "text"; readonly text: string }>;
|
|
19
|
-
readonly isError?: boolean;
|
|
20
|
-
readonly details?: unknown;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface DiagnosticsDetails {
|
|
24
|
-
readonly mode: "file" | "directory";
|
|
25
|
-
readonly totalDiagnostics: number;
|
|
26
|
-
readonly error?: string;
|
|
27
|
-
readonly errorKind?: "missing_dependency" | "no_files" | "invalid_path";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface ToolsModule {
|
|
31
|
-
readonly executeLspDiagnostics: (
|
|
32
|
-
params: Record<string, unknown>,
|
|
33
|
-
signal?: AbortSignal,
|
|
34
|
-
) => Promise<ToolExecutionResult>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface ContextModule {
|
|
38
|
-
readonly runWithRequestContext: <T>(
|
|
39
|
-
context: { cwd?: string; env?: Record<string, string> },
|
|
40
|
-
fn: () => T,
|
|
41
|
-
) => T;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface ManagerModule {
|
|
45
|
-
readonly disposeDefaultLspManager: () => Promise<void>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function findUp(relativeTarget: string): string | null {
|
|
49
|
-
const starts = [dirname(fileURLToPath(import.meta.url)), process.cwd()];
|
|
50
|
-
for (const start of starts) {
|
|
51
|
-
let current = start;
|
|
52
|
-
while (true) {
|
|
53
|
-
const candidate = join(current, relativeTarget);
|
|
54
|
-
if (existsSync(candidate)) return candidate;
|
|
55
|
-
const parent = dirname(current);
|
|
56
|
-
if (parent === current) break;
|
|
57
|
-
current = parent;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function buildEnv(): Record<string, string> {
|
|
64
|
-
const env: Record<string, string> = {};
|
|
65
|
-
for (const [key, value] of Object.entries(process.env)) {
|
|
66
|
-
if (value !== undefined) env[key] = value;
|
|
67
|
-
}
|
|
68
|
-
return env;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function isDiagnosticsDetails(value: unknown): value is DiagnosticsDetails {
|
|
72
|
-
return (
|
|
73
|
-
typeof value === "object" && value !== null && "mode" in value && "totalDiagnostics" in value
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function loadModule<T>(relativeTarget: string): Promise<T> {
|
|
78
|
-
const path = findUp(relativeTarget);
|
|
79
|
-
if (path === null) {
|
|
80
|
-
throw new EngineNotFoundError(relativeTarget);
|
|
81
|
-
}
|
|
82
|
-
return (await import(pathToFileURL(path).href)) as T;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
class EngineNotFoundError extends Error {
|
|
86
|
-
constructor(public readonly target: string) {
|
|
87
|
-
super(
|
|
88
|
-
`lsp-tools-mcp engine not found (looked for ${target}). Run verify-lsp.ts inside the HolyCodex repository.`,
|
|
89
|
-
);
|
|
90
|
-
this.name = "EngineNotFoundError";
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function parseTimeout(args: readonly string[]): number {
|
|
95
|
-
const flag = args.find((arg) => arg.startsWith("--timeout="));
|
|
96
|
-
if (flag === undefined) return DEFAULT_TIMEOUT_MS;
|
|
97
|
-
const parsed = Number.parseInt(flag.slice("--timeout=".length), 10);
|
|
98
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_TIMEOUT_MS;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async function run(filePath: string, timeoutMs: number): Promise<number> {
|
|
102
|
-
const tools = await loadModule<ToolsModule>(ENGINE_TOOLS);
|
|
103
|
-
const context = await loadModule<ContextModule>(ENGINE_CONTEXT);
|
|
104
|
-
const manager = await loadModule<ManagerModule>(ENGINE_MANAGER);
|
|
105
|
-
const absolute = isAbsolute(filePath) ? filePath : resolve(process.cwd(), filePath);
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
const signal = AbortSignal.timeout(timeoutMs);
|
|
109
|
-
const result = await context.runWithRequestContext(
|
|
110
|
-
{ cwd: process.cwd(), env: buildEnv() },
|
|
111
|
-
() => tools.executeLspDiagnostics({ filePath: absolute, severity: "all" }, signal),
|
|
112
|
-
);
|
|
113
|
-
const details = isDiagnosticsDetails(result.details) ? result.details : null;
|
|
114
|
-
const text = result.content.map((part) => part.text).join("\n");
|
|
115
|
-
|
|
116
|
-
if (details?.errorKind === "missing_dependency") {
|
|
117
|
-
process.stdout.write(`FAIL ${absolute}: language server not installed\n${text}\n`);
|
|
118
|
-
return 1;
|
|
119
|
-
}
|
|
120
|
-
if (
|
|
121
|
-
result.isError === true ||
|
|
122
|
-
details?.errorKind === "invalid_path" ||
|
|
123
|
-
details?.errorKind === "no_files"
|
|
124
|
-
) {
|
|
125
|
-
process.stdout.write(`FAIL ${absolute}: ${details?.error ?? text}\n`);
|
|
126
|
-
return 1;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const count = details?.totalDiagnostics ?? 0;
|
|
130
|
-
process.stdout.write(
|
|
131
|
-
`OK ${absolute}: LSP roundtrip succeeded (${count} diagnostic(s))\n${text}\n`,
|
|
132
|
-
);
|
|
133
|
-
return 0;
|
|
134
|
-
} finally {
|
|
135
|
-
await manager.disposeDefaultLspManager();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async function main(): Promise<void> {
|
|
140
|
-
const args = process.argv.slice(2);
|
|
141
|
-
const filePath = args.find((arg) => !arg.startsWith("--"));
|
|
142
|
-
if (filePath === undefined) {
|
|
143
|
-
process.stderr.write("Usage: bun verify-lsp.ts <file> [--timeout=ms]\n");
|
|
144
|
-
process.exit(2);
|
|
145
|
-
}
|
|
146
|
-
if (!existsSync(filePath) || !statSync(filePath).isFile()) {
|
|
147
|
-
process.stderr.write(`verify-lsp: not a file: ${filePath}\n`);
|
|
148
|
-
process.exit(2);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
try {
|
|
152
|
-
const code = await run(filePath, parseTimeout(args));
|
|
153
|
-
process.exit(code);
|
|
154
|
-
} catch (error) {
|
|
155
|
-
if (error instanceof EngineNotFoundError) {
|
|
156
|
-
process.stderr.write(`SKIP: ${error.message}\n`);
|
|
157
|
-
process.exit(3);
|
|
158
|
-
}
|
|
159
|
-
process.stderr.write(
|
|
160
|
-
`FAIL ${filePath}: ${error instanceof Error ? error.message : String(error)}\n`,
|
|
161
|
-
);
|
|
162
|
-
process.exit(1);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
await main();
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan
|
|
3
|
-
description: Use when the user asks for a plan or implementation requires unresolved architecture, cross-cutting coordination, irreversible decisions, high risk, or material ambiguity; do not use for multiple obvious steps, simple direct work, status, or explanation. Produces one repo-grounded reviewed plan with approval and optional goal gates; unlike plan-review, it owns the full planning sequence.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Plan
|
|
7
|
-
|
|
8
|
-
On activation, first user-visible line must be:
|
|
9
|
-
|
|
10
|
-
**PLAN MODE ACTIVATED**
|
|
11
|
-
|
|
12
|
-
Main agent owns planning. No subagent, reviewer agent, evidence directory, execution waves, commit ritual, or ceremony unless user asks.
|
|
13
|
-
|
|
14
|
-
## Required sequence
|
|
15
|
-
|
|
16
|
-
1. Load `plan`; inspect enough task and repo context.
|
|
17
|
-
2. Write the complete initial plan. Each ordered step names the relevant file or surface, exact change, expected outcome, and smallest proof; mark only material dependencies, risks, and user decisions.
|
|
18
|
-
3. Only after the initial plan exists, load `plan-review`. Never preload, parallelize, or imply its review.
|
|
19
|
-
4. Use `plan-review` once to revise or rewrite the initial plan. Keep initial and reviewed phases distinct.
|
|
20
|
-
5. Present the reviewed executable plan and ask for approval. Do not implement before approval.
|
|
21
|
-
6. After approval, ask whether the user wants to define a goal.
|
|
22
|
-
7. Only after explicit agreement, load `define-goal`; otherwise implement the approved plan.
|
|
23
|
-
|
|
24
|
-
Preserve architecture and requested scope. Stop planning after approval and the optional goal choice; no repeated review or polishing loop.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan-review
|
|
3
|
-
description: Use when a complete initial implementation plan needs feasibility, scope, sequencing, risk, or verification repair, including the required review phase of the plan skill; do not use before initial drafting or as a recurring reviewer. Produces one repaired executable plan; unlike plan it does not own drafting or approval.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Plan Review
|
|
7
|
-
|
|
8
|
-
On activation, first user-visible line must be:
|
|
9
|
-
|
|
10
|
-
**PLAN REVIEW ACTIVATED**
|
|
11
|
-
|
|
12
|
-
Input must include the request, complete initial plan, and enough repo facts. If no initial plan exists, stop and return control to `plan`; never draft its first plan.
|
|
13
|
-
|
|
14
|
-
One pass:
|
|
15
|
-
|
|
16
|
-
1. Test feasibility and compatibility with repo architecture and user constraints.
|
|
17
|
-
2. Find missing steps, dependencies, risks, ambiguities, unsafe mutations, weak completion criteria, and unverifiable outcomes.
|
|
18
|
-
3. Remove unnecessary work, ceremony, scope expansion, duplicate checks, and poor sequencing.
|
|
19
|
-
4. Strengthen each step's target, change, dependency, proof, and stop condition.
|
|
20
|
-
5. Revise or rewrite directly; preserve sound content. Output one complete reviewed plan, not comments or scores.
|
|
21
|
-
|
|
22
|
-
No reviewer agent, evidence folder, second review loop, or implementation. Stop after the corrected executable plan; `plan` owns presentation and approval.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: programming
|
|
3
|
-
description: Use when a task edits Python, Rust, TypeScript, Go, or their matching manifests; do not use for prose-only edits or unsupported languages. Applies language-specific correctness, typing, size, and verification rules; debugging or refactor may additionally own the workflow.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Programming
|
|
7
|
-
|
|
8
|
-
Before editing `.py`, `.pyi`, `.rs`, `.ts`, `.tsx`, `.mts`, `.cts`, `.go`, or matching manifests, read `references/<language>/README.md`. Load `references/logging.md` only for logs and all `references/rust-ub/` for Rust unsafe or FFI.
|
|
9
|
-
|
|
10
|
-
## Core
|
|
11
|
-
|
|
12
|
-
- Best code: none, existing helper, standard API, native feature, installed dependency, one line, then new code.
|
|
13
|
-
- Trace real flow and callers. Fix shared root seam once.
|
|
14
|
-
- Parse untrusted input once at boundary. Interior stays typed.
|
|
15
|
-
- Make illegal states unrepresentable. Distinct primitives get distinct types.
|
|
16
|
-
- Immutable default. No parameter mutation without explicit purpose.
|
|
17
|
-
- Exhaustive variant handling.
|
|
18
|
-
- No untyped escape, ignored diagnostics, non-null assertion, unchecked cast, panic/unwrap in library path.
|
|
19
|
-
- Typed errors. Catch only expected errors; unknown errors propagate to boundary.
|
|
20
|
-
- Existing project stack and logger win.
|
|
21
|
-
- No helper for one caller. No speculative abstraction.
|
|
22
|
-
|
|
23
|
-
## Test
|
|
24
|
-
|
|
25
|
-
Defect: add a public-seam regression test first and confirm the intended failure. Explicit test-first request or clearly defined new behavior without adequate proof: test public seam first, confirm failure, implement minimum green, then refactor. Existing tests may lock small covered changes. Do not force red-green for prose, configuration-only work, trivial mechanical edits, or behavior already adequately covered. Use real object or fake before mock. Deterministic fixture; no sleep. Add an end-to-end user outcome for new behavior when proportional. Run smallest test in loop.
|
|
26
|
-
|
|
27
|
-
## Size
|
|
28
|
-
|
|
29
|
-
After write, measure pure LOC. Under 200 healthy; 200–250 warn; over 250 split unless generated table or documented indivisible state machine. Function over three independent parameters needs named domain input or specific reason.
|
|
30
|
-
|
|
31
|
-
## Finish
|
|
32
|
-
|
|
33
|
-
Run project formatter, linter, strict type checker, targeted tests, then proportional broader gate. Review: one responsibility; typed boundary; exhaustive variants; no escape hatch; no defensive duplicate layer; no one-off helper; regression test exists; no redundant post-action verification; positive names; logging matches project.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Code smells
|
|
2
|
-
|
|
3
|
-
Reject duplicate validation, one-call helpers, boolean mode flags, primitive obsession, variant `if` chains, catch-and-rethrow noise, speculative fallback, hidden mutation, global state, wide interfaces, oversized modules, comments narrating code, and tests coupled to private structure. Fix only smell in task scope; lock behavior first.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Go
|
|
2
|
-
|
|
3
|
-
Preserve module stack. Greenfield: current Go, gofmt/gofumpt, `go vet`, golangci-lint, tests with race detector when concurrency touched. Accept context first for cancellable work. Concrete inputs, narrow consumer-owned interfaces, explicit zero-value semantics. Wrap errors with `%w`; use `errors.Is/As`. Close owned resources. No panic for expected failure, goroutine without owner/stop path, copied mutex, hidden global state, `interface{}` escape, or sleep-based test. Table tests only when cases share one contract. Run format, vet/lint, targeted tests; `-race` for concurrent code.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Logging
|
|
2
|
-
|
|
3
|
-
Use existing structured logger. Log once at ownership boundary, not every layer. Include stable event name and useful IDs; exclude secrets, tokens, raw personal data, huge payloads. Error logs retain typed cause and operation. Debug logs must not be required for correctness. Avoid string interpolation when logger supports fields.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Python
|
|
2
|
-
|
|
3
|
-
Preserve workspace toolchain; greenfield prefers `uv`, Python 3.12+, Ruff, basedpyright, pytest. Type every public boundary. Parse external data with Pydantic v2 or existing schema layer. Prefer frozen dataclasses/models, protocols, pathlib, context managers, explicit async ownership, structured concurrency. No `Any`, bare `except`, mutable default, import side effect, silent fallback, or blocking I/O in async path. Use typed domain errors; preserve causes with `raise ... from`. Test public behavior with deterministic fixtures. Run formatter/lint, strict typecheck, targeted pytest.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Rust
|
|
2
|
-
|
|
3
|
-
Preserve crate choices. Greenfield: stable edition, rustfmt, Clippy warnings denied, cargo test. Model states with enums/newtypes; borrow before clone; iterator when clearer. Libraries return typed `thiserror` errors; applications may add `anyhow` context at boundary. No `unwrap`, `expect`, panic, ignored `Result`, needless clone, blocking call in async runtime, or unbounded task. Use cancellation-aware structured tasks. Test public behavior; add property tests only for real invariants. Unsafe/FFI also loads `../rust-ub/README.md`. Run fmt, check, Clippy, targeted tests; Miri when unsafe touched.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Rust unsafe / FFI
|
|
2
|
-
|
|
3
|
-
Minimize unsafe surface; safe wrapper owns invariant. State aliasing, alignment, initialization, lifetime, provenance, thread, unwind, and ownership assumptions beside boundary. Validate foreign pointer/length before slice; define allocator and deallocation owner; use `repr(C)` only where ABI requires. No reference from possibly null/misaligned pointer, mutable alias, unchecked integer-to-pointer guess, or unwind across FFI. Add boundary tests. Run Miri first and after fix; use sanitizer/loom when memory or concurrency model requires it.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# TypeScript
|
|
2
|
-
|
|
3
|
-
Preserve workspace runtime/package manager. Strict `tsc`; project formatter/linter/test runner. `unknown` at boundaries, then narrow or schema-parse. Prefer discriminated unions, `readonly`, `satisfies`, type-only imports, named exports. No `any`, ignored diagnostic, non-null assertion, unchecked cast, enum, empty catch, or swallowed error. Async work must expose cancellation/timeout where caller needs it. React: semantic HTML, stable keys, minimal effects; derive state instead of syncing it. Test public behavior with Vitest/project runner. Run formatter, typecheck, targeted tests.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refactor
|
|
3
|
-
description: Use when a task needs behavior-preserving restructuring, extraction, simplification, modernization, or cleanup of one named seam; do not use for features, bug fixes, formatting sweeps, or broad AI-slop cleanup. Produces a behavior-locked structural change; unlike remove-ai-slops it targets one seam or smell.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Refactor
|
|
7
|
-
|
|
8
|
-
Scope one smell or seam. No feature, formatting sweep, rename drift, or cleanup bundle.
|
|
9
|
-
|
|
10
|
-
1. Map target responsibility, callers, references, tests, public contract.
|
|
11
|
-
2. State invariant that must remain true.
|
|
12
|
-
3. Add or run behavior-locking test before move.
|
|
13
|
-
4. Use LSP references/rename for symbols. Use AST rewrite for repeated syntax shape.
|
|
14
|
-
5. Move one responsibility at time. Keep compatibility only when contract requires it.
|
|
15
|
-
6. Run smallest test after each semantic move.
|
|
16
|
-
7. Delete obsolete path only after all callers move.
|
|
17
|
-
8. Run strict diagnostics and proportional suite.
|
|
18
|
-
|
|
19
|
-
Good split follows ownership, lifecycle, policy, or dependency boundary. Bad split creates pass-through files, one-call helpers, generic `utils`, or cycles.
|
|
20
|
-
|
|
21
|
-
Stop and reassess if public API changes, tests cannot distinguish behavior, concurrent user edits overlap, or required migration exceeds request.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: remove-ai-slops
|
|
3
|
-
description: Use when a task asks to remove AI-generated code smells from an explicit diff or file scope without behavior changes; do not use for general refactors, features, bug fixes, or repository-wide cleanup. Produces behavior-locked removal of proven smell instances; unlike refactor it may cover several categories in fixed scope.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Remove AI Slops
|
|
7
|
-
|
|
8
|
-
Lock behavior first. Work only branch changes or explicit files. No broad repo cleanup.
|
|
9
|
-
|
|
10
|
-
Categories: dead wrapper/helper; redundant guard or fallback; broad catch; vague narrative comment; duplicated path; needless object annotation; variant `if` chain; oversized mixed module; repeated post-action verification; inefficient equivalent work.
|
|
11
|
-
|
|
12
|
-
For each category:
|
|
13
|
-
|
|
14
|
-
1. Find exact instances.
|
|
15
|
-
2. Add regression test when behavior lacks coverage.
|
|
16
|
-
3. Confirm red where change fixes a bug; otherwise confirm behavior lock passes.
|
|
17
|
-
4. Remove smallest smell set.
|
|
18
|
-
5. Run targeted test and diagnostics.
|
|
19
|
-
|
|
20
|
-
Do not collapse distinct semantics, remove required compatibility, change error strings, reorder observable effects, or “simplify” security checks without proof. Finish with formatter, linter, strict types, targeted suite, and diff review.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rules
|
|
3
|
-
description: Use when a task asks how HolyCodex rules are discovered, matched, injected, deduplicated, limited, cached, or why rule loading is wrong; do not use merely because repository instructions exist or for skill routing. Produces an evidence-backed rule trace without exposing unrelated content; unlike general debugging it owns this pipeline.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Rules
|
|
7
|
-
|
|
8
|
-
Automatic when plugin enabled. Static rules load on session start and user prompt. File rules load after matching edit. Post-compact clears session cache.
|
|
9
|
-
|
|
10
|
-
Sources: `CONTEXT.md`, `.holycodex/rules/**/*.md`, `.codex/rules/**/*.md`, `.github/instructions/**/*.md`, `.github/copilot-instructions.md`. Never load or reinject `AGENTS.md`.
|
|
11
|
-
|
|
12
|
-
Frontmatter: `alwaysApply: true` for static rule; `globs` accepts quoted or unquoted scalar, inline array, or multiline array. Body after frontmatter is injected. Native and plugin rules dedupe by normalized content hash. Per-rule cap 8,000 chars; event cap 24,000 chars.
|
|
13
|
-
|
|
14
|
-
Environment: `HOLYCODEX_RULES_DISABLED=1`, `HOLYCODEX_RULES_MAX_RULE_CHARS`, `HOLYCODEX_RULES_MAX_RESULT_CHARS`.
|
|
15
|
-
|
|
16
|
-
When debugging rules, report discovered files, parsed metadata, target path, match result, dedupe/cache result. Do not expose unrelated rule content.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: security-research
|
|
3
|
-
description: Use when an authorized task needs repository security review, threat analysis, vulnerability validation, or attack-path and exploitability proof; do not use for generic review, ordinary debugging, unsupported hardening claims, or real-system attacks. Produces evidence-calibrated findings and minimum fixes; unlike debugging it evaluates attacker reachability and impact.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Security Research
|
|
7
|
-
|
|
8
|
-
Main agent owns scope, threat surface, dedupe, proof, severity, report. No Team Mode. At most two independent lanes when useful: `explorer` for one internal surface; `librarian` for named standards or dependency facts. No duplicate hunters, recursive delegation, reviewer loop, or full-history fork.
|
|
9
|
-
|
|
10
|
-
## Rules
|
|
11
|
-
|
|
12
|
-
- Name target: repo, diff, path, release, or threat surface.
|
|
13
|
-
- Map entry points, attacker input, trust boundaries, sensitive assets, sinks, privilege transitions.
|
|
14
|
-
- No severity without reachable attack path.
|
|
15
|
-
- High or critical needs safe local PoC or decisive static proof plus concrete preconditions and impact.
|
|
16
|
-
- CWE classifies weakness. Severity measures exploitability and impact. Keep separate.
|
|
17
|
-
- Generic hardening is not finding.
|
|
18
|
-
- Never attack real or third-party systems. Use local fixture, toy payload, dry run, or static proof.
|
|
19
|
-
|
|
20
|
-
## Flow
|
|
21
|
-
|
|
22
|
-
1. Baseline: scope, branch/diff, sensitive paths, tests, constraints.
|
|
23
|
-
2. Threat surface: attacker capability, controlled input, boundary, sink, asset.
|
|
24
|
-
3. Candidates: title, path/function, attack path, impact, CWE candidate, evidence, safe proof idea.
|
|
25
|
-
4. Deduplicate by root cause and attack path.
|
|
26
|
-
5. Validate strongest candidate. Reproduce, falsify, or downgrade. Record exact command and observed output.
|
|
27
|
-
6. Calibrate severity from proven preconditions, reachability, privilege, user action, scope, confidentiality, integrity, availability.
|
|
28
|
-
7. Give minimum fix and public-seam regression test.
|
|
29
|
-
|
|
30
|
-
## Report
|
|
31
|
-
|
|
32
|
-
Lead with `PASS`, `PASS WITH FINDINGS`, or `BLOCK`.
|
|
33
|
-
|
|
34
|
-
For each surviving finding: severity, title, CWE, affected path/function, attacker capability, attack path, proof, impact, minimum fix, regression check.
|
|
35
|
-
|
|
36
|
-
Also list downgraded and rejected candidates with reason. End with residual risk: untested surfaces and why.
|
|
37
|
-
|
|
38
|
-
Use CWE, OWASP WSTG/ASVS, and CVSS v4 only when relevant. Cite exact source. Do not claim precise CVSS score without scoring every metric.
|