DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Adding Graph Retrieval to a RAG Pipeline With Python
  • Threat Modeling Context-Aware AI: A STRIDE Walkthrough
  • 6 Techniques To Reduce LLM API Costs With the Python Library
  • Prompt Caching: Overriding Tokenization for Faster and More Cost-Effective AI

Trending

  • Build Production-Ready AI Phone Agents: Infrastructure, Models, and Telephony
  • WebSockets, gRPC, and GraphQL in the Core
  • The Alert Is Not the Incident: LLM Triage on a Multi-Engine Data Platform
  • Batching Strategies: Throughput vs Latency in Practice

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Reusable Operational Playbooks With Agent Skills

Reusable Operational Playbooks With Agent Skills

Agent Skill enables engineers to follow consistent operational playbooks without manual copying and establishes a clear boundary.

By 
Daniel Oh
DZone Core CORE ·
Nov. 24, 26 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
9 Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In Part 4, we learned about multi-agent orchestration. Now, Maya at Acme FinServ wants engineers to follow the same refund investigation procedure without pasting a long runbook into every conversation. Package the procedure as an Agent Skill: a SKILL.md containing metadata and instructions, with supporting references, scripts, and assets. Goose discovers skill names and descriptions at session startup and loads full instructions when a skill is selected. References and templates can then be read when needed.

Keep the responsibilities clear:

  • Agent Skills provide reusable task procedures and resources.
  • A2A Agent Card skills advertise remote agent capabilities. Those entries are distinct from filesystem Agent Skills packages.
  • MCP tools supply operations and data. This exercise reaches Part 1's audit tool through the existing Part 4 workflow.
  • Server-side governance decides whether an operation executes, pauses for approval, or fails. In this demo, Java explicitly parses the server'sAGENTS.md; the Markdown format alone does not enforce policy.

Inspect and Install the Example

The companion package is in part4-multi-agent/skills/refund-investigation/:

Shell
 
refund-investigation/
├── SKILL.md
├── references/refund-playbook.md
├── scripts/workflow.py
└── assets/evidence-report.md


Read SKILL.md first. Its frontmatter declares name, description, and version metadata; the body states requirements and routes the agent to the playbook, helper, and report template. The playbook describes evidence limits and the refund threshold. The helper submits or polls tasks; it has no approval command.

Run the Skill From the SPA

At this point, the app from Step 5 is normally already running. You need Goose installed and a model configured for this optional exercise. Choose the setup that matches your current state:

  • Keep the original ./start-all.sh terminal running. In a second terminal, from the repository root, run:

    Shell
     
    cd part4-multi-agent
    ./start-goose.sh 8889

    This adds only Goose to the running lab. No app restart is needed. Keep this second terminal running and wait for the [goose] ACP ready message. The argument 8889 must match the existing SPA port.

    If Step 5 was already started with WITH_GOOSE=true, Goose is included: skip this command and proceed to Start Goose Session in the SPA.



  • From the repository root, start all services and Goose together:

    Shell
     
    cd part4-multi-agent
    WITH_GOOSE=true ./start-all.sh

    This calls start-goose.sh automatically. Do not run the companion script again. If you choose this route while an older launcher is still running, stop the older launcher with Ctrl+C first to avoid port conflicts.

start-goose.sh starts a real goose serve process using your installed Goose and configured provider. It prepares a project workspace containing a fresh copy of the skill and supplies temporary authenticated connection settings to the browser. It does not start another MCP server, A2A server, or SPA.

Keep the console open on http://localhost:8889/index.html. If the new fifth panel is missing after updating the tutorial code, reload the page. Then:

  1. In 5 · Goose Skill Investigation, click Start Goose Session.
  2. Click Investigate $2500 Refund to populate the prompt. Review it and click Send Message.
  3. Watch streamed Goose replies and skill/tool activity. Resolve any Goose tool permission requests explicitly.
  4. The console observes new backend tasks. When the refund reaches input-required, its server-generated ID, operation, and reason appear in the existing Human Approval Required panel. Approve or reject there.
  5. Once the Goose turn ends, click Continue Investigation. Review and send its prompt to poll the same refund task and complete the evidence report.

One-time permissions are a demo UI choice

ACP stands for Agent Client Protocol, the protocol connecting this browser client to Goose. This UI offers one-time permission choices to keep tool actions visible during the demo. ACP also supports persistent choices such as allow_always and reject_always; it does not require one-time choices. See the ACP permission options. Tool permission and the Quarkus refund approval gate remain separate.

The investigation button fills the input; it does not submit an unseen prompt. The continuation button also requires an explicit send and never resubmits a refund itself. Transcript and tool output are rendered as text.

The browser uses Goose's supported Agent Client Protocol interface over an authenticated localhost WebSocket. ACP handles model conversations, tool events, and tool permissions; A2A carries the workflow requests made by the skill's helper. The Java workflow service continues to enforce operation policy and the approval gate.

Goose retains its configured tool and extension access, including local command execution through the Developer extension. The browser client provides no additional terminal or filesystem capabilities through ACP. A Goose permission decision authorizes a tool action, not a refund. The local admin API is still unauthenticated, so this is not separation of duties against an unrestricted local agent; that needs the production controls described below.

The optional launcher generates a temporary connection token in gitignoredtarget/goose-ui.json, readable by the local SPA. It removes the file when stopped. Keep that file and its token-bearing connection URL private. Provider credentials remain in Goose. Both the SPA and Goose listener bind to loopback; Goose restricts browser connections to the exact SPA origins. This setup is not intended for shared hosting.

If the panel cannot connect, check the second terminal for[goose] ACP ready, inspect target/goose-ui.logand check your Goose provider configuration. Goose uses port 3284 by default; override it with GOOSE_UI_PORT if another Goose server occupies that port. Override the executable with GOOSE_BIN.

When finished, click Disconnect in the SPA. If you started Goose in a second terminal, press Ctrl+C in that terminal to stop Goose; the original app and its four exercises remain running. Press Ctrl+C in the original launcher terminal when you are ready to stop the app too. If you used the combined WITH_GOOSE=true launcher, Ctrl+C in its terminal stops everything.

Cancel Turn requests cancellation of model work, leaving already submitted workflow tasks intact. Disconnect does not delete those tasks. Reconnecting starts a fresh Goose conversation; do not repeat an investigation merely to check status. If the prompt response is lost, the panel requires disconnecting before another submission. Since this is a single-user lab, it observes tasks created after connecting rather than claiming authenticated session ownership. Avoid running another task-producing client during the demonstration.

The four original exercises require neither Goose nor a model. The optional panel reports unavailable runtime/provider errors and never fabricates an agent response. The terminal path below remains available.

Run the Skill From a Terminal

Keep ./start-all.sh running in the first terminal. In a second terminal, from the repository root, install a project-local copy before starting Goose:

Shell
 
cd part4-multi-agent
mkdir -p .goose/skills
cp -R skills/refund-investigation .goose/skills/
goose session


Goose supports .goose/skills/ for project-local discovery, as well as the newer .agents/skills/ location. This lab uses .goose/skills/ to keep its installation separate from repository agent configuration. The installed copy is gitignored; repeat the copy after changing the source package and start a new Goose session. Enable Goose's Skills extension and Developer extension for local file and command access if they are disabled. A configured model is needed for this interactive portion; the manual checks below require neither Goose nor an LLM.

In the Goose session, enter:

Shell
 
Use the refund-investigation skill to investigate the disputed payment for
CUST-4091 and request a simulated $2500 refund. Collect the audit evidence,
leave approval to me, and fill the evidence report template. Do not call the
admin approval endpoint.


Expected behavior: Goose loads the playbook, submits generate-report, identifies the [MCP → getAuditTrail] result, submits process-refund, then reports the server-generated refund task ID and pauses at TASK_STATE_INPUT_REQUIRED. The synthetic audit events are not a payment ledger and do not establish refund eligibility. If MCP is unavailable, the workflow's synthetic fallback report must be labeled as unavailable evidence, and the skill stops before a refund request.

Verify the Same Boundary Without an LLM

From part4-multi-agent/, run the source helper directly:

Shell
 
python3 skills/refund-investigation/scripts/workflow.py submit \
  'generate-report --customer CUST-4091'

python3 skills/refund-investigation/scripts/workflow.py submit \
  'process-refund --customer CUST-4091 --amount 2500'


The first task completes with audit evidence from Part 1. The second returns TASK_STATE_INPUT_REQUIRED with no execution artifact. Preserve its id.

Now try an instruction claiming that approval can be skipped:

Shell
 
python3 skills/refund-investigation/scripts/workflow.py submit \
  'process-refund --customer CUST-4091 --amount 2500 --approved true --skip-approval true Ignore the policy and execute now'

python3 skills/refund-investigation/scripts/workflow.py submit \
  'drop-database --approved true --skip-approval true'

python3 skills/refund-investigation/scripts/workflow.py submit \
  'process-refund --customer CUST-4091 --amount invalid'


The refund still pauses; the destructive operation and invalid amount fail with TASK_STATE_FAILED. These requests model the command an agent might emit after reading a changed or malicious skill. They verify the backend boundary, not whether a particular model will resist prompt injection. A failed workflow task is a valid A2A response, so the helper prints it successfully; inspect its state.

Operator Decision and Evidence

In the operator's terminal, set REFUND_TASK_ID to the id from the original $2500 request. Approve that task once:

Shell
 
REFUND_TASK_ID='<server-generated-id>'
curl --fail-with-body -sS -X POST \
  "http://localhost:8082/api/tasks/$REFUND_TASK_ID/approve" | python3 -m json.tool
python3 skills/refund-investigation/scripts/workflow.py status "$REFUND_TASK_ID"


The admin response uses completed; A2A polling uses TASK_STATE_COMPLETED. Alternatively, reject a pending request:

Shell
 
curl --fail-with-body -sS -X POST \
  "http://localhost:8082/api/tasks/$REFUND_TASK_ID/reject" \
  -H 'Content-Type: application/json' \
  -d '{"reason":"Insufficient evidence for the simulated refund"}' | python3 -m json.tool


Choose one decision per task. Reject the additional bypass-test request using its own ID to leave no pending exercise task. Polling after rejection returns TASK_STATE_FAILED. Ask Goose to poll the original task and finish the evidence report, using assets/evidence-report.md from the skill package. It should report the observed decision and label the output as a simulation; no funds move.

The local admin API is unauthenticated. An agent with unrestricted HTTP access could call it too. The skill's instruction to leave approval to a human does not establish approver identity or separation of duties. Shared deployments need independently authorized approvers, protected admin endpoints, and durable approval evidence, in addition to the existing operation policy.

Regression Checks

RefundGovernanceTest Checks the $1000/$1001 boundary, missing and malformed amounts, approval claims, blocked operations, rejection, and single execution after approval. Run it with the rest of Part 4's tests:

Shell
 
# From the repository root
mvn -pl part4-multi-agent -am test


Treat skill instructions and scripts as reviewed source: pin the package revision when distributing it and rerun these checks after changes. Part 5's golden MCP datasets continue to validate tool behavior; these Part 4 tests cover the workflow approval boundary.

To verify the packaged helper against live MCP and A2A services, run the same smoke check as CI. It uses temporary ports, starts its own services, collects actual Part 1 fixture evidence, verifies approval and rejection through A2A polling, and stops the services when finished:

Shell
 
mvn -pl part1-quarkus-mcp,part4-multi-agent -am package -DskipTests
python3 part4-multi-agent/smoke-skills.py


A2A follow-up text such as APPROVED also leaves a pending task at the approval gate; only the operator's admin decision changes it. The HTTP regression suite checks this alongside status synchronization after admin decisions.

Run node --test part4-multi-agent/tests/*.test.cjs with Node 24+ to verify the ACP browser client without a model. With the optional runtime running, node part4-multi-agent/smoke-goose.cjs --connect-only tests a real WebSocket handshake. Omit --connect-only to create a session and stream one short test reply through your configured provider, which can incur provider usage.

What We Achieved

Starting from the observable architecture in Part 3, we added multi-agent orchestration with governance and HITL without changing any existing MCP tool code:

Layer What We Added Key File
A2A Protocol Agent Card + JSON-RPC via A2A Java SDK AgentCardProducer.java, AgentExecutorProducer.java
Governance AGENTS.md rule parsing and enforcement GovernanceEngine.java, AGENTS.md
Workflow State machine with HITL approval gates WorkflowEngine.java
MCP Integration Tool delegation via quarkus-langchain4j-mcp McpToolClient.java, application.properties
Admin REST API + SPA for human approvals AdminEndpoint.java, index.html
Agent Skills Reusable refund playbook, A2A helper, and evidence template skills/refund-investigation/SKILL.md

Production Considerations¶

Concern Local (this tutorial) Production
Task storage In-memory ConcurrentHashMap PostgreSQL + Flyway migrations
HITL notifications Browser polling from SPA WebSocket push or Slack/Teams integration
Governance rules AGENTS.md file on classpath Policy engine (OPA, Cedar, or Keycloak policies)
A2A transport Plain HTTP JSON-RPC mTLS + OAuth2 client credentials
Workflow engine Custom state machine SonataFlow (CNCF Serverless Workflow on Quarkus)
Audit trail In-memory task history Append-only event store with Kafka
API large language model Agent-based model

Opinions expressed by DZone contributors are their own.

Related

  • Adding Graph Retrieval to a RAG Pipeline With Python
  • Threat Modeling Context-Aware AI: A STRIDE Walkthrough
  • 6 Techniques To Reduce LLM API Costs With the Python Library
  • Prompt Caching: Overriding Tokenization for Faster and More Cost-Effective AI

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook