# Paper Code

> Use when implementing experimental code, scaffolding research projects, or following coding best practices for academic work

- Skill: `lipu-jpg/paper-code` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add lipu-jpg/paper-code`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lipu-jpg/paper-code/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Research & Search
- Author: lipu-jpg (https://skillmd.com/u/lipu-jpg)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lipu-jpg/paper-code

---


# Paper Code

Implement experimental code following best practices for reproducibility and academic standards.

## Project Structure

```
project/
├── configs/           # Hyperparameters, settings
├── data/              # Raw and processed data
├── models/            # Model implementations
├── scripts/           # Training and evaluation scripts
├── notebooks/        # Exploratory analysis
├── tests/             # Unit and integration tests
├── logs/              # Experiment tracking
└── README.md          # Documentation
```

## Code Quality Standards

### Reproducibility
- Fixed random seeds (torch.manual_seed, numpy.random.seed)
- Config files for all hyperparameters
- Exact command reproduction in logs
- Environment specification (requirements.txt, conda env)

### Style
- Clear variable and function names
- Comprehensive docstrings (Google/NumPy style)
- Type hints for function signatures
- Modular, reusable components

### Testing
- Test core functions individually
- Validate data preprocessing pipelines
- Check metric calculations match paper definitions

## Scripts

### code-scaffold.py
Generate project templates for common experiment types:
- Classification experiments
- Generation experiments
- RL training loops
- Baseline implementations
## References

- `references/best-practices.md`: Code quality standards and project structure

### code-validator.py
Check code quality:
- Linting (flake8, black)
- Type checking (mypy)
- Import validation

## Tips

- Start with a working baseline, then modify
- Keep experiment configs versioned
- Log everything (parameters, seeds, results)
- Use Weights & Biases or MLflow for tracking

