source-command-extract-knowledge
Skill2 starsChanged 3 months agoApache-2.0View on GitHub
Extract reusable knowledge from this session into the project's knowledge system.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- dashboard-designSkill
- database-patternsSkill
- source-command-rearrange-commitsSkill
- testing-patternsSkill
- visual-auditSkill
- dashboard-designSkill
- database-patternsSkill
- design-tasteSkill
- issue-templateSkill
- testing-patternsSkill
- visual-auditSkill
- design-systemSkill
- issue-templateSkill
- testing-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user asks to run the migrated source command extract-knowledge.
- Distinctive: line 39
Run git diff and git diff --cached to see current changes.
- Distinctive: line 55
Read the target file
- Distinctive: line 56
Check for existing entries about the same topic
- Distinctive: line 57
Update existing entries rather than adding duplicates
- Distinctive: line 58
Remove entries that are now outdated or wrong
- Distinctive: line 63
Follow the existing structure and formatting of the target file.
- Very specific: line 71
Follow the two-step process: write topic file, then update MEMORY.md index
- Distinctive: line 72
Only for genuinely new user preferences or workflow changes
- Very specific: line 80
If a pattern has matured from agent-memory into a stable convention, promote it to the appropriate .Codex/rules/*.md file and remove the …
- Very specific: line 100
Broader assessment: Run /agent-readiness to evaluate the full knowledge system
- Distinctive: line 104
Only save confirmed, stable patterns: not one-off debugging notes
- Distinctive: line 105
Update existing entries when the pattern evolved
- Distinctive: line 106
Keep entries actionable: someone reading them should know exactly what to do
- Distinctive: line 107
No session-specific context (task details, in-progress work)
- Distinctive: line 109
NEVER use emojis in any output
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
source-command-extract-knowledge
Use this skill when the user asks to run the migrated source command extract-knowledge.
Command Template
Extract Knowledge
Review this session's work and extract reusable knowledge into the project's knowledge system.
Knowledge Architecture
This project uses a four-tier knowledge system:
Tier 0: ~/.Codex/shared-knowledge/ (cross-project patterns)
Reusable patterns that apply across multiple repositories. Loaded by agent startup scripts.
Tier 1: .Codex/rules/*.md (canonical, always loaded via AGENTS.md)
Stable patterns loaded into every session via AGENTS.md. Primary destination for confirmed conventions.
Tier 2: .Codex/agent-memory/ (agent learnings, loaded by morning agent)
Lessons learned from development and review cycles. Destination for agent-specific patterns that improve autonomous development quality.
MEMORY.md: Index filecookbook.md: Topical knowledge by domain, common mistakes with occurrence counts
Tier 3: User auto-memory (~/.Codex/projects/.../memory/)
User preferences, workflow conventions, and project state.
Steps
1. Identify What Changed
Run git diff and git diff --cached to see current changes. Also review the conversation for patterns, gotchas, decisions, and fixes that came up during the session.
2. Categorize Findings
For each finding, determine the right destination:
| Finding type | Destination |
| Domain-specific patterns (security, performance, etc.) | .Codex/rules/<domain>.md |
| ORM/framework gotchas, review lessons, recurring mistakes | .Codex/agent-memory/cookbook.md (under matching domain section) |
| Agent workflow or project pattern changes | .Codex/agent-memory/MEMORY.md |
| User preferences, workflow, collaboration style | User auto-memory |
3. Check for Duplicates
Before writing anything:
- Read the target file
- Check for existing entries about the same topic
- Update existing entries rather than adding duplicates
- Remove entries that are now outdated or wrong
4. Write Knowledge
For .Codex/rules/*.md (Tier 1):
- Follow the existing structure and formatting of the target file. Write concise entries with bold labels, then the lesson. These are always loaded: keep entries actionable and specific to this project.
For .Codex/agent-memory/ (Tier 2):
- One line per pattern: bold label, then the lesson
- Include the "why": not just what to do, but why it matters
- Include file paths when relevant
For user auto-memory (Tier 3):
- Follow the two-step process: write topic file, then update
MEMORY.mdindex - Only for genuinely new user preferences or workflow changes
5. Verify Sizes
Agent memory files should stay concise:
MEMORY.md: under 20 lines (index only)cookbook.md: under 200 lines (prune oldest[confirmed: 0]entries if needed)
If a pattern has matured from agent-memory into a stable convention, promote it to the appropriate .Codex/rules/*.md file and remove the agent-memory entry.
6. Summary
List what was extracted and where it was saved. Flag any patterns promoted from Tier 2 to Tier 1.
What to Look For
- Bugs fixed: root cause, how to avoid next time
- Performance issues: the pattern used to fix them
- Permission/auth issues: framework quirks, permission patterns
- Migration gotchas: schema vs data, deployment considerations
- ORM/framework patterns: query tricks, validation edge cases
- Test patterns: new fixtures, assertion techniques, edge case coverage
- Review feedback: what reviewers flagged and why
- Recurring mistakes: same issue appearing in multiple sessions
Cross-References
- Called by:
/review(Step 9) and/after-merge(post-merge learning) - Broader assessment: Run
/agent-readinessto evaluate the full knowledge system
Rules
- Only save confirmed, stable patterns: not one-off debugging notes
- Update existing entries when the pattern evolved
- Keep entries actionable: someone reading them should know exactly what to do
- No session-specific context (task details, in-progress work)
- Promote mature patterns from agent-memory to
.Codex/rules/*.md - NEVER use emojis in any output
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

