ncoderz-awa-update-awa-templates-prompt.prompt.json json Copy{
"prompt" : "# Update awa Templates Prompt\n\nThis prompt guides you through updating the awa template files in `./templates/awa` to match changes made in the generated awa agent files.\n\n## Context\n\nThe awa CLI generates agent files from templates using the Eta templating engine. Templates can include partials from `./templates/awa/_partials/` directory. Your goal is to reverse-engineer changes from the generated files back into the template source files.\n\n## Understanding Template Assembly\n\nTemplates use Eta syntax:\n\n- `<%~ include('_partials/header.md', it) %>` - includes a partial\n- `<% if (condition) { %> ... <% } %>` - conditional logic\n- `<%= variable %>` - output variable\n- `<%~ variable %>` - output variable without escaping\n\nKey files:\n\n- **Generated files** (TARGET - do not modify):\n - `./.awa/.agent/awa.core.md` - Core agent configuration\n - `./.awa/.agent/schemas/*.schema.md` - Schema definitions (ARCHITECTURE, DESIGN, PLAN, REQ, TASK, etc.)\n - `./.github/agents/awa.agent.md` - Main awa agent file\n - `./.github/prompts/awa.*.prompt.md` - Mode-specific prompts (architecture, code, design, documentation, plan, requirements, tasks, validate)\n- **Template files** (SOURCE - edit these): `./templates/awa/` mirrors the root directory structure:\n - `./templates/awa/.awa/.agent/awa.core.md` → `./.awa/.agent/awa.core.md`\n - `./templates/awa/.awa/.agent/schemas/*.schema.md` → `./.awa/.agent/schemas/*.schema.md`\n - `./templates/awa/.github/agents/awa.agent.md` → `./.github/agents/awa.agent.md`\n - `./templates/awa/.github/prompts/awa.*.prompt.md` → `./.github/prompts/awa.*.prompt.md`\n- **Partial files**: `./templates/awa/_partials/*.md` (shared content included by templates)\n\n## State Machine\n\n<stateMachine name=\"UpdateAwaTemplates\" initialState=\"AnalyzeDifferences\">\n\n <state id=\"AnalyzeDifferences\" label=\"Analyze Differences\">\n <description>Compare generated agent files with template files to identify changes</description>\n <actions>\n <run command=\"npm run diff:awa\" description=\"Generate diff report between templates and target files\" />\n <analyze target=\"diff_output\" description=\"Identify which files have differences\" />\n <read path=\"./.awa/.agent/awa.core.md\" description=\"Read core agent file\" />\n <read path=\"./.awa/.agent/schemas/*.schema.md\" description=\"Read schema files\" />\n <read path=\"./.github/agents/awa.agent.md\" description=\"Read main agent file\" />\n <read path=\"./.github/prompts/awa.*.prompt.md\" description=\"Read mode-specific prompt files\" />\n <read path=\"./templates/awa/.awa/.agent/*.md\" description=\"Read corresponding template files\" />\n <read path=\"./templates/awa/.awa/.agent/schemas/*.schema.md\" description=\"Read schema template files\" />\n <read path=\"./templates/awa/.github/agents/*.md\" description=\"Read agent template files\" />\n <read path=\"./templates/awa/.github/prompts/*.prompt.md\" description=\"Read prompt template files\" />\n <read path=\"./templates/awa/_partials/*.md\" description=\"Read partial files that may be included\" />\n <identify target=\"change_locations\" description=\"Determine if changes are in template-specific content or in partials\" />\n </actions>\n <transitions>\n <transition target=\"Success\" condition=\"No differences found (exit code 0)\" />\n <transition target=\"UpdateTemplates\" condition=\"Differences found (exit code 1)\" />\n </transitions>\n </state>\n\n <state id=\"UpdateTemplates\" label=\"Update Templates\">\n <description>Apply changes from generated files back to template source files</description>\n <actions>\n <determine target=\"affected_files\" description=\"Identify which template or partial files need updates\" />\n <foreach item=\"changed_file\" in=\"affected_files\">\n <if condition=\"change is in partial content\">\n <edit path=\"./templates/awa/_partials/{partial}.md\" description=\"Update partial file with changes\" />\n </if>\n <if condition=\"change is in a target file\">\n <edit path=\"./templates/awa/{target_path}\" description=\"Update template file (mirrors root structure)\" />\n </if>\n </foreach>\n <note>NEVER modify files in ./.awa/.agent/, ./.github/agents/, or ./.github/prompts/ - these are target files only</note>\n <note>Only edit files in ./templates/awa/ directory</note>\n <note>Template paths mirror root: e.g., ./.github/agents/awa.agent.md → ./templates/awa/.github/agents/awa.agent.md</note>\n <note>Preserve Eta template syntax (includes, conditionals, variables)</note>\n <note>If content appears in multiple generated files, it likely belongs in a partial</note>\n </actions>\n <transitions>\n <transition target=\"ValidateChanges\" />\n </transitions>\n </state>\n\n <state id=\"ValidateChanges\" label=\"Validate Changes\">\n <description>Verify template changes produce exact original files</description>\n <actions>\n <run command=\"npm run diff:awa\" description=\"Re-run diff to validate template changes\" />\n <analyze target=\"diff_output\" description=\"Check if differences remain\" />\n </actions>\n <transitions>\n <transition target=\"Success\" condition=\"No differences (exit code 0)\" />\n <transition target=\"AnalyzeDifferences\" condition=\"Differences remain (exit code 1) AND iterations < 5\" />\n <transition target=\"Failure\" condition=\"Differences remain (exit code 1) AND iterations >= 5\" />\n </transitions>\n </state>\n\n <state id=\"Success\" label=\"Success\">\n <description>Templates successfully updated to match generated files</description>\n <actions>\n <report status=\"success\" message=\"Template files updated successfully. Generated files match target files exactly.\" />\n <list target=\"files_modified\" description=\"Show which template/partial files were changed\" />\n </actions>\n <transitions>\n <transition target=\"End\" />\n </transitions>\n </state>\n\n <state id=\"Failure\" label=\"Failure\">\n <description>Unable to resolve all differences after maximum iterations</description>\n <actions>\n <report status=\"failure\" message=\"Unable to resolve all differences after 5 iterations.\" />\n <report target=\"remaining_diffs\" description=\"Show remaining differences that could not be resolved\" />\n <suggest target=\"manual_review\" description=\"Suggest manual review of remaining differences\" />\n </actions>\n <transitions>\n <transition target=\"End\" />\n </transitions>\n </state>\n\n <state id=\"End\" label=\"End\">\n <description>Process complete</description>\n </state>\n\n</stateMachine>\n\n## Important Notes\n\n1. **NEVER MODIFY TARGET FILES**: You SHALL NOT modify or regenerate files in `./.awa/.agent/`, `./.github/agents/`, or `./.github/prompts/`. These are the target files that contain the desired changes. Only update template files in `./templates/awa/` to match them.\n2. **Template Structure**: Templates mirror root directory structure. For example:\n - `./.github/agents/awa.agent.md` → `./templates/awa/.github/agents/awa.agent.md`\n - `./.awa/.agent/schemas/DESIGN.schema.md` → `./templates/awa/.awa/.agent/schemas/DESIGN.schema.md`\n3. **Partial vs Template**: If the same content appears in multiple generated files, it's likely from a shared partial in `_partials/`\n4. **Preserve Syntax**: Maintain all Eta template syntax (`<%~`, `<%`, `%>`, etc.)\n5. **Template Data**: Templates receive an `it` object with data (check `_README.md` for structure)\n6. **Exact Match**: The diff must show zero differences for success (whitespace-sensitive)\n7. **Iteration Limit**: Maximum 10 iterations to prevent infinite loops\n\n## Validation Command\n\n```bash\nnpm run diff:awa\n```\n\nThis runs: `tsx src/cli/index.ts diff . --template ./templates/awa`\n\nCompares templates against the root directory, matching files like:\n- `./.awa/.agent/` - Core agent and schema files\n- `./.github/agents/` - Main agent file\n- `./.github/prompts/` - Mode-specific prompt files\n\nExit codes:\n\n- `0` = all files match exactly (success)\n- `1` = differences found (continue iteration)\n\n## Example Workflow\n\n1. Run `npm run diff:awa` to see what changed\n2. If `.github/prompts/awa.code.prompt.md` has changes:\n - Read `./.github/prompts/awa.code.prompt.md` (target, has changes)\n - Read `./templates/awa/.github/prompts/awa.code.prompt.md` (template source)\n - Read `./templates/awa/_partials/header.md` (if changes are in header)\n - Apply changes to appropriate template file(s)\n3. If `.awa/.agent/schemas/DESIGN.schema.md` has changes:\n - Read `./.awa/.agent/schemas/DESIGN.schema.md` (target, has changes)\n - Read `./templates/awa/.awa/.agent/schemas/DESIGN.schema.md` (template source)\n - Apply changes to the template\n4. Run `npm run diff:awa` again to validate\n5. Repeat until exit code is 0\n\n## Success Criteria\n\n- `npm run diff:awa` exits with code 0\n- No output diffs shown\n- All template files preserve Eta syntax\n- All agent files match their generated counterparts exactly" ,
"variables" : [],
"notes" : "Update awa template files to match changes in generated agent files Tools: edit, runCommands, search, read." ,
"metadata" : {
"source" : {
"provider" : "github-prompts" ,
"repository" : "https://github.com/ncoderz/awa" ,
"path" : ".github/prompts/update-awa-templates.prompt.md" ,
"ref" : "bea98700680b1eafbad3f739117ef66e30c4b9ae" ,
"url" : "https://github.com/ncoderz/awa/blob/bea98700680b1eafbad3f739117ef66e30c4b9ae/.github/prompts/update-awa-templates.prompt.md" ,
"key" : "ncoderz/awa/.github/prompts/update-awa-templates.prompt.md"
}
}
}