Enhance the Workflow to Support a New Scenario

Scenario: src/workflows/opportunity_management.wf already exists, and you want to enhance it to add a team member with questions such as Add Elaine Benes to the opportunity 'Laptops for ABC Networks'.

Use the AI Studio skill at:
<AI Studio CLI location>

Enhance the standalone workflow:
src/workflows/opportunity_management.wf

Add support for adding an existing Fusion Resource as a team member to an existing opportunity.

Inspect:
- src/workflows/opportunity_management.wf
- src/businessObjects/opportunities.bo
- resourecs-describe.json
- opportunities-describe.json

Important runtime rules:
- A team member is an existing Fusion Resource. Never create a Resource record.
- Check if there are existing BOs for searching for Resources. If not, create a new BO.
- Use Business Object workflow nodes only; do not create or use an External REST tool.
- Opportunity references in user requests are full `OptyNumber` values, not internal `OptyId` values.
- Preserve the full supplied opportunity number exactly, including prefixes, underscores, letters, and leading zeroes. For example, `CDRM_152867` must remain `CDRM_152867`.
- Do not strip, parse, normalize, convert, or look up an `OptyNumber` to obtain an `OptyId`.
- Add the child resource using the full opportunity number directly in the `OpportunityResource` child-operation path.
- The team-member payload must use the selected resource’s `PartyId` as `ResourceId`. Do not use `ResourceProfileId` as `ResourceId`.
- Do not include `OptyId` in the child request body.

Implement:
1. Extend `CLASSIFY_INTENT` with `ADD_TEAM_MEMBER`.
2. For that intent, extract:
   - `opportunityNumber`: the exact user-supplied full OptyNumber
   - resource lookup type and value: name, email, or ResourceProfileId
   - only explicitly supplied supported team-member attributes
3. Do not classify generic opportunity updates as `ADD_TEAM_MEMBER`.
4. Add the intent route and input validation.
5. Find existing BOs that can help query resources using various fields such as resource id, name, resource number, email address or login
6. If there is no existing BO, create a BO that you can use to search for resources using the above attributes. The openapi describe for resources is in the folder.
7. Return clear messages for missing opportunity number, missing resource information, zero resources, multiple resources, and API failures.
8. On exactly one resource match, map `PartyId` to `ResourceId`.
9. Add or update `OPPORTUNITIES.CreateOpportunityResource` as a BO function with:
   - POST `/crmRestApi/resources/11.13.18.05/opportunities/{opportunityNumber}/child/OpportunityResource`
   - token parameters `opportunityNumber` and `requestBody`
9. Make `ADD_OPPORTUNITY_TEAM_MEMBER` a `BO_FUNCTION` node using `OPPORTUNITIES.CreateOpportunityResource`.
10. Bind the full `opportunityNumber` directly to that BO node. Do not introduce an opportunity-ID lookup node.
11. Wire all new nodes into the real execution path.
12. Preserve all existing list, filtered-list, create, update, revenue, and out-of-scope behavior.

After changes:
- Run `do-prettify-workflow`.
- Run `validate-workflow`.
- Run `validate-bo` for the Opportunities BO.
- Complete the workflow test-sync loop and add coverage for successful team-member addition with an opportunity number, missing number/resource, no resource match, multiple resource matches, and an existing update regression.
- Keep changes local unless I explicitly ask you to save the BO or workflow to the server.

In the final response, state the full-number behavior, the `PartyId` → `ResourceId` mapping, the BO function used, and validation/test results.

Instructions given to the code assistant

Use the code assistant to create the prompt that you can then pass to the assistant to build the agentic app. Here are the instructions used to generate the above prompt.
Review this workflow:

`src/workflows/opportunity_management.wf`

I want to enhance it to support adding an existing Fusion Resource as a team member to an existing opportunity.

Please generate a detailed implementation prompt for Codex. Instruct Codex to use the AI Studio skill at:

`<Path To>\aistudio\SKILL.md`

I have included the Fusion REST describe files:

- `resources-describe.json`
- `opportunities-describe.json`

Additional requirements to include in the generated Codex prompt:

- A team member is an existing Resource; never create a Resource record.
- Use Business Object workflow nodes only; do not use an External REST tool.
- Find existing BOs that can help query resources using various fields such as resource id, name, resource number, email address or login
- If there is no existing BO, create a BO that you can use to search for resources using the above attributes. The openapi describe for resources is in the folder.
- Opportunities are identified by their full Opportunity Number (`OptyNumber`), not `OptyId`.
- Use the full `OptyNumber` directly when adding the OpportunityResource child record. Do not look up or use an `OptyId`.
- Use the selected Resource’s `PartyId` as the OpportunityResource `ResourceId`; do not use `ResourceProfileId`.
- The child POST should use the `OpportunityResource` child resource under the supplied opportunity number.
- Keep existing list, filter, create, update, revenue, and out-of-scope behavior unchanged.
- Include validation, deterministic no-match/multiple-match resource handling, workflow wiring, formatting, and test requirements.

Generate only the detailed prompt I can paste into Codex.