Stop Letting AI Write Code Blindly: 5S+6A Method Boosts Efficiency by 90%

The article presents a step‑by‑step 5S documentation standard and 6A workflow that turn AI from a careless code generator into a reliable assistant, cutting bug‑fix time dramatically and delivering up to a 90% efficiency gain in small‑to‑medium projects.

Xiaolong Cloud Tech Team
Xiaolong Cloud Tech Team
Xiaolong Cloud Tech Team
Stop Letting AI Write Code Blindly: 5S+6A Method Boosts Efficiency by 90%

1. Understand: AI coding vs. traditional coding – the missing piece is documentation

When developers first let AI write a "fresh order API" without any docs, the model added three useless parameters and mis‑described the out‑of‑stock message, costing two hours to locate the bug. The author realized the problem is not AI’s ability but the lack of clear rules.

AI should be treated as a rule‑following assistant, not a free‑wheeling writer. Traditional coding writes code first then adds docs; AI‑assisted coding must reverse the order: write the docs first, then let AI follow the documented process.

For an order‑placement feature the author creates three core documents:

《说明文档.md》 – project overview, requirements, timeline, e.g., "Fresh‑food e‑commerce order system, supports WeChat Pay, auto‑cancel after 10 minutes".

《设计文档.md》 – flowchart of "order → inventory deduction → order creation".

《接口文档.md》 – request parameters (user_id, goods_id) and error code ERROR_001 for insufficient stock.

Updating a single field in the docs (e.g., changing cancel timeout from 10 min to 15 min) lets AI modify the code precisely without repeated manual corrections.

2. 5S Documentation Standard – five essential "specs" that keep AI on track

Many think docs waste time, but in AI‑assisted development they are the commands. The five documents are:

1. 《说明文档.md》 – the project notebook

Project overview: name, scope, tech stack (Python + Django), deadline.

Requirement alignment using 5W1H (Who, What, When, Where, Why, How).

Progress record – fill after each code change.

Pitfall log – e.g., "different time formats caused order‑time mismatch; switched to UTC".

Future plan – upcoming features (coupons) and risks (peak‑time latency).

2. 《接口文档.md》 – the front‑back‑AI communication protocol

Base URL: /api/v1/, token authentication, JSON response.

Endpoint list: e.g., POST /order/create for order creation, login‑only.

Details: user_id numeric required, success returns order_id, insufficient stock returns ERROR_001.

AI can generate the initial draft of this doc from the design doc; the developer only verifies parameter names and error codes.

3. 《设计文档.md》 – the architectural blueprint

Architecture diagram drawn with Mermaid, e.g., "User → Mini‑program → API layer → Service layer → DB".

Module design: Order module with class OrderService containing createOrder and cancelOrder.

Database schema: order table with order_id, user_id, create_time; index on user_id.

AI can validate the architecture against existing systems and auto‑complete missing tables.

4. 《TASK_XX.md》 – atomizing large features into AI‑manageable tasks

Large features are split into tasks no longer than 20 lines of code and 2 hours of work. Example for the order feature:

Write parameter‑validation function (check user_id and goods_id).

Implement inventory‑deduction logic (call inventory service, return success).

Write order‑creation logic (persist data).

Each task includes an acceptance criterion, e.g., "missing parameters return ERROR_003".

5. 《验收文档.md》 – testing and acceptance records

Test case example: missing goods_id → input user_id=123 → expect ERROR_003.

Results: 10 cases, 8 passed, 2 failed (e.g., coupon‑expiry warning missing).

Conclusion: "Not passed, need to fix coupon‑prompt logic".

AI can auto‑generate test code and report coverage; if coverage < 80 % it prompts to add cases.

3. 6A Process – six stages that keep the project on track

1. Align – turn vague requirements into undisputed consensus

Use 5W1H to clarify details, record answers in the "Requirement Alignment" section of 《说明文档.md》.

AI highlights missing points, e.g., "should inventory be restored after cancellation?".

2. Architect – design a robust architecture before coding

Select tech stack (e.g., Django because the team knows it, Redis for cart).

Create architecture diagram and 《设计文档.md》.

AI validates scalability (e.g., 100 concurrent orders) and suggests exception handling.

3. Atomize – break work into AI‑friendly micro‑tasks

Each task ≤ 20 lines, ≤ 2 hours; generate 《TASK_XX.md》 with dependencies.

AI warns about missing dependencies or vague acceptance standards.

4. Approve – review tasks before implementation

Check coverage of requirements, testability of acceptance criteria, and reasonable dependencies.

AI flags vague standards like "works well" and asks for concrete metrics (e.g., response ≤ 1 s).

5. Automate – AI writes code and tests under defined rules

AI follows PEP8 naming conventions when generating code from 《TASK_XX.md》.

AI auto‑generates and runs test cases, then updates progress in 《说明文档.md》 and results in 《验收文档.md》.

6. Assess – final quality check before release

Verify that all requirements are implemented, no redundant code, and docs match code.

Write project summary in 《说明文档.md》 (e.g., "8 hours spent, 2 hours faster than expected, pitfall: inconsistent time format").

Store all docs under docs/ for future reference.

AI generates a requirement‑match report, e.g., "90 % implemented, 10 % pending (coupon expiry prompt)".

4. Three Red Lines Not to Cross and One "Passcode"

Red line 1: Do not wait for a delay to act. AI produces a daily progress‑risk report and suggests immediate mitigation.

Red line 2: Never add ad‑hoc features without updating 《说明文档.md》 and the task list; otherwise code quality degrades.

Red line 3: All compile errors must be fixed with clear explanations, and test coverage must stay ≥ 80 %.

The "passcode" is the AI‑generated checklist at each stage: correct 5S format, completed prior work, sufficiently atomized tasks, and ≥ 80 % test coverage.

Conclusion

Using the 5S+6A framework does not mean writing endless docs; it means giving AI clear rules so that a one‑hour upfront documentation effort saves ten hours of bug‑fixing later. After a single trial, the author found AI transformed from a careless tool into a trustworthy assistant.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonAI codingDjangodocumentationsoftware process5S method6A workflow
Xiaolong Cloud Tech Team
Written by

Xiaolong Cloud Tech Team

Xiaolong Cloud Tech Team

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.