specpilot 2.2.4 → 2.3.0

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/ui/app.js ADDED
@@ -0,0 +1,340 @@
1
+ /* SpecPilot Local, read-only (BL-051). Ported from the approved mockup; every string a view
2
+ shows about the project comes from GET /api/specs (readSpecs() output) or GET /api/file
3
+ (the file itself). Views may group and order; they never reword. */
4
+ (function(){
5
+ const $=(s,r=document)=>r.querySelector(s), $$=(s,r=document)=>[...r.querySelectorAll(s)];
6
+ const toastEl=$('#toast');let toastT;
7
+ const toast=m=>{toastEl.textContent=m;toastEl.classList.add('show');clearTimeout(toastT);toastT=setTimeout(()=>toastEl.classList.remove('show'),2600);};
8
+ const chev='<svg class="ico chev" aria-hidden="true" focusable="false"><use href="#i-chev"/></svg>';
9
+
10
+ /* theme: dark by default, light is a per-viewer toggle */
11
+ let theme=null;try{theme=localStorage.getItem('sp-theme');}catch(e){}
12
+ function setMeta(light){const m=document.querySelector('meta[name=theme-color]');if(m)m.content=light?'#f8fafc':'#0f172a';}
13
+ if(theme==='light'){document.documentElement.setAttribute('data-theme','light');setMeta(true);}
14
+ $('#themeBtn').onclick=()=>{const light=document.documentElement.getAttribute('data-theme')==='light';if(light)document.documentElement.removeAttribute('data-theme');else document.documentElement.setAttribute('data-theme','light');setMeta(!light);try{light?localStorage.removeItem('sp-theme'):localStorage.setItem('sp-theme','light');}catch(e){}toast('Appearance: '+(light?'dark':'light'));};
15
+
16
+ /* ---------------- data: fetched, never embedded ---------------- */
17
+ let DATA=null;
18
+ const fileCache={};
19
+ async function getText(p){
20
+ if(p in fileCache)return fileCache[p];
21
+ const r=await fetch('/api/file?p='+encodeURIComponent(p),{cache:'no-store'});
22
+ if(!r.ok)throw Object.assign(new Error(p+': HTTP '+r.status),{status:r.status});
23
+ return fileCache[p]=await r.text();
24
+ }
25
+ function showErr(msg){const e=$('#loadErr');e.textContent=msg;e.hidden=false;}
26
+
27
+ /* ---------------- project: only the one being served ---------------- */
28
+ function initials(n){const w=String(n).split(/[^A-Za-z0-9]+/).filter(Boolean);
29
+ if(!w.length)return '??';
30
+ if(w.length>1)return (w[0][0]+w[1][0]).toUpperCase();
31
+ return w[0].slice(0,2).toUpperCase();}
32
+ function renderProject(){
33
+ const p=DATA.project, name=p.name!==null?p.name:p.root, where=p.root+(p.branch?' · '+p.branch:'');
34
+ $('#projList').innerHTML=`<button class="tile blue cur" data-tip="${esc(name)}" data-path="${esc(where)}" aria-label="${esc(name)}" aria-current="true"><span aria-hidden="true">${esc(initials(name))}</span></button>`;
35
+ $('#curGrp').textContent=name;$('#curGrp').title=p.root;
36
+ $('#curBranch').textContent=p.branch||'';
37
+ $('#subName').textContent=name;$('#subPath').textContent=where;
38
+ $('#footAddr').textContent=location.host;$('#footVer').textContent='v'+p.specpilotVersion;
39
+ document.title=name+' · SpecPilot Local';
40
+ }
41
+
42
+ /* ---------------- views ---------------- */
43
+ const VIEWS={board:'Tasks',explorer:'Explorer',security:'Security',instructions:'Instructions',commands:'Commands',skills:'Skills'};
44
+ const TITLES={'planning/roadmap.md':'Roadmap','project/requirements.md':'Requirements','architecture/architecture.md':'Architecture','quality/tests.md':'Tests'};
45
+ const NAV=[['board'],['file','planning/roadmap.md'],['file','project/requirements.md'],['explorer'],['file','architecture/architecture.md'],['file','quality/tests.md'],['security'],['instructions'],['commands'],['skills']];
46
+ let curView='board',curFile='';
47
+ function syncNav(){
48
+ $$('.src .srow').forEach(b=>{
49
+ const on=b.dataset.v==='file'?(curView==='file'&&b.dataset.f===curFile):(b.dataset.v===curView);
50
+ b.classList.toggle('on',on);b.setAttribute('aria-current',on?'page':'false');});
51
+ }
52
+ function go(v,keep,sub){
53
+ if(v==='file'){if(!DATA||!sub)v='board';else curFile=sub;}
54
+ else if(!VIEWS[v])v='board';
55
+ curView=v;
56
+ $$('.content>.view').forEach(e=>e.classList.toggle('on',e.id==='v-'+v));
57
+ syncNav();
58
+ $('#title').textContent=v==='file'?(TITLES[sub]||sub):VIEWS[v];
59
+ $('#modeSeg').hidden=v!=='board';
60
+ setNav(false);closeInsp();
61
+ if(v==='file')renderFile(sub);
62
+ if(v==='explorer')renderExplorer();
63
+ if(v==='security')renderSecurity();
64
+ setHash(v,v==='file'?sub:(keep?stateFor(v):null));
65
+ $('#content').scrollTop=0;
66
+ }
67
+ function stateFor(v){return v==='board'?(mode==='board'?'board':null):null}
68
+ /* URL state. Sandboxed frames refuse replaceState with a URL, so fall back to an in-memory hash. */
69
+ let urlOk=true,memHash='';
70
+ try{history.replaceState(null,'',location.href);}catch(e){urlOk=false;}
71
+ try{memHash=location.hash;}catch(e){memHash='';}
72
+ function curHash(){if(!urlOk)return memHash;try{return location.hash;}catch(e){return memHash;}}
73
+ function setHash(v,sub){const h='#'+v+(sub?'/'+sub:'');if(curHash()===h)return;memHash=h;
74
+ if(!urlOk)return;
75
+ try{history.replaceState(null,'',h);}catch(e){urlOk=false;}}
76
+ function route(){
77
+ const r=resolveRoute(curHash(),DATA?DATA.files:{});
78
+ if(r.view==='board'&&r.sub==='board'){mode='board';$$('#modeSeg button').forEach(x=>x.classList.toggle('on',x.dataset.m==='board'));renderTasks();}
79
+ go(r.view,true,r.sub);
80
+ }
81
+ if(urlOk)window.addEventListener('hashchange',route);
82
+ $$('.src .srow[data-v]').forEach(b=>b.onclick=()=>go(b.dataset.v,false,b.dataset.f));
83
+ function setNav(on){const w=$('#win');w.classList.toggle('nav',on);$('#scrim').hidden=!on;$('#menuBtn').setAttribute('aria-expanded',on?'true':'false');}
84
+ $('#menuBtn').onclick=()=>setNav(!$('#win').classList.contains('nav'));
85
+ $('#scrim').onclick=()=>setNav(false);
86
+
87
+ /* ---------------- rail tooltips + rail keys ---------------- */
88
+ let tipEl=null,tipFor=null;
89
+ function tipNode(){if(!tipEl){tipEl=document.createElement('div');tipEl.className='tip';tipEl.setAttribute('role','presentation');document.body.appendChild(tipEl);}return tipEl;}
90
+ function showTip(el){
91
+ if(window.matchMedia('(max-width:900px)').matches)return;
92
+ const label=el.dataset.tip;if(!label)return;
93
+ const t=tipNode();tipFor=el;
94
+ t.innerHTML=esc(label)+(el.dataset.path?`<span class="p">${esc(el.dataset.path)}</span>`:'');
95
+ t.classList.remove('on');t.style.left='-9999px';t.style.top='0px';
96
+ const r=el.getBoundingClientRect(),b=t.getBoundingClientRect();
97
+ let top=Math.round(r.top+r.height/2-b.height/2);
98
+ top=Math.max(8,Math.min(top,window.innerHeight-b.height-8));
99
+ const rail=$('#rail').getBoundingClientRect();
100
+ t.style.left=Math.round(Math.max(r.right,rail.right)+9)+'px';t.style.top=top+'px';
101
+ requestAnimationFrame(()=>t.classList.add('on'));
102
+ }
103
+ function hideTip(){if(tipEl){tipEl.classList.remove('on');tipEl.style.left='-9999px';}tipFor=null;}
104
+ document.addEventListener('mouseover',e=>{const el=e.target.closest&&e.target.closest('#rail [data-tip]');if(el&&el!==tipFor)showTip(el);else if(!el&&tipFor)hideTip();});
105
+ document.addEventListener('focusin',e=>{const el=e.target.closest&&e.target.closest('#rail [data-tip]');el?showTip(el):hideTip();});
106
+ document.addEventListener('focusout',e=>{if(e.target.closest&&e.target.closest('#rail [data-tip]'))hideTip();});
107
+ window.addEventListener('scroll',hideTip,true);window.addEventListener('resize',hideTip);
108
+ $('#rail').addEventListener('keydown',e=>{
109
+ if(e.key!=='ArrowDown'&&e.key!=='ArrowUp'&&e.key!=='Home'&&e.key!=='End')return;
110
+ const tiles=$$('#rail .tile');const i=tiles.indexOf(document.activeElement);if(i<0)return;
111
+ e.preventDefault();
112
+ const n=e.key==='Home'?0:e.key==='End'?tiles.length-1:(i+(e.key==='ArrowDown'?1:-1)+tiles.length)%tiles.length;
113
+ tiles[n].focus();
114
+ });
115
+
116
+ /* ---------------- tasks: the rows of planning/tasks.md ---------------- */
117
+ /* Cells are readSpecs() output, verbatim. Rows are keyed by section and position, never by
118
+ ID: IDs repeat in real files (two rows can share a # and an ID). */
119
+ let mode='list', selected=null, lastFocus=null, showAllBacklog=false, showAllDone=false;
120
+ const insp=$('#insp');
121
+ const COLS={currentSprint:'Current Sprint',backlog:'Backlog',completed:'Completed'};
122
+ const DOT={completed:'green',currentSprint:'orange',backlog:'hollow'};
123
+ function mdi(t){return md(String(t)).replace(/^<p>/,'').replace(/<\/p>$/,'');}
124
+ /* Completed is listed newest first (the file runs oldest first); the others in file order. */
125
+ function rowsOf(col){
126
+ const T=DATA.tasks;if(!T)return [];
127
+ const items=T[col].map((t,i)=>({t,i}));
128
+ return col==='completed'?items.reverse():items;
129
+ }
130
+ function taskRow({t,i},col){
131
+ return `<button type="button" class="row act" data-col="${col}" data-i="${i}">
132
+ <span class="st ${DOT[col]}" aria-hidden="true"></span>
133
+ <div class="body"><div class="ttl clamp">${col==='completed'?`<span class="num" translate="no">${esc(t.num)}</span>`:''}<span class="id" translate="no">${mdi(t.id)}</span>${mdi(t.description)}</div></div>
134
+ <div class="trail">${chev}</div>
135
+ </button>`;
136
+ }
137
+ function group(col,items,opt){
138
+ opt=opt||{};
139
+ const shown=opt.limit&&!opt.all?items.slice(0,opt.limit):items;
140
+ const more=opt.limit&&!opt.all&&items.length>opt.limit?`<button type="button" class="more" data-more="${col}">Show All ${items.length}</button>`:'';
141
+ const gh=opt.disc
142
+ ?`<div class="gh"><button type="button" class="disc" data-disc="${col}" aria-expanded="${!opt.closed}" aria-label="Toggle ${esc(COLS[col])}"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-chev"/></svg></button>${esc(COLS[col])} <span class="cnt">${items.length}</span>${more}</div>`
143
+ :`<div class="gh">${esc(COLS[col])} <span class="cnt">${items.length}</span>${more}</div>`;
144
+ return gh+`<div class="box">${shown.length?shown.map(x=>taskRow(x,col)).join(''):'<div class="empty">No rows in this section.</div>'}</div>`;
145
+ }
146
+ function renderTasks(){
147
+ const S=rowsOf('currentSprint'),B=rowsOf('backlog'),D=rowsOf('completed');
148
+ $('#gSprint').innerHTML=group('currentSprint',S,{});
149
+ $('#gBacklog').innerHTML=group('backlog',B,{limit:6,all:showAllBacklog});
150
+ $('#gDone').innerHTML=group('completed',D,{disc:true,closed:$('#gDone').classList.contains('closed'),limit:8,all:showAllDone});
151
+ $('#boardMode').innerHTML=[['currentSprint',S,{}],['backlog',B,{}],['completed',D,{limit:8,all:showAllDone}]].map(([c,items,o])=>`<div class="gl" data-col="${c}">${group(c,items,o)}</div>`).join('');
152
+ $('#listMode').hidden=mode!=='list';$('#boardMode').hidden=mode!=='board';
153
+ const T=DATA.tasks;
154
+ const bad=T?T.malformed:[];
155
+ $('#gRaw').hidden=!bad.length;
156
+ $('#gRaw').innerHTML=bad.length?`<div class="gh">Rows that could not be parsed <span class="cnt">${bad.length}</span></div><div class="box">${bad.map(l=>`<pre class="raw" translate="no">${esc(l)}</pre>`).join('')}</div>`:'';
157
+ $('#gConv').innerHTML=T&&T.intro.trim()?`<div class="gh"><span translate="no">planning/tasks.md</span></div><div class="box"><div class="desc md">${md(T.intro)}</div></div>`:
158
+ (T?'':'<div class="box"><div class="empty">No <span class="mono" translate="no">planning/tasks.md</span> in <span class="mono" translate="no">.specs/</span>.</div></div>');
159
+ bind();
160
+ }
161
+ let inspOpen=null; // {kind:'task',col,i,id} | {kind:'file',path} | null
162
+ function openTask(col,i,quiet){
163
+ const t=DATA.tasks[col][i];if(!t)return;
164
+ if(!quiet)lastFocus=document.activeElement;
165
+ selected=col+':'+i;inspOpen={kind:'task',col,i,id:t.id};
166
+ $$('.row.sel').forEach(r=>r.classList.remove('sel'));
167
+ $$(`#v-board .row[data-col="${col}"][data-i="${i}"]`).forEach(r=>r.classList.add('sel'));
168
+ insp.innerHTML=`<div class="ih">${col==='completed'?`<span class="id" translate="no">${esc(t.num)}</span>`:''}<span class="id" translate="no">${mdi(t.id)}</span><span class="pill ${col==='completed'?'green':col==='currentSprint'?'orange':'gray'}">${esc(COLS[col])}</span><button type="button" class="ib x" id="inspX" aria-label="Close Details"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-x"/></svg></button></div>
169
+ <div class="ib2">
170
+ <div class="gl"><div class="gh">Description <span class="cnt" translate="no">tasks.md · ## ${esc(COLS[col])}</span></div><div class="box"><div class="desc md">${md(t.description)}</div></div></div>
171
+ </div>`;
172
+ openInsp(quiet);
173
+ }
174
+ function openInsp(quiet){insp.classList.add('open');insp.setAttribute('aria-hidden','false');$('#inspX').onclick=closeInsp;if(!quiet)setTimeout(()=>$('#inspX').focus(),60);}
175
+ function closeInsp(){const was=insp.classList.contains('open');insp.classList.remove('open');insp.setAttribute('aria-hidden','true');selected=null;inspOpen=null;$$('.row.sel').forEach(r=>r.classList.remove('sel'));if(was&&lastFocus&&lastFocus.focus){lastFocus.focus();lastFocus=null;}}
176
+ function bind(){
177
+ $$('#v-board .row[data-col]').forEach(r=>r.onclick=()=>openTask(r.dataset.col,+r.dataset.i));
178
+ $$('[data-more]').forEach(b=>b.onclick=e=>{e.stopPropagation();if(b.dataset.more==='completed')showAllDone=true;else showAllBacklog=true;renderTasks();});
179
+ $$('[data-disc]').forEach(b=>b.onclick=e=>{e.stopPropagation();const g=$('#gDone');g.classList.toggle('closed');b.setAttribute('aria-expanded',!g.classList.contains('closed'));});
180
+ }
181
+ $$('#modeSeg button').forEach(b=>b.onclick=()=>{mode=b.dataset.m;$$('#modeSeg button').forEach(x=>x.classList.toggle('on',x===b));renderTasks();setHash('board',stateFor('board'));});
182
+
183
+ /* ---------------- any .specs/ file, rendered as written ---------------- */
184
+ function metaLine(m){return ['fileID','version','lastUpdated'].filter(k=>m&&m[k]!==undefined).map(k=>`${k}: ${m[k]}`).join(' · ');}
185
+ async function renderFile(path){
186
+ let src=null;
187
+ if(path in DATA.files)try{src=await getText('.specs/'+path);}catch(e){if(e.status!==404){if(curView==='file'&&curFile===path){$('#fmBox').innerHTML='';$('#fileBody').innerHTML=`<p class="note">${esc(e.message)}</p>`;}return;}}
188
+ if(curView!=='file'||curFile!==path)return;
189
+ if(src===null){$('#fmBox').innerHTML='';$('#fileBody').innerHTML=gone('.specs/'+path);return;}
190
+ const isYaml=/\.ya?ml$/.test(path);
191
+ const {fm,body}=isYaml?{fm:'',body:src}:splitFm(src);
192
+ $('#fmBox').innerHTML=fm?`<div class="gh">Front matter <span class="cnt" translate="no">.specs/${esc(path)}</span></div><div class="box"><pre class="raw" translate="no">${esc(fm)}</pre></div>`:'';
193
+ $('#fileBody').innerHTML=isYaml?`<pre translate="no">${esc(src)}</pre>`:md(body);
194
+ }
195
+ const gone=goneHtml; // one definition of the "no longer exists" markup: ui/route.js
196
+
197
+ /* Explorer: the .specs/ tree, each row carrying that file's own front matter. */
198
+ function renderExplorer(){
199
+ const dirs={};
200
+ DATA.nav.specs.forEach(p=>{const ix=p.indexOf('/'),d=ix<0?'':p.slice(0,ix);(dirs[d]=dirs[d]||[]).push(p);});
201
+ $('#exBody').innerHTML=Object.keys(dirs).map(d=>`<div class="gl mb18"><div class="gh" translate="no">${esc(d?d+'/':'.specs/')}</div><div class="box">${dirs[d].map(p=>{
202
+ const line=metaLine(DATA.files[p]);
203
+ return `<button type="button" class="row act" data-file="${esc(p)}"><span class="st hollow" aria-hidden="true"></span><div class="body"><div class="ttl" translate="no">${esc(d?p.slice(d.length+1):p)}</div>${line?`<div class="det" translate="no">${esc(line)}</div>`:''}</div><div class="trail">${chev}</div></button>`;}).join('')}</div></div>`).join('');
204
+ $$('#exBody .row.act').forEach(b=>b.onclick=()=>go('file',false,b.dataset.file));
205
+ $('#exNote').innerHTML=`${DATA.nav.specs.length} files under <span class="mono" translate="no">.specs/</span>. Every ID, version and date is that file’s own front matter.`;
206
+ }
207
+ /* Security: both files in security/, each rendered as written. */
208
+ const secShown=new Set(); // security files this page has shown, so a deletion can be named
209
+ async function renderSecurity(){
210
+ const paths=['security/threat-model.md','security/security-decisions.md'].filter(p=>p in DATA.files||secShown.has(p));
211
+ const parts=await Promise.all(paths.map(p=>!(p in DATA.files)?Promise.resolve(gone('.specs/'+p)):getText('.specs/'+p).then(src=>(secShown.add(p),
212
+ `<div class="gl"><div class="gh" translate="no">${esc(p)} <span class="cnt" translate="no">${esc(metaLine(DATA.files[p]))}</span></div></div><div class="md doc doc-gap">${md(splitFm(src).body)}</div>`),
213
+ e=>`<p class="note">${esc(e.message)}</p>`)));
214
+ if(curView==='security')$('#secBody').innerHTML=parts.join('')||'<div class="box"><div class="empty">No files in <span class="mono" translate="no">.specs/security/</span>.</div></div>';
215
+ }
216
+
217
+ /* ---------------- automation: generated files, read as they are ---------------- */
218
+ function renderIde(){
219
+ const I=DATA.nav.instructions;
220
+ $('#insBox').innerHTML=I.map(f=>f.exists
221
+ ?`<button type="button" class="row act" data-open="${esc(f.path)}"><span class="st green" aria-hidden="true"></span><div class="body"><div class="ttl"><span class="id" translate="no">${esc(f.path)}</span></div><div class="det">${f.bytes} bytes</div></div><div class="trail">${chev}</div></button>`
222
+ :`<div class="row"><span class="st hollow" aria-hidden="true"></span><div class="body"><div class="ttl"><span class="id" translate="no">${esc(f.path)}</span></div></div><div class="trail"><span class="pill gray">not in this repo</span></div></div>`).join('');
223
+ $('#insMeta').textContent=I.filter(f=>f.exists).length+' of '+I.length;
224
+ }
225
+ function fileRows(list){
226
+ return list.length?list.map(f=>{const fm=f.frontMatter||{};
227
+ return `<button type="button" class="row act" data-open="${esc(f.path)}"><span class="st hollow" aria-hidden="true"></span><div class="body"><div class="ttl"><span class="id" translate="no">${esc(f.path)}</span>${fm['argument-hint']!==undefined?`<span class="id" translate="no">${esc(fm['argument-hint'])}</span>`:''}</div>${fm.description!==undefined?`<div class="det">${esc(fm.description)}</div>`:''}</div><div class="trail">${fm['allowed-tools']!==undefined?`<span class="pill gray" translate="no">${esc(fm['allowed-tools'])}</span>`:''}${chev}</div></button>`;}).join('')
228
+ :'<div class="empty">No files here.</div>';
229
+ }
230
+ function renderAgentFiles(){
231
+ const N=DATA.nav;
232
+ $('#cmdBox').innerHTML=fileRows(N.commands);$('#cmdCnt').textContent=N.commands.length;
233
+ $('#prmBox').innerHTML=fileRows(N.prompts);$('#prmCnt').textContent=N.prompts.length;
234
+ $('#sklBox').innerHTML=fileRows(N.skills);$('#sklCnt').textContent=N.skills.length;
235
+ }
236
+ /* Inspector for a generated file: its front matter raw, its body rendered. */
237
+ /* Is this generated file in the latest /api/specs listing? */
238
+ function listed(path){const N=DATA.nav;return N.instructions.some(f=>f.exists&&f.path===path)||[N.commands,N.prompts,N.skills].some(l=>l.some(f=>f.path===path));}
239
+ async function openFile(path,quiet){
240
+ if(!quiet)lastFocus=document.activeElement;
241
+ let src=null;
242
+ if(listed(path))try{src=await getText(path);}catch(e){if(e.status!==404){if(!quiet)toast(e.message);return;}}
243
+ inspOpen={kind:'file',path};
244
+ const head=`<div class="ih"><span class="id" translate="no">${esc(path)}</span><button type="button" class="ib x" id="inspX" aria-label="Close Details"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-x"/></svg></button></div>`;
245
+ if(src===null){insp.innerHTML=head+`<div class="ib2">${gone(path)}</div>`;openInsp(quiet);return;}
246
+ const {fm,body}=splitFm(src);
247
+ insp.innerHTML=head+`<div class="ib2">${fm?`<div class="gl"><div class="gh">Front matter</div><div class="box"><pre class="raw" translate="no">${esc(fm)}</pre></div></div>`:''}<div class="md doc">${md(body)}</div></div>`;
248
+ openInsp(quiet);
249
+ }
250
+ document.addEventListener('click',e=>{const b=e.target.closest&&e.target.closest('[data-open]');if(b)openFile(b.dataset.open);});
251
+
252
+ /* ---------------- palette + keys ---------------- */
253
+ const palVeil=$('#palVeil'),palIn=$('#palIn'),palList=$('#palList');
254
+ function items(q){q=q.toLowerCase();
255
+ const T=DATA?DATA.tasks:null;
256
+ const it=[
257
+ ...NAV.map(n=>n[0]==='file'?{l:'.specs/'+n[1],k:'file',go:()=>go('file',false,n[1])}:{l:VIEWS[n[0]],k:'view',go:()=>go(n[0])}),
258
+ ...(DATA?DATA.nav.specs:[]).filter(p=>!NAV.some(n=>n[1]===p)).map(p=>({l:'.specs/'+p,k:'file',go:()=>go('file',false,p)})),
259
+ ...(T?['currentSprint','backlog','completed'].flatMap(c=>T[c].map((t,i)=>({l:t.id+' '+t.description,k:'task',go:()=>{go('board');openTask(c,i)}}))):[])
260
+ ];
261
+ return it.filter(i=>!q||i.l.toLowerCase().includes(q)).slice(0,9);}
262
+ function renderPal(){const it=items(palIn.value);palList.innerHTML=it.map((i,n)=>`<li class="${n===0?'on':''}" role="option" aria-selected="${n===0}" tabindex="0"><span class="lbl">${esc(i.l)}</span><span class="k">${esc(i.k)}</span></li>`).join('')||'<li class="empty">No matches</li>';$$('#palList li').forEach((li,n)=>{li.onclick=()=>{it[n]&&it[n].go();closePal();};li.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();li.click()}}});}
263
+ function openPal(){palVeil.classList.add('open');palIn.value='';renderPal();palIn.focus();}
264
+ function closePal(){palVeil.classList.remove('open');}
265
+ $('#palBtn').onclick=openPal;palIn.oninput=renderPal;palVeil.onclick=e=>{if(e.target===palVeil)closePal()};
266
+ palIn.onkeydown=e=>{if(e.key==='Enter'){const it=items(palIn.value);it[0]&&it[0].go();closePal();}};
267
+ document.addEventListener('keydown',e=>{
268
+ const mod=e.metaKey||e.ctrlKey;const inField=/INPUT|SELECT|TEXTAREA/.test(e.target.tagName);
269
+ if(mod&&e.key.toLowerCase()==='k'){e.preventDefault();palVeil.classList.contains('open')?closePal():openPal();return}
270
+ if(mod&&/^[1-9]$/.test(e.key)){e.preventDefault();const n=NAV[+e.key-1];if(n)go(n[0],false,n[1]);return}
271
+ if(e.key==='Escape'){hideTip();closeInsp();closePal();setNav(false);return}
272
+ if(inField||mod||e.altKey)return;
273
+ if(/^[1-9]$/.test(e.key)){const n=NAV[+e.key-1];if(n)go(n[0],false,n[1]);}
274
+ if((e.key==='j'||e.key==='k')&&curView==='board'){const rows=$$((mode==='board'?'#boardMode':'#listMode')+' .row[data-col]');if(!rows.length)return;let i=rows.findIndex(r=>r.dataset.col+':'+r.dataset.i===selected);i=e.key==='j'?Math.min(rows.length-1,i+1):Math.max(0,i-1);if(i<0)i=0;openTask(rows[i].dataset.col,+rows[i].dataset.i);rows[i].scrollIntoView({block:'nearest'});rows[i].focus();}
275
+ });
276
+
277
+ /* ---------------- live reload (BL-052) ----------------
278
+ On a change event: re-fetch, redraw in place. Route, scroll, open inspector, selected row
279
+ and focus stay where they were. If the server is gone, the last content stays on screen. */
280
+ function focusKey(el){
281
+ if(!el||el===document.body)return null;
282
+ const row=el.closest&&el.closest('.row[data-col][data-i]');
283
+ if(row){const t=DATA.tasks&&DATA.tasks[row.dataset.col][+row.dataset.i];return {row:row.dataset.col,id:t?t.id:null,i:+row.dataset.i,board:!!row.closest('#boardMode')};}
284
+ for(const a of ['data-open','data-file','data-more','data-disc'])if(el.hasAttribute&&el.hasAttribute(a))return {sel:`[${a}="${CSS.escape(el.getAttribute(a))}"]`};
285
+ if(el.id)return {sel:'#'+CSS.escape(el.id)};
286
+ return null;
287
+ }
288
+ /* Where a row with this ID sits now in that section: the occurrence nearest its old position. */
289
+ function findRow(col,id,oldI){
290
+ const rows=DATA.tasks?DATA.tasks[col]:[];let best=-1;
291
+ rows.forEach((t,i)=>{if(t.id===id&&(best<0||Math.abs(i-oldI)<Math.abs(best-oldI)))best=i;});
292
+ return best;
293
+ }
294
+ function refocus(key){
295
+ if(!key||document.activeElement&&document.activeElement!==document.body)return;
296
+ let el=null;
297
+ if(key.row){const i=findRow(key.row,key.id,key.i);if(i>=0)el=$(`${key.board?'#boardMode':'#listMode'} .row[data-col="${key.row}"][data-i="${i}"]`);}
298
+ else el=$(key.sel);
299
+ if(el)el.focus({preventScroll:true});
300
+ }
301
+ let refreshing=Promise.resolve();
302
+ function refresh(paths){refreshing=refreshing.then(()=>redraw(paths)).catch(()=>{});}
303
+ async function redraw(paths){
304
+ let d;
305
+ try{const r=await fetch('/api/specs',{cache:'no-store'});if(!r.ok)return;d=await r.json();}catch(e){return;} // server gone: keep what is shown
306
+ (paths||Object.keys(fileCache)).forEach(p=>{delete fileCache[p];});
307
+ const key=focusKey(document.activeElement);
308
+ const scroll=$('#content').scrollTop,ib0=insp.querySelector('.ib2'),inspScroll=ib0?ib0.scrollTop:0;
309
+ const was=inspOpen;
310
+ DATA=d;
311
+ renderProject();renderTasks();renderIde();renderAgentFiles();
312
+ if(curView==='file')await renderFile(curFile);
313
+ if(curView==='explorer')renderExplorer();
314
+ if(curView==='security')await renderSecurity();
315
+ if(was&&was.kind==='task'){
316
+ const i=findRow(was.col,was.id,was.i);
317
+ if(i>=0){openTask(was.col,i,true);$$(`#v-board .row[data-col="${was.col}"][data-i="${i}"]`).forEach(r=>r.classList.add('sel'));}
318
+ else{insp.classList.remove('open');insp.setAttribute('aria-hidden','true');selected=null;inspOpen=null;}
319
+ }
320
+ if(was&&was.kind==='file'&&(!paths||paths.includes(was.path)))await openFile(was.path,true);
321
+ $('#content').scrollTop=scroll;
322
+ const ib=insp.querySelector('.ib2');if(ib)ib.scrollTop=inspScroll;
323
+ refocus(key);
324
+ }
325
+ function listen(){
326
+ if(!window.EventSource)return;
327
+ const es=new EventSource('/api/events');let dropped=false;
328
+ es.addEventListener('change',e=>{let paths=null;try{paths=JSON.parse(e.data).paths;}catch(_){}refresh(Array.isArray(paths)?paths:null);});
329
+ es.onerror=()=>{dropped=true;}; // EventSource retries by itself
330
+ es.onopen=()=>{if(dropped){dropped=false;refresh(null);}}; // catch up on anything missed
331
+ }
332
+
333
+ /* boot */
334
+ insp.setAttribute('aria-hidden','true');
335
+ $('#gDone').classList.add('closed');
336
+ fetch('/api/specs',{cache:'no-store'})
337
+ .then(r=>{if(!r.ok)throw new Error('/api/specs: HTTP '+r.status);return r.json();})
338
+ .then(d=>{DATA=d;renderProject();renderTasks();renderIde();renderAgentFiles();route();listen();})
339
+ .catch(e=>showErr('Could not load the project: '+e.message));
340
+ })();
package/ui/favicon.svg ADDED
@@ -0,0 +1,25 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300" fill="none">
2
+ <rect width="300" height="300" rx="60" fill="url(#paint0_linear_18_9)"/>
3
+ <g filter="url(#filter0_d_18_9)">
4
+ <rect x="46.5" y="73.5" width="207.888" height="153" rx="76.5" stroke="white" stroke-width="41"/>
5
+ <circle cx="116.376" cy="150" r="16.561" fill="#FFFEFE"/>
6
+ <circle cx="116.376" cy="150" r="16.561" stroke="black"/>
7
+ <path d="M184.985 133.439C194.131 133.439 201.546 140.853 201.546 150C201.546 159.146 194.131 166.561 184.985 166.561C175.839 166.561 168.424 159.146 168.424 150C168.425 140.854 175.839 133.439 184.985 133.439Z" fill="white"/>
8
+ <path d="M184.985 133.439C194.131 133.439 201.546 140.853 201.546 150C201.546 159.146 194.131 166.561 184.985 166.561C175.839 166.561 168.424 159.146 168.424 150C168.425 140.854 175.839 133.439 184.985 133.439Z" stroke="black"/>
9
+ </g>
10
+ <defs>
11
+ <filter id="filter0_d_18_9" x="24" y="52" width="252.888" height="198" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
12
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
13
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
14
+ <feOffset dy="1"/>
15
+ <feGaussianBlur stdDeviation="1"/>
16
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"/>
17
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_9"/>
18
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_9" result="shape"/>
19
+ </filter>
20
+ <linearGradient id="paint0_linear_18_9" x1="150" y1="0" x2="150" y2="300" gradientUnits="userSpaceOnUse">
21
+ <stop stop-color="#1481FC"/>
22
+ <stop offset="1" stop-color="#0077FF"/>
23
+ </linearGradient>
24
+ </defs>
25
+ </svg>
package/ui/index.html ADDED
@@ -0,0 +1,171 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>SpecPilot Local</title>
7
+ <meta name="theme-color" content="#0f172a">
8
+ <link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
9
+ <link rel="stylesheet" href="/assets/app.css">
10
+ <script src="/assets/md.js" defer></script>
11
+ <script src="/assets/route.js" defer></script>
12
+ <script src="/assets/app.js" defer></script>
13
+ </head>
14
+ <body>
15
+ <svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><defs>
16
+ <symbol id="logo" viewBox="0 0 300 300" fill="none">
17
+ <rect width="300" height="300" rx="60" fill="url(#paint0_linear_18_9)"/>
18
+ <g filter="url(#filter0_d_18_9)">
19
+ <rect x="46.5" y="73.5" width="207.888" height="153" rx="76.5" stroke="white" stroke-width="41"/>
20
+ <circle cx="116.376" cy="150" r="16.561" fill="#FFFEFE"/>
21
+ <circle cx="116.376" cy="150" r="16.561" stroke="black"/>
22
+ <path d="M184.985 133.439C194.131 133.439 201.546 140.853 201.546 150C201.546 159.146 194.131 166.561 184.985 166.561C175.839 166.561 168.424 159.146 168.424 150C168.425 140.854 175.839 133.439 184.985 133.439Z" fill="white"/>
23
+ <path d="M184.985 133.439C194.131 133.439 201.546 140.853 201.546 150C201.546 159.146 194.131 166.561 184.985 166.561C175.839 166.561 168.424 159.146 168.424 150C168.425 140.854 175.839 133.439 184.985 133.439Z" stroke="black"/>
24
+ </g>
25
+ <defs>
26
+ <filter id="filter0_d_18_9" x="24" y="52" width="252.888" height="198" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
27
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
28
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
29
+ <feOffset dy="1"/>
30
+ <feGaussianBlur stdDeviation="1"/>
31
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"/>
32
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_9"/>
33
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_9" result="shape"/>
34
+ </filter>
35
+ <linearGradient id="paint0_linear_18_9" x1="150" y1="0" x2="150" y2="300" gradientUnits="userSpaceOnUse">
36
+ <stop stop-color="#1481FC"/>
37
+ <stop offset="1" stop-color="#0077FF"/>
38
+ </linearGradient>
39
+ <symbol id="i-term" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 10l3 2.5-3 2.5M13 15h4"/></symbol>
40
+ <symbol id="i-spark" viewBox="0 0 24 24"><path d="M12 3l1.7 4.8L18.5 9.5l-4.8 1.7L12 16l-1.7-4.8L5.5 9.5l4.8-1.7z"/><path d="M18 15.5l.8 2.2 2.2.8-2.2.8-.8 2.2-.8-2.2-2.2-.8 2.2-.8z"/></symbol>
41
+ </defs>
42
+ </symbol>
43
+ <symbol id="i-board" viewBox="0 0 24 24"><rect x="3" y="4" width="5" height="16" rx="1"/><rect x="10" y="4" width="5" height="10" rx="1"/><rect x="17" y="4" width="4" height="13" rx="1"/></symbol>
44
+ <symbol id="i-map" viewBox="0 0 24 24"><path d="M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2z"/><path d="M9 4v14M15 6v14"/></symbol>
45
+ <symbol id="i-req" viewBox="0 0 24 24"><path d="M9 6h11M9 12h11M9 18h11"/><path d="M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"/></symbol>
46
+ <symbol id="i-folder" viewBox="0 0 24 24"><path d="M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></symbol>
47
+ <symbol id="i-arch" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="8.5" y="14" width="7" height="7" rx="1"/><path d="M6.5 10v2h11v-2M12 12v2"/></symbol>
48
+ <symbol id="i-test" viewBox="0 0 24 24"><path d="M9 3h6M10 3v6l-5.5 9a2 2 0 001.7 3h11.6a2 2 0 001.7-3L14 9V3"/><path d="M7 15h10"/></symbol>
49
+ <symbol id="i-shield" viewBox="0 0 24 24"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/><path d="M9 12l2 2 4-4"/></symbol>
50
+ <symbol id="i-bot" viewBox="0 0 24 24"><rect x="4" y="8" width="16" height="12" rx="2"/><path d="M12 8V4M8 4h8"/><circle cx="9" cy="14" r="1"/><circle cx="15" cy="14" r="1"/></symbol>
51
+ <symbol id="i-plus" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></symbol>
52
+ <symbol id="i-gear" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.7 1.7 0 00-1.8-.3 1.7 1.7 0 00-1 1.5V21a2 2 0 11-4 0v-.1a1.7 1.7 0 00-1.1-1.5 1.7 1.7 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.7 1.7 0 00.3-1.8 1.7 1.7 0 00-1.5-1H3a2 2 0 110-4h.1a1.7 1.7 0 001.5-1.1 1.7 1.7 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.7 1.7 0 001.8.3H9a1.7 1.7 0 001-1.5V3a2 2 0 114 0v.1a1.7 1.7 0 001 1.5 1.7 1.7 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.7 1.7 0 00-.3 1.8V9a1.7 1.7 0 001.5 1H21a2 2 0 110 4h-.1a1.7 1.7 0 00-1.5 1z"/></symbol>
53
+ <symbol id="i-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></symbol>
54
+ <symbol id="i-x" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18"/></symbol>
55
+ <symbol id="i-file" viewBox="0 0 24 24"><path d="M6 3h8l4 4v14H6z"/><path d="M14 3v4h4"/></symbol>
56
+ <symbol id="i-play" viewBox="0 0 24 24"><path d="M7 5l12 7-12 7z"/></symbol>
57
+ <symbol id="i-git" viewBox="0 0 24 24"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><circle cx="18" cy="8" r="2.5"/><path d="M6 8.5v7M18 10.5c0 4-12 2-12 5"/></symbol>
58
+ <symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 7h16M4 12h16M4 17h16"/></symbol>
59
+ <symbol id="i-hd" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 12h18M7 16h2"/></symbol>
60
+ <symbol id="i-search" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></symbol>
61
+ <symbol id="i-ext" viewBox="0 0 24 24"><path d="M14 4h6v6M20 4l-9 9"/><path d="M19 14v5a1 1 0 01-1 1H5a1 1 0 01-1-1V6a1 1 0 011-1h5"/></symbol>
62
+ <symbol id="i-chev" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
63
+ <symbol id="i-arrow" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></symbol>
64
+ <symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12l5 5L20 7"/></symbol>
65
+ </defs></svg>
66
+
67
+ <a class="skip" href="#content">Skip to Content</a>
68
+ <div class="win" id="win">
69
+ <nav class="rail" id="rail" aria-label="Projects">
70
+ <svg class="logo" aria-hidden="true" focusable="false"><use href="#logo"/></svg>
71
+ <div class="rsep" aria-hidden="true"></div>
72
+ <div class="rlist" id="projList" role="group" aria-label="Open projects"></div>
73
+ <div class="rfoot">
74
+ <button class="tile ghost" id="themeBtn" aria-label="Switch between light and dark" data-tip="Light / dark"><svg aria-hidden="true" focusable="false"><use href="#i-sun"/></svg></button>
75
+ </div>
76
+ </nav>
77
+ <aside class="src" id="src">
78
+ <div class="top"><b id="curGrp" translate="no"></b><span class="br mono" id="curBranch" translate="no"></span></div>
79
+ <button class="search" id="palBtn"><svg class="ico ico-13" aria-hidden="true" focusable="false"><use href="#i-search"/></svg>Search<kbd>&#8984;K</kbd></button>
80
+ <div class="snav">
81
+ <div class="grp" id="gPlan">Plan</div>
82
+ <div role="group" aria-labelledby="gPlan">
83
+ <button class="srow on" data-v="board"><svg aria-hidden="true" focusable="false"><use href="#i-board"/></svg><span class="t">Tasks</span><span class="meta" translate="no">tasks.md</span></button>
84
+ <button class="srow" data-v="file" data-f="planning/roadmap.md"><svg aria-hidden="true" focusable="false"><use href="#i-map"/></svg><span class="t">Roadmap</span><span class="meta" translate="no">roadmap.md</span></button>
85
+ <button class="srow" data-v="file" data-f="project/requirements.md"><svg aria-hidden="true" focusable="false"><use href="#i-req"/></svg><span class="t">Requirements</span><span class="meta" translate="no">requirements.md</span></button>
86
+ </div>
87
+ <div class="grp" id="gSpecs">Specs</div>
88
+ <div role="group" aria-labelledby="gSpecs">
89
+ <button class="srow" data-v="explorer"><svg aria-hidden="true" focusable="false"><use href="#i-folder"/></svg><span class="t">Explorer</span><span class="meta" translate="no">.specs/</span></button>
90
+ <button class="srow" data-v="file" data-f="architecture/architecture.md"><svg aria-hidden="true" focusable="false"><use href="#i-arch"/></svg><span class="t">Architecture</span><span class="meta" translate="no">architecture/</span></button>
91
+ <button class="srow" data-v="file" data-f="quality/tests.md"><svg aria-hidden="true" focusable="false"><use href="#i-test"/></svg><span class="t">Tests</span><span class="meta" translate="no">quality/</span></button>
92
+ <button class="srow" data-v="security"><svg aria-hidden="true" focusable="false"><use href="#i-shield"/></svg><span class="t">Security</span><span class="meta" translate="no">security/</span></button>
93
+ </div>
94
+ <div class="grp" id="gAuto">Automation</div>
95
+ <div role="group" aria-labelledby="gAuto">
96
+ <button class="srow" data-v="instructions"><svg aria-hidden="true" focusable="false"><use href="#i-file"/></svg><span class="t">Instructions</span><span class="meta" id="insMeta" translate="no"></span></button>
97
+ <button class="srow" data-v="commands"><svg aria-hidden="true" focusable="false"><use href="#i-term"/></svg><span class="t">Commands</span><span class="meta" id="cmdMeta" translate="no">.claude/commands/</span></button>
98
+ <button class="srow" data-v="skills"><svg aria-hidden="true" focusable="false"><use href="#i-spark"/></svg><span class="t">Skills</span><span class="meta" id="sklMeta" translate="no">.claude/skills/</span></button>
99
+ </div>
100
+ </div>
101
+ <div class="foot"><span class="v" id="footAddr" title="Local server, read-only" translate="no"></span><span class="v ml-auto" id="footVer" translate="no"></span></div>
102
+ </aside>
103
+ <div class="scrim" id="scrim" hidden></div>
104
+
105
+ <main class="pane">
106
+ <div class="tb">
107
+ <button class="ib menu" id="menuBtn" aria-label="Show sidebar"><svg class="ico" aria-hidden="true" focusable="false"><use href="#i-menu"/></svg></button>
108
+ <div><h1 id="title">Tasks</h1><div class="sub"><span id="subName" translate="no"></span><span class="mono" id="subPath" translate="no"></span></div></div>
109
+ <div class="right">
110
+ <div class="seg" id="modeSeg"><button class="on" data-m="list">List</button><button data-m="board">Board</button></div>
111
+ </div>
112
+ </div>
113
+ <div class="content" id="content">
114
+ <p class="note" id="loadErr" hidden></p>
115
+
116
+ <!-- TASKS: the rows of planning/tasks.md, from readSpecs() -->
117
+ <section class="view on" id="v-board">
118
+ <div id="listMode">
119
+ <div class="gl" id="gSprint" data-col="currentSprint"></div>
120
+ <div class="gl mt18" id="gBacklog" data-col="backlog"></div>
121
+ <div class="gl mt18" id="gDone" data-col="completed"></div>
122
+ </div>
123
+ <div id="boardMode" class="board" hidden></div>
124
+ <div class="gl" id="gRaw" hidden></div>
125
+ <div class="gl" id="gConv"></div>
126
+ </section>
127
+
128
+ <!-- EXPLORER: the .specs/ folder -->
129
+ <section class="view" id="v-explorer">
130
+ <div id="exBody"></div>
131
+ <p class="note" id="exNote"></p>
132
+ </section>
133
+
134
+ <!-- SECURITY: both files in security/, each as written -->
135
+ <section class="view" id="v-security">
136
+ <div id="secBody"></div>
137
+ </section>
138
+
139
+ <!-- FILE: any .specs/ file, rendered as written -->
140
+ <section class="view" id="v-file">
141
+ <div class="gl" id="fmBox"></div>
142
+ <div class="md doc" id="fileBody"></div>
143
+ </section>
144
+
145
+ <!-- INSTRUCTIONS -->
146
+ <section class="view" id="v-instructions">
147
+ <div class="gl"><div class="gh">Instruction Files</div><div class="box" id="insBox"></div></div>
148
+ </section>
149
+
150
+ <!-- COMMANDS -->
151
+ <section class="view" id="v-commands">
152
+ <div class="gl"><div class="gh"><span translate="no">.claude/commands/</span> <span class="cnt" id="cmdCnt"></span></div><div class="box" id="cmdBox"></div></div>
153
+ <div class="gl"><div class="gh"><span translate="no">.github/prompts/</span> <span class="cnt" id="prmCnt"></span></div><div class="box" id="prmBox"></div></div>
154
+ </section>
155
+
156
+ <!-- SKILLS -->
157
+ <section class="view" id="v-skills">
158
+ <div class="gl"><div class="gh"><span translate="no">.claude/skills/</span> <span class="cnt" id="sklCnt"></span></div><div class="box" id="sklBox"></div></div>
159
+ </section>
160
+
161
+ </div>
162
+
163
+ <aside class="insp" id="insp" aria-label="Details"></aside>
164
+ </main>
165
+ </div>
166
+
167
+ <!-- PALETTE -->
168
+ <div class="veil pal-veil" id="palVeil"><div class="pal"><input id="palIn" type="search" name="q" aria-label="Search views, spec files and tasks" placeholder="Jump to a view, spec file or task…" autocomplete="off" spellcheck="false"><ul id="palList"></ul></div></div>
169
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
170
+ </body>
171
+ </html>