Recent

Author Topic: Discipline your AI coding sessions  (Read 704 times)

avra

  • Hero Member
  • *****
  • Posts: 2591
    • Additional info
Discipline your AI coding sessions
« on: May 21, 2026, 06:52:25 pm »
If you use AI coding assistants like Claude Code, OpenCode and others, there is a way to make them actually behave, so every coding session becomes more disciplined, more predictable, and more productive:

https://github.com/zeljkoavramovic/karpathy-bernstein-avramovic

Happy Pascal coding !!!  ;)
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: Discipline your AI coding sessions
« Reply #1 on: May 21, 2026, 07:36:11 pm »
Sounds like something very useful.

I had to give up on Gemini before asking it to produce even a single line of code because it could not leave specs untouched which totally defeats the purpose of having a spec to determine what has to be done and also how.  It just couldn't help itself from making changes.

I'm pretty sure what you've shared there will come in handy once I tell Claude to produce code. 

Thank you Avra.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

avra

  • Hero Member
  • *****
  • Posts: 2591
    • Additional info
Re: Discipline your AI coding sessions
« Reply #2 on: May 24, 2026, 10:07:53 pm »
Alternative presentation for people who do not like to read MD files:
https://zeljkoavramovic.github.io/karpathy-bernstein-avramovic/

Thank you Avra.
You're most welcome  :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

devEric69

  • Hero Member
  • *****
  • Posts: 657
Re: Discipline your AI coding sessions
« Reply #3 on: May 26, 2026, 04:48:27 pm »
Thank you @Avra: I'm using it ("Power is nothing without control.", as says an advertisement).
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

avra

  • Hero Member
  • *****
  • Posts: 2591
    • Additional info
Re: Discipline your AI coding sessions
« Reply #4 on: May 26, 2026, 06:17:32 pm »
Thank you @Avra: I'm using it ("Power is nothing without control.", as says an advertisement).
I am glad you like it  :D

If you want you can combine it with freepascal and lazarus specific skills from https://github.com/delphicleancode/lazarus-spec-kit;)
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Weiss

  • Full Member
  • ***
  • Posts: 242
Re: Discipline your AI coding sessions
« Reply #5 on: May 31, 2026, 09:47:34 am »
interesting. If I understand it right, .md file must be in a project folder on my machine, and if I understand that part also, it means Claude needs its little app installed to be able to access .md file on my machine? I am reading about md file and AI misdemeanors, sounds scary. So far I used AI as a coach and guide, not the code writer. It shines as a tool to expand the documentation with concrete examples.

or do I just copy text with project particulars to AI at each session? It is same idea as md file, no?

By the way, I got into habit of keeping AI session open ( I am talking about Google AI Mode sessions) until I walked all the way through, which might take days, and doing it this way, every new AI instance replies as if that thing never left.

avra

  • Hero Member
  • *****
  • Posts: 2591
    • Additional info
Re: Discipline your AI coding sessions
« Reply #6 on: Today at 12:19:27 am »
If I understand it right, .md file must be in a project folder on my machine, and if I understand that part also, it means Claude needs its little app installed to be able to access .md file on my machine?
It all makes sense only if you use it with AI coding assistants like Claude Code, OpenCode, Codex, Google Antigravity, Claude Cowork, Codex Desktop, and others, since they all allow you to work on your local project folder. It is not useful for chat sessions used from your browser. MD file can be local to your project folder, but it is better to have it available for all your projects - which is what installation script does.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: Discipline your AI coding sessions
« Reply #7 on: Today at 02:44:06 am »
So far I used AI as a coach and guide, not the code writer. It shines as a tool to expand the documentation with concrete examples.
Just the standard word of caution about AI, as you have found, AI is a reasonably good coach but, you do have to keep in mind that the thing does make mistakes, sometimes even very simple mistakes.  What I'm saying here is that, don't ask it to write code for something you don't understand and cannot personally ensure is correct because if you do that, you don't have the knowledge necessary to catch the mistakes it does make and correct them.  The more sophisticated the code you ask it to write the more important following that rule becomes.

That said, if you're learning about something and, always keep in the back of your mind that the example it just provided you may contain errors, you should still be ok by learning from its errors in addition to yours ;)

HTH.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018