@zcy2nn/agent-forge 1.0.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/LICENSE +21 -0
- package/README.md +266 -0
- package/agent-forge.schema.json +675 -0
- package/dist/agents/council.d.ts +27 -0
- package/dist/agents/councillor.d.ts +2 -0
- package/dist/agents/implementer.d.ts +2 -0
- package/dist/agents/index.d.ts +30 -0
- package/dist/agents/orchestrator.d.ts +30 -0
- package/dist/agents/researcher.d.ts +2 -0
- package/dist/agents/reviewer.d.ts +2 -0
- package/dist/cli/config-io.d.ts +24 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/doctor.d.ts +38 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1932 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/migration.d.ts +46 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +35 -0
- package/dist/cli/providers.d.ts +99 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +40 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +28 -0
- package/dist/config/council-schema.d.ts +127 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/loader.d.ts +57 -0
- package/dist/config/runtime-preset.d.ts +12 -0
- package/dist/config/schema.d.ts +371 -0
- package/dist/config/utils.d.ts +15 -0
- package/dist/council/council-manager.d.ts +49 -0
- package/dist/council/index.d.ts +1 -0
- package/dist/divoom/council.gif +0 -0
- package/dist/divoom/designer.gif +0 -0
- package/dist/divoom/explorer.gif +0 -0
- package/dist/divoom/fixer.gif +0 -0
- package/dist/divoom/input.gif +0 -0
- package/dist/divoom/intro.gif +0 -0
- package/dist/divoom/librarian.gif +0 -0
- package/dist/divoom/manager.d.ts +57 -0
- package/dist/divoom/oracle.gif +0 -0
- package/dist/divoom/orchestrator.gif +0 -0
- package/dist/hooks/apply-patch/codec.d.ts +7 -0
- package/dist/hooks/apply-patch/errors.d.ts +25 -0
- package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
- package/dist/hooks/apply-patch/index.d.ts +15 -0
- package/dist/hooks/apply-patch/matching.d.ts +26 -0
- package/dist/hooks/apply-patch/operations.d.ts +3 -0
- package/dist/hooks/apply-patch/patch.d.ts +2 -0
- package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
- package/dist/hooks/apply-patch/resolution.d.ts +19 -0
- package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
- package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
- package/dist/hooks/apply-patch/types.d.ts +80 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +32 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +18 -0
- package/dist/hooks/auto-update-checker/types.d.ts +22 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/filter-available-skills/index.d.ts +32 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/image-hook.d.ts +19 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-file-tool-nudge/index.d.ts +19 -0
- package/dist/hooks/task-session-manager/index.d.ts +52 -0
- package/dist/hooks/todo-continuation/index.d.ts +53 -0
- package/dist/hooks/todo-continuation/todo-hygiene.d.ts +35 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32981 -0
- package/dist/interview/dashboard.d.ts +62 -0
- package/dist/interview/document.d.ts +25 -0
- package/dist/interview/helpers.d.ts +10 -0
- package/dist/interview/index.d.ts +1 -0
- package/dist/interview/manager.d.ts +35 -0
- package/dist/interview/parser.d.ts +11 -0
- package/dist/interview/prompts.d.ts +7 -0
- package/dist/interview/server.d.ts +13 -0
- package/dist/interview/service.d.ts +34 -0
- package/dist/interview/types.d.ts +96 -0
- package/dist/interview/ui.d.ts +12 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +9 -0
- package/dist/multiplexer/factory.d.ts +26 -0
- package/dist/multiplexer/index.d.ts +9 -0
- package/dist/multiplexer/session-manager.d.ts +53 -0
- package/dist/multiplexer/tmux/index.d.ts +22 -0
- package/dist/multiplexer/types.d.ts +54 -0
- package/dist/multiplexer/zellij/index.d.ts +34 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/council.d.ts +10 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/preset-manager.d.ts +27 -0
- package/dist/tools/skill.d.ts +9 -0
- package/dist/tools/smartfetch/binary.d.ts +3 -0
- package/dist/tools/smartfetch/cache.d.ts +6 -0
- package/dist/tools/smartfetch/constants.d.ts +12 -0
- package/dist/tools/smartfetch/index.d.ts +3 -0
- package/dist/tools/smartfetch/network.d.ts +38 -0
- package/dist/tools/smartfetch/secondary-model.d.ts +28 -0
- package/dist/tools/smartfetch/tool.d.ts +3 -0
- package/dist/tools/smartfetch/types.d.ts +122 -0
- package/dist/tools/smartfetch/utils.d.ts +18 -0
- package/dist/tui-state.d.ts +15 -0
- package/dist/tui.d.ts +8 -0
- package/dist/tui.js +248 -0
- package/dist/utils/agent-variant.d.ts +63 -0
- package/dist/utils/compat.d.ts +30 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/session-manager.d.ts +55 -0
- package/dist/utils/session.d.ts +74 -0
- package/dist/utils/subagent-depth.d.ts +35 -0
- package/dist/utils/system-collapse.d.ts +6 -0
- package/dist/utils/task.d.ts +4 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +104 -0
- package/src/skills/brainstorming/SKILL.md +177 -0
- package/src/skills/brainstorming/scripts/frame-template.html +214 -0
- package/src/skills/brainstorming/scripts/helper.js +88 -0
- package/src/skills/brainstorming/scripts/server.cjs +354 -0
- package/src/skills/brainstorming/scripts/start-server.sh +148 -0
- package/src/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/src/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/src/skills/brainstorming/visual-companion.md +279 -0
- package/src/skills/codemap/README.md +59 -0
- package/src/skills/codemap/SKILL.md +163 -0
- package/src/skills/codemap/codemap.md +36 -0
- package/src/skills/codemap/scripts/codemap.mjs +483 -0
- package/src/skills/codemap/scripts/codemap.test.ts +129 -0
- package/src/skills/codemap.md +40 -0
- package/src/skills/dispatching-parallel-agents/SKILL.md +193 -0
- package/src/skills/executing-plans/SKILL.md +78 -0
- package/src/skills/finishing-a-development-branch/SKILL.md +211 -0
- package/src/skills/receiving-code-review/SKILL.md +224 -0
- package/src/skills/requesting-code-review/SKILL.md +113 -0
- package/src/skills/requesting-code-review/code-reviewer.md +146 -0
- package/src/skills/simplify/README.md +19 -0
- package/src/skills/simplify/SKILL.md +138 -0
- package/src/skills/simplify/codemap.md +36 -0
- package/src/skills/subagent-driven-development/SKILL.md +288 -0
- package/src/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/src/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/src/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/src/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/src/skills/systematic-debugging/SKILL.md +308 -0
- package/src/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/src/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/src/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/src/skills/systematic-debugging/find-polluter.sh +63 -0
- package/src/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/src/skills/systematic-debugging/test-academic.md +14 -0
- package/src/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/src/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/src/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/src/skills/test-driven-development/SKILL.md +383 -0
- package/src/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/src/skills/using-git-worktrees/SKILL.md +226 -0
- package/src/skills/verification-before-completion/SKILL.md +147 -0
- package/src/skills/writing-plans/SKILL.md +165 -0
- package/src/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/src/skills/writing-skills/SKILL.md +666 -0
- package/src/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/src/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/src/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/src/skills/writing-skills/persuasion-principles.md +187 -0
- package/src/skills/writing-skills/render-graphs.js +168 -0
- package/src/skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk/v2';
|
|
2
|
+
import { type PluginConfig, SUBAGENT_NAMES } from '../config';
|
|
3
|
+
import { type AgentDefinition } from './orchestrator';
|
|
4
|
+
export type { AgentDefinition } from './orchestrator';
|
|
5
|
+
export type SubagentName = (typeof SUBAGENT_NAMES)[number];
|
|
6
|
+
export declare function isSubagent(name: string): name is SubagentName;
|
|
7
|
+
/**
|
|
8
|
+
* Create all agent definitions with optional configuration overrides.
|
|
9
|
+
* Instantiates the orchestrator and all subagents, applying user config and defaults.
|
|
10
|
+
*
|
|
11
|
+
* @param config - Optional plugin configuration with agent overrides
|
|
12
|
+
* @returns Array of agent definitions (orchestrator first, then subagents)
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
15
|
+
/**
|
|
16
|
+
* Get agent configurations formatted for the OpenCode SDK.
|
|
17
|
+
* Converts agent definitions to SDK config format and applies classification metadata.
|
|
18
|
+
*
|
|
19
|
+
* @param config - Optional plugin configuration with agent overrides
|
|
20
|
+
* @returns Record mapping agent names to their SDK configurations
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the set of disabled agent names from config, applying protection rules.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDisabledAgents(config?: PluginConfig): Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the list of enabled (non-disabled) agent names.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getEnabledAgentNames(config?: PluginConfig): string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentConfig } from '@opencode-ai/sdk/v2';
|
|
2
|
+
export interface AgentDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
config: AgentConfig;
|
|
7
|
+
/** Priority-ordered model entries for runtime fallback resolution. */
|
|
8
|
+
_modelArray?: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
variant?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve agent prompt from base/custom/append inputs.
|
|
15
|
+
* If customPrompt is provided, it replaces the base entirely.
|
|
16
|
+
* Otherwise, customAppendPrompt is appended to the base.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolvePrompt(base: string, customPrompt?: string, customAppendPrompt?: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Build the orchestrator prompt with dynamic agent filtering.
|
|
21
|
+
* @param disabledAgents - Set of disabled agent names to exclude from the prompt
|
|
22
|
+
* @returns The complete orchestrator prompt string
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildOrchestratorPrompt(disabledAgents?: Set<string>): string;
|
|
25
|
+
/** @deprecated Use buildOrchestratorPrompt() instead */
|
|
26
|
+
export declare const ORCHESTRATOR_PROMPT: string;
|
|
27
|
+
export declare function createOrchestratorAgent(model?: string | Array<string | {
|
|
28
|
+
id: string;
|
|
29
|
+
variant?: string;
|
|
30
|
+
}>, customPrompt?: string, customAppendPrompt?: string, disabledAgents?: Set<string>): AgentDefinition;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Strip JSON comments (single-line // and multi-line) and trailing commas for JSONC support.
|
|
4
|
+
*/
|
|
5
|
+
export declare function stripJsonComments(json: string): string;
|
|
6
|
+
export declare function parseConfigFile(path: string): {
|
|
7
|
+
config: OpenCodeConfig | null;
|
|
8
|
+
error?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function parseConfig(path: string): {
|
|
11
|
+
config: OpenCodeConfig | null;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Write config to file atomically.
|
|
16
|
+
*/
|
|
17
|
+
export declare function writeConfig(configPath: string, config: OpenCodeConfig): void;
|
|
18
|
+
export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
|
|
19
|
+
export declare function addPluginToOpenCodeTuiConfig(): Promise<ConfigMergeResult>;
|
|
20
|
+
export declare function writeLiteConfig(installConfig: InstallConfig, targetPath?: string): ConfigMergeResult;
|
|
21
|
+
export declare function disableDefaultAgents(): ConfigMergeResult;
|
|
22
|
+
export declare function enableLspByDefault(): ConfigMergeResult;
|
|
23
|
+
export declare function canModifyOpenCodeConfig(): boolean;
|
|
24
|
+
export declare function detectCurrentConfig(): DetectedConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom skill bundled in this repository.
|
|
3
|
+
* Unlike npx-installed skills, these are copied from src/skills/ to the OpenCode skills directory
|
|
4
|
+
*/
|
|
5
|
+
export interface CustomSkill {
|
|
6
|
+
/** Skill name (folder name) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable description */
|
|
9
|
+
description: string;
|
|
10
|
+
/** List of agents that should auto-allow this skill */
|
|
11
|
+
allowedAgents: string[];
|
|
12
|
+
/** Source path in this repo (relative to project root) */
|
|
13
|
+
sourcePath: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registry of custom skills bundled in this repository.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CUSTOM_SKILLS: CustomSkill[];
|
|
19
|
+
/**
|
|
20
|
+
* Get the target directory for custom skills installation.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCustomSkillsDir(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Install a custom skill by copying from src/skills/ to the OpenCode skills directory
|
|
25
|
+
* @param skill - The custom skill to install
|
|
26
|
+
* @param projectRoot - Root directory of agent-forge project
|
|
27
|
+
* @returns True if installation succeeded, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
export declare function installCustomSkill(skill: CustomSkill): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginConfig } from '../config/schema';
|
|
3
|
+
export type DoctorArgs = {
|
|
4
|
+
json?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
help?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function parseDoctorArgs(args: string[]): DoctorArgs;
|
|
9
|
+
export type ConfigCheckResult = {
|
|
10
|
+
scope: 'user' | 'project';
|
|
11
|
+
path: string | null;
|
|
12
|
+
exists: boolean;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
config?: PluginConfig;
|
|
15
|
+
error?: {
|
|
16
|
+
kind: 'invalid-json' | 'invalid-schema' | 'read-error';
|
|
17
|
+
message: string;
|
|
18
|
+
issues?: z.ZodIssue[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type PresetCheckResult = {
|
|
22
|
+
preset: string;
|
|
23
|
+
ok: boolean;
|
|
24
|
+
error?: {
|
|
25
|
+
kind: 'missing-preset';
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type DoctorResult = {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
project: string;
|
|
32
|
+
configs: ConfigCheckResult[];
|
|
33
|
+
presetCheck?: PresetCheckResult;
|
|
34
|
+
};
|
|
35
|
+
export declare function runDoctorCheck(cwd: string): DoctorResult;
|
|
36
|
+
export declare function formatHumanDoctorResult(result: DoctorResult): string;
|
|
37
|
+
export declare function formatJsonDoctorResult(result: DoctorResult): string;
|
|
38
|
+
export declare function doctor(args: DoctorArgs): Promise<number>;
|