Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.factory/
__pycache__/
*.py[cod]
13 changes: 12 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Context index

- [README](README.md): read for product behavior, installation, consumer context conventions and runtime evidence before changing the plugin.
- [Self-hosting](docs/self-hosting.md): read before developing Software Factory with its own released skills.
- [Review policy](REVIEW.md): required review, deterministic PR verification and local behavioral-qualification ownership.
- [Qualification](README.md#qualify-the-plugin): read before verification; prerequisites, commands, manual checks and execution limits.
- [Durable-context procedure](skills/document/references/durable-context.md): read when changing consumer documentation or instruction guidance.
- [Task artifacts](skills/factory/references/task-folder.md): read when changing factory handoffs or resume state.
Expand All @@ -15,17 +17,26 @@
- A passing `plugin validate` proves packaging, not that a harness runs the stage.
- Do not build test harnesses, validators or expected-answer machinery for the plugin without a concrete product need.

## Self-hosting

- Use the installed stable `software-factory:factory` skill for non-trivial work on this repository. The released plugin operates the task; the edited checkout is the candidate.
- Never replace the running task's instructions with candidate skills. Load the candidate only in fresh evaluation sessions that are explicitly testing it.
- Keep `.factory/` task artifacts local and ignored. Follow [REVIEW.md](REVIEW.md) for independent review and verification ownership.
- Behavioral evals run on a trusted machine with configured coding agents, never in PR CI. After merge, refresh and reinstall the plugin before starting work under the new release.
- Starting or continuing an authorized Factory task here also authorizes committing the independently reviewed candidate, pushing its task branch and opening or updating a draft pull request for remote verification. Do not ask again at that boundary.

## Rules

- Skills are the contract. Every stage must work from its skill alone in every supported harness. Do not add harness-specific agent definitions.
- Keep the plugin generic. Consumer context, access policy and delivery policy stay in the consumer; the consumer or the person decides when `submit` runs.
- No consumer names in skills, references or examples: no repository, user or file path from a project the plugin was tried on.
- Do not pin models or effort in skills; the host chooses.
- A change meant for users needs a version bump in both `plugin.json` and `.claude-plugin/plugin.json`. Hosts cache by version and keep the old copy otherwise.
- A person or separately authorized outer workflow owns ready state, approval, merge and deployment. Factory never extends its standing draft-publication authority to those actions.

## Verification

From the repository root:
During Factory work, run only affected local checks before draft publication. The candidate-bound `PR quality` job owns the complete deterministic matrix described in [REVIEW.md](REVIEW.md). Use these commands locally to reproduce or diagnose that matrix:

- Repository quality: `python3 -m unittest discover -s tests`, then `python3 scripts/validate_repository.py --base-ref <target revision>`
- Claude Code: `claude plugin validate .`
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The goal is to use these pieces on real work, observe where they fall short and

This repository is the **Software Factory plugin**. It is listed in the [thecarbonlayer marketplace](https://github.com/thecarbonlayer/plugin-marketplace), the catalog through which a host discovers installable plugins. The plugin contains ten capability skills, a submit skill and an orchestrator skill. Your own project is the **consumer**: it supplies the request, code, project rules and access to relevant discussion.

Software Factory is also a consumer of its own released plugin. Development of this repository uses the same Factory workflow described here. The installed stable release operates the task, while edited skills remain a candidate until they pass independent review, local behavioral qualification when applicable and deterministic PR verification. See [Developing Software Factory with Software Factory](docs/self-hosting.md).

```mermaid
flowchart LR
M["thecarbonlayer marketplace"] -->|lists| P["This repository: Software Factory plugin"]
Expand Down Expand Up @@ -64,7 +66,7 @@ All stages accept ordinary text, links and files. Include relevant discussion, c
| **Document** | Do the project's docs match the implemented change? | Requirements, decisions, final code and implementation evidence | Updated existing docs, files left unchanged, missing destinations |
| **Review** | Does this frozen code-and-docs candidate meet the agreement? | Requirements, final diff and evidence ledger | Independent findings, acceptance assessment and limits |
| **Verify** | Does the frozen candidate pass the consumer's required checks and journeys? | Candidate, plan, capabilities, consumer policy, remote results and test guidance | Candidate-bound black-box results, evidence IDs and verification gaps |
| **Submit** | May this reviewed candidate be published as a draft, including to trigger remote verification? | Reviewed branch, current evidence and the person's approval | Pushed branch, draft PR link and pending verification state |
| **Submit** | May this reviewed candidate be published as a draft, including to trigger remote verification? | Reviewed branch, current evidence and publication authority from the person or consumer policy | Pushed branch, draft PR link and pending verification state |

Triage defaults to assessing readiness for **pilot implementation** when no stage is specified. Name another stage when that is the decision you need. A failed investigation is reported separately from a request that is not ready.

Expand Down Expand Up @@ -136,7 +138,7 @@ The excluded `.factory/<task id>/` holds intent, accepted requirements, the plan

`start` preserves existing tasks and reserves a new identity before writing artifacts. It authorizes implementation within the plan's scope. Independent checks can run in parallel only when their resources are isolated; otherwise they are serialized. `continue` compares saved branch, commit, worktree, capabilities, remote-check identity and check environment before resuming. It preserves unexpected changes and marks affected results stale.

When configured remote checks own the full suite, the factory asks to publish a draft after independent review, then resumes verification from required jobs bound to the candidate head or a proven integration revision. Without suitable CI, it runs the documented local suite once before asking to submit. It fixes within two rounds, has already reconciled durable documentation, and stops for unresolved decisions or verification gaps. It never marks ready, merges or deploys. A later merge-queue run on a changed combined tree is new integration evidence, not a duplicate candidate-tree run.
When configured remote checks own the full suite, the factory uses existing publication authority or asks for it after independent review, then publishes a draft and resumes verification from required jobs bound to the candidate head or a proven integration revision. Without suitable CI, it runs the documented local suite once before asking to submit when no publication authority already exists. It fixes within two rounds, has already reconciled durable documentation, and stops for unresolved decisions or verification gaps. It never marks ready, merges or deploys. A later merge-queue run on a changed combined tree is new integration evidence, not a duplicate candidate-tree run.

No CI is a supported repository shape. Factory falls back to consumer-documented local automation, then meaningful manual checks. If neither exists, it reports the affected behavior as unverified and asks for the delivery-risk decision. It does not create CI or a test framework implicitly.

Expand Down Expand Up @@ -198,14 +200,21 @@ skills/factory/ Orchestration skill (start, continue, statu
evals/ Generic behavioral scenarios and scoring rubric
```

The repository root is the plugin; the marketplace catalogs live in [thecarbonlayer/plugin-marketplace](https://github.com/thecarbonlayer/plugin-marketplace). Contributor guidance and authoring references live in [AGENTS.md](AGENTS.md); [CLAUDE.md](CLAUDE.md) imports that same guidance.
The repository root is the plugin; the marketplace catalogs live in [thecarbonlayer/plugin-marketplace](https://github.com/thecarbonlayer/plugin-marketplace). Contributor guidance and authoring references live in [AGENTS.md](AGENTS.md); [CLAUDE.md](CLAUDE.md) imports that same guidance. Repository-specific review and verification policy lives in [REVIEW.md](REVIEW.md).


## Develop the Factory with the Factory

For non-trivial changes to this repository, start with the installed `software-factory:factory` skill. It creates the same isolated task worktree and evidence boundary used for any consumer repository. `.factory/` is ignored so intent, plans, raw reports and local evaluation transcripts cannot enter a commit.

The running task keeps its installed release. Candidate skills are loaded only by fresh sessions that are explicitly evaluating them. The deterministic `PR quality` job validates the submitted revision; behavioral evals run locally on a trusted machine when shipped skill behavior changes. Starting an authorized Factory task here includes authority to commit, push and open or update its draft after independent review, while ready state, approval, merge and deployment remain separately authorized. The complete lifecycle is in the [self-hosting guide](docs/self-hosting.md).


## Qualify the plugin

This repository contains instructions and packaging, not a runnable consumer product. Pull requests run the deterministic checks in [PR quality](.github/workflows/pr-quality.yml). The workflow does not call a model or require model credentials.
This repository contains instructions and packaging, not a runnable consumer product. Pull requests run the authoritative complete deterministic suite in [PR quality](.github/workflows/pr-quality.yml). The workflow does not call a model or require model credentials.

Run the same repository-owned checks locally, replacing `origin/main` when the pull request targets another revision:
During implementation, run the focused checks needed for the affected behavior. Once an authorized draft exists, let PR quality own the complete deterministic matrix rather than repeating it locally on the same candidate. To reproduce or diagnose that matrix locally, replace `origin/main` when the pull request targets another revision:

```bash
python3 -m unittest discover -s tests
Expand All @@ -223,7 +232,7 @@ claude plugin validate .

Plugin validation can pass with metadata warnings. Read the exit status and warnings; validation does not prove native stage execution or behavioral quality.

Manually check changed skill links and native skill references. Run the tracked [generic eval suite](evals/README.md) with the previous and candidate plugin versions, then qualify on a de-identified frozen consumer trace and a structurally different consumer or synthetic repository. Keep per-run transcripts, credentials and consumer data local. Record the agent harness, version and checks used, and distinguish a simulation or supplied skill text from native plugin execution.
When shipped skill behavior changes, run the tracked [generic eval suite](evals/README.md) locally on a trusted machine with configured coding agents. Compare the previous release and candidate, then qualify on a de-identified frozen consumer trace and a structurally different consumer or synthetic repository. Keep transcripts, credentials and consumer data local and commit only aggregate results. Documentation or infrastructure-only changes may skip behavioral execution when they record why shipped skill behavior is unchanged.

## Standards and authoring practices

Expand Down
35 changes: 35 additions & 0 deletions REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Review and verification policy

This repository develops Software Factory with the released Software Factory plugin. Follow [the self-hosting procedure](docs/self-hosting.md) and keep the installed stable release separate from the candidate being edited.

## Independent review

- Review the frozen code-and-documentation candidate in one fresh context with `software-factory:review` and `software-factory:review-code`.
- Add the security lens only for trust boundaries, permissions, secrets, untrusted input, shared data or workflow-token changes. Add the UX lens only for changed user-visible interaction.
- Give the reviewer the request, accepted requirements and decisions, base-to-candidate diff, documentation and evidence. Do not provide builder-private reasoning as evidence.
- Report actionable correctness, compatibility, evidence and maintainability findings. Do not report style-only preferences.

## Deterministic verification

The required complete deterministic suite is the pull request job `PR quality / Validate plugin repository`. It must pass on the exact candidate head or a proven integration revision containing that candidate and its target.

The job runs:

- validator unit tests;
- `scripts/validate_repository.py` against the pull request base;
- `git diff --check` for the pull request patch;
- `claude plugin validate .` with the workflow's pinned validator version.

Implementation and review may run affected checks needed to build or prove a finding. Do not duplicate the complete deterministic matrix locally and remotely on an equivalent tree without a recorded policy reason.

## Behavioral qualification

When shipped skill behavior or orchestration changes, run the applicable [behavioral evals](evals/README.md) on a trusted machine with configured coding agents. This is local release evidence, not a GitHub Actions job. Keep model credentials, raw transcripts and consumer traces out of the repository.

Documentation, eval prose and repository-infrastructure changes may omit behavioral qualification when they do not change shipped skill behavior. Record that classification and its limits in the task evidence and pull request.

## Delivery

Starting or continuing an authorized Factory task in this repository includes authority to commit the independently reviewed candidate, push its task branch and open or update a draft pull request so remote verification can run. Factory does not ask again at that boundary.

A person or separately authorized outer workflow still owns ready state, approval, merge and deployment. After merge, refresh and reinstall the plugin before using the new release for another task.
68 changes: 68 additions & 0 deletions docs/self-hosting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Developing Software Factory with Software Factory

Software Factory is a consumer of its own released plugin. Non-trivial changes to this repository use the same `factory`, stage, review, verification and submit skills that another repository uses.

The installed stable release is the operator. The repository checkout is the product being changed, and its edited skills are the candidate under test.

```text
installed stable Factory
|
| creates and operates the task
v
isolated factory/<task> worktree
|
| produces
v
candidate Factory release
|
+--> independent review
+--> local behavioral qualification when skill behavior changed
+--> PR quality on the exact candidate
v
human delivery decision, merge, then plugin refresh
```

## Start and operate a task

1. Confirm that a released Factory plugin is installed and record its version. The root manifests describe the candidate version; they do not change the running operator.
2. Start the request with the installed `software-factory:factory` skill. It reserves `.factory/<task-id>/`, creates a separate `factory/<task-id>` worktree from the fetched delivery target and keeps the source checkout unchanged.
3. Keep triage, refinement, planning, implementation, documentation and scoped fixes in the persistent builder. Use fresh contexts for independent review and verification.
4. Treat `.factory/` as local task state. It contains intent, plans, evidence and raw reports and is ignored by Git. Shared intent belongs in an issue when one exists; delivery evidence belongs in the pull request.

Do not load edited candidate skills into the running builder and pretend that the task changed versions. A task started under one installed release finishes under that release. Fresh evaluation sessions may load the candidate explicitly because the candidate is what those sessions are testing.

If the installed release cannot operate the task safely, use the last known-good installed release or carry out the smallest manual recovery. Record that departure and do not let an unreviewed candidate become its own control plane.

## Review and verification ownership

[REVIEW.md](../REVIEW.md) owns the repository's review and verification policy.

Implementation runs focused checks for the affected behavior. One fresh reviewer examines the frozen code-and-documentation candidate with code review and any applicable security or UX lens.

The pull request's `PR quality / Validate plugin repository` job owns the complete deterministic suite for the submitted revision. It runs the repository validator tests, repository validation, patch whitespace check and plugin packaging validation. A Factory task consumes that remote result rather than running the identical complete matrix locally first.

## Run behavioral qualification locally

Behavioral evals require a coding agent, so they run on a trusted workstation or other controlled machine where the selected agents are already configured. They do not run in GitHub Actions and no model credential belongs in repository or workflow configuration.

Run behavioral qualification when a change alters skill decisions, stage boundaries, evidence rules, review or verification behavior, or release-level orchestration. Documentation, evaluation prose and deterministic CI changes may skip it when they do not change shipped skill behavior; record the reason.

For qualification:

1. Keep the released plugin as the baseline and expose the candidate skills only to fresh candidate sessions.
2. Give each runner only the case prompt and fixture. Keep builder reasoning and expected answers out of the runner context.
3. Use a separate evaluator to score the saved output against the checked-in rubric and hard gates.
4. Record the baseline and candidate revisions, host, agent harness and version, model selection, environment limits, case results and evidence for each deduction.
5. Keep raw transcripts under the ignored task directory or another local temporary location. Commit only de-identified aggregate results.

If a pull request changes an eval case or rubric, run the candidate against the target branch's original suite as well as the proposed suite. The proposed test must not erase evidence of a regression against the earlier contract.

See [the eval guide](../evals/README.md) for the cases and scoring procedure.

## Deliver and adopt the next release

Starting or continuing an authorized Factory task in this repository grants standing authority to commit an independently reviewed candidate, push its task branch and open or update a draft pull request. Factory does not ask again before those actions. This lets the candidate-bound PR-quality job run without a redundant publication prompt.

That standing authority does not cover marking the pull request ready, approval, merge or deployment. After required local behavioral qualification and the candidate-bound PR-quality result support delivery, Factory stops for a person's decision on those actions.

After merge, refresh the marketplace, install the released plugin and confirm the installed version before starting the next Factory task. A task already in progress keeps the release it started with.
Loading
Loading