@codemcp/ade 0.2.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/.ade/skills/adr-nygard/SKILL.md +45 -0
- package/.ade/skills/conventional-commits/SKILL.md +36 -0
- package/.ade/skills/tanstack-architecture/SKILL.md +25 -0
- package/.ade/skills/tanstack-code/SKILL.md +25 -0
- package/.ade/skills/tanstack-design/SKILL.md +24 -0
- package/.ade/skills/tanstack-testing/SKILL.md +24 -0
- package/.agentskills/skills/adr-nygard/SKILL.md +45 -0
- package/.agentskills/skills/commit/SKILL.md +20 -0
- package/.agentskills/skills/tdd/SKILL.md +10 -0
- package/.beads/README.md +85 -0
- package/.beads/config.yaml +63 -0
- package/.beads/interactions.jsonl +0 -0
- package/.beads/issues.jsonl +46 -0
- package/.beads/last-touched +1 -0
- package/.beads/metadata.json +4 -0
- package/.claude/settings.json +16 -0
- package/.claude/skills/extending-catalog/SKILL.md +41 -0
- package/.cursor/mcp.json +16 -0
- package/.cursor/rules/ade.mdc +10 -0
- package/.github/agents/ade.agent.md +28 -0
- package/.github/copilot-instructions.md +11 -0
- package/.github/workflows/pr.yml +38 -0
- package/.github/workflows/release.yml +124 -0
- package/.husky/post-checkout +2 -0
- package/.husky/post-merge +2 -0
- package/.husky/pre-commit +2 -0
- package/.husky/pre-push +8 -0
- package/.kiro/agents/ade.json +20 -0
- package/.kiro/settings/mcp.json +14 -0
- package/.knowledge/.prettierignore +1 -0
- package/.knowledge/config.yaml +9 -0
- package/.lintstagedrc.js +4 -0
- package/.mcp.json +20 -0
- package/.opencode/agents/ade.md +118 -0
- package/.prettierignore +2 -0
- package/.prettierrc.yaml +3 -0
- package/.vibe/beads-state-ade-autonomy-facet-46zodk.json +29 -0
- package/.vibe/beads-state-ade-fix-no-arch-selected-hvfiio.json +34 -0
- package/.vibe/development-plan-autonomy-facet.md +214 -0
- package/.vibe/development-plan-fix-no-arch-selected.md +103 -0
- package/.vscode/mcp.json +24 -0
- package/LICENSE +21 -0
- package/README.md +293 -0
- package/config.lock.yaml +118 -0
- package/config.yaml +10 -0
- package/docs/CLI-PRD.md +251 -0
- package/docs/CLI-design.md +646 -0
- package/docs/adrs/0001-tui-framework-selection.md +77 -0
- package/eslint.config.mjs +38 -0
- package/opencode.json +17 -0
- package/package.json +79 -0
- package/packages/cli/.prettierignore +1 -0
- package/packages/cli/dist/commands/install.js +39 -0
- package/packages/cli/dist/commands/setup.js +177 -0
- package/packages/cli/dist/index.js +43 -0
- package/packages/cli/dist/knowledge-installer.js +38 -0
- package/packages/cli/dist/version.js +1 -0
- package/packages/cli/eslint.config.mjs +40 -0
- package/packages/cli/nodemon.json +7 -0
- package/packages/cli/package.json +40 -0
- package/packages/cli/src/commands/conventions.integration.spec.ts +267 -0
- package/packages/cli/src/commands/install.integration.spec.ts +123 -0
- package/packages/cli/src/commands/install.spec.ts +169 -0
- package/packages/cli/src/commands/install.ts +63 -0
- package/packages/cli/src/commands/knowledge.integration.spec.ts +129 -0
- package/packages/cli/src/commands/setup.integration.spec.ts +148 -0
- package/packages/cli/src/commands/setup.spec.ts +442 -0
- package/packages/cli/src/commands/setup.ts +252 -0
- package/packages/cli/src/index.ts +52 -0
- package/packages/cli/src/knowledge-installer.spec.ts +111 -0
- package/packages/cli/src/knowledge-installer.ts +54 -0
- package/packages/cli/src/version.ts +1 -0
- package/packages/cli/tsconfig.build.json +8 -0
- package/packages/cli/tsconfig.json +10 -0
- package/packages/cli/tsconfig.vitest.json +7 -0
- package/packages/cli/vitest.config.ts +5 -0
- package/packages/core/.prettierignore +1 -0
- package/packages/core/eslint.config.mjs +40 -0
- package/packages/core/nodemon.json +7 -0
- package/packages/core/package.json +34 -0
- package/packages/core/src/catalog/catalog.spec.ts +570 -0
- package/packages/core/src/catalog/facets/architecture.ts +438 -0
- package/packages/core/src/catalog/facets/autonomy.ts +106 -0
- package/packages/core/src/catalog/facets/backpressure.ts +143 -0
- package/packages/core/src/catalog/facets/practices.ts +173 -0
- package/packages/core/src/catalog/facets/process.ts +50 -0
- package/packages/core/src/catalog/index.ts +93 -0
- package/packages/core/src/config.spec.ts +165 -0
- package/packages/core/src/config.ts +39 -0
- package/packages/core/src/index.ts +55 -0
- package/packages/core/src/registry.spec.ts +145 -0
- package/packages/core/src/registry.ts +70 -0
- package/packages/core/src/resolver.spec.ts +626 -0
- package/packages/core/src/resolver.ts +214 -0
- package/packages/core/src/types.ts +179 -0
- package/packages/core/src/writers/git-hooks.ts +9 -0
- package/packages/core/src/writers/instruction.spec.ts +42 -0
- package/packages/core/src/writers/instruction.ts +8 -0
- package/packages/core/src/writers/knowledge.spec.ts +26 -0
- package/packages/core/src/writers/knowledge.ts +15 -0
- package/packages/core/src/writers/permission-policy.ts +8 -0
- package/packages/core/src/writers/setup-note.ts +9 -0
- package/packages/core/src/writers/skills.spec.ts +109 -0
- package/packages/core/src/writers/skills.ts +9 -0
- package/packages/core/src/writers/workflows.spec.ts +72 -0
- package/packages/core/src/writers/workflows.ts +26 -0
- package/packages/core/tsconfig.build.json +8 -0
- package/packages/core/tsconfig.json +7 -0
- package/packages/core/tsconfig.vitest.json +7 -0
- package/packages/core/vitest.config.ts +5 -0
- package/packages/harnesses/.prettierignore +1 -0
- package/packages/harnesses/eslint.config.mjs +40 -0
- package/packages/harnesses/package.json +35 -0
- package/packages/harnesses/src/index.spec.ts +45 -0
- package/packages/harnesses/src/index.ts +47 -0
- package/packages/harnesses/src/permission-policy.ts +173 -0
- package/packages/harnesses/src/skills-installer.ts +54 -0
- package/packages/harnesses/src/types.ts +12 -0
- package/packages/harnesses/src/util.ts +221 -0
- package/packages/harnesses/src/writers/claude-code.spec.ts +320 -0
- package/packages/harnesses/src/writers/claude-code.ts +107 -0
- package/packages/harnesses/src/writers/cline.spec.ts +212 -0
- package/packages/harnesses/src/writers/cline.ts +24 -0
- package/packages/harnesses/src/writers/copilot.spec.ts +258 -0
- package/packages/harnesses/src/writers/copilot.ts +105 -0
- package/packages/harnesses/src/writers/cursor.spec.ts +219 -0
- package/packages/harnesses/src/writers/cursor.ts +95 -0
- package/packages/harnesses/src/writers/kiro.spec.ts +228 -0
- package/packages/harnesses/src/writers/kiro.ts +89 -0
- package/packages/harnesses/src/writers/opencode.spec.ts +258 -0
- package/packages/harnesses/src/writers/opencode.ts +67 -0
- package/packages/harnesses/src/writers/roo-code.spec.ts +197 -0
- package/packages/harnesses/src/writers/roo-code.ts +71 -0
- package/packages/harnesses/src/writers/universal.spec.ts +134 -0
- package/packages/harnesses/src/writers/universal.ts +84 -0
- package/packages/harnesses/src/writers/windsurf.spec.ts +178 -0
- package/packages/harnesses/src/writers/windsurf.ts +89 -0
- package/packages/harnesses/tsconfig.build.json +8 -0
- package/packages/harnesses/tsconfig.json +7 -0
- package/packages/harnesses/tsconfig.vitest.json +7 -0
- package/packages/harnesses/vitest.config.ts +5 -0
- package/pnpm-workspace.yaml +2 -0
- package/scripts/rename-packages.sh +23 -0
- package/skills-lock.json +20 -0
- package/tsconfig.base.json +25 -0
- package/tsconfig.build.json +7 -0
- package/tsconfig.json +13 -0
- package/turbo.json +47 -0
- package/vitest.config.ts +22 -0
- package/vitest.setup.ts +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { version } from "./version.js";
|
|
4
|
+
import { runSetup } from "./commands/setup.js";
|
|
5
|
+
import { runInstall } from "./commands/install.js";
|
|
6
|
+
import { getDefaultCatalog } from "@codemcp/ade-core";
|
|
7
|
+
import { getHarnessIds } from "@codemcp/ade-harnesses";
|
|
8
|
+
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
const command = args[0];
|
|
11
|
+
|
|
12
|
+
if (command === "setup") {
|
|
13
|
+
const projectRoot = args[1] ?? process.cwd();
|
|
14
|
+
const catalog = getDefaultCatalog();
|
|
15
|
+
await runSetup(projectRoot, catalog);
|
|
16
|
+
} else if (command === "install") {
|
|
17
|
+
const projectRoot = args[1] ?? process.cwd();
|
|
18
|
+
|
|
19
|
+
let harnessIds: string[] | undefined;
|
|
20
|
+
|
|
21
|
+
// Support --harness flag (comma-separated)
|
|
22
|
+
if (args.includes("--harness")) {
|
|
23
|
+
const val = args[args.indexOf("--harness") + 1];
|
|
24
|
+
if (val) {
|
|
25
|
+
harnessIds = val.split(",").map((s) => s.trim());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
await runInstall(projectRoot, harnessIds);
|
|
30
|
+
} else if (command === "--version" || command === "-v") {
|
|
31
|
+
console.log(version);
|
|
32
|
+
} else {
|
|
33
|
+
const allIds = getHarnessIds();
|
|
34
|
+
console.log(`ade v${version}`);
|
|
35
|
+
console.log();
|
|
36
|
+
console.log("Usage: ade <command> [options]");
|
|
37
|
+
console.log();
|
|
38
|
+
console.log("Commands:");
|
|
39
|
+
console.log(
|
|
40
|
+
" setup [dir] Interactive setup wizard (re-run to change selections)"
|
|
41
|
+
);
|
|
42
|
+
console.log(
|
|
43
|
+
" install [dir] Apply lock file to generate agent files (idempotent)"
|
|
44
|
+
);
|
|
45
|
+
console.log();
|
|
46
|
+
console.log("Options:");
|
|
47
|
+
console.log(
|
|
48
|
+
` --harness <ids> Comma-separated harnesses (${allIds.join(", ")})`
|
|
49
|
+
);
|
|
50
|
+
console.log(" -v, --version Show version");
|
|
51
|
+
process.exitCode = command ? 1 : 0;
|
|
52
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import type { KnowledgeSource } from "@codemcp/ade-core";
|
|
3
|
+
|
|
4
|
+
vi.mock("@codemcp/knowledge/packages/cli/dist/exports.js", () => ({
|
|
5
|
+
createDocset: vi.fn().mockResolvedValue({
|
|
6
|
+
docset: {},
|
|
7
|
+
configPath: ".knowledge/config.yaml",
|
|
8
|
+
configCreated: false
|
|
9
|
+
}),
|
|
10
|
+
initDocset: vi.fn().mockResolvedValue({ alreadyInitialized: false })
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
createDocset,
|
|
15
|
+
initDocset
|
|
16
|
+
} from "@codemcp/knowledge/packages/cli/dist/exports.js";
|
|
17
|
+
import { installKnowledge } from "./knowledge-installer.js";
|
|
18
|
+
|
|
19
|
+
describe("installKnowledge", () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
vi.clearAllMocks();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("does nothing when knowledge_sources is empty", async () => {
|
|
25
|
+
await installKnowledge([], "/tmp/project");
|
|
26
|
+
|
|
27
|
+
expect(createDocset).not.toHaveBeenCalled();
|
|
28
|
+
expect(initDocset).not.toHaveBeenCalled();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("calls createDocset for each knowledge source", async () => {
|
|
32
|
+
const sources: KnowledgeSource[] = [
|
|
33
|
+
{
|
|
34
|
+
name: "react-docs",
|
|
35
|
+
origin: "https://github.com/facebook/react.git",
|
|
36
|
+
description: "React documentation"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "tanstack-query-docs",
|
|
40
|
+
origin: "https://github.com/TanStack/query.git",
|
|
41
|
+
description: "TanStack Query docs"
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
await installKnowledge(sources, "/tmp/project");
|
|
46
|
+
|
|
47
|
+
expect(createDocset).toHaveBeenCalledTimes(2);
|
|
48
|
+
expect(createDocset).toHaveBeenCalledWith(
|
|
49
|
+
expect.objectContaining({
|
|
50
|
+
id: "react-docs",
|
|
51
|
+
name: "React documentation",
|
|
52
|
+
preset: "git-repo",
|
|
53
|
+
url: "https://github.com/facebook/react.git"
|
|
54
|
+
}),
|
|
55
|
+
expect.objectContaining({ cwd: "/tmp/project" })
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("calls initDocset for each knowledge source after creation", async () => {
|
|
60
|
+
const sources: KnowledgeSource[] = [
|
|
61
|
+
{
|
|
62
|
+
name: "react-docs",
|
|
63
|
+
origin: "https://github.com/facebook/react.git",
|
|
64
|
+
description: "React documentation"
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
await installKnowledge(sources, "/tmp/project");
|
|
69
|
+
|
|
70
|
+
expect(initDocset).toHaveBeenCalledTimes(1);
|
|
71
|
+
expect(initDocset).toHaveBeenCalledWith(
|
|
72
|
+
expect.objectContaining({
|
|
73
|
+
docsetId: "react-docs",
|
|
74
|
+
cwd: "/tmp/project"
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("continues with remaining sources when one fails", async () => {
|
|
80
|
+
vi.mocked(createDocset)
|
|
81
|
+
.mockRejectedValueOnce(new Error("already exists"))
|
|
82
|
+
.mockResolvedValueOnce({
|
|
83
|
+
docset: {},
|
|
84
|
+
configPath: ".knowledge/config.yaml",
|
|
85
|
+
configCreated: false
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const sources: KnowledgeSource[] = [
|
|
89
|
+
{
|
|
90
|
+
name: "failing",
|
|
91
|
+
origin: "https://github.com/fail/fail.git",
|
|
92
|
+
description: "Will fail"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "succeeding",
|
|
96
|
+
origin: "https://github.com/ok/ok.git",
|
|
97
|
+
description: "Will succeed"
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
await installKnowledge(sources, "/tmp/project");
|
|
102
|
+
|
|
103
|
+
// Should have attempted both
|
|
104
|
+
expect(createDocset).toHaveBeenCalledTimes(2);
|
|
105
|
+
// initDocset only called for the successful one
|
|
106
|
+
expect(initDocset).toHaveBeenCalledTimes(1);
|
|
107
|
+
expect(initDocset).toHaveBeenCalledWith(
|
|
108
|
+
expect.objectContaining({ docsetId: "succeeding" })
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { KnowledgeSource } from "@codemcp/ade-core";
|
|
2
|
+
import {
|
|
3
|
+
createDocset,
|
|
4
|
+
initDocset
|
|
5
|
+
} from "@codemcp/knowledge/packages/cli/dist/exports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Install knowledge sources using the @codemcp/knowledge programmatic API.
|
|
9
|
+
*
|
|
10
|
+
* For each knowledge source:
|
|
11
|
+
* 1. Creates a docset config entry via `createDocset`
|
|
12
|
+
* 2. Initializes (downloads) the docset via `initDocset`
|
|
13
|
+
*
|
|
14
|
+
* Errors on individual sources are logged and skipped so that one failure
|
|
15
|
+
* doesn't block the rest.
|
|
16
|
+
*/
|
|
17
|
+
export async function installKnowledge(
|
|
18
|
+
sources: KnowledgeSource[],
|
|
19
|
+
projectRoot: string
|
|
20
|
+
): Promise<void> {
|
|
21
|
+
if (sources.length === 0) return;
|
|
22
|
+
|
|
23
|
+
for (const source of sources) {
|
|
24
|
+
try {
|
|
25
|
+
await createDocset(
|
|
26
|
+
{
|
|
27
|
+
id: source.name,
|
|
28
|
+
name: source.description,
|
|
29
|
+
preset: "git-repo" as const,
|
|
30
|
+
url: source.origin
|
|
31
|
+
},
|
|
32
|
+
{ cwd: projectRoot }
|
|
33
|
+
);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.warn(
|
|
36
|
+
`Warning: failed to create docset "${source.name}":`,
|
|
37
|
+
err instanceof Error ? err.message : err
|
|
38
|
+
);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
await initDocset({
|
|
44
|
+
docsetId: source.name,
|
|
45
|
+
cwd: projectRoot
|
|
46
|
+
});
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.warn(
|
|
49
|
+
`Warning: failed to initialize docset "${source.name}":`,
|
|
50
|
+
err instanceof Error ? err.message : err
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const version = "0.0.0-development";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import { parser, configs } from "typescript-eslint";
|
|
3
|
+
import prettier from "eslint-config-prettier";
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
js.configs.recommended,
|
|
7
|
+
...configs.recommended,
|
|
8
|
+
prettier,
|
|
9
|
+
{
|
|
10
|
+
// Config for TypeScript files
|
|
11
|
+
files: ["**/*.{ts,tsx}"],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser,
|
|
14
|
+
parserOptions: {
|
|
15
|
+
project: ["./tsconfig.json", "./tsconfig.vitest.json"]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
// Config for JavaScript files - no TypeScript parsing
|
|
21
|
+
files: ["**/*.{js,jsx}"],
|
|
22
|
+
...js.configs.recommended
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
// Relaxed rules for test files
|
|
26
|
+
files: ["**/*.test.ts", "**/*.spec.ts"],
|
|
27
|
+
rules: {
|
|
28
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
29
|
+
"@typescript-eslint/no-unused-vars": "off"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
ignores: [
|
|
34
|
+
"**/node_modules/**",
|
|
35
|
+
"**/dist/**",
|
|
36
|
+
".pnpm-store/**",
|
|
37
|
+
"pnpm-lock.yaml"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codemcp/ade-core",
|
|
3
|
+
"main": "dist/index.js",
|
|
4
|
+
"types": "dist/index.d.ts",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc -p tsconfig.build.json",
|
|
11
|
+
"clean:build": "rimraf ./dist",
|
|
12
|
+
"dev": "nodemon",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"lint:fix": "eslint --fix .",
|
|
15
|
+
"format": "prettier --check .",
|
|
16
|
+
"format:fix": "prettier --write .",
|
|
17
|
+
"test": "vitest --run",
|
|
18
|
+
"test:watch": "vitest",
|
|
19
|
+
"typecheck": "tsc"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
23
|
+
"@typescript-eslint/parser": "^8.21.0",
|
|
24
|
+
"eslint": "^9.18.0",
|
|
25
|
+
"eslint-config-prettier": "^10.0.1",
|
|
26
|
+
"prettier": "^3.4.2",
|
|
27
|
+
"rimraf": "^6.0.1",
|
|
28
|
+
"typescript": "^5.7.3"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"yaml": "^2.8.2"
|
|
32
|
+
},
|
|
33
|
+
"version": "0.2.0"
|
|
34
|
+
}
|