Skip to content

Conversation

@jhauga
Copy link
Contributor

@jhauga jhauga commented Nov 2, 2025

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, or chat mode file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, or chat mode with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

This allows the agent to look at a code file and make updates where marked lines like ()=> for x in y do z++; where the agent takes context from current file and applies the changes. And applies the changes really good (if I might say). I tested it using this in a prompt:

UPDATE CODE FROM SHORTHAND
#file:collections #file:instructions #file:instructions #file:prompts 
// start-shorthand
()=> for file in prompt:folder DO (
 // If there are md ```(.*) with "```"code"```" nested before closing ```, then indent nested data.
 ()=> if (findstr /R /(```).*(```).*(```).*(```)/gi file == true) {
  // Indent the nested data between "```".* and closing "```" so that the code block will render correctly on github.com, and not affect the remaining markdown so it becomes more human readable.
  ()=> file = file.replaceAll(/```(.*)\n(.*)\n```/gi, `\`\`\`$1\n` + `\t\t\t\t$2\n\`\`\`` );
  ()=> file.save();
 }
)
// end-shorthand

It created a new file scripts/indent-nested-md-code.js, which worked; but not perfect. So - then several tweaks like:

#file:indent-nested-md-code.js indent 4 spaces and not 3.

and

The script #file:indent-nested-md-code.js is not working entirely as it should. It should indent code blocks i.e. "```" that are nested in a code block like:

    ```md
    Some instruction or prompt template that uses nest code block in template of prompt or instruction file like:
    ```js
    var one 1 = 1;
    return one;
    ```
    ```

    and indent the nested code block 4 spaces like:

    ```md
    Some instruction or prompt template that uses nest code block in template of prompt or instruction file like:
        ```js
        var one 1 = 1;
        return one;
        ```
    ```

So that the markdown renders in the browser not affecting remaining markdown
so it becomes more human readable. Only edit #file:indent-nested-md-code.js 

And the end result - pushed them to another branch where you can see the difference at indent-nested-md-code.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New chat mode file.
  • New collection file.
  • Update to existing instruction, prompt, chat mode, or collection.
  • Other (please specify):

Additional Notes

I add trouble with npm start. I had to modify the eng/yaml-parser.js, package.json, and package-lock.json to get it to work, running git restore . after adding the docs/README.instructions.md that was relevant to this pull request.


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI review requested due to automatic review settings November 2, 2025 06:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new custom instruction file for updating code from shorthand notation and adds it to the instructions catalog. The PR also appears to have updated all description entries in the README table, though many of these changes appear to be unintentional modifications.

Key Changes

  • Adds a new instruction file update-code-from-shorthand.instructions.md for converting shorthand notation to production code
  • Inserts the new instruction entry into the alphabetically-sorted README table at position 120
  • Updates description entries across the entire README table (appears to be unintentional bulk changes)

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
instructions/update-code-from-shorthand.instructions.md New instruction file defining shorthand-to-code conversion guidelines
docs/README.instructions.md Adds new instruction entry and modifies existing descriptions

jhauga and others added 3 commits November 2, 2025 01:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jhauga
Copy link
Contributor Author

jhauga commented Nov 2, 2025

Wanted the example instructions to be functional, and illustrate better how to correctly use the instructions; so I changed the bottom example a bit. For proof of concept I used an example file like the one in the instructions, and used the prompt from the updated example. With just that the agent produced a basic markdown to html converter. See support-repo for an example of - well, the example.

Copy link
Contributor

@aaronpowell aaronpowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like something is up with the changes in the README, as there's a lot unrelated to the new instruction being added.

Can you update with main and re-run

@jhauga jhauga marked this pull request as draft November 3, 2025 01:12
@jhauga jhauga marked this pull request as ready for review November 3, 2025 01:38
@jhauga jhauga requested a review from aaronpowell November 3, 2025 02:15
@aaronpowell aaronpowell merged commit aa81913 into github:main Nov 3, 2025
2 checks passed
@jhauga jhauga deleted the update-code-from-shorthand branch November 3, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants