abelworkflow 0.7.0 → 0.8.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/.gitignore +2 -0
- package/AGENTS.md +3 -3
- package/README.md +5 -5
- package/commands/{oc/diagnose.md → abel-diagnose.md} +6 -6
- package/commands/{oc/implementation.md → abel-implement.md} +5 -5
- package/commands/{oc/init.md → abel-init.md} +8 -8
- package/commands/{oc/plan.md → abel-plan.md} +7 -7
- package/commands/{oc/research.md → abel-research.md} +9 -9
- package/lib/cli.mjs +225 -19
- package/lib/templates/codex/agents/default.toml +1 -1
- package/lib/templates/codex/agents/explorer.toml +1 -1
- package/lib/templates/codex/agents/planner.toml +1 -1
- package/lib/templates/codex/agents/reviewer.toml +1 -1
- package/lib/templates/codex/agents/worker.toml +1 -1
- package/lib/templates/codex/config-base.toml +7 -3
- package/package.json +2 -1
package/.gitignore
CHANGED
package/AGENTS.md
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
## Context Rules
|
|
15
15
|
|
|
16
|
-
-
|
|
16
|
+
- {{CODEBASE_RETRIEVAL_POLICY}}
|
|
17
17
|
- Rely only on project code plus `grok/context7` results
|
|
18
18
|
- If information is insufficient or uncertain, state it explicitly
|
|
19
19
|
|
|
20
20
|
## Workflow
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
/
|
|
24
|
-
|
|
23
|
+
/abel-init → /abel-research → /abel-plan → /abel-implement(TDD)
|
|
24
|
+
↘ /abel-diagnose (bug fix)
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Universal Constraints
|
package/README.md
CHANGED
|
@@ -178,15 +178,15 @@ node .\bin\abelworkflow.mjs install
|
|
|
178
178
|
|---|---|---|---|
|
|
179
179
|
| `AGENTS.md` | `~/.claude/CLAUDE.md` | `~/.codex/AGENTS.md` | 全局系统提示词/规则 |
|
|
180
180
|
| `skills/<skill>/` | `~/.claude/skills/<skill>/` | `~/.codex/skills/<skill>/` | Skills(每个目录一个技能) |
|
|
181
|
-
| `commands/
|
|
181
|
+
| `commands/abel-*.md` | `~/.claude/commands/abel-*.md` | `~/.codex/prompts/abel-*.md` | 扁平化部署,避免命名冲突 |
|
|
182
182
|
|
|
183
183
|
### 验证(可选)
|
|
184
184
|
|
|
185
185
|
**Linux/macOS(bash/zsh)**
|
|
186
186
|
|
|
187
187
|
```bash
|
|
188
|
-
ls -la "$HOME/.claude/CLAUDE.md" "$HOME/.claude/commands/
|
|
189
|
-
ls -la "$HOME/.codex/AGENTS.md" "$HOME/.codex/prompts/"
|
|
188
|
+
ls -la "$HOME/.claude/CLAUDE.md" "$HOME/.claude/commands/"abel-*.md
|
|
189
|
+
ls -la "$HOME/.codex/AGENTS.md" "$HOME/.codex/prompts/"abel-*.md
|
|
190
190
|
cat "$HOME/.claude/settings.json" | head
|
|
191
191
|
cat "$HOME/.codex/config.toml" | head
|
|
192
192
|
```
|
|
@@ -194,9 +194,9 @@ cat "$HOME/.codex/config.toml" | head
|
|
|
194
194
|
**Windows(PowerShell)**
|
|
195
195
|
|
|
196
196
|
```powershell
|
|
197
|
-
Get-Item "$HOME\.claude\CLAUDE.md"
|
|
197
|
+
Get-Item "$HOME\.claude\CLAUDE.md"; Get-ChildItem "$HOME\.claude\commands\abel-*.md"
|
|
198
198
|
Get-Item "$HOME\.codex\AGENTS.md"
|
|
199
|
-
Get-ChildItem "$HOME\.codex\prompts
|
|
199
|
+
Get-ChildItem "$HOME\.codex\prompts\abel-*.md"
|
|
200
200
|
Get-Content "$HOME\.claude\settings.json" -TotalCount 10
|
|
201
201
|
Get-Content "$HOME\.codex\config.toml" -TotalCount 10
|
|
202
202
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: abel-diagnose
|
|
3
3
|
description: Parallel diagnosis with batch fix reporting via systematic root cause analysis.
|
|
4
|
-
category:
|
|
5
|
-
tags: [diagnosis, bugfix]
|
|
4
|
+
category: abel
|
|
5
|
+
tags: [abel, diagnosis, bugfix]
|
|
6
6
|
argument-hint: <problem-description>
|
|
7
7
|
---
|
|
8
|
-
<!--
|
|
8
|
+
<!-- ABEL:START -->
|
|
9
9
|
**Arguments**
|
|
10
10
|
- Required: `<problem-description>` (one or more bug descriptions; comma-separated supported)
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ argument-hint: <problem-description>
|
|
|
31
31
|
|
|
32
32
|
**Steps**
|
|
33
33
|
1. Parse input, infer scope, and split into issue list (single or multiple).
|
|
34
|
-
2. For each issue in parallel: collect logs/traces and locate code via
|
|
34
|
+
2. For each issue in parallel: collect logs/traces and locate code via the configured codebase retrieval policy.
|
|
35
35
|
3. For each issue in parallel: perform root cause analysis; use `/sequential-think` for multi-component chains.
|
|
36
36
|
4. Build dependency/conflict graph across issues and compute safe fix order.
|
|
37
37
|
5. Run `/confidence-check` per issue; only issues with score ≥90% can move to fix generation.
|
|
@@ -60,4 +60,4 @@ Total: {n} | ReadyToFix: {n_ready} | Blocked: {n_blocked}
|
|
|
60
60
|
### Final Status
|
|
61
61
|
{FIXED|PARTIAL|NEEDS_REVIEW|BLOCKED}
|
|
62
62
|
```
|
|
63
|
-
<!--
|
|
63
|
+
<!-- ABEL:END -->
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: abel-implement
|
|
3
3
|
description: Implement approved changes with mandatory TDD.
|
|
4
|
-
category:
|
|
5
|
-
tags: [
|
|
4
|
+
category: abel
|
|
5
|
+
tags: [abel, implementation, TDD]
|
|
6
6
|
argument-hint: [change_name]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
<!--
|
|
9
|
+
<!-- ABEL:START -->
|
|
10
10
|
**Arguments**
|
|
11
11
|
- Requested: `<change_name>`
|
|
12
12
|
|
|
@@ -154,4 +154,4 @@ Frontend Review
|
|
|
154
154
|
|
|
155
155
|
✓ Implementation complete
|
|
156
156
|
```
|
|
157
|
-
<!--
|
|
157
|
+
<!-- ABEL:END -->
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: abel-init
|
|
3
3
|
description: Initialize OpenSpec environment and validate required tooling.
|
|
4
|
-
category:
|
|
4
|
+
category: abel
|
|
5
5
|
tags: [openspec, init, setup]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
<!--
|
|
8
|
+
<!-- ABEL:START -->
|
|
9
9
|
**Guardrails**
|
|
10
10
|
- Complete steps in order; stop on failure
|
|
11
11
|
- Preserve existing config; do not overwrite without confirmation
|
|
@@ -16,12 +16,12 @@ tags: [openspec, init, setup]
|
|
|
16
16
|
2. Verify `openspec` availability via `openspec --version`.
|
|
17
17
|
3. If missing, `npm install -g @fission-ai/openspec@latest`, then re-check version.
|
|
18
18
|
4. Run `openspec init` (or `openspec update` for existing projects).
|
|
19
|
-
5.
|
|
20
|
-
|
|
19
|
+
5. {{AUGMENT_CONTEXT_ENGINE_VALIDATION}}
|
|
20
|
+
6. Verify required skills:
|
|
21
21
|
- Skills: `/dev-browser` `/sequential-think` `/context7-auto-research` `/grok-search` `/confidence-check`
|
|
22
|
-
|
|
22
|
+
7. Output summary with ✓/✗:
|
|
23
23
|
- OpenSpec installation
|
|
24
24
|
- Project initialization
|
|
25
|
-
- MCP availability
|
|
25
|
+
- MCP availability if enabled
|
|
26
26
|
- Required skills availability
|
|
27
|
-
<!--
|
|
27
|
+
<!-- ABEL:END -->
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: abel-plan
|
|
3
3
|
description: Refine approved change into a zero-decision executable plan.
|
|
4
|
-
category:
|
|
5
|
-
tags: [
|
|
4
|
+
category: abel
|
|
5
|
+
tags: [abel, plan, PBT]
|
|
6
6
|
argument-hint: [change_name]
|
|
7
7
|
---
|
|
8
|
-
<!--
|
|
8
|
+
<!-- ABEL:START -->
|
|
9
9
|
**Guardrails**
|
|
10
10
|
- Strictly adhere to **OpenSpec** rules when writing **standardized spec-structured projects**.
|
|
11
11
|
- The goal of this phase is to eliminate ALL decision points from the task flow—implementation should be pure mechanical execution.
|
|
@@ -39,8 +39,8 @@ argument-hint: [change_name]
|
|
|
39
39
|
|
|
40
40
|
4. **Uncertainty Elimination Audit**: Invoke skills to detect and eliminate remaining ambiguities:
|
|
41
41
|
```
|
|
42
|
-
# First,
|
|
43
|
-
|
|
42
|
+
# First, validate against existing codebase patterns
|
|
43
|
+
{{CODEBASE_RETRIEVAL_PATTERN_AUDIT}}
|
|
44
44
|
# Then audit for ambiguities directly and list them explicitly
|
|
45
45
|
Review change <change_name> for decision points that remain unspecified. For each: [AMBIGUITY] <description> → [REQUIRED CONSTRAINT] <what must be specified>.
|
|
46
46
|
Identify implicit assumptions in change <change_name>. For each: [ASSUMPTION] <description> → [EXPLICIT CONSTRAINT NEEDED] <concrete specification>.
|
|
@@ -85,4 +85,4 @@ A proposal is ready to exit the Plan phase only when:
|
|
|
85
85
|
- [ ] All PBT properties documented with falsification strategies
|
|
86
86
|
- [ ] `openspec validate <change_name> --strict` returns zero issues
|
|
87
87
|
- [ ] User has explicitly approved all constraint decisions
|
|
88
|
-
<!--
|
|
88
|
+
<!-- ABEL:END -->
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: abel-research
|
|
3
3
|
description: Transform user requirements into constraint sets via structured exploration (NO implementation)
|
|
4
|
-
category:
|
|
5
|
-
tags: [
|
|
4
|
+
category: abel
|
|
5
|
+
tags: [abel, research, constraints, exploration, subagents]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
<!--
|
|
8
|
+
<!-- ABEL:RESEARCH:START -->
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# abel-research — Operating Mode (Constraints & Specs Only)
|
|
11
11
|
|
|
12
12
|
## Non‑Negotiable Rules (Highest Priority)
|
|
13
13
|
1. RESEARCH MODE ONLY.
|
|
@@ -38,7 +38,7 @@ Produce constraint sets that narrow the solution space, plus measurable success
|
|
|
38
38
|
---
|
|
39
39
|
|
|
40
40
|
## Phase 2 — Initial Codebase Assessment (Read‑Only)
|
|
41
|
-
-
|
|
41
|
+
- {{CODEBASE_RETRIEVAL_POLICY}}
|
|
42
42
|
- If technical research needed (architectural patterns, best practices), invoke `/grok-search` skill
|
|
43
43
|
- If the codebase spans multiple modules/directories, dispatch parallel explore subagents by context boundary.
|
|
44
44
|
|
|
@@ -73,7 +73,7 @@ All explore subagents MUST return valid JSON using this schema:
|
|
|
73
73
|
## Phase 5 — Parallel Subagent Dispatch
|
|
74
74
|
- Monitor subagent execution and collect structured reports.
|
|
75
75
|
- For each boundary, spawn an Explore subagent with:
|
|
76
|
-
-
|
|
76
|
+
- {{CODEBASE_RETRIEVAL_MANDATORY_RULE}}
|
|
77
77
|
- Clear scope
|
|
78
78
|
- self-contained with independent output
|
|
79
79
|
- Required output template (from Phase 4)
|
|
@@ -113,7 +113,7 @@ All explore subagents MUST return valid JSON using this schema:
|
|
|
113
113
|
|
|
114
114
|
## Reference
|
|
115
115
|
- Review existing constraints: `rg -n "Constraint:|MUST|MUST NOT" openspec/specs`
|
|
116
|
-
-
|
|
116
|
+
- {{CODEBASE_RETRIEVAL_STRUCTURE_REFERENCE}}
|
|
117
117
|
|
|
118
118
|
- Check prior research outputs: `ls openspec/changes/*/`
|
|
119
119
|
- OpenSpec CLI commands:
|
|
@@ -123,4 +123,4 @@ All explore subagents MUST return valid JSON using this schema:
|
|
|
123
123
|
- `openspec instructions proposal --change <name>` - Get proposal instructions
|
|
124
124
|
- Validate subagent outputs conform to template before aggregation.
|
|
125
125
|
- Ask the user directly for ANY ambiguity—do not assume or guess.
|
|
126
|
-
<!--
|
|
126
|
+
<!-- ABEL:RESEARCH:END -->
|
package/lib/cli.mjs
CHANGED
|
@@ -35,6 +35,14 @@ const codexTemplateConfigPath = join(codexTemplateRoot, "config-base.toml");
|
|
|
35
35
|
const codexTemplateAgentsPath = join(codexTemplateRoot, "agents");
|
|
36
36
|
const installBackupStamp = Date.now();
|
|
37
37
|
const createdBackupPaths = new Set();
|
|
38
|
+
const augmentContextEnginePermission = "mcp__augment-context-engine";
|
|
39
|
+
const augmentContextEngineRetrievalTool = "mcp__augment-context-engine__codebase-retrieval";
|
|
40
|
+
const augmentContextEngineFeaturePrompt = {
|
|
41
|
+
message: "是否启用 augment-context-engine MCP 代码检索支持?不确定建议选否,可减少 MCP 安装和配置麻烦。",
|
|
42
|
+
initialValue: false
|
|
43
|
+
};
|
|
44
|
+
const localCodebaseRetrievalPolicy = "Use local codebase retrieval with `rg`, `rg --files`, `git grep`, and direct file reads. Do not require augment-context-engine MCP.";
|
|
45
|
+
const augmentCodebaseRetrievalPolicy = `Use \`${augmentContextEngineRetrievalTool}\` as the primary codebase search tool.`;
|
|
38
46
|
const claudeModelEnvKeys = [
|
|
39
47
|
"ANTHROPIC_MODEL",
|
|
40
48
|
"ANTHROPIC_DEFAULT_OPUS_MODEL",
|
|
@@ -74,8 +82,7 @@ const defaultClaudeSettings = {
|
|
|
74
82
|
"WebSearch",
|
|
75
83
|
"TodoWrite",
|
|
76
84
|
"NotebookRead",
|
|
77
|
-
"NotebookEdit"
|
|
78
|
-
"mcp__augment-context-engine"
|
|
85
|
+
"NotebookEdit"
|
|
79
86
|
],
|
|
80
87
|
deny: []
|
|
81
88
|
},
|
|
@@ -103,6 +110,69 @@ const ignoredSkillPathPatterns = [
|
|
|
103
110
|
/^dev-browser\/tmp(\/|$)/
|
|
104
111
|
];
|
|
105
112
|
|
|
113
|
+
function buildDefaultClaudeSettings({ augmentContextEngine = false } = {}) {
|
|
114
|
+
const settings = {
|
|
115
|
+
...defaultClaudeSettings,
|
|
116
|
+
env: { ...defaultClaudeSettings.env },
|
|
117
|
+
permissions: {
|
|
118
|
+
...defaultClaudeSettings.permissions,
|
|
119
|
+
allow: [...defaultClaudeSettings.permissions.allow],
|
|
120
|
+
deny: [...defaultClaudeSettings.permissions.deny]
|
|
121
|
+
},
|
|
122
|
+
hooks: { ...defaultClaudeSettings.hooks }
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
if (augmentContextEngine && !settings.permissions.allow.includes(augmentContextEnginePermission)) {
|
|
126
|
+
settings.permissions.allow.push(augmentContextEnginePermission);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return settings;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getAugmentContextEnginePromptOptions() {
|
|
133
|
+
return { ...augmentContextEngineFeaturePrompt };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function resolveAugmentContextEngineFeature(options = {}, previousMetadata = {}) {
|
|
137
|
+
if (typeof options.augmentContextEngine === "boolean") {
|
|
138
|
+
return options.augmentContextEngine;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (typeof previousMetadata?.features?.augmentContextEngine === "boolean") {
|
|
142
|
+
return previousMetadata.features.augmentContextEngine;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getWorkflowRenderValues(augmentContextEngine) {
|
|
149
|
+
return {
|
|
150
|
+
CODEBASE_RETRIEVAL_POLICY: augmentContextEngine
|
|
151
|
+
? augmentCodebaseRetrievalPolicy
|
|
152
|
+
: localCodebaseRetrievalPolicy,
|
|
153
|
+
AUGMENT_CONTEXT_ENGINE_VALIDATION: augmentContextEngine
|
|
154
|
+
? `Verify MCP availability:\n - \`${augmentContextEngineRetrievalTool}\``
|
|
155
|
+
: "Skip augment-context-engine MCP validation; use local retrieval tools.",
|
|
156
|
+
CODEBASE_RETRIEVAL_MANDATORY_RULE: augmentContextEngine
|
|
157
|
+
? `Mandatory use of \`${augmentContextEngineRetrievalTool}\``
|
|
158
|
+
: "Mandatory use of configured codebase retrieval policy.",
|
|
159
|
+
CODEBASE_RETRIEVAL_STRUCTURE_REFERENCE: augmentContextEngine
|
|
160
|
+
? `Inspect codebase structure: \`${augmentContextEngineRetrievalTool}\` with \`file list --recursive\`.`
|
|
161
|
+
: "Inspect codebase structure with `rg --files`, `git grep`, and direct file reads.",
|
|
162
|
+
CODEBASE_RETRIEVAL_PATTERN_AUDIT: augmentContextEngine
|
|
163
|
+
? `Use augment-context-engine to validate against existing codebase patterns.\n ${augmentContextEngineRetrievalTool}: "Search for existing implementations similar to change <change_name>. Keywords: [key concepts from proposal]"`
|
|
164
|
+
: "Use `rg`, `rg --files`, `git grep`, and direct file reads to validate against existing codebase patterns."
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function renderManagedWorkflowContent(content, { augmentContextEngine = false } = {}) {
|
|
169
|
+
let nextContent = content;
|
|
170
|
+
for (const [key, value] of Object.entries(getWorkflowRenderValues(augmentContextEngine))) {
|
|
171
|
+
nextContent = nextContent.replaceAll(`{{${key}}}`, value);
|
|
172
|
+
}
|
|
173
|
+
return nextContent;
|
|
174
|
+
}
|
|
175
|
+
|
|
106
176
|
function printHelp() {
|
|
107
177
|
console.log(`${c.bold("AbelWorkflow")} ${c.cyan("installer")}
|
|
108
178
|
|
|
@@ -320,6 +390,28 @@ async function writeInstallMetadata(agentsDir, metadata) {
|
|
|
320
390
|
await writeFile(join(agentsDir, installMetadataName), `${JSON.stringify(metadata, null, 2)}\n`, "utf8");
|
|
321
391
|
}
|
|
322
392
|
|
|
393
|
+
async function renderManagedWorkflowFile(path, augmentContextEngine) {
|
|
394
|
+
if (!(await pathIsFile(path))) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const content = await readFile(path, "utf8");
|
|
399
|
+
const rendered = renderManagedWorkflowContent(content, { augmentContextEngine });
|
|
400
|
+
if (rendered !== content) {
|
|
401
|
+
await writeFile(path, rendered, "utf8");
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
async function renderManagedWorkflowFiles(agentsDir, augmentContextEngine) {
|
|
406
|
+
await renderManagedWorkflowFile(join(agentsDir, "AGENTS.md"), augmentContextEngine);
|
|
407
|
+
|
|
408
|
+
const commandsDir = join(agentsDir, "commands");
|
|
409
|
+
const commandFiles = await getCommandNames(commandsDir);
|
|
410
|
+
for (const fileName of commandFiles) {
|
|
411
|
+
await renderManagedWorkflowFile(join(commandsDir, fileName), augmentContextEngine);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
323
415
|
async function syncPreservedManagedEntry(sourceRoot, targetRoot, entry, previousManagedChildren) {
|
|
324
416
|
await removeIfNotDirectory(targetRoot);
|
|
325
417
|
await mkdir(targetRoot, { recursive: true });
|
|
@@ -685,12 +777,27 @@ async function linkClaude(agentsDir, previousLinkedTargets) {
|
|
|
685
777
|
"file",
|
|
686
778
|
previousLinkedTargets
|
|
687
779
|
),
|
|
688
|
-
await
|
|
689
|
-
join(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
780
|
+
...(await (async () => {
|
|
781
|
+
const commandFiles = await getCommandNames(join(agentsDir, "commands"));
|
|
782
|
+
const r = [];
|
|
783
|
+
r.push(...(await pruneManagedTargets(
|
|
784
|
+
join(claudeDir, "commands"),
|
|
785
|
+
join(agentsDir, "commands"),
|
|
786
|
+
commandFiles,
|
|
787
|
+
previousLinkedTargets
|
|
788
|
+
)));
|
|
789
|
+
for (const fileName of commandFiles) {
|
|
790
|
+
r.push(
|
|
791
|
+
await ensureManagedLink(
|
|
792
|
+
join(claudeDir, "commands", fileName),
|
|
793
|
+
join(agentsDir, "commands", fileName),
|
|
794
|
+
"file",
|
|
795
|
+
previousLinkedTargets
|
|
796
|
+
)
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
return r;
|
|
800
|
+
})()),
|
|
694
801
|
...(await linkSkillDirectories(claudeDir, agentsDir, previousLinkedTargets))
|
|
695
802
|
];
|
|
696
803
|
}
|
|
@@ -714,11 +821,11 @@ async function linkCodex(agentsDir, previousLinkedTargets) {
|
|
|
714
821
|
);
|
|
715
822
|
results.push(...(await linkSkillDirectories(codexDir, agentsDir, previousLinkedTargets)));
|
|
716
823
|
|
|
717
|
-
const commandFiles = await getCommandNames(join(agentsDir, "commands"
|
|
824
|
+
const commandFiles = await getCommandNames(join(agentsDir, "commands"));
|
|
718
825
|
results.push(
|
|
719
826
|
...(await pruneManagedTargets(
|
|
720
827
|
join(codexDir, "prompts"),
|
|
721
|
-
join(agentsDir, "commands"
|
|
828
|
+
join(agentsDir, "commands"),
|
|
722
829
|
commandFiles,
|
|
723
830
|
previousLinkedTargets
|
|
724
831
|
))
|
|
@@ -727,7 +834,7 @@ async function linkCodex(agentsDir, previousLinkedTargets) {
|
|
|
727
834
|
results.push(
|
|
728
835
|
await ensureManagedLink(
|
|
729
836
|
join(codexDir, "prompts", fileName),
|
|
730
|
-
join(agentsDir, "commands",
|
|
837
|
+
join(agentsDir, "commands", fileName),
|
|
731
838
|
"file",
|
|
732
839
|
previousLinkedTargets
|
|
733
840
|
)
|
|
@@ -740,12 +847,15 @@ async function linkCodex(agentsDir, previousLinkedTargets) {
|
|
|
740
847
|
async function installManagedWorkflow(options) {
|
|
741
848
|
let previousMetadata = {};
|
|
742
849
|
let managedChildren = {};
|
|
850
|
+
let augmentContextEngine = false;
|
|
743
851
|
const s = p.spinner();
|
|
744
852
|
|
|
745
853
|
if (!options.relinkOnly) {
|
|
746
854
|
s.start("正在同步工作流文件...");
|
|
747
855
|
try {
|
|
748
856
|
({ previousMetadata, managedChildren } = await syncManagedFiles(options.agentsDir));
|
|
857
|
+
augmentContextEngine = resolveAugmentContextEngineFeature(options, previousMetadata);
|
|
858
|
+
await renderManagedWorkflowFiles(options.agentsDir, augmentContextEngine);
|
|
749
859
|
} catch (e) {
|
|
750
860
|
s.cancel(c.red(`同步失败: ${e.message}`));
|
|
751
861
|
throw e;
|
|
@@ -756,6 +866,7 @@ async function installManagedWorkflow(options) {
|
|
|
756
866
|
} else {
|
|
757
867
|
previousMetadata = await readInstallMetadata(options.agentsDir);
|
|
758
868
|
managedChildren = previousMetadata.managedChildren ?? {};
|
|
869
|
+
augmentContextEngine = resolveAugmentContextEngineFeature(options, previousMetadata);
|
|
759
870
|
}
|
|
760
871
|
|
|
761
872
|
const previousLinkedTargets = previousMetadata.linkedTargets ?? {};
|
|
@@ -784,10 +895,17 @@ async function installManagedWorkflow(options) {
|
|
|
784
895
|
])
|
|
785
896
|
);
|
|
786
897
|
|
|
898
|
+
const managedClaudePermissions = await ensureClaudeSettingsForFeature(augmentContextEngine, previousMetadata);
|
|
899
|
+
|
|
787
900
|
await writeInstallMetadata(options.agentsDir, {
|
|
788
901
|
package: "abelworkflow",
|
|
789
902
|
installedAt: new Date().toISOString(),
|
|
903
|
+
features: {
|
|
904
|
+
...(previousMetadata.features && typeof previousMetadata.features === "object" ? previousMetadata.features : {}),
|
|
905
|
+
augmentContextEngine
|
|
906
|
+
},
|
|
790
907
|
managedChildren,
|
|
908
|
+
managedClaudePermissions,
|
|
791
909
|
linkedTargets
|
|
792
910
|
});
|
|
793
911
|
|
|
@@ -1064,26 +1182,104 @@ async function configurePromptEnhancerEnv(agentsDir) {
|
|
|
1064
1182
|
p.log.step(`已写入 ${pathToLabel(envPath)}`);
|
|
1065
1183
|
}
|
|
1066
1184
|
|
|
1067
|
-
function mergeClaudeSettingsWithDefaults(settings) {
|
|
1185
|
+
function mergeClaudeSettingsWithDefaults(settings, { augmentContextEngine = false } = {}) {
|
|
1186
|
+
const defaults = buildDefaultClaudeSettings({ augmentContextEngine });
|
|
1068
1187
|
const env = settings?.env && typeof settings.env === "object" ? settings.env : {};
|
|
1069
1188
|
const permissions = settings?.permissions && typeof settings.permissions === "object" ? settings.permissions : {};
|
|
1070
1189
|
return {
|
|
1071
|
-
...
|
|
1190
|
+
...defaults,
|
|
1072
1191
|
...settings,
|
|
1073
1192
|
env: {
|
|
1074
|
-
...
|
|
1193
|
+
...defaults.env,
|
|
1075
1194
|
...env
|
|
1076
1195
|
},
|
|
1077
1196
|
permissions: {
|
|
1078
|
-
...
|
|
1197
|
+
...defaults.permissions,
|
|
1079
1198
|
...permissions,
|
|
1080
|
-
allow: Array.isArray(permissions.allow) ? permissions.allow :
|
|
1081
|
-
deny: Array.isArray(permissions.deny) ? permissions.deny :
|
|
1199
|
+
allow: Array.isArray(permissions.allow) ? permissions.allow : defaults.permissions.allow,
|
|
1200
|
+
deny: Array.isArray(permissions.deny) ? permissions.deny : defaults.permissions.deny
|
|
1082
1201
|
},
|
|
1083
|
-
hooks: settings?.hooks && typeof settings.hooks === "object" ? settings.hooks :
|
|
1202
|
+
hooks: settings?.hooks && typeof settings.hooks === "object" ? settings.hooks : defaults.hooks
|
|
1084
1203
|
};
|
|
1085
1204
|
}
|
|
1086
1205
|
|
|
1206
|
+
function getPreviousManagedClaudePermissions(previousMetadata = {}) {
|
|
1207
|
+
return Array.isArray(previousMetadata.managedClaudePermissions)
|
|
1208
|
+
? previousMetadata.managedClaudePermissions.filter((value) => typeof value === "string")
|
|
1209
|
+
: [];
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
function applyClaudePermissionFeature(settings, {
|
|
1213
|
+
augmentContextEngine = false,
|
|
1214
|
+
previousManagedPermissions = []
|
|
1215
|
+
} = {}) {
|
|
1216
|
+
const hasSettings = settings && typeof settings === "object";
|
|
1217
|
+
const wasManaged = previousManagedPermissions.includes(augmentContextEnginePermission);
|
|
1218
|
+
if (!hasSettings && !augmentContextEngine) {
|
|
1219
|
+
return { settings, changed: false, managedPermissions: [] };
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
const defaults = buildDefaultClaudeSettings({ augmentContextEngine: false });
|
|
1223
|
+
const nextSettings = hasSettings
|
|
1224
|
+
? {
|
|
1225
|
+
...settings,
|
|
1226
|
+
permissions: settings.permissions && typeof settings.permissions === "object"
|
|
1227
|
+
? { ...settings.permissions }
|
|
1228
|
+
: {}
|
|
1229
|
+
}
|
|
1230
|
+
: defaults;
|
|
1231
|
+
const permissions = nextSettings.permissions;
|
|
1232
|
+
const allow = Array.isArray(permissions.allow)
|
|
1233
|
+
? [...permissions.allow]
|
|
1234
|
+
: [...defaults.permissions.allow];
|
|
1235
|
+
let changed = !hasSettings;
|
|
1236
|
+
let isManaged = wasManaged;
|
|
1237
|
+
|
|
1238
|
+
if (augmentContextEngine) {
|
|
1239
|
+
if (!allow.includes(augmentContextEnginePermission)) {
|
|
1240
|
+
allow.push(augmentContextEnginePermission);
|
|
1241
|
+
changed = true;
|
|
1242
|
+
isManaged = true;
|
|
1243
|
+
}
|
|
1244
|
+
} else if (wasManaged && allow.includes(augmentContextEnginePermission)) {
|
|
1245
|
+
allow.splice(allow.indexOf(augmentContextEnginePermission), 1);
|
|
1246
|
+
changed = true;
|
|
1247
|
+
isManaged = false;
|
|
1248
|
+
} else {
|
|
1249
|
+
isManaged = false;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
permissions.allow = allow;
|
|
1253
|
+
if (!Array.isArray(permissions.deny)) {
|
|
1254
|
+
permissions.deny = [...defaults.permissions.deny];
|
|
1255
|
+
}
|
|
1256
|
+
nextSettings.permissions = permissions;
|
|
1257
|
+
|
|
1258
|
+
return {
|
|
1259
|
+
settings: nextSettings,
|
|
1260
|
+
changed,
|
|
1261
|
+
managedPermissions: isManaged ? [augmentContextEnginePermission] : []
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
async function ensureClaudeSettingsForFeature(augmentContextEngine, previousMetadata) {
|
|
1266
|
+
const settingsExists = await pathExists(claudeSettingsPath);
|
|
1267
|
+
const settings = settingsExists ? await readJsonFileSafe(claudeSettingsPath, {}) : undefined;
|
|
1268
|
+
const result = applyClaudePermissionFeature(settings, {
|
|
1269
|
+
augmentContextEngine,
|
|
1270
|
+
previousManagedPermissions: getPreviousManagedClaudePermissions(previousMetadata)
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
if (result.changed && result.settings) {
|
|
1274
|
+
if (settingsExists) {
|
|
1275
|
+
await backupExistingPath(claudeSettingsPath);
|
|
1276
|
+
}
|
|
1277
|
+
await writeJsonFileSafe(claudeSettingsPath, result.settings);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
return result.managedPermissions;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1087
1283
|
function getExistingClaudeApiConfig(settings) {
|
|
1088
1284
|
const env = mergeClaudeSettingsWithDefaults(settings).env;
|
|
1089
1285
|
return {
|
|
@@ -1801,10 +1997,15 @@ async function installCliTool(tool) {
|
|
|
1801
1997
|
}
|
|
1802
1998
|
|
|
1803
1999
|
async function runFullInit(options) {
|
|
2000
|
+
const augmentContextEngine = options.nonInteractive
|
|
2001
|
+
? false
|
|
2002
|
+
: await confirmOrCancel(getAugmentContextEnginePromptOptions());
|
|
2003
|
+
|
|
1804
2004
|
await installManagedWorkflow({
|
|
1805
2005
|
agentsDir: options.agentsDir,
|
|
1806
2006
|
force: options.force,
|
|
1807
|
-
relinkOnly: false
|
|
2007
|
+
relinkOnly: false,
|
|
2008
|
+
augmentContextEngine
|
|
1808
2009
|
});
|
|
1809
2010
|
|
|
1810
2011
|
if (await confirmOrCancel({ message: "是否安装或更新 Claude Code CLI?", initialValue: false })) {
|
|
@@ -1967,12 +2168,17 @@ async function main() {
|
|
|
1967
2168
|
}
|
|
1968
2169
|
|
|
1969
2170
|
export {
|
|
2171
|
+
applyClaudePermissionFeature,
|
|
2172
|
+
buildDefaultClaudeSettings,
|
|
1970
2173
|
buildCodexConfigContent,
|
|
2174
|
+
getAugmentContextEnginePromptOptions,
|
|
1971
2175
|
getRunCommandSpawnOptions,
|
|
1972
2176
|
hasPromptEnhancerApiConfig,
|
|
1973
2177
|
main,
|
|
1974
2178
|
mergeCodexAuthData,
|
|
1975
2179
|
mergeClaudeSettingsWithDefaults,
|
|
2180
|
+
renderManagedWorkflowContent,
|
|
2181
|
+
resolveAugmentContextEngineFeature,
|
|
1976
2182
|
resolvePromptEnhancerMode,
|
|
1977
2183
|
resolveExistingCodexApiConfig,
|
|
1978
2184
|
updateTomlSectionFields
|
|
@@ -12,7 +12,7 @@ pre-implementation planning, post-implementation review, or bounded
|
|
|
12
12
|
module-level implementation.
|
|
13
13
|
"""
|
|
14
14
|
nickname_candidates = ["Relay", "Pivot", "Anchor"]
|
|
15
|
-
model = "gpt-5.
|
|
15
|
+
model = "gpt-5.5"
|
|
16
16
|
model_reasoning_effort = "high"
|
|
17
17
|
sandbox_mode = "workspace-write"
|
|
18
18
|
|
|
@@ -11,7 +11,7 @@ Do NOT dispatch for review after implementation — use reviewer instead.
|
|
|
11
11
|
Do NOT dispatch if the affected files are already known and confirmed.
|
|
12
12
|
"""
|
|
13
13
|
nickname_candidates = ["Atlas", "Trace", "Scout"]
|
|
14
|
-
model = "gpt-5.
|
|
14
|
+
model = "gpt-5.5"
|
|
15
15
|
model_reasoning_effort = "high"
|
|
16
16
|
sandbox_mode = "read-only"
|
|
17
17
|
|
|
@@ -14,7 +14,7 @@ exceed execution value.
|
|
|
14
14
|
Do NOT dispatch after implementation is complete — use reviewer instead.
|
|
15
15
|
"""
|
|
16
16
|
nickname_candidates = ["Blueprint", "Compass", "Architect"]
|
|
17
|
-
model = "gpt-5.
|
|
17
|
+
model = "gpt-5.5"
|
|
18
18
|
model_reasoning_effort = "high"
|
|
19
19
|
sandbox_mode = "read-only"
|
|
20
20
|
|
|
@@ -11,7 +11,7 @@ Do NOT dispatch for codebase mapping or exploration — use explorer instead.
|
|
|
11
11
|
Do NOT dispatch before implementation is complete.
|
|
12
12
|
"""
|
|
13
13
|
nickname_candidates = ["Delta", "Echo", "Sigma"]
|
|
14
|
-
model = "gpt-5.
|
|
14
|
+
model = "gpt-5.5"
|
|
15
15
|
model_reasoning_effort = "xhigh"
|
|
16
16
|
sandbox_mode = "read-only"
|
|
17
17
|
|
|
@@ -10,7 +10,7 @@ Do NOT dispatch when the task touches global configs, shared utilities,
|
|
|
10
10
|
public interfaces used across modules, or project scaffolding.
|
|
11
11
|
"""
|
|
12
12
|
nickname_candidates = ["Forge", "Patch", "Builder"]
|
|
13
|
-
model = "gpt-5.
|
|
13
|
+
model = "gpt-5.5"
|
|
14
14
|
model_reasoning_effort = "high"
|
|
15
15
|
sandbox_mode = "workspace-write"
|
|
16
16
|
|
|
@@ -5,9 +5,11 @@ preferred_auth_method = "apikey"
|
|
|
5
5
|
approvals_reviewer = "guardian_subagent"
|
|
6
6
|
approval_policy = "on-request"
|
|
7
7
|
sandbox_mode = "workspace-write"
|
|
8
|
-
|
|
9
|
-
model = "gpt-5.4"
|
|
8
|
+
model = "gpt-5.5"
|
|
10
9
|
model_reasoning_effort = "high"
|
|
10
|
+
network_access = true
|
|
11
|
+
supports_websockets = true
|
|
12
|
+
requires_openai_auth = true
|
|
11
13
|
developer_instructions = """
|
|
12
14
|
Act as the default orchestrator for specialized subagents.
|
|
13
15
|
|
|
@@ -86,10 +88,12 @@ take precedence over the default routing below.
|
|
|
86
88
|
|
|
87
89
|
[agents]
|
|
88
90
|
max_threads = 10
|
|
89
|
-
max_depth =
|
|
91
|
+
max_depth = 1
|
|
90
92
|
job_max_runtime_seconds = 2400
|
|
91
93
|
|
|
92
94
|
[features]
|
|
93
95
|
multi_agent = true
|
|
94
96
|
js_repl = true
|
|
95
97
|
guardian_approval = true
|
|
98
|
+
responses_websockets_v2 = true
|
|
99
|
+
shell_snapshot = true
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abelworkflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Install AbelWorkflow into ~/.agents and create Claude/Codex symlinks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"test": "node --test test/runtime-doc-contracts.test.mjs test/cli-contracts.test.mjs test/codex-config.test.mjs",
|
|
7
8
|
"test:contracts": "node --test test/runtime-doc-contracts.test.mjs test/cli-contracts.test.mjs"
|
|
8
9
|
},
|
|
9
10
|
"bin": {
|