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