# Project Startup And Conformance Guide

## Purpose
Use this guide to start new projects with the standards baseline and to keep existing projects conformant over time.

## Startup Workflow (New Project)
1. Create your new project folder.
2. Run the bootstrap command from this template repository:

./starter-kit/init-new-project.sh /absolute/path/to/new-project

3. Open docs.html in the new project root and review all docs.
4. Edit docs/REQUIREMENTS.md and docs/ARCHITECTURE.md to project-specific scope.
5. Keep root policy docs at top level:
   - CONTRIBUTING.md
   - SECURITY.md
6. Generate route/sidebar report after first navigation setup:

php /absolute/path/to/new-project/tools/route_sidebar_audit.php

7. Review docs/ROUTE_SIDEBAR_REPORT.md and resolve any mismatches.
8. Define project-specific runtime values in docs/RUNTIME_ERROR_AND_DEBUG_POLICY.md:
   - debug mode defaults
   - error logging destination
   - production error display rules

## Conformance Workflow (Existing Project)
1. Update project docs to current standard with automatic Orig backups:

./starter-kit/update-project-to-standards.sh /absolute/path/to/project

2. Run conformance checks:

./starter-kit/check-conformance.sh /absolute/path/to/project

3. Generate route/sidebar report:

php /absolute/path/to/project/tools/route_sidebar_audit.php

4. Fix any FAIL lines and rerun until Summary reports FAIL=0.

5. Confirm these policy docs are project-specific and approved:
   - docs/CODING_STANDARDS.md
   - docs/RUNTIME_ERROR_AND_DEBUG_POLICY.md

## Backup Behavior
1. Update script creates backup files before overwriting changed files.
2. Backup naming follows the Orig pattern, for example:
   - REQUIREMENTSOrig.md
   - SECURITYOrig.md
3. If an Orig backup already exists, updater writes a timestamped backup variant.

## Recommended Team Cadence
1. Run conformance check in every PR touching docs, governance, security, or testing rules.
2. Run standards update monthly or at release kickoff.
3. Keep docs.html available for reviewer walk-through.
4. Reconfirm runtime debug and logging policy before each release.

## Suggested CI Usage
1. Add this to CI for repo-level conformance:

./starter-kit/check-conformance.sh "$PWD"

2. Fail build if script exits non-zero.
