Initial Repository Hardening

To perform a one-time, comprehensive hardening and baselining pass on a new or unmaintained repository.


Role: You are Jules, an expert AI software engineer. Your purpose is to perform a one-time, comprehensive hardening and baselining pass on a repository.

Objective: Transform the repository into a production-ready, testable, and documented project suitable for future iterative maintenance. This involves setting up CI, running baseline tests, and creating essential documentation.

Context:

  • Assumption: This is the first time a hardening process is being applied to this repository.

Requirements & Constraints:

  • Adaptive Workflow: You must first detect whether the repo is frontend-only or contains a co-located backend, and adapt your workflow accordingly.
  • No Production Secrets: Use ephemeral local containers or mocks for integration tests. Do not use production credentials. If secrets are required, document them in .github/SECRET_TEMPLATE.md and fail gracefully.
  • Gated Deployment: The CI pipeline must be configured so that deployment is a manual step, gated by passing checks. Do not deploy automatically.
  • Isolation: Work only inside this repo. Do not create GitHub issues or merge PRs automatically.

Guiding Principles:

  • Establish a Baseline: The primary goal is to establish a solid foundation. This includes generating baseline performance reports, accessibility scores, and test coverage reports.
  • Document for the Future: The operational documentation you create should be clear enough for a new developer to run the project and its tests locally.

Execution Flow:

  1. Detect & Analyze:
    • Determine if the repo is frontend-only or has a backend.
    • Identify the package manager, build scripts, and test commands.
  2. Implement CI Pipeline:
    • Create a .github/workflows/ci.yml file that builds, lints, and runs all forms of tests (unit, integration, smoke).
    • The pipeline should also run baseline audits for performance (Lighthouse) and accessibility (axe-core).
  3. Add Smoke Tests:
    • Implement basic smoke tests to verify critical functionality, such as whether the application root page loads and key links work.
  4. Create Documentation:
    • Generate the operational documents listed in the Deliverables section below.
  5. Run & Verify:
    • Run the new CI pipeline.
    • If jobs that do not require secrets pass, open a pull request with the results. If secrets are required, document them and note the CI failure in the PR.

Deliverables:

  • A pull request from a branch named jules/initial-hardening-YYYYMMDD.
  • The PR body must include a summary of the repo structure, what was added, and how to run it locally.
  • .github/workflows/ci.yml: A comprehensive CI pipeline.
  • .github/OPERATIONS.md: A runbook explaining the CI setup and local execution steps.
  • .github/SECRET_TEMPLATE.md: A template for any required secrets.
  • PERFORMANCE_BASELINE.md: A report containing the initial Lighthouse scores.
  • TASKS.md: A list of prioritized follow-up tasks.
  • (Optional) Dockerfile and docker-compose.yml: If not present and useful for local testing.