@@ -148,3 +148,95 @@ You can then use a `docker-compose.yaml` file to run them. Such a file
148148can be created from the TrustGraph config utility or the
149149` trustgraph-templates ` utility repo.
150150
151+ ## Development Workflow
152+
153+ ### Working with AI Assistants
154+
155+ When working with AI assistants like Claude for development.
156+
157+ Be aware...
158+ - AI assistants are not perfect. Your job is to learn their limitations
159+ and work with them.
160+ - Assistants can be forgetful, so "writing things down" is a good plan.
161+ Submit a tech spec along with your pull request, and other people will be
162+ able to use AI assistants to enchance, test, and verify your work.
163+ - Assistants can get confused with large quantities of stuff. So get them
164+ to be modular. Bring things into well-defined classes and modules
165+ reduces the need to "know everything" at once.
166+ - AI assistants are a little random and can 'go off-pieste' if things
167+ get confusing, so catch them before they do this to save yourself a bunch
168+ of time.
169+ - Try to get an understanding of how things are solved in the codebase to
170+ prevent assistants from re-inventing the wheel regarding something that's
171+ already solved in the codebase.
172+
173+ A useful process guide:
174+ 1 . ** Read the Test Strategy** : Have the AI assistant read ` TEST_STRATEGY.md `
175+ to understand testing approaches
176+ 2 . ** Branch from Latest Release** : Fork the repo and create a branch off the
177+ latest ` release/vX.Y `
178+ 3 . ** Create Technical Specifications** : Get the assistant to write tech
179+ specs in ` docs/tech-specs/WHATEVER.md ` for new features. It helps to be
180+ iterative for complex work. Start with an empty template and add
181+ requirements a bit at time, and check the assistant is doing the right
182+ thing. Shout on the Discord forum if you want something reviewed.
183+ 4 . ** Iterative Development** : Review and refine the tech spec before
184+ implementation.
185+ 5 . ** Commit the Tech Spec** : Save the specification before beginning
186+ implementation.
187+ 6 . ** Implement with Regular Commits** : Commit changes regularly to bank
188+ progress and enable easy rollbacks.
189+ 7 . ** Create Pull Requests** : Push changes and create PRs for review, do this
190+ as your code becomes more mature so you get an idea what the test suite
191+ thinks of your change.
192+ 8 . ** Verify Tests** : Ensure all tests pass before merging.
193+ 9 . ** Write Tests for New Features** : Add comprehensive tests for any new
194+ functionality.
195+
196+ ### Testing Environment Setup
197+
198+ For local testing, set up a Python virtual environment in the trustgraph directory:
199+
200+ ``` bash
201+ python3 -m venv env
202+ source env/bin/activate # On Linux/Mac
203+ # or
204+ env\S cripts\a ctivate # On Windows
205+
206+ pip install ./trustgraph-base
207+ pip install ./trustgraph-cli
208+ pip install ./trustgraph-flow
209+ pip install ./trustgraph-vertexai
210+ pip install ./trustgraph-bedrock
211+
212+ # Run tests
213+ pytest tests -m ' not slow'
214+ ```
215+
216+ Note: As we use the 'trustgraph' namespace across multiple packages,
217+ ` pip install -e ` seems not to work well.
218+
219+ ** Important Notes:**
220+ - Reinstall packages (` pip install ./package-name ` ) whenever code changes
221+ - Run tests periodically to catch issues early
222+ - AI assistants may not remember to reinstall packages, so monitor this manually
223+
224+ It can save time and token usage by running the tests yourself and
225+ cut'n'pasting just the errors into the code assistant.
226+
227+ ### Development Best Practices
228+
229+ - ** Modular Code** : Write modular, well-architected code - this helps both AI
230+ assistants and human developers
231+ - ** Incremental Progress** : AI assistants aren't perfect, so encourage
232+ incremental changes
233+ - ** Regular Testing** : Test frequently to prevent major issues
234+ - ** Clear Specifications** : Document intentions clearly in tech specs before
235+ implementation
236+ - ** Solve common problems** commonly. As well as all the old-school
237+ benefits, this really does save a ton of time and token usage
238+
239+ ### Share your experiences
240+
241+ We love Claude and Qwen coding models, we want to hear about your experiences
242+ too, get in Discord and share.
0 commit comments