Imported from YuanyuanMa03/cropcode (
.cropcode/AGENTS.md). Install upstream withnpx skills add YuanyuanMa03/cropcode --skill .cropcode. Copyright stays with the author.
Repository Guidelines
Project Structure & Module Organization
npm workspaces monorepo under packages/.
packages/core/src/—session.ts(LLM loop, streaming, retry, compaction),tools/,common/(permissions, OpenAI client, capabilities, file history),mcp/,templates/.packages/cli/src/— Ink/React TUI (cli.tsx,cli-args.ts,ui/);packages/vscode-ide-companion/— VSCode companion.docs/— user docs;scripts/— build/release tooling;dist/— bundled output (gitignored).
Build, Test, and Development Commands
npm run check— typecheck/lint/format;npm test— workspace tests.npm run build— full build;npm run bundle— esbuild bundle;npm run start— run the CLI.- Single test:
node --import tsx --test packages/core/src/tests/session.test.ts. - Release:
npm run release:version -- <bump>, thennpm run prepare:package/prepare:vscode(RELEASE.md).
Coding Style & Naming Conventions
- 2-space indent, double quotes, semicolons,
es5trailing commas, 120-char lines, LF endings; TypeScript strict. import typefor type-only imports;_prefix for unused vars; ES2022/ESNext; JSXreact-jsx.- Prettier + ESLint; Husky/lint-staged formats staged files. Files:
kebab-case.ts,kebab-case.tsx,*.test.ts.
Testing Guidelines
- Node native test runner (
node:test) viatsxwithnode:assert/strict. - Tests live in
packages/*/src/tests/, named after the source module; runnpm testbefore PRs.
Commit & Pull Request Guidelines
- Conventional commits:
feat:,fix:,chore:,refactor:,style:,test:,docs:,perf:,build:. - PRs: clear description, linked issues, UI screenshots, passing
npm run check && npm test, no unintendeddist//lockfile changes.
Architecture Overview
@yuanyuanma03/cropcode-cli(Ink TUI) drives the LLM loop viaSessionManager(@yuanyuanma03/cropcode-core) over a 180s keep-alivecreateOpenAIClient()using only the configured provider credentials.- Built-in tools:
bash,read,write,edit,skill,AskUserQuestion,UpdatePlan,WebSearch,ReadImage;readreturns asnippet_idforedit, andsupportsMultimodal()picks the matching image tool. bashbounds output draining after exit/timeout so a held pipe cannot hang a session, captures native cwd on Windows Git Bash;run_in_backgroundhandles detached work.- Permissions: 12 scopes including
read-in-tmp/write-in-tmp;addWorkingDirsextends the workspace;file-history.tsprovides undo. - Models: default
deepseek-flash;/modeloffersdeepseek-v4-pro,deepseek-v4-flash,deepseek-v4-flash-vision-exp(effortlow/high/max). - Commands:
/skills,/model,/plan,/new,/init,/resume,/fork,/continue,/undo,/mcp,/raw,/exit; Plan Mode gates writes behind<proposed_plan>. - CLI flags:
-p,-x,-r,-f,-l,-v,-h.
Agent-Specific Instructions
- AGENTS.md loads from
./.cropcode/AGENTS.md,./AGENTS.md, then~/.cropcode/AGENTS.md(first wins). - Skills load from
./.cropcode/skills,./.agents/skills, or~equivalents via theskilltool. Bundled:cropcode-self-refer,skill-digester,skill-writer. - File references:
@path/to/file.
Persistent Product Requirements
Read AGENTS.md at the repository root for the user-approved brand and commit rules. Use CropCode branding; describe concrete changes in commits without imitation language. No third-party product credentials, purchase links, default proxy services, or usage reporting. Retain required MIT attribution.