|
| 1 | +# Ailly Prompt Workflow |
| 2 | + |
| 3 | +This project automates the process of generating, running, parsing, and applying [Ailly](https://www.npmjs.com/package/@ailly/cli) prompt outputs to an AWS DocGen project. It combines all steps into one streamlined command using a single Python script. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 📦 Overview |
| 8 | + |
| 9 | +This tool: |
| 10 | +1. **Generates** Ailly prompts from DocGen snippets. |
| 11 | +2. **Runs** Ailly CLI to get enhanced metadata. |
| 12 | +3. **Parses** Ailly responses into structured JSON. |
| 13 | +4. **Updates** your DocGen examples with the new metadata. |
| 14 | + |
| 15 | +All of this is done with one command. |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## ✅ Prerequisites |
| 20 | + |
| 21 | +- Python 3.8+ |
| 22 | +- Node.js and npm (for `npx`) |
| 23 | +- A DocGen project directory |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 🚀 Usage |
| 28 | + |
| 29 | +From your project root, run: |
| 30 | + |
| 31 | +```bash |
| 32 | +python -m aws_doc_sdk_examples_tools.agent.bin.main \ |
| 33 | + /path/to/your/docgen/project \ |
| 34 | + --system-prompts path/to/system_prompt.txt |
| 35 | +``` |
| 36 | + |
| 37 | +### 🔧 Arguments |
| 38 | + |
| 39 | +- `iam_tributary_root`: Path to the root directory of your IAM policy tributary |
| 40 | +- `--system-prompts`: List of system prompt files or strings to include in the Ailly configuration |
| 41 | +- `--skip-generation`: Skip the prompt generation and Ailly execution steps (useful for reprocessing existing outputs) |
| 42 | + |
| 43 | +Run `python -m aws_doc_sdk_examples_tools.agent.bin.main update --help` for more info. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## 🗂 What This Does |
| 48 | + |
| 49 | +Under the hood, this script: |
| 50 | + |
| 51 | +1. Creates a directory `.ailly_iam_policy` containing: |
| 52 | + - One Markdown file per snippet. |
| 53 | + - A `.aillyrc` configuration file. |
| 54 | + |
| 55 | +2. Runs `npx @ailly/cli` to generate `.ailly.md` outputs. |
| 56 | + |
| 57 | +3. Parses the Ailly `.ailly.md` files into a single `iam_updates.json` file. |
| 58 | + |
| 59 | +4. Updates each matching `Example` in the DocGen instance with: |
| 60 | + - `title` |
| 61 | + - `title_abbrev` |
| 62 | + - `synopsis` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 💡 Example |
| 67 | + |
| 68 | +```bash |
| 69 | +python -m aws_doc_sdk_examples_tools.agent.bin.main \ |
| 70 | + ~/projects/AWSIAMPolicyExampleReservoir \ |
| 71 | + --system-prompts prompts/system_prompt.txt |
| 72 | +``` |
| 73 | + |
| 74 | +This will: |
| 75 | +- Write prompts and config to `.ailly_iam_policy/` |
| 76 | +- Run Ailly and capture results |
| 77 | +- Parse and save output as `.ailly_iam_policy/iam_updates.json` |
| 78 | +- Apply updates to your DocGen examples |
0 commit comments