Thinky Face is your prompt library, finally organized. Unlimited prompt storage, full version control, fork other users' prompts, public & private sharing, MCP server, teams, and much more. Learn more.
No credit card required
Description
This prompt is self-contained—drop it into Claude Code or Cursor in any repo and it should produce useful output.
compound_engineering.md
Compound Learning System Setup
You are initializing a compound learning system for this repository. This system captures learnings from development work so future AI agents and developers benefit from accumulated knowledge.
Your Task
Analyze this repository and create the initial knowledge base files by mining git history, code patterns, and existing documentation.
Step 1: Analyze the Repository
Run these commands and analyze the output:
```bash
Identify default branch
git symbolic-ref refs/remotes/origin/HEAD | sed 's@refs/remotes/origin/@@'
Recent commit history with messages
git log --oneline -100
Files changed most frequently (hotspots)
git log --pretty=format: --name-only | sort | uniq -c | sort -rn | head -30
Recent commit messages with more detail
git log --pretty=format:"%h %s%n%b" -50
Look for existing documentation
find . -name "README" -o -name ".md" | head -20
Understand directory structure
find . -type d -not -path "/node_modules/" -not -path "/.git/" | head -50
```
Step 2: Create Root CLAUDE.md
Create /CLAUDE.md at repository root with this structure:
```markdown
[Repository Name]
Purpose
[One paragraph: what this repo does, its role in the larger system]
Workflow Requirements
All changes follow this process:
1. Create a branch from [default branch] (never commit directly)
2. Make changes on the feature branch
3. Open a pull request for review
4. Squash and merge when approved
5. Delete the feature branch after merge
Branch naming: [type]/[brief-description] (e.g., feat/add-staking, fix/gas-estimation)
Before Making Changes
- Check /progress.txt for recent learnings
- Look for AGENTS.md in directories you're modifying
- After completing work, update relevant AGENTS.md if you learned something reusable
Architecture Overview
[Key directories and their purposes, main entry points, data flow]
Tech Stack
[Languages, frameworks, key dependencies]
Quality Checks
[Commands that must pass before committing - typecheck, lint, test, etc.]
Common Commands
[Build, test, deploy, dev server commands]
Critical Areas
[Parts of the codebase that require extra care - security sensitive, complex logic, etc.]
```
Populate each section based on your analysis. Be specific and actionable. Replace [default branch] with the actual default branch name (main, master, develop, etc.).
Step 3: Create progress.txt
Create /progress.txt with this initial entry:
```markdown
Progress Log
Append-only log of learnings from each development session.
Reusable patterns get promoted to relevant AGENTS.md files.
[Today's Date] - Compound Learning System Initialized
Initial setup of knowledge capture system.
Findings from git history analysis:
- [List 3-5 notable patterns or decisions visible in commit history]
- [Any recurring issues or fixes you noticed]
- [Architectural decisions implied by the code structure]
Hotspot directories (most frequently modified):
- [List top 3-5 directories with brief note on what they contain]
```
Step 4: Create Directory-Level AGENTS.md Files
For each major directory (especially hotspots), create an AGENTS.md file:
```markdown
[Directory/Module Name]
Purpose
[What this module does]
Patterns
[Conventions used in this directory - naming, structure, common approaches]
- Pattern: description
Gotchas
[Things that have caused issues or aren't obvious]
- [Gotcha description]
Key Files
filename.ts- [what it does]
Dependencies
[What this module depends on, what depends on it]
```
Create AGENTS.md for:
- Top 3-5 most-modified directories (from git analysis)
- Any directory with complex logic
- Any directory mentioned in existing documentation as important
Step 5: Mining Git History for Learnings
Look for these signals in commit history:
Bug fixes (commits with "fix", "bug", "issue", "revert"):
- What broke? Why? → Candidate for Gotchas section
Refactors (commits with "refactor", "cleanup", "reorganize"):
- What pattern emerged? → Candidate for Patterns section
Repeated changes to same files:
- Why do these keep changing? → May indicate unclear patterns or tech debt
Commit messages mentioning "don't", "always", "never", "must":
- These often encode hard-won lessons
Extract 5-10 concrete learnings and distribute them to appropriate AGENTS.md files.
Step 6: Commit Your Changes
Follow the workflow requirements:
```bash
Ensure you're on the default branch and up to date
git checkout [default-branch]
git pull
Create a branch for this setup
git checkout -b chore/compound-learning-setup
Add the new files
git add CLAUDE.md progress.txt
git add "**/AGENTS.md"
Commit
git commit -m "chore: initialize compound learning system
- Add CLAUDE.md with repo context and workflow requirements
- Add progress.txt for session learnings
- Add AGENTS.md files for key directories
- Extracted initial learnings from git history"
Push and create PR
git push -u origin chore/compound-learning-setup
```
Then open a pull request. When approved, squash and merge.
Output
After completing setup, provide a summary:
- Files created (with paths)
- Key learnings extracted from history
- Recommendations for high-value areas to document further
- Any gaps noticed (missing tests, unclear architecture, etc.)
- Branch name and instructions for creating the PR
Quality Criteria
- CLAUDE.md should let a new developer understand the repo in 2 minutes
- CLAUDE.md must include the workflow requirements section with correct default branch
- AGENTS.md files should prevent repeating past mistakes
- progress.txt should be ready for the next session to append to
- All content should be specific to THIS repo, not generic boilerplate
- Changes must be on a feature branch, ready for PR
Comments
Press Enter to post
No comments yet. Be the first to comment.