- Use 4-space indentation, unless project or editor settings is configured otherwise
- Use
ast-grep
orsg
for code structural search, lint or rewriting, cheatsheet: @~/.claude/ast-grep-rule.md - Only use
rg
for recursive search, manual or automatic filtering of plain text files - Use
gemini
to prompt for more understanding in large documents, images, or directory of files - Be precise and targeted in examining where changes need to be made
- Avoid inline styles, create separate CSS files
- Avoid creating a large file, split it into reusable modules
- Refactor long functions into smaller, reusable functions
- Follow development guidelines for files written in:
- python: @~/.claude/python-guidelines.md
- javascript / typescript: @~/.claude/typescript-guide.md
- swift: @~/.claude/modern-swift.md
gemini
is available to prompt for more understanding
To prompt a text with gemini
echo "Explain the functions on @path/to/source_file.rs, and what do they achieve" | gemini
gemini -p "Explain the functions on @path/to/source_file.rs, and what do they achieve"
gemini -p "Analyze this document @path/to/document"
ast-grep
or sg
is available as CLI tool for code structural search, lint, and rewriting
ast-grep has following form
sg --pattern 'var code = $PATTERN' --rewrite 'let code = new $PATTERN' --lang ts
ripgrep is a command line tool that searches your files for patterns that you give it. ripgrep behaves as if reading each file line by line.
How to find all function definitions whose name is write
:
$ rg 'fn write\('
src/printer.rs
469: fn write(&mut self, buf: &[u8]) {
- Use
xcbeautify
to pipe the output ofxcodebuild
set -o pipefail && xcodebuild [flags] | xcbeautify
- List available simulators before running
xcodebuild
on a simulator
xcrun simctl list
- Run build for iOS simulator target, where
-scheme
argument value is one from the list given byxcodebuild -list
, use debug configuration before building with release configuration
xcodebuild -configuration debug -scheme $SCHEME -sdk iphonesimulator -destination "generic/platform=iOS Simulator"