create-agentic-starter 0.1.19 → 0.1.20
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 +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{mkdir as
|
|
3
|
-
`);let
|
|
2
|
+
import{mkdir as G,rm as v,writeFile as I}from"fs/promises";import u from"path";import{readFile as A,writeFile as w}from"fs/promises";import M from"path";function E(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(e,r,s,a){let n=new RegExp(`${E(s)}[\\s\\S]*?${E(a)}\\n?`,"m");if(n.test(e))return e.replace(n,`${r}
|
|
3
|
+
`);let c=e.endsWith(`
|
|
4
4
|
`)?`
|
|
5
5
|
`:`
|
|
6
6
|
|
|
7
|
-
`;return`${
|
|
8
|
-
`}async function
|
|
9
|
-
`,"utf8")}}import{existsSync as
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
`;var
|
|
7
|
+
`;return`${e}${c}${r}
|
|
8
|
+
`}async function T(e,r,s,a,n){let c=M.join(e,r);try{let o=await A(c,"utf8"),h=N(o,s,a,n);await w(c,h,"utf8")}catch(o){if(o.code!=="ENOENT")throw o;await w(c,`${s}
|
|
9
|
+
`,"utf8")}}import{existsSync as b,readFileSync as P,realpathSync as j}from"fs";import i from"path";import{fileURLToPath as B}from"url";function t(e){let r=[i.dirname(j(B(import.meta.url))),process.argv[1]?i.dirname(j(process.argv[1])):null,process.argv[1]?i.dirname(i.resolve(process.argv[1])):null].filter(s=>!!s);for(let s of r){let a=i.join(s,e);if(b(a))return P(a,"utf8")}throw new Error(`Template not found: ${e}. Checked: ${r.join(", ")}`)}var x="AGENTS.md",p="<!-- from create-agentic-starter:agents:start -->",d="<!-- from create-agentic-starter:agents:end -->",D=t("./templates/meta/agents.md").trimEnd(),y=`${p}
|
|
10
|
+
${D}
|
|
11
|
+
${d}
|
|
12
|
+
`;var k={".agentic/commands/project-requirements.md":t("./templates/commands/project-requirements.md"),".agentic/commands/architecture.md":t("./templates/commands/architecture.md"),".agentic/commands/create-brd.md":t("./templates/commands/create-brd.md"),".agentic/commands/create-frd.md":t("./templates/commands/create-frd.md"),".agentic/commands/create-estimate.md":t("./templates/commands/create-estimate.md"),".agentic/commands/create-proposal.md":t("./templates/commands/create-proposal.md"),".agentic/commands/create-plan.md":t("./templates/commands/create-plan.md"),".agentic/commands/create-tasks.md":t("./templates/commands/create-tasks.md"),".agentic/commands/implementation.md":t("./templates/commands/implementation.md")};var _={".agentic/init.md":t("./templates/core/init.md"),".agentic/context.md":t("./templates/core/context.md")};var l=[".agentic"],g=[".agentic",".agentic/commands",".agentic/workspace",".agentic/workspace/project",".agentic/workspace/memory",".agentic/workspace/memory/features",".agentic/workspace/documents",".agentic/workspace/scripts",".docs",".docs/brd",".docs/frd",".docs/estimate",".docs/proposal",".docs/plan",".docs/tasks"];var $={".agentic/workspace/memory/project-state.md":t("./templates/memory/project-state.md"),".agentic/workspace/memory/decisions.md":t("./templates/memory/decisions.md"),".agentic/workspace/memory/next-actions.md":t("./templates/memory/next-actions.md"),".agentic/workspace/memory/handoff.md":t("./templates/memory/handoff.md")};var F={".agentic/workspace/scripts/README.md":t("./templates/scripts/README.md"),".agentic/workspace/scripts/_shared.js":t("./templates/scripts/_shared.js"),".agentic/workspace/scripts/generate_brd.js":t("./templates/scripts/generate_brd.js"),".agentic/workspace/scripts/generate_frd.js":t("./templates/scripts/generate_frd.js"),".agentic/workspace/scripts/generate_estimate.js":t("./templates/scripts/generate_estimate.js"),".agentic/workspace/scripts/generate_proposal.js":t("./templates/scripts/generate_proposal.js"),".agentic/workspace/scripts/generate_plan.js":t("./templates/scripts/generate_plan.js"),".agentic/workspace/scripts/generate_tasks.js":t("./templates/scripts/generate_tasks.js")};var S=()=>({..._,...k,...$,...F});var m={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",cyan:"\x1B[36m"};function f(e,r){return process.stdout.isTTY?`${r}${e}${m.reset}`:e}function R(e,r){let s=[e,...r],a=Math.max(...s.map(o=>o.length)),n=`+${"-".repeat(a+2)}+`,c=s.map(o=>`| ${o.padEnd(a)} |`);return[n,...c,n].join(`
|
|
13
|
+
`)}async function O(e){await Promise.all(l.map(r=>v(u.join(e,r),{recursive:!0,force:!0})))}async function C(e){await Promise.all(g.map(r=>G(u.join(e,r),{recursive:!0})))}async function H(e){let r=S();await Promise.all(Object.entries(r).map(([s,a])=>I(u.join(e,s),a,"utf8")))}async function K(){let e=process.cwd();await O(e),await C(e),await H(e),await T(e,x,y,p,d);let r=R(f("create-agentic-starter ready",`${m.bold}${m.green}`),[`Folder: ${e}`,`Next: ${f("@.agentic/init.md",`${m.bold}${m.cyan}`)}`]);console.log(r)}K().catch(e=>{let r=e instanceof Error?e.message:String(e),s=R(f("create-agentic-starter failed",`${m.bold}${m.red}`),[r]);console.error(s),process.exitCode=1});
|