@p_tipso/agentive 1.1.1 → 1.1.2
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/README.md +2 -7
- package/package.json +1 -1
- package/src/utils/fileSystem.js +12 -3
package/README.md
CHANGED
|
@@ -99,17 +99,12 @@ We love contributions! Whether it's adding new built-in skills, fixing bugs, or
|
|
|
99
99
|
|
|
100
100
|
Please read our [Contributing Guide](CONTRIBUTING.md) to get started with setting up your local environment and submitting a Pull Request.
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
---
|
|
103
104
|
|
|
104
105
|
## ⭐ Star History
|
|
105
106
|
|
|
106
|
-
|
|
107
|
-
<picture>
|
|
108
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date&theme=dark" />
|
|
109
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date" />
|
|
110
|
-
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date" />
|
|
111
|
-
</picture>
|
|
112
|
-
</a>
|
|
107
|
+
[](https://star-history.com/#TiPS0/agentive&Date)
|
|
113
108
|
|
|
114
109
|
---
|
|
115
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p_tipso/agentive",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A universal, framework-agnostic AI agent repository setup CLI. Scaffold a .agents/ workspace, AGENTS.md, and .aiignore to sync and optimize context for Cursor, Claude, and Windsurf.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Pakawat Tipso",
|
package/src/utils/fileSystem.js
CHANGED
|
@@ -42,8 +42,6 @@ async function createAgentDirectory(cwd, overwrite = false) {
|
|
|
42
42
|
|
|
43
43
|
if (overwrite) {
|
|
44
44
|
await fs.rm(agentsDir, { recursive: true, force: true });
|
|
45
|
-
// Also remove old AGENTS.md if overwriting
|
|
46
|
-
try { await fs.rm(path.join(cwd, 'AGENTS.md'), { force: true }); } catch { /* noop */ }
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
await fs.mkdir(agentsDir, { recursive: true });
|
|
@@ -130,10 +128,21 @@ async function copyTemplates(templatesDir, agentsDir, projectName, projectType =
|
|
|
130
128
|
|
|
131
129
|
// 1. Copy AGENTS.md from base to project root
|
|
132
130
|
const agentMdSrc = path.join(templatesDir, 'base', 'AGENTS.md');
|
|
131
|
+
const targetAgentMdPath = path.join(cwd, 'AGENTS.md');
|
|
133
132
|
try {
|
|
134
133
|
let content = await fs.readFile(agentMdSrc, 'utf-8');
|
|
135
134
|
content = replacePlaceholders(content, projectName);
|
|
136
|
-
|
|
135
|
+
|
|
136
|
+
let finalContent = content;
|
|
137
|
+
try {
|
|
138
|
+
const existingContent = await fs.readFile(targetAgentMdPath, 'utf-8');
|
|
139
|
+
if (existingContent.trim()) {
|
|
140
|
+
// Prepend the new template content to the existing content
|
|
141
|
+
finalContent = content + '\n\n' + existingContent;
|
|
142
|
+
}
|
|
143
|
+
} catch { /* target may not exist, that's fine */ }
|
|
144
|
+
|
|
145
|
+
await fs.writeFile(targetAgentMdPath, finalContent, 'utf-8');
|
|
137
146
|
} catch { /* template may not exist */ }
|
|
138
147
|
|
|
139
148
|
// 1.5 Copy aiignore from base to project root as .aiignore
|