Part VIII - Project Structure and Organization

v2026.04.12

Comprehensive standards for project structure, directory organization, file naming conventions, configuration management, dependency management, build and deployment processes, versioning, release management, and version control workflows within the AI Constitution framework.

GitHub
CLI command
npx skhub add Divith123/part-viii-project-structure-and-organization
Markdown
SKILL.md

PART VIII

PROJECT STRUCTURE AND ORGANIZATION


Preamble to Project Structure Standards

We, the AI Agents operating within this constitutional framework, recognizing that well-organized projects are essential for maintainability, scalability, and collaborative development, do hereby establish these project structure and organization standards as mandatory requirements that shall govern all codebases developed within this framework.

These standards exist because:

  1. Consistent structure enables navigation by making codebase layout predictable
  2. Clear organization reduces cognitive load by grouping related concerns
  3. Standardized configuration prevents drift by establishing authoritative sources
  4. Proper versioning ensures reliability by tracking changes systematically
  5. Organized releases enable trust by providing clear upgrade paths

Every AI Agent shall treat these standards as foundational requirements that must be established before any significant development begins.


ARTICLE 1: DIRECTORY STRUCTURE STANDARDS

Section 1.1 - Statement of Requirement

All projects must follow a consistent, well-documented directory structure.

Directory structure requirements:

  1. Logical separation of concerns
  2. Clear separation between source, configuration, and artifacts
  3. Consistent naming across all projects
  4. Self-documenting structure
  5. Minimal nesting (maximum 4 levels deep)

Section 1.2 - Standard Directory Layout

project-root/
├── .github/                    # GitHub configuration
│   ├── ISSUE_TEMPLATE/         # Issue templates
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/              # GitHub Actions workflows
├── .husky/                     # Git hooks configuration
├── .vscode/                    # VS Code settings
│   ├── extensions.json
│   └── settings.json
├── docs/                       # Documentation
│   ├── api/
│   ├── architecture/
│   └── guides/
├── scripts/                    # Build and utility scripts
├── src/                        # Source code
│   ├── components/             # Reusable components
│   ├── features/               # Feature modules
│   ├── services/               # Service layer
│   ├── utils/                  # Utility functions
│   ├── types/                  # TypeScript type definitions
│   └── index.ts                # Main entry point
├── tests/                      # Test files (mirrors src structure)
│   ├── unit/
│   ├── integration/
│   └── e2e/
├── config/                     # Configuration files
│   ├── development/
│   ├── staging/
│   └── production/
├── tools/                      # Development tools
├── .env.example                # Environment variable template
├── .eslintrc.js                # ESLint configuration
├── .prettierrc                 # Prettier configuration
├── tsconfig.json               # TypeScript configuration
├── package.json                # Package definition
├── README.md                   # Project documentation
└── CONTRIBUTING.md             # Contribution guidelines

Section 1.3 - Directory Naming Conventions

DirectoryPurposeNaming
Source codeApplication codesrc/
TestsTest filestests/ or __tests__/
ConfigurationConfig filesconfig/ or configs/
DocumentationDocsdocs/ or documentation/
ScriptsBuild/utility scriptsscripts/ or scripts/
BinariesCompiled outputdist/ or build/
DependenciesInstalled packagesnode_modules/
AssetsStatic filesassets/ or public/
TypesTypeScript typestypes/ or @types/
UtilsUtility functionsutils/ or utilities/

Section 1.4 - Feature-Based Directory Structure

For larger applications, organize by feature:

src/
├── features/
│   ├── auth/
│   │   ├── components/
│   │   ├── services/
│   │   ├── hooks/
│   │   ├── types/
│   │   ├── utils/
│   │   ├── auth.test.ts
│   │   └── index.ts
│   ├── users/
│   │   ├── components/
│   │   ├── services/
│   │   ├── hooks/
│   │   ├── types/
│   │   ├── utils/
│   │   ├── users.test.ts
│   │   └── index.ts
│   ├── orders/
│   │   ├── components/
│   │   ├── services/
│   │   ├── hooks/
│   │   ├── types/
│   │   ├── utils/
│   │   ├── orders.test.ts
│   │   └── index.ts
│   └── products/
│       └── ...
├── shared/
│   ├── components/
│   ├── hooks/
│   ├── utils/
│   └── types/
└── app/
    └── main entry point

ARTICLE 2: FILE NAMING STANDARDS

Section 2.1 - Statement of Requirement

All files must follow consistent, descriptive naming conventions.

File naming requirements:

  1. Use kebab-case for most files
  2. Use PascalCase for components
  3. Use descriptive names that indicate purpose
  4. Include file type suffix
  5. Group related files with consistent prefixes

Section 2.2 - File Naming Conventions Table

File TypeConventionExample
TypeScript sourcekebab-caseuser-service.ts
React componentPascalCaseUserProfile.tsx
Type definitionskebab-caseuser.types.ts
Test fileskebab-case + .testuser-service.test.ts
Style fileskebab-casebutton-styles.css
Configurationdot-prefix.eslintrc.js
Environmentdot-prefix.env.production
Markdown docskebab-casegetting-started.md

Section 2.3 - File Naming Examples

// Service files
user-service.ts
order-service.ts
payment-service.ts
notification-service.ts

// Component files
UserProfile.tsx
OrderList.tsx
PaymentForm.tsx
NotificationBell.tsx

// Hook files (if using hooks directory)
use-user-data.ts
use-authentication.ts
use-shopping-cart.ts

// Utility files
date-formatter.ts
currency-formatter.ts
validators.ts
constants.ts

// Type definition files
user.types.ts
order.types.ts
payment.types.ts
api.types.ts

// Test files
user-service.test.ts
user-service.integration.test.ts
user-service.e2e.test.ts

// Configuration files
.eslintrc.js
.prettierrc
tsconfig.json
jest.config.js

ARTICLE 3: CONFIGURATION MANAGEMENT STANDARDS

Section 3.1 - Statement of Requirement

Configuration must be centralized, documented, and environment-aware.

Configuration requirements:

  1. No hardcoded configuration values
  2. Environment-specific configuration files
  3. Secrets managed via environment variables
  4. Configuration validated at startup
  5. Configuration schema documented

Section 3.2 - Environment Configuration Structure

// config/index.ts
import { validateEnvironment } from './validation';
import { getEnvironment } from './environment';

const config = {
    app: {
        name: process.env.APP_NAME || 'MyApp',
        port: parseInt(process.env.PORT || '3000', 10),
        env: getEnvironment(),
    },
    
    database: {
        host: getRequiredEnv('DB_HOST'),
        port: parseInt(getRequiredEnv('DB_PORT'), 10),
        name: getRequiredEnv('DB_NAME'),
        user: getRequiredEnv('DB_USER'),
        password: getRequiredEnv('DB_PASSWORD'),
        ssl: process.env.DB_SSL === 'true',
        pool: {
            min: parseInt(process.env.DB_POOL_MIN || '2', 10),
            max: parseInt(process.env.DB_POOL_MAX || '10', 10),
        },
    },
    
    cache: {
        host: getRequiredEnv('REDIS_HOST'),
        port: parseInt(getRequiredEnv('REDIS_PORT'), 10),
        password: process.env.REDIS_PASSWORD,
        ttl: parseInt(process.env.REDIS_TTL || '3600', 10),
    },
    
    logging: {
        level: process.env.LOG_LEVEL || 'info',
        format: process.env.LOG_FORMAT || 'json',
    },
    
    features: {
        enableNewCheckout: process.env.FEATURE_NEW_CHECKOUT === 'true',
        enableBetaFeatures: process.env.FEATURE_BETA === 'true',
    },
    
    rateLimit: {
        windowMs: parseInt(process.env.RATE_LIMIT_WINDOW || '60000', 10),
        maxRequests: parseInt(process.env.RATE_LIMIT_MAX || '100', 10),
    },
};

export type Config = typeof config;
export { config };

Section 3.3 - Environment File Structure

project-root/
├── .env                      # Default (development)
├── .env.local               # Local overrides (gitignored)
├── .env.development         # Development overrides
├── .env.staging             # Staging environment
├── .env.production          # Production environment
└── .env.test                # Test environment

Section 3.4 - Environment Variable Standards

# .env.example - Document all environment variables

# Application
APP_NAME="My Application"
PORT=3000
NODE_ENV=development

# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=myapp_dev
DB_USER=postgres
DB_PASSWORD= # Set in .env.local
DB_SSL=false

# Cache
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD= # Set in .env.local

# External Services
API_KEY= # Set in .env.local
API_SECRET= # Set in .env.local

# Feature Flags
FEATURE_NEW_CHECKOUT=false
FEATURE_BETA=false

# Rate Limiting
RATE_LIMIT_WINDOW=60000
RATE_LIMIT_MAX=100

# Logging
LOG_LEVEL=info
LOG_FORMAT=json

ARTICLE 4: DEPENDENCY MANAGEMENT STANDARDS

Section 4.1 - Statement of Requirement

Dependencies must be carefully selected, regularly updated, and minimally used.

Dependency requirements:

  1. No unnecessary dependencies
  2. Dependencies actively maintained
  3. Version constraints defined
  4. Dependencies audited for security
  5. Tree-shaking support preferred

Section 4.2 - Dependency Categories

{
    "dependencies": {
        "express": "^4.18.2",
        "zod": "^3.22.0",
        "winston": "^3.11.0",
        "uuid": "^9.0.0"
    },
    "devDependencies": {
        "typescript": "^5.3.0",
        "eslint": "^8.55.0",
        "prettier": "^3.1.0",
        "jest": "^29.7.0",
        "@types/node": "^20.10.0",
        "husky": "^8.0.3",
        "lint-staged": "^15.2.0"
    },
    "peerDependencies": {
        "react": ">=17.0.0",
        "react-dom": ">=17.0.0"
    },
    "optionalDependencies": {
        "sharp": "^0.33.0"
    }
}

Section 4.3 - Dependency Update Policy

Dependency TypeUpdate FrequencyApproval Required
Major versionsAnnuallyYes
Minor versionsQuarterlyNo
Patch versionsMonthlyNo
Security patchesImmediatelyNo

Section 4.4 - Dependency Audit Requirements

AI Agents MUST:

  1. Run npm audit before every release
  2. Fix critical vulnerabilities immediately
  3. Fix high vulnerabilities within 7 days
  4. Document any accepted vulnerabilities
  5. Update dependencies regularly

ARTICLE 5: MONOREPO GOVERNANCE STANDARDS

Section 5.1 - Statement of Requirement

Monorepos must have clear boundaries, shared configuration, and controlled dependencies.

Monorepo requirements:

  1. Shared configuration at root
  2. Clear package boundaries
  3. Controlled cross-package dependencies
  4. Consistent tooling across packages
  5. Independent deployability where needed

Section 5.2 - Monorepo Structure

monorepo-root/
├── package.json              # Root package.json
├── package-lock.json
├── tsconfig.base.json        # Shared TypeScript config
├── .eslintrc.base.js         # Shared ESLint config
├── .prettierrc               # Shared Prettier config
├── jest.config.base.js       # Shared Jest config
├── turbo.json                # Turborepo config
├── packages/
│   ├── shared/               # Shared utilities
│   │   ├── package.json
│   │   ├── tsconfig.json
│   │   └── src/
│   │       ├── types/
│   │       ├── utils/
│   │       └── index.ts
│   ├── ui/                   # UI components
│   │   ├── package.json
│   │   ├── tsconfig.json
│   │   └── src/
│   │       ├── components/
│   │       └── index.ts
│   ├── api/                  # API server
│   │   ├── package.json
│   │   ├── tsconfig.json
│   │   └── src/
│   │       ├── routes/
│   │       ├── services/
│   │       └── index.ts
│   └── docs/                 # Documentation
│       └── ...
├── apps/
│   ├── web/                  # Web application
│   │   ├── package.json
│   │   └── src/
│   ├── mobile/               # Mobile application
│   │   └── ...
│   └── desktop/              # Desktop application
│       └── ...
└── scripts/                  # Monorepo scripts
    ├── build-all.ts
    ├── test-all.ts
    └── publish.ts

Section 5.3 - Monorepo Configuration Files

// tsconfig.base.json
{
    "compilerOptions": {
        "target": "ES2022",
        "module": "ESNext",
        "lib": ["ES2022"],
        "moduleResolution": "bundler",
        "strict": true,
        "esModuleInterop": true,
        "skipLibCheck": true,
        "forceConsistentCasingInFileNames": true,
        "declaration": true,
        "declarationMap": true,
        "sourceMap": true,
        "composite": true
    }
}
// turbo.json
{
    "$schema": "https://turbo.build/schema.json",
    "pipeline": {
        "build": {
            "dependsOn": ["^build"],
            "outputs": ["dist/**", ".next/**"]
        },
        "test": {
            "dependsOn": ["build"],
            "outputs": ["coverage/**"]
        },
        "lint": {
            "outputs": []
        },
        "dev": {
            "cache": false,
            "persistent": true
        }
    }
}

ARTICLE 6: BUILD AND DEPLOYMENT STANDARDS

Section 6.1 - Statement of Requirement

Build and deployment must be automated, reproducible, and documented.

Build/deployment requirements:

  1. CI/CD pipeline for all environments
  2. Reproducible builds
  3. Automated testing
  4. Environment-specific configurations
  5. Rollback capability

Section 6.2 - Build Pipeline Standards

# .github/workflows/build.yml
name: Build and Test

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main, develop]

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      
  typecheck:
    name: Type Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run typecheck
      
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run test:ci
      
  build:
    name: Build
    runs-on: ubuntu-latest
    needs: [lint, typecheck, test]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: dist
          path: dist/

Section 6.3 - Deployment Pipeline

# .github/workflows/deploy.yml
name: Deploy

on:
  push:
    tags:
      - 'v*'

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  deploy-staging:
    name: Deploy to Staging
    runs-on: ubuntu-latest
    if: contains(github.ref, 'develop')
    environment: staging
    steps:
      - uses: actions/checkout@v4
      - uses: docker/setup-buildx-action@v3
      - uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:staging
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Deploy to staging
        run: |
          kubectl set image deployment/app app=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:staging
          --namespace=staging

  deploy-production:
    name: Deploy to Production
    runs-on: ubuntu-latest
    needs: [deploy-staging]
    if: contains(github.ref, 'main')
    environment: production
    steps:
      - uses: actions/checkout@v4
      - uses: docker/setup-buildx-action@v3
      - uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: |
            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Deploy to production
        run: |
          kubectl set image deployment/app app=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
          --namespace=production

Section 6.4 - Build Environment Requirements

EnvironmentNode VersionCacheArtifacts
DevelopmentLatest LTSYesNone
CI/CDExact versionYesdist/
StagingExact versionYesDocker image
ProductionExact versionYesDocker image

ARTICLE 7: VERSIONING STANDARDS

Section 7.1 - Statement of Requirement

All projects must follow Semantic Versioning (SemVer).

Versioning requirements:

  1. Use major.minor.patch format
  2. Increment appropriately based on changes
  3. Pre-release versions for unstable releases
  4. No breaking changes in minor/patch
  5. Document all breaking changes

Section 7.2 - Semantic Versioning Rules

Change TypeExampleIncrement
Bug fixesFix user loginpatch: 1.0.0 → 1.0.1
New featuresAdd dark modeminor: 1.0.0 → 1.1.0
Breaking changesRename APImajor: 1.0.0 → 2.0.0
DeprecationsMark old methodminor: 1.0.0 → 1.1.0
Security patchesFix vulnerabilitypatch: 1.0.0 → 1.0.1

Section 7.3 - Version Number Examples

# Version formats
1.0.0                    # Release version
1.0.0-alpha.1           # Alpha release
1.0.0-beta.1            # Beta release
1.0.0-rc.1               # Release candidate
1.0.0+build.123          # Build metadata

# npm version commands
npm version major        # 1.0.0 → 2.0.0
npm version minor        # 1.0.0 → 1.1.0
npm version patch        # 1.0.0 → 1.0.1
npm version prerelease   # 1.0.0 → 1.0.1-alpha.1

Section 7.4 - Breaking Change Standards

Breaking changes include:

  1. API Changes

    • Removing endpoints
    • Changing parameter names
    • Changing response structure
    • Changing authentication methods
  2. Data Changes

    • Database schema changes
    • Changing data types
    • Removing fields
  3. Behavior Changes

    • Changing default values
    • Changing error messages
    • Changing validation rules
  4. Dependency Changes

    • Upgrading to incompatible versions
    • Removing dependencies

ARTICLE 8: RELEASE MANAGEMENT STANDARDS

Section 8.1 - Statement of Requirement

Releases must be planned, tested, documented, and reversible.

Release requirements:

  1. Release planning and scheduling
  2. Feature freezes before releases
  3. Comprehensive testing
  4. Changelog documentation
  5. Rollback procedures defined

Section 8.2 - Release Types

Release TypeFrequencyScopeTesting
HotfixAs neededCritical fixesFull
PatchMonthlyBug fixesFull
MinorQuarterlyNew featuresFull + Integration
MajorAnnuallyBreaking changesFull + Migration
BetaAs neededPre-release testingFull

Section 8.3 - Release Checklist

RELEASE CHECKLIST
=================

PRE-RELEASE (1 week before):
[ ] All features merged
[ ] Code freeze in effect
[ ] Migration guide drafted
[ ] Changelog updated
[ ] Release notes drafted

TESTING:
[ ] Unit tests passing (100%)
[ ] Integration tests passing
[ ] E2E tests passing
[ ] Performance tests passing
[ ] Security scan complete
[ ] Accessibility audit complete
[ ] Browser compatibility tested

ARTIFACTS:
[ ] Build succeeds
[ ] Docker image built
[ ] Image pushed to registry
[ ] Documentation published

COMMUNICATION:
[ ] Changelog published
[ ] Release notes published
[ ] Stakeholders notified
[ ] Support team briefed
[ ] Marketing informed (if needed)

DEPLOYMENT:
[ ] Deployment plan reviewed
[ ] Rollback plan tested
[ ] Monitoring dashboards ready
[ ] Alerts configured
[ ] Runbook updated

POST-RELEASE:
[ ] Smoke tests passed
[ ] Monitoring healthy
[ ] No critical errors
[ ] Users notified

Section 8.4 - Release Process

# 1. Create release branch
git checkout develop
git pull origin develop
git checkout -b release/v1.2.0

# 2. Update version
npm version minor  # or major/patch

# 3. Update changelog
# Edit CHANGELOG.md with release notes

# 4. Run final checks
npm run lint
npm run typecheck
npm run test:ci
npm run build

# 5. Merge to main
git checkout main
git merge release/v1.2.0
git tag v1.2.0
git push origin main --tags

# 6. Merge back to develop
git checkout develop
git merge release/v1.2.0
git push origin develop

# 7. Create GitHub release
gh release create v1.2.0 \
  --title "Release v1.2.0" \
  --notes "$(cat CHANGELOG.md)"

ARTICLE 9: BRANCHING STRATEGY STANDARDS

Section 9.1 - Statement of Requirement

All development must follow a consistent branching strategy.

Branching requirements:

  1. Feature branches from appropriate base
  2. Protected main branch
  3. Clean branch naming
  4. Regular synchronization
  5. Branch age limits

Section 9.2 - Branch Types

BranchPurposeNamingLifetime
mainProduction codemainPermanent
developIntegrationdevelopPermanent
feature/*New featuresfeature/JIRA-123-feature-nameUntil merged
bugfix/*Bug fixesbugfix/JIRA-456-fix-loginUntil merged
hotfix/*Urgent fixeshotfix/JIRA-789-security-patchUntil merged
release/*Release preprelease/v1.2.0Until released

Section 9.3 - Branch Naming Conventions

# Feature branches
feature/JIRA-123-add-user-authentication
feature/JIRA-456-implement-shopping-cart
feature/add-dark-mode

# Bug fix branches
bugfix/JIRA-789-fix-login-redirect
bugfix/JIRA-101-fix-payment-validation
bugfix/resolve-memory-leak

# Hotfix branches
hotfix/JIRA-202-security-patch-cve
hotfix/JIRA-203-critical-data-loss

# Release branches
release/v1.2.0
release/v2.0.0-rc.1

# Chore branches
chore/JIRA-204-update-dependencies
chore/JIRA-205-refactor-user-service

Section 9.4 - Git Flow Workflow

main ────────────────────────────────────────────►
         ↑                       ↑         ↑
         │ merge                 │ merge   │ merge (hotfix)
         │                       │         │
     release/v1.0.0          release/v1.1.0   hotfix/v1.0.1
         │                       │         │
         │ merge                 │ merge   │
         ↓                       ↓         │
develop ──────────────────────────────────────►
                ↑                       ↑
                │                       │
            feature/*               feature/*
            feature/JIRA-123         feature/JIRA-456

ARTICLE 10: GIT COMMIT STANDARDS

Section 10.1 - Statement of Requirement

All commits must follow Conventional Commits specification.

Commit requirements:

  1. Meaningful commit messages
  2. Conventional commit format
  3. Atomic commits (one change per commit)
  4. Reference to issue tracker
  5. No meaningless commits

Section 10.2 - Conventional Commits Format

<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Section 10.3 - Commit Types

TypeDescriptionExample
featNew featurefeat(auth): add OAuth2 login
fixBug fixfix(cart): resolve quantity calculation
docsDocumentationdocs: update README
styleFormattingstyle: format with Prettier
refactorCode restructurerefactor(user): extract validation
perfPerformanceperf(api): optimize query
testTeststest(auth): add login tests
buildBuild systembuild: update webpack config
ciCI/CDci: add GitHub Actions
choreMaintenancechore: update dependencies
revertRevert commitrevert: revert "feat: add feature"

Section 10.4 - Commit Message Examples

# Simple commit
git commit -m "fix(auth): resolve login redirect issue"

# Commit with scope
git commit -m "feat(checkout): add coupon code support"

# Commit with body
git commit -m "feat(payments): add Stripe webhook support

Implements webhook endpoint for handling payment events from Stripe.
Supports payment.succeeded and payment.failed events.

Closes JIRA-123"

# Commit with footer
git commit -m "fix(api): handle null response from external API

The external API sometimes returns null instead of an object.
Now gracefully handles this case by returning an empty array.

Closes JIRA-456
Refs JIRA-789"

# Commit with breaking change
git commit -m "feat(api)!: change user endpoint response format

BREAKING CHANGE: The /api/users endpoint now returns an object
with 'data' and 'meta' properties instead of a flat array.

Migration guide: https://docs.example.com/migration/v2"

Section 10.5 - Commit Rules

  1. First line limit: 72 characters maximum
  2. Use imperative mood: "Add feature" not "Added feature"
  3. No period at end: "Add feature" not "Add feature."
  4. Reference issues: Include JIRA ticket numbers
  5. One change per commit: Don't mix unrelated changes
  6. Atomic commits: Each commit should be self-contained

ARTICLE 11: PULL REQUEST STANDARDS

Section 11.1 - Statement of Requirement

All changes must go through pull request review.

Pull request requirements:

  1. Descriptive title and description
  2. Linked issues
  3. Passing CI/CD
  4. Code review approval
  5. Squash merge to main

Section 11.2 - Pull Request Template

## Description

<!-- Describe what this PR does and why -->

## Type of Change

- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change (fix or feature)
- [ ] This change requires a documentation update

## Checklist

- [ ] My code follows the style guidelines
- [ ] I have performed a self-review
- [ ] I have commented my code where necessary
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix
- [ ] New and existing tests pass locally
- [ ] Any dependent changes have been merged

## Screenshots (if applicable)

<!-- Add screenshots for UI changes -->

## Related Issues

<!-- Link related issues: Closes #123, Related to #456 -->

## Notes for Reviewers

<!-- Any additional context for reviewers -->

Section 11.3 - Pull Request Checklist

PULL REQUEST CHECKLIST
======================

BEFORE SUBMITTING:
[ ] Code follows style guidelines
[ ] Self-review completed
[ ] Tests added/updated
[ ] Documentation updated
[ ] No console.log/debugger
[ ] No TODO comments
[ ] No placeholder values
[ ] No hardcoded secrets

DESCRIPTION:
[ ] Clear title
[ ] Detailed description
[ ] Screenshots (if UI)
[ ] Breaking changes noted
[ ] Migration guide (if needed)

TESTING:
[ ] Local testing complete
[ ] CI/CD passing
[ ] Manual testing (if needed)
[ ] Edge cases considered

REVIEW:
[ ] Reviewer assigned
[ ] All comments addressed
[ ] Approval received
[ ] No unresolved discussions

Section 11.4 - Code Review Standards

// Code review guidelines for reviewers

REVIEWER RESPONSIBILITIES:

1. Logic and correctness
   - Does the code do what it claims?
   - Are there edge cases not handled?
   - Could this break existing functionality?

2. Security
   - Any security vulnerabilities?
   - Input properly validated?
   - Secrets properly managed?

3. Performance
   - Any obvious performance issues?
   - N+1 query patterns?
   - Unnecessary re-renders?

4. Maintainability
   - Is the code readable?
   - Is it consistent with existing code?
   - Are there tests?

REVIEW FEEDBACK:

// DO:
// - Be specific about what needs to change
// - Explain why something is an issue
// - Suggest alternatives
// - Be respectful and constructive

// DON'T:
// - "LGTM" without explanation
// - Nitpick style issues (use linting)
// - Block for minor preferences
// - Be rude or dismissive

ARTICLE 12: CODE FREEZE STANDARDS

Section 12.1 - Statement of Requirement

Code freezes must be scheduled, communicated, and enforced.

Code freeze requirements:

  1. Advance notice of freeze dates
  2. Exception process defined
  3. Emergency exception procedure
  4. Freeze duration limits
  5. Clear scope of restrictions

Section 12.2 - Code Freeze Types

TypeDurationAllowed Changes
Minor Release1-2 weeksBug fixes only
Major Release2-4 weeksCritical bug fixes only
SecurityImmediateSecurity patches only
ExtendedAs neededExceptions required

Section 12.3 - Code Freeze Procedure

CODE FREEZE PROCEDURE
=====================

INITIATION:
1. Announce code freeze 1 week in advance
2. Include: start date, end date, scope, exceptions

DURING FREEZE:
1. No new features merged
2. No non-critical changes merged
3. Bug fixes require bug report linked
4. All tests must pass
5. Two approvals required

EXCEPTIONS:
1. Critical bugs blocking release
2. Security vulnerabilities
3. Legal/compliance issues
4. Request via: exception-form.md

EMERGENCY HOTFIX:
1. Notify release manager
2. Create hotfix branch from release tag
3. Fast-track review (1 approver)
4. Direct merge to release branch
5. Document in incident report

Section 12.4 - Code Freeze Communication

# Code Freeze Announcement

**Subject:** CODE FREEZE for v1.2.0 Release - [DATE] to [DATE]

**Timeline:**
- Freeze starts: January 15, 2024 00:00 UTC
- Freeze ends: January 29, 2024 23:59 UTC
- Release target: January 30, 2024

**Scope:**
- Branch: release/v1.2.0
- Only bug fixes and documentation allowed

**Exceptions:**
- Critical bugs (P0/P1) only
- Submit exception request to #release-Exceptions channel

**Contact:**
- Release Manager: @release-manager
- Channel: #release-v1.2.0

ARTICLE 13: HOTFIX STANDARDS

Section 13.1 - Statement of Requirement

Hotfixes must be fast, focused, and follow emergency procedures.

Hotfix requirements:

  1. Critical only (data loss, security, service down)
  2. Minimal changes
  3. Fast-track review
  4. Immediate deployment
  5. Post-incident review

Section 13.2 - Hotfix Process

# HOTFIX PROCESS

# 1. Create hotfix branch from production tag
git checkout -b hotfix/v1.0.1 v1.0.0
git pull origin v1.0.0

# 2. Make minimal fix
# ... edit files ...
git add .
git commit -m "fix(critical): resolve data loss on edge case

Hotfix for JIRA-123

[Critical bug description and root cause]

Signed-off-by: Developer Name"

# 3. Fast-track review
# - One approval sufficient
# - Skip CI for trivial changes
# - Immediate review by on-call

# 4. Merge to production
git checkout main
git merge hotfix/v1.0.1
git tag v1.0.1
git push origin main --tags

# 5. Merge to develop
git checkout develop
git merge hotfix/v1.0.1
git push origin develop

# 6. Delete hotfix branch
git branch -d hotfix/v1.0.1
git push origin --delete hotfix/v1.0.1

# 7. Deploy immediately
# (trigger production deployment)

Section 13.3 - Hotfix Criteria

PriorityCriteriaExamples
P0Complete service outageDatabase down, auth broken
P1Major feature brokenPayments failing
P2Data loss riskCorruption possible
P3Security vulnerabilitySQL injection possible
P4Minor but quick fixTypo, minor bug

Section 13.4 - Hotfix Prevention

To minimize hotfixes:

  1. Thorough testing before release
  2. Feature flags for risky changes
  3. Canary deployments for gradual rollout
  4. Rollback plans ready
  5. Monitoring alerts configured
  6. Runbooks documented

ARTICLE 14: CHANGELOG STANDARDS

Section 14.1 - Statement of Requirement

All releases must have accurate, well-formatted changelogs.

Changelog requirements:

  1. Follow Keep a Changelog format
  2. Categorize changes appropriately
  3. Reference issues and PRs
  4. Maintain reverse chronological order
  5. Include migration notes

Section 14.2 - Changelog Format

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2024-01-15

### Added
- `feature:user-authentication`
  - OAuth2 login support for Google and GitHub
  - Multi-factor authentication (TOTP)
  - Password reset flow with email verification
- `feature:api-v2`
  - New REST API version with improved performance
  - GraphQL endpoint for complex queries

### Changed
- `breaking:user-endpoint`
  - User endpoint now returns `{ data, meta }` structure
  - See [Migration Guide v2](docs/migration-v2.md)
- `change:validation`
  - Email validation now follows RFC 5322 standard

### Deprecated
- `deprecate:api-v1`
  - `/api/v1/*` endpoints marked deprecated
  - Will be removed in v3.0.0
  - Migrate to `/api/v2/*`

### Removed
- `remove:legacy-auth`
  - Removed deprecated MD5 password hashing
  - Removed `remember_token` field

### Fixed
- `fix:payment-processing`
  - Resolved race condition in payment webhook handler
  - Closes #1234
- `fix:session-timeout`
  - Sessions now correctly timeout after 30 minutes
  - Closes #1235

### Security
- `security:cve-2024-1234`
  - Patched SQL injection vulnerability in search endpoint
  - Updated dependencies to patch known vulnerabilities

## [1.5.0] - 2023-10-01

### Added
- Dark mode support
- Export to CSV functionality

Section 14.3 - Changelog Categories

CategoryDescriptionBadge
AddedNew features🆕
ChangedChanges in existing functionality🔄
DeprecatedSoon-to-be removed features⚠️
RemovedRemoved features
FixedBug fixes🐛
SecuritySecurity patches🔒
PerformancePerformance improvements
BreakingBreaking changes (include migration)💥

Section 14.4 - Changelog Maintenance

# CHANGELOG MAINTENANCE

# 1. Update changelog with each PR
git log --oneline --decorate v1.0.0..HEAD | \
  while read commit msg; do
    # Parse conventional commit
    # Add to CHANGELOG.md
  done

# 2. Before release
# - Review all entries
# - Remove duplicate entries
# - Ensure consistent formatting
# - Add migration notes if needed

# 3. After release
# - Archive previous version
# - Reset for next version
# - Publish to release page

ARTICLE 15: DOCUMENTATION STANDARDS

Section 15.1 - Statement of Requirement

All projects must have comprehensive, up-to-date documentation.

Documentation requirements:

  1. README with getting started
  2. API documentation
  3. Architecture documentation
  4. Contribution guidelines
  5. Runbooks for operations

Section 15.2 - Required Documentation Files

FilePurposeLocation
README.mdProject overviewRoot
CONTRIBUTING.mdContribution guidelinesRoot
ARCHITECTURE.mdSystem architecturedocs/
API.mdAPI documentationdocs/
DEPLOYMENT.mdDeployment guidedocs/
CHANGELOG.mdVersion historyRoot
LICENSELicense fileRoot
CODE_OF_CONDUCT.mdCommunity guidelinesRoot

Section 15.3 - README Template

# Project Name

Brief description of what this project does.

## Features

- Feature 1
- Feature 2
- Feature 3

## Quick Start

### Prerequisites

- Node.js 18+
- PostgreSQL 14+
- Redis 6+

### Installation

\`\`\`bash
git clone <repository>
cd <project>
npm install
\`\`\`

### Configuration

\`\`\`bash
cp .env.example .env
# Edit .env with your configuration
\`\`\`

### Running

\`\`\`bash
# Development
npm run dev

# Production
npm run build
npm start
\`\`\`

## Testing

\`\`\`bash
npm test
npm run test:coverage
\`\`\`

## Documentation

For full documentation, see [docs/](docs/)

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)

## License

MIT License - see [LICENSE](LICENSE)

SCHEDULE: PROJECT STRUCTURE QUICK REFERENCE

Directory Structure

DirectoryPurposeRequired
src/Source codeYes
tests/Test filesYes
docs/DocumentationYes
config/ConfigurationYes
scripts/Build scriptsRecommended
.github/GitHub configYes

File Naming

TypeConventionExample
Source fileskebab-caseuser-service.ts
ComponentsPascalCaseUserProfile.tsx
Config filesdot-prefix.eslintrc.js
Test files.test suffixuser.test.ts

Version Control

ItemStandard
VersioningSemVer
Branch namingtype/JIRA-description
Commit formatconventionalcommits.org
PR requirementsTemplate + reviews

Release Process

PhaseDuration
Feature freeze1-2 weeks
Testing1 week
Code freeze1-2 weeks
ReleaseScheduled

GLOSSARY OF PROJECT STRUCTURE TERMS

Branch: A parallel line of development in Git.

Build: The process of compiling source code into deployable artifacts.

Changelog: A record of all notable changes made to a project.

Code Freeze: A period during which no new code is merged except critical fixes.

Commit: A snapshot of changes in Git.

Conventional Commits: A commit message format standard.

Dependency: An external package or library that a project uses.

Deploy: To release software to an environment.

Feature Branch: A branch created for developing a new feature.

Hotfix: An urgent fix deployed directly to production.

Main Branch: The primary branch containing production code.

Monorepo: A repository containing multiple projects.

Pull Request: A request to merge changes from one branch to another.

Release: A published version of software.

Rollback: To revert to a previous version.

Semantic Versioning: A versioning scheme using major.minor.patch.

SemVer: See Semantic Versioning.

Tag: A named reference to a specific commit.

Version: A specific release of software.


These project structure and organization standards are foundational. Deviation from these standards undermines project maintainability and team collaboration.

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.04.12

Published

Apr 12, 2026

Category

Uncategorized

License

MIT

Source path

skills/part-viii-project-structure

Default branch

main

Latest commit

ee1f44b

Tree SHA

3f7ce77