plain-forge 1.0.23 → 1.0.24-next.019bba8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +14 -11
  2. package/bin/cli.mjs +5 -4
  3. package/forge/rules/plain-forge.md +10 -0
  4. package/forge/skills/add-concept/SKILL.md +1 -1
  5. package/forge/skills/add-feature/SKILL.md +8 -7
  6. package/forge/skills/add-feature/references/checklist.md +2 -2
  7. package/forge/skills/add-functional-spec/SKILL.md +14 -10
  8. package/forge/skills/add-functional-specs/SKILL.md +14 -10
  9. package/forge/skills/add-implementation-requirement/SKILL.md +1 -1
  10. package/forge/skills/add-resource/SKILL.md +3 -2
  11. package/forge/skills/add-template/SKILL.md +1 -1
  12. package/forge/skills/add-test-requirement/SKILL.md +4 -4
  13. package/forge/skills/add-test-scenarios/SKILL.md +98 -0
  14. package/forge/skills/analyze-2-func-specs/SKILL.md +1 -1
  15. package/forge/skills/analyze-func-specs/SKILL.md +2 -2
  16. package/forge/skills/analyze-if-func-spec-too-complex/SKILL.md +44 -24
  17. package/forge/skills/break-down-func-spec/SKILL.md +57 -33
  18. package/forge/skills/check-plain-env/SKILL.md +2 -2
  19. package/forge/skills/consolidate-concepts/SKILL.md +8 -8
  20. package/forge/skills/create-import-module/SKILL.md +1 -1
  21. package/forge/skills/create-requires-module/SKILL.md +6 -3
  22. package/forge/skills/debug-specs/SKILL.md +14 -8
  23. package/forge/skills/forge-plain/SKILL.md +3 -3
  24. package/forge/skills/forge-plain/references/checklist.md +3 -3
  25. package/forge/skills/forge-plain/references/phase-1-product.md +2 -2
  26. package/forge/skills/forge-plain/references/phase-2-tech.md +1 -1
  27. package/forge/skills/forge-plain/references/phase-3-testing.md +5 -5
  28. package/forge/skills/init-config-file/SKILL.md +2 -2
  29. package/forge/skills/init-plain-project/SKILL.md +6 -6
  30. package/forge/skills/load-plain-reference/SKILL.md +25 -25
  31. package/forge/skills/load-plain-reference/references/project-model.md +2 -1
  32. package/forge/skills/load-plain-reference/references/rendering-and-testing.md +7 -5
  33. package/forge/{rules → skills/load-plain-reference/rules}/bullet-continuation.md +11 -11
  34. package/forge/{rules → skills/load-plain-reference/rules}/concise-specs-examples.md +100 -69
  35. package/forge/{rules → skills/load-plain-reference/rules}/concise-specs-integration-examples.md +39 -24
  36. package/forge/{rules → skills/load-plain-reference/rules}/concise-specs.md +3 -2
  37. package/forge/{rules → skills/load-plain-reference/rules}/func-specs.md +37 -28
  38. package/forge/{rules → skills/load-plain-reference/rules}/impl-reqs.md +1 -1
  39. package/forge/{rules → skills/load-plain-reference/rules}/integration-embedded-testing.md +1 -1
  40. package/forge/{rules → skills/load-plain-reference/rules}/linked-resources.md +7 -4
  41. package/forge/{rules → skills/load-plain-reference/rules}/module-structure.md +16 -9
  42. package/forge/{rules → skills/load-plain-reference/rules}/requires-modules.md +1 -0
  43. package/forge/skills/load-plain-reference/rules/semantic-ids.md +47 -0
  44. package/forge/skills/load-plain-reference/rules/test-plain-files.md +67 -0
  45. package/forge/{rules → skills/load-plain-reference/rules}/test-reqs.md +6 -6
  46. package/forge/skills/plain-healthcheck/SKILL.md +31 -13
  47. package/forge/skills/refactor-module/SKILL.md +16 -16
  48. package/forge/skills/resolve-section-ownership/SKILL.md +3 -3
  49. package/forge/skills/resolve-spec-conflict/SKILL.md +14 -8
  50. package/package.json +1 -1
  51. package/forge/skills/add-acceptance-test/SKILL.md +0 -101
  52. /package/forge/{rules → skills/load-plain-reference/rules}/definitions.md +0 -0
  53. /package/forge/{rules → skills/load-plain-reference/rules}/examples/integration-embedded-testing/prepare_environment_java.sh +0 -0
  54. /package/forge/{rules → skills/load-plain-reference/rules}/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -0
  55. /package/forge/{rules → skills/load-plain-reference/rules}/examples/integration-embedded-testing/run_unittests_java.sh +0 -0
  56. /package/forge/{rules → skills/load-plain-reference/rules}/exported-concepts.md +0 -0
  57. /package/forge/{rules → skills/load-plain-reference/rules}/import-modules.md +0 -0
  58. /package/forge/{rules → skills/load-plain-reference/rules}/integration-embedded.md +0 -0
  59. /package/forge/{rules → skills/load-plain-reference/rules}/integration-standalone.md +0 -0
  60. /package/forge/{rules → skills/load-plain-reference/rules}/integrations.md +0 -0
  61. /package/forge/{rules → skills/load-plain-reference/rules}/required-concepts.md +0 -0
@@ -37,7 +37,7 @@ A box is met only when its source confirms it. Return `APPROVED` only when every
37
37
  - [ ] **[disk]** `.plain` module structure created with YAML frontmatter; template (if any) has no `***functional specs***`.
38
38
  - [ ] **[both]** Every concept authored in `***definitions***` via `add-concept`, defined before use.
39
39
  - [ ] **[both]** Every feature authored as functional specs via `add-functional-spec(s)`, each ≤200 LOC, in chronological build order.
40
- - [ ] **[disk]** No `***test reqs***` or `***acceptance tests***` written in this phase.
40
+ - [ ] **[disk]** No `***test reqs***` or test plain files written in this phase.
41
41
  - [ ] **[disk]** Every `***implementation reqs***` bullet written this phase is technology-free policy — none names a language, framework, library, storage engine, or deployment target.
42
42
  - [ ] **[record]** Summarized the full feature list and module/concept layout; got explicit overall confirmation.
43
43
 
@@ -45,7 +45,7 @@ A box is met only when its source confirms it. Return `APPROVED` only when every
45
45
 
46
46
  - [ ] **[record]** Read `references/phase-2-tech.md` and walked its topics in order (language, frameworks, storage, external services, structure/architecture, other constraints, anything else).
47
47
  - [ ] **[disk]** Every requirement authored into `***implementation reqs***` at the right scope (shared → template, module-specific → module).
48
- - [ ] **[disk]** No `***test reqs***` or `***acceptance tests***` written in this phase.
48
+ - [ ] **[disk]** No `***test reqs***` or test plain files written in this phase.
49
49
  - [ ] **[record]** Summarized the tech stack and architecture; got explicit overall confirmation.
50
50
 
51
51
  ## Phase 3 — How is testing done?
@@ -54,7 +54,7 @@ A box is met only when its source confirms it. Return `APPROVED` only when every
54
54
  - [ ] **[disk]** Honored the hard partition — every `:UnitTests:` fact in `***implementation reqs***`, every `:ConformanceTests:` fact in `***test reqs***`; never shared a bullet.
55
55
  - [ ] **[record]** Walked topics in order (unit framework, unit types/architecture, conformance decision, prepare-environment decision, layout, execution, other constraints, anything else).
56
56
  - [ ] **[disk]** Generated the needed scripts under `test_scripts/` via the `implement-*-script` skills and added each `*-script:` entry to the right `config.yaml`.
57
- - [ ] **[both]** Conformance decision was asked explicitly; if yes, walked every Phase-1 functional spec one at a time for acceptance tests via `add-acceptance-test` (acceptance tests present on disk when the decision was yes).
57
+ - [ ] **[both]** Conformance decision was asked explicitly; if yes, walked every Phase-1 functionality one at a time via `add-test-scenarios` (a test plain file with at least one conformance scenario on disk for every functionality when the decision was yes).
58
58
  - [ ] **[record]** Prepare-environment decision was asked explicitly and recorded.
59
59
  - [ ] **[record]** Recapped the testing strategy; got explicit overall confirmation.
60
60
  - [ ] **[record]** Ran `check-plain-env`; it returned `PASS`, or `WARN`/`FAIL` with each remaining item explicitly acknowledged by the user (re-invoked after any install).
@@ -10,10 +10,10 @@ The moment the user answers, write the resulting snippet to disk using the right
10
10
 
11
11
  - **Module structure** — create or update the `.plain` file(s) (single module, template + modules, or chained modules). Set up YAML frontmatter (`import`, `requires`, `description`) and the proposed module name. If a template is used, create it in `template/` **without** a `***functional specs***` section. Use the `create-import-module` skill where applicable.
12
12
  - **`***definitions***`** — add or refine concepts (entities, attributes, relationships). Define every concept before it is referenced. Use the `add-concept` skill.
13
- - **`***functional specs***`** — translate each answer into a single chronological, incremental spec (≤200 lines of code change, language-agnostic, no conflicts). Use `add-functional-spec` for one new spec; use `add-functional-specs` only when a single answer naturally decomposes into a tight cluster of specs flowing from the same answer (e.g. list / create / delete CRUD on one entity). **Never hand-author the `***functional specs***` section directly.**
13
+ - **`***functional specs***`** — translate each answer into a single chronological, incremental spec (≤200 lines of code change, language-agnostic, no conflicts), headed by a func-id per `semantic-ids.md`. Use `add-functional-spec` for one new spec; use `add-functional-specs` only when a single answer naturally decomposes into a tight cluster of specs flowing from the same answer (e.g. list / create / delete CRUD on one entity). **Never hand-author the `***functional specs***` section directly.**
14
14
  - **`***implementation reqs***`** — only a requirement that can be stated without naming a technology: an error-handling or retry policy, an idempotency or ordering guarantee, a data-format or precision rule. Use the `add-implementation-requirement` skill, on the module whose behavior it constrains. The moment stating it takes a language, framework, library, storage engine, or deployment target, it is a Phase 2 answer — note it and steer back.
15
15
 
16
- Do **not** add `***test reqs***` or `***acceptance tests***` in this phase — they belong to later phases.
16
+ Do **not** add `***test reqs***` or test plain files in this phase — they belong to later phases.
17
17
 
18
18
  ## Topics (in order)
19
19
 
@@ -9,7 +9,7 @@ Write each requirement into `***implementation reqs***`:
9
9
  - Shared, stack-wide reqs (language, framework, architecture, coding standards) go on the template module if one exists.
10
10
  - Module-specific reqs (e.g. a data-storage choice or an external integration only one module uses) go on the module that needs them.
11
11
 
12
- Do **not** add `***test reqs***` or `***acceptance tests***` in this phase — they belong to later phases.
12
+ Do **not** add `***test reqs***` or test plain files in this phase — they belong to later phases.
13
13
 
14
14
  ## Topics (in order)
15
15
 
@@ -1,6 +1,6 @@
1
1
  # Phase 3 — How should testing be done?
2
2
 
3
- Gather the testing strategy. This phase covers `***test reqs***`, `***acceptance tests***`, the scripts under `test_scripts/`, and the `config.yaml` file(s) that wire them in. Run the core loop (ask → author → review) from `SKILL.md` for each topic below, in order. When the user has no preference, propose a default that fits the language and stack chosen in Phase 2 and ask them to confirm.
3
+ Gather the testing strategy. This phase covers `***test reqs***`, the test plain files, the scripts under `test_scripts/`, and the `config.yaml` file(s) that wire them in. Run the core loop (ask → author → review) from `SKILL.md` for each topic below, in order. When the user has no preference, propose a default that fits the language and stack chosen in Phase 2 and ask them to confirm.
4
4
 
5
5
  ## Hard partition (applies to every topic)
6
6
 
@@ -36,10 +36,10 @@ template_dir: template
36
36
  - Author a `:UnitTests:` framework requirement in `***implementation reqs***` at the appropriate scope (template if shared, otherwise on the module) — e.g. "`:UnitTests:` should use pytest" plus "`:UnitTests:` are run via `pytest tests/`". Generate `run_unittests` (and any framework config it needs, e.g. `pytest.ini`, `jest.config.js`) via `implement-unit-testing-script`. Add the `unittests-script:` entry to the relevant `config.yaml`(s), creating each file if it doesn't exist yet.
37
37
  - Review the framework req, the generated script paths, and the new `config.yaml` entry.
38
38
  2. **Unit-test types and architecture mapping** — which of unit tests and integration tests the user wants, and how tests map to the Phase 2 architectural layers (e.g. one test module per service, repository tests with an in-memory store). Author a `:UnitTests:` scope / architecture requirement in `***implementation reqs***`, phrased in terms of `:UnitTests:` so the partition is visible. Review that requirement.
39
- 3. **Conformance testing** — explicitly ask whether conformance / end-to-end tests should be part of the project. This drives whether `run_conformance_tests` is generated and whether `***acceptance tests***` are authored. If the user is unsure, briefly explain the tradeoff (extra scripts + per-spec acceptance tests vs. lighter setup) and let them choose.
40
- - If **yes**: author a conformance-testing requirement in `***test reqs***` (framework, execution command, any constraints); generate `run_conformance_tests` via `implement-conformance-testing-script`; add the `conformance-tests-script:` entry to the relevant `config.yaml`(s); then **walk every functional spec authored in Phase 1, one at a time** — for each spec, ask one `AskUserQuestion` whether it needs concrete verification, and if yes author one acceptance test under that spec via `add-acceptance-test`, then review that acceptance test as a snippet before moving to the next spec. Never bulk-write acceptance tests; never ask about more than one spec per call.
41
- - If **no**: record the decision; skip the conformance script, its config entry, and acceptance-test authoring entirely.
42
- - Review the conformance req (if any), the new script and config entry (if any), and each acceptance test snippet (if any).
39
+ 3. **Conformance testing** — explicitly ask whether conformance / end-to-end tests should be part of the project. This drives whether `run_conformance_tests` is generated and whether test plain files with conformance scenarios are authored. If the user is unsure, briefly explain the tradeoff (extra scripts + one test plain file per functionality vs. lighter setup) and let them choose.
40
+ - If **yes**: author a conformance-testing requirement in `***test reqs***` (framework, execution command, any constraints); generate `run_conformance_tests` via `implement-conformance-testing-script`; add the `conformance-tests-script:` entry to the relevant `config.yaml`(s); then **walk every functionality authored in Phase 1, one at a time** — for each one, invoke `add-test-scenarios` to write its test plain file with at least one conformance scenario, then review those scenarios as a snippet with one `AskUserQuestion` and apply the answer before moving to the next functionality. Never bulk-write scenarios; never ask about more than one functionality per call.
41
+ - If **no**: record the decision; skip the conformance script, its config entry, and test plain file authoring entirely.
42
+ - Review the conformance req (if any), the new script and config entry (if any), and each test plain file snippet (if any).
43
43
  4. **Environment preparation script** — explicitly ask whether a `prepare_environment` script should be generated. It is the single entry point for installing dependencies and setting up fixtures/services before tests run. If the user is unsure, note it is recommended when there are dependencies to install or services to start, and skippable when the project genuinely has nothing to prepare.
44
44
  - If **yes**: generate `prepare_environment` via `implement-prepare-environment-script`; add the `prepare-environment-script:` entry to the relevant `config.yaml`(s); if the script's responsibilities are non-trivial and worth pinning in the spec, add a brief `***test reqs***` entry describing what `prepare_environment` is responsible for.
45
45
  - If **no**: record the decision; skip the script and the config entry.
@@ -53,7 +53,7 @@ These keys reflect choices made in Phase 3 of `forge-plain`:
53
53
  | `conformance-tests-script` | path (string) | — | Include when the user opted into conformance testing in Phase 3. |
54
54
  | `prepare-environment-script` | path (string) | — | Include only when both (a) the user opted into a prepare-environment script and (b) `conformance-tests-script` is also set. Setting prepare without conformance is a hard `plain-healthcheck` failure. |
55
55
  | `test-script-timeout` | int (seconds) | `120` | Include only when the user explicitly raised/lowered the default. |
56
- | `template-dir` | path (string) | — | Include whenever the project has an `import` module or a custom template directory (e.g. `template/`). Required for projects with shared templates. `plain-parser check` reads it too, so `plain-healthcheck` finds the templates. |
56
+ | `template-dir` | path (string) | — | Include whenever the project has an import module or a custom template directory (e.g. `template/`). Required for projects with shared templates. `plain-parser check` reads it too, so `plain-healthcheck` finds the templates. |
57
57
  | `build-folder` | string | `plain_modules` | Include only when the user picked a non-default folder name. Must differ from `build-dest`. The renderer writes `<build-folder>/<module>/code` (implementation + unit tests) and `<build-folder>/<module>/tests` (conformance tests, one folder per functional spec). |
58
58
  | `build-dest` | string | `dist` | **Always include with the value `dist`.** This skill pins the output destination explicitly so every project's `config.yaml` has the same, predictable target folder, visible in the file. Must differ from `build-folder`. |
59
59
 
@@ -73,7 +73,7 @@ Before emitting anything, state the planned split to the user (e.g. "I'll emit `
73
73
 
74
74
  ### Step 1 — Inventory
75
75
 
76
- 1. List every `.plain` file in the repo and identify the top modules (modules not `requires`-ed by anything else) — same procedure as `plain-healthcheck` Step 1.
76
+ 1. List every `.plain` file in the repo and identify the top modules (modules not `requires`-ed by any other module) — same procedure as `plain-healthcheck` Step 1.
77
77
  2. For each top module, determine which part it belongs to (single-stack → one part; multi-part → one part per top module).
78
78
  3. List every script under `test_scripts/` and group them by part (e.g. `*_python.sh` belongs to the backend part, `*_js.sh` belongs to the frontend part).
79
79
  4. Identify the template directory (typically `template/`) and any custom resource directories (typically `resources/`).
@@ -13,16 +13,16 @@ description: >-
13
13
 
14
14
  # Init Plain Project
15
15
 
16
- Always use the skill `load-plain-reference` to retrieve the ***plain syntax rules — but only if you haven't done so yet.
16
+ **Load the rules first.** Before you read, edit, or write any `.plain` file, invoke the `load-plain-reference` skill and read the rule files it routes you to. Skip this only if `load-plain-reference` already ran in this conversation.
17
17
 
18
18
  ## Scope
19
19
 
20
- This skill is intentionally **minimal**. It produces a runnable project skeleton — not a complete spec. **No `***definitions***` sections are written by this skill — not in the template module, not in the top module.** No functional specs, no concepts, no acceptance tests, no validation. The user will fill those in afterwards with `add-feature`, `add-concept`, `add-functional-spec`, etc.
20
+ This skill is intentionally **minimal**. It produces a runnable project skeleton — not a complete spec. **No `***definitions***` sections are written by this skill — not in the template module, not in the top module.** No functional specs, no concepts, no test plain files, no validation. The user will fill those in afterwards with `add-feature`, `add-concept`, `add-functional-spec`, etc.
21
21
 
22
22
  What this skill writes:
23
23
 
24
24
  - `template/base.plain` — an import module with the project's base `***implementation reqs***` and `***test reqs***`.
25
- - `<project>.plain` — a top-level module that imports `base`. Frontmatter only — no body sections. The user adds `***functional specs***` later.
25
+ - `<project>.plain` — a top-level module that imports `base`. Frontmatter only — no body sections. The user adds `***functional specs***` later, each with its test plain file.
26
26
  - `test_scripts/run_unittests_<lang>.<sh|ps1>` — always.
27
27
  - `test_scripts/run_conformance_tests_<lang>.<sh|ps1>` — only if conformance testing is enabled.
28
28
  - `test_scripts/prepare_environment_<lang>.<sh|ps1>` — only if conformance testing is enabled **and** the user opts in.
@@ -31,7 +31,7 @@ What this skill writes:
31
31
  What this skill does **not** do:
32
32
 
33
33
  - Run `plain-healthcheck`.
34
- - Author concepts, functional specs, or acceptance tests.
34
+ - Author concepts, functional specs, or test plain files.
35
35
  - Probe the host environment (`check-plain-env` is a separate step the user can run later).
36
36
 
37
37
  ## Workflow
@@ -51,7 +51,7 @@ Follow up with a free-form prompt for anything the options didn't cover (e.g. sp
51
51
  Use **AskUserQuestion** for one tight batch covering:
52
52
 
53
53
  - **Unit testing framework** — propose the canonical one for the chosen language (pytest, Jest, Go `testing`, JUnit, ...) and let the user override.
54
- - **Conformance testing** — enabled or not. If the user is unsure, briefly explain it adds a `run_conformance_tests` script and per-spec acceptance tests later.
54
+ - **Conformance testing** — enabled or not. If the user is unsure, briefly explain it adds a `run_conformance_tests` script and, for every functionality added later, a test plain file with conformance scenarios.
55
55
  - **Prepare-environment script** — only ask this if conformance testing was enabled in the previous question. Generate one or skip. Recommend "yes" when dependencies need installing (most stacks); recommend "skip" when there is genuinely nothing to set up. If conformance testing is disabled, skip this question entirely and do not generate a prepare-environment script.
56
56
 
57
57
  ### 3. Author `template/base.plain`
@@ -118,7 +118,7 @@ Do **not** invoke `init-config-file` or `plain-healthcheck` here — keeping thi
118
118
  Tell the user what was created and what's next:
119
119
 
120
120
  - Files written: `template/base.plain`, `<project>.plain`, the test scripts, `config.yaml`.
121
- - Suggested next steps: add concepts with `add-concept`, add functional specs with `add-functional-spec` or `add-functional-specs`, or jump straight into `add-feature`.
121
+ - Suggested next steps: add concepts with `add-concept`, add functional specs with `add-functional-spec` or `add-functional-specs` (each new functionality gets its test plain file when conformance testing is enabled), or jump straight into `add-feature`.
122
122
  - Mention that the project has not been validated — they can run `plain-healthcheck` when they want validation.
123
123
 
124
124
  ## Validation checklist
@@ -2,15 +2,16 @@
2
2
  name: load-plain-reference
3
3
  description: >-
4
4
  Loads the applicable ***plain authoring rules and operational references for the current task.
5
- Covers section ownership, concepts, modules, resources, integrations, rendering, and testing
5
+ Covers section ownership, concepts, func-ids, test plain files, modules, resources, integrations, rendering, and testing
6
6
  without loading unrelated guidance. Use when authoring, editing, reviewing,
7
7
  or debugging .plain files, or before invoking another skill that reads or writes .plain content.
8
8
  ---
9
9
 
10
10
  # Load the ***plain reference
11
11
 
12
- Load only the rules and references required for the current task. Files under `../../rules/` are
13
- the source of truth for `.plain` syntax and authoring constraints. Do not restate or override them.
12
+ Load only the rules and references required for the current task. Files under `rules/`, next to
13
+ this `SKILL.md`, are the source of truth for `.plain` syntax and authoring constraints. Do not
14
+ restate or override them.
14
15
 
15
16
  **First, confirm the rules about to be loaded are current.** On the first invocation of this skill in
16
17
  a session, invoke `check-forge-version` before loading any rule file. A stale plain-forge ships stale
@@ -26,10 +27,7 @@ Skip the check on later invocations in the same session, and skip it when the ne
26
27
 
27
28
  ## 1. Account for rules already loaded
28
29
 
29
- - In Claude Code, applicable `.claude/rules/*.md` files are loaded natively. Do not read those rule
30
- files again.
31
- - In another agent, do not reread a rule whose full content is already present in the current
32
- context.
30
+ - Do not reread a rule whose full content is already present in the current context.
33
31
  - Otherwise, read the applicable files from the routing table below before inspecting or changing
34
32
  `.plain` content.
35
33
 
@@ -39,19 +37,21 @@ All paths are relative to this `SKILL.md`.
39
37
 
40
38
  | Task or content | Rule files |
41
39
  |---|---|
42
- | New module, file skeleton, section placement, or comments | `../../rules/module-structure.md` |
43
- | Moving facts between sections (see `resolve-section-ownership`) | `../../rules/module-structure.md`, plus the rule file of each section involved |
44
- | Definitions or concept usage | `../../rules/definitions.md` |
45
- | Functional specs or acceptance tests | `../../rules/func-specs.md` |
46
- | Implementation requirements or unit tests | `../../rules/impl-reqs.md` |
47
- | Test requirements or conformance tests | `../../rules/test-reqs.md` |
48
- | `import` modules | `../../rules/import-modules.md` |
49
- | `requires` modules | `../../rules/requires-modules.md` |
50
- | `required_concepts` | `../../rules/required-concepts.md` |
51
- | `exported_concepts` | `../../rules/exported-concepts.md` |
52
- | Linked files or `resources/` | `../../rules/linked-resources.md` |
53
- | Any `.plain` text or example | `../../rules/bullet-continuation.md`, `../../rules/concise-specs.md` |
54
- | Drafting or trimming spec wording, or reviewing a spec for verbosity | `../../rules/concise-specs-examples.md` |
40
+ | New module, file skeleton, section placement, or comments | `rules/module-structure.md` |
41
+ | Moving facts between sections (see `resolve-section-ownership`) | `rules/module-structure.md`, plus the rule file of each section involved |
42
+ | Definitions or concept usage | `rules/definitions.md` |
43
+ | Functional specs | `rules/func-specs.md`, `rules/semantic-ids.md` |
44
+ | Test plain files or scenarios | `rules/test-plain-files.md`, `rules/semantic-ids.md` |
45
+ | Implementation requirements or unit tests | `rules/impl-reqs.md` |
46
+ | Test requirements or conformance tests | `rules/test-reqs.md` |
47
+ | `import` modules | `rules/import-modules.md` |
48
+ | `requires` modules | `rules/requires-modules.md` |
49
+ | `required_concepts` | `rules/required-concepts.md` |
50
+ | `exported_concepts` | `rules/exported-concepts.md` |
51
+ | Linked files or `resources/` | `rules/linked-resources.md` |
52
+ | Definitions, implementation reqs, or test reqs text | `rules/bullet-continuation.md` |
53
+ | Any `.plain` text or example | `rules/concise-specs.md` |
54
+ | Drafting or trimming spec wording, or reviewing a spec for verbosity | `rules/concise-specs-examples.md` |
55
55
 
56
56
  For a whole-file review or a task spanning several sections, load the union of the applicable rule
57
57
  files. Do not load every rule by default.
@@ -60,16 +60,16 @@ files. Do not load every rule by default.
60
60
 
61
61
  For an integration spec, always read:
62
62
 
63
- - `../../rules/integrations.md`
63
+ - `rules/integrations.md`
64
64
 
65
65
  Then read the rule matching the integration shape:
66
66
 
67
- - Embedded integration: `../../rules/integration-embedded.md`
68
- - Standalone integration: `../../rules/integration-standalone.md`
69
- - Embedded integration test scripts: `../../rules/integration-embedded-testing.md`
67
+ - Embedded integration: `rules/integration-embedded.md`
68
+ - Standalone integration: `rules/integration-standalone.md`
69
+ - Embedded integration test scripts: `rules/integration-embedded-testing.md`
70
70
 
71
71
  When drafting or trimming the wording of an integration spec, also read
72
- `../../rules/concise-specs-integration-examples.md`.
72
+ `rules/concise-specs-integration-examples.md`.
73
73
 
74
74
  Do not load integration rules for ordinary non-integration specs.
75
75
 
@@ -14,10 +14,11 @@ those specifications.
14
14
  ```text
15
15
  *.plain # Root specification modules
16
16
  template/*.plain # Reusable import modules
17
+ tests/<module>/<func-id>.plain # Test plain files, one per functionality (conventional location)
17
18
  resources/ # Linked text artifacts such as schemas and fixtures
18
19
  plain_modules/ # Generated output, one directory per module
19
20
  <module>/code/ # implementation and unit tests
20
- <module>/tests/ # conformance tests, one folder per functional spec
21
+ <module>/tests/ # conformance tests, one folder per functionality, one test per scenario
21
22
  test_scripts/ # Unit, environment-preparation, and conformance runners
22
23
  config.yaml # renderer configuration
23
24
  ```
@@ -6,8 +6,10 @@ Functional specs render from top to bottom. When rendering one functional spec,
6
6
  the previous specs but not future specs. A required module's functional specs also count as previous
7
7
  specs according to the module rules.
8
8
 
9
- Each functional spec receives its own conformance-test folder. After a new spec renders, the
10
- renderer runs conformance tests for previous specs to detect regressions. A new failure can mean:
9
+ The renderer reads the test plain files and generates exactly the scenarios they hold,
10
+ one labelled test per scenario-id; it never adds a test of its own. Each functionality receives its own
11
+ conformance-test folder, named by its func-id. After a new spec renders, the renderer runs conformance
12
+ tests for previous specs to detect regressions. A new failure can mean:
11
13
 
12
14
  1. The generated implementation does not satisfy the specification.
13
15
  2. The generated conformance test does not accurately test the specification.
@@ -24,7 +26,7 @@ and debugged, but never edited directly. Apply fixes as follows:
24
26
  - Behavior or implementation/unit-test guidance: edit definitions, functional specs, or
25
27
  implementation requirements as appropriate.
26
28
  - Conformance-test guidance: edit test requirements.
27
- - Acceptance-test guidance: edit the acceptance tests nested under their owning functional spec.
29
+ - Scenario guidance: edit the scenarios in the functionality's test plain file with `add-test-scenarios`.
28
30
 
29
31
  Re-render after correcting the source specification.
30
32
 
@@ -37,7 +39,7 @@ Test scripts are renderer entry points as well as developer utilities:
37
39
  - `prepare_environment_<lang>` optionally prepares a reusable system-temporary environment for
38
40
  conformance testing once per render.
39
41
  - `run_conformance_tests_<lang>` receives the generated build folder and one functionality's
40
- conformance-test folder (`plain_modules/<module_name>/tests/<functionality>`). It may run repeatedly during a render.
42
+ conformance-test folder (`plain_modules/<module_name>/tests/<func-id>`). It may run repeatedly during a render.
41
43
 
42
44
  Invoke the corresponding `implement-*-script` skill when creating or changing a test script. Those
43
45
  skills own exact staging, cleanup, dependency-installation, shell, and exit-code contracts.
@@ -50,7 +52,7 @@ Run project scripts from the repository root, using the filenames configured for
50
52
  ./test_scripts/run_unittests.sh plain_modules/<module_name>/code
51
53
  ./test_scripts/prepare_environment.sh plain_modules/<module_name>/code
52
54
  ./test_scripts/run_conformance_tests.sh \
53
- plain_modules/<module_name>/code plain_modules/<module_name>/tests/<functionality>
55
+ plain_modules/<module_name>/code plain_modules/<module_name>/tests/<func-id>
54
56
  ```
55
57
 
56
58
  The renderer resolves script arguments to absolute paths. Test scripts must treat input directories
@@ -4,7 +4,7 @@ description: Bullet and continuation syntax for every section in .plain files
4
4
 
5
5
  # Rules for bullets and continuations in `.plain` files
6
6
 
7
- These rules apply to every section and to concept explanations.
7
+ These rules apply to `***definitions***`, `***implementation reqs***`, and `***test reqs***`, and to concept explanations. The body of a functionality and a scenario in a test plain file are free text; these rules do not apply there (see `func-specs.md` and `test-plain-files.md`).
8
8
 
9
9
  ## No line-length limit
10
10
 
@@ -25,14 +25,14 @@ clarification of the statement above it. There is no third, typographic reason t
25
25
  indistinguishable from a deliberate sub-point
26
26
  - The test: if content deserves its own line, it deserves its own `- ` bullet; if it doesn't,
27
27
  keep it on the parent's line
28
- - What the renderer does enforce is the top level: every statement in a section must be a `- `
29
- list item — a flush-left prose line is a syntax error. A bare continuation, by contrast, is
30
- accepted and folded into its parent item verbatim
28
+ - What the renderer does enforce is the top level of `***definitions***`, `***implementation reqs***`,
29
+ and `***test reqs***`: every statement there must be a `- ` list item — a flush-left prose line is
30
+ a syntax error. A bare continuation, by contrast, is accepted and folded into its parent item verbatim
31
31
 
32
32
  BAD — line broken for width (bare continuation):
33
33
 
34
34
  ```plain
35
- ***functional specs***
35
+ ***definitions***
36
36
 
37
37
  - :GatewayWebhook: hands off :StripeRequest: to :StripeIntegration:.handle(),
38
38
  which returns a list of :EventEnvelope: dicts conforming to the gateway contract.
@@ -41,25 +41,25 @@ BAD — line broken for width (bare continuation):
41
41
  GOOD — one valid list item:
42
42
 
43
43
  ```plain
44
- ***functional specs***
44
+ ***definitions***
45
45
 
46
46
  - :GatewayWebhook: hands off :StripeRequest: to :StripeIntegration:.handle(), which returns a list of :EventEnvelope: dicts conforming to the gateway contract.
47
47
  ```
48
48
 
49
- BEST — separate clarifications expressed as nested bullets:
49
+ BEST — separate clarifications, each as its own bullet:
50
50
 
51
51
  ```plain
52
- ***functional specs***
52
+ ***definitions***
53
53
 
54
54
  - :GatewayWebhook: hands off :StripeRequest: to :StripeIntegration:.handle().
55
- - The method returns a list of :EventEnvelope: dicts.
56
- - The dicts conform to the gateway's :EventEnvelope: contract.
55
+ - The method returns a list of :EventEnvelope: dicts.
56
+ - The dicts conform to the gateway's :EventEnvelope: contract.
57
57
  ```
58
58
 
59
59
  ## Presenting `.plain` examples
60
60
 
61
61
  - Show every example under its owning section header
62
- - Separate top-level list items with one blank line
62
+ - Separate top-level list items, functionalities, and scenarios with one blank line
63
63
  - Keep nested clarifications directly under their parent without a blank line
64
64
  - BAD, WRONG, `Before:`, and `Too complex:` examples may intentionally demonstrate invalid syntax
65
65