@turri-dev/cli 0.1.16-next.b861614 → 0.1.16-next.ce2cd46

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 (54) hide show
  1. package/.pi/themes/turri-dark.json +1 -1
  2. package/dist/extension.js +2 -1
  3. package/dist/init-config.d.ts +1 -1
  4. package/dist/init-config.js +1 -1
  5. package/dist/loop-tools.js +1 -1
  6. package/dist/regenerate/cases.js +2 -2
  7. package/dist/regenerate/change-view.js +5 -3
  8. package/dist/regenerate/conform.js +0 -2
  9. package/dist/regenerate/delivery.d.ts +1 -5
  10. package/dist/regenerate/delivery.js +2 -9
  11. package/dist/regenerate/loop.js +1 -2
  12. package/dist/regenerate/regenerate.js +27 -9
  13. package/dist/regenerate/release.d.ts +3 -7
  14. package/dist/regenerate/release.js +59 -15
  15. package/dist/regenerate/testing.d.ts +7 -0
  16. package/dist/regenerate/testing.js +14 -0
  17. package/dist/regenerate-cli.js +1 -1
  18. package/dist/release-agent.d.ts +1 -1
  19. package/dist/release-agent.js +3 -3
  20. package/dist/release-tools.js +2 -1
  21. package/dist/skill-progress.d.ts +1 -1
  22. package/docs/authoring-plain.md +2 -2
  23. package/docs/config.md +1 -1
  24. package/docs/deploy.md +4 -6
  25. package/docs/hosting.md +1 -1
  26. package/docs/regenerating.md +3 -3
  27. package/docs/using.md +2 -2
  28. package/genome/rules/func-specs.md +30 -0
  29. package/genome/rules/impl-reqs.md +1 -1
  30. package/genome/rules/integration-embedded-testing.md +1 -1
  31. package/genome/rules/integration-embedded.md +1 -1
  32. package/genome/rules/integration-standalone.md +1 -1
  33. package/genome/rules/linked-resources.md +4 -0
  34. package/genome/rules/project-model.md +1 -1
  35. package/genome/rules/test-reqs.md +1 -1
  36. package/genome/rules/turri-regeneration.md +1 -1
  37. package/genome/skills/analyze-if-func-spec-too-complex/SKILL.md +5 -5
  38. package/genome/skills/break-down-func-spec/SKILL.md +1 -1
  39. package/genome/skills/brood/references/product.md +2 -2
  40. package/genome/skills/bud/SKILL.md +4 -4
  41. package/genome/skills/debug-specs/SKILL.md +6 -6
  42. package/genome/skills/mature/SKILL.md +1 -1
  43. package/genome/skills/resolve-section-ownership/SKILL.md +4 -4
  44. package/genome/skills/resolve-spec-conflict/SKILL.md +3 -3
  45. package/genome/skills/spawn/SKILL.md +2 -2
  46. package/package.json +1 -1
  47. package/genome/skills/add-acceptance-test/SKILL.md +0 -100
  48. package/genome/skills/add-concept/SKILL.md +0 -71
  49. package/genome/skills/add-functional-spec/SKILL.md +0 -93
  50. package/genome/skills/add-functional-specs/SKILL.md +0 -128
  51. package/genome/skills/add-implementation-requirement/SKILL.md +0 -85
  52. package/genome/skills/add-resource/SKILL.md +0 -105
  53. package/genome/skills/add-template/SKILL.md +0 -64
  54. package/genome/skills/add-test-requirement/SKILL.md +0 -73
@@ -1,93 +0,0 @@
1
- ---
2
- name: add-functional-spec
3
- description: >-
4
- Add a single functional spec to the ***functional specs*** section of a
5
- ***plain spec file. Use whenever exactly one new functional spec is being
6
- added — whether the user explicitly asks, or another skill/workflow
7
- (e.g. `brood`, `bud`) needs to author a new functional spec.
8
- Every new entry under ***functional specs*** must go through either this
9
- skill or `add-functional-specs` (the bulk variant for adding multiple specs
10
- in one pass); hand-authoring functional specs without invoking one of these
11
- skills is forbidden.
12
- allowed-tools: [read, write, edit, bash, ls, grep, find]
13
- ---
14
-
15
- # Add Functional Spec
16
-
17
- ## Workflow
18
-
19
- 1. **Identify the target `.plain` file.** If ambiguous, ask the user.
20
- 2. **Read the entire file** to understand existing definitions, implementation reqs, and all current functional specs (including those in `requires` modules).
21
- 3. **Draft the functional spec** following the rules below, then run the review pass in `concise-specs.md` over the draft — trim it to the shortest wording that keeps every fact before any other check.
22
- 4. **Analyze complexity** — use the `analyze-if-func-spec-too-complex` skill to verify the drafted spec implies ≤ 200 LOC. If too complex, use the `break-down-func-spec` skill to split it, then repeat from step 3 for each resulting spec.
23
- 5. **Check for conflicts** with every existing functional spec — this is critical. Run `analyze-func-specs` **once** with the new spec plus all existing specs (in the file and in any `requires` chain) as a single batch. The batched analyzer returns every conflicting pair in one call — do **not** invoke a pair-by-pair analyzer. For each conflicting pair it reports, run `resolve-spec-conflict` on that pair; re-run `analyze-func-specs` over the touched set after each resolution until the verdict is `COMPATIBLE`.
24
- 6. **Insert the spec where it best fits** in the `***functional specs***` section - see Placement below.
25
- 7. **Read the file again** to confirm correct placement and syntax.
26
-
27
- ## Rules
28
-
29
- ### Complexity Limit
30
-
31
- Each functional spec must imply a **maximum of 200 changed lines of code**. If the requirement is too large, use the `break-down-func-spec` skill to split it into multiple smaller, independent specs. Do not include LOC estimates in the spec text.
32
-
33
- ### Chronological Ordering
34
-
35
- Specs are rendered incrementally, top to bottom. The renderer has **no knowledge of future specs** — only previously rendered specs are in context. This means:
36
- - A new spec can reference behavior defined by earlier specs.
37
- - A new spec **cannot** assume anything about specs that come after it.
38
-
39
- ### Placement
40
-
41
- Put the new spec where it best fits the spec as it reads, not at the end by default:
42
- - **Below every spec it builds on** - each spec whose behaviour it references or extends, and the first spec using each concept it relies on.
43
- - **Above every existing spec that builds on it** - one that already assumes what the new spec adds.
44
- - **Within those bounds, beside the specs of the same feature** - usually straight after the last spec it extends, so a feature's specs read as one group.
45
- - **At the end** only when it starts something new or fits nowhere better.
46
-
47
- An insertion in the middle costs no more than one at the end: turri regenerates it as one addition, and the specs after it are not rebuilt (`turri-regeneration.md`). Never append just to avoid moving the numbering.
48
-
49
- ### Language Agnosticism
50
-
51
- Write in terms of behavior, concepts, and domain logic — not implementation constructs. Avoid language-specific types, generics syntax, framework annotations, or other constructs tied to a particular language or framework. General technical terms (null values, JSON types, HTTP status codes) are fine. Language-specific guidance belongs in `***implementation reqs***`.
52
-
53
- ### No Conflicts
54
-
55
- The new spec must not contradict any existing functional spec. Conflicting specs are the most costly outcome. Before adding, review all existing specs and verify the new one is compatible. Use `analyze-func-specs` to check the new spec against every existing spec in **one batched call** — it lists every conflicting pair, so a pair-by-pair analyzer is not needed. If ambiguity exists, add explicit detail to eliminate any conflicting interpretation. For each conflicting pair the batched analyzer reports, use the `resolve-spec-conflict` skill to diagnose and fix it before proceeding.
56
-
57
- ### Disambiguation
58
-
59
- Each functional spec must be unambiguous — the renderer should have only one reasonable interpretation. If a single line is not enough to fully disambiguate the behavior, use **nested sub-bullets** to add detail. Nested lines clarify the parent spec; they do not introduce separate functionality. Even with nested detail, the spec must still imply ≤ 200 LOC.
60
-
61
- ```plain
62
- ***functional specs***
63
-
64
- - A :User: can send a :Message: to a :Conversation:.
65
- - A :Message: must have non-empty content.
66
- - The :Message: is appended to the end of the :Conversation:.
67
- - All :Participant: members of the :Conversation: can see the new :Message:.
68
- ```
69
-
70
-
71
- ### Deterministic Interface
72
-
73
- Specs must be detailed enough that a developer can use the built software without reading the generated code. All external interfaces must be explicit — REST endpoint paths and HTTP methods, CLI command names and arguments, file formats, message schemas, etc. Never leave interface details up to the renderer's discretion.
74
-
75
- ### Encapsulation
76
-
77
- Functionality must be self-contained in the spec text. `requires` modules only import functional specs, so do not rely on implementation reqs to convey behavior — they won't be visible in downstream modules.
78
-
79
- ## Acceptance Tests
80
-
81
- If the functional spec needs verification, use the `add-acceptance-test` skill to add acceptance tests after inserting the spec.
82
-
83
- ## Validation Checklist
84
-
85
- - [ ] Spec implies ≤ 200 lines of code changes
86
- - [ ] No conflict with any existing functional spec
87
- - [ ] Written in language-agnostic terms (no language/framework specifics)
88
- - [ ] All external interfaces are explicit (endpoint paths, methods, CLI args, formats, etc.)
89
- - [ ] All referenced `:Concepts:` are defined in `***definitions***`
90
- - [ ] Sentences are short, clear, and unambiguous
91
- - [ ] Trimmed per `concise-specs.md`: nothing obvious, no rationale, no uncheckable adjectives or hedges, plain words throughout
92
- - [ ] No redundancy with existing specs
93
- - [ ] Placed where it best fits: below what it builds on, above what builds on it, beside its feature's specs
@@ -1,128 +0,0 @@
1
- ---
2
- name: add-functional-specs
3
- description: >-
4
- Add multiple functional specs to the ***functional specs*** section of a
5
- ***plain spec file in a single batch. Use whenever more than one new
6
- functional spec is being added — whether the user explicitly asks, or
7
- another skill/workflow (e.g. `brood`, `bud`) needs to author
8
- several specs in one pass. Bulk-writing or hand-authoring functional
9
- specs without invoking this skill is forbidden; for adding a single spec,
10
- use add-functional-spec instead.
11
- allowed-tools: [read, write, edit, bash, ls, grep, find]
12
- ---
13
-
14
- # Add Functional Specs
15
-
16
- ## When to Use
17
-
18
- - The user asks for several functional specs to be added in one go (e.g. "add these three specs", "spec out this feature in a few bullets").
19
- - A higher-level skill or workflow (`brood`, `bud`, `debug-specs`) needs to author a tight group of related specs.
20
- - Anywhere you would otherwise be tempted to write more than one functional spec without running per-spec analysis.
21
-
22
- If you only need to add a single spec, use the `add-functional-spec` skill instead. Either way, **never** edit the `***functional specs***` section by hand — every new entry must go through one of these two skills so the complexity and conflict checks actually run.
23
-
24
- ## Workflow
25
-
26
- This skill is `add-functional-spec` applied **one spec at a time, in order**, with no shortcuts. The batch never escapes per-spec rigor.
27
-
28
- 1. **Identify the target `.plain` file.** If ambiguous, ask the user.
29
- 2. **Read the entire file** to understand existing definitions, implementation reqs, and all current functional specs (including those reachable via `import` / `requires`).
30
- 3. **Draft all the specs you intend to add**, in the chronological order they should appear. Keep the drafts in a working list — nothing is inserted yet. Run the review pass in `concise-specs.md` over every draft before continuing; trim each to the shortest wording that keeps every fact.
31
- 4. **For each drafted spec, in order:**
32
- 1. **Analyze complexity.** Run `analyze-if-func-spec-too-complex` on the spec. If the verdict is `TOO COMPLEX`, run `break-down-func-spec`, replace the entry in the working list with the resulting smaller specs (preserving order), and restart this step on the first of the replacements.
33
- 2. **Check for conflicts.** Run `analyze-func-specs` **once** with this single input set:
34
- - the new spec, plus
35
- - every existing functional spec in the file and its `requires` chain, plus
36
- - every spec from this batch that has already been inserted.
37
-
38
- The batched analyzer returns every conflicting pair in one call — do **not** loop over pairs invoking a per-pair analyzer. For each conflicting pair it reports, run `resolve-spec-conflict`. Apply the resolution — which may revise the new spec, an existing spec, or both — then re-run `analyze-func-specs` once over the touched set until the verdict is `COMPATIBLE`.
39
- 3. **Insert the spec where it best fits** in the `***functional specs***` section - see Placement below.
40
- 5. **Read the file again** to confirm correct placement, ordering, and syntax for the full batch.
41
-
42
- Order matters: each new spec is inserted only after its complexity and conflict checks pass, so subsequent specs in the batch are always checked against an already-validated file.
43
-
44
- ## Rules
45
-
46
- All the rules from `add-functional-spec` apply per individual spec. They are restated here so this skill is self-contained.
47
-
48
- ### Complexity Limit (per spec)
49
-
50
- Each functional spec must imply a **maximum of 200 changed lines of code**. If a spec is too large, use `break-down-func-spec` to split it into multiple smaller, independent specs. Do not include LOC estimates in the spec text.
51
-
52
- ### Chronological Ordering
53
-
54
- Specs are rendered incrementally, top to bottom. The renderer has **no knowledge of future specs** — only previously rendered specs are in context.
55
- - A new spec can reference behavior defined by earlier specs.
56
- - A new spec **cannot** assume anything about specs that come after it.
57
- - Order the batch so that each spec only depends on specs that precede it. If two new specs would otherwise reference each other, the dependent one comes second.
58
-
59
- ### Placement
60
-
61
- Put each new spec where it best fits the spec as it reads, not at the end by default:
62
- - **Below every spec it builds on** - each spec whose behaviour it references or extends, the batch's own included, and the first spec using each concept it relies on.
63
- - **Above every existing spec that builds on it** - one that already assumes what the new spec adds.
64
- - **Within those bounds, beside the specs of the same feature** - usually straight after the last spec it extends, so a feature's specs read as one group.
65
- - **At the end** only when it starts something new or fits nowhere better.
66
-
67
- The batch need not stay together: each spec goes where it fits. An insertion in the middle costs no more than one at the end: turri regenerates it as one addition, and the specs after it are not rebuilt (`turri-regeneration.md`). Never append just to avoid moving the numbering.
68
-
69
- ### Language Agnosticism
70
-
71
- Write in terms of behavior, concepts, and domain logic — not implementation constructs. Avoid language-specific types, generics syntax, framework annotations, or other constructs tied to a particular language or framework. General technical terms (null values, JSON types, HTTP status codes) are fine. Language-specific guidance belongs in `***implementation reqs***`.
72
-
73
- ### No Conflicts (full coverage via one batched call per spec)
74
-
75
- The new specs must not contradict each other **and** must not contradict any existing functional spec. Conflicting specs are the most costly outcome. The conflict check must cover:
76
- - every (new × existing) pair, and
77
- - every (new × new) pair within the batch.
78
-
79
- That coverage is achieved by running `analyze-func-specs` **once per spec being inserted**, with the new spec plus every existing spec plus every already-inserted spec from this batch passed in as a single set. The batched analyzer lists every conflicting pair in one call — do not invoke a pair-by-pair analyzer. If ambiguity exists, add explicit detail to eliminate any conflicting interpretation. For each conflicting pair the batched analyzer reports, use the `resolve-spec-conflict` skill to diagnose and fix it before proceeding.
80
-
81
- ### Disambiguation (per spec)
82
-
83
- Each functional spec must be unambiguous — the renderer should have only one reasonable interpretation. If a single line is not enough to fully disambiguate the behavior, use **nested sub-bullets** to add detail. Nested lines clarify the parent spec; they do not introduce separate functionality. Even with nested detail, the spec must still imply ≤ 200 LOC.
84
-
85
- ```plain
86
- ***functional specs***
87
-
88
- - A :User: can send a :Message: to a :Conversation:.
89
- - A :Message: must have non-empty content.
90
- - The :Message: is appended to the end of the :Conversation:.
91
- - All :Participant: members of the :Conversation: can see the new :Message:.
92
- ```
93
-
94
-
95
- ### Deterministic Interface
96
-
97
- Specs must be detailed enough that a developer can use the built software without reading the generated code. All external interfaces must be explicit — REST endpoint paths and HTTP methods, CLI command names and arguments, file formats, message schemas, etc. Never leave interface details up to the renderer's discretion.
98
-
99
- ### Encapsulation
100
-
101
- Functionality must be self-contained in the spec text. `requires` modules only import functional specs, so do not rely on implementation reqs to convey behavior — they won't be visible in downstream modules.
102
-
103
- ## Acceptance Tests
104
-
105
- If any of the newly added functional specs need verification, use the `add-acceptance-test` skill to add acceptance tests after the batch has been inserted. Do this per spec, not as part of the bulk pass.
106
-
107
- ## Anti-Patterns
108
-
109
- - **Don't skip per-spec checks because the batch "feels" small.** Even two specs require two complexity checks and a batched conflict check that includes both new specs.
110
- - **Don't fall back to pair-by-pair conflict analysis.** Use `analyze-func-specs` with the full relevant set once per inserted spec — not `analyze-2-func-specs` across every pair.
111
- - **Don't run all complexity checks first and all conflict checks last.** Interleave them per spec, as described in the Workflow — a failed complexity check earlier would otherwise waste later conflict checks.
112
- - **Don't insert every spec first and then analyze.** A bad spec already in the file pollutes subsequent conflict analyses.
113
- - **Don't fall back to hand-authoring** because there are "a lot" of specs to add. The right answer is more analyzer calls, not fewer.
114
- - **Don't use this skill for a single spec.** Use `add-functional-spec` — it's the same checks without the bulk bookkeeping.
115
-
116
- ## Validation Checklist
117
-
118
- - [ ] Every spec in the batch implies ≤ 200 lines of code changes (verified via `analyze-if-func-spec-too-complex`)
119
- - [ ] No conflict between any new spec and any existing spec (verified via batched `analyze-func-specs` calls)
120
- - [ ] No conflict between any two new specs in the batch (covered by the same batched `analyze-func-specs` calls)
121
- - [ ] Every conflicting pair the batched analyzer reported was resolved via `resolve-spec-conflict` before the batch completed
122
- - [ ] All specs written in language-agnostic terms (no language/framework specifics)
123
- - [ ] All external interfaces explicit (endpoint paths, methods, CLI args, formats, etc.)
124
- - [ ] All referenced `:Concepts:` are defined in `***definitions***`
125
- - [ ] Sentences are short, clear, and unambiguous
126
- - [ ] Every spec trimmed per `concise-specs.md`: nothing obvious, no rationale, no uncheckable adjectives or hedges, plain words throughout
127
- - [ ] No redundancy with existing specs or within the batch
128
- - [ ] Each spec placed where it best fits: below what it builds on, above what builds on it, beside its feature's specs
@@ -1,85 +0,0 @@
1
- ---
2
- name: add-implementation-requirement
3
- description: >-
4
- Add an implementation requirement to the ***implementation reqs*** section of
5
- a ***plain spec file. Use when the user wants to add non-functional
6
- requirements like technology choices, architectural constraints, coding
7
- standards, data formats, error handling strategies, or any HOW-to-build
8
- guidance to a .plain file.
9
- allowed-tools: [read, write, edit, bash, ls, grep, find]
10
- ---
11
-
12
- # Add Implementation Requirement
13
-
14
- ## Workflow
15
-
16
- 1. **Identify the target `.plain` file.** If ambiguous, ask the user.
17
- 2. **Read the file** to understand existing implementation reqs, definitions, and functional specs.
18
- 3. **Determine if this belongs in implementation reqs** — it must describe HOW to build, not WHAT to build (that goes in `***functional specs***`).
19
- 4. **Draft the requirement** following the rules below.
20
- 5. **Insert it** into the `***implementation reqs***` section.
21
- 6. **Read the file again** to confirm correct placement and syntax.
22
-
23
- ## What Belongs Here
24
-
25
- Implementation reqs are free-form instructions that steer code generation. Common contents:
26
-
27
- - **Technology choices**: language, framework, runtime version
28
- - **Architectural constraints**: patterns, layering, dependency rules
29
- - **Coding standards**: naming conventions, style guidelines
30
- - **Data formats**: serialization, encoding, transformation rules
31
- - **Error handling**: strategies, retry logic, exception hierarchies
32
- - **Algorithm descriptions**: specific approaches when behavior alone is insufficient
33
- - **Performance guidance**: memory constraints, streaming requirements, batching strategies
34
- - **Language-specific constructs**: generics, annotations, framework-specific types and idioms
35
-
36
- ## What Does NOT Belong Here
37
-
38
- - **Behavior and features** — those go in `***functional specs***`
39
- - **Concept definitions** — those go in `***definitions***`
40
- - **Conformance-test instructions** — those go in `***test reqs***`. Note: **unit-test instructions belong HERE**, not in `***test reqs***` — see *Unit-test guidance belongs here* below
41
-
42
- ## Unit-test guidance belongs here
43
-
44
- **Everything about `:UnitTests:` goes in `***implementation reqs***`** — paths, approach, packages, framework (JUnit / pytest / Jest / Go's `testing` / …), conventions, fixtures, mocking policy, file layout, naming, lint / static-analysis gates. Unit tests are part of the generated codebase, so requirements that shape them are implementation reqs by definition.
45
-
46
- - The unit-test generator reads **only** `***implementation reqs***`; anything about `:UnitTests:` placed in `***test reqs***` is silently ignored
47
- - Phrase each `:UnitTests:` requirement in terms of the predefined `:UnitTests:` concept so the partition stays visible at a glance
48
- - `***test reqs***` is exclusively for `:ConformanceTests:` — see [`add-test-requirement`](../add-test-requirement/SKILL.md)
49
-
50
- ## Key Principle: HOW vs WHAT
51
-
52
- `***implementation reqs***` describe HOW the software should be built. `***functional specs***` describe WHAT the software should do.
53
-
54
- If the requirement describes observable behavior (endpoints, business rules, user-facing features), it belongs in functional specs. If it describes internal structure, technology, or coding guidance, it belongs here.
55
-
56
- ## Format
57
-
58
- Implementation reqs are bullet points in the `***implementation reqs***` section:
59
-
60
- ```plain
61
- ***implementation reqs***
62
-
63
- - :Implementation: should be in Python 3.12.
64
-
65
- - :Implementation: should use pip for dependency management.
66
-
67
- - :ReportExporter: writes a :CsvFile: with streaming writes, never holding the full dataset in memory.
68
-
69
- ```
70
-
71
- Reference defined `:Concepts:` where they add clarity. Implementation reqs in non-leaf sections apply to all subsections.
72
-
73
-
74
- ## Encapsulation Warning
75
-
76
- `requires` modules only receive functional specs from their dependencies — not implementation reqs. If downstream modules need certain behavior to be visible, that behavior must be expressed in functional specs, not here.
77
-
78
- ## Validation Checklist
79
-
80
- - [ ] Describes HOW to build, not WHAT to build
81
- - [ ] All referenced `:Concepts:` are defined in `***definitions***`
82
- - [ ] Does not duplicate guidance already present in the file or its imports
83
- - [ ] Trimmed per `concise-specs.md`: plain words, no rationale, no standard behavior of a technology already named
84
- - [ ] Placed inside a `***implementation reqs***` section
85
- - [ ] No behavioral requirements that should be in `***functional specs***`
@@ -1,105 +0,0 @@
1
- ---
2
- name: add-resource
3
- description: >-
4
- Add a linked resource (external file reference) to a ***plain spec. Use when
5
- the user wants to reference a JSON schema, API spec, data file, or other
6
- external file from within a functional spec, definition, or implementation
7
- requirement.
8
- allowed-tools: [read, write, edit, bash, ls, grep, find]
9
- ---
10
-
11
- # Add Resource
12
-
13
- Linked resources are external files referenced from within a `.plain` spec using markdown link syntax. The file contents are passed to the renderer alongside the spec, providing additional context for code generation.
14
-
15
- ## Workflow
16
-
17
- 1. **Identify or create the resource file.** Keep it inside the project — the `resources/` directory is the conventional home; it does not have to sit next to the `.plain` file.
18
- 2. **Add the markdown link** at the appropriate place in the spec.
19
- 3. **Verify the file path** is relative to the `.plain` file location.
20
- 4. **Read the file back** to confirm correct link syntax and path.
21
-
22
- ## Format
23
-
24
- Use standard markdown link syntax inside any spec section:
25
-
26
- ```plain
27
- ***definitions***
28
- - :AuthData: is the authentication data structure.
29
- - Its format is defined in the [auth schema](resources/auth_schema.json).
30
-
31
- ***implementation reqs***
32
- - When transforming :BackupData:, use the JOLT transform.
33
- - The transform is defined in [backup_transform.jolt](resources/backup_transform.jolt).
34
-
35
- ***functional specs***
36
-
37
- - An API conforming to the [API specification](resources/api_spec.yaml) is exposed.
38
- ```
39
-
40
- ## Path Rules
41
-
42
- - Paths are resolved **relative to the directory where `turri` is run** (the current working directory).
43
- - Relative paths may traverse into parent directories — `[resource](../../resources/resource.md)` is valid — as long as they resolve to a real text file on disk.
44
- - **No external URLs** — only local file references.
45
- - **No folder paths** — the target must be a file, not a directory.
46
- - Only text-based files are supported.
47
-
48
- ### A linked resource MUST be a single, text-based file that exists on disk
49
-
50
- A linked resource is **always** a single file that exists on disk at the path you reference, **and** that file's content must be text-based. The renderer reads the linked file's bytes and feeds them into the model alongside the spec; a directory, a remote URL, or a binary blob breaks that contract and is one of the most disruptive mistakes you can make when authoring a `.plain` file — the spec looks valid but the renderer either silently ignores the link, fails to read it, or wastes the model's context window on bytes it cannot interpret.
51
-
52
- Three things a linked resource **must not** be:
53
-
54
- 1. **A folder / directory.** `[integrations](src/integrations/)`, `[schemas](resources/schemas/)`, `[host project](../host_project/)` are all invalid — the renderer cannot ingest a directory. If a whole directory's worth of content is relevant, pick the single most representative **file** inside it (a `README.md`, an exemplar source file, a manifest at the directory root) and link **that**.
55
- 2. **A URL / external location.** `[Stripe docs](https://stripe.com/docs/api)`, `[OpenAPI spec](https://example.com/openapi.json)`, any `http://` / `https://` / `ftp://` / `git://` / `s3://` / `gs://` target. Linked resources are local-file only. If a URL's content is essential to the spec, fetch it once, save the response to a text file under `resources/` (e.g. `resources/stripe-docs-snapshot.md`, `resources/example-openapi.yaml`), and link **that file**.
56
- 3. **A binary file.** PNG, JPG, JPEG, GIF, BMP, TIFF, WebP, ICO, PDF, DOCX, XLSX, PPTX, ZIP, TAR, GZ, MP3, MP4, WAV, compiled binaries (`.exe`, `.so`, `.dylib`, `.class`, `.wasm`), and anything else that isn't human-readable text in its raw form. Binary content cannot be meaningfully consumed by the renderer; linking a screenshot, a PDF spec, or a packaged artifact accomplishes nothing except bloating the context. If the information in a binary asset is essential, transcribe it into a text-based form first — a UI screenshot becomes a Markdown description or a structured YAML wireframe under `resources/`; a PDF spec becomes a Markdown extract or the underlying JSON Schema / OpenAPI; an architecture diagram becomes a Mermaid block inside a Markdown file.
57
-
58
- If the markdown-link target ends with `/`, contains `://`, points at a path that resolves to a directory, or points at a file with a binary extension (see the list above), **stop** — it cannot be a linked resource. Convert it to a text file under `resources/` first, then link the converted file.
59
-
60
- ### Do not mention URLs or folder paths in `.plain` content at all
61
-
62
- The constraint above is **not** just about markdown link syntax. URLs (any `http://`, `https://`, `ftp://`, `git://`, `s3://`, … string) and folder paths (`src/integrations/`, `../host_project/`, anything ending with `/`, anything that resolves to a directory) **must not appear anywhere in `.plain` content** — not as link targets, not in concept body prose, not in functional-spec text, not in implementation-reqs. Mentioning a URL or a folder in prose is a critical and common mistake because:
63
-
64
- - The renderer cannot follow URLs or open folders. A URL or folder reference in prose is a *ghost* dependency: it looks meaningful to a human reader, but it contributes nothing to code generation. Worse, downstream readers (and future you) assume the renderer used the referenced content, so the spec drifts from reality.
65
- - The fix is always the same: if external content matters, fetch it (or pick one canonical file out of the directory), save it as a text file under `resources/`, and refer to it through a normal linked resource. The concept or spec then names the content through the linked file, not through a URL or folder path string.
66
-
67
- The **only** exceptions are URLs and paths that are *values the produced software itself uses at runtime* (e.g. the base URL the integration calls, a database connection path, a CLI argument value). Those are configuration values, not external references, and they belong in the spec because the generated code needs them. A useful litmus test: "Would the renderer benefit from reading the bytes at this URL / folder?" If yes, save it to a text file and link the file. If no (it's a runtime value), it can stay as plain text in the spec.
68
-
69
- ### What a linked resource CAN be
70
-
71
- - A single file inside the project, reachable by a path relative to where `turri` is run — parent-directory traversal (`../`) is allowed (`resources/` is the conventional home).
72
- - A **text-based** file the renderer can read end-to-end: JSON, YAML, XML, HTML, Markdown, plain text, CSV, TSV, source code in any language (`.py`, `.js`, `.ts`, `.go`, `.java`, `.rb`, `.rs`, `.kt`, `.swift`, `.c`, `.cpp`, `.cs`, …), shell scripts, SQL, JSON Schema, OpenAPI, AsyncAPI, Protobuf `.proto`, GraphQL SDL, `.jolt`, `.env.example`, `.toml`, `.ini`, `.proto`, `Dockerfile`, etc.
73
-
74
- ## Common Resource Types
75
-
76
- | Type | Typical location | Use case |
77
- |------|-----------------|----------|
78
- | JSON Schema | `resources/*.json` | Defining data structure contracts |
79
- | OpenAPI / Swagger spec | `resources/*.yaml` | API endpoint definitions |
80
- | Data transforms | `resources/*.jolt` | Data transformation rules |
81
- | Test fixtures | `resources/*.json`, `resources/*.csv` | Sample data for tests |
82
- | Configuration examples | `resources/*.yaml` | Reference configurations |
83
-
84
- ## When to Use Resources
85
-
86
- - The information is too detailed or structured to express inline in the spec (e.g., a full JSON schema).
87
- - The same data is referenced by multiple specs or sections.
88
- - The resource is an industry-standard format (OpenAPI, JSON Schema) that the renderer can interpret directly.
89
-
90
- ## When NOT to Use Resources
91
-
92
- - The information is short enough to include inline in the spec text.
93
- - The file is generated code (those belong in `plain_modules/`, not `resources/`).
94
-
95
- ## Validation Checklist
96
-
97
- - [ ] Resource file exists at the specified path
98
- - [ ] **Target is a file on disk, not a directory** (the path does not end in `/` and does not resolve to a folder)
99
- - [ ] **Target is a local path, not a URL** (no `://` anywhere in the target: no `http://`, `https://`, `ftp://`, `git://`, `s3://`, `gs://`, etc.)
100
- - [ ] **Target is a text-based file** (no binary extensions: `.png`, `.jpg`, `.jpeg`, `.gif`, `.bmp`, `.tiff`, `.webp`, `.ico`, `.pdf`, `.docx`, `.xlsx`, `.pptx`, `.zip`, `.tar`, `.gz`, `.mp3`, `.mp4`, `.wav`, `.exe`, `.so`, `.dylib`, `.class`, `.wasm`, …)
101
- - [ ] **No URLs or folder paths anywhere in the surrounding `.plain` content** (not as link targets, not in body prose), with the sole exception of URLs / paths that are runtime values the generated software itself uses
102
- - [ ] Path is relative to the `.plain` file, not absolute
103
- - [ ] Path resolves to a real text file on disk from where `turri` is run (`../` traversal is allowed)
104
- - [ ] Markdown link syntax is correct: `[display text](relative/path)`
105
- - [ ] Resource content is relevant and adds value beyond what the spec text says
@@ -1,64 +0,0 @@
1
- ---
2
- name: add-template
3
- description: >-
4
- Create or include a Liquid template in a ***plain spec file using
5
- {% include %} syntax. Use when the same spec content needs to be reused
6
- across multiple .plain files with different parameters.
7
- allowed-tools: [read, write, edit, bash, ls, grep, find]
8
- ---
9
-
10
- # Add Template
11
-
12
- Templates use Liquid syntax (`{% include %}`) to reuse the same spec content across multiple `.plain` files. Each inclusion can pass different parameters, producing tailored output from a single source. This is distinct from `import` and `requires` — templates are about textual reuse with parameterization, not module dependencies.
13
-
14
- ## When to Use Templates
15
-
16
- - The **exact same spec structure** is needed in more than one `.plain` file.
17
- - The reused content differs only in specific values (names, paths, config) that can be parameterized.
18
- - You want a single source of truth for a pattern that appears in multiple modules.
19
-
20
- ## Format
21
-
22
- ### Including a Template
23
-
24
- Use `{% include %}` with the template path and parameters:
25
-
26
- ```plain
27
- {% include "console_app_template.plain", main_file_name: "app.py", app_name: "MyApp" %}
28
- ```
29
-
30
- Parameters are passed as key-value pairs after the template path. Inside the template, parameters are accessed using Liquid variable syntax (`{{ main_file_name }}`).
31
-
32
- ### Writing a Template
33
-
34
- Templates live in the `template/` directory. Only **variables** (`{{ variable_name }}`) are supported — conditionals, loops, and other Liquid features are not available:
35
-
36
- ```plain
37
- ***definitions***
38
- - :{{ app_name }}MainFile: is the entry point file for :{{ app_name }}:.
39
-
40
- ***implementation reqs***
41
- - :{{ app_name }}MainFile: should be called "{{ main_file_name }}".
42
- ```
43
-
44
- ## Workflow: Including an Existing Template
45
-
46
- 1. **Check the `template/` directory** to see what templates are available.
47
- 2. **Read the template** to understand what parameters it expects and what content it produces.
48
- 3. **Add the `{% include %}` statement** to the target `.plain` file with the correct parameters.
49
- 4. **Verify** that the expanded content does not introduce concept name collisions or duplicate sections.
50
-
51
- ## Workflow: Creating a New Template
52
-
53
- 1. **Identify the repeated pattern** — find spec content that is duplicated (or will be duplicated) across multiple `.plain` files.
54
- 2. **Extract the common content** into a new `.plain` file in the `template/` directory.
55
- 3. **Parameterize the differences** — replace the varying parts with Liquid variables.
56
- 4. **Update the original files** to use `{% include %}` instead of the duplicated content.
57
-
58
- ## Validation Checklist
59
-
60
- - [ ] Template file is in the `template/` directory
61
- - [ ] All varying parts are parameterized with Liquid variables
62
- - [ ] All required parameters are passed at each `{% include %}` call site
63
- - [ ] Expanded content does not introduce concept name collisions
64
- - [ ] Template is used by more than one `.plain` file (otherwise, inline the content)
@@ -1,73 +0,0 @@
1
- ---
2
- name: add-test-requirement
3
- description: >-
4
- Add a test requirement to the ***test reqs*** section of a ***plain spec
5
- file. Use when the user wants to specify conformance testing instructions
6
- like test frameworks, execution methods, or testing constraints in a .plain
7
- file.
8
- allowed-tools: [read, write, edit, bash, ls, grep, find]
9
- ---
10
-
11
- # Add Test Requirement
12
-
13
- ## Workflow
14
-
15
- 1. **Identify the target `.plain` file.** If ambiguous, ask the user.
16
- 2. **Read the file** to understand existing test reqs and the overall spec structure.
17
- 3. **Confirm this is a conformance test concern** — unit test guidance goes in `***implementation reqs***`, not here.
18
- 4. **Draft the requirement** following the rules below.
19
- 5. **Insert it** into the `***test reqs***` section.
20
- 6. **Read the file again** to confirm correct placement and syntax.
21
-
22
- ## What Belongs Here
23
-
24
- Test reqs specify how **conformance tests** should be written and run. Common contents:
25
-
26
- - **Test framework**: which framework to use (e.g., pytest, Unittest, xUnit)
27
- - **Execution method**: the command to run the tests
28
- - **Testing constraints**: what must or must not be done in tests (e.g., no skipping tests, mock requirements)
29
- - **Test data**: how test fixtures or mock data should be structured
30
- - **Environment setup**: any prerequisites for running conformance tests
31
-
32
- ## What Does NOT Belong Here
33
-
34
- - **Unit test guidance** — that goes in `***implementation reqs***`
35
- - **Acceptance tests** — those are nested under individual functional specs in `***functional specs***`
36
- - **Behavioral requirements** — those go in `***functional specs***`
37
- - **Technology choices for the implementation** — those go in `***implementation reqs***`
38
-
39
- ## Conformance Tests vs Other Tests
40
-
41
- | Test Type | Where to Specify | Purpose |
42
- |-----------|-----------------|---------|
43
- | Unit tests | `***implementation reqs***` | Test individual functionalities in isolation |
44
- | Conformance tests | `***test reqs***` | Verify implementation conforms to the full spec |
45
- | Acceptance tests | `***acceptance tests***` under a functional spec | Verify a specific functional spec |
46
-
47
- ## Format
48
-
49
- Test reqs are bullet points in the `***test reqs***` section:
50
-
51
- ```plain
52
- ***test reqs***
53
-
54
- - :ConformanceTests: should be implemented using pytest framework.
55
-
56
- - :ConformanceTests: will be run using "pytest" command.
57
-
58
- - :ConformanceTests: must be implemented and executed - do not skip tests.
59
-
60
- - :ConformanceTests: should mock all external HTTP calls.
61
- ```
62
-
63
- Reference predefined concepts like `:ConformanceTests:` and any defined `:Concepts:` where they add clarity.
64
-
65
-
66
- ## Validation Checklist
67
-
68
- - [ ] Describes conformance testing concerns, not unit tests or behavior
69
- - [ ] All referenced `:Concepts:` are defined (or are predefined like `:ConformanceTests:`)
70
- - [ ] Does not duplicate guidance already present in the file or its imports
71
- - [ ] Trimmed per `concise-specs.md`: plain words, no rationale, no default framework behavior
72
- - [ ] Placed inside a `***test reqs***` section
73
- - [ ] No behavioral requirements that should be in `***functional specs***`