docs/sdlc.md

Repository SDLC

These rules govern contributions to software-factory itself, not delivery tasks in projects using the plugin. Instructions for factory skills and agents do not waive these repository contribution rules.

Before changing files

  • Read the relevant issue, comments, and applicable instructions. Confirm the requested outcome and acceptance conditions; distinguish planning requests from authorization to implement.
  • Inspect the current branch and working-tree status. Preserve unrelated changes and never discard another contributor's work.
  • Fetch the target branch from the remote before starting a feature or fix. Create the branch from the latest remote-tracking target (normally origin/main), not a potentially stale local main. For an explicitly requested stack, use the intended parent branch. If fetching fails, report it instead of assuming the local baseline is current.
  • Stack PRs only when they change separate files or sections. When they edit the same sections, either agree one combined branch for them (one commit per issue, the PR referencing each issue), or start the child only after the parent has merged: in a stack, every parent fix otherwise has to be carried into each child, with conflicts. Once a stacked PR is open, bring parent changes into the child by merging the parent branch, so the child needs no force-push.
  • Use a dedicated branch for each feature or fix, such as feat/19-design-workflow or fix/<issue>-<short-name>. Creating this branch is part of an authorized implementation task, not a separate approval step.
  • Always create a new, dedicated branch before implementing an issue solution. Never implement directly on main or another protected integration branch, or reuse an unrelated task's branch. The exceptions are release work, which is committed on its release branch (see Releases), and an agreed combined branch for issues that edit the same sections (see the stacking rule above). If edits were made there accidentally, move the uncommitted work to a dedicated branch before continuing; do not reset or rewrite shared history.
  • Keep the first implementation small. Identify the scope and verification approach before editing; use a short plan for multi-step work.
  • Decide release impact before implementation: internal-only, patch, minor, or major/breaking. Shipped plugin changes need an agreed version/changelog update; internal repository tooling does not. Define a migration strategy for major/breaking changes affecting existing projects and record it in docs/updating.md; see the internal issue workflow for the solution and migration requirements.

Implementation and verification

  • Follow existing skill instructions, agent boundaries, and project conventions. Do not bypass required reviews or approvals.
  • Define each shared rule (a record format, a log rule, a linking rule, the meaning of a field) in one file. Other skills and agents link to it and add only their own steps and gates; do not restate it around the link.
  • Add or update proportionate tests and documentation. For update migrations, use work-issue-migrations and its template to define version-scoped instructions linked from docs/updating.md; do not add release-specific behavior to the generic consumer migrate skill. Run the relevant checks and git diff --check before handing work back.
  • Report actual check results and blockers. Do not weaken safeguards, silently skip failures, or claim blocked checks passed.
  • There is no compilation step. Run claude plugin validate . and npm test in apps/docs (after npm ci); the latter also runs the root tests/*.test.mjs (including the shipped-link check) and builds and validates the catalog of repository Markdown, including .agents/skills/ and README.md. If apps/docs cannot run, run node --test tests/*.test.mjs and report the gap. Every relative link in shipped Markdown must resolve, including examples; write example paths as code, not links. Report any unavailable tooling or validation warnings accurately.

Review and delivery

  • Do not commit or push changes, open a pull request, or merge unless the user authorizes that action. An explicit request to deliver through a PR authorizes its necessary commit and push steps, not merging.
  • Before opening a PR, assess whether the change should be split for review, inspect the final diff, and obtain independent review. Keep review findings and unresolved objections visible.
  • Link the issue and explain the change, verification results, and known limitations in the PR. Never push feature changes directly to main.
  • Human approval is required before merging. Visual/UI design artifacts also require explicit human approval of the submitted revision; task-definition or code review does not replace it.
  • At handoff, state the branch, what changed, checks run, and any remaining review or approval steps. Do not claim work is merged, approved, or complete beyond the evidence.

Releases

Shipped changes are released together through a release issue and branch. See work-issue-release for the full procedure.

  • Open one release issue per version (for example #35 for 0.5.0) listing the included issues. Adding scope needs an explicit developer decision.
  • Create release/<version> from freshly fetched origin/main. Create each included issue's branch from fresh origin/main, not from the release branch, unless the issue records a dependency on another in-progress issue and its agreed parent/base SHA. Target issue PRs at the release branch.
  • Issue PRs reference their issue (Refs #n), never close it, and add no changelog entry, version bump or migration descriptor. Each provides a compatibility summary: changed records, configuration, paths and IDs, with old and new examples or an explicit no-impact decision, plus preservation needs and the verification run.
  • Integrating an issue PR into the release branch still needs its approved solution, verification, independent review, human approval of the submitted revision and explicit merge authorization. It does not wait for the release migration.
  • Once the issues are integrated, release work is committed directly on release/<version> (no separate branch or PR into it). It analyzes the integrated diff and the migration history, obtains approval of one migration plan (docs/migrations/<version>-release.md; a release with no record changes gets a step that writes only its checkpoint), rehearses it in a sandbox across the supported upgrade paths, and finalizes version, changelog and docs.
  • The release PR targets main and closes the release issue and every fully delivered included issue. Merging needs human approval and explicit authorization. Issues stay open until the release is on main.
Original Markdown, including metadata
# Repository SDLC

These rules govern contributions to software-factory itself, not delivery tasks in projects using the plugin. Instructions for factory skills and agents do not waive these repository contribution rules.

## Before changing files

- Read the relevant issue, comments, and applicable instructions. Confirm the requested outcome and acceptance conditions; distinguish planning requests from authorization to implement.
- Inspect the current branch and working-tree status. Preserve unrelated changes and never discard another contributor's work.
- Fetch the target branch from the remote before starting a feature or fix. Create the branch from the latest remote-tracking target (normally `origin/main`), not a potentially stale local `main`. For an explicitly requested stack, use the intended parent branch. If fetching fails, report it instead of assuming the local baseline is current.
- Stack PRs only when they change separate files or sections. When they edit the same sections, either agree one combined branch for them (one commit per issue, the PR referencing each issue), or start the child only after the parent has merged: in a stack, every parent fix otherwise has to be carried into each child, with conflicts. Once a stacked PR is open, bring parent changes into the child by merging the parent branch, so the child needs no force-push.
- Use a dedicated branch for each feature or fix, such as `feat/19-design-workflow` or `fix/<issue>-<short-name>`. Creating this branch is part of an authorized implementation task, not a separate approval step.
- Always create a new, dedicated branch before implementing an issue solution. Never implement directly on `main` or another protected integration branch, or reuse an unrelated task's branch. The exceptions are release work, which is committed on its release branch (see [Releases](#releases)), and an agreed combined branch for issues that edit the same sections (see the stacking rule above). If edits were made there accidentally, move the uncommitted work to a dedicated branch before continuing; do not reset or rewrite shared history.
- Keep the first implementation small. Identify the scope and verification approach before editing; use a short plan for multi-step work.
- Decide release impact before implementation: internal-only, patch, minor, or major/breaking. Shipped plugin changes need an agreed version/changelog update; internal repository tooling does not. Define a migration strategy for major/breaking changes affecting existing projects and record it in `docs/updating.md`; see the [internal issue workflow](../.agents/skills/work-issue/SKILL.md) for the solution and migration requirements.

## Implementation and verification

- Follow existing skill instructions, agent boundaries, and project conventions. Do not bypass required reviews or approvals.
- Define each shared rule (a record format, a log rule, a linking rule, the meaning of a field) in one file. Other skills and agents link to it and add only their own steps and gates; do not restate it around the link.
- Add or update proportionate tests and documentation. For update migrations, use [work-issue-migrations](../.agents/skills/work-issue-migrations/SKILL.md) and its template to define version-scoped instructions linked from `docs/updating.md`; do not add release-specific behavior to the generic consumer `migrate` skill. Run the relevant checks and `git diff --check` before handing work back.
- Report actual check results and blockers. Do not weaken safeguards, silently skip failures, or claim blocked checks passed.
- There is no compilation step. Run `claude plugin validate .` and `npm test` in `apps/docs` (after `npm ci`); the latter also runs the root `tests/*.test.mjs` (including the shipped-link check) and builds and validates the catalog of repository Markdown, including `.agents/skills/` and `README.md`. If `apps/docs` cannot run, run `node --test tests/*.test.mjs` and report the gap. Every relative link in shipped Markdown must resolve, including examples; write example paths as code, not links. Report any unavailable tooling or validation warnings accurately.

## Review and delivery

- Do not commit or push changes, open a pull request, or merge unless the user authorizes that action. An explicit request to deliver through a PR authorizes its necessary commit and push steps, not merging.
- Before opening a PR, assess whether the change should be split for review, inspect the final diff, and obtain independent review. Keep review findings and unresolved objections visible.
- Link the issue and explain the change, verification results, and known limitations in the PR. Never push feature changes directly to `main`.
- Human approval is required before merging. Visual/UI design artifacts also require explicit human approval of the submitted revision; task-definition or code review does not replace it.
- At handoff, state the branch, what changed, checks run, and any remaining review or approval steps. Do not claim work is merged, approved, or complete beyond the evidence.

## Releases

Shipped changes are released together through a release issue and branch. See [work-issue-release](../.agents/skills/work-issue-release/SKILL.md) for the full procedure.

- Open one release issue per version (for example #35 for `0.5.0`) listing the included issues. Adding scope needs an explicit developer decision.
- Create `release/<version>` from freshly fetched `origin/main`. Create each included issue's branch from fresh `origin/main`, not from the release branch, unless the issue records a dependency on another in-progress issue and its agreed parent/base SHA. Target issue PRs at the release branch.
- Issue PRs reference their issue (`Refs #n`), never close it, and add no changelog entry, version bump or migration descriptor. Each provides a compatibility summary: changed records, configuration, paths and IDs, with old and new examples or an explicit no-impact decision, plus preservation needs and the verification run.
- Integrating an issue PR into the release branch still needs its approved solution, verification, independent review, human approval of the submitted revision and explicit merge authorization. It does not wait for the release migration.
- Once the issues are integrated, release work is committed directly on `release/<version>` (no separate branch or PR into it). It analyzes the integrated diff and the migration history, obtains approval of one migration plan (`docs/migrations/<version>-release.md`; a release with no record changes gets a step that writes only its checkpoint), rehearses it in a sandbox across the supported upgrade paths, and finalizes version, changelog and docs.
- The release PR targets `main` and closes the release issue and every fully delivered included issue. Merging needs human approval and explicit authorization. Issues stay open until the release is on `main`.