Skip to content

Commit 196e843

Browse files
deepracticexsclaude
andcommitted
feat: rename use/direct top-level param from locator to command
Resolves naming collision where resource operations have their own `locator` parameter conflicting with the tool-level `locator` field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 248cf65 commit 196e843

11 files changed

Lines changed: 87 additions & 91 deletions

File tree

apps/mcp-server/src/index.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,17 @@ server.addTool({
226226
description: detail("use"),
227227
parameters: z
228228
.object({
229-
locator: z
229+
command: z
230230
.string()
231-
.describe(
232-
"Locator string. !namespace.method for RoleX commands, or a ResourceX locator for resources"
233-
),
231+
.describe("!namespace.method for RoleX commands, or a ResourceX locator for resources"),
234232
})
235233
.catchall(z.unknown()),
236234
execute: async (params) => {
237-
const { locator, ...args } = params;
235+
const { command, ...args } = params;
238236
const result = await state
239237
.requireRole()
240-
.use(locator, Object.keys(args).length > 0 ? args : undefined);
241-
if (result == null) return `${locator} done.`;
238+
.use(command as string, Object.keys(args).length > 0 ? args : undefined);
239+
if (result == null) return `${command} done.`;
242240
if (typeof result === "string") return result;
243241
return JSON.stringify(result, null, 2);
244242
},
@@ -251,24 +249,22 @@ server.addTool({
251249
description: detail("direct"),
252250
parameters: z
253251
.object({
254-
locator: z
252+
command: z
255253
.string()
256-
.describe(
257-
"Locator string. !namespace.method for RoleX commands, or a ResourceX locator for resources"
258-
),
254+
.describe("!namespace.method for RoleX commands, or a ResourceX locator for resources"),
259255
})
260256
.catchall(z.unknown()),
261257
execute: async (params) => {
262-
const { locator, ...args } = params;
258+
const { command, ...args } = params;
263259
const result = await rolex.direct(
264-
locator as string,
260+
command as string,
265261
Object.keys(args).length > 0 ? args : undefined
266262
);
267-
if (result == null) return `${locator} done.`;
263+
if (result == null) return `${command} done.`;
268264
if (typeof result === "string") return result;
269265
// Render project results as readable text
270-
if (locator.startsWith("!project.")) {
271-
const action = locator.slice("!project.".length) as ProjectAction;
266+
if ((command as string).startsWith("!project.")) {
267+
const action = (command as string).slice("!project.".length) as ProjectAction;
272268
const opResult = result as { state: State };
273269
return renderProjectResult(action, opResult.state);
274270
}

packages/prototype/src/descriptions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ export const world: Record<string, string> = {
8383
"state-origin":
8484
"Feature: State origin — prototype vs instance\n Every node in a role's state tree has an origin: prototype or instance.\n This distinction determines what can be modified and what is read-only.\n\n Scenario: Prototype nodes are read-only\n Given a node has origin {prototype}\n Then it comes from a position, duty, or organizational definition\n And it is inherited through the membership/appointment chain\n And it CANNOT be modified or forgotten — it belongs to the organization\n\n Scenario: Instance nodes are mutable\n Given a node has origin {instance}\n Then it was created by the individual through execution or cognition\n And it includes goals, plans, tasks, encounters, experiences, principles, and procedures\n And it CAN be modified or forgotten — it belongs to the individual\n\n Scenario: Reading the state heading\n Given a state node is rendered as a heading\n Then the format is: [name] (id) {origin} #tag\n And [name] identifies the structure type\n And (id) identifies the specific node\n And {origin} shows prototype or instance\n And #tag shows the node's tag if present (e.g. #done, #abandoned)\n And nodes without origin have no organizational inheritance\n\n Scenario: Forget only works on instance nodes\n Given the AI wants to forget a node\n When the node origin is {instance}\n Then forget will succeed — the individual owns this knowledge\n When the node origin is {prototype}\n Then forget will fail — the knowledge belongs to the organization",
8585
"use-protocol":
86-
'Feature: Use tool — the universal execution entry point\n The MCP use tool is how you execute ALL RoleX operations beyond the core MCP tools.\n Whenever you see use("...") or a !namespace.method pattern in skills or documentation,\n it is an instruction to call the MCP use tool with that locator.\n\n Scenario: How to read use instructions in skills\n Given a skill document contains use("!resource.add", { path: "..." })\n Then this means: call the MCP use tool with locator "!resource.add" and args { path: "..." }\n And always use the MCP use tool for RoleX operations\n And this applies to every use("...") pattern you encounter in any skill or documentation\n\n Scenario: ! prefix dispatches to RoleX runtime\n Given the locator starts with !\n Then it is parsed as !namespace.method\n And dispatched to the corresponding RoleX API with named args\n\n Scenario: Mandatory skill loading before execution\n Given your procedures list the skills you have\n When you need to execute a command you have not seen in a loaded skill\n Then you MUST call skill(locator) first to load the full instructions\n And the loaded skill will tell you the exact command name and arguments\n And only then call use(!namespace.method, args) with the correct syntax\n And do not use commands from other roles\' descriptions — only your own skills\n\n Scenario: NEVER guess commands\n Given a command is not found in any loaded skill\n When the AI considers trying it anyway\n Then STOP — do not call use or direct with unverified commands\n And call skill(locator) with the relevant procedure to learn the correct syntax\n And if no procedure covers this task, it is outside your duties — suggest Nuwa\n\n Scenario: Regular locators delegate to ResourceX\n Given the locator does not start with !\n Then it is treated as a ResourceX locator\n And resolved through the ResourceX ingest pipeline',
86+
'Feature: Use tool — the universal execution entry point\n The MCP use tool is how you execute ALL RoleX operations beyond the core MCP tools.\n Whenever you see use("...") or a !namespace.method pattern in skills or documentation,\n it is an instruction to call the MCP use tool with that command.\n\n Scenario: How to read use instructions in skills\n Given a skill document contains use("!resource.add", { path: "..." })\n Then this means: call the MCP use tool with command "!resource.add" and path "..."\n And all named arguments are passed as flat top-level parameters alongside command\n And always use the MCP use tool for RoleX operations\n And this applies to every use("...") pattern you encounter in any skill or documentation\n\n Scenario: ! prefix dispatches to RoleX runtime\n Given the command starts with !\n Then it is parsed as !namespace.method\n And dispatched to the corresponding RoleX API with named args\n\n Scenario: Mandatory skill loading before execution\n Given your procedures list the skills you have\n When you need to execute a command you have not seen in a loaded skill\n Then you MUST call skill(locator) first to load the full instructions\n And the loaded skill will tell you the exact command name and arguments\n And only then call use with the correct command and flat named parameters\n And do not use commands from other roles\' descriptions — only your own skills\n\n Scenario: NEVER guess commands\n Given a command is not found in any loaded skill\n When the AI considers trying it anyway\n Then STOP — do not call use or direct with unverified commands\n And call skill(locator) with the relevant procedure to learn the correct syntax\n And if no procedure covers this task, it is outside your duties — suggest Nuwa\n\n Scenario: Regular commands delegate to ResourceX\n Given the command does not start with !\n Then it is treated as a ResourceX locator\n And resolved through the ResourceX ingest pipeline',
8787
} as const;
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Feature: Use tool — the universal execution entry point
22
The MCP use tool is how you execute ALL RoleX operations beyond the core MCP tools.
33
Whenever you see use("...") or a !namespace.method pattern in skills or documentation,
4-
it is an instruction to call the MCP use tool with that locator.
4+
it is an instruction to call the MCP use tool with that command.
55

66
Scenario: How to read use instructions in skills
77
Given a skill document contains use("!resource.add", { path: "..." })
8-
Then this means: call the MCP use tool with locator "!resource.add" and path "..."
9-
And all named arguments are passed as flat top-level parameters alongside locator
8+
Then this means: call the MCP use tool with command "!resource.add" and path "..."
9+
And all named arguments are passed as flat top-level parameters alongside command
1010
And always use the MCP use tool for RoleX operations
1111
And this applies to every use("...") pattern you encounter in any skill or documentation
1212

1313
Scenario: ! prefix dispatches to RoleX runtime
14-
Given the locator starts with !
14+
Given the command starts with !
1515
Then it is parsed as !namespace.method
1616
And dispatched to the corresponding RoleX API with named args
1717

@@ -20,7 +20,7 @@ Feature: Use tool — the universal execution entry point
2020
When you need to execute a command you have not seen in a loaded skill
2121
Then you MUST call skill(locator) first to load the full instructions
2222
And the loaded skill will tell you the exact command name and arguments
23-
And only then call use with the correct locator and flat named parameters
23+
And only then call use with the correct command and flat named parameters
2424
And do not use commands from other roles' descriptions — only your own skills
2525

2626
Scenario: NEVER guess commands
@@ -30,7 +30,7 @@ Feature: Use tool — the universal execution entry point
3030
And call skill(locator) with the relevant procedure to learn the correct syntax
3131
And if no procedure covers this task, it is outside your duties — suggest Nuwa
3232

33-
Scenario: Regular locators delegate to ResourceX
34-
Given the locator does not start with !
33+
Scenario: Regular commands delegate to ResourceX
34+
Given the command does not start with !
3535
Then it is treated as a ResourceX locator
3636
And resolved through the ResourceX ingest pipeline

skills/individual-management/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Feature: Individual Lifecycle
1414
And the individual can be activated, hired into organizations, and taught skills
1515
And parameters are:
1616
"""
17-
locator: "!individual.born"
17+
command: "!individual.born"
1818
content: "Feature: ..." # Gherkin persona (optional)
1919
id: "sean" # kebab-case identifier
2020
alias: ["小明", "xm"] # aliases (optional)
@@ -34,7 +34,7 @@ Feature: Individual Lifecycle
3434
And all data is preserved for potential restoration via rehire
3535
And parameters are:
3636
"""
37-
locator: "!individual.retire"
37+
command: "!individual.retire"
3838
individual: "sean"
3939
"""
4040

@@ -45,7 +45,7 @@ Feature: Individual Lifecycle
4545
And this is semantically permanent — rehire is technically possible but not intended
4646
And parameters are:
4747
"""
48-
locator: "!individual.die"
48+
command: "!individual.die"
4949
individual: "sean"
5050
"""
5151

@@ -63,7 +63,7 @@ Feature: Individual Lifecycle
6363
And all previous knowledge, experience, and history are intact
6464
And parameters are:
6565
"""
66-
locator: "!individual.rehire"
66+
command: "!individual.rehire"
6767
individual: "sean"
6868
"""
6969

@@ -79,7 +79,7 @@ Feature: Knowledge Injection
7979
And if a principle with the same id already exists, it is replaced (upsert)
8080
And parameters are:
8181
"""
82-
locator: "!individual.teach"
82+
command: "!individual.teach"
8383
individual: "sean"
8484
content: "Feature: Always validate input\n ..."
8585
id: "always-validate-input"
@@ -93,7 +93,7 @@ Feature: Knowledge Injection
9393
And the procedure Feature description MUST contain the ResourceX locator for the skill
9494
And parameters are:
9595
"""
96-
locator: "!individual.train"
96+
command: "!individual.train"
9797
individual: "sean"
9898
content: "Feature: Skill Creator\n https://github.com/Deepractice/DeepracticeX/tree/main/skills/skill-creator\n\n Scenario: When to use\n Given I need to create a skill\n Then load this skill"
9999
id: "skill-creator"
@@ -136,9 +136,9 @@ Feature: Common Workflows
136136
When setting up a new role from scratch
137137
Then follow this sequence:
138138
"""
139-
1. locator: "!individual.born", id: "sean", content: "Feature: ..."
140-
2. locator: "!individual.teach", individual: "sean", content: "...", id: "..." # repeat
141-
3. locator: "!individual.train", individual: "sean", content: "...", id: "..." # repeat
139+
1. command: "!individual.born", id: "sean", content: "Feature: ..."
140+
2. command: "!individual.teach", individual: "sean", content: "...", id: "..." # repeat
141+
3. command: "!individual.train", individual: "sean", content: "...", id: "..." # repeat
142142
4. activate with roleId: "sean" # verify the individual's state
143143
"""
144144

skills/issue-management/SKILL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Feature: Issue Lifecycle Commands
3131
And optional: assignee can be set at creation
3232
And parameters are:
3333
"""
34-
locator: "!issue.publish"
34+
command: "!issue.publish"
3535
title: "Issue title"
3636
body: "Issue description"
3737
author: "individual-id"
@@ -44,7 +44,7 @@ title: "Issue title"
4444
Then the full issue is returned including labels
4545
And parameters are:
4646
"""
47-
locator: "!issue.get"
47+
command: "!issue.get"
4848
number: 1
4949
"""
5050

@@ -55,7 +55,7 @@ number: 1
5555
And all filter parameters are optional — omit for all issues
5656
And parameters are:
5757
"""
58-
locator: "!issue.list"
58+
command: "!issue.list"
5959
status: "open" # optional
6060
author: "id" # optional
6161
assignee: "id" # optional
@@ -68,7 +68,7 @@ status: "open" # optional
6868
Then the specified fields are updated
6969
And parameters are:
7070
"""
71-
locator: "!issue.update"
71+
command: "!issue.update"
7272
number: 1
7373
title: "New title" # optional
7474
body: "New body" # optional
@@ -81,7 +81,7 @@ number: 1
8181
Then status changes to "closed" and closedAt is set
8282
And parameters are:
8383
"""
84-
locator: "!issue.close"
84+
command: "!issue.close"
8585
number: 1
8686
"""
8787

@@ -91,7 +91,7 @@ number: 1
9191
Then status changes back to "open" and closedAt is cleared
9292
And parameters are:
9393
"""
94-
locator: "!issue.reopen"
94+
command: "!issue.reopen"
9595
number: 1
9696
"""
9797

@@ -101,7 +101,7 @@ number: 1
101101
Then the issue's assignee is updated
102102
And parameters are:
103103
"""
104-
locator: "!issue.assign"
104+
command: "!issue.assign"
105105
number: 1
106106
assignee: "individual-id"
107107
"""
@@ -115,7 +115,7 @@ Feature: Comment Commands
115115
Then a comment is added to the issue
116116
And parameters are:
117117
"""
118-
locator: "!issue.comment"
118+
command: "!issue.comment"
119119
number: 1
120120
body: "Comment text"
121121
author: "individual-id"
@@ -127,7 +127,7 @@ number: 1
127127
Then all comments are returned ordered by creation time
128128
And parameters are:
129129
"""
130-
locator: "!issue.comments"
130+
command: "!issue.comments"
131131
number: 1
132132
"""
133133

@@ -141,7 +141,7 @@ Feature: Label Commands
141141
And if the label doesn't exist yet, it is auto-created
142142
And parameters are:
143143
"""
144-
locator: "!issue.label"
144+
command: "!issue.label"
145145
number: 1
146146
label: "bug"
147147
"""
@@ -152,7 +152,7 @@ number: 1
152152
Then the label is removed from the issue
153153
And parameters are:
154154
"""
155-
locator: "!issue.unlabel"
155+
command: "!issue.unlabel"
156156
number: 1
157157
label: "bug"
158158
"""

0 commit comments

Comments
 (0)