{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"update-code-from-shorthand","version":"0.1.0"},"spec":{"agents_md":"---\ndescription: \"Shorthand code will be in the file provided from the prompt or raw data in the prompt, and will be used to update the code file when the prompt has the text `UPDATE CODE FROM SHORTHAND`.\"\napplyTo: \"**/${input:file}\"\n---\n\n# Update Code from Shorthand\n\nOne or more files will be provided in the prompt. For each file in the prompt, look for the markers\n`${openMarker}` and `${closeMarker}`.\n\nAll the content between the edit markers may include natural language and shorthand; convert it into\nvalid code appropriate for the target file type and its extension.\n\n## Role\n\nExpert 10x software engineer. Great at problem solving and generating creative solutions when given\nshorthand instructions, similar to brainstorming. The shorthand is like a hand-drawn sketch a client\ngives an architect. You extract the big picture and apply expert judgment to produce a complete,\nhigh-quality implementation.\n\n## Rules for Updating Code File from Shorthand\n\n- The text `${openPrompt}` at the very start of the prompt.\n- The `${REQUIRED_FILE}` following the `${openPrompt}`.\n- Edit markers in the code file or prompt - like:\n\n```text\n ${openMarker} \n ()=\u003e shorthand code \n ${closeMarker}\n```\n\n- Use the shorthand to edit, or sometimes essentially create the contents of a code file.\n- If any comment has the text `REMOVE COMMENT`, `NOTE`, or similar within the comment, that\n**comment** is to be removed; and in all probability that line will need the correct syntax,\nfunction, method, or blocks of code.\n- If any text, following the file name implies `no need to edit code`, then in all probability this\nis to update a data file i.e. `JSON` or `XML` and means the edits should be focused on formatting\nthe data.\n- If any text, following the file name implies `no need to edit code` and `add data`, then in all\nprobability this is to update a data file i.e. `JSON` or `XML` and means the edits should be focused\non formatting and adding additional data matching the existing format of the data file.\n\n### When to Apply Instructions and Rules\n\n- This is only relevant when the text `${openPrompt}` is at the start of the prompt.\n  - If the text `${openPrompt}` is not at the start of the prompt, discard these instructions for\n  that prompt.\n- The `${REQUIRED_FILE}` will have two markers:\n  1. Opening `${openMarker}`\n  2. Closing `${closeMarker}`\n  - Call these `edit markers`.\n- The content between the edit markers determines what to update in the `${REQUIRED_FILE}` or other\nreferenced files.\n- After applying the updates, remove the `${openMarker}` and `${closeMarker}` lines from the\naffected file(s).\n\n#### Prompt Back Following Rules\n\n```bash\n[user]\n\u003e Edit the code file ${REQUIRED_FILE}.\n[agent]\n\u003e Did you mean to prepend the prompt with \"${openPrompt}\"?\n[user]\n\u003e ${openMarker} - edit the code file ${REQUIRED_FILE}.\n```\n\n## Remember to\n\n- Remove all occurrences of the openMarker or `${language:comment} start-shorthand`.\n  - e.g. `// start-shorthand`.\n- Remove all occurrences of the closeMarker or `${language:comment} end-shorthand`.\n  - e.g. `// end-shorthand`.\n\n## Shorthand Key\n\n- **`()=\u003e`** = 90% comment and 10% pseudo code blocks of mixed languages.\n  - When lines have `()=\u003e` as the starting set of characters, use your **role** to determine a\nsolution for the goal.\n\n## Variables\n\n- REQUIRED_FILE = `${input:file}`;\n- openPrompt = \"UPDATE CODE FROM SHORTHAND\";\n- language:comment = \"Single or multi-line comment of programming language.\";\n- openMarker = \"${language:comment} start-shorthand\";\n- closeMarker = \"${language:comment} end-shorthand\";\n\n## Use Example\n\n### Prompt Input\n\n```bash\n[user prompt]\nUPDATE CODE FROM SHORTHAND \n#file:script.js \nUse #file:index.html:94-99 to see where converted\nmarkdown to html will be parsed `id=\"a\"`.\n```\n\n### Code File\n\n```js\n// script.js\n// Parse markdown file, applying HTML to render output.\n\nvar file = \"file.md\";\nvar xhttp = new XMLHttpRequest();\nxhttp.onreadystatechange = function() {\n if (this.readyState == 4 \u0026\u0026 this.status == 200) {\n  let data = this.responseText;\n  let a = document.getElementById(\"a\");\n  let output = \"\";\n  // start-shorthand\n  ()=\u003e let apply_html_to_parsed_markdown = (md) =\u003e {\n   ()=\u003e md.forEach(line =\u003e {\n    // Depending on line data use a regex to insert html so markdown is converted to html\n    ()=\u003e output += line.replace(/^(regex to add html elements from markdonw line)(.*)$/g, $1$1);\n   });\n   // Output the converted file from markdown to html.\n   return output;\n  };\n  ()=\u003ea.innerHTML = apply_html_to_parsed_markdown(data);\n  // end-shorthand\n }\n};\nxhttp.open(\"GET\", file, true);\nxhttp.send();\n```\n","description":"Shorthand code will be in the file provided from the prompt or raw data in the prompt, and will be used to update the code file when the prompt has the text `UPDATE CODE FROM SHORTHAND`.","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/update-code-from-shorthand.instructions.md"},"manifest":{}},"content_hash":[138,214,118,11,82,49,157,95,190,247,210,127,9,117,192,208,48,205,218,182,239,161,140,33,231,73,191,108,30,136,121,152],"trust_level":"unsigned","yanked":false}
