Boost Your Learning with ChatGPT and Apple's Shortcuts App

Alessandro - Jun 29 - - Dev Community

Hello There! πŸ‘‹

After attending an insightful AI talk by Benoit Macq and Bruno Colmant at the Brussels Book Fair earlier this year, I decided it was time to enhance my creative capabilities with the excellent tools provided by the leading minds in AI.

I started using ChatGPT (you already know ChatGPT, right? Just in case, here's a link: ChatGPT) to see how I could boost my current learning. Since the release of the ChatGPT app on Apple devices, it's possible to pair native tools like Reminders with ChatGPT to create a tutor or mentor.

The Concept

Let's get to the point! Imagine having someone on hand to review your public GitHub repo and offer advice on:

  • Project structure and key considerations.

  • Code quality and adherence to modern standards.

  • Bug identification.

  • Improvement suggestions.

  • Forgotten elements.

  • Relevant libraries or better-suited concepts.

  • Etc...

And finally, they could log all their recommendations in an issue on your project (wouldn't that be a great friend?) so you can review them later and plan your next steps in development or learning.

Well, that friend doesn't exist! If you have good friends, they might do this for you once, twice, three times, and then... (you get the idea ^^).

Good news! In 2024, you can create a mentor who is always there for you and takes the time to review your code (even when it's in a rough state, like mine during the learning phase).

Enough talking, let's get practical.

DISCLAIMER:

Never fully trust an entity (virtual or physical) that has a tendency to hallucinate and tell you nonsense when it doesn't know what to say! You've been warned!

Prerequisites

I assume you have at this stage:

  • An Apple computer or smartphone.

  • The ChatGPT app on your Apple device.

  • A ChatGPT account (paid or free, but be aware of the limitations of the free account).

  • You develop projects in a public GitHub repo.

Step-by-Step

GitHub Configuration

Go to GitHub Tokens and create a new token. You can select a classic or fine-grained token (I recommend a fine-grained one that you can customize).

Name it, select an account (yours), and optionally, authorise all repos or just the one where you want to post your issue at the end of the workflow.

The two permissions to select under Repository Permissions are:

Permissions

Permissions 2

Generate the token by clicking Generate Token. Copy the key and keep it safe. For example, I've created this token: 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

πŸ’‘ For ChatGPT to access the repo, nothing needs to be done for now. Since the repo is public and you use a version of ChatGPT with internet access, it will have access to all your files.

Shortcuts App Configuration

Open the Shortcuts app and create a new shortcut. For this demo, I'll use the desktop version, but know that the smartphone version works the same way.

Here's what the final workflow looks like:

Shortcut Workflow

You can select various elements on the right side of the app. According to the image above:

  1. The first Text element contains the public repo URL you want ChatGPT to analyze.

  2. The second converts the URL into a variable for use in the next block.

  3. The Text block that you pass to ChatGPT. Here’s the text to save you some time (this model is based on the RCT prompt principle - Role/Context/Task). This can be customized for your needs

You are a mentor with extensive experience in JavaScript and full-stack development. You will analyze my public GitHub repository, which serves as my learning playground, and be as thorough as possible in your responses, providing examples and tools:

repo (the variable from block 2 ^^)

I would like you to help identify the following points:

  • Is the project structure respected? What are the key considerations?

  • Does the code quality meet modern standards?

  • Are there any bugs you can identify?

  • Improvement suggestions?

  • Forgotten elements?

  • Relevant libraries or better-suited concepts?

Please provide a detailed analysis and concrete suggestions and write the response in English.

  1. The block that calls ChatGPT. The options for the block are your choice; I use GPT-4. Be sure to select Text corresponding to the previous block.

Ask GPT

  1. The next two blocks retrieve ChatGPT's response and store it in a variable answer for use in the next block (this is where it gets fun :)).

  2. Enter the GitHub API pointing to issues GitHub API Docs

    1. Choose POST because we want to create an issue automatically.
    2. In the headers, create two headers:

      1. Authorization with the value: Bearer*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* (This is the key you saved earlier)
      2. Content-Type with the value: application/json
    3. In the Request Body, select JSON (since the response we send to the API is of type JSON)

      1. Add two Keys

        1. title of type text with the value: The title you want, I chose to add the first variable I created repo
        2. body of type text with the value: answer (ChatGPT's response)

GitHub API

Run the workflow, authorize the accesses that Shortcuts will request, and wait for the content to be generated in an issue like the example below (based on my first project).

GPT Analysis - Contact Application

Conclusion

Now, you have unlimited possibilities. Extract the points you find important from this analysis and guide your learning accordingly.

I hope you can now take full advantage of ChatGPT's advice and continue your learning journey.

Don't hesitate to share your creations that could potentially benefit the community.

See you soon! πŸ‘‹

. . . . . . . .