feat(agents): restrict Agent tool to specific sub-agents and add allowedTools to skills

This commit is contained in:
xixingde 2026-04-16 10:37:38 +08:00
parent 1e1d32205d
commit b58f5b72b0
5 changed files with 21 additions and 6 deletions

View File

@ -177,7 +177,7 @@ export const STRICT_PLAN_AGENT: BuiltInAgentDefinition = {
'根据用户的需求创建具体可实施的计划。Use this when you need to create structured, actionable implementation plans based on user requirements. This agent follows a strict workflow: understand requirements → QuickExplore project → clarify requirements → create proposal → implement proposal.',
tools:[
"AskUserQuestion",
"Agent", // Can spawn: QuickExplore, TaskCheck, SubCoding
"Agent(QuickExplore,TaskCheck,SubCoding)", // Can spawn: QuickExplore, TaskCheck, SubCoding
"Read",
"Write",
"Edit",

View File

@ -54,7 +54,7 @@ After project is verified to be buildable/runnable:
2. Otherwise, confirm the functional requirements based on the user's recent messages and code changes
3. Clearly identify what functionality needs to be tested
**IMPORTANT: After confirming user requirements, you MUST use the \`question\` tool to get user confirmation before proceeding to Step 3**
**IMPORTANT: After confirming user requirements, you MUST use the \`AskUserQuestion\` tool to get user confirmation before proceeding to Step 3**
- Present the confirmed requirements to the user
- Ask if they want to proceed with test case generation or if they need adjustments
@ -120,7 +120,7 @@ export const TDD_AGENT: BuiltInAgentDefinition = {
'execute comprehensive testing workflow: confirm requirements, generate test cases, and execute tests with automated fixes',
tools:[
"AskUserQuestion",
"Agent",
"Agent(RunAndFix,TestDesign,TestAndFix)",
"Read",
"Write",
"Edit",

View File

@ -11,6 +11,13 @@ export function registerProjectWikiSkill(): void {
disableModelInvocation: true,
context: 'fork',
agent: 'WIKI',
allowedTools:[
"Agent(WikiCatalogueDesign,WikiDocumentGenerate,WikiIndexGeneration,WikiProjectAnalyze)",
"Read",
"Write",
"Edit",
"TodoWrite",
],
async getPromptForCommand(args) {
const userRequest = args.trim()
if (!userRequest) {

View File

@ -7,6 +7,14 @@ export function registerTddSkill(): void {
'execute comprehensive testing workflow: confirm requirements, generate test cases, and execute tests with automated fixes',
userInvocable: true,
disableModelInvocation: true,
allowedTools:[
"AskUserQuestion",
"Agent(RunAndFix,TestDesign,TestAndFix)",
"Read",
"Write",
"Edit",
"TodoWrite",
],
context: 'fork',
agent: 'TDD',
async getPromptForCommand(args) {

View File

@ -15,8 +15,8 @@ import { registerLoopSkill } from './loop.js'
import { registerDreamSkill } from './dream.js'
import { registerUpdateConfigSkill } from './updateConfig.js'
import { registerVerifySkill } from './verify.js'
import { registerStrictPlanSkill } from '../../costrict/skills/strictPlan.js'
import { registerStrictSpecSkill } from '../../costrict/skills/strictSpec.js'
import { registerStrictPlanSkill } from 'src/costrict/skills/strictPlan.js'
import { registerStrictSpecSkill } from 'src/costrict/skills/strictSpec.js'
import { registerProjectWikiSkill } from 'src/costrict/skills/projectWiki.js'
import { registerTddSkill } from 'src/costrict/skills/tdd.js'
@ -35,7 +35,7 @@ export function initBundledSkills(): void {
registerProjectWikiSkill()
registerTddSkill()
registerStrictPlanSkill()
registerStrictSpecSkill()
// registerStrictSpecSkill()
registerKeybindingsSkill()
registerVerifySkill()
registerDebugSkill()