@e0ipso/ai-task-manager 1.11.0 → 1.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e0ipso/ai-task-manager",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Task management for AI coding assistants",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ /**
7
+ * Detect the currently running AI assistant based on environment variables and directory presence
8
+ * @returns {string} Assistant identifier: 'claude', 'gemini', 'opencode', 'cursor', or 'unknown'
9
+ */
10
+ function detectAssistant() {
11
+ // 1. Check environment variables (highest priority)
12
+ if (process.env.CLAUDECODE) {
13
+ return 'claude';
14
+ }
15
+
16
+ if (process.env.GEMINI_CODE) {
17
+ return 'gemini';
18
+ }
19
+
20
+ if (process.env.OPENCODE) {
21
+ return 'opencode';
22
+ }
23
+
24
+ if (process.env.CURSOR) {
25
+ return 'cursor';
26
+ }
27
+
28
+ // 2. Check directory presence (fallback)
29
+ const cwd = process.cwd();
30
+
31
+ const assistantDirs = [
32
+ { name: 'claude', dir: '.claude' },
33
+ { name: 'gemini', dir: '.gemini' },
34
+ { name: 'opencode', dir: '.opencode' },
35
+ { name: 'cursor', dir: '.cursor' }
36
+ ];
37
+
38
+ for (const { name, dir } of assistantDirs) {
39
+ const dirPath = path.join(cwd, dir);
40
+
41
+ try {
42
+ if (fs.existsSync(dirPath)) {
43
+ const stats = fs.statSync(dirPath);
44
+ if (stats.isDirectory()) {
45
+ return name;
46
+ }
47
+ }
48
+ } catch (err) {
49
+ // Handle filesystem errors gracefully (e.g., permission issues)
50
+ continue;
51
+ }
52
+ }
53
+
54
+ // 3. Default: unknown
55
+ return 'unknown';
56
+ }
57
+
58
+ // Main execution with error handling
59
+ try {
60
+ const assistant = detectAssistant();
61
+ console.log(assistant);
62
+ process.exit(0);
63
+ } catch (error) {
64
+ // Graceful degradation: output 'unknown' even on error
65
+ console.log('unknown');
66
+ process.exit(0);
67
+ }
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ // Configuration path mapping
8
+ const CONFIG_PATHS = {
9
+ claude: {
10
+ global: [path.join(os.homedir(), '.claude', 'CLAUDE.md')],
11
+ project: ['AGENTS.md', 'CLAUDE.md']
12
+ },
13
+ gemini: {
14
+ global: [path.join(os.homedir(), '.gemini', 'GEMINI.md')],
15
+ project: ['.gemini/styleguide.md']
16
+ },
17
+ opencode: {
18
+ global: [path.join(os.homedir(), '.opencode', 'OPENCODE.md')],
19
+ project: ['AGENTS.md', 'OPENCODE.md']
20
+ },
21
+ cursor: {
22
+ global: [path.join(os.homedir(), '.cursor', 'rules', 'index.mdc')],
23
+ project: ['.cursor/index.mdc']
24
+ }
25
+ };
26
+
27
+ function readConfigFile(filePath) {
28
+ try {
29
+ if (fs.existsSync(filePath)) {
30
+ const content = fs.readFileSync(filePath, 'utf-8');
31
+ return content.trim();
32
+ }
33
+ return null;
34
+ } catch (error) {
35
+ return null;
36
+ }
37
+ }
38
+
39
+ function readAssistantConfig(assistant) {
40
+ const configs = CONFIG_PATHS[assistant];
41
+
42
+ if (!configs) {
43
+ return '';
44
+ }
45
+
46
+ const output = [];
47
+
48
+ // Read global configs
49
+ let globalContent = null;
50
+ for (const globalPath of configs.global) {
51
+ const content = readConfigFile(globalPath);
52
+ if (content) {
53
+ globalContent = content;
54
+ break; // Use first found
55
+ }
56
+ }
57
+
58
+ if (globalContent) {
59
+ output.push('## Global Assistant Configuration\n');
60
+ output.push(globalContent);
61
+ output.push('\n');
62
+ }
63
+
64
+ // Read project configs
65
+ let projectContent = null;
66
+ for (const projectPath of configs.project) {
67
+ const fullPath = path.join(process.cwd(), projectPath);
68
+ const content = readConfigFile(fullPath);
69
+ if (content) {
70
+ projectContent = content;
71
+ break; // Use first found
72
+ }
73
+ }
74
+
75
+ if (projectContent) {
76
+ output.push('## Project-Level Configuration\n');
77
+ output.push(projectContent);
78
+ output.push('\n');
79
+ }
80
+
81
+ return output.join('\n');
82
+ }
83
+
84
+ // Main execution
85
+ const assistant = process.argv[2];
86
+
87
+ if (!assistant) {
88
+ process.exit(0); // Silent exit for graceful degradation
89
+ }
90
+
91
+ try {
92
+ const config = readAssistantConfig(assistant);
93
+ if (config) {
94
+ console.log(config);
95
+ }
96
+ process.exit(0);
97
+ } catch (error) {
98
+ process.exit(0); // Graceful degradation
99
+ }
@@ -4,6 +4,20 @@ description: Create a comprehensive plan to accomplish the request from the user
4
4
  ---
5
5
  # Comprehensive Plan Creation
6
6
 
7
+ ## Assistant Configuration
8
+
9
+ Before proceeding with this command, you MUST load and respect the assistant's configuration:
10
+
11
+ **Run the following scripts:**
12
+ ```bash
13
+ ASSISTANT=$(node .ai/task-manager/config/scripts/detect-assistant.cjs)
14
+ node .ai/task-manager/config/scripts/read-assistant-config.cjs "$ASSISTANT"
15
+ ```
16
+
17
+ The output above contains your global and project-level configuration rules. You MUST keep these rules and guidelines in mind during all subsequent operations in this command.
18
+
19
+ ---
20
+
7
21
  Think harder and use tools.
8
22
 
9
23
  You are a comprehensive task planning assistant. Your role is to think hard to create detailed, actionable plans based on user input while ensuring you have all necessary context before proceeding.
@@ -4,6 +4,20 @@ description: Execute the task in the plan
4
4
  ---
5
5
  # Task Execution
6
6
 
7
+ ## Assistant Configuration
8
+
9
+ Before proceeding with this command, you MUST load and respect the assistant's configuration:
10
+
11
+ **Run the following scripts:**
12
+ ```bash
13
+ ASSISTANT=$(node .ai/task-manager/config/scripts/detect-assistant.cjs)
14
+ node .ai/task-manager/config/scripts/read-assistant-config.cjs "$ASSISTANT"
15
+ ```
16
+
17
+ The output above contains your global and project-level configuration rules. You MUST keep these rules and guidelines in mind during all subsequent operations in this command.
18
+
19
+ ---
20
+
7
21
  You are the orchestrator responsible for executing all tasks defined in the execution blueprint of a plan document, so choose an appropriate sub-agent for this role. Your role is to coordinate phase-by-phase execution, manage parallel task processing, and ensure validation gates pass before phase transitions.
8
22
 
9
23
  ## Critical Rules
@@ -36,7 +50,8 @@ Use your internal Todo task tool to track the execution of all phases, and the f
36
50
  - [ ] Execute .ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 3.
37
51
  - [ ] Phase 3: Execute 1 task(s) in parallel.
38
52
  - [ ] Execute .ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 3.
39
- - [ ] Update the Plan 7 with execution summary, and the archive it.
53
+ - [ ] Update the Plan 7 with execution summary using .ai/task-manager/config/hooks/EXECUTION_SUMMARY_TEMPLATE.md.
54
+ - [ ] Archive Plan 7.
40
55
 
41
56
  ### Phase Pre-Execution
42
57
 
@@ -5,6 +5,20 @@ description: Generate tasks to implement the plan with the provided ID.
5
5
 
6
6
  # Comprehensive Task List Creation
7
7
 
8
+ ## Assistant Configuration
9
+
10
+ Before proceeding with this command, you MUST load and respect the assistant's configuration:
11
+
12
+ **Run the following scripts:**
13
+ ```bash
14
+ ASSISTANT=$(node .ai/task-manager/config/scripts/detect-assistant.cjs)
15
+ node .ai/task-manager/config/scripts/read-assistant-config.cjs "$ASSISTANT"
16
+ ```
17
+
18
+ The output above contains your global and project-level configuration rules. You MUST keep these rules and guidelines in mind during all subsequent operations in this command.
19
+
20
+ ---
21
+
8
22
  Think harder and use tools.
9
23
 
10
24
  You are a comprehensive task planning assistant. Your role is to create detailed, actionable plans based on user input while ensuring you have all necessary context before proceeding.