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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,10 @@ vite.config.ts.timestamp-*
# Core dump files
core
core.*
.claude/

# Local AIDD database
.aidd/

# Local task files
tasks/
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.

7 changes: 4 additions & 3 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 Down
50 changes: 17 additions & 33 deletions bin/aidd.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
#!/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 { executeClone, handleCliErrors } from "../lib/cli-core.js";
import { generateAllIndexes } from "../lib/index-generator.js";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const packageJson = JSON.parse(
readFileSync(path.join(__dirname, "../package.json"), "utf-8"),
);

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

const createCli = () => {
const program = new Command();

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

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

if (!result.success) {
Expand All @@ -168,11 +152,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 +170,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
120 changes: 120 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.12/schema.json",
"assist": {
"actions": {
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [":NODE:", ":PACKAGE:", ":BLANK_LINE:", ":PATH:"]
}
},
"useSortedAttributes": "on",
"useSortedKeys": "on"
}
},
"enabled": true
},
"css": {
"parser": {
"tailwindDirectives": true
}
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!.react-router"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"linter": {
"enabled": true,
"rules": {
"correctness": {
"noReactPropAssignments": "error",
"noUnusedFunctionParameters": "error",
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useHookAtTopLevel": "error",
"useJsonImportAttributes": "error",
"useJsxKeyInIterable": "error",
"useSingleJsDocAsterisk": "error"
},
"recommended": true,
"style": {
"noRestrictedGlobals": "off",
"useForOf": "error",
"useImportType": {
"level": "error",
"options": {
"style": "separatedType"
}
},
"useNodejsImportProtocol": "off",
"useNumberNamespace": "error",
"useNumericSeparators": "error",
"useSelfClosingElements": "error",
"useTrimStartEnd": "error"
},
"suspicious": {
"noDuplicateTestHooks": "error",
"noFocusedTests": "error",
"noGlobalIsFinite": "off",
"noGlobalIsNan": "error",
"noMisplacedAssertion": "error",
"noUnknownAtRules": "off"
}
}
},
"overrides": [
{
"includes": ["**/*.d.ts"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
},
{
"assist": {
"actions": {
"source": {
"useSortedKeys": "off"
}
}
},
"includes": ["**/*.test.js", "**/*.test.ts", "**/*.test.tsx"],
"linter": {
"rules": {
"correctness": {
"noUnusedFunctionParameters": "off"
}
}
}
},
{
"assist": {
"actions": {
"source": {
"useSortedKeys": "off"
}
}
},
"includes": ["package.json"]
}
],
"vcs": {
"clientKind": "git",
"defaultBranch": "main",
"enabled": true,
"useIgnoreFile": true
}
}
27 changes: 0 additions & 27 deletions eslint.config.mjs

This file was deleted.

14 changes: 6 additions & 8 deletions lib/agents-index-e2e.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { assert } from "riteway/vitest";
import { describe, test, beforeEach, afterEach } from "vitest";
import { exec } from "child_process";
import { promisify } from "util";
import fs from "fs-extra";
import path from "path";
import { fileURLToPath } from "url";
import { promisify } from "util";
import fs from "fs-extra";
import { assert } from "riteway/vitest";
import { afterEach, beforeEach, describe, test } from "vitest";

import { executeClone } from "./cli-core.js";
import { hasAllDirectives } from "./agents-md.js";
import { executeClone } from "./cli-core.js";

const execAsync = promisify(exec);
const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -188,9 +188,7 @@ This is a test rule.
});

test("--index generates index.md files", async () => {
const { stdout, stderr } = await execAsync(
`node ${cliPath} --index "${tempTestDir}"`,
);
await execAsync(`node ${cliPath} --index "${tempTestDir}"`);

const aiIndexExists = await fs.pathExists(path.join(aiPath, "index.md"));
const commandsIndexExists = await fs.pathExists(
Expand Down
10 changes: 8 additions & 2 deletions lib/agents-md.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ export function getMissingDirectives(content: string): string[];
* @param content - Content to write
* @throws {Error} If file cannot be written
*/
export function writeAgentsFile(targetBase: string, content: string): Promise<void>;
export function writeAgentsFile(
targetBase: string,
content: string,
): Promise<void>;

/**
* Append directives to existing AGENTS.md
* @param targetBase - Base directory containing AGENTS.md
* @param existingContent - Current content of AGENTS.md
*/
export function appendDirectives(targetBase: string, existingContent: string): Promise<void>;
export function appendDirectives(
targetBase: string,
existingContent: string,
): Promise<void>;

/**
* Ensure AGENTS.md exists with required directives
Expand Down
Loading