Skip to content

Add Foundry segment output configuration tool - #131

Open
ko47kmr wants to merge 2 commits into
mainfrom
feature/foundry-segment-output-tool
Open

Add Foundry segment output configuration tool#131
ko47kmr wants to merge 2 commits into
mainfrom
feature/foundry-segment-output-tool

Conversation

@ko47kmr

@ko47kmr ko47kmr commented Mar 16, 2026

Copy link
Copy Markdown

Summary

This PR adds a command-line tool to automate adding :segment: output capability to Foundry agents.

  • New script: foundry-tools/segment-output/tdx-add-segment-output.sh - Automates the process of configuring agents with segment generation output
  • Schema file: segment_output.schema.json - Complete JSON Schema defining segment structure validation
  • Documentation: Comprehensive README with usage instructions, troubleshooting, and examples

Key Features

  • ✅ Automated tdx agent pull → modify → push workflow
  • ✅ Dependency checking (tdx, yq, jq)
  • ✅ Authentication verification
  • ✅ Detects and confirms before overwriting existing :segment: output
  • ✅ Color-coded output for better UX
  • ✅ Comprehensive error handling

Use Case

Unlike tdx sg (which creates segments directly via CLI), this tool configures Foundry agents to generate segment drafts through natural language conversation. Users can then review and save the segments in Audience Studio's Segment Editor.

Target users: TDx CLI users and Treasure Studio who want to enable segment generation capabilities in their Foundry agents.

Testing

✅ Tested successfully with ___test_project/test_111 agent
✅ Verified complete workflow: pull → modify → validate → push

Test plan

  • Script executes successfully with valid project/agent names
  • Schema file is correctly embedded in agent.yml
  • Agent configuration validates against Foundry API
  • Error messages display correctly for missing dependencies
  • Overwrites existing :segment: output with confirmation
  • README documentation is clear and comprehensive

🤖 Generated with Claude Code

- Add tdx-add-segment-output.sh script to automate :segment: output setup
- Include complete segment_output.schema.json from Foundry
- Add comprehensive README with usage instructions and troubleshooting
- Tool enables easy integration of segment generation in Foundry agents
- Tested successfully with ___test_project/test_111 agent
@ko47kmr
ko47kmr requested review from a team as code owners March 16, 2026 06:42
- Ensures output type is correctly identified as Custom in Foundry UI
- Matches production agent configuration format
- Tested successfully with default-agent

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ko47kmr
ko47kmr requested review from adher-code, doryokujin and tsubasatmd and removed request for adher-code and tsubasatmd March 16, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant