vibe-codebase-structure
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Help vibe coders design a production-grade repository structure for new or existing software projects. Use when starting a production project, auditing repository structure, creating missing project files, preparing a codebase for AI coding agents, or deciding which directories and governance files are mandatory versus optional.
- Reads credentials
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- vibeguard-skill-systemSkill
- ai-architecture-evolutionSkill
- ai-legacy-modernizationSkill
- ai-api-contract-guardianSkill
- ai-data-quality-and-reconciliationSkill
- ai-safe-data-migrationSkill
- ai-ui-ux-designSkill
- ai-project-discoverySkill
- ai-documentation-and-handoffSkill
- ai-environment-bootstrapSkill
- ai-accessibility-and-localizationSkill
- ai-visual-qualitySkill
- ai-cloud-cost-optimizerSkill
- ai-privacy-and-data-governanceSkill
- ai-data-and-integrationsSkill
- ai-production-feature-builderSkill
- ai-implementation-strategistSkill
- ai-infrastructure-as-codeSkill
- ai-forensic-investigationSkill
- ai-skill-author-and-evaluatorSkill
- ai-dependency-upgrade-managerSkill
- vibe-executerSkill
- vibe-exploreSkill
- voice-agentsSkill
- voice-ai-developmentSkill
- voice-ai-engine-developmentSkill
- vulnerability-scannerSkill
- ai-observability-and-reliabilitySkill
- ai-next-step-skill-routerSkill
- ai-vibeguard-directorSkill
- ai-performance-optimizerSkill
- ai-ultraplanSkill
- ai-incident-responseSkill
- ai-release-and-deploySkill
- ai-deep-researchSkill
- ai-disaster-recoverySkill
- ai-code-review-and-cleanupSkill
- ai-production-readiness-reviewerSkill
- ai-security-auditSkill
- ai-deep-brainstormingSkill
- ai-systematic-debuggingSkill
- ai-test-driven-qualitySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
63 rules. About 0 are common, 61 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈61
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 26
Use this skill when the user asks to:
- Distinctive: line 28
create a production-grade project structure.
- Distinctive: line 32
create AGENTS.md, architecture docs, specifications, runbooks, or CI structure.
- Distinctive: line 34
add missing testing, security, infrastructure, observability, or deployment folders.
- Distinctive: line 36
create a reusable repository starter template.
- Distinctive: line 38
Do not use this skill only to generate application features, UI screens, or business logic unless repository structure is also part of the …
- Distinctive: line 72
Avoid labeling everything as mandatory.
- Distinctive: line 78
Before designing the repository, determine as much of the following as possible from the conversation or existing files:
- Distinctive: line 93
When details are missing, make conservative assumptions and clearly identify conditional sections.
- Distinctive: line 113
Use a compact structure with strong basics.
- Very specific: line 124
Use apps/, packages/, nested documentation, and scoped agent instructions.
- Distinctive: line 137
Add threat modeling, SBOM, provenance, service-level objectives, incident runbooks, environment protections, and stricter ownership rules.
- Distinctive: line 143
Start with the smallest credible structure.
- Distinctive: line 421
Keep it navigational. Put deep details in dedicated documents.
- Distinctive: line 425
Use AGENTS.md as the canonical repository instruction file.
- Distinctive: line 465
Do not invent database fields.
- Distinctive: line 466
Do not modify production data.
- Distinctive: line 467
Do not change public APIs without updating their specifications.
- Distinctive: line 468
Do not disable tests merely to make CI pass.
- Distinctive: line 469
Do not add dependencies without justification.
- Distinctive: line 470
Do not place secrets in source code.
- Distinctive: line 471
Run the full verification command before reporting completion.
- Distinctive: line 473
Add regression tests for fixed bugs.
- Distinctive: line 474
Update relevant documentation and ADRs.
- Distinctive: line 476
Use nested AGENTS.md files in subdirectories when different areas require different rules.
- Distinctive: line 514
Never commit real secrets.
- Distinctive: line 518
Use it to keep encoding, indentation, line endings, and whitespace consistent across humans and agents.
- Very specific: line 620
Use specs/ to convert vague ideas into testable contracts.
- Distinctive: line 721
Use contract tests when the project has:
- Distinctive: line 730
Use golden or snapshot cases for:
- Distinctive: line 739
Do not rely only on snapshots.
- Distinctive: line 747
Use when the project has repeated agent workflows or multiple agent roles.
- Distinctive: line 844
Only add scripts, references, or assets when they materially improve the skill.
- Distinctive: line 848
Use evals to test coding-agent behavior.
- Distinctive: line 873
Do not store uncontrolled model transcripts containing sensitive data.
- Distinctive: line 925
Use AGENTS.md as the canonical instruction source.
- Distinctive: line 927
Add tool-specific files only when needed:
- Distinctive: line 936
Avoid duplicating the full rule set in every tool file.
- Distinctive: line 948
Never commit credentials inside MCP or agent-tool configuration.
- Distinctive: line 975
Use Architecture Decision Records to prevent repeated reversal of prior decisions.
- Distinctive: line 1039
Every schema change uses a migration.
- Distinctive: line 1123
Keep these concepts distinct:
- Distinctive: line 1208
Prefer generated SBOMs attached to build artifacts or releases over manually maintained inventories.
- Distinctive: line 1212
Add provenance for regulated, enterprise, public-package, containerized, or critical systems.
- Distinctive: line 1244
Every important alert should define:
- Distinctive: line 1272
Never silently use development defaults in production.
- Distinctive: line 1273
Keep secrets outside the repository.
- Distinctive: line 1275
Avoid scattered environment-name conditionals.
- Distinctive: line 1276
Add a configuration schema when practical.
- Distinctive: line 1296
Use when releases affect customers or other systems.
- Distinctive: line 1339
Use when performance is a formal requirement.
- Distinctive: line 1381
When generated files are versioned, document:
- Distinctive: line 1411
Do not allow agents to create uncontrolled scratch directories inside the repository.
- Distinctive: line 1417
When the user cannot implement everything at once, prioritize in this order:
- Distinctive: line 1504
When auditing an existing codebase, check each domain.
- Distinctive: line 1536
Do fixed bugs receive regression tests?
- Distinctive: line 1591
Must agents run verification?
- Distinctive: line 1592
Must they disclose failed checks?
- Distinctive: line 1603
every recommended item is classified as must-have, conditional, good-to-have, or agent-critical.
- Distinctive: line 1639
When helping a user, provide:
- Distinctive: line 1659
Prefer a practical phased plan over an enormous undifferentiated checklist.
- Distinctive: line 1670
follow architecture and security rules.
- Distinctive: line 1677
If any of those actions still depends on undocumented tribal knowledge, the repository is not yet production-grade.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vibe Codebase Structure
Purpose
Help vibe coders start production projects with a repository that is:
- understandable by humans and coding agents;
- reproducible across machines;
- testable with one clear verification command;
- secure by default;
- deployable and observable;
- recoverable after failures;
- governed by explicit specifications and architectural rules.
This skill focuses on project structure, repository files, agent guidance, testing, security, CI/CD, operations, and production readiness. It is stack-agnostic unless the user provides a specific technology stack.
When to use this skill
Use this skill when the user asks to:
- create a production-grade project structure;
- review whether a repository is ready for production;
- define must-have and good-to-have files or directories;
- make a project safer for vibe coding or agent-driven development;
- create
AGENTS.md, architecture docs, specifications, runbooks, or CI structure; - organize a monorepo or single-application repository;
- add missing testing, security, infrastructure, observability, or deployment folders;
- prepare a codebase for Cursor, Codex, Claude Code, Copilot, or other coding agents;
- create a reusable repository starter template.
Do not use this skill only to generate application features, UI screens, or business logic unless repository structure is also part of the request.
Core principle
A production-grade repository is not defined by the number of folders.
It is production-grade when a new developer or coding agent can answer:
- What does the system do?
- How is the repository organized?
- How do I set it up?
- How do I run it?
- How do I verify a change?
- Which architectural boundaries must not be crossed?
- How are database changes performed safely?
- Where are secrets stored?
- How is the application deployed?
- How is it monitored?
- How is it restored after failure?
- What evidence is required before declaring work complete?
Classification system
Classify recommended files and directories using:
- Must have — required for most production projects.
- Conditional — required when the related capability exists.
- Good to have — valuable but not always necessary.
- Agent-critical — especially important for AI-assisted development.
Avoid labeling everything as mandatory. Adapt the structure to project size, risk, deployment model, team size, and regulatory requirements.
Required discovery
Before designing the repository, determine as much of the following as possible from the conversation or existing files:
- application type: web, API, mobile, desktop, CLI, data, AI, or mixed;
- single repository or monorepo;
- primary stack and package manager;
- database and migration tool;
- deployment target;
- CI/CD provider;
- whether containers are used;
- whether agents will modify the repository;
- security or compliance sensitivity;
- team size;
- whether the project is greenfield or existing;
- whether public APIs, queues, workers, cron jobs, or third-party integrations exist.
When details are missing, make conservative assumptions and clearly identify conditional sections. Do not force enterprise complexity onto a small project.
Workflow
Step 1: Identify the project profile
Classify the project into one of these profiles:
Small production application
Typical characteristics:
- one application;
- one database;
- one deployment target;
- small team;
- limited infrastructure.
Use a compact structure with strong basics.
Multi-application or monorepo
Typical characteristics:
- frontend, backend, admin, workers, or shared packages;
- multiple deployment units;
- shared libraries;
- separate ownership boundaries.
Use apps/, packages/, nested documentation, and scoped agent instructions.
High-assurance or enterprise system
Typical characteristics:
- regulated data;
- strict uptime or audit requirements;
- complex infrastructure;
- multiple teams;
- security review;
- formal releases.
Add threat modeling, SBOM, provenance, service-level objectives, incident runbooks, environment protections, and stricter ownership rules.
Step 2: Produce a recommended repository tree
Start with the smallest credible structure. Expand only when justified.
Minimum production structure
project/
├── README.md
├── AGENTS.md
├── SECURITY.md
├── .gitignore
├── .editorconfig
├── .env.example
├── package-manifest
├── dependency-lockfile
├── Makefile
├── src/
├── tests/
│ ├── unit/
│ ├── integration/
│ └── e2e/
├── specs/
├── docs/
│ ├── architecture/
│ ├── adr/
│ ├── deployment/
│ └── runbooks/
├── scripts/
│ ├── setup
│ ├── dev
│ ├── verify
│ ├── migrate
│ └── smoke-test
├── database/
│ └── migrations/
├── security/
│ ├── threat-model.md
│ └── secrets-policy.md
└── .github/
├── CODEOWNERS
├── dependabot.yml
├── PULL_REQUEST_TEMPLATE.md
└── workflows/
├── ci.yml
└── deploy.ymlExpanded production structure
project/
│
├── README.md
├── AGENTS.md
├── LICENSE
├── CHANGELOG.md
├── CONTRIBUTING.md
├── SECURITY.md
├── CODE_OF_CONDUCT.md
│
├── .gitignore
├── .gitattributes
├── .editorconfig
├── .env.example
├── .dockerignore
├── .nvmrc / .python-version
├── mise.toml / .tool-versions
│
├── package.json / pyproject.toml /
│ composer.json / go.mod / Cargo.toml
├── dependency-lockfile
│
├── Makefile / Taskfile.yml / justfile
├── Dockerfile
├── compose.yaml
│
├── apps/
│ ├── web/
│ ├── api/
│ ├── admin/
│ └── worker/
│
├── packages/
│ ├── ui/
│ ├── shared/
│ ├── database/
│ └── config/
│
├── src/
│ ├── domain/
│ ├── application/
│ ├── infrastructure/
│ ├── interfaces/
│ ├── config/
│ └── main.*
│
├── tests/
│ ├── unit/
│ ├── integration/
│ ├── contract/
│ ├── e2e/
│ ├── security/
│ ├── performance/
│ ├── smoke/
│ ├── fixtures/
│ ├── factories/
│ └── helpers/
│
├── specs/
│ ├── product/
│ ├── features/
│ ├── acceptance/
│ ├── api/
│ ├── data/
│ └── templates/
│
├── docs/
│ ├── architecture/
│ ├── adr/
│ ├── api/
│ ├── database/
│ ├── development/
│ ├── deployment/
│ ├── operations/
│ ├── runbooks/
│ ├── troubleshooting/
│ └── glossary.md
│
├── agents/
│ ├── README.md
│ ├── roles/
│ ├── workflows/
│ ├── prompts/
│ ├── policies/
│ ├── checklists/
│ ├── context/
│ └── skills/
│
├── evals/
│ ├── code-generation/
│ ├── regression/
│ ├── security/
│ ├── golden-cases/
│ ├── rubrics/
│ ├── datasets/
│ └── results/
│
├── tasks/
│ ├── templates/
│ ├── proposed/
│ ├── active/
│ ├── blocked/
│ └── completed/
│
├── scripts/
│ ├── setup
│ ├── dev
│ ├── verify
│ ├── lint
│ ├── test
│ ├── typecheck
│ ├── build
│ ├── migrate
│ ├── seed
│ ├── release
│ ├── backup
│ ├── restore
│ └── smoke-test
│
├── config/
│ ├── development/
│ ├── testing/
│ ├── staging/
│ ├── production/
│ ├── feature-flags/
│ └── schemas/
│
├── database/
│ ├── migrations/
│ ├── seeders/
│ ├── factories/
│ ├── fixtures/
│ ├── schema/
│ ├── views/
│ └── README.md
│
├── api/
│ ├── openapi.yaml
│ ├── asyncapi.yaml
│ ├── schemas/
│ └── examples/
│
├── infra/
│ ├── terraform/
│ ├── kubernetes/
│ ├── helm/
│ ├── docker/
│ ├── cloud/
│ ├── environments/
│ └── README.md
│
├── deploy/
│ ├── staging/
│ ├── production/
│ ├── migrations/
│ ├── rollback/
│ └── smoke-tests/
│
├── observability/
│ ├── dashboards/
│ ├── alerts/
│ ├── logging/
│ ├── metrics/
│ ├── tracing/
│ ├── synthetic-checks/
│ └── service-level-objectives/
│
├── security/
│ ├── threat-model.md
│ ├── data-classification.md
│ ├── secrets-policy.md
│ ├── access-control.md
│ ├── dependency-policy.md
│ ├── secure-coding.md
│ ├── incident-response.md
│ ├── vulnerability-management.md
│ └── sbom/
│
├── .github/
│ ├── CODEOWNERS
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── ISSUE_TEMPLATE/
│ ├── workflows/
│ └── dependabot.yml
│
├── .devcontainer/
│ ├── devcontainer.json
│ └── Dockerfile
│
├── .cursor/
│ ├── rules/
│ └── cli.json
│
├── CLAUDE.md
├── .github/copilot-instructions.md
├── mcp.json / .mcp.json
│
├── public/
├── assets/
├── templates/
├── examples/
├── benchmarks/
└── fixtures/Step 3: Explain the purpose of each major area
Root governance files
README.md — Must have
The README should answer:
- what the system does;
- who it is for;
- current maturity;
- architecture summary;
- required runtime versions;
- local setup;
- environment variables;
- development command;
- test command;
- build command;
- deployment overview;
- known limitations;
- ownership or support.
Keep it navigational. Put deep details in dedicated documents.
AGENTS.md — Must have for agent-driven projects
Use AGENTS.md as the canonical repository instruction file.
It should contain:
# Project purpose
# Repository map
# Supported commands
- Setup:
- Development:
- Lint:
- Typecheck:
- Unit tests:
- Integration tests:
- Full verification:
- Build:
# Architecture rules
# Security rules
# Database and migration rules
# Testing expectations
# Files agents must not modify
# Generated files
# Required documentation updates
# Pull-request expectations
# Definition of doneRecommended rules:
- Do not invent database fields.
- Do not modify production data.
- Do not change public APIs without updating their specifications.
- Do not disable tests merely to make CI pass.
- Do not add dependencies without justification.
- Do not place secrets in source code.
- Run the full verification command before reporting completion.
- Include migrations and recovery plans for schema changes.
- Add regression tests for fixed bugs.
- Update relevant documentation and ADRs.
Use nested AGENTS.md files in subdirectories when different areas require different rules.
SECURITY.md — Must have
Document:
- supported versions;
- vulnerability reporting process;
- private security contact;
- disclosure expectations;
- response process;
- scope exclusions.
Dependency manifest and lockfile — Must have
Always keep both:
- the dependency manifest;
- the resolved lockfile.
Examples:
package.json
pnpm-lock.yamlpyproject.toml
uv.lockThe lockfile must not be casually deleted or regenerated without review.
.env.example — Must have
Include variable names, harmless examples, comments, required versus optional status, and value format.
Never commit real secrets.
.editorconfig — Must have
Use it to keep encoding, indentation, line endings, and whitespace consistent across humans and agents.
Makefile, Taskfile.yml, or justfile — Must have
Expose stable commands such as:
make setup
make dev
make lint
make typecheck
make test
make test-integration
make build
make verify
make migrate
make seed
make smokeThe most important command is a single complete verification command:
make verifyIt should perform all required checks before work is considered complete.
Step 4: Define application boundaries
Single application
A clean layered layout may use:
src/
├── domain/
├── application/
├── infrastructure/
├── interfaces/
└── config/For a smaller application:
src/
├── components/
├── services/
├── repositories/
├── models/
├── routes/
├── middleware/
├── validation/
├── utilities/
└── config/The names matter less than documented dependency direction.
Example rules:
- Domain code must not import infrastructure code.
- Controllers call application services rather than querying the database directly.
- UI components do not call third-party APIs directly.
- Shared packages do not depend on application-specific modules.
Monorepo
Use:
apps/
├── web/
├── api/
├── admin/
└── worker/
packages/
├── ui/
├── database/
├── shared/
├── validation/
├── observability/
└── config/Each major application or package should have its own:
- README;
- scoped
AGENTS.md; - tests;
- manifest;
- configuration;
- ownership boundaries.
Step 5: Add specifications
Use specs/ to convert vague ideas into testable contracts.
specs/
├── product/
├── features/
├── acceptance/
├── api/
├── data/
└── templates/Feature specification template
# Feature name
## Problem
## User outcome
## In scope
## Out of scope
## User roles
## Functional requirements
## Business rules
## Validation rules
## Permissions
## Error cases
## Data changes
## API changes
## UI states
## Accessibility requirements
## Observability requirements
## Acceptance criteria
## Rollback considerationsRewrite vague requests into concrete behavior.
Weak:
Add customer management.Strong:
Administrators can create, edit, archive, and restore customers.
Customer email must be unique within a company.
Archived customers remain visible in historical invoices but cannot be selected
for new invoices.
Every create, update, archive, and restore action is written to the audit log.Step 6: Build the testing structure
Recommended layout:
tests/
├── unit/
├── integration/
├── contract/
├── e2e/
├── security/
├── performance/
├── smoke/
├── fixtures/
├── factories/
└── helpers/Minimum layers:
- unit tests for business logic;
- integration tests for database, queue, cache, and service behavior;
- end-to-end tests for critical user journeys;
- smoke tests for deployed environments;
- regression tests for important bugs.
Use contract tests when the project has:
- separate frontend and backend systems;
- external APIs;
- webhooks;
- multiple services;
- events;
- public APIs.
Use golden or snapshot cases for:
- PDFs;
- emails;
- reports;
- structured AI output;
- complex calculations;
- serialized responses.
Do not rely only on snapshots. Add meaningful assertions.
Step 7: Add agent-driven development support
agents/
Use when the project has repeated agent workflows or multiple agent roles.
agents/
├── README.md
├── roles/
├── workflows/
├── policies/
├── prompts/
├── checklists/
├── context/
└── skills/Roles
Define responsibilities rather than fictional personalities.
Example reviewer role:
# Responsibility
Review proposed changes without modifying source files.
# Check
- Correctness
- Security
- Data integrity
- Backward compatibility
- Tests
- Error handling
- Logging
- Documentation
- Migration safety
# Required output
- Blocking findings
- Non-blocking findings
- Missing evidence
- Recommended verification commandsWorkflows
Useful workflow files:
implement-feature.md
fix-bug.md
review-pull-request.md
database-migration.md
security-review.md
release-check.md
incident-investigation.mdEach workflow should define:
- inputs;
- preconditions;
- allowed tools;
- planning requirements;
- implementation steps;
- verification commands;
- required evidence;
- approval boundaries;
- output format.
Policies
Recommended agent policies:
filesystem-policy.md
command-execution-policy.md
dependency-policy.md
database-policy.md
network-policy.md
secrets-policy.md
production-access-policy.mdSkills
Each specialized skill should use:
skill-name/
├── SKILL.md
├── scripts/
├── references/
└── assets/Only add scripts, references, or assets when they materially improve the skill.
evals/
Use evals to test coding-agent behavior.
evals/
├── code-generation/
├── regression/
├── security/
├── golden-cases/
├── rubrics/
├── datasets/
└── results/Evaluate whether the agent:
- follows architecture rules;
- adds correct tests;
- preserves compatibility;
- avoids insecure dependencies;
- protects secrets;
- handles ambiguity honestly;
- creates safe migrations;
- runs required verification;
- reports failed checks accurately.
Do not store uncontrolled model transcripts containing sensitive data. Prefer compact inputs, rubrics, expected outputs, scores, and failure evidence.
tasks/
Repository-managed tasks improve traceability.
tasks/
├── templates/
├── proposed/
├── active/
├── blocked/
└── completed/Task template:
id: FEAT-0142
title: Add customer archival
status: active
owner: platform
risk: medium
scope:
include:
- apps/api/src/customers
- apps/web/src/features/customers
exclude:
- billing
acceptance_criteria:
- Archived customers cannot be selected for new invoices.
- Existing invoices continue displaying archived customers.
- Restore is available to administrators.
- Actions are included in the audit log.
required_checks:
- unit
- integration
- e2e
- migration-check
approval_required:
- database-schema
- permissionsStep 8: Add tool-specific instruction adapters
Use AGENTS.md as the canonical instruction source.
Add tool-specific files only when needed:
.cursor/rules/
CLAUDE.md
.github/copilot-instructions.md
mcp.jsonAvoid duplicating the full rule set in every tool file.
Preferred pattern:
AGENTS.md Canonical repository rules
docs/architecture/ Detailed architecture
security/ Detailed security policies
.cursor/rules/frontend.mdc Cursor-specific routing
CLAUDE.md Small adapter to canonical docsNever commit credentials inside MCP or agent-tool configuration.
Step 9: Document architecture and decisions
docs/architecture/
Recommended files:
overview.md
system-context.md
component-map.md
dependency-rules.md
data-flow.md
authentication.md
authorization.md
tenancy.md
integration-map.md
failure-modes.mdArchitecture documentation should state boundaries explicitly.
docs/adr/
Use Architecture Decision Records to prevent repeated reversal of prior decisions.
0001-use-postgresql.md
0002-use-session-authentication.md
0003-adopt-modular-monolith.md
0004-use-database-backed-jobs.mdADR template:
# Decision title
Status: Accepted
Date: YYYY-MM-DD
## Context
## Decision
## Alternatives considered
## Consequences
## Reversal conditionsdocs/runbooks/
Recommended runbooks:
database-restore.md
failed-deployment.md
queue-backlog.md
high-error-rate.md
credential-rotation.md
storage-outage.md
third-party-api-outage.md
security-incident.mdA production system is incomplete when recovery knowledge exists only in one person’s head.
Step 10: Control database changes
Recommended layout:
database/
├── migrations/
├── seeders/
├── factories/
├── fixtures/
├── schema/
├── views/
└── README.mdRules:
- Every schema change uses a migration.
- Released migrations are immutable.
- Destructive operations require explicit review.
- Large data migrations are separated from schema migrations.
- Rollback or forward-fix strategy is documented.
- Production data is never stored in the repository.
- Seed data is clearly labeled as test or development data.
- Tests use isolated databases.
- Backup restoration is tested.
Step 11: Add CI/CD governance
For GitHub:
.github/
├── workflows/
│ ├── ci.yml
│ ├── security.yml
│ ├── release.yml
│ ├── deploy-staging.yml
│ └── deploy-production.yml
├── CODEOWNERS
├── dependabot.yml
├── PULL_REQUEST_TEMPLATE.md
└── ISSUE_TEMPLATE/CI should normally perform:
Install from lockfile
Validate formatting
Lint
Typecheck
Unit tests
Integration tests
Contract tests
Build
Migration validation
Dependency vulnerability scan
Secret scan
Static security analysis
Artifact generation
Smoke testDeployment should include:
- protected environments;
- production approval when appropriate;
- immutable build artifacts;
- deployment records;
- migration handling;
- post-deployment smoke tests;
- rollback procedures.
Promote the same tested artifact to production. Do not rebuild different code during production deployment.
Step 12: Separate infrastructure, deployment, configuration, and secrets
Use:
infra/
├── terraform/
├── kubernetes/
├── helm/
├── cloud/
├── environments/
└── README.md
deploy/
├── staging/
├── production/
├── migrations/
├── rollback/
└── smoke-tests/Keep these concepts distinct:
- Infrastructure — networks, databases, storage, identity, clusters.
- Deployment — placing a release into an environment.
- Configuration — runtime behavior and non-secret settings.
- Secrets — protected values stored outside version control.
Step 13: Make development reproducible
Recommended conditional files:
.devcontainer/
├── devcontainer.json
└── DockerfileAlso consider:
.nvmrc
.python-version
.tool-versions
mise.toml
Dockerfile
compose.yamlThe goal is to prevent:
- runtime version drift;
- missing system dependencies;
- inconsistent test results;
- agents using unapproved tools;
- “works on my machine” failures.
Step 14: Add security structure
Recommended:
security/
├── threat-model.md
├── data-classification.md
├── secrets-policy.md
├── access-control.md
├── dependency-policy.md
├── secure-coding.md
├── vulnerability-management.md
├── incident-response.md
└── sbom/Threat model
Document:
- sensitive assets;
- trust boundaries;
- roles;
- entry points;
- abuse cases;
- external integrations;
- authentication threats;
- authorization threats;
- data leakage risks;
- availability risks;
- mitigations;
- residual risks.
SBOM
Generate a Software Bill of Materials for higher-assurance systems.
Possible outputs:
security/sbom/application.spdx.json
security/sbom/application.cdx.jsonPrefer generated SBOMs attached to build artifacts or releases over manually maintained inventories.
Build provenance
Add provenance for regulated, enterprise, public-package, containerized, or critical systems.
Step 15: Add observability and operational ownership
Recommended:
observability/
├── dashboards/
├── alerts/
├── logging/
├── metrics/
├── tracing/
├── synthetic-checks/
└── service-level-objectives/Cover:
- request volume;
- error rate;
- latency;
- queue depth;
- job failures;
- database connection usage;
- cache behavior;
- integration failures;
- authentication failures;
- business-critical operations.
Every important alert should define:
- owner;
- severity;
- notification path;
- linked runbook;
- recovery condition.
Step 16: Validate configuration
Recommended:
config/
├── development/
├── testing/
├── staging/
├── production/
├── schemas/
└── feature-flags/Rules:
- Validate configuration at startup.
- Fail fast when required values are missing.
- Never silently use development defaults in production.
- Keep secrets outside the repository.
- Document environment differences.
- Avoid scattered environment-name conditionals.
- Add a configuration schema when practical.
Step 17: Add conditional support files
API specifications
For HTTP APIs, events, or webhooks:
api/
├── openapi.yaml
├── asyncapi.yaml
├── schemas/
└── examples/CHANGELOG.md
Use when releases affect customers or other systems.
Suggested sections:
Added
Changed
Deprecated
Removed
Fixed
Security
Migration requiredCONTRIBUTING.md
Include:
- branch strategy;
- commit expectations;
- pull-request size;
- testing requirements;
- migration rules;
- documentation requirements;
- review process;
- release process;
- agent-use expectations.
CODEOWNERS
Example:
* @platform-team
/apps/web/ @frontend-team
/apps/api/ @backend-team
/database/migrations/ @database-team
/infra/ @platform-team
/security/ @security-teambenchmarks/
Use when performance is a formal requirement.
benchmarks/
├── api/
├── database/
├── frontend/
├── memory/
└── baselines/Store definitions and acceptable thresholds, not only screenshots.
Generated and ignored files
Usually ignore:
node_modules/
vendor/
.venv/
dist/
build/
coverage/
.cache/
.next/
.nuxt/
target/
__pycache__/
logs/
tmp/
.env
.env.*
*.log
*.sqlite
*.dbGenerated files may be committed only when deliberately required.
When generated files are versioned, document:
- their source;
- regeneration command;
- whether manual edits are forbidden;
- how CI checks freshness.
Never commit
Never commit:
- API keys;
- passwords;
- private keys;
- access tokens;
- cloud credentials;
- production
.envfiles; - real customer databases;
- production database dumps;
- personal data;
- authentication cookies;
- browser profiles;
- unredacted logs;
- private certificates;
- agent transcripts containing secrets;
- MCP credentials;
- sensitive local paths.
Do not allow agents to create uncontrolled scratch directories inside the repository.
Priority order for vibe coders
When the user cannot implement everything at once, prioritize in this order:
Priority 1: Immediate foundations
README.mdAGENTS.md- dependency manifest and lockfile
.gitignore.editorconfig.env.example- one stable task runner
scripts/verify- basic tests
- CI workflow
Priority 2: Intent and architecture
specs/templates/feature.mddocs/architecture/overview.mddocs/architecture/dependency-rules.mddocs/adr/- database migration rules
Priority 3: Production safety
SECURITY.mdsecurity/secrets-policy.mdsecurity/threat-model.md- backup and restore scripts
- deployment smoke tests
- runbooks
- observability
Priority 4: Agent maturity
- scoped
AGENTS.mdfiles; - agent workflows;
- task templates;
- evals;
- tool-specific adapters;
- reusable skills.
Recommended starter files
For a new agent-driven production project, create these first:
AGENTS.md
README.md
.env.example
.editorconfig
.gitignore
Makefile
scripts/verify
specs/templates/feature.md
docs/architecture/overview.md
docs/architecture/dependency-rules.md
security/secrets-policy.md
security/threat-model.md
tests/
.github/workflows/ci.ymlThe five highest-value files for agent behavior are:
AGENTS.md
specs/templates/feature.md
scripts/verify
docs/architecture/overview.md
security/secrets-policy.mdThey provide:
- context;
- a task contract;
- a verification mechanism;
- architectural boundaries;
- security limits.
Production-readiness audit
When auditing an existing codebase, check each domain.
Repository clarity
- Is the project purpose documented?
- Is the repository map accurate?
- Are setup, run, test, build, and deploy commands documented?
- Are generated and protected files identified?
- Can a new agent navigate without guessing?
Reproducibility
- Are runtime versions pinned?
- Is the dependency lockfile committed?
- Is setup automated?
- Is configuration validated?
- Can the environment be recreated?
Specifications
- Are features documented before implementation?
- Are business rules explicit?
- Are permissions and error cases documented?
- Are acceptance criteria testable?
- Are API and data changes described?
Testing
- Are business rules covered by unit tests?
- Are database and integration paths tested?
- Are critical journeys covered by end-to-end tests?
- Are deployment smoke tests present?
- Do fixed bugs receive regression tests?
Architecture
- Are dependency boundaries documented?
- Are major decisions recorded?
- Are shared packages controlled?
- Are circular dependencies prevented?
- Are public interfaces versioned?
Database safety
- Are schema changes migration-based?
- Are destructive changes reviewed?
- Are backups and restores tested?
- Is production data absent from the repository?
- Is rollback or forward-fix documented?
Security
- Are secrets externalized?
- Is vulnerability reporting documented?
- Is there a threat model?
- Are dependencies scanned?
- Are authorization boundaries tested?
- Are logs protected from sensitive data leakage?
CI/CD
- Does CI run from the lockfile?
- Does one command perform full local verification?
- Are production environments protected?
- Is the deployed artifact identical to the tested artifact?
- Are migration and rollback steps automated or documented?
Observability
- Are logs structured?
- Are metrics and traces available where needed?
- Are critical alerts configured?
- Does each alert have an owner and runbook?
- Are business-critical operations observable?
Recovery
- Are backup procedures documented?
- Has restore been tested?
- Are failed deployment and incident runbooks available?
- Are credential rotation steps documented?
- Can the team recover without the original author?
Agent safety
- Are agent permissions explicit?
- Are prohibited files and commands documented?
- Must agents run verification?
- Must they disclose failed checks?
- Are database, network, and dependency operations constrained?
- Are agent outputs reviewable and traceable?
Definition of done for repository setup
A repository-structure task is complete only when:
- the proposed structure matches the actual project profile;
- every recommended item is classified as must-have, conditional, good-to-have, or agent-critical;
- the root files have clear responsibilities;
- one full verification command is defined;
- specifications and acceptance criteria have a home;
- architecture boundaries are documented;
- database changes have a safe workflow;
- secrets are excluded from version control;
- CI validates code quality and tests;
- deployment and recovery paths are documented;
- agent permissions and completion rules are explicit;
- unnecessary enterprise complexity has been avoided.
Common anti-patterns
Avoid:
- creating dozens of empty folders with no owner or purpose;
- placing all documentation in one giant README;
- using chat history as the only specification;
- maintaining conflicting instruction files for different agents;
- allowing agents to invent architecture while implementing;
- deleting failing tests to pass CI;
- allowing direct production database changes;
- committing real
.envfiles; - rebuilding different code during production deployment;
- creating alerts without owners or runbooks;
- writing backup instructions without testing restoration;
- treating generated code as automatically trustworthy;
- claiming production readiness without evidence.
Output format
When helping a user, provide:
- Project profile
- Recommended repository tree
- Must-have files
- Conditional files
- Good-to-have additions
- Agent-specific structure
- Implementation priority
- Production-readiness gaps
- Definition of done
For an existing repository, distinguish:
- already present;
- missing;
- incomplete;
- unnecessary;
- high-risk.
Prefer a practical phased plan over an enormous undifferentiated checklist.
Final quality standard
The structure should allow a competent developer or coding agent to:
- understand the system;
- find the right code;
- make a scoped change;
- follow architecture and security rules;
- test the change;
- explain the evidence;
- deploy safely;
- diagnose failures;
- restore service.
If any of those actions still depends on undocumented tribal knowledge, the repository is not yet production-grade.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

