
This system ensures that your code doesn't just "work," but improves in readability and structure with every iteration.
### SYSTEM: The Code Consistency Architect
**End Goal:** A Python CLI tool that analyzes a local repository and outputs a 'Consistency Scorecard' based on documentation coverage, function length, and PEP8 compliance.
**Step 1: The Success State (The Output)**
The final output is a `quality_audit.md` containing:
- A clear list of functions exceeding 20 lines.
- A percentage score for docstring coverage.
- Three specific suggestions for improving code modularity.
**Step 2: The Rewind (Dependencies)**
To reach this, the script must:
- Use the `ast` module to walk the tree.
- Scan for `#` and `"""` patterns for documentation.
- Implement a logic gate that compares findings against 'Clean Code' standards.
**Step 3: Logic Construction**
- Build the `ScorecardGenerator` first (The Goal).
- Build the `CodeParser` second (The Engine).
- Build the `CLI_Interface` last (The Input).
**The Consistency Prompt:**
"I am building a tool for long-term code improvement. The final report must look like [Report Structure].
Working backwards, what are the logic requirements to ensure this report is accurate and repeatable?
Generate the script starting from the report generation logic."
This isn't about a "launch"; it's about the discipline of finishing what you start. Use this to turn a "side project" into a completed asset.
### TEMPLATE: The 30-Day Completion Framework
**Day 30 Success State:** A fully functional, documented, and deployed minimal project that solves [Problem].
**The Reverse Milestones:**
- **Week 4 (The Polish):** Final bug-fix pass and 'README' documentation completion.
- **Week 3 (The Integration):** Connecting the internal logic to the user interface.
- **Week 2 (The Core Build):** Completing the primary function—no feature creep allowed.
- **Week 1 (The Foundation):** Environment setup and core logic architecture.
**Execution Prompt:**
"Act as a Project Manager focused on completion. The goal is a finished project in 30 days.
Reason backwards from the 'Finished State' on Day 30.
What are the non-negotiable weekly milestones required to reach that end without distraction or scope creep?"
Improve your communication by ensuring your voice stays consistent from the first word to the last.
### WORKFLOW: The Narrative Anchor
**The Outcome:** A 1,000-word article where the tone, logic, and conclusion are perfectly aligned with a central 'Deep Insight.'
**Step-by-Step Breakdown:**
1. **The Synthesis (The End):** Write the final paragraph first. What do you want the reader to feel or do?
2. **The Pivot (The Middle):** What is the one reframe that makes that conclusion inevitable?
3. **The Proof (The Support):** What data or logic supports that reframe?
4. **The Hook (The Start):** What opening sentence leads naturally to that proof?
**Implementation Guide:**
- Provide the AI with your final conclusion.
- Ask: 'Given this conclusion, work backwards to identify the three logical pillars required to make this argument consistent and undeniable.
- Then, draft the full piece starting with those pillars.'
Consistency fails when edge cases aren't considered. Here is how to maintain your standards when things get messy.
### GUIDE: The System Stress-Test
**Refining the Loop:**
- **The Gap Analysis:** Ask the AI, 'I have the start and the end. What is the one step in the middle that usually breaks down due to lack of focus or technical error?'
- **The Optimization Pass:** 'Rewrite this backward-engineered plan to include a "Recovery Step" for every milestone if a deadline is missed.'
**Key Insight:** Backward chaining creates a 'Logic Net.' Even if you fail a specific task, the overall structure of the end goal remains intact, allowing you to pivot without losing momentum.
Improvement is not a mystery; it is the result of a system that refuses to drift. By defining the "Success State" before you take your first step, you turn the AI into a partner in precision. You have been provided with: