@orderful/droid 0.23.0 → 0.25.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/.eslintrc.json +6 -4
- package/AGENTS.md +58 -0
- package/CHANGELOG.md +44 -0
- package/README.md +11 -6
- package/dist/bin/droid.js +384 -170
- package/dist/commands/config.d.ts +15 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/exec.d.ts +10 -0
- package/dist/commands/exec.d.ts.map +1 -0
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/index.js +171 -33
- package/dist/lib/migrations.d.ts.map +1 -1
- package/dist/lib/skills.d.ts.map +1 -1
- package/dist/tools/codex/TOOL.yaml +2 -2
- package/dist/tools/codex/agents/codex-document-processor.md +8 -4
- package/dist/tools/codex/commands/codex.md +18 -10
- package/dist/tools/codex/skills/droid-codex/SKILL.md +140 -67
- package/dist/tools/codex/skills/droid-codex/references/creating.md +13 -51
- package/dist/tools/codex/skills/droid-codex/references/decisions.md +15 -19
- package/dist/tools/codex/skills/droid-codex/references/loading.md +49 -13
- package/dist/tools/codex/skills/droid-codex/references/topics.md +14 -12
- package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.d.ts +31 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.d.ts.map +1 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.ts +236 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.d.ts +20 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.d.ts.map +1 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.ts +156 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-scripts.test.ts +364 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.d.ts +23 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.d.ts.map +1 -0
- package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.ts +172 -0
- package/package.json +1 -1
- package/src/bin/droid.ts +9 -0
- package/src/commands/config.ts +38 -4
- package/src/commands/exec.ts +96 -0
- package/src/commands/install.ts +1 -1
- package/src/commands/setup.ts +6 -6
- package/src/commands/tui.tsx +254 -175
- package/src/lib/migrations.ts +103 -10
- package/src/lib/quotes.ts +6 -6
- package/src/lib/skills.ts +168 -45
- package/src/tools/codex/TOOL.yaml +2 -2
- package/src/tools/codex/agents/codex-document-processor.md +8 -4
- package/src/tools/codex/commands/codex.md +18 -10
- package/src/tools/codex/skills/droid-codex/SKILL.md +140 -67
- package/src/tools/codex/skills/droid-codex/references/creating.md +13 -51
- package/src/tools/codex/skills/droid-codex/references/decisions.md +15 -19
- package/src/tools/codex/skills/droid-codex/references/loading.md +49 -13
- package/src/tools/codex/skills/droid-codex/references/topics.md +14 -12
- package/src/tools/codex/skills/droid-codex/scripts/git-finish-write.ts +236 -0
- package/src/tools/codex/skills/droid-codex/scripts/git-preamble.ts +156 -0
- package/src/tools/codex/skills/droid-codex/scripts/git-scripts.test.ts +364 -0
- package/src/tools/codex/skills/droid-codex/scripts/git-start-write.ts +172 -0
|
@@ -3,6 +3,20 @@ interface ConfigOptions {
|
|
|
3
3
|
get?: string;
|
|
4
4
|
set?: string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Merged config for a tool
|
|
8
|
+
* Contains global values plus tool-specific overrides
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolConfig {
|
|
11
|
+
user_mention: string;
|
|
12
|
+
ai_mention: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get merged config for a tool (global + overrides)
|
|
17
|
+
* Used by deterministic scripts via `droid config <tool>`
|
|
18
|
+
*/
|
|
19
|
+
export declare function getToolConfig(toolName: string): ToolConfig;
|
|
20
|
+
export declare function configCommand(tool?: string, options?: ConfigOptions): Promise<void>;
|
|
7
21
|
export {};
|
|
8
22
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAYA,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAS1D;AAED,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA4EzF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute a tool script
|
|
3
|
+
*
|
|
4
|
+
* Usage: droid exec <tool> <script> [args...]
|
|
5
|
+
*
|
|
6
|
+
* Finds the script in the tool's scripts/ directory and runs it with the
|
|
7
|
+
* appropriate runtime (bun for .ts/.js, python3 for .py)
|
|
8
|
+
*/
|
|
9
|
+
export declare function execCommand(tool: string, script: string, args: string[]): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/commands/exec.ts"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/commands/tui.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/commands/tui.tsx"],"names":[],"mappings":"AAkiBA,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBhD"}
|
package/dist/index.js
CHANGED
|
@@ -187,7 +187,14 @@ function setAutoUpdateConfig(updates) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
// src/lib/skills.ts
|
|
190
|
-
import {
|
|
190
|
+
import {
|
|
191
|
+
existsSync as existsSync5,
|
|
192
|
+
readdirSync as readdirSync4,
|
|
193
|
+
readFileSync as readFileSync5,
|
|
194
|
+
mkdirSync as mkdirSync4,
|
|
195
|
+
writeFileSync as writeFileSync3,
|
|
196
|
+
rmSync as rmSync2
|
|
197
|
+
} from "fs";
|
|
191
198
|
import { join as join7, dirname as dirname5, basename } from "path";
|
|
192
199
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
193
200
|
import YAML4 from "yaml";
|
|
@@ -338,6 +345,20 @@ function loadToolManifest(toolDir) {
|
|
|
338
345
|
return null;
|
|
339
346
|
}
|
|
340
347
|
}
|
|
348
|
+
function getBundledTools() {
|
|
349
|
+
if (!existsSync2(BUNDLED_TOOLS_DIR)) {
|
|
350
|
+
return [];
|
|
351
|
+
}
|
|
352
|
+
const toolDirs = readdirSync(BUNDLED_TOOLS_DIR, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
353
|
+
const tools = [];
|
|
354
|
+
for (const toolName of toolDirs) {
|
|
355
|
+
const manifest = loadToolManifest(join4(BUNDLED_TOOLS_DIR, toolName));
|
|
356
|
+
if (manifest) {
|
|
357
|
+
tools.push(manifest);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return tools;
|
|
361
|
+
}
|
|
341
362
|
|
|
342
363
|
// src/lib/agents.ts
|
|
343
364
|
var __dirname3 = dirname3(fileURLToPath3(import.meta.url));
|
|
@@ -463,7 +484,14 @@ function uninstallAgent(agentName) {
|
|
|
463
484
|
}
|
|
464
485
|
|
|
465
486
|
// src/lib/migrations.ts
|
|
466
|
-
import {
|
|
487
|
+
import {
|
|
488
|
+
existsSync as existsSync4,
|
|
489
|
+
appendFileSync,
|
|
490
|
+
mkdirSync as mkdirSync3,
|
|
491
|
+
renameSync,
|
|
492
|
+
rmSync,
|
|
493
|
+
readdirSync as readdirSync3
|
|
494
|
+
} from "fs";
|
|
467
495
|
import { join as join6, dirname as dirname4 } from "path";
|
|
468
496
|
var MIGRATIONS_LOG_FILE = ".migrations.log";
|
|
469
497
|
function getMigrationsLogPath() {
|
|
@@ -501,11 +529,54 @@ function createConfigDirMigration(skillName, version) {
|
|
|
501
529
|
}
|
|
502
530
|
};
|
|
503
531
|
}
|
|
532
|
+
function createPlatformSyncMigration(version) {
|
|
533
|
+
return {
|
|
534
|
+
version,
|
|
535
|
+
description: "Sync installed tools from disk to config",
|
|
536
|
+
up: () => {
|
|
537
|
+
const config = loadConfig();
|
|
538
|
+
const bundledTools = getBundledTools();
|
|
539
|
+
let configChanged = false;
|
|
540
|
+
const originalPlatform = config.platform;
|
|
541
|
+
for (const platformKey of ["claude-code" /* ClaudeCode */, "opencode" /* OpenCode */]) {
|
|
542
|
+
const skillsPath = getSkillsPath(platformKey);
|
|
543
|
+
if (!existsSync4(skillsPath)) continue;
|
|
544
|
+
config.platform = platformKey;
|
|
545
|
+
const trackedTools = getPlatformTools(config);
|
|
546
|
+
const installedDirs = readdirSync3(skillsPath, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
547
|
+
for (const skillName of installedDirs) {
|
|
548
|
+
const normalizedName = skillName.replace(/^droid-/, "");
|
|
549
|
+
const isTracked = trackedTools[skillName] || trackedTools[`droid-${normalizedName}`] || trackedTools[normalizedName];
|
|
550
|
+
if (isTracked) continue;
|
|
551
|
+
const matchingTool = bundledTools.find(
|
|
552
|
+
(tool) => tool.includes.skills.some((s) => s.name === skillName)
|
|
553
|
+
);
|
|
554
|
+
if (matchingTool) {
|
|
555
|
+
trackedTools[skillName] = {
|
|
556
|
+
version: matchingTool.version,
|
|
557
|
+
installed_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
558
|
+
};
|
|
559
|
+
configChanged = true;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (configChanged) {
|
|
563
|
+
setPlatformTools(config, trackedTools);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
config.platform = originalPlatform;
|
|
567
|
+
if (configChanged) {
|
|
568
|
+
saveConfig(config);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
}
|
|
504
573
|
var TOOL_MIGRATIONS = {
|
|
505
574
|
brain: [createConfigDirMigration("droid-brain", "0.2.3")],
|
|
506
575
|
comments: [createConfigDirMigration("droid-comments", "0.2.6")],
|
|
507
576
|
project: [createConfigDirMigration("droid-project", "0.1.5")],
|
|
508
|
-
coach: [createConfigDirMigration("droid-coach", "0.1.3")]
|
|
577
|
+
coach: [createConfigDirMigration("droid-coach", "0.1.3")],
|
|
578
|
+
// Global migration for the droid meta-tool
|
|
579
|
+
droid: [createPlatformSyncMigration("0.25.0")]
|
|
509
580
|
};
|
|
510
581
|
function getToolMigrations(toolName) {
|
|
511
582
|
return TOOL_MIGRATIONS[toolName] ?? [];
|
|
@@ -540,8 +611,17 @@ function runMigrations(toolName, fromVersion, toVersion) {
|
|
|
540
611
|
logMigration(toolName, fromVersion, migration.version, "OK");
|
|
541
612
|
} catch (error) {
|
|
542
613
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
543
|
-
logMigration(
|
|
544
|
-
|
|
614
|
+
logMigration(
|
|
615
|
+
toolName,
|
|
616
|
+
fromVersion,
|
|
617
|
+
migration.version,
|
|
618
|
+
"FAILED",
|
|
619
|
+
errorMessage
|
|
620
|
+
);
|
|
621
|
+
return {
|
|
622
|
+
success: false,
|
|
623
|
+
error: `Migration ${migration.version} failed: ${errorMessage}`
|
|
624
|
+
};
|
|
545
625
|
}
|
|
546
626
|
}
|
|
547
627
|
setLastMigratedVersion(toolName, toVersion);
|
|
@@ -641,7 +721,7 @@ function findSkillPath(skillName) {
|
|
|
641
721
|
if (!existsSync5(BUNDLED_SKILLS_DIR)) {
|
|
642
722
|
return null;
|
|
643
723
|
}
|
|
644
|
-
const toolDirs =
|
|
724
|
+
const toolDirs = readdirSync4(BUNDLED_SKILLS_DIR, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
645
725
|
for (const toolName of toolDirs) {
|
|
646
726
|
const skillsDir = join7(BUNDLED_SKILLS_DIR, toolName, "skills");
|
|
647
727
|
if (!existsSync5(skillsDir)) continue;
|
|
@@ -659,12 +739,12 @@ function getBundledSkills() {
|
|
|
659
739
|
if (!existsSync5(BUNDLED_SKILLS_DIR)) {
|
|
660
740
|
return [];
|
|
661
741
|
}
|
|
662
|
-
const toolDirs =
|
|
742
|
+
const toolDirs = readdirSync4(BUNDLED_SKILLS_DIR, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
663
743
|
const skills = [];
|
|
664
744
|
for (const toolName of toolDirs) {
|
|
665
745
|
const skillsDir = join7(BUNDLED_SKILLS_DIR, toolName, "skills");
|
|
666
746
|
if (!existsSync5(skillsDir)) continue;
|
|
667
|
-
const skillSubdirs =
|
|
747
|
+
const skillSubdirs = readdirSync4(skillsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
668
748
|
for (const skillName of skillSubdirs) {
|
|
669
749
|
const manifest = loadSkillManifest(join7(skillsDir, skillName));
|
|
670
750
|
if (manifest) {
|
|
@@ -723,10 +803,16 @@ function updateSkill(skillName) {
|
|
|
723
803
|
return { success: false, message: `Skill '${skillName}' is not installed` };
|
|
724
804
|
}
|
|
725
805
|
if (!status.bundledVersion) {
|
|
726
|
-
return {
|
|
806
|
+
return {
|
|
807
|
+
success: false,
|
|
808
|
+
message: `Skill '${skillName}' not found in bundled skills`
|
|
809
|
+
};
|
|
727
810
|
}
|
|
728
811
|
if (!status.hasUpdate) {
|
|
729
|
-
return {
|
|
812
|
+
return {
|
|
813
|
+
success: false,
|
|
814
|
+
message: `Skill '${skillName}' is already at latest version (${status.installedVersion})`
|
|
815
|
+
};
|
|
730
816
|
}
|
|
731
817
|
const result = installSkill(skillName);
|
|
732
818
|
if (result.success) {
|
|
@@ -776,7 +862,10 @@ function installSkill(skillName) {
|
|
|
776
862
|
const { toolDir, skillDir } = skillPath;
|
|
777
863
|
const manifest = loadSkillManifest(skillDir);
|
|
778
864
|
if (!manifest) {
|
|
779
|
-
return {
|
|
865
|
+
return {
|
|
866
|
+
success: false,
|
|
867
|
+
message: `Invalid skill manifest for '${skillName}'`
|
|
868
|
+
};
|
|
780
869
|
}
|
|
781
870
|
if (manifest.dependencies) {
|
|
782
871
|
for (const dep of manifest.dependencies) {
|
|
@@ -793,30 +882,41 @@ function installSkill(skillName) {
|
|
|
793
882
|
const commandsPath = getCommandsInstallPath(config.platform);
|
|
794
883
|
const tools = getPlatformTools(config);
|
|
795
884
|
if (skillName.startsWith("droid-")) {
|
|
796
|
-
const
|
|
797
|
-
const oldSkillDir = join7(skillsPath,
|
|
885
|
+
const oldSkillName2 = skillName.replace(/^droid-/, "");
|
|
886
|
+
const oldSkillDir = join7(skillsPath, oldSkillName2);
|
|
798
887
|
if (existsSync5(oldSkillDir)) {
|
|
799
888
|
try {
|
|
800
889
|
rmSync2(oldSkillDir, { recursive: true });
|
|
801
890
|
} catch (error) {
|
|
802
|
-
console.warn(
|
|
891
|
+
console.warn(
|
|
892
|
+
`Warning: Could not remove old skill directory ${oldSkillDir}: ${error}`
|
|
893
|
+
);
|
|
803
894
|
}
|
|
804
895
|
}
|
|
805
|
-
if (tools[
|
|
806
|
-
delete tools[
|
|
896
|
+
if (tools[oldSkillName2]) {
|
|
897
|
+
delete tools[oldSkillName2];
|
|
807
898
|
setPlatformTools(config, tools);
|
|
808
899
|
saveConfig(config);
|
|
809
900
|
}
|
|
810
901
|
}
|
|
811
902
|
const commandsSource = join7(toolDir, "commands");
|
|
812
903
|
const agentsSource = join7(toolDir, "agents");
|
|
813
|
-
|
|
904
|
+
const oldSkillName = skillName.startsWith("droid-") ? skillName.replace(/^droid-/, "") : null;
|
|
905
|
+
const isAlreadyInstalled = tools[skillName] || oldSkillName && tools[oldSkillName];
|
|
906
|
+
if (!isAlreadyInstalled) {
|
|
907
|
+
const toolName2 = basename(toolDir);
|
|
908
|
+
const normalizedToolName = toolName2.replace(/^droid-/, "");
|
|
814
909
|
if (existsSync5(commandsSource)) {
|
|
815
|
-
const commandFiles =
|
|
910
|
+
const commandFiles = readdirSync4(commandsSource).filter(
|
|
911
|
+
(f) => f.endsWith(".md") && f.toLowerCase() !== "readme.md"
|
|
912
|
+
);
|
|
816
913
|
for (const file of commandFiles) {
|
|
817
914
|
const targetCommandPath = join7(commandsPath, file);
|
|
818
915
|
if (existsSync5(targetCommandPath)) {
|
|
819
916
|
const commandName = file.replace(".md", "");
|
|
917
|
+
if (commandName === toolName2 || commandName === normalizedToolName) {
|
|
918
|
+
continue;
|
|
919
|
+
}
|
|
820
920
|
return {
|
|
821
921
|
success: false,
|
|
822
922
|
message: `Cannot install: command /${commandName} already exists at ${targetCommandPath}`
|
|
@@ -825,8 +925,8 @@ function installSkill(skillName) {
|
|
|
825
925
|
}
|
|
826
926
|
}
|
|
827
927
|
if (existsSync5(agentsSource)) {
|
|
828
|
-
const
|
|
829
|
-
for (const agentName of
|
|
928
|
+
const agentFiles = readdirSync4(agentsSource, { withFileTypes: true }).filter((dirent) => dirent.isFile() && dirent.name.endsWith(".md")).map((dirent) => dirent.name.replace(".md", ""));
|
|
929
|
+
for (const agentName of agentFiles) {
|
|
830
930
|
if (isAgentInstalled(agentName)) {
|
|
831
931
|
return {
|
|
832
932
|
success: false,
|
|
@@ -854,7 +954,9 @@ function installSkill(skillName) {
|
|
|
854
954
|
if (!existsSync5(targetReferencesDir)) {
|
|
855
955
|
mkdirSync4(targetReferencesDir, { recursive: true });
|
|
856
956
|
}
|
|
857
|
-
const referenceFiles =
|
|
957
|
+
const referenceFiles = readdirSync4(referencesSource).filter(
|
|
958
|
+
(f) => f.endsWith(".md")
|
|
959
|
+
);
|
|
858
960
|
for (const file of referenceFiles) {
|
|
859
961
|
const sourcePath = join7(referencesSource, file);
|
|
860
962
|
const targetPath = join7(targetReferencesDir, file);
|
|
@@ -862,11 +964,29 @@ function installSkill(skillName) {
|
|
|
862
964
|
writeFileSync3(targetPath, content);
|
|
863
965
|
}
|
|
864
966
|
}
|
|
967
|
+
const scriptsSource = join7(skillDir, "scripts");
|
|
968
|
+
if (existsSync5(scriptsSource)) {
|
|
969
|
+
const targetScriptsDir = join7(targetSkillDir, "scripts");
|
|
970
|
+
if (!existsSync5(targetScriptsDir)) {
|
|
971
|
+
mkdirSync4(targetScriptsDir, { recursive: true });
|
|
972
|
+
}
|
|
973
|
+
const scriptFiles = readdirSync4(scriptsSource).filter(
|
|
974
|
+
(f) => f.endsWith(".ts") || f.endsWith(".js") || f.endsWith(".py")
|
|
975
|
+
);
|
|
976
|
+
for (const file of scriptFiles) {
|
|
977
|
+
const sourcePath = join7(scriptsSource, file);
|
|
978
|
+
const targetPath = join7(targetScriptsDir, file);
|
|
979
|
+
const content = readFileSync5(sourcePath, "utf-8");
|
|
980
|
+
writeFileSync3(targetPath, content);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
865
983
|
if (existsSync5(commandsSource)) {
|
|
866
984
|
if (!existsSync5(commandsPath)) {
|
|
867
985
|
mkdirSync4(commandsPath, { recursive: true });
|
|
868
986
|
}
|
|
869
|
-
const commandFiles =
|
|
987
|
+
const commandFiles = readdirSync4(commandsSource).filter(
|
|
988
|
+
(f) => f.endsWith(".md") && f.toLowerCase() !== "readme.md"
|
|
989
|
+
);
|
|
870
990
|
for (const file of commandFiles) {
|
|
871
991
|
const sourcePath = join7(commandsSource, file);
|
|
872
992
|
const targetPath = join7(commandsPath, file);
|
|
@@ -876,10 +996,10 @@ function installSkill(skillName) {
|
|
|
876
996
|
}
|
|
877
997
|
const installedAgents = [];
|
|
878
998
|
if (existsSync5(agentsSource)) {
|
|
879
|
-
const
|
|
880
|
-
for (const agentName of
|
|
881
|
-
const
|
|
882
|
-
const result = installAgentFromPath(
|
|
999
|
+
const agentFiles = readdirSync4(agentsSource, { withFileTypes: true }).filter((dirent) => dirent.isFile() && dirent.name.endsWith(".md")).map((dirent) => dirent.name.replace(".md", ""));
|
|
1000
|
+
for (const agentName of agentFiles) {
|
|
1001
|
+
const agentPath = join7(agentsSource, `${agentName}.md`);
|
|
1002
|
+
const result = installAgentFromPath(agentPath, agentName);
|
|
883
1003
|
if (result.success) {
|
|
884
1004
|
installedAgents.push(agentName);
|
|
885
1005
|
}
|
|
@@ -900,9 +1020,14 @@ function installSkill(skillName) {
|
|
|
900
1020
|
const toolName = basename(toolDir);
|
|
901
1021
|
const migrationResult = runToolMigrations(toolName, manifest.version);
|
|
902
1022
|
if (!migrationResult.success) {
|
|
903
|
-
console.warn(
|
|
1023
|
+
console.warn(
|
|
1024
|
+
`Warning: Migration failed for ${toolName}: ${migrationResult.error}`
|
|
1025
|
+
);
|
|
904
1026
|
}
|
|
905
|
-
return {
|
|
1027
|
+
return {
|
|
1028
|
+
success: true,
|
|
1029
|
+
message: `Installed ${skillName} v${manifest.version}`
|
|
1030
|
+
};
|
|
906
1031
|
}
|
|
907
1032
|
function uninstallSkill(skillName) {
|
|
908
1033
|
const config = loadConfig();
|
|
@@ -919,7 +1044,9 @@ function uninstallSkill(skillName) {
|
|
|
919
1044
|
const commandsPath = getCommandsInstallPath(config.platform);
|
|
920
1045
|
const commandsSource = skillPath ? join7(skillPath.toolDir, "commands") : null;
|
|
921
1046
|
if (commandsSource && existsSync5(commandsSource)) {
|
|
922
|
-
const commandFiles =
|
|
1047
|
+
const commandFiles = readdirSync4(commandsSource).filter(
|
|
1048
|
+
(f) => f.endsWith(".md") && f.toLowerCase() !== "readme.md"
|
|
1049
|
+
);
|
|
923
1050
|
for (const file of commandFiles) {
|
|
924
1051
|
const commandPath = join7(commandsPath, file);
|
|
925
1052
|
if (existsSync5(commandPath)) {
|
|
@@ -969,16 +1096,24 @@ function installCommand(commandName, skillName) {
|
|
|
969
1096
|
}
|
|
970
1097
|
const commandsDir = join7(skillPath.toolDir, "commands");
|
|
971
1098
|
if (!existsSync5(commandsDir)) {
|
|
972
|
-
return {
|
|
1099
|
+
return {
|
|
1100
|
+
success: false,
|
|
1101
|
+
message: `No commands found for skill '${skillName}'`
|
|
1102
|
+
};
|
|
973
1103
|
}
|
|
974
1104
|
const cmdPart = commandName.startsWith(skillName + " ") ? commandName.slice(skillName.length + 1) : commandName;
|
|
975
|
-
const files =
|
|
1105
|
+
const files = readdirSync4(commandsDir).filter(
|
|
1106
|
+
(f) => f.endsWith(".md") && f.toLowerCase() !== "readme.md"
|
|
1107
|
+
);
|
|
976
1108
|
const sourceFile = files.find((f) => {
|
|
977
1109
|
const base = f.replace(".md", "");
|
|
978
1110
|
return base === cmdPart || base === cmdPart.replace(/\s+/g, "-");
|
|
979
1111
|
});
|
|
980
1112
|
if (!sourceFile) {
|
|
981
|
-
return {
|
|
1113
|
+
return {
|
|
1114
|
+
success: false,
|
|
1115
|
+
message: `Command file not found for: ${commandName}`
|
|
1116
|
+
};
|
|
982
1117
|
}
|
|
983
1118
|
const commandsPath = getCommandsInstallPath(config.platform);
|
|
984
1119
|
if (!existsSync5(commandsPath)) {
|
|
@@ -1015,7 +1150,10 @@ function uninstallCommand(commandName, skillName) {
|
|
|
1015
1150
|
rmSync2(commandPath);
|
|
1016
1151
|
return { success: true, message: `Uninstalled /${commandName}` };
|
|
1017
1152
|
} catch (error) {
|
|
1018
|
-
return {
|
|
1153
|
+
return {
|
|
1154
|
+
success: false,
|
|
1155
|
+
message: `Failed to uninstall command: ${error}`
|
|
1156
|
+
};
|
|
1019
1157
|
}
|
|
1020
1158
|
}
|
|
1021
1159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/lib/migrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/lib/migrations.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;AAgKjB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CAE/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,CAON;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA2CtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAStC"}
|
package/dist/lib/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/lib/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/lib/skills.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,KAA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AE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAwCvC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: codex
|
|
2
|
-
description: "Shared organizational knowledge - PRDs, tech designs, patterns, and explored topics. Use when loading project context, searching codex, capturing decisions, or
|
|
3
|
-
version: 0.1.
|
|
2
|
+
description: "Shared organizational knowledge - PRDs, tech designs, domains, proposals, patterns, and explored topics. Use when loading project context, searching codex, capturing decisions, or creating new entries."
|
|
3
|
+
version: 0.1.2
|
|
4
4
|
status: beta
|
|
5
5
|
|
|
6
6
|
includes:
|
|
@@ -14,7 +14,7 @@ You are a document processor for the Orderful codex. Your job is to transform so
|
|
|
14
14
|
|
|
15
15
|
You will receive:
|
|
16
16
|
1. **File path** - The source document to process
|
|
17
|
-
2. **Document type** - One of: `prd`, `tech-design`, `topic`, `pattern`, `artifact`
|
|
17
|
+
2. **Document type** - One of: `prd`, `tech-design`, `topic`, `pattern`, `domain`, `proposal`, `artifact`
|
|
18
18
|
3. **Project/entry name** - Where this should be stored in the codex
|
|
19
19
|
4. **Codex repo path** - The local path to orderful-codex repository
|
|
20
20
|
5. **Artifact filename** (optional, for artifacts) - Name for the artifact file
|
|
@@ -23,7 +23,7 @@ You will receive:
|
|
|
23
23
|
|
|
24
24
|
Before processing, validate all inputs:
|
|
25
25
|
|
|
26
|
-
1. **Document type** - Must be one of: `prd`, `tech-design`, `topic`, `pattern`, `artifact`. Reject anything else.
|
|
26
|
+
1. **Document type** - Must be one of: `prd`, `tech-design`, `topic`, `pattern`, `domain`, `proposal`, `artifact`. Reject anything else.
|
|
27
27
|
2. **File path** - Must exist and be readable. Use Read tool to verify.
|
|
28
28
|
3. **Project/entry name** - Must be safe for filesystem paths:
|
|
29
29
|
- Only allow: alphanumeric, dashes, underscores
|
|
@@ -47,11 +47,11 @@ From the content, identify:
|
|
|
47
47
|
- **Codebase paths** (if tech-design) - Any code paths mentioned
|
|
48
48
|
- **Source** - Default based on type:
|
|
49
49
|
- PRD/tech-design: `confluence`
|
|
50
|
-
- Topic/pattern: `exploration`
|
|
50
|
+
- Topic/pattern/domain/proposal: `exploration`
|
|
51
51
|
- Artifact: infer from content (`interview`, `transcript`, `notes`, `meeting`, `research`, `spike`, `analysis`)
|
|
52
52
|
- **Status** - Default based on type:
|
|
53
53
|
- PRD/tech-design: `draft` (new imports start as drafts)
|
|
54
|
-
- Topic/pattern/artifact: `active`
|
|
54
|
+
- Topic/pattern/domain/proposal/artifact: `active`
|
|
55
55
|
|
|
56
56
|
### 3. Read and Apply Frontmatter Template
|
|
57
57
|
|
|
@@ -63,6 +63,8 @@ From the content, identify:
|
|
|
63
63
|
| `tech-design` | `{codex_repo}/templates/TECH-DESIGN.md` |
|
|
64
64
|
| `topic` | `{codex_repo}/templates/TOPIC.md` |
|
|
65
65
|
| `pattern` | `{codex_repo}/templates/PATTERN.md` |
|
|
66
|
+
| `domain` | `{codex_repo}/templates/DOMAIN.md` |
|
|
67
|
+
| `proposal` | `{codex_repo}/templates/PROPOSAL.md` |
|
|
66
68
|
| `artifact` | `{codex_repo}/templates/ARTIFACT.md` |
|
|
67
69
|
|
|
68
70
|
1. Read the appropriate template file
|
|
@@ -95,6 +97,8 @@ Write the processed markdown to the correct location:
|
|
|
95
97
|
| `tech-design` | `{codex_repo}/projects/{name}/TECH-DESIGN.md` |
|
|
96
98
|
| `topic` | `{codex_repo}/topics/{name}.md` |
|
|
97
99
|
| `pattern` | `{codex_repo}/patterns/{name}.md` |
|
|
100
|
+
| `domain` | `{codex_repo}/domains/{name}.md` |
|
|
101
|
+
| `proposal` | `{codex_repo}/proposals/{name}.md` |
|
|
98
102
|
| `artifact` | `{codex_repo}/projects/{name}/artifacts/{filename}.md` |
|
|
99
103
|
|
|
100
104
|
For artifacts, derive `{filename}` from the artifact filename input or the source file's name (slugified).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Shared organizational knowledge - PRDs, tech designs, patterns, and explored topics
|
|
3
|
-
argument-hint: "[projects | patterns | topics | {name} | search {query} | new {name} | decision {text}
|
|
2
|
+
description: Shared organizational knowledge - PRDs, tech designs, patterns, domains, proposals, and explored topics
|
|
3
|
+
argument-hint: "[projects | domains | proposals | patterns | topics | {name} | search {query} | new {type} {name} | decision {text}]"
|
|
4
4
|
allowed-tools: Read, Write, Edit, Glob, Grep, Bash(gh:*), Bash(git:*), Bash(ls:*), Bash(mkdir:*)
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -24,16 +24,23 @@ Before first use, verify:
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
/codex # Show categories (
|
|
27
|
+
/codex # Show categories (5 total)
|
|
28
28
|
/codex projects # List projects
|
|
29
|
+
/codex domains # List domains
|
|
30
|
+
/codex proposals # List proposals
|
|
29
31
|
/codex patterns # List patterns
|
|
30
32
|
/codex topics # List topics
|
|
31
33
|
/codex {name} # Load entry (searches all categories)
|
|
32
34
|
/codex search {query} # Search across everything
|
|
33
|
-
/codex new {name} # Scaffold new project
|
|
35
|
+
/codex new {name} # Scaffold new project (shorthand)
|
|
36
|
+
/codex new project {name} # Scaffold new project from templates
|
|
37
|
+
/codex new domain {name} # Scaffold new domain entry
|
|
38
|
+
/codex new proposal {name} # Scaffold new proposal entry
|
|
39
|
+
/codex new pattern {name} # Scaffold new pattern entry
|
|
40
|
+
/codex new topic {name} # Scaffold new topic entry
|
|
34
41
|
/codex decision {text} # Append to active project's DECISIONS.md
|
|
35
|
-
/codex snapshot {file} {name}
|
|
36
|
-
/codex
|
|
42
|
+
/codex snapshot {type} {file} {name} # Import PDF/markdown to codex
|
|
43
|
+
/codex artifact {file} {project} # Add supporting artifact to project
|
|
37
44
|
```
|
|
38
45
|
|
|
39
46
|
## Configuration
|
|
@@ -48,8 +55,7 @@ Before first use, verify:
|
|
|
48
55
|
Refer to the codex skill for:
|
|
49
56
|
- **Loading**: How to search, handle matches, check freshness, auto-generate CONTEXT.md
|
|
50
57
|
- **Decisions**: How to append to active project's DECISIONS.md
|
|
51
|
-
- **
|
|
52
|
-
- **Creating**: How to scaffold new projects from templates
|
|
58
|
+
- **Creating**: How to scaffold new entries (projects, domains, proposals, patterns, topics)
|
|
53
59
|
|
|
54
60
|
The skill's `references/` folder contains detailed procedures for each workflow.
|
|
55
61
|
|
|
@@ -65,6 +71,8 @@ The skill's `references/` folder contains detailed procedures for each workflow.
|
|
|
65
71
|
# Capture a decision during implementation
|
|
66
72
|
/codex decision "Using UUIDv7 for IDs because it's sortable and includes timestamp"
|
|
67
73
|
|
|
68
|
-
#
|
|
69
|
-
/codex
|
|
74
|
+
# Create new entries
|
|
75
|
+
/codex new domain partnerships
|
|
76
|
+
/codex new proposal caching-layer
|
|
77
|
+
/codex new topic organization-hierarchy
|
|
70
78
|
```
|