<?xml version="1.0" encoding="UTF-8"?>
<gsl-prompt id="20250801T153742+0000" type="feat">
<gsl-header>

# Multi-XSD Prompt Validation with xmlschema and Resource Packaging
</gsl-header>
<gsl-block>
<gsl-purpose>
<gsl-title>

## 1. Purpose
</gsl-title>
<gsl-description>

Implement robust prompt validation in OBK, supporting multiple XSD schemas, package resource loading, and migration to `xmlschema` for modern XML validation.
</gsl-description>
</gsl-purpose>

<gsl-inputs>
<gsl-title>

## 2. Inputs
</gsl-title>
<gsl-description>

| Input | Notes |
| --- | --- |
| `xsd-upgrade.md` | Feature/design spec for multi-XSD prompt validation |
| `prompt-template-for-codex-agents.md` | Prompt structure and maintenance rules |
| `adhoc-task-template-for-codex-agents.md` | Task structuring and repo modification policy |
| `one-line-manual-tests.md` | Manual test philosophy for initial test cases |
| `20250801T153742+0000.md` | Stubbed prompt (this prompt) |

</gsl-description>
</gsl-inputs>

<gsl-outputs>
<gsl-title>

## 3. Outputs
</gsl-title>
<gsl-description>

<!-- List main components or deliverables produced by this prompt. -->
- Source code
- Completed `20250801T153742+0000` prompt
- Automated tests checked against manual tests
</gsl-description>
</gsl-outputs>
<gsl-workflows>
<gsl-title>

## 4. Workflows
</gsl-title>
<gsl-description>

#### **Minimal PyPI Release Workflow**

1. **Bump version**  
    Edit `pyproject.toml` → update `version = "..."`
    
2. **Clean & build**
    
    ```powershell
    Remove-Item -Recurse -Force dist, build, *.egg-info
    hatch build

    ```
    
3. **Upload**
    
    ```powershell
    twine upload dist/*
    ```
    

* * *

#### **What to check**

* `pip install obk` works **from PyPI** (not just from your local dist).
    
* The installed CLI works:
    
    * `obk hello-world`
        
    * `obk validate-all --prompts-dir ...`  
        (Check that schema files are available and validation works!)
        
* CLI shows correct help output.
    
* No `ModuleNotFoundError` or “can’t find resource” errors.
    
* All included package data (`xsd/*.xsd`, etc.) are present and loaded.
    
* Tests and real-world usage work as expected.

#### **Pro Tip**

If you’re doing this from a **clean machine or VM** (or just a new venv), you’ll catch “it works on my machine” bugs before your users do!

You can also run:

```bash
pip uninstall obk
pip install obk
```

on your own machine, but a _truly_ fresh environment is even better.
</gsl-description>
</gsl-workflows>

<gsl-acceptance-tests>
<gsl-title>

## 5. Acceptance Tests
</gsl-title>

<gsl-acceptance-test id="1">
<gsl-performed-action>

1. On a fresh machine, run `pip install obk`
</gsl-performed-action>
<gsl-expected-result>

    The installation completes successfully. Running `obk validate-all --prompts-dir some_dir/` finds no resource or import errors.
</gsl-expected-result>
</gsl-acceptance-test>
<gsl-acceptance-test id="2">
<gsl-performed-action>

2. Run `obk validate-all --prompts-dir valid_prompts/` where some files are valid for their schemas
</gsl-performed-action>
<gsl-expected-result>

    The CLI reports "All prompt files are valid." and exits with code 0.
</gsl-expected-result>
</gsl-acceptance-test>

<gsl-acceptance-test id="3">
<gsl-performed-action>

3. Run `obk validate-all --prompts-dir invalid_prompts/` where at least one file is invalid for its mapped schema
</gsl-performed-action>
<gsl-expected-result>

    The CLI reports clear validation errors for the invalid files and exits with code 1.
</gsl-expected-result>
</gsl-acceptance-test>
</gsl-acceptance-tests>
</gsl-block>
</gsl-prompt>
