Blame

74fcad David Marsh 2026-05-11 05:10:00
1
# AI-Assisted Development Workflow
2e3b03 David Marsh 2026-05-01 02:10:41
2
74fcad David Marsh 2026-05-11 05:10:00
3
AI tools are useful, but only when treated like fast junior engineers with unlimited energy and limited judgement.
2e3b03 David Marsh 2026-05-01 02:10:41
4
74fcad David Marsh 2026-05-11 05:10:00
5
The quality of the output depends heavily on:
6
- project documentation
7
- clear rules
8
- tight feedback loops
9
- small scoped tasks
10
- verification at every step
2e3b03 David Marsh 2026-05-01 02:10:41
11
91cd70 David Marsh 2026-05-25 05:30:40
12
---
13
14
# Core principles
2e3b03 David Marsh 2026-05-01 02:10:41
15
91cd70 David Marsh 2026-05-25 05:30:40
16
## 1. Keep project knowledge in files
74fcad David Marsh 2026-05-11 05:10:00
17
18
Do not rely on chat history as memory.
19
20
Every project should contain:
21
- design documents
22
- architecture notes
23
- coding standards
24
- workflow rules
25
- progress journals
26
- TODO tracking
27
28
The AI should read these files at the start of every session.
29
30
Prefer Markdown files committed to the repository so both humans and AI share the same source of truth.
20d9c3 David Marsh 2026-05-05 03:01:33
31
32
---
33
91cd70 David Marsh 2026-05-25 05:30:40
34
## 2. Structure memory by type
9c95d2 David Marsh 2026-05-18 08:31:22
35
36
A single journal file conflates different kinds of information and becomes noise over time.
37
38
Separate memory by type:
39
40
- **User context** — who is working on this, their expertise, what they care about. Helps calibrate explanation depth and framing.
41
- **Feedback** — corrections and confirmations, each with a *why*. Record both directions: if you only save corrections, you avoid past mistakes but drift away from approaches that were already validated. The *why* lets edge cases be judged rather than rules applied blindly.
42
- **Project state** — current goals, blockers, parked ideas, open questions, deadlines.
91cd70 David Marsh 2026-05-25 05:30:40
43
- **References** — dashboards, issue trackers, documentation, operational runbooks, and non-sensitive configuration locations.
9c95d2 David Marsh 2026-05-18 08:31:22
44
45
Keep these in separate files. Load only what is relevant to the current session.
46
91cd70 David Marsh 2026-05-25 05:30:40
47
Secrets and credentials should never be stored in AI-readable project memory.
48
9c95d2 David Marsh 2026-05-18 08:31:22
49
---
50
91cd70 David Marsh 2026-05-25 05:30:40
51
## 3. Describe desired behaviour positively
20d9c3 David Marsh 2026-05-05 03:01:33
52
74fcad David Marsh 2026-05-11 05:10:00
53
Write rules describing how work should be done rather than only listing forbidden behaviour.
50cead David Marsh 2026-05-05 03:27:58
54
74fcad David Marsh 2026-05-11 05:10:00
55
Good:
56
- "Preserve existing debug logging unless explicitly asked to remove it."
57
- "Implement changes incrementally and verify after each step."
20d9c3 David Marsh 2026-05-05 03:01:33
58
74fcad David Marsh 2026-05-11 05:10:00
59
Bad:
60
- "Don't remove logs."
61
- "Don't break things."
20d9c3 David Marsh 2026-05-05 03:01:33
62
91cd70 David Marsh 2026-05-25 05:30:40
63
Positive instructions usually produce more reliable behaviour.
64
65
Negative constraints are still important for:
66
- security boundaries
67
- destructive operations
68
- irreversible actions
69
70
Use both styles where appropriate.
20d9c3 David Marsh 2026-05-05 03:01:33
71
74fcad David Marsh 2026-05-11 05:10:00
72
---
20d9c3 David Marsh 2026-05-05 03:01:33
73
91cd70 David Marsh 2026-05-25 05:30:40
74
## 4. Separate design from implementation
20d9c3 David Marsh 2026-05-05 03:01:33
75
74fcad David Marsh 2026-05-11 05:10:00
76
Maintain design documents describing:
77
- architecture
78
- intended workflows
79
- module responsibilities
80
- invariants
81
- interfaces
82
- constraints
20d9c3 David Marsh 2026-05-05 03:01:33
83
74fcad David Marsh 2026-05-11 05:10:00
84
Then instruct the AI to implement the documented design.
20d9c3 David Marsh 2026-05-05 03:01:33
85
74fcad David Marsh 2026-05-11 05:10:00
86
If implementation repeatedly goes wrong:
87
1. improve the design docs
88
2. improve the rules
89
3. review whether the architecture itself is unclear
20d9c3 David Marsh 2026-05-05 03:01:33
90
74fcad David Marsh 2026-05-11 05:10:00
91
Do not keep patching prompts forever.
20d9c3 David Marsh 2026-05-05 03:01:33
92
74fcad David Marsh 2026-05-11 05:10:00
93
---
20d9c3 David Marsh 2026-05-05 03:01:33
94
91cd70 David Marsh 2026-05-25 05:30:40
95
## 5. Use minimal prompts
20d9c3 David Marsh 2026-05-05 03:01:33
96
74fcad David Marsh 2026-05-11 05:10:00
97
Once project context exists in files:
98
- prompts should be short
99
- prompts should reference TODO items
100
- prompts should focus on one task at a time
20d9c3 David Marsh 2026-05-05 03:01:33
101
74fcad David Marsh 2026-05-11 05:10:00
102
Long conversational prompting usually causes drift and inconsistency.
50cead David Marsh 2026-05-05 03:27:58
103
9c95d2 David Marsh 2026-05-18 08:31:22
104
Define named shorthands for repeatable multi-step sequences. Document the expansion in project rules so the AI learns it rather than guessing.
105
106
Good:
91cd70 David Marsh 2026-05-25 05:30:40
107
- "wrap it up" -> check for leaks, update changelog, update docs, commit, push, update journal
9c95d2 David Marsh 2026-05-18 08:31:22
108
109
This is more reliable than re-stating the full sequence each time.
110
50cead David Marsh 2026-05-05 03:27:58
111
---
74fcad David Marsh 2026-05-11 05:10:00
112
91cd70 David Marsh 2026-05-25 05:30:40
113
## 6. Use isolated sessions
74fcad David Marsh 2026-05-11 05:10:00
114
115
Prefer a new AI session for each feature or task.
116
117
This reduces:
118
- context pollution
119
- stale assumptions
120
- accidental behavioural drift
121
91cd70 David Marsh 2026-05-25 05:30:40
122
Long sessions accumulate stale assumptions, conflicting context, and behavioural drift.
123
124
Keep sessions short and let project files carry continuity instead.
1cd1e0 David Marsh 2026-05-19 09:43:34
125
91cd70 David Marsh 2026-05-25 05:30:40
126
Persistent project files should carry the long-term memory.
74fcad David Marsh 2026-05-11 05:10:00
127
50cead David Marsh 2026-05-05 03:27:58
128
---
129
91cd70 David Marsh 2026-05-25 05:30:40
130
## 7. Prefer incremental changes
50cead David Marsh 2026-05-05 03:27:58
131
74fcad David Marsh 2026-05-11 05:10:00
132
Avoid large speculative rewrites.
50cead David Marsh 2026-05-05 03:27:58
133
74fcad David Marsh 2026-05-11 05:10:00
134
Make:
135
- small changes
136
- verify behaviour
137
- review output
138
- continue iteratively
50cead David Marsh 2026-05-05 03:27:58
139
74fcad David Marsh 2026-05-11 05:10:00
140
Large unverified refactors are where AI tools fail hardest.
50cead David Marsh 2026-05-05 03:27:58
141
74fcad David Marsh 2026-05-11 05:10:00
142
---
143
91cd70 David Marsh 2026-05-25 05:30:40
144
## 8. Use test-driven development where practical
74fcad David Marsh 2026-05-11 05:10:00
145
146
Preferred workflow:
147
1. write failing test/check
148
2. confirm failure occurs for expected reason
149
3. implement fix
150
4. confirm passing result
151
5. refactor if needed
152
153
Do not generate tests and implementation simultaneously and call it TDD.
154
91cd70 David Marsh 2026-05-25 05:30:40
155
Tests should validate externally observable behaviour and known edge cases, not merely mirror the implementation.
156
74fcad David Marsh 2026-05-11 05:10:00
157
---
158
91cd70 David Marsh 2026-05-25 05:30:40
159
## 9. Treat mistakes as process failures
74fcad David Marsh 2026-05-11 05:10:00
160
161
When the AI makes a mistake:
162
1. fix the code
163
2. identify why the mistake happened
164
3. improve rules or design docs if needed
165
4. record lessons learned in the project journal
166
167
The goal is not merely fixing bugs.
168
169
The goal is improving the system that produced them.
170
171
---
172
91cd70 David Marsh 2026-05-25 05:30:40
173
## 10. Prefer simple, readable code
200307 David Marsh 2026-05-19 04:38:38
174
175
Write the simplest code that correctly solves the problem.
176
177
- Readable and explicit beats clever and compact.
178
- A future reader — or the same person at 3am — should understand the code without reverse-engineering it.
179
- If a solution surprised you when you wrote it, it will surprise the next reader too.
180
- Three clear lines beat one clever expression.
181
- Avoid unnecessary abstraction, indirection, and generality.
182
183
AI tools tend toward impressive-looking solutions. Push back on complexity that is not earned by the problem.
184
185
---
186
91cd70 David Marsh 2026-05-25 05:30:40
187
## 11. Track skills you personally develop in SKILLS_USED.md
eaf940 David Marsh 2026-05-22 08:31:17
188
189
AI tools can mask your own skill development if you are not deliberate about it.
190
91cd70 David Marsh 2026-05-25 05:30:40
191
Maintain a private `SKILLS_USED.md` file alongside the project. Add concise dated entries for:
192
- skills you actively built — things you understood, debugged, designed, or decided yourself
193
- investigations, debugging work, and tests you drove
194
- decisions you made and why they mattered
195
- outcomes that could later become resume bullets
196
197
A task where the AI generated code and you approved it is not the same as a skill you hold. Be honest about the distinction.
eaf940 David Marsh 2026-05-22 08:31:17
198
199
This record is useful for:
200
- resume and portfolio evidence
201
- performance reviews
91cd70 David Marsh 2026-05-25 05:30:40
202
- understanding what you can credibly explain and defend in an interview
eaf940 David Marsh 2026-05-22 08:31:17
203
91cd70 David Marsh 2026-05-25 05:30:40
204
Do not commit or expose this file if it is intended as private.
eaf940 David Marsh 2026-05-22 08:31:17
205
91cd70 David Marsh 2026-05-25 05:30:40
206
---
207
208
## 12. Instruction precedence
209
210
When instructions conflict, use this priority order:
211
212
1. Explicit user request in current session
213
2. Security and safety constraints
214
3. Architecture and design documents
215
4. Project rules (`CLAUDE.md`)
216
5. Inline code comments and local conventions
217
6. TODO items and journals
218
7. Historical decisions recorded in memory files
219
220
If conflicts remain unresolved:
221
- stop
222
- explain the conflict
223
- ask for clarification
224
225
---
226
227
## 13. Understand before modifying
228
229
Before changing code:
230
- identify the relevant subsystem
231
- read surrounding code
232
- identify invariants and conventions
233
- check whether similar patterns already exist elsewhere in the project
234
- understand why the current implementation exists
235
236
Do not immediately rewrite unfamiliar code.
237
238
Matching established project patterns is usually more important than introducing a theoretically cleaner abstraction.
239
240
---
241
242
## 14. Prefer modifying existing systems over introducing parallel ones
243
244
Before creating new abstractions, helpers, wrappers, services, or utilities:
245
- check whether equivalent functionality already exists
246
- extend existing systems where reasonable
247
- avoid creating duplicate patterns
248
249
AI tools frequently introduce redundant abstractions because local generation optimises for immediate completion rather than long-term maintainability.
eaf940 David Marsh 2026-05-22 08:31:17
250
251
---
252
91cd70 David Marsh 2026-05-25 05:30:40
253
## 15. Stop and ask when
e7f76e David Marsh 2026-05-24 06:17:25
254
91cd70 David Marsh 2026-05-25 05:30:40
255
Pause and request clarification if:
256
- requirements conflict
257
- the change may cause data loss
258
- behaviour is ambiguous
259
- security implications are unclear
260
- architectural intent cannot be inferred confidently
261
- multiple reasonable implementations exist with materially different tradeoffs
262
263
---
264
265
## 16. Optimise for maintainability over speed
266
267
AI should optimise for:
268
- maintainability
269
- correctness
270
- clarity
271
272
over speed of completion.
273
274
A slower correct change is preferable to a fast unstable one.
e7f76e David Marsh 2026-05-24 06:17:25
275
276
---
277
74fcad David Marsh 2026-05-11 05:10:00
278
# Recommended AI Behaviour Rules
279
280
## General behaviour
281
282
Be direct, technically honest, and precise.
283
284
- Say when something is wrong.
285
- Explain why an approach is risky or poorly designed.
286
- Push back on questionable changes before implementing them.
287
- Distinguish facts from assumptions.
288
- Explain tradeoffs instead of presenting guesses as certainty.
289
- Prefer correctness over agreement.
290
291
Avoid:
292
- flattery
91cd70 David Marsh 2026-05-25 05:30:40
293
- validation phrases
74fcad David Marsh 2026-05-11 05:10:00
294
- pretending confidence where uncertainty exists
295
9c95d2 David Marsh 2026-05-18 08:31:22
296
A thirty-second argument before implementing is better than chasing a bad change afterward.
297
74fcad David Marsh 2026-05-11 05:10:00
298
If uncertain:
299
- state the uncertainty
300
- explain what information is missing
301
- suggest ways to verify
302
303
---
304
305
## Working with code
306
307
Preserve intentional diagnostics and documentation.
308
309
- Keep existing comments, debug output, and logging unless removal is explicitly requested.
9c95d2 David Marsh 2026-05-18 08:31:22
310
- Improve comments and logging when useful, but explain what changed and why.
311
- If a comment, log line, or debug statement should be removed, say so and let the author decide.
74fcad David Marsh 2026-05-11 05:10:00
312
- Avoid speculative refactors unrelated to the task.
313
- Prefer minimal, reviewable diffs.
91cd70 David Marsh 2026-05-25 05:30:40
314
- Write the simplest code that solves the problem.
315
- Avoid clever solutions when a straightforward one exists.
316
- When generating code, avoid reproducing verbatim patterns from known licensed sources.
317
- In commercial contexts, flag when a generated implementation closely resembles a specific known library or project.
318
319
Do not silently fix unrelated issues encountered during a task.
320
321
Record them separately if relevant, but keep task scope controlled unless expansion is explicitly approved.
74fcad David Marsh 2026-05-11 05:10:00
322
323
Before making architectural changes:
324
- explain the reasoning
325
- explain tradeoffs
326
- identify risks
327
- confirm assumptions against existing design docs
328
91cd70 David Marsh 2026-05-25 05:30:40
329
---
330
331
## Verify external APIs and libraries
332
333
Do not assume:
334
- APIs exist
335
- methods exist
336
- configuration options are valid
337
- package names are correct
338
- examples found in memory are current
339
340
Verify against:
341
- official documentation
342
- existing project usage
343
- installed package versions
344
- actual runtime behaviour
345
346
Plausible-looking code is not evidence of correctness.
347
348
---
349
350
## Generated files
9c95d2 David Marsh 2026-05-18 08:31:22
351
352
If any files are generated artefacts — from templates, build pipelines, or code generators — document this prominently.
353
354
- Do not edit generated files directly.
355
- Fixes belong in the template source, not the generated output.
356
- The AI will edit whatever file it can find unless explicitly told otherwise.
357
91cd70 David Marsh 2026-05-25 05:30:40
358
Document which files are generated and what produces them in `CLAUDE.md` or equivalent.
9c95d2 David Marsh 2026-05-18 08:31:22
359
74fcad David Marsh 2026-05-11 05:10:00
360
---
361
1cd1e0 David Marsh 2026-05-19 09:43:34
362
## Sensitive data in AI sessions
363
91cd70 David Marsh 2026-05-25 05:30:40
364
AI tools are third-party services. Anything pasted into a session may be:
365
- logged
366
- retained
367
- used for training
1cd1e0 David Marsh 2026-05-19 09:43:34
368
369
Before pasting any content into an AI session:
91cd70 David Marsh 2026-05-25 05:30:40
370
- replace real account names, hostnames, IPs, and usernames with placeholders
371
- never paste credential files, API keys, tokens, or secrets
372
- sanitise log output and API responses before using them as examples
373
- treat session contents as if they could be read by anyone
1cd1e0 David Marsh 2026-05-19 09:43:34
374
91cd70 David Marsh 2026-05-25 05:30:40
375
If a session needs to work with output that contains sensitive data:
376
- describe the structure rather than pasting the content directly
1cd1e0 David Marsh 2026-05-19 09:43:34
377
91cd70 David Marsh 2026-05-25 05:30:40
378
Document sanitisation conventions for the project so the same placeholders are used consistently across examples, issues, and docs.
1cd1e0 David Marsh 2026-05-19 09:43:34
379
380
---
381
74fcad David Marsh 2026-05-11 05:10:00
382
## Verification and testing
383
384
After each meaningful change:
385
- run tests
386
- run linters/checks where available
387
- verify expected behaviour
388
- report failures clearly
389
91cd70 David Marsh 2026-05-25 05:30:40
390
AI tools will confidently cite library methods, function signatures, and config options that do not exist.
391
392
Running the code is what catches this.
393
394
Static review alone is not sufficient, because a hallucinated method name is syntactically indistinguishable from a real one.
200307 David Marsh 2026-05-19 04:38:38
395
74fcad David Marsh 2026-05-11 05:10:00
396
Do not claim something works without verification.
397
398
If verification cannot be performed:
399
- say so explicitly
400
- explain what remains unverified
401
402
---
403
1cd1e0 David Marsh 2026-05-19 09:43:34
404
## Security review of AI-generated code
405
91cd70 David Marsh 2026-05-25 05:30:40
406
AI tools introduce security vulnerabilities.
407
408
Generated code is syntactically plausible but may contain:
1cd1e0 David Marsh 2026-05-19 09:43:34
409
- hardcoded credentials or secrets
410
- command injection via string concatenation
411
- missing input validation at system boundaries
412
- insecure defaults
413
- invented or malicious package suggestions
414
91cd70 David Marsh 2026-05-25 05:30:40
415
Review all AI-generated code for these issues before accepting it.
1cd1e0 David Marsh 2026-05-19 09:43:34
416
91cd70 David Marsh 2026-05-25 05:30:40
417
Tests passing is not a proxy for security.
418
419
Tests verify behaviour, not safety.
420
421
When AI suggests adding a new package or dependency:
422
- verify it exists
423
- verify it is actively maintained
424
- verify it has no known CVEs before adding it
1cd1e0 David Marsh 2026-05-19 09:43:34
425
426
### Ongoing reviews
427
91cd70 David Marsh 2026-05-25 05:30:40
428
A single review at generation time is not sufficient.
429
430
AI-contributed code accumulates, and issues missed initially may only surface in combination with later changes.
1cd1e0 David Marsh 2026-05-19 09:43:34
431
91cd70 David Marsh 2026-05-25 05:30:40
432
Review AI-contributed code regularly — at minimum:
433
- when a significant feature completes
434
- when dependencies are updated
1cd1e0 David Marsh 2026-05-19 09:43:34
435
91cd70 David Marsh 2026-05-25 05:30:40
436
Review for:
437
- security patterns listed above
438
- accidentally committed credentials or sensitive data
439
- unnecessary or unsafe dependencies added on AI suggestion
440
441
Record each review in the project journal:
442
- what was checked
443
- what was found
444
- what was fixed
1cd1e0 David Marsh 2026-05-19 09:43:34
445
446
---
447
9c95d2 David Marsh 2026-05-18 08:31:22
448
## Scope of authorisation
449
450
Approving one action does not authorise the same action in a different context.
451
452
Confirm risky or irreversible operations explicitly each time:
453
- pushing to a remote
454
- dropping or overwriting data
455
- force operations
456
- modifying shared infrastructure
457
91cd70 David Marsh 2026-05-25 05:30:40
458
When suggesting a shell command for the user to run:
459
- explain what it does before they run it
460
- flag anything destructive or hard to reverse
1cd1e0 David Marsh 2026-05-19 09:43:34
461
91cd70 David Marsh 2026-05-25 05:30:40
462
Unless standing permission is recorded in a durable config file that both the human and AI can read, do not assume prior approval carries forward.
9c95d2 David Marsh 2026-05-18 08:31:22
463
464
---
465
74fcad David Marsh 2026-05-11 05:10:00
466
## Project journal workflow
467
468
Maintain a `journal.md` containing:
469
- recent work
470
- parked ideas
471
- open questions
472
- lessons learned
473
474
Update it whenever:
475
- significant work completes
476
- mistakes reveal missing rules
477
- architectural decisions change
478
- work is deferred
479
480
The journal is operational memory, not a changelog.
481
91cd70 David Marsh 2026-05-25 05:30:40
482
Summarise:
483
- why decisions were made
484
- what alternatives were rejected
485
- what uncertainties remain
486
- what future work was intentionally deferred
487
488
Do not record every tiny edit.
74fcad David Marsh 2026-05-11 05:10:00
489
490
---
491
9c95d2 David Marsh 2026-05-18 08:31:22
492
## Session startup
493
494
At the start of each session:
495
1. Read the journal.
496
2. Check parked ideas and open questions.
497
3. Note current project state before asking or being asked what to work on.
498
91cd70 David Marsh 2026-05-25 05:30:40
499
Do not rely on the AI to remember previous sessions.
500
501
Assume a cold start every time and let the files provide continuity.
9c95d2 David Marsh 2026-05-18 08:31:22
502
503
---
504
91cd70 David Marsh 2026-05-25 05:30:40
505
# Recommended project structure
74fcad David Marsh 2026-05-11 05:10:00
506
507
```text
508
project/
509
├── CLAUDE.md
91cd70 David Marsh 2026-05-25 05:30:40
510
├── SKILLS_USED.md
74fcad David Marsh 2026-05-11 05:10:00
511
├── journal.md
9c95d2 David Marsh 2026-05-18 08:31:22
512
├── memory/
513
│ ├── user.md
514
│ ├── feedback.md
515
│ ├── project.md
516
│ └── references.md
74fcad David Marsh 2026-05-11 05:10:00
517
├── docs/
518
│ ├── architecture.md
519
│ ├── design.md
520
│ ├── workflows.md
91cd70 David Marsh 2026-05-25 05:30:40
521
│ ├── coding-standards.md
522
│ ├── ai-workflow.md
523
│ ├── ai-rules.md
524
│ ├── ai-security.md
525
│ └── project-memory.md
74fcad David Marsh 2026-05-11 05:10:00
526
├── todo.md
527
└── src/
50cead David Marsh 2026-05-05 03:27:58
528
```
529
74fcad David Marsh 2026-05-11 05:10:00
530
---
531
91cd70 David Marsh 2026-05-25 05:30:40
532
# Short operational prompt
74fcad David Marsh 2026-05-11 05:10:00
533
534
Once the project is structured properly, prompts can stay extremely small:
535
536
```text
537
Read the project docs and journal.
538
Complete the highest priority TODO item.
539
Use TDD.
540
Update journal.md if new lessons or decisions emerge.
541
```
50cead David Marsh 2026-05-05 03:27:58
542
74fcad David Marsh 2026-05-11 05:10:00
543
Most people are still trying to "prompt engineer" around missing project structure.
50cead David Marsh 2026-05-05 03:27:58
544
74fcad David Marsh 2026-05-11 05:10:00
545
The structure matters far more than clever prompts.