rapidkit 0.41.3 → 0.41.5

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.
Files changed (50) hide show
  1. package/README.md +5 -0
  2. package/contracts/agent-customization-pack.v1.json +5 -0
  3. package/contracts/artifact-remediation-plan.v1.json +163 -0
  4. package/contracts/extension-cli-compatibility.v1.json +2 -1
  5. package/contracts/runtime-command-surface.v1.json +2 -0
  6. package/dist/analyze-JYHEGUSH.js +1 -0
  7. package/dist/artifact-remediation-plan-HRR3WH7T.js +3 -0
  8. package/dist/autopilot-release-ZADU63OD.js +1 -0
  9. package/dist/chunk-2E6WGUN6.js +1 -0
  10. package/dist/{chunk-O74N26AD.js → chunk-3VI4Y7LZ.js} +1 -1
  11. package/dist/{chunk-C4ASE2DV.js → chunk-FI4VMG2I.js} +1 -1
  12. package/dist/{chunk-KZLRUBQ5.js → chunk-GDWLW7GF.js} +1 -1
  13. package/dist/{chunk-3CYEVV6H.js → chunk-HCJV2ITA.js} +1 -1
  14. package/dist/chunk-LRF6PQOZ.js +1 -0
  15. package/dist/{chunk-42ARJBM7.js → chunk-P5NZE2RV.js} +1 -1
  16. package/dist/{chunk-AM5OJWXF.js → chunk-Q4HEXEDW.js} +1 -1
  17. package/dist/{chunk-DKNVDNT4.js → chunk-SO2SSVWN.js} +1 -1
  18. package/dist/{chunk-XY3SGMAJ.js → chunk-T5GS4BUP.js} +1 -1
  19. package/dist/chunk-T7B3GF3Q.js +1 -0
  20. package/dist/{chunk-6UBWN4EE.js → chunk-THSTNVE3.js} +1 -1
  21. package/dist/{chunk-XRGBKUJO.js → chunk-TXUBE6KV.js} +1 -1
  22. package/dist/{chunk-HT3G7HOV.js → chunk-U5IRABWC.js} +32 -32
  23. package/dist/{chunk-GD6VML5K.js → chunk-U7TS7W2V.js} +2 -2
  24. package/dist/{create-XTKHAYH7.js → create-P3USIH52.js} +1 -1
  25. package/dist/{doctor-4UQZIELO.js → doctor-KYNACWFC.js} +1 -1
  26. package/dist/index.d.ts +5 -2
  27. package/dist/index.js +119 -119
  28. package/dist/{pipeline-ZCJ6NVRC.js → pipeline-SU3FJUKI.js} +1 -1
  29. package/dist/{workspace-VKUBU4M4.js → workspace-5DKOA7TN.js} +1 -1
  30. package/dist/{workspace-agent-sync-QJWXK3RT.js → workspace-agent-sync-HZ4UBSZ2.js} +1 -1
  31. package/dist/{workspace-context-I5OXR6XB.js → workspace-context-R3XWWLFP.js} +1 -1
  32. package/dist/workspace-explain-5RDFGHUN.js +1 -0
  33. package/dist/{workspace-foundation-V6SLZRBY.js → workspace-foundation-H6IPS4MW.js} +1 -1
  34. package/dist/{workspace-intelligence-4SGJDZ6H.js → workspace-intelligence-5BBKUJAG.js} +1 -1
  35. package/dist/{workspace-mcp-serve-4QN7ZU6C.js → workspace-mcp-serve-TQTJ4HWI.js} +1 -1
  36. package/dist/{workspace-model-R6XYEQZO.js → workspace-model-YAC5BKLL.js} +1 -1
  37. package/dist/workspace-run-P5UOJSLQ.js +1 -0
  38. package/dist/{workspace-verify-TEQWZOXM.js → workspace-verify-5RZSDKGR.js} +1 -1
  39. package/dist/{workspace-watch-WERGZE5P.js → workspace-watch-P2PGSYDD.js} +1 -1
  40. package/docs/commands-reference.md +2 -1
  41. package/docs/contracts/ARTIFACT_CATALOG.md +11 -0
  42. package/docs/contracts/README.md +1 -0
  43. package/package.json +1 -1
  44. package/dist/analyze-UTB3PNKM.js +0 -1
  45. package/dist/autopilot-release-GBH7PIIZ.js +0 -1
  46. package/dist/chunk-JU3VNLTY.js +0 -1
  47. package/dist/chunk-TSUQQTHI.js +0 -1
  48. package/dist/workspace-explain-YFKDZRVX.js +0 -1
  49. package/dist/workspace-run-QRT3JJDB.js +0 -1
  50. /package/dist/{chunk-GH674HP5.js → chunk-DAPZJHMN.js} +0 -0
@@ -1,11 +1,11 @@
1
- import {b,c,d}from'./chunk-XY3SGMAJ.js';import {d as d$1}from'./chunk-O74N26AD.js';import {b as b$1,f,a,g as g$1}from'./chunk-GBJBQ43T.js';import {n,k as k$1,b as b$2,j as j$1}from'./chunk-TSUQQTHI.js';import {j}from'./chunk-3PTJID76.js';import s from'path';import g from'fs-extra';var _=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var Se="workspace-operational-skill.v1";function je(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function pe(e){let t=je(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:Se,skillId:t,canonicalPath:f(t),title:e.title,triggers:[...e.triggers].sort((r,i)=>r.localeCompare(i)),requiredReports:[...e.requiredReports].sort((r,i)=>r.localeCompare(i)),scopedProjects:[...e.scopedProjects??[]].sort((r,i)=>r.localeCompare(i)),verificationCommands:[...e.verificationCommands],answerContractSections:[..._],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var ve="workspace-skills-index.v1";function de(e){let t=[...e.skills].sort((i,o)=>i.skillId.localeCompare(o.skillId)),r=e.inputsHash??b$2({skillIds:t.map(i=>i.skillId),paths:t.map(i=>i.canonicalPath)});return {schemaVersion:ve,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(i=>({skillId:i.skillId,path:i.canonicalPath,schemaVersion:i.schemaVersion,title:i.title}))}}var le=[".rapidkit/reports/INDEX.json",b,d$1],Pe=[{skillId:"rapidkit-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using RapidKit evidence before editing application code.",steps:["Read `.rapidkit/reports/INDEX.json` and identify fail/warn reports for the scoped project.","Read `.rapidkit/reports/doctor-last-run.json`, `doctor-project-last-run.json`, and project-scoped run evidence if present.","If a fix was requested, read `doctor-remediation-plan-last-run.json` before editing and `doctor-fix-result-last-run.json` before claiming completion.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."]},{skillId:"rapidkit-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed RapidKit gates.",steps:["Read `.rapidkit/reports/release-readiness-last-run.json` and `pipeline-last-run.json`.","Read `.rapidkit/reports/workspace-verify-last-run.json` for verdict and blocking reasons.","List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."]},{skillId:"rapidkit-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Require project-scoped test/build commands before promoting the migration.","Document rollback and verification signals."]},{skillId:"rapidkit-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Prefer workspace run test/build for affected projects.","Re-run `workspace verify` after evidence refresh."]},{skillId:"rapidkit-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:["Read `.rapidkit/workspace.contract.json` for publishes/consumes/owns edges.","List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."]}];function D(e){return `npx rapidkit ${e}`.trim()}function Ce(e){let t=[`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",...le.map(r=>`- \`${r}\``),"","## Procedure","",...e.template.steps.map((r,i)=>`${i+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",D("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
1
+ import {b,c,d}from'./chunk-T5GS4BUP.js';import {d as d$1}from'./chunk-3VI4Y7LZ.js';import {b as b$1,f,a,g as g$1}from'./chunk-GBJBQ43T.js';import {n,k as k$1,b as b$2,j as j$1}from'./chunk-LRF6PQOZ.js';import {j}from'./chunk-3PTJID76.js';import s from'path';import g from'fs-extra';var _=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var Se="workspace-operational-skill.v1";function je(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function pe(e){let t=je(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:Se,skillId:t,canonicalPath:f(t),title:e.title,triggers:[...e.triggers].sort((r,i)=>r.localeCompare(i)),requiredReports:[...e.requiredReports].sort((r,i)=>r.localeCompare(i)),scopedProjects:[...e.scopedProjects??[]].sort((r,i)=>r.localeCompare(i)),verificationCommands:[...e.verificationCommands],answerContractSections:[..._],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var ve="workspace-skills-index.v1";function de(e){let t=[...e.skills].sort((i,o)=>i.skillId.localeCompare(o.skillId)),r=e.inputsHash??b$2({skillIds:t.map(i=>i.skillId),paths:t.map(i=>i.canonicalPath)});return {schemaVersion:ve,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(i=>({skillId:i.skillId,path:i.canonicalPath,schemaVersion:i.schemaVersion,title:i.title}))}}var le=[".rapidkit/reports/INDEX.json",b,d$1],Pe=[{skillId:"rapidkit-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using RapidKit evidence before editing application code.",steps:["Read `.rapidkit/reports/INDEX.json` and identify fail/warn reports for the scoped project.","Read `.rapidkit/reports/doctor-last-run.json`, `doctor-project-last-run.json`, and project-scoped run evidence if present.","If a fix was requested, read `artifact-remediation-plan-last-run.json` for cross-artifact next steps, then `doctor-remediation-plan-last-run.json` for Doctor-specific file edits.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."]},{skillId:"rapidkit-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed RapidKit gates.",steps:["Read `.rapidkit/reports/release-readiness-last-run.json` and `pipeline-last-run.json`.","Read `.rapidkit/reports/workspace-verify-last-run.json` for verdict and blocking reasons.","Read `.rapidkit/reports/artifact-remediation-plan-last-run.json` when a Studio or agent repair path is needed.","List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."]},{skillId:"rapidkit-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Require project-scoped test/build commands before promoting the migration.","Document rollback and verification signals."]},{skillId:"rapidkit-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Prefer workspace run test/build for affected projects.","Re-run `workspace verify` after evidence refresh."]},{skillId:"rapidkit-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:["Read `.rapidkit/workspace.contract.json` for publishes/consumes/owns edges.","List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."]}];function D(e){return `npx rapidkit ${e}`.trim()}function Ce(e){let t=[`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",...le.map(r=>`- \`${r}\``),"","## Procedure","",...e.template.steps.map((r,i)=>`${i+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",D("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
2
2
  `)}function Ee(e){return e?.safeCommands?.length?e.safeCommands.slice(0,8).map(t=>t.display):[D("workspace verify --json"),D("doctor workspace --json")]}function Ie(e){return e?.projects?.length?e.projects.slice(0,12).map(r=>{let i=r.contracts.owns.join(", ")||"none",o=r.contracts.publishes.join(", ")||"none",p=r.contracts.consumes.join(", ")||"none";return `- **${r.slug}**: owns \`${i}\`; publishes \`${o}\`; consumes \`${p}\``}).join(`
3
3
  `):void 0}function ue(e){let t=e.model.workspace.name,r=e.model.projects.map(p=>p.name).sort(),i=Ee(e.context??null),o=Ie(e.contract??null);return Pe.map(p=>{let c=Ce({template:p,workspaceName:t,scopedProjects:r,verificationCommands:i,contractSummary:o});return pe({skillId:p.skillId,title:p.title,triggers:p.triggers,requiredReports:[...le],scopedProjects:r,verificationCommands:i,promptStem:g$1[p.skillId],markdown:c})})}async function ge(e){let t=s.resolve(e.workspacePath),r=[],i=b$2({skills:e.skills.map(p=>({id:p.skillId,path:p.canonicalPath,hash:b$2({markdown:p.markdown})}))}),o=de({generatedAt:e.generatedAt,skills:e.skills,inputsHash:i});if(e.write){for(let c of e.skills){let n=s.join(t,c.canonicalPath);await g.ensureDir(s.dirname(n)),await g.writeFile(n,c.markdown,"utf8"),r.push(c.canonicalPath);}let p=s.join(t,b$1);await g.ensureDir(s.dirname(p)),await g.writeJson(p,o,{spaces:2}),r.push(b$1);}return {skills:e.skills,index:o,writtenPaths:r}}function me(e){return ["## Operational skills (canonical)","","Read workspace-native playbooks from `.rapidkit/skills/` before generic repo scans:","",...e.skills.map(r=>`- \`${r.path}\` \u2014 ${r.title} (\`${r.skillId}\`)`),"","Regenerate:","","```bash",D("workspace agent-sync --write --refresh-context"),"```",""].join(`
4
4
  `)}var Oe={"rapidkit-diagnose-api-failure":".github/prompts/rapidkit-diagnose.prompt.md","rapidkit-release-readiness":".github/prompts/rapidkit-release-readiness.prompt.md"},B="## Workspace verification (hydrated)";function Te(e){let t=[B,"","Verification commands for this workspace:","",...e.verificationCommands.length?e.verificationCommands.map(r=>`- \`${r}\``):["- `npx rapidkit workspace verify --json`"]];return e.scopedProjects.length>0&&t.push("","Scoped projects:","",...e.scopedProjects.map(r=>`- ${r}`)),t.push(""),t.join(`
5
5
  `)}async function ke(e){let t=s.resolve(e.workspacePath),r=[];for(let i of e.skills){let o=Oe[i.skillId];if(!o)continue;let p=s.join(t,o);if(!await g.pathExists(p))continue;let c=await g.readFile(p,"utf8"),n=Te(i),m=c.includes(B)?c.replace(new RegExp(`${B}[\\s\\S]*$`),n.trimEnd()):`${c.trimEnd()}
6
6
 
7
7
  ${n}`;e.write&&await g.writeFile(p,`${m.trimEnd()}
8
- `,"utf8"),r.push(o);}return r}var We="rapidkit-agent-customization-pack.v1";function fe(){return {schemaVersion:We,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md"]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md",".github/instructions/rapidkit-workspace.instructions.md",".github/prompts/rapidkit-diagnose.prompt.md",".github/skills/rapidkit-workspace-intelligence/SKILL.md",".github/agents/workspai-advisor.agent.md",".rapidkit/reports/rapidkit-mcp-design.json",b$1]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding for any agent.",outputFamilies:["portable"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},orca:{meaning:"Use AGENTS.md and the report index as the Orca/Grok grounding layer.",outputFamilies:["portable"]}},standardAnswerContract:[..._],requiredReports:O.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".rapidkit/reports/",`${a}/`],l2PrefixedMirrorRoots:[".github/",".cursor/",".claude/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md"]}}}var Ne="rapidkit-agent-reports-index.v1",_e="rapidkit-agent-customization-pack.v1",J=".rapidkit/reports/INDEX.json",he=".rapidkit/AGENT-GROUNDING.md",G=".rapidkit/reports/agent-customization-pack.json",O=[{relativePath:b,label:"Agent context pack",required:true},{relativePath:b$1,label:"Operational skills index",required:true},{relativePath:".rapidkit/reports/workspace-model.json",label:"Workspace model graph",required:false},{relativePath:".rapidkit/reports/doctor-last-run.json",label:"Workspace doctor",required:false},{relativePath:".rapidkit/reports/doctor-project-last-run.json",label:"Project doctor",required:false},{relativePath:".rapidkit/reports/doctor-remediation-plan-last-run.json",label:"Doctor remediation plan",required:false},{relativePath:".rapidkit/reports/doctor-fix-result-last-run.json",label:"Doctor fix result",required:false},{relativePath:".rapidkit/reports/analyze-last-run.json",label:"Workspace analyze",required:false},{relativePath:".rapidkit/reports/pipeline-last-run.json",label:"Governance pipeline",required:false},{relativePath:".rapidkit/reports/release-readiness-last-run.json",label:"Release readiness",required:false},{relativePath:".rapidkit/reports/workspace-impact-last-run.json",label:"Workspace impact",required:false},{relativePath:".rapidkit/reports/workspace-verify-last-run.json",label:"Workspace verify",required:false},{relativePath:".rapidkit/reports/workspace-model-snapshot.json",label:"Workspace model snapshot",required:false},{relativePath:".rapidkit/reports/workspace-model-diff-last-run.json",label:"Workspace model diff",required:false},{relativePath:".rapidkit/reports/workspace-explain-last-run.json",label:"Workspace explain",required:false},{relativePath:".rapidkit/reports/workspace-contract-verify-last-run.json",label:"Workspace contract verify",required:false},{relativePath:".rapidkit/reports/workspace-intelligence-history.json",label:"Workspace intelligence history",required:false}];function k(e){return `npx rapidkit ${e}`.trim()}function be(e){return e&&typeof e=="object"?e:null}function Z(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function De(e){let t=Z(e.blockers,12);if(t.length>0)return t;let r=Z(e.blockingReasons,12);if(r.length>0)return r;let i=be(e.summary);return i&&Array.isArray(i.blockingReasons)?Z(i.blockingReasons,12):[]}function Ge(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function Ke(e,t,r){if(!e)return true;let i=Date.parse(e);return Number.isFinite(i)?r.getTime()-i>t*60*60*1e3:true}function Le(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function w(e,t){return e.has("all")||e.has(t)}function Me(e){return w(e,"copilot")||w(e,"vscode")}function qe(e){return e??"enterprise"}function $e(e){return e===b$1?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":e.startsWith(".rapidkit/skills/")&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e.endsWith("rapidkit-agent-hooks.json")?"hook":e.includes("mcp")||e.endsWith("rapidkit-mcp-design.json")?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function He(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Ve(e,t){return fe().presets[t].requiredOutputs.includes(e)}function ze(e){return e.schemaVersion===j$1&&typeof e.generatedAt=="string"&&e.summary!=null&&typeof e.summary=="object"&&!Array.isArray(e.summary)&&Array.isArray(e.projects)}async function Fe(e,t){if(t)return t;let r=s.join(e,k$1);if(await g.pathExists(r))try{let i=await g.readJson(r);if(ze(i))return i}catch{}return n({workspacePath:e,includeEvidence:true})}function Ue(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Xe(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(i=>i.targets.includes(r)).map(i=>i.path).sort()}]))}async function Be(e){try{if(!await g.pathExists(e))return null;let t=await g.readJson(e);return be(t)}catch{return null}}async function we(e){let t=e.now??new Date,r=e.staleAfterHours??24,i=[],o=[];for(let c of O){let n=s.join(e.workspacePath,c.relativePath),m=await Be(n),j=m!==null;j&&m&&o.push(...De(m)),i.push({path:c.relativePath,label:c.label,required:c.required,exists:j,generatedAt:m?Ge(m):void 0,commandId:typeof m?.commandId=="string"?m.commandId:void 0,exitCode:typeof m?.exitCode=="number"?m.exitCode:void 0});}let p=[...new Set(o.map(c=>c.trim()).filter(Boolean))].slice(0,16);return {schemaVersion:Ne,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,readOrder:O.map(c=>c.relativePath),blockers:p,staleAfterHours:r,reports:i,refreshCommand:k("workspace agent-sync --write --refresh-context")}}function Ae(e){let t=["# RapidKit agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","","1. `.rapidkit/reports/INDEX.json` \u2014 latest blockers, timestamps, and report paths","2. `.rapidkit/reports/workspace-context-agent.json` \u2014 canonical agent context pack","3. Evidence artifacts listed in the index (doctor, analyze, pipeline, readiness, impact, verify)","","Do **not** full-repo scan until these reports are read or regenerated.","","## Regenerate intelligence","","```bash",k("workspace agent-sync --write --refresh-context"),k("workspace context --for-agent --json --write"),k("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t.push(`- ${r}`);t.push("");}if(e.context?.safeCommands?.length){t.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t.push(`- \`${r.display}\` \u2014 ${r.description}`);t.push("");}return t.push("## Rules","","- Treat `.rapidkit/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic RapidKit CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.",""),t.join(`
8
+ `,"utf8"),r.push(o);}return r}var We="rapidkit-agent-customization-pack.v1";function fe(){return {schemaVersion:We,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md"]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md",".github/instructions/rapidkit-workspace.instructions.md",".github/prompts/rapidkit-diagnose.prompt.md",".github/skills/rapidkit-workspace-intelligence/SKILL.md",".github/agents/workspai-advisor.agent.md",".rapidkit/reports/rapidkit-mcp-design.json",b$1]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding for any agent.",outputFamilies:["portable"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},orca:{meaning:"Use AGENTS.md and the report index as the Orca/Grok grounding layer.",outputFamilies:["portable"]}},standardAnswerContract:[..._],requiredReports:O.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".rapidkit/reports/",`${a}/`],l2PrefixedMirrorRoots:[".github/",".cursor/",".claude/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md"]}}}var Ne="rapidkit-agent-reports-index.v1",_e="rapidkit-agent-customization-pack.v1",J=".rapidkit/reports/INDEX.json",he=".rapidkit/AGENT-GROUNDING.md",G=".rapidkit/reports/agent-customization-pack.json",O=[{relativePath:b,label:"Agent context pack",required:true},{relativePath:b$1,label:"Operational skills index",required:true},{relativePath:".rapidkit/reports/workspace-model.json",label:"Workspace model graph",required:false},{relativePath:".rapidkit/reports/doctor-last-run.json",label:"Workspace doctor",required:false},{relativePath:".rapidkit/reports/doctor-project-last-run.json",label:"Project doctor",required:false},{relativePath:".rapidkit/reports/doctor-remediation-plan-last-run.json",label:"Doctor remediation plan",required:false},{relativePath:".rapidkit/reports/artifact-remediation-plan-last-run.json",label:"Artifact remediation plan",required:false},{relativePath:".rapidkit/reports/doctor-fix-result-last-run.json",label:"Doctor fix result",required:false},{relativePath:".rapidkit/reports/analyze-last-run.json",label:"Workspace analyze",required:false},{relativePath:".rapidkit/reports/pipeline-last-run.json",label:"Governance pipeline",required:false},{relativePath:".rapidkit/reports/release-readiness-last-run.json",label:"Release readiness",required:false},{relativePath:".rapidkit/reports/workspace-impact-last-run.json",label:"Workspace impact",required:false},{relativePath:".rapidkit/reports/workspace-verify-last-run.json",label:"Workspace verify",required:false},{relativePath:".rapidkit/reports/workspace-model-snapshot.json",label:"Workspace model snapshot",required:false},{relativePath:".rapidkit/reports/workspace-model-diff-last-run.json",label:"Workspace model diff",required:false},{relativePath:".rapidkit/reports/workspace-explain-last-run.json",label:"Workspace explain",required:false},{relativePath:".rapidkit/reports/workspace-contract-verify-last-run.json",label:"Workspace contract verify",required:false},{relativePath:".rapidkit/reports/workspace-intelligence-history.json",label:"Workspace intelligence history",required:false}];function k(e){return `npx rapidkit ${e}`.trim()}function be(e){return e&&typeof e=="object"?e:null}function Z(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function De(e){let t=Z(e.blockers,12);if(t.length>0)return t;let r=Z(e.blockingReasons,12);if(r.length>0)return r;let i=be(e.summary);return i&&Array.isArray(i.blockingReasons)?Z(i.blockingReasons,12):[]}function Ge(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function Ke(e,t,r){if(!e)return true;let i=Date.parse(e);return Number.isFinite(i)?r.getTime()-i>t*60*60*1e3:true}function Le(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function w(e,t){return e.has("all")||e.has(t)}function Me(e){return w(e,"copilot")||w(e,"vscode")}function qe(e){return e??"enterprise"}function $e(e){return e===b$1?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":e.startsWith(".rapidkit/skills/")&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e.endsWith("rapidkit-agent-hooks.json")?"hook":e.includes("mcp")||e.endsWith("rapidkit-mcp-design.json")?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function He(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Ve(e,t){return fe().presets[t].requiredOutputs.includes(e)}function ze(e){return e.schemaVersion===j$1&&typeof e.generatedAt=="string"&&e.summary!=null&&typeof e.summary=="object"&&!Array.isArray(e.summary)&&Array.isArray(e.projects)}async function Fe(e,t){if(t)return t;let r=s.join(e,k$1);if(await g.pathExists(r))try{let i=await g.readJson(r);if(ze(i))return i}catch{}return n({workspacePath:e,includeEvidence:true})}function Ue(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Xe(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(i=>i.targets.includes(r)).map(i=>i.path).sort()}]))}async function Be(e){try{if(!await g.pathExists(e))return null;let t=await g.readJson(e);return be(t)}catch{return null}}async function we(e){let t=e.now??new Date,r=e.staleAfterHours??24,i=[],o=[];for(let c of O){let n=s.join(e.workspacePath,c.relativePath),m=await Be(n),j=m!==null;j&&m&&o.push(...De(m)),i.push({path:c.relativePath,label:c.label,required:c.required,exists:j,generatedAt:m?Ge(m):void 0,commandId:typeof m?.commandId=="string"?m.commandId:void 0,exitCode:typeof m?.exitCode=="number"?m.exitCode:void 0});}let p=[...new Set(o.map(c=>c.trim()).filter(Boolean))].slice(0,16);return {schemaVersion:Ne,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,readOrder:O.map(c=>c.relativePath),blockers:p,staleAfterHours:r,reports:i,refreshCommand:k("workspace agent-sync --write --refresh-context")}}function Ae(e){let t=["# RapidKit agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","","1. `.rapidkit/reports/INDEX.json` \u2014 latest blockers, timestamps, and report paths","2. `.rapidkit/reports/workspace-context-agent.json` \u2014 canonical agent context pack","3. Evidence artifacts listed in the index (doctor, analyze, pipeline, readiness, impact, verify)","","Do **not** full-repo scan until these reports are read or regenerated.","","## Regenerate intelligence","","```bash",k("workspace agent-sync --write --refresh-context"),k("workspace context --for-agent --json --write"),k("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t.push(`- ${r}`);t.push("");}if(e.context?.safeCommands?.length){t.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t.push(`- \`${r.display}\` \u2014 ${r.description}`);t.push("");}return t.push("## Rules","","- Treat `.rapidkit/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic RapidKit CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.",""),t.join(`
9
9
  `)}function Je(e){return ["# RapidKit agent grounding","",`Generated: ${e.generatedAt}`,"","This file is tool-agnostic. Synced agents should read it together with `.rapidkit/reports/INDEX.json`.","","## Mandatory read order","",...e.readOrder.map((t,r)=>`${r+1}. \`${t}\``),"",e.blockers.length>0?"## Blockers":"",...e.blockers.length>0?e.blockers.map(t=>`- ${t}`):[],"","## Refresh","","```bash",e.refreshCommand,"```",""].filter(t=>t!=="").join(`
10
10
  `)}function Ze(){return ["# RapidKit workspace grounding","","Before answering workspace, release, or architecture questions:","","1. Read `AGENTS.md` (managed RapidKit section).","2. Read `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","3. Use evidence reports before scanning the full repository.","","Regenerate stale intelligence:","","```bash",k("workspace agent-sync --write --refresh-context"),"```",""].join(`
11
11
  `)}function Ye(){return ["## Claude Code","","- Load `.rapidkit/reports/INDEX.json` before diagnosing blockers.","- Use `.claude/rules/rapidkit-evidence.md` when editing files under `.rapidkit/`.","- Refresh grounding with `npx rapidkit workspace agent-sync --write`.",""].join(`
@@ -1 +1 @@
1
- export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-42ARJBM7.js';
1
+ export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-P5NZE2RV.js';
@@ -1 +1 @@
1
- export{b as computeDoctorGateExitCode,a as resolveDoctorPolicyProfile,c as runDoctor}from'./chunk-HT3G7HOV.js';
1
+ export{b as computeDoctorGateExitCode,a as resolveDoctorPolicyProfile,c as runDoctor}from'./chunk-U5IRABWC.js';
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ declare function getPublishedContractVersions(): {
19
19
  workspaceExplain: "workspace-explain.v1";
20
20
  agentActionOutcome: "agent-action-outcome.v1";
21
21
  doctorRemediationPlan: "doctor-remediation-plan-v2";
22
+ artifactRemediationPlan: "artifact-remediation-plan-v1";
22
23
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
23
24
  };
24
25
 
@@ -55,6 +56,7 @@ declare function getVersionContract(): {
55
56
  workspaceExplain: "workspace-explain.v1";
56
57
  agentActionOutcome: "agent-action-outcome.v1";
57
58
  doctorRemediationPlan: "doctor-remediation-plan-v2";
59
+ artifactRemediationPlan: "artifact-remediation-plan-v1";
58
60
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
59
61
  };
60
62
  };
@@ -82,6 +84,7 @@ declare function getGlobalCommandCapabilities(): {
82
84
  workspaceExplain: "workspace-explain.v1";
83
85
  agentActionOutcome: "agent-action-outcome.v1";
84
86
  doctorRemediationPlan: "doctor-remediation-plan-v2";
87
+ artifactRemediationPlan: "artifact-remediation-plan-v1";
85
88
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
86
89
  };
87
90
  commands: {
@@ -91,8 +94,8 @@ declare function getGlobalCommandCapabilities(): {
91
94
  };
92
95
  workspace: {
93
96
  command: string;
94
- subcommands: ("init" | "import" | "snapshot" | "archive" | "list" | "diff" | "sync" | "registry" | "foundation" | "model" | "impact" | "verify" | "graph" | "watch" | "context" | "agent-sync" | "explain" | "why" | "trace" | "feedback" | "mcp" | "policy" | "contract" | "share" | "export" | "hydrate" | "run")[];
95
- intelligenceSubcommands: ("snapshot" | "diff" | "model" | "impact" | "verify" | "context" | "agent-sync" | "explain" | "why" | "trace")[];
97
+ subcommands: ("init" | "import" | "snapshot" | "archive" | "list" | "diff" | "sync" | "registry" | "foundation" | "model" | "impact" | "verify" | "graph" | "watch" | "context" | "agent-sync" | "remediation-plan" | "explain" | "why" | "trace" | "feedback" | "mcp" | "policy" | "contract" | "share" | "export" | "hydrate" | "run")[];
98
+ intelligenceSubcommands: ("snapshot" | "diff" | "model" | "impact" | "verify" | "context" | "agent-sync" | "remediation-plan" | "explain" | "why" | "trace")[];
96
99
  };
97
100
  commandMap: any;
98
101
  };