kopular 1.2.6 → 1.3.0
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/bin/kp.mjs +27 -0
- package/package.json +1 -1
package/bin/kp.mjs
CHANGED
|
@@ -203,6 +203,31 @@ Counter app = new Counter();
|
|
|
203
203
|
app.Mount(document.body);
|
|
204
204
|
`;
|
|
205
205
|
|
|
206
|
+
// Loaded automatically at session start by AI coding agents (AGENTS.md is the
|
|
207
|
+
// cross-tool convention; Claude Code reads CLAUDE.md, which imports it). Kept
|
|
208
|
+
// deliberately tiny, because it sits in every request's context. Its one job is
|
|
209
|
+
// routing: an agent that opens node_modules/kopular/LLM.md (~53K chars) before
|
|
210
|
+
// GUIDE.md (~15K) pays for that on every call after, and benchmark transcripts
|
|
211
|
+
// showed agents never read a project's README unprompted.
|
|
212
|
+
const AGENTS_MD_TEMPLATE = `# Notes for AI coding agents
|
|
213
|
+
|
|
214
|
+
This app is KopScript + Kopular: a typed language that compiles to JavaScript, and is
|
|
215
|
+
probably not in your training data.
|
|
216
|
+
|
|
217
|
+
- **Read \`node_modules/kopular/GUIDE.md\` first**, in full: one page covering the language
|
|
218
|
+
subset, components, templates, forms, HTTP and routing. Search the much longer
|
|
219
|
+
\`node_modules/kopular/LLM.md\` and \`node_modules/kopscript/LLM.md\` only for what it
|
|
220
|
+
doesn't cover.
|
|
221
|
+
- **Check your work with one command.** \`npm run build\` compiles \`src/app.ks\` and every file
|
|
222
|
+
it \`using\`s in well under a second and prints every error with a \`fix:\` hint. Anything
|
|
223
|
+
that runs the app or its tests builds first, so don't run a separate build before it.
|
|
224
|
+
- Kopular's source in \`node_modules\` isn't its documentation — try GUIDE.md, the compiler's
|
|
225
|
+
hint, then the LLM.md references before reading it.
|
|
226
|
+
`;
|
|
227
|
+
|
|
228
|
+
const CLAUDE_MD_TEMPLATE = `@AGENTS.md
|
|
229
|
+
`;
|
|
230
|
+
|
|
206
231
|
function scaffoldProject(dirPath) {
|
|
207
232
|
const name = basename(dirPath);
|
|
208
233
|
if (existsSync(dirPath) && readdirSync(dirPath).length > 0) {
|
|
@@ -218,6 +243,8 @@ function scaffoldProject(dirPath) {
|
|
|
218
243
|
writeFileSync(join(dirPath, "index.html"), indexHtmlTemplate(), "utf-8");
|
|
219
244
|
writeFileSync(join(dirPath, ".gitignore"), GITIGNORE_TEMPLATE, "utf-8");
|
|
220
245
|
writeFileSync(join(dirPath, "README.md"), readmeTemplate(name), "utf-8");
|
|
246
|
+
writeFileSync(join(dirPath, "AGENTS.md"), AGENTS_MD_TEMPLATE, "utf-8");
|
|
247
|
+
writeFileSync(join(dirPath, "CLAUDE.md"), CLAUDE_MD_TEMPLATE, "utf-8");
|
|
221
248
|
writeFileSync(join(dirPath, "scripts", "serve.mjs"), SERVE_MJS_TEMPLATE, "utf-8");
|
|
222
249
|
writeFileSync(join(dirPath, "scripts", "vendor-kopular.mjs"), VENDOR_KOPULAR_MJS_TEMPLATE, "utf-8");
|
|
223
250
|
writeFileSync(join(dirPath, "src", "counter.ks"), COUNTER_KS_TEMPLATE, "utf-8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kopular",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Kopular: a small component framework for KopScript — components, reactive state, constructor-injected services, routing, real compiled templates, and HTTP, with no DI container",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|