skills/harness/code-organization-harness/SKILL.md
Use when adding a new feature module, fixing a bug, refactoring, or deciding where code/tests/docs should live. Guides agents to discover context with targeted grep, choose module boundaries, place files by domain and layer, and follow project-specific Next.js, Python, and Java code organization patterns.
npx skillsauth add escapewu/skills code-organization-harnessInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill before creating or moving code for any non-trivial feature, bug fix, API change, refactor, or new module. Its job is to make file placement boring: find the owning domain, extend the right layer, and keep new code easy for the next agent to grep.
scheduler task cancel, evaluation proposal approve,
time-axis replay compare.docs/OVERVIEW.md, then docs/feature/INDEX.md or
docs/reference/INDEX.md only when relevant. When locating a feature owner,
follow progressive disclosure into its README.md or INDEX.md and
requirements.md: requirements capture expected behavior, while README/INDEX
capture current state and routing.common,
utils, components, or services just because the code is reusable.
Promote to shared only after there are at least two real callers and a stable
contract.docs/feature/<module>/requirements.md; current implementation, API lists,
and status go to the feature README.md or INDEX.md; stable interfaces go
to docs/reference/interfaces.md; runbook changes go to
docs/reference/runbook-testing.md. API/schema/runtime changes update the
docs listed in AGENTS.md.Prefer rg and rg --files.
# Find likely owners by noun / route / schema / table.
rg -n "evaluation|proposal|scheduler|time_axis|run_id" src frontend/src tests docs
rg --files | rg "(evaluation|proposal|scheduler|time_axis|run|worker)"
# Trace an API path end to end.
rg -n "APIRouter|include_router|response_model|/api/evaluations" src/api tests frontend/src
# Trace a typed contract.
rg -n "class .*Response|class .*Request|model_validate|frontend/src/types" src frontend/src tests
# Trace persistence and repository ownership.
rg -n "class .*\\(Base\\)|__tablename__|repo_|AsyncSession|select\\(" src/api tests
# Trace frontend callers.
rg -n "apiGet|apiPost|apiPut|apiDelete|/api/" frontend/src tests
# Detect whether Java is present before applying Java guidance.
rg --files | rg "(^|/)(pom.xml|build.gradle|settings.gradle|src/(main|test)/java/)"
When grep finds several candidates, choose the file whose tests would naturally fail if the new behavior were broken.
common-style helpers only for
narrow, domain-neutral behavior. If the helper name needs "misc", it is not
ready to be shared.src/api/services/ai_evaluation/, with internal files named by capability.tests/test_api, service/domain tests under tests/test_services,
repository tests under tests/test_repositories, CLI tests under
tests/test_cli, and schema-only tests under tests/test_models.| Change type | Primary location | Also check |
|---|---|---|
| Backend API endpoint | src/api/routers/<domain>.py | src/api/app.py, schemas, service, API tests |
| Backend business behavior | src/api/services/<domain>.py or package | service tests, docs feature module |
| API request/response | src/api/models/schemas.py | frontend/src/types/index.ts, docs/reference/interfaces.md |
| Persistence table/query | src/api/models/tables.py, repositories.py, Alembic | repository tests, runbook docs |
| Worker runtime/source | src/api/services/workers/ | worker tests, scheduler/runtime docs |
| CLI command | src/cli/<tool>/ | CLI tests, runbook docs |
| Frontend route | frontend/src/app/<route>/page.tsx | API helper, shared types, UI tests/typecheck |
| Shared frontend UI | frontend/src/components/ | keep route-only UI local until reused |
| Frontend data access | frontend/src/lib/api.ts | never hardcode backend host in components/pages |
| Feature requirements / expected behavior / acceptance | docs/feature/<module>/requirements.md | feature README/INDEX, tests |
| Feature current state / API list / known gaps | docs/feature/<module>/README.md or INDEX.md | docs/feature/INDEX.md, docs/OVERVIEW.md when adding modules |
| Design decisions | docs/feature/<module>/design.md | feature README/INDEX |
| Data flow / sequence | docs/feature/<module>/dataflow.md | design docs, tests |
| Stable API/config/schema contracts | docs/reference/interfaces.md | feature README/INDEX, schemas/types |
| Feature docs | docs/feature/<module>/ | use the specific docs rows above before adding generic files |
| Execution plan | .agents/skills/harness/harness-engineering-plan/tasks/<module>/taskBoard.md | WIP, not under docs/ |
Load only the reference that matches the code being changed:
references/nextjs.mdreferences/python.mdreferences/java.mdIf a framework reference conflicts with existing project conventions, follow the project convention unless the task is explicitly to migrate it.
requirements.md.development
Use when working with the news fetcher REST API at <news-fetcher-host> for supported-site lookup, domain article discovery, URL fetching, batch fetch/crawl workflows, fetch history queries, and Bearer-authenticated integration examples.
development
create and refresh repository-specific development standards for an existing local codebase. use when the user wants to analyze a local repository, extract coding conventions from real files, generate docs/ai-dev-standards, create code review checklists, or update existing agents.md or claude.md files so future coding agents load the right standards before development. do not use for generic programming advice detached from a repository.
documentation
analyze postgresql or mysql database schemas from ddl files, schema-only dumps, migration sql, or read-only database metadata. use when the user wants table structure summaries, primary keys, foreign keys, indexes, inferred table relationships, er diagrams, dbml, mermaid erd, schema documentation, or database relationship analysis for postgres/mysql schemas.
tools
Replace with description of the skill and when Claude should use it.