Blame
|
1 | # AI-Assisted Development Workflow |
||||||
|
2 | |||||||
|
3 | AI tools are useful, but only when treated like fast junior engineers with unlimited energy and limited judgement. |
||||||
|
4 | |||||||
|
5 | The quality of the output depends heavily on: |
||||||
| 6 | - project documentation |
|||||||
| 7 | - clear rules |
|||||||
| 8 | - tight feedback loops |
|||||||
|
9 | - narrowly scoped tasks |
||||||
|
10 | - verification at every step |
||||||
|
11 | |||||||
|
12 | # Core principles |
||||||
|
13 | |||||||
|
14 | ## Keep project knowledge in files |
||||||
|
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. |
|||||||
|
29 | |||||||
|
30 | Treat project files as the authoritative long-term memory of the project. Conversations are temporary working context only. |
||||||
|
31 | |||||||
|
32 | ## Structure memory by type |
||||||
|
33 | |||||||
| 34 | A single journal file conflates different kinds of information and becomes noise over time. |
|||||||
| 35 | ||||||||
| 36 | Separate memory by type: |
|||||||
| 37 | ||||||||
|
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. |
|||||||
|
42 | |||||||
|
43 | Keep these in separate files. Load only what is relevant to the current task or session. |
||||||
|
44 | |||||||
|
45 | Secrets and credentials should never be stored in AI-readable project memory. |
||||||
| 46 | ||||||||
|
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 |
|||||||
|
68 | |||||||
|
69 | A shorter file is not an improvement if it loses knowledge. |
||||||
| 70 | ||||||||
| 71 | ## Describe desired behaviour positively |
|||||||
|
72 | |||||||
|
73 | Write rules describing how work should be done rather than only listing forbidden behaviour. |
||||||
|
74 | |||||||
|
75 | Good: |
||||||
| 76 | - "Preserve existing debug logging unless explicitly asked to remove it." |
|||||||
| 77 | - "Implement changes incrementally and verify after each step." |
|||||||
|
78 | |||||||
|
79 | Bad: |
||||||
| 80 | - "Don't remove logs." |
|||||||
| 81 | - "Don't break things." |
|||||||
|
82 | |||||||
|
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. |
|||||||
|
91 | |||||||
|
92 | ## Separate design from implementation |
||||||
|
93 | |||||||
|
94 | Maintain design documents describing: |
||||||
| 95 | - architecture |
|||||||
| 96 | - intended workflows |
|||||||
| 97 | - module responsibilities |
|||||||
| 98 | - invariants |
|||||||
| 99 | - interfaces |
|||||||
| 100 | - constraints |
|||||||
|
101 | |||||||
|
102 | Then instruct the AI to implement the documented design. |
||||||
|
103 | |||||||
|
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 |
|||||||
|
108 | |||||||
|
109 | Do not keep patching prompts forever. |
||||||
|
110 | |||||||
|
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. |
|||||||
|
117 | |||||||
|
118 | ## Use minimal prompts |
||||||
|
119 | |||||||
|
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 |
|||||||
|
124 | |||||||
|
125 | Long conversational prompting usually causes drift, inconsistency, and stale assumptions. |
||||||
|
126 | |||||||
|
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: |
|||||||
|
130 | - "wrap it up" -> check for leaks, update changelog, update docs, commit, push, update journal |
||||||
|
131 | |||||||
| 132 | This is more reliable than re-stating the full sequence each time. |
|||||||
| 133 | ||||||||
|
134 | ## Use isolated sessions |
||||||
|
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 | ||||||||
|
143 | Long sessions accumulate stale assumptions, conflicting context, and behavioural drift. |
||||||
| 144 | ||||||||
| 145 | Keep sessions short and let project files carry continuity instead. |
|||||||
|
146 | |||||||
|
147 | Persistent project files should carry the long-term memory. |
||||||
|
148 | |||||||
|
149 | ## Prefer incremental changes |
||||||
|
150 | |||||||
|
151 | Avoid large speculative rewrites. |
||||||
|
152 | |||||||
|
153 | Prefer: |
||||||
|
154 | - small changes |
||||||
|
155 | - explicit verification |
||||||
| 156 | - reviewable diffs |
|||||||
| 157 | - iterative progress |
|||||||
|
158 | |||||||
|
159 | Large unverified refactors are where AI tools fail hardest. |
||||||
|
160 | |||||||
|
161 | Small validated steps are easier to: |
||||||
| 162 | - review |
|||||||
| 163 | - revert |
|||||||
| 164 | - reason about |
|||||||
| 165 | - debug |
|||||||
| 166 | - attribute |
|||||||
|
167 | |||||||
|
168 | ## Use test-driven development where practical |
||||||
|
169 | |||||||
| 170 | Preferred workflow: |
|||||||
|
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 |
|||||||
|
175 | 5. refactor if needed |
||||||
| 176 | ||||||||
| 177 | Do not generate tests and implementation simultaneously and call it TDD. |
|||||||
| 178 | ||||||||
|
179 | Tests should validate externally observable behaviour and important edge cases, not merely mirror the implementation. |
||||||
|
180 | |||||||
|
181 | A weak test that only confirms the generated implementation behaves as written is not meaningful verification. |
||||||
|
182 | |||||||
|
183 | ## Treat mistakes as process failures |
||||||
|
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 |
|||||||
|
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 |
|||||||
|
192 | |||||||
| 193 | The goal is not merely fixing bugs. |
|||||||
| 194 | ||||||||
| 195 | The goal is improving the system that produced them. |
|||||||
| 196 | ||||||||
|
197 | Repeated classes of mistakes should result in stronger project rules, clearer documentation, or improved verification workflows. |
||||||
|
198 | |||||||
|
199 | ## Prefer simple, readable code |
||||||
|
200 | |||||||
| 201 | Write the simplest code that correctly solves the problem. |
|||||||
| 202 | ||||||||
| 203 | - Readable and explicit beats clever and compact. |
|||||||
|
204 | - A future reader - or the same person at 3am - should understand the code without reverse-engineering it. |
||||||
|
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 | ||||||||
|
211 | Prefer consistency with the existing codebase over introducing theoretically cleaner but unfamiliar patterns. |
||||||
|
212 | |||||||
|
213 | ## Track skills you personally develop in SKILLS_USED.md |
||||||
|
214 | |||||||
| 215 | AI tools can mask your own skill development if you are not deliberate about it. |
|||||||
| 216 | ||||||||
|
217 | Maintain a private `SKILLS_USED.md` file alongside the project. Add concise dated entries for: |
||||||
|
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 |
|||||||
|
222 | - decisions you made and why they mattered |
||||||
| 223 | - outcomes that could later become resume bullets |
|||||||
| 224 | ||||||||
|
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. |
||||||
|
226 | |||||||
| 227 | This record is useful for: |
|||||||
| 228 | - resume and portfolio evidence |
|||||||
| 229 | - performance reviews |
|||||||
|
230 | - understanding what you can credibly explain and defend in an interview |
||||||
|
231 | |||||||
|
232 | Do not commit or expose this file if it is intended as private. |
||||||
|
233 | |||||||
|
234 | ## Instruction precedence |
||||||
|
235 | |||||||
| 236 | When instructions conflict, use this priority order: |
|||||||
| 237 | ||||||||
|
238 | 1. Explicit user request in the current session |
||||||
|
239 | 2. Security and safety constraints |
||||||
| 240 | 3. Architecture and design documents |
|||||||
| 241 | 4. Project rules (`CLAUDE.md`) |
|||||||
|
242 | 5. Inline code comments and established local conventions |
||||||
|
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 | ||||||||
|
251 | Do not silently guess which instruction should win. |
||||||
|
252 | |||||||
|
253 | ## Understand before modifying |
||||||
|
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 | ||||||||
|
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. |
|||||||
|
274 | |||||||
|
275 | ## Prefer extending existing systems over introducing parallel ones |
||||||
|
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. |
|||||||
|
283 | |||||||
|
284 | Prefer consistency and reuse over novelty. |
||||||
|
285 | |||||||
|
286 | ## Stop and ask when |
||||||
|
287 | |||||||
|
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 | ||||||||
|
296 | Do not continue by guessing when uncertainty materially affects correctness, safety, or maintainability. |
||||||
|
297 | |||||||
|
298 | ## Optimise for maintainability over speed |
||||||
|
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. |
|||||||
|
308 | |||||||
|
309 | Code survives longer than prompts. Optimise for the future maintainer, not immediate completion. |
||||||
|
310 | |||||||
|
311 | # Recommended AI behaviour rules |
||||||
|
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 |
|||||||
|
326 | - validation phrases |
||||||
|
327 | - pretending confidence where uncertainty exists |
||||||
| 328 | ||||||||
|
329 | A thirty-second argument before implementing is better than chasing a bad change afterward. |
||||||
| 330 | ||||||||
|
331 | If uncertain: |
||||||
| 332 | - state the uncertainty |
|||||||
| 333 | - explain what information is missing |
|||||||
| 334 | - suggest ways to verify |
|||||||
| 335 | ||||||||
|
336 | Do not simulate certainty to maintain conversational flow. |
||||||
|
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. |
|||||||
|
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. |
|||||||
|
345 | - Avoid speculative refactors unrelated to the task. |
||||||
| 346 | - Prefer minimal, reviewable diffs. |
|||||||
|
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. |
|||||||
|
355 | |||||||
| 356 | Before making architectural changes: |
|||||||
| 357 | - explain the reasoning |
|||||||
| 358 | - explain tradeoffs |
|||||||
| 359 | - identify risks |
|||||||
| 360 | - confirm assumptions against existing design docs |
|||||||
| 361 | ||||||||
|
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. |
|||||||
|
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 | ||||||||
|
386 | AI-generated examples are often syntactically plausible but operationally wrong. |
||||||
|
387 | |||||||
| 388 | ## Generated files |
|||||||
|
389 | |||||||
|
390 | If any files are generated artefacts - from templates, build pipelines, or code generators - document this prominently. |
||||||
|
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 | ||||||||
|
396 | Document: |
||||||
| 397 | - which files are generated |
|||||||
| 398 | - what produces them |
|||||||
| 399 | - how regeneration occurs |
|||||||
|
400 | |||||||
|
401 | Record this in `CLAUDE.md` or equivalent project documentation. |
||||||
|
402 | |||||||
|
403 | ## Sensitive data in AI sessions |
||||||
| 404 | ||||||||
|
405 | AI tools are third-party services. Anything pasted into a session may be: |
||||||
| 406 | - logged |
|||||||
| 407 | - retained |
|||||||
| 408 | - used for training |
|||||||
|
409 | |||||||
| 410 | Before pasting any content into an AI session: |
|||||||
|
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 |
|||||||
|
415 | |||||||
|
416 | If a session needs to work with sensitive structures or outputs: |
||||||
|
417 | - describe the structure rather than pasting the content directly |
||||||
|
418 | |||||||
|
419 | Document sanitisation conventions for the project so the same placeholders are used consistently across: |
||||||
| 420 | - examples |
|||||||
| 421 | - issues |
|||||||
| 422 | - documentation |
|||||||
| 423 | - test fixtures |
|||||||
|
424 | |||||||
|
425 | ## Verification and testing |
||||||
| 426 | ||||||||
| 427 | After each meaningful change: |
|||||||
| 428 | - run tests |
|||||||
|
429 | - run linters and checks where available |
||||||
|
430 | - verify expected behaviour |
||||||
| 431 | - report failures clearly |
|||||||
| 432 | ||||||||
|
433 | AI tools will confidently cite: |
||||||
| 434 | - library methods |
|||||||
| 435 | - function signatures |
|||||||
| 436 | - config options |
|||||||
| 437 | ||||||||
| 438 | that do not exist. |
|||||||
|
439 | |||||||
| 440 | Running the code is what catches this. |
|||||||
| 441 | ||||||||
|
442 | Static review alone is insufficient, because a hallucinated method name is syntactically indistinguishable from a real one. |
||||||
|
443 | |||||||
|
444 | Do not claim something works without verification. |
||||||
| 445 | ||||||||
| 446 | If verification cannot be performed: |
|||||||
| 447 | - say so explicitly |
|||||||
| 448 | - explain what remains unverified |
|||||||
|
449 | - explain how it should be verified later |
||||||
|
450 | |||||||
|
451 | Verification should be treated as part of implementation, not an optional follow-up task. |
||||||
|
452 | |||||||
|
453 | ## Security review of AI-generated code |
||||||
| 454 | ||||||||
|
455 | AI tools introduce security vulnerabilities. |
||||||
| 456 | ||||||||
| 457 | Generated code is syntactically plausible but may contain: |
|||||||
|
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 | ||||||||
|
464 | Review all AI-generated code for these issues before accepting it. |
||||||
|
465 | |||||||
|
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 |
|||||||
|
474 | |||||||
| 475 | ### Ongoing reviews |
|||||||
| 476 | ||||||||
|
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. |
|||||||
|
480 | |||||||
|
481 | Review AI-contributed code regularly - at minimum: |
||||||
|
482 | - when a significant feature completes |
||||||
| 483 | - when dependencies are updated |
|||||||
|
484 | |||||||
|
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 |
|||||||
|
494 | |||||||
|
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 | ||||||||
|
505 | When suggesting a shell command for the user to run: |
||||||
| 506 | - explain what it does before they run it |
|||||||
|
507 | - flag anything destructive or difficult to reverse |
||||||
|
508 | |||||||
|
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. |
||||||
|
510 | |||||||
|
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 | ||||||||
|
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. |
|||||||
|
534 | |||||||
|
535 | A useful journal captures reasoning and operational context, not just actions taken. |
||||||
|
536 | |||||||
|
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 | ||||||||
|
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 | ||||||||
|
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. |
|||||||
|
573 | |||||||
|
574 | # Recommended project structure |
||||||
|
575 | |||||||
| 576 | ```text |
|||||||
| 577 | project/ |
|||||||
| 578 | ├── CLAUDE.md |
|||||||
|
579 | ├── SKILLS_USED.md |
||||||
|
580 | ├── journal.md |
||||||
|
581 | ├── memory/ |
||||||
| 582 | │ ├── user.md |
|||||||
| 583 | │ ├── feedback.md |
|||||||
| 584 | │ ├── project.md |
|||||||
| 585 | │ └── references.md |
|||||||
|
586 | ├── docs/ |
||||||
| 587 | │ ├── architecture.md |
|||||||
| 588 | │ ├── design.md |
|||||||
| 589 | │ ├── workflows.md |
|||||||
|
590 | │ ├── coding-standards.md |
||||||
| 591 | │ ├── ai-workflow.md |
|||||||
| 592 | │ ├── ai-rules.md |
|||||||
| 593 | │ ├── ai-security.md |
|||||||
| 594 | │ └── project-memory.md |
|||||||
|
595 | ├── todo.md |
||||||
| 596 | └── src/ |
|||||||
|
597 | ``` |
||||||
| 598 | ||||||||
|
599 | # Short operational prompt |
||||||
|
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. |
|||||||
|
606 | Use TDD where practical. |
||||||
| 607 | Update journal.md if new lessons, decisions, or operational knowledge emerge. |
|||||||
|
608 | ``` |
||||||
|
609 | |||||||
|
610 | Most failed AI-assisted development workflows are fundamentally documentation and process failures, not prompt failures. |
||||||
|
611 | |||||||
|
612 | The structure matters far more than clever prompts. |
||||||