@jjdenhertog/ai-driven-development
Version:
AI-driven development workflow with learning capabilities for Claude
1 lines • 12.2 kB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{445:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>_});var s=t(5155),i=t(2115),n=t(5695),l=t(838),c=t(7883),r=t(1241),d=t(64),o=t(4653),h=t(3330),m=t(7565),p=t(8720),u=t(1223),g=t.n(u);function v(e){let{settings:a,onSave:t,saving:n}=e,[l,c]=(0,i.useState)(a),[r,d]=(0,i.useState)(!1),[o,m]=(0,i.useState)(null);(0,i.useEffect)(()=>{c(a),d(!1)},[a]);let p=(0,i.useCallback)((e,a)=>{c(t=>({...t,[e]:a})),d(!0),m(null)},[]),u=(0,i.useCallback)(e=>{p("mainBranch",e.target.value)},[p]),v=(0,i.useCallback)(e=>{p("branchStartingPoint",e.target.value)},[p]),x=(0,i.useCallback)(e=>{p("slack_webhook_url",e.target.value)},[p]),k=(0,i.useCallback)(e=>{p("enforce_opus",e.target.checked)},[p]),b=(0,i.useCallback)(e=>{p("sequential",e.target.checked)},[p]),f=(0,i.useCallback)(e=>{p("automatic_merging",e.target.checked)},[p]),j=(0,i.useCallback)(e=>{if(e.preventDefault(),m(null),l.slack_webhook_url&&""!==l.slack_webhook_url.trim())try{new URL(l.slack_webhook_url)}catch(e){m("Please enter a valid URL for the Slack webhook");return}t(l).then(()=>{d(!1)}).catch(()=>{m("Failed to save settings")})},[l,t]);return(0,s.jsxs)("form",{onSubmit:j,className:g().form,children:[(0,s.jsxs)("div",{className:g().formGroup,children:[(0,s.jsx)("label",{htmlFor:"mainBranch",children:"Main Branch"}),(0,s.jsx)("input",{id:"mainBranch",type:"text",value:l.mainBranch,onChange:u,placeholder:"main"}),(0,s.jsx)("span",{className:g().description,children:"Used by the learning AI to track which features have been merged and what users have changed in AI-generated code"})]}),(0,s.jsxs)("div",{className:g().formGroup,children:[(0,s.jsx)("label",{htmlFor:"branchStartingPoint",children:"Branch Starting Point"}),(0,s.jsx)("input",{id:"branchStartingPoint",type:"text",value:l.branchStartingPoint,onChange:v,placeholder:"main"}),(0,s.jsx)("span",{className:g().description,children:"When an AI works on a task it will create a feature branch. The starting point of any new feature is from this branch"})]}),(0,s.jsxs)("div",{className:g().formGroup,children:[(0,s.jsx)("label",{htmlFor:"slackWebhook",children:"Slack Webhook"}),(0,s.jsx)("input",{id:"slackWebhook",type:"text",value:l.slack_webhook_url,onChange:x,placeholder:"https://hooks.slack.com/services/..."}),(0,s.jsx)("span",{className:g().description,children:"Add your Slack Webhook URL here to get notifications when tasks are picked up or completed"})]}),(0,s.jsx)("div",{className:g().formGroup,children:(0,s.jsxs)("div",{className:g().switchGroup,children:[(0,s.jsxs)("div",{className:g().switchHeader,children:[(0,s.jsxs)("label",{className:g().switch,children:[(0,s.jsx)("input",{id:"enforceOpus",type:"checkbox",checked:l.enforce_opus||!1,onChange:k}),(0,s.jsx)("span",{className:g().slider})]}),(0,s.jsx)("label",{htmlFor:"enforceOpus",children:"Enforce Opus Model"})]}),(0,s.jsx)("span",{className:g().description,children:"When enabled, it will always only use the Opus model when running the AI commands"})]})}),(0,s.jsx)("div",{className:g().formGroup,children:(0,s.jsxs)("div",{className:g().switchGroup,children:[(0,s.jsxs)("div",{className:g().switchHeader,children:[(0,s.jsxs)("label",{className:g().switch,children:[(0,s.jsx)("input",{id:"sequential",type:"checkbox",checked:l.sequential||!1,onChange:b}),(0,s.jsx)("span",{className:g().slider})]}),(0,s.jsx)("label",{htmlFor:"sequential",children:"Sequential"})]}),(0,s.jsx)("span",{className:g().description,children:"This does each tasks in a sequential mode. Which means that it will wait for the last completed task to be analysed and merged with the main branch. Only when that is the case a new task will be picked up."})]})}),(0,s.jsx)("div",{className:g().formGroup,children:(0,s.jsxs)("div",{className:g().switchGroup,children:[(0,s.jsxs)("div",{className:g().switchHeader,children:[(0,s.jsxs)("label",{className:g().switch,children:[(0,s.jsx)("input",{id:"automaticMerging",type:"checkbox",checked:l.automatic_merging||!1,onChange:f}),(0,s.jsx)("span",{className:g().slider})]}),(0,s.jsx)("label",{htmlFor:"automaticMerging",children:"Automatic Merging (Dangerous)"})]}),(0,s.jsx)("span",{className:g().description,children:"This mode will automatically merge any created feature branch with the main branch. This mode is not recommended. The best way to work with the tooling is to manually verify each feature branch and merging it with the main."})]})}),!!o&&(0,s.jsx)("div",{className:g().error,children:o}),(0,s.jsxs)("div",{className:g().footer,children:[(0,s.jsx)("div",{className:g().status,children:!!r&&(0,s.jsx)("span",{className:g().unsaved,children:"• Unsaved changes"})}),(0,s.jsx)(h.$,{type:"submit",variant:"primary",disabled:n||!r,children:n?"Saving...":"Save Settings"})]})]})}var x=t(3660),k=t.n(x),b=t(5729);let f={"aidev-plan-phase0-analyze.md":{title:"Phase 0: Analyze",description:"Analyze project requirements and existing codebase"},"aidev-plan-phase1-architect.md":{title:"Phase 1: Architect",description:"Design technical architecture and patterns"},"aidev-plan-phase2-generate.md":{title:"Phase 2: Generate",description:"Generate task specifications from architecture"},"aidev-plan-phase3-validate.md":{title:"Phase 3: Validate",description:"Validate and refine task specifications"},"aidev-code-phase0.md":{title:"Phase 0: Inventory",description:"Identify reusable components and patterns"},"aidev-code-phase1.md":{title:"Phase 1: Architect",description:"Design implementation approach and structure"},"aidev-code-phase2.md":{title:"Phase 2: Test designer",description:"Design comprehensive test coverage"},"aidev-code-phase3.md":{title:"Phase 3: Programmer",description:"Write code following the architecture"},"aidev-code-phase4a.md":{title:"Phase 4A: Test executer",description:"Execute tests and fix failures"},"aidev-code-phase4b.md":{title:"Phase 4B: Test fixer",description:"Fix failing tests and resolve issues"},"aidev-code-phase5.md":{title:"Phase 5: Reviewer",description:"Review code and ensure quality"},"aidev-instruction-task.md":{title:"Instruction Task",description:"Execute specific coding instructions"},"aidev-learn.md":{title:"Learn",description:"Extract patterns and learnings from codebase"},"aidev-index.md":{title:"Index",description:"Create initial codebase index"},"aidev-update-index.md":{title:"Update Index",description:"Update existing codebase index with changes"},"task-specification-template.md":{title:"Task Specification Template",description:"Template for creating detailed task specifications"},"task-creation.md":{title:"Task Creation Guide",description:"Guidelines for creating effective tasks"},"automated-prp-template.md":{title:"Automated PRP Template",description:"Problem-Resolution-Plan template for structured implementation"}};function j(){let e=(0,n.useRouter)(),a=(0,n.useSearchParams)(),t=a.get("tab")||"plan",u=a.get("file"),{enqueueSnackbar:g}=(0,b.dh)(),[x,j]=(0,i.useState)(""),[_,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),{data:N}=(0,l.Ay)("prompts",r.FH.getPrompts),{data:y}=(0,l.Ay)("templates",r.FH.getTemplates),{data:F,error:P,mutate:H}=(0,l.Ay)("settings",()=>r.FH.getSettings()),A=(0,i.useCallback)(async(e,a)=>{try{let t;j(""),t="plan"===a||"code"===a||"learn"===a||"index"===a?await r.FH.getPrompt(e):await r.FH.getTemplate(e),j(t.content),C(!1)}catch(e){j("Failed to load content")}},[]);(0,i.useEffect)(()=>{u&&t&&"settings"!==t&&A(u,t)},[u,t,A]);let G=(0,i.useCallback)(a=>{e.push("/settings?tab=".concat(a))},[e]),T=(0,i.useCallback)(a=>{e.push("/settings?tab=".concat(t,"&file=").concat(encodeURIComponent(a)))},[e,t]),I=(0,i.useCallback)(e=>{j(e),C(!0)},[]),E=(0,i.useCallback)(async()=>{if(u){w(!0);try{"plan"===t||"code"===t||"learn"===t||"index"===t?await r.FH.updatePrompt(u,x):await r.FH.updateTemplate(u,x),C(!1),g("".concat(t.charAt(0).toUpperCase()+t.slice(1)," saved successfully"),{variant:"success"})}catch(e){g("Failed to save ".concat(t),{variant:"error"})}finally{w(!1)}}},[u,t,x,g]),W=(0,i.useCallback)(async e=>{try{await r.FH.updateSettings(e),await H(e,!1),g("Settings saved successfully",{variant:"success"})}catch(e){throw g("Failed to save settings",{variant:"error"}),e}},[H,g]),D=(0,i.useCallback)(()=>{G("plan")},[G]),B=(0,i.useCallback)(()=>{G("code")},[G]),L=(0,i.useCallback)(()=>{G("learn")},[G]),R=(0,i.useCallback)(()=>{G("index")},[G]),U=(0,i.useCallback)(()=>{G("settings")},[G]),q=(0,i.useCallback)(e=>()=>T(e),[T]),M=(0,i.useCallback)(()=>{E().catch(()=>{})},[E]),O=e=>{let a=f[e.name];return{...e,title:(null==a?void 0:a.title)||e.name,description:(null==a?void 0:a.description)||e.description||""}},z="plan"===t?[...(null==N?void 0:N.filter(e=>e.name.startsWith("aidev-plan-phase")))||[],...(null==y?void 0:y.filter(e=>"task-specification-template.md"===e.name||"task-creation.md"===e.name))||[]].map(O):"code"===t?[...(null==N?void 0:N.filter(e=>e.name.startsWith("aidev-code-phase")||"aidev-instruction-task.md"===e.name))||[],...(null==y?void 0:y.filter(e=>"automated-prp-template.md"===e.name))||[]].map(O):"learn"===t?((null==N?void 0:N.filter(e=>"aidev-learn.md"===e.name))||[]).map(O):"index"===t?((null==N?void 0:N.filter(e=>"aidev-index.md"===e.name||"aidev-update-index.md"===e.name))||[]).map(O):[],V=(0,s.jsxs)(m.a,{children:[(0,s.jsx)(m.o,{onClick:D,active:"plan"===t,children:"Plan"}),(0,s.jsx)(m.o,{onClick:B,active:"code"===t,children:"Code"}),(0,s.jsx)(m.o,{onClick:L,active:"learn"===t,children:"Learn"}),(0,s.jsx)(m.o,{onClick:R,active:"index"===t,children:"Index"}),(0,s.jsx)(m.o,{onClick:U,active:"settings"===t,children:"Settings"})]}),K=(0,s.jsx)(s.Fragment,{children:"settings"===t?(0,s.jsx)("div",{className:k().placeholder,children:(0,s.jsx)("p",{children:"Application Settings"})}):(0,s.jsx)("div",{className:k().fileList,children:z.map(e=>(0,s.jsx)(p.H,{icon:c.A4h,title:e.title,description:e.description,selected:u===e.name,onClick:q(e.name)},e.name))})});return(0,s.jsx)(o.M,{title:"Settings",subtitle:"You can find all the settings used by AI Driven Development here. This allows you to customize how Claude Code is used or tweak the prompts so it matches your needs.",variant:"sidebar",sidebarHeader:V,sidebarContent:K,children:"settings"===t?(0,s.jsx)(s.Fragment,{children:P?(0,s.jsx)("div",{className:k().placeholder,children:(0,s.jsx)("p",{children:"Failed to load settings. Please ensure settings.json exists in .aidev-storage"})}):F?(0,s.jsx)(v,{settings:F,onSave:W,saving:_}):(0,s.jsx)("div",{className:k().placeholder,children:(0,s.jsx)("p",{children:"Loading settings..."})})}):u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:k().header,children:[(0,s.jsxs)("div",{className:k().headerInfo,children:[(0,s.jsx)("h2",{children:u}),S?(0,s.jsx)("span",{className:k().unsaved,children:"• Unsaved changes"}):null]}),(0,s.jsx)(h.$,{onClick:M,disabled:_||!S,variant:"primary",size:"medium",children:_?"Saving...":"Save"})]}),(0,s.jsx)("div",{className:k().editor,children:(0,s.jsx)(d.B,{value:x,onChange:I,language:u.endsWith(".json")?"json":"markdown",height:"100%"})})]}):(0,s.jsx)("div",{className:k().placeholder,style:{background:"none"},children:(0,s.jsx)("p",{children:"Select a file to edit"})})})}function _(){return(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)("div",{className:k().loading,children:"Loading..."}),children:(0,s.jsx)(j,{})})}},1223:e=>{e.exports={form:"SettingsForm_form__wNg6E",formGroup:"SettingsForm_formGroup__1PbVt",description:"SettingsForm_description__ppRE7",switchGroup:"SettingsForm_switchGroup__QNrHD",switchHeader:"SettingsForm_switchHeader__WjgC0",switch:"SettingsForm_switch__b4sE5",slider:"SettingsForm_slider__fhtD3",error:"SettingsForm_error__KDKNB",footer:"SettingsForm_footer__bHZId",status:"SettingsForm_status__BqoIG",unsaved:"SettingsForm_unsaved__p3D0Z"}},3660:e=>{e.exports={fileList:"SettingsSection_fileList__74JVN",headerInfo:"SettingsSection_headerInfo__G2cJ7",unsaved:"SettingsSection_unsaved__g_vV1",editor:"SettingsSection_editor__HeKvz",placeholder:"SettingsSection_placeholder__MHotH"}},9181:(e,a,t)=>{Promise.resolve().then(t.bind(t,445))}},e=>{e.O(0,[2403,6750,1919,838,5729,6874,3044,2112,8441,5964,7358],()=>e(e.s=9181)),_N_E=e.O()}]);