Home / Market / repo foundation

repo foundation

Implement features, fixes, modules, contract migrations, and resumed work while preserving user edits and authorized public contracts.

skill★ 509080 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: repo-foundation description: "Implement features, fixes, modules, contract migrations, and resumed work while preserving user edits and authorized public contracts." category: development risk: critical source: https://github.com/Natchannnn/repository-engineering-skills source_repo: Natchannnn/repository-engineering-skills source_type: community date_added: "2026-09-30" author: Natchannnn tags: [repository-engineering, feature-development, contract-migration, continuity] tools: [codex] license: MIT license_source: https://github.com/Natchannnn/repository-engineering-skills/blob/e55b378158d5134a77af3b8dace4a2a1b17e41e2/LICENSE metadata: version: "0.3.0" license: "MIT"

---

Repo foundation

When to Use

Build on a foundation that's just big enough, add features on top of it, and change the architecture only when requirements force it. Aim for the least total rework.

---

Core principles

---

Mode selection

| Mode | Trigger | Core Actions | Exit Criteria | |---|---|---|---| | Bootstrap | New repository from scratch or an area lacking minimal foundation (no build/test/run commands, conventions, or boundaries). | Elicit critical constraints, choose just-enough design, set up minimal tooling/checks, implement and verify the first representative slice. Read bootstrap. | Representative slice works and is verified; run/build commands are documented; repo is stable for subsequent work. | | Continue | Adding a feature, bugfix, or improvement on an existing, fitting foundation. | Determine owning domain and boundary, implement changes, run proportionate checks, and review diff. Executable directly from core. | Task requirements are met; diff is reviewed; intentional contract changes are verified (or existing contracts preserved); remaining limitations are stated. | | Evolve | New requirements alter core contracts, ownership, boundaries, or architecture; or adopting a repo with conflicting conventions. | Assess blast radius, execute controlled migration, update evidence, tests, and documentation. Read evolution. | Transition is verified; new contracts are operational; instructions and documentation align with code. |

Adopting an existing repository begins with mode selection; do not default to re-bootstrapping. If the repository already has working instructions, tooling, and conventions, reuse them. If a specific subsystem lacks a foundation, establish only what that subsystem requires.

---

Continue workflow (Core)

Routine feature work runs straight from the mode above plus core principles, no extra reference needed:

1. Scope and baseline

Confirm the user's objective, observable consequences, affected boundaries, baseline revision/inventory, and any uncommitted user changes to preserve.

2. Implement just enough

3. Verify proportionately

4. Continuity and state

---

Companion Coordination (repo-native-refactor)

Use at most one companion pass when the user requests review, concrete unresolved concerns remain, or a substantial contract, ownership, or semantic change warrants a scoped audit. Lightweight fixes do not trigger an automatic pass. Read references/companion.md when a pass is warranted; finish normally if the companion is unavailable. Rerun affected checks after its edits; same-agent self-review is not independent review.

---

Reference routing

Read supporting references only when the corresponding trigger occurs:

---

Examples

Add a feature on an existing foundation

Use repo-foundation to add pagination to this project's existing search endpoint.
Preserve the current default response and my uncommitted changes. Reuse the
project's conventions, add relevant regression coverage, and verify the final diff.

Select Continue mode, inspect the endpoint's callers and baseline checks, implement the smallest compatible change, and report the checks actually performed.

Migrate an authorized persisted contract

Use repo-foundation to migrate our local JSON store from schema v1 to v2.
Update the in-scope callers and tests. A failed migration must leave the existing
store intact; verify that failure boundary before reporting completion.

Select Evolve mode and read the migration and verification references before changing persisted state. Establish the authorized target schema and verify the transition, including failure-state preservation.

Limitations

Security & Safety Notes

This skill can edit source files and guide state migrations, so its declared risk is critical under this collection's state-modification classification. Work only within the user's authorized repository and task scope, preserve existing use