@p_tipso/agentive 1.0.0 → 1.0.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 +67 -83
- package/package.json +2 -2
- package/src/commands/init.js +65 -100
- package/src/templates/base/AGENTS.md +29 -0
- package/src/templates/base/commands/README.md +26 -0
- package/src/templates/base/commands/fix-issue.md +41 -0
- package/src/templates/base/commands/review.md +37 -0
- package/src/templates/base/rules/README.md +29 -0
- package/src/templates/base/skills/README.md +29 -0
- package/src/templates/mobile/expo/rules/01-expo-components.md +17 -0
- package/src/templates/mobile/expo/rules/02-expo-styling.md +16 -0
- package/src/templates/mobile/expo/rules/expo-router.md +16 -0
- package/src/templates/mobile/expo/skills/create-expo-app.md +19 -0
- package/src/templates/mobile/expo/skills/expo-upgrader.md +10 -0
- package/src/templates/mobile/react-native/rules/01-native-primitives.md +18 -0
- package/src/templates/mobile/react-native/rules/02-native-styling.md +29 -0
- package/src/templates/mobile/react-native/rules/03-ios-android-builds.md +14 -0
- package/src/templates/mobile/react-native/skills/native-linking.md +27 -0
- package/src/utils/compilers.js +22 -21
- package/src/utils/fileSystem.js +86 -48
- package/src/templates/context/project_overview.md +0 -62
- package/src/templates/rules/architecture.md +0 -42
- package/src/templates/skills/data-extractor.md +0 -56
- package/src/templates/skills/data-transformer.md +0 -62
- package/src/templates/skills/output-dispatcher.md +0 -79
- package/src/templates/skills/web-browser.md +0 -54
package/README.md
CHANGED
|
@@ -1,127 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Agentive
|
|
4
4
|
|
|
5
5
|
**A universal, framework-agnostic AI agent workspace CLI.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@p_tipso/agentive"><img src="https://img.shields.io/npm/v/@p_tipso/agentive?style=for-the-badge&color=blue" alt="npm version"></a>
|
|
9
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen?style=for-the-badge&logo=nodedotjs" alt="Node.js"></a>
|
|
10
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge" alt="License: MIT"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/@p_tipso/agentive"><img src="https://img.shields.io/npm/dm/@p_tipso/agentive?style=flat-square&label=downloads" alt="npm downloads"></a>
|
|
15
|
+
<a href="https://github.com/TiPS0/agentive/stargazers"><img src="https://img.shields.io/github/stars/TiPS0/agentive?style=flat-square&logo=github" alt="GitHub stars"></a>
|
|
16
|
+
<a href="https://github.com/TiPS0/agentive/issues"><img src="https://img.shields.io/github/issues/TiPS0/agentive?style=flat-square" alt="GitHub issues"></a>
|
|
17
|
+
</p>
|
|
10
18
|
|
|
11
19
|
</div>
|
|
12
20
|
|
|
13
21
|
---
|
|
14
22
|
|
|
15
|
-
Stop maintaining separate rule files for every AI tool. **agentive** scaffolds a
|
|
23
|
+
Stop maintaining separate rule files for every AI tool. **agentive** scaffolds a universal `.agents/` directory and an `AGENTS.md` file in your project — providing a **single source of truth** for all your agent commands, skills, and rules.
|
|
16
24
|
|
|
17
|
-
## ✨
|
|
25
|
+
## ✨ Why Agentive?
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
| Feature | Description |
|
|
28
|
+
| :---------------------------- | :------------------------------------------------------------------- |
|
|
29
|
+
| 🚀 **Zero Config** | Run one command and get a fully structured workspace instantly. |
|
|
30
|
+
| 🌍 **Universal** | Framework-agnostic setup. Works with React, Python, Go, you name it. |
|
|
31
|
+
| 🧠 **Single Source of Truth** | Centralize skills and rules for _all_ your AI agents in one place. |
|
|
32
|
+
| ⚡ **No Prompts** | Just run it. No annoying interactive setup wizards to slow you down. |
|
|
24
33
|
|
|
25
34
|
---
|
|
26
35
|
|
|
27
|
-
##
|
|
36
|
+
## 📦 Installation & Usage
|
|
37
|
+
|
|
38
|
+
Run one command, get a fully structured AI agent workspace instantly:
|
|
28
39
|
|
|
29
40
|
```bash
|
|
30
41
|
npx @p_tipso/agentive
|
|
31
42
|
```
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
1. **Project name** (pre-filled from your directory name)
|
|
35
|
-
2. **Your primary tech stack** (e.g. "Next.js, TypeScript, Postgres")
|
|
36
|
-
3. **Which AI tools** you use (multi-select: Cursor, Claude, Windsurf)
|
|
37
|
-
|
|
38
|
-
Then it scaffolds everything automatically.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## 📁 Output Structure
|
|
43
|
-
|
|
44
|
-
After running `npx @p_tipso/agentive`, your project will have:
|
|
44
|
+
If you prefer to install it globally for frequent usage:
|
|
45
45
|
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
│ ├── settings.json ← project config (commit this)
|
|
50
|
-
│ ├── settings.local.json ← local overrides (gitignored automatically)
|
|
51
|
-
│ ├── rules/
|
|
52
|
-
│ │ └── architecture.md ← project-wide rules for all agents
|
|
53
|
-
│ └── skills/
|
|
54
|
-
│ ├── web-browser.md ← how agents should browse the web
|
|
55
|
-
│ ├── data-extractor.md ← how agents should extract data
|
|
56
|
-
│ ├── data-transformer.md ← how agents should transform data
|
|
57
|
-
│ └── output-dispatcher.md ← how agents should deliver output
|
|
58
|
-
│
|
|
59
|
-
│ ── (auto-synced based on your selection) ──
|
|
60
|
-
│
|
|
61
|
-
├── .cursor/rules/ ← if you selected Cursor
|
|
62
|
-
├── CLAUDE.md ← if you selected Claude
|
|
63
|
-
└── .windsurfrules ← if you selected Windsurf
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g @p_tipso/agentive
|
|
48
|
+
agentive
|
|
64
49
|
```
|
|
65
50
|
|
|
66
|
-
###
|
|
51
|
+
### CLI Commands
|
|
67
52
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"agentiveVersion": "1.0.0",
|
|
74
|
-
"createdAt": "2026-07-05T12:00:00.000Z"
|
|
75
|
-
}
|
|
76
|
-
```
|
|
53
|
+
| Command | Description |
|
|
54
|
+
| :-------------------------------- | :----------------------------------------------------------- |
|
|
55
|
+
| `npx @p_tipso/agentive` | Scaffold `.agents/` workspace instantly in current directory |
|
|
56
|
+
| `npx @p_tipso/agentive --version` | Print the current CLI version |
|
|
57
|
+
| `npx @p_tipso/agentive --help` | Show available commands and options |
|
|
77
58
|
|
|
78
59
|
---
|
|
79
60
|
|
|
80
|
-
##
|
|
61
|
+
## 🏗 What Happens Under the Hood?
|
|
81
62
|
|
|
82
|
-
|
|
83
|
-
|---|---|
|
|
84
|
-
| `npx @p_tipso/agentive` | Run the setup wizard and scaffold your `.agent/` workspace |
|
|
85
|
-
| `npx @p_tipso/agentive init` | Same as above (explicit subcommand) |
|
|
86
|
-
| `npx @p_tipso/agentive --version` | Print the current version |
|
|
87
|
-
| `npx @p_tipso/agentive --help` | Show available commands |
|
|
63
|
+
When you run `agentive`, it detects your current directory and instantly scaffolds this structure:
|
|
88
64
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
65
|
+
```text
|
|
66
|
+
your-project/
|
|
67
|
+
├── AGENTS.md ← Root agent instructions
|
|
68
|
+
├── .agents/
|
|
69
|
+
│ ├── settings.json ← Project config
|
|
70
|
+
│ ├── settings.local.json ← Local machine overrides (auto-gitignored)
|
|
71
|
+
│ ├── commands/
|
|
72
|
+
│ │ ├── README.md ← Guide: how to add commands
|
|
73
|
+
│ │ ├── review.md ← Example code review command
|
|
74
|
+
│ │ └── fix-issue.md ← Example zero-error fix command
|
|
75
|
+
│ ├── skills/
|
|
76
|
+
│ │ └── README.md ← Guide: how to add skills
|
|
77
|
+
│ └── rules/
|
|
78
|
+
│ └── README.md ← Guide: how to add rules
|
|
79
|
+
```
|
|
92
80
|
|
|
93
|
-
|
|
81
|
+
### 📂 Folder Guide
|
|
94
82
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```
|
|
83
|
+
- **`commands/`**: Reusable prompt instructions that agents can execute on demand (e.g. `review.md`).
|
|
84
|
+
- **`skills/`**: Skill definitions that teach agents how to behave in specific roles.
|
|
85
|
+
- **`rules/`**: Project-wide rules that all agents must follow strictly.
|
|
99
86
|
|
|
100
87
|
---
|
|
101
88
|
|
|
102
|
-
##
|
|
103
|
-
|
|
104
|
-
Edited your `.agent/` files and want to push changes to Cursor, Claude, etc.? Just re-run:
|
|
89
|
+
## 🤝 Contributing
|
|
105
90
|
|
|
106
|
-
|
|
107
|
-
npx @p_tipso/agentive
|
|
108
|
-
```
|
|
91
|
+
We love contributions! Whether it's adding new built-in skills, fixing bugs, or improving documentation, your help is appreciated.
|
|
109
92
|
|
|
110
|
-
|
|
93
|
+
Please read our [Contributing Guide](CONTRIBUTING.md) to get started with setting up your local environment and submitting a Pull Request.
|
|
111
94
|
|
|
112
95
|
---
|
|
113
96
|
|
|
114
|
-
##
|
|
97
|
+
## ⭐ Star History
|
|
115
98
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
<a href="https://star-history.com/#TiPS0/agentive&Date">
|
|
100
|
+
<picture>
|
|
101
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date&theme=dark" />
|
|
102
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date" />
|
|
103
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=TiPS0/agentive&type=Date" />
|
|
104
|
+
</picture>
|
|
105
|
+
</a>
|
|
121
106
|
|
|
122
107
|
---
|
|
123
108
|
|
|
124
109
|
## 📄 License
|
|
125
110
|
|
|
126
|
-
|
|
127
|
-
]]>
|
|
111
|
+
This project is licensed under the [MIT License](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p_tipso/agentive",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A universal, framework-agnostic AI agent repository setup CLI. Scaffold a .agent/ workspace and sync to Cursor, Claude, and Windsurf.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Pakawat Tipso",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "git+https://github.com/TiPS0/agentive.git"
|
|
35
35
|
},
|
|
36
|
-
"homepage": "https://github.com/TiPS0/agentive
|
|
36
|
+
"homepage": "https://github.com/TiPS0/agentive",
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/TiPS0/agentive/issues"
|
|
39
39
|
},
|
package/src/commands/init.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const prompts = require('prompts');
|
|
5
4
|
const chalk = require('chalk');
|
|
5
|
+
const prompts = require('prompts');
|
|
6
6
|
const { version } = require('../../package.json');
|
|
7
7
|
const {
|
|
8
8
|
createAgentDirectory,
|
|
@@ -10,138 +10,103 @@ const {
|
|
|
10
10
|
agentDirectoryExists,
|
|
11
11
|
writeSettings,
|
|
12
12
|
} = require('../utils/fileSystem');
|
|
13
|
-
const { syncToCursor, syncToClaude, syncToWindsurf } = require('../utils/compilers');
|
|
14
|
-
|
|
15
|
-
const AI_TOOLS = [
|
|
16
|
-
{ title: '🖱 Cursor', value: 'cursor', description: 'Generates .cursor/rules/' },
|
|
17
|
-
{ title: '🤖 Claude', value: 'claude', description: 'Generates CLAUDE.md' },
|
|
18
|
-
{ title: '🌊 Windsurf', value: 'windsurf', description: 'Generates .windsurfrules' },
|
|
19
|
-
];
|
|
20
13
|
|
|
21
14
|
async function runInit() {
|
|
22
15
|
const cwd = process.cwd();
|
|
16
|
+
const projectName = path.basename(cwd);
|
|
23
17
|
|
|
24
18
|
console.log('');
|
|
25
19
|
console.log(chalk.bold.cyan(' 🤖 agentive') + chalk.gray(' — Universal AI Agent Workspace Setup'));
|
|
26
20
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
27
21
|
console.log('');
|
|
28
22
|
|
|
29
|
-
// --- Guard: check if .
|
|
23
|
+
// --- Guard: check if .agents/ already exists ---
|
|
30
24
|
const alreadyExists = await agentDirectoryExists(cwd);
|
|
31
25
|
if (alreadyExists) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
initial: false,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (!overwrite) {
|
|
40
|
-
console.log('');
|
|
41
|
-
console.log(chalk.gray(' Aborted. Your existing .agent/ directory was not modified.'));
|
|
42
|
-
console.log('');
|
|
43
|
-
process.exit(0);
|
|
44
|
-
}
|
|
26
|
+
console.log(chalk.yellow(' ⚠ ') + chalk.white('.agents/ already exists — skipping (no files were modified).'));
|
|
27
|
+
console.log(chalk.gray(' Delete .agents/ first if you want to re-scaffold.'));
|
|
28
|
+
console.log('');
|
|
29
|
+
process.exit(0);
|
|
45
30
|
}
|
|
46
31
|
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
console.log(chalk.gray(' Installing to: ') + chalk.white(cwd));
|
|
33
|
+
console.log('');
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: 'text',
|
|
61
|
-
name: 'techStack',
|
|
62
|
-
message: 'Primary tech stack?',
|
|
63
|
-
placeholder: 'e.g. Next.js, TypeScript, PostgreSQL',
|
|
64
|
-
validate: (v) => v.trim().length > 0 || 'Required.',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: 'multiselect',
|
|
68
|
-
name: 'tools',
|
|
69
|
-
message: 'Which AI tools do you want to target?',
|
|
70
|
-
choices: AI_TOOLS,
|
|
71
|
-
min: 1,
|
|
72
|
-
hint: '- Space to select. Return to submit',
|
|
73
|
-
instructions: false,
|
|
74
|
-
},
|
|
35
|
+
// --- Prompt User for Project Type ---
|
|
36
|
+
const typeResponse = await prompts({
|
|
37
|
+
type: 'select',
|
|
38
|
+
name: 'projectType',
|
|
39
|
+
message: 'What type of project are you building?',
|
|
40
|
+
choices: [
|
|
41
|
+
{ title: 'General / Universal', value: 'general' },
|
|
42
|
+
{ title: 'Web Development', value: 'web', disabled: true },
|
|
43
|
+
{ title: 'Mobile Development', value: 'mobile' },
|
|
75
44
|
],
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log('');
|
|
79
|
-
console.log(chalk.gray(' Setup cancelled.'));
|
|
80
|
-
process.exit(0);
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
);
|
|
45
|
+
initial: 0,
|
|
46
|
+
});
|
|
84
47
|
|
|
85
|
-
|
|
86
|
-
|
|
48
|
+
if (!typeResponse.projectType) {
|
|
49
|
+
console.log(chalk.red(' ✖ ') + 'Setup cancelled.');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
87
52
|
|
|
88
|
-
|
|
89
|
-
|
|
53
|
+
let framework = null;
|
|
54
|
+
if (typeResponse.projectType === 'mobile') {
|
|
55
|
+
const fwResponse = await prompts({
|
|
56
|
+
type: 'select',
|
|
57
|
+
name: 'framework',
|
|
58
|
+
message: 'Which framework are you using?',
|
|
59
|
+
choices: [
|
|
60
|
+
{ title: 'Expo', value: 'expo' },
|
|
61
|
+
{ title: 'React Native', value: 'react-native' },
|
|
62
|
+
],
|
|
63
|
+
initial: 0,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (!fwResponse.framework) {
|
|
67
|
+
console.log(chalk.red(' ✖ ') + 'Setup cancelled.');
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
framework = fwResponse.framework;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const projectType = typeResponse.projectType;
|
|
90
74
|
console.log('');
|
|
91
75
|
|
|
92
|
-
// --- Scaffold .
|
|
76
|
+
// --- Scaffold .agents/ directory ---
|
|
93
77
|
const templatesDir = path.join(__dirname, '..', 'templates');
|
|
94
|
-
const
|
|
95
|
-
await copyTemplates(templatesDir,
|
|
78
|
+
const agentsDir = await createAgentDirectory(cwd, false);
|
|
79
|
+
await copyTemplates(templatesDir, agentsDir, projectName, projectType, framework);
|
|
96
80
|
|
|
97
81
|
// --- Write settings.json and settings.local.json ---
|
|
98
|
-
await writeSettings(
|
|
99
|
-
projectName
|
|
100
|
-
|
|
101
|
-
|
|
82
|
+
await writeSettings(agentsDir, {
|
|
83
|
+
projectName,
|
|
84
|
+
projectType,
|
|
85
|
+
framework,
|
|
102
86
|
agentiveVersion: version,
|
|
103
87
|
createdAt: new Date().toISOString(),
|
|
104
88
|
});
|
|
105
89
|
|
|
106
|
-
console.log(chalk.green(' ✔ ') + chalk.white('
|
|
107
|
-
|
|
108
|
-
// --- Sync to selected tools ---
|
|
109
|
-
const compilers = {
|
|
110
|
-
cursor: syncToCursor,
|
|
111
|
-
claude: syncToClaude,
|
|
112
|
-
windsurf: syncToWindsurf,
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const toolLabels = {
|
|
116
|
-
cursor: '.cursor/rules/',
|
|
117
|
-
claude: 'CLAUDE.md',
|
|
118
|
-
windsurf: '.windsurfrules',
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
for (const tool of tools) {
|
|
122
|
-
try {
|
|
123
|
-
await compilers[tool](agentDir, cwd, techStack);
|
|
124
|
-
console.log(chalk.green(' ✔ ') + chalk.white('Synced → ') + chalk.cyan(toolLabels[tool]));
|
|
125
|
-
} catch (err) {
|
|
126
|
-
console.log(chalk.red(' ✘ ') + chalk.white(`Failed to sync ${tool}: `) + chalk.gray(err.message));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
90
|
+
console.log(chalk.green(' ✔ ') + chalk.white('Created ') + chalk.cyan('AGENTS.md'));
|
|
91
|
+
console.log(chalk.green(' ✔ ') + chalk.white('Scaffolded ') + chalk.cyan('.agents/') + chalk.white(' workspace'));
|
|
129
92
|
|
|
130
93
|
// --- Done ---
|
|
131
94
|
console.log('');
|
|
132
95
|
console.log(chalk.bold.green(' ✅ All done!'));
|
|
133
96
|
console.log('');
|
|
134
|
-
console.log(chalk.white(' Your AI workspace is ready
|
|
97
|
+
console.log(chalk.white(' Your AI workspace is ready:'));
|
|
135
98
|
console.log('');
|
|
136
|
-
console.log(chalk.gray('
|
|
137
|
-
console.log(chalk.gray(' .
|
|
138
|
-
console.log(chalk.gray(' ├── settings.json
|
|
139
|
-
console.log(chalk.gray(' ├── settings.local.json
|
|
140
|
-
console.log(chalk.gray(' ├──
|
|
141
|
-
console.log(chalk.gray('
|
|
99
|
+
console.log(chalk.gray(' AGENTS.md ← root agent instructions'));
|
|
100
|
+
console.log(chalk.gray(' .agents/'));
|
|
101
|
+
console.log(chalk.gray(' ├── settings.json ← project config'));
|
|
102
|
+
console.log(chalk.gray(' ├── settings.local.json ← local overrides (gitignored)'));
|
|
103
|
+
console.log(chalk.gray(' ├── commands/'));
|
|
104
|
+
console.log(chalk.gray(' │ ├── review.md ← code review command'));
|
|
105
|
+
console.log(chalk.gray(' │ └── fix-issue.md ← zero-error fix command'));
|
|
106
|
+
console.log(chalk.gray(' ├── skills/'));
|
|
107
|
+
console.log(chalk.gray(' └── rules/'));
|
|
142
108
|
console.log('');
|
|
143
|
-
console.log(chalk.gray(' Edit the markdown files
|
|
144
|
-
console.log(chalk.gray(' Re-run ') + chalk.cyan('npx @p_tipso/agentive') + chalk.gray(' any time to re-sync to your AI tools.'));
|
|
109
|
+
console.log(chalk.gray(' Edit the markdown files to customise agent behaviour.'));
|
|
145
110
|
console.log('');
|
|
146
111
|
}
|
|
147
112
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
> This file is your project's top-level instruction file for AI agents.
|
|
4
|
+
> It is generated by [agentive](https://github.com/TiPS0/agentive).
|
|
5
|
+
|
|
6
|
+
## Project
|
|
7
|
+
|
|
8
|
+
- **Name:** {{PROJECT_NAME}}
|
|
9
|
+
|
|
10
|
+
## Agent Configuration
|
|
11
|
+
|
|
12
|
+
All agent configuration lives inside the `.agents/` directory:
|
|
13
|
+
|
|
14
|
+
| Path | Purpose |
|
|
15
|
+
|------|---------|
|
|
16
|
+
| `.agents/settings.json` | Project-wide agent configuration (commit this) |
|
|
17
|
+
| `.agents/settings.local.json` | Local machine overrides (gitignored) |
|
|
18
|
+
| `.agents/commands/` | Reusable prompt commands your agents can execute |
|
|
19
|
+
| `.agents/skills/` | Skill definitions that teach agents how to behave |
|
|
20
|
+
| `.agents/rules/` | Project-wide rules all agents must follow |
|
|
21
|
+
|
|
22
|
+
## Getting Started
|
|
23
|
+
|
|
24
|
+
1. Edit the markdown files inside `.agents/` to customise agent behaviour
|
|
25
|
+
2. Add new commands in `.agents/commands/` for common tasks
|
|
26
|
+
3. Add new skills in `.agents/skills/` to teach agents new capabilities
|
|
27
|
+
4. Add new rules in `.agents/rules/` to enforce coding standards
|
|
28
|
+
|
|
29
|
+
Re-run `npx @p_tipso/agentive` any time to re-sync changes to your AI tools.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
This folder contains **reusable prompt commands** — predefined instructions that AI agents can execute on demand.
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
Each `.md` file in this directory is a command. To use a command, reference it by name when prompting your AI agent.
|
|
8
|
+
|
|
9
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
Each command file should include:
|
|
12
|
+
|
|
13
|
+
- **Goal:** What the command achieves
|
|
14
|
+
- **Steps:** The ordered steps the agent should follow
|
|
15
|
+
- **Output:** What the agent should produce at the end
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
| File | Purpose |
|
|
20
|
+
|------|---------|
|
|
21
|
+
| `review.md` | Review code for bugs, performance, and best practices |
|
|
22
|
+
| `fix-issue.md` | Diagnose and fix code errors with zero tolerance |
|
|
23
|
+
|
|
24
|
+
## Adding new commands
|
|
25
|
+
|
|
26
|
+
Create a new `.md` file in this folder. Name it clearly (e.g., `write-tests.md`, `refactor.md`, `deploy-check.md`).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Command: Fix Issue (Zero Code Error)
|
|
2
|
+
|
|
3
|
+
> Use this command to diagnose and fix code errors with zero tolerance — no errors should remain after execution.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Find and fix **all** code errors in the target file or project. The end result must compile, run, and pass all existing tests with zero errors.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Identify the error** — read the error message, stack trace, or failing test output
|
|
12
|
+
2. **Locate the root cause** — trace the error to its origin (don't just fix the symptom)
|
|
13
|
+
3. **Understand the context** — read surrounding code to understand the intended behaviour
|
|
14
|
+
4. **Implement the fix** — make the minimal change that resolves the root cause
|
|
15
|
+
5. **Check for side effects** — ensure the fix doesn't break other functionality
|
|
16
|
+
6. **Verify** — confirm the error is resolved by running the relevant command or test
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- **Never** suppress or silence errors without fixing the underlying cause
|
|
21
|
+
- **Never** add `// @ts-ignore`, `eslint-disable`, or similar without explicit approval
|
|
22
|
+
- **Prefer** targeted fixes over large refactors
|
|
23
|
+
- **Always** explain what caused the error and why the fix resolves it
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
### Error
|
|
29
|
+
[Original error message or description]
|
|
30
|
+
|
|
31
|
+
### Root Cause
|
|
32
|
+
[Explanation of why this error occurred]
|
|
33
|
+
|
|
34
|
+
### Fix Applied
|
|
35
|
+
[Description of what was changed and where]
|
|
36
|
+
|
|
37
|
+
### Verification
|
|
38
|
+
[How the fix was verified — command run, test passed, etc.]
|
|
39
|
+
|
|
40
|
+
### Status: ✅ Resolved
|
|
41
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Command: Review Code
|
|
2
|
+
|
|
3
|
+
> Use this command to perform a thorough code review on a file, folder, or pull request.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Review the target code for correctness, performance, readability, and adherence to project conventions.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Read** the target code carefully from start to finish
|
|
12
|
+
2. **Check for bugs** — logic errors, off-by-one errors, null/undefined handling, race conditions
|
|
13
|
+
3. **Check for performance** — unnecessary re-renders, N+1 queries, missing indexes, memory leaks
|
|
14
|
+
4. **Check for security** — injection vulnerabilities, exposed secrets, missing auth checks
|
|
15
|
+
5. **Check for readability** — naming, function length, comment quality, dead code
|
|
16
|
+
6. **Check for conventions** — does the code follow the rules defined in `.agents/rules/`?
|
|
17
|
+
|
|
18
|
+
## Output
|
|
19
|
+
|
|
20
|
+
Provide a structured review with:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
### Summary
|
|
24
|
+
One-sentence verdict (e.g., "Generally solid, 2 bugs found")
|
|
25
|
+
|
|
26
|
+
### Issues Found
|
|
27
|
+
- 🐛 **Bug:** [description] (file:line)
|
|
28
|
+
- ⚡ **Performance:** [description] (file:line)
|
|
29
|
+
- 🔒 **Security:** [description] (file:line)
|
|
30
|
+
|
|
31
|
+
### Suggestions
|
|
32
|
+
- 💡 [optional improvement]
|
|
33
|
+
|
|
34
|
+
### Verdict
|
|
35
|
+
- [ ] Ready to merge
|
|
36
|
+
- [ ] Needs changes (see issues above)
|
|
37
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Rules
|
|
2
|
+
|
|
3
|
+
This folder contains **project-wide rules** — constraints and standards that all AI agents must follow when working in this repository.
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
Each `.md` file in this directory defines a set of rules. Agents will read and adhere to these rules for every task they perform.
|
|
8
|
+
|
|
9
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
Each rule file should include:
|
|
12
|
+
|
|
13
|
+
- **Purpose:** Why this rule exists
|
|
14
|
+
- **Rules:** The specific constraints, listed clearly
|
|
15
|
+
- **Examples:** Good vs. bad patterns (optional but recommended)
|
|
16
|
+
|
|
17
|
+
## Examples of rules you could add
|
|
18
|
+
|
|
19
|
+
| File | Purpose |
|
|
20
|
+
|------|---------|
|
|
21
|
+
| `code-style.md` | Naming conventions, formatting, and patterns |
|
|
22
|
+
| `architecture.md` | How the project is structured, what goes where |
|
|
23
|
+
| `testing.md` | Testing requirements, coverage expectations |
|
|
24
|
+
| `security.md` | Security practices, data handling rules |
|
|
25
|
+
| `git.md` | Branch naming, commit messages, PR conventions |
|
|
26
|
+
|
|
27
|
+
## Adding new rules
|
|
28
|
+
|
|
29
|
+
Create a new `.md` file in this folder. Name it after the topic (e.g., `error-handling.md`, `performance.md`).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Skills
|
|
2
|
+
|
|
3
|
+
This folder contains **skill definitions** — instructions that teach AI agents how to behave in specific roles or capabilities.
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
Each `.md` file in this directory defines a skill. The agent will adopt the role described in the skill file when activated.
|
|
8
|
+
|
|
9
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
Each skill file should include:
|
|
12
|
+
|
|
13
|
+
- **Role description:** What the agent does in this role
|
|
14
|
+
- **Responsibilities:** Specific tasks the agent handles
|
|
15
|
+
- **Inputs / Outputs:** What the agent expects and what it produces
|
|
16
|
+
- **Constraints:** Boundaries the agent must respect
|
|
17
|
+
|
|
18
|
+
## Examples of skills you could add
|
|
19
|
+
|
|
20
|
+
| File | Purpose |
|
|
21
|
+
|------|---------|
|
|
22
|
+
| `web-browser.md` | How agents should browse the web and retrieve data |
|
|
23
|
+
| `data-extractor.md` | How agents should extract structured data from raw content |
|
|
24
|
+
| `code-writer.md` | How agents should write new code following project conventions |
|
|
25
|
+
| `tester.md` | How agents should write and run tests |
|
|
26
|
+
|
|
27
|
+
## Adding new skills
|
|
28
|
+
|
|
29
|
+
Create a new `.md` file in this folder. Name it after the role (e.g., `api-designer.md`, `database-manager.md`).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Rule: Expo Components & Libraries
|
|
2
|
+
|
|
3
|
+
When building UI or accessing device features in an Expo project, you MUST adhere to the following rules:
|
|
4
|
+
|
|
5
|
+
1. **Strictly Prefer Expo SDK Packages**:
|
|
6
|
+
- For images, ALWAYS use `expo-image` instead of React Native's `<Image>` or `react-native-fast-image`.
|
|
7
|
+
- For icons, prefer `expo-symbols` or `@expo/vector-icons`.
|
|
8
|
+
- For fonts, use `expo-font`.
|
|
9
|
+
- For device features (camera, location, file system), ALWAYS check if an official `expo-*` package exists before reaching for a third-party React Native package.
|
|
10
|
+
|
|
11
|
+
2. **No Web Primitives**:
|
|
12
|
+
- NEVER use `<div>`, `<span>`, `<button>`, `<p>`, `<a>`, or `<input>`.
|
|
13
|
+
- You MUST use `<View>`, `<Text>`, `<Pressable>`, `<TextInput>`, etc., from `react-native`.
|
|
14
|
+
|
|
15
|
+
3. **Avoid Bare Native Modules**:
|
|
16
|
+
- Do NOT recommend installing libraries that require manual `pod install` or manual Android Gradle changes unless they are explicitly Expo-compatible (e.g., they provide a Config Plugin).
|
|
17
|
+
- If a library requires native code changes, remind the user that they must use a Custom Development Client (`npx expo run:ios` or `npx expo run:android`) rather than Expo Go.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Rule: Expo Styling
|
|
2
|
+
|
|
3
|
+
1. **Flexbox Defaults**:
|
|
4
|
+
- Remember that in React Native, `flexDirection` defaults to `"column"`, NOT `"row"`.
|
|
5
|
+
- `display: "flex"` is the default and only display type for Views.
|
|
6
|
+
|
|
7
|
+
2. **Unitless Values**:
|
|
8
|
+
- NEVER use string values with `px` for dimensions (e.g., `width: "100px"`). ALWAYS use unitless numbers (e.g., `width: 100`).
|
|
9
|
+
- Percentages are allowed as strings (e.g., `width: "100%"`).
|
|
10
|
+
|
|
11
|
+
3. **StyleSheet Priority**:
|
|
12
|
+
- Unless NativeWind (Tailwind) is explicitly set up in the project, ALWAYS use `StyleSheet.create({ ... })` from `react-native` to define styles.
|
|
13
|
+
- Avoid inline object styles except for dynamic values (e.g., `style={{ width: dynamicWidth }}`).
|
|
14
|
+
|
|
15
|
+
4. **SafeAreaView**:
|
|
16
|
+
- In Expo Router, do NOT use `react-native`'s `SafeAreaView`. Use `react-native-safe-area-context` and its `useSafeAreaInsets` hook or `<SafeAreaView>` component to handle notches properly across all platforms.
|