@xn-intenton-z2a/agentic-lib 7.1.34 → 7.1.35

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.
@@ -248,6 +248,7 @@ async function loadTaskConfig() {
248
248
  featuresPath: toml.paths?.features || "features/",
249
249
  libraryPath: toml.paths?.docs || "library/",
250
250
  sourcesPath: toml.paths?.["library-sources"] || "SOURCES.md",
251
+ examplesPath: toml.paths?.examples || "examples/",
251
252
  readmePath: toml.paths?.readme || "README.md",
252
253
  depsPath: toml.paths?.dependencies || "package.json",
253
254
  buildScript: toml.execution?.build || "npm run build",
@@ -264,6 +265,7 @@ function getWritablePathsFromConfig(config) {
264
265
  config.testsPath,
265
266
  config.featuresPath,
266
267
  config.libraryPath,
268
+ config.examplesPath,
267
269
  config.readmePath,
268
270
  config.depsPath,
269
271
  ].filter(Boolean);
@@ -363,6 +365,11 @@ function buildTransformPrompt(config, pathsSection) {
363
365
  `## Current Source Files (${sourceFiles.length})`,
364
366
  ...sourceFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
365
367
  "",
368
+ "## Output Artifacts",
369
+ "If your changes produce output artifacts (plots, visualizations, data files, usage examples),",
370
+ `save them to the \`${config.examplesPath || "examples/"}\` directory.`,
371
+ "This directory is for demonstrating what the code can do.",
372
+ "",
366
373
  "## Your Task",
367
374
  "Analyze the mission, features, and source code.",
368
375
  "Determine the single most impactful next step.",
@@ -736,6 +743,14 @@ function initConfig(seedsDir) {
736
743
  } else {
737
744
  console.log(" SKIP: seed TOML not found");
738
745
  }
746
+
747
+ const giSeed = resolve(seedsDir, "zero-.gitignore");
748
+ const giTarget = resolve(target, ".gitignore");
749
+ if (existsSync(giSeed) && !existsSync(giTarget)) {
750
+ initCopyFile(giSeed, giTarget, ".gitignore (new)");
751
+ } else if (existsSync(giTarget)) {
752
+ console.log(" SKIP: .gitignore already exists");
753
+ }
739
754
  }
740
755
 
741
756
  function removeFile(filePath, label) {
@@ -769,6 +784,7 @@ function initReseed() {
769
784
  }
770
785
 
771
786
  clearDirContents(resolve(target, "library"), "library");
787
+ clearDirContents(resolve(target, "examples"), "examples");
772
788
 
773
789
  // Remove old getting-started-guide if it exists
774
790
  const oldGuideDir = resolve(target, ".github/agentic-lib/getting-started-guide");
@@ -782,19 +798,22 @@ function initReseed() {
782
798
  function readTomlPaths() {
783
799
  let sourcePath = "src/lib/";
784
800
  let testsPath = "tests/unit/";
801
+ let examplesPath = "examples/";
785
802
  const tomlTarget = resolve(target, "agentic-lib.toml");
786
803
  if (existsSync(tomlTarget)) {
787
804
  try {
788
805
  const tomlContent = readFileSync(tomlTarget, "utf8");
789
806
  const sourceMatch = tomlContent.match(/^source\s*=\s*"([^"]+)"/m);
790
807
  const testsMatch = tomlContent.match(/^tests\s*=\s*"([^"]+)"/m);
808
+ const examplesMatch = tomlContent.match(/^examples\s*=\s*"([^"]+)"/m);
791
809
  if (sourceMatch) sourcePath = sourceMatch[1];
792
810
  if (testsMatch) testsPath = testsMatch[1];
811
+ if (examplesMatch) examplesPath = examplesMatch[1];
793
812
  } catch (err) {
794
813
  console.log(` WARN: Could not read TOML for paths, using defaults: ${err.message}`);
795
814
  }
796
815
  }
797
- return { sourcePath, testsPath };
816
+ return { sourcePath, testsPath, examplesPath };
798
817
  }
799
818
 
800
819
  function clearAndRecreateDir(dirPath, label) {
@@ -810,9 +829,10 @@ function clearAndRecreateDir(dirPath, label) {
810
829
  function initPurge(seedsDir) {
811
830
  console.log("\n--- Purge: Reset Source Files to Seed State ---");
812
831
 
813
- const { sourcePath, testsPath } = readTomlPaths();
832
+ const { sourcePath, testsPath, examplesPath } = readTomlPaths();
814
833
  clearAndRecreateDir(sourcePath, sourcePath);
815
834
  clearAndRecreateDir(testsPath, testsPath);
835
+ clearAndRecreateDir(examplesPath, examplesPath);
816
836
 
817
837
  // Copy seed files (including config TOML)
818
838
  const SEED_MAP = {
@@ -823,6 +843,7 @@ function initPurge(seedsDir) {
823
843
  "zero-package.json": "package.json",
824
844
  "zero-README.md": "README.md",
825
845
  "zero-agentic-lib.toml": "agentic-lib.toml",
846
+ "zero-.gitignore": ".gitignore",
826
847
  };
827
848
  for (const [seedFile, targetRel] of Object.entries(SEED_MAP)) {
828
849
  const src = resolve(seedsDir, seedFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.1.34",
3
+ "version": "7.1.35",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -35,7 +35,7 @@ import { parse as parseToml } from "smol-toml";
35
35
  */
36
36
 
37
37
  // Keys whose paths are writable by agents
38
- const WRITABLE_KEYS = ["source", "tests", "features", "dependencies", "docs", "readme"];
38
+ const WRITABLE_KEYS = ["source", "tests", "features", "dependencies", "docs", "readme", "examples"];
39
39
 
40
40
  // Default paths — every key that task handlers might access
41
41
  const PATH_DEFAULTS = {
@@ -44,6 +44,7 @@ const PATH_DEFAULTS = {
44
44
  tests: "tests/unit/",
45
45
  features: "features/",
46
46
  docs: "docs/",
47
+ examples: "examples/",
47
48
  readme: "README.md",
48
49
  dependencies: "package.json",
49
50
  library: "library/",
@@ -72,6 +72,11 @@ export async function transform(context) {
72
72
  `## Open Issues (${openIssues.length})`,
73
73
  ...openIssues.slice(0, 10).map((i) => `- #${i.number}: ${i.title}`),
74
74
  "",
75
+ "## Output Artifacts",
76
+ "If your changes produce output artifacts (plots, visualizations, data files, usage examples),",
77
+ `save them to the \`${config.paths.examples?.path || "examples/"}\` directory.`,
78
+ "This directory is for demonstrating what the code can do.",
79
+ "",
75
80
  "## Your Task",
76
81
  "Analyze the mission, features, source code, and open issues.",
77
82
  "Determine the single most impactful next step to transform this repository.",
@@ -190,6 +195,11 @@ async function transformTdd({
190
195
  "",
191
196
  formatPathsSection(writablePaths, readOnlyPaths),
192
197
  "",
198
+ "## Output Artifacts",
199
+ "If your changes produce output artifacts (plots, visualizations, data files, usage examples),",
200
+ `save them to the \`${_config.paths.examples?.path || "examples/"}\` directory.`,
201
+ "This directory is for demonstrating what the code can do.",
202
+ "",
193
203
  "## Constraints",
194
204
  "- Write implementation code to make the failing test pass",
195
205
  "- Do NOT modify the test file created in Phase 1",
@@ -1,7 +1,7 @@
1
1
  Please generate the name and specification for a software feature which will be added or updated to action the supplied feature prompt.
2
2
  Prioritize features that deliver substantial user impact and core functionality that solves real problems. Focus on capabilities that directly enhance the product's primary purpose rather than cosmetic improvements, excessive validation, or polishing. Aim for achievable, high-impact outcomes within a single repository, not a grandiose vision or bloated feature set.
3
3
 
4
- You may only create features to only change the source file, test file, README file and dependencies file content. You may not create features that request new files, delete existing files, or change the other files provided in the prompt context.
4
+ You may only create features to only change the source file, test file, README file, dependencies file, and examples directory content. You may not create features that request new files, delete existing files, or change the other files provided in the prompt context.
5
5
  If there are more than the maximum number of features in the repository, you may delete a feature but preferably, you should identify an existing feature that is most similar or related to the new feature and modify it to incorporate aspects of the new feature.
6
6
  All existing features could be retained, with one being enhanced to move towards accommodating the new feature.
7
7
 
@@ -0,0 +1,27 @@
1
+ # Node
2
+ node_modules/
3
+
4
+ # Coverage
5
+ coverage/
6
+
7
+ # Environment and secrets
8
+ .env
9
+ secrets.env
10
+ *.kdbx
11
+ .npmrc
12
+
13
+ # OS files
14
+ .DS_Store
15
+ Thumbs.db
16
+
17
+ # IDE
18
+ .idea/
19
+ .vscode/
20
+ *.swp
21
+ *.swo
22
+
23
+ # Generated files at repo root (agents should use examples/ instead)
24
+ /*.png
25
+ /*.svg
26
+ /*.pdf
27
+ /*.csv
@@ -16,6 +16,7 @@ tests = "tests/unit/"
16
16
  features = "features/"
17
17
  library = "library/"
18
18
  docs = "docs/"
19
+ examples = "examples/"
19
20
  readme = "README.md"
20
21
  dependencies = "package.json"
21
22
  contributing = "CONTRIBUTING.md"
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.34"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.35"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",