@arx-hq/adapters 0.0.0-stage → 0.4.0-alpha.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 +21 -0
- package/README.md +25 -2
- package/dist/index.d.ts +42 -0
- package/dist/index.js +587 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arx Contributors
|
|
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
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @arx-hq/adapters
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Part of the [Arx](https://github.com/mehmetkoyunco/arx) 360-degree deterministic software quality, security, and production-readiness harness.
|
|
4
|
+
|
|
5
|
+
Repository stack/agent detector and idempotent `<!-- ARX:START/END -->` generators for `AGENTS.md`, Claude Code, Cursor, Codex, `docs/*`, and GitHub Actions CI.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @arx-hq/adapters
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { detectProjectEnvironment, generateAdapterFiles } from "@arx-hq/adapters";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Documentation & Source
|
|
20
|
+
|
|
21
|
+
- Repository: https://github.com/mehmetkoyunco/arx
|
|
22
|
+
- CLI Quick Start: `npx @arx-hq/cli init --profile saas-web && npx @arx-hq/cli check`
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT © Arx Contributors
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FileOwnershipMode, Profile, MaturityMode, PackageManager } from '@arx-hq/contracts';
|
|
2
|
+
|
|
3
|
+
type SupportedAgentTool = "claude" | "cursor" | "codex";
|
|
4
|
+
type AdapterMergeStyle = "markdown" | "yaml" | "json-hooks";
|
|
5
|
+
interface DetectedEnvironment {
|
|
6
|
+
readonly rootDir: string;
|
|
7
|
+
readonly projectName: string;
|
|
8
|
+
readonly stacks: readonly string[];
|
|
9
|
+
readonly packageManager: PackageManager;
|
|
10
|
+
readonly hasGit: boolean;
|
|
11
|
+
readonly hasTypeScript: boolean;
|
|
12
|
+
readonly hasBiome: boolean;
|
|
13
|
+
readonly hasEslint: boolean;
|
|
14
|
+
readonly suggestedProfile: Profile;
|
|
15
|
+
readonly detectedAgents: readonly SupportedAgentTool[];
|
|
16
|
+
}
|
|
17
|
+
interface AdapterArtifact {
|
|
18
|
+
readonly path: string;
|
|
19
|
+
readonly ownership: FileOwnershipMode;
|
|
20
|
+
readonly content: string;
|
|
21
|
+
readonly mergeStyle?: AdapterMergeStyle;
|
|
22
|
+
}
|
|
23
|
+
interface AdapterGenerateOptions {
|
|
24
|
+
readonly profile?: Profile;
|
|
25
|
+
readonly mode?: MaturityMode;
|
|
26
|
+
readonly todayIsoDate?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare function detectEnvironment(rootDir: string): Promise<DetectedEnvironment>;
|
|
30
|
+
|
|
31
|
+
declare function generateAdapterArtifacts(env: DetectedEnvironment, options?: AdapterGenerateOptions): AdapterArtifact[];
|
|
32
|
+
|
|
33
|
+
declare function renderAgentsArtifacts(env: DetectedEnvironment, profile: Profile, mode: MaturityMode): AdapterArtifact[];
|
|
34
|
+
|
|
35
|
+
declare function renderCiWorkflowArtifact(env: DetectedEnvironment): AdapterArtifact;
|
|
36
|
+
|
|
37
|
+
declare function renderArxConfigArtifact(profile: Profile, mode: MaturityMode): AdapterArtifact;
|
|
38
|
+
declare function renderDocsArtifacts(env: DetectedEnvironment, profile: Profile, mode: MaturityMode, todayIsoDate: string): AdapterArtifact[];
|
|
39
|
+
|
|
40
|
+
declare const ADAPTERS_SCHEMA_VERSION: "1.0.0";
|
|
41
|
+
|
|
42
|
+
export { ADAPTERS_SCHEMA_VERSION, type AdapterArtifact, type AdapterGenerateOptions, type AdapterMergeStyle, type DetectedEnvironment, type SupportedAgentTool, detectEnvironment, generateAdapterArtifacts, renderAgentsArtifacts, renderArxConfigArtifact, renderCiWorkflowArtifact, renderDocsArtifacts };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { ARX_SCHEMA_VERSION } from "@arx-hq/contracts";
|
|
3
|
+
|
|
4
|
+
// src/detector.ts
|
|
5
|
+
import { access, readFile } from "fs/promises";
|
|
6
|
+
import path from "path";
|
|
7
|
+
async function exists(absPath) {
|
|
8
|
+
try {
|
|
9
|
+
await access(absPath);
|
|
10
|
+
return true;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
async function readPackageJson(rootDir) {
|
|
16
|
+
try {
|
|
17
|
+
const raw = await readFile(path.resolve(rootDir, "package.json"), "utf8");
|
|
18
|
+
const parsed = JSON.parse(raw);
|
|
19
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
20
|
+
return parsed;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function detectPackageManager(rootDir, pkg) {
|
|
28
|
+
if (await exists(path.resolve(rootDir, "pnpm-lock.yaml")) || await exists(path.resolve(rootDir, "pnpm-workspace.yaml"))) {
|
|
29
|
+
return "pnpm";
|
|
30
|
+
}
|
|
31
|
+
if (await exists(path.resolve(rootDir, "yarn.lock"))) {
|
|
32
|
+
return "yarn";
|
|
33
|
+
}
|
|
34
|
+
if (await exists(path.resolve(rootDir, "bun.lockb")) || await exists(path.resolve(rootDir, "bun.lock"))) {
|
|
35
|
+
return "bun";
|
|
36
|
+
}
|
|
37
|
+
if (await exists(path.resolve(rootDir, "package-lock.json"))) {
|
|
38
|
+
return "npm";
|
|
39
|
+
}
|
|
40
|
+
const pmField = pkg?.packageManager ?? "";
|
|
41
|
+
if (pmField.startsWith("pnpm@")) {
|
|
42
|
+
return "pnpm";
|
|
43
|
+
}
|
|
44
|
+
if (pmField.startsWith("yarn@")) {
|
|
45
|
+
return "yarn";
|
|
46
|
+
}
|
|
47
|
+
if (pmField.startsWith("bun@")) {
|
|
48
|
+
return "bun";
|
|
49
|
+
}
|
|
50
|
+
if (pmField.startsWith("npm@") || pkg !== null) {
|
|
51
|
+
return "npm";
|
|
52
|
+
}
|
|
53
|
+
return "unknown";
|
|
54
|
+
}
|
|
55
|
+
async function detectEnvironment(rootDir) {
|
|
56
|
+
const absRoot = path.resolve(rootDir);
|
|
57
|
+
const pkg = await readPackageJson(absRoot);
|
|
58
|
+
const allDeps = /* @__PURE__ */ new Set([
|
|
59
|
+
...Object.keys(pkg?.dependencies ?? {}),
|
|
60
|
+
...Object.keys(pkg?.devDependencies ?? {})
|
|
61
|
+
]);
|
|
62
|
+
const [
|
|
63
|
+
packageManager,
|
|
64
|
+
hasGit,
|
|
65
|
+
hasTsConfig,
|
|
66
|
+
hasBiomeJson,
|
|
67
|
+
hasBiomeJsonc,
|
|
68
|
+
hasEslintFlat,
|
|
69
|
+
hasEslintRc,
|
|
70
|
+
hasNextConfig,
|
|
71
|
+
hasViteConfig,
|
|
72
|
+
hasIndexHtml,
|
|
73
|
+
hasPublicIndexHtml,
|
|
74
|
+
hasClaudeDir,
|
|
75
|
+
hasClaudeMd,
|
|
76
|
+
hasCursorDir,
|
|
77
|
+
hasCodexDir
|
|
78
|
+
] = await Promise.all([
|
|
79
|
+
detectPackageManager(absRoot, pkg),
|
|
80
|
+
exists(path.join(absRoot, ".git")),
|
|
81
|
+
exists(path.join(absRoot, "tsconfig.json")),
|
|
82
|
+
exists(path.join(absRoot, "biome.json")),
|
|
83
|
+
exists(path.join(absRoot, "biome.jsonc")),
|
|
84
|
+
exists(path.join(absRoot, "eslint.config.js")),
|
|
85
|
+
exists(path.join(absRoot, ".eslintrc.json")),
|
|
86
|
+
exists(path.join(absRoot, "next.config.mjs")),
|
|
87
|
+
exists(path.join(absRoot, "vite.config.ts")),
|
|
88
|
+
exists(path.join(absRoot, "index.html")),
|
|
89
|
+
exists(path.join(absRoot, "public/index.html")),
|
|
90
|
+
exists(path.join(absRoot, ".claude")),
|
|
91
|
+
exists(path.join(absRoot, "CLAUDE.md")),
|
|
92
|
+
exists(path.join(absRoot, ".cursor")),
|
|
93
|
+
exists(path.join(absRoot, ".codex"))
|
|
94
|
+
]);
|
|
95
|
+
const hasTypeScript = hasTsConfig || allDeps.has("typescript");
|
|
96
|
+
const hasBiome = hasBiomeJson || hasBiomeJsonc || allDeps.has("@biomejs/biome");
|
|
97
|
+
const hasEslint = hasEslintFlat || hasEslintRc || allDeps.has("eslint");
|
|
98
|
+
const stacks = [];
|
|
99
|
+
if (hasTypeScript || pkg !== null) {
|
|
100
|
+
stacks.push("ts-node");
|
|
101
|
+
}
|
|
102
|
+
if (allDeps.has("next") || hasNextConfig) {
|
|
103
|
+
stacks.push("nextjs");
|
|
104
|
+
}
|
|
105
|
+
if (allDeps.has("vite") || hasViteConfig) {
|
|
106
|
+
stacks.push("vite");
|
|
107
|
+
}
|
|
108
|
+
if (allDeps.has("react")) {
|
|
109
|
+
stacks.push("react");
|
|
110
|
+
}
|
|
111
|
+
if (hasIndexHtml || hasPublicIndexHtml) {
|
|
112
|
+
stacks.push("web");
|
|
113
|
+
}
|
|
114
|
+
if (allDeps.has("express") || allDeps.has("fastify") || allDeps.has("hono") || allDeps.has("@nestjs/core")) {
|
|
115
|
+
stacks.push("backend-api");
|
|
116
|
+
}
|
|
117
|
+
const hasWebUi = stacks.includes("nextjs") || stacks.includes("vite") || stacks.includes("react") || stacks.includes("web");
|
|
118
|
+
let suggestedProfile = "saas-web";
|
|
119
|
+
if (pkg?.bin && !hasWebUi) {
|
|
120
|
+
suggestedProfile = "cli";
|
|
121
|
+
} else if (stacks.includes("backend-api") && !hasWebUi) {
|
|
122
|
+
suggestedProfile = "backend-api";
|
|
123
|
+
} else if (!hasWebUi && hasTypeScript) {
|
|
124
|
+
suggestedProfile = "cli";
|
|
125
|
+
}
|
|
126
|
+
const detectedAgents = [];
|
|
127
|
+
if (hasClaudeDir || hasClaudeMd) {
|
|
128
|
+
detectedAgents.push("claude");
|
|
129
|
+
}
|
|
130
|
+
if (hasCursorDir) {
|
|
131
|
+
detectedAgents.push("cursor");
|
|
132
|
+
}
|
|
133
|
+
if (hasCodexDir) {
|
|
134
|
+
detectedAgents.push("codex");
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
rootDir: absRoot,
|
|
138
|
+
projectName: pkg?.name ?? path.basename(absRoot),
|
|
139
|
+
stacks: stacks.length > 0 ? stacks : ["ts-node"],
|
|
140
|
+
packageManager,
|
|
141
|
+
hasGit,
|
|
142
|
+
hasTypeScript,
|
|
143
|
+
hasBiome,
|
|
144
|
+
hasEslint,
|
|
145
|
+
suggestedProfile,
|
|
146
|
+
detectedAgents
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/templates/agents.ts
|
|
151
|
+
import {
|
|
152
|
+
ARX_MARKERS
|
|
153
|
+
} from "@arx-hq/contracts";
|
|
154
|
+
function renderAgentsArtifacts(env, profile, mode) {
|
|
155
|
+
const agentsBody = [
|
|
156
|
+
ARX_MARKERS.START,
|
|
157
|
+
`# ${env.projectName} \u2014 Engineering Constitution (\`AGENTS.md\`)`,
|
|
158
|
+
"",
|
|
159
|
+
"## Active Harness Configuration",
|
|
160
|
+
`- **Profile:** \`${profile}\` | **Mode:** \`${mode}\` | **Package Manager:** \`${env.packageManager}\``,
|
|
161
|
+
"- **Living Memory:** `docs/PROJECT.md`, `docs/ARCHITECTURE.md`, `docs/DECISIONS.md`, `docs/STATUS.md` (<= 50 lines).",
|
|
162
|
+
"",
|
|
163
|
+
"## Mandatory Verification Gate",
|
|
164
|
+
"- Run `npx arx check --tier T1` after edits and `npx arx check` before completing a task.",
|
|
165
|
+
"- Keep `AGENTS.md` <= 200 lines and `docs/STATUS.md` <= 50 lines.",
|
|
166
|
+
"- Log significant architectural choices in `docs/DECISIONS.md`.",
|
|
167
|
+
"",
|
|
168
|
+
"## Zero-Slop & Security Invariants",
|
|
169
|
+
"- No explicit `any`, no empty `catch {}`, no unfinished `// TODO` markers, no files > 400 lines.",
|
|
170
|
+
"- Never commit hardcoded secrets or `.env` files; document required keys in `.env.example`.",
|
|
171
|
+
"- No circular imports and no OS-specific Bash dependencies in runtime or test code.",
|
|
172
|
+
"",
|
|
173
|
+
"## Bounded Self-Healing (Anti-Loop)",
|
|
174
|
+
"- Diagnose root cause before editing; maximum 3 repair attempts.",
|
|
175
|
+
"- If the exact same finding fingerprint repeats consecutively, STOP and escalate with root cause and options.",
|
|
176
|
+
ARX_MARKERS.END,
|
|
177
|
+
""
|
|
178
|
+
].join("\n");
|
|
179
|
+
const claudeMd = [ARX_MARKERS.START, "@AGENTS.md", ARX_MARKERS.END, ""].join(
|
|
180
|
+
"\n"
|
|
181
|
+
);
|
|
182
|
+
const claudeSettings = `${JSON.stringify(
|
|
183
|
+
{
|
|
184
|
+
hooks: {
|
|
185
|
+
PostToolUse: [
|
|
186
|
+
{
|
|
187
|
+
arxManaged: true,
|
|
188
|
+
matcher: "Write|Edit|MultiEdit",
|
|
189
|
+
hooks: [
|
|
190
|
+
{
|
|
191
|
+
type: "command",
|
|
192
|
+
command: "npx arx check --tier T1 --quiet"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
Stop: [
|
|
198
|
+
{
|
|
199
|
+
arxManaged: true,
|
|
200
|
+
matcher: "*",
|
|
201
|
+
hooks: [
|
|
202
|
+
{
|
|
203
|
+
type: "command",
|
|
204
|
+
command: "npx arx check --tier T2"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
null,
|
|
212
|
+
2
|
|
213
|
+
)}
|
|
214
|
+
`;
|
|
215
|
+
const claudeCommands = [
|
|
216
|
+
{
|
|
217
|
+
path: ".claude/commands/arx-plan.md",
|
|
218
|
+
ownership: "managed",
|
|
219
|
+
content: [
|
|
220
|
+
"# /arx-plan",
|
|
221
|
+
"",
|
|
222
|
+
"Read `AGENTS.md`, `docs/PROJECT.md`, `docs/ARCHITECTURE.md`, and `docs/STATUS.md`.",
|
|
223
|
+
"Lock task scope, identify impacted modules/contracts, and list verification tests before editing code.",
|
|
224
|
+
""
|
|
225
|
+
].join("\n")
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
path: ".claude/commands/arx-build.md",
|
|
229
|
+
ownership: "managed",
|
|
230
|
+
content: [
|
|
231
|
+
"# /arx-build",
|
|
232
|
+
"",
|
|
233
|
+
"Implement the approved plan in atomic modules (<= 400 lines/file, zero `any`, zero empty `catch`, zero `// TODO`).",
|
|
234
|
+
"After edits, run `npx arx check --tier T1` and resolve findings in priority order.",
|
|
235
|
+
""
|
|
236
|
+
].join("\n")
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
path: ".claude/commands/arx-check.md",
|
|
240
|
+
ownership: "managed",
|
|
241
|
+
content: [
|
|
242
|
+
"# /arx-check",
|
|
243
|
+
"",
|
|
244
|
+
"Run `npx arx check` and inspect the Traffic Light summary and `repairQueue`.",
|
|
245
|
+
"Follow bounded self-healing (max 3 attempts; stop immediately on repeated fingerprint).",
|
|
246
|
+
""
|
|
247
|
+
].join("\n")
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
path: ".claude/commands/arx-audit.md",
|
|
251
|
+
ownership: "managed",
|
|
252
|
+
content: [
|
|
253
|
+
"# /arx-audit",
|
|
254
|
+
"",
|
|
255
|
+
"Run `npx arx audit` across all enabled pillars and summarize Blockers, Criticals, and PRI score.",
|
|
256
|
+
""
|
|
257
|
+
].join("\n")
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
path: ".claude/commands/arx-report.md",
|
|
261
|
+
ownership: "managed",
|
|
262
|
+
content: [
|
|
263
|
+
"# /arx-report",
|
|
264
|
+
"",
|
|
265
|
+
"Run `npx arx report --format md` to generate a human-readable Production Readiness summary from `.arx/scorecard.json`.",
|
|
266
|
+
""
|
|
267
|
+
].join("\n")
|
|
268
|
+
}
|
|
269
|
+
];
|
|
270
|
+
const cursorRules = [
|
|
271
|
+
{
|
|
272
|
+
path: ".cursor/rules/arx-core.mdc",
|
|
273
|
+
ownership: "managed",
|
|
274
|
+
content: [
|
|
275
|
+
"---",
|
|
276
|
+
"description: Arx core engineering discipline, zero-slop rules, and bounded self-healing",
|
|
277
|
+
'globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]',
|
|
278
|
+
"alwaysApply: true",
|
|
279
|
+
"---",
|
|
280
|
+
"",
|
|
281
|
+
"- Follow `AGENTS.md` as the single source of truth.",
|
|
282
|
+
"- No explicit `any`, no empty `catch {}`, no `// TODO`, and keep files <= 400 lines.",
|
|
283
|
+
"- Run `npx arx check` after changes; stop and escalate after 3 failed attempts or repeated error fingerprints.",
|
|
284
|
+
""
|
|
285
|
+
].join("\n")
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
path: ".cursor/rules/arx-security.mdc",
|
|
289
|
+
ownership: "managed",
|
|
290
|
+
content: [
|
|
291
|
+
"---",
|
|
292
|
+
"description: Arx API & security boundary guardrails",
|
|
293
|
+
'globs: ["src/app/api/**", "src/api/**", "src/server/**"]',
|
|
294
|
+
"alwaysApply: false",
|
|
295
|
+
"---",
|
|
296
|
+
"",
|
|
297
|
+
"- Validate all external request payloads with Zod before processing.",
|
|
298
|
+
"- Never hardcode API keys/tokens, never use `eval()` or wildcard `CORS: *` on authenticated routes.",
|
|
299
|
+
"- Document every required `process.env.*` key in `.env.example`.",
|
|
300
|
+
""
|
|
301
|
+
].join("\n")
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
path: ".cursor/rules/arx-ui.mdc",
|
|
305
|
+
ownership: "managed",
|
|
306
|
+
content: [
|
|
307
|
+
"---",
|
|
308
|
+
"description: Arx UI design token and accessibility guardrails",
|
|
309
|
+
'globs: ["src/components/**", "src/app/**/*.tsx"]',
|
|
310
|
+
"alwaysApply: false",
|
|
311
|
+
"---",
|
|
312
|
+
"",
|
|
313
|
+
"- Never inject untrusted HTML with `dangerouslySetInnerHTML`.",
|
|
314
|
+
"- Use semantic HTML landmarks, accessible labels, and design tokens instead of ad-hoc magic values.",
|
|
315
|
+
"- Provide loading, empty, and error states for asynchronous views.",
|
|
316
|
+
""
|
|
317
|
+
].join("\n")
|
|
318
|
+
}
|
|
319
|
+
];
|
|
320
|
+
const codexConfig = {
|
|
321
|
+
path: ".codex/config.toml",
|
|
322
|
+
ownership: "managed",
|
|
323
|
+
content: [
|
|
324
|
+
"# Managed by Arx \u2014 OpenAI Codex harness configuration",
|
|
325
|
+
'project_doc_fallback_filenames = ["AGENTS.md"]',
|
|
326
|
+
'approval_policy = "on-request"',
|
|
327
|
+
"",
|
|
328
|
+
"[arx]",
|
|
329
|
+
`profile = "${profile}"`,
|
|
330
|
+
`mode = "${mode}"`,
|
|
331
|
+
'verify_command = "npx arx check"',
|
|
332
|
+
""
|
|
333
|
+
].join("\n")
|
|
334
|
+
};
|
|
335
|
+
const verifyWorkflow = {
|
|
336
|
+
path: ".arx/workflows/verify-loop.md",
|
|
337
|
+
ownership: "managed",
|
|
338
|
+
content: [
|
|
339
|
+
"# Arx Bounded Verification Loop",
|
|
340
|
+
"",
|
|
341
|
+
"1. Run `npx arx check --tier T1` after edits.",
|
|
342
|
+
"2. Run `npx arx check --tier T2` before finishing a task or opening a PR.",
|
|
343
|
+
"3. Fix items strictly in `repairQueue` order (Blocker -> Critical -> High -> AutoFixable).",
|
|
344
|
+
"4. Stop after 3 failed attempts or if the same finding fingerprint repeats consecutively.",
|
|
345
|
+
"5. Update `docs/STATUS.md` (<= 50 lines) once GREEN.",
|
|
346
|
+
""
|
|
347
|
+
].join("\n")
|
|
348
|
+
};
|
|
349
|
+
return [
|
|
350
|
+
{
|
|
351
|
+
path: "AGENTS.md",
|
|
352
|
+
ownership: "merged",
|
|
353
|
+
mergeStyle: "markdown",
|
|
354
|
+
content: agentsBody
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
path: "CLAUDE.md",
|
|
358
|
+
ownership: "merged",
|
|
359
|
+
mergeStyle: "markdown",
|
|
360
|
+
content: claudeMd
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
path: ".claude/settings.json",
|
|
364
|
+
ownership: "merged",
|
|
365
|
+
mergeStyle: "json-hooks",
|
|
366
|
+
content: claudeSettings
|
|
367
|
+
},
|
|
368
|
+
...claudeCommands,
|
|
369
|
+
...cursorRules,
|
|
370
|
+
codexConfig,
|
|
371
|
+
verifyWorkflow
|
|
372
|
+
];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// src/templates/ci.ts
|
|
376
|
+
import { ARX_MARKERS as ARX_MARKERS2 } from "@arx-hq/contracts";
|
|
377
|
+
function ghExpr(expression) {
|
|
378
|
+
return ["$", "{{ ", expression, " }}"].join("");
|
|
379
|
+
}
|
|
380
|
+
function installStep(pm) {
|
|
381
|
+
const nodeExpr = ghExpr("matrix.node");
|
|
382
|
+
if (pm === "pnpm") {
|
|
383
|
+
return [
|
|
384
|
+
" - name: Setup pnpm",
|
|
385
|
+
" uses: pnpm/action-setup@v4",
|
|
386
|
+
` - name: Setup Node.js ${nodeExpr}`,
|
|
387
|
+
" uses: actions/setup-node@v4",
|
|
388
|
+
" with:",
|
|
389
|
+
` node-version: ${nodeExpr}`,
|
|
390
|
+
" cache: pnpm",
|
|
391
|
+
" - name: Install dependencies",
|
|
392
|
+
" run: pnpm install --frozen-lockfile"
|
|
393
|
+
];
|
|
394
|
+
}
|
|
395
|
+
if (pm === "yarn") {
|
|
396
|
+
return [
|
|
397
|
+
` - name: Setup Node.js ${nodeExpr}`,
|
|
398
|
+
" uses: actions/setup-node@v4",
|
|
399
|
+
" with:",
|
|
400
|
+
` node-version: ${nodeExpr}`,
|
|
401
|
+
" cache: yarn",
|
|
402
|
+
" - name: Install dependencies",
|
|
403
|
+
" run: yarn install --frozen-lockfile"
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
return [
|
|
407
|
+
` - name: Setup Node.js ${nodeExpr}`,
|
|
408
|
+
" uses: actions/setup-node@v4",
|
|
409
|
+
" with:",
|
|
410
|
+
` node-version: ${nodeExpr}`,
|
|
411
|
+
" cache: npm",
|
|
412
|
+
" - name: Install dependencies",
|
|
413
|
+
" run: npm ci"
|
|
414
|
+
];
|
|
415
|
+
}
|
|
416
|
+
function renderCiWorkflowArtifact(env) {
|
|
417
|
+
const arxCmd = env.packageManager === "pnpm" ? "pnpm exec arx check --ci" : "npx arx check --ci";
|
|
418
|
+
const osExpr = ghExpr("matrix.os");
|
|
419
|
+
const nodeExpr = ghExpr("matrix.node");
|
|
420
|
+
const content = [
|
|
421
|
+
ARX_MARKERS2.YAML_START,
|
|
422
|
+
"name: Arx Quality Gate",
|
|
423
|
+
"",
|
|
424
|
+
"on:",
|
|
425
|
+
" push:",
|
|
426
|
+
" branches: [main]",
|
|
427
|
+
" pull_request:",
|
|
428
|
+
" branches: [main]",
|
|
429
|
+
"",
|
|
430
|
+
"permissions:",
|
|
431
|
+
" contents: read",
|
|
432
|
+
"",
|
|
433
|
+
"jobs:",
|
|
434
|
+
" arx-gate:",
|
|
435
|
+
` name: Arx Gate (${osExpr} / Node ${nodeExpr})`,
|
|
436
|
+
` runs-on: ${osExpr}`,
|
|
437
|
+
" strategy:",
|
|
438
|
+
" fail-fast: false",
|
|
439
|
+
" matrix:",
|
|
440
|
+
" os: [ubuntu-latest, macos-latest, windows-latest]",
|
|
441
|
+
" node: [20, 22]",
|
|
442
|
+
" steps:",
|
|
443
|
+
" - name: Checkout repository",
|
|
444
|
+
" uses: actions/checkout@v4",
|
|
445
|
+
...installStep(env.packageManager),
|
|
446
|
+
" - name: Run Arx Quality Gate",
|
|
447
|
+
` run: ${arxCmd}`,
|
|
448
|
+
ARX_MARKERS2.YAML_END,
|
|
449
|
+
""
|
|
450
|
+
].join("\n");
|
|
451
|
+
return {
|
|
452
|
+
path: ".github/workflows/ci.yml",
|
|
453
|
+
ownership: "merged",
|
|
454
|
+
mergeStyle: "yaml",
|
|
455
|
+
content
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// src/templates/docs.ts
|
|
460
|
+
import { ARX_PATHS } from "@arx-hq/contracts";
|
|
461
|
+
function renderArxConfigArtifact(profile, mode) {
|
|
462
|
+
const content = [
|
|
463
|
+
'import { defineArxConfig } from "@arx-hq/contracts";',
|
|
464
|
+
"",
|
|
465
|
+
"export default defineArxConfig({",
|
|
466
|
+
` profile: "${profile}",`,
|
|
467
|
+
` mode: "${mode}",`,
|
|
468
|
+
" budgets: {",
|
|
469
|
+
" statusMaxLines: 50,",
|
|
470
|
+
" agentsMaxLines: 200,",
|
|
471
|
+
" maxFileLines: 400,",
|
|
472
|
+
" },",
|
|
473
|
+
" repair: {",
|
|
474
|
+
" maxAttempts: 3,",
|
|
475
|
+
" stopOnRepeatedFingerprint: true,",
|
|
476
|
+
" createCheckpointBranch: true,",
|
|
477
|
+
" },",
|
|
478
|
+
' ignorePaths: ["dist/**", ".next/**", "coverage/**", ".arx/**", "node_modules/**"],',
|
|
479
|
+
"});",
|
|
480
|
+
""
|
|
481
|
+
].join("\n");
|
|
482
|
+
return {
|
|
483
|
+
path: ARX_PATHS.CONFIG_FILE,
|
|
484
|
+
ownership: "user-owned",
|
|
485
|
+
content
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function renderDocsArtifacts(env, profile, mode, todayIsoDate) {
|
|
489
|
+
const projectMd = [
|
|
490
|
+
`# ${env.projectName} \u2014 Project Scope`,
|
|
491
|
+
"",
|
|
492
|
+
"## Vision & Goals",
|
|
493
|
+
`- **Profile:** \`${profile}\``,
|
|
494
|
+
`- **Maturity Mode:** \`${mode}\``,
|
|
495
|
+
`- **Detected Stack:** ${env.stacks.join(", ")}`,
|
|
496
|
+
`- **Package Manager:** \`${env.packageManager}\``,
|
|
497
|
+
"",
|
|
498
|
+
"## Definition of Done",
|
|
499
|
+
"- `arx check` passes with `0 Blocker` and GREEN status.",
|
|
500
|
+
"- Typecheck, lint, tests, and production build are clean.",
|
|
501
|
+
"- `docs/STATUS.md` remains <= 50 lines and reflects the latest verified state.",
|
|
502
|
+
""
|
|
503
|
+
].join("\n");
|
|
504
|
+
const architectureMd = [
|
|
505
|
+
`# ${env.projectName} \u2014 System Architecture`,
|
|
506
|
+
"",
|
|
507
|
+
"## Living Documentation",
|
|
508
|
+
"- Project Scope: [PROJECT.md](./PROJECT.md)",
|
|
509
|
+
"- Decision Log: [DECISIONS.md](./DECISIONS.md)",
|
|
510
|
+
"- Live Status: [STATUS.md](./STATUS.md)",
|
|
511
|
+
"",
|
|
512
|
+
"## Module Boundaries",
|
|
513
|
+
"- Keep domain logic pure, small (<= 400 lines/file), and free of circular imports.",
|
|
514
|
+
"- Validate external input at system boundaries.",
|
|
515
|
+
""
|
|
516
|
+
].join("\n");
|
|
517
|
+
const decisionsMd = [
|
|
518
|
+
`# ${env.projectName} \u2014 Architectural Decision Records (ADR)`,
|
|
519
|
+
"",
|
|
520
|
+
"## ADR-001: Adopt Arx Deterministic Verification Harness",
|
|
521
|
+
`- **Date:** ${todayIsoDate}`,
|
|
522
|
+
"- **Status:** Accepted",
|
|
523
|
+
"- **Context:** Ensure consistent code quality, security, and architectural integrity across AI coding agents and CI.",
|
|
524
|
+
`- **Decision:** Configure Arx (\`profile: ${profile}\`, \`mode: ${mode}\`) with bounded self-healing (max 3 attempts) and SHA-256 safe upgrades.`,
|
|
525
|
+
"- **Consequences:** All changes pass deterministic quality gates locally and in CI.",
|
|
526
|
+
""
|
|
527
|
+
].join("\n");
|
|
528
|
+
const statusMd = [
|
|
529
|
+
`# ${env.projectName} \u2014 Live Project Status`,
|
|
530
|
+
"",
|
|
531
|
+
`> **Hard Budget:** Strictly <= 50 lines. Last updated: \`${todayIsoDate}\`.`,
|
|
532
|
+
"",
|
|
533
|
+
"## Current Status",
|
|
534
|
+
`- **Profile / Mode:** \`${profile}\` / \`${mode}\``,
|
|
535
|
+
"- **Health:** \u{1F7E2} Initialized with Arx harness",
|
|
536
|
+
"",
|
|
537
|
+
"## Completed",
|
|
538
|
+
"- [x] Initialized Arx memory docs and verification config",
|
|
539
|
+
"",
|
|
540
|
+
"## Next Up",
|
|
541
|
+
"- [ ] Run `npx arx check` to establish baseline scorecard",
|
|
542
|
+
"",
|
|
543
|
+
"## Active Risks / Blockers",
|
|
544
|
+
"- None.",
|
|
545
|
+
""
|
|
546
|
+
].join("\n");
|
|
547
|
+
return [
|
|
548
|
+
{ path: "docs/PROJECT.md", ownership: "user-owned", content: projectMd },
|
|
549
|
+
{
|
|
550
|
+
path: "docs/ARCHITECTURE.md",
|
|
551
|
+
ownership: "user-owned",
|
|
552
|
+
content: architectureMd
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
path: "docs/DECISIONS.md",
|
|
556
|
+
ownership: "user-owned",
|
|
557
|
+
content: decisionsMd
|
|
558
|
+
},
|
|
559
|
+
{ path: "docs/STATUS.md", ownership: "user-owned", content: statusMd }
|
|
560
|
+
];
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// src/generator.ts
|
|
564
|
+
function generateAdapterArtifacts(env, options = {}) {
|
|
565
|
+
const profile = options.profile ?? env.suggestedProfile;
|
|
566
|
+
const mode = options.mode ?? "production";
|
|
567
|
+
const todayIsoDate = options.todayIsoDate ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
568
|
+
return [
|
|
569
|
+
renderArxConfigArtifact(profile, mode),
|
|
570
|
+
...renderDocsArtifacts(env, profile, mode, todayIsoDate),
|
|
571
|
+
...renderAgentsArtifacts(env, profile, mode),
|
|
572
|
+
renderCiWorkflowArtifact(env)
|
|
573
|
+
];
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// src/index.ts
|
|
577
|
+
var ADAPTERS_SCHEMA_VERSION = ARX_SCHEMA_VERSION;
|
|
578
|
+
export {
|
|
579
|
+
ADAPTERS_SCHEMA_VERSION,
|
|
580
|
+
detectEnvironment,
|
|
581
|
+
generateAdapterArtifacts,
|
|
582
|
+
renderAgentsArtifacts,
|
|
583
|
+
renderArxConfigArtifact,
|
|
584
|
+
renderCiWorkflowArtifact,
|
|
585
|
+
renderDocsArtifacts
|
|
586
|
+
};
|
|
587
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/detector.ts","../src/templates/agents.ts","../src/templates/ci.ts","../src/templates/docs.ts","../src/generator.ts"],"sourcesContent":["import { ARX_SCHEMA_VERSION } from \"@arx-hq/contracts\";\n\nexport const ADAPTERS_SCHEMA_VERSION = ARX_SCHEMA_VERSION;\n\nexport * from \"./detector.js\";\nexport * from \"./generator.js\";\nexport * from \"./templates/agents.js\";\nexport * from \"./templates/ci.js\";\nexport * from \"./templates/docs.js\";\nexport * from \"./types.js\";\n","import { access, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { PackageManager, Profile } from \"@arx-hq/contracts\";\nimport type { DetectedEnvironment, SupportedAgentTool } from \"./types.js\";\n\ninterface RawPackageJson {\n readonly name?: string;\n readonly bin?: string | Record<string, string>;\n readonly packageManager?: string;\n readonly dependencies?: Record<string, string>;\n readonly devDependencies?: Record<string, string>;\n}\n\nasync function exists(absPath: string): Promise<boolean> {\n try {\n await access(absPath);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function readPackageJson(\n rootDir: string,\n): Promise<RawPackageJson | null> {\n try {\n const raw = await readFile(path.resolve(rootDir, \"package.json\"), \"utf8\");\n const parsed: unknown = JSON.parse(raw);\n if (\n typeof parsed === \"object\" &&\n parsed !== null &&\n !Array.isArray(parsed)\n ) {\n return parsed as RawPackageJson;\n }\n return null;\n } catch {\n return null;\n }\n}\n\nasync function detectPackageManager(\n rootDir: string,\n pkg: RawPackageJson | null,\n): Promise<PackageManager> {\n if (\n (await exists(path.resolve(rootDir, \"pnpm-lock.yaml\"))) ||\n (await exists(path.resolve(rootDir, \"pnpm-workspace.yaml\")))\n ) {\n return \"pnpm\";\n }\n if (await exists(path.resolve(rootDir, \"yarn.lock\"))) {\n return \"yarn\";\n }\n if (\n (await exists(path.resolve(rootDir, \"bun.lockb\"))) ||\n (await exists(path.resolve(rootDir, \"bun.lock\")))\n ) {\n return \"bun\";\n }\n if (await exists(path.resolve(rootDir, \"package-lock.json\"))) {\n return \"npm\";\n }\n\n const pmField = pkg?.packageManager ?? \"\";\n if (pmField.startsWith(\"pnpm@\")) {\n return \"pnpm\";\n }\n if (pmField.startsWith(\"yarn@\")) {\n return \"yarn\";\n }\n if (pmField.startsWith(\"bun@\")) {\n return \"bun\";\n }\n if (pmField.startsWith(\"npm@\") || pkg !== null) {\n return \"npm\";\n }\n\n return \"unknown\";\n}\n\nexport async function detectEnvironment(\n rootDir: string,\n): Promise<DetectedEnvironment> {\n const absRoot = path.resolve(rootDir);\n const pkg = await readPackageJson(absRoot);\n const allDeps = new Set<string>([\n ...Object.keys(pkg?.dependencies ?? {}),\n ...Object.keys(pkg?.devDependencies ?? {}),\n ]);\n\n const [\n packageManager,\n hasGit,\n hasTsConfig,\n hasBiomeJson,\n hasBiomeJsonc,\n hasEslintFlat,\n hasEslintRc,\n hasNextConfig,\n hasViteConfig,\n hasIndexHtml,\n hasPublicIndexHtml,\n hasClaudeDir,\n hasClaudeMd,\n hasCursorDir,\n hasCodexDir,\n ] = await Promise.all([\n detectPackageManager(absRoot, pkg),\n exists(path.join(absRoot, \".git\")),\n exists(path.join(absRoot, \"tsconfig.json\")),\n exists(path.join(absRoot, \"biome.json\")),\n exists(path.join(absRoot, \"biome.jsonc\")),\n exists(path.join(absRoot, \"eslint.config.js\")),\n exists(path.join(absRoot, \".eslintrc.json\")),\n exists(path.join(absRoot, \"next.config.mjs\")),\n exists(path.join(absRoot, \"vite.config.ts\")),\n exists(path.join(absRoot, \"index.html\")),\n exists(path.join(absRoot, \"public/index.html\")),\n exists(path.join(absRoot, \".claude\")),\n exists(path.join(absRoot, \"CLAUDE.md\")),\n exists(path.join(absRoot, \".cursor\")),\n exists(path.join(absRoot, \".codex\")),\n ]);\n\n const hasTypeScript = hasTsConfig || allDeps.has(\"typescript\");\n const hasBiome =\n hasBiomeJson || hasBiomeJsonc || allDeps.has(\"@biomejs/biome\");\n const hasEslint = hasEslintFlat || hasEslintRc || allDeps.has(\"eslint\");\n\n const stacks: string[] = [];\n if (hasTypeScript || pkg !== null) {\n stacks.push(\"ts-node\");\n }\n if (allDeps.has(\"next\") || hasNextConfig) {\n stacks.push(\"nextjs\");\n }\n if (allDeps.has(\"vite\") || hasViteConfig) {\n stacks.push(\"vite\");\n }\n if (allDeps.has(\"react\")) {\n stacks.push(\"react\");\n }\n if (hasIndexHtml || hasPublicIndexHtml) {\n stacks.push(\"web\");\n }\n if (\n allDeps.has(\"express\") ||\n allDeps.has(\"fastify\") ||\n allDeps.has(\"hono\") ||\n allDeps.has(\"@nestjs/core\")\n ) {\n stacks.push(\"backend-api\");\n }\n\n const hasWebUi =\n stacks.includes(\"nextjs\") ||\n stacks.includes(\"vite\") ||\n stacks.includes(\"react\") ||\n stacks.includes(\"web\");\n\n let suggestedProfile: Profile = \"saas-web\";\n if (pkg?.bin && !hasWebUi) {\n suggestedProfile = \"cli\";\n } else if (stacks.includes(\"backend-api\") && !hasWebUi) {\n suggestedProfile = \"backend-api\";\n } else if (!hasWebUi && hasTypeScript) {\n suggestedProfile = \"cli\";\n }\n\n const detectedAgents: SupportedAgentTool[] = [];\n if (hasClaudeDir || hasClaudeMd) {\n detectedAgents.push(\"claude\");\n }\n if (hasCursorDir) {\n detectedAgents.push(\"cursor\");\n }\n if (hasCodexDir) {\n detectedAgents.push(\"codex\");\n }\n\n return {\n rootDir: absRoot,\n projectName: pkg?.name ?? path.basename(absRoot),\n stacks: stacks.length > 0 ? stacks : [\"ts-node\"],\n packageManager,\n hasGit,\n hasTypeScript,\n hasBiome,\n hasEslint,\n suggestedProfile,\n detectedAgents,\n };\n}\n","import {\n ARX_MARKERS,\n type MaturityMode,\n type Profile,\n} from \"@arx-hq/contracts\";\nimport type { AdapterArtifact, DetectedEnvironment } from \"../types.js\";\n\nexport function renderAgentsArtifacts(\n env: DetectedEnvironment,\n profile: Profile,\n mode: MaturityMode,\n): AdapterArtifact[] {\n const agentsBody = [\n ARX_MARKERS.START,\n `# ${env.projectName} — Engineering Constitution (\\`AGENTS.md\\`)`,\n \"\",\n \"## Active Harness Configuration\",\n `- **Profile:** \\`${profile}\\` | **Mode:** \\`${mode}\\` | **Package Manager:** \\`${env.packageManager}\\``,\n \"- **Living Memory:** `docs/PROJECT.md`, `docs/ARCHITECTURE.md`, `docs/DECISIONS.md`, `docs/STATUS.md` (<= 50 lines).\",\n \"\",\n \"## Mandatory Verification Gate\",\n \"- Run `npx arx check --tier T1` after edits and `npx arx check` before completing a task.\",\n \"- Keep `AGENTS.md` <= 200 lines and `docs/STATUS.md` <= 50 lines.\",\n \"- Log significant architectural choices in `docs/DECISIONS.md`.\",\n \"\",\n \"## Zero-Slop & Security Invariants\",\n \"- No explicit `any`, no empty `catch {}`, no unfinished `// TODO` markers, no files > 400 lines.\",\n \"- Never commit hardcoded secrets or `.env` files; document required keys in `.env.example`.\",\n \"- No circular imports and no OS-specific Bash dependencies in runtime or test code.\",\n \"\",\n \"## Bounded Self-Healing (Anti-Loop)\",\n \"- Diagnose root cause before editing; maximum 3 repair attempts.\",\n \"- If the exact same finding fingerprint repeats consecutively, STOP and escalate with root cause and options.\",\n ARX_MARKERS.END,\n \"\",\n ].join(\"\\n\");\n\n const claudeMd = [ARX_MARKERS.START, \"@AGENTS.md\", ARX_MARKERS.END, \"\"].join(\n \"\\n\",\n );\n\n const claudeSettings = `${JSON.stringify(\n {\n hooks: {\n PostToolUse: [\n {\n arxManaged: true,\n matcher: \"Write|Edit|MultiEdit\",\n hooks: [\n {\n type: \"command\",\n command: \"npx arx check --tier T1 --quiet\",\n },\n ],\n },\n ],\n Stop: [\n {\n arxManaged: true,\n matcher: \"*\",\n hooks: [\n {\n type: \"command\",\n command: \"npx arx check --tier T2\",\n },\n ],\n },\n ],\n },\n },\n null,\n 2,\n )}\\n`;\n\n const claudeCommands: AdapterArtifact[] = [\n {\n path: \".claude/commands/arx-plan.md\",\n ownership: \"managed\",\n content: [\n \"# /arx-plan\",\n \"\",\n \"Read `AGENTS.md`, `docs/PROJECT.md`, `docs/ARCHITECTURE.md`, and `docs/STATUS.md`.\",\n \"Lock task scope, identify impacted modules/contracts, and list verification tests before editing code.\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".claude/commands/arx-build.md\",\n ownership: \"managed\",\n content: [\n \"# /arx-build\",\n \"\",\n \"Implement the approved plan in atomic modules (<= 400 lines/file, zero `any`, zero empty `catch`, zero `// TODO`).\",\n \"After edits, run `npx arx check --tier T1` and resolve findings in priority order.\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".claude/commands/arx-check.md\",\n ownership: \"managed\",\n content: [\n \"# /arx-check\",\n \"\",\n \"Run `npx arx check` and inspect the Traffic Light summary and `repairQueue`.\",\n \"Follow bounded self-healing (max 3 attempts; stop immediately on repeated fingerprint).\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".claude/commands/arx-audit.md\",\n ownership: \"managed\",\n content: [\n \"# /arx-audit\",\n \"\",\n \"Run `npx arx audit` across all enabled pillars and summarize Blockers, Criticals, and PRI score.\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".claude/commands/arx-report.md\",\n ownership: \"managed\",\n content: [\n \"# /arx-report\",\n \"\",\n \"Run `npx arx report --format md` to generate a human-readable Production Readiness summary from `.arx/scorecard.json`.\",\n \"\",\n ].join(\"\\n\"),\n },\n ];\n\n const cursorRules: AdapterArtifact[] = [\n {\n path: \".cursor/rules/arx-core.mdc\",\n ownership: \"managed\",\n content: [\n \"---\",\n \"description: Arx core engineering discipline, zero-slop rules, and bounded self-healing\",\n 'globs: [\"**/*.ts\", \"**/*.tsx\", \"**/*.js\", \"**/*.jsx\"]',\n \"alwaysApply: true\",\n \"---\",\n \"\",\n \"- Follow `AGENTS.md` as the single source of truth.\",\n \"- No explicit `any`, no empty `catch {}`, no `// TODO`, and keep files <= 400 lines.\",\n \"- Run `npx arx check` after changes; stop and escalate after 3 failed attempts or repeated error fingerprints.\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".cursor/rules/arx-security.mdc\",\n ownership: \"managed\",\n content: [\n \"---\",\n \"description: Arx API & security boundary guardrails\",\n 'globs: [\"src/app/api/**\", \"src/api/**\", \"src/server/**\"]',\n \"alwaysApply: false\",\n \"---\",\n \"\",\n \"- Validate all external request payloads with Zod before processing.\",\n \"- Never hardcode API keys/tokens, never use `eval()` or wildcard `CORS: *` on authenticated routes.\",\n \"- Document every required `process.env.*` key in `.env.example`.\",\n \"\",\n ].join(\"\\n\"),\n },\n {\n path: \".cursor/rules/arx-ui.mdc\",\n ownership: \"managed\",\n content: [\n \"---\",\n \"description: Arx UI design token and accessibility guardrails\",\n 'globs: [\"src/components/**\", \"src/app/**/*.tsx\"]',\n \"alwaysApply: false\",\n \"---\",\n \"\",\n \"- Never inject untrusted HTML with `dangerouslySetInnerHTML`.\",\n \"- Use semantic HTML landmarks, accessible labels, and design tokens instead of ad-hoc magic values.\",\n \"- Provide loading, empty, and error states for asynchronous views.\",\n \"\",\n ].join(\"\\n\"),\n },\n ];\n\n const codexConfig: AdapterArtifact = {\n path: \".codex/config.toml\",\n ownership: \"managed\",\n content: [\n \"# Managed by Arx — OpenAI Codex harness configuration\",\n 'project_doc_fallback_filenames = [\"AGENTS.md\"]',\n 'approval_policy = \"on-request\"',\n \"\",\n \"[arx]\",\n `profile = \"${profile}\"`,\n `mode = \"${mode}\"`,\n 'verify_command = \"npx arx check\"',\n \"\",\n ].join(\"\\n\"),\n };\n\n const verifyWorkflow: AdapterArtifact = {\n path: \".arx/workflows/verify-loop.md\",\n ownership: \"managed\",\n content: [\n \"# Arx Bounded Verification Loop\",\n \"\",\n \"1. Run `npx arx check --tier T1` after edits.\",\n \"2. Run `npx arx check --tier T2` before finishing a task or opening a PR.\",\n \"3. Fix items strictly in `repairQueue` order (Blocker -> Critical -> High -> AutoFixable).\",\n \"4. Stop after 3 failed attempts or if the same finding fingerprint repeats consecutively.\",\n \"5. Update `docs/STATUS.md` (<= 50 lines) once GREEN.\",\n \"\",\n ].join(\"\\n\"),\n };\n\n return [\n {\n path: \"AGENTS.md\",\n ownership: \"merged\",\n mergeStyle: \"markdown\",\n content: agentsBody,\n },\n {\n path: \"CLAUDE.md\",\n ownership: \"merged\",\n mergeStyle: \"markdown\",\n content: claudeMd,\n },\n {\n path: \".claude/settings.json\",\n ownership: \"merged\",\n mergeStyle: \"json-hooks\",\n content: claudeSettings,\n },\n ...claudeCommands,\n ...cursorRules,\n codexConfig,\n verifyWorkflow,\n ];\n}\n","import { ARX_MARKERS } from \"@arx-hq/contracts\";\nimport type { AdapterArtifact, DetectedEnvironment } from \"../types.js\";\n\nfunction ghExpr(expression: string): string {\n return [\"$\", \"{{ \", expression, \" }}\"].join(\"\");\n}\n\nfunction installStep(pm: DetectedEnvironment[\"packageManager\"]): string[] {\n const nodeExpr = ghExpr(\"matrix.node\");\n\n if (pm === \"pnpm\") {\n return [\n \" - name: Setup pnpm\",\n \" uses: pnpm/action-setup@v4\",\n ` - name: Setup Node.js ${nodeExpr}`,\n \" uses: actions/setup-node@v4\",\n \" with:\",\n ` node-version: ${nodeExpr}`,\n \" cache: pnpm\",\n \" - name: Install dependencies\",\n \" run: pnpm install --frozen-lockfile\",\n ];\n }\n if (pm === \"yarn\") {\n return [\n ` - name: Setup Node.js ${nodeExpr}`,\n \" uses: actions/setup-node@v4\",\n \" with:\",\n ` node-version: ${nodeExpr}`,\n \" cache: yarn\",\n \" - name: Install dependencies\",\n \" run: yarn install --frozen-lockfile\",\n ];\n }\n return [\n ` - name: Setup Node.js ${nodeExpr}`,\n \" uses: actions/setup-node@v4\",\n \" with:\",\n ` node-version: ${nodeExpr}`,\n \" cache: npm\",\n \" - name: Install dependencies\",\n \" run: npm ci\",\n ];\n}\n\nexport function renderCiWorkflowArtifact(\n env: DetectedEnvironment,\n): AdapterArtifact {\n const arxCmd =\n env.packageManager === \"pnpm\"\n ? \"pnpm exec arx check --ci\"\n : \"npx arx check --ci\";\n const osExpr = ghExpr(\"matrix.os\");\n const nodeExpr = ghExpr(\"matrix.node\");\n\n const content = [\n ARX_MARKERS.YAML_START,\n \"name: Arx Quality Gate\",\n \"\",\n \"on:\",\n \" push:\",\n \" branches: [main]\",\n \" pull_request:\",\n \" branches: [main]\",\n \"\",\n \"permissions:\",\n \" contents: read\",\n \"\",\n \"jobs:\",\n \" arx-gate:\",\n ` name: Arx Gate (${osExpr} / Node ${nodeExpr})`,\n ` runs-on: ${osExpr}`,\n \" strategy:\",\n \" fail-fast: false\",\n \" matrix:\",\n \" os: [ubuntu-latest, macos-latest, windows-latest]\",\n \" node: [20, 22]\",\n \" steps:\",\n \" - name: Checkout repository\",\n \" uses: actions/checkout@v4\",\n ...installStep(env.packageManager),\n \" - name: Run Arx Quality Gate\",\n ` run: ${arxCmd}`,\n ARX_MARKERS.YAML_END,\n \"\",\n ].join(\"\\n\");\n\n return {\n path: \".github/workflows/ci.yml\",\n ownership: \"merged\",\n mergeStyle: \"yaml\",\n content,\n };\n}\n","import { ARX_PATHS, type MaturityMode, type Profile } from \"@arx-hq/contracts\";\nimport type { AdapterArtifact, DetectedEnvironment } from \"../types.js\";\n\nexport function renderArxConfigArtifact(\n profile: Profile,\n mode: MaturityMode,\n): AdapterArtifact {\n const content = [\n 'import { defineArxConfig } from \"@arx-hq/contracts\";',\n \"\",\n \"export default defineArxConfig({\",\n ` profile: \"${profile}\",`,\n ` mode: \"${mode}\",`,\n \" budgets: {\",\n \" statusMaxLines: 50,\",\n \" agentsMaxLines: 200,\",\n \" maxFileLines: 400,\",\n \" },\",\n \" repair: {\",\n \" maxAttempts: 3,\",\n \" stopOnRepeatedFingerprint: true,\",\n \" createCheckpointBranch: true,\",\n \" },\",\n ' ignorePaths: [\"dist/**\", \".next/**\", \"coverage/**\", \".arx/**\", \"node_modules/**\"],',\n \"});\",\n \"\",\n ].join(\"\\n\");\n\n return {\n path: ARX_PATHS.CONFIG_FILE,\n ownership: \"user-owned\",\n content,\n };\n}\n\nexport function renderDocsArtifacts(\n env: DetectedEnvironment,\n profile: Profile,\n mode: MaturityMode,\n todayIsoDate: string,\n): AdapterArtifact[] {\n const projectMd = [\n `# ${env.projectName} — Project Scope`,\n \"\",\n \"## Vision & Goals\",\n `- **Profile:** \\`${profile}\\``,\n `- **Maturity Mode:** \\`${mode}\\``,\n `- **Detected Stack:** ${env.stacks.join(\", \")}`,\n `- **Package Manager:** \\`${env.packageManager}\\``,\n \"\",\n \"## Definition of Done\",\n \"- `arx check` passes with `0 Blocker` and GREEN status.\",\n \"- Typecheck, lint, tests, and production build are clean.\",\n \"- `docs/STATUS.md` remains <= 50 lines and reflects the latest verified state.\",\n \"\",\n ].join(\"\\n\");\n\n const architectureMd = [\n `# ${env.projectName} — System Architecture`,\n \"\",\n \"## Living Documentation\",\n \"- Project Scope: [PROJECT.md](./PROJECT.md)\",\n \"- Decision Log: [DECISIONS.md](./DECISIONS.md)\",\n \"- Live Status: [STATUS.md](./STATUS.md)\",\n \"\",\n \"## Module Boundaries\",\n \"- Keep domain logic pure, small (<= 400 lines/file), and free of circular imports.\",\n \"- Validate external input at system boundaries.\",\n \"\",\n ].join(\"\\n\");\n\n const decisionsMd = [\n `# ${env.projectName} — Architectural Decision Records (ADR)`,\n \"\",\n \"## ADR-001: Adopt Arx Deterministic Verification Harness\",\n `- **Date:** ${todayIsoDate}`,\n \"- **Status:** Accepted\",\n \"- **Context:** Ensure consistent code quality, security, and architectural integrity across AI coding agents and CI.\",\n `- **Decision:** Configure Arx (\\`profile: ${profile}\\`, \\`mode: ${mode}\\`) with bounded self-healing (max 3 attempts) and SHA-256 safe upgrades.`,\n \"- **Consequences:** All changes pass deterministic quality gates locally and in CI.\",\n \"\",\n ].join(\"\\n\");\n\n const statusMd = [\n `# ${env.projectName} — Live Project Status`,\n \"\",\n `> **Hard Budget:** Strictly <= 50 lines. Last updated: \\`${todayIsoDate}\\`.`,\n \"\",\n \"## Current Status\",\n `- **Profile / Mode:** \\`${profile}\\` / \\`${mode}\\``,\n \"- **Health:** 🟢 Initialized with Arx harness\",\n \"\",\n \"## Completed\",\n \"- [x] Initialized Arx memory docs and verification config\",\n \"\",\n \"## Next Up\",\n \"- [ ] Run `npx arx check` to establish baseline scorecard\",\n \"\",\n \"## Active Risks / Blockers\",\n \"- None.\",\n \"\",\n ].join(\"\\n\");\n\n return [\n { path: \"docs/PROJECT.md\", ownership: \"user-owned\", content: projectMd },\n {\n path: \"docs/ARCHITECTURE.md\",\n ownership: \"user-owned\",\n content: architectureMd,\n },\n {\n path: \"docs/DECISIONS.md\",\n ownership: \"user-owned\",\n content: decisionsMd,\n },\n { path: \"docs/STATUS.md\", ownership: \"user-owned\", content: statusMd },\n ];\n}\n","import { renderAgentsArtifacts } from \"./templates/agents.js\";\nimport { renderCiWorkflowArtifact } from \"./templates/ci.js\";\nimport {\n renderArxConfigArtifact,\n renderDocsArtifacts,\n} from \"./templates/docs.js\";\nimport type {\n AdapterArtifact,\n AdapterGenerateOptions,\n DetectedEnvironment,\n} from \"./types.js\";\n\nexport function generateAdapterArtifacts(\n env: DetectedEnvironment,\n options: AdapterGenerateOptions = {},\n): AdapterArtifact[] {\n const profile = options.profile ?? env.suggestedProfile;\n const mode = options.mode ?? \"production\";\n const todayIsoDate =\n options.todayIsoDate ?? new Date().toISOString().slice(0, 10);\n\n return [\n renderArxConfigArtifact(profile, mode),\n ...renderDocsArtifacts(env, profile, mode, todayIsoDate),\n ...renderAgentsArtifacts(env, profile, mode),\n renderCiWorkflowArtifact(env),\n ];\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;;;ACAnC,SAAS,QAAQ,gBAAgB;AACjC,OAAO,UAAU;AAYjB,eAAe,OAAO,SAAmC;AACvD,MAAI;AACF,UAAM,OAAO,OAAO;AACpB,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,gBACb,SACgC;AAChC,MAAI;AACF,UAAM,MAAM,MAAM,SAAS,KAAK,QAAQ,SAAS,cAAc,GAAG,MAAM;AACxE,UAAM,SAAkB,KAAK,MAAM,GAAG;AAC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SAAS,SAAS;AAAA,EACvE;AACF;;;ACzGO,SAAS,yBACd,KACA,UAAkC,CAAC,GAChB;AACnB,QAAM,UAAU,QAAQ,WAAW,IAAI;AACvC,QAAM,OAAO,QAAQ,QAAQ;AAC7B,QAAM,eACJ,QAAQ,iBAAgB,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAE9D,SAAO;AAAA,IACL,wBAAwB,SAAS,IAAI;AAAA,IACrC,GAAG,oBAAoB,KAAK,SAAS,MAAM,YAAY;AAAA,IACvD,GAAG,sBAAsB,KAAK,SAAS,IAAI;AAAA,IAC3C,yBAAyB,GAAG;AAAA,EAC9B;AACF;;;ALzBO,IAAM,0BAA0B;","names":["ARX_MARKERS"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arx-hq/adapters",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.4.0-alpha.1",
|
|
4
|
+
"description": "Stack detection and idempotent AI coding agent adapters for Arx",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20.0.0"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@arx-hq/contracts": "0.4.0-alpha.1"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"arx",
|
|
31
|
+
"ai-coding",
|
|
32
|
+
"quality-gate",
|
|
33
|
+
"security",
|
|
34
|
+
"mcp",
|
|
35
|
+
"static-analysis"
|
|
36
|
+
],
|
|
37
|
+
"author": "Arx Contributors",
|
|
38
|
+
"homepage": "https://github.com/mehmetkoyunco/arx#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/mehmetkoyunco/arx/issues"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/mehmetkoyunco/arx.git",
|
|
45
|
+
"directory": "packages/adapters"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
}
|
|
6
51
|
}
|