@moskala/oneagent-templates 0.4.0 → 0.4.1
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/dist/index.js +42 -0
- package/dist/templates/default/instructions.md +3 -0
- package/dist/templates/default/template.yml +36 -0
- package/dist/templates/react/instructions.md +15 -0
- package/dist/templates/react/template.yml +23 -0
- package/dist/templates/react-native/instructions.md +15 -0
- package/dist/templates/react-native/template.yml +14 -0
- package/package.json +11 -5
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs/promises";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { parseTemplateYaml, resolveExtends } from "@moskala/oneagent-core";
|
|
6
|
+
var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
var TEMPLATE_NAMES = ["default", "react", "react-native"];
|
|
8
|
+
async function loadTemplate(name) {
|
|
9
|
+
const templateDir = path.join(__dirname2, "templates", name);
|
|
10
|
+
const [yamlText, instructions] = await Promise.all([
|
|
11
|
+
fs.readFile(path.join(templateDir, "template.yml"), "utf-8"),
|
|
12
|
+
fs.readFile(path.join(templateDir, "instructions.md"), "utf-8")
|
|
13
|
+
]);
|
|
14
|
+
const parsed = parseTemplateYaml(yamlText, name);
|
|
15
|
+
const rulesDir = path.join(templateDir, "rules");
|
|
16
|
+
let rules = [];
|
|
17
|
+
try {
|
|
18
|
+
const ruleFiles = await fs.readdir(rulesDir);
|
|
19
|
+
rules = await Promise.all(ruleFiles.filter((f) => f.endsWith(".md")).map(async (f) => ({
|
|
20
|
+
name: path.basename(f, ".md"),
|
|
21
|
+
content: await fs.readFile(path.join(rulesDir, f), "utf-8")
|
|
22
|
+
})));
|
|
23
|
+
} catch {}
|
|
24
|
+
const base = { ...parsed, instructions, rules };
|
|
25
|
+
return resolveExtends(base, (n) => resolveBuiltinTemplate(n));
|
|
26
|
+
}
|
|
27
|
+
async function resolveBuiltinTemplate(name) {
|
|
28
|
+
if (!TEMPLATE_NAMES.includes(name))
|
|
29
|
+
return null;
|
|
30
|
+
return loadTemplate(name);
|
|
31
|
+
}
|
|
32
|
+
var BUILTIN_TEMPLATE_NAMES = TEMPLATE_NAMES;
|
|
33
|
+
var BUILTIN_TEMPLATE_META = [
|
|
34
|
+
{ name: "default", description: "General programming starter" },
|
|
35
|
+
{ name: "react", description: "React / Next.js project starter" },
|
|
36
|
+
{ name: "react-native", description: "React Native / Expo project starter" }
|
|
37
|
+
];
|
|
38
|
+
export {
|
|
39
|
+
resolveBuiltinTemplate,
|
|
40
|
+
BUILTIN_TEMPLATE_NAMES,
|
|
41
|
+
BUILTIN_TEMPLATE_META
|
|
42
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: default
|
|
2
|
+
description: General programming starter
|
|
3
|
+
skills:
|
|
4
|
+
- repo: https://github.com/vercel-labs/skills
|
|
5
|
+
skill: find-skills
|
|
6
|
+
- repo: https://github.com/obra/superpowers
|
|
7
|
+
skill: writing-skills
|
|
8
|
+
- repo: https://github.com/github/awesome-copilot
|
|
9
|
+
skill: conventional-commit
|
|
10
|
+
- repo: https://github.com/oldwinter/skills
|
|
11
|
+
skill: github-cli
|
|
12
|
+
- repo: https://github.com/supercent-io/skills-template
|
|
13
|
+
skill: code-review
|
|
14
|
+
- repo: https://github.com/vercel-labs/agent-skills
|
|
15
|
+
skill: web-design-guidelines
|
|
16
|
+
- repo: https://github.com/coreyhaines31/marketingskills
|
|
17
|
+
skill: copywriting
|
|
18
|
+
plugins:
|
|
19
|
+
- target: claude
|
|
20
|
+
id: context7@claude-plugins-official
|
|
21
|
+
- target: claude
|
|
22
|
+
id: superpowers@claude-plugins-official
|
|
23
|
+
- target: claude
|
|
24
|
+
id: code-simplifier@claude-plugins-official
|
|
25
|
+
- target: claude
|
|
26
|
+
id: security-guidance@claude-plugins-official
|
|
27
|
+
- target: claude
|
|
28
|
+
id: claude-md-management@claude-plugins-official
|
|
29
|
+
- target: opencode
|
|
30
|
+
id: oh-my-opencode
|
|
31
|
+
- target: opencode
|
|
32
|
+
id: "@plannotator/opencode"
|
|
33
|
+
- target: opencode
|
|
34
|
+
id: "@openspoon/subtask2"
|
|
35
|
+
- target: opencode
|
|
36
|
+
id: micode
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Project Instructions
|
|
2
|
+
|
|
3
|
+
This is a React project. Follow modern React best practices.
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
|
|
7
|
+
- React 18+
|
|
8
|
+
- TypeScript
|
|
9
|
+
- Prefer functional components and hooks
|
|
10
|
+
|
|
11
|
+
## Guidelines
|
|
12
|
+
|
|
13
|
+
- Use composition over inheritance
|
|
14
|
+
- Keep components small and focused
|
|
15
|
+
- Colocate state as close to where it's used as possible
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: react
|
|
2
|
+
description: React / Next.js project starter
|
|
3
|
+
extends: default
|
|
4
|
+
skills:
|
|
5
|
+
- repo: https://github.com/anthropics/skills
|
|
6
|
+
skill: frontend-design
|
|
7
|
+
- repo: https://github.com/vercel-labs/agent-skills
|
|
8
|
+
skill: vercel-react-best-practices
|
|
9
|
+
- repo: https://github.com/vercel-labs/agent-skills
|
|
10
|
+
skill: vercel-composition-patterns
|
|
11
|
+
- repo: https://github.com/obra/superpowers
|
|
12
|
+
skill: brainstorming
|
|
13
|
+
- repo: https://github.com/coreyhaines31/marketingskills
|
|
14
|
+
skill: seo-audit
|
|
15
|
+
- repo: https://github.com/vercel-labs/next-skills
|
|
16
|
+
skill: next-best-practices
|
|
17
|
+
- repo: https://github.com/wshobson/agents
|
|
18
|
+
skill: react-state-management
|
|
19
|
+
plugins:
|
|
20
|
+
- target: claude
|
|
21
|
+
id: frontend-design@claude-plugins-official
|
|
22
|
+
- target: claude
|
|
23
|
+
id: typescript-lsp@claude-plugins-official
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Project Instructions
|
|
2
|
+
|
|
3
|
+
This is a React Native project. Target both iOS and Android.
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
|
|
7
|
+
- React Native with Expo
|
|
8
|
+
- TypeScript
|
|
9
|
+
- Prefer functional components and hooks
|
|
10
|
+
|
|
11
|
+
## Guidelines
|
|
12
|
+
|
|
13
|
+
- Use `StyleSheet.create` for styles
|
|
14
|
+
- Avoid platform-specific code unless necessary; use `Platform.select` when needed
|
|
15
|
+
- Prefer Expo SDK APIs over bare React Native APIs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: react-native
|
|
2
|
+
description: React Native / Expo project starter
|
|
3
|
+
extends: react
|
|
4
|
+
skills:
|
|
5
|
+
- repo: https://github.com/vercel-labs/agent-skills
|
|
6
|
+
skill: vercel-react-native-skills
|
|
7
|
+
- repo: https://github.com/callstackincubator/agent-skills
|
|
8
|
+
skill: react-native-best-practices
|
|
9
|
+
- repo: https://github.com/callstackincubator/agent-skills
|
|
10
|
+
skill: upgrading-react-native
|
|
11
|
+
- repo: https://github.com/expo/skills
|
|
12
|
+
skill: upgrading-expo
|
|
13
|
+
- repo: https://github.com/conorluddy/ios-simulator-skill
|
|
14
|
+
skill: ios-simulator-skill
|
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moskala/oneagent-templates",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Built-in templates for oneagent",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"module": "./
|
|
8
|
-
"main": "./
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
9
|
"exports": {
|
|
10
|
-
".":
|
|
10
|
+
".": {
|
|
11
|
+
"bun": "./src/index.ts",
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
16
|
"files": [
|
|
13
|
-
"src"
|
|
17
|
+
"src",
|
|
18
|
+
"dist"
|
|
14
19
|
],
|
|
15
20
|
"scripts": {
|
|
21
|
+
"build": "bun ./scripts/build.ts",
|
|
16
22
|
"typecheck": "tsc --noEmit"
|
|
17
23
|
},
|
|
18
24
|
"dependencies": {
|