@turri-dev/cli 0.0.0-stage → 0.1.2-next.48dacfc
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/.pi/themes/turri-dark.json +80 -0
- package/.pi/themes/turri-light.json +82 -0
- package/LICENSE +21 -0
- package/README.md +272 -2
- package/assets/jellyfish/dark-00.png +0 -0
- package/assets/jellyfish/dark-01.png +0 -0
- package/assets/jellyfish/dark-02.png +0 -0
- package/assets/jellyfish/dark-03.png +0 -0
- package/assets/jellyfish/dark-04.png +0 -0
- package/assets/jellyfish/dark-05.png +0 -0
- package/assets/jellyfish/dark-06.png +0 -0
- package/assets/jellyfish/dark-07.png +0 -0
- package/assets/jellyfish/dark-08.png +0 -0
- package/assets/jellyfish/dark-09.png +0 -0
- package/assets/jellyfish/dark-10.png +0 -0
- package/assets/jellyfish/dark-11.png +0 -0
- package/assets/jellyfish/dark-12.png +0 -0
- package/assets/jellyfish/dark-13.png +0 -0
- package/assets/jellyfish/dark-14.png +0 -0
- package/assets/jellyfish/fallback.txt +252 -0
- package/assets/jellyfish/light-00.png +0 -0
- package/assets/jellyfish/light-01.png +0 -0
- package/assets/jellyfish/light-02.png +0 -0
- package/assets/jellyfish/light-03.png +0 -0
- package/assets/jellyfish/light-04.png +0 -0
- package/assets/jellyfish/light-05.png +0 -0
- package/assets/jellyfish/light-06.png +0 -0
- package/assets/jellyfish/light-07.png +0 -0
- package/assets/jellyfish/light-08.png +0 -0
- package/assets/jellyfish/light-09.png +0 -0
- package/assets/jellyfish/light-10.png +0 -0
- package/assets/jellyfish/light-11.png +0 -0
- package/assets/jellyfish/light-12.png +0 -0
- package/assets/jellyfish/light-13.png +0 -0
- package/assets/jellyfish/light-14.png +0 -0
- package/bin/turri.mjs +29 -0
- package/dist/ask.js +149 -0
- package/dist/brand.js +50 -0
- package/dist/btw.js +174 -0
- package/dist/chat-models.js +37 -0
- package/dist/chat-skills.js +18 -0
- package/dist/cli.js +178 -0
- package/dist/config-command.js +197 -0
- package/dist/config-edit.js +367 -0
- package/dist/config.js +489 -0
- package/dist/conform-cli.js +29 -0
- package/dist/cultivate-cli.js +110 -0
- package/dist/drift-cli.js +25 -0
- package/dist/environment.js +70 -0
- package/dist/extension.js +2372 -0
- package/dist/genome.js +301 -0
- package/dist/graph.js +246 -0
- package/dist/identity.js +35 -0
- package/dist/init-config.js +511 -0
- package/dist/judge.js +62 -0
- package/dist/lineage-cli.js +13 -0
- package/dist/loop-cli.js +132 -0
- package/dist/loop-tools.js +225 -0
- package/dist/mature-tools.js +193 -0
- package/dist/model-check.js +117 -0
- package/dist/module-report.js +9 -0
- package/dist/pi-launch.js +31 -0
- package/dist/pi.js +813 -0
- package/dist/plain/check.js +76 -0
- package/dist/plain/concepts.js +213 -0
- package/dist/plain/errors.js +43 -0
- package/dist/plain/files.js +57 -0
- package/dist/plain/highlight.js +195 -0
- package/dist/plain/index.js +15 -0
- package/dist/plain/liquid.js +129 -0
- package/dist/plain/markdown.js +208 -0
- package/dist/plain/parser.js +752 -0
- package/dist/plain/plain.tmLanguage.json +124 -0
- package/dist/plain/spec.js +291 -0
- package/dist/plain/stdlib.js +44 -0
- package/dist/question-dialog.js +125 -0
- package/dist/questioning.js +109 -0
- package/dist/quiet.js +125 -0
- package/dist/regenerate/activity.js +187 -0
- package/dist/regenerate/agent-env.js +190 -0
- package/dist/regenerate/agent-shell.js +114 -0
- package/dist/regenerate/arbiter.js +133 -0
- package/dist/regenerate/audit.js +203 -0
- package/dist/regenerate/cases.js +83 -0
- package/dist/regenerate/change-view.js +102 -0
- package/dist/regenerate/choose-conformance.js +117 -0
- package/dist/regenerate/chunk-plan.js +625 -0
- package/dist/regenerate/codebase.js +75 -0
- package/dist/regenerate/command-check.js +312 -0
- package/dist/regenerate/compaction.js +20 -0
- package/dist/regenerate/confine.js +310 -0
- package/dist/regenerate/conform.js +133 -0
- package/dist/regenerate/conformance-agents.js +955 -0
- package/dist/regenerate/conformance.js +936 -0
- package/dist/regenerate/conversation-writes.js +100 -0
- package/dist/regenerate/credentials.js +88 -0
- package/dist/regenerate/debug-log.js +228 -0
- package/dist/regenerate/debugger.js +90 -0
- package/dist/regenerate/delivery.js +19 -0
- package/dist/regenerate/diagnose-job.js +40 -0
- package/dist/regenerate/diagnose.js +81 -0
- package/dist/regenerate/diff-view.js +240 -0
- package/dist/regenerate/drift.js +194 -0
- package/dist/regenerate/engine.js +118 -0
- package/dist/regenerate/environment-error.js +220 -0
- package/dist/regenerate/job-log.js +102 -0
- package/dist/regenerate/job-panel.js +336 -0
- package/dist/regenerate/jobs-tree.js +300 -0
- package/dist/regenerate/jobs.js +427 -0
- package/dist/regenerate/lanes.js +32 -0
- package/dist/regenerate/lineage.js +384 -0
- package/dist/regenerate/loop.js +1435 -0
- package/dist/regenerate/masking.js +95 -0
- package/dist/regenerate/notes.js +397 -0
- package/dist/regenerate/os-sandbox.js +243 -0
- package/dist/regenerate/paths.js +165 -0
- package/dist/regenerate/plain-palette.js +83 -0
- package/dist/regenerate/prompt.js +704 -0
- package/dist/regenerate/records.js +294 -0
- package/dist/regenerate/regenerate.js +598 -0
- package/dist/regenerate/regression.js +181 -0
- package/dist/regenerate/release.js +262 -0
- package/dist/regenerate/requires.js +241 -0
- package/dist/regenerate/resources.js +164 -0
- package/dist/regenerate/self-check.js +111 -0
- package/dist/regenerate/services.js +155 -0
- package/dist/regenerate/shell.js +320 -0
- package/dist/regenerate/side-panel.js +278 -0
- package/dist/regenerate/spec-map-view.js +574 -0
- package/dist/regenerate/spec-map.js +561 -0
- package/dist/regenerate/spec-steps.js +527 -0
- package/dist/regenerate/state.js +10 -0
- package/dist/regenerate/steer.js +91 -0
- package/dist/regenerate/steering.js +119 -0
- package/dist/regenerate/stop-report.js +161 -0
- package/dist/regenerate/submit-work.js +71 -0
- package/dist/regenerate/test-kinds.js +124 -0
- package/dist/regenerate/test-scripts.js +695 -0
- package/dist/regenerate/testing.js +406 -0
- package/dist/regenerate/transcript-view.js +1 -0
- package/dist/regenerate/unit-gate.js +20 -0
- package/dist/regenerate/unit-review.js +347 -0
- package/dist/regenerate/web.js +256 -0
- package/dist/regenerate/workspace.js +99 -0
- package/dist/regenerate-cli.js +68 -0
- package/dist/release-agent.js +114 -0
- package/dist/release-cli.js +131 -0
- package/dist/release-tools.js +148 -0
- package/dist/review/live.js +165 -0
- package/dist/rules.js +47 -0
- package/dist/self-invocation.js +110 -0
- package/dist/setup.js +245 -0
- package/dist/skill-progress.js +78 -0
- package/dist/skill.js +149 -0
- package/dist/skills.js +74 -0
- package/dist/spec-diff-cli.js +37 -0
- package/dist/spec-tools.js +155 -0
- package/dist/stack.js +158 -0
- package/dist/stacks.js +97 -0
- package/dist/stdlib.js +100 -0
- package/dist/terminal-images.js +46 -0
- package/dist/tools.js +242 -0
- package/dist/validate-cli.js +52 -0
- package/docs/README.md +58 -0
- package/docs/authoring-plain.md +245 -0
- package/docs/config.md +353 -0
- package/docs/deploy.md +109 -0
- package/docs/development.md +88 -0
- package/docs/headless.md +148 -0
- package/docs/images/how-turri-works.svg +50 -0
- package/docs/images/turri-banner.png +0 -0
- package/docs/installation.md +119 -0
- package/docs/parser.md +108 -0
- package/docs/regenerating.md +1116 -0
- package/docs/sandbox.md +233 -0
- package/docs/skills-and-gates.md +254 -0
- package/docs/theming.md +76 -0
- package/docs/using.md +454 -0
- package/genome/rules/bullet-continuation.md +69 -0
- package/genome/rules/concise-specs-examples.md +431 -0
- package/genome/rules/concise-specs-integration-examples.md +270 -0
- package/genome/rules/concise-specs.md +80 -0
- package/genome/rules/definitions.md +107 -0
- package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +163 -0
- package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +51 -0
- package/genome/rules/exported-concepts.md +39 -0
- package/genome/rules/func-specs.md +129 -0
- package/genome/rules/impl-reqs.md +68 -0
- package/genome/rules/import-modules.md +48 -0
- package/genome/rules/integration-embedded-testing.md +276 -0
- package/genome/rules/integration-embedded.md +171 -0
- package/genome/rules/integration-standalone.md +135 -0
- package/genome/rules/integrations.md +137 -0
- package/genome/rules/linked-resources.md +69 -0
- package/genome/rules/module-structure.md +105 -0
- package/genome/rules/project-model.md +88 -0
- package/genome/rules/required-concepts.md +44 -0
- package/genome/rules/requires-modules.md +80 -0
- package/genome/rules/stdlib.md +73 -0
- package/genome/rules/test-reqs.md +57 -0
- package/genome/skills/add-acceptance-test/SKILL.md +100 -0
- package/genome/skills/add-concept/SKILL.md +71 -0
- package/genome/skills/add-functional-spec/SKILL.md +84 -0
- package/genome/skills/add-functional-specs/SKILL.md +118 -0
- package/genome/skills/add-implementation-requirement/SKILL.md +86 -0
- package/genome/skills/add-resource/SKILL.md +105 -0
- package/genome/skills/add-template/SKILL.md +64 -0
- package/genome/skills/add-test-requirement/SKILL.md +73 -0
- package/genome/skills/analyze-2-func-specs/SKILL.md +101 -0
- package/genome/skills/analyze-func-specs/SKILL.md +123 -0
- package/genome/skills/analyze-if-func-spec-too-complex/SKILL.md +211 -0
- package/genome/skills/break-down-func-spec/SKILL.md +205 -0
- package/genome/skills/brood/SKILL.md +229 -0
- package/genome/skills/brood/references/intent.md +35 -0
- package/genome/skills/brood/references/product.md +101 -0
- package/genome/skills/brood/references/stack.md +61 -0
- package/genome/skills/brood/references/testing.md +56 -0
- package/genome/skills/bud/SKILL.md +148 -0
- package/genome/skills/bud/references/checklist.md +44 -0
- package/genome/skills/bud/references/intent.md +30 -0
- package/genome/skills/check-plain-env/SKILL.md +285 -0
- package/genome/skills/consolidate-concepts/SKILL.md +192 -0
- package/genome/skills/create-import-module/SKILL.md +104 -0
- package/genome/skills/create-requires-module/SKILL.md +109 -0
- package/genome/skills/debug-specs/SKILL.md +188 -0
- package/genome/skills/implement-conformance-testing-script/SKILL.md +238 -0
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +337 -0
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +111 -0
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +136 -0
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +103 -0
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +150 -0
- package/genome/skills/implement-unit-testing-script/SKILL.md +160 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +87 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +73 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +72 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +81 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +98 -0
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +87 -0
- package/genome/skills/init-plain-project/SKILL.md +117 -0
- package/genome/skills/init-plain-project/references/checklist.md +30 -0
- package/genome/skills/mature/SKILL.md +126 -0
- package/genome/skills/refactor-module/SKILL.md +196 -0
- package/genome/skills/resolve-section-ownership/SKILL.md +64 -0
- package/genome/skills/resolve-spec-conflict/SKILL.md +96 -0
- package/genome/skills/spawn/SKILL.md +163 -0
- package/package.json +68 -4
- package/stdlib/backend/common.plain +25 -0
- package/stdlib/backend/conformance/common.plain +12 -0
- package/stdlib/backend/conformance/go-gin.plain +9 -0
- package/stdlib/backend/conformance/go-nethttp.plain +9 -0
- package/stdlib/backend/conformance/java-springboot.plain +9 -0
- package/stdlib/backend/conformance/python-django.plain +9 -0
- package/stdlib/backend/conformance/python-fastapi.plain +9 -0
- package/stdlib/backend/conformance/python-flask.plain +9 -0
- package/stdlib/backend/conformance/rust-axum.plain +9 -0
- package/stdlib/backend/conformance/typescript-express.plain +9 -0
- package/stdlib/backend/conformance/typescript-fastify.plain +9 -0
- package/stdlib/backend/conformance/typescript-nestjs.plain +9 -0
- package/stdlib/backend/go-gin.plain +18 -0
- package/stdlib/backend/go-nethttp.plain +18 -0
- package/stdlib/backend/java-springboot.plain +19 -0
- package/stdlib/backend/python-django.plain +19 -0
- package/stdlib/backend/python-fastapi.plain +23 -0
- package/stdlib/backend/python-flask.plain +23 -0
- package/stdlib/backend/rust-axum.plain +17 -0
- package/stdlib/backend/typescript-express.plain +19 -0
- package/stdlib/backend/typescript-fastify.plain +19 -0
- package/stdlib/backend/typescript-nestjs.plain +19 -0
- package/stdlib/cli/common.plain +17 -0
- package/stdlib/cli/conformance/common.plain +11 -0
- package/stdlib/cli/conformance/go-cobra.plain +9 -0
- package/stdlib/cli/conformance/go-flag.plain +9 -0
- package/stdlib/cli/conformance/java-picocli.plain +9 -0
- package/stdlib/cli/conformance/python-argparse.plain +9 -0
- package/stdlib/cli/conformance/python-click.plain +9 -0
- package/stdlib/cli/conformance/python-typer.plain +9 -0
- package/stdlib/cli/conformance/rust-clap.plain +9 -0
- package/stdlib/cli/conformance/typescript-commander.plain +9 -0
- package/stdlib/cli/go-cobra.plain +14 -0
- package/stdlib/cli/go-flag.plain +14 -0
- package/stdlib/cli/java-picocli.plain +15 -0
- package/stdlib/cli/python-argparse.plain +18 -0
- package/stdlib/cli/python-click.plain +16 -0
- package/stdlib/cli/python-typer.plain +16 -0
- package/stdlib/cli/rust-clap.plain +14 -0
- package/stdlib/cli/typescript-commander.plain +17 -0
- package/stdlib/frontend/angular.plain +17 -0
- package/stdlib/frontend/common.plain +17 -0
- package/stdlib/frontend/conformance/angular.plain +5 -0
- package/stdlib/frontend/conformance/common.plain +11 -0
- package/stdlib/frontend/conformance/react-vite.plain +5 -0
- package/stdlib/frontend/conformance/sveltekit-spa.plain +5 -0
- package/stdlib/frontend/conformance/vue-vite.plain +5 -0
- package/stdlib/frontend/react-vite.plain +16 -0
- package/stdlib/frontend/sveltekit-spa.plain +16 -0
- package/stdlib/frontend/vue-vite.plain +16 -0
- package/stdlib/lang/go.plain +13 -0
- package/stdlib/lang/java.plain +12 -0
- package/stdlib/lang/python.plain +18 -0
- package/stdlib/lang/rust.plain +12 -0
- package/stdlib/lang/typescript.plain +13 -0
- package/stdlib/library/common.plain +15 -0
- package/stdlib/library/conformance/common.plain +9 -0
- package/stdlib/library/conformance/go.plain +9 -0
- package/stdlib/library/conformance/java-gradle.plain +9 -0
- package/stdlib/library/conformance/java-maven.plain +9 -0
- package/stdlib/library/conformance/python.plain +9 -0
- package/stdlib/library/conformance/rust.plain +9 -0
- package/stdlib/library/conformance/typescript.plain +9 -0
- package/stdlib/library/go.plain +12 -0
- package/stdlib/library/java-gradle.plain +13 -0
- package/stdlib/library/java-maven.plain +13 -0
- package/stdlib/library/python.plain +13 -0
- package/stdlib/library/rust.plain +12 -0
- package/stdlib/library/typescript.plain +15 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check-plain-env
|
|
3
|
+
description: >-
|
|
4
|
+
Read a ***plain project — its `.plain` files, `test_scripts/`,
|
|
5
|
+
and `resources/` — and determine every command-line tool, runtime, package
|
|
6
|
+
manager, and external service the project needs on the host machine. Probe
|
|
7
|
+
the host for each one, then emit a `PASS` / `FAIL` report listing what's
|
|
8
|
+
installed (with versions), what's missing, and concrete OS-specific install
|
|
9
|
+
commands for the gaps. Run this any time someone is about to render, test,
|
|
10
|
+
or onboard onto a ***plain project for the first time.
|
|
11
|
+
allowed-tools: [read, bash, ls, grep, find]
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Check Plain Env
|
|
15
|
+
|
|
16
|
+
This skill answers one question: **does the host machine have everything the ***plain project needs to render and test?** It reads the project, derives the requirement list, probes the machine, and returns a report. It never installs anything itself — that decision belongs to the user.
|
|
17
|
+
|
|
18
|
+
## When to run
|
|
19
|
+
|
|
20
|
+
- **First time you open a ***plain project on a new machine** — before the first `turri regenerate <module>.plain` or `./test_scripts/run_unittests*.sh` invocation. This is the most common case.
|
|
21
|
+
- **Once a new project's stack is settled** — at the end of `brood`'s stack phase, so the first build does not stop on a missing toolchain.
|
|
22
|
+
- **After `bud`** — when the new feature brought in a new dependency (a new framework, a new service, a new package manager) the project didn't need before.
|
|
23
|
+
- **Before a real render** — alongside `validate`. `validate` answers "do the specs parse?"; this skill answers "can this machine render and test them?". Both should pass.
|
|
24
|
+
- **Onboarding** — when a teammate (or CI runner, or fresh dev container) is about to start using the project.
|
|
25
|
+
- **Debugging a confusing failure** — when a test script exits with "command not found", "module not found", "could not connect", or similar before any test runs.
|
|
26
|
+
- **On demand** — whenever the user asks "what do I need to install for this project?".
|
|
27
|
+
|
|
28
|
+
This skill is **read-only and observational**. It does not edit `.plain` files or scripts, and it never invokes install commands on the user's behalf.
|
|
29
|
+
|
|
30
|
+
## What this skill does NOT do
|
|
31
|
+
|
|
32
|
+
- It does **not** install anything. It only suggests install commands and lets the user run them.
|
|
33
|
+
- It does **not** generate scripts or change project files. Use the `implement-*-testing-script` skills for that.
|
|
34
|
+
- It does **not** start services (databases, brokers, Docker daemons). It only checks whether the right binaries and (optionally) running endpoints are reachable.
|
|
35
|
+
- It does **not** validate the specs themselves (syntax, structure, complexity). Use the `validate` tool for that — the two are complementary.
|
|
36
|
+
- It does **not** print secrets. Check whether an env var is *set* (e.g. `printenv FOO >/dev/null && echo set || echo missing`), never echo its value.
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
39
|
+
|
|
40
|
+
The skill is a **derive → probe → report** pass. It does not stop at the first missing tool; it surfaces every gap so the user gets a single complete shopping list.
|
|
41
|
+
|
|
42
|
+
### Step 1 — Inventory the project
|
|
43
|
+
|
|
44
|
+
1. **Detect the host OS** first. Run `uname -s 2>/dev/null || echo "$OS"`. Use the result to (a) pick the right script extensions to inspect (`.sh` vs `.ps1`) and (b) pick the right install commands later (Homebrew, apt, dnf, pacman, choco, scoop, winget).
|
|
45
|
+
2. **List every `.plain` file** in the repo root and in any subdirectory that contains them. Note which are top modules (not `requires`-ed by anything) and which are import modules (under `template/`).
|
|
46
|
+
3. **List every script under `test_scripts/`** (both `.sh` and `.ps1` — projects can ship both).
|
|
47
|
+
4. **List every file under `resources/`** if the directory exists. Schemas and protocol files there often imply running services (e.g. a Postgres `.sql` schema implies a Postgres server).
|
|
48
|
+
5. Print a one-line inventory summary, e.g. `Detected: 2 top modules (backend/api.plain, frontend/web.plain), 4 test_scripts, 3 resources. Host: Darwin.`
|
|
49
|
+
|
|
50
|
+
### Step 2 — Derive the requirement list (at runtime, from what the project actually says)
|
|
51
|
+
|
|
52
|
+
The requirement list is **not pre-baked into this skill**. There is no catalog of "things to always check". The list is derived for each project from the project itself, by reading the specs and scripts in front of you and classifying every signal into one of the categories below.
|
|
53
|
+
|
|
54
|
+
#### What to check vs. what *not* to check
|
|
55
|
+
|
|
56
|
+
The single most important rule:
|
|
57
|
+
|
|
58
|
+
> **Check only the layers a package manager cannot install.** Anything `pip install -r requirements.txt`, `npm ci`, `mvn install`, `cargo fetch`, `go mod download`, `bundle install`, `composer install`, etc. would resolve is **out of scope** for this skill. It will be installed by the project's own scripts the moment they run. Checking it here is wasted work and creates false-negative reports the moment the manifest changes.
|
|
59
|
+
|
|
60
|
+
Concretely:
|
|
61
|
+
|
|
62
|
+
- ❌ **Do NOT check individual language packages** — not `torch`, not `requests`, not `numpy`, not `FastAPI`, not `express`, not `react`, not a specific JAR in `pom.xml`, not a specific gem in `Gemfile`, not a specific crate in `Cargo.toml`. The language's package manager handles all of it. The same rule applies in every language — Python, Node.js, Java, Go, Rust, Ruby, PHP, .NET, Dart, etc.
|
|
63
|
+
- ✅ **Do check the layers below the package manager**, which fall into four categories. Build the requirement list at runtime by walking through each category and adding only what the project actually needs.
|
|
64
|
+
|
|
65
|
+
#### Category 1 — Language toolchains and their package managers
|
|
66
|
+
|
|
67
|
+
For each language the project uses, the *toolchain* must be on the host — the package manager cannot install itself. Decide which toolchains apply by reading the specs and scripts:
|
|
68
|
+
|
|
69
|
+
- **Signals in `.plain` files**: phrases like `should be in Python`, `should be in Java`, `should be in Go` in `***implementation reqs***`. Find the language; ignore the framework (the framework is a package, not a toolchain).
|
|
70
|
+
- **Signals in `test_scripts/`** (more reliable, because scripts are the executable contract): which interpreter / build tool is invoked at the top level. `python3` / `pip` → Python toolchain. `node` / `npm` / `pnpm` / `yarn` → Node.js toolchain. `mvn` / `gradle` → JDK + Maven/Gradle. `go` → Go toolchain. `cargo` → Rust toolchain. `dotnet` → .NET SDK. `ruby` / `bundle` → Ruby + Bundler. `php` / `composer` → PHP + Composer. `dart` / `flutter` → Dart/Flutter SDK.
|
|
71
|
+
|
|
72
|
+
For each detected toolchain, probe both the interpreter/compiler **and** its package manager:
|
|
73
|
+
|
|
74
|
+
- Python → `python3 --version` + `pip --version`.
|
|
75
|
+
- Node.js → `node --version` + `npm --version` (or `pnpm`/`yarn` if the scripts use them).
|
|
76
|
+
- Java → `java -version` + `javac -version` + `mvn -version` (or `gradle --version`).
|
|
77
|
+
- Go → `go version`.
|
|
78
|
+
- Rust → `cargo --version` + `rustc --version`.
|
|
79
|
+
- .NET → `dotnet --version`.
|
|
80
|
+
- Ruby → `ruby --version` + `bundle --version`.
|
|
81
|
+
- PHP → `php --version` + `composer --version`.
|
|
82
|
+
- Flutter / Dart → `flutter --version` + `dart --version`.
|
|
83
|
+
|
|
84
|
+
**That's where the language-package check stops.** Once `python3` and `pip` are on the host, `pip install -r requirements.txt` will handle `torch`, `numpy`, `requests`, etc. when the test script runs. Don't probe for them here.
|
|
85
|
+
|
|
86
|
+
#### Category 2 — External services
|
|
87
|
+
|
|
88
|
+
Services that run as separate processes / daemons and cannot be installed by a language package manager. Identify them at runtime by reading the specs and config:
|
|
89
|
+
|
|
90
|
+
- **Signals**: a `.plain` file names a service the implementation talks to (database, cache, queue, broker, orchestrator). A `resources/*.sql` schema implies a database. A `docker-compose.yml` (if present) lists services explicitly.
|
|
91
|
+
- For each service found, probe **both** that its CLI is available **and** — when possible — that the service is reachable. "Binary present but service not running" should report as `WARN`, not `FAIL`; the user may want to start it on demand.
|
|
92
|
+
|
|
93
|
+
No catalog — if the spec says "uses PostgreSQL" you check Postgres, if it says "uses Redis" you check Redis, if it says "uses some-niche-service" you look up its CLI on the fly and probe that. Don't pretend the list is closed.
|
|
94
|
+
|
|
95
|
+
#### Category 3 — System binaries that language packages wrap
|
|
96
|
+
|
|
97
|
+
Some language packages are thin wrappers around a system binary that **`pip install` / `npm install` cannot install for you**. The package manager installs the wrapper; the wrapped binary still has to be on the host separately. This is the most commonly missed category.
|
|
98
|
+
|
|
99
|
+
Decide at runtime by reading the workflow described in the specs. If the workflow can't physically run without an external tool, that tool needs to be checked even though the language wrapper around it is in `requirements.txt`. Examples of the *pattern* (not an exhaustive list — derive yours from the actual project):
|
|
100
|
+
|
|
101
|
+
- The spec describes OCR → a wrapper like `pytesseract` is in `requirements.txt`, but the host still needs the `tesseract` binary and the language data files.
|
|
102
|
+
- The spec describes video/audio processing → `ffmpeg-python` is in the manifest, but the `ffmpeg` binary itself must be on the host.
|
|
103
|
+
- The spec describes PDF extraction → a Python wrapper is in the manifest, but the `pdftotext` / `pdftoppm` binaries from poppler-utils are still required.
|
|
104
|
+
- The spec describes headless-browser e2e testing → the npm package is in `package.json`, but the actual browser binaries (Chromium, Firefox, WebKit) must be downloaded onto the host separately.
|
|
105
|
+
- The spec describes shelling out to any external CLI from generated code → that CLI must be on the host.
|
|
106
|
+
|
|
107
|
+
**Heuristic for spotting Category 3:** if removing the package from `requirements.txt` would still leave a binary on the host that the project depends on, the binary belongs in Category 3. If the package *is* the only thing the project needs, it's package-manager territory and out of scope.
|
|
108
|
+
|
|
109
|
+
Whenever the test scripts themselves invoke a non-language binary (`ffmpeg`, `psql`, `docker`, `tesseract`, ...), that binary is automatically Category 3 — the script is the executable contract. **Always reconcile the spec-derived list against the scripts** before probing.
|
|
110
|
+
|
|
111
|
+
#### Category 4 — Hardware, drivers, accelerators
|
|
112
|
+
|
|
113
|
+
Things the OS — not any package manager — must provide. The only category where the chain runs deeper than "is this binary on PATH?".
|
|
114
|
+
|
|
115
|
+
- **Signals**: a spec mentions GPU acceleration, local model training/fine-tuning, real-time inference, CUDA, MPS / Apple Silicon, hardware-accelerated video encoding, etc.
|
|
116
|
+
- The check is **layered**, and each layer fails independently. Probe each one and surface each result separately, in order, so the user sees exactly where the chain breaks:
|
|
117
|
+
1. **Driver present?** (e.g. `nvidia-smi` succeeds.)
|
|
118
|
+
2. **Device visible?** (e.g. `nvidia-smi -L` lists ≥ 1 GPU.)
|
|
119
|
+
3. **Accelerator SDK installed?** (e.g. `nvcc --version` for the CUDA toolkit.)
|
|
120
|
+
4. **Acceleration libraries discoverable?** (e.g. cuDNN via `ldconfig -p \| grep libcudnn` on Linux.)
|
|
121
|
+
5. **The runtime can actually see the accelerator?** (e.g. a one-line Python probe through whatever framework the spec named: `python -c "import torch; print(torch.cuda.is_available(), torch.version.cuda)"`.) This particular layer **does** require the language package, so run it after the test scripts have had a chance to install dependencies — or surface it as "can be verified after `pip install`" if dependencies aren't installed yet.
|
|
122
|
+
6. **Version compatibility.** If the runtime reports a different CUDA major version than the toolkit, surface a `WARN`. Driver / toolkit / runtime version mismatches are the most common silent GPU bug.
|
|
123
|
+
|
|
124
|
+
The same shape applies to other accelerators: Apple Silicon / MPS (`uname -m`, `sw_vers`, framework probe), AMD ROCm (`rocminfo`), Intel oneAPI, etc. Look up the relevant probe at runtime from the spec's terminology.
|
|
125
|
+
|
|
126
|
+
Worked example — the GPU case:
|
|
127
|
+
|
|
128
|
+
> A `.plain` file declares: `:Implementation: should fine-tune :BaseModel: on the user's local hardware using PyTorch. Training should use available GPUs when present.`
|
|
129
|
+
>
|
|
130
|
+
> What the package manager handles (out of scope for this skill): `torch` itself. `pip install -r requirements.txt` will fetch the right wheel.
|
|
131
|
+
>
|
|
132
|
+
> What this skill must probe (in scope):
|
|
133
|
+
>
|
|
134
|
+
> 1. The **Python toolchain** (Category 1): `python3 --version`, `pip --version`.
|
|
135
|
+
> 2. The **NVIDIA driver** (Category 4, layer 1): `nvidia-smi`.
|
|
136
|
+
> 3. **At least one GPU visible** (Category 4, layer 2): `nvidia-smi -L` lists ≥ 1 device.
|
|
137
|
+
> 4. **CUDA toolkit** (Category 4, layer 3): `nvcc --version`.
|
|
138
|
+
> 5. **cuDNN discoverable** (Category 4, layer 4): `ldconfig -p \| grep libcudnn` on Linux; skip on macOS.
|
|
139
|
+
> 6. **PyTorch actually sees the GPU** (Category 4, layer 5): `python -c "import torch; print(torch.cuda.is_available(), torch.version.cuda)"` — noting this requires `torch` to be installed (i.e. requires the test scripts to have run their install step at least once).
|
|
140
|
+
> 7. **Version match** (Category 4, layer 6): cross-check `torch.version.cuda` against `nvcc --version`. Mismatch → `WARN`.
|
|
141
|
+
>
|
|
142
|
+
> The skill never asks "is `torch` installed?". That belongs to `pip`.
|
|
143
|
+
|
|
144
|
+
#### Category 5 — Always required
|
|
145
|
+
|
|
146
|
+
Add these to every requirement list regardless of project:
|
|
147
|
+
|
|
148
|
+
- turri's own needs — Node, bash, the OS sandbox, a model provider — are checked by `turri doctor`. Run it and report its result; do not probe those separately.
|
|
149
|
+
- A shell matching the testing scripts' extension (Bash for `.sh`, PowerShell for `.ps1`).
|
|
150
|
+
- `git` (the renderer uses it; almost every plain project tracks itself in git).
|
|
151
|
+
|
|
152
|
+
### Step 3 — Probe the host
|
|
153
|
+
|
|
154
|
+
For every requirement the project produced in Step 2, run a check using the `bash` tool. Capture stdout/stderr and exit code. Classify each result:
|
|
155
|
+
|
|
156
|
+
- **PASS** — present and (where a version was specified) at or above the required version.
|
|
157
|
+
- **WARN** — present but at a version that doesn't match what the project explicitly asks for (e.g. spec says Java 17, host has Java 21), or service binary present but the service itself isn't running, or a Category 4 sub-layer is mismatched against another (e.g. CUDA toolkit version doesn't match what the framework expects).
|
|
158
|
+
- **FAIL** — missing, unreachable, or below the minimum version.
|
|
159
|
+
|
|
160
|
+
Probe in the same category order Step 2 produced them, so the report reads top-down:
|
|
161
|
+
|
|
162
|
+
1. **Category 1 — Language toolchains.** Run the toolchain + package-manager probes listed in Step 2's Category 1 for the languages this project actually uses. Do not probe individual language packages.
|
|
163
|
+
2. **Category 5 — turri and `git`.** Always required, independent of the project. `turri doctor`, `git --version`. Verify the shell flavor matches the scripts' extension; a `.sh`-only project on native Windows is a `FAIL` (suggest WSL).
|
|
164
|
+
3. **Category 2 — External services.** For each service identified at runtime, probe the CLI's presence first, then — if the CLI exists — check whether the service itself is reachable. Service binary present but daemon down → `WARN`, not `FAIL`.
|
|
165
|
+
4. **Category 3 — System binaries that language packages wrap.** For each one identified in Step 2, check the system binary is on `PATH` (`which <bin>` / `<bin> --version`). The wrapper package itself isn't probed.
|
|
166
|
+
5. **Category 4 — Hardware, drivers, accelerators.** Walk the layered probe from Step 2 in order (driver → device visibility → SDK → acceleration libs → framework-sees-it → version match), reporting each layer's result separately. Never collapse a multi-layer failure into a single "GPU not available" message — each layer has a different fix.
|
|
167
|
+
6. **Credentials and config holes.** For every env var, dotfile, or cloud CLI login state the project implies, probe its presence without printing its value: `printenv VAR >/dev/null && echo set || echo missing`, `[ -f <path> ] && echo present || echo missing`, `aws sts get-caller-identity` / `gcloud auth list` / `az account show` for cloud SDKs.
|
|
168
|
+
|
|
169
|
+
### Step 4 — Report
|
|
170
|
+
|
|
171
|
+
Emit a single report with **the verdict on the first line** so callers can pattern-match without parsing the body:
|
|
172
|
+
|
|
173
|
+
- **`PASS`** — every required item is present at an acceptable version. Follow with a one-paragraph summary listing what was checked.
|
|
174
|
+
- **`WARN`** — everything required is present but at least one item triggered a soft warning (version mismatch, service not currently running). Follow with the numbered list of warnings.
|
|
175
|
+
- **`FAIL`** — at least one required item is missing or below minimum version. Follow with a numbered list of every gap.
|
|
176
|
+
|
|
177
|
+
For every **FAIL** and **WARN** item, the report must include four columns:
|
|
178
|
+
|
|
179
|
+
| Column | Content |
|
|
180
|
+
|---|---|
|
|
181
|
+
| **What** | The missing tool/service/credential. |
|
|
182
|
+
| **Why** | Which spec, script, or library introduced this requirement (e.g. "`backend/api.plain` says `using FastAPI`", "`test_scripts/run_unittests_python.sh` calls `pytest`"). |
|
|
183
|
+
| **Status** | "missing", "outdated (found X, need Y)", "binary present but service not running", or "env var not set". |
|
|
184
|
+
| **How to install** | OS-specific command(s). See [Install suggestions](#install-suggestions) below. |
|
|
185
|
+
|
|
186
|
+
Group the report into the same six probe groups used in Step 3 (toolchains, turri/git, services, system binaries, hardware, credentials), so the user can fix one whole layer at a time.
|
|
187
|
+
|
|
188
|
+
End the report with a one-liner reminder: `Re-run check-plain-env after installing missing items to confirm.`
|
|
189
|
+
|
|
190
|
+
## Install suggestions
|
|
191
|
+
|
|
192
|
+
When emitting an install command, **match the host OS** detected in Step 1. Prefer the OS's first-party package manager. Don't suggest `curl | sh` style installs unless there is no alternative.
|
|
193
|
+
|
|
194
|
+
The tables below are a **starter set** of well-known install commands for the things projects most often need. They are **not** a list of "things to check" — that list is derived per project in Step 2. When the requirement list contains something not in these tables (e.g. a niche service, a specialty CLI), look up the canonical install command for the detected OS at the time of report generation rather than skipping the row or inventing a command.
|
|
195
|
+
|
|
196
|
+
### macOS (Darwin)
|
|
197
|
+
|
|
198
|
+
| Requirement | Suggested install |
|
|
199
|
+
|---|---|
|
|
200
|
+
| Python 3 | `brew install python@3.12` |
|
|
201
|
+
| Node.js | `brew install node` (or `brew install nvm` for multi-version) |
|
|
202
|
+
| Go | `brew install go` |
|
|
203
|
+
| Rust | `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \| sh` (no Homebrew equivalent that stays current) |
|
|
204
|
+
| Java | `brew install openjdk@21` then follow the post-install `sudo ln -sfn ...` step |
|
|
205
|
+
| Maven | `brew install maven` |
|
|
206
|
+
| Gradle | `brew install gradle` |
|
|
207
|
+
| PostgreSQL | `brew install postgresql@16` then `brew services start postgresql@16` |
|
|
208
|
+
| MySQL | `brew install mysql` then `brew services start mysql` |
|
|
209
|
+
| Redis | `brew install redis` then `brew services start redis` |
|
|
210
|
+
| Docker | Install Docker Desktop from https://docker.com/products/docker-desktop |
|
|
211
|
+
| `pg_config` (psycopg) | comes with `brew install postgresql@16` |
|
|
212
|
+
| Xcode CLT | `xcode-select --install` |
|
|
213
|
+
| `turri` | follow the install instructions at https://turri.ai |
|
|
214
|
+
|
|
215
|
+
### Linux (Debian/Ubuntu)
|
|
216
|
+
|
|
217
|
+
| Requirement | Suggested install |
|
|
218
|
+
|---|---|
|
|
219
|
+
| Python 3 | `sudo apt update && sudo apt install -y python3 python3-pip python3-venv` |
|
|
220
|
+
| Node.js | `curl -fsSL https://deb.nodesource.com/setup_20.x \| sudo -E bash - && sudo apt install -y nodejs` |
|
|
221
|
+
| Go | `sudo apt install -y golang-go` (or download from https://go.dev/dl/ for the latest) |
|
|
222
|
+
| Rust | `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \| sh` |
|
|
223
|
+
| Java | `sudo apt install -y openjdk-21-jdk` |
|
|
224
|
+
| Maven | `sudo apt install -y maven` |
|
|
225
|
+
| PostgreSQL | `sudo apt install -y postgresql postgresql-contrib && sudo systemctl start postgresql` |
|
|
226
|
+
| Redis | `sudo apt install -y redis-server && sudo systemctl start redis-server` |
|
|
227
|
+
| Docker | follow https://docs.docker.com/engine/install/ubuntu/ |
|
|
228
|
+
| `pg_config` (psycopg) | `sudo apt install -y libpq-dev` |
|
|
229
|
+
| C/C++ build tools | `sudo apt install -y build-essential` |
|
|
230
|
+
|
|
231
|
+
### Linux (Fedora/RHEL)
|
|
232
|
+
|
|
233
|
+
Equivalent commands with `sudo dnf install -y ...` instead of `apt`. Surface them when the host is detected as Fedora/RHEL (e.g. presence of `/etc/redhat-release` or `dnf --version` succeeding).
|
|
234
|
+
|
|
235
|
+
### Windows (native PowerShell)
|
|
236
|
+
|
|
237
|
+
| Requirement | Suggested install |
|
|
238
|
+
|---|---|
|
|
239
|
+
| Python 3 | `winget install Python.Python.3.12` or `choco install python` |
|
|
240
|
+
| Node.js | `winget install OpenJS.NodeJS.LTS` or `choco install nodejs-lts` |
|
|
241
|
+
| Go | `winget install GoLang.Go` |
|
|
242
|
+
| Rust | `winget install Rustlang.Rustup` |
|
|
243
|
+
| Java | `winget install Microsoft.OpenJDK.21` |
|
|
244
|
+
| PostgreSQL | `winget install PostgreSQL.PostgreSQL` |
|
|
245
|
+
| Docker | `winget install Docker.DockerDesktop` |
|
|
246
|
+
| MSVC build tools | `winget install Microsoft.VisualStudio.2022.BuildTools` |
|
|
247
|
+
|
|
248
|
+
If the project's `test_scripts/` are `.sh` only and the host is native Windows, suggest **WSL** (`wsl --install`) rather than trying to make Bash scripts run under PowerShell.
|
|
249
|
+
|
|
250
|
+
### When you can't pick
|
|
251
|
+
|
|
252
|
+
When the host OS detection in Step 1 was inconclusive (e.g. an unrecognized Linux distro), include the macOS and Debian/Ubuntu commands and tell the user to adapt for their package manager. Never invent install commands for a distro you can't identify.
|
|
253
|
+
|
|
254
|
+
## Anti-patterns
|
|
255
|
+
|
|
256
|
+
- **(Hard mistake) Don't probe individual language packages.** Anything `pip install -r requirements.txt`, `npm ci`, `mvn install`, `cargo fetch`, `go mod download`, `bundle install`, `composer install`, etc. would resolve is out of scope. `torch`, `requests`, `numpy`, `FastAPI`, `express`, `react`, JARs, gems, crates — all package-manager territory. Check the toolchain (`python3`, `pip`, `node`, `npm`, `mvn`, `cargo`, ...) and stop there. Probing the package itself creates false negatives the moment `requirements.txt` changes and duplicates work the test scripts will do anyway.
|
|
257
|
+
- **Don't stop after the directly named technologies.** A spec that says "fine-tune on local hardware using PyTorch" never says "CUDA", but the workflow can't run without CUDA. Always work through Category 3 (system binaries that language packages wrap) and Category 4 (hardware/drivers) — not only the directly named runtimes. These categories are where the workflow's hidden requirements live.
|
|
258
|
+
- **Don't merge a chain of failures into one generic message.** "GPU not available" is not a useful report. The chain is `driver → device visibility → toolkit → acceleration libs → framework-sees-it → version match`; each layer has a different fix. Surface each layer separately.
|
|
259
|
+
- **Don't work only from `.plain` files.** Always cross-reference with `test_scripts/` — the scripts are the executable contract. If a script invokes a non-language binary the specs never mention, that binary is automatically a Category 3 requirement.
|
|
260
|
+
- **Don't pre-bake a catalog.** Derive the requirement list at runtime from the project in front of you. A hard-coded "things to always check" table becomes wrong the moment any project deviates from the assumed shape — and every project does.
|
|
261
|
+
- **Don't probe testing framework binaries as if they were independent.** `pytest`, `jest`, `vitest`, `phpunit`, `junit-console`, etc. are installed by the package manager via `requirements.txt` / `package.json` / `pom.xml`. The toolchain check (Category 1) is enough — the framework binary itself is out of scope.
|
|
262
|
+
- **Don't probe in silence.** Use the `bash` tool and capture the actual command output (version strings, exit codes). Telling the user "looks like Python is installed" without running `python3 --version` is guessing.
|
|
263
|
+
- **Don't print secret values.** Check whether `DATABASE_URL`, provider API keys, etc. are set, not what they contain. Use `printenv VAR >/dev/null` not `printenv VAR`.
|
|
264
|
+
- **Don't install anything on the user's behalf.** Even when the install command is obvious. The user needs to opt in.
|
|
265
|
+
- **Don't stop at the first FAIL.** Run the full sweep so the report is complete in one pass.
|
|
266
|
+
- **Don't suggest `curl | sh` installs when a package manager works.** Reserve the upstream installer fallback for cases where no package-manager option exists (e.g. `rustup`, sometimes Go).
|
|
267
|
+
- **Don't ignore version mismatches.** If a spec says Java 17 and the host has Java 21, surface that as a `WARN` so the user can decide — don't silently let it pass.
|
|
268
|
+
- **Don't duplicate this check inline elsewhere.** Other skills (`brood`, `bud`) that need an env check should **delegate to `check-plain-env`** rather than re-implementing the probe themselves. This skill is the single source of truth.
|
|
269
|
+
|
|
270
|
+
## Validation Checklist
|
|
271
|
+
|
|
272
|
+
- [ ] Host OS detected (`uname -s` / `$OS`) before any other action.
|
|
273
|
+
- [ ] Requirement list derived **at runtime from this project's** `.plain` files, `test_scripts/`, and `resources/` — no pre-baked catalog used.
|
|
274
|
+
- [ ] **No individual language packages probed.** Only the toolchain + package manager for each detected language.
|
|
275
|
+
- [ ] Every script under `test_scripts/` opened and read; every non-language binary it invokes added to the Category 3 list.
|
|
276
|
+
- [ ] Every external service named in the specs is in the Category 2 list, with both a binary probe and (when feasible) a reachability probe.
|
|
277
|
+
- [ ] Every hardware / accelerator signal ("GPU", "fine-tune", "local inference", "CUDA", "MPS", etc.) triggered the layered Category 4 probe.
|
|
278
|
+
- [ ] Every requirement probed via the `bash` tool with an actual version / availability command (no "looks installed" guesses).
|
|
279
|
+
- [ ] GPU / accelerator chains probed layer-by-layer (driver → device visibility → toolkit → acceleration libs → framework-sees-it → version match), with each layer reported separately.
|
|
280
|
+
- [ ] Each result classified as PASS / WARN / FAIL.
|
|
281
|
+
- [ ] Report has the verdict on the first line.
|
|
282
|
+
- [ ] Every FAIL and WARN row has all four columns: What / Why / Status / How to install.
|
|
283
|
+
- [ ] Install suggestions match the detected host OS (no Debian commands on macOS, no `brew` on Linux, etc.).
|
|
284
|
+
- [ ] No secret values were printed at any point.
|
|
285
|
+
- [ ] Nothing was installed; no project files were modified.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: consolidate-concepts
|
|
3
|
+
description: >-
|
|
4
|
+
Gather concept definitions scattered across multiple modules into a single
|
|
5
|
+
shared import module in template/. Removes the moved definitions from the
|
|
6
|
+
original modules and adds the new import to their frontmatter. Use when
|
|
7
|
+
concepts are duplicated or spread across modules and should be centralized.
|
|
8
|
+
allowed-tools: [read, write, edit, bash, ls, grep, find]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Consolidate Concepts
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Multiple modules define the same or closely related concepts independently.
|
|
16
|
+
- A `requires` chain uses long `exported_concepts` lists to share definitions that would be simpler as an import.
|
|
17
|
+
- After a `refactor-module` split, shared concepts ended up duplicated or awkwardly exported.
|
|
18
|
+
- The user wants a single source of truth for domain concepts used across modules.
|
|
19
|
+
|
|
20
|
+
## Guiding Principle
|
|
21
|
+
|
|
22
|
+
This is a structural refactoring. The **behavior** of every affected module must remain **identical**. No functional spec, implementation req, or test req is changed. Only concept definitions move — from scattered locations into one shared import module — and the modules' `import` lists are updated to reference it.
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
|
|
26
|
+
The set of modules to consolidate from, plus optionally the name for the new (or existing) import module. If not specified, ask the user.
|
|
27
|
+
|
|
28
|
+
## Phase 1 — Analyze Concepts Across Modules
|
|
29
|
+
|
|
30
|
+
1. **Read all source modules.** For each `.plain` file involved, read the full file including frontmatter, definitions, implementation reqs, test reqs, and functional specs. Also read their `import` and `requires` chains.
|
|
31
|
+
2. **Build a concept inventory.** For each concept defined across all source modules, record:
|
|
32
|
+
- Where it is defined (which file, which line)
|
|
33
|
+
- Which modules reference it (in definitions, functional specs, implementation reqs, or test reqs)
|
|
34
|
+
- Whether it is currently in an `exported_concepts` list
|
|
35
|
+
- Which other concepts it references in its definition (dependency graph)
|
|
36
|
+
3. **Identify consolidation candidates.** A concept should be consolidated if:
|
|
37
|
+
- It is defined in one module but referenced by specs in another module (currently shared via `exported_concepts`)
|
|
38
|
+
- It is duplicated across multiple modules
|
|
39
|
+
- It is a foundational domain concept that logically belongs in a shared vocabulary
|
|
40
|
+
4. **Identify concepts that should stay local.** A concept should remain in its module if:
|
|
41
|
+
- It is only used within that single module's specs and definitions
|
|
42
|
+
- It is an internal implementation detail not meaningful outside that module
|
|
43
|
+
|
|
44
|
+
## Phase 2 — Plan the Consolidation
|
|
45
|
+
|
|
46
|
+
Present the plan to the user and get explicit confirmation before making changes.
|
|
47
|
+
|
|
48
|
+
### 2a. Choose the target import module
|
|
49
|
+
|
|
50
|
+
- **New import module** — create a new `.plain` file in `template/`. Choose a name that reflects the shared domain (e.g., `template/myapp-concepts.plain`).
|
|
51
|
+
- **Existing import module** — add the concepts to an import module that is already used by the affected modules. This avoids adding another import reference.
|
|
52
|
+
|
|
53
|
+
If the target is an existing import module, read it fully to understand what it already contains.
|
|
54
|
+
|
|
55
|
+
### 2b. Determine which concepts move
|
|
56
|
+
|
|
57
|
+
For each consolidation candidate, confirm:
|
|
58
|
+
- The concept will be removed from its current module's `***definitions***` section.
|
|
59
|
+
- The concept will be added to the target import module's `***definitions***` section.
|
|
60
|
+
- The concept's full definition text (including all sub-bullets for attributes and constraints) is moved verbatim.
|
|
61
|
+
|
|
62
|
+
### 2c. Determine concept ordering in the target
|
|
63
|
+
|
|
64
|
+
Concepts in the import module must be ordered so that every concept is defined **after** any concepts it references. Use the dependency graph from Phase 1 to establish a valid topological order.
|
|
65
|
+
|
|
66
|
+
### 2d. Determine import and export changes
|
|
67
|
+
|
|
68
|
+
For each affected module, determine the frontmatter changes:
|
|
69
|
+
|
|
70
|
+
| Change | When |
|
|
71
|
+
|--------|------|
|
|
72
|
+
| Add the new import to `import` list | Module does not already import the target |
|
|
73
|
+
| Remove concepts from `exported_concepts` | Concepts that were exported only to share definitions — now handled by the import |
|
|
74
|
+
| Keep concepts in `exported_concepts` | Concepts that downstream `requires` modules still need via export (because those downstream modules do not import the new template) |
|
|
75
|
+
|
|
76
|
+
**Important:** `import` provides definitions to the importing module. `exported_concepts` on a `requires` module provides concepts to downstream modules in the build chain. If a downstream module will now `import` the shared template directly, the concept can be removed from `exported_concepts`. If a downstream module does **not** import the template, the concept must remain exported.
|
|
77
|
+
|
|
78
|
+
### 2e. Present the plan
|
|
79
|
+
|
|
80
|
+
Summarize for the user:
|
|
81
|
+
- Target import module (new or existing) and its path
|
|
82
|
+
- List of concepts being moved, with source module for each
|
|
83
|
+
- List of concepts staying local (and why)
|
|
84
|
+
- Frontmatter changes per module (`import` additions, `exported_concepts` removals)
|
|
85
|
+
- Confirmation that no functional specs, implementation reqs, or test reqs are changing
|
|
86
|
+
|
|
87
|
+
Get explicit user confirmation before proceeding.
|
|
88
|
+
|
|
89
|
+
## Phase 3 — Execute
|
|
90
|
+
|
|
91
|
+
### 3a. Create or update the import module
|
|
92
|
+
|
|
93
|
+
If creating a new import module:
|
|
94
|
+
1. Create `template/<name>.plain` with YAML frontmatter. If it needs concepts from another import, add that to its own `import` list.
|
|
95
|
+
2. Add a `***definitions***` section with all consolidated concepts in dependency order.
|
|
96
|
+
3. Do **not** add `***functional specs***` — import modules must not contain them.
|
|
97
|
+
|
|
98
|
+
If updating an existing import module:
|
|
99
|
+
1. Read the current file.
|
|
100
|
+
2. Insert the new concepts into the `***definitions***` section, respecting dependency order relative to existing concepts.
|
|
101
|
+
3. Verify no concept name collisions with concepts already in the file or its own imports.
|
|
102
|
+
|
|
103
|
+
### 3b. Update each source module
|
|
104
|
+
|
|
105
|
+
For each module that had concepts moved out:
|
|
106
|
+
|
|
107
|
+
1. **Remove the concept definitions** from the module's `***definitions***` section. Remove the full definition including all sub-bullets.
|
|
108
|
+
2. **Add the import** to the module's YAML frontmatter `import` list (if not already present).
|
|
109
|
+
3. **Update `exported_concepts`** — remove concepts that no longer need to be exported (see 2d).
|
|
110
|
+
4. **Do not touch** `***functional specs***`, `***implementation reqs***`, or `***test reqs***` — concept references (`:ConceptName:`) in these sections remain unchanged since the concept is now provided by the import.
|
|
111
|
+
|
|
112
|
+
### 3c. Update downstream modules (if applicable)
|
|
113
|
+
|
|
114
|
+
If concepts were removed from a module's `exported_concepts` and downstream `requires` modules relied on them:
|
|
115
|
+
1. Add the new import to the downstream module's `import` list so it gets the concepts directly.
|
|
116
|
+
2. Verify the downstream module's specs can still resolve all concept references.
|
|
117
|
+
|
|
118
|
+
## Phase 4 — Verify
|
|
119
|
+
|
|
120
|
+
### 4a. Concept availability check
|
|
121
|
+
|
|
122
|
+
For every affected module (source modules, downstream modules, and the import module itself):
|
|
123
|
+
- [ ] Every `:Concept:` referenced in functional specs is resolvable (defined locally, via import, or via exported concepts from requires)
|
|
124
|
+
- [ ] Every `:Concept:` referenced in definitions is defined before the concept that references it
|
|
125
|
+
- [ ] Every `:Concept:` referenced in implementation reqs and test reqs is resolvable
|
|
126
|
+
|
|
127
|
+
### 4b. No duplicates check
|
|
128
|
+
|
|
129
|
+
- [ ] No concept is defined in both the import module and a source module
|
|
130
|
+
- [ ] No concept is defined in both the import module and another import that a source module uses
|
|
131
|
+
- [ ] Concept names are globally unique across each module's full resolution scope (local + imports + requires exports)
|
|
132
|
+
|
|
133
|
+
### 4c. Definition integrity check
|
|
134
|
+
|
|
135
|
+
- [ ] Each moved concept's definition text is identical to the original — no rewording, no lost sub-bullets
|
|
136
|
+
- [ ] Concept ordering in the import module respects the dependency graph (no forward references)
|
|
137
|
+
|
|
138
|
+
### 4d. No behavioral change check
|
|
139
|
+
|
|
140
|
+
- [ ] No `***functional specs***` were modified in any module
|
|
141
|
+
- [ ] No `***implementation reqs***` were modified in any module
|
|
142
|
+
- [ ] No `***test reqs***` were modified in any module
|
|
143
|
+
- [ ] No `***acceptance tests***` were modified in any module
|
|
144
|
+
|
|
145
|
+
### 4e. Structural validation
|
|
146
|
+
|
|
147
|
+
For the import module:
|
|
148
|
+
- [ ] File is in the `template/` directory
|
|
149
|
+
- [ ] Does not contain `***functional specs***`
|
|
150
|
+
- [ ] Does not use `requires`
|
|
151
|
+
- [ ] YAML frontmatter is correctly formatted
|
|
152
|
+
|
|
153
|
+
For each source module:
|
|
154
|
+
- [ ] YAML frontmatter `import` list includes the target import module
|
|
155
|
+
- [ ] `exported_concepts` is correct (no over-export, no missing exports)
|
|
156
|
+
- [ ] Module still has at least one functional spec and one implementation req
|
|
157
|
+
|
|
158
|
+
### 4f. Read all modified files
|
|
159
|
+
|
|
160
|
+
Read each modified `.plain` file in full and present the changes to the user for approval. If the user requests changes, apply them and re-verify.
|
|
161
|
+
|
|
162
|
+
## Common Pitfalls
|
|
163
|
+
|
|
164
|
+
### Moving a concept that is only used locally
|
|
165
|
+
If a concept is only referenced within a single module, consolidating it into a shared import adds unnecessary coupling. Keep it local.
|
|
166
|
+
|
|
167
|
+
### Forgetting to update downstream requires modules
|
|
168
|
+
When a concept is removed from `exported_concepts`, any module that `requires` the source module and references that concept will break — unless it now imports the shared template. Always trace the full dependency chain.
|
|
169
|
+
|
|
170
|
+
### Breaking concept ordering
|
|
171
|
+
Concepts in the import module must be topologically ordered. If `:Meal:` references `:MealType:` in its definition, then `:MealType:` must appear first. The source modules may have had them in the right order locally, but merging concepts from different modules requires re-establishing a valid order.
|
|
172
|
+
|
|
173
|
+
### Creating circular imports
|
|
174
|
+
An import module cannot `import` a module that directly or indirectly imports it back. If the shared concepts reference concepts from an existing template, the new import module should itself import that template — not the other way around.
|
|
175
|
+
|
|
176
|
+
### Removing concepts from exported_concepts prematurely
|
|
177
|
+
Only remove a concept from `exported_concepts` if **every** downstream `requires` module that needs it will now get it via `import`. If even one downstream module does not import the shared template, the export must stay.
|
|
178
|
+
|
|
179
|
+
## Validation Checklist
|
|
180
|
+
|
|
181
|
+
- [ ] User confirmed the consolidation plan before execution
|
|
182
|
+
- [ ] All moved concepts are defined in the import module with identical text
|
|
183
|
+
- [ ] Concepts are in valid dependency order in the import module
|
|
184
|
+
- [ ] No concept is defined in both the import module and a source module
|
|
185
|
+
- [ ] Every affected module's `import` list includes the target import module
|
|
186
|
+
- [ ] `exported_concepts` updated correctly — no missing exports, no unnecessary exports
|
|
187
|
+
- [ ] All concept references in all affected modules resolve correctly
|
|
188
|
+
- [ ] No functional specs, implementation reqs, test reqs, or acceptance tests were modified
|
|
189
|
+
- [ ] Import module is in `template/` and has no functional specs or requires
|
|
190
|
+
- [ ] No circular imports introduced
|
|
191
|
+
- [ ] Downstream requires modules updated if needed
|
|
192
|
+
- [ ] User approved the final result
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-import-module
|
|
3
|
+
description: >-
|
|
4
|
+
Create a ***plain import module that provides shared definitions,
|
|
5
|
+
implementation reqs, and test reqs for other modules to import. Use when
|
|
6
|
+
the user wants to create a new .plain file that contains only definitions,
|
|
7
|
+
implementation reqs, and/or test reqs — no functional specs.
|
|
8
|
+
allowed-tools: [read, write, edit, bash, ls, grep, find]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Create Import Module
|
|
12
|
+
|
|
13
|
+
## What an Import Module Is
|
|
14
|
+
|
|
15
|
+
An import module is a `.plain` file that lives in the **`template/`** directory and contains **only** `***definitions***`, `***implementation reqs***`, and/or `***test reqs***`. It must **not** contain `***functional specs***` and must **not** use `requires` in its frontmatter. Other modules pull in its content via the `import` field in their YAML frontmatter, gaining access to its definitions and reqs.
|
|
16
|
+
|
|
17
|
+
Use import modules for:
|
|
18
|
+
- Sharing concept definitions across multiple modules
|
|
19
|
+
- Providing common implementation requirements (e.g., technology stack, coding standards)
|
|
20
|
+
- Providing common test requirements
|
|
21
|
+
- Creating reusable foundational structure (templates)
|
|
22
|
+
|
|
23
|
+
If the module needs functional specs (i.e., it describes what software should do), it is not an import module — see the `create-requires-module` skill.
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
1. **Determine what shared content this module should provide** — which definitions, implementation reqs, or test reqs will other modules need?
|
|
28
|
+
2. **Create the `.plain` file in the `template/` directory** with YAML frontmatter. Use `required_concepts` to declare concepts that importing modules must define. It may optionally `import` other templates for layered reuse, but must **not** use `requires`.
|
|
29
|
+
3. **Add the shared content** — definitions, implementation reqs, and/or test reqs.
|
|
30
|
+
4. **Do not add `***functional specs***`** — import modules must not contain functional specs.
|
|
31
|
+
5. **Verify concept availability** — ensure all `:Concepts:` referenced are either defined in this module, provided by its own imports, declared as `required_concepts`, or are predefined concepts.
|
|
32
|
+
|
|
33
|
+
## Format
|
|
34
|
+
|
|
35
|
+
The `import` field is a list of module paths in the YAML frontmatter:
|
|
36
|
+
|
|
37
|
+
```plain
|
|
38
|
+
---
|
|
39
|
+
import:
|
|
40
|
+
- base_template
|
|
41
|
+
required_concepts: [":AppName:"]
|
|
42
|
+
description: Shared API definitions and reqs
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
***definitions***
|
|
46
|
+
|
|
47
|
+
- :ApiClient: is the HTTP client used to communicate with external services.
|
|
48
|
+
|
|
49
|
+
- :ApiResponse: is the response returned by :ApiClient:.
|
|
50
|
+
|
|
51
|
+
***implementation reqs***
|
|
52
|
+
|
|
53
|
+
- :Implementation: should handle HTTP errors by raising appropriate exceptions.
|
|
54
|
+
|
|
55
|
+
- :ApiClient: should support configurable timeouts.
|
|
56
|
+
|
|
57
|
+
***test reqs***
|
|
58
|
+
|
|
59
|
+
- :ConformanceTests: should mock all external HTTP calls made by :ApiClient:.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The default import directory is `template/` — the `template/` prefix is not needed in import paths. The `.plain` extension is omitted. Note the absence of `***functional specs***` — import modules must not have them.
|
|
63
|
+
|
|
64
|
+
## Satisfying Required Concepts
|
|
65
|
+
|
|
66
|
+
If an imported template declares `required_concepts`, the importing module **must** define those concepts in its own `***definitions***` section:
|
|
67
|
+
|
|
68
|
+
```plain
|
|
69
|
+
---
|
|
70
|
+
import:
|
|
71
|
+
- auth_template
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
> auth_template declares required_concepts: [":AuthSchema:", ":AuthApiSpec:"]
|
|
75
|
+
> So this module must define them:
|
|
76
|
+
|
|
77
|
+
***definitions***
|
|
78
|
+
|
|
79
|
+
- :AuthSchema: is the JSON schema describing the authentication data structure.
|
|
80
|
+
|
|
81
|
+
- :AuthApiSpec: is the OpenAPI specification for the external service's auth endpoint.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Import vs Requires
|
|
85
|
+
|
|
86
|
+
| Aspect | `import` | `requires` |
|
|
87
|
+
|--------|----------|------------|
|
|
88
|
+
| Pulls in definitions | Yes | No (only `exported_concepts`) |
|
|
89
|
+
| Pulls in implementation reqs | Yes | No |
|
|
90
|
+
| Pulls in test reqs | Yes | No |
|
|
91
|
+
| Pulls in functional specs | No | Yes (as previous requirements, transitively) |
|
|
92
|
+
| Copies generated code | No | Yes (accumulated ancestor chain) |
|
|
93
|
+
| Typical use | Templates, shared definitions | Attaching a module to the build chain |
|
|
94
|
+
|
|
95
|
+
## Validation Checklist
|
|
96
|
+
|
|
97
|
+
- [ ] Module file is in the `template/` directory
|
|
98
|
+
- [ ] Module does **not** contain `***functional specs***`
|
|
99
|
+
- [ ] Module does **not** use `requires` in its frontmatter
|
|
100
|
+
- [ ] Contains at least one of: definitions, implementation reqs, or test reqs
|
|
101
|
+
- [ ] All `required_concepts` from any imports this module itself uses are satisfied
|
|
102
|
+
- [ ] `required_concepts` declared for any concepts referenced but not defined here
|
|
103
|
+
- [ ] No concept name collisions between this module's imports and local definitions
|
|
104
|
+
- [ ] YAML frontmatter is correctly formatted between `---` markers
|