@christianmaf80/agentic-workflow 1.5.0-beta.1 → 1.7.0-beta.1
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/bin/cli.js +6 -0
- package/dist/bootstrap.md +1 -1
- package/dist/cli/commands/clean.js +18 -0
- package/dist/cli/commands/init.js +15 -0
- package/dist/cli/commands/restore.js +2 -2
- package/dist/core/migration/backup.js +3 -2
- package/dist/core/utils/backup.js +1 -1
- package/dist/rules/constitution/agent-system.md +1 -1
- package/dist/templates/brief.md +6 -6
- package/dist/templates/init.md +7 -0
- package/dist/templates/research.md +12 -0
- package/dist/workflows/init.md +16 -18
- package/dist/workflows/tasklifecycle-long/phase-1-research.md +8 -4
- package/dist/workflows/tasklifecycle-short/short-phase-1-brief.md +1 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { initCommand } from '../dist/cli/commands/init.js';
|
|
4
4
|
import { createCommand } from '../dist/cli/commands/create.js';
|
|
5
5
|
import { restoreCommand } from '../dist/cli/commands/restore.js';
|
|
6
|
+
import { cleanCommand } from '../dist/cli/commands/clean.js';
|
|
6
7
|
|
|
7
8
|
const program = new Command();
|
|
8
9
|
|
|
@@ -28,4 +29,9 @@ program
|
|
|
28
29
|
.description('Restore the agentic system from a backup')
|
|
29
30
|
.action(restoreCommand);
|
|
30
31
|
|
|
32
|
+
program
|
|
33
|
+
.command('clean')
|
|
34
|
+
.description('Remove legacy configuration files (e.g. MCP)')
|
|
35
|
+
.action(cleanCommand);
|
|
36
|
+
|
|
31
37
|
program.parse();
|
package/dist/bootstrap.md
CHANGED
|
@@ -508,7 +508,7 @@ Discipline is non-negotiable. The local metrics system will apply the **Zero Tol
|
|
|
508
508
|
To ensure the resilience of the local orchestration history:
|
|
509
509
|
|
|
510
510
|
### 3.1 Preventive Auto-Backups
|
|
511
|
-
- The system MUST perform a backup of the `.agent/` folder to `.
|
|
511
|
+
- The system MUST perform a backup of the `.agent/` folder to `.backups/TIMESTAMP/` before executing destructive commands:
|
|
512
512
|
- `init --force`
|
|
513
513
|
- Massive migration operations.
|
|
514
514
|
- Scheduled cleanup.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { intro, outro, spinner } from '@clack/prompts';
|
|
4
|
+
export async function cleanCommand() {
|
|
5
|
+
intro('Agentic Workflow Cleanup');
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
const s = spinner();
|
|
8
|
+
s.start('Removing legacy MCP config...');
|
|
9
|
+
const mcpConfigPath = path.join(cwd, '.antigravity', 'task_mcp_config.json');
|
|
10
|
+
try {
|
|
11
|
+
await fs.rm(mcpConfigPath, { force: true });
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// Ignore if missing or not removable.
|
|
15
|
+
}
|
|
16
|
+
s.stop('Cleanup complete.');
|
|
17
|
+
outro('Legacy MCP configuration removed.');
|
|
18
|
+
}
|
|
@@ -47,6 +47,7 @@ export async function initCommand() {
|
|
|
47
47
|
const sCleanup = spinner();
|
|
48
48
|
sCleanup.start('Cleaning up redundant legacy core files...');
|
|
49
49
|
await cleanupLegacyFiles(agentDir);
|
|
50
|
+
await cleanupLegacyMcpConfig(cwd);
|
|
50
51
|
sCleanup.stop('Local environment cleaned (Core references only).');
|
|
51
52
|
const s = spinner();
|
|
52
53
|
s.start('Configuring Agentic Core Reference...');
|
|
@@ -193,3 +194,17 @@ async function cleanupLegacyFiles(agentDir) {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Removes legacy MCP configuration if present.
|
|
199
|
+
*/
|
|
200
|
+
async function cleanupLegacyMcpConfig(cwd) {
|
|
201
|
+
const mcpConfigPath = path.join(cwd, '.antigravity', 'task_mcp_config.json');
|
|
202
|
+
try {
|
|
203
|
+
await fs.rm(mcpConfigPath, { force: true });
|
|
204
|
+
const mcpDir = path.join(cwd, '.antigravity');
|
|
205
|
+
await fs.rmdir(mcpDir);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Ignore if missing or not removable.
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -4,12 +4,12 @@ import path from 'node:path';
|
|
|
4
4
|
export async function restoreCommand() {
|
|
5
5
|
intro('Agentic Workflow Recovery');
|
|
6
6
|
const cwd = process.cwd();
|
|
7
|
-
const backupBaseDir = path.join(cwd, '.
|
|
7
|
+
const backupBaseDir = path.join(cwd, '.backups');
|
|
8
8
|
try {
|
|
9
9
|
await fs.access(backupBaseDir);
|
|
10
10
|
}
|
|
11
11
|
catch {
|
|
12
|
-
outro('No backups were found in .
|
|
12
|
+
outro('No backups were found in .backups/');
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const backups = await fs.readdir(backupBaseDir);
|
|
@@ -3,10 +3,11 @@ import path from 'node:path';
|
|
|
3
3
|
export async function createBackup(cwd) {
|
|
4
4
|
const agentDir = path.join(cwd, '.agent');
|
|
5
5
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
6
|
-
const backupDir = path.join(cwd,
|
|
6
|
+
const backupDir = path.join(cwd, '.backups', timestamp, '.agent');
|
|
7
7
|
try {
|
|
8
|
+
await fs.mkdir(path.dirname(backupDir), { recursive: true });
|
|
8
9
|
await fs.cp(agentDir, backupDir, { recursive: true });
|
|
9
|
-
return backupDir;
|
|
10
|
+
return path.dirname(backupDir);
|
|
10
11
|
}
|
|
11
12
|
catch (error) {
|
|
12
13
|
throw new Error(`Failed to create backup: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -5,7 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
*/
|
|
6
6
|
export async function performBackup(cwd) {
|
|
7
7
|
const agentDir = path.join(cwd, '.agent');
|
|
8
|
-
const backupBaseDir = path.join(cwd, '.
|
|
8
|
+
const backupBaseDir = path.join(cwd, '.backups');
|
|
9
9
|
// Check if .agent exists
|
|
10
10
|
try {
|
|
11
11
|
await fs.access(agentDir);
|
|
@@ -50,7 +50,7 @@ Discipline is non-negotiable. The local metrics system will apply the **Zero Tol
|
|
|
50
50
|
To ensure the resilience of the local orchestration history:
|
|
51
51
|
|
|
52
52
|
### 3.1 Preventive Auto-Backups
|
|
53
|
-
- The system MUST perform a backup of the `.agent/` folder to `.
|
|
53
|
+
- The system MUST perform a backup of the `.agent/` folder to `.backups/TIMESTAMP/` before executing destructive commands:
|
|
54
54
|
- `init --force`
|
|
55
55
|
- Massive migration operations.
|
|
56
56
|
- Scheduled cleanup.
|
package/dist/templates/brief.md
CHANGED
|
@@ -20,15 +20,15 @@ First line of the document:
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
## 2. The 5 Mandatory Questions
|
|
23
|
+
## 2. The 5 Mandatory Questions (Dynamic)
|
|
24
24
|
|
|
25
25
|
| # | Question (formulated by architect) | Answer (from developer) |
|
|
26
26
|
|---|-----------------------------------|-------------------------|
|
|
27
|
-
| 1 | | |
|
|
28
|
-
| 2 | | |
|
|
29
|
-
| 3 | | |
|
|
30
|
-
| 4 | | |
|
|
31
|
-
| 5 | | |
|
|
27
|
+
| 1 | <dynamic question based on task description> | |
|
|
28
|
+
| 2 | <dynamic question based on task description> | |
|
|
29
|
+
| 3 | <dynamic question based on task description> | |
|
|
30
|
+
| 4 | <dynamic question based on task description> | |
|
|
31
|
+
| 5 | <dynamic question based on task description> | |
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
package/dist/templates/init.md
CHANGED
|
@@ -24,6 +24,18 @@ First line of the document:
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
+
## Clarifications (5 Mandatory Questions, Dynamic)
|
|
28
|
+
|
|
29
|
+
| # | Question (formulated by architect) | Answer (from developer) |
|
|
30
|
+
|---|-----------------------------------|-------------------------|
|
|
31
|
+
| 1 | <dynamic question based on task description> | |
|
|
32
|
+
| 2 | <dynamic question based on task description> | |
|
|
33
|
+
| 3 | <dynamic question based on task description> | |
|
|
34
|
+
| 4 | <dynamic question based on task description> | |
|
|
35
|
+
| 5 | <dynamic question based on task description> | |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
27
39
|
## 2. Detected Needs
|
|
28
40
|
- Technical requirements identified by the architect-agent
|
|
29
41
|
- Assumptions and limits
|
package/dist/workflows/init.md
CHANGED
|
@@ -19,41 +19,39 @@ blocking: true
|
|
|
19
19
|
|
|
20
20
|
## Objective (ONLY)
|
|
21
21
|
- Activate the **architect-agent** role.
|
|
22
|
-
- Load the
|
|
23
|
-
-
|
|
24
|
-
- Detect the conversation language and confirm explicitly.
|
|
25
|
-
- **Select the lifecycle strategy (Long/Short)**.
|
|
22
|
+
- Load the prebuilt bootstrap bundle (constitutions + indexes + core roles).
|
|
23
|
+
- Capture developer language, name, strategy, and first task description.
|
|
26
24
|
- Create the **task candidate** artifact `init.md`.
|
|
27
25
|
|
|
28
26
|
## Mandatory Steps
|
|
29
|
-
1.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
1. Use the `bootstrap_context` tool to load the prebuilt core bootstrap bundle plus local indices in a single step.
|
|
28
|
+
2. Save the bundle output to `.agent/artifacts/candidate/bootstrap.md`.
|
|
29
|
+
3. Ask the developer to confirm language (**YES**).
|
|
30
|
+
4. Ask the developer for their preferred name (used in all future responses).
|
|
31
|
+
5. Ask the developer to choose lifecycle strategy: **short (fast)** or **long**.
|
|
32
|
+
6. Ask for the first task description (1-3 sentences).
|
|
33
|
+
7. Create the `init.md` artifact using `templates.init`.
|
|
34
|
+
8. Evaluate Gate.
|
|
37
35
|
- The developer **MUST** explicitly confirm with a **YES**.
|
|
38
36
|
|
|
39
37
|
## Output (REQUIRED)
|
|
40
38
|
- Created artifact: `artifacts.candidate.init` (from `templates.init`).
|
|
41
39
|
- Created artifact: `artifacts.candidate.bootstrap` (bundle from `bootstrap_context`).
|
|
42
40
|
|
|
43
|
-
## Reasoning (MANDATORY)
|
|
44
|
-
- Before executing, the architect-agent must explain to the developer what will be done and why.
|
|
45
|
-
- No document is required for this step.
|
|
46
|
-
|
|
47
41
|
## Pass
|
|
48
42
|
- `init.md` is created from `templates.init`.
|
|
49
|
-
- Language is confirmed
|
|
43
|
+
- Language is confirmed, developer name is captured, strategy is set, and task description exists.
|
|
50
44
|
- `bootstrap.md` exists and contains the bundle.
|
|
51
45
|
|
|
52
46
|
## Gate (REQUIRED)
|
|
53
47
|
Requirements (all mandatory):
|
|
54
48
|
1. `artifacts.candidate.init` exists.
|
|
55
49
|
2. `artifacts.candidate.bootstrap` exists.
|
|
56
|
-
3. In `init.md` YAML:
|
|
50
|
+
3. In `init.md` YAML:
|
|
51
|
+
- `language.confirmed == true`
|
|
52
|
+
- `developer.name` is defined
|
|
53
|
+
- `strategy` is defined
|
|
54
|
+
- `task.description` is defined
|
|
57
55
|
4. The developer has explicitly approved with **YES**.
|
|
58
56
|
|
|
59
57
|
If Gate FAIL:
|
|
@@ -70,11 +70,15 @@ blocking: true
|
|
|
70
70
|
- `task.md` contains acceptance criteria
|
|
71
71
|
- If fails → go to **Step 8 (FAIL)**.
|
|
72
72
|
|
|
73
|
-
2.
|
|
73
|
+
2. Ask 5 mandatory clarification questions (architect-agent)
|
|
74
|
+
- Generate them dynamically from the task description to clarify scope, inputs, outputs, constraints, and success criteria.
|
|
75
|
+
- Capture answers in `research.md` under a `clarifications` section.
|
|
76
|
+
|
|
77
|
+
3. Load research template (architect-agent)
|
|
74
78
|
- Load `templates.research`
|
|
75
79
|
- If it doesn't exist or cannot be read → go to **Step 8 (FAIL)**.
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
4. **Delegate to researcher-agent (MANDATORY)**
|
|
78
82
|
> ⚠️ **PERMANENT RULE**: The `architect-agent` **CANNOT** create the research report.
|
|
79
83
|
> The `researcher-agent` is the **only authorized agent** to create `research.md`.
|
|
80
84
|
|
|
@@ -98,7 +102,7 @@ blocking: true
|
|
|
98
102
|
- Official or prestigious sources
|
|
99
103
|
- Hand back control to the `architect-agent` upon completion
|
|
100
104
|
|
|
101
|
-
|
|
105
|
+
5. Request developer approval (MANDATORY, via console)
|
|
102
106
|
- The developer **MUST** issue a binary decision:
|
|
103
107
|
- **YES** → Approved
|
|
104
108
|
- **NO** → Rejected
|
|
@@ -112,7 +116,7 @@ blocking: true
|
|
|
112
116
|
```
|
|
113
117
|
- If `decision != YES` → go to **Step 8 (FAIL)**.
|
|
114
118
|
|
|
115
|
-
|
|
119
|
+
6. PASS
|
|
116
120
|
- Update `.agent/artifacts/<taskId>-<taskTitle>/task.md` (using prefix):
|
|
117
121
|
- Mark Phase 1 as completed
|
|
118
122
|
- Set `task.lifecycle.phases.phase-1-research.validated_at = <ISO-8601>`
|
package/package.json
CHANGED