claude-code-usage
24
总安装量
3
周安装量
#15647
全站排名
安装命令
npx skills add https://github.com/0xlayerghost/solidity-agent-kit --skill claude-code-usage
Agent 安装分布
claude-code
3
windsurf
1
trae
1
cursor
1
codex
1
Skill 文档
Claude Code Best Practices
Language Rule
- Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.
Context Management Rules
| Rule | Why |
|---|---|
| One window = one task | Mixing tasks pollutes context and degrades output quality |
Use /clear over /compact |
Clean start is more reliable than compressed context |
/clear after complex tasks |
Prevents old context from interfering with new work |
| Copy key info to new windows | Don’t rely on context persistence â paste critical details |
Task Execution Strategy
| Task Type | Recommended Approach |
|---|---|
| Small bug fix (few lines) | Describe directly, let Claude modify in-place |
| Large feature / refactor | /plan â review approach â /clear â paste plan â execute step by step |
| Multi-file changes | Must use /plan workflow â never modify multiple files without a plan |
| Code analysis / learning | Ask Claude to analyze directly â no plan needed |
| Debugging | Provide error message + file path + relevant code â ask for root cause |
Prompt Techniques
Do This
- Give specific paths: “Modify the
_transferfunction insrc/MyToken.sol“ - Give examples: “Input: 100 tokens, Expected: 95 tokens after 5% fee”
- Set boundaries: “Only modify this function, don’t touch other code”
- Reference tests: “The fix should make
test_transfer_feeDeductionpass”
Avoid This
- Vague references: “Modify that transfer function” â which one? Where?
- Open-ended requests without constraints: “Make it better”
- Multiple unrelated tasks in one message
Git Operation Rules
- Always run
git diffbefore committing to review changes - Only commit â do not push unless explicitly requested
- Never push directly to main/master branch
- Stage specific files â never use
git add .in Solidity projects (risk of committing.env)
Foundry-Specific Workflow
| Action | Command |
|---|---|
| Before committing | forge fmt && forge test |
| After modifying contracts | forge build to check compilation |
| Before PR | forge test --gas-report to check gas impact |
| Debugging failed test | forge test --match-test <name> -vvvv for full trace |
Quick Command Reference
| Command | Purpose |
|---|---|
/clear |
Clear context, start fresh |
/plan |
Enter planning mode â analyze before modifying |
/help |
View all available commands |
/compact |
Compress context (prefer /clear instead) |
Project-level Configuration
Create .claude/instructions.md in the project root with project-specific rules. Claude automatically reads it at the start of every conversation â no manual loading needed.