claw-code-tingfeng
CLAUDE.md4 starsChanged 7 months agoMITView on GitHub
Clawd Code is a comprehensive AI-powered coding agent framework written in Python. It provides multi-agent collaboration, self-healing, codebase awareness (World Model), enterprise-grade RAG, and a full workflow engine. GoalX Integration (v2026-04-13): - Durable Surfaces: 9 canonical surfaces (charter, obligation_model, control_state, coordination_state, assurance_plan, evidence_log, objective_contract, status_summary, freshness_state) - Budget Guard: Resource safety monitoring (PSI, RSS, Host pressure) + dynamic adjustment - Worktree Isolation: Git worktree-based parallel execution with explicit merge boundaries (keep/integrate) - Integration Engine: keep_session, keep_to_source, partial_adopt semantics - Intent…
- Reads credentials
In this repository69 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- accessibilitySkill
- frontend-designSkill
- python-background-jobsSkill
- python-executorSkill
- python-testing-patternsSkill
- seoSkill
- ai-slop-cleanerSkill
- analyzeSkill
- api-and-interface-designSkill
- ask-claudeSkill
- ask-geminiSkill
- autopilotSkill
- browser-testing-with-devtoolsSkill
- build-fixSkill
- cancelSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- configure-notificationsSkill
- context-engineeringSkill
- debugging-and-error-recoverySkill
- deep-interviewSkill
- deepsearchSkill
- deprecation-and-migrationSkill
- doctorSkill
- documentation-and-adrsSkill
- ecomodeSkill
- frontend-ui-engineeringSkill
- frontend-ui-uxSkill
- git-masterSkill
- git-workflow-and-versioningSkill
- helpSkill
- hudSkill
- idea-refineSkill
- incremental-implementationSkill
- intent_routerSkill
- keyword_registrySkill
- mode_stateSkill
- noteSkill
- omx-setupSkill
- performance-optimizationSkill
- pipeline_orchestratorSkill
- pipelineSkill
- planning-and-task-breakdownSkill
- planSkill
- ralph-initSkill
- ralph_loopSkill
- ralphSkill
- ralplanSkill
- reviewSkill
- security-and-hardeningSkill
- security-reviewSkill
- shipping-and-launchSkill
- skillSkill
- spec-driven-developmentSkill
- swarmSkill
- tddSkill
- The first 60 shown.
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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
- could be automatic: a setting could enforce it
- Very specific: line 131
Test files mirror source structure: tests/<module>/
- Distinctive: line 138
Every skill has: Overview, When to Use, Process, Common Rationalizations, Red Flags, Verification
- Distinctive: line 184
Always: Run tests after code changes
- Distinctive: line 185
Always: Follow the existing code patterns and architecture
- Distinctive: line 186
Always: Use the patch engine for declarative code modifications
- Distinctive: line 187
Never: Commit secrets or API keys
- Very specific: line 188
Never: Modify .env files with real credentials
- Very specific: line 189
Never: Skip error handling — use the structured error codes from src/core/exceptions.py
- Very specific: line 190
Never: Add dependencies without updating requirements.txt and pyproject.toml
- Distinctive: line 206
Create distinctive, production-grade frontend interfaces with high design quality.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
Clawd Code — AI Programming Agent Framework
Project Overview
Clawd Code is a comprehensive AI-powered coding agent framework written in Python. It provides multi-agent collaboration, self-healing, codebase awareness (World Model), enterprise-grade RAG, and a full workflow engine.
GoalX Integration (v2026-04-13):
- Durable Surfaces: 9 canonical surfaces (charter, obligation_model, control_state, coordination_state, assurance_plan, evidence_log, objective_contract, status_summary, freshness_state)
- Budget Guard: Resource safety monitoring (PSI, RSS, Host pressure) + dynamic adjustment
- Worktree Isolation: Git worktree-based parallel execution with explicit merge boundaries (keep/integrate)
- Integration Engine:
keep_session,keep_to_source,partial_adoptsemantics - Intent Routing: DELIVER, EXPLORE, EVOLVE, IMPLEMENT, DEBATE
- Debate Mode: From saved runs with evidence-based challenge/review
- Memory Seed & Promote: Project bootstrap memory + short-to-long-term memory promotion
- Resource Profile: Detailed host/PID/memory/disk/load profiling with history tracking
Aider Integration (v0.50.0 - 2026-04-08):
- 18+ Aider-style commands (/add, /drop, /run, /test, /git, etc.)
- 10 edit formats (editblock, wholefile, udiff, patch, etc.)
- 25+ model aliases with metadata caching
- RepoMap code understanding
- Tree-sitter syntax parsing
- 20+ LLM exception types handling
- Message role sanitization
- File pattern filtering (gitignore)
- Version checking (PyPI)
- 34 new integration tests
Oh-My-Codex Integration (v2026-04-14):
- Intent Router: 关键词检测与技能自动激活 (src/agent/intent_router.py)
- Keyword Registry: 40+ 技能关键词注册表 (src/agent/keyword_registry.py)
- Mode State: 独占模式互斥检查、跨会话恢复 (src/workflow/mode_state.py)
- Pipeline Orchestrator: RALPLAN -> team-exec -> ralph 管道 (src/workflow/pipeline_orchestrator.py)
- Session History Search: 历史会话检索 (src/workflow/session_history_search.py)
- Team Persistence: 团队状态持久化 (src/workflow/team_persistence.py)
- Ralph Ledger: RALPH 进度账本与视觉反馈 (src/workflow/ralph_ledger.py)
- Keyword Registry: 40+ 技能关键词注册表 (src/agent/keyword_registry.py)
- Mode State: 独占模式互斥检查、跨会话恢复 (src/workflow/mode_state.py)
- Pipeline Orchestrator: RALPLAN -> team-exec -> ralph 管道 (src/workflow/pipeline_orchestrator.py)
- Session History Search: 历史会话检索 (src/workflow/session_history_search.py)
- Team Persistence: 团队状态持久化 (src/workflow/team_persistence.py)
- Ralph Ledger: RALPH 进度账本与视觉反馈 (src/workflow/ralph_ledger.py)
- Task Analyzer: 任务规模检测 (small/medium/large/heavy)
- Code Simplifier: 自动代码简化钩子 (src/tools_runtime/code_simplifier.py)
- RALPH Loop: 持久化循环执行技能 (skills/ralph_loop/)
- Team Execution: 并行代理执行增强
- Pipeline Orchestrator: RALPLAN -> team-exec -> ralph-verify 管道 (src/workflow/pipeline_*.py)
- Mode State: 管道/团队/技能模式状态持久化 + 独占模式互斥检查 (src/workflow/mode_state.py)
- Ralph Progress Ledger: 视觉反馈记录 + 进度账本 (src/workflow/ralph_ledger.py)
- Agent Prompts: 34 个 Agent Prompt 模板库 (prompts/agents/)
- Agent Definitions: 40+ Agent 角色定义 (src/agent/definitions.py)
- Agent Prompts: 34 个 Agent Prompt 模板库 (prompts/agents/)
- Agent Definitions: 40+ Agent 角色定义 (src/agent/definitions.py)
Tech Stack
- Language: Python 3.10+
- Package Manager: pip / pyproject.toml
- Testing: pytest (1414 test cases, ~50% coverage, target 60%)
- Linting: ruff
- Type Checking: mypy (optional)
- Containerization: Docker + docker-compose
- CI/CD: GitHub Actions
- Git Integration: gitpython (undo, diff, commit attribution, co-authored-by)
Project Structure
src/ → Main source code
├── agent/ → Agent engine + multi-agent swarm system
├── brain/ → World Model (codebase awareness)
├── cli/ → REPL interface + TUI components
├── core/ → Settings, events, exceptions, patch engine, git integration
│ ├── important_files.py # File importance detection (from Aider)
│ └── args_parser.py # Enhanced CLI argument parsing
├── llm/ → Multi-provider LLM abstraction (9 providers)
│ ├── exception_handler.py # LLM exception classification
│ ├── message_handler.py # Message role sanitization
│ ├── model_manager.py # Model aliases & metadata
│ ├── openrouter_manager.py # OpenRouter integration
│ └── prompts/ # Prompt templates
├── memory/ → Enterprise long-term memory (SQLite, async)
├── rag/ → Trigram index, text indexer, dependency graph
│ ├── repo_map.py # Code map (from Aider)
│ └── tree_sitter_syntax.py # Syntax parsing
├── self_healing/ → Auto error detection and AI-driven repair
├── tools_runtime/ → Tool execution (bash, file, grep, glob, AI comment watcher)
├── workflow/ → 5-phase execution pipeline
└── utils/ → Shared utilities (from Aider)
├── diff_utils.py # Diff & progress bar
├── version_check.py # PyPI version check
├── file_patterns.py # Gitignore patterns
├── urls.py # Documentation URLs
├── report.py # Bug reporter
├── deprecated_args.py # Deprecated CLI args
├── image_utils.py # Image file detection
├── arg_formatter.py # CLI help formatters
├── analytics.py # Telemetry (disabled by default)
├── voice.py # Whisper voice input
├── scrape.py # Web scraping
├── watch.py # File watcher with AI comment detection
└── onboarding.py # New user onboarding
skills/ → 21 engineering skills (SKILL.md per directory)
agents/ → Agent personas (code-reviewer, security-auditor, test-engineer)
hooks/ → Session lifecycle hooks (simplify-ignore protection)
references/ → Checklists (accessibility, performance, security, testing)
.claude/commands/ → Slash commands for Claude Code
tests/ → Test suiteCommands
# Development
python -m pytest tests/ -v --tb=short # Run tests
python -m pytest tests/ --tb=short # Run tests (short output)
ruff check src/ # Lint
ruff format src/ # Format
# Run the agent
python -m src.main # Launch REPL
python -m src.main chat # Chat mode
python -m src.main doctor # Environment diagnostics
python -m src.main workflow # Workflow engineConventions
- Python code follows PEP 8 with ruff enforcement
- Test files mirror source structure:
tests/<module>/ - Settings use 6-layer priority: defaults → .env → runtime → CLI → file → API
- Feature flags managed in
.clawd/features.json - Agent swarm roles defined in
src/agent/swarm/roles.py - LLM providers configured via
LLM_PROVIDERenv var or settings - Skills use YAML frontmatter with
nameanddescriptionfields - Skill description starts with what it does (third person), followed by trigger conditions ("Use when...")
- Every skill has: Overview, When to Use, Process, Common Rationalizations, Red Flags, Verification
- References are in
references/, not inside skill directories - Supporting files only created when content exceeds 100 lines
Slash Commands (Claude Code)
| Command | Purpose |
/spec | Spec-driven development |
/plan | Task planning with dependency graph |
/build | Incremental TDD implementation |
/test | TDD workflow (RED/GREEN/REFACTOR) |
/review | Five-axis code review |
/code-simplify | Code simplification |
/ship | Pre-launch checklist and deployment prep |
/undo | Undo last AI commit (from Aider) |
/diff | Show uncommitted changes (from Aider) |
/compact | Compress conversation context |
/format | Switch edit format (Aider integration) |
/add | Add file to chat (Aider) |
/drop | Remove file from chat (Aider) |
/test | Run tests (Aider) |
/lint | Run linter (Aider) |
/git | Git shortcuts (Aider) |
Engineering Skills
Skills are located in skills/<name>/SKILL.md. Each skill follows a consistent anatomy:
Define: idea-refine, spec-driven-development Meta: using-agent-skills Plan: planning-and-task-breakdown Build: incremental-implementation, test-driven-development, context-engineering, frontend-ui-engineering, api-and-interface-design Verify: browser-testing-with-devtools, debugging-and-error-recovery Review: code-review-and-quality, code-simplification, security-and-hardening, performance-optimization Ship: git-workflow-and-versioning, ci-cd-and-automation, deprecation-and-migration, documentation-and-adrs, shipping-and-launch
Agent Personas
Three specialist personas in agents/:
- code-reviewer.md — Staff Engineer; five-axis review (correctness, readability, architecture, security, performance)
- security-auditor.md — Security Engineer; vulnerability detection, OWASP assessment
- test-engineer.md — QA Specialist; test strategy, coverage analysis, Prove-It pattern
Boundaries
- Always: Run tests after code changes
- Always: Follow the existing code patterns and architecture
- Always: Use the patch engine for declarative code modifications
- Never: Commit secrets or API keys
- Never: Modify
.envfiles with real credentials - Never: Skip error handling — use the structured error codes from
src/core/exceptions.py - Never: Add dependencies without updating
requirements.txtandpyproject.toml
<!-- autoskills:start -->Summary generated by autoskills. Check the full files inside .claude/skills.
Accessibility (a11y)
Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".
.claude/skills/accessibility/SKILL.md.claude/skills/accessibility/references/A11Y-PATTERNS.md: Practical, copy-paste-ready patterns for common accessibility requirements. Each pattern is self-contained and linked from the main SKILL.md..claude/skills/accessibility/references/WCAG.md
Design Thinking
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beaut...
.claude/skills/frontend-design/SKILL.md
Python Background Jobs & Task Queues
Python background job patterns including task queues, workers, and event-driven architecture. Use when implementing async task processing, job queues, long-running operations, or decoupling work from request/response cycles.
.claude/skills/python-background-jobs/SKILL.md
Python Code Executor
Execute Python code in a safe sandboxed environment via inference.sh. Pre-installed: NumPy, Pandas, Matplotlib, requests, BeautifulSoup, Selenium, Playwright, MoviePy, Pillow, OpenCV, trimesh, and 100+ more libraries. Use for: data processing, web scraping, image manipulat...
.claude/skills/python-executor/SKILL.md
Python Testing Patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
.claude/skills/python-testing-patterns/SKILL.md.claude/skills/python-testing-patterns/references/advanced-patterns.md: Advanced testing patterns including async code, monkeypatching, temporary files, conftest setup, property-based testing, database testing, CI/CD integration, and configuration.
SEO optimization
Optimize for search engine visibility and ranking. Use when asked to "improve SEO", "optimize for search", "fix meta tags", "add structured data", "sitemap optimization", or "search engine optimization".
.claude/skills/seo/SKILL.md
<!-- autoskills:end -->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.

