plain-forge 1.0.1
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.
- package/LICENSE +21 -0
- package/README.md +247 -0
- package/bin/cli.mjs +143 -0
- package/forge/docs/.gitkeep +0 -0
- package/forge/rules/definitions.md +57 -0
- package/forge/rules/exported-concepts.md +39 -0
- package/forge/rules/func-specs.md +72 -0
- package/forge/rules/impl-reqs.md +50 -0
- package/forge/rules/import-modules.md +51 -0
- package/forge/rules/required-concepts.md +45 -0
- package/forge/rules/requires-modules.md +59 -0
- package/forge/rules/test-reqs.md +47 -0
- package/forge/skills/add-acceptance-test/SKILL.md +98 -0
- package/forge/skills/add-concept/SKILL.md +67 -0
- package/forge/skills/add-feature/SKILL.md +136 -0
- package/forge/skills/add-functional-spec/SKILL.md +81 -0
- package/forge/skills/add-functional-specs/SKILL.md +115 -0
- package/forge/skills/add-implementation-requirement/SKILL.md +73 -0
- package/forge/skills/add-resource/SKILL.md +108 -0
- package/forge/skills/add-template/SKILL.md +65 -0
- package/forge/skills/add-test-requirement/SKILL.md +68 -0
- package/forge/skills/analyze-2-func-specs/SKILL.md +102 -0
- package/forge/skills/analyze-func-specs/SKILL.md +124 -0
- package/forge/skills/analyze-if-func-spec-too-complex/SKILL.md +152 -0
- package/forge/skills/break-down-func-spec/SKILL.md +156 -0
- package/forge/skills/check-plain-env/SKILL.md +288 -0
- package/forge/skills/consolidate-concepts/SKILL.md +193 -0
- package/forge/skills/create-import-module/SKILL.md +98 -0
- package/forge/skills/create-requires-module/SKILL.md +104 -0
- package/forge/skills/debug-specs/SKILL.md +189 -0
- package/forge/skills/forge-integration/SKILL.md +443 -0
- package/forge/skills/forge-plain/SKILL.md +333 -0
- package/forge/skills/implement-conformance-testing-script/SKILL.md +247 -0
- package/forge/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +324 -0
- package/forge/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +100 -0
- package/forge/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +102 -0
- package/forge/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +92 -0
- package/forge/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +100 -0
- package/forge/skills/implement-prepare-environment-script/SKILL.md +242 -0
- package/forge/skills/implement-prepare-environment-script/assets/prepare_environment_java.sh +42 -0
- package/forge/skills/implement-prepare-environment-script/assets/prepare_environment_python.sh +81 -0
- package/forge/skills/implement-unit-testing-script/SKILL.md +133 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +82 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +68 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_java.sh +45 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +76 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_python.sh +90 -0
- package/forge/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +83 -0
- package/forge/skills/init-config-file/SKILL.md +261 -0
- package/forge/skills/init-plain-project/SKILL.md +124 -0
- package/forge/skills/load-plain-reference/SKILL.md +646 -0
- package/forge/skills/plain-healthcheck/SKILL.md +132 -0
- package/forge/skills/refactor-module/SKILL.md +197 -0
- package/forge/skills/resolve-spec-conflict/SKILL.md +88 -0
- package/forge/skills/run-codeplain/SKILL.md +540 -0
- package/package.json +42 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init-plain-project
|
|
3
|
+
description: >-
|
|
4
|
+
Lightweight initializer for a new ***plain project. Asks about the base
|
|
5
|
+
technology and project kind, asks whether conformance testing is enabled,
|
|
6
|
+
then scaffolds a template import module (with base implementation reqs and
|
|
7
|
+
test reqs), a stub top-level module, the unit testing script, and
|
|
8
|
+
(optionally) the conformance and prepare-environment scripts plus a
|
|
9
|
+
config.yaml. Does NOT run `codeplain --dry-run`. Use when the user wants a
|
|
10
|
+
quick project skeleton to start writing functional specs against, without
|
|
11
|
+
the full forge-plain interview.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Init Plain Project
|
|
15
|
+
|
|
16
|
+
Always use the skill `load-plain-reference` to retrieve the ***plain syntax rules — but only if you haven't done so yet.
|
|
17
|
+
|
|
18
|
+
## Scope
|
|
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 dry-run validation. The user will fill those in afterwards with `add-feature`, `add-concept`, `add-functional-spec`, etc.
|
|
21
|
+
|
|
22
|
+
What this skill writes:
|
|
23
|
+
|
|
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.
|
|
26
|
+
- `test_scripts/run_unittests_<lang>.<sh|ps1>` — always.
|
|
27
|
+
- `test_scripts/run_conformance_tests_<lang>.<sh|ps1>` — only if conformance testing is enabled.
|
|
28
|
+
- `test_scripts/prepare_environment_<lang>.<sh|ps1>` — only if conformance testing is enabled **and** the user opts in.
|
|
29
|
+
- `config.yaml` at the project root — wired to whichever scripts were generated.
|
|
30
|
+
|
|
31
|
+
What this skill does **not** do:
|
|
32
|
+
|
|
33
|
+
- Run `codeplain --dry-run` or `plain-healthcheck`.
|
|
34
|
+
- Author concepts, functional specs, or acceptance tests.
|
|
35
|
+
- Probe the host environment (`check-plain-env` is a separate step the user can run later).
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
### 1. Ask the project basics
|
|
40
|
+
|
|
41
|
+
Use **AskUserQuestion** for one tight batch covering:
|
|
42
|
+
|
|
43
|
+
- **Project name** — used as the top module filename and as `:AppName:` later. Free-form.
|
|
44
|
+
- **Base technology** — programming language and primary framework (e.g. Python + FastAPI, Node.js + Express, Go + net/http, Java + Spring Boot). Offer the most common stacks plus free-form.
|
|
45
|
+
- **Project kind** — CLI tool, web app, REST API / backend service, library, desktop app, mobile app, other. Offer the common kinds plus free-form.
|
|
46
|
+
|
|
47
|
+
Follow up with a free-form prompt for anything the options didn't cover (e.g. specific Python version, monorepo layout).
|
|
48
|
+
|
|
49
|
+
### 2. Ask about testing
|
|
50
|
+
|
|
51
|
+
Use **AskUserQuestion** for one tight batch covering:
|
|
52
|
+
|
|
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.
|
|
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
|
+
|
|
57
|
+
### 3. Author `template/base.plain`
|
|
58
|
+
|
|
59
|
+
Create the import module with `create-import-module`. It must contain:
|
|
60
|
+
|
|
61
|
+
- `***implementation reqs***` — the base stack as requirements:
|
|
62
|
+
- Programming language and version.
|
|
63
|
+
- Primary framework (if any).
|
|
64
|
+
- Dependency / package manager.
|
|
65
|
+
- Project kind as a constraint (e.g. ":Implementation: should be a REST API service.").
|
|
66
|
+
- Anything else the user added in the free-form catch-all.
|
|
67
|
+
- `***test reqs***` — the base testing rules:
|
|
68
|
+
- Unit testing framework and the command used to run it.
|
|
69
|
+
- ":ConformanceTests: must be implemented and executed - do not skip tests." — only if conformance testing is enabled. Add framework + command for conformance tests too.
|
|
70
|
+
|
|
71
|
+
Do **not** add a `***definitions***` section to `template/base.plain`. This skill does not author any concepts. Use only the predefined concepts (`:Implementation:`, `:ConformanceTests:`) in the reqs — no project-specific concepts like `:AppName:` or `:App:`. Do not declare `required_concepts` either.
|
|
72
|
+
|
|
73
|
+
Do **not** add `***functional specs***` to `template/base.plain` — it is an import module.
|
|
74
|
+
|
|
75
|
+
### 4. Author the top module `<project>.plain`
|
|
76
|
+
|
|
77
|
+
Create it at the repo root with frontmatter:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
---
|
|
81
|
+
import:
|
|
82
|
+
- base
|
|
83
|
+
description: <one-line project description>
|
|
84
|
+
---
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Body: **none**. The file ends after the closing `---` of the frontmatter. Do **not** add `***definitions***`, do **not** add `***functional specs***`, do **not** add any other section. The user will add `***functional specs***` later via `add-functional-spec` / `add-functional-specs`, and any concepts via `add-concept`.
|
|
88
|
+
|
|
89
|
+
The file must still be created on disk — an empty body is fine, but the file itself is required.
|
|
90
|
+
|
|
91
|
+
### 5. Generate the testing scripts
|
|
92
|
+
|
|
93
|
+
Call the corresponding implementation skills in order. Each skill knows how to write the right Bash or PowerShell variant for the host OS.
|
|
94
|
+
|
|
95
|
+
- `implement-unit-testing-script` — always.
|
|
96
|
+
- `implement-conformance-testing-script` — only if conformance testing was enabled. If a prepare-environment script will also exist, choose the **activate-only** variant; otherwise the **install-inline** variant.
|
|
97
|
+
- `implement-prepare-environment-script` — only if conformance testing was enabled **and** the user opted in.
|
|
98
|
+
|
|
99
|
+
### 6. Write `config.yaml`
|
|
100
|
+
|
|
101
|
+
Create `config.yaml` at the project root with **only the keys for scripts that were actually generated**. Valid keys:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
unittests-script: test_scripts/run_unittests_<lang>.<sh|ps1>
|
|
105
|
+
conformance-tests-script: test_scripts/run_conformance_tests_<lang>.<sh|ps1>
|
|
106
|
+
prepare-environment-script: test_scripts/prepare_environment_<lang>.<sh|ps1>
|
|
107
|
+
template_dir: template
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Always include `template_dir: template` because the project has a template import module from step 3. Use `.sh` on macOS/Linux and `.ps1` on Windows, matching whatever the implement-* skills produced.
|
|
111
|
+
|
|
112
|
+
Do **not** invoke `init-config-file` or `plain-healthcheck` here — keeping this skill light is the whole point. The user can run them later if they want a strict canonicalization or a dry-run.
|
|
113
|
+
|
|
114
|
+
### 7. Recap
|
|
115
|
+
|
|
116
|
+
Tell the user what was created and what's next:
|
|
117
|
+
|
|
118
|
+
- Files written: `template/base.plain`, `<project>.plain`, the test scripts, `config.yaml`.
|
|
119
|
+
- 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`.
|
|
120
|
+
- Mention that `codeplain <project>.plain --dry-run` has not been run — they can run `plain-healthcheck` when they want validation.
|
|
121
|
+
|
|
122
|
+
## Question style
|
|
123
|
+
|
|
124
|
+
Use simple grammatical structures: short direct sentences, one idea per sentence, plain words over jargon. Keep every constraint and edge case the user needs to answer accurately.
|