@moskala/oneagent-templates 0.4.1 → 0.4.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.
@@ -0,0 +1,9 @@
1
+ import { type TemplatePlugin, type TemplateDefinition } from "@moskala/oneagent-core";
2
+ export type { TemplatePlugin, TemplateDefinition };
3
+ export declare function resolveBuiltinTemplate(name: string): Promise<TemplateDefinition | null>;
4
+ export declare const BUILTIN_TEMPLATE_NAMES: readonly string[];
5
+ export interface BuiltinTemplateMeta {
6
+ name: string;
7
+ description: string;
8
+ }
9
+ export declare const BUILTIN_TEMPLATE_META: BuiltinTemplateMeta[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moskala/oneagent-templates",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Built-in templates for oneagent",
6
6
  "license": "MIT",
@@ -9,12 +9,11 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "bun": "./src/index.ts",
12
- "types": "./src/index.ts",
12
+ "types": "./dist/index.d.ts",
13
13
  "default": "./dist/index.js"
14
14
  }
15
15
  },
16
16
  "files": [
17
- "src",
18
17
  "dist"
19
18
  ],
20
19
  "scripts": {
package/src/index.ts DELETED
@@ -1,60 +0,0 @@
1
- import path from "path";
2
- import fs from "fs/promises";
3
- import { fileURLToPath } from "url";
4
- import { type TemplatePlugin, type TemplateDefinition, parseTemplateYaml, resolveExtends } from "@moskala/oneagent-core";
5
-
6
- export type { TemplatePlugin, TemplateDefinition };
7
-
8
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
-
10
- type BuiltinTemplateName = "default" | "react" | "react-native";
11
-
12
- const TEMPLATE_NAMES: BuiltinTemplateName[] = ["default", "react", "react-native"];
13
-
14
- async function loadTemplate(name: BuiltinTemplateName): Promise<TemplateDefinition> {
15
- const templateDir = path.join(__dirname, "templates", name);
16
-
17
- const [yamlText, instructions] = await Promise.all([
18
- fs.readFile(path.join(templateDir, "template.yml"), "utf-8"),
19
- fs.readFile(path.join(templateDir, "instructions.md"), "utf-8"),
20
- ]);
21
-
22
- const parsed = parseTemplateYaml(yamlText, name);
23
-
24
- const rulesDir = path.join(templateDir, "rules");
25
- let rules: Array<{ name: string; content: string }> = [];
26
- try {
27
- const ruleFiles = await fs.readdir(rulesDir);
28
- rules = await Promise.all(
29
- ruleFiles
30
- .filter((f) => f.endsWith(".md"))
31
- .map(async (f) => ({
32
- name: path.basename(f, ".md"),
33
- content: await fs.readFile(path.join(rulesDir, f), "utf-8"),
34
- })),
35
- );
36
- } catch {
37
- // No rules directory — fine
38
- }
39
-
40
- const base = { ...parsed, instructions, rules };
41
- return resolveExtends(base, (n) => resolveBuiltinTemplate(n));
42
- }
43
-
44
- export async function resolveBuiltinTemplate(name: string): Promise<TemplateDefinition | null> {
45
- if (!TEMPLATE_NAMES.includes(name as BuiltinTemplateName)) return null;
46
- return loadTemplate(name as BuiltinTemplateName);
47
- }
48
-
49
- export const BUILTIN_TEMPLATE_NAMES: readonly string[] = TEMPLATE_NAMES;
50
-
51
- export interface BuiltinTemplateMeta {
52
- name: string;
53
- description: string;
54
- }
55
-
56
- export const BUILTIN_TEMPLATE_META: BuiltinTemplateMeta[] = [
57
- { name: "default", description: "General programming starter" },
58
- { name: "react", description: "React / Next.js project starter" },
59
- { name: "react-native", description: "React Native / Expo project starter" },
60
- ];
@@ -1,3 +0,0 @@
1
- # Project Instructions
2
-
3
- Add your AI instructions here.
@@ -1,36 +0,0 @@
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
@@ -1,15 +0,0 @@
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
@@ -1,23 +0,0 @@
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
@@ -1,15 +0,0 @@
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
@@ -1,14 +0,0 @@
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