Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,4 @@ vite.config.ts.timestamp-*
# Core dump files
core
core.*
.claude/
20 changes: 10 additions & 10 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"git": {
"commitMessage": "chore(release): v${version}",
"tagName": "v${version}",
"requireBranch": ["main", "master"],
"requireCleanWorkingDir": false,
"requireBranch": ["main", "master"]
"tagName": "v${version}"
},
"github": {
"release": true,
"releaseName": "v${version}",
"autoGenerate": {
"template": "compact"
}
},
"npm": {
"publish": true
},
"release": true,
"releaseName": "v${version}"
},
"hooks": {
"before:init": ["npm test"],
"after:release": [
"node lib/update-latest-tag-hook.js ${version}",
"echo 🎉 Successfully released ${name} v${version}"
]
],
"before:init": ["npm test"]
},
"npm": {
"publish": true
}
}
4 changes: 4 additions & 0 deletions ai/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ See [`javascript/index.md`](./javascript/index.md) for contents.

See [`security/index.md`](./security/index.md) for contents.

### 📁 sudolang/

See [`sudolang/index.md`](./sudolang/index.md) for contents.

## Files

### Aiden Agent Orchestrator
Expand Down
12 changes: 12 additions & 0 deletions ai/rules/sudolang/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# sudolang

This index provides an overview of the contents in this directory.

## Files

### SudoLang Syntax

**File:** `sudolang-syntax.mdc`

A quick cheat sheet for SudoLang syntax.

55 changes: 28 additions & 27 deletions ai/rules/user-testing.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { assert } from "riteway/vitest";
import { describe, test } from "vitest";
import fs from "fs-extra";
import path from "path";
import { fileURLToPath } from "url";
import fs from "fs-extra";
import { assert } from "riteway/vitest";
import { describe, test } from "vitest";

import { parseFrontmatter } from "../../lib/index-generator.js";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand All @@ -14,27 +15,27 @@ describe("user-testing", () => {
const exists = await fs.pathExists(filePath);

assert({
given: "user-testing.mdc file",
should: "exist in ai/rules directory",
actual: exists,
expected: true,
given: "user-testing.mdc file",
should: "exist in ai/rules directory",
});

const content = await fs.readFile(filePath, "utf-8");
const frontmatter = parseFrontmatter(content);

assert({
given: "user-testing.mdc frontmatter",
should: "have description field",
actual: typeof frontmatter?.description,
expected: "string",
given: "user-testing.mdc frontmatter",
should: "have description field",
});

assert({
given: "user-testing.mdc frontmatter",
should: "have alwaysApply set to false",
actual: frontmatter?.alwaysApply,
expected: false,
given: "user-testing.mdc frontmatter",
should: "have alwaysApply set to false",
});
});

Expand All @@ -43,17 +44,17 @@ describe("user-testing", () => {
const content = await fs.readFile(filePath, "utf-8");

assert({
given: "user-testing.mdc content",
should: "include HumanScript template",
actual: content.includes("HumanScript:template"),
expected: true,
given: "user-testing.mdc content",
should: "include HumanScript template",
});

assert({
given: "user-testing.mdc content",
should: "include AgentScript template",
actual: content.includes("AgentScript:template"),
expected: true,
given: "user-testing.mdc content",
should: "include AgentScript template",
});
});
});
Expand All @@ -64,10 +65,10 @@ describe("user-testing", () => {
const exists = await fs.pathExists(filePath);

assert({
given: "user-test.md command file",
should: "exist in ai/commands directory",
actual: exists,
expected: true,
given: "user-test.md command file",
should: "exist in ai/commands directory",
});
});

Expand All @@ -76,12 +77,12 @@ describe("user-testing", () => {
const content = await fs.readFile(filePath, "utf-8");

assert({
given: "user-test.md content",
should: "reference user-testing.mdc",
actual:
content.includes("@user-testing.mdc") ||
content.includes("user-testing.mdc"),
expected: true,
given: "user-test.md content",
should: "reference user-testing.mdc",
});
});
});
Expand All @@ -92,10 +93,10 @@ describe("user-testing", () => {
const exists = await fs.pathExists(filePath);

assert({
given: "run-test.md command file",
should: "exist in ai/commands directory",
actual: exists,
expected: true,
given: "run-test.md command file",
should: "exist in ai/commands directory",
});
});

Expand All @@ -104,12 +105,12 @@ describe("user-testing", () => {
const content = await fs.readFile(filePath, "utf-8");

assert({
given: "run-test.md content",
should: "reference user-testing.mdc",
actual:
content.includes("@user-testing.mdc") ||
content.includes("user-testing.mdc"),
expected: true,
given: "run-test.md content",
should: "reference user-testing.mdc",
});
});
});
Expand All @@ -120,10 +121,10 @@ describe("user-testing", () => {
const exists = await fs.pathExists(filePath);

assert({
given: "user-testing.md documentation",
should: "exist in docs directory",
actual: exists,
expected: true,
given: "user-testing.md documentation",
should: "exist in docs directory",
});
});
});
Expand All @@ -134,17 +135,17 @@ describe("user-testing", () => {
const content = await fs.readFile(filePath, "utf-8");

assert({
given: "README.md content",
should: "include /user-test in command list",
actual: content.includes("/user-test"),
expected: true,
given: "README.md content",
should: "include /user-test in command list",
});

assert({
given: "README.md content",
should: "link to user testing documentation",
actual: content.includes("docs/user-testing.md"),
expected: true,
given: "README.md content",
should: "link to user testing documentation",
});
});
});
Expand Down
47 changes: 24 additions & 23 deletions bin/aidd.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env node

import { Command } from "commander";
import { executeClone } from "../lib/cli-core.js";
import { generateAllIndexes } from "../lib/index-generator.js";
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
import path from "path";
import process from "process";
import { errorCauses } from "error-causes";
import { fileURLToPath } from "url";
import chalk from "chalk";
import { Command } from "commander";
import { errorCauses } from "error-causes";

import { executeClone } from "../lib/cli-core.js";
import { generateAllIndexes } from "../lib/index-generator.js";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -18,17 +19,17 @@ const packageJson = JSON.parse(

// Use the same error causes as the CLI library
const [, handleCliErrors] = errorCauses({
ValidationError: {
code: "VALIDATION_ERROR",
message: "Input validation failed",
CloneError: {
code: "CLONE_ERROR",
message: "AI folder cloning failed",
},
FileSystemError: {
code: "FILESYSTEM_ERROR",
message: "File system operation failed",
},
CloneError: {
code: "CLONE_ERROR",
message: "AI folder cloning failed",
ValidationError: {
code: "VALIDATION_ERROR",
message: "Input validation failed",
},
});

Expand Down Expand Up @@ -150,11 +151,11 @@ https://paralleldrive.com
}

const result = await executeClone({
targetDirectory,
force,
cursor,
dryRun,
force,
targetDirectory,
verbose,
cursor,
});

if (!result.success) {
Expand All @@ -168,11 +169,14 @@ https://paralleldrive.com
// Use handleErrors instead of manual switching
try {
handleCliErrors({
ValidationError: ({ message }) => {
console.error(`❌ Validation Error: ${message}`);
CloneError: ({ message, cause }) => {
console.error(`❌ Clone Error: ${message}`);
console.error(
"💡 Try using --force to overwrite existing files",
"💡 Check source directory and target permissions",
);
if (verbose && cause) {
console.error("🔍 Caused by:", cause.message || cause);
}
},
FileSystemError: ({ message, cause }) => {
console.error(`❌ File System Error: ${message}`);
Expand All @@ -183,14 +187,11 @@ https://paralleldrive.com
console.error("🔍 Caused by:", cause.message || cause);
}
},
CloneError: ({ message, cause }) => {
console.error(`❌ Clone Error: ${message}`);
ValidationError: ({ message }) => {
console.error(`❌ Validation Error: ${message}`);
console.error(
"💡 Check source directory and target permissions",
"💡 Try using --force to overwrite existing files",
);
if (verbose && cause) {
console.error("🔍 Caused by:", cause.message || cause);
}
},
})(error);
} catch {
Expand Down
8 changes: 4 additions & 4 deletions bin/cli-help-e2e.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { assert } from "riteway/vitest";
import { describe, test } from "vitest";
import { exec } from "child_process";
import { promisify } from "util";
import { fileURLToPath } from "url";
import path from "path";
import { fileURLToPath } from "url";
import { promisify } from "util";
import { assert } from "riteway/vitest";
import { describe, test } from "vitest";

const execAsync = promisify(exec);
const __filename = fileURLToPath(import.meta.url);
Expand Down
Loading