airdy 0.1.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.
@@ -0,0 +1,88 @@
1
+ import { readFile, readdir, stat } from "node:fs/promises";
2
+ import { join, relative } from "node:path";
3
+ async function readOptional(path) {
4
+ try {
5
+ return await readFile(path, "utf8");
6
+ }
7
+ catch {
8
+ return null;
9
+ }
10
+ }
11
+ async function listFiles(root, current, acc) {
12
+ let entries;
13
+ try {
14
+ entries = await readdir(current);
15
+ }
16
+ catch {
17
+ return;
18
+ }
19
+ for (const entry of entries) {
20
+ const full = join(current, entry);
21
+ const s = await stat(full);
22
+ if (s.isDirectory())
23
+ await listFiles(root, full, acc);
24
+ else
25
+ acc.push(relative(root, full));
26
+ }
27
+ }
28
+ export async function loadModule(dir) {
29
+ const manifestRaw = await readFile(join(dir, "module.json"), "utf8");
30
+ const manifest = JSON.parse(manifestRaw);
31
+ const hooksRaw = await readOptional(join(dir, "hooks.json"));
32
+ const docsRaw = await readOptional(join(dir, "docs.md"));
33
+ const files = [];
34
+ await listFiles(join(dir, "files"), join(dir, "files"), files);
35
+ return {
36
+ name: manifest.name,
37
+ description: manifest.description,
38
+ agents: manifest.agents,
39
+ platforms: manifest.platforms,
40
+ dir,
41
+ hooksPatch: hooksRaw ? JSON.parse(hooksRaw) : undefined,
42
+ docsSection: docsRaw ?? undefined,
43
+ files,
44
+ };
45
+ }
46
+ export async function moduleToActions(module) {
47
+ const actions = [];
48
+ for (const rel of module.files) {
49
+ const contents = await readFile(join(module.dir, "files", rel), "utf8");
50
+ actions.push({
51
+ type: "write-file",
52
+ path: rel,
53
+ contents,
54
+ mode: "overwrite",
55
+ });
56
+ }
57
+ if (module.hooksPatch) {
58
+ actions.push({
59
+ type: "merge-json",
60
+ path: ".claude/settings.json",
61
+ patch: module.hooksPatch,
62
+ });
63
+ }
64
+ if (module.docsSection) {
65
+ actions.push({
66
+ type: "merge-markdown",
67
+ path: "AGENTS.md",
68
+ marker: `airdy:workflow:${module.name}`,
69
+ section: module.docsSection,
70
+ });
71
+ }
72
+ return actions;
73
+ }
74
+ const SUPERPOWERS_DOC = `### superpowers
75
+
76
+ This project follows the superpowers workflow (brainstorm → plan → TDD → review).
77
+ Install the plugin in your agent, then invoke skills such as \`superpowers:brainstorming\`
78
+ and \`superpowers:writing-plans\` before implementation.`;
79
+ export function builtinSuperpowersActions() {
80
+ return [
81
+ {
82
+ type: "merge-markdown",
83
+ path: "AGENTS.md",
84
+ marker: "airdy:workflow:superpowers",
85
+ section: SUPERPOWERS_DOC,
86
+ },
87
+ ];
88
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "airdy",
3
+ "version": "0.1.0",
4
+ "description": "Interactive project setup wizard for coding agents (claude-code, codex)",
5
+ "keywords": [
6
+ "cli",
7
+ "wizard",
8
+ "scaffold",
9
+ "coding-agent",
10
+ "claude-code",
11
+ "codex",
12
+ "agents",
13
+ "setup"
14
+ ],
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Raiy-TW/airdy.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/Raiy-TW/airdy/issues"
22
+ },
23
+ "homepage": "https://github.com/Raiy-TW/airdy#readme",
24
+ "type": "module",
25
+ "bin": {
26
+ "airdy": "./bin/airdy.js"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "bin"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc -p tsconfig.json",
37
+ "prepack": "npm run build",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest",
40
+ "typecheck": "tsc --noEmit -p tsconfig.test.json"
41
+ },
42
+ "dependencies": {
43
+ "@clack/prompts": "^0.7.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^20.12.0",
47
+ "typescript": "^5.4.0",
48
+ "vitest": "^1.6.0"
49
+ }
50
+ }